@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
@@ -3,6 +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 { I as Icon } from '../Icon_es_BYViOa6l.js';
7
+ import { icons14, icons20, icons24, icons32, icons40 } from '@itcase/icons/default';
6
8
  import 'react';
7
9
  import 'lodash/camelCase';
8
10
  import 'lodash/castArray';
@@ -17,6 +19,11 @@ import '../utils/setViewportProperty.js';
17
19
  import '../hooks.js';
18
20
  import '../hooks/useStyles/styleAttributes.js';
19
21
  import 'lodash/maxBy';
22
+ import 'react-inlinesvg';
23
+ import '../hoc/urlWithAssetPrefix.js';
24
+ import '../context/UrlAssetPrefix.js';
25
+ import '../Link_es_BDAmhIzd.js';
26
+ import '../Text_es_DVNvU0m0.js';
20
27
 
21
28
  const checkmarkAppearanceAccent = {
22
29
  accentPrimary: {
@@ -24,7 +31,7 @@ const checkmarkAppearanceAccent = {
24
31
  fillActive: 'accentPrimary',
25
32
  borderColor: 'accentBorderPrimary',
26
33
  borderWidth: '2',
27
- checkmarkFill: 'accentPrimary',
34
+ checkmarkIconFill: 'accentItemPrimary',
28
35
  },
29
36
  };
30
37
 
@@ -34,31 +41,48 @@ const checkmarkAppearanceDisabled = {
34
41
  fillActive: 'surfaceDisabled',
35
42
  borderColor: 'surfaceBorderDisabled',
36
43
  borderWidth: '2',
37
- checkmarkFill: 'surfaceDisabled',
44
+ checkmarkIconFill: 'surfaceItemDisabled',
45
+ },
46
+ };
47
+
48
+ const checkmarkAppearanceError = {
49
+ errorPrimary: {
50
+ fill: 'extraPrimary',
51
+ fillActive: 'extraActivePrimary',
52
+ borderColor: 'extraBorderTertiary',
53
+ borderWidth: '2',
54
+ checkmarkIconFill: 'extraItemPrimary',
38
55
  },
39
56
  };
40
57
 
41
58
  const checkmarkAppearanceSize = {
42
59
  sizeXXL: {
43
60
  size: 'xxl',
61
+ checkmarkIcon: icons40.General.Check,
44
62
  },
45
63
  sizeXL: {
46
64
  size: 'xl',
65
+ checkmarkIcon: icons40.General.Check,
47
66
  },
48
67
  sizeL: {
49
68
  size: 'l',
69
+ checkmarkIcon: icons32.General.Check,
50
70
  },
51
71
  sizeM: {
52
72
  size: 'm',
73
+ checkmarkIcon: icons24.Form.Check,
53
74
  },
54
75
  sizeS: {
55
76
  size: 's',
77
+ checkmarkIcon: icons24.Form.Check,
56
78
  },
57
79
  sizeXS: {
58
80
  size: 'xs',
81
+ checkmarkIcon: icons20.Form.Check,
59
82
  },
60
83
  sizeXXS: {
61
84
  size: 'xxs',
85
+ checkmarkIcon: icons14.Form.Check,
62
86
  },
63
87
  };
64
88
 
@@ -84,7 +108,7 @@ const checkmarkAppearanceSurface = {
84
108
  borderColor: 'surfaceBorderTertiary',
85
109
  borderColorHover: 'surfaceBorderPrimary',
86
110
  borderWidth: '2',
87
- checkmarkFill: 'surfacePrimary',
111
+ checkmarkIconFill: 'surfaceItemPrimary',
88
112
  },
89
113
  surfaceSecondary: {
90
114
  fill: 'surfaceSecondary',
@@ -93,7 +117,7 @@ const checkmarkAppearanceSurface = {
93
117
  borderColor: 'surfaceBorderTertiary',
94
118
  borderColorHover: 'surfaceBorderPrimary',
95
119
  borderWidth: '2',
96
- checkmarkFill: 'surfacePrimary',
120
+ checkmarkIconFill: 'surfaceItemPrimary',
97
121
  },
98
122
  };
99
123
 
@@ -103,6 +127,7 @@ const checkmarkAppearance = {
103
127
  ...checkmarkAppearanceStyle,
104
128
  ...checkmarkAppearanceSurface,
105
129
  ...checkmarkAppearanceSize,
130
+ ...checkmarkAppearanceError,
106
131
  };
