@sableui/react 0.9.0 → 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 +124 -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.js +13 -2
- 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.js +2 -0
- 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/form/form.js +10 -5
- 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.js +15 -1
- 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/stepper/stepper.js +11 -2
- 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.js +1 -0
- package/dist/components/toast/toast.meta.js +1 -1
- package/dist/components/tooltip/tooltip.meta.js +2 -2
- package/dist/file-hashes.json +127 -124
- package/dist/foundations/spacing.js +8 -8
- package/dist/index.d.ts +138 -73
- package/dist/index.js +12 -1
- package/dist/lib/chart/types.js +3 -3
- package/dist/lib/is-promise.js +5 -0
- 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 +163 -55
- 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/building-with-sable.md +4 -0
- package/llms/tasks/converting-an-app.md +3 -1
- package/llms/tasks/using-presets.md +4 -0
- package/llms-full.txt +433 -347
- package/llms.txt +7 -7
- package/package.json +4 -4
- package/registry.json +369 -233
- package/scripts/lint-rules.mjs +26 -5
- package/scripts/sources.mjs +4 -1
- package/skills/sable/SKILL.md +14 -3
|
@@ -232,7 +232,7 @@ var buttonMeta = {
|
|
|
232
232
|
"loading sets aria-busy and disables activation (disabled on a native button, aria-disabled on a render element) so the action can't double-fire."
|
|
233
233
|
],
|
|
234
234
|
examples: [
|
|
235
|
-
{ label: "Primary", code: "<Button>
|
|
235
|
+
{ label: "Primary", code: "<Button>Save changes</Button>" },
|
|
236
236
|
{
|
|
237
237
|
label: "Secondary + ghost",
|
|
238
238
|
code: '<Row gap={1}><Button variant="secondary">Cancel</Button><Button variant="ghost">Skip</Button></Row>'
|
|
@@ -259,7 +259,7 @@ var buttonMeta = {
|
|
|
259
259
|
},
|
|
260
260
|
{
|
|
261
261
|
label: "Destructive with confirmation copy",
|
|
262
|
-
code: '<Row gap={1}><Button variant="secondary">Cancel</Button><Button variant="destructive">Delete
|
|
262
|
+
code: '<Row gap={1}><Button variant="secondary">Cancel</Button><Button variant="destructive">Delete project</Button></Row>'
|
|
263
263
|
},
|
|
264
264
|
{
|
|
265
265
|
label: "Leading icon",
|
|
@@ -302,7 +302,7 @@ var buttonMeta = {
|
|
|
302
302
|
},
|
|
303
303
|
{
|
|
304
304
|
label: "Action in a solid Banner",
|
|
305
|
-
code: '<Banner tone="warning" appearance="solid" action={<Button variant="on-color" size="sm">Reconnect</Button>}>
|
|
305
|
+
code: '<Banner tone="warning" appearance="solid" action={<Button variant="on-color" size="sm">Reconnect</Button>}>Calendar sync paused.</Banner>'
|
|
306
306
|
}
|
|
307
307
|
]
|
|
308
308
|
};
|
|
@@ -11,9 +11,9 @@ var DENSITY_PAD = {
|
|
|
11
11
|
compact: "calc(var(--spacing) * 4)"
|
|
12
12
|
// p-4
|
|
13
13
|
};
|
|
14
|
-
var INTERACTIVE_BASE = "[&:is(a[href],button)]:motion-interactive [&:is(a[href],button)]:cursor-pointer [&:is(button)]:w-full [&:is(button)]:text-start focus-visible:
|
|
14
|
+
var INTERACTIVE_BASE = "[&:is(a[href],button)]:motion-interactive [&:is(a[href],button)]:cursor-pointer [&:is(button)]:w-full [&:is(button)]:text-start focus-visible:ring-2 focus-visible:ring-ring";
|
|
15
15
|
var INTERACTIVE_HOVER = {
|
|
16
|
-
default: "[&:is(a[href],button)]:hover:
|
|
16
|
+
default: "[&:is(a[href],button)]:hover:outline-border-strong [&:is(a[href],button)]:hover:shadow-md",
|
|
17
17
|
flat: "[&:is(a[href],button)]:hover:bg-muted"
|
|
18
18
|
};
|
|
19
19
|
function Card({
|
|
@@ -41,9 +41,15 @@ function Card({
|
|
|
41
41
|
// sable-frame — at Sable's paddings the subtraction runs to ~0, and a
|
|
42
42
|
// near-square box inside a rounded card reads as another system.
|
|
43
43
|
// A field or panel inside reads it (ChatComposer does).
|
|
44
|
-
"[--card-inner-radius:max(var(--radius-sm),calc(var(--radius-lg)-var(--card-p)
|
|
44
|
+
"[--card-inner-radius:max(var(--radius-sm),calc(var(--radius-lg)-var(--card-p)))]",
|
|
45
45
|
// Declares its surface so sable-well / sable-surface-interactive inside derive from the card.
|
|
46
|
-
|
|
46
|
+
// The edge is an outline drawn 1px INSIDE the box, not a border: it
|
|
47
|
+
// takes no space, so the card's padding is whole baseline steps and
|
|
48
|
+
// its content starts on the rhythm instead of a pixel below it. It
|
|
49
|
+
// paints above the card's in-flow content (a flush table's row fill);
|
|
50
|
+
// a positioned child with a fill of its own would cover it, which no
|
|
51
|
+
// card part has. DESIGN.md → Vertical rhythm.
|
|
52
|
+
variant === "default" && "outline-1 -outline-offset-1 outline-border bg-card shadow-sm [--sable-surface-bg:var(--card)]",
|
|
47
53
|
// A CardList or a flush CardContent (an edge-to-edge Table) runs its
|
|
48
54
|
// rows to the card's edges, and a row's hover fill or a TableFooter's
|
|
49
55
|
// tint would otherwise poke square corners out past the card's
|
|
@@ -154,12 +160,15 @@ function CardList({
|
|
|
154
160
|
{
|
|
155
161
|
"data-slot": "card-list",
|
|
156
162
|
className: cn(
|
|
157
|
-
"flex flex-col
|
|
163
|
+
"flex flex-col [--entity-radius:0px] [--entity-px:var(--card-p,--spacing(6))] [--entity-py:calc(var(--card-p,--spacing(6))/2)]",
|
|
158
164
|
// Between rows the half padding is enough (each side of a hairline
|
|
159
165
|
// gets it); against the card's own edge the first and last rows take
|
|
160
166
|
// the full card padding, so the list is inset like every other card.
|
|
161
167
|
"*:first:pt-[var(--card-p,--spacing(6))] *:last:pb-[var(--card-p,--spacing(6))]",
|
|
162
|
-
|
|
168
|
+
// Hairlines between rows are inset shadows, not borders: a 1px border
|
|
169
|
+
// per row pushed every row below it a pixel further off the rhythm.
|
|
170
|
+
"[&>*+*]:shadow-[inset_0_1px_0_var(--border)]",
|
|
171
|
+
"[[data-slot=card-header]+&]:mt-[calc(var(--card-p,--spacing(6))/2)] [[data-slot=card-header]+&>*:first-child]:shadow-[inset_0_1px_0_var(--border)]",
|
|
163
172
|
className
|
|
164
173
|
),
|
|
165
174
|
...props
|
|
@@ -182,7 +191,7 @@ function CardFooter({
|
|
|
182
191
|
className: cn(
|
|
183
192
|
"flex items-center gap-2 p-[var(--card-p,--spacing(6))] pt-0",
|
|
184
193
|
"[[data-slot=card-header]+&]:pt-[var(--card-p,--spacing(6))]",
|
|
185
|
-
"[:is([data-slot=card-list],[data-slot=card-content][data-flush])+&]:
|
|
194
|
+
"[:is([data-slot=card-list],[data-slot=card-content][data-flush])+&]:shadow-[inset_0_1px_0_var(--border)] [:is([data-slot=card-list],[data-slot=card-content][data-flush])+&]:pt-[var(--card-p,--spacing(6))]",
|
|
186
195
|
className,
|
|
187
196
|
stacked && "mt-auto flex-col-reverse items-stretch justify-start"
|
|
188
197
|
),
|
|
@@ -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",
|
|
@@ -194,6 +194,8 @@ function CommandMenuBody({
|
|
|
194
194
|
variant: "ghost",
|
|
195
195
|
size: "icon-xs",
|
|
196
196
|
"aria-label": "Clear search",
|
|
197
|
+
tabIndex: -1,
|
|
198
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
197
199
|
className: "-my-1 text-muted-foreground hover:text-foreground",
|
|
198
200
|
onClick: () => {
|
|
199
201
|
setQuery("");
|
|
@@ -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
|
};
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
useRef
|
|
11
11
|
} from "react";
|
|
12
12
|
import { cn } from "../../lib/cn.js";
|
|
13
|
+
import { isPromise } from "../../lib/is-promise.js";
|
|
13
14
|
import { Label } from "../label/index.js";
|
|
14
15
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
15
16
|
function Form({
|
|
@@ -68,23 +69,27 @@ function Form({
|
|
|
68
69
|
);
|
|
69
70
|
}
|
|
70
71
|
Form.displayName = "Form";
|
|
71
|
-
var
|
|
72
|
+
var SETTLE_FRAMES = 10;
|
|
72
73
|
function afterSubmit(form, result) {
|
|
73
|
-
const
|
|
74
|
+
const attempt = (framesLeft) => requestAnimationFrame(() => {
|
|
74
75
|
if (!form.isConnected) return;
|
|
75
76
|
const active = document.activeElement;
|
|
77
|
+
if (active && active !== document.body && !form.contains(active)) return;
|
|
76
78
|
if (active && form.contains(active) && active.getAttribute("aria-invalid") === "true") return;
|
|
77
79
|
const first = [...form.querySelectorAll('[aria-invalid="true"]')].find(
|
|
78
80
|
(el) => !(el instanceof HTMLInputElement && el.type === "hidden") && !el.closest("[aria-hidden='true'],[inert]")
|
|
79
81
|
);
|
|
80
|
-
if (!first)
|
|
82
|
+
if (!first) {
|
|
83
|
+
if (framesLeft > 0) attempt(framesLeft - 1);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
81
86
|
first.focus();
|
|
82
87
|
if (first instanceof HTMLInputElement && /^(?:text|search|email|tel|url|password|number)?$/.test(first.type)) {
|
|
83
88
|
first.select();
|
|
84
89
|
}
|
|
85
90
|
});
|
|
86
|
-
if (isPromise(result)) result.finally(
|
|
87
|
-
else
|
|
91
|
+
if (isPromise(result)) result.finally(() => attempt(SETTLE_FRAMES));
|
|
92
|
+
else attempt(SETTLE_FRAMES);
|
|
88
93
|
}
|
|
89
94
|
function Field({
|
|
90
95
|
label,
|
|
@@ -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
|
};
|