foldkit-mixins 0.17.0 → 0.18.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/README.md CHANGED
@@ -338,7 +338,8 @@ Beyond `self`, `pseudo`, `media`, `supports`, `container` and `nest`, the rule p
338
338
  `foldkit-mixins/theme` extends the root `Theme` with the pieces a page ships. A theme is a typed
339
339
  set of knob values: only what it changes, every other knob at its default.
340
340
  `Theme.make` checks each value against its knob (`Knobs.standard`, grouped by concern: `accent`,
341
- `surface`, `shape`, `type`, `icon`, `motion`, `shadow`, `menu`, `feedback`, `code`, `chart`, `scales`),
341
+ `surface`, `state`, `shape`, `type`, `icon`, `motion`, `shadow`, `menu`, `feedback`, `code`,
342
+ `chart`, `scales`),
342
343
  so a misspelt knob or a choice outside its options is a type error and a number out of its range
343
344
  throws where the theme is made. A theme is `pipe`able: `Theme.set` changes some knobs, and
344
345
  `Theme.describe` gives it a title and a description for a list of themes.
@@ -433,14 +434,18 @@ at both ends, where a vivid near-white or near-black falls out of gamut; `wash-1
433
434
  mix step 6 into `surface.base` at 8, 16, 28 and 44%, so a tinted ground follows the scheme and
434
435
  the surface knobs. Each hue is a knob (`red-h`), and `scale-c` scales every step's chroma
435
436
  (`--fk-blue-wash-2`, `ref.blue['6']`). The `popup` group is a menu's
436
- panel (`surface`, `ink`, `blur`) and its lit row (`highlight`, `highlight-ink`): `menu.highlight:
437
- 'bold'` lights the row in the accent's fill, and `menu.panel` draws the panel `inverted`
438
- (the other scheme's surface and text) or `translucent` over a blur, as shadcn's menu options do.
437
+ panel (`surface`, `ink`, `blur`) and its lit row (`highlight`, `press`, `highlight-ink`):
438
+ `menu.highlight: 'bold'` lights the row in the accent's fill, and `menu.panel` draws the panel
439
+ `inverted` (the other scheme's surface and text) or `translucent` over a blur, as shadcn's menu
440
+ options do.
439
441
  Each is a 0-or-1 knob (`popup-bold`, `popup-invert`) blended by `color-mix`, so an override
440
442
  switches it live. The `state` group is what a state lays over the surface under it, a mix of the
441
- element's own text color (`hover`; `tint` and `tint-hover`, a see-through fill; `edge`, a hairline
442
- inside an image), so it reads at any elevation and on any band; its amounts are knobs
443
- (`state-hover`, `state-tint`, `state-tint-dark`, `image-edge`). `Theme.nested(outer, inset,
443
+ element's own text color (`hover`, and `press` at 1.75 of it; `tint` and `tint-hover`, a
444
+ see-through fill; `edge`, a hairline inside an image), so it reads at any elevation and on any
445
+ band; its amounts are knob variables (`state-hover`, `state-tint`, `state-tint-dark`,
446
+ `image-edge`), and a theme sets the hover's, and the press's with it, with
447
+ `surface.hoverStrength` (4% to 24%, 12% by default); a disabled control fades by
448
+ `state.disabledOpacity` (`Disabled`, 0.3 to 0.7, half by default). `Theme.nested(outer, inset,
444
449
  border?)` is the radius of a surface inset in another, so their corners are concentric. A
445
450
  container that pads its children can publish that instead: spread `Theme.nests(radius, inset,
446
451
  border?)` beside its own radius and padding, and `Theme.nested()` with no arguments on any
@@ -525,6 +530,25 @@ container named `page` rather than the window: an editor's preview frame, narrow
525
530
  window, then draws a look as a narrow screen would. An element must be that container
526
531
  (`containerType: 'inline-size', containerName: 'page'`).
527
532
 
533
+ ### States
534
+
535
+ One owner per interactive state, so every component on a page agrees and a theme moves them
536
+ together:
537
+
538
+ | State | Drawn by | Chosen by |
539
+ | --- | --- | --- |
540
+ | hover | the hover ink as a film over what is under it | `surface.hover` (the ink), `surface.hoverStrength` (how much) |
541
+ | press | the same ink at 1.75 of the hover's strength | `surface.hoverStrength` |
542
+ | selected / current | `accent.subtle`; a popup's lit row by `menu.highlight` | `accent.*`, `menu.highlight` |
543
+ | focus | one outline token, one offset | `accent.hue` |
544
+ | disabled | one fade, and nothing else changes | `state.disabledOpacity` |
545
+
546
+ A fluid highlight — one highlight that glides from item to item — is the hover: it lays the
547
+ same film from the same ink, so a fluid list and a plain one on a page hover alike, and it
548
+ deepens to the press while its item is held. Popups keep their own highlight, and a Card
549
+ lightens a dark page as it darkens a light one, both by design. `foldkit-mixins-ui` names the
550
+ pieces: `unfilledHover`, `pressedHover`, `hover()`, `focusRing` and `disabled`.
551
+
528
552
  ### Layout
529
553
 
530
554
  `foldkit-mixins/layout` ships the common arrangements as pieces: `Layout.stack`, `cluster`,
package/dist/app.d.mts CHANGED
@@ -2,7 +2,7 @@ import { i as StyleValue } from "./styleValue-DEsUAC4v.mjs";
2
2
  import { standard } from "./layers.mjs";
3
3
  import { a as NamedStyle, l as StyleOptions, n as Declared, r as DeclaredPieces, u as StylePieces } from "./style-Cs-aMa_a.mjs";
4
4
  import { a as compose, r as ThemeTokens, t as Refs } from "./core-Cq9PThXv.mjs";
5
- import { d as RootOptions, g as KnobTheme, r as Themes, t as StandardTokens, v as Standard } from "./themes-B9jxH5tK.mjs";
5
+ import { d as RootOptions, g as KnobTheme, r as Themes, t as StandardTokens, v as Standard } from "./themes-DF2Spo6_.mjs";
6
6
  //#region src/app.d.ts
7
7
  interface Common<Own extends ThemeTokens> {
8
8
  /**
package/dist/app.mjs CHANGED
@@ -2,7 +2,7 @@ import { i as stylesheet, n as forSlots, r as slots } from "./style-COMT0F2e.mjs
2
2
  import { i as compose } from "./styleValue-6hpAYYfg.mjs";
3
3
  import { r as standard } from "./layers-DxWvuCJL.mjs";
4
4
  import { o as ref, r as compose$1 } from "./core-BrR6UPbk.mjs";
5
- import { l as standardOf, t as root } from "./root-BsyR6nwj.mjs";
5
+ import { l as standardOf, t as root } from "./root-CT_iUZvD.mjs";
6
6
  import { body, reset } from "./defaults.mjs";
7
7
  //#region src/app.ts
8
8
  /**
@@ -1,6 +1,6 @@
1
1
  import { c as global } from "./styleValue-6hpAYYfg.mjs";
2
2
  import { i as define, n as VAR_PREFIX, r as compose } from "./core-BrR6UPbk.mjs";
3
- import { _ as tokensOf, b as variables, c as tokens, d as make$1, g as standard, v as unsetOf } from "./tokens-DIIMgir1.mjs";
3
+ import { _ as tokensOf, b as variables, c as tokens, d as make$1, g as standard, v as unsetOf } from "./tokens-CkTT9DNd.mjs";
4
4
  import { Effect, Schema } from "effect";
5
5
  //#region src/theme/oklch.ts
6
6
  /**
@@ -161,7 +161,6 @@ const accent = v("accent", "default");
161
161
  const palette = define({
162
162
  knob: {
163
163
  ...unsetOf(standard),
164
- "state-hover": "12%",
165
164
  "state-tint": "8%",
166
165
  "state-tint-dark": "25%",
167
166
  "image-edge": "10%",
@@ -203,6 +202,7 @@ const palette = define({
203
202
  shadow: { color: ld(`oklch(25% ${v("knob", "shadow-c")} ${v("knob", "shadow-h")} / 0.14)`, `oklch(5% calc(${v("knob", "shadow-c")} * 4 / 3) ${v("knob", "shadow-h")} / 0.6)`) },
204
203
  state: {
205
204
  hover: `color-mix(in oklab, currentColor ${v("knob", "state-hover")}, transparent)`,
205
+ press: `color-mix(in oklab, currentColor calc(${v("knob", "state-hover")} * 1.75), transparent)`,
206
206
  tint: ld(`color-mix(in oklab, currentColor ${v("knob", "state-tint")}, transparent)`, `color-mix(in oklab, currentColor ${v("knob", "state-tint-dark")}, transparent)`),
207
207
  "tint-hover": ld(`color-mix(in oklab, currentColor calc(${v("knob", "state-tint")} * 0.8), transparent)`, `color-mix(in oklab, currentColor calc(${v("knob", "state-tint-dark")} * 0.8), transparent)`),
208
208
  edge: `color-mix(in oklab, ${v("text", "overt")} ${v("knob", "image-edge")}, transparent)`,
@@ -213,6 +213,7 @@ const palette = define({
213
213
  inverted: ld(`oklch(${v("knob", "base-l-dark")} calc(${surfaceCDark} * 0.9) ${neutral})`, `oklch(${v("knob", "base-l")} calc(${surfaceC} * 0.9) ${neutral})`),
214
214
  ink: share(text([88, .8], [20, 2]), "popup-invert", v("text", "default")),
215
215
  highlight: share(v("accent", "default"), "popup-bold", `color-mix(in oklab, ${v("popup", "ink")} 8%, transparent)`),
216
+ press: share(v("accent", "active"), "popup-bold", `color-mix(in oklab, ${v("popup", "ink")} 14%, transparent)`),
216
217
  "highlight-ink": share(v("accent", "on-fill"), "popup-bold", v("popup", "ink")),
217
218
  blur: v("knob", "popup-blur")
218
219
  },
@@ -370,4 +371,4 @@ const scoped = (_theme, selector, overrides) => {
370
371
  //#endregion
371
372
  export { choose as a, script as c, apply as i, standardOf as l, scoped as n, make as o, THEME_KEY as r, scope as s, root as t, scriptLiteral as u };
372
373
 
373
- //# sourceMappingURL=root-BsyR6nwj.mjs.map
374
+ //# sourceMappingURL=root-CT_iUZvD.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root-CT_iUZvD.mjs","names":["makeTheme","declarations"],"sources":["../src/theme/oklch.ts","../src/theme/scriptLiteral.ts","../src/theme/themes.ts","../src/theme/root.ts"],"sourcesContent":["/**\n * A whole palette from a few knobs, as css-tags derives it: every value\n * except the knobs is a CSS expression over other tokens, so overriding a\n * knob on the element that declares the tokens (`:root`, or a scoped theme's\n * selector) re-derives the rest in the browser. A custom property resolves\n * where it is declared, so a knob overridden on a subtree below `:root`\n * changes nothing: `Theme.scope` declares the derivations there too. Where\n * light and dark schemes need different numbers the value is a `light-dark()` pair, so one theme serves both and a user's\n * choice is a `color-scheme` override.\n */\nimport { define } from './core.js'\nimport { standard, unsetOf } from './knobs.js'\n\nconst v = (group: string, name: string) => `var(--fk-${group}-${name})`\nconst ld = (light: string, dark: string) => `light-dark(${light}, ${dark})`\nconst offset = (amount: number) => `${amount < 0 ? '-' : '+'} ${Math.abs(amount)}`\n/** `oklch(from <color> …)` with the hue kept. */\nconst from = (color: string, l: string, c: string) => `oklch(from ${color} ${l} ${c} h)`\nconst shift = (color: string, dl: number, dc: number) =>\n from(color, `calc(l ${offset(dl)})`, `calc(c ${offset(dc)})`)\nconst scale = (color: string, dl: number, cx: number) =>\n from(color, `calc(l ${offset(dl)})`, `calc(c * ${cx})`)\n/** The same lightness and chroma as `color` on another hue. */\nconst rehue = (color: string, hue: string) => `oklch(from ${color} l c ${hue})`\n/** Near-black or near-white text over `color`. */\nconst contrast = (color: string) =>\n `oklch(from ${color} clamp(0.1, (0.65 / l - 1) * 999, 0.98) min(c, 0.08) h)`\n/** `color` as text on the base surface: dark in a light scheme, light in a dark one. */\nconst ink = (color: string) => ld(from(color, '0.5', 'c'), from(color, '0.8', 'c'))\n/**\n * `color` tinted onto the base surface, the same in both schemes. Mixed in\n * OKLab, not OKLCH: OKLCH interpolates hue, so a mix mostly of the base keeps\n * the base's hue, and a green tinted onto a blue-grey base came out blue.\n */\nconst tint = (color: string, percent: number) =>\n `color-mix(in oklab, ${v('surface', 'base')} ${percent}%, ${color})`\n\nconst neutral = v('hue', 'neutral')\nconst base = v('surface', 'base')\nconst surfaceC = v('knob', 'surface-c')\nconst surfaceCDark = v('knob', 'surface-c-dark')\nconst contrastFactor = v('knob', 'contrast-factor')\n\ntype Step = readonly [lightness: number, chroma: number]\n\n/**\n * How far a step's target lies past the offset it names: at the default\n * contrast (26%) a step sits where its offset says, and the whole knob spans\n * 2.5 times that, so its range is one a reader sees. At a reach of 1 the knob\n * at its top moved the muted surface four points of lightness.\n */\nconst REACH = 2.5\nconst reach = ([lightness, chroma]: Step): Step => [\n Number((lightness * REACH).toFixed(4)),\n Number((1 + (chroma - 1) * REACH).toFixed(4)),\n]\n\n/** A surface step: the base mixed toward a target by `surface-contrast`. */\nconst surfaceStep = (lightStep: Step, darkStep: Step) => {\n const amount = v('knob', 'surface-contrast')\n const [light, dark] = [reach(lightStep), reach(darkStep)]\n const target = ld(scale(base, light[0], light[1]), scale(base, dark[0], dark[1]))\n return `color-mix(in oklch, ${base} calc(100% - ${amount}), ${target} ${amount})`\n}\n\n/** `a` where the 0-or-1 knob `name` is 1, `b` where it is 0. */\nconst share = (a: string, name: string, b: string) =>\n `color-mix(in oklab, ${a} calc(${v('knob', name)} * 100%), ${b})`\n\n/** A text color: fixed lightness, chroma scaled by surface saturation and the contrast factor. */\nconst text = (light: Step, dark: Step) =>\n ld(\n `oklch(${light[0]}% calc(${surfaceC} * ${light[1]} * ${contrastFactor}) ${neutral})`,\n `oklch(${dark[0]}% calc(${surfaceCDark} * ${dark[1]} * ${contrastFactor}) ${neutral})`,\n )\n\n/**\n * A color family, every one the same shape: its fill, the fill hovered and\n * pressed, a tint of it on the base, a line in it that stands off the base\n * (darker in a light scheme, lighter in a dark one), and text on the fill\n * and in the family's color.\n */\nconst family = (name: string, defaultValue: string) => {\n const color = v(name, 'default')\n return {\n default: defaultValue,\n hover: shift(color, -0.06, 0),\n active: shift(color, -0.1, 0.05),\n subtle: tint(color, 85),\n outline: ld(shift(color, -0.05, 0), shift(color, 0.05, 0)),\n 'on-fill': contrast(color),\n ink: ink(color),\n }\n}\n\n/**\n * A code color in `hue`: the same lightness for every kind, so no kind shouts,\n * dark enough to read on a light surface and light enough on a dark one.\n */\nconst syntaxInk = (hue: string) =>\n ld(`oklch(48% ${v('knob', 'syntax-c')} ${hue})`, `oklch(80% ${v('knob', 'syntax-c')} ${hue})`)\n\n/**\n * A chart's series color: a hue a fixed turn from the first, at a lightness\n * and chroma chosen for that hue in each scheme (a yellow sits lighter than a\n * blue to read as strong). The five are the dataviz reference palette's first\n * slots, in its order, which keeps neighbors apart under protan and deutan\n * vision; moving `chart-h` turns them all and keeps the order.\n */\nconst chartInk = (turn: number, light: Step, dark: Step) => {\n const hue = `calc(${v('knob', 'chart-h')} ${offset(turn)})`\n return ld(`oklch(${light[0]} ${light[1]} ${hue})`, `oklch(${dark[0]} ${dark[1]} ${hue})`)\n}\n\n/** A feedback family, lighter in a dark scheme so its fill reads on a dark page. */\nconst feedback = (name: string, l: number, c: number, dark: number) =>\n family(\n name,\n ld(\n `oklch(${l}% ${c} ${v('knob', `${name}-h`)})`,\n `oklch(${dark}% ${c} ${v('knob', `${name}-h`)})`,\n ),\n )\n\n/** The color scales, each named for its hue (a knob, `red-h`). */\ntype ScaleName = 'red' | 'orange' | 'yellow' | 'green' | 'teal' | 'blue' | 'purple'\n\n/**\n * One lightness ladder for every scale, near white to near black in even\n * steps, so step 6 of red is as light as step 6 of blue: a step number\n * means the same contrast in any hue (after css-tags' palette).\n */\nconst scaleL = [97, 88.5, 80, 71.5, 63, 54.5, 46, 37.5, 29, 20.5]\n// Chroma swells toward the middle, where a screen can show most of it, and\n// thins at both ends, where a vivid near-white or near-black falls out of gamut.\nconst scaleC = [0.02, 0.05, 0.09, 0.13, 0.16, 0.17, 0.155, 0.125, 0.09, 0.055]\n\n/**\n * A color's ten steps, `1` the lightest, and four `wash`es: step 6 mixed\n * into the page, so a tinted ground follows the scheme and the surface\n * knobs as the page does.\n */\nconst colorScale = (name: ScaleName) => {\n const hue = v('knob', `${name}-h`)\n const step = (index: number) =>\n `oklch(${scaleL[index]}% calc(${scaleC[index]} * ${v('knob', 'scale-c')}) ${hue})`\n const wash = (share: number) =>\n `color-mix(in oklab, ${v(name, '6')} ${share}%, ${v('surface', 'base')})`\n return {\n '1': step(0),\n '2': step(1),\n '3': step(2),\n '4': step(3),\n '5': step(4),\n '6': step(5),\n '7': step(6),\n '8': step(7),\n '9': step(8),\n '10': step(9),\n 'wash-1': wash(8),\n 'wash-2': wash(16),\n 'wash-3': wash(28),\n 'wash-4': wash(44),\n }\n}\n\n/**\n * An outline, the palette's line until the `shape.outlines` knob gives it the\n * text's own ink: `outline-ink` 0 is the line itself, 1 the ink at its strength.\n */\nconst inked = (line: string, strength: 'subtle' | 'default' | 'overt') =>\n `color-mix(in oklch, ${line}, color-mix(in oklch, ${v('text', 'overt')} ${v('knob', `outline-ink-${strength}`)}, transparent) calc(${v('knob', 'outline-ink')} * 100%))`\n\nconst accent = v('accent', 'default')\n\n/**\n * The palette: every color a CSS expression over the knobs' variables. The\n * knobs stand at their defaults here; a theme declares its own values over\n * them (`Theme.standard`).\n */\nexport const palette = define({\n knob: {\n ...unsetOf(standard),\n // How much of the text a state lays over its surface; a hover's is a knob.\n 'state-tint': '8%',\n 'state-tint-dark': '25%',\n 'image-edge': '10%',\n // How much lighter each raised level is in a dark scheme.\n 'raise-dark': '0.027',\n },\n hue: {\n accent: v('knob', 'accent-h'),\n secondary: `calc(${v('knob', 'accent-h')} + ${v('knob', 'secondary-shift')})`,\n tertiary: `calc(${v('knob', 'accent-h')} + ${v('knob', 'tertiary-shift')})`,\n neutral: v('knob', 'neutral-h'),\n },\n surface: {\n base: ld(\n `oklch(${v('knob', 'base-l')} calc(${surfaceC} * 0.9) ${neutral})`,\n `oklch(${v('knob', 'base-l-dark')} calc(${surfaceCDark} * 0.9) ${neutral})`,\n ),\n // A control's resting ground, separate from a neutral surface step so a\n // field can keep its contrast if the steps move: filled fields read it,\n // the page reads base.\n field: v('surface', 'default'),\n // Each step keeps about the base's chroma, so a sidebar, a panel and\n // the page read as one color at a few lightnesses: one with less reads\n // grey on the page, one with more reads as another, bluer color.\n muted: surfaceStep([-0.04, 1.2], [-0.03, 1.05]),\n subtle: surfaceStep([-0.025, 1.15], [-0.015, 1.05]),\n default: surfaceStep([-0.055, 1.25], [0.045, 1.1]),\n overt: surfaceStep([-0.31, 2.25], [0.125, 1.2]),\n // The deepest of the page's color in both schemes: under a dialog's\n // backdrop, a veil of it darkens the page; it was near-white in a dark one.\n bedrock: ld(\n `oklch(8% calc(${surfaceC} * 1.2) ${neutral})`,\n `oklch(6% calc(${surfaceCDark} * 1.2) ${neutral})`,\n ),\n },\n text: {\n default: text([20, 2], [88, 0.8]),\n muted: text([45, 1.5], [65, 1.2]),\n subtle: text([35, 1.8], [75, 1]),\n overt: text([10, 2.2], [95, 0.6]),\n link: shift(accent, 0.1, 0.05),\n 'link-hover': shift(v('text', 'link'), -0.1, 0),\n },\n // Steps from the base, as the surfaces are: darker in a light scheme,\n // lighter in a dark one, and in the base's own hue with a little more of\n // its chroma, which a thin line needs to read as the page's color. Text mixed into the base, as they were, came out grey on a\n // tinted page: the text is near-neutral, so the mix lost the tint.\n outline: {\n subtle: inked(ld(scale(base, -0.07, 1.3), scale(base, 0.065, 1.25)), 'subtle'),\n // Between two parts of one surface (groups of a list, a panel's\n // header): a step past `subtle`, which a dark page all but hides.\n divider: inked(ld(scale(base, -0.1, 1.35), scale(base, 0.095, 1.3)), 'subtle'),\n default: inked(ld(scale(base, -0.13, 1.4), scale(base, 0.12, 1.35)), 'default'),\n overt: inked(ld(scale(base, -0.27, 1.6), scale(base, 0.23, 1.5)), 'overt'),\n // The accent as it is: darker and more saturated, the ring was the\n // harshest color on the page.\n focus: accent,\n },\n accent: family(\n 'accent',\n ld(\n `oklch(${v('knob', 'accent-l')} ${v('knob', 'accent-c')} ${v('hue', 'accent')})`,\n `oklch(${v('knob', 'accent-l-dark')} ${v('knob', 'accent-c-dark')} ${v('hue', 'accent')})`,\n ),\n ),\n secondary: family('secondary', rehue(accent, v('hue', 'secondary'))),\n tertiary: family('tertiary', rehue(accent, v('hue', 'tertiary'))),\n // A near-black of the shadow's hue: faint on a light surface, and denser\n // on a dark one, where a light shadow would read as a glow.\n shadow: {\n color: ld(\n `oklch(25% ${v('knob', 'shadow-c')} ${v('knob', 'shadow-h')} / 0.14)`,\n // A third more chroma, as the dark surfaces have.\n `oklch(5% calc(${v('knob', 'shadow-c')} * 4 / 3) ${v('knob', 'shadow-h')} / 0.6)`,\n ),\n },\n // What a state lays over the surface under it, after Fluid Functionalism's\n // overlays. `hover`, `tint` and `tint-hover` mix the element's own text\n // color: `currentColor` resolves where the film is drawn, so a hover reads\n // at any elevation, on a tinted band, and on an inverted panel alike. A\n // film that must take its surface's hue instead reads a property on the\n // element (`unfilledHover` reads a surface's `--_fk-state-ink`, falling\n // back to this `ink`): a `var()` substitutes where the token is declared,\n // so a token cannot carry a per-surface ink. `tint` is a see-through fill, which\n // takes on whatever it sits on (lighter when hovered, as Fluid's: the\n // press is what darkens). `edge` is a hairline inside an image, so a pale\n // edge keeps its shape. `ink` is the state ink where no surface set one:\n // the text (`surface`), the accent's ink (`accent`), or the text with the\n // films reading it directly (`neutral`, as before).\n state: {\n hover: `color-mix(in oklab, currentColor ${v('knob', 'state-hover')}, transparent)`,\n // The same ink held down: a press is the hover at 1.75, one strength the\n // `hoverStrength` knob moves for both. `pressedHover` is its twin, and\n // takes the surface's ink where this one takes the text's.\n press: `color-mix(in oklab, currentColor calc(${v('knob', 'state-hover')} * 1.75), transparent)`,\n tint: ld(\n `color-mix(in oklab, currentColor ${v('knob', 'state-tint')}, transparent)`,\n `color-mix(in oklab, currentColor ${v('knob', 'state-tint-dark')}, transparent)`,\n ),\n 'tint-hover': ld(\n `color-mix(in oklab, currentColor calc(${v('knob', 'state-tint')} * 0.8), transparent)`,\n `color-mix(in oklab, currentColor calc(${v('knob', 'state-tint-dark')} * 0.8), transparent)`,\n ),\n edge: `color-mix(in oklab, ${v('text', 'overt')} ${v('knob', 'image-edge')}, transparent)`,\n ink: v('knob', 'state-ink'),\n },\n // A menu's panel and its lit row, which the popup recipes read.\n popup: {\n surface: `color-mix(in oklab, ${share(\n ld(\n `oklch(${v('knob', 'base-l-dark')} calc(${surfaceCDark} * 0.9) ${neutral})`,\n `oklch(${v('knob', 'base-l')} calc(${surfaceC} * 0.9) ${neutral})`,\n ),\n 'popup-invert',\n base,\n )} calc(${v('knob', 'popup-alpha')} * 100%), transparent)`,\n // The other scheme's base, which an inverted panel takes wherever it is raised to.\n inverted: ld(\n `oklch(${v('knob', 'base-l-dark')} calc(${surfaceCDark} * 0.9) ${neutral})`,\n `oklch(${v('knob', 'base-l')} calc(${surfaceC} * 0.9) ${neutral})`,\n ),\n // The text of the opposite scheme: light on an inverted panel in a light one.\n ink: share(text([88, 0.8], [20, 2]), 'popup-invert', v('text', 'default')),\n highlight: share(\n v('accent', 'default'),\n 'popup-bold',\n `color-mix(in oklab, ${v('popup', 'ink')} 8%, transparent)`,\n ),\n // Held down, as a row's hover deepens to its press: the accent darker, the\n // panel's own ink denser.\n press: share(\n v('accent', 'active'),\n 'popup-bold',\n `color-mix(in oklab, ${v('popup', 'ink')} 14%, transparent)`,\n ),\n 'highlight-ink': share(v('accent', 'on-fill'), 'popup-bold', v('popup', 'ink')),\n blur: v('knob', 'popup-blur'),\n },\n success: feedback('success', 55, 0.15, 64),\n warning: feedback('warning', 70, 0.15, 76),\n // Under 65% in the dark, where the text on a fill turns dark: on red that reads muddy.\n error: feedback('error', 60, 0.2, 64),\n info: feedback('info', 65, 0.15, 70),\n // Series colors, `chart-1` to `chart-5` as shadcn names them: a chart\n // assigns them in order, never by rank, so a series keeps its color.\n chart: {\n '1': chartInk(0, [0.575, 0.163], [0.622, 0.161]),\n '2': chartInk(145, [0.671, 0.175], [0.622, 0.173]),\n '3': chartInk(-93, [0.669, 0.141], [0.621, 0.128]),\n '4': chartInk(180, [0.764, 0.161], [0.67, 0.143]),\n '5': chartInk(102, [0.716, 0.141], [0.622, 0.171]),\n },\n // Color scales of ten even steps, for what is not a role: a tag's\n // color, an illustration, a status of the application's own.\n red: colorScale('red'),\n orange: colorScale('orange'),\n yellow: colorScale('yellow'),\n green: colorScale('green'),\n teal: colorScale('teal'),\n blue: colorScale('blue'),\n purple: colorScale('purple'),\n // Code, by the kinds a tokenizer names (`syntax-keyword` is\n // `--fk-syntax-keyword`): each kind in a hue the palette already has, so\n // code follows the brand, and the quiet kinds in the text's own grey.\n syntax: {\n keyword: syntaxInk(v('hue', 'accent')),\n function: syntaxInk(v('hue', 'secondary')),\n type: syntaxInk(v('hue', 'tertiary')),\n string: syntaxInk(v('knob', 'success-h')),\n number: syntaxInk(v('knob', 'warning-h')),\n property: syntaxInk(v('knob', 'info-h')),\n operator: v('text', 'default'),\n punctuation: v('text', 'muted'),\n comment: text([52, 1], [62, 1]),\n },\n})\n\nexport type Palette = typeof palette\n","/**\n * `value` as a literal in a head script's text: `<` escaped, so a key or a\n * name cannot close the script it is written into.\n */\nexport const scriptLiteral = (value: unknown): string =>\n JSON.stringify(value).replaceAll('<', `${String.fromCharCode(92)}u003c`)\n","/**\n * Themes installed by name. A theme of typed knobs (`Theme.make`) holds only\n * knob values, and every token derives from knob variables, so one set of\n * derivations serves every theme: the root declares them with the initial\n * theme's knobs, and each other theme writes its knobs under\n * `:root[data-theme=\"name\"]`, the same element, where the derivations resolve\n * them. Which theme is active is the application's Model's fact; `apply` is\n * the Command's effect that shows it, and `choose` shows it and keeps it,\n * for `script` to show in the head of the next page before the first paint.\n */\nimport { Effect, Schema } from 'effect'\nimport { global, type StyleValue } from '../styleValue.js'\nimport { compose, VAR_PREFIX, type ThemeTokens } from './core.js'\nimport {\n make as makeTheme,\n tokensOf,\n variables,\n type KnobSet,\n type KnobTheme,\n type Standard,\n} from './knobs.js'\nimport { palette, type Palette } from './oklch.js'\nimport { scriptLiteral } from './scriptLiteral.js'\nimport { tokens, type Tokens } from './tokens.js'\n\n/** Every shipped token: the scales, the palette, and the knobs they read. */\nexport type StandardTokens = ReturnType<typeof compose<Tokens, Palette>>\n\nconst shipped = compose(tokens, palette)\n\n/**\n * Every shipped token with `theme`'s knob values, for a page's root: the\n * derivations are the same for every theme, so only the knobs differ. With\n * no theme, every knob at its default.\n */\nexport const standardOf = (theme: KnobTheme<Standard> = makeTheme({})): StandardTokens =>\n compose(shipped, tokensOf(theme))\n\nconst declarations = (theme: ThemeTokens) =>\n Object.entries(theme)\n .flatMap(([group, names]) =>\n Object.entries(names).map(([name, value]) => `${VAR_PREFIX}-${group}-${name}:${value}`),\n )\n .join(';')\n\nconst knobRule = (selector: string, theme: KnobTheme<KnobSet>) =>\n `${selector}{${Object.entries(variables(theme))\n .map(([name, value]) => `${VAR_PREFIX}-knob-${name}:${value}`)\n .join(';')}}`\n\n/** A set of named themes, one of them shown until the Model chooses another. */\nexport interface Themes<Name extends string> {\n /** The names, as a Schema for the Model field that holds the active one. */\n readonly Name: Schema.Literals<ReadonlyArray<Name>>\n readonly names: ReadonlyArray<Name>\n readonly initial: Name\n /** The root element's attribute that names the active theme. */\n readonly attribute: string\n readonly theme: (name: Name) => KnobTheme<Standard>\n /** Every token with the initial theme's knobs: what the root declares, and what `t` reads. */\n readonly root: StandardTokens\n /** Each other theme's knobs, under its attribute on the root element, for the `theme` layer. */\n readonly scoped: StyleValue\n}\n\n/**\n * `themes` installed by their keys, `initial` shown until the Model chooses\n * another. A name is a key, so it is unique, and `Name` is the Schema of the\n * Model field that holds the active one.\n */\nexport const make = <const Record extends { readonly [name: string]: KnobTheme<Standard> }>(\n themes: Record,\n options: { readonly initial: keyof Record & string; readonly attribute?: string },\n): Themes<keyof Record & string> => {\n const names = Object.keys(themes) as ReadonlyArray<keyof Record & string>\n const attribute = options.attribute ?? 'data-theme'\n const theme = (name: keyof Record & string) => themes[name]!\n return {\n Name: Schema.Literals(names),\n names,\n initial: options.initial,\n attribute,\n theme,\n root: standardOf(theme(options.initial)),\n scoped: global(\n names\n .filter(name => name !== options.initial)\n .map(name => knobRule(`:root[${attribute}=\"${name}\"]`, theme(name)))\n .join(''),\n ),\n }\n}\n\n/**\n * Shows `name` on the root element, as a Command's effect: the initial theme\n * removes the attribute, so the root's own declarations apply.\n */\nexport const apply = <Name extends string>(themes: Themes<Name>, name: Name): Effect.Effect<void> =>\n Effect.sync(() => {\n const root = document.documentElement\n if (name === themes.initial) root.removeAttribute(themes.attribute)\n else root.setAttribute(themes.attribute, name)\n })\n\n/** The storage key a chosen theme's name is kept under, unless one is given. */\nexport const THEME_KEY = 'foldkit:theme'\n\n/**\n * The text of a `<script>` for the document's head: it shows the theme whose\n * name is kept under `key`, so a reader who chose one never sees the initial\n * theme for a frame. A kept name that is not one of `themes` (a theme a later\n * build removed), and storage that throws, leave the initial theme.\n */\nexport const script = <Name extends string>(\n themes: Themes<Name>,\n key: string = THEME_KEY,\n): string =>\n `(function(){try{var n=localStorage.getItem(${scriptLiteral(key)});` +\n `if(${scriptLiteral(themes.names.filter(name => name !== themes.initial))}.indexOf(n)!==-1)` +\n `document.documentElement.setAttribute(${scriptLiteral(themes.attribute)},n)}catch(e){}})()`\n\n/**\n * Shows `name`, as `apply` does, and keeps it under `key` for the next visit,\n * as a Command's effect: the initial theme keeps nothing. Storage that throws\n * still shows it on this page.\n */\nexport const choose = <Name extends string>(\n themes: Themes<Name>,\n name: Name,\n key: string = THEME_KEY,\n): Effect.Effect<void> =>\n apply(themes, name).pipe(\n Effect.andThen(\n Effect.sync(() => {\n try {\n if (name === themes.initial) localStorage.removeItem(key)\n else localStorage.setItem(key, name)\n } catch {\n // Storage refused (a private window, a full quota): this visit keeps it.\n }\n }),\n ),\n )\n\n/**\n * `theme` on the elements `selector` matches, below the root: its knobs and\n * every derivation again. A token resolves where it is declared, so knobs\n * alone under a subtree would change nothing derived from them there.\n */\nexport const scope = (theme: KnobTheme<Standard>, selector: string): StyleValue => {\n const { knob: _knob, ...derived } = shipped\n return global(`${selector}{${declarations(derived)}}${knobRule(selector, theme)}`)\n}\n","/**\n * A theme's tokens as `:root` custom properties, for the page stylesheet.\n * Unlayered: the page decides which layer with `Layers.in`.\n */\nimport { global, type StyleValue } from '../styleValue.js'\nimport { VAR_PREFIX, type ThemeTokens } from './core.js'\n\nexport interface RootOptions {\n /** Tokens present in this theme are left out, so a scale shipped in another layer goes out once. */\n readonly omit?: ThemeTokens\n /** Default `'light dark'`, so `lightDark` tokens resolve. */\n readonly colorScheme?: 'light dark' | 'light' | 'dark'\n}\n\n/**\n * Every token as `--fk-group-name:value`, in authored order. `omit` is\n * matched token by token, not group by group: two themes can both carry a\n * `knob` group (the scales' density beside a palette's hues) and only the\n * names `omit` has are skipped.\n */\nconst declarations = (theme: ThemeTokens, omit?: ThemeTokens): ReadonlyArray<string> =>\n Object.entries(theme).flatMap(([group, names]) =>\n Object.entries(names).flatMap(([name, value]) =>\n omit !== undefined && Object.hasOwn(omit[group] ?? {}, name)\n ? []\n : [`${VAR_PREFIX}-${group}-${name}:${value}`],\n ),\n )\n\nexport const root = (theme: ThemeTokens, options?: RootOptions): StyleValue =>\n global(\n `:root{${[...declarations(theme, options?.omit), `color-scheme:${options?.colorScheme ?? 'light dark'}`].join(';')}}`,\n )\n\n/** Some of a theme's tokens, by the theme's own group and token names. */\nexport type Overrides<T extends ThemeTokens> = {\n readonly [G in keyof T]?: { readonly [N in keyof T[G]]?: string }\n}\n\n/**\n * Token overrides under `selector`: a named theme the Model selects with a\n * root attribute (`:root[data-theme=\"ocean\"]`), or a scheme the user chose\n * (`:root[data-color-scheme=\"dark\"]`). Which one is active is the Model's\n * fact; this only says what it means. On the root element an overridden knob\n * re-derives every token; under a subtree it changes only the tokens it\n * overrides itself, since a token resolves where it is declared: scope a\n * theme to a subtree with `Theme.scope`, which declares the derivations there\n * too.\n *\n * `theme` is the theme being overridden and is read only for its type, so a\n * group or token it lacks is a type error rather than a variable nothing reads.\n */\nexport const scoped = <T extends ThemeTokens>(\n _theme: T,\n selector: string,\n overrides: Overrides<T>,\n): StyleValue => {\n const tokens: Record<string, Record<string, string>> = {}\n for (const [group, names] of Object.entries(overrides)) {\n const defined: Record<string, string> = {}\n for (const [name, value] of Object.entries(names ?? {})) {\n if (typeof value === 'string') defined[name] = value\n }\n tokens[group] = defined\n }\n return global(`${selector}{${declarations(tokens).join(';')}}`)\n}\n"],"mappings":";;;;;;;;;;;;;;;AAaA,MAAM,KAAK,OAAe,SAAiB,YAAY,MAAM,GAAG,KAAK;AACrE,MAAM,MAAM,OAAe,SAAiB,cAAc,MAAM,IAAI,KAAK;AACzE,MAAM,UAAU,WAAmB,GAAG,SAAS,IAAI,MAAM,IAAI,GAAG,KAAK,IAAI,MAAM;;AAE/E,MAAM,QAAQ,OAAe,GAAW,MAAc,cAAc,MAAM,GAAG,EAAE,GAAG,EAAE;AACpF,MAAM,SAAS,OAAe,IAAY,OACxC,KAAK,OAAO,UAAU,OAAO,EAAE,EAAE,IAAI,UAAU,OAAO,EAAE,EAAE,EAAE;AAC9D,MAAM,SAAS,OAAe,IAAY,OACxC,KAAK,OAAO,UAAU,OAAO,EAAE,EAAE,IAAI,YAAY,GAAG,EAAE;;AAExD,MAAM,SAAS,OAAe,QAAgB,cAAc,MAAM,OAAO,IAAI;;AAE7E,MAAM,YAAY,UAChB,cAAc,MAAM;;AAEtB,MAAM,OAAO,UAAkB,GAAG,KAAK,OAAO,OAAO,GAAG,GAAG,KAAK,OAAO,OAAO,GAAG,CAAC;;;;;;AAMlF,MAAM,QAAQ,OAAe,YAC3B,uBAAuB,EAAE,WAAW,MAAM,EAAE,GAAG,QAAQ,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KAAK,GAAG,EAAE,EACrH;;;;;;;;;;;;;;AAoBF,MAAa,UACX,QACA,UACA,cACe;CACf,MAAM,SAAiD,CAAC;CACxD,KAAK,MAAM,CAAC,OAAO,UAAU,OAAO,QAAQ,SAAS,GAAG;EACtD,MAAM,UAAkC,CAAC;EACzC,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,SAAS,CAAC,CAAC,GACpD,IAAI,OAAO,UAAU,UAAU,QAAQ,QAAQ;EAEjD,OAAO,SAAS;CAClB;CACA,OAAO,OAAO,GAAG,SAAS,GAAG,aAAa,MAAM,CAAC,CAAC,KAAK,GAAG,EAAE,EAAE;AAChE"}
package/dist/theme.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { i as StyleValue } from "./styleValue-DEsUAC4v.mjs";
2
2
  import { a as compose, c as ref, i as VAR_PREFIX, l as variables, n as Theme$1, o as define, r as ThemeTokens, s as lightDark, t as Refs } from "./core-Cq9PThXv.mjs";
3
- import { A as variables$1, C as make$1, D as set, E as schemaOf, F as Schemed, I as Variables, L as knob_d_exports, M as Choice, N as Control, O as tokensOf, P as Knob, S as describe, T as print, _ as PathOf, a as choose, b as Values, c as script, d as RootOptions, f as root, g as KnobTheme, h as KnobSet, i as apply, j as withValue, k as valueAt, l as standardOf, m as KnobAt, n as THEME_KEY, o as make, p as scoped, r as Themes$1, s as scope, t as StandardTokens, u as Overrides, v as Standard, w as paths, x as at, y as ValueOf } from "./themes-B9jxH5tK.mjs";
4
- import { a as concentric, c as nested, d as tokens, f as Palette, i as breakpointWidths, l as nests, n as Rung, o as inContainer, r as Tokens, s as ladder, t as Role, u as role } from "./tokens-D6z26O2A.mjs";
3
+ import { A as variables$1, C as make$1, D as set, E as schemaOf, F as Schemed, I as Variables, L as knob_d_exports, M as Choice, N as Control, O as tokensOf, P as Knob, S as describe, T as print, _ as PathOf, a as choose, b as Values, c as script, d as RootOptions, f as root, g as KnobTheme, h as KnobSet, i as apply, j as withValue, k as valueAt, l as standardOf, m as KnobAt, n as THEME_KEY, o as make, p as scoped, r as Themes$1, s as scope, t as StandardTokens, u as Overrides, v as Standard, w as paths, x as at, y as ValueOf } from "./themes-DF2Spo6_.mjs";
4
+ import { a as concentric, c as nested, d as tokens, f as Palette, i as breakpointWidths, l as nests, n as Rung, o as inContainer, r as Tokens, s as ladder, t as Role, u as role } from "./tokens-C4tC1NFW.mjs";
5
5
  import { Effect } from "effect";
6
6
  //#region src/theme/scheme.d.ts
7
7
  /** What a reader may choose: a scheme, or the operating system's. */
@@ -114,6 +114,10 @@ export declare const Knobs: {
114
114
  readonly 'state-ink': string;
115
115
  };
116
116
  }>;