107
132
 
108
133
  const checkmarkConfig = {
@@ -115,7 +140,7 @@ function Checkmark(props) {
115
140
  const { appearance, className, dataTestId, dataTour, isActive, isChecked, isDisabled = false, onClick, } = props;
116
141
  const appearanceConfig = useAppearanceConfig(appearance, checkmarkConfig);
117
142
  const propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
118
- const { fillActiveClass, fillActiveHoverClass, fillClass, fillHoverClass, borderColorActiveClass, borderColorActiveHoverClass, borderColorClass, borderColorHoverClass, borderWidthClass, checkmarkFillClass, sizeClass, } = propsGenerator;
143
+ const { fillActiveClass, fillActiveHoverClass, fillClass, fillHoverClass, borderColorActiveClass, borderColorActiveHoverClass, borderColorClass, borderColorHoverClass, borderWidthClass, checkmarkFill, checkmarkIcon, checkmarkIconFill, checkmarkIconShape, checkmarkIconSize, checkmarkIconSrc, sizeClass, } = propsGenerator;
119
144
  const { styles: checkmarkStyles } = useStyles(props);
120
145
  return (jsx("div", { className: clsx(className, 'checkmark', sizeClass && `checkmark_size_${sizeClass}`, !isChecked || !isActive
121
146
  ? fillClass && `fill_${fillClass}`
@@ -128,7 +153,7 @@ function Checkmark(props) {
128
153
  ? borderColorHoverClass &&
129
154
  `border-color_hover_${borderColorHoverClass}`
130
155
  : borderColorActiveHoverClass &&
131
- `border-color_active_hover_${borderColorActiveHoverClass}`, borderWidthClass && `border-width_${borderWidthClass}`, isDisabled), "data-testid": dataTestId, "data-tour": dataTour, style: checkmarkStyles, onClick: onClick, children: (isChecked || isActive) && (jsx("div", { className: clsx('checkmark__icon', `svg_path_fill_${checkmarkFillClass}`), children: jsx("svg", { width: "32", height: "24", fill: "none", viewBox: "0 0 32 24", xmlns: "http://www.w3.org/2000/svg", children: jsx("path", { fill: checkmarkFillClass, d: "M28.0896 0.706312L11.4967 18.1772L3.9104 10.1895C3.01576 9.24775 1.56549 9.24775 0.670845 10.1895C-0.223615 11.1315 -0.223615 12.6585 0.670845 13.6005L9.87695 23.2936C10.3243 23.7644 10.9105 24 11.4967 24C12.083 24 12.6692 23.7644 13.1165 23.2936L31.3292 4.11744C32.2236 3.17547 32.2236 1.64848 31.3292 0.706504C30.4345 -0.235469 28.9841 -0.235469 28.0896 0.706312Z" }) }) })) }));
156
+ `border-color_active_hover_${borderColorActiveHoverClass}`, borderWidthClass && `border-width_${borderWidthClass}`, isDisabled), "data-testid": dataTestId, "data-tour": dataTour, style: checkmarkStyles, onClick: onClick, children: (isChecked || isActive) && (jsx(Icon, { fill: checkmarkFill, iconFill: checkmarkIconFill, iconSize: checkmarkIconSize, imageSrc: checkmarkIconSrc, shape: checkmarkIconShape, SvgImage: checkmarkIcon })) }));
132
157
  }
133
158
 
134
159
  export { Checkmark, checkmarkAppearance, checkmarkConfig };
@@ -1,4 +1,4 @@
1
- export { C as Chips, a as ChipsGroup, c as chipsAppearance, b as chipsConfig } from '../ChipsGroup_es_C_dgXLfC.js';
1
+ export { C as Chips, a as ChipsGroup, c as chipsAppearance, b as chipsConfig } from '../ChipsGroup_es_CxqwFgoo.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'clsx';
4
4
  import '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
@@ -3,28 +3,27 @@ import { useCallback } from 'react';
3
3
  import clsx from 'clsx';
4
4
  import { DateTime } from 'luxon';
5
5
  import { DATE_PERIOD_INTERVALS } from '@itcase/common';
