@espressif/dashboard-ui-components 1.13.0 → 1.14.1

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 (178) hide show
  1. package/.claude/rules/dashboard-ui-consumption.md +42 -0
  2. package/.cursor/rules/dashboard-ui-consumption.mdc +40 -1
  3. package/CHANGELOG.md +272 -0
  4. package/README.md +68 -6
  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/avatar/avatar.js +1 -1
  17. package/dist/components/badge/index.d.ts +1 -1
  18. package/dist/components/bottom-sheet/_hooks/use-sheet-drag.js +112 -0
  19. package/dist/components/bottom-sheet/bottom-sheet.js +84 -0
  20. package/dist/components/bottom-sheet/index.d.ts +50 -0
  21. package/dist/components/bottom-sheet/index.js +3 -0
  22. package/dist/components/bubble/bubble.js +1 -1
  23. package/dist/components/button/button.js +2 -2
  24. package/dist/components/button/flash-button.js +4 -4
  25. package/dist/components/calendar/calendar.js +5 -5
  26. package/dist/components/cards/animated-card/animated-card.js +1 -1
  27. package/dist/components/cards/basic-details-card.js +2 -2
  28. package/dist/components/cards/collapsible-card.js +1 -1
  29. package/dist/components/cards/index.d.ts +2 -2
  30. package/dist/components/cards/no-data-card/no-data-card.js +2 -2
  31. package/dist/components/cards/section-card.js +12 -12
  32. package/dist/components/cards/simple-card.js +2 -5
  33. package/dist/components/category-card/category-card.js +2 -2
  34. package/dist/components/chart/chart.js +4 -4
  35. package/dist/components/chart/donut-chart.js +1 -1
  36. package/dist/components/chart/treemap-chart.js +1 -1
  37. package/dist/components/choice-card/choice-card.js +3 -3
  38. package/dist/components/code-editor/code-editor.js +4 -3
  39. package/dist/components/data-table/table-header.js +1 -1
  40. package/dist/components/date-range-picker/date-range-picker.js +3 -3
  41. package/dist/components/dynamic-list/dynamic-list.js +14 -13
  42. package/dist/components/dynamic-list/index.d.ts +1 -1
  43. package/dist/components/error-display/full-size-error/full-size-error.js +2 -2
  44. package/dist/components/expandable-text/expandable-text-overlay.js +1 -1
  45. package/dist/components/facet-filters/filter-group.js +2 -2
  46. package/dist/components/feature-grid/feature-grid.js +3 -3
  47. package/dist/components/file-input/file-input.js +8 -8
  48. package/dist/components/file-upload/file-upload.js +4 -4
  49. package/dist/components/fullscreen-dialog/fullscreen-dialog.js +1 -1
  50. package/dist/components/gradient-ring-button/_hooks/use-ring-geometry.js +116 -0
  51. package/dist/components/gradient-ring-button/gradient-ring-button.js +44 -0
  52. package/dist/components/gradient-ring-button/gradient-ring.js +77 -0
  53. package/dist/components/gradient-ring-button/index.d.ts +66 -0
  54. package/dist/components/gradient-ring-button/index.js +3 -0
  55. package/dist/components/horizontal-stepper/horizontal-stepper.js +4 -8
  56. package/dist/components/horizontal-stepper/index.d.ts +1 -1
  57. package/dist/components/icon-avatar/index.d.ts +3 -3
  58. package/dist/components/icon-text-action-card/index.d.ts +4 -4
  59. package/dist/components/index.d.ts +9 -7
  60. package/dist/components/index.js +5 -1
  61. package/dist/components/key-value-manager/key-value-manager-add-popover.js +1 -1
  62. package/dist/components/key-value-manager/key-value-manager-table.js +1 -1
  63. package/dist/components/link/link.js +7 -7
  64. package/dist/components/list/list-item.utils.js +5 -4
  65. package/dist/components/list/list.js +1 -1
  66. package/dist/components/list-details/index.d.ts +2 -2
  67. package/dist/components/markdown-content/markdown-content.components.js +2 -2
  68. package/dist/components/media-card/media-card-reveal.js +2 -2
  69. package/dist/components/media-card/media-card.js +2 -2
  70. package/dist/components/monospace-content/index.d.ts +4 -4
  71. package/dist/components/monospace-content/monospace-content.js +9 -11
  72. package/dist/components/nav-bar/nav-bar-mobile-menu.js +3 -3
  73. package/dist/components/nav-bar/nav-bar.js +4 -4
  74. package/dist/components/notice-strip/notice-strip.js +1 -1
  75. package/dist/components/option-card-group/option-card-group.js +2 -2
  76. package/dist/components/overflow-badge-list/index.d.ts +2 -2
  77. package/dist/components/overflow-badge-list/overflow-badge-list.js +3 -3
  78. package/dist/components/page-banner/page-banner.js +1 -1
  79. package/dist/components/page-container/page-container.js +1 -1
  80. package/dist/components/pagination/pagination.js +1 -1
  81. package/dist/components/progress-bar/progress-bar.js +2 -2
  82. package/dist/components/qr-code/qr-code.js +2 -2
  83. package/dist/components/radio-group/radio-group.js +3 -3
  84. package/dist/components/range-field/range-field.js +9 -12
  85. package/dist/components/readout/readout.js +1 -1
  86. package/dist/components/requirement-list/requirement-list.js +5 -10
  87. package/dist/components/scrollable-sections/scrollable-sections.js +1 -1
  88. package/dist/components/search-field-shell.js +8 -8
  89. package/dist/components/selectable-card-list/selectable-card-list-shared.js +6 -6
  90. package/dist/components/showcase-card/showcase-card.js +2 -2
  91. package/dist/components/sidebar/sidebar.js +13 -15
  92. package/dist/components/simple-clickable-card/index.d.ts +4 -4
  93. package/dist/components/simple-clickable-card/simple-clickable-card-shared.js +17 -23
  94. package/dist/components/simple-info-card/index.d.ts +3 -3
  95. package/dist/components/simple-list/index.d.ts +1 -1
  96. package/dist/components/simple-list/simple-list.js +8 -8
  97. package/dist/components/simple-paginated-list/simple-paginated-list.js +1 -4
  98. package/dist/components/stat-card/stat-card.js +7 -13
  99. package/dist/components/status-badge/index.d.ts +3 -3
  100. package/dist/components/status-badge/status-badge.js +4 -4
  101. package/dist/components/status-card-list/status-card-list.js +6 -6
  102. package/dist/components/tag/index.d.ts +1 -1
  103. package/dist/components/tag/tag.js +4 -4
  104. package/dist/components/tag-input/tag-input.js +12 -12
  105. package/dist/components/timeline/timeline.js +2 -2
  106. package/dist/components/toast/index.d.ts +1 -1
  107. package/dist/components/toast/toast.js +2 -2
  108. package/dist/components/toolbar/index.d.ts +5 -2
  109. package/dist/components/toolbar/toolbar-button.js +1 -1
  110. package/dist/components/toolbar/toolbar.js +9 -3
  111. package/dist/components/trace/trace.js +1 -1
  112. package/dist/components/transfer-list/transfer-list.js +2 -2
  113. package/dist/components/typography/index.d.ts +12 -3
  114. package/dist/components/typography/typography-variants.js +98 -13
  115. package/dist/components/typography/typography.js +4 -2
  116. package/dist/components/user-type-badge/user-type-badge.js +4 -4
  117. package/dist/components/vertical-stepper/vertical-stepper.js +11 -7
  118. package/dist/core/alert.js +3 -3
  119. package/dist/core/animate-ui/components/animate/code-header.js +1 -1
  120. package/dist/core/animate-ui/components/animate/code.js +1 -1
  121. package/dist/core/animate-ui/components/animate/tabs.js +6 -6
  122. package/dist/core/animate-ui/components/animate/tooltip.js +1 -1
  123. package/dist/core/animate-ui/components/base/progress.js +2 -2
  124. package/dist/core/animate-ui/components/radix/accordion.js +2 -2
  125. package/dist/core/animate-ui/components/radix/dialog.js +2 -2
  126. package/dist/core/animate-ui/components/radix/dropdown-menu.js +6 -6
  127. package/dist/core/animate-ui/components/radix/sheet.js +2 -2
  128. package/dist/core/animate-ui/components/radix/sidebar.js +8 -8
  129. package/dist/core/animate-ui/components/radix/toggle-group.js +4 -4
  130. package/dist/core/animate-ui/components/radix/toggle.js +1 -1
  131. package/dist/core/animate-ui/primitives/animate/tooltip.js +3 -0
  132. package/dist/core/badge.js +1 -1
  133. package/dist/core/breadcrumb.js +1 -1
  134. package/dist/core/button/button.js +2 -2
  135. package/dist/core/button/craft-button.js +4 -4
  136. package/dist/core/button-group.js +1 -1
  137. package/dist/core/button.js +2 -2
  138. package/dist/core/card.js +2 -2
  139. package/dist/core/combobox/combobox.js +3 -3
  140. package/dist/core/command.js +5 -5
  141. package/dist/core/field-label-row.js +4 -4
  142. package/dist/core/form.js +2 -2
  143. package/dist/core/index.d.ts +1 -1
  144. package/dist/core/input/input.js +11 -11
  145. package/dist/core/input-otp/input-otp.js +12 -12
  146. package/dist/core/label.js +1 -1
  147. package/dist/core/select.js +6 -6
  148. package/dist/core/separator.js +1 -1
  149. package/dist/core/table.js +2 -2
  150. package/dist/core/textarea/textarea.js +9 -9
  151. package/dist/{icon-avatar.props-RYtw2eSW.d.ts → icon-avatar.props-BJe0-vva.d.ts} +1 -1
  152. package/dist/{icon-text-action-card.props-B2ggncUK.d.ts → icon-text-action-card.props-BU7yFi2Q.d.ts} +2 -2
  153. package/dist/index.d.ts +9 -7
  154. package/dist/index.js +6 -2
  155. package/dist/layouts/entry-layout/entry-layout.js +1 -1
  156. package/dist/layouts/index.d.ts +21 -6
  157. package/dist/layouts/index.js +1 -1
  158. package/dist/layouts/minimal-workspace-layout/minimal-workspace-layout.js +10 -18
  159. package/dist/layouts/minimal-workspace-layout/sidebar-trigger.js +35 -7
  160. package/dist/layouts/workspace-layout/footer/footer.js +1 -1
  161. package/dist/markdown/index.d.ts +4 -4
  162. package/dist/{section-card-B7c5uc08.d.ts → section-card-DqQeQkzU.d.ts} +1 -1
  163. package/dist/{simple-clickable-card.props-BrPCw7CR.d.ts → simple-clickable-card.props-BhhotZMp.d.ts} +2 -2
  164. package/dist/{status-badge.props-lKlEOfRt.d.ts → status-badge.props-BVe8CmQZ.d.ts} +1 -1
  165. package/dist/styles/type-scale.js +153 -0
  166. package/dist/tailwind-preset.js +120 -1
  167. package/dist/toast/index.d.ts +1 -1
  168. package/dist/utils/cn.js +16 -5
  169. package/dist/utils/color.js +10 -1
  170. package/dist/utils/index.d.ts +37 -3
  171. package/dist/utils/index.js +2 -1
  172. package/dist/utils/variant.js +76 -76
  173. package/dist/{variant-D81RhpbR.d.ts → variant-DjdaxfIA.d.ts} +6 -1
  174. package/package.json +6 -2
  175. package/src/styles/colors.css +23 -2
  176. package/src/styles/theme.css +8 -3
  177. package/src/styles/type-scale.css +152 -0
  178. package/tailwind.preset.ts +23 -0
