@glasshome/ui 1.24.0 → 1.25.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/SPEC.md CHANGED
@@ -66,17 +66,17 @@ tone desaturates without swinging yellow — `glassToneText()`).
66
66
 
67
67
  ### The material tier
68
68
 
69
- Five inheriting variables, the homeowner's dials, declared once in `theme.css` and
69
+ Six inheriting variables, the homeowner's dials, declared once in `theme.css` and
70
70
  multiplied into every surface's knobs by the formula. A knob is a surface's
71
71
  identity; the tier scales all of them at once, chrome and widgets alike.
72
72
 
73
- | Variable | Type | Frosted | Multiplies |
73
+ | Variable | Type | Glass | Multiplies |
74
74
  | --- | --- | --- | --- |
75
75
  | `--material-blur` | length | 24px | the backdrop radius (`--glass-blur` overrides it when set) |
76
76
  | `--material-clarity` | % | 60% | the card fill's share of `--card` (the rest is wallpaper) |
77
- | `--material-depth` | number | 1 | `--glass-light`, `--glass-shade`, `--glass-rim`, `--glass-lift` |
77
+ | `--material-depth` | number | 1 | the default for edge, sheen and shadow below; read by nothing else |
78
78
  | `--material-tint` | number | 1 | `--glass-wash`, `--glass-wash-2` |
79
- | `--material-glow` | length | 0px | an outer bloom in `--material-hue` (Neon 18px) |
79
+ | `--material-glow` | length | 0px | an outer bloom in `--material-hue` (Neon 3px) |
80
80
  | `--material-ink-level` | number | 0 | above 0, the Ink body: every surface hand-inked |
81
81
 
82
82
  Four more are preset terms, inert at their defaults and never a homeowner dial.
@@ -86,10 +86,10 @@ opaque: its tone when it has one, the accent otherwise.
86
86
 
87
87
  | Variable | Type | Default | Turns on |
88
88
  | --- | --- | --- | --- |
89
- | `--material-edge-width` | length | 1px | the edge weight (Neon 1.5px) |
89
+ | `--material-edge-width` | length | 1px | the edge weight (Neon 1px) |
90
90
  | `--material-edge-ink` | number | 0 | the edge's mix toward `--material-ink` (Paper 0.3) |
91
91
  | `--material-ink-lift` | number | 0 | the Ink line's mix toward `--foreground` (Chalk 1) |
92
- | `--material-edge-accent` | number | 0 | the edge's mix toward `--material-hue` (Neon 1) |
92
+ | `--material-edge-accent` | number | 0 | the edge's mix toward `--material-hue` (Neon 0.35) |
93
93
 
94
94
  `--material-ink` is fixed per mode in theme.css: dark ink in light mode, a mid
95
95
  grey in dark mode.
@@ -101,12 +101,40 @@ and a nudge, so it strays over and under the line, and `::after` draws the line
101
101
  (opacity = the level) with two faint offset passes. No images or masks: it
102
102
  renders the same in every browser with style queries.
103
103
 
