@craft-ts/style 0.7.0-beta.15

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 (73) hide show
  1. package/package.json +41 -0
  2. package/src/index.d.ts +18 -0
  3. package/src/index.d.ts.map +1 -0
  4. package/src/index.js +18 -0
  5. package/src/index.js.map +1 -0
  6. package/src/lib/axes/define.d.ts +115 -0
  7. package/src/lib/axes/define.d.ts.map +1 -0
  8. package/src/lib/axes/define.js +81 -0
  9. package/src/lib/axes/define.js.map +1 -0
  10. package/src/lib/axes/index.d.ts +4 -0
  11. package/src/lib/axes/index.d.ts.map +1 -0
  12. package/src/lib/axes/index.js +4 -0
  13. package/src/lib/axes/index.js.map +1 -0
  14. package/src/lib/axes/standard.d.ts +85 -0
  15. package/src/lib/axes/standard.d.ts.map +1 -0
  16. package/src/lib/axes/standard.js +109 -0
  17. package/src/lib/axes/standard.js.map +1 -0
  18. package/src/lib/axes/types.d.ts +67 -0
  19. package/src/lib/axes/types.d.ts.map +1 -0
  20. package/src/lib/axes/types.js +21 -0
  21. package/src/lib/axes/types.js.map +1 -0
  22. package/src/lib/css-vars.d.ts +100 -0
  23. package/src/lib/css-vars.d.ts.map +1 -0
  24. package/src/lib/css-vars.js +96 -0
  25. package/src/lib/css-vars.js.map +1 -0
  26. package/src/lib/kinds.d.ts +84 -0
  27. package/src/lib/kinds.d.ts.map +1 -0
  28. package/src/lib/kinds.js +44 -0
  29. package/src/lib/kinds.js.map +1 -0
  30. package/src/lib/obligations.d.ts +99 -0
  31. package/src/lib/obligations.d.ts.map +1 -0
  32. package/src/lib/obligations.js +69 -0
  33. package/src/lib/obligations.js.map +1 -0
  34. package/src/lib/props/factory.d.ts +61 -0
  35. package/src/lib/props/factory.d.ts.map +1 -0
  36. package/src/lib/props/factory.js +35 -0
  37. package/src/lib/props/factory.js.map +1 -0
  38. package/src/lib/props/generated.d.ts +974 -0
  39. package/src/lib/props/generated.d.ts.map +1 -0
  40. package/src/lib/props/generated.js +2478 -0
  41. package/src/lib/props/generated.js.map +1 -0
  42. package/src/lib/props/index.d.ts +37 -0
  43. package/src/lib/props/index.d.ts.map +1 -0
  44. package/src/lib/props/index.js +27 -0
  45. package/src/lib/props/index.js.map +1 -0
  46. package/src/lib/styles.d.ts +201 -0
  47. package/src/lib/styles.d.ts.map +1 -0
  48. package/src/lib/styles.js +247 -0
  49. package/src/lib/styles.js.map +1 -0
  50. package/src/lib/tokens/index.d.ts +4 -0
  51. package/src/lib/tokens/index.d.ts.map +1 -0
  52. package/src/lib/tokens/index.js +4 -0
  53. package/src/lib/tokens/index.js.map +1 -0
  54. package/src/lib/tokens/palette.d.ts +97 -0
  55. package/src/lib/tokens/palette.d.ts.map +1 -0
  56. package/src/lib/tokens/palette.js +61 -0
  57. package/src/lib/tokens/palette.js.map +1 -0
  58. package/src/lib/tokens/scales.d.ts +47 -0
  59. package/src/lib/tokens/scales.d.ts.map +1 -0
  60. package/src/lib/tokens/scales.js +51 -0
  61. package/src/lib/tokens/scales.js.map +1 -0
  62. package/src/lib/tokens/units.d.ts +114 -0
  63. package/src/lib/tokens/units.d.ts.map +1 -0
  64. package/src/lib/tokens/units.js +54 -0
  65. package/src/lib/tokens/units.js.map +1 -0
  66. package/src/plugin/emit.d.ts +64 -0
  67. package/src/plugin/emit.d.ts.map +1 -0
  68. package/src/plugin/emit.js +134 -0
  69. package/src/plugin/emit.js.map +1 -0
  70. package/src/plugin/vite.d.ts +66 -0
  71. package/src/plugin/vite.d.ts.map +1 -0
  72. package/src/plugin/vite.js +150 -0
  73. package/src/plugin/vite.js.map +1 -0
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@craft-ts/style",
3
+ "version": "0.7.0-beta.15",
4
+ "description": "Typed design tokens, CSS custom properties and build-time style emission for CraftTS",
5
+ "author": "Romain Geffrault",
6
+ "license": "MIT",
7
+ "homepage": "https://craft-ts.github.io/craft/",
8
+ "bugs": {
9
+ "url": "https://github.com/craft-ts/craft-ts/issues"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/craft-ts/craft-ts.git"
14
+ },
15
+ "peerDependencies": {
16
+ "@craft-ts/core": "^0.7.0-beta.0",
17
+ "tslib": "^2.3.0"
18
+ },
19
+ "engines": {
20
+ "node": ">=20.19.0"
21
+ },
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
25
+ "sideEffects": false,
26
+ "type": "module",
27
+ "main": "./src/index.js",
28
+ "types": "./src/index.d.ts",
29
+ "exports": {
30
+ "./package.json": "./package.json",
31
+ ".": {
32
+ "types": "./src/index.d.ts",
33
+ "default": "./src/index.js"
34
+ },
35
+ "./vite": {
36
+ "types": "./src/plugin/vite.d.ts",
37
+ "default": "./src/plugin/vite.js"
38
+ }
39
+ },
40
+ "module": "./src/index.js"
41
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ /**
2
+ * `@craft-ts/style` — the whole style vocabulary.
3
+ *
4
+ * Tokens, kinds, typed custom properties, the generated property table, axes,
5
+ * sheets and context obligations. The core carries two opaque channels for it
6
+ * and interprets neither; every piece of CSS meaning lives here.
7
+ *
8
+ * The build-time emitter is a separate entry point (`@craft-ts/style/vite`) so
9
+ * that importing the vocabulary never drags Node APIs into the browser bundle.
10
+ */
11
+ export * from './lib/tokens/index.ts';
12
+ export * from './lib/kinds.ts';
13
+ export * from './lib/css-vars.ts';
14
+ export * from './lib/props/index.ts';
15
+ export * from './lib/axes/index.ts';
16
+ export * from './lib/obligations.ts';
17
+ export * from './lib/styles.ts';
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../libs/style/src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC"}
package/src/index.js ADDED
@@ -0,0 +1,18 @@
1
+ /**
2
+ * `@craft-ts/style` — the whole style vocabulary.
3
+ *
4
+ * Tokens, kinds, typed custom properties, the generated property table, axes,
5
+ * sheets and context obligations. The core carries two opaque channels for it
6
+ * and interprets neither; every piece of CSS meaning lives here.
7
+ *
8
+ * The build-time emitter is a separate entry point (`@craft-ts/style/vite`) so
9
+ * that importing the vocabulary never drags Node APIs into the browser bundle.
10
+ */
11
+ export * from "./lib/tokens/index.js";
12
+ export * from "./lib/kinds.js";
13
+ export * from "./lib/css-vars.js";
14
+ export * from "./lib/props/index.js";
15
+ export * from "./lib/axes/index.js";
16
+ export * from "./lib/obligations.js";
17
+ export * from "./lib/styles.js";
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/style/src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC","sourcesContent":["/**\n * `@craft-ts/style` — the whole style vocabulary.\n *\n * Tokens, kinds, typed custom properties, the generated property table, axes,\n * sheets and context obligations. The core carries two opaque channels for it\n * and interprets neither; every piece of CSS meaning lives here.\n *\n * The build-time emitter is a separate entry point (`@craft-ts/style/vite`) so\n * that importing the vocabulary never drags Node APIs into the browser bundle.\n */\nexport * from './lib/tokens/index.ts';\nexport * from './lib/kinds.ts';\nexport * from './lib/css-vars.ts';\nexport * from './lib/props/index.ts';\nexport * from './lib/axes/index.ts';\nexport * from './lib/obligations.ts';\nexport * from './lib/styles.ts';\n"]}
@@ -0,0 +1,115 @@
1
+ /**
2
+ * The axes an application defines for itself.
3
+ *
4
+ * Four constructors, and each one closes its set at construction: what comes
5
+ * back is a record of points, so a name that does not exist is a missing
6
+ * property rather than a condition the browser silently drops.
7
+ */
8
+ import type { AnyKind, SyntaxOf } from '../kinds.ts';
9
+ import type { LengthValue } from '../tokens/units.ts';
10
+ import { type AxisPoint, type AnyAxisPoint } from './types.ts';
11
+ /**
12
+ * A point that sits on an ordered axis, and on which side of it.
13
+ *
14
+ * A plain breakpoint is a lower bound: `bp.md` means "from md up". `above` and
15
+ * `below` make the bound explicit so that an empty intersection — a rule no
16
+ * viewport can ever match — is detectable instead of shipped.
17
+ */
18
+ export interface RangePoint<Axis extends string, Point extends string, Bound extends 'above' | 'below' = 'above'> extends AxisPoint<Axis, Point> {
19
+ readonly order: number;
20
+ readonly bound: Bound;
21
+ }
22
+ /**
23
+ * Breakpoints take **built conditions**, never strings:
24
+ * `at.minInlineSize(unit.rem(40))` and not `'(min-width: 40rem)'`.
25
+ *
26
+ * They live under `at` because `minInlineSize` is also a CSS property in the
27
+ * generated table. Same collision as `px` the unit versus `px` the padding
28
+ * helper, settled the same way.
29
+ */
30
+ export declare const at: {
31
+ readonly minInlineSize: (value: LengthValue) => {
32
+ minInlineSize: LengthValue;
33
+ };
34
+ };
35
+ export type BreakpointSpec = {
36
+ readonly minInlineSize: LengthValue;
37
+ };
38
+ export type Breakpoints<Points extends Readonly<Record<string, BreakpointSpec>>> = {
39
+ readonly [Key in keyof Points & string]: RangePoint<'viewport', Key>;
40
+ };
41
+ /**
42
+ * Breakpoints are indexed by declaration order.
43
+ *
44
+ * The order is what lets the matrix reduce by interval — two children cutting
45
+ * at `md` and `lg` produce three viewport cells, not four — and what lets a
46
+ * dead rule be recognised. Declare them ascending; nothing else can infer it.
47
+ */
48
+ export declare function defineBreakpoints<const Points extends Readonly<Record<string, BreakpointSpec>>>(points: Points): Breakpoints<Points>;
49
+ /** From this breakpoint up. The same thing a bare breakpoint already means. */
50
+ export declare const above: <Axis extends string, Point extends string>(point: RangePoint<Axis, Point, "above" | "below">) => RangePoint<Axis, Point, "above">;
51
+ /** Strictly below this breakpoint. */
52
+ export declare const below: <Axis extends string, Point extends string>(point: RangePoint<Axis, Point, "above" | "below">) => RangePoint<Axis, Point, "below">;
53
+ declare const WRITES: unique symbol;
54
+ /**
55
+ * An axis that may only write custom properties of one kind.
56
+ *
57
+ * This is the one reduction the matrix can make without analysing anything: an
58
+ * axis constrained to `<color>` cannot move a box, so it crosses additively
59
+ * with the axes that do. The constraint is checked where it is cheap — at the
60
+ * call site of `when` — rather than by reading the emitted CSS afterwards.
61
+ */
62
+ export interface ConstrainedAxisPoint<Axis extends string, Point extends string, Syntax extends string> extends AxisPoint<Axis, Point> {
63
+ readonly [WRITES]?: Syntax;
64
+ }
65
+ export type WritesSyntaxOf<Point> = typeof WRITES extends keyof Point ? Point extends {
66
+ readonly [WRITES]?: infer Syntax extends string;
67
+ } ? Syntax : never : never;
68
+ /** `defineAxis('theme', [...], { writes: onlyVarsOfKind(kind.color) })`. */
69
+ export declare const onlyVarsOfKind: <Kind extends AnyKind>(kind: Kind) => {
70
+ readonly writes: readonly [SyntaxOf<Kind>];
71
+ };
72
+ export interface AxisOptions<Syntax extends string = never> {
73
+ readonly writes?: readonly [Syntax];
74
+ }
75
+ export type DefinedAxis<Name extends string, Values extends readonly string[], Syntax extends string> = {
76
+ readonly [Value in Values[number]]: [Syntax] extends [never] ? AxisPoint<Name, Value> : ConstrainedAxisPoint<Name, Value, Syntax>;
77
+ };
78
+ /**
79
+ * A generic axis driven by an attribute, with an optional write constraint.
80
+ *
81
+ * `defineStateAxis` is this without the constraint; it stays a separate name
82
+ * because a state axis is the common case and reads better without options.
83
+ */
84
+ export declare function defineAxis<const Name extends string, const Values extends readonly string[], const Syntax extends string = never>(name: Name, values: Values, options?: AxisOptions<Syntax>): DefinedAxis<Name, Values, Syntax>;
85
+ /**
86
+ * A state axis emits `data-{prefix}='{state}'` — something a driver can set and
87
+ * a component can render. An axis whose points nothing can reach has no place
88
+ * in the matrix.
89
+ *
90
+ * The attribute-value form, rather than one attribute per state, is what makes
91
+ * the states mutually exclusive by construction: an element cannot be two of
92
+ * them at once, so the matrix does not have to be told.
93
+ */
94
+ export declare function defineStateAxis<const Prefix extends string, const States extends readonly string[]>(prefix: Prefix, states: States): DefinedAxis<Prefix, States, never>;
95
+ export type ContainerBreakpoints<Name extends string, Points extends Readonly<Record<string, BreakpointSpec>>> = {
96
+ readonly [Key in keyof Points & string]: RangePoint<`container.${Name}`, Key>;
97
+ };
98
+ export interface ContainerSpec {
99
+ readonly name: string;
100
+ readonly type: 'inline-size' | 'size' | 'scroll-state';
101
+ }
102
+ /**
103
+ * A container axis is closed at the element that declares the container.
104
+ *
105
+ * It answers "how wide is my box", which nobody above the container can change,
106
+ * so the axis must not propagate past it — otherwise every ancestor inherits
107
+ * scenarios it has no way to affect. The pruning lives in the matrix; this is
108
+ * where the boundary is named.
109
+ */
110
+ export declare function defineContainer<const Name extends string, const Points extends Readonly<Record<string, BreakpointSpec>>>(container: {
111
+ readonly name: Name;
112
+ readonly type: ContainerSpec['type'];
113
+ }, points: Points): ContainerBreakpoints<Name, Points>;
114
+ export type { AnyAxisPoint };
115
+ //# sourceMappingURL=define.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define.d.ts","sourceRoot":"","sources":["../../../../../../libs/style/src/lib/axes/define.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAa,KAAK,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1E;;;;;;GAMG;AACH,MAAM,WAAW,UAAU,CACzB,IAAI,SAAS,MAAM,EACnB,KAAK,SAAS,MAAM,EACpB,KAAK,SAAS,OAAO,GAAG,OAAO,GAAG,OAAO,CACzC,SAAQ,SA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, never strings:
4
+ * `at.minInlineSize(unit.rem(40))` and not `'(min-width: 40rem)'`.
5
+ *
6
+ * They live under `at` because `minInlineSize` is also a CSS property in the
7
+ * generated table. Same collision as `px` the unit versus `px` the padding
8
+ * helper, settled the same way.
9
+ */
10
+ export const at = {
11
+ minInlineSize: (value) => ({ minInlineSize: value }),
12
+ };
13
+ /**
14
+ * Breakpoints are indexed by declaration order.
15
+ *
16
+ * The order is what lets the matrix reduce by interval — two children cutting
17
+ * at `md` and `lg` produce three viewport cells, not four — and what lets a
18
+ * dead rule be recognised. Declare them ascending; nothing else can infer it.
19
+ */
20
+ export function defineBreakpoints(points) {
21
+ return Object.fromEntries(Object.entries(points).map(([name, { minInlineSize }], index) => [
22
+ name,
23
+ axisPoint('viewport', name, `@media (min-width: ${minInlineSize.css})`, {
24
+ kind: 'resize',
25
+ minInlineSize: minInlineSize.css,
26
+ }, { order: index + 1, bound: 'above' }),
27
+ ]));
28
+ }
29
+ /** From this breakpoint up. The same thing a bare breakpoint already means. */
30
+ export const above = (point) => ({ ...point, bound: 'above' });
31
+ /** Strictly below this breakpoint. */
32
+ export const below = (point) => ({
33
+ ...point,
34
+ bound: 'below',
35
+ open: point.open.replace(/^@media \(min-width: (.*)\)$/, '@media not (min-width: $1)'),
36
+ });
37
+ /** `defineAxis('theme', [...], { writes: onlyVarsOfKind(kind.color) })`. */
38
+ export const onlyVarsOfKind = (kind) => ({ writes: [kind.syntax] });
39
+ /**
40
+ * A generic axis driven by an attribute, with an optional write constraint.
41
+ *
42
+ * `defineStateAxis` is this without the constraint; it stays a separate name
43
+ * because a state axis is the common case and reads better without options.
44
+ */
45
+ export function defineAxis(name, values, options = {}) {
46
+ return Object.fromEntries(values.map((value) => [
47
+ value,
48
+ axisPoint(name, value, `&[data-${name}='${value}']`, { kind: 'setAttribute', name: `data-${name}`, value }, options.writes ? { writes: options.writes } : {}),
49
+ ]));
50
+ }
51
+ /**
52
+ * A state axis emits `data-{prefix}='{state}'` — something a driver can set and
53
+ * a component can render. An axis whose points nothing can reach has no place
54
+ * in the matrix.
55
+ *
56
+ * The attribute-value form, rather than one attribute per state, is what makes
57
+ * the states mutually exclusive by construction: an element cannot be two of
58
+ * them at once, so the matrix does not have to be told.
59
+ */
60
+ export function defineStateAxis(prefix, states) {
61
+ return defineAxis(prefix, states);
62
+ }
63
+ /**
64
+ * A container axis is closed at the element that declares the container.
65
+ *
66
+ * It answers "how wide is my box", which nobody above the container can change,
67
+ * so the axis must not propagate past it — otherwise every ancestor inherits
68
+ * scenarios it has no way to affect. The pruning lives in the matrix; this is
69
+ * where the boundary is named.
70
+ */
71
+ export function defineContainer(container, points) {
72
+ return Object.fromEntries(Object.entries(points).map(([name, { minInlineSize }], index) => [
73
+ name,
74
+ axisPoint(`container.${container.name}`, name, `@container ${container.name} (min-width: ${minInlineSize.css})`, {
75
+ kind: 'resizeContainer',
76
+ container: container.name,
77
+ minInlineSize: minInlineSize.css,
78
+ }, { order: index + 1, bound: 'above', container: container.name }),
79
+ ]));
80
+ }
81
+ //# sourceMappingURL=define.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define.js","sourceRoot":"","sources":["../../../../../../libs/style/src/lib/axes/define.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,SAAS,EAAqC,MAAM,YAAY,CAAC;AAkB1E;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,EAAE,GAAG;IAChB,aAAa,EAAE,CAAC,KAAkB,EAAE,EAAE,CAAC,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;CACzD,CAAC;AAUX;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAE/B,MAAc;IACd,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;QAC/D,IAAI;QACJ,SAAS,CACP,UAAU,EACV,IAAI,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AAC;AACzC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAG7B,MAAc,EAAE,MAAc;IAC9B,OAAO,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACpC,CAAC;AAgBD;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAI7B,SAAwE,EACxE,MAAc;IAEd,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;QAC/D,IAAI;QACJ,SAAS,CACP,aAAa,SAAS,CAAC,IAAI,EAAE,EAC7B,IAAI,EACJ,cAAc,SAAS,CAAC,IAAI,gBAAgB,aAAa,CAAC,GAAG,GAAG,EAChE;YACE,IAAI,EAAE,iBAAiB;YACvB,SAAS,EAAE,SAAS,CAAC,IAAI;YACzB,aAAa,EAAE,aAAa,CAAC,GAAG;SACjC,EACD,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,CAAC,IAAI,EAAE,CAChE;KACF,CAAC,CACmC,CAAC;AAC1C,CAAC","sourcesContent":["/**\n * The axes an application defines for itself.\n *\n * Four constructors, and each one closes its set at construction: what comes\n * back is a record of points, so a name that does not exist is a missing\n * property rather than a condition the browser silently drops.\n */\nimport type { AnyKind, SyntaxOf } from '../kinds.ts';\nimport type { LengthValue } from '../tokens/units.ts';\nimport { axisPoint, type AxisPoint, type AnyAxisPoint } from './types.ts';\n\n/**\n * A point that sits on an ordered axis, and on which side of it.\n *\n * A plain breakpoint is a lower bound: `bp.md` means \"from md up\". `above` and\n * `below` make the bound explicit so that an empty intersection — a rule no\n * viewport can ever match — is detectable instead of shipped.\n */\nexport interface RangePoint<\n Axis extends string,\n Point extends string,\n Bound extends 'above' | 'below' = 'above',\n> extends AxisPoint<Axis, Point> {\n readonly order: number;\n readonly bound: Bound;\n}\n\n/**\n * Breakpoints take **built conditions**, never strings:\n * `at.minInlineSize(unit.rem(40))` and not `'(min-width: 40rem)'`.\n *\n * They live under `at` because `minInlineSize` is also a CSS property in the\n * generated table. Same collision as `px` the unit versus `px` the padding\n * helper, settled the same way.\n */\nexport const at = {\n minInlineSize: (value: LengthValue) => ({ minInlineSize: value }),\n} as const;\n\nexport type BreakpointSpec = { readonly minInlineSize: LengthValue };\n\nexport type Breakpoints<\n Points extends Readonly<Record<string, BreakpointSpec>>,\n> = {\n readonly [Key in keyof Points & string]: RangePoint<'viewport', Key>;\n};\n\n/**\n * Breakpoints are indexed by declaration order.\n *\n * The order is what lets the matrix reduce by interval — two children cutting\n * at `md` and `lg` produce three viewport cells, not four — and what lets a\n * dead rule be recognised. Declare them ascending; nothing else can infer it.\n */\nexport function defineBreakpoints<\n const Points extends Readonly<Record<string, BreakpointSpec>>,\n>(points: Points): Breakpoints<Points> {\n return Object.fromEntries(\n Object.entries(points).map(([name, { minInlineSize }], index) => [\n name,\n axisPoint(\n 'viewport',\n name,\n `@media (min-width: ${minInlineSize.css})`,\n {\n kind: 'resize',\n minInlineSize: minInlineSize.css,\n },\n { order: index + 1, bound: 'above' },\n ),\n ]),\n ) as Breakpoints<Points>;\n}\n\n/** From this breakpoint up. The same thing a bare breakpoint already means. */\nexport const above = <Axis extends string, Point extends string>(\n point: RangePoint<Axis, Point, 'above' | 'below'>,\n): RangePoint<Axis, Point, 'above'> => ({ ...point, bound: 'above' });\n\n/** Strictly below this breakpoint. */\nexport const below = <Axis extends string, Point extends string>(\n point: RangePoint<Axis, Point, 'above' | 'below'>,\n): RangePoint<Axis, Point, 'below'> => ({\n ...point,\n bound: 'below',\n open: point.open.replace(\n /^@media \\(min-width: (.*)\\)$/,\n '@media not (min-width: $1)',\n ),\n});\n\n// ─── constrained axes ───────────────────────────────────────────────────────\n\ndeclare const WRITES: unique symbol;\n\n/**\n * An axis that may only write custom properties of one kind.\n *\n * This is the one reduction the matrix can make without analysing anything: an\n * axis constrained to `<color>` cannot move a box, so it crosses additively\n * with the axes that do. The constraint is checked where it is cheap — at the\n * call site of `when` — rather than by reading the emitted CSS afterwards.\n */\nexport interface ConstrainedAxisPoint<\n Axis extends string,\n Point extends string,\n Syntax extends string,\n> extends AxisPoint<Axis, Point> {\n readonly [WRITES]?: Syntax;\n}\n\nexport type WritesSyntaxOf<Point> = typeof WRITES extends keyof Point\n ? Point extends { readonly [WRITES]?: infer Syntax extends string }\n ? Syntax\n : never\n : never;\n\n/** `defineAxis('theme', [...], { writes: onlyVarsOfKind(kind.color) })`. */\nexport const onlyVarsOfKind = <Kind extends AnyKind>(\n kind: Kind,\n): { readonly writes: readonly [SyntaxOf<Kind>] } =>\n ({ writes: [kind.syntax] }) as never;\n\nexport interface AxisOptions<Syntax extends string = never> {\n readonly writes?: readonly [Syntax];\n}\n\nexport type DefinedAxis<\n Name extends string,\n Values extends readonly string[],\n Syntax extends string,\n> = {\n readonly [Value in Values[number]]: [Syntax] extends [never]\n ? AxisPoint<Name, Value>\n : ConstrainedAxisPoint<Name, Value, Syntax>;\n};\n\n/**\n * A generic axis driven by an attribute, with an optional write constraint.\n *\n * `defineStateAxis` is this without the constraint; it stays a separate name\n * because a state axis is the common case and reads better without options.\n */\nexport function defineAxis<\n const Name extends string,\n const Values extends readonly string[],\n const Syntax extends string = never,\n>(\n name: Name,\n values: Values,\n options: AxisOptions<Syntax> = {},\n): DefinedAxis<Name, Values, Syntax> {\n return Object.fromEntries(\n values.map((value) => [\n value,\n axisPoint(\n name,\n value,\n `&[data-${name}='${value}']`,\n { kind: 'setAttribute', name: `data-${name}`, value },\n options.writes ? { writes: options.writes } : {},\n ),\n ]),\n ) as DefinedAxis<Name, Values, Syntax>;\n}\n\n/**\n * A state axis emits `data-{prefix}='{state}'` — something a driver can set and\n * a component can render. An axis whose points nothing can reach has no place\n * in the matrix.\n *\n * The attribute-value form, rather than one attribute per state, is what makes\n * the states mutually exclusive by construction: an element cannot be two of\n * them at once, so the matrix does not have to be told.\n */\nexport function defineStateAxis<\n const Prefix extends string,\n const States extends readonly string[],\n>(prefix: Prefix, states: States): DefinedAxis<Prefix, States, never> {\n return defineAxis(prefix, states);\n}\n\n// ─── container axes ─────────────────────────────────────────────────────────\n\nexport type ContainerBreakpoints<\n Name extends string,\n Points extends Readonly<Record<string, BreakpointSpec>>,\n> = {\n readonly [Key in keyof Points & string]: RangePoint<`container.${Name}`, Key>;\n};\n\nexport interface ContainerSpec {\n readonly name: string;\n readonly type: 'inline-size' | 'size' | 'scroll-state';\n}\n\n/**\n * A container axis is closed at the element that declares the container.\n *\n * It answers \"how wide is my box\", which nobody above the container can change,\n * so the axis must not propagate past it — otherwise every ancestor inherits\n * scenarios it has no way to affect. The pruning lives in the matrix; this is\n * where the boundary is named.\n */\nexport function defineContainer<\n const Name extends string,\n const Points extends Readonly<Record<string, BreakpointSpec>>,\n>(\n container: { readonly name: Name; readonly type: ContainerSpec['type'] },\n points: Points,\n): ContainerBreakpoints<Name, Points> {\n return Object.fromEntries(\n Object.entries(points).map(([name, { minInlineSize }], index) => [\n name,\n axisPoint(\n `container.${container.name}`,\n name,\n `@container ${container.name} (min-width: ${minInlineSize.css})`,\n {\n kind: 'resizeContainer',\n container: container.name,\n minInlineSize: minInlineSize.css,\n },\n { order: index + 1, bound: 'above', container: container.name },\n ),\n ]),\n ) as ContainerBreakpoints<Name, Points>;\n}\n\nexport type { AnyAxisPoint };\n"]}
@@ -0,0 +1,4 @@
1
+ export * from './types.ts';
2
+ export * from './standard.ts';
3
+ export * from './define.ts';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../libs/style/src/lib/axes/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./types.js";
2
+ export * from "./standard.js";
3
+ export * from "./define.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/style/src/lib/axes/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC","sourcesContent":["export * from './types.ts';\nexport * from './standard.ts';\nexport * from './define.ts';\n"]}
@@ -0,0 +1,85 @@
1
+ /**
2
+ * The axes the platform defines, shipped closed.
3
+ *
4
+ * Property access only — `scrollState.stuck.blockEnd`, never
5
+ * `scrollState.stuck('block-end')`. A typo is
6
+ * `Property 'blockEndd' does not exist`, and not a container query the browser
7
+ * parses, ignores, and never mentions again.
8
+ *
9
+ * `descendant.*` is the **only** door to `:has()`. Free-form `:has()` reaches
10
+ * across a component boundary, so a component's visual states would depend on
11
+ * markup it does not own — which is exactly the thing the matrix cannot model.
12
+ * The combinators that stay inside a component (`+`, `~`, `:nth-child`) are not
13
+ * restricted; `no-free-has` enforces the rest.
14
+ */
15
+ import { type AxisPoint } from './types.ts';
16
+ /**
17
+ * The user's preferred colour scheme.
18
+ *
19
+ * Named `scheme` and not `colorScheme`, which the generated table already uses
20
+ * for the `color-scheme` **property** — a different thing: the property tells
21
+ * the UA which schemes the page supports, the axis asks which one the user
22
+ * wants. Fourth collision settled the same way as `px`, `color` and
23
+ * `minInlineSize`; here the shorter distinct name reads better than a namespace.
24
+ *
25
+ * `base` is implicit on every axis: it is the absence of a condition. There is
26
+ * therefore no `scheme.light` — writing light styles unconditionally and
27
+ * overriding them in dark is the one spelling.
28
+ */
29
+ export declare const scheme: {
30
+ readonly dark: AxisPoint<"scheme", "dark">;
31
+ };
32
+ export declare const motion: {
33
+ readonly reduced: AxisPoint<"motion", "reduced">;
34
+ };
35
+ export declare const forcedColors: {
36
+ readonly active: AxisPoint<"forcedColors", "active">;
37
+ };
38
+ export declare const contrast: {
39
+ readonly more: AxisPoint<"contrast", "more">;
40
+ };
41
+ /**
42
+ * The three groups are separate axes, not one.
43
+ *
44
+ * An element can be stuck *and* snapped at the same time, so folding them into
45
+ * a single axis would make the matrix claim combinations are impossible when
46
+ * they are not. Within one group the points are mutually exclusive, which is
47
+ * what the reduction in wave 5 would rely on.
48
+ */
49
+ export declare const scrollState: {
50
+ readonly stuck: {
51
+ readonly none: AxisPoint<"scrollState.stuck" | "scrollState.snapped" | "scrollState.scrollable", string>;
52
+ readonly blockStart: AxisPoint<"scrollState.stuck" | "scrollState.snapped" | "scrollState.scrollable", string>;
53
+ readonly blockEnd: AxisPoint<"scrollState.stuck" | "scrollState.snapped" | "scrollState.scrollable", string>;
54
+ readonly inlineStart: AxisPoint<"scrollState.stuck" | "scrollState.snapped" | "scrollState.scrollable", string>;
55
+ readonly inlineEnd: AxisPoint<"scrollState.stuck" | "scrollState.snapped" | "scrollState.scrollable", string>;
56
+ };
57
+ readonly snapped: {
58
+ readonly none: AxisPoint<"scrollState.stuck" | "scrollState.snapped" | "scrollState.scrollable", string>;
59
+ readonly block: AxisPoint<"scrollState.stuck" | "scrollState.snapped" | "scrollState.scrollable", string>;
60
+ readonly inline: AxisPoint<"scrollState.stuck" | "scrollState.snapped" | "scrollState.scrollable", string>;
61
+ readonly both: AxisPoint<"scrollState.stuck" | "scrollState.snapped" | "scrollState.scrollable", string>;
62
+ };
63
+ readonly scrollable: {
64
+ readonly none: AxisPoint<"scrollState.stuck" | "scrollState.snapped" | "scrollState.scrollable", string>;
65
+ readonly blockStart: AxisPoint<"scrollState.stuck" | "scrollState.snapped" | "scrollState.scrollable", string>;
66
+ readonly blockEnd: AxisPoint<"scrollState.stuck" | "scrollState.snapped" | "scrollState.scrollable", string>;
67
+ readonly inlineStart: AxisPoint<"scrollState.stuck" | "scrollState.snapped" | "scrollState.scrollable", string>;
68
+ readonly inlineEnd: AxisPoint<"scrollState.stuck" | "scrollState.snapped" | "scrollState.scrollable", string>;
69
+ };
70
+ };
71
+ /**
72
+ * The only entry point to `:has()`.
73
+ *
74
+ * Each entry is its own axis with a single point, because "a descendant is
75
+ * invalid" and "a descendant has focus" are independent — one axis with three
76
+ * points would say they exclude each other.
77
+ */
78
+ export declare const descendant: {
79
+ readonly userInvalid: AxisPoint<`descendant.${string}`, "present">;
80
+ readonly focusVisible: AxisPoint<`descendant.${string}`, "present">;
81
+ readonly checked: AxisPoint<`descendant.${string}`, "present">;
82
+ };
83
+ /** Every standard point, for the specs that assert each one has a driver. */
84
+ export declare const STANDARD_AXES: readonly (AxisPoint<"scheme", "dark"> | AxisPoint<"motion", "reduced"> | AxisPoint<"forcedColors", "active"> | AxisPoint<"contrast", "more"> | AxisPoint<"scrollState.stuck" | "scrollState.snapped" | "scrollState.scrollable", string> | AxisPoint<`descendant.${string}`, "present">)[];
85
+ //# sourceMappingURL=standard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standard.d.ts","sourceRoot":"","sources":["../../../../../../libs/style/src/lib/axes/standard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAa,KAAK,SAAS,EAAe,MAAM,YAAY,CAAC;AAcpE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,MAAM;mBACgD,SAAS,CACxE,QAAQ,EACR,MAAM,CACP;CACO,CAAC;AAEX,eAAO,MAAM,MAAM;sBAMZ,SAAS,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC3B,CAAC;AAEX,eAAO,MAAM,YAAY;qBAMlB,SAAS,CAAC,cAAc,EAAE,QAAQ,CAAC;CAChC,CAAC;AAEX,eAAO,MAAM,QAAQ;mBAC4C,SAAS,CACtE,UAAU,EACV,MAAM,CACP;CACO,CAAC;AAoBX;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;CAyCd,CAAC;AAcX;;;;;;GAMG;AACH,eAAO,MAAM,UAAU;;;;CAQb,CAAC;AAEX,6EAA6E;AAC7E,eAAO,MAAM,aAAa,4RAShB,CAAC"}
@@ -0,0 +1,109 @@
1
+ /**
2
+ * The axes the platform defines, shipped closed.
3
+ *
4
+ * Property access only — `scrollState.stuck.blockEnd`, never
5
+ * `scrollState.stuck('block-end')`. A typo is
6
+ * `Property 'blockEndd' does not exist`, and not a container query the browser
7
+ * parses, ignores, and never mentions again.
8
+ *
9
+ * `descendant.*` is the **only** door to `:has()`. Free-form `:has()` reaches
10
+ * across a component boundary, so a component's visual states would depend on
11
+ * markup it does not own — which is exactly the thing the matrix cannot model.
12
+ * The combinators that stay inside a component (`+`, `~`, `:nth-child`) are not
13
+ * restricted; `no-free-has` enforces the rest.
14
+ */
15
+ import { axisPoint } from "./types.js";
16
+ const media = (axis, name, feature, value) => axisPoint(axis, name, `@media (${feature}: ${value})`, {
17
+ kind: 'emulateMedia',
18
+ feature,
19
+ value,
20
+ });
21
+ /**
22
+ * The user's preferred colour scheme.
23
+ *
24
+ * Named `scheme` and not `colorScheme`, which the generated table already uses
25
+ * for the `color-scheme` **property** — a different thing: the property tells
26
+ * the UA which schemes the page supports, the axis asks which one the user
27
+ * wants. Fourth collision settled the same way as `px`, `color` and
28
+ * `minInlineSize`; here the shorter distinct name reads better than a namespace.
29
+ *
30
+ * `base` is implicit on every axis: it is the absence of a condition. There is
31
+ * therefore no `scheme.light` — writing light styles unconditionally and
32
+ * overriding them in dark is the one spelling.
33
+ */
34
+ export const scheme = {
35
+ dark: media('scheme', 'dark', 'prefers-color-scheme', 'dark'),
36
+ };
37
+ export const motion = {
38
+ reduced: media('motion', 'reduced', 'prefers-reduced-motion', 'reduce'),
39
+ };
40
+ export const forcedColors = {
41
+ active: media('forcedColors', 'active', 'forced-colors', 'active'),
42
+ };
43
+ export const contrast = {
44
+ more: media('contrast', 'more', 'prefers-contrast', 'more'),
45
+ };
46
+ // ─── scroll state ───────────────────────────────────────────────────────────
47
+ // `@container scroll-state(...)`. Reading it requires a
48
+ // `container-type: scroll-state` ancestor, which only `provides(containerType.scrollState)`
49
+ // can lay down — so a sheet cannot query a state nobody made queryable.
50
+ const scrollStatePoint = (group, name, value, to) => axisPoint(`scrollState.${group}`, name, `@container scroll-state(${group}: ${value})`, { kind: 'scroll', to });
51
+ /**
52
+ * The three groups are separate axes, not one.
53
+ *
54
+ * An element can be stuck *and* snapped at the same time, so folding them into
55
+ * a single axis would make the matrix claim combinations are impossible when
56
+ * they are not. Within one group the points are mutually exclusive, which is
57
+ * what the reduction in wave 5 would rely on.
58
+ */
59
+ export const scrollState = {
60
+ stuck: {
61
+ none: scrollStatePoint('stuck', 'none', 'none', 'start'),
62
+ blockStart: scrollStatePoint('stuck', 'blockStart', 'block-start', 'start'),
63
+ blockEnd: scrollStatePoint('stuck', 'blockEnd', 'block-end', 'end'),
64
+ inlineStart: scrollStatePoint('stuck', 'inlineStart', 'inline-start', 'start'),
65
+ inlineEnd: scrollStatePoint('stuck', 'inlineEnd', 'inline-end', 'end'),
66
+ },
67
+ snapped: {
68
+ none: scrollStatePoint('snapped', 'none', 'none', 'start'),
69
+ block: scrollStatePoint('snapped', 'block', 'block', 'snap'),
70
+ inline: scrollStatePoint('snapped', 'inline', 'inline', 'snap'),
71
+ both: scrollStatePoint('snapped', 'both', 'both', 'snap'),
72
+ },
73
+ scrollable: {
74
+ none: scrollStatePoint('scrollable', 'none', 'none', 'start'),
75
+ blockStart: scrollStatePoint('scrollable', 'blockStart', 'block-start', 'end'),
76
+ blockEnd: scrollStatePoint('scrollable', 'blockEnd', 'block-end', 'start'),
77
+ inlineStart: scrollStatePoint('scrollable', 'inlineStart', 'inline-start', 'end'),
78
+ inlineEnd: scrollStatePoint('scrollable', 'inlineEnd', 'inline-end', 'start'),
79
+ },
80
+ };
81
+ // ─── descendant state ───────────────────────────────────────────────────────
82
+ const descendantPoint = (name, selector, state) => axisPoint(`descendant.${name}`, 'present', `&:has(${selector})`, {
83
+ kind: 'descendantState',
84
+ state,
85
+ });
86
+ /**
87
+ * The only entry point to `:has()`.
88
+ *
89
+ * Each entry is its own axis with a single point, because "a descendant is
90
+ * invalid" and "a descendant has focus" are independent — one axis with three
91
+ * points would say they exclude each other.
92
+ */
93
+ export const descendant = {
94
+ userInvalid: descendantPoint('userInvalid', ':user-invalid', 'user-invalid'),
95
+ focusVisible: descendantPoint('focusVisible', ':focus-visible', 'focus-visible'),
96
+ checked: descendantPoint('checked', ':checked', 'checked'),
97
+ };
98
+ /** Every standard point, for the specs that assert each one has a driver. */
99
+ export const STANDARD_AXES = [
100
+ ...Object.values(scheme),
101
+ ...Object.values(motion),
102
+ ...Object.values(forcedColors),
103
+ ...Object.values(contrast),
104
+ ...Object.values(scrollState.stuck),
105
+ ...Object.values(scrollState.snapped),
106
+ ...Object.values(scrollState.scrollable),
107
+ ...Object.values(descendant),
108
+ ];
109
+ //# sourceMappingURL=standard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standard.js","sourceRoot":"","sources":["../../../../../../libs/style/src/lib/axes/standard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,SAAS,EAA+B,MAAM,YAAY,CAAC;AAEpE,MAAM,KAAK,GAAG,CACZ,IAAY,EACZ,IAAY,EACZ,OAA6D,EAC7D,KAAa,EACb,EAAE,CACF,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,OAAO,KAAK,KAAK,GAAG,EAAE;IACrD,IAAI,EAAE,cAAc;IACpB,OAAO;IACP,KAAK;CACN,CAAC,CAAC;AAEL;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,CAG3D;CACO,CAAC;AAEX,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,OAAO,EAAE,KAAK,CACZ,QAAQ,EACR,SAAS,EACT,wBAAwB,EACxB,QAAQ,CACyB;CAC3B,CAAC;AAEX,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,MAAM,EAAE,KA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AAC,MAAM,CAAC,QAAQ,CAAC;IAC1B,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC;IACnC,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC;IACrC,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC;IACxC,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;CACpB,CAAC","sourcesContent":["/**\n * The axes the platform defines, shipped closed.\n *\n * Property access only — `scrollState.stuck.blockEnd`, never\n * `scrollState.stuck('block-end')`. A typo is\n * `Property 'blockEndd' does not exist`, and not a container query the browser\n * parses, ignores, and never mentions again.\n *\n * `descendant.*` is the **only** door to `:has()`. Free-form `:has()` reaches\n * across a component boundary, so a component's visual states would depend on\n * markup it does not own — which is exactly the thing the matrix cannot model.\n * The combinators that stay inside a component (`+`, `~`, `:nth-child`) are not\n * restricted; `no-free-has` enforces the rest.\n */\nimport { axisPoint, type AxisPoint, type Driver } from './types.ts';\n\nconst media = (\n axis: string,\n name: string,\n feature: Extract<Driver, { kind: 'emulateMedia' }>['feature'],\n value: string,\n) =>\n axisPoint(axis, name, `@media (${feature}: ${value})`, {\n kind: 'emulateMedia',\n feature,\n value,\n });\n\n/**\n * The user's preferred colour scheme.\n *\n * Named `scheme` and not `colorScheme`, which the generated table already uses\n * for the `color-scheme` **property** — a different thing: the property tells\n * the UA which schemes the page supports, the axis asks which one the user\n * wants. Fourth collision settled the same way as `px`, `color` and\n * `minInlineSize`; here the shorter distinct name reads better than a namespace.\n *\n * `base` is implicit on every axis: it is the absence of a condition. There is\n * therefore no `scheme.light` — writing light styles unconditionally and\n * overriding them in dark is the one spelling.\n */\nexport const scheme = {\n dark: media('scheme', 'dark', 'prefers-color-scheme', 'dark') as AxisPoint<\n 'scheme',\n 'dark'\n >,\n} as const;\n\nexport const motion = {\n reduced: media(\n 'motion',\n 'reduced',\n 'prefers-reduced-motion',\n 'reduce',\n ) as AxisPoint<'motion', 'reduced'>,\n} as const;\n\nexport const forcedColors = {\n active: media(\n 'forcedColors',\n 'active',\n 'forced-colors',\n 'active',\n ) as AxisPoint<'forcedColors', 'active'>,\n} as const;\n\nexport const contrast = {\n more: media('contrast', 'more', 'prefers-contrast', 'more') as AxisPoint<\n 'contrast',\n 'more'\n >,\n} as const;\n\n// ─── scroll state ───────────────────────────────────────────────────────────\n// `@container scroll-state(...)`. Reading it requires a\n// `container-type: scroll-state` ancestor, which only `provides(containerType.scrollState)`\n// can lay down — so a sheet cannot query a state nobody made queryable.\n\nconst scrollStatePoint = (\n group: 'stuck' | 'snapped' | 'scrollable',\n name: string,\n value: string,\n to: 'start' | 'end' | 'snap',\n) =>\n axisPoint(\n `scrollState.${group}`,\n name,\n `@container scroll-state(${group}: ${value})`,\n { kind: 'scroll', to },\n );\n\n/**\n * The three groups are separate axes, not one.\n *\n * An element can be stuck *and* snapped at the same time, so folding them into\n * a single axis would make the matrix claim combinations are impossible when\n * they are not. Within one group the points are mutually exclusive, which is\n * what the reduction in wave 5 would rely on.\n */\nexport const scrollState = {\n stuck: {\n none: scrollStatePoint('stuck', 'none', 'none', 'start'),\n blockStart: scrollStatePoint('stuck', 'blockStart', 'block-start', 'start'),\n blockEnd: scrollStatePoint('stuck', 'blockEnd', 'block-end', 'end'),\n inlineStart: scrollStatePoint(\n 'stuck',\n 'inlineStart',\n 'inline-start',\n 'start',\n ),\n inlineEnd: scrollStatePoint('stuck', 'inlineEnd', 'inline-end', 'end'),\n },\n snapped: {\n none: scrollStatePoint('snapped', 'none', 'none', 'start'),\n block: scrollStatePoint('snapped', 'block', 'block', 'snap'),\n inline: scrollStatePoint('snapped', 'inline', 'inline', 'snap'),\n both: scrollStatePoint('snapped', 'both', 'both', 'snap'),\n },\n scrollable: {\n none: scrollStatePoint('scrollable', 'none', 'none', 'start'),\n blockStart: scrollStatePoint(\n 'scrollable',\n 'blockStart',\n 'block-start',\n 'end',\n ),\n blockEnd: scrollStatePoint('scrollable', 'blockEnd', 'block-end', 'start'),\n inlineStart: scrollStatePoint(\n 'scrollable',\n 'inlineStart',\n 'inline-start',\n 'end',\n ),\n inlineEnd: scrollStatePoint(\n 'scrollable',\n 'inlineEnd',\n 'inline-end',\n 'start',\n ),\n },\n} as const;\n\n// ─── descendant state ───────────────────────────────────────────────────────\n\nconst descendantPoint = (\n name: string,\n selector: string,\n state: Extract<Driver, { kind: 'descendantState' }>['state'],\n) =>\n axisPoint(`descendant.${name}`, 'present', `&:has(${selector})`, {\n kind: 'descendantState',\n state,\n });\n\n/**\n * The only entry point to `:has()`.\n *\n * Each entry is its own axis with a single point, because \"a descendant is\n * invalid\" and \"a descendant has focus\" are independent — one axis with three\n * points would say they exclude each other.\n */\nexport const descendant = {\n userInvalid: descendantPoint('userInvalid', ':user-invalid', 'user-invalid'),\n focusVisible: descendantPoint(\n 'focusVisible',\n ':focus-visible',\n 'focus-visible',\n ),\n checked: descendantPoint('checked', ':checked', 'checked'),\n} as const;\n\n/** Every standard point, for the specs that assert each one has a driver. */\nexport const STANDARD_AXES = [\n ...Object.values(scheme),\n ...Object.values(motion),\n ...Object.values(forcedColors),\n ...Object.values(contrast),\n ...Object.values(scrollState.stuck),\n ...Object.values(scrollState.snapped),\n ...Object.values(scrollState.scrollable),\n ...Object.values(descendant),\n] as const;\n"]}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * What an axis is made of.
3
+ *
4
+ * An axis is a **closed** set of points, shipped by the library or built by
5
+ * `defineBreakpoints` / `defineAxis` / `defineStateAxis` / `defineContainer`.
6
+ * Never a string: `scrollState.stuck.blockEnd`, not
7
+ * `scrollState.stuck('block-end')`. A key that does not exist is a compile
8
+ * error, not CSS the browser ignores.
9
+ *
10
+ * Every point carries its **driver**. An axis without one would be worse than a
11
+ * missing axis: the matrix would enumerate scenarios nothing can reach and
12
+ * render identical captures, which is false coverage rather than no coverage.
13
+ */
14
+ /** How a test reaches a point. There is no `'none'`: every point is reachable. */
15
+ export type Driver = {
16
+ readonly kind: 'emulateMedia';
17
+ readonly feature: 'prefers-color-scheme' | 'prefers-reduced-motion' | 'forced-colors' | 'prefers-contrast';
18
+ readonly value: string;
19
+ } | {
20
+ readonly kind: 'resize';
21
+ readonly minInlineSize: string;
22
+ } | {
23
+ readonly kind: 'resizeContainer';
24
+ readonly container: string;
25
+ readonly minInlineSize: string;
26
+ } | {
27
+ readonly kind: 'setAttribute';
28
+ readonly name: string;
29
+ readonly value: string;
30
+ } | {
31
+ readonly kind: 'scroll';
32
+ readonly to: 'start' | 'end' | 'snap';
33
+ } | {
34
+ readonly kind: 'descendantState';
35
+ readonly state: 'user-invalid' | 'focus-visible' | 'checked';
36
+ };
37
+ export interface AxisPoint<Axis extends string, Point extends string> {
38
+ readonly axis: Axis;
39
+ readonly point: Point;
40
+ /** The at-rule or selector fragment the emitter wraps around the rule. */
41
+ readonly open: string;
42
+ readonly driver: Driver;
43
+ /**
44
+ * Ordered axes only — viewport and container. Two points of the same axis
45
+ * with an order can be compared, which is what makes a dead rule detectable
46
+ * and what lets the matrix reduce by interval instead of by product.
47
+ */
48
+ readonly order?: number;
49
+ /**
50
+ * Set when the point is a lower bound (`above`) or an upper bound (`below`).
51
+ * A plain breakpoint is a lower bound.
52
+ */
53
+ readonly bound?: 'above' | 'below';
54
+ /**
55
+ * The container this point queries, when it is not the viewport. A container
56
+ * axis does not propagate above the element that resolves it.
57
+ */
58
+ readonly container?: string;
59
+ /**
60
+ * Custom properties this axis is allowed to write, by kind syntax. Empty
61
+ * means unconstrained. See `defineAxis(..., { writes })`.
62
+ */
63
+ readonly writes?: readonly string[];
64
+ }
65
+ export type AnyAxisPoint = AxisPoint<string, string>;
66
+ export declare const axisPoint: <Axis extends string, Point extends string>(axis: Axis, name: Point, open: string, driver: Driver, extra?: Omit<Partial<AnyAxisPoint>, "axis" | "point" | "open" | "driver">) => AxisPoint<Axis, Point>;
67
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceR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