@glasshome/ui 1.18.0 → 1.19.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.
Files changed (53) hide show
  1. package/SPEC.md +82 -1
  2. package/dist/index.js +2 -2
  3. package/dist/lib/button-variants.d.ts +3 -0
  4. package/dist/lib/card-classes.d.ts +4 -4
  5. package/dist/lib/motion-classes.d.ts +1 -0
  6. package/dist/lib/overlay-classes.d.ts +4 -2
  7. package/dist/lib/spotlight-geometry.d.ts +22 -0
  8. package/dist/solid/button.d.ts +8 -3
  9. package/dist/solid/dock.d.ts +9 -0
  10. package/dist/solid/docked-panel.d.ts +11 -0
  11. package/dist/solid/index.d.ts +6 -2
  12. package/dist/solid/index.js +4387 -4022
  13. package/dist/solid/option-card.d.ts +1 -1
  14. package/dist/solid/preview-tile.d.ts +33 -0
  15. package/dist/solid/spotlight.d.ts +14 -0
  16. package/dist/solid/swatch-picker.d.ts +12 -0
  17. package/dist/solid/tabs.d.ts +4 -1
  18. package/dist/solid/widget-identity.d.ts +2 -0
  19. package/dist/tokens/index.d.ts +1 -0
  20. package/dist/tokens/index.js +336 -118
  21. package/dist/tokens/material.d.ts +40 -0
  22. package/dist/tokens/presets.d.ts +3 -0
  23. package/dist/tokens/theme-colors.d.ts +13 -3
  24. package/dist/tokens/theme-recipe.d.ts +8 -0
  25. package/dist/{utils-COITV1s9.js → utils-CV6G6fr8.js} +618 -615
  26. package/package.json +2 -2
  27. package/src/lib/button-variants.ts +4 -3
  28. package/src/lib/card-classes.ts +4 -3
  29. package/src/lib/motion-classes.ts +5 -0
  30. package/src/lib/overlay-classes.ts +10 -2
  31. package/src/lib/spotlight-geometry.ts +90 -0
  32. package/src/solid/button.tsx +17 -2
  33. package/src/solid/dock.tsx +67 -9
  34. package/src/solid/docked-panel.tsx +56 -0
  35. package/src/solid/hero-action.tsx +2 -2
  36. package/src/solid/index.ts +11 -2
  37. package/src/solid/option-card.tsx +25 -31
  38. package/src/solid/preview-tile.tsx +79 -0
  39. package/src/solid/radio-group.tsx +7 -2
  40. package/src/solid/section-card.tsx +4 -2
  41. package/src/solid/sliding-indicator.tsx +13 -12
  42. package/src/solid/spotlight.tsx +179 -0
  43. package/src/solid/swatch-picker.tsx +47 -0
  44. package/src/solid/tabs.tsx +20 -4
  45. package/src/solid/toggle-group.tsx +1 -4
  46. package/src/solid/widget-identity.tsx +3 -1
  47. package/src/styles/globals.css +166 -14
  48. package/src/styles/theme.css +13 -0
  49. package/src/tokens/index.ts +1 -0
  50. package/src/tokens/material.ts +116 -0
  51. package/src/tokens/presets.ts +195 -56
  52. package/src/tokens/theme-colors.ts +15 -3
  53. package/src/tokens/theme-recipe.ts +18 -4
@@ -100,22 +100,120 @@ function h(e) {
100
100
  return e.toString(16).padStart(2, "0");
101
101
  }
102
102
  //#endregion
