@wallarm-org/design-system 4.8.0-rc-fix-claude-code.1 → 4.8.0-rc-feat-parser.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/README.md +2 -4
  2. package/dist/components/BulkBar/index.d.ts +0 -5
  3. package/dist/components/Drawer/classes.js +1 -1
  4. package/dist/components/DropdownMenu/DropdownMenu.d.ts +2 -0
  5. package/dist/components/DropdownMenu/DropdownMenu.js +84 -71
  6. package/dist/components/DropdownMenu/DropdownMenuItemDescription.js +1 -1
  7. package/dist/components/FilterInput/hooks/useFilterInputAutocomplete/useFilterInputAutocomplete.js +1 -1
  8. package/dist/components/Overlay/Overlay.js +1 -1
  9. package/dist/components/Rules/PointSelector/KeyboardShortcutsDialog.d.ts +14 -0
  10. package/dist/components/Rules/PointSelector/KeyboardShortcutsDialog.js +209 -0
  11. package/dist/components/Rules/PointSelector/MatchStep.d.ts +15 -0
  12. package/dist/components/Rules/PointSelector/MatchStep.js +186 -0
  13. package/dist/components/Rules/PointSelector/MenuFooterHints.d.ts +16 -0
  14. package/dist/components/Rules/PointSelector/MenuFooterHints.js +177 -0
  15. package/dist/components/Rules/PointSelector/PointPreview.d.ts +10 -0
  16. package/dist/components/Rules/PointSelector/PointPreview.js +88 -0
  17. package/dist/components/Rules/PointSelector/PointSelector.d.ts +17 -0
  18. package/dist/components/Rules/PointSelector/PointSelector.js +937 -0
  19. package/dist/components/Rules/PointSelector/PointSelectorEmptyState.d.ts +12 -0
  20. package/dist/components/Rules/PointSelector/PointSelectorEmptyState.js +173 -0
  21. package/dist/components/Rules/PointSelector/PointSelectorError.d.ts +31 -0
  22. package/dist/components/Rules/PointSelector/PointSelectorError.js +275 -0
  23. package/dist/components/Rules/PointSelector/PointSelectorInput.d.ts +20 -0
  24. package/dist/components/Rules/PointSelector/PointSelectorInput.js +130 -0
  25. package/dist/components/Rules/PointSelector/PointSelectorMenu.d.ts +31 -0
  26. package/dist/components/Rules/PointSelector/PointSelectorMenu.js +317 -0
  27. package/dist/components/Rules/PointSelector/PointSelectorSkeleton.d.ts +8 -0
  28. package/dist/components/Rules/PointSelector/PointSelectorSkeleton.js +73 -0
  29. package/dist/components/Rules/PointSelector/SampleRequest.d.ts +14 -0
  30. package/dist/components/Rules/PointSelector/SampleRequest.js +116 -0
  31. package/dist/components/Rules/PointSelector/StepMenu.d.ts +40 -0
  32. package/dist/components/Rules/PointSelector/StepMenu.js +210 -0
  33. package/dist/components/Rules/PointSelector/VersionWarning.d.ts +26 -0
  34. package/dist/components/Rules/PointSelector/VersionWarning.js +231 -0
  35. package/dist/components/Rules/PointSelector/WhereBar.d.ts +48 -0
  36. package/dist/components/Rules/PointSelector/WhereBar.js +263 -0
  37. package/dist/components/Rules/PointSelector/classes.d.ts +28 -0
  38. package/dist/components/Rules/PointSelector/classes.js +22 -0
  39. package/dist/components/Rules/PointSelector/index.d.ts +20 -0
  40. package/dist/components/Rules/PointSelector/index.js +18 -0
  41. package/dist/components/Rules/PointSelector/liftLayer.d.ts +8 -0
  42. package/dist/components/Rules/PointSelector/liftLayer.js +4 -0
  43. package/dist/components/Rules/PointSelector/sampleValue.d.ts +6 -0
  44. package/dist/components/Rules/PointSelector/sampleValue.js +51 -0
  45. package/dist/components/Rules/PointSelector/sdkBridge.d.ts +508 -0
  46. package/dist/components/Rules/PointSelector/sdkBridge.js +339 -0
  47. package/dist/components/Rules/PointSelector/types.d.ts +304 -0
  48. package/dist/components/Rules/PointSelector/types.js +0 -0
  49. package/dist/components/Rules/PointSelector/usePointSelector.d.ts +161 -0
  50. package/dist/components/Rules/PointSelector/usePointSelector.js +1088 -0
  51. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionEditor.d.ts +28 -0
  52. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionEditor.js +208 -0
  53. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionFields.d.ts +23 -0
  54. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionFields.js +950 -0
  55. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTargetPicker.d.ts +21 -0
  56. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTargetPicker.js +110 -0
  57. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTypeSelect.d.ts +20 -0
  58. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTypeSelect.js +31 -0
  59. package/dist/components/Rules/RuleBuilder/ActionEditor/AttackTypeField.d.ts +23 -0
  60. package/dist/components/Rules/RuleBuilder/ActionEditor/AttackTypeField.js +131 -0
  61. package/dist/components/Rules/RuleBuilder/ActionEditor/classes.d.ts +17 -0
  62. package/dist/components/Rules/RuleBuilder/ActionEditor/classes.js +14 -0
  63. package/dist/components/Rules/RuleBuilder/ActionEditor/index.d.ts +6 -0
  64. package/dist/components/Rules/RuleBuilder/ActionEditor/index.js +6 -0
  65. package/dist/components/Rules/RuleBuilder/ConditionTree/AddConditionMenu.d.ts +24 -0
  66. package/dist/components/Rules/RuleBuilder/ConditionTree/AddConditionMenu.js +245 -0
  67. package/dist/components/Rules/RuleBuilder/ConditionTree/AttackCondition.d.ts +15 -0
  68. package/dist/components/Rules/RuleBuilder/ConditionTree/AttackCondition.js +691 -0
  69. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionCard.d.ts +19 -0
  70. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionCard.js +72 -0
  71. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionTree.d.ts +27 -0
  72. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionTree.js +407 -0
  73. package/dist/components/Rules/RuleBuilder/ConditionTree/FieldCondition.d.ts +14 -0
  74. package/dist/components/Rules/RuleBuilder/ConditionTree/FieldCondition.js +269 -0
  75. package/dist/components/Rules/RuleBuilder/ConditionTree/GroupCondition.d.ts +25 -0
  76. package/dist/components/Rules/RuleBuilder/ConditionTree/GroupCondition.js +99 -0
  77. package/dist/components/Rules/RuleBuilder/ConditionTree/SampleCondition.d.ts +14 -0
  78. package/dist/components/Rules/RuleBuilder/ConditionTree/SampleCondition.js +118 -0
  79. package/dist/components/Rules/RuleBuilder/ConditionTree/SignalCondition.d.ts +14 -0
  80. package/dist/components/Rules/RuleBuilder/ConditionTree/SignalCondition.js +446 -0
  81. package/dist/components/Rules/RuleBuilder/ConditionTree/TagCondition.d.ts +14 -0
  82. package/dist/components/Rules/RuleBuilder/ConditionTree/TagCondition.js +266 -0
  83. package/dist/components/Rules/RuleBuilder/ConditionTree/classes.d.ts +35 -0
  84. package/dist/components/Rules/RuleBuilder/ConditionTree/classes.js +57 -0
  85. package/dist/components/Rules/RuleBuilder/ConditionTree/index.d.ts +15 -0
  86. package/dist/components/Rules/RuleBuilder/ConditionTree/index.js +10 -0
  87. package/dist/components/Rules/RuleBuilder/RuleBuilder.d.ts +67 -0
  88. package/dist/components/Rules/RuleBuilder/RuleBuilder.js +366 -0
  89. package/dist/components/Rules/RuleBuilder/Summary/ActionSummary.d.ts +32 -0
  90. package/dist/components/Rules/RuleBuilder/Summary/ActionSummary.js +420 -0
  91. package/dist/components/Rules/RuleBuilder/Summary/ConditionSummary.d.ts +27 -0
  92. package/dist/components/Rules/RuleBuilder/Summary/ConditionSummary.js +446 -0
  93. package/dist/components/Rules/RuleBuilder/Summary/index.d.ts +7 -0
  94. package/dist/components/Rules/RuleBuilder/Summary/index.js +2 -0
  95. package/dist/components/Rules/RuleBuilder/classes.d.ts +19 -0
  96. package/dist/components/Rules/RuleBuilder/classes.js +18 -0
  97. package/dist/components/Rules/RuleBuilder/index.d.ts +55 -0
  98. package/dist/components/Rules/RuleBuilder/index.js +11 -0
  99. package/dist/components/Rules/RuleBuilder/models/actionModel.d.ts +31 -0
  100. package/dist/components/Rules/RuleBuilder/models/actionModel.js +276 -0
  101. package/dist/components/Rules/RuleBuilder/models/conditionModel.d.ts +95 -0
  102. package/dist/components/Rules/RuleBuilder/models/conditionModel.js +418 -0
  103. package/dist/components/Rules/RuleBuilder/models/index.d.ts +3 -0
  104. package/dist/components/Rules/RuleBuilder/models/index.js +3 -0
  105. package/dist/components/Rules/RuleBuilder/models/validation.d.ts +176 -0
  106. package/dist/components/Rules/RuleBuilder/models/validation.js +242 -0
  107. package/dist/components/Rules/RuleBuilder/shared/ChoiceSelect.d.ts +27 -0
  108. package/dist/components/Rules/RuleBuilder/shared/ChoiceSelect.js +92 -0
  109. package/dist/components/Rules/RuleBuilder/shared/index.d.ts +1 -0
  110. package/dist/components/Rules/RuleBuilder/shared/index.js +1 -0
  111. package/dist/components/Rules/RuleBuilder/types.d.ts +384 -0
  112. package/dist/components/Rules/RuleBuilder/types.js +0 -0
  113. package/dist/components/Rules/RuleBuilder/utils/constants.d.ts +65 -0
  114. package/dist/components/Rules/RuleBuilder/utils/constants.js +356 -0
  115. package/dist/components/Rules/RuleBuilder/utils/extractBindings.d.ts +48 -0
  116. package/dist/components/Rules/RuleBuilder/utils/extractBindings.js +42 -0
  117. package/dist/components/Rules/RuleBuilder/utils/helpers.d.ts +92 -0
  118. package/dist/components/Rules/RuleBuilder/utils/helpers.js +54 -0
  119. package/dist/components/Rules/RuleBuilder/utils/index.d.ts +2 -0
  120. package/dist/components/Rules/RuleBuilder/utils/index.js +2 -0
  121. package/dist/components/SearchInput/SearchInput.d.ts +5 -7
  122. package/dist/components/SearchInput/SearchInput.js +101 -119
  123. package/dist/components/Select/SelectSearchInput.d.ts +1 -1
  124. package/dist/components/Table/types.d.ts +1 -1
  125. package/dist/components/Tabs/Tabs.d.ts +0 -1
  126. package/dist/components/Tabs/Tabs.js +28 -30
  127. package/dist/components/Tabs/TabsList/index.d.ts +1 -1
  128. package/dist/components/Tabs/index.d.ts +2 -2
  129. package/dist/components/Tour/TourPositioner.d.ts +0 -3
  130. package/dist/components/Tour/TourPositioner.js +4 -4
  131. package/dist/index.d.ts +3 -2
  132. package/dist/index.js +2 -1
  133. package/dist/metadata/components.json +9077 -12300
  134. package/dist/theme/typography.css +0 -5
  135. package/dist/utils/formatDateTime.d.ts +0 -6
  136. package/dist/utils/formatDateTime.js +1 -13
  137. package/package.json +4 -6
  138. package/dist/components/NotificationCenter/NotificationCenter.d.ts +0 -20
  139. package/dist/components/NotificationCenter/NotificationCenter.js +0 -65
  140. package/dist/components/NotificationCenter/NotificationCenterBody.d.ts +0 -18
  141. package/dist/components/NotificationCenter/NotificationCenterBody.js +0 -202
  142. package/dist/components/NotificationCenter/NotificationCenterContent.d.ts +0 -5
  143. package/dist/components/NotificationCenter/NotificationCenterContent.js +0 -42
  144. package/dist/components/NotificationCenter/NotificationCenterHeader.d.ts +0 -20
  145. package/dist/components/NotificationCenter/NotificationCenterHeader.js +0 -202
  146. package/dist/components/NotificationCenter/NotificationCenterItem.d.ts +0 -26
  147. package/dist/components/NotificationCenter/NotificationCenterItem.js +0 -211
  148. package/dist/components/NotificationCenter/NotificationCenterItemTime.d.ts +0 -9
  149. package/dist/components/NotificationCenter/NotificationCenterItemTime.js +0 -148
  150. package/dist/components/NotificationCenter/NotificationCenterItemTitle.d.ts +0 -14
  151. package/dist/components/NotificationCenter/NotificationCenterItemTitle.js +0 -115
  152. package/dist/components/NotificationCenter/NotificationCenterTabs.d.ts +0 -10
  153. package/dist/components/NotificationCenter/NotificationCenterTabs.js +0 -77
  154. package/dist/components/NotificationCenter/NotificationCenterTrigger.d.ts +0 -13
  155. package/dist/components/NotificationCenter/NotificationCenterTrigger.js +0 -138
  156. package/dist/components/NotificationCenter/index.d.ts +0 -9
  157. package/dist/components/NotificationCenter/index.js +0 -9
  158. package/dist/guidelines/foundations/color.md +0 -157
  159. package/dist/guidelines/foundations/focus.md +0 -122
  160. package/dist/guidelines/foundations/layering.md +0 -131
  161. package/dist/guidelines/foundations/radius-elevation.md +0 -111
  162. package/dist/guidelines/foundations/spacing.md +0 -117
  163. package/dist/guidelines/foundations/typography.md +0 -114
  164. package/dist/guidelines/patterns/app-layout.md +0 -1567
  165. package/dist/guidelines/patterns/auth-page.md +0 -668
  166. package/dist/guidelines/patterns/confirmation-dialogs.md +0 -605
  167. package/dist/guidelines/patterns/create-edit-forms.md +0 -768
  168. package/dist/guidelines/patterns/detail-drawer.md +0 -868
  169. package/dist/guidelines/patterns/empty-states.md +0 -461
  170. package/dist/guidelines/patterns/entity-table.md +0 -533
  171. package/dist/guidelines/patterns/feedback-toasts.md +0 -493
  172. package/dist/guidelines/patterns/filtering.md +0 -630
  173. package/dist/guidelines/patterns/resource-list-page.md +0 -558
  174. package/dist/guidelines/patterns/settings-page.md +0 -752
  175. package/dist/guidelines/rules.md +0 -25
  176. package/dist/metadata/guidelines.json +0 -1705
