@glasshome/ui 1.21.1 → 1.21.2

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 (145) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.js +1 -1
  3. package/dist/lib/use-is-mobile.d.ts +3 -1
  4. package/dist/solid/index.d.ts +9 -9
  5. package/dist/solid/index.js +5431 -5424
  6. package/dist/{utils-CMk7R3zM.js → utils-D5blHO4O.js} +624 -622
  7. package/package.json +128 -126
  8. package/scripts/check-gallery.ts +142 -142
  9. package/scripts/check-pack.ts +13 -13
  10. package/scripts/check-structural-classes.ts +20 -20
  11. package/scripts/check-tokens.ts +27 -27
  12. package/scripts/check-ui-drift.mjs +103 -103
  13. package/src/index.ts +75 -80
  14. package/src/lib/alert-tones.ts +41 -41
  15. package/src/lib/anchor-placement.ts +21 -21
  16. package/src/lib/button-variants.ts +28 -28
  17. package/src/lib/card-classes.ts +9 -9
  18. package/src/lib/carousel-classes.ts +14 -14
  19. package/src/lib/glass-tone.ts +11 -11
  20. package/src/lib/input-classes.ts +6 -6
  21. package/src/lib/layers.ts +4 -4
  22. package/src/lib/logo-lockup.ts +8 -8
  23. package/src/lib/menu-classes.ts +2 -2
  24. package/src/lib/motion-classes.ts +8 -8
  25. package/src/lib/motion-window.ts +24 -24
  26. package/src/lib/overlay-classes.ts +6 -6
  27. package/src/lib/pill-classes.ts +3 -3
  28. package/src/lib/position-bar-classes.ts +1 -1
  29. package/src/lib/spotlight-geometry.ts +67 -67
  30. package/src/lib/thumb-classes.ts +2 -2
  31. package/src/lib/tier-badge.ts +16 -16
  32. package/src/lib/use-is-mobile.ts +17 -14
  33. package/src/lib/utils.ts +1 -1
  34. package/src/solid/accordion.tsx +41 -41
  35. package/src/solid/alert-dialog.tsx +95 -95
  36. package/src/solid/alert.tsx +88 -88
  37. package/src/solid/area-picker.tsx +204 -204
  38. package/src/solid/aspect-ratio.tsx +13 -13
  39. package/src/solid/avatar.tsx +27 -27
  40. package/src/solid/badge.tsx +49 -49
  41. package/src/solid/bottom-sheet/arbitration.ts +22 -22
  42. package/src/solid/bottom-sheet/bottom-sheet.tsx +394 -394
  43. package/src/solid/bottom-sheet/drag-controller.ts +201 -201
  44. package/src/solid/bottom-sheet/focus-trap.ts +51 -47
  45. package/src/solid/bottom-sheet/index.ts +12 -12
  46. package/src/solid/bottom-sheet/keyboard.ts +25 -25
  47. package/src/solid/bottom-sheet/scroll-lock.ts +46 -46
  48. package/src/solid/bottom-sheet/state-machine.ts +28 -28
  49. package/src/solid/bottom-sheet/velocity.ts +29 -29
  50. package/src/solid/breadcrumb.tsx +76 -76
  51. package/src/solid/button-group.tsx +46 -46
  52. package/src/solid/button.tsx +19 -19
  53. package/src/solid/card.tsx +67 -67
  54. package/src/solid/carousel.tsx +246 -246
  55. package/src/solid/charts.tsx +253 -253
  56. package/src/solid/checkbox.tsx +51 -51
  57. package/src/solid/collapsible.tsx +22 -22
  58. package/src/solid/color-disc.tsx +213 -213
  59. package/src/solid/color-slider.tsx +81 -81
  60. package/src/solid/color-wheel.tsx +61 -61
  61. package/src/solid/context-menu.tsx +63 -63
  62. package/src/solid/copy-button.tsx +31 -31
  63. package/src/solid/count-pill.tsx +11 -11
  64. package/src/solid/dashboard-preview.tsx +104 -104
  65. package/src/solid/data-table.tsx +228 -228
  66. package/src/solid/dialog-parts.tsx +127 -127
  67. package/src/solid/dialog.tsx +113 -113
  68. package/src/solid/dock-paging.ts +9 -9
  69. package/src/solid/dock.tsx +339 -339
  70. package/src/solid/docked-panel.tsx +35 -35
  71. package/src/solid/dropdown-menu.tsx +77 -77
  72. package/src/solid/empty.tsx +70 -70
  73. package/src/solid/entity-data.ts +38 -38
  74. package/src/solid/entity-selector.tsx +634 -634
  75. package/src/solid/field.tsx +205 -205
  76. package/src/solid/form.tsx +159 -159
  77. package/src/solid/hero-action.tsx +85 -85
  78. package/src/solid/hover-card.tsx +11 -11
  79. package/src/solid/icon-picker.tsx +401 -401
  80. package/src/solid/icon.tsx +101 -78
  81. package/src/solid/image-picker.tsx +416 -414
  82. package/src/solid/index.ts +265 -304
  83. package/src/solid/input-group.tsx +123 -123
  84. package/src/solid/input-otp.tsx +143 -143
  85. package/src/solid/input.tsx +4 -4
  86. package/src/solid/item.tsx +130 -130
  87. package/src/solid/kbd.tsx +20 -20
  88. package/src/solid/label.tsx +12 -12
  89. package/src/solid/list-reorder.ts +122 -122
  90. package/src/solid/logo.tsx +60 -60
  91. package/src/solid/media-copy.ts +21 -21
  92. package/src/solid/media-store.ts +56 -56
  93. package/src/solid/media-tile.tsx +85 -85
  94. package/src/solid/menu-parts.tsx +164 -164
  95. package/src/solid/number-field.tsx +56 -56
  96. package/src/solid/option-card.tsx +164 -164
  97. package/src/solid/ornament.tsx +43 -43
  98. package/src/solid/overlay.tsx +4 -4
  99. package/src/solid/page-header.tsx +75 -75
  100. package/src/solid/pagination.tsx +80 -80
  101. package/src/solid/password-input.tsx +51 -51
  102. package/src/solid/picker-row.tsx +83 -83
  103. package/src/solid/picker-search.tsx +65 -63
  104. package/src/solid/picker-trigger.tsx +59 -57
  105. package/src/solid/popover.tsx +54 -54
  106. package/src/solid/preview-tile.tsx +67 -67
  107. package/src/solid/progress.tsx +21 -21
  108. package/src/solid/radio-group.tsx +51 -51
  109. package/src/solid/resizable.tsx +128 -128
  110. package/src/solid/responsive-dialog.tsx +134 -134
  111. package/src/solid/schema-form.tsx +743 -743
  112. package/src/solid/scope-indicator.tsx +5 -5
  113. package/src/solid/scroll-area.tsx +16 -16
  114. package/src/solid/section-card.tsx +281 -281
  115. package/src/solid/select.tsx +101 -101
  116. package/src/solid/separator.tsx +25 -25
  117. package/src/solid/settings-row.tsx +122 -122
  118. package/src/solid/sheet.tsx +96 -96
  119. package/src/solid/skeleton.tsx +8 -8
  120. package/src/solid/slider.tsx +132 -132
  121. package/src/solid/sliding-indicator.tsx +280 -265
  122. package/src/solid/sonner.tsx +164 -164
  123. package/src/solid/spinner.tsx +12 -12
  124. package/src/solid/spotlight.tsx +140 -140
  125. package/src/solid/step-indicator.tsx +18 -18
  126. package/src/solid/swatch-picker.tsx +38 -38
  127. package/src/solid/switch.tsx +52 -52
  128. package/src/solid/table.tsx +63 -63
  129. package/src/solid/tabs.tsx +93 -93
  130. package/src/solid/textarea.tsx +8 -8
  131. package/src/solid/toggle-group.tsx +83 -83
  132. package/src/solid/toggle.tsx +33 -33
  133. package/src/solid/tooltip.tsx +16 -16
  134. package/src/solid/widget-card.tsx +90 -90
  135. package/src/solid/widget-identity.tsx +99 -99
  136. package/src/solid/widget-trust-badge.tsx +20 -20
  137. package/src/styles/globals.css +316 -319
  138. package/src/styles/theme.css +448 -448
  139. package/src/tokens/hex.ts +29 -29
  140. package/src/tokens/material.ts +75 -75
  141. package/src/tokens/presets.ts +303 -303
  142. package/src/tokens/readability.ts +32 -32
  143. package/src/tokens/theme-colors.ts +95 -95
  144. package/src/tokens/theme-css.ts +22 -22
  145. package/src/tokens/theme-recipe.ts +106 -106
