@glasshome/ui 1.7.0 → 1.8.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.8.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",
@@ -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,6 +18,7 @@
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);
@@ -157,11 +158,15 @@
157
158
  }
158
159
 
159
160
  :root {
160
- --background: oklch(0.975 0.003 250);
161
+ --background: oklch(0.995 0.003 250);
161
162
  --foreground: oklch(0 0 0);
162
- --card: oklch(0.995 0.004 250);
163
+ /* Light glass scatters light away from the eye, so a pane sits BELOW its
164
+ * ground here, the opposite of dark: the page is the lightest thing on
165
+ * screen, the card steps down, the popover down again. Ratios 1.11 and 1.07,
166
+ * and --popover is the floor the semantic roles below can still sit on. */
167
+ --card: oklch(0.96 0.005 250);
163
168
  --card-foreground: oklch(0 0 0);
164
- --popover: oklch(0.995 0.003 250);
169
+ --popover: oklch(0.937 0.006 250);
165
170
  --popover-foreground: oklch(0 0 0);
166
171
  --primary: oklch(0.48 0.2 215.221);
167
172
  --primary-foreground: oklch(1 0 0);
@@ -171,31 +176,41 @@
171
176
  --muted-foreground: oklch(0.34 0 0);
172
177
  --accent: oklch(0.6 0.2 195);
173
178
  --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. */
179
+ /* Semantic roles are one value per role, used as fill AND as text, so they
180
+ * clear 4.5:1 on every ground they land on. --popover is the darkest of them
181
+ * and therefore the binding one: it is what stops the ladder above sinking
182
+ * further. Chroma comes down only as far as the sRGB gamut edge needs.
183
+ * Measured vs --background / --card / --popover / white-on-fill:
184
+ * success 5.56 / 5.01 / 4.66 / 5.63, warning 5.49 / 4.94 / 4.60 / 5.55,
185
+ * destructive 5.53 / 4.98 / 4.63 / 5.59. */
182
186
  --success: oklch(0.5 0.15 145);
183
187
  --warning: oklch(0.52 0.13 85);
184
188
  --primary-tint-foreground: oklch(0.42 0.2 215.221);
185
189
  --accent-tint-foreground: oklch(0.46 0.16 195);
186
190
  --destructive: oklch(0.54 0.19 23.0704);
187
191
  --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);
192
+ --border: oklch(0.855 0.014 250);
193
+ /* Toggle wells (FIELD_CHROME), not text fields: the whole job is to read as
194
+ * empty, and the off knob has to show against it. 2.50:1 to the off thumb,
195
+ * 1.40:1 to the card. */
196
+ --input: oklch(0.85 0.016 250);
197
+ /* The focus ring wears --primary, not --accent: the two are different hues,
198
+ * so an accent ring landed teal on blue controls. */
199
+ --ring: oklch(0.48 0.2 215.221);
200
+ /* Modal scrim: a wash darker than the page. A scrim keyed to --background is
201
+ * the page colour at alpha, which computes to no darkening at all. */
202
+ --scrim: oklch(0.2 0.012 250 / 0.45);
191
203
  /* 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. */
204
+ * darker fill: on a light ground an --input-deep fill reads as the `disabled`
205
+ * cue, so a form of light fields would read switched off. Light fields sit AT
206
+ * the card and carry a solid --border edge, 1.39:1, at 1px instead of a slab. */
197
207
  --field: var(--card);
198
208
  --field-edge: var(--border);
209
+ /* The knob says the state too: on wears --primary's hue, off stays inert
210
+ * metal in the recessed well. Light reads lit by going darker than its pale
211
+ * track, dark by going lighter; the hue is what carries across both. */
212
+ --thumb-face-on: oklch(0.55 0.16 215);
213
+ --thumb-face-off: oklch(0.62 0.015 250);
199
214
  --chart-1: oklch(0.7459 0.1483 156.4499);
200
215
  --chart-2: oklch(0.48 0.2 215.221);
201
216
  --chart-3: oklch(0.7336 0.1758 50.5517);
@@ -266,10 +281,15 @@
266
281
  * 0.01) keeps it from going flat gray. Same rail color as the slider track. */
267
282
  --input: oklch(0.19 0.01 250);
268
283
  --ring: oklch(0.6 0.2 195);
284
+ --scrim: color-mix(in oklab, var(--background) 70%, transparent);
269
285
  /* Dark fields keep the dug-out fill (it reads as depth here, not as disabled)
270
286
  * and the glass formula's own soft edge. See the light block. */
271
287
  --field: var(--input);
272
288
  --field-edge: color-mix(in srgb, var(--border) 60%, transparent);
289
+ /* Lit through hue, not brightness: a neutral knob this light read as the
290
+ * loudest pixel in the row. Carries --primary's hue, so on ties to the rim. */
291
+ --thumb-face-on: oklch(0.78 0.1 215);
292
+ --thumb-face-off: oklch(0.45 0.015 250);
273
293
  --chart-1: oklch(0.8003 0.1821 151.711);
274
294
  --chart-2: oklch(0.48 0.2 215.221);
275
295
  --chart-3: oklch(0.8077 0.1035 19.5706);