@@ -1,558 +0,0 @@
1
- ---
2
- title: Resource list page
3
- description: Use when building a page that lists one kind of entity (users, roles, SSO providers, channels) with a create action, search, status tabs and a table.
4
- components: [Page, PageHeader, PageHeaderGroup, PageTitle, PageDescription, PageActions, PageToolbar, PageContent, RemoteShellBreadcrumb, Button, SearchInput, SegmentedTabs, SegmentedTabsList, SegmentedTabsTrigger, NumericBadge, Table, TableEmptyState, EmptyState, EmptyStateIllustration, EmptyStateMessage, EmptyStateTitle, EmptyStateDescription, EmptyStateActions]
5
- keywords: [list page, index page, resource list, entity list, collection page, settings list, page header, breadcrumbs, toolbar, search, status tabs, segmented tabs, counts, create button, table page, CRUD]
6
- order: 10
7
- ---
8
-
9
- # Resource list page
10
-
11
- A resource list page is `Page` with a header, a filter toolbar and one `Table`. All parts import from `@wallarm-org/design-system`.
12
-
13
- ## When to use
14
-
15
- | Need | Use | Not |
16
- | --- | --- | --- |
17
- | A list of one entity with create, search and a status filter | This pattern | A `Card` grid, a hand-built `<table>` |
18
- | A list with no create action and no filter | `Page`, `PageHeader`, `PageContent`; drop the rest | A bare `Table` with a custom heading |
19
- | One record with its fields | [Detail drawer](./detail-drawer.md) | A one-row table |
20
- | Many filter dimensions, chips, scope | [Filtering](./filtering.md) in `PageToolbar` | Several `SegmentedTabs` side by side |
21
- | Column, cell, row menu and bulk bar rules | [Entity table](./entity-table.md) | Rules from this page |
22
- | Shell, rails, product menu, breadcrumbs | [Application layout](./app-layout.md) | Rendering them inside the page |
23
-
24
- ## Rules
25
-
26
- Spacing counts in pixels: `px-24` is 24px. See [Spacing](../foundations/spacing.md).
27
-
28
- **Frame and spacing**
29
-
30
- - If the page lists rows, use `<Page fullSize fixedHeight>`. The body scrolls; header and toolbar stay put.
31
- - `PageHeader`, `PageToolbar` and `PageContent` own the 24px side gutter. **Never** wrap `Page` or them in a padded container, and **never** add `px-*`, `py-*` or `gap-*` to `PageToolbar` or `PageContent`.
32
- - Toolbar to table is 12px, and search to tabs is 12px. Both are automatic; add nothing.
33
- - Put `Table` straight into `PageContent`. It aligns to the gutter.
34
- - **Never** put the search or the status tabs inside `PageHeader` or `PageContent`. They go in `PageToolbar`.
35
-
36
- **Header**
37
-
38
- - The trail ("Settings › Users") is `RemoteShellBreadcrumb`, above the page; see [Application layout](./app-layout.md). **Never** put `Breadcrumbs` in `PageHeader`.
39
- - The title repeats the last crumb.
40
- - Give `PageHeaderGroup` `className='flex-1'` so a long description never pushes the buttons down.
41
- - Write `PageDescription` as one plain sentence: what the entity is and how it relates to sibling pages.
42
- - Show one primary button in `PageActions`, labelled "Create" plus the entity: "Create user".
43
- - Use `Button size='medium'` (32px) in `PageActions`. The default `large` is 36px.
44
- - If there is a code-first alternative ("Edit as code"), make it `variant='secondary'` in the same `PageActions`.
45
-
46
- **Toolbar**
47
-
48
- - Give `SearchInput` `className='w-[320px]'` and a placeholder naming the searched fields: "Search name or email". Keep the default size.
49
- - `SearchInput` has a built-in clear button that calls `onChange('')`. **Never** add a separate Clear button.
50
- - Use `SegmentedTabs` with `value` and `onChange(value: string)` as the status filter. It has no `onValueChange`.
51
- - Put the count in a `NumericBadge` inside each `SegmentedTabsTrigger`, after the label. Recompute counts when data changes.
52
- - **Never** add `SegmentedTabsContent` for a filter. The tabs change `data`; the one `Table` stays.
53
- - If you need filters beyond the one status filter, use `FilterInput` or [Filtering](./filtering.md).
54
-
55
- **Table**
56
-
57
- - Pass `getRowId` so selection and row state survive refetches.
58
- - **Never** use `meta.renderMenuAction` for entity actions you expect to be always visible: its `…` shows only on row hover, an open menu or preview. Add a trailing actions column; see [Entity table](./entity-table.md).
59
-
60
- **What does not exist**
61
-
62
- There is no breadcrumbs prop or slot on `Page` or `PageHeader`, no `PageBreadcrumbs`, no `size` prop on `PageTitle`, no `className` on `SegmentedTabs`, and no `DRAWER_SIZES` or `DIALOG_SIZES` export.
63
-
64
- ## Examples
65
-
66
- The page frame: a fixed-height `Page` with the table directly in `PageContent`.
67
-
68
- The whole page: title, description and one create action in the header; search
69
- and status tabs with counts in the toolbar; a user table with a status badge and an
70
- always-visible actions column. Search and tabs filter the rows.
71
-
72
- ```tsx story=Default
73
- import { useState } from 'react';
74
- import { Avatar, AvatarContent, AvatarDescription, AvatarFallback, AvatarName } from '@wallarm-org/design-system/Avatar';
75
- import { Badge } from '@wallarm-org/design-system/Badge';
76
- import { Button } from '@wallarm-org/design-system/Button';
77
- import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemText, DropdownMenuSeparator, DropdownMenuTrigger } from '@wallarm-org/design-system/DropdownMenu';
78
- import { EmptyState, EmptyStateActions, EmptyStateDescription, EmptyStateIllustration, EmptyStateMessage, EmptyStateTitle } from '@wallarm-org/design-system/EmptyState';
79
- import { FormatDateTime } from '@wallarm-org/design-system/FormatDateTime';
80
- import { Ellipsis, FilterX, SearchX, Users } from '@wallarm-org/design-system/icons';
81
- import { NumericBadge } from '@wallarm-org/design-system/NumericBadge';
82
- import { Page, PageActions, PageContent, PageDescription, PageHeader, PageHeaderGroup, PageTitle, PageToolbar } from '@wallarm-org/design-system/Page';
83
- import { SearchInput } from '@wallarm-org/design-system/SearchInput';
84
- import { SegmentedTabs, SegmentedTabsList, SegmentedTabsTrigger } from '@wallarm-org/design-system/SegmentedTabs';
85
- import { type TableCellContext, type TableColumnDef, Table, TableEmptyState } from '@wallarm-org/design-system/Table';
86
-
87
- export const Default = () => {
88
- const [query, setQuery] = useState('');
89
- const [status, setStatus] = useState('all');
90
-
91
- const STATUS = {
92
- active: { label: 'Active', color: 'green' },
93
- invited: { label: 'Invited', color: 'yellow' },
94
- deactivated: { label: 'Deactivated', color: 'gray' },
95
- } as const;
96
-
97
- const renderUser = ({ row }: TableCellContext<User, unknown>) => (
98
- <Avatar size='md'>
99
- <AvatarFallback name={row.original.name} />
100
- <AvatarContent>
101
- <AvatarName>{row.original.name}</AvatarName>
102
- <AvatarDescription>{row.original.email}</AvatarDescription>
103
- </AvatarContent>
104
- </Avatar>
105
- );
106
-
107
- const renderStatus = ({ row }: TableCellContext<User, unknown>) => (
108
- <Badge variant='dotted' type='secondary' color={STATUS[row.original.status].color}>
109
- {STATUS[row.original.status].label}
110
- </Badge>
111
- );
112
-
113
- const renderLastSignIn = ({ row }: TableCellContext<User, unknown>) => (
114
- <FormatDateTime value={row.original.lastSignIn} format='date' />
115
- );
116
-
117
- const renderActions = ({ row }: TableCellContext<User, unknown>) => {
118
- const user = row.original;
119
- const handleEdit = () => onEditUser(user);
120
- const handleDeactivate = () => onDeactivateUser(user);
121
- const handleDelete = () => onDeleteUser(user);
122
-
123
- return (
124
- <DropdownMenu>
125
- <DropdownMenuTrigger asChild>
126
- <Button
127
- variant='ghost'
128
- color='neutral'
129
- size='small'
130
- aria-label={`Actions for ${user.name}`}
131
- >
132
- <Ellipsis />
133
- </Button>
134
- </DropdownMenuTrigger>
135
- <DropdownMenuContent>
136
- <DropdownMenuItem onSelect={handleEdit}>
137
- <DropdownMenuItemText>Edit</DropdownMenuItemText>
138
- </DropdownMenuItem>
139
- <DropdownMenuItem onSelect={handleDeactivate}>
140
- <DropdownMenuItemText>Deactivate</DropdownMenuItemText>
141
- </DropdownMenuItem>
142
- <DropdownMenuSeparator />
143
- <DropdownMenuItem variant='destructive' onSelect={handleDelete}>
144
- <DropdownMenuItemText>Delete user</DropdownMenuItemText>
145
- </DropdownMenuItem>
146
- </DropdownMenuContent>
147
- </DropdownMenu>
148
- );
149
- };
150
-
151
- const columns: TableColumnDef<User>[] = [
152
- { accessorKey: 'name', header: 'Name', size: 320, cell: renderUser },
153
- { accessorKey: 'role', header: 'Role', size: 200 },
154
- { accessorKey: 'status', header: 'Status', size: 140, cell: renderStatus },
155
- { accessorKey: 'lastSignIn', header: 'Last sign-in', size: 200, cell: renderLastSignIn },
156
- {
157
- id: 'actions',
158
- header: '',
159
- size: 60,
160
- minSize: 60,
161
- enableHiding: false,
162
- cell: renderActions,
163
- },
164
- ];
165
-
166
- const search = query.trim().toLowerCase();
167
- const matching = USERS.filter(
168
- user => user.name.toLowerCase().includes(search) || user.email.toLowerCase().includes(search),
169
- );
170
- const counts = {
171
- all: matching.length,
172
- active: matching.filter(user => user.status === 'active').length,
173
- invited: matching.filter(user => user.status === 'invited').length,
174
- deactivated: matching.filter(user => user.status === 'deactivated').length,
175
- };
176
- const rows = status === 'all' ? matching : matching.filter(user => user.status === status);
177
-
178
- const handleReset = () => {
179
- setQuery('');
180
- setStatus('all');
181
- };
182
-
183
- return (
184
- <Page name='settings-users' fullSize fixedHeight data-testid='users-page'>
185
- <PageHeader>
186
- <PageHeaderGroup className='flex-1'>
187
- <PageTitle>Users</PageTitle>
188
- <PageDescription>
189
- People who can sign in to your organization, with access set by roles and groups.
190
- </PageDescription>
191
- </PageHeaderGroup>
192
- <PageActions>
193
- <Button size='medium' onClick={onCreateUser} data-testid='users-create'>
194
- Create user
195
- </Button>
196
- </PageActions>
197
- </PageHeader>
198
-
199
- <PageToolbar>
200
- <SearchInput
201
- value={query}
202
- onChange={setQuery}
203
- placeholder='Search name or email'
204
- className='w-[320px]'
205
- data-testid='users-search'
206
- />
207
- <SegmentedTabs value={status} onChange={setStatus} data-testid='users-status-tabs'>
208
- <SegmentedTabsList>
209
- <SegmentedTabsTrigger value='all'>
210
- All <NumericBadge>{counts.all}</NumericBadge>
211
- </SegmentedTabsTrigger>
212
- <SegmentedTabsTrigger value='active'>
213
- Active <NumericBadge>{counts.active}</NumericBadge>
214
- </SegmentedTabsTrigger>
215
- <SegmentedTabsTrigger value='invited'>
216
- Invited <NumericBadge>{counts.invited}</NumericBadge>
217
- </SegmentedTabsTrigger>
218
- <SegmentedTabsTrigger value='deactivated'>
219
- Deactivated <NumericBadge>{counts.deactivated}</NumericBadge>
220
- </SegmentedTabsTrigger>
221
- </SegmentedTabsList>
222
- </SegmentedTabs>
223
- </PageToolbar>
224
-
225
- <PageContent>
226
- <Table
227
- aria-label='Users'
228
- data={rows}
229
- columns={columns}
230
- getRowId={getUserId}
231
- data-testid='users-table'
232
- >
233
- <TableEmptyState>
234
- <EmptyState type='collection-empty' data-testid='users-no-results'>
235
- <EmptyStateIllustration>
236
- <SearchX />
237
- </EmptyStateIllustration>
238
- <EmptyStateMessage>
239
- <EmptyStateTitle>No results found</EmptyStateTitle>
240
- <EmptyStateDescription>No users match your search or status.</EmptyStateDescription>
241
- </EmptyStateMessage>
242
- <EmptyStateActions>
243
- <Button size='medium' variant='outline' color='neutral' onClick={handleReset}>
244
- <FilterX />
245
- Reset filters
246
- </Button>
247
- </EmptyStateActions>
248
- </EmptyState>
249
- </TableEmptyState>
250
- </Table>
251
- </PageContent>
252
- </Page>
253
- );
254
- };
255
- ```
256
-
257
- A header with a title block and one create action.
258
-
259
- The title repeats the last crumb of the product's trail; one create action sits on the right.
260
-
261
- ```tsx story=Header
262
- import { Button } from '@wallarm-org/design-system/Button';
263
- import { Users } from '@wallarm-org/design-system/icons';
264
- import { Page, PageActions, PageDescription, PageHeader, PageHeaderGroup, PageTitle } from '@wallarm-org/design-system/Page';
265
-
266
- export const Header = () => (
267
- <Page name='settings-users' data-testid='users-page'>
268
- <PageHeader>
269
- <PageHeaderGroup className='flex-1'>
270
- <PageTitle>Users</PageTitle>
271
- <PageDescription>
272
- People who can sign in to your organization, with access set by roles and groups.
273
- </PageDescription>
274
- </PageHeaderGroup>
275
- <PageActions>
276
- <Button size='medium' onClick={onCreateUser} data-testid='users-create'>
277
- Create user
278
- </Button>
279
- </PageActions>
280
- </PageHeader>
281
- </Page>
282
- );
283
- ```
284
-
285
- A toolbar with search and status tabs that carry counts.
286
-
287
- Search clears with its built-in button; the tabs filter the one table, with no tab panels.
288
-
289
- ```tsx story=Toolbar
290
- import { useState } from 'react';
291
- import { NumericBadge } from '@wallarm-org/design-system/NumericBadge';
292
- import { Page, PageToolbar } from '@wallarm-org/design-system/Page';
293
- import { SearchInput } from '@wallarm-org/design-system/SearchInput';
294
- import { SegmentedTabs, SegmentedTabsList, SegmentedTabsTrigger } from '@wallarm-org/design-system/SegmentedTabs';
295
-
296
- export const Toolbar = () => {
297
- const [query, setQuery] = useState('');
298
- const [status, setStatus] = useState('all');
299
-
300
- const counts = {
301
- all: USERS.length,
302
- active: USERS.filter(user => user.status === 'active').length,
303
- invited: USERS.filter(user => user.status === 'invited').length,
304
- };
305
-
306
- return (
307
- <Page name='settings-users' data-testid='users-page'>
308
- <PageToolbar>
309
- <SearchInput
310
- value={query}
311
- onChange={setQuery}
312
- placeholder='Search name or email'
313
- className='w-[320px]'
314
- data-testid='users-search'
315
- />
316
- <SegmentedTabs value={status} onChange={setStatus} data-testid='users-status-tabs'>
317
- <SegmentedTabsList>
318
- <SegmentedTabsTrigger value='all'>
319
- All <NumericBadge>{counts.all}</NumericBadge>
320
- </SegmentedTabsTrigger>
321
- <SegmentedTabsTrigger value='active'>
322
- Active <NumericBadge>{counts.active}</NumericBadge>
323
- </SegmentedTabsTrigger>
324
- <SegmentedTabsTrigger value='invited'>
325
- Invited <NumericBadge>{counts.invited}</NumericBadge>
326
- </SegmentedTabsTrigger>
327
- </SegmentedTabsList>
328
- </SegmentedTabs>
329
- </PageToolbar>
330
- </Page>
331
- );
332
- };
333
- ```
334
-
335
- No results: `type='collection-empty'` with a button that resets filters.
336
-
337
- Search or a tab matched nothing: "No results found" with a "Reset filters" button that clears
338
- both. The header keeps its one create action; the empty state never adds another, and never
339
- uses `type='no-results'` (that is for cards and menus).
340
-
341
- ```tsx story=NoResults
342
- import { useState } from 'react';
343
- import { Button } from '@wallarm-org/design-system/Button';
344
- import { EmptyState, EmptyStateActions, EmptyStateDescription, EmptyStateIllustration, EmptyStateMessage, EmptyStateTitle } from '@wallarm-org/design-system/EmptyState';
345
- import { FilterX, SearchX, Users } from '@wallarm-org/design-system/icons';
346
- import { NumericBadge } from '@wallarm-org/design-system/NumericBadge';
347
- import { Page, PageActions, PageContent, PageDescription, PageHeader, PageHeaderGroup, PageTitle, PageToolbar } from '@wallarm-org/design-system/Page';
348
- import { SearchInput } from '@wallarm-org/design-system/SearchInput';
349
- import { SegmentedTabs, SegmentedTabsList, SegmentedTabsTrigger } from '@wallarm-org/design-system/SegmentedTabs';
350
- import { type TableColumnDef, Table, TableEmptyState } from '@wallarm-org/design-system/Table';
351
-
352
- export const NoResults = () => {
353
- const [query, setQuery] = useState('contractor');
354
- const [status, setStatus] = useState('all');
355
-
356
- const columns: TableColumnDef<User>[] = [
357
- { accessorKey: 'name', header: 'Name', size: 320 },
358
- { accessorKey: 'role', header: 'Role', size: 200 },
359
- { accessorKey: 'status', header: 'Status', size: 140 },
360
- { accessorKey: 'lastSignIn', header: 'Last sign-in', size: 200 },
361
- ];
362
-
363
- const search = query.trim().toLowerCase();
364
- const matching = USERS.filter(
365
- user => user.name.toLowerCase().includes(search) || user.email.toLowerCase().includes(search),
366
- );
367
- const counts = {
368
- all: matching.length,
369
- active: matching.filter(user => user.status === 'active').length,
370
- invited: matching.filter(user => user.status === 'invited').length,
371
- };
372
- const rows = status === 'all' ? matching : matching.filter(user => user.status === status);
373
-
374
- const handleReset = () => {
375
- setQuery('');
376
- setStatus('all');
377
- };
378
-
379
- return (
380
- <Page name='settings-users' fullSize fixedHeight data-testid='users-page'>
381
- <PageHeader>
382
- <PageHeaderGroup className='flex-1'>
383
- <PageTitle>Users</PageTitle>
384
- <PageDescription>
385
- People who can sign in to your organization, with access set by roles and groups.
386
- </PageDescription>
387
- </PageHeaderGroup>
388
- <PageActions>
389
- <Button size='medium' onClick={onCreateUser} data-testid='users-create'>
390
- Create user
391
- </Button>
392
- </PageActions>
393
- </PageHeader>
394
-
395
- <PageToolbar>
396
- <SearchInput
397
- value={query}
398
- onChange={setQuery}
399
- placeholder='Search name or email'
400
- className='w-[320px]'
401
- data-testid='users-search'
402
- />
403
- <SegmentedTabs value={status} onChange={setStatus} data-testid='users-status-tabs'>
404
- <SegmentedTabsList>
405
- <SegmentedTabsTrigger value='all'>
406
- All <NumericBadge>{counts.all}</NumericBadge>
407
- </SegmentedTabsTrigger>
408
- <SegmentedTabsTrigger value='active'>
409
- Active <NumericBadge>{counts.active}</NumericBadge>
410
- </SegmentedTabsTrigger>
411
- <SegmentedTabsTrigger value='invited'>
412
- Invited <NumericBadge>{counts.invited}</NumericBadge>
413
- </SegmentedTabsTrigger>
414
- </SegmentedTabsList>
415
- </SegmentedTabs>
416
- </PageToolbar>
417
-
418
- <PageContent>
419
- <Table
420
- aria-label='Users'
421
- data={rows}
422
- columns={columns}
423
- getRowId={getUserId}
424
- data-testid='users-table'
425
- >
426
- <TableEmptyState>
427
- <EmptyState type='collection-empty' data-testid='users-no-results'>
428
- <EmptyStateIllustration>
429
- <SearchX />
430
- </EmptyStateIllustration>
431
- <EmptyStateMessage>
432
- <EmptyStateTitle>No results found</EmptyStateTitle>
433
- <EmptyStateDescription>No users match your search or status.</EmptyStateDescription>
434
- </EmptyStateMessage>
435
- <EmptyStateActions>
436
- <Button size='medium' variant='outline' color='neutral' onClick={handleReset}>
437
- <FilterX />
438
- Reset filters
439
- </Button>
440
- </EmptyStateActions>
441
- </EmptyState>
442
- </TableEmptyState>
443
- </Table>
444
- </PageContent>
445
- </Page>
446
- );
447
- };
448
- ```
449
-
450
- Nothing exists yet: the same `type='collection-empty'`, with no button.
451
-
452
- Nothing exists yet: the real header with its create button, the toolbar, and an empty state
453
- with no button of its own — one create action per screen.
454
-
455
- ```tsx story=Empty
456
- import { useState } from 'react';
457
- import { Button } from '@wallarm-org/design-system/Button';
458
- import { EmptyState, EmptyStateDescription, EmptyStateIllustration, EmptyStateMessage, EmptyStateTitle } from '@wallarm-org/design-system/EmptyState';
459
- import { Users } from '@wallarm-org/design-system/icons';
460
- import { Page, PageActions, PageContent, PageDescription, PageHeader, PageHeaderGroup, PageTitle, PageToolbar } from '@wallarm-org/design-system/Page';
461
- import { SearchInput } from '@wallarm-org/design-system/SearchInput';
462
- import { type TableColumnDef, Table, TableEmptyState } from '@wallarm-org/design-system/Table';
463
-
464
- export const Empty = () => {
465
- const [query, setQuery] = useState('');
466
-
467
- const columns: TableColumnDef<User>[] = [
468
- { accessorKey: 'name', header: 'Name', size: 320 },
469
- { accessorKey: 'role', header: 'Role', size: 200 },
470
- { accessorKey: 'status', header: 'Status', size: 140 },
471
- { accessorKey: 'lastSignIn', header: 'Last sign-in', size: 200 },
472
- ];
473
-
474
- return (
475
- <Page name='settings-users' fullSize fixedHeight data-testid='users-page'>
476
- <PageHeader>
477
- <PageHeaderGroup className='flex-1'>
478
- <PageTitle>Users</PageTitle>
479
- <PageDescription>
480
- People who can sign in to your organization, with access set by roles and groups.
481
- </PageDescription>
482
- </PageHeaderGroup>
483
- <PageActions>
484
- <Button size='medium' onClick={onCreateUser} data-testid='users-create'>
485
- Create user
486
- </Button>
487
- </PageActions>
488
- </PageHeader>
489
-
490
- <PageToolbar>
491
- <SearchInput
492
- value={query}
493
- onChange={setQuery}
494
- placeholder='Search name or email'
495
- className='w-[320px]'
496
- data-testid='users-search'
497
- />
498
- </PageToolbar>
499
-
500
- <PageContent>
501
- <Table
502
- aria-label='Users'
503
- data={[]}
504
- columns={columns}
505
- getRowId={getUserId}
506
- data-testid='users-table'
507
- >
508
- <TableEmptyState>
509
- <EmptyState type='collection-empty' data-testid='users-empty-state'>
510
- <EmptyStateIllustration>
511
- <Users />
512
- </EmptyStateIllustration>
513
- <EmptyStateMessage>
514
- <EmptyStateTitle>No users yet</EmptyStateTitle>
515
- <EmptyStateDescription>Invite people so they can sign in.</EmptyStateDescription>
516
- </EmptyStateMessage>
517
- </EmptyState>
518
- </TableEmptyState>
519
- </Table>
520
- </PageContent>
521
- </Page>
522
- );
523
- };
524
- ```
525
-
526
- ## States
527
-
528
- | State | Show | Example component |
529
- | --- | --- | --- |
530
- | First load | Skeleton rows under a real header. **Never** a `Loader` in place of the table | `<Table data={[]} isLoading />` |
531
- | Loading more | Keep `data`, set `isLoading`; skeletons append below. **Never** clear `data` while fetching | `Table isLoading` |
532
- | Nothing exists yet | Header with its create button, toolbar, empty state with no button (one create action per screen) | `TableEmptyState` › `EmptyState type='collection-empty'` |
533
- | Search or tab matched nothing | "No results found" and a "Reset filters" button. **Never** a create CTA, **never** `type='no-results'` (that is for cards and menus) | `TableEmptyState` › `EmptyState type='collection-empty'` |
534
- | Search active | The typed value stays in the field | `SearchInput` |
535
- | Request failed | Your own message; the table has no error state | App-rendered, in `PageContent` |
536
-
537
- ## What your app owns
538
-
539
- | Concern | Recipe |
540
- | --- | --- |
541
- | Shell and rails | The page renders `Page` only, inside `RemoteShellContent`. See [Application layout](./app-layout.md) |
542
- | Fetching, search, status filter | Pass the filtered array as `data`; set `isLoading` while fetching |
543
- | Status counts | Compute from the server or the full array |
544
- | Create flow | Short form: `Dialog` from `@wallarm-org/design-system/Dialog`. Long form: `Drawer`. See [Create and edit forms](./create-edit-forms.md) |
545
- | Detail drawer width | Presets are 640, 960 and 1130. Figma uses 700; pass `width={640}` unless design confirms 700. See [Detail drawer](./detail-drawer.md) |
546
- | URL state | Sync `query` and `status` to the URL yourself; there is no router integration |
547
- | Error state | Render your own message in `PageContent` |
548
-
549
- ## Related
550
-
551
- - [Application layout](./app-layout.md)
552
- - [Spacing](../foundations/spacing.md)
553
- - [Entity table](./entity-table.md)
554
- - [Filtering](./filtering.md)
555
- - [Empty states](./empty-states.md)
556
- - [Create and edit forms](./create-edit-forms.md)
557
- - [Detail drawer](./detail-drawer.md)
558
- - [Confirmation dialogs](./confirmation-dialogs.md)