@@ -1,15 +1,15 @@
1
1
  import { type ComponentProps, children, type JSX, Show, splitProps } from "solid-js";
2
2
  import {
3
- CARD_BLUR,
4
- CARD_SURFACE_BASE,
5
- SECTION_ROW_INTERACTIVE,
6
- SECTION_ROW_SURFACE,
3
+ CARD_BLUR,
4
+ CARD_SURFACE_BASE,
5
+ SECTION_ROW_INTERACTIVE,
6
+ SECTION_ROW_SURFACE,
7
7
  } from "../lib/card-classes.js";
8
8
  import { ICON_PILL, ICON_PILL_TINT } from "../lib/pill-classes.js";
9
9
  import {
10
- SECTION_INNER_RADIUS,
11
- SECTION_OUTER_RADIUS,
12
- SECTION_PADDING,
10
+ SECTION_INNER_RADIUS,
11
+ SECTION_OUTER_RADIUS,
12
+ SECTION_PADDING,
13
13
  } from "../lib/section-tokens.js";
14
14
  import { cn } from "../lib/utils.js";
15
15
  import { CountPill } from "./count-pill.js";
@@ -18,134 +18,134 @@ import { Icon } from "./icon.js";
18
18
  /* Performant-blur injection (dash): when active() the card gates CARD_BLUR off
19
19
  * and paints the engine's precomputed slice via style() instead. */
