@itcase/ui 1.9.51 → 1.9.52

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.
Files changed (104) hide show
  1. package/dist/{Avatar_cjs_CZ0XJ6d2.js → Avatar_cjs_CvbURI0f.js} +1 -1
  2. package/dist/{Avatar_es_B2gMldVe.js → Avatar_es_CV-ffIJu.js} +1 -1
  3. package/dist/{ChipsGroup_cjs_D0xy5I4S.js → ChipsGroup_cjs_CE-nNENH.js} +2 -4
  4. package/dist/{ChipsGroup_es_C_dgXLfC.js → ChipsGroup_es_CxqwFgoo.js} +2 -4
  5. package/dist/{Image_cjs_C_FMjUjx.js → Image_cjs_Hvjp2QDB.js} +2 -2
  6. package/dist/{Image_es_Ca7UQOkj.js → Image_es_DpOCNWpn.js} +2 -2
  7. package/dist/{SelectContainer_cjs_DshFNYWN.js → SelectContainer_cjs_qWAMLIkz.js} +5 -5
  8. package/dist/{SelectContainer_es_BQ3-SqL2.js → SelectContainer_es_kRH4DsEh.js} +5 -5
  9. package/dist/cjs/components/Avatar.js +2 -2
  10. package/dist/cjs/components/AvatarStack.js +2 -2
  11. package/dist/cjs/components/Checkbox.js +47 -50
  12. package/dist/cjs/components/Checkmark.js +31 -6
  13. package/dist/cjs/components/Chips.js +1 -1
  14. package/dist/cjs/components/DatePeriod.js +8 -8
  15. package/dist/cjs/components/DatePicker.js +4 -4
  16. package/dist/cjs/components/Drawer.js +23 -24
  17. package/dist/cjs/components/Image.js +1 -1
  18. package/dist/cjs/components/InputPassword.js +1 -1
  19. package/dist/cjs/components/Select/stories/__mock__.js +4 -4
  20. package/dist/cjs/components/Select.js +2 -2
  21. package/dist/cjs/components/Tile.js +2 -1
  22. package/dist/cjs/context/Notifications.js +1 -1
  23. package/dist/cjs/context/UIContext.js +7 -1
  24. package/dist/cjs/hooks/useActiveClasses/useActiveClasses.helpers.js +9 -9
  25. package/dist/cjs/hooks/useActiveClasses/useActiveClasses.js +3 -3
  26. package/dist/cjs/hooks/useStyles/styleAttributes.js +166 -43
  27. package/dist/cjs/hooks/useStyles/useStyles.js +169 -155
  28. package/dist/cjs/utils/mergeAppearanceKeys.js +14 -1
  29. package/dist/components/Avatar.js +2 -2
  30. package/dist/components/AvatarStack.js +2 -2
  31. package/dist/components/Checkbox.js +47 -50
  32. package/dist/components/Checkmark.js +31 -6
  33. package/dist/components/Chips.js +1 -1
  34. package/dist/components/DatePeriod.js +8 -8
  35. package/dist/components/DatePicker.js +4 -4
  36. package/dist/components/Drawer.js +23 -24
  37. package/dist/components/Image.js +1 -1
  38. package/dist/components/InputPassword.js +1 -1
  39. package/dist/components/Select/stories/__mock__.js +4 -4
  40. package/dist/components/Select.js +2 -2
  41. package/dist/components/Tile.js +2 -1
  42. package/dist/context/Notifications.js +1 -1
  43. package/dist/context/UIContext.js +7 -1
  44. package/dist/css/styles/bundles.css +102 -97
  45. package/dist/hooks/useActiveClasses/useActiveClasses.helpers.js +9 -9
  46. package/dist/hooks/useActiveClasses/useActiveClasses.js +3 -3
  47. package/dist/hooks/useStyles/styleAttributes.js +166 -43
  48. package/dist/hooks/useStyles/useStyles.js +169 -155
  49. package/dist/types/components/Avatar/Avatar.interface.d.ts +2 -2
  50. package/dist/types/components/AvatarStack/AvatarStack.interface.d.ts +9 -15
  51. package/dist/types/components/Breadcrumbs/Breadcrumbs.interface.d.ts +9 -8
  52. package/dist/types/components/Checkbox/Checkbox.interface.d.ts +3 -3
  53. package/dist/types/components/Checkbox/appearance/checkboxShape.d.ts +3 -0
  54. package/dist/types/components/Checkmark/Checkmark.interface.d.ts +8 -2
  55. package/dist/types/components/Checkmark/appearance/checkmarkError.d.ts +3 -0
  56. package/dist/types/components/Checkmark/stories/CheckmarkError.stories.d.ts +23 -0
  57. package/dist/types/components/Chips/Chips.interface.d.ts +2 -2
  58. package/dist/types/components/DatePeriod/DatePeriod.interface.d.ts +20 -19
  59. package/dist/types/components/DatePeriod/stories/DatePeriodSize.stories.d.ts +3 -0
  60. package/dist/types/components/DatePicker/DatePicker.interface.d.ts +4 -3
  61. package/dist/types/components/HeroTitle/HeroTitle.interface.d.ts +1 -1
  62. package/dist/types/components/Link/Link.interface.d.ts +1 -1
  63. package/dist/types/components/List/List.interface.d.ts +1 -1
  64. package/dist/types/components/Loader/Loader.interface.d.ts +4 -3
  65. package/dist/types/components/MenuItem/MenuItem.interface.d.ts +1 -1
  66. package/dist/types/components/Notification/Notification.interface.d.ts +2 -2
  67. package/dist/types/components/Search/Search.interface.d.ts +10 -9
  68. package/dist/types/components/Search/SearchInput.d.ts +7 -7
  69. package/dist/types/components/Search/stories/SearchInputDefault.stories.d.ts +7 -7
  70. package/dist/types/components/Search/stories/SearchInputDemo.stories.d.ts +7 -7
  71. package/dist/types/components/Search/stories/SearchInputDisabled.stories.d.ts +7 -7
  72. package/dist/types/components/Search/stories/SearchInputError.stories.d.ts +7 -7
  73. package/dist/types/components/Search/stories/SearchInputRequire.stories.d.ts +7 -7
  74. package/dist/types/components/Search/stories/SearchInputShape.stories.d.ts +7 -7
  75. package/dist/types/components/Search/stories/SearchInputSize.stories.d.ts +7 -7
  76. package/dist/types/components/Search/stories/SearchInputStyle.stories.d.ts +7 -7
  77. package/dist/types/components/Search/stories/SearchInputSuccess.stories.d.ts +7 -7
  78. package/dist/types/components/Select/Select.interface.d.ts +9 -7
  79. package/dist/types/components/Select/SelectContainer.d.ts +4 -1
  80. package/dist/types/components/Select/SelectMultiValue.d.ts +2 -2
  81. package/dist/types/components/Select/stories/Select.stories.d.ts +5 -3
  82. package/dist/types/components/Select/stories/SelectDefault.stories.d.ts +5 -3
  83. package/dist/types/components/Select/stories/SelectDisabled.stories.d.ts +5 -3
  84. package/dist/types/components/Select/stories/SelectError.stories.d.ts +5 -3
  85. package/dist/types/components/Select/stories/SelectRequire.stories.d.ts +5 -3
  86. package/dist/types/components/Select/stories/SelectShape.stories.d.ts +5 -3
  87. package/dist/types/components/Select/stories/SelectSize.stories.d.ts +5 -3
  88. package/dist/types/components/Select/stories/SelectStyle.stories.d.ts +5 -3
  89. package/dist/types/components/Select/stories/SelectSuccess.stories.d.ts +5 -3
  90. package/dist/types/components/Select/stories/__mock__/index.d.ts +2 -2
  91. package/dist/types/components/Swiper/Swiper.interface.d.ts +2 -11
  92. package/dist/types/components/Text/Text.interface.d.ts +2 -2
  93. package/dist/types/context/Notifications.d.ts +1 -1
  94. package/dist/types/context/Notifications.interface.d.ts +2 -1
  95. package/dist/types/context/UIContext.d.ts +10 -4
  96. package/dist/types/hooks/useActiveClasses/useActiveClasses.interface.d.ts +1 -2
  97. package/dist/types/hooks/useStyles/styleAttributes.d.ts +2 -3
  98. package/dist/types/hooks/useStyles/styleAttributes.interface.d.ts +9 -3
  99. package/dist/types/hooks/useStyles/useStyles.d.ts +4 -1
  100. package/dist/types/utils/mergeAppearanceKeys.d.ts +6 -1
  101. package/dist/utils/mergeAppearanceKeys.js +14 -1
  102. package/package.json +12 -12
  103. package/dist/{DatePicker_cjs_avA-OHmZ.js → DatePicker_cjs_BJzVpk0o.js} +3 -3
  104. package/dist/{DatePicker_es_ungoFvip.js → DatePicker_es_BP0iWHMt.js} +3 -3
