foldkit-mixins 0.14.0 → 0.15.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
@@ -371,7 +371,11 @@ border?)` is the radius of a surface inset in another, so their corners are conc
371
371
  container that pads its children can publish that instead: spread `Theme.nests(radius, inset,
372
372
  border?)` beside its own radius and padding, and `Theme.nested()` with no arguments on any
373
373
  descendant (a row, a pill, a highlight, a focus ring) reads it. Outside such a container it is
374
- square.
374
+ square. `Theme.concentric({ min, max })` is a control's corner read the same way, the container's
375
+ corner less its inset kept between `min` and `max`, and `max` outside any: `foldkit-mixins-ui`'s
376
+ buttons and fields take `concentric({ min: sm, max: md })`, and its Card, Dialog, Toast and Alert
377
+ `nests`, so a button in a card rounds with the card. A control that `nests` its own parts sets
378
+ `'--fk-control-corner': 'inherit'` after `nests`, or it reads the corner it publishes.
375
379
  `Theme.raise(offset)` lifts an element `offset` levels above the raised element holding it (or the
376
380
  page, level 1), capped at 8, and `Theme.raisedSurface()` is its background at that level: a popover
377
381
  opened in a dialog lands above the dialog with nothing passed. In a light scheme the first two
package/dist/app.d.mts CHANGED
@@ -3,7 +3,7 @@ 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-moq41T8O.mjs";
4
4
  import { a as compose, r as ThemeTokens, t as Refs } from "./core-Cq9PThXv.mjs";
5
5
  import { n as RootOptions } from "./root-DCb6aqif.mjs";
6
- import { r as Tokens } from "./tokens-DOTnlgyA.mjs";
6
+ import { r as Tokens } from "./tokens-BIjkKhiC.mjs";
7
7
  //#region src/app.d.ts
8
8
  export interface AppStyleOptions<Palette extends ThemeTokens> {
9
9
  /** The application's own tokens, usually `Theme.oklch(…)`, laid over `Theme.tokens`. */
package/dist/app.mjs CHANGED
@@ -3,7 +3,7 @@ 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-By7s5txd.mjs";
5
5
  import { t as root } from "./root-cMUipDvi.mjs";
6
- import { l as tokens } from "./tokens-BOFcnIJM.mjs";
6
+ import { u as tokens } from "./tokens-ByWGqQV3.mjs";
7
7
  import { body, reset } from "./defaults.mjs";
8
8
  //#region src/app.ts
9
9
  /**
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
3
  import { i as scoped, n as RootOptions, r as root, t as Overrides } from "./root-DCb6aqif.mjs";
4
- import { a as hardShadows, c as nested, d as role, f as tokens, i as breakpointWidths, l as nests, n as Rung, o as inContainer, r as Tokens, s as ladder, t as Role, u as relief } from "./tokens-DOTnlgyA.mjs";
4
+ import { a as concentric, c as ladder, d as relief, f as role, i as breakpointWidths, l as nested, n as Rung, o as hardShadows, p as tokens, r as Tokens, s as inContainer, t as Role, u as nests } from "./tokens-BIjkKhiC.mjs";
5
5
  import { n as OklchTheme, r as oklch, t as OklchKnobs } from "./oklch-BCbqJ1aM.mjs";
6
6
  import { Effect } from "effect";
7
7
  //#region src/theme/scheme.d.ts
@@ -234,6 +234,7 @@ export declare const Theme: {
234
234
  readonly role: typeof role;
235
235
  readonly nested: typeof nested;
236
236
  readonly nests: typeof nests;
237
+ readonly concentric: typeof concentric;
237
238
  readonly raise: typeof raise;
238
239
  readonly raisedSurface: typeof raisedSurface;
239
240
  readonly breakpointWidths: typeof breakpointWidths;
@@ -244,5 +245,5 @@ export declare const Theme: {
244
245
  readonly currentScheme: typeof currentScheme;
245
246
  };
246
247
  //#endregion
247
- export { type OklchKnobs, type OklchTheme, type Overrides, type Refs, type Role, type RootOptions, type Rung, type Scheme, type ThemeTokens, type Theme$1 as ThemeValue, type Tokens, VAR_PREFIX, breakpointWidths, compose, define, hardShadows, inContainer, ladder, lightDark, nested, nests, oklch, ref, relief, role, root, scoped, tokens, variables };
248
+ export { type OklchKnobs, type OklchTheme, type Overrides, type Refs, type Role, type RootOptions, type Rung, type Scheme, type ThemeTokens, type Theme$1 as ThemeValue, type Tokens, VAR_PREFIX, breakpointWidths, compose, concentric, define, hardShadows, inContainer, ladder, lightDark, nested, nests, oklch, ref, relief, role, root, scoped, tokens, variables };
248
249
  //# sourceMappingURL=theme.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"theme.d.mts","names":["Core.define","Core.ref","Core.variables","Core.lightDark","Core.compose"],"sources":["../src/theme/scheme.ts","../src/theme/raise.ts","../src/theme.ts"],"mappings":";;;;;;;;KASY;;qBAGC;;;;;;;qBAWA,eAAY;;qBAKZ,qBAAoB;;;;;;qBAWpB,eAAY,QAAY,QAAM,iBAA6B,OAAO;;;;;;;qBCGlE,QAAK,mBAAqB;;;;;;;;;qBAW1B;;;qBCPA"}
1
+ {"version":3,"file":"theme.d.mts","names":["Core.define","Core.ref","Core.variables","Core.lightDark","Core.compose"],"sources":["../src/theme/scheme.ts","../src/theme/raise.ts","../src/theme.ts"],"mappings":";;;;;;;;KASY;;qBAGC;;;;;;;qBAWA,eAAY;;qBAKZ,qBAAoB;;;;;;qBAWpB,eAAY,QAAY,QAAM,iBAA6B,OAAO;;;;;;;qBCGlE,QAAK,mBAAqB;;;;;;;;;qBAW1B;;;qBCLA"}
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-By7s5txd.mjs";
3
3
  import { n as scoped, t as root } from "./root-cMUipDvi.mjs";
4
- import { a as nested, c as role, i as ladder, l as tokens, n as hardShadows, o as nests, r as inContainer, s as relief, t as breakpointWidths } from "./tokens-BOFcnIJM.mjs";
4
+ import { a as ladder, c as relief, i as inContainer, l as role, n as concentric, o as nested, r as hardShadows, s as nests, t as breakpointWidths, u as tokens } from "./tokens-ByWGqQV3.mjs";
5
5
  import { Effect } from "effect";
6
6
  //#region src/theme/oklch.ts
7
7
  /**
@@ -310,6 +310,7 @@ const Theme = {
310
310
  role,
311
311
  nested,
312
312
  nests,
313
+ concentric,
313
314
  raise,
314
315
  raisedSurface,
315
316
  breakpointWidths,
@@ -320,6 +321,6 @@ const Theme = {
320
321
  currentScheme
321
322
  };
322
323
  //#endregion
323
- export { SCHEME_KEY, Theme, VAR_PREFIX, breakpointWidths, chooseScheme, compose, currentScheme, define, hardShadows, inContainer, ladder, lightDark, nested, nests, oklch, raise, raisedSurface, ref, relief, role, root, schemeScript, scoped, tokens, variables };
324
+ export { SCHEME_KEY, Theme, VAR_PREFIX, breakpointWidths, chooseScheme, compose, concentric, currentScheme, define, hardShadows, inContainer, ladder, lightDark, nested, nests, oklch, raise, raisedSurface, ref, relief, role, root, schemeScript, scoped, tokens, variables };
324
325
 
325
326
  //# sourceMappingURL=theme.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"theme.mjs","names":["compose","Core.Theme"],"sources":["../src/theme/oklch.ts","../src/theme/scheme.ts","../src/theme/raise.ts","../src/theme.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: declare the theme on that subtree too. Where light and dark schemes need different numbers\n * 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'\n\nexport interface OklchKnobs {\n /** The brand color: hue in degrees, chroma 0–0.4, lightness as a percentage. */\n readonly accent: {\n readonly h: number\n readonly c: number\n readonly l: string\n /** Lighter and stronger on dark surfaces; defaults `70%` and `c + 0.03`. */\n readonly dark?: { readonly l?: string; readonly c?: number }\n }\n /** Degrees added to the accent hue for the secondary and tertiary families. */\n readonly secondaryHueShift?: number\n readonly tertiaryHueShift?: number\n /**\n * The hue of the neutrals (surfaces, text, outlines, the shadow), apart\n * from the accent's, as a base color is: a warm stone under a blue accent.\n * Without it the neutrals take the accent's hue, and follow it when the\n * `accent-h` knob moves.\n */\n readonly neutral?: { readonly h: number }\n /**\n * The tint of every shadow: its hue (the neutrals' unless given) and chroma\n * (twice the surfaces' unless given), so a warm theme's cards cast a warm\n * shadow. `shadow-strength` still scales how much of it shows.\n */\n readonly shadow?: { readonly h?: number; readonly c?: number }\n /** Chroma of neutral surfaces; 0 is gray. */\n readonly surfaceSaturation?: number\n /** How far apart the surface steps are, 0–100%. */\n readonly surfaceContrast?: string\n /** Multiplies text chroma. */\n readonly contrastFactor?: number\n /** Chroma of the code colors (`syntax-*`), 0–0.4; default `0.14`. */\n readonly syntaxChroma?: number\n /**\n * How menus, listboxes and comboboxes draw their panels, as shadcn's menu\n * options: the row the keys or pointer are on in a tint of the text\n * (`subtle`, the default) or the accent's fill (`bold`); the panel in the\n * page's surface (`default`), the opposite scheme's (`inverted`), or either\n * see-through over a blur (`translucent`, `inverted-translucent`).\n */\n readonly menu?: {\n readonly accent?: 'subtle' | 'bold'\n readonly color?: 'default' | 'inverted' | 'translucent' | 'inverted-translucent'\n }\n /** Hues of the feedback families. */\n readonly feedback?: {\n readonly success?: number\n readonly warning?: number\n readonly error?: number\n readonly info?: number\n }\n /**\n * What a hover is made of: `neutral` mixes the element's own text, as\n * before; `surface` (the default) mixes a painted surface's own paint where\n * one names it (an alert band, a tone's fill), the text elsewhere; `accent`\n * leans every hover on the accent at low chroma, as Fluid's. One override\n * changes every component. Painted surfaces read the derived `surface-ink`\n * knob below (0 in `neutral`), so the choice also switches at runtime.\n */\n readonly stateHue?: 'neutral' | 'surface' | 'accent'\n}\n\nconst v = (group: string, name: string) => `var(--fk-${group}-${name})`\n/** A computed knob without float noise: `0.02`, not `0.019999999999999997`. */\nconst num = (value: number) => String(Number(value.toFixed(4)))\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\nexport const oklch = (knobs: OklchKnobs) => {\n const accent = v('accent', 'default')\n const surfaceSaturation = knobs.surfaceSaturation ?? 0.015\n return define({\n knob: {\n 'accent-h': String(knobs.accent.h),\n 'accent-c': String(knobs.accent.c),\n 'accent-l': knobs.accent.l,\n 'accent-c-dark': num(knobs.accent.dark?.c ?? Math.min(0.4, knobs.accent.c + 0.03)),\n 'accent-l-dark': knobs.accent.dark?.l ?? '70%',\n // The accent's hue unless one is given: an expression, so a moved accent moves it too.\n 'neutral-h': knobs.neutral === undefined ? v('hue', 'accent') : String(knobs.neutral.h),\n 'secondary-shift': String(knobs.secondaryHueShift ?? 60),\n 'tertiary-shift': String(knobs.tertiaryHueShift ?? -90),\n 'surface-c': String(surfaceSaturation),\n 'surface-c-dark': num(surfaceSaturation * (4 / 3)),\n 'surface-contrast': knobs.surfaceContrast ?? '26%',\n 'contrast-factor': String(knobs.contrastFactor ?? 1),\n 'base-l': '97.5%',\n 'base-l-dark': '22%',\n 'success-h': String(knobs.feedback?.success ?? 145),\n 'warning-h': String(knobs.feedback?.warning ?? 75),\n 'error-h': String(knobs.feedback?.error ?? 25),\n 'info-h': String(knobs.feedback?.info ?? 245),\n 'syntax-c': num(knobs.syntaxChroma ?? 0.14),\n // The first chart color's hue; the other four keep their places around it.\n 'chart-h': '255',\n // 0 or 1, each blending one look into the other, so a knob override switches it.\n 'popup-bold': knobs.menu?.accent === 'bold' ? '1' : '0',\n 'popup-invert': knobs.menu?.color?.startsWith('inverted') === true ? '1' : '0',\n 'popup-alpha': knobs.menu?.color?.endsWith('translucent') === true ? '0.8' : '1',\n 'popup-blur': knobs.menu?.color?.endsWith('translucent') === true ? '12px' : '0px',\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 // Whether a painted surface names its paint as the state ink: 1,\n // unless `stateHue` is `neutral`, when every hover mixes the text.\n 'surface-ink': knobs.stateHue === 'neutral' ? '0' : '1',\n 'image-edge': '10%',\n // The shadow's tint: the neutrals' hue, and a little more than their chroma.\n 'shadow-h': knobs.shadow?.h === undefined ? v('hue', 'neutral') : String(knobs.shadow.h),\n 'shadow-c': knobs.shadow?.c === undefined ? `calc(${surfaceC} * 2)` : num(knobs.shadow.c),\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: ld(scale(base, -0.07, 1.3), scale(base, 0.065, 1.25)),\n default: ld(scale(base, -0.13, 1.4), scale(base, 0.12, 1.35)),\n overt: ld(scale(base, -0.27, 1.6), scale(base, 0.23, 1.5)),\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: knobs.stateHue === 'accent' ? v('accent', 'ink') : 'currentColor',\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 // 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}\n\nexport type OklchTheme = ReturnType<typeof oklch>\n","/**\n * A reader's light or dark choice, kept across visits and applied before the\n * first paint. A palette of `lightDark` tokens follows `color-scheme`, so the\n * choice is that one property on the root element: `'system'` leaves the\n * stylesheet's `light dark`, and the browser follows the operating system.\n */\nimport { Effect } from 'effect'\n\n/** What a reader may choose: a scheme, or the operating system's. */\nexport type Scheme = 'light' | 'dark' | 'system'\n\n/** The storage key a chosen scheme is kept under, unless one is given. */\nexport const SCHEME_KEY = 'foldkit:color-scheme'\n\nconst stored = (value: string | null): value is 'light' | 'dark' =>\n value === 'light' || value === 'dark'\n\n/**\n * The text of a `<script>` for the document's head, before any stylesheet\n * draws: it applies the scheme kept under `key`, so a reader who chose dark\n * never sees one light frame. Storage that throws (a private window) or holds\n * anything else leaves the stylesheet's choice.\n */\nexport const schemeScript = (key: string = SCHEME_KEY): string =>\n // `<` escaped, so a key cannot close the script it is written into.\n `(function(){try{var s=localStorage.getItem(${JSON.stringify(key).replaceAll('<', `${String.fromCharCode(92)}u003c`)});if(s==='light'||s==='dark')document.documentElement.style.colorScheme=s}catch(e){}})()`\n\n/** The scheme the root element shows now: what `schemeScript` or `chooseScheme` applied. */\nexport const currentScheme = (): Scheme => {\n if (typeof document === 'undefined') return 'system'\n const applied = document.documentElement.style.colorScheme\n return stored(applied) ? applied : 'system'\n}\n\n/**\n * Applies `scheme` to the root element and keeps it under `key` for the next\n * visit, as a Command's effect. `'system'` removes both. Storage that throws\n * still applies the scheme to this page.\n */\nexport const chooseScheme = (scheme: Scheme, key: string = SCHEME_KEY): Effect.Effect<void> =>\n Effect.sync(() => {\n const root = document.documentElement\n if (scheme === 'system') root.style.removeProperty('color-scheme')\n else root.style.colorScheme = scheme\n try {\n if (scheme === 'system') localStorage.removeItem(key)\n else localStorage.setItem(key, scheme)\n } catch {\n // Storage refused (a private window, a full quota): this visit keeps it.\n }\n })\n","/**\n * Elevation that nests by itself, after Fluid Functionalism's surface ladder:\n * the page is level 1, a raised element sits `offset` levels above whatever\n * raised element holds it (capped at 8), and `raisedSurface` paints it for\n * its level. A popover opened in a dialog lands above the dialog, with no\n * prop passed, instead of melting into a surface it shares.\n *\n * CSS cannot add to an inherited value on one element (`--d: calc(var(--d) +\n * 2)` is a cycle, and `inherit()` has no engine yet), so the depth is counted\n * by eight rules, one per nesting depth `k`: `k` raised elements deep, the\n * element sets `--_fk-depth-k` from its ancestor's `--_fk-depth-(k-1)`. The\n * rules for shallower depths match it too, so each rule hands those back to\n * the ancestor's (`inherit`); otherwise the element's depth would be read\n * from its own. `--_fk-level` is the result, private like a recipe's own\n * properties: it is no theme token.\n */\nimport { classPiece, compose, global, self, type StyleValue } from '../styleValue.js'\nimport { VAR_PREFIX } from './core.js'\n\nconst DEPTHS = 8\nconst MARK = 'fk-raised'\n\nconst depthRules = (() => {\n const rules = [`:root{--_fk-depth-0:1;--_fk-level:1}`]\n for (let depth = 1; depth <= DEPTHS; depth += 1) {\n const selector = Array.from({ length: depth }, () => `.${MARK}`).join(' ')\n const handBack = Array.from(\n { length: depth - 1 },\n (_, shallower) => `--_fk-depth-${shallower + 1}:inherit;`,\n ).join('')\n rules.push(\n `${selector}{${handBack}--_fk-depth-${depth}:calc(var(--_fk-depth-${depth - 1}) + var(--_fk-raise));` +\n `--_fk-level:min(var(--_fk-depth-${depth}), ${DEPTHS})}`,\n )\n }\n return global(rules.join(''))\n})()\n\n/**\n * An element `offset` levels above the raised element holding it, or the\n * page: popovers and menus are 2, dialogs 4. Paint it with `raisedSurface`.\n */\nexport const raise = (offset: number): StyleValue =>\n compose(depthRules, classPiece(MARK), self({ '--_fk-raise': String(offset) }))\n\n/**\n * The background of a raised element at its level, from `Theme.oklch`'s base\n * surface. In a light scheme the first two steps go toward white and the rest\n * stay there, so shadow alone carries elevation; in a dark scheme each level\n * is an even step lighter (`knob.raise-dark`). Written as an expression, not\n * a token, because the level is the element's own and a token resolves at\n * `:root`.\n */\nexport const raisedSurface = (): string => {\n const base = `var(${VAR_PREFIX}-surface-base)`\n const above = `(var(--_fk-level) - 1)`\n return (\n `light-dark(oklch(from ${base} calc(l + (1 - l) * min(${above}, 2) / 2) c h), ` +\n `oklch(from ${base} calc(l + var(${VAR_PREFIX}-knob-raise-dark) * ${above}) c h))`\n )\n}\n","/**\n * `foldkit-mixins/theme`: the root export's `Theme` plus the page-level\n * pieces. `root` and `scoped` turn tokens into unlayered `:root` and\n * selector rules for `Style.stylesheet`; `tokens` is the shipped set of\n * non-color scales; `oklch` derives a whole palette from a few knobs;\n * `schemeScript` and `chooseScheme` keep a reader's light or dark choice.\n */\nimport * as Core from './theme/core.js'\nimport { oklch } from './theme/oklch.js'\nimport { root, scoped } from './theme/root.js'\nimport { chooseScheme, currentScheme, schemeScript } from './theme/scheme.js'\nimport { raise, raisedSurface } from './theme/raise.js'\nimport {\n breakpointWidths,\n hardShadows,\n inContainer,\n ladder,\n nested,\n nests,\n relief,\n role,\n tokens,\n} from './theme/tokens.js'\n\nexport { compose, define, lightDark, ref, variables, VAR_PREFIX } from './theme/core.js'\nexport type { Refs, Theme as ThemeValue, ThemeTokens } from './theme/core.js'\nexport { root, scoped } from './theme/root.js'\nexport type { Overrides, RootOptions } from './theme/root.js'\nexport {\n breakpointWidths,\n hardShadows,\n inContainer,\n ladder,\n nested,\n nests,\n relief,\n role,\n tokens,\n} from './theme/tokens.js'\nexport type { Role, Rung, Tokens } from './theme/tokens.js'\nexport { oklch } from './theme/oklch.js'\nexport { raise, raisedSurface } from './theme/raise.js'\nexport type { OklchKnobs, OklchTheme } from './theme/oklch.js'\nexport { chooseScheme, currentScheme, SCHEME_KEY, schemeScript } from './theme/scheme.js'\nexport type { Scheme } from './theme/scheme.js'\n\nexport const Theme = {\n ...Core.Theme,\n root,\n scoped,\n tokens,\n hardShadows,\n relief,\n ladder,\n role,\n nested,\n nests,\n raise,\n raisedSurface,\n breakpointWidths,\n inContainer,\n oklch,\n schemeScript,\n chooseScheme,\n currentScheme,\n} as const\n"],"mappings":";;;;;;;;;;;;;;;;AA0EA,MAAM,KAAK,OAAe,SAAiB,YAAY,MAAM,GAAG,KAAK;;AAErE,MAAM,OAAO,UAAkB,OAAO,OAAO,MAAM,QAAQ,CAAC,CAAC,CAAC;AAC9D,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,EAA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,sCAAsC;CACrD,KAAK,IAAI,QAAQ,GAAG,SAAS,QAAQ,SAAS,GAAG;EAC/C,MAAM,WAAW,MAAM,KAAK,EAAE,QAAQ,MAAM,SAAS,IAAI,MAAM,CAAC,CAAC,KAAK,GAAG;EACzE,MAAM,WAAW,MAAM,KACrB,EAAE,QAAQ,QAAQ,EAAE,IACnB,GAAG,cAAc,eAAe,YAAY,EAAE,UACjD,CAAC,CAAC,KAAK,EAAE;EACT,MAAM,KACJ,GAAG,SAAS,GAAG,SAAS,cAAc,MAAM,wBAAwB,QAAQ,EAAE,wDACzC,MAAM,KAAK,OAAO,GACzD;CACF;CACA,OAAO,OAAO,MAAM,KAAK,EAAE,CAAC;AAC9B,EAAA,CAAG;;;;;AAMH,MAAa,SAAS,WACpBA,UAAQ,YAAY,WAAW,IAAI,GAAG,KAAK,EAAE,eAAe,OAAO,MAAM,EAAE,CAAC,CAAC;;;;;;;;;AAU/E,MAAa,sBAA8B;CACzC,MAAM,OAAO,OAAO,WAAW;CAC/B,MAAM,QAAQ;CACd,OACE,yBAAyB,KAAK,0BAA0B,MAAM,6BAChD,KAAK,gBAAgB,WAAW,sBAAsB,MAAM;AAE9E;;;;;;;;;;ACdA,MAAa,QAAQ;CACnB,GAAGC;CACH;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
1
+ {"version":3,"file":"theme.mjs","names":["compose","Core.Theme"],"sources":["../src/theme/oklch.ts","../src/theme/scheme.ts","../src/theme/raise.ts","../src/theme.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: declare the theme on that subtree too. Where light and dark schemes need different numbers\n * 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'\n\nexport interface OklchKnobs {\n /** The brand color: hue in degrees, chroma 0–0.4, lightness as a percentage. */\n readonly accent: {\n readonly h: number\n readonly c: number\n readonly l: string\n /** Lighter and stronger on dark surfaces; defaults `70%` and `c + 0.03`. */\n readonly dark?: { readonly l?: string; readonly c?: number }\n }\n /** Degrees added to the accent hue for the secondary and tertiary families. */\n readonly secondaryHueShift?: number\n readonly tertiaryHueShift?: number\n /**\n * The hue of the neutrals (surfaces, text, outlines, the shadow), apart\n * from the accent's, as a base color is: a warm stone under a blue accent.\n * Without it the neutrals take the accent's hue, and follow it when the\n * `accent-h` knob moves.\n */\n readonly neutral?: { readonly h: number }\n /**\n * The tint of every shadow: its hue (the neutrals' unless given) and chroma\n * (twice the surfaces' unless given), so a warm theme's cards cast a warm\n * shadow. `shadow-strength` still scales how much of it shows.\n */\n readonly shadow?: { readonly h?: number; readonly c?: number }\n /** Chroma of neutral surfaces; 0 is gray. */\n readonly surfaceSaturation?: number\n /** How far apart the surface steps are, 0–100%. */\n readonly surfaceContrast?: string\n /** Multiplies text chroma. */\n readonly contrastFactor?: number\n /** Chroma of the code colors (`syntax-*`), 0–0.4; default `0.14`. */\n readonly syntaxChroma?: number\n /**\n * How menus, listboxes and comboboxes draw their panels, as shadcn's menu\n * options: the row the keys or pointer are on in a tint of the text\n * (`subtle`, the default) or the accent's fill (`bold`); the panel in the\n * page's surface (`default`), the opposite scheme's (`inverted`), or either\n * see-through over a blur (`translucent`, `inverted-translucent`).\n */\n readonly menu?: {\n readonly accent?: 'subtle' | 'bold'\n readonly color?: 'default' | 'inverted' | 'translucent' | 'inverted-translucent'\n }\n /** Hues of the feedback families. */\n readonly feedback?: {\n readonly success?: number\n readonly warning?: number\n readonly error?: number\n readonly info?: number\n }\n /**\n * What a hover is made of: `neutral` mixes the element's own text, as\n * before; `surface` (the default) mixes a painted surface's own paint where\n * one names it (an alert band, a tone's fill), the text elsewhere; `accent`\n * leans every hover on the accent at low chroma, as Fluid's. One override\n * changes every component. Painted surfaces read the derived `surface-ink`\n * knob below (0 in `neutral`), so the choice also switches at runtime.\n */\n readonly stateHue?: 'neutral' | 'surface' | 'accent'\n}\n\nconst v = (group: string, name: string) => `var(--fk-${group}-${name})`\n/** A computed knob without float noise: `0.02`, not `0.019999999999999997`. */\nconst num = (value: number) => String(Number(value.toFixed(4)))\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\nexport const oklch = (knobs: OklchKnobs) => {\n const accent = v('accent', 'default')\n const surfaceSaturation = knobs.surfaceSaturation ?? 0.015\n return define({\n knob: {\n 'accent-h': String(knobs.accent.h),\n 'accent-c': String(knobs.accent.c),\n 'accent-l': knobs.accent.l,\n 'accent-c-dark': num(knobs.accent.dark?.c ?? Math.min(0.4, knobs.accent.c + 0.03)),\n 'accent-l-dark': knobs.accent.dark?.l ?? '70%',\n // The accent's hue unless one is given: an expression, so a moved accent moves it too.\n 'neutral-h': knobs.neutral === undefined ? v('hue', 'accent') : String(knobs.neutral.h),\n 'secondary-shift': String(knobs.secondaryHueShift ?? 60),\n 'tertiary-shift': String(knobs.tertiaryHueShift ?? -90),\n 'surface-c': String(surfaceSaturation),\n 'surface-c-dark': num(surfaceSaturation * (4 / 3)),\n 'surface-contrast': knobs.surfaceContrast ?? '26%',\n 'contrast-factor': String(knobs.contrastFactor ?? 1),\n 'base-l': '97.5%',\n 'base-l-dark': '22%',\n 'success-h': String(knobs.feedback?.success ?? 145),\n 'warning-h': String(knobs.feedback?.warning ?? 75),\n 'error-h': String(knobs.feedback?.error ?? 25),\n 'info-h': String(knobs.feedback?.info ?? 245),\n 'syntax-c': num(knobs.syntaxChroma ?? 0.14),\n // The first chart color's hue; the other four keep their places around it.\n 'chart-h': '255',\n // 0 or 1, each blending one look into the other, so a knob override switches it.\n 'popup-bold': knobs.menu?.accent === 'bold' ? '1' : '0',\n 'popup-invert': knobs.menu?.color?.startsWith('inverted') === true ? '1' : '0',\n 'popup-alpha': knobs.menu?.color?.endsWith('translucent') === true ? '0.8' : '1',\n 'popup-blur': knobs.menu?.color?.endsWith('translucent') === true ? '12px' : '0px',\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 // Whether a painted surface names its paint as the state ink: 1,\n // unless `stateHue` is `neutral`, when every hover mixes the text.\n 'surface-ink': knobs.stateHue === 'neutral' ? '0' : '1',\n 'image-edge': '10%',\n // The shadow's tint: the neutrals' hue, and a little more than their chroma.\n 'shadow-h': knobs.shadow?.h === undefined ? v('hue', 'neutral') : String(knobs.shadow.h),\n 'shadow-c': knobs.shadow?.c === undefined ? `calc(${surfaceC} * 2)` : num(knobs.shadow.c),\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: ld(scale(base, -0.07, 1.3), scale(base, 0.065, 1.25)),\n default: ld(scale(base, -0.13, 1.4), scale(base, 0.12, 1.35)),\n overt: ld(scale(base, -0.27, 1.6), scale(base, 0.23, 1.5)),\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: knobs.stateHue === 'accent' ? v('accent', 'ink') : 'currentColor',\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 // 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}\n\nexport type OklchTheme = ReturnType<typeof oklch>\n","/**\n * A reader's light or dark choice, kept across visits and applied before the\n * first paint. A palette of `lightDark` tokens follows `color-scheme`, so the\n * choice is that one property on the root element: `'system'` leaves the\n * stylesheet's `light dark`, and the browser follows the operating system.\n */\nimport { Effect } from 'effect'\n\n/** What a reader may choose: a scheme, or the operating system's. */\nexport type Scheme = 'light' | 'dark' | 'system'\n\n/** The storage key a chosen scheme is kept under, unless one is given. */\nexport const SCHEME_KEY = 'foldkit:color-scheme'\n\nconst stored = (value: string | null): value is 'light' | 'dark' =>\n value === 'light' || value === 'dark'\n\n/**\n * The text of a `<script>` for the document's head, before any stylesheet\n * draws: it applies the scheme kept under `key`, so a reader who chose dark\n * never sees one light frame. Storage that throws (a private window) or holds\n * anything else leaves the stylesheet's choice.\n */\nexport const schemeScript = (key: string = SCHEME_KEY): string =>\n // `<` escaped, so a key cannot close the script it is written into.\n `(function(){try{var s=localStorage.getItem(${JSON.stringify(key).replaceAll('<', `${String.fromCharCode(92)}u003c`)});if(s==='light'||s==='dark')document.documentElement.style.colorScheme=s}catch(e){}})()`\n\n/** The scheme the root element shows now: what `schemeScript` or `chooseScheme` applied. */\nexport const currentScheme = (): Scheme => {\n if (typeof document === 'undefined') return 'system'\n const applied = document.documentElement.style.colorScheme\n return stored(applied) ? applied : 'system'\n}\n\n/**\n * Applies `scheme` to the root element and keeps it under `key` for the next\n * visit, as a Command's effect. `'system'` removes both. Storage that throws\n * still applies the scheme to this page.\n */\nexport const chooseScheme = (scheme: Scheme, key: string = SCHEME_KEY): Effect.Effect<void> =>\n Effect.sync(() => {\n const root = document.documentElement\n if (scheme === 'system') root.style.removeProperty('color-scheme')\n else root.style.colorScheme = scheme\n try {\n if (scheme === 'system') localStorage.removeItem(key)\n else localStorage.setItem(key, scheme)\n } catch {\n // Storage refused (a private window, a full quota): this visit keeps it.\n }\n })\n","/**\n * Elevation that nests by itself, after Fluid Functionalism's surface ladder:\n * the page is level 1, a raised element sits `offset` levels above whatever\n * raised element holds it (capped at 8), and `raisedSurface` paints it for\n * its level. A popover opened in a dialog lands above the dialog, with no\n * prop passed, instead of melting into a surface it shares.\n *\n * CSS cannot add to an inherited value on one element (`--d: calc(var(--d) +\n * 2)` is a cycle, and `inherit()` has no engine yet), so the depth is counted\n * by eight rules, one per nesting depth `k`: `k` raised elements deep, the\n * element sets `--_fk-depth-k` from its ancestor's `--_fk-depth-(k-1)`. The\n * rules for shallower depths match it too, so each rule hands those back to\n * the ancestor's (`inherit`); otherwise the element's depth would be read\n * from its own. `--_fk-level` is the result, private like a recipe's own\n * properties: it is no theme token.\n */\nimport { classPiece, compose, global, self, type StyleValue } from '../styleValue.js'\nimport { VAR_PREFIX } from './core.js'\n\nconst DEPTHS = 8\nconst MARK = 'fk-raised'\n\nconst depthRules = (() => {\n const rules = [`:root{--_fk-depth-0:1;--_fk-level:1}`]\n for (let depth = 1; depth <= DEPTHS; depth += 1) {\n const selector = Array.from({ length: depth }, () => `.${MARK}`).join(' ')\n const handBack = Array.from(\n { length: depth - 1 },\n (_, shallower) => `--_fk-depth-${shallower + 1}:inherit;`,\n ).join('')\n rules.push(\n `${selector}{${handBack}--_fk-depth-${depth}:calc(var(--_fk-depth-${depth - 1}) + var(--_fk-raise));` +\n `--_fk-level:min(var(--_fk-depth-${depth}), ${DEPTHS})}`,\n )\n }\n return global(rules.join(''))\n})()\n\n/**\n * An element `offset` levels above the raised element holding it, or the\n * page: popovers and menus are 2, dialogs 4. Paint it with `raisedSurface`.\n */\nexport const raise = (offset: number): StyleValue =>\n compose(depthRules, classPiece(MARK), self({ '--_fk-raise': String(offset) }))\n\n/**\n * The background of a raised element at its level, from `Theme.oklch`'s base\n * surface. In a light scheme the first two steps go toward white and the rest\n * stay there, so shadow alone carries elevation; in a dark scheme each level\n * is an even step lighter (`knob.raise-dark`). Written as an expression, not\n * a token, because the level is the element's own and a token resolves at\n * `:root`.\n */\nexport const raisedSurface = (): string => {\n const base = `var(${VAR_PREFIX}-surface-base)`\n const above = `(var(--_fk-level) - 1)`\n return (\n `light-dark(oklch(from ${base} calc(l + (1 - l) * min(${above}, 2) / 2) c h), ` +\n `oklch(from ${base} calc(l + var(${VAR_PREFIX}-knob-raise-dark) * ${above}) c h))`\n )\n}\n","/**\n * `foldkit-mixins/theme`: the root export's `Theme` plus the page-level\n * pieces. `root` and `scoped` turn tokens into unlayered `:root` and\n * selector rules for `Style.stylesheet`; `tokens` is the shipped set of\n * non-color scales; `oklch` derives a whole palette from a few knobs;\n * `schemeScript` and `chooseScheme` keep a reader's light or dark choice.\n */\nimport * as Core from './theme/core.js'\nimport { oklch } from './theme/oklch.js'\nimport { root, scoped } from './theme/root.js'\nimport { chooseScheme, currentScheme, schemeScript } from './theme/scheme.js'\nimport { raise, raisedSurface } from './theme/raise.js'\nimport {\n breakpointWidths,\n concentric,\n hardShadows,\n inContainer,\n ladder,\n nested,\n nests,\n relief,\n role,\n tokens,\n} from './theme/tokens.js'\n\nexport { compose, define, lightDark, ref, variables, VAR_PREFIX } from './theme/core.js'\nexport type { Refs, Theme as ThemeValue, ThemeTokens } from './theme/core.js'\nexport { root, scoped } from './theme/root.js'\nexport type { Overrides, RootOptions } from './theme/root.js'\nexport {\n breakpointWidths,\n concentric,\n hardShadows,\n inContainer,\n ladder,\n nested,\n nests,\n relief,\n role,\n tokens,\n} from './theme/tokens.js'\nexport type { Role, Rung, Tokens } from './theme/tokens.js'\nexport { oklch } from './theme/oklch.js'\nexport { raise, raisedSurface } from './theme/raise.js'\nexport type { OklchKnobs, OklchTheme } from './theme/oklch.js'\nexport { chooseScheme, currentScheme, SCHEME_KEY, schemeScript } from './theme/scheme.js'\nexport type { Scheme } from './theme/scheme.js'\n\nexport const Theme = {\n ...Core.Theme,\n root,\n scoped,\n tokens,\n hardShadows,\n relief,\n ladder,\n role,\n nested,\n nests,\n concentric,\n raise,\n raisedSurface,\n breakpointWidths,\n inContainer,\n oklch,\n schemeScript,\n chooseScheme,\n currentScheme,\n} as const\n"],"mappings":";;;;;;;;;;;;;;;;AA0EA,MAAM,KAAK,OAAe,SAAiB,YAAY,MAAM,GAAG,KAAK;;AAErE,MAAM,OAAO,UAAkB,OAAO,OAAO,MAAM,QAAQ,CAAC,CAAC,CAAC;AAC9D,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W,UAAU,aAAa,WAAW,GAAG;OAC/C,aAAa,QAAQ,KAAK,MAAM;CACvC,QAAQ,CAER;AACF,CAAC;;;;;;;;;;;;;;;;;;;AC/BH,MAAM,SAAS;AACf,MAAM,OAAO;AAEb,MAAM,oBAAoB;CACxB,MAAM,QAAQ,CAAC,sCAAsC;CACrD,KAAK,IAAI,QAAQ,GAAG,SAAS,QAAQ,SAAS,GAAG;EAC/C,MAAM,WAAW,MAAM,KAAK,EAAE,QAAQ,MAAM,SAAS,IAAI,MAAM,CAAC,CAAC,KAAK,GAAG;EACzE,MAAM,WAAW,MAAM,KACrB,EAAE,QAAQ,QAAQ,EAAE,IACnB,GAAG,cAAc,eAAe,YAAY,EAAE,UACjD,CAAC,CAAC,KAAK,EAAE;EACT,MAAM,KACJ,GAAG,SAAS,GAAG,SAAS,cAAc,MAAM,wBAAwB,QAAQ,EAAE,wDACzC,MAAM,KAAK,OAAO,GACzD;CACF;CACA,OAAO,OAAO,MAAM,KAAK,EAAE,CAAC;AAC9B,EAAA,CAAG;;;;;AAMH,MAAa,SAAS,WACpBA,UAAQ,YAAY,WAAW,IAAI,GAAG,KAAK,EAAE,eAAe,OAAO,MAAM,EAAE,CAAC,CAAC;;;;;;;;;AAU/E,MAAa,sBAA8B;CACzC,MAAM,OAAO,OAAO,WAAW;CAC/B,MAAM,QAAQ;CACd,OACE,yBAAyB,KAAK,0BAA0B,MAAM,6BAChD,KAAK,gBAAgB,WAAW,sBAAsB,MAAM;AAE9E;;;;;;;;;;ACZA,MAAa,QAAQ;CACnB,GAAGC;CACH;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
@@ -175,15 +175,33 @@ declare const ladder: (name: Rung) => string;
175
175
  declare function nested(): string;
176
176
  declare function nested(outer: string, inset: string, border?: string): string;
177
177
  /**
178
- * What a container that pads its children publishes for `nested()`: its
179
- * corner inside its border, and the inset to them. Spread it beside the
180
- * container's own radius and padding. The values are read on each child, so
181
- * a container deeper in that `nests` again publishes its own.
178
+ * What a container that pads its children publishes for `nested()` and
179
+ * `concentric()`: its corner inside its border, the inset to them, and the
180
+ * corner a control there takes. Spread it beside the container's own radius
181
+ * and padding. The values are read on each child, so a container deeper in
182
+ * that `nests` again publishes its own.
182
183
  */
183
184
  declare const nests: (radius: string, inset: string, border?: string) => {
184
185
  readonly '--fk-outer-radius': string;
185
186
  readonly '--fk-inset': string;
187
+ readonly '--fk-control-corner': string;
186
188
  };
189
+ /**
190
+ * A control's corner, concentric with the nearest container that `nests`
191
+ * (a card, a dialog, a toast) and kept between `min` and `max`: a deep
192
+ * inset would square it off, and a wide corner round it past what a
193
+ * control is drawn with. Outside every such container it is `max`. Like
194
+ * `nested()`, it reads what that ancestor published, so it is written in the
195
+ * control's own rule; as a token it would resolve once, at the root.
196
+ *
197
+ * A control that `nests` its own parts (a segmented tray) reads this and
198
+ * publishes from it on one element, a cycle that voids both: after `nests`,
199
+ * it sets `'--fk-control-corner': 'inherit'`, passing its container's on.
200
+ */
201
+ declare const concentric: (bounds: {
202
+ readonly min: string;
203
+ readonly max: string;
204
+ }) => string;
187
205
  /**
188
206
  * The shadow scale drawn hard, as retro and brutalist interfaces draw it:
189
207
  * each step a solid offset copy, deeper the higher it sits. Compose it over
@@ -261,5 +279,5 @@ declare const breakpointWidths: (theme: {
261
279
  */
262
280
  declare const inContainer: <Breakpoints extends Readonly<Record<string, string>>>(name: string, breakpoints: Breakpoints) => { readonly [K in keyof Breakpoints]: string; };
263
281
  //#endregion
264
- export { hardShadows as a, nested as c, role as d, tokens as f, breakpointWidths as i, nests as l, Rung as n, inContainer as o, Tokens as r, ladder as s, Role as t, relief as u };
265
- //# sourceMappingURL=tokens-DOTnlgyA.d.mts.map
282
+ export { concentric as a, ladder as c, relief as d, role as f, breakpointWidths as i, nested as l, Rung as n, hardShadows as o, tokens as p, Tokens as r, inContainer as s, Role as t, nests as u };
283
+ //# sourceMappingURL=tokens-BIjkKhiC.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tokens-DOTnlgyA.d.mts","names":[],"sources":["../src/theme/tokens.ts"],"mappings":";cAuCa,QAAM;;IAEf;IACA;IACA;IACA;IAEA;IACA;IAIA;IACA;IACA;IAGA;;;IAGA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;;IAGA;IACA;IACA;IACA;IACA;IAEA;IAEA;;;IAEM;IAA+B;IAAoB;;;IAEzD;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;;IAGA;IACA;IACA;IACA;;;IAGQ;IAAe;IAAe;IAAiB;IAAa;;;IAE1D;;;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;;;IAEQ;IAAa;IAAc;;;;;;;;;;;;;;;IAoBnC;IACA;IACA;IACA;;;IAMA;IACA;IACA;IACA;;;KAIQ,gBAAgB;;KAGhB,OAAO,cAAc;;;;;;;;;;;;cAapB,SAAM,MAAU;;;;;;;;;;;;;iBAiBb;iBACA,OAAO,eAAe,eAAe;;;;;;;cAaxC,QAAK,gBACF,eACD;WAED;WAAsC;;;;;;;cAcvC,aAAW;;IAEpB;IACA;IACA;IACA;IACA;IACA;IACA;;;;;;;;;;;cA2BS;WACX,MAAI;;MAEA;MACA;MACA;;;WAGJ,MAAI;;MAAqB;MAAiB;MAAkB;;;WAC5D,OAAK;;MAAqB;MAAkB;MAAoB;;;;;KAItD;;;;;;cAOC,OAAI,MAAU;WAAkB;WAA2B;;;;;;;cAmB3D,mBAAgB;WAClB;cAAwB;;MAC/B,SAAS;;;;;;;;cA0BA,cAAe,oBAAoB,SAAS,yBAAuB,cAClE,aACC,4BACA,WAAW"}
1
+ {"version":3,"file":"tokens-BIjkKhiC.d.mts","names":[],"sources":["../src/theme/tokens.ts"],"mappings":";cAuCa,QAAM;;IAEf;IACA;IACA;IACA;IAEA;IACA;IAIA;IACA;IACA;IAIA;;;IAGA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;;IAGA;IACA;IACA;IACA;IACA;IAEA;IAEA;;;IAEM;IAA+B;IAAoB;;;IAEzD;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;;IAGA;IACA;IACA;IACA;;;IAGQ;IAAe;IAAe;IAAiB;IAAa;;;IAE1D;;;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;;;IAEQ;IAAa;IAAc;;;;;;;;;;;;;;;IAoBnC;IACA;IACA;IACA;;;IAMA;IACA;IACA;IACA;;;KAIQ,gBAAgB;;KAGhB,OAAO,cAAc;;;;;;;;;;;;cAapB,SAAM,MAAU;;;;;;;;;;;;;iBAiBb;iBACA,OAAO,eAAe,eAAe;;;;;;;;cAcxC,QAAK,gBACF,eACD;WAGJ;WACA;WACA;;;;;;;;;;;;;;cAmBE,aAAU;WAAuB;WAAsB;;;;;;;cAYvD,aAAW;;IAEpB;IACA;IACA;IACA;IACA;IACA;IACA;;;;;;;;;;;cA2BS;WACX,MAAI;;MAEA;MACA;MACA;;;WAGJ,MAAI;;MAAqB;MAAiB;MAAkB;;;WAC5D,OAAK;;MAAqB;MAAkB;MAAoB;;;;;KAItD;;;;;;cAOC,OAAI,MAAU;WAAkB;WAA2B;;;;;;;cAmB3D,mBAAgB;WAClB;cAAwB;;MAC/B,SAAS;;;;;;;;cA0BA,cAAe,oBAAoB,SAAS,yBAAuB,cAClE,aACC,4BACA,WAAW"}
@@ -195,15 +195,30 @@ function nested(outer, inset, border = "0px") {
195
195
  return outer === void 0 || inset === void 0 ? `max(0px, calc(var(--fk-outer-radius, 0px) - var(--fk-inset, 0px)))` : `max(0px, calc(${outer} - ${inset} - ${border}))`;
196
196
  }
197
197
  /**
198
- * What a container that pads its children publishes for `nested()`: its
199
- * corner inside its border, and the inset to them. Spread it beside the
200
- * container's own radius and padding. The values are read on each child, so
201
- * a container deeper in that `nests` again publishes its own.
198
+ * What a container that pads its children publishes for `nested()` and
199
+ * `concentric()`: its corner inside its border, the inset to them, and the
200
+ * corner a control there takes. Spread it beside the container's own radius
201
+ * and padding. The values are read on each child, so a container deeper in
202
+ * that `nests` again publishes its own.
202
203
  */
203
204
  const nests = (radius, inset, border = "0px") => ({
204
205
  "--fk-outer-radius": `calc(${radius} - ${border})`,
205
- "--fk-inset": inset
206
+ "--fk-inset": inset,
207
+ "--fk-control-corner": `calc(${radius} - ${border} - ${inset})`
206
208
  });
209
+ /**
210
+ * A control's corner, concentric with the nearest container that `nests`
211
+ * (a card, a dialog, a toast) and kept between `min` and `max`: a deep
212
+ * inset would square it off, and a wide corner round it past what a
213
+ * control is drawn with. Outside every such container it is `max`. Like
214
+ * `nested()`, it reads what that ancestor published, so it is written in the
215
+ * control's own rule; as a token it would resolve once, at the root.
216
+ *
217
+ * A control that `nests` its own parts (a segmented tray) reads this and
218
+ * publishes from it on one element, a cycle that voids both: after `nests`,
219
+ * it sets `'--fk-control-corner': 'inherit'`, passing its container's on.
220
+ */
221
+ const concentric = (bounds) => `clamp(${bounds.min}, var(--fk-control-corner, 9999px), ${bounds.max})`;
207
222
  /** A step of `hardShadows`: the shadow's color, nearly opaque, offset with no blur. */
208
223
  const hard = (offset) => `${offset}px ${offset}px 0 0 color-mix(in oklch, oklch(from ${shade} l c h / 0.9) ${strength}, transparent)`;
209
224
  /**
@@ -305,6 +320,6 @@ const breakpointWidths = (theme) => {
305
320
  */
306
321
  const inContainer = (name, breakpoints) => Object.freeze(Object.fromEntries(Object.entries(breakpoints).map(([at, query]) => [at, `@container ${name} ${query}`])));
307
322
  //#endregion
308
- export { nested as a, role as c, ladder as i, tokens as l, hardShadows as n, nests as o, inContainer as r, relief as s, breakpointWidths as t };
323
+ export { ladder as a, relief as c, inContainer as i, role as l, concentric as n, nested as o, hardShadows as r, nests as s, breakpointWidths as t, tokens as u };
309
324
 
310
- //# sourceMappingURL=tokens-BOFcnIJM.mjs.map
325
+ //# sourceMappingURL=tokens-ByWGqQV3.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens-ByWGqQV3.mjs","names":[],"sources":["../src/theme/tokens.ts"],"sourcesContent":["/**\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 a palette sets (`Theme.oklch` does, 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'\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))`\nconst shade = 'var(--fk-shadow-color, oklch(0% 0 0 / 0.12))'\nconst strength = 'var(--fk-knob-shadow-strength, 100%)'\n/** No shadow, as a shadow: one a transition can interpolate from, unlike `none`. */\nconst FLAT = '0 0 #0000'\nconst shadow = (...layers: ReadonlyArray<string>) =>\n layers.map(layer => `${layer} color-mix(in oklch, ${shade} ${strength}, transparent)`).join(', ')\n\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 },\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: { body: 'system-ui, sans-serif', heading: 'inherit', mono: 'ui-monospace, monospace' },\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: { normal: '400', medium: '500', semibold: '600', bold: '700', heading: '600' },\n // A heading's letter spacing: set large, type reads better a little tighter.\n tracking: { heading: '-0.01em' },\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: 'ease-out',\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 border: { thin: '1px', thick: '2px', heavy: '3px' },\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 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 // 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: FLAT,\n pressed: FLAT,\n field: FLAT,\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' ? stepped : `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 step of `hardShadows`: 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/**\n * The shadow scale drawn hard, as retro and brutalist interfaces draw it:\n * each step a solid offset copy, deeper the higher it sits. Compose it over\n * `tokens`; `shadow-strength` still fades it, and 0 takes it away.\n */\nexport const hardShadows = define({\n shadow: {\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})\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/** Two rings of inset edges, the outer lit at `-1` and shaded at `1`, flipped when pressed in. */\nconst bevel = (sign: 1 | -1) =>\n [\n `inset ${-sign}px ${-sign}px 0 0 ${shaded(0.9)}`,\n `inset ${sign}px ${sign}px 0 0 ${lit(1, 0.3)}`,\n `inset ${-2 * sign}px ${-2 * sign}px 0 0 ${shaded(0.4)}`,\n `inset ${2 * sign}px ${2 * sign}px 0 0 ${lit(0.5, 0.12)}`,\n ].join(', ')\n\n/**\n * How controls stand off the page, as token sets over `tokens`: a button's\n * resting shadow (`raised`), the one it takes held or on (`pressed`), and a\n * field's well (`field`). The shipped scales are flat. `soft` lifts buttons\n * a hair and sinks fields a hair; `hard` drops solid offset copies, as\n * `hardShadows` does for surfaces; `bevel` draws lit and shaded edges, the\n * raised and sunken chrome of a 1990s desktop. `shadow-strength` fades each.\n */\nexport const relief = {\n soft: define({\n shadow: {\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 }),\n hard: define({ shadow: { raised: hard(2), pressed: hard(1), field: hard(2) } }),\n bevel: define({ shadow: { raised: bevel(1), pressed: bevel(-1), field: bevel(-1) } }),\n} as const\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":";;;;;;;;;;;;;;;;;;AAkBA,MAAM,SAAS,QAAgB,QAAQ,I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GACR,MAAM;GACN,UAAU;GACV,SAAS,eAAe,KAAK,QAAQ,MAAM;GAC3C,SAAS;IAAE;IAAM;GAAM;EACzB,CAAC;EAEH,MAAM,SAAS,OAAO,MAAM,EAAE;EAC9B,OAAO,QAAQ,MAAM,OAAO,QAAQ,SAAS,KAAK;CACpD;CACA,OAAO,OAAO,OAAO,MAAM;AAC7B;;;;;;;;AASA,MAAa,eACX,MACA,gBAEA,OAAO,OACL,OAAO,YACL,OAAO,QAAQ,WAAW,CAAC,CAAC,KAAK,CAAC,IAAI,WAAW,CAAC,IAAI,cAAc,KAAK,GAAG,OAAO,CAAC,CACtF,CACF"}
@@ -1,5 +1,5 @@
1
1
  import { i as StyleValue } from "./styleValue-DEsUAC4v.mjs";
