@itcase/ui 1.8.72 → 1.8.74

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 (49) hide show
  1. package/dist/{DatePicker_cjs_C5Scs-GL.js → DatePicker_cjs_DPe3TnXs.js} +1 -1
  2. package/dist/{DatePicker_es_Cn7l4eD0.js → DatePicker_es_DIFs7Wgs.js} +1 -1
  3. package/dist/Group_cjs_GqR99U0L.js +59 -0
  4. package/dist/Group_es_Bo7Y6JwT.js +55 -0
  5. package/dist/{Input_cjs_BGLd0EQu.js → Input_cjs_DSpBwtPv.js} +28 -3
  6. package/dist/{Input_es_D2mNCqiH.js → Input_es_3C_YhQFo.js} +28 -3
  7. package/dist/cjs/components/Avatar.js +1 -1
  8. package/dist/cjs/components/AvatarStack.js +2 -2
  9. package/dist/cjs/components/Checkmark.js +9 -0
  10. package/dist/cjs/components/Dadata.js +1 -1
  11. package/dist/cjs/components/DatePeriod.js +2 -2
  12. package/dist/cjs/components/DatePicker.js +2 -2
  13. package/dist/cjs/components/Drawer/stories/__mock__.js +10 -0
  14. package/dist/cjs/components/Drawer.js +2 -2
  15. package/dist/cjs/components/Group.js +1 -1
  16. package/dist/cjs/components/Input.js +1 -1
  17. package/dist/cjs/components/Radio.js +33 -8
  18. package/dist/cjs/components/Response.js +1 -1
  19. package/dist/cjs/components/Select.js +1 -1
  20. package/dist/cjs/components/Switch.js +6 -16
  21. package/dist/cjs/components/Textarea.js +28 -3
  22. package/dist/components/Avatar.js +1 -1
  23. package/dist/components/AvatarStack.js +2 -2
  24. package/dist/components/Checkmark.js +9 -0
  25. package/dist/components/Dadata.js +1 -1
  26. package/dist/components/DatePeriod.js +2 -2
  27. package/dist/components/DatePicker.js +2 -2
  28. package/dist/components/Drawer/stories/__mock__.js +8 -0
  29. package/dist/components/Drawer.js +2 -2
  30. package/dist/components/Group.js +1 -1
  31. package/dist/components/Input.js +1 -1
  32. package/dist/components/Radio.js +33 -8
  33. package/dist/components/Response.js +1 -1
  34. package/dist/components/Select.js +1 -1
  35. package/dist/components/Switch.js +6 -16
  36. package/dist/components/Textarea.js +28 -3
  37. package/dist/css/components/Input/Input.css +0 -4
  38. package/dist/css/components/Textarea/Textarea.css +0 -4
  39. package/dist/types/components/Avatar/appearance/avatarShape.d.ts +2 -2
  40. package/dist/types/components/Checkmark/appearance/checkmarkSurface.d.ts +9 -0
  41. package/dist/types/components/Input/appearance/inputShape.d.ts +25 -0
  42. package/dist/types/components/Radio/Radio.appearance.d.ts +22 -0
  43. package/dist/types/components/Radio/appearance/radioShape.d.ts +25 -0
  44. package/dist/types/components/Textarea/appearance/textareaShape.d.ts +25 -0
  45. package/package.json +5 -5
  46. package/dist/Group_cjs_D4QLNgcC.js +0 -50
  47. package/dist/Group_es_CruwH8Al.js +0 -46
  48. package/dist/{Avatar_cjs_CUv4th9V.js → Avatar_cjs_BHvgPTAY.js} +4 -4
  49. package/dist/{Avatar_es_CZbxsfMv.js → Avatar_es_DnqQ0yn6.js} +4 -4
@@ -3,8 +3,8 @@ import clsx from 'clsx';
3
3
  import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
4
4
  import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
5
5
  import { useStyles } from '../hooks/useStyles/useStyles.js';
6
- import { A as Avatar } from '../Avatar_es_CZbxsfMv.js';
7
- import { G as Group } from '../Group_es_CruwH8Al.js';
6
+ import { A as Avatar } from '../Avatar_es_DnqQ0yn6.js';
7
+ import { G as Group } from '../Group_es_Bo7Y6JwT.js';
8
8
  import { T as Text } from '../Text_es_BvmOR4nv.js';
9
9
  import { _ as __assign } from '../tslib.es6_es_Bwu1Cn-t.js';
10
10
  import 'react';
@@ -87,6 +87,15 @@ var checkmarkAppearanceSurface = {
87
87
  borderWidth: '2',
88
88
  checkmarkFill: 'surfaceItemPrimary',
89
89
  },
90
+ surfaceSecondary: {
91
+ fill: 'surfaceSecondary',
92
+ fillActive: 'surfacePrimary',
93
+ fillHover: 'surfaceHover',
94
+ borderColor: 'surfaceBorderTertiary',
95
+ borderColorHover: 'surfaceBorderPrimary',
96
+ borderWidth: '2',
97
+ checkmarkFill: 'surfaceItemPrimary',
98
+ },
90
99
  };
91
100
 
92
101
  var checkmarkAppearance = __assign(__assign(__assign(__assign(__assign({}, checkmarkAppearanceAccent), checkmarkAppearanceDisabled), checkmarkAppearanceStyle), checkmarkAppearanceSurface), checkmarkAppearanceSize);
@@ -3,7 +3,7 @@ import { jsx } from 'react/jsx-runtime';
3
3
  import { useMemo } from 'react';
4
4
  import clsx from 'clsx';
5
5
  import { PartySuggestions } from 'react-dadata';
6
- import { I as Input } from '../Input_es_D2mNCqiH.js';
6
+ import { I as Input } from '../Input_es_3C_YhQFo.js';
7
7
  import '../hooks/useAppearanceConfig/useAppearanceConfig.js';