6
- import { mergeAppearanceKeys } from '../utils/mergeAppearanceKeys.js';
7
- import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
8
- import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
9
- import { a as ChipsGroup, C as Chips } from '../ChipsGroup_es_C_dgXLfC.js';
10
- import { D as DatePickerInput } from '../DatePicker_es_ungoFvip.js';
6
+ import { a as ChipsGroup, C as Chips } from '../ChipsGroup_es_CxqwFgoo.js';
7
+ import { D as DatePickerInput } from '../DatePicker_es_BP0iWHMt.js';
11
8
  import 'react-select';
12
9
  import '../Icon_es_BYViOa6l.js';
13
- import { S as SelectContainer } from '../SelectContainer_es_BQ3-SqL2.js';
10
+ import { S as SelectContainer } from '../SelectContainer_es_kRH4DsEh.js';
11
+ import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
12
+ import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
14
13
  import 'lodash/camelCase';
15
14
  import 'lodash/maxBy';
16
15
  import 'lodash/upperFirst';
17
16
  import '../context/Notifications.js';
18
17
  import '../context/UIContext.js';
19
18
  import '../Group_es_Y1qBBLZU.js';
20
- import 'lodash/castArray';
19
+ import { mergeAppearanceKeys } from '../utils/mergeAppearanceKeys.js';
20
+ import '../hooks/useStyles/useStyles.js';
21
21
  import '../hooks.js';
22
22
  import '../hooks/useStyles/styleAttributes.js';
23
23
  import 'uuid';
24
24
  import '../hooks/useMediaQueries/useMediaQueries.js';
25
25
  import 'react-responsive';
26
26
  import '../utils/setViewportProperty.js';
27
- import '../hooks/useStyles/useStyles.js';
28
27
  import '../Text_es_DVNvU0m0.js';
29
28
  import 'date-fns/locale';
30
29
  import 'react-datepicker';
@@ -40,6 +39,7 @@ import '../hoc/urlWithAssetPrefix.js';
40
39
  import '../context/UrlAssetPrefix.js';
41
40
  import 'react-select/creatable';
42
41
  import '../Divider_es_D2snK_vn.js';
42
+ import 'lodash/castArray';
43
43
 
