@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
@@ -4,14 +4,15 @@ var jsxRuntime = require('react/jsx-runtime');
4
4
  var React = require('react');
5
5
  var clsx = require('clsx');
6
6
  var ReactDrawer = require('react-modern-drawer');
7
- var useAppearanceConfig = require('../hooks/useAppearanceConfig/useAppearanceConfig.js');
8
- var useDevicePropsGenerator = require('../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
9
7
  var Divider = require('../../Divider_cjs_C5Ou2Kqa.js');
10
8
  var Icon = require('../../Icon_cjs_CuqEv1jm.js');
11
9
  var Text = require('../../Text_cjs_erTy2pUN.js');
10
+ var useAppearanceConfig = require('../hooks/useAppearanceConfig/useAppearanceConfig.js');
11
+ var useDevicePropsGenerator = require('../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
12
12
  var _default = require('@itcase/icons/default');
13
+ require('../hooks/useStyles/useStyles.js');
13
14
  require('lodash/camelCase');
14
- require('lodash/castArray');
15
+ require('lodash/maxBy');
15
16
  require('lodash/upperFirst');
16
17
  require('../context/Notifications.js');
17
18
  require('uuid');
@@ -22,12 +23,11 @@ require('react-responsive');
22
23
  require('../utils/setViewportProperty.js');
23
24
  require('../hooks.js');
24
25
  require('../hooks/useStyles/styleAttributes.js');
25
- require('../hooks/useStyles/useStyles.js');
26
- require('lodash/maxBy');
27
26
  require('react-inlinesvg');
28
27
  require('../hoc/urlWithAssetPrefix.js');
29
28
  require('../context/UrlAssetPrefix.js');
30
29
  require('../../Link_cjs_Dn7UhCYe.js');
30
+ require('lodash/castArray');
31
31
 
32
32
  const drawerAppearanceSize = {
33
33
  sizeH3: {
@@ -74,51 +74,50 @@ const drawerConfig = {
74
74
  },
75
75
  };
76
76
  function Drawer(props) {
77
- const { appearance, className, dataTestId, dataTour, type, title, desc, enableOverlay, lockBackgroundScroll = true, stickyButton, before, after, close, isOpen, isOpenModal, onClickClose, onClose, children, } = props;
78
- const _onClickClose = onClickClose ?? onClose;
79
- const _isOpen = isOpen ?? isOpenModal;
80
- const isOpenPrevRef = React.useRef(Boolean(_isOpen));
77
+ const { appearance, className, dataTestId, dataTour, type, title, desc, enableOverlay, lockBackgroundScroll = true, stickyButton, before, after, close, isOpen = false, isOpenModal, onClickClose, onClose, children, } = props;
78
+ const isOpenPrevRef = React.useRef(isOpen);
81
79
  const isFirstRenderRef = React.useRef(true);
82
80
  const appearanceConfig = useAppearanceConfig.useAppearanceConfig(appearance, drawerConfig);
83
81
  const propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
84
82
  const { direction, size, titleTextColor, titleTextSize, titleTextWeight, descTextColor, descTextSize, divider, dividerSize, zeroPadding, closeIcon, closeIconFill, closeIconFillIcon, closeIconFillSize, closeIconShape, closeIconSize, closeIconSrc, } = propsGenerator;
85
- const [animationState, setAnimationState] = React.useState(_isOpen
83
+ const [animationState, setAnimationState] = React.useState(isOpen
86
84
  ? ANIMATION_STATE_SNAPSHOTS.ENTER_FINISH
87
85
  : ANIMATION_STATE_SNAPSHOTS.EXIT_FINISH);
88
86
  React.useEffect(() => {
89
- const isFromOpenToClose = isOpenPrevRef.current === true && !_isOpen;
90
- if (isFromOpenToClose && onClose) {
91
- onClose();
92
- }
93
- isOpenPrevRef.current = Boolean(_isOpen);
87
+ /* TODO: Remove error after some time */
94
88
  const isNeedShowWarning = process.env.NODE_ENV === 'development' &&
95
89
  typeof isOpenModal !== 'undefined';
96
90
  if (isNeedShowWarning) {
97
- console.warn('@itcase/ui Drawer warning: "isOpenModal" is deprecated, use "isOpen" instead.');
91
+ throw new Error('@itcase/ui Drawer warning: "isOpenModal" is deprecated, use "isOpen" instead.');
98
92
  }
99
- // eslint-disable-next-line react-hooks/exhaustive-deps
100
- }, [_isOpen, onClose]);
101
- React.useEffect(() => {
102
93
  if (isFirstRenderRef.current) {
103
94
  isFirstRenderRef.current = false;
104
95
  return;
105
96
  }
97
+ const isPrevStateOpen = Boolean(isOpenPrevRef.current) === true;
98
+ const isNewStateClose = Boolean(isOpen) === false;
99
+ if (isPrevStateOpen && isNewStateClose && onClose) {
100
+ onClose();
101
+ }
102
+ isOpenPrevRef.current = isOpen;
106
103
  setAnimationState(ANIMATION_STATE_SNAPSHOTS.DEFAULT);
107
104
  const startTransitionDelay = 16;
108
- const timeoutDelay = _isOpen ? startTransitionDelay : ANIMATION_DURATION;
105
+ const timeoutDelay = isOpen ? startTransitionDelay : ANIMATION_DURATION;
109
106
  const timeout = setTimeout(() => {
110
- setAnimationState(_isOpen
107
+ const newAnimationState = isOpen
111
108
  ? ANIMATION_STATE_SNAPSHOTS.ENTER_FINISH
112
- : ANIMATION_STATE_SNAPSHOTS.EXIT_FINISH);
109
+ : ANIMATION_STATE_SNAPSHOTS.EXIT_FINISH;
110
+ setAnimationState(newAnimationState);
113
111
  }, timeoutDelay);
114
112
  return () => {
115
113
  clearTimeout(timeout);
116
114
  };
117
- }, [_isOpen]);
115
+ // eslint-disable-next-line react-hooks/exhaustive-deps
116
+ }, [isOpen]);
118
117
  if (!animationState.isInDOM) {
119
118
  return null;
120
119
  }
121
- return (jsxRuntime.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 && jsxRuntime.jsx("div", { className: "drawer__before", children: before }), !close && (closeIcon || closeIconSrc) && (jsxRuntime.jsx("div", { className: "drawer__close", children: jsxRuntime.jsx(Icon.Icon, { className: "cursor_type_pointer", fill: closeIconFill, fillSize: closeIconFillSize, iconFill: closeIconFillIcon, iconSize: closeIconSize, imageSrc: closeIconSrc, shape: closeIconShape, SvgImage: closeIcon, onClick: _onClickClose }) })), (title || desc) && (jsxRuntime.jsxs("div", { className: "drawer__header", children: [jsxRuntime.jsx(Icon.Title, { className: "drawer__header-title", size: titleTextSize, textColor: titleTextColor, textWeight: titleTextWeight, children: title }), jsxRuntime.jsx(Text.Text, { className: "drawer__header-desc", size: descTextSize, textColor: descTextColor, children: desc })] })), divider && (jsxRuntime.jsx(Divider.Divider, { width: "fill", size: dividerSize, fill: "surfaceTertiary" })), children && jsxRuntime.jsx("div", { className: "drawer__wrapper", children: children }), after && jsxRuntime.jsx("div", { className: "drawer__after", children: after })] }));
120
+ return (jsxRuntime.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 && jsxRuntime.jsx("div", { className: "drawer__before", children: before }), !close && (closeIcon || closeIconSrc) && (jsxRuntime.jsx("div", { className: "drawer__close", children: jsxRuntime.jsx(Icon.Icon, { className: "cursor_type_pointer", fill: closeIconFill, fillSize: closeIconFillSize, iconFill: closeIconFillIcon, iconSize: closeIconSize, imageSrc: closeIconSrc, shape: closeIconShape, SvgImage: closeIcon, onClick: onClickClose }) })), (title || desc) && (jsxRuntime.jsxs("div", { className: "drawer__header", children: [jsxRuntime.jsx(Icon.Title, { className: "drawer__header-title", size: titleTextSize, textColor: titleTextColor, textWeight: titleTextWeight, children: title }), jsxRuntime.jsx(Text.Text, { className: "drawer__header-desc", size: descTextSize, textColor: descTextColor, children: desc })] })), divider && (jsxRuntime.jsx(Divider.Divider, { width: "fill", size: dividerSize, fill: "surfaceTertiary" })), children && jsxRuntime.jsx("div", { className: "drawer__wrapper", children: children }), after && jsxRuntime.jsx("div", { className: "drawer__after", children: after })] }));
122
121
  }
