@glasshome/ui 1.7.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glasshome/ui",
3
- "version": "1.7.0",
3
+ "version": "1.9.0",
4
4
  "description": "SolidJS component library for GlassHome, built on Kobalte",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/glasshome/ui#readme",
@@ -38,6 +38,11 @@ const RULES = [
38
38
  /border-input\s[^"'`]*bg-(?:background|transparent)\b/,
39
39
  "use INPUT_CLASS / INPUT_SURFACE / FIELD_CHROME from @glasshome/ui",
40
40
  ],
41
+ [
42
+ "hand-rolled group header",
43
+ /<SectionSubtitle\b/,
44
+ "a labelled group inside a card is <SectionGroup icon label count action>; an empty state is <Empty> + parts; a list row is <ListRow>",
45
+ ],
41
46
  [
42
47
  "solid badge",
43
48
  /border-transparent\s+bg-primary\s+text-primary-foreground/,
@@ -1,3 +1,5 @@
1
+ import { PRESS_DIP } from "./motion-classes.js";
2
+
1
3
  const CARD_KNOBS =
2
4
  "glass [--glass-wash:20%] [--glass-rim:0.3] [--glass-lift:0.45] [--glass-shade:0.05] dark:[--glass-shade:0]";
3
5
 
@@ -33,6 +35,10 @@ export type CardPadding = keyof typeof CARD_PADDING;
33
35
  export const CARD_INTERACTIVE =
34
36
  "cursor-pointer transition-glass hover:[--glass-light:0.09] focus-within:[--glass-edge:var(--border)]";
35
37
 
38
+ /* A row that activates as a whole. Two focus selectors, one look: the row may
39
+ * be focusable itself, or hold an absolutely-positioned overlay button. */
40
+ export const SECTION_ROW_INTERACTIVE = `${CARD_INTERACTIVE} ${PRESS_DIP} outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 has-[:focus-visible]:ring-[3px] has-[:focus-visible]:ring-ring/50`;
41
+
36
42
  export const CARD_HEADER_CLASS =
37
43
  "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 has-data-[slot=card-action]:grid-cols-[1fr_auto]";
38
44
  export const CARD_TITLE_CLASS = "font-semibold leading-none";
@@ -21,9 +21,10 @@ export const OVERLAY_SURFACE = `${OVERLAY_SURFACE_BASE} ${OVERLAY_BLUR}`;
21
21
  * behind it would just be see-through. */
22
22
  export const OVERLAY_SURFACE_OPAQUE = `${OVERLAY_KNOBS} [--glass-base:var(--popover)]`;
23
23
 
24
- /* Modal scrim behind dialogs/sheets. BottomSheet keeps its own unblurred scrim
25
- * (backdrop-blur is too slow on mobile). */
26
- export const SCRIM_CLASS = "bg-background/70 backdrop-blur-md";
24
+ /* Modal scrim behind dialogs/sheets, from the theme's own --scrim so light can
25
+ * darken while dark keeps its background wash. BottomSheet keeps its own
26
+ * unblurred scrim (backdrop-blur is too slow on mobile). */
27
+ export const SCRIM_CLASS = "bg-scrim backdrop-blur-md";
27
28
 
28
29
  /* The floating panel every anchored surface wears. Padding is the caller's:
29
30
  * menus add p-1, popovers p-4, pickers none. */
@@ -18,10 +18,13 @@
18
18
  --color-border: var(--border);
19
19
  --color-input: var(--input);
20
20
  --color-ring: var(--ring);
21
+ --color-scrim: var(--scrim);
21
22
  --color-success: var(--success);
22
23
  --color-warning: var(--warning);
23
24
  --color-primary-tint-foreground: var(--primary-tint-foreground);
24
25
  --color-accent-tint-foreground: var(--accent-tint-foreground);
26
+ --color-warning-tint-foreground: var(--warning-tint-foreground);
27
+ --color-love: var(--love);
25
28
  --color-chart-1: var(--chart-1);
26
29
  --color-chart-2: var(--chart-2);
27
30
  --color-chart-3: var(--chart-3);
@@ -30,6 +33,8 @@
30
33
  --font-sans: var(--font-sans);
31
34
  --font-mono: var(--font-mono);
32
35
  --font-serif: var(--font-serif);
36
+ --font-caveat: var(--font-caveat);
37
+ --font-bebas: var(--font-bebas);
33
38
 
34
39
  /* Below --radius-sm: a box small enough that the theme's smallest token would
35
40
  round it into a circle (checkbox, OTP slot). Clamped, so a tiny --radius
@@ -157,11 +162,15 @@
157
162
  }
158
163
 
159
164
  :root {
160
- --background: oklch(0.975 0.003 250);
165
+ --background: oklch(0.995 0.003 250);
161
166
  --foreground: oklch(0 0 0);
162
- --card: oklch(0.995 0.004 250);
167
+ /* Light glass scatters light away from the eye, so a pane sits BELOW its
168
+ * ground here, the opposite of dark: the page is the lightest thing on
169
+ * screen, the card steps down, the popover down again. Ratios 1.11 and 1.07,
170
+ * and --popover is the floor the semantic roles below can still sit on. */
171
+ --card: oklch(0.96 0.005 250);
163
172
  --card-foreground: oklch(0 0 0);
164
- --popover: oklch(0.995 0.003 250);
173
+ --popover: oklch(0.937 0.006 250);
165
174
  --popover-foreground: oklch(0 0 0);
166
175
  --primary: oklch(0.48 0.2 215.221);
167
176
  --primary-foreground: oklch(1 0 0);
@@ -171,31 +180,43 @@
171
180
  --muted-foreground: oklch(0.34 0 0);
172
181
  --accent: oklch(0.6 0.2 195);
173
182
  --accent-foreground: oklch(1 0 0);
174
- /* Semantic roles are one value per role, used as fill AND as text, so on this
175
- * L=0.975 ground they have to clear 4.5:1 (3:1 for --ring, a focus indicator)
176
- * against --background and --card. The dark theme's high-lightness versions
177
- * measure 2.1-3.6:1 here, so the light theme drops lightness and holds hue;
178
- * chroma comes down only as far as staying near the sRGB gamut edge needs.
179
- * Measured vs --background / --card / white-on-fill:
180
- * success 5.24 / 5.56 / 5.63, warning 5.17 / 5.49 / 5.55,
181
- * destructive 5.21 / 5.53 / 5.59, ring 4.68 / 4.97 / 5.03. */
183
+ /* Semantic roles are one value per role, used as fill AND as text, so they
184
+ * clear 4.5:1 on every ground they land on. --popover is the darkest of them
185
+ * and therefore the binding one: it is what stops the ladder above sinking
186
+ * further. Chroma comes down only as far as the sRGB gamut edge needs.
187
+ * Measured vs --background / --card / --popover / white-on-fill:
188
+ * success 5.56 / 5.01 / 4.66 / 5.63, warning 5.49 / 4.94 / 4.60 / 5.55,
189
+ * destructive 5.53 / 4.98 / 4.63 / 5.59. */
182
190
  --success: oklch(0.5 0.15 145);
183
191
  --warning: oklch(0.52 0.13 85);
184
192
  --primary-tint-foreground: oklch(0.42 0.2 215.221);
185
193
  --accent-tint-foreground: oklch(0.46 0.16 195);
194
+ --warning-tint-foreground: oklch(0.52 0.11 70);
195
+ --love: oklch(0.66 0.22 16);
186
196
  --destructive: oklch(0.54 0.19 23.0704);
187
197
  --destructive-foreground: oklch(1 0 0);
188
- --border: oklch(0.9 0.01 250);
189
- --input: oklch(0.9 0.012 250);
190
- --ring: oklch(0.53 0.18 195);
198
+ --border: oklch(0.855 0.014 250);
199
+ /* Toggle wells (FIELD_CHROME), not text fields: the whole job is to read as
200
+ * empty, and the off knob has to show against it. 2.50:1 to the off thumb,
201
+ * 1.40:1 to the card. */
202
+ --input: oklch(0.85 0.016 250);
203
+ /* The focus ring wears --primary, not --accent: the two are different hues,
204
+ * so an accent ring landed teal on blue controls. */
205
+ --ring: oklch(0.48 0.2 215.221);
206
+ /* Modal scrim: a wash darker than the page. A scrim keyed to --background is
207
+ * the page colour at alpha, which computes to no darkening at all. */
208
+ --scrim: oklch(0.2 0.012 250 / 0.45);
191
209
  /* Field material (INPUT_SURFACE). The recess is the .glass-sink rim, not a
192
- * darker fill: on a card of L=0.995 an --input fill of L=0.9 is a nine-point
193
- * drop, the same cue this library spends on `disabled`, so a form of light
194
- * fields reads switched off. Light fields sit AT the card and get a solid
195
- * --border edge instead — the boundary still measures 1.33:1 against the
196
- * card, exactly what the fill drop used to carry, at 1px instead of a slab. */
210
+ * darker fill: on a light ground an --input-deep fill reads as the `disabled`
211
+ * cue, so a form of light fields would read switched off. Light fields sit AT
212
+ * the card and carry a solid --border edge, 1.39:1, at 1px instead of a slab. */
197
213
  --field: var(--card);
198
214
  --field-edge: var(--border);
215
+ /* The knob says the state too: on wears --primary's hue, off stays inert
216
+ * metal in the recessed well. Light reads lit by going darker than its pale
217
+ * track, dark by going lighter; the hue is what carries across both. */
218
+ --thumb-face-on: oklch(0.55 0.16 215);
219
+ --thumb-face-off: oklch(0.62 0.015 250);
199
220
  --chart-1: oklch(0.7459 0.1483 156.4499);
200
221
  --chart-2: oklch(0.48 0.2 215.221);
201
222
  --chart-3: oklch(0.7336 0.1758 50.5517);
@@ -204,6 +225,8 @@
204
225
  --font-sans: "Geist Variable", ui-sans-serif, system-ui, sans-serif;
205
226
  --font-serif: "Geist Variable", ui-sans-serif, system-ui, sans-serif;
206
227
  --font-mono: "GeistMono Variable", "JetBrains Mono", "Fira Code", Consolas, monospace;
228
+ --font-caveat: "Caveat Variable", cursive;
229
+ --font-bebas: "Bebas Neue", ui-sans-serif, system-ui, sans-serif;
207
230
  --radius: 1.4rem;
208
231
  --shadow-x: 0px;
209
232
  --shadow-y: 2px;
@@ -257,6 +280,8 @@
257
280
  --warning: oklch(0.78 0.14 85);
258
281
  --primary-tint-foreground: oklch(0.78 0.16 215.221);
259
282
  --accent-tint-foreground: oklch(0.8 0.14 195);
283
+ --warning-tint-foreground: oklch(0.82 0.13 85);
284
+ --love: oklch(0.72 0.19 14);
260
285
  --destructive: oklch(0.7106 0.1661 22.2162);
261
286
  --destructive-foreground: oklch(1 0 0);
262
287
  --border: oklch(0.26 0.012 250);
@@ -266,10 +291,15 @@
266
291
  * 0.01) keeps it from going flat gray. Same rail color as the slider track. */
267
292
  --input: oklch(0.19 0.01 250);
268
293
  --ring: oklch(0.6 0.2 195);
294
+ --scrim: color-mix(in oklab, var(--background) 70%, transparent);
269
295
  /* Dark fields keep the dug-out fill (it reads as depth here, not as disabled)
270
296
  * and the glass formula's own soft edge. See the light block. */
271
297
  --field: var(--input);
272
298
  --field-edge: color-mix(in srgb, var(--border) 60%, transparent);
299
+ /* Lit through hue, not brightness: a neutral knob this light read as the
300
+ * loudest pixel in the row. Carries --primary's hue, so on ties to the rim. */
301
+ --thumb-face-on: oklch(0.78 0.1 215);
302
+ --thumb-face-off: oklch(0.45 0.015 250);
273
303
  --chart-1: oklch(0.8003 0.1821 151.711);
274
304
  --chart-2: oklch(0.48 0.2 215.221);
275
305
  --chart-3: oklch(0.8077 0.1035 19.5706);
@@ -278,6 +308,8 @@
278
308
  --font-sans: "Geist Variable", ui-sans-serif, system-ui, sans-serif;
279
309
  --font-serif: "Geist Variable", ui-sans-serif, system-ui, sans-serif;
280
310
  --font-mono: "GeistMono Variable", "JetBrains Mono", "Fira Code", Consolas, monospace;
311
+ --font-caveat: "Caveat Variable", cursive;
312
+ --font-bebas: "Bebas Neue", ui-sans-serif, system-ui, sans-serif;
281
313
  --radius: 1.4rem;
282
314
  --shadow-x: 0px;
283
315
  --shadow-y: 2px;