venice-ui 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.circleci/config.yml +36 -0
- package/.eslintrc.json +24 -0
- package/.prettierignore +10 -0
- package/.prettierrc +5 -0
- package/.storybook/PCTheme.js +10 -0
- package/.storybook/main.js +5 -4
- package/.storybook/manager.js +17 -0
- package/.storybook/preview-head.html +18 -0
- package/.storybook/preview.js +21 -1
- package/.storybook/public/pc_logo.png +0 -0
- package/README.md +2 -2
- package/dist/cjs/Theme/Theme.d.ts +45 -0
- package/dist/cjs/Theme/Theme.js +49 -0
- package/dist/cjs/Theme/Theme.js.map +1 -0
- package/dist/cjs/components/Aligment/Aligment.stories.d.ts +7 -0
- package/dist/cjs/components/Aligment/Aligment.stories.js +110 -0
- package/dist/cjs/components/Aligment/Aligment.stories.js.map +1 -0
- package/dist/cjs/components/Aligment/Aligment.styles.d.ts +11 -0
- package/dist/cjs/components/Aligment/Aligment.styles.js +19 -0
- package/dist/cjs/components/Aligment/Aligment.styles.js.map +1 -0
- package/dist/cjs/components/Aligment/index.d.ts +1 -0
- package/dist/cjs/components/Aligment/index.js +6 -0
- package/dist/cjs/components/Aligment/index.js.map +1 -0
- package/dist/cjs/components/Button/Button.d.ts +10 -0
- package/dist/cjs/components/Button/Button.js +13 -0
- package/dist/cjs/components/Button/Button.js.map +1 -0
- package/dist/cjs/components/Button/Button.stories.d.ts +7 -0
- package/dist/cjs/components/Button/Button.stories.js +51 -0
- package/dist/cjs/components/Button/Button.stories.js.map +1 -0
- package/dist/cjs/components/Button/Button.styles.d.ts +8 -0
- package/dist/cjs/components/Button/Button.styles.js +66 -0
- package/dist/cjs/components/Button/Button.styles.js.map +1 -0
- package/dist/cjs/components/Button/index.d.ts +1 -0
- package/dist/cjs/components/Button/index.js +6 -0
- package/dist/cjs/components/Button/index.js.map +1 -0
- package/dist/cjs/components/Icons/Icon.d.ts +9 -0
- package/dist/cjs/components/Icons/Icon.js +17 -0
- package/dist/cjs/components/Icons/Icon.js.map +1 -0
- package/dist/cjs/components/Icons/Icon.stories.d.ts +9 -0
- package/dist/cjs/components/Icons/Icon.stories.js +60 -0
- package/dist/cjs/components/Icons/Icon.stories.js.map +1 -0
- package/dist/cjs/components/Icons/Icon.styles.d.ts +6 -0
- package/dist/cjs/components/Icons/Icon.styles.js +29 -0
- package/dist/cjs/components/Icons/Icon.styles.js.map +1 -0
- package/dist/cjs/components/Icons/IconsPath.d.ts +11 -0
- package/dist/cjs/components/Icons/IconsPath.js +15 -0
- package/dist/cjs/components/Icons/IconsPath.js.map +1 -0
- package/dist/cjs/components/Icons/index.d.ts +1 -0
- package/dist/cjs/components/Icons/index.js +6 -0
- package/dist/cjs/components/Icons/index.js.map +1 -0
- package/dist/cjs/components/InputText/InputText.d.ts +11 -0
- package/dist/cjs/components/InputText/InputText.js +13 -0
- package/dist/cjs/components/InputText/InputText.js.map +1 -0
- package/dist/cjs/components/InputText/InputText.stories.d.ts +5 -0
- package/dist/cjs/components/InputText/InputText.stories.js +18 -0
- package/dist/cjs/components/InputText/InputText.stories.js.map +1 -0
- package/dist/cjs/components/InputText/InputText.styles.d.ts +1 -0
- package/dist/cjs/components/InputText/InputText.styles.js +25 -0
- package/dist/cjs/components/InputText/InputText.styles.js.map +1 -0
- package/dist/cjs/components/InputText/index.d.ts +1 -0
- package/dist/cjs/components/InputText/index.js +6 -0
- package/dist/cjs/components/InputText/index.js.map +1 -0
- package/dist/cjs/components/Modal/Modal.d.ts +11 -0
- package/dist/cjs/components/Modal/Modal.js +30 -0
- package/dist/cjs/components/Modal/Modal.js.map +1 -0
- package/dist/cjs/components/Modal/Modal.stories.d.ts +8 -0
- package/dist/cjs/components/Modal/Modal.stories.js +83 -0
- package/dist/cjs/components/Modal/Modal.stories.js.map +1 -0
- package/dist/cjs/components/Modal/Modal.styles.d.ts +6 -0
- package/dist/cjs/components/Modal/Modal.styles.js +40 -0
- package/dist/cjs/components/Modal/Modal.styles.js.map +1 -0
- package/dist/cjs/components/Modal/index.d.ts +1 -0
- package/dist/cjs/components/Modal/index.js +6 -0
- package/dist/cjs/components/Modal/index.js.map +1 -0
- package/dist/cjs/components/Typography/Typography.styles.d.ts +5 -0
- package/dist/cjs/components/Typography/Typography.styles.js +34 -0
- package/dist/cjs/components/Typography/Typography.styles.js.map +1 -0
- package/dist/cjs/components/Typography/index.d.ts +1 -0
- package/dist/cjs/components/Typography/index.js +9 -0
- package/dist/cjs/components/Typography/index.js.map +1 -0
- package/dist/cjs/components/common/commonComponents.d.ts +2 -0
- package/dist/cjs/components/common/commonComponents.js +18 -0
- package/dist/cjs/components/common/commonComponents.js.map +1 -0
- package/dist/cjs/components/common/index.d.ts +1 -0
- package/dist/cjs/components/common/index.js +18 -0
- package/dist/cjs/components/common/index.js.map +1 -0
- package/dist/cjs/example/ExampleComponent.d.ts +16 -0
- package/dist/cjs/example/ExampleComponent.js +39 -0
- package/dist/cjs/example/ExampleComponent.js.map +1 -0
- package/dist/cjs/example/index.d.ts +1 -0
- package/dist/cjs/example/index.js +18 -0
- package/dist/cjs/example/index.js.map +1 -0
- package/dist/cjs/index.d.ts +5 -0
- package/dist/cjs/index.js +26 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/esm/Theme/Theme.d.ts +45 -0
- package/dist/esm/Theme/Theme.js +46 -0
- package/dist/esm/Theme/Theme.js.map +1 -0
- package/dist/esm/components/Aligment/Aligment.stories.d.ts +7 -0
- package/dist/esm/components/Aligment/Aligment.stories.js +104 -0
- package/dist/esm/components/Aligment/Aligment.stories.js.map +1 -0
- package/dist/esm/components/Aligment/Aligment.styles.d.ts +11 -0
- package/dist/esm/components/Aligment/Aligment.styles.js +13 -0
- package/dist/esm/components/Aligment/Aligment.styles.js.map +1 -0
- package/dist/esm/components/Aligment/index.d.ts +1 -0
- package/dist/esm/components/Aligment/index.js +2 -0
- package/dist/esm/components/Aligment/index.js.map +1 -0
- package/dist/esm/components/Button/Button.d.ts +10 -0
- package/dist/esm/components/Button/Button.js +6 -0
- package/dist/esm/components/Button/Button.js.map +1 -0
- package/dist/esm/components/Button/Button.stories.d.ts +7 -0
- package/dist/esm/components/Button/Button.stories.js +45 -0
- package/dist/esm/components/Button/Button.stories.js.map +1 -0
- package/dist/esm/components/Button/Button.styles.d.ts +8 -0
- package/dist/esm/components/Button/Button.styles.js +60 -0
- package/dist/esm/components/Button/Button.styles.js.map +1 -0
- package/dist/esm/components/Button/index.d.ts +1 -0
- package/dist/esm/components/Button/index.js +2 -0
- package/dist/esm/components/Button/index.js.map +1 -0
- package/dist/esm/components/Icons/Icon.d.ts +9 -0
- package/dist/esm/components/Icons/Icon.js +10 -0
- package/dist/esm/components/Icons/Icon.js.map +1 -0
- package/dist/esm/components/Icons/Icon.stories.d.ts +9 -0
- package/dist/esm/components/Icons/Icon.stories.js +54 -0
- package/dist/esm/components/Icons/Icon.stories.js.map +1 -0
- package/dist/esm/components/Icons/Icon.styles.d.ts +6 -0
- package/dist/esm/components/Icons/Icon.styles.js +23 -0
- package/dist/esm/components/Icons/Icon.styles.js.map +1 -0
- package/dist/esm/components/Icons/IconsPath.d.ts +11 -0
- package/dist/esm/components/Icons/IconsPath.js +12 -0
- package/dist/esm/components/Icons/IconsPath.js.map +1 -0
- package/dist/esm/components/Icons/index.d.ts +1 -0
- package/dist/esm/components/Icons/index.js +2 -0
- package/dist/esm/components/Icons/index.js.map +1 -0
- package/dist/esm/components/InputText/InputText.d.ts +11 -0
- package/dist/esm/components/InputText/InputText.js +6 -0
- package/dist/esm/components/InputText/InputText.js.map +1 -0
- package/dist/esm/components/InputText/InputText.stories.d.ts +5 -0
- package/dist/esm/components/InputText/InputText.stories.js +12 -0
- package/dist/esm/components/InputText/InputText.stories.js.map +1 -0
- package/dist/esm/components/InputText/InputText.styles.d.ts +1 -0
- package/dist/esm/components/InputText/InputText.styles.js +19 -0
- package/dist/esm/components/InputText/InputText.styles.js.map +1 -0
- package/dist/esm/components/InputText/index.d.ts +1 -0
- package/dist/esm/components/InputText/index.js +2 -0
- package/dist/esm/components/InputText/index.js.map +1 -0
- package/dist/esm/components/Modal/Modal.d.ts +11 -0
- package/dist/esm/components/Modal/Modal.js +23 -0
- package/dist/esm/components/Modal/Modal.js.map +1 -0
- package/dist/esm/components/Modal/Modal.stories.d.ts +8 -0
- package/dist/esm/components/Modal/Modal.stories.js +57 -0
- package/dist/esm/components/Modal/Modal.stories.js.map +1 -0
- package/dist/esm/components/Modal/Modal.styles.d.ts +6 -0
- package/dist/esm/components/Modal/Modal.styles.js +34 -0
- package/dist/esm/components/Modal/Modal.styles.js.map +1 -0
- package/dist/esm/components/Modal/index.d.ts +1 -0
- package/dist/esm/components/Modal/index.js +2 -0
- package/dist/esm/components/Modal/index.js.map +1 -0
- package/dist/esm/components/Typography/Typography.styles.d.ts +5 -0
- package/dist/esm/components/Typography/Typography.styles.js +28 -0
- package/dist/esm/components/Typography/Typography.styles.js.map +1 -0
- package/dist/esm/components/Typography/index.d.ts +1 -0
- package/dist/esm/components/Typography/index.js +2 -0
- package/dist/esm/components/Typography/index.js.map +1 -0
- package/dist/esm/components/common/commonComponents.d.ts +2 -0
- package/dist/esm/components/common/commonComponents.js +12 -0
- package/dist/esm/components/common/commonComponents.js.map +1 -0
- package/dist/esm/components/common/index.d.ts +1 -0
- package/dist/esm/components/common/index.js +2 -0
- package/dist/esm/components/common/index.js.map +1 -0
- package/dist/esm/example/ExampleComponent.d.ts +16 -0
- package/dist/esm/example/ExampleComponent.js +33 -0
- package/dist/esm/example/ExampleComponent.js.map +1 -0
- package/dist/esm/example/index.d.ts +1 -0
- package/dist/esm/example/index.js +2 -0
- package/dist/esm/example/index.js.map +1 -0
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.js +6 -0
- package/dist/esm/index.js.map +1 -0
- package/package.json +17 -2
- package/src/Theme/Theme.ts +47 -0
- package/src/components/Aligment/Aligment.stories.tsx +126 -0
- package/src/components/Aligment/Aligment.styles.ts +23 -0
- package/src/components/Aligment/index.ts +1 -0
- package/src/components/Button/Button.stories.tsx +53 -0
- package/src/components/Button/Button.styles.tsx +76 -0
- package/src/components/Button/Button.tsx +31 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/Icons/Icon.stories.tsx +62 -0
- package/src/components/Icons/Icon.styles.ts +29 -0
- package/src/components/Icons/Icon.tsx +35 -0
- package/src/components/Icons/Icons.stories.mdx +38 -0
- package/src/components/Icons/IconsPath.ts +13 -0
- package/src/components/Icons/index.ts +1 -0
- package/src/components/InputText/InputText.stories.tsx +18 -0
- package/src/components/InputText/InputText.styles.ts +19 -0
- package/src/components/InputText/InputText.tsx +24 -0
- package/src/components/InputText/index.ts +1 -0
- package/src/components/Modal/Modal.stories.tsx +183 -0
- package/src/components/Modal/Modal.styles.ts +38 -0
- package/src/components/Modal/Modal.tsx +63 -0
- package/src/components/Modal/index.ts +1 -0
- package/src/components/Typography/Typography.stories.mdx +35 -0
- package/src/components/Typography/Typography.styles.tsx +31 -0
- package/src/components/Typography/index.ts +1 -0
- package/src/components/common/commonComponents.tsx +13 -0
- package/src/components/common/index.ts +1 -0
- package/src/example/ExampleComponent.tsx +44 -0
- package/src/example/index.ts +1 -0
- package/src/index.ts +5 -0
- package/tsconfig.json +18 -18
- package/stories/Button.stories.tsx +0 -41
- package/stories/Button.tsx +0 -48
- package/stories/Header.stories.tsx +0 -25
- package/stories/Header.tsx +0 -56
- package/stories/Introduction.stories.mdx +0 -211
- package/stories/Page.stories.tsx +0 -26
- package/stories/Page.tsx +0 -73
- package/stories/assets/code-brackets.svg +0 -1
- package/stories/assets/colors.svg +0 -1
- package/stories/assets/comments.svg +0 -1
- package/stories/assets/direction.svg +0 -1
- package/stories/assets/flow.svg +0 -1
- package/stories/assets/plugin.svg +0 -1
- package/stories/assets/repo.svg +0 -1
- package/stories/assets/stackalt.svg +0 -1
- package/stories/button.css +0 -30
- package/stories/header.css +0 -32
- package/stories/page.css +0 -69
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "venice-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Component library",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
8
|
+
"clean": "rm -rf node_modules/ && rm -rf public/dist/",
|
|
8
9
|
"build": "rm -rf /dist && npm run build:esm && npm run build:cjs",
|
|
9
10
|
"build:esm": "tsc",
|
|
10
11
|
"build:cjs": "tsc --module CommonJS --outDir dist/cjs",
|
|
@@ -34,7 +35,14 @@
|
|
|
34
35
|
"@types/node": "^18.7.15",
|
|
35
36
|
"@types/react": "^18.0.18",
|
|
36
37
|
"@types/react-dom": "^18.0.6",
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "^5.37.0",
|
|
39
|
+
"@typescript-eslint/parser": "^5.37.0",
|
|
37
40
|
"babel-loader": "^8.2.5",
|
|
41
|
+
"eslint": "^8.23.1",
|
|
42
|
+
"eslint-config-prettier": "^8.5.0",
|
|
43
|
+
"eslint-plugin-react": "^7.31.8",
|
|
44
|
+
"eslint-plugin-storybook": "^0.6.4",
|
|
45
|
+
"prettier": "2.7.1",
|
|
38
46
|
"react": "^18.2.0",
|
|
39
47
|
"react-dom": "^18.2.0",
|
|
40
48
|
"typescript": "^4.8.2"
|
|
@@ -43,5 +51,12 @@
|
|
|
43
51
|
"react": "^18.2.0",
|
|
44
52
|
"react-dom": "^18.2.0"
|
|
45
53
|
},
|
|
46
|
-
"dependencies": {
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"@storybook/addon-a11y": "^7.0.0-alpha.34",
|
|
56
|
+
"@storybook/addons": "^7.0.0-alpha.34",
|
|
57
|
+
"@storybook/theming": "^7.0.0-alpha.34",
|
|
58
|
+
"@types/styled-components": "^5.1.26",
|
|
59
|
+
"polished": "^4.2.2",
|
|
60
|
+
"styled-components": "^5.3.5"
|
|
61
|
+
}
|
|
47
62
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export const Theme = {
|
|
2
|
+
colors: {
|
|
3
|
+
primary: "#4c95c5",
|
|
4
|
+
text: '#333333',
|
|
5
|
+
disableText: "#cccccc",
|
|
6
|
+
disableBackground: '#dddddd',
|
|
7
|
+
white: "#ffffff",
|
|
8
|
+
black: "#333333",
|
|
9
|
+
gray_1: "#b7b7b7",
|
|
10
|
+
overlayer: 'rgba(255,255,255,0.2)'
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
fontSize: {
|
|
14
|
+
xs: "12px",
|
|
15
|
+
s: "14px",
|
|
16
|
+
m: "16px",
|
|
17
|
+
l: "22px",
|
|
18
|
+
xl: "32px",
|
|
19
|
+
},
|
|
20
|
+
lineHeight: {
|
|
21
|
+
xs: "14px",
|
|
22
|
+
s: "16px",
|
|
23
|
+
m: "18px",
|
|
24
|
+
l: "24px",
|
|
25
|
+
xl: "36px",
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
padding: {
|
|
29
|
+
xs: "2px",
|
|
30
|
+
s: "4px",
|
|
31
|
+
m: "8px",
|
|
32
|
+
l: "16px",
|
|
33
|
+
xl: "32px",
|
|
34
|
+
xxl: '48px',
|
|
35
|
+
},
|
|
36
|
+
zIndex:{
|
|
37
|
+
modalOverlayer: 1000,
|
|
38
|
+
},
|
|
39
|
+
borderRadius: {
|
|
40
|
+
s: '2px',
|
|
41
|
+
m: '4px',
|
|
42
|
+
l: '8px',
|
|
43
|
+
},
|
|
44
|
+
shadow:{
|
|
45
|
+
m: '0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);'
|
|
46
|
+
}
|
|
47
|
+
};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
|
3
|
+
|
|
4
|
+
import { Aligment } from './Aligment.styles'
|
|
5
|
+
import { ExmpleBlock, ExmpleBlockWrapper } from '../../example'
|
|
6
|
+
import { Theme } from '../../Theme/Theme'
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Layout/Aligment',
|
|
10
|
+
component: Aligment,
|
|
11
|
+
argTypes: {
|
|
12
|
+
width: { control: 'text', defaultValue: '100%', default: '100%' },
|
|
13
|
+
direction: {
|
|
14
|
+
options: ['row', 'row-reverse', 'column', 'column-reverse'],
|
|
15
|
+
control: 'select',
|
|
16
|
+
},
|
|
17
|
+
align: {
|
|
18
|
+
options: [
|
|
19
|
+
'stretch',
|
|
20
|
+
'flex-start',
|
|
21
|
+
'flex-end',
|
|
22
|
+
'center',
|
|
23
|
+
'baseline',
|
|
24
|
+
'first baseline',
|
|
25
|
+
'last baseline',
|
|
26
|
+
'start',
|
|
27
|
+
'end',
|
|
28
|
+
'self-start',
|
|
29
|
+
'self-end',
|
|
30
|
+
],
|
|
31
|
+
control: 'select',
|
|
32
|
+
},
|
|
33
|
+
justify: {
|
|
34
|
+
options: [
|
|
35
|
+
'flex-start',
|
|
36
|
+
'flex-end',
|
|
37
|
+
'center',
|
|
38
|
+
'space-between',
|
|
39
|
+
'space-around',
|
|
40
|
+
'space-evenly',
|
|
41
|
+
'start',
|
|
42
|
+
'end',
|
|
43
|
+
'left',
|
|
44
|
+
],
|
|
45
|
+
control: 'select',
|
|
46
|
+
},
|
|
47
|
+
wrap: {
|
|
48
|
+
options: ['wrap', 'nowrap', 'wrap-reverse'],
|
|
49
|
+
control: 'select',
|
|
50
|
+
},
|
|
51
|
+
backgroundColor: {
|
|
52
|
+
control: { type: 'color' },
|
|
53
|
+
},
|
|
54
|
+
vPadding: { control: 'text' },
|
|
55
|
+
hPadding: { control: 'text' },
|
|
56
|
+
},
|
|
57
|
+
} as ComponentMeta<typeof Aligment>
|
|
58
|
+
|
|
59
|
+
const Template: ComponentStory<typeof Aligment> = (args) => (
|
|
60
|
+
<Aligment {...args}>
|
|
61
|
+
<ExmpleBlockWrapper>
|
|
62
|
+
<ExmpleBlock width="20px" height="40px">
|
|
63
|
+
1
|
|
64
|
+
</ExmpleBlock>
|
|
65
|
+
</ExmpleBlockWrapper>
|
|
66
|
+
<ExmpleBlockWrapper>
|
|
67
|
+
<ExmpleBlock width="60px" height="30px">
|
|
68
|
+
2
|
|
69
|
+
</ExmpleBlock>
|
|
70
|
+
</ExmpleBlockWrapper>
|
|
71
|
+
<ExmpleBlockWrapper>
|
|
72
|
+
<ExmpleBlock width="30px" height="60px">
|
|
73
|
+
3
|
|
74
|
+
</ExmpleBlock>
|
|
75
|
+
</ExmpleBlockWrapper>
|
|
76
|
+
<ExmpleBlockWrapper>
|
|
77
|
+
<ExmpleBlock width="40px" height="40px">
|
|
78
|
+
4
|
|
79
|
+
</ExmpleBlock>
|
|
80
|
+
</ExmpleBlockWrapper>
|
|
81
|
+
</Aligment>
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
export const Default = Template.bind({})
|
|
85
|
+
Default.args = {
|
|
86
|
+
direction: 'row',
|
|
87
|
+
align: 'center',
|
|
88
|
+
justify: 'space-between',
|
|
89
|
+
wrap: 'wrap',
|
|
90
|
+
backgroundColor: 'transparent',
|
|
91
|
+
vPadding: '0px',
|
|
92
|
+
hPadding: '0px',
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export const Column = Template.bind({})
|
|
96
|
+
Column.args = {
|
|
97
|
+
direction: 'column',
|
|
98
|
+
align: 'center',
|
|
99
|
+
justify: 'space-between',
|
|
100
|
+
wrap: 'wrap',
|
|
101
|
+
backgroundColor: 'transparent',
|
|
102
|
+
vPadding: '0px',
|
|
103
|
+
hPadding: '0px',
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export const WithColor = Template.bind({})
|
|
107
|
+
WithColor.args = {
|
|
108
|
+
direction: 'row',
|
|
109
|
+
align: 'center',
|
|
110
|
+
justify: 'space-between',
|
|
111
|
+
wrap: 'wrap',
|
|
112
|
+
backgroundColor: Theme.colors.primary,
|
|
113
|
+
vPadding: '0px',
|
|
114
|
+
hPadding: '0px',
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export const WithPadding = Template.bind({})
|
|
118
|
+
WithPadding.args = {
|
|
119
|
+
direction: 'row',
|
|
120
|
+
align: 'center',
|
|
121
|
+
justify: 'space-between',
|
|
122
|
+
wrap: 'wrap',
|
|
123
|
+
backgroundColor: Theme.colors.primary,
|
|
124
|
+
vPadding: Theme.padding.xl,
|
|
125
|
+
hPadding: Theme.padding.xl,
|
|
126
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
|
|
3
|
+
export interface IAligmentProps {
|
|
4
|
+
direction?: string
|
|
5
|
+
justify?: string
|
|
6
|
+
align?: string
|
|
7
|
+
width?: string
|
|
8
|
+
wrap?: string
|
|
9
|
+
vPadding?: string
|
|
10
|
+
hPadding?: string
|
|
11
|
+
backgroundColor? :string
|
|
12
|
+
}
|
|
13
|
+
export const Aligment = styled.div<IAligmentProps>`
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
display: flex;
|
|
16
|
+
width: ${p => p.width ? p.width : '100%'};
|
|
17
|
+
flex-direction: ${p => p.direction ? p.direction : 'row'};
|
|
18
|
+
justify-content: ${p => p.justify ? p.justify : 'space-between'};
|
|
19
|
+
align-items: ${p => p.align ? p.align : 'center'};
|
|
20
|
+
flex-wrap: ${p => p.wrap ? p.wrap : 'wrap'};
|
|
21
|
+
padding: ${p=> p.vPadding ? p.vPadding : '0'} ${p=> p.hPadding ? p.hPadding : '0'};
|
|
22
|
+
background-color: ${p => p.backgroundColor ? p.backgroundColor : 'transparent'}
|
|
23
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Aligment } from './Aligment.styles'
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
|
3
|
+
|
|
4
|
+
import { Button } from './Button'
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Elements/Button',
|
|
8
|
+
component: Button,
|
|
9
|
+
argTypes: {
|
|
10
|
+
text: { control: 'text' },
|
|
11
|
+
mode: {
|
|
12
|
+
options: ['primary', 'inverse', 'ghost'],
|
|
13
|
+
control: 'select',
|
|
14
|
+
},
|
|
15
|
+
size: {
|
|
16
|
+
options: ['regular', 'small', 'flat'],
|
|
17
|
+
control: 'select',
|
|
18
|
+
},
|
|
19
|
+
right: { control: 'boolean' },
|
|
20
|
+
left: { control: 'boolean' },
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
},
|
|
24
|
+
args: {
|
|
25
|
+
text: 'Click me',
|
|
26
|
+
},
|
|
27
|
+
} as ComponentMeta<typeof Button>
|
|
28
|
+
|
|
29
|
+
const Template: ComponentStory<typeof Button> = (args) => <Button {...args}/>
|
|
30
|
+
|
|
31
|
+
export const Default = Template.bind({})
|
|
32
|
+
Default.args = {
|
|
33
|
+
size: 'regular',
|
|
34
|
+
mode: 'primary',
|
|
35
|
+
left: false,
|
|
36
|
+
right: false,
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const Inverse = Template.bind({})
|
|
40
|
+
Inverse.args = {
|
|
41
|
+
size: 'regular',
|
|
42
|
+
mode: 'inverse',
|
|
43
|
+
left: false,
|
|
44
|
+
right: false,
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const Ghost = Template.bind({})
|
|
48
|
+
Ghost.args = {
|
|
49
|
+
size: 'regular',
|
|
50
|
+
mode: 'ghost',
|
|
51
|
+
left: false,
|
|
52
|
+
right: false,
|
|
53
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { lighten } from 'polished'
|
|
2
|
+
import styled from 'styled-components'
|
|
3
|
+
import { Theme } from '../../Theme/Theme'
|
|
4
|
+
|
|
5
|
+
interface IButtonElement {
|
|
6
|
+
mode: string
|
|
7
|
+
size: string
|
|
8
|
+
right: boolean
|
|
9
|
+
left: boolean
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const ButtonElement = styled.button<IButtonElement>`
|
|
13
|
+
transition: 300ms;
|
|
14
|
+
border-radius: ${Theme.borderRadius.s};
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
margin-left: ${(p) => (p.right ? Theme.padding.m : '0')};
|
|
19
|
+
margin-right: ${(p) => (p.left ? Theme.padding.m : '0')};
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
display: flex;
|
|
24
|
+
|
|
25
|
+
${(p) =>
|
|
26
|
+
p.mode === 'primary' &&
|
|
27
|
+
`background-color: ${Theme.colors.primary};
|
|
28
|
+
color: ${Theme.colors.white};
|
|
29
|
+
border: 1px solid rgba(0,0,0,0.15);`}
|
|
30
|
+
${(p) =>
|
|
31
|
+
p.mode === 'inverse' &&
|
|
32
|
+
`background-color: ${Theme.colors.white};
|
|
33
|
+
color: ${Theme.colors.primary};
|
|
34
|
+
border: 1px solid ${Theme.colors.primary};
|
|
35
|
+
`}
|
|
36
|
+
${(p) =>
|
|
37
|
+
p.mode === 'ghost' &&
|
|
38
|
+
`background-color:transparent;
|
|
39
|
+
color: ${Theme.colors.primary};
|
|
40
|
+
border:none;`}
|
|
41
|
+
${(p) =>
|
|
42
|
+
p.size === 'regular' &&
|
|
43
|
+
`font-size: ${Theme.fontSize.m};
|
|
44
|
+
line-height: ${Theme.lineHeight.m};
|
|
45
|
+
padding: ${Theme.padding.m} ${Theme.padding.l};`}
|
|
46
|
+
${(p) =>
|
|
47
|
+
p.size === 'small' &&
|
|
48
|
+
`font-size: ${Theme.fontSize.s};
|
|
49
|
+
line-height: ${Theme.lineHeight.s};
|
|
50
|
+
padding: ${Theme.padding.s} ${Theme.padding.m};`}
|
|
51
|
+
${(p) =>
|
|
52
|
+
p.size === 'flat' &&
|
|
53
|
+
`font-size: ${Theme.fontSize.m};
|
|
54
|
+
line-height: ${Theme.lineHeight.m};
|
|
55
|
+
padding: ${Theme.padding.s} ${Theme.padding.s};`}
|
|
56
|
+
&:hover {
|
|
57
|
+
transition: 300ms;
|
|
58
|
+
${(p) =>
|
|
59
|
+
p.mode === 'primary' &&
|
|
60
|
+
`background-color: ${lighten(0.1, Theme.colors.primary)};`}
|
|
61
|
+
${(p) =>
|
|
62
|
+
p.mode === 'inverse' &&
|
|
63
|
+
`background-color: ${lighten(0.4, Theme.colors.primary)}`};
|
|
64
|
+
${(p) =>
|
|
65
|
+
p.mode === 'ghost' && `color: ${lighten(0.2, Theme.colors.primary)};`}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&.disable,
|
|
69
|
+
button[disabled] {
|
|
70
|
+
color: ${Theme.colors.disableText};
|
|
71
|
+
cursor: default;
|
|
72
|
+
&:hover {
|
|
73
|
+
color: ${Theme.colors.disableBackground};
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
`
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React, { FC } from 'react'
|
|
2
|
+
import { ButtonElement } from './Button.styles'
|
|
3
|
+
|
|
4
|
+
export interface IButtonProps {
|
|
5
|
+
text: string
|
|
6
|
+
mode?: string
|
|
7
|
+
size?: string
|
|
8
|
+
right?: boolean
|
|
9
|
+
left?: boolean
|
|
10
|
+
onClick: () => void
|
|
11
|
+
}
|
|
12
|
+
export const Button: FC<IButtonProps> = ({
|
|
13
|
+
text,
|
|
14
|
+
mode = 'primary',
|
|
15
|
+
size = 'regular',
|
|
16
|
+
right = false,
|
|
17
|
+
left = false,
|
|
18
|
+
onClick,
|
|
19
|
+
}) => {
|
|
20
|
+
return (
|
|
21
|
+
<ButtonElement
|
|
22
|
+
mode={mode}
|
|
23
|
+
size={size}
|
|
24
|
+
right={right}
|
|
25
|
+
left={left}
|
|
26
|
+
onClick={onClick}
|
|
27
|
+
>
|
|
28
|
+
{text}
|
|
29
|
+
</ButtonElement>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {Button} from './Button'
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
|
3
|
+
|
|
4
|
+
import { Icon } from './Icon'
|
|
5
|
+
import { Theme } from '../../Theme/Theme'
|
|
6
|
+
import { Aligment } from '../Aligment'
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Elements/Icon',
|
|
10
|
+
|
|
11
|
+
component: Icon,
|
|
12
|
+
argTypes: {
|
|
13
|
+
name: {
|
|
14
|
+
options: ['person', 'menu', 'remove', 'add', 'close'],
|
|
15
|
+
control: 'select',
|
|
16
|
+
},
|
|
17
|
+
size: { control: 'number' },
|
|
18
|
+
color: { control: { type: 'color' } },
|
|
19
|
+
bgColor: { control: 'boolean' },
|
|
20
|
+
},
|
|
21
|
+
args: {
|
|
22
|
+
onClick: undefined
|
|
23
|
+
}
|
|
24
|
+
} as ComponentMeta<typeof Icon>
|
|
25
|
+
|
|
26
|
+
const Template: ComponentStory<typeof Icon> = (args) => (
|
|
27
|
+
<Icon {...args}/>
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
export const Default = Template.bind({})
|
|
31
|
+
Default.args ={
|
|
32
|
+
name: 'person',
|
|
33
|
+
size: 48
|
|
34
|
+
}
|
|
35
|
+
export const Size = Template.bind({})
|
|
36
|
+
Size.args ={
|
|
37
|
+
name: 'person',
|
|
38
|
+
size: 24
|
|
39
|
+
}
|
|
40
|
+
export const Color = Template.bind({})
|
|
41
|
+
Color.args ={
|
|
42
|
+
name: 'person',
|
|
43
|
+
size: 48,
|
|
44
|
+
color: Theme.colors.primary
|
|
45
|
+
}
|
|
46
|
+
export const ActionDefault = Template.bind({})
|
|
47
|
+
ActionDefault.args ={
|
|
48
|
+
name: 'person',
|
|
49
|
+
size: 48,
|
|
50
|
+
onClick: ()=>console.log('click')
|
|
51
|
+
}
|
|
52
|
+
const DarkTemplate: ComponentStory<typeof Icon> = (args) => (
|
|
53
|
+
<Aligment backgroundColor={Theme.colors.black}><Icon {...args}/></Aligment>
|
|
54
|
+
)
|
|
55
|
+
export const ActionColor = DarkTemplate.bind({})
|
|
56
|
+
ActionColor.args ={
|
|
57
|
+
name: 'person',
|
|
58
|
+
size: 48,
|
|
59
|
+
bgColor: true,
|
|
60
|
+
color:Theme.colors.white,
|
|
61
|
+
onClick: ()=>console.log('click')
|
|
62
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { lighten } from "polished";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { Theme } from "../../Theme/Theme";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
interface IIconElementProps {
|
|
7
|
+
bgColor?: boolean
|
|
8
|
+
onClick?: ()=>void
|
|
9
|
+
}
|
|
10
|
+
export const IconElement = styled.div<IIconElementProps>`
|
|
11
|
+
transition: 300ms;
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
width:auto;
|
|
14
|
+
display:inline-flex;
|
|
15
|
+
border-radius: ${Theme.borderRadius.s};
|
|
16
|
+
${p => p.onClick !== undefined &&
|
|
17
|
+
`
|
|
18
|
+
padding: ${Theme.padding.s};
|
|
19
|
+
cursor:pointer;
|
|
20
|
+
&:hover{
|
|
21
|
+
background-color: ${p.bgColor ? `rgba(255,255,255,0.2)` : lighten(0.4, Theme.colors.primary) };
|
|
22
|
+
transition: 300ms;
|
|
23
|
+
}
|
|
24
|
+
svg{
|
|
25
|
+
cursor:pointer;
|
|
26
|
+
}
|
|
27
|
+
`
|
|
28
|
+
}
|
|
29
|
+
`
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React, { FC } from 'react'
|
|
2
|
+
import { Theme } from '../../Theme/Theme'
|
|
3
|
+
import { IconElement } from './Icon.styles'
|
|
4
|
+
import { iconsPath } from './IconsPath'
|
|
5
|
+
|
|
6
|
+
export interface IIconActionProps {
|
|
7
|
+
name: string
|
|
8
|
+
size?: number
|
|
9
|
+
color?: string
|
|
10
|
+
bgColor?: boolean
|
|
11
|
+
onClick?: () => void
|
|
12
|
+
}
|
|
13
|
+
export const Icon: FC<IIconActionProps> = ({
|
|
14
|
+
size = 24,
|
|
15
|
+
name,
|
|
16
|
+
color = Theme.colors.text,
|
|
17
|
+
bgColor,
|
|
18
|
+
onClick,
|
|
19
|
+
}) => {
|
|
20
|
+
return (
|
|
21
|
+
<IconElement onClick={onClick} bgColor={bgColor}>
|
|
22
|
+
<svg
|
|
23
|
+
width={size}
|
|
24
|
+
height={size}
|
|
25
|
+
viewBox={'0 0 48 48'}
|
|
26
|
+
preserveAspectRatio="xMidYMid meet"
|
|
27
|
+
x="0"
|
|
28
|
+
y="0"
|
|
29
|
+
name={name}
|
|
30
|
+
>
|
|
31
|
+
<path d={iconsPath[name]} fill={color} />
|
|
32
|
+
</svg>
|
|
33
|
+
</IconElement>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Meta } from '@storybook/addon-docs';
|
|
2
|
+
import { ExampleTable, ExampleTableRow, ExampleTableHeader,ExampleTableCell , StoryWrapper } from '../../example'
|
|
3
|
+
import { Icon } from '../Icons'
|
|
4
|
+
|
|
5
|
+
<Meta title="Basic/Icons" />
|
|
6
|
+
|
|
7
|
+
<StoryWrapper>
|
|
8
|
+
|
|
9
|
+
<h2>Size</h2>
|
|
10
|
+
<ExampleTable>
|
|
11
|
+
<ExampleTableRow>
|
|
12
|
+
<ExampleTableHeader>Size</ExampleTableHeader>
|
|
13
|
+
<ExampleTableHeader>Sample</ExampleTableHeader>
|
|
14
|
+
</ExampleTableRow>
|
|
15
|
+
<ExampleTableRow>
|
|
16
|
+
<ExampleTableCell>14px</ExampleTableCell>
|
|
17
|
+
<ExampleTableCell><Icon name="delete" size={14} /></ExampleTableCell>
|
|
18
|
+
</ExampleTableRow>
|
|
19
|
+
<ExampleTableRow>
|
|
20
|
+
<ExampleTableCell>16px</ExampleTableCell>
|
|
21
|
+
<ExampleTableCell><Icon name="delete" size={16} /></ExampleTableCell>
|
|
22
|
+
</ExampleTableRow>
|
|
23
|
+
<ExampleTableRow>
|
|
24
|
+
<ExampleTableCell>24px</ExampleTableCell>
|
|
25
|
+
<ExampleTableCell><Icon name="delete" size={24} /></ExampleTableCell>
|
|
26
|
+
</ExampleTableRow>
|
|
27
|
+
<ExampleTableRow>
|
|
28
|
+
<ExampleTableCell>32px</ExampleTableCell>
|
|
29
|
+
<ExampleTableCell><Icon name="delete" size={32} /></ExampleTableCell>
|
|
30
|
+
</ExampleTableRow>
|
|
31
|
+
<ExampleTableRow>
|
|
32
|
+
<ExampleTableCell>42px</ExampleTableCell>
|
|
33
|
+
<ExampleTableCell><Icon name="delete" size={42} /></ExampleTableCell>
|
|
34
|
+
</ExampleTableRow>
|
|
35
|
+
</ExampleTable>
|
|
36
|
+
|
|
37
|
+
<h2>Icons</h2>
|
|
38
|
+
</StoryWrapper>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const iconsPath = {
|
|
2
|
+
close: "m12.45 37.65-2.1-2.1L21.9 24 10.35 12.45l2.1-2.1L24 21.9l11.55-11.55 2.1 2.1L26.1 24l11.55 11.55-2.1 2.1L24 26.1Z",
|
|
3
|
+
add: "M22.5 38V25.5H10v-3h12.5V10h3v12.5H38v3H25.5V38Z",
|
|
4
|
+
back: "M24 40 8 24 24 8l2.1 2.1-12.4 12.4H40v3H13.7l12.4 12.4Z",
|
|
5
|
+
delete: "M13.05 42q-1.25 0-2.125-.875T10.05 39V10.5H8v-3h9.4V6h13.2v1.5H40v3h-2.05V39q0 1.2-.9 2.1-.9.9-2.1.9Zm21.9-31.5h-21.9V39h21.9Zm-16.6 24.2h3V14.75h-3Zm8.3 0h3V14.75h-3Zm-13.6-24.2V39Z",
|
|
6
|
+
remove: "M10 25.5v-3h28v3Z",
|
|
7
|
+
person: "M24 23.95q-3.3 0-5.4-2.1-2.1-2.1-2.1-5.4 0-3.3 2.1-5.4 2.1-2.1 5.4-2.1 3.3 0 5.4 2.1 2.1 2.1 2.1 5.4 0 3.3-2.1 5.4-2.1 2.1-5.4 2.1ZM8 40v-4.7q0-1.9.95-3.25T11.4 30q3.35-1.5 6.425-2.25Q20.9 27 24 27q3.1 0 6.15.775 3.05.775 6.4 2.225 1.55.7 2.5 2.05.95 1.35.95 3.25V40Zm3-3h26v-1.7q0-.8-.475-1.525-.475-.725-1.175-1.075-3.2-1.55-5.85-2.125Q26.85 30 24 30t-5.55.575q-2.7.575-5.85 2.125-.7.35-1.15 1.075Q11 34.5 11 35.3Zm13-16.05q1.95 0 3.225-1.275Q28.5 18.4 28.5 16.45q0-1.95-1.275-3.225Q25.95 11.95 24 11.95q-1.95 0-3.225 1.275Q19.5 14.5 19.5 16.45q0 1.95 1.275 3.225Q22.05 20.95 24 20.95Zm0-4.5ZM24 37Z",
|
|
8
|
+
menu: "M6 36v-3h36v3Zm0-10.5v-3h36v3ZM6 15v-3h36v3Z",
|
|
9
|
+
expand_more: "m24 30.75-12-12 2.15-2.15L24 26.5l9.85-9.85L36 18.8Z",
|
|
10
|
+
expand_less: "M14.15 30.75 12 28.6l12-12 12 11.95-2.15 2.15L24 20.85Z",
|
|
11
|
+
|
|
12
|
+
}
|
|
13
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Icon } from './Icon'
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
+
|
|
4
|
+
import { InputText } from "./InputText";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Form/InputText",
|
|
8
|
+
component: InputText,
|
|
9
|
+
args: {
|
|
10
|
+
type: "text",
|
|
11
|
+
},
|
|
12
|
+
} as ComponentMeta<typeof InputText>;
|
|
13
|
+
|
|
14
|
+
const Template: ComponentStory<typeof InputText> = (args) => (
|
|
15
|
+
<InputText {...args} />
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
export const Primary = Template.bind({});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { Theme } from "../../Theme/Theme";
|
|
3
|
+
|
|
4
|
+
export const InputTextField = styled.input`
|
|
5
|
+
background-color: ${Theme.colors.white};
|
|
6
|
+
border: 1px solid ${Theme.colors.gray_1};
|
|
7
|
+
width: 100%;
|
|
8
|
+
border-radius: 2px;
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
outline: 0;
|
|
11
|
+
font-family: "Lato", sans-serif;
|
|
12
|
+
padding: ${Theme.padding.s};
|
|
13
|
+
margin: 0;
|
|
14
|
+
font-size: ${Theme.fontSize.m};
|
|
15
|
+
|
|
16
|
+
:focus {
|
|
17
|
+
border-color: ${Theme.colors.primary};
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React, { FC } from "react";
|
|
2
|
+
import { InputTextField } from "./InputText.styles";
|
|
3
|
+
|
|
4
|
+
export interface IInputTextProps {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string | number;
|
|
7
|
+
name: string;
|
|
8
|
+
read?: boolean;
|
|
9
|
+
disable?: boolean;
|
|
10
|
+
size?: string;
|
|
11
|
+
onChange: any;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const InputText: FC<IInputTextProps> = ({
|
|
15
|
+
label,
|
|
16
|
+
value,
|
|
17
|
+
name,
|
|
18
|
+
read = false,
|
|
19
|
+
disable = false,
|
|
20
|
+
size = "normal",
|
|
21
|
+
onChange,
|
|
22
|
+
}) => {
|
|
23
|
+
return <InputTextField />;
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InputText } from "./InputText";
|