@@ -24,167 +24,181 @@ require('../../utils/setViewportProperty.js');
24
24
  * paddingHorizontalGridInnerWrapperMobileNormal: "10px"
25
25
  */
26
26
  function useStyles(props) {
27
- const {
28
- deviceCurrentMainType,
29
- deviceCurrentType,
30
- deviceTypesList
31
- } = UIContext.useUserDeviceContext();
32
- const propsStyleAttributes = React.useMemo(() => {
33
- const styles = Object.entries(props).reduce((result, [propKey, propValue]) => {
34
- const styleAttributeKey = getTargetStyleAttributeKey(propKey, propValue);
35
- if (styleAttributeKey) {
36
- result[propKey] = propValue;
37
- }
38
- return result;
39
- }, {});
40
- return styles;
41
- // "props" object maybe big and frequently changing
42
- }, [props]);
43
- const collectedStyles = React.useMemo(() => {
44
- const resultStylesGroups = {};
45
- for (const [propKey, propValue] of Object.entries(propsStyleAttributes)) {
46
- let value = null;
47
- const styleAttributeKey = getTargetStyleAttributeKey(propKey, propValue);
48
- const isStyleForCurrentDevice = propKey.toLowerCase().endsWith(deviceCurrentType.toLowerCase());
49
- // e.g. "GridWrapperInner"
50
- const targetElementKey = removeDeviceType(propKey.replace(styleAttributeKey, ''), deviceTypesList);
51
- const targetElementGroupKey = camelCase(targetElementKey) || 'styles';
52
- if (!resultStylesGroups[targetElementGroupKey]) {
53
- resultStylesGroups[targetElementGroupKey] = {};
54
- }
55
- if (isStyleForCurrentDevice) {
56
- value = propValue;
57
- } else {
58
- const propKeyWithOutDeviceType = `${styleAttributeKey}${targetElementKey}`;
59
- const propKeyWithBaseDeviceType = `${propKeyWithOutDeviceType}${upperFirst(deviceCurrentMainType)}`;
60
- const defaultValue = props[propKeyWithBaseDeviceType] || props[propKeyWithOutDeviceType];
61
- let currentValue = resultStylesGroups[targetElementGroupKey][styleAttributeKey];
62
- if (propKeyWithOutDeviceType.includes('Horizontal')) {
63
- const keyLeft = styleAttributeKey.replace('Horizontal', 'Left');
64
- currentValue = resultStylesGroups[targetElementGroupKey][keyLeft];
65
- } else if (propKeyWithOutDeviceType.includes('Vertical')) {
66
- const keyTop = styleAttributeKey.replace('Vertical', 'Top');
67
- currentValue = resultStylesGroups[targetElementGroupKey][keyTop];
27
+ const { deviceCurrentMainType, deviceCurrentType, deviceTypesList } = UIContext.useUserDeviceContext();
28
+ const propsStyleAttributes = React.useMemo(() => {
29
+ const styles = Object.entries(props).reduce((result, [propKey, propValue]) => {
30
+ const styleAttributeKey = getTargetStyleAttributeKey(propKey, propValue);
31
+ if (styleAttributeKey) {
32
+ result[propKey] = propValue;
33
+ }
34
+ return result;
35
+ }, {});
36
+ return styles;
37
+ // "props" object maybe big and frequently changing
38
+ }, [props]);
39
+ const collectedStyles = React.useMemo(() => {
40
+ const resultStylesGroups = {};
41
+ for (const [propKey, propValue] of Object.entries(propsStyleAttributes)) {
42
+ let value = null;
43
+ const styleAttributeKey = getTargetStyleAttributeKey(propKey, propValue);
44
+ const isStyleForCurrentDevice = propKey
45
+ .toLowerCase()
46
+ .endsWith(deviceCurrentType.toLowerCase());
47
+ // e.g. "GridWrapperInner"
48
+ const targetElementKey = removeDeviceType(propKey.replace(styleAttributeKey, ''), deviceTypesList);
49
+ const targetElementGroupKey = camelCase(targetElementKey) || 'styles';
50
+ if (!resultStylesGroups[targetElementGroupKey]) {
51
+ resultStylesGroups[targetElementGroupKey] = {};
52
+ }
53
+ if (isStyleForCurrentDevice) {
54
+ value = propValue;
55
+ }
56
+ else {
57
+ const propKeyWithOutDeviceType = `${styleAttributeKey}${targetElementKey}`;
58
+ const propKeyWithBaseDeviceType = `${propKeyWithOutDeviceType}${upperFirst(deviceCurrentMainType)}`;
59
+ const defaultValue = props[propKeyWithBaseDeviceType] || props[propKeyWithOutDeviceType];
60
+ let currentValue = resultStylesGroups[targetElementGroupKey][styleAttributeKey];
61
+ if (propKeyWithOutDeviceType.includes('Horizontal')) {
62
+ const keyLeft = styleAttributeKey.replace('Horizontal', 'Left');
63
+ currentValue =
64
+ resultStylesGroups[targetElementGroupKey][keyLeft];
65
+ }
66
+ else if (propKeyWithOutDeviceType.includes('Vertical')) {
67
+ const keyTop = styleAttributeKey.replace('Vertical', 'Top');
68
+ currentValue =
69
+ resultStylesGroups[targetElementGroupKey][keyTop];
70
+ }
71
+ if (!currentValue) {
72
+ value = defaultValue;
73
+ }
74
+ }
75
+ if (value) {
76
+ // Check not digit symbols. Chars means some unit ("px", "em", "rem" or custom "m")
77
+ const isValueHasUnit = /\D/.test(value);
78
+ // If value has some unit
79
+ if (isValueHasUnit) {
80
+ // Check value on our custom "m"(module) unit
81
+ /** Pattern for:
82
+ * 1m
83
+ * 1.5m
84
+ * 1m 1m 1.5m
85
+ * 0 0 1m 1m
86
+ */
87
+ const isValueHasModuleUnit = /\d+\.?\d*m\s?(?![a-zA-Z]+)/.test(value);
88
+ // If value has module unit
89
+ if (isValueHasModuleUnit) {
90
+ /** Order for shorthand properties:
91
+ * top
92
+ * right
93
+ * bottom
94
+ * left
95
+ * or:
96
+ * top
97
+ * right and left
98
+ * bottom
99
+ * or:
100
+ * top and bottom
101
+ * right and left
102
+ */
103
+ const valuePxPartsList = value
104
+ .split(' ')
105
+ .map((valuePart) => {
106
+ const valueModule = valuePart.replace(/[a-z]/gi, '');
107
+ const valuePx = parseFloat(valueModule) * 8;
108
+ return `${valuePx}px`;
109
+ }, []);
110
+ value = valuePxPartsList.join(' ');
111
+ }
112
+ }
113
+ else {
114
+ // Some properties doesn't have any units
115
+ const ignorePX = ['zIndex', 'order', 'flexGrow'].includes(styleAttributeKey);
116
+ if (!ignorePX) {
117
+ // Add px to non-unit value
118
+ value = `${value}px`;
119
+ }
120
+ }
121
+ if (styleAttributeKey.includes('Horizontal')) {
122
+ const keyRight = styleAttributeKey.replace('Horizontal', 'Right');
123
+ const keyLeft = styleAttributeKey.replace('Horizontal', 'Left');
124
+ const valuePartsList = value.split(' ');
125
+ const valueRight = valuePartsList[0];
126
+ const valueLeft = valuePartsList[1] || valuePartsList[0];
127
+ resultStylesGroups[targetElementGroupKey][keyRight] = valueRight;
128
+ resultStylesGroups[targetElementGroupKey][keyLeft] = valueLeft;
129
+ }
130
+ else if (styleAttributeKey.includes('Vertical')) {
131
+ const keyTop = styleAttributeKey.replace('Vertical', 'Top');
132
+ const keyBottom = styleAttributeKey.replace('Vertical', 'Bottom');
133
+ const valuePartsList = value.split(' ');
134
+ const valueTop = valuePartsList[0];
135
+ const valueBottom = valuePartsList[1] || valuePartsList[0];
136
+ resultStylesGroups[targetElementGroupKey][keyTop] = valueTop;
137
+ resultStylesGroups[targetElementGroupKey][keyBottom] = valueBottom;
138
+ }
139
+ else {
140
+ resultStylesGroups[targetElementGroupKey][styleAttributeKey] = value;
141
+ }
142
+ }
68
143
  }
69
- if (!currentValue) {
70
- value = defaultValue;
71
- }
72
- }
73
- if (value) {
74
- // Check not digit symbols. Chars means some unit ("px", "em", "rem" or custom "m")
75
- const isValueHasUnit = /\D/.test(value);
76
- // If value has some unit
77
- if (isValueHasUnit) {
78
- // Check value on our custom "m"(module) unit
79
- /** Pattern for:
80
- * 1m
81
- * 1.5m
82
- * 1m 1m 1.5m
83
- * 0 0 1m 1m
84
- */
85
- const isValueHasModuleUnit = /\d+\.?\d*m\s?(?![a-zA-Z]+)/.test(value);
86
- // If value has module unit
87
- if (isValueHasModuleUnit) {
88
- /** Order for shorthand properties:
89
- * top
90
- * right
91
- * bottom
92
- * left
93
- * or:
94
- * top
95
- * right and left
96
- * bottom
97
- * or:
98
- * top and bottom
99
- * right and left
100
- */
101
- const valuePxPartsList = value.split(' ').map(valuePart => {
102
- const valueModule = valuePart.replace(/[a-z]/gi, '');
103
- const valuePx = parseFloat(valueModule) * 8;
104
- return `${valuePx}px`;
105
- }, []);
106
- value = valuePxPartsList.join(' ');
107
- }
108
- } else {
109
- // Some properties doesn't have any units
110
- const ignorePX = ['zIndex', 'order', 'flexGrow'].includes(styleAttributeKey);
111
- if (!ignorePX) {
112
- // Add px to non-unit value
113
- value = `${value}px`;
114
- }
115
- }
116
- if (styleAttributeKey.includes('Horizontal')) {
117
- const keyRight = styleAttributeKey.replace('Horizontal', 'Right');
118
- const keyLeft = styleAttributeKey.replace('Horizontal', 'Left');
119
- const valuePartsList = value.split(' ');
120
- const valueRight = valuePartsList[0];
121
- const valueLeft = valuePartsList[1] || valuePartsList[0];
122
- resultStylesGroups[targetElementGroupKey][keyRight] = valueRight;
123
- resultStylesGroups[targetElementGroupKey][keyLeft] = valueLeft;
124
- } else if (styleAttributeKey.includes('Vertical')) {
125
- const keyTop = styleAttributeKey.replace('Vertical', 'Top');
126
- const keyBottom = styleAttributeKey.replace('Vertical', 'Bottom');
127
- const valuePartsList = value.split(' ');
128
- const valueTop = valuePartsList[0];
129
- const valueBottom = valuePartsList[1] || valuePartsList[0];
130
- resultStylesGroups[targetElementGroupKey][keyTop] = valueTop;
131
- resultStylesGroups[targetElementGroupKey][keyBottom] = valueBottom;
132
- } else {
133
- resultStylesGroups[targetElementGroupKey][styleAttributeKey] = value;
134
- }
135
- }
136
- }
137
- return resultStylesGroups;
138
- // eslint-disable-next-line react-hooks/exhaustive-deps
139
- }, [deviceCurrentMainType, deviceCurrentType, ...Object.values(propsStyleAttributes)]);
140
- return collectedStyles;
144
+ return resultStylesGroups;
145
+ // eslint-disable-next-line react-hooks/exhaustive-deps
146
+ }, [
147
+ deviceCurrentMainType,
148
+ deviceCurrentType,
149
+ ...Object.values(propsStyleAttributes),
150
+ ]);
151
+ return collectedStyles;
141
152
  }
142
153
  const removeDeviceType = (originalKey, deviceTypesList) => {
143
- // Remove "mobile"/"tablet"/"desktop"
144
- const withOutDeviceType = deviceTypesList.reduce((cleanKey, deviceType) => {
145
- if (cleanKey.endsWith(upperFirst(deviceType))) {
146
- return cleanKey.replace(upperFirst(deviceType), '');
147
- }
148
- return cleanKey;
149
- }, originalKey);
150
- return withOutDeviceType;
154
+ // Remove "mobile"/"tablet"/"desktop"
155
+ const withOutDeviceType = deviceTypesList.reduce((cleanKey, deviceType) => {
156
+ if (cleanKey.endsWith(upperFirst(deviceType))) {
157
+ return cleanKey.replace(upperFirst(deviceType), '');
158
+ }
159
+ return cleanKey;
160
+ }, originalKey);
161
+ return withOutDeviceType;
151
162
  };
152
163
  const getTargetStyleAttributeKey = (styleKey, styleValue = '') => {
153
- // Collect list of possible styles for propKey. e.g:
154
- // "borderLeftWidthWrapperInnerMobileNormal" to ["border", "borderLeftWidth"]
155
- const possibleStyleAttributesList = styleAttributes.default.filter(styleAttribute => {
156
- // Attribute can be array with key on first position and params on second
157
- if (Array.isArray(styleAttribute)) {
158
- // First item always attribute key (e.g. border, width, etc)
159
- const styleAttributeKey = styleAttribute[0];
160
- // Second item always params with some settings or methods
161
- const styleAttributeParams = styleAttribute[1] || {};
162
- // If is target attribute key
163
- if (styleKey.startsWith(styleAttributeKey)) {
164
- // If target attribute params has validate method
165
- if (styleAttributeParams.validate) {
166
- // Return validation result for target attribute
167
- return styleAttributeParams.validate(styleValue);
168
- } else {
169
- // Or always add to list
170
- return true;
164
+ // Collect list of possible styles for propKey. e.g:
165
+ // "borderLeftWidthWrapperInnerMobileNormal" to ["border", "borderLeftWidth"]
166
+ const possibleStyleAttributesList = styleAttributes.default.filter((styleAttribute) => {
167
+ // Attribute can be array with key on first position and params on second
168
+ if (Array.isArray(styleAttribute)) {
169
+ // First item always attribute key (e.g. border, width, etc)
170
+ const styleAttributeKey = styleAttribute[0];
171
+ // Second item always params with some settings or methods
172
+ const styleAttributeParams = styleAttribute[1] || {};
173
+ // If is target attribute key
174
+ if (styleKey.startsWith(styleAttributeKey)) {
175
+ // If target attribute params has validate method
176
+ if (styleAttributeParams.validate) {
177
+ // Return validation result for target attribute
178
+ return styleAttributeParams.validate(styleValue);
179
+ }
180
+ else {
181
+ // Or always add to list
182
+ return true;
183
+ }
184
+ }
185
+ else {
186
+ // Else ignore
187
+ return false;
188
+ }
189
+ }
190
+ else {
191
+ // If is target attribute
192
+ return styleKey.startsWith(String(styleAttribute));
171
193
  }
172
- } else {
173
- // Else ignore
174
- return false;
175
- }
176
- } else {
177
- // If is target attribute
178
- return styleKey.startsWith(styleAttribute);
179
- }
180
- });
181
- // Get longest style key (e.g. "borderLeftWidth")
182
- const targetStyleAttribute = maxBy(possibleStyleAttributesList, styleAttribute => {
183
- const key = index_helpers.getStyleAttributeKey(styleAttribute);
184
- return key.length;
185
- });
186
- const styleAttributeKey = index_helpers.getStyleAttributeKey(targetStyleAttribute);
187
- return styleAttributeKey;
194
+ });
195
+ // Get longest style key (e.g. "borderLeftWidth")
196
+ const targetStyleAttribute = maxBy(possibleStyleAttributesList, (styleAttribute) => {
197
+ const key = index_helpers.getStyleAttributeKey(styleAttribute);
198
+ return key.length;
199
+ });
200
+ const styleAttributeKey = index_helpers.getStyleAttributeKey(targetStyleAttribute);
201
+ return styleAttributeKey;
188
202
  };
189
203
 
190
204
  exports.useStyles = useStyles;
@@ -1,5 +1,18 @@
1
1
  'use strict';
2
2
 
3
- const mergeAppearanceKeys = (...values) => values.join(' ');
3
+ /**
4
+ * @example
5
+ * mergeAppearanceKeys(' ', '1', undefined, '2', '1') === '1 2'
6
+ */
7
+ const mergeAppearanceKeys = (...appearances) => {
8
+ const trimmedAppearances = appearances
9
+ .map((appearance) => appearance?.trim())
10
+ .filter(Boolean);
11
+ if (trimmedAppearances.length < 2) {
12
+ return trimmedAppearances[0] ?? '';
13
+ }
14
+ const uniqueAppearances = Array.from(new Set(trimmedAppearances));
15
+ return uniqueAppearances.join(' ');
16
+ };
4
17
 
5
18
  exports.mergeAppearanceKeys = mergeAppearanceKeys;
@@ -1,4 +1,4 @@
1
- export { A as Avatar, a as avatarAppearance, b as avatarConfig } from '../Avatar_es_B2gMldVe.js';
1
+ export { A as Avatar, a as avatarAppearance, b as avatarConfig } from '../Avatar_es_CV-ffIJu.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
4
4
  import 'clsx';
@@ -24,4 +24,4 @@ import '../hooks/useStyles/useStyles.js';
24
24
  import 'lodash/maxBy';
25
25
  import '../Link_es_BDAmhIzd.js';
26
26
  import '../Text_es_DVNvU0m0.js';
27
- import '../Image_es_Ca7UQOkj.js';
27
+ import '../Image_es_DpOCNWpn.js';
@@ -4,7 +4,7 @@ import { mergeAppearanceKeys } from '../utils/mergeAppearanceKeys.js';
4
4
  import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
5
5
  import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
6
6
  import { useStyles } from '../hooks/useStyles/useStyles.js';
7
- import { A as Avatar } from '../Avatar_es_B2gMldVe.js';
7
+ import { A as Avatar } from '../Avatar_es_CV-ffIJu.js';
8
8
  import { G as Group } from '../Group_es_Y1qBBLZU.js';
9
9
  import { T as Text } from '../Text_es_DVNvU0m0.js';
10
10
  import 'react';
@@ -26,7 +26,7 @@ import 'react-inlinesvg';
26
26
  import '../hoc/urlWithAssetPrefix.js';
27
27
  import '../context/UrlAssetPrefix.js';
28
28
  import '../Link_es_BDAmhIzd.js';
29
- import '../Image_es_Ca7UQOkj.js';
29
+ import '../Image_es_DpOCNWpn.js';
30
30
 
31
31
  const avatarStackAppearanceSize = {
32
32
  size16: {
@@ -1,11 +1,12 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import clsx from 'clsx';
3
+ import { T as Text } from '../Text_es_DVNvU0m0.js';
3
4
  import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
4
5
  import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
5
- import { T as Text } from '../Text_es_DVNvU0m0.js';
6
+ import '../hooks/useStyles/useStyles.js';
6
7
  import 'react';
7
8
  import 'lodash/camelCase';
8
- import 'lodash/castArray';
9
+ import 'lodash/maxBy';
9
10
  import 'lodash/upperFirst';
10
11
  import '../context/Notifications.js';
11
12
  import 'uuid';
@@ -16,79 +17,79 @@ import 'react-responsive';
16
17
  import '../utils/setViewportProperty.js';
17
18
  import '../hooks.js';
18
19
  import '../hooks/useStyles/styleAttributes.js';
19
- import '../hooks/useStyles/useStyles.js';
20
- import 'lodash/maxBy';
20
+ import 'lodash/castArray';
21
21
 
22
22
  const checkboxAppearanceDefault = {
23
23
  defaultPrimary: {
24
+ fill: 'surfaceSecondary',
24
25
  fillCheckbox: 'surfaceSecondary',
25
- fillCheckboxActive: 'surfaceSecondary',
26
- fillCheckboxActiveHover: 'surfaceTertiary',
26
+ fillCheckboxActive: 'surfaceQuaternary',
27
+ fillCheckboxActiveHover: 'surfaceActiveHoverTertiary',
27
28
  fillCheckboxHover: 'surfaceHoverTertiary',
28
- fillCheckmark: 'surfacePrimary',
29
29
  labelTextColor: 'surfaceTextPrimary',
30
30
  descTextColor: 'surfaceTextPrimary',
31
- borderColorCheckbox: 'surfaceBorderPrimary',
32
- borderColorCheckboxActive: 'surfaceBorderPrimary',
33
- borderColorCheckboxActiveHover: 'surfaceBorderPrimary',
31
+ borderColorCheckbox: 'surfaceBorderQuaternary',
32
+ borderColorCheckboxActive: 'surfaceBorderQuaternary',
33
+ borderColorCheckboxActiveHover: 'surfaceBorderActivePrimary',
34
34
  borderColorCheckboxHover: 'surfaceBorderHoverPrimary',
35
35
  },
36
36
  };
37
37
 
38
38
  const checkboxAppearanceDisabled = {
39
39
  disabledPrimary: {
40
- fill: 'surfacePrimary',
41
- borderColor: 'errorBorderQuaternary',
42
- borderHover: 'errorBorderHoverQuaternary',
43
- textColor: 'surfaceTextQuaternary',
44
- },
45
- disabledSecondary: {
46
40
  fill: 'surfaceSecondary',
47
- borderColor: 'surfaceBorderTertiary',
48
- borderHover: 'surfaceBorderHoverQuaternary',
41
+ fillCheckbox: 'surfaceSecondary',
42
+ fillCheckboxActive: 'surfaceQuaternary',
43
+ fillCheckboxActiveHover: 'surfaceActiveHoverTertiary',
44
+ fillCheckboxHover: 'surfaceHoverTertiary',
45
+ labelTextColor: 'disabledTextSecondary',
46
+ descTextColor: 'disabledTextSecondary',
47
+ borderColorCheckbox: 'surfaceBorderQuaternary',
48
+ borderColorCheckboxActive: 'surfaceBorderQuaternary',
49
+ borderColorCheckboxActiveHover: 'surfaceBorderActivePrimary',
50
+ borderColorCheckboxHover: 'surfaceBorderHoverPrimary',
49
51
  },
50
52
  };
51
53
 
52
54
  const checkboxAppearanceError = {
53
55
  errorPrimary: {
54
56
  fill: 'errorTertiary',
55
- fillCheckbox: 'errorPrimary',
56
- fillCheckboxActive: 'errorActivePrimary',
57
+ fillCheckbox: 'errorTertiary',
58
+ fillCheckboxActive: 'errorQuaternary',
57
59
  fillCheckboxActiveHover: 'errorActiveHoverPrimary',
58
- fillCheckboxHover: 'surfaceHoverTertiary',
59
- fillCheckmark: 'errorPrimary',
60
+ fillCheckboxHover: 'errorHoverTertiary',
60
61
  labelTextColor: 'surfaceTextPrimary',
61
62
  descTextColor: 'surfaceTextPrimary',
62
- borderColorCheckbox: 'errorBorderPrimary',
63
- borderColorCheckboxActive: 'errorBorderActivePrimary',
63
+ borderColorCheckbox: 'errorBorderQuaternary',
64
+ borderColorCheckboxActive: 'errorBorderActiveQuaternary',
64
65
  borderColorCheckboxActiveHover: 'errorBorderActivePrimary',
65
66
  borderColorCheckboxHover: 'errorBorderHoverPrimary',
66
67
  },
67
- errorSecondary: {
68
- fill: 'errorSecondary',
69
- borderColor: 'errorBorderTertiary',
70
- borderHover: 'errorBorderHoverQuaternary',
71
- },
72
68
  };
73
69
 
74
70
  const checkboxAppearanceRequire = {
75
71
  requirePrimary: {
72
+ fill: 'warningTertiary',
76
73
  fillCheckbox: 'warningTertiary',
77
- fillCheckboxActive: 'warningActivePrimary',
78
- fillCheckboxActiveHover: 'warningActiveHoverTertiary',
79
- fillCheckboxHover: 'warningHoverSecondary',
80
- fillCheckmark: 'warningPrimary',
74
+ fillCheckboxActive: 'warningPrimary',
75
+ fillCheckboxActiveHover: 'warningActiveHoverPrimary',
76
+ fillCheckboxHover: 'warningHoverTertiary',
81
77
  labelTextColor: 'surfaceTextPrimary',
82
78
  descTextColor: 'surfaceTextPrimary',
83
- borderColorCheckbox: 'warningBorderPrimary',
84
- borderColorCheckboxActive: 'warningBorderActivePrimary',
79
+ borderColorCheckbox: 'warningBorderSecondary',
80
+ borderColorCheckboxActive: 'warningBorderSecondary',
85
81
  borderColorCheckboxActiveHover: 'warningBorderActivePrimary',
86
82
  borderColorCheckboxHover: 'warningBorderHoverPrimary',
87
83
  },
88
- requireSecondary: {
89
- fill: 'surfaceSecondary',
90
- borderColor: 'surfaceBorderTertiary',
91
- borderHover: 'surfaceBorderHoverQuaternary',
84
+ };
85
+
86
+ const checkboxAppearanceShape = {
87
+ rounded: {
88
+ shape: 'rounded',
89
+ },
90
+ roundedS: {
91
+ shape: 'rounded',
92
+ shapeStrength: '0_5m',
92
93
  },
93
94
  };
94
95
 
@@ -139,23 +140,18 @@ const checkboxAppearanceStyle = {
139
140
 
140
141
  const checkboxAppearanceSuccess = {
141
142
  successPrimary: {
142
- fillCheckbox: 'successPrimary',
143
- fillCheckboxActive: 'successActivePrimary',
144
- fillCheckboxActiveHover: 'successActiveHoverTertiary',
143
+ fill: 'successTertiary',
144
+ fillCheckbox: 'successTertiary',
145
+ fillCheckboxActive: 'successSecondary',
146
+ fillCheckboxActiveHover: 'successActiveHoverPrimary',
145
147
  fillCheckboxHover: 'successHoverTertiary',
146
- fillCheckmark: 'successPrimary',
147
148
  labelTextColor: 'surfaceTextPrimary',
148
149
  descTextColor: 'surfaceTextPrimary',
149
- borderColorCheckbox: 'successBorderPrimary',
150
- borderColorCheckboxActive: 'successBorderActivePrimary',
150
+ borderColorCheckbox: 'successBorderSecondary',
151
+ borderColorCheckboxActive: 'successBorderSecondary',
151
152
  borderColorCheckboxActiveHover: 'successBorderActivePrimary',
152
153
  borderColorCheckboxHover: 'successBorderHoverPrimary',
153
154
  },
154
- successSecondary: {
155
- fill: 'successSecondary',
156
- borderColor: 'successBorderTertiary',
157
- borderHover: 'successBorderHoverQuaternary',
158
- },
159
155
  };
160
156
 
161
157
  const checkboxAppearance = {
@@ -166,6 +162,7 @@ const checkboxAppearance = {
166
162
  ...checkboxAppearanceDisabled,
167
163
  ...checkboxAppearanceSize,
168
164
  ...checkboxAppearanceStyle,
165
+ ...checkboxAppearanceShape,
169
166
  };
170
167
 
171
168
  const checkboxConfig = {