20
20
  export type GlassSurface = {
21
- ref?: (el: HTMLElement) => void;
22
- style?: () => JSX.CSSProperties;
23
- active?: () => boolean;
21
+ ref?: (el: HTMLElement) => void;
22
+ style?: () => JSX.CSSProperties;
23
+ active?: () => boolean;
24
24
  };
25
25
 
26
26
  export const NOOP_GLASS: Required<GlassSurface> = {
27
- ref: () => {},
28
- style: () => ({}),
29
- active: () => false,
27
+ ref: () => {},
28
+ style: () => ({}),
29
+ active: () => false,
30
30
  };
31
31
 
32
32
  type SectionCardProps = {
33
- icon?: string;
34
- title?: JSX.Element;
35
- subtitle?: JSX.Element;
36
- count?: number | string;
37
- action?: JSX.Element;
38
- toolbar?: JSX.Element;
39
- headerClass?: string;
40
- subtitleClass?: string;
41
- class?: string;
42
- glass?: GlassSurface;
43
- children?: JSX.Element;
33
+ icon?: string;
34
+ title?: JSX.Element;
35
+ subtitle?: JSX.Element;
36
+ count?: number | string;
37
+ action?: JSX.Element;
38
+ toolbar?: JSX.Element;
39
+ headerClass?: string;
40
+ subtitleClass?: string;
41
+ class?: string;
42
+ glass?: GlassSurface;
43
+ children?: JSX.Element;
44
44
  };
45
45
 
46
46
  // The section owns every gap; the header, toolbar and rows inside it add none.
