@redis-ui/components 49.0.2 → 49.1.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.
- package/README.md +5 -5
- package/dist/AppSelectionMenu/components/Item/Item.style.d.ts +2 -2
- package/dist/AutoCompleteSelect/AutoCompleteSelect.style.d.ts +2 -2
- package/dist/Banner/components/BannerSemanticComponents/SemanticButton/SemanticButton.style.d.ts +1 -1
- package/dist/Banner/components/BannerSemanticComponents/SemanticCloseButton/SemanticCloseButton.style.d.ts +1 -1
- package/dist/Banner/components/Message/Message.style.d.ts +1 -1
- package/dist/Button/CopyToClipboardButton/CopyToClipboardButton.style.d.ts +1 -1
- package/dist/Checkbox/components/Label/Label.style.d.ts +1 -1
- package/dist/ChipList/ChipList.style.d.ts +1 -1
- package/dist/ChipList/Components/ExtraItem.style.d.ts +1 -1
- package/dist/Drawer/components/Content/Content.cjs +1 -1
- package/dist/Drawer/components/Content/Content.js +1 -1
- package/dist/Drawer/components/Header/components/Compose/Compose.style.d.ts +1 -1
- package/dist/Filters/components/MultiSelectFilter/MultiSelectFilter.style.d.ts +5 -5
- package/dist/FormField/FormField.d.ts +1 -1
- package/dist/FormField/components/AdditionalText/AdditionalText.style.d.ts +1 -1
- package/dist/Inputs/Input/Input.d.ts +1 -1
- package/dist/Inputs/NumericInput/NumericInput.d.ts +1 -1
- package/dist/Inputs/PasswordInput/PasswordInput.d.ts +1 -1
- package/dist/Inputs/QuantityCounter/components/InputGroup/components/ValueLabel/ValueLabel.style.d.ts +1 -1
- package/dist/Inputs/SearchInput/SearchInput.d.ts +1 -1
- package/dist/Inputs/TextArea/TextArea.d.ts +1 -1
- package/dist/Inputs/TextArea/components/Compose/Compose.style.d.ts +1 -1
- package/dist/Inputs/TextArea/components/StatusIndicator/StatusIndicator.style.d.ts +1 -1
- package/dist/Inputs/components/Compose/Compose.style.d.ts +2 -2
- package/dist/Inputs/components/Context/InputValue.context.cjs +1 -1
- package/dist/Inputs/components/Context/InputValue.context.js +1 -1
- package/dist/Inputs/components/ResetButton/ResetButton.style.d.ts +1 -1
- package/dist/Label/components/InfoIcon/InfoIcon.style.d.ts +1 -1
- package/dist/Label/components/Optional/Optional.style.d.ts +1 -1
- package/dist/Label/components/Required/Required.style.d.ts +1 -1
- package/dist/Label/components/Text/Text.style.d.ts +1 -1
- package/dist/Layouts/FlexGroup/FlexGroup.style.d.ts +1 -1
- package/dist/Link/Link.style.d.ts +1 -1
- package/dist/Menu/components/Content/components/Item/Components/SubHead/SubHead.style.d.ts +1 -1
- package/dist/Menu/components/Content/components/Label/components/Text/Text.style.d.ts +1 -1
- package/dist/Modal/components/Content/components/Body/components/Text/Text.style.d.ts +1 -1
- package/dist/Modal/components/Content/components/Compose/Compose.cjs +1 -1
- package/dist/Modal/components/Content/components/Compose/Compose.js +1 -1
- package/dist/Modal/components/Content/components/Header/components/Title/Title.style.d.ts +1 -1
- package/dist/MultiSelect/MultiSelect.d.ts +3 -3
- package/dist/MultiSelect/components/Trigger/Trigger.d.ts +2 -2
- package/dist/Pagination/Pagination.d.ts +4 -4
- package/dist/Pagination/Pagination.style.d.ts +9 -9
- package/dist/Popover/components/Content/components/Body/components/BodyText/BodyText.style.d.ts +1 -1
- package/dist/Popover/components/Content/components/Header/components/HeaderTitle/HeaderTitle.style.d.ts +1 -1
- package/dist/Popover/components/Content/components/Text/Text.style.d.ts +1 -1
- package/dist/Popover/components/Content/components/WindowBar/WindowBar.style.d.ts +1 -1
- package/dist/ProgressBar/ProgressBar.style.d.ts +1 -1
- package/dist/Section/components/Header/Header.d.ts +1 -1
- package/dist/Section/components/Header/components/CategoryValueList/CategoryValueList.style.d.ts +2 -2
- package/dist/Section/components/Header/components/CategoryValueList/components/CategoryValueChip/CategoryValueChip.style.d.ts +2 -2
- package/dist/Section/components/Header/components/CollapseButton/CollapseButton.style.d.ts +1 -1
- package/dist/Section/components/Header/components/Label/Label.style.d.ts +1 -1
- package/dist/Select/Select.d.ts +2 -2
- package/dist/Select/components/Content/components/Compose/Compose.types.d.ts +1 -1
- package/dist/Select/components/Content/components/Search/SelectSearchInput.style.d.ts +2 -2
- package/dist/Select/components/Trigger/Trigger.d.ts +2 -2
- package/dist/Select/components/Trigger/components/Compose/Compose.types.d.ts +1 -1
- package/dist/SideBar/SideBar.d.ts +1 -1
- package/dist/SideBar/SideBar.style.d.ts +1 -1
- package/dist/SideBar/components/Footer/components/Text/Text.style.d.ts +1 -1
- package/dist/SideBar/components/Group/components/Title/Title.style.d.ts +1 -1
- package/dist/SideBar/components/Item/components/Text/Text.style.d.ts +1 -1
- package/dist/SideBar/components/ItemsContainer/ItemsContainer.style.d.ts +1 -1
- package/dist/SideBar/components/ScrollContainer/ScrollContainer.style.d.ts +1 -1
- package/dist/Stepper/components/Step/components/Label/Label.style.d.ts +1 -1
- package/dist/Switch/components/Title/Title.style.d.ts +1 -1
- package/dist/TableHeading/TableHeading.d.ts +1 -1
- package/dist/TableHeading/TableHeading.style.d.ts +2 -2
- package/dist/Toast/components/Content/components/Description/Description.style.d.ts +1 -1
- package/dist/Toast/components/Content/components/Message/Message.style.d.ts +1 -1
- package/dist/Tooltip/Tooltip.d.ts +1 -1
- package/dist/Tooltip/components/Content/components/Text/Text.style.d.ts +1 -1
- package/dist/TreeView/components/TreeItem/components/Checkbox/Checkbox.style.d.ts +1 -1
- package/dist/TreeView/components/TreeItem/components/ExpandButton/ExpandButton.style.d.ts +1 -1
- package/dist/Typography/hooks/useEllipsisTooltip.cjs +1 -1
- package/dist/Typography/hooks/useEllipsisTooltip.js +1 -1
- package/dist/packages/components/node_modules/@radix-ui/react-compose-refs/dist/index.cjs +30 -0
- package/dist/packages/components/node_modules/@radix-ui/react-compose-refs/dist/index.js +28 -0
- package/dist/packages/components/node_modules/@radix-ui/react-slot/dist/index.cjs +50 -51
- package/dist/packages/components/node_modules/@radix-ui/react-slot/dist/index.js +50 -51
- package/package.json +2 -2
- package/skills/redis-ui-components/SKILL.md +2 -0
- package/skills/redis-ui-components/references/TableHeading.md +79 -0
- package/skills/redis-ui-components/references/ThemeModeSwitch.md +72 -0
|
@@ -120,6 +120,7 @@ Always check the relevant component reference before using a component. The refe
|
|
|
120
120
|
- [KeyValueList](./references/KeyValueList.md)
|
|
121
121
|
- [Filters](./references/Filters.md)
|
|
122
122
|
- [SearchBar](./references/SearchBar.md)
|
|
123
|
+
- [TableHeading](./references/TableHeading.md)
|
|
123
124
|
|
|
124
125
|
### Misc
|
|
125
126
|
|
|
@@ -132,3 +133,4 @@ Always check the relevant component reference before using a component. The refe
|
|
|
132
133
|
- [ButtonGroup](./references/ButtonGroup.md)
|
|
133
134
|
- [Banner](./references/Banner.md)
|
|
134
135
|
- [Slider](./references/Slider.md)
|
|
136
|
+
- [ThemeModeSwitch](./references/ThemeModeSwitch.md)
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# TableHeading
|
|
2
|
+
|
|
3
|
+
A heading bar for tables and list views. It is a composable container whose main part is a search input, with optional predefined `Title` and `EndContainer` slots that can hold any content (actions, buttons, etc.).
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { TableHeading } from '@redis-ui/components';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Props
|
|
12
|
+
|
|
13
|
+
`TableHeadingProps` is `HTMLAttributes<HTMLDivElement>` — the container forwards all standard div attributes.
|
|
14
|
+
|
|
15
|
+
| Prop | Type | Default | Description |
|
|
16
|
+
|------|------|---------|-------------|
|
|
17
|
+
| `children` | `ReactNode` | - | Heading content, typically `TableHeading.Title`, `TableHeading.SearchInput`, and `TableHeading.EndContainer`. |
|
|
18
|
+
| `className` | `string` | - | Applied to the container element. |
|
|
19
|
+
| `style` | `CSSProperties` | - | Applied to the container element. |
|
|
20
|
+
| `other div attributes` | `HTMLAttributes<HTMLDivElement>` | - | Any other div attributes are forwarded to the container. |
|
|
21
|
+
|
|
22
|
+
## Sub-components
|
|
23
|
+
|
|
24
|
+
- `TableHeading.Title` - Heading text for the bar. Accepts `TypographyHeadingProps` and renders a small `Typography.Heading`.
|
|
25
|
+
- `TableHeading.SearchInput` - The pre-styled search field for the heading (a `SearchInput`); forwards `SearchInput` props such as `placeholder`. See the [SearchInput](./SearchInput.md) reference.
|
|
26
|
+
- `TableHeading.EndContainer` - Trailing slot for actions/controls; can contain any content.
|
|
27
|
+
|
|
28
|
+
## Examples
|
|
29
|
+
|
|
30
|
+
### Playground
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
import { TableHeading } from '@redis-ui/components';
|
|
34
|
+
|
|
35
|
+
<TableHeading>
|
|
36
|
+
<TableHeading.Title>Title</TableHeading.Title>
|
|
37
|
+
<TableHeading.SearchInput />
|
|
38
|
+
<TableHeading.EndContainer>EndContainer</TableHeading.EndContainer>
|
|
39
|
+
</TableHeading>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Simple
|
|
43
|
+
|
|
44
|
+
> `TableHeading` can contain any components. The main part of that bar is `SearchInput`.
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
import { TableHeading } from '@redis-ui/components';
|
|
48
|
+
|
|
49
|
+
<TableHeading>
|
|
50
|
+
<TableHeading.SearchInput placeholder="Search table" />
|
|
51
|
+
</TableHeading>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### FullComposition
|
|
55
|
+
|
|
56
|
+
> In addition to `SearchInput`, the `TableHeading` also has predefined `Title` and `EndContainer`, each of which can contain any content.
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
import { ActionIconButton, Button, TableHeading, TextButton } from '@redis-ui/components';
|
|
60
|
+
import { ExportIcon, PlusIcon } from '@redis-ui/icons';
|
|
61
|
+
|
|
62
|
+
<TableHeading>
|
|
63
|
+
<TableHeading.Title>Title</TableHeading.Title>
|
|
64
|
+
<TableHeading.SearchInput placeholder="Search table" />
|
|
65
|
+
<TableHeading.EndContainer>
|
|
66
|
+
<TextButton>
|
|
67
|
+
<Button.Icon icon={ExportIcon} />
|
|
68
|
+
Export
|
|
69
|
+
</TextButton>
|
|
70
|
+
<ActionIconButton size="L" icon={PlusIcon} variant="primary" />
|
|
71
|
+
</TableHeading.EndContainer>
|
|
72
|
+
</TableHeading>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Notes
|
|
76
|
+
|
|
77
|
+
- `TableHeading` is a composition container — it can hold any components, but the main element is the `SearchInput`.
|
|
78
|
+
- `Title` and `EndContainer` are optional predefined slots; each accepts arbitrary content.
|
|
79
|
+
- `TableHeading.Title` forwards `Typography.Heading` props (it renders a small heading).
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# ThemeModeSwitch
|
|
2
|
+
|
|
3
|
+
A pre-built control that lets the user switch the app's theme mode. By default it is a light/dark toggle; when the surrounding provider allows the system mode it becomes a menu offering Light, Dark, and Browser options. It must be rendered inside a `SwitchableModeThemeProvider` (or an equivalent `ThemeModeSwitchingProvider` context) from `@redis-ui/styles`.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { ThemeModeSwitch } from '@redis-ui/components';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The theme mode provider comes from the styles package:
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { SwitchableModeThemeProvider } from '@redis-ui/styles';
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Props
|
|
18
|
+
|
|
19
|
+
| Prop | Type | Default | Description |
|
|
20
|
+
|------|------|---------|-------------|
|
|
21
|
+
| `onThemeModeChange` | `(newThemeMode: UserThemeMode) => void` | - | Called after the theme mode change is applied. |
|
|
22
|
+
| `switchTimeoutMs` | `number` | `300` | Delay before the selected mode is applied, matching the switch transition. |
|
|
23
|
+
| `other element attributes` | `Omit<HTMLAttributes<HTMLElement>, 'onClick' \| 'onChange'>` | - | Remaining HTML attributes are forwarded to the control (`onClick`/`onChange` are managed internally). |
|
|
24
|
+
|
|
25
|
+
## Hooks
|
|
26
|
+
|
|
27
|
+
- `useThemeModeSwitch` - Powers `ThemeModeSwitch`; use it to build a custom switcher. Accepts `{ onThemeModeChange?, switchTimeoutMs? }` and returns `{ allowSystemThemeMode, themeMode, setThemeMode, toggleThemeMode }`.
|
|
28
|
+
|
|
29
|
+
## Examples
|
|
30
|
+
|
|
31
|
+
### Basic Usage
|
|
32
|
+
|
|
33
|
+
> Provide the theme modes once at the app root, then drop the switch anywhere inside it.
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
import { SwitchableModeThemeProvider } from '@redis-ui/styles';
|
|
37
|
+
import { themeDark, themeLight } from './themes'; // app extended themes, based on redis-ui-styles
|
|
38
|
+
|
|
39
|
+
<SwitchableModeThemeProvider
|
|
40
|
+
lightTheme={themeLight}
|
|
41
|
+
darkTheme={themeDark}
|
|
42
|
+
allowSystemThemeMode={allowSystemThemeMode}
|
|
43
|
+
storageKey={storageKey}
|
|
44
|
+
>
|
|
45
|
+
<App />
|
|
46
|
+
</SwitchableModeThemeProvider>;
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
import { ThemeModeSwitch } from '@redis-ui/components';
|
|
51
|
+
|
|
52
|
+
<ThemeModeSwitch onThemeModeChange={notifyUserSwitchedMode} />;
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Custom switcher with the hook
|
|
56
|
+
|
|
57
|
+
> When the built-in control doesn't fit, build your own from `useThemeModeSwitch` (or the lower-level `useThemeModeSwitchingContext` from the styles package).
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
import { useThemeModeSwitch } from '@redis-ui/components';
|
|
61
|
+
|
|
62
|
+
const { themeMode, toggleThemeMode } = useThemeModeSwitch({ onThemeModeChange });
|
|
63
|
+
|
|
64
|
+
<button onClick={toggleThemeMode}>Current mode: {themeMode}</button>;
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Notes
|
|
68
|
+
|
|
69
|
+
- `ThemeModeSwitch` requires a `SwitchableModeThemeProvider` (or `ThemeModeSwitchingProvider`) ancestor — it reads and updates the theme mode through that context.
|
|
70
|
+
- When the provider is configured with `allowSystemThemeMode`, the control renders a menu with Light / Dark / Browser choices instead of a two-state toggle.
|
|
71
|
+
- `onThemeModeChange` fires only after the mode is actually applied (after `switchTimeoutMs`).
|
|
72
|
+
- For fully custom UI, use the exported `useThemeModeSwitch` hook rather than restyling the component internals.
|