Skip to content

Commit 50aad79

Browse files
init
1 parent ff990fb commit 50aad79

File tree

118 files changed

+6640
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+6640
-0
lines changed

.babelrc.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"sourceType": "unambiguous",
3+
"presets": [
4+
[
5+
"@babel/preset-env",
6+
{
7+
"targets": {
8+
"chrome": 100
9+
}
10+
}
11+
],
12+
"@babel/preset-typescript",
13+
"@babel/preset-react"
14+
],
15+
"plugins": []
16+
}

.eslintrc.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es2021: true
5+
},
6+
extends: ['plugin:react/recommended', 'standard-with-typescript', 'plugin:storybook/recommended'],
7+
overrides: [],
8+
parserOptions: {
9+
ecmaVersion: 'latest',
10+
sourceType: 'module',
11+
project: './tsconfig.json',
12+
},
13+
plugins: ['react'],
14+
settings: {
15+
react: {
16+
version: 'detect'
17+
}
18+
},
19+
rules: {
20+
"@typescript-eslint/semi": ["error", "always"],
21+
"@typescript-eslint/explicit-function-return-type": "off",
22+
"@typescript-eslint/strict-boolean-expressions": "off",
23+
}
24+
};
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Build and Publish Storybook to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
# List of jobs
14+
jobs:
15+
deploy:
16+
runs-on: ubuntu-latest
17+
# Job steps
18+
steps:
19+
# Manual Checkout
20+
- uses: actions/checkout@v3
21+
22+
# Set up Node
23+
- uses: actions/setup-node@v3
24+
with:
25+
node-version: '18.x'
26+
27+
#👇 Add Storybook build and deploy to GitHub Pages as a step in the workflow
28+
- uses: bitovi/github-actions-storybook-to-github-pages@v1.0.1
29+
with:
30+
install_command: yarn install # default: npm ci
31+
build_command: yarn build-storybook # default: npm run build-storybook
32+
path: storybook-static # default: dist/storybook
33+
checkout: false # default: true

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
package-lock.json
3+
storybook-static
4+
dist
5+
build-storybook.log

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npm run precommit

.storybook/main.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const config = {
2+
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
3+
addons: ["@storybook/manager-api, @storybook/theming, @storybook/addon-links", "@storybook/addon-essentials", "@storybook/addon-interactions", "@storybook/addon-mdx-gfm", '@storybook/addon-toolbars', '@storybook/addon-designs'],
4+
framework: {
5+
name: "@storybook/react-webpack5",
6+
options: {}
7+
},
8+
docs: {
9+
autodocs: "tag"
10+
}
11+
};
12+
export default config;

.storybook/manager-head.html

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<link rel="preconnect" href="https://fonts.googleapis.com">
2+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
3+
<link rel="preconnect" href="https://fonts.googleapis.com">
4+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
5+
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap" rel="stylesheet">
6+
<style>
7+
8+
</style>

.storybook/manager.js

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { addons } from '@storybook/manager-api';
2+
import { themes } from '@storybook/theming';
3+
4+
const getCssVarStringValue = (varName) => getComputedStyle(document.documentElement).getPropertyValue(varName);
5+
6+
addons.setConfig({
7+
theme: {
8+
// colorPrimary: getCssVarStringValue('--fui-color-brand'),
9+
// colorSecondary: '#2856E0',
10+
// appBg: getCssVarStringValue('--fui-color-surface-subdued'),
11+
fontBase: '"Inter", sans-serif',
12+
fontCode: '"IBM Plex Mono", monospace',
13+
// appContentBg: getCssVarStringValue('--fui-color-surface-base'),
14+
// // appBorderColor: getCssVarStringValue('--fui-color-divider-solid'),
15+
// appBorderRadius: getComputedStyle(document.documentElement).getPropertyValue('--fui-border-radius-lg'),
16+
// textColor: getCssVarStringValue('--fui-color-foreground-default'),
17+
// textInverseColor: getCssVarStringValue('--fui-color-foreground-inverted'),
18+
// // textMutedColor: getCssVarStringValue('--fui-color-foreground-soft'),
19+
// barTextColor: getCssVarStringValue('--fui-color-foreground-default'),
20+
// barSelectedColor: getCssVarStringValue('--fui-color-foreground-primary'),
21+
// barBg: getCssVarStringValue('--fui-color-background-elevated'),
22+
// buttonBg: getCssVarStringValue('--fui-disableable-color-button-primary-bg-neutral'),
23+
// buttonBorder: getCssVarStringValue('--fui-disableable-color-button-secondary-border-neutral'),
24+
// booleanBg: getCssVarStringValue('--fui-disableable-color-background-subdued'),
25+
// booleanSelectedBg: getCssVarStringValue('--fui-disableable-color-brand'),
26+
// inputBg: getCssVarStringValue('--fui-disableable-color-background-base'),
27+
// inputBorder: getCssVarStringValue('--fui-disableable-color-divider-solid'),
28+
// inputTextColor: getCssVarStringValue('--fui-color-foreground-default'),
29+
// inputBorderRadius: getCssVarStringValue('--fui-border-radius-md'),
30+
// brandTitle: 'Functional UI Kit',
31+
// brandUrl: 'https://functional-ui-kit.framer.website/',
32+
// brandImage: 'https://framerusercontent.com/images/tVkfz6i8rL4iFXxNlvKJhZuM.png',
33+
// brandTarget: '_self',
34+
}
35+
});

