foldkit-mixins 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +7 -0
  2. package/dist/app.mjs +6 -6
  3. package/dist/{core-Bxj0UQDF.mjs → core-IMVYU8JN.mjs} +2 -2
  4. package/dist/{core-Bxj0UQDF.mjs.map → core-IMVYU8JN.mjs.map} +1 -1
  5. package/dist/defaults.d.mts.map +1 -1
  6. package/dist/defaults.mjs +2 -2
  7. package/dist/defaults.mjs.map +1 -1
  8. package/dist/index.d.mts +1 -1
  9. package/dist/index.d.mts.map +1 -1
  10. package/dist/index.mjs +4 -4
  11. package/dist/{layers-B31M0tDi.mjs → layers-keV38soP.mjs} +2 -2
  12. package/dist/{layers-B31M0tDi.mjs.map → layers-keV38soP.mjs.map} +1 -1
  13. package/dist/layers.mjs +1 -1
  14. package/dist/layout.mjs +1 -1
  15. package/dist/oklch-FOemcYSv.d.mts.map +1 -1
  16. package/dist/prose.mjs +1 -1
  17. package/dist/{root-C1u12YMD.mjs → root-BBi88KYx.mjs} +3 -3
  18. package/dist/{root-C1u12YMD.mjs.map → root-BBi88KYx.mjs.map} +1 -1
  19. package/dist/{slotMark-Rdsjb7XI.mjs → slotMark-DK75y0GJ.mjs} +2 -2
  20. package/dist/{slotMark-Rdsjb7XI.mjs.map → slotMark-DK75y0GJ.mjs.map} +1 -1
  21. package/dist/{style-CKjLee4e.mjs → style-CmHD4Ul3.mjs} +4 -4
  22. package/dist/{style-CKjLee4e.mjs.map → style-CmHD4Ul3.mjs.map} +1 -1
  23. package/dist/styleValue-BavTe9MZ.d.mts.map +1 -1
  24. package/dist/{styleValue-_G9jwb17.mjs → styleValue-Cj4YjgVB.mjs} +60 -2
  25. package/dist/styleValue-Cj4YjgVB.mjs.map +1 -0
  26. package/dist/testing.mjs +1 -1
  27. package/dist/theme.mjs +15 -13
  28. package/dist/theme.mjs.map +1 -1
  29. package/dist/{tokens-O8S8QH_R.mjs → tokens-BkWHtxjY.mjs} +3 -3
  30. package/dist/{tokens-O8S8QH_R.mjs.map → tokens-BkWHtxjY.mjs.map} +1 -1
  31. package/dist/utilities.mjs +3 -3
  32. package/package.json +1 -1
  33. package/dist/styleValue-_G9jwb17.mjs.map +0 -1
package/README.md CHANGED
@@ -301,6 +301,13 @@ inside `Style.whenInput` compiles to its class like any other; the class is stat
301
301
  presence follows the input, and its CSS is in `Style.stylesheet` whether or not the condition
302
302
  ever holds. Drawn, it is injected like any other class.
303
303
 
304
+ Prefer rule pieces for a state. An inline shorthand beside a conditional inline
305
+ longhand of it (an inline `border` and a `whenInput` `borderColor`, either way
306
+ round) is refused when the style is defined, with
307
+ `mixins:inline-shorthand-conflict`: the renderer drops a property by clearing
308
+ it, so clearing `borderColor` also cleared the color `border` set, and the
309
+ element kept a `currentColor` border after the state ended.
310
+
304
311
  Beyond `self`, `pseudo`, `media`, `supports`, `container` and `nest`, the rule pieces are:
305
312
 
306
313
  - `Style.states({ open: { opacity: '1' } })` compiles to `&[data-state="open"]`, for Behaviors that
package/dist/app.mjs CHANGED
@@ -1,9 +1,9 @@
1
- import { i as stylesheet, n as forSlots, r as slots } from "./style-CKjLee4e.mjs";
2
- import { i as compose } from "./styleValue-_G9jwb17.mjs";
3
- import { r as standard } from "./layers-B31M0tDi.mjs";
4
- import { o as ref, r as compose$1 } from "./core-Bxj0UQDF.mjs";
5
- import { t as root } from "./root-C1u12YMD.mjs";
6
- import { r as tokens } from "./tokens-O8S8QH_R.mjs";
1
+ import { i as stylesheet, n as forSlots, r as slots } from "./style-CmHD4Ul3.mjs";
2
+ import { i as compose } from "./styleValue-Cj4YjgVB.mjs";
3
+ import { r as standard } from "./layers-keV38soP.mjs";
4
+ import { o as ref, r as compose$1 } from "./core-IMVYU8JN.mjs";
5
+ import { t as root } from "./root-BBi88KYx.mjs";
6
+ import { r as tokens } from "./tokens-BkWHtxjY.mjs";
7
7
  import { body, reset } from "./defaults.mjs";
8
8
  //#region src/app.ts
9
9
  /**
@@ -1,4 +1,4 @@
1
- import { u as inline } from "./styleValue-_G9jwb17.mjs";
1
+ import { u as inline } from "./styleValue-Cj4YjgVB.mjs";
2
2
  //#region src/theme/core.ts
3
3
  /**
4
4
  * `Theme` is typed token data, not a service. Dynamic theme state (light/dark)
@@ -50,4 +50,4 @@ const Theme = {
50
50
  //#endregion
51
51
  export { lightDark as a, define as i, VAR_PREFIX as n, ref as o, compose as r, variables as s, Theme as t };
52
52
 
53
- //# sourceMappingURL=core-Bxj0UQDF.mjs.map
53
+ //# sourceMappingURL=core-IMVYU8JN.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"core-Bxj0UQDF.mjs","names":[],"sources":["../src/theme/core.ts"],"sourcesContent":["/**\n * `Theme` is typed token data, not a service. Dynamic theme state (light/dark)\n * belongs in the Foldkit Model; `variables` compiles the tokens to CSS custom\n * properties so switching a class or a root style is cheap and SSR-safe.\n */\nimport { inline, type StyleValue } from '../styleValue.js'\n\nexport type ThemeTokens = {\n readonly [group: string]: { readonly [name: string]: string }\n}\n\nexport type Theme<T extends ThemeTokens = ThemeTokens> = T\n\nexport const VAR_PREFIX = '--fk'\n\nexport const define = <T extends ThemeTokens>(tokens: T): Readonly<T> =>\n Object.freeze(\n Object.fromEntries(\n Object.entries(tokens).map(([group, names]) => [group, Object.freeze({ ...names })]),\n ),\n ) as Readonly<T>\n\n/** `var(--fk-group-name)` for every token, by the theme's own group and token names. */\nexport type Refs<T extends ThemeTokens> = {\n readonly [G in keyof T & string]: { readonly [N in keyof T[G] & string]: string }\n}\n\nconst refsByTheme = new WeakMap<ThemeTokens, Refs<ThemeTokens>>()\n\n/**\n * The theme's tokens as references: `Theme.ref(theme).surface.overt` is\n * `var(--fk-surface-overt)`, and a group or name the theme lacks is a type\n * error. Only the names are read, never the values. Built once per theme.\n */\nexport const ref = <T extends ThemeTokens>(theme: T): Refs<T> => {\n const cached = refsByTheme.get(theme)\n if (cached !== undefined) return cached as Refs<T>\n const built = Object.freeze(\n Object.fromEntries(\n Object.entries(theme).map(([group, names]) => [\n group,\n Object.freeze(\n Object.fromEntries(\n Object.keys(names).map(name => [name, `var(${VAR_PREFIX}-${group}-${name})`]),\n ),\n ),\n ]),\n ),\n )\n refsByTheme.set(theme, built)\n return built as Refs<T>\n}\n\nexport const variables = <T extends ThemeTokens>(theme: T): StyleValue => {\n const style: Record<`--${string}`, string> = {}\n for (const [group, names] of Object.entries(theme)) {\n for (const [name, value] of Object.entries(names as Record<string, string>)) {\n style[`${VAR_PREFIX}-${group}-${name}`] = value\n }\n }\n return inline(style)\n}\n\n/**\n * A token that follows the user's color scheme with CSS `light-dark()`: no\n * JavaScript and no Model field. A theme the user chooses is the other case,\n * and belongs in the Model as a class on the root; `variables` compiles both.\n */\nexport const lightDark = (light: string, dark: string): string => `light-dark(${light}, ${dark})`\n\ntype Merge<A, B> = {\n readonly [G in keyof A | keyof B]: G extends keyof B\n ? G extends keyof A\n ? A[G] & B[G]\n : B[G]\n : G extends keyof A\n ? A[G]\n : never\n}\n\n/** Themes merged at definition time, later tokens winning within a group. */\nexport const compose = <A extends ThemeTokens, B extends ThemeTokens>(\n base: A,\n over: B,\n): Readonly<Merge<A, B>> => {\n const merged: Record<string, Record<string, string>> = {}\n for (const source of [base, over]) {\n for (const [group, names] of Object.entries(source)) {\n merged[group] = { ...merged[group], ...(names as Record<string, string>) }\n }\n }\n return define(merged) as unknown as Readonly<Merge<A, B>>\n}\n\nexport const Theme = { define, ref, variables, lightDark, compose } as const\n"],"mappings":";;;;;;;AAaA,MAAa,aAAa;AAE1B,MAAa,UAAiC,WAC5C,OAAO,OACL,OAAO,YACL,OAAO,QAAQ,MAAM,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,OAAO,OAAO,OAAO,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,CACrF,CACF;AAOF,MAAM,8BAAc,IAAI,QAAwC;;;;;;AAOhE,MAAa,OAA8B,UAAsB;CAC/D,MAAM,SAAS,YAAY,IAAI,KAAK;CACpC,IAAI,WAAW,KAAA,GAAW,OAAO;CACjC,MAAM,QAAQ,OAAO,OACnB,OAAO,YACL,OAAO,QAAQ,KAAK,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAC5C,OACA,OAAO,OACL,OAAO,YACL,OAAO,KAAK,KAAK,CAAC,CAAC,KAAI,SAAQ,CAAC,MAAM,OAAO,WAAW,GAAG,MAAM,GAAG,KAAK,EAAE,CAAC,CAC9E,CACF,CACF,CAAC,CACH,CACF;CACA,YAAY,IAAI,OAAO,KAAK;CAC5B,OAAO;AACT;AAEA,MAAa,aAAoC,UAAyB;CACxE,MAAM,QAAuC,CAAC;CAC9C,KAAK,MAAM,CAAC,OAAO,UAAU,OAAO,QAAQ,KAAK,GAC/C,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,KAA+B,GACxE,MAAM,GAAG,WAAW,GAAG,MAAM,GAAG,UAAU;CAG9C,OAAO,OAAO,KAAK;AACrB;;;;;;AAOA,MAAa,aAAa,OAAe,SAAyB,cAAc,MAAM,IAAI,KAAK;;AAa/F,MAAa,WACX,MACA,SAC0B;CAC1B,MAAM,SAAiD,CAAC;CACxD,KAAK,MAAM,UAAU,CAAC,MAAM,IAAI,GAC9B,KAAK,MAAM,CAAC,OAAO,UAAU,OAAO,QAAQ,MAAM,GAChD,OAAO,SAAS;EAAE,GAAG,OAAO;EAAQ,GAAI;CAAiC;CAG7E,OAAO,OAAO,MAAM;AACtB;AAEA,MAAa,QAAQ;CAAE;CAAQ;CAAK;CAAW;CAAW;AAAQ"}
1
+ {"version":3,"file":"core-IMVYU8JN.mjs","names":[],"sources":["../src/theme/core.ts"],"sourcesContent":["/**\n * `Theme` is typed token data, not a service. Dynamic theme state (light/dark)\n * belongs in the Foldkit Model; `variables` compiles the tokens to CSS custom\n * properties so switching a class or a root style is cheap and SSR-safe.\n */\nimport { inline, type StyleValue } from '../styleValue.js'\n\nexport type ThemeTokens = {\n readonly [group: string]: { readonly [name: string]: string }\n}\n\nexport type Theme<T extends ThemeTokens = ThemeTokens> = T\n\nexport const VAR_PREFIX = '--fk'\n\nexport const define = <T extends ThemeTokens>(tokens: T): Readonly<T> =>\n Object.freeze(\n Object.fromEntries(\n Object.entries(tokens).map(([group, names]) => [group, Object.freeze({ ...names })]),\n ),\n ) as Readonly<T>\n\n/** `var(--fk-group-name)` for every token, by the theme's own group and token names. */\nexport type Refs<T extends ThemeTokens> = {\n readonly [G in keyof T & string]: { readonly [N in keyof T[G] & string]: string }\n}\n\nconst refsByTheme = new WeakMap<ThemeTokens, Refs<ThemeTokens>>()\n\n/**\n * The theme's tokens as references: `Theme.ref(theme).surface.overt` is\n * `var(--fk-surface-overt)`, and a group or name the theme lacks is a type\n * error. Only the names are read, never the values. Built once per theme.\n */\nexport const ref = <T extends ThemeTokens>(theme: T): Refs<T> => {\n const cached = refsByTheme.get(theme)\n if (cached !== undefined) return cached as Refs<T>\n const built = Object.freeze(\n Object.fromEntries(\n Object.entries(theme).map(([group, names]) => [\n group,\n Object.freeze(\n Object.fromEntries(\n Object.keys(names).map(name => [name, `var(${VAR_PREFIX}-${group}-${name})`]),\n ),\n ),\n ]),\n ),\n )\n refsByTheme.set(theme, built)\n return built as Refs<T>\n}\n\nexport const variables = <T extends ThemeTokens>(theme: T): StyleValue => {\n const style: Record<`--${string}`, string> = {}\n for (const [group, names] of Object.entries(theme)) {\n for (const [name, value] of Object.entries(names as Record<string, string>)) {\n style[`${VAR_PREFIX}-${group}-${name}`] = value\n }\n }\n return inline(style)\n}\n\n/**\n * A token that follows the user's color scheme with CSS `light-dark()`: no\n * JavaScript and no Model field. A theme the user chooses is the other case,\n * and belongs in the Model as a class on the root; `variables` compiles both.\n */\nexport const lightDark = (light: string, dark: string): string => `light-dark(${light}, ${dark})`\n\ntype Merge<A, B> = {\n readonly [G in keyof A | keyof B]: G extends keyof B\n ? G extends keyof A\n ? A[G] & B[G]\n : B[G]\n : G extends keyof A\n ? A[G]\n : never\n}\n\n/** Themes merged at definition time, later tokens winning within a group. */\nexport const compose = <A extends ThemeTokens, B extends ThemeTokens>(\n base: A,\n over: B,\n): Readonly<Merge<A, B>> => {\n const merged: Record<string, Record<string, string>> = {}\n for (const source of [base, over]) {\n for (const [group, names] of Object.entries(source)) {\n merged[group] = { ...merged[group], ...(names as Record<string, string>) }\n }\n }\n return define(merged) as unknown as Readonly<Merge<A, B>>\n}\n\nexport const Theme = { define, ref, variables, lightDark, compose } as const\n"],"mappings":";;;;;;;AAaA,MAAa,aAAa;AAE1B,MAAa,UAAiC,WAC5C,OAAO,OACL,OAAO,YACL,OAAO,QAAQ,MAAM,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,OAAO,OAAO,OAAO,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,CACrF,CACF;AAOF,MAAM,8BAAc,IAAI,QAAwC;;;;;;AAOhE,MAAa,OAA8B,UAAsB;CAC/D,MAAM,SAAS,YAAY,IAAI,KAAK;CACpC,IAAI,WAAW,KAAA,GAAW,OAAO;CACjC,MAAM,QAAQ,OAAO,OACnB,OAAO,YACL,OAAO,QAAQ,KAAK,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAC5C,OACA,OAAO,OACL,OAAO,YACL,OAAO,KAAK,KAAK,CAAC,CAAC,KAAI,SAAQ,CAAC,MAAM,OAAO,WAAW,GAAG,MAAM,GAAG,KAAK,EAAE,CAAC,CAC9E,CACF,CACF,CAAC,CACH,CACF;CACA,YAAY,IAAI,OAAO,KAAK;CAC5B,OAAO;AACT;AAEA,MAAa,aAAoC,UAAyB;CACxE,MAAM,QAAuC,CAAC;CAC9C,KAAK,MAAM,CAAC,OAAO,UAAU,OAAO,QAAQ,KAAK,GAC/C,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,KAA+B,GACxE,MAAM,GAAG,WAAW,GAAG,MAAM,GAAG,UAAU;CAG9C,OAAO,OAAO,KAAK;AACrB;;;;;;AAOA,MAAa,aAAa,OAAe,SAAyB,cAAc,MAAM,IAAI,KAAK;;AAa/F,MAAa,WACX,MACA,SAC0B;CAC1B,MAAM,SAAiD,CAAC;CACxD,KAAK,MAAM,UAAU,CAAC,MAAM,IAAI,GAC9B,KAAK,MAAM,CAAC,OAAO,UAAU,OAAO,QAAQ,MAAM,GAChD,OAAO,SAAS;EAAE,GAAG,OAAO;EAAQ,GAAI;CAAiC;CAG7E,OAAO,OAAO,MAAM;AACtB;AAEA,MAAa,QAAQ;CAAE;CAAQ;CAAK;CAAW;CAAW;AAAQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.d.mts","names":[],"sources":["../src/defaults.ts"],"mappings":";;;qBAca,OAAO;;qBAcP,MAAM;;;;;;qBASN,UAAU;;qBAaV,OAAO;;qBASP,MAAM;;qBASN,UAAU;;qBAaV,KAAK;qBAEL"}
1
+ {"version":3,"file":"defaults.d.mts","names":[],"sources":["../src/defaults.ts"],"mappings":";;;qBAca,OAAO;;qBAcP,MAAM;;;;;;qBAYN,UAAU;;qBAaV,OAAO;;qBASP,MAAM;;qBASN,UAAU;;qBAaV,KAAK;qBAEL"}
package/dist/defaults.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { c as global, i as compose } from "./styleValue-_G9jwb17.mjs";
1
+ import { c as global, i as compose } from "./styleValue-Cj4YjgVB.mjs";
2
2
  //#region src/defaults.ts
