@espressif/dashboard-ui-components 1.13.0 → 1.14.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.
Files changed (170) hide show
  1. package/.claude/rules/dashboard-ui-consumption.md +41 -0
  2. package/.cursor/rules/dashboard-ui-consumption.mdc +39 -1
  3. package/CHANGELOG.md +222 -0
  4. package/README.md +50 -4
  5. package/dist/{alert.props-CcKo49Rb.d.ts → alert.props-BuLuWmXA.d.ts} +3 -3
  6. package/dist/common/copyright-card/copyright-card.js +1 -1
  7. package/dist/common/footer-card/footer-card.js +2 -2
  8. package/dist/common/index.d.ts +3 -0
  9. package/dist/common/my-account-menu/my-account-menu.js +2 -2
  10. package/dist/common/page-loader/page-loader.js +4 -1
  11. package/dist/common/profile-card/profile-card.js +2 -2
  12. package/dist/components/accordion/accordion.js +6 -11
  13. package/dist/components/alert/index.d.ts +5 -5
  14. package/dist/components/anchored-panel/anchored-panel.js +4 -4
  15. package/dist/components/async-multi-select/async-multi-select.js +8 -8
  16. package/dist/components/badge/index.d.ts +1 -1
  17. package/dist/components/bottom-sheet/_hooks/use-sheet-drag.js +112 -0
  18. package/dist/components/bottom-sheet/bottom-sheet.js +84 -0
  19. package/dist/components/bottom-sheet/index.d.ts +50 -0
  20. package/dist/components/bottom-sheet/index.js +3 -0
  21. package/dist/components/bubble/bubble.js +1 -1
  22. package/dist/components/calendar/calendar.js +5 -5
  23. package/dist/components/cards/animated-card/animated-card.js +1 -1
  24. package/dist/components/cards/basic-details-card.js +2 -2
  25. package/dist/components/cards/collapsible-card.js +1 -1
  26. package/dist/components/cards/index.d.ts +2 -2
  27. package/dist/components/cards/no-data-card/no-data-card.js +2 -2
  28. package/dist/components/cards/section-card.js +12 -12
  29. package/dist/components/cards/simple-card.js +2 -5
  30. package/dist/components/category-card/category-card.js +2 -2
  31. package/dist/components/chart/chart.js +4 -4
  32. package/dist/components/chart/donut-chart.js +1 -1
  33. package/dist/components/chart/treemap-chart.js +1 -1
  34. package/dist/components/choice-card/choice-card.js +3 -3
  35. package/dist/components/code-editor/code-editor.js +4 -3
  36. package/dist/components/data-table/table-header.js +1 -1
  37. package/dist/components/date-range-picker/date-range-picker.js +3 -3
  38. package/dist/components/dynamic-list/dynamic-list.js +14 -13
  39. package/dist/components/dynamic-list/index.d.ts +1 -1
  40. package/dist/components/error-display/full-size-error/full-size-error.js +2 -2
  41. package/dist/components/expandable-text/expandable-text-overlay.js +1 -1
  42. package/dist/components/facet-filters/filter-group.js +2 -2
  43. package/dist/components/feature-grid/feature-grid.js +3 -3
  44. package/dist/components/file-input/file-input.js +8 -8
  45. package/dist/components/file-upload/file-upload.js +4 -4
  46. package/dist/components/fullscreen-dialog/fullscreen-dialog.js +1 -1
  47. package/dist/components/gradient-ring-button/_hooks/use-ring-geometry.js +116 -0
  48. package/dist/components/gradient-ring-button/gradient-ring-button.js +44 -0
  49. package/dist/components/gradient-ring-button/gradient-ring.js +77 -0
  50. package/dist/components/gradient-ring-button/index.d.ts +66 -0
  51. package/dist/components/gradient-ring-button/index.js +3 -0
  52. package/dist/components/horizontal-stepper/horizontal-stepper.js +2 -6
  53. package/dist/components/horizontal-stepper/index.d.ts +1 -1
  54. package/dist/components/icon-avatar/index.d.ts +3 -3
  55. package/dist/components/icon-text-action-card/index.d.ts +4 -4
  56. package/dist/components/index.d.ts +9 -7
  57. package/dist/components/index.js +5 -1
  58. package/dist/components/key-value-manager/key-value-manager-add-popover.js +1 -1
  59. package/dist/components/key-value-manager/key-value-manager-table.js +1 -1
  60. package/dist/components/link/link.js +7 -7
  61. package/dist/components/list/list-item.utils.js +5 -4
  62. package/dist/components/list/list.js +1 -1
  63. package/dist/components/list-details/index.d.ts +2 -2
  64. package/dist/components/markdown-content/markdown-content.components.js +2 -2
  65. package/dist/components/media-card/media-card-reveal.js +2 -2
  66. package/dist/components/media-card/media-card.js +2 -2
  67. package/dist/components/monospace-content/index.d.ts +4 -4
  68. package/dist/components/monospace-content/monospace-content.js +9 -11
  69. package/dist/components/nav-bar/nav-bar-mobile-menu.js +3 -3
  70. package/dist/components/nav-bar/nav-bar.js +4 -4
  71. package/dist/components/notice-strip/notice-strip.js +1 -1
  72. package/dist/components/option-card-group/option-card-group.js +2 -2
  73. package/dist/components/overflow-badge-list/index.d.ts +2 -2
  74. package/dist/components/overflow-badge-list/overflow-badge-list.js +3 -3
  75. package/dist/components/page-banner/page-banner.js +1 -1
  76. package/dist/components/page-container/page-container.js +1 -1
  77. package/dist/components/pagination/pagination.js +1 -1
  78. package/dist/components/progress-bar/progress-bar.js +2 -2
  79. package/dist/components/qr-code/qr-code.js +2 -2
  80. package/dist/components/radio-group/radio-group.js +3 -3
  81. package/dist/components/range-field/range-field.js +9 -12
  82. package/dist/components/readout/readout.js +1 -1
  83. package/dist/components/requirement-list/requirement-list.js +5 -10
  84. package/dist/components/scrollable-sections/scrollable-sections.js +1 -1
  85. package/dist/components/search-field-shell.js +8 -8
  86. package/dist/components/selectable-card-list/selectable-card-list-shared.js +6 -6
  87. package/dist/components/showcase-card/showcase-card.js +2 -2
  88. package/dist/components/sidebar/sidebar.js +13 -15
  89. package/dist/components/simple-clickable-card/index.d.ts +4 -4
  90. package/dist/components/simple-clickable-card/simple-clickable-card-shared.js +17 -23
  91. package/dist/components/simple-info-card/index.d.ts +3 -3
  92. package/dist/components/simple-list/index.d.ts +1 -1
  93. package/dist/components/simple-list/simple-list.js +8 -8
  94. package/dist/components/simple-paginated-list/simple-paginated-list.js +1 -4
  95. package/dist/components/stat-card/stat-card.js +7 -13
  96. package/dist/components/status-badge/index.d.ts +3 -3
  97. package/dist/components/status-badge/status-badge.js +4 -4
  98. package/dist/components/status-card-list/status-card-list.js +6 -6
  99. package/dist/components/tag/index.d.ts +1 -1
  100. package/dist/components/tag/tag.js +4 -4
  101. package/dist/components/tag-input/tag-input.js +12 -12
  102. package/dist/components/timeline/timeline.js +2 -2
  103. package/dist/components/toast/index.d.ts +1 -1
  104. package/dist/components/toast/toast.js +2 -2
  105. package/dist/components/toolbar/index.d.ts +5 -2
  106. package/dist/components/toolbar/toolbar-button.js +1 -1
  107. package/dist/components/toolbar/toolbar.js +9 -3
  108. package/dist/components/trace/trace.js +1 -1
  109. package/dist/components/transfer-list/transfer-list.js +2 -2
  110. package/dist/components/typography/index.d.ts +12 -3
  111. package/dist/components/typography/typography-variants.js +98 -13
  112. package/dist/components/typography/typography.js +4 -2
  113. package/dist/components/user-type-badge/user-type-badge.js +4 -4
  114. package/dist/components/vertical-stepper/vertical-stepper.js +11 -7
  115. package/dist/core/alert.js +3 -3
  116. package/dist/core/animate-ui/components/animate/code-header.js +1 -1
  117. package/dist/core/animate-ui/components/animate/code.js +1 -1
  118. package/dist/core/animate-ui/components/animate/tabs.js +6 -6
  119. package/dist/core/animate-ui/components/animate/tooltip.js +1 -1
  120. package/dist/core/animate-ui/components/base/progress.js +2 -2
  121. package/dist/core/animate-ui/components/radix/accordion.js +2 -2
  122. package/dist/core/animate-ui/components/radix/dialog.js +2 -2
  123. package/dist/core/animate-ui/components/radix/dropdown-menu.js +6 -6
  124. package/dist/core/animate-ui/components/radix/sheet.js +2 -2
  125. package/dist/core/animate-ui/components/radix/sidebar.js +8 -8
  126. package/dist/core/animate-ui/components/radix/toggle.js +1 -1
  127. package/dist/core/badge.js +1 -1
  128. package/dist/core/breadcrumb.js +1 -1
  129. package/dist/core/button/button.js +2 -2
  130. package/dist/core/button-group.js +1 -1
  131. package/dist/core/button.js +2 -2
  132. package/dist/core/card.js +2 -2
  133. package/dist/core/combobox/combobox.js +3 -3
  134. package/dist/core/command.js +5 -5
  135. package/dist/core/field-label-row.js +4 -4
  136. package/dist/core/form.js +2 -2
  137. package/dist/core/index.d.ts +1 -1
  138. package/dist/core/input/input.js +11 -11
  139. package/dist/core/input-otp/input-otp.js +12 -12
  140. package/dist/core/label.js +1 -1
  141. package/dist/core/select.js +6 -6
  142. package/dist/core/separator.js +1 -1
  143. package/dist/core/table.js +2 -2
  144. package/dist/core/textarea/textarea.js +9 -9
  145. package/dist/{icon-avatar.props-RYtw2eSW.d.ts → icon-avatar.props-BJe0-vva.d.ts} +1 -1
  146. package/dist/{icon-text-action-card.props-B2ggncUK.d.ts → icon-text-action-card.props-BU7yFi2Q.d.ts} +2 -2
  147. package/dist/index.d.ts +9 -7
  148. package/dist/index.js +6 -2
  149. package/dist/layouts/entry-layout/entry-layout.js +1 -1
  150. package/dist/layouts/index.d.ts +21 -6
  151. package/dist/layouts/index.js +1 -1
  152. package/dist/layouts/minimal-workspace-layout/minimal-workspace-layout.js +10 -18
  153. package/dist/layouts/minimal-workspace-layout/sidebar-trigger.js +35 -7
  154. package/dist/layouts/workspace-layout/footer/footer.js +1 -1
  155. package/dist/markdown/index.d.ts +4 -4
  156. package/dist/{section-card-B7c5uc08.d.ts → section-card-DqQeQkzU.d.ts} +1 -1
  157. package/dist/{simple-clickable-card.props-BrPCw7CR.d.ts → simple-clickable-card.props-BhhotZMp.d.ts} +2 -2
  158. package/dist/{status-badge.props-lKlEOfRt.d.ts → status-badge.props-BVe8CmQZ.d.ts} +1 -1
  159. package/dist/styles/type-scale.js +153 -0
  160. package/dist/tailwind-preset.js +120 -1
  161. package/dist/toast/index.d.ts +1 -1
  162. package/dist/utils/cn.js +16 -5
  163. package/dist/utils/index.d.ts +31 -2
  164. package/dist/utils/index.js +2 -1
  165. package/dist/utils/variant.js +47 -47
  166. package/dist/{variant-D81RhpbR.d.ts → variant-DjdaxfIA.d.ts} +6 -1
  167. package/package.json +3 -1
  168. package/src/styles/theme.css +8 -3
  169. package/src/styles/type-scale.css +152 -0
  170. package/tailwind.preset.ts +23 -0