47
47
  export function SectionCard(props: SectionCardProps) {
48
- const glass = () => props.glass ?? NOOP_GLASS;
49
- const active = () => glass().active?.() ?? false;
50
- const hasHeader = () =>
51
- props.icon != null || props.title != null || props.action != null || props.count != null;
52
- // Resolved once: a header-only card must not pay the section gap for an
53
- // empty body slot, and reading props.children twice would build it twice.
54
- const body = children(() => props.children);
55
- const hasBody = () => body.toArray().some((child) => child != null && child !== false);
48
+ const glass = () => props.glass ?? NOOP_GLASS;
49
+ const active = () => glass().active?.() ?? false;
50
+ const hasHeader = () =>
51
+ props.icon != null || props.title != null || props.action != null || props.count != null;
52
+ // Resolved once: a header-only card must not pay the section gap for an
53
+ // empty body slot, and reading props.children twice would build it twice.
54
+ const body = children(() => props.children);
55
+ const hasBody = () => body.toArray().some((child) => child != null && child !== false);
56
56
 
57
- return (
58
- <section
59
- data-slot="section-card"
60
- ref={glass().ref}
61
- class={cn(
62
- CARD_SURFACE_BASE,
63
- SECTION_OUTER_RADIUS,
64
- SECTION_PADDING,
65
- "relative flex flex-col gap-3 overflow-hidden transition-glass [contain:layout_style_paint] md:gap-4",
66
- props.class,
67
- )}
68
- classList={{ [CARD_BLUR]: !active() }}
69
- style={glass().style?.() ?? {}}
70
- >
71
- <Show when={hasHeader()}>
72
- <header
73
- data-slot="section-card-header"
74
- class={cn("flex items-center gap-2 sm:gap-3", props.headerClass)}
75
- >
76
- <Show when={props.icon}>
77
- {(icon) => <SectionIcon icon={icon()} tone="var(--primary)" />}
78
- </Show>
79
- <div data-slot="section-card-headings" class="flex min-w-0 flex-1 flex-col gap-0.5">
80
- <div data-slot="section-card-headline" class="flex min-w-0 items-center gap-2 sm:gap-3">
81
- <Show when={props.title}>
82
- <SectionTitle>{props.title}</SectionTitle>
83
- </Show>
84
- <Show when={props.count != null}>
85
- <CountPill>{props.count}</CountPill>
86
- </Show>
87
- </div>
88
- <Show when={props.subtitle}>
89
- <SectionMeta class={props.subtitleClass}>{props.subtitle}</SectionMeta>
90
- </Show>
91
- </div>
92
- <Show when={props.action}>
93
- <div data-slot="section-card-actions" class="flex shrink-0 items-center gap-2">
94
- {props.action}
95
- </div>
96
- </Show>
97
- </header>
98
- </Show>
99
- <Show when={props.toolbar}>
100
- <div
101
- data-slot="section-card-toolbar"
102
- class={cn(hasHeader() && "border-border/50 border-t pt-3")}
103
- >
104
- {props.toolbar}
105
- </div>
106
- </Show>
107
- <Show when={hasBody()}>
108
- <div data-slot="section-card-body">{body()}</div>
109
- </Show>
110
- </section>
111
- );
57
+ return (
58
+ <section
59
+ data-slot="section-card"
60
+ ref={glass().ref}
61
+ class={cn(
62
+ CARD_SURFACE_BASE,
63
+ SECTION_OUTER_RADIUS,
64
+ SECTION_PADDING,
65
+ "transition-glass relative flex flex-col gap-3 overflow-hidden [contain:layout_style_paint] md:gap-4",
66
+ props.class,
67
+ )}
68
+ classList={{ [CARD_BLUR]: !active() }}
69
+ style={glass().style?.() ?? {}}
70
+ >
71
+ <Show when={hasHeader()}>
72
+ <header
73
+ data-slot="section-card-header"
74
+ class={cn("flex items-center gap-2 sm:gap-3", props.headerClass)}
75
+ >
76
+ <Show when={props.icon}>
77
+ {(icon) => <SectionIcon icon={icon()} tone="var(--primary)" />}
78
+ </Show>
79
+ <div data-slot="section-card-headings" class="flex min-w-0 flex-1 flex-col gap-0.5">
80
+ <div data-slot="section-card-headline" class="flex min-w-0 items-center gap-2 sm:gap-3">
81
+ <Show when={props.title}>
82
+ <SectionTitle>{props.title}</SectionTitle>
83
+ </Show>
84
+ <Show when={props.count != null}>
85
+ <CountPill>{props.count}</CountPill>
86
+ </Show>
87
+ </div>
88
+ <Show when={props.subtitle}>
89
+ <SectionMeta class={props.subtitleClass}>{props.subtitle}</SectionMeta>
90
+ </Show>
91
+ </div>
92
+ <Show when={props.action}>
93
+ <div data-slot="section-card-actions" class="flex shrink-0 items-center gap-2">
94
+ {props.action}
95
+ </div>
96
+ </Show>
97
+ </header>
98
+ </Show>
99
+ <Show when={props.toolbar}>
100
+ <div
101
+ data-slot="section-card-toolbar"
102
+ class={cn(hasHeader() && "border-border/50 border-t pt-3")}
103
+ >
104
+ {props.toolbar}
105
+ </div>
106
+ </Show>
107
+ <Show when={hasBody()}>
108
+ <div data-slot="section-card-body">{body()}</div>
109
+ </Show>
110
+ </section>
111
+ );
112
112
  }
113
113
 
114
114
  export function SectionRow(props: ComponentProps<"div"> & { interactive?: boolean }) {
115
- const [local, rest] = splitProps(props, ["class", "interactive"]);
116
- return (
117
- <div
118
- data-slot="section-row"
119
- class={cn(
120
- SECTION_ROW_SURFACE,
121
- SECTION_INNER_RADIUS,
122
- SECTION_PADDING,
123
- local.interactive && SECTION_ROW_INTERACTIVE,
124
- local.class,
125
- )}
126
- {...rest}
127
- />
128
- );
115
+ const [local, rest] = splitProps(props, ["class", "interactive"]);
116
+ return (
117
+ <div
118
+ data-slot="section-row"
119
+ class={cn(
120
+ SECTION_ROW_SURFACE,
121
+ SECTION_INNER_RADIUS,
122
+ SECTION_PADDING,
123
+ local.interactive && SECTION_ROW_INTERACTIVE,
124
+ local.class,
125
+ )}
126
+ {...rest}
127
+ />
128
+ );
129
129
  }