117
+ readonly hoverStrength: Knob<number, "state-hover">;
118
+ };
119
+ readonly state: {
120
+ readonly disabledOpacity: Knob<number, "state-disabled">;
117
121
  };
118
122
  readonly shape: {
119
123
  readonly radius: Knob<number, "radius-factor">;
@@ -1 +1 @@
1
- {"version":3,"file":"theme.d.mts","names":["Knob.Knob","Knob.Schemed","Knob.Choice","ThemeSet.make","ThemeSet.apply","ThemeSet.choose","ThemeSet.script","Core.define","Core.ref","Core.lightDark","Core.compose","ThemeSet.standardOf","make","variables","ThemeSet.scope"],"sources":["../src/theme/scheme.ts","../src/theme/knobsKept.ts","../src/theme/raise.ts","../src/theme/iconMasks.ts","../src/theme.ts"],"mappings":";;;;;;;KAUY;;qBAGC;;;;;;;qBAWA,eAAY;;qBAIZ,qBAAoB;;;;;;qBAWpB,eAAY,QAAY,QAAM,iBAA6B,OAAO;;;;qBCtBlE;;;;;;qBAOA;;UAGI;;WAEN;;;;;;WAMA;;;UAIM,YAAY,UAAU,iBAAiB;;WAE7C,MAAM,UAAU;;;;;;;;qBAcd,eAAU,KAAA,aAA6C;;;;;;;qBAkCvD,cAAe,UAAU,SAAO,OACpC,UAAU,MAAE,MAAA,KAAA,YAC4B,YAAY,OAC1D,OAAO;;;;;;;qBClDG,QAAK,mBAAqB;;;;;;;;;qBAW1B;;;KCnDD;;;;qBCqEC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAOA;WACX,aAAIG;WACJ,cAAKC;WACL,eAAMC;WACN,eAAMC;;qBAWK"}
1
+ {"version":3,"file":"theme.d.mts","names":["Knob.Knob","Knob.Schemed","Knob.Choice","ThemeSet.make","ThemeSet.apply","ThemeSet.choose","ThemeSet.script","Core.define","Core.ref","Core.lightDark","Core.compose","ThemeSet.standardOf","make","variables","ThemeSet.scope"],"sources":["../src/theme/scheme.ts","../src/theme/knobsKept.ts","../src/theme/raise.ts","../src/theme/iconMasks.ts","../src/theme.ts"],"mappings":";;;;;;;KAUY;;qBAGC;;;;;;;qBAWA,eAAY;;qBAIZ,qBAAoB;;;;;;qBAWpB,eAAY,QAAY,QAAM,iBAA6B,OAAO;;;;qBCtBlE;;;;;;qBAOA;;UAGI;;WAEN;;;;;;WAMA;;;UAIM,YAAY,UAAU,iBAAiB;;WAE7C,MAAM,UAAU;;;;;;;;qBAcd,eAAU,KAAA,aAA6C;;;;;;;qBAkCvD,cAAe,UAAU,SAAO,OACpC,UAAU,MAAE,MAAA,KAAA,YAC4B,YAAY,OAC1D,OAAO;;;;;;;qBClDG,QAAK,mBAAqB;;;;;;;;;qBAW1B;;;KCnDD;;;;qBCqEC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAOA;WACX,aAAIG;WACJ,cAAKC;WACL,eAAMC;WACN,eAAMC;;qBAWK"}
package/dist/theme.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { _ as self, c as global, i as compose$1, r as classPiece } from "./styleValue-6hpAYYfg.mjs";
2
2
  import { a as lightDark, i as define, n as VAR_PREFIX, o as ref, r as compose, s as variables, t as Theme$1 } from "./core-BrR6UPbk.mjs";
3
- import { S as knob_exports, _ as tokensOf, a as nested, b as variables$1, c as tokens, d as make, f as paths, g as standard, h as set, i as ladder, l as at, m as schemaOf, n as concentric, o as nests, p as print, r as inContainer, s as role, t as breakpointWidths, u as describe, x as withValue, y as valueAt } from "./tokens-DIIMgir1.mjs";
4
- import { a as choose, c as script, i as apply, l as standardOf, n as scoped, o as make$1, r as THEME_KEY, s as scope, t as root, u as scriptLiteral } from "./root-BsyR6nwj.mjs";
3
+ import { S as knob_exports, _ as tokensOf, a as nested, b as variables$1, c as tokens, d as make, f as paths, g as standard, h as set, i as ladder, l as at, m as schemaOf, n as concentric, o as nests, p as print, r as inContainer, s as role, t as breakpointWidths, u as describe, x as withValue, y as valueAt } from "./tokens-CkTT9DNd.mjs";
4
+ import { a as choose, c as script, i as apply, l as standardOf, n as scoped, o as make$1, r as THEME_KEY, s as scope, t as root, u as scriptLiteral } from "./root-CT_iUZvD.mjs";
5
5
  import { Effect } from "effect";
6
6
  //#region src/theme/fonts.ts
7
7
  /**
@@ -1,7 +1,7 @@
1
1
  import { i as StyleValue } from "./styleValue-DEsUAC4v.mjs";
2
2
  import { t as Pipeable } from "./pipe-DrDyEhoj.mjs";
3
3
  import { a as compose, r as ThemeTokens } from "./core-Cq9PThXv.mjs";
4
- import { f as Palette, r as Tokens } from "./tokens-D6z26O2A.mjs";
4
+ import { f as Palette, r as Tokens } from "./tokens-C4tC1NFW.mjs";
5
5
  import { Effect, Option, Schema } from "effect";
6
6
  declare namespace knob_d_exports {
7
7
  export { Choice, Control, Knob, Schemed, Variables, angle, choice, font, length, number, percent, schemed };
@@ -140,6 +140,10 @@ declare const standard: {
140
140
  readonly 'state-ink': string;
141
141
  };
142
142
  }>;
143
+ readonly hoverStrength: Knob<number, "state-hover">;
144
+ };
145
+ readonly state: {
146
+ readonly disabledOpacity: Knob<number, "state-disabled">;
143
147
  };
144
148
  readonly shape: {
145
149
  readonly radius: Knob<number, "radius-factor">;
@@ -450,4 +454,4 @@ declare const choose: <Name extends string>(themes: Themes<Name>, name: Name, ke
450
454
  declare const scope: (theme: KnobTheme<Standard>, selector: string) => StyleValue;
451
455
  //#endregion
452
456
  export { variables as A, make$1 as C, set as D, schemaOf as E, Schemed as F, Variables as I, knob_d_exports as L, Choice as M, Control as N, tokensOf as O, Knob as P, describe as S, print as T, PathOf as _, choose as a, Values as b, script as c, RootOptions as d, root as f, KnobTheme as g, KnobSet as h, apply as i, withValue as j, valueAt as k, standardOf as l, KnobAt as m, THEME_KEY as n, make as o, scoped as p, Themes as r, scope as s, StandardTokens as t, Overrides as u, Standard as v, paths as w, at as x, ValueOf as y };
453
- //# sourceMappingURL=themes-B9jxH5tK.d.mts.map
457
+ //# sourceMappingURL=themes-DF2Spo6_.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themes-DF2Spo6_.d.mts","names":["Knob.Knob","Knob.Schemed","Knob.Choice","make","Knob.Variables"],"sources":["../src/theme/knob.ts","../src/theme/knobs.ts","../src/theme/root.ts","../src/theme/themes.ts"],"mappings":";;;;;;;;;KAUY,UAAU,iCAAiC,SAAS,OAAO;;KAG3D;WAEG;WACA;WACA;WACA;WACA;;WAEA;WAAyB,SAAS;;WAClC;;;;;;;UAOE,KAAK,OAAO;WAClB,QAAQ,OAAO,MAAM;;EAE9B,MAAM,OAAO,QAAQ,SAAS,QAAQ,OAAO;WACpC,OAAO,UAAU;;WAEjB,SAAS;;WAET;;WAEA;WACA,SAAS;;UAMV,MAAM;;WAEL,UAAU;WACV;;WAEA;WACA;WACA;WACA;WACA;WACA;;;cAqBE,eAXJ,qBAAmB,SA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string;
@@ -65,6 +64,8 @@ declare const palette: Readonly<{
65
64
  "shadow-strength": string;
66
65
  "shadow-xl": string;
67
66
  "shadow-xs": string;
67
+ "state-disabled": string;
68
+ "state-hover": string;
68
69
  "state-ink": string;
69
70
  step: string;
70
71
  "success-h": string;
@@ -141,6 +142,7 @@ declare const palette: Readonly<{
141
142
  };
142
143
  state: {
143
144
  hover: string;
145
+ press: string;
144
146
  tint: string;
145
147
  'tint-hover': string;
146
148
  edge: string;
@@ -151,6 +153,7 @@ declare const palette: Readonly<{
151
153
  inverted: string;
152
154
  ink: string;
153
155
  highlight: string;
156
+ press: string;
154
157
  'highlight-ink': string;
155
158
  blur: string;
156
159
  };
@@ -597,4 +600,4 @@ declare const breakpointWidths: (theme: {
597
600
  declare const inContainer: <Breakpoints extends Readonly<Record<string, string>>>(name: string, breakpoints: Breakpoints) => { readonly [K in keyof Breakpoints]: string; };
598
601
  //#endregion
599
602
  export { concentric as a, nested as c, tokens as d, Palette as f, breakpointWidths as i, nests as l, Rung as n, inContainer as o, Tokens as r, ladder as s, Role as t, role as u };
600
- //# sourceMappingURL=tokens-D6z26O2A.d.mts.map
603
+ //# sourceMappingURL=tokens-C4tC1NFW.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens-C4tC1NFW.d.mts","names":[],"sources":["../src/theme/oklch.ts","../src/theme/tokens.ts"],"mappings":";;;;;;cAoLa,SAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAWhB;IACA;IACA;IACA;;;IAGA;IAOA;IAIA;IACA;IACA;IACA;IAGA;;;IAMA;IACA;IACA;IACA;IACA;IACA;;;IAOA;IAGA;IACA;IACA;IAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAcA;;;IAoBA;IAIA;IACA;IAIA;IAIA;IACA;;;IAIA;IASA;IAKA;IACA;IAOA;IAKA;IACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAUA;IACA;IACA;IACA;IACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAeA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;;KAIQ,iBAAiB;;;cCtUhB,QAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgCf;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;;IAGA;IACA;IACA;IACA;IACA;IAEA;IAEA;;;IAGA;IACA;IACA;;;IAGA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;;IAGA;IACA;IACA;IACA;;;IAIA;IACA;IACA;IACA;IACA;;;IAGU;;;IAOV;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAIA;IAIA;;;IASA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;;IAQA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;;IAMA;IACA;IACA;IACA;;;;;;;;;;;;;;;;;IAUA;IACA;IACA;IACA;;;IAOA;IACA;IACA;IACA;IACA;IACA;IACA;IAIA;IACA;IACA;;;IAGA;IACA;IACA;IACA;;;IAMA;IACA;IACA;IACA;;;KAIQ,gBAAgB;;KAGhB,OAAO,cAAc;;;;;;;;;;;;cAapB,SAAM,MAAU;;;;;;;;;;;;;iBAmBb;iBACA,OAAO,eAAe,eAAe;;;;;;;;cAcxC,QAAK,gBACF,eACD;WAGJ;WACA;WACA;;;;;;;;;;;;;;cAmBE,aAAU;WAAuB;WAAsB;;;KAIxD;;;;;;cAOC,OAAI,MAAU;WAAkB;WAA2B;;;;;;;cAmB3D,mBAAgB;WAClB;cAAwB;;MAC/B,SAAS;;;;;;;;cA0BA,cAAe,oBAAoB,SAAS,yBAAuB,cAClE,aACC,4BACA,WAAW"}
@@ -364,8 +364,26 @@ const standard = {
364
364
  }
365
365
  },
366
366
  description: "What a hovered row or button is tinted with: a step of the surface, a plain grey, or the accent."
367
+ }),
368
+ hoverStrength: percent({
369
+ title: "Hover strength",
370
+ variable: "state-hover",
371
+ default: 12,
372
+ min: 4,
373
+ max: 24,
374
+ step: 1,
375
+ description: "How strongly a hovered row or button is tinted, a fluid highlight with it, and a press more."
367
376
  })
368
377
  },
378
+ state: { disabledOpacity: number({
379
+ title: "Disabled",
380
+ variable: "state-disabled",
381
+ default: .5,
382
+ min: .3,
383
+ max: .7,
384
+ step: .05,
385
+ description: "How far a disabled control fades: 0.5 is half, 1 draws it as any other."
386
+ }) },
369
387
  shape: {
370
388
  radius: number({
371
389
  title: "Radius",
@@ -1076,4 +1094,4 @@ const inContainer = (name, breakpoints) => Object.freeze(Object.fromEntries(Obje
1076
1094
  //#endregion
1077
1095
  export { knob_exports as S, tokensOf as _, nested as a, variables as b, tokens as c, make as d, paths as f, standard as g, set as h, ladder as i, at as l, schemaOf as m, concentric as n, nests as o, print as p, inContainer as r, role as s, breakpointWidths as t, describe as u, unsetOf as v, withValue as x, valueAt as y };
1078
1096
 
1079
- //# sourceMappingURL=tokens-DIIMgir1.mjs.map
1097
+ //# sourceMappingURL=tokens-CkTT9DNd.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens-CkTT9DNd.mjs","names":["Knob.angle","Knob.schemed","Knob.number","Knob.percent","Knob.choice","Knob.length","Knob.font"],"sources":["../src/theme/knob.ts","../src/theme/shadows.ts","../src/theme/knobs.ts","../src/theme/iconMasks.ts","../src/theme/tokens.ts"],"sourcesContent":["/**\n * Knobs: the typed inputs a theme sets. Each knob is a Schema for the value\n * a theme writes, the CSS variables that value writes, and what those\n * variables hold when no theme sets it (its default, or the expression it\n * follows). Every token derives from knob variables, so a theme is only its\n * knob values (`docs/theme-knobs.md`).\n */\nimport { Schema } from 'effect'\n\n/** A knob's variables, by the name after `--fk-knob-`, each a CSS value. */\nexport type Variables<Names extends string = string> = Readonly<Record<Names, string>>\n\n/** How a knob is drawn as a control: a range for a number, a choice of options, a font stack. */\nexport type Control =\n | {\n readonly kind: 'range'\n readonly min: number\n readonly max: number\n readonly step: number\n readonly unit: string\n }\n | { readonly kind: 'choice'; readonly options: ReadonlyArray<string> }\n | { readonly kind: 'font' }\n\n/**\n * A knob of `Value` writing the variables `Names`. `write` gives those a\n * value sets (a light-only value leaves the dark one out); `unset` gives\n * every one, as no theme set it.\n */\nexport interface Knob<Value, Names extends string = string> {\n readonly schema: Schema.Codec<Value>\n /** A method, so a knob of any value is a `Knob<unknown>`. */\n write(value: Value): Readonly<Partial<Record<Names, string>>>\n readonly unset: Variables<Names>\n /** The value it stands at unset: a control's starting point. */\n readonly default: Value\n /** What the knob is called: a control's label. */\n readonly title: string\n /** What the knob does, in a sentence: a control's tooltip. */\n readonly description: string\n readonly control: Control\n}\n\n/** A computed number without float noise: `0.02`, not `0.019999999999999997`. */\nconst num = (value: number) => String(Number(value.toFixed(4)))\n\ninterface Range<Name extends string> {\n /** The variable it writes, the name after `--fk-knob-`. */\n readonly variable: Name\n readonly default: number\n /** A CSS expression it holds while unset, in place of `default` (`var(--fk-hue-accent)`). */\n readonly follows?: string\n readonly min: number\n readonly max: number\n readonly step: number\n readonly title: string\n readonly description: string\n}\n\n/** `{ [name]: value }` with its one key's name kept in its type. */\nconst one = <Name extends string>(name: Name, value: string) =>\n ({ [name]: value }) as Variables<Name>\n\n/** A number written with `unit` after it, refused outside `min` to `max`. */\nconst ranged =\n (unit: string) =>\n <const Name extends string>(options: Range<Name>): Knob<number, Name> => ({\n schema: Schema.Number.check(Schema.isBetween({ minimum: options.min, maximum: options.max })),\n write: value => one(options.variable, `${num(value)}${unit}`),\n unset: one(options.variable, options.follows ?? `${num(options.default)}${unit}`),\n default: options.default,\n title: options.title,\n description: options.description,\n control: { kind: 'range', min: options.min, max: options.max, step: options.step, unit },\n })\n\n/** A plain number: a multiplier, a chroma. */\nexport const number = ranged('')\n/** A number of degrees around the hue wheel. */\nexport const angle = <const Name extends string>(\n options: Omit<Range<Name>, 'min' | 'max' | 'step'> &\n Partial<Pick<Range<Name>, 'min' | 'max' | 'step'>>,\n) => number({ min: -360, max: 360, step: 1, ...options })\n/** A percentage, written with `%`. */\nexport const percent = ranged('%')\n/** A length in `unit`, written with it (`1px`, `-0.025em`). */\nexport const length = (unit: 'px' | 'em' | 'rem') => ranged(unit)\n\n/**\n * A value per scheme: `{ light, dark }`, or a bare value for the light scheme\n * alone, the dark keeping its default (a theme's accent lightness rarely\n * suits a dark page). `dark` is the knob for the dark variable.\n */\n/** A knob per scheme, and each half as a knob of its own: its range, its title. */\nexport interface Schemed<Light extends string, Dark extends string> extends Knob<\n number | { readonly light?: number; readonly dark?: number },\n Light | Dark\n> {\n readonly light: Knob<number, Light>\n readonly dark: Knob<number, Dark>\n}\n\nexport const schemed = <Light extends string, Dark extends string>(\n light: Knob<number, Light>,\n dark: Knob<number, Dark>,\n): Schemed<Light, Dark> => ({\n light,\n dark,\n schema: Schema.Union([\n light.schema,\n Schema.Struct({\n light: Schema.optionalKey(light.schema),\n dark: Schema.optionalKey(dark.schema),\n }),\n ]),\n // Light's variables, dark's, or both: each a partial record of the two\n // (TypeScript does not widen a record over generic keys by itself).\n write: value =>\n (typeof value === 'number'\n ? light.write(value)\n : {\n ...(value.light === undefined ? {} : light.write(value.light)),\n ...(value.dark === undefined ? {} : dark.write(value.dark)),\n }) as Readonly<Partial<Record<Light | Dark, string>>>,\n unset: { ...light.unset, ...dark.unset },\n default: { light: light.default, dark: dark.default },\n title: light.title,\n description: light.description,\n control: light.control,\n})\n\n/** A choice's options: every one writes the same variables. */\ntype Options = Readonly<Record<string, Variables>>\n\n/** The variables every option of `O` writes. */\ntype Written<O extends Options> = keyof O[keyof O] & string\n\n/** A knob that is one of its `options`, each in full, as `write` gives a chosen one. */\nexport interface Choice<O extends Options> extends Knob<keyof O & string, Written<O>> {\n readonly options: { readonly [K in keyof O]: Variables<Written<O>> }\n}\n\n/**\n * One of `options`, each the variables it writes: choosing `spring` writes\n * the ease variable as `var(--fk-motion-spring)`. Every option names the\n * same variables, so switching writes each again.\n */\nexport const choice = <const O extends Options>(options: {\n readonly default: keyof O & string\n readonly options: O\n readonly title: string\n readonly description: string\n}): Choice<O> => {\n const names = Object.keys(options.options) as ReadonlyArray<keyof O & string>\n return {\n schema: Schema.Literals(names),\n write: value => options.options[value]!,\n unset: options.options[options.default]!,\n options: options.options,\n default: options.default,\n title: options.title,\n description: options.description,\n control: { kind: 'choice', options: names },\n }\n}\n\n/** A font stack: any non-empty CSS `font-family` value. */\nexport const font = <const Name extends string>(options: {\n readonly variable: Name\n readonly default: string\n readonly follows?: string\n readonly title: string\n readonly description: string\n}): Knob<string, Name> => ({\n schema: Schema.NonEmptyString,\n write: value => one(options.variable, value),\n unset: one(options.variable, options.follows ?? options.default),\n default: options.default,\n title: options.title,\n description: options.description,\n control: { kind: 'font' },\n})\n","/**\n * The shadow lists the shadow knobs choose between: the elevation scale drawn\n * soft or hard (`shadow.style`), and a control's relief (`shadow.relief`).\n * Each is drawn in `shadow.color`, which a palette sets, and faded by the\n * `shadow-strength` knob.\n */\n\nconst shade = 'var(--fk-shadow-color, oklch(0% 0 0 / 0.12))'\nconst strength = 'var(--fk-knob-shadow-strength, 100%)'\n\n/** No shadow, as a shadow: one a transition can interpolate from, unlike `none`. */\nexport const FLAT = '0 0 #0000'\n\n/** Layers in the shadow's color, faded by `shadow-strength`. */\nexport const shadow = (...layers: ReadonlyArray<string>) =>\n layers.map(layer => `${layer} color-mix(in oklch, ${shade} ${strength}, transparent)`).join(', ')\n\n/** A hard step: the shadow's color, nearly opaque, offset with no blur. */\nconst hard = (offset: number) =>\n `${offset}px ${offset}px 0 0 color-mix(in oklch, oklch(from ${shade} l c h / 0.9) ${strength}, transparent)`\n\n/** An edge of a bevel: `color` faded by `shadow-strength`, as every shadow is. */\nconst edge = (color: string) => `color-mix(in oklch, ${color} ${strength}, transparent)`\n/** Lit from the top left: white, dimmer in a dark scheme, where white would glare. */\nconst lit = (alpha: number, darkAlpha: number) =>\n edge(`light-dark(oklch(100% 0 0 / ${alpha}), oklch(100% 0 0 / ${darkAlpha}))`)\nconst shaded = (alpha: number) => edge(`oklch(from ${shade} l c h / ${alpha})`)\n\n/**\n * Two rings of edges, lit at the top left and shaded at the bottom right,\n * flipped when sunken. Raised, the outer ring is drawn outside the\n * border: a button's border carries its fill, and an inset ring lay inside\n * it, so its darkest edge sat within a line of the button's own color.\n */\nconst raisedBevel = [\n `1px 1px 0 0 ${shaded(0.9)}`,\n `-1px -1px 0 0 ${lit(1, 0.3)}`,\n `inset -1px -1px 0 0 ${shaded(0.4)}`,\n `inset 1px 1px 0 0 ${lit(0.5, 0.12)}`,\n].join(', ')\nconst sunkenBevel = [\n `inset 1px 1px 0 0 ${shaded(0.9)}`,\n `inset -1px -1px 0 0 ${lit(1, 0.3)}`,\n `inset 2px 2px 0 0 ${shaded(0.4)}`,\n `inset -2px -2px 0 0 ${lit(0.5, 0.12)}`,\n].join(', ')\n\n/**\n * Raised a little to a lot: a pressed control, a lifted cell, a menu, a\n * dialog. Soft, each step is a tight contact layer plus a wide ambient one,\n * so large surfaces diffuse instead of ringing; `2xl` is the modal step.\n * Hard, as retro and brutalist interfaces draw it, each step is a solid\n * offset copy, deeper the higher it sits.\n */\nexport const elevation = {\n soft: {\n xs: shadow('0 1px 2px 0'),\n sm: shadow('0 1px 3px 0', '0 1px 2px -1px'),\n md: shadow('0 4px 6px -1px', '0 2px 4px -2px'),\n lg: shadow('0 12px 28px -8px', '0 4px 8px -4px'),\n xl: shadow('0 24px 48px -12px', '0 8px 16px -8px'),\n '2xl': shadow('0 32px 64px -16px', '0 12px 24px -12px'),\n inset: shadow('inset 0 2px 4px 0'),\n },\n hard: {\n xs: hard(1),\n sm: hard(2),\n md: hard(3),\n lg: hard(4),\n xl: hard(6),\n '2xl': hard(8),\n inset: `inset ${hard(2)}`,\n },\n} as const\n\n/**\n * How controls stand off the page: a button's resting shadow (`raised`), the\n * one it takes held or on (`pressed`), and a field's well (`field`). `flat`\n * gives them none; `soft` lifts buttons a hair and sinks fields a hair;\n * `hard` drops solid offset copies; `bevel` draws lit and shaded edges, the\n * raised and sunken chrome of a 1990s desktop.\n */\nexport const reliefs = {\n flat: { raised: FLAT, pressed: FLAT, field: FLAT },\n soft: {\n raised: shadow('0 1px 2px 0'),\n pressed: shadow('inset 0 1px 2px 0'),\n field: shadow('inset 0 1px 2px 0'),\n },\n hard: { raised: hard(2), pressed: hard(1), field: hard(2) },\n bevel: { raised: raisedBevel, pressed: sunkenBevel, field: sunkenBevel },\n} as const\n\n/** `lists` as knob variables, each name prefixed: `{ xs }` to `{ 'shadow-xs' }`. */\nexport const asVariables = <const P extends string, L extends Readonly<Record<string, string>>>(\n prefix: P,\n lists: L,\n) =>\n Object.fromEntries(Object.entries(lists).map(([name, list]) => [`${prefix}-${name}`, list])) as {\n readonly [K in keyof L & string as `${P}-${K}`]: string\n }\n","/**\n * The standard knobs, and a theme as a typed set of their values.\n *\n * `Knobs.standard` is every knob the shipped tokens and palette read, grouped\n * by concern. A theme (`Theme.make`) holds the values it sets and nothing\n * else; `Theme.variables` writes them, every knob it leaves unset holding its\n * default or the expression it follows (`docs/theme-knobs.md`).\n */\nimport { Option, Schema } from 'effect'\nimport { pipeSelf, type Pipeable } from '../pipe.js'\nimport { define } from './core.js'\nimport * as Knob from './knob.js'\nimport { asVariables, elevation, reliefs } from './shadows.js'\n\n/** Knobs grouped one level deep: `{ shape: { radius: Knob.number(...) } }`. */\nexport type KnobSet = {\n readonly [group: string]: { readonly [name: string]: Knob.Knob<unknown> }\n}\n\n/** The value a theme writes to `K`. */\nexport type ValueOf<K> = K extends Knob.Knob<infer V> ? V : never\n\n/** Values for some of `S`'s knobs, by group and name. */\nexport type Values<S extends KnobSet> = {\n readonly [G in keyof S]?: { readonly [N in keyof S[G]]?: ValueOf<S[G][N]> }\n}\n\nconst hue = <const Name extends string>(\n variable: Name,\n value: number,\n title: string,\n description: string,\n) => Knob.angle({ variable, default: value, min: 0, max: 360, title, description })\nconst ref = (group: string, name: string) => `var(--fk-${group}-${name})`\n\nexport const standard = {\n accent: {\n hue: Knob.angle({\n title: 'Hue',\n variable: 'accent-h',\n default: 264,\n min: 0,\n max: 360,\n description:\n 'The accent’s place on the color wheel, in degrees: about 25 is red, 145 green, 264 blue. Buttons, links, focus rings and selections take it.',\n }),\n chroma: Knob.schemed(\n Knob.number({\n title: 'Chroma',\n variable: 'accent-c',\n default: 0.17,\n min: 0,\n max: 0.4,\n step: 0.005,\n description:\n 'How vivid the accent is. 0 is grey; around 0.2 is as vivid as most screens show.',\n }),\n Knob.number({\n title: 'Chroma, dark',\n variable: 'accent-c-dark',\n default: 0.2,\n // A little stronger on a dark page, where the same chroma reads duller.\n follows: `min(0.4, calc(${ref('knob', 'accent-c')} + 0.03))`,\n min: 0,\n max: 0.4,\n step: 0.005,\n description: 'How vivid the accent is in the dark scheme.',\n }),\n ),\n lightness: Knob.schemed(\n Knob.percent({\n title: 'Lightness',\n variable: 'accent-l',\n default: 52,\n min: 5,\n max: 98,\n step: 1,\n description:\n 'How light the accent is in the light scheme: near 10 a black accent, as shadcn’s.',\n }),\n Knob.percent({\n title: 'Lightness, dark',\n variable: 'accent-l-dark',\n default: 70,\n min: 5,\n max: 98,\n step: 1,\n description: 'How light the accent is in the dark scheme.',\n }),\n ),\n secondaryShift: Knob.angle({\n title: 'Secondary hue shift',\n variable: 'secondary-shift',\n default: 60,\n description: 'Degrees from the accent’s hue to the secondary family’s.',\n }),\n tertiaryShift: Knob.angle({\n title: 'Tertiary hue shift',\n variable: 'tertiary-shift',\n default: -90,\n description: 'Degrees from the accent’s hue to the tertiary family’s.',\n }),\n },\n surface: {\n hue: Knob.angle({\n title: 'Neutral hue',\n variable: 'neutral-h',\n default: 264,\n follows: ref('hue', 'accent'),\n min: 0,\n max: 360,\n description:\n 'The hue the neutrals are mixed from: the page, text and borders. Unset, the accent’s own.',\n }),\n saturation: Knob.schemed(\n Knob.number({\n title: 'Surface tint',\n variable: 'surface-c',\n default: 0.015,\n min: 0,\n max: 0.04,\n step: 0.001,\n description: 'How much the page, cards and borders lean toward their hue. 0 is pure grey.',\n }),\n Knob.number({\n title: 'Surface tint, dark',\n variable: 'surface-c-dark',\n default: 0.02,\n follows: `calc(${ref('knob', 'surface-c')} * 4 / 3)`,\n min: 0,\n max: 0.04,\n step: 0.001,\n description: 'How much the dark scheme’s surfaces lean toward their hue.',\n }),\n ),\n lightness: Knob.schemed(\n Knob.percent({\n title: 'Page lightness',\n variable: 'base-l',\n default: 97.5,\n min: 75,\n max: 100,\n step: 0.5,\n description:\n 'How light the page is in the light scheme. Cards, fields and hovers step from it.',\n }),\n Knob.percent({\n title: 'Page lightness, dark',\n variable: 'base-l-dark',\n default: 22,\n min: 6,\n max: 36,\n step: 0.5,\n description:\n 'How light the page is in the dark scheme. Cards, fields and hovers step from it.',\n }),\n ),\n contrast: Knob.percent({\n title: 'Surface contrast',\n variable: 'surface-contrast',\n default: 26,\n min: 0,\n max: 100,\n step: 1,\n description:\n 'How far apart the surface steps are: the page, a card on it, a field, a hover. Low is flat; high sets each apart.',\n }),\n textContrast: Knob.number({\n title: 'Text contrast',\n variable: 'contrast-factor',\n default: 1,\n min: 0,\n max: 2,\n step: 0.05,\n description: 'Multiplies the text’s chroma.',\n }),\n hover: Knob.choice({\n title: 'Hover',\n default: 'surface',\n options: {\n surface: { 'surface-ink': '1', 'state-ink': 'currentColor' },\n neutral: { 'surface-ink': '0', 'state-ink': 'currentColor' },\n accent: { 'surface-ink': '1', 'state-ink': ref('accent', 'ink') },\n },\n description:\n 'What a hovered row or button is tinted with: a step of the surface, a plain grey, or the accent.',\n }),\n hoverStrength: Knob.percent({\n title: 'Hover strength',\n variable: 'state-hover',\n default: 12,\n min: 4,\n max: 24,\n step: 1,\n description:\n 'How strongly a hovered row or button is tinted, a fluid highlight with it, and a press more.',\n }),\n },\n state: {\n disabledOpacity: Knob.number({\n title: 'Disabled',\n variable: 'state-disabled',\n default: 0.5,\n min: 0.3,\n max: 0.7,\n step: 0.05,\n description: 'How far a disabled control fades: 0.5 is half, 1 draws it as any other.',\n }),\n },\n shape: {\n radius: Knob.number({\n title: 'Radius',\n variable: 'radius-factor',\n default: 1,\n min: 0,\n max: 2.5,\n step: 0.05,\n description:\n 'Multiplies every corner. 0 is square. A control inside a card keeps inside the card’s corner.',\n }),\n density: Knob.number({\n title: 'Density',\n variable: 'density',\n default: 1,\n min: 0.75,\n max: 1.3,\n step: 0.05,\n description:\n 'Multiplies spacing: padding, gaps and margins. Below 1 is tighter, above 1 roomier.',\n }),\n size: Knob.choice({\n title: 'Size',\n default: 'default',\n options: { default: { step: '0' }, compact: { step: '1' } },\n description: 'How tall controls are: 36px, or a compact 28px.',\n }),\n controls: Knob.choice({\n title: 'Buttons',\n default: 'rounded',\n options: { rounded: { 'control-round': '0' }, pill: { 'control-round': '1' } },\n description: 'The corners of buttons: the radius’s, or fully round pills.',\n }),\n border: Knob.length('px')({\n title: 'Border',\n variable: 'border-width',\n default: 1,\n min: 1,\n max: 3,\n step: 1,\n description: 'The thinnest border’s width; the thicker ones step up from it.',\n }),\n // How much of the text's own ink the outlines take over the palette's\n // lines, at three strengths for subtle, default and overt.\n outlines: Knob.choice({\n title: 'Outlines',\n default: 'soft',\n options: {\n soft: {\n 'outline-ink': '0',\n 'outline-ink-subtle': '0%',\n 'outline-ink-default': '0%',\n 'outline-ink-overt': '0%',\n },\n strong: {\n 'outline-ink': '1',\n 'outline-ink-subtle': '22%',\n 'outline-ink-default': '48%',\n 'outline-ink-overt': '72%',\n },\n ink: {\n 'outline-ink': '1',\n 'outline-ink-subtle': '45%',\n 'outline-ink-default': '88%',\n 'outline-ink-overt': '100%',\n },\n },\n description:\n 'How much borders show: the palette’s soft lines, darker ones, or lines in the text’s own ink.',\n }),\n },\n type: {\n body: Knob.font({\n title: 'Font',\n variable: 'font-body',\n default: 'system-ui, sans-serif',\n description: 'The typeface for body text and controls.',\n }),\n heading: Knob.font({\n title: 'Heading font',\n variable: 'font-heading',\n default: 'inherit',\n description: 'The typeface for headings. `inherit` is the body’s.',\n }),\n headingWeight: Knob.number({\n title: 'Heading weight',\n variable: 'heading-weight',\n default: 600,\n min: 100,\n max: 900,\n step: 100,\n description: 'How bold headings are, from 300 (light) to 900 (black).',\n }),\n headingTracking: Knob.length('em')({\n title: 'Heading tracking',\n variable: 'heading-tracking',\n default: -0.01,\n min: -0.05,\n max: 0.05,\n step: 0.005,\n description:\n 'Headings’ letter spacing, in em: negative draws letters together, positive spreads them.',\n }),\n scale: Knob.number({\n title: 'Text size',\n variable: 'text-scale',\n default: 1,\n min: 0.8,\n max: 1.3,\n step: 0.025,\n description: 'Multiplies every text size, headings and body alike.',\n }),\n headingScale: Knob.number({\n title: 'Heading scale',\n variable: 'heading-scale',\n default: 1,\n min: 0.4,\n max: 1.8,\n step: 0.05,\n description:\n 'How far headings stand above body text: below 1 nearer its size, above 1 larger.',\n }),\n leading: Knob.number({\n title: 'Line height',\n variable: 'leading',\n default: 1,\n min: 0.85,\n max: 1.3,\n step: 0.05,\n description: 'Multiplies line height, the space each line of text takes.',\n }),\n },\n icon: {\n size: Knob.number({\n title: 'Icon size',\n variable: 'icon-scale',\n default: 1,\n min: 0.75,\n max: 1.5,\n step: 0.05,\n description:\n 'Multiplies every icon a component draws, beside its words: 1 is 16px, or 14px compact.',\n }),\n stroke: Knob.length('px')({\n title: 'Glyph stroke',\n variable: 'glyph-width',\n default: 2,\n min: 1,\n max: 3,\n step: 0.25,\n description:\n 'The width of the strokes components draw themselves: checks, chevrons, a tree’s guides. An icon pack keeps its own.',\n }),\n },\n motion: {\n scale: Knob.number({\n title: 'Motion',\n variable: 'motion',\n default: 1,\n min: 0,\n max: 2,\n step: 0.1,\n description: 'Multiplies how long every transition takes. 0 stills them; 2 is twice as slow.',\n }),\n easing: Knob.choice({\n title: 'Easing',\n default: 'ease',\n options: { ease: { ease: 'ease-out' }, spring: { ease: ref('motion', 'spring') } },\n description: 'How transitions move: along an easing curve, or on a spring that settles.',\n }),\n },\n shadow: {\n style: Knob.choice({\n title: 'Shadows',\n default: 'soft',\n options: {\n soft: asVariables('shadow', elevation.soft),\n hard: asVariables('shadow', elevation.hard),\n },\n description: 'Shadows that diffuse softly, or hard, solid offset copies.',\n }),\n relief: Knob.choice({\n title: 'Controls',\n default: 'flat',\n options: {\n flat: asVariables('relief', reliefs.flat),\n soft: asVariables('relief', reliefs.soft),\n hard: asVariables('relief', reliefs.hard),\n bevel: asVariables('relief', reliefs.bevel),\n },\n description:\n 'How buttons stand off the page and fields sink into it: flat, or a soft, hard or bevelled edge.',\n }),\n strength: Knob.percent({\n title: 'Shadow',\n variable: 'shadow-strength',\n default: 100,\n min: 0,\n max: 100,\n step: 1,\n description: 'How strong shadows are. 0 removes them.',\n }),\n hue: Knob.angle({\n title: 'Shadow hue',\n variable: 'shadow-h',\n default: 264,\n follows: ref('hue', 'neutral'),\n min: 0,\n max: 360,\n description: 'The hue every shadow is tinted with. Unset, the neutrals’.',\n }),\n chroma: Knob.number({\n title: 'Shadow tint',\n variable: 'shadow-c',\n default: 0.03,\n follows: `calc(${ref('knob', 'surface-c')} * 2)`,\n min: 0,\n max: 0.1,\n step: 0.005,\n description: 'How tinted every shadow is. Unset, twice the surfaces’ saturation.',\n }),\n },\n menu: {\n highlight: Knob.choice({\n title: 'Menu accent',\n default: 'subtle',\n options: { subtle: { 'popup-bold': '0' }, bold: { 'popup-bold': '1' } },\n description:\n 'How the highlighted row of a menu shows: a subtle tint, or filled with the accent.',\n }),\n panel: Knob.choice({\n title: 'Menu color',\n default: 'default',\n options: {\n default: { 'popup-invert': '0', 'popup-alpha': '1', 'popup-blur': '0px' },\n inverted: { 'popup-invert': '1', 'popup-alpha': '1', 'popup-blur': '0px' },\n translucent: { 'popup-invert': '0', 'popup-alpha': '0.8', 'popup-blur': '12px' },\n 'inverted-translucent': { 'popup-invert': '1', 'popup-alpha': '0.8', 'popup-blur': '12px' },\n },\n description:\n 'The background of menus and popovers: the page’s, inverted (dark on a light page), or translucent, the page blurred behind it.',\n }),\n },\n feedback: {\n success: hue('success-h', 145, 'Success', 'The hue of success: a saved form, a passing check.'),\n warning: hue('warning-h', 75, 'Warning', 'The hue of a warning.'),\n error: hue('error-h', 25, 'Error', 'The hue of an error: a refused field, a failed save.'),\n info: hue('info-h', 245, 'Info', 'The hue of a neutral notice.'),\n },\n code: {\n chroma: Knob.number({\n title: 'Code chroma',\n variable: 'syntax-c',\n default: 0.14,\n min: 0,\n max: 0.4,\n step: 0.01,\n description: 'How vivid code’s colors are.',\n }),\n },\n chart: {\n hue: hue(\n 'chart-h',\n 255,\n 'Chart hue',\n 'The first chart series’ hue; the other four keep their places around it.',\n ),\n },\n scales: {\n chroma: Knob.number({\n title: 'Scale vividness',\n variable: 'scale-c',\n default: 1,\n min: 0,\n max: 1.5,\n step: 0.05,\n description:\n 'How vivid the seven color scales are, as a share of each step’s own. 0 turns them grey.',\n }),\n red: hue('red-h', 25, 'Red', 'The red scale’s hue.'),\n orange: hue('orange-h', 55, 'Orange', 'The orange scale’s hue.'),\n yellow: hue('yellow-h', 90, 'Yellow', 'The yellow scale’s hue.'),\n green: hue('green-h', 145, 'Green', 'The green scale’s hue.'),\n teal: hue('teal-h', 185, 'Teal', 'The teal scale’s hue.'),\n blue: hue('blue-h', 255, 'Blue', 'The blue scale’s hue.'),\n purple: hue('purple-h', 300, 'Purple', 'The purple scale’s hue.'),\n },\n} as const satisfies KnobSet\n\nexport type Standard = typeof standard\n\n/** A theme: the knobs it may set, the values it sets, and what it is called in a list. */\nexport interface KnobTheme<S extends KnobSet = Standard> extends Pipeable<KnobTheme<S>> {\n readonly knobs: S\n readonly values: Values<S>\n readonly title: Option.Option<string>\n readonly description: Option.Option<string>\n}\n\nconst theme = <S extends KnobSet>(\n knobs: S,\n values: Values<S>,\n title: Option.Option<string>,\n description: Option.Option<string>,\n): KnobTheme<S> => ({\n knobs,\n values,\n title,\n description,\n pipe(...fns: ReadonlyArray<(self: KnobTheme<S>) => KnobTheme<S>>) {\n return pipeSelf(this, fns) as KnobTheme<S>\n },\n})\n\n/** Each value checked against its knob: an unknown group or knob, or a value out of range, throws. */\nconst checked = <S extends KnobSet>(knobs: S, values: Values<S>): Values<S> => {\n for (const [group, names] of Object.entries(values)) {\n if (!Object.hasOwn(knobs, group)) throw new Error(`Theme: no knob group \"${group}\".`)\n for (const [name, value] of Object.entries(names ?? {})) {\n if (!Object.hasOwn(knobs[group]!, name)) throw new Error(`Theme: no knob \"${group}.${name}\".`)\n Schema.decodeUnknownSync(knobs[group]![name]!.schema)(value)\n }\n }\n return values\n}\n\n/**\n * A theme of the standard knobs, or of `knobs`: the values it sets, checked,\n * every other knob keeping its default. A misspelt knob or a choice outside\n * its options is a type error; a number out of its range throws here.\n */\nexport function make(values: Values<Standard>): KnobTheme<Standard>\nexport function make<S extends KnobSet>(knobs: S, values: Values<NoInfer<S>>): KnobTheme<S>\nexport function make(...args: [Values<Standard>] | [KnobSet, Values<KnobSet>]): KnobTheme<KnobSet> {\n const [knobs, values] = args.length === 1 ? [standard, args[0]] : args\n return theme(knobs, checked(knobs, values), Option.none(), Option.none())\n}\n\n/** `theme` with `values` over its own, group by group. */\nexport const set =\n <S extends KnobSet>(values: Values<NoInfer<S>>) =>\n (self: KnobTheme<S>): KnobTheme<S> => {\n const merged: Record<string, Record<string, unknown>> = {}\n for (const source of [self.values, checked(self.knobs, values)])\n for (const [group, names] of Object.entries(source))\n merged[group] = { ...merged[group], ...names }\n return theme(self.knobs, merged as Values<S>, self.title, self.description)\n }\n\n/** A title and a description for a list of themes; neither is the theme's identity. */\nexport const describe =\n (meta: { readonly title?: string; readonly description?: string }) =>\n <S extends KnobSet>(self: KnobTheme<S>): KnobTheme<S> =>\n theme(\n self.knobs,\n self.values,\n meta.title === undefined ? self.title : Option.some(meta.title),\n meta.description === undefined ? self.description : Option.some(meta.description),\n )\n\n/** Every knob variable `self` declares: the values it sets, and every other knob's unset value. */\nexport const variables = <S extends KnobSet>(self: KnobTheme<S>): Knob.Variables => {\n const declared: Record<string, string> = {}\n for (const [group, knobs] of Object.entries(self.knobs))\n for (const [name, knob] of Object.entries(knobs)) {\n const value = (self.values[group] as Readonly<Record<string, unknown>> | undefined)?.[name]\n Object.assign(declared, knob.unset, value === undefined ? {} : knob.write(value))\n }\n return declared\n}\n\ntype Intersected<U> = (U extends unknown ? (union: U) => void : never) extends (\n meet: infer I,\n) => void\n ? I\n : never\n\n/** What every knob of `knobs` writes unset, under its variables' own names. */\nexport const unsetOf = <S extends KnobSet>(\n knobs: S,\n): Intersected<{ [G in keyof S]: { [K in keyof S[G]]: S[G][K]['unset'] }[keyof S[G]] }[keyof S]> =>\n Object.assign(\n {},\n ...Object.values(knobs).flatMap(group => Object.values(group).map(knob => knob.unset)),\n )\n\n/** `self`'s knob variables as tokens, for `Theme.root` and `Theme.scoped`. */\nexport const tokensOf = <S extends KnobSet>(self: KnobTheme<S>) => define({ knob: variables(self) })\n\n/**\n * The Schema of a theme's values over `knobs`: each group and knob optional,\n * each value checked by its knob, for a Model field or a decoded URL. Decode\n * with `onExcessProperty: 'error'` where an unknown key must be refused\n * rather than dropped.\n */\nexport const schemaOf = <S extends KnobSet>(knobs: S): Schema.Codec<Values<S>> =>\n // Built from `knobs` group by group, so its type is `Values<S>` by construction.\n Schema.Struct(\n Object.fromEntries(\n Object.entries(knobs).map(([group, names]) => [\n group,\n Schema.optionalKey(\n Schema.Struct(\n Object.fromEntries(\n Object.entries(names).map(([name, knob]) => [name, Schema.optionalKey(knob.schema)]),\n ),\n ),\n ),\n ]),\n ),\n ) as unknown as Schema.Codec<Values<S>>\n\nconst literal = (value: unknown): string =>\n typeof value === 'string'\n ? `'${value.replaceAll('\\\\', '\\\\\\\\').replaceAll(\"'\", \"\\\\'\")}'`\n : typeof value === 'object' && value !== null\n ? `{ ${Object.entries(value)\n .map(([key, each]) => `${key}: ${literal(each)}`)\n .join(', ')} }`\n : String(value)\n\n/**\n * Whether `value` changes nothing the knob writes unset: a bare `0.17` for a\n * schemed knob whose dark half follows is its default, though it is no\n * `{ light, dark }`.\n */\nconst atDefault = (knob: Knob.Knob<unknown>, value: unknown): boolean =>\n Object.entries(knob.write(value)).every(([name, css]) => knob.unset[name] === css)\n\n/**\n * The source of `self` as `Theme.make({ … })`: each knob it sets that writes\n * other than the knob's default does, a group to a line (a knob a line past\n * a hundred characters), so the code an application\n * pastes says only what makes the theme its own.\n */\nexport const print = <S extends KnobSet>(self: KnobTheme<S>): string => {\n const groups = Object.entries(self.knobs).flatMap(([group, knobs]) => {\n const values = (self.values[group] ?? {}) as Readonly<Record<string, unknown>>\n const set = Object.entries(knobs).flatMap(([name, knob]) => {\n const value = values[name]\n return value === undefined || atDefault(knob, value) ? [] : [`${name}: ${literal(value)}`]\n })\n if (set.length === 0) return []\n const line = ` ${group}: { ${set.join(', ')} },`\n // A group past the width a formatter keeps breaks to a knob a line, as one would.\n return line.length <= 100\n ? [line]\n : [` ${group}: {`, ...set.map(each => ` ${each},`), ' },']\n })\n return groups.length === 0 ? 'Theme.make({})' : ['Theme.make({', ...groups, '})'].join('\\n')\n}\n\n/** One knob of `S`, by its group and name: `shape.radius`. */\nexport type PathOf<S extends KnobSet> = {\n readonly [G in keyof S & string]: `${G}.${keyof S[G] & string}`\n}[keyof S & string]\n\n/** The knob of `S` at `P`. */\nexport type KnobAt<S extends KnobSet, P extends PathOf<S>> = P extends `${infer G}.${infer N}`\n ? G extends keyof S\n ? N extends keyof S[G]\n ? S[G][N]\n : never\n : never\n : never\n\nconst split = (path: string): readonly [string, string] => {\n const dot = path.indexOf('.')\n return [path.slice(0, dot), path.slice(dot + 1)]\n}\n\n/** Every knob's path in `knobs`, in the order they are declared. */\nexport const paths = <S extends KnobSet>(knobs: S): ReadonlyArray<PathOf<S>> =>\n Object.entries(knobs).flatMap(([group, names]) =>\n Object.keys(names).map(name => `${group}.${name}`),\n ) as ReadonlyArray<PathOf<S>>\n\n/** The knob at `path`. */\nexport const at = <S extends KnobSet, P extends PathOf<S>>(knobs: S, path: P): KnobAt<S, P> => {\n const [group, name] = split(path)\n return knobs[group]![name] as KnobAt<S, P>\n}\n\n/** What `values` set the knob at `path` to, or its default. */\nexport const valueAt = <S extends KnobSet, P extends PathOf<S>>(\n knobs: S,\n values: Values<S>,\n path: P,\n): ValueOf<KnobAt<S, P>> => {\n const [group, name] = split(path)\n const set = (values[group] as Readonly<Record<string, unknown>> | undefined)?.[name]\n return (set ?? at(knobs, path).default) as ValueOf<KnobAt<S, P>>\n}\n\n/** `values` with the knob at `path` set to `value`, checked by the knob as `make` checks it. */\nexport const withValue = <S extends KnobSet, P extends PathOf<S>>(\n knobs: S,\n values: Values<S>,\n path: P,\n value: ValueOf<KnobAt<S, P>>,\n): Values<S> => {\n const [group, name] = split(path)\n Schema.decodeUnknownSync(at(knobs, path).schema)(value)\n return { ...values, [group]: { ...values[group], [name]: value } } as Values<S>\n}\n","// Written by `pnpm icons` from icons.json. Do not edit.\n// Lucide (ISC, Lucide Contributors): @iconify-json/lucide 1.2.147, https://github.com/lucide-icons/lucide/blob/main/LICENSE\nexport type IconName =\n | 'search'\n | 'eye'\n | 'eye-off'\n | 'pipette'\n | 'rotate-ccw'\n | 'rotate-cw'\n | 'success'\n | 'warning'\n | 'error'\n | 'info'\n | 'lock'\n | 'close'\n\nexport const masks: { readonly [Name in IconName]: string } = {\n search:\n 'url(\"data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cg fill=%22none%22 stroke=%22currentColor%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222%22%3E%3Cpath d=%22m21 21l-4.34-4.34%22/%3E%3Ccircle cx=%2211%22 cy=%2211%22 r=%228%22/%3E%3C/g%3E%3C/svg%3E\")',\n eye: 'url(\"data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cg fill=%22none%22 stroke=%22currentColor%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222%22%3E%3Cpath d=%22M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0%22/%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%223%22/%3E%3C/g%3E%3C/svg%3E\")',\n 'eye-off':\n 'url(\"data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cg fill=%22none%22 stroke=%22currentColor%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222%22%3E%3Cpath d=%22M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575a1 1 0 0 1 0 .696a10.8 10.8 0 0 1-1.444 2.49m-6.41-.679a3 3 0 0 1-4.242-4.242%22/%3E%3Cpath d=%22M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 4.446-5.143M2 2l20 20%22/%3E%3C/g%3E%3C/svg%3E\")',\n pipette:\n 'url(\"data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cg fill=%22none%22 stroke=%22currentColor%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222%22%3E%3Cpath d=%22m12 9l-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12%22/%3E%3Cpath d=%22m18 9l.4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4l3.4-3.4a1 1 0 1 1 3 3zM2 22l.414-.414%22/%3E%3C/g%3E%3C/svg%3E\")',\n 'rotate-ccw':\n 'url(\"data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cg fill=%22none%22 stroke=%22currentColor%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222%22%3E%3Cpath d=%22M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8%22/%3E%3Cpath d=%22M3 3v5h5%22/%3E%3C/g%3E%3C/svg%3E\")',\n 'rotate-cw':\n 'url(\"data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cg fill=%22none%22 stroke=%22currentColor%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222%22%3E%3Cpath d=%22M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8%22/%3E%3Cpath d=%22M21 3v5h-5%22/%3E%3C/g%3E%3C/svg%3E\")',\n success:\n 'url(\"data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cg fill=%22none%22 stroke=%22currentColor%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222%22%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%2210%22/%3E%3Cpath d=%22m16 9l-5.5 5.5L8 12%22/%3E%3C/g%3E%3C/svg%3E\")',\n warning:\n 'url(\"data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath fill=%22none%22 stroke=%22currentColor%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222%22 d=%22m21.73 18l-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3M12 9v4m0 4h.01%22/%3E%3C/svg%3E\")',\n error:\n 'url(\"data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cg fill=%22none%22 stroke=%22currentColor%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222%22%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%2210%22/%3E%3Cpath d=%22m15 9l-6 6m0-6l6 6%22/%3E%3C/g%3E%3C/svg%3E\")',\n info: 'url(\"data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cg fill=%22none%22 stroke=%22currentColor%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222%22%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%2210%22/%3E%3Cpath d=%22M12 16v-4m0-4h.01%22/%3E%3C/g%3E%3C/svg%3E\")',\n lock: 'url(\"data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cg fill=%22none%22 stroke=%22currentColor%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222%22%3E%3Crect width=%2218%22 height=%2211%22 x=%223%22 y=%2211%22 rx=%222%22 ry=%222%22/%3E%3Cpath d=%22M7 11V7a5 5 0 0 1 10 0v4%22/%3E%3C/g%3E%3C/svg%3E\")',\n close:\n 'url(\"data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath fill=%22none%22 stroke=%22currentColor%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222%22 d=%22M18 6L6 18M6 6l12 12%22/%3E%3C/svg%3E\")',\n}\n","/**\n * The non-color scales a design system shares across themes. Space, radius,\n * and durations multiply by the `density`, `radius-factor`, and `motion`\n * knobs, so a compact, a rounder, or a stiller theme is one override\n * (`motion: '0'` stills every recipe transition). `travel` multiplies only\n * the durations of things that move or resize: the reset sets it to 0 under\n * `prefers-reduced-motion`, so objects stop travelling and fades stay. `shadow` is drawn in `shadow.color`,\n * which the palette sets (stronger in a dark scheme, where\n * a shadow mixed from the text would glow); alone it falls back to black.\n * Every layer is mixed toward transparent by the `shadow-strength` knob, so\n * one override dims the whole elevation system without touching its shapes.\n * `breakpoint` is the record\n * `Style.responsive` takes; `breakpointWidths` gives the same names as pixel\n * thresholds for `foldkit-primitives/media` Breakpoints.\n */\nimport { DiagnosticError } from '../diagnostics.js'\nimport { define } from './core.js'\nimport { masks } from './iconMasks.js'\nimport { standard } from './knobs.js'\nimport { asVariables, elevation, reliefs } from './shadows.js'\n\nconst space = (rem: number) => `calc(${rem}rem * var(--fk-knob-density))`\nconst radius = (px: number) => `calc(${px}px * var(--fk-knob-radius-factor))`\nconst duration = (ms: number) => `calc(${ms}ms * var(--fk-knob-motion))`\nconst textScale = 'var(--fk-knob-text-scale, 1)'\n/**\n * A step of the type scale: at or below the body size it scales with the\n * text alone; above it, its distance from the body size also scales with\n * `heading-scale`, so headings can stand further off the text or closer.\n */\nconst text = (rem: number) =>\n rem <= 1\n ? `calc(${rem}rem * ${textScale})`\n : `calc((1rem + ${Number((rem - 1).toFixed(4))}rem * var(--fk-knob-heading-scale, 1)) * ${textScale})`\nconst leading = (ratio: number) => `calc(${ratio} * var(--fk-knob-leading, 1))`\nexport const tokens = define({\n knob: {\n density: '1',\n 'radius-factor': '1',\n motion: '1',\n travel: '1',\n // The size ladder's step: 0 default, 1 compact; `ladder` reads it.\n step: '0',\n 'shadow-strength': '100%',\n // The reading type: every size of the scale (`text-scale`), how far the\n // headings stand above the body (`heading-scale`), and the line height\n // (`leading`), each a multiplier.\n 'text-scale': '1',\n 'heading-scale': '1',\n leading: '1',\n // 1 rounds a pressable control (a button, a segmented tray) to a pill,\n // whatever the radius factor; 0 keeps its corner (`radius-md`, or\n // concentric inside a card: `concentric`).\n 'control-round': '0',\n // What the tokens below read, at each knob's default.\n ...standard.shape.border.unset,\n ...standard.type.body.unset,\n ...standard.type.heading.unset,\n ...standard.type.headingWeight.unset,\n ...standard.type.headingTracking.unset,\n ...standard.motion.easing.unset,\n ...standard.icon.size.unset,\n ...standard.icon.stroke.unset,\n ...standard.shadow.style.unset,\n ...standard.shadow.relief.unset,\n },\n space: {\n '3xs': space(0.125),\n '2xs': space(0.25),\n xs: space(0.5),\n sm: space(0.75),\n md: space(1),\n lg: space(1.5),\n xl: space(2),\n '2xl': space(3),\n '3xl': space(4),\n },\n radius: {\n xs: radius(2),\n sm: radius(3),\n md: radius(6),\n lg: radius(8),\n xl: radius(12),\n // A pill, which squares off only where the knob is 0, as a boxy theme's are.\n full: 'calc(9999px * min(var(--fk-knob-radius-factor), 1))',\n // A pressable control's corner: `md`, or a pill when `control-round` is 1.\n control: 'calc(var(--fk-radius-md) + var(--fk-knob-control-round, 0) * 9999px)',\n },\n font: {\n body: 'var(--fk-knob-font-body)',\n heading: 'var(--fk-knob-font-heading)',\n mono: 'ui-monospace, monospace',\n },\n size: {\n xs: text(0.75),\n sm: text(0.875),\n md: text(1),\n lg: text(1.125),\n xl: text(1.25),\n '2xl': text(1.5),\n '3xl': text(1.875),\n '4xl': text(2.25),\n },\n leading: {\n tight: leading(1.2),\n snug: leading(1.375),\n normal: leading(1.5),\n relaxed: leading(1.6),\n },\n // `heading` is what a heading or a title is set in.\n weight: {\n normal: '400',\n medium: '500',\n semibold: '600',\n bold: '700',\n heading: 'var(--fk-knob-heading-weight)',\n },\n // A heading's letter spacing: set large, type reads better a little tighter.\n tracking: { heading: 'var(--fk-knob-heading-tracking)' },\n // Three tiers, as Fluid Functionalism's springs: the bigger the thing that\n // moves, the slower its tier. Hover, fades and focus rings are `fast`;\n // popups, tabs and short travel `moderate`; dialogs and large surfaces\n // `slow`. Each exit is a tween one tier quicker, so a dismissal reads as\n // final rather than as the entrance replayed.\n motion: {\n fast: duration(80),\n moderate: duration(160),\n slow: duration(240),\n 'fast-exit': duration(60),\n 'moderate-exit': duration(120),\n 'slow-exit': duration(160),\n ease: 'var(--fk-knob-ease)',\n 'ease-exit': 'ease-in',\n // Springs sampled as CSS easings, so they need no JavaScript and follow\n // the knobs through the duration they are paired with. `settle` is\n // critically damped: it lands exactly, for `fast` and `moderate` travel.\n settle:\n 'linear(0, 0.035, 0.116, 0.218, 0.325, 0.428, 0.522, 0.605, 0.677, 0.737, 0.788, 0.83, 0.864, 0.892, 0.914, 0.932, 0.947, 0.958, 0.967, 0.974, 0.98, 0.984, 0.988, 0.991, 1)',\n // Damping ratio 0.88 (Fluid's bounce 0.12), for `slow`: a large surface\n // arrives with a little weight and no visible wobble.\n spring:\n 'linear(0, 0.041, 0.136, 0.255, 0.379, 0.497, 0.603, 0.693, 0.768, 0.829, 0.876, 0.913, 0.941, 0.961, 0.976, 0.986, 0.993, 0.998, 1, 1.002, 1.003, 1.003, 1.003, 1.003, 1)',\n },\n // The size ladder's two ends, after Fluid Functionalism's: a 36px default\n // control and a 28px compact one, everything about a control stepping down\n // together. One height serves buttons, fields and the rows of a list, so a\n // popup's row lines up with the trigger that opened it. Read through\n // `ladder`, which blends the pair by the `step` knob.\n control: {\n height: '2.25rem',\n 'height-compact': '1.75rem',\n pad: '0.75rem',\n 'pad-compact': '0.625rem',\n 'row-pad': '0.5rem',\n 'row-pad-compact': '0.375rem',\n gap: '0.5rem',\n 'gap-compact': '0.25rem',\n inset: '0.25rem',\n 'inset-compact': '0.125rem',\n icon: '1rem',\n 'icon-compact': '0.875rem',\n },\n // Six roles, each a size and a whole-pixel leading at both steps of the\n // ladder, after Fluid Functionalism's (body one notch up, at shadcn's 14px):\n // a caption in a menu and one in a table share a rhythm, and a compact\n // region reads as a smaller sibling of the same hierarchy. Pick by purpose:\n // `micro` is for keycaps, counters and tiny badges only. Read through `role`.\n type: {\n 'display-size': '1.75rem',\n 'display-size-compact': '1.5rem',\n 'display-leading': '2.125rem',\n 'display-leading-compact': '1.875rem',\n 'title-size': '1rem',\n 'title-size-compact': '0.9375rem',\n 'title-leading': '1.375rem',\n 'title-leading-compact': '1.25rem',\n 'subtitle-size': '0.9375rem',\n 'subtitle-size-compact': '0.875rem',\n 'subtitle-leading': '1.375rem',\n 'subtitle-leading-compact': '1.25rem',\n 'body-size': '0.875rem',\n 'body-size-compact': '0.8125rem',\n 'body-leading': '1.25rem',\n 'body-leading-compact': '1.125rem',\n 'caption-size': '0.75rem',\n 'caption-size-compact': '0.6875rem',\n 'caption-leading': '1rem',\n 'caption-leading-compact': '0.875rem',\n 'micro-size': '0.6875rem',\n 'micro-size-compact': '0.625rem',\n 'micro-leading': '0.875rem',\n 'micro-leading-compact': '0.75rem',\n },\n // The least widths content sets: `field` a text field's, so one sized by\n // its content still has room to type in; the columns a grid of cards or\n // tiles lays out by.\n width: {\n field: '20ch',\n 'column-sm': '10rem',\n 'column-md': '14rem',\n 'column-lg': '18rem',\n },\n // The icons the components draw themselves, each a CSS mask `url()` an\n // element paints in its text's color: Lucide's by default, written by\n // `pnpm icons`. An application's own pack replaces them as its own tokens\n // (`Icons.tokens` in `foldkit-mixins-ui`).\n icon: masks,\n // `glyph` strokes what a recipe draws in CSS as an icon (a check, a\n // chevron): apart from the borders, so thicker borders do not blot them.\n border: {\n thin: 'var(--fk-knob-border-width)',\n thick: 'calc(var(--fk-knob-border-width) + 1px)',\n heavy: 'calc(var(--fk-knob-border-width) + 2px)',\n glyph: 'var(--fk-knob-glyph-width)',\n },\n // Raised a little to a lot: a pressed control, a lifted cell, a menu, a\n // dialog. Each step is a tight contact layer plus a wide ambient one, so\n // large surfaces diffuse instead of ringing; `2xl` is the modal step.\n shadow: {\n // Soft or hard by the `shadow.style` knob.\n xs: 'var(--fk-knob-shadow-xs)',\n sm: 'var(--fk-knob-shadow-sm)',\n md: 'var(--fk-knob-shadow-md)',\n lg: 'var(--fk-knob-shadow-lg)',\n xl: 'var(--fk-knob-shadow-xl)',\n '2xl': 'var(--fk-knob-shadow-2xl)',\n inset: 'var(--fk-knob-shadow-inset)',\n // A control's relief: a button standing off the page (`raised`), pressed\n // into it while held or on (`pressed`), and a field's well (`field`).\n // Flat here; `relief` holds themes that give controls depth.\n raised: 'var(--fk-knob-relief-raised)',\n pressed: 'var(--fk-knob-relief-pressed)',\n field: 'var(--fk-knob-relief-field)',\n },\n breakpoint: {\n sm: '(min-width: 40rem)',\n md: '(min-width: 48rem)',\n lg: '(min-width: 64rem)',\n xl: '(min-width: 80rem)',\n },\n // What a notch, a rounded corner or the home indicator takes from each edge of the\n // screen: 0 on a desktop, and everywhere unless the page's viewport meta says\n // `viewport-fit=cover`. Physical, as the screen is; a fixed bar pads the edge it touches.\n safe: {\n top: 'env(safe-area-inset-top, 0px)',\n right: 'env(safe-area-inset-right, 0px)',\n bottom: 'env(safe-area-inset-bottom, 0px)',\n left: 'env(safe-area-inset-left, 0px)',\n },\n})\n\nexport type Tokens = typeof tokens\n\n/** A dimension on the size ladder, by its default end's name. */\nexport type Rung = Exclude<keyof Tokens['control'], `${string}-compact`>\n\n/**\n * A control's dimension on the size ladder: `name`'s default end blended\n * toward its compact one by the `step` knob, and spacing multiplied by\n * `density`. The blend is written here, not in a token, because a custom\n * property resolves where it is declared: a token would read the step at\n * `:root`, while this expression reads it on the element that uses it, so\n * `--fk-knob-step: 1` on a toolbar makes everything in it compact, a menu it\n * opens included while the panel stays in the page (an anchor's `portal:\n * false`); a portaled panel takes only the size its recipe chooses. A step of\n * `-0.5` is shadcn's large size, 40px.\n */\nexport const ladder = (name: Rung): string => {\n const stepped = blend('control', name)\n return name === 'icon'\n ? `calc(${stepped} * var(--fk-knob-icon-scale))`\n : `calc(${stepped} * var(--fk-knob-density))`\n}\n\n/**\n * The radius of a rounded surface inset in another, so their corners are\n * concentric: the outer radius less the inset between them and the outer\n * surface's border, never below zero. Past a large radius, or with uneven\n * gaps, the two read as independent and may be tuned by eye.\n *\n * With no arguments, it reads what the nearest container that `nests` its\n * children published, so a row, a pill or a highlight inside a padded panel\n * follows the panel's corner without repeating its arithmetic. The values\n * inherit, so it reads the nearest ancestor that `nests`, however deep and in\n * whatever component; it is square only where no ancestor does.\n */\nexport function nested(): string\nexport function nested(outer: string, inset: string, border?: string): string\nexport function nested(outer?: string, inset?: string, border = '0px'): string {\n return outer === undefined || inset === undefined\n ? `max(0px, calc(var(--fk-outer-radius, 0px) - var(--fk-inset, 0px)))`\n : `max(0px, calc(${outer} - ${inset} - ${border}))`\n}\n\n/**\n * What a container that pads its children publishes for `nested()` and\n * `concentric()`: its corner inside its border, the inset to them, and the\n * corner a control there takes. Spread it beside the container's own radius\n * and padding. The values are read on each child, so a container deeper in\n * that `nests` again publishes its own.\n */\nexport const nests = (\n radius: string,\n inset: string,\n border = '0px',\n): {\n readonly '--fk-outer-radius': string\n readonly '--fk-inset': string\n readonly '--fk-control-corner': string\n} => ({\n '--fk-outer-radius': `calc(${radius} - ${border})`,\n '--fk-inset': inset,\n '--fk-control-corner': `calc(${radius} - ${border} - ${inset})`,\n})\n\n/**\n * A control's corner, concentric with the nearest container that `nests`\n * (a card, a dialog, a toast) and kept between `min` and `max`: a deep\n * inset would square it off, and a wide corner round it past what a\n * control is drawn with. Outside every such container it is `max`. Like\n * `nested()`, it reads what that ancestor published, so it is written in the\n * control's own rule; as a token it would resolve once, at the root.\n *\n * A control that `nests` its own parts (a segmented tray) reads this and\n * publishes from it on one element, a cycle that voids both: after `nests`,\n * it sets `'--fk-control-corner': 'inherit'`, passing its container's on.\n */\nexport const concentric = (bounds: { readonly min: string; readonly max: string }): string =>\n `clamp(${bounds.min}, var(--fk-control-corner, 9999px), ${bounds.max})`\n\n/** A role of the type scale. */\nexport type Role = 'display' | 'title' | 'subtitle' | 'body' | 'caption' | 'micro'\n\n/**\n * Text in `role`: its size and leading on the size ladder, read on the\n * element like `ladder`, so a compact region's text steps down with its\n * controls.\n */\nexport const role = (name: Role): { readonly fontSize: string; readonly lineHeight: string } => ({\n fontSize: blend('type', `${name}-size`),\n lineHeight: blend('type', `${name}-leading`),\n})\n\n/** A token's default end blended toward its `-compact` one by the `step` knob. */\nconst blend = (group: string, name: string) => {\n const at = `var(--fk-${group}-${name})`\n return `calc(${at} + (var(--fk-${group}-${name}-compact) - ${at}) * var(--fk-knob-step))`\n}\n\n// A plain `min-width`, of the window or of a named container.\nconst MIN_WIDTH = /^(?:@container\\s+[\\w-]+\\s+)?\\(min-width:\\s*(\\d+(?:\\.\\d+)?)(rem|px)\\)$/\n\n/**\n * Each breakpoint query's `min-width` in pixels (rem at 16), so CSS and the\n * Model agree on what `md` means. A query that is not a plain `min-width`\n * is refused: it has no single threshold. A container's is its container's.\n */\nexport const breakpointWidths = (theme: {\n readonly breakpoint: { readonly [name: string]: string }\n}): Readonly<Record<string, number>> => {\n const widths: Record<string, number> = {}\n for (const [name, query] of Object.entries(theme.breakpoint)) {\n const match = MIN_WIDTH.exec(query)\n if (match === null) {\n throw new DiagnosticError({\n source: 'theme',\n code: 'theme:unparseable-breakpoint',\n severity: 'error',\n message: `Breakpoint \"${name}\" is \"${query}\", not a \"(min-width: <rem|px>)\" query`,\n details: { name, query },\n })\n }\n const amount = Number(match[1])\n widths[name] = match[2] === 'rem' ? amount * 16 : amount\n }\n return Object.freeze(widths)\n}\n\n/**\n * The same breakpoints measured on a named container rather than the window:\n * `Theme.inContainer('page', Theme.tokens.breakpoint)` gives `md` as\n * `'@container page (min-width: 48rem)'`, for `Style.responsive` and a\n * responsive look. An element must be that container (`container: page /\n * inline-size`) for them to match.\n */\nexport const inContainer = <Breakpoints extends Readonly<Record<string, string>>>(\n name: string,\n breakpoints: Breakpoints,\n): { readonly [K in keyof Breakpoints]: string } =>\n Object.freeze(\n Object.fromEntries(\n Object.entries(breakpoints).map(([at, query]) => [at, `@container ${name} ${query}`]),\n ),\n ) as { readonly [K in keyof Breakpoints]: string }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAM,OAAO,UAAkB,OAAO,OAAO,MAAM,QAAQ,CAAC,CAAC,CAAC;;AAgB9D,MAAM,OAA4B,MAAY,WAC3C,GAAG,OAAO,MAAM;;AAGnB,MAAM,UACH,UAC2B,aAA8C;CACxE,QAAQ,OAAO,OAAO,MAAM,OAAO,UAAU;EAAE,SAAS,QAAQ;EAAK,SAAS,QAAQ;CAAI,CAAC,CAAC;CAC5F,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tokens } from "./tokens-C4tC1NFW.mjs";
3
3
  //#region src/utilities.d.ts
4
4
  /** A space step, or none. */
5
5
  export type Space = (keyof Tokens['space'] & string) | '0';
@@ -1,6 +1,6 @@
1
1
  import { _ as self, c as global, d as keyframes, i as compose, m as nest, n as at, y as supports } from "./styleValue-6hpAYYfg.mjs";
2
2
  import { n as VAR_PREFIX, o as ref } from "./core-BrR6UPbk.mjs";
3
- import { c as tokens } from "./tokens-DIIMgir1.mjs";
3
+ import { c as tokens } from "./tokens-CkTT9DNd.mjs";
4
4
  //#region src/utilities.ts
5
5
  /**
6
6
  * `foldkit-mixins/utilities`: one-idea pieces over the shipped scales, so
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foldkit-mixins",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "description": "Typed slot contracts and inside-out Style/Behavior attachments for Foldkit.",
5
5
  "keywords": [
6
6
  "foldkit",
@@ -1 +0,0 @@
1
- {"version":3,"file":"root-BsyR6nwj.mjs","names":["makeTheme","declarations"],"sources":["../src/theme/oklch.ts","../src/theme/scriptLiteral.ts","../src/theme/themes.ts","../src/theme/root.ts"],"sourcesContent":["/**\n * A whole palette from a few knobs, as css-tags derives it: every value\n * except the knobs is a CSS expression over other tokens, so overriding a\n * knob on the element that declares the tokens (`:root`, or a scoped theme's\n * selector) re-derives the rest in the browser. A custom property resolves\n * where it is declared, so a knob overridden on a subtree below `:root`\n * changes nothing: `Theme.scope` declares the derivations there too. Where\n * light and dark schemes need different numbers the value is a `light-dark()` pair, so one theme serves both and a user's\n * choice is a `color-scheme` override.\n */\nimport { define } from './core.js'\nimport { standard, unsetOf } from './knobs.js'\n\nconst v = (group: string, name: string) => `var(--fk-${group}-${name})`\nconst ld = (light: string, dark: string) => `light-dark(${light}, ${dark})`\nconst offset = (amount: number) => `${amount < 0 ? '-' : '+'} ${Math.abs(amount)}`\n/** `oklch(from <color> …)` with the hue kept. */\nconst from = (color: string, l: string, c: string) => `oklch(from ${color} ${l} ${c} h)`\nconst shift = (color: string, dl: number, dc: number) =>\n from(color, `calc(l ${offset(dl)})`, `calc(c ${offset(dc)})`)\nconst scale = (color: string, dl: number, cx: number) =>\n from(color, `calc(l ${offset(dl)})`, `calc(c * ${cx})`)\n/** The same lightness and chroma as `color` on another hue. */\nconst rehue = (color: string, hue: string) => `oklch(from ${color} l c ${hue})`\n/** Near-black or near-white text over `color`. */\nconst contrast = (color: string) =>\n `oklch(from ${color} clamp(0.1, (0.65 / l - 1) * 999, 0.98) min(c, 0.08) h)`\n/** `color` as text on the base surface: dark in a light scheme, light in a dark one. */\nconst ink = (color: string) => ld(from(color, '0.5', 'c'), from(color, '0.8', 'c'))\n/**\n * `color` tinted onto the base surface, the same in both schemes. Mixed in\n * OKLab, not OKLCH: OKLCH interpolates hue, so a mix mostly of the base keeps\n * the base's hue, and a green tinted onto a blue-grey base came out blue.\n */\nconst tint = (color: string, percent: number) =>\n `color-mix(in oklab, ${v('surface', 'base')} ${percent}%, ${color})`\n\nconst neutral = v('hue', 'neutral')\nconst base = v('surface', 'base')\nconst surfaceC = v('knob', 'surface-c')\nconst surfaceCDark = v('knob', 'surface-c-dark')\nconst contrastFactor = v('knob', 'contrast-factor')\n\ntype Step = readonly [lightness: number, chroma: number]\n\n/**\n * How far a step's target lies past the offset it names: at the default\n * contrast (26%) a step sits where its offset says, and the whole knob spans\n * 2.5 times that, so its range is one a reader sees. At a reach of 1 the knob\n * at its top moved the muted surface four points of lightness.\n */\nconst REACH = 2.5\nconst reach = ([lightness, chroma]: Step): Step => [\n Number((lightness * REACH).toFixed(4)),\n Number((1 + (chroma - 1) * REACH).toFixed(4)),\n]\n\n/** A surface step: the base mixed toward a target by `surface-contrast`. */\nconst surfaceStep = (lightStep: Step, darkStep: Step) => {\n const amount = v('knob', 'surface-contrast')\n const [light, dark] = [reach(lightStep), reach(darkStep)]\n const target = ld(scale(base, light[0], light[1]), scale(base, dark[0], dark[1]))\n return `color-mix(in oklch, ${base} calc(100% - ${amount}), ${target} ${amount})`\n}\n\n/** `a` where the 0-or-1 knob `name` is 1, `b` where it is 0. */\nconst share = (a: string, name: string, b: string) =>\n `color-mix(in oklab, ${a} calc(${v('knob', name)} * 100%), ${b})`\n\n/** A text color: fixed lightness, chroma scaled by surface saturation and the contrast factor. */\nconst text = (light: Step, dark: Step) =>\n ld(\n `oklch(${light[0]}% calc(${surfaceC} * ${light[1]} * ${contrastFactor}) ${neutral})`,\n `oklch(${dark[0]}% calc(${surfaceCDark} * ${dark[1]} * ${contrastFactor}) ${neutral})`,\n )\n\n/**\n * A color family, every one the same shape: its fill, the fill hovered and\n * pressed, a tint of it on the base, a line in it that stands off the base\n * (darker in a light scheme, lighter in a dark one), and text on the fill\n * and in the family's color.\n */\nconst family = (name: string, defaultValue: string) => {\n const color = v(name, 'default')\n return {\n default: defaultValue,\n hover: shift(color, -0.06, 0),\n active: shift(color, -0.1, 0.05),\n subtle: tint(color, 85),\n outline: ld(shift(color, -0.05, 0), shift(color, 0.05, 0)),\n 'on-fill': contrast(color),\n ink: ink(color),\n }\n}\n\n/**\n * A code color in `hue`: the same lightness for every kind, so no kind shouts,\n * dark enough to read on a light surface and light enough on a dark one.\n */\nconst syntaxInk = (hue: string) =>\n ld(`oklch(48% ${v('knob', 'syntax-c')} ${hue})`, `oklch(80% ${v('knob', 'syntax-c')} ${hue})`)\n\n/**\n * A chart's series color: a hue a fixed turn from the first, at a lightness\n * and chroma chosen for that hue in each scheme (a yellow sits lighter than a\n * blue to read as strong). The five are the dataviz reference palette's first\n * slots, in its order, which keeps neighbors apart under protan and deutan\n * vision; moving `chart-h` turns them all and keeps the order.\n */\nconst chartInk = (turn: number, light: Step, dark: Step) => {\n const hue = `calc(${v('knob', 'chart-h')} ${offset(turn)})`\n return ld(`oklch(${light[0]} ${light[1]} ${hue})`, `oklch(${dark[0]} ${dark[1]} ${hue})`)\n}\n\n/** A feedback family, lighter in a dark scheme so its fill reads on a dark page. */\nconst feedback = (name: string, l: number, c: number, dark: number) =>\n family(\n name,\n ld(\n `oklch(${l}% ${c} ${v('knob', `${name}-h`)})`,\n `oklch(${dark}% ${c} ${v('knob', `${name}-h`)})`,\n ),\n )\n\n/** The color scales, each named for its hue (a knob, `red-h`). */\ntype ScaleName = 'red' | 'orange' | 'yellow' | 'green' | 'teal' | 'blue' | 'purple'\n\n/**\n * One lightness ladder for every scale, near white to near black in even\n * steps, so step 6 of red is as light as step 6 of blue: a step number\n * means the same contrast in any hue (after css-tags' palette).\n */\nconst scaleL = [97, 88.5, 80, 71.5, 63, 54.5, 46, 37.5, 29, 20.5]\n// Chroma swells toward the middle, where a screen can show most of it, and\n// thins at both ends, where a vivid near-white or near-black falls out of gamut.\nconst scaleC = [0.02, 0.05, 0.09, 0.13, 0.16, 0.17, 0.155, 0.125, 0.09, 0.055]\n\n/**\n * A color's ten steps, `1` the lightest, and four `wash`es: step 6 mixed\n * into the page, so a tinted ground follows the scheme and the surface\n * knobs as the page does.\n */\nconst colorScale = (name: ScaleName) => {\n const hue = v('knob', `${name}-h`)\n const step = (index: number) =>\n `oklch(${scaleL[index]}% calc(${scaleC[index]} * ${v('knob', 'scale-c')}) ${hue})`\n const wash = (share: number) =>\n `color-mix(in oklab, ${v(name, '6')} ${share}%, ${v('surface', 'base')})`\n return {\n '1': step(0),\n '2': step(1),\n '3': step(2),\n '4': step(3),\n '5': step(4),\n '6': step(5),\n '7': step(6),\n '8': step(7),\n '9': step(8),\n '10': step(9),\n 'wash-1': wash(8),\n 'wash-2': wash(16),\n 'wash-3': wash(28),\n 'wash-4': wash(44),\n }\n}\n\n/**\n * An outline, the palette's line until the `shape.outlines` knob gives it the\n * text's own ink: `outline-ink` 0 is the line itself, 1 the ink at its strength.\n */\nconst inked = (line: string, strength: 'subtle' | 'default' | 'overt') =>\n `color-mix(in oklch, ${line}, color-mix(in oklch, ${v('text', 'overt')} ${v('knob', `outline-ink-${strength}`)}, transparent) calc(${v('knob', 'outline-ink')} * 100%))`\n\nconst accent = v('accent', 'default')\n\n/**\n * The palette: every color a CSS expression over the knobs' variables. The\n * knobs stand at their defaults here; a theme declares its own values over\n * them (`Theme.standard`).\n */\nexport const palette = define({\n knob: {\n ...unsetOf(standard),\n // How much of the text a state lays over its surface.\n 'state-hover': '12%',\n 'state-tint': '8%',\n 'state-tint-dark': '25%',\n 'image-edge': '10%',\n // How much lighter each raised level is in a dark scheme.\n 'raise-dark': '0.027',\n },\n hue: {\n accent: v('knob', 'accent-h'),\n secondary: `calc(${v('knob', 'accent-h')} + ${v('knob', 'secondary-shift')})`,\n tertiary: `calc(${v('knob', 'accent-h')} + ${v('knob', 'tertiary-shift')})`,\n neutral: v('knob', 'neutral-h'),\n },\n surface: {\n base: ld(\n `oklch(${v('knob', 'base-l')} calc(${surfaceC} * 0.9) ${neutral})`,\n `oklch(${v('knob', 'base-l-dark')} calc(${surfaceCDark} * 0.9) ${neutral})`,\n ),\n // A control's resting ground, separate from a neutral surface step so a\n // field can keep its contrast if the steps move: filled fields read it,\n // the page reads base.\n field: v('surface', 'default'),\n // Each step keeps about the base's chroma, so a sidebar, a panel and\n // the page read as one color at a few lightnesses: one with less reads\n // grey on the page, one with more reads as another, bluer color.\n muted: surfaceStep([-0.04, 1.2], [-0.03, 1.05]),\n subtle: surfaceStep([-0.025, 1.15], [-0.015, 1.05]),\n default: surfaceStep([-0.055, 1.25], [0.045, 1.1]),\n overt: surfaceStep([-0.31, 2.25], [0.125, 1.2]),\n // The deepest of the page's color in both schemes: under a dialog's\n // backdrop, a veil of it darkens the page; it was near-white in a dark one.\n bedrock: ld(\n `oklch(8% calc(${surfaceC} * 1.2) ${neutral})`,\n `oklch(6% calc(${surfaceCDark} * 1.2) ${neutral})`,\n ),\n },\n text: {\n default: text([20, 2], [88, 0.8]),\n muted: text([45, 1.5], [65, 1.2]),\n subtle: text([35, 1.8], [75, 1]),\n overt: text([10, 2.2], [95, 0.6]),\n link: shift(accent, 0.1, 0.05),\n 'link-hover': shift(v('text', 'link'), -0.1, 0),\n },\n // Steps from the base, as the surfaces are: darker in a light scheme,\n // lighter in a dark one, and in the base's own hue with a little more of\n // its chroma, which a thin line needs to read as the page's color. Text mixed into the base, as they were, came out grey on a\n // tinted page: the text is near-neutral, so the mix lost the tint.\n outline: {\n subtle: inked(ld(scale(base, -0.07, 1.3), scale(base, 0.065, 1.25)), 'subtle'),\n // Between two parts of one surface (groups of a list, a panel's\n // header): a step past `subtle`, which a dark page all but hides.\n divider: inked(ld(scale(base, -0.1, 1.35), scale(base, 0.095, 1.3)), 'subtle'),\n default: inked(ld(scale(base, -0.13, 1.4), scale(base, 0.12, 1.35)), 'default'),\n overt: inked(ld(scale(base, -0.27, 1.6), scale(base, 0.23, 1.5)), 'overt'),\n // The accent as it is: darker and more saturated, the ring was the\n // harshest color on the page.\n focus: accent,\n },\n accent: family(\n 'accent',\n ld(\n `oklch(${v('knob', 'accent-l')} ${v('knob', 'accent-c')} ${v('hue', 'accent')})`,\n `oklch(${v('knob', 'accent-l-dark')} ${v('knob', 'accent-c-dark')} ${v('hue', 'accent')})`,\n ),\n ),\n secondary: family('secondary', rehue(accent, v('hue', 'secondary'))),\n tertiary: family('tertiary', rehue(accent, v('hue', 'tertiary'))),\n // A near-black of the shadow's hue: faint on a light surface, and denser\n // on a dark one, where a light shadow would read as a glow.\n shadow: {\n color: ld(\n `oklch(25% ${v('knob', 'shadow-c')} ${v('knob', 'shadow-h')} / 0.14)`,\n // A third more chroma, as the dark surfaces have.\n `oklch(5% calc(${v('knob', 'shadow-c')} * 4 / 3) ${v('knob', 'shadow-h')} / 0.6)`,\n ),\n },\n // What a state lays over the surface under it, after Fluid Functionalism's\n // overlays. `hover`, `tint` and `tint-hover` mix the element's own text\n // color: `currentColor` resolves where the film is drawn, so a hover reads\n // at any elevation, on a tinted band, and on an inverted panel alike. A\n // film that must take its surface's hue instead reads a property on the\n // element (`unfilledHover` reads a surface's `--_fk-state-ink`, falling\n // back to this `ink`): a `var()` substitutes where the token is declared,\n // so a token cannot carry a per-surface ink. `tint` is a see-through fill, which\n // takes on whatever it sits on (lighter when hovered, as Fluid's: the\n // press is what darkens). `edge` is a hairline inside an image, so a pale\n // edge keeps its shape. `ink` is the state ink where no surface set one:\n // the text (`surface`), the accent's ink (`accent`), or the text with the\n // films reading it directly (`neutral`, as before).\n state: {\n hover: `color-mix(in oklab, currentColor ${v('knob', 'state-hover')}, transparent)`,\n tint: ld(\n `color-mix(in oklab, currentColor ${v('knob', 'state-tint')}, transparent)`,\n `color-mix(in oklab, currentColor ${v('knob', 'state-tint-dark')}, transparent)`,\n ),\n 'tint-hover': ld(\n `color-mix(in oklab, currentColor calc(${v('knob', 'state-tint')} * 0.8), transparent)`,\n `color-mix(in oklab, currentColor calc(${v('knob', 'state-tint-dark')} * 0.8), transparent)`,\n ),\n edge: `color-mix(in oklab, ${v('text', 'overt')} ${v('knob', 'image-edge')}, transparent)`,\n ink: v('knob', 'state-ink'),\n },\n // A menu's panel and its lit row, which the popup recipes read.\n popup: {\n surface: `color-mix(in oklab, ${share(\n ld(\n `oklch(${v('knob', 'base-l-dark')} calc(${surfaceCDark} * 0.9) ${neutral})`,\n `oklch(${v('knob', 'base-l')} calc(${surfaceC} * 0.9) ${neutral})`,\n ),\n 'popup-invert',\n base,\n )} calc(${v('knob', 'popup-alpha')} * 100%), transparent)`,\n // The other scheme's base, which an inverted panel takes wherever it is raised to.\n inverted: ld(\n `oklch(${v('knob', 'base-l-dark')} calc(${surfaceCDark} * 0.9) ${neutral})`,\n `oklch(${v('knob', 'base-l')} calc(${surfaceC} * 0.9) ${neutral})`,\n ),\n // The text of the opposite scheme: light on an inverted panel in a light one.\n ink: share(text([88, 0.8], [20, 2]), 'popup-invert', v('text', 'default')),\n highlight: share(\n v('accent', 'default'),\n 'popup-bold',\n `color-mix(in oklab, ${v('popup', 'ink')} 8%, transparent)`,\n ),\n 'highlight-ink': share(v('accent', 'on-fill'), 'popup-bold', v('popup', 'ink')),\n blur: v('knob', 'popup-blur'),\n },\n success: feedback('success', 55, 0.15, 64),\n warning: feedback('warning', 70, 0.15, 76),\n // Under 65% in the dark, where the text on a fill turns dark: on red that reads muddy.\n error: feedback('error', 60, 0.2, 64),\n info: feedback('info', 65, 0.15, 70),\n // Series colors, `chart-1` to `chart-5` as shadcn names them: a chart\n // assigns them in order, never by rank, so a series keeps its color.\n chart: {\n '1': chartInk(0, [0.575, 0.163], [0.622, 0.161]),\n '2': chartInk(145, [0.671, 0.175], [0.622, 0.173]),\n '3': chartInk(-93, [0.669, 0.141], [0.621, 0.128]),\n '4': chartInk(180, [0.764, 0.161], [0.67, 0.143]),\n '5': chartInk(102, [0.716, 0.141], [0.622, 0.171]),\n },\n // Color scales of ten even steps, for what is not a role: a tag's\n // color, an illustration, a status of the application's own.\n red: colorScale('red'),\n orange: colorScale('orange'),\n yellow: colorScale('yellow'),\n green: colorScale('green'),\n teal: colorScale('teal'),\n blue: colorScale('blue'),\n purple: colorScale('purple'),\n // Code, by the kinds a tokenizer names (`syntax-keyword` is\n // `--fk-syntax-keyword`): each kind in a hue the palette already has, so\n // code follows the brand, and the quiet kinds in the text's own grey.\n syntax: {\n keyword: syntaxInk(v('hue', 'accent')),\n function: syntaxInk(v('hue', 'secondary')),\n type: syntaxInk(v('hue', 'tertiary')),\n string: syntaxInk(v('knob', 'success-h')),\n number: syntaxInk(v('knob', 'warning-h')),\n property: syntaxInk(v('knob', 'info-h')),\n operator: v('text', 'default'),\n punctuation: v('text', 'muted'),\n comment: text([52, 1], [62, 1]),\n },\n})\n\nexport type Palette = typeof palette\n","/**\n * `value` as a literal in a head script's text: `<` escaped, so a key or a\n * name cannot close the script it is written into.\n */\nexport const scriptLiteral = (value: unknown): string =>\n JSON.stringify(value).replaceAll('<', `${String.fromCharCode(92)}u003c`)\n","/**\n * Themes installed by name. A theme of typed knobs (`Theme.make`) holds only\n * knob values, and every token derives from knob variables, so one set of\n * derivations serves every theme: the root declares them with the initial\n * theme's knobs, and each other theme writes its knobs under\n * `:root[data-theme=\"name\"]`, the same element, where the derivations resolve\n * them. Which theme is active is the application's Model's fact; `apply` is\n * the Command's effect that shows it, and `choose` shows it and keeps it,\n * for `script` to show in the head of the next page before the first paint.\n */\nimport { Effect, Schema } from 'effect'\nimport { global, type StyleValue } from '../styleValue.js'\nimport { compose, VAR_PREFIX, type ThemeTokens } from './core.js'\nimport {\n make as makeTheme,\n tokensOf,\n variables,\n type KnobSet,\n type KnobTheme,\n type Standard,\n} from './knobs.js'\nimport { palette, type Palette } from './oklch.js'\nimport { scriptLiteral } from './scriptLiteral.js'\nimport { tokens, type Tokens } from './tokens.js'\n\n/** Every shipped token: the scales, the palette, and the knobs they read. */\nexport type StandardTokens = ReturnType<typeof compose<Tokens, Palette>>\n\nconst shipped = compose(tokens, palette)\n\n/**\n * Every shipped token with `theme`'s knob values, for a page's root: the\n * derivations are the same for every theme, so only the knobs differ. With\n * no theme, every knob at its default.\n */\nexport const standardOf = (theme: KnobTheme<Standard> = makeTheme({})): StandardTokens =>\n compose(shipped, tokensOf(theme))\n\nconst declarations = (theme: ThemeTokens) =>\n Object.entries(theme)\n .flatMap(([group, names]) =>\n Object.entries(names).map(([name, value]) => `${VAR_PREFIX}-${group}-${name}:${value}`),\n )\n .join(';')\n\nconst knobRule = (selector: string, theme: KnobTheme<KnobSet>) =>\n `${selector}{${Object.entries(variables(theme))\n .map(([name, value]) => `${VAR_PREFIX}-knob-${name}:${value}`)\n .join(';')}}`\n\n/** A set of named themes, one of them shown until the Model chooses another. */\nexport interface Themes<Name extends string> {\n /** The names, as a Schema for the Model field that holds the active one. */\n readonly Name: Schema.Literals<ReadonlyArray<Name>>\n readonly names: ReadonlyArray<Name>\n readonly initial: Name\n /** The root element's attribute that names the active theme. */\n readonly attribute: string\n readonly theme: (name: Name) => KnobTheme<Standard>\n /** Every token with the initial theme's knobs: what the root declares, and what `t` reads. */\n readonly root: StandardTokens\n /** Each other theme's knobs, under its attribute on the root element, for the `theme` layer. */\n readonly scoped: StyleValue\n}\n\n/**\n * `themes` installed by their keys, `initial` shown until the Model chooses\n * another. A name is a key, so it is unique, and `Name` is the Schema of the\n * Model field that holds the active one.\n */\nexport const make = <const Record extends { readonly [name: string]: KnobTheme<Standard> }>(\n themes: Record,\n options: { readonly initial: keyof Record & string; readonly attribute?: string },\n): Themes<keyof Record & string> => {\n const names = Object.keys(themes) as ReadonlyArray<keyof Record & string>\n const attribute = options.attribute ?? 'data-theme'\n const theme = (name: keyof Record & string) => themes[name]!\n return {\n Name: Schema.Literals(names),\n names,\n initial: options.initial,\n attribute,\n theme,\n root: standardOf(theme(options.initial)),\n scoped: global(\n names\n .filter(name => name !== options.initial)\n .map(name => knobRule(`:root[${attribute}=\"${name}\"]`, theme(name)))\n .join(''),\n ),\n }\n}\n\n/**\n * Shows `name` on the root element, as a Command's effect: the initial theme\n * removes the attribute, so the root's own declarations apply.\n */\nexport const apply = <Name extends string>(themes: Themes<Name>, name: Name): Effect.Effect<void> =>\n Effect.sync(() => {\n const root = document.documentElement\n if (name === themes.initial) root.removeAttribute(themes.attribute)\n else root.setAttribute(themes.attribute, name)\n })\n\n/** The storage key a chosen theme's name is kept under, unless one is given. */\nexport const THEME_KEY = 'foldkit:theme'\n\n/**\n * The text of a `<script>` for the document's head: it shows the theme whose\n * name is kept under `key`, so a reader who chose one never sees the initial\n * theme for a frame. A kept name that is not one of `themes` (a theme a later\n * build removed), and storage that throws, leave the initial theme.\n */\nexport const script = <Name extends string>(\n themes: Themes<Name>,\n key: string = THEME_KEY,\n): string =>\n `(function(){try{var n=localStorage.getItem(${scriptLiteral(key)});` +\n `if(${scriptLiteral(themes.names.filter(name => name !== themes.initial))}.indexOf(n)!==-1)` +\n `document.documentElement.setAttribute(${scriptLiteral(themes.attribute)},n)}catch(e){}})()`\n\n/**\n * Shows `name`, as `apply` does, and keeps it under `key` for the next visit,\n * as a Command's effect: the initial theme keeps nothing. Storage that throws\n * still shows it on this page.\n */\nexport const choose = <Name extends string>(\n themes: Themes<Name>,\n name: Name,\n key: string = THEME_KEY,\n): Effect.Effect<void> =>\n apply(themes, name).pipe(\n Effect.andThen(\n Effect.sync(() => {\n try {\n if (name === themes.initial) localStorage.removeItem(key)\n else localStorage.setItem(key, name)\n } catch {\n // Storage refused (a private window, a full quota): this visit keeps it.\n }\n }),\n ),\n )\n\n/**\n * `theme` on the elements `selector` matches, below the root: its knobs and\n * every derivation again. A token resolves where it is declared, so knobs\n * alone under a subtree would change nothing derived from them there.\n */\nexport const scope = (theme: KnobTheme<Standard>, selector: string): StyleValue => {\n const { knob: _knob, ...derived } = shipped\n return global(`${selector}{${declarations(derived)}}${knobRule(selector, theme)}`)\n}\n","/**\n * A theme's tokens as `:root` custom properties, for the page stylesheet.\n * Unlayered: the page decides which layer with `Layers.in`.\n */\nimport { global, type StyleValue } from '../styleValue.js'\nimport { VAR_PREFIX, type ThemeTokens } from './core.js'\n\nexport interface RootOptions {\n /** Tokens present in this theme are left out, so a scale shipped in another layer goes out once. */\n readonly omit?: ThemeTokens\n /** Default `'light dark'`, so `lightDark` tokens resolve. */\n readonly colorScheme?: 'light dark' | 'light' | 'dark'\n}\n\n/**\n * Every token as `--fk-group-name:value`, in authored order. `omit` is\n * matched token by token, not group by group: two themes can both carry a\n * `knob` group (the scales' density beside a palette's hues) and only the\n * names `omit` has are skipped.\n */\nconst declarations = (theme: ThemeTokens, omit?: ThemeTokens): ReadonlyArray<string> =>\n Object.entries(theme).flatMap(([group, names]) =>\n Object.entries(names).flatMap(([name, value]) =>\n omit !== undefined && Object.hasOwn(omit[group] ?? {}, name)\n ? []\n : [`${VAR_PREFIX}-${group}-${name}:${value}`],\n ),\n )\n\nexport const root = (theme: ThemeTokens, options?: RootOptions): StyleValue =>\n global(\n `:root{${[...declarations(theme, options?.omit), `color-scheme:${options?.colorScheme ?? 'light dark'}`].join(';')}}`,\n )\n\n/** Some of a theme's tokens, by the theme's own group and token names. */\nexport type Overrides<T extends ThemeTokens> = {\n readonly [G in keyof T]?: { readonly [N in keyof T[G]]?: string }\n}\n\n/**\n * Token overrides under `selector`: a named theme the Model selects with a\n * root attribute (`:root[data-theme=\"ocean\"]`), or a scheme the user chose\n * (`:root[data-color-scheme=\"dark\"]`). Which one is active is the Model's\n * fact; this only says what it means. On the root element an overridden knob\n * re-derives every token; under a subtree it changes only the tokens it\n * overrides itself, since a token resolves where it is declared: scope a\n * theme to a subtree with `Theme.scope`, which declares the derivations there\n * too.\n *\n * `theme` is the theme being overridden and is read only for its type, so a\n * group or token it lacks is a type error rather than a variable nothing reads.\n */\nexport const scoped = <T extends ThemeTokens>(\n _theme: T,\n selector: string,\n overrides: Overrides<T>,\n): StyleValue => {\n const tokens: Record<string, Record<string, string>> = {}\n for (const [group, names] of Object.entries(overrides)) {\n const defined: Record<string, string> = {}\n for (const [name, value] of Object.entries(names ?? {})) {\n if (typeof value === 'string') defined[name] = value\n }\n tokens[group] = defined\n }\n return global(`${selector}{${declarations(tokens).join(';')}}`)\n}\n"],"mappings":";;;;;;;;;;;;;;;AAaA,MAAM,KAAK,OAAe,SAAiB,YAAY,MAAM,GAAG,KAAK;AACrE,MAAM,MAAM,OAAe,SAAiB,cAAc,MAAM,IAAI,KAAK;AACzE,MAAM,UAAU,WAAmB,GAAG,SAAS,IAAI,MAAM,IAAI,GAAG,KAAK,IAAI,MAAM;;AAE/E,MAAM,QAAQ,OAAe,GAAW,MAAc,cAAc,MAAM,GAAG,EAAE,GAAG,EAAE;AACpF,MAAM,SAAS,OAAe,IAAY,OACxC,KAAK,OAAO,UAAU,OAAO,EAAE,EAAE,IAAI,UAAU,OAAO,EAAE,EAAE,EAAE;AAC9D,MAAM,SAAS,OAAe,IAAY,OACxC,KAAK,OAAO,UAAU,OAAO,EAAE,EAAE,IAAI,YAAY,GAAG,EAAE;;AAExD,MAAM,SAAS,OAAe,QAAgB,cAAc,MAAM,OAAO,IAAI;;AAE7E,MAAM,YAAY,UAChB,cAAc,MAAM;;AAEtB,MAAM,OAAO,UAAkB,GAAG,KAAK,OAAO,OAAO,GAAG,GAAG,KAAK,OAAO,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rH;;;;;;;;;;;;;;AAoBF,MAAa,UACX,QACA,UACA,cACe;CACf,MAAM,SAAiD,CAAC;CACxD,KAAK,MAAM,CAAC,OAAO,UAAU,OAAO,QAAQ,SAAS,GAAG;EACtD,MAAM,UAAkC,CAAC;EACzC,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,SAAS,CAAC,CAAC,GACpD,IAAI,OAAO,UAAU,UAAU,QAAQ,QAAQ;EAEjD,OAAO,SAAS;CAClB;CACA,OAAO,OAAO,GAAG,SAAS,GAAG,aAAa,MAAM,CAAC,CAAC,KAAK,GAAG,EAAE,EAAE;AAChE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"themes-B9jxH5tK.d.mts","names":["Knob.Knob","Knob.Schemed","Knob.Choice","make","Knob.Variables"],"sources":["../src/theme/knob.ts","../src/theme/knobs.ts","../src/theme/root.ts","../src/theme/themes.ts"],"mappings":";;;;;;;;;KAUY,UAAU,iCAAiC,SAAS,OAAO;;KAG3D;WAEG;WACA;WACA;WACA;WACA;;WAEA;WAAyB,SAAS;;WAClC;;;;;;;UAOE,KAAK,OAAO;WAClB,QAAQ,OAAO,MAAM;;EAE9B,MAAM,OAAO,QAAQ,SAAS,QAAQ,OAAO;WACpC,OAAO,UAAU;;WAEjB,SAAS;;WAET;;WAEA;WACA,SAAS;;UAMV,MAAM;;WAEL,UAAU;WACV;;WAEA;WACA;WACA;WACA;WACA;WACA;;;cAqBE,eAXJ,qBAAmB,SAAW,MAAM,UAAQ,aAAa;;cAarD,cAAe,qBAAmB,SACpC,KAAK,MAAM,iCAClB,QAAQ,KAAK,MAAM,oCAA+B,aAAA;;cAGzC,gBAlBJ,qBAAmB,SAAW,MAAM,UAAQ,aAAa;;cAoBrD,SAAM,qCApBV,qBAAmB,SAAW,MAAM,UAAQ,aAAa;;;;;;;UA4BjD,QAAQ,sBAAsB,6BAA6B;WACtD;WAAyB;GAC7C,QAAQ;WAEC,OAAO,aAAa;WACpB,MAAM,aAAa;;cAGj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;;;;;;;;;;IAUA;IACA;IACA;IACA;IACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAeA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;;KAIQ,iBAAiB;;;cC5ThB,QAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgCf;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;;IAGA;IACA;IACA;IACA;IACA;IAEA;IAEA;;;IAGA;IACA;IACA;;;IAGA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;;IAGA;IACA;IACA;IACA;;;IAIA;IACA;IACA;IACA;IACA;;;IAGU;;;IAOV;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAIA;IAIA;;;IASA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;;IAQA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;;IAMA;IACA;IACA;IACA;;;;;;;;;;;;;;;;;IAUA;IACA;IACA;IACA;;;IAOA;IACA;IACA;IACA;IACA;IACA;IACA;IAIA;IACA;IACA;;;IAGA;IACA;IACA;IACA;;;IAMA;IACA;IACA;IACA;;;KAIQ,gBAAgB;;KAGhB,OAAO,cAAc;;;;;;;;;;;;cAapB,SAAM,MAAU;;;;;;;;;;;;;iBAmBb;iBACA,OAAO,eAAe,eAAe;;;;;;;;cAcxC,QAAK,gBACF,eACD;WAGJ;WACA;WACA;;;;;;;;;;;;;;cAmBE,aAAU;WAAuB;WAAsB;;;KAIxD;;;;;;cAOC,OAAI,MAAU;WAAkB;WAA2B;;;;;;;cAmB3D,mBAAgB;WAClB;cAAwB;;MAC/B,SAAS;;;;;;;;cA0BA,cAAe,oBAAoB,SAAS,yBAAuB,cAClE,aACC,4BACA,WAAW"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"tokens-DIIMgir1.mjs","names":["Knob.angle","Knob.schemed","Knob.number","Knob.percent","Knob.choice","Knob.length","Knob.font"],"sources":["../src/theme/knob.ts","../src/theme/shadows.ts","../src/theme/knobs.ts","../src/theme/iconMasks.ts","../src/theme/tokens.ts"],"sourcesContent":["/**\n * Knobs: the typed inputs a theme sets. Each knob is a Schema for the value\n * a theme writes, the CSS variables that value writes, and what those\n * variables hold when no theme sets it (its default, or the expression it\n * follows). Every token derives from knob variables, so a theme is only its\n * knob values (`docs/theme-knobs.md`).\n */\nimport { Schema } from 'effect'\n\n/** A knob's variables, by the name after `--fk-knob-`, each a CSS value. */\nexport type Variables<Names extends string = string> = Readonly<Record<Names, string>>\n\n/** How a knob is drawn as a control: a range for a number, a choice of options, a font stack. */\nexport type Control =\n | {\n readonly kind: 'range'\n readonly min: number\n readonly max: number\n readonly step: number\n readonly unit: string\n }\n | { readonly kind: 'choice'; readonly options: ReadonlyArray<string> }\n | { readonly kind: 'font' }\n\n/**\n * A knob of `Value` writing the variables `Names`. `write` gives those a\n * value sets (a light-only value leaves the dark one out); `unset` gives\n * every one, as no theme set it.\n */\nexport interface Knob<Value, Names extends string = string> {\n readonly schema: Schema.Codec<Value>\n /** A method, so a knob of any value is a `Knob<unknown>`. */\n write(value: Value): Readonly<Partial<Record<Names, string>>>\n readonly unset: Variables<Names>\n /** The value it stands at unset: a control's starting point. */\n readonly default: Value\n /** What the knob is called: a control's label. */\n readonly title: string\n /** What the knob does, in a sentence: a control's tooltip. */\n readonly description: string\n readonly control: Control\n}\n\n/** A computed number without float noise: `0.02`, not `0.019999999999999997`. */\nconst num = (value: number) => String(Number(value.toFixed(4)))\n\ninterface Range<Name extends string> {\n /** The variable it writes, the name after `--fk-knob-`. */\n readonly variable: Name\n readonly default: number\n /** A CSS expression it holds while unset, in place of `default` (`var(--fk-hue-accent)`). */\n readonly follows?: string\n readonly min: number\n readonly max: number\n readonly step: number\n readonly title: string\n readonly description: string\n}\n\n/** `{ [name]: value }` with its one key's name kept in its type. */\nconst one = <Name extends string>(name: Name, value: string) =>\n ({ [name]: value }) as Variables<Name>\n\n/** A number written with `unit` after it, refused outside `min` to `max`. */\nconst ranged =\n (unit: string) =>\n <const Name extends string>(options: Range<Name>): Knob<number, Name> => ({\n schema: Schema.Number.check(Schema.isBetween({ minimum: options.min, maximum: options.max })),\n write: value => one(options.variable, `${num(value)}${unit}`),\n unset: one(options.variable, options.follows ?? `${num(options.default)}${unit}`),\n default: options.default,\n title: options.title,\n description: options.description,\n control: { kind: 'range', min: options.min, max: options.max, step: options.step, unit },\n })\n\n/** A plain number: a multiplier, a chroma. */\nexport const number = ranged('')\n/** A number of degrees around the hue wheel. */\nexport const angle = <const Name extends string>(\n options: Omit<Range<Name>, 'min' | 'max' | 'step'> &\n Partial<Pick<Range<Name>, 'min' | 'max' | 'step'>>,\n) => number({ min: -360, max: 360, step: 1, ...options })\n/** A percentage, written with `%`. */\nexport const percent = ranged('%')\n/** A length in `unit`, written with it (`1px`, `-0.025em`). */\nexport const length = (unit: 'px' | 'em' | 'rem') => ranged(unit)\n\n/**\n * A value per scheme: `{ light, dark }`, or a bare value for the light scheme\n * alone, the dark keeping its default (a theme's accent lightness rarely\n * suits a dark page). `dark` is the knob for the dark variable.\n */\n/** A knob per scheme, and each half as a knob of its own: its range, its title. */\nexport interface Schemed<Light extends string, Dark extends string> extends Knob<\n number | { readonly light?: number; readonly dark?: number },\n Light | Dark\n> {\n readonly light: Knob<number, Light>\n readonly dark: Knob<number, Dark>\n}\n\nexport const schemed = <Light extends string, Dark extends string>(\n light: Knob<number, Light>,\n dark: Knob<number, Dark>,\n): Schemed<Light, Dark> => ({\n light,\n dark,\n schema: Schema.Union([\n light.schema,\n Schema.Struct({\n light: Schema.optionalKey(light.schema),\n dark: Schema.optionalKey(dark.schema),\n }),\n ]),\n // Light's variables, dark's, or both: each a partial record of the two\n // (TypeScript does not widen a record over generic keys by itself).\n write: value =>\n (typeof value === 'number'\n ? light.write(value)\n : {\n ...(value.light === undefined ? {} : light.write(value.light)),\n ...(value.dark === undefined ? {} : dark.write(value.dark)),\n }) as Readonly<Partial<Record<Light | Dark, string>>>,\n unset: { ...light.unset, ...dark.unset },\n default: { light: light.default, dark: dark.default },\n title: light.title,\n description: light.description,\n control: light.control,\n})\n\n/** A choice's options: every one writes the same variables. */\ntype Options = Readonly<Record<string, Variables>>\n\n/** The variables every option of `O` writes. */\ntype Written<O extends Options> = keyof O[keyof O] & string\n\n/** A knob that is one of its `options`, each in full, as `write` gives a chosen one. */\nexport interface Choice<O extends Options> extends Knob<keyof O & string, Written<O>> {\n readonly options: { readonly [K in keyof O]: Variables<Written<O>> }\n}\n\n/**\n * One of `options`, each the variables it writes: choosing `spring` writes\n * the ease variable as `var(--fk-motion-spring)`. Every option names the\n * same variables, so switching writes each again.\n */\nexport const choice = <const O extends Options>(options: {\n readonly default: keyof O & string\n readonly options: O\n readonly title: string\n readonly description: string\n}): Choice<O> => {\n const names = Object.keys(options.options) as ReadonlyArray<keyof O & string>\n return {\n schema: Schema.Literals(names),\n write: value => options.options[value]!,\n unset: options.options[options.default]!,\n options: options.options,\n default: options.default,\n title: options.title,\n description: options.description,\n control: { kind: 'choice', options: names },\n }\n}\n\n/** A font stack: any non-empty CSS `font-family` value. */\nexport const font = <const Name extends string>(options: {\n readonly variable: Name\n readonly default: string\n readonly follows?: string\n readonly title: string\n readonly description: string\n}): Knob<string, Name> => ({\n schema: Schema.NonEmptyString,\n write: value => one(options.variable, value),\n unset: one(options.variable, options.follows ?? options.default),\n default: options.default,\n title: options.title,\n description: options.description,\n control: { kind: 'font' },\n})\n","/**\n * The shadow lists the shadow knobs choose between: the elevation scale drawn\n * soft or hard (`shadow.style`), and a control's relief (`shadow.relief`).\n * Each is drawn in `shadow.color`, which a palette sets, and faded by the\n * `shadow-strength` knob.\n */\n\nconst shade = 'var(--fk-shadow-color, oklch(0% 0 0 / 0.12))'\nconst strength = 'var(--fk-knob-shadow-strength, 100%)'\n\n/** No shadow, as a shadow: one a transition can interpolate from, unlike `none`. */\nexport const FLAT = '0 0 #0000'\n\n/** Layers in the shadow's color, faded by `shadow-strength`. */\nexport const shadow = (...layers: ReadonlyArray<string>) =>\n layers.map(layer => `${layer} color-mix(in oklch, ${shade} ${strength}, transparent)`).join(', ')\n\n/** A hard step: the shadow's color, nearly opaque, offset with no blur. */\nconst hard = (offset: number) =>\n `${offset}px ${offset}px 0 0 color-mix(in oklch, oklch(from ${shade} l c h / 0.9) ${strength}, transparent)`\n\n/** An edge of a bevel: `color` faded by `shadow-strength`, as every shadow is. */\nconst edge = (color: string) => `color-mix(in oklch, ${color} ${strength}, transparent)`\n/** Lit from the top left: white, dimmer in a dark scheme, where white would glare. */\nconst lit = (alpha: number, darkAlpha: number) =>\n edge(`light-dark(oklch(100% 0 0 / ${alpha}), oklch(100% 0 0 / ${darkAlpha}))`)\nconst shaded = (alpha: number) => edge(`oklch(from ${shade} l c h / ${alpha})`)\n\n/**\n * Two rings of edges, lit at the top left and shaded at the bottom right,\n * flipped when sunken. Raised, the outer ring is drawn outside the\n * border: a button's border carries its fill, and an inset ring lay inside\n * it, so its darkest edge sat within a line of the button's own color.\n */\nconst raisedBevel = [\n `1px 1px 0 0 ${shaded(0.9)}`,\n `-1px -1px 0 0 ${lit(1, 0.3)}`,\n `inset -1px -1px 0 0 ${shaded(0.4)}`,\n `inset 1px 1px 0 0 ${lit(0.5, 0.12)}`,\n].join(', ')\nconst sunkenBevel = [\n `inset 1px 1px 0 0 ${shaded(0.9)}`,\n `inset -1px -1px 0 0 ${lit(1, 0.3)}`,\n `inset 2px 2px 0 0 ${shaded(0.4)}`,\n `inset -2px -2px 0 0 ${lit(0.5, 0.12)}`,\n].join(', ')\n\n/**\n * Raised a little to a lot: a pressed control, a lifted cell, a menu, a\n * dialog. Soft, each step is a tight contact layer plus a wide ambient one,\n * so large surfaces diffuse instead of ringing; `2xl` is the modal step.\n * Hard, as retro and brutalist interfaces draw it, each step is a solid\n * offset copy, deeper the higher it sits.\n */\nexport const elevation = {\n soft: {\n xs: shadow('0 1px 2px 0'),\n sm: shadow('0 1px 3px 0', '0 1px 2px -1px'),\n md: shadow('0 4px 6px -1px', '0 2px 4px -2px'),\n lg: shadow('0 12px 28px -8px', '0 4px 8px -4px'),\n xl: shadow('0 24px 48px -12px', '0 8px 16px -8px'),\n '2xl': shadow('0 32px 64px -16px', '0 12px 24px -12px'),\n inset: shadow('inset 0 2px 4px 0'),\n },\n hard: {\n xs: hard(1),\n sm: hard(2),\n md: hard(3),\n lg: hard(4),\n xl: hard(6),\n '2xl': hard(8),\n inset: `inset ${hard(2)}`,\n },\n} as const\n\n/**\n * How controls stand off the page: a button's resting shadow (`raised`), the\n * one it takes held or on (`pressed`), and a field's well (`field`). `flat`\n * gives them none; `soft` lifts buttons a hair and sinks fields a hair;\n * `hard` drops solid offset copies; `bevel` draws lit and shaded edges, the\n * raised and sunken chrome of a 1990s desktop.\n */\nexport const reliefs = {\n flat: { raised: FLAT, pressed: FLAT, field: FLAT },\n soft: {\n raised: shadow('0 1px 2px 0'),\n pressed: shadow('inset 0 1px 2px 0'),\n field: shadow('inset 0 1px 2px 0'),\n },\n hard: { raised: hard(2), pressed: hard(1), field: hard(2) },\n bevel: { raised: raisedBevel, pressed: sunkenBevel, field: sunkenBevel },\n} as const\n\n/** `lists` as knob variables, each name prefixed: `{ xs }` to `{ 'shadow-xs' }`. */\nexport const asVariables = <const P extends string, L extends Readonly<Record<string, string>>>(\n prefix: P,\n lists: L,\n) =>\n Object.fromEntries(Object.entries(lists).map(([name, list]) => [`${prefix}-${name}`, list])) as {\n readonly [K in keyof L & string as `${P}-${K}`]: string\n }\n","/**\n * The standard knobs, and a theme as a typed set of their values.\n *\n * `Knobs.standard` is every knob the shipped tokens and palette read, grouped\n * by concern. A theme (`Theme.make`) holds the values it sets and nothing\n * else; `Theme.variables` writes them, every knob it leaves unset holding its\n * default or the expression it follows (`docs/theme-knobs.md`).\n */\nimport { Option, Schema } from 'effect'\nimport { pipeSelf, type Pipeable } from '../pipe.js'\nimport { define } from './core.js'\nimport * as Knob from './knob.js'\nimport { asVariables, elevation, reliefs } from './shadows.js'\n\n/** Knobs grouped one level deep: `{ shape: { radius: Knob.number(...) } }`. */\nexport type KnobSet = {\n readonly [group: string]: { readonly [name: string]: Knob.Knob<unknown> }\n}\n\n/** The value a theme writes to `K`. */\nexport type ValueOf<K> = K extends Knob.Knob<infer V> ? V : never\n\n/** Values for some of `S`'s knobs, by group and name. */\nexport type Values<S extends KnobSet> = {\n readonly [G in keyof S]?: { readonly [N in keyof S[G]]?: ValueOf<S[G][N]> }\n}\n\nconst hue = <const Name extends string>(\n variable: Name,\n value: number,\n title: string,\n description: string,\n) => Knob.angle({ variable, default: value, min: 0, max: 360, title, description })\nconst ref = (group: string, name: string) => `var(--fk-${group}-${name})`\n\nexport const standard = {\n accent: {\n hue: Knob.angle({\n title: 'Hue',\n variable: 'accent-h',\n default: 264,\n min: 0,\n max: 360,\n description:\n 'The accent’s place on the color wheel, in degrees: about 25 is red, 145 green, 264 blue. Buttons, links, focus rings and selections take it.',\n }),\n chroma: Knob.schemed(\n Knob.number({\n title: 'Chroma',\n variable: 'accent-c',\n default: 0.17,\n min: 0,\n max: 0.4,\n step: 0.005,\n description:\n 'How vivid the accent is. 0 is grey; around 0.2 is as vivid as most screens show.',\n }),\n Knob.number({\n title: 'Chroma, dark',\n variable: 'accent-c-dark',\n default: 0.2,\n // A little stronger on a dark page, where the same chroma reads duller.\n follows: `min(0.4, calc(${ref('knob', 'accent-c')} + 0.03))`,\n min: 0,\n max: 0.4,\n step: 0.005,\n description: 'How vivid the accent is in the dark scheme.',\n }),\n ),\n lightness: Knob.schemed(\n Knob.percent({\n title: 'Lightness',\n variable: 'accent-l',\n default: 52,\n min: 5,\n max: 98,\n step: 1,\n description:\n 'How light the accent is in the light scheme: near 10 a black accent, as shadcn’s.',\n }),\n Knob.percent({\n title: 'Lightness, dark',\n variable: 'accent-l-dark',\n default: 70,\n min: 5,\n max: 98,\n step: 1,\n description: 'How light the accent is in the dark scheme.',\n }),\n ),\n secondaryShift: Knob.angle({\n title: 'Secondary hue shift',\n variable: 'secondary-shift',\n default: 60,\n description: 'Degrees from the accent’s hue to the secondary family’s.',\n }),\n tertiaryShift: Knob.angle({\n title: 'Tertiary hue shift',\n variable: 'tertiary-shift',\n default: -90,\n description: 'Degrees from the accent’s hue to the tertiary family’s.',\n }),\n },\n surface: {\n hue: Knob.angle({\n title: 'Neutral hue',\n variable: 'neutral-h',\n default: 264,\n follows: ref('hue', 'accent'),\n min: 0,\n max: 360,\n description:\n 'The hue the neutrals are mixed from: the page, text and borders. Unset, the accent’s own.',\n }),\n saturation: Knob.schemed(\n Knob.number({\n title: 'Surface tint',\n variable: 'surface-c',\n default: 0.015,\n min: 0,\n max: 0.04,\n step: 0.001,\n description: 'How much the page, cards and borders lean toward their hue. 0 is pure grey.',\n }),\n Knob.number({\n title: 'Surface tint, dark',\n variable: 'surface-c-dark',\n default: 0.02,\n follows: `calc(${ref('knob', 'surface-c')} * 4 / 3)`,\n min: 0,\n max: 0.04,\n step: 0.001,\n description: 'How much the dark scheme’s surfaces lean toward their hue.',\n }),\n ),\n lightness: Knob.schemed(\n Knob.percent({\n title: 'Page lightness',\n variable: 'base-l',\n default: 97.5,\n min: 75,\n max: 100,\n step: 0.5,\n description:\n 'How light the page is in the light scheme. Cards, fields and hovers step from it.',\n }),\n Knob.percent({\n title: 'Page lightness, dark',\n variable: 'base-l-dark',\n default: 22,\n min: 6,\n max: 36,\n step: 0.5,\n description:\n 'How light the page is in the dark scheme. Cards, fields and hovers step from it.',\n }),\n ),\n contrast: Knob.percent({\n title: 'Surface contrast',\n variable: 'surface-contrast',\n default: 26,\n min: 0,\n max: 100,\n step: 1,\n description:\n 'How far apart the surface steps are: the page, a card on it, a field, a hover. Low is flat; high sets each apart.',\n }),\n textContrast: Knob.number({\n title: 'Text contrast',\n variable: 'contrast-factor',\n default: 1,\n min: 0,\n max: 2,\n step: 0.05,\n description: 'Multiplies the text’s chroma.',\n }),\n hover: Knob.choice({\n title: 'Hover',\n default: 'surface',\n options: {\n surface: { 'surface-ink': '1', 'state-ink': 'currentColor' },\n neutral: { 'surface-ink': '0', 'state-ink': 'currentColor' },\n accent: { 'surface-ink': '1', 'state-ink': ref('accent', 'ink') },\n },\n description:\n 'What a hovered row or button is tinted with: a step of the surface, a plain grey, or the accent.',\n }),\n },\n shape: {\n radius: Knob.number({\n title: 'Radius',\n variable: 'radius-factor',\n default: 1,\n min: 0,\n max: 2.5,\n step: 0.05,\n description:\n 'Multiplies every corner. 0 is square. A control inside a card keeps inside the card’s corner.',\n }),\n density: Knob.number({\n title: 'Density',\n variable: 'density',\n default: 1,\n min: 0.75,\n max: 1.3,\n step: 0.05,\n description:\n 'Multiplies spacing: padding, gaps and margins. Below 1 is tighter, above 1 roomier.',\n }),\n size: Knob.choice({\n title: 'Size',\n default: 'default',\n options: { default: { step: '0' }, compact: { step: '1' } },\n description: 'How tall controls are: 36px, or a compact 28px.',\n }),\n controls: Knob.choice({\n title: 'Buttons',\n default: 'rounded',\n options: { rounded: { 'control-round': '0' }, pill: { 'control-round': '1' } },\n description: 'The corners of buttons: the radius’s, or fully round pills.',\n }),\n border: Knob.length('px')({\n title: 'Border',\n variable: 'border-width',\n default: 1,\n min: 1,\n max: 3,\n step: 1,\n description: 'The thinnest border’s width; the thicker ones step up from it.',\n }),\n // How much of the text's own ink the outlines take over the palette's\n // lines, at three strengths for subtle, default and overt.\n outlines: Knob.choice({\n title: 'Outlines',\n default: 'soft',\n options: {\n soft: {\n 'outline-ink': '0',\n 'outline-ink-subtle': '0%',\n 'outline-ink-default': '0%',\n 'outline-ink-overt': '0%',\n },\n strong: {\n 'outline-ink': '1',\n 'outline-ink-subtle': '22%',\n 'outline-ink-default': '48%',\n 'outline-ink-overt': '72%',\n },\n ink: {\n 'outline-ink': '1',\n 'outline-ink-subtle': '45%',\n 'outline-ink-default': '88%',\n 'outline-ink-overt': '100%',\n },\n },\n description:\n 'How much borders show: the palette’s soft lines, darker ones, or lines in the text’s own ink.',\n }),\n },\n type: {\n body: Knob.font({\n title: 'Font',\n variable: 'font-body',\n default: 'system-ui, sans-serif',\n description: 'The typeface for body text and controls.',\n }),\n heading: Knob.font({\n title: 'Heading font',\n variable: 'font-heading',\n default: 'inherit',\n description: 'The typeface for headings. `inherit` is the body’s.',\n }),\n headingWeight: Knob.number({\n title: 'Heading weight',\n variable: 'heading-weight',\n default: 600,\n min: 100,\n max: 900,\n step: 100,\n description: 'How bold headings are, from 300 (light) to 900 (black).',\n }),\n headingTracking: Knob.length('em')({\n title: 'Heading tracking',\n variable: 'heading-tracking',\n default: -0.01,\n min: -0.05,\n max: 0.05,\n step: 0.005,\n description:\n 'Headings’ letter spacing, in em: negative draws letters together, positive spreads them.',\n }),\n scale: Knob.number({\n title: 'Text size',\n variable: 'text-scale',\n default: 1,\n min: 0.8,\n max: 1.3,\n step: 0.025,\n description: 'Multiplies every text size, headings and body alike.',\n }),\n headingScale: Knob.number({\n title: 'Heading scale',\n variable: 'heading-scale',\n default: 1,\n min: 0.4,\n max: 1.8,\n step: 0.05,\n description:\n 'How far headings stand above body text: below 1 nearer its size, above 1 larger.',\n }),\n leading: Knob.number({\n title: 'Line height',\n variable: 'leading',\n default: 1,\n min: 0.85,\n max: 1.3,\n step: 0.05,\n description: 'Multiplies line height, the space each line of text takes.',\n }),\n },\n icon: {\n size: Knob.number({\n title: 'Icon size',\n variable: 'icon-scale',\n default: 1,\n min: 0.75,\n max: 1.5,\n step: 0.05,\n description:\n 'Multiplies every icon a component draws, beside its words: 1 is 16px, or 14px compact.',\n }),\n stroke: Knob.length('px')({\n title: 'Glyph stroke',\n variable: 'glyph-width',\n default: 2,\n min: 1,\n max: 3,\n step: 0.25,\n description:\n 'The width of the strokes components draw themselves: checks, chevrons, a tree’s guides. An icon pack keeps its own.',\n }),\n },\n motion: {\n scale: Knob.number({\n title: 'Motion',\n variable: 'motion',\n default: 1,\n min: 0,\n max: 2,\n step: 0.1,\n description: 'Multiplies how long every transition takes. 0 stills them; 2 is twice as slow.',\n }),\n easing: Knob.choice({\n title: 'Easing',\n default: 'ease',\n options: { ease: { ease: 'ease-out' }, spring: { ease: ref('motion', 'spring') } },\n description: 'How transitions move: along an easing curve, or on a spring that settles.',\n }),\n },\n shadow: {\n style: Knob.choice({\n title: 'Shadows',\n default: 'soft',\n options: {\n soft: asVariables('shadow', elevation.soft),\n hard: asVariables('shadow', elevation.hard),\n },\n description: 'Shadows that diffuse softly, or hard, solid offset copies.',\n }),\n relief: Knob.choice({\n title: 'Controls',\n default: 'flat',\n options: {\n flat: asVariables('relief', reliefs.flat),\n soft: asVariables('relief', reliefs.soft),\n hard: asVariables('relief', reliefs.hard),\n bevel: asVariables('relief', reliefs.bevel),\n },\n description:\n 'How buttons stand off the page and fields sink into it: flat, or a soft, hard or bevelled edge.',\n }),\n strength: Knob.percent({\n title: 'Shadow',\n variable: 'shadow-strength',\n default: 100,\n min: 0,\n max: 100,\n step: 1,\n description: 'How strong shadows are. 0 removes them.',\n }),\n hue: Knob.angle({\n title: 'Shadow hue',\n variable: 'shadow-h',\n default: 264,\n follows: ref('hue', 'neutral'),\n min: 0,\n max: 360,\n description: 'The hue every shadow is tinted with. Unset, the neutrals’.',\n }),\n chroma: Knob.number({\n title: 'Shadow tint',\n variable: 'shadow-c',\n default: 0.03,\n follows: `calc(${ref('knob', 'surface-c')} * 2)`,\n min: 0,\n max: 0.1,\n step: 0.005,\n description: 'How tinted every shadow is. Unset, twice the surfaces’ saturation.',\n }),\n },\n menu: {\n highlight: Knob.choice({\n title: 'Menu accent',\n default: 'subtle',\n options: { subtle: { 'popup-bold': '0' }, bold: { 'popup-bold': '1' } },\n description:\n 'How the highlighted row of a menu shows: a subtle tint, or filled with the accent.',\n }),\n panel: Knob.choice({\n title: 'Menu color',\n default: 'default',\n options: {\n default: { 'popup-invert': '0', 'popup-alpha': '1', 'popup-blur': '0px' },\n inverted: { 'popup-invert': '1', 'popup-alpha': '1', 'popup-blur': '0px' },\n translucent: { 'popup-invert': '0', 'popup-alpha': '0.8', 'popup-blur': '12px' },\n 'inverted-translucent': { 'popup-invert': '1', 'popup-alpha': '0.8', 'popup-blur': '12px' },\n },\n description:\n 'The background of menus and popovers: the page’s, inverted (dark on a light page), or translucent, the page blurred behind it.',\n }),\n },\n feedback: {\n success: hue('success-h', 145, 'Success', 'The hue of success: a saved form, a passing check.'),\n warning: hue('warning-h', 75, 'Warning', 'The hue of a warning.'),\n error: hue('error-h', 25, 'Error', 'The hue of an error: a refused field, a failed save.'),\n info: hue('info-h', 245, 'Info', 'The hue of a neutral notice.'),\n },\n code: {\n chroma: Knob.number({\n title: 'Code chroma',\n variable: 'syntax-c',\n default: 0.14,\n min: 0,\n max: 0.4,\n step: 0.01,\n description: 'How vivid code’s colors are.',\n }),\n },\n chart: {\n hue: hue(\n 'chart-h',\n 255,\n 'Chart hue',\n 'The first chart series’ hue; the other four keep their places around it.',\n ),\n },\n scales: {\n chroma: Knob.number({\n title: 'Scale vividness',\n variable: 'scale-c',\n default: 1,\n min: 0,\n max: 1.5,\n step: 0.05,\n description:\n 'How vivid the seven color scales are, as a share of each step’s own. 0 turns them grey.',\n }),\n red: hue('red-h', 25, 'Red', 'The red scale’s hue.'),\n orange: hue('orange-h', 55, 'Orange', 'The orange scale’s hue.'),\n yellow: hue('yellow-h', 90, 'Yellow', 'The yellow scale’s hue.'),\n green: hue('green-h', 145, 'Green', 'The green scale’s hue.'),\n teal: hue('teal-h', 185, 'Teal', 'The teal scale’s hue.'),\n blue: hue('blue-h', 255, 'Blue', 'The blue scale’s hue.'),\n purple: hue('purple-h', 300, 'Purple', 'The purple scale’s hue.'),\n },\n} as const satisfies KnobSet\n\nexport type Standard = typeof standard\n\n/** A theme: the knobs it may set, the values it sets, and what it is called in a list. */\nexport interface KnobTheme<S extends KnobSet = Standard> extends Pipeable<KnobTheme<S>> {\n readonly knobs: S\n readonly values: Values<S>\n readonly title: Option.Option<string>\n readonly description: Option.Option<string>\n}\n\nconst theme = <S extends KnobSet>(\n knobs: S,\n values: Values<S>,\n title: Option.Option<string>,\n description: Option.Option<string>,\n): KnobTheme<S> => ({\n knobs,\n values,\n title,\n description,\n pipe(...fns: ReadonlyArray<(self: KnobTheme<S>) => KnobTheme<S>>) {\n return pipeSelf(this, fns) as KnobTheme<S>\n },\n})\n\n/** Each value checked against its knob: an unknown group or knob, or a value out of range, throws. */\nconst checked = <S extends KnobSet>(knobs: S, values: Values<S>): Values<S> => {\n for (const [group, names] of Object.entries(values)) {\n if (!Object.hasOwn(knobs, group)) throw new Error(`Theme: no knob group \"${group}\".`)\n for (const [name, value] of Object.entries(names ?? {})) {\n if (!Object.hasOwn(knobs[group]!, name)) throw new Error(`Theme: no knob \"${group}.${name}\".`)\n Schema.decodeUnknownSync(knobs[group]![name]!.schema)(value)\n }\n }\n return values\n}\n\n/**\n * A theme of the standard knobs, or of `knobs`: the values it sets, checked,\n * every other knob keeping its default. A misspelt knob or a choice outside\n * its options is a type error; a number out of its range throws here.\n */\nexport function make(values: Values<Standard>): KnobTheme<Standard>\nexport function make<S extends KnobSet>(knobs: S, values: Values<NoInfer<S>>): KnobTheme<S>\nexport function make(...args: [Values<Standard>] | [KnobSet, Values<KnobSet>]): KnobTheme<KnobSet> {\n const [knobs, values] = args.length === 1 ? [standard, args[0]] : args\n return theme(knobs, checked(knobs, values), Option.none(), Option.none())\n}\n\n/** `theme` with `values` over its own, group by group. */\nexport const set =\n <S extends KnobSet>(values: Values<NoInfer<S>>) =>\n (self: KnobTheme<S>): KnobTheme<S> => {\n const merged: Record<string, Record<string, unknown>> = {}\n for (const source of [self.values, checked(self.knobs, values)])\n for (const [group, names] of Object.entries(source))\n merged[group] = { ...merged[group], ...names }\n return theme(self.knobs, merged as Values<S>, self.title, self.description)\n }\n\n/** A title and a description for a list of themes; neither is the theme's identity. */\nexport const describe =\n (meta: { readonly title?: string; readonly description?: string }) =>\n <S extends KnobSet>(self: KnobTheme<S>): KnobTheme<S> =>\n theme(\n self.knobs,\n self.values,\n meta.title === undefined ? self.title : Option.some(meta.title),\n meta.description === undefined ? self.description : Option.some(meta.description),\n )\n\n/** Every knob variable `self` declares: the values it sets, and every other knob's unset value. */\nexport const variables = <S extends KnobSet>(self: KnobTheme<S>): Knob.Variables => {\n const declared: Record<string, string> = {}\n for (const [group, knobs] of Object.entries(self.knobs))\n for (const [name, knob] of Object.entries(knobs)) {\n const value = (self.values[group] as Readonly<Record<string, unknown>> | undefined)?.[name]\n Object.assign(declared, knob.unset, value === undefined ? {} : knob.write(value))\n }\n return declared\n}\n\ntype Intersected<U> = (U extends unknown ? (union: U) => void : never) extends (\n meet: infer I,\n) => void\n ? I\n : never\n\n/** What every knob of `knobs` writes unset, under its variables' own names. */\nexport const unsetOf = <S extends KnobSet>(\n knobs: S,\n): Intersected<{ [G in keyof S]: { [K in keyof S[G]]: S[G][K]['unset'] }[keyof S[G]] }[keyof S]> =>\n Object.assign(\n {},\n ...Object.values(knobs).flatMap(group => Object.values(group).map(knob => knob.unset)),\n )\n\n/** `self`'s knob variables as tokens, for `Theme.root` and `Theme.scoped`. */\nexport const tokensOf = <S extends KnobSet>(self: KnobTheme<S>) => define({ knob: variables(self) })\n\n/**\n * The Schema of a theme's values over `knobs`: each group and knob optional,\n * each value checked by its knob, for a Model field or a decoded URL. Decode\n * with `onExcessProperty: 'error'` where an unknown key must be refused\n * rather than dropped.\n */\nexport const schemaOf = <S extends KnobSet>(knobs: S): Schema.Codec<Values<S>> =>\n // Built from `knobs` group by group, so its type is `Values<S>` by construction.\n Schema.Struct(\n Object.fromEntries(\n Object.entries(knobs).map(([group, names]) => [\n group,\n Schema.optionalKey(\n Schema.Struct(\n Object.fromEntries(\n Object.entries(names).map(([name, knob]) => [name, Schema.optionalKey(knob.schema)]),\n ),\n ),\n ),\n ]),\n ),\n ) as unknown as Schema.Codec<Values<S>>\n\nconst literal = (value: unknown): string =>\n typeof value === 'string'\n ? `'${value.replaceAll('\\\\', '\\\\\\\\').replaceAll(\"'\", \"\\\\'\")}'`\n : typeof value === 'object' && value !== null\n ? `{ ${Object.entries(value)\n .map(([key, each]) => `${key}: ${literal(each)}`)\n .join(', ')} }`\n : String(value)\n\n/**\n * Whether `value` changes nothing the knob writes unset: a bare `0.17` for a\n * schemed knob whose dark half follows is its default, though it is no\n * `{ light, dark }`.\n */\nconst atDefault = (knob: Knob.Knob<unknown>, value: unknown): boolean =>\n Object.entries(knob.write(value)).every(([name, css]) => knob.unset[name] === css)\n\n/**\n * The source of `self` as `Theme.make({ … })`: each knob it sets that writes\n * other than the knob's default does, a group to a line (a knob a line past\n * a hundred characters), so the code an application\n * pastes says only what makes the theme its own.\n */\nexport const print = <S extends KnobSet>(self: KnobTheme<S>): string => {\n const groups = Object.entries(self.knobs).flatMap(([group, knobs]) => {\n const values = (self.values[group] ?? {}) as Readonly<Record<string, unknown>>\n const set = Object.entries(knobs).flatMap(([name, knob]) => {\n const value = values[name]\n return value === undefined || atDefault(knob, value) ? [] : [`${name}: ${literal(value)}`]\n })\n if (set.length === 0) return []\n const line = ` ${group}: { ${set.join(', ')} },`\n // A group past the width a formatter keeps breaks to a knob a line, as one would.\n return line.length <= 100\n ? [line]\n : [` ${group}: {`, ...set.map(each => ` ${each},`), ' },']\n })\n return groups.length === 0 ? 'Theme.make({})' : ['Theme.make({', ...groups, '})'].join('\\n')\n}\n\n/** One knob of `S`, by its group and name: `shape.radius`. */\nexport type PathOf<S extends KnobSet> = {\n readonly [G in keyof S & string]: `${G}.${keyof S[G] & string}`\n}[keyof S & string]\n\n/** The knob of `S` at `P`. */\nexport type KnobAt<S extends KnobSet, P extends PathOf<S>> = P extends `${infer G}.${infer N}`\n ? G extends keyof S\n ? N extends keyof S[G]\n ? S[G][N]\n : never\n : never\n : never\n\nconst split = (path: string): readonly [string, string] => {\n const dot = path.indexOf('.')\n return [path.slice(0, dot), path.slice(dot + 1)]\n}\n\n/** Every knob's path in `knobs`, in the order they are declared. */\nexport const paths = <S extends KnobSet>(knobs: S): ReadonlyArray<PathOf<S>> =>\n Object.entries(knobs).flatMap(([group, names]) =>\n Object.keys(names).map(name => `${group}.${name}`),\n ) as ReadonlyArray<PathOf<S>>\n\n/** The knob at `path`. */\nexport const at = <S extends KnobSet, P extends PathOf<S>>(knobs: S, path: P): KnobAt<S, P> => {\n const [group, name] = split(path)\n return knobs[group]![name] as KnobAt<S, P>\n}\n\n/** What `values` set the knob at `path` to, or its default. */\nexport const valueAt = <S extends KnobSet, P extends PathOf<S>>(\n knobs: S,\n values: Values<S>,\n path: P,\n): ValueOf<KnobAt<S, P>> => {\n const [group, name] = split(path)\n const set = (values[group] as Readonly<Record<string, unknown>> | undefined)?.[name]\n return (set ?? at(knobs, path).default) as ValueOf<KnobAt<S, P>>\n}\n\n/** `values` with the knob at `path` set to `value`, checked by the knob as `make` checks it. */\nexport const withValue = <S extends KnobSet, P extends PathOf<S>>(\n knobs: S,\n values: Values<S>,\n path: P,\n value: ValueOf<KnobAt<S, P>>,\n): Values<S> => {\n const [group, name] = split(path)\n Schema.decodeUnknownSync(at(knobs, path).schema)(value)\n return { ...values, [group]: { ...values[group], [name]: value } } as Values<S>\n}\n","// Written by `pnpm icons` from icons.json. Do not edit.\n// Lucide (ISC, Lucide Contributors): @iconify-json/lucide 1.2.147, https://github.com/lucide-icons/lucide/blob/main/LICENSE\nexport type IconName =\n | 'search'\n | 'eye'\n | 'eye-off'\n | 'pipette'\n | 'rotate-ccw'\n | 'rotate-cw'\n | 'success'\n | 'warning'\n | 'error'\n | 'info'\n | 'lock'\n | 'close'\n\nexport const masks: { readonly [Name in IconName]: string } = {\n search:\n 'url(\"data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cg fill=%22none%22 stroke=%22currentColor%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222%22%3E%3Cpath d=%22m21 21l-4.34-4.34%22/%3E%3Ccircle cx=%2211%22 cy=%2211%22 r=%228%22/%3E%3C/g%3E%3C/svg%3E\")',\n eye: 'url(\"data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cg fill=%22none%22 stroke=%22currentColor%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222%22%3E%3Cpath d=%22M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0%22/%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%223%22/%3E%3C/g%3E%3C/svg%3E\")',\n 'eye-off':\n 'url(\"data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cg fill=%22none%22 stroke=%22currentColor%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222%22%3E%3Cpath d=%22M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575a1 1 0 0 1 0 .696a10.8 10.8 0 0 1-1.444 2.49m-6.41-.679a3 3 0 0 1-4.242-4.242%22/%3E%3Cpath d=%22M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 4.446-5.143M2 2l20 20%22/%3E%3C/g%3E%3C/svg%3E\")',\n pipette:\n 'url(\"data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cg fill=%22none%22 stroke=%22currentColor%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222%22%3E%3Cpath d=%22m12 9l-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12%22/%3E%3Cpath d=%22m18 9l.4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4l3.4-3.4a1 1 0 1 1 3 3zM2 22l.414-.414%22/%3E%3C/g%3E%3C/svg%3E\")',\n 'rotate-ccw':\n 'url(\"data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cg fill=%22none%22 stroke=%22currentColor%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222%22%3E%3Cpath d=%22M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8%22/%3E%3Cpath d=%22M3 3v5h5%22/%3E%3C/g%3E%3C/svg%3E\")',\n 'rotate-cw':\n 'url(\"data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cg fill=%22none%22 stroke=%22currentColor%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222%22%3E%3Cpath d=%22M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8%22/%3E%3Cpath d=%22M21 3v5h-5%22/%3E%3C/g%3E%3C/svg%3E\")',\n success:\n 'url(\"data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cg fill=%22none%22 stroke=%22currentColor%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222%22%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%2210%22/%3E%3Cpath d=%22m16 9l-5.5 5.5L8 12%22/%3E%3C/g%3E%3C/svg%3E\")',\n warning:\n 'url(\"data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath fill=%22none%22 stroke=%22currentColor%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222%22 d=%22m21.73 18l-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3M12 9v4m0 4h.01%22/%3E%3C/svg%3E\")',\n error:\n 'url(\"data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cg fill=%22none%22 stroke=%22currentColor%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222%22%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%2210%22/%3E%3Cpath d=%22m15 9l-6 6m0-6l6 6%22/%3E%3C/g%3E%3C/svg%3E\")',\n info: 'url(\"data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cg fill=%22none%22 stroke=%22currentColor%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222%22%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%2210%22/%3E%3Cpath d=%22M12 16v-4m0-4h.01%22/%3E%3C/g%3E%3C/svg%3E\")',\n lock: 'url(\"data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cg fill=%22none%22 stroke=%22currentColor%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222%22%3E%3Crect width=%2218%22 height=%2211%22 x=%223%22 y=%2211%22 rx=%222%22 ry=%222%22/%3E%3Cpath d=%22M7 11V7a5 5 0 0 1 10 0v4%22/%3E%3C/g%3E%3C/svg%3E\")',\n close:\n 'url(\"data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath fill=%22none%22 stroke=%22currentColor%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%222%22 d=%22M18 6L6 18M6 6l12 12%22/%3E%3C/svg%3E\")',\n}\n","/**\n * The non-color scales a design system shares across themes. Space, radius,\n * and durations multiply by the `density`, `radius-factor`, and `motion`\n * knobs, so a compact, a rounder, or a stiller theme is one override\n * (`motion: '0'` stills every recipe transition). `travel` multiplies only\n * the durations of things that move or resize: the reset sets it to 0 under\n * `prefers-reduced-motion`, so objects stop travelling and fades stay. `shadow` is drawn in `shadow.color`,\n * which the palette sets (stronger in a dark scheme, where\n * a shadow mixed from the text would glow); alone it falls back to black.\n * Every layer is mixed toward transparent by the `shadow-strength` knob, so\n * one override dims the whole elevation system without touching its shapes.\n * `breakpoint` is the record\n * `Style.responsive` takes; `breakpointWidths` gives the same names as pixel\n * thresholds for `foldkit-primitives/media` Breakpoints.\n */\nimport { DiagnosticError } from '../diagnostics.js'\nimport { define } from './core.js'\nimport { masks } from './iconMasks.js'\nimport { standard } from './knobs.js'\nimport { asVariables, elevation, reliefs } from './shadows.js'\n\nconst space = (rem: number) => `calc(${rem}rem * var(--fk-knob-density))`\nconst radius = (px: number) => `calc(${px}px * var(--fk-knob-radius-factor))`\nconst duration = (ms: number) => `calc(${ms}ms * var(--fk-knob-motion))`\nconst textScale = 'var(--fk-knob-text-scale, 1)'\n/**\n * A step of the type scale: at or below the body size it scales with the\n * text alone; above it, its distance from the body size also scales with\n * `heading-scale`, so headings can stand further off the text or closer.\n */\nconst text = (rem: number) =>\n rem <= 1\n ? `calc(${rem}rem * ${textScale})`\n : `calc((1rem + ${Number((rem - 1).toFixed(4))}rem * var(--fk-knob-heading-scale, 1)) * ${textScale})`\nconst leading = (ratio: number) => `calc(${ratio} * var(--fk-knob-leading, 1))`\nexport const tokens = define({\n knob: {\n density: '1',\n 'radius-factor': '1',\n motion: '1',\n travel: '1',\n // The size ladder's step: 0 default, 1 compact; `ladder` reads it.\n step: '0',\n 'shadow-strength': '100%',\n // The reading type: every size of the scale (`text-scale`), how far the\n // headings stand above the body (`heading-scale`), and the line height\n // (`leading`), each a multiplier.\n 'text-scale': '1',\n 'heading-scale': '1',\n leading: '1',\n // 1 rounds a pressable control (a button, a segmented tray) to a pill,\n // whatever the radius factor; 0 keeps its corner (`radius-md`, or\n // concentric inside a card: `concentric`).\n 'control-round': '0',\n // What the tokens below read, at each knob's default.\n ...standard.shape.border.unset,\n ...standard.type.body.unset,\n ...standard.type.heading.unset,\n ...standard.type.headingWeight.unset,\n ...standard.type.headingTracking.unset,\n ...standard.motion.easing.unset,\n ...standard.icon.size.unset,\n ...standard.icon.stroke.unset,\n ...standard.shadow.style.unset,\n ...standard.shadow.relief.unset,\n },\n space: {\n '3xs': space(0.125),\n '2xs': space(0.25),\n xs: space(0.5),\n sm: space(0.75),\n md: space(1),\n lg: space(1.5),\n xl: space(2),\n '2xl': space(3),\n '3xl': space(4),\n },\n radius: {\n xs: radius(2),\n sm: radius(3),\n md: radius(6),\n lg: radius(8),\n xl: radius(12),\n // A pill, which squares off only where the knob is 0, as a boxy theme's are.\n full: 'calc(9999px * min(var(--fk-knob-radius-factor), 1))',\n // A pressable control's corner: `md`, or a pill when `control-round` is 1.\n control: 'calc(var(--fk-radius-md) + var(--fk-knob-control-round, 0) * 9999px)',\n },\n font: {\n body: 'var(--fk-knob-font-body)',\n heading: 'var(--fk-knob-font-heading)',\n mono: 'ui-monospace, monospace',\n },\n size: {\n xs: text(0.75),\n sm: text(0.875),\n md: text(1),\n lg: text(1.125),\n xl: text(1.25),\n '2xl': text(1.5),\n '3xl': text(1.875),\n '4xl': text(2.25),\n },\n leading: {\n tight: leading(1.2),\n snug: leading(1.375),\n normal: leading(1.5),\n relaxed: leading(1.6),\n },\n // `heading` is what a heading or a title is set in.\n weight: {\n normal: '400',\n medium: '500',\n semibold: '600',\n bold: '700',\n heading: 'var(--fk-knob-heading-weight)',\n },\n // A heading's letter spacing: set large, type reads better a little tighter.\n tracking: { heading: 'var(--fk-knob-heading-tracking)' },\n // Three tiers, as Fluid Functionalism's springs: the bigger the thing that\n // moves, the slower its tier. Hover, fades and focus rings are `fast`;\n // popups, tabs and short travel `moderate`; dialogs and large surfaces\n // `slow`. Each exit is a tween one tier quicker, so a dismissal reads as\n // final rather than as the entrance replayed.\n motion: {\n fast: duration(80),\n moderate: duration(160),\n slow: duration(240),\n 'fast-exit': duration(60),\n 'moderate-exit': duration(120),\n 'slow-exit': duration(160),\n ease: 'var(--fk-knob-ease)',\n 'ease-exit': 'ease-in',\n // Springs sampled as CSS easings, so they need no JavaScript and follow\n // the knobs through the duration they are paired with. `settle` is\n // critically damped: it lands exactly, for `fast` and `moderate` travel.\n settle:\n 'linear(0, 0.035, 0.116, 0.218, 0.325, 0.428, 0.522, 0.605, 0.677, 0.737, 0.788, 0.83, 0.864, 0.892, 0.914, 0.932, 0.947, 0.958, 0.967, 0.974, 0.98, 0.984, 0.988, 0.991, 1)',\n // Damping ratio 0.88 (Fluid's bounce 0.12), for `slow`: a large surface\n // arrives with a little weight and no visible wobble.\n spring:\n 'linear(0, 0.041, 0.136, 0.255, 0.379, 0.497, 0.603, 0.693, 0.768, 0.829, 0.876, 0.913, 0.941, 0.961, 0.976, 0.986, 0.993, 0.998, 1, 1.002, 1.003, 1.003, 1.003, 1.003, 1)',\n },\n // The size ladder's two ends, after Fluid Functionalism's: a 36px default\n // control and a 28px compact one, everything about a control stepping down\n // together. One height serves buttons, fields and the rows of a list, so a\n // popup's row lines up with the trigger that opened it. Read through\n // `ladder`, which blends the pair by the `step` knob.\n control: {\n height: '2.25rem',\n 'height-compact': '1.75rem',\n pad: '0.75rem',\n 'pad-compact': '0.625rem',\n 'row-pad': '0.5rem',\n 'row-pad-compact': '0.375rem',\n gap: '0.5rem',\n 'gap-compact': '0.25rem',\n inset: '0.25rem',\n 'inset-compact': '0.125rem',\n icon: '1rem',\n 'icon-compact': '0.875rem',\n },\n // Six roles, each a size and a whole-pixel leading at both steps of the\n // ladder, after Fluid Functionalism's (body one notch up, at shadcn's 14px):\n // a caption in a menu and one in a table share a rhythm, and a compact\n // region reads as a smaller sibling of the same hierarchy. Pick by purpose:\n // `micro` is for keycaps, counters and tiny badges only. Read through `role`.\n type: {\n 'display-size': '1.75rem',\n 'display-size-compact': '1.5rem',\n 'display-leading': '2.125rem',\n 'display-leading-compact': '1.875rem',\n 'title-size': '1rem',\n 'title-size-compact': '0.9375rem',\n 'title-leading': '1.375rem',\n 'title-leading-compact': '1.25rem',\n 'subtitle-size': '0.9375rem',\n 'subtitle-size-compact': '0.875rem',\n 'subtitle-leading': '1.375rem',\n 'subtitle-leading-compact': '1.25rem',\n 'body-size': '0.875rem',\n 'body-size-compact': '0.8125rem',\n 'body-leading': '1.25rem',\n 'body-leading-compact': '1.125rem',\n 'caption-size': '0.75rem',\n 'caption-size-compact': '0.6875rem',\n 'caption-leading': '1rem',\n 'caption-leading-compact': '0.875rem',\n 'micro-size': '0.6875rem',\n 'micro-size-compact': '0.625rem',\n 'micro-leading': '0.875rem',\n 'micro-leading-compact': '0.75rem',\n },\n // The least widths content sets: `field` a text field's, so one sized by\n // its content still has room to type in; the columns a grid of cards or\n // tiles lays out by.\n width: {\n field: '20ch',\n 'column-sm': '10rem',\n 'column-md': '14rem',\n 'column-lg': '18rem',\n },\n // The icons the components draw themselves, each a CSS mask `url()` an\n // element paints in its text's color: Lucide's by default, written by\n // `pnpm icons`. An application's own pack replaces them as its own tokens\n // (`Icons.tokens` in `foldkit-mixins-ui`).\n icon: masks,\n // `glyph` strokes what a recipe draws in CSS as an icon (a check, a\n // chevron): apart from the borders, so thicker borders do not blot them.\n border: {\n thin: 'var(--fk-knob-border-width)',\n thick: 'calc(var(--fk-knob-border-width) + 1px)',\n heavy: 'calc(var(--fk-knob-border-width) + 2px)',\n glyph: 'var(--fk-knob-glyph-width)',\n },\n // Raised a little to a lot: a pressed control, a lifted cell, a menu, a\n // dialog. Each step is a tight contact layer plus a wide ambient one, so\n // large surfaces diffuse instead of ringing; `2xl` is the modal step.\n shadow: {\n // Soft or hard by the `shadow.style` knob.\n xs: 'var(--fk-knob-shadow-xs)',\n sm: 'var(--fk-knob-shadow-sm)',\n md: 'var(--fk-knob-shadow-md)',\n lg: 'var(--fk-knob-shadow-lg)',\n xl: 'var(--fk-knob-shadow-xl)',\n '2xl': 'var(--fk-knob-shadow-2xl)',\n inset: 'var(--fk-knob-shadow-inset)',\n // A control's relief: a button standing off the page (`raised`), pressed\n // into it while held or on (`pressed`), and a field's well (`field`).\n // Flat here; `relief` holds themes that give controls depth.\n raised: 'var(--fk-knob-relief-raised)',\n pressed: 'var(--fk-knob-relief-pressed)',\n field: 'var(--fk-knob-relief-field)',\n },\n breakpoint: {\n sm: '(min-width: 40rem)',\n md: '(min-width: 48rem)',\n lg: '(min-width: 64rem)',\n xl: '(min-width: 80rem)',\n },\n // What a notch, a rounded corner or the home indicator takes from each edge of the\n // screen: 0 on a desktop, and everywhere unless the page's viewport meta says\n // `viewport-fit=cover`. Physical, as the screen is; a fixed bar pads the edge it touches.\n safe: {\n top: 'env(safe-area-inset-top, 0px)',\n right: 'env(safe-area-inset-right, 0px)',\n bottom: 'env(safe-area-inset-bottom, 0px)',\n left: 'env(safe-area-inset-left, 0px)',\n },\n})\n\nexport type Tokens = typeof tokens\n\n/** A dimension on the size ladder, by its default end's name. */\nexport type Rung = Exclude<keyof Tokens['control'], `${string}-compact`>\n\n/**\n * A control's dimension on the size ladder: `name`'s default end blended\n * toward its compact one by the `step` knob, and spacing multiplied by\n * `density`. The blend is written here, not in a token, because a custom\n * property resolves where it is declared: a token would read the step at\n * `:root`, while this expression reads it on the element that uses it, so\n * `--fk-knob-step: 1` on a toolbar makes everything in it compact, a menu it\n * opens included while the panel stays in the page (an anchor's `portal:\n * false`); a portaled panel takes only the size its recipe chooses. A step of\n * `-0.5` is shadcn's large size, 40px.\n */\nexport const ladder = (name: Rung): string => {\n const stepped = blend('control', name)\n return name === 'icon'\n ? `calc(${stepped} * var(--fk-knob-icon-scale))`\n : `calc(${stepped} * var(--fk-knob-density))`\n}\n\n/**\n * The radius of a rounded surface inset in another, so their corners are\n * concentric: the outer radius less the inset between them and the outer\n * surface's border, never below zero. Past a large radius, or with uneven\n * gaps, the two read as independent and may be tuned by eye.\n *\n * With no arguments, it reads what the nearest container that `nests` its\n * children published, so a row, a pill or a highlight inside a padded panel\n * follows the panel's corner without repeating its arithmetic. The values\n * inherit, so it reads the nearest ancestor that `nests`, however deep and in\n * whatever component; it is square only where no ancestor does.\n */\nexport function nested(): string\nexport function nested(outer: string, inset: string, border?: string): string\nexport function nested(outer?: string, inset?: string, border = '0px'): string {\n return outer === undefined || inset === undefined\n ? `max(0px, calc(var(--fk-outer-radius, 0px) - var(--fk-inset, 0px)))`\n : `max(0px, calc(${outer} - ${inset} - ${border}))`\n}\n\n/**\n * What a container that pads its children publishes for `nested()` and\n * `concentric()`: its corner inside its border, the inset to them, and the\n * corner a control there takes. Spread it beside the container's own radius\n * and padding. The values are read on each child, so a container deeper in\n * that `nests` again publishes its own.\n */\nexport const nests = (\n radius: string,\n inset: string,\n border = '0px',\n): {\n readonly '--fk-outer-radius': string\n readonly '--fk-inset': string\n readonly '--fk-control-corner': string\n} => ({\n '--fk-outer-radius': `calc(${radius} - ${border})`,\n '--fk-inset': inset,\n '--fk-control-corner': `calc(${radius} - ${border} - ${inset})`,\n})\n\n/**\n * A control's corner, concentric with the nearest container that `nests`\n * (a card, a dialog, a toast) and kept between `min` and `max`: a deep\n * inset would square it off, and a wide corner round it past what a\n * control is drawn with. Outside every such container it is `max`. Like\n * `nested()`, it reads what that ancestor published, so it is written in the\n * control's own rule; as a token it would resolve once, at the root.\n *\n * A control that `nests` its own parts (a segmented tray) reads this and\n * publishes from it on one element, a cycle that voids both: after `nests`,\n * it sets `'--fk-control-corner': 'inherit'`, passing its container's on.\n */\nexport const concentric = (bounds: { readonly min: string; readonly max: string }): string =>\n `clamp(${bounds.min}, var(--fk-control-corner, 9999px), ${bounds.max})`\n\n/** A role of the type scale. */\nexport type Role = 'display' | 'title' | 'subtitle' | 'body' | 'caption' | 'micro'\n\n/**\n * Text in `role`: its size and leading on the size ladder, read on the\n * element like `ladder`, so a compact region's text steps down with its\n * controls.\n */\nexport const role = (name: Role): { readonly fontSize: string; readonly lineHeight: string } => ({\n fontSize: blend('type', `${name}-size`),\n lineHeight: blend('type', `${name}-leading`),\n})\n\n/** A token's default end blended toward its `-compact` one by the `step` knob. */\nconst blend = (group: string, name: string) => {\n const at = `var(--fk-${group}-${name})`\n return `calc(${at} + (var(--fk-${group}-${name}-compact) - ${at}) * var(--fk-knob-step))`\n}\n\n// A plain `min-width`, of the window or of a named container.\nconst MIN_WIDTH = /^(?:@container\\s+[\\w-]+\\s+)?\\(min-width:\\s*(\\d+(?:\\.\\d+)?)(rem|px)\\)$/\n\n/**\n * Each breakpoint query's `min-width` in pixels (rem at 16), so CSS and the\n * Model agree on what `md` means. A query that is not a plain `min-width`\n * is refused: it has no single threshold. A container's is its container's.\n */\nexport const breakpointWidths = (theme: {\n readonly breakpoint: { readonly [name: string]: string }\n}): Readonly<Record<string, number>> => {\n const widths: Record<string, number> = {}\n for (const [name, query] of Object.entries(theme.breakpoint)) {\n const match = MIN_WIDTH.exec(query)\n if (match === null) {\n throw new DiagnosticError({\n source: 'theme',\n code: 'theme:unparseable-breakpoint',\n severity: 'error',\n message: `Breakpoint \"${name}\" is \"${query}\", not a \"(min-width: <rem|px>)\" query`,\n details: { name, query },\n })\n }\n const amount = Number(match[1])\n widths[name] = match[2] === 'rem' ? amount * 16 : amount\n }\n return Object.freeze(widths)\n}\n\n/**\n * The same breakpoints measured on a named container rather than the window:\n * `Theme.inContainer('page', Theme.tokens.breakpoint)` gives `md` as\n * `'@container page (min-width: 48rem)'`, for `Style.responsive` and a\n * responsive look. An element must be that container (`container: page /\n * inline-size`) for them to match.\n */\nexport const inContainer = <Breakpoints extends Readonly<Record<string, string>>>(\n name: string,\n breakpoints: Breakpoints,\n): { readonly [K in keyof Breakpoints]: string } =>\n Object.freeze(\n Object.fromEntries(\n Object.entries(breakpoints).map(([at, query]) => [at, `@container ${name} ${query}`]),\n ),\n ) as { readonly [K in keyof Breakpoints]: string }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAM,OAAO,UAAkB,OAAO,OAAO,MAAM,QAAQ,CAAC,CAAC,CAAC;;AAgB9D,MAAM,OAA4B,MAAY,WAC3C,GAAG,OAAO,MAAM;;AAGnB,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