@@ -264,7 +264,7 @@ function DateRangePicker({ presets, presetLabels, allowCustom = false, lockEndTo
264
264
  type: "button",
265
265
  onClick: () => handlePresetClick(id),
266
266
  onMouseEnter: () => setShowCalendar(false),
267
- className: cn("flex w-full items-center justify-between gap-6 px-3 py-1.5 text-left text-sm hover:bg-accent", selectedPresetId === id && "font-medium"),
267
+ className: cn("flex w-full items-center justify-between gap-6 px-3 py-1.5 text-left type-label font-normal hover:bg-accent", selectedPresetId === id && "font-medium"),
268
268
  children: [resolveLabel(id), selectedPresetId === id && /* @__PURE__ */ jsx(CheckIcon, { className: "size-4 shrink-0 text-primary" })]
269
269
  }, id)),
270
270
  allowCustom && /* @__PURE__ */ jsxs(Fragment$1, { children: [showPresetRows && /* @__PURE__ */ jsx("div", { className: "mx-1 my-1 h-px bg-border" }), /* @__PURE__ */ jsxs("button", {
@@ -278,14 +278,14 @@ function DateRangePicker({ presets, presetLabels, allowCustom = false, lockEndTo
278
278
  onPointerEnter: (event) => {
279
279
  if (event.pointerType === "mouse") openCalendarPanel();
280
280
  },
281
- className: cn("flex w-full items-center justify-between gap-6 px-3 py-1.5 text-left text-sm hover:bg-accent", showCalendar && "bg-accent font-medium"),
281
+ className: cn("flex w-full items-center justify-between gap-6 px-3 py-1.5 text-left type-label font-normal hover:bg-accent", showCalendar && "bg-accent font-medium"),
282
282
  children: [resolveLabel("custom"), /* @__PURE__ */ jsx(ChevronRightIcon, { className: cn("size-4 shrink-0 text-muted-foreground transition-transform duration-200", showCalendar && "rotate-90") })]
283
283
  })] }),
284
284
  showPresetRows && clearable && hasSelection && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", { className: "mx-1 my-1 h-px bg-border" }), /* @__PURE__ */ jsxs("button", {
285
285
  type: "button",
286
286
  onClick: handleClear,
287
287
  onMouseEnter: () => setShowCalendar(false),
288
- className: "flex w-full items-center justify-between gap-6 px-3 py-1.5 text-left text-sm text-muted-foreground hover:bg-accent",
288
+ className: "flex w-full items-center justify-between gap-6 px-3 py-1.5 text-left type-label font-normal text-muted-foreground hover:bg-accent",
289
289
  children: [clearLabel, /* @__PURE__ */ jsx(XIcon, { className: "size-4 shrink-0" })]
290
290
  })] })