130
130
 
131
131
  type ListRowProps = {
132
- /** Leading visual: SectionIcon, Avatar, drag handle. */
133
- leading?: JSX.Element;
134
- title: JSX.Element;
135
- /** Chips inline after the title. */
136
- badges?: JSX.Element;
137
- subtitle?: JSX.Element;
138
- /** Quiet trailing text: versions, timestamps, counts. */
139
- meta?: JSX.Element;
140
- /** Controls at the row's end. Stacked above the open overlay. */
141
- actions?: JSX.Element;
142
- /** Activates the whole row. Renders a chevron when there are no actions. */
143
- onOpen?: () => void;
144
- /** The whole row is a link. Same chevron and press target as onOpen. */
145
- href?: string;
146
- /** Accessible name for the whole-row activation; required with href or onOpen. */
147
- openLabel?: string;
148
- class?: string;
132
+ /** Leading visual: SectionIcon, Avatar, drag handle. */
133
+ leading?: JSX.Element;
134
+ title: JSX.Element;
135
+ /** Chips inline after the title. */
136
+ badges?: JSX.Element;
137
+ subtitle?: JSX.Element;
138
+ /** Quiet trailing text: versions, timestamps, counts. */
139
+ meta?: JSX.Element;
140
+ /** Controls at the row's end. Stacked above the open overlay. */
141
+ actions?: JSX.Element;
142
+ /** Activates the whole row. Renders a chevron when there are no actions. */
143
+ onOpen?: () => void;
144
+ /** The whole row is a link. Same chevron and press target as onOpen. */
145
+ href?: string;
146
+ /** Accessible name for the whole-row activation; required with href or onOpen. */
147
+ openLabel?: string;
148
+ class?: string;
149
149
  };
150
150
 
151
151
  /**
@@ -154,15 +154,15 @@ type ListRowProps = {
154
154
  * rather than navigable items.
155
155
  */
156
156
  export function FactRow(props: { label: JSX.Element; children: JSX.Element; class?: string }) {
157
- return (
158
- <div
159
- data-slot="fact-row"
160
- class={cn("flex items-baseline justify-between gap-3 py-1.5", props.class)}
161
- >
162
- <span class="shrink-0 text-muted-foreground text-xs">{props.label}</span>
163
- <span class="min-w-0 text-right text-sm">{props.children}</span>
164
- </div>
165
- );
157
+ return (
158
+ <div
159
+ data-slot="fact-row"
160
+ class={cn("flex items-baseline justify-between gap-3 py-1.5", props.class)}
161
+ >
162
+ <span class="text-muted-foreground shrink-0 text-xs">{props.label}</span>
163
+ <span class="min-w-0 text-right text-sm">{props.children}</span>
164
+ </div>
165
+ );
166
166
  }
167
167
 
168
168
  /**
@@ -170,140 +170,140 @@ export function FactRow(props: { label: JSX.Element; children: JSX.Element; clas
170
170
  * whatever it holds; the row itself, not a nested button, is what you press.
171
171
  */
