@maxio-com/react-ui-components 9.31.0 → 9.33.0
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/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/skills/maxio-react/SKILL.md +3 -0
- package/dist/skills/maxio-react/references/components-action-menu.md +9 -1
- package/dist/skills/maxio-react/references/components-avatar.md +1 -0
- package/dist/skills/maxio-react/references/components-copy-to-clipboard.md +1 -1
- package/dist/skills/maxio-react/references/components-data-table.md +9 -2
- package/dist/skills/maxio-react/references/components-dialog.md +45 -0
- package/dist/skills/maxio-react/references/components-drawer.md +7 -1
- package/dist/skills/maxio-react/references/components-flex.md +4 -4
- package/dist/skills/maxio-react/references/components-grid.md +11 -11
- package/dist/skills/maxio-react/references/components-icon.md +1 -0
- package/dist/skills/maxio-react/references/components-loading-spinner.md +1 -0
- package/dist/skills/maxio-react/references/components-logo.md +1 -0
- package/dist/skills/maxio-react/references/components-modal.md +507 -0
- package/dist/skills/maxio-react/references/components-notifications-alert.md +6 -0
- package/dist/skills/maxio-react/references/components-notifications-banner.md +6 -0
- package/dist/skills/maxio-react/references/components-notifications-toast.md +6 -0
- package/dist/skills/maxio-react/references/components-pagination.md +6 -0
- package/dist/skills/maxio-react/references/components-popover.md +1 -1
- package/dist/skills/maxio-react/references/components-progressbar.md +2 -1
- package/dist/skills/maxio-react/references/components-tabs.md +7 -0
- package/dist/skills/maxio-react/references/components-tag.md +1 -0
- package/dist/skills/maxio-react/references/components-tile.md +1 -0
- package/dist/skills/maxio-react/references/components-toggle.md +7 -1
- package/dist/skills/maxio-react/references/components-tooltip.md +8 -1
- package/dist/skills/maxio-react/references/foundations-testing.md +191 -0
- package/dist/skills/maxio-react/references/patterns-side-nav.md +6 -0
- package/dist/skills/maxio-react/references/patterns-top-bar.md +1 -0
- package/dist/temporary-typings/src/components/ActionMenu/components/Menu/Menu.d.ts +3 -2
- package/dist/temporary-typings/src/components/ActionMenu/components/Menu/Menu.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/ActionMenu/components/MenuButton/MenuButton.d.ts +1 -1
- package/dist/temporary-typings/src/components/ActionMenu/components/MenuButton/MenuButton.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/ActionMenu/components/MenuButton/types.d.ts +2 -1
- package/dist/temporary-typings/src/components/ActionMenu/components/MenuButton/types.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/ActionMenu/components/MenuList/MenuList.d.ts +3 -2
- package/dist/temporary-typings/src/components/ActionMenu/components/MenuList/MenuList.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/ActionMenu/contexts/MenuContext.d.ts +3 -1
- package/dist/temporary-typings/src/components/ActionMenu/contexts/MenuContext.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/Avatar/Avatar.d.ts +1 -1
- package/dist/temporary-typings/src/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/Avatar/Avatar.types.d.ts +2 -1
- package/dist/temporary-typings/src/components/Avatar/Avatar.types.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/DataTable/DataTable.d.ts +1 -1
- package/dist/temporary-typings/src/components/DataTable/DataTable.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/DataTable/DataTable.types.d.ts +2 -1
- package/dist/temporary-typings/src/components/DataTable/DataTable.types.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/DataTable/components/RowRenderer/RowRenderer.d.ts +2 -1
- package/dist/temporary-typings/src/components/DataTable/components/RowRenderer/RowRenderer.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/DataTable/components/Table/Table.d.ts +1 -1
- package/dist/temporary-typings/src/components/DataTable/components/Table/Table.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/DataTable/components/Table/Table.types.d.ts +1 -0
- package/dist/temporary-typings/src/components/DataTable/components/Table/Table.types.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/Dialog/Dialog.d.ts +5 -0
- package/dist/temporary-typings/src/components/Dialog/Dialog.d.ts.map +1 -0
- package/dist/temporary-typings/src/components/Dialog/index.d.ts +3 -0
- package/dist/temporary-typings/src/components/Dialog/index.d.ts.map +1 -0
- package/dist/temporary-typings/src/components/Dialog/types.d.ts +15 -0
- package/dist/temporary-typings/src/components/Dialog/types.d.ts.map +1 -0
- package/dist/temporary-typings/src/components/Drawer/Drawer.d.ts +1 -1
- package/dist/temporary-typings/src/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/Drawer/types.d.ts +2 -1
- package/dist/temporary-typings/src/components/Drawer/types.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/Icon/Icon.d.ts +1 -1
- package/dist/temporary-typings/src/components/Icon/Icon.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/Icon/Icon.types.d.ts +2 -1
- package/dist/temporary-typings/src/components/Icon/Icon.types.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/LoadingSpinner/LoadingSpinner.d.ts +1 -1
- package/dist/temporary-typings/src/components/LoadingSpinner/LoadingSpinner.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/LoadingSpinner/types.d.ts +2 -1
- package/dist/temporary-typings/src/components/LoadingSpinner/types.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/Logo/Logo.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/Logo/Logo.types.d.ts +2 -1
- package/dist/temporary-typings/src/components/Logo/Logo.types.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/Modal/Modal.d.ts +5 -0
- package/dist/temporary-typings/src/components/Modal/Modal.d.ts.map +1 -0
- package/dist/temporary-typings/src/components/Modal/index.d.ts +3 -0
- package/dist/temporary-typings/src/components/Modal/index.d.ts.map +1 -0
- package/dist/temporary-typings/src/components/Modal/types.d.ts +10 -0
- package/dist/temporary-typings/src/components/Modal/types.d.ts.map +1 -0
- package/dist/temporary-typings/src/components/Notifications/Alert/Alert.d.ts +1 -1
- package/dist/temporary-typings/src/components/Notifications/Alert/Alert.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/Notifications/Alert/Alert.types.d.ts +2 -1
- package/dist/temporary-typings/src/components/Notifications/Alert/Alert.types.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/Notifications/Banner/Banner.d.ts +1 -1
- package/dist/temporary-typings/src/components/Notifications/Banner/Banner.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/Notifications/Banner/Banner.types.d.ts +2 -1
- package/dist/temporary-typings/src/components/Notifications/Banner/Banner.types.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/Notifications/Toast/Toast/Toast.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/Notifications/Toast/Toast/Toast.types.d.ts +1 -0
- package/dist/temporary-typings/src/components/Notifications/Toast/Toast/Toast.types.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/OverlayTrigger/OverlayTrigger.d.ts +1 -0
- package/dist/temporary-typings/src/components/OverlayTrigger/OverlayTrigger.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/Pagination/Pagination.d.ts +1 -1
- package/dist/temporary-typings/src/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/Pagination/Pagination.types.d.ts +2 -1
- package/dist/temporary-typings/src/components/Pagination/Pagination.types.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/ProgressBar/ProgressBar.d.ts +3 -2
- package/dist/temporary-typings/src/components/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/SideNav/contexts/types.d.ts +1 -0
- package/dist/temporary-typings/src/components/SideNav/contexts/types.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/Tabs/Tab/types.d.ts +2 -1
- package/dist/temporary-typings/src/components/Tabs/Tab/types.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/Tabs/TabPanel/TabPanel.d.ts +2 -1
- package/dist/temporary-typings/src/components/Tabs/TabPanel/TabPanel.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/Tabs/Tabs/Tabs.d.ts +1 -1
- package/dist/temporary-typings/src/components/Tabs/Tabs/Tabs.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/Tabs/contexts/types.d.ts +1 -0
- package/dist/temporary-typings/src/components/Tabs/contexts/types.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/Tag/Tag.d.ts +1 -1
- package/dist/temporary-typings/src/components/Tag/Tag.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/Tag/Tag.types.d.ts +2 -1
- package/dist/temporary-typings/src/components/Tag/Tag.types.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/Tile/Tile.d.ts +3 -2
- package/dist/temporary-typings/src/components/Tile/Tile.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/Toggle/Toggle.d.ts +2 -1
- package/dist/temporary-typings/src/components/Toggle/Toggle.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/Tooltip/Tooltip.d.ts +1 -0
- package/dist/temporary-typings/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/TooltipTrigger/TooltipTrigger.d.ts +1 -1
- package/dist/temporary-typings/src/components/TooltipTrigger/TooltipTrigger.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/TopBar/TopBar.d.ts +1 -1
- package/dist/temporary-typings/src/components/TopBar/TopBar.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/TopBar/types.d.ts +2 -1
- package/dist/temporary-typings/src/components/TopBar/types.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/index.d.ts +5 -1
- package/dist/temporary-typings/src/components/index.d.ts.map +1 -1
- package/dist/temporary-typings/src/hooks/useIsOverflowing/index.d.ts +2 -0
- package/dist/temporary-typings/src/hooks/useIsOverflowing/index.d.ts.map +1 -0
- package/dist/temporary-typings/src/hooks/useIsOverflowing/useIsOverflowing.d.ts +3 -0
- package/dist/temporary-typings/src/hooks/useIsOverflowing/useIsOverflowing.d.ts.map +1 -0
- package/dist/temporary-typings/src/utils/index.d.ts +2 -0
- package/dist/temporary-typings/src/utils/index.d.ts.map +1 -1
- package/dist/temporary-typings/src/utils/testId.d.ts +5 -0
- package/dist/temporary-typings/src/utils/testId.d.ts.map +1 -0
- package/package.json +2 -2
- package/typings/index.d.ts +76 -40
|
@@ -23,6 +23,7 @@ Use this skill to build React components using `@maxio-com/react-ui-components`.
|
|
|
23
23
|
- [Foundations / Design Tokens / About](references/foundations-design-tokens-about.md)
|
|
24
24
|
- [Foundations / Design Tokens / Colors / Primitive Colors](references/foundations-design-tokens-colors-primitive-colors.md)
|
|
25
25
|
- [Foundations / Design Tokens / Colors / Semantic Colors](references/foundations-design-tokens-colors-semantic-colors.md)
|
|
26
|
+
- [Foundations / Testing](references/foundations-testing.md)
|
|
26
27
|
- [Components / Action List](references/components-action-list.md)
|
|
27
28
|
- [Components / Action Menu](references/components-action-menu.md)
|
|
28
29
|
- [Components / Avatar](references/components-avatar.md)
|
|
@@ -34,6 +35,7 @@ Use this skill to build React components using `@maxio-com/react-ui-components`.
|
|
|
34
35
|
- [Components / Chip](references/components-chip.md)
|
|
35
36
|
- [Components / Copy To Clipboard](references/components-copy-to-clipboard.md)
|
|
36
37
|
- [Components / Data Table](references/components-data-table.md)
|
|
38
|
+
- [Components / Dialog](references/components-dialog.md)
|
|
37
39
|
- [Components / Drawer](references/components-drawer.md)
|
|
38
40
|
- [Components / Empty State](references/components-empty-state.md)
|
|
39
41
|
- [Components / Flex](references/components-flex.md)
|
|
@@ -54,6 +56,7 @@ Use this skill to build React components using `@maxio-com/react-ui-components`.
|
|
|
54
56
|
- [Components / ListBox](references/components-listbox.md)
|
|
55
57
|
- [Components / Loading Spinner](references/components-loading-spinner.md)
|
|
56
58
|
- [Components / Logo](references/components-logo.md)
|
|
59
|
+
- [Components / Modal](references/components-modal.md)
|
|
57
60
|
- [Components / Notifications / Alert](references/components-notifications-alert.md)
|
|
58
61
|
- [Components / Notifications / Banner](references/components-notifications-banner.md)
|
|
59
62
|
- [Components / Notifications / Toast](references/components-notifications-toast.md)
|
|
@@ -44,6 +44,12 @@ occupying persistent space.
|
|
|
44
44
|
- Keep item labels action-oriented and specific, such as "Edit invoice" or "Cancel subscription".
|
|
45
45
|
- Use icon-only triggers only where repeated layout context makes the menu purpose obvious.
|
|
46
46
|
|
|
47
|
+
### Testing
|
|
48
|
+
|
|
49
|
+
- Pass `data-testid` to `Menu` to set it on the menu. `MenuButton` derives `<id>.trigger` and `MenuList` derives `<id>.list`.
|
|
50
|
+
- A `data-testid` passed to `MenuButton` or `MenuList` overrides the derived ID.
|
|
51
|
+
- See [Testing](foundations-testing.md) for when to use test IDs and how to name them.
|
|
52
|
+
|
|
47
53
|
### Related
|
|
48
54
|
|
|
49
55
|
- **[ActionList](components-action-list.md)**: use for the menu item list inside ActionMenu or for standalone action lists.
|
|
@@ -86,7 +92,9 @@ import { Menu, MenuButton, MenuList } from "@maxio-com/react-ui-components";
|
|
|
86
92
|
|
|
87
93
|
### Menu
|
|
88
94
|
|
|
89
|
-
|
|
95
|
+
| Prop | Type | Required | Default | Description | Source |
|
|
96
|
+
| --- | --- | --- | --- | --- | --- |
|
|
97
|
+
| `data-testid` | `string` | no | - | Test ID set on the component's root element. Components with internal parts derive their IDs from it (e.g. `<id>.row.<rowId>`). | TypeLiteral |
|
|
90
98
|
|
|
91
99
|
## Stories
|
|
92
100
|
|
|
@@ -53,6 +53,7 @@ import { AvatarComponent } from "@maxio-com/react-ui-components";
|
|
|
53
53
|
| --- | --- | --- | --- | --- | --- |
|
|
54
54
|
| `alt` | `string` | no | `avatar` | The alt text of the avatar | TypeLiteral |
|
|
55
55
|
| `className` | `string` | no | - | Class name for the main container | TypeLiteral |
|
|
56
|
+
| `data-testid` | `string` | no | - | Test ID set on the component's root element. Components with internal parts derive their IDs from it (e.g. `<id>.row.<rowId>`). | TypeLiteral |
|
|
56
57
|
| `src` | `string` | yes | - | The image source of the avatar | TypeLiteral |
|
|
57
58
|
|
|
58
59
|
## Stories
|
|
@@ -156,7 +156,7 @@ import { Body, CopyToClipboard, Flex } from "@maxio-com/react-ui-components";
|
|
|
156
156
|
| `onCopyError` | `((error: unknown) => void)` | no | - | Called when the clipboard write fails, such as in an insecure context or when permission is denied. The copied state is not entered. | TypeLiteral |
|
|
157
157
|
| `resetAfterMs` | `number` | no | `2000` | How long the copied state lasts before reverting, in milliseconds. | TypeLiteral |
|
|
158
158
|
| `size` | `"sm" \| "md" \| "lg" \| "xs"` | no | `md` | Changes the size of the button. | TypeLiteral |
|
|
159
|
-
| `tooltipPlacement` | `"
|
|
159
|
+
| `tooltipPlacement` | `"left" \| "right" \| "top" \| "bottom" \| "left-start" \| "left-end" \| "right-start" \| "right-end" \| "top-start" \| "top-end" \| "bottom-start" \| "bottom-end"` | no | `top` | Where the tooltip is positioned relative to the button. | TypeLiteral |
|
|
160
160
|
| `value` | `string` | yes | - | Text written to the clipboard when the button is pressed. | TypeLiteral |
|
|
161
161
|
| `variant` | `"primary" \| "secondary" \| "tertiary" \| "ghost" \| "subtle"` | no | `ghost` | Button variant. | TypeLiteral |
|
|
162
162
|
|
|
@@ -69,6 +69,12 @@ table state.
|
|
|
69
69
|
- Keep row action labels specific to the command or provide a descriptive `aria-label` for icon-only actions.
|
|
70
70
|
- Prefer scannable cell values over long prose. Use expandable custom rows for secondary detail.
|
|
71
71
|
|
|
72
|
+
### Testing
|
|
73
|
+
|
|
74
|
+
- Pass `data-testid` to set it on the table wrapper. The table derives `<id>.header.<columnId>`, `<id>.row.<rowId>` and `<id>.cell.<rowId>.<columnId>`.
|
|
75
|
+
- `<rowId>` comes from `getRowId`. Pass it so row IDs use the record's ID instead of its position.
|
|
76
|
+
- See [Testing](foundations-testing.md) for when to use test IDs and how to name them.
|
|
77
|
+
|
|
72
78
|
### Related
|
|
73
79
|
|
|
74
80
|
- **[Link](components-link.md)**: use for plain text navigation inside table cells.
|
|
@@ -245,7 +251,8 @@ import {
|
|
|
245
251
|
| `actions` | `((row: Row<TData>, table: Table<TData>) => ReactNode)` | no | - | render custom actions cell content | TypeLiteral |
|
|
246
252
|
| `actionsColumnSize` | `number` | no | - | width (in px) of the actions column; defaults to 40 | TypeLiteral |
|
|
247
253
|
| `aggregationFns` | `Record<string, AggregationFn<any>>` | no | - | - | TypeLiteral |
|
|
248
|
-
| `align` | `"
|
|
254
|
+
| `align` | `"left" \| "right"` | no | - | - | TypeLiteral |
|
|
255
|
+
| `data-testid` | `string` | no | - | Test ID set on the component's root element. Components with internal parts derive their IDs from it (e.g. `<id>.row.<rowId>`). | TypeLiteral |
|
|
249
256
|
| `enableExpanding` | `boolean \| "rowsOnly"` | no | - | Enable nested row expansion. Include `'rowsOnly'` for row-level toggles without group expand/collapse header control. | TypeLiteral |
|
|
250
257
|
| `enableRowReordering` | `boolean` | no | `false` | Enable controlled row reordering for small, non-paginated tables. Intended for approximately 100 total rows or fewer, including nested and collapsed rows. Nested row data must use the `subRows` property; custom `getSubRows` accessors are unsupported. | TypeLiteral |
|
|
251
258
|
| `enableSorting` | `boolean` | no | `false` | - | TypeLiteral |
|
|
@@ -259,7 +266,7 @@ import {
|
|
|
259
266
|
| `onSelect` | `((selected: RowSelectionState) => void)` | no | - | function to peek into selection state changes | TypeLiteral |
|
|
260
267
|
| `onSort` | `((selected: SortingState) => void)` | no | - | function to peek into sorting state changes | TypeLiteral |
|
|
261
268
|
| `pattern` | `boolean` | no | - | - | TypeLiteral |
|
|
262
|
-
| `rowReorderMode` | `"
|
|
269
|
+
| `rowReorderMode` | `"siblings" \| "same-level" \| "all"` | no | `siblings` | - | TypeLiteral |
|
|
263
270
|
| `size` | `"sm" \| "md" \| "lg"` | no | `md` | - | TypeLiteral |
|
|
264
271
|
| `sortingFns` | `Record<string, SortingFn<any>>` | no | - | - | TypeLiteral |
|
|
265
272
|
| `SubRowComponent` | `((row: Row<TData>) => ReactNode)` | no | - | - | TypeLiteral |
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Dialog
|
|
2
|
+
|
|
3
|
+
## Imports
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { Body, Button, Dialog, DialogTrigger, Popover } from "@maxio-com/react-ui-components";
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Prop Types
|
|
10
|
+
|
|
11
|
+
### Dialog
|
|
12
|
+
|
|
13
|
+
| Prop | Type | Required | Default | Description | Source |
|
|
14
|
+
| --- | --- | --- | --- | --- | --- |
|
|
15
|
+
| `children` | `ReactNode \| ((opts: { close: () => void; }) => ReactNode)` | yes | - | Body content. A function receives `close` to dismiss the dialog. | DialogProps |
|
|
16
|
+
| `className` | `string` | no | - | - | DialogProps |
|
|
17
|
+
| `description` | `ReactNode` | no | - | Optional supporting text below the title. | DialogProps |
|
|
18
|
+
| `footer` | `ReactNode \| ((opts: { close: () => void; }) => ReactNode)` | no | - | Footer content, such as primary and secondary actions. A function receives `close`, so actions can dismiss an uncontrolled dialog. | DialogProps |
|
|
19
|
+
| `showCloseButton` | `boolean` | no | `role !== 'alertdialog'` | Shows the close button in the header. Defaults to `true`, or `false` when `role="alertdialog"`. | DialogProps |
|
|
20
|
+
| `title` | `ReactNode` | yes | - | Visible heading. It is also the dialog's accessible name. | DialogProps |
|
|
21
|
+
|
|
22
|
+
## Stories
|
|
23
|
+
|
|
24
|
+
### In a popover
|
|
25
|
+
|
|
26
|
+
Inside a Popover, the Dialog keeps the title connected and adds a close
|
|
27
|
+
button, while the Popover stays anchored to its trigger.
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
const InPopover = () => <DialogTrigger>
|
|
31
|
+
<Button variant="secondary">Billing contact</Button>
|
|
32
|
+
<Popover placement="bottom start">
|
|
33
|
+
<Dialog
|
|
34
|
+
title="Billing contact"
|
|
35
|
+
description="Who receives invoices for this customer."
|
|
36
|
+
footer={({ close }) => (
|
|
37
|
+
<Button size="sm" onClick={close}>
|
|
38
|
+
Done
|
|
39
|
+
</Button>
|
|
40
|
+
)}>
|
|
41
|
+
<Body size="sm">Jane Doe · billing@acme.com</Body>
|
|
42
|
+
</Dialog>
|
|
43
|
+
</Popover>
|
|
44
|
+
</DialogTrigger>;
|
|
45
|
+
```
|
|
@@ -40,6 +40,11 @@
|
|
|
40
40
|
- Put primary and secondary actions in `footer` rather than at the end of the scrollable body.
|
|
41
41
|
- Keep body content scannable; long-form content should still fit the drawer's fixed width or height.
|
|
42
42
|
|
|
43
|
+
### Testing
|
|
44
|
+
|
|
45
|
+
- Pass `data-testid` to set it on the drawer panel. The close button derives `<id>.close`.
|
|
46
|
+
- See [Testing](foundations-testing.md) for when to use test IDs and how to name them.
|
|
47
|
+
|
|
43
48
|
### Related
|
|
44
49
|
|
|
45
50
|
- **[Popover](components-popover.md)**: use for lighter-weight, anchored content that doesn't need to block the page.
|
|
@@ -65,11 +70,12 @@ import { Body, Button, DialogTrigger, Drawer } from "@maxio-com/react-ui-compone
|
|
|
65
70
|
| --- | --- | --- | --- | --- | --- |
|
|
66
71
|
| `backdrop` | `"none" \| "dim"` | no | `dim` | - | DrawerProps |
|
|
67
72
|
| `className` | `string` | no | - | - | DrawerProps |
|
|
73
|
+
| `data-testid` | `string` | no | - | Test ID set on the component's root element. Components with internal parts derive their IDs from it (e.g. `<id>.row.<rowId>`). | TypeLiteral |
|
|
68
74
|
| `description` | `string` | no | - | - | DrawerProps |
|
|
69
75
|
| `footer` | `ReactNode` | no | - | - | DrawerProps |
|
|
70
76
|
| `onOpenChange` | `((open: boolean) => void)` | no | - | - | DrawerProps |
|
|
71
77
|
| `open` | `boolean` | no | - | - | DrawerProps |
|
|
72
|
-
| `placement` | `"
|
|
78
|
+
| `placement` | `"left" \| "right" \| "top" \| "bottom"` | no | `right` | - | DrawerProps |
|
|
73
79
|
| `size` | `"sm" \| "md" \| "lg" \| "xl" \| "full"` | no | `md` | - | DrawerProps |
|
|
74
80
|
| `title` | `string` | yes | - | - | DrawerProps |
|
|
75
81
|
|
|
@@ -65,11 +65,11 @@ import { Flex } from "@maxio-com/react-ui-components";
|
|
|
65
65
|
| `basis` | `"auto" \| "1/2" \| "1/3" \| "2/3" \| "1/4" \| "2/4" \| "3/4" \| "1/5" \| "2/5" \| "3/5" \| "4/5" \| "1/6" \| "2/6" \| "3/6" \| "4/6" \| "5/6" \| "1/12" \| "2/12" \| "3/12" \| "4/12" \| "5/12" \| "6/12" \| "7/12" \| "8/12" \| "9/12" \| "10/12" \| "11/12" \| "full"` | no | - | Defines the initial size of flex items. | TypeLiteral |
|
|
66
66
|
| `children` | `ReactNode` | no | - | The content of the flex container. Can be any valid `ReactNode`. | TypeLiteral, DOMAttributes |
|
|
67
67
|
| `className` | `string` | no | - | Additional class names for custom styling. | TypeLiteral, HTMLAttributes |
|
|
68
|
-
| `flex` | `"
|
|
68
|
+
| `flex` | `"auto" \| 1 \| "none" \| "initial"` | no | - | Controls how flex items both grow and shrink. | TypeLiteral |
|
|
69
69
|
| `flexDirection` | `"row" \| "col" \| "row-reverse" \| "col-reverse"` | no | - | Defines the flex direction. Default orientation is `row`. | TypeLiteral |
|
|
70
|
-
| `gap` | `0 \| 1 \| "px" \| 0.5 \| 1.5 \| 2
|
|
71
|
-
| `gapX` | `0 \| 1 \| "px" \| 0.5 \| 1.5 \| 2
|
|
72
|
-
| `gapY` | `0 \| 1 \| "px" \| 0.5 \| 1.5 \| 2
|
|
70
|
+
| `gap` | `0 \| 2 \| 1 \| 12 \| 24 \| "px" \| 0.5 \| 1.5 \| 2.5 \| 3 \| 3.5 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 14 \| 16 \| 20 \| 28 \| 32 \| 36 \| 40 \| 44 \| 48 \| 52 \| 56 \| 60 \| 64 \| 72 \| 80 \| 96` | no | - | Controls the vertical and horizontal space between flex items. | TypeLiteral |
|
|
71
|
+
| `gapX` | `0 \| 2 \| 1 \| 12 \| 24 \| "px" \| 0.5 \| 1.5 \| 2.5 \| 3 \| 3.5 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 14 \| 16 \| 20 \| 28 \| 32 \| 36 \| 40 \| 44 \| 48 \| 52 \| 56 \| 60 \| 64 \| 72 \| 80 \| 96` | no | - | Controls the horizontal space between flex items. | TypeLiteral |
|
|
72
|
+
| `gapY` | `0 \| 2 \| 1 \| 12 \| 24 \| "px" \| 0.5 \| 1.5 \| 2.5 \| 3 \| 3.5 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 14 \| 16 \| 20 \| 28 \| 32 \| 36 \| 40 \| 44 \| 48 \| 52 \| 56 \| 60 \| 64 \| 72 \| 80 \| 96` | no | - | Controls the vertical space between flex items. | TypeLiteral |
|
|
73
73
|
| `grow` | `boolean` | no | - | Allows or restricts growing. | TypeLiteral |
|
|
74
74
|
| `justifyContent` | `"start" \| "center" \| "end" \| "stretch" \| "normal" \| "between" \| "around" \| "evenly"` | no | - | Controls how flex items are positioned along the main axis (defined by `FlexDirection`). | TypeLiteral |
|
|
75
75
|
| `shrink` | `boolean` | no | - | Allows or restricts shrinking. | TypeLiteral |
|
|
@@ -67,19 +67,19 @@ import { Grid } from "@maxio-com/react-ui-components";
|
|
|
67
67
|
| `alignItems` | `"start" \| "center" \| "end" \| "baseline" \| "stretch"` | no | - | Apply to child Grid components. Controls how item is positioned vertically. | TypeLiteral |
|
|
68
68
|
| `autoColumns` | `"auto" \| "max" \| "min" \| "fr"` | no | - | Sets the size of columns that do not have a specified size. | TypeLiteral |
|
|
69
69
|
| `autoRows` | `"auto" \| "max" \| "min" \| "fr"` | no | - | Sets the size of rows that do not have a specified size. | TypeLiteral |
|
|
70
|
-
| `column` | `
|
|
71
|
-
| `columnEnd` | `"auto" \| 1 \|
|
|
72
|
-
| `columnStart` | `"auto" \| 1 \|
|
|
73
|
-
| `gap` | `0 \| 1 \| "px" \| 0.5 \| 1.5 \| 2
|
|
74
|
-
| `gapX` | `0 \| 1 \| "px" \| 0.5 \| 1.5 \| 2
|
|
75
|
-
| `gapY` | `0 \| 1 \| "px" \| 0.5 \| 1.5 \| 2
|
|
70
|
+
| `column` | `2 \| "auto" \| 1 \| 12 \| "full" \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 13` | no | - | Apply to child Grid components. Sets the number of columns the item spans. Values can be overridden by `columnStart` and `columnEnd`. | TypeLiteral |
|
|
71
|
+
| `columnEnd` | `2 \| "auto" \| 1 \| 12 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 13` | no | - | Apply to child Grid components. Sets the item's ending column. Needs `columnStart` to span multiple columns. | TypeLiteral |
|
|
72
|
+
| `columnStart` | `2 \| "auto" \| 1 \| 12 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 13` | no | - | Apply to child Grid components. Sets the item's starting column. | TypeLiteral |
|
|
73
|
+
| `gap` | `0 \| 2 \| 1 \| 12 \| 24 \| "px" \| 0.5 \| 1.5 \| 2.5 \| 3 \| 3.5 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 14 \| 16 \| 20 \| 28 \| 32 \| 36 \| 40 \| 44 \| 48 \| 52 \| 56 \| 60 \| 64 \| 72 \| 80 \| 96` | no | - | Controls the vertical and horizontal space between grid items. Can be overridden by `gapX` and `gapY`. | TypeLiteral |
|
|
74
|
+
| `gapX` | `0 \| 2 \| 1 \| 12 \| 24 \| "px" \| 0.5 \| 1.5 \| 2.5 \| 3 \| 3.5 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 14 \| 16 \| 20 \| 28 \| 32 \| 36 \| 40 \| 44 \| 48 \| 52 \| 56 \| 60 \| 64 \| 72 \| 80 \| 96` | no | - | Controls the horizontal space between grid items. | TypeLiteral |
|
|
75
|
+
| `gapY` | `0 \| 2 \| 1 \| 12 \| 24 \| "px" \| 0.5 \| 1.5 \| 2.5 \| 3 \| 3.5 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 14 \| 16 \| 20 \| 28 \| 32 \| 36 \| 40 \| 44 \| 48 \| 52 \| 56 \| 60 \| 64 \| 72 \| 80 \| 96` | no | - | Controls the vertical space between grid items. | TypeLiteral |
|
|
76
76
|
| `inline` | `boolean` | no | - | Changes grid from block element to inline element. | TypeLiteral |
|
|
77
77
|
| `justifyContent` | `"start" \| "center" \| "end" \| "stretch" \| "normal" \| "between" \| "around" \| "evenly"` | no | - | Apply to child Grid components. Controls how grid item is positioned horizontally. | TypeLiteral |
|
|
78
|
-
| `row` | `
|
|
79
|
-
| `rowEnd` | `"auto" \| 1 \|
|
|
80
|
-
| `rowStart` | `"auto" \| 1 \|
|
|
81
|
-
| `templateColumns` | `
|
|
82
|
-
| `templateRows` | `
|
|
78
|
+
| `row` | `2 \| "auto" \| 1 \| 12 \| "full" \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 13` | no | - | Apply to child Grid components. Sets the number of rows the item spans. Values can be overridden by `rowStart` and `rowEnd`. | TypeLiteral |
|
|
79
|
+
| `rowEnd` | `2 \| "auto" \| 1 \| 12 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 13` | no | - | Apply to child Grid components. Sets the item's ending row. Needs `rowStart` to span multiple columns. | TypeLiteral |
|
|
80
|
+
| `rowStart` | `2 \| "auto" \| 1 \| 12 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 13` | no | - | Apply to child Grid components. Sets the item's starting row. | TypeLiteral |
|
|
81
|
+
| `templateColumns` | `2 \| 1 \| "none" \| 12 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| "subgrid"` | no | - | Sets number of columns in the grid. | TypeLiteral |
|
|
82
|
+
| `templateRows` | `2 \| 1 \| "none" \| 12 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| "subgrid"` | no | - | Sets number of rows in the grid. | TypeLiteral |
|
|
83
83
|
|
|
84
84
|
## Stories
|
|
85
85
|
|
|
@@ -111,6 +111,7 @@ import { Icon } from "@maxio-com/react-ui-components";
|
|
|
111
111
|
| --- | --- | --- | --- | --- | --- |
|
|
112
112
|
| `className` | `string` | no | - | Class name for the main container | TypeLiteral |
|
|
113
113
|
| `color` | `string` | no | - | The icon color | TypeLiteral |
|
|
114
|
+
| `data-testid` | `string` | no | - | Test ID set on the component's root element. Components with internal parts derive their IDs from it (e.g. `<id>.row.<rowId>`). | TypeLiteral |
|
|
114
115
|
| `size` | `"md" \| "lg" \| "xs"` | no | - | The icon size | TypeLiteral |
|
|
115
116
|
| `variant` | `string` | yes | - | The icon variant | TypeLiteral |
|
|
116
117
|
|
|
@@ -68,6 +68,7 @@ import { LoadingSpinner } from "@maxio-com/react-ui-components";
|
|
|
68
68
|
| Prop | Type | Required | Default | Description | Source |
|
|
69
69
|
| --- | --- | --- | --- | --- | --- |
|
|
70
70
|
| `className` | `string` | no | - | Class name for the main container | TypeLiteral |
|
|
71
|
+
| `data-testid` | `string` | no | - | Test ID set on the component's root element. Components with internal parts derive their IDs from it (e.g. `<id>.row.<rowId>`). | TypeLiteral |
|
|
71
72
|
| `size` | `"sm" \| "md" \| "lg" \| "xl"` | no | `md` | The size of the loading spinner | TypeLiteral |
|
|
72
73
|
| `white` | `boolean` | no | `false` | Changes color of the spinner to white for use on dark backgrounds. | TypeLiteral |
|
|
73
74
|
|
|
@@ -53,6 +53,7 @@ import { LogoComponent } from "@maxio-com/react-ui-components";
|
|
|
53
53
|
| --- | --- | --- | --- | --- | --- |
|
|
54
54
|
| `alt` | `string` | no | - | The alt text of the logo | TypeLiteral |
|
|
55
55
|
| `className` | `string` | no | - | Class name for the svg element of the logo | TypeLiteral |
|
|
56
|
+
| `data-testid` | `string` | no | - | Test ID set on the component's root element. Components with internal parts derive their IDs from it (e.g. `<id>.row.<rowId>`). | TypeLiteral |
|
|
56
57
|
| `size` | `number \| "sm" \| "md" \| "lg"` | no | - | Size of the logo, by default uses 'sm'. Pass a number for a custom pixel height (e.g. 20 → '20px'). | TypeLiteral |
|
|
57
58
|
| `variant` | `"mark" \| "lockup"` | no | - | Variant of the logo, by default uses 'lockup' | TypeLiteral |
|
|
58
59
|
|