@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,265 @@
1
+ # RadioGroup
2
+
3
+ A compound radio group for selecting a single option from a list. It supports controlled and uncontrolled state, horizontal or vertical layout, readonly and disabled modes, data-driven items, and full item composition.
4
+
5
+ ## Import
6
+ ```tsx
7
+ import { RadioGroup } from '@redislabsdev/redis-ui-components';
8
+ ```
9
+
10
+ ## Props
11
+ | Prop | Type | Default | Description |
12
+ |------|------|---------|-------------|
13
+ | items | `RadioGroupItem[]` | *required* | Array of radio items to render |
14
+ | value | `string` | - | Controlled selected value |
15
+ | defaultValue | `string` | - | Initial selected value for uncontrolled usage |
16
+ | onChange | `(value: string) => void` | - | Called when the selected value changes |
17
+ | layout | `'horizontal' \| 'vertical'` | `vertical` | Group orientation |
18
+ | disabled | `boolean` | `false` | Disables all radio items in the group |
19
+ | readOnly | `boolean` | `false` | Prevents selection changes while keeping the current appearance |
20
+ | id | `string` | - | Shared id for the group and its generated items |
21
+
22
+ The component also accepts standard `HTMLAttributes<HTMLDivElement>` passthrough props through `RadioGroup.Compose`.
23
+
24
+ ### RadioGroupItem Type
25
+ | Field | Type | Description |
26
+ |-------|------|-------------|
27
+ | value | `string` | *required* - Unique item value |
28
+ | label | `string` | Label text shown next to the indicator; pass `''` to hide the label |
29
+ | disabled | `boolean` | Disables the item |
30
+ | id | `string` | Custom id for the item |
31
+
32
+ ## Sub-components
33
+
34
+ - `RadioGroup.Compose` - Low-level radio group wrapper used by the compound examples and custom layouts.
35
+ - `RadioGroup.Item` - Generates a single radio item from item data.
36
+ - `RadioGroup.Item.Compose` - Composes a single radio item with shared id and value context.
37
+ - `RadioGroup.Item.Indicator` - Renders the selectable indicator for a radio item.
38
+ - `RadioGroup.Item.Label` - Renders the associated label for a radio item.
39
+
40
+ ### RadioGroup.Compose Props
41
+ | Prop | Type | Default | Description |
42
+ |------|------|---------|-------------|
43
+ | children | `React.ReactNode` | *required* | Group contents |
44
+ | disabled | `boolean` | `false` | Disables the entire radio group |
45
+ | value | `string` | - | Controlled selected value |
46
+ | defaultValue | `string` | - | Initial selected value for uncontrolled usage |
47
+ | onChange | `(value: string) => void` | - | Called when the selected value changes |
48
+ | layout | `'horizontal' \| 'vertical'` | `vertical` | Group orientation |
49
+ | readOnly | `boolean` | `false` | Prevents selection changes |
50
+ | id | `string` | - | Shared group id |
51
+
52
+ `RadioGroup.Compose` also accepts standard `HTMLAttributes<HTMLDivElement>` passthrough props.
53
+
54
+ ### RadioGroup.Item Props
55
+ | Prop | Type | Default | Description |
56
+ |------|------|---------|-------------|
57
+ | value | `string` | *required* | Item value |
58
+ | label | `string` | - | Optional label text; if omitted, the value is shown, and `''` hides the label |
59
+ | disabled | `boolean` | `false` | Disables the item |
60
+ | id | `string` | - | Custom item id |
61
+
62
+ `RadioGroup.Item` forwards standard button attributes to `RadioGroup.Item.Indicator`.
63
+
64
+ ### RadioGroup.Item.Compose Props
65
+ | Prop | Type | Default | Description |
66
+ |------|------|---------|-------------|
67
+ | children | `React.ReactNode` | *required* | Item contents |
68
+ | value | `string` | *required* | Item value |
69
+ | disabled | `boolean` | `false` | Disables the item |
70
+ | id | `string` | - | Shared id for the item label and indicator |
71
+
72
+ `RadioGroup.Item.Compose` also accepts standard `HTMLAttributes<HTMLDivElement>` passthrough props and renders its children inside the item wrapper.
73
+
74
+ `RadioGroup.Item.Indicator` accepts standard `HTMLAttributes<HTMLButtonElement>` passthrough props.
75
+
76
+ `RadioGroup.Item.Label` accepts standard `LabelHTMLAttributes<HTMLLabelElement>` passthrough props.
77
+
78
+ ## Examples
79
+
80
+ ### Basic Usage
81
+ ```tsx
82
+ import { RadioGroup } from '@redislabsdev/redis-ui-components';
83
+
84
+ const items = [
85
+ { value: '1', label: 'Item 1' },
86
+ { value: '2', label: 'Item 2' },
87
+ { value: '3', label: 'Disabled item', disabled: true }
88
+ ];
89
+
90
+ <RadioGroup items={items} defaultValue={items[0].value} />
91
+ ```
92
+
93
+ ### Controlled
94
+ > Use `value` and `onChange` props to control `RadioGroup` state
95
+ ```tsx
96
+ import { Button, RadioGroup } from '@redislabsdev/redis-ui-components';
97
+ import { useState } from 'react';
98
+
99
+ const items = [
100
+ { value: '1', label: 'Item 1' },
101
+ { value: '2', label: 'Item 2' },
102
+ { value: '3', label: 'Disabled item', disabled: true }
103
+ ];
104
+
105
+ function Example() {
106
+ const [value, setValue] = useState('2');
107
+
108
+ return (
109
+ <>
110
+ <Button onClick={() => setValue('1')}>Select first option</Button>
111
+ <Button onClick={() => setValue('3')}>Select disabled option</Button>
112
+ <Button onClick={() => setValue('')}>Unselect all</Button>
113
+ <RadioGroup items={items} value={value} onChange={setValue} />
114
+ </>
115
+ );
116
+ }
117
+ ```
118
+
119
+ ### Layout
120
+ > Set `layout` prop to `"horizontal"` to have horizontal layout. Vertical layout is default.
121
+ ```tsx
122
+ import { RadioGroup } from '@redislabsdev/redis-ui-components';
123
+
124
+ const items = [
125
+ { value: '1', label: 'Item 1' },
126
+ { value: '2', label: 'Item 2' },
127
+ { value: '3', label: 'Disabled item', disabled: true }
128
+ ];
129
+
130
+ <>
131
+ <RadioGroup items={items} layout="horizontal" />
132
+ <RadioGroup items={items} />
133
+ </>
134
+ ```
135
+
136
+ ### Readonly
137
+ > In readonly mode items appear as normal, but the user cannot change the selection
138
+ ```tsx
139
+ import { RadioGroup } from '@redislabsdev/redis-ui-components';
140
+
141
+ const items = [
142
+ { value: '1', label: 'Item 1' },
143
+ { value: '2', label: 'Item 2' },
144
+ { value: '3', label: 'Disabled item', disabled: true }
145
+ ];
146
+
147
+ <RadioGroup items={items} readOnly defaultValue="2" />
148
+ ```
149
+
150
+ ### Disabled
151
+ > Use `disabled` prop of the `RadioGroup` to turn all items to disabled mode
152
+ ```tsx
153
+ import { RadioGroup } from '@redislabsdev/redis-ui-components';
154
+
155
+ const items = [
156
+ { value: '1', label: 'Item 1' },
157
+ { value: '2', label: 'Item 2' },
158
+ { value: '3', label: 'Disabled item', disabled: true }
159
+ ];
160
+
161
+ <RadioGroup items={items} disabled defaultValue="2" />
162
+ ```
163
+
164
+ ### WithinFormField
165
+ > `RadioGroup` can be used together with `FormField` and `Label` components.
166
+ ```tsx
167
+ import { FormField, RadioGroup } from '@redislabsdev/redis-ui-components';
168
+
169
+ const items = [
170
+ { value: '1', label: 'Item 1' },
171
+ { value: '2', label: 'Item 2' },
172
+ { value: '3', label: 'Disabled item', disabled: true }
173
+ ];
174
+
175
+ <FormField
176
+ label="FormField Label"
177
+ required
178
+ optional
179
+ infoIconProps={{ text: 'ToolTip!' }}
180
+ additionalText="RadioGroup with horizontal layout"
181
+ >
182
+ <RadioGroup items={items} defaultValue="2" layout="horizontal" />
183
+ </FormField>
184
+ ```
185
+
186
+ ### ItemsData
187
+ > Without composition, items are generated from item data, which allows you to define a value, label, disabled state and custom id
188
+ ```tsx
189
+ import { RadioGroup } from '@redislabsdev/redis-ui-components';
190
+
191
+ const radioGroupItems = [
192
+ { label: 'Item 1', value: '1' },
193
+ { label: 'Disabled', value: '2', disabled: true },
194
+ { label: 'Next one is without label (must pass empty string to label prop)', value: '3' },
195
+ { label: '', value: '4' },
196
+ { label: 'Next one takes value as label', value: '5' },
197
+ { value: '6' },
198
+ { value: '7', label: 'Custom id', id: 'custom-id' }
199
+ ];
200
+
201
+ <RadioGroup items={radioGroupItems} defaultValue="2" />
202
+ ```
203
+
204
+ ### GroupComposition
205
+ > `RadioGroup` can be composed of `Item`s.
206
+ > In this case, each `Item` is defined as component rather than as plain data.
207
+ ```tsx
208
+ import { RadioGroup } from '@redislabsdev/redis-ui-components';
209
+
210
+ <RadioGroup.Compose>
211
+ <RadioGroup.Item label="Item 1" value="1" />
212
+ <RadioGroup.Item label="Disabled" value="2" disabled />
213
+ <RadioGroup.Item
214
+ label="Next one is without label (must pass empty string to label prop) "
215
+ value="3"
216
+ />
217
+ <RadioGroup.Item label="" value="4" />
218
+ <RadioGroup.Item label="Next one takes value as label" value="5" />
219
+ <RadioGroup.Item value="6" />
220
+ <RadioGroup.Item value="7" id="custom-id" label="Custom id" />
221
+ </RadioGroup.Compose>
222
+ ```
223
+
224
+ ### ItemComposition
225
+ > `RadioGroup` allows to compose each item separately.<br>
226
+ > `Item.Indicator` and `Item.Label` can be customized and used with other custom components
227
+ ```tsx
228
+ import { Label, RadioGroup } from '@redislabsdev/redis-ui-components';
229
+
230
+ <RadioGroup.Compose defaultValue="1" layout="horizontal">
231
+ <RadioGroup.Item.Compose value="1">
232
+ <RadioGroup.Item.Label>Label on the left</RadioGroup.Item.Label>
233
+ <RadioGroup.Item.Indicator />
234
+ </RadioGroup.Item.Compose>
235
+ <RadioGroup.Item.Compose value="2" id="manual-id">
236
+ <RadioGroup.Item.Indicator />
237
+ <RadioGroup.Item.Label>Manual id</RadioGroup.Item.Label>
238
+ </RadioGroup.Item.Compose>
239
+ <RadioGroup.Item.Compose value="3">
240
+ <RadioGroup.Item.Indicator />
241
+ </RadioGroup.Item.Compose>
242
+ <RadioGroup.Item.Compose value="4" disabled>
243
+ <RadioGroup.Item.Indicator />
244
+ <RadioGroup.Item.Label>Disabled item</RadioGroup.Item.Label>
245
+ </RadioGroup.Item.Compose>
246
+ <RadioGroup.Item.Compose value="5">
247
+ <RadioGroup.Item.Indicator id="inlineId" />
248
+ <RadioGroup.Item.Label htmlFor="inlineId">Id and htmlFor out of context</RadioGroup.Item.Label>
249
+ </RadioGroup.Item.Compose>
250
+ <RadioGroup.Item.Compose value="6">
251
+ <RadioGroup.Item.Indicator />
252
+ <RadioGroup.Item.Label>With Info</RadioGroup.Item.Label>
253
+ <Label.InfoIcon content="Any info text or content" />
254
+ </RadioGroup.Item.Compose>
255
+ </RadioGroup.Compose>
256
+ ```
257
+
258
+ ## Notes
259
+ - Use `value` and `onChange` to control `RadioGroup` state.
260
+ - Horizontal layout is enabled with `layout="horizontal"`; vertical layout is the default.
261
+ - In readonly mode, items render normally but the user cannot change the selection.
262
+ - `disabled` turns all items into disabled mode.
263
+ - `RadioGroup` can be used together with `FormField` and `Label`.
264
+ - Without composition, items are generated from item data and can define `value`, `label`, `disabled`, and custom `id`.
265
+ - `Item.Indicator` and `Item.Label` can be customized and combined with other custom components.
@@ -0,0 +1,147 @@
1
+ # ScreenReaderAnnounce
2
+
3
+ An invisible announcement helper for screen readers with configurable live region behavior and opt-in first-render announcements.
4
+
5
+ ## Import
6
+
7
+ ```tsx
8
+ import { ScreenReaderAnnounce } from '@redislabsdev/redis-ui-components';
9
+ ```
10
+
11
+ ## Props
12
+
13
+ | Prop | Type | Default | Description |
14
+ |------|------|---------|-------------|
15
+ | text | `string` | required | Announcement text |
16
+ | allowAnnounce | `boolean` | `undefined` | Forces or disables the initial announcement behavior |
17
+ | aria-live | `'polite' \| 'assertive'` | `polite` | Live region priority |
18
+ | aria-atomic | `boolean` | `true` | Treats the announcement as a single atomic update |
19
+ | role | `'alert' \| 'status' \| 'log'` | - | Semantic role for the live region |
20
+ | other `VisuallyHidden` props | `ComponentProps<typeof VisuallyHidden>` minus `children`, `style`, `className`, `aria-hidden`, `role`, `text`, `asChild`, and other ARIA props | - | Remaining props forwarded to the hidden announcer |
21
+
22
+ ## Examples
23
+
24
+ ### Playground
25
+
26
+ ```tsx
27
+ import { ScreenReaderAnnounce } from '@redislabsdev/redis-ui-components';
28
+
29
+ <ScreenReaderAnnounce text="This is a screen reader announcement" allowAnnounce />
30
+ ```
31
+
32
+ ### AutomaticAnnouncement
33
+
34
+ > By default, the component only announces text changes after the first render to avoid unnecessary announcements on initial page load.
35
+
36
+ ```tsx
37
+ import { useState } from 'react';
38
+ import { Button, ScreenReaderAnnounce } from '@redislabsdev/redis-ui-components';
39
+
40
+ function Example() {
41
+ const [text, setText] = useState('Initial text');
42
+
43
+ return (
44
+ <>
45
+ <Button onClick={() => setText(`Text ${Date.now()}`)}>Update Text</Button>
46
+ <ScreenReaderAnnounce text={text} />
47
+ </>
48
+ );
49
+ }
50
+ ```
51
+
52
+ ### ForceAnnouncement
53
+
54
+ > Use `allowAnnounce=true` to force announcement on first render.
55
+
56
+ ```tsx
57
+ import { ScreenReaderAnnounce } from '@redislabsdev/redis-ui-components';
58
+
59
+ <>
60
+ <div>This will announce immediately</div>
61
+ <ScreenReaderAnnounce text="Forced announcement on first render" allowAnnounce />
62
+ </>
63
+ ```
64
+
65
+ ### DisabledAnnouncement
66
+
67
+ > Use `allowAnnounce=false` to disable announcements.
68
+
69
+ ```tsx
70
+ import { useState } from 'react';
71
+ import { Button, ScreenReaderAnnounce } from '@redislabsdev/redis-ui-components';
72
+
73
+ function Example() {
74
+ const [text, setText] = useState('Initial text');
75
+
76
+ return (
77
+ <>
78
+ <Button onClick={() => setText('Updated text - but no announcement')}>Update Text</Button>
79
+ <ScreenReaderAnnounce text={text} allowAnnounce={false} />
80
+ </>
81
+ );
82
+ }
83
+ ```
84
+
85
+ ### AriaLiveValues
86
+
87
+ > Use `aria-live` to control announcement priority. Do not use it together with `role`.
88
+
89
+ ```tsx
90
+ import { useState } from 'react';
91
+ import { Button, ScreenReaderAnnounce } from '@redislabsdev/redis-ui-components';
92
+
93
+ function Example() {
94
+ const [politeText, setPoliteText] = useState('Polite announcement');
95
+ const [assertiveText, setAssertiveText] = useState('Assertive announcement');
96
+
97
+ return (
98
+ <>
99
+ <Button onClick={() => setPoliteText(`Polite: ${Date.now()}`)}>Update Polite</Button>
100
+ <div>Polite (default): {politeText}</div>
101
+ <ScreenReaderAnnounce text={politeText} aria-live="polite" />
102
+
103
+ <Button onClick={() => setAssertiveText(`Assertive: ${Date.now()}`)}>Update Assertive</Button>
104
+ <div>Assertive (interrupts): {assertiveText}</div>
105
+ <ScreenReaderAnnounce text={assertiveText} aria-live="assertive" />
106
+ </>
107
+ );
108
+ }
109
+ ```
110
+
111
+ ### RoleValues
112
+
113
+ > Use `role` to define semantic meaning of announcements. Do not use it together with `aria-live`.
114
+
115
+ ```tsx
116
+ import { useState } from 'react';
117
+ import { Button, ScreenReaderAnnounce } from '@redislabsdev/redis-ui-components';
118
+
119
+ function Example() {
120
+ const [statusText, setStatusText] = useState('Status announcement');
121
+ const [alertText, setAlertText] = useState('Alert announcement');
122
+ const [logText, setLogText] = useState('Log announcement');
123
+
124
+ return (
125
+ <>
126
+ <Button onClick={() => setStatusText(`Status: ${Date.now()}`)}>Update Status</Button>
127
+ <div>Status (default): {statusText}</div>
128
+ <ScreenReaderAnnounce text={statusText} role="status" />
129
+
130
+ <Button onClick={() => setAlertText(`Alert: ${Date.now()}`)}>Update Alert</Button>
131
+ <div>Alert (important): {alertText}</div>
132
+ <ScreenReaderAnnounce text={alertText} role="alert" />
133
+
134
+ <Button onClick={() => setLogText(`Log: ${Date.now()}`)}>Update Log</Button>
135
+ <div>Log (sequential): {logText}</div>
136
+ <ScreenReaderAnnounce text={logText} role="log" />
137
+ </>
138
+ );
139
+ }
140
+ ```
141
+
142
+ ## Notes
143
+
144
+ - By default the component waits for the first text change before announcing.
145
+ - `allowAnnounce` can force the first announcement or disable announcements entirely.
146
+ - Use either `aria-live` or `role`, but not both on the same instance.
147
+ - The component renders nothing when `text` is empty.
@@ -0,0 +1,242 @@
1
+ # SearchBar
2
+
3
+ Composite search bar for table screens that combines search, filters, column selection, and custom actions.
4
+
5
+ ## Import
6
+
7
+ ```tsx
8
+ import { SearchBar, type ColumnOption } from '@redislabsdev/redis-ui-components';
9
+ ```
10
+
11
+ > Composition examples also use icons from `@redislabsdev/redis-ui-icons`:
12
+ > ```tsx
13
+ > import { ExportIcon, RefreshIcon } from '@redislabsdev/redis-ui-icons';
14
+ > ```
15
+
16
+ ## Props
17
+
18
+ | Prop | Type | Default | Description |
19
+ |------|------|---------|-------------|
20
+ | searchValue | `string` | required | Current search text passed to the built-in search input. |
21
+ | onSearchChange | `(value: string) => void` | required | Called when the search text changes. |
22
+ | onFiltersChange | `(activeFilters: FilterActive[]) => void` | required | Called when filter selection changes. |
23
+ | activeFilters | `FilterActive[]` | required | Active filters rendered by the filters section. |
24
+ | availableFilters | `FilterItemConfig[]` | required | Filter definitions shown in the filters section. |
25
+ | availableColumns | `ColumnOption[]` | - | Optional column definitions shown in the column selector. |
26
+ | activeColumns | `string[]` | - | Optional active column ids. |
27
+ | onColumnsChange | `(selectedColumns: string[]) => void` | - | Called when selected columns change. |
28
+ | children | `React.ReactNode` | - | Additional content forwarded to `SearchBar.Compose`. |
29
+
30
+ ### Related Types
31
+
32
+ - `ColumnOption` - Column definition type exported by `SearchBar`; used by `availableColumns` and the column selector.
33
+
34
+ ## Sub-components
35
+
36
+ - `SearchBar.Compose` - Shared state wrapper that provides `SearchBar` context and wraps the composed search layout.
37
+ - `SearchBar.SearchSection` - Default search header with the search input and actions row.
38
+ - `SearchBar.SearchSection.Compose` - Low-level wrapper for fully custom search header layouts.
39
+ - `SearchBar.SearchSection.SearchInput` - Search input wrapper with the built-in `Search anything` placeholder.
40
+ - `SearchBar.SearchSection.Actions` - Default actions row that renders the filter toggle and optional column selector.
41
+ - `SearchBar.SearchSection.Actions.Compose` - Low-level wrapper for custom action-row layouts.
42
+ - `SearchBar.SearchSection.Actions.FilterToggle` - Filter toggle button with the active filter count badge.
43
+ - `SearchBar.SearchSection.Actions.ColumnSelector` - Column multi-select used to show or hide table columns.
44
+ - `SearchBar.SearchSection.Actions.CustomActions` - Slot for custom action buttons or other trailing controls.
45
+ - `SearchBar.FiltersSection` - Filter panel section rendered below the search header.
46
+
47
+ ## Props
48
+
49
+ ### SearchBar.Compose Props
50
+
51
+ | Prop | Type | Default | Description |
52
+ |------|------|---------|-------------|
53
+ | activeFilters | `FilterActive[]` | required | Active filters shared with nested controls. |
54
+ | children | `React.ReactNode` | required | Custom search bar layout content. |
55
+
56
+ `SearchBar.Compose` also accepts native `HTMLAttributes<HTMLDivElement>` props.
57
+
58
+ ### SearchBar.SearchSection Props
59
+
60
+ | Prop | Type | Default | Description |
61
+ |------|------|---------|-------------|
62
+ | searchValue | `string` | required | Current search input value. |
63
+ | onSearchChange | `(value: string) => void` | required | Called when the search input changes. |
64
+ | availableColumns | `ColumnOption[]` | - | Column options passed to the column selector. |
65
+ | activeColumns | `string[]` | - | Active column ids. |
66
+ | onColumnsChange | `(selectedColumns: string[]) => void` | - | Called when selected columns change. |
67
+ | children | `React.ReactNode` | - | Additional search section content. |
68
+
69
+ ### SearchBar.SearchSection.Compose Props
70
+
71
+ | Prop | Type | Default | Description |
72
+ |------|------|---------|-------------|
73
+ | children | `React.ReactNode` | required | Custom search header content. |
74
+
75
+ `SearchBar.SearchSection.Compose` also accepts native `HTMLAttributes<HTMLDivElement>` props.
76
+
77
+ ### SearchBar.SearchSection.SearchInput Props
78
+
79
+ `SearchBar.SearchSection.SearchInput` does not define new props. It inherits the `SearchInput` prop surface from the input package and renders with a built-in `Search anything` placeholder.
80
+
81
+ ### SearchBar.SearchSection.Actions Props
82
+
83
+ | Prop | Type | Default | Description |
84
+ |------|------|---------|-------------|
85
+ | availableColumns | `ColumnOption[]` | - | Column options used to render the column selector. |
86
+ | activeColumns | `string[]` | - | Active column ids. |
87
+ | onColumnsChange | `(selectedColumns: string[]) => void` | - | Called when selected columns change. |
88
+
89
+ ### SearchBar.SearchSection.Actions.Compose Props
90
+
91
+ | Prop | Type | Default | Description |
92
+ |------|------|---------|-------------|
93
+ | children | `React.ReactNode` | required | Custom action row content. |
94
+
95
+ `SearchBar.SearchSection.Actions.Compose` also accepts native `HTMLAttributes<HTMLDivElement>` props.
96
+
97
+ ### SearchBar.SearchSection.Actions.FilterToggle Props
98
+
99
+ `SearchBar.SearchSection.Actions.FilterToggle` does not define custom props. It reads `SearchBar` context and shows the active filter count.
100
+
101
+ ### SearchBar.SearchSection.Actions.ColumnSelector Props
102
+
103
+ | Prop | Type | Default | Description |
104
+ |------|------|---------|-------------|
105
+ | availableColumns | `ColumnOption[]` | required | Column definitions available in the selector. |
106
+ | activeColumns | `string[]` | required | Active column ids. |
107
+ | onChange | `(selectedColumns: string[]) => void` | required | Called when the selection changes. |
108
+
109
+ ### SearchBar.SearchSection.Actions.CustomActions Props
110
+
111
+ | Prop | Type | Default | Description |
112
+ |------|------|---------|-------------|
113
+ | children | `React.ReactNode` | - | Custom trailing actions rendered next to the built-in controls. |
114
+
115
+ `SearchBar.SearchSection.Actions.CustomActions` also accepts native `HTMLAttributes<HTMLDivElement>` props.
116
+
117
+ ### SearchBar.FiltersSection Props
118
+
119
+ | Prop | Type | Default | Description |
120
+ |------|------|---------|-------------|
121
+ | availableFilters | `FilterItemConfig[]` | required | Filter definitions shown in the filter section. |
122
+ | onFiltersChange | `(activeFilters: FilterActive[]) => void` | required | Called when filters change. |
123
+
124
+ `SearchBar.FiltersSection` also accepts native `HTMLAttributes<HTMLDivElement>` props.
125
+
126
+ ## Examples
127
+
128
+ ### Playground
129
+
130
+ > The playground story keeps filter and column state in sync with `useArgState`.
131
+
132
+ ```tsx
133
+ import { useArgState } from '../../helpers/useArgState';
134
+ import { SearchBar } from '@redislabsdev/redis-ui-components';
135
+
136
+ function Render(args) {
137
+ const [activeFilters, setActiveFilters] = useArgState({
138
+ arg: args.activeFilters,
139
+ event: args.onFiltersChange,
140
+ getNewState: (_, [value]) => value
141
+ });
142
+ const [activeColumns, setActiveColumns] = useArgState({
143
+ arg: args.activeColumns,
144
+ event: args.onColumnsChange,
145
+ getNewState: (_, [value]) => value
146
+ });
147
+
148
+ return (
149
+ <SearchBar
150
+ {...args}
151
+ activeFilters={activeFilters}
152
+ onFiltersChange={setActiveFilters}
153
+ activeColumns={activeColumns}
154
+ onColumnsChange={setActiveColumns}
155
+ />
156
+ );
157
+ }
158
+ ```
159
+
160
+ ### Controlled
161
+
162
+ > SearchBar works in controlled mode.<br/>
163
+ > Component requires following props:
164
+ > - `availableFilters` array of filters with type and options
165
+ > - `activeFilters` selected filter values
166
+ > - `onFiltersChange` handler to update filter selection
167
+ > - `searchValue` string (initial value)
168
+ > - `onSearchChange` handler to update search state
169
+ >
170
+ > To enable column selection you should specify following optional props
171
+ > - `availableColumns` array of columns
172
+ > - `activeColumns` selected columns ids
173
+ > - `onColumnsChange` handler to update column selection
174
+
175
+ ```tsx
176
+ import { useState } from 'react';
177
+ import { SearchBar } from '@redislabsdev/redis-ui-components';
178
+
179
+ function Render() {
180
+ const [searchValue, setSearchValue] = useState('');
181
+ const [activeFilters, setActiveFilters] = useState(defaultFilters);
182
+ const [activeColumns, setActiveColumns] = useState(defaultColumns);
183
+
184
+ return (
185
+ <SearchBar
186
+ availableFilters={availableFilters}
187
+ activeFilters={activeFilters}
188
+ onFiltersChange={setActiveFilters}
189
+ availableColumns={availableColumns}
190
+ activeColumns={activeColumns}
191
+ onColumnsChange={setActiveColumns}
192
+ searchValue={searchValue}
193
+ onSearchChange={setSearchValue}
194
+ data-testid="search-bar-test-id"
195
+ />
196
+ );
197
+ }
198
+ ```
199
+
200
+ ### Composition
201
+
202
+ ```tsx
203
+ import { useState } from 'react';
204
+ import { IconButton, SearchBar } from '@redislabsdev/redis-ui-components';
205
+ import { ExportIcon, RefreshIcon } from '@redislabsdev/redis-ui-icons';
206
+
207
+ function Render() {
208
+ const [activeFilters, setActiveFilters] = useState(defaultFilters);
209
+ const [activeColumns, setActiveColumns] = useState(defaultColumns);
210
+
211
+ return (
212
+ <SearchBar.Compose activeFilters={activeFilters}>
213
+ <SearchBar.SearchSection.Compose>
214
+ <SearchBar.SearchSection.SearchInput />
215
+ <SearchBar.SearchSection.Actions.Compose>
216
+ <SearchBar.SearchSection.Actions.FilterToggle />
217
+ <SearchBar.SearchSection.Actions.ColumnSelector
218
+ availableColumns={availableColumns}
219
+ activeColumns={activeColumns}
220
+ onChange={setActiveColumns}
221
+ />
222
+ <SearchBar.SearchSection.Actions.CustomActions>
223
+ <IconButton icon={ExportIcon} size="L" title="Export" />
224
+ <IconButton icon={RefreshIcon} size="L" title="Refresh" />
225
+ </SearchBar.SearchSection.Actions.CustomActions>
226
+ </SearchBar.SearchSection.Actions.Compose>
227
+ </SearchBar.SearchSection.Compose>
228
+ <SearchBar.FiltersSection
229
+ onFiltersChange={setActiveFilters}
230
+ availableFilters={availableFilters}
231
+ />
232
+ </SearchBar.Compose>
233
+ );
234
+ }
235
+ ```
236
+
237
+ ## Notes
238
+
239
+ - The root `SearchBar` forwards remaining props to `SearchBar.Compose`, so compose-container attributes can be applied at the root.
240
+ - `SearchBar.SearchSection.Actions` only renders `ColumnSelector` when `availableColumns`, `activeColumns`, and `onColumnsChange` are all provided.
241
+ - `SearchBar.FiltersSection` and `SearchBar.SearchSection.Actions.FilterToggle` rely on `SearchBar` context and must be rendered inside `SearchBar.Compose`.
242
+ - The controlled story manages search text, filters, and columns with local `useState` hooks.