123
122
 
124
123
  exports.Drawer = Drawer;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var Image = require('../../Image_cjs_C_FMjUjx.js');
3
+ var Image = require('../../Image_cjs_Hvjp2QDB.js');
4
4
  require('react/jsx-runtime');
5
5
  require('react');
6
6
  require('clsx');
@@ -233,7 +233,7 @@ function InputPassword(props) {
233
233
  return isRevealed ? 'text' : 'password';
234
234
  }, [isRevealed]);
235
235
  const onClickIconReveal = React.useCallback((event) => {
236
- event.preventDefault();
236
+ event?.preventDefault();
237
237
  setIsRevealed((prev) => !prev);
238
238
  }, []);
239
239
  const appearanceConfig = useAppearanceConfig.useAppearanceConfig(appearance, inputPasswordConfig, isDisabled);
@@ -20,12 +20,12 @@ const SelectDefaultMock = {
20
20
  }]
21
21
  }, {
22
22
  label: 'Томат',
23
- isDisabled: true,
24
- value: '2'
23
+ value: '2',
24
+ isDisabled: true
25
25
  }, {
26
26
  label: 'Томат красный',
27
- isDisabled: true,
28
- value: '3'
27
+ value: '3',
28
+ isDisabled: true
29
29
  }, {
30
30
  label: 'Томат среднеплодный (круглый)',
31
31
  value: '4',
@@ -1,11 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var SelectContainer = require('../../SelectContainer_cjs_DshFNYWN.js');
3
+ var SelectContainer = require('../../SelectContainer_cjs_qWAMLIkz.js');
4
4
  require('react/jsx-runtime');
5
5
  require('react');
6
6
  require('clsx');
7
7
  require('react-select');
8
8
  require('react-select/creatable');
9
+ require('../../Group_cjs_xCUYKUcc.js');
9
10
  require('../hooks/useAppearanceConfig/useAppearanceConfig.js');
10
11
  require('../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
11
12
  require('lodash/camelCase');
@@ -20,7 +21,6 @@ require('react-responsive');
20
21
  require('../utils/setViewportProperty.js');
21
22
  require('../hooks.js');
22
23
  require('../hooks/useStyles/styleAttributes.js');
23
- require('../../Group_cjs_xCUYKUcc.js');
24
24
  require('../hooks/useStyles/useStyles.js');
25
25
  require('lodash/maxBy');
26
26
  require('../../Text_cjs_erTy2pUN.js');
@@ -2,6 +2,7 @@
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var clsx = require('clsx');
5
+ var mergeAppearanceKeys = require('../utils/mergeAppearanceKeys.js');
5
6
  var useAppearanceConfig = require('../hooks/useAppearanceConfig/useAppearanceConfig.js');
6
7
  var useDevicePropsGenerator = require('../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
7
8
  var useStyles = require('../hooks/useStyles/useStyles.js');
@@ -170,7 +171,7 @@ function Tile(props) {
170
171
  const propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
171
172
  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;
172
173
  const { styles: tileStyles } = useStyles.useStyles(props);
173
- return (jsxRuntime.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: jsxRuntime.jsxs("div", { className: clsx('tile__wrapper', alignClass, alignDirectionClass), children: [before, jsxRuntime.jsxs("div", { className: "tile__header", children: [jsxRuntime.jsxs("div", { className: "tile__header-inner", children: [title && (jsxRuntime.jsx(Icon.Title, { className: "tile__title", size: titleTextSize, textAlign: titleTextAlign, textColor: titleTextColor, textWeight: titleTextWeight, textWrap: titleTextWrap, children: title })), desc && (jsxRuntime.jsx(Text.Text, { className: "tile__text", size: descTextSize, textColor: descTextColor, textWrap: descTextWrap, children: desc }))] }), jsxRuntime.jsxs("div", { className: "tile__header-actions", children: [badgeValue && (jsxRuntime.jsx(Icon.Badge, { appearance: `${badgeAppearance} ${badgeAppearanceSize}`, className: "tile__badge", size: badgeSize, textColor: badgeTextColor, textSize: badgeTextSize, shape: badgeShape, value: badgeValue })), (icon || iconSrc) && (jsxRuntime.jsx(Icon.Icon, { appearance: iconAppearance, className: "tile__icon", fill: iconFill, fillSize: iconFillSize, iconFill: iconFillIcon, iconSize: iconSize, imageSrc: iconSrc, shape: iconShape, SvgImage: icon, onClick: iconClick }))] })] }), children, after] }) }));
174
+ return (jsxRuntime.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: jsxRuntime.jsxs("div", { className: clsx('tile__wrapper', alignClass, alignDirectionClass), children: [before, jsxRuntime.jsxs("div", { className: "tile__header", children: [jsxRuntime.jsxs("div", { className: "tile__header-inner", children: [title && (jsxRuntime.jsx(Icon.Title, { className: "tile__title", size: titleTextSize, textAlign: titleTextAlign, textColor: titleTextColor, textWeight: titleTextWeight, textWrap: titleTextWrap, children: title })), desc && (jsxRuntime.jsx(Text.Text, { className: "tile__text", size: descTextSize, textColor: descTextColor, textWrap: descTextWrap, children: desc }))] }), jsxRuntime.jsxs("div", { className: "tile__header-actions", children: [badgeValue && (jsxRuntime.jsx(Icon.Badge, { appearance: mergeAppearanceKeys.mergeAppearanceKeys(badgeAppearance, badgeAppearanceSize), className: "tile__badge", size: badgeSize, textColor: badgeTextColor, textSize: badgeTextSize, shape: badgeShape, value: badgeValue })), (icon || iconSrc) && (jsxRuntime.jsx(Icon.Icon, { appearance: iconAppearance, className: "tile__icon", fill: iconFill, fillSize: iconFillSize, iconFill: iconFillIcon, iconSize: iconSize, imageSrc: iconSrc, shape: iconShape, SvgImage: icon, onClick: iconClick }))] })] }), children, after] }) }));
174
175
  }