2
- import { r as Tokens } from "./tokens-DOTnlgyA.mjs";
2
+ import { r as Tokens } from "./tokens-BIjkKhiC.mjs";
3
3
  import { n as OklchTheme } from "./oklch-BCbqJ1aM.mjs";
4
4
  //#region src/utilities.d.ts
5
5
  /** A space step, or none. */
@@ -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-By7s5txd.mjs";
3
- import { l as tokens } from "./tokens-BOFcnIJM.mjs";
3
+ import { u as tokens } from "./tokens-ByWGqQV3.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.14.0",
3
+ "version": "0.15.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":"tokens-BOFcnIJM.mjs","names":[],"sources":["../src/theme/tokens.ts"],"sourcesContent":["/**\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 a palette sets (`Theme.oklch` does, 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'\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))`\nconst shade = 'var(--fk-shadow-color, oklch(0% 0 0 / 0.12))'\nconst strength = 'var(--fk-knob-shadow-strength, 100%)'\n/** No shadow, as a shadow: one a transition can interpolate from, unlike `none`. */\nconst FLAT = '0 0 #0000'\nconst shadow = (...layers: ReadonlyArray<string>) =>\n layers.map(layer => `${layer} color-mix(in oklch, ${shade} ${strength}, transparent)`).join(', ')\n\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 `radius-md`.\n 'control-round': '0',\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: { body: 'system-ui, sans-serif', heading: 'inherit', mono: 'ui-monospace, monospace' },\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: { normal: '400', medium: '500', semibold: '600', bold: '700', heading: '600' },\n // A heading's letter spacing: set large, type reads better a little tighter.\n tracking: { heading: '-0.01em' },\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: 'ease-out',\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 border: { thin: '1px', thick: '2px', heavy: '3px' },\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 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 // 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: FLAT,\n pressed: FLAT,\n field: FLAT,\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' ? stepped : `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()`: its\n * corner inside its border, and the inset to them. Spread it beside the\n * container's own radius and padding. The values are read on each child, so\n * a container deeper in that `nests` again publishes its own.\n */\nexport const nests = (\n radius: string,\n inset: string,\n border = '0px',\n): { readonly '--fk-outer-radius': string; readonly '--fk-inset': string } => ({\n '--fk-outer-radius': `calc(${radius} - ${border})`,\n '--fk-inset': inset,\n})\n\n/** A step of `hardShadows`: 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/**\n * The shadow scale drawn hard, as retro and brutalist interfaces draw it:\n * each step a solid offset copy, deeper the higher it sits. Compose it over\n * `tokens`; `shadow-strength` still fades it, and 0 takes it away.\n */\nexport const hardShadows = define({\n shadow: {\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})\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/** Two rings of inset edges, the outer lit at `-1` and shaded at `1`, flipped when pressed in. */\nconst bevel = (sign: 1 | -1) =>\n [\n `inset ${-sign}px ${-sign}px 0 0 ${shaded(0.9)}`,\n `inset ${sign}px ${sign}px 0 0 ${lit(1, 0.3)}`,\n `inset ${-2 * sign}px ${-2 * sign}px 0 0 ${shaded(0.4)}`,\n `inset ${2 * sign}px ${2 * sign}px 0 0 ${lit(0.5, 0.12)}`,\n ].join(', ')\n\n/**\n * How controls stand off the page, as token sets over `tokens`: a button's\n * resting shadow (`raised`), the one it takes held or on (`pressed`), and a\n * field's well (`field`). The shipped scales are flat. `soft` lifts buttons\n * a hair and sinks fields a hair; `hard` drops solid offset copies, as\n * `hardShadows` does for surfaces; `bevel` draws lit and shaded edges, the\n * raised and sunken chrome of a 1990s desktop. `shadow-strength` fades each.\n */\nexport const relief = {\n soft: define({\n shadow: {\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 }),\n hard: define({ shadow: { raised: hard(2), pressed: hard(1), field: hard(2) } }),\n bevel: define({ shadow: { raised: bevel(1), pressed: bevel(-1), field: bevel(-1) } }),\n} as const\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":";;;;;;;;;;;;;;;;;;AAkBA,MAAM,SAAS,QAAgB,QAAQ,IAAI;AAC3C,MAAM,UAAU,OAAe,QAAQ,GAAG;AAC1C,MAAM,YAAY,OAAe,QAAQ,GAAG;AAC5C,MAAM,YAAY;;;;;;AAMlB,MAAM,QAAQ,QACZ,OAAO,IACH,QAAQ,IAAI,QAAQ,UAAU,KAC9B,gBAAgB,QAAQ,MAAM,EAAA,CAAG,QAAQ,CAAC,CAAC,EAAE,2CAA2C,UAAU;AACxG,MAAM,WAAW,UAAkB,QAAQ,MAAM;AACjD,MAAM,QAAQ;AACd,MAAM,WAAW;;AAEjB,MAAM,OAAO;AACb,MAAM,UAAU,GAAG,WACjB,OAAO,KAAI,UAAS,GAAG,MAAM,uBAAuB,MAAM,GAAG,SAAS,eAAe,CAAC,CAAC,KAAK,IAAI;AAElG,MAAa,SAAS,OAAO;CAC3B,MAAM;EACJ,SAAS;EACT,iBAAiB;EACjB,QAAQ;EACR,QAAQ;EAER,MAAM;EACN,mBAAmB;EAInB,cAAc;EACd,iBAAiB;EACjB,SAAS;EAGT,iBAAiB;CACnB;CACA,OAAO;EACL,OAAO,MAAM,IAAK;EAClB,OAAO,MAAM,GAAI;EACjB,IAAI,MAAM,EAAG;EACb,IAAI,MAAM,GAAI;EACd,IAAI,MAAM,CAAC;EACX,IAAI,MAAM,GAAG;EACb,IAAI,MAAM,CAAC;EACX,OAAO,MAAM,CAAC;EACd,OAAO,MAAM,CAAC;CAChB;CACA,QAAQ;EACN,IAAI,OAAO,CAAC;EACZ,IAAI,OAAO,CAAC;EACZ,IAAI,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