@redis-ui/components 42.7.0 → 43.0.2

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 (197) 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/Breadcrumbs/Breadcrumbs.cjs +51 -0
  13. package/dist/Breadcrumbs/Breadcrumbs.d.ts +10 -0
  14. package/dist/Breadcrumbs/Breadcrumbs.js +51 -0
  15. package/dist/Breadcrumbs/Breadcrumbs.types.d.ts +17 -0
  16. package/dist/Breadcrumbs/components/Compose/Compose.cjs +14 -0
  17. package/dist/Breadcrumbs/components/Compose/Compose.d.ts +3 -0
  18. package/dist/Breadcrumbs/components/Compose/Compose.js +14 -0
  19. package/dist/Breadcrumbs/components/Compose/Compose.style.cjs +10 -0
  20. package/dist/Breadcrumbs/components/Compose/Compose.style.d.ts +1 -0
  21. package/dist/Breadcrumbs/components/Compose/Compose.style.js +8 -0
  22. package/dist/Breadcrumbs/components/Compose/Compose.types.d.ts +5 -0
  23. package/dist/Breadcrumbs/components/Current/Current.cjs +13 -0
  24. package/dist/Breadcrumbs/components/Current/Current.d.ts +3 -0
  25. package/dist/Breadcrumbs/components/Current/Current.js +13 -0
  26. package/dist/Breadcrumbs/components/Current/Current.style.cjs +11 -0
  27. package/dist/Breadcrumbs/components/Current/Current.style.d.ts +1 -0
  28. package/dist/Breadcrumbs/components/Current/Current.style.js +9 -0
  29. package/dist/Breadcrumbs/components/Current/Current.types.d.ts +4 -0
  30. package/dist/Breadcrumbs/components/Item/Item.cjs +12 -0
  31. package/dist/Breadcrumbs/components/Item/Item.d.ts +3 -0
  32. package/dist/Breadcrumbs/components/Item/Item.js +12 -0
  33. package/dist/Breadcrumbs/components/Item/Item.style.cjs +11 -0
  34. package/dist/Breadcrumbs/components/Item/Item.style.d.ts +1 -0
  35. package/dist/Breadcrumbs/components/Item/Item.style.js +9 -0
  36. package/dist/Breadcrumbs/components/Item/Item.types.d.ts +2 -0
  37. package/dist/Breadcrumbs/components/Link/Link.cjs +52 -0
  38. package/dist/Breadcrumbs/components/Link/Link.d.ts +3 -0
  39. package/dist/Breadcrumbs/components/Link/Link.js +52 -0
  40. package/dist/Breadcrumbs/components/Link/Link.style.cjs +13 -0
  41. package/dist/Breadcrumbs/components/Link/Link.style.d.ts +1 -0
  42. package/dist/Breadcrumbs/components/Link/Link.style.js +11 -0
  43. package/dist/Breadcrumbs/components/Link/Link.types.d.ts +5 -0
  44. package/dist/Breadcrumbs/components/List/List.cjs +12 -0
  45. package/dist/Breadcrumbs/components/List/List.d.ts +3 -0
  46. package/dist/Breadcrumbs/components/List/List.js +12 -0
  47. package/dist/Breadcrumbs/components/List/List.style.cjs +11 -0
  48. package/dist/Breadcrumbs/components/List/List.style.d.ts +1 -0
  49. package/dist/Breadcrumbs/components/List/List.style.js +9 -0
  50. package/dist/Breadcrumbs/components/List/List.types.d.ts +2 -0
  51. package/dist/Breadcrumbs/components/Separator/Separator.cjs +13 -0
  52. package/dist/Breadcrumbs/components/Separator/Separator.d.ts +3 -0
  53. package/dist/Breadcrumbs/components/Separator/Separator.js +13 -0
  54. package/dist/Breadcrumbs/components/Separator/Separator.style.cjs +11 -0
  55. package/dist/Breadcrumbs/components/Separator/Separator.style.d.ts +1 -0
  56. package/dist/Breadcrumbs/components/Separator/Separator.style.js +9 -0
  57. package/dist/Breadcrumbs/components/Separator/Separator.types.d.ts +4 -0
  58. package/dist/Breadcrumbs/index.d.ts +5 -0
  59. package/dist/Button/Button.style.cjs +4 -1
  60. package/dist/Button/Button.style.js +4 -1
  61. package/dist/Button/Button.style.utils.cjs +16 -1
  62. package/dist/Button/Button.style.utils.js +16 -1
  63. package/dist/Button/Button.types.cjs +1 -1
  64. package/dist/Button/Button.types.d.ts +1 -1
  65. package/dist/Button/Button.types.js +1 -1
  66. package/dist/Button/CopyToClipboardButton/CopyToClipboardButton.cjs +59 -0
  67. package/dist/Button/CopyToClipboardButton/CopyToClipboardButton.d.ts +4 -0
  68. package/dist/Button/CopyToClipboardButton/CopyToClipboardButton.js +57 -0
  69. package/dist/Button/CopyToClipboardButton/CopyToClipboardButton.style.cjs +40 -0
  70. package/dist/Button/CopyToClipboardButton/CopyToClipboardButton.style.d.ts +8 -0
  71. package/dist/Button/CopyToClipboardButton/CopyToClipboardButton.style.js +38 -0
  72. package/dist/Button/CopyToClipboardButton/CopyToClipboardButton.types.d.ts +5 -0
  73. package/dist/Button/TextButton/TextButton.style.cjs +4 -1
  74. package/dist/Button/TextButton/TextButton.style.js +4 -1
  75. package/dist/Button/TextButton/TextButton.types.cjs +1 -1
  76. package/dist/Button/TextButton/TextButton.types.d.ts +1 -1
  77. package/dist/Button/TextButton/TextButton.types.js +1 -1
  78. package/dist/Button/index.d.ts +2 -0
  79. package/dist/Checkbox/components/Label/Label.style.cjs +15 -3
  80. package/dist/Checkbox/components/Label/Label.style.js +15 -3
  81. package/dist/Chip/components/CloseButton/CloseButton.cjs +3 -1
  82. package/dist/Chip/components/CloseButton/CloseButton.js +3 -1
  83. package/dist/Chip/components/Compose/Compose.style.cjs +4 -1
  84. package/dist/Chip/components/Compose/Compose.style.js +4 -1
  85. package/dist/Drawer/components/Description/Description.cjs +3 -1
  86. package/dist/Drawer/components/Description/Description.js +3 -1
  87. package/dist/Helpers/contexts/Popper/PopperCollisionBoundaryManager.cjs +3 -1
  88. package/dist/Helpers/contexts/Popper/PopperCollisionBoundaryManager.js +3 -1
  89. package/dist/Helpers/contexts/PrimitiveContextState.cjs +28 -16
  90. package/dist/Helpers/contexts/PrimitiveContextState.js +28 -16
  91. package/dist/Helpers/contexts/SharedId.context.cjs +9 -5
  92. package/dist/Helpers/contexts/SharedId.context.js +9 -5
  93. package/dist/Helpers/css.utils.cjs +18 -4
  94. package/dist/Helpers/css.utils.d.ts +15 -3
  95. package/dist/Helpers/css.utils.js +18 -4
  96. package/dist/Helpers/hooks/useScrollable.cjs +3 -1
  97. package/dist/Helpers/hooks/useScrollable.js +3 -1
  98. package/dist/Helpers/react.utils.cjs +6 -2
  99. package/dist/Helpers/react.utils.js +6 -2
  100. package/dist/Inputs/QuantityCounter/components/InputGroup/components/ValueLabel/ValueLabel.cjs +9 -5
  101. package/dist/Inputs/QuantityCounter/components/InputGroup/components/ValueLabel/ValueLabel.js +9 -5
  102. package/dist/Inputs/components/Compose/Compose.style.cjs +29 -6
  103. package/dist/Inputs/components/Compose/Compose.style.js +29 -6
  104. package/dist/Inputs/hooks/numericInput/numericInput.utils.cjs +12 -4
  105. package/dist/Inputs/hooks/numericInput/numericInput.utils.js +12 -4
  106. package/dist/Inputs/hooks/numericInput/useNumericInput.cjs +15 -3
  107. package/dist/Inputs/hooks/numericInput/useNumericInput.js +15 -3
  108. package/dist/Loader/Loader.cjs +1 -0
  109. package/dist/Loader/Loader.js +1 -0
  110. package/dist/Menu/components/Content/components/Item/Components/Compose/Compose.style.cjs +19 -4
  111. package/dist/Menu/components/Content/components/Item/Components/Compose/Compose.style.js +19 -4
  112. package/dist/Menu/components/Content/components/Label/components/Compose/Compose.style.cjs +4 -1
  113. package/dist/Menu/components/Content/components/Label/components/Compose/Compose.style.js +4 -1
  114. package/dist/Modal/components/Content/components/Compose/Compose.cjs +3 -1
  115. package/dist/Modal/components/Content/components/Compose/Compose.js +3 -1
  116. package/dist/Modal/components/Content/components/Description/Description.cjs +3 -1
  117. package/dist/Modal/components/Content/components/Description/Description.js +3 -1
  118. package/dist/MultiSelect/components/Compose/hooks/useMultiSelectContextApi.cjs +3 -1
  119. package/dist/MultiSelect/components/Compose/hooks/useMultiSelectContextApi.js +3 -1
  120. package/dist/MultiSelect/components/Trigger/components/MultiValue/MultiValue.cjs +3 -1
  121. package/dist/MultiSelect/components/Trigger/components/MultiValue/MultiValue.js +3 -1
  122. package/dist/Overflow/Overflow.cjs +3 -1
  123. package/dist/Overflow/Overflow.js +3 -1
  124. package/dist/Overflow/Overflow.utils.cjs +15 -6
  125. package/dist/Overflow/Overflow.utils.js +15 -6
  126. package/dist/Overflow/components/OverflowContainer/OverflowContainer.cjs +3 -1
  127. package/dist/Overflow/components/OverflowContainer/OverflowContainer.js +3 -1
  128. package/dist/Pagination/components/PageSizeSelect.cjs +3 -1
  129. package/dist/Pagination/components/PageSizeSelect.js +3 -1
  130. package/dist/Popover/components/Content/Content.cjs +3 -1
  131. package/dist/Popover/components/Content/Content.js +3 -1
  132. package/dist/Popover/components/Content/components/Footer/Footer.cjs +3 -1
  133. package/dist/Popover/components/Content/components/Footer/Footer.js +3 -1
  134. package/dist/RadioGroup/components/Item/components/Label/Label.style.cjs +15 -3
  135. package/dist/RadioGroup/components/Item/components/Label/Label.style.js +15 -3
  136. package/dist/ScreenReaderAnnounce/ScreenReaderAnnounce.cjs +3 -1
  137. package/dist/ScreenReaderAnnounce/ScreenReaderAnnounce.js +3 -1
  138. package/dist/Section/components/Header/components/CollapseButton/CollapseButton.cjs +3 -1
  139. package/dist/Section/components/Header/components/CollapseButton/CollapseButton.js +3 -1
  140. package/dist/Select/components/Content/components/Option/components/Compose/Compose.style.cjs +16 -4
  141. package/dist/Select/components/Content/components/Option/components/Compose/Compose.style.js +16 -4
  142. package/dist/Select/components/Content/components/OptionList/OptionList.cjs +6 -4
  143. package/dist/Select/components/Content/components/OptionList/OptionList.js +6 -4
  144. package/dist/Select/components/Content/components/OptionList/Virtual.cjs +9 -5
  145. package/dist/Select/components/Content/components/OptionList/Virtual.js +9 -5
  146. package/dist/Select/components/Context/hooks/useSearch.cjs +3 -1
  147. package/dist/Select/components/Context/hooks/useSearch.js +3 -1
  148. package/dist/Select/components/Trigger/components/Compose/Compose.style.cjs +33 -7
  149. package/dist/Select/components/Trigger/components/Compose/Compose.style.js +33 -7
  150. package/dist/SideBar/components/Item/Item.style.cjs +14 -3
  151. package/dist/SideBar/components/Item/Item.style.js +14 -3
  152. package/dist/Skeleton/components/Circle/Circle.cjs +1 -1
  153. package/dist/Skeleton/components/Circle/Circle.js +1 -1
  154. package/dist/Skeleton/components/Square/Square.cjs +1 -1
  155. package/dist/Skeleton/components/Square/Square.js +1 -1
  156. package/dist/Slider/components/Label/Compose/Compose.cjs +3 -1
  157. package/dist/Slider/components/Label/Compose/Compose.js +3 -1
  158. package/dist/Slider/components/Mark/Compose/Compose.cjs +3 -1
  159. package/dist/Slider/components/Mark/Compose/Compose.js +3 -1
  160. package/dist/Slider/hooks/useOffset.cjs +3 -1
  161. package/dist/Slider/hooks/useOffset.js +3 -1
  162. package/dist/Stepper/components/Step/components/Compose/Compose.cjs +3 -1
  163. package/dist/Stepper/components/Step/components/Compose/Compose.js +3 -1
  164. package/dist/Stepper/hooks/useStepperInteractive.cjs +12 -4
  165. package/dist/Stepper/hooks/useStepperInteractive.js +12 -4
  166. package/dist/Switch/components/Switcher/Switcher.cjs +3 -1
  167. package/dist/Switch/components/Switcher/Switcher.js +3 -1
  168. package/dist/Switch/components/Switcher/Switcher.style.cjs +31 -8
  169. package/dist/Switch/components/Switcher/Switcher.style.js +31 -8
  170. package/dist/Tabs/components/TabBar/components/Trigger/components/Marker/Marker.style.cjs +24 -5
  171. package/dist/Tabs/components/TabBar/components/Trigger/components/Marker/Marker.style.js +24 -5
  172. package/dist/Tabs/components/TabBar/components/Trigger/components/Tab/Tab.style.cjs +24 -5
  173. package/dist/Tabs/components/TabBar/components/Trigger/components/Tab/Tab.style.js +24 -5
  174. package/dist/ThemeModeSwitch/useThemeModeSwitch.cjs +6 -2
  175. package/dist/ThemeModeSwitch/useThemeModeSwitch.js +6 -2
  176. package/dist/Toast/core/content.helper.cjs +8 -4
  177. package/dist/Toast/core/content.helper.js +8 -4
  178. package/dist/Tooltip/components/Content/Content.cjs +3 -1
  179. package/dist/Tooltip/components/Content/Content.js +3 -1
  180. package/dist/TreeView/TreeView.cjs +3 -1
  181. package/dist/TreeView/TreeView.js +3 -1
  182. package/dist/TreeView/components/TreeItem/components/Compose/Compose.cjs +6 -4
  183. package/dist/TreeView/components/TreeItem/components/Compose/Compose.js +6 -4
  184. package/dist/Typography/Typography.types.cjs +4 -0
  185. package/dist/Typography/Typography.types.d.ts +2 -1
  186. package/dist/Typography/Typography.types.js +4 -0
  187. package/dist/index.cjs +6 -0
  188. package/dist/index.d.ts +1 -0
  189. package/dist/index.js +110 -104
  190. package/package.json +10 -9
  191. package/skills/redis-ui-components/SKILL.md +128 -0
  192. package/skills/redis-ui-components/references/Button.md +169 -0
  193. package/skills/redis-ui-components/references/FlexDivider.md +152 -0
  194. package/skills/redis-ui-components/references/FlexGroup.md +149 -0
  195. package/skills/redis-ui-components/references/FlexItem.md +58 -0
  196. package/skills/redis-ui-components/references/FlexSplit.md +37 -0
  197. package/skills/redis-ui-components/references/Select.md +517 -0
