@wallarm-org/design-system 4.10.0-rc-feat-parser.1 → 4.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/components/Badge/generateBadgeVariants.js +9 -28
- package/dist/components/CodeSnippet/internal/FoldToggle.js +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +0 -2
- package/dist/components/DropdownMenu/DropdownMenu.js +71 -84
- package/dist/components/DropdownMenu/DropdownMenuItemDescription.js +1 -1
- package/dist/components/FilterInput/hooks/useFilterInputAutocomplete/useFilterInputAutocomplete.js +1 -1
- package/dist/components/SimpleCharts/Chart/classes.js +1 -1
- package/dist/components/SimpleCharts/HorizontalBarStack/classes.js +1 -1
- package/dist/components/SimpleCharts/Metric/classes.d.ts +2 -2
- package/dist/components/SimpleCharts/Metric/classes.js +2 -2
- package/dist/components/Table/TableBody/TableBodyCell.js +4 -1
- package/dist/guidelines/patterns/complex-drawer.md +1084 -0
- package/dist/guidelines/patterns/confirmation-dialogs.md +3 -11
- package/dist/guidelines/patterns/detail-drawer.md +31 -13
- package/dist/guidelines/patterns/empty-states.md +6 -5
- package/dist/guidelines/patterns/entity-table.md +25 -29
- package/dist/guidelines/patterns/feedback-toasts.md +3 -11
- package/dist/guidelines/patterns/resource-list-page.md +14 -16
- package/dist/guidelines/rules.md +6 -5
- package/dist/guidelines/templates/ai-assistant.md +1133 -0
- package/dist/guidelines/templates/api-inventory.md +905 -0
- package/dist/guidelines/templates/attack-events.md +2722 -0
- package/dist/guidelines/templates/incident-detail.md +2085 -0
- package/dist/guidelines/templates/integrations-settings.md +836 -0
- package/dist/guidelines/templates/page-states.md +798 -0
- package/dist/guidelines/templates/rule-editor.md +886 -0
- package/dist/guidelines/templates/security-dashboard.md +681 -0
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -2
- package/dist/metadata/components.json +9 -107
- package/dist/metadata/guidelines.json +1203 -36
- package/dist/theme/tokens.test.ts +52 -0
- package/package.json +1 -4
- package/dist/components/Rules/PointSelector/KeyboardShortcutsDialog.d.ts +0 -14
- package/dist/components/Rules/PointSelector/KeyboardShortcutsDialog.js +0 -209
- package/dist/components/Rules/PointSelector/MatchStep.d.ts +0 -15
- package/dist/components/Rules/PointSelector/MatchStep.js +0 -186
- package/dist/components/Rules/PointSelector/MenuFooterHints.d.ts +0 -16
- package/dist/components/Rules/PointSelector/MenuFooterHints.js +0 -177
- package/dist/components/Rules/PointSelector/PointPreview.d.ts +0 -10
- package/dist/components/Rules/PointSelector/PointPreview.js +0 -88
- package/dist/components/Rules/PointSelector/PointSelector.d.ts +0 -17
- package/dist/components/Rules/PointSelector/PointSelector.js +0 -937
- package/dist/components/Rules/PointSelector/PointSelectorEmptyState.d.ts +0 -12
- package/dist/components/Rules/PointSelector/PointSelectorEmptyState.js +0 -173
- package/dist/components/Rules/PointSelector/PointSelectorError.d.ts +0 -31
- package/dist/components/Rules/PointSelector/PointSelectorError.js +0 -275
- package/dist/components/Rules/PointSelector/PointSelectorInput.d.ts +0 -20
- package/dist/components/Rules/PointSelector/PointSelectorInput.js +0 -130
- package/dist/components/Rules/PointSelector/PointSelectorMenu.d.ts +0 -31
- package/dist/components/Rules/PointSelector/PointSelectorMenu.js +0 -317
- package/dist/components/Rules/PointSelector/PointSelectorSkeleton.d.ts +0 -8
- package/dist/components/Rules/PointSelector/PointSelectorSkeleton.js +0 -73
- package/dist/components/Rules/PointSelector/SampleRequest.d.ts +0 -14
- package/dist/components/Rules/PointSelector/SampleRequest.js +0 -116
- package/dist/components/Rules/PointSelector/StepMenu.d.ts +0 -40
- package/dist/components/Rules/PointSelector/StepMenu.js +0 -210
- package/dist/components/Rules/PointSelector/VersionWarning.d.ts +0 -26
- package/dist/components/Rules/PointSelector/VersionWarning.js +0 -231
- package/dist/components/Rules/PointSelector/WhereBar.d.ts +0 -48
- package/dist/components/Rules/PointSelector/WhereBar.js +0 -263
- package/dist/components/Rules/PointSelector/classes.d.ts +0 -28
- package/dist/components/Rules/PointSelector/classes.js +0 -22
- package/dist/components/Rules/PointSelector/index.d.ts +0 -20
- package/dist/components/Rules/PointSelector/index.js +0 -18
- package/dist/components/Rules/PointSelector/liftLayer.d.ts +0 -8
- package/dist/components/Rules/PointSelector/liftLayer.js +0 -4
- package/dist/components/Rules/PointSelector/sampleValue.d.ts +0 -6
- package/dist/components/Rules/PointSelector/sampleValue.js +0 -51
- package/dist/components/Rules/PointSelector/sdkBridge.d.ts +0 -508
- package/dist/components/Rules/PointSelector/sdkBridge.js +0 -339
- package/dist/components/Rules/PointSelector/types.d.ts +0 -304
- package/dist/components/Rules/PointSelector/types.js +0 -0
- package/dist/components/Rules/PointSelector/usePointSelector.d.ts +0 -161
- package/dist/components/Rules/PointSelector/usePointSelector.js +0 -1088
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionEditor.d.ts +0 -28
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionEditor.js +0 -208
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionFields.d.ts +0 -23
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionFields.js +0 -950
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTargetPicker.d.ts +0 -21
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTargetPicker.js +0 -110
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTypeSelect.d.ts +0 -20
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTypeSelect.js +0 -31
- package/dist/components/Rules/RuleBuilder/ActionEditor/AttackTypeField.d.ts +0 -23
- package/dist/components/Rules/RuleBuilder/ActionEditor/AttackTypeField.js +0 -131
- package/dist/components/Rules/RuleBuilder/ActionEditor/classes.d.ts +0 -17
- package/dist/components/Rules/RuleBuilder/ActionEditor/classes.js +0 -14
- package/dist/components/Rules/RuleBuilder/ActionEditor/index.d.ts +0 -6
- package/dist/components/Rules/RuleBuilder/ActionEditor/index.js +0 -6
- package/dist/components/Rules/RuleBuilder/ConditionTree/AddConditionMenu.d.ts +0 -24
- package/dist/components/Rules/RuleBuilder/ConditionTree/AddConditionMenu.js +0 -245
- package/dist/components/Rules/RuleBuilder/ConditionTree/AttackCondition.d.ts +0 -15
- package/dist/components/Rules/RuleBuilder/ConditionTree/AttackCondition.js +0 -691
- package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionCard.d.ts +0 -19
- package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionCard.js +0 -72
- package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionTree.d.ts +0 -27
- package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionTree.js +0 -407
- package/dist/components/Rules/RuleBuilder/ConditionTree/FieldCondition.d.ts +0 -14
- package/dist/components/Rules/RuleBuilder/ConditionTree/FieldCondition.js +0 -269
- package/dist/components/Rules/RuleBuilder/ConditionTree/GroupCondition.d.ts +0 -25
- package/dist/components/Rules/RuleBuilder/ConditionTree/GroupCondition.js +0 -99
- package/dist/components/Rules/RuleBuilder/ConditionTree/SampleCondition.d.ts +0 -14
- package/dist/components/Rules/RuleBuilder/ConditionTree/SampleCondition.js +0 -118
- package/dist/components/Rules/RuleBuilder/ConditionTree/SignalCondition.d.ts +0 -14
- package/dist/components/Rules/RuleBuilder/ConditionTree/SignalCondition.js +0 -446
- package/dist/components/Rules/RuleBuilder/ConditionTree/TagCondition.d.ts +0 -14
- package/dist/components/Rules/RuleBuilder/ConditionTree/TagCondition.js +0 -266
- package/dist/components/Rules/RuleBuilder/ConditionTree/classes.d.ts +0 -35
- package/dist/components/Rules/RuleBuilder/ConditionTree/classes.js +0 -57
- package/dist/components/Rules/RuleBuilder/ConditionTree/index.d.ts +0 -15
- package/dist/components/Rules/RuleBuilder/ConditionTree/index.js +0 -10
- package/dist/components/Rules/RuleBuilder/RuleBuilder.d.ts +0 -67
- package/dist/components/Rules/RuleBuilder/RuleBuilder.js +0 -366
- package/dist/components/Rules/RuleBuilder/Summary/ActionSummary.d.ts +0 -32
- package/dist/components/Rules/RuleBuilder/Summary/ActionSummary.js +0 -420
- package/dist/components/Rules/RuleBuilder/Summary/ConditionSummary.d.ts +0 -27
- package/dist/components/Rules/RuleBuilder/Summary/ConditionSummary.js +0 -446
- package/dist/components/Rules/RuleBuilder/Summary/index.d.ts +0 -7
- package/dist/components/Rules/RuleBuilder/Summary/index.js +0 -2
- package/dist/components/Rules/RuleBuilder/classes.d.ts +0 -19
- package/dist/components/Rules/RuleBuilder/classes.js +0 -18
- package/dist/components/Rules/RuleBuilder/index.d.ts +0 -55
- package/dist/components/Rules/RuleBuilder/index.js +0 -11
- package/dist/components/Rules/RuleBuilder/models/actionModel.d.ts +0 -31
- package/dist/components/Rules/RuleBuilder/models/actionModel.js +0 -276
- package/dist/components/Rules/RuleBuilder/models/conditionModel.d.ts +0 -95
- package/dist/components/Rules/RuleBuilder/models/conditionModel.js +0 -418
- package/dist/components/Rules/RuleBuilder/models/index.d.ts +0 -3
- package/dist/components/Rules/RuleBuilder/models/index.js +0 -3
- package/dist/components/Rules/RuleBuilder/models/validation.d.ts +0 -176
- package/dist/components/Rules/RuleBuilder/models/validation.js +0 -242
- package/dist/components/Rules/RuleBuilder/shared/ChoiceSelect.d.ts +0 -27
- package/dist/components/Rules/RuleBuilder/shared/ChoiceSelect.js +0 -92
- package/dist/components/Rules/RuleBuilder/shared/index.d.ts +0 -1
- package/dist/components/Rules/RuleBuilder/shared/index.js +0 -1
- package/dist/components/Rules/RuleBuilder/types.d.ts +0 -384
- package/dist/components/Rules/RuleBuilder/types.js +0 -0
- package/dist/components/Rules/RuleBuilder/utils/constants.d.ts +0 -65
- package/dist/components/Rules/RuleBuilder/utils/constants.js +0 -356
- package/dist/components/Rules/RuleBuilder/utils/extractBindings.d.ts +0 -48
- package/dist/components/Rules/RuleBuilder/utils/extractBindings.js +0 -42
- package/dist/components/Rules/RuleBuilder/utils/helpers.d.ts +0 -92
- package/dist/components/Rules/RuleBuilder/utils/helpers.js +0 -54
- package/dist/components/Rules/RuleBuilder/utils/index.d.ts +0 -2
- package/dist/components/Rules/RuleBuilder/utils/index.js +0 -2
|
@@ -87,7 +87,7 @@ import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, Di
|
|
|
87
87
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemText, DropdownMenuTrigger } from '@wallarm-org/design-system/DropdownMenu';
|
|
88
88
|
import { Ellipsis } from '@wallarm-org/design-system/icons';
|
|
89
89
|
import { Page, PageContent, PageDescription, PageHeader, PageHeaderGroup, PageTitle } from '@wallarm-org/design-system/Page';
|
|
90
|
-
import { type TableCellContext, type TableColumnDef, Table } from '@wallarm-org/design-system/Table';
|
|
90
|
+
import { type TableCellContext, type TableColumnDef, type TableRow, Table } from '@wallarm-org/design-system/Table';
|
|
91
91
|
import { useToast } from '@wallarm-org/design-system/Toast';
|
|
92
92
|
|
|
93
93
|
export const Default = () => {
|
|
@@ -108,7 +108,7 @@ export const Default = () => {
|
|
|
108
108
|
</Badge>
|
|
109
109
|
);
|
|
110
110
|
|
|
111
|
-
const
|
|
111
|
+
const renderMenuAction = (row: TableRow<User>) => {
|
|
112
112
|
const user = row.original;
|
|
113
113
|
const handleDeleteSelect = () => {
|
|
114
114
|
setSelected(user);
|
|
@@ -142,18 +142,10 @@ export const Default = () => {
|
|
|
142
142
|
};
|
|
143
143
|
|
|
144
144
|
const columns: TableColumnDef<User>[] = [
|
|
145
|
-
{ accessorKey: 'name', header: 'Name', size: 220 },
|
|
145
|
+
{ accessorKey: 'name', header: 'Name', size: 220, meta: { renderMenuAction } },
|
|
146
146
|
{ accessorKey: 'email', header: 'Email', size: 280 },
|
|
147
147
|
{ accessorKey: 'role', header: 'Role', size: 180 },
|
|
148
148
|
{ accessorKey: 'status', header: 'Status', size: 140, cell: renderStatus },
|
|
149
|
-
{
|
|
150
|
-
id: 'actions',
|
|
151
|
-
header: '',
|
|
152
|
-
size: 60,
|
|
153
|
-
minSize: 60,
|
|
154
|
-
enableHiding: false,
|
|
155
|
-
cell: renderActions,
|
|
156
|
-
},
|
|
157
149
|
];
|
|
158
150
|
|
|
159
151
|
const handleDeleteOpenChange = (next: boolean) => {
|
|
@@ -45,7 +45,7 @@ A detail drawer is a `Drawer` with no footer. It shows one entity as `Attribute`
|
|
|
45
45
|
**Spacing**
|
|
46
46
|
|
|
47
47
|
- `DrawerBody` owns the 24px gutter. **Never** pad inside it or pass `className` to `DrawerHeader`/`DrawerBody`.
|
|
48
|
-
- Attribute rows: `VStack gap={6} className='pb-8'`. Sections: `Separator spacing={4}`.
|
|
48
|
+
- Attribute rows: `VStack gap={6} className='pb-8'`. Sections: `Separator spacing={4}`. **Never** a `Separator` above `Tabs`: `TabsList` draws its own line.
|
|
49
49
|
- Section header: `HStack justify='between' align='center' className='py-8'`, `Heading as='h3' size='md' weight='medium'`, optional `Button size='small'`.
|
|
50
50
|
- 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.
|
|
51
51
|
|
|
@@ -98,7 +98,6 @@ import { FormatDateTime } from '@wallarm-org/design-system/FormatDateTime';
|
|
|
98
98
|
import { ChevronDown, Plus } from '@wallarm-org/design-system/icons';
|
|
99
99
|
import { NumericBadge } from '@wallarm-org/design-system/NumericBadge';
|
|
100
100
|
import { Page, PageContent, PageHeader, PageHeaderGroup, PageTitle } from '@wallarm-org/design-system/Page';
|
|
101
|
-
import { Separator } from '@wallarm-org/design-system/Separator';
|
|
102
101
|
import { VStack } from '@wallarm-org/design-system/Stack';
|
|
103
102
|
import { type TableCellContext, type TableColumnDef, Table } from '@wallarm-org/design-system/Table';
|
|
104
103
|
import { Tabs, TabsContent, TabsLineActions, TabsList, TabsTrigger } from '@wallarm-org/design-system/Tabs';
|
|
@@ -244,8 +243,6 @@ export const Default = () => {
|
|
|
244
243
|
</Attribute>
|
|
245
244
|
</VStack>
|
|
246
245
|
|
|
247
|
-
<Separator spacing={4} />
|
|
248
|
-
|
|
249
246
|
<Tabs value={tab} onChange={setTab} data-testid='provider-tabs'>
|
|
250
247
|
<div className='-mx-24'>
|
|
251
248
|
<TabsList>
|
|
@@ -320,13 +317,13 @@ persist. The close X comes built in, so there is no footer and no close button o
|
|
|
320
317
|
import { useState } from 'react';
|
|
321
318
|
import { Attribute, AttributeLabel, AttributeValue } from '@wallarm-org/design-system/Attribute';
|
|
322
319
|
import { Button } from '@wallarm-org/design-system/Button';
|
|
323
|
-
import { Drawer, DrawerBody, DrawerContent, DrawerHeader, DrawerResizeHandle, DrawerTitle } from '@wallarm-org/design-system/Drawer';
|
|
320
|
+
import { Drawer, DrawerBody, DrawerContent, DrawerHeader, DrawerResizeHandle, DrawerTitle, DrawerTrigger } from '@wallarm-org/design-system/Drawer';
|
|
324
321
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemText, DropdownMenuSeparator, DropdownMenuTrigger } from '@wallarm-org/design-system/DropdownMenu';
|
|
325
322
|
import { ChevronDown } from '@wallarm-org/design-system/icons';
|
|
326
323
|
import { VStack } from '@wallarm-org/design-system/Stack';
|
|
327
324
|
|
|
328
325
|
export const Header = () => {
|
|
329
|
-
const [open, setOpen] = useState(
|
|
326
|
+
const [open, setOpen] = useState(false);
|
|
330
327
|
|
|
331
328
|
const handleEdit = () => onEditProvider(OKTA);
|
|
332
329
|
const handleDisable = () => onDisableProvider(OKTA);
|
|
@@ -335,6 +332,11 @@ export const Header = () => {
|
|
|
335
332
|
|
|
336
333
|
return (
|
|
337
334
|
<Drawer open={open} onOpenChange={setOpen} width={640} data-testid='provider-drawer'>
|
|
335
|
+
<DrawerTrigger asChild>
|
|
336
|
+
<Button variant='outline' color='neutral'>
|
|
337
|
+
View {OKTA.name}
|
|
338
|
+
</Button>
|
|
339
|
+
</DrawerTrigger>
|
|
338
340
|
<DrawerContent>
|
|
339
341
|
<DrawerResizeHandle onResizeEnd={onSaveDrawerWidth} />
|
|
340
342
|
<DrawerHeader>
|
|
@@ -384,17 +386,23 @@ stays and shows the empty marker; the codes copy on click.
|
|
|
384
386
|
```tsx story=Attributes
|
|
385
387
|
import { useState } from 'react';
|
|
386
388
|
import { Attribute, AttributeLabel, AttributeValue } from '@wallarm-org/design-system/Attribute';
|
|
389
|
+
import { Button } from '@wallarm-org/design-system/Button';
|
|
387
390
|
import { InlineCodeSnippet } from '@wallarm-org/design-system/CodeSnippet';
|
|
388
|
-
import { Drawer, DrawerBody, DrawerContent, DrawerHeader, DrawerTitle } from '@wallarm-org/design-system/Drawer';
|
|
391
|
+
import { Drawer, DrawerBody, DrawerContent, DrawerHeader, DrawerTitle, DrawerTrigger } from '@wallarm-org/design-system/Drawer';
|
|
389
392
|
import { FormatDateTime } from '@wallarm-org/design-system/FormatDateTime';
|
|
390
393
|
import { VStack } from '@wallarm-org/design-system/Stack';
|
|
391
394
|
import { Tag } from '@wallarm-org/design-system/Tag';
|
|
392
395
|
|
|
393
396
|
export const Attributes = () => {
|
|
394
|
-
const [open, setOpen] = useState(
|
|
397
|
+
const [open, setOpen] = useState(false);
|
|
395
398
|
|
|
396
399
|
return (
|
|
397
400
|
<Drawer open={open} onOpenChange={setOpen} width={640} data-testid='provider-drawer'>
|
|
401
|
+
<DrawerTrigger asChild>
|
|
402
|
+
<Button variant='outline' color='neutral'>
|
|
403
|
+
View {ENTRA.name}
|
|
404
|
+
</Button>
|
|
405
|
+
</DrawerTrigger>
|
|
398
406
|
<DrawerContent>
|
|
399
407
|
<DrawerHeader>
|
|
400
408
|
<DrawerTitle>{ENTRA.name}</DrawerTitle>
|
|
@@ -439,7 +447,7 @@ import { useState } from 'react';
|
|
|
439
447
|
import { Attribute, AttributeLabel, AttributeValue } from '@wallarm-org/design-system/Attribute';
|
|
440
448
|
import { Button } from '@wallarm-org/design-system/Button';
|
|
441
449
|
import { InlineCodeSnippet } from '@wallarm-org/design-system/CodeSnippet';
|
|
442
|
-
import { Drawer, DrawerBody, DrawerContent, DrawerHeader, DrawerTitle } from '@wallarm-org/design-system/Drawer';
|
|
450
|
+
import { Drawer, DrawerBody, DrawerContent, DrawerHeader, DrawerTitle, DrawerTrigger } from '@wallarm-org/design-system/Drawer';
|
|
443
451
|
import { FormatDateTime } from '@wallarm-org/design-system/FormatDateTime';
|
|
444
452
|
import { Heading } from '@wallarm-org/design-system/Heading';
|
|
445
453
|
import { Separator } from '@wallarm-org/design-system/Separator';
|
|
@@ -447,12 +455,17 @@ import { HStack, VStack } from '@wallarm-org/design-system/Stack';
|
|
|
447
455
|
import { Tag } from '@wallarm-org/design-system/Tag';
|
|
448
456
|
|
|
449
457
|
export const Section = () => {
|
|
450
|
-
const [open, setOpen] = useState(
|
|
458
|
+
const [open, setOpen] = useState(false);
|
|
451
459
|
|
|
452
460
|
const handleEditDefaults = () => onEditProvider(OKTA);
|
|
453
461
|
|
|
454
462
|
return (
|
|
455
463
|
<Drawer open={open} onOpenChange={setOpen} width={640} data-testid='provider-drawer'>
|
|
464
|
+
<DrawerTrigger asChild>
|
|
465
|
+
<Button variant='outline' color='neutral'>
|
|
466
|
+
View {OKTA.name}
|
|
467
|
+
</Button>
|
|
468
|
+
</DrawerTrigger>
|
|
456
469
|
<DrawerContent>
|
|
457
470
|
<DrawerHeader>
|
|
458
471
|
<DrawerTitle>{OKTA.name}</DrawerTitle>
|
|
@@ -514,7 +527,7 @@ with no action, since "Create rule" already sits on the tab line.
|
|
|
514
527
|
import { useState } from 'react';
|
|
515
528
|
import { Button } from '@wallarm-org/design-system/Button';
|
|
516
529
|
import { InlineCodeSnippet } from '@wallarm-org/design-system/CodeSnippet';
|
|
517
|
-
import { Drawer, DrawerBody, DrawerContent, DrawerHeader, DrawerTitle } from '@wallarm-org/design-system/Drawer';
|
|
530
|
+
import { Drawer, DrawerBody, DrawerContent, DrawerHeader, DrawerTitle, DrawerTrigger } from '@wallarm-org/design-system/Drawer';
|
|
518
531
|
import { EmptyState, EmptyStateMessage, EmptyStateTitle } from '@wallarm-org/design-system/EmptyState';
|
|
519
532
|
import { Plus } from '@wallarm-org/design-system/icons';
|
|
520
533
|
import { NumericBadge } from '@wallarm-org/design-system/NumericBadge';
|
|
@@ -523,7 +536,7 @@ import { Tabs, TabsContent, TabsLineActions, TabsList, TabsTrigger } from '@wall
|
|
|
523
536
|
import { Tag } from '@wallarm-org/design-system/Tag';
|
|
524
537
|
|
|
525
538
|
export const NestedTable = () => {
|
|
526
|
-
const [open, setOpen] = useState(
|
|
539
|
+
const [open, setOpen] = useState(false);
|
|
527
540
|
const [tab, setTab] = useState('rules');
|
|
528
541
|
|
|
529
542
|
const renderClaim = ({ row }: TableCellContext<RoleRule, unknown>) => (
|
|
@@ -542,6 +555,11 @@ export const NestedTable = () => {
|
|
|
542
555
|
|
|
543
556
|
return (
|
|
544
557
|
<Drawer open={open} onOpenChange={setOpen} width={640} data-testid='provider-drawer'>
|
|
558
|
+
<DrawerTrigger asChild>
|
|
559
|
+
<Button variant='outline' color='neutral'>
|
|
560
|
+
View {GOOGLE.name}
|
|
561
|
+
</Button>
|
|
562
|
+
</DrawerTrigger>
|
|
545
563
|
<DrawerContent>
|
|
546
564
|
<DrawerHeader>
|
|
547
565
|
<DrawerTitle>{GOOGLE.name}</DrawerTitle>
|
|
@@ -862,7 +880,7 @@ export const OldVersion = () => {
|
|
|
862
880
|
|
|
863
881
|
## Related
|
|
864
882
|
|
|
865
|
-
- [Entity table](./entity-table.md), [Resource list page](./resource-list-page.md)
|
|
883
|
+
- [Complex drawer](./complex-drawer.md) for events with charts, [Entity table](./entity-table.md), [Resource list page](./resource-list-page.md)
|
|
866
884
|
- [Create and edit forms](./create-edit-forms.md), [Confirmation dialogs](./confirmation-dialogs.md)
|
|
867
885
|
- [Action-result toasts](./feedback-toasts.md), [Empty states](./empty-states.md)
|
|
868
886
|
- [Spacing](../foundations/spacing.md), [Layering](../foundations/layering.md)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Empty states
|
|
3
|
-
description: Use when a table, nested table, tab, section, column or menu has no content and you must pick the EmptyState scale, copy and action.
|
|
3
|
+
description: Use when a table, nested table, tab, section, column or menu has no content or failed to load and you must pick the EmptyState scale, copy and action.
|
|
4
4
|
components: [EmptyState, EmptyStateIllustration, EmptyStateMessage, EmptyStateTitle, EmptyStateDescription, EmptyStateActions, EmptyStateLink, TableEmptyState, Table, SelectEmptyState, FilterDropdownEmpty, FilterCascadeEmpty, Tabs, TabsContent, Button]
|
|
5
|
-
keywords: [empty state, empty, no data, no results, nothing found, zero state, blank slate, no items yet, nothing yet, first use, onboarding, empty table, empty tab, empty column, empty list, dependency, select first, reset filters, caught up, placeholder]
|
|
5
|
+
keywords: [empty state, failed to load, load error, try again, empty, no data, no results, nothing found, zero state, blank slate, no items yet, nothing yet, first use, onboarding, empty table, empty tab, empty column, empty list, dependency, select first, reset filters, caught up, placeholder]
|
|
6
6
|
order: 90
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -25,7 +25,7 @@ An empty state is `EmptyState` placed where the content would be. The header aro
|
|
|
25
25
|
| A `FilterCascade` search with no matches | Nothing: `FilterCascadeEmpty` shows itself | `EmptyState` |
|
|
26
26
|
| One missing value in a cell or attribute | The em dash `'—'`. See [Entity table](./entity-table.md) | `EmptyState` |
|
|
27
27
|
| Data is loading | `Table isLoading` (skeleton rows) | Any empty state |
|
|
28
|
-
| A
|
|
28
|
+
| A list or table failed to load | `EmptyState` in place of the rows, with "Try again" | An `Alert` above an empty table |
|
|
29
29
|
|
|
30
30
|
`type` sets the scale, not the cause. If the empty area fills a page, table or panel, use `collection-empty` (the default). If it sits in a small container, use `no-results`.
|
|
31
31
|
|
|
@@ -55,6 +55,7 @@ An empty state is `EmptyState` placed where the content would be. The header aro
|
|
|
55
55
|
- Show one create action per screen. If `PageActions` or a section header has the create button, the empty state has no button.
|
|
56
56
|
- If no header has a create button, put `Button size='medium'` in `EmptyStateActions`.
|
|
57
57
|
- If search or filters matched nothing, offer "Reset filters" as `Button variant='outline' color='neutral'`. **Never** a create action.
|
|
58
|
+
- If a list failed to load, say what failed ("Couldn't load triggers") and offer "Try again" as `Button variant='outline' color='neutral'`. If access is denied, name the permission and add no button.
|
|
58
59
|
- If a dependency is missing, name the choice that unlocks the area. **Never** say "No {items} yet".
|
|
59
60
|
- If one area can be dependency-empty or nothing-yet, switch the copy.
|
|
60
61
|
- If each tab can be empty, write copy per tab. **Never** reuse one sentence across tabs.
|
|
@@ -438,14 +439,14 @@ export const SmallContainers = () => (
|
|
|
438
439
|
| Earlier choice missing | "Select a service first", no action | `EmptyState` |
|
|
439
440
|
| Tab empty | Per-tab copy, no action: "You're all caught up" (`CheckCheck`), "Nothing read yet" (`History`) | `EmptyState` in `TabsContent` |
|
|
440
441
|
| Column, card or chart empty | Title only, or description only in a chart | `EmptyState type='no-results'` |
|
|
441
|
-
|
|
|
442
|
+
| List failed to load | "Couldn't load {items}" + "Try again"; while retrying, skeleton rows | `EmptyState` › `EmptyStateActions` |
|
|
442
443
|
|
|
443
444
|
## What your app owns
|
|
444
445
|
|
|
445
446
|
- **The cause.** The DS cannot tell nothing-yet, filtered and dependency-missing apart. Pass your own flag.
|
|
446
447
|
- **Copy.** `EmptyState` has no default strings.
|
|
447
448
|
- **Dependency gating.** Show the dependency state until the earlier field has a value. See [Create and edit forms](./create-edit-forms.md).
|
|
448
|
-
- **Errors.** There is no error
|
|
449
|
+
- **Errors.** There is no error `type`: pass the failure and the retry yourself. A failed page, not a list, is your own message in `PageContent`.
|
|
449
450
|
- **Notification center.** No popover block exists. Compose `Popover`, `Tabs` and `EmptyState`.
|
|
450
451
|
- **Kanban.** No kanban component exists. Centre `EmptyState type='no-results'` in your column.
|
|
451
452
|
- **Figma drift.** Figma flags the empty state component for an update. Follow the code scale until it changes.
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
title: Entity table
|
|
3
3
|
description: Use when you render a list of users, roles, providers, channels or policies as a Table, with status badges, tags, a row menu and bulk actions.
|
|
4
4
|
components: [Table, TableActionBar, TableActionBarSelection, TableEmptyState, Badge, Tag, OverflowList, Avatar, AvatarContent, AvatarName, AvatarDescription, Code, FormatDateTime, DropdownMenu, DropdownMenuItem, Button, Tooltip, Switch, EmptyState]
|
|
5
|
-
keywords: [table, data table, grid, list, rows, columns, entity list, users table, cell, status badge, tags, +N, overflow, row menu, row actions, kebab, ellipsis, three dots, bulk actions, bulk bar, selection, checkbox, sort, empty value, em dash, column description, reorder]
|
|
5
|
+
keywords: [table, master cell, renderMenuAction, data table, grid, list, rows, columns, entity list, users table, cell, status badge, tags, +N, overflow, row menu, row actions, kebab, ellipsis, three dots, bulk actions, bulk bar, selection, checkbox, sort, empty value, em dash, column description, reorder]
|
|
6
6
|
order: 20
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Entity table
|
|
10
10
|
|
|
11
|
-
One `Table` with a fixed cell vocabulary, a
|
|
11
|
+
One `Table` with a fixed cell vocabulary, a row menu in the master cell and a bulk bar.
|
|
12
12
|
|
|
13
13
|
## When to use
|
|
14
14
|
|
|
@@ -16,7 +16,7 @@ One `Table` with a fixed cell vocabulary, a trailing row menu and a bulk bar.
|
|
|
16
16
|
| --- | --- | --- |
|
|
17
17
|
| A list of entities on a page | `Table` inside `PageContent` | A `div` grid, a `Card` per row |
|
|
18
18
|
| A list in a drawer or dialog | The same `Table` inside `DrawerBody` or `DialogBody` (from `@wallarm-org/design-system/Dialog`) | A custom bordered list |
|
|
19
|
-
| Actions on one row |
|
|
19
|
+
| Actions on one row | `meta.renderMenuAction` on the master (first) column | A trailing actions column, buttons repeated in every row |
|
|
20
20
|
| Actions on many rows | `onRowSelectionChange` plus `TableActionBar` | Your own floating bar |
|
|
21
21
|
| Details of one entity | `Attribute` in a drawer | A two-column `Table` |
|
|
22
22
|
| Kanban, preference matrix | Product code | This pattern |
|
|
@@ -44,14 +44,14 @@ Use only these cells.
|
|
|
44
44
|
- The first column is pinned and never hideable: put the entity name there.
|
|
45
45
|
- `Table` owns its frame, borders, padding and header. **Never** wrap it in a bordered `div` or restyle cells via `meta.cellClassName`.
|
|
46
46
|
- `PageContent`, `DrawerBody` and `DialogBody` own the gutter. **Never** add `p-24` or any padding around `Table`.
|
|
47
|
-
- Set widths with `size`: name `320`, email `240`, status `140`, timestamp `200
|
|
47
|
+
- Set widths with `size`: name `320`, email `240`, status `140`, timestamp `200` (the default minimum is 96px).
|
|
48
48
|
- If columns must keep their `size`, pass `stretch={false}`.
|
|
49
49
|
- Two-line cell: add a `Text size='xs' color='secondary'` line; there is no `rowHeight`.
|
|
50
50
|
|
|
51
51
|
**Row menu**
|
|
52
52
|
|
|
53
|
-
-
|
|
54
|
-
- **Never**
|
|
53
|
+
- Every contextual row action goes through the master cell: `meta: { renderMenuAction }` on the first column. Its `…` shows on row hover, while the menu is open and on the previewed row.
|
|
54
|
+
- **Never** add a trailing actions column or buttons in cells. There is no `actions` column type or `alwaysShowMenu`.
|
|
55
55
|
- Trigger: `Button variant='ghost' color='neutral' size='small'`, `Ellipsis` icon, `aria-label` naming the row.
|
|
56
56
|
- Order items: open, edit, reorder, state changes, `DropdownMenuSeparator`, destructive.
|
|
57
57
|
- Use `variant='destructive'` and name the entity: "Delete user", not "Delete". Confirm before deleting.
|
|
@@ -77,7 +77,7 @@ Use only these cells.
|
|
|
77
77
|
|
|
78
78
|
## Examples
|
|
79
79
|
|
|
80
|
-
The whole table: the cell vocabulary,
|
|
80
|
+
The whole table: the cell vocabulary, the row menu in the master cell, sorting and a bulk bar for selected rows.
|
|
81
81
|
|
|
82
82
|
Adds an ID in `Code` and an exact time to the `Cells` vocabulary. Sort by any header; select
|
|
83
83
|
rows to bring up the bulk bar.
|
|
@@ -93,7 +93,7 @@ import { FormatDateTime } from '@wallarm-org/design-system/FormatDateTime';
|
|
|
93
93
|
import { Ellipsis, Trash2 } from '@wallarm-org/design-system/icons';
|
|
94
94
|
import { OverflowList } from '@wallarm-org/design-system/OverflowList';
|
|
95
95
|
import { Page, PageContent } from '@wallarm-org/design-system/Page';
|
|
96
|
-
import { type TableCellContext, type TableColumnDef, type TableRowSelectionState, type TableSortingState, Table, TableActionBar } from '@wallarm-org/design-system/Table';
|
|
96
|
+
import { type TableCellContext, type TableColumnDef, type TableRow, type TableRowSelectionState, type TableSortingState, Table, TableActionBar } from '@wallarm-org/design-system/Table';
|
|
97
97
|
import { Tag } from '@wallarm-org/design-system/Tag';
|
|
98
98
|
|
|
99
99
|
export const Default = () => {
|
|
@@ -142,7 +142,7 @@ export const Default = () => {
|
|
|
142
142
|
|
|
143
143
|
const renderRequests = ({ row }: TableCellContext<User, unknown>) => row.original.requests ?? '—';
|
|
144
144
|
|
|
145
|
-
const
|
|
145
|
+
const renderMenuAction = (row: TableRow<User>) => {
|
|
146
146
|
const user = row.original;
|
|
147
147
|
const handleEdit = () => onEditUser(user);
|
|
148
148
|
const handleResend = () => onResendInvite(user);
|
|
@@ -183,7 +183,13 @@ export const Default = () => {
|
|
|
183
183
|
};
|
|
184
184
|
|
|
185
185
|
const columns: TableColumnDef<User>[] = [
|
|
186
|
-
{
|
|
186
|
+
{
|
|
187
|
+
accessorKey: 'name',
|
|
188
|
+
header: 'Name',
|
|
189
|
+
size: 320,
|
|
190
|
+
cell: renderUser,
|
|
191
|
+
meta: { renderMenuAction },
|
|
192
|
+
},
|
|
187
193
|
{ accessorKey: 'id', header: 'User ID', size: 160, cell: renderId },
|
|
188
194
|
{
|
|
189
195
|
accessorKey: 'groups',
|
|
@@ -201,14 +207,6 @@ export const Default = () => {
|
|
|
201
207
|
meta: { sortType: 'number', description: { type: 'tooltip', content: 'Last 24 hours' } },
|
|
202
208
|
cell: renderRequests,
|
|
203
209
|
},
|
|
204
|
-
{
|
|
205
|
-
id: 'actions',
|
|
206
|
-
header: '',
|
|
207
|
-
size: 60,
|
|
208
|
-
minSize: 60,
|
|
209
|
-
enableHiding: false,
|
|
210
|
-
cell: renderActions,
|
|
211
|
-
},
|
|
212
210
|
];
|
|
213
211
|
|
|
214
212
|
const handleAssignGroup = () => onAssignGroup(Object.keys(selection));
|
|
@@ -328,8 +326,8 @@ export const Cells = () => {
|
|
|
328
326
|
|
|
329
327
|
The row menu: the trigger names the row, and the destructive item comes last and names the entity.
|
|
330
328
|
|
|
331
|
-
|
|
332
|
-
|
|
329
|
+
Hover a row: the `…` appears in the master cell, `meta.renderMenuAction` on the first column. The
|
|
330
|
+
trigger names the row and the destructive item comes last.
|
|
333
331
|
|
|
334
332
|
```tsx story=RowMenu
|
|
335
333
|
import { Avatar, AvatarContent, AvatarDescription, AvatarFallback, AvatarName } from '@wallarm-org/design-system/Avatar';
|
|
@@ -337,7 +335,7 @@ import { Button } from '@wallarm-org/design-system/Button';
|
|
|
337
335
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemText, DropdownMenuSeparator, DropdownMenuTrigger } from '@wallarm-org/design-system/DropdownMenu';
|
|
338
336
|
import { Ellipsis } from '@wallarm-org/design-system/icons';
|
|
339
337
|
import { Page, PageContent } from '@wallarm-org/design-system/Page';
|
|
340
|
-
import { type TableCellContext, type TableColumnDef, Table } from '@wallarm-org/design-system/Table';
|
|
338
|
+
import { type TableCellContext, type TableColumnDef, type TableRow, Table } from '@wallarm-org/design-system/Table';
|
|
341
339
|
|
|
342
340
|
export const RowMenu = () => {
|
|
343
341
|
const renderUser = ({ row }: TableCellContext<User, unknown>) => (
|
|
@@ -350,7 +348,7 @@ export const RowMenu = () => {
|
|
|
350
348
|
</Avatar>
|
|
351
349
|
);
|
|
352
350
|
|
|
353
|
-
const
|
|
351
|
+
const renderMenuAction = (row: TableRow<User>) => {
|
|
354
352
|
const user = row.original;
|
|
355
353
|
const handleEdit = () => onEditUser(user);
|
|
356
354
|
const handleDeactivate = () => onDeactivateUser(user);
|
|
@@ -385,14 +383,12 @@ export const RowMenu = () => {
|
|
|
385
383
|
};
|
|
386
384
|
|
|
387
385
|
const columns: TableColumnDef<User>[] = [
|
|
388
|
-
{ accessorKey: 'name', header: 'Name', size: 320, cell: renderUser },
|
|
389
386
|
{
|
|
390
|
-
|
|
391
|
-
header: '',
|
|
392
|
-
size:
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
cell: renderActions,
|
|
387
|
+
accessorKey: 'name',
|
|
388
|
+
header: 'Name',
|
|
389
|
+
size: 320,
|
|
390
|
+
cell: renderUser,
|
|
391
|
+
meta: { renderMenuAction },
|
|
396
392
|
},
|
|
397
393
|
];
|
|
398
394
|
|
|
@@ -91,7 +91,7 @@ import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, Di
|
|
|
91
91
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemText, DropdownMenuSeparator, DropdownMenuTrigger } from '@wallarm-org/design-system/DropdownMenu';
|
|
92
92
|
import { Ellipsis } from '@wallarm-org/design-system/icons';
|
|
93
93
|
import { Page, PageActions, PageContent, PageDescription, PageHeader, PageHeaderGroup, PageTitle } from '@wallarm-org/design-system/Page';
|
|
94
|
-
import { type
|
|
94
|
+
import { type TableColumnDef, type TableRow, Table } from '@wallarm-org/design-system/Table';
|
|
95
95
|
import { ToastActions, useToast } from '@wallarm-org/design-system/Toast';
|
|
96
96
|
|
|
97
97
|
export const Default = () => {
|
|
@@ -124,7 +124,7 @@ export const Default = () => {
|
|
|
124
124
|
toast.create({ id: `delete-${deleteTarget.id}`, title: 'Channel deleted', type: 'default' });
|
|
125
125
|
};
|
|
126
126
|
|
|
127
|
-
const
|
|
127
|
+
const renderMenuAction = (row: TableRow<Channel>) => {
|
|
128
128
|
const channel = row.original;
|
|
129
129
|
|
|
130
130
|
const handleTest = async () => {
|
|
@@ -190,17 +190,9 @@ export const Default = () => {
|
|
|
190
190
|
};
|
|
191
191
|
|
|
192
192
|
const columns: TableColumnDef<Channel>[] = [
|
|
193
|
-
{ accessorKey: 'name', header: 'Name', size: 240 },
|
|
193
|
+
{ accessorKey: 'name', header: 'Name', size: 240, meta: { renderMenuAction } },
|
|
194
194
|
{ accessorKey: 'provider', header: 'Provider', size: 160 },
|
|
195
195
|
{ accessorKey: 'events', header: 'Events', size: 320 },
|
|
196
|
-
{
|
|
197
|
-
id: 'actions',
|
|
198
|
-
header: '',
|
|
199
|
-
size: 60,
|
|
200
|
-
minSize: 60,
|
|
201
|
-
enableHiding: false,
|
|
202
|
-
cell: renderActions,
|
|
203
|
-
},
|
|
204
196
|
];
|
|
205
197
|
|
|
206
198
|
return (
|
|
@@ -55,7 +55,7 @@ Spacing counts in pixels: `px-24` is 24px. See [Spacing](../foundations/spacing.
|
|
|
55
55
|
**Table**
|
|
56
56
|
|
|
57
57
|
- Pass `getRowId` so selection and row state survive refetches.
|
|
58
|
-
-
|
|
58
|
+
- Row actions live in the master cell: `meta.renderMenuAction` on the first column. **Never** add a trailing actions column; see [Entity table](./entity-table.md).
|
|
59
59
|
|
|
60
60
|
**What does not exist**
|
|
61
61
|
|
|
@@ -66,8 +66,8 @@ There is no breadcrumbs prop or slot on `Page` or `PageHeader`, no `PageBreadcru
|
|
|
66
66
|
The page frame: a fixed-height `Page` with the table directly in `PageContent`.
|
|
67
67
|
|
|
68
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
|
|
70
|
-
|
|
69
|
+
and status tabs with counts in the toolbar; a user table with a status badge and a
|
|
70
|
+
row menu in the master cell. Search and tabs filter the rows.
|
|
71
71
|
|
|
72
72
|
```tsx story=Default
|
|
73
73
|
import { useState } from 'react';
|
|
@@ -82,7 +82,7 @@ import { NumericBadge } from '@wallarm-org/design-system/NumericBadge';
|
|
|
82
82
|
import { Page, PageActions, PageContent, PageDescription, PageHeader, PageHeaderGroup, PageTitle, PageToolbar } from '@wallarm-org/design-system/Page';
|
|
83
83
|
import { SearchInput } from '@wallarm-org/design-system/SearchInput';
|
|
84
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';
|
|
85
|
+
import { type TableCellContext, type TableColumnDef, type TableRow, Table, TableEmptyState } from '@wallarm-org/design-system/Table';
|
|
86
86
|
|
|
87
87
|
export const Default = () => {
|
|
88
88
|
const [query, setQuery] = useState('');
|
|
@@ -114,7 +114,7 @@ export const Default = () => {
|
|
|
114
114
|
<FormatDateTime value={row.original.lastSignIn} format='date' />
|
|
115
115
|
);
|
|
116
116
|
|
|
117
|
-
const
|
|
117
|
+
const renderMenuAction = (row: TableRow<User>) => {
|
|
118
118
|
const user = row.original;
|
|
119
119
|
const handleEdit = () => onEditUser(user);
|
|
120
120
|
const handleDeactivate = () => onDeactivateUser(user);
|
|
@@ -149,18 +149,16 @@ export const Default = () => {
|
|
|
149
149
|
};
|
|
150
150
|
|
|
151
151
|
const columns: TableColumnDef<User>[] = [
|
|
152
|
-
{
|
|
152
|
+
{
|
|
153
|
+
accessorKey: 'name',
|
|
154
|
+
header: 'Name',
|
|
155
|
+
size: 320,
|
|
156
|
+
cell: renderUser,
|
|
157
|
+
meta: { renderMenuAction },
|
|
158
|
+
},
|
|
153
159
|
{ accessorKey: 'role', header: 'Role', size: 200 },
|
|
154
160
|
{ accessorKey: 'status', header: 'Status', size: 140, cell: renderStatus },
|
|
155
161
|
{ 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
162
|
];
|
|
165
163
|
|
|
166
164
|
const search = query.trim().toLowerCase();
|
|
@@ -532,7 +530,7 @@ export const Empty = () => {
|
|
|
532
530
|
| 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
531
|
| 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
532
|
| Search active | The typed value stays in the field | `SearchInput` |
|
|
535
|
-
| Request failed |
|
|
533
|
+
| Request failed | "Couldn't load {items}" + "Try again" in place of the rows; header and toolbar stay | `TableEmptyState` › `EmptyState` |
|
|
536
534
|
|
|
537
535
|
## What your app owns
|
|
538
536
|
|
|
@@ -544,7 +542,7 @@ export const Empty = () => {
|
|
|
544
542
|
| Create flow | Short form: `Dialog` from `@wallarm-org/design-system/Dialog`. Long form: `Drawer`. See [Create and edit forms](./create-edit-forms.md) |
|
|
545
543
|
| 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
544
|
| URL state | Sync `query` and `status` to the URL yourself; there is no router integration |
|
|
547
|
-
| Error state |
|
|
545
|
+
| Error state | Pass the failure and the retry yourself; see [Empty states](./empty-states.md) |
|
|
548
546
|
|
|
549
547
|
## Related
|
|
550
548
|
|
package/dist/guidelines/rules.md
CHANGED
|
@@ -4,22 +4,23 @@ Before composing a screen, call get_guideline for the pattern (app shell, list p
|
|
|
4
4
|
|
|
5
5
|
- p-5, gap-3, p-10 → stay on the scale: 1, 2, 4, 6, 8, 12, 16, 20, 24, 28, 32, 40, 48, 64…
|
|
6
6
|
- space-y-4, margins per child → <VStack gap={16}>, <HStack gap={8}>
|
|
7
|
-
- Padded page wrapper →
|
|
7
|
+
- Padded page wrapper → PageHeader / PageToolbar / PageContent own the 24px gutter
|
|
8
8
|
- p-* on Card, DrawerBody, DialogBody, PageToolbar, Table → none; they own their padding
|
|
9
9
|
- className on Text, Heading, Field, Drawer/Dialog Header/Body/Footer → wrap in your own element
|
|
10
10
|
- Raw <h1>, <p>, <label> → <Heading as="h2" size="lg">, <Text size="sm">, Field
|
|
11
|
-
- <Text> default (16px) for body → size="sm"
|
|
12
|
-
- leading-none (0px), leading-5 (5px) → leading-sm
|
|
11
|
+
- <Text> default (16px) for body → size="sm"
|
|
12
|
+
- leading-none (0px), leading-5 (5px) → leading-sm, leading-20
|
|
13
13
|
- weight="semibold" → weight is light|regular|medium|bold (medium = 450)
|
|
14
|
-
- bg-primary, text-muted, bg-card, bg-white
|
|
14
|
+
- bg-primary, text-muted, bg-card, bg-white → bg-bg-primary, text-text-secondary, bg-bg-surface-1
|
|
15
15
|
- text-error, bg-red-500 → danger tokens; categorical color → Badge color
|
|
16
16
|
- dark: variant, setting data-theme → semantic tokens, useTheme().setTheme()
|
|
17
17
|
- rounded-lg, rounded, rounded-[15px] → rounded-8 (controls), rounded-12 (panels)
|
|
18
18
|
- shadow-* on DS components, z-* on overlays → never; they own both
|
|
19
19
|
- focus:ring → focus-visible:ring-3 ring-focus-primary outline-none
|
|
20
|
-
- size,
|
|
20
|
+
- size, DIALOG/DRAWER_SIZES → width: Dialog 400 confirm, 560 default, 960 picker; Drawer 640 default, 700 Timeline form
|
|
21
21
|
- Dialog, useToast from the root → @wallarm-org/design-system/Dialog, /Toast
|
|
22
22
|
- Field invalid → error on the control + FieldError
|
|
23
|
+
- Table actions column → meta.renderMenuAction on the master column
|
|
23
24
|
- Hand-built side menu → RemoteShell config={NavConfig}
|
|
24
25
|
- ConfirmDialog, FilterBar, Combobox → compose Dialog parts, PageToolbar + FilterDropdown, Select + useSelectSearch
|
|
25
26
|
- data-slot in tests → data-testid
|