@kuniversedev/design-tokens 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/css.js ADDED
@@ -0,0 +1,311 @@
1
+ // src/index.ts
2
+ var colorsImpl = {
3
+ // Base neutrals
4
+ black: "#000000",
5
+ white: "#FFFFFF",
6
+ gray: {
7
+ 100: "#F5F5F5",
8
+ 300: "#D4D4D4",
9
+ 500: "#737373",
10
+ 700: "#404040",
11
+ 900: "#171717"
12
+ },
13
+ // Dark mode semantic surfaces
14
+ background: "#0A0A0A",
15
+ surface: "#1A1A1A",
16
+ foreground: "#FFFFFF",
17
+ muted: "#2A2A2A",
18
+ border: "#333333",
19
+ // Accent / status
20
+ primary: "#0066FF",
21
+ secondary: "#00CC88",
22
+ success: "#00DD77",
23
+ error: "#FF3333",
24
+ warning: "#FFAA00"
25
+ };
26
+ var typographyImpl = {
27
+ fontFamily: {
28
+ sans: 'Power Grotesk, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
29
+ mono: 'JetBrains Mono, "Fira Code", monospace',
30
+ display: 'Power Grotesk, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'
31
+ },
32
+ scale: {
33
+ hero: { size: "4rem", lineHeight: "1.125", weight: 700 },
34
+ // 64px
35
+ h1: { size: "3rem", lineHeight: "1.167", weight: 700 },
36
+ // 48px
37
+ h2: { size: "2rem", lineHeight: "1.25", weight: 600 },
38
+ // 32px
39
+ h3: { size: "1.5rem", lineHeight: "1.333", weight: 600 },
40
+ // 24px
41
+ body: { size: "1rem", lineHeight: "1.5", weight: 400 },
42
+ // 16px
43
+ small: { size: "0.875rem", lineHeight: "1.429", weight: 400 },
44
+ // 14px
45
+ tiny: { size: "0.75rem", lineHeight: "1.333", weight: 400 }
46
+ // 12px
47
+ },
48
+ fontWeight: {
49
+ thin: 200,
50
+ light: 300,
51
+ regular: 400,
52
+ medium: 500,
53
+ semibold: 600,
54
+ bold: 700,
55
+ black: 900
56
+ }
57
+ };
58
+ var spacingImpl = {
59
+ 0: "0",
60
+ 1: "4px",
61
+ 2: "8px",
62
+ 3: "12px",
63
+ 4: "16px",
64
+ 5: "20px",
65
+ 6: "24px",
66
+ 7: "28px",
67
+ 8: "32px",
68
+ 9: "36px",
69
+ 10: "40px",
70
+ 12: "48px",
71
+ 14: "56px",
72
+ 15: "60px",
73
+ // K-Universe 60px margin principle
74
+ 16: "64px",
75
+ 18: "72px",
76
+ 20: "80px",
77
+ 24: "96px",
78
+ 32: "128px"
79
+ };
80
+ var motionImpl = {
81
+ duration: {
82
+ instant: "100ms",
83
+ fast: "200ms",
84
+ default: "300ms",
85
+ slow: "500ms",
86
+ crawl: "800ms"
87
+ },
88
+ easing: {
89
+ default: "cubic-bezier(0.4, 0, 0.2, 1)",
90
+ smooth: "cubic-bezier(0.25, 0.1, 0.25, 1)",
91
+ sharp: "cubic-bezier(0.4, 0, 0.6, 1)",
92
+ accelerate: "cubic-bezier(0.4, 0, 1, 1)",
93
+ decelerate: "cubic-bezier(0, 0, 0.2, 1)"
94
+ }
95
+ };
96
+ var layoutImpl = {
97
+ margin: "60px",
98
+ // primary horizontal landmark
99
+ sectionSpacing: "96px",
100
+ container: {
101
+ sm: "640px",
102
+ md: "768px",
103
+ lg: "1024px",
104
+ xl: "1280px",
105
+ max: "1320px"
106
+ // K-Universe max-width
107
+ },
108
+ measure: "65ch"
109
+ };
110
+ var radiusImpl = {
111
+ none: "0",
112
+ xs: "2px",
113
+ sm: "4px",
114
+ md: "6px",
115
+ lg: "8px",
116
+ xl: "12px",
117
+ "2xl": "16px",
118
+ "3xl": "24px",
119
+ round: "9999px"
120
+ };
121
+ var shadowsImpl = {
122
+ xs: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
123
+ sm: "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)",
124
+ md: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)",
125
+ lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",
126
+ xl: "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)",
127
+ "2xl": "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
128
+ inner: "inset 0 2px 4px 0 rgba(0, 0, 0, 0.05)",
129
+ cardHover: "0 20px 55px rgba(0, 0, 0, 0.55)",
130
+ elevated: "0 24px 60px rgba(0, 0, 0, 0.45)"
131
+ };
132
+ var zIndexImpl = {
133
+ bg: -1,
134
+ base: 0,
135
+ content: 10,
136
+ dropdown: 100,
137
+ sticky: 200,
138
+ overlay: 300,
139
+ modal: 400,
140
+ popover: 500,
141
+ tooltip: 600,
142
+ toast: 700
143
+ };
144
+ var borderWidthImpl = {
145
+ thin: "1px",
146
+ base: "2px",
147
+ thick: "4px"
148
+ };
149
+ var tokens = {
150
+ colors: colorsImpl,
151
+ typography: typographyImpl,
152
+ spacing: spacingImpl,
153
+ motion: motionImpl,
154
+ layout: layoutImpl,
155
+ radius: radiusImpl,
156
+ shadows: shadowsImpl,
157
+ zIndex: zIndexImpl,
158
+ borderWidth: borderWidthImpl
159
+ };
160
+ var colors = tokens.colors;
161
+ var typography = tokens.typography;
162
+ var spacing = tokens.spacing;
163
+ var motion = tokens.motion;
164
+ var layout = tokens.layout;
165
+ var radius = tokens.radius;
166
+ var shadows = tokens.shadows;
167
+ var zIndex = tokens.zIndex;
168
+ var borderWidth = tokens.borderWidth;
169
+
170
+ // src/css-vars.ts
171
+ function toKebab(str) {
172
+ return str.replace(/([a-z\d])([A-Z])/g, "$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").toLowerCase();
173
+ }
174
+ var CATEGORY_PREFIXES = {
175
+ colors: "color",
176
+ typography: "",
177
+ // further split per sub-key (font-family, scale, font-weight)
178
+ spacing: "spacing",
179
+ motion: "",
180
+ // split: duration, easing
181
+ layout: "layout",
182
+ radius: "radius",
183
+ shadows: "shadow",
184
+ zIndex: "z-index",
185
+ borderWidth: "border-width"
186
+ };
187
+ function flattenTokens(obj, prefix) {
188
+ if (obj === null || obj === void 0) return [];
189
+ if (typeof obj !== "object" || Array.isArray(obj)) {
190
+ return [[`--${prefix}`, String(obj)]];
191
+ }
192
+ const pairs = [];
193
+ for (const [key, value] of Object.entries(obj)) {
194
+ const segment = toKebab(key);
195
+ const nextPrefix = prefix ? `${prefix}-${segment}` : segment;
196
+ pairs.push(...flattenTokens(value, nextPrefix));
197
+ }
198
+ return pairs;
199
+ }
200
+ function pairsForCategory(categoryKey, value) {
201
+ const prefix = CATEGORY_PREFIXES[categoryKey];
202
+ return flattenTokens(value, prefix);
203
+ }
204
+ function buildPairs(t) {
205
+ const pairs = [];
206
+ for (const key of Object.keys(t)) {
207
+ pairs.push(...pairsForCategory(key, t[key]));
208
+ }
209
+ return pairs;
210
+ }
211
+ function pairsToLines(pairs, indent = " ") {
212
+ return pairs.map(([name, val]) => `${indent}${name}: ${val};`).join("\n");
213
+ }
214
+ var SECTION_LABELS = {
215
+ colors: "Colors",
216
+ typography: "Typography",
217
+ spacing: "Spacing",
218
+ motion: "Motion",
219
+ layout: "Layout",
220
+ radius: "Border Radius",
221
+ shadows: "Shadows",
222
+ zIndex: "Z-Index",
223
+ borderWidth: "Border Width"
224
+ };
225
+ function buildSectionedCSSBody(t, indent = " ") {
226
+ const sections = [];
227
+ for (const key of Object.keys(t)) {
228
+ const label = SECTION_LABELS[key] ?? key;
229
+ const pairs = pairsForCategory(key, t[key]);
230
+ if (pairs.length === 0) continue;
231
+ sections.push(`${indent}/* ${label} */`);
232
+ sections.push(pairsToLines(pairs, indent));
233
+ }
234
+ return sections.join("\n");
235
+ }
236
+ var LIGHT_THEME_OVERRIDES = [
237
+ ["--color-background", "#FFFFFF"],
238
+ ["--color-foreground", "#000000"],
239
+ ["--color-surface", "#F5F5F5"],
240
+ ["--color-muted", "#E5E5E5"],
241
+ ["--color-border", "#D4D4D4"]
242
+ ];
243
+ function generateCSSVars(t, prefix) {
244
+ let pairs = buildPairs(t);
245
+ if (prefix) {
246
+ pairs = pairs.map(([name, val]) => [`--${prefix}-${name.slice(2)}`, val]);
247
+ }
248
+ return `:root {
249
+ ${pairsToLines(pairs)}
250
+ }`;
251
+ }
252
+ function generateDarkThemeCSS(t) {
253
+ const body = buildSectionedCSSBody(t);
254
+ return `:root {
255
+ ${body}
256
+ }`;
257
+ }
258
+ function generateLightThemeCSS(_t) {
259
+ const lines = LIGHT_THEME_OVERRIDES.map(([name, val]) => ` ${name}: ${val};`).join("\n");
260
+ return `[data-theme="light"] {
261
+ ${lines}
262
+ }`;
263
+ }
264
+ function generateCompleteCSS(t) {
265
+ return [
266
+ generateDarkThemeCSS(t),
267
+ "",
268
+ generateLightThemeCSS(t)
269
+ ].join("\n");
270
+ }
271
+ function applyCSSVarsToDocument(theme) {
272
+ if (typeof document === "undefined") return;
273
+ const root = document.documentElement;
274
+ const pairs = buildPairs(tokens);
275
+ for (const [name, value] of pairs) {
276
+ root.style.setProperty(name, value);
277
+ }
278
+ if (theme === "light") {
279
+ root.setAttribute("data-theme", "light");
280
+ for (const [name, value] of LIGHT_THEME_OVERRIDES) {
281
+ root.style.setProperty(name, value);
282
+ }
283
+ } else {
284
+ root.removeAttribute("data-theme");
285
+ }
286
+ }
287
+ function getCSSVar(name) {
288
+ if (typeof document === "undefined") return "";
289
+ return getComputedStyle(document.documentElement).getPropertyValue(name).trim();
290
+ }
291
+ function setCSSVar(name, value) {
292
+ if (typeof document === "undefined") return;
293
+ document.documentElement.style.setProperty(name, value);
294
+ }
295
+ var cssVarsString = generateCSSVars(tokens);
296
+ var darkThemeCSS = generateDarkThemeCSS(tokens);
297
+ var lightThemeCSS = generateLightThemeCSS(tokens);
298
+ export {
299
+ applyCSSVarsToDocument,
300
+ cssVarsString,
301
+ darkThemeCSS,
302
+ flattenTokens,
303
+ generateCSSVars,
304
+ generateCompleteCSS,
305
+ generateDarkThemeCSS,
306
+ generateLightThemeCSS,
307
+ getCSSVar,
308
+ lightThemeCSS,
309
+ setCSSVar
310
+ };
311
+ //# sourceMappingURL=css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/css-vars.ts"],"sourcesContent":["/**\n * @k-universe/design-tokens\n *\n * Foundational design token implementation for K-Universe.\n * All values are authoritative — derived from the K-Universe design system spec.\n *\n * @example\n * ```typescript\n * import { tokens } from \"@k-universe/design-tokens\";\n *\n * tokens.colors.background // '#0A0A0A'\n * tokens.colors.foreground // '#FFFFFF'\n * tokens.colors.secondary // '#00CC88'\n * tokens.typography.fontFamily.sans // 'Power Grotesk, ...'\n * ```\n */\n\n// Re-export all types from the types module\nexport type {\n ColorToken,\n DimensionToken,\n DurationToken,\n EasingToken,\n ShadowToken,\n ColorScale,\n ColorTokens,\n TypeScaleEntry,\n FontFamilyTokens,\n TypeScaleTokens,\n FontWeightTokens,\n TypographyTokens,\n SpacingTokens,\n DurationTokens,\n EasingTokens,\n MotionTokens,\n ContainerTokens,\n LayoutTokens,\n RadiusTokens,\n ShadowTokens,\n ZIndexTokens,\n BorderWidthTokens,\n DesignTokens,\n} from './types.js';\n\nimport type { DesignTokens } from './types.js';\n\n// ---------------------------------------------------------------------------\n// Colors\n// ---------------------------------------------------------------------------\n\nconst colorsImpl = {\n // Base neutrals\n black: '#000000',\n white: '#FFFFFF',\n gray: {\n 100: '#F5F5F5',\n 300: '#D4D4D4',\n 500: '#737373',\n 700: '#404040',\n 900: '#171717',\n },\n\n // Dark mode semantic surfaces\n background: '#0A0A0A',\n surface: '#1A1A1A',\n foreground: '#FFFFFF',\n muted: '#2A2A2A',\n border: '#333333',\n\n // Accent / status\n primary: '#0066FF',\n secondary: '#00CC88',\n success: '#00DD77',\n error: '#FF3333',\n warning: '#FFAA00',\n} as const satisfies DesignTokens['colors'];\n\n// ---------------------------------------------------------------------------\n// Typography\n// ---------------------------------------------------------------------------\n\nconst typographyImpl = {\n fontFamily: {\n sans: 'Power Grotesk, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif',\n mono: 'JetBrains Mono, \"Fira Code\", monospace',\n display: 'Power Grotesk, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif',\n },\n\n scale: {\n hero: { size: '4rem', lineHeight: '1.125', weight: 700 }, // 64px\n h1: { size: '3rem', lineHeight: '1.167', weight: 700 }, // 48px\n h2: { size: '2rem', lineHeight: '1.25', weight: 600 }, // 32px\n h3: { size: '1.5rem', lineHeight: '1.333', weight: 600 }, // 24px\n body: { size: '1rem', lineHeight: '1.5', weight: 400 }, // 16px\n small: { size: '0.875rem', lineHeight: '1.429', weight: 400 }, // 14px\n tiny: { size: '0.75rem', lineHeight: '1.333', weight: 400 }, // 12px\n },\n\n fontWeight: {\n thin: 200,\n light: 300,\n regular: 400,\n medium: 500,\n semibold: 600,\n bold: 700,\n black: 900,\n },\n} as const satisfies DesignTokens['typography'];\n\n// ---------------------------------------------------------------------------\n// Spacing — 8px base grid\n// ---------------------------------------------------------------------------\n\nconst spacingImpl = {\n 0: '0',\n 1: '4px',\n 2: '8px',\n 3: '12px',\n 4: '16px',\n 5: '20px',\n 6: '24px',\n 7: '28px',\n 8: '32px',\n 9: '36px',\n 10: '40px',\n 12: '48px',\n 14: '56px',\n 15: '60px', // K-Universe 60px margin principle\n 16: '64px',\n 18: '72px',\n 20: '80px',\n 24: '96px',\n 32: '128px',\n} as const satisfies DesignTokens['spacing'];\n\n// ---------------------------------------------------------------------------\n// Motion\n// ---------------------------------------------------------------------------\n\nconst motionImpl = {\n duration: {\n instant: '100ms',\n fast: '200ms',\n default: '300ms',\n slow: '500ms',\n crawl: '800ms',\n },\n\n easing: {\n default: 'cubic-bezier(0.4, 0, 0.2, 1)',\n smooth: 'cubic-bezier(0.25, 0.1, 0.25, 1)',\n sharp: 'cubic-bezier(0.4, 0, 0.6, 1)',\n accelerate: 'cubic-bezier(0.4, 0, 1, 1)',\n decelerate: 'cubic-bezier(0, 0, 0.2, 1)',\n },\n} as const satisfies DesignTokens['motion'];\n\n// ---------------------------------------------------------------------------\n// Layout\n// ---------------------------------------------------------------------------\n\nconst layoutImpl = {\n margin: '60px', // primary horizontal landmark\n sectionSpacing: '96px',\n container: {\n sm: '640px',\n md: '768px',\n lg: '1024px',\n xl: '1280px',\n max: '1320px', // K-Universe max-width\n },\n measure: '65ch',\n} as const satisfies DesignTokens['layout'];\n\n// ---------------------------------------------------------------------------\n// Border radius\n// ---------------------------------------------------------------------------\n\nconst radiusImpl = {\n none: '0',\n xs: '2px',\n sm: '4px',\n md: '6px',\n lg: '8px',\n xl: '12px',\n '2xl': '16px',\n '3xl': '24px',\n round: '9999px',\n} as const satisfies DesignTokens['radius'];\n\n// ---------------------------------------------------------------------------\n// Shadows — neutral black only, no colored glow\n// ---------------------------------------------------------------------------\n\nconst shadowsImpl = {\n xs: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',\n sm: '0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)',\n md: '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)',\n lg: '0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)',\n xl: '0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)',\n '2xl': '0 25px 50px -12px rgba(0, 0, 0, 0.25)',\n inner: 'inset 0 2px 4px 0 rgba(0, 0, 0, 0.05)',\n cardHover: '0 20px 55px rgba(0, 0, 0, 0.55)',\n elevated: '0 24px 60px rgba(0, 0, 0, 0.45)',\n} as const satisfies DesignTokens['shadows'];\n\n// ---------------------------------------------------------------------------\n// Z-index\n// ---------------------------------------------------------------------------\n\nconst zIndexImpl = {\n bg: -1,\n base: 0,\n content: 10,\n dropdown: 100,\n sticky: 200,\n overlay: 300,\n modal: 400,\n popover: 500,\n tooltip: 600,\n toast: 700,\n} as const satisfies DesignTokens['zIndex'];\n\n// ---------------------------------------------------------------------------\n// Border width\n// ---------------------------------------------------------------------------\n\nconst borderWidthImpl = {\n thin: '1px',\n base: '2px',\n thick: '4px',\n} as const satisfies DesignTokens['borderWidth'];\n\n// ---------------------------------------------------------------------------\n// Root tokens object\n// ---------------------------------------------------------------------------\n\n/**\n * Primary design tokens export.\n *\n * @example\n * ```typescript\n * import { tokens } from \"@k-universe/design-tokens\";\n *\n * tokens.colors.background // '#0A0A0A'\n * tokens.colors.foreground // '#FFFFFF'\n * tokens.colors.secondary // '#00CC88'\n * tokens.typography.fontFamily.sans // 'Power Grotesk, ...'\n * tokens.spacing[15] // '60px' — 60px margin principle\n * tokens.motion.duration.default // '300ms'\n * ```\n */\nexport const tokens: DesignTokens = {\n colors: colorsImpl,\n typography: typographyImpl,\n spacing: spacingImpl,\n motion: motionImpl,\n layout: layoutImpl,\n radius: radiusImpl,\n shadows: shadowsImpl,\n zIndex: zIndexImpl,\n borderWidth: borderWidthImpl,\n};\n\n// ---------------------------------------------------------------------------\n// Convenience shortcut exports\n// ---------------------------------------------------------------------------\n\n/** Alias for tokens — backwards compatibility. */\nexport const designTokens: DesignTokens = tokens;\n\n/** Shortcut: tokens.colors */\nexport const colors = tokens.colors;\n\n/** Shortcut: tokens.typography */\nexport const typography = tokens.typography;\n\n/** Shortcut: tokens.spacing */\nexport const spacing = tokens.spacing;\n\n/** Shortcut: tokens.motion */\nexport const motion = tokens.motion;\n\n/** Shortcut: tokens.layout */\nexport const layout = tokens.layout;\n\n/** Shortcut: tokens.radius */\nexport const radius = tokens.radius;\n\n/** Shortcut: tokens.shadows */\nexport const shadows = tokens.shadows;\n\n/** Shortcut: tokens.zIndex */\nexport const zIndex = tokens.zIndex;\n\n/** Shortcut: tokens.borderWidth */\nexport const borderWidth = tokens.borderWidth;\n\n// ---------------------------------------------------------------------------\n// Utility: mergeTokens\n// ---------------------------------------------------------------------------\n\ntype DeepPartial<T> = {\n [K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];\n};\n\n/**\n * Deep-merges override tokens into a base token set.\n * Returns a new object — does not mutate the base.\n *\n * @example\n * ```typescript\n * import { tokens, mergeTokens } from \"@k-universe/design-tokens\";\n *\n * const theme = mergeTokens(tokens, {\n * colors: { primary: '#FF6600' },\n * });\n * ```\n */\nexport function mergeTokens(\n base: DesignTokens,\n overrides: DeepPartial<DesignTokens>,\n): DesignTokens {\n return deepMerge(base, overrides) as DesignTokens;\n}\n\nfunction deepMerge<T extends object>(target: T, source: DeepPartial<T>): T {\n const result: T = { ...target };\n\n for (const key in source) {\n if (!Object.prototype.hasOwnProperty.call(source, key)) continue;\n\n const sourceVal = source[key as keyof typeof source];\n const targetVal = target[key as keyof T];\n\n if (\n sourceVal !== null &&\n typeof sourceVal === 'object' &&\n !Array.isArray(sourceVal) &&\n targetVal !== null &&\n typeof targetVal === 'object' &&\n !Array.isArray(targetVal)\n ) {\n (result as Record<string, unknown>)[key] = deepMerge(\n targetVal as object,\n sourceVal as DeepPartial<typeof targetVal>,\n );\n } else if (sourceVal !== undefined) {\n (result as Record<string, unknown>)[key] = sourceVal;\n }\n }\n\n return result;\n}\n\n// ---------------------------------------------------------------------------\n// Utility: getTokenByPath\n// ---------------------------------------------------------------------------\n\n/**\n * Retrieves a token value using dot-notation path access.\n *\n * @param obj - The token object to traverse (typically `tokens`).\n * @param path - Dot-notation path string, e.g. `'colors.primary'`.\n * @returns The value at the given path, or `undefined` if not found.\n *\n * @example\n * ```typescript\n * import { tokens, getTokenByPath } from \"@k-universe/design-tokens\";\n *\n * getTokenByPath(tokens, 'colors.primary') // '#0066FF'\n * getTokenByPath(tokens, 'motion.duration.default') // '300ms'\n * getTokenByPath(tokens, 'spacing.15') // '60px'\n * ```\n */\nexport function getTokenByPath(\n obj: unknown,\n path: string,\n): unknown {\n if (!path) return obj;\n\n const segments = path.split('.');\n let current: unknown = obj;\n\n for (const segment of segments) {\n if (current === null || current === undefined) return undefined;\n if (typeof current !== 'object') return undefined;\n current = (current as Record<string, unknown>)[segment];\n }\n\n return current;\n}\n","/**\n * @k-universe/design-tokens — CSS custom properties generation\n *\n * Generates CSS variable strings from the token object and provides\n * browser utilities for applying / reading / writing CSS vars at runtime.\n *\n * Package exports needed (add to package.json exports — handled by Agent 5 / build config):\n * \"./css\": \"./src/css-vars.ts\"\n * \"./standalone/css\": \"./src/standalone/tokens.css\"\n */\n\n// Package exports needed: \"./css\": \"./src/css-vars.ts\", \"./standalone/css\": \"./src/standalone/tokens.css\"\n\nimport type { DesignTokens } from './types.js';\nimport { tokens } from './index.js';\n\n// ---------------------------------------------------------------------------\n// Internal: camelCase / PascalCase → kebab-case\n// ---------------------------------------------------------------------------\n\n/**\n * Converts a camelCase or PascalCase segment to kebab-case.\n * Numeric-only segments are left as-is (e.g. '100', '2xl').\n */\nfunction toKebab(str: string): string {\n return str\n // Insert hyphen before uppercase letters that follow a lowercase/digit\n .replace(/([a-z\\d])([A-Z])/g, '$1-$2')\n // Insert hyphen before uppercase letters that are followed by lowercase (e.g. XMLParser → xml-parser)\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1-$2')\n .toLowerCase();\n}\n\n// ---------------------------------------------------------------------------\n// Internal: CSS-var name prefix map per top-level token category\n// ---------------------------------------------------------------------------\n\nconst CATEGORY_PREFIXES: Record<string, string> = {\n colors: 'color',\n typography: '', // further split per sub-key (font-family, scale, font-weight)\n spacing: 'spacing',\n motion: '', // split: duration, easing\n layout: 'layout',\n radius: 'radius',\n shadows: 'shadow',\n zIndex: 'z-index',\n borderWidth: 'border-width',\n};\n\n// ---------------------------------------------------------------------------\n// Internal: flattenTokens\n// ---------------------------------------------------------------------------\n\n/**\n * Recursively walks an object and produces a flat array of\n * `['--name', 'value']` pairs for every leaf node.\n *\n * @param obj - The (sub-)object to walk.\n * @param prefix - Accumulated CSS-var name prefix (without leading `--`).\n * @returns Array of `[varName, value]` tuples.\n */\nexport function flattenTokens(\n obj: unknown,\n prefix: string,\n): Array<[string, string]> {\n if (obj === null || obj === undefined) return [];\n\n if (typeof obj !== 'object' || Array.isArray(obj)) {\n // Leaf value — emit the var\n return [[`--${prefix}`, String(obj)]];\n }\n\n const pairs: Array<[string, string]> = [];\n\n for (const [key, value] of Object.entries(obj as Record<string, unknown>)) {\n const segment = toKebab(key);\n const nextPrefix = prefix ? `${prefix}-${segment}` : segment;\n pairs.push(...flattenTokens(value, nextPrefix));\n }\n\n return pairs;\n}\n\n// ---------------------------------------------------------------------------\n// Internal: build pairs for one top-level token category\n// ---------------------------------------------------------------------------\n\nfunction pairsForCategory(\n categoryKey: keyof DesignTokens,\n value: unknown,\n): Array<[string, string]> {\n const prefix = CATEGORY_PREFIXES[categoryKey as string];\n return flattenTokens(value, prefix);\n}\n\n// ---------------------------------------------------------------------------\n// Internal: build the full flat pairs map from a DesignTokens object\n// ---------------------------------------------------------------------------\n\nfunction buildPairs(t: DesignTokens): Array<[string, string]> {\n const pairs: Array<[string, string]> = [];\n\n for (const key of Object.keys(t) as Array<keyof DesignTokens>) {\n pairs.push(...pairsForCategory(key, t[key]));\n }\n\n return pairs;\n}\n\n// ---------------------------------------------------------------------------\n// Internal: pairs → CSS property lines, indented\n// ---------------------------------------------------------------------------\n\nfunction pairsToLines(pairs: Array<[string, string]>, indent = ' '): string {\n return pairs.map(([name, val]) => `${indent}${name}: ${val};`).join('\\n');\n}\n\n// ---------------------------------------------------------------------------\n// Internal: section-commented block builder\n// ---------------------------------------------------------------------------\n\nconst SECTION_LABELS: Partial<Record<keyof DesignTokens, string>> = {\n colors: 'Colors',\n typography: 'Typography',\n spacing: 'Spacing',\n motion: 'Motion',\n layout: 'Layout',\n radius: 'Border Radius',\n shadows: 'Shadows',\n zIndex: 'Z-Index',\n borderWidth: 'Border Width',\n};\n\nfunction buildSectionedCSSBody(t: DesignTokens, indent = ' '): string {\n const sections: string[] = [];\n\n for (const key of Object.keys(t) as Array<keyof DesignTokens>) {\n const label = SECTION_LABELS[key] ?? key;\n const pairs = pairsForCategory(key, t[key]);\n if (pairs.length === 0) continue;\n\n sections.push(`${indent}/* ${label} */`);\n sections.push(pairsToLines(pairs, indent));\n }\n\n return sections.join('\\n');\n}\n\n// ---------------------------------------------------------------------------\n// Light-theme overrides (semantic surface colours only)\n// ---------------------------------------------------------------------------\n\n/**\n * The light theme overrides only the semantic surface tokens.\n * All other tokens (spacing, motion, etc.) remain unchanged.\n */\nconst LIGHT_THEME_OVERRIDES: Array<[string, string]> = [\n ['--color-background', '#FFFFFF'],\n ['--color-foreground', '#000000'],\n ['--color-surface', '#F5F5F5'],\n ['--color-muted', '#E5E5E5'],\n ['--color-border', '#D4D4D4'],\n];\n\n// ---------------------------------------------------------------------------\n// Public: generateCSSVars\n// ---------------------------------------------------------------------------\n\n/**\n * Generates a `:root { ... }` CSS block string from a DesignTokens object.\n *\n * @param t - Token object to generate from.\n * @param prefix - Optional additional prefix for all var names (rarely needed).\n *\n * @example\n * ```typescript\n * import { generateCSSVars, tokens } from \"@k-universe/design-tokens/css\";\n * const css = generateCSSVars(tokens);\n * // \":root {\\n --color-background: #0A0A0A;\\n ...\\n}\"\n * ```\n */\nexport function generateCSSVars(t: DesignTokens, prefix?: string): string {\n let pairs = buildPairs(t);\n\n if (prefix) {\n pairs = pairs.map(([name, val]) => [`--${prefix}-${name.slice(2)}`, val]);\n }\n\n return `:root {\\n${pairsToLines(pairs)}\\n}`;\n}\n\n// ---------------------------------------------------------------------------\n// Public: generateDarkThemeCSS\n// ---------------------------------------------------------------------------\n\n/**\n * Generates the dark-theme `:root { ... }` block.\n * Dark mode is the default / primary context for K-Universe.\n *\n * @example\n * ```typescript\n * const css = generateDarkThemeCSS(tokens);\n * ```\n */\nexport function generateDarkThemeCSS(t: DesignTokens): string {\n const body = buildSectionedCSSBody(t);\n return `:root {\\n${body}\\n}`;\n}\n\n// ---------------------------------------------------------------------------\n// Public: generateLightThemeCSS\n// ---------------------------------------------------------------------------\n\n/**\n * Generates the `[data-theme=\"light\"] { ... }` override block.\n * Only overrides semantic surface colours — all other tokens are inherited.\n *\n * @example\n * ```typescript\n * const css = generateLightThemeCSS(tokens);\n * ```\n */\nexport function generateLightThemeCSS(_t: DesignTokens): string {\n const lines = LIGHT_THEME_OVERRIDES\n .map(([name, val]) => ` ${name}: ${val};`)\n .join('\\n');\n return `[data-theme=\"light\"] {\\n${lines}\\n}`;\n}\n\n// ---------------------------------------------------------------------------\n// Public: generateCompleteCSS\n// ---------------------------------------------------------------------------\n\n/**\n * Generates the complete CSS: dark `:root` block + light `[data-theme=\"light\"]` block.\n *\n * @example\n * ```typescript\n * import { generateCompleteCSS, tokens } from \"@k-universe/design-tokens/css\";\n *\n * // In a Next.js layout or global stylesheet:\n * const css = generateCompleteCSS(tokens);\n * ```\n */\nexport function generateCompleteCSS(t: DesignTokens): string {\n return [\n generateDarkThemeCSS(t),\n '',\n generateLightThemeCSS(t),\n ].join('\\n');\n}\n\n// ---------------------------------------------------------------------------\n// Public: applyCSSVarsToDocument\n// ---------------------------------------------------------------------------\n\n/**\n * Applies all design tokens as CSS custom properties to `document.documentElement`.\n * SSR-safe — no-ops when `document` is not available.\n *\n * @param theme - Optional theme override. Defaults to dark (no attribute set).\n * Passing `'light'` sets `data-theme=\"light\"` on `<html>`.\n * Passing `'dark'` removes the attribute.\n *\n * @example\n * ```typescript\n * // In a client-only bootstrap file:\n * import { applyCSSVarsToDocument } from \"@k-universe/design-tokens/css\";\n * applyCSSVarsToDocument(); // dark theme (default)\n * applyCSSVarsToDocument('light'); // light theme\n * ```\n */\nexport function applyCSSVarsToDocument(theme?: 'dark' | 'light'): void {\n if (typeof document === 'undefined') return;\n\n const root = document.documentElement;\n const pairs = buildPairs(tokens);\n\n for (const [name, value] of pairs) {\n root.style.setProperty(name, value);\n }\n\n if (theme === 'light') {\n root.setAttribute('data-theme', 'light');\n for (const [name, value] of LIGHT_THEME_OVERRIDES) {\n root.style.setProperty(name, value);\n }\n } else {\n root.removeAttribute('data-theme');\n }\n}\n\n// ---------------------------------------------------------------------------\n// Public: getCSSVar / setCSSVar\n// ---------------------------------------------------------------------------\n\n/**\n * Reads a CSS custom property value from `document.documentElement` at runtime.\n * Returns an empty string when called server-side.\n *\n * @param name - Full CSS var name including `--`, e.g. `'--color-primary'`.\n *\n * @example\n * ```typescript\n * const primary = getCSSVar('--color-primary'); // '#0066FF'\n * ```\n */\nexport function getCSSVar(name: string): string {\n if (typeof document === 'undefined') return '';\n return getComputedStyle(document.documentElement).getPropertyValue(name).trim();\n}\n\n/**\n * Sets a CSS custom property on `document.documentElement` at runtime.\n * No-ops when called server-side.\n *\n * @param name - Full CSS var name including `--`, e.g. `'--color-primary'`.\n * @param value - The new value.\n *\n * @example\n * ```typescript\n * setCSSVar('--color-primary', '#FF6600');\n * ```\n */\nexport function setCSSVar(name: string, value: string): void {\n if (typeof document === 'undefined') return;\n document.documentElement.style.setProperty(name, value);\n}\n\n// ---------------------------------------------------------------------------\n// Pre-computed exports (generated at module load time)\n// ---------------------------------------------------------------------------\n\n/**\n * Pre-computed flat `:root { ... }` CSS string from the default token set.\n * Import and inject directly into a `<style>` tag or CSS-in-JS system.\n *\n * @example\n * ```typescript\n * import { cssVarsString } from \"@k-universe/design-tokens/css\";\n * // inject into a <style> tag in layout.tsx\n * ```\n */\nexport const cssVarsString: string = generateCSSVars(tokens);\n\n/**\n * Pre-computed dark-theme `:root { ... }` block with section comments.\n */\nexport const darkThemeCSS: string = generateDarkThemeCSS(tokens);\n\n/**\n * Pre-computed `[data-theme=\"light\"] { ... }` override block.\n */\nexport const lightThemeCSS: string = generateLightThemeCSS(tokens);\n"],"mappings":";AAkDA,IAAM,aAAa;AAAA;AAAA,EAEjB,OAAO;AAAA,EACP,OAAO;AAAA,EACP,MAAM;AAAA,IACJ,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,EACP;AAAA;AAAA,EAGA,YAAY;AAAA,EACZ,SAAS;AAAA,EAC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AAM,gBAAwB,sBAAsB,MAAM;","names":[]}
package/dist/index.cjs ADDED
@@ -0,0 +1,253 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ borderWidth: () => borderWidth,
24
+ colors: () => colors,
25
+ designTokens: () => designTokens,
26
+ getTokenByPath: () => getTokenByPath,
27
+ layout: () => layout,
28
+ mergeTokens: () => mergeTokens,
29
+ motion: () => motion,
30
+ radius: () => radius,
31
+ shadows: () => shadows,
32
+ spacing: () => spacing,
33
+ tokens: () => tokens,
34
+ typography: () => typography,
35
+ zIndex: () => zIndex
36
+ });
37
+ module.exports = __toCommonJS(src_exports);
38
+ var colorsImpl = {
39
+ // Base neutrals
40
+ black: "#000000",
41
+ white: "#FFFFFF",
42
+ gray: {
43
+ 100: "#F5F5F5",
44
+ 300: "#D4D4D4",
45
+ 500: "#737373",
46
+ 700: "#404040",
47
+ 900: "#171717"
48
+ },
49
+ // Dark mode semantic surfaces
50
+ background: "#0A0A0A",
51
+ surface: "#1A1A1A",
52
+ foreground: "#FFFFFF",
53
+ muted: "#2A2A2A",
54
+ border: "#333333",
55
+ // Accent / status
56
+ primary: "#0066FF",
57
+ secondary: "#00CC88",
58
+ success: "#00DD77",
59
+ error: "#FF3333",
60
+ warning: "#FFAA00"
61
+ };
62
+ var typographyImpl = {
63
+ fontFamily: {
64
+ sans: 'Power Grotesk, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
65
+ mono: 'JetBrains Mono, "Fira Code", monospace',
66
+ display: 'Power Grotesk, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'
67
+ },
68
+ scale: {
69
+ hero: { size: "4rem", lineHeight: "1.125", weight: 700 },
70
+ // 64px
71
+ h1: { size: "3rem", lineHeight: "1.167", weight: 700 },
72
+ // 48px
73
+ h2: { size: "2rem", lineHeight: "1.25", weight: 600 },
74
+ // 32px
75
+ h3: { size: "1.5rem", lineHeight: "1.333", weight: 600 },
76
+ // 24px
77
+ body: { size: "1rem", lineHeight: "1.5", weight: 400 },
78
+ // 16px
79
+ small: { size: "0.875rem", lineHeight: "1.429", weight: 400 },
80
+ // 14px
81
+ tiny: { size: "0.75rem", lineHeight: "1.333", weight: 400 }
82
+ // 12px
83
+ },
84
+ fontWeight: {
85
+ thin: 200,
86
+ light: 300,
87
+ regular: 400,
88
+ medium: 500,
89
+ semibold: 600,
90
+ bold: 700,
91
+ black: 900
92
+ }
93
+ };
94
+ var spacingImpl = {
95
+ 0: "0",
96
+ 1: "4px",
97
+ 2: "8px",
98
+ 3: "12px",
99
+ 4: "16px",
100
+ 5: "20px",
101
+ 6: "24px",
102
+ 7: "28px",
103
+ 8: "32px",
104
+ 9: "36px",
105
+ 10: "40px",
106
+ 12: "48px",
107
+ 14: "56px",
108
+ 15: "60px",
109
+ // K-Universe 60px margin principle
110
+ 16: "64px",
111
+ 18: "72px",
112
+ 20: "80px",
113
+ 24: "96px",
114
+ 32: "128px"
115
+ };
116
+ var motionImpl = {
117
+ duration: {
118
+ instant: "100ms",
119
+ fast: "200ms",
120
+ default: "300ms",
121
+ slow: "500ms",
122
+ crawl: "800ms"
123
+ },
124
+ easing: {
125
+ default: "cubic-bezier(0.4, 0, 0.2, 1)",
126
+ smooth: "cubic-bezier(0.25, 0.1, 0.25, 1)",
127
+ sharp: "cubic-bezier(0.4, 0, 0.6, 1)",
128
+ accelerate: "cubic-bezier(0.4, 0, 1, 1)",
129
+ decelerate: "cubic-bezier(0, 0, 0.2, 1)"
130
+ }
131
+ };
132
+ var layoutImpl = {
133
+ margin: "60px",
134
+ // primary horizontal landmark
135
+ sectionSpacing: "96px",
136
+ container: {
137
+ sm: "640px",
138
+ md: "768px",
139
+ lg: "1024px",
140
+ xl: "1280px",
141
+ max: "1320px"
142
+ // K-Universe max-width
143
+ },
144
+ measure: "65ch"
145
+ };
146
+ var radiusImpl = {
147
+ none: "0",
148
+ xs: "2px",
149
+ sm: "4px",
150
+ md: "6px",
151
+ lg: "8px",
152
+ xl: "12px",
153
+ "2xl": "16px",
154
+ "3xl": "24px",
155
+ round: "9999px"
156
+ };
157
+ var shadowsImpl = {
158
+ xs: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
159
+ sm: "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)",
160
+ md: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)",
161
+ lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",
162
+ xl: "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)",
163
+ "2xl": "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
164
+ inner: "inset 0 2px 4px 0 rgba(0, 0, 0, 0.05)",
165
+ cardHover: "0 20px 55px rgba(0, 0, 0, 0.55)",
166
+ elevated: "0 24px 60px rgba(0, 0, 0, 0.45)"
167
+ };
168
+ var zIndexImpl = {
169
+ bg: -1,
170
+ base: 0,
171
+ content: 10,
172
+ dropdown: 100,
173
+ sticky: 200,
174
+ overlay: 300,
175
+ modal: 400,
176
+ popover: 500,
177
+ tooltip: 600,
178
+ toast: 700
179
+ };
180
+ var borderWidthImpl = {
181
+ thin: "1px",
182
+ base: "2px",
183
+ thick: "4px"
184
+ };
185
+ var tokens = {
186
+ colors: colorsImpl,
187
+ typography: typographyImpl,
188
+ spacing: spacingImpl,
189
+ motion: motionImpl,
190
+ layout: layoutImpl,
191
+ radius: radiusImpl,
192
+ shadows: shadowsImpl,
193
+ zIndex: zIndexImpl,
194
+ borderWidth: borderWidthImpl
195
+ };
196
+ var designTokens = tokens;
197
+ var colors = tokens.colors;
198
+ var typography = tokens.typography;
199
+ var spacing = tokens.spacing;
200
+ var motion = tokens.motion;
201
+ var layout = tokens.layout;
202
+ var radius = tokens.radius;
203
+ var shadows = tokens.shadows;
204
+ var zIndex = tokens.zIndex;
205
+ var borderWidth = tokens.borderWidth;
206
+ function mergeTokens(base, overrides) {
207
+ return deepMerge(base, overrides);
208
+ }
209
+ function deepMerge(target, source) {
210
+ const result = { ...target };
211
+ for (const key in source) {
212
+ if (!Object.prototype.hasOwnProperty.call(source, key)) continue;
213
+ const sourceVal = source[key];
214
+ const targetVal = target[key];
215
+ if (sourceVal !== null && typeof sourceVal === "object" && !Array.isArray(sourceVal) && targetVal !== null && typeof targetVal === "object" && !Array.isArray(targetVal)) {
216
+ result[key] = deepMerge(
217
+ targetVal,
218
+ sourceVal
219
+ );
220
+ } else if (sourceVal !== void 0) {
221
+ result[key] = sourceVal;
222
+ }
223
+ }
224
+ return result;
225
+ }
226
+ function getTokenByPath(obj, path) {
227
+ if (!path) return obj;
228
+ const segments = path.split(".");
229
+ let current = obj;
230
+ for (const segment of segments) {
231
+ if (current === null || current === void 0) return void 0;
232
+ if (typeof current !== "object") return void 0;
233
+ current = current[segment];
234
+ }
235
+ return current;
236
+ }
237
+ // Annotate the CommonJS export names for ESM import in node:
238
+ 0 && (module.exports = {
239
+ borderWidth,
240
+ colors,
241
+ designTokens,
242
+ getTokenByPath,
243
+ layout,
244
+ mergeTokens,
245
+ motion,
246
+ radius,
247
+ shadows,
248
+ spacing,
249
+ tokens,
250
+ typography,
251
+ zIndex
252
+ });
253
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @k-universe/design-tokens\n *\n * Foundational design token implementation for K-Universe.\n * All values are authoritative — derived from the K-Universe design system spec.\n *\n * @example\n * ```typescript\n * import { tokens } from \"@k-universe/design-tokens\";\n *\n * tokens.colors.background // '#0A0A0A'\n * tokens.colors.foreground // '#FFFFFF'\n * tokens.colors.secondary // '#00CC88'\n * tokens.typography.fontFamily.sans // 'Power Grotesk, ...'\n * ```\n */\n\n// Re-export all types from the types module\nexport type {\n ColorToken,\n DimensionToken,\n DurationToken,\n EasingToken,\n ShadowToken,\n ColorScale,\n ColorTokens,\n TypeScaleEntry,\n FontFamilyTokens,\n TypeScaleTokens,\n FontWeightTokens,\n TypographyTokens,\n SpacingTokens,\n DurationTokens,\n EasingTokens,\n MotionTokens,\n ContainerTokens,\n LayoutTokens,\n RadiusTokens,\n ShadowTokens,\n ZIndexTokens,\n BorderWidthTokens,\n DesignTokens,\n} from './types.js';\n\nimport type { DesignTokens } from './types.js';\n\n// ---------------------------------------------------------------------------\n// Colors\n// ---------------------------------------------------------------------------\n\nconst colorsImpl = {\n // Base neutrals\n black: '#000000',\n white: '#FFFFFF',\n gray: {\n 100: '#F5F5F5',\n 300: '#D4D4D4',\n 500: '#737373',\n 700: '#404040',\n 900: '#171717',\n },\n\n // Dark mode semantic surfaces\n background: '#0A0A0A',\n surface: '#1A1A1A',\n foreground: '#FFFFFF',\n muted: '#2A2A2A',\n border: '#333333',\n\n // Accent / status\n primary: '#0066FF',\n secondary: '#00CC88',\n success: '#00DD77',\n error: '#FF3333',\n warning: '#FFAA00',\n} as const satisfies DesignTokens['colors'];\n\n// ---------------------------------------------------------------------------\n// Typography\n// ---------------------------------------------------------------------------\n\nconst typographyImpl = {\n fontFamily: {\n sans: 'Power Grotesk, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif',\n mono: 'JetBrains Mono, \"Fira Code\", monospace',\n display: 'Power Grotesk, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif',\n },\n\n scale: {\n hero: { size: '4rem', lineHeight: '1.125', weight: 700 }, // 64px\n h1: { size: '3rem', lineHeight: '1.167', weight: 700 }, // 48px\n h2: { size: '2rem', lineHeight: '1.25', weight: 600 }, // 32px\n h3: { size: '1.5rem', lineHeight: '1.333', weight: 600 }, // 24px\n body: { size: '1rem', lineHeight: '1.5', weight: 400 }, // 16px\n small: { size: '0.875rem', lineHeight: '1.429', weight: 400 }, // 14px\n tiny: { size: '0.75rem', lineHeight: '1.333', weight: 400 }, // 12px\n },\n\n fontWeight: {\n thin: 200,\n light: 300,\n regular: 400,\n medium: 500,\n semibold: 600,\n bold: 700,\n black: 900,\n },\n} as const satisfies DesignTokens['typography'];\n\n// ---------------------------------------------------------------------------\n// Spacing — 8px base grid\n// ---------------------------------------------------------------------------\n\nconst spacingImpl = {\n 0: '0',\n 1: '4px',\n 2: '8px',\n 3: '12px',\n 4: '16px',\n 5: '20px',\n 6: '24px',\n 7: '28px',\n 8: '32px',\n 9: '36px',\n 10: '40px',\n 12: '48px',\n 14: '56px',\n 15: '60px', // K-Universe 60px margin principle\n 16: '64px',\n 18: '72px',\n 20: '80px',\n 24: '96px',\n 32: '128px',\n} as const satisfies DesignTokens['spacing'];\n\n// ---------------------------------------------------------------------------\n// Motion\n// ---------------------------------------------------------------------------\n\nconst motionImpl = {\n duration: {\n instant: '100ms',\n fast: '200ms',\n default: '300ms',\n slow: '500ms',\n crawl: '800ms',\n },\n\n easing: {\n default: 'cubic-bezier(0.4, 0, 0.2, 1)',\n smooth: 'cubic-bezier(0.25, 0.1, 0.25, 1)',\n sharp: 'cubic-bezier(0.4, 0, 0.6, 1)',\n accelerate: 'cubic-bezier(0.4, 0, 1, 1)',\n decelerate: 'cubic-bezier(0, 0, 0.2, 1)',\n },\n} as const satisfies DesignTokens['motion'];\n\n// ---------------------------------------------------------------------------\n// Layout\n// ---------------------------------------------------------------------------\n\nconst layoutImpl = {\n margin: '60px', // primary horizontal landmark\n sectionSpacing: '96px',\n container: {\n sm: '640px',\n md: '768px',\n lg: '1024px',\n xl: '1280px',\n max: '1320px', // K-Universe max-width\n },\n measure: '65ch',\n} as const satisfies DesignTokens['layout'];\n\n// ---------------------------------------------------------------------------\n// Border radius\n// ---------------------------------------------------------------------------\n\nconst radiusImpl = {\n none: '0',\n xs: '2px',\n sm: '4px',\n md: '6px',\n lg: '8px',\n xl: '12px',\n '2xl': '16px',\n '3xl': '24px',\n round: '9999px',\n} as const satisfies DesignTokens['radius'];\n\n// ---------------------------------------------------------------------------\n// Shadows — neutral black only, no colored glow\n// ---------------------------------------------------------------------------\n\nconst shadowsImpl = {\n xs: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',\n sm: '0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)',\n md: '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)',\n lg: '0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)',\n xl: '0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)',\n '2xl': '0 25px 50px -12px rgba(0, 0, 0, 0.25)',\n inner: 'inset 0 2px 4px 0 rgba(0, 0, 0, 0.05)',\n cardHover: '0 20px 55px rgba(0, 0, 0, 0.55)',\n elevated: '0 24px 60px rgba(0, 0, 0, 0.45)',\n} as const satisfies DesignTokens['shadows'];\n\n// ---------------------------------------------------------------------------\n// Z-index\n// ---------------------------------------------------------------------------\n\nconst zIndexImpl = {\n bg: -1,\n base: 0,\n content: 10,\n dropdown: 100,\n sticky: 200,\n overlay: 300,\n modal: 400,\n popover: 500,\n tooltip: 600,\n toast: 700,\n} as const satisfies DesignTokens['zIndex'];\n\n// ---------------------------------------------------------------------------\n// Border width\n// ---------------------------------------------------------------------------\n\nconst borderWidthImpl = {\n thin: '1px',\n base: '2px',\n thick: '4px',\n} as const satisfies DesignTokens['borderWidth'];\n\n// ---------------------------------------------------------------------------\n// Root tokens object\n// ---------------------------------------------------------------------------\n\n/**\n * Primary design tokens export.\n *\n * @example\n * ```typescript\n * import { tokens } from \"@k-universe/design-tokens\";\n *\n * tokens.colors.background // '#0A0A0A'\n * tokens.colors.foreground // '#FFFFFF'\n * tokens.colors.secondary // '#00CC88'\n * tokens.typography.fontFamily.sans // 'Power Grotesk, ...'\n * tokens.spacing[15] // '60px' — 60px margin principle\n * tokens.motion.duration.default // '300ms'\n * ```\n */\nexport const tokens: DesignTokens = {\n colors: colorsImpl,\n typography: typographyImpl,\n spacing: spacingImpl,\n motion: motionImpl,\n layout: layoutImpl,\n radius: radiusImpl,\n shadows: shadowsImpl,\n zIndex: zIndexImpl,\n borderWidth: borderWidthImpl,\n};\n\n// ---------------------------------------------------------------------------\n// Convenience shortcut exports\n// ---------------------------------------------------------------------------\n\n/** Alias for tokens — backwards compatibility. */\nexport const designTokens: DesignTokens = tokens;\n\n/** Shortcut: tokens.colors */\nexport const colors = tokens.colors;\n\n/** Shortcut: tokens.typography */\nexport const typography = tokens.typography;\n\n/** Shortcut: tokens.spacing */\nexport const spacing = tokens.spacing;\n\n/** Shortcut: tokens.motion */\nexport const motion = tokens.motion;\n\n/** Shortcut: tokens.layout */\nexport const layout = tokens.layout;\n\n/** Shortcut: tokens.radius */\nexport const radius = tokens.radius;\n\n/** Shortcut: tokens.shadows */\nexport const shadows = tokens.shadows;\n\n/** Shortcut: tokens.zIndex */\nexport const zIndex = tokens.zIndex;\n\n/** Shortcut: tokens.borderWidth */\nexport const borderWidth = tokens.borderWidth;\n\n// ---------------------------------------------------------------------------\n// Utility: mergeTokens\n// ---------------------------------------------------------------------------\n\ntype DeepPartial<T> = {\n [K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];\n};\n\n/**\n * Deep-merges override tokens into a base token set.\n * Returns a new object — does not mutate the base.\n *\n * @example\n * ```typescript\n * import { tokens, mergeTokens } from \"@k-universe/design-tokens\";\n *\n * const theme = mergeTokens(tokens, {\n * colors: { primary: '#FF6600' },\n * });\n * ```\n */\nexport function mergeTokens(\n base: DesignTokens,\n overrides: DeepPartial<DesignTokens>,\n): DesignTokens {\n return deepMerge(base, overrides) as DesignTokens;\n}\n\nfunction deepMerge<T extends object>(target: T, source: DeepPartial<T>): T {\n const result: T = { ...target };\n\n for (const key in source) {\n if (!Object.prototype.hasOwnProperty.call(source, key)) continue;\n\n const sourceVal = source[key as keyof typeof source];\n const targetVal = target[key as keyof T];\n\n if (\n sourceVal !== null &&\n typeof sourceVal === 'object' &&\n !Array.isArray(sourceVal) &&\n targetVal !== null &&\n typeof targetVal === 'object' &&\n !Array.isArray(targetVal)\n ) {\n (result as Record<string, unknown>)[key] = deepMerge(\n targetVal as object,\n sourceVal as DeepPartial<typeof targetVal>,\n );\n } else if (sourceVal !== undefined) {\n (result as Record<string, unknown>)[key] = sourceVal;\n }\n }\n\n return result;\n}\n\n// ---------------------------------------------------------------------------\n// Utility: getTokenByPath\n// ---------------------------------------------------------------------------\n\n/**\n * Retrieves a token value using dot-notation path access.\n *\n * @param obj - The token object to traverse (typically `tokens`).\n * @param path - Dot-notation path string, e.g. `'colors.primary'`.\n * @returns The value at the given path, or `undefined` if not found.\n *\n * @example\n * ```typescript\n * import { tokens, getTokenByPath } from \"@k-universe/design-tokens\";\n *\n * getTokenByPath(tokens, 'colors.primary') // '#0066FF'\n * getTokenByPath(tokens, 'motion.duration.default') // '300ms'\n * getTokenByPath(tokens, 'spacing.15') // '60px'\n * ```\n */\nexport function getTokenByPath(\n obj: unknown,\n path: string,\n): unknown {\n if (!path) return obj;\n\n const segments = path.split('.');\n let current: unknown = obj;\n\n for (const segment of segments) {\n if (current === null || current === undefined) return undefined;\n if (typeof current !== 'object') return undefined;\n current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