@stridge/noctis-design-tokens 1.0.0-beta.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 (42) hide show
  1. package/README.md +226 -0
  2. package/dist/apply-scopes.d.ts +12 -0
  3. package/dist/apply-scopes.js +30 -0
  4. package/dist/css.d.ts +10 -0
  5. package/dist/css.js +36 -0
  6. package/dist/graph/components.d.ts +6 -0
  7. package/dist/graph/components.js +4488 -0
  8. package/dist/graph/index.d.ts +11 -0
  9. package/dist/graph/index.js +26 -0
  10. package/dist/graph/inputs.d.ts +1 -0
  11. package/dist/graph/inputs.js +23 -0
  12. package/dist/graph/model.d.ts +205 -0
  13. package/dist/graph/model.js +282 -0
  14. package/dist/graph/registry.d.ts +67 -0
  15. package/dist/graph/registry.js +118 -0
  16. package/dist/graph/roles.d.ts +5 -0
  17. package/dist/graph/roles.js +151 -0
  18. package/dist/graph/scales.d.ts +1 -0
  19. package/dist/graph/scales.js +1296 -0
  20. package/dist/graph/serialize.d.ts +16 -0
  21. package/dist/graph/serialize.js +25 -0
  22. package/dist/graph/statics.d.ts +1 -0
  23. package/dist/graph/statics.js +419 -0
  24. package/dist/index.d.ts +26 -0
  25. package/dist/index.js +25 -0
  26. package/dist/palettes.d.ts +70 -0
  27. package/dist/palettes.js +114 -0
  28. package/dist/react/provider.d.ts +23 -0
  29. package/dist/react/provider.js +28 -0
  30. package/dist/react.d.ts +3 -0
  31. package/dist/react.js +3 -0
  32. package/dist/scales.d.ts +186 -0
  33. package/dist/scales.js +186 -0
  34. package/dist/semantic.d.ts +36 -0
  35. package/dist/semantic.js +49 -0
  36. package/dist/swatches.d.ts +24 -0
  37. package/dist/swatches.js +57 -0
  38. package/dist/tokens.css +2607 -0
  39. package/dist/tokens.dtcg.json +3475 -0
  40. package/dist/tokens.json +14658 -0
  41. package/dist/tokens.tailwind.css +479 -0
  42. package/package.json +67 -0