8
8
  import '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
9
9
  import 'lodash/camelCase';
@@ -2,7 +2,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { useCallback } from 'react';
3
3
  import clsx from 'clsx';
4
4
  import { DATE_PERIOD_INTERVALS } from '@itcase/common';
5
- import { D as DatePickerInput } from '../DatePicker_es_Cn7l4eD0.js';
5
+ import { D as DatePickerInput } from '../DatePicker_es_DIFs7Wgs.js';
6
6
  import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
7
7
  import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
8
8
  import { b as ChipsGroup, C as Chips } from '../ChipsGroup_es_CSRBUuRU.js';
@@ -28,7 +28,7 @@ import '../context/UrlAssetPrefix.js';
28
28
  import '../Link_es_BnUIX0QT.js';
29
29
  import '../Text_es_BvmOR4nv.js';
30
30
  import '../Loader_es_DhNCKZ8Y.js';
31
- import '../Input_es_D2mNCqiH.js';
31
+ import '../Input_es_3C_YhQFo.js';
32
32
  import '../Label_es_DnTcY7ih.js';
33
33
  import '@itcase/icons/default';
34
34
  import 'lodash/castArray';
@@ -1,4 +1,4 @@
1
- export { D as DatePickerInput, a as datePickerAppearance, d as datePickerConfig } from '../DatePicker_es_Cn7l4eD0.js';
1
+ export { D as DatePickerInput, a as datePickerAppearance, d as datePickerConfig } from '../DatePicker_es_DIFs7Wgs.js';
2
2
  import '../tslib.es6_es_Bwu1Cn-t.js';
3
3
  import 'react/jsx-runtime';
4
4
  import 'react';
@@ -28,6 +28,6 @@ import '../context/UrlAssetPrefix.js';
28
28
  import '../Link_es_BnUIX0QT.js';
29
29
  import '../Text_es_BvmOR4nv.js';
30
30
  import '../Loader_es_DhNCKZ8Y.js';
31
- import '../Input_es_D2mNCqiH.js';
31
+ import '../Input_es_3C_YhQFo.js';
32
32
  import '../Label_es_DnTcY7ih.js';
33
33
  import '@itcase/icons/default';
@@ -0,0 +1,8 @@
1
+ const DrawerMock = {
2
+ appearance: 'surfacePrimary',
3
+ isOpenModal: true,
4
+ title: 'Title 123',
5
+ desc: 'Text 123'
6
+ };
7
+
8
+ export { DrawerMock };
@@ -70,7 +70,7 @@ function Drawer(props) {
70
70
  var prevIsOpenModalRef = useRef(null);
71
71
  var appearanceConfig = useAppearanceConfig(appearance, drawerConfig);
72
72
  var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
73
- var direction = propsGenerator.direction, size = propsGenerator.size, titleTextColor = propsGenerator.titleTextColor, titleTextSize = propsGenerator.titleTextSize, descTextColor = propsGenerator.descTextColor, descTextSize = propsGenerator.descTextSize, zeroPadding = propsGenerator.zeroPadding, closeIcon = propsGenerator.closeIcon, closeIconFill = propsGenerator.closeIconFill, closeIconFillIcon = propsGenerator.closeIconFillIcon, closeIconFillSize = propsGenerator.closeIconFillSize, closeIconShape = propsGenerator.closeIconShape, closeIconSize = propsGenerator.closeIconSize, closeIconSrc = propsGenerator.closeIconSrc;
73
+ var direction = propsGenerator.direction, size = propsGenerator.size, titleTextColor = propsGenerator.titleTextColor, titleTextSize = propsGenerator.titleTextSize, descTextColor = propsGenerator.descTextColor, descTextSize = propsGenerator.descTextSize, divider = propsGenerator.divider, zeroPadding = propsGenerator.zeroPadding, closeIcon = propsGenerator.closeIcon, closeIconFill = propsGenerator.closeIconFill, closeIconFillIcon = propsGenerator.closeIconFillIcon, closeIconFillSize = propsGenerator.closeIconFillSize, closeIconShape = propsGenerator.closeIconShape, closeIconSize = propsGenerator.closeIconSize, closeIconSrc = propsGenerator.closeIconSrc;
74
74
  useEffect(function () {
75
75
  if (onClose && prevIsOpenModalRef.current === true && !isOpenModal) {
76
76
  onClose();
@@ -79,7 +79,7 @@ function Drawer(props) {
79
79
  }, [isOpenModal, onClose]);
80
80
  return (jsxs(ReactDrawer, { className: clsx('drawer', type && "drawer_type_".concat(type), className, dataTour && "dataTour-".concat(dataTour), stickyButton && 'drawer_sticky-button', zeroPadding && 'drawer_reset-padding'), direction: direction || 'right', size: size || 600,
81
81
  // Drawer set prefix "EZDrawer" for any id
82
- customIdSuffix: dataTestId ? "_".concat(dataTestId) : undefined, dataTour: dataTour, enableOverlay: enableOverlay, lockBackgroundScroll: false, overlayClassName: "drawer__overlay", open: isOpenModal, onClose: onClickClose, children: [before && jsx("div", { className: "drawer__before", children: before }), !close && (closeIcon || closeIconSrc) && (jsx("div", { className: "drawer__close", children: jsx(Icon, { className: "cursor_type_pointer", fill: closeIconFill, fillSize: closeIconFillSize, iconFill: closeIconFillIcon, iconSize: closeIconSize, imageSrc: closeIconSrc, shape: closeIconShape, SvgImage: closeIcon }) })), (title || desc) && (jsxs("div", { className: "drawer__header", children: [jsx(Title, { className: "drawer__header-title", size: titleTextSize, textColor: titleTextColor, children: title }), jsx(Text, { className: "drawer__header-desc", size: descTextSize, textColor: descTextColor, children: desc })] })), children && jsx("div", { className: "drawer__wrapper", children: children }), after && jsx("div", { className: "drawer__after", children: after })] }));
82
+ customIdSuffix: dataTestId ? "_".concat(dataTestId) : undefined, dataTour: dataTour, enableOverlay: enableOverlay, lockBackgroundScroll: false, overlayClassName: "drawer__overlay", open: isOpenModal, onClose: onClickClose, children: [before && jsx("div", { className: "drawer__before", children: before }), !close && (closeIcon || closeIconSrc) && (jsx("div", { className: "drawer__close", children: jsx(Icon, { className: "cursor_type_pointer", fill: closeIconFill, fillSize: closeIconFillSize, iconFill: closeIconFillIcon, iconSize: closeIconSize, imageSrc: closeIconSrc, shape: closeIconShape, SvgImage: closeIcon }) })), (title || desc) && (jsxs("div", { className: "drawer__header", children: [jsx(Title, { className: "drawer__header-title", size: titleTextSize, textColor: titleTextColor, children: title }), jsx(Text, { className: "drawer__header-desc", size: descTextSize, textColor: descTextColor, children: desc })] })), divider && jsx(Divider, { width: "fill", fill: "surfaceTertiary" }), children && jsx("div", { className: "drawer__wrapper", children: children }), after && jsx("div", { className: "drawer__after", children: after })] }));
83
83
  }