@@ -4,10 +4,13 @@ import { jsx } from "react/jsx-runtime";
4
4
  /**
5
5
  * Full-screen loading indicator
6
6
  * Used as defaultPendingComponent for route transitions
7
+ *
8
+ * The bar is at most 24rem wide and keeps 1.5rem off each edge of a narrower
9
+ * screen (the padding is outside the column, so a wide screen is unaffected).
7
10
  */
8
11
  function PageLoader() {
9
12
  return /* @__PURE__ */ jsx("div", {
10
- className: "flex min-h-screen items-center justify-center bg-background",
13
+ className: "flex min-h-screen items-center justify-center bg-background px-6",
11
14
  children: /* @__PURE__ */ jsx("div", {
12
15
  className: "flex flex-col items-center gap-4 w-full max-w-sm",
13
16
  children: /* @__PURE__ */ jsx(ProgressBar, {
@@ -14,10 +14,10 @@ function ProfileCard({ name, email, imageUrl, avatarColor }) {
14
14
  }), /* @__PURE__ */ jsxs("div", {
15
15
  className: "flex-1 min-w-0 flex flex-col gap-1",
16
16
  children: [name && /* @__PURE__ */ jsx("div", {
17
- className: "text-sm font-medium leading-5 text-foreground truncate",
17
+ className: "type-label text-foreground truncate",
18
18
  children: name
19
19
  }), email && /* @__PURE__ */ jsx("div", {
20
- className: "text-xs leading-4 text-muted-foreground truncate",
20
+ className: "type-secondary text-muted-foreground truncate",
21
21
  children: email
22
22
  })]
23
23
  })]
@@ -2,21 +2,19 @@ import { cn } from "../../utils/cn.js";
2
2
  import { Accordion as Accordion$1, AccordionContent, AccordionItem, AccordionTrigger } from "../../core/animate-ui/components/radix/accordion.js";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  //#region src/components/accordion/accordion.tsx
5
+ var TITLE_TEXT = "type-heading font-medium tracking-tight";
5
6
  var sizeStyles = {
6
7
  sm: {
7
8
  trigger: "py-2 px-3",
8
- content: "px-3 pb-2",
9
- text: "text-sm font-medium tracking-tight"
9
+ content: "px-3 pb-2 type-secondary"
10
10
  },
11
11
  default: {
12
12
  trigger: "py-3 px-4",
13
- content: "px-4 pb-3",
14
- text: "text-base font-medium tracking-tight"
13
+ content: "px-4 pb-3 type-body"
15
14
  },
16
15
  lg: {
17
16
  trigger: "py-4 px-5",
18
- content: "px-5 pb-4",
19
- text: "text-lg font-medium tracking-tight"
17
+ content: "px-5 pb-4 type-body"
20
18
  }
21
19
  };
22
20
  /** The open ids in the shape the primitive wants for the mode: one string (single), or a list (multiple). */
@@ -43,16 +41,13 @@ function Accordion({ items, size = "default", allowMultiple = false, defaultValu
43
41
  children: /* @__PURE__ */ jsxs("span", {
44
42
  className: "flex min-w-0 flex-1 items-center gap-2",
45
43
  children: [item.icon, typeof item.title === "string" ? /* @__PURE__ */ jsx("span", {
46
- className: styles.text,
44
+ className: TITLE_TEXT,
47
45
  children: item.title
48
46
  }) : item.title]
49
47
  })
50
48
  }), /* @__PURE__ */ jsx(AccordionContent, {
51
49
  className: cn(styles.content, contentClassName),
52
- children: typeof item.content === "string" ? /* @__PURE__ */ jsx("span", {
53
- className: styles.text,
54
- children: item.content
55
- }) : item.content
50
+ children: item.content
56
51
  })]
57
52
  }, item.id))
58
53
  });