172
172
  export function ListRow(props: ListRowProps) {
173
- const opens = () => props.onOpen !== undefined || props.href !== undefined;
174
- return (
175
- <SectionRow
176
- interactive={opens()}
177
- class={cn("@container/list-row relative flex items-center gap-3", props.class)}
178
- >
179
- <Show when={props.href}>
180
- {(href) => (
181
- <a href={href()} class="absolute inset-0 rounded-[inherit] outline-none">
182
- <span class="sr-only">{props.openLabel}</span>
183
- </a>
184
- )}
185
- </Show>
186
- <Show when={props.href === undefined && props.onOpen}>
187
- <button
188
- type="button"
189
- class="absolute inset-0 rounded-[inherit] outline-none"
190
- aria-label={props.openLabel}
191
- onClick={() => props.onOpen?.()}
192
- />
193
- </Show>
194
- <Show when={props.leading}>
195
- <span class="flex shrink-0 items-center gap-2">{props.leading}</span>
196
- </Show>
197
- {/* Identity column. The floor is what gives the name priority: without
173
+ const opens = () => props.onOpen !== undefined || props.href !== undefined;
174
+ return (
175
+ <SectionRow
176
+ interactive={opens()}
177
+ class={cn("@container/list-row relative flex items-center gap-3", props.class)}
178
+ >
179
+ <Show when={props.href}>
180
+ {(href) => (
181
+ <a href={href()} class="absolute inset-0 rounded-[inherit] outline-none">
182
+ <span class="sr-only">{props.openLabel}</span>
183
+ </a>
184
+ )}
185
+ </Show>
186
+ <Show when={props.href === undefined && props.onOpen}>
187
+ <button
188
+ type="button"
189
+ class="absolute inset-0 rounded-[inherit] outline-none"
190
+ aria-label={props.openLabel}
191
+ onClick={() => props.onOpen?.()}
192
+ />
193
+ </Show>
194
+ <Show when={props.leading}>
195
+ <span class="flex shrink-0 items-center gap-2">{props.leading}</span>
196
+ </Show>
197
+ {/* Identity column. The floor is what gives the name priority: without
198
198
  it this is the only shrinkable child, so flex crushes it to an
199
199
  ellipsis and hands every spare pixel to meta. Sized to hold a name
200
200
  plus its badge. */}
201
- <div class="min-w-[9rem] flex-1">
202
- <div class="flex min-w-0 items-center gap-2">
203
- <p class="truncate font-semibold text-sm leading-tight">{props.title}</p>
204
- {props.badges}
205
- </div>
206
- <Show when={props.subtitle}>
207
- <p class="mt-1 truncate text-muted-foreground text-xs">{props.subtitle}</p>
208
- </Show>
209
- </div>
210
- {/* Trailing meta, centred across both identity lines. shrink-0, because
201
+ <div class="min-w-[9rem] flex-1">
202
+ <div class="flex min-w-0 items-center gap-2">
203
+ <p class="truncate text-sm leading-tight font-semibold">{props.title}</p>
204
+ {props.badges}
205
+ </div>
206
+ <Show when={props.subtitle}>
207
+ <p class="text-muted-foreground mt-1 truncate text-xs">{props.subtitle}</p>
208
+ </Show>
209
+ </div>
210
+ {/* Trailing meta, centred across both identity lines. shrink-0, because
211
211
  a squeeze-driven wrap fires off whichever meta happens to be widest
212
212
  while the flex-1 identity column still holds unused slack. Meta that
213
213
  wants to reflow reads @container/list-row and says so itself. */}
214
- <Show when={props.meta}>
215
- <div class="shrink-0 text-muted-foreground text-xs">{props.meta}</div>
216
- </Show>
217
- <Show when={props.actions}>
218
- <div class="relative flex shrink-0 items-center gap-1">{props.actions}</div>
219
- </Show>
220
- <Show when={opens() && props.actions === undefined}>
221
- <Icon
222
- icon="lucide:chevron-right"
223
- width={16}
224
- height={16}
225
- class="shrink-0 text-muted-foreground"
226
- aria-hidden="true"
227
- />
228
- </Show>
229
- </SectionRow>
230
- );
214
+ <Show when={props.meta}>
215
+ <div class="text-muted-foreground shrink-0 text-xs">{props.meta}</div>
216
+ </Show>
217
+ <Show when={props.actions}>
218
+ <div class="relative flex shrink-0 items-center gap-1">{props.actions}</div>
219
+ </Show>
220
+ <Show when={opens() && props.actions === undefined}>
221
+ <Icon
222
+ icon="lucide:chevron-right"
223
+ width={16}
224
+ height={16}
225
+ class="text-muted-foreground shrink-0"
226
+ aria-hidden="true"
227
+ />
228
+ </Show>
229
+ </SectionRow>
230
+ );
231
231
  }
232
232
 
233
233
  type SectionIconSize = "sm" | "md" | "lg";
234
234
 
235
235
  const ICON_DIMENSIONS: Record<SectionIconSize, string> = {
236
- sm: "size-7 [&>[data-slot=icon]]:text-[16px]",
237
- md: "size-10 sm:size-11 [&>[data-slot=icon]]:text-[20px] sm:[&>[data-slot=icon]]:text-[22px]",
238
- lg: "size-12 sm:size-14 [&>[data-slot=icon]]:text-[24px] sm:[&>[data-slot=icon]]:text-[28px]",
236
+ sm: "size-7 [&>[data-slot=icon]]:text-[16px]",
237
+ md: "size-10 sm:size-11 [&>[data-slot=icon]]:text-[20px] sm:[&>[data-slot=icon]]:text-[22px]",
238
+ lg: "size-12 sm:size-14 [&>[data-slot=icon]]:text-[24px] sm:[&>[data-slot=icon]]:text-[28px]",
239
239
  };
