@itcase/ui 1.8.35 → 1.8.36

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 (147) hide show
  1. package/dist/{Avatar_cjs_kADy_b4o.js → Avatar_cjs_DBoMi2WA.js} +1 -1
  2. package/dist/{Avatar_es_DbGpnL99.js → Avatar_es_DHREqfOD.js} +1 -1
  3. package/dist/{Button_cjs_CW6ENTbm.js → Button_cjs_djJUZATX.js} +2 -2
  4. package/dist/{Button_es_DTUagqgU.js → Button_es_X1DzVhok.js} +2 -2
  5. package/dist/ChipsGroup_cjs_5xsEchPo.js +314 -0
  6. package/dist/ChipsGroup_es_4TOkv-fm.js +309 -0
  7. package/dist/{DatePicker_cjs_Bx5_lZNT.js → DatePicker_cjs_DffhgUnQ.js} +4 -4
  8. package/dist/{DatePicker_es_A1FcasHs.js → DatePicker_es_GmkagjKf.js} +4 -4
  9. package/dist/{DropdownItem_cjs_tH2DBClp.js → DropdownItem_cjs_DxBpJAi9.js} +1 -1
  10. package/dist/{DropdownItem_es_BeVv-pDA.js → DropdownItem_es_Loneq6M7.js} +1 -1
  11. package/dist/{Input_cjs_arr_wxD2.js → Input_cjs_CPmXkQGd.js} +1 -0
  12. package/dist/{Input_es_BW6cZThr.js → Input_es_D9Y1Rj5Y.js} +1 -0
  13. package/dist/{Label_cjs_CP4b6Mg2.js → Label_cjs_C88e2CIP.js} +49 -49
  14. package/dist/{Label_es_DFSiy5sL.js → Label_es_Bn2aRjLl.js} +49 -49
  15. package/dist/{Loader_cjs_CCrbD8Em.js → Loader_cjs_Ca4i0sER.js} +4 -2
  16. package/dist/{Loader_es_B2auu_rc.js → Loader_es_GYOr0UTX.js} +4 -2
  17. package/dist/{Tooltip_cjs_DinScDnC.js → Tooltip_cjs_oS1iOamX.js} +4 -2
  18. package/dist/{Tooltip_es_B0nm9irO.js → Tooltip_es_LV5ZNg3B.js} +4 -2
  19. package/dist/cjs/components/Accordion.js +1 -1
  20. package/dist/cjs/components/Avatar.js +2 -2
  21. package/dist/cjs/components/AvatarStack.js +2 -2
  22. package/dist/cjs/components/Badge.js +1 -1
  23. package/dist/cjs/components/Breadcrumbs/stories/__mock__.js +13 -6
  24. package/dist/cjs/components/Breadcrumbs.js +17 -18
  25. package/dist/cjs/components/Button.js +3 -3
  26. package/dist/cjs/components/Cell.js +2 -2
  27. package/dist/cjs/components/Chips/stories/__mock__.js +31 -0
  28. package/dist/cjs/components/Chips.js +4 -4
  29. package/dist/cjs/components/Choice/stories/__mock__.js +15 -15
  30. package/dist/cjs/components/Choice.js +7 -7
  31. package/dist/cjs/components/CookiesWarning.js +3 -3
  32. package/dist/cjs/components/Dadata.js +1 -1
  33. package/dist/cjs/components/DatePeriod.js +7 -7
  34. package/dist/cjs/components/DatePicker.js +6 -6
  35. package/dist/cjs/components/Drawer.js +1 -1
  36. package/dist/cjs/components/Dropdown/stories/__mock__.js +3 -2
  37. package/dist/cjs/components/Dropdown.js +2 -2
  38. package/dist/cjs/components/HeroTitle.js +1 -1
  39. package/dist/cjs/components/Icon.js +1 -1
  40. package/dist/cjs/components/Input.js +1 -1
  41. package/dist/cjs/components/InputPassword.js +1 -1
  42. package/dist/cjs/components/Label.js +2 -2
  43. package/dist/cjs/components/Loader.js +1 -1
  44. package/dist/cjs/components/MenuItem.js +12 -5
  45. package/dist/cjs/components/Modal.js +2 -2
  46. package/dist/cjs/components/Notification.js +1 -1
  47. package/dist/cjs/components/Pagination.js +2 -4
  48. package/dist/cjs/components/Response.js +3 -3
  49. package/dist/cjs/components/ScrollOnDrag.js +5 -3
  50. package/dist/cjs/components/Search.js +1 -1
  51. package/dist/cjs/components/Segmented/stories/__mock__.js +24 -9
  52. package/dist/cjs/components/Segmented.js +80 -51
  53. package/dist/cjs/components/Select.js +1 -1
  54. package/dist/cjs/components/Swiper.js +1 -1
  55. package/dist/cjs/components/Tab.js +1 -1
  56. package/dist/cjs/components/Textarea.js +8 -9
  57. package/dist/cjs/components/Tile.js +1 -1
  58. package/dist/cjs/components/Title.js +1 -1
  59. package/dist/cjs/components/Tooltip.js +1 -1
  60. package/dist/cjs/hooks/useStyles/styleAttributes.js +1 -1
  61. package/dist/components/Accordion.js +1 -1
  62. package/dist/components/Avatar.js +2 -2
  63. package/dist/components/AvatarStack.js +2 -2
  64. package/dist/components/Badge.js +1 -1
  65. package/dist/components/Breadcrumbs/stories/__mock__.js +13 -7
  66. package/dist/components/Breadcrumbs.js +17 -18
  67. package/dist/components/Button.js +3 -3
  68. package/dist/components/Cell.js +2 -2
  69. package/dist/components/Chips/stories/__mock__.js +29 -0
  70. package/dist/components/Chips.js +4 -4
  71. package/dist/components/Choice/stories/__mock__.js +15 -15
  72. package/dist/components/Choice.js +7 -7
  73. package/dist/components/CookiesWarning.js +3 -3
  74. package/dist/components/Dadata.js +1 -1
  75. package/dist/components/DatePeriod.js +7 -7
  76. package/dist/components/DatePicker.js +6 -6
  77. package/dist/components/Drawer.js +1 -1
  78. package/dist/components/Dropdown/stories/__mock__.js +3 -2
  79. package/dist/components/Dropdown.js +2 -2
  80. package/dist/components/HeroTitle.js +1 -1
  81. package/dist/components/Icon.js +1 -1
  82. package/dist/components/Input.js +1 -1
  83. package/dist/components/InputPassword.js +1 -1
  84. package/dist/components/Label.js +2 -2
  85. package/dist/components/Loader.js +1 -1
  86. package/dist/components/MenuItem.js +12 -5
  87. package/dist/components/Modal.js +2 -2
  88. package/dist/components/Notification.js +1 -1
  89. package/dist/components/Pagination.js +3 -5
  90. package/dist/components/Response.js +3 -3
  91. package/dist/components/ScrollOnDrag.js +7 -5
  92. package/dist/components/Search.js +1 -1
  93. package/dist/components/Segmented/stories/__mock__.js +23 -11
  94. package/dist/components/Segmented.js +80 -51
  95. package/dist/components/Select.js +1 -1
  96. package/dist/components/Swiper.js +1 -1
  97. package/dist/components/Tab.js +1 -1
  98. package/dist/components/Textarea.js +8 -9
  99. package/dist/components/Tile.js +1 -1
  100. package/dist/components/Title.js +1 -1
  101. package/dist/components/Tooltip.js +1 -1
  102. package/dist/css/components/Breadcrumbs/Breadcrumbs.css +15 -6
  103. package/dist/css/components/Chips/Chips.css +40 -14
  104. package/dist/css/components/Loader/Loader.css +1 -19
  105. package/dist/css/components/MenuItem/MenuItem.css +22 -30
  106. package/dist/css/components/ScrollOnDrag/ScrollOnDrag.css +230 -4
  107. package/dist/css/components/Segmented/Segmented.css +53 -6
  108. package/dist/css/components/Segmented/css/__item/segmaented__item.css +31 -0
  109. package/dist/css/styles/centering/centering.css +17 -0
  110. package/dist/css/styles/shape-strength/shape-strength.css +6 -0
  111. package/dist/hooks/useStyles/styleAttributes.js +1 -1
  112. package/dist/stories/ChipsOverview.mdx +26 -14
  113. package/dist/stories/ChipsPlayground.mdx +3 -3
  114. package/dist/types/components/Breadcrumbs/appearance/breadcrumbsStyle.d.ts +5 -5
  115. package/dist/types/components/Breadcrumbs/stories/__mock__/index.d.ts +24 -1
  116. package/dist/types/components/Chips/Chips.interface.d.ts +1 -0
  117. package/dist/types/components/Chips/appearance/chipsAccent.d.ts +9 -1
  118. package/dist/types/components/Chips/appearance/chipsDanger.d.ts +16 -1
  119. package/dist/types/components/Chips/appearance/chipsError.d.ts +16 -1
  120. package/dist/types/components/Chips/appearance/chipsInfo.d.ts +16 -1
  121. package/dist/types/components/Chips/appearance/chipsPrimary.d.ts +11 -2
  122. package/dist/types/components/Chips/appearance/chipsSecondary.d.ts +10 -2
  123. package/dist/types/components/Chips/appearance/chipsStyle.d.ts +3 -1
  124. package/dist/types/components/Chips/appearance/chipsSuccess.d.ts +16 -1
  125. package/dist/types/components/Chips/appearance/chipsSurface.d.ts +11 -1
  126. package/dist/types/components/Chips/appearance/chipsWarning.d.ts +16 -1
  127. package/dist/types/components/Chips/stories/__mock__/index.d.ts +14 -0
  128. package/dist/types/components/Choice/appearance/choiceStyle.d.ts +5 -5
  129. package/dist/types/components/Choice/stories/__mock__/index.d.ts +3 -9
  130. package/dist/types/components/Input/appearance/inputDefault.d.ts +1 -0
  131. package/dist/types/components/Label/appearance/labelDisable.d.ts +2 -2
  132. package/dist/types/components/MenuItem/appearance/menuItemSurface.d.ts +5 -0
  133. package/dist/types/components/Segmented/Segmented.interface.d.ts +5 -2
  134. package/dist/types/components/Segmented/appearance/segmentedDefault.d.ts +8 -11
  135. package/dist/types/components/Segmented/appearance/segmentedDisabled.d.ts +9 -11
  136. package/dist/types/components/Segmented/appearance/segmentedError.d.ts +9 -2
  137. package/dist/types/components/Segmented/appearance/segmentedSize.d.ts +5 -0
  138. package/dist/types/components/Segmented/appearance/segmentedStyle.d.ts +5 -3
  139. package/dist/types/components/Segmented/appearance/segmentedSuccess.d.ts +8 -0
  140. package/dist/types/components/Segmented/appearance/segmentedWarning.d.ts +9 -1
  141. package/dist/types/components/Segmented/stories/__mock__/index.d.ts +30 -8
  142. package/dist/types/components/Textarea/appearance/textareaDefault.d.ts +1 -0
  143. package/dist/types/components/Textarea/appearance/textareaStyle.d.ts +4 -4
  144. package/dist/types/context/UIContext.d.ts +3 -5
  145. package/package.json +3 -2
  146. package/dist/ChipsGroup_cjs_j3QOma3U.js +0 -200
  147. package/dist/ChipsGroup_es_DF1fhn97.js +0 -195