3
3
  /**
4
4
  * `foldkit-mixins/defaults`: the baseline plain HTML gets before any slot is
@@ -21,7 +21,7 @@ const reset = global([
21
21
  `@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:0.01ms!important;transition-duration:0.01ms!important;scroll-behavior:auto!important}}`
22
22
  ].join(""));
23
23
  /** The page's font, color, background, and color scheme. */
24
- const body = global(`:where(body){font-family:${v("font-body", "system-ui, sans-serif")};font-size:${v("size-md", "1rem")};line-height:${v("leading-normal", "1.5")};font-weight:${v("weight-normal", "400")};color:${v("text-default", "CanvasText")};background:${v("surface-base", "Canvas")};-webkit-font-smoothing:antialiased}`);
24
+ const body = global(`:where(:root){scrollbar-color:${v("outline-overt", "auto")} transparent}:where(body){font-family:${v("font-body", "system-ui, sans-serif")};font-size:${v("size-md", "1rem")};line-height:${v("leading-normal", "1.5")};font-weight:${v("weight-normal", "400")};color:${v("text-default", "CanvasText")};background:${v("surface-base", "Canvas")};-webkit-font-smoothing:antialiased}`);
25
25
  /**
26
26
  * A type hierarchy for h1 to h6 from the size scale, in `text-overt`. A
27
27
  * container drawn in a color of its own, such as a band on the accent, sets
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.mjs","names":[],"sources":["../src/defaults.ts"],"sourcesContent":["/**\n * `foldkit-mixins/defaults`: the baseline plain HTML gets before any slot is\n * styled. Every member is element-selector CSS over `--fk-*` tokens with a\n * fallback, so it re-themes with the tokens and still reads without them.\n * The pieces are unlayered; a page puts `reset` in `reset` and the rest in\n * `defaults` with `Layers.standard.in`. Selectors use `:where()` so any\n * class rule beats them.\n */\nimport { compose, global } from './styleValue.js'\nimport type { StyleValue } from './styleValue.js'\n\nconst v = (name: string, fallback: string): string => `var(--fk-${name}, ${fallback})`\n\n/** Box model, margins, media, form-control fonts: what every page assumes. */\nexport const reset: StyleValue = global(\n [\n '*,*::before,*::after{box-sizing:border-box;margin:0;min-width:0}',\n ':where(html){text-size-adjust:none;-webkit-text-size-adjust:none;tab-size:4;font-synthesis:none;text-rendering:optimizeLegibility}',\n ':where(:is(img,picture,video,canvas,svg)){display:block;max-inline-size:100%;block-size:auto}',\n ':where(:is(input,button,textarea,select)){font:inherit;color:inherit}',\n ':where(textarea){field-sizing:content;min-block-size:2lh}',\n ':where(:is(h1,h2,h3,h4,h5,h6)){text-wrap:balance}',\n ':where(p){text-wrap:pretty;overflow-wrap:break-word}',\n `@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:0.01ms!important;transition-duration:0.01ms!important;scroll-behavior:auto!important}}`,\n ].join(''),\n)\n\n/** The page's font, color, background, and color scheme. */\nexport const body: StyleValue = global(\n `:where(body){font-family:${v('font-body', 'system-ui, sans-serif')};font-size:${v('size-md', '1rem')};line-height:${v('leading-normal', '1.5')};font-weight:${v('weight-normal', '400')};color:${v('text-default', 'CanvasText')};background:${v('surface-base', 'Canvas')};-webkit-font-smoothing:antialiased}`,\n)\n\n/**\n * A type hierarchy for h1 to h6 from the size scale, in `text-overt`. A\n * container drawn in a color of its own, such as a band on the accent, sets\n * `--fk-heading: currentColor` (`Style.vars`) and its headings take its color.\n */\nexport const headings: StyleValue = global(\n [\n `:where(:is(h1,h2,h3,h4,h5,h6)){font-family:${v('font-heading', 'inherit')};font-weight:${v('weight-bold', '700')};line-height:${v('leading-tight', '1.2')};color:${v('heading', v('text-overt', 'inherit'))};letter-spacing:-0.01em}`,\n `:where(h1){font-size:${v('size-4xl', '2.25rem')}}`,\n `:where(h2){font-size:${v('size-3xl', '1.875rem')}}`,\n `:where(h3){font-size:${v('size-2xl', '1.5rem')}}`,\n `:where(h4){font-size:${v('size-xl', '1.25rem')}}`,\n `:where(h5){font-size:${v('size-lg', '1.125rem')}}`,\n `:where(h6){font-size:${v('size-md', '1rem')}}`,\n ].join(''),\n)\n\n/** Link color, hover, and a visible focus ring. */\nexport const links: StyleValue = global(\n [\n `:where(a){color:${v('text-link', 'LinkText')};text-decoration-thickness:from-font;text-underline-offset:0.15em}`,\n `:where(a:hover){color:${v('text-link-hover', 'LinkText')}}`,\n `:where(:is(a,button,input,select,textarea,summary,[tabindex]):focus-visible){outline:${v('border-thick', '2px')} solid ${v('outline-focus', 'Highlight')};outline-offset:2px}`,\n ].join(''),\n)\n\n/** Inline code and code blocks on the subtle surface. */\nexport const code: StyleValue = global(\n [\n `:where(:is(code,kbd,samp,pre)){font-family:${v('font-mono', 'ui-monospace, monospace')};font-size:${v('size-sm', '0.875rem')}}`,\n `:where(:not(pre)>code){padding:0.1em 0.35em;border-radius:${v('radius-sm', '3px')};background:${v('surface-subtle', 'transparent')};overflow-wrap:anywhere}`,\n `:where(pre){padding:${v('space-md', '1rem')};border:${v('border-thin', '1px')} solid ${v('outline-subtle', 'transparent')};border-radius:${v('radius-md', '6px')};background:${v('surface-subtle', 'transparent')};overflow-x:auto;line-height:${v('leading-snug', '1.375')}}`,\n ].join(''),\n)\n\n/** Text inputs, selects, textareas, and buttons: one radius, one border, one focus. */\nexport const controls: StyleValue = global(\n [\n `:where(:is(input:not([type=checkbox],[type=radio],[type=range],[type=color],[type=file]),select,textarea)){padding:${v('space-xs', '0.5rem')} ${v('space-sm', '0.75rem')};border:${v('border-thin', '1px')} solid ${v('outline-default', 'ButtonBorder')};border-radius:${v('radius-md', '6px')};background:${v('surface-base', 'Field')};color:${v('text-default', 'FieldText')};transition:border-color ${v('motion-fast', '150ms')} ${v('motion-ease', 'ease-out')}}`,\n `:where(:is(input,select,textarea):focus-visible){border-color:${v('accent-default', 'Highlight')}}`,\n `:where(:is(input,select,textarea)[aria-invalid=true]){border-color:${v('error-default', 'red')}}`,\n `:where(button,[type=button],[type=submit],[type=reset]){padding:${v('space-xs', '0.5rem')} ${v('space-md', '1rem')};border:${v('border-thin', '1px')} solid ${v('outline-default', 'ButtonBorder')};border-radius:${v('radius-md', '6px')};background:${v('surface-subtle', 'ButtonFace')};color:${v('text-default', 'ButtonText')};cursor:pointer;transition:background ${v('motion-fast', '150ms')} ${v('motion-ease', 'ease-out')}}`,\n `:where(button,[type=button],[type=submit],[type=reset]):hover{background:${v('surface-muted', 'ButtonFace')}}`,\n `:where(:is(button,input,select,textarea):disabled){opacity:0.5;cursor:not-allowed}`,\n `:where(:is(input,select,textarea,button)::placeholder){color:${v('text-muted', 'GrayText')}}`,\n ].join(''),\n)\n\n/** Every default except `reset`, which belongs in its own layer. */\nexport const all: StyleValue = compose(body, headings, links, code, controls)\n\nexport const Defaults = { reset, body, headings, links, code, controls, all } as const\n"],"mappings":";;;;;;;;;;AAWA,MAAM,KAAK,MAAc,aAA6B,YAAY,KAAK,IAAI,SAAS;;AAGpF,MAAa,QAAoB,OAC/B;CACE;CACA;C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E,iBAAiB,EAAE,aAAa,KAAK,EAAE,cAAc,EAAE,kBAAkB,aAAa,EAAE,+BAA+B,EAAE,gBAAgB,OAAO,EAAE;AAC/Q,CAAC,CAAC,KAAK,EAAE,CACX;;AAGA,MAAa,WAAuB,OAClC;CACE,sHAAsH,EAAE,YAAY,QAAQ,EAAE,GAAG,EAAE,YAAY,SAAS,EAAE,UAAU,EAAE,eAAe,KAAK,EAAE,SAAS,EAAE,mBAAmB,cAAc,EAAE,iBAAiB,EAAE,aAAa,KAAK,EAAE,cAAc,EAAE,gBAAgB,OAAO,EAAE,SAAS,EAAE,gBAAgB,WAAW,EAAE,2BAA2B,EAAE,eAAe,OAAO,EAAE,GAAG,EAAE,eAAe,UAAU,EAAE;CACvc,iEAAiE,EAAE,kBAAkB,WAAW,EAAE;CAClG,sEAAsE,EAAE,iBAAiB,KAAK,EAAE;CAChG,mEAAmE,EAAE,YAAY,QAAQ,EAAE,GAAG,EAAE,YAAY,MAAM,EAAE,UAAU,EAAE,eAAe,KAAK,EAAE,SAAS,EAAE,mBAAmB,cAAc,EAAE,iBAAiB,EAAE,aAAa,KAAK,EAAE,cAAc,EAAE,kBAAkB,YAAY,EAAE,SAAS,EAAE,gBAAgB,YAAY,EAAE,wCAAwC,EAAE,eAAe,OAAO,EAAE,GAAG,EAAE,eAAe,UAAU,EAAE;CACta,4EAA4E,EAAE,iBAAiB,YAAY,EAAE;CAC7G;CACA,gEAAgE,EAAE,cAAc,UAAU,EAAE;AAC9F,CAAC,CAAC,KAAK,EAAE,CACX;;AAGA,MAAa,MAAkB,QAAQ,MAAM,UAAU,OAAO,MAAM,QAAQ;AAE5E,MAAa,WAAW;CAAE;CAAO;CAAM;CAAU;CAAO;CAAM;CAAU;AAAI"}
1
+ {"version":3,"file":"defaults.mjs","names":[],"sources":["../src/defaults.ts"],"sourcesContent":["/**\n * `foldkit-mixins/defaults`: the baseline plain HTML gets before any slot is\n * styled. Every member is element-selector CSS over `--fk-*` tokens with a\n * fallback, so it re-themes with the tokens and still reads without them.\n * The pieces are unlayered; a page puts `reset` in `reset` and the rest in\n * `defaults` with `Layers.standard.in`. Selectors use `:where()` so any\n * class rule beats them.\n */\nimport { compose, global } from './styleValue.js'\nimport type { StyleValue } from './styleValue.js'\n\nconst v = (name: string, fallback: string): string => `var(--fk-${name}, ${fallback})`\n\n/** Box model, margins, media, form-control fonts: what every page assumes. */\nexport const reset: StyleValue = global(\n [\n '*,*::before,*::after{box-sizing:border-box;margin:0;min-width:0}',\n ':where(html){text-size-adjust:none;-webkit-text-size-adjust:none;tab-size:4;font-synthesis:none;text-rendering:optimizeLegibility}',\n ':where(:is(img,picture,video,canvas,svg)){display:block;max-inline-size:100%;block-size:auto}',\n ':where(:is(input,button,textarea,select)){font:inherit;color:inherit}',\n ':where(textarea){field-sizing:content;min-block-size:2lh}',\n ':where(:is(h1,h2,h3,h4,h5,h6)){text-wrap:balance}',\n ':where(p){text-wrap:pretty;overflow-wrap:break-word}',\n `@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:0.01ms!important;transition-duration:0.01ms!important;scroll-behavior:auto!important}}`,\n ].join(''),\n)\n\n/** The page's font, color, background, and color scheme. */\nexport const body: StyleValue = global(\n // Scrollbars in the theme's line color, which keeps the page's hue, not the\n // browser's grey; inherited, so one rule reaches every scrolling panel.\n `:where(:root){scrollbar-color:${v('outline-overt', 'auto')} transparent}` +\n `:where(body){font-family:${v('font-body', 'system-ui, sans-serif')};font-size:${v('size-md', '1rem')};line-height:${v('leading-normal', '1.5')};font-weight:${v('weight-normal', '400')};color:${v('text-default', 'CanvasText')};background:${v('surface-base', 'Canvas')};-webkit-font-smoothing:antialiased}`,\n)\n\n/**\n * A type hierarchy for h1 to h6 from the size scale, in `text-overt`. A\n * container drawn in a color of its own, such as a band on the accent, sets\n * `--fk-heading: currentColor` (`Style.vars`) and its headings take its color.\n */\nexport const headings: StyleValue = global(\n [\n `:where(:is(h1,h2,h3,h4,h5,h6)){font-family:${v('font-heading', 'inherit')};font-weight:${v('weight-bold', '700')};line-height:${v('leading-tight', '1.2')};color:${v('heading', v('text-overt', 'inherit'))};letter-spacing:-0.01em}`,\n `:where(h1){font-size:${v('size-4xl', '2.25rem')}}`,\n `:where(h2){font-size:${v('size-3xl', '1.875rem')}}`,\n `:where(h3){font-size:${v('size-2xl', '1.5rem')}}`,\n `:where(h4){font-size:${v('size-xl', '1.25rem')}}`,\n `:where(h5){font-size:${v('size-lg', '1.125rem')}}`,\n `:where(h6){font-size:${v('size-md', '1rem')}}`,\n ].join(''),\n)\n\n/** Link color, hover, and a visible focus ring. */\nexport const links: StyleValue = global(\n [\n `:where(a){color:${v('text-link', 'LinkText')};text-decoration-thickness:from-font;text-underline-offset:0.15em}`,\n `:where(a:hover){color:${v('text-link-hover', 'LinkText')}}`,\n `:where(:is(a,button,input,select,textarea,summary,[tabindex]):focus-visible){outline:${v('border-thick', '2px')} solid ${v('outline-focus', 'Highlight')};outline-offset:2px}`,\n ].join(''),\n)\n\n/** Inline code and code blocks on the subtle surface. */\nexport const code: StyleValue = global(\n [\n `:where(:is(code,kbd,samp,pre)){font-family:${v('font-mono', 'ui-monospace, monospace')};font-size:${v('size-sm', '0.875rem')}}`,\n `:where(:not(pre)>code){padding:0.1em 0.35em;border-radius:${v('radius-sm', '3px')};background:${v('surface-subtle', 'transparent')};overflow-wrap:anywhere}`,\n `:where(pre){padding:${v('space-md', '1rem')};border:${v('border-thin', '1px')} solid ${v('outline-subtle', 'transparent')};border-radius:${v('radius-md', '6px')};background:${v('surface-subtle', 'transparent')};overflow-x:auto;line-height:${v('leading-snug', '1.375')}}`,\n ].join(''),\n)\n\n/** Text inputs, selects, textareas, and buttons: one radius, one border, one focus. */\nexport const controls: StyleValue = global(\n [\n `:where(:is(input:not([type=checkbox],[type=radio],[type=range],[type=color],[type=file]),select,textarea)){padding:${v('space-xs', '0.5rem')} ${v('space-sm', '0.75rem')};border:${v('border-thin', '1px')} solid ${v('outline-default', 'ButtonBorder')};border-radius:${v('radius-md', '6px')};background:${v('surface-base', 'Field')};color:${v('text-default', 'FieldText')};transition:border-color ${v('motion-fast', '150ms')} ${v('motion-ease', 'ease-out')}}`,\n `:where(:is(input,select,textarea):focus-visible){border-color:${v('accent-default', 'Highlight')}}`,\n `:where(:is(input,select,textarea)[aria-invalid=true]){border-color:${v('error-default', 'red')}}`,\n `:where(button,[type=button],[type=submit],[type=reset]){padding:${v('space-xs', '0.5rem')} ${v('space-md', '1rem')};border:${v('border-thin', '1px')} solid ${v('outline-default', 'ButtonBorder')};border-radius:${v('radius-md', '6px')};background:${v('surface-subtle', 'ButtonFace')};color:${v('text-default', 'ButtonText')};cursor:pointer;transition:background ${v('motion-fast', '150ms')} ${v('motion-ease', 'ease-out')}}`,\n `:where(button,[type=button],[type=submit],[type=reset]):hover{background:${v('surface-muted', 'ButtonFace')}}`,\n `:where(:is(button,input,select,textarea):disabled){opacity:0.5;cursor:not-allowed}`,\n `:where(:is(input,select,textarea,button)::placeholder){color:${v('text-muted', 'GrayText')}}`,\n ].join(''),\n)\n\n/** Every default except `reset`, which belongs in its own layer. */\nexport const all: StyleValue = compose(body, headings, links, code, controls)\n\nexport const Defaults = { reset, body, headings, links, code, controls, all } as const\n"],"mappings":";;;;;;;;;;AAWA,MAAM,KAAK,MAAc,aAA6B,YAAY,KAAK,IAAI,SAAS;;AAGpF,MAAa,QAAoB,OAC/B;CACE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC,CAAC,KAAK,EAAE,CACX;;AAGA,MAAa,OAAmB,OAG9B,iCAAiC,EAAE,iBAAiB,MAAM,EAAE,wCAC9B,EAAE,aAAa,uBAAuB,EAAE,aAAa,EAAE,WAAW,MAAM,EAAE,eAAe,EAAE,kBAAkB,KAAK,EAAE,eAAe,EAAE,iBAAiB,KAAK,EAAE,SAAS,EAAE,gBAAgB,YAAY,EAAE,cAAc,EAAE,gBAAgB,QAAQ,EAAE,qCAChR;;;;;;AAOA,MAAa,WAAuB,OAClC;CACE,8CAA8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AAE,gBAAgB,OAAO,EAAE,SAAS,EAAE,gBAAgB,WAAW,EAAE,2BAA2B,EAAE,eAAe,OAAO,EAAE,GAAG,EAAE,eAAe,UAAU,EAAE;CACvc,iEAAiE,EAAE,kBAAkB,WAAW,EAAE;CAClG,sEAAsE,EAAE,iBAAiB,KAAK,EAAE;CAChG,mEAAmE,EAAE,YAAY,QAAQ,EAAE,GAAG,EAAE,YAAY,MAAM,EAAE,UAAU,EAAE,eAAe,KAAK,EAAE,SAAS,EAAE,mBAAmB,cAAc,EAAE,iBAAiB,EAAE,aAAa,KAAK,EAAE,cAAc,EAAE,kBAAkB,YAAY,EAAE,SAAS,EAAE,gBAAgB,YAAY,EAAE,wCAAwC,EAAE,eAAe,OAAO,EAAE,GAAG,EAAE,eAAe,UAAU,EAAE;CACta,4EAA4E,EAAE,iBAAiB,YAAY,EAAE;CAC7G;CACA,gEAAgE,EAAE,cAAc,UAAU,EAAE;AAC9F,CAAC,CAAC,KAAK,EAAE,CACX;;AAGA,MAAa,MAAkB,QAAQ,MAAM,UAAU,OAAO,MAAM,QAAQ;AAE5E,MAAa,WAAW;CAAE;CAAO;CAAM;CAAU;CAAO;CAAM;CAAU;AAAI"}
package/dist/index.d.mts CHANGED
@@ -14,7 +14,7 @@ declare namespace diagnostics_d_exports {
14
14
  * programming errors (a definition attaches something a slot does not allow),
15
15
  * so `resolve` throws a `DiagnosticError` carrying one.
16
16
  */
17
- type DiagnosticCode = 'mixins:unknown-slot' | 'mixins:hidden-slot' | 'mixins:capability-mismatch' | 'mixins:unsupported-event' | 'mixins:unsupported-attribute' | 'mixins:protected-event' | 'mixins:protected-attribute' | 'mixins:protected-style-property' | 'mixins:style-property-conflict' | 'mixins:event-conflict' | 'mixins:attribute-conflict' | 'mixins:structural-override' | 'mixins:duplicate-mount-name' | 'mixins:duplicate-item-id' | 'mixins:ragged-grid-areas' | 'style:duplicate-layer' | 'style:conflicting-layer-order' | 'style:unlayered-rule' | 'style:relayered' | 'theme:unparseable-breakpoint' | 'a11y:missing-slot' | 'a11y:hidden-slot' | 'a11y:capability-mismatch' | 'a11y:missing-event' | 'a11y:missing-attribute';
17
+ type DiagnosticCode = 'mixins:unknown-slot' | 'mixins:hidden-slot' | 'mixins:capability-mismatch' | 'mixins:unsupported-event' | 'mixins:unsupported-attribute' | 'mixins:protected-event' | 'mixins:protected-attribute' | 'mixins:protected-style-property' | 'mixins:style-property-conflict' | 'mixins:event-conflict' | 'mixins:attribute-conflict' | 'mixins:structural-override' | 'mixins:duplicate-mount-name' | 'mixins:duplicate-item-id' | 'mixins:ragged-grid-areas' | 'mixins:inline-shorthand-conflict' | 'style:duplicate-layer' | 'style:conflicting-layer-order' | 'style:unlayered-rule' | 'style:relayered' | 'theme:unparseable-breakpoint' | 'a11y:missing-slot' | 'a11y:hidden-slot' | 'a11y:capability-mismatch' | 'a11y:missing-event' | 'a11y:missing-attribute';
18
18
  interface Diagnostic {
19
19
  readonly source: 'mixins' | 'a11y' | 'style' | 'theme';
20
20
  readonly code: DiagnosticCode;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/diagnostics.ts","../src/a11y.ts","../src/attributes.ts","../src/behaviors/collection.ts","../src/behaviors/disclosure.ts","../src/behaviors/field-association.ts","../src/behaviors/spin-value.ts","../src/behaviors/toggle-state.ts","../src/behaviors/index.ts","../src/selector.ts"],"mappings":";;;;;;;;;;;;;;;;KAMY;UA2BK;WACN;WACA,MAAM;WACN;WACA;WACA;WACA,UAAU,SAAS;;cAGjB,wBAAwB;WAC1B,YAAY;EAET,YAAA,YAAY;;;;;KChCd;UAOK,uBAAuB;WAC7B;WACA,MAAM;;UAGA;WACN,aAAa;WACb,SAAS,cAAc;WACvB,aAAa,cAAc;;WAE3B;;KAGC,eAAe,SAAS,eAAe;cAEtC;UAEI,QAAQ,aAAa,eAAe;YACzC;aAA2B,cAAc;;WAC1C,cAAc;;cAGZ,gBAAiB,aAAa,cAAc,MAAM,SAAO,QAAQ;cAyCjE,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AS,eAAe;WAC7C,eAAe;WACf,QAAQ,OAAO;WACf,WAAW,iBAAiB;;WAE5B,QAAQ,OAAO;;cAGb,aACV,OAAO,OAAO,WACd,OAAO,SACN,SAAS,UAAQ,OAAO,SAAS,WAChC,cAAuB,OAAO,OAAO;;;;KC3D9B;UAEK,QAAQ,OAAO;WACrB,eAAe;WACf,QAAQ,OAAO,UAAU;;;WAGzB;;cAGE,WACV,OAAO,OAAO,WACd,OAAO,SAAS,SAAS,QAAQ,OAAO,WAAS,cAAuB,OAAO,OAAO;;;;;;;;;;;;;cEf5E,OAAQ,cAAc;;cAItB,MAAO;;cAGP,QAAS,WAAW;;cAGpB,QAAS;;cAGT,aAAc;;cAGd,UAAW;;cAGX,WAAY"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/diagnostics.ts","../src/a11y.ts","../src/attributes.ts","../src/behaviors/collection.ts","../src/behaviors/disclosure.ts","../src/behaviors/field-association.ts","../src/behaviors/spin-value.ts","../src/behaviors/toggle-state.ts","../src/behaviors/index.ts","../src/selector.ts"],"mappings":";;;;;;;;;;;;;;;;KAMY;UA4BK;WACN;WACA,MAAM;WACN;WACA;WACA;WACA,UAAU,SAAS;;cAGjB,wBAAwB;WAC1B,YAAY;EAET,YAAA,YAAY;;;;;KCjCd;UAOK,uBAAuB;WAC7B;WACA,MAAM;;UAGA;WACN,aAAa;WACb,SAAS,cAAc;WACvB,aAAa,cAAc;;WAE3B;;KAGC,eAAe,SAAS,eAAe;cAEtC;UAEI,QAAQ,aAAa,eAAe;YACzC;aAA2B,cAAc;;WAC1C,cAAc;;cAGZ,gBAAiB,aAAa,cAAc,MAAM,SAAO,QAAQ;cAyCjE,WACX,SAAS,SACT;YAAmB,eAAe;MACjC,cAAc;;;;;KC5EL,MAAM;;KAGN,GAAG,SAAS,UAAU,OAAO,QAAQ,UAAU;WAAqB,MAAM;;;cAGzE,QAAS,SAAS,WAAW,eAAe,qBAAmB;;cAS/D,OAAQ,SAAS,UAAU,KACtC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AAQ,OAAO;WACrB,eAAe;WACf,QAAQ,OAAO,UAAU;;;WAGzB;;cAGE,WACV,OAAO,OAAO,WACd,OAAO,SAAS,SAAS,QAAQ,OAAO,WAAS,cAAuB,OAAO,OAAO;;;;;;;;;;;;;cEf5E,OAAQ,cAAc;;cAItB,MAAO;;cAGP,QAAS,WAAW;;cAGpB,QAAS;;cAGT,aAAc;;cAGd,UAAW;;cAGX,WAAY"}
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
- import { _ as extendsCapability, a as slots_exports, b as metadataToken_exports, c as slotView_exports, d as mixin_exports, f as isTagged, g as capability_exports, h as Interactive, l as resolver_exports, m as Focusable, o as slot_exports, p as Container, s as attach$1, t as Style, u as dynamic, v as is$4, x as nameOf, y as make$3 } from "./style-CKjLee4e.mjs";
3
- import { E as diagnostics_exports, T as DiagnosticError } from "./styleValue-_G9jwb17.mjs";
4
- import { t as Layers } from "./layers-B31M0tDi.mjs";
5
- import { t as Theme } from "./core-Bxj0UQDF.mjs";
2
+ import { _ as extendsCapability, a as slots_exports, b as metadataToken_exports, c as slotView_exports, d as mixin_exports, f as isTagged, g as capability_exports, h as Interactive, l as resolver_exports, m as Focusable, o as slot_exports, p as Container, s as attach$1, t as Style, u as dynamic, v as is$4, x as nameOf, y as make$3 } from "./style-CmHD4Ul3.mjs";
3
+ import { E as diagnostics_exports, T as DiagnosticError } from "./styleValue-Cj4YjgVB.mjs";
4
+ import { t as Layers } from "./layers-keV38soP.mjs";
5
+ import { t as Theme } from "./core-IMVYU8JN.mjs";
6
6
  import { Option } from "effect";