175
176
 
176
177
  exports.Tile = Tile;
@@ -144,7 +144,7 @@ function createNotification(notification, onClose) {
144
144
  let after = null;
145
145
  let isLoading = false;
146
146
  let closeIconAppearance = '';
147
- let onClickButton = null;
147
+ let onClickButton = () => { };
148
148
  if (typeof notification === 'string') {
149
149
  text = notification;
150
150
  }
@@ -13,6 +13,8 @@ const UserDeviceContext = React.createContext({
13
13
  isTablet: false,
14
14
  isDesktop: false,
15
15
  deviceCurrentMainType: '',
16
+ deviceCurrentType: '',
17
+ deviceTypesList: [],
16
18
  });
17
19
  const UIProvider = React.memo(function UIProvider(props) {
18
20
  const { userDeviceState = {}, children } = props;
@@ -63,7 +65,11 @@ const UIProvider = React.memo(function UIProvider(props) {
63
65
  return (jsxRuntime.jsx(UserDeviceContext.Provider, { value: deviceContextState, children: children }));
64
66
  });
65
67
  function useUserDeviceContext() {
66
- return React.useContext(UserDeviceContext);
68
+ const context = React.useContext(UserDeviceContext);
69
+ if (!context) {
70
+ throw new Error('useUserDeviceContext is not defined');
71
+ }
72
+ return context;
67
73
  }
68
74
 
69
75
  exports.UIProvider = UIProvider;
@@ -4,43 +4,43 @@ const CLASS_RULES = {
4
4
  fill: [
5
5
  {
6
6
  key: 'fillClass',
7
- stateFn: ({ isDisabled, isActive }) => !isActive && !isDisabled,
7
+ stateFn: ({ isActive, isDisabled }) => !isActive && !isDisabled,
8
8
  },
9
9
  {
10
10
  key: 'fillHoverClass',
11
- stateFn: ({ isDisabled, isActive }) => !isActive && !isDisabled,
11
+ stateFn: ({ isActive, isDisabled }) => !isActive && !isDisabled,
12
12
  },
13
13
  {
14
14
  key: 'fillActiveClass',
15
- stateFn: ({ isDisabled, isActive }) => Boolean(isActive) && !isDisabled,
15
+ stateFn: ({ isActive, isDisabled }) => Boolean(isActive) && !isDisabled,
16
16
  },
17
17
  {
18
18
  key: 'fillActiveHoverClass',
19
- stateFn: ({ isDisabled, isActive }) => Boolean(isActive) && !isDisabled,
19
+ stateFn: ({ isActive, isDisabled }) => Boolean(isActive) && !isDisabled,
20
20
  },
21
21
  {
22
22
  key: 'fillDisabledClass',
23
- stateFn: ({ isDisabled, isActive }) => !isActive && Boolean(isDisabled),
23
+ stateFn: ({ isActive, isDisabled }) => !isActive && Boolean(isDisabled),
24
24
  },
25
25
  ],
26
26
  borderColor: [
27
27
  {
28
28
  key: 'borderColorClass',
29
- stateFn: ({ isDisabled, isActive }) => !isActive && !isDisabled,
29
+ stateFn: ({ isActive, isDisabled }) => !isActive && !isDisabled,
30
30
  },
31
31
  {
32
32
  key: 'borderColorHoverClass',
33
- stateFn: ({ isDisabled, isActive }) => !isActive && !isDisabled,
33
+ stateFn: ({ isActive, isDisabled }) => !isActive && !isDisabled,
34
34
  },
35
35
  {
36
36
  key: 'borderColorActiveClass',
37
- stateFn: ({ isDisabled, isActive }) => Boolean(isActive) && !isDisabled,
37
+ stateFn: ({ isActive, isDisabled }) => Boolean(isActive) && !isDisabled,
38
38
  },
39
39
  ],
40
40
  textColor: [
41
41
  {
42
42
  key: 'textColorClass',
43
- stateFn: ({ isDisabled, isActive }) => !isActive && !isDisabled,
43
+ stateFn: ({ isActive, isDisabled }) => !isActive && !isDisabled,
44
44
  },
45
45
  ],
46
46
  };
@@ -4,7 +4,7 @@ var clsx = require('clsx');
4
4
  var useActiveClasses_helpers = require('./useActiveClasses.helpers.js');
5
5
 
6
6
  const useActiveClasses = (params) => {
7
- const { isDisabled, propsGenerator, suffixes = [], isActive } = params;
7
+ const { propsGenerator, suffixes = [], isActive, isDisabled } = params;
8
8
  const rootClassesArray = [];
9
9
  Object.entries(useActiveClasses_helpers.CLASS_RULES).forEach(([rulesName, rules]) => {
10
10
  const kebabRuleName = useActiveClasses_helpers.toKebabCase(rulesName);
@@ -14,7 +14,7 @@ const useActiveClasses = (params) => {
14
14
  return;
15
15
  }
16
16
  if (stateFn) {
17
- const active = stateFn({ isDisabled, isActive });
17
+ const active = stateFn({ isActive, isDisabled });
18
18
  if (!active) {
19
19
  return;
20
20
  }
@@ -35,7 +35,7 @@ const useActiveClasses = (params) => {
35
35
  return;
36
36
  }
37
37
  if (stateFn) {
38
- const active = stateFn({ isDisabled, isActive });
38
+ const active = stateFn({ isActive, isDisabled });
39
39
  if (!active) {
40
40
  return;
41
41
  }
@@ -3,48 +3,171 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var styleAttributes = [
6
- /**
7
- * Layout
8
- */
9
- 'alignContent', 'alignItems', 'alignSelf', 'aspectRatio', 'border', 'borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth', 'borderWidth', 'bottom', 'display', 'flex', 'flexBasis', 'flexDirection', 'flexGrow', 'flexShrink', 'flexWrap', 'gap', 'rowGap', 'columnGap', 'columnWidth', 'height', 'justifyContent', 'left', 'margin', 'marginBottom', 'marginHorizontal', 'marginLeft', 'marginRight', 'marginTop', 'marginVertical', 'maxHeight', 'maxWidth', 'minHeight', 'minWidth', 'overflow', 'overflowY', 'overflowX', 'padding', 'paddingBottom', 'paddingEnd', 'paddingHorizontal', 'paddingLeft', 'paddingRight', 'paddingStart', 'paddingTop', 'paddingVertical', 'position', 'right', 'top', ['width', {
10
- validate: value => {
11
- // Pass only number value for "width" style.
12
- // If width have custom value, like "fill", we must set class by this value.
13
- // "\d" - digit; "+" - 1 or more
14
- return /\d+/.test(value);
15
- }
16
- }], 'zIndex', 'order',
17
- /**
18
- * Shadow
19
- */
20
- 'shadowColor', 'shadowOffset', 'shadowOpacity', 'shadowRadius',
21
- /**
22
- * Transform
23
- */
24
- 'transform',
25
- /**
26
- * View
27
- */
28
- 'background', 'backgroundColor', 'borderBottomColor', 'borderBottomEndRadius', 'borderBottomLeftRadius', 'borderBottomRightRadius', 'borderBottomStartRadius', 'borderColor', 'borderCurve', 'borderEndColor', 'borderLeftColor', 'borderRadius', 'borderRightColor', 'borderStartColor', 'borderStyle', 'borderTopColor', 'borderTopEndRadius', 'borderTopLeftRadius', 'borderTopRightRadius', 'borderTopStartRadius', 'opacity', 'cursor',
29
- /**
30
- * Text
31
- */
32
- 'color', 'fontFamily', 'fontSize', 'fontStyle', 'fontVariant', 'fontWeight', 'letterSpacing', 'lineHeight', 'textAlign', 'textDecorationColor', 'textDecorationLine', 'textDecorationStyle', 'textShadowColor', 'textShadowOffset', 'textShadowRadius', 'textTransform', 'verticalAlign', 'writingMode', 'whiteSpace',
33
- /**
34
- * Image
35
- */
36
- 'overlayColor', 'resizeMode', 'tintColor', 'objectFit', 'objectPosition',
37
- /**
38
- * Grid
39
- */
40
- 'gridTemplateColumns', 'gridArea', 'gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridTemplate', 'gridTemplateAreas', 'gridTemplateRows', 'gridColumn', 'gridColumnStart', 'gridColumnEnd', 'gridColumnGap', 'gridRow', 'gridRowStart', 'gridRowEnd', 'gridRowGap',
41
- /**
42
- * Filter
43
- */
44
- 'backdropFilter',
45
- /**
46
- * transition
47
- */
48
- 'transition', 'transitionBehavior', 'transitionDelay', 'transitionDuration', 'transitionProperty', 'transitionTimingFunction'];
6
+ /**
7
+ * Layout
8
+ */
9
+ 'alignContent',
10
+ 'alignItems',
11
+ 'alignSelf',
12
+ 'aspectRatio',
13
+ 'border',
14
+ 'borderBottomWidth',
15
+ 'borderLeftWidth',
16
+ 'borderRightWidth',
17
+ 'borderTopWidth',
18
+ 'borderWidth',
19
+ 'bottom',
20
+ 'display',
21
+ 'flex',
22
+ 'flexBasis',
23
+ 'flexDirection',
24
+ 'flexGrow',
25
+ 'flexShrink',
26
+ 'flexWrap',
27
+ 'gap',
28
+ 'rowGap',
29
+ 'columnGap',
30
+ 'columnWidth',
31
+ 'height',
32
+ 'justifyContent',
33
+ 'left',
34
+ 'margin',
35
+ 'marginBottom',
36
+ 'marginHorizontal',
37
+ 'marginLeft',
38
+ 'marginRight',
39
+ 'marginTop',
40
+ 'marginVertical',
41
+ 'maxHeight',
42
+ 'maxWidth',
43
+ 'minHeight',
44
+ 'minWidth',
45
+ 'overflow',
46
+ 'overflowY',
47
+ 'overflowX',
48
+ 'padding',
49
+ 'paddingBottom',
50
+ 'paddingEnd',
51
+ 'paddingHorizontal',
52
+ 'paddingLeft',
53
+ 'paddingRight',
54
+ 'paddingStart',
55
+ 'paddingTop',
56
+ 'paddingVertical',
57
+ 'position',
58
+ 'right',
59
+ 'top',
60
+ [
61
+ 'width',
62
+ {
63
+ validate: (value) => {
64
+ // Pass only number value for "width" style.
65
+ // If width have custom value, like "fill", we must set class by this value.
66
+ // "\d" - digit; "+" - 1 or more
67
+ return /\d+/.test(value);
68
+ },
69
+ },
70
+ ],
71
+ 'zIndex',
72
+ 'order',
73
+ /**
74
+ * Shadow
75
+ */
76
+ 'shadowColor',
77
+ 'shadowOffset',
78
+ 'shadowOpacity',
79
+ 'shadowRadius',
80
+ /**
81
+ * Transform
82
+ */
83
+ 'transform',
84
+ /**
85
+ * View
86
+ */
87
+ 'background',
88
+ 'backgroundColor',
89
+ 'borderBottomColor',
90
+ 'borderBottomEndRadius',
91
+ 'borderBottomLeftRadius',
92
+ 'borderBottomRightRadius',
93
+ 'borderBottomStartRadius',
94
+ 'borderColor',
95
+ 'borderCurve',
96
+ 'borderEndColor',
97
+ 'borderLeftColor',
98
+ 'borderRadius',
99
+ 'borderRightColor',
100
+ 'borderStartColor',
101
+ 'borderStyle',
102
+ 'borderTopColor',
103
+ 'borderTopEndRadius',
104
+ 'borderTopLeftRadius',
105
+ 'borderTopRightRadius',
106
+ 'borderTopStartRadius',
107
+ 'opacity',
108
+ 'cursor',
109
+ /**
110
+ * Text
111
+ */
112
+ 'color',
113
+ 'fontFamily',
114
+ 'fontSize',
115
+ 'fontStyle',
116
+ 'fontVariant',
117
+ 'fontWeight',
118
+ 'letterSpacing',
119
+ 'lineHeight',
120
+ 'textAlign',
121
+ 'textDecorationColor',
122
+ 'textDecorationLine',
123
+ 'textDecorationStyle',
124
+ 'textShadowColor',
125
+ 'textShadowOffset',
126
+ 'textShadowRadius',
127
+ 'textTransform',
128
+ 'verticalAlign',
129
+ 'writingMode',
130
+ 'whiteSpace',
131
+ /**
132
+ * Image
133
+ */
134
+ 'overlayColor',
135
+ 'resizeMode',
136
+ 'tintColor',
137
+ 'objectFit',
138
+ 'objectPosition',
139
+ /**
140
+ * Grid
141
+ */
142
+ 'gridTemplateColumns',
143
+ 'gridArea',
144
+ 'gridAutoColumns',
145
+ 'gridAutoFlow',
146
+ 'gridAutoRows',
147
+ 'gridTemplate',
148
+ 'gridTemplateAreas',
149
+ 'gridTemplateRows',
150
+ 'gridColumn',
151
+ 'gridColumnStart',
152
+ 'gridColumnEnd',
153
+ 'gridColumnGap',
154
+ 'gridRow',
155
+ 'gridRowStart',
156
+ 'gridRowEnd',
157
+ 'gridRowGap',
158
+ /**
159
+ * Filter
160
+ */
161
+ 'backdropFilter',
162
+ /**
163
+ * transition
164
+ */
165
+ 'transition',
166
+ 'transitionBehavior',
167
+ 'transitionDelay',
168
+ 'transitionDuration',
169
+ 'transitionProperty',
170
+ 'transitionTimingFunction',
171
+ ];
49
172
 
50
173
  exports.default = styleAttributes;