84
84
 
85
85
  export { Drawer, drawerAppearance, drawerConfig };
@@ -1,4 +1,4 @@
1
- export { G as Group, a as groupAppearance, g as groupConfig } from '../Group_es_CruwH8Al.js';
1
+ export { G as Group, a as groupAppearance, g as groupConfig } from '../Group_es_Bo7Y6JwT.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
4
4
  import 'clsx';
@@ -1,4 +1,4 @@
1
- export { I as Input, a as inputAppearance, i as inputConfig } from '../Input_es_D2mNCqiH.js';
1
+ export { I as Input, a as inputAppearance, i as inputConfig } from '../Input_es_3C_YhQFo.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
4
4
  import 'clsx';
@@ -67,6 +67,31 @@ var radioAppearanceRequire = {
67
67
  },
68
68
  };
69
69
 
70
+ var radioAppearanceShape = {
71
+ circular: {
72
+ shape: 'circular',
73
+ },
74
+ rounded: {
75
+ shape: 'rounded',
76
+ },
77
+ roundedS: {
78
+ shape: 'rounded',
79
+ shapeStrength: '0_5m',
80
+ },
81
+ roundedM: {
82
+ shape: 'rounded',
83
+ shapeStrength: '1m',
84
+ },
85
+ roundedL: {
86
+ shape: 'rounded',
87
+ shapeStrength: '1_5m',
88
+ },
89
+ roundedXL: {
90
+ shape: 'rounded',
91
+ shapeStrength: '2m',
92
+ },
93
+ };
94
+
70
95
  var radioAppearanceSize = {
71
96
  sizeM: {
72
97
  size: 'm',
@@ -111,7 +136,7 @@ var radioAppearanceSuccess = {
111
136
  },
112
137
  };
113
138
 
114
- var radioAppearance = __assign(__assign(__assign(__assign(__assign(__assign(__assign({}, radioAppearanceDefault), radioAppearanceError), radioAppearanceSuccess), radioAppearanceRequire), radioAppearanceDisabled), radioAppearanceSize), radioAppearanceStyle);
139
+ var radioAppearance = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, radioAppearanceDefault), radioAppearanceError), radioAppearanceSuccess), radioAppearanceRequire), radioAppearanceDisabled), radioAppearanceSize), radioAppearanceShape), radioAppearanceStyle);
115
140
 
116
141
  var radioConfig = {
117
142
  appearance: radioAppearance,
@@ -120,23 +145,23 @@ var radioConfig = {
120
145
  },
121
146
  };