7
7
  //#region src/a11y.ts
8
8
  /**
@@ -1,4 +1,4 @@
1
- import { T as DiagnosticError, f as make } from "./styleValue-_G9jwb17.mjs";
1
+ import { T as DiagnosticError, f as make } from "./styleValue-Cj4YjgVB.mjs";
2
2
  //#region src/cssBlocks.ts
3
3
  const withoutComments = (text) => text.replace(/\/\*[\s\S]*?\*\//g, "").trim();
4
4
  /** Index just past the string starting at `start`, which holds its quote. */
@@ -190,4 +190,4 @@ const Layers = {
190
190
  //#endregion
191
191
  export { isUnordered as a, declaredNames as i, define as n, layerOf as o, standard as r, topLevelBlocks as s, Layers as t };
192
192
 
193
- //# sourceMappingURL=layers-B31M0tDi.mjs.map
193
+ //# sourceMappingURL=layers-keV38soP.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"layers-B31M0tDi.mjs","names":[],"sources":["../src/cssBlocks.ts","../src/layers.ts"],"sourcesContent":["/**\n * The top-level blocks of compiled CSS text, and which cascade layer each is\n * in. `Layers.in` reads them to leave an already-layered block where it is,\n * and `Style.stylesheet` to refuse a rule outside the declared order. The\n * text is the compiler's own output or a `Style.global` chunk, so a scanner\n * that respects strings, comments, and brace depth is enough; it is not a\n * CSS parser.\n */\nexport interface Block {\n /** What precedes the body, comments removed: `@layer app`, `.x:hover`, or a whole `@layer a, b;`. */\n readonly prelude: string\n /** The block's full text, as it appeared. */\n readonly text: string\n}\n\nconst withoutComments = (text: string): string => text.replace(/\\/\\*[\\s\\S]*?\\*\\//g, '').trim()\n\n/** Index just past the string starting at `start`, which holds its quote. */\nconst endOfString = (css: string, start: number): number => {\n const quote = css[start]\n let index = start + 1\n while (index < css.length && css[index] !== quote) index += css[index] === '\\\\' ? 2 : 1\n return index + 1\n}\n\nexport const topLevelBlocks = (css: string): ReadonlyArray<Block> => {\n const blocks: Array<Block> = []\n let start = 0\n let depth = 0\n let bodyAt = -1\n let index = 0\n while (index < css.length) {\n const char = css[index]\n if (char === '\"' || char === \"'\") {\n index = endOfString(css, index)\n continue\n }\n if (char === '/' && css[index + 1] === '*') {\n const end = css.indexOf('*/', index + 2)\n index = end === -1 ? css.length : end + 2\n continue\n }\n if (char === '{') {\n if (depth === 0) bodyAt = index\n depth++\n } else if (char === '}') {\n depth--\n if (depth === 0) {\n blocks.push({\n prelude: withoutComments(css.slice(start, bodyAt)),\n text: css.slice(start, index + 1),\n })\n start = index + 1\n }\n } else if (char === ';' && depth === 0) {\n const text = css.slice(start, index + 1)\n blocks.push({ prelude: withoutComments(text), text })\n start = index + 1\n }\n index++\n }\n const rest = css.slice(start)\n if (withoutComments(rest) !== '') blocks.push({ prelude: withoutComments(rest), text: rest })\n return blocks\n}\n\n/** `@layer a, b, c;`: an order statement, not a layered rule. */\nexport const isLayerStatement = (block: Block): boolean => /^@layer\\s[^{}]*;$/.test(block.prelude)\n\n/** The layer a `@layer name{…}` block is in; undefined for any other block. */\nexport const layerOf = (block: Block): string | undefined =>\n /^@layer\\s+([^\\s{},;]+)$/.exec(block.prelude)?.[1]\n\n/** Blocks the cascade does not order: the layer statement, keyframes, font faces, registered properties. */\nexport const isUnordered = (block: Block): boolean =>\n isLayerStatement(block) ||\n /^@(?:-webkit-)?keyframes\\s|^@font-face\\b|^@property\\s/.test(block.prelude)\n\n/** The names a `@layer a, b, c;` statement declares. */\nexport const declaredNames = (statement: string): ReadonlyArray<string> =>\n statement\n .replace(/^@layer\\s+/, '')\n .replace(/;$/, '')\n .split(',')\n .map(name => name.trim())\n","/**\n * Cascade layers as a value. `define` names an order; the result declares\n * it (`declare`) and places a piece in one of its layers (`in`), typed to\n * those names so a misspelled layer is a type error. `standard` is the\n * order a design system built on the `/theme`, `/layout`, `/defaults`, and\n * `/prose` subpaths expects; the pieces those ship are unlayered until a\n * page wraps them, so a different order needs no different generators.\n */\nimport { isLayerStatement, layerOf, topLevelBlocks } from './cssBlocks.js'\nimport { DiagnosticError } from './diagnostics.js'\nimport type { SlotItem } from './slotItem.js'\nimport type { StyleRule } from './styleRules.js'\nimport { make, type StyleValue } from './styleValue.js'\n\n/**\n * One layer of one order, for `Style.forSlots(S)(pieces, { layer })`: every\n * piece is placed before it is compiled, so the style a view attaches and the\n * style a sheet ships are the same value with the same classes. A piece\n * already in another layer keeps it and is not refused, because a slot piece\n * that is only a layered layout or recipe is ordinary.\n */\nexport interface Placement<Name extends string = string> {\n readonly layer: Name\n readonly place: (piece: StyleValue) => StyleValue\n}\n\nexport interface Layers<Name extends string> {\n readonly names: ReadonlyArray<Name>\n /** The `@layer a, b, c;` statement as a global piece; `Style.stylesheet` hoists it first. */\n readonly declare: StyleValue\n /**\n * The piece's unlayered rules and global CSS emitted inside `@layer name`,\n * including rules under `whenInput` and per-item pieces. A rule or block\n * already in a layer keeps it, so a design system's layered layout composed\n * into an application style stays in `layouts`. A piece with nothing\n * unlayered but something in another layer is refused with\n * `style:relayered`, since the call would move nothing. A slot style is\n * layered where it is defined, with `layer`, not here: placing a finished\n * style would copy it under new classes that no view attaches.\n */\n readonly in: (name: Name, piece: StyleValue) => StyleValue\n /** The placement `Style.forSlots` takes as its `layer` option. */\n readonly layer: (name: Name) => Placement<Name>\n}\n\n/** What one `in` call placed, and which other layers it left in place. */\ninterface Tally {\n placed: number\n readonly kept: Set<string>\n}\n\nconst tally = (): Tally => ({ placed: 0, kept: new Set() })\n\nconst placeRule = (name: string, rule: StyleRule, count: Tally): StyleRule => {\n if (rule.layer !== undefined && rule.layer !== name) {\n count.kept.add(rule.layer)\n return rule\n }\n count.placed++\n return rule.layer === name ? rule : { ...rule, layer: name }\n}\n\n/** Runs of unlayered blocks go into one `@layer name{…}`; layered blocks and statements stay. */\nconst placeGlobal = (name: string, css: string, count: Tally): string => {\n const out: Array<string> = []\n let pending = ''\n const flush = (): void => {\n if (pending !== '') out.push(`@layer ${name}{${pending}}`)\n pending = ''\n }\n for (const block of topLevelBlocks(css)) {\n const layer = layerOf(block)\n if (isLayerStatement(block)) {\n flush()\n out.push(block.text)\n } else if (layer === undefined) {\n pending += block.text\n count.placed++\n } else {\n flush()\n out.push(block.text)\n if (layer === name) count.placed++\n else count.kept.add(layer)\n }\n }\n flush()\n return out.join('')\n}\n\nconst place = (name: string, piece: StyleValue, count: Tally): StyleValue =>\n Object.freeze({\n ...piece,\n ...(piece.rules === undefined\n ? {}\n : { rules: Object.freeze(piece.rules.map(rule => placeRule(name, rule, count))) }),\n ...(piece.globalCss === undefined\n ? {}\n : { globalCss: Object.freeze(piece.globalCss.map(css => placeGlobal(name, css, count))) }),\n ...(piece.conditions === undefined\n ? {}\n : {\n conditions: Object.freeze(\n piece.conditions.map(condition => ({\n predicate: condition.predicate,\n piece: place(name, condition.piece, count),\n })),\n ),\n }),\n ...(piece.items === undefined\n ? {}\n : {\n // Rendered per item, after `in` returned: nothing to refuse by then.\n items: Object.freeze(\n piece.items.map(\n render => (item: SlotItem | undefined) => place(name, render(item), tally()),\n ),\n ),\n }),\n })\n\nconst refuseRelayer = (name: string, count: Tally): void => {\n if (count.placed > 0 || count.kept.size === 0) return\n const layers = [...count.kept]\n throw new DiagnosticError({\n source: 'style',\n code: 'style:relayered',\n severity: 'error',\n message: `Layers.in(\"${name}\", …) was given a piece already in layer ${layers.map(layer => `\"${layer}\"`).join(', ')}; a layered rule keeps its layer, so nothing would move. Place the unlayered piece instead.`,\n details: { layer: name, kept: layers },\n })\n}\n\nconst placeIn = (name: string, piece: StyleValue): StyleValue => {\n const count = tally()\n const placed = place(name, piece, count)\n refuseRelayer(name, count)\n return placed\n}\n\nexport const define = <const Name extends string>(names: ReadonlyArray<Name>): Layers<Name> => {\n const seen = new Set<string>()\n for (const name of names) {\n if (seen.has(name)) {\n throw new DiagnosticError({\n source: 'style',\n code: 'style:duplicate-layer',\n severity: 'error',\n message: `Layers.define names \"${name}\" twice`,\n })\n }\n seen.add(name)\n }\n return Object.freeze({\n names: Object.freeze([...names]),\n declare: make({ globalCss: Object.freeze([`@layer ${names.join(', ')};`]) }),\n in: placeIn,\n layer: (name: Name): Placement<Name> =>\n Object.freeze({ layer: name, place: (piece: StyleValue) => place(name, piece, tally()) }),\n })\n}\n\n/**\n * The shipped order. `reset` normalizes; `tokens` holds the scales that do\n * not change per theme; `theme` the knobs and what derives from them, plus\n * scoped overrides; `defaults` element defaults; then a design system's\n * `components`, `layouts` (after components, so a wrapper never beats a\n * component's inner rule), a recipe's `variants`, `utilities`, and the\n * application's `app`, always last.\n */\nexport const standard = define([\n 'reset',\n 'tokens',\n 'theme',\n 'defaults',\n 'components',\n 'layouts',\n 'variants',\n 'utilities',\n 'app',\n])\n\nexport const Layers = { define, standard } as const\n"],"mappings":";;AAeA,MAAM,mBAAmB,SAAyB,KAAK,QAAQ,qBAAqB,EAAE,CAAC,CAAC,KAAK;;AAG7F,MAAM,eAAe,KAAa,UAA0B;CAC1D,MAAM,QAAQ,IAAI;CAClB,IAAI,QAAQ,QAAQ;CACpB,OAAO,QAAQ,IAAI,UAAU,IAAI,WAAW,OAAO,SAAS,IAAI,WAAW,OAAO,IAAI;CACtF,OAAO,QAAQ;AACjB;AAEA,MAAa,kBAAkB,QAAsC;CACnE,MAAM,SAAuB,CAAC;CAC9B,IAAI,QAAQ;CACZ,IAAI,QAAQ;CACZ,IAAI,SAAS;CACb,IAAI,QAAQ;CACZ,OAAO,QAAQ,IAAI,QAAQ;EACzB,MAAM,OAAO,IAAI;EACjB,IAAI,SAAS,QAAO,SAAS,KAAK;GAChC,QAAQ,YAAY,KAAK,KAAK;GAC9B;EACF;EACA,IAAI,SAAS,OAAO,IAAI,QAAQ,OAAO,KAAK;GAC1C,MAAM,MAAM,IAAI,QAAQ,MAAM,QAAQ,CAAC;GACvC,QAAQ,QAAQ,KAAK,IAAI,SAAS,MAAM;GACxC;EACF;EACA,IAAI,SAAS,KAAK;GAChB,IAAI,UAAU,GAAG,SAAS;GAC1B;EACF,OAAO,IAAI,SAAS,KAAK;GACvB;GACA,IAAI,UAAU,GAAG;IACf,OAAO,KAAK;KACV,SAAS,gBAAgB,IAAI,MAAM,OAAO,MAAM,CAAC;KACjD,MAAM,IAAI,MAAM,OAAO,QAAQ,CAAC;IAClC,CAAC;IACD,QAAQ,QAAQ;GAClB;EACF,OAAO,IAAI,SAAS,OAAO,UAAU,GAAG;GACtC,MAAM,OAAO,IAAI,MAAM,OAAO,QAAQ,CAAC;GACvC,OAAO,KAAK;IAAE,SAAS,gBAAgB,IAAI;IAAG;GAAK,CAAC;GAC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M,WAAW,MAAc,UAAkC;CAC/D,MAAM,QAAQ,MAAM;CACpB,MAAM,SAAS,MAAM,MAAM,OAAO,KAAK;CACvC,cAAc,MAAM,KAAK;CACzB,OAAO;AACT;AAEA,MAAa,UAAqC,UAA6C;CAC7F,MAAM,uBAAO,IAAI,IAAY;CAC7B,KAAK,MAAM,QAAQ,OAAO;EACxB,IAAI,KAAK,IAAI,IAAI,GACf,MAAM,IAAI,gBAAgB;GACxB,QAAQ;GACR,MAAM;GACN,UAAU;GACV,SAAS,wBAAwB,KAAK;EACxC,CAAC;EAEH,KAAK,IAAI,IAAI;CACf;CACA,OAAO,OAAO,OAAO;EACnB,OAAO,OAAO,OAAO,CAAC,GAAG,KAAK,CAAC;EAC/B,SAAS,KAAK,EAAE,WAAW,OAAO,OAAO,CAAC,UAAU,MAAM,KAAK,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC;EAC3E,IAAI;EACJ,QAAQ,SACN,OAAO,OAAO;GAAE,OAAO;GAAM,QAAQ,UAAsB,MAAM,MAAM,OAAO,MAAM,CAAC;EAAE,CAAC;CAC5F,CAAC;AACH;;;;;;;;;AAUA,MAAa,WAAW,OAAO;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAa,SAAS;CAAE;CAAQ;AAAS"}
1
+ {"version":3,"file":"layers-keV38soP.mjs","names":[],"sources":["../src/cssBlocks.ts","../src/layers.ts"],"sourcesContent":["/**\n * The top-level blocks of compiled CSS text, and which cascade layer each is\n * in. `Layers.in` reads them to leave an already-layered block where it is,\n * and `Style.stylesheet` to refuse a rule outside the declared order. The\n * text is the compiler's own output or a `Style.global` chunk, so a scanner\n * that respects strings, comments, and brace depth is enough; it is not a\n * CSS parser.\n */\nexport interface Block {\n /** What precedes the body, comments removed: `@layer app`, `.x:hover`, or a whole `@layer a, b;`. */\n readonly prelude: string\n /** The block's full text, as it appeared. */\n readonly text: string\n}\n\nconst withoutComments = (text: string): string => text.replace(/\\/\\*[\\s\\S]*?\\*\\//g, '').trim()\n\n/** Index just past the string starting at `start`, which holds its quote. */\nconst endOfString = (css: string, start: number): number => {\n const quote = css[start]\n let index = start + 1\n while (index < css.length && css[index] !== quote) index += css[index] === '\\\\' ? 2 : 1\n return index + 1\n}\n\nexport const topLevelBlocks = (css: string): ReadonlyArray<Block> => {\n const blocks: Array<Block> = []\n let start = 0\n let depth = 0\n let bodyAt = -1\n let index = 0\n while (index < css.length) {\n const char = css[index]\n if (char === '\"' || char === \"'\") {\n index = endOfString(css, index)\n continue\n }\n if (char === '/' && css[index + 1] === '*') {\n const end = css.indexOf('*/', index + 2)\n index = end === -1 ? css.length : end + 2\n continue\n }\n if (char === '{') {\n if (depth === 0) bodyAt = index\n depth++\n } else if (char === '}') {\n depth--\n if (depth === 0) {\n blocks.push({\n prelude: withoutComments(css.slice(start, bodyAt)),\n text: css.slice(start, index + 1),\n })\n start = index + 1\n }\n } else if (char === ';' && depth === 0) {\n const text = css.slice(start, index + 1)\n blocks.push({ prelude: withoutComments(text), text })\n start = index + 1\n }\n index++\n }\n const rest = css.slice(start)\n if (withoutComments(rest) !== '') blocks.push({ prelude: withoutComments(rest), text: rest })\n return blocks\n}\n\n/** `@layer a, b, c;`: an order statement, not a layered rule. */\nexport const isLayerStatement = (block: Block): boolean => /^@layer\\s[^{}]*;$/.test(block.prelude)\n\n/** The layer a `@layer name{…}` block is in; undefined for any other block. */\nexport const layerOf = (block: Block): string | undefined =>\n /^@layer\\s+([^\\s{},;]+)$/.exec(block.prelude)?.[1]\n\n/** Blocks the cascade does not order: the layer statement, keyframes, font faces, registered properties. */\nexport const isUnordered = (block: Block): boolean =>\n isLayerStatement(block) ||\n /^@(?:-webkit-)?keyframes\\s|^@font-face\\b|^@property\\s/.test(block.prelude)\n\n/** The names a `@layer a, b, c;` statement declares. */\nexport const declaredNames = (statement: string): ReadonlyArray<string> =>\n statement\n .replace(/^@layer\\s+/, '')\n .replace(/;$/, '')\n .split(',')\n .map(name => name.trim())\n","/**\n * Cascade layers as a value. `define` names an order; the result declares\n * it (`declare`) and places a piece in one of its layers (`in`), typed to\n * those names so a misspelled layer is a type error. `standard` is the\n * order a design system built on the `/theme`, `/layout`, `/defaults`, and\n * `/prose` subpaths expects; the pieces those ship are unlayered until a\n * page wraps them, so a different order needs no different generators.\n */\nimport { isLayerStatement, layerOf, topLevelBlocks } from './cssBlocks.js'\nimport { DiagnosticError } from './diagnostics.js'\nimport type { SlotItem } from './slotItem.js'\nimport type { StyleRule } from './styleRules.js'\nimport { make, type StyleValue } from './styleValue.js'\n\n/**\n * One layer of one order, for `Style.forSlots(S)(pieces, { layer })`: every\n * piece is placed before it is compiled, so the style a view attaches and the\n * style a sheet ships are the same value with the same classes. A piece\n * already in another layer keeps it and is not refused, because a slot piece\n * that is only a layered layout or recipe is ordinary.\n */\nexport interface Placement<Name extends string = string> {\n readonly layer: Name\n readonly place: (piece: StyleValue) => StyleValue\n}\n\nexport interface Layers<Name extends string> {\n readonly names: ReadonlyArray<Name>\n /** The `@layer a, b, c;` statement as a global piece; `Style.stylesheet` hoists it first. */\n readonly declare: StyleValue\n /**\n * The piece's unlayered rules and global CSS emitted inside `@layer name`,\n * including rules under `whenInput` and per-item pieces. A rule or block\n * already in a layer keeps it, so a design system's layered layout composed\n * into an application style stays in `layouts`. A piece with nothing\n * unlayered but something in another layer is refused with\n * `style:relayered`, since the call would move nothing. A slot style is\n * layered where it is defined, with `layer`, not here: placing a finished\n * style would copy it under new classes that no view attaches.\n */\n readonly in: (name: Name, piece: StyleValue) => StyleValue\n /** The placement `Style.forSlots` takes as its `layer` option. */\n readonly layer: (name: Name) => Placement<Name>\n}\n\n/** What one `in` call placed, and which other layers it left in place. */\ninterface Tally {\n placed: number\n readonly kept: Set<string>\n}\n\nconst tally = (): Tally => ({ placed: 0, kept: new Set() })\n\nconst placeRule = (name: string, rule: StyleRule, count: Tally): StyleRule => {\n if (rule.layer !== undefined && rule.layer !== name) {\n count.kept.add(rule.layer)\n return rule\n }\n count.placed++\n return rule.layer === name ? rule : { ...rule, layer: name }\n}\n\n/** Runs of unlayered blocks go into one `@layer name{…}`; layered blocks and statements stay. */\nconst placeGlobal = (name: string, css: string, count: Tally): string => {\n const out: Array<string> = []\n let pending = ''\n const flush = (): void => {\n if (pending !== '') out.push(`@layer ${name}{${pending}}`)\n pending = ''\n }\n for (const block of topLevelBlocks(css)) {\n const layer = layerOf(block)\n if (isLayerStatement(block)) {\n flush()\n out.push(block.text)\n } else if (layer === undefined) {\n pending += block.text\n count.placed++\n } else {\n flush()\n out.push(block.text)\n if (layer === name) count.placed++\n else count.kept.add(layer)\n }\n }\n flush()\n return out.join('')\n}\n\nconst place = (name: string, piece: StyleValue, count: Tally): StyleValue =>\n Object.freeze({\n ...piece,\n ...(piece.rules === undefined\n ? {}\n : { rules: Object.freeze(piece.rules.map(rule => placeRule(name, rule, count))) }),\n ...(piece.globalCss === undefined\n ? {}\n : { globalCss: Object.freeze(piece.globalCss.map(css => placeGlobal(name, css, count))) }),\n ...(piece.conditions === undefined\n ? {}\n : {\n conditions: Object.freeze(\n piece.conditions.map(condition => ({\n predicate: condition.predicate,\n piece: place(name, condition.piece, count),\n })),\n ),\n }),\n ...(piece.items === undefined\n ? {}\n : {\n // Rendered per item, after `in` returned: nothing to refuse by then.\n items: Object.freeze(\n piece.items.map(\n render => (item: SlotItem | undefined) => place(name, render(item), tally()),\n ),\n ),\n }),\n })\n\nconst refuseRelayer = (name: string, count: Tally): void => {\n if (count.placed > 0 || count.kept.size === 0) return\n const layers = [...count.kept]\n throw new DiagnosticError({\n source: 'style',\n code: 'style:relayered',\n severity: 'error',\n message: `Layers.in(\"${name}\", …) was given a piece already in layer ${layers.map(layer => `\"${layer}\"`).join(', ')}; a layered rule keeps its layer, so nothing would move. Place the unlayered piece instead.`,\n details: { layer: name, kept: layers },\n })\n}\n\nconst placeIn = (name: string, piece: StyleValue): StyleValue => {\n const count = tally()\n const placed = place(name, piece, count)\n refuseRelayer(name, count)\n return placed\n}\n\nexport const define = <const Name extends string>(names: ReadonlyArray<Name>): Layers<Name> => {\n const seen = new Set<string>()\n for (const name of names) {\n if (seen.has(name)) {\n throw new DiagnosticError({\n source: 'style',\n code: 'style:duplicate-layer',\n severity: 'error',\n message: `Layers.define names \"${name}\" twice`,\n })\n }\n seen.add(name)\n }\n return Object.freeze({\n names: Object.freeze([...names]),\n declare: make({ globalCss: Object.freeze([`@layer ${names.join(', ')};`]) }),\n in: placeIn,\n layer: (name: Name): Placement<Name> =>\n Object.freeze({ layer: name, place: (piece: StyleValue) => place(name, piece, tally()) }),\n })\n}\n\n/**\n * The shipped order. `reset` normalizes; `tokens` holds the scales that do\n * not change per theme; `theme` the knobs and what derives from them, plus\n * scoped overrides; `defaults` element defaults; then a design system's\n * `components`, `layouts` (after components, so a wrapper never beats a\n * component's inner rule), a recipe's `variants`, `utilities`, and the\n * application's `app`, always last.\n */\nexport const standard = define([\n 'reset',\n 'tokens',\n 'theme',\n 'defaults',\n 'components',\n 'layouts',\n 'variants',\n 'utilities',\n 'app',\n])\n\nexport const Layers = { define, standard } as const\n"],"mappings":";;AAeA,MAAM,mBAAmB,SAAyB,KAAK,QAAQ,qBAAqB,EAAE,CAAC,CAAC,KAAK;;AAG7F,MAAM,eAAe,KAAa,UAA0B;CAC1D,MAAM,QAAQ,IAAI;CAClB,IAAI,QAAQ,QAAQ;CACpB,OAAO,QAAQ,IAAI,UAAU,IAAI,WAAW,OAAO,SAAS,IAAI,WAAW,OAAO,IAAI;CACtF,OAAO,QAAQ;AACjB;AAEA,MAAa,kBAAkB,QAAsC;CACnE,MAAM,SAAuB,CAAC;CAC9B,IAAI,QAAQ;CACZ,IAAI,QAAQ;CACZ,IAAI,SAAS;CACb,IAAI,QAAQ;CACZ,OAAO,QAAQ,IAAI,QAAQ;EACzB,MAAM,OAAO,IAAI;EACjB,IAAI,SAAS,QAAO,SAAS,KAAK;GAChC,QAAQ,YAAY,KAAK,KAAK;GAC9B;EACF;EACA,IAAI,SAAS,OA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F,CAAC;AACH;;;;;;;;;AAUA,MAAa,WAAW,OAAO;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAa,SAAS;CAAE;CAAQ;AAAS"}
package/dist/layers.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { n as define, r as standard, t as Layers } from "./layers-B31M0tDi.mjs";
1
+ import { n as define, r as standard, t as Layers } from "./layers-keV38soP.mjs";
2
2
  export { Layers, define, standard };
package/dist/layout.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { C as className, _ as self, a as container, h as pseudo, i as compose, m as nest, o as empty, p as media, x as vars } from "./styleValue-_G9jwb17.mjs";
1
+ import { C as className, _ as self, a as container, h as pseudo, i as compose, m as nest, o as empty, p as media, x as vars } from "./styleValue-Cj4YjgVB.mjs";
2
2
  //#region src/layout.ts
3
3
  /**
4
4
  * `foldkit-mixins/layout`: layout pieces (stack, cluster, sidebar, …) as
@@ -1 +1 @@
1
- {"version":3,"file":"oklch-FOemcYSv.d.mts","names":[],"sources":["../src/theme/oklch.ts"],"mappings":";UAUiB;;WAEN;aACE;aACA;aACA;;aAEA;eAAkB;eAAqB;;;;WAGzC;WACA;;WAEA;;WAEA;;WAEA;;WAEA;aACE;aACA;aACA;aACA;;;cA2EA,QAAS,OAAO,eAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmF3B,aAAa,kBAAkB"}
1
+ {"version":3,"file":"oklch-FOemcYSv.d.mts","names":[],"sources":["../src/theme/oklch.ts"],"mappings":";UAUiB;;WAEN;aACE;aACA;aACA;;aAEA;eAAkB;eAAqB;;;;WAGzC;WACA;;WAEA;;WAEA;;WAEA;;WAEA;aACE;aACA;aACA;aACA;;;cA2EA,QAAS,OAAO,eAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwF3B,aAAa,kBAAkB"}
package/dist/prose.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as self, i as compose, m as nest, u as inline } from "./styleValue-_G9jwb17.mjs";
1
+ import { _ as self, i as compose, m as nest, u as inline } from "./styleValue-Cj4YjgVB.mjs";
2
2
  //#region src/prose.ts
3
3
  /**
4
4
  * `foldkit-mixins/prose`: the longform-content contract. One class carries
@@ -1,5 +1,5 @@
1
- import { c as global } from "./styleValue-_G9jwb17.mjs";
2
- import { n as VAR_PREFIX } from "./core-Bxj0UQDF.mjs";
1
+ import { c as global } from "./styleValue-Cj4YjgVB.mjs";
2
+ import { n as VAR_PREFIX } from "./core-IMVYU8JN.mjs";
3
3
  //#region src/theme/root.ts
4
4
  /**
5
5
  * A theme's tokens as `:root` custom properties, for the page stylesheet.
@@ -34,4 +34,4 @@ const scoped = (_theme, selector, overrides) => {
34
34
  //#endregion
35
35
  export { scoped as n, root as t };
36
36
 
37
- //# sourceMappingURL=root-C1u12YMD.mjs.map
37
+ //# sourceMappingURL=root-BBi88KYx.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"root-C1u12YMD.mjs","names":[],"sources":["../src/theme/root.ts"],"sourcesContent":["/**\n * A theme's tokens as `:root` custom properties, for the page stylesheet.\n * Unlayered: the page decides which layer with `Layers.in`.\n */\nimport { global, type StyleValue } from '../styleValue.js'\nimport { VAR_PREFIX, type ThemeTokens } from './core.js'\n\nexport interface RootOptions {\n /** Tokens present in this theme are left out, so a scale shipped in another layer goes out once. */\n readonly omit?: ThemeTokens\n /** Default `'light dark'`, so `lightDark` tokens resolve. */\n readonly colorScheme?: 'light dark' | 'light' | 'dark'\n}\n\n/**\n * Every token as `--fk-group-name:value`, in authored order. `omit` is\n * matched token by token, not group by group: two themes can both carry a\n * `knob` group (the scales' density beside a palette's hues) and only the\n * names `omit` has are skipped.\n */\nconst declarations = (theme: ThemeTokens, omit?: ThemeTokens): ReadonlyArray<string> =>\n Object.entries(theme).flatMap(([group, names]) =>\n Object.entries(names).flatMap(([name, value]) =>\n omit !== undefined && Object.hasOwn(omit[group] ?? {}, name)\n ? []\n : [`${VAR_PREFIX}-${group}-${name}:${value}`],\n ),\n )\n\nexport const root = (theme: ThemeTokens, options?: RootOptions): StyleValue =>\n global(\n `:root{${[...declarations(theme, options?.omit), `color-scheme:${options?.colorScheme ?? 'light dark'}`].join(';')}}`,\n )\n\n/** Some of a theme's tokens, by the theme's own group and token names. */\nexport type Overrides<T extends ThemeTokens> = {\n readonly [G in keyof T]?: { readonly [N in keyof T[G]]?: string }\n}\n\n/**\n * Token overrides under `selector`: a named theme the Model selects with a\n * root attribute (`:root[data-theme=\"ocean\"]`), a scheme the user chose\n * (`:root[data-color-scheme=\"dark\"]`), or a subtree (`.marketing`). Which\n * one is active is the Model's fact; this only says what it means.\n *\n * `theme` is the theme being overridden and is read only for its type, so a\n * group or token it lacks is a type error rather than a variable nothing reads.\n */\nexport const scoped = <T extends ThemeTokens>(\n _theme: T,\n selector: string,\n overrides: Overrides<T>,\n): StyleValue => {\n const tokens: Record<string, Record<string, string>> = {}\n for (const [group, names] of Object.entries(overrides)) {\n const defined: Record<string, string> = {}\n for (const [name, value] of Object.entries(names ?? {})) {\n if (typeof value === 'string') defined[name] = value\n }\n tokens[group] = defined\n }\n return global(`${selector}{${declarations(tokens).join(';')}}`)\n}\n"],"mappings":";;;;;;;;;;;;;AAoBA,MAAM,gBAAgB,OAAoB,SACxC,OAAO,QAAQ,KAAK,CAAC,CAAC,SAAS,CAAC,OAAO,WACrC,OAAO,QAAQ,KAAK,CAAC,CAAC,SAAS,CAAC,MAAM,WACpC,SAAS,KAAA,KAAa,OAAO,OAAO,KAAK,UAAU,CAAC,GAAG,IAAI,IACvD,CAAC,IACD,CAAC,GAAG,WAAW,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,CAChD,CACF;AAEF,MAAa,QAAQ,OAAoB,YACvC,OACE,SAAS,CAAC,GAAG,aAAa,OAAO,SAAS,IAAI,GAAG,gBAAgB,SAAS,eAAe,cAAc,CAAC,CAAC,KAAK,GAAG,EAAE,EACrH;;;;;;;;;;AAgBF,MAAa,UACX,QACA,UACA,cACe;CACf,MAAM,SAAiD,CAAC;CACxD,KAAK,MAAM,CAAC,OAAO,UAAU,OAAO,QAAQ,SAAS,GAAG;EACtD,MAAM,UAAkC,CAAC;EACzC,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,SAAS,CAAC,CAAC,GACpD,IAAI,OAAO,UAAU,UAAU,QAAQ,QAAQ;EAEjD,OAAO,SAAS;CAClB;CACA,OAAO,OAAO,GAAG,SAAS,GAAG,aAAa,MAAM,CAAC,CAAC,KAAK,GAAG,EAAE,EAAE;AAChE"}
1
+ {"version":3,"file":"root-BBi88KYx.mjs","names":[],"sources":["../src/theme/root.ts"],"sourcesContent":["/**\n * A theme's tokens as `:root` custom properties, for the page stylesheet.\n * Unlayered: the page decides which layer with `Layers.in`.\n */\nimport { global, type StyleValue } from '../styleValue.js'\nimport { VAR_PREFIX, type ThemeTokens } from './core.js'\n\nexport interface RootOptions {\n /** Tokens present in this theme are left out, so a scale shipped in another layer goes out once. */\n readonly omit?: ThemeTokens\n /** Default `'light dark'`, so `lightDark` tokens resolve. */\n readonly colorScheme?: 'light dark' | 'light' | 'dark'\n}\n\n/**\n * Every token as `--fk-group-name:value`, in authored order. `omit` is\n * matched token by token, not group by group: two themes can both carry a\n * `knob` group (the scales' density beside a palette's hues) and only the\n * names `omit` has are skipped.\n */\nconst declarations = (theme: ThemeTokens, omit?: ThemeTokens): ReadonlyArray<string> =>\n Object.entries(theme).flatMap(([group, names]) =>\n Object.entries(names).flatMap(([name, value]) =>\n omit !== undefined && Object.hasOwn(omit[group] ?? {}, name)\n ? []\n : [`${VAR_PREFIX}-${group}-${name}:${value}`],\n ),\n )\n\nexport const root = (theme: ThemeTokens, options?: RootOptions): StyleValue =>\n global(\n `:root{${[...declarations(theme, options?.omit), `color-scheme:${options?.colorScheme ?? 'light dark'}`].join(';')}}`,\n )\n\n/** Some of a theme's tokens, by the theme's own group and token names. */\nexport type Overrides<T extends ThemeTokens> = {\n readonly [G in keyof T]?: { readonly [N in keyof T[G]]?: string }\n}\n\n/**\n * Token overrides under `selector`: a named theme the Model selects with a\n * root attribute (`:root[data-theme=\"ocean\"]`), a scheme the user chose\n * (`:root[data-color-scheme=\"dark\"]`), or a subtree (`.marketing`). Which\n * one is active is the Model's fact; this only says what it means.\n *\n * `theme` is the theme being overridden and is read only for its type, so a\n * group or token it lacks is a type error rather than a variable nothing reads.\n */\nexport const scoped = <T extends ThemeTokens>(\n _theme: T,\n selector: string,\n overrides: Overrides<T>,\n): StyleValue => {\n const tokens: Record<string, Record<string, string>> = {}\n for (const [group, names] of Object.entries(overrides)) {\n const defined: Record<string, string> = {}\n for (const [name, value] of Object.entries(names ?? {})) {\n if (typeof value === 'string') defined[name] = value\n }\n tokens[group] = defined\n }\n return global(`${selector}{${declarations(tokens).join(';')}}`)\n}\n"],"mappings":";;;;;;;;;;;;;AAoBA,MAAM,gBAAgB,OAAoB,SACxC,OAAO,QAAQ,KAAK,CAAC,CAAC,SAAS,CAAC,OAAO,WACrC,OAAO,QAAQ,KAAK,CAAC,CAAC,SAAS,CAAC,MAAM,WACpC,SAAS,KAAA,KAAa,OAAO,OAAO,KAAK,UAAU,CAAC,GAAG,IAAI,IACvD,CAAC,IACD,CAAC,GAAG,WAAW,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,CAChD,CACF;AAEF,MAAa,QAAQ,OAAoB,YACvC,OACE,SAAS,CAAC,GAAG,aAAa,OAAO,SAAS,IAAI,GAAG,gBAAgB,SAAS,eAAe,cAAc,CAAC,CAAC,KAAK,GAAG,EAAE,EACrH;;;;;;;;;;AAgBF,MAAa,UACX,QACA,UACA,cACe;CACf,MAAM,SAAiD,CAAC;CACxD,KAAK,MAAM,CAAC,OAAO,UAAU,OAAO,QAAQ,SAAS,GAAG;EACtD,MAAM,UAAkC,CAAC;EACzC,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,SAAS,CAAC,CAAC,GACpD,IAAI,OAAO,UAAU,UAAU,QAAQ,QAAQ;EAEjD,OAAO,SAAS;CAClB;CACA,OAAO,OAAO,GAAG,SAAS,GAAG,aAAa,MAAM,CAAC,CAAC,KAAK,GAAG,EAAE,EAAE;AAChE"}
@@ -1,4 +1,4 @@
1
- import { r as standard } from "./layers-B31M0tDi.mjs";
1
+ import { r as standard } from "./layers-keV38soP.mjs";
2
2
  //#region src/inject.ts
3
3
  /**
4
4
  * Styles that arrive with what uses them. Compiling a Style registers each
@@ -132,4 +132,4 @@ const drawMarked = (draw) => {
132
132
  //#endregion
133
133
  export { register as a, ensure as i, drawMarked as n, usedIn as o, isMarking as r, SLOT_MARK as t };
134
134
 
135
- //# sourceMappingURL=slotMark-Rdsjb7XI.mjs.map
135
+ //# sourceMappingURL=slotMark-DK75y0GJ.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"slotMark-Rdsjb7XI.mjs","names":[],"sources":["../src/inject.ts","../src/slotMark.ts"],"sourcesContent":["/**\n * Styles that arrive with what uses them. Compiling a Style registers each\n * class it produces with that class's CSS; the name is a hash of the CSS, so\n * the registry is the same on the server and in the browser, and holds no DOM.\n *\n * When a Slot draws a class in a browser, the CSS is queued, and one microtask\n * later (after the patch, before the browser paints) appended to a single\n * `<style data-foldkit-styles>` element, unless a stylesheet on the page\n * already carries the class: a static sheet and injection never repeat each\n * other.\n *\n * The registry holds every class compiled in the process and never lets one\n * go, which is bounded by the code when Styles are defined once, as they are\n * meant to be. A Style compiled during a render from data (a width from the\n * Model) would register a class per value; such a value belongs in an inline\n * custom property read by a rule instead.\n */\nimport { standard } from './layers.js'\n\nconst registry = new Map<string, string>()\n\n/** Records the CSS a compiled class stands for. Called by the compiler. */\nexport const register = (className: string, css: string): void => {\n if (!registry.has(className)) registry.set(className, css)\n}\n\n/** A compiled class in CSS text: `.style-` and its hash. */\nconst COMPILED_CLASS = /\\.(style-[0-9a-z]+)/g\n\n/** An `@layer` order statement, as opposed to a layer block. */\nconst LAYER_STATEMENT = /@layer [^{};]+;/g\n\n/** The standard layer order, as one `@layer` statement. */\nconst layerOrder = (): string => standard.declare.globalCss?.join('') ?? ''\n\n/**\n * The CSS for every compiled class that `html` carries, after the standard\n * layer order: what a server puts in a page's head, so it is styled before\n * any script runs. The browser's injection then finds these classes present\n * and adds nothing twice.\n */\nexport const usedIn = (html: string): string => {\n const found = new Set<string>()\n for (const [className] of html.matchAll(/style-[0-9a-z]+/g)) {\n if (registry.has(className)) found.add(className)\n }\n return [layerOrder(), ...[...found].map(className => registry.get(className) ?? '')].join('')\n}\n\n/** What the page carries: counted from its sheets once, then kept as CSS is queued. */\ninterface Page {\n readonly present: Set<string>\n readonly globals: Set<string>\n /** Contributions already handled whole: a Style's are the same object every render. */\n readonly handled: WeakSet<object>\n /** Whether a sheet on the page declares a layer order, so this one need not. */\n readonly ordered: boolean\n /** The sheets counted, so a removed one means counting again. */\n readonly counted: ReadonlyArray<HTMLStyleElement>\n element: HTMLStyleElement | undefined\n}\n\nlet page: Page | undefined\nlet pending: Array<string> = []\nlet scheduled = false\n\n/**\n * The page as injection knows it, counted afresh when a sheet it counted or its\n * own element has been removed (by a test's cleanup, or an application\n * replacing the head).\n */\nconst current = (): Page => {\n if (\n page !== undefined &&\n (page.element === undefined || page.element.isConnected) &&\n page.counted.every(sheet => sheet.isConnected)\n )\n return page\n const present = new Set<string>()\n let ordered = false\n const counted = Array.from(document.querySelectorAll('style'))\n for (const sheet of counted) {\n const text = sheet.textContent ?? ''\n for (const [, className] of text.matchAll(COMPILED_CLASS))\n if (className !== undefined) present.add(className)\n if (text.match(LAYER_STATEMENT) !== null) ordered = true\n }\n page = {\n present,\n globals: new Set(),\n handled: new WeakSet(),\n ordered,\n counted,\n element: undefined,\n }\n return page\n}\n\nconst flush = (): void => {\n scheduled = false\n if (pending.length === 0) return\n const into = current()\n if (into.element === undefined) {\n const element = document.createElement('style')\n element.setAttribute('data-foldkit-styles', '')\n // Without an order on the page, the standard one first, so rules inserted\n // in any order still cascade by layer; an application's own order is left alone.\n element.textContent = into.ordered ? '' : layerOrder()\n document.head.appendChild(element)\n into.element = element\n }\n into.element.appendChild(document.createTextNode(pending.join('')))\n pending = []\n}\n\n/**\n * Queues the CSS of each registered class a contribution draws that the page\n * does not carry yet, and its global CSS (keyframes, a theme root) once.\n * Outside a browser it does nothing: a server extracts what it rendered instead.\n */\nexport const ensure = (contribution: {\n readonly classes?: ReadonlyArray<string>\n readonly globalCss?: string\n}): void => {\n if (typeof document === 'undefined') return\n const into = current()\n if (into.handled.has(contribution)) return\n for (const className of contribution.classes ?? []) {\n if (into.present.has(className)) continue\n const css = registry.get(className)\n if (css === undefined) continue\n into.present.add(className)\n pending.push(css)\n }\n const globalCss = contribution.globalCss\n // A layer order is the page's to declare, so a Style's own is not repeated.\n if (globalCss !== undefined && globalCss !== '' && !into.globals.has(globalCss)) {\n into.globals.add(globalCss)\n pending.push(globalCss.replace(LAYER_STATEMENT, ''))\n }\n // Frozen, a contribution cannot draw other classes next time it is drawn.\n if (Object.isFrozen(contribution)) into.handled.add(contribution)\n if (pending.length > 0 && !scheduled) {\n scheduled = true\n queueMicrotask(flush)\n }\n}\n","/**\n * Marking the elements Slots draw with the Slot's name, for\n * `foldkit-mixins/testing`'s `Inert.draw`. Internal: the package index does not\n * export it, and a view drawn for real is never marked.\n */\n\n/** The data attribute a marked element carries: `data-fk-slot=\"row\"`. */\nexport const SLOT_MARK = 'fk-slot'\n\nlet marking = false\n\n/** Whether Slots mark what they draw: only while `drawMarked` runs. */\nexport const isMarking = (): boolean => marking\n\n/** Draws with every Slot, however deeply nested its view, marking its element. */\nexport const drawMarked = <A>(draw: () => A): A => {\n marking = true\n try {\n return draw()\n } finally {\n marking = false\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,MAAM,2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Mark-DK75y0GJ.mjs","names":[],"sources":["../src/inject.ts","../src/slotMark.ts"],"sourcesContent":["/**\n * Styles that arrive with what uses them. Compiling a Style registers each\n * class it produces with that class's CSS; the name is a hash of the CSS, so\n * the registry is the same on the server and in the browser, and holds no DOM.\n *\n * When a Slot draws a class in a browser, the CSS is queued, and one microtask\n * later (after the patch, before the browser paints) appended to a single\n * `<style data-foldkit-styles>` element, unless a stylesheet on the page\n * already carries the class: a static sheet and injection never repeat each\n * other.\n *\n * The registry holds every class compiled in the process and never lets one\n * go, which is bounded by the code when Styles are defined once, as they are\n * meant to be. A Style compiled during a render from data (a width from the\n * Model) would register a class per value; such a value belongs in an inline\n * custom property read by a rule instead.\n */\nimport { standard } from './layers.js'\n\nconst registry = new Map<string, string>()\n\n/** Records the CSS a compiled class stands for. Called by the compiler. */\nexport const register = (className: string, css: string): void => {\n if (!registry.has(className)) registry.set(className, css)\n}\n\n/** A compiled class in CSS text: `.style-` and its hash. */\nconst COMPILED_CLASS = /\\.(style-[0-9a-z]+)/g\n\n/** An `@layer` order statement, as opposed to a layer block. */\nconst LAYER_STATEMENT = /@layer [^{};]+;/g\n\n/** The standard layer order, as one `@layer` statement. */\nconst layerOrder = (): string => standard.declare.globalCss?.join('') ?? ''\n\n/**\n * The CSS for every compiled class that `html` carries, after the standard\n * layer order: what a server puts in a page's head, so it is styled before\n * any script runs. The browser's injection then finds these classes present\n * and adds nothing twice.\n */\nexport const usedIn = (html: string): string => {\n const found = new Set<string>()\n for (const [className] of html.matchAll(/style-[0-9a-z]+/g)) {\n if (registry.has(className)) found.add(className)\n }\n return [layerOrder(), ...[...found].map(className => registry.get(className) ?? '')].join('')\n}\n\n/** What the page carries: counted from its sheets once, then kept as CSS is queued. */\ninterface Page {\n readonly present: Set<string>\n readonly globals: Set<string>\n /** Contributions already handled whole: a Style's are the same object every render. */\n readonly handled: WeakSet<object>\n /** Whether a sheet on the page declares a layer order, so this one need not. */\n readonly ordered: boolean\n /** The sheets counted, so a removed one means counting again. */\n readonly counted: ReadonlyArray<HTMLStyleElement>\n element: HTMLStyleElement | undefined\n}\n\nlet page: Page | undefined\nlet pending: Array<string> = []\nlet scheduled = false\n\n/**\n * The page as injection knows it, counted afresh when a sheet it counted or its\n * own element has been removed (by a test's cleanup, or an application\n * replacing the head).\n */\nconst current = (): Page => {\n if (\n page !== undefined &&\n (page.element === undefined || page.element.isConnected) &&\n page.counted.every(sheet => sheet.isConnected)\n )\n return page\n const present = new Set<string>()\n let ordered = false\n const counted = Array.from(document.querySelectorAll('style'))\n for (const sheet of counted) {\n const text = sheet.textContent ?? ''\n for (const [, className] of text.matchAll(COMPILED_CLASS))\n if (className !== undefined) present.add(className)\n if (text.match(LAYER_STATEMENT) !== null) ordered = true\n }\n page = {\n present,\n globals: new Set(),\n handled: new WeakSet(),\n ordered,\n counted,\n element: undefined,\n }\n return page\n}\n\nconst flush = (): void => {\n scheduled = false\n if (pending.length === 0) return\n const into = current()\n if (into.element === undefined) {\n const element = document.createElement('style')\n element.setAttribute('data-foldkit-styles', '')\n // Without an order on the page, the standard one first, so rules inserted\n // in any order still cascade by layer; an application's own order is left alone.\n element.textContent = into.ordered ? '' : layerOrder()\n document.head.appendChild(element)\n into.element = element\n }\n into.element.appendChild(document.createTextNode(pending.join('')))\n pending = []\n}\n\n/**\n * Queues the CSS of each registered class a contribution draws that the page\n * does not carry yet, and its global CSS (keyframes, a theme root) once.\n * Outside a browser it does nothing: a server extracts what it rendered instead.\n */\nexport const ensure = (contribution: {\n readonly classes?: ReadonlyArray<string>\n readonly globalCss?: string\n}): void => {\n if (typeof document === 'undefined') return\n const into = current()\n if (into.handled.has(contribution)) return\n for (const className of contribution.classes ?? []) {\n if (into.present.has(className)) continue\n const css = registry.get(className)\n if (css === undefined) continue\n into.present.add(className)\n pending.push(css)\n }\n const globalCss = contribution.globalCss\n // A layer order is the page's to declare, so a Style's own is not repeated.\n if (globalCss !== undefined && globalCss !== '' && !into.globals.has(globalCss)) {\n into.globals.add(globalCss)\n pending.push(globalCss.replace(LAYER_STATEMENT, ''))\n }\n // Frozen, a contribution cannot draw other classes next time it is drawn.\n if (Object.isFrozen(contribution)) into.handled.add(contribution)\n if (pending.length > 0 && !scheduled) {\n scheduled = true\n queueMicrotask(flush)\n }\n}\n","/**\n * Marking the elements Slots draw with the Slot's name, for\n * `foldkit-mixins/testing`'s `Inert.draw`. Internal: the package index does not\n * export it, and a view drawn for real is never marked.\n */\n\n/** The data attribute a marked element carries: `data-fk-slot=\"row\"`. */\nexport const SLOT_MARK = 'fk-slot'\n\nlet marking = false\n\n/** Whether Slots mark what they draw: only while `drawMarked` runs. */\nexport const isMarking = (): boolean => marking\n\n/** Draws with every Slot, however deeply nested its view, marking its element. */\nexport const drawMarked = <A>(draw: () => A): A => {\n marking = true\n try {\n return draw()\n } finally {\n marking = false\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,MAAM,2BAAW,IAAI,IAAoB;;AAGzC,MAAa,YAAY,WAAmB,QAAsB;CAChE,IAAI,CAAC,SAAS,IAAI,SAAS,GAAG,SAAS,IAAI,WAAW,GAAG;AAC3D;;AAGA,MAAM,iBAAiB;;AAGvB,MAAM,kBAAkB;;AAGxB,MAAM,mBAA2B,SAAS,QAAQ,WAAW,KAAK,EAAE,KAAK;;;;;;;AAQzE,MAAa,UAAU,SAAyB;CAC9C,MAAM,wBAAQ,IAAI,IAAY;CAC9B,KAAK,MAAM,CAAC,cAAc,KAAK,SAAS,kBAAkB,GACxD,IAAI,SAAS,IAAI,SAAS,GAAG,MAAM,IAAI,SAAS;CAElD,OAAO,CAAC,WAAW,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,KAAI,cAAa,SAAS,IAAI,SAAS,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE;AAC9F;AAeA,IAAI;AACJ,IAAI,UAAyB,CAAC;AAC9B,IAAI,YAAY;;;;;;AAOhB,MAAM,gBAAsB;CAC1B,IACE,SAAS,KAAA,MACR,KAA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C1B,QAAQ,KAAK,GAAG;CAClB;CACA,MAAM,YAAY,aAAa;CAE/B,IAAI,cAAc,KAAA,KAAa,cAAc,MAAM,CAAC,KAAK,QAAQ,IAAI,SAAS,GAAG;EAC/E,KAAK,QAAQ,IAAI,SAAS;EAC1B,QAAQ,KAAK,UAAU,QAAQ,iBAAiB,EAAE,CAAC;CACrD;CAEA,IAAI,OAAO,SAAS,YAAY,GAAG,KAAK,QAAQ,IAAI,YAAY;CAChE,IAAI,QAAQ,SAAS,KAAK,CAAC,WAAW;EACpC,YAAY;EACZ,eAAe,KAAK;CACtB;AACF;;;;;;;;;AC3IA,MAAa,YAAY;AAEzB,IAAI,UAAU;;AAGd,MAAa,kBAA2B;;AAGxC,MAAa,cAAiB,SAAqB;CACjD,UAAU;CACV,IAAI;EACF,OAAO,KAAK;CACd,UAAU;EACR,UAAU;CACZ;AACF"}
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
- import { C as className, S as viewTransitionName, T as DiagnosticError, _ as self, a as container, b as toStyleValue, c as global, d as keyframes, f as make$4, g as responsive, h as pseudo, i as compose$1, l as grid, m as nest, n as at, o as empty$1, p as media, r as classPiece, s as enter, t as allowDiscrete, u as inline, v as states, w as css, x as vars, y as supports } from "./styleValue-_G9jwb17.mjs";
3
- import { a as isUnordered, i as declaredNames, o as layerOf, s as topLevelBlocks } from "./layers-B31M0tDi.mjs";
4
- import { a as register, i as ensure, o as usedIn, r as isMarking, t as SLOT_MARK } from "./slotMark-Rdsjb7XI.mjs";
2
+ import { C as className, S as viewTransitionName, T as DiagnosticError, _ as self, a as container, b as toStyleValue, c as global, d as keyframes, f as make$4, g as responsive, h as pseudo, i as compose$1, l as grid, m as nest, n as at, o as empty$1, p as media, r as classPiece, s as enter, t as allowDiscrete, u as inline, v as states, w as css, x as vars, y as supports } from "./styleValue-Cj4YjgVB.mjs";
3
+ import { a as isUnordered, i as declaredNames, o as layerOf, s as topLevelBlocks } from "./layers-keV38soP.mjs";
4
+ import { a as register, i as ensure, o as usedIn, r as isMarking, t as SLOT_MARK } from "./slotMark-DK75y0GJ.mjs";
5
5
  import { createKeyedLazy, createLazy, inertHtml } from "foldkit/html";
6
6
  import { Stream } from "effect";
7
7
  //#region src/metadataToken.ts
@@ -1263,4 +1263,4 @@ const Style = {
1263
1263
  //#endregion
1264
1264
  export { extendsCapability as _, slots_exports as a, metadataToken_exports as b, slotView_exports as c, mixin_exports as d, isTagged as f, capability_exports as g, Interactive as h, stylesheet as i, resolver_exports as l, Focusable as m, forSlots as n, slot_exports as o, Container as p, slots as r, attach$1 as s, Style as t, dynamic as u, is$2 as v, nameOf as x, make$3 as y };
1265
1265
 
1266
- //# sourceMappingURL=style-CKjLee4e.mjs.map
1266
+ //# sourceMappingURL=style-CmHD4Ul3.mjs.map