@openkeyai/ui 0.1.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 +134 -0
- package/dist/index.cjs +98 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +74 -0
- package/dist/index.d.ts +74 -0
- package/dist/index.js +95 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +308 -0
- package/dist/tailwind.cjs +152 -0
- package/dist/tailwind.cjs.map +1 -0
- package/dist/tailwind.d.cts +83 -0
- package/dist/tailwind.d.ts +83 -0
- package/dist/tailwind.js +147 -0
- package/dist/tailwind.js.map +1 -0
- package/dist/tokens.cjs +109 -0
- package/dist/tokens.cjs.map +1 -0
- package/dist/tokens.d.cts +121 -0
- package/dist/tokens.d.ts +121 -0
- package/dist/tokens.js +107 -0
- package/dist/tokens.js.map +1 -0
- package/package.json +68 -0
package/dist/tailwind.js
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
// src/tokens.ts
|
|
2
|
+
var tokens = {
|
|
3
|
+
color: {
|
|
4
|
+
/** App-wide canvas. Dark navy with a touch of indigo. */
|
|
5
|
+
bg: "#0a0c1a",
|
|
6
|
+
/** Surface a half-step lighter than `bg`. Card / panel default. */
|
|
7
|
+
surface: "#11142a",
|
|
8
|
+
/** Surface above `surface` — popovers, hover states. */
|
|
9
|
+
surfaceRaised: "#181d3a",
|
|
10
|
+
/** Primary readable text. */
|
|
11
|
+
foreground: "#e6e8f5",
|
|
12
|
+
/** Lower-emphasis text. Captions, metadata. */
|
|
13
|
+
foregroundMuted: "#9097b8",
|
|
14
|
+
/** Subtle border default for cards / dividers. */
|
|
15
|
+
border: "rgba(150, 160, 220, 0.12)",
|
|
16
|
+
/** Indigo-violet primary, softened so it doesn't blow out the bg. */
|
|
17
|
+
accent: "#7c6cf5",
|
|
18
|
+
/** Brighter accent for focus rings + active links. */
|
|
19
|
+
accentBright: "#9b8af9",
|
|
20
|
+
/** Destructive action accent. */
|
|
21
|
+
destructive: "#ef4459",
|
|
22
|
+
/** Success / positive accent. */
|
|
23
|
+
success: "#34d399"
|
|
24
|
+
},
|
|
25
|
+
radius: {
|
|
26
|
+
sm: "4px",
|
|
27
|
+
md: "8px",
|
|
28
|
+
lg: "12px",
|
|
29
|
+
/** Default for cards and surfaces. */
|
|
30
|
+
xl: "16px",
|
|
31
|
+
"2xl": "20px"},
|
|
32
|
+
font: {
|
|
33
|
+
/** Geist Sans — opt-in by the consumer's stack. We just suggest it. */
|
|
34
|
+
sans: 'Geist, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
35
|
+
/** Geist Mono for code + hashes + token displays. */
|
|
36
|
+
mono: 'Geist Mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace'
|
|
37
|
+
},
|
|
38
|
+
fontSize: {
|
|
39
|
+
xs: "11px",
|
|
40
|
+
sm: "13px",
|
|
41
|
+
base: "14px",
|
|
42
|
+
md: "16px",
|
|
43
|
+
lg: "18px",
|
|
44
|
+
xl: "22px"
|
|
45
|
+
},
|
|
46
|
+
shadow: {
|
|
47
|
+
/** Subtle pop on raised cards. */
|
|
48
|
+
sm: "0 1px 2px rgba(0, 0, 0, 0.25)",
|
|
49
|
+
/** Standard floating-pill / dropdown lift. */
|
|
50
|
+
md: "0 6px 24px -8px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3)",
|
|
51
|
+
/** Modal-style. */
|
|
52
|
+
lg: "0 20px 60px -20px rgba(0, 0, 0, 0.6), 0 8px 24px rgba(0, 0, 0, 0.4)"
|
|
53
|
+
},
|
|
54
|
+
motion: {
|
|
55
|
+
/** Default easing — feels good for most UI. */
|
|
56
|
+
ease: "cubic-bezier(0.4, 0.0, 0.2, 1)",
|
|
57
|
+
/** Quick interactions — hover, focus. */
|
|
58
|
+
fast: "120ms",
|
|
59
|
+
/** Standard — most state transitions. */
|
|
60
|
+
normal: "180ms",
|
|
61
|
+
/** Used for entrance / exit animations. */
|
|
62
|
+
slow: "260ms"
|
|
63
|
+
},
|
|
64
|
+
/** Z-index scale. Use these names, never raw numbers. */
|
|
65
|
+
z: {
|
|
66
|
+
raised: 10,
|
|
67
|
+
sticky: 30,
|
|
68
|
+
/** HubHeader sits here. */
|
|
69
|
+
header: 40,
|
|
70
|
+
overlay: 50,
|
|
71
|
+
modal: 60,
|
|
72
|
+
toast: 70
|
|
73
|
+
},
|
|
74
|
+
/** Component-specific dimensions. */
|
|
75
|
+
size: {
|
|
76
|
+
/** HubHeader height. Tools should leave this much top padding. */
|
|
77
|
+
headerHeight: "56px"
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
// src/tailwind.ts
|
|
82
|
+
var hubTailwindPreset = {
|
|
83
|
+
theme: {
|
|
84
|
+
extend: {
|
|
85
|
+
colors: {
|
|
86
|
+
"okai-bg": tokens.color.bg,
|
|
87
|
+
"okai-surface": tokens.color.surface,
|
|
88
|
+
"okai-surface-raised": tokens.color.surfaceRaised,
|
|
89
|
+
"okai-foreground": tokens.color.foreground,
|
|
90
|
+
"okai-foreground-muted": tokens.color.foregroundMuted,
|
|
91
|
+
"okai-border": tokens.color.border,
|
|
92
|
+
"okai-accent": tokens.color.accent,
|
|
93
|
+
"okai-accent-bright": tokens.color.accentBright,
|
|
94
|
+
"okai-destructive": tokens.color.destructive,
|
|
95
|
+
"okai-success": tokens.color.success
|
|
96
|
+
},
|
|
97
|
+
borderRadius: {
|
|
98
|
+
"okai-sm": tokens.radius.sm,
|
|
99
|
+
"okai-md": tokens.radius.md,
|
|
100
|
+
"okai-lg": tokens.radius.lg,
|
|
101
|
+
"okai-xl": tokens.radius.xl,
|
|
102
|
+
"okai-2xl": tokens.radius["2xl"]
|
|
103
|
+
},
|
|
104
|
+
fontFamily: {
|
|
105
|
+
"okai-sans": tokens.font.sans.split(",").map((s) => s.trim()),
|
|
106
|
+
"okai-mono": tokens.font.mono.split(",").map((s) => s.trim())
|
|
107
|
+
},
|
|
108
|
+
fontSize: {
|
|
109
|
+
"okai-xs": tokens.fontSize.xs,
|
|
110
|
+
"okai-sm": tokens.fontSize.sm,
|
|
111
|
+
"okai-base": tokens.fontSize.base,
|
|
112
|
+
"okai-md": tokens.fontSize.md,
|
|
113
|
+
"okai-lg": tokens.fontSize.lg,
|
|
114
|
+
"okai-xl": tokens.fontSize.xl
|
|
115
|
+
},
|
|
116
|
+
boxShadow: {
|
|
117
|
+
"okai-sm": tokens.shadow.sm,
|
|
118
|
+
"okai-md": tokens.shadow.md,
|
|
119
|
+
"okai-lg": tokens.shadow.lg
|
|
120
|
+
},
|
|
121
|
+
transitionTimingFunction: {
|
|
122
|
+
"okai-ease": tokens.motion.ease
|
|
123
|
+
},
|
|
124
|
+
transitionDuration: {
|
|
125
|
+
"okai-fast": tokens.motion.fast.replace("ms", ""),
|
|
126
|
+
"okai-normal": tokens.motion.normal.replace("ms", ""),
|
|
127
|
+
"okai-slow": tokens.motion.slow.replace("ms", "")
|
|
128
|
+
},
|
|
129
|
+
zIndex: {
|
|
130
|
+
"okai-raised": String(tokens.z.raised),
|
|
131
|
+
"okai-sticky": String(tokens.z.sticky),
|
|
132
|
+
"okai-header": String(tokens.z.header),
|
|
133
|
+
"okai-overlay": String(tokens.z.overlay),
|
|
134
|
+
"okai-modal": String(tokens.z.modal),
|
|
135
|
+
"okai-toast": String(tokens.z.toast)
|
|
136
|
+
},
|
|
137
|
+
spacing: {
|
|
138
|
+
"okai-header": tokens.size.headerHeight
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
var tailwind_default = hubTailwindPreset;
|
|
144
|
+
|
|
145
|
+
export { tailwind_default as default, hubTailwindPreset };
|
|
146
|
+
//# sourceMappingURL=tailwind.js.map
|
|
147
|
+
//# sourceMappingURL=tailwind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":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ACN,aAAA,EAAe,MAAA,CAAO,MAAA,CAAO,CAAA,CAAE,MAAM,CAAA;AAAA,QACrC,aAAA,EAAe,MAAA,CAAO,MAAA,CAAO,CAAA,CAAE,MAAM,CAAA;AAAA,QACrC,aAAA,EAAe,MAAA,CAAO,MAAA,CAAO,CAAA,CAAE,MAAM,CAAA;AAAA,QACrC,cAAA,EAAgB,MAAA,CAAO,MAAA,CAAO,CAAA,CAAE,OAAO,CAAA;AAAA,QACvC,YAAA,EAAc,MAAA,CAAO,MAAA,CAAO,CAAA,CAAE,KAAK,CAAA;AAAA,QACnC,YAAA,EAAc,MAAA,CAAO,MAAA,CAAO,CAAA,CAAE,KAAK;AAAA,OACrC;AAAA,MACA,OAAA,EAAS;AAAA,QACP,aAAA,EAAe,OAAO,IAAA,CAAK;AAAA;AAC7B;AACF;AAEJ;AAMA,IAAO,gBAAA,GAAQ","file":"tailwind.js","sourcesContent":["/**\n * Design tokens — colors, spacing, typography, radius, motion.\n *\n * Frozen-ish: visual changes that affect layout (header height, spacing\n * scale, font sizes) require coordinated checks against deployed tools.\n * See ../CLAUDE.md.\n *\n * Two consumption styles:\n * 1. As CSS custom properties — import `@openkeyai/ui/css` and use\n * `var(--okai-color-bg)` etc. The `<HubHeader />` component does this.\n * 2. As a JS object — `import { tokens } from \"@openkeyai/ui/tokens\"`\n * for programmatic colour pickups (charts, gradients).\n *\n * The token names mirror the CSS variable names below the prefix.\n * Example: `tokens.color.bg` ↔ `--okai-color-bg`.\n */\n\nexport const tokens = {\n color: {\n /** App-wide canvas. Dark navy with a touch of indigo. */\n bg: \"#0a0c1a\",\n /** Surface a half-step lighter than `bg`. Card / panel default. */\n surface: \"#11142a\",\n /** Surface above `surface` — popovers, hover states. */\n surfaceRaised: \"#181d3a\",\n /** Primary readable text. */\n foreground: \"#e6e8f5\",\n /** Lower-emphasis text. Captions, metadata. */\n foregroundMuted: \"#9097b8\",\n /** Subtle border default for cards / dividers. */\n border: \"rgba(150, 160, 220, 0.12)\",\n /** Indigo-violet primary, softened so it doesn't blow out the bg. */\n accent: \"#7c6cf5\",\n /** Brighter accent for focus rings + active links. */\n accentBright: \"#9b8af9\",\n /** Destructive action accent. */\n destructive: \"#ef4459\",\n /** Success / positive accent. */\n success: \"#34d399\",\n },\n /** 4px base. Use multiples of these for layout — keeps the grid honest. */\n space: {\n px: \"1px\",\n \"0_5\": \"2px\",\n \"1\": \"4px\",\n \"1_5\": \"6px\",\n \"2\": \"8px\",\n \"3\": \"12px\",\n \"4\": \"16px\",\n \"5\": \"20px\",\n \"6\": \"24px\",\n \"8\": \"32px\",\n \"10\": \"40px\",\n \"12\": \"48px\",\n \"16\": \"64px\",\n },\n radius: {\n sm: \"4px\",\n md: \"8px\",\n lg: \"12px\",\n /** Default for cards and surfaces. */\n xl: \"16px\",\n \"2xl\": \"20px\",\n full: \"9999px\",\n },\n font: {\n /** Geist Sans — opt-in by the consumer's stack. We just suggest it. */\n sans:\n \"Geist, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \" +\n '\"Segoe UI\", Roboto, sans-serif',\n /** Geist Mono for code + hashes + token displays. */\n mono:\n \"Geist Mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \" +\n '\"Liberation Mono\", monospace',\n },\n fontSize: {\n xs: \"11px\",\n sm: \"13px\",\n base: \"14px\",\n md: \"16px\",\n lg: \"18px\",\n xl: \"22px\",\n },\n lineHeight: {\n tight: \"1.2\",\n normal: \"1.5\",\n relaxed: \"1.65\",\n },\n shadow: {\n /** Subtle pop on raised cards. */\n sm: \"0 1px 2px rgba(0, 0, 0, 0.25)\",\n /** Standard floating-pill / dropdown lift. */\n md: \"0 6px 24px -8px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3)\",\n /** Modal-style. */\n lg: \"0 20px 60px -20px rgba(0, 0, 0, 0.6), 0 8px 24px rgba(0, 0, 0, 0.4)\",\n },\n motion: {\n /** Default easing — feels good for most UI. */\n ease: \"cubic-bezier(0.4, 0.0, 0.2, 1)\",\n /** Quick interactions — hover, focus. */\n fast: \"120ms\",\n /** Standard — most state transitions. */\n normal: \"180ms\",\n /** Used for entrance / exit animations. */\n slow: \"260ms\",\n },\n /** Z-index scale. Use these names, never raw numbers. */\n z: {\n base: 0,\n raised: 10,\n sticky: 30,\n /** HubHeader sits here. */\n header: 40,\n overlay: 50,\n modal: 60,\n toast: 70,\n },\n /** Component-specific dimensions. */\n size: {\n /** HubHeader height. Tools should leave this much top padding. */\n headerHeight: \"56px\",\n },\n} as const;\n\nexport type DesignTokens = typeof tokens;\n","import { tokens } from \"./tokens\";\n\n/**\n * Tailwind preset for `@openkeyai/ui` consumers.\n *\n * Drop into a tool's `tailwind.config.ts`:\n *\n * import { hubTailwindPreset } from \"@openkeyai/ui/tailwind\";\n * export default {\n * presets: [hubTailwindPreset],\n * content: [...],\n * } satisfies Config;\n *\n * The preset extends Tailwind's theme with the hub's tokens. It does NOT\n * override Tailwind's defaults — tools can still use the full standard\n * scale alongside the hub additions. Hub-flavoured names are prefixed with\n * `okai-` to avoid colliding with Tailwind's own colour names.\n *\n * We intentionally don't `require(\"tailwindcss\")` here — `tailwind` is a\n * peer concern of the consumer's stack and isn't a dep of this package.\n */\nexport const hubTailwindPreset = {\n theme: {\n extend: {\n colors: {\n \"okai-bg\": tokens.color.bg,\n \"okai-surface\": tokens.color.surface,\n \"okai-surface-raised\": tokens.color.surfaceRaised,\n \"okai-foreground\": tokens.color.foreground,\n \"okai-foreground-muted\": tokens.color.foregroundMuted,\n \"okai-border\": tokens.color.border,\n \"okai-accent\": tokens.color.accent,\n \"okai-accent-bright\": tokens.color.accentBright,\n \"okai-destructive\": tokens.color.destructive,\n \"okai-success\": tokens.color.success,\n },\n borderRadius: {\n \"okai-sm\": tokens.radius.sm,\n \"okai-md\": tokens.radius.md,\n \"okai-lg\": tokens.radius.lg,\n \"okai-xl\": tokens.radius.xl,\n \"okai-2xl\": tokens.radius[\"2xl\"],\n },\n fontFamily: {\n \"okai-sans\": tokens.font.sans.split(\",\").map((s) => s.trim()),\n \"okai-mono\": tokens.font.mono.split(\",\").map((s) => s.trim()),\n },\n fontSize: {\n \"okai-xs\": tokens.fontSize.xs,\n \"okai-sm\": tokens.fontSize.sm,\n \"okai-base\": tokens.fontSize.base,\n \"okai-md\": tokens.fontSize.md,\n \"okai-lg\": tokens.fontSize.lg,\n \"okai-xl\": tokens.fontSize.xl,\n },\n boxShadow: {\n \"okai-sm\": tokens.shadow.sm,\n \"okai-md\": tokens.shadow.md,\n \"okai-lg\": tokens.shadow.lg,\n },\n transitionTimingFunction: {\n \"okai-ease\": tokens.motion.ease,\n },\n transitionDuration: {\n \"okai-fast\": tokens.motion.fast.replace(\"ms\", \"\"),\n \"okai-normal\": tokens.motion.normal.replace(\"ms\", \"\"),\n \"okai-slow\": tokens.motion.slow.replace(\"ms\", \"\"),\n },\n zIndex: {\n \"okai-raised\": String(tokens.z.raised),\n \"okai-sticky\": String(tokens.z.sticky),\n \"okai-header\": String(tokens.z.header),\n \"okai-overlay\": String(tokens.z.overlay),\n \"okai-modal\": String(tokens.z.modal),\n \"okai-toast\": String(tokens.z.toast),\n },\n spacing: {\n \"okai-header\": tokens.size.headerHeight,\n },\n },\n },\n} as const;\n\nexport type HubTailwindPreset = typeof hubTailwindPreset;\n\n// Default export so it can also be consumed via\n// `import preset from \"@openkeyai/ui/tailwind\"`.\nexport default hubTailwindPreset;\n"]}
|
package/dist/tokens.cjs
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/tokens.ts
|
|
4
|
+
var tokens = {
|
|
5
|
+
color: {
|
|
6
|
+
/** App-wide canvas. Dark navy with a touch of indigo. */
|
|
7
|
+
bg: "#0a0c1a",
|
|
8
|
+
/** Surface a half-step lighter than `bg`. Card / panel default. */
|
|
9
|
+
surface: "#11142a",
|
|
10
|
+
/** Surface above `surface` — popovers, hover states. */
|
|
11
|
+
surfaceRaised: "#181d3a",
|
|
12
|
+
/** Primary readable text. */
|
|
13
|
+
foreground: "#e6e8f5",
|
|
14
|
+
/** Lower-emphasis text. Captions, metadata. */
|
|
15
|
+
foregroundMuted: "#9097b8",
|
|
16
|
+
/** Subtle border default for cards / dividers. */
|
|
17
|
+
border: "rgba(150, 160, 220, 0.12)",
|
|
18
|
+
/** Indigo-violet primary, softened so it doesn't blow out the bg. */
|
|
19
|
+
accent: "#7c6cf5",
|
|
20
|
+
/** Brighter accent for focus rings + active links. */
|
|
21
|
+
accentBright: "#9b8af9",
|
|
22
|
+
/** Destructive action accent. */
|
|
23
|
+
destructive: "#ef4459",
|
|
24
|
+
/** Success / positive accent. */
|
|
25
|
+
success: "#34d399"
|
|
26
|
+
},
|
|
27
|
+
/** 4px base. Use multiples of these for layout — keeps the grid honest. */
|
|
28
|
+
space: {
|
|
29
|
+
px: "1px",
|
|
30
|
+
"0_5": "2px",
|
|
31
|
+
"1": "4px",
|
|
32
|
+
"1_5": "6px",
|
|
33
|
+
"2": "8px",
|
|
34
|
+
"3": "12px",
|
|
35
|
+
"4": "16px",
|
|
36
|
+
"5": "20px",
|
|
37
|
+
"6": "24px",
|
|
38
|
+
"8": "32px",
|
|
39
|
+
"10": "40px",
|
|
40
|
+
"12": "48px",
|
|
41
|
+
"16": "64px"
|
|
42
|
+
},
|
|
43
|
+
radius: {
|
|
44
|
+
sm: "4px",
|
|
45
|
+
md: "8px",
|
|
46
|
+
lg: "12px",
|
|
47
|
+
/** Default for cards and surfaces. */
|
|
48
|
+
xl: "16px",
|
|
49
|
+
"2xl": "20px",
|
|
50
|
+
full: "9999px"
|
|
51
|
+
},
|
|
52
|
+
font: {
|
|
53
|
+
/** Geist Sans — opt-in by the consumer's stack. We just suggest it. */
|
|
54
|
+
sans: 'Geist, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
55
|
+
/** Geist Mono for code + hashes + token displays. */
|
|
56
|
+
mono: 'Geist Mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace'
|
|
57
|
+
},
|
|
58
|
+
fontSize: {
|
|
59
|
+
xs: "11px",
|
|
60
|
+
sm: "13px",
|
|
61
|
+
base: "14px",
|
|
62
|
+
md: "16px",
|
|
63
|
+
lg: "18px",
|
|
64
|
+
xl: "22px"
|
|
65
|
+
},
|
|
66
|
+
lineHeight: {
|
|
67
|
+
tight: "1.2",
|
|
68
|
+
normal: "1.5",
|
|
69
|
+
relaxed: "1.65"
|
|
70
|
+
},
|
|
71
|
+
shadow: {
|
|
72
|
+
/** Subtle pop on raised cards. */
|
|
73
|
+
sm: "0 1px 2px rgba(0, 0, 0, 0.25)",
|
|
74
|
+
/** Standard floating-pill / dropdown lift. */
|
|
75
|
+
md: "0 6px 24px -8px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3)",
|
|
76
|
+
/** Modal-style. */
|
|
77
|
+
lg: "0 20px 60px -20px rgba(0, 0, 0, 0.6), 0 8px 24px rgba(0, 0, 0, 0.4)"
|
|
78
|
+
},
|
|
79
|
+
motion: {
|
|
80
|
+
/** Default easing — feels good for most UI. */
|
|
81
|
+
ease: "cubic-bezier(0.4, 0.0, 0.2, 1)",
|
|
82
|
+
/** Quick interactions — hover, focus. */
|
|
83
|
+
fast: "120ms",
|
|
84
|
+
/** Standard — most state transitions. */
|
|
85
|
+
normal: "180ms",
|
|
86
|
+
/** Used for entrance / exit animations. */
|
|
87
|
+
slow: "260ms"
|
|
88
|
+
},
|
|
89
|
+
/** Z-index scale. Use these names, never raw numbers. */
|
|
90
|
+
z: {
|
|
91
|
+
base: 0,
|
|
92
|
+
raised: 10,
|
|
93
|
+
sticky: 30,
|
|
94
|
+
/** HubHeader sits here. */
|
|
95
|
+
header: 40,
|
|
96
|
+
overlay: 50,
|
|
97
|
+
modal: 60,
|
|
98
|
+
toast: 70
|
|
99
|
+
},
|
|
100
|
+
/** Component-specific dimensions. */
|
|
101
|
+
size: {
|
|
102
|
+
/** HubHeader height. Tools should leave this much top padding. */
|
|
103
|
+
headerHeight: "56px"
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
exports.tokens = tokens;
|
|
108
|
+
//# sourceMappingURL=tokens.cjs.map
|
|
109
|
+
//# sourceMappingURL=tokens.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tokens.ts"],"names":[],"mappings":";;;AAiBO,IAAM,MAAA,GAAS;AAAA,EACpB,KAAA,EAAO;AAAA;AAAA,IAEL,EAAA,EAAI,SAAA;AAAA;AAAA,IAEJ,OAAA,EAAS,SAAA;AAAA;AAAA,IAET,aAAA,EAAe,SAAA;AAAA;AAAA,IAEf,UAAA,EAAY,SAAA;AAAA;AAAA,IAEZ,eAAA,EAAiB,SAAA;AAAA;AAAA,IAEjB,MAAA,EAAQ,2BAAA;AAAA;AAAA,IAER,MAAA,EAAQ,SAAA;AAAA;AAAA,IAER,YAAA,EAAc,SAAA;AAAA;AAAA,IAEd,WAAA,EAAa,SAAA;AAAA;AAAA,IAEb,OAAA,EAAS;AAAA,GACX;AAAA;AAAA,EAEA,KAAA,EAAO;AAAA,IACL,EAAA,EAAI,KAAA;AAAA,IACJ,KAAA,EAAO,KAAA;AAAA,IACP,GAAA,EAAK,KAAA;AAAA,IACL,KAAA,EAAO,KAAA;AAAA,IACP,GAAA,EAAK,KAAA;AAAA,IACL,GAAA,EAAK,MAAA;AAAA,IACL,GAAA,EAAK,MAAA;AAAA,IACL,GAAA,EAAK,MAAA;AAAA,IACL,GAAA,EAAK,MAAA;AAAA,IACL,GAAA,EAAK,MAAA;AAAA,IACL,IAAA,EAAM,MAAA;AAAA,IACN,IAAA,EAAM,MAAA;AAAA,IACN,IAAA,EAAM;AAAA,GACR;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,EAAA,EAAI,KAAA;AAAA,IACJ,EAAA,EAAI,KAAA;AAAA,IACJ,EAAA,EAAI,MAAA;AAAA;AAAA,IAEJ,EAAA,EAAI,MAAA;AAAA,IACJ,KAAA,EAAO,MAAA;AAAA,IACP,IAAA,EAAM;AAAA,GACR;AAAA,EACA,IAAA,EAAM;AAAA;AAAA,IAEJ,IAAA,EACE,oGAAA;AAAA;AAAA,IAGF,IAAA,EACE;AAAA,GAEJ;AAAA,EACA,QAAA,EAAU;AAAA,IACR,EAAA,EAAI,MAAA;AAAA,IACJ,EAAA,EAAI,MAAA;AAAA,IACJ,IAAA,EAAM,MAAA;AAAA,IACN,EAAA,EAAI,MAAA;AAAA,IACJ,EAAA,EAAI,MAAA;AAAA,IACJ,EAAA,EAAI;AAAA,GACN;AAAA,EACA,UAAA,EAAY;AAAA,IACV,KAAA,EAAO,KAAA;AAAA,IACP,MAAA,EAAQ,KAAA;AAAA,IACR,OAAA,EAAS;AAAA,GACX;AAAA,EACA,MAAA,EAAQ;AAAA;AAAA,IAEN,EAAA,EAAI,+BAAA;AAAA;AAAA,IAEJ,EAAA,EAAI,kEAAA;AAAA;AAAA,IAEJ,EAAA,EAAI;AAAA,GACN;AAAA,EACA,MAAA,EAAQ;AAAA;AAAA,IAEN,IAAA,EAAM,gCAAA;AAAA;AAAA,IAEN,IAAA,EAAM,OAAA;AAAA;AAAA,IAEN,MAAA,EAAQ,OAAA;AAAA;AAAA,IAER,IAAA,EAAM;AAAA,GACR;AAAA;AAAA,EAEA,CAAA,EAAG;AAAA,IACD,IAAA,EAAM,CAAA;AAAA,IACN,MAAA,EAAQ,EAAA;AAAA,IACR,MAAA,EAAQ,EAAA;AAAA;AAAA,IAER,MAAA,EAAQ,EAAA;AAAA,IACR,OAAA,EAAS,EAAA;AAAA,IACT,KAAA,EAAO,EAAA;AAAA,IACP,KAAA,EAAO;AAAA,GACT;AAAA;AAAA,EAEA,IAAA,EAAM;AAAA;AAAA,IAEJ,YAAA,EAAc;AAAA;AAElB","file":"tokens.cjs","sourcesContent":["/**\n * Design tokens — colors, spacing, typography, radius, motion.\n *\n * Frozen-ish: visual changes that affect layout (header height, spacing\n * scale, font sizes) require coordinated checks against deployed tools.\n * See ../CLAUDE.md.\n *\n * Two consumption styles:\n * 1. As CSS custom properties — import `@openkeyai/ui/css` and use\n * `var(--okai-color-bg)` etc. The `<HubHeader />` component does this.\n * 2. As a JS object — `import { tokens } from \"@openkeyai/ui/tokens\"`\n * for programmatic colour pickups (charts, gradients).\n *\n * The token names mirror the CSS variable names below the prefix.\n * Example: `tokens.color.bg` ↔ `--okai-color-bg`.\n */\n\nexport const tokens = {\n color: {\n /** App-wide canvas. Dark navy with a touch of indigo. */\n bg: \"#0a0c1a\",\n /** Surface a half-step lighter than `bg`. Card / panel default. */\n surface: \"#11142a\",\n /** Surface above `surface` — popovers, hover states. */\n surfaceRaised: \"#181d3a\",\n /** Primary readable text. */\n foreground: \"#e6e8f5\",\n /** Lower-emphasis text. Captions, metadata. */\n foregroundMuted: \"#9097b8\",\n /** Subtle border default for cards / dividers. */\n border: \"rgba(150, 160, 220, 0.12)\",\n /** Indigo-violet primary, softened so it doesn't blow out the bg. */\n accent: \"#7c6cf5\",\n /** Brighter accent for focus rings + active links. */\n accentBright: \"#9b8af9\",\n /** Destructive action accent. */\n destructive: \"#ef4459\",\n /** Success / positive accent. */\n success: \"#34d399\",\n },\n /** 4px base. Use multiples of these for layout — keeps the grid honest. */\n space: {\n px: \"1px\",\n \"0_5\": \"2px\",\n \"1\": \"4px\",\n \"1_5\": \"6px\",\n \"2\": \"8px\",\n \"3\": \"12px\",\n \"4\": \"16px\",\n \"5\": \"20px\",\n \"6\": \"24px\",\n \"8\": \"32px\",\n \"10\": \"40px\",\n \"12\": \"48px\",\n \"16\": \"64px\",\n },\n radius: {\n sm: \"4px\",\n md: \"8px\",\n lg: \"12px\",\n /** Default for cards and surfaces. */\n xl: \"16px\",\n \"2xl\": \"20px\",\n full: \"9999px\",\n },\n font: {\n /** Geist Sans — opt-in by the consumer's stack. We just suggest it. */\n sans:\n \"Geist, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \" +\n '\"Segoe UI\", Roboto, sans-serif',\n /** Geist Mono for code + hashes + token displays. */\n mono:\n \"Geist Mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \" +\n '\"Liberation Mono\", monospace',\n },\n fontSize: {\n xs: \"11px\",\n sm: \"13px\",\n base: \"14px\",\n md: \"16px\",\n lg: \"18px\",\n xl: \"22px\",\n },\n lineHeight: {\n tight: \"1.2\",\n normal: \"1.5\",\n relaxed: \"1.65\",\n },\n shadow: {\n /** Subtle pop on raised cards. */\n sm: \"0 1px 2px rgba(0, 0, 0, 0.25)\",\n /** Standard floating-pill / dropdown lift. */\n md: \"0 6px 24px -8px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3)\",\n /** Modal-style. */\n lg: \"0 20px 60px -20px rgba(0, 0, 0, 0.6), 0 8px 24px rgba(0, 0, 0, 0.4)\",\n },\n motion: {\n /** Default easing — feels good for most UI. */\n ease: \"cubic-bezier(0.4, 0.0, 0.2, 1)\",\n /** Quick interactions — hover, focus. */\n fast: \"120ms\",\n /** Standard — most state transitions. */\n normal: \"180ms\",\n /** Used for entrance / exit animations. */\n slow: \"260ms\",\n },\n /** Z-index scale. Use these names, never raw numbers. */\n z: {\n base: 0,\n raised: 10,\n sticky: 30,\n /** HubHeader sits here. */\n header: 40,\n overlay: 50,\n modal: 60,\n toast: 70,\n },\n /** Component-specific dimensions. */\n size: {\n /** HubHeader height. Tools should leave this much top padding. */\n headerHeight: \"56px\",\n },\n} as const;\n\nexport type DesignTokens = typeof tokens;\n"]}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Design tokens — colors, spacing, typography, radius, motion.
|
|
3
|
+
*
|
|
4
|
+
* Frozen-ish: visual changes that affect layout (header height, spacing
|
|
5
|
+
* scale, font sizes) require coordinated checks against deployed tools.
|
|
6
|
+
* See ../CLAUDE.md.
|
|
7
|
+
*
|
|
8
|
+
* Two consumption styles:
|
|
9
|
+
* 1. As CSS custom properties — import `@openkeyai/ui/css` and use
|
|
10
|
+
* `var(--okai-color-bg)` etc. The `<HubHeader />` component does this.
|
|
11
|
+
* 2. As a JS object — `import { tokens } from "@openkeyai/ui/tokens"`
|
|
12
|
+
* for programmatic colour pickups (charts, gradients).
|
|
13
|
+
*
|
|
14
|
+
* The token names mirror the CSS variable names below the prefix.
|
|
15
|
+
* Example: `tokens.color.bg` ↔ `--okai-color-bg`.
|
|
16
|
+
*/
|
|
17
|
+
declare const tokens: {
|
|
18
|
+
readonly color: {
|
|
19
|
+
/** App-wide canvas. Dark navy with a touch of indigo. */
|
|
20
|
+
readonly bg: "#0a0c1a";
|
|
21
|
+
/** Surface a half-step lighter than `bg`. Card / panel default. */
|
|
22
|
+
readonly surface: "#11142a";
|
|
23
|
+
/** Surface above `surface` — popovers, hover states. */
|
|
24
|
+
readonly surfaceRaised: "#181d3a";
|
|
25
|
+
/** Primary readable text. */
|
|
26
|
+
readonly foreground: "#e6e8f5";
|
|
27
|
+
/** Lower-emphasis text. Captions, metadata. */
|
|
28
|
+
readonly foregroundMuted: "#9097b8";
|
|
29
|
+
/** Subtle border default for cards / dividers. */
|
|
30
|
+
readonly border: "rgba(150, 160, 220, 0.12)";
|
|
31
|
+
/** Indigo-violet primary, softened so it doesn't blow out the bg. */
|
|
32
|
+
readonly accent: "#7c6cf5";
|
|
33
|
+
/** Brighter accent for focus rings + active links. */
|
|
34
|
+
readonly accentBright: "#9b8af9";
|
|
35
|
+
/** Destructive action accent. */
|
|
36
|
+
readonly destructive: "#ef4459";
|
|
37
|
+
/** Success / positive accent. */
|
|
38
|
+
readonly success: "#34d399";
|
|
39
|
+
};
|
|
40
|
+
/** 4px base. Use multiples of these for layout — keeps the grid honest. */
|
|
41
|
+
readonly space: {
|
|
42
|
+
readonly px: "1px";
|
|
43
|
+
readonly "0_5": "2px";
|
|
44
|
+
readonly "1": "4px";
|
|
45
|
+
readonly "1_5": "6px";
|
|
46
|
+
readonly "2": "8px";
|
|
47
|
+
readonly "3": "12px";
|
|
48
|
+
readonly "4": "16px";
|
|
49
|
+
readonly "5": "20px";
|
|
50
|
+
readonly "6": "24px";
|
|
51
|
+
readonly "8": "32px";
|
|
52
|
+
readonly "10": "40px";
|
|
53
|
+
readonly "12": "48px";
|
|
54
|
+
readonly "16": "64px";
|
|
55
|
+
};
|
|
56
|
+
readonly radius: {
|
|
57
|
+
readonly sm: "4px";
|
|
58
|
+
readonly md: "8px";
|
|
59
|
+
readonly lg: "12px";
|
|
60
|
+
/** Default for cards and surfaces. */
|
|
61
|
+
readonly xl: "16px";
|
|
62
|
+
readonly "2xl": "20px";
|
|
63
|
+
readonly full: "9999px";
|
|
64
|
+
};
|
|
65
|
+
readonly font: {
|
|
66
|
+
/** Geist Sans — opt-in by the consumer's stack. We just suggest it. */
|
|
67
|
+
readonly sans: string;
|
|
68
|
+
/** Geist Mono for code + hashes + token displays. */
|
|
69
|
+
readonly mono: string;
|
|
70
|
+
};
|
|
71
|
+
readonly fontSize: {
|
|
72
|
+
readonly xs: "11px";
|
|
73
|
+
readonly sm: "13px";
|
|
74
|
+
readonly base: "14px";
|
|
75
|
+
readonly md: "16px";
|
|
76
|
+
readonly lg: "18px";
|
|
77
|
+
readonly xl: "22px";
|
|
78
|
+
};
|
|
79
|
+
readonly lineHeight: {
|
|
80
|
+
readonly tight: "1.2";
|
|
81
|
+
readonly normal: "1.5";
|
|
82
|
+
readonly relaxed: "1.65";
|
|
83
|
+
};
|
|
84
|
+
readonly shadow: {
|
|
85
|
+
/** Subtle pop on raised cards. */
|
|
86
|
+
readonly sm: "0 1px 2px rgba(0, 0, 0, 0.25)";
|
|
87
|
+
/** Standard floating-pill / dropdown lift. */
|
|
88
|
+
readonly md: "0 6px 24px -8px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3)";
|
|
89
|
+
/** Modal-style. */
|
|
90
|
+
readonly lg: "0 20px 60px -20px rgba(0, 0, 0, 0.6), 0 8px 24px rgba(0, 0, 0, 0.4)";
|
|
91
|
+
};
|
|
92
|
+
readonly motion: {
|
|
93
|
+
/** Default easing — feels good for most UI. */
|
|
94
|
+
readonly ease: "cubic-bezier(0.4, 0.0, 0.2, 1)";
|
|
95
|
+
/** Quick interactions — hover, focus. */
|
|
96
|
+
readonly fast: "120ms";
|
|
97
|
+
/** Standard — most state transitions. */
|
|
98
|
+
readonly normal: "180ms";
|
|
99
|
+
/** Used for entrance / exit animations. */
|
|
100
|
+
readonly slow: "260ms";
|
|
101
|
+
};
|
|
102
|
+
/** Z-index scale. Use these names, never raw numbers. */
|
|
103
|
+
readonly z: {
|
|
104
|
+
readonly base: 0;
|
|
105
|
+
readonly raised: 10;
|
|
106
|
+
readonly sticky: 30;
|
|
107
|
+
/** HubHeader sits here. */
|
|
108
|
+
readonly header: 40;
|
|
109
|
+
readonly overlay: 50;
|
|
110
|
+
readonly modal: 60;
|
|
111
|
+
readonly toast: 70;
|
|
112
|
+
};
|
|
113
|
+
/** Component-specific dimensions. */
|
|
114
|
+
readonly size: {
|
|
115
|
+
/** HubHeader height. Tools should leave this much top padding. */
|
|
116
|
+
readonly headerHeight: "56px";
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
type DesignTokens = typeof tokens;
|
|
120
|
+
|
|
121
|
+
export { type DesignTokens, tokens };
|
package/dist/tokens.d.ts
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Design tokens — colors, spacing, typography, radius, motion.
|
|
3
|
+
*
|
|
4
|
+
* Frozen-ish: visual changes that affect layout (header height, spacing
|
|
5
|
+
* scale, font sizes) require coordinated checks against deployed tools.
|
|
6
|
+
* See ../CLAUDE.md.
|
|
7
|
+
*
|
|
8
|
+
* Two consumption styles:
|
|
9
|
+
* 1. As CSS custom properties — import `@openkeyai/ui/css` and use
|
|
10
|
+
* `var(--okai-color-bg)` etc. The `<HubHeader />` component does this.
|
|
11
|
+
* 2. As a JS object — `import { tokens } from "@openkeyai/ui/tokens"`
|
|
12
|
+
* for programmatic colour pickups (charts, gradients).
|
|
13
|
+
*
|
|
14
|
+
* The token names mirror the CSS variable names below the prefix.
|
|
15
|
+
* Example: `tokens.color.bg` ↔ `--okai-color-bg`.
|
|
16
|
+
*/
|
|
17
|
+
declare const tokens: {
|
|
18
|
+
readonly color: {
|
|
19
|
+
/** App-wide canvas. Dark navy with a touch of indigo. */
|
|
20
|
+
readonly bg: "#0a0c1a";
|
|
21
|
+
/** Surface a half-step lighter than `bg`. Card / panel default. */
|
|
22
|
+
readonly surface: "#11142a";
|
|
23
|
+
/** Surface above `surface` — popovers, hover states. */
|
|
24
|
+
readonly surfaceRaised: "#181d3a";
|
|
25
|
+
/** Primary readable text. */
|
|
26
|
+
readonly foreground: "#e6e8f5";
|
|
27
|
+
/** Lower-emphasis text. Captions, metadata. */
|
|
28
|
+
readonly foregroundMuted: "#9097b8";
|
|
29
|
+
/** Subtle border default for cards / dividers. */
|
|
30
|
+
readonly border: "rgba(150, 160, 220, 0.12)";
|
|
31
|
+
/** Indigo-violet primary, softened so it doesn't blow out the bg. */
|
|
32
|
+
readonly accent: "#7c6cf5";
|
|
33
|
+
/** Brighter accent for focus rings + active links. */
|
|
34
|
+
readonly accentBright: "#9b8af9";
|
|
35
|
+
/** Destructive action accent. */
|
|
36
|
+
readonly destructive: "#ef4459";
|
|
37
|
+
/** Success / positive accent. */
|
|
38
|
+
readonly success: "#34d399";
|
|
39
|
+
};
|
|
40
|
+
/** 4px base. Use multiples of these for layout — keeps the grid honest. */
|
|
41
|
+
readonly space: {
|
|
42
|
+
readonly px: "1px";
|
|
43
|
+
readonly "0_5": "2px";
|
|
44
|
+
readonly "1": "4px";
|
|
45
|
+
readonly "1_5": "6px";
|
|
46
|
+
readonly "2": "8px";
|
|
47
|
+
readonly "3": "12px";
|
|
48
|
+
readonly "4": "16px";
|
|
49
|
+
readonly "5": "20px";
|
|
50
|
+
readonly "6": "24px";
|
|
51
|
+
readonly "8": "32px";
|
|
52
|
+
readonly "10": "40px";
|
|
53
|
+
readonly "12": "48px";
|
|
54
|
+
readonly "16": "64px";
|
|
55
|
+
};
|
|
56
|
+
readonly radius: {
|
|
57
|
+
readonly sm: "4px";
|
|
58
|
+
readonly md: "8px";
|
|
59
|
+
readonly lg: "12px";
|
|
60
|
+
/** Default for cards and surfaces. */
|
|
61
|
+
readonly xl: "16px";
|
|
62
|
+
readonly "2xl": "20px";
|
|
63
|
+
readonly full: "9999px";
|
|
64
|
+
};
|
|
65
|
+
readonly font: {
|
|
66
|
+
/** Geist Sans — opt-in by the consumer's stack. We just suggest it. */
|
|
67
|
+
readonly sans: string;
|
|
68
|
+
/** Geist Mono for code + hashes + token displays. */
|
|
69
|
+
readonly mono: string;
|
|
70
|
+
};
|
|
71
|
+
readonly fontSize: {
|
|
72
|
+
readonly xs: "11px";
|
|
73
|
+
readonly sm: "13px";
|
|
74
|
+
readonly base: "14px";
|
|
75
|
+
readonly md: "16px";
|
|
76
|
+
readonly lg: "18px";
|
|
77
|
+
readonly xl: "22px";
|
|
78
|
+
};
|
|
79
|
+
readonly lineHeight: {
|
|
80
|
+
readonly tight: "1.2";
|
|
81
|
+
readonly normal: "1.5";
|
|
82
|
+
readonly relaxed: "1.65";
|
|
83
|
+
};
|
|
84
|
+
readonly shadow: {
|
|
85
|
+
/** Subtle pop on raised cards. */
|
|
86
|
+
readonly sm: "0 1px 2px rgba(0, 0, 0, 0.25)";
|
|
87
|
+
/** Standard floating-pill / dropdown lift. */
|
|
88
|
+
readonly md: "0 6px 24px -8px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3)";
|
|
89
|
+
/** Modal-style. */
|
|
90
|
+
readonly lg: "0 20px 60px -20px rgba(0, 0, 0, 0.6), 0 8px 24px rgba(0, 0, 0, 0.4)";
|
|
91
|
+
};
|
|
92
|
+
readonly motion: {
|
|
93
|
+
/** Default easing — feels good for most UI. */
|
|
94
|
+
readonly ease: "cubic-bezier(0.4, 0.0, 0.2, 1)";
|
|
95
|
+
/** Quick interactions — hover, focus. */
|
|
96
|
+
readonly fast: "120ms";
|
|
97
|
+
/** Standard — most state transitions. */
|
|
98
|
+
readonly normal: "180ms";
|
|
99
|
+
/** Used for entrance / exit animations. */
|
|
100
|
+
readonly slow: "260ms";
|
|
101
|
+
};
|
|
102
|
+
/** Z-index scale. Use these names, never raw numbers. */
|
|
103
|
+
readonly z: {
|
|
104
|
+
readonly base: 0;
|
|
105
|
+
readonly raised: 10;
|
|
106
|
+
readonly sticky: 30;
|
|
107
|
+
/** HubHeader sits here. */
|
|
108
|
+
readonly header: 40;
|
|
109
|
+
readonly overlay: 50;
|
|
110
|
+
readonly modal: 60;
|
|
111
|
+
readonly toast: 70;
|
|
112
|
+
};
|
|
113
|
+
/** Component-specific dimensions. */
|
|
114
|
+
readonly size: {
|
|
115
|
+
/** HubHeader height. Tools should leave this much top padding. */
|
|
116
|
+
readonly headerHeight: "56px";
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
type DesignTokens = typeof tokens;
|
|
120
|
+
|
|
121
|
+
export { type DesignTokens, tokens };
|
package/dist/tokens.js
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// src/tokens.ts
|
|
2
|
+
var tokens = {
|
|
3
|
+
color: {
|
|
4
|
+
/** App-wide canvas. Dark navy with a touch of indigo. */
|
|
5
|
+
bg: "#0a0c1a",
|
|
6
|
+
/** Surface a half-step lighter than `bg`. Card / panel default. */
|
|
7
|
+
surface: "#11142a",
|
|
8
|
+
/** Surface above `surface` — popovers, hover states. */
|
|
9
|
+
surfaceRaised: "#181d3a",
|
|
10
|
+
/** Primary readable text. */
|
|
11
|
+
foreground: "#e6e8f5",
|
|
12
|
+
/** Lower-emphasis text. Captions, metadata. */
|
|
13
|
+
foregroundMuted: "#9097b8",
|
|
14
|
+
/** Subtle border default for cards / dividers. */
|
|
15
|
+
border: "rgba(150, 160, 220, 0.12)",
|
|
16
|
+
/** Indigo-violet primary, softened so it doesn't blow out the bg. */
|
|
17
|
+
accent: "#7c6cf5",
|
|
18
|
+
/** Brighter accent for focus rings + active links. */
|
|
19
|
+
accentBright: "#9b8af9",
|
|
20
|
+
/** Destructive action accent. */
|
|
21
|
+
destructive: "#ef4459",
|
|
22
|
+
/** Success / positive accent. */
|
|
23
|
+
success: "#34d399"
|
|
24
|
+
},
|
|
25
|
+
/** 4px base. Use multiples of these for layout — keeps the grid honest. */
|
|
26
|
+
space: {
|
|
27
|
+
px: "1px",
|
|
28
|
+
"0_5": "2px",
|
|
29
|
+
"1": "4px",
|
|
30
|
+
"1_5": "6px",
|
|
31
|
+
"2": "8px",
|
|
32
|
+
"3": "12px",
|
|
33
|
+
"4": "16px",
|
|
34
|
+
"5": "20px",
|
|
35
|
+
"6": "24px",
|
|
36
|
+
"8": "32px",
|
|
37
|
+
"10": "40px",
|
|
38
|
+
"12": "48px",
|
|
39
|
+
"16": "64px"
|
|
40
|
+
},
|
|
41
|
+
radius: {
|
|
42
|
+
sm: "4px",
|
|
43
|
+
md: "8px",
|
|
44
|
+
lg: "12px",
|
|
45
|
+
/** Default for cards and surfaces. */
|
|
46
|
+
xl: "16px",
|
|
47
|
+
"2xl": "20px",
|
|
48
|
+
full: "9999px"
|
|
49
|
+
},
|
|
50
|
+
font: {
|
|
51
|
+
/** Geist Sans — opt-in by the consumer's stack. We just suggest it. */
|
|
52
|
+
sans: 'Geist, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
53
|
+
/** Geist Mono for code + hashes + token displays. */
|
|
54
|
+
mono: 'Geist Mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace'
|
|
55
|
+
},
|
|
56
|
+
fontSize: {
|
|
57
|
+
xs: "11px",
|
|
58
|
+
sm: "13px",
|
|
59
|
+
base: "14px",
|
|
60
|
+
md: "16px",
|
|
61
|
+
lg: "18px",
|
|
62
|
+
xl: "22px"
|
|
63
|
+
},
|
|
64
|
+
lineHeight: {
|
|
65
|
+
tight: "1.2",
|
|
66
|
+
normal: "1.5",
|
|
67
|
+
relaxed: "1.65"
|
|
68
|
+
},
|
|
69
|
+
shadow: {
|
|
70
|
+
/** Subtle pop on raised cards. */
|
|
71
|
+
sm: "0 1px 2px rgba(0, 0, 0, 0.25)",
|
|
72
|
+
/** Standard floating-pill / dropdown lift. */
|
|
73
|
+
md: "0 6px 24px -8px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3)",
|
|
74
|
+
/** Modal-style. */
|
|
75
|
+
lg: "0 20px 60px -20px rgba(0, 0, 0, 0.6), 0 8px 24px rgba(0, 0, 0, 0.4)"
|
|
76
|
+
},
|
|
77
|
+
motion: {
|
|
78
|
+
/** Default easing — feels good for most UI. */
|
|
79
|
+
ease: "cubic-bezier(0.4, 0.0, 0.2, 1)",
|
|
80
|
+
/** Quick interactions — hover, focus. */
|
|
81
|
+
fast: "120ms",
|
|
82
|
+
/** Standard — most state transitions. */
|
|
83
|
+
normal: "180ms",
|
|
84
|
+
/** Used for entrance / exit animations. */
|
|
85
|
+
slow: "260ms"
|
|
86
|
+
},
|
|
87
|
+
/** Z-index scale. Use these names, never raw numbers. */
|
|
88
|
+
z: {
|
|
89
|
+
base: 0,
|
|
90
|
+
raised: 10,
|
|
91
|
+
sticky: 30,
|
|
92
|
+
/** HubHeader sits here. */
|
|
93
|
+
header: 40,
|
|
94
|
+
overlay: 50,
|
|
95
|
+
modal: 60,
|
|
96
|
+
toast: 70
|
|
97
|
+
},
|
|
98
|
+
/** Component-specific dimensions. */
|
|
99
|
+
size: {
|
|
100
|
+
/** HubHeader height. Tools should leave this much top padding. */
|
|
101
|
+
headerHeight: "56px"
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export { tokens };
|
|
106
|
+
//# sourceMappingURL=tokens.js.map
|
|
107
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tokens.ts"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EAAI,MAAA;AAAA,IACJ,IAAA,EAAM,MAAA;AAAA,IACN,EAAA,EAAI,MAAA;AAAA,IACJ,EAAA,EAAI,MAAA;AAAA,IACJ,EAAA,EAAI;AAAA,GACN;AAAA,EACA,UAAA,EAAY;AAAA,IACV,KAAA,EAAO,KAAA;AAAA,IACP,MAAA,EAAQ,KAAA;AAAA,IACR,OAAA,EAAS;AAAA,GACX;AAAA,EACA,MAAA,EAAQ;AAAA;AAAA,IAEN,EAAA,EAAI,+BAAA;AAAA;AAAA,IAEJ,EAAA,EAAI,kEAAA;AAAA;AAAA,IAEJ,EAAA,EAAI;AAAA,GACN;AAAA,EACA,MAAA,EAAQ;AAAA;AAAA,IAEN,IAAA,EAAM,gCAAA;AAAA;AAAA,IAEN,IAAA,EAAM,OAAA;AAAA;AAAA,IAEN,MAAA,EAAQ,OAAA;AAAA;AAAA,IAER,IAAA,EAAM;AAAA,GACR;AAAA;AAAA,EAEA,CAAA,EAAG;AAAA,IACD,IAAA,EAAM,CAAA;AAAA,IACN,MAAA,EAAQ,EAAA;AAAA,IACR,MAAA,EAAQ,EAAA;AAAA;AAAA,IAER,MAAA,EAAQ,EAAA;AAAA,IACR,OAAA,EAAS,EAAA;AAAA,IACT,KAAA,EAAO,EAAA;AAAA,IACP,KAAA,EAAO;AAAA,GACT;AAAA;AAAA,EAEA,IAAA,EAAM;AAAA;AAAA,IAEJ,YAAA,EAAc;AAAA;AAElB","file":"tokens.js","sourcesContent":["/**\n * Design tokens — colors, spacing, typography, radius, motion.\n *\n * Frozen-ish: visual changes that affect layout (header height, spacing\n * scale, font sizes) require coordinated checks against deployed tools.\n * See ../CLAUDE.md.\n *\n * Two consumption styles:\n * 1. As CSS custom properties — import `@openkeyai/ui/css` and use\n * `var(--okai-color-bg)` etc. The `<HubHeader />` component does this.\n * 2. As a JS object — `import { tokens } from \"@openkeyai/ui/tokens\"`\n * for programmatic colour pickups (charts, gradients).\n *\n * The token names mirror the CSS variable names below the prefix.\n * Example: `tokens.color.bg` ↔ `--okai-color-bg`.\n */\n\nexport const tokens = {\n color: {\n /** App-wide canvas. Dark navy with a touch of indigo. */\n bg: \"#0a0c1a\",\n /** Surface a half-step lighter than `bg`. Card / panel default. */\n surface: \"#11142a\",\n /** Surface above `surface` — popovers, hover states. */\n surfaceRaised: \"#181d3a\",\n /** Primary readable text. */\n foreground: \"#e6e8f5\",\n /** Lower-emphasis text. Captions, metadata. */\n foregroundMuted: \"#9097b8\",\n /** Subtle border default for cards / dividers. */\n border: \"rgba(150, 160, 220, 0.12)\",\n /** Indigo-violet primary, softened so it doesn't blow out the bg. */\n accent: \"#7c6cf5\",\n /** Brighter accent for focus rings + active links. */\n accentBright: \"#9b8af9\",\n /** Destructive action accent. */\n destructive: \"#ef4459\",\n /** Success / positive accent. */\n success: \"#34d399\",\n },\n /** 4px base. Use multiples of these for layout — keeps the grid honest. */\n space: {\n px: \"1px\",\n \"0_5\": \"2px\",\n \"1\": \"4px\",\n \"1_5\": \"6px\",\n \"2\": \"8px\",\n \"3\": \"12px\",\n \"4\": \"16px\",\n \"5\": \"20px\",\n \"6\": \"24px\",\n \"8\": \"32px\",\n \"10\": \"40px\",\n \"12\": \"48px\",\n \"16\": \"64px\",\n },\n radius: {\n sm: \"4px\",\n md: \"8px\",\n lg: \"12px\",\n /** Default for cards and surfaces. */\n xl: \"16px\",\n \"2xl\": \"20px\",\n full: \"9999px\",\n },\n font: {\n /** Geist Sans — opt-in by the consumer's stack. We just suggest it. */\n sans:\n \"Geist, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \" +\n '\"Segoe UI\", Roboto, sans-serif',\n /** Geist Mono for code + hashes + token displays. */\n mono:\n \"Geist Mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \" +\n '\"Liberation Mono\", monospace',\n },\n fontSize: {\n xs: \"11px\",\n sm: \"13px\",\n base: \"14px\",\n md: \"16px\",\n lg: \"18px\",\n xl: \"22px\",\n },\n lineHeight: {\n tight: \"1.2\",\n normal: \"1.5\",\n relaxed: \"1.65\",\n },\n shadow: {\n /** Subtle pop on raised cards. */\n sm: \"0 1px 2px rgba(0, 0, 0, 0.25)\",\n /** Standard floating-pill / dropdown lift. */\n md: \"0 6px 24px -8px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3)\",\n /** Modal-style. */\n lg: \"0 20px 60px -20px rgba(0, 0, 0, 0.6), 0 8px 24px rgba(0, 0, 0, 0.4)\",\n },\n motion: {\n /** Default easing — feels good for most UI. */\n ease: \"cubic-bezier(0.4, 0.0, 0.2, 1)\",\n /** Quick interactions — hover, focus. */\n fast: \"120ms\",\n /** Standard — most state transitions. */\n normal: \"180ms\",\n /** Used for entrance / exit animations. */\n slow: \"260ms\",\n },\n /** Z-index scale. Use these names, never raw numbers. */\n z: {\n base: 0,\n raised: 10,\n sticky: 30,\n /** HubHeader sits here. */\n header: 40,\n overlay: 50,\n modal: 60,\n toast: 70,\n },\n /** Component-specific dimensions. */\n size: {\n /** HubHeader height. Tools should leave this much top padding. */\n headerHeight: \"56px\",\n },\n} as const;\n\nexport type DesignTokens = typeof tokens;\n"]}
|