@@ -0,0 +1,114 @@
1
+ //#region src/palettes.ts
2
+ /**
3
+ * Categorical chart series (8). Spread across the hue wheel with alternating lightness;
4
+ * dark-mode values sit lighter (read on dark surfaces), light-mode values sit darker.
5
+ */
6
+ const CHART_PALETTE = {
7
+ dark: [
8
+ "oklch(0.7 0.15 264)",
9
+ "oklch(0.78 0.13 195)",
10
+ "oklch(0.74 0.16 150)",
11
+ "oklch(0.83 0.15 95)",
12
+ "oklch(0.72 0.16 55)",
13
+ "oklch(0.68 0.18 25)",
14
+ "oklch(0.7 0.17 310)",
15
+ "oklch(0.76 0.14 350)"
16
+ ],
17
+ light: [
18
+ "oklch(0.55 0.17 264)",
19
+ "oklch(0.6 0.13 195)",
20
+ "oklch(0.58 0.16 150)",
21
+ "oklch(0.68 0.15 95)",
22
+ "oklch(0.6 0.17 55)",
23
+ "oklch(0.55 0.2 25)",
24
+ "oklch(0.55 0.19 310)",
25
+ "oklch(0.6 0.16 350)"
26
+ ]
27
+ };
28
+ /**
29
+ * Avatar / identity backgrounds (10). Saturated mid-lightness colors chosen so white initials
30
+ * read clearly on every swatch; picked deterministically by hashing a stable id.
31
+ */
32
+ const AVATAR_PALETTE = {
33
+ dark: [
34
+ "oklch(0.62 0.17 264)",
35
+ "oklch(0.62 0.15 196)",
36
+ "oklch(0.62 0.16 152)",
37
+ "oklch(0.64 0.15 130)",
38
+ "oklch(0.66 0.16 70)",
39
+ "oklch(0.62 0.18 40)",
40
+ "oklch(0.6 0.2 18)",
41
+ "oklch(0.6 0.18 330)",
42
+ "oklch(0.6 0.18 300)",
43
+ "oklch(0.6 0.15 285)"
44
+ ],
45
+ light: [
46
+ "oklch(0.58 0.18 264)",
47
+ "oklch(0.56 0.15 196)",
48
+ "oklch(0.56 0.16 152)",
49
+ "oklch(0.58 0.15 130)",
50
+ "oklch(0.62 0.16 70)",
51
+ "oklch(0.58 0.19 40)",
52
+ "oklch(0.56 0.21 18)",
53
+ "oklch(0.56 0.19 330)",
54
+ "oklch(0.56 0.19 300)",
55
+ "oklch(0.56 0.16 285)"
56
+ ]
57
+ };
58
+ /** Number of distinct chart series and avatar swatches. */
59
+ const CHART_SERIES_COUNT = CHART_PALETTE.dark.length;
60
+ const AVATAR_SWATCH_COUNT = AVATAR_PALETTE.dark.length;
61
+ /** On-avatar text — a fixed knockout that reads on every (saturated) avatar swatch. */
62
+ const AVATAR_FOREGROUND = "oklch(0.99 0 0)";
63
+ /**
64
+ * Pick a stable avatar swatch index (1-based, matching `bg-avatar-N`) for an id. A small FNV-1a
65
+ * hash keeps the mapping deterministic across renders and sessions.
66
+ */
67
+ function avatarIndex(id) {
68
+ let hash = 2166136261;
69
+ for (let i = 0; i < id.length; i++) {
70
+ hash ^= id.charCodeAt(i);
71
+ hash = Math.imul(hash, 16777619);
72
+ }
73
+ return (hash >>> 0) % AVATAR_SWATCH_COUNT + 1;
74
+ }
75
+ /** Chart roles that alias engine semantics (kept here so the swatch/reference lists them together). */
76
+ const CHART_SEMANTIC_ROLES = [
77
+ {
78
+ role: "chart-positive",
79
+ utility: "text-chart-positive",
80
+ description: "Up / gain trend (= success)."
81
+ },
82
+ {
83
+ role: "chart-negative",
84
+ utility: "text-chart-negative",
85
+ description: "Down / loss trend (= danger)."
86
+ },
87
+ {
88
+ role: "chart-neutral",
89
+ utility: "text-chart-neutral",
90
+ description: "Flat / baseline series."
91
+ },
92
+ {
93
+ role: "chart-grid",
94
+ utility: "border-chart-grid",
95
+ description: "Gridlines and axis ticks."
96
+ },
97
+ {
98
+ role: "chart-axis",
99
+ utility: "text-chart-axis",
100
+ description: "Axis labels and tick text."
101
+ },
102
+ {
103
+ role: "chart-track",
104
+ utility: "bg-chart-track",
105
+ description: "Empty bar / gauge remainder."
106
+ },
107
+ {
108
+ role: "chart-tooltip",
109
+ utility: "bg-chart-tooltip",
110
+ description: "Chart tooltip surface."
111
+ }
112
+ ];
113
+ //#endregion
114
+ export { AVATAR_FOREGROUND, AVATAR_PALETTE, AVATAR_SWATCH_COUNT, CHART_PALETTE, CHART_SEMANTIC_ROLES, CHART_SERIES_COUNT, avatarIndex };
@@ -0,0 +1,23 @@
1
+ import { ThemeInput, ThemeOverrides } from "@stridge/noctis-theme-engine";
2
+ import { ReactNode } from "react";
3
+
4
+ //#region src/react/provider.d.ts
5
+ interface ThemeProviderProps {
6
+ /** Server-resolved seed (from the persisted cookie) — falls back to the default preset. */
7
+ initialInput?: ThemeInput;
8
+ /** Generation-time primitive overrides, threaded to the engine provider and the scope sets. */
9
+ overrides?: ThemeOverrides;
10
+ children: ReactNode;
11
+ }
12
+ /**
13
+ * The app's theme provider: the engine provider plus elevation-scope application, so the
14
+ * root theme and the `elevated`/`sunken` scope sets are emitted together and stay in sync
15
+ * across theme changes. Components reach scopes with a `data-elevation` attribute.
16
+ */
17
+ declare function ThemeProvider({
18
+ initialInput,
19
+ overrides,
20
+ children
21
+ }: ThemeProviderProps): ReactNode;
22
+ //#endregion
23
+ export { ThemeProvider, ThemeProviderProps };
@@ -0,0 +1,28 @@
1
+ "use client";
2
+ import { applyThemeWithScopes } from "../apply-scopes.js";
3
+ import { ThemeProvider, useTheme } from "@stridge/noctis-theme-engine/react";
4
+ import { useInsertionEffect } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ //#region src/react/provider.tsx
7
+ /** Applies the active theme with its elevation scopes whenever the input or overrides change. */
8
+ function ElevationScopes() {
9
+ const { input, overrides } = useTheme();
10
+ useInsertionEffect(() => {
11
+ applyThemeWithScopes(input, void 0, { overrides });
12
+ }, [input, overrides]);
13
+ return null;
14
+ }
15
+ /**
16
+ * The app's theme provider: the engine provider plus elevation-scope application, so the
17
+ * root theme and the `elevated`/`sunken` scope sets are emitted together and stay in sync
18
+ * across theme changes. Components reach scopes with a `data-elevation` attribute.
19
+ */
20
+ function ThemeProvider$1({ initialInput, overrides, children }) {
21
+ return /* @__PURE__ */ jsxs(ThemeProvider, {
22
+ initialInput,
23
+ overrides,
24
+ children: [/* @__PURE__ */ jsx(ElevationScopes, {}), children]
25
+ });
26
+ }
27
+ //#endregion
28
+ export { ThemeProvider$1 as ThemeProvider };
@@ -0,0 +1,3 @@
1
+ import { ThemeProvider, ThemeProviderProps } from "./react/provider.js";
2
+ import { useTheme } from "@stridge/noctis-theme-engine/react";
3
+ export { ThemeProvider, type ThemeProviderProps, useTheme };
package/dist/react.js ADDED
@@ -0,0 +1,3 @@
1
+ import { ThemeProvider } from "./react/provider.js";
2
+ import { useTheme } from "@stridge/noctis-theme-engine/react";
3
+ export { ThemeProvider, useTheme };
@@ -0,0 +1,186 @@
1
+ //#region src/scales.d.ts
2
+ /**
3
+ * The foundation scales — typography, radius, motion, z-index, breakpoints — as data.
4
+ *
5
+ * These mirror the values declared in `tokens.css` (which is what the app actually consumes)
6
+ * and exist so the debug reference page can list them and so the scale stays documented in
7
+ * one typed place. The engine owns color + shadows.
8
+ */
9
+ /** Named font sizes (rem base, before the `--noctis-seed-font-scale` multiplier) and their Tailwind utility. */
10
+ declare const FONT_SIZES: {
11
+ readonly micro: {
12
+ readonly rem: 0.6875;
13
+ readonly utility: "text-micro";
14
+ };
15
+ readonly mini: {
16
+ readonly rem: 0.75;
17
+ readonly utility: "text-mini";
18
+ };
19
+ readonly small: {
20
+ readonly rem: 0.8125;
21
+ readonly utility: "text-small";
22
+ };
23
+ readonly regular: {
24
+ readonly rem: 0.9375;
25
+ readonly utility: "text-regular";
26
+ };
27
+ readonly large: {
28
+ readonly rem: 1.125;
29
+ readonly utility: "text-large";
30
+ };
31
+ readonly "title-3": {
32
+ readonly rem: 1.25;
33
+ readonly utility: "text-title-3";
34
+ };
35
+ readonly "title-2": {
36
+ readonly rem: 1.5;
37
+ readonly utility: "text-title-2";
38
+ };
39
+ readonly "title-1": {
40
+ readonly rem: 2.25;
41
+ readonly utility: "text-title-1";
42
+ };
43
+ };
44
+ /** Font weights (Inter's variable steps) and their Tailwind utility. */
45
+ declare const FONT_WEIGHTS: {
46
+ readonly light: {
47
+ readonly value: 300;
48
+ readonly utility: "font-light";
49
+ };
50
+ readonly normal: {
51
+ readonly value: 450;
52
+ readonly utility: "font-normal";
53
+ };
54
+ readonly medium: {
55
+ readonly value: 500;
56
+ readonly utility: "font-medium";
57
+ };
58
+ readonly semibold: {
59
+ readonly value: 600;
60
+ readonly utility: "font-semibold";
61
+ };
62
+ readonly bold: {
63
+ readonly value: 700;
64
+ readonly utility: "font-bold";
65
+ };
66
+ readonly extrabold: {
67
+ readonly value: 800;
68
+ readonly utility: "font-extrabold";
69
+ };
70
+ readonly black: {
71
+ readonly value: 900;
72
+ readonly utility: "font-black";
73
+ };
74
+ };
75
+ /**
76
+ * Corner radii and their Tailwind utility. Every box step derives from the `--radius` knob
77
+ * ({@link RADIUS_VAR}), so one root value scales the whole UI live. Noctis is pill by default — the
78
+ * knob is `9999px`, so short interactive controls (buttons, chips, inputs, segmented) read as true
79
+ * pills while SURFACES stay capped. Each box step is `min()`-capped so surfaces (cards, sheets,
80
+ * popovers) stay bounded and never become pills, no matter how large the knob — a pill card never reads
81
+ * right. `full` is the only fully-round value (a constant) for genuine circles. `control` is the
82
+ * exception: it follows the knob uncapped, so controls reach a true pill at the Pill default (and go
83
+ * square when the knob is dialled to 0).
84
+ */
85
+ declare const RADII: {
86
+ readonly xs: {
87
+ readonly value: "min(calc(var(--noctis-seed-radius) * 0.5), 0.375rem)";
88
+ readonly utility: "rounded-xs";
89
+ };
90
+ readonly sm: {
91
+ readonly value: "min(calc(var(--noctis-seed-radius) * 0.75), 0.5rem)";
92
+ readonly utility: "rounded-sm";
93
+ };
94
+ readonly md: {
95
+ readonly value: "min(var(--noctis-seed-radius), 0.625rem)";
96
+ readonly utility: "rounded-md";
97
+ };
98
+ readonly lg: {
99
+ readonly value: "min(calc(var(--noctis-seed-radius) * 1.5), 0.875rem)";
100
+ readonly utility: "rounded-lg";
101
+ };
102
+ readonly xl: {
103
+ readonly value: "min(calc(var(--noctis-seed-radius) * 2), 1.25rem)";
104
+ readonly utility: "rounded-xl";
105
+ };
106
+ readonly full: {
107
+ readonly value: "9999px";
108
+ readonly utility: "rounded-full";
109
+ };
110
+ readonly control: {
111
+ readonly value: "var(--noctis-seed-radius)";
112
+ readonly utility: "rounded-control";
113
+ };
114
+ };
115
+ /** Easing curves and their Tailwind utility. */
116
+ declare const EASINGS: {
117
+ readonly standard: {
118
+ readonly value: "cubic-bezier(0.25, 0.46, 0.45, 0.94)";
119
+ readonly utility: "ease-standard";
120
+ };
121
+ readonly in: {
122
+ readonly value: "cubic-bezier(0.55, 0.055, 0.675, 0.19)";
123
+ readonly utility: "ease-in";
124
+ };
125
+ readonly out: {
126
+ readonly value: "cubic-bezier(0.215, 0.61, 0.355, 1)";
127
+ readonly utility: "ease-out";
128
+ };
129
+ readonly "in-out": {
130
+ readonly value: "cubic-bezier(0.645, 0.045, 0.355, 1)";
131
+ readonly utility: "ease-in-out";
132
+ };
133
+ readonly overlay: {
134
+ readonly value: "cubic-bezier(0.32, 0.72, 0, 1)";
135
+ readonly utility: "ease-overlay";
136
+ };
137
+ };
138
+ /**
139
+ * Transition speeds, bridged into the `duration-…` utilities and read as `var(--noctis-duration-…)`.
140
+ * `quick` is the library-wide control-feedback stop; `overlay` drives modal-overlay motion.
141
+ */
142
+ declare const SPEEDS: {
143
+ readonly fast: "0.1s";
144
+ readonly quick: "0.15s";
145
+ readonly regular: "0.2s";
146
+ readonly slow: "0.35s";
147
+ readonly overlay: "0.26s";
148
+ };
149
+ /** Named stacking contexts, bridged into the `z-…` utilities and read as `var(--z-…)`. */
150
+ declare const Z_INDEX: {
151
+ readonly base: 0;
152
+ readonly raised: 1;
153
+ readonly dropdown: 1000;
154
+ readonly sticky: 1100;
155
+ readonly overlay: 1300;
156
+ readonly modal: 1400;
157
+ readonly popover: 1500;
158
+ readonly toast: 1700;
159
+ };
160
+ /** Responsive breakpoints (Tailwind `sm:`/`md:`/… prefixes). */
161
+ declare const BREAKPOINTS: {
162
+ readonly sm: "40rem";
163
+ readonly md: "48rem";
164
+ readonly lg: "64rem";
165
+ readonly xl: "80rem";
166
+ readonly "2xl": "96rem";
167
+ };
168
+ /**
169
+ * The seed variable that scales the entire type ramp. Set on `:root` (System Controls, host tweaks),
170
+ * it resizes every named `text-*` utility live, since each size is a `calc()` of its base times this seed.
171
+ */
172
+ declare const FONT_SCALE_VAR: "--noctis-seed-font-scale";
173
+ /**
174
+ * The seed variable the whole radius scale derives from. Set on `:root` (System Controls, host tweaks),
175
+ * it rounds every `rounded-*` utility live, since each {@link RADII} step is a `calc()` of this seed.
176
+ * `9999px` is the pill Noctis default (controls go fully round; surfaces stay capped).
177
+ */
178
+ declare const RADIUS_VAR: "--noctis-seed-radius";
179
+ /**
180
+ * The seed variable that tunes spacing density. Set on `:root` (System Controls, host tweaks), it tightens
181
+ * or loosens the spacing ramp, control heights, and region padding, each a `calc()` over this seed. `1` is
182
+ * the default; focus-ring geometry and border widths stay fixed.
183
+ */
184
+ declare const DENSITY_VAR: "--noctis-seed-density";
185
+ //#endregion
186
+ export { BREAKPOINTS, DENSITY_VAR, EASINGS, FONT_SCALE_VAR, FONT_SIZES, FONT_WEIGHTS, RADII, RADIUS_VAR, SPEEDS, Z_INDEX };
package/dist/scales.js ADDED
@@ -0,0 +1,186 @@
1
+ //#region src/scales.ts
2
+ /**
3
+ * The foundation scales — typography, radius, motion, z-index, breakpoints — as data.
4
+ *
5
+ * These mirror the values declared in `tokens.css` (which is what the app actually consumes)
6
+ * and exist so the debug reference page can list them and so the scale stays documented in
7
+ * one typed place. The engine owns color + shadows.
8
+ */
9
+ /** Named font sizes (rem base, before the `--noctis-seed-font-scale` multiplier) and their Tailwind utility. */
10
+ const FONT_SIZES = {
11
+ micro: {
12
+ rem: .6875,
13
+ utility: "text-micro"
14
+ },
15
+ mini: {
16
+ rem: .75,
17
+ utility: "text-mini"
18
+ },
19
+ small: {
20
+ rem: .8125,
21
+ utility: "text-small"
22
+ },
23
+ regular: {
24
+ rem: .9375,
25
+ utility: "text-regular"
26
+ },
27
+ large: {
28
+ rem: 1.125,
29
+ utility: "text-large"
30
+ },
31
+ "title-3": {
32
+ rem: 1.25,
33
+ utility: "text-title-3"
34
+ },
35
+ "title-2": {
36
+ rem: 1.5,
37
+ utility: "text-title-2"
38
+ },
39
+ "title-1": {
40
+ rem: 2.25,
41
+ utility: "text-title-1"
42
+ }
43
+ };
44
+ /** Font weights (Inter's variable steps) and their Tailwind utility. */
45
+ const FONT_WEIGHTS = {
46
+ light: {
47
+ value: 300,
48
+ utility: "font-light"
49
+ },
50
+ normal: {
51
+ value: 450,
52
+ utility: "font-normal"
53
+ },
54
+ medium: {
55
+ value: 500,
56
+ utility: "font-medium"
57
+ },
58
+ semibold: {
59
+ value: 600,
60
+ utility: "font-semibold"
61
+ },
62
+ bold: {
63
+ value: 700,
64
+ utility: "font-bold"
65
+ },
66
+ extrabold: {
67
+ value: 800,
68
+ utility: "font-extrabold"
69
+ },
70
+ black: {
71
+ value: 900,
72
+ utility: "font-black"
73
+ }
74
+ };
75
+ /**
76
+ * Corner radii and their Tailwind utility. Every box step derives from the `--radius` knob
77
+ * ({@link RADIUS_VAR}), so one root value scales the whole UI live. Noctis is pill by default — the
78
+ * knob is `9999px`, so short interactive controls (buttons, chips, inputs, segmented) read as true
79
+ * pills while SURFACES stay capped. Each box step is `min()`-capped so surfaces (cards, sheets,
80
+ * popovers) stay bounded and never become pills, no matter how large the knob — a pill card never reads
81
+ * right. `full` is the only fully-round value (a constant) for genuine circles. `control` is the
82
+ * exception: it follows the knob uncapped, so controls reach a true pill at the Pill default (and go
83
+ * square when the knob is dialled to 0).
84
+ */
85
+ const RADII = {
86
+ xs: {
87
+ value: "min(calc(var(--noctis-seed-radius) * 0.5), 0.375rem)",
88
+ utility: "rounded-xs"
89
+ },
90
+ sm: {
91
+ value: "min(calc(var(--noctis-seed-radius) * 0.75), 0.5rem)",
92
+ utility: "rounded-sm"
93
+ },
94
+ md: {
95
+ value: "min(var(--noctis-seed-radius), 0.625rem)",
96
+ utility: "rounded-md"
97
+ },
98
+ lg: {
99
+ value: "min(calc(var(--noctis-seed-radius) * 1.5), 0.875rem)",
100
+ utility: "rounded-lg"
101
+ },
102
+ xl: {
103
+ value: "min(calc(var(--noctis-seed-radius) * 2), 1.25rem)",
104
+ utility: "rounded-xl"
105
+ },
106
+ full: {
107
+ value: "9999px",
108
+ utility: "rounded-full"
109
+ },
110
+ control: {
111
+ value: "var(--noctis-seed-radius)",
112
+ utility: "rounded-control"
113
+ }
114
+ };
115
+ /** Easing curves and their Tailwind utility. */
116
+ const EASINGS = {
117
+ standard: {
118
+ value: "cubic-bezier(0.25, 0.46, 0.45, 0.94)",
119
+ utility: "ease-standard"
120
+ },
121
+ in: {
122
+ value: "cubic-bezier(0.55, 0.055, 0.675, 0.19)",
123
+ utility: "ease-in"
124
+ },
125
+ out: {
126
+ value: "cubic-bezier(0.215, 0.61, 0.355, 1)",
127
+ utility: "ease-out"
128
+ },
129
+ "in-out": {
130
+ value: "cubic-bezier(0.645, 0.045, 0.355, 1)",
131
+ utility: "ease-in-out"
132
+ },
133
+ overlay: {
134
+ value: "cubic-bezier(0.32, 0.72, 0, 1)",
135
+ utility: "ease-overlay"
136
+ }
137
+ };
138
+ /**
139
+ * Transition speeds, bridged into the `duration-…` utilities and read as `var(--noctis-duration-…)`.
140
+ * `quick` is the library-wide control-feedback stop; `overlay` drives modal-overlay motion.
141
+ */
142
+ const SPEEDS = {
143
+ fast: "0.1s",
144
+ quick: "0.15s",
145
+ regular: "0.2s",
146
+ slow: "0.35s",
147
+ overlay: "0.26s"
148
+ };
149
+ /** Named stacking contexts, bridged into the `z-…` utilities and read as `var(--z-…)`. */
150
+ const Z_INDEX = {
151
+ base: 0,
152
+ raised: 1,
153
+ dropdown: 1e3,
154
+ sticky: 1100,
155
+ overlay: 1300,
156
+ modal: 1400,
157
+ popover: 1500,
158
+ toast: 1700
159
+ };
160
+ /** Responsive breakpoints (Tailwind `sm:`/`md:`/… prefixes). */
161
+ const BREAKPOINTS = {
162
+ sm: "40rem",
163
+ md: "48rem",
164
+ lg: "64rem",
165
+ xl: "80rem",
166
+ "2xl": "96rem"
167
+ };
168
+ /**
169
+ * The seed variable that scales the entire type ramp. Set on `:root` (System Controls, host tweaks),
170
+ * it resizes every named `text-*` utility live, since each size is a `calc()` of its base times this seed.
171
+ */
172
+ const FONT_SCALE_VAR = "--noctis-seed-font-scale";
173
+ /**
174
+ * The seed variable the whole radius scale derives from. Set on `:root` (System Controls, host tweaks),
175
+ * it rounds every `rounded-*` utility live, since each {@link RADII} step is a `calc()` of this seed.
176
+ * `9999px` is the pill Noctis default (controls go fully round; surfaces stay capped).
177
+ */
178
+ const RADIUS_VAR = "--noctis-seed-radius";
179
+ /**
180
+ * The seed variable that tunes spacing density. Set on `:root` (System Controls, host tweaks), it tightens
181
+ * or loosens the spacing ramp, control heights, and region padding, each a `calc()` over this seed. `1` is
182
+ * the default; focus-ring geometry and border widths stay fixed.
183
+ */
184
+ const DENSITY_VAR = "--noctis-seed-density";
185
+ //#endregion
186
+ export { BREAKPOINTS, DENSITY_VAR, EASINGS, FONT_SCALE_VAR, FONT_SIZES, FONT_WEIGHTS, RADII, RADIUS_VAR, SPEEDS, Z_INDEX };
@@ -0,0 +1,36 @@
1
+ import { TokenBridge, TokenGroup } from "./graph/model.js";
2
+ import { ThemeVar } from "@stridge/noctis-theme-engine";
3
+
4
+ //#region src/semantic.d.ts
5
+ /** Shared shape for a token entry (engine-backed entries also carry a `primitive`). */
6
+ interface TokenBase {
7
+ readonly role: string;
8
+ readonly label: string;
9
+ readonly cssVar: `--noctis-${string}`;
10
+ readonly utility: string;
11
+ readonly group: TokenGroup;
12
+ readonly bridge?: TokenBridge;
13
+ readonly description: string;
14
+ /** The component surfaces this token drives across the app. */
15
+ readonly usage: string;
16
+ }
17
+ /** An engine-backed semantic role: resolves to one generated primitive. */
18
+ interface SemanticRole extends TokenBase {
19
+ readonly primitive: ThemeVar;
20
+ }
21
+ /** An authored static token: a value the engine does not generate. */
22
+ type StaticToken = TokenBase;
23
+ /** The engine-backed semantic role set, in display order — a view over the graph's semantic tier. */
24
+ declare const SEMANTIC_ROLES: readonly SemanticRole[];
25
+ /** Authored static tokens (accent-independent; no engine primitive) — a view over the graph. */
26
+ declare const STATIC_TOKENS: readonly StaticToken[];
27
+ /** An elevation scope a `data-elevation` subtree adopts (a full re-generated, consistent set). */
28
+ interface ElevationScope {
29
+ readonly level: "elevated" | "menu" | "sunken";
30
+ readonly attribute: string;
31
+ readonly description: string;
32
+ }
33
+ /** The elevation scopes the layer ships. Scopes are absolute (not relative/compounding). */
34
+ declare const ELEVATION_SCOPES: readonly ElevationScope[];
35
+ //#endregion
36
+ export { ELEVATION_SCOPES, ElevationScope, SEMANTIC_ROLES, STATIC_TOKENS, SemanticRole, StaticToken };
@@ -0,0 +1,49 @@
1
+ import { ROLE_VAR_PREFIX } from "./graph/registry.js";
2
+ import { serializeTokenName } from "./graph/serialize.js";
3
+ import { cssVarName } from "./graph/model.js";
4
+ import { SEMANTIC_TOKENS } from "./graph/roles.js";
5
+ import { STATIC_SEMANTIC_TOKENS } from "./graph/statics.js";
6
+ import "./graph/index.js";
7
+ //#region src/semantic.ts
8
+ function base(token) {
9
+ return {
10
+ role: serializeTokenName(token.name),
11
+ label: token.label ?? "",
12
+ cssVar: cssVarName(token, ROLE_VAR_PREFIX),
13
+ utility: token.utility ?? "",
14
+ group: token.group ?? "utility",
15
+ ...token.bridge ? { bridge: token.bridge } : {},
16
+ description: token.description,
17
+ usage: token.usage
18
+ };
19
+ }
20
+ /** The engine-backed semantic role set, in display order — a view over the graph's semantic tier. */
21
+ const SEMANTIC_ROLES = SEMANTIC_TOKENS.map((token) => {
22
+ if (!("primitive" in token.value)) throw new Error(`role "${serializeTokenName(token.name)}" is not engine-backed`);
23
+ return {
24
+ ...base(token),
25
+ primitive: token.value.primitive
26
+ };
27
+ });
28
+ /** Authored static tokens (accent-independent; no engine primitive) — a view over the graph. */
29
+ const STATIC_TOKENS = STATIC_SEMANTIC_TOKENS.map(base);
30
+ /** The elevation scopes the layer ships. Scopes are absolute (not relative/compounding). */
31
+ const ELEVATION_SCOPES = [
32
+ {
33
+ level: "elevated",
34
+ attribute: "data-elevation=\"elevated\"",
35
+ description: "Raised surfaces — dialogs, sheets, drawers, popovers, tooltips."
36
+ },
37
+ {
38
+ level: "menu",
39
+ attribute: "data-elevation=\"menu\"",
40
+ description: "Highest float — dropdown and context menus, select listboxes, the command palette."
41
+ },
42
+ {
43
+ level: "sunken",
44
+ attribute: "data-elevation=\"sunken\"",
45
+ description: "Recessed regions — sidebars and content wells."
46
+ }
47
+ ];
48
+ //#endregion
49
+ export { ELEVATION_SCOPES, SEMANTIC_ROLES, STATIC_TOKENS };
@@ -0,0 +1,24 @@
1
+ //#region src/swatches.d.ts
2
+ /**
3
+ * Seed swatches for the preference controls — the accent and background options a user (or the
4
+ * debug tweak panel) can pick. Each is an OKLCH seed fed straight into the theme engine, which
5
+ * regenerates a full, contrast-correct token set around it. Authoring raw OKLCH is the token
6
+ * layer's job (the same as the brand presets), so these live here rather than in app code.
7
+ */
8
+ /** A named color seed offered as a swatch. */
9
+ interface ThemeSwatch {
10
+ /** Display name shown as the control's accessible label. */
11
+ name: string;
12
+ /** OKLCH seed handed to the theme engine. */
13
+ value: string;
14
+ }
15
+ /** Accent options spread across the hue wheel at a consistent lightness/chroma so each calibrates well.
16
+ * The first is the brand accent itself — kept identical to `defaultPreset.accent` so the shipped Dark
17
+ * theme lights up its own swatch (and the readout names it) rather than reading as a custom color. */
18
+ declare const ACCENT_SWATCHES: readonly ThemeSwatch[];
19
+ /** Background options — the base lightness the engine reads to resolve light vs dark and the full ramp.
20
+ * The first is the brand canvas itself — kept identical to `defaultPreset.background` so the shipped
21
+ * Dark theme lights up its own swatch. `Light` already matches the Light preset's canvas. */
22
+ declare const BACKGROUND_SWATCHES: readonly ThemeSwatch[];
23
+ //#endregion
24
+ export { ACCENT_SWATCHES, BACKGROUND_SWATCHES, ThemeSwatch };