@wallarm-org/design-system 4.20.0 → 4.20.2-rc-fix-drawer-exit-complete.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/dist/components/Drawer/Drawer.d.ts +5 -3
- package/dist/components/Drawer/DrawerContext/DrawerProvider.js +23 -20
- package/dist/components/Drawer/DrawerOverlay.js +15 -9
- package/dist/components/Table/TableHeadCell.js +2 -2
- package/dist/components/Table/lib/useColumnDnd.js +47 -38
- package/dist/guidelines/patterns/detail-drawer.md +1 -1
- package/dist/metadata/components.json +4 -4
- package/dist/metadata/guidelines.json +3 -3
- package/package.json +1 -1
|
@@ -34,9 +34,11 @@ export interface DrawerProps extends TestableProps {
|
|
|
34
34
|
/** Fired when the user presses the Escape key while the drawer is open. */
|
|
35
35
|
onEscapeKeyDown?: (event: KeyboardEvent) => void;
|
|
36
36
|
/**
|
|
37
|
-
* Fires once
|
|
38
|
-
*
|
|
39
|
-
*
|
|
37
|
+
* Fires once per close, after the last of the panel's and the backdrop's exit animations ends,
|
|
38
|
+
* or about a frame after the close when nothing animates. In a tab hidden when the drawer closes
|
|
39
|
+
* it fires at once; in one hidden mid-exit, it can wait until the tab is shown again. Not fired
|
|
40
|
+
* when the drawer reopens before the exit ends, when it never opened, or when it unmounts open or
|
|
41
|
+
* mid-exit, as a drawer inside another one's content does when the outer one closes.
|
|
40
42
|
*/
|
|
41
43
|
onExitComplete?: () => void;
|
|
42
44
|
}
|
|
@@ -23,6 +23,8 @@ const DrawerProvider = (t0)=>{
|
|
|
23
23
|
const [t5, setIsOpenUncontrolled] = useControlled(t4);
|
|
24
24
|
const isOpen = void 0 === t5 ? false : t5;
|
|
25
25
|
const contentId = useId();
|
|
26
|
+
const [openOverlay, setOpenOverlay] = useState(overlay);
|
|
27
|
+
if (isOpen && overlay !== openOverlay) setOpenOverlay(overlay);
|
|
26
28
|
const [width, setWidth] = useState(initialWidth);
|
|
27
29
|
const [isResizing, setIsResizing] = useState(false);
|
|
28
30
|
let t6;
|
|
@@ -36,13 +38,14 @@ const DrawerProvider = (t0)=>{
|
|
|
36
38
|
$[4] = t6;
|
|
37
39
|
} else t6 = $[4];
|
|
38
40
|
const handleOpenChange = t6;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
const t7 = isOpen ? overlay : openOverlay;
|
|
42
|
+
let t8;
|
|
43
|
+
if ($[5] !== closeOnEscape || $[6] !== contentId || $[7] !== handleOpenChange || $[8] !== isOpen || $[9] !== isResizing || $[10] !== maxWidth || $[11] !== minWidth || $[12] !== modal || $[13] !== t7 || $[14] !== width) {
|
|
44
|
+
t8 = {
|
|
42
45
|
isOpen,
|
|
43
46
|
onOpenChange: handleOpenChange,
|
|
44
47
|
closeOnEscape,
|
|
45
|
-
overlay,
|
|
48
|
+
overlay: t7,
|
|
46
49
|
modal,
|
|
47
50
|
contentId,
|
|
48
51
|
width,
|
|
@@ -60,14 +63,14 @@ const DrawerProvider = (t0)=>{
|
|
|
60
63
|
$[10] = maxWidth;
|
|
61
64
|
$[11] = minWidth;
|
|
62
65
|
$[12] = modal;
|
|
63
|
-
$[13] =
|
|
66
|
+
$[13] = t7;
|
|
64
67
|
$[14] = width;
|
|
65
|
-
$[15] =
|
|
66
|
-
} else
|
|
67
|
-
const contextValue =
|
|
68
|
-
let
|
|
68
|
+
$[15] = t8;
|
|
69
|
+
} else t8 = $[15];
|
|
70
|
+
const contextValue = t8;
|
|
71
|
+
let t9;
|
|
69
72
|
if ($[16] !== children || $[17] !== isOpen || $[18] !== kind) {
|
|
70
|
-
|
|
73
|
+
t9 = /*#__PURE__*/ jsx(DrawerNestingProvider, {
|
|
71
74
|
kind: kind,
|
|
72
75
|
open: isOpen,
|
|
73
76
|
children: children
|
|
@@ -75,18 +78,18 @@ const DrawerProvider = (t0)=>{
|
|
|
75
78
|
$[16] = children;
|
|
76
79
|
$[17] = isOpen;
|
|
77
80
|
$[18] = kind;
|
|
78
|
-
$[19] =
|
|
79
|
-
} else
|
|
80
|
-
let
|
|
81
|
-
if ($[20] !== contextValue || $[21] !==
|
|
82
|
-
|
|
81
|
+
$[19] = t9;
|
|
82
|
+
} else t9 = $[19];
|
|
83
|
+
let t10;
|
|
84
|
+
if ($[20] !== contextValue || $[21] !== t9) {
|
|
85
|
+
t10 = /*#__PURE__*/ jsx(DrawerContext.Provider, {
|
|
83
86
|
value: contextValue,
|
|
84
|
-
children:
|
|
87
|
+
children: t9
|
|
85
88
|
});
|
|
86
89
|
$[20] = contextValue;
|
|
87
|
-
$[21] =
|
|
88
|
-
$[22] =
|
|
89
|
-
} else
|
|
90
|
-
return
|
|
90
|
+
$[21] = t9;
|
|
91
|
+
$[22] = t10;
|
|
92
|
+
} else t10 = $[22];
|
|
93
|
+
return t10;
|
|
91
94
|
};
|
|
92
95
|
export { DrawerProvider };
|
|
@@ -1,25 +1,31 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
3
|
import { Dialog } from "@ark-ui/react/dialog";
|
|
4
|
+
import { useTestId } from "../../utils/testId.js";
|
|
4
5
|
import { Overlay } from "../Overlay/index.js";
|
|
5
6
|
const DrawerOverlay = (t0)=>{
|
|
6
|
-
const $ = c(
|
|
7
|
+
const $ = c(5);
|
|
7
8
|
const { ref } = t0;
|
|
9
|
+
const testId = useTestId("overlay");
|
|
8
10
|
let t1;
|
|
9
|
-
if ($[0]
|
|
10
|
-
t1 = /*#__PURE__*/ jsx(Overlay, {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
if ($[0] !== testId) {
|
|
12
|
+
t1 = /*#__PURE__*/ jsx(Overlay, {
|
|
13
|
+
"data-testid": testId
|
|
14
|
+
});
|
|
15
|
+
$[0] = testId;
|
|
16
|
+
$[1] = t1;
|
|
17
|
+
} else t1 = $[1];
|
|
13
18
|
let t2;
|
|
14
|
-
if ($[
|
|
19
|
+
if ($[2] !== ref || $[3] !== t1) {
|
|
15
20
|
t2 = /*#__PURE__*/ jsx(Dialog.Backdrop, {
|
|
16
21
|
ref: ref,
|
|
17
22
|
asChild: true,
|
|
18
23
|
children: t1
|
|
19
24
|
});
|
|
20
|
-
$[
|
|
21
|
-
$[
|
|
22
|
-
|
|
25
|
+
$[2] = ref;
|
|
26
|
+
$[3] = t1;
|
|
27
|
+
$[4] = t2;
|
|
28
|
+
} else t2 = $[4];
|
|
23
29
|
return t2;
|
|
24
30
|
};
|
|
25
31
|
DrawerOverlay.displayName = "DrawerOverlay";
|
|
@@ -5,7 +5,7 @@ import { useTableContext } from "../TableContext/useTableContext.js";
|
|
|
5
5
|
import { getDndStyles } from "./getDndStyles.js";
|
|
6
6
|
import { useTableValue } from "./tableReactivity.js";
|
|
7
7
|
const useColumnDnd = (column)=>{
|
|
8
|
-
const $ = c(
|
|
8
|
+
const $ = c(30);
|
|
9
9
|
const { columnDndEnabled, alwaysPinnedLeft, columnDndStyles } = useTableContext();
|
|
10
10
|
let t0;
|
|
11
11
|
if ($[0] !== column) {
|
|
@@ -34,43 +34,52 @@ const useColumnDnd = (column)=>{
|
|
|
34
34
|
const canDnd = t2;
|
|
35
35
|
const t3 = !canDnd;
|
|
36
36
|
let t4;
|
|
37
|
-
if ($[10]
|
|
37
|
+
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
38
38
|
t4 = {
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
role: "columnheader",
|
|
40
|
+
tabIndex: -1
|
|
41
41
|
};
|
|
42
|
-
$[10] =
|
|
43
|
-
|
|
44
|
-
$[12] = t4;
|
|
45
|
-
} else t4 = $[12];
|
|
46
|
-
const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable(t4);
|
|
42
|
+
$[10] = t4;
|
|
43
|
+
} else t4 = $[10];
|
|
47
44
|
let t5;
|
|
48
|
-
if ($[
|
|
49
|
-
t5 =
|
|
45
|
+
if ($[11] !== column.id || $[12] !== t3) {
|
|
46
|
+
t5 = {
|
|
47
|
+
id: column.id,
|
|
48
|
+
disabled: t3,
|
|
49
|
+
attributes: t4
|
|
50
|
+
};
|
|
51
|
+
$[11] = column.id;
|
|
52
|
+
$[12] = t3;
|
|
53
|
+
$[13] = t5;
|
|
54
|
+
} else t5 = $[13];
|
|
55
|
+
const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable(t5);
|
|
56
|
+
let t6;
|
|
57
|
+
if ($[14] !== canDnd || $[15] !== isDragging || $[16] !== transform || $[17] !== transition) {
|
|
58
|
+
t6 = getDndStyles({
|
|
50
59
|
canDnd,
|
|
51
60
|
isDragging,
|
|
52
61
|
transform,
|
|
53
62
|
transition
|
|
54
63
|
});
|
|
55
|
-
$[
|
|
56
|
-
$[
|
|
57
|
-
$[
|
|
58
|
-
$[
|
|
59
|
-
$[
|
|
60
|
-
} else
|
|
61
|
-
const dndStyle =
|
|
62
|
-
let t6;
|
|
63
|
-
if ($[18] !== column.id || $[19] !== columnDndStyles || $[20] !== dndStyle) {
|
|
64
|
-
t6 = ()=>columnDndStyles.set(column.id, dndStyle);
|
|
65
|
-
$[18] = column.id;
|
|
66
|
-
$[19] = columnDndStyles;
|
|
67
|
-
$[20] = dndStyle;
|
|
68
|
-
$[21] = t6;
|
|
69
|
-
} else t6 = $[21];
|
|
70
|
-
useLayoutEffect(t6);
|
|
64
|
+
$[14] = canDnd;
|
|
65
|
+
$[15] = isDragging;
|
|
66
|
+
$[16] = transform;
|
|
67
|
+
$[17] = transition;
|
|
68
|
+
$[18] = t6;
|
|
69
|
+
} else t6 = $[18];
|
|
70
|
+
const dndStyle = t6;
|
|
71
71
|
let t7;
|
|
72
|
-
if ($[
|
|
73
|
-
t7 =
|
|
72
|
+
if ($[19] !== column.id || $[20] !== columnDndStyles || $[21] !== dndStyle) {
|
|
73
|
+
t7 = ()=>columnDndStyles.set(column.id, dndStyle);
|
|
74
|
+
$[19] = column.id;
|
|
75
|
+
$[20] = columnDndStyles;
|
|
76
|
+
$[21] = dndStyle;
|
|
77
|
+
$[22] = t7;
|
|
78
|
+
} else t7 = $[22];
|
|
79
|
+
useLayoutEffect(t7);
|
|
80
|
+
let t8;
|
|
81
|
+
if ($[23] !== attributes || $[24] !== canDnd || $[25] !== dndStyle || $[26] !== isDragging || $[27] !== listeners || $[28] !== setNodeRef) {
|
|
82
|
+
t8 = {
|
|
74
83
|
canDnd,
|
|
75
84
|
isDragging,
|
|
76
85
|
setNodeRef,
|
|
@@ -78,14 +87,14 @@ const useColumnDnd = (column)=>{
|
|
|
78
87
|
attributes,
|
|
79
88
|
listeners
|
|
80
89
|
};
|
|
81
|
-
$[
|
|
82
|
-
$[
|
|
83
|
-
$[
|
|
84
|
-
$[
|
|
85
|
-
$[
|
|
86
|
-
$[
|
|
87
|
-
$[
|
|
88
|
-
} else
|
|
89
|
-
return
|
|
90
|
+
$[23] = attributes;
|
|
91
|
+
$[24] = canDnd;
|
|
92
|
+
$[25] = dndStyle;
|
|
93
|
+
$[26] = isDragging;
|
|
94
|
+
$[27] = listeners;
|
|
95
|
+
$[28] = setNodeRef;
|
|
96
|
+
$[29] = t8;
|
|
97
|
+
} else t8 = $[29];
|
|
98
|
+
return t8;
|
|
90
99
|
};
|
|
91
100
|
export { useColumnDnd };
|
|
@@ -29,7 +29,7 @@ A detail drawer is a `Drawer` with no footer. It shows one entity as `Attribute`
|
|
|
29
29
|
|
|
30
30
|
- Mount one controlled `Drawer` (`open`, `onOpenChange`) for the list. **Never** one per row.
|
|
31
31
|
- Open it from the list `Table` `onMasterCellClick`; mark the row with `activeRowId`. Row-menu clicks do not open it.
|
|
32
|
-
- Keep the last entity in state after close so content does not blank.
|
|
32
|
+
- Keep the last entity in state after close so content does not blank. To reset state after close, use `onExitComplete`: it fires once the exit animation ends.
|
|
33
33
|
- Pass `width={640}`. Use 700 (the Figma frame) only if design confirms it. `width` is read once on mount.
|
|
34
34
|
- If resizable, put `DrawerResizeHandle` first in `DrawerContent` (400–1130px).
|
|
35
35
|
- **Never** add a `DrawerFooter` or your own close button.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "4.
|
|
3
|
-
"generatedAt": "2026-11-
|
|
2
|
+
"version": "4.20.1",
|
|
3
|
+
"generatedAt": "2026-11-18T16:55:25.762Z",
|
|
4
4
|
"components": [
|
|
5
5
|
{
|
|
6
6
|
"name": "Accordion",
|
|
@@ -11891,7 +11891,7 @@
|
|
|
11891
11891
|
"name": "onExitComplete",
|
|
11892
11892
|
"type": "(() => void) | undefined",
|
|
11893
11893
|
"required": false,
|
|
11894
|
-
"description": "Fires once
|
|
11894
|
+
"description": "Fires once per close, after the last of the panel's and the backdrop's exit animations ends,\nor about a frame after the close when nothing animates. In a tab hidden when the drawer closes\nit fires at once; in one hidden mid-exit, it can wait until the tab is shown again. Not fired\nwhen the drawer reopens before the exit ends, when it never opened, or when it unmounts open or\nmid-exit, as a drawer inside another one's content does when the outer one closes."
|
|
11895
11895
|
},
|
|
11896
11896
|
{
|
|
11897
11897
|
"name": "data-testid",
|
|
@@ -12342,7 +12342,7 @@
|
|
|
12342
12342
|
"name": "onExitComplete",
|
|
12343
12343
|
"type": "(() => void) | undefined",
|
|
12344
12344
|
"required": false,
|
|
12345
|
-
"description": "Fires once
|
|
12345
|
+
"description": "Fires once per close, after the last of the panel's and the backdrop's exit animations ends,\nor about a frame after the close when nothing animates. In a tab hidden when the drawer closes\nit fires at once; in one hidden mid-exit, it can wait until the tab is shown again. Not fired\nwhen the drawer reopens before the exit ends, when it never opened, or when it unmounts open or\nmid-exit, as a drawer inside another one's content does when the outer one closes."
|
|
12346
12346
|
},
|
|
12347
12347
|
{
|
|
12348
12348
|
"name": "data-testid",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "4.
|
|
2
|
+
"version": "4.20.1",
|
|
3
3
|
"rules": "Every numeric utility is in px, not 4px steps: p-16 is 16px, p-4 is 4px. Translate Tailwind habits (p-4 → p-16, gap-6 → gap-24, w-64 → w-256).\n\nBefore composing a screen, call get_guideline for the pattern (app shell, list page, table, drawer, form, dialog, filters, empty state, settings, auth). Wrong → right:\n\n- p-5, gap-3, p-10 → stay on the scale: 1, 2, 4, 6, 8, 12, 16, 20, 24, 28, 32, 40, 48, 64…\n- space-y-4, margins per child → <VStack gap={16}>, <HStack gap={8}>\n- Padded page wrapper → PageHeader / PageToolbar / PageContent own the 24px gutter\n- p-* on Card, DrawerBody, DialogBody, PageToolbar, Table → none; they own their padding\n- className on Text, Heading, Field, Drawer/Dialog Header/Body/Footer → wrap in your own element\n- Raw <h1>, <p>, <label> → <Heading as=\"h2\" size=\"lg\">, <Text size=\"sm\">, Field\n- <Text> default (16px) for body → size=\"sm\"\n- leading-none (0px), leading-5 (5px) → leading-sm, leading-20\n- weight=\"semibold\" → weight is light|regular|medium|bold (medium = 450)\n- bg-primary, text-muted, bg-card, bg-white → bg-bg-primary, text-text-secondary, bg-bg-surface-1\n- text-error, bg-red-500 → danger tokens; categorical color → Badge color\n- dark: variant, setting data-theme → semantic tokens, useTheme().setTheme()\n- rounded-lg, rounded, rounded-[15px] → rounded-8 (controls), rounded-12 (panels)\n- shadow-* on DS components, z-* on overlays → never; they own both\n- focus:ring → focus-visible:ring-3 ring-focus-primary outline-none\n- size, DIALOG/DRAWER_SIZES → width: Dialog 400 confirm, 560 default, 960 picker; Drawer 640 default, 700 Timeline form\n- Dialog, useToast from the root → @wallarm-org/design-system/Dialog, /Toast\n- Field invalid → error on the control + FieldError\n- Table actions column → meta.renderMenuAction on the master column\n- Hand-built side menu → RemoteShell config={NavConfig}\n- ConfirmDialog, FilterBar, Combobox → compose Dialog parts, PageToolbar + FilterDropdown, Select + useSelectSearch\n- data-slot in tests → data-testid\n",
|
|
4
4
|
"guidelines": [
|
|
5
5
|
{
|
|
@@ -1047,7 +1047,7 @@
|
|
|
1047
1047
|
"master cell"
|
|
1048
1048
|
],
|
|
1049
1049
|
"order": 50,
|
|
1050
|
-
"markdown": "# Detail drawer\n\nA detail drawer is a `Drawer` with no footer. It shows one entity as `Attribute` rows, titled sections and an optional nested `Table`.\n\n## When to use\n\n| Need | Use | Not |\n| --- | --- | --- |\n| Read-only details of one row | This pattern, opened from `Table` `onMasterCellClick` | A new page, a `Dialog` |\n| Edit several fields | A separate edit drawer or dialog. See [Create and edit forms](./create-edit-forms.md) | Inputs inside the detail drawer |\n| Edit one field in place | `InlineEdit` inside `AttributeValue` | A form in the drawer |\n| Actions on the entity | One \"Actions\" `DropdownMenu` in `DrawerHeader` | Several header buttons, a footer |\n| Related collections (roles, rules, members) | `Tabs` with `NumericBadge` counts, one `Table` per tab | Stacked tables with no tabs |\n| A few titled groups of attributes | `Heading` sections split by `Separator` | `Accordion`, a `Card` per group |\n| Confirm a destructive action | A `Dialog` inside `DrawerContent`. See [Confirmation dialogs](./confirmation-dialogs.md) | `window.confirm` |\n| Keep the list usable while open | `modal={false} overlay={false} closeOnOutsideClick={false}` | Default props |\n\n## Rules\n\n**Drawer**\n\n- Mount one controlled `Drawer` (`open`, `onOpenChange`) for the list. **Never** one per row.\n- Open it from the list `Table` `onMasterCellClick`; mark the row with `activeRowId`. Row-menu clicks do not open it.\n- Keep the last entity in state after close so content does not blank.\n- Pass `width={640}`. Use 700 (the Figma frame) only if design confirms it. `width` is read once on mount.\n- If resizable, put `DrawerResizeHandle` first in `DrawerContent` (400–1130px).\n- **Never** add a `DrawerFooter` or your own close button.\n- In tests, pass `data-testid` to `Drawer`. **Never** select by `data-slot`.\n\n**Header actions**\n\n- One `DropdownMenu` in `DrawerHeader`, trigger `Button variant='outline' color='neutral' size='small'` \"Actions\" + `ChevronDown`.\n- Order: edit, state changes, \"Go to …\" links, `DropdownMenuSeparator`, destructive items.\n- Destructive items use `variant='destructive'` and name the entity: \"Delete provider\".\n- Keep the built-in 12px before the close X, though Figma shows 4px.\n\n**Spacing**\n\n- `DrawerBody` owns the 24px gutter. **Never** pad inside it or pass `className` to `DrawerHeader`/`DrawerBody`.\n- Attribute rows: `VStack gap={6} className='pb-8'`. Sections: `Separator spacing={4}`. **Never** a `Separator` above `Tabs`: `TabsList` draws its own line.\n- Section header: `HStack justify='between' align='center' className='py-8'`, `Heading as='h3' size='md' weight='medium'`, optional `Button size='small'`.\n- Full-width tabs: `<div className='-mx-24'>` around `TabsList`, not its `className`. Table 16px from the edge: `<div className='-mx-8'>` around `Table`, never on it. No other negative margins.\n\n**Attributes**\n\n- Always pass `orientation='horizontal'`; the default is vertical.\n- One `AttributeLabel` `width` per drawer: 140 matches Figma; up to 256 for long labels. **Never** wrap a label.\n- Two columns: `grid grid-cols-2 gap-x-8 gap-y-6`, default label width.\n- Section help: an `Info` icon in a `Tooltip` after the heading.\n\n| Data | Value | Not |\n| --- | --- | --- |\n| Plain text | The string as the `AttributeValue` child | A `Text` with your own size |\n| ID, URL, claim, scope, path | `InlineCodeSnippet code={value} size='md'` | `Code`, a monospace `span` |\n| Several codes | Several `InlineCodeSnippet` in `HStack gap={4}` | One joined string |\n| Role, tag, label | `Tag` | `Badge`, plain text |\n| Timestamp | `FormatDateTime format='datetime' layout='inline'` | `toLocaleString()` |\n| Secret | \"Set — never shown\" | Dots, a masked input |\n| Missing value | `Attribute isEmpty` | `N/A`, `0`, your own dash |\n| Icon with text | `HStack gap={6} align='center'` | An `img` with your own margin |\n\n`InlineCodeSnippet` copies on click; `copyable={false}` turns that off.\n\n**Tabs and tables**\n\n- Keep `Tabs` in `DrawerBody` to scroll with the attributes. Pinned tabs: `Tabs asChild` around `DrawerHeader`, `TabsList`, `DrawerBody` (`Drawer` `WithTabs` story); attributes then go in each `TabsContent`.\n- Tab action: `Button size='small'` in `TabsLineActions`.\n- Nested tables follow [Entity table](./entity-table.md). **Never** use `TableActionBar` in a drawer: it renders underneath.\n\n**Does not exist:** `DRAWER_SIZES`, a `size` prop on `Drawer`, `DrawerActions`, `DrawerHeaderActions`, `AttributeGroup`, `AttributeList`, `DescriptionList`, a section component, `fullBleed` on `TabsList` or `Table`.\n\n## Examples\n\nThe list opens one shared drawer from the master cell.\n\nClick a provider name: one shared, non-modal drawer opens and the row stays marked. The header\nhas a single \"Actions\" menu; the body has horizontal attributes (a code value, a secret, a\ntimestamp), then full-width tabs with counts, each with an inset nested table. Google Workspace\nhas no rules, so its table keeps the headers and shows a short empty state.\n\n```tsx story=Default\nimport { useState } from 'react';\nimport { Attribute, AttributeLabel, AttributeValue } from '@wallarm-org/design-system/Attribute';\nimport { Button } from '@wallarm-org/design-system/Button';\nimport { InlineCodeSnippet } from '@wallarm-org/design-system/CodeSnippet';\nimport { Drawer, DrawerBody, DrawerContent, DrawerHeader, DrawerResizeHandle, DrawerTitle } from '@wallarm-org/design-system/Drawer';\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemText, DropdownMenuSeparator, DropdownMenuTrigger } from '@wallarm-org/design-system/DropdownMenu';\nimport { EmptyState, EmptyStateMessage, EmptyStateTitle } from '@wallarm-org/design-system/EmptyState';\nimport { FormatDateTime } from '@wallarm-org/design-system/FormatDateTime';\nimport { ChevronDown, Plus } from '@wallarm-org/design-system/icons';\nimport { NumericBadge } from '@wallarm-org/design-system/NumericBadge';\nimport { Page, PageContent, PageHeader, PageHeaderGroup, PageTitle } from '@wallarm-org/design-system/Page';\nimport { VStack } from '@wallarm-org/design-system/Stack';\nimport { type TableCellContext, type TableColumnDef, Table } from '@wallarm-org/design-system/Table';\nimport { Tabs, TabsContent, TabsLineActions, TabsList, TabsTrigger } from '@wallarm-org/design-system/Tabs';\nimport { Tag } from '@wallarm-org/design-system/Tag';\n\nexport const Default = () => {\n const [selectedId, setSelectedId] = useState<string | null>(null);\n const [open, setOpen] = useState(false);\n const [tab, setTab] = useState('rules');\n\n const provider = PROVIDERS.find(item => item.id === selectedId) ?? null;\n\n const renderClaim = ({ row }: TableCellContext<RoleRule, unknown>) => (\n <InlineCodeSnippet code={`${row.original.claim} = ${row.original.value}`} size='md' />\n );\n const renderRole = ({ row }: TableCellContext<RoleRule, unknown>) => (\n <Tag>{row.original.role}</Tag>\n );\n const renderVerifiedAt = ({ row }: TableCellContext<Domain, unknown>) => (\n <FormatDateTime value={row.original.verifiedAt} format='date' />\n );\n\n const columns: TableColumnDef<Provider>[] = [\n { accessorKey: 'name', header: 'Name', size: 260 },\n { accessorKey: 'protocol', header: 'Protocol', size: 180 },\n { accessorKey: 'issuer', header: 'Issuer', size: 360 },\n ];\n const ruleColumns: TableColumnDef<RoleRule>[] = [\n { id: 'claim', header: 'Claim', size: 300, cell: renderClaim },\n { accessorKey: 'role', header: 'Role', size: 200, cell: renderRole },\n ];\n const domainColumns: TableColumnDef<Domain>[] = [\n { accessorKey: 'name', header: 'Domain', size: 300 },\n { accessorKey: 'verifiedAt', header: 'Verified', size: 200, cell: renderVerifiedAt },\n ];\n\n const handleMasterCellClick = (id: string) => {\n setSelectedId(id);\n setOpen(true);\n };\n const handleEdit = () => onEditProvider(provider);\n const handleDisable = () => onDisableProvider(provider);\n const handleGoToAuditLog = () => onGoToAuditLog(provider);\n const handleDelete = () => onDeleteProvider(provider);\n const handleCreateRule = () => onCreateRule(provider);\n\n return (\n <Page name='settings-sso' fullSize fixedHeight data-testid='providers-page'>\n <PageHeader>\n <PageHeaderGroup>\n <PageTitle>SSO providers</PageTitle>\n </PageHeaderGroup>\n </PageHeader>\n\n <PageContent>\n <Table\n aria-label='SSO providers'\n data={PROVIDERS}\n columns={columns}\n getRowId={getProviderId}\n activeRowId={open ? selectedId : null}\n onMasterCellClick={handleMasterCellClick}\n data-testid='providers-table'\n />\n </PageContent>\n\n <Drawer\n open={open}\n onOpenChange={setOpen}\n modal={false}\n overlay={false}\n closeOnOutsideClick={false}\n width={640}\n data-testid='provider-drawer'\n >\n <DrawerContent>\n <DrawerResizeHandle />\n <DrawerHeader>\n <DrawerTitle>{provider?.name}</DrawerTitle>\n <DropdownMenu data-testid='provider-actions'>\n <DropdownMenuTrigger asChild>\n <Button variant='outline' color='neutral' size='small'>\n Actions <ChevronDown />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuItem onSelect={handleEdit}>\n <DropdownMenuItemText>Edit provider</DropdownMenuItemText>\n </DropdownMenuItem>\n <DropdownMenuItem onSelect={handleDisable}>\n <DropdownMenuItemText>Disable provider</DropdownMenuItemText>\n </DropdownMenuItem>\n <DropdownMenuItem onSelect={handleGoToAuditLog}>\n <DropdownMenuItemText>Go to audit log</DropdownMenuItemText>\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem variant='destructive' onSelect={handleDelete}>\n <DropdownMenuItemText>Delete provider</DropdownMenuItemText>\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </DrawerHeader>\n\n <DrawerBody>\n {provider && (\n <>\n <VStack gap={6} className='pb-8' data-testid='provider-attributes'>\n <Attribute orientation='horizontal'>\n <AttributeLabel width={140}>Protocol</AttributeLabel>\n <AttributeValue>{provider.protocol}</AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal'>\n <AttributeLabel width={140}>Issuer URL</AttributeLabel>\n <AttributeValue>\n <InlineCodeSnippet code={provider.issuer} size='md' />\n </AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal'>\n <AttributeLabel width={140}>Client ID</AttributeLabel>\n <AttributeValue>\n <InlineCodeSnippet code={provider.clientId} size='md' />\n </AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal'>\n <AttributeLabel width={140}>Client secret</AttributeLabel>\n <AttributeValue>Set — never shown</AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal' isEmpty={!provider.defaultRole}>\n <AttributeLabel width={140}>Default role</AttributeLabel>\n <AttributeValue>\n {provider.defaultRole && <Tag>{provider.defaultRole}</Tag>}\n </AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal'>\n <AttributeLabel width={140}>Created at</AttributeLabel>\n <AttributeValue>\n <FormatDateTime\n value={provider.createdAt}\n format='datetime'\n layout='inline'\n />\n </AttributeValue>\n </Attribute>\n </VStack>\n\n <Tabs value={tab} onChange={setTab} data-testid='provider-tabs'>\n <div className='-mx-24'>\n <TabsList>\n <TabsTrigger value='rules'>\n Role rules <NumericBadge>{provider.rules.length}</NumericBadge>\n </TabsTrigger>\n <TabsTrigger value='domains'>\n Domains <NumericBadge>{provider.domains.length}</NumericBadge>\n </TabsTrigger>\n <TabsLineActions>\n <Button size='small' onClick={handleCreateRule}>\n <Plus /> Create rule\n </Button>\n </TabsLineActions>\n </TabsList>\n </div>\n <TabsContent value='rules'>\n <div className='-mx-8 pt-8'>\n <Table\n aria-label='Role rules'\n data={provider.rules}\n columns={ruleColumns}\n getRowId={getItemId}\n data-testid='provider-rules-table'\n >\n {provider.rules.length === 0 && (\n <EmptyState type='collection-empty' data-testid='provider-rules-empty'>\n <EmptyStateMessage>\n <EmptyStateTitle>No role rules yet</EmptyStateTitle>\n </EmptyStateMessage>\n </EmptyState>\n )}\n </Table>\n </div>\n </TabsContent>\n <TabsContent value='domains'>\n <div className='-mx-8 pt-8'>\n <Table\n aria-label='Domains'\n data={provider.domains}\n columns={domainColumns}\n getRowId={getItemId}\n data-testid='provider-domains-table'\n >\n {provider.domains.length === 0 && (\n <EmptyState type='collection-empty'>\n <EmptyStateMessage>\n <EmptyStateTitle>No domains yet</EmptyStateTitle>\n </EmptyStateMessage>\n </EmptyState>\n )}\n </Table>\n </div>\n </TabsContent>\n </Tabs>\n </>\n )}\n </DrawerBody>\n </DrawerContent>\n </Drawer>\n </Page>\n );\n};\n```\n\nThe drawer shell with a resize handle and the header actions menu.\n\nDrag the left edge to resize between 400 and 1130px; `onResizeEnd` gets the final width to\npersist. The close X comes built in, so there is no footer and no close button of your own.\n\n```tsx story=Header\nimport { useState } from 'react';\nimport { Attribute, AttributeLabel, AttributeValue } from '@wallarm-org/design-system/Attribute';\nimport { Button } from '@wallarm-org/design-system/Button';\nimport { Drawer, DrawerBody, DrawerContent, DrawerHeader, DrawerResizeHandle, DrawerTitle, DrawerTrigger } from '@wallarm-org/design-system/Drawer';\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemText, DropdownMenuSeparator, DropdownMenuTrigger } from '@wallarm-org/design-system/DropdownMenu';\nimport { ChevronDown } from '@wallarm-org/design-system/icons';\nimport { VStack } from '@wallarm-org/design-system/Stack';\n\nexport const Header = () => {\n const [open, setOpen] = useState(false);\n\n const handleEdit = () => onEditProvider(OKTA);\n const handleDisable = () => onDisableProvider(OKTA);\n const handleGoToAuditLog = () => onGoToAuditLog(OKTA);\n const handleDelete = () => onDeleteProvider(OKTA);\n\n return (\n <Drawer open={open} onOpenChange={setOpen} width={640} data-testid='provider-drawer'>\n <DrawerTrigger asChild>\n <Button variant='outline' color='neutral'>\n View {OKTA.name}\n </Button>\n </DrawerTrigger>\n <DrawerContent>\n <DrawerResizeHandle onResizeEnd={onSaveDrawerWidth} />\n <DrawerHeader>\n <DrawerTitle>{OKTA.name}</DrawerTitle>\n <DropdownMenu data-testid='provider-actions'>\n <DropdownMenuTrigger asChild>\n <Button variant='outline' color='neutral' size='small'>\n Actions <ChevronDown />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuItem onSelect={handleEdit}>\n <DropdownMenuItemText>Edit provider</DropdownMenuItemText>\n </DropdownMenuItem>\n <DropdownMenuItem onSelect={handleDisable}>\n <DropdownMenuItemText>Disable provider</DropdownMenuItemText>\n </DropdownMenuItem>\n <DropdownMenuItem onSelect={handleGoToAuditLog}>\n <DropdownMenuItemText>Go to audit log</DropdownMenuItemText>\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem variant='destructive' onSelect={handleDelete}>\n <DropdownMenuItemText>Delete provider</DropdownMenuItemText>\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </DrawerHeader>\n <DrawerBody>\n <VStack gap={6} className='pb-8'>\n <Attribute orientation='horizontal'>\n <AttributeLabel width={140}>Protocol</AttributeLabel>\n <AttributeValue>{OKTA.protocol}</AttributeValue>\n </Attribute>\n </VStack>\n </DrawerBody>\n </DrawerContent>\n </Drawer>\n );\n};\n```\n\nAttribute rows with a code value, a secret, a missing value and a timestamp.\n\nEvery row is horizontal with the same 140px label. Entra ID has no default role, so that row\nstays and shows the empty marker; the codes copy on click.\n\n```tsx story=Attributes\nimport { useState } from 'react';\nimport { Attribute, AttributeLabel, AttributeValue } from '@wallarm-org/design-system/Attribute';\nimport { Button } from '@wallarm-org/design-system/Button';\nimport { InlineCodeSnippet } from '@wallarm-org/design-system/CodeSnippet';\nimport { Drawer, DrawerBody, DrawerContent, DrawerHeader, DrawerTitle, DrawerTrigger } from '@wallarm-org/design-system/Drawer';\nimport { FormatDateTime } from '@wallarm-org/design-system/FormatDateTime';\nimport { VStack } from '@wallarm-org/design-system/Stack';\nimport { Tag } from '@wallarm-org/design-system/Tag';\n\nexport const Attributes = () => {\n const [open, setOpen] = useState(false);\n\n return (\n <Drawer open={open} onOpenChange={setOpen} width={640} data-testid='provider-drawer'>\n <DrawerTrigger asChild>\n <Button variant='outline' color='neutral'>\n View {ENTRA.name}\n </Button>\n </DrawerTrigger>\n <DrawerContent>\n <DrawerHeader>\n <DrawerTitle>{ENTRA.name}</DrawerTitle>\n </DrawerHeader>\n <DrawerBody>\n <VStack gap={6} className='pb-8' data-testid='provider-attributes'>\n <Attribute orientation='horizontal'>\n <AttributeLabel width={140}>Client ID</AttributeLabel>\n <AttributeValue>\n <InlineCodeSnippet code={ENTRA.clientId} size='md' />\n </AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal'>\n <AttributeLabel width={140}>Client secret</AttributeLabel>\n <AttributeValue>Set — never shown</AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal' isEmpty={!ENTRA.defaultRole}>\n <AttributeLabel width={140}>Default role</AttributeLabel>\n <AttributeValue>{ENTRA.defaultRole && <Tag>{ENTRA.defaultRole}</Tag>}</AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal'>\n <AttributeLabel width={140}>Created at</AttributeLabel>\n <AttributeValue>\n <FormatDateTime value={ENTRA.createdAt} format='datetime' layout='inline' />\n </AttributeValue>\n </Attribute>\n </VStack>\n </DrawerBody>\n </DrawerContent>\n </Drawer>\n );\n};\n```\n\nA section with a title and an action.\n\nThe first group needs no title. Each later group starts with a `Separator` and a header row; the\naction applies to that section only.\n\n```tsx story=Section\nimport { useState } from 'react';\nimport { Attribute, AttributeLabel, AttributeValue } from '@wallarm-org/design-system/Attribute';\nimport { Button } from '@wallarm-org/design-system/Button';\nimport { InlineCodeSnippet } from '@wallarm-org/design-system/CodeSnippet';\nimport { Drawer, DrawerBody, DrawerContent, DrawerHeader, DrawerTitle, DrawerTrigger } from '@wallarm-org/design-system/Drawer';\nimport { FormatDateTime } from '@wallarm-org/design-system/FormatDateTime';\nimport { Heading } from '@wallarm-org/design-system/Heading';\nimport { Separator } from '@wallarm-org/design-system/Separator';\nimport { HStack, VStack } from '@wallarm-org/design-system/Stack';\nimport { Tag } from '@wallarm-org/design-system/Tag';\n\nexport const Section = () => {\n const [open, setOpen] = useState(false);\n\n const handleEditDefaults = () => onEditProvider(OKTA);\n\n return (\n <Drawer open={open} onOpenChange={setOpen} width={640} data-testid='provider-drawer'>\n <DrawerTrigger asChild>\n <Button variant='outline' color='neutral'>\n View {OKTA.name}\n </Button>\n </DrawerTrigger>\n <DrawerContent>\n <DrawerHeader>\n <DrawerTitle>{OKTA.name}</DrawerTitle>\n </DrawerHeader>\n <DrawerBody>\n <VStack gap={6} className='pb-8'>\n <Attribute orientation='horizontal'>\n <AttributeLabel width={140}>Protocol</AttributeLabel>\n <AttributeValue>{OKTA.protocol}</AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal'>\n <AttributeLabel width={140}>Issuer URL</AttributeLabel>\n <AttributeValue>\n <InlineCodeSnippet code={OKTA.issuer} size='md' />\n </AttributeValue>\n </Attribute>\n </VStack>\n\n <Separator spacing={4} />\n\n <HStack\n justify='between'\n align='center'\n className='py-8'\n data-testid='provider-defaults-section'\n >\n <Heading as='h3' size='md' weight='medium'>\n Defaults\n </Heading>\n <Button size='small' variant='outline' color='neutral' onClick={handleEditDefaults}>\n Edit defaults\n </Button>\n </HStack>\n <VStack gap={6} className='pb-8'>\n <Attribute orientation='horizontal' isEmpty={!OKTA.defaultRole}>\n <AttributeLabel width={140}>Default role</AttributeLabel>\n <AttributeValue>{OKTA.defaultRole && <Tag>{OKTA.defaultRole}</Tag>}</AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal'>\n <AttributeLabel width={140}>Created at</AttributeLabel>\n <AttributeValue>\n <FormatDateTime value={OKTA.createdAt} format='datetime' layout='inline' />\n </AttributeValue>\n </Attribute>\n </VStack>\n </DrawerBody>\n </DrawerContent>\n </Drawer>\n );\n};\n```\n\nFull-width tabs with a count and an inset nested table that stays visible when empty.\n\nGoogle Workspace has no rules yet: the table keeps its headers and shows a one-line empty state\nwith no action, since \"Create rule\" already sits on the tab line.\n\n```tsx story=NestedTable\nimport { useState } from 'react';\nimport { Button } from '@wallarm-org/design-system/Button';\nimport { InlineCodeSnippet } from '@wallarm-org/design-system/CodeSnippet';\nimport { Drawer, DrawerBody, DrawerContent, DrawerHeader, DrawerTitle, DrawerTrigger } from '@wallarm-org/design-system/Drawer';\nimport { EmptyState, EmptyStateMessage, EmptyStateTitle } from '@wallarm-org/design-system/EmptyState';\nimport { Plus } from '@wallarm-org/design-system/icons';\nimport { NumericBadge } from '@wallarm-org/design-system/NumericBadge';\nimport { type TableCellContext, type TableColumnDef, Table } from '@wallarm-org/design-system/Table';\nimport { Tabs, TabsContent, TabsLineActions, TabsList, TabsTrigger } from '@wallarm-org/design-system/Tabs';\nimport { Tag } from '@wallarm-org/design-system/Tag';\n\nexport const NestedTable = () => {\n const [open, setOpen] = useState(false);\n const [tab, setTab] = useState('rules');\n\n const renderClaim = ({ row }: TableCellContext<RoleRule, unknown>) => (\n <InlineCodeSnippet code={`${row.original.claim} = ${row.original.value}`} size='md' />\n );\n const renderRole = ({ row }: TableCellContext<RoleRule, unknown>) => (\n <Tag>{row.original.role}</Tag>\n );\n\n const ruleColumns: TableColumnDef<RoleRule>[] = [\n { id: 'claim', header: 'Claim', size: 300, cell: renderClaim },\n { accessorKey: 'role', header: 'Role', size: 200, cell: renderRole },\n ];\n\n const handleCreateRule = () => onCreateRule(GOOGLE);\n\n return (\n <Drawer open={open} onOpenChange={setOpen} width={640} data-testid='provider-drawer'>\n <DrawerTrigger asChild>\n <Button variant='outline' color='neutral'>\n View {GOOGLE.name}\n </Button>\n </DrawerTrigger>\n <DrawerContent>\n <DrawerHeader>\n <DrawerTitle>{GOOGLE.name}</DrawerTitle>\n </DrawerHeader>\n <DrawerBody>\n <Tabs value={tab} onChange={setTab} data-testid='provider-tabs'>\n <div className='-mx-24'>\n <TabsList>\n <TabsTrigger value='rules'>\n Role rules <NumericBadge>{GOOGLE.rules.length}</NumericBadge>\n </TabsTrigger>\n <TabsLineActions>\n <Button size='small' onClick={handleCreateRule}>\n <Plus /> Create rule\n </Button>\n </TabsLineActions>\n </TabsList>\n </div>\n <TabsContent value='rules'>\n <div className='-mx-8 pt-8'>\n <Table\n aria-label='Role rules'\n data={GOOGLE.rules}\n columns={ruleColumns}\n getRowId={getItemId}\n data-testid='provider-rules-table'\n >\n {GOOGLE.rules.length === 0 && (\n <EmptyState type='collection-empty' data-testid='provider-rules-empty'>\n <EmptyStateMessage>\n <EmptyStateTitle>No role rules yet</EmptyStateTitle>\n </EmptyStateMessage>\n </EmptyState>\n )}\n </Table>\n </div>\n </TabsContent>\n </Tabs>\n </DrawerBody>\n </DrawerContent>\n </Drawer>\n );\n};\n```\n\n## States\n\n| State | Show | Example component |\n| --- | --- | --- |\n| Entity loading | `loading` on every `Attribute` (skeleton label is 100 wide whatever `width`). Not a `Loader` over the body | `Attribute` |\n| Nested table loading | `isLoading` with `skeletonCount={3}` | `Table` |\n| Nested collection empty | Keep headers; `type='collection-empty'` as a direct `Table` child when `rows.length === 0 && !isLoading`. Title and description only, no `EmptyStateActions`. Not `TableEmptyState` (too tall) | `EmptyState` |\n| Field has no value | `isEmpty`; never hide the row | `Attribute` |\n| Viewing an old version | `color='info'` first in `DrawerBody`, \"Back to current\" and \"Restore\" in `AlertControls`; disable header actions | `Alert` |\n| Row open in the drawer | `activeRowId={selectedId}`; not a row `className` | `Table` |\n| Action running | `loading` on its button, then a toast; keep the drawer open | `Button` |\n\nThe entity is loading.\n\nThe entity is still loading: every `Attribute` shows its skeleton and the nested table shows\nthree skeleton rows. No `Loader` over the body, and the header keeps its title.\n\n```tsx story=Loading\nimport { useState } from 'react';\nimport { Attribute, AttributeLabel, AttributeValue } from '@wallarm-org/design-system/Attribute';\nimport { Drawer, DrawerBody, DrawerContent, DrawerHeader, DrawerTitle } from '@wallarm-org/design-system/Drawer';\nimport { Page, PageContent, PageHeader, PageHeaderGroup, PageTitle } from '@wallarm-org/design-system/Page';\nimport { Separator } from '@wallarm-org/design-system/Separator';\nimport { VStack } from '@wallarm-org/design-system/Stack';\nimport { type TableColumnDef, Table } from '@wallarm-org/design-system/Table';\n\nexport const Loading = () => {\n const [selectedId, setSelectedId] = useState<string | null>(null);\n const [open, setOpen] = useState(false);\n\n const provider = PROVIDERS.find(item => item.id === selectedId) ?? null;\n\n const columns: TableColumnDef<Provider>[] = [\n { accessorKey: 'name', header: 'Name', size: 260 },\n { accessorKey: 'protocol', header: 'Protocol', size: 180 },\n { accessorKey: 'issuer', header: 'Issuer', size: 360 },\n ];\n const ruleColumns: TableColumnDef<RoleRule>[] = [\n { accessorKey: 'value', header: 'Claim', size: 300 },\n { accessorKey: 'role', header: 'Role', size: 200 },\n ];\n\n const handleMasterCellClick = (id: string) => {\n setSelectedId(id);\n setOpen(true);\n };\n\n return (\n <Page name='settings-sso' fullSize fixedHeight data-testid='providers-page'>\n <PageHeader>\n <PageHeaderGroup>\n <PageTitle>SSO providers</PageTitle>\n </PageHeaderGroup>\n </PageHeader>\n\n <PageContent>\n <Table\n aria-label='SSO providers'\n data={PROVIDERS}\n columns={columns}\n getRowId={getProviderId}\n activeRowId={open ? selectedId : null}\n onMasterCellClick={handleMasterCellClick}\n data-testid='providers-table'\n />\n </PageContent>\n\n <Drawer\n open={open}\n onOpenChange={setOpen}\n modal={false}\n overlay={false}\n closeOnOutsideClick={false}\n width={640}\n data-testid='provider-drawer'\n >\n <DrawerContent>\n <DrawerHeader>\n <DrawerTitle>{provider?.name}</DrawerTitle>\n </DrawerHeader>\n <DrawerBody>\n <VStack gap={6} className='pb-8' data-testid='provider-attributes'>\n <Attribute orientation='horizontal' loading>\n <AttributeLabel width={140}>Protocol</AttributeLabel>\n <AttributeValue>{provider?.protocol}</AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal' loading>\n <AttributeLabel width={140}>Issuer URL</AttributeLabel>\n <AttributeValue>{provider?.issuer}</AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal' loading>\n <AttributeLabel width={140}>Client ID</AttributeLabel>\n <AttributeValue>{provider?.clientId}</AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal' loading>\n <AttributeLabel width={140}>Created at</AttributeLabel>\n <AttributeValue>{provider?.createdAt}</AttributeValue>\n </Attribute>\n </VStack>\n <Separator spacing={4} />\n <div className='-mx-8 pt-8'>\n <Table\n aria-label='Role rules'\n data={[]}\n columns={ruleColumns}\n getRowId={getItemId}\n isLoading\n skeletonCount={3}\n data-testid='provider-rules-table'\n />\n </div>\n </DrawerBody>\n </DrawerContent>\n </Drawer>\n </Page>\n );\n};\n```\n\nViewing an old version.\n\nViewing an old version: an info `Alert` comes first in the body with \"Back to current\" and\n\"Restore\", and the header \"Actions\" menu is disabled until the reader goes back.\n\n```tsx story=OldVersion\nimport { useState } from 'react';\nimport { Alert, AlertContent, AlertControls, AlertDescription, AlertIcon, AlertTitle } from '@wallarm-org/design-system/Alert';\nimport { Attribute, AttributeLabel, AttributeValue } from '@wallarm-org/design-system/Attribute';\nimport { Button } from '@wallarm-org/design-system/Button';\nimport { InlineCodeSnippet } from '@wallarm-org/design-system/CodeSnippet';\nimport { Drawer, DrawerBody, DrawerContent, DrawerHeader, DrawerTitle } from '@wallarm-org/design-system/Drawer';\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemText, DropdownMenuSeparator, DropdownMenuTrigger } from '@wallarm-org/design-system/DropdownMenu';\nimport { ChevronDown } from '@wallarm-org/design-system/icons';\nimport { Page, PageContent, PageHeader, PageHeaderGroup, PageTitle } from '@wallarm-org/design-system/Page';\nimport { VStack } from '@wallarm-org/design-system/Stack';\nimport { type TableColumnDef, Table } from '@wallarm-org/design-system/Table';\nimport { Tag } from '@wallarm-org/design-system/Tag';\n\nexport const OldVersion = () => {\n const [selectedId, setSelectedId] = useState<string | null>(null);\n const [open, setOpen] = useState(false);\n const [isOldVersion, setIsOldVersion] = useState(true);\n\n const provider = PROVIDERS.find(item => item.id === selectedId) ?? null;\n // The old version had a default role that was removed later.\n const defaultRole = isOldVersion ? 'Security analyst' : provider?.defaultRole;\n\n const columns: TableColumnDef<Provider>[] = [\n { accessorKey: 'name', header: 'Name', size: 260 },\n { accessorKey: 'protocol', header: 'Protocol', size: 180 },\n { accessorKey: 'issuer', header: 'Issuer', size: 360 },\n ];\n\n const handleMasterCellClick = (id: string) => {\n setSelectedId(id);\n setIsOldVersion(true);\n setOpen(true);\n };\n const handleBackToCurrent = () => setIsOldVersion(false);\n const handleRestore = () => onRestoreVersion(provider);\n const handleEdit = () => onEditProvider(provider);\n const handleDelete = () => onDeleteProvider(provider);\n\n return (\n <Page name='settings-sso' fullSize fixedHeight data-testid='providers-page'>\n <PageHeader>\n <PageHeaderGroup>\n <PageTitle>SSO providers</PageTitle>\n </PageHeaderGroup>\n </PageHeader>\n\n <PageContent>\n <Table\n aria-label='SSO providers'\n data={PROVIDERS}\n columns={columns}\n getRowId={getProviderId}\n activeRowId={open ? selectedId : null}\n onMasterCellClick={handleMasterCellClick}\n data-testid='providers-table'\n />\n </PageContent>\n\n <Drawer\n open={open}\n onOpenChange={setOpen}\n modal={false}\n overlay={false}\n closeOnOutsideClick={false}\n width={640}\n data-testid='provider-drawer'\n >\n <DrawerContent>\n <DrawerHeader>\n <DrawerTitle>{provider?.name}</DrawerTitle>\n <DropdownMenu data-testid='provider-actions'>\n <DropdownMenuTrigger asChild>\n <Button variant='outline' color='neutral' size='small' disabled={isOldVersion}>\n Actions <ChevronDown />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuItem onSelect={handleEdit}>\n <DropdownMenuItemText>Edit provider</DropdownMenuItemText>\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem variant='destructive' onSelect={handleDelete}>\n <DropdownMenuItemText>Delete provider</DropdownMenuItemText>\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </DrawerHeader>\n\n <DrawerBody>\n {isOldVersion && (\n <Alert color='info' data-testid='provider-version-alert'>\n <AlertIcon />\n <AlertContent>\n <AlertTitle>You are viewing the version from Oct 28, 2026</AlertTitle>\n <AlertDescription>Changes made after it are not shown.</AlertDescription>\n </AlertContent>\n <AlertControls>\n <Button\n variant='secondary'\n color='neutral'\n size='small'\n onClick={handleBackToCurrent}\n >\n Back to current\n </Button>\n <Button variant='secondary' color='neutral' size='small' onClick={handleRestore}>\n Restore\n </Button>\n </AlertControls>\n </Alert>\n )}\n {provider && (\n <VStack gap={6} className='pt-12 pb-8' data-testid='provider-attributes'>\n <Attribute orientation='horizontal'>\n <AttributeLabel width={140}>Protocol</AttributeLabel>\n <AttributeValue>{provider.protocol}</AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal'>\n <AttributeLabel width={140}>Client ID</AttributeLabel>\n <AttributeValue>\n <InlineCodeSnippet code={provider.clientId} size='md' />\n </AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal' isEmpty={!defaultRole}>\n <AttributeLabel width={140}>Default role</AttributeLabel>\n <AttributeValue>{defaultRole && <Tag>{defaultRole}</Tag>}</AttributeValue>\n </Attribute>\n </VStack>\n )}\n </DrawerBody>\n </DrawerContent>\n </Drawer>\n </Page>\n );\n};\n```\n\n## What your app owns\n\n| You own | The DS owns |\n| --- | --- |\n| `selectedId`, `open`, fetching | Animation, focus trap, close X |\n| Width; persisting it via `onResizeEnd` | Resize drag and limits |\n| Attributes, sections, tabs, label width | Row height, truncation, skeletons |\n| Menu items and handlers | Menu positioning and keyboard |\n| Section headers, grid, bleed offsets | Body gutter, header spacing |\n| Confirmation, version restore | Nothing; compose `Dialog`, `Alert` |\n\n## Related\n\n- [Complex drawer](./complex-drawer.md) for events with charts, [Entity table](./entity-table.md), [Resource list page](./resource-list-page.md)\n- [Create and edit forms](./create-edit-forms.md), [Confirmation dialogs](./confirmation-dialogs.md)\n- [Action-result toasts](./feedback-toasts.md), [Empty states](./empty-states.md)\n- [Spacing](../foundations/spacing.md), [Layering](../foundations/layering.md)",
|
|
1050
|
+
"markdown": "# Detail drawer\n\nA detail drawer is a `Drawer` with no footer. It shows one entity as `Attribute` rows, titled sections and an optional nested `Table`.\n\n## When to use\n\n| Need | Use | Not |\n| --- | --- | --- |\n| Read-only details of one row | This pattern, opened from `Table` `onMasterCellClick` | A new page, a `Dialog` |\n| Edit several fields | A separate edit drawer or dialog. See [Create and edit forms](./create-edit-forms.md) | Inputs inside the detail drawer |\n| Edit one field in place | `InlineEdit` inside `AttributeValue` | A form in the drawer |\n| Actions on the entity | One \"Actions\" `DropdownMenu` in `DrawerHeader` | Several header buttons, a footer |\n| Related collections (roles, rules, members) | `Tabs` with `NumericBadge` counts, one `Table` per tab | Stacked tables with no tabs |\n| A few titled groups of attributes | `Heading` sections split by `Separator` | `Accordion`, a `Card` per group |\n| Confirm a destructive action | A `Dialog` inside `DrawerContent`. See [Confirmation dialogs](./confirmation-dialogs.md) | `window.confirm` |\n| Keep the list usable while open | `modal={false} overlay={false} closeOnOutsideClick={false}` | Default props |\n\n## Rules\n\n**Drawer**\n\n- Mount one controlled `Drawer` (`open`, `onOpenChange`) for the list. **Never** one per row.\n- Open it from the list `Table` `onMasterCellClick`; mark the row with `activeRowId`. Row-menu clicks do not open it.\n- Keep the last entity in state after close so content does not blank. To reset state after close, use `onExitComplete`: it fires once the exit animation ends.\n- Pass `width={640}`. Use 700 (the Figma frame) only if design confirms it. `width` is read once on mount.\n- If resizable, put `DrawerResizeHandle` first in `DrawerContent` (400–1130px).\n- **Never** add a `DrawerFooter` or your own close button.\n- In tests, pass `data-testid` to `Drawer`. **Never** select by `data-slot`.\n\n**Header actions**\n\n- One `DropdownMenu` in `DrawerHeader`, trigger `Button variant='outline' color='neutral' size='small'` \"Actions\" + `ChevronDown`.\n- Order: edit, state changes, \"Go to …\" links, `DropdownMenuSeparator`, destructive items.\n- Destructive items use `variant='destructive'` and name the entity: \"Delete provider\".\n- Keep the built-in 12px before the close X, though Figma shows 4px.\n\n**Spacing**\n\n- `DrawerBody` owns the 24px gutter. **Never** pad inside it or pass `className` to `DrawerHeader`/`DrawerBody`.\n- Attribute rows: `VStack gap={6} className='pb-8'`. Sections: `Separator spacing={4}`. **Never** a `Separator` above `Tabs`: `TabsList` draws its own line.\n- Section header: `HStack justify='between' align='center' className='py-8'`, `Heading as='h3' size='md' weight='medium'`, optional `Button size='small'`.\n- Full-width tabs: `<div className='-mx-24'>` around `TabsList`, not its `className`. Table 16px from the edge: `<div className='-mx-8'>` around `Table`, never on it. No other negative margins.\n\n**Attributes**\n\n- Always pass `orientation='horizontal'`; the default is vertical.\n- One `AttributeLabel` `width` per drawer: 140 matches Figma; up to 256 for long labels. **Never** wrap a label.\n- Two columns: `grid grid-cols-2 gap-x-8 gap-y-6`, default label width.\n- Section help: an `Info` icon in a `Tooltip` after the heading.\n\n| Data | Value | Not |\n| --- | --- | --- |\n| Plain text | The string as the `AttributeValue` child | A `Text` with your own size |\n| ID, URL, claim, scope, path | `InlineCodeSnippet code={value} size='md'` | `Code`, a monospace `span` |\n| Several codes | Several `InlineCodeSnippet` in `HStack gap={4}` | One joined string |\n| Role, tag, label | `Tag` | `Badge`, plain text |\n| Timestamp | `FormatDateTime format='datetime' layout='inline'` | `toLocaleString()` |\n| Secret | \"Set — never shown\" | Dots, a masked input |\n| Missing value | `Attribute isEmpty` | `N/A`, `0`, your own dash |\n| Icon with text | `HStack gap={6} align='center'` | An `img` with your own margin |\n\n`InlineCodeSnippet` copies on click; `copyable={false}` turns that off.\n\n**Tabs and tables**\n\n- Keep `Tabs` in `DrawerBody` to scroll with the attributes. Pinned tabs: `Tabs asChild` around `DrawerHeader`, `TabsList`, `DrawerBody` (`Drawer` `WithTabs` story); attributes then go in each `TabsContent`.\n- Tab action: `Button size='small'` in `TabsLineActions`.\n- Nested tables follow [Entity table](./entity-table.md). **Never** use `TableActionBar` in a drawer: it renders underneath.\n\n**Does not exist:** `DRAWER_SIZES`, a `size` prop on `Drawer`, `DrawerActions`, `DrawerHeaderActions`, `AttributeGroup`, `AttributeList`, `DescriptionList`, a section component, `fullBleed` on `TabsList` or `Table`.\n\n## Examples\n\nThe list opens one shared drawer from the master cell.\n\nClick a provider name: one shared, non-modal drawer opens and the row stays marked. The header\nhas a single \"Actions\" menu; the body has horizontal attributes (a code value, a secret, a\ntimestamp), then full-width tabs with counts, each with an inset nested table. Google Workspace\nhas no rules, so its table keeps the headers and shows a short empty state.\n\n```tsx story=Default\nimport { useState } from 'react';\nimport { Attribute, AttributeLabel, AttributeValue } from '@wallarm-org/design-system/Attribute';\nimport { Button } from '@wallarm-org/design-system/Button';\nimport { InlineCodeSnippet } from '@wallarm-org/design-system/CodeSnippet';\nimport { Drawer, DrawerBody, DrawerContent, DrawerHeader, DrawerResizeHandle, DrawerTitle } from '@wallarm-org/design-system/Drawer';\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemText, DropdownMenuSeparator, DropdownMenuTrigger } from '@wallarm-org/design-system/DropdownMenu';\nimport { EmptyState, EmptyStateMessage, EmptyStateTitle } from '@wallarm-org/design-system/EmptyState';\nimport { FormatDateTime } from '@wallarm-org/design-system/FormatDateTime';\nimport { ChevronDown, Plus } from '@wallarm-org/design-system/icons';\nimport { NumericBadge } from '@wallarm-org/design-system/NumericBadge';\nimport { Page, PageContent, PageHeader, PageHeaderGroup, PageTitle } from '@wallarm-org/design-system/Page';\nimport { VStack } from '@wallarm-org/design-system/Stack';\nimport { type TableCellContext, type TableColumnDef, Table } from '@wallarm-org/design-system/Table';\nimport { Tabs, TabsContent, TabsLineActions, TabsList, TabsTrigger } from '@wallarm-org/design-system/Tabs';\nimport { Tag } from '@wallarm-org/design-system/Tag';\n\nexport const Default = () => {\n const [selectedId, setSelectedId] = useState<string | null>(null);\n const [open, setOpen] = useState(false);\n const [tab, setTab] = useState('rules');\n\n const provider = PROVIDERS.find(item => item.id === selectedId) ?? null;\n\n const renderClaim = ({ row }: TableCellContext<RoleRule, unknown>) => (\n <InlineCodeSnippet code={`${row.original.claim} = ${row.original.value}`} size='md' />\n );\n const renderRole = ({ row }: TableCellContext<RoleRule, unknown>) => (\n <Tag>{row.original.role}</Tag>\n );\n const renderVerifiedAt = ({ row }: TableCellContext<Domain, unknown>) => (\n <FormatDateTime value={row.original.verifiedAt} format='date' />\n );\n\n const columns: TableColumnDef<Provider>[] = [\n { accessorKey: 'name', header: 'Name', size: 260 },\n { accessorKey: 'protocol', header: 'Protocol', size: 180 },\n { accessorKey: 'issuer', header: 'Issuer', size: 360 },\n ];\n const ruleColumns: TableColumnDef<RoleRule>[] = [\n { id: 'claim', header: 'Claim', size: 300, cell: renderClaim },\n { accessorKey: 'role', header: 'Role', size: 200, cell: renderRole },\n ];\n const domainColumns: TableColumnDef<Domain>[] = [\n { accessorKey: 'name', header: 'Domain', size: 300 },\n { accessorKey: 'verifiedAt', header: 'Verified', size: 200, cell: renderVerifiedAt },\n ];\n\n const handleMasterCellClick = (id: string) => {\n setSelectedId(id);\n setOpen(true);\n };\n const handleEdit = () => onEditProvider(provider);\n const handleDisable = () => onDisableProvider(provider);\n const handleGoToAuditLog = () => onGoToAuditLog(provider);\n const handleDelete = () => onDeleteProvider(provider);\n const handleCreateRule = () => onCreateRule(provider);\n\n return (\n <Page name='settings-sso' fullSize fixedHeight data-testid='providers-page'>\n <PageHeader>\n <PageHeaderGroup>\n <PageTitle>SSO providers</PageTitle>\n </PageHeaderGroup>\n </PageHeader>\n\n <PageContent>\n <Table\n aria-label='SSO providers'\n data={PROVIDERS}\n columns={columns}\n getRowId={getProviderId}\n activeRowId={open ? selectedId : null}\n onMasterCellClick={handleMasterCellClick}\n data-testid='providers-table'\n />\n </PageContent>\n\n <Drawer\n open={open}\n onOpenChange={setOpen}\n modal={false}\n overlay={false}\n closeOnOutsideClick={false}\n width={640}\n data-testid='provider-drawer'\n >\n <DrawerContent>\n <DrawerResizeHandle />\n <DrawerHeader>\n <DrawerTitle>{provider?.name}</DrawerTitle>\n <DropdownMenu data-testid='provider-actions'>\n <DropdownMenuTrigger asChild>\n <Button variant='outline' color='neutral' size='small'>\n Actions <ChevronDown />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuItem onSelect={handleEdit}>\n <DropdownMenuItemText>Edit provider</DropdownMenuItemText>\n </DropdownMenuItem>\n <DropdownMenuItem onSelect={handleDisable}>\n <DropdownMenuItemText>Disable provider</DropdownMenuItemText>\n </DropdownMenuItem>\n <DropdownMenuItem onSelect={handleGoToAuditLog}>\n <DropdownMenuItemText>Go to audit log</DropdownMenuItemText>\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem variant='destructive' onSelect={handleDelete}>\n <DropdownMenuItemText>Delete provider</DropdownMenuItemText>\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </DrawerHeader>\n\n <DrawerBody>\n {provider && (\n <>\n <VStack gap={6} className='pb-8' data-testid='provider-attributes'>\n <Attribute orientation='horizontal'>\n <AttributeLabel width={140}>Protocol</AttributeLabel>\n <AttributeValue>{provider.protocol}</AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal'>\n <AttributeLabel width={140}>Issuer URL</AttributeLabel>\n <AttributeValue>\n <InlineCodeSnippet code={provider.issuer} size='md' />\n </AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal'>\n <AttributeLabel width={140}>Client ID</AttributeLabel>\n <AttributeValue>\n <InlineCodeSnippet code={provider.clientId} size='md' />\n </AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal'>\n <AttributeLabel width={140}>Client secret</AttributeLabel>\n <AttributeValue>Set — never shown</AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal' isEmpty={!provider.defaultRole}>\n <AttributeLabel width={140}>Default role</AttributeLabel>\n <AttributeValue>\n {provider.defaultRole && <Tag>{provider.defaultRole}</Tag>}\n </AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal'>\n <AttributeLabel width={140}>Created at</AttributeLabel>\n <AttributeValue>\n <FormatDateTime\n value={provider.createdAt}\n format='datetime'\n layout='inline'\n />\n </AttributeValue>\n </Attribute>\n </VStack>\n\n <Tabs value={tab} onChange={setTab} data-testid='provider-tabs'>\n <div className='-mx-24'>\n <TabsList>\n <TabsTrigger value='rules'>\n Role rules <NumericBadge>{provider.rules.length}</NumericBadge>\n </TabsTrigger>\n <TabsTrigger value='domains'>\n Domains <NumericBadge>{provider.domains.length}</NumericBadge>\n </TabsTrigger>\n <TabsLineActions>\n <Button size='small' onClick={handleCreateRule}>\n <Plus /> Create rule\n </Button>\n </TabsLineActions>\n </TabsList>\n </div>\n <TabsContent value='rules'>\n <div className='-mx-8 pt-8'>\n <Table\n aria-label='Role rules'\n data={provider.rules}\n columns={ruleColumns}\n getRowId={getItemId}\n data-testid='provider-rules-table'\n >\n {provider.rules.length === 0 && (\n <EmptyState type='collection-empty' data-testid='provider-rules-empty'>\n <EmptyStateMessage>\n <EmptyStateTitle>No role rules yet</EmptyStateTitle>\n </EmptyStateMessage>\n </EmptyState>\n )}\n </Table>\n </div>\n </TabsContent>\n <TabsContent value='domains'>\n <div className='-mx-8 pt-8'>\n <Table\n aria-label='Domains'\n data={provider.domains}\n columns={domainColumns}\n getRowId={getItemId}\n data-testid='provider-domains-table'\n >\n {provider.domains.length === 0 && (\n <EmptyState type='collection-empty'>\n <EmptyStateMessage>\n <EmptyStateTitle>No domains yet</EmptyStateTitle>\n </EmptyStateMessage>\n </EmptyState>\n )}\n </Table>\n </div>\n </TabsContent>\n </Tabs>\n </>\n )}\n </DrawerBody>\n </DrawerContent>\n </Drawer>\n </Page>\n );\n};\n```\n\nThe drawer shell with a resize handle and the header actions menu.\n\nDrag the left edge to resize between 400 and 1130px; `onResizeEnd` gets the final width to\npersist. The close X comes built in, so there is no footer and no close button of your own.\n\n```tsx story=Header\nimport { useState } from 'react';\nimport { Attribute, AttributeLabel, AttributeValue } from '@wallarm-org/design-system/Attribute';\nimport { Button } from '@wallarm-org/design-system/Button';\nimport { Drawer, DrawerBody, DrawerContent, DrawerHeader, DrawerResizeHandle, DrawerTitle, DrawerTrigger } from '@wallarm-org/design-system/Drawer';\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemText, DropdownMenuSeparator, DropdownMenuTrigger } from '@wallarm-org/design-system/DropdownMenu';\nimport { ChevronDown } from '@wallarm-org/design-system/icons';\nimport { VStack } from '@wallarm-org/design-system/Stack';\n\nexport const Header = () => {\n const [open, setOpen] = useState(false);\n\n const handleEdit = () => onEditProvider(OKTA);\n const handleDisable = () => onDisableProvider(OKTA);\n const handleGoToAuditLog = () => onGoToAuditLog(OKTA);\n const handleDelete = () => onDeleteProvider(OKTA);\n\n return (\n <Drawer open={open} onOpenChange={setOpen} width={640} data-testid='provider-drawer'>\n <DrawerTrigger asChild>\n <Button variant='outline' color='neutral'>\n View {OKTA.name}\n </Button>\n </DrawerTrigger>\n <DrawerContent>\n <DrawerResizeHandle onResizeEnd={onSaveDrawerWidth} />\n <DrawerHeader>\n <DrawerTitle>{OKTA.name}</DrawerTitle>\n <DropdownMenu data-testid='provider-actions'>\n <DropdownMenuTrigger asChild>\n <Button variant='outline' color='neutral' size='small'>\n Actions <ChevronDown />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuItem onSelect={handleEdit}>\n <DropdownMenuItemText>Edit provider</DropdownMenuItemText>\n </DropdownMenuItem>\n <DropdownMenuItem onSelect={handleDisable}>\n <DropdownMenuItemText>Disable provider</DropdownMenuItemText>\n </DropdownMenuItem>\n <DropdownMenuItem onSelect={handleGoToAuditLog}>\n <DropdownMenuItemText>Go to audit log</DropdownMenuItemText>\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem variant='destructive' onSelect={handleDelete}>\n <DropdownMenuItemText>Delete provider</DropdownMenuItemText>\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </DrawerHeader>\n <DrawerBody>\n <VStack gap={6} className='pb-8'>\n <Attribute orientation='horizontal'>\n <AttributeLabel width={140}>Protocol</AttributeLabel>\n <AttributeValue>{OKTA.protocol}</AttributeValue>\n </Attribute>\n </VStack>\n </DrawerBody>\n </DrawerContent>\n </Drawer>\n );\n};\n```\n\nAttribute rows with a code value, a secret, a missing value and a timestamp.\n\nEvery row is horizontal with the same 140px label. Entra ID has no default role, so that row\nstays and shows the empty marker; the codes copy on click.\n\n```tsx story=Attributes\nimport { useState } from 'react';\nimport { Attribute, AttributeLabel, AttributeValue } from '@wallarm-org/design-system/Attribute';\nimport { Button } from '@wallarm-org/design-system/Button';\nimport { InlineCodeSnippet } from '@wallarm-org/design-system/CodeSnippet';\nimport { Drawer, DrawerBody, DrawerContent, DrawerHeader, DrawerTitle, DrawerTrigger } from '@wallarm-org/design-system/Drawer';\nimport { FormatDateTime } from '@wallarm-org/design-system/FormatDateTime';\nimport { VStack } from '@wallarm-org/design-system/Stack';\nimport { Tag } from '@wallarm-org/design-system/Tag';\n\nexport const Attributes = () => {\n const [open, setOpen] = useState(false);\n\n return (\n <Drawer open={open} onOpenChange={setOpen} width={640} data-testid='provider-drawer'>\n <DrawerTrigger asChild>\n <Button variant='outline' color='neutral'>\n View {ENTRA.name}\n </Button>\n </DrawerTrigger>\n <DrawerContent>\n <DrawerHeader>\n <DrawerTitle>{ENTRA.name}</DrawerTitle>\n </DrawerHeader>\n <DrawerBody>\n <VStack gap={6} className='pb-8' data-testid='provider-attributes'>\n <Attribute orientation='horizontal'>\n <AttributeLabel width={140}>Client ID</AttributeLabel>\n <AttributeValue>\n <InlineCodeSnippet code={ENTRA.clientId} size='md' />\n </AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal'>\n <AttributeLabel width={140}>Client secret</AttributeLabel>\n <AttributeValue>Set — never shown</AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal' isEmpty={!ENTRA.defaultRole}>\n <AttributeLabel width={140}>Default role</AttributeLabel>\n <AttributeValue>{ENTRA.defaultRole && <Tag>{ENTRA.defaultRole}</Tag>}</AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal'>\n <AttributeLabel width={140}>Created at</AttributeLabel>\n <AttributeValue>\n <FormatDateTime value={ENTRA.createdAt} format='datetime' layout='inline' />\n </AttributeValue>\n </Attribute>\n </VStack>\n </DrawerBody>\n </DrawerContent>\n </Drawer>\n );\n};\n```\n\nA section with a title and an action.\n\nThe first group needs no title. Each later group starts with a `Separator` and a header row; the\naction applies to that section only.\n\n```tsx story=Section\nimport { useState } from 'react';\nimport { Attribute, AttributeLabel, AttributeValue } from '@wallarm-org/design-system/Attribute';\nimport { Button } from '@wallarm-org/design-system/Button';\nimport { InlineCodeSnippet } from '@wallarm-org/design-system/CodeSnippet';\nimport { Drawer, DrawerBody, DrawerContent, DrawerHeader, DrawerTitle, DrawerTrigger } from '@wallarm-org/design-system/Drawer';\nimport { FormatDateTime } from '@wallarm-org/design-system/FormatDateTime';\nimport { Heading } from '@wallarm-org/design-system/Heading';\nimport { Separator } from '@wallarm-org/design-system/Separator';\nimport { HStack, VStack } from '@wallarm-org/design-system/Stack';\nimport { Tag } from '@wallarm-org/design-system/Tag';\n\nexport const Section = () => {\n const [open, setOpen] = useState(false);\n\n const handleEditDefaults = () => onEditProvider(OKTA);\n\n return (\n <Drawer open={open} onOpenChange={setOpen} width={640} data-testid='provider-drawer'>\n <DrawerTrigger asChild>\n <Button variant='outline' color='neutral'>\n View {OKTA.name}\n </Button>\n </DrawerTrigger>\n <DrawerContent>\n <DrawerHeader>\n <DrawerTitle>{OKTA.name}</DrawerTitle>\n </DrawerHeader>\n <DrawerBody>\n <VStack gap={6} className='pb-8'>\n <Attribute orientation='horizontal'>\n <AttributeLabel width={140}>Protocol</AttributeLabel>\n <AttributeValue>{OKTA.protocol}</AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal'>\n <AttributeLabel width={140}>Issuer URL</AttributeLabel>\n <AttributeValue>\n <InlineCodeSnippet code={OKTA.issuer} size='md' />\n </AttributeValue>\n </Attribute>\n </VStack>\n\n <Separator spacing={4} />\n\n <HStack\n justify='between'\n align='center'\n className='py-8'\n data-testid='provider-defaults-section'\n >\n <Heading as='h3' size='md' weight='medium'>\n Defaults\n </Heading>\n <Button size='small' variant='outline' color='neutral' onClick={handleEditDefaults}>\n Edit defaults\n </Button>\n </HStack>\n <VStack gap={6} className='pb-8'>\n <Attribute orientation='horizontal' isEmpty={!OKTA.defaultRole}>\n <AttributeLabel width={140}>Default role</AttributeLabel>\n <AttributeValue>{OKTA.defaultRole && <Tag>{OKTA.defaultRole}</Tag>}</AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal'>\n <AttributeLabel width={140}>Created at</AttributeLabel>\n <AttributeValue>\n <FormatDateTime value={OKTA.createdAt} format='datetime' layout='inline' />\n </AttributeValue>\n </Attribute>\n </VStack>\n </DrawerBody>\n </DrawerContent>\n </Drawer>\n );\n};\n```\n\nFull-width tabs with a count and an inset nested table that stays visible when empty.\n\nGoogle Workspace has no rules yet: the table keeps its headers and shows a one-line empty state\nwith no action, since \"Create rule\" already sits on the tab line.\n\n```tsx story=NestedTable\nimport { useState } from 'react';\nimport { Button } from '@wallarm-org/design-system/Button';\nimport { InlineCodeSnippet } from '@wallarm-org/design-system/CodeSnippet';\nimport { Drawer, DrawerBody, DrawerContent, DrawerHeader, DrawerTitle, DrawerTrigger } from '@wallarm-org/design-system/Drawer';\nimport { EmptyState, EmptyStateMessage, EmptyStateTitle } from '@wallarm-org/design-system/EmptyState';\nimport { Plus } from '@wallarm-org/design-system/icons';\nimport { NumericBadge } from '@wallarm-org/design-system/NumericBadge';\nimport { type TableCellContext, type TableColumnDef, Table } from '@wallarm-org/design-system/Table';\nimport { Tabs, TabsContent, TabsLineActions, TabsList, TabsTrigger } from '@wallarm-org/design-system/Tabs';\nimport { Tag } from '@wallarm-org/design-system/Tag';\n\nexport const NestedTable = () => {\n const [open, setOpen] = useState(false);\n const [tab, setTab] = useState('rules');\n\n const renderClaim = ({ row }: TableCellContext<RoleRule, unknown>) => (\n <InlineCodeSnippet code={`${row.original.claim} = ${row.original.value}`} size='md' />\n );\n const renderRole = ({ row }: TableCellContext<RoleRule, unknown>) => (\n <Tag>{row.original.role}</Tag>\n );\n\n const ruleColumns: TableColumnDef<RoleRule>[] = [\n { id: 'claim', header: 'Claim', size: 300, cell: renderClaim },\n { accessorKey: 'role', header: 'Role', size: 200, cell: renderRole },\n ];\n\n const handleCreateRule = () => onCreateRule(GOOGLE);\n\n return (\n <Drawer open={open} onOpenChange={setOpen} width={640} data-testid='provider-drawer'>\n <DrawerTrigger asChild>\n <Button variant='outline' color='neutral'>\n View {GOOGLE.name}\n </Button>\n </DrawerTrigger>\n <DrawerContent>\n <DrawerHeader>\n <DrawerTitle>{GOOGLE.name}</DrawerTitle>\n </DrawerHeader>\n <DrawerBody>\n <Tabs value={tab} onChange={setTab} data-testid='provider-tabs'>\n <div className='-mx-24'>\n <TabsList>\n <TabsTrigger value='rules'>\n Role rules <NumericBadge>{GOOGLE.rules.length}</NumericBadge>\n </TabsTrigger>\n <TabsLineActions>\n <Button size='small' onClick={handleCreateRule}>\n <Plus /> Create rule\n </Button>\n </TabsLineActions>\n </TabsList>\n </div>\n <TabsContent value='rules'>\n <div className='-mx-8 pt-8'>\n <Table\n aria-label='Role rules'\n data={GOOGLE.rules}\n columns={ruleColumns}\n getRowId={getItemId}\n data-testid='provider-rules-table'\n >\n {GOOGLE.rules.length === 0 && (\n <EmptyState type='collection-empty' data-testid='provider-rules-empty'>\n <EmptyStateMessage>\n <EmptyStateTitle>No role rules yet</EmptyStateTitle>\n </EmptyStateMessage>\n </EmptyState>\n )}\n </Table>\n </div>\n </TabsContent>\n </Tabs>\n </DrawerBody>\n </DrawerContent>\n </Drawer>\n );\n};\n```\n\n## States\n\n| State | Show | Example component |\n| --- | --- | --- |\n| Entity loading | `loading` on every `Attribute` (skeleton label is 100 wide whatever `width`). Not a `Loader` over the body | `Attribute` |\n| Nested table loading | `isLoading` with `skeletonCount={3}` | `Table` |\n| Nested collection empty | Keep headers; `type='collection-empty'` as a direct `Table` child when `rows.length === 0 && !isLoading`. Title and description only, no `EmptyStateActions`. Not `TableEmptyState` (too tall) | `EmptyState` |\n| Field has no value | `isEmpty`; never hide the row | `Attribute` |\n| Viewing an old version | `color='info'` first in `DrawerBody`, \"Back to current\" and \"Restore\" in `AlertControls`; disable header actions | `Alert` |\n| Row open in the drawer | `activeRowId={selectedId}`; not a row `className` | `Table` |\n| Action running | `loading` on its button, then a toast; keep the drawer open | `Button` |\n\nThe entity is loading.\n\nThe entity is still loading: every `Attribute` shows its skeleton and the nested table shows\nthree skeleton rows. No `Loader` over the body, and the header keeps its title.\n\n```tsx story=Loading\nimport { useState } from 'react';\nimport { Attribute, AttributeLabel, AttributeValue } from '@wallarm-org/design-system/Attribute';\nimport { Drawer, DrawerBody, DrawerContent, DrawerHeader, DrawerTitle } from '@wallarm-org/design-system/Drawer';\nimport { Page, PageContent, PageHeader, PageHeaderGroup, PageTitle } from '@wallarm-org/design-system/Page';\nimport { Separator } from '@wallarm-org/design-system/Separator';\nimport { VStack } from '@wallarm-org/design-system/Stack';\nimport { type TableColumnDef, Table } from '@wallarm-org/design-system/Table';\n\nexport const Loading = () => {\n const [selectedId, setSelectedId] = useState<string | null>(null);\n const [open, setOpen] = useState(false);\n\n const provider = PROVIDERS.find(item => item.id === selectedId) ?? null;\n\n const columns: TableColumnDef<Provider>[] = [\n { accessorKey: 'name', header: 'Name', size: 260 },\n { accessorKey: 'protocol', header: 'Protocol', size: 180 },\n { accessorKey: 'issuer', header: 'Issuer', size: 360 },\n ];\n const ruleColumns: TableColumnDef<RoleRule>[] = [\n { accessorKey: 'value', header: 'Claim', size: 300 },\n { accessorKey: 'role', header: 'Role', size: 200 },\n ];\n\n const handleMasterCellClick = (id: string) => {\n setSelectedId(id);\n setOpen(true);\n };\n\n return (\n <Page name='settings-sso' fullSize fixedHeight data-testid='providers-page'>\n <PageHeader>\n <PageHeaderGroup>\n <PageTitle>SSO providers</PageTitle>\n </PageHeaderGroup>\n </PageHeader>\n\n <PageContent>\n <Table\n aria-label='SSO providers'\n data={PROVIDERS}\n columns={columns}\n getRowId={getProviderId}\n activeRowId={open ? selectedId : null}\n onMasterCellClick={handleMasterCellClick}\n data-testid='providers-table'\n />\n </PageContent>\n\n <Drawer\n open={open}\n onOpenChange={setOpen}\n modal={false}\n overlay={false}\n closeOnOutsideClick={false}\n width={640}\n data-testid='provider-drawer'\n >\n <DrawerContent>\n <DrawerHeader>\n <DrawerTitle>{provider?.name}</DrawerTitle>\n </DrawerHeader>\n <DrawerBody>\n <VStack gap={6} className='pb-8' data-testid='provider-attributes'>\n <Attribute orientation='horizontal' loading>\n <AttributeLabel width={140}>Protocol</AttributeLabel>\n <AttributeValue>{provider?.protocol}</AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal' loading>\n <AttributeLabel width={140}>Issuer URL</AttributeLabel>\n <AttributeValue>{provider?.issuer}</AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal' loading>\n <AttributeLabel width={140}>Client ID</AttributeLabel>\n <AttributeValue>{provider?.clientId}</AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal' loading>\n <AttributeLabel width={140}>Created at</AttributeLabel>\n <AttributeValue>{provider?.createdAt}</AttributeValue>\n </Attribute>\n </VStack>\n <Separator spacing={4} />\n <div className='-mx-8 pt-8'>\n <Table\n aria-label='Role rules'\n data={[]}\n columns={ruleColumns}\n getRowId={getItemId}\n isLoading\n skeletonCount={3}\n data-testid='provider-rules-table'\n />\n </div>\n </DrawerBody>\n </DrawerContent>\n </Drawer>\n </Page>\n );\n};\n```\n\nViewing an old version.\n\nViewing an old version: an info `Alert` comes first in the body with \"Back to current\" and\n\"Restore\", and the header \"Actions\" menu is disabled until the reader goes back.\n\n```tsx story=OldVersion\nimport { useState } from 'react';\nimport { Alert, AlertContent, AlertControls, AlertDescription, AlertIcon, AlertTitle } from '@wallarm-org/design-system/Alert';\nimport { Attribute, AttributeLabel, AttributeValue } from '@wallarm-org/design-system/Attribute';\nimport { Button } from '@wallarm-org/design-system/Button';\nimport { InlineCodeSnippet } from '@wallarm-org/design-system/CodeSnippet';\nimport { Drawer, DrawerBody, DrawerContent, DrawerHeader, DrawerTitle } from '@wallarm-org/design-system/Drawer';\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemText, DropdownMenuSeparator, DropdownMenuTrigger } from '@wallarm-org/design-system/DropdownMenu';\nimport { ChevronDown } from '@wallarm-org/design-system/icons';\nimport { Page, PageContent, PageHeader, PageHeaderGroup, PageTitle } from '@wallarm-org/design-system/Page';\nimport { VStack } from '@wallarm-org/design-system/Stack';\nimport { type TableColumnDef, Table } from '@wallarm-org/design-system/Table';\nimport { Tag } from '@wallarm-org/design-system/Tag';\n\nexport const OldVersion = () => {\n const [selectedId, setSelectedId] = useState<string | null>(null);\n const [open, setOpen] = useState(false);\n const [isOldVersion, setIsOldVersion] = useState(true);\n\n const provider = PROVIDERS.find(item => item.id === selectedId) ?? null;\n // The old version had a default role that was removed later.\n const defaultRole = isOldVersion ? 'Security analyst' : provider?.defaultRole;\n\n const columns: TableColumnDef<Provider>[] = [\n { accessorKey: 'name', header: 'Name', size: 260 },\n { accessorKey: 'protocol', header: 'Protocol', size: 180 },\n { accessorKey: 'issuer', header: 'Issuer', size: 360 },\n ];\n\n const handleMasterCellClick = (id: string) => {\n setSelectedId(id);\n setIsOldVersion(true);\n setOpen(true);\n };\n const handleBackToCurrent = () => setIsOldVersion(false);\n const handleRestore = () => onRestoreVersion(provider);\n const handleEdit = () => onEditProvider(provider);\n const handleDelete = () => onDeleteProvider(provider);\n\n return (\n <Page name='settings-sso' fullSize fixedHeight data-testid='providers-page'>\n <PageHeader>\n <PageHeaderGroup>\n <PageTitle>SSO providers</PageTitle>\n </PageHeaderGroup>\n </PageHeader>\n\n <PageContent>\n <Table\n aria-label='SSO providers'\n data={PROVIDERS}\n columns={columns}\n getRowId={getProviderId}\n activeRowId={open ? selectedId : null}\n onMasterCellClick={handleMasterCellClick}\n data-testid='providers-table'\n />\n </PageContent>\n\n <Drawer\n open={open}\n onOpenChange={setOpen}\n modal={false}\n overlay={false}\n closeOnOutsideClick={false}\n width={640}\n data-testid='provider-drawer'\n >\n <DrawerContent>\n <DrawerHeader>\n <DrawerTitle>{provider?.name}</DrawerTitle>\n <DropdownMenu data-testid='provider-actions'>\n <DropdownMenuTrigger asChild>\n <Button variant='outline' color='neutral' size='small' disabled={isOldVersion}>\n Actions <ChevronDown />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuItem onSelect={handleEdit}>\n <DropdownMenuItemText>Edit provider</DropdownMenuItemText>\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem variant='destructive' onSelect={handleDelete}>\n <DropdownMenuItemText>Delete provider</DropdownMenuItemText>\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </DrawerHeader>\n\n <DrawerBody>\n {isOldVersion && (\n <Alert color='info' data-testid='provider-version-alert'>\n <AlertIcon />\n <AlertContent>\n <AlertTitle>You are viewing the version from Oct 28, 2026</AlertTitle>\n <AlertDescription>Changes made after it are not shown.</AlertDescription>\n </AlertContent>\n <AlertControls>\n <Button\n variant='secondary'\n color='neutral'\n size='small'\n onClick={handleBackToCurrent}\n >\n Back to current\n </Button>\n <Button variant='secondary' color='neutral' size='small' onClick={handleRestore}>\n Restore\n </Button>\n </AlertControls>\n </Alert>\n )}\n {provider && (\n <VStack gap={6} className='pt-12 pb-8' data-testid='provider-attributes'>\n <Attribute orientation='horizontal'>\n <AttributeLabel width={140}>Protocol</AttributeLabel>\n <AttributeValue>{provider.protocol}</AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal'>\n <AttributeLabel width={140}>Client ID</AttributeLabel>\n <AttributeValue>\n <InlineCodeSnippet code={provider.clientId} size='md' />\n </AttributeValue>\n </Attribute>\n <Attribute orientation='horizontal' isEmpty={!defaultRole}>\n <AttributeLabel width={140}>Default role</AttributeLabel>\n <AttributeValue>{defaultRole && <Tag>{defaultRole}</Tag>}</AttributeValue>\n </Attribute>\n </VStack>\n )}\n </DrawerBody>\n </DrawerContent>\n </Drawer>\n </Page>\n );\n};\n```\n\n## What your app owns\n\n| You own | The DS owns |\n| --- | --- |\n| `selectedId`, `open`, fetching | Animation, focus trap, close X |\n| Width; persisting it via `onResizeEnd` | Resize drag and limits |\n| Attributes, sections, tabs, label width | Row height, truncation, skeletons |\n| Menu items and handlers | Menu positioning and keyboard |\n| Section headers, grid, bleed offsets | Body gutter, header spacing |\n| Confirmation, version restore | Nothing; compose `Dialog`, `Alert` |\n\n## Related\n\n- [Complex drawer](./complex-drawer.md) for events with charts, [Entity table](./entity-table.md), [Resource list page](./resource-list-page.md)\n- [Create and edit forms](./create-edit-forms.md), [Confirmation dialogs](./confirmation-dialogs.md)\n- [Action-result toasts](./feedback-toasts.md), [Empty states](./empty-states.md)\n- [Spacing](../foundations/spacing.md), [Layering](../foundations/layering.md)",
|
|
1051
1051
|
"sections": [
|
|
1052
1052
|
{
|
|
1053
1053
|
"id": "when-to-use",
|
|
@@ -1057,7 +1057,7 @@
|
|
|
1057
1057
|
{
|
|
1058
1058
|
"id": "rules",
|
|
1059
1059
|
"heading": "Rules",
|
|
1060
|
-
"markdown": "**Drawer**\n\n- Mount one controlled `Drawer` (`open`, `onOpenChange`) for the list. **Never** one per row.\n- Open it from the list `Table` `onMasterCellClick`; mark the row with `activeRowId`. Row-menu clicks do not open it.\n- Keep the last entity in state after close so content does not blank.\n- Pass `width={640}`. Use 700 (the Figma frame) only if design confirms it. `width` is read once on mount.\n- If resizable, put `DrawerResizeHandle` first in `DrawerContent` (400–1130px).\n- **Never** add a `DrawerFooter` or your own close button.\n- In tests, pass `data-testid` to `Drawer`. **Never** select by `data-slot`.\n\n**Header actions**\n\n- One `DropdownMenu` in `DrawerHeader`, trigger `Button variant='outline' color='neutral' size='small'` \"Actions\" + `ChevronDown`.\n- Order: edit, state changes, \"Go to …\" links, `DropdownMenuSeparator`, destructive items.\n- Destructive items use `variant='destructive'` and name the entity: \"Delete provider\".\n- Keep the built-in 12px before the close X, though Figma shows 4px.\n\n**Spacing**\n\n- `DrawerBody` owns the 24px gutter. **Never** pad inside it or pass `className` to `DrawerHeader`/`DrawerBody`.\n- Attribute rows: `VStack gap={6} className='pb-8'`. Sections: `Separator spacing={4}`. **Never** a `Separator` above `Tabs`: `TabsList` draws its own line.\n- Section header: `HStack justify='between' align='center' className='py-8'`, `Heading as='h3' size='md' weight='medium'`, optional `Button size='small'`.\n- Full-width tabs: `<div className='-mx-24'>` around `TabsList`, not its `className`. Table 16px from the edge: `<div className='-mx-8'>` around `Table`, never on it. No other negative margins.\n\n**Attributes**\n\n- Always pass `orientation='horizontal'`; the default is vertical.\n- One `AttributeLabel` `width` per drawer: 140 matches Figma; up to 256 for long labels. **Never** wrap a label.\n- Two columns: `grid grid-cols-2 gap-x-8 gap-y-6`, default label width.\n- Section help: an `Info` icon in a `Tooltip` after the heading.\n\n| Data | Value | Not |\n| --- | --- | --- |\n| Plain text | The string as the `AttributeValue` child | A `Text` with your own size |\n| ID, URL, claim, scope, path | `InlineCodeSnippet code={value} size='md'` | `Code`, a monospace `span` |\n| Several codes | Several `InlineCodeSnippet` in `HStack gap={4}` | One joined string |\n| Role, tag, label | `Tag` | `Badge`, plain text |\n| Timestamp | `FormatDateTime format='datetime' layout='inline'` | `toLocaleString()` |\n| Secret | \"Set — never shown\" | Dots, a masked input |\n| Missing value | `Attribute isEmpty` | `N/A`, `0`, your own dash |\n| Icon with text | `HStack gap={6} align='center'` | An `img` with your own margin |\n\n`InlineCodeSnippet` copies on click; `copyable={false}` turns that off.\n\n**Tabs and tables**\n\n- Keep `Tabs` in `DrawerBody` to scroll with the attributes. Pinned tabs: `Tabs asChild` around `DrawerHeader`, `TabsList`, `DrawerBody` (`Drawer` `WithTabs` story); attributes then go in each `TabsContent`.\n- Tab action: `Button size='small'` in `TabsLineActions`.\n- Nested tables follow [Entity table](./entity-table.md). **Never** use `TableActionBar` in a drawer: it renders underneath.\n\n**Does not exist:** `DRAWER_SIZES`, a `size` prop on `Drawer`, `DrawerActions`, `DrawerHeaderActions`, `AttributeGroup`, `AttributeList`, `DescriptionList`, a section component, `fullBleed` on `TabsList` or `Table`."
|
|
1060
|
+
"markdown": "**Drawer**\n\n- Mount one controlled `Drawer` (`open`, `onOpenChange`) for the list. **Never** one per row.\n- Open it from the list `Table` `onMasterCellClick`; mark the row with `activeRowId`. Row-menu clicks do not open it.\n- Keep the last entity in state after close so content does not blank. To reset state after close, use `onExitComplete`: it fires once the exit animation ends.\n- Pass `width={640}`. Use 700 (the Figma frame) only if design confirms it. `width` is read once on mount.\n- If resizable, put `DrawerResizeHandle` first in `DrawerContent` (400–1130px).\n- **Never** add a `DrawerFooter` or your own close button.\n- In tests, pass `data-testid` to `Drawer`. **Never** select by `data-slot`.\n\n**Header actions**\n\n- One `DropdownMenu` in `DrawerHeader`, trigger `Button variant='outline' color='neutral' size='small'` \"Actions\" + `ChevronDown`.\n- Order: edit, state changes, \"Go to …\" links, `DropdownMenuSeparator`, destructive items.\n- Destructive items use `variant='destructive'` and name the entity: \"Delete provider\".\n- Keep the built-in 12px before the close X, though Figma shows 4px.\n\n**Spacing**\n\n- `DrawerBody` owns the 24px gutter. **Never** pad inside it or pass `className` to `DrawerHeader`/`DrawerBody`.\n- Attribute rows: `VStack gap={6} className='pb-8'`. Sections: `Separator spacing={4}`. **Never** a `Separator` above `Tabs`: `TabsList` draws its own line.\n- Section header: `HStack justify='between' align='center' className='py-8'`, `Heading as='h3' size='md' weight='medium'`, optional `Button size='small'`.\n- Full-width tabs: `<div className='-mx-24'>` around `TabsList`, not its `className`. Table 16px from the edge: `<div className='-mx-8'>` around `Table`, never on it. No other negative margins.\n\n**Attributes**\n\n- Always pass `orientation='horizontal'`; the default is vertical.\n- One `AttributeLabel` `width` per drawer: 140 matches Figma; up to 256 for long labels. **Never** wrap a label.\n- Two columns: `grid grid-cols-2 gap-x-8 gap-y-6`, default label width.\n- Section help: an `Info` icon in a `Tooltip` after the heading.\n\n| Data | Value | Not |\n| --- | --- | --- |\n| Plain text | The string as the `AttributeValue` child | A `Text` with your own size |\n| ID, URL, claim, scope, path | `InlineCodeSnippet code={value} size='md'` | `Code`, a monospace `span` |\n| Several codes | Several `InlineCodeSnippet` in `HStack gap={4}` | One joined string |\n| Role, tag, label | `Tag` | `Badge`, plain text |\n| Timestamp | `FormatDateTime format='datetime' layout='inline'` | `toLocaleString()` |\n| Secret | \"Set — never shown\" | Dots, a masked input |\n| Missing value | `Attribute isEmpty` | `N/A`, `0`, your own dash |\n| Icon with text | `HStack gap={6} align='center'` | An `img` with your own margin |\n\n`InlineCodeSnippet` copies on click; `copyable={false}` turns that off.\n\n**Tabs and tables**\n\n- Keep `Tabs` in `DrawerBody` to scroll with the attributes. Pinned tabs: `Tabs asChild` around `DrawerHeader`, `TabsList`, `DrawerBody` (`Drawer` `WithTabs` story); attributes then go in each `TabsContent`.\n- Tab action: `Button size='small'` in `TabsLineActions`.\n- Nested tables follow [Entity table](./entity-table.md). **Never** use `TableActionBar` in a drawer: it renders underneath.\n\n**Does not exist:** `DRAWER_SIZES`, a `size` prop on `Drawer`, `DrawerActions`, `DrawerHeaderActions`, `AttributeGroup`, `AttributeList`, `DescriptionList`, a section component, `fullBleed` on `TabsList` or `Table`."
|
|
1061
1061
|
},
|
|
1062
1062
|
{
|
|
1063
1063
|
"id": "examples",
|
package/package.json
CHANGED