103
+ //#region src/tokens/material.ts
104
+ var g = 1, _ = {
105
+ edgeWidth: 1,
106
+ edgeInk: 0,
107
+ edgeAccent: 0,
108
+ inkLift: 0
109
+ }, v = {
110
+ frosted: {
111
+ blur: 24,
112
+ clarity: 60,
113
+ depth: 1,
114
+ tint: 1,
115
+ glow: 0,
116
+ ink: 0,
117
+ ..._
118
+ },
119
+ paper: {
120
+ blur: 0,
121
+ clarity: 100,
122
+ depth: .5,
123
+ tint: .85,
124
+ glow: 0,
125
+ ink: 0,
126
+ ..._,
127
+ edgeInk: .3
128
+ },
129
+ neon: {
130
+ blur: 8,
131
+ clarity: 92,
132
+ depth: .4,
133
+ tint: .9,
134
+ edgeWidth: 1.5,
135
+ edgeInk: 0,
136
+ edgeAccent: 1,
137
+ inkLift: 0,
138
+ glow: 18,
139
+ ink: 0
140
+ },
141
+ chalk: {
142
+ blur: 0,
143
+ clarity: 100,
144
+ depth: .3,
145
+ tint: .7,
146
+ glow: 0,
147
+ ink: 1,
148
+ ..._,
149
+ inkLift: 1
150
+ }
151
+ }, y = {
152
+ v: 1,
153
+ preset: "frosted"
154
+ }, b = {
155
+ blur: [0, 48],
156
+ clarity: [0, 100],
157
+ depth: [0, 2],
158
+ tint: [0, 2],
159
+ glow: [0, 40],
160
+ ink: [0, 1]
161
+ }, x = 85;
162
+ function S(e) {
163
+ let n = {
164
+ ...v[e.preset],
165
+ ...e.dials
166
+ };
167
+ return {
168
+ blur: t(n.blur, ...b.blur),
169
+ clarity: t(n.clarity, ...b.clarity),
170
+ depth: t(n.depth, ...b.depth),
171
+ tint: t(n.tint, ...b.tint),
172
+ glow: t(n.glow, ...b.glow),
173
+ ink: t(n.ink, ...b.ink)
174
+ };
175
+ }
176
+ function C(e, t) {
177
+ let n = S(e), r = v[e.preset], i = t === "none" ? 0 : n.blur, a = t === "none" ? Math.max(n.clarity, x) : n.clarity;
178
+ return {
179
+ "--material-blur": `${i}px`,
180
+ "--material-clarity": `${a}%`,
181
+ "--material-depth": `${n.depth}`,
182
+ "--material-tint": `${n.tint}`,
183
+ "--material-edge-width": `${r.edgeWidth}px`,
184
+ "--material-edge-ink": `${r.edgeInk}`,
185
+ "--material-edge-accent": `${r.edgeAccent}`,
186
+ "--material-glow": `${n.glow}px`,
187
+ "--material-ink-level": `${n.ink}`,
188
+ "--material-ink-lift": `${r.inkLift}`
189
+ };
190
+ }
191
+ //#endregion
103
192
  //#region src/tokens/presets.ts
