@councilbox/councilbox-ui 1.0.1 → 2.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/dist/HOCs/useDynamicStyles.js +99 -0
- package/dist/HOCs/useRipple.js +91 -0
- package/dist/build-index.js +8 -0
- package/dist/components/1.Introduction.stories.mdx +2 -1
- package/dist/components/2.Changelog.stories.mdx +3 -0
- package/dist/components/3.Guide.stories.mdx +56 -0
- package/dist/components/Accordion/Accordion.css +39 -1
- package/dist/components/Accordion/Accordion.js +84 -45
- package/dist/components/Accordion/Accordion.stories.js +4 -2
- package/dist/components/Accordion/AccordionOld.css +16 -0
- package/dist/components/Accordion/AccordionOld.js +115 -0
- package/dist/components/Accordion/DesignAccordion.stories.js +38 -0
- package/dist/components/Alert/Alert.css +5 -0
- package/dist/components/Alert/Alert.js +17 -6
- package/dist/components/Avatar/Avatar.css +3 -3
- package/dist/components/Avatar/Avatar.js +36 -20
- package/dist/components/Avatar/AvatarOld.js +138 -0
- package/dist/components/Avatar/DesignAvatar.stories.js +1 -1
- package/dist/components/Block/Block.js +17 -2
- package/dist/components/ButtonBasic/ButtonBasic.css +264 -20
- package/dist/components/ButtonBasic/ButtonBasic.js +85 -110
- package/dist/components/ButtonBasic/ButtonBasicOld.css +41 -0
- package/dist/components/ButtonBasic/ButtonBasicOld.js +231 -0
- package/dist/components/Checkbox/Checkbox.css +101 -22
- package/dist/components/Checkbox/Checkbox.js +119 -63
- package/dist/components/Checkbox/CheckboxOld.css +31 -0
- package/dist/components/Checkbox/CheckboxOld.js +112 -0
- package/dist/components/DragDrop/DragDrop.js +24 -9
- package/dist/components/DrawerPanel/DesignDrawerPanel.js +4 -2
- package/dist/components/DrawerPanel/DrawerPanel.css +76 -36
- package/dist/components/DrawerPanel/DrawerPanel.js +137 -115
- package/dist/components/DrawerPanel/DrawerPanelOld.css +56 -0
- package/dist/components/DrawerPanel/DrawerPanelOld.js +233 -0
- package/dist/components/DropDown/DesignDropDown.stories.js +146 -17
- package/dist/components/DropDown/DropDown.css +96 -1
- package/dist/components/DropDown/DropDown.js +308 -82
- package/dist/components/DropDown/DropDown.stories.js +1 -0
- package/dist/components/DropDown/DropDownOld.css +3 -0
- package/dist/components/DropDown/DropDownOld.js +186 -0
- package/dist/components/DropDown/PopoverPlayground.css +22 -0
- package/dist/components/DropDown/PopoverPlayground.js +235 -0
- package/dist/components/EnhancedTable/EnhancedTable.js +5 -6
- package/dist/components/FabButton/DesignFabButton.stories.js +3 -1
- package/dist/components/FabButton/FabButton.js +25 -5
- package/dist/components/Grid/DesignGrid.stories.js +9 -3
- package/dist/components/Grid/Grid.css +325 -0
- package/dist/components/Grid/Grid.js +57 -16
- package/dist/components/Grid/GridItem.js +31 -13
- package/dist/components/Grid/GridItemOld.js +43 -0
- package/dist/components/Grid/GridOld.css +0 -0
- package/dist/components/Grid/GridOld.js +53 -0
- package/dist/components/Header/Header.js +95 -116
- package/dist/components/IconButton/DesignIconButton.stories.js +22 -2
- package/dist/components/IconButton/IconButton.css +121 -1
- package/dist/components/IconButton/IconButton.js +98 -53
- package/dist/components/IconButton/IconButtonOld.css +0 -0
- package/dist/components/IconButton/IconButtonOld.js +138 -0
- package/dist/components/IconButtonSquare/IconButtonSquare.js +20 -90
- package/dist/components/IconButtonSquare/IconButtonSquareOld.css +43 -0
- package/dist/components/IconButtonSquare/IconButtonSquareOld.js +133 -0
- package/dist/components/InputAutocomplete/InputAutocomplete.css +109 -0
- package/dist/components/InputAutocomplete/InputAutocomplete.js +382 -76
- package/dist/components/InputAutocomplete/InputAutocomplete.stories.js +118 -6
- package/dist/components/InputAutocomplete/InputAutocompleteOld.css +5 -0
- package/dist/components/InputAutocomplete/InputAutocompleteOld.js +178 -0
- package/dist/components/InputPassword/InputPassword.js +10 -20
- package/dist/components/InputText/InputText.css +442 -1
- package/dist/components/InputText/InputText.js +298 -239
- package/dist/components/InputText/InputText.stories.js +12 -3
- package/dist/components/InputText/InputTextOld.css +10 -0
- package/dist/components/InputText/InputTextOld.js +340 -0
- package/dist/components/InputTextArea/DesignInputTextArea.stories.js +30 -4
- package/dist/components/InputTextArea/InputTextArea.js +13 -6
- package/dist/components/LoadingSection/LoadingSection.css +44 -2
- package/dist/components/LoadingSection/LoadingSection.js +63 -9
- package/dist/components/MenuItem/DesignMenuItem.stories.js +1 -0
- package/dist/components/MenuItem/MenuItem.css +35 -6
- package/dist/components/MenuItem/MenuItem.js +99 -50
- package/dist/components/MenuItem/MenuItemOld.js +139 -0
- package/dist/components/MenuLateralLeft/MenuLateralLeft.js +60 -40
- package/dist/components/MenuLateralRight/MenuLateralRight.js +23 -8
- package/dist/components/Modal/DesignModal.stories.js +54 -0
- package/dist/components/Modal/Modal.css +81 -2
- package/dist/components/Modal/Modal.js +112 -80
- package/dist/components/Modal/Modal.stories.js +13 -2
- package/dist/components/Modal/ModalOld.css +3 -0
- package/dist/components/Modal/ModalOld.js +230 -0
- package/dist/components/PaginationFooter/DesignPaginationFooter.stories.js +9 -1
- package/dist/components/PaginationFooter/PaginationFooter.css +73 -0
- package/dist/components/PaginationFooter/PaginationFooter.js +45 -87
- package/dist/components/RadioButton/Radio.css +115 -16
- package/dist/components/RadioButton/Radio.js +70 -94
- package/dist/components/RadioButton/Radio.stories.js +42 -18
- package/dist/components/RadioButton/RadioOld.css +31 -0
- package/dist/components/RadioButton/RadioOld.js +142 -0
- package/dist/components/Ripple/DesignRipple.js +77 -0
- package/dist/components/Ripple/Ripple.stories.js +45 -0
- package/dist/components/Scrollbar/Scrollbar.js +21 -6
- package/dist/components/SelectInput/DesignSelectInput.js +62 -23
- package/dist/components/SelectInput/SelectInput.css +128 -10
- package/dist/components/SelectInput/SelectInput.js +265 -244
- package/dist/components/SelectInput/SelectInputOld.css +17 -0
- package/dist/components/SelectInput/SelectInputOld.js +325 -0
- package/dist/components/Stars/Stars.css +28 -28
- package/dist/components/Stars/Stars.js +22 -12
- package/dist/components/Stepper/Stepper.css +1 -0
- package/dist/components/Stepper/Stepper.js +81 -24
- package/dist/components/Table/DesignTable.stories.js +1 -0
- package/dist/components/Table/Table.css +56 -53
- package/dist/components/Table/Table.js +55 -75
- package/dist/components/Table/TableOld.css +79 -0
- package/dist/components/Table/TableOld.js +165 -0
- package/dist/components/Tabs/DesignTabs.js +37 -12
- package/dist/components/Tabs/Tabs.css +39 -4
- package/dist/components/Tabs/Tabs.js +194 -30
- package/dist/components/Tabs/Tabs.stories.js +8 -1
- package/dist/components/Tabs/TabsOld.js +92 -0
- package/dist/components/Tag/Tag.js +19 -9
- package/dist/components/Toggle/Toggle.css +122 -3
- package/dist/components/Toggle/Toggle.js +95 -68
- package/dist/components/Tooltip/DesignTooltip.stories.js +48 -0
- package/dist/components/Tooltip/Tooltip.css +75 -0
- package/dist/components/Tooltip/Tooltip.js +126 -0
- package/dist/components/Tooltip/Tooltip.stories.js +40 -0
- package/dist/components/Typography/Typography.css +9 -0
- package/dist/components/Typography/Typography.js +30 -21
- package/dist/components/Typography/TypographyOld.js +132 -0
- package/dist/styles/colorConsts.css +24 -0
- package/dist/styles/main.css +41 -49
- package/dist/styles/scpacingConsts.css +26 -0
- package/dist/styles/zIndexConsts.css +9 -0
- package/dist/testing/TestAutocomplete.js +369 -0
- package/dist/testing/TestComponents.js +3 -114
- package/dist/testing/TestDropdown.js +225 -0
- package/dist/utils/autoDetectScroll.js +127 -0
- package/dist/utils/index.js +141 -0
- package/package.json +2 -1
|
@@ -1,33 +1,242 @@
|
|
|
1
|
-
.cbx-buttonBasic
|
|
2
|
-
display: flex;
|
|
1
|
+
.cbx-buttonBasic {
|
|
2
|
+
display: inline-flex;
|
|
3
3
|
align-items: center;
|
|
4
|
-
justify-content:
|
|
4
|
+
justify-content: center;
|
|
5
5
|
position: relative;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
outline: 0;
|
|
8
|
+
margin: 0;
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
vertical-align: middle;
|
|
11
|
+
text-decoration: none;
|
|
12
|
+
font-family: var(--font-primary);
|
|
13
|
+
font-weight: 500;
|
|
14
|
+
font-size: 1rem;
|
|
15
|
+
text-transform: uppercase;
|
|
16
|
+
min-width: 64px;
|
|
17
|
+
padding: 6px 16px;
|
|
18
|
+
border-radius: 4px;
|
|
19
|
+
height: 3rem;
|
|
20
|
+
padding-top: 0.75rem;
|
|
21
|
+
padding-bottom: 0.75rem;
|
|
22
|
+
padding-left: var(--spacing24);
|
|
23
|
+
padding-right: var(--spacing24);
|
|
24
|
+
box-shadow: none;
|
|
25
|
+
line-height: 1.5rem;
|
|
26
|
+
transition: all .3s;
|
|
27
|
+
border: 0;
|
|
28
|
+
user-select: none;
|
|
29
|
+
-webkit-user-select: none;
|
|
30
|
+
-moz-user-select: none;
|
|
31
|
+
-ms-user-select: none;
|
|
6
32
|
}
|
|
7
33
|
|
|
8
|
-
.cbx-buttonBasic
|
|
9
|
-
|
|
10
|
-
.cbx-buttonBasic-container-end-icon {
|
|
11
|
-
width: 1.5rem;
|
|
12
|
-
height: 1.5rem;
|
|
34
|
+
.cbx-buttonBasic:focus {
|
|
35
|
+
outline: none;
|
|
13
36
|
}
|
|
14
37
|
|
|
15
|
-
.cbx-buttonBasic-
|
|
16
|
-
|
|
38
|
+
.cbx-buttonBasic.cbx-primary {
|
|
39
|
+
background-color: var(--primary);
|
|
40
|
+
color: var(--white);
|
|
41
|
+
border: 0;
|
|
17
42
|
}
|
|
18
43
|
|
|
19
|
-
.cbx-buttonBasic-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
margin-left: 0.75rem;
|
|
44
|
+
.cbx-buttonBasic.cbx-buttonBasic-disabled.cbx-primary {
|
|
45
|
+
background-color: var(--primary25);
|
|
46
|
+
cursor: default;
|
|
23
47
|
}
|
|
24
48
|
|
|
25
|
-
.cbx-buttonBasic-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
49
|
+
.cbx-buttonBasic.cbx-buttonBasic-fullWidth {
|
|
50
|
+
width: 100%;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.cbx-buttonBasic .cbx-buttonBasic-container span,
|
|
54
|
+
.cbx-buttonBasic:hover .cbx-buttonBasic-container .cbx-buttonBasic-container-start-icon,
|
|
55
|
+
.cbx-buttonBasic:hover .cbx-buttonBasic-container .cbx-buttonBasic-container-end-icon {
|
|
56
|
+
transition: .2s;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.cbx-buttonBasic.cbx-primary .cbx-buttonBasic-container span,
|
|
60
|
+
.cbx-buttonBasic.cbx-primary:hover .cbx-buttonBasic-container .cbx-buttonBasic-container-start-icon,
|
|
61
|
+
.cbx-buttonBasic.cbx-primary:hover .cbx-buttonBasic-container .cbx-buttonBasic-container-end-icon {
|
|
62
|
+
color: var(--white);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.cbx-buttonBasic.cbx-primary:not(.cbx-buttonBasic-disabled):hover .cbx-buttonBasic-container span,
|
|
66
|
+
.cbx-buttonBasic.cbx-primary:hover .cbx-buttonBasic-container .cbx-buttonBasic-container-start-icon,
|
|
67
|
+
.cbx-buttonBasic.cbx-primary:hover .cbx-buttonBasic-container .cbx-buttonBasic-container-end-icon {
|
|
68
|
+
color: var(--accent);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.cbx-buttonBasic.cbx-primary.cbx-success {
|
|
72
|
+
background-color: var(--success);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.cbx-buttonBasic.cbx-primary.cbx-error {
|
|
76
|
+
background-color: var(--error);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.cbx-buttonBasic.cbx-secondary {
|
|
80
|
+
color: var(--primary);
|
|
81
|
+
background-color: transparent;
|
|
82
|
+
border: 0.063rem solid var(--primary);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.cbx-buttonBasic.cbx-secondary.cbx-success {
|
|
86
|
+
border: 0.063rem solid var(--success);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.cbx-buttonBasic.cbx-secondary.cbx-success .cbx-buttonBasic-container span,
|
|
90
|
+
.cbx-buttonBasic.cbx-secondary.cbx-success .cbx-buttonBasic-container .cbx-buttonBasic-container-start-icon,
|
|
91
|
+
.cbx-buttonBasic.cbx-secondary.cbx-success .cbx-buttonBasic-container .cbx-buttonBasic-container-end-icon {
|
|
92
|
+
color: var(--success);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.cbx-buttonBasic.cbx-secondary.cbx-success:hover .cbx-buttonBasic-container span,
|
|
96
|
+
.cbx-buttonBasic.cbx-secondary.cbx-success:hover .cbx-buttonBasic-container .cbx-buttonBasic-container-start-icon,
|
|
97
|
+
.cbx-buttonBasic.cbx-secondary.cbx-success:hover .cbx-buttonBasic-container .cbx-buttonBasic-container-end-icon {
|
|
98
|
+
color: var(--success);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.cbx-buttonBasic.cbx-secondary.cbx-success:hover {
|
|
102
|
+
background-color: transparent;
|
|
103
|
+
border: 0.063rem solid var(--success);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.cbx-buttonBasic.cbx-secondary.cbx-error {
|
|
107
|
+
border: 0.063rem solid var(--error);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.cbx-buttonBasic.cbx-secondary.cbx-error .cbx-buttonBasic-container span,
|
|
111
|
+
.cbx-buttonBasic.cbx-secondary.cbx-error .cbx-buttonBasic-container .cbx-buttonBasic-container-start-icon,
|
|
112
|
+
.cbx-buttonBasic.cbx-secondary.cbx-error .cbx-buttonBasic-container .cbx-buttonBasic-container-end-icon {
|
|
113
|
+
color: var(--error);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.cbx-buttonBasic.cbx-secondary.cbx-error:hover .cbx-buttonBasic-container span,
|
|
117
|
+
.cbx-buttonBasic.cbx-secondary.cbx-error:hover .cbx-buttonBasic-container .cbx-buttonBasic-container-start-icon,
|
|
118
|
+
.cbx-buttonBasic.cbx-secondary.cbx-error:hover .cbx-buttonBasic-container .cbx-buttonBasic-container-end-icon {
|
|
119
|
+
color: var(--error);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.cbx-buttonBasic.cbx-secondary.cbx-error:hover {
|
|
123
|
+
background-color: transparent;
|
|
124
|
+
border: 0.063rem solid var(--error);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.cbx-buttonBasic.cbx-secondary:hover {
|
|
128
|
+
border: 0.063rem solid var(--primary);
|
|
129
|
+
background-color: var(--accent25);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.cbx-buttonBasic.cbx-secondary.cbx-buttonBasic-disabled:hover {
|
|
133
|
+
background-color: transparent;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.cbx-buttonBasic.cbx-secondary .cbx-buttonBasic-container span {
|
|
137
|
+
color: var(--primary);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.cbx-buttonBasic.cbx-buttonBasic-disabled.cbx-secondary {
|
|
141
|
+
border: 0.063rem solid var(--primary25);
|
|
142
|
+
cursor: default;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.cbx-buttonBasic.cbx-buttonBasic-disabled.cbx-secondary .cbx-buttonBasic-container span,
|
|
146
|
+
.cbx-buttonBasic.cbx-buttonBasic-disabled.cbx-secondary .cbx-buttonBasic-container .cbx-buttonBasic-container-start-icon,
|
|
147
|
+
.cbx-buttonBasic.cbx-buttonBasic-disabled.cbx-secondary .cbx-buttonBasic-container .cbx-buttonBasic-container-end-icon {
|
|
148
|
+
color: var(--primary50);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.cbx-buttonBasic.cbx-secondaryDark {
|
|
152
|
+
color: var(--white);
|
|
153
|
+
background-color: transparent;
|
|
154
|
+
border: 0.063rem solid var(--white);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.cbx-buttonBasic.cbx-secondaryDark.cbx-success {
|
|
158
|
+
background-color: var(--success);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.cbx-buttonBasic.cbx-secondaryDark.cbx-error {
|
|
162
|
+
background-color: var(--error);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.cbx-buttonBasic.cbx-secondaryDark.cbx-success:hover {
|
|
166
|
+
background-color: var(--success);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.cbx-buttonBasic.cbx-secondaryDark.cbx-error:hover {
|
|
170
|
+
background-color: var(--error);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.cbx-buttonBasic.cbx-secondaryDark:hover {
|
|
174
|
+
border: 0.063rem solid var(--white);
|
|
175
|
+
background-color: var(--primary75);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.cbx-buttonBasic.cbx-secondaryDark .cbx-buttonBasic-container span {
|
|
179
|
+
color: var(--white);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.cbx-buttonBasic.cbx-buttonBasic-disabled.cbx-secondaryDark {
|
|
183
|
+
border: 0.063rem solid var(--primary25);
|
|
184
|
+
cursor: default;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.cbx-buttonBasic.cbx-buttonBasic-disabled.cbx-secondaryDark:hover {
|
|
188
|
+
background-color: transparent;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.cbx-buttonBasic.cbx-buttonBasic-disabled.cbx-secondaryDark .cbx-buttonBasic-container span,
|
|
192
|
+
.cbx-buttonBasic.cbx-buttonBasic-disabled.cbx-secondaryDark .cbx-buttonBasic-container .cbx-buttonBasic-container-start-icon,
|
|
193
|
+
.cbx-buttonBasic.cbx-buttonBasic-disabled.cbx-secondaryDark .cbx-buttonBasic-container .cbx-buttonBasic-container-end-icon {
|
|
194
|
+
color: var(--primary50);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.cbx-buttonBasic.cbx-tertiary {
|
|
198
|
+
color: var(--primary);
|
|
199
|
+
background-color: transparent;
|
|
200
|
+
border: 0;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.cbx-buttonBasic.cbx-tertiary.cbx-buttonBasic-disabled .cbx-buttonBasic-container span,
|
|
204
|
+
.cbx-buttonBasic.cbx-tertiary.cbx-buttonBasic-disabled .cbx-buttonBasic-container .cbx-buttonBasic-container-start-icon,
|
|
205
|
+
.cbx-buttonBasic.cbx-tertiary.cbx-buttonBasic-disabled .cbx-buttonBasic-container .cbx-buttonBasic-container-end-icon {
|
|
206
|
+
color: var(--primary50);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.cbx-buttonBasic.cbx-tertiary.cbx-buttonBasic-disabled:hover,
|
|
210
|
+
.cbx-buttonBasic.cbx-tertiary.cbx-buttonBasic-disabled:hover,
|
|
211
|
+
.cbx-buttonBasic.cbx-tertiary.cbx-buttonBasic-disabled:hover {
|
|
212
|
+
background-color: transparent;
|
|
213
|
+
cursor: default;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.cbx-buttonBasic.cbx-tertiary:hover {
|
|
217
|
+
border: 0;
|
|
218
|
+
background-color: var(--accent25);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.cbx-buttonBasic.cbx-tertiary .cbx-buttonBasic-container span {
|
|
222
|
+
color: var(--primary);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.cbx-buttonBasic.cbx-tertiary.cbx-success .cbx-buttonBasic-container span,
|
|
226
|
+
.cbx-buttonBasic.cbx-tertiary.cbx-success .cbx-buttonBasic-container .cbx-buttonBasic-container-start-icon,
|
|
227
|
+
.cbx-buttonBasic.cbx-tertiary.cbx-success .cbx-buttonBasic-container .cbx-buttonBasic-container-end-icon {
|
|
228
|
+
color: var(--success);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.cbx-buttonBasic.cbx-tertiary.cbx-success:hover,
|
|
232
|
+
.cbx-buttonBasic.cbx-tertiary.cbx-error:hover {
|
|
233
|
+
background-color: transparent;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.cbx-buttonBasic.cbx-tertiary.cbx-error .cbx-buttonBasic-container span,
|
|
237
|
+
.cbx-buttonBasic.cbx-tertiary.cbx-error .cbx-buttonBasic-container .cbx-buttonBasic-container-start-icon,
|
|
238
|
+
.cbx-buttonBasic.cbx-tertiary.cbx-error .cbx-buttonBasic-container .cbx-buttonBasic-container-end-icon {
|
|
239
|
+
color: var(--error);
|
|
31
240
|
}
|
|
32
241
|
|
|
33
242
|
.cbx-buttonBasic-badge {
|
|
@@ -38,4 +247,39 @@
|
|
|
38
247
|
left: -0.75rem;
|
|
39
248
|
border-radius: 50rem;
|
|
40
249
|
background: var(--error);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.cbx-buttonBasic-container-start-icon {
|
|
253
|
+
margin-right: 0.75rem;
|
|
254
|
+
width: 1.5rem;
|
|
255
|
+
height: 1.5rem;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.cbx-buttonBasic-container-start-icon i,
|
|
259
|
+
.cbx-buttonBasic-container-end-icon i {
|
|
260
|
+
font-size: 1.5rem !important;
|
|
261
|
+
margin: 0 !important;
|
|
262
|
+
padding: 0 !important;
|
|
263
|
+
vertical-align: unset !important;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.cbx-buttonBasic-container-end-icon {
|
|
267
|
+
width: 1.5rem;
|
|
268
|
+
height: 1.5rem;
|
|
269
|
+
font-size: 1.5rem;
|
|
270
|
+
margin-left: 0.75rem;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.cbx-buttonBasic-container-loading {
|
|
274
|
+
width: 1.5rem;
|
|
275
|
+
height: 1.5rem;
|
|
276
|
+
font-size: 1.5rem;
|
|
277
|
+
margin-left: 0.75rem;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.cbx-buttonBasic-container {
|
|
281
|
+
display: flex;
|
|
282
|
+
align-items: center;
|
|
283
|
+
justify-content: space-between;
|
|
284
|
+
position: relative;
|
|
41
285
|
}
|
|
@@ -9,17 +9,19 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
|
-
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
13
|
-
|
|
14
12
|
require("../../styles/main.css");
|
|
15
13
|
|
|
16
14
|
require("./ButtonBasic.css");
|
|
17
15
|
|
|
18
|
-
var
|
|
16
|
+
var _LoadingSection = _interopRequireDefault(require("../LoadingSection/LoadingSection"));
|
|
19
17
|
|
|
20
18
|
var _Typography = _interopRequireDefault(require("../Typography/Typography"));
|
|
21
19
|
|
|
22
|
-
var
|
|
20
|
+
var _useDynamicStyles2 = _interopRequireDefault(require("../../HOCs/useDynamicStyles"));
|
|
21
|
+
|
|
22
|
+
var _useRipple3 = _interopRequireDefault(require("../../HOCs/useRipple"));
|
|
23
|
+
|
|
24
|
+
var _excluded = ["id", "text", "onClick", "disabled", "loading", "variant", "fullWidth", "icon", "variantText", "stylesButton", "sx", "badge", "resetDelay", "reset", "error", "success", "startIcon", "endIcon", "className", "style", "prefixClass", "component"];
|
|
23
25
|
|
|
24
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
27
|
|
|
@@ -31,6 +33,18 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
31
33
|
|
|
32
34
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
33
35
|
|
|
36
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
37
|
+
|
|
38
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
39
|
+
|
|
40
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
41
|
+
|
|
42
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
43
|
+
|
|
44
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
45
|
+
|
|
46
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
47
|
+
|
|
34
48
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
35
49
|
|
|
36
50
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -57,24 +71,43 @@ var ButtonBasic = function ButtonBasic(_ref) {
|
|
|
57
71
|
startIcon = _ref$startIcon === void 0 ? icon : _ref$startIcon,
|
|
58
72
|
endIcon = _ref.endIcon,
|
|
59
73
|
className = _ref.className,
|
|
74
|
+
style = _ref.style,
|
|
75
|
+
propPrefixClass = _ref.prefixClass,
|
|
76
|
+
component = _ref.component,
|
|
60
77
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
61
78
|
|
|
62
|
-
var
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
var _useDynamicStyles = (0, _useDynamicStyles2.default)(sx),
|
|
80
|
+
stylesInLine = _useDynamicStyles.stylesInLine,
|
|
81
|
+
dynamicPrefixClass = _useDynamicStyles.prefixClass;
|
|
82
|
+
|
|
83
|
+
var prefixClass = propPrefixClass || dynamicPrefixClass;
|
|
84
|
+
|
|
85
|
+
var variantRipples = function variantRipples() {
|
|
86
|
+
if (variant === 'primary') {
|
|
87
|
+
return '#ffffff47';
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (variant === 'secondary') {
|
|
91
|
+
return '#38398c7a';
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (variant === 'secondaryDark') {
|
|
95
|
+
return '#38398c7a';
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (variant === 'tertiary') {
|
|
99
|
+
return '#38398c7a';
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return '#ffffff47';
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
var _useRipple = (0, _useRipple3.default)({
|
|
106
|
+
backgroundColor: variantRipples()
|
|
107
|
+
}),
|
|
108
|
+
_useRipple2 = _slicedToArray(_useRipple, 2),
|
|
109
|
+
addRipple = _useRipple2[0],
|
|
110
|
+
ripples = _useRipple2[1];
|
|
78
111
|
|
|
79
112
|
_react.default.useEffect(function () {
|
|
80
113
|
var timeout;
|
|
@@ -88,112 +121,54 @@ var ButtonBasic = function ButtonBasic(_ref) {
|
|
|
88
121
|
};
|
|
89
122
|
}, [error, success, reset, resetDelay]);
|
|
90
123
|
|
|
91
|
-
|
|
124
|
+
var onClickButton = function onClickButton(e) {
|
|
125
|
+
if (!disabled && !loading) {
|
|
126
|
+
addRipple(e);
|
|
127
|
+
|
|
128
|
+
if (onClick) {
|
|
129
|
+
onClick(e);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
var Component = component || 'button';
|
|
135
|
+
return /*#__PURE__*/_react.default.createElement(Component, _extends({
|
|
92
136
|
id: id,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
},
|
|
102
|
-
'&.MuiButton-contained:hover': {
|
|
103
|
-
boxShadow: 'none',
|
|
104
|
-
backgroundColor: success || error ? success ? 'var(--success)' : error && 'var(--error)' : 'var(--primary)'
|
|
105
|
-
},
|
|
106
|
-
'&.MuiButton-contained div span, &.MuiButton-contained div div ': {
|
|
107
|
-
transition: 'background .3s, width .3s, color .3s'
|
|
108
|
-
},
|
|
109
|
-
'&.MuiButton-contained:hover div span, &.MuiButton-contained:hover div div': {
|
|
110
|
-
color: success || error ? 'white' : 'var(--accent)'
|
|
111
|
-
},
|
|
112
|
-
'&.MuiButton-contained.Mui-disabled': {
|
|
113
|
-
backgroundColor: 'var(--primary25)'
|
|
114
|
-
},
|
|
115
|
-
'&.MuiButton-contained.Mui-disabled div span, &.MuiButton-contained.Mui-disabled div div': {
|
|
116
|
-
color: 'var(--primary50)'
|
|
117
|
-
},
|
|
118
|
-
'&.MuiButton-outlined': {
|
|
119
|
-
border: '0.063rem solid var(--primary)',
|
|
120
|
-
borderColor: success ? 'var(--success)' : error && 'var(--error)'
|
|
121
|
-
},
|
|
122
|
-
'&.MuiButton-outlined.secondaryDark': {
|
|
123
|
-
border: "0.063rem solid ".concat(buttonColor),
|
|
124
|
-
background: success ? 'var(--success)' : error && 'var(--error)'
|
|
125
|
-
},
|
|
126
|
-
'&.MuiButton-outlined div span, &.MuiButton-outlined div div ': {
|
|
127
|
-
color: success ? 'var(--success)' : error && 'var(--error)'
|
|
128
|
-
},
|
|
129
|
-
'&.MuiButton-outlined.secondaryDark div span, &.MuiButton-outlined.secondaryDark div div ': {
|
|
130
|
-
color: buttonColor
|
|
131
|
-
},
|
|
132
|
-
'&.MuiButton-outlined.Mui-disabled': {
|
|
133
|
-
border: '0.063rem solid var(--primary25)'
|
|
134
|
-
},
|
|
135
|
-
'&.MuiButton-outlined.Mui-disabled div span, &.MuiButton-outlined.Mui-disabled div div': {
|
|
136
|
-
color: 'var(--primary50)'
|
|
137
|
-
},
|
|
138
|
-
'&.MuiButton-text.Mui-disabled div span, &.MuiButton-text.Mui-disabled div div': {
|
|
139
|
-
color: 'var(--primary50)'
|
|
140
|
-
},
|
|
141
|
-
'&.MuiButton-text div span, &.MuiButton-text div div': {
|
|
142
|
-
color: success ? 'var(--success)' : error && 'var(--error)'
|
|
143
|
-
},
|
|
144
|
-
'&.MuiButton-root': {
|
|
145
|
-
transition: 'background .3s, width .3s, color .3s'
|
|
146
|
-
},
|
|
147
|
-
'&.MuiButton-outlined:hover': {
|
|
148
|
-
border: '0.063rem solid var(--primary)',
|
|
149
|
-
backgroundColor: success || error ? 'transparent' : 'var(--accent25)',
|
|
150
|
-
borderColor: success ? 'var(--success)' : error && 'var(--error)'
|
|
151
|
-
},
|
|
152
|
-
'&.MuiButton-outlined.secondaryDark:hover': {
|
|
153
|
-
border: "0.063rem solid ".concat(buttonColor),
|
|
154
|
-
backgroundColor: success || error ? success ? 'var(--success)' : error && 'var(--error)' : 'var(--primary75)'
|
|
155
|
-
},
|
|
156
|
-
'&.MuiButton-root.MuiButton-text:hover': {
|
|
157
|
-
backgroundColor: success || error ? 'transparent' : 'var(--accent25)'
|
|
158
|
-
},
|
|
159
|
-
paddingTop: '0.75rem',
|
|
160
|
-
paddingBottom: '0.75rem',
|
|
137
|
+
htmlFor: id,
|
|
138
|
+
className: prefixClass("cbx-ripple cbx-buttonBasic ".concat(className || '', " ").concat(variant === 'secondaryDark' ? 'secondaryDark' : '').concat(disabled || loading ? ' cbx-buttonBasic-disabled' : '', " cbx-").concat(variant).concat(success ? ' cbx-success' : error ? ' cbx-error' : '').concat(fullWidth ? ' cbx-buttonBasic-fullWidth' : '')),
|
|
139
|
+
type: 'button',
|
|
140
|
+
disabled: disabled || loading,
|
|
141
|
+
onClick: function onClick(e) {
|
|
142
|
+
return onClickButton(e);
|
|
143
|
+
},
|
|
144
|
+
style: _objectSpread(_objectSpread({
|
|
161
145
|
paddingLeft: startIcon && endIcon ? 'var(--spacing16)' : startIcon ? 'var(--spacing16)' : 'var(--spacing24)',
|
|
162
|
-
paddingRight: startIcon && endIcon ? 'var(--spacing16)' : endIcon || loading ? 'var(--spacing16)' : 'var(--spacing24)'
|
|
163
|
-
|
|
164
|
-
lineHeight: '1.5rem'
|
|
165
|
-
}),
|
|
166
|
-
disabled: loading || disabled,
|
|
167
|
-
variant: buttonVariant,
|
|
168
|
-
disableFocusRipple: true,
|
|
169
|
-
fullWidth: fullWidth,
|
|
170
|
-
onClick: onClick
|
|
146
|
+
paddingRight: startIcon && endIcon ? 'var(--spacing16)' : endIcon || loading ? 'var(--spacing16)' : 'var(--spacing24)'
|
|
147
|
+
}, style), stylesInLine)
|
|
171
148
|
}, props), /*#__PURE__*/_react.default.createElement("div", {
|
|
172
|
-
className: 'cbx-buttonBasic-container'
|
|
149
|
+
className: prefixClass('cbx-buttonBasic-container ')
|
|
173
150
|
}, badge && /*#__PURE__*/_react.default.createElement("div", {
|
|
174
151
|
className: "cbx-buttonBasic-badge"
|
|
175
152
|
}), startIcon && /*#__PURE__*/_react.default.createElement("div", {
|
|
176
153
|
className: 'cbx-buttonBasic-container-start-icon'
|
|
177
154
|
}, startIcon), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
178
|
-
color: buttonColor,
|
|
179
155
|
variant: variantText || 'M',
|
|
180
156
|
component: 'span',
|
|
181
157
|
fontWeight: '700',
|
|
182
158
|
styles: _objectSpread({}, stylesButton)
|
|
183
159
|
}, text), loading ? /*#__PURE__*/_react.default.createElement("div", {
|
|
184
|
-
className: 'cbx-buttonBasic-container-loading'
|
|
185
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}
|
|
160
|
+
className: prefixClass('cbx-buttonBasic-container-loading')
|
|
161
|
+
}, /*#__PURE__*/_react.default.createElement(_LoadingSection.default, {
|
|
162
|
+
size: 24,
|
|
163
|
+
color: 'var(--primary50)',
|
|
164
|
+
prefixClass: prefixClass
|
|
190
165
|
})) : success || error ? /*#__PURE__*/_react.default.createElement("div", {
|
|
191
|
-
className: 'cbx-buttonBasic-container-end-icon'
|
|
166
|
+
className: prefixClass('cbx-buttonBasic-container-end-icon')
|
|
192
167
|
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
193
168
|
className: error ? 'ri-close-line' : 'ri-check-line'
|
|
194
169
|
})) : endIcon && /*#__PURE__*/_react.default.createElement("div", {
|
|
195
|
-
className: 'cbx-buttonBasic-container-end-icon'
|
|
196
|
-
}, endIcon)));
|
|
170
|
+
className: prefixClass('cbx-buttonBasic-container-end-icon')
|
|
171
|
+
}, endIcon), !disabled && ripples));
|
|
197
172
|
};
|
|
198
173
|
|
|
199
174
|
ButtonBasic.displayName = "ButtonBasic";
|
|
@@ -208,7 +183,7 @@ ButtonBasic.propTypes = {
|
|
|
208
183
|
endIcon: _propTypes.default.node,
|
|
209
184
|
variantText: _propTypes.default.string,
|
|
210
185
|
stylesButton: _propTypes.default.object,
|
|
211
|
-
badge: _propTypes.default.
|
|
186
|
+
badge: _propTypes.default.bool,
|
|
212
187
|
success: _propTypes.default.bool,
|
|
213
188
|
error: _propTypes.default.bool
|
|
214
189
|
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
.cbx-buttonBasic-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
position: relative;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.cbx-buttonBasic-container-start-icon,
|
|
9
|
+
.cbx-buttonBasic-container-loading,
|
|
10
|
+
.cbx-buttonBasic-container-end-icon {
|
|
11
|
+
width: 1.5rem;
|
|
12
|
+
height: 1.5rem;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.cbx-buttonBasic-container-start-icon {
|
|
16
|
+
margin-right: 0.75rem;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.cbx-buttonBasic-container-loading,
|
|
20
|
+
.cbx-buttonBasic-container-end-icon {
|
|
21
|
+
font-size: 1.5rem;
|
|
22
|
+
margin-left: 0.75rem;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.cbx-buttonBasic-container-start-icon i,
|
|
26
|
+
.cbx-buttonBasic-container-end-icon i {
|
|
27
|
+
font-size: 1.5rem !important;
|
|
28
|
+
margin: 0 !important;
|
|
29
|
+
padding: 0 !important;
|
|
30
|
+
vertical-align: unset !important;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.cbx-buttonBasic-badge {
|
|
34
|
+
position: absolute;
|
|
35
|
+
width: var(--spacing8);
|
|
36
|
+
height: var(--spacing8);
|
|
37
|
+
top: -0.125rem;
|
|
38
|
+
left: -0.75rem;
|
|
39
|
+
border-radius: 50rem;
|
|
40
|
+
background: var(--error);
|
|
41
|
+
}
|