@wallarm-org/design-system 4.8.0-rc-feat-parser.1 → 4.8.0-rc-fix-claude-code.2
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 +4 -2
- package/dist/components/BulkBar/index.d.ts +5 -0
- package/dist/components/Drawer/classes.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/NotificationCenter/NotificationCenter.d.ts +20 -0
- package/dist/components/NotificationCenter/NotificationCenter.js +65 -0
- package/dist/components/NotificationCenter/NotificationCenterBody.d.ts +18 -0
- package/dist/components/NotificationCenter/NotificationCenterBody.js +202 -0
- package/dist/components/NotificationCenter/NotificationCenterContent.d.ts +5 -0
- package/dist/components/NotificationCenter/NotificationCenterContent.js +42 -0
- package/dist/components/NotificationCenter/NotificationCenterHeader.d.ts +20 -0
- package/dist/components/NotificationCenter/NotificationCenterHeader.js +202 -0
- package/dist/components/NotificationCenter/NotificationCenterItem.d.ts +26 -0
- package/dist/components/NotificationCenter/NotificationCenterItem.js +211 -0
- package/dist/components/NotificationCenter/NotificationCenterItemTime.d.ts +9 -0
- package/dist/components/NotificationCenter/NotificationCenterItemTime.js +148 -0
- package/dist/components/NotificationCenter/NotificationCenterItemTitle.d.ts +14 -0
- package/dist/components/NotificationCenter/NotificationCenterItemTitle.js +115 -0
- package/dist/components/NotificationCenter/NotificationCenterTabs.d.ts +10 -0
- package/dist/components/NotificationCenter/NotificationCenterTabs.js +77 -0
- package/dist/components/NotificationCenter/NotificationCenterTrigger.d.ts +13 -0
- package/dist/components/NotificationCenter/NotificationCenterTrigger.js +138 -0
- package/dist/components/NotificationCenter/index.d.ts +9 -0
- package/dist/components/NotificationCenter/index.js +9 -0
- package/dist/components/Overlay/Overlay.js +1 -1
- package/dist/components/SearchInput/SearchInput.d.ts +7 -5
- package/dist/components/SearchInput/SearchInput.js +119 -101
- package/dist/components/Select/SelectSearchInput.d.ts +1 -1
- package/dist/components/Table/types.d.ts +1 -1
- package/dist/components/Tabs/Tabs.d.ts +1 -0
- package/dist/components/Tabs/Tabs.js +30 -28
- package/dist/components/Tabs/TabsList/index.d.ts +1 -1
- package/dist/components/Tabs/index.d.ts +2 -2
- package/dist/components/Tour/TourPositioner.d.ts +3 -0
- package/dist/components/Tour/TourPositioner.js +4 -4
- package/dist/guidelines/foundations/color.md +157 -0
- package/dist/guidelines/foundations/focus.md +122 -0
- package/dist/guidelines/foundations/layering.md +131 -0
- package/dist/guidelines/foundations/radius-elevation.md +111 -0
- package/dist/guidelines/foundations/spacing.md +117 -0
- package/dist/guidelines/foundations/typography.md +114 -0
- package/dist/guidelines/patterns/app-layout.md +1567 -0
- package/dist/guidelines/patterns/auth-page.md +668 -0
- package/dist/guidelines/patterns/confirmation-dialogs.md +605 -0
- package/dist/guidelines/patterns/create-edit-forms.md +768 -0
- package/dist/guidelines/patterns/detail-drawer.md +868 -0
- package/dist/guidelines/patterns/empty-states.md +461 -0
- package/dist/guidelines/patterns/entity-table.md +533 -0
- package/dist/guidelines/patterns/feedback-toasts.md +493 -0
- package/dist/guidelines/patterns/filtering.md +630 -0
- package/dist/guidelines/patterns/resource-list-page.md +558 -0
- package/dist/guidelines/patterns/settings-page.md +752 -0
- package/dist/guidelines/rules.md +25 -0
- package/dist/index.d.ts +2 -3
- package/dist/index.js +1 -2
- package/dist/metadata/components.json +12431 -9208
- package/dist/metadata/guidelines.json +1705 -0
- package/dist/theme/typography.css +5 -0
- package/dist/utils/formatDateTime.d.ts +6 -0
- package/dist/utils/formatDateTime.js +13 -1
- package/package.json +6 -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
|
@@ -0,0 +1,461 @@
|
|
|
1
|
+
---
|
|
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.
|
|
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]
|
|
6
|
+
order: 90
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Empty states
|
|
10
|
+
|
|
11
|
+
An empty state is `EmptyState` placed where the content would be. The header around it stays.
|
|
12
|
+
|
|
13
|
+
## When to use
|
|
14
|
+
|
|
15
|
+
| Need | Use | Not |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| A page table with no rows | `TableEmptyState` › `EmptyState type='collection-empty'` | Hiding `PageHeader` or `PageToolbar` |
|
|
18
|
+
| A table in a drawer or section with no rows | `EmptyState type='collection-empty'` as a direct `Table` child | `TableEmptyState` (too tall) |
|
|
19
|
+
| Search or filters matched nothing | `EmptyState` with "Reset filters" | A create action |
|
|
20
|
+
| An earlier choice is missing ("Select a service first") | `EmptyState` with no actions | Disabling the section silently |
|
|
21
|
+
| A tab or popover panel with nothing in it | `EmptyState` inside `TabsContent` | Hiding the tab |
|
|
22
|
+
| A card, kanban column or chart with no data | `EmptyState type='no-results'` | The icon tile and a pixel title |
|
|
23
|
+
| A `Select` with no options | Nothing: `SelectContent` shows `SelectEmptyState` itself | A hand-built "No results" row |
|
|
24
|
+
| A `FilterDropdown` search with no matches | `FilterDropdownEmpty` | `EmptyState` |
|
|
25
|
+
| A `FilterCascade` search with no matches | Nothing: `FilterCascadeEmpty` shows itself | `EmptyState` |
|
|
26
|
+
| One missing value in a cell or attribute | The em dash `'—'`. See [Entity table](./entity-table.md) | `EmptyState` |
|
|
27
|
+
| Data is loading | `Table isLoading` (skeleton rows) | Any empty state |
|
|
28
|
+
| A request failed | Your own error message | `EmptyState` |
|
|
29
|
+
|
|
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
|
+
|
|
32
|
+
## Rules
|
|
33
|
+
|
|
34
|
+
**Composition**
|
|
35
|
+
|
|
36
|
+
- Compose the parts: `EmptyState` › `EmptyStateIllustration` (`collection-empty` only) › `EmptyStateMessage` › `EmptyStateTitle` + `EmptyStateDescription` › `EmptyStateActions` › `EmptyStateLink` (optional).
|
|
37
|
+
- `collection-empty` needs a title and a description. `no-results` needs one of them: a title in a column or card, a description in a chart.
|
|
38
|
+
- **Never** pass `type` to a part. Parts take the scale from `EmptyState`.
|
|
39
|
+
- There is no `size`, `variant`, `icon`, `title` or `action` prop, and no `className` on `TableEmptyState`.
|
|
40
|
+
- **Never** place a bare icon. Put one icon from `@wallarm-org/design-system/icons` in `EmptyStateIllustration` and leave its size alone.
|
|
41
|
+
- `EmptyState` is already a live region (`role='status'`). **Never** wrap it in another.
|
|
42
|
+
|
|
43
|
+
**Layout and spacing**
|
|
44
|
+
|
|
45
|
+
- `EmptyState` owns its spacing: `collection-empty` is 256–560px wide with 24px vertical padding and 16px gaps; `no-results` is 240px wide with 8px padding. **Never** add `py-*`, `gap-*` or `w-*` to it or its parts.
|
|
46
|
+
- In a page table, wrap it in `TableEmptyState`: it adds 128px vertical padding and renders only when there are no rows and `isLoading` is false, so it needs no guard.
|
|
47
|
+
- In a drawer or section table, render `EmptyState` directly in `Table`, guarded by `data.length === 0 && !isLoading`.
|
|
48
|
+
- **Never** wrap `EmptyState` in a `Card` or a bordered box.
|
|
49
|
+
- Keep `PageHeader`, `PageToolbar`, section headers and table column headers visible when empty.
|
|
50
|
+
|
|
51
|
+
**Copy and actions**
|
|
52
|
+
|
|
53
|
+
- Write the title as a short statement: "No rules yet". **Never** an accusation: "You have no rules".
|
|
54
|
+
- Keep the description to one or two sentences: what the user gets, or what unlocks the area.
|
|
55
|
+
- Show one create action per screen. If `PageActions` or a section header has the create button, the empty state has no button.
|
|
56
|
+
- If no header has a create button, put `Button size='medium'` in `EmptyStateActions`.
|
|
57
|
+
- If search or filters matched nothing, offer "Reset filters" as `Button variant='outline' color='neutral'`. **Never** a create action.
|
|
58
|
+
- If a dependency is missing, name the choice that unlocks the area. **Never** say "No {items} yet".
|
|
59
|
+
- If one area can be dependency-empty or nothing-yet, switch the copy.
|
|
60
|
+
- If each tab can be empty, write copy per tab. **Never** reuse one sentence across tabs.
|
|
61
|
+
- Pick an icon that names the entity: `Users` for users, `Shapes` for rules, `CheckCheck` for caught up, `History` for read.
|
|
62
|
+
- **Never** use an `Alert` or a toast to say a list is empty.
|
|
63
|
+
|
|
64
|
+
## Examples
|
|
65
|
+
|
|
66
|
+
A page table with nothing yet: `PageActions` has the create button, so the empty state has none.
|
|
67
|
+
|
|
68
|
+
The header, toolbar and column headers stay visible. Typing a search switches the copy to
|
|
69
|
+
"No results found" with "Reset filters": the app passes its own flag for the cause.
|
|
70
|
+
|
|
71
|
+
```tsx story=Default
|
|
72
|
+
import { useState } from 'react';
|
|
73
|
+
import { Button } from '@wallarm-org/design-system/Button';
|
|
74
|
+
import { EmptyState, EmptyStateActions, EmptyStateDescription, EmptyStateIllustration, EmptyStateMessage, EmptyStateTitle } from '@wallarm-org/design-system/EmptyState';
|
|
75
|
+
import { Bell, FilterX, SearchX } from '@wallarm-org/design-system/icons';
|
|
76
|
+
import { Page, PageActions, PageContent, PageDescription, PageHeader, PageHeaderGroup, PageTitle, PageToolbar } from '@wallarm-org/design-system/Page';
|
|
77
|
+
import { SearchInput } from '@wallarm-org/design-system/SearchInput';
|
|
78
|
+
import { Table, TableEmptyState } from '@wallarm-org/design-system/Table';
|
|
79
|
+
|
|
80
|
+
export const Default = () => {
|
|
81
|
+
const [query, setQuery] = useState('');
|
|
82
|
+
|
|
83
|
+
const isFiltered = query.trim() !== '';
|
|
84
|
+
|
|
85
|
+
const handleReset = () => setQuery('');
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<Page name='triggers' fullSize fixedHeight data-testid='triggers-page'>
|
|
89
|
+
<PageHeader>
|
|
90
|
+
<PageHeaderGroup className='flex-1'>
|
|
91
|
+
<PageTitle>Triggers</PageTitle>
|
|
92
|
+
<PageDescription>
|
|
93
|
+
Automatic reactions to attacks, incidents and new API endpoints.
|
|
94
|
+
</PageDescription>
|
|
95
|
+
</PageHeaderGroup>
|
|
96
|
+
<PageActions>
|
|
97
|
+
<Button size='medium' onClick={onCreateTrigger} data-testid='triggers-create'>
|
|
98
|
+
Create trigger
|
|
99
|
+
</Button>
|
|
100
|
+
</PageActions>
|
|
101
|
+
</PageHeader>
|
|
102
|
+
|
|
103
|
+
<PageToolbar>
|
|
104
|
+
<SearchInput
|
|
105
|
+
value={query}
|
|
106
|
+
onChange={setQuery}
|
|
107
|
+
placeholder='Search triggers'
|
|
108
|
+
className='w-320'
|
|
109
|
+
data-testid='triggers-search'
|
|
110
|
+
/>
|
|
111
|
+
</PageToolbar>
|
|
112
|
+
|
|
113
|
+
<PageContent>
|
|
114
|
+
<Table
|
|
115
|
+
aria-label='Triggers'
|
|
116
|
+
data={[]}
|
|
117
|
+
columns={TRIGGER_COLUMNS}
|
|
118
|
+
getRowId={getTriggerId}
|
|
119
|
+
data-testid='triggers-table'
|
|
120
|
+
>
|
|
121
|
+
<TableEmptyState>
|
|
122
|
+
{isFiltered ? (
|
|
123
|
+
<EmptyState data-testid='triggers-no-results'>
|
|
124
|
+
<EmptyStateIllustration>
|
|
125
|
+
<SearchX />
|
|
126
|
+
</EmptyStateIllustration>
|
|
127
|
+
<EmptyStateMessage>
|
|
128
|
+
<EmptyStateTitle>No results found</EmptyStateTitle>
|
|
129
|
+
<EmptyStateDescription>
|
|
130
|
+
Try resetting your search or filters.
|
|
131
|
+
</EmptyStateDescription>
|
|
132
|
+
</EmptyStateMessage>
|
|
133
|
+
<EmptyStateActions>
|
|
134
|
+
<Button size='medium' variant='outline' color='neutral' onClick={handleReset}>
|
|
135
|
+
<FilterX />
|
|
136
|
+
Reset filters
|
|
137
|
+
</Button>
|
|
138
|
+
</EmptyStateActions>
|
|
139
|
+
</EmptyState>
|
|
140
|
+
) : (
|
|
141
|
+
<EmptyState data-testid='triggers-empty-state'>
|
|
142
|
+
<EmptyStateIllustration>
|
|
143
|
+
<Bell />
|
|
144
|
+
</EmptyStateIllustration>
|
|
145
|
+
<EmptyStateMessage>
|
|
146
|
+
<EmptyStateTitle>No triggers yet</EmptyStateTitle>
|
|
147
|
+
<EmptyStateDescription>
|
|
148
|
+
Create one to block an IP or notify your team when an attack matches its
|
|
149
|
+
condition.
|
|
150
|
+
</EmptyStateDescription>
|
|
151
|
+
</EmptyStateMessage>
|
|
152
|
+
</EmptyState>
|
|
153
|
+
)}
|
|
154
|
+
</TableEmptyState>
|
|
155
|
+
</Table>
|
|
156
|
+
</PageContent>
|
|
157
|
+
</Page>
|
|
158
|
+
);
|
|
159
|
+
};
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Search or filters matched nothing: reset, never create.
|
|
163
|
+
|
|
164
|
+
The table has rows: "Reset filters" clears the search and they come back.
|
|
165
|
+
|
|
166
|
+
```tsx story=NoResults
|
|
167
|
+
import { useState } from 'react';
|
|
168
|
+
import { Button } from '@wallarm-org/design-system/Button';
|
|
169
|
+
import { EmptyState, EmptyStateActions, EmptyStateDescription, EmptyStateIllustration, EmptyStateMessage, EmptyStateTitle } from '@wallarm-org/design-system/EmptyState';
|
|
170
|
+
import { FilterX, SearchX } from '@wallarm-org/design-system/icons';
|
|
171
|
+
import { Page, PageActions, PageContent, PageDescription, PageHeader, PageHeaderGroup, PageTitle, PageToolbar } from '@wallarm-org/design-system/Page';
|
|
172
|
+
import { SearchInput } from '@wallarm-org/design-system/SearchInput';
|
|
173
|
+
import { Table, TableEmptyState } from '@wallarm-org/design-system/Table';
|
|
174
|
+
|
|
175
|
+
export const NoResults = () => {
|
|
176
|
+
const [query, setQuery] = useState('graphql');
|
|
177
|
+
|
|
178
|
+
const search = query.trim().toLowerCase();
|
|
179
|
+
const rows = TRIGGERS.filter(trigger => trigger.name.toLowerCase().includes(search));
|
|
180
|
+
|
|
181
|
+
const handleReset = () => setQuery('');
|
|
182
|
+
|
|
183
|
+
return (
|
|
184
|
+
<Page name='triggers' fullSize fixedHeight data-testid='triggers-page'>
|
|
185
|
+
<PageHeader>
|
|
186
|
+
<PageHeaderGroup className='flex-1'>
|
|
187
|
+
<PageTitle>Triggers</PageTitle>
|
|
188
|
+
<PageDescription>
|
|
189
|
+
Automatic reactions to attacks, incidents and new API endpoints.
|
|
190
|
+
</PageDescription>
|
|
191
|
+
</PageHeaderGroup>
|
|
192
|
+
<PageActions>
|
|
193
|
+
<Button size='medium' onClick={onCreateTrigger} data-testid='triggers-create'>
|
|
194
|
+
Create trigger
|
|
195
|
+
</Button>
|
|
196
|
+
</PageActions>
|
|
197
|
+
</PageHeader>
|
|
198
|
+
|
|
199
|
+
<PageToolbar>
|
|
200
|
+
<SearchInput
|
|
201
|
+
value={query}
|
|
202
|
+
onChange={setQuery}
|
|
203
|
+
placeholder='Search triggers'
|
|
204
|
+
className='w-320'
|
|
205
|
+
data-testid='triggers-search'
|
|
206
|
+
/>
|
|
207
|
+
</PageToolbar>
|
|
208
|
+
|
|
209
|
+
<PageContent>
|
|
210
|
+
<Table
|
|
211
|
+
aria-label='Triggers'
|
|
212
|
+
data={rows}
|
|
213
|
+
columns={TRIGGER_COLUMNS}
|
|
214
|
+
getRowId={getTriggerId}
|
|
215
|
+
data-testid='triggers-table'
|
|
216
|
+
>
|
|
217
|
+
<TableEmptyState>
|
|
218
|
+
<EmptyState data-testid='triggers-no-results'>
|
|
219
|
+
<EmptyStateIllustration>
|
|
220
|
+
<SearchX />
|
|
221
|
+
</EmptyStateIllustration>
|
|
222
|
+
<EmptyStateMessage>
|
|
223
|
+
<EmptyStateTitle>No results found</EmptyStateTitle>
|
|
224
|
+
<EmptyStateDescription>Try resetting your search or filters.</EmptyStateDescription>
|
|
225
|
+
</EmptyStateMessage>
|
|
226
|
+
<EmptyStateActions>
|
|
227
|
+
<Button size='medium' variant='outline' color='neutral' onClick={handleReset}>
|
|
228
|
+
<FilterX />
|
|
229
|
+
Reset filters
|
|
230
|
+
</Button>
|
|
231
|
+
</EmptyStateActions>
|
|
232
|
+
</EmptyState>
|
|
233
|
+
</TableEmptyState>
|
|
234
|
+
</Table>
|
|
235
|
+
</PageContent>
|
|
236
|
+
</Page>
|
|
237
|
+
);
|
|
238
|
+
};
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
A drawer or section table: `EmptyState` is a direct `Table` child, hidden while loading.
|
|
242
|
+
|
|
243
|
+
No `TableEmptyState` here: its 128px vertical padding is too tall for a section.
|
|
244
|
+
|
|
245
|
+
```tsx story=SectionTable
|
|
246
|
+
import { EmptyState, EmptyStateDescription, EmptyStateIllustration, EmptyStateMessage, EmptyStateTitle } from '@wallarm-org/design-system/EmptyState';
|
|
247
|
+
import { Heading } from '@wallarm-org/design-system/Heading';
|
|
248
|
+
import { Shapes } from '@wallarm-org/design-system/icons';
|
|
249
|
+
import { Table } from '@wallarm-org/design-system/Table';
|
|
250
|
+
|
|
251
|
+
export const SectionTable = () => {
|
|
252
|
+
const isLoading = false;
|
|
253
|
+
|
|
254
|
+
return (
|
|
255
|
+
<div className='flex w-640 flex-col gap-12 p-24' data-testid='mapping-rules-section'>
|
|
256
|
+
<Heading size='lg' weight='medium'>
|
|
257
|
+
Mapping rules
|
|
258
|
+
</Heading>
|
|
259
|
+
<Table
|
|
260
|
+
aria-label='Mapping rules'
|
|
261
|
+
data={MAPPING_RULES}
|
|
262
|
+
columns={MAPPING_RULE_COLUMNS}
|
|
263
|
+
getRowId={getMappingRuleId}
|
|
264
|
+
isLoading={isLoading}
|
|
265
|
+
data-testid='mapping-rules-table'
|
|
266
|
+
>
|
|
267
|
+
{MAPPING_RULES.length === 0 && !isLoading && (
|
|
268
|
+
<EmptyState data-testid='mapping-rules-empty-state'>
|
|
269
|
+
<EmptyStateIllustration>
|
|
270
|
+
<Shapes />
|
|
271
|
+
</EmptyStateIllustration>
|
|
272
|
+
<EmptyStateMessage>
|
|
273
|
+
<EmptyStateTitle>No rules yet</EmptyStateTitle>
|
|
274
|
+
<EmptyStateDescription>
|
|
275
|
+
Create one to grant a role or a group from a claim this provider sends.
|
|
276
|
+
</EmptyStateDescription>
|
|
277
|
+
</EmptyStateMessage>
|
|
278
|
+
</EmptyState>
|
|
279
|
+
)}
|
|
280
|
+
</Table>
|
|
281
|
+
</div>
|
|
282
|
+
);
|
|
283
|
+
};
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
A missing dependency: name the choice that unlocks the area, with no action.
|
|
287
|
+
|
|
288
|
+
The section header stays visible. **Never** "No operations yet".
|
|
289
|
+
|
|
290
|
+
```tsx story=Dependency
|
|
291
|
+
import { EmptyState, EmptyStateDescription, EmptyStateIllustration, EmptyStateMessage, EmptyStateTitle } from '@wallarm-org/design-system/EmptyState';
|
|
292
|
+
import { Heading } from '@wallarm-org/design-system/Heading';
|
|
293
|
+
import { Link2 } from '@wallarm-org/design-system/icons';
|
|
294
|
+
|
|
295
|
+
export const Dependency = () => (
|
|
296
|
+
<div className='flex w-640 flex-col gap-12 p-24' data-testid='operations-section'>
|
|
297
|
+
<Heading size='lg' weight='medium'>
|
|
298
|
+
Operations
|
|
299
|
+
</Heading>
|
|
300
|
+
<EmptyState data-testid='operations-empty-state'>
|
|
301
|
+
<EmptyStateIllustration>
|
|
302
|
+
<Link2 />
|
|
303
|
+
</EmptyStateIllustration>
|
|
304
|
+
<EmptyStateMessage>
|
|
305
|
+
<EmptyStateTitle>Select a service first</EmptyStateTitle>
|
|
306
|
+
<EmptyStateDescription>Choose a service to pick its operations.</EmptyStateDescription>
|
|
307
|
+
</EmptyStateMessage>
|
|
308
|
+
</EmptyState>
|
|
309
|
+
</div>
|
|
310
|
+
);
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
Empty tabs: each tab gets its own copy and an icon that names the case.
|
|
314
|
+
|
|
315
|
+
A notification panel: no action, and every tab stays visible.
|
|
316
|
+
|
|
317
|
+
```tsx story=EmptyTabs
|
|
318
|
+
import { useState } from 'react';
|
|
319
|
+
import { EmptyState, EmptyStateDescription, EmptyStateIllustration, EmptyStateMessage, EmptyStateTitle } from '@wallarm-org/design-system/EmptyState';
|
|
320
|
+
import { CheckCheck, History } from '@wallarm-org/design-system/icons';
|
|
321
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@wallarm-org/design-system/Tabs';
|
|
322
|
+
|
|
323
|
+
export const EmptyTabs = () => {
|
|
324
|
+
const [tab, setTab] = useState('unread');
|
|
325
|
+
|
|
326
|
+
return (
|
|
327
|
+
<div className='w-400 p-24'>
|
|
328
|
+
<Tabs value={tab} onChange={setTab} data-testid='notifications-tabs'>
|
|
329
|
+
<TabsList>
|
|
330
|
+
<TabsTrigger value='unread'>Unread</TabsTrigger>
|
|
331
|
+
<TabsTrigger value='read'>Read</TabsTrigger>
|
|
332
|
+
</TabsList>
|
|
333
|
+
<TabsContent value='unread'>
|
|
334
|
+
<EmptyState data-testid='notifications-unread-empty'>
|
|
335
|
+
<EmptyStateIllustration>
|
|
336
|
+
<CheckCheck />
|
|
337
|
+
</EmptyStateIllustration>
|
|
338
|
+
<EmptyStateMessage>
|
|
339
|
+
<EmptyStateTitle>You're all caught up</EmptyStateTitle>
|
|
340
|
+
<EmptyStateDescription>
|
|
341
|
+
New attacks and incidents will show up here.
|
|
342
|
+
</EmptyStateDescription>
|
|
343
|
+
</EmptyStateMessage>
|
|
344
|
+
</EmptyState>
|
|
345
|
+
</TabsContent>
|
|
346
|
+
<TabsContent value='read'>
|
|
347
|
+
<EmptyState data-testid='notifications-read-empty'>
|
|
348
|
+
<EmptyStateIllustration>
|
|
349
|
+
<History />
|
|
350
|
+
</EmptyStateIllustration>
|
|
351
|
+
<EmptyStateMessage>
|
|
352
|
+
<EmptyStateTitle>Nothing read yet</EmptyStateTitle>
|
|
353
|
+
<EmptyStateDescription>
|
|
354
|
+
Notifications you open move to this tab.
|
|
355
|
+
</EmptyStateDescription>
|
|
356
|
+
</EmptyStateMessage>
|
|
357
|
+
</EmptyState>
|
|
358
|
+
</TabsContent>
|
|
359
|
+
</Tabs>
|
|
360
|
+
</div>
|
|
361
|
+
);
|
|
362
|
+
};
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
Small containers: a kanban column gets a title only, a chart card a description only.
|
|
366
|
+
|
|
367
|
+
`type='no-results'` has no illustration. Centre it in the column or the card body.
|
|
368
|
+
|
|
369
|
+
```tsx story=SmallContainers
|
|
370
|
+
import { Card, CardContent, CardHeader, CardTitle } from '@wallarm-org/design-system/Card';
|
|
371
|
+
import { EmptyState, EmptyStateDescription, EmptyStateMessage, EmptyStateTitle } from '@wallarm-org/design-system/EmptyState';
|
|
372
|
+
import { NumericBadge } from '@wallarm-org/design-system/NumericBadge';
|
|
373
|
+
import { Text } from '@wallarm-org/design-system/Text';
|
|
374
|
+
|
|
375
|
+
export const SmallContainers = () => (
|
|
376
|
+
<div className='flex gap-16 p-24'>
|
|
377
|
+
<div
|
|
378
|
+
className='flex h-320 w-280 flex-col gap-8 rounded-12 border border-border-primary-light p-12'
|
|
379
|
+
data-testid='incidents-column-open'
|
|
380
|
+
>
|
|
381
|
+
<div className='flex items-center gap-8'>
|
|
382
|
+
<Text size='sm' weight='medium'>
|
|
383
|
+
Open
|
|
384
|
+
</Text>
|
|
385
|
+
<NumericBadge>1</NumericBadge>
|
|
386
|
+
</div>
|
|
387
|
+
<div className='flex flex-col gap-4 rounded-8 border border-border-primary p-12'>
|
|
388
|
+
<Text size='sm' weight='medium'>
|
|
389
|
+
SQL injection on /api/v2/payments
|
|
390
|
+
</Text>
|
|
391
|
+
<Text size='xs' color='secondary'>
|
|
392
|
+
payments.acme-bank.com
|
|
393
|
+
</Text>
|
|
394
|
+
</div>
|
|
395
|
+
</div>
|
|
396
|
+
<div
|
|
397
|
+
className='flex h-320 w-280 flex-col gap-8 rounded-12 border border-border-primary-light p-12'
|
|
398
|
+
data-testid='incidents-column-in-progress'
|
|
399
|
+
>
|
|
400
|
+
<div className='flex items-center gap-8'>
|
|
401
|
+
<Text size='sm' weight='medium'>
|
|
402
|
+
In progress
|
|
403
|
+
</Text>
|
|
404
|
+
<NumericBadge>0</NumericBadge>
|
|
405
|
+
</div>
|
|
406
|
+
<div className='flex flex-1 items-center justify-center'>
|
|
407
|
+
<EmptyState type='no-results' data-testid='incidents-column-empty'>
|
|
408
|
+
<EmptyStateMessage>
|
|
409
|
+
<EmptyStateTitle>Nothing runs here yet</EmptyStateTitle>
|
|
410
|
+
</EmptyStateMessage>
|
|
411
|
+
</EmptyState>
|
|
412
|
+
</div>
|
|
413
|
+
</div>
|
|
414
|
+
<Card className='h-320 w-400' data-testid='attacks-chart'>
|
|
415
|
+
<CardHeader>
|
|
416
|
+
<CardTitle>Attacks by type</CardTitle>
|
|
417
|
+
</CardHeader>
|
|
418
|
+
<CardContent className='flex flex-1 items-center justify-center'>
|
|
419
|
+
<EmptyState type='no-results' data-testid='attacks-chart-empty'>
|
|
420
|
+
<EmptyStateMessage>
|
|
421
|
+
<EmptyStateDescription>No data found for selected period</EmptyStateDescription>
|
|
422
|
+
</EmptyStateMessage>
|
|
423
|
+
</EmptyState>
|
|
424
|
+
</CardContent>
|
|
425
|
+
</Card>
|
|
426
|
+
</div>
|
|
427
|
+
);
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
## States
|
|
431
|
+
|
|
432
|
+
| State | Show | Example component |
|
|
433
|
+
| --- | --- | --- |
|
|
434
|
+
| Loading | Skeleton rows, no empty state | `Table isLoading` |
|
|
435
|
+
| Nothing yet, create button in a header | "No {items} yet" + what creating one does; no button | `TableEmptyState` › `EmptyState` |
|
|
436
|
+
| Nothing yet, no create button anywhere | Title, description, `Button size='medium'` | `EmptyState` › `EmptyStateActions` |
|
|
437
|
+
| Filters matched nothing | "No results found" + "Reset filters" | `EmptyState` › `EmptyStateActions` |
|
|
438
|
+
| Earlier choice missing | "Select a service first", no action | `EmptyState` |
|
|
439
|
+
| Tab empty | Per-tab copy, no action: "You're all caught up" (`CheckCheck`), "Nothing read yet" (`History`) | `EmptyState` in `TabsContent` |
|
|
440
|
+
| Column, card or chart empty | Title only, or description only in a chart | `EmptyState type='no-results'` |
|
|
441
|
+
| Request failed | Your own message | App-rendered |
|
|
442
|
+
|
|
443
|
+
## What your app owns
|
|
444
|
+
|
|
445
|
+
- **The cause.** The DS cannot tell nothing-yet, filtered and dependency-missing apart. Pass your own flag.
|
|
446
|
+
- **Copy.** `EmptyState` has no default strings.
|
|
447
|
+
- **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 variant. Render your own message.
|
|
449
|
+
- **Notification center.** No popover block exists. Compose `Popover`, `Tabs` and `EmptyState`.
|
|
450
|
+
- **Kanban.** No kanban component exists. Centre `EmptyState type='no-results'` in your column.
|
|
451
|
+
- **Figma drift.** Figma flags the empty state component for an update. Follow the code scale until it changes.
|
|
452
|
+
|
|
453
|
+
## Related
|
|
454
|
+
|
|
455
|
+
- [Resource list page](./resource-list-page.md)
|
|
456
|
+
- [Entity table](./entity-table.md)
|
|
457
|
+
- [Detail drawer](./detail-drawer.md)
|
|
458
|
+
- [Create and edit forms](./create-edit-forms.md)
|
|
459
|
+
- [Filtering](./filtering.md)
|
|
460
|
+
- [Spacing](../foundations/spacing.md)
|
|
461
|
+
- [Typography](../foundations/typography.md)
|