.storybook/preview-head.html

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<link rel="preconnect" href="https://fonts.googleapis.com" />
2+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
3+
<link rel="preconnect" href="https://fonts.googleapis.com" />
4+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
5+
<link
6+
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap"
7+
rel="stylesheet"
8+
/>
9+
<style>
10+
html,
11+
body,
12+
#storybook-root {
13+
height: 100%;
14+
width: 100%;
15+
display: flex;
16+
flex-direction: column;
17+
align-items: center;
18+
justify-content: center;
19+
gap: 6px;
20+
background-color: var(--fui-color-surface-base);
21+
}
22+
.docs-story {
23+
background-color: var(--fui-color-surface-base);
24+
}
25+
</style>

.storybook/preview.js

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import '../src/css/main.css';
2+
import { themes } from '@storybook/theming';
3+
4+
const withThemeProvider = (Story, context) => {
5+
document.body.setAttribute('data-theme', context.globals.theme);
6+
return Story();
7+
};
8+
9+
const preview = {
10+
decorators: [withThemeProvider],
11+
parameters: {
12+
backgrounds: { disable: true },
13+
actions: { argTypesRegex: "^on[A-Z].*" },
14+
controls: {
15+
matchers: {
16+
color: /(background|color)$/i,
17+
date: /Date$/,
18+
},
19+
},
20+
docs: {
21+
theme: themes.dark,
22+
},
23+
},
24+
globalTypes: {
25+
theme: {
26+
description: 'Functional UI Kit theme',
27+
defaultValue: 'light',
28+
toolbar: {
29+
items: [{ value: 'light', icon: 'sun', title: 'light' }, { value: 'dark', icon: 'moon', title: 'dark' }],
30+
},
31+
},
32+
},
33+
34+
};
35+
36+
export default preview;

.storybook/theme.js

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// .storybook/YourTheme.js
2+
3+
import { create } from '@storybook/theming/create';
4+
5+
const getCssVarStringValue = (varName) => getComputedStyle(document.documentElement).getPropertyValue(varName);
6+
7+
export default create({
8+
base: 'light',
9+
// Typography
10+
fontBase: '"Inter", sans-serif',
11+
fontCode: '"IBM Plex Mono", monospace',
12+
13+
brandTitle: 'Functional UI Kit',
14+
brandUrl: 'https://functional-ui-kit.com/',
15+
brandImage: 'https://framerusercontent.com/images/tVkfz6i8rL4iFXxNlvKJhZuM.png',
16+
brandTarget: '_self',
17+
18+
//
19+
colorPrimary: 'red',
20+
colorSecondary: '#585C6D',
21+
22+
// UI
23+
appBg: '#ddd',
24+
appContentBg: '#ffffff',
25+
appBorderColor: getCssVarStringValue('--fui-color-divider-soft'),
26+
appBorderRadius: getCssVarStringValue('--fui-border-radius-xlg'),
27+
28+
// Text colors
29+
textColor: '#10162F',
30+
textInverseColor: '#ffffff',
31+
32+
// Toolbar default and active colors
33+
barTextColor: '#9E9E9E',
34+
barSelectedColor: '#585C6D',
35+
barBg: '#ffffff',
36+
37+
// Form colors
38+
inputBg: '#ffffff',
39+
inputBorder: getCssVarStringValue('--fui-color-divider-solid'),
40+
inputTextColor: '#10162F',
41+
inputBorderRadius: getCssVarStringValue('--fui-border-radius-md'),
42+
colorPrimary: getCssVarStringValue('--fui-color-brand'),
43+
});

CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## [0.0.2] - 2023-12-21
11+
Initial Release 🎉

README.md

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Welcome to Functional UI Kit
2+
3+
Functional UI Kit is a professionally crafted design system for product design and development teams and individuals. We provide core components you would need in every project, focusing on accessibility, development experience and unified designer-developer experience.
4+
5+
We've made sure that Figma variables and CSS variables work together effortlessly. They share the same names, usage and inheritance structure. This isn't just an extra feature; it's the core approach.
6+
7+
Each Figma variable has a direct counterpart in CSS, so there's no confusion. Your design ideas stay crystal clear as you move into the development phase.
8+
9+
10+
# Setup
11+
### Install
12+
Install the latest version from NPM.
13+
```
14+
npm install functional-ui-kit
15+
```
16+
17+
### Setup CSS
18+
Import the functional-ui-kit CSS file into your project in your css file
19+
```css
20+
@import 'practical-ui-kit/style';
21+
22+
html {
23+
...
24+
```
25+
you can also import the CSS file directly into your main React App file
26+
```js
27+
import React, { Component } from 'react'
28+
import 'practical-ui-kit/style';
29+
30+
class App extends Component {
31+
...
32+
```
33+
34+
### Customizing Theme
35+
You can customize the theme by overriding the CSS variables. You can find the list of variables in the [theme file](/docs/theming--docs)
36+
```css
37+
:root {
38+
--fui-color-brand: var(--fui-color-green-700);
39+
}
40+
41+
[data-theme="dark"],
42+
[data-theme="dark"] * {
43+
--fui-color-brand: var(--fui-color-green-500);
44+
}
45+
...
46+
```
47+
48+
### Using Components
49+
You can use the components by importing them into your React App file
50+
```js
51+
import React, { Component } from 'react'
52+
import { FuiBadge } from 'practical-ui-kit/fui-badge';
53+
54+
function App() {
55+
return (
56+
<div>
57+
<FuiBadge label='label' />
58+
</div>
59+
);
60+
}
61+
```

fui-badge/package.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"main": "../dist/fui-badge/index.js",
3+
"module": "../dist/fui-badge/index.mjs",
4+
"types": "../dist/fui-badge/index.d.ts"
5+
}

fui-button/package.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"main": "../dist/fui-button/index.js",
3+
"module": "../dist/fui-button/index.mjs",
4+
"types": "../dist/fui-button/index.d.ts"
5+
}

fui-checkbox/package.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"main": "../dist/fui-checkbox/index.js",
3+
"module": "../dist/fui-checkbox/index.mjs",
4+
"types": "../dist/fui-checkbox/index.d.ts"
5+
}

fui-empty/package.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"main": "../dist/fui-empty/index.js",
3+
"module": "../dist/fui-empty/index.mjs",
4+
"types": "../dist/fui-empty/index.d.ts"
5+
}

fui-modal/package.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"main": "../dist/fui-modal/index.js",
3+
"module": "../dist/fui-modal/index.mjs",
4+
"types": "../dist/fui-modal/index.d.ts"
5+
}

fui-notification/package.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"main": "../dist/fui-notification/index.js",
3+
"module": "../dist/fui-notification/index.mjs",
4+
"types": "../dist/fui-notification/index.d.ts"
5+
}

fui-popover/package.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"main": "../dist/fui-popover/index.js",
3+
"module": "../dist/fui-popover/index.mjs",
4+
"types": "../dist/fui-popover/index.d.ts"
5+
}

fui-radio/package.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"main": "../dist/fui-radio/index.js",
3+
"module": "../dist/fui-radio/index.mjs",
4+
"types": "../dist/fui-radio/index.d.ts"
5+
}

fui-select/package.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"main": "../dist/fui-select/index.js",
3+
"module": "../dist/fui-select/index.mjs",
4+
"types": "../dist/fui-select/index.d.ts"
5+
}

0 commit comments

Comments
 (0)