@omniumretail/component-library 1.0.74 → 1.0.75
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/.storybook/main.js +16 -16
- package/.storybook/preview-head.html +20 -20
- package/.storybook/preview.js +27 -27
- package/NPMPUBLISH.md +29 -29
- package/README.md +54 -54
- package/bitbucket-pipelines.yml +94 -94
- package/dist/bundle.js +247 -291
- package/dist/types/components/AnalyticsBar/AnalyticsBar.stories.d.ts +5 -5
- package/dist/types/components/AnalyticsBar/helpers/codeMutation.d.ts +4 -4
- package/dist/types/components/AnalyticsBar/index.d.ts +2 -2
- package/dist/types/components/AnalyticsBar/interfaces/analyticsBar.d.ts +12 -12
- package/dist/types/components/Button/Button.stories.d.ts +6 -6
- package/dist/types/components/Button/index.d.ts +7 -7
- package/dist/types/components/Category/Category.stories.d.ts +4 -4
- package/dist/types/components/Category/CategoryContent/index.d.ts +7 -7
- package/dist/types/components/Category/CategorySidebar/index.d.ts +26 -26
- package/dist/types/components/Category/index.d.ts +7 -7
- package/dist/types/components/CategoryReadOnly/CategoryReadOnly.stories.d.ts +4 -4
- package/dist/types/components/CategoryReadOnly/evaluationOptions.d.ts +10 -10
- package/dist/types/components/CategoryReadOnly/index.d.ts +9 -9
- package/dist/types/components/CategoryResponse/CategoryResponse.stories.d.ts +4 -4
- package/dist/types/components/CategoryResponse/evaluationOptions.d.ts +10 -10
- package/dist/types/components/CategoryResponse/index.d.ts +9 -9
- package/dist/types/components/DatePicker/DatePicker.stories.d.ts +5 -5
- package/dist/types/components/DatePicker/index.d.ts +8 -8
- package/dist/types/components/DatePickerTag/DatePickerTag.stories.d.ts +5 -5
- package/dist/types/components/DatePickerTag/index.d.ts +6 -6
- package/dist/types/components/Footer/Footer.stories.d.ts +5 -5
- package/dist/types/components/Footer/index.d.ts +4 -4
- package/dist/types/components/Input/Input.stories.d.ts +5 -5
- package/dist/types/components/Input/index.d.ts +10 -10
- package/dist/types/components/InputCountryCode/index.d.ts +10 -10
- package/dist/types/components/InputCountryCode/inputCountryCode.stories.d.ts +5 -5
- package/dist/types/components/Label/Label.stories.d.ts +6 -6
- package/dist/types/components/Label/index.d.ts +7 -7
- package/dist/types/components/Link/Link.stories.d.ts +7 -7
- package/dist/types/components/Link/index.d.ts +7 -7
- package/dist/types/components/Menu/Menu.stories.d.ts +5 -5
- package/dist/types/components/Menu/helpers/codeMutation.d.ts +4 -4
- package/dist/types/components/Menu/index.d.ts +3 -2
- package/dist/types/components/ModalConfirmation/ModalConfirmation.stories.d.ts +5 -5
- package/dist/types/components/ModalConfirmation/ModalStatusList.d.ts +5 -5
- package/dist/types/components/ModalConfirmation/index.d.ts +9 -9
- package/dist/types/components/ModalWithTable/ModalWithTable.stories.d.ts +5 -5
- package/dist/types/components/ModalWithTable/index.d.ts +13 -13
- package/dist/types/components/Navigation/Navigation.stories.d.ts +5 -5
- package/dist/types/components/Navigation/index.d.ts +10 -10
- package/dist/types/components/Notification/Notification.stories.d.ts +5 -5
- package/dist/types/components/Notification/index.d.ts +9 -9
- package/dist/types/components/Questions/Questions.stories.d.ts +4 -4
- package/dist/types/components/Questions/SingleQuestion/index.d.ts +1 -1
- package/dist/types/components/Questions/index.d.ts +5 -5
- package/dist/types/components/Radio/Radio.stories.d.ts +5 -5
- package/dist/types/components/Radio/index.d.ts +10 -10
- package/dist/types/components/Select/Select.stories.d.ts +6 -6
- package/dist/types/components/Select/index.d.ts +5 -5
- package/dist/types/components/Separator/Separator.stories.d.ts +6 -6
- package/dist/types/components/Separator/index.d.ts +11 -11
- package/dist/types/components/Sidebar/Sidebar.stories.d.ts +6 -6
- package/dist/types/components/Sidebar/index.d.ts +15 -15
- package/dist/types/components/Switch/Switch.stories.d.ts +5 -5
- package/dist/types/components/Switch/index.d.ts +2 -2
- package/dist/types/components/Table/Table.stories.d.ts +9 -9
- package/dist/types/components/Table/index.d.ts +37 -37
- package/dist/types/components/Tag/Tag.stories.d.ts +5 -5
- package/dist/types/components/Tag/index.d.ts +8 -8
- package/dist/types/components/Upload/Upload.stories.d.ts +4 -4
- package/dist/types/components/Upload/index.d.ts +8 -8
- package/dist/types/components/UserInfo/UserInfo.stories.d.ts +4 -4
- package/dist/types/components/UserInfo/index.d.ts +8 -8
- package/dist/types/components/index.d.ts +25 -25
- package/dist/types/constants/i18n.d.ts +1 -1
- package/dist/types/constants/translationHelper.d.ts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/package.json +198 -198
- package/src/assets/scss/_global.scss +89 -89
- package/src/assets/scss/index.scss +2 -2
- package/src/components/AnalyticsBar/AnalyticsBar.stories.tsx +236 -236
- package/src/components/AnalyticsBar/helpers/codeMutation.tsx +19 -19
- package/src/components/AnalyticsBar/index.tsx +76 -76
- package/src/components/AnalyticsBar/interfaces/analyticsBar.tsx +13 -13
- package/src/components/AnalyticsBar/styles.module.scss +108 -108
- package/src/components/Button/Button.stories.tsx +26 -26
- package/src/components/Button/index.tsx +24 -24
- package/src/components/Button/styles.module.scss +65 -65
- package/src/components/Category/Category.stories.tsx +88 -88
- package/src/components/Category/CategoryContent/index.tsx +188 -188
- package/src/components/Category/CategoryContent/styles.module.scss +51 -51
- package/src/components/Category/CategorySidebar/index.tsx +268 -268
- package/src/components/Category/CategorySidebar/styles.module.scss +28 -28
- package/src/components/Category/index.tsx +76 -76
- package/src/components/Category/styles.module.scss +13 -13
- package/src/components/CategoryReadOnly/CategoryReadOnly.stories.tsx +270 -270
- package/src/components/CategoryReadOnly/evaluationOptions.tsx +81 -81
- package/src/components/CategoryReadOnly/index.tsx +254 -254
- package/src/components/CategoryReadOnly/styles.module.scss +184 -184
- package/src/components/CategoryResponse/CategoryResponse.stories.tsx +251 -251
- package/src/components/CategoryResponse/evaluationOptions.tsx +81 -81
- package/src/components/CategoryResponse/index.tsx +277 -277
- package/src/components/CategoryResponse/styles.module.scss +180 -180
- package/src/components/DatePicker/DatePicker.stories.tsx +16 -16
- package/src/components/DatePicker/index.tsx +38 -38
- package/src/components/DatePicker/styles.module.scss +3 -3
- package/src/components/DatePickerTag/DatePickerTag.stories.tsx +19 -19
- package/src/components/DatePickerTag/index.tsx +89 -89
- package/src/components/DatePickerTag/styles.module.scss +31 -31
- package/src/components/Footer/Footer.stories.tsx +14 -14
- package/src/components/Footer/index.tsx +38 -38
- package/src/components/Footer/styles.module.scss +38 -38
- package/src/components/Input/Input.stories.tsx +13 -13
- package/src/components/Input/index.tsx +31 -31
- package/src/components/Input/styles.module.scss +8 -8
- package/src/components/InputCountryCode/index.tsx +75 -75
- package/src/components/InputCountryCode/inputCountryCode.stories.tsx +55 -55
- package/src/components/InputCountryCode/styles.module.scss +3 -3
- package/src/components/Label/Label.stories.tsx +21 -21
- package/src/components/Label/index.tsx +19 -19
- package/src/components/Label/styles.module.scss +16 -16
- package/src/components/Link/Link.stories.tsx +30 -30
- package/src/components/Link/index.tsx +21 -21
- package/src/components/Link/styles.module.scss +24 -24
- package/src/components/Menu/Menu.stories.tsx +178 -178
- package/src/components/Menu/helpers/codeMutation.tsx +19 -19
- package/src/components/Menu/index.tsx +23 -23
- package/src/components/ModalConfirmation/ModalConfirmation.stories.tsx +40 -40
- package/src/components/ModalConfirmation/ModalStatusList.tsx +5 -5
- package/src/components/ModalConfirmation/index.tsx +70 -70
- package/src/components/ModalConfirmation/styles.module.scss +62 -62
- package/src/components/ModalWithTable/ModalWithTable.stories.tsx +96 -96
- package/src/components/ModalWithTable/index.tsx +232 -232
- package/src/components/ModalWithTable/styles.module.scss +77 -77
- package/src/components/Navigation/Navigation.stories.tsx +17 -17
- package/src/components/Navigation/index.tsx +33 -33
- package/src/components/Navigation/styles.module.scss +59 -59
- package/src/components/Notification/Notification.stories.tsx +29 -29
- package/src/components/Notification/index.tsx +21 -21
- package/src/components/Questions/Questions.stories.tsx +37 -37
- package/src/components/Questions/SingleQuestion/index.tsx +84 -84
- package/src/components/Questions/SingleQuestion/styles.module.scss +81 -81
- package/src/components/Questions/index.tsx +78 -78
- package/src/components/Radio/Radio.stories.tsx +43 -43
- package/src/components/Radio/index.tsx +26 -26
- package/src/components/Radio/styles.module.scss +23 -23
- package/src/components/Select/Select.stories.tsx +39 -39
- package/src/components/Select/index.tsx +27 -27
- package/src/components/Select/styles.module.scss +13 -13
- package/src/components/Separator/Separator.stories.tsx +22 -22
- package/src/components/Separator/index.tsx +27 -27
- package/src/components/Separator/styles.module.scss +25 -25
- package/src/components/Sidebar/Sidebar.stories.tsx +85 -85
- package/src/components/Sidebar/index.tsx +103 -103
- package/src/components/Sidebar/styles.module.scss +85 -85
- package/src/components/Switch/Switch.stories.tsx +14 -14
- package/src/components/Switch/index.tsx +8 -8
- package/src/components/Switch/styles.module.scss +7 -7
- package/src/components/Table/Table.stories.tsx +222 -222
- package/src/components/Table/index.tsx +279 -275
- package/src/components/Table/styles.module.scss +75 -75
- package/src/components/Tag/Tag.stories.tsx +22 -22
- package/src/components/Tag/index.tsx +189 -189
- package/src/components/Tag/styles.module.scss +60 -60
- package/src/components/Upload/Upload.stories.tsx +45 -45
- package/src/components/Upload/index.tsx +91 -91
- package/src/components/UserInfo/UserInfo.stories.tsx +37 -37
- package/src/components/UserInfo/index.tsx +62 -62
- package/src/components/UserInfo/styles.module.scss +29 -29
- package/src/components/index.tsx +25 -25
- package/src/constants/i18n.ts +25 -25
- package/src/constants/translationHelper.ts +7 -7
- package/src/index.ts +2 -2
- package/src/locales/en.json +86 -86
- package/src/locales/es.json +86 -86
- package/src/locales/pt.json +86 -86
- package/src/types/Global.d.ts +4 -4
- package/tsconfig.json +29 -29
- package/webpack.config.js +51 -51
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export interface AnalyticsBarProps {
|
|
2
|
-
data: any;
|
|
3
|
-
selectOptions: any;
|
|
4
|
-
selectDefault: any;
|
|
5
|
-
selectUserOption?: any;
|
|
6
|
-
sortedBy?: any;
|
|
7
|
-
activeListItem?: any;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export enum sortBy {
|
|
11
|
-
asc = 'asc',
|
|
12
|
-
desc = 'desc',
|
|
13
|
-
}
|
|
1
|
+
export interface AnalyticsBarProps {
|
|
2
|
+
data: any;
|
|
3
|
+
selectOptions: any;
|
|
4
|
+
selectDefault: any;
|
|
5
|
+
selectUserOption?: any;
|
|
6
|
+
sortedBy?: any;
|
|
7
|
+
activeListItem?: any;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export enum sortBy {
|
|
11
|
+
asc = 'asc',
|
|
12
|
+
desc = 'desc',
|
|
13
|
+
}
|
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
.select {
|
|
2
|
-
width: 100%;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.analyticsbar {
|
|
6
|
-
background: #2C2D2E0D;
|
|
7
|
-
height: 100%;
|
|
8
|
-
position: relative;
|
|
9
|
-
|
|
10
|
-
:global {
|
|
11
|
-
.ant-menu-light {
|
|
12
|
-
background-color: transparent !important;
|
|
13
|
-
border-inline-end: none !important;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.ant-menu-title-content {
|
|
17
|
-
font-size: 17px;
|
|
18
|
-
line-height: 20px;
|
|
19
|
-
font-weight: var(--font-weight-semibold);
|
|
20
|
-
|
|
21
|
-
&:hover {
|
|
22
|
-
color: var(--color-orange);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.ant-menu-sub {
|
|
27
|
-
.ant-menu-title-content {
|
|
28
|
-
font-size: 15px;
|
|
29
|
-
line-height: 18px;
|
|
30
|
-
font-weight: var(--font-weight-medium);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.ant-menu-item {
|
|
34
|
-
height: 30px;
|
|
35
|
-
line-height: 30px;
|
|
36
|
-
|
|
37
|
-
&:first-child {
|
|
38
|
-
margin-top: -10px;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.ant-menu-submenu {
|
|
44
|
-
border-top: 1px solid var(--color-orange);
|
|
45
|
-
border-radius: 0;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.ant-menu-item {
|
|
49
|
-
&:hover {
|
|
50
|
-
background-color: initial !important;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.ant-menu-item-selected,
|
|
55
|
-
.ant-menu-submenu-selected >.ant-menu-submenu-title {
|
|
56
|
-
color: var(--color-orange);
|
|
57
|
-
background-color: initial;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.ant-menu-inline .ant-menu-sub.ant-menu-inline {
|
|
61
|
-
background: initial;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.ant-menu-submenu-title {
|
|
65
|
-
height: 50px !important;
|
|
66
|
-
line-height: 50px !important;
|
|
67
|
-
|
|
68
|
-
&:hover {
|
|
69
|
-
background-color: initial !important;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.anticon {
|
|
73
|
-
color: var(--color-orange);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.header {
|
|
80
|
-
position: absolute;
|
|
81
|
-
top: 24px;
|
|
82
|
-
left: 24px;
|
|
83
|
-
right: 24px;
|
|
84
|
-
height: 144px;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.sorterWrapper {
|
|
88
|
-
font-size: var(--font-size-body-2);
|
|
89
|
-
line-height: 14px;
|
|
90
|
-
font-weight: var(--font-weight-light);
|
|
91
|
-
display: inline-block;
|
|
92
|
-
padding: 12px;
|
|
93
|
-
cursor: pointer;
|
|
94
|
-
position: absolute;
|
|
95
|
-
right: 0;
|
|
96
|
-
top: 60px;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.content {
|
|
100
|
-
position: absolute;
|
|
101
|
-
top: 144px;
|
|
102
|
-
left: 24px;
|
|
103
|
-
right: 24px;
|
|
104
|
-
bottom: 0;
|
|
105
|
-
overflow-y: auto;
|
|
106
|
-
overflow-x: hidden;
|
|
107
|
-
padding-bottom: 24px;
|
|
108
|
-
}
|
|
1
|
+
.select {
|
|
2
|
+
width: 100%;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.analyticsbar {
|
|
6
|
+
background: #2C2D2E0D;
|
|
7
|
+
height: 100%;
|
|
8
|
+
position: relative;
|
|
9
|
+
|
|
10
|
+
:global {
|
|
11
|
+
.ant-menu-light {
|
|
12
|
+
background-color: transparent !important;
|
|
13
|
+
border-inline-end: none !important;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.ant-menu-title-content {
|
|
17
|
+
font-size: 17px;
|
|
18
|
+
line-height: 20px;
|
|
19
|
+
font-weight: var(--font-weight-semibold);
|
|
20
|
+
|
|
21
|
+
&:hover {
|
|
22
|
+
color: var(--color-orange);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ant-menu-sub {
|
|
27
|
+
.ant-menu-title-content {
|
|
28
|
+
font-size: 15px;
|
|
29
|
+
line-height: 18px;
|
|
30
|
+
font-weight: var(--font-weight-medium);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.ant-menu-item {
|
|
34
|
+
height: 30px;
|
|
35
|
+
line-height: 30px;
|
|
36
|
+
|
|
37
|
+
&:first-child {
|
|
38
|
+
margin-top: -10px;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.ant-menu-submenu {
|
|
44
|
+
border-top: 1px solid var(--color-orange);
|
|
45
|
+
border-radius: 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.ant-menu-item {
|
|
49
|
+
&:hover {
|
|
50
|
+
background-color: initial !important;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.ant-menu-item-selected,
|
|
55
|
+
.ant-menu-submenu-selected >.ant-menu-submenu-title {
|
|
56
|
+
color: var(--color-orange);
|
|
57
|
+
background-color: initial;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.ant-menu-inline .ant-menu-sub.ant-menu-inline {
|
|
61
|
+
background: initial;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.ant-menu-submenu-title {
|
|
65
|
+
height: 50px !important;
|
|
66
|
+
line-height: 50px !important;
|
|
67
|
+
|
|
68
|
+
&:hover {
|
|
69
|
+
background-color: initial !important;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.anticon {
|
|
73
|
+
color: var(--color-orange);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.header {
|
|
80
|
+
position: absolute;
|
|
81
|
+
top: 24px;
|
|
82
|
+
left: 24px;
|
|
83
|
+
right: 24px;
|
|
84
|
+
height: 144px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.sorterWrapper {
|
|
88
|
+
font-size: var(--font-size-body-2);
|
|
89
|
+
line-height: 14px;
|
|
90
|
+
font-weight: var(--font-weight-light);
|
|
91
|
+
display: inline-block;
|
|
92
|
+
padding: 12px;
|
|
93
|
+
cursor: pointer;
|
|
94
|
+
position: absolute;
|
|
95
|
+
right: 0;
|
|
96
|
+
top: 60px;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.content {
|
|
100
|
+
position: absolute;
|
|
101
|
+
top: 144px;
|
|
102
|
+
left: 24px;
|
|
103
|
+
right: 24px;
|
|
104
|
+
bottom: 0;
|
|
105
|
+
overflow-y: auto;
|
|
106
|
+
overflow-x: hidden;
|
|
107
|
+
padding-bottom: 24px;
|
|
108
|
+
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { Meta, Story } from "@storybook/react";
|
|
2
|
-
import { Button, CustomButtonProps } from '.';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Button',
|
|
6
|
-
component: Button,
|
|
7
|
-
} as Meta;
|
|
8
|
-
|
|
9
|
-
const Template: Story<CustomButtonProps> = (args) => <Button {...args}>ola</Button>;
|
|
10
|
-
|
|
11
|
-
export const Primary = Template.bind({});
|
|
12
|
-
Primary.args = {
|
|
13
|
-
href: '#',
|
|
14
|
-
iconAlignRight: true,
|
|
15
|
-
type: 'link',
|
|
16
|
-
customClass: 'ola'
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export const Secondary = Template.bind({});
|
|
21
|
-
Secondary.args = {
|
|
22
|
-
href: '#',
|
|
23
|
-
iconAlignRight: true,
|
|
24
|
-
type: 'link',
|
|
25
|
-
ghost: true
|
|
26
|
-
};
|
|
1
|
+
import { Meta, Story } from "@storybook/react";
|
|
2
|
+
import { Button, CustomButtonProps } from '.';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Button',
|
|
6
|
+
component: Button,
|
|
7
|
+
} as Meta;
|
|
8
|
+
|
|
9
|
+
const Template: Story<CustomButtonProps> = (args) => <Button {...args}>ola</Button>;
|
|
10
|
+
|
|
11
|
+
export const Primary = Template.bind({});
|
|
12
|
+
Primary.args = {
|
|
13
|
+
href: '#',
|
|
14
|
+
iconAlignRight: true,
|
|
15
|
+
type: 'link',
|
|
16
|
+
customClass: 'ola'
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export const Secondary = Template.bind({});
|
|
21
|
+
Secondary.args = {
|
|
22
|
+
href: '#',
|
|
23
|
+
iconAlignRight: true,
|
|
24
|
+
type: 'link',
|
|
25
|
+
ghost: true
|
|
26
|
+
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { Button as AntButton, ButtonProps } from 'antd';
|
|
2
|
-
import styles from './styles.module.scss';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
|
|
5
|
-
export interface CustomButtonProps extends ButtonProps {
|
|
6
|
-
iconAlignRight?: boolean;
|
|
7
|
-
buttonStyle?: string;
|
|
8
|
-
customClass?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const Button = ({customClass, ...props}: CustomButtonProps) => {
|
|
12
|
-
const { iconAlignRight, buttonStyle } = props;
|
|
13
|
-
|
|
14
|
-
const buttonClasses = {
|
|
15
|
-
[styles.button]: true,
|
|
16
|
-
[styles["button--iconPositionStyle"]]: iconAlignRight === true,
|
|
17
|
-
[styles["button--style1"]]: buttonStyle === "style1",
|
|
18
|
-
[`${customClass}`]: customClass,
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<AntButton { ...props } className={ classNames(buttonClasses) } />
|
|
23
|
-
);
|
|
24
|
-
};
|
|
1
|
+
import { Button as AntButton, ButtonProps } from 'antd';
|
|
2
|
+
import styles from './styles.module.scss';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
|
|
5
|
+
export interface CustomButtonProps extends ButtonProps {
|
|
6
|
+
iconAlignRight?: boolean;
|
|
7
|
+
buttonStyle?: string;
|
|
8
|
+
customClass?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const Button = ({customClass, ...props}: CustomButtonProps) => {
|
|
12
|
+
const { iconAlignRight, buttonStyle } = props;
|
|
13
|
+
|
|
14
|
+
const buttonClasses = {
|
|
15
|
+
[styles.button]: true,
|
|
16
|
+
[styles["button--iconPositionStyle"]]: iconAlignRight === true,
|
|
17
|
+
[styles["button--style1"]]: buttonStyle === "style1",
|
|
18
|
+
[`${customClass}`]: customClass,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<AntButton { ...props } className={ classNames(buttonClasses) } />
|
|
23
|
+
);
|
|
24
|
+
};
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
.button {
|
|
2
|
-
padding: 12px 24px;
|
|
3
|
-
border-radius: 4px;
|
|
4
|
-
min-width: 170px;
|
|
5
|
-
display: inline-flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
justify-content: center;
|
|
8
|
-
align-self: flex-start;
|
|
9
|
-
text-decoration: none;
|
|
10
|
-
border: none;
|
|
11
|
-
font-size: 14px;
|
|
12
|
-
line-height: 16.8px;
|
|
13
|
-
font-weight: 700;
|
|
14
|
-
font-family: 'Silka', sans-serif;
|
|
15
|
-
background-color: var(--button-default-background);
|
|
16
|
-
color: var(--button-default-text-color);
|
|
17
|
-
|
|
18
|
-
&:hover {
|
|
19
|
-
background-color: var(--button-default-background-hover-color);
|
|
20
|
-
color: var(--button-default-text-hover-color) !important;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
&:focus,
|
|
24
|
-
&:active,
|
|
25
|
-
&:focus:active {
|
|
26
|
-
background-color: var(--button-default-background-focus-color);
|
|
27
|
-
color: var(--button-default-text-focus-color);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
&:disabled,
|
|
31
|
-
&.disabled {
|
|
32
|
-
background-color: var(--button-disabled-background-color);
|
|
33
|
-
color: var(--button-disabled-default-text-color);
|
|
34
|
-
pointer-events: none;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
&--iconPositionStyle {
|
|
38
|
-
flex-direction: row-reverse;
|
|
39
|
-
gap: 5px;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
&--style1 {
|
|
43
|
-
background-color: var(--button-style-1-background);
|
|
44
|
-
color: var(--button-style-1-text-color);
|
|
45
|
-
|
|
46
|
-
&:hover {
|
|
47
|
-
background-color: var(--button-style-1-background-hover-color);
|
|
48
|
-
color: var(--button-style-1-text-hover-color) !important;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
&:focus,
|
|
52
|
-
&:active,
|
|
53
|
-
&:focus:active {
|
|
54
|
-
background-color: var(--button-style-1-background-focus-color);
|
|
55
|
-
color: var(--button-style-1-text-focus-color);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
&:disabled,
|
|
59
|
-
&.disabled {
|
|
60
|
-
background-color: var(--button-disabled-background-color);
|
|
61
|
-
color: var(--button-disabled-default-text-color);
|
|
62
|
-
pointer-events: none;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
1
|
+
.button {
|
|
2
|
+
padding: 12px 24px;
|
|
3
|
+
border-radius: 4px;
|
|
4
|
+
min-width: 170px;
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
align-self: flex-start;
|
|
9
|
+
text-decoration: none;
|
|
10
|
+
border: none;
|
|
11
|
+
font-size: 14px;
|
|
12
|
+
line-height: 16.8px;
|
|
13
|
+
font-weight: 700;
|
|
14
|
+
font-family: 'Silka', sans-serif;
|
|
15
|
+
background-color: var(--button-default-background);
|
|
16
|
+
color: var(--button-default-text-color);
|
|
17
|
+
|
|
18
|
+
&:hover {
|
|
19
|
+
background-color: var(--button-default-background-hover-color);
|
|
20
|
+
color: var(--button-default-text-hover-color) !important;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&:focus,
|
|
24
|
+
&:active,
|
|
25
|
+
&:focus:active {
|
|
26
|
+
background-color: var(--button-default-background-focus-color);
|
|
27
|
+
color: var(--button-default-text-focus-color);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&:disabled,
|
|
31
|
+
&.disabled {
|
|
32
|
+
background-color: var(--button-disabled-background-color);
|
|
33
|
+
color: var(--button-disabled-default-text-color);
|
|
34
|
+
pointer-events: none;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&--iconPositionStyle {
|
|
38
|
+
flex-direction: row-reverse;
|
|
39
|
+
gap: 5px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&--style1 {
|
|
43
|
+
background-color: var(--button-style-1-background);
|
|
44
|
+
color: var(--button-style-1-text-color);
|
|
45
|
+
|
|
46
|
+
&:hover {
|
|
47
|
+
background-color: var(--button-style-1-background-hover-color);
|
|
48
|
+
color: var(--button-style-1-text-hover-color) !important;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&:focus,
|
|
52
|
+
&:active,
|
|
53
|
+
&:focus:active {
|
|
54
|
+
background-color: var(--button-style-1-background-focus-color);
|
|
55
|
+
color: var(--button-style-1-text-focus-color);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&:disabled,
|
|
59
|
+
&.disabled {
|
|
60
|
+
background-color: var(--button-disabled-background-color);
|
|
61
|
+
color: var(--button-disabled-default-text-color);
|
|
62
|
+
pointer-events: none;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -1,88 +1,88 @@
|
|
|
1
|
-
import { Meta, Story } from "@storybook/react";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import { Category } from '.';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Category',
|
|
7
|
-
component: Category,
|
|
8
|
-
} as Meta;
|
|
9
|
-
|
|
10
|
-
const Template: Story<any> = (args) => {
|
|
11
|
-
const [serverData, setServerData] = useState<any>();
|
|
12
|
-
|
|
13
|
-
// useEffect(() => {
|
|
14
|
-
// console.log(serverData);
|
|
15
|
-
// }, [serverData])
|
|
16
|
-
|
|
17
|
-
return <Category {...args} serverReadyData={setServerData} data={[
|
|
18
|
-
{
|
|
19
|
-
"title": "2 (Q: 0) (G: 2)",
|
|
20
|
-
"key": "0",
|
|
21
|
-
"data": {
|
|
22
|
-
"categoryName": "2",
|
|
23
|
-
"openAnswer": false,
|
|
24
|
-
"generalEvaluationLevel": "0",
|
|
25
|
-
"grade": "2",
|
|
26
|
-
"questions": []
|
|
27
|
-
},
|
|
28
|
-
"children": []
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"title": "1 (Q: 0) (G: 1)",
|
|
32
|
-
"key": "1",
|
|
33
|
-
"data": {
|
|
34
|
-
"categoryName": "1",
|
|
35
|
-
"openAnswer": false,
|
|
36
|
-
"generalEvaluationLevel": "0",
|
|
37
|
-
"grade": "1",
|
|
38
|
-
"questions": []
|
|
39
|
-
},
|
|
40
|
-
"children": [
|
|
41
|
-
{
|
|
42
|
-
"title": "1.1 (Q: 0) (G: 1.1)",
|
|
43
|
-
"key": "1.0",
|
|
44
|
-
"data": {
|
|
45
|
-
"categoryName": "1.1",
|
|
46
|
-
"openAnswer": false,
|
|
47
|
-
"generalEvaluationLevel": "0",
|
|
48
|
-
"grade": "1.1",
|
|
49
|
-
"questions": []
|
|
50
|
-
},
|
|
51
|
-
"children": [
|
|
52
|
-
{
|
|
53
|
-
"title": "1.1.1 (Q: 0) (G: 1.1.1)",
|
|
54
|
-
"key": "1.0.0",
|
|
55
|
-
"data": {
|
|
56
|
-
"categoryName": "1.1.1",
|
|
57
|
-
"openAnswer": false,
|
|
58
|
-
"generalEvaluationLevel": "0",
|
|
59
|
-
"grade": "1.1.1",
|
|
60
|
-
"questions": []
|
|
61
|
-
},
|
|
62
|
-
"children": []
|
|
63
|
-
}
|
|
64
|
-
]
|
|
65
|
-
}
|
|
66
|
-
]
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
"title": "3 (Q: 0) (G: 3)",
|
|
70
|
-
"key": "2",
|
|
71
|
-
"data": {
|
|
72
|
-
"categoryName": "3",
|
|
73
|
-
"openAnswer": false,
|
|
74
|
-
"generalEvaluationLevel": "0",
|
|
75
|
-
"grade": "3",
|
|
76
|
-
"questions": []
|
|
77
|
-
},
|
|
78
|
-
"children": []
|
|
79
|
-
}
|
|
80
|
-
]}></Category>
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
export const Primary = Template.bind({});
|
|
84
|
-
Primary.args = {
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
1
|
+
import { Meta, Story } from "@storybook/react";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { Category } from '.';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Category',
|
|
7
|
+
component: Category,
|
|
8
|
+
} as Meta;
|
|
9
|
+
|
|
10
|
+
const Template: Story<any> = (args) => {
|
|
11
|
+
const [serverData, setServerData] = useState<any>();
|
|
12
|
+
|
|
13
|
+
// useEffect(() => {
|
|
14
|
+
// console.log(serverData);
|
|
15
|
+
// }, [serverData])
|
|
16
|
+
|
|
17
|
+
return <Category {...args} serverReadyData={setServerData} data={[
|
|
18
|
+
{
|
|
19
|
+
"title": "2 (Q: 0) (G: 2)",
|
|
20
|
+
"key": "0",
|
|
21
|
+
"data": {
|
|
22
|
+
"categoryName": "2",
|
|
23
|
+
"openAnswer": false,
|
|
24
|
+
"generalEvaluationLevel": "0",
|
|
25
|
+
"grade": "2",
|
|
26
|
+
"questions": []
|
|
27
|
+
},
|
|
28
|
+
"children": []
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"title": "1 (Q: 0) (G: 1)",
|
|
32
|
+
"key": "1",
|
|
33
|
+
"data": {
|
|
34
|
+
"categoryName": "1",
|
|
35
|
+
"openAnswer": false,
|
|
36
|
+
"generalEvaluationLevel": "0",
|
|
37
|
+
"grade": "1",
|
|
38
|
+
"questions": []
|
|
39
|
+
},
|
|
40
|
+
"children": [
|
|
41
|
+
{
|
|
42
|
+
"title": "1.1 (Q: 0) (G: 1.1)",
|
|
43
|
+
"key": "1.0",
|
|
44
|
+
"data": {
|
|
45
|
+
"categoryName": "1.1",
|
|
46
|
+
"openAnswer": false,
|
|
47
|
+
"generalEvaluationLevel": "0",
|
|
48
|
+
"grade": "1.1",
|
|
49
|
+
"questions": []
|
|
50
|
+
},
|
|
51
|
+
"children": [
|
|
52
|
+
{
|
|
53
|
+
"title": "1.1.1 (Q: 0) (G: 1.1.1)",
|
|
54
|
+
"key": "1.0.0",
|
|
55
|
+
"data": {
|
|
56
|
+
"categoryName": "1.1.1",
|
|
57
|
+
"openAnswer": false,
|
|
58
|
+
"generalEvaluationLevel": "0",
|
|
59
|
+
"grade": "1.1.1",
|
|
60
|
+
"questions": []
|
|
61
|
+
},
|
|
62
|
+
"children": []
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"title": "3 (Q: 0) (G: 3)",
|
|
70
|
+
"key": "2",
|
|
71
|
+
"data": {
|
|
72
|
+
"categoryName": "3",
|
|
73
|
+
"openAnswer": false,
|
|
74
|
+
"generalEvaluationLevel": "0",
|
|
75
|
+
"grade": "3",
|
|
76
|
+
"questions": []
|
|
77
|
+
},
|
|
78
|
+
"children": []
|
|
79
|
+
}
|
|
80
|
+
]}></Category>
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export const Primary = Template.bind({});
|
|
84
|
+
Primary.args = {
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|