291
291
  ]
@@ -164,13 +164,18 @@ function rowUsesTagsPropertyArray(key, value, rowMeta) {
164
164
  return isTagsPropertyKey(key) && isPlainStringArray(value) && !rowMeta?.valueRender && !rowMeta?.valueFormatter;
165
165
  }
166
166
  var CODE_DISPLAY_CLASSNAME = "min-w-0 w-full max-w-full max-h-[200px] text-start [&_pre]:text-start";
167
+ /**
168
+ * Text roles, the same at every `size` (size moves gaps, avatar and icon
169
+ * sizes only): the key is a field label, the value the muted line beside or
170
+ * under it.
171
+ */
172
+ var LABEL_TYPOGRAPHY = "type-label font-semibold";
173
+ var VALUE_TYPOGRAPHY = "type-secondary";
167
174
  var DYNAMIC_LIST_SIZE_STYLES = {
168
175
  sm: {
169
176
  listGap: "gap-4",
170
177
  rowGap: "gap-3",
171
178
  itemGap: "gap-1.5",
172
- labelTypography: "text-xs font-semibold",
173
- valueTypography: "text-xs",
174
179
  avatarSize: "h-8 w-8",
175
180
  avatarFallbackTypography: "text-[10px]",
176
181
  rowIcon: "h-3 w-3 shrink-0"
@@ -179,8 +184,6 @@ var DYNAMIC_LIST_SIZE_STYLES = {
179
184
  listGap: "gap-5",
180
185
  rowGap: "gap-4",
181
186
  itemGap: "gap-2",
182
- labelTypography: "text-sm font-semibold",
183
- valueTypography: "text-sm",
184
187
  avatarSize: "h-10 w-10",
185
188
  avatarFallbackTypography: "text-xs",
186
189
  rowIcon: "h-3.5 w-3.5 shrink-0"
@@ -189,8 +192,6 @@ var DYNAMIC_LIST_SIZE_STYLES = {
189
192
  listGap: "gap-6",
190
193
  rowGap: "gap-5",
191
194
  itemGap: "gap-3",
192
- labelTypography: "text-base font-semibold",
193
- valueTypography: "text-base",
194
195
  avatarSize: "h-12 w-12",
195
196
  avatarFallbackTypography: "text-sm",
196
197
  rowIcon: "h-4 w-4 shrink-0"
@@ -256,7 +257,7 @@ function wrapTypedValue(value, rowMeta, key, opts, effectiveType) {
256
257
  case "badge": return /* @__PURE__ */ jsx(Badge, {
257
258
  variant: "solid",
258
259
  color: "gray",
259
- className: cn("w-fit max-w-full self-start font-medium", DYNAMIC_LIST_SIZE_STYLES[opts.size].valueTypography),
260
+ className: cn("w-fit max-w-full self-start font-medium", VALUE_TYPOGRAPHY),
260
261
  children: base
261
262
  });
262
263
  case "info": return /* @__PURE__ */ jsx(Alert, {
@@ -396,10 +397,10 @@ function DynamicList({ items, meta, className, size = "default", labelClassName,
396
397
  className: cn("flex min-w-0 flex-1 flex-col sm:flex-row sm:gap-0", sizeStyles.itemGap, valueRowAlignStart ? "sm:items-start" : "sm:items-center"),
397
398
  style: splitStyle,
398
399
  children: [/* @__PURE__ */ jsx("span", {
399
- className: cn("truncate sm:flex-none sm:basis-[var(--dynamic-list-key-width)]", sizeStyles.labelTypography, labelClassName),
400
+ className: cn("truncate sm:flex-none sm:basis-[var(--dynamic-list-key-width)]", LABEL_TYPOGRAPHY, labelClassName),
400
401
  children: labelText
401
402
  }), /* @__PURE__ */ jsx("div", {
402
- className: cn("flex min-w-0 text-muted-foreground sm:flex-none sm:basis-[var(--dynamic-list-value-width)] sm:justify-end", sizeStyles.valueTypography, usesBadgeArrayLayout ? "items-start sm:pt-0.5 text-start" : "items-center"),
403
+ className: cn("flex min-w-0 text-muted-foreground sm:flex-none sm:basis-[var(--dynamic-list-value-width)] sm:justify-end", VALUE_TYPOGRAPHY, usesBadgeArrayLayout ? "items-start sm:pt-0.5 text-start" : "items-center"),
403
404
  children: /* @__PURE__ */ jsx("div", {
404
405
  className: cn("min-w-0 max-w-full", !usesBadgeArrayLayout && "sm:truncate sm:text-end", valueClassName),
405
406
  children: valueDisplay
@@ -411,11 +412,11 @@ function DynamicList({ items, meta, className, size = "default", labelClassName,
411
412
  if (!needsBlockValueLayout) return /* @__PURE__ */ jsx(BasicDetailsCard, {
412
413
  icon: hideIcon ? void 0 : rowIcon,
413
414
  primaryText: /* @__PURE__ */ jsx("span", {
414
- className: cn(sizeStyles.labelTypography, labelClassName),
415
+ className: cn(LABEL_TYPOGRAPHY, labelClassName),
415
416
  children: labelText
416
417
  }),
417
418
  secondaryText: /* @__PURE__ */ jsx("span", {
418
- className: cn(sizeStyles.valueTypography, valueClassName),
419
+ className: cn(VALUE_TYPOGRAPHY, valueClassName),
419
420
  children: valueDisplay
420
421
  })
421
422
  }, key);
@@ -430,10 +431,10 @@ function DynamicList({ items, meta, className, size = "default", labelClassName,
430
431
  }), /* @__PURE__ */ jsxs("div", {
431
432
  className: cn("flex min-w-0 flex-1 flex-col", sizeStyles.itemGap),
432
433
  children: [/* @__PURE__ */ jsx("span", {
433
- className: cn(sizeStyles.labelTypography, labelClassName),
434
+ className: cn(LABEL_TYPOGRAPHY, labelClassName),
434
435
  children: labelText
435
436
  }), /* @__PURE__ */ jsx("div", {
436
- className: cn("min-w-0", sizeStyles.valueTypography, valueClassName),
437
+ className: cn("min-w-0", VALUE_TYPOGRAPHY, valueClassName),
437
438
  children: valueDisplay
438
439
  })]
439
440
  })]
@@ -34,7 +34,7 @@ interface DynamicListProps {
34
34
  /** Optional per-item overrides keyed by `DynamicListEntry.key`. */
35
35
  meta?: Record<string, DynamicListMetaEntry>;
36
36
  className?: string;
37
- /** Overall list spacing and typography scale. Default: `"default"`. */
37
+ /** Overall list spacing (and the avatar size). Text keeps its type role at every size. Default: `"default"`. */
38
38
  size?: DynamicListSize;
39
39
  /** Extra classes for each row label. */
40
40
  labelClassName?: string;
@@ -6,11 +6,11 @@ function FullSizeError({ title, children, illustration }) {
6
6
  children: [
7
7
  illustration,
8
8
  title && /* @__PURE__ */ jsx("h3", {
9
- className: "text-lg font-semibold",
9
+ className: "type-headline",
10
10
  children: title
11
11
  }),
12
12
  /* @__PURE__ */ jsx("div", {
13
- className: "text-muted-foreground text-sm",
13
+ className: "type-body text-muted-foreground",
14
14
  children
15
15
  })
16
16
  ]
@@ -64,7 +64,7 @@ function ExpandableTextOverlay({ text, header, footer, closeLabel, origin, open,
64
64
  }),
65
65
  /* @__PURE__ */ jsx("p", {
66
66
  tabIndex: 0,
67
- className: "m-0 min-h-0 flex-1 overflow-y-auto overscroll-contain text-sm whitespace-pre-line text-foreground-secondary outline-none focus-visible:ring-2 focus-visible:ring-ring",
67
+ className: "m-0 min-h-0 flex-1 overflow-y-auto overscroll-contain type-body whitespace-pre-line text-foreground-secondary outline-none focus-visible:ring-2 focus-visible:ring-ring",
68
68
  children: text
69
69
  }),
70
70
  footer && /* @__PURE__ */ jsx("div", {
@@ -53,7 +53,7 @@ function FilterGroup({ group, selected, onToggle, order, animate, labels }) {
53
53
  /* @__PURE__ */ jsx("ul", {
54
54
  className: "m-0 flex list-none flex-col gap-1 p-0",
55
55
  children: view.visible.map((option) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs("label", {
56
- className: "flex cursor-pointer items-center gap-2 rounded-md px-1 py-1 text-sm text-foreground hover:bg-accent",
56
+ className: "flex cursor-pointer items-center gap-2 rounded-md px-1 py-1 type-body text-foreground hover:bg-accent",
57
57
  children: [
58
58
  /* @__PURE__ */ jsx(Checkbox, {
59
59
  checked: selected.includes(option.value),
@@ -64,7 +64,7 @@ function FilterGroup({ group, selected, onToggle, order, animate, labels }) {
64
64
  children: option.label
65
65
  }),
66
66
  /* @__PURE__ */ jsx("span", {
67
- className: "font-mono text-xs text-foreground-muted",
67
+ className: "type-caption font-mono text-foreground-muted",
68
68
  children: option.count
69
69
  })
70
70
  ]
@@ -85,15 +85,15 @@ var FeatureGrid = React$1.forwardRef(function FeatureGrid({ items, numbered = tr
85
85
  className: cn("flex gap-3 border-r border-b border-border p-4 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset", index >= pageSize && "motion-safe:animate-rise-in"),
86
86
  children: [numbered && /* @__PURE__ */ jsx("span", {
87
87
  "aria-hidden": true,
88
- className: "h-fit shrink-0 rounded-md bg-muted px-1.5 py-0.5 font-mono text-xs font-semibold text-muted-foreground",
88
+ className: "h-fit shrink-0 rounded-md bg-muted px-1.5 py-0.5 font-mono type-caption font-semibold text-muted-foreground",
89
89
  children: numberOf(index, items.length)
90
90
  }), /* @__PURE__ */ jsxs("div", {
91
91
  className: "flex min-w-0 flex-col gap-1",
92
92
  children: [/* @__PURE__ */ jsx(Title, {
93
- className: "m-0 text-sm font-semibold text-foreground [overflow-wrap:anywhere]",
93
+ className: "m-0 type-heading text-foreground [overflow-wrap:anywhere]",
94
94
  children: item.title
95
95
  }), item.description != null && /* @__PURE__ */ jsx("p", {
96
- className: "m-0 text-sm leading-relaxed text-muted-foreground",
96
+ className: "m-0 type-body text-muted-foreground",
97
97
  children: item.description
98
98
  })]
99
99
  })]
@@ -36,9 +36,9 @@ function mergeFiles(existing, incoming, multiple) {
36
36
  return next;
37
37
  }
38
38
  var sizeClasses = {
39
- sm: "h-8 text-xs",
40
- default: "h-10 text-base md:text-sm",
41
- lg: "h-12 text-lg"
39
+ sm: "h-8 type-input",
40
+ default: "h-10 type-input",
41
+ lg: "h-12 type-input"
42
42
  };
43
43
  var iconSizeClasses = {
44
44
  sm: "size-3.5",
@@ -246,12 +246,12 @@ var FileInput = React$1.forwardRef(function FileInput({ label, required, size, r
246
246
  children: "*"
247
247
  })]
248
248
  }), hintContent && /* @__PURE__ */ jsx("span", {
249
- className: "text-sm text-muted-foreground",
249
+ className: "type-caption text-muted-foreground",
250
250
  children: hintContent
251
251
  })]
252
252
  }),
253
253
  !label && hintContent && /* @__PURE__ */ jsx("span", {
254
- className: "text-sm text-muted-foreground",
254
+ className: "type-caption text-muted-foreground",
255
255
  children: hintContent
256
256
  }),
257
257
  /* @__PURE__ */ jsxs("div", {
@@ -303,17 +303,17 @@ var FileInput = React$1.forwardRef(function FileInput({ label, required, size, r
303
303
  }),
304
304
  errorContent && /* @__PURE__ */ jsx("div", {
305
305
  id: `${inputId}-error`,
306
- className: "text-sm text-destructive",
306
+ className: "type-caption text-destructive",
307
307
  children: errorContent
308
308
  }),
309
309
  startHelperContent && !errorContent && /* @__PURE__ */ jsx("div", {
310
310
  id: helperStartId,
311
- className: "text-sm text-muted-foreground",
311
+ className: "type-caption text-muted-foreground",
312
312
  children: startHelperContent
313
313
  }),
314
314
  endHelperContent && !errorContent && /* @__PURE__ */ jsx("div", {
315
315
  id: helperEndId,
316
- className: "text-sm text-end text-muted-foreground",
316
+ className: "type-caption text-end text-muted-foreground",
317
317
  children: endHelperContent
318
318
  })
319
319
  ]
@@ -259,9 +259,9 @@ var FileUpload = React$1.forwardRef(function FileUpload({ className, title = "Dr
259
259
  children: title
260
260
  }), hasDescription ? /* @__PURE__ */ jsx(Typography, {
261
261
  id: descriptionId,
262
- variant: "body2",
262
+ variant: "body",
263
263
  as: "p",
264
- className: "text-sm text-muted-foreground",
264
+ className: "text-muted-foreground",
265
265
  children: description
266
266
  }) : null]
267
267
  }),
@@ -293,9 +293,9 @@ var FileUpload = React$1.forwardRef(function FileUpload({ className, title = "Dr
293
293
  className: "truncate font-semibold",
294
294
  children: file.name
295
295
  }), /* @__PURE__ */ jsx(Typography, {
296
- variant: "body2",
296
+ variant: "caption",
297
297
  as: "p",
298
- className: "text-xs text-muted-foreground",
298
+ className: "text-muted-foreground",
299
299
  children: formatFileSize(file.size)
300
300
  })]
301
301
  }),
@@ -45,7 +45,7 @@ function FullscreenDialog({ icon, iconSize = "lg", heading, secondaryText, child
45
45
  })
46
46
  }),
47
47
  heading != null && /* @__PURE__ */ jsx("h1", {
48
- className: "text-2xl mb-4 font-normal text-center text-muted-foreground shrink-0",
48
+ className: "type-title mb-4 font-normal text-center text-muted-foreground shrink-0",
49
49
  children: heading
50
50
  }),
51
51
  secondaryText != null && /* @__PURE__ */ jsx("div", {
@@ -0,0 +1,116 @@
1
+ import { useEffect, useLayoutEffect, useRef } from "react";
2
+ //#region src/components/gradient-ring-button/_hooks/use-ring-geometry.ts
3
+ /** The ring's width in px: the stroke, and the padding it sits in around the control (`p-0.5`). */
4
+ var RING_WIDTH = 2;
5
+ /** One full turn of the gradient while the control is engaged, in seconds, when none is given. */
6
+ var DEFAULT_TURN_SECONDS = 1.5;
7
+ /** How long after it appears a cued ring starts its one turn: once whatever it sits in has risen into place. */
8
+ var CUE_DELAY_MS = 800;
9
+ /** The pill's outline, a RING_WIDTH stroke centred half its width inside the control's edge. */
10
+ function place(wrap, svg) {
11
+ const { width, height } = wrap.getBoundingClientRect();
12
+ const inset = RING_WIDTH / 2;
13
+ const w = Math.max(width - RING_WIDTH, 0);
14
+ const h = Math.max(height - RING_WIDTH, 0);
15
+ for (const rect of svg.querySelectorAll("rect")) {
16
+ rect.setAttribute("x", String(inset));
17
+ rect.setAttribute("y", String(inset));
18
+ rect.setAttribute("width", String(w));
19
+ rect.setAttribute("height", String(h));
20
+ rect.setAttribute("rx", String(h / 2));
21
+ rect.setAttribute("ry", String(h / 2));
22
+ }
23
+ }
24
+ /** Whether this SVG has the timeline methods the turn needs (jsdom, for one, has only some). */
25
+ function hasTimeline(svg) {
26
+ return [
27
+ "pauseAnimations",
28
+ "unpauseAnimations",
29
+ "animationsPaused",
30
+ "getCurrentTime",
31
+ "setCurrentTime"
32
+ ].every((name) => typeof svg[name] === "function");
33
+ }
34
+ /**
35
+ * Pointed at, or holding focus that came from the keyboard. `:hover` counts
36
+ * only where a pointer can hover: a touch screen keeps it true after a tap
37
+ * until the next tap elsewhere, and the ring would turn on and on.
38
+ */
39
+ function engaged(wrap) {
40
+ return typeof window.matchMedia === "function" && window.matchMedia("(hover: hover)").matches && wrap.matches(":hover") || wrap.querySelector(":focus-visible") !== null;
41
+ }
42
+ /**
43
+ * Plays the ring's turn while it is engaged; let go, it finishes the turn it
44
+ * is on and pauses exactly at the start of the next, so it always rests as it
45
+ * began (start colour on the left, end colour on the right). Engaged again
46
+ * before then, it simply carries on. Returns the cleanup.
47
+ */
48
+ function runWhileEngaged(wrap, svg, turn, cue) {
49
+ let settle;
50
+ svg.pauseAnimations();
51
+ svg.setCurrentTime(0);
52
+ function play() {
53
+ if (!engaged(wrap)) return;
54
+ clearTimeout(settle);
55
+ settle = void 0;
56
+ svg.unpauseAnimations();
57
+ }
58
+ function letGo() {
59
+ if (engaged(wrap) || svg.animationsPaused() || settle !== void 0) return;
60
+ const into = svg.getCurrentTime() % turn;
61
+ settle = setTimeout(() => {
62
+ settle = void 0;
63
+ svg.pauseAnimations();
64
+ svg.setCurrentTime(Math.round(svg.getCurrentTime() / turn) * turn);
65
+ }, (turn - into) * 1e3);
66
+ }
67
+ const cueing = cue ? setTimeout(() => {
68
+ svg.unpauseAnimations();
69
+ letGo();
70
+ }, CUE_DELAY_MS) : void 0;
71
+ const events = [
72
+ ["pointerenter", play],
73
+ ["focusin", play],
74
+ ["pointerleave", letGo],
75
+ ["focusout", letGo]
76
+ ];
77
+ for (const [name, handler] of events) wrap.addEventListener(name, handler);
78
+ return () => {
79
+ clearTimeout(settle);
80
+ clearTimeout(cueing);
81
+ for (const [name, handler] of events) wrap.removeEventListener(name, handler);
82
+ };
83
+ }
84
+ /**
85
+ * Keeps the ring's SVG outline the shape of its control (a pill is a
86
+ * rectangle whose corner radius is half its height, measured, since SVG
87
+ * cannot express it otherwise), and runs the ring's turn (`turn` seconds a
88
+ * revolution, the SMIL `dur`) only while the control is pointed at or focused
89
+ * from the keyboard. Cued, it also turns once by itself as it appears.
90
+ */
91
+ function useRingGeometry(moving, turn, cue = false) {
92
+ const wrapRef = useRef(null);
93
+ const svgRef = useRef(null);
94
+ useLayoutEffect(() => {
95
+ const wrap = wrapRef.current;
96
+ const svg = svgRef.current;
97
+ if (!wrap || !svg) return;
98
+ place(wrap, svg);
99
+ if (typeof ResizeObserver === "undefined") return;
100
+ const observer = new ResizeObserver(() => place(wrap, svg));
101
+ observer.observe(wrap);
102
+ return () => observer.disconnect();
103
+ }, []);
104
+ useEffect(() => {
105
+ const wrap = wrapRef.current;
106
+ const svg = svgRef.current;
107
+ if (!moving || !wrap || !svg || !hasTimeline(svg)) return;
108
+ return runWhileEngaged(wrap, svg, turn, cue);
109
+ }, [moving, turn]);
110
+ return {
111
+ wrapRef,
112
+ svgRef
113
+ };
114
+ }
115
+ //#endregion
116
+ export { DEFAULT_TURN_SECONDS, RING_WIDTH, useRingGeometry };
@@ -0,0 +1,44 @@
1
+ import { cn } from "../../utils/cn.js";
2
+ import { Button } from "../button/button.js";
3
+ import { DEFAULT_TURN_SECONDS } from "./_hooks/use-ring-geometry.js";
4
+ import { GradientRing } from "./gradient-ring.js";
5
+ import * as React$1 from "react";
6
+ import { jsx } from "react/jsx-runtime";
7
+ //#region src/components/gradient-ring-button/gradient-ring-button.tsx
8
+ /**
9
+ * The button inside the ring: clear in every state (the surface behind shows
10
+ * through; the ring is an SVG outline, so nothing behind needs covering),
11
+ * plain text, no shadow. Its own rings are off too: the ghost Button draws
12
+ * one on hover (2px, with a 2px offset painted in the page background) as
13
+ * well as on focus, and either covers the gradient ring with a dark band.
14
+ * The gradient ring is the hover and focus indicator instead.
15
+ */
16
+ var CLEAR = "rounded-full border-0 bg-transparent font-semibold text-foreground shadow-none hover:bg-transparent hover:ring-0 hover:ring-offset-0 focus-visible:bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 focus-visible:outline-none active:bg-transparent";
17
+ /**
18
+ * A clear pill button with a 2px border in the theme's gradient tokens that
19
+ * turns clockwise while it is pointed at or focused from the keyboard, and
20
+ * settles back when let go (see `GradientRing`). For the one step into
21
+ * something new on a surface, where a filled primary button is too loud.
22
+ *
23
+ * Every prop of the styled Button passes through except `variant` and
24
+ * `color`. `disabled` fades the ring and holds it still; `fullWidth`
25
+ * (default `false`) makes the ring the full width too.
26
+ */
27
+ var GradientRingButton = React$1.forwardRef(({ turnSeconds = DEFAULT_TURN_SECONDS, cue = false, fullWidth = false, disabled, className, ...props }, ref) => /* @__PURE__ */ jsx(GradientRing, {
28
+ wide: fullWidth,
29
+ quiet: Boolean(disabled),
30
+ cue,
31
+ turnSeconds,
32
+ children: /* @__PURE__ */ jsx(Button, {
33
+ ref,
34
+ ...props,
35
+ variant: "ghost",
36
+ color: "gray",
37
+ fullWidth,
38
+ disabled,
39
+ className: cn(CLEAR, className)
40
+ })
41
+ }));
42
+ GradientRingButton.displayName = "GradientRingButton";
43
+ //#endregion
44
+ export { GradientRingButton };
@@ -0,0 +1,77 @@
1
+ import { cn } from "../../utils/cn.js";
2
+ import { usePrefersReducedMotion } from "../../core/hooks/use-prefers-reduced-motion.js";
3
+ import { DEFAULT_TURN_SECONDS, RING_WIDTH, useRingGeometry } from "./_hooks/use-ring-geometry.js";
4
+ import { useId } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ //#region src/components/gradient-ring-button/gradient-ring.tsx
7
+ /**
8
+ * A 2px border in the theme's gradient (`--color-gradient-start` → middle →
9
+ * end) around one pill-shaped control: at rest the start colour is on the
10
+ * left and the end colour on the right. While the control is pointed at (or
11
+ * focused from the keyboard) the whole gradient turns clockwise, and when it
12
+ * is let go it finishes the turn it is on and settles back.
13
+ *
14
+ * SVG, not a turning CSS layer: a turning layer has to be clipped to the
15
+ * pill, and a clip on an animated layer softens its outermost pixel, which is
16
+ * the whole ring. A stroke is painted as a line wherever it is, so the
17
+ * control can stay transparent. The gradient turns in the outline's own box
18
+ * (objectBoundingBox), so a quarter turn puts the start colour along the
19
+ * whole top however wide the pill is. The stops take the tokens through
20
+ * `currentColor`, and the turn is SMIL. Not rendered for someone who asked
21
+ * for less motion: the ring then only brightens, and keyboard focus gets the
22
+ * page's usual outline.
23
+ */
24
+ function GradientRing({ children, wide = false, quiet = false, cue = false, turnSeconds = DEFAULT_TURN_SECONDS }) {
25
+ const reduced = usePrefersReducedMotion();
26
+ const moving = !quiet && !reduced;
27
+ const gradient = `gradient-ring-${useId().replace(/[^a-zA-Z0-9]/g, "")}`;
28
+ const { wrapRef, svgRef } = useRingGeometry(moving, turnSeconds, cue);
29
+ return /* @__PURE__ */ jsxs("span", {
30
+ ref: wrapRef,
31
+ "data-slot": "gradient-ring",
32
+ className: cn("group/ring relative rounded-full p-0.5", wide ? "flex w-full" : "inline-flex", !moving && !quiet && "has-focus-visible:outline-2 has-focus-visible:outline-offset-2 has-focus-visible:outline-ring"),
33
+ children: [children, /* @__PURE__ */ jsxs("svg", {
34
+ ref: svgRef,
35
+ "aria-hidden": "true",
36
+ className: cn("pointer-events-none absolute inset-0 size-full overflow-visible transition-opacity duration-300 motion-reduce:transition-none", quiet ? "opacity-35" : "opacity-75 group-hover/ring:opacity-100 group-has-focus-visible/ring:opacity-100"),
37
+ children: [/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", {
38
+ id: gradient,
39
+ x1: "0",
40
+ y1: "0.5",
41
+ x2: "1",
42
+ y2: "0.5",
43
+ children: [
44
+ /* @__PURE__ */ jsx("stop", {
45
+ offset: "0",
46
+ stopColor: "currentColor",
47
+ className: "text-gradient-start"
48
+ }),
49
+ /* @__PURE__ */ jsx("stop", {
50
+ offset: "0.5",
51
+ stopColor: "currentColor",
52
+ className: "text-gradient-middle"
53
+ }),
54
+ /* @__PURE__ */ jsx("stop", {
55
+ offset: "1",
56
+ stopColor: "currentColor",
57
+ className: "text-gradient-end"
58
+ }),
59
+ moving && /* @__PURE__ */ jsx("animateTransform", {
60
+ attributeName: "gradientTransform",
61
+ type: "rotate",
62
+ from: "0 0.5 0.5",
63
+ to: "360 0.5 0.5",
64
+ dur: `${turnSeconds}s`,
65
+ repeatCount: "indefinite"
66
+ })
67
+ ]
68
+ }) }), /* @__PURE__ */ jsx("rect", {
69
+ fill: "none",
70
+ stroke: `url(#${gradient})`,
71
+ strokeWidth: RING_WIDTH
72
+ })]
73
+ })]
74
+ });
75
+ }
76
+ //#endregion
77
+ export { GradientRing };
@@ -0,0 +1,66 @@
1
+ import * as React from 'react';
2
+ import { ReactNode } from 'react';
3
+ import { b as ButtonProps } from '../../button-BxJ7s6sR.js';
4
+ import '../../button-BK-DIR_L.js';
5
+ import 'class-variance-authority/types';
6
+ import 'class-variance-authority';
7
+ import '../../style-axes-DSQ2DGc5.js';
8
+ import '../../index-BQANnKs9.js';
9
+
10
+ /**
11
+ * The styled Button's props, less `variant` and `color` (the look is the
12
+ * component: clear, plain text, the gradient ring). `fullWidth` defaults to
13
+ * `false` here, and the ring goes full width with the button.
14
+ */
15
+ interface GradientRingButtonProps extends Omit<ButtonProps, "variant" | "color"> {
16
+ /** One full turn of the ring's gradient while pointed at or focused from the keyboard, in seconds. Default 1.5. */
17
+ turnSeconds?: number;
18
+ /** Turn once by itself as it appears ("this is your next step"), then settle. Read on mount only. */
19
+ cue?: boolean;
20
+ }
21
+
22
+ /**
23
+ * A clear pill button with a 2px border in the theme's gradient tokens that
24
+ * turns clockwise while it is pointed at or focused from the keyboard, and
25
+ * settles back when let go (see `GradientRing`). For the one step into
26
+ * something new on a surface, where a filled primary button is too loud.
27
+ *
28
+ * Every prop of the styled Button passes through except `variant` and
29
+ * `color`. `disabled` fades the ring and holds it still; `fullWidth`
30
+ * (default `false`) makes the ring the full width too.
31
+ */
32
+ declare const GradientRingButton: React.ForwardRefExoticComponent<GradientRingButtonProps & React.RefAttributes<HTMLButtonElement>>;
33
+
34
+ interface GradientRingProps {
35
+ /** One pill-shaped control (the ring draws over its outermost pixel). */
36
+ children: ReactNode;
37
+ /** The control takes the full width (a phone's own row). */
38
+ wide?: boolean;
39
+ /** A control that cannot be used now: the ring fades and stays still. */
40
+ quiet?: boolean;
41
+ /** Turn once by itself as it appears, then settle. Read on mount only. */
42
+ cue?: boolean;
43
+ /** One full turn of the gradient while the control is engaged, in seconds. Default 1.5. */
44
+ turnSeconds?: number;
45
+ }
46
+
47
+ /**
48
+ * A 2px border in the theme's gradient (`--color-gradient-start` → middle →
49
+ * end) around one pill-shaped control: at rest the start colour is on the
50
+ * left and the end colour on the right. While the control is pointed at (or
51
+ * focused from the keyboard) the whole gradient turns clockwise, and when it
52
+ * is let go it finishes the turn it is on and settles back.
53
+ *
54
+ * SVG, not a turning CSS layer: a turning layer has to be clipped to the
55
+ * pill, and a clip on an animated layer softens its outermost pixel, which is
56
+ * the whole ring. A stroke is painted as a line wherever it is, so the
57
+ * control can stay transparent. The gradient turns in the outline's own box
58
+ * (objectBoundingBox), so a quarter turn puts the start colour along the
59
+ * whole top however wide the pill is. The stops take the tokens through
60
+ * `currentColor`, and the turn is SMIL. Not rendered for someone who asked
61
+ * for less motion: the ring then only brightens, and keyboard focus gets the
62
+ * page's usual outline.
63
+ */
64
+ declare function GradientRing({ children, wide, quiet, cue, turnSeconds }: GradientRingProps): React.JSX.Element;
65
+
66
+ export { GradientRing, GradientRingButton, type GradientRingButtonProps, type GradientRingProps };
@@ -0,0 +1,3 @@
1
+ import { GradientRing } from "./gradient-ring.js";
2
+ import { GradientRingButton } from "./gradient-ring-button.js";
3
+ export { GradientRing, GradientRingButton };
@@ -7,16 +7,12 @@ var sizes = {
7
7
  sm: {
8
8
  node: "size-7",
9
9
  icon: "size-3.5",
10
- label: "text-[11px]",
11
- description: "text-[11px]",
12
10
  line: "top-3.5",
13
11
  lineFromNode: "left-9"
14
12
  },
15
13
  default: {
16
14
  node: "size-9",
17
15
  icon: "size-4.5",
18
- label: "text-xs",
19
- description: "text-xs",
20
16
  line: "top-4.5",
21
17
  lineFromNode: "left-11"
22
18
  }
@@ -106,11 +102,11 @@ function HorizontalStepper({ steps, color = "primary", size = "default", tone =
106
102
  children: sized(step.icon, s.icon)
107
103
  }),
108
104
  /* @__PURE__ */ jsx("span", {
109
- className: cn("max-w-full font-semibold", step.description ? "mt-1" : "truncate", s.label, reached ? t.label : t.upcomingLabel, start && "text-left"),
105
+ className: cn("max-w-full type-label font-semibold", step.description ? "mt-1" : "truncate", reached ? t.label : t.upcomingLabel, start && "text-left"),
110
106
  children: step.label
111
107
  }),
112
108
  step.description && /* @__PURE__ */ jsx("span", {
113
- className: cn("max-w-full leading-snug text-muted-foreground", s.description, start ? "text-left" : "text-center"),
109
+ className: cn("max-w-full type-secondary text-muted-foreground", start ? "text-left" : "text-center"),
114
110
  children: step.description
115
111
  })
116
112
  ]
@@ -32,7 +32,7 @@ interface HorizontalStepperProps {
32
32
  steps: HorizontalStepperStep[];
33
33
  /** Fill of the steps reached (complete and current) and of the line between them. Default `primary`. */
34
34
  color?: Color;
35
- /** `sm`: 28px nodes and small labels, for a card. Default `default`. */
35
+ /** `sm`: 28px nodes and tighter spacing, for a card (labels keep the `label` role). Default `default`. */
36
36
  size?: HorizontalStepperSize;
37
37
  /**
38
38
  * `inverse` draws it for a dark overlay such as a `MediaCardReveal` panel, in
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react';
2
- import { I as IconAvatarProps } from '../../icon-avatar.props-RYtw2eSW.js';
3
- export { a as IconAvatarRingProps, b as IconAvatarVariant } from '../../icon-avatar.props-RYtw2eSW.js';
2
+ import { I as IconAvatarProps } from '../../icon-avatar.props-BJe0-vva.js';
3
+ export { a as IconAvatarRingProps, b as IconAvatarVariant } from '../../icon-avatar.props-BJe0-vva.js';
4
4
  import '../../index-BQANnKs9.js';
5
- import '../../variant-D81RhpbR.js';
5
+ import '../../variant-DjdaxfIA.js';
6
6
 
7
7
  declare function IconAvatar({ size, color, variant, ring, children, className, discClassName, discStyle, }: IconAvatarProps): React.JSX.Element;
8
8