@redis-ui/components 42.8.0 → 43.2.1

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 (228) hide show
  1. package/dist/AutoCompleteSelect/AutoCompleteSelect.cjs +7 -1
  2. package/dist/AutoCompleteSelect/AutoCompleteSelect.js +7 -1
  3. package/dist/AutoCompleteSelect/hooks/useAutoCompleteSelect.cjs +7 -1
  4. package/dist/AutoCompleteSelect/hooks/useAutoCompleteSelect.d.ts +8 -1
  5. package/dist/AutoCompleteSelect/hooks/useAutoCompleteSelect.js +7 -1
  6. package/dist/BoxSelectionGroup/components/Item/components/BoxStateIndicator/BoxStateIndicator.cjs +8 -4
  7. package/dist/BoxSelectionGroup/components/Item/components/BoxStateIndicator/BoxStateIndicator.js +8 -4
  8. package/dist/BoxSelectionGroup/components/Item/components/Compose/Compose.style.cjs +18 -4
  9. package/dist/BoxSelectionGroup/components/Item/components/Compose/Compose.style.js +18 -4
  10. package/dist/BoxSelectionGroup/hooks/useBoxSelectionGroup.cjs +3 -1
  11. package/dist/BoxSelectionGroup/hooks/useBoxSelectionGroup.js +3 -1
  12. package/dist/Button/Button.style.cjs +4 -1
  13. package/dist/Button/Button.style.js +4 -1
  14. package/dist/Button/Button.style.utils.cjs +16 -1
  15. package/dist/Button/Button.style.utils.js +16 -1
  16. package/dist/Button/Button.types.cjs +1 -1
  17. package/dist/Button/Button.types.d.ts +1 -1
  18. package/dist/Button/Button.types.js +1 -1
  19. package/dist/Button/CopyToClipboardButton/CopyToClipboardButton.cjs +59 -0
  20. package/dist/Button/CopyToClipboardButton/CopyToClipboardButton.d.ts +4 -0
  21. package/dist/Button/CopyToClipboardButton/CopyToClipboardButton.js +57 -0
  22. package/dist/Button/CopyToClipboardButton/CopyToClipboardButton.style.cjs +40 -0
  23. package/dist/Button/CopyToClipboardButton/CopyToClipboardButton.style.d.ts +8 -0
  24. package/dist/Button/CopyToClipboardButton/CopyToClipboardButton.style.js +38 -0
  25. package/dist/Button/CopyToClipboardButton/CopyToClipboardButton.types.d.ts +5 -0
  26. package/dist/Button/TextButton/TextButton.style.cjs +4 -1
  27. package/dist/Button/TextButton/TextButton.style.js +4 -1
  28. package/dist/Button/TextButton/TextButton.types.cjs +1 -1
  29. package/dist/Button/TextButton/TextButton.types.d.ts +1 -1
  30. package/dist/Button/TextButton/TextButton.types.js +1 -1
  31. package/dist/Button/index.d.ts +2 -0
  32. package/dist/Checkbox/components/Label/Label.style.cjs +15 -3
  33. package/dist/Checkbox/components/Label/Label.style.js +15 -3
  34. package/dist/Chip/components/CloseButton/CloseButton.cjs +3 -1
  35. package/dist/Chip/components/CloseButton/CloseButton.js +3 -1
  36. package/dist/Chip/components/Compose/Compose.style.cjs +4 -1
  37. package/dist/Chip/components/Compose/Compose.style.js +4 -1
  38. package/dist/Drawer/components/Description/Description.cjs +3 -1
  39. package/dist/Drawer/components/Description/Description.js +3 -1
  40. package/dist/Helpers/contexts/Popper/PopperCollisionBoundaryManager.cjs +3 -1
  41. package/dist/Helpers/contexts/Popper/PopperCollisionBoundaryManager.js +3 -1
  42. package/dist/Helpers/contexts/PrimitiveContextState.cjs +28 -16
  43. package/dist/Helpers/contexts/PrimitiveContextState.js +28 -16
  44. package/dist/Helpers/contexts/SharedId.context.cjs +9 -5
  45. package/dist/Helpers/contexts/SharedId.context.js +9 -5
  46. package/dist/Helpers/css.utils.cjs +18 -4
  47. package/dist/Helpers/css.utils.d.ts +15 -3
  48. package/dist/Helpers/css.utils.js +18 -4
  49. package/dist/Helpers/hooks/useScrollable.cjs +3 -1
  50. package/dist/Helpers/hooks/useScrollable.js +3 -1
  51. package/dist/Helpers/react.utils.cjs +6 -2
  52. package/dist/Helpers/react.utils.js +6 -2
  53. package/dist/HighlightedIcon/HighlightedIcon.cjs +26 -0
  54. package/dist/HighlightedIcon/HighlightedIcon.d.ts +3 -0
  55. package/dist/HighlightedIcon/HighlightedIcon.js +26 -0
  56. package/dist/HighlightedIcon/HighlightedIcon.style.cjs +49 -0
  57. package/dist/HighlightedIcon/HighlightedIcon.style.d.ts +5 -0
  58. package/dist/HighlightedIcon/HighlightedIcon.style.js +47 -0
  59. package/dist/HighlightedIcon/HighlightedIcon.types.d.ts +8 -0
  60. package/dist/HighlightedIcon/index.d.ts +3 -0
  61. package/dist/Inputs/QuantityCounter/components/InputGroup/components/ValueLabel/ValueLabel.cjs +9 -5
  62. package/dist/Inputs/QuantityCounter/components/InputGroup/components/ValueLabel/ValueLabel.js +9 -5
  63. package/dist/Inputs/components/Compose/Compose.style.cjs +29 -6
  64. package/dist/Inputs/components/Compose/Compose.style.js +29 -6
  65. package/dist/Inputs/hooks/numericInput/numericInput.utils.cjs +12 -4
  66. package/dist/Inputs/hooks/numericInput/numericInput.utils.js +12 -4
  67. package/dist/Inputs/hooks/numericInput/useNumericInput.cjs +15 -3
  68. package/dist/Inputs/hooks/numericInput/useNumericInput.js +15 -3
  69. package/dist/Loader/Loader.cjs +1 -0
  70. package/dist/Loader/Loader.js +1 -0
  71. package/dist/Menu/components/Content/components/Item/Components/Compose/Compose.style.cjs +19 -4
  72. package/dist/Menu/components/Content/components/Item/Components/Compose/Compose.style.js +19 -4
  73. package/dist/Menu/components/Content/components/Label/components/Compose/Compose.style.cjs +4 -1
  74. package/dist/Menu/components/Content/components/Label/components/Compose/Compose.style.js +4 -1
  75. package/dist/Modal/components/Content/components/Compose/Compose.cjs +3 -1
  76. package/dist/Modal/components/Content/components/Compose/Compose.js +3 -1
  77. package/dist/Modal/components/Content/components/Description/Description.cjs +3 -1
  78. package/dist/Modal/components/Content/components/Description/Description.js +3 -1
  79. package/dist/MultiSelect/components/Compose/hooks/useMultiSelectContextApi.cjs +3 -1
  80. package/dist/MultiSelect/components/Compose/hooks/useMultiSelectContextApi.js +3 -1
  81. package/dist/MultiSelect/components/Trigger/components/MultiValue/MultiValue.cjs +3 -1
  82. package/dist/MultiSelect/components/Trigger/components/MultiValue/MultiValue.js +3 -1
  83. package/dist/Overflow/Overflow.cjs +3 -1
  84. package/dist/Overflow/Overflow.js +3 -1
  85. package/dist/Overflow/Overflow.utils.cjs +15 -6
  86. package/dist/Overflow/Overflow.utils.js +15 -6
  87. package/dist/Overflow/components/OverflowContainer/OverflowContainer.cjs +3 -1
  88. package/dist/Overflow/components/OverflowContainer/OverflowContainer.js +3 -1
  89. package/dist/Pagination/components/PageSizeSelect.cjs +3 -1
  90. package/dist/Pagination/components/PageSizeSelect.js +3 -1
  91. package/dist/Popover/components/Content/Content.cjs +3 -1
  92. package/dist/Popover/components/Content/Content.js +3 -1
  93. package/dist/Popover/components/Content/components/Footer/Footer.cjs +3 -1
  94. package/dist/Popover/components/Content/components/Footer/Footer.js +3 -1
  95. package/dist/RadioGroup/components/Item/components/Label/Label.style.cjs +15 -3
  96. package/dist/RadioGroup/components/Item/components/Label/Label.style.js +15 -3
  97. package/dist/ScreenReaderAnnounce/ScreenReaderAnnounce.cjs +3 -1
  98. package/dist/ScreenReaderAnnounce/ScreenReaderAnnounce.js +3 -1
  99. package/dist/Section/components/Header/components/CollapseButton/CollapseButton.cjs +3 -1
  100. package/dist/Section/components/Header/components/CollapseButton/CollapseButton.js +3 -1
  101. package/dist/Select/components/Content/components/Option/components/Compose/Compose.style.cjs +16 -4
  102. package/dist/Select/components/Content/components/Option/components/Compose/Compose.style.js +16 -4
  103. package/dist/Select/components/Content/components/OptionList/OptionList.cjs +6 -4
  104. package/dist/Select/components/Content/components/OptionList/OptionList.js +6 -4
  105. package/dist/Select/components/Content/components/OptionList/Virtual.cjs +9 -5
  106. package/dist/Select/components/Content/components/OptionList/Virtual.js +9 -5
  107. package/dist/Select/components/Context/hooks/useSearch.cjs +3 -1
  108. package/dist/Select/components/Context/hooks/useSearch.js +3 -1
  109. package/dist/Select/components/Trigger/components/Compose/Compose.style.cjs +33 -7
  110. package/dist/Select/components/Trigger/components/Compose/Compose.style.js +33 -7
  111. package/dist/SideBar/components/Item/Item.style.cjs +14 -3
  112. package/dist/SideBar/components/Item/Item.style.js +14 -3
  113. package/dist/Skeleton/components/Circle/Circle.cjs +1 -1
  114. package/dist/Skeleton/components/Circle/Circle.js +1 -1
  115. package/dist/Skeleton/components/Square/Square.cjs +1 -1
  116. package/dist/Skeleton/components/Square/Square.js +1 -1
  117. package/dist/Slider/components/Label/Compose/Compose.cjs +3 -1
  118. package/dist/Slider/components/Label/Compose/Compose.js +3 -1
  119. package/dist/Slider/components/Mark/Compose/Compose.cjs +3 -1
  120. package/dist/Slider/components/Mark/Compose/Compose.js +3 -1
  121. package/dist/Slider/hooks/useOffset.cjs +3 -1
  122. package/dist/Slider/hooks/useOffset.js +3 -1
  123. package/dist/Stepper/Stepper.cjs +14 -5
  124. package/dist/Stepper/Stepper.d.ts +2 -0
  125. package/dist/Stepper/Stepper.js +14 -5
  126. package/dist/Stepper/Stepper.utils.cjs +12 -0
  127. package/dist/Stepper/Stepper.utils.d.ts +2 -0
  128. package/dist/Stepper/Stepper.utils.js +12 -0
  129. package/dist/Stepper/components/Compose/Compose.d.ts +1 -0
  130. package/dist/Stepper/components/Step/Step.cjs +2 -0
  131. package/dist/Stepper/components/Step/Step.d.ts +1 -0
  132. package/dist/Stepper/components/Step/Step.js +2 -0
  133. package/dist/Stepper/components/Step/components/Compose/Compose.cjs +5 -10
  134. package/dist/Stepper/components/Step/components/Compose/Compose.js +5 -10
  135. package/dist/Stepper/components/Step/components/Separator/Separator.cjs +15 -0
  136. package/dist/Stepper/components/Step/components/Separator/Separator.d.ts +3 -0
  137. package/dist/Stepper/components/Step/components/Separator/Separator.js +15 -0
  138. package/dist/Stepper/components/Step/components/Separator/Separator.style.cjs +24 -0
  139. package/dist/Stepper/components/Step/components/Separator/Separator.style.d.ts +1 -0
  140. package/dist/Stepper/components/Step/components/Separator/Separator.style.js +22 -0
  141. package/dist/Stepper/components/Step/components/Separator/Separator.types.d.ts +5 -0
  142. package/dist/Stepper/hooks/useStepperInteractive.cjs +12 -4
  143. package/dist/Stepper/hooks/useStepperInteractive.js +12 -4
  144. package/dist/Switch/components/Switcher/Switcher.cjs +3 -1
  145. package/dist/Switch/components/Switcher/Switcher.js +3 -1
  146. package/dist/Switch/components/Switcher/Switcher.style.cjs +31 -8
  147. package/dist/Switch/components/Switcher/Switcher.style.js +31 -8
  148. package/dist/Tabs/components/TabBar/components/Trigger/components/Marker/Marker.style.cjs +24 -5
  149. package/dist/Tabs/components/TabBar/components/Trigger/components/Marker/Marker.style.js +24 -5
  150. package/dist/Tabs/components/TabBar/components/Trigger/components/Tab/Tab.style.cjs +24 -5
  151. package/dist/Tabs/components/TabBar/components/Trigger/components/Tab/Tab.style.js +24 -5
  152. package/dist/ThemeModeSwitch/useThemeModeSwitch.cjs +6 -2
  153. package/dist/ThemeModeSwitch/useThemeModeSwitch.js +6 -2
  154. package/dist/Toast/core/content.helper.cjs +8 -4
  155. package/dist/Toast/core/content.helper.js +8 -4
  156. package/dist/Tooltip/components/Content/Content.cjs +3 -1
  157. package/dist/Tooltip/components/Content/Content.js +3 -1
  158. package/dist/TreeView/TreeView.cjs +3 -1
  159. package/dist/TreeView/TreeView.js +3 -1
  160. package/dist/TreeView/components/TreeItem/components/Compose/Compose.cjs +6 -4
  161. package/dist/TreeView/components/TreeItem/components/Compose/Compose.js +6 -4
  162. package/dist/Typography/Typography.types.cjs +4 -0
  163. package/dist/Typography/Typography.types.d.ts +2 -1
  164. package/dist/Typography/Typography.types.js +4 -0
  165. package/dist/index.cjs +8 -0
  166. package/dist/index.d.ts +1 -0
  167. package/dist/index.js +98 -90
  168. package/package.json +10 -9
  169. package/skills/redis-ui-components/SKILL.md +126 -0
  170. package/skills/redis-ui-components/references/ActionIconButton.md +96 -0
  171. package/skills/redis-ui-components/references/AppBar.md +161 -0
  172. package/skills/redis-ui-components/references/AppSelectionMenu.md +184 -0
  173. package/skills/redis-ui-components/references/AutoCompleteSelect.md +193 -0
  174. package/skills/redis-ui-components/references/Badge.md +77 -0
  175. package/skills/redis-ui-components/references/Banner.md +563 -0
  176. package/skills/redis-ui-components/references/BoxSelectionGroup.md +487 -0
  177. package/skills/redis-ui-components/references/Breadcrumbs.md +214 -0
  178. package/skills/redis-ui-components/references/Button.md +169 -0
  179. package/skills/redis-ui-components/references/ButtonGroup.md +126 -0
  180. package/skills/redis-ui-components/references/Card.md +56 -0
  181. package/skills/redis-ui-components/references/Checkbox.md +171 -0
  182. package/skills/redis-ui-components/references/Chip.md +154 -0
  183. package/skills/redis-ui-components/references/ChipList.md +307 -0
  184. package/skills/redis-ui-components/references/CopyToClipboardButton.md +47 -0
  185. package/skills/redis-ui-components/references/CountryFlag.md +57 -0
  186. package/skills/redis-ui-components/references/Drawer.md +298 -0
  187. package/skills/redis-ui-components/references/Filters.md +162 -0
  188. package/skills/redis-ui-components/references/FlexDivider.md +152 -0
  189. package/skills/redis-ui-components/references/FlexGroup.md +149 -0
  190. package/skills/redis-ui-components/references/FlexItem.md +58 -0
  191. package/skills/redis-ui-components/references/FlexSplit.md +37 -0
  192. package/skills/redis-ui-components/references/FormField.md +678 -0
  193. package/skills/redis-ui-components/references/IconButton.md +63 -0
  194. package/skills/redis-ui-components/references/Input.md +295 -0
  195. package/skills/redis-ui-components/references/KeyValueList.md +501 -0
  196. package/skills/redis-ui-components/references/Label.md +238 -0
  197. package/skills/redis-ui-components/references/Link.md +402 -0
  198. package/skills/redis-ui-components/references/Loader.md +100 -0
  199. package/skills/redis-ui-components/references/Menu.md +988 -0
  200. package/skills/redis-ui-components/references/MidBar.md +358 -0
  201. package/skills/redis-ui-components/references/Modal.md +525 -0
  202. package/skills/redis-ui-components/references/MoreInfoIcon.md +119 -0
  203. package/skills/redis-ui-components/references/MultiSelect.md +558 -0
  204. package/skills/redis-ui-components/references/NumericInput.md +322 -0
  205. package/skills/redis-ui-components/references/Overflow.md +127 -0
  206. package/skills/redis-ui-components/references/Pagination.md +151 -0
  207. package/skills/redis-ui-components/references/PasswordInput.md +262 -0
  208. package/skills/redis-ui-components/references/Popover.md +868 -0
  209. package/skills/redis-ui-components/references/ProfileIcon.md +65 -0
  210. package/skills/redis-ui-components/references/ProgressBar.md +103 -0
  211. package/skills/redis-ui-components/references/QuantityCounter.md +555 -0
  212. package/skills/redis-ui-components/references/RadioGroup.md +265 -0
  213. package/skills/redis-ui-components/references/ScreenReaderAnnounce.md +147 -0
  214. package/skills/redis-ui-components/references/SearchBar.md +242 -0
  215. package/skills/redis-ui-components/references/SearchInput.md +213 -0
  216. package/skills/redis-ui-components/references/Section.md +349 -0
  217. package/skills/redis-ui-components/references/Select.md +517 -0
  218. package/skills/redis-ui-components/references/SideBar.md +468 -0
  219. package/skills/redis-ui-components/references/Slider.md +398 -0
  220. package/skills/redis-ui-components/references/Stepper.md +288 -0
  221. package/skills/redis-ui-components/references/Switch.md +193 -0
  222. package/skills/redis-ui-components/references/Tabs.md +383 -0
  223. package/skills/redis-ui-components/references/TextArea.md +139 -0
  224. package/skills/redis-ui-components/references/TextButton.md +217 -0
  225. package/skills/redis-ui-components/references/Toast.md +399 -0
  226. package/skills/redis-ui-components/references/ToggleButton.md +163 -0
  227. package/skills/redis-ui-components/references/Tooltip.md +636 -0
  228. package/skills/redis-ui-components/references/Typography.md +323 -0
