@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/LICENSE +21 -0
- package/README.md +224 -0
- package/dist/branding.cjs +133 -0
- package/dist/branding.cjs.map +1 -0
- package/dist/branding.d.cts +53 -0
- package/dist/branding.d.ts +53 -0
- package/dist/branding.js +96 -0
- package/dist/branding.js.map +1 -0
- package/dist/css.cjs +348 -0
- package/dist/css.cjs.map +1 -0
- package/dist/css.d.cts +131 -0
- package/dist/css.d.ts +131 -0
- package/dist/css.js +311 -0
- package/dist/css.js.map +1 -0
- package/dist/index.cjs +253 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +75 -0
- package/dist/index.d.ts +75 -0
- package/dist/index.js +216 -0
- package/dist/index.js.map +1 -0
- package/dist/tailwind.cjs +606 -0
- package/dist/tailwind.cjs.map +1 -0
- package/dist/tailwind.d.cts +25 -0
- package/dist/tailwind.d.ts +25 -0
- package/dist/tailwind.js +571 -0
- package/dist/tailwind.js.map +1 -0
- package/dist/types-BcWm9ccA.d.cts +204 -0
- package/dist/types-BcWm9ccA.d.ts +204 -0
- package/package.json +90 -0
- package/src/standalone/k-universe-tokens.css +151 -0
- package/src/standalone/tokens.css +158 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { B as BorderWidthTokens, C as ColorTokens, D as DesignTokens, L as LayoutTokens, M as MotionTokens, R as RadiusTokens, S as ShadowTokens, a as SpacingTokens, T as TypographyTokens, Z as ZIndexTokens } from './types-BcWm9ccA.cjs';
|
|
2
|
+
export { b as ColorScale, c as ColorToken, d as ContainerTokens, e as DimensionToken, f as DurationToken, g as DurationTokens, E as EasingToken, h as EasingTokens, F as FontFamilyTokens, i as FontWeightTokens, j as ShadowToken, k as TypeScaleEntry, l as TypeScaleTokens } from './types-BcWm9ccA.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Primary design tokens export.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { tokens } from "@k-universe/design-tokens";
|
|
10
|
+
*
|
|
11
|
+
* tokens.colors.background // '#0A0A0A'
|
|
12
|
+
* tokens.colors.foreground // '#FFFFFF'
|
|
13
|
+
* tokens.colors.secondary // '#00CC88'
|
|
14
|
+
* tokens.typography.fontFamily.sans // 'Power Grotesk, ...'
|
|
15
|
+
* tokens.spacing[15] // '60px' — 60px margin principle
|
|
16
|
+
* tokens.motion.duration.default // '300ms'
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
declare const tokens: DesignTokens;
|
|
20
|
+
/** Alias for tokens — backwards compatibility. */
|
|
21
|
+
declare const designTokens: DesignTokens;
|
|
22
|
+
/** Shortcut: tokens.colors */
|
|
23
|
+
declare const colors: ColorTokens;
|
|
24
|
+
/** Shortcut: tokens.typography */
|
|
25
|
+
declare const typography: TypographyTokens;
|
|
26
|
+
/** Shortcut: tokens.spacing */
|
|
27
|
+
declare const spacing: SpacingTokens;
|
|
28
|
+
/** Shortcut: tokens.motion */
|
|
29
|
+
declare const motion: MotionTokens;
|
|
30
|
+
/** Shortcut: tokens.layout */
|
|
31
|
+
declare const layout: LayoutTokens;
|
|
32
|
+
/** Shortcut: tokens.radius */
|
|
33
|
+
declare const radius: RadiusTokens;
|
|
34
|
+
/** Shortcut: tokens.shadows */
|
|
35
|
+
declare const shadows: ShadowTokens;
|
|
36
|
+
/** Shortcut: tokens.zIndex */
|
|
37
|
+
declare const zIndex: ZIndexTokens;
|
|
38
|
+
/** Shortcut: tokens.borderWidth */
|
|
39
|
+
declare const borderWidth: BorderWidthTokens;
|
|
40
|
+
type DeepPartial<T> = {
|
|
41
|
+
[K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Deep-merges override tokens into a base token set.
|
|
45
|
+
* Returns a new object — does not mutate the base.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* import { tokens, mergeTokens } from "@k-universe/design-tokens";
|
|
50
|
+
*
|
|
51
|
+
* const theme = mergeTokens(tokens, {
|
|
52
|
+
* colors: { primary: '#FF6600' },
|
|
53
|
+
* });
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
declare function mergeTokens(base: DesignTokens, overrides: DeepPartial<DesignTokens>): DesignTokens;
|
|
57
|
+
/**
|
|
58
|
+
* Retrieves a token value using dot-notation path access.
|
|
59
|
+
*
|
|
60
|
+
* @param obj - The token object to traverse (typically `tokens`).
|
|
61
|
+
* @param path - Dot-notation path string, e.g. `'colors.primary'`.
|
|
62
|
+
* @returns The value at the given path, or `undefined` if not found.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* import { tokens, getTokenByPath } from "@k-universe/design-tokens";
|
|
67
|
+
*
|
|
68
|
+
* getTokenByPath(tokens, 'colors.primary') // '#0066FF'
|
|
69
|
+
* getTokenByPath(tokens, 'motion.duration.default') // '300ms'
|
|
70
|
+
* getTokenByPath(tokens, 'spacing.15') // '60px'
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
declare function getTokenByPath(obj: unknown, path: string): unknown;
|
|
74
|
+
|
|
75
|
+
export { BorderWidthTokens, ColorTokens, DesignTokens, LayoutTokens, MotionTokens, RadiusTokens, ShadowTokens, SpacingTokens, TypographyTokens, ZIndexTokens, borderWidth, colors, designTokens, getTokenByPath, layout, mergeTokens, motion, radius, shadows, spacing, tokens, typography, zIndex };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { B as BorderWidthTokens, C as ColorTokens, D as DesignTokens, L as LayoutTokens, M as MotionTokens, R as RadiusTokens, S as ShadowTokens, a as SpacingTokens, T as TypographyTokens, Z as ZIndexTokens } from './types-BcWm9ccA.js';
|
|
2
|
+
export { b as ColorScale, c as ColorToken, d as ContainerTokens, e as DimensionToken, f as DurationToken, g as DurationTokens, E as EasingToken, h as EasingTokens, F as FontFamilyTokens, i as FontWeightTokens, j as ShadowToken, k as TypeScaleEntry, l as TypeScaleTokens } from './types-BcWm9ccA.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Primary design tokens export.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { tokens } from "@k-universe/design-tokens";
|
|
10
|
+
*
|
|
11
|
+
* tokens.colors.background // '#0A0A0A'
|
|
12
|
+
* tokens.colors.foreground // '#FFFFFF'
|
|
13
|
+
* tokens.colors.secondary // '#00CC88'
|
|
14
|
+
* tokens.typography.fontFamily.sans // 'Power Grotesk, ...'
|
|
15
|
+
* tokens.spacing[15] // '60px' — 60px margin principle
|
|
16
|
+
* tokens.motion.duration.default // '300ms'
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
declare const tokens: DesignTokens;
|
|
20
|
+
/** Alias for tokens — backwards compatibility. */
|
|
21
|
+
declare const designTokens: DesignTokens;
|
|
22
|
+
/** Shortcut: tokens.colors */
|
|
23
|
+
declare const colors: ColorTokens;
|
|
24
|
+
/** Shortcut: tokens.typography */
|
|
25
|
+
declare const typography: TypographyTokens;
|
|
26
|
+
/** Shortcut: tokens.spacing */
|
|
27
|
+
declare const spacing: SpacingTokens;
|
|
28
|
+
/** Shortcut: tokens.motion */
|
|
29
|
+
declare const motion: MotionTokens;
|
|
30
|
+
/** Shortcut: tokens.layout */
|
|
31
|
+
declare const layout: LayoutTokens;
|
|
32
|
+
/** Shortcut: tokens.radius */
|
|
33
|
+
declare const radius: RadiusTokens;
|
|
34
|
+
/** Shortcut: tokens.shadows */
|
|
35
|
+
declare const shadows: ShadowTokens;
|
|
36
|
+
/** Shortcut: tokens.zIndex */
|
|
37
|
+
declare const zIndex: ZIndexTokens;
|
|
38
|
+
/** Shortcut: tokens.borderWidth */
|
|
39
|
+
declare const borderWidth: BorderWidthTokens;
|
|
40
|
+
type DeepPartial<T> = {
|
|
41
|
+
[K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Deep-merges override tokens into a base token set.
|
|
45
|
+
* Returns a new object — does not mutate the base.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* import { tokens, mergeTokens } from "@k-universe/design-tokens";
|
|
50
|
+
*
|
|
51
|
+
* const theme = mergeTokens(tokens, {
|
|
52
|
+
* colors: { primary: '#FF6600' },
|
|
53
|
+
* });
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
declare function mergeTokens(base: DesignTokens, overrides: DeepPartial<DesignTokens>): DesignTokens;
|
|
57
|
+
/**
|
|
58
|
+
* Retrieves a token value using dot-notation path access.
|
|
59
|
+
*
|
|
60
|
+
* @param obj - The token object to traverse (typically `tokens`).
|
|
61
|
+
* @param path - Dot-notation path string, e.g. `'colors.primary'`.
|
|
62
|
+
* @returns The value at the given path, or `undefined` if not found.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* import { tokens, getTokenByPath } from "@k-universe/design-tokens";
|
|
67
|
+
*
|
|
68
|
+
* getTokenByPath(tokens, 'colors.primary') // '#0066FF'
|
|
69
|
+
* getTokenByPath(tokens, 'motion.duration.default') // '300ms'
|
|
70
|
+
* getTokenByPath(tokens, 'spacing.15') // '60px'
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
declare function getTokenByPath(obj: unknown, path: string): unknown;
|
|
74
|
+
|
|
75
|
+
export { BorderWidthTokens, ColorTokens, DesignTokens, LayoutTokens, MotionTokens, RadiusTokens, ShadowTokens, SpacingTokens, TypographyTokens, ZIndexTokens, borderWidth, colors, designTokens, getTokenByPath, layout, mergeTokens, motion, radius, shadows, spacing, tokens, typography, zIndex };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
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 designTokens = tokens;
|
|
161
|
+
var colors = tokens.colors;
|
|
162
|
+
var typography = tokens.typography;
|
|
163
|
+
var spacing = tokens.spacing;
|
|
164
|
+
var motion = tokens.motion;
|
|
165
|
+
var layout = tokens.layout;
|
|
166
|
+
var radius = tokens.radius;
|
|
167
|
+
var shadows = tokens.shadows;
|
|
168
|
+
var zIndex = tokens.zIndex;
|
|
169
|
+
var borderWidth = tokens.borderWidth;
|
|
170
|
+
function mergeTokens(base, overrides) {
|
|
171
|
+
return deepMerge(base, overrides);
|
|
172
|
+
}
|
|
173
|
+
function deepMerge(target, source) {
|
|
174
|
+
const result = { ...target };
|
|
175
|
+
for (const key in source) {
|
|
176
|
+
if (!Object.prototype.hasOwnProperty.call(source, key)) continue;
|
|
177
|
+
const sourceVal = source[key];
|
|
178
|
+
const targetVal = target[key];
|
|
179
|
+
if (sourceVal !== null && typeof sourceVal === "object" && !Array.isArray(sourceVal) && targetVal !== null && typeof targetVal === "object" && !Array.isArray(targetVal)) {
|
|
180
|
+
result[key] = deepMerge(
|
|
181
|
+
targetVal,
|
|
182
|
+
sourceVal
|
|
183
|
+
);
|
|
184
|
+
} else if (sourceVal !== void 0) {
|
|
185
|
+
result[key] = sourceVal;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return result;
|
|
189
|
+
}
|
|
190
|
+
function getTokenByPath(obj, path) {
|
|
191
|
+
if (!path) return obj;
|
|
192
|
+
const segments = path.split(".");
|
|
193
|
+
let current = obj;
|
|
194
|
+
for (const segment of segments) {
|
|
195
|
+
if (current === null || current === void 0) return void 0;
|
|
196
|
+
if (typeof current !== "object") return void 0;
|
|
197
|
+
current = current[segment];
|
|
198
|
+
}
|
|
199
|
+
return current;
|
|
200
|
+
}
|
|
201
|
+
export {
|
|
202
|
+
borderWidth,
|
|
203
|
+
colors,
|
|
204
|
+
designTokens,
|
|
205
|
+
getTokenByPath,
|
|
206
|
+
layout,
|
|
207
|
+
mergeTokens,
|
|
208
|
+
motion,
|
|
209
|
+
radius,
|
|
210
|
+
shadows,
|
|
211
|
+
spacing,
|
|
212
|
+
tokens,
|
|
213
|
+
typography,
|
|
214
|
+
zIndex
|
|
215
|
+
};
|
|
216
|
+
//# sourceMappingURL=index.js.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 = (current as Record<string, unknown>)[segment];\n }\n\n return current;\n}\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,EACT,YAAY;AAAA,EACZ,OAAO;AAAA,EACP,QAAQ;AAAA;AAAA,EAGR,SAAS;AAAA,EACT,WAAW;AAAA,EACX,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AACX;AAMA,IAAM,iBAAiB;AAAA,EACrB,YAAY;AAAA,IACV,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,EACX;AAAA,EAEA,OAAO;AAAA,IACL,MAAO,EAAE,MAAM,QAAY,YAAY,SAAS,QAAQ,IAAI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