@acronis-platform/ui-react 2.0.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/accordion-container/accordion-container.js +144 -0
- package/dist/components/ui/accordion-container/accordion-container.js.map +1 -0
- package/dist/components/ui/app-shell-chat/app-shell-chat.js.map +1 -1
- package/dist/components/ui/area-chart/area-chart.js +141 -139
- package/dist/components/ui/area-chart/area-chart.js.map +1 -1
- package/dist/components/ui/avatar/avatar.js +33 -22
- package/dist/components/ui/avatar/avatar.js.map +1 -1
- package/dist/components/ui/bar-chart/bar-chart.js +295 -293
- package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
- package/dist/components/ui/card/card.js +150 -74
- package/dist/components/ui/card/card.js.map +1 -1
- package/dist/components/ui/card-section/card-section.js +111 -0
- package/dist/components/ui/card-section/card-section.js.map +1 -0
- package/dist/components/ui/category-bar/category-bar.js +109 -93
- package/dist/components/ui/category-bar/category-bar.js.map +1 -1
- package/dist/components/ui/chart/chart-palette.js +113 -0
- package/dist/components/ui/chart/chart-palette.js.map +1 -0
- package/dist/components/ui/chart/chart.js +176 -129
- package/dist/components/ui/chart/chart.js.map +1 -1
- package/dist/components/ui/chart-state/chart-state-illustrations.js +310 -0
- package/dist/components/ui/chart-state/chart-state-illustrations.js.map +1 -0
- package/dist/components/ui/chart-state/chart-state.js +48 -34
- package/dist/components/ui/chart-state/chart-state.js.map +1 -1
- package/dist/components/ui/chart-widget/chart-widget.js +87 -0
- package/dist/components/ui/chart-widget/chart-widget.js.map +1 -0
- package/dist/components/ui/composed-chart/composed-chart.js +117 -115
- package/dist/components/ui/composed-chart/composed-chart.js.map +1 -1
- package/dist/components/ui/confidence-cone/confidence-cone.js +166 -158
- package/dist/components/ui/confidence-cone/confidence-cone.js.map +1 -1
- package/dist/components/ui/data-table/data-table.js +4 -2
- package/dist/components/ui/data-table/data-table.js.map +1 -1
- package/dist/components/ui/empty-overlay/empty-overlay.js +49 -0
- package/dist/components/ui/empty-overlay/empty-overlay.js.map +1 -0
- package/dist/components/ui/funnel-chart/funnel-chart.js +162 -161
- package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -1
- package/dist/components/ui/histogram/histogram.js +94 -92
- package/dist/components/ui/histogram/histogram.js.map +1 -1
- package/dist/components/ui/input/input.js.map +1 -1
- package/dist/components/ui/label/label.js +2 -9
- package/dist/components/ui/label/label.js.map +1 -1
- package/dist/components/ui/line-chart/line-chart.js +143 -141
- package/dist/components/ui/line-chart/line-chart.js.map +1 -1
- package/dist/components/ui/metric/metric.js +74 -185
- package/dist/components/ui/metric/metric.js.map +1 -1
- package/dist/components/ui/page-content/page-content.js.map +1 -1
- package/dist/components/ui/pie-chart/pie-chart.js +201 -195
- package/dist/components/ui/pie-chart/pie-chart.js.map +1 -1
- package/dist/components/ui/radar-chart/radar-chart.js +133 -131
- package/dist/components/ui/radar-chart/radar-chart.js.map +1 -1
- package/dist/components/ui/radial-bar-chart/radial-bar-chart.js +297 -265
- package/dist/components/ui/radial-bar-chart/radial-bar-chart.js.map +1 -1
- package/dist/components/ui/sankey-chart/sankey-chart.js +123 -101
- package/dist/components/ui/sankey-chart/sankey-chart.js.map +1 -1
- package/dist/components/ui/scatter-chart/scatter-chart.js +76 -74
- package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -1
- package/dist/components/ui/section/section.js +157 -31
- package/dist/components/ui/section/section.js.map +1 -1
- package/dist/components/ui/stepper/stepper.js +24 -24
- package/dist/components/ui/stepper/stepper.js.map +1 -1
- package/dist/components/ui/stepper-item/stepper-item.js +43 -24
- package/dist/components/ui/stepper-item/stepper-item.js.map +1 -1
- package/dist/components/ui/table/table.js +27 -27
- package/dist/components/ui/table/table.js.map +1 -1
- package/dist/components/ui/treemap/treemap.js +133 -124
- package/dist/components/ui/treemap/treemap.js.map +1 -1
- package/dist/components/ui/trend-indicator/trend-indicator.js +34 -69
- package/dist/components/ui/trend-indicator/trend-indicator.js.map +1 -1
- package/dist/components/ui/wizard/wizard.js +59 -0
- package/dist/components/ui/wizard/wizard.js.map +1 -0
- package/dist/hooks/use-wizard.js +75 -0
- package/dist/hooks/use-wizard.js.map +1 -0
- package/dist/index.js +540 -525
- package/dist/index.js.map +1 -1
- package/dist/llms/accordion-container.md +181 -0
- package/dist/llms/accordion.md +124 -0
- package/dist/llms/alert.md +225 -0
- package/dist/llms/app-shell-chat.md +415 -0
- package/dist/llms/area-chart.md +355 -0
- package/dist/llms/avatar.md +208 -0
- package/dist/llms/bar-chart.md +406 -0
- package/dist/llms/breadcrumb.md +326 -0
- package/dist/llms/button-group.md +298 -0
- package/dist/llms/button-icon-input.md +142 -0
- package/dist/llms/button-icon-menu.md +209 -0
- package/dist/llms/button-icon.md +128 -0
- package/dist/llms/button-menu.md +172 -0
- package/dist/llms/button.md +185 -0
- package/dist/llms/calendar-panel.md +733 -0
- package/dist/llms/calendar.md +188 -0
- package/dist/llms/card-filter.md +214 -0
- package/dist/llms/card-section.md +293 -0
- package/dist/llms/card.md +447 -0
- package/dist/llms/carousel-dialog.md +156 -0
- package/dist/llms/category-bar.md +193 -0
- package/dist/llms/chart-state.md +190 -0
- package/dist/llms/chart-widget.md +209 -0
- package/dist/llms/chart.md +182 -0
- package/dist/llms/checkbox.md +257 -0
- package/dist/llms/chip.md +195 -0
- package/dist/llms/combobox.md +164 -0
- package/dist/llms/composed-chart.md +508 -0
- package/dist/llms/confidence-cone.md +277 -0
- package/dist/llms/data-table.md +474 -0
- package/dist/llms/date-range-picker.md +272 -0
- package/dist/llms/description-list.md +131 -0
- package/dist/llms/dialog-footer-carousel.md +147 -0
- package/dist/llms/dialog-footer-default.md +142 -0
- package/dist/llms/dialog-root.md +246 -0
- package/dist/llms/dialog-welcome.md +223 -0
- package/dist/llms/dialog.md +403 -0
- package/dist/llms/dropdown-menu.md +193 -0
- package/dist/llms/empty-overlay.md +146 -0
- package/dist/llms/empty.md +156 -0
- package/dist/llms/field.md +185 -0
- package/dist/llms/filter-cards.md +157 -0
- package/dist/llms/filter-chips.md +323 -0
- package/dist/llms/filter-search.md +512 -0
- package/dist/llms/form.md +154 -0
- package/dist/llms/funnel-chart.md +333 -0
- package/dist/llms/grid.md +80 -0
- package/dist/llms/histogram.md +190 -0
- package/dist/llms/input-date-picker.md +203 -0
- package/dist/llms/input-otp.md +173 -0
- package/dist/llms/input-password.md +197 -0
- package/dist/llms/input-search.md +170 -0
- package/dist/llms/input-select.md +278 -0
- package/dist/llms/input-text-area.md +271 -0
- package/dist/llms/input-text.md +192 -0
- package/dist/llms/line-chart.md +369 -0
- package/dist/llms/link.md +209 -0
- package/dist/llms/loading.md +130 -0
- package/dist/llms/meter.md +177 -0
- package/dist/llms/metric.md +204 -0
- package/dist/llms/number-field.md +122 -0
- package/dist/llms/page-content.md +69 -0
- package/dist/llms/page-header.md +182 -0
- package/dist/llms/pagination.md +133 -0
- package/dist/llms/pie-chart.md +307 -0
- package/dist/llms/popover.md +252 -0
- package/dist/llms/progress-circle.md +126 -0
- package/dist/llms/progress.md +111 -0
- package/dist/llms/radar-chart.md +316 -0
- package/dist/llms/radial-bar-chart.md +319 -0
- package/dist/llms/radio.md +255 -0
- package/dist/llms/resizable.md +195 -0
- package/dist/llms/sankey-chart.md +208 -0
- package/dist/llms/scatter-chart.md +239 -0
- package/dist/llms/scroll-area.md +183 -0
- package/dist/llms/section.md +401 -0
- package/dist/llms/select.md +210 -0
- package/dist/llms/separator.md +87 -0
- package/dist/llms/sheet.md +202 -0
- package/dist/llms/sidebar-primary.md +360 -0
- package/dist/llms/sidebar-secondary.md +417 -0
- package/dist/llms/skeleton.md +81 -0
- package/dist/llms/slider.md +97 -0
- package/dist/llms/spinner.md +100 -0
- package/dist/llms/stack.md +80 -0
- package/dist/llms/stepper-item.md +309 -0
- package/dist/llms/stepper.md +251 -0
- package/dist/llms/switch.md +140 -0
- package/dist/llms/table.md +436 -0
- package/dist/llms/tabs.md +197 -0
- package/dist/llms/tag.md +139 -0
- package/dist/llms/timeline.md +361 -0
- package/dist/llms/timer.md +259 -0
- package/dist/llms/toast.md +241 -0
- package/dist/llms/toggle-group.md +121 -0
- package/dist/llms/toolbar.md +453 -0
- package/dist/llms/tooltip.md +164 -0
- package/dist/llms/treemap.md +254 -0
- package/dist/llms/trend-indicator.md +132 -0
- package/dist/llms/widget-placeholder.md +169 -0
- package/dist/llms/wizard.md +412 -0
- package/dist/llms.txt +142 -0
- package/dist/react.js +540 -525
- package/dist/react.js.map +1 -1
- package/dist/src/components/ui/accordion-container/accordion-container.d.ts +44 -0
- package/dist/src/components/ui/accordion-container/index.d.ts +1 -0
- package/dist/src/components/ui/area-chart/area-chart.d.ts +9 -4
- package/dist/src/components/ui/avatar/avatar.d.ts +27 -8
- package/dist/src/components/ui/bar-chart/bar-chart.d.ts +9 -4
- package/dist/src/components/ui/button/button.d.ts +1 -1
- package/dist/src/components/ui/card/card.d.ts +69 -8
- package/dist/src/components/ui/card/index.d.ts +1 -1
- package/dist/src/components/ui/card-section/card-section.d.ts +50 -0
- package/dist/src/components/ui/card-section/index.d.ts +1 -0
- package/dist/src/components/ui/category-bar/category-bar.d.ts +10 -4
- package/dist/src/components/ui/chart/__stories__/palette-control.d.ts +48 -0
- package/dist/src/components/ui/chart/__tests__/chart-palette.test.d.ts +1 -0
- package/dist/src/components/ui/chart/chart-palette.d.ts +128 -0
- package/dist/src/components/ui/chart/chart.d.ts +66 -15
- package/dist/src/components/ui/chart/index.d.ts +4 -2
- package/dist/src/components/ui/chart-state/chart-state-illustrations.d.ts +6 -0
- package/dist/src/components/ui/chart-state/chart-state.d.ts +13 -2
- package/dist/src/components/ui/chart-state/index.d.ts +1 -0
- package/dist/src/components/ui/chart-widget/chart-widget.d.ts +64 -0
- package/dist/src/components/ui/chart-widget/index.d.ts +1 -0
- package/dist/src/components/ui/composed-chart/composed-chart.d.ts +12 -7
- package/dist/src/components/ui/confidence-cone/confidence-cone.d.ts +10 -5
- package/dist/src/components/ui/dialog/dialog.d.ts +1 -1
- package/dist/src/components/ui/empty-overlay/empty-overlay.d.ts +20 -0
- package/dist/src/components/ui/empty-overlay/index.d.ts +2 -0
- package/dist/src/components/ui/funnel-chart/funnel-chart.d.ts +11 -5
- package/dist/src/components/ui/grid/grid.d.ts +1 -1
- package/dist/src/components/ui/histogram/histogram.d.ts +10 -4
- package/dist/src/components/ui/label/index.d.ts +1 -1
- package/dist/src/components/ui/label/label.d.ts +1 -5
- package/dist/src/components/ui/line-chart/line-chart.d.ts +9 -4
- package/dist/src/components/ui/metric/metric.d.ts +13 -14
- package/dist/src/components/ui/pie-chart/pie-chart.d.ts +17 -8
- package/dist/src/components/ui/radar-chart/radar-chart.d.ts +10 -5
- package/dist/src/components/ui/radial-bar-chart/radial-bar-chart.d.ts +17 -6
- package/dist/src/components/ui/sankey-chart/sankey-chart.d.ts +10 -5
- package/dist/src/components/ui/scatter-chart/scatter-chart.d.ts +10 -5
- package/dist/src/components/ui/section/index.d.ts +1 -1
- package/dist/src/components/ui/section/section.d.ts +75 -6
- package/dist/src/components/ui/sheet/sheet.d.ts +1 -1
- package/dist/src/components/ui/stack/stack.d.ts +1 -1
- package/dist/src/components/ui/stepper-item/stepper-item.d.ts +6 -5
- package/dist/src/components/ui/tag/tag.d.ts +1 -1
- package/dist/src/components/ui/treemap/treemap.d.ts +11 -5
- package/dist/src/components/ui/trend-indicator/trend-indicator.d.ts +3 -7
- package/dist/src/components/ui/wizard/index.d.ts +1 -0
- package/dist/src/components/ui/wizard/wizard.d.ts +6 -0
- package/dist/src/hooks/index.d.ts +1 -0
- package/dist/src/hooks/use-wizard.d.ts +80 -0
- package/dist/src/index.d.ts +5 -3
- package/dist/ui-react.css +1 -1
- package/package.json +12 -6
- package/dist/components/ui/app-shell/app-shell.js +0 -75
- package/dist/components/ui/app-shell/app-shell.js.map +0 -1
- package/dist/components/ui/auth-layout/auth-layout.js +0 -56
- package/dist/components/ui/auth-layout/auth-layout.js.map +0 -1
- package/dist/components/ui/collapsible/collapsible.js +0 -22
- package/dist/components/ui/collapsible/collapsible.js.map +0 -1
- package/dist/src/components/ui/app-shell/app-shell.d.ts +0 -8
- package/dist/src/components/ui/app-shell/index.d.ts +0 -1
- package/dist/src/components/ui/auth-layout/auth-layout.d.ts +0 -6
- package/dist/src/components/ui/auth-layout/index.d.ts +0 -1
- package/dist/src/components/ui/collapsible/collapsible.d.ts +0 -5
- package/dist/src/components/ui/collapsible/index.d.ts +0 -1
- package/dist/src/components/ui/label/label.docs.d.ts +0 -10
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
# FilterChips
|
|
2
|
+
|
|
3
|
+
> A wrapping row that summarises the filters currently applied to a data set (the Figma `FilterChips` component): one removable `Chip` per filter, closed by a ghost "Reset filters" action that clears them all at once. Pure layout — it owns no visual styling of its own besides the two gaps. Figma's nested `ListChips` slot maps to `FilterChipsList`'s children.
|
|
4
|
+
|
|
5
|
+
**Status:** ready · **Category:** data-display · **Since:** v0.63.0
|
|
6
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { FilterChips, FilterChipsList, FilterChipsReset, Chip } from '@acronis-platform/ui-react'
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick example
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
<FilterChips>
|
|
17
|
+
<FilterChipsList>
|
|
18
|
+
{applied.map((filter) => (
|
|
19
|
+
<Chip
|
|
20
|
+
key={filter.id}
|
|
21
|
+
removeLabel={`Remove ${filter.id} filter`}
|
|
22
|
+
onRemove={() => removeFilter(filter.id)}
|
|
23
|
+
>
|
|
24
|
+
{filter.label}
|
|
25
|
+
</Chip>
|
|
26
|
+
))}
|
|
27
|
+
<FilterChipsReset onClick={resetFilters} />
|
|
28
|
+
</FilterChipsList>
|
|
29
|
+
</FilterChips>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
A wrapping row that summarises the filters currently applied to a data set: one
|
|
33
|
+
removable chip per filter, closed by a ghost "Reset filters" action that clears
|
|
34
|
+
them all at once.
|
|
35
|
+
|
|
36
|
+
It is pure layout. The only thing it owns is the two gaps the design specifies —
|
|
37
|
+
16px between the root's children and 8px between the items in the chip list. The
|
|
38
|
+
chips are `Chip`s you pass in, and the reset action is a ghost `Button`.
|
|
39
|
+
|
|
40
|
+
## When to use
|
|
41
|
+
|
|
42
|
+
- Below a filter toolbar, to show which filters are currently narrowing a table,
|
|
43
|
+
list or dashboard, and to let a user drop them individually.
|
|
44
|
+
- Wherever a filter selection needs to stay visible after the popover or panel
|
|
45
|
+
that produced it has closed.
|
|
46
|
+
- When you want the composition under your control — you decide what each chip's
|
|
47
|
+
label says, whether it carries a leading icon, and whether a reset action is
|
|
48
|
+
offered at all.
|
|
49
|
+
|
|
50
|
+
## When not to use
|
|
51
|
+
|
|
52
|
+
- **To offer the filters themselves.** This row reports a selection; it does not
|
|
53
|
+
make one. Use `FilterSearchFilters` (a filter popover) or the appropriate input
|
|
54
|
+
for that.
|
|
55
|
+
- **When you just want the row wired to a filter record.** Use
|
|
56
|
+
`FilterSearchAppliedFilters`, which renders through these parts and derives the
|
|
57
|
+
chips from a `filters` object, including hiding itself when the object is empty.
|
|
58
|
+
- **For a single chip, or for chips that select rather than remove.** Use `Chip`
|
|
59
|
+
directly (`variant="selectable"` / `variant="operational"`).
|
|
60
|
+
- **As a general tag row.** The group is named "Applied filters" and the reset
|
|
61
|
+
action is a clear-all; a row of non-filter tokens should compose `Chip` itself.
|
|
62
|
+
|
|
63
|
+
## Examples
|
|
64
|
+
|
|
65
|
+
### Applied filters with a clear-all
|
|
66
|
+
|
|
67
|
+
```tsx
|
|
68
|
+
import {
|
|
69
|
+
Chip,
|
|
70
|
+
FilterChips,
|
|
71
|
+
FilterChipsList,
|
|
72
|
+
FilterChipsReset,
|
|
73
|
+
} from '@acronis-platform/ui-react';
|
|
74
|
+
|
|
75
|
+
<FilterChips>
|
|
76
|
+
<FilterChipsList>
|
|
77
|
+
{applied.map((filter) => (
|
|
78
|
+
<Chip
|
|
79
|
+
key={filter.id}
|
|
80
|
+
removeLabel={`Remove ${filter.id} filter`}
|
|
81
|
+
onRemove={() => removeFilter(filter.id)}
|
|
82
|
+
>
|
|
83
|
+
{filter.label}
|
|
84
|
+
</Chip>
|
|
85
|
+
))}
|
|
86
|
+
<FilterChipsReset onClick={resetFilters} />
|
|
87
|
+
</FilterChipsList>
|
|
88
|
+
</FilterChips>;
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Chips with a leading icon
|
|
92
|
+
|
|
93
|
+
```tsx
|
|
94
|
+
<FilterChips>
|
|
95
|
+
<FilterChipsList>
|
|
96
|
+
<Chip icon={<TagIcon size={16} />} removeLabel="Remove type filter">
|
|
97
|
+
Type: Server
|
|
98
|
+
</Chip>
|
|
99
|
+
<Chip icon={<TagIcon size={16} />} removeLabel="Remove OS filter">
|
|
100
|
+
OS: Linux
|
|
101
|
+
</Chip>
|
|
102
|
+
<FilterChipsReset />
|
|
103
|
+
</FilterChipsList>
|
|
104
|
+
</FilterChips>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### No reset action
|
|
108
|
+
|
|
109
|
+
Omit `FilterChipsReset` when the surrounding UI already offers a way to clear the
|
|
110
|
+
filters.
|
|
111
|
+
|
|
112
|
+
```tsx
|
|
113
|
+
<FilterChips ariaLabel="Applied workload filters">
|
|
114
|
+
<FilterChipsList>
|
|
115
|
+
<Chip removeLabel="Remove type filter">Type: Server</Chip>
|
|
116
|
+
<Chip removeLabel="Remove OS filter">OS: Linux</Chip>
|
|
117
|
+
</FilterChipsList>
|
|
118
|
+
</FilterChips>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### A localized reset label
|
|
122
|
+
|
|
123
|
+
Every string in the row is consumer-supplied. `FilterChipsReset`'s "Reset filters"
|
|
124
|
+
is only a default; pass your own translated label as its children, and override
|
|
125
|
+
the region's name with `ariaLabel`.
|
|
126
|
+
|
|
127
|
+
```tsx
|
|
128
|
+
<FilterChips ariaLabel={t('appliedFilters')}>
|
|
129
|
+
<FilterChipsList>
|
|
130
|
+
<Chip removeLabel={t('removeTypeFilter')}>{t('filterType')}</Chip>
|
|
131
|
+
<FilterChipsReset>{t('resetFilters')}</FilterChipsReset>
|
|
132
|
+
</FilterChipsList>
|
|
133
|
+
</FilterChips>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Parts
|
|
137
|
+
|
|
138
|
+
| Part | Element | Notes |
|
|
139
|
+
| ------------------ | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
140
|
+
| `FilterChips` | `div` (`role="group"`) | Root row. Carries the region's accessible name (`ariaLabel`, default "Applied filters") and the 16px gap between its children. Polymorphic via `render`. |
|
|
141
|
+
| `FilterChipsList` | `div` | The wrapping chip container — 8px gap in both axes, wrapped lines centered. Maps to the Figma `ListChips` slot. |
|
|
142
|
+
| `FilterChipsReset` | `button` (ghost `Button`) | The clear-all action. Label is `children`, defaulting to "Reset filters". Composed as the **last child of the list**, not beside it. |
|
|
143
|
+
|
|
144
|
+
`Chip` is not a part of this component — the chips are your children. Use
|
|
145
|
+
`variant="removable"` (Chip's default) and give each one a `removeLabel` that
|
|
146
|
+
names the filter it drops.
|
|
147
|
+
|
|
148
|
+
## Notes
|
|
149
|
+
|
|
150
|
+
- **The reset action belongs inside the list.** The design measures 8px between
|
|
151
|
+
the last chip and the button, which is the list's gap. Placing it as a sibling
|
|
152
|
+
of the list would render it 16px away and wrap independently of the chips.
|
|
153
|
+
- **No empty state.** The row renders whatever it is given, including nothing;
|
|
154
|
+
the design defines no empty appearance. Deciding not to render the row when no
|
|
155
|
+
filters are applied is the consumer's call —
|
|
156
|
+
`FilterSearchAppliedFilters` makes that call for you.
|
|
157
|
+
- **Theming.** No `--ui-filter-chips-*` tier exists and none is needed. The row
|
|
158
|
+
consumes `--ui-gap-16` and `--ui-gap-8`; everything visible comes from
|
|
159
|
+
`--ui-chip-*` and `--ui-button-ghost-*`.
|
|
160
|
+
|
|
161
|
+
## Props
|
|
162
|
+
|
|
163
|
+
| Prop | Type | Default | Required | Description |
|
|
164
|
+
|------|------|---------|----------|-------------|
|
|
165
|
+
| `ariaLabel` | `string` | `Applied filters` | no | `FilterChips` (root) only. Accessible name for the applied-filter region, which the root exposes as `role="group"`. Override to localize. |
|
|
166
|
+
| `render` | `RenderProp` | `undefined` | no | Base UI composition prop on `FilterChips` (root, replaces the `<div>`) and on `FilterChipsReset` (replaces the `<button>`) — merges props and classes onto the supplied element or component. React-only; other frameworks use their own polymorphism. |
|
|
167
|
+
|
|
168
|
+
## Events
|
|
169
|
+
|
|
170
|
+
| Event | Payload | Description |
|
|
171
|
+
|-------|---------|-------------|
|
|
172
|
+
| `click` | `MouseEvent` | `FilterChipsReset` only. Emitted when the clear-all action is pressed. Removing an individual filter is the chip's own `remove` event — see Chip's spec. |
|
|
173
|
+
|
|
174
|
+
## Content slots
|
|
175
|
+
|
|
176
|
+
| Slot | Description |
|
|
177
|
+
|------|-------------|
|
|
178
|
+
| `default` | On `FilterChips`, the `FilterChipsList` (plus anything a consumer places beside the whole list, separated by the root's 16px gap). On `FilterChipsList`, one removable `Chip` per applied filter followed by an optional `FilterChipsReset`. On `FilterChipsReset`, the action's label, defaulting to "Reset filters". |
|
|
179
|
+
|
|
180
|
+
## Behavior
|
|
181
|
+
|
|
182
|
+
`FilterChips` is a layout composition: it renders whatever chips and actions the
|
|
183
|
+
consumer passes in and owns no state of its own. The scenarios below describe
|
|
184
|
+
the contract the parts establish together; the chip's own remove button and the
|
|
185
|
+
reset button's press feedback are specified in Chip's and Button's behavior docs.
|
|
186
|
+
|
|
187
|
+
### Layout
|
|
188
|
+
|
|
189
|
+
**Given** a `FilterChips` root containing a `FilterChipsList`
|
|
190
|
+
**When** the list holds several chips
|
|
191
|
+
**Then** the chips sit in a single row 8px apart, vertically centered against the
|
|
192
|
+
32px row height (the reset button's height), and the root leaves 16px between the
|
|
193
|
+
list and any sibling placed beside it.
|
|
194
|
+
|
|
195
|
+
**Given** a `FilterChipsList` whose chips exceed the available width
|
|
196
|
+
**When** the row is laid out
|
|
197
|
+
**Then** the chips wrap onto additional lines, keeping the same 8px gap between
|
|
198
|
+
lines, and the wrapped lines stay centered against the row (`content-center`).
|
|
199
|
+
The component never clips a chip and never scrolls; the row grows taller instead.
|
|
200
|
+
|
|
201
|
+
**Given** a chip whose label is wider than the space available to it
|
|
202
|
+
**When** the row is laid out
|
|
203
|
+
**Then** the chip truncates its own label with an ellipsis rather than pushing the
|
|
204
|
+
row wider — see Chip's spec.
|
|
205
|
+
|
|
206
|
+
### Removing a single filter
|
|
207
|
+
|
|
208
|
+
**Given** a removable `Chip` inside the list
|
|
209
|
+
**When** the user presses the chip's × button
|
|
210
|
+
**Then** the chip emits `remove`; the consumer drops that filter from its state
|
|
211
|
+
and the chip disappears on the next render, with the remaining chips reflowing to
|
|
212
|
+
close the gap. `FilterChips` does not remove the chip itself.
|
|
213
|
+
|
|
214
|
+
### Clearing every filter
|
|
215
|
+
|
|
216
|
+
**Given** a `FilterChipsReset` composed as the last child of the list
|
|
217
|
+
**When** the user presses it
|
|
218
|
+
**Then** it emits `click`; the consumer clears its filter state and every chip
|
|
219
|
+
disappears on the next render.
|
|
220
|
+
|
|
221
|
+
**Given** a `FilterChipsReset` with `disabled`
|
|
222
|
+
**When** the user presses it
|
|
223
|
+
**Then** nothing is emitted and the button shows the ghost variant's disabled
|
|
224
|
+
styling.
|
|
225
|
+
|
|
226
|
+
### Empty state
|
|
227
|
+
|
|
228
|
+
**Given** a consumer with no applied filters
|
|
229
|
+
**When** it renders
|
|
230
|
+
**Then** it is the consumer's decision whether to render an empty
|
|
231
|
+
`FilterChips` (a 32px-tall empty row) or nothing at all. `FilterChips` renders
|
|
232
|
+
whatever it is given and does not hide itself — the design has no empty state.
|
|
233
|
+
The data-driven `FilterSearchAppliedFilters` wrapper, which owns the filter
|
|
234
|
+
record, is the part that returns nothing when there are no filters.
|
|
235
|
+
|
|
236
|
+
### Composition
|
|
237
|
+
|
|
238
|
+
**Given** the reset action
|
|
239
|
+
**When** it is composed
|
|
240
|
+
**Then** it belongs inside `FilterChipsList`, not beside it — the design measures
|
|
241
|
+
8px between the last chip and the button, which is the list's gap, not the root's
|
|
242
|
+
16px.
|
|
243
|
+
|
|
244
|
+
**Given** a `render` prop on the root
|
|
245
|
+
**When** it is supplied
|
|
246
|
+
**Then** the root renders as that element or component instead of a `<div>`, with
|
|
247
|
+
the group role, accessible name and layout classes merged onto it.
|
|
248
|
+
|
|
249
|
+
### Right-to-left
|
|
250
|
+
|
|
251
|
+
**Given** an ancestor with `dir="rtl"`
|
|
252
|
+
**When** the row is laid out
|
|
253
|
+
**Then** the chips and the reset action flow from the right edge and wrap
|
|
254
|
+
right-to-left; the chip's × sits at the label's trailing (left) edge. The row
|
|
255
|
+
uses no physical directional utilities, so this needs no extra prop.
|
|
256
|
+
|
|
257
|
+
## Accessibility
|
|
258
|
+
|
|
259
|
+
## Roles and ARIA
|
|
260
|
+
|
|
261
|
+
- The **root** is a `role="group"` with an accessible name from `ariaLabel`
|
|
262
|
+
(default `"Applied filters"`). This gives the region a landmark-like
|
|
263
|
+
announcement so a screen-reader user can tell the applied-filter summary apart
|
|
264
|
+
from the controls that produced it. Override `ariaLabel` to localize it or to
|
|
265
|
+
name the specific data set ("Applied workload filters").
|
|
266
|
+
- The **list** is a plain container with no role. It is deliberately not a
|
|
267
|
+
`list`/`listitem` structure: `Chip` renders a `<div>`, so imposing list
|
|
268
|
+
semantics would require the consumer to wrap every chip in an `<li>`, and the
|
|
269
|
+
chips are already individually announced through their remove buttons.
|
|
270
|
+
- Each **chip** is presentational apart from its remove button; that button
|
|
271
|
+
carries its own accessible name via Chip's `removeLabel`. Always give it a name
|
|
272
|
+
that identifies _which_ filter it removes ("Remove type filter") — a row of
|
|
273
|
+
buttons all named "Remove" is ambiguous out of context.
|
|
274
|
+
- The **reset** action is a native `<button type="button">` whose accessible name
|
|
275
|
+
is its visible label. It is not `aria-disabled`-only: when it is unavailable it
|
|
276
|
+
is really `disabled`, so it leaves the tab order.
|
|
277
|
+
|
|
278
|
+
## Keyboard
|
|
279
|
+
|
|
280
|
+
- The row adds no keyboard behavior of its own: it is a sequence of native
|
|
281
|
+
buttons in DOM order. `Tab` / `Shift+Tab` moves through each chip's remove
|
|
282
|
+
button and then the reset action; `Enter` / `Space` activates the focused
|
|
283
|
+
button.
|
|
284
|
+
- No arrow-key roving is implemented. The chips are independent controls rather
|
|
285
|
+
than a single composite widget, so the sequential tab order is the expected
|
|
286
|
+
pattern; adding roving focus would hide the remove buttons from users who
|
|
287
|
+
navigate by `Tab` alone.
|
|
288
|
+
- Removing the last chip in the list moves focus out of the removed element.
|
|
289
|
+
Consumers that clear filters one by one should move focus deliberately — to the
|
|
290
|
+
reset action, or to the filter trigger once the row empties — so focus never
|
|
291
|
+
lands on `<body>`.
|
|
292
|
+
|
|
293
|
+
## Screen reader
|
|
294
|
+
|
|
295
|
+
- Entering the region announces the group and its name, then each chip's label
|
|
296
|
+
followed by its remove button's name.
|
|
297
|
+
- Removals and resets are not announced by the component. A consumer whose result
|
|
298
|
+
set changes as a result should own that announcement (for example a live region
|
|
299
|
+
reporting the new result count), because only the consumer knows what the
|
|
300
|
+
filter change did.
|
|
301
|
+
|
|
302
|
+
## Focus visibility
|
|
303
|
+
|
|
304
|
+
- Focus indication comes from the composed parts: the chip shows the 3px
|
|
305
|
+
`--ui-focus-primary` ring around the whole pill when its remove button takes
|
|
306
|
+
focus (`focus-within`), and the reset button shows the same ring on
|
|
307
|
+
`focus-visible`. The row itself is not focusable and draws no ring.
|
|
308
|
+
|
|
309
|
+
## Contrast
|
|
310
|
+
|
|
311
|
+
- The row contributes no colors, so contrast is Chip's and Button's
|
|
312
|
+
responsibility. Both are verified in their own specs against WCAG 2.1 AA in
|
|
313
|
+
light and dark themes.
|
|
314
|
+
- The reset action is a ghost button — a text-only control. Its idle label color
|
|
315
|
+
(`--ui-button-ghost-label-color-idle`) must clear 4.5:1 against the surface the
|
|
316
|
+
row sits on, which is Button's contract; do not place the row on a custom
|
|
317
|
+
background that has not been checked against it.
|
|
318
|
+
|
|
319
|
+
## Right-to-left
|
|
320
|
+
|
|
321
|
+
- The row mirrors under `dir="rtl"` with no extra props: it uses logical flex
|
|
322
|
+
ordering only, and it contains no directional artwork. The chip's × is
|
|
323
|
+
direction-agnostic and must not be flipped.
|