44
44
  const datePeriodAppearanceShape = {
45
45
  circular: {
@@ -1,9 +1,11 @@
1
- export { D as DatePickerInput, d as datePickerAppearance, a as datePickerConfig } from '../DatePicker_es_ungoFvip.js';
1
+ export { D as DatePickerInput, d as datePickerAppearance, a as datePickerConfig } from '../DatePicker_es_BP0iWHMt.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
4
4
  import 'clsx';
5
5
  import 'date-fns/locale';
6
6
  import 'react-datepicker';
7
+ import '../Button_es_Dk6_9N-r.js';
8
+ import '../utils/mergeAppearanceKeys.js';
7
9
  import '../hooks/useAppearanceConfig/useAppearanceConfig.js';
8
10
  import '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
9
11
  import 'lodash/camelCase';
@@ -18,11 +20,9 @@ import 'react-responsive';
18
20
  import '../utils/setViewportProperty.js';
19
21
  import '../hooks.js';
20
22
  import '../hooks/useStyles/styleAttributes.js';
23
+ import '../hooks/useHoldProgress.js';
21
24
  import '../hooks/useStyles/useStyles.js';
22
25
  import 'lodash/maxBy';
23
- import '../Button_es_Dk6_9N-r.js';
24
- import '../utils/mergeAppearanceKeys.js';
25
- import '../hooks/useHoldProgress.js';
26
26
  import '../Icon_es_BYViOa6l.js';
27
27
  import 'react-inlinesvg';
28
28
  import '../hoc/urlWithAssetPrefix.js';
@@ -2,14 +2,15 @@ import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { useRef, useState, useEffect } from 'react';
3
3
  import clsx from 'clsx';
4
4
  import ReactDrawer from 'react-modern-drawer';
5
- import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
6
- import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
7
5
  import { D as Divider } from '../Divider_es_D2snK_vn.js';
8
6
  import { I as Icon, b as Title } from '../Icon_es_BYViOa6l.js';
9
7
  import { T as Text } from '../Text_es_DVNvU0m0.js';
8
+ import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
9
+ import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
10
10
  import { icons24 } from '@itcase/icons/default';
11
+ import '../hooks/useStyles/useStyles.js';
11
12
  import 'lodash/camelCase';
12
- import 'lodash/castArray';
13
+ import 'lodash/maxBy';
13
14
  import 'lodash/upperFirst';
14
15
  import '../context/Notifications.js';
15
16
  import 'uuid';
@@ -20,12 +21,11 @@ import 'react-responsive';
20
21
  import '../utils/setViewportProperty.js';
21
22
  import '../hooks.js';
22
23
  import '../hooks/useStyles/styleAttributes.js';
23
- import '../hooks/useStyles/useStyles.js';
24
- import 'lodash/maxBy';
25
24
  import 'react-inlinesvg';
26
25
  import '../hoc/urlWithAssetPrefix.js';
27
26
  import '../context/UrlAssetPrefix.js';
28
27
  import '../Link_es_BDAmhIzd.js';
28
+ import 'lodash/castArray';
29
29
 
30
30
  const drawerAppearanceSize = {
31
31
  sizeH3: {
@@ -72,51 +72,50 @@ const drawerConfig = {
72
72
  },
73
73
  };
74
74
  function Drawer(props) {
75
- const { appearance, className, dataTestId, dataTour, type, title, desc, enableOverlay, lockBackgroundScroll = true, stickyButton, before, after, close, isOpen, isOpenModal, onClickClose, onClose, children, } = props;
76
- const _onClickClose = onClickClose ?? onClose;
77
- const _isOpen = isOpen ?? isOpenModal;
78
- const isOpenPrevRef = useRef(Boolean(_isOpen));
75
+ const { appearance, className, dataTestId, dataTour, type, title, desc, enableOverlay, lockBackgroundScroll = true, stickyButton, before, after, close, isOpen = false, isOpenModal, onClickClose, onClose, children, } = props;
76
+ const isOpenPrevRef = useRef(isOpen);
79
77
  const isFirstRenderRef = useRef(true);
80
78
  const appearanceConfig = useAppearanceConfig(appearance, drawerConfig);
81
79
  const propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
82
80
  const { direction, size, titleTextColor, titleTextSize, titleTextWeight, descTextColor, descTextSize, divider, dividerSize, zeroPadding, closeIcon, closeIconFill, closeIconFillIcon, closeIconFillSize, closeIconShape, closeIconSize, closeIconSrc, } = propsGenerator;
83
- const [animationState, setAnimationState] = useState(_isOpen
81
+ const [animationState, setAnimationState] = useState(isOpen
84
82
  ? ANIMATION_STATE_SNAPSHOTS.ENTER_FINISH
85
83
  : ANIMATION_STATE_SNAPSHOTS.EXIT_FINISH);
86
84
  useEffect(() => {
87
- const isFromOpenToClose = isOpenPrevRef.current === true && !_isOpen;
88
- if (isFromOpenToClose && onClose) {
89
- onClose();
90
- }
91
- isOpenPrevRef.current = Boolean(_isOpen);
85
+ /* TODO: Remove error after some time */
92
86
  const isNeedShowWarning = process.env.NODE_ENV === 'development' &&
93
87
  typeof isOpenModal !== 'undefined';
94
88
  if (isNeedShowWarning) {
95
- console.warn('@itcase/ui Drawer warning: "isOpenModal" is deprecated, use "isOpen" instead.');
89
+ throw new Error('@itcase/ui Drawer warning: "isOpenModal" is deprecated, use "isOpen" instead.');
96
90
  }
97
- // eslint-disable-next-line react-hooks/exhaustive-deps
98
- }, [_isOpen, onClose]);
99
- useEffect(() => {
100
91
  if (isFirstRenderRef.current) {
101
92
  isFirstRenderRef.current = false;
102
93
  return;
103
94
  }
95
+ const isPrevStateOpen = Boolean(isOpenPrevRef.current) === true;
96
+ const isNewStateClose = Boolean(isOpen) === false;
97
+ if (isPrevStateOpen && isNewStateClose && onClose) {
98
+ onClose();
99
+ }
100
+ isOpenPrevRef.current = isOpen;
104
101
  setAnimationState(ANIMATION_STATE_SNAPSHOTS.DEFAULT);
105
102
  const startTransitionDelay = 16;
106
- const timeoutDelay = _isOpen ? startTransitionDelay : ANIMATION_DURATION;
103
+ const timeoutDelay = isOpen ? startTransitionDelay : ANIMATION_DURATION;
107
104
  const timeout = setTimeout(() => {
108
- setAnimationState(_isOpen
105
+ const newAnimationState = isOpen
109
106
  ? ANIMATION_STATE_SNAPSHOTS.ENTER_FINISH
110
- : ANIMATION_STATE_SNAPSHOTS.EXIT_FINISH);
107
+ : ANIMATION_STATE_SNAPSHOTS.EXIT_FINISH;
108
+ setAnimationState(newAnimationState);
111
109
  }, timeoutDelay);
112
110
  return () => {
113
111
  clearTimeout(timeout);
114
112
  };
115
- }, [_isOpen]);
113
+ // eslint-disable-next-line react-hooks/exhaustive-deps
114
+ }, [isOpen]);
116
115
  if (!animationState.isInDOM) {
117
116
  return null;
118
117
  }
119
- return (jsxs(ReactDrawer, { className: clsx('drawer', type && `drawer_type_${type}`, className, dataTour && `dataTour-${dataTour}`, stickyButton && 'drawer_sticky-button', zeroPadding && 'drawer_reset-padding'), direction: direction || 'right', size: size || 600, customIdSuffix: dataTestId ? `_${dataTestId}` : undefined, "data-testid": dataTestId, "data-tour": dataTour, duration: ANIMATION_DURATION, enableOverlay: enableOverlay, lockBackgroundScroll: lockBackgroundScroll, overlayClassName: "drawer__overlay", open: animationState.isOpen, 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, onClick: _onClickClose }) })), (title || desc) && (jsxs("div", { className: "drawer__header", children: [jsx(Title, { className: "drawer__header-title", size: titleTextSize, textColor: titleTextColor, textWeight: titleTextWeight, children: title }), jsx(Text, { className: "drawer__header-desc", size: descTextSize, textColor: descTextColor, children: desc })] })), divider && (jsx(Divider, { width: "fill", size: dividerSize, fill: "surfaceTertiary" })), children && jsx("div", { className: "drawer__wrapper", children: children }), after && jsx("div", { className: "drawer__after", children: after })] }));
118
+ return (jsxs(ReactDrawer, { className: clsx('drawer', type && `drawer_type_${type}`, className, dataTour && `dataTour-${dataTour}`, stickyButton && 'drawer_sticky-button', zeroPadding && 'drawer_reset-padding'), direction: direction || 'right', size: size || 600, customIdSuffix: dataTestId ? `_${dataTestId}` : undefined, "data-testid": dataTestId, "data-tour": dataTour, duration: ANIMATION_DURATION, enableOverlay: enableOverlay, lockBackgroundScroll: lockBackgroundScroll, overlayClassName: "drawer__overlay", open: animationState.isOpen, 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, onClick: onClickClose }) })), (title || desc) && (jsxs("div", { className: "drawer__header", children: [jsx(Title, { className: "drawer__header-title", size: titleTextSize, textColor: titleTextColor, textWeight: titleTextWeight, children: title }), jsx(Text, { className: "drawer__header-desc", size: descTextSize, textColor: descTextColor, children: desc })] })), divider && (jsx(Divider, { width: "fill", size: dividerSize, fill: "surfaceTertiary" })), children && jsx("div", { className: "drawer__wrapper", children: children }), after && jsx("div", { className: "drawer__after", children: after })] }));
120
119
  }
