@itcase/ui 1.8.108 → 1.8.110
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/{Avatar_cjs_bOSuIjlv.js → Avatar_cjs_joB9qjwk.js} +36 -60
- package/dist/{Avatar_es_CEiiRkAd.js → Avatar_es_C3HGSiHU.js} +36 -60
- package/dist/{Button_cjs_eGfgY2Dz.js → Button_cjs_mau_55Fl.js} +6 -6
- package/dist/{Button_es_CEXL2diU.js → Button_es_D_IlkeBp.js} +6 -6
- package/dist/{ChipsGroup_cjs_DKLEgUi2.js → ChipsGroup_cjs_D454M1-p.js} +2 -2
- package/dist/{ChipsGroup_es_vMh6YMRm.js → ChipsGroup_es_BKG5mK5N.js} +2 -2
- package/dist/{DatePicker_cjs_T63y9kcH.js → DatePicker_cjs_C9rI2uTl.js} +5 -5
- package/dist/{DatePicker_es_B87jj8h6.js → DatePicker_es_Bi6lgbTb.js} +5 -5
- package/dist/{DropdownItem_cjs_BGp4XAme.js → DropdownItem_cjs_D2hHKA5E.js} +2 -2
- package/dist/{DropdownItem_es_BwdenrJx.js → DropdownItem_es_D9JBMV70.js} +2 -2
- package/dist/{Icon_cjs_LSfBwmrG.js → Icon_cjs_ZerVip3X.js} +32 -47
- package/dist/{Icon_es_BYO1LdXJ.js → Icon_es_C76te22j.js} +32 -47
- package/dist/{Input_cjs_CFy0tfAO.js → Input_cjs_TC7DOpvh.js} +13 -13
- package/dist/{Input_es_l3ry6luZ.js → Input_es_RtN2gtZq.js} +13 -13
- package/dist/{Label_cjs_Df_mrKBf.js → Label_cjs_CaTh_laL.js} +2 -2
- package/dist/{Label_es_Dl5zb0RD.js → Label_es_CoIII7Ty.js} +2 -2
- package/dist/{Loader_cjs_Db9diKuF.js → Loader_cjs_c6yF7akz.js} +1 -1
- package/dist/{Loader_es_AhHU-s7_.js → Loader_es_C8ETXkiZ.js} +1 -1
- package/dist/{Text_cjs_CeJHeRfI.js → Text_cjs_DpRclhwc.js} +2 -5
- package/dist/{Text_es_BXh9Y3hR.js → Text_es_CtCwsa3V.js} +2 -5
- package/dist/cjs/components/Accordion.js +4 -3
- package/dist/cjs/components/Avatar.js +5 -4
- package/dist/cjs/components/AvatarStack.js +5 -4
- package/dist/cjs/components/Badge.js +4 -3
- package/dist/cjs/components/Breadcrumbs.js +4 -3
- package/dist/cjs/components/Button.js +6 -5
- package/dist/cjs/components/Cell.js +5 -4
- package/dist/cjs/components/Checkbox.js +3 -2
- package/dist/cjs/components/Checkmark.js +2 -1
- package/dist/cjs/components/Chips.js +5 -4
- package/dist/cjs/components/Choice.js +9 -8
- package/dist/cjs/components/Code.js +2 -0
- package/dist/cjs/components/CookiesWarning.js +6 -5
- package/dist/cjs/components/Dadata.js +3 -1
- package/dist/cjs/components/DatePeriod.js +9 -8
- package/dist/cjs/components/DatePicker.js +9 -8
- package/dist/cjs/components/Divider.js +2 -1
- package/dist/cjs/components/Dot.js +2 -1
- package/dist/cjs/components/Drawer.js +3 -2
- package/dist/cjs/components/Dropdown.js +5 -4
- package/dist/cjs/components/Flex.js +2 -1
- package/dist/cjs/components/Grid.js +2 -1
- package/dist/cjs/components/Group.js +2 -1
- package/dist/cjs/components/HTMLContent.js +2 -1
- package/dist/cjs/components/HeroTitle.js +4 -3
- package/dist/cjs/components/Icon.js +4 -3
- package/dist/cjs/components/Image.js +2 -1
- package/dist/cjs/components/Input.js +3 -1
- package/dist/cjs/components/InputPassword.js +4 -3
- package/dist/cjs/components/Label.js +5 -4
- package/dist/cjs/components/Link.js +2 -1
- package/dist/cjs/components/List.js +2 -1
- package/dist/cjs/components/Loader.js +4 -3
- package/dist/cjs/components/Logo.js +2 -1
- package/dist/cjs/components/MenuItem.js +4 -3
- package/dist/cjs/components/Modal.js +5 -4
- package/dist/cjs/components/ModalSheetBottom.js +4 -3
- package/dist/cjs/components/Notification.js +4 -3
- package/dist/cjs/components/Overlay.js +2 -1
- package/dist/cjs/components/Pagination.js +5 -4
- package/dist/cjs/components/Radio.js +6 -2
- package/dist/cjs/components/RangeSlider.js +2 -1
- package/dist/cjs/components/Response.js +6 -5
- package/dist/cjs/components/SVGContent.js +2 -1
- package/dist/cjs/components/ScrollOnDrag.js +2 -1
- package/dist/cjs/components/ScrollToView.js +2 -1
- package/dist/cjs/components/Search.js +4 -3
- package/dist/cjs/components/Segmented.js +3 -2
- package/dist/cjs/components/Select.js +4 -3
- package/dist/cjs/components/Swiper.js +4 -3
- package/dist/cjs/components/Switch.js +3 -2
- package/dist/cjs/components/Tab.js +14 -16
- package/dist/cjs/components/Text.js +3 -2
- package/dist/cjs/components/Textarea.js +2 -0
- package/dist/cjs/components/Tile.js +4 -3
- package/dist/cjs/components/Title.js +4 -3
- package/dist/cjs/components/Tooltip.js +4 -3
- package/dist/cjs/components/Video.js +1 -0
- package/dist/cjs/components/Warning.js +4 -3
- package/dist/cjs/hoc/urlWithAssetPrefix.js +17 -0
- package/dist/cjs/hooks/useActiveClasses/useActiveClasses.helpers.js +120 -0
- package/dist/cjs/hooks/useActiveClasses/useActiveClasses.interface.js +65 -0
- package/dist/cjs/hooks/useActiveClasses/useActiveClasses.js +64 -0
- package/dist/cjs/hooks/useActiveClasses.js +9 -0
- package/dist/cjs/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js +11 -1
- package/dist/cjs/hooks/useDevicePropsGenerator.js +2 -0
- package/dist/cjs/hooks/useStyles/useStyles.js +4 -3
- package/dist/cjs/hooks/useStyles.js +1 -0
- package/dist/cjs/hooks.js +9 -0
- package/dist/components/Accordion.js +4 -3
- package/dist/components/Avatar.js +5 -4
- package/dist/components/AvatarStack.js +5 -4
- package/dist/components/Badge.js +4 -3
- package/dist/components/Breadcrumbs.js +4 -3
- package/dist/components/Button.js +6 -5
- package/dist/components/Cell.js +5 -4
- package/dist/components/Checkbox.js +3 -2
- package/dist/components/Checkmark.js +2 -1
- package/dist/components/Chips.js +5 -4
- package/dist/components/Choice.js +9 -8
- package/dist/components/Code.js +2 -0
- package/dist/components/CookiesWarning.js +6 -5
- package/dist/components/Dadata.js +3 -1
- package/dist/components/DatePeriod.js +9 -8
- package/dist/components/DatePicker.js +9 -8
- package/dist/components/Divider.js +2 -1
- package/dist/components/Dot.js +2 -1
- package/dist/components/Drawer.js +3 -2
- package/dist/components/Dropdown.js +5 -4
- package/dist/components/Flex.js +2 -1
- package/dist/components/Grid.js +2 -1
- package/dist/components/Group.js +2 -1
- package/dist/components/HTMLContent.js +2 -1
- package/dist/components/HeroTitle.js +4 -3
- package/dist/components/Icon.js +4 -3
- package/dist/components/Image.js +2 -1
- package/dist/components/Input.js +3 -1
- package/dist/components/InputPassword.js +4 -3
- package/dist/components/Label.js +5 -4
- package/dist/components/Link.js +2 -1
- package/dist/components/List.js +2 -1
- package/dist/components/Loader.js +4 -3
- package/dist/components/Logo.js +2 -1
- package/dist/components/MenuItem.js +4 -3
- package/dist/components/Modal.js +5 -4
- package/dist/components/ModalSheetBottom.js +4 -3
- package/dist/components/Notification.js +4 -3
- package/dist/components/Overlay.js +2 -1
- package/dist/components/Pagination.js +5 -4
- package/dist/components/Radio.js +6 -2
- package/dist/components/RangeSlider.js +2 -1
- package/dist/components/Response.js +6 -5
- package/dist/components/SVGContent.js +2 -1
- package/dist/components/ScrollOnDrag.js +2 -1
- package/dist/components/ScrollToView.js +2 -1
- package/dist/components/Search.js +4 -3
- package/dist/components/Segmented.js +3 -2
- package/dist/components/Select.js +4 -3
- package/dist/components/Swiper.js +4 -3
- package/dist/components/Switch.js +3 -2
- package/dist/components/Tab.js +14 -16
- package/dist/components/Text.js +3 -2
- package/dist/components/Textarea.js +2 -0
- package/dist/components/Tile.js +4 -3
- package/dist/components/Title.js +4 -3
- package/dist/components/Tooltip.js +4 -3
- package/dist/components/Video.js +1 -0
- package/dist/components/Warning.js +4 -3
- package/dist/css/components/Choice/Choice.css +22 -22
- package/dist/css/components/Choice/css/__item/choice__item_size.css +3 -3
- package/dist/css/components/Icon/Icon.css +12 -19
- package/dist/css/components/Input/Input.css +12 -13
- package/dist/css/components/Select/Select.css +8 -5
- package/dist/css/styles/bundle.css +2 -1
- package/dist/css/styles/text-weight/text-weight.css +2 -1
- package/dist/hoc/urlWithAssetPrefix.js +17 -0
- package/dist/hooks/useActiveClasses/useActiveClasses.helpers.js +116 -0
- package/dist/hooks/useActiveClasses/useActiveClasses.interface.js +63 -0
- package/dist/hooks/useActiveClasses/useActiveClasses.js +62 -0
- package/dist/hooks/useActiveClasses.js +3 -0
- package/dist/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js +11 -1
- package/dist/hooks/useDevicePropsGenerator.js +2 -0
- package/dist/hooks/useStyles/useStyles.js +4 -3
- package/dist/hooks/useStyles.js +1 -0
- package/dist/hooks.js +7 -0
- package/dist/stories/useActiveClasses.mdx +134 -0
- package/dist/types/components/Avatar/Avatar.appearance.d.ts +1878 -2
- package/dist/types/components/Avatar/Avatar.interface.d.ts +48 -37
- package/dist/types/components/Avatar/appearance/avatarDefault.d.ts +2 -19
- package/dist/types/components/Avatar/appearance/avatarShape.d.ts +2 -24
- package/dist/types/components/Avatar/appearance/avatarSize.d.ts +2 -83
- package/dist/types/components/Avatar/appearance/avatarStyle.d.ts +2 -15
- package/dist/types/components/Badge/Badge.appearance.d.ts +986 -228
- package/dist/types/components/Badge/Badge.interface.d.ts +6 -6
- package/dist/types/components/Badge/appearance/badgeAccent.d.ts +2 -37
- package/dist/types/components/Badge/appearance/badgeDanger.d.ts +2 -16
- package/dist/types/components/Badge/appearance/badgeDisabled.d.ts +2 -14
- package/dist/types/components/Badge/appearance/badgeError.d.ts +2 -16
- package/dist/types/components/Badge/appearance/badgeInfo.d.ts +2 -15
- package/dist/types/components/Badge/appearance/badgePrimary.d.ts +2 -16
- package/dist/types/components/Badge/appearance/badgeSecondary.d.ts +2 -16
- package/dist/types/components/Badge/appearance/badgeShape.d.ts +2 -24
- package/dist/types/components/Badge/appearance/badgeSize.d.ts +2 -31
- package/dist/types/components/Badge/appearance/badgeStyle.d.ts +2 -13
- package/dist/types/components/Badge/appearance/badgeSuccess.d.ts +2 -16
- package/dist/types/components/Badge/appearance/badgeSurface.d.ts +2 -24
- package/dist/types/components/Badge/appearance/badgeWarning.d.ts +2 -16
- package/dist/types/components/Icon/Icon.d.ts +30 -6
- package/dist/types/components/Icon/Icon.interface.d.ts +2 -0
- package/dist/types/components/Image/Image.d.ts +1 -2
- package/dist/types/components/Input/appearance/inputDefault.d.ts +2 -2
- package/dist/types/components/Input/appearance/inputShape.d.ts +4 -4
- package/dist/types/components/Logo/Logo.d.ts +2 -2
- package/dist/types/components/Radio/Radio.appearance.d.ts +3 -0
- package/dist/types/components/Radio/appearance/radioDefault.d.ts +3 -0
- package/dist/types/components/Response/Response.d.ts +2 -2
- package/dist/types/components/SVGContent/SVGContent.d.ts +1 -2
- package/dist/types/components/Tab/appearance/tabSurface.d.ts +1 -0
- package/dist/types/components/Text/Text.appearance.d.ts +698 -2
- package/dist/types/components/Text/Text.interface.d.ts +32 -47
- package/dist/types/components/Text/appearance/textSize.d.ts +2 -23
- package/dist/types/components/Title/Title.appearance.d.ts +2225 -2
- package/dist/types/components/Title/Title.interface.d.ts +56 -38
- package/dist/types/components/Title/appearance/titleAccent.d.ts +2 -19
- package/dist/types/components/Title/appearance/titleDanger.d.ts +2 -6
- package/dist/types/components/Title/appearance/titleDisabled.d.ts +2 -19
- package/dist/types/components/Title/appearance/titleError.d.ts +2 -10
- package/dist/types/components/Title/appearance/titleInfo.d.ts +2 -20
- package/dist/types/components/Title/appearance/titlePrimary.d.ts +2 -7
- package/dist/types/components/Title/appearance/titleRequire.d.ts +2 -19
- package/dist/types/components/Title/appearance/titleSecondary.d.ts +2 -7
- package/dist/types/components/Title/appearance/titleSize.d.ts +2 -44
- package/dist/types/components/Title/appearance/titleStyle.d.ts +2 -15
- package/dist/types/components/Title/appearance/titleSuccess.d.ts +2 -10
- package/dist/types/components/Title/appearance/titleSurface.d.ts +2 -24
- package/dist/types/components/Title/appearance/titleWarning.d.ts +2 -10
- package/dist/types/hoc/urlWithAssetPrefix.d.ts +27 -8
- package/dist/types/hooks/index.helpers.d.ts +3 -0
- package/dist/types/hooks/useActiveClasses/index.d.ts +2 -0
- package/dist/types/hooks/useActiveClasses/useActiveClasses.d.ts +3 -0
- package/dist/types/hooks/useActiveClasses/useActiveClasses.helpers.d.ts +5 -0
- package/dist/types/hooks/useActiveClasses/useActiveClasses.interface.d.ts +26 -0
- package/dist/types/hooks/useDevicePropsGenerator/useDevicePropsGenerator.d.ts +1 -1
- package/dist/types/hooks/useStyles/styleAttributes.interface.d.ts +3 -0
- package/dist/types/types/utils.d.ts +34 -0
- package/package.json +7 -7
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
&_size {
|
|
46
46
|
@each $size in xxl, xl, l, m, s, xs, xxs {
|
|
47
47
|
&_$(size) {
|
|
48
|
-
min-height: var(--choice-item
|
|
49
|
-
padding: var(--choice-item
|
|
48
|
+
min-height: var(--choice-item-$(size)-min-height);
|
|
49
|
+
padding: var(--choice-item-$(size)-padding);
|
|
50
50
|
^^&-label {
|
|
51
|
-
gap: var(--choice-item
|
|
51
|
+
gap: var(--choice-item-$(size)-gap);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
}
|
|
@@ -138,30 +138,30 @@
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
:root {
|
|
141
|
-
--choice-size-
|
|
142
|
-
--choice-size-
|
|
143
|
-
--choice-size-
|
|
144
|
-
--choice-size-
|
|
141
|
+
--choice-size-l-height: 48px;
|
|
142
|
+
--choice-size-l-min-height: 48px;
|
|
143
|
+
--choice-size-l-row-gap: 12px;
|
|
144
|
+
--choice-size-l-column-gap: 12px;
|
|
145
145
|
|
|
146
146
|
--choice-size-m-row-gap: 12px;
|
|
147
147
|
--choice-size-m-column-gap: 12px;
|
|
148
|
-
--choice-size-m-height:
|
|
149
|
-
--choice-size-m-min-height:
|
|
148
|
+
--choice-size-m-height: 40px;
|
|
149
|
+
--choice-size-m-min-height: 40px;
|
|
150
150
|
|
|
151
|
-
--choice-size-
|
|
152
|
-
--choice-size-
|
|
153
|
-
--choice-size-
|
|
154
|
-
--choice-size-
|
|
151
|
+
--choice-size-s-height: 28px;
|
|
152
|
+
--choice-size-s-min-height: 28px;
|
|
153
|
+
--choice-size-s-row-gap: 12px;
|
|
154
|
+
--choice-size-s-column-gap: 12px;
|
|
155
155
|
|
|
156
|
-
--choice-item-
|
|
157
|
-
--choice-item-
|
|
158
|
-
--choice-item-
|
|
156
|
+
--choice-item-l-padding: 0px 12px;
|
|
157
|
+
--choice-item-l-min-height: 44px;
|
|
158
|
+
--choice-item-l-gap: 8px;
|
|
159
159
|
|
|
160
|
-
--choice-item-
|
|
161
|
-
--choice-item-
|
|
162
|
-
--choice-item-
|
|
160
|
+
--choice-item-m-padding: 0px 12px;
|
|
161
|
+
--choice-item-m-min-height: 36px;
|
|
162
|
+
--choice-item-m-gap: 8px;
|
|
163
163
|
|
|
164
|
-
--choice-item-
|
|
165
|
-
--choice-item-
|
|
166
|
-
--choice-item-
|
|
164
|
+
--choice-item-s-padding: 0px 6px;
|
|
165
|
+
--choice-item-s-min-height: 24px;
|
|
166
|
+
--choice-item-s-gap: 8px;
|
|
167
167
|
}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
&_size {
|
|
3
3
|
@each $size in xxl, xl, l, m, s, xs, xxs {
|
|
4
4
|
&_$(size) {
|
|
5
|
-
min-height: var(--choice-item
|
|
6
|
-
padding: var(--choice-item
|
|
5
|
+
min-height: var(--choice-item-$(size)-min-height);
|
|
6
|
+
padding: var(--choice-item-$(size)-padding);
|
|
7
7
|
^^&-label {
|
|
8
|
-
gap: var(--choice-item
|
|
8
|
+
gap: var(--choice-item-$(size)-gap);
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
}
|
|
@@ -33,11 +33,10 @@
|
|
|
33
33
|
}
|
|
34
34
|
.icon_fill {
|
|
35
35
|
@each $type in accent, primary, secondary, tertiary, quaternary, surface,
|
|
36
|
-
error, success, warning, info, danger
|
|
36
|
+
error, success, warning, info, danger {
|
|
37
37
|
&_$(type) {
|
|
38
38
|
&-item {
|
|
39
|
-
@each $color in primary, secondary, tertiary, quaternary
|
|
40
|
-
senary, accent, disabled, hover, inverse {
|
|
39
|
+
@each $color in primary, secondary, tertiary, quaternary {
|
|
41
40
|
&-$(color) {
|
|
42
41
|
& svg {
|
|
43
42
|
stroke: none;
|
|
@@ -46,8 +45,7 @@
|
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
|
-
@each $color in primary, secondary, tertiary, quaternary
|
|
50
|
-
accent, disabled, hover, inverse {
|
|
48
|
+
@each $color in primary, secondary, tertiary, quaternary {
|
|
51
49
|
&-$(color) {
|
|
52
50
|
& svg {
|
|
53
51
|
stroke: none;
|
|
@@ -85,12 +83,11 @@
|
|
|
85
83
|
}
|
|
86
84
|
}
|
|
87
85
|
.icon_fill_hover {
|
|
88
|
-
@each $type in accent, primary, secondary, tertiary, quaternary,
|
|
89
|
-
|
|
86
|
+
@each $type in accent, primary, secondary, tertiary, quaternary, surface,
|
|
87
|
+
error, success, warning, info, danger {
|
|
90
88
|
&_$(type) {
|
|
91
89
|
&-item {
|
|
92
|
-
@each $color in primary, secondary, tertiary, quaternary
|
|
93
|
-
senary, accent, disabled, hover, inverse {
|
|
90
|
+
@each $color in primary, secondary, tertiary, quaternary {
|
|
94
91
|
&-$(color) {
|
|
95
92
|
&:hover {
|
|
96
93
|
& svg {
|
|
@@ -137,11 +134,10 @@
|
|
|
137
134
|
.icon_fill {
|
|
138
135
|
&_active {
|
|
139
136
|
@each $type in accent, primary, secondary, tertiary, quaternary, surface,
|
|
140
|
-
|
|
137
|
+
error, success, warning, info, danger {
|
|
141
138
|
&_$(type) {
|
|
142
139
|
&-item {
|
|
143
|
-
@each $color in primary, secondary, tertiary, quaternary
|
|
144
|
-
senary, accent, disabled, hover, inverse {
|
|
140
|
+
@each $color in primary, secondary, tertiary, quaternary {
|
|
145
141
|
&-$(color) {
|
|
146
142
|
& svg {
|
|
147
143
|
stroke: none;
|
|
@@ -150,8 +146,7 @@
|
|
|
150
146
|
}
|
|
151
147
|
}
|
|
152
148
|
}
|
|
153
|
-
@each $color in primary, secondary, tertiary, quaternary
|
|
154
|
-
senary, accent, disabled, hover, inverse {
|
|
149
|
+
@each $color in primary, secondary, tertiary, quaternary {
|
|
155
150
|
&-$(color) {
|
|
156
151
|
& svg {
|
|
157
152
|
stroke: none;
|
|
@@ -193,11 +188,10 @@
|
|
|
193
188
|
&_active {
|
|
194
189
|
&_hover {
|
|
195
190
|
@each $type in accent, primary, secondary, tertiary, quaternary, surface,
|
|
196
|
-
error, success, warning, info, danger
|
|
191
|
+
error, success, warning, info, danger {
|
|
197
192
|
&_$(type) {
|
|
198
193
|
&-item {
|
|
199
|
-
@each $color in primary, secondary, tertiary, quaternary
|
|
200
|
-
senary, accent, disabled, hover, inverse {
|
|
194
|
+
@each $color in primary, secondary, tertiary, quaternary {
|
|
201
195
|
&-$(color) {
|
|
202
196
|
&:hover {
|
|
203
197
|
& svg {
|
|
@@ -208,8 +202,7 @@
|
|
|
208
202
|
}
|
|
209
203
|
}
|
|
210
204
|
}
|
|
211
|
-
@each $color in primary, secondary, tertiary, quaternary
|
|
212
|
-
senary, accent, disabled, hover, inverse {
|
|
205
|
+
@each $color in primary, secondary, tertiary, quaternary {
|
|
213
206
|
&-$(color) {
|
|
214
207
|
&:hover {
|
|
215
208
|
& svg {
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
padding: 0;
|
|
4
4
|
margin: 0;
|
|
5
5
|
border: none;
|
|
6
|
+
border: solid 2px red;
|
|
6
7
|
position: relative;
|
|
7
8
|
box-shadow: none;
|
|
8
9
|
appearance: none;
|
|
@@ -32,10 +33,10 @@
|
|
|
32
33
|
}
|
|
33
34
|
.input {
|
|
34
35
|
&&_size {
|
|
35
|
-
@each $size in
|
|
36
|
+
@each $size in xl, l, m, s {
|
|
36
37
|
&_$(size) {
|
|
37
|
-
min-height: var(--input
|
|
38
|
-
padding: var(--input
|
|
38
|
+
min-height: var(--input-$(size)-min-height);
|
|
39
|
+
padding: var(--input-$(size)-padding);
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
}
|
|
@@ -70,16 +71,14 @@
|
|
|
70
71
|
--input-shape-rounded: 8px;
|
|
71
72
|
|
|
72
73
|
/* Size */
|
|
73
|
-
--input-
|
|
74
|
-
--input-
|
|
75
|
-
--input-
|
|
76
|
-
--input-
|
|
77
|
-
--input-
|
|
78
|
-
--input-
|
|
79
|
-
--input-
|
|
80
|
-
--input-
|
|
81
|
-
--input-size-xl-min-height: 48px;
|
|
82
|
-
--input-size-xxl-min-height: 56px;
|
|
74
|
+
--input-xl-min-height: 56px;
|
|
75
|
+
--input-xl-padding: 12px 16px;
|
|
76
|
+
--input-l-min-height: 48px;
|
|
77
|
+
--input-l-padding: 12px 12px;
|
|
78
|
+
--input-m-min-height: 40px;
|
|
79
|
+
--input-m-padding: 8px 12px;
|
|
80
|
+
--input-s-min-height: 28px;
|
|
81
|
+
--input-s-padding: 2px 6px;
|
|
83
82
|
|
|
84
83
|
--input-caret-color: var(--color-accent-fill-primary);
|
|
85
84
|
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
.select {
|
|
34
34
|
&&_size {
|
|
35
|
-
@each $size in
|
|
35
|
+
@each $size in xl, l, m, s {
|
|
36
36
|
&_$(size) {
|
|
37
37
|
^^&__control {
|
|
38
38
|
padding: var(--select-$(size)-padding);
|
|
@@ -300,11 +300,14 @@
|
|
|
300
300
|
}
|
|
301
301
|
|
|
302
302
|
:root {
|
|
303
|
-
--select-
|
|
304
|
-
--select-xl-padding: 12px
|
|
303
|
+
--select-xl-min-height: 56px;
|
|
304
|
+
--select-xl-padding: 12px 16px;
|
|
305
|
+
--select-l-min-height: 48px;
|
|
306
|
+
--select-l-padding: 12px 12px;
|
|
307
|
+
--select-m-min-height: 40px;
|
|
305
308
|
--select-m-padding: 8px 12px;
|
|
306
|
-
--select-s-
|
|
307
|
-
--select-
|
|
309
|
+
--select-s-min-height: 28px;
|
|
310
|
+
--select-s-padding: 2px 6px;
|
|
308
311
|
|
|
309
312
|
--select-multi-item-xxl-padding: 5px;
|
|
310
313
|
--select-multi-item-xl-padding: 5px;
|
|
@@ -5,6 +5,23 @@ import { formatURL } from '@itcase/common';
|
|
|
5
5
|
import { UrlAssetPrefixContext } from '../context/UrlAssetPrefix.js';
|
|
6
6
|
|
|
7
7
|
var urlPropsList = ['src', 'imageSrc', 'svgSrc', 'placeholderUrl'];
|
|
8
|
+
/**
|
|
9
|
+
* HOC, который добавляет assetPrefix к URL-пропсам.
|
|
10
|
+
*
|
|
11
|
+
* @template P - Тип пропсов оборачиваемого компонента.
|
|
12
|
+
* @template T - Тип ref (если используется forwardRef).
|
|
13
|
+
* @template Check - Проверка на наличие хотя бы одного URL-пропа.
|
|
14
|
+
*
|
|
15
|
+
* @param WrappedComponent - Компонент, который оборачиваем.
|
|
16
|
+
* @param _error - Проверка: если ни одного URL-пропа нет, будет ошибка компиляции.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* const A = (props: { src?: string }) => <div />;
|
|
20
|
+
* urlWithAssetPrefix(A); // ✅ OK
|
|
21
|
+
*
|
|
22
|
+
* const B = (props: { id: string }) => <div />;
|
|
23
|
+
* urlWithAssetPrefix(B); // ❌ TS ошибка (нет url-пропов)
|
|
24
|
+
*/
|
|
8
25
|
var urlWithAssetPrefix = function (WrappedComponent) {
|
|
9
26
|
var HOC = React.forwardRef(function HOC(props, ref) {
|
|
10
27
|
var _a = useContext(UrlAssetPrefixContext), assetPrefix = _a.assetPrefix, ignorePathsList = _a.ignorePathsList;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
var CLASS_RULES = {
|
|
2
|
+
fill: [
|
|
3
|
+
{
|
|
4
|
+
key: 'fillClass',
|
|
5
|
+
stateFn: function (_a) {
|
|
6
|
+
var isDisabled = _a.isDisabled, isActive = _a.isActive;
|
|
7
|
+
return !isActive && !isDisabled;
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
key: 'fillHoverClass',
|
|
12
|
+
stateFn: function (_a) {
|
|
13
|
+
var isDisabled = _a.isDisabled, isActive = _a.isActive;
|
|
14
|
+
return !isActive && !isDisabled;
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
key: 'fillActiveClass',
|
|
19
|
+
stateFn: function (_a) {
|
|
20
|
+
var isDisabled = _a.isDisabled, isActive = _a.isActive;
|
|
21
|
+
return Boolean(isActive) && !isDisabled;
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
key: 'fillActiveHoverClass',
|
|
26
|
+
stateFn: function (_a) {
|
|
27
|
+
var isDisabled = _a.isDisabled, isActive = _a.isActive;
|
|
28
|
+
return Boolean(isActive) && !isDisabled;
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
key: 'fillDisabledClass',
|
|
33
|
+
stateFn: function (_a) {
|
|
34
|
+
var isDisabled = _a.isDisabled, isActive = _a.isActive;
|
|
35
|
+
return !isActive && Boolean(isDisabled);
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
borderColor: [
|
|
40
|
+
{
|
|
41
|
+
key: 'borderColorClass',
|
|
42
|
+
stateFn: function (_a) {
|
|
43
|
+
var isDisabled = _a.isDisabled, isActive = _a.isActive;
|
|
44
|
+
return !isActive && !isDisabled;
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
key: 'borderColorHoverClass',
|
|
49
|
+
stateFn: function (_a) {
|
|
50
|
+
var isDisabled = _a.isDisabled, isActive = _a.isActive;
|
|
51
|
+
return !isActive && !isDisabled;
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
key: 'borderColorActiveClass',
|
|
56
|
+
stateFn: function (_a) {
|
|
57
|
+
var isDisabled = _a.isDisabled, isActive = _a.isActive;
|
|
58
|
+
return Boolean(isActive) && !isDisabled;
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
textColor: [
|
|
63
|
+
{
|
|
64
|
+
key: 'textColorClass',
|
|
65
|
+
stateFn: function (_a) {
|
|
66
|
+
var isDisabled = _a.isDisabled, isActive = _a.isActive;
|
|
67
|
+
return !isActive && !isDisabled;
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
};
|
|
72
|
+
var formatState = function (key) {
|
|
73
|
+
// Try to find one of the state tokens in the input key:
|
|
74
|
+
// - matches "ActiveHover", "Active", "Hover" or "Disabled"
|
|
75
|
+
// - case-insensitive because of the /i flag
|
|
76
|
+
// Examples of matches:
|
|
77
|
+
// "fillActiveHoverColor" -> match[0] === "ActiveHover"
|
|
78
|
+
// "borderDisabled" -> match[0] === "Disabled"
|
|
79
|
+
var stateMatch = key.match(/(ActiveHover|Active|Hover|Disabled)/i);
|
|
80
|
+
if (!stateMatch) {
|
|
81
|
+
return '';
|
|
82
|
+
}
|
|
83
|
+
// Replace the matched token with a normalized snake-like form and
|
|
84
|
+
// prepend an underscore. The chained replace calls map:
|
|
85
|
+
// ActiveHover -> active_hover
|
|
86
|
+
// Active -> active
|
|
87
|
+
// Hover -> hover
|
|
88
|
+
// Disabled -> disabled
|
|
89
|
+
// The final .toLowerCase() ensures output is lowercased regardless of input casing.
|
|
90
|
+
// Examples:
|
|
91
|
+
// "fillActiveHoverColor" -> "_active_hover"
|
|
92
|
+
// "borderDisabled" -> "disabled"
|
|
93
|
+
return ('_' +
|
|
94
|
+
stateMatch[0]
|
|
95
|
+
.replace(/ActiveHover/i, 'active_hover')
|
|
96
|
+
.replace(/Active/i, 'active')
|
|
97
|
+
.replace(/Hover/i, 'hover')
|
|
98
|
+
.replace(/Disabled/i, 'disabled')
|
|
99
|
+
.toLowerCase());
|
|
100
|
+
};
|
|
101
|
+
// Insert a hyphen between a lowercase letter followed by an uppercase letter:
|
|
102
|
+
// - regex: /([a-z])([A-Z])/g
|
|
103
|
+
// ([a-z]) -> capture group 1: a lowercase letter
|
|
104
|
+
// ([A-Z]) -> capture group 2: an uppercase letter
|
|
105
|
+
// g -> global: replace all occurrences
|
|
106
|
+
// - replacement: '$1-$2' puts a hyphen between the two captured groups
|
|
107
|
+
// - finally .toLowerCase() to produce a full kebab-case string
|
|
108
|
+
//
|
|
109
|
+
// Examples:
|
|
110
|
+
// "myTestString" -> "my-test-string"
|
|
111
|
+
// "borderColorActiveHover" -> "border-color-active-hover"
|
|
112
|
+
var toKebabCase = function (str) {
|
|
113
|
+
return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export { CLASS_RULES, formatState, toKebabCase };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
var suffix = [
|
|
2
|
+
'Button',
|
|
3
|
+
'Checkbox',
|
|
4
|
+
'Radio',
|
|
5
|
+
'Checkmark',
|
|
6
|
+
'Avatar',
|
|
7
|
+
'AvatarStack',
|
|
8
|
+
'Badge',
|
|
9
|
+
'Breadcrumbs',
|
|
10
|
+
'Cell',
|
|
11
|
+
'Chips',
|
|
12
|
+
'Choice',
|
|
13
|
+
'Code',
|
|
14
|
+
'CookiesWarning',
|
|
15
|
+
'Dadata',
|
|
16
|
+
'DatePeriod',
|
|
17
|
+
'Divider',
|
|
18
|
+
'Dot',
|
|
19
|
+
'Drawer',
|
|
20
|
+
'Dropdown',
|
|
21
|
+
'DropdownItem',
|
|
22
|
+
'Flex',
|
|
23
|
+
'Grid',
|
|
24
|
+
'Group',
|
|
25
|
+
'HeroTitle',
|
|
26
|
+
'HTMLContent',
|
|
27
|
+
'Icon',
|
|
28
|
+
'Image',
|
|
29
|
+
'Input',
|
|
30
|
+
'InputPassword',
|
|
31
|
+
'Label',
|
|
32
|
+
'Link',
|
|
33
|
+
'List',
|
|
34
|
+
'Loader',
|
|
35
|
+
'Logo',
|
|
36
|
+
'MenuItem',
|
|
37
|
+
'Modal',
|
|
38
|
+
'ModalSheetBottom',
|
|
39
|
+
'Notification',
|
|
40
|
+
'Overlay',
|
|
41
|
+
'Pagination',
|
|
42
|
+
'RangeSlider',
|
|
43
|
+
'Response',
|
|
44
|
+
'ScrollBar',
|
|
45
|
+
'ScrollOnDrag',
|
|
46
|
+
'ScrollToView',
|
|
47
|
+
'Search',
|
|
48
|
+
'Segmented',
|
|
49
|
+
'Select',
|
|
50
|
+
'SvgContent',
|
|
51
|
+
'Swiper',
|
|
52
|
+
'Switch',
|
|
53
|
+
'Tab',
|
|
54
|
+
'Text',
|
|
55
|
+
'Textarea',
|
|
56
|
+
'Tile',
|
|
57
|
+
'Title',
|
|
58
|
+
'Tooltip',
|
|
59
|
+
'Video',
|
|
60
|
+
'Warning',
|
|
61
|
+
];
|
|
62
|
+
|
|
63
|
+
export { suffix };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import { CLASS_RULES, toKebabCase, formatState } from './useActiveClasses.helpers.js';
|
|
3
|
+
|
|
4
|
+
var useActiveClasses = function (params) {
|
|
5
|
+
var isDisabled = params.isDisabled, propsGenerator = params.propsGenerator, _a = params.suffixes, suffixes = _a === void 0 ? [] : _a, isActive = params.isActive;
|
|
6
|
+
var rootClassesArray = [];
|
|
7
|
+
Object.entries(CLASS_RULES).forEach(function (_a) {
|
|
8
|
+
var rulesName = _a[0], rules = _a[1];
|
|
9
|
+
var kebabRuleName = toKebabCase(rulesName);
|
|
10
|
+
rules.forEach(function (_a) {
|
|
11
|
+
var key = _a.key, stateFn = _a.stateFn;
|
|
12
|
+
var value = propsGenerator[key];
|
|
13
|
+
if (!value) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (stateFn) {
|
|
17
|
+
var active = stateFn({ isDisabled: isDisabled, isActive: isActive });
|
|
18
|
+
if (!active) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
var stateName = formatState(key);
|
|
23
|
+
rootClassesArray.push("".concat(kebabRuleName).concat(stateName, "_").concat(value));
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
var rootClasses = clsx(rootClassesArray);
|
|
27
|
+
var suffixClasses = suffixes.reduce(function (acc, suffix) {
|
|
28
|
+
var classes = [];
|
|
29
|
+
Object.entries(CLASS_RULES).forEach(function (_a) {
|
|
30
|
+
var rulesName = _a[0], rules = _a[1];
|
|
31
|
+
rules.forEach(function (_a) {
|
|
32
|
+
var key = _a.key, stateFn = _a.stateFn;
|
|
33
|
+
var withoutPrefixRulesName = key.replace(rulesName, '');
|
|
34
|
+
var propKey = rulesName + suffix + withoutPrefixRulesName;
|
|
35
|
+
var value = propsGenerator[propKey];
|
|
36
|
+
if (!value) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (stateFn) {
|
|
40
|
+
var active = stateFn({ isDisabled: isDisabled, isActive: isActive });
|
|
41
|
+
if (!active) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
var state = formatState(propKey);
|
|
46
|
+
var kebabName = toKebabCase(rulesName);
|
|
47
|
+
classes.push("".concat(kebabName).concat(state, "_").concat(value));
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
var suffixKey = suffix === 'HTMLContent'
|
|
51
|
+
? 'htmlContent'
|
|
52
|
+
: (suffix[0].toLowerCase() + suffix.slice(1));
|
|
53
|
+
acc[suffixKey] = clsx(classes);
|
|
54
|
+
return acc;
|
|
55
|
+
}, {});
|
|
56
|
+
return {
|
|
57
|
+
rootClasses: rootClasses,
|
|
58
|
+
suffixClasses: suffixClasses,
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export { useActiveClasses };
|
|
@@ -5,6 +5,8 @@ import castArray from 'lodash/castArray';
|
|
|
5
5
|
import upperFirst from 'lodash/upperFirst';
|
|
6
6
|
import '../../context/Notifications.js';
|
|
7
7
|
import { useUserDeviceContext } from '../../context/UIContext.js';
|
|
8
|
+
import { getStyleAttributeKey } from '../../hooks.js';
|
|
9
|
+
import styleAttributes from '../useStyles/styleAttributes.js';
|
|
8
10
|
import 'react/jsx-runtime';
|
|
9
11
|
import 'uuid';
|
|
10
12
|
import '@itcase/common';
|
|
@@ -70,8 +72,16 @@ function useDevicePropsGenerator(componentProps, appearanceConfig) {
|
|
|
70
72
|
// eslint-disable-next-line perfectionist/sort-objects
|
|
71
73
|
getClassName: function (propKey, params) {
|
|
72
74
|
var _a = params || {}, _b = _a.prefix, prefix = _b === void 0 ? '' : _b, _c = _a.replace, replace = _c === void 0 ? [/([A-Z])/g, '-$1'] : _c;
|
|
73
|
-
// prettier-ignore
|
|
74
75
|
var targetClassValue = this.getProp(String(propKey));
|
|
76
|
+
var styleAttributeKeys = styleAttributes.map(function (attr) {
|
|
77
|
+
return getStyleAttributeKey(attr);
|
|
78
|
+
});
|
|
79
|
+
if (styleAttributeKeys.includes(String(propKey)) &&
|
|
80
|
+
(typeof targetClassValue === 'number' ||
|
|
81
|
+
(typeof targetClassValue === 'string' &&
|
|
82
|
+
!isNaN(parseFloat(targetClassValue))))) {
|
|
83
|
+
return '';
|
|
84
|
+
}
|
|
75
85
|
if (targetClassValue) {
|
|
76
86
|
var cleanClassValue = String(targetClassValue);
|
|
77
87
|
if (!cleanClassValue.includes('.')) {
|
|
@@ -4,6 +4,7 @@ import maxBy from 'lodash/maxBy';
|
|
|
4
4
|
import upperFirst from 'lodash/upperFirst';
|
|
5
5
|
import '../../context/Notifications.js';
|
|
6
6
|
import { useUserDeviceContext } from '../../context/UIContext.js';
|
|
7
|
+
import { getStyleAttributeKey } from '../../hooks.js';
|
|
7
8
|
import styleAttributes from './styleAttributes.js';
|
|
8
9
|
import '../../tslib.es6_es_Bwu1Cn-t.js';
|
|
9
10
|
import 'react/jsx-runtime';
|
|
@@ -181,10 +182,10 @@ const getTargetStyleAttributeKey = (styleKey, styleValue = '') => {
|
|
|
181
182
|
|
|
182
183
|
// Get longest style key (e.g. "borderLeftWidth")
|
|
183
184
|
const targetStyleAttribute = maxBy(possibleStyleAttributesList, styleAttribute => {
|
|
184
|
-
const
|
|
185
|
-
return
|
|
185
|
+
const key = getStyleAttributeKey(styleAttribute);
|
|
186
|
+
return key.length;
|
|
186
187
|
});
|
|
187
|
-
const styleAttributeKey =
|
|
188
|
+
const styleAttributeKey = getStyleAttributeKey(targetStyleAttribute);
|
|
188
189
|
return styleAttributeKey;
|
|
189
190
|
};
|
|
190
191
|
|
package/dist/hooks/useStyles.js
CHANGED