@@ -1,200 +0,0 @@
1
- 'use strict';
2
-
3
- var tslib_es6 = require('./tslib.es6_cjs_CCZ3TN_7.js');
4
- var jsxRuntime = require('react/jsx-runtime');
5
- var React = require('react');
6
- var clsx = require('clsx');
7
- var useDevicePropsGenerator = require('./cjs/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
8
- var useStyles = require('./cjs/hooks/useStyles/useStyles.js');
9
- var Tooltip = require('./Tooltip_cjs_DinScDnC.js');
10
- var Text = require('./Text_cjs_C9fOm0nd.js');
11
-
12
- var chipsAppearanceAccent = {
13
- accent: {
14
- fill: 'accentPrimary',
15
- fillHover: 'accentPrimaryHover',
16
- labelTextColor: 'accentTextPrimary',
17
- borderColor: 'accentBorderSecondary',
18
- },
19
- accentPrimary: {
20
- fill: 'accentPrimary',
21
- fillHover: 'accentPrimaryHover',
22
- labelTextColor: 'accentTextPrimary',
23
- borderColor: 'accentBorderSecondary',
24
- },
25
- };
26
-
27
- var chipsAppearanceDanger = {};
28
-
29
- var chipsAppearanceDisabled = {
30
- disabled: {
31
- fill: 'surfaceDisabled',
32
- fillActive: 'surfaceDisabled',
33
- fillHover: 'surfaceDisabled',
34
- labelTextColor: 'surfaceTextDisabled',
35
- labelTextHoverColor: 'surfaceTextDisabled',
36
- borderColor: 'surfaceBorderDisabled',
37
- },
38
- };
39
-
40
- var chipsAppearanceError = {};
41
-
42
- var chipsAppearanceInfo = {};
43
-
44
- var chipsAppearancePrimary = {
45
- primary: {
46
- fill: 'primaryPrimary',
47
- fillHover: 'primaryPrimaryHover',
48
- labelTextColor: 'primaryTextPrimary',
49
- },
50
- };
51
-
52
- var chipsAppearanceSecondary = {
53
- secondary: {
54
- fill: 'secondaryPrimary',
55
- fillHover: 'secondaryPrimaryHover',
56
- labelTextColor: 'secondaryTextPrimary',
57
- borderColor: 'secondaryBorderSecondary',
58
- },
59
- };
60
-
61
- var chipsAppearanceSize = {
62
- sizeXXL: {
63
- size: 'xxl',
64
- labelTextSize: 'xl',
65
- iconAfterSize: 24,
66
- iconBeforeSize: 24,
67
- },
68
- sizeXL: {
69
- size: 'xl',
70
- labelTextSize: 'm',
71
- iconAfterSize: 20,
72
- iconBeforeSize: 20,
73
- },
74
- sizeL: {
75
- size: 'l',
76
- labelTextSize: 'm',
77
- iconAfterSize: 16,
78
- iconBeforeSize: 16,
79
- },
80
- sizeM: {
81
- size: 'm',
82
- labelTextSize: 's',
83
- iconAfterSize: 16,
84
- iconBeforeSize: 16,
85
- },
86
- sizeS: {
87
- size: 's',
88
- labelTextSize: 's',
89
- iconAfterSize: 16,
90
- iconBeforeSize: 16,
91
- },
92
- sizeXS: {
93
- size: 'xs',
94
- labelTextSize: 'xs',
95
- iconAfterSize: 14,
96
- iconBeforeSize: 14,
97
- },
98
- sizeXXS: {
99
- size: 'xxs',
100
- labelTextSize: 'xxs',
101
- iconAfterSize: 12,
102
- iconBeforeSize: 12,
103
- },
104
- };
105
-
106
- var chipsAppearanceStyle = {
107
- solid: {
108
- borderColor: 'none',
109
- },
110
- outlined: {
111
- fill: 'none',
112
- },
113
- full: {},
114
- ghost: {
115
- fill: 'none',
116
- borderColor: 'none',
117
- },
118
- };
119
-
120
- var chipsAppearanceSuccess = {};
121
-
122
- var chipsAppearanceSurface = {
123
- surfacePrimary: {
124
- fill: 'surfacePrimary',
125
- fillActive: 'accentPrimary',
126
- fillActiveHover: 'accentSecondary',
127
- fillHover: 'surfaceHover',
128
- labelTextActiveColor: 'accentTextPrimary',
129
- labelTextColor: 'surfaceTextPrimary',
130
- labelTextHoverColor: 'surfaceTextPrimary',
131
- borderColor: 'surfaceBorderTertiary',
132
- activeIconItemFill: 'surfaceItemSecondary',
133
- iconBeforeFillIcon: 'surfaceItemPrimary',
134
- badgeAppearance: 'surfacePrimary sizeXS solid'
135
- },
136
- surfaceSecondary: {
137
- fill: 'surfaceSecondary',
138
- fillHover: 'surfaceHover',
139
- labelTextColor: 'surfaceTextPrimary',
140
- borderColor: 'surfaceBorderSecondary',
141
- },
142
- surfaceTertiary: {
143
- fill: 'surfaceTertiary',
144
- fillHover: 'surfaceHover',
145
- labelTextColor: 'surfaceTextPrimary',
146
- borderColor: 'surfaceBorderTertiary',
147
- },
148
- };
149
-
150
- var chipsAppearanceWarning = {};
151
-
152
- var chipsAppearance = tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign({}, chipsAppearanceSize), chipsAppearanceStyle), chipsAppearanceAccent), chipsAppearanceDanger), chipsAppearanceError), chipsAppearanceInfo), chipsAppearancePrimary), chipsAppearanceSecondary), chipsAppearanceSuccess), chipsAppearanceSurface), chipsAppearanceWarning), chipsAppearanceDisabled);
153
-
154
- var chipsConfig = {
155
- appearance: chipsAppearance,
156
- setAppearance: function (appearanceConfig) {
157
- chipsConfig.appearance = appearanceConfig;
158
- },
159
- };
160
- function Chips(props) {
161
- var className = props.className, appearance = props.appearance, _a = props.label, label = _a === void 0 ? '' : _a, isDisabled = props.isDisabled, dataTestId = props.dataTestId, dataTour = props.dataTour, iconAfter = props.iconAfter, iconAfterSrc = props.iconAfterSrc, iconBefore = props.iconBefore, iconBeforeSrc = props.iconBeforeSrc, isActive = props.isActive, onClick = props.onClick, children = props.children;
162
- var appearanceConfig = React.useMemo(function () {
163
- if (appearance) {
164
- var appearanceProps = appearance.split(' ').reduce(function (resultConfig, appearanceKey) {
165
- var _a;
166
- return (tslib_es6.__assign(tslib_es6.__assign({}, resultConfig), (_a = chipsConfig.appearance) === null || _a === void 0 ? void 0 : _a[appearanceKey]));
167
- }, {});
168
- if (isDisabled && chipsConfig.appearance.disabled) {
169
- Object.assign(appearanceProps, chipsConfig.appearance.disabled);
170
- }
171
- return appearanceProps;
172
- }
173
- if (isDisabled) {
174
- return chipsConfig.appearance.disabled;
175
- }
176
- return {};
177
- }, [appearance, isDisabled]);
178
- var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
179
- var alignClass = propsGenerator.alignClass, alignDirectionClass = propsGenerator.alignDirectionClass, fillActiveClass = propsGenerator.fillActiveClass, fillActiveHoverClass = propsGenerator.fillActiveHoverClass, fillClass = propsGenerator.fillClass, fillHoverClass = propsGenerator.fillHoverClass, labelTextActiveColor = propsGenerator.labelTextActiveColor, labelTextActiveHoverColor = propsGenerator.labelTextActiveHoverColor, labelTextColor = propsGenerator.labelTextColor, labelTextHoverColor = propsGenerator.labelTextHoverColor, labelTextSize = propsGenerator.labelTextSize, labelTextWeight = propsGenerator.labelTextWeight, labelTextWrap = propsGenerator.labelTextWrap, borderColorClass = propsGenerator.borderColorClass, borderTypeClass = propsGenerator.borderTypeClass, badgeAppearance = propsGenerator.badgeAppearance, badgeShape = propsGenerator.badgeShape, badgeSize = propsGenerator.badgeSize, badgeTextColor = propsGenerator.badgeTextColor, badgeTextSize = propsGenerator.badgeTextSize, badgeValue = propsGenerator.badgeValue, cursorClass = propsGenerator.cursorClass, iconAfterFill = propsGenerator.iconAfterFill, iconAfterFillIcon = propsGenerator.iconAfterFillIcon, iconAfterFillSize = propsGenerator.iconAfterFillSize, iconAfterShape = propsGenerator.iconAfterShape, iconAfterSize = propsGenerator.iconAfterSize, iconBeforeFill = propsGenerator.iconBeforeFill, iconBeforeFillIcon = propsGenerator.iconBeforeFillIcon, iconBeforeFillSize = propsGenerator.iconBeforeFillSize, iconBeforeShape = propsGenerator.iconBeforeShape, iconBeforeSize = propsGenerator.iconBeforeSize, shapeClass = propsGenerator.shapeClass, sizeClass = propsGenerator.sizeClass;
180
- var chipsStyles = useStyles.useStyles(props).styles;
181
- return (jsxRuntime.jsx("div", { className: clsx(className, 'chips', !isActive
182
- ? fillClass && "fill_".concat(fillClass)
183
- : fillActiveClass && "fill_active_".concat(fillActiveClass), !isActive
184
- ? fillHoverClass && "fill_hover_".concat(fillHoverClass)
185
- : fillActiveHoverClass && "fill_active_hover_".concat(fillActiveHoverClass), shapeClass && "chips_shape_".concat(shapeClass), borderColorClass && "border-color_".concat(borderColorClass), borderTypeClass && "border_type_".concat(borderTypeClass), sizeClass && "chips_size_".concat(sizeClass), alignDirectionClass && "align_".concat(alignDirectionClass), alignClass && "align_".concat(alignClass), isActive && 'chips_state_active', isDisabled && "chips_state_disabled", cursorClass && "cursor_".concat(cursorClass), onClick && 'cursor_type_pointer'), "data-testid": dataTestId && "".concat(dataTestId, "Chips"), "data-tour": dataTour, style: chipsStyles, onClick: !isDisabled ? onClick : undefined, children: jsxRuntime.jsxs("div", { className: "chips__inner", children: [(iconBefore || iconBeforeSrc) && (jsxRuntime.jsx(Tooltip.Icon, { className: "chips__icon_before", size: iconBeforeSize, fill: iconBeforeFill, fillSize: iconBeforeFillSize, iconFill: iconBeforeFillIcon, imageSrc: iconBeforeSrc, shape: iconBeforeShape, SvgImage: iconBefore })), typeof label === 'string' ? (jsxRuntime.jsx(Text.Text, { className: "chips__label", size: labelTextSize, textColor: labelTextColor, textColorActive: labelTextActiveColor, textColorActiveHover: labelTextActiveHoverColor, textColorHover: labelTextHoverColor, textWeight: labelTextWeight, textWrap: labelTextWrap, isActive: isActive, children: label })) : (jsxRuntime.jsx("div", { className: "chips__label", children: label })), children, (iconAfter || iconAfterSrc) && (jsxRuntime.jsx(Tooltip.Icon, { className: "chips__icon_after", size: iconAfterSize, fill: iconAfterFill, fillSize: iconAfterFillSize, iconFill: iconAfterFillIcon, imageSrc: iconAfterSrc, shape: iconAfterShape, SvgImage: iconAfter })), badgeValue && (jsxRuntime.jsx(Tooltip.Badge, { className: "chips__badge", appearance: badgeAppearance, size: badgeSize, textColor: badgeTextColor, textSize: badgeTextSize, shape: badgeShape, value: badgeValue }))] }) }));
186
- }
187
-
188
- function ChipsGroup(props) {
189
- var className = props.className, dataTestId = props.dataTestId, dataTour = props.dataTour, horizontalScroll = props.horizontalScroll, style = props.style, set = props.set, children = props.children;
190
- var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props);
191
- var directionClass = propsGenerator.directionClass, alignClass = propsGenerator.alignClass, alignDirectionClass = propsGenerator.alignDirectionClass, fillClass = propsGenerator.fillClass, borderColorClass = propsGenerator.borderColorClass, borderTypeClass = propsGenerator.borderTypeClass, borderWidthClass = propsGenerator.borderWidthClass, contentAlignClass = propsGenerator.contentAlignClass, widthClass = propsGenerator.widthClass, wrapClass = propsGenerator.wrapClass;
192
- // @ts-expect-error
193
- var _a = useStyles.useStyles(props), groupStyles = _a.styles, groupWrapperStyles = _a.wrapper;
194
- return (jsxRuntime.jsx("div", { className: clsx(className, 'chips-group', 'group', widthClass && "width_".concat(widthClass), contentAlignClass && "group_content-align_".concat(contentAlignClass), alignDirectionClass && "align_".concat(alignDirectionClass), directionClass && "group_direction_".concat(directionClass), alignClass && "align_".concat(alignClass), fillClass && "fill_".concat(fillClass), set && "group_set_".concat(set), horizontalScroll && 'group_type_horizontal_scroll', wrapClass && "group_wrap_".concat(wrapClass), borderColorClass && "border-color_".concat(borderColorClass), borderWidthClass && "border-width_".concat(borderWidthClass), borderTypeClass && "border_type_".concat(borderTypeClass)), "data-testid": dataTestId, "data-tour": dataTour, style: Object.assign({}, groupStyles, style), children: horizontalScroll ? (jsxRuntime.jsx("div", { className: "chips-group__wrapper", style: groupWrapperStyles, children: children })) : (children) }));
195
- }
196
-
197
- exports.Chips = Chips;
198
- exports.ChipsGroup = ChipsGroup;
199
- exports.chipsAppearance = chipsAppearance;
200
- exports.chipsConfig = chipsConfig;
@@ -1,195 +0,0 @@
1
- import { _ as __assign } from './tslib.es6_es_Bwu1Cn-t.js';
2
- import { jsx, jsxs } from 'react/jsx-runtime';
3
- import { useMemo } from 'react';
4
- import clsx from 'clsx';
5
- import { useDevicePropsGenerator } from './hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
6
- import { useStyles } from './hooks/useStyles/useStyles.js';
7
- import { I as Icon, B as Badge } from './Tooltip_es_B0nm9irO.js';
8
- import { T as Text } from './Text_es_BfLRfj-5.js';
9
-
10
- var chipsAppearanceAccent = {
11
- accent: {
12
- fill: 'accentPrimary',
13
- fillHover: 'accentPrimaryHover',
14
- labelTextColor: 'accentTextPrimary',
15
- borderColor: 'accentBorderSecondary',
16
- },
17
- accentPrimary: {
18
- fill: 'accentPrimary',
19
- fillHover: 'accentPrimaryHover',
20
- labelTextColor: 'accentTextPrimary',
21
- borderColor: 'accentBorderSecondary',
22
- },
23
- };
24
-
25
- var chipsAppearanceDanger = {};
26
-
27
- var chipsAppearanceDisabled = {
28
- disabled: {
29
- fill: 'surfaceDisabled',
30
- fillActive: 'surfaceDisabled',
31
- fillHover: 'surfaceDisabled',
32
- labelTextColor: 'surfaceTextDisabled',
33
- labelTextHoverColor: 'surfaceTextDisabled',
34
- borderColor: 'surfaceBorderDisabled',
35
- },
36
- };
37
-
38
- var chipsAppearanceError = {};
39
-
40
- var chipsAppearanceInfo = {};
41
-
42
- var chipsAppearancePrimary = {
43
- primary: {
44
- fill: 'primaryPrimary',
45
- fillHover: 'primaryPrimaryHover',
46
- labelTextColor: 'primaryTextPrimary',
47
- },
48
- };
49
-
50
- var chipsAppearanceSecondary = {
51
- secondary: {
52
- fill: 'secondaryPrimary',
53
- fillHover: 'secondaryPrimaryHover',
54
- labelTextColor: 'secondaryTextPrimary',
55
- borderColor: 'secondaryBorderSecondary',
56
- },
57
- };
58
-
59
- var chipsAppearanceSize = {
60
- sizeXXL: {
61
- size: 'xxl',
62
- labelTextSize: 'xl',
63
- iconAfterSize: 24,
64
- iconBeforeSize: 24,
65
- },
66
- sizeXL: {
67
- size: 'xl',
68
- labelTextSize: 'm',
69
- iconAfterSize: 20,
70
- iconBeforeSize: 20,
71
- },
72
- sizeL: {
73
- size: 'l',
74
- labelTextSize: 'm',
75
- iconAfterSize: 16,
76
- iconBeforeSize: 16,
77
- },
78
- sizeM: {
79
- size: 'm',
80
- labelTextSize: 's',
81
- iconAfterSize: 16,
82
- iconBeforeSize: 16,
83
- },
84
- sizeS: {
85
- size: 's',
86
- labelTextSize: 's',
87
- iconAfterSize: 16,
88
- iconBeforeSize: 16,
89
- },
90
- sizeXS: {
91
- size: 'xs',
92
- labelTextSize: 'xs',
93
- iconAfterSize: 14,
94
- iconBeforeSize: 14,
95
- },
96
- sizeXXS: {
97
- size: 'xxs',
98
- labelTextSize: 'xxs',
99
- iconAfterSize: 12,
100
- iconBeforeSize: 12,
101
- },
102
- };
103
-
104
- var chipsAppearanceStyle = {
105
- solid: {
106
- borderColor: 'none',
107
- },
108
- outlined: {
109
- fill: 'none',
110
- },
111
- full: {},
112
- ghost: {
113
- fill: 'none',
114
- borderColor: 'none',
115
- },
116
- };
117
-
118
- var chipsAppearanceSuccess = {};
119
-
120
- var chipsAppearanceSurface = {
121
- surfacePrimary: {
122
- fill: 'surfacePrimary',
123
- fillActive: 'accentPrimary',
124
- fillActiveHover: 'accentSecondary',
125
- fillHover: 'surfaceHover',
126
- labelTextActiveColor: 'accentTextPrimary',
127
- labelTextColor: 'surfaceTextPrimary',
128
- labelTextHoverColor: 'surfaceTextPrimary',
129
- borderColor: 'surfaceBorderTertiary',
130
- activeIconItemFill: 'surfaceItemSecondary',
131
- iconBeforeFillIcon: 'surfaceItemPrimary',
132
- badgeAppearance: 'surfacePrimary sizeXS solid'
133
- },
134
- surfaceSecondary: {
135
- fill: 'surfaceSecondary',
136
- fillHover: 'surfaceHover',
137
- labelTextColor: 'surfaceTextPrimary',
138
- borderColor: 'surfaceBorderSecondary',
139
- },
140
- surfaceTertiary: {
141
- fill: 'surfaceTertiary',
142
- fillHover: 'surfaceHover',
143
- labelTextColor: 'surfaceTextPrimary',
144
- borderColor: 'surfaceBorderTertiary',
145
- },
146
- };
147
-
148
- var chipsAppearanceWarning = {};
149
-
150
- var chipsAppearance = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, chipsAppearanceSize), chipsAppearanceStyle), chipsAppearanceAccent), chipsAppearanceDanger), chipsAppearanceError), chipsAppearanceInfo), chipsAppearancePrimary), chipsAppearanceSecondary), chipsAppearanceSuccess), chipsAppearanceSurface), chipsAppearanceWarning), chipsAppearanceDisabled);
151
-
152
- var chipsConfig = {
153
- appearance: chipsAppearance,
154
- setAppearance: function (appearanceConfig) {
155
- chipsConfig.appearance = appearanceConfig;
156
- },
157
- };
158
- function Chips(props) {
159
- var className = props.className, appearance = props.appearance, _a = props.label, label = _a === void 0 ? '' : _a, isDisabled = props.isDisabled, dataTestId = props.dataTestId, dataTour = props.dataTour, iconAfter = props.iconAfter, iconAfterSrc = props.iconAfterSrc, iconBefore = props.iconBefore, iconBeforeSrc = props.iconBeforeSrc, isActive = props.isActive, onClick = props.onClick, children = props.children;
160
- var appearanceConfig = useMemo(function () {
161
- if (appearance) {
162
- var appearanceProps = appearance.split(' ').reduce(function (resultConfig, appearanceKey) {
163
- var _a;
164
- return (__assign(__assign({}, resultConfig), (_a = chipsConfig.appearance) === null || _a === void 0 ? void 0 : _a[appearanceKey]));
165
- }, {});
166
- if (isDisabled && chipsConfig.appearance.disabled) {
167
- Object.assign(appearanceProps, chipsConfig.appearance.disabled);
168
- }
169
- return appearanceProps;
170
- }
171
- if (isDisabled) {
172
- return chipsConfig.appearance.disabled;
173
- }
174
- return {};
175
- }, [appearance, isDisabled]);
176
- var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
177
- var alignClass = propsGenerator.alignClass, alignDirectionClass = propsGenerator.alignDirectionClass, fillActiveClass = propsGenerator.fillActiveClass, fillActiveHoverClass = propsGenerator.fillActiveHoverClass, fillClass = propsGenerator.fillClass, fillHoverClass = propsGenerator.fillHoverClass, labelTextActiveColor = propsGenerator.labelTextActiveColor, labelTextActiveHoverColor = propsGenerator.labelTextActiveHoverColor, labelTextColor = propsGenerator.labelTextColor, labelTextHoverColor = propsGenerator.labelTextHoverColor, labelTextSize = propsGenerator.labelTextSize, labelTextWeight = propsGenerator.labelTextWeight, labelTextWrap = propsGenerator.labelTextWrap, borderColorClass = propsGenerator.borderColorClass, borderTypeClass = propsGenerator.borderTypeClass, badgeAppearance = propsGenerator.badgeAppearance, badgeShape = propsGenerator.badgeShape, badgeSize = propsGenerator.badgeSize, badgeTextColor = propsGenerator.badgeTextColor, badgeTextSize = propsGenerator.badgeTextSize, badgeValue = propsGenerator.badgeValue, cursorClass = propsGenerator.cursorClass, iconAfterFill = propsGenerator.iconAfterFill, iconAfterFillIcon = propsGenerator.iconAfterFillIcon, iconAfterFillSize = propsGenerator.iconAfterFillSize, iconAfterShape = propsGenerator.iconAfterShape, iconAfterSize = propsGenerator.iconAfterSize, iconBeforeFill = propsGenerator.iconBeforeFill, iconBeforeFillIcon = propsGenerator.iconBeforeFillIcon, iconBeforeFillSize = propsGenerator.iconBeforeFillSize, iconBeforeShape = propsGenerator.iconBeforeShape, iconBeforeSize = propsGenerator.iconBeforeSize, shapeClass = propsGenerator.shapeClass, sizeClass = propsGenerator.sizeClass;
178
- var chipsStyles = useStyles(props).styles;
179
- return (jsx("div", { className: clsx(className, 'chips', !isActive
180
- ? fillClass && "fill_".concat(fillClass)
181
- : fillActiveClass && "fill_active_".concat(fillActiveClass), !isActive
182
- ? fillHoverClass && "fill_hover_".concat(fillHoverClass)
183
- : fillActiveHoverClass && "fill_active_hover_".concat(fillActiveHoverClass), shapeClass && "chips_shape_".concat(shapeClass), borderColorClass && "border-color_".concat(borderColorClass), borderTypeClass && "border_type_".concat(borderTypeClass), sizeClass && "chips_size_".concat(sizeClass), alignDirectionClass && "align_".concat(alignDirectionClass), alignClass && "align_".concat(alignClass), isActive && 'chips_state_active', isDisabled && "chips_state_disabled", cursorClass && "cursor_".concat(cursorClass), onClick && 'cursor_type_pointer'), "data-testid": dataTestId && "".concat(dataTestId, "Chips"), "data-tour": dataTour, style: chipsStyles, onClick: !isDisabled ? onClick : undefined, children: jsxs("div", { className: "chips__inner", children: [(iconBefore || iconBeforeSrc) && (jsx(Icon, { className: "chips__icon_before", size: iconBeforeSize, fill: iconBeforeFill, fillSize: iconBeforeFillSize, iconFill: iconBeforeFillIcon, imageSrc: iconBeforeSrc, shape: iconBeforeShape, SvgImage: iconBefore })), typeof label === 'string' ? (jsx(Text, { className: "chips__label", size: labelTextSize, textColor: labelTextColor, textColorActive: labelTextActiveColor, textColorActiveHover: labelTextActiveHoverColor, textColorHover: labelTextHoverColor, textWeight: labelTextWeight, textWrap: labelTextWrap, isActive: isActive, children: label })) : (jsx("div", { className: "chips__label", children: label })), children, (iconAfter || iconAfterSrc) && (jsx(Icon, { className: "chips__icon_after", size: iconAfterSize, fill: iconAfterFill, fillSize: iconAfterFillSize, iconFill: iconAfterFillIcon, imageSrc: iconAfterSrc, shape: iconAfterShape, SvgImage: iconAfter })), badgeValue && (jsx(Badge, { className: "chips__badge", appearance: badgeAppearance, size: badgeSize, textColor: badgeTextColor, textSize: badgeTextSize, shape: badgeShape, value: badgeValue }))] }) }));
184
- }
185
-
186
- function ChipsGroup(props) {
187
- var className = props.className, dataTestId = props.dataTestId, dataTour = props.dataTour, horizontalScroll = props.horizontalScroll, style = props.style, set = props.set, children = props.children;
188
- var propsGenerator = useDevicePropsGenerator(props);
189
- var directionClass = propsGenerator.directionClass, alignClass = propsGenerator.alignClass, alignDirectionClass = propsGenerator.alignDirectionClass, fillClass = propsGenerator.fillClass, borderColorClass = propsGenerator.borderColorClass, borderTypeClass = propsGenerator.borderTypeClass, borderWidthClass = propsGenerator.borderWidthClass, contentAlignClass = propsGenerator.contentAlignClass, widthClass = propsGenerator.widthClass, wrapClass = propsGenerator.wrapClass;
190
- // @ts-expect-error
191
- var _a = useStyles(props), groupStyles = _a.styles, groupWrapperStyles = _a.wrapper;
192
- return (jsx("div", { className: clsx(className, 'chips-group', 'group', widthClass && "width_".concat(widthClass), contentAlignClass && "group_content-align_".concat(contentAlignClass), alignDirectionClass && "align_".concat(alignDirectionClass), directionClass && "group_direction_".concat(directionClass), alignClass && "align_".concat(alignClass), fillClass && "fill_".concat(fillClass), set && "group_set_".concat(set), horizontalScroll && 'group_type_horizontal_scroll', wrapClass && "group_wrap_".concat(wrapClass), borderColorClass && "border-color_".concat(borderColorClass), borderWidthClass && "border-width_".concat(borderWidthClass), borderTypeClass && "border_type_".concat(borderTypeClass)), "data-testid": dataTestId, "data-tour": dataTour, style: Object.assign({}, groupStyles, style), children: horizontalScroll ? (jsx("div", { className: "chips-group__wrapper", style: groupWrapperStyles, children: children })) : (children) }));
193
- }
194
-
195
- export { Chips as C, chipsAppearance as a, ChipsGroup as b, chipsConfig as c };