121
120
 
122
121
  export { Drawer, drawerAppearance, drawerConfig };
@@ -1,4 +1,4 @@
1
- export { I as Image } from '../Image_es_Ca7UQOkj.js';
1
+ export { I as Image } from '../Image_es_DpOCNWpn.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
4
4
  import 'clsx';
@@ -231,7 +231,7 @@ function InputPassword(props) {
231
231
  return isRevealed ? 'text' : 'password';
232
232
  }, [isRevealed]);
233
233
  const onClickIconReveal = useCallback((event) => {
234
- event.preventDefault();
234
+ event?.preventDefault();
235
235
  setIsRevealed((prev) => !prev);
236
236
  }, []);
237
237
  const appearanceConfig = useAppearanceConfig(appearance, inputPasswordConfig, isDisabled);
@@ -18,12 +18,12 @@ const SelectDefaultMock = {
18
18
  }]
19
19
  }, {
20
20
  label: 'Томат',
21
- isDisabled: true,
22
- value: '2'
21
+ value: '2',
22
+ isDisabled: true
23
23
  }, {
24
24
  label: 'Томат красный',
25
- isDisabled: true,
26
- value: '3'
25
+ value: '3',
26
+ isDisabled: true
27
27
  }, {
28
28
  label: 'Томат среднеплодный (круглый)',
29
29
  value: '4',
@@ -1,9 +1,10 @@
1
- export { S as Select, a as SelectClearIndicator, b as SelectControl, c as SelectDropdownIndicator, d as SelectGroupHeading, e as SelectIndicatorsContainer, f as SelectInput, g as SelectMenu, h as SelectMultiValueContainer, i as SelectMultiValueLabel, j as SelectMultiValueRemove, k as SelectOption, l as SelectPlaceholder, m as SelectSingleValue, n as SelectValueContainer, s as selectConfig } from '../SelectContainer_es_BQ3-SqL2.js';
1
+ export { S as Select, a as SelectClearIndicator, b as SelectControl, c as SelectDropdownIndicator, d as SelectGroupHeading, e as SelectIndicatorsContainer, f as SelectInput, g as SelectMenu, h as SelectMultiValueContainer, i as SelectMultiValueLabel, j as SelectMultiValueRemove, k as SelectOption, l as SelectPlaceholder, m as SelectSingleValue, n as SelectValueContainer, s as selectConfig } from '../SelectContainer_es_kRH4DsEh.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
4
4
  import 'clsx';
5
5
  import 'react-select';
6
6
  import 'react-select/creatable';
7
+ import '../Group_es_Y1qBBLZU.js';
7
8
  import '../hooks/useAppearanceConfig/useAppearanceConfig.js';
8
9
  import '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
9
10
  import 'lodash/camelCase';
@@ -18,7 +19,6 @@ import 'react-responsive';
18
19
  import '../utils/setViewportProperty.js';
19
20
  import '../hooks.js';
20
21
  import '../hooks/useStyles/styleAttributes.js';
21
- import '../Group_es_Y1qBBLZU.js';
22
22
  import '../hooks/useStyles/useStyles.js';
23
23
  import 'lodash/maxBy';
24
24
  import '../Text_es_DVNvU0m0.js';
@@ -1,5 +1,6 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import clsx from 'clsx';
3
+ import { mergeAppearanceKeys } from '../utils/mergeAppearanceKeys.js';
3
4
  import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
4
5
  import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
5
6
  import { useStyles } from '../hooks/useStyles/useStyles.js';
@@ -168,7 +169,7 @@ function Tile(props) {
168
169
  const propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
169
170
  const { directionClass, alignClass, alignDirectionClass, fillClass, titleTextAlign, titleTextColor, titleTextSize, titleTextWeight, titleTextWrap, descTextColor, descTextSize, descTextWrap, borderColorClass, borderColorHoverClass, borderTypeClass, borderWidthClass, badgeAppearance, badgeAppearanceSize, badgeShape, badgeSize, badgeTextColor, badgeTextSize, icon, iconAppearance, iconFill, iconFillIcon, iconFillSize, iconShape, iconSize, iconSrc, shapeClass, shapeStrengthClass, sizeClass, widthClass, } = propsGenerator;
170
171
  const { styles: tileStyles } = useStyles(props);
171
- return (jsx("div", { className: clsx('tile', className, fillClass && `fill_${fillClass}`, shapeClass && `shape_${shapeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`, alignClass && `align_${alignClass}`, directionClass && `direction_${directionClass}`, borderColorClass && `border-color_${borderColorClass}`, borderColorHoverClass && `border-color_hover_${borderColorHoverClass}`, borderWidthClass && `border-width_${borderWidthClass}`, borderTypeClass && `border_type_${borderTypeClass}`, sizeClass && `tile_size_${sizeClass}`, type && `tile_type_${type}`, badgeValue && `tile_state_badge`, widthClass && `width_${widthClass}`, isSkeleton && `tile_skeleton`), "data-testid": dataTestId, "data-tour": dataTour, style: tileStyles, onClick: onClick, children: jsxs("div", { className: clsx('tile__wrapper', alignClass, alignDirectionClass), children: [before, jsxs("div", { className: "tile__header", children: [jsxs("div", { className: "tile__header-inner", children: [title && (jsx(Title, { className: "tile__title", size: titleTextSize, textAlign: titleTextAlign, textColor: titleTextColor, textWeight: titleTextWeight, textWrap: titleTextWrap, children: title })), desc && (jsx(Text, { className: "tile__text", size: descTextSize, textColor: descTextColor, textWrap: descTextWrap, children: desc }))] }), jsxs("div", { className: "tile__header-actions", children: [badgeValue && (jsx(Badge, { appearance: `${badgeAppearance} ${badgeAppearanceSize}`, className: "tile__badge", size: badgeSize, textColor: badgeTextColor, textSize: badgeTextSize, shape: badgeShape, value: badgeValue })), (icon || iconSrc) && (jsx(Icon, { appearance: iconAppearance, className: "tile__icon", fill: iconFill, fillSize: iconFillSize, iconFill: iconFillIcon, iconSize: iconSize, imageSrc: iconSrc, shape: iconShape, SvgImage: icon, onClick: iconClick }))] })] }), children, after] }) }));
172
+ return (jsx("div", { className: clsx('tile', className, fillClass && `fill_${fillClass}`, shapeClass && `shape_${shapeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`, alignClass && `align_${alignClass}`, directionClass && `direction_${directionClass}`, borderColorClass && `border-color_${borderColorClass}`, borderColorHoverClass && `border-color_hover_${borderColorHoverClass}`, borderWidthClass && `border-width_${borderWidthClass}`, borderTypeClass && `border_type_${borderTypeClass}`, sizeClass && `tile_size_${sizeClass}`, type && `tile_type_${type}`, badgeValue && `tile_state_badge`, widthClass && `width_${widthClass}`, isSkeleton && `tile_skeleton`), "data-testid": dataTestId, "data-tour": dataTour, style: tileStyles, onClick: onClick, children: jsxs("div", { className: clsx('tile__wrapper', alignClass, alignDirectionClass), children: [before, jsxs("div", { className: "tile__header", children: [jsxs("div", { className: "tile__header-inner", children: [title && (jsx(Title, { className: "tile__title", size: titleTextSize, textAlign: titleTextAlign, textColor: titleTextColor, textWeight: titleTextWeight, textWrap: titleTextWrap, children: title })), desc && (jsx(Text, { className: "tile__text", size: descTextSize, textColor: descTextColor, textWrap: descTextWrap, children: desc }))] }), jsxs("div", { className: "tile__header-actions", children: [badgeValue && (jsx(Badge, { appearance: mergeAppearanceKeys(badgeAppearance, badgeAppearanceSize), className: "tile__badge", size: badgeSize, textColor: badgeTextColor, textSize: badgeTextSize, shape: badgeShape, value: badgeValue })), (icon || iconSrc) && (jsx(Icon, { appearance: iconAppearance, className: "tile__icon", fill: iconFill, fillSize: iconFillSize, iconFill: iconFillIcon, iconSize: iconSize, imageSrc: iconSrc, shape: iconShape, SvgImage: icon, onClick: iconClick }))] })] }), children, after] }) }));
172
173
  }
173
174
 
174
175
  export { Tile, tileAppearance, tileConfig };
@@ -142,7 +142,7 @@ function createNotification(notification, onClose) {
142
142
  let after = null;
143
143
  let isLoading = false;
144
144
  let closeIconAppearance = '';
145
- let onClickButton = null;
145
+ let onClickButton = () => { };
146
146
  if (typeof notification === 'string') {
147
147
  text = notification;
148
148
  }
@@ -11,6 +11,8 @@ const UserDeviceContext = createContext({
11
11
  isTablet: false,
12
12
  isDesktop: false,
13
13
  deviceCurrentMainType: '',
14
+ deviceCurrentType: '',
15
+ deviceTypesList: [],
14
16
  });
15
17
  const UIProvider = memo(function UIProvider(props) {
16
18
  const { userDeviceState = {}, children } = props;
@@ -61,7 +63,11 @@ const UIProvider = memo(function UIProvider(props) {
61
63
  return (jsx(UserDeviceContext.Provider, { value: deviceContextState, children: children }));
62
64
  });
63
65
  function useUserDeviceContext() {
64
- return useContext(UserDeviceContext);
66
+ const context = useContext(UserDeviceContext);
67
+ if (!context) {
68
+ throw new Error('useUserDeviceContext is not defined');
69
+ }
70
+ return context;
65
71
  }
66
72
 
67
73
  export { UIProvider, useUserDeviceContext };