@@ -1,11 +1,11 @@
1
1
  import * as React from 'react';
2
- import { b as AlertProps } from '../../alert.props-CcKo49Rb.js';
3
- export { A as AlertColor, a as AlertIconAvatarVariant, c as AlertSize, d as AlertType, e as AlertVariant } from '../../alert.props-CcKo49Rb.js';
2
+ import { b as AlertProps } from '../../alert.props-BuLuWmXA.js';
3
+ export { A as AlertColor, a as AlertIconAvatarVariant, c as AlertSize, d as AlertType, e as AlertVariant } from '../../alert.props-BuLuWmXA.js';
4
4
  import '../../index-BQANnKs9.js';
5
- import '../../variant-D81RhpbR.js';
5
+ import '../../variant-DjdaxfIA.js';
6
6
  import '../../style-axes-DSQ2DGc5.js';
7
- import '../../icon-avatar.props-RYtw2eSW.js';
8
- import '../../icon-text-action-card.props-B2ggncUK.js';
7
+ import '../../icon-avatar.props-BJe0-vva.js';
8
+ import '../../icon-text-action-card.props-BU7yFi2Q.js';
9
9
 
10
10
  declare const Alert: React.ForwardRefExoticComponent<AlertProps & React.RefAttributes<HTMLDivElement>>;
11
11
 