122
147
  function Radio(props) {
123
- var id = props.id, className = props.className, appearance = props.appearance, label = props.label, desc = props.desc, isDisabled = props.isDisabled, checked = props.checked, _a = props.tag, Tag = _a === void 0 ? 'label' : _a, isSkeleton = props.isSkeleton, onChange = props.onChange;
148
+ var id = props.id, className = props.className, appearance = props.appearance, label = props.label, desc = props.desc, isDisabled = props.isDisabled, checked = props.checked, _a = props.tag, Tag = _a === void 0 ? 'label' : _a, isActive = props.isActive, isSkeleton = props.isSkeleton, onChange = props.onChange;
124
149
  var appearanceConfig = useAppearanceConfig(appearance, radioConfig);
125
150
  var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
126
- var fillCheckmarkClass = propsGenerator.fillCheckmarkClass, fillClass = propsGenerator.fillClass, fillRadioActiveClass = propsGenerator.fillRadioActiveClass, fillRadioActiveHoverClass = propsGenerator.fillRadioActiveHoverClass, fillRadioClass = propsGenerator.fillRadioClass, fillRadioHoverClass = propsGenerator.fillRadioHoverClass, labelTextColor = propsGenerator.labelTextColor, labelTextSize = propsGenerator.labelTextSize, labelTextWeight = propsGenerator.labelTextWeight, descTextColor = propsGenerator.descTextColor, descTextSize = propsGenerator.descTextSize, descTextWeight = propsGenerator.descTextWeight, borderColorClass = propsGenerator.borderColorClass, borderColorRadioActiveClass = propsGenerator.borderColorRadioActiveClass, borderColorRadioActiveHoverClass = propsGenerator.borderColorRadioActiveHoverClass, borderColorRadioClass = propsGenerator.borderColorRadioClass, borderColorRadioHoverClass = propsGenerator.borderColorRadioHoverClass, _b = propsGenerator.shapeClass, shapeClass = _b === void 0 ? 'circular' : _b, sizeClass = propsGenerator.sizeClass;
127
- return (jsxs(Tag, { className: clsx(className, 'radio', fillClass && "fill_".concat(fillClass), borderColorClass && "border-color_".concat(borderColorClass), isSkeleton && 'radio_skeleton', sizeClass && "radio_size_".concat(sizeClass)), htmlFor: id, children: [jsxs("div", { className: "radio__item", children: [jsx("input", { id: id, className: "radio__input", type: "radio", disabled: isDisabled && 'disabled', checked: checked, onChange: onChange }), jsx("div", { className: clsx('radio__state', !checked
151
+ var fillCheckmarkClass = propsGenerator.fillCheckmarkClass, fillClass = propsGenerator.fillClass, fillRadioActiveClass = propsGenerator.fillRadioActiveClass, fillRadioActiveHoverClass = propsGenerator.fillRadioActiveHoverClass, fillRadioClass = propsGenerator.fillRadioClass, fillRadioHoverClass = propsGenerator.fillRadioHoverClass, labelTextColor = propsGenerator.labelTextColor, labelTextSize = propsGenerator.labelTextSize, labelTextWeight = propsGenerator.labelTextWeight, descTextColor = propsGenerator.descTextColor, descTextSize = propsGenerator.descTextSize, descTextWeight = propsGenerator.descTextWeight, borderColorClass = propsGenerator.borderColorClass, borderColorRadioActiveClass = propsGenerator.borderColorRadioActiveClass, borderColorRadioActiveHoverClass = propsGenerator.borderColorRadioActiveHoverClass, borderColorRadioClass = propsGenerator.borderColorRadioClass, borderColorRadioHoverClass = propsGenerator.borderColorRadioHoverClass, shapeClass = propsGenerator.shapeClass, shapeStrengthClass = propsGenerator.shapeStrengthClass, sizeClass = propsGenerator.sizeClass;
152
+ return (jsxs(Tag, { className: clsx(className, 'radio', fillClass && "fill_".concat(fillClass), borderColorClass && "border-color_".concat(borderColorClass), isSkeleton && 'radio_skeleton', sizeClass && "radio_size_".concat(sizeClass)), htmlFor: id, children: [jsxs("div", { className: "radio__item", children: [jsx("input", { id: id, className: "radio__input", type: "radio", disabled: isDisabled && 'disabled', checked: checked, onChange: onChange }), jsx("div", { className: clsx('radio__state', !checked || !isActive
128
153
  ? fillRadioClass && "fill_".concat(fillRadioClass)
129
- : fillRadioActiveClass && "fill_active_".concat(fillRadioActiveClass), !checked
154
+ : fillRadioActiveClass && "fill_active_".concat(fillRadioActiveClass), !checked || !isActive
130
155
  ? fillRadioHoverClass && "fill_hover_".concat(fillRadioHoverClass)
131
156
  : fillRadioActiveHoverClass &&
132
- "fill_active_hover_".concat(fillRadioActiveHoverClass), !checked
157
+ "fill_active_hover_".concat(fillRadioActiveHoverClass), !checked || !isActive
133
158
  ? borderColorRadioClass && "border-color_".concat(borderColorRadioClass)
134
159
  : borderColorRadioActiveClass &&
135
- "border-color_active_".concat(borderColorRadioActiveClass), !checked
160
+ "border-color_active_".concat(borderColorRadioActiveClass), !checked || !isActive
136
161
  ? borderColorRadioHoverClass &&
137
162
  "border-color_hover_".concat(borderColorRadioHoverClass)
138
163
  : borderColorRadioActiveHoverClass &&
139
- "border-color_active_hover_".concat(borderColorRadioActiveHoverClass), shapeClass && "shape_".concat(shapeClass)), children: "\u00A0" }), jsx("div", { className: clsx('radio__state-checkmark', checked && fillCheckmarkClass && "fill_".concat(fillCheckmarkClass)), children: "\u00A0" })] }), label && (jsx(Text, { className: "radio__label", size: labelTextSize, textColor: labelTextColor, textWeight: labelTextWeight, children: label })), desc && (jsx(Text, { className: "radio__desc", size: descTextSize, textColor: descTextColor, textWeight: descTextWeight, children: desc }))] }));
164
+ "border-color_active_hover_".concat(borderColorRadioActiveHoverClass), shapeClass && "shape_".concat(shapeClass), shapeStrengthClass && "shape-strength_".concat(shapeStrengthClass)), children: "\u00A0" }), jsx("div", { className: clsx('radio__state-checkmark', checked && fillCheckmarkClass && "fill_".concat(fillCheckmarkClass)), children: "\u00A0" })] }), label && (jsx(Text, { className: "radio__label", size: labelTextSize, textColor: labelTextColor, textWeight: labelTextWeight, children: label })), desc && (jsx(Text, { className: "radio__desc", size: descTextSize, textColor: descTextColor, textWeight: descTextWeight, children: desc }))] }));
140
165
  }
141
166
 
142
167
  export { Radio, radioAppearance, radioConfig };
@@ -8,7 +8,7 @@ import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceC
8
8
  import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
9
9
  import { useStyles } from '../hooks/useStyles/useStyles.js';
10
10
  import { B as Button } from '../Button_es_3cCwdJcQ.js';
11
- import { G as Group } from '../Group_es_CruwH8Al.js';
11
+ import { G as Group } from '../Group_es_Bo7Y6JwT.js';
12
12
  import { T as Text } from '../Text_es_BvmOR4nv.js';
13
13
  import '@itcase/common';
14
14
  import '../context/UrlAssetPrefix.js';
@@ -8,7 +8,7 @@ import CreatableSelect from 'react-select/creatable';
8
8
  import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