240
240
 
241
241
  /** @deprecated pass a CSS color to `tone` instead. */
242
242
  const LEGACY_TONES: Record<string, string | undefined> = {
243
- neutral: undefined,
244
- primary: "var(--primary)",
243
+ neutral: undefined,
244
+ primary: "var(--primary)",
245
245
  };
246
246
 
247
247
  export function SectionIcon(props: {
248
- icon?: string;
249
- children?: JSX.Element;
250
- size?: SectionIconSize;
251
- /** Any CSS color. `"neutral"` and `"primary"` are the deprecated old enum. */
252
- tone?: string;
253
- class?: string;
248
+ icon?: string;
249
+ children?: JSX.Element;
250
+ size?: SectionIconSize;
251
+ /** Any CSS color. `"neutral"` and `"primary"` are the deprecated old enum. */
252
+ tone?: string;
253
+ class?: string;
254
254
  }) {
255
- const tone = () => {
256
- const t = props.tone;
257
- if (t == null) return undefined;
258
- return t in LEGACY_TONES ? LEGACY_TONES[t] : t;
259
- };
260
- return (
261
- <span
262
- data-slot="section-icon"
263
- class={cn(
264
- tone() ? ICON_PILL_TINT : `${ICON_PILL} text-foreground/80`,
265
- SECTION_INNER_RADIUS,
266
- ICON_DIMENSIONS[props.size ?? "md"],
267
- props.class,
268
- )}
269
- style={tone() ? { "--glass-tone": tone() } : undefined}
270
- >
271
- <Show when={props.children} fallback={props.icon ? <Icon icon={props.icon} /> : null}>
272
- {props.children}
273
- </Show>
274
- </span>
275
- );
255
+ const tone = () => {
256
+ const t = props.tone;
257
+ if (t == null) return undefined;
258
+ return t in LEGACY_TONES ? LEGACY_TONES[t] : t;
259
+ };
260
+ return (
261
+ <span
262
+ data-slot="section-icon"
263
+ class={cn(
264
+ tone() ? ICON_PILL_TINT : `${ICON_PILL} text-foreground/80`,
265
+ SECTION_INNER_RADIUS,
266
+ ICON_DIMENSIONS[props.size ?? "md"],
267
+ props.class,
268
+ )}
269
+ style={tone() ? { "--glass-tone": tone() } : undefined}
270
+ >
271
+ <Show when={props.children} fallback={props.icon ? <Icon icon={props.icon} /> : null}>
272
+ {props.children}
273
+ </Show>
274
+ </span>
275
+ );
276
276
  }
277
277
 
278
278
  export function SectionTitle(props: { children: JSX.Element; class?: string }) {
279
- return (
280
- <h2
281
- data-slot="section-title"
282
- class={cn(
283
- "truncate font-bold text-foreground text-lg tracking-tight sm:text-xl",
284
- props.class,
285
- )}
286
- >
287
- {props.children}
288
- </h2>
289
- );
279
+ return (
280
+ <h2
281
+ data-slot="section-title"
282
+ class={cn(
283
+ "text-foreground truncate text-lg font-bold tracking-tight sm:text-xl",
284
+ props.class,
285
+ )}
286
+ >
287
+ {props.children}
288
+ </h2>
289
+ );
290
290
  }
291
291
 
292
292
  function SectionHeading(props: { children: JSX.Element; class?: string }) {
293
- return (
294
- <h3
295
- data-slot="section-subtitle"
296
- class={cn("font-semibold text-base leading-tight", props.class)}
297
- >
298
- {props.children}
299
- </h3>
300
- );
293
+ return (
294
+ <h3
295
+ data-slot="section-subtitle"
296
+ class={cn("text-base leading-tight font-semibold", props.class)}
297
+ >
298
+ {props.children}
299
+ </h3>
300
+ );
301
301
  }
302
302
 
303
303
  /** @deprecated A bare heading has no owner: `SectionGroup` for a labelled group
304
304
  * inside a card, `FieldLegend` for a titled group of form rows. */
305
305
  export function SectionSubtitle(props: { children: JSX.Element; class?: string }) {
306
- return <SectionHeading class={props.class}>{props.children}</SectionHeading>;
306
+ return <SectionHeading class={props.class}>{props.children}</SectionHeading>;
307
307
  }
308
308
 
309
309
  /** One labelled group inside a `SectionCard`: icon, label, optional count and
@@ -311,68 +311,68 @@ export function SectionSubtitle(props: { children: JSX.Element; class?: string }
311
311
  * its own rows and far from the group above; no rule is drawn. A zero count
312
312
  * renders no pill: the empty group below already says it. */