@@ -49,19 +49,19 @@ function AnchoredPanel({ open, anchorRef, side, title, subtitle, badge, closeLab
49
49
  children: [
50
50
  /* @__PURE__ */ jsx(Typography, {
51
51
  id: titleId,
52
- variant: "subtitle2",
52
+ variant: "heading",
53
53
  as: "h2",
54
- className: "m-0 min-w-0 truncate text-sm text-foreground",
54
+ className: "m-0 min-w-0 truncate text-foreground",
55
55
  children: title
56
56
  }),
57
57
  subtitle && /* @__PURE__ */ jsx("span", {
58
- className: "min-w-0 flex-1 truncate font-mono text-xs text-foreground-secondary",
58
+ className: "min-w-0 flex-1 truncate font-mono type-code text-foreground-secondary",
59
59
  children: subtitle
60
60
  }),
61
61
  !subtitle && /* @__PURE__ */ jsx("span", { className: "flex-1" }),
62
62
  badge && /* @__PURE__ */ jsx(Badge, {
63
63
  variant: "outline",
64
- className: "shrink-0 rounded-xs font-mono text-xs",
64
+ className: "shrink-0 rounded-xs font-mono type-caption",
65
65
  children: badge
66
66
  }),
67
67
  /* @__PURE__ */ jsx(ToolbarButton, {
@@ -9,9 +9,9 @@ import { jsx, jsxs } from "react/jsx-runtime";
9
9
  import { Check, ChevronDown, X } from "lucide-react";
10
10
  //#region src/components/async-multi-select/async-multi-select.tsx
11
11
  var triggerSizeClasses = {
12
- sm: "min-h-8 px-3 text-xs",
13
- default: "min-h-10 px-3.5 py-2 text-base md:text-sm",
14
- lg: "min-h-12 px-5 text-lg"
12
+ sm: "min-h-8 px-3 type-input",
13
+ default: "min-h-10 px-3.5 py-2 type-input",
14
+ lg: "min-h-12 px-5 type-input"
15
15
  };
16
16
  var chevronSizeClasses = {
17
17
  sm: "size-3.5",
@@ -108,7 +108,7 @@ function AsyncMultiSelect({ options, multiple = true, value, onValueChange, onSe
108
108
  children: /* @__PURE__ */ jsx(X, { className: "size-3" })
109
109
  })]
110
110
  }, opt.value)), remaining > 0 && /* @__PURE__ */ jsxs("span", {
111
- className: "text-xs text-muted-foreground",
111
+ className: "type-caption text-muted-foreground",
112
112
  children: [
113
113
  "+",
114
114
  remaining,
@@ -133,7 +133,7 @@ function AsyncMultiSelect({ options, multiple = true, value, onValueChange, onSe
133
133
  className: "flex items-center justify-between",
134
134
  children: /* @__PURE__ */ jsxs("label", {
135
135
  htmlFor: triggerId,
136
- className: "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50",
136
+ className: "flex items-center gap-2 type-label leading-none select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50",
137
137
  children: [label, required && /* @__PURE__ */ jsx("span", {
138
138
  className: "text-destructive",
139
139
  children: "*"
@@ -169,7 +169,7 @@ function AsyncMultiSelect({ options, multiple = true, value, onValueChange, onSe
169
169
  className: "overscroll-contain",
170
170
  children: [
171
171
  action ? options.length === 0 && /* @__PURE__ */ jsx("div", {
172
- className: "py-6 text-center text-sm",
172
+ className: "py-6 text-center type-body",
173
173
  children: emptyContent
174
174
  }) : /* @__PURE__ */ jsx(CommandEmpty, { children: emptyContent }),
175
175
  /* @__PURE__ */ jsx(CommandGroup, {
@@ -190,7 +190,7 @@ function AsyncMultiSelect({ options, multiple = true, value, onValueChange, onSe
190
190
  className: "font-medium leading-relaxed",
191
191
  children: opt.label
192
192
  }), /* @__PURE__ */ jsx("span", {
193
- className: "truncate text-xs font-normal text-muted-foreground",
193
+ className: "truncate type-secondary text-muted-foreground",
194
194
  children: desc
195
195
  })]
196
196
  }) : opt.label]
@@ -223,7 +223,7 @@ function AsyncMultiSelect({ options, multiple = true, value, onValueChange, onSe
223
223
  className: "font-medium leading-relaxed",
224
224
  children: action.label
225
225
  }), action.description && /* @__PURE__ */ jsx("span", {
226
- className: "truncate text-xs font-normal text-muted-foreground",
226
+ className: "truncate type-secondary text-muted-foreground",
227
227
  children: action.description
228
228
  })]
229
229
  })]
@@ -15,7 +15,7 @@ function Avatar({ name, imageUrl, size = "default", className, badgeColor, badge
15
15
  const showIconBadge = badgeIcon != null && badgeIcon !== false;
16
16
  const colorResolved = !showIconBadge && badgeColor != null ? resolveColor(badgeColor, "bg") : void 0;
17
17
  const hasBadge = showIconBadge || Boolean(colorResolved);
18
- const fill = resolveColor(color, "bg");
18
+ const fill = resolveColor(color, "solid");
19
19
  const onFill = resolveColor(color, "fg");
20
20
  const avatar = /* @__PURE__ */ jsxs(Avatar$1, {
21
21
  className: cn(sizeClasses[size], className),
@@ -1,7 +1,7 @@
1
1
  import * as class_variance_authority_types from 'class-variance-authority/types';
2
2
  import * as React from 'react';
3
3
  import { k as StyleAxisProps } from '../../style-axes-DSQ2DGc5.js';
4
- import { f as Variant } from '../../variant-D81RhpbR.js';
4
+ import { f as Variant } from '../../variant-DjdaxfIA.js';
5
5
  import { C as Color } from '../../index-BQANnKs9.js';
6
6
 
7
7
  declare const badgeVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
@@ -0,0 +1,112 @@
1
+ import { useRef } from "react";
2
+ //#region src/components/bottom-sheet/_hooks/use-sheet-drag.ts
3
+ /** The sheet's two open heights, as a share of the viewport: the `h-1/2` and `h-5/6` the sheet draws with. */
4
+ var SHEET_HEIGHTS = {
5
+ half: .5,
6
+ tall: 5 / 6
7
+ };
8
+ /** Below this share of the viewport a let-go sheet is put away rather than kept open. */
9
+ var CLOSE_BELOW = .3;
10
+ /** A drag no longer than this (px) is a tap: the handle's own click toggles the height. */
11
+ var TAP_SLOP = 6;
12
+ /** A flick: px per ms past which the direction decides, whatever the height. */
13
+ var FLICK = .6;
14
+ /** The drag never makes the sheet smaller or taller than this share of the viewport. */
15
+ var MIN_SHARE = .12;
16
+ var MAX_SHARE = .92;
17
+ /**
18
+ * Where a sheet let go of comes to rest: a quick flick goes the way it was
19
+ * flicked (down from half puts it away), otherwise the nearest open height,
20
+ * or away once dragged low enough. `share` is the sheet's height as a share
21
+ * of the viewport; `velocity` is px per ms, down positive.
22
+ */
23
+ function settleSheet({ share, velocity, from }) {
24
+ if (velocity > FLICK) return from === "tall" && share > SHEET_HEIGHTS.half * .8 ? "half" : "closed";
25
+ if (velocity < -.6) return "tall";
26
+ if (share < CLOSE_BELOW) return "closed";
27
+ return Math.abs(share - SHEET_HEIGHTS.tall) < Math.abs(share - SHEET_HEIGHTS.half) ? "tall" : "half";
28
+ }
29
+ /**
30
+ * The height the sheet's `h-1/2` and `h-5/6` are shares of: the viewport for
31
+ * a `fixed` sheet, or the positioned box an `absolute` one sits in (a framed
32
+ * preview).
33
+ */
34
+ function viewportHeight(element) {
35
+ const box = element.offsetParent;
36
+ return box instanceof HTMLElement && box.clientHeight > 0 ? box.clientHeight : window.innerHeight;
37
+ }
38
+ /**
39
+ * A bottom sheet that follows the finger: dragged by its grip (the handle and
40
+ * the title bar; the sheet's content keeps its own scrolling), it takes the
41
+ * height the finger gives it, and let go it comes to rest (`settleSheet`).
42
+ * The height changes with every frame, so it is written to the sheet from
43
+ * here and dropped again when the sheet rests, the class taking over (the
44
+ * transition carries it there). The grip claims the gesture (`touch-none`
45
+ * on it), so dragging down never reaches the browser's pull-to-refresh.
46
+ */
47
+ function useSheetDrag(sheet, rest, onRest) {
48
+ const gesture = useRef(null);
49
+ const swallowClick = useRef(false);
50
+ function end(event, cancelled) {
51
+ const active = gesture.current;
52
+ if (!active || active.pointerId !== event.pointerId) return;
53
+ gesture.current = null;
54
+ event.currentTarget.releasePointerCapture?.(event.pointerId);
55
+ const element = sheet.current;
56
+ element?.removeAttribute("data-dragging");
57
+ if (!active.moved || !element) return;
58
+ swallowClick.current = true;
59
+ const share = element.getBoundingClientRect().height / viewportHeight(element);
60
+ onRest(cancelled ? rest : settleSheet({
61
+ share,
62
+ velocity: active.velocity,
63
+ from: rest
64
+ }));
65
+ requestAnimationFrame(() => element.style.removeProperty("height"));
66
+ }
67
+ return {
68
+ onPointerDown(event) {
69
+ swallowClick.current = false;
70
+ const control = event.target.closest("button, a, input");
71
+ if (event.button !== 0 || !sheet.current || control && !control.hasAttribute("data-sheet-grip")) return;
72
+ event.currentTarget.setPointerCapture?.(event.pointerId);
73
+ const startHeight = sheet.current.getBoundingClientRect().height;
74
+ gesture.current = {
75
+ pointerId: event.pointerId,
76
+ startY: event.clientY,
77
+ startHeight,
78
+ lastY: event.clientY,
79
+ lastAt: event.timeStamp,
80
+ velocity: 0,
81
+ moved: false
82
+ };
83
+ },
84
+ onPointerMove(event) {
85
+ const active = gesture.current;
86
+ const element = sheet.current;
87
+ if (!active || active.pointerId !== event.pointerId || !element) return;
88
+ const dy = event.clientY - active.startY;
89
+ if (!active.moved && Math.abs(dy) < TAP_SLOP) return;
90
+ active.moved = true;
91
+ const dt = Math.max(1, event.timeStamp - active.lastAt);
92
+ active.velocity = (event.clientY - active.lastY) / dt;
93
+ active.lastY = event.clientY;
94
+ active.lastAt = event.timeStamp;
95
+ const viewport = viewportHeight(element);
96
+ const height = Math.min(MAX_SHARE * viewport, Math.max(MIN_SHARE * viewport, active.startHeight - dy));
97
+ element.setAttribute("data-dragging", "");
98
+ element.style.height = `${height}px`;
99
+ },
100
+ onPointerUp: (event) => end(event, false),
101
+ onPointerCancel: (event) => end(event, true),
102
+ onClickCapture(event) {
103
+ if (swallowClick.current) {
104
+ swallowClick.current = false;
105
+ event.preventDefault();
106
+ event.stopPropagation();
107
+ }
108
+ }
109
+ };
110
+ }
111
+ //#endregion
112
+ export { SHEET_HEIGHTS, settleSheet, useSheetDrag };
@@ -0,0 +1,84 @@
1
+ import { cn } from "../../utils/cn.js";
2
+ import { Typography } from "../typography/typography.js";
3
+ import { ToolbarButton } from "../toolbar/toolbar-button.js";
4
+ import { useSheetDrag } from "./_hooks/use-sheet-drag.js";
5
+ import * as React$1 from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { X } from "lucide-react";
8
+ //#region src/components/bottom-sheet/bottom-sheet.tsx
9
+ /**
10
+ * A phone's panel: a sheet up from the bottom edge, half the screen, so what
11
+ * it works on stays in view above it. Its grip (the handle and the title bar)
12
+ * drags it: up to nearly all of the screen, back to half, or down and away. A
13
+ * tap on the handle toggles the two heights. Not modal: the page above still
14
+ * answers a tap. Escape or ✕ closes it.
15
+ */
16
+ var BottomSheet = React$1.forwardRef(({ title, icon, labels, onClose, children, className }, ref) => {
17
+ const titleId = React$1.useId();
18
+ const [tall, setTall] = React$1.useState(false);
19
+ const sheet = React$1.useRef(null);
20
+ const drag = useSheetDrag(sheet, tall ? "tall" : "half", (rest) => rest === "closed" ? onClose() : setTall(rest === "tall"));
21
+ const setRef = React$1.useCallback((node) => {
22
+ sheet.current = node;
23
+ if (typeof ref === "function") ref(node);
24
+ else if (ref) ref.current = node;
25
+ }, [ref]);
26
+ function onKeyDown(event) {
27
+ if (event.key === "Escape") {
28
+ event.stopPropagation();
29
+ onClose();
30
+ }
31
+ }
32
+ return /* @__PURE__ */ jsxs("section", {
33
+ ref: setRef,
34
+ role: "dialog",
35
+ "aria-modal": false,
36
+ "aria-labelledby": titleId,
37
+ onKeyDown,
38
+ "data-slot": "bottom-sheet",
39
+ className: cn("fixed inset-x-0 bottom-0 z-40 flex flex-col overflow-hidden rounded-t-[var(--espd-radius-surface,var(--radius-2xl))] border-t border-border bg-background shadow-float transition-all duration-200 starting:translate-y-full data-dragging:transition-none motion-reduce:transition-none", tall ? "h-5/6" : "h-1/2", className),
40
+ children: [/* @__PURE__ */ jsxs("div", {
41
+ className: "flex shrink-0 cursor-grab touch-none flex-col select-none active:cursor-grabbing",
42
+ ...drag,
43
+ children: [/* @__PURE__ */ jsx("button", {
44
+ type: "button",
45
+ "data-sheet-grip": true,
46
+ "aria-label": tall ? labels.collapse : labels.expand,
47
+ "aria-expanded": tall,
48
+ onClick: () => setTall(!tall),
49
+ className: "flex h-5 shrink-0 cursor-pointer items-center justify-center outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",
50
+ children: /* @__PURE__ */ jsx("span", {
51
+ "aria-hidden": true,
52
+ className: "h-1 w-10 rounded-full bg-foreground-muted"
53
+ })
54
+ }), /* @__PURE__ */ jsxs("div", {
55
+ className: "flex shrink-0 items-center gap-2 border-b border-border px-4 pb-2",
56
+ children: [
57
+ icon && /* @__PURE__ */ jsx("span", {
58
+ "aria-hidden": true,
59
+ className: "flex shrink-0 text-foreground-secondary",
60
+ children: icon
61
+ }),
62
+ /* @__PURE__ */ jsx(Typography, {
63
+ id: titleId,
64
+ variant: "heading",
65
+ as: "h2",
66
+ className: "m-0 min-w-0 flex-1 truncate text-foreground",
67
+ children: title
68
+ }),
69
+ /* @__PURE__ */ jsx(ToolbarButton, {
70
+ label: labels.close,
71
+ icon: /* @__PURE__ */ jsx(X, {}),
72
+ onClick: onClose
73
+ })
74
+ ]
75
+ })]
76
+ }), /* @__PURE__ */ jsx("div", {
77
+ className: "min-h-0 flex-1 overflow-y-auto overscroll-contain",
78
+ children
79
+ })]
80
+ });
81
+ });
82
+ BottomSheet.displayName = "BottomSheet";
83
+ //#endregion
84
+ export { BottomSheet };
@@ -0,0 +1,50 @@
1
+ import * as React from 'react';
2
+ import { ReactNode } from 'react';
3
+
4
+ /** The sheet's own controls, named in the page's language (no English defaults). */
5
+ interface BottomSheetLabels {
6
+ /** The handle's name while the sheet is at half height. */
7
+ expand: string;
8
+ /** The handle's name while the sheet is tall. */
9
+ collapse: string;
10
+ /** The ✕ button's name. */
11
+ close: string;
12
+ }
13
+ interface BottomSheetProps {
14
+ /** Names the sheet (its dialog role) and shows in its title bar. */
15
+ title: string;
16
+ /** Beside the title. */
17
+ icon?: ReactNode;
18
+ labels: BottomSheetLabels;
19
+ /** Escape, ✕, or a drag or flick down. Open and closed is the parent's: it renders the sheet or doesn't. */
20
+ onClose: () => void;
21
+ /** What the sheet holds; it scrolls on its own below the title bar. */
22
+ children: ReactNode;
23
+ /** Merged onto the sheet's `<section>` (e.g. `absolute` instead of `fixed` inside a framed preview). */
24
+ className?: string;
25
+ }
26
+
27
+ /**
28
+ * A phone's panel: a sheet up from the bottom edge, half the screen, so what
29
+ * it works on stays in view above it. Its grip (the handle and the title bar)
30
+ * drags it: up to nearly all of the screen, back to half, or down and away. A
31
+ * tap on the handle toggles the two heights. Not modal: the page above still
32
+ * answers a tap. Escape or ✕ closes it.
33
+ */
34
+ declare const BottomSheet: React.ForwardRefExoticComponent<BottomSheetProps & React.RefAttributes<HTMLElement>>;
35
+
36
+ /** Where a bottom sheet rests: half the screen, nearly all of it, or put away. */
37
+ type SheetRest = "half" | "tall" | "closed";
38
+ /**
39
+ * Where a sheet let go of comes to rest: a quick flick goes the way it was
40
+ * flicked (down from half puts it away), otherwise the nearest open height,
41
+ * or away once dragged low enough. `share` is the sheet's height as a share
42
+ * of the viewport; `velocity` is px per ms, down positive.
43
+ */
44
+ declare function settleSheet({ share, velocity, from }: {
45
+ share: number;
46
+ velocity: number;
47
+ from: Exclude<SheetRest, "closed">;
48
+ }): SheetRest;
49
+
50
+ export { BottomSheet, type BottomSheetLabels, type BottomSheetProps, type SheetRest, settleSheet };
@@ -0,0 +1,3 @@
1
+ import { settleSheet } from "./_hooks/use-sheet-drag.js";
2
+ import { BottomSheet } from "./bottom-sheet.js";
3
+ export { BottomSheet, settleSheet };
@@ -10,7 +10,7 @@ import { jsx } from "react/jsx-runtime";
10
10
  function Bubble({ variant = "plain", size = "base", className, ...props }) {
11
11
  return /* @__PURE__ */ jsx("div", {
12
12
  "data-slot": "bubble",
13
- className: cn("min-w-0 wrap-break-word whitespace-pre-line text-foreground", size === "sm" ? "text-sm leading-normal" : "text-base leading-relaxed", variant === "filled" && "rounded-2xl rounded-br-md bg-primary/7 dark:bg-primary/15", variant === "filled" && (size === "sm" ? "px-3.5 py-2" : "px-4 py-2.5"), className),
13
+ className: cn("min-w-0 wrap-break-word whitespace-pre-line text-foreground", size === "sm" ? "type-secondary" : "type-body", variant === "filled" && "rounded-2xl rounded-br-md bg-primary/7 dark:bg-primary/15", variant === "filled" && (size === "sm" ? "px-3.5 py-2" : "px-4 py-2.5"), className),
14
14
  ...props
15
15
  });
16
16
  }
@@ -45,14 +45,14 @@ var presetButtonColors = {
45
45
  link: "text-success"
46
46
  },
47
47
  warning: {
48
- default: "bg-warning text-warning-foreground hover:bg-warning/90",
48
+ default: "bg-warning-solid text-warning-foreground hover:bg-warning-solid/90",
49
49
  outline: "border-warning/30 text-warning hover:bg-warning/5 hover:border-warning",
50
50
  glow: "border-warning/30 text-warning hover:bg-warning/5 hover:border-warning shadow-glow shadow-warning/45",
51
51
  ghost: "text-warning hover:bg-warning/10",
52
52
  link: "text-warning"
53
53
  },
54
54
  disabled: {
55
- default: "bg-disabled text-disabled-foreground",
55
+ default: "bg-disabled-solid text-disabled-foreground",
56
56
  outline: "border-disabled/30 text-disabled",
57
57
  glow: "border-disabled/30 text-disabled shadow-glow shadow-disabled/45",
58
58
  ghost: "text-disabled",
@@ -14,8 +14,8 @@ var flashButtonBgClasses = {
14
14
  error: "bg-error hover:bg-background text-error-foreground",
15
15
  info: "bg-info hover:bg-background text-info-foreground",
16
16
  success: "bg-success hover:bg-background text-success-foreground",
17
- warning: "bg-warning hover:bg-background text-warning-foreground",
18
- disabled: "bg-disabled hover:bg-background text-disabled-foreground",
17
+ warning: "bg-warning-solid hover:bg-background text-warning-foreground",
18
+ disabled: "bg-disabled-solid hover:bg-background text-disabled-foreground",
19
19
  gray: "bg-gray hover:bg-background text-gray-foreground",
20
20
  mist: "bg-mist hover:bg-background text-mist-foreground"
21
21
  };
@@ -26,8 +26,8 @@ var flashOverlayClasses = {
26
26
  error: "bg-error",
27
27
  info: "bg-info",
28
28
  success: "bg-success",
29
- warning: "bg-warning",
30
- disabled: "bg-disabled",
29
+ warning: "bg-warning-solid",
30
+ disabled: "bg-disabled-solid",
31
31
  gray: "bg-gray",
32
32
  mist: "bg-mist"
33
33
  };
@@ -23,16 +23,16 @@ function Calendar({ className, classNames, showOutsideDays = true, captionLayout
23
23
  button_previous: cn(buttonVariants({ variant: buttonVariant }), "size-[var(--cell-size)] p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_previous),
24
24
  button_next: cn(buttonVariants({ variant: buttonVariant }), "size-[var(--cell-size)] p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_next),
25
25
  month_caption: cn("flex h-[var(--cell-size)] w-full items-center justify-center px-[var(--cell-size)]", defaultClassNames.month_caption),
26
- dropdowns: cn("flex h-[var(--cell-size)] w-full items-center justify-center gap-1.5 text-sm font-medium", defaultClassNames.dropdowns),
26
+ dropdowns: cn("flex h-[var(--cell-size)] w-full items-center justify-center gap-1.5 type-label", defaultClassNames.dropdowns),
27
27
  dropdown_root: cn("relative rounded-md has-focus:border-ring has-focus:ring-[3px] has-focus:ring-ring/50", defaultClassNames.dropdown_root),
28
28
  dropdown: cn("absolute inset-0 opacity-0", defaultClassNames.dropdown),
29
- caption_label: cn("font-medium select-none", captionLayout === "label" ? "text-sm" : "flex h-8 items-center gap-1 rounded-md pr-1 pl-2 text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground", defaultClassNames.caption_label),
29
+ caption_label: cn("type-label select-none", captionLayout !== "label" && "flex h-8 items-center gap-1 rounded-md pr-1 pl-2 [&>svg]:size-3.5 [&>svg]:text-muted-foreground", defaultClassNames.caption_label),
30
30
  table: "w-full border-collapse",
31
31
  weekdays: cn("flex", defaultClassNames.weekdays),
32
- weekday: cn("flex-1 rounded-md text-[0.8rem] font-normal text-muted-foreground select-none", defaultClassNames.weekday),
32
+ weekday: cn("flex-1 rounded-md type-caption text-muted-foreground select-none", defaultClassNames.weekday),
33
33
  week: cn("mt-2 flex w-full", defaultClassNames.week),
34
34
  week_number_header: cn("w-[var(--cell-size)] select-none", defaultClassNames.week_number_header),
35
- week_number: cn("text-[0.8rem] text-muted-foreground select-none", defaultClassNames.week_number),
35
+ week_number: cn("type-caption text-muted-foreground select-none", defaultClassNames.week_number),
36
36
  day: cn("group/day relative aspect-square h-full w-full p-0 text-center select-none [&:first-child[data-selected=true]_button]:rounded-l-[var(--espd-own-radius,var(--espd-radius-item,var(--radius-md)))] [&:last-child[data-selected=true]_button]:rounded-r-[var(--espd-own-radius,var(--espd-radius-item,var(--radius-md)))]", defaultClassNames.day),
37
37
  range_start: cn("rounded-l-[var(--espd-own-radius,var(--espd-radius-item,var(--radius-md)))] bg-accent", defaultClassNames.range_start),
38
38
  range_middle: cn("rounded-none", defaultClassNames.range_middle),
@@ -96,7 +96,7 @@ function CalendarDayButton({ className: dayClassName, day, modifiers, ...props }
96
96
  className: cn(buttonVariants({
97
97
  variant: "ghost",
98
98
  size: "icon"
99
- }), "flex aspect-square size-auto w-full min-w-[var(--cell-size)] flex-col gap-1 leading-none font-normal rounded-[var(--espd-own-radius,var(--espd-radius-item,var(--radius-md)))]", "group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50", "data-[range-end=true]:rounded-[var(--espd-own-radius,var(--espd-radius-item,var(--radius-md)))] data-[range-end=true]:rounded-r-[var(--espd-own-radius,var(--espd-radius-item,var(--radius-md)))] data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground", "data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground", "data-[range-start=true]:rounded-[var(--espd-own-radius,var(--espd-radius-item,var(--radius-md)))] data-[range-start=true]:rounded-l-[var(--espd-own-radius,var(--espd-radius-item,var(--radius-md)))] data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground", "data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground", "[&>span]:text-xs [&>span]:opacity-70", dayClassName),
99
+ }), "flex aspect-square size-auto w-full min-w-[var(--cell-size)] flex-col gap-1 leading-none font-normal rounded-[var(--espd-own-radius,var(--espd-radius-item,var(--radius-md)))]", "group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50", "data-[range-end=true]:rounded-[var(--espd-own-radius,var(--espd-radius-item,var(--radius-md)))] data-[range-end=true]:rounded-r-[var(--espd-own-radius,var(--espd-radius-item,var(--radius-md)))] data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground", "data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground", "data-[range-start=true]:rounded-[var(--espd-own-radius,var(--espd-radius-item,var(--radius-md)))] data-[range-start=true]:rounded-l-[var(--espd-own-radius,var(--espd-radius-item,var(--radius-md)))] data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground", "data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground", "[&>span]:type-caption [&>span]:opacity-70", dayClassName),
100
100
  ...props
101
101
  });
102
102
  }
@@ -24,7 +24,7 @@ function AnimatedCard({ type, iconSize, transparent = true, children, actions, c
24
24
  width: iconSize
25
25
  }) : null,
26
26
  children != null && /* @__PURE__ */ jsx("div", {
27
- className: "text-base text-foreground w-full",
27
+ className: "type-body text-foreground w-full",
28
28
  children: typeof children === "string" ? /* @__PURE__ */ jsx("p", {
29
29
  className: "text-center font-medium",
30
30
  children
@@ -8,10 +8,10 @@ var content = (icon, primaryText, secondaryText) => /* @__PURE__ */ jsxs(Fragmen
8
8
  }) }), /* @__PURE__ */ jsxs("div", {
9
9
  className: "flex min-w-0 flex-1 flex-col gap-1",
10
10
  children: [primaryText != null && /* @__PURE__ */ jsx("span", {
11
- className: "text-sm font-semibold",
11
+ className: "type-heading",
12
12
  children: primaryText
13
13
  }), secondaryText != null && /* @__PURE__ */ jsx("span", {
14
- className: "truncate text-sm text-muted-foreground",
14
+ className: "truncate type-secondary text-muted-foreground",
15
15
  children: secondaryText
16
16
  })]
17
17
  })] });
@@ -35,7 +35,7 @@ function CollapsibleCard({ children, className, defaultOpen = false, radius, ele
35
35
  type: "button",
36
36
  className: "flex w-full min-w-0 items-center justify-between gap-2 rounded-md text-left outline-none ring-offset-background transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
37
37
  children: [/* @__PURE__ */ jsx("div", {
38
- className: "min-w-0 flex-1 [&>div]:font-medium [&>div]:text-sm",
38
+ className: "min-w-0 flex-1 [&>div]:type-heading [&>div]:font-medium",
39
39
  children: titleChild
40
40
  }), /* @__PURE__ */ jsxs("div", {
41
41
  className: "flex h-4 w-4 shrink-0 items-center justify-center",
@@ -1,9 +1,9 @@
1
1
  import * as React$1 from 'react';
2
2
  import { ReactNode } from 'react';
3
3
  import { k as StyleAxisProps } from '../../style-axes-DSQ2DGc5.js';
4
- export { S as SectionCard, a as SectionCardProps, b as SectionCardSize, c as SectionCardVariant } from '../../section-card-B7c5uc08.js';
4
+ export { S as SectionCard, a as SectionCardProps, b as SectionCardSize, c as SectionCardVariant } from '../../section-card-DqQeQkzU.js';
5
5
  import '../../index-BQANnKs9.js';
6
- import '../../variant-D81RhpbR.js';
6
+ import '../../variant-DjdaxfIA.js';
7
7
 
8
8
  interface SimpleCardProps extends StyleAxisProps {
9
9
  /** No shadow. Same as `elevation="none"`; `elevation` wins when both are set. */
@@ -14,11 +14,11 @@ function NoDataCard({ illustration, hideIllustration = false, heading, descripti
14
14
  children: illustration ?? /* @__PURE__ */ jsx(Illustration, { type: "no-search-results" })
15
15
  }),
16
16
  heading != null && /* @__PURE__ */ jsx("div", {
17
- className: "text-lg font-semibold",
17
+ className: "type-heading",
18
18
  children: heading
19
19
  }),
20
20
  description != null && /* @__PURE__ */ jsx("p", {
21
- className: "text-sm text-muted-foreground",
21
+ className: "type-body text-muted-foreground",
22
22
  children: description
23
23
  }),
24
24
  action != null && /* @__PURE__ */ jsx("div", { children: action })