@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,13 +1,13 @@
1
1
  import { useRadioGroupContext } from "@kobalte/core/radio-group";
2
2
  import {
3
- children,
4
- createContext,
5
- createSignal,
6
- type JSX,
7
- onCleanup,
8
- onMount,
9
- Show,
10
- useContext,
3
+ children,
4
+ createContext,
5
+ createSignal,
6
+ type JSX,
7
+ onCleanup,
8
+ onMount,
9
+ Show,
10
+ useContext,
11
11
  } from "solid-js";
12
12
  import { CARD_SURFACE } from "../lib/card-classes.js";
13
13
  import { STAGGER } from "../lib/motion-classes.js";
@@ -24,14 +24,14 @@ const OPTION_CARD_CHROME = `${CARD_SURFACE} group/option-card relative cursor-po
24
24
  * 0fr -> 1fr on the morph token) while it is picked, and the content settles
25
25
  * in behind the growing edge. Nothing appears below the card. */
26
26
  const OPTION_CARD_DRAWER =
27
- "grid grid-rows-[0fr] transition-[grid-template-rows] duration-(--duration-morph) ease-(--ease-morph) group-data-[checked]/option-card:grid-rows-[1fr]";
27
+ "grid grid-rows-[0fr] transition-[grid-template-rows] duration-(--duration-morph) ease-(--ease-morph) group-data-[checked]/option-card:grid-rows-[1fr]";
28
28
  /* Flat: hover is a tint, the current row is the check plus full text colour.
29
29
  * The rows start under the title text (card pad + icon + gap, less the row's own pad). */
30
30
  const OPTION_CHOICE_ROW =
31
- "rounded-sm text-foreground/75 transition-colors hover:bg-foreground/5 aria-checked:text-foreground";
31
+ "rounded-sm text-foreground/75 transition-colors hover:bg-foreground/5 aria-checked:text-foreground";
32
32
 
33
33
  const OPTION_CARD_DRAWER_CONTENT =
34
- "-translate-y-2 flex flex-col gap-0.5 pr-1 pb-2 pl-[calc(var(--spacing)*3.5+54px)] opacity-0 transition-[opacity,translate] duration-(--duration-expand) ease-(--ease-morph) group-data-[checked]/option-card:translate-y-0 group-data-[checked]/option-card:opacity-100 group-data-[checked]/option-card:delay-[80ms]";
34
+ "-translate-y-2 flex flex-col gap-0.5 pr-1 pb-2 pl-[calc(var(--spacing)*3.5+54px)] opacity-0 transition-[opacity,translate] duration-(--duration-expand) ease-(--ease-morph) group-data-[checked]/option-card:translate-y-0 group-data-[checked]/option-card:opacity-100 group-data-[checked]/option-card:delay-[80ms]";
35
35
 
36
36
  /* Sub-options are rows of the card, chosen in place: the same row a picker
37
37
  * list shows, flat on the card (a glass pill on a glass card is a layer too
@@ -39,175 +39,175 @@ const OPTION_CARD_DRAWER_CONTENT =
39
39
  * value (`subValue` / `onSubChange`); a choice registers so the card knows
40
40
  * it has rows to name as a radiogroup. */
41
41
  type ChoiceContext = {
42
- subValue: () => string | undefined;
43
- pick: (value: string) => void;
44
- register: (value: string) => () => void;
42
+ subValue: () => string | undefined;
43
+ pick: (value: string) => void;
44
+ register: (value: string) => () => void;
45
45
  };
46
46
  const OptionChoiceContext = createContext<ChoiceContext>();
47
47
 
48
48
  export function OptionChoice(props: {
49
- value: string;
50
- label: string;
51
- hint?: string;
52
- icon?: string;
53
- disabled?: boolean;
49
+ value: string;
50
+ label: string;
51
+ hint?: string;
52
+ icon?: string;
53
+ disabled?: boolean;
54
54
  }) {
55
- const card = useContext(OptionChoiceContext);
56
- if (!card) throw new Error("OptionChoice renders inside an OptionCard");
57
- onMount(() => onCleanup(card.register(props.value)));
58
- const selected = () => card.subValue() === props.value;
59
- return (
60
- <PickerRow
61
- as="button"
62
- type="button"
63
- role="radio"
64
- aria-checked={selected()}
65
- data-slot="option-choice"
66
- class={OPTION_CHOICE_ROW}
67
- disabled={props.disabled}
68
- icon={props.icon}
69
- title={props.label}
70
- subtitle={props.hint}
71
- selected={selected()}
72
- multi={false}
73
- onClick={() => !props.disabled && card.pick(props.value)}
74
- />
75
- );
55
+ const card = useContext(OptionChoiceContext);
56
+ if (!card) throw new Error("OptionChoice renders inside an OptionCard");
57
+ onMount(() => onCleanup(card.register(props.value)));
58
+ const selected = () => card.subValue() === props.value;
59
+ return (
60
+ <PickerRow
61
+ as="button"
62
+ type="button"
63
+ role="radio"
64
+ aria-checked={selected()}
65
+ data-slot="option-choice"
66
+ class={OPTION_CHOICE_ROW}
67
+ disabled={props.disabled}
68
+ icon={props.icon}
69
+ title={props.label}
70
+ subtitle={props.hint}
71
+ selected={selected()}
72
+ multi={false}
73
+ onClick={() => !props.disabled && card.pick(props.value)}
74
+ />
75
+ );
76
76
  }
77
77
 
78
78
  export function OptionCardGroup(props: {
79
- value: string | null;
80
- onChange: (value: string) => void;
81
- "aria-label"?: string;
82
- "aria-labelledby"?: string;
83
- class?: string;
84
- children: JSX.Element;
79
+ value: string | null;
80
+ onChange: (value: string) => void;
81
+ "aria-label"?: string;
82
+ "aria-labelledby"?: string;
83
+ class?: string;
84
+ children: JSX.Element;
85
85
  }) {
86
- return (
87
- <RadioGroup
88
- class={cn("gap-2", props.class)}
89
- value={props.value ?? undefined}
90
- onChange={props.onChange}
91
- aria-label={props["aria-label"]}
92
- aria-labelledby={props["aria-labelledby"]}
93
- >
94
- {props.children}
95
- </RadioGroup>
96
- );
86
+ return (
87
+ <RadioGroup
88
+ class={cn("gap-2", props.class)}
89
+ value={props.value ?? undefined}
90
+ onChange={props.onChange}
91
+ aria-label={props["aria-label"]}
92
+ aria-labelledby={props["aria-labelledby"]}
93
+ >
94
+ {props.children}
95
+ </RadioGroup>
96
+ );
97
97
  }
98
98
 
99
99
  export function OptionCard(props: {
100
- value: string;
101
- title: string;
102
- description?: string;
103
- icon?: string;
104
- iconImage?: string;
105
- /** Per-option tone (setup's brand colours); the theme primary when absent. */
106
- accentVar?: string;
107
- /** Drop the check when picking the card is itself the next step. */
108
- ornament?: "check" | "none";
109
- /** Fires on every click, including a re-pick of the already-checked card,
110
- * which the group's `onChange` alone never reports. */
111
- onPick?: () => void;
112
- disabled?: boolean;
113
- class?: string;
114
- /** The current sub-option (an OptionChoice value). */
115
- subValue?: string;
116
- onSubChange?: (value: string) => void;
117
- /** Sub-options (OptionChoice rows) or a custom body. The card grows to
118
- * reveal them while it is picked. */
119
- children?: JSX.Element;
100
+ value: string;
101
+ title: string;
102
+ description?: string;
103
+ icon?: string;
104
+ iconImage?: string;
105
+ /** Per-option tone (setup's brand colours); the theme primary when absent. */
106
+ accentVar?: string;
107
+ /** Drop the check when picking the card is itself the next step. */
108
+ ornament?: "check" | "none";
109
+ /** Fires on every click, including a re-pick of the already-checked card,
110
+ * which the group's `onChange` alone never reports. */
111
+ onPick?: () => void;
112
+ disabled?: boolean;
113
+ class?: string;
114
+ /** The current sub-option (an OptionChoice value). */
115
+ subValue?: string;
116
+ onSubChange?: (value: string) => void;
117
+ /** Sub-options (OptionChoice rows) or a custom body. The card grows to
118
+ * reveal them while it is picked. */
119
+ children?: JSX.Element;
120
120
  }) {
121
- const group = useRadioGroupContext();
122
- const checked = () => group.isSelectedValue(props.value);
123
- const [choices, setChoices] = createSignal<string[]>([]);
124
- const choice: ChoiceContext = {
125
- subValue: () => props.subValue,
126
- pick: (value) => props.onSubChange?.(value),
127
- register: (value) => {
128
- setChoices((list) => [...list, value]);
129
- return () => setChoices((list) => list.filter((v) => v !== value));
130
- },
131
- };
132
- const kids = children(() => (
133
- <OptionChoiceContext.Provider value={choice}>{props.children}</OptionChoiceContext.Provider>
134
- ));
135
- return (
136
- <div
137
- data-slot="option-card"
138
- data-checked={checked() ? "" : undefined}
139
- data-disabled={props.disabled ? "" : undefined}
140
- class={cn(OPTION_CARD_CHROME, props.class)}
141
- style={
142
- props.accentVar ? ({ "--glass-tone": props.accentVar } as JSX.CSSProperties) : undefined
143
- }
144
- >
145
- <RadioGroupItem
146
- value={props.value}
147
- disabled={props.disabled}
148
- showControl={false}
149
- onClick={() => !props.disabled && props.onPick?.()}
150
- class="relative w-full cursor-pointer overflow-hidden rounded-[inherit] text-left"
151
- >
152
- {/* On the header row, not the card: a grown card keeps its rows clear. */}
153
- <Ornament kind={props.ornament ?? "check"} />
154
- <div data-slot="option-card-row" class="flex w-full items-center gap-3.5 p-3.5">
155
- <OptionIconWell icon={props.icon} image={props.iconImage} />
156
- <div class="flex min-w-0 flex-1 flex-col gap-0.5">
157
- <span data-slot="option-card-title" class="font-semibold text-[15px] leading-snug">
158
- {props.title}
159
- </span>
160
- <Show when={props.description}>
161
- {(description) => (
162
- <span
163
- data-slot="option-card-description"
164
- class="text-muted-foreground text-sm leading-normal"
165
- >
166
- {description()}
167
- </span>
168
- )}
169
- </Show>
170
- </div>
171
- </div>
172
- </RadioGroupItem>
173
- <Show when={kids.toArray().length > 0}>
174
- <div data-slot="option-card-drawer" class={OPTION_CARD_DRAWER}>
175
- <div class="min-h-0 overflow-hidden">
176
- {/* biome-ignore lint/a11y/useAriaPropsSupportedByRole: the role is always radiogroup or group, both take aria-label */}
177
- <div
178
- role={choices().length > 0 ? "radiogroup" : "group"}
179
- aria-label={`${props.title} options`}
180
- class={OPTION_CARD_DRAWER_CONTENT}
181
- classList={{ [STAGGER]: checked() }}
182
- >
183
- {kids()}
184
- </div>
185
- </div>
186
- </div>
187
- </Show>
188
- </div>
189
- );
121
+ const group = useRadioGroupContext();
122
+ const checked = () => group.isSelectedValue(props.value);
123
+ const [choices, setChoices] = createSignal<string[]>([]);
124
+ const choice: ChoiceContext = {
125
+ subValue: () => props.subValue,
126
+ pick: (value) => props.onSubChange?.(value),
127
+ register: (value) => {
128
+ setChoices((list) => [...list, value]);
129
+ return () => setChoices((list) => list.filter((v) => v !== value));
130
+ },
131
+ };
132
+ const kids = children(() => (
133
+ <OptionChoiceContext.Provider value={choice}>{props.children}</OptionChoiceContext.Provider>
134
+ ));
135
+ return (
136
+ <div
137
+ data-slot="option-card"
138
+ data-checked={checked() ? "" : undefined}
139
+ data-disabled={props.disabled ? "" : undefined}
140
+ class={cn(OPTION_CARD_CHROME, props.class)}
141
+ style={
142
+ props.accentVar ? ({ "--glass-tone": props.accentVar } as JSX.CSSProperties) : undefined
143
+ }
144
+ >
145
+ <RadioGroupItem
146
+ value={props.value}
147
+ disabled={props.disabled}
148
+ showControl={false}
149
+ onClick={() => !props.disabled && props.onPick?.()}
150
+ class="relative w-full cursor-pointer overflow-hidden rounded-[inherit] text-left"
151
+ >
152
+ {/* On the header row, not the card: a grown card keeps its rows clear. */}
153
+ <Ornament kind={props.ornament ?? "check"} />
154
+ <div data-slot="option-card-row" class="flex w-full items-center gap-3.5 p-3.5">
155
+ <OptionIconWell icon={props.icon} image={props.iconImage} />
156
+ <div class="flex min-w-0 flex-1 flex-col gap-0.5">
157
+ <span data-slot="option-card-title" class="text-[15px] leading-snug font-semibold">
158
+ {props.title}
159
+ </span>
160
+ <Show when={props.description}>
161
+ {(description) => (
162
+ <span
163
+ data-slot="option-card-description"
164
+ class="text-muted-foreground text-sm leading-normal"
165
+ >
166
+ {description()}
167
+ </span>
168
+ )}
169
+ </Show>
170
+ </div>
171
+ </div>
172
+ </RadioGroupItem>
173
+ <Show when={kids.toArray().length > 0}>
174
+ <div data-slot="option-card-drawer" class={OPTION_CARD_DRAWER}>
175
+ <div class="min-h-0 overflow-hidden">
176
+ {/* biome-ignore lint/a11y/useAriaPropsSupportedByRole: the role is always radiogroup or group, both take aria-label */}
177
+ <div
178
+ role={choices().length > 0 ? "radiogroup" : "group"}
179
+ aria-label={`${props.title} options`}
180
+ class={OPTION_CARD_DRAWER_CONTENT}
181
+ classList={{ [STAGGER]: checked() }}
182
+ >
183
+ {kids()}
184
+ </div>
185
+ </div>
186
+ </div>
187
+ </Show>
188
+ </div>
189
+ );
190
190
  }
191
191
 
192
192
  function OptionIconWell(props: { icon?: string; image?: string }) {
193
- return (
194
- <Show when={props.icon || props.image}>
195
- <span
196
- data-slot="option-card-icon"
197
- aria-hidden="true"
198
- class="grid size-10 shrink-0 place-items-center rounded-[14px] bg-[color-mix(in_oklab,var(--surface-tone)_80%,black)] [color:oklch(from_var(--surface-tone)_calc((0.75_-_l)*100)_0_0)]"
199
- >
200
- <Show
201
- when={props.image}
202
- fallback={
203
- <Show when={props.icon}>{(icon) => <Icon icon={icon()} width={20} height={20} />}</Show>
204
- }
205
- >
206
- {(src) => <img src={src()} alt="" class="size-5 object-contain" />}
207
- </Show>
208
- </span>
209
- </Show>
210
- );
193
+ return (
194
+ <Show when={props.icon || props.image}>
195
+ <span
196
+ data-slot="option-card-icon"
197
+ aria-hidden="true"
198
+ class="grid size-10 shrink-0 place-items-center rounded-[14px] bg-[color-mix(in_oklab,var(--surface-tone)_80%,black)] [color:oklch(from_var(--surface-tone)_calc((0.75_-_l)*100)_0_0)]"
199
+ >
200
+ <Show
201
+ when={props.image}
202
+ fallback={
203
+ <Show when={props.icon}>{(icon) => <Icon icon={icon()} width={20} height={20} />}</Show>
204
+ }
205
+ >
206
+ {(src) => <img src={src()} alt="" class="size-5 object-contain" />}
207
+ </Show>
208
+ </span>
209
+ </Show>
210
+ );
211
211
  }
212
212
 
213
213
  /**
@@ -7,47 +7,47 @@ import { ALERT_ICON_BG_CLASS, alertIconBgStyle, iconBgMaskStyle } from "../lib/a
7
7
  * well, fading in while an ancestor carries data-checked. Absolutely positioned, a sibling of the
8
8
  * card's row, so it never competes for row gap. */
9
9
  export function Ornament(props: { kind: "arrow" | "check" | "none" }) {
10
- return (
11
- <Switch>
12
- <Match when={props.kind === "arrow"}>
13
- <span
14
- data-slot="ornament-arrow"
15
- class={`${ALERT_ICON_BG_CLASS} transition-transform duration-(--duration-state) group-hover:translate-x-1`}
16
- style={alertIconBgStyle("var(--surface-tone)")}
17
- aria-hidden="true"
18
- >
19
- <svg
20
- aria-hidden="true"
21
- viewBox="0 0 24 24"
22
- fill="none"
23
- stroke="currentColor"
24
- stroke-linecap="round"
25
- stroke-linejoin="round"
26
- >
27
- <path d="M5 12h14" />
28
- <path d="m12 5 7 7-7 7" />
29
- </svg>
30
- </span>
31
- </Match>
32
- <Match when={props.kind === "check"}>
33
- <span
34
- data-slot="ornament-check"
35
- class={`${ALERT_ICON_BG_CLASS} opacity-0 transition-opacity duration-(--duration-state) [[data-checked]_&]:opacity-[0.32]`}
36
- style={iconBgMaskStyle("var(--surface-tone)")}
37
- aria-hidden="true"
38
- >
39
- <svg
40
- aria-hidden="true"
41
- viewBox="0 0 24 24"
42
- fill="none"
43
- stroke="currentColor"
44
- stroke-linecap="round"
45
- stroke-linejoin="round"
46
- >
47
- <path d="M20 6 9 17l-5-5" />
48
- </svg>
49
- </span>
50
- </Match>
51
- </Switch>
52
- );
10
+ return (
11
+ <Switch>
12
+ <Match when={props.kind === "arrow"}>
13
+ <span
14
+ data-slot="ornament-arrow"
15
+ class={`${ALERT_ICON_BG_CLASS} transition-transform duration-(--duration-state) group-hover:translate-x-1`}
16
+ style={alertIconBgStyle("var(--surface-tone)")}
17
+ aria-hidden="true"
18
+ >
19
+ <svg
20
+ aria-hidden="true"
21
+ viewBox="0 0 24 24"
22
+ fill="none"
23
+ stroke="currentColor"
24
+ stroke-linecap="round"
25
+ stroke-linejoin="round"
26
+ >
27
+ <path d="M5 12h14" />
28
+ <path d="m12 5 7 7-7 7" />
29
+ </svg>
30
+ </span>
31
+ </Match>
32
+ <Match when={props.kind === "check"}>
33
+ <span
34
+ data-slot="ornament-check"
35
+ class={`${ALERT_ICON_BG_CLASS} opacity-0 transition-opacity duration-(--duration-state) [[data-checked]_&]:opacity-[0.32]`}
36
+ style={iconBgMaskStyle("var(--surface-tone)")}
37
+ aria-hidden="true"
38
+ >
39
+ <svg
40
+ aria-hidden="true"
41
+ viewBox="0 0 24 24"
42
+ fill="none"
43
+ stroke="currentColor"
44
+ stroke-linecap="round"
45
+ stroke-linejoin="round"
46
+ >
47
+ <path d="M20 6 9 17l-5-5" />
48
+ </svg>
49
+ </span>
50
+ </Match>
51
+ </Switch>
52
+ );
53
53
  }
@@ -7,10 +7,10 @@ import { cn } from "../lib/utils.js";
7
7
  * a Popover/Menu primitive. Radius and motion come from FLOATING_PANEL/
8
8
  * OVERLAY_MOTION; caller owns padding and positioning. */
9
9
  const Overlay: Component<ComponentProps<"div">> = (props) => {
10
- const [local, others] = splitProps(props, ["class"]);
11
- return (
12
- <div data-slot="overlay" class={cn(FLOATING_PANEL, OVERLAY_MOTION, local.class)} {...others} />
13
- );
10
+ const [local, others] = splitProps(props, ["class"]);
11
+ return (
12
+ <div data-slot="overlay" class={cn(FLOATING_PANEL, OVERLAY_MOTION, local.class)} {...others} />
13
+ );
14
14
  };
15
15
 
16
16
  export { Overlay };
@@ -16,80 +16,80 @@ import { type GlassSurface, NOOP_GLASS, SectionIcon } from "./section-card.js";
16
16
  * watermark (the package ships no asset).
17
17
  */
18
18
  export function PageHeader(props: {
19
- /** Iconify icon name for the banner glyph. */
20
- icon?: string;
21
- /** Custom glyph, overrides `icon`. */
22
- iconNode?: JSX.Element;
23
- title: JSX.Element;
24
- subtitle?: JSX.Element;
25
- /** Small count pill next to the title. Rendered only when not null/undefined. */
26
- count?: number | string;
27
- /** Right-side actions. */
28
- actions?: JSX.Element;
29
- /** Watermark image src (e.g. the app logo). Omit for no watermark. */
30
- logo?: string;
31
- /** Performant-blur injection (dash). Omit for a normal frosted banner. */
32
- glass?: GlassSurface;
19
+ /** Iconify icon name for the banner glyph. */
20
+ icon?: string;
21
+ /** Custom glyph, overrides `icon`. */
22
+ iconNode?: JSX.Element;
23
+ title: JSX.Element;
24
+ subtitle?: JSX.Element;
25
+ /** Small count pill next to the title. Rendered only when not null/undefined. */
26
+ count?: number | string;
27
+ /** Right-side actions. */
28
+ actions?: JSX.Element;
29
+ /** Watermark image src (e.g. the app logo). Omit for no watermark. */
30
+ logo?: string;
31
+ /** Performant-blur injection (dash). Omit for a normal frosted banner. */
32
+ glass?: GlassSurface;
33
33
  }) {
34
- const glass = () => props.glass ?? NOOP_GLASS;
35
- return (
36
- <div
37
- data-slot="page-header"
38
- ref={glass().ref}
39
- class={cn(CARD_SURFACE_BASE, SECTION_OUTER_RADIUS, "relative overflow-hidden")}
40
- classList={{ [CARD_BLUR]: !(glass().active?.() ?? false) }}
41
- style={glass().style?.() ?? {}}
42
- >
43
- <Show when={props.logo}>
44
- {(logo) => (
45
- <img
46
- data-slot="page-header-watermark"
47
- src={logo()}
48
- alt=""
49
- class="pointer-events-none absolute -top-4 -right-8 size-48 rotate-[14deg] opacity-[0.13] [mask-image:radial-gradient(circle_at_70%_30%,black,transparent_80%)]"
50
- />
51
- )}
52
- </Show>
53
- <div data-slot="page-header-row" class="relative flex items-center gap-3 p-4 sm:gap-5 sm:p-6">
54
- <Show
55
- when={props.iconNode}
56
- fallback={
57
- <Show when={props.icon}>
58
- {(icon) => (
59
- <SectionIcon icon={icon()} size="lg" tone="var(--primary)" class="shrink-0" />
60
- )}
61
- </Show>
62
- }
63
- >
64
- {props.iconNode}
65
- </Show>
66
- <div data-slot="page-header-headings" class="flex min-w-0 flex-1 flex-col gap-1.5 sm:gap-2">
67
- <div data-slot="page-header-headline" class="flex min-w-0 items-center gap-2 sm:gap-3">
68
- <h1
69
- data-slot="page-header-title"
70
- class="min-w-0 truncate pb-0.5 font-bold text-[1.75rem] text-foreground leading-none tracking-[-0.035em] sm:text-[2.5rem]"
71
- >
72
- {props.title}
73
- </h1>
74
- <Show when={props.count != null}>
75
- <CountPill>{props.count}</CountPill>
76
- </Show>
77
- </div>
78
- <Show when={props.subtitle}>
79
- <div
80
- data-slot="page-header-subtitle"
81
- class="flex items-center gap-2 text-muted-foreground text-sm"
82
- >
83
- {props.subtitle}
84
- </div>
85
- </Show>
86
- </div>
87
- <Show when={props.actions}>
88
- <div data-slot="page-header-actions" class="flex shrink-0 items-center gap-2">
89
- {props.actions}
90
- </div>
91
- </Show>
92
- </div>
93
- </div>
94
- );
34
+ const glass = () => props.glass ?? NOOP_GLASS;
35
+ return (
36
+ <div
37
+ data-slot="page-header"
38
+ ref={glass().ref}
39
+ class={cn(CARD_SURFACE_BASE, SECTION_OUTER_RADIUS, "relative overflow-hidden")}
40
+ classList={{ [CARD_BLUR]: !(glass().active?.() ?? false) }}
41
+ style={glass().style?.() ?? {}}
42
+ >
43
+ <Show when={props.logo}>
44
+ {(logo) => (
45
+ <img
46
+ data-slot="page-header-watermark"
47
+ src={logo()}
48
+ alt=""
49
+ class="pointer-events-none absolute -top-4 -right-8 size-48 rotate-[14deg] [mask-image:radial-gradient(circle_at_70%_30%,black,transparent_80%)] opacity-[0.13]"
50
+ />
51
+ )}
52
+ </Show>
53
+ <div data-slot="page-header-row" class="relative flex items-center gap-3 p-4 sm:gap-5 sm:p-6">
54
+ <Show
55
+ when={props.iconNode}
56
+ fallback={
57
+ <Show when={props.icon}>
58
+ {(icon) => (
59
+ <SectionIcon icon={icon()} size="lg" tone="var(--primary)" class="shrink-0" />
60
+ )}
61
+ </Show>
62
+ }
63
+ >
64
+ {props.iconNode}
65
+ </Show>
66
+ <div data-slot="page-header-headings" class="flex min-w-0 flex-1 flex-col gap-1.5 sm:gap-2">
67
+ <div data-slot="page-header-headline" class="flex min-w-0 items-center gap-2 sm:gap-3">
68
+ <h1
69
+ data-slot="page-header-title"
70
+ class="text-foreground min-w-0 truncate pb-0.5 text-[1.75rem] leading-none font-bold tracking-[-0.035em] sm:text-[2.5rem]"
71
+ >
72
+ {props.title}
73
+ </h1>
74
+ <Show when={props.count != null}>
75
+ <CountPill>{props.count}</CountPill>
76
+ </Show>
77
+ </div>
78
+ <Show when={props.subtitle}>
79
+ <div
80
+ data-slot="page-header-subtitle"
81
+ class="text-muted-foreground flex items-center gap-2 text-sm"
82
+ >
83
+ {props.subtitle}
84
+ </div>
85
+ </Show>
86
+ </div>
87
+ <Show when={props.actions}>
88
+ <div data-slot="page-header-actions" class="flex shrink-0 items-center gap-2">
89
+ {props.actions}
90
+ </div>
91
+ </Show>
92
+ </div>
93
+ </div>
94
+ );
95
95
  }