@sableui/react 0.9.1 → 0.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/AGENTS.md +1 -1
- package/CHANGELOG.md +95 -0
- package/CONTRIBUTING.md +2 -2
- package/DESIGN.md +55 -16
- package/README.md +12 -0
- package/dist/{_contract-C2M1SjBf.d.ts → _contract-CkqXDVww.d.ts} +25 -2
- package/dist/blocks/danger-zone-block.js +3 -3
- package/dist/blocks/danger-zone-block.meta.js +1 -1
- package/dist/blocks/faq-block.js +3 -3
- package/dist/blocks/goal-progress-block.js +1 -1
- package/dist/blocks/notification-list-block.js +1 -1
- package/dist/blocks/pricing-table-block.js +12 -12
- package/dist/blocks/product-card-block.js +3 -3
- package/dist/blocks/product-card-block.meta.js +3 -3
- package/dist/blocks/profile-card-block.js +1 -1
- package/dist/blocks/profile-form-block.js +3 -3
- package/dist/blocks/revenue-breakdown-block.js +5 -5
- package/dist/blocks/stat-row-block.js +3 -3
- package/dist/blocks/task-list-block.js +2 -2
- package/dist/blocks/team-members-block.js +1 -1
- package/dist/blocks/wallet-block.js +4 -4
- package/dist/blocks/wallet-block.meta.js +3 -3
- package/dist/components/accordion/accordion.meta.js +2 -2
- package/dist/components/app-header/app-header.meta.js +1 -1
- package/dist/components/app-shell/app-shell.meta.js +2 -2
- package/dist/components/area-chart/area-chart.meta.js +3 -3
- package/dist/components/badge/badge.js +13 -4
- package/dist/components/badge/badge.meta.js +24 -13
- package/dist/components/badge/badge.variants.js +37 -23
- package/dist/components/banner/banner.meta.js +8 -8
- package/dist/components/banner/banner.variants.js +3 -3
- package/dist/components/bar-chart/bar-chart.meta.js +4 -4
- package/dist/components/breadcrumbs/breadcrumbs.meta.js +1 -1
- package/dist/components/button/button.meta.js +3 -3
- package/dist/components/card/card.js +16 -7
- package/dist/components/card/card.meta.js +4 -4
- package/dist/components/checkbox-card/checkbox-card.meta.js +10 -10
- package/dist/components/checkbox-card/checkbox-card.variants.js +15 -15
- package/dist/components/code-block/code-block.meta.js +1 -1
- package/dist/components/command-menu/command-menu.meta.js +1 -1
- package/dist/components/context-card/context-card.meta.js +2 -2
- package/dist/components/destructive-action-modal/destructive-action-modal.meta.js +1 -1
- package/dist/components/dialog/dialog.meta.js +2 -2
- package/dist/components/disclosure-picker/disclosure-picker.js +48 -2
- package/dist/components/disclosure-picker/disclosure-picker.meta.js +3 -2
- package/dist/components/empty-state/empty-state.meta.js +4 -4
- package/dist/components/gradient-art/gradient-art.meta.js +3 -3
- package/dist/components/label/label.meta.js +1 -1
- package/dist/components/line-chart/line-chart.meta.js +3 -3
- package/dist/components/meter/meter.js +1 -1
- package/dist/components/meter/meter.meta.js +2 -2
- package/dist/components/meter/meter.variants.js +1 -1
- package/dist/components/middle-truncate/middle-truncate.meta.js +4 -4
- package/dist/components/note/note.meta.js +3 -3
- package/dist/components/page-header/page-header.js +1 -1
- package/dist/components/pagination/pagination.meta.js +2 -2
- package/dist/components/phone/phone.meta.js +1 -1
- package/dist/components/pie-chart/pie-chart.meta.js +3 -3
- package/dist/components/pill/pill.js +4 -2
- package/dist/components/pill/pill.meta.js +19 -2
- package/dist/components/pill/pill.variants.js +23 -2
- package/dist/components/popover/popover.meta.js +2 -2
- package/dist/components/radar-chart/radar-chart.meta.js +3 -3
- package/dist/components/radial-chart/radial-chart.meta.js +3 -3
- package/dist/components/radio/radio.meta.js +2 -2
- package/dist/components/radio-card/radio-card.meta.js +6 -6
- package/dist/components/radio-card/radio-card.variants.js +15 -15
- package/dist/components/scroller/scroller.meta.js +1 -1
- package/dist/components/search-input/search-input.meta.js +1 -1
- package/dist/components/section-header/section-header.js +1 -1
- package/dist/components/segmented-bar/segmented-bar.js +1 -1
- package/dist/components/segmented-bar/segmented-bar.meta.js +6 -6
- package/dist/components/segmented-bar/segmented-bar.variants.js +4 -4
- package/dist/components/select/select.meta.js +2 -2
- package/dist/components/sheet/sheet.meta.js +1 -1
- package/dist/components/side-nav/side-nav.meta.js +1 -1
- package/dist/components/sidebar/sidebar.meta.js +1 -1
- package/dist/components/sparkline/sparkline.meta.js +4 -4
- package/dist/components/spinner/spinner.meta.js +1 -1
- package/dist/components/status-dot/status-dot.js +4 -1
- package/dist/components/status-dot/status-dot.meta.js +8 -16
- package/dist/components/status-dot/status-dot.variants.js +13 -4
- package/dist/components/table/table.meta.js +4 -4
- package/dist/components/tabs/tabs.meta.js +1 -1
- package/dist/components/textarea/textarea.meta.js +2 -2
- package/dist/components/toast/toast.meta.js +1 -1
- package/dist/components/tooltip/tooltip.meta.js +2 -2
- package/dist/file-hashes.json +120 -118
- package/dist/foundations/spacing.js +8 -8
- package/dist/index.d.ts +137 -72
- package/dist/index.js +12 -1
- package/dist/lib/chart/types.js +3 -3
- package/dist/lib/palette.js +103 -0
- package/dist/lib/selection-card.js +4 -4
- package/dist/palette.css +669 -0
- package/dist/patterns/auth-page.js +6 -6
- package/dist/patterns/auth-page.meta.js +3 -3
- package/dist/patterns/brand-landing-page.js +2 -2
- package/dist/patterns/chat-panel.js +2 -2
- package/dist/patterns/dashboard-page.js +71 -71
- package/dist/patterns/dashboard-page.meta.js +5 -5
- package/dist/patterns/feed-page.js +25 -25
- package/dist/patterns/feed-page.meta.js +3 -3
- package/dist/patterns/landing-page.js +1 -1
- package/dist/patterns/list-detail-page.js +17 -17
- package/dist/patterns/settings-page.js +17 -17
- package/dist/presets/index.d.ts +1 -1
- package/dist/presets/index.js +17 -2
- package/dist/styles.css +115 -50
- package/dist/{theme-provider-S0NVJs2Y.d.ts → theme-provider-CdSicAad.d.ts} +1 -1
- package/dist/themes/_contract.js +22 -8
- package/dist/themes/atelier/atelier.css +13 -13
- package/dist/themes/atelier/index.d.ts +1 -1
- package/dist/themes/ember/ember.css +13 -13
- package/dist/themes/ember/index.d.ts +1 -1
- package/dist/themes/index.d.ts +2 -2
- package/dist/themes/meridian/index.d.ts +1 -1
- package/dist/themes/meridian/meridian.css +13 -13
- package/dist/themes/poppy/index.d.ts +1 -1
- package/dist/themes/poppy/poppy.css +19 -16
- package/dist/themes/prism/index.d.ts +1 -1
- package/dist/themes/prism/prism.css +18 -15
- package/dist/themes/sable/index.d.ts +1 -1
- package/dist/themes/sable/sable.css +18 -22
- package/dist/themes/verdant/index.d.ts +1 -1
- package/dist/themes/verdant/verdant.css +15 -15
- package/llms/blocks/danger-zone-block.md +4 -4
- package/llms/blocks/faq-block.md +3 -3
- package/llms/blocks/goal-progress-block.md +1 -1
- package/llms/blocks/notification-list-block.md +1 -1
- package/llms/blocks/pricing-table-block.md +12 -12
- package/llms/blocks/product-card-block.md +6 -6
- package/llms/blocks/profile-card-block.md +1 -1
- package/llms/blocks/profile-form-block.md +3 -3
- package/llms/blocks/revenue-breakdown-block.md +5 -5
- package/llms/blocks/stat-row-block.md +3 -3
- package/llms/blocks/task-list-block.md +2 -2
- package/llms/blocks/team-members-block.md +1 -1
- package/llms/blocks/wallet-block.md +7 -7
- package/llms/components/accordion.md +2 -2
- package/llms/components/app-header.md +1 -1
- package/llms/components/app-shell.md +2 -2
- package/llms/components/area-chart.md +1 -1
- package/llms/components/badge.md +15 -7
- package/llms/components/banner.md +6 -6
- package/llms/components/bar-chart.md +2 -2
- package/llms/components/breadcrumbs.md +1 -1
- package/llms/components/button.md +3 -3
- package/llms/components/card.md +4 -4
- package/llms/components/checkbox-card.md +5 -5
- package/llms/components/code-block.md +1 -1
- package/llms/components/command-menu.md +1 -1
- package/llms/components/context-card.md +2 -2
- package/llms/components/destructive-action-modal.md +1 -1
- package/llms/components/dialog.md +2 -2
- package/llms/components/disclosure-picker.md +2 -1
- package/llms/components/empty-state.md +4 -4
- package/llms/components/gradient-art.md +3 -3
- package/llms/components/label.md +1 -1
- package/llms/components/line-chart.md +1 -1
- package/llms/components/meter.md +2 -2
- package/llms/components/middle-truncate.md +5 -5
- package/llms/components/note.md +3 -3
- package/llms/components/pagination.md +2 -2
- package/llms/components/phone.md +1 -1
- package/llms/components/pie-chart.md +1 -1
- package/llms/components/pill.md +12 -2
- package/llms/components/popover.md +2 -2
- package/llms/components/radar-chart.md +1 -1
- package/llms/components/radial-chart.md +1 -1
- package/llms/components/radio-card.md +4 -4
- package/llms/components/radio.md +2 -2
- package/llms/components/scroller.md +1 -1
- package/llms/components/search-input.md +1 -1
- package/llms/components/segmented-bar.md +7 -7
- package/llms/components/select.md +2 -2
- package/llms/components/sheet.md +1 -1
- package/llms/components/side-nav.md +1 -1
- package/llms/components/sidebar.md +1 -1
- package/llms/components/sparkline.md +2 -2
- package/llms/components/spinner.md +1 -1
- package/llms/components/status-dot.md +4 -4
- package/llms/components/table.md +8 -8
- package/llms/components/tabs.md +1 -1
- package/llms/components/textarea.md +2 -2
- package/llms/components/toast.md +1 -1
- package/llms/components/tooltip.md +2 -2
- package/llms/foundations/spacing.md +7 -7
- package/llms/layout/grid.md +1 -1
- package/llms/layout/page.md +1 -1
- package/llms/layout/region.md +1 -1
- package/llms/layout/split-pane.md +1 -1
- package/llms/patterns/auth-page.md +11 -11
- package/llms/patterns/brand-landing-page.md +2 -2
- package/llms/patterns/chat-panel.md +2 -2
- package/llms/patterns/dashboard-page.md +78 -78
- package/llms/patterns/feed-page.md +31 -31
- package/llms/patterns/landing-page.md +1 -1
- package/llms/patterns/list-detail-page.md +18 -18
- package/llms/patterns/settings-page.md +18 -18
- package/llms/reference/token-intent.md +25 -11
- package/llms/reference/utilities.md +1 -1
- package/llms/tasks/adding-a-component.md +4 -1
- package/llms/tasks/building-a-page.md +40 -0
- package/llms/tasks/converting-an-app.md +3 -1
- package/llms/tasks/using-presets.md +4 -0
- package/llms-full.txt +429 -347
- package/llms.txt +7 -7
- package/package.json +4 -4
- package/registry.json +369 -233
- package/scripts/lint-rules.mjs +26 -5
- package/skills/sable/SKILL.md +14 -3
|
@@ -179,11 +179,11 @@ var cardMeta = {
|
|
|
179
179
|
examples: [
|
|
180
180
|
{
|
|
181
181
|
label: "With parts",
|
|
182
|
-
code: '<Card><CardHeader><CardTitle>
|
|
182
|
+
code: '<Card><CardHeader><CardTitle>Studio plan</CardTitle><CardDescription>Up to 10 seats.</CardDescription></CardHeader><CardContent><p className="text-body-md">Every seat gets unlimited projects and shared reports.</p></CardContent></Card>'
|
|
183
183
|
},
|
|
184
184
|
{
|
|
185
185
|
label: "With a header action",
|
|
186
|
-
code: '<Card><CardHeader><CardTitle>
|
|
186
|
+
code: '<Card><CardHeader><CardTitle>Seats</CardTitle><CardAction><Button variant="ghost" size="icon-sm" aria-label="More"><Icon name="ellipsis" /></Button></CardAction></CardHeader><CardContent><p className="text-body-md text-muted-foreground">24 of 100 seats in use.</p></CardContent></Card>'
|
|
187
187
|
},
|
|
188
188
|
{
|
|
189
189
|
label: "Compact section panel",
|
|
@@ -191,7 +191,7 @@ var cardMeta = {
|
|
|
191
191
|
},
|
|
192
192
|
{
|
|
193
193
|
label: "Product card with actions",
|
|
194
|
-
code: '<Card><CardHeader><CardTitle>Midnight Archive</CardTitle><CardDescription>
|
|
194
|
+
code: '<Card><CardHeader><CardTitle>Midnight Archive</CardTitle><CardDescription>Template \xB7 24 pages</CardDescription><CardAction><Badge tone="1">New</Badge></CardAction></CardHeader><CardContent><p className="text-body-sm text-muted-foreground">A project template with a brief, a timeline and a review board.</p></CardContent><CardFooter><Button size="sm">Use template</Button><Button size="sm" variant="ghost">Preview</Button></CardFooter></Card>'
|
|
195
195
|
},
|
|
196
196
|
{
|
|
197
197
|
label: "Whole card as a link",
|
|
@@ -199,7 +199,7 @@ var cardMeta = {
|
|
|
199
199
|
},
|
|
200
200
|
{
|
|
201
201
|
label: "Metric card",
|
|
202
|
-
code: '<Card density="compact"><CardHeader><CardTitle>Revenue</CardTitle><CardDescription>Last 30 days</CardDescription></CardHeader><CardContent><p className="text-heading-3"
|
|
202
|
+
code: '<Card density="compact"><CardHeader><CardTitle>Revenue</CardTitle><CardDescription>Last 30 days</CardDescription></CardHeader><CardContent><p className="text-heading-3">$12,840</p><p className="text-body-sm text-success">+12.8% from previous period</p></CardContent></Card>'
|
|
203
203
|
},
|
|
204
204
|
{
|
|
205
205
|
label: "List card",
|
|
@@ -79,7 +79,7 @@ var checkboxCardMeta = {
|
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
81
|
name: "tone",
|
|
82
|
-
type: '"neutral" | "
|
|
82
|
+
type: '"neutral" | "3" | "2" | "1" | "info" | "warning"',
|
|
83
83
|
default: '"neutral"',
|
|
84
84
|
description: "Semantic colour the checked state carries across the border, checkbox box, and icon."
|
|
85
85
|
},
|
|
@@ -102,7 +102,7 @@ var checkboxCardMeta = {
|
|
|
102
102
|
}
|
|
103
103
|
],
|
|
104
104
|
variants: {
|
|
105
|
-
tone: ["neutral", "
|
|
105
|
+
tone: ["neutral", "3", "2", "1", "info", "warning"]
|
|
106
106
|
},
|
|
107
107
|
tokensUsed: [
|
|
108
108
|
"input",
|
|
@@ -113,12 +113,12 @@ var checkboxCardMeta = {
|
|
|
113
113
|
"accent",
|
|
114
114
|
"foreground",
|
|
115
115
|
"muted-foreground",
|
|
116
|
-
"tone-
|
|
117
|
-
"tone-
|
|
118
|
-
"tone-
|
|
119
|
-
"tone-
|
|
120
|
-
"tone-
|
|
121
|
-
"tone-
|
|
116
|
+
"tone-3",
|
|
117
|
+
"tone-3-foreground",
|
|
118
|
+
"tone-2",
|
|
119
|
+
"tone-2-foreground",
|
|
120
|
+
"tone-1",
|
|
121
|
+
"tone-1-foreground",
|
|
122
122
|
"tone-info",
|
|
123
123
|
"tone-info-foreground",
|
|
124
124
|
"tone-warning",
|
|
@@ -141,11 +141,11 @@ var checkboxCardMeta = {
|
|
|
141
141
|
},
|
|
142
142
|
{
|
|
143
143
|
label: "A single independent card",
|
|
144
|
-
code: '<CheckboxCard title="Email me a receipt" description="Sent when the
|
|
144
|
+
code: '<CheckboxCard title="Email me a receipt" description="Sent when the payment settles" checked={receipt} onCheckedChange={setReceipt} />'
|
|
145
145
|
},
|
|
146
146
|
{
|
|
147
147
|
label: "Toned with description",
|
|
148
|
-
code: '<CheckboxCard tone="
|
|
148
|
+
code: '<CheckboxCard tone="1" title="Reports" description="Weekly usage reports by email" defaultChecked />'
|
|
149
149
|
}
|
|
150
150
|
]
|
|
151
151
|
};
|
|
@@ -7,23 +7,23 @@ var checkboxCardToneClasses = {
|
|
|
7
7
|
check: "text-primary-foreground",
|
|
8
8
|
glyph: "text-foreground"
|
|
9
9
|
},
|
|
10
|
-
|
|
11
|
-
card: SELECTION_CARD_CHECKED
|
|
12
|
-
box: "group-data-[checked]:border-tone-
|
|
13
|
-
check: "text-tone-
|
|
14
|
-
glyph: "text-tone-
|
|
10
|
+
"3": {
|
|
11
|
+
card: SELECTION_CARD_CHECKED["3"],
|
|
12
|
+
box: "group-data-[checked]:border-tone-3 group-data-[checked]:bg-tone-3 group-data-[indeterminate]:border-tone-3 group-data-[indeterminate]:bg-tone-3",
|
|
13
|
+
check: "text-tone-3-foreground",
|
|
14
|
+
glyph: "text-tone-3"
|
|
15
15
|
},
|
|
16
|
-
|
|
17
|
-
card: SELECTION_CARD_CHECKED
|
|
18
|
-
box: "group-data-[checked]:border-tone-
|
|
19
|
-
check: "text-tone-
|
|
20
|
-
glyph: "text-tone-
|
|
16
|
+
"2": {
|
|
17
|
+
card: SELECTION_CARD_CHECKED["2"],
|
|
18
|
+
box: "group-data-[checked]:border-tone-2 group-data-[checked]:bg-tone-2 group-data-[indeterminate]:border-tone-2 group-data-[indeterminate]:bg-tone-2",
|
|
19
|
+
check: "text-tone-2-foreground",
|
|
20
|
+
glyph: "text-tone-2"
|
|
21
21
|
},
|
|
22
|
-
|
|
23
|
-
card: SELECTION_CARD_CHECKED
|
|
24
|
-
box: "group-data-[checked]:border-tone-
|
|
25
|
-
check: "text-tone-
|
|
26
|
-
glyph: "text-tone-
|
|
22
|
+
"1": {
|
|
23
|
+
card: SELECTION_CARD_CHECKED["1"],
|
|
24
|
+
box: "group-data-[checked]:border-tone-1 group-data-[checked]:bg-tone-1 group-data-[indeterminate]:border-tone-1 group-data-[indeterminate]:bg-tone-1",
|
|
25
|
+
check: "text-tone-1-foreground",
|
|
26
|
+
glyph: "text-tone-1"
|
|
27
27
|
},
|
|
28
28
|
info: {
|
|
29
29
|
card: SELECTION_CARD_CHECKED.info,
|
|
@@ -26,7 +26,7 @@ var codeBlockMeta = {
|
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
guidance: "do",
|
|
29
|
-
description: "Wire highlighting once with CodeHighlightProvider and map token colors to semantic tone tokens (keywords \u2192 tone-
|
|
29
|
+
description: "Wire highlighting once with CodeHighlightProvider and map token colors to semantic tone tokens (keywords \u2192 tone-1, strings \u2192 success, comments \u2192 muted-foreground), so code follows the theme instead of a fixed palette."
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
guidance: "dont",
|
|
@@ -250,7 +250,7 @@ var commandMenuMeta = {
|
|
|
250
250
|
},
|
|
251
251
|
{
|
|
252
252
|
label: "Grouped launcher",
|
|
253
|
-
code: '<CommandMenu open={open} onOpenChange={setOpen}><CommandMenuGroup label="Create"><CommandMenuItem icon="plus" onSelect={() => createPost()}>New post</CommandMenuItem><CommandMenuItem icon="sparkles" onSelect={() =>
|
|
253
|
+
code: '<CommandMenu open={open} onOpenChange={setOpen}><CommandMenuGroup label="Create"><CommandMenuItem icon="plus" onSelect={() => createPost()}>New post</CommandMenuItem><CommandMenuItem icon="sparkles" onSelect={() => createProject()}>New project</CommandMenuItem></CommandMenuGroup><CommandMenuGroup label="Navigation"><CommandMenuItem icon="home" onSelect={() => navigate("/")}>Home</CommandMenuItem><CommandMenuItem icon="gear" onSelect={() => navigate("/settings")}>Settings</CommandMenuItem></CommandMenuGroup></CommandMenu>'
|
|
254
254
|
},
|
|
255
255
|
{
|
|
256
256
|
label: "Consumer-owned ranking",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/components/context-card/context-card.meta.ts
|
|
2
2
|
var contextCardMeta = {
|
|
3
3
|
name: "ContextCard",
|
|
4
|
-
summary: "Hover/focus-triggered rich preview card over Base UI PreviewCard. Reveals contextual content (a profile,
|
|
4
|
+
summary: "Hover/focus-triggered rich preview card over Base UI PreviewCard. Reveals contextual content (a profile, a project summary) from an inline anchor; 20rem-wide surface with delayed open and collision-aware positioning.",
|
|
5
5
|
status: "stable",
|
|
6
6
|
keywords: [
|
|
7
7
|
"context card",
|
|
@@ -93,7 +93,7 @@ var contextCardMeta = {
|
|
|
93
93
|
examples: [
|
|
94
94
|
{
|
|
95
95
|
label: "Profile preview",
|
|
96
|
-
code: "<ContextCard><ContextCardTrigger render={<a href='/u/ada' className='text-title-sm underline-offset-2 hover:underline'>@ada</a>} /><ContextCardContent><Entity className='[--entity-px:0] [--entity-py:0]' leading={<Avatar fallback='AL' size='lg' />} title='Ada Lovelace' subtitle='@ada' /><p className='mt-3 text-body-sm text-muted-foreground'>
|
|
96
|
+
code: "<ContextCard><ContextCardTrigger render={<a href='/u/ada' className='text-title-sm underline-offset-2 hover:underline'>@ada</a>} /><ContextCardContent><Entity className='[--entity-px:0] [--entity-py:0]' leading={<Avatar fallback='AL' size='lg' />} title='Ada Lovelace' subtitle='@ada' /><p className='mt-3 text-body-sm text-muted-foreground'>Product designer. Building tools for small teams.</p></ContextCardContent></ContextCard>"
|
|
97
97
|
},
|
|
98
98
|
{
|
|
99
99
|
label: "With stat row",
|
|
@@ -127,7 +127,7 @@ var destructiveActionModalMeta = {
|
|
|
127
127
|
},
|
|
128
128
|
{
|
|
129
129
|
label: "Body slot + type-to-confirm",
|
|
130
|
-
code: "<DestructiveActionModal open={open} onOpenChange={setOpen} title='Delete this post?' confirmText='gold rush' confirmLabel='Delete forever' onConfirm={handleDelete}><Note tone='warning'>
|
|
130
|
+
code: "<DestructiveActionModal open={open} onOpenChange={setOpen} title='Delete this post?' confirmText='gold rush' confirmLabel='Delete forever' onConfirm={handleDelete}><Note tone='warning'>People you shared this post with lose access to it.</Note></DestructiveActionModal>"
|
|
131
131
|
}
|
|
132
132
|
]
|
|
133
133
|
};
|
|
@@ -222,7 +222,7 @@ var dialogMeta = {
|
|
|
222
222
|
},
|
|
223
223
|
{
|
|
224
224
|
label: "Basic",
|
|
225
|
-
code: '<Dialog><DialogTrigger render={<Button>Open</Button>} /><DialogContent><DialogHeader><DialogTitle>
|
|
225
|
+
code: '<Dialog><DialogTrigger render={<Button>Open</Button>} /><DialogContent><DialogHeader><DialogTitle>Plan details</DialogTitle><DialogDescription>Up to 10 seats, billed monthly per seat.</DialogDescription></DialogHeader><DialogFooter><DialogClose render={<Button variant="secondary">Close</Button>} /><DialogClose render={<Button>Upgrade</Button>} /></DialogFooter></DialogContent></Dialog>'
|
|
226
226
|
},
|
|
227
227
|
{
|
|
228
228
|
label: "Settings form",
|
|
@@ -230,7 +230,7 @@ var dialogMeta = {
|
|
|
230
230
|
},
|
|
231
231
|
{
|
|
232
232
|
label: "Destructive confirmation",
|
|
233
|
-
code: '<AlertDialog><AlertDialogTrigger render={<Button variant="destructive">Delete
|
|
233
|
+
code: '<AlertDialog><AlertDialogTrigger render={<Button variant="destructive">Delete project</Button>} /><AlertDialogContent><AlertDialogHeader><AlertDialogTitle>Delete project?</AlertDialogTitle><AlertDialogDescription>This removes the project and cannot be undone.</AlertDialogDescription></AlertDialogHeader><AlertDialogFooter><AlertDialogClose render={<Button variant="secondary">Cancel</Button>} /><Button variant="destructive" onClick={deleteProject}>Delete project</Button></AlertDialogFooter></AlertDialogContent></AlertDialog>'
|
|
234
234
|
}
|
|
235
235
|
]
|
|
236
236
|
};
|
|
@@ -361,7 +361,10 @@ function DisclosurePickerOption({
|
|
|
361
361
|
note,
|
|
362
362
|
disabled = false,
|
|
363
363
|
textValue,
|
|
364
|
+
onRemove,
|
|
365
|
+
removeLabel = "Remove",
|
|
364
366
|
className,
|
|
367
|
+
ref,
|
|
365
368
|
onClick,
|
|
366
369
|
...props
|
|
367
370
|
}) {
|
|
@@ -369,13 +372,27 @@ function DisclosurePickerOption({
|
|
|
369
372
|
if (!list) throw new Error("<DisclosurePickerOption> must be rendered inside <DisclosurePickerList>.");
|
|
370
373
|
const { size, pick } = list;
|
|
371
374
|
const selected = list.value === value;
|
|
375
|
+
const optionRef = useRef(null);
|
|
376
|
+
const remove = () => {
|
|
377
|
+
const option = optionRef.current;
|
|
378
|
+
const options = [...option?.closest('[role="listbox"]')?.querySelectorAll(ENABLED_OPTION) ?? []];
|
|
379
|
+
const index = option ? options.indexOf(option) : -1;
|
|
380
|
+
if (option?.contains(document.activeElement)) moveTo(options[index + 1] ?? options[index - 1]);
|
|
381
|
+
onRemove?.();
|
|
382
|
+
};
|
|
372
383
|
return /* @__PURE__ */ jsxs(
|
|
373
384
|
"div",
|
|
374
385
|
{
|
|
375
386
|
...props,
|
|
387
|
+
ref: (node) => {
|
|
388
|
+
optionRef.current = node;
|
|
389
|
+
if (typeof ref === "function") ref(node);
|
|
390
|
+
else if (ref) ref.current = node;
|
|
391
|
+
},
|
|
376
392
|
role: "option",
|
|
377
393
|
"aria-selected": selected,
|
|
378
394
|
"aria-disabled": disabled || void 0,
|
|
395
|
+
"aria-keyshortcuts": onRemove ? "Delete" : void 0,
|
|
379
396
|
"data-value": value,
|
|
380
397
|
"data-text-value": textValue,
|
|
381
398
|
"data-selected": selected ? "" : void 0,
|
|
@@ -383,8 +400,13 @@ function DisclosurePickerOption({
|
|
|
383
400
|
onClick?.(event);
|
|
384
401
|
if (!event.defaultPrevented && !disabled) pick(value);
|
|
385
402
|
},
|
|
403
|
+
onKeyDown: onRemove ? (event) => {
|
|
404
|
+
if (event.key !== "Delete" && event.key !== "Backspace") return;
|
|
405
|
+
event.preventDefault();
|
|
406
|
+
remove();
|
|
407
|
+
} : void 0,
|
|
386
408
|
className: cn(
|
|
387
|
-
"flex items-center gap-3 rounded-sm px-(--item-px) text-start motion-interactive",
|
|
409
|
+
"group/option flex items-center gap-3 rounded-sm px-(--item-px) text-start motion-interactive",
|
|
388
410
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring aria-disabled:cursor-not-allowed aria-disabled:opacity-50",
|
|
389
411
|
size === "xs" ? "min-h-(--control-xs)" : "min-h-(--control-sm) py-1",
|
|
390
412
|
// Chosen: lifted out of the well, like a segmented control's knob.
|
|
@@ -396,7 +418,31 @@ function DisclosurePickerOption({
|
|
|
396
418
|
media != null ? /* @__PURE__ */ jsx("span", { className: "flex shrink-0 items-center", children: media }) : null,
|
|
397
419
|
/* @__PURE__ */ jsx("span", { "data-disclosure-picker-label": "", className: cn("min-w-0 truncate", size === "xs" ? "text-ui-md" : "text-body-md"), children })
|
|
398
420
|
] }),
|
|
399
|
-
note != null ? /* @__PURE__ */ jsx("span", { className: cn("shrink-0 text-muted-foreground", size === "xs" ? "text-ui-sm" : "text-caption"), children: note }) : selected ? /* @__PURE__ */ jsx(Icon, { name: "check", className: "shrink-0 text-sm" }) : null
|
|
421
|
+
note != null ? /* @__PURE__ */ jsx("span", { className: cn("shrink-0 text-muted-foreground", size === "xs" ? "text-ui-sm" : "text-caption"), children: note }) : selected ? /* @__PURE__ */ jsx(Icon, { name: "check", className: "shrink-0 text-sm" }) : null,
|
|
422
|
+
onRemove ? (
|
|
423
|
+
// A pointer target, not a control: an option's children are presentational,
|
|
424
|
+
// so a nested button would be invisible to assistive tech. The keyboard
|
|
425
|
+
// path is Delete on the row, announced through aria-keyshortcuts.
|
|
426
|
+
// design-lint-disable-next-line clickable-static -- pointer twin of Delete on the focused option; a button cannot live inside role="option"
|
|
427
|
+
/* @__PURE__ */ jsx(
|
|
428
|
+
"span",
|
|
429
|
+
{
|
|
430
|
+
"aria-hidden": "true",
|
|
431
|
+
title: removeLabel,
|
|
432
|
+
"data-disclosure-picker-remove": "",
|
|
433
|
+
onClick: (event) => {
|
|
434
|
+
event.preventDefault();
|
|
435
|
+
remove();
|
|
436
|
+
},
|
|
437
|
+
className: cn(
|
|
438
|
+
"-me-1 flex shrink-0 cursor-pointer items-center justify-center rounded-xs text-muted-foreground motion-interactive hover:text-destructive",
|
|
439
|
+
size === "xs" ? "size-5 text-xs" : "size-6 text-sm",
|
|
440
|
+
"opacity-0 group-hover/option:opacity-100 group-focus-visible/option:opacity-100 pointer-coarse:opacity-100"
|
|
441
|
+
),
|
|
442
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "trash" })
|
|
443
|
+
}
|
|
444
|
+
)
|
|
445
|
+
) : null
|
|
400
446
|
]
|
|
401
447
|
}
|
|
402
448
|
);
|
|
@@ -100,8 +100,8 @@ var disclosurePickerMeta = {
|
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
name: "DisclosurePickerOption",
|
|
103
|
-
type: "{ value: string; children?: ReactNode; media?: ReactNode; note?: ReactNode; disabled?: boolean; textValue?: string }",
|
|
104
|
-
description: "One option row. `media` is a leading visual (a ThemePreview tile); `note` a muted trailing annotation \u2014 options without one show a check when chosen. `disabled` skips it for the keyboard and refuses the pick; `textValue` is what type-ahead matches when the name is not plain text."
|
|
103
|
+
type: "{ value: string; children?: ReactNode; media?: ReactNode; note?: ReactNode; disabled?: boolean; textValue?: string; onRemove?: () => void; removeLabel?: string }",
|
|
104
|
+
description: "One option row. `media` is a leading visual (a ThemePreview tile); `note` a muted trailing annotation \u2014 options without one show a check when chosen. `disabled` skips it for the keyboard and refuses the pick; `textValue` is what type-ahead matches when the name is not plain text. `onRemove` makes the option removable \u2014 for entries the person added (an imported preset, a saved font): a trash glyph at the row's end on hover or focus (always on touch), and Delete or Backspace on the focused row; removing never picks, and focus moves to a neighbour first. `removeLabel` is the glyph's tooltip."
|
|
105
105
|
},
|
|
106
106
|
{ name: "DisclosurePickerEmpty", type: "{ children?: ReactNode }", description: "The no-match line, rendered in place of the list." },
|
|
107
107
|
{
|
|
@@ -117,6 +117,7 @@ var disclosurePickerMeta = {
|
|
|
117
117
|
"Why a listbox and not a radio group: a radio group's checked state follows focus, so every arrow press would be a pick \u2014 wrong for a choice that opens a confirm, loads a font or resets settings. Base UI ships no standalone listbox (Select is popup-only, Combobox's inline list is focus-in-the-input, Composite is internal), so the keyboard model lives here.",
|
|
118
118
|
"Opening from the keyboard (Enter, Space, ArrowDown) moves focus into the panel: the search field when there is one, otherwise the chosen option (or the first). A pointer open focuses the search field on a fine pointer only, so touch does not raise the on-screen keyboard.",
|
|
119
119
|
"Escape closes the row without changing the value (clearing a query first) and returns focus to the trigger; a pick does the same. Focus is not pulled back when it has already moved on, e.g. to a confirm dialog the pick opened.",
|
|
120
|
+
`A removable option (onRemove) announces aria-keyshortcuts="Delete"; Delete or Backspace removes it and focus moves to the next option (or the previous). The trash glyph is a pointer target only (aria-hidden, not focusable): an option's children are presentational, so a nested button would be unreachable by assistive tech anyway.`,
|
|
120
121
|
"The panel animates with motion-disclosure, which is static under prefers-reduced-motion or MotionProvider off; the scroll that keeps the row in view is instant, never smooth."
|
|
121
122
|
],
|
|
122
123
|
motion: [
|
|
@@ -16,7 +16,7 @@ var emptyStateMeta = {
|
|
|
16
16
|
bestPractices: [
|
|
17
17
|
{
|
|
18
18
|
guidance: "do",
|
|
19
|
-
description: 'Explain what is empty in plain language, such as "No posts yet" or "No matching
|
|
19
|
+
description: 'Explain what is empty in plain language, such as "No posts yet" or "No matching customers".'
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
guidance: "do",
|
|
@@ -137,7 +137,7 @@ var emptyStateMeta = {
|
|
|
137
137
|
},
|
|
138
138
|
{
|
|
139
139
|
label: "First-run setup",
|
|
140
|
-
code: '<EmptyState surface="card" icon={<Icon name="sparkles" />} title="Start your
|
|
140
|
+
code: '<EmptyState surface="card" icon={<Icon name="sparkles" />} title="Start your first project" description="Create a project, import one from a file, or invite collaborators." action={<Row gap={1}><Button>Create project</Button><Button variant="ghost">Import</Button></Row>} />'
|
|
141
141
|
},
|
|
142
142
|
{
|
|
143
143
|
label: "Page-level error",
|
|
@@ -145,11 +145,11 @@ var emptyStateMeta = {
|
|
|
145
145
|
},
|
|
146
146
|
{
|
|
147
147
|
label: "Error card",
|
|
148
|
-
code: '<EmptyState tone="destructive" surface="card" title="Could not load this
|
|
148
|
+
code: '<EmptyState tone="destructive" surface="card" title="Could not load this project" description="Check your connection and try again." action={<Button variant="secondary">Retry</Button>} />'
|
|
149
149
|
},
|
|
150
150
|
{
|
|
151
151
|
label: "Empty table body",
|
|
152
|
-
code: '<DataTable data={[]} columns={[{ key: "name", header: "
|
|
152
|
+
code: '<DataTable data={[]} columns={[{ key: "name", header: "Customer" }, { key: "status", header: "Status" }]} empty={<EmptyState title="No customers yet" description="Customers appear here after the first order." />} />'
|
|
153
153
|
}
|
|
154
154
|
]
|
|
155
155
|
};
|
|
@@ -38,7 +38,7 @@ var gradientArtMeta = {
|
|
|
38
38
|
{ name: "variant", type: '"mesh" | "grain"', default: '"mesh"', description: "mesh: soft spots of colour pulled together by gentle waves. grain: glowing light over deep corners with a printed texture." },
|
|
39
39
|
{
|
|
40
40
|
name: "tones",
|
|
41
|
-
type: '("info" | "
|
|
41
|
+
type: '("info" | "3" | "2" | "1" | "warning")[]',
|
|
42
42
|
description: "Paint these `--tone-*` colours instead of the preset's art palette. Leave unset to follow the preset's art direction."
|
|
43
43
|
},
|
|
44
44
|
{ name: "seed", type: "string | number", description: "Fixes the composition: the same seed paints the same art in every theme. Pass a stable id." },
|
|
@@ -46,7 +46,7 @@ var gradientArtMeta = {
|
|
|
46
46
|
{ name: "className", type: "string", description: "Size and shape: aspect, height, rounding." }
|
|
47
47
|
],
|
|
48
48
|
variants: { variant: ["mesh", "grain"] },
|
|
49
|
-
tokensUsed: ["art-1", "art-2", "art-3", "art-4", "art-5", "art-6", "art-ground", "art-warp", "art-softness", "art-grain", "primary", "tone-info", "tone-
|
|
49
|
+
tokensUsed: ["art-1", "art-2", "art-3", "art-4", "art-5", "art-6", "art-ground", "art-warp", "art-softness", "art-grain", "primary", "tone-info", "tone-3", "tone-2", "tone-1", "tone-warning"],
|
|
50
50
|
motion: [
|
|
51
51
|
{
|
|
52
52
|
slot: "arrival",
|
|
@@ -69,7 +69,7 @@ var gradientArtMeta = {
|
|
|
69
69
|
],
|
|
70
70
|
examples: [
|
|
71
71
|
{ label: "Product cover", code: '<GradientArt seed="Untitled (gold rush)" className="aspect-[4/3] rounded-lg" />' },
|
|
72
|
-
{ label: "Grain banner", code: '<GradientArt variant="grain" seed="juno" tones={["info", "
|
|
72
|
+
{ label: "Grain banner", code: '<GradientArt variant="grain" seed="juno" tones={["info", "1"]} className="h-20 rounded-md" />' },
|
|
73
73
|
{
|
|
74
74
|
label: "Avatar with initials",
|
|
75
75
|
code: '<GradientArt seed="Mara Okafor" className="grid size-10 place-items-center rounded-full text-label-md text-overlay-foreground">MO</GradientArt>'
|
|
@@ -89,7 +89,7 @@ var labelMeta = {
|
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
91
|
label: "With hint",
|
|
92
|
-
code: '<Label htmlFor="
|
|
92
|
+
code: '<Label htmlFor="discount" hint="Taken off every order this code is used on.">Discount</Label>'
|
|
93
93
|
}
|
|
94
94
|
]
|
|
95
95
|
};
|
|
@@ -13,7 +13,7 @@ var ToneContext = createContext("primary");
|
|
|
13
13
|
var SizeContext = createContext(void 0);
|
|
14
14
|
var RING_TONE_STROKE = {
|
|
15
15
|
primary: "var(--primary)",
|
|
16
|
-
|
|
16
|
+
"3": "var(--tone-3)",
|
|
17
17
|
success: "var(--success)",
|
|
18
18
|
warning: "var(--tone-warning)",
|
|
19
19
|
destructive: "var(--destructive)"
|
|
@@ -83,7 +83,7 @@ var meterMeta = {
|
|
|
83
83
|
},
|
|
84
84
|
{
|
|
85
85
|
name: "tone",
|
|
86
|
-
type: '"primary" | "
|
|
86
|
+
type: '"primary" | "3" | "success" | "warning" | "destructive"',
|
|
87
87
|
default: '"primary"',
|
|
88
88
|
description: "Fill colour, mapped to a semantic token. Choose it from your own thresholds."
|
|
89
89
|
},
|
|
@@ -149,7 +149,7 @@ var meterMeta = {
|
|
|
149
149
|
}
|
|
150
150
|
],
|
|
151
151
|
variants: {
|
|
152
|
-
tone: ["primary", "
|
|
152
|
+
tone: ["primary", "3", "success", "warning", "destructive"],
|
|
153
153
|
shape: ["bar", "ring"],
|
|
154
154
|
size: ["sm", "md", "lg"]
|
|
155
155
|
},
|
|
@@ -59,16 +59,16 @@ var middleTruncateMeta = {
|
|
|
59
59
|
],
|
|
60
60
|
examples: [
|
|
61
61
|
{
|
|
62
|
-
label: "
|
|
63
|
-
code: '<MiddleTruncate text="
|
|
62
|
+
label: "API key",
|
|
63
|
+
code: '<MiddleTruncate text="demo_key_7f3a9c2e5b8d1f4a6c0e9b3d7a2f5c8e1b4" />'
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
66
|
label: "Custom start/end counts",
|
|
67
|
-
code: '<MiddleTruncate text="
|
|
67
|
+
code: '<MiddleTruncate text="9f2c4e7a1b3d5f60c8e2a4b6d8f0e1c3a5b7d9f2" startChars={4} endChars={4} />'
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
70
|
label: "Copyable value",
|
|
71
|
-
code: 'const { copy, copied } = useCopy(
|
|
71
|
+
code: 'const { copy, copied } = useCopy(commitHash)\n<Row gap={1}><MiddleTruncate text={commitHash} /><Button variant="ghost" size="icon-xs" aria-label="Copy commit hash" onClick={copy}><Icon name={copied ? "check" : "copy"} /></Button></Row>'
|
|
72
72
|
}
|
|
73
73
|
]
|
|
74
74
|
};
|
|
@@ -91,11 +91,11 @@ var noteMeta = {
|
|
|
91
91
|
examples: [
|
|
92
92
|
{
|
|
93
93
|
label: "Info",
|
|
94
|
-
code: '<Note tone="info">
|
|
94
|
+
code: '<Note tone="info">Reports refresh every hour.</Note>'
|
|
95
95
|
},
|
|
96
96
|
{
|
|
97
97
|
label: "With title",
|
|
98
|
-
code: '<Note tone="warning" title="Low balance">
|
|
98
|
+
code: '<Note tone="warning" title="Low balance">Add credits before your next export.</Note>'
|
|
99
99
|
},
|
|
100
100
|
{
|
|
101
101
|
label: "Warning with a remedy, inside a dialog",
|
|
@@ -103,7 +103,7 @@ var noteMeta = {
|
|
|
103
103
|
},
|
|
104
104
|
{
|
|
105
105
|
label: "Custom icon",
|
|
106
|
-
code: '<Note tone="neutral" icon="lock">Pricing
|
|
106
|
+
code: '<Note tone="neutral" icon="lock">Pricing cannot be changed after an order is placed.</Note>'
|
|
107
107
|
}
|
|
108
108
|
]
|
|
109
109
|
};
|
|
@@ -12,7 +12,7 @@ function PageHeader({
|
|
|
12
12
|
children,
|
|
13
13
|
...props
|
|
14
14
|
}) {
|
|
15
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-
|
|
15
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-2 pb-4", className), ...props, children: [
|
|
16
16
|
/* @__PURE__ */ jsx(
|
|
17
17
|
HeadingRow,
|
|
18
18
|
{
|
|
@@ -21,7 +21,7 @@ var paginationMeta = {
|
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
guidance: "do",
|
|
24
|
-
description: 'Use a specific label when multiple pagers appear on a page, such as "
|
|
24
|
+
description: 'Use a specific label when multiple pagers appear on a page, such as "Customer pages".'
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
guidance: "do",
|
|
@@ -128,7 +128,7 @@ var paginationMeta = {
|
|
|
128
128
|
},
|
|
129
129
|
{
|
|
130
130
|
label: "Table results footer",
|
|
131
|
-
code: '<Stack gap={2}><DataTable data={rows} columns={columns} rowKey={(row) => row.id} /><Pagination label="
|
|
131
|
+
code: '<Stack gap={2}><DataTable data={rows} columns={columns} rowKey={(row) => row.id} /><Pagination label="Customer pages" page={page} total={12} onPageChange={setPage} /></Stack>'
|
|
132
132
|
},
|
|
133
133
|
{
|
|
134
134
|
label: "Server query state",
|
|
@@ -67,7 +67,7 @@ var phoneMeta = {
|
|
|
67
67
|
examples: [
|
|
68
68
|
{
|
|
69
69
|
label: "Framing a mobile layout",
|
|
70
|
-
code: '<Phone><div className="p-4"><h2 className="text-title-lg">Activity</h2><p className="text-body-sm text-muted-foreground">3 new
|
|
70
|
+
code: '<Phone><div className="p-4"><h2 className="text-title-lg">Activity</h2><p className="text-body-sm text-muted-foreground">3 new orders today.</p></div></Phone>'
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
73
|
label: "Mockup, not a responsive preview",
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
// src/components/pill/pill.tsx
|
|
2
2
|
import { cn } from "../../lib/cn.js";
|
|
3
|
+
import { isPaletteColor } from "../../lib/palette.js";
|
|
3
4
|
import { trimLabel } from "../../lib/trim-label.js";
|
|
4
5
|
import { pillVariants } from "./pill.variants.js";
|
|
5
6
|
import { jsxs } from "react/jsx-runtime";
|
|
6
|
-
function Pill({ selected = false, appearance, size, icon, className, children, type, ...props }) {
|
|
7
|
+
function Pill({ selected = false, appearance, size, tone, icon, className, children, type, ...props }) {
|
|
7
8
|
return /* @__PURE__ */ jsxs(
|
|
8
9
|
"button",
|
|
9
10
|
{
|
|
10
11
|
type: type ?? "button",
|
|
11
12
|
"aria-pressed": selected,
|
|
12
|
-
|
|
13
|
+
"data-palette": isPaletteColor(tone) ? tone : void 0,
|
|
14
|
+
className: cn(pillVariants({ appearance, size, selected, tone }), className),
|
|
13
15
|
...props,
|
|
14
16
|
children: [
|
|
15
17
|
icon,
|
|
@@ -61,6 +61,12 @@ var pillMeta = {
|
|
|
61
61
|
default: '"md"',
|
|
62
62
|
description: "md sits on the density ladder's xs control height (28px); sm is 24px, for chips under or inside other content."
|
|
63
63
|
},
|
|
64
|
+
{
|
|
65
|
+
name: "tone",
|
|
66
|
+
type: '"neutral" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "purple" | "pink"',
|
|
67
|
+
default: '"neutral"',
|
|
68
|
+
description: "neutral is the chip as described. A palette family colours it as a category, like the choices in a tag picker: a wash at rest, the solid family colour when selected. Painted from the theme's generated palette."
|
|
69
|
+
},
|
|
64
70
|
{
|
|
65
71
|
name: "icon",
|
|
66
72
|
type: "ReactNode",
|
|
@@ -70,9 +76,16 @@ var pillMeta = {
|
|
|
70
76
|
variants: {
|
|
71
77
|
appearance: ["solid", "outline"],
|
|
72
78
|
size: ["md", "sm"],
|
|
73
|
-
selected: ["true", "false"]
|
|
79
|
+
selected: ["true", "false"],
|
|
80
|
+
tone: ["neutral", "red", "orange", "yellow", "green", "teal", "blue", "purple", "pink"]
|
|
74
81
|
},
|
|
75
82
|
tokensUsed: [
|
|
83
|
+
"palette-wash",
|
|
84
|
+
"palette-wash-strong",
|
|
85
|
+
"palette-edge",
|
|
86
|
+
"palette-solid",
|
|
87
|
+
"palette-text",
|
|
88
|
+
"palette-solid-ink",
|
|
76
89
|
"secondary",
|
|
77
90
|
"secondary-foreground",
|
|
78
91
|
"accent",
|
|
@@ -89,9 +102,13 @@ var pillMeta = {
|
|
|
89
102
|
"Selected state is exposed via aria-pressed."
|
|
90
103
|
],
|
|
91
104
|
examples: [
|
|
105
|
+
{
|
|
106
|
+
label: "Tag picker",
|
|
107
|
+
code: '<Row gap={1}><Pill tone="blue" selected onClick={() => {}}>Design</Pill><Pill tone="teal" onClick={() => {}}>Research</Pill><Pill tone="orange" onClick={() => {}}>Marketing</Pill></Row>'
|
|
108
|
+
},
|
|
92
109
|
{
|
|
93
110
|
label: "Filter row",
|
|
94
|
-
code: "<Row gap={1}><Pill selected onClick={() => {}}>All</Pill><Pill onClick={() => {}}>
|
|
111
|
+
code: "<Row gap={1}><Pill selected onClick={() => {}}>All</Pill><Pill onClick={() => {}}>Projects</Pill><Pill onClick={() => {}}>Reports</Pill></Row>"
|
|
95
112
|
},
|
|
96
113
|
{
|
|
97
114
|
label: "Outline, small (reactions)",
|