@hirobius/design-system 0.19.1 → 0.21.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 +123 -0
- package/CONSUMING.md +11 -6
- package/DESIGN.md +34 -21
- package/NOTICE.md +1 -1
- package/README.md +48 -13
- package/codemods/hds-prefix.mjs +231 -0
- package/codemods/jsx-fold.mjs +515 -0
- package/codemods/not-found-pattern.mjs +71 -0
- package/codemods/patterns-subpath.mjs +242 -81
- package/codemods/patterns-subpath.names.json +41 -15
- package/codemods/removed-0.20.json +194 -0
- package/codemods/tile-grid.mjs +283 -0
- package/codemods/unrewritable.mjs +291 -0
- package/dist/chunks/DemoStateContext-Cz5TmrYu.js +32 -0
- package/dist/chunks/empty-state-DNoThgfV.js +1227 -0
- package/dist/chunks/form-By82qZcC.js +66 -0
- package/dist/contexts.js +157 -78
- package/dist/fonts/geist-mono-400.woff2 +0 -0
- package/dist/fonts/satoshi-400.woff2 +0 -0
- package/dist/fonts/satoshi-500.woff2 +0 -0
- package/dist/fonts/satoshi-700.woff2 +0 -0
- package/dist/fonts.css +53 -0
- package/dist/form.js +1 -1
- package/dist/hirobius-ui.js +1600 -5354
- package/dist/manifest.js +12 -13
- package/dist/patterns.js +796 -510
- package/dist/styles.css +2 -2
- package/dist/tokens.css +1 -1
- package/dist/tokens.js +165 -65
- package/dist/types/src/app/components/alert-dialog.d.ts +5 -0
- package/dist/types/src/app/components/asset-img.d.ts +1 -0
- package/dist/types/src/app/components/avatar-group.d.ts +2 -2
- package/dist/types/src/app/components/badge.d.ts +8 -3
- package/dist/types/src/app/components/blockquote.d.ts +2 -2
- package/dist/types/src/app/components/box-sx.d.ts +110 -13
- package/dist/types/src/app/components/box.d.ts +6 -3
- package/dist/types/src/app/components/breadcrumb.d.ts +0 -5
- package/dist/types/src/app/components/button.d.ts +35 -4
- package/dist/types/src/app/components/card.d.ts +10 -10
- package/dist/types/src/app/components/combobox.d.ts +47 -11
- package/dist/types/src/app/components/container.d.ts +2 -2
- package/dist/types/src/app/components/data-table-section.d.ts +2 -1
- package/dist/types/src/app/components/destructive-section.d.ts +1 -0
- package/dist/types/src/app/components/dialog.d.ts +8 -1
- package/dist/types/src/app/components/disclosure.d.ts +1 -5
- package/dist/types/src/app/components/error-pattern.d.ts +6 -1
- package/dist/types/src/app/components/field.d.ts +1 -2
- package/dist/types/src/app/components/form-actions.d.ts +1 -0
- package/dist/types/src/app/components/form-control.d.ts +10 -0
- package/dist/types/src/app/components/grid.d.ts +15 -6
- package/dist/types/src/app/components/hds-tooltip.d.ts +12 -2
- package/dist/types/src/app/components/icon.d.ts +1 -0
- package/dist/types/src/app/components/inline-code.d.ts +1 -2
- package/dist/types/src/app/components/input.d.ts +8 -5
- package/dist/types/src/app/components/kbd.d.ts +2 -2
- package/dist/types/src/app/components/metadata-list.d.ts +2 -2
- package/dist/types/src/app/components/metric-tiles.d.ts +1 -0
- package/dist/types/src/app/components/page-header.d.ts +0 -2
- package/dist/types/src/app/components/popover.d.ts +8 -0
- package/dist/types/src/app/components/progress.d.ts +33 -6
- package/dist/types/src/app/components/segmented-control.d.ts +2 -26
- package/dist/types/src/app/components/select.d.ts +10 -1
- package/dist/types/src/app/components/skeleton.d.ts +3 -4
- package/dist/types/src/app/components/spinner.d.ts +1 -2
- package/dist/types/src/app/components/stack.d.ts +4 -1
- package/dist/types/src/app/components/stat.d.ts +5 -5
- package/dist/types/src/app/components/status-list-item.d.ts +1 -2
- package/dist/types/src/app/components/status-tile.d.ts +3 -2
- package/dist/types/src/app/components/surface.d.ts +2 -3
- package/dist/types/src/app/components/switcher.d.ts +1 -1
- package/dist/types/src/app/components/table.d.ts +6 -15
- package/dist/types/src/app/components/tag.d.ts +0 -6
- package/dist/types/src/app/components/text.d.ts +54 -8
- package/dist/types/src/app/components/textarea.d.ts +1 -2
- package/dist/types/src/app/components/timestamp.d.ts +1 -0
- package/dist/types/src/app/components/toast.d.ts +1 -2
- package/dist/types/src/app/components/tooltip.d.ts +1 -1
- package/dist/types/src/app/context/DemoStateContext.d.ts +1 -1
- package/dist/types/src/app/context/RouterContext.d.ts +5 -5
- package/dist/types/src/app/data/manifest-types.d.ts +10 -5
- package/dist/types/src/app/design-system/generated-token-refs.d.ts +45 -28
- package/dist/types/src/app/design-system/generated-token-values.d.ts +4 -0
- package/dist/types/src/app/design-system/tokens.d.ts +139 -18
- package/dist/types/src/icons.d.ts +1 -1
- package/dist/types/src/index.d.ts +76 -164
- package/dist/types/src/patterns.d.ts +20 -25
- package/dist/variables.css +47 -33
- package/docs/CONSUMING.md +80 -48
- package/hirobius.tokens.json +125 -88
- package/llms.txt +166 -59
- package/mcp/catalog.mjs +366 -0
- package/mcp/guide.mjs +315 -0
- package/mcp/hds-mcp.mjs +49 -0
- package/mcp/server.mjs +94 -0
- package/package.json +48 -27
- package/public/hds-manifest.json +2667 -6705
- package/public/llms/components.txt +45 -426
- package/public/llms/layout.txt +5 -5
- package/public/llms-full.txt +245 -506
- package/public/llms.txt +166 -59
- package/scripts/eslint-plugin-hds/index.d.mts +29 -0
- package/scripts/eslint-plugin-hds/index.mjs +55 -0
- package/scripts/eslint-plugin-hds/package.json +30 -0
- package/scripts/eslint-plugin-hds/rules/no-raw-controls.mjs +47 -0
- package/scripts/eslint-plugin-hds/rules/no-raw-hex.mjs +70 -0
- package/scripts/eslint-plugin-hds/rules/no-raw-px-spacing.mjs +125 -0
- package/scripts/eslint-plugin-hds/rules/prefer-hds-layout-primitive.mjs +54 -0
- package/scripts/eslint-plugin-hds/rules/sx-token-first.mjs +111 -0
- package/scripts/eslint-plugin-hds/rules/utils.mjs +66 -0
- package/src/app/data/component-api.json +1082 -2913
- package/dist/chunks/LanguageContext-BxdCwiFg.js +0 -95
- package/dist/chunks/TokenDisplayContext-DKYJMVWk.js +0 -26
- package/dist/chunks/activity-feed-BGQ6v3wc.js +0 -22040
- package/dist/chunks/form-COP3vK9_.js +0 -66
- package/dist/types/src/app/components/activity-feed.d.ts +0 -73
- package/dist/types/src/app/components/app-shell.d.ts +0 -40
- package/dist/types/src/app/components/aspect-ratio.d.ts +0 -25
- package/dist/types/src/app/components/bleed.d.ts +0 -39
- package/dist/types/src/app/components/button-group.d.ts +0 -22
- package/dist/types/src/app/components/calendar.d.ts +0 -22
- package/dist/types/src/app/components/carousel.d.ts +0 -26
- package/dist/types/src/app/components/center.d.ts +0 -36
- package/dist/types/src/app/components/cinematic-link.d.ts +0 -18
- package/dist/types/src/app/components/circular-progress.d.ts +0 -28
- package/dist/types/src/app/components/cluster.d.ts +0 -39
- package/dist/types/src/app/components/command-palette.d.ts +0 -46
- package/dist/types/src/app/components/component-instance-matrix.d.ts +0 -27
- package/dist/types/src/app/components/context-menu.d.ts +0 -78
- package/dist/types/src/app/components/cover.d.ts +0 -43
- package/dist/types/src/app/components/date-input.d.ts +0 -31
- package/dist/types/src/app/components/date-range-input.d.ts +0 -34
- package/dist/types/src/app/components/date-time-input.d.ts +0 -30
- package/dist/types/src/app/components/doc-link-card.d.ts +0 -32
- package/dist/types/src/app/components/error-boundary.d.ts +0 -25
- package/dist/types/src/app/components/file-input.d.ts +0 -30
- package/dist/types/src/app/components/foundation-swatch.d.ts +0 -45
- package/dist/types/src/app/components/frame.d.ts +0 -38
- package/dist/types/src/app/components/heading-stack.d.ts +0 -52
- package/dist/types/src/app/components/history-card.d.ts +0 -12
- package/dist/types/src/app/components/hover-card.d.ts +0 -46
- package/dist/types/src/app/components/icon-button.d.ts +0 -22
- package/dist/types/src/app/components/image-lightbox.d.ts +0 -14
- package/dist/types/src/app/components/input-group.d.ts +0 -23
- package/dist/types/src/app/components/multi-selector.d.ts +0 -40
- package/dist/types/src/app/components/nav-group.d.ts +0 -29
- package/dist/types/src/app/components/nav-item.d.ts +0 -33
- package/dist/types/src/app/components/not-found-pattern.d.ts +0 -1
- package/dist/types/src/app/components/overflow-list.d.ts +0 -21
- package/dist/types/src/app/components/selectable-card.d.ts +0 -29
- package/dist/types/src/app/components/side-nav.d.ts +0 -23
- package/dist/types/src/app/components/sketch.d.ts +0 -19
- package/dist/types/src/app/components/stacked-card-rail.d.ts +0 -32
- package/dist/types/src/app/components/status-dot.d.ts +0 -25
- package/dist/types/src/app/components/stepper-field.d.ts +0 -12
- package/dist/types/src/app/components/stepper.d.ts +0 -33
- package/dist/types/src/app/components/text-lockup.d.ts +0 -38
- package/dist/types/src/app/components/tile-grid.d.ts +0 -17
- package/dist/types/src/app/components/time-input.d.ts +0 -24
- package/dist/types/src/app/components/toggle-button.d.ts +0 -32
- package/dist/types/src/app/components/token.d.ts +0 -90
- package/dist/types/src/app/components/tokenUtils.d.ts +0 -38
- package/dist/types/src/app/components/tokenizer.d.ts +0 -24
- package/dist/types/src/app/components/toolbar.d.ts +0 -36
- package/dist/types/src/app/components/top-nav.d.ts +0 -23
- package/dist/types/src/app/components/tree-list.d.ts +0 -30
- package/dist/types/src/app/data/nav-model.d.ts +0 -39
- package/dist/types/src/app/hooks/useFocusVisible.d.ts +0 -9
- package/dist/types/src/app/layouts/CaseStudyLayout.d.ts +0 -20
- package/dist/types/src/app/layouts/DocLayout.d.ts +0 -14
- package/dist/types/src/app/layouts/EmbeddedDocLayoutContext.d.ts +0 -6
- package/dist/types/src/app/layouts/HdsDocsShell.d.ts +0 -72
- package/dist/types/src/app/layouts/HdsSystemDocLayout.d.ts +0 -14
- package/dist/types/src/app/lib/hds-search.d.ts +0 -45
- package/dist/types/src/app/lib/nav-active.d.ts +0 -16
- package/dist/types/src/app/lib/navLevels.d.ts +0 -4
package/dist/tokens.js
CHANGED
|
@@ -134,7 +134,8 @@ const a = {
|
|
|
134
134
|
"3xl": "30px",
|
|
135
135
|
"4xl": "36px",
|
|
136
136
|
"5xl": "48px",
|
|
137
|
-
"6xl": "60px"
|
|
137
|
+
"6xl": "60px",
|
|
138
|
+
code: "13px"
|
|
138
139
|
},
|
|
139
140
|
weight: {
|
|
140
141
|
regular: "400",
|
|
@@ -147,7 +148,9 @@ const a = {
|
|
|
147
148
|
tight: "1.25",
|
|
148
149
|
snug: "1.375",
|
|
149
150
|
normal: "1.5",
|
|
150
|
-
relaxed: "1.625"
|
|
151
|
+
relaxed: "1.625",
|
|
152
|
+
display: "1.05",
|
|
153
|
+
body: "1.6"
|
|
151
154
|
},
|
|
152
155
|
letterSpacing: {
|
|
153
156
|
tight: "-0.01em",
|
|
@@ -190,6 +193,7 @@ const a = {
|
|
|
190
193
|
64: "64px",
|
|
191
194
|
80: "80px",
|
|
192
195
|
96: "96px",
|
|
196
|
+
120: "120px",
|
|
193
197
|
interactive: {
|
|
194
198
|
min: "44px",
|
|
195
199
|
minCompact: "24px"
|
|
@@ -257,26 +261,12 @@ const a = {
|
|
|
257
261
|
letterSpacing: "var(--semantic-typography-display-letter-spacing)",
|
|
258
262
|
lineHeight: "var(--semantic-typography-display-line-height)"
|
|
259
263
|
},
|
|
260
|
-
|
|
261
|
-
fontFamily: "var(--semantic-typography-
|
|
262
|
-
fontSize: "var(--semantic-typography-
|
|
263
|
-
fontWeight: "var(--semantic-typography-
|
|
264
|
-
letterSpacing: "var(--semantic-typography-
|
|
265
|
-
lineHeight: "var(--semantic-typography-
|
|
266
|
-
},
|
|
267
|
-
h2: {
|
|
268
|
-
fontFamily: "var(--semantic-typography-h2-font-family)",
|
|
269
|
-
fontSize: "var(--semantic-typography-h2-font-size)",
|
|
270
|
-
fontWeight: "var(--semantic-typography-h2-font-weight)",
|
|
271
|
-
letterSpacing: "var(--semantic-typography-h2-letter-spacing)",
|
|
272
|
-
lineHeight: "var(--semantic-typography-h2-line-height)"
|
|
273
|
-
},
|
|
274
|
-
h3: {
|
|
275
|
-
fontFamily: "var(--semantic-typography-h3-font-family)",
|
|
276
|
-
fontSize: "var(--semantic-typography-h3-font-size)",
|
|
277
|
-
fontWeight: "var(--semantic-typography-h3-font-weight)",
|
|
278
|
-
letterSpacing: "var(--semantic-typography-h3-letter-spacing)",
|
|
279
|
-
lineHeight: "var(--semantic-typography-h3-line-height)"
|
|
264
|
+
title: {
|
|
265
|
+
fontFamily: "var(--semantic-typography-title-font-family)",
|
|
266
|
+
fontSize: "var(--semantic-typography-title-font-size)",
|
|
267
|
+
fontWeight: "var(--semantic-typography-title-font-weight)",
|
|
268
|
+
letterSpacing: "var(--semantic-typography-title-letter-spacing)",
|
|
269
|
+
lineHeight: "var(--semantic-typography-title-line-height)"
|
|
280
270
|
},
|
|
281
271
|
body: {
|
|
282
272
|
fontFamily: "var(--semantic-typography-body-font-family)",
|
|
@@ -301,14 +291,6 @@ const a = {
|
|
|
301
291
|
letterSpacing: "var(--semantic-typography-caption-letter-spacing)",
|
|
302
292
|
lineHeight: "var(--semantic-typography-caption-line-height)"
|
|
303
293
|
},
|
|
304
|
-
eyebrow: {
|
|
305
|
-
fontFamily: "var(--semantic-typography-eyebrow-font-family)",
|
|
306
|
-
fontSize: "var(--semantic-typography-eyebrow-font-size)",
|
|
307
|
-
fontWeight: "var(--semantic-typography-eyebrow-font-weight)",
|
|
308
|
-
letterSpacing: "var(--semantic-typography-eyebrow-letter-spacing)",
|
|
309
|
-
lineHeight: "var(--semantic-typography-eyebrow-line-height)",
|
|
310
|
-
textTransform: "var(--semantic-typography-eyebrow-text-transform)"
|
|
311
|
-
},
|
|
312
294
|
mono: {
|
|
313
295
|
fontFamily: "var(--semantic-typography-mono-font-family)",
|
|
314
296
|
fontSize: "var(--semantic-typography-mono-font-size)",
|
|
@@ -502,16 +484,25 @@ const o = "var(--primitive-typography-family-primary)", n = "var(--primitive-typ
|
|
|
502
484
|
xs: "var(--semantic-space-subgrid-xs)"
|
|
503
485
|
},
|
|
504
486
|
component: {
|
|
505
|
-
/**
|
|
487
|
+
/**
|
|
488
|
+
* @deprecated hds#206 — use `semantic.space.surface.padding`.
|
|
489
|
+
* @removeIn 1.0.0
|
|
490
|
+
*/
|
|
506
491
|
padding: "var(--semantic-space-surface-padding)",
|
|
507
|
-
/**
|
|
492
|
+
/**
|
|
493
|
+
* @deprecated hds#206 — use `semantic.space.scale.xs`.
|
|
494
|
+
* @removeIn 1.0.0
|
|
495
|
+
*/
|
|
508
496
|
gap: "var(--semantic-space-scale-xs)"
|
|
509
497
|
},
|
|
510
498
|
stack: {
|
|
511
499
|
gap: "var(--semantic-space-section-stack)"
|
|
512
500
|
},
|
|
513
501
|
layout: {
|
|
514
|
-
/**
|
|
502
|
+
/**
|
|
503
|
+
* @deprecated hds#206 — use `semantic.space.region.gutter`.
|
|
504
|
+
* @removeIn 1.0.0
|
|
505
|
+
*/
|
|
515
506
|
gutter: "var(--semantic-space-region-gutter)",
|
|
516
507
|
gap: "var(--semantic-space-layout-gap)",
|
|
517
508
|
section: "var(--semantic-layout-section-paddingY)"
|
|
@@ -528,52 +519,150 @@ const o = "var(--primitive-typography-family-primary)", n = "var(--primitive-typ
|
|
|
528
519
|
}
|
|
529
520
|
},
|
|
530
521
|
typography: {
|
|
522
|
+
/** @deprecated hds#483 — use `typeStyles.ui`.
|
|
523
|
+
* @removeIn 1.0.0 */
|
|
531
524
|
label: i.semantic.typography.ui,
|
|
525
|
+
/** @deprecated hds#483 — use `typeStyles.ui`.
|
|
526
|
+
* @removeIn 1.0.0 */
|
|
532
527
|
labelDescriptive: i.semantic.typography.ui,
|
|
528
|
+
/** @deprecated hds#483 — use `typeStyles.mono`.
|
|
529
|
+
* @removeIn 1.0.0 */
|
|
533
530
|
labelTechnical: i.semantic.typography.mono
|
|
534
531
|
}
|
|
535
532
|
},
|
|
536
533
|
// Each style object spreads directly into a React inline style prop.
|
|
537
534
|
// CSS vars resolve at paint time — no hardcoded pixel values.
|
|
538
535
|
typeStyles: {
|
|
539
|
-
// ──
|
|
540
|
-
//
|
|
541
|
-
//
|
|
542
|
-
// never re-apply textTransform inline. Casing changes are eyebrow-only.
|
|
536
|
+
// ── The 5-role ramp plus mono (hds#483) ───────────────────────────────────
|
|
537
|
+
// display 48 / title 24 / body 16 / ui 14 / caption 12 / mono 13. body, ui
|
|
538
|
+
// and mono carry maxWidth: 60ch. Casing is never changed inline.
|
|
543
539
|
display: i.semantic.typography.display,
|
|
544
|
-
|
|
545
|
-
h2: i.semantic.typography.h2,
|
|
546
|
-
h3: i.semantic.typography.h3,
|
|
540
|
+
title: i.semantic.typography.title,
|
|
547
541
|
body: i.semantic.typography.body,
|
|
548
542
|
ui: i.semantic.typography.ui,
|
|
549
|
-
eyebrow: i.semantic.typography.eyebrow,
|
|
550
|
-
mono: i.semantic.typography.mono,
|
|
551
|
-
// ── Migration aliases → canonical composites ──────────────────────────────
|
|
552
|
-
// Pre-2026-05-04 names map to the new roles. small → ui; the eyebrow-pattern
|
|
553
|
-
// callsites migrate explicitly to typeStyles.eyebrow as part of the
|
|
554
|
-
// ops-dashboard sweep. caption now resolves to its own 12/16 composite
|
|
555
|
-
// (semantic.typography.caption, matching Figma) rather than aliasing ui.
|
|
556
|
-
small: i.semantic.typography.ui,
|
|
557
543
|
caption: i.semantic.typography.caption,
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
544
|
+
mono: i.semantic.typography.mono,
|
|
545
|
+
// ── Deprecated aliases → the six roles ────────────────────────────────────
|
|
546
|
+
// Every pre-cut name still resolves, to the role it now points at.
|
|
547
|
+
/**
|
|
548
|
+
* @deprecated hds#483 — use `typeStyles.title`.
|
|
549
|
+
* @removeIn 1.0.0
|
|
550
|
+
*/
|
|
551
|
+
h1: i.semantic.typography.title,
|
|
552
|
+
/**
|
|
553
|
+
* @deprecated hds#483 — use `typeStyles.title`.
|
|
554
|
+
* @removeIn 1.0.0
|
|
555
|
+
*/
|
|
556
|
+
h2: i.semantic.typography.title,
|
|
557
|
+
/**
|
|
558
|
+
* @deprecated hds#483 — use `typeStyles.title`.
|
|
559
|
+
* @removeIn 1.0.0
|
|
560
|
+
*/
|
|
561
|
+
h3: i.semantic.typography.title,
|
|
562
|
+
/**
|
|
563
|
+
* @deprecated hds#483 — use `typeStyles.title`.
|
|
564
|
+
* @removeIn 1.0.0
|
|
565
|
+
*/
|
|
566
|
+
heading1: i.semantic.typography.title,
|
|
567
|
+
/**
|
|
568
|
+
* @deprecated hds#483 — use `typeStyles.title`.
|
|
569
|
+
* @removeIn 1.0.0
|
|
570
|
+
*/
|
|
571
|
+
heading2: i.semantic.typography.title,
|
|
572
|
+
/**
|
|
573
|
+
* @deprecated hds#483 — use `typeStyles.title`.
|
|
574
|
+
* @removeIn 1.0.0
|
|
575
|
+
*/
|
|
576
|
+
heading3: i.semantic.typography.title,
|
|
577
|
+
/**
|
|
578
|
+
* @deprecated hds#483 — use `typeStyles.title`.
|
|
579
|
+
* @removeIn 1.0.0
|
|
580
|
+
*/
|
|
581
|
+
headingHero: i.semantic.typography.title,
|
|
582
|
+
/**
|
|
583
|
+
* @deprecated hds#483 — use `typeStyles.title`.
|
|
584
|
+
* @removeIn 1.0.0
|
|
585
|
+
*/
|
|
586
|
+
headingSection: i.semantic.typography.title,
|
|
587
|
+
/**
|
|
588
|
+
* @deprecated hds#483 — use `typeStyles.title`.
|
|
589
|
+
* @removeIn 1.0.0
|
|
590
|
+
*/
|
|
591
|
+
display2: i.semantic.typography.title,
|
|
592
|
+
/**
|
|
593
|
+
* @deprecated hds#483 — use `typeStyles.display`.
|
|
594
|
+
* @removeIn 1.0.0
|
|
595
|
+
*/
|
|
564
596
|
displayXl: i.semantic.typography.display,
|
|
597
|
+
/**
|
|
598
|
+
* @deprecated hds#483 — use `typeStyles.display`.
|
|
599
|
+
* @removeIn 1.0.0
|
|
600
|
+
*/
|
|
565
601
|
display1: i.semantic.typography.display,
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
602
|
+
/**
|
|
603
|
+
* @deprecated hds#483 — use `typeStyles.body`.
|
|
604
|
+
* @removeIn 1.0.0
|
|
605
|
+
*/
|
|
570
606
|
body2: i.semantic.typography.body,
|
|
607
|
+
/**
|
|
608
|
+
* @deprecated hds#483 — use `typeStyles.body`.
|
|
609
|
+
* @removeIn 1.0.0
|
|
610
|
+
*/
|
|
571
611
|
bodyLarge: i.semantic.typography.body,
|
|
612
|
+
/**
|
|
613
|
+
* @deprecated hds#483 — use `typeStyles.ui`.
|
|
614
|
+
* @removeIn 1.0.0
|
|
615
|
+
*/
|
|
616
|
+
small: i.semantic.typography.ui,
|
|
617
|
+
/**
|
|
618
|
+
* @deprecated hds#483 — use `typeStyles.ui`.
|
|
619
|
+
* @removeIn 1.0.0
|
|
620
|
+
*/
|
|
572
621
|
bodySmall: i.semantic.typography.ui,
|
|
573
|
-
|
|
574
|
-
|
|
622
|
+
/**
|
|
623
|
+
* @deprecated hds#483 — use `typeStyles.ui`.
|
|
624
|
+
* @removeIn 1.0.0
|
|
625
|
+
*/
|
|
575
626
|
label: i.semantic.typography.ui,
|
|
627
|
+
/**
|
|
628
|
+
* @deprecated hds#483 — use `typeStyles.ui`.
|
|
629
|
+
* @removeIn 1.0.0
|
|
630
|
+
*/
|
|
576
631
|
labelDescriptive: i.semantic.typography.ui,
|
|
632
|
+
/**
|
|
633
|
+
* @deprecated hds#483 — use `typeStyles.caption`.
|
|
634
|
+
* @removeIn 1.0.0
|
|
635
|
+
*/
|
|
636
|
+
eyebrow: i.semantic.typography.caption,
|
|
637
|
+
/**
|
|
638
|
+
* @deprecated hds#483 — use `typeStyles.caption`.
|
|
639
|
+
* @removeIn 1.0.0
|
|
640
|
+
*/
|
|
641
|
+
badge: i.semantic.typography.caption,
|
|
642
|
+
/**
|
|
643
|
+
* @deprecated hds#483 — use `typeStyles.caption`.
|
|
644
|
+
* @removeIn 1.0.0
|
|
645
|
+
*/
|
|
646
|
+
micro: i.semantic.typography.caption,
|
|
647
|
+
/**
|
|
648
|
+
* @deprecated hds#483 — use `typeStyles.mono`.
|
|
649
|
+
* @removeIn 1.0.0
|
|
650
|
+
*/
|
|
651
|
+
technical: i.semantic.typography.mono,
|
|
652
|
+
/**
|
|
653
|
+
* @deprecated hds#483 — use `typeStyles.mono`.
|
|
654
|
+
* @removeIn 1.0.0
|
|
655
|
+
*/
|
|
656
|
+
monoXs: i.semantic.typography.mono,
|
|
657
|
+
/**
|
|
658
|
+
* @deprecated hds#483 — use `typeStyles.mono`.
|
|
659
|
+
* @removeIn 1.0.0
|
|
660
|
+
*/
|
|
661
|
+
monoSm: i.semantic.typography.mono,
|
|
662
|
+
/**
|
|
663
|
+
* @deprecated hds#483 — use `typeStyles.mono`.
|
|
664
|
+
* @removeIn 1.0.0
|
|
665
|
+
*/
|
|
577
666
|
labelTechnical: i.semantic.typography.mono
|
|
578
667
|
},
|
|
579
668
|
// ── Icons ────────────────────────────────────────────────────────────────────
|
|
@@ -594,10 +683,21 @@ const o = "var(--primitive-typography-family-primary)", n = "var(--primitive-typ
|
|
|
594
683
|
large: "var(--primitive-size-24)"
|
|
595
684
|
// 24px — hero / large empty states
|
|
596
685
|
},
|
|
597
|
-
// ── Density-aware spacing
|
|
598
|
-
// These vars respond to [data-density="compact"] on <html
|
|
599
|
-
//
|
|
600
|
-
//
|
|
686
|
+
// ── Density-aware spacing (deprecated) ───────────────────────────────────────
|
|
687
|
+
// These vars respond to [data-density="compact"] on <html>, and so does
|
|
688
|
+
// semantic.space.scale.*, the one spacing vocabulary (hds#206). The same
|
|
689
|
+
// names mean different pixels here (density.sm is 8px, scale.sm is 16px),
|
|
690
|
+
// so this group is deprecated. Nothing in HDS reads it.
|
|
691
|
+
/**
|
|
692
|
+
* @deprecated hds#206 — use `hds.semantic.space.scale.*`, which compact density
|
|
693
|
+
* remaps too. Same pixels at both densities, one step down the name ladder:
|
|
694
|
+
* `density.sm` → `scale.xs`, `density.md` → `scale.sm`, `density.lg` → `scale.md`,
|
|
695
|
+
* `density.xl` → `scale.lg`, `density.xl2` → `scale.xl`. `density.xs` (4px),
|
|
696
|
+
* `density.xl3` (64px) and `density.xl4` (80px) have no scale step:
|
|
697
|
+
* `hds.space.px4` / `px64` / `px80` keep their comfortable pixels, without the
|
|
698
|
+
* compact remap.
|
|
699
|
+
* @removeIn 1.0.0
|
|
700
|
+
*/
|
|
601
701
|
density: {
|
|
602
702
|
xs: "var(--hds-space-xs)",
|
|
603
703
|
// 4px comfortable / 2px compact
|
|
@@ -620,7 +720,7 @@ const o = "var(--primitive-typography-family-primary)", n = "var(--primitive-typ
|
|
|
620
720
|
// CSS var strings — valid in any inline style property that accepts a length.
|
|
621
721
|
// Note: avoid interpolating these into template literal shorthand strings,
|
|
622
722
|
// e.g. `margin: \`0 0 ${hds.space.px20}\`` — use individual properties instead.
|
|
623
|
-
// For component spacing that adapts to density, use hds.
|
|
723
|
+
// For component spacing that adapts to density, use hds.semantic.space.scale.* instead.
|
|
624
724
|
space: {
|
|
625
725
|
px1: "var(--primitive-space-px1)",
|
|
626
726
|
px2: "var(--primitive-space-px2)",
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* AlertDialog — modal confirmation dialog on Radix AlertDialog.
|
|
3
3
|
* @category Overlays
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @figma https://www.figma.com/design/2VgBbVpKiDnu0aftJEVyBQ/HDS-Tokens-Components-Copy?node-id=2035-24
|
|
5
6
|
* @doc-exempt: no Overlays doc page yet — add demo when the overlays page is created
|
|
6
7
|
*
|
|
7
8
|
* Radix AlertDialog (@radix-ui/react-alert-dialog) themed with the overlay role
|
|
@@ -58,6 +59,10 @@ interface AlertDialogComponent extends React.FC<React.ComponentProps<typeof Aler
|
|
|
58
59
|
/**
|
|
59
60
|
* AlertDialog root + parts. Controlled via `open`/`onOpenChange`, or
|
|
60
61
|
* uncontrolled with `defaultOpen`.
|
|
62
|
+
* @usage Confirm a destructive or irreversible action (delete, archive, remove) before it runs, with Cancel and Action buttons.
|
|
63
|
+
* @whenNot A modal that collects input or shows content, or a confirmation after the action is done.
|
|
64
|
+
* @useInstead Dialog a modal with a form or other content
|
|
65
|
+
* @useInstead ToastProvider a brief confirmation after the action
|
|
61
66
|
* @public
|
|
62
67
|
*/
|
|
63
68
|
export declare const AlertDialog: AlertDialogComponent;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Contexts: default, lightbox, and detail.
|
|
4
4
|
* @category Display
|
|
5
5
|
* @tier primitive
|
|
6
|
+
* @figma https://www.figma.com/design/2VgBbVpKiDnu0aftJEVyBQ/HDS-Tokens-Components-Copy?node-id=2041-67
|
|
6
7
|
*/
|
|
7
8
|
import { CSSProperties } from 'react';
|
|
8
9
|
import type React from 'react';
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* AvatarGroup — an overlapping cluster of Avatars with an overflow count.
|
|
3
3
|
* @category Display
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @figma https://www.figma.com/design/2VgBbVpKiDnu0aftJEVyBQ/HDS-Tokens-Components-Copy?node-id=2030-63
|
|
5
6
|
*/
|
|
6
7
|
import * as React from 'react';
|
|
7
8
|
import { type VariantProps } from 'class-variance-authority';
|
|
@@ -18,5 +19,4 @@ export interface AvatarGroupProps extends Omit<React.HTMLAttributes<HTMLDivEleme
|
|
|
18
19
|
}
|
|
19
20
|
/** Renders up to `max` overlapping avatars followed by a `+N` overflow chip. */
|
|
20
21
|
export declare const AvatarGroup: React.ForwardRefExoticComponent<AvatarGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
-
|
|
22
|
-
export { overflowBubbleVariants };
|
|
22
|
+
export {};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Badge - compact feedback badge for neutral and semantic states.
|
|
3
3
|
* @category Feedback
|
|
4
4
|
* @tier primitive
|
|
5
|
-
* @usage Label a status, state or count with a compact neutral or semantic chip.
|
|
5
|
+
* @usage Label a status, state or count with a compact neutral or semantic chip, or a dot.
|
|
6
6
|
* @whenNot A chip people can toggle, or a message that needs a sentence.
|
|
7
7
|
* @useInstead Tag an interactive filter or category chip
|
|
8
8
|
* @useInstead Alert a message that needs a sentence
|
|
@@ -18,8 +18,13 @@ type BadgeVariantProps = VariantProps<typeof badgeVariants>;
|
|
|
18
18
|
export interface BadgeProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'style'>, BadgeVariantProps {
|
|
19
19
|
/** Element rendered as the badge wrapper. Defaults to 'span'. */
|
|
20
20
|
as?: React.ElementType;
|
|
21
|
+
/** Render a solid status dot with no text (children are ignored). */
|
|
22
|
+
dot?: boolean;
|
|
23
|
+
/** Dot diameter; used only with `dot`. */
|
|
24
|
+
size?: 'sm' | 'md' | 'lg';
|
|
25
|
+
/** Names a `dot` badge: role="img" with this aria-label. Without it the dot is aria-hidden. A text badge ignores it: put the text in `children`. */
|
|
26
|
+
label?: string;
|
|
21
27
|
}
|
|
22
28
|
/** Compact metadata/status chip. Tone is the only styling input. */
|
|
23
29
|
export declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLSpanElement>>;
|
|
24
|
-
|
|
25
|
-
export { badgeVariants };
|
|
30
|
+
export {};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Blockquote — quoted passage with an optional attribution.
|
|
3
3
|
* @category Typography
|
|
4
4
|
* @tier primitive
|
|
5
|
+
* @figma https://www.figma.com/design/2VgBbVpKiDnu0aftJEVyBQ/HDS-Tokens-Components-Copy?node-id=2024-18
|
|
5
6
|
*/
|
|
6
7
|
import * as React from 'react';
|
|
7
8
|
import { type VariantProps } from 'class-variance-authority';
|
|
@@ -16,5 +17,4 @@ export interface BlockquoteProps extends React.BlockquoteHTMLAttributes<HTMLQuot
|
|
|
16
17
|
}
|
|
17
18
|
/** A quoted passage; pass `cite` for the source URL and `attribution` for a byline. */
|
|
18
19
|
export declare const Blockquote: React.ForwardRefExoticComponent<BlockquoteProps & React.RefAttributes<HTMLQuoteElement>>;
|
|
19
|
-
|
|
20
|
-
export { blockquoteVariants };
|
|
20
|
+
export {};
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* box-sx.ts — pure resolver + CSS injector for Box's `sx` prop.
|
|
3
3
|
*
|
|
4
|
-
* Deliberately
|
|
5
|
-
* testable in isolation from the component tree.
|
|
6
|
-
*
|
|
4
|
+
* Deliberately React-free (its one import is the dev-only `warnOnce`) so the
|
|
5
|
+
* resolver is unit testable in isolation from the component tree. Its
|
|
6
|
+
* consumers: `box.tsx` re-exports the types below as part of the public `Box`
|
|
7
|
+
* API; `stack.tsx` resolves its `gap` through `resolveSpacingValue`, the one
|
|
8
|
+
* spacing resolver (hds#206); and the layout components (Grid, Sidebar,
|
|
9
|
+
* Switcher, Card) resolve theirs through it against `LAYOUT_GAP`, the one copy
|
|
10
|
+
* of the layout-gap names (hds#404).
|
|
7
11
|
*
|
|
8
12
|
* @internal — the resolver internals (`resolveSx`, `sxClassName`, `injectSx`)
|
|
9
|
-
* are exported for testing
|
|
10
|
-
* `
|
|
13
|
+
* are exported for testing, and `resolveSpacingValue`, `SpacingVocabulary`,
|
|
14
|
+
* `SPACE_SCALE`, `LAYOUT_GAP_NAMES` and `LAYOUT_GAP` for the components. The
|
|
15
|
+
* supported public surface is `Box` + the `Sx*` types, both re-exported from
|
|
16
|
+
* `box.tsx`.
|
|
11
17
|
*/
|
|
12
18
|
export declare const BOX_BREAKPOINTS: {
|
|
13
19
|
readonly xs: 375;
|
|
@@ -29,18 +35,108 @@ export type ResponsiveValue<T> = T | Partial<Record<Breakpoint, T>>;
|
|
|
29
35
|
export interface SxObject {
|
|
30
36
|
[key: string]: ResponsiveValue<SxValue> | SxObject | undefined;
|
|
31
37
|
}
|
|
38
|
+
/** The canonical t-shirt scale, `semantic.space.scale.{xs,sm,md,lg,xl}` (hds#206). */
|
|
39
|
+
export declare const SPACE_SCALE: {
|
|
40
|
+
readonly xs: "var(--semantic-space-scale-xs)";
|
|
41
|
+
readonly sm: "var(--semantic-space-scale-sm)";
|
|
42
|
+
readonly md: "var(--semantic-space-scale-md)";
|
|
43
|
+
readonly lg: "var(--semantic-space-scale-lg)";
|
|
44
|
+
readonly xl: "var(--semantic-space-scale-xl)";
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* The names a spacing prop accepts, and what any other value means there.
|
|
48
|
+
*
|
|
49
|
+
* An open vocabulary passes any other string through ('auto', '1rem', a
|
|
50
|
+
* `var()`) and reads a number by `numbers`: `'units'` is a count of 4px
|
|
51
|
+
* units (Box `sx`), `'raw'` returns the number as-is for React's inline
|
|
52
|
+
* style to read as px (Stack and Card `gap`).
|
|
53
|
+
*
|
|
54
|
+
* A closed vocabulary resolves its own names and nothing else: any other
|
|
55
|
+
* value, a number included, resolves to `undefined`, so the prop sets no
|
|
56
|
+
* style. That is what the layout components rendered before hds#404, when
|
|
57
|
+
* each looked a value up in a private map.
|
|
58
|
+
*/
|
|
59
|
+
export type SpacingVocabulary = {
|
|
60
|
+
readonly names: Readonly<Record<string, string>>;
|
|
61
|
+
readonly numbers: 'units' | 'raw';
|
|
62
|
+
} | {
|
|
63
|
+
readonly names: Readonly<Record<string, string>>;
|
|
64
|
+
readonly closed: true;
|
|
65
|
+
};
|
|
66
|
+
type OpenSpacingVocabulary = Extract<SpacingVocabulary, {
|
|
67
|
+
readonly numbers: unknown;
|
|
68
|
+
}>;
|
|
69
|
+
type ClosedSpacingVocabulary = Extract<SpacingVocabulary, {
|
|
70
|
+
readonly closed: true;
|
|
71
|
+
}>;
|
|
72
|
+
/**
|
|
73
|
+
* The layout-gap names (hds#404): the only copy of the four names the layout
|
|
74
|
+
* components take for a gap, a gutter or a bleed, with the same values as
|
|
75
|
+
* Stack's `gap`:
|
|
76
|
+
*
|
|
77
|
+
* tight → var(--semantic-space-scale-sm)
|
|
78
|
+
* normal → var(--semantic-space-scale-md)
|
|
79
|
+
* inset → var(--semantic-space-scale-lg)
|
|
80
|
+
* spacious → var(--semantic-space-scale-xl)
|
|
81
|
+
*
|
|
82
|
+
* They read the scale steps, so compact density tightens them. Box `sx`'s
|
|
83
|
+
* deprecated names of the same spelling read the fixed layout vars instead
|
|
84
|
+
* (BOX_SX_SPACING below). scripts/check-layout-gap-vocabulary.mjs fails a
|
|
85
|
+
* second copy anywhere else in src/.
|
|
86
|
+
*/
|
|
87
|
+
export declare const LAYOUT_GAP_NAMES: {
|
|
88
|
+
readonly tight: "var(--semantic-space-scale-sm)";
|
|
89
|
+
readonly normal: "var(--semantic-space-scale-md)";
|
|
90
|
+
readonly inset: "var(--semantic-space-scale-lg)";
|
|
91
|
+
readonly spacious: "var(--semantic-space-scale-xl)";
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Grid, Sidebar and Switcher `gap` (Cluster, Cover, Bleed and Center, which
|
|
95
|
+
* read it too, went in 0.20.0, hds#394): the four layout-gap names, plus
|
|
96
|
+
* `medium` (hds#393), and nothing else. Closed, so an untyped value sets no style, as it did before
|
|
97
|
+
* hds#404 (scripts/__tests__/spacing-computed-lock.test.mjs).
|
|
98
|
+
*
|
|
99
|
+
* `medium` is the 12px default gap of TileGrid (removed in 0.20.0, hds#395),
|
|
100
|
+
* `semantic.space.component.medium`, the step Stack's `medium` reads. Unlike
|
|
101
|
+
* the four names it is fixed: compact density does not remap it, as it did not
|
|
102
|
+
* remap TileGrid's 12px. Only
|
|
103
|
+
* Grid's `gap` type takes it so far. It stays out of LAYOUT_GAP_NAMES, so
|
|
104
|
+
* Card and Stack, which spread those names, do not change.
|
|
105
|
+
*/
|
|
106
|
+
export declare const LAYOUT_GAP: {
|
|
107
|
+
names: {
|
|
108
|
+
medium: string;
|
|
109
|
+
tight: "var(--semantic-space-scale-sm)";
|
|
110
|
+
normal: "var(--semantic-space-scale-md)";
|
|
111
|
+
inset: "var(--semantic-space-scale-lg)";
|
|
112
|
+
spacious: "var(--semantic-space-scale-xl)";
|
|
113
|
+
};
|
|
114
|
+
closed: true;
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* The one spacing resolver for Box `sx`, Stack `gap` and the layout
|
|
118
|
+
* components. A name is looked up in the caller's vocabulary (own keys only,
|
|
119
|
+
* so 'constructor' is not a name). Anything else ('auto', '1rem', a `var()`)
|
|
120
|
+
* passes through an open vocabulary and resolves to `undefined` in a closed
|
|
121
|
+
* one. The return type says which: an open vocabulary never yields
|
|
122
|
+
* `undefined`, so Box cannot emit `margin:undefined`, and a closed one never
|
|
123
|
+
* yields a number.
|
|
124
|
+
*/
|
|
125
|
+
export declare function resolveSpacingValue(value: SxValue, vocabulary: OpenSpacingVocabulary): string | number;
|
|
126
|
+
export declare function resolveSpacingValue(value: SxValue, vocabulary: ClosedSpacingVocabulary): string | undefined;
|
|
127
|
+
export declare function resolveSpacingValue(value: SxValue, vocabulary: SpacingVocabulary): string | number | undefined;
|
|
32
128
|
/**
|
|
33
129
|
* Resolves an `SxObject` into an ordered array of standalone, top-level CSS
|
|
34
130
|
* rule strings ready for individual `CSSStyleSheet.insertRule()` calls.
|
|
35
131
|
*
|
|
36
|
-
* Pure
|
|
37
|
-
* encountered (outer class first,
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* is one rule; only top-level
|
|
43
|
-
* `injectSx` below).
|
|
132
|
+
* Pure apart from a dev-only deprecation warning; no DOM access. Order: base
|
|
133
|
+
* (non-responsive) rules for every selector encountered (outer class first,
|
|
134
|
+
* then each `&`-selector in declaration order), followed by
|
|
135
|
+
* `@media (min-width: …)` blocks in ascending breakpoint order. Each media
|
|
136
|
+
* block is ONE rule string containing its inner selector rules concatenated
|
|
137
|
+
* as plain text — that concatenation is safe (and required) because a single
|
|
138
|
+
* `insertRule()` call for an `@media {...}` block is one rule; only top-level
|
|
139
|
+
* rule concatenation breaks `insertRule()` (see `injectSx` below).
|
|
44
140
|
*/
|
|
45
141
|
export declare function resolveSx(sx: SxObject, className: string): string[];
|
|
46
142
|
/** Deterministic class name for an sx object — identical objects (by value) share one class/hash. */
|
|
@@ -67,3 +163,4 @@ export declare function sxClassName(sx: SxObject): string;
|
|
|
67
163
|
export declare function injectSx(sx: SxObject): string;
|
|
68
164
|
/** @internal test-only — clears the injection cache and managed stylesheet between test runs. */
|
|
69
165
|
export declare function __resetBoxSxForTests(): void;
|
|
166
|
+
export {};
|
|
@@ -16,9 +16,12 @@
|
|
|
16
16
|
* keys, not raw hex/px. Prefer named layout primitives over ad-hoc flex.
|
|
17
17
|
*
|
|
18
18
|
* `sx` is a deliberate SUBSET of MUI's sx — not all of CSS-in-JS is a feature:
|
|
19
|
-
* - Spacing shorthands (m/p/gap family)
|
|
20
|
-
* (
|
|
21
|
-
*
|
|
19
|
+
* - Spacing shorthands (m/p/gap family) take the t-shirt scale
|
|
20
|
+
* ('xs'|'sm'|'md'|'lg'|'xl' → `--semantic-space-scale-*`, hds#206) through the
|
|
21
|
+
* resolver Stack's `gap` shares. Numbers still resolve as a count of 4px units
|
|
22
|
+
* (`p: 4` is 16px), and the deprecated 'tight'|'normal'|'inset'|'spacious' still
|
|
23
|
+
* read `--semantic-space-layout-*`, fixed px that compact density does not
|
|
24
|
+
* remap. HDS source may not use raw integers (check-spacing-vocabulary).
|
|
22
25
|
* - `color`/`bgcolor`/`borderColor`/`fill`/`stroke` resolve dotted token keys
|
|
23
26
|
* ('content.primary', 'surface.raised', 'border.subtle', 'accent',
|
|
24
27
|
* 'accent.hover', 'feedback.success', …) to the matching semantic CSS var.
|
|
@@ -9,9 +9,6 @@
|
|
|
9
9
|
* @figma https://www.figma.com/design/c8MaVgwxOlxm4wr8wnH0Z4/HDS-Tokens-Components?node-id=86-159
|
|
10
10
|
*/
|
|
11
11
|
import * as React from 'react';
|
|
12
|
-
declare const crumbLabelVariants: (props?: ({
|
|
13
|
-
current?: boolean | null | undefined;
|
|
14
|
-
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
15
12
|
/** @public */
|
|
16
13
|
export interface BreadcrumbItem {
|
|
17
14
|
/** Visible label for the crumb. */
|
|
@@ -32,5 +29,3 @@ export interface BreadcrumbProps extends Omit<React.HTMLAttributes<HTMLElement>,
|
|
|
32
29
|
* is marked aria-current="page".
|
|
33
30
|
*/
|
|
34
31
|
export declare const Breadcrumb: React.ForwardRefExoticComponent<BreadcrumbProps & React.RefAttributes<HTMLElement>>;
|
|
35
|
-
/** @internal — CVA variant helper; compose via Breadcrumb instead. */
|
|
36
|
-
export { crumbLabelVariants };
|
|
@@ -7,6 +7,30 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as React from 'react';
|
|
9
9
|
import { type VariantProps } from 'class-variance-authority';
|
|
10
|
+
/**
|
|
11
|
+
* Pressed state (hds#322): an inset box-shadow wash bound to
|
|
12
|
+
* `role.pressed-overlay` (`semantic.color.state.pressed.overlay`: black in
|
|
13
|
+
* light, white in dark; the 5% alpha lives in the class, like `bg-scrim/60`),
|
|
14
|
+
* not the brightness filter it replaces (95% in light, 110% in dark), which
|
|
15
|
+
* had no token behind it and no Figma equivalent. Why an inset shadow and not
|
|
16
|
+
* a pseudo-element: Tailwind v4 composes `--tw-inset-shadow` with the
|
|
17
|
+
* `focus-visible:ring-*` and any consumer `shadow-*` into one `box-shadow`
|
|
18
|
+
* list, so the focus ring, an outer shadow and the press wash all render at
|
|
19
|
+
* once with no `relative`/`after:` classes and no extra DOM; the
|
|
20
|
+
* `inset-shadow-[0_0_0_9999px]` spread fills the padding box, so it works on
|
|
21
|
+
* a transparent tertiary fill and respects the radius. `disabled:pointer-events-none`
|
|
22
|
+
* keeps a disabled control from ever matching `:active`. The wash snaps on
|
|
23
|
+
* and off (`transition-[colors,filter]` is unchanged: the tone variants still
|
|
24
|
+
* hover through the brightness filter), which is also how the Figma Pressed
|
|
25
|
+
* variant behaves. Without `color-mix()` support the fallback is the opaque
|
|
26
|
+
* token, the same fallback Tailwind emits for `bg-scrim/60`.
|
|
27
|
+
*
|
|
28
|
+
* Toggled on (`pressed`, hds#393) is a different state from that momentary
|
|
29
|
+
* wash: `data-pressed="true"` fills with `role.accent` and its foreground,
|
|
30
|
+
* the on-state a toggle needs, so it reads as on at rest, not only mid-click.
|
|
31
|
+
* Only toggle buttons get these classes, so every other Button renders the
|
|
32
|
+
* same markup as before.
|
|
33
|
+
*/
|
|
10
34
|
declare const buttonVariants: (props?: ({
|
|
11
35
|
variant?: "primary" | "secondary" | "tertiary" | null | undefined;
|
|
12
36
|
tone?: "success" | "danger" | "warning" | "info" | "neutral" | null | undefined;
|
|
@@ -16,6 +40,8 @@ declare const buttonVariants: (props?: ({
|
|
|
16
40
|
type ButtonVariantProps = VariantProps<typeof buttonVariants>;
|
|
17
41
|
/** @public */
|
|
18
42
|
export interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'disabled'>, Omit<ButtonVariantProps, 'iconOnly'> {
|
|
43
|
+
/** Visual treatment: `primary`, `secondary` or `tertiary`. Defaults to `secondary` (an outline), so pass `primary` for the main action. */
|
|
44
|
+
variant?: ButtonVariantProps['variant'];
|
|
19
45
|
/** Render the button chrome onto a single child element for link semantics. */
|
|
20
46
|
asChild?: boolean;
|
|
21
47
|
/** Optional accessible label used when children are not suitable as the name. */
|
|
@@ -26,17 +52,22 @@ export interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonE
|
|
|
26
52
|
iconLeft?: React.ReactNode;
|
|
27
53
|
/** Trailing icon rendered after the label. */
|
|
28
54
|
iconRight?: React.ReactNode;
|
|
29
|
-
/** Render
|
|
55
|
+
/** Render a square icon-only control; `label` becomes its aria-label. */
|
|
30
56
|
iconOnly?: boolean;
|
|
31
57
|
/** Disable interaction. Mirrors the native HTML attribute. */
|
|
32
58
|
disabled?: boolean;
|
|
59
|
+
/** Make it a toggle button (aria-pressed), controlled. */
|
|
60
|
+
pressed?: boolean;
|
|
61
|
+
/** Initial toggle state when `pressed` is not set. */
|
|
62
|
+
defaultPressed?: boolean;
|
|
63
|
+
/** Called with the next pressed state on click. */
|
|
64
|
+
onPressedChange?: (pressed: boolean) => void;
|
|
33
65
|
}
|
|
34
66
|
/**
|
|
35
67
|
* Triggers an action when activated.
|
|
36
|
-
* @usage Trigger an action (submit, save, open a dialog) with a text label and optional icons; for an icon-only control pass iconOnly with iconLeft.
|
|
68
|
+
* @usage Trigger an action (submit, save, open a dialog) with a text label and optional icons; for an icon-only control pass iconOnly with iconLeft and label; for an on/off toggle pass pressed.
|
|
37
69
|
* @whenNot Navigating to another page, where a link is the correct element.
|
|
38
70
|
* @useInstead InlineLink navigation to another page
|
|
39
71
|
*/
|
|
40
72
|
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
41
|
-
|
|
42
|
-
export { buttonVariants };
|
|
73
|
+
export {};
|