@@ -0,0 +1,169 @@
1
+ # Button
2
+
3
+ A standard button component supporting multiple variants, sizes, and optional icons. It forwards refs and provides a `Button.Icon` sub-component for embedding icons that automatically match the button's size and color.
4
+
5
+ ## Import
6
+ ```tsx
7
+ import { Button } from '@redislabsdev/redis-ui-components';
8
+ ```
9
+
10
+ ## Props
11
+ | Prop | Type | Default | Description |
12
+ |------|------|---------|-------------|
13
+ | size | `'large' \| 'medium' \| 'small'` | `'medium'` | The size of the button |
14
+ | variant | `'primary' \| 'destructive' \| 'secondary-fill' \| 'secondary-invert' \| 'secondary-ghost' \| 'upsell' \| 'upsell-invert' \| 'upsell-ghost'` | `'primary'` | The visual style variant of the button |
15
+ | disabled | `boolean` | `false` | Whether the button is disabled |
16
+ | onClick | `(e: React.MouseEvent<HTMLButtonElement>) => void` | - | Click event handler |
17
+ | theme | `Theme` | - | Theme override from `@redislabsdev/redis-ui-styles` |
18
+ | children | `React.ReactNode` | - | Button content (inherited from `ButtonHTMLAttributes`) |
19
+
20
+ The component also extends all native `ButtonHTMLAttributes<HTMLButtonElement>` props.
21
+
22
+ ## Sub-components
23
+
24
+ - **`Button.Icon`** - Renders an icon inside the button, automatically sized and colored to match the parent button.
25
+
26
+ ### Button.Icon Props
27
+ | Prop | Type | Default | Description |
28
+ |------|------|---------|-------------|
29
+ | icon | `IconType` | *required* | The icon component from `@redislabsdev/redis-ui-icons` |
30
+ | customSize | `string` | - | Override the automatic icon size (e.g. `'2.8rem'`) |
31
+ | title | `string` | - | Title attribute for the icon container |
32
+
33
+ ## Examples
34
+
35
+ ### Playground
36
+ ```tsx
37
+ import { Button } from '@redislabsdev/redis-ui-components';
38
+
39
+ <Button variant="primary" size="medium" disabled={false}>
40
+ Button
41
+ </Button>
42
+ ```
43
+
44
+ ### Sizes
45
+ > 3 sizes are supported with `medium` being the default.
46
+ ```tsx
47
+ import { Button } from '@redislabsdev/redis-ui-components';
48
+ import { EditIcon } from '@redislabsdev/redis-ui-icons';
49
+
50
+ <>
51
+ <Button size="small">
52
+ <Button.Icon icon={EditIcon} />
53
+ Small
54
+ </Button>
55
+ <Button size="medium">
56
+ <Button.Icon icon={EditIcon} />
57
+ Medium
58
+ </Button>
59
+ <Button size="large">
60
+ <Button.Icon icon={EditIcon} />
61
+ Large
62
+ </Button>
63
+ </>
64
+ ```
65
+
66
+ ### Variants
67
+ > 8 total variants are supported, 1 primary, 3 secondary, a destructive variant, and 3 upsell variants. The default is `primary`.
68
+ ```tsx
69
+ import { Button } from '@redislabsdev/redis-ui-components';
70
+ import { CancelIcon } from '@redislabsdev/redis-ui-icons';
71
+
72
+ <>
73
+ <Button variant="primary">
74
+ Primary
75
+ <Button.Icon icon={CancelIcon} />
76
+ </Button>
77
+ <Button variant="secondary-fill">
78
+ Secondary Fill
79
+ <Button.Icon icon={CancelIcon} />
80
+ </Button>
81
+ <Button variant="secondary-invert">
82
+ Secondary Invert
83
+ <Button.Icon icon={CancelIcon} />
84
+ </Button>
85
+ <Button variant="secondary-ghost">
86
+ Secondary Ghost
87
+ <Button.Icon icon={CancelIcon} />
88
+ </Button>
89
+ <Button variant="destructive">
90
+ Destructive
91
+ <Button.Icon icon={CancelIcon} />
92
+ </Button>
93
+ <Button variant="upsell">
94
+ Upsell
95
+ <Button.Icon icon={CancelIcon} />
96
+ </Button>
97
+ <Button variant="upsell-invert">
98
+ Upsell Invert
99
+ <Button.Icon icon={CancelIcon} />
100
+ </Button>
101
+ <Button variant="upsell-ghost">
102
+ Upsell Ghost
103
+ <Button.Icon icon={CancelIcon} />
104
+ </Button>
105
+ </>
106
+ ```
107
+
108
+ ### Disabled
109
+ > Buttons can be disabled by setting the `disabled` prop to `true`. This will disable any hover styles and prevent click events from firing.
110
+ ```tsx
111
+ import { Button } from '@redislabsdev/redis-ui-components';
112
+ import { CancelIcon } from '@redislabsdev/redis-ui-icons';
113
+
114
+ <>
115
+ <Button disabled>
116
+ Primary
117
+ <Button.Icon icon={CancelIcon} />
118
+ </Button>
119
+ <Button disabled variant="secondary-fill">
120
+ Secondary Fill
121
+ <Button.Icon icon={CancelIcon} />
122
+ </Button>
123
+ <Button disabled variant="secondary-invert">
124
+ Secondary Invert
125
+ <Button.Icon icon={CancelIcon} />
126
+ </Button>
127
+ <Button disabled variant="secondary-ghost">
128
+ Secondary Ghost
129
+ </Button>
130
+ <Button disabled variant="destructive">
131
+ Destructive
132
+ <Button.Icon icon={CancelIcon} />
133
+ </Button>
134
+ </>
135
+ ```
136
+
137
+ ### WithIcon
138
+ > To add an icon to a button, use the `Button.Icon` component. This component can be placed anywhere inside the `Button` component. It will automatically be sized and colored to match its parent button.
139
+ >
140
+ > Do not use this component if you need a round icon-only button. Instead, use the IconButton or ActionIconButton components.
141
+ ```tsx
142
+ import { Button } from '@redislabsdev/redis-ui-components';
143
+ import { ContractIcon, MarketplaceIcon, ShardIcon } from '@redislabsdev/redis-ui-icons';
144
+
145
+ <>
146
+ <Button>
147
+ <Button.Icon icon={ContractIcon} />
148
+ Left Icon
149
+ </Button>
150
+ <Button>
151
+ Right Icon
152
+ <Button.Icon icon={MarketplaceIcon} />
153
+ </Button>
154
+ <Button>
155
+ <Button.Icon icon={ShardIcon} />
156
+ </Button>
157
+ <Button>
158
+ <Button.Icon icon={ShardIcon} customSize="2.8rem" />
159
+ Custom icon size
160
+ </Button>
161
+ </>
162
+ ```
163
+
164
+ ## Notes
165
+ - The button renders with `type="button"` by default.
166
+ - `Button.Icon` automatically sizes the icon based on the parent button's size (`S` for small, `M` for medium, `L` for large).
167
+ - If you need to pass props to the icon element, declare it as a separate component outside the parent or wrap it in `useMemo`. Do not pass it as an inline arrow function, as it will cause re-renders on every render of the parent component.
168
+ - For icon-only round buttons, use the `IconButton` or `ActionIconButton` components instead.
169
+ - The component forwards refs to the underlying `<button>` element.
@@ -0,0 +1,152 @@
1
+ # FlexDivider
2
+
3
+ A visual separator line used to divide content within flex layouts. Automatically adapts its orientation based on the parent `FlexGroup` direction, or can be explicitly set when used in custom containers. Supports configurable padding, spacing, and automatic hiding of redundant dividers.
4
+
5
+ ## Import
6
+
7
+ ```tsx
8
+ import { FlexDivider } from '@redislabsdev/redis-ui-components';
9
+ ```
10
+
11
+ ## Props
12
+
13
+ | Prop | Type | Default | Description |
14
+ |------|------|---------|-------------|
15
+ | `padding` | `'XXS' \| 'XS' \| 'S' \| 'M' \| 'L' \| 'XL' \| 'XXL' \| 'none' \| string` | `'none'` | Paddings from the edges of the container to the divider line. Accepts predefined sizes or custom CSS dimension values. |
16
+ | `spacing` | `'XXS' \| 'XS' \| 'S' \| 'M' \| 'L' \| 'XL' \| 'XXL' \| 'none' \| string` | `'none'` | Additional margins between the divider line and adjacent elements. Gap of flex container is preferred. |
17
+ | `orientation` | `'horizontal' \| 'vertical'` | — | The orientation of the divider line when used in a custom container. `FlexGroup` automatically defines its orientation, so this is only needed outside of `FlexGroup`. |
18
+ | `autoHide` | `boolean` | `true` | Hide extra dividers if there are multiple ones next to each other or if one is displayed as the first/last element. |
19
+
20
+ ## Examples
21
+
22
+ ### Playground
23
+
24
+ ```tsx
25
+ <FlexGroup direction="row" align="stretch">
26
+ <div>a</div>
27
+ <FlexDivider />
28
+ <div>b</div>
29
+ <div>c</div>
30
+ </FlexGroup>
31
+ ```
32
+
33
+ ### AutoHiding
34
+
35
+ > `FlexDivider` allows you to automatically hide unnecessary dividers. If a divider appears as the first/last element or is duplicated, it will be hidden. To prevent automatic hiding, set the `autoHide` property for that particular divider to `false`.
36
+
37
+ ```tsx
38
+ import { FlexGroup, FlexDivider, Switch } from '@redislabsdev/redis-ui-components';
39
+ import { useState } from 'react';
40
+
41
+ const [autoHide, setAutoHide] = useState(true);
42
+
43
+ <FlexGroup direction="row" align="stretch" justify="center">
44
+ <FlexDivider autoHide={autoHide} />
45
+ <div>a</div>
46
+ <FlexDivider autoHide={autoHide} />
47
+ <FlexDivider autoHide={autoHide} />
48
+ <div>b</div>
49
+ <FlexDivider autoHide={autoHide} />
50
+ <div>c</div>
51
+ <FlexDivider autoHide={autoHide} />
52
+ </FlexGroup>
53
+ ```
54
+
55
+ ### Paddings
56
+
57
+ > `FlexDivider` allows control `padding` from the edge of container to the line. Supports predefined sizes (XXS ... XXL, none) or custom values (in format of one/two CSS dimensions).
58
+
59
+ ```tsx
60
+ <FlexGroup>
61
+ <div>S:</div>
62
+ <FlexDivider padding="S" />
63
+ <div>M:</div>
64
+ <FlexDivider padding="M" />
65
+ <div>L:</div>
66
+ <FlexDivider padding="L" />
67
+ <div>custom:</div>
68
+ <FlexDivider padding="5rem 2rem" />
69
+ </FlexGroup>
70
+ ```
71
+
72
+ ### Spacing
73
+
74
+ > `FlexDivider` allows control `spacing` between the divider and adjacent elements. Supports predefined sizes (XXS ... XXL, none) or custom values (in format of one/two CSS dimensions).
75
+
76
+ ```tsx
77
+ <FlexGroup gap="0">
78
+ <div>S:</div>
79
+ <FlexDivider spacing="S" />
80
+ <div>M:</div>
81
+ <FlexDivider spacing="M" />
82
+ <div>L:</div>
83
+ <FlexDivider spacing="L" />
84
+ <div>custom:</div>
85
+ <FlexDivider spacing="3rem 1rem" />
86
+ </FlexGroup>
87
+ ```
88
+
89
+ ### HorizontalContainer
90
+
91
+ > Shows `FlexDivider` usage in horizontal (`row`) layouts. Demonstrates how dividers work in `FlexGroup` containers, custom flex containers, and the limitations with block-level containers.
92
+
93
+ ```tsx
94
+ {/* Inside FlexGroup - orientation is automatic */}
95
+ <FlexGroup justify="center" align="stretch">
96
+ <div>a</div>
97
+ <FlexDivider />
98
+ <div>b</div>
99
+ <FlexDivider />
100
+ <div>c</div>
101
+ </FlexGroup>
102
+
103
+ {/* Inside a custom flex container - orientation must be set explicitly */}
104
+ <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'center', gap: 10 }}>
105
+ <div>a</div>
106
+ <FlexDivider orientation="vertical" />
107
+ <div>b</div>
108
+ <FlexDivider orientation="vertical" />
109
+ <div>c</div>
110
+ </div>
111
+ ```
112
+
113
+ ### VerticalContainer
114
+
115
+ > Shows `FlexDivider` usage in vertical (`column`) layouts. Compares behavior across `FlexGroup` containers, custom flex containers, and custom block containers.
116
+
117
+ ```tsx
118
+ {/* FlexGroup column container */}
119
+ <FlexGroup direction="column" align="stretch" gap="M">
120
+ <div>a</div>
121
+ <FlexDivider padding="S" />
122
+ <div>b</div>
123
+ <FlexDivider />
124
+ <div>c</div>
125
+ </FlexGroup>
126
+
127
+ {/* Custom flex column container */}
128
+ <div style={{ display: 'flex', flexDirection: 'column', gap: '1.2rem' }}>
129
+ <div>a</div>
130
+ <FlexDivider orientation="horizontal" padding="S" />
131
+ <div>b</div>
132
+ <FlexDivider orientation="horizontal" />
133
+ <div>c</div>
134
+ </div>
135
+
136
+ {/* Custom block container */}
137
+ <div>
138
+ <div>a</div>
139
+ <FlexDivider orientation="horizontal" spacing="M" padding="S" />
140
+ <div>b</div>
141
+ <FlexDivider orientation="horizontal" spacing="M" />
142
+ <div>c</div>
143
+ </div>
144
+ ```
145
+
146
+ ## Notes
147
+
148
+ - When used inside a `FlexGroup`, the divider automatically detects the container's direction and renders with the correct orientation. No need to set the `orientation` prop.
149
+ - When used in a custom flex container (not `FlexGroup`), you must explicitly set `orientation` to `'vertical'` (for row layouts) or `'horizontal'` (for column layouts).
150
+ - `FlexDivider` does not work with horizontal block containers out of the box; additional styling is required.
151
+ - The `autoHide` feature (enabled by default) uses CSS adjacency selectors to hide dividers that are first, last, or consecutive, keeping the layout clean even when items are conditionally rendered.
152
+ - Both `padding` and `spacing` accept predefined size tokens (`XXS` through `XXL`, `none`) or arbitrary CSS dimension strings (e.g., `"5rem 2rem"`).
@@ -0,0 +1,149 @@
1
+ # FlexGroup
2
+
3
+ A flexible layout container that arranges its children using CSS flexbox. It supports configurable direction, gap sizing (with predefined T-Shirt sizes or theme values), alignment, justification, and wrapping. It extends `FlexItem`, so it can also be nested as a flex child.
4
+
5
+ ## Import
6
+ ```tsx
7
+ import { FlexGroup } from '@redislabsdev/redis-ui-components';
8
+ ```
9
+
10
+ ## Props
11
+ | Prop | Type | Default | Description |
12
+ |------|------|---------|-------------|
13
+ | gap | `'XXS' \| 'XS' \| 'S' \| 'M' \| 'L' \| 'XL' \| 'XXL' \| string` | `'S'` | Gap size between items. Supports predefined T-Shirt sizes and free text for applying values from theme |
14
+ | direction | `'column' \| 'row' \| 'column-reverse' \| 'row-reverse'` | `'row'` | Flex direction |
15
+ | align | `'start' \| 'end' \| 'center' \| 'stretch'` | `'center'` (row) / `'stretch'` (column) | Align items along the cross axis |
16
+ | justify | `'start' \| 'end' \| 'center' \| 'space-between' \| 'space-around' \| 'space-evenly'` | - | Justify content along the main axis |
17
+ | wrap | `boolean` | - | Whether items should wrap to new lines |
18
+ | flex | `'auto' \| 'none' \| string` | - | Flex grow/shrink/basis value (inherited from FlexItem) |
19
+ | selfAlign | `'start' \| 'end' \| 'center' \| 'stretch'` | - | Align self in parent flex container along the cross axis (inherited from FlexItem) |
20
+ | component | `string \| ComponentType` | `'div'` | Use a different component with Flex styling (inherited from FlexItem) |
21
+
22
+ The component also extends all native HTML element props via `ComposeElementProps`.
23
+
24
+ ## Examples
25
+
26
+ ### Playground
27
+ ```tsx
28
+ import { FlexGroup } from '@redislabsdev/redis-ui-components';
29
+
30
+ <FlexGroup direction="row" gap="S">
31
+ <div>a</div>
32
+ <div>b</div>
33
+ <div>c</div>
34
+ <div>d</div>
35
+ </FlexGroup>
36
+ ```
37
+
38
+ ### Complex Layout: Descriptions
39
+ > This example demonstrates the use of `FlexGroup`, `FlexDivider`, and `FlexSplit` to create a complex layout with varying directions, spacing, alignments, and more.
40
+ ```tsx
41
+ import { FlexGroup, FlexDivider, FlexSplit, MoreInfoIcon, Typography } from '@redislabsdev/redis-ui-components';
42
+ import { CheckBoldIcon } from '@redislabsdev/redis-ui-icons';
43
+
44
+ const Title = ({ children }) => <Typography.Heading size="L">{children}</Typography.Heading>;
45
+ const Property = ({ children }) => <Typography.Body>{children}</Typography.Body>;
46
+ const Value = ({ children }) => (
47
+ <Typography.Body color="secondary" style={{ textAlign: 'end' }}>
48
+ {children}
49
+ </Typography.Body>
50
+ );
51
+
52
+ const descriptions1 = [
53
+ {
54
+ name: (
55
+ <FlexGroup>
56
+ Total Memory <MoreInfoIcon tooltip="Total memory available" />
57
+ </FlexGroup>
58
+ ),
59
+ value: '250 MB'
60
+ },
61
+ { name: 'Connections', value: '256' },
62
+ { name: 'CIDR Allow Rules', value: '4' },
63
+ { name: 'Recommended network usage', value: '< 100 GB' }
64
+ ];
65
+
66
+ const descriptions2 = [
67
+ { name: 'High Availability', value: 'Off' },
68
+ { name: 'Daily and instant backups', value: <CheckBoldIcon color="success500" style={{ display: 'block' }} /> },
69
+ {
70
+ name: (
71
+ <FlexGroup>
72
+ Max ops/sec <MoreInfoIcon tooltip="Max operations per second" />
73
+ </FlexGroup>
74
+ ),
75
+ value: '1000'
76
+ }
77
+ ];
78
+
79
+ <FlexGroup direction="column" gap="XL">
80
+ <Title>Database details</Title>
81
+ <FlexDivider />
82
+ <FlexGroup gap="XXL" align="start">
83
+ <FlexGroup direction="column" gap="XL" flex="1">
84
+ {descriptions1.flatMap((prop) => (
85
+ <>
86
+ <FlexGroup justify="space-between">
87
+ <Property>{prop.name}</Property>
88
+ <FlexSplit />
89
+ <Value>{prop.value}</Value>
90
+ </FlexGroup>
91
+ <FlexDivider />
92
+ </>
93
+ ))}
94
+ </FlexGroup>
95
+ <FlexDivider />
96
+ <FlexGroup direction="column" gap="XL" flex="1">
97
+ {descriptions2.flatMap((prop) => (
98
+ <>
99
+ <FlexDivider />
100
+ <FlexGroup>
101
+ <Property>{prop.name}</Property>
102
+ <FlexSplit />
103
+ <Value>{prop.value}</Value>
104
+ </FlexGroup>
105
+ </>
106
+ ))}
107
+ </FlexGroup>
108
+ </FlexGroup>
109
+ </FlexGroup>
110
+ ```
111
+
112
+ ### Complex Layout: Toolbar
113
+ > This example demonstrates the use of `FlexGroup`, `FlexDivider`, and `FlexSplit` to create a complex toolbar layout.
114
+ ```tsx
115
+ import { Badge, Button, FlexDivider, FlexGroup, FlexItem, FlexSplit, IconButton, MoreInfoIcon, SearchInput, Typography } from '@redislabsdev/redis-ui-components';
116
+ import { CopyIcon, MenuIcon, MarketplaceIcon } from '@redislabsdev/redis-ui-icons';
117
+
118
+ <FlexGroup gap="XL" style={{ paddingInline: '2.4rem', minHeight: '5.6rem' }}>
119
+ <FlexGroup gap="L" flex="none">
120
+ <FlexGroup gap="S">
121
+ <MarketplaceIcon size="XL" />
122
+ <Typography.Heading size="L">Title</Typography.Heading>
123
+ <MoreInfoIcon tooltip="Info" />
124
+ </FlexGroup>
125
+ <Badge label="Badge" variant="informative" />
126
+ </FlexGroup>
127
+ <FlexDivider padding="M" />
128
+ <FlexItem>
129
+ <SearchInput />
130
+ </FlexItem>
131
+ <FlexSplit />
132
+ <FlexDivider padding="M" />
133
+ <FlexGroup gap="XL">
134
+ <Button>Action</Button>
135
+ </FlexGroup>
136
+ <FlexDivider padding="M" />
137
+ <FlexGroup gap="XL">
138
+ <IconButton icon={CopyIcon} size="L" />
139
+ <IconButton icon={MenuIcon} size="XL" />
140
+ </FlexGroup>
141
+ </FlexGroup>
142
+ ```
143
+
144
+ ## Notes
145
+ - `FlexGroup` extends `FlexItem` internally, so it can be used both as a flex container and as a flex child within a parent `FlexGroup`.
146
+ - The default `align` value is context-aware: it defaults to `'center'` for row directions and `'stretch'` for column directions.
147
+ - The `gap` prop accepts T-Shirt sizes (`XXS` through `XXL`) which map to theme-defined spacing values. You can also pass arbitrary CSS values or theme token strings.
148
+ - Use `FlexGroup` together with `FlexItem`, `FlexSplit`, and `FlexDivider` to compose complex layouts. `FlexSplit` pushes subsequent items to the end, and `FlexDivider` adds visual separators.
149
+ - The `flex` prop (inherited from `FlexItem`) is useful for controlling how a `FlexGroup` sizes within a parent flex container (e.g., `flex="1"` for equal distribution, `flex="none"` for intrinsic sizing).
@@ -0,0 +1,58 @@
1
+ # FlexItem
2
+
3
+ A flex item wrapper component that controls individual item behavior within a flex container. It supports custom flex grow/shrink/basis values, self-alignment, and rendering as a different HTML element or component.
4
+
5
+ ## Import
6
+ ```tsx
7
+ import { FlexItem } from '@redislabsdev/redis-ui-components';
8
+ ```
9
+
10
+ ## Props
11
+ | Prop | Type | Default | Description |
12
+ |------|------|---------|-------------|
13
+ | flex | `'auto' \| 'none' \| string` | - | Flex grow/shrink/basis value |
14
+ | selfAlign | `'start' \| 'end' \| 'center' \| 'stretch'` | - | Align self in parent flex container along the cross axis of the parent flex |
15
+ | component | `string \| ComponentType` | `'div'` | Use different component with Flex styling |
16
+ | children | `ReactNode` | - | Content to render inside the flex item |
17
+
18
+ The component also extends all native `HTMLAttributes<HTMLElement>` props (excluding `children` and `content`).
19
+
20
+ ## Examples
21
+
22
+ ### Toolbar with FlexItem
23
+ > From the FlexGroup "Complex Layout: Toolbar" story. Demonstrates using `FlexItem` to wrap a search input within a flex toolbar layout.
24
+ ```tsx
25
+ import { FlexGroup, FlexItem, FlexSplit, FlexDivider, SearchInput, Button, Badge, IconButton } from '@redislabsdev/redis-ui-components';
26
+ import { MarketplaceIcon, CopyIcon, MenuIcon } from '@redislabsdev/redis-ui-icons';
27
+
28
+ <FlexGroup gap="XL" style={{ paddingInline: '2.4rem', minHeight: '5.6rem' }}>
29
+ <FlexGroup gap="L" flex="none">
30
+ <FlexGroup gap="S">
31
+ <MarketplaceIcon size="XL" />
32
+ <Typography.Heading size="L">Title</Typography.Heading>
33
+ </FlexGroup>
34
+ <Badge label="Badge" variant="informative" />
35
+ </FlexGroup>
36
+ <FlexDivider padding="M" />
37
+ <FlexItem>
38
+ <SearchInput />
39
+ </FlexItem>
40
+ <FlexSplit />
41
+ <FlexDivider padding="M" />
42
+ <FlexGroup gap="XL">
43
+ <Button>Action</Button>
44
+ </FlexGroup>
45
+ <FlexDivider padding="M" />
46
+ <FlexGroup gap="XL">
47
+ <IconButton icon={CopyIcon} size="L" />
48
+ <IconButton icon={MenuIcon} size="XL" />
49
+ </FlexGroup>
50
+ </FlexGroup>
51
+ ```
52
+
53
+ ## Notes
54
+ - `FlexItem` is typically used inside a `FlexGroup` to control individual item sizing and alignment.
55
+ - The `flex` prop maps directly to the CSS `flex` shorthand property (e.g., `"auto"`, `"none"`, `"1"`, `"0 0 200px"`).
56
+ - The `selfAlign` prop maps to the CSS `align-self` property, allowing an item to override the parent's `align` setting.
57
+ - Use the `component` prop to render as a different element (e.g., `component="span"`) or a custom React component while preserving flex item styling.
58
+ - `FlexItem` renders as a `div` by default.
@@ -0,0 +1,37 @@
1
+ # FlexSplit
2
+
3
+ A layout utility component used inside `FlexGroup` to push sibling elements apart. It creates an auto-margin split point that pushes the next sibling to the opposite end of the flex container. Works with all flex directions (`row`, `column`, `row-reverse`, `column-reverse`). Uses `display: contents` so it does not affect the layout itself.
4
+
5
+ ## Import
6
+
7
+ ```tsx
8
+ import { FlexSplit } from '@redislabsdev/redis-ui-components';
9
+ ```
10
+
11
+ ## Props
12
+
13
+ | Prop | Type | Default | Description |
14
+ |------|------|---------|-------------|
15
+ | `extraMinSpace` | `string` | `undefined` | Space added to the existing gap at the split point. If no component exists before the split, or the split is the last element, it is not applied. If the component before the split has margin adjacent to the split, that margin will be overridden. |
16
+
17
+ ## Examples
18
+
19
+ ### Playground
20
+
21
+ ```tsx
22
+ import { FlexGroup, FlexSplit } from '@redislabsdev/redis-ui-components';
23
+
24
+ <FlexGroup direction="row" style={{ minWidth: '40rem', minHeight: '12rem' }}>
25
+ <div>a</div>
26
+ <FlexSplit />
27
+ <div>b</div>
28
+ <div>c</div>
29
+ </FlexGroup>
30
+ ```
31
+
32
+ ## Notes
33
+
34
+ - `FlexSplit` must be used as a direct child of `FlexGroup`. It relies on `FlexGroup`'s `data-flex-direction` attribute to determine which margin direction to apply.
35
+ - The component renders as a `div` with `display: contents`, so it produces no visible box in the layout.
36
+ - When `extraMinSpace` is provided, it sets a minimum margin on the element preceding the split, ensuring a guaranteed gap between the two groups of items.
37
+ - Direction-aware: automatically adjusts margin logic for `row`, `column`, `row-reverse`, and `column-reverse` layouts.