104
- var g = "midnight-glass", _ = "\"Geist Variable\", ui-sans-serif, system-ui, sans-serif", v = "\"GeistMono Variable\", \"JetBrains Mono\", \"Fira Code\", Consolas, monospace";
105
- function y(e, t) {
193
+ var w = "midnight-glass", T = "\"Geist Variable\", ui-sans-serif, system-ui, sans-serif", E = "\"GeistMono Variable\", \"JetBrains Mono\", \"Fira Code\", Consolas, monospace";
194
+ function D(e, t) {
195
+ let n = e === "default" ? "solid" : "static", r = t?.night ? {
196
+ type: "static",
197
+ id: t.night
198
+ } : void 0, { url: i, overlay: a, blur: o, vignette: s } = t ?? {};
106
199
  return {
107
- type: e === "default" ? "solid" : "static",
200
+ type: n,
108
201
  id: e,
109
202
  themed: t?.themed ?? !0,
110
- url: t?.url
203
+ url: i,
204
+ dark: r,
205
+ overlay: a,
206
+ blur: o,
207
+ vignette: s
111
208
  };
112
209
  }
113
- function b(e, t, n, r, i, a, o) {
210
+ function O(e, t, n, r, i, a, o, l) {
114
211
  return {
115
212
  id: e,
116
213
  name: t,
117
214
  radius: n,
118
215
  swatch: r,
216
+ material: l,
119
217
  colors: {
120
218
  light: s(i, "light"),
121
219
  dark: o ? s(o, "dark") : c(i)
@@ -123,7 +221,7 @@ function b(e, t, n, r, i, a, o) {
123
221
  background: a
124
222
  };
125
223
  }
126
- var x = [
224
+ var k = [
127
225
  {
128
226
  id: "midnight-glass",
129
227
  name: "Midnight Glass",
@@ -159,69 +257,185 @@ var x = [
159
257
  destructive: "oklch(0.7106 0.1661 22.2162)"
160
258
  }
161
259
  },
162
- background: y("geometric-houses", { url: "/backgrounds/geometric-houses.svg" })
260
+ background: D("glass-house", {
261
+ url: "/backgrounds/glass-house.webp",
262
+ themed: !1,
263
+ night: "glass-house-night",
264
+ vignette: .65
265
+ })
163
266
  },
164
- b("sunrise-studio", "Sunrise Studio", 1.1, ["#e8590c", "#fab005"], {
165
- primary: "oklch(0.68 0.16 50)",
166
- accent: "oklch(0.74 0.14 28)",
167
- secondary: "oklch(0.92 0.04 82)",
168
- border: "oklch(0.84 0.03 78)",
169
- card: "oklch(0.96 0.02 85)",
170
- background: "oklch(0.985 0.01 90)"
171
- }, y("diagonal-stripes")),
172
- b("forest-zen", "Forest Zen", 1.6, ["#2f9e44", "#12b886"], {
173
- primary: "oklch(0.58 0.13 145)",
174
- accent: "oklch(0.66 0.1 165)",
175
- secondary: "oklch(0.9 0.03 150)",
176
- border: "oklch(0.82 0.02 155)",
177
- card: "oklch(0.95 0.01 150)",
178
- background: "oklch(0.98 0.01 160)"
179
- }, y("trees")),
180
- b("lavender-dreams", "Lavender Dreams", 1.8, ["#9c36b5", "#e64980"], {
181
- primary: "oklch(0.62 0.14 300)",
182
- accent: "oklch(0.7 0.12 320)",
183
- secondary: "oklch(0.93 0.03 290)",
184
- border: "oklch(0.85 0.03 295)",
185
- card: "oklch(0.97 0.02 300)",
186
- background: "oklch(0.99 0.01 305)"
187
- }, y("streets", { url: "/backgrounds/streets.svg" })),
188
- b("coral-reef", "Coral Reef", 1.25, ["#e03131", "#fd7e14"], {
189
- primary: "oklch(0.66 0.19 20)",
190
- accent: "oklch(0.7 0.16 45)",
191
- secondary: "oklch(0.91 0.04 35)",
192
- border: "oklch(0.83 0.03 28)",
193
- card: "oklch(0.96 0.02 25)",
194
- background: "oklch(0.985 0.01 30)"
195
- }, y("beauty-over-cliff", {
196
- url: "/backgrounds/beauty-over-cliff.jpg",
197
- themed: !1
198
- })),
199
- b("monochrome-pro", "Monochrome Pro", 0, ["#868e96", "#495057"], {
200
- primary: "oklch(0.4 0.01 260)",
201
- accent: "oklch(0.55 0.01 260)",
202
- secondary: "oklch(0.94 0.005 260)",
203
- border: "oklch(0.86 0.005 260)",
204
- card: "oklch(0.98 0.003 260)",
205
- background: "oklch(0.995 0.002 260)"
206
- }, y("grid")),
207
- b("ocean-breeze", "Ocean Breeze", 1.5, ["#1098ad", "#3b5bdb"], {
208
- primary: "oklch(0.6 0.16 235)",
209
- accent: "oklch(0.68 0.11 205)",
210
- secondary: "oklch(0.92 0.03 225)",
211
- border: "oklch(0.84 0.02 230)",
212
- card: "oklch(0.97 0.01 230)",
213
- background: "oklch(0.99 0.01 235)"
214
- }, y("abstract-pattern", { url: "/backgrounds/ride-the-wave.svg" }))
267
+ O("sunrise-studio", "Sunrise Studio", 1.1, ["#e8590c", "#f7e3c6"], {
268
+ primary: "oklch(0.56 0.13 48)",
269
+ accent: "oklch(0.54 0.11 35)",
270
+ secondary: "oklch(0.93 0.02 70)",
271
+ border: "oklch(0.84 0.025 65)",
272
+ card: "oklch(0.99 0.008 75)",
273
+ background: "oklch(0.945 0.02 72)"
274
+ }, D("studio-geometric", {
275
+ url: "/backgrounds/studio-geometric.svg",
276
+ night: "studio-night"
277
+ }), {
278
+ primary: "oklch(0.78 0.11 62)",
279
+ accent: "oklch(0.72 0.1 42)",
280
+ secondary: "oklch(0.3 0.025 55)",
281
+ border: "oklch(0.4 0.03 55)",
282
+ card: "oklch(0.27 0.025 55)",
283
+ background: "oklch(0.17 0.022 55)"
284
+ }, {
285
+ v: 1,
286
+ preset: "paper"
287
+ }),
288
+ O("forest-zen", "Forest Zen", 1.6, ["#2b8a3e", "#a9c7b0"], {
289
+ primary: "oklch(0.5 0.12 150)",
290
+ accent: "oklch(0.5 0.09 170)",
291
+ secondary: "oklch(0.92 0.025 150)",
292
+ border: "oklch(0.83 0.02 155)",
293
+ card: "oklch(0.99 0.008 150)",
294
+ background: "oklch(0.945 0.015 160)"
295
+ }, D("forest-mist", {
296
+ url: "/backgrounds/forest-mist.webp",
297
+ themed: !1,
298
+ night: "forest-mist-night",
299
+ vignette: .65
300
+ }), {
301
+ primary: "oklch(0.74 0.12 150)",
302
+ accent: "oklch(0.72 0.08 175)",
303
+ secondary: "oklch(0.24 0.025 160)",
304
+ border: "oklch(0.33 0.025 160)",
305
+ card: "oklch(0.25 0.02 160)",
306
+ background: "oklch(0.15 0.02 165)"
307
+ }, {
308
+ v: 1,
309
+ preset: "frosted",
310
+ dials: { clarity: 82 }
311
+ }),
312
+ O("lavender-dreams", "Lavender Dreams", 1.8, ["#845ef7", "#fff4e6"], {
313
+ primary: "oklch(0.5 0.14 305)",
314
+ accent: "oklch(0.52 0.12 325)",
315
+ secondary: "oklch(0.93 0.025 300)",
316
+ border: "oklch(0.85 0.025 300)",
317
+ card: "oklch(0.975 0.012 90)",
318
+ background: "oklch(0.97 0.015 85)"
319
+ }, D("lavender-ink"), {
320
+ primary: "oklch(0.76 0.12 305)",
321
+ accent: "oklch(0.76 0.1 325)",
322
+ secondary: "oklch(0.26 0.04 310)",
323
+ border: "oklch(0.36 0.045 310)",
324
+ card: "oklch(0.23 0.045 312)",
325
+ background: "oklch(0.18 0.045 315)"
326
+ }, {
327
+ v: 1,
328
+ preset: "paper",
329
+ dials: { ink: 1 }
330
+ }),
331
+ O("coral-reef", "Liquid Glass", .9, ["#0e1426", "#5fd4e8"], {
332
+ primary: "oklch(0.5 0.11 225)",
333
+ accent: "oklch(0.52 0.16 345)",
334
+ secondary: "oklch(0.93 0.008 260)",
335
+ border: "oklch(0.85 0.012 260)",
336
+ card: "oklch(0.99 0.004 260)",
337
+ background: "oklch(0.94 0.008 260)"
338
+ }, D("liquid-glass-day", {
339
+ url: "/backgrounds/liquid-glass-day.webp",
340
+ themed: !1,
341
+ night: "liquid-glass"
342
+ }), {
343
+ primary: "oklch(0.78 0.11 210)",
344
+ accent: "oklch(0.72 0.16 340)",
345
+ secondary: "oklch(0.25 0.03 265)",
346
+ border: "oklch(0.36 0.035 265)",
347
+ card: "oklch(0.24 0.03 265)",
348
+ background: "oklch(0.13 0.03 268)"
349
+ }, {
350
+ v: 1,
351
+ preset: "frosted"
352
+ }),
353
+ O("monochrome-pro", "Monochrome Pro", 0, ["#e9ecef", "#343a40"], {
354
+ primary: "oklch(0.32 0.01 260)",
355
+ accent: "oklch(0.4 0.01 260)",
356
+ secondary: "oklch(0.93 0.004 260)",
357
+ border: "oklch(0.8 0.004 260)",
358
+ card: "oklch(0.99 0.002 260)",
359
+ background: "oklch(0.955 0.003 260)"
360
+ }, D("monochrome-blocks", {
361
+ url: "/backgrounds/monochrome-blocks.svg",
362
+ night: "monochrome-night"
363
+ }), {
364
+ primary: "oklch(0.9 0.005 260)",
365
+ accent: "oklch(0.82 0.005 260)",
366
+ secondary: "oklch(0.24 0.004 260)",
367
+ border: "oklch(0.36 0.004 260)",
368
+ card: "oklch(0.2 0.003 260)",
369
+ background: "oklch(0.14 0.003 260)"
370
+ }, {
371
+ v: 1,
372
+ preset: "paper"
373
+ }),
374
+ O("ocean-breeze", "Tide", 1.5, ["#2b4a8b", "#efe6d2"], {
375
+ primary: "oklch(0.42 0.12 262)",
376
+ accent: "oklch(0.48 0.09 225)",
377
+ secondary: "oklch(0.93 0.015 85)",
378
+ border: "oklch(0.84 0.02 80)",
379
+ card: "oklch(0.975 0.012 85)",
380
+ background: "oklch(0.955 0.018 85)"
381
+ }, D("tide-waves"), {
382
+ primary: "oklch(0.78 0.09 235)",
383
+ accent: "oklch(0.76 0.08 205)",
384
+ secondary: "oklch(0.26 0.04 262)",
385
+ border: "oklch(0.36 0.045 262)",
386
+ card: "oklch(0.23 0.045 262)",
387
+ background: "oklch(0.18 0.05 262)"
388
+ }, {
389
+ v: 1,
390
+ preset: "paper"
391
+ }),
392
+ O("chalkboard", "Chalkboard", 1.2, ["#2f4a40", "#f2e6a0"], {
393
+ primary: "oklch(0.48 0.13 255)",
394
+ accent: "oklch(0.5 0.1 165)",
395
+ secondary: "oklch(0.9 0.012 165)",
396
+ border: "oklch(0.8 0.015 165)",
397
+ card: "oklch(0.965 0.006 165)",
398
+ background: "oklch(0.93 0.012 165)"
399
+ }, D("chalkboard"), {
400
+ primary: "oklch(0.88 0.12 95)",
401
+ accent: "oklch(0.8 0.09 220)",
402
+ secondary: "oklch(0.29 0.025 165)",
403
+ border: "oklch(0.43 0.02 165)",
404
+ card: "oklch(0.28 0.028 165)",
405
+ background: "oklch(0.22 0.03 165)"
406
+ }, {
407
+ v: 1,
408
+ preset: "chalk"
409
+ }),
410
+ O("retrowave", "Retrowave", 1.2, ["#ff2bd6", "#35e0ff"], {
411
+ primary: "oklch(0.58 0.24 345)",
412
+ accent: "oklch(0.6 0.14 215)",
413
+ secondary: "oklch(0.93 0.03 320)",
414
+ border: "oklch(0.84 0.04 320)",
415
+ card: "oklch(0.96 0.02 320)",
416
+ background: "oklch(0.98 0.015 320)"
417
+ }, D("sunset-grid", { url: "/backgrounds/sunset-grid.svg" }), {
418
+ primary: "oklch(0.68 0.27 345)",
419
+ accent: "oklch(0.8 0.14 205)",
420
+ secondary: "oklch(0.2 0.06 290)",
421
+ border: "oklch(0.34 0.1 300)",
422
+ card: "oklch(0.19 0.07 290)",
423
+ background: "oklch(0.13 0.06 285)"
424
+ }, {
425
+ v: 1,
426
+ preset: "neon",
427
+ dials: { glow: 14 }
428
+ })
215
429
  ];
216
- function S() {
217
- return x;
430
+ function A() {
431
+ return k;
218
432
  }
219
- function C(e) {
220
- return x.find((t) => t.id === e);
433
+ function j(e) {
434
+ return k.find((t) => t.id === e);
221
435
  }
222
436
  //#endregion
223
437
  //#region src/tokens/theme-css.ts
224
- function w(e, t) {
438
+ function M(e, t) {
225
439
  let n = e.match(RegExp(`${t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\s*\\{([^}]*)\\}`));
226
440
  if (!n) throw Error(`block not found in theme.css: ${t}`);
227
441
  let r = {};
@@ -231,7 +445,7 @@ function w(e, t) {
231
445
  }
232
446
  return r;
233
447
  }
234
- function T(e) {
448
+ function N(e) {
235
449
  let t = d(e), [n, r, i] = [
236
450
  1,
237
451
  3,
@@ -239,13 +453,13 @@ function T(e) {
239
453
  ].map((e) => Number.parseInt(t.slice(e, e + 2), 16) / 255).map((e) => e <= .04045 ? e / 12.92 : ((e + .055) / 1.055) ** 2.4);
240
454
  return .2126 * n + .7152 * r + .0722 * i;
241
455
  }
242
- function E(e, t) {
243
- let [n, r] = [T(e), T(t)];
456
+ function P(e, t) {
457
+ let [n, r] = [N(e), N(t)];
244
458
  return (Math.max(n, r) + .05) / (Math.min(n, r) + .05);
245
459
  }
246
460
  //#endregion
247
461
  //#region src/tokens/readability.ts
248
- var D = [
462
+ var F = [
249
463
  {
250
464
  text: "mutedForeground",
251
465
  surface: "background",
@@ -287,37 +501,41 @@ var D = [
287
501
  min: 3
288
502
  }
289
503
  ];
290
- function O(e) {
291
- return D.flatMap((t) => {
292
- let n = E(e[t.text], e[t.surface]);
504
+ function I(e) {
505
+ return F.flatMap((t) => {
506
+ let n = P(e[t.text], e[t.surface]);
293
507
  return n >= t.min ? [] : [{
294
508
  ...t,
295
509
  ratio: n
296
510
  }];
297
511
  });
298
512
  }
299
- var k = .01;
300
- function A(e) {
301
- return D.filter((t) => t.text === e);
513
+ var L = .01;
514
+ function R(e) {
515
+ return F.filter((t) => t.text === e);
302
516
  }
303
- function j(e, t, n) {
304
- return n.every((n) => E(e, t[n.surface]) >= n.min);
517
+ function z(e, t, n) {
518
+ return n.every((n) => P(e, t[n.surface]) >= n.min);
305
519
  }
306
- function M(e, n) {
520
+ function B(e, n) {
307
521
  let a = r(e[n]);
308
522
  if (!a) return null;
309
- let o = A(n);
310
- for (let n = k; n <= 1; n += k) for (let r of [-1, 1]) {
523
+ let o = R(n);
524
+ for (let n = L; n <= 1; n += L) for (let r of [-1, 1]) {
311
525
  let s = a.l + r * n;
312
526
  if (s < 0 || s > 1) continue;
313
527
  let c = i(t(Number(s.toFixed(4)), 0, 1), a.c, a.h);
314
- if (j(c, e, o)) return c;
528
+ if (z(c, e, o)) return c;
315
529
  }
316
530
  return null;
317
531
  }
318
532
  //#endregion
319
533
  //#region src/tokens/theme-recipe.ts
320
- var N = 1, P = {
534
+ var V = 1, H = {
535
+ cool: "oklch(0.965 0.02 240)",
536
+ neutral: "oklch(0.97 0 0)",
537
+ warm: "oklch(0.965 0.025 75)"
538
+ }, U = {
321
539
  light: {
322
540
  ground: {},
323
541
  card: {
@@ -338,24 +556,24 @@ var N = 1, P = {
338
556
  },
339
557
  dark: {
340
558
  ground: {
341
- lTo: .14,
342
- c: 1.5,
343
- cMax: .04
559
+ lTo: .15,
560
+ c: 2.6,
561
+ cMax: .07
344
562
  },
345
563
  card: {
346
- lTo: .18,
347
- c: 1.5,
348
- cMax: .04
564
+ lTo: .19,
565
+ c: 2.6,
566
+ cMax: .07
349
567
  },
350
568
  border: {
351
- lTo: .26,
352
- c: 1.5,
353
- cMax: .05
569
+ lTo: .27,
570
+ c: 2.6,
571
+ cMax: .08
354
572
  },
355
573
  secondary: {
356
- lTo: .21,
357
- c: 1.5,
358
- cMax: .04
574
+ lTo: .22,
575
+ c: 2.6,
576
+ cMax: .07
359
577
  },
360
578
  primary: { l: .08 },
361
579
  accent: {
@@ -364,41 +582,41 @@ var N = 1, P = {
364
582
  }
365
583
  }
366
584
  };
367
- function F(e, n) {
585
+ function W(e, n) {
368
586
  let a = r(e);
369
587
  return a ? i(t(n.lTo ?? a.l + (n.l ?? 0), 0, 1), t(a.c * (n.c ?? 1), 0, n.cMax ?? .4), a.h) : e;
370
588
  }
371
- function I(e, t) {
372
- let n = P[t];
589
+ function G(e, t) {
590
+ let n = U[t];
373
591
  return {
374
- background: F(e.surface, n.ground),
375
- card: F(e.surface, n.card),
376
- border: F(e.surface, n.border),
377
- secondary: F(e.surface, n.secondary),
378
- primary: F(e.accent, n.primary),
379
- accent: F(e.accent, n.accent)
592
+ background: W(e.surface, n.ground),
593
+ card: W(e.surface, n.card),
594
+ border: W(e.surface, n.border),
595
+ secondary: W(e.surface, n.secondary),
596
+ primary: W(e.accent, n.primary),
597
+ accent: W(e.accent, n.accent)
380
598
  };
381
599
  }
382
- var L = [
600
+ var K = [
383
601
  "primary",
384
602
  "ring",
385
603
  "mutedForeground",
386
604
  "destructive"
387
605
  ];
388
- function R(e) {
389
- let t = { ...e }, n = new Set(O(t).map((e) => e.text));
390
- for (let e of L) n.has(e) && (t[e] = M(t, e) ?? t[e]);
606
+ function q(e) {
607
+ let t = { ...e }, n = new Set(I(t).map((e) => e.text));
608
+ for (let e of K) n.has(e) && (t[e] = B(t, e) ?? t[e]);
391
609
  return t;
392
610
  }
393
- function z(e) {
394
- let t = I(e, "light"), n = s(t, "light"), r = e.darkLinked ? c(t) : s(I(e, "dark"), "dark");
611
+ function J(e) {
612
+ let t = G(e, "light"), n = s(t, "light"), r = e.darkLinked ? c(t) : s(G(e, "dark"), "dark");
395
613
  return {
396
- light: R(n),
397
- dark: R(r)
614
+ light: q(n),
615
+ dark: q(r)
398
616
  };
399
617
  }
400
- function B(e) {
401
- let t = z(e);
618
+ function Y(e) {
619
+ let t = J(e);
402
620
  return {
403
621
  light: {
404
622
  ...t.light,
@@ -410,15 +628,15 @@ function B(e) {
410
628
  }
411
629
  };
412
630
  }
413
- function V(e, t, n) {
631
+ function X(e, t, n) {
414
632
  return e.set[t][n] === void 0;
415
633
  }
416
- function H(e, t) {
634
+ function Z(e, t) {
417
635
  let n = {};
418
636
  for (let r of Object.keys(t)) t[r] !== e[r] && (n[r] = t[r]);
419
637
  return n;
420
638
  }
421
- function U(e, t, n) {
639
+ function Q(e, t, n) {
422
640
  let r = {
423
641
  v: 1,
424
642
  accent: e.light.primary,
@@ -430,14 +648,14 @@ function U(e, t, n) {
430
648
  light: {},
431
649
  dark: {}
432
650
  }
433
- }, i = z(r);
651
+ }, i = J(r);
434
652
  return {
435
653
  ...r,
436
654
  set: {
437
- light: H(i.light, e.light),
438
- dark: H(i.dark, e.dark)
655
+ light: Z(i.light, e.light),
656
+ dark: Z(i.dark, e.dark)
439
657
  }
440
658
  };
441
659
  }
442
660
  //#endregion
443
- export { g as DEFAULT_THEME_ID, v as FONT_MONO, _ as FONT_SANS, D as READABLE_PAIRS, N as RECIPE_VERSION, x as THEME_PRESETS, t as clamp, E as contrastRatio, c as deriveDarkFromLight, u as ensureFullThemeColors, O as findUnreadable, M as fixReadable, S as getAllPresets, C as getPreset, V as isDerived, d as oklchToHex, r as parseOklch, w as parseThemeBlock, B as resolveRecipe, s as resolveThemeColors, U as seedsFromColors, i as toOklch };
661
+ export { w as DEFAULT_THEME_ID, E as FONT_MONO, T as FONT_SANS, y as FROSTED, v as MATERIAL_PRESETS, g as MATERIAL_VERSION, F as READABLE_PAIRS, V as RECIPE_VERSION, k as THEME_PRESETS, H as TINT_SURFACES, t as clamp, P as contrastRatio, c as deriveDarkFromLight, u as ensureFullThemeColors, I as findUnreadable, B as fixReadable, A as getAllPresets, j as getPreset, X as isDerived, S as materialDials, d as oklchToHex, r as parseOklch, M as parseThemeBlock, C as resolveMaterial, Y as resolveRecipe, s as resolveThemeColors, Q as seedsFromColors, i as toOklch };
@@ -0,0 +1,40 @@
1
+ export declare const MATERIAL_VERSION = 1;
2
+ export type MaterialPresetId = "frosted" | "paper" | "neon" | "chalk";
3
+ /** Tier 2 of the glass formula: what every surface's knobs are multiplied by. The homeowner's dials. */
4
+ export interface MaterialDials {
5
+ /** Backdrop blur radius, px. */
6
+ blur: number;
7
+ /** How much of the card colour a surface keeps, %; the rest is the wallpaper. */
8
+ clarity: number;
9
+ /** Scales sheen, shade, rim and lift together. */
10
+ depth: number;
11
+ /** Scales the tone wash. */
12
+ tint: number;
13
+ /** Outer bloom radius in the surface's own hue, px. */
14
+ glow: number;
15
+ /** 0..1; above 0 every surface is hand-inked: a drawn line over a hand-laid fill. */
16
+ ink: number;
17
+ }
18
+ /** Terms a preset turns on; inert at zero, never a homeowner dial. */
19
+ export interface MaterialTerms {
20
+ /** Edge width, px. */
21
+ edgeWidth: number;
22
+ /** 0..1, how far the edge moves toward the material ink. */
23
+ edgeInk: number;
24
+ /** 0..1, how far the edge moves toward the surface's own hue (its tone, else the accent). */
25
+ edgeAccent: number;
26
+ /** 0..1, how far the Ink line moves from the mode's ink toward the foreground: chalk on a dark board. */
27
+ inkLift: number;
28
+ }
29
+ export type MaterialSpec = MaterialDials & MaterialTerms;
30
+ /** What was chosen, never what was computed. */
31
+ export interface Material {
32
+ v: typeof MATERIAL_VERSION;
33
+ preset: MaterialPresetId;
34
+ dials?: Partial<MaterialDials>;
35
+ }
36
+ export type BlurMode = "dynamic" | "performant" | "none";
37
+ export declare const MATERIAL_PRESETS: Record<MaterialPresetId, MaterialSpec>;
38
+ export declare const FROSTED: Material;
39
+ export declare function materialDials(material: Material): MaterialDials;
40
+ export declare function resolveMaterial(material: Material, blurMode: BlurMode): Record<`--material-${string}`, string>;
@@ -1,3 +1,4 @@
1
+ import type { Material } from "./material.js";
1
2
  import { type BackgroundConfig, type ThemeColorsConfig } from "./theme-colors.js";
2
3
  export interface ThemePreset {
3
4
  id: string;
@@ -7,6 +8,8 @@ export interface ThemePreset {
7
8
  background: BackgroundConfig;
8
9
  /** Curated two-stop gradient used for theme picker dots and marketing swatches. */
9
10
  swatch: [string, string];
11
+ /** Absent: Frosted. */
12
+ material?: Material;
10
13
  }
11
14
  export declare const DEFAULT_THEME_ID = "midnight-glass";
12
15
  /** Font stacks as shipped in styles/theme.css. */
@@ -20,14 +20,24 @@ export interface ThemeColorsConfig {
20
20
  light: ThemeColors;
21
21
  dark: ThemeColors;
22
22
  }
23
- export interface BackgroundConfig {
23
+ export interface BackgroundLayer {
24
24
  type: "solid" | "static" | "custom";
25
25
  id: string;
26
- themed: boolean;
27
- url?: string;
28
26
  fit?: "cover" | "contain" | "tile";
27
+ /** 0 to 1: how far the wallpaper fades toward `--background`. */
29
28
  overlay?: number;
29
+ /** 0 to 20, in px. */
30
30
  blur?: number;
31
+ /** 0 to 1: how dark the corners fall. */
32
+ vignette?: number;
33
+ }
34
+ /** The picture alone; visibility and softness belong to the theme, the same in both modes. */
35
+ export type BackgroundImage = Pick<BackgroundLayer, "type" | "id" | "fit">;
36
+ export interface BackgroundConfig extends BackgroundLayer {
37
+ themed: boolean;
38
+ url?: string;
39
+ /** Shown in dark mode instead of the top-level picture. */
40
+ dark?: BackgroundImage;
31
41
  }
32
42
  /** The 6 base colors used as input for resolving a full ThemeColors */
33
43
  export type ThemeBaseColors = Pick<ThemeColors, "primary" | "accent" | "secondary" | "border" | "card" | "background">;