104
- A preset is a point in that space (`tokens/material.ts`: Frosted, Paper,
105
- Neon, Chalk; `resolveMaterial` composes it with the host blur mode); a theme stores the
106
- preset and any dial it moved, never the resolved values. A look these cannot
107
- express adds another inert-by-default term here (a ui minor), then, if that is
108
- not enough, a second formula body selected by a style query on a material
109
- variable, as Ink is.
104
+ **Terms.** Beyond the dials, a material carries creator terms
105
+ (`MaterialTerms` in `tokens/material.ts`, ranges in `MATERIAL_RANGES`), each
106
+ optional, each defaulting to today's glass: vibrancy, edge, sheen, shadow,
107
+ inset, light from, rim position, dark scale, glow position, inner glow (and its
108
+ hue), grain, wash style and angle, face, relief, accent, fill. `resolveMaterial`
109
+ turns enums into numbers the formula multiplies by and applies the dark scale per
110
+ mode; light from is a rotation of today's offsets, exact at 315°.
111
+
112
+ **Raised face** is the third body, a style query on `--_material-face-raised`:
113
+ controls turn neumorphic (pressed wells, raised knobs and keys, the lit part in
114
+ the accent and glowing). A flat face keeps the calm controls: the accent on what
115
+ is on, a white knob, a neutral off knob.
116
+
117
+ **What widgets read.** `--material-*` is the material, readable: the parts
118
+ below plus `--material-blur`, `-clarity`, `-tint`, `-glow`. `--_material-*` is
119
+ how it is drawn and private (the `--_` prefix says so); `--glass-*` are knobs to
120
+ set on a `.glass` element, never to read. The pre-1.21 internal names
121
+ (`--material-depth`, `-hue`, `-reach`, `-ink*`, `-edge-*`) still work, retired
122
+ by name; widget-cli warns on those reads (`internal-material-vars`, removed in
123
+ SDK 2.0).
124
+
125
+ | Variable | What it is |
126
+ | --- | --- |
127
+ | `--material-accent` | the material's accent, the theme's `--primary` unless set |
128
+ | `--material-face` / `--material-well` | raised and pressed face backgrounds |
129
+ | `--material-raised` / `--material-pressed` | the matching shadows, scaled by relief and turned by light from |
130
+ | `--material-control-track` / `-fill` / `-knob` | the control palette for the material's face |
131
+ | `--surface-tone` / `--surface-wash` | the surface's own tone and wash, readable by children |
132
+
133
+ A preset is a point in that space (`tokens/material.ts`: Glass, Frosted, Paper,
134
+ Neon, Chalk); a theme stores the preset and any term it moved, never the
135
+ resolved values. A look these cannot express adds another inert-by-default term
136
+ here (a ui minor), then, if that is not enough, a body selected by a style query
137
+ on a material variable, as Ink and raised are.
110
138
  The class name never changes.
111
139
 