9
9
  import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
10
10
  import { T as Text } from '../Text_es_BvmOR4nv.js';
11
- import { G as Group } from '../Group_es_CruwH8Al.js';
11
+ import { G as Group } from '../Group_es_Bo7Y6JwT.js';
12
12
  import { D as Divider } from '../Divider_es_CiRU0sTz.js';
13
13
  import 'react-inlinesvg';
14
14
  import '../hoc/urlWithAssetPrefix.js';
@@ -117,30 +117,20 @@ var switchConfig = {
117
117
  },
118
118
  };
119
119
  var Switch = React.forwardRef(function Switch(props, ref) {
120
- var id = props.id, className = props.className, appearance = props.appearance, _a = props.align, align = _a === void 0 ? 'left' : _a, title = props.title, desc = props.desc, disabled = props.disabled, checked = props.checked, isActive = props.isActive, onChange = props.onChange;
120
+ var id = props.id, className = props.className, appearance = props.appearance, _a = props.align, align = _a === void 0 ? 'left' : _a, title = props.title, desc = props.desc, isDisabled = props.isDisabled, isChecked = props.isChecked, isActive = props.isActive, onChange = props.onChange;
121
121
  var appearanceConfig = useAppearanceConfig(appearance, switchConfig);
122
122
  var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
123
123
  var size = propsGenerator.size, fillActiveClass = propsGenerator.fillActiveClass, fillActiveHoverClass = propsGenerator.fillActiveHoverClass, fillClass = propsGenerator.fillClass, fillHoverClass = propsGenerator.fillHoverClass, fillToggleActiveClass = propsGenerator.fillToggleActiveClass, fillToggleActiveHoverClass = propsGenerator.fillToggleActiveHoverClass, fillToggleClass = propsGenerator.fillToggleClass, fillToggleHoverClass = propsGenerator.fillToggleHoverClass, titleTextColor = propsGenerator.titleTextColor, titleTextSize = propsGenerator.titleTextSize, descTextColor = propsGenerator.descTextColor, descTextSize = propsGenerator.descTextSize;
124
- return (jsxs("div", { className: clsx('switch', className, align && "switch_align_".concat(align), size && "switch_size_".concat(size)), children: [title && (jsx(Text, { className: clsx('switch__title'), size: titleTextSize, textColor: titleTextColor, children: title })), desc && (jsx(Text, { className: clsx('switch__desc'), size: descTextSize, textColor: descTextColor, children: desc })), jsxs("div", { className: 'switch__item', children: [jsx("input", { id: id, className: "switch__checkbox", type: "checkbox", disabled: disabled, checked: checked || isActive,
124
+ return (jsxs("div", { className: clsx('switch', className, align && "switch_align_".concat(align), size && "switch_size_".concat(size)), children: [title && (jsx(Text, { className: clsx('switch__title'), size: titleTextSize, textColor: titleTextColor, children: title })), desc && (jsx(Text, { className: clsx('switch__desc'), size: descTextSize, textColor: descTextColor, children: desc })), jsxs("div", { className: 'switch__item', children: [jsx("input", { id: id, className: "switch__checkbox", type: "checkbox", disabled: isDisabled && 'disabled', checked: (isActive || isChecked) && 'checked',
125
125
  // @ts-expect-error
126
- ref: ref, onChange: onChange }), jsx("div", { className: clsx('switch__bg', !checked
126
+ ref: ref, onChange: onChange }), jsx("div", { className: clsx('switch__bg', !isActive || !isChecked
127
127
  ? fillClass && "fill_".concat(fillClass)
128
- : fillActiveClass && "fill_active_".concat(fillActiveClass), !checked
128
+ : fillActiveClass && "fill_active_".concat(fillActiveClass), !isActive || !isChecked
129
129
  ? fillHoverClass && "fill_hover_".concat(fillHoverClass)
130
130
  : fillActiveHoverClass &&
131
- "fill_active_hover_".concat(fillActiveHoverClass), !isActive
132
- ? fillClass && "fill_".concat(fillClass)
133
- : fillActiveClass && "fill_active_".concat(fillActiveClass), !isActive
134
- ? fillHoverClass && "fill_hover_".concat(fillHoverClass)
135
- : fillActiveHoverClass &&
136
- "fill_active_hover_".concat(fillActiveHoverClass)), children: "\u00A0" }), jsx("div", { className: clsx('switch__toggle', !checked
137
- ? fillToggleClass && "fill_".concat(fillToggleClass)
138
- : fillToggleActiveClass && "fill_active_".concat(fillToggleActiveClass), !checked
139
- ? fillToggleHoverClass && "fill_hover_".concat(fillToggleHoverClass)
140
- : fillToggleActiveHoverClass &&
141
- "fill_active_hover_".concat(fillToggleActiveHoverClass), !isActive
131
+ "fill_active_hover_".concat(fillActiveHoverClass)), children: "\u00A0" }), jsx("div", { className: clsx('switch__toggle', !isActive || !isChecked
142
132
  ? fillToggleClass && "fill_".concat(fillToggleClass)
143
- : fillToggleActiveClass && "fill_active_".concat(fillToggleActiveClass), !isActive
133
+ : fillToggleActiveClass && "fill_active_".concat(fillToggleActiveClass), !isActive || !isChecked
144
134
  ? fillToggleHoverClass && "fill_hover_".concat(fillToggleHoverClass)
145
135
  : fillToggleActiveHoverClass &&
146
136
  "fill_active_hover_".concat(fillToggleActiveHoverClass)), children: "\u00A0" })] })] }));
@@ -110,6 +110,31 @@ var textareaAppearanceRequire = {
110
110
  },
111
111
  };
112
112
 
113
+ var textareaAppearanceShape = {
114
+ circular: {
115
+ shape: 'circular',
116
+ },
117
+ rounded: {
118
+ shape: 'rounded',
119
+ },
120
+ roundedS: {
121
+ shape: 'rounded',
122
+ shapeStrength: '0_5m',
123
+ },
124
+ roundedM: {
125
+ shape: 'rounded',
126
+ shapeStrength: '1m',
127
+ },
128
+ roundedL: {
129
+ shape: 'rounded',
130
+ shapeStrength: '1_5m',
131
+ },
132
+ roundedXL: {
133
+ shape: 'rounded',
134
+ shapeStrength: '2m',
135
+ },
136
+ };
137
+
113
138
  var textareaAppearanceSize = {
114
139
  sizeXXL: {
115
140
  size: 'xxl',
@@ -175,7 +200,7 @@ var textareaAppearanceSuccess = {
175
200
  },
176
201
  };
177
202
 
178
- var textareaAppearance = __assign(__assign(__assign(__assign(__assign(__assign(__assign({}, textareaAppearanceDefault), textareaAppearanceError), textareaAppearanceSuccess), textareaAppearanceRequire), textareaAppearanceDisabled), textareaAppearanceSize), textareaAppearanceStyle);
203
+ var textareaAppearance = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, textareaAppearanceDefault), textareaAppearanceShape), textareaAppearanceError), textareaAppearanceSuccess), textareaAppearanceRequire), textareaAppearanceDisabled), textareaAppearanceSize), textareaAppearanceStyle);
179
204
 
180
205
  var textareaConfig = {
181
206
  appearance: textareaAppearance,
@@ -187,8 +212,8 @@ function Textarea(props) {
187
212
  var id = props.id, className = props.className, appearance = props.appearance, isDisabled = props.isDisabled, placeholder = props.placeholder, value = props.value, onBlur = props.onBlur, onChange = props.onChange, onKeyDown = props.onKeyDown;
188
213
  var appearanceConfig = useAppearanceConfig(appearance, textareaConfig);
189
214
  var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
190
- var fillClass = propsGenerator.fillClass, borderColorClass = propsGenerator.borderColorClass, borderHoverClass = propsGenerator.borderHoverClass, borderWidthClass = propsGenerator.borderWidthClass, textColorClass = propsGenerator.textColorClass, textSizeClass = propsGenerator.textSizeClass, textWeightClass = propsGenerator.textWeightClass, caretClass = propsGenerator.caretClass, placeholderTextColorClass = propsGenerator.placeholderTextColorClass, shapeClass = propsGenerator.shapeClass, sizeClass = propsGenerator.sizeClass, widthClass = propsGenerator.widthClass;
191
- return (jsx("div", { className: clsx('textarea', className, sizeClass && "textarea_size_".concat(sizeClass), shapeClass && "textarea_shape_".concat(shapeClass)), children: jsx("textarea", { id: id, className: clsx('textarea__input', (textSizeClass || textColorClass || textWeightClass) && 'text', caretClass && "caret-color_".concat(caretClass), fillClass && "fill_".concat(fillClass), borderColorClass && "border-color_".concat(borderColorClass), borderWidthClass && "border-width_".concat(borderWidthClass), borderHoverClass && "border-color_hover_".concat(borderHoverClass), placeholderTextColorClass &&
215
+ var fillClass = propsGenerator.fillClass, borderColorClass = propsGenerator.borderColorClass, borderHoverClass = propsGenerator.borderHoverClass, borderWidthClass = propsGenerator.borderWidthClass, textColorClass = propsGenerator.textColorClass, textSizeClass = propsGenerator.textSizeClass, textWeightClass = propsGenerator.textWeightClass, caretClass = propsGenerator.caretClass, placeholderTextColorClass = propsGenerator.placeholderTextColorClass, shapeClass = propsGenerator.shapeClass, shapeStrengthClass = propsGenerator.shapeStrengthClass, sizeClass = propsGenerator.sizeClass, widthClass = propsGenerator.widthClass;
216
+ return (jsx("div", { className: clsx('textarea', className, sizeClass && "textarea_size_".concat(sizeClass)), children: jsx("textarea", { id: id, className: clsx('textarea__input', (textSizeClass || textColorClass || textWeightClass) && 'text', caretClass && "caret-color_".concat(caretClass), fillClass && "fill_".concat(fillClass), borderColorClass && "border-color_".concat(borderColorClass), borderWidthClass && "border-width_".concat(borderWidthClass), borderHoverClass && "border-color_hover_".concat(borderHoverClass), shapeClass && "shape_".concat(shapeClass), shapeStrengthClass && "shape-strength_".concat(shapeStrengthClass), placeholderTextColorClass &&
192
217
  "placeholder-text-color_".concat(placeholderTextColorClass), textSizeClass && "text_size_".concat(textSizeClass), textColorClass && "text-color_".concat(textColorClass), textWeightClass && "text-weight_".concat(textWeightClass), widthClass && "width_".concat(widthClass)), disabled: isDisabled && 'disabled', placeholder: placeholder, value: value, onBlur: onBlur, onChange: onChange, onKeyDown: onKeyDown }) }));
193
218
  }
194
219
 
@@ -22,10 +22,6 @@
22
22
  }
23
23
  .input {
24
24
  &_shape {
25
- &_rounded {
26
- border-radius: var(--input-shape-rounded);
27
- position: relative;
28
- }
29
25
  &_underline {
30
26
  border-left: none !important;
31
27
  border-top: none !important;
@@ -22,10 +22,6 @@
22
22
  .textarea {
23
23
  &_shape {
24
24
  &^&__input {
25
- &_rounded {
26
- border-radius: var(--textarea-shape-rounded);
27
- position: relative;
28
- }
29
25
  &_underline {
30
26
  border-left: none !important;
31
27
  border-top: none !important;
@@ -5,7 +5,7 @@ declare const avatarAppearanceShape: {
5
5
  rounded: {
6
6
  shape: string;
7
7
  };
8
- roundedL: {
8
+ roundedS: {
9
9
  shape: string;
10
10
  shapeStrength: string;
11
11
  };
@@ -13,7 +13,7 @@ declare const avatarAppearanceShape: {
13
13
  shape: string;
14
14
  shapeStrength: string;
15
15
  };
16
- roundedS: {
16
+ roundedL: {
17
17
  shape: string;
18
18
  shapeStrength: string;
19
19
  };
@@ -8,5 +8,14 @@ declare const checkmarkAppearanceSurface: {
8
8
  borderWidth: string;
9
9
  checkmarkFill: string;
10
10
  };
11
+ surfaceSecondary: {
12
+ fill: string;
13
+ fillActive: string;
14
+ fillHover: string;
15
+ borderColor: string;
16
+ borderColorHover: string;
17
+ borderWidth: string;
18
+ checkmarkFill: string;
19
+ };
11
20
  };
12
21
  export { checkmarkAppearanceSurface };
@@ -0,0 +1,25 @@
1
+ declare const inputAppearanceShape: {
2
+ circular: {
3
+ shape: string;
4
+ };
5
+ rounded: {
6
+ shape: string;
7
+ };
8
+ roundedS: {
9
+ shape: string;
10
+ shapeStrength: string;
11
+ };
12
+ roundedM: {
13
+ shape: string;
14
+ shapeStrength: string;
15
+ };
16
+ roundedL: {
17
+ shape: string;
18
+ shapeStrength: string;
19
+ };
20
+ roundedXL: {
21
+ shape: string;
22
+ shapeStrength: string;
23
+ };
24
+ };
25
+ export { inputAppearanceShape };
@@ -10,6 +10,28 @@ export declare const radioAppearance: {
10
10
  fill: string;
11
11
  borderColor: string;
12
12
  };
13
+ circular: {
14
+ shape: string;
15
+ };
16
+ rounded: {
17
+ shape: string;
18
+ };
19
+ roundedS: {
20
+ shape: string;
21
+ shapeStrength: string;
22
+ };
23
+ roundedM: {
24
+ shape: string;
25
+ shapeStrength: string;
26
+ };
27
+ roundedL: {
28
+ shape: string;
29
+ shapeStrength: string;
30
+ };
31
+ roundedXL: {
32
+ shape: string;
33
+ shapeStrength: string;
34
+ };
13
35
  sizeM: {
14
36
  size: string;
15
37
  labelTextSize: string;
@@ -0,0 +1,25 @@
1
+ declare const radioAppearanceShape: {
2
+ circular: {
3
+ shape: string;
4
+ };
5
+ rounded: {
6
+ shape: string;
7
+ };
8
+ roundedS: {
9
+ shape: string;
10
+ shapeStrength: string;
11
+ };
12
+ roundedM: {
13
+ shape: string;
14
+ shapeStrength: string;
15
+ };
16
+ roundedL: {
17
+ shape: string;
18
+ shapeStrength: string;
19
+ };
20
+ roundedXL: {
21
+ shape: string;
22
+ shapeStrength: string;
23
+ };
24
+ };
25
+ export { radioAppearanceShape };
@@ -0,0 +1,25 @@
1
+ declare const textareaAppearanceShape: {
2
+ circular: {
3
+ shape: string;
4
+ };
5
+ rounded: {
6
+ shape: string;
7
+ };
8
+ roundedS: {
9
+ shape: string;
10
+ shapeStrength: string;
11
+ };
12
+ roundedM: {
13
+ shape: string;
14
+ shapeStrength: string;
15
+ };
16
+ roundedL: {
17
+ shape: string;
18
+ shapeStrength: string;
19
+ };
20
+ roundedXL: {
21
+ shape: string;
22
+ shapeStrength: string;
23
+ };
24
+ };
25
+ export { textareaAppearanceShape };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/ui",
3
- "version": "1.8.72",
3
+ "version": "1.8.74",
4
4
  "description": "UI components (Modal, Loader, Popup, etc)",
5
5
  "keywords": [
6
6
  "Modal",
@@ -103,7 +103,7 @@
103
103
  "@emotion/is-prop-valid": "^1.3.1",
104
104
  "@itcase/common": "^1.2.28",
105
105
  "@itcase/icons": "^1.2.16",
106
- "@itcase/storybook-config": "^1.1.61",
106
+ "@itcase/storybook-config": "^1.1.66",
107
107
  "@itcase/tokens-am": "^1.1.19",
108
108
  "@itcase/tokens-baikal": "^1.1.17",
109
109
  "@itcase/tokens-palette": "^1.1.11",
@@ -143,7 +143,7 @@
143
143
  "@commitlint/cli": "^19.8.1",
144
144
  "@commitlint/config-conventional": "^19.8.1",
145
145
  "@itcase/config": "^1.0.54",
146
- "@itcase/lint": "^1.1.27",
146
+ "@itcase/lint": "^1.1.29",
147
147
  "@itcase/types": "^1.0.6",
148
148
  "@rollup/plugin-alias": "^5.1.1",
149
149
  "@rollup/plugin-babel": "^6.0.4",
@@ -169,12 +169,12 @@
169
169
  "babel-plugin-react-docgen": "^4.2.1",
170
170
  "babel-plugin-transform-react-remove-prop-types": "^0.4.24",
171
171
  "conventional-changelog-conventionalcommits": "^9.1.0",
172
- "eslint": "9.31.0",
172
+ "eslint": "9.32.0",
173
173
  "husky": "^9.1.7",
174
174
  "lint-staged": "^16.1.2",
175
175
  "prettier": "^3.6.2",
176
176
  "react-docgen-typescript": "^2.4.0",
177
- "rollup": "^4.45.1",
177
+ "rollup": "^4.46.0",
178
178
  "rollup-plugin-copy": "^3.5.0",
179
179
  "rollup-plugin-dts": "^6.2.1",
180
180
  "rollup-plugin-peer-deps-external": "^2.2.4",
@@ -1,50 +0,0 @@
1
- 'use strict';
2
-
3
- var jsxRuntime = require('react/jsx-runtime');
4
- var React = require('react');
5
- var clsx = require('clsx');
6
- var useAppearanceConfig = require('./cjs/hooks/useAppearanceConfig/useAppearanceConfig.js');
7
- var useDevicePropsGenerator = require('./cjs/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
8
- var useStyles = require('./cjs/hooks/useStyles/useStyles.js');
9
-
10
- var groupAppearance = {
11
- dev: {
12
- direction: 'horizontal',
13
- fill: 'surfacePrimary',
14
- fillHover: 'surfacePrimaryHover',
15
- borderColor: 'surfaceBorderPrimary',
16
- borderWidth: 1,
17
- },
18
- };
19
-
20
- var groupConfig = {
21
- appearance: groupAppearance,
22
- setAppearance: function (appearanceConfig) {
23
- groupConfig.appearance = appearanceConfig;
24
- },
25
- };
26
- var Group = React.forwardRef(function Group(props, ref) {
27
- var id = props.id, className = props.className, name = props.name, appearance = props.appearance, dataTestId = props.dataTestId, dataTour = props.dataTour, htmlFor = props.htmlFor, scroll = props.scroll, style = props.style, _a = props.tag, Tag = _a === void 0 ? 'div' : _a, isActive = props.isActive, onClick = props.onClick, onMouseDown = props.onMouseDown, children = props.children;
28
- var appearanceConfig = useAppearanceConfig.useAppearanceConfig(appearance, groupConfig);
29
- var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
30
- var directionClass = propsGenerator.directionClass, flexGrowClass = propsGenerator.flexGrowClass, justifyContentClass = propsGenerator.justifyContentClass, alignClass = propsGenerator.alignClass, alignDirectionClass = propsGenerator.alignDirectionClass, fillActiveClass = propsGenerator.fillActiveClass, fillActiveHoverClass = propsGenerator.fillActiveHoverClass, fillClass = propsGenerator.fillClass, fillHoverClass = propsGenerator.fillHoverClass, borderColorActiveClass = propsGenerator.borderColorActiveClass, borderColorActiveHoverClass = propsGenerator.borderColorActiveHoverClass, borderColorClass = propsGenerator.borderColorClass, borderColorHoverClass = propsGenerator.borderColorHoverClass, borderTypeClass = propsGenerator.borderTypeClass, borderWidthClass = propsGenerator.borderWidthClass, textColorActiveClass = propsGenerator.textColorActiveClass, textColorClass = propsGenerator.textColorClass, textColorHoverClass = propsGenerator.textColorHoverClass, columnsClass = propsGenerator.columnsClass, elevationClass = propsGenerator.elevationClass, heightClass = propsGenerator.heightClass, iconFillHoverClass = propsGenerator.iconFillHoverClass, shapeClass = propsGenerator.shapeClass, stackingClass = propsGenerator.stackingClass, widthClass = propsGenerator.widthClass, wrapClass = propsGenerator.wrapClass;
31
- // @ts-expect-error
32
- var groupStyles = useStyles.useStyles(props).styles;
33
- return (jsxRuntime.jsx(Tag, { id: id, dataTestId: dataTestId, dataTour: dataTour, className: clsx(className, 'group', widthClass && "width_".concat(widthClass), heightClass && "height_".concat(heightClass), columnsClass && "group_columns_".concat(columnsClass), alignDirectionClass && "align_".concat(alignDirectionClass), directionClass && "group_direction_".concat(directionClass), alignClass && "align_".concat(alignClass), textColorClass && "group_text-color_".concat(textColorClass), textColorActiveClass &&
34
- "group_text-color_active_".concat(textColorActiveClass), textColorHoverClass && "group_text-color_hover_".concat(textColorHoverClass), iconFillHoverClass && "group_icon_fill_hover_".concat(iconFillHoverClass), !isActive
35
- ? fillClass && "fill_".concat(fillClass)
36
- : fillActiveClass && "fill_active_".concat(fillActiveClass), !isActive
37
- ? fillHoverClass && "fill_hover_".concat(fillHoverClass)
38
- : fillActiveHoverClass && "fill_active_hover_".concat(fillActiveHoverClass), scroll && "group_scroll_".concat(scroll), stackingClass && "group_stacking_".concat(stackingClass), wrapClass && "group_wrap_".concat(wrapClass), flexGrowClass && "flex-grow_".concat(flexGrowClass), shapeClass && "group_shape_".concat(shapeClass), !isActive
39
- ? borderColorClass && "border-color_".concat(borderColorClass)
40
- : borderColorActiveClass &&
41
- "border-color_active_".concat(borderColorActiveClass), !isActive
42
- ? borderColorHoverClass &&
43
- "border-color_hover_".concat(borderColorHoverClass)
44
- : borderColorActiveHoverClass &&
45
- "border-color_active_hover_".concat(borderColorActiveHoverClass), borderWidthClass && "border-width_".concat(borderWidthClass), borderTypeClass && "border_type_".concat(borderTypeClass), elevationClass && "elevation_".concat(elevationClass), justifyContentClass && "justify-content_".concat(justifyContentClass), onClick && 'cursor_type_pointer'), name: name, htmlFor: htmlFor, ref: ref, style: Object.assign({}, groupStyles, style), onClick: onClick, onMouseDown: onMouseDown, children: children }));
46
- });
47
-
48
- exports.Group = Group;
49
- exports.groupAppearance = groupAppearance;
50
- exports.groupConfig = groupConfig;