@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
@@ -28,7 +28,7 @@ const Circle = ({
28
28
  height: circleWidth,
29
29
  circle: true,
30
30
  wrapper: CircleWrapper
31
- });
31
+ }, index);
32
32
  })
33
33
  });
34
34
  };
@@ -32,7 +32,7 @@ const Square = ({
32
32
  height,
33
33
  borderRadius,
34
34
  wrapper: Square_style.SquareWrapper
35
- });
35
+ }, index$1);
36
36
  })
37
37
  });
38
38
  };
@@ -30,7 +30,7 @@ const Square = ({
30
30
  height,
31
31
  borderRadius,
32
32
  wrapper: SquareWrapper
33
- });
33
+ }, index);
34
34
  })
35
35
  });
36
36
  };
@@ -15,7 +15,9 @@ const Compose = ({
15
15
  setValue,
16
16
  disabled
17
17
  } = Slider_context.useSliderContext();
18
- if (offset === void 0) return null;
18
+ if (offset === void 0) {
19
+ return null;
20
+ }
19
21
  const handleClick = () => {
20
22
  if (clickable && !disabled) {
21
23
  setValue([value]);
@@ -13,7 +13,9 @@ const Compose = ({
13
13
  setValue,
14
14
  disabled
15
15
  } = useSliderContext();
16
- if (offset === void 0) return null;
16
+ if (offset === void 0) {
17
+ return null;
18
+ }
17
19
  const handleClick = () => {
18
20
  if (clickable && !disabled) {
19
21
  setValue([value]);
@@ -14,7 +14,9 @@ const Compose = ({
14
14
  disabled
15
15
  } = Slider_context.useSliderContext();
16
16
  const offset = useOffset.useOffset(value);
17
- if (offset === void 0) return null;
17
+ if (offset === void 0) {
18
+ return null;
19
+ }
18
20
  const isInRange = sliderValue[0] >= value;
19
21
  return jsxRuntime.jsxRuntimeExports.jsx(Compose_style.SliderMarkCompose, {
20
22
  "$offset": offset,
@@ -12,7 +12,9 @@ const Compose = ({
12
12
  disabled
13
13
  } = useSliderContext();
14
14
  const offset = useOffset(value);
15
- if (offset === void 0) return null;
15
+ if (offset === void 0) {
16
+ return null;
17
+ }
16
18
  const isInRange = sliderValue[0] >= value;
17
19
  return jsxRuntimeExports.jsx(SliderMarkCompose, {
18
20
  "$offset": offset,
@@ -6,7 +6,9 @@ const useOffset = (value) => {
6
6
  min,
7
7
  max
8
8
  } = Slider_context.useSliderContext();
9
- if (min > value || value > max) return void 0;
9
+ if (min > value || value > max) {
10
+ return void 0;
11
+ }
10
12
  const range = max - min;
11
13
  return range > 0 ? (value - min) / range * 100 : 0;
12
14
  };
@@ -4,7 +4,9 @@ const useOffset = (value) => {
4
4
  min,
5
5
  max
6
6
  } = useSliderContext();
7
- if (min > value || value > max) return void 0;
7
+ if (min > value || value > max) {
8
+ return void 0;
9
+ }
8
10
  const range = max - min;
9
11
  return range > 0 ? (value - min) / range * 100 : 0;
10
12
  };
@@ -1,21 +1,30 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const jsxRuntime = require("../node_modules/react/jsx-runtime.cjs");
4
+ const React = require("react");
4
5
  const Step = require("./components/Step/Step.cjs");
5
6
  const Compose = require("./components/Compose/Compose.cjs");
7
+ const Stepper_utils = require("./Stepper.utils.cjs");
6
8
  const Stepper = Object.assign(({
7
9
  steps,
8
10
  ...restProps
9
11
  }) => {
12
+ const {
13
+ currentStep = -1
14
+ } = restProps;
10
15
  return jsxRuntime.jsxRuntimeExports.jsx(Stepper.Compose, {
11
16
  ...restProps,
12
17
  children: steps.map((step, idx) => (
13
18
  // eslint-disable-next-line react/no-array-index-key
14
- jsxRuntime.jsxRuntimeExports.jsxs(Step.default.Compose, {
15
- children: [jsxRuntime.jsxRuntimeExports.jsx(Step.default.Icon, {
16
- children: step.icon
17
- }), jsxRuntime.jsxRuntimeExports.jsx(Step.default.Label, {
18
- children: step.label
19
+ jsxRuntime.jsxRuntimeExports.jsxs(React.Fragment, {
20
+ children: [idx > 0 && jsxRuntime.jsxRuntimeExports.jsx(Step.default.Separator, {
21
+ state: Stepper_utils.getStepState(idx, currentStep)
22
+ }), jsxRuntime.jsxRuntimeExports.jsxs(Step.default.Compose, {
23
+ children: [jsxRuntime.jsxRuntimeExports.jsx(Step.default.Icon, {
24
+ children: step.icon
25
+ }), jsxRuntime.jsxRuntimeExports.jsx(Step.default.Label, {
26
+ children: step.label
27
+ })]
19
28
  })]
20
29
  }, idx)
21
30
  ))
@@ -4,6 +4,7 @@ declare const Stepper: (({ steps, ...restProps }: StepperProps) => import("react
4
4
  Compose: ({ onClick, ...restProps }: import("./components/Step/components/Compose/Compose.types").ComposeProps) => import("react/jsx-runtime").JSX.Element | null;
5
5
  Icon: ({ children, ...restProps }: import("./components/Step/components/Icon/Icon.types").IconProps) => import("react/jsx-runtime").JSX.Element;
6
6
  Label: ({ children, ...restProps }: import("./components/Step/components/Label/Label.types").LabelProps) => import("react/jsx-runtime").JSX.Element | null;
7
+ Separator: ({ state, ...restProps }: import("./components/Step/components/Separator/Separator.types").SeparatorProps) => import("react/jsx-runtime").JSX.Element;
7
8
  useStepContext: () => import(".").StepperStepContextType;
8
9
  };
9
10
  Compose: (({ currentStep, getIsStepInteractive, onStepChange, onKeyDown, ...restProps }: import("./components/Compose/Compose.types").StepperComposeProps) => import("react/jsx-runtime").JSX.Element) & {
@@ -11,6 +12,7 @@ declare const Stepper: (({ steps, ...restProps }: StepperProps) => import("react
11
12
  Compose: ({ onClick, ...restProps }: import("./components/Step/components/Compose/Compose.types").ComposeProps) => import("react/jsx-runtime").JSX.Element | null;
12
13
  Icon: ({ children, ...restProps }: import("./components/Step/components/Icon/Icon.types").IconProps) => import("react/jsx-runtime").JSX.Element;
13
14
  Label: ({ children, ...restProps }: import("./components/Step/components/Label/Label.types").LabelProps) => import("react/jsx-runtime").JSX.Element | null;
15
+ Separator: ({ state, ...restProps }: import("./components/Step/components/Separator/Separator.types").SeparatorProps) => import("react/jsx-runtime").JSX.Element;
14
16
  useStepContext: () => import(".").StepperStepContextType;
15
17
  };
16
18
  };
@@ -1,19 +1,28 @@
1
1
  import { j as jsxRuntimeExports } from "../node_modules/react/jsx-runtime.js";
2
+ import { Fragment } from "react";
2
3
  import Step from "./components/Step/Step.js";
3
4
  import StepperCompose from "./components/Compose/Compose.js";
5
+ import { getStepState } from "./Stepper.utils.js";
4
6
  const Stepper = Object.assign(({
5
7
  steps,
6
8
  ...restProps
7
9
  }) => {
10
+ const {
11
+ currentStep = -1
12
+ } = restProps;
8
13
  return jsxRuntimeExports.jsx(Stepper.Compose, {
9
14
  ...restProps,
10
15
  children: steps.map((step, idx) => (
11
16
  // eslint-disable-next-line react/no-array-index-key
12
- jsxRuntimeExports.jsxs(Step.Compose, {
13
- children: [jsxRuntimeExports.jsx(Step.Icon, {
14
- children: step.icon
15
- }), jsxRuntimeExports.jsx(Step.Label, {
16
- children: step.label
17
+ jsxRuntimeExports.jsxs(Fragment, {
18
+ children: [idx > 0 && jsxRuntimeExports.jsx(Step.Separator, {
19
+ state: getStepState(idx, currentStep)
20
+ }), jsxRuntimeExports.jsxs(Step.Compose, {
21
+ children: [jsxRuntimeExports.jsx(Step.Icon, {
22
+ children: step.icon
23
+ }), jsxRuntimeExports.jsx(Step.Label, {
24
+ children: step.label
25
+ })]
17
26
  })]
18
27
  }, idx)
19
28
  ))
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const getStepState = (idx, currentStep) => {
4
+ if (idx < currentStep) {
5
+ return "completed";
6
+ }
7
+ if (idx === currentStep) {
8
+ return "focused";
9
+ }
10
+ return "idle";
11
+ };
12
+ exports.getStepState = getStepState;
@@ -0,0 +1,2 @@
1
+ import { StepperStepStateType } from './components/Step/Step.types';
2
+ export declare const getStepState: (idx: number, currentStep: number) => StepperStepStateType;
@@ -0,0 +1,12 @@
1
+ const getStepState = (idx, currentStep) => {
2
+ if (idx < currentStep) {
3
+ return "completed";
4
+ }
5
+ if (idx === currentStep) {
6
+ return "focused";
7
+ }
8
+ return "idle";
9
+ };
10
+ export {
11
+ getStepState
12
+ };
@@ -4,6 +4,7 @@ declare const StepperCompose: (({ currentStep, getIsStepInteractive, onStepChang
4
4
  Compose: ({ onClick, ...restProps }: import("../Step/components/Compose/Compose.types").ComposeProps) => import("react/jsx-runtime").JSX.Element | null;
5
5
  Icon: ({ children, ...restProps }: import("../Step/components/Icon/Icon.types").IconProps) => import("react/jsx-runtime").JSX.Element;
6
6
  Label: ({ children, ...restProps }: import("../Step/components/Label/Label.types").LabelProps) => import("react/jsx-runtime").JSX.Element | null;
7
+ Separator: ({ state, ...restProps }: import("../Step/components/Separator/Separator.types").SeparatorProps) => import("react/jsx-runtime").JSX.Element;
7
8
  useStepContext: () => import("../..").StepperStepContextType;
8
9
  };
9
10
  };
@@ -4,6 +4,7 @@ const jsxRuntime = require("../../../node_modules/react/jsx-runtime.cjs");
4
4
  const Compose = require("./components/Compose/Compose.cjs");
5
5
  const Icon = require("./components/Icon/Icon.cjs");
6
6
  const Label = require("./components/Label/Label.cjs");
7
+ const Separator = require("./components/Separator/Separator.cjs");
7
8
  const Step_context = require("./Step.context.cjs");
8
9
  const Step = Object.assign(({
9
10
  children,
@@ -17,6 +18,7 @@ const Step = Object.assign(({
17
18
  Compose: Compose.default,
18
19
  Icon: Icon.default,
19
20
  Label: Label.default,
21
+ Separator: Separator.default,
20
22
  useStepContext: Step_context.useStepContext
21
23
  });
22
24
  exports.default = Step;
@@ -3,6 +3,7 @@ declare const Step: (({ children, ...restProps }: StepperStepProps) => import("r
3
3
  Compose: ({ onClick, ...restProps }: import("./components/Compose/Compose.types").ComposeProps) => import("react/jsx-runtime").JSX.Element | null;
4
4
  Icon: ({ children, ...restProps }: import("./components/Icon/Icon.types").IconProps) => import("react/jsx-runtime").JSX.Element;
5
5
  Label: ({ children, ...restProps }: import("./components/Label/Label.types").LabelProps) => import("react/jsx-runtime").JSX.Element | null;
6
+ Separator: ({ state, ...restProps }: import("./components/Separator/Separator.types").SeparatorProps) => import("react/jsx-runtime").JSX.Element;
6
7
  useStepContext: () => import("./Step.types").StepperStepContextType;
7
8
  };
8
9
  export default Step;
@@ -2,6 +2,7 @@ import { j as jsxRuntimeExports } from "../../../node_modules/react/jsx-runtime.
2
2
  import Compose from "./components/Compose/Compose.js";
3
3
  import Icon from "./components/Icon/Icon.js";
4
4
  import Label from "./components/Label/Label.js";
5
+ import Separator from "./components/Separator/Separator.js";
5
6
  import { useStepContext } from "./Step.context.js";
6
7
  const Step = Object.assign(({
7
8
  children,
@@ -15,6 +16,7 @@ const Step = Object.assign(({
15
16
  Compose,
16
17
  Icon,
17
18
  Label,
19
+ Separator,
18
20
  useStepContext
19
21
  });
20
22
  export {
@@ -3,11 +3,11 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
3
3
  const jsxRuntime = require("../../../../../node_modules/react/jsx-runtime.cjs");
4
4
  const React = require("react");
5
5
  const Step_context = require("../../Step.context.cjs");
6
- const Step_types = require("../../Step.types.cjs");
7
6
  const useStepRegistration = require("../../../../hooks/useStepRegistration.cjs");
8
7
  const Stepper_context = require("../../../../Stepper.context.cjs");
9
8
  const Compose_style = require("./Compose.style.cjs");
10
9
  const useStepperInteractive = require("../../../../hooks/useStepperInteractive.cjs");
10
+ const Stepper_utils = require("../../../../Stepper.utils.cjs");
11
11
  const Compose = ({
12
12
  onClick,
13
13
  ...restProps
@@ -20,19 +20,14 @@ const Compose = ({
20
20
  const {
21
21
  stepIndex
22
22
  } = useStepRegistration.useStepRegistration();
23
- let state = Step_types.StepperStepState.IDLE;
24
- if (stepIndex >= 0) {
25
- if (stepIndex < currentStep) {
26
- state = Step_types.StepperStepState.COMPLETED;
27
- } else if (stepIndex === currentStep) {
28
- state = Step_types.StepperStepState.FOCUSED;
29
- }
30
- }
23
+ const state = stepIndex >= 0 ? Stepper_utils.getStepState(stepIndex, currentStep) : "idle";
31
24
  const contextValue = React.useMemo(() => ({
32
25
  state,
33
26
  index: stepIndex
34
27
  }), [state, stepIndex]);
35
- if (stepIndex < 0) return null;
28
+ if (stepIndex < 0) {
29
+ return null;
30
+ }
36
31
  const interactiveProps = useStepperInteractive.getInteractiveStepProps({
37
32
  onStepChange,
38
33
  getIsStepInteractive,
@@ -1,11 +1,11 @@
1
1
  import { j as jsxRuntimeExports } from "../../../../../node_modules/react/jsx-runtime.js";
2
2
  import { useMemo } from "react";
3
3
  import { StepContextProvider } from "../../Step.context.js";
4
- import { StepperStepState } from "../../Step.types.js";
5
4
  import { useStepRegistration } from "../../../../hooks/useStepRegistration.js";
6
5
  import { useStepperContext } from "../../../../Stepper.context.js";
7
6
  import { StepCompose } from "./Compose.style.js";
8
7
  import { getInteractiveStepProps } from "../../../../hooks/useStepperInteractive.js";
8
+ import { getStepState } from "../../../../Stepper.utils.js";
9
9
  const Compose = ({
10
10
  onClick,
11
11
  ...restProps
@@ -18,19 +18,14 @@ const Compose = ({
18
18
  const {
19
19
  stepIndex
20
20
  } = useStepRegistration();
21
- let state = StepperStepState.IDLE;
22
- if (stepIndex >= 0) {
23
- if (stepIndex < currentStep) {
24
- state = StepperStepState.COMPLETED;
25
- } else if (stepIndex === currentStep) {
26
- state = StepperStepState.FOCUSED;
27
- }
28
- }
21
+ const state = stepIndex >= 0 ? getStepState(stepIndex, currentStep) : "idle";
29
22
  const contextValue = useMemo(() => ({
30
23
  state,
31
24
  index: stepIndex
32
25
  }), [state, stepIndex]);
33
- if (stepIndex < 0) return null;
26
+ if (stepIndex < 0) {
27
+ return null;
28
+ }
34
29
  const interactiveProps = getInteractiveStepProps({
35
30
  onStepChange,
36
31
  getIsStepInteractive,
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const jsxRuntime = require("../../../../../node_modules/react/jsx-runtime.cjs");
4
+ const Separator_style = require("./Separator.style.cjs");
5
+ const Separator = ({
6
+ state,
7
+ ...restProps
8
+ }) => {
9
+ return jsxRuntime.jsxRuntimeExports.jsx(Separator_style.Separator, {
10
+ ...restProps,
11
+ "data-state": state,
12
+ "aria-hidden": true
13
+ });
14
+ };
15
+ exports.default = Separator;
@@ -0,0 +1,3 @@
1
+ import { SeparatorProps } from './Separator.types';
2
+ declare const Separator: ({ state, ...restProps }: SeparatorProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default Separator;
@@ -0,0 +1,15 @@
1
+ import { j as jsxRuntimeExports } from "../../../../../node_modules/react/jsx-runtime.js";
2
+ import { Separator as Separator$1 } from "./Separator.style.js";
3
+ const Separator = ({
4
+ state,
5
+ ...restProps
6
+ }) => {
7
+ return jsxRuntimeExports.jsx(Separator$1, {
8
+ ...restProps,
9
+ "data-state": state,
10
+ "aria-hidden": true
11
+ });
12
+ };
13
+ export {
14
+ Separator as default
15
+ };
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const _styled = require("styled-components");
4
+ const redisUiStyles = require("@redislabsdev/redis-ui-styles");
5
+ const Step_types = require("../../Step.types.cjs");
6
+ const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
7
+ const _styled__default = /* @__PURE__ */ _interopDefault(_styled);
8
+ const Separator = _styled__default.default.div.withConfig({
9
+ displayName: "Separatorstyle__Separator",
10
+ componentId: "RedisUI__sc-89iwun-0"
11
+ })(["width:1.6rem;height:", ";transition:background-color 0.3s ease;", ""], () => redisUiStyles.useTheme().components.stepper.step.separator.height, () => {
12
+ const {
13
+ states
14
+ } = redisUiStyles.useTheme().components.stepper.step;
15
+ return Object.values(Step_types.StepperStepState).map((state) => {
16
+ const theme = states[state].separator;
17
+ return _styled.css`
18
+ &[data-state='${state}'] {
19
+ background-color: ${theme.bgColor};
20
+ }
21
+ `;
22
+ });
23
+ });
24
+ exports.Separator = Separator;
@@ -0,0 +1 @@
1
+ export declare const Separator: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,22 @@
1
+ import _styled, { css } from "styled-components";
2
+ import { useTheme } from "@redislabsdev/redis-ui-styles";
3
+ import { StepperStepState } from "../../Step.types.js";
4
+ const Separator = _styled.div.withConfig({
5
+ displayName: "Separatorstyle__Separator",
6
+ componentId: "RedisUI__sc-89iwun-0"
7
+ })(["width:1.6rem;height:", ";transition:background-color 0.3s ease;", ""], () => useTheme().components.stepper.step.separator.height, () => {
8
+ const {
9
+ states
10
+ } = useTheme().components.stepper.step;
11
+ return Object.values(StepperStepState).map((state) => {
12
+ const theme = states[state].separator;
13
+ return css`
14
+ &[data-state='${state}'] {
15
+ background-color: ${theme.bgColor};
16
+ }
17
+ `;
18
+ });
19
+ });
20
+ export {
21
+ Separator
22
+ };
@@ -0,0 +1,5 @@
1
+ import { HTMLAttributes } from 'react';
2
+ import { StepperStepStateType } from '../../Step.types';
3
+ export interface SeparatorProps extends HTMLAttributes<HTMLDivElement> {
4
+ state?: StepperStepStateType;
5
+ }
@@ -12,7 +12,9 @@ function useStepperInteractive({
12
12
  }) {
13
13
  const isInteractive = !!onStepChange;
14
14
  const isStepInteractive = React.useCallback((stepIndex) => {
15
- if (!isInteractive) return false;
15
+ if (!isInteractive) {
16
+ return false;
17
+ }
16
18
  if (typeof getIsStepInteractive === "function") {
17
19
  return getIsStepInteractive(stepIndex);
18
20
  }
@@ -21,19 +23,25 @@ function useStepperInteractive({
21
23
  const handleKeyDown = isInteractive ? (event) => {
22
24
  const findNextInteractive = (from, to = totalSteps || 0) => {
23
25
  for (let i = from; i < to; i += 1) {
24
- if (isStepInteractive(i)) return i;
26
+ if (isStepInteractive(i)) {
27
+ return i;
28
+ }
25
29
  }
26
30
  return void 0;
27
31
  };
28
32
  const findPrevInteractive = (from, to = 0) => {
29
33
  for (let i = from; i >= to; i -= 1) {
30
- if (isStepInteractive(i)) return i;
34
+ if (isStepInteractive(i)) {
35
+ return i;
36
+ }
31
37
  }
32
38
  return void 0;
33
39
  };
34
40
  const handleChange = (next) => {
35
41
  event.preventDefault();
36
- if (next !== void 0) onStepChange(next);
42
+ if (next !== void 0) {
43
+ onStepChange(next);
44
+ }
37
45
  };
38
46
  const {
39
47
  key
@@ -10,7 +10,9 @@ function useStepperInteractive({
10
10
  }) {
11
11
  const isInteractive = !!onStepChange;
12
12
  const isStepInteractive = useCallback((stepIndex) => {
13
- if (!isInteractive) return false;
13
+ if (!isInteractive) {
14
+ return false;
15
+ }
14
16
  if (typeof getIsStepInteractive === "function") {
15
17
  return getIsStepInteractive(stepIndex);
16
18
  }
@@ -19,19 +21,25 @@ function useStepperInteractive({
19
21
  const handleKeyDown = isInteractive ? (event) => {
20
22
  const findNextInteractive = (from, to = totalSteps || 0) => {
21
23
  for (let i = from; i < to; i += 1) {
22
- if (isStepInteractive(i)) return i;
24
+ if (isStepInteractive(i)) {
25
+ return i;
26
+ }
23
27
  }
24
28
  return void 0;
25
29
  };
26
30
  const findPrevInteractive = (from, to = 0) => {
27
31
  for (let i = from; i >= to; i -= 1) {
28
- if (isStepInteractive(i)) return i;
32
+ if (isStepInteractive(i)) {
33
+ return i;
34
+ }
29
35
  }
30
36
  return void 0;
31
37
  };
32
38
  const handleChange = (next) => {
33
39
  event.preventDefault();
34
- if (next !== void 0) onStepChange(next);
40
+ if (next !== void 0) {
41
+ onStepChange(next);
42
+ }
35
43
  };
36
44
  const {
37
45
  key
@@ -48,7 +48,9 @@ const Switcher = Object.assign(({
48
48
  userCanChangeRef.current = false;
49
49
  };
50
50
  handleKeyDown = (e) => {
51
- if ((e.code === "Space" || e.code === "Enter") && !e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey) userCanChangeRef.current = true;
51
+ if ((e.code === "Space" || e.code === "Enter") && !e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey) {
52
+ userCanChangeRef.current = true;
53
+ }
52
54
  };
53
55
  }
54
56
  return jsxRuntime.jsxRuntimeExports.jsx(Switcher.Compose, {
@@ -46,7 +46,9 @@ const Switcher = Object.assign(({
46
46
  userCanChangeRef.current = false;
47
47
  };
48
48
  handleKeyDown = (e) => {
49
- if ((e.code === "Space" || e.code === "Enter") && !e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey) userCanChangeRef.current = true;
49
+ if ((e.code === "Space" || e.code === "Enter") && !e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey) {
50
+ userCanChangeRef.current = true;
51
+ }
50
52
  };
51
53
  }
52
54
  return jsxRuntimeExports.jsx(Switcher.Compose, {
@@ -16,30 +16,53 @@ const getSwitchStatesStyle = (theme, maps, {
16
16
  withCursor,
17
17
  selectorSuffix = ""
18
18
  }) => {
19
- if (!theme) return null;
20
- if (disabled) return _styled.css`
19
+ if (!theme) {
20
+ return null;
21
+ }
22
+ if (disabled) {
23
+ return _styled.css`
21
24
  &&${selectorSuffix} {
22
- ${css_utils.styleFromTokens(maps, theme.disabled)};
25
+ ${css_utils.styleFromTokens({
26
+ tokenMaps: maps,
27
+ tokens: theme.disabled
28
+ })};
23
29
  ${withCursor && `cursor: not-allowed`};
24
30
  }
25
31
  `;
26
- if (readOnly) return _styled.css`
32
+ }
33
+ if (readOnly) {
34
+ return _styled.css`
27
35
  &${selectorSuffix}, &:hover${selectorSuffix}, &:active${selectorSuffix} {
28
- ${css_utils.styleFromTokens(maps, theme.readonly)};
36
+ ${css_utils.styleFromTokens({
37
+ tokenMaps: maps,
38
+ tokens: theme.readonly
39
+ })};
29
40
  ${withCursor && `cursor: default`};
30
41
  }
31
42
  `;
43
+ }
32
44
  return _styled.css`
33
45
  &${selectorSuffix} {
34
- ${css_utils.styleFromTokens(maps, theme.normal)};
46
+ ${css_utils.styleFromTokens({
47
+ tokenMaps: maps,
48
+ tokens: theme.normal
49
+ })};
35
50
  }
36
51
 
37
52
  &:hover${selectorSuffix} {
38
- ${css_utils.styleFromTokens(maps, theme.hover, theme.normal)};
53
+ ${css_utils.styleFromTokens({
54
+ tokenMaps: maps,
55
+ tokens: theme.hover,
56
+ fallbackTokens: theme.normal
57
+ })};
39
58
  }
40
59
 
41
60
  &:active${selectorSuffix} {
42
- ${css_utils.styleFromTokens(maps, theme.active, theme.normal)};
61
+ ${css_utils.styleFromTokens({
62
+ tokenMaps: maps,
63
+ tokens: theme.active,
64
+ fallbackTokens: theme.normal
65
+ })};
43
66
  }
44
67
  `;
45
68
  };