112
140
  ## Surfaces (the only sanctioned recipes)
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ export { BUTTON_DEFAULT_CLASS, BUTTON_OUTLINE_CLASS, buttonVariants, ICON_BUTTON
3
3
  export { CARD_BLUR, CARD_SURFACE, CARD_SURFACE_BASE, CARD_SURFACE_OPAQUE, SECTION_ROW_SURFACE, TRACK_SURFACE, } from "./lib/card-classes.js";
4
4
  export { CAROUSEL_DOTS, CAROUSEL_VIEWPORT, type CarouselTransition, carouselDot, carouselItem, carouselTrack, } from "./lib/carousel-classes.js";
5
5
  export { glassToneText, toneTextMix } from "./lib/glass-tone.js";
6
- export { CONTROL_H, FIELD_CHROME, FIELD_CONTROL, FIELD_TEXT, FOCUS_RING, INPUT_CLASS, INPUT_SURFACE, INVALID_RING, } from "./lib/input-classes.js";
6
+ export { CONTROL_H, CONTROL_ON, FIELD_CHROME, FIELD_CONTROL, FIELD_TEXT, FOCUS_RING, INPUT_CLASS, INPUT_SURFACE, INVALID_RING, } from "./lib/input-classes.js";
7
7
  export { Z, Z_CLASS } from "./lib/layers.js";
8
8
  export { LOGO_DEFAULT_SIZE, LOGO_DEFAULT_SRC, LOGO_DEFAULT_SUB, LOGO_MARK_CLASS, LOGO_MARK_PX, LOGO_NAME_CLASS, LOGO_ROOT_CLASS, LOGO_SIZES, LOGO_STACK_CLASS, LOGO_SUB_CLASS, type LogoSize, } from "./lib/logo-lockup.js";
9
9
  export { MENU_ITEM, MENU_ITEM_BASE, MENU_ITEM_X, MENU_LABEL, MENU_SEPARATOR, } from "./lib/menu-classes.js";
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { $ as e, $t as t, A as n, B as r, Bt as i, C as a, Ct as ee, D as te, Dt as o, Et as s, F as c, G as l, H as u, Ht as d, I as f, It as p, Jt as m, K as h, Kt as g, L as _, Lt as v, M as y, Mt as b, N as x, Nt as S, O as C, P as w, Pt as T, Q as E, R as D, Rt as O, S as k, St as A, T as j, U as M, Ut as N, V as P, Vt as F, W as I, Wt as L, Xt as R, Y as z, Yt as B, Z as V, Zt as H, _ as U, at as W, b as G, c as K, ct as q, d as J, dt as Y, en as ne, et as X, f as Z, ft as re, g as ie, h as ae, i as oe, in as se, it as ce, j as le, jt as ue, k as de, kt as fe, l as pe, lt as me, m as he, mt as ge, n as _e, nn as ve, nt as ye, ot as be, p as xe, q as Se, qt as Ce, r as we, rn as Te, rt as Ee, s as De, st as Oe, t as Q, tn as ke, tt as Ae, u as je, ut as Me, v as Ne, w as Pe, x as Fe, xt as Ie, y as Le, z as Re } from "./utils-rZf2Zpkw.js";
1
+ import { $ as e, $t as t, A as n, B as r, Bt as i, C as a, Ct as ee, D as te, Dt as o, E as s, Et as c, F as l, G as u, H as d, Ht as f, I as p, It as m, J as h, Jt as g, K as _, Kt as v, L as y, Lt as b, M as x, Mt as S, N as C, Nt as w, O as T, P as E, Pt as D, Q as O, R as k, Rt as A, S as j, St as M, U as N, Ut as P, V as F, Vt as I, W as L, Wt as R, X as z, Xt as B, Yt as V, Z as H, Zt as U, _ as W, at as G, b as K, c as q, ct as J, d as Y, dt as ne, en as X, et as Z, f as re, ft as ie, g as ae, h as oe, i as se, in as ce, it as le, j as ue, jt as de, k as fe, kt as pe, l as me, lt as he, m as ge, mt as _e, n as ve, nn as ye, nt as be, o as xe, ot as Se, p as Ce, qt as we, r as Te, rn as Ee, rt as De, s as Oe, st as Q, t as ke, tn as Ae, tt as je, u as Me, ut as Ne, v as Pe, w as Fe, x as Ie, xt as Le, y as Re, z as ze } from "./utils-Sl2ceVna.js";
2
2
  //#region src/lib/motion-window.ts
3
3
  var $ = 3e4;
4
- function ze(e = $) {
4
+ function Be(e = $) {
5
5
  let t, n = document.documentElement, r = () => {
6
6
  clearTimeout(t), t = void 0, delete n.dataset.motion;
7
7
  }, i = () => {
@@ -17,4 +17,4 @@ function ze(e = $) {
17
17
  };
18
18
  }
19
19
  //#endregion
20
- export { g as ALERT_CLASS, Ce as ALERT_CONTENT_CLASS, m as ALERT_DESCRIPTION_CLASS, B as ALERT_ICON_BG_CLASS, R as ALERT_ICON_CLASS, H as ALERT_ICON_PATHS, t as ALERT_TITLE_CLASS, ne as ALERT_TONES, i as BUTTON_DEFAULT_CLASS, F as BUTTON_OUTLINE_CLASS, ge as CARD_BLUR, Ie as CARD_SURFACE, A as CARD_SURFACE_BASE, ee as CARD_SURFACE_OPAQUE, E as CAROUSEL_DOTS, e as CAROUSEL_VIEWPORT, ae as CHIP, W as CONTROL_H, Ne as CONTROL_H_TOUCH, be as FIELD_CHROME, Oe as FIELD_CONTROL, fe as FIELD_MOTION, q as FIELD_TEXT, Fe as FLOATING_PANEL, me as FOCUS_RING, de as HOLD_GRACE_MS, n as HOLD_MS, d as ICON_BUTTON_CLASS, ie as ICON_PILL, U as ICON_PILL_TINT, Me as INPUT_CLASS, Y as INPUT_SURFACE, re as INVALID_RING, f as LOGO_DEFAULT_SIZE, _ as LOGO_DEFAULT_SRC, D as LOGO_DEFAULT_SUB, Re as LOGO_MARK_CLASS, r as LOGO_MARK_PX, P as LOGO_NAME_CLASS, u as LOGO_ROOT_CLASS, M as LOGO_SIZES, I as LOGO_STACK_CLASS, l as LOGO_SUB_CLASS, le as MENU_ITEM, y as MENU_ITEM_BASE, x as MENU_ITEM_X, w as MENU_LABEL, c as MENU_SEPARATOR, _e as MOBILE_BREAKPOINT, ue as MODAL_MOTION, b as MORPH_MOTION, $ as MOTION_WINDOW_MS, N as OUTLINE_SURFACE, k as OVERLAY_BLUR, S as OVERLAY_MOTION, a as OVERLAY_SURFACE, Pe as OVERLAY_SURFACE_BASE, j as OVERLAY_SURFACE_OPAQUE, Le as PICKER_LIST, G as PICKER_TRIGGER, Ee as POSITION_BAR, ce as POSITION_BAR_LIT, T as PRESS_DIP, te as SCRIM_CLASS, p as SCRIM_MOTION, J as SECTION_INNER_RADIUS, Z as SECTION_OUTER_RADIUS, xe as SECTION_PADDING, he as SECTION_ROW_CLASS, s as SECTION_ROW_SURFACE, je as SEGMENT_ITEM, v as SETTLE_MOTION, O as STAGGER, oe as THUMB_CLASS, De as THUMB_RAIL_BLEED, K as THUMB_RAIL_PAD, pe as THUMB_SIZE, o as TRACK_SURFACE, h as Z, Se as Z_CLASS, ke as alertBorder, ve as alertFill, Te as alertIconBgStyle, se as alertIconFill, C as anchorToTriggerTop, L as buttonVariants, X as carouselDot, Ae as carouselItem, ye as carouselTrack, Q as cn, we as createIsMobile, z as glassToneText, ze as startMotionWindow, V as toneTextMix };
20
+ export { v as ALERT_CLASS, we as ALERT_CONTENT_CLASS, g as ALERT_DESCRIPTION_CLASS, V as ALERT_ICON_BG_CLASS, B as ALERT_ICON_CLASS, U as ALERT_ICON_PATHS, t as ALERT_TITLE_CLASS, X as ALERT_TONES, i as BUTTON_DEFAULT_CLASS, I as BUTTON_OUTLINE_CLASS, _e as CARD_BLUR, Le as CARD_SURFACE, M as CARD_SURFACE_BASE, ee as CARD_SURFACE_OPAQUE, H as CAROUSEL_DOTS, O as CAROUSEL_VIEWPORT, ge as CHIP, le as CONTROL_H, W as CONTROL_H_TOUCH, G as CONTROL_ON, Se as FIELD_CHROME, Q as FIELD_CONTROL, pe as FIELD_MOTION, J as FIELD_TEXT, K as FLOATING_PANEL, he as FOCUS_RING, T as HOLD_GRACE_MS, fe as HOLD_MS, f as ICON_BUTTON_CLASS, oe as ICON_PILL, ae as ICON_PILL_TINT, Ne as INPUT_CLASS, ne as INPUT_SURFACE, ie as INVALID_RING, l as LOGO_DEFAULT_SIZE, p as LOGO_DEFAULT_SRC, y as LOGO_DEFAULT_SUB, k as LOGO_MARK_CLASS, ze as LOGO_MARK_PX, r as LOGO_NAME_CLASS, F as LOGO_ROOT_CLASS, d as LOGO_SIZES, N as LOGO_STACK_CLASS, L as LOGO_SUB_CLASS, n as MENU_ITEM, ue as MENU_ITEM_BASE, x as MENU_ITEM_X, C as MENU_LABEL, E as MENU_SEPARATOR, ve as MOBILE_BREAKPOINT, de as MODAL_MOTION, S as MORPH_MOTION, $ as MOTION_WINDOW_MS, P as OUTLINE_SURFACE, Ie as OVERLAY_BLUR, w as OVERLAY_MOTION, j as OVERLAY_SURFACE, a as OVERLAY_SURFACE_BASE, Fe as OVERLAY_SURFACE_OPAQUE, Pe as PICKER_LIST, Re as PICKER_TRIGGER, be as POSITION_BAR, De as POSITION_BAR_LIT, D as PRESS_DIP, s as SCRIM_CLASS, m as SCRIM_MOTION, Me as SECTION_INNER_RADIUS, Y as SECTION_OUTER_RADIUS, re as SECTION_PADDING, Ce as SECTION_ROW_CLASS, c as SECTION_ROW_SURFACE, me as SEGMENT_ITEM, b as SETTLE_MOTION, A as STAGGER, se as THUMB_CLASS, xe as THUMB_RAIL_BLEED, Oe as THUMB_RAIL_PAD, q as THUMB_SIZE, o as TRACK_SURFACE, u as Z, _ as Z_CLASS, Ae as alertBorder, ye as alertFill, Ee as alertIconBgStyle, ce as alertIconFill, te as anchorToTriggerTop, R as buttonVariants, e as carouselDot, Z as carouselItem, je as carouselTrack, ke as cn, Te as createIsMobile, h as glassToneText, Be as startMotionWindow, z as toneTextMix };
@@ -1,7 +1,7 @@
1
- export declare const CARD_SURFACE_BASE = "glass [--glass-wash:20%] [--glass-rim:0.3] [--glass-lift:0.45] [--glass-shade:0.05] dark:[--glass-shade:0] [--glass-base:color-mix(in_srgb,var(--card)_var(--material-clarity),transparent)]";
2
- export declare const CARD_BLUR = "backdrop-blur-[var(--glass-blur,var(--material-blur,24px))] backdrop-saturate-[1.8]";
3
- export declare const CARD_SURFACE = "glass [--glass-wash:20%] [--glass-rim:0.3] [--glass-lift:0.45] [--glass-shade:0.05] dark:[--glass-shade:0] [--glass-base:color-mix(in_srgb,var(--card)_var(--material-clarity),transparent)] backdrop-blur-[var(--glass-blur,var(--material-blur,24px))] backdrop-saturate-[1.8]";
4
- export declare const CARD_SURFACE_OPAQUE = "glass [--glass-wash:20%] [--glass-rim:0.3] [--glass-lift:0.45] [--glass-shade:0.05] dark:[--glass-shade:0]";
1
+ export declare const CARD_SURFACE_BASE = "glass [--glass-grain:var(--_material-grain)] [--glass-wash:20%] [--glass-rim:0.3] [--glass-lift:0.45] [--glass-shade:0.05] dark:[--glass-shade:0] [--glass-base:color-mix(in_srgb,var(--card)_var(--material-clarity),transparent)]";
2
+ export declare const CARD_BLUR = "backdrop-blur-[var(--glass-blur,var(--material-blur,24px))] backdrop-saturate-[calc(1.8*var(--_material-vibrancy,1))] backdrop-brightness-[calc(1+(var(--_material-vibrancy,1)-1)*0.2)]";
3
+ export declare const CARD_SURFACE = "glass [--glass-grain:var(--_material-grain)] [--glass-wash:20%] [--glass-rim:0.3] [--glass-lift:0.45] [--glass-shade:0.05] dark:[--glass-shade:0] [--glass-base:color-mix(in_srgb,var(--card)_var(--material-clarity),transparent)] backdrop-blur-[var(--glass-blur,var(--material-blur,24px))] backdrop-saturate-[calc(1.8*var(--_material-vibrancy,1))] backdrop-brightness-[calc(1+(var(--_material-vibrancy,1)-1)*0.2)]";
4
+ export declare const CARD_SURFACE_OPAQUE = "glass [--glass-grain:var(--_material-grain)] [--glass-wash:20%] [--glass-rim:0.3] [--glass-lift:0.45] [--glass-shade:0.05] dark:[--glass-shade:0]";
5
5
  export declare const SECTION_ROW_SURFACE = "glass [--glass-rim:0.3] [--glass-base:color-mix(in_srgb,var(--card)_var(--material-clarity),transparent)]";
6
6
  export declare const TRACK_SURFACE = "border border-border/50 bg-card/40 backdrop-blur-sm";
7
7
  export declare const CARD_PADDING: {
@@ -1,5 +1,6 @@
1
1
  export declare const INPUT_SURFACE = "glass glass-sink [--glass-base:var(--field)] [--glass-edge:var(--field-edge)] [--glass-light:0.04]";
2
2
  export declare const FIELD_CHROME = "glass glass-sink [--glass-base:var(--input)] [--glass-light:0.04]";
3
+ export declare const CONTROL_ON = "glass glass-tint [--glass-tone:var(--material-accent)] [--glass-wash:100%] [--glass-text:0%]";
3
4
  export declare const FOCUS_RING = "outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:[--glass-edge:var(--ring)]";
4
5
  export declare const INVALID_RING = "aria-invalid:[--glass-edge:var(--destructive)] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40";
5
6
  export declare const CONTROL_H: {
@@ -1,6 +1,6 @@
1
- export declare const OVERLAY_BLUR = "backdrop-blur-[var(--glass-blur,var(--material-blur,24px))] backdrop-saturate-[1.2]";
1
+ export declare const OVERLAY_BLUR = "backdrop-blur-[var(--glass-blur,var(--material-blur,24px))] backdrop-saturate-[calc(1.2*var(--_material-vibrancy,1))] backdrop-brightness-[calc(1+(var(--_material-vibrancy,1)-1)*0.2)]";
2
2
  export declare const OVERLAY_SURFACE_BASE = "glass glass-frost [--glass-rim:0.5] [--glass-lift:0.6] [--glass-light:0] [--glass-edge:color-mix(in_srgb,var(--border)_90%,transparent)] [--glass-base:color-mix(in_srgb,var(--popover)_92%,transparent)]";
3
- export declare const OVERLAY_SURFACE = "glass glass-frost [--glass-rim:0.5] [--glass-lift:0.6] [--glass-light:0] [--glass-edge:color-mix(in_srgb,var(--border)_90%,transparent)] [--glass-base:color-mix(in_srgb,var(--popover)_92%,transparent)] backdrop-blur-[var(--glass-blur,var(--material-blur,24px))] backdrop-saturate-[1.2]";
3
+ export declare const OVERLAY_SURFACE = "glass glass-frost [--glass-rim:0.5] [--glass-lift:0.6] [--glass-light:0] [--glass-edge:color-mix(in_srgb,var(--border)_90%,transparent)] [--glass-base:color-mix(in_srgb,var(--popover)_92%,transparent)] backdrop-blur-[var(--glass-blur,var(--material-blur,24px))] backdrop-saturate-[calc(1.2*var(--_material-vibrancy,1))] backdrop-brightness-[calc(1+(var(--_material-vibrancy,1)-1)*0.2)]";
4
4
  export declare const OVERLAY_SURFACE_OPAQUE = "glass glass-frost [--glass-rim:0.5] [--glass-lift:0.6] [--glass-light:0] [--glass-edge:color-mix(in_srgb,var(--border)_90%,transparent)] [--glass-base:var(--popover)]";
5
5
  export declare const SCRIM_CLASS = "bg-scrim backdrop-blur-md";
6
6
  export declare const PANEL_TAIL: string;
@@ -1,2 +1,2 @@
1
1
  export declare const POSITION_BAR = "glass glass-sink [--glass-base:var(--input)] [--glass-light:0.04] h-1.5 rounded-full transition-glass duration-(--duration-morph) ease-(--ease-morph)";
2
- export declare const POSITION_BAR_LIT = "glass glass-tint [--glass-tone:var(--primary)] [--glass-wash:70%] [--glass-drop:0%]";
2
+ export declare const POSITION_BAR_LIT = "glass glass-tint [--glass-tone:var(--material-accent)] [--glass-wash:70%] [--glass-drop:0%]";
@@ -1,6 +1,5 @@
1
1
  export declare const THUMB_SIZE = 31;
2
2
  export declare const THUMB_CLASS = "block size-7 shrink-0 rounded-xl shadow-[0_2px_5px_oklch(0_0_0/0.35),inset_0_1px_0_oklch(1_0_0/0.35),inset_0_-2px_3px_oklch(0_0_0/0.2)]";
3
- export declare const THUMB_FACE_ON = "oklch(from var(--primary) var(--thumb-on-l) min(c, var(--thumb-on-c)) h)";
4
3
  export declare const THUMB_COLOR_RING = "border-2 border-white/90";
5
4
  export declare const THUMB_RAIL_PAD = "px-3.5";
6
5
  export declare const THUMB_RAIL_BLEED = "-mx-3.5";