313
313
  export function SectionGroup(props: {
314
- icon: string;
315
- label: JSX.Element;
316
- count?: number | string;
317
- action?: JSX.Element;
318
- class?: string;
319
- children: JSX.Element;
314
+ icon: string;
315
+ label: JSX.Element;
316
+ count?: number | string;
317
+ action?: JSX.Element;
318
+ class?: string;
319
+ children: JSX.Element;
320
320
  }) {
321
- return (
322
- <section data-slot="section-group" class={cn("mt-7 first:mt-3", props.class)}>
323
- <header
324
- data-slot="section-group-header"
325
- class="mb-2 flex flex-wrap items-center justify-between gap-2"
326
- >
327
- <div data-slot="section-group-heading" class="flex min-w-0 items-center gap-2">
328
- <SectionIcon icon={props.icon} size="sm" tone="var(--primary)" />
329
- <SectionHeading>{props.label}</SectionHeading>
330
- <Show when={props.count}>
331
- <CountPill>{props.count}</CountPill>
332
- </Show>
333
- </div>
334
- {props.action}
335
- </header>
336
- {props.children}
337
- </section>
338
- );
321
+ return (
322
+ <section data-slot="section-group" class={cn("mt-7 first:mt-3", props.class)}>
323
+ <header
324
+ data-slot="section-group-header"
325
+ class="mb-2 flex flex-wrap items-center justify-between gap-2"
326
+ >
327
+ <div data-slot="section-group-heading" class="flex min-w-0 items-center gap-2">
328
+ <SectionIcon icon={props.icon} size="sm" tone="var(--primary)" />
329
+ <SectionHeading>{props.label}</SectionHeading>
330
+ <Show when={props.count}>
331
+ <CountPill>{props.count}</CountPill>
332
+ </Show>
333
+ </div>
334
+ {props.action}
335
+ </header>
336
+ {props.children}
337
+ </section>
338
+ );
339
339
  }
340
340
 
341
341
  /** @deprecated SectionMeta, or FieldLegend for a titled group of rows. */
342
342
  export function SectionLabel(props: { children: JSX.Element; class?: string }) {
343
- return <SectionMeta class={cn("font-medium", props.class)}>{props.children}</SectionMeta>;
343
+ return <SectionMeta class={cn("font-medium", props.class)}>{props.children}</SectionMeta>;
344
344
  }
345
345
 
346
346
  export function SectionMeta(props: { children: JSX.Element; class?: string }) {
347
- return (
348
- <p data-slot="section-meta" class={cn("text-muted-foreground text-xs", props.class)}>
349
- {props.children}
350
- </p>
351
- );
347
+ return (
348
+ <p data-slot="section-meta" class={cn("text-muted-foreground text-xs", props.class)}>
349
+ {props.children}
350
+ </p>
351
+ );
352
352
  }
353
353
 
354
354
  export function SectionRowSkeleton(props: { class?: string }) {
355
- return (
356
- <div
357
- data-slot="section-row-skeleton"
358
- aria-hidden="true"
359
- class={cn(
360
- SECTION_ROW_SURFACE,
361
- SECTION_INNER_RADIUS,
362
- "h-14 animate-pulse [--glass-rim:0.15]",
363
- props.class,
364
- )}
365
- />
366
- );
355
+ return (
356
+ <div
357
+ data-slot="section-row-skeleton"
358
+ aria-hidden="true"
359
+ class={cn(
360
+ SECTION_ROW_SURFACE,
361
+ SECTION_INNER_RADIUS,
362
+ "h-14 animate-pulse [--glass-rim:0.15]",
363
+ props.class,
364
+ )}
365
+ />
366
+ );
367
367
  }
368
368
 
369
369
  export function SectionRowSkeletons(props: { count?: number }) {
370
- const n = props.count ?? 3;
371
- return (
372
- <div data-slot="section-row-skeletons" class="flex flex-col gap-2" aria-busy="true">
373
- {Array.from({ length: n }, () => (
374
- <SectionRowSkeleton />
375
- ))}
376
- </div>
377
- );
370
+ const n = props.count ?? 3;
371
+ return (
372
+ <div data-slot="section-row-skeletons" class="flex flex-col gap-2" aria-busy="true">
373
+ {Array.from({ length: n }, () => (
374
+ <SectionRowSkeleton />
375
+ ))}
376
+ </div>
377
+ );
378
378
  }