@@ -0,0 +1,47 @@
1
+ import _styled from "styled-components";
2
+ import { useTheme } from "@redislabsdev/redis-ui-styles";
3
+ const SIZE_MAP = {
4
+ XS: {
5
+ size: "1.6rem",
6
+ borderRadius: "0.3rem"
7
+ },
8
+ S: {
9
+ size: "2rem",
10
+ borderRadius: "0.3rem"
11
+ },
12
+ M: {
13
+ size: "2.4rem",
14
+ borderRadius: "0.5rem"
15
+ },
16
+ L: {
17
+ size: "3.2rem",
18
+ borderRadius: "0.5rem"
19
+ },
20
+ XL: {
21
+ size: "4rem",
22
+ borderRadius: "0.8rem"
23
+ },
24
+ XXL: {
25
+ size: "4.4rem",
26
+ borderRadius: "0.8rem"
27
+ }
28
+ };
29
+ const getColors = (type) => {
30
+ const theme = useTheme();
31
+ return theme.components.highlightedIcon.variants[type];
32
+ };
33
+ const HighlightedIconContainer = _styled.div.withConfig({
34
+ displayName: "HighlightedIconstyle__HighlightedIconContainer",
35
+ componentId: "RedisUI__sc-o2gs2e-0"
36
+ })(["display:inline-flex;align-items:center;justify-content:center;width:", ";aspect-ratio:1;background-color:", ";color:", ";border-radius:", ";flex-shrink:0;"], ({
37
+ $size
38
+ }) => SIZE_MAP[$size].size, ({
39
+ $type
40
+ }) => getColors($type).background, ({
41
+ $type
42
+ }) => getColors($type).text, ({
43
+ $size
44
+ }) => SIZE_MAP[$size].borderRadius);
45
+ export {
46
+ HighlightedIconContainer
47
+ };
@@ -0,0 +1,8 @@
1
+ import { HTMLAttributes } from 'react';
2
+ import { IconType as IconComponent } from '@redislabsdev/redis-ui-icons';
3
+ import { HighlightedIconType, IconSizeType } from '@redislabsdev/redis-ui-styles';
4
+ export interface HighlightedIconProps extends HTMLAttributes<HTMLDivElement> {
5
+ icon: IconComponent;
6
+ size?: IconSizeType;
7
+ type?: HighlightedIconType;
8
+ }
@@ -0,0 +1,3 @@
1
+ export { default as HighlightedIcon } from './HighlightedIcon';
2
+ export * from './HighlightedIcon.types';
3
+ export * as HighlightedIconStyles from './HighlightedIcon.style';
@@ -10,11 +10,15 @@ const ValueLabel = ({
10
10
  const {
11
11
  value
12
12
  } = InputValue_context.useInputValueApi();
13
- if (!children || !value) return null;
14
- if (typeof children === "string") return jsxRuntime.jsxRuntimeExports.jsx(ValueLabel_style.ValueLabel, {
15
- component: "span",
16
- children
17
- });
13
+ if (!children || !value) {
14
+ return null;
15
+ }
16
+ if (typeof children === "string") {
17
+ return jsxRuntime.jsxRuntimeExports.jsx(ValueLabel_style.ValueLabel, {
18
+ component: "span",
19
+ children
20
+ });
21
+ }
18
22
  return React.Children.only(children);
19
23
  };
20
24
  exports.ValueLabel = ValueLabel;
@@ -8,11 +8,15 @@ const ValueLabel = ({
8
8
  const {
9
9
  value
10
10
  } = useInputValueApi();
11
- if (!children || !value) return null;
12
- if (typeof children === "string") return jsxRuntimeExports.jsx(ValueLabel$1, {
13
- component: "span",
14
- children
15
- });
11
+ if (!children || !value) {
12
+ return null;
13
+ }
14
+ if (typeof children === "string") {
15
+ return jsxRuntimeExports.jsx(ValueLabel$1, {
16
+ component: "span",
17
+ children
18
+ });
19
+ }
16
20
  return Children.only(children);
17
21
  };
18
22
  export {
@@ -19,23 +19,42 @@ const getStateStyle = (theme) => {
19
19
  const maps = [bgColor, textColor, borderColor];
20
20
  return _styled.css`
21
21
  & {
22
- ${css_utils.styleFromTokens(maps, statesStyle.normal)};
22
+ ${css_utils.styleFromTokens({
23
+ tokenMaps: maps,
24
+ tokens: statesStyle.normal
25
+ })};
23
26
  }
24
27
 
25
28
  &:focus-within {
26
- ${css_utils.styleFromTokens(maps, statesStyle.focused, statesStyle.normal)};
29
+ ${css_utils.styleFromTokens({
30
+ tokenMaps: maps,
31
+ tokens: statesStyle.focused,
32
+ fallbackTokens: statesStyle.normal
33
+ })};
27
34
  }
28
35
 
29
36
  &[data-status='error'] {
30
- ${css_utils.styleFromTokens(maps, statesStyle.error, statesStyle.normal)};
37
+ ${css_utils.styleFromTokens({
38
+ tokenMaps: maps,
39
+ tokens: statesStyle.error,
40
+ fallbackTokens: statesStyle.normal
41
+ })};
31
42
  }
32
43
 
33
44
  &[data-status='success'] {
34
- ${css_utils.styleFromTokens(maps, statesStyle.success, statesStyle.normal)};
45
+ ${css_utils.styleFromTokens({
46
+ tokenMaps: maps,
47
+ tokens: statesStyle.success,
48
+ fallbackTokens: statesStyle.normal
49
+ })};
35
50
  }
36
51
 
37
52
  &:has(:is(input, textarea):disabled) {
38
- ${css_utils.styleFromTokens(maps, statesStyle.disabled, statesStyle.normal)};
53
+ ${css_utils.styleFromTokens({
54
+ tokenMaps: maps,
55
+ tokens: statesStyle.disabled,
56
+ fallbackTokens: statesStyle.normal
57
+ })};
39
58
  cursor: no-drop;
40
59
 
41
60
  ${StatusIndicator_style.IconContainer},${Loader_style.LoaderSVG} {
@@ -61,7 +80,11 @@ const CommonInputCompose = _styled__default.default.div.attrs(() => ({
61
80
  `;
62
81
  }, () => getStateStyle(redisUiStyles.useTheme()), ({
63
82
  $variant
64
- }) => css_utils.styleFromTokens([css_utils.tokenMaps.borderWidth, css_utils.tokenMaps.borderRadius], redisUiStyles.useTheme().components.input.variants[$variant], redisUiStyles.useTheme().components.input.variants.outline), ({
83
+ }) => css_utils.styleFromTokens({
84
+ tokenMaps: [css_utils.tokenMaps.borderWidth, css_utils.tokenMaps.borderRadius],
85
+ tokens: redisUiStyles.useTheme().components.input.variants[$variant],
86
+ fallbackTokens: redisUiStyles.useTheme().components.input.variants.outline
87
+ }), ({
65
88
  $variant
66
89
  }) => $variant !== "underline" ? void 0 : _styled.css`
67
90
  border-top-color: transparent;
@@ -15,23 +15,42 @@ const getStateStyle = (theme) => {
15
15
  const maps = [bgColor, textColor, borderColor];
16
16
  return css`
17
17
  & {
18
- ${styleFromTokens(maps, statesStyle.normal)};
18
+ ${styleFromTokens({
19
+ tokenMaps: maps,
20
+ tokens: statesStyle.normal
21
+ })};
19
22
  }
20
23
 
21
24
  &:focus-within {
22
- ${styleFromTokens(maps, statesStyle.focused, statesStyle.normal)};
25
+ ${styleFromTokens({
26
+ tokenMaps: maps,
27
+ tokens: statesStyle.focused,
28
+ fallbackTokens: statesStyle.normal
29
+ })};
23
30
  }
24
31
 
25
32
  &[data-status='error'] {
26
- ${styleFromTokens(maps, statesStyle.error, statesStyle.normal)};
33
+ ${styleFromTokens({
34
+ tokenMaps: maps,
35
+ tokens: statesStyle.error,
36
+ fallbackTokens: statesStyle.normal
37
+ })};
27
38
  }
28
39
 
29
40
  &[data-status='success'] {
30
- ${styleFromTokens(maps, statesStyle.success, statesStyle.normal)};
41
+ ${styleFromTokens({
42
+ tokenMaps: maps,
43
+ tokens: statesStyle.success,
44
+ fallbackTokens: statesStyle.normal
45
+ })};
31
46
  }
32
47
 
33
48
  &:has(:is(input, textarea):disabled) {
34
- ${styleFromTokens(maps, statesStyle.disabled, statesStyle.normal)};
49
+ ${styleFromTokens({
50
+ tokenMaps: maps,
51
+ tokens: statesStyle.disabled,
52
+ fallbackTokens: statesStyle.normal
53
+ })};
35
54
  cursor: no-drop;
36
55
 
37
56
  ${IconContainer},${LoaderSVG} {
@@ -57,7 +76,11 @@ const CommonInputCompose = _styled.div.attrs(() => ({
57
76
  `;
58
77
  }, () => getStateStyle(useTheme()), ({
59
78
  $variant
60
- }) => styleFromTokens([tokenMaps.borderWidth, tokenMaps.borderRadius], useTheme().components.input.variants[$variant], useTheme().components.input.variants.outline), ({
79
+ }) => styleFromTokens({
80
+ tokenMaps: [tokenMaps.borderWidth, tokenMaps.borderRadius],
81
+ tokens: useTheme().components.input.variants[$variant],
82
+ fallbackTokens: useTheme().components.input.variants.outline
83
+ }), ({
61
84
  $variant
62
85
  }) => $variant !== "underline" ? void 0 : css`
63
86
  border-top-color: transparent;
@@ -12,11 +12,19 @@ const roundDecimal = (value, fractionDigits) => +value.toFixed(fractionDigits);
12
12
  const isInoperative = (value) => value == null || typeof value === "number" && Number.isNaN(value);
13
13
  const isEmpty = (value) => isInoperative(value) || value === "";
14
14
  const toNumberOptimistic = (value) => {
15
- if (isInoperative(value)) return void 0;
16
- if (typeof value === "number") return value;
17
- if (!Number.isNaN(+value)) return +value;
15
+ if (isInoperative(value)) {
16
+ return void 0;
17
+ }
18
+ if (typeof value === "number") {
19
+ return value;
20
+ }
21
+ if (!Number.isNaN(+value)) {
22
+ return +value;
23
+ }
18
24
  value = `${value}0`;
19
- if (!Number.isNaN(+value)) return +value;
25
+ if (!Number.isNaN(+value)) {
26
+ return +value;
27
+ }
20
28
  value = value.replace(/e/i, "0e");
21
29
  return !Number.isNaN(+value) ? +value : void 0;
22
30
  };
@@ -10,11 +10,19 @@ const roundDecimal = (value, fractionDigits) => +value.toFixed(fractionDigits);
10
10
  const isInoperative = (value) => value == null || typeof value === "number" && Number.isNaN(value);
11
11
  const isEmpty = (value) => isInoperative(value) || value === "";
12
12
  const toNumberOptimistic = (value) => {
13
- if (isInoperative(value)) return void 0;
14
- if (typeof value === "number") return value;
15
- if (!Number.isNaN(+value)) return +value;
13
+ if (isInoperative(value)) {
14
+ return void 0;
15
+ }
16
+ if (typeof value === "number") {
17
+ return value;
18
+ }
19
+ if (!Number.isNaN(+value)) {
20
+ return +value;
21
+ }
16
22
  value = `${value}0`;
17
- if (!Number.isNaN(+value)) return +value;
23
+ if (!Number.isNaN(+value)) {
24
+ return +value;
25
+ }
18
26
  value = value.replace(/e/i, "0e");
19
27
  return !Number.isNaN(+value) ? +value : void 0;
20
28
  };
@@ -2,14 +2,24 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const React = require("react");
4
4
  const numericInput_utils = require("./numericInput.utils.cjs");
5
- const snapToConstraints = (value, min, max, maxDecimals) => numericInput_utils.roundDecimal(numericInput_utils.snapToRange(value, min, max), maxDecimals);
5
+ const snapToConstraints = ({
6
+ value,
7
+ min,
8
+ max,
9
+ maxDecimals
10
+ }) => numericInput_utils.roundDecimal(numericInput_utils.snapToRange(value, min, max), maxDecimals);
6
11
  const defaultValidate = ({
7
12
  value,
8
13
  required,
9
14
  min,
10
15
  max,
11
16
  maxDecimals
12
- }) => !required && value == null ? null : snapToConstraints(value || 0, min, max, maxDecimals);
17
+ }) => !required && value == null ? null : snapToConstraints({
18
+ value: value || 0,
19
+ min,
20
+ max,
21
+ maxDecimals
22
+ });
13
23
  const defaultCalcStepActionValue = ({
14
24
  value,
15
25
  step,
@@ -44,7 +54,9 @@ const useNumericInput = ({
44
54
  }, [max, maxDecimals, min, step]);
45
55
  React.useLayoutEffect(() => {
46
56
  if (numericInput_utils.isEmpty(value)) {
47
- if (lastValueRef.current != null) setDisplayValue("");
57
+ if (lastValueRef.current != null) {
58
+ setDisplayValue("");
59
+ }
48
60
  } else if (lastValueRef.current !== value) {
49
61
  setDisplayValue(String(value));
50
62
  lastValueRef.current = value;
@@ -1,13 +1,23 @@
1
1
  import { useState, useRef, useMemo, useLayoutEffect, useCallback } from "react";
2
2
  import { normalizeMaxDecimals, isEmpty, toNumberOptimistic, toString, getClosestDivisibleNumber, normalizeMinMax, normalizeStep, toNumber, roundDecimal, snapToRange } from "./numericInput.utils.js";
3
- const snapToConstraints = (value, min, max, maxDecimals) => roundDecimal(snapToRange(value, min, max), maxDecimals);
3
+ const snapToConstraints = ({
4
+ value,
5
+ min,
6
+ max,
7
+ maxDecimals
8
+ }) => roundDecimal(snapToRange(value, min, max), maxDecimals);
4
9
  const defaultValidate = ({
5
10
  value,
6
11
  required,
7
12
  min,
8
13
  max,
9
14
  maxDecimals
10
- }) => !required && value == null ? null : snapToConstraints(value || 0, min, max, maxDecimals);
15
+ }) => !required && value == null ? null : snapToConstraints({
16
+ value: value || 0,
17
+ min,
18
+ max,
19
+ maxDecimals
20
+ });
11
21
  const defaultCalcStepActionValue = ({
12
22
  value,
13
23
  step,
@@ -42,7 +52,9 @@ const useNumericInput = ({
42
52
  }, [max, maxDecimals, min, step]);
43
53
  useLayoutEffect(() => {
44
54
  if (isEmpty(value)) {
45
- if (lastValueRef.current != null) setDisplayValue("");
55
+ if (lastValueRef.current != null) {
56
+ setDisplayValue("");
57
+ }
46
58
  } else if (lastValueRef.current !== value) {
47
59
  setDisplayValue(String(value));
48
60
  lastValueRef.current = value;
@@ -19,6 +19,7 @@ const Loader = ({
19
19
  "aria-live": loaderText ? void 0 : "polite",
20
20
  ...restProps,
21
21
  children: jsxRuntime.jsxRuntimeExports.jsxs(Loader_style.InnerFlexContainer, {
22
+ "aria-busy": true,
22
23
  role: loaderText ? void 0 : "status",
23
24
  children: [jsxRuntime.jsxRuntimeExports.jsx(Loader_style.LoaderSVG, {
24
25
  "$variant": variant,
@@ -17,6 +17,7 @@ const Loader = ({
17
17
  "aria-live": loaderText ? void 0 : "polite",
18
18
  ...restProps,
19
19
  children: jsxRuntimeExports.jsxs(InnerFlexContainer, {
20
+ "aria-busy": true,
20
21
  role: loaderText ? void 0 : "status",
21
22
  children: [jsxRuntimeExports.jsx(LoaderSVG, {
22
23
  "$variant": variant,
@@ -16,21 +16,36 @@ const getMenuItemStatesStyle = (stateStyles) => {
16
16
  };
17
17
  return _styled.css`
18
18
  & {
19
- ${css_utils.styleFromTokens(maps, fallbackStyle)}
19
+ ${css_utils.styleFromTokens({
20
+ tokenMaps: maps,
21
+ tokens: fallbackStyle
22
+ })}
20
23
  }
21
24
 
22
25
  &[data-highlighted],
23
26
  &:hover {
24
- ${css_utils.styleFromTokens(maps, stateStyles.hover, fallbackStyle)}
27
+ ${css_utils.styleFromTokens({
28
+ tokenMaps: maps,
29
+ tokens: stateStyles.hover,
30
+ fallbackTokens: fallbackStyle
31
+ })}
25
32
  }
26
33
 
27
34
  &[data-selected] {
28
- ${css_utils.styleFromTokens(maps, stateStyles.selected, fallbackStyle)}
35
+ ${css_utils.styleFromTokens({
36
+ tokenMaps: maps,
37
+ tokens: stateStyles.selected,
38
+ fallbackTokens: fallbackStyle
39
+ })}
29
40
  }
30
41
 
31
42
  &[data-disabled],
32
43
  &:disabled {
33
- ${css_utils.styleFromTokens(maps, stateStyles.disabled, fallbackStyle)}
44
+ ${css_utils.styleFromTokens({
45
+ tokenMaps: maps,
46
+ tokens: stateStyles.disabled,
47
+ fallbackTokens: fallbackStyle
48
+ })}
34
49
  }
35
50
  `;
36
51
  };
@@ -12,21 +12,36 @@ const getMenuItemStatesStyle = (stateStyles) => {
12
12
  };
13
13
  return css`
14
14
  & {
15
- ${styleFromTokens(maps, fallbackStyle)}
15
+ ${styleFromTokens({
16
+ tokenMaps: maps,
17
+ tokens: fallbackStyle
18
+ })}
16
19
  }
17
20
 
18
21
  &[data-highlighted],
19
22
  &:hover {
20
- ${styleFromTokens(maps, stateStyles.hover, fallbackStyle)}
23
+ ${styleFromTokens({
24
+ tokenMaps: maps,
25
+ tokens: stateStyles.hover,
26
+ fallbackTokens: fallbackStyle
27
+ })}
21
28
  }
22
29
 
23
30
  &[data-selected] {
24
- ${styleFromTokens(maps, stateStyles.selected, fallbackStyle)}
31
+ ${styleFromTokens({
32
+ tokenMaps: maps,
33
+ tokens: stateStyles.selected,
34
+ fallbackTokens: fallbackStyle
35
+ })}
25
36
  }
26
37
 
27
38
  &[data-disabled],
28
39
  &:disabled {
29
- ${styleFromTokens(maps, stateStyles.disabled, fallbackStyle)}
40
+ ${styleFromTokens({
41
+ tokenMaps: maps,
42
+ tokens: stateStyles.disabled,
43
+ fallbackTokens: fallbackStyle
44
+ })}
30
45
  }
31
46
  `;
32
47
  };
@@ -11,7 +11,10 @@ const MenuContentLabelCompose = _styled__default.default.div.withConfig({
11
11
  componentId: "RedisUI__sc-sansj6-0"
12
12
  })(["", " gap:", ";padding:", ";padding-inline-start:", ";display:flex;align-items:center;cursor:default;"], ({
13
13
  variant = "header"
14
- }) => css_utils.styleFromTokens(maps, redisUiStyles.useTheme().components.menu.label.variants[variant]), () => redisUiStyles.useTheme().components.menu.label.gap, () => redisUiStyles.useTheme().components.menu.label.padding, ({
14
+ }) => css_utils.styleFromTokens({
15
+ tokenMaps: maps,
16
+ tokens: redisUiStyles.useTheme().components.menu.label.variants[variant]
17
+ }), () => redisUiStyles.useTheme().components.menu.label.gap, () => redisUiStyles.useTheme().components.menu.label.padding, ({
15
18
  shift
16
19
  }) => {
17
20
  const styles = redisUiStyles.useTheme().components.menu.label;
@@ -7,7 +7,10 @@ const MenuContentLabelCompose = _styled.div.withConfig({
7
7
  componentId: "RedisUI__sc-sansj6-0"
8
8
  })(["", " gap:", ";padding:", ";padding-inline-start:", ";display:flex;align-items:center;cursor:default;"], ({
9
9
  variant = "header"
10
- }) => styleFromTokens(maps, useTheme().components.menu.label.variants[variant]), () => useTheme().components.menu.label.gap, () => useTheme().components.menu.label.padding, ({
10
+ }) => styleFromTokens({
11
+ tokenMaps: maps,
12
+ tokens: useTheme().components.menu.label.variants[variant]
13
+ }), () => useTheme().components.menu.label.gap, () => useTheme().components.menu.label.padding, ({
11
14
  shift
12
15
  }) => {
13
16
  const styles = useTheme().components.menu.label;
@@ -52,7 +52,9 @@ const Compose = ({
52
52
  onCloseAutoFocus: (e) => {
53
53
  var _a;
54
54
  e.preventDefault();
55
- if (!document.querySelector("div[role=dialog][data-role=dialog]")) (_a = focusedRef.current) == null ? void 0 : _a.focus();
55
+ if (!document.querySelector("div[role=dialog][data-role=dialog]")) {
56
+ (_a = focusedRef.current) == null ? void 0 : _a.focus();
57
+ }
56
58
  }
57
59
  })]
58
60
  });
@@ -50,7 +50,9 @@ const Compose = ({
50
50
  onCloseAutoFocus: (e) => {
51
51
  var _a;
52
52
  e.preventDefault();
53
- if (!document.querySelector("div[role=dialog][data-role=dialog]")) (_a = focusedRef.current) == null ? void 0 : _a.focus();
53
+ if (!document.querySelector("div[role=dialog][data-role=dialog]")) {
54
+ (_a = focusedRef.current) == null ? void 0 : _a.focus();
55
+ }
54
56
  }
55
57
  })]
56
58
  });
@@ -13,7 +13,9 @@ const Description = Object.assign(({
13
13
  }) => {
14
14
  var _a;
15
15
  const emptyContent = !((_a = react_utils.childrenToString(children)) == null ? void 0 : _a.trim());
16
- if (emptyContent) return null;
16
+ if (emptyContent) {
17
+ return null;
18
+ }
17
19
  const mainElement = jsxRuntime.jsxRuntimeExports.jsx(index.Description, {
18
20
  asChild: true,
19
21
  children: jsxRuntime.jsxRuntimeExports.jsx(Description_style.DescriptionContainer, {
@@ -11,7 +11,9 @@ const Description = Object.assign(({
11
11
  }) => {
12
12
  var _a;
13
13
  const emptyContent = !((_a = childrenToString(children)) == null ? void 0 : _a.trim());
14
- if (emptyContent) return null;
14
+ if (emptyContent) {
15
+ return null;
16
+ }
15
17
  const mainElement = jsxRuntimeExports.jsx(Description$1, {
16
18
  asChild: true,
17
19
  children: jsxRuntimeExports.jsx(DescriptionContainer, {
@@ -57,7 +57,9 @@ function useMultiSelectContextApi({
57
57
  };
58
58
  const hasSelectable = enabledOptions.length > 0;
59
59
  const getIsAllSelected = () => {
60
- if (!hasSelectable) return false;
60
+ if (!hasSelectable) {
61
+ return false;
62
+ }
61
63
  const selectedValues = new Set(values);
62
64
  return !enabledOptions.some(({
63
65
  value
@@ -55,7 +55,9 @@ function useMultiSelectContextApi({
55
55
  };
56
56
  const hasSelectable = enabledOptions.length > 0;
57
57
  const getIsAllSelected = () => {
58
- if (!hasSelectable) return false;
58
+ if (!hasSelectable) {
59
+ return false;
60
+ }
59
61
  const selectedValues = new Set(values);
60
62
  return !enabledOptions.some(({
61
63
  value
@@ -39,7 +39,9 @@ const MultiValue = ({
39
39
  const handlePointerDown = (e) => {
40
40
  let targetElement = e.target;
41
41
  while (targetElement && targetElement !== ref.current) {
42
- if (targetElement.tagName === "BUTTON") e.stopPropagation();
42
+ if (targetElement.tagName === "BUTTON") {
43
+ e.stopPropagation();
44
+ }
43
45
  targetElement = targetElement.parentElement;
44
46
  }
45
47
  };
@@ -37,7 +37,9 @@ const MultiValue = ({
37
37
  const handlePointerDown = (e) => {
38
38
  let targetElement = e.target;
39
39
  while (targetElement && targetElement !== ref.current) {
40
- if (targetElement.tagName === "BUTTON") e.stopPropagation();
40
+ if (targetElement.tagName === "BUTTON") {
41
+ e.stopPropagation();
42
+ }
41
43
  targetElement = targetElement.parentElement;
42
44
  }
43
45
  };
@@ -26,7 +26,9 @@ const Overflow = ({
26
26
  const handleItemSizeChange = (size, itemKey) => {
27
27
  setSizes((origin) => {
28
28
  const origSize = origin.get(itemKey);
29
- if (origSize != null && isSizingContainerRef.current || origSize === size) return origin;
29
+ if (origSize != null && isSizingContainerRef.current || origSize === size) {
30
+ return origin;
31
+ }
30
32
  const clone = new Map(origin);
31
33
  if (size == null) {
32
34
  clone.delete(itemKey);
@@ -24,7 +24,9 @@ const Overflow = ({
24
24
  const handleItemSizeChange = (size, itemKey) => {
25
25
  setSizes((origin) => {
26
26
  const origSize = origin.get(itemKey);
27
- if (origSize != null && isSizingContainerRef.current || origSize === size) return origin;
27
+ if (origSize != null && isSizingContainerRef.current || origSize === size) {
28
+ return origin;
29
+ }
28
30
  const clone = new Map(origin);
29
31
  if (size == null) {
30
32
  clone.delete(itemKey);
@@ -16,7 +16,9 @@ const calcVisibleCount = ({
16
16
  let indexInRow = 0;
17
17
  itemKeys.some((key, index) => {
18
18
  const size = itemSizes.get(key);
19
- if (size === void 0) return true;
19
+ if (size === void 0) {
20
+ return true;
21
+ }
20
22
  const calcOverflow = () => {
21
23
  const isLastRow = row === maxRows - 1;
22
24
  const isFirstInRow = indexInRow === 0;
@@ -26,8 +28,9 @@ const calcVisibleCount = ({
26
28
  summarySize += itemSize;
27
29
  indexInRow += 1;
28
30
  const isOverflow2 = summarySize + expectedExtraSize > containerSize;
29
- if (!isOverflow2) visibleCount += 1;
30
- else if (isFirstInRow && itemSize >= containerSize && (!isLastRow || isLastItem)) {
31
+ if (!isOverflow2) {
32
+ visibleCount += 1;
33
+ } else if (isFirstInRow && itemSize >= containerSize && (!isLastRow || isLastItem)) {
31
34
  visibleCount += 1;
32
35
  return false;
33
36
  }
@@ -35,7 +38,9 @@ const calcVisibleCount = ({
35
38
  };
36
39
  const isOverflow = calcOverflow();
37
40
  if (isOverflow) {
38
- if (row === maxRows - 1) return true;
41
+ if (row === maxRows - 1) {
42
+ return true;
43
+ }
39
44
  row += 1;
40
45
  indexInRow = 0;
41
46
  summarySize = 0;
@@ -49,8 +54,12 @@ const calcVisibleCount = ({
49
54
  const verifyChildren = (children) => {
50
55
  const keysCheck = /* @__PURE__ */ new Set();
51
56
  return React.Children.toArray(children).filter((child) => {
52
- if (typeof child !== "object") throw new Error("Child must be ReactElement");
53
- if (!("key" in child) || !child.key || keysCheck.has(child.key)) throw new Error("Each child element must have unique key");
57
+ if (typeof child !== "object") {
58
+ throw new Error("Child must be ReactElement");
59
+ }
60
+ if (!("key" in child) || !child.key || keysCheck.has(child.key)) {
61
+ throw new Error("Each child element must have unique key");
62
+ }
54
63
  keysCheck.add(child.key);
55
64
  return true;
56
65
  });