@openkeyai/ui 0.1.0 → 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/tailwind.js CHANGED
@@ -1,39 +1,83 @@
1
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"
2
+ var darkPalette = {
3
+ /** App-wide canvas. Warm dark slate (oklch hue 35). */
4
+ bg: "oklch(0.13 0.008 35)",
5
+ /** Surface a half-step lighter than `bg`. Card / panel default. */
6
+ surface: "oklch(0.17 0.010 35)",
7
+ /** Surface above `surface` — popovers, hover states. */
8
+ surface1: "oklch(0.17 0.010 35)",
9
+ surface2: "oklch(0.21 0.012 35)",
10
+ surface3: "oklch(0.25 0.014 35)",
11
+ surface4: "oklch(0.29 0.016 35)",
12
+ surfaceRaised: "oklch(0.21 0.012 35)",
13
+ /** Primary readable text. */
14
+ foreground: "oklch(0.96 0.005 35)",
15
+ /** Lower-emphasis text. Captions, metadata. */
16
+ foregroundMuted: "oklch(0.74 0.008 35)",
17
+ /** Even lower emphasis — placeholder text, ghost labels. */
18
+ foregroundSubtle: "oklch(0.58 0.010 35)",
19
+ /** Subtle border default for cards / dividers. */
20
+ border: "oklch(1 0 0 / 0.08)",
21
+ /** Stronger border for inputs + outlined buttons. */
22
+ borderStrong: "oklch(1 0 0 / 0.14)",
23
+ /** Brand — warm coral (Material 3 key color, Claude warmth). */
24
+ accent: "oklch(0.76 0.17 35)",
25
+ /** Brighter accent for focus rings + active links. */
26
+ accentBright: "oklch(0.82 0.17 35)",
27
+ /** Tint that sits behind brand-on-brand content. */
28
+ accentContainer: "oklch(0.30 0.13 28 / 0.25)",
29
+ /** Text/icon color on top of accentContainer. */
30
+ onAccentContainer: "oklch(0.88 0.085 35)",
31
+ /** Text/icon color on top of solid accent. */
32
+ onAccent: "oklch(0.13 0.008 35)",
33
+ /** Destructive action accent — warmer than the old red. */
34
+ destructive: "oklch(0.74 0.18 28)",
35
+ /** Success / positive accent — sage. */
36
+ success: "oklch(0.84 0.08 150)",
37
+ /** Warning accent — amber. */
38
+ warning: "oklch(0.88 0.12 80)"
39
+ };
40
+ var shared = {
41
+ /** 4px base. Use multiples of these for layout — keeps the grid honest. */
42
+ space: {
43
+ px: "1px",
44
+ "0_5": "2px",
45
+ "1": "4px",
46
+ "1_5": "6px",
47
+ "2": "8px",
48
+ "3": "12px",
49
+ "4": "16px",
50
+ "5": "20px",
51
+ "6": "24px",
52
+ "8": "32px",
53
+ "10": "40px",
54
+ "12": "48px",
55
+ "16": "64px"
24
56
  },
57
+ /**
58
+ * Material 3 shape scale. Generous radii, predictable family. One
59
+ * radius per element — NO mixed-corner shapes.
60
+ */
25
61
  radius: {
26
- sm: "4px",
27
- md: "8px",
28
- lg: "12px",
29
- /** Default for cards and surfaces. */
30
- xl: "16px",
31
- "2xl": "20px"},
62
+ xs: "6px",
63
+ sm: "10px",
64
+ md: "14px",
65
+ lg: "20px",
66
+ xl: "28px",
67
+ "2xl": "36px",
68
+ full: "9999px"
69
+ },
32
70
  font: {
33
71
  /** Geist Sans — opt-in by the consumer's stack. We just suggest it. */
34
72
  sans: 'Geist, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
35
73
  /** Geist Mono for code + hashes + token displays. */
36
- mono: 'Geist Mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace'
74
+ mono: 'Geist Mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace',
75
+ /**
76
+ * Display — Roboto Flex (Apache 2.0 via Google Fonts). Consumer loads
77
+ * via next/font and exposes the CSS variable `--font-display`. If
78
+ * absent, falls back to the body sans.
79
+ */
80
+ display: "var(--font-display, Geist, ui-sans-serif, system-ui, sans-serif)"
37
81
  },
38
82
  fontSize: {
39
83
  xs: "11px",
@@ -41,28 +85,54 @@ var tokens = {
41
85
  base: "14px",
42
86
  md: "16px",
43
87
  lg: "18px",
44
- xl: "22px"
88
+ xl: "22px",
89
+ "2xl": "28px",
90
+ "3xl": "36px",
91
+ "4xl": "48px",
92
+ /** Big display moments (marketing hero). */
93
+ display: "60px"
45
94
  },
95
+ lineHeight: {
96
+ /** Display — tight, almost 1:1 to the cap height. */
97
+ display: "1.05",
98
+ /** Headlines. */
99
+ tight: "1.2",
100
+ /** UI. */
101
+ normal: "1.5",
102
+ /** Long-form. */
103
+ relaxed: "1.65"
104
+ },
105
+ /**
106
+ * Shadows — heavier in light (real visible shadow), lighter in dark
107
+ * (surface lift carries hierarchy; shadow is just a hairline tint).
108
+ *
109
+ * Values match the hub's `--next-shadow-*` tokens.
110
+ */
46
111
  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)"
112
+ /** Dark cards, hover lift. */
113
+ sm: "0 1px 0 oklch(1 0 0 / 0.04), 0 4px 12px oklch(0 0 0 / 0.20)",
114
+ md: "0 1px 0 oklch(1 0 0 / 0.05), 0 12px 28px oklch(0 0 0 / 0.30)",
115
+ lg: "0 1px 0 oklch(1 0 0 / 0.06), 0 24px 56px oklch(0 0 0 / 0.38)",
116
+ /** Light — real shadow values for the light theme. */
117
+ smLight: "0 1px 2px oklch(0.13 0.008 35 / 0.06), 0 4px 12px oklch(0.13 0.008 35 / 0.06)",
118
+ mdLight: "0 2px 4px oklch(0.13 0.008 35 / 0.08), 0 12px 28px oklch(0.13 0.008 35 / 0.10)",
119
+ lgLight: "0 4px 8px oklch(0.13 0.008 35 / 0.10), 0 24px 56px oklch(0.13 0.008 35 / 0.14)"
53
120
  },
54
121
  motion: {
55
- /** Default easing — feels good for most UI. */
56
- ease: "cubic-bezier(0.4, 0.0, 0.2, 1)",
122
+ /** Material easing — standard. Most UI transitions. */
123
+ easeStandard: "cubic-bezier(0.2, 0.0, 0.0, 1.0)",
124
+ /** Material easing — emphasized. Bigger surface motions. */
125
+ easeEmphasized: "cubic-bezier(0.05, 0.7, 0.1, 1.0)",
57
126
  /** Quick interactions — hover, focus. */
58
- fast: "120ms",
59
- /** Standard — most state transitions. */
60
- normal: "180ms",
61
- /** Used for entrance / exit animations. */
62
- slow: "260ms"
127
+ fast: "160ms",
128
+ /** Standard — dialogs, surface moves. */
129
+ normal: "280ms",
130
+ /** Used for big route / page transitions. */
131
+ slow: "400ms"
63
132
  },
64
133
  /** Z-index scale. Use these names, never raw numbers. */
65
134
  z: {
135
+ base: 0,
66
136
  raised: 10,
67
137
  sticky: 30,
68
138
  /** HubHeader sits here. */
@@ -77,6 +147,11 @@ var tokens = {
77
147
  headerHeight: "56px"
78
148
  }
79
149
  };
150
+ var darkTokens = {
151
+ color: darkPalette,
152
+ ...shared
153
+ };
154
+ var tokens = darkTokens;
80
155
 
81
156
  // src/tailwind.ts
82
157
  var hubTailwindPreset = {
@@ -85,16 +160,27 @@ var hubTailwindPreset = {
85
160
  colors: {
86
161
  "okai-bg": tokens.color.bg,
87
162
  "okai-surface": tokens.color.surface,
163
+ "okai-surface-1": tokens.color.surface1,
164
+ "okai-surface-2": tokens.color.surface2,
165
+ "okai-surface-3": tokens.color.surface3,
166
+ "okai-surface-4": tokens.color.surface4,
88
167
  "okai-surface-raised": tokens.color.surfaceRaised,
89
168
  "okai-foreground": tokens.color.foreground,
90
169
  "okai-foreground-muted": tokens.color.foregroundMuted,
170
+ "okai-foreground-subtle": tokens.color.foregroundSubtle,
91
171
  "okai-border": tokens.color.border,
172
+ "okai-border-strong": tokens.color.borderStrong,
92
173
  "okai-accent": tokens.color.accent,
93
174
  "okai-accent-bright": tokens.color.accentBright,
175
+ "okai-accent-container": tokens.color.accentContainer,
176
+ "okai-on-accent": tokens.color.onAccent,
177
+ "okai-on-accent-container": tokens.color.onAccentContainer,
94
178
  "okai-destructive": tokens.color.destructive,
95
- "okai-success": tokens.color.success
179
+ "okai-success": tokens.color.success,
180
+ "okai-warning": tokens.color.warning
96
181
  },
97
182
  borderRadius: {
183
+ "okai-xs": tokens.radius.xs,
98
184
  "okai-sm": tokens.radius.sm,
99
185
  "okai-md": tokens.radius.md,
100
186
  "okai-lg": tokens.radius.lg,
@@ -103,7 +189,8 @@ var hubTailwindPreset = {
103
189
  },
104
190
  fontFamily: {
105
191
  "okai-sans": tokens.font.sans.split(",").map((s) => s.trim()),
106
- "okai-mono": tokens.font.mono.split(",").map((s) => s.trim())
192
+ "okai-mono": tokens.font.mono.split(",").map((s) => s.trim()),
193
+ "okai-display": tokens.font.display.split(",").map((s) => s.trim())
107
194
  },
108
195
  fontSize: {
109
196
  "okai-xs": tokens.fontSize.xs,
@@ -111,7 +198,11 @@ var hubTailwindPreset = {
111
198
  "okai-base": tokens.fontSize.base,
112
199
  "okai-md": tokens.fontSize.md,
113
200
  "okai-lg": tokens.fontSize.lg,
114
- "okai-xl": tokens.fontSize.xl
201
+ "okai-xl": tokens.fontSize.xl,
202
+ "okai-2xl": tokens.fontSize["2xl"],
203
+ "okai-3xl": tokens.fontSize["3xl"],
204
+ "okai-4xl": tokens.fontSize["4xl"],
205
+ "okai-display": tokens.fontSize.display
115
206
  },
116
207
  boxShadow: {
117
208
  "okai-sm": tokens.shadow.sm,
@@ -119,7 +210,8 @@ var hubTailwindPreset = {
119
210
  "okai-lg": tokens.shadow.lg
120
211
  },
121
212
  transitionTimingFunction: {
122
- "okai-ease": tokens.motion.ease
213
+ "okai-ease": tokens.motion.easeStandard,
214
+ "okai-ease-emphasized": tokens.motion.easeEmphasized
123
215
  },
124
216
  transitionDuration: {
125
217
  "okai-fast": tokens.motion.fast.replace("ms", ""),
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/tokens.ts","../src/tailwind.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,EAiBA,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,MAET,CAAA;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;AA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,wBAAA,EAA0B;AAAA,QACxB,WAAA,EAAa,OAAO,MAAA,CAAO;AAAA,OAC7B;AAAA,MACA,kBAAA,EAAoB;AAAA,QAClB,aAAa,MAAA,CAAO,MAAA,CAAO,IAAA,CAAK,OAAA,CAAQ,MAAM,EAAE,CAAA;AAAA,QAChD,eAAe,MAAA,CAAO,MAAA,CAAO,MAAA,CAAO,OAAA,CAAQ,MAAM,EAAE,CAAA;AAAA,QACpD,aAAa,MAAA,CAAO,MAAA,CAAO,IAAA,CAAK,OAAA,CAAQ,MAAM,EAAE;AAAA,OAClD;AAAA,MACA,MAAA,EAAQ;AAAA,QACN,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/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AAA,CAAQ,MAAM,EAAE;AAAA,OAClD;AAAA,MACA,MAAA,EAAQ;AAAA,QACN,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 * **v1.0.0** — major version: palette swap from cool indigo-violet to\n * warm coral, Material 3 elevation model, light + dark themes,\n * Roboto Flex display font. See README for the migration map and the\n * `hub` repo's `docs/DESIGN.md` for the language behind the choices.\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, darkTokens, lightTokens }`\n * from \"@openkeyai/ui/tokens\" for programmatic colour pickups\n * (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 * Dark is the default. Light mode is opt-in by the consumer:\n *\n * <html data-theme=\"light\">\n *\n * Switches every `--okai-*` color variable to the light palette.\n */\n\n/* ─── Dark palette (default) ──────────────────────────────────────────────── */\n\nconst darkPalette = {\n /** App-wide canvas. Warm dark slate (oklch hue 35). */\n bg: \"oklch(0.13 0.008 35)\",\n /** Surface a half-step lighter than `bg`. Card / panel default. */\n surface: \"oklch(0.17 0.010 35)\",\n /** Surface above `surface` — popovers, hover states. */\n surface1: \"oklch(0.17 0.010 35)\",\n surface2: \"oklch(0.21 0.012 35)\",\n surface3: \"oklch(0.25 0.014 35)\",\n surface4: \"oklch(0.29 0.016 35)\",\n surfaceRaised: \"oklch(0.21 0.012 35)\",\n /** Primary readable text. */\n foreground: \"oklch(0.96 0.005 35)\",\n /** Lower-emphasis text. Captions, metadata. */\n foregroundMuted: \"oklch(0.74 0.008 35)\",\n /** Even lower emphasis — placeholder text, ghost labels. */\n foregroundSubtle: \"oklch(0.58 0.010 35)\",\n /** Subtle border default for cards / dividers. */\n border: \"oklch(1 0 0 / 0.08)\",\n /** Stronger border for inputs + outlined buttons. */\n borderStrong: \"oklch(1 0 0 / 0.14)\",\n /** Brand — warm coral (Material 3 key color, Claude warmth). */\n accent: \"oklch(0.76 0.17 35)\",\n /** Brighter accent for focus rings + active links. */\n accentBright: \"oklch(0.82 0.17 35)\",\n /** Tint that sits behind brand-on-brand content. */\n accentContainer: \"oklch(0.30 0.13 28 / 0.25)\",\n /** Text/icon color on top of accentContainer. */\n onAccentContainer: \"oklch(0.88 0.085 35)\",\n /** Text/icon color on top of solid accent. */\n onAccent: \"oklch(0.13 0.008 35)\",\n /** Destructive action accent — warmer than the old red. */\n destructive: \"oklch(0.74 0.18 28)\",\n /** Success / positive accent — sage. */\n success: \"oklch(0.84 0.08 150)\",\n /** Warning accent — amber. */\n warning: \"oklch(0.88 0.12 80)\",\n} as const;\n\n/* ─── Light palette (opt-in via data-theme=\"light\") ───────────────────────── */\n\nconst lightPalette = {\n bg: \"oklch(0.985 0.005 35)\",\n surface: \"oklch(1 0 0)\",\n surface1: \"oklch(1 0 0)\",\n surface2: \"oklch(0.96 0.006 35)\",\n surface3: \"oklch(0.93 0.008 35)\",\n surface4: \"oklch(0.90 0.010 35)\",\n surfaceRaised: \"oklch(0.96 0.006 35)\",\n foreground: \"oklch(0.18 0.012 35)\",\n foregroundMuted: \"oklch(0.42 0.012 50)\",\n foregroundSubtle: \"oklch(0.58 0.010 50)\",\n border: \"oklch(0 0 0 / 0.08)\",\n borderStrong: \"oklch(0 0 0 / 0.16)\",\n accent: \"oklch(0.64 0.21 30)\",\n accentBright: \"oklch(0.56 0.20 28)\",\n accentContainer: \"oklch(0.93 0.045 35)\",\n onAccentContainer: \"oklch(0.30 0.13 28)\",\n onAccent: \"oklch(1 0 0)\",\n destructive: \"oklch(0.55 0.21 28)\",\n success: \"oklch(0.52 0.10 150)\",\n warning: \"oklch(0.60 0.15 70)\",\n} as const;\n\n/* ─── Shared (theme-invariant) ────────────────────────────────────────────── */\n\nconst shared = {\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 /**\n * Material 3 shape scale. Generous radii, predictable family. One\n * radius per element — NO mixed-corner shapes.\n */\n radius: {\n xs: \"6px\",\n sm: \"10px\",\n md: \"14px\",\n lg: \"20px\",\n xl: \"28px\",\n \"2xl\": \"36px\",\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 * Display — Roboto Flex (Apache 2.0 via Google Fonts). Consumer loads\n * via next/font and exposes the CSS variable `--font-display`. If\n * absent, falls back to the body sans.\n */\n display:\n \"var(--font-display, Geist, ui-sans-serif, system-ui, sans-serif)\",\n },\n fontSize: {\n xs: \"11px\",\n sm: \"13px\",\n base: \"14px\",\n md: \"16px\",\n lg: \"18px\",\n xl: \"22px\",\n \"2xl\": \"28px\",\n \"3xl\": \"36px\",\n \"4xl\": \"48px\",\n /** Big display moments (marketing hero). */\n display: \"60px\",\n },\n lineHeight: {\n /** Display — tight, almost 1:1 to the cap height. */\n display: \"1.05\",\n /** Headlines. */\n tight: \"1.2\",\n /** UI. */\n normal: \"1.5\",\n /** Long-form. */\n relaxed: \"1.65\",\n },\n /**\n * Shadows — heavier in light (real visible shadow), lighter in dark\n * (surface lift carries hierarchy; shadow is just a hairline tint).\n *\n * Values match the hub's `--next-shadow-*` tokens.\n */\n shadow: {\n /** Dark — cards, hover lift. */\n sm:\n \"0 1px 0 oklch(1 0 0 / 0.04), 0 4px 12px oklch(0 0 0 / 0.20)\",\n md:\n \"0 1px 0 oklch(1 0 0 / 0.05), 0 12px 28px oklch(0 0 0 / 0.30)\",\n lg:\n \"0 1px 0 oklch(1 0 0 / 0.06), 0 24px 56px oklch(0 0 0 / 0.38)\",\n /** Light — real shadow values for the light theme. */\n smLight:\n \"0 1px 2px oklch(0.13 0.008 35 / 0.06), 0 4px 12px oklch(0.13 0.008 35 / 0.06)\",\n mdLight:\n \"0 2px 4px oklch(0.13 0.008 35 / 0.08), 0 12px 28px oklch(0.13 0.008 35 / 0.10)\",\n lgLight:\n \"0 4px 8px oklch(0.13 0.008 35 / 0.10), 0 24px 56px oklch(0.13 0.008 35 / 0.14)\",\n },\n motion: {\n /** Material easing — standard. Most UI transitions. */\n easeStandard: \"cubic-bezier(0.2, 0.0, 0.0, 1.0)\",\n /** Material easing — emphasized. Bigger surface motions. */\n easeEmphasized: \"cubic-bezier(0.05, 0.7, 0.1, 1.0)\",\n /** Quick interactions — hover, focus. */\n fast: \"160ms\",\n /** Standard — dialogs, surface moves. */\n normal: \"280ms\",\n /** Used for big route / page transitions. */\n slow: \"400ms\",\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\n/* ─── Exports ─────────────────────────────────────────────────────────────── */\n\n/**\n * Tokens for the **dark** theme (default). For programmatic use; UI\n * components should reference the CSS variables in styles.css which\n * automatically swap to the light palette when `data-theme=\"light\"`.\n */\nexport const darkTokens = {\n color: darkPalette,\n ...shared,\n} as const;\n\n/** Tokens for the **light** theme. */\nexport const lightTokens = {\n color: lightPalette,\n ...shared,\n} as const;\n\n/**\n * Default `tokens` export — dark palette. Kept for backwards\n * compatibility with v0.x callers that did `tokens.color.bg`. The shape\n * is unchanged; only color values have shifted from cool to warm.\n */\nexport const tokens = darkTokens;\n\nexport type DesignTokens = typeof tokens;\n\n/** Names for theming. Use to coerce stringly-typed data into the union. */\nexport type ThemeName = \"dark\" | \"light\";\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-1\": tokens.color.surface1,\n \"okai-surface-2\": tokens.color.surface2,\n \"okai-surface-3\": tokens.color.surface3,\n \"okai-surface-4\": tokens.color.surface4,\n \"okai-surface-raised\": tokens.color.surfaceRaised,\n \"okai-foreground\": tokens.color.foreground,\n \"okai-foreground-muted\": tokens.color.foregroundMuted,\n \"okai-foreground-subtle\": tokens.color.foregroundSubtle,\n \"okai-border\": tokens.color.border,\n \"okai-border-strong\": tokens.color.borderStrong,\n \"okai-accent\": tokens.color.accent,\n \"okai-accent-bright\": tokens.color.accentBright,\n \"okai-accent-container\": tokens.color.accentContainer,\n \"okai-on-accent\": tokens.color.onAccent,\n \"okai-on-accent-container\": tokens.color.onAccentContainer,\n \"okai-destructive\": tokens.color.destructive,\n \"okai-success\": tokens.color.success,\n \"okai-warning\": tokens.color.warning,\n },\n borderRadius: {\n \"okai-xs\": tokens.radius.xs,\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 \"okai-display\": tokens.font.display.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 \"okai-2xl\": tokens.fontSize[\"2xl\"],\n \"okai-3xl\": tokens.fontSize[\"3xl\"],\n \"okai-4xl\": tokens.fontSize[\"4xl\"],\n \"okai-display\": tokens.fontSize.display,\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.easeStandard,\n \"okai-ease-emphasized\": tokens.motion.easeEmphasized,\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 CHANGED
@@ -1,29 +1,67 @@
1
1
  'use strict';
2
2
 
3
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
- },
4
+ var darkPalette = {
5
+ /** App-wide canvas. Warm dark slate (oklch hue 35). */
6
+ bg: "oklch(0.13 0.008 35)",
7
+ /** Surface a half-step lighter than `bg`. Card / panel default. */
8
+ surface: "oklch(0.17 0.010 35)",
9
+ /** Surface above `surface` — popovers, hover states. */
10
+ surface1: "oklch(0.17 0.010 35)",
11
+ surface2: "oklch(0.21 0.012 35)",
12
+ surface3: "oklch(0.25 0.014 35)",
13
+ surface4: "oklch(0.29 0.016 35)",
14
+ surfaceRaised: "oklch(0.21 0.012 35)",
15
+ /** Primary readable text. */
16
+ foreground: "oklch(0.96 0.005 35)",
17
+ /** Lower-emphasis text. Captions, metadata. */
18
+ foregroundMuted: "oklch(0.74 0.008 35)",
19
+ /** Even lower emphasis — placeholder text, ghost labels. */
20
+ foregroundSubtle: "oklch(0.58 0.010 35)",
21
+ /** Subtle border default for cards / dividers. */
22
+ border: "oklch(1 0 0 / 0.08)",
23
+ /** Stronger border for inputs + outlined buttons. */
24
+ borderStrong: "oklch(1 0 0 / 0.14)",
25
+ /** Brand — warm coral (Material 3 key color, Claude warmth). */
26
+ accent: "oklch(0.76 0.17 35)",
27
+ /** Brighter accent for focus rings + active links. */
28
+ accentBright: "oklch(0.82 0.17 35)",
29
+ /** Tint that sits behind brand-on-brand content. */
30
+ accentContainer: "oklch(0.30 0.13 28 / 0.25)",
31
+ /** Text/icon color on top of accentContainer. */
32
+ onAccentContainer: "oklch(0.88 0.085 35)",
33
+ /** Text/icon color on top of solid accent. */
34
+ onAccent: "oklch(0.13 0.008 35)",
35
+ /** Destructive action accent — warmer than the old red. */
36
+ destructive: "oklch(0.74 0.18 28)",
37
+ /** Success / positive accent — sage. */
38
+ success: "oklch(0.84 0.08 150)",
39
+ /** Warning accent — amber. */
40
+ warning: "oklch(0.88 0.12 80)"
41
+ };
42
+ var lightPalette = {
43
+ bg: "oklch(0.985 0.005 35)",
44
+ surface: "oklch(1 0 0)",
45
+ surface1: "oklch(1 0 0)",
46
+ surface2: "oklch(0.96 0.006 35)",
47
+ surface3: "oklch(0.93 0.008 35)",
48
+ surface4: "oklch(0.90 0.010 35)",
49
+ surfaceRaised: "oklch(0.96 0.006 35)",
50
+ foreground: "oklch(0.18 0.012 35)",
51
+ foregroundMuted: "oklch(0.42 0.012 50)",
52
+ foregroundSubtle: "oklch(0.58 0.010 50)",
53
+ border: "oklch(0 0 0 / 0.08)",
54
+ borderStrong: "oklch(0 0 0 / 0.16)",
55
+ accent: "oklch(0.64 0.21 30)",
56
+ accentBright: "oklch(0.56 0.20 28)",
57
+ accentContainer: "oklch(0.93 0.045 35)",
58
+ onAccentContainer: "oklch(0.30 0.13 28)",
59
+ onAccent: "oklch(1 0 0)",
60
+ destructive: "oklch(0.55 0.21 28)",
61
+ success: "oklch(0.52 0.10 150)",
62
+ warning: "oklch(0.60 0.15 70)"
63
+ };
64
+ var shared = {
27
65
  /** 4px base. Use multiples of these for layout — keeps the grid honest. */
28
66
  space: {
29
67
  px: "1px",
@@ -40,20 +78,30 @@ var tokens = {
40
78
  "12": "48px",
41
79
  "16": "64px"
42
80
  },
81
+ /**
82
+ * Material 3 shape scale. Generous radii, predictable family. One
83
+ * radius per element — NO mixed-corner shapes.
84
+ */
43
85
  radius: {
44
- sm: "4px",
45
- md: "8px",
46
- lg: "12px",
47
- /** Default for cards and surfaces. */
48
- xl: "16px",
49
- "2xl": "20px",
86
+ xs: "6px",
87
+ sm: "10px",
88
+ md: "14px",
89
+ lg: "20px",
90
+ xl: "28px",
91
+ "2xl": "36px",
50
92
  full: "9999px"
51
93
  },
52
94
  font: {
53
95
  /** Geist Sans — opt-in by the consumer's stack. We just suggest it. */
54
96
  sans: 'Geist, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
55
97
  /** Geist Mono for code + hashes + token displays. */
56
- mono: 'Geist Mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace'
98
+ mono: 'Geist Mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace',
99
+ /**
100
+ * Display — Roboto Flex (Apache 2.0 via Google Fonts). Consumer loads
101
+ * via next/font and exposes the CSS variable `--font-display`. If
102
+ * absent, falls back to the body sans.
103
+ */
104
+ display: "var(--font-display, Geist, ui-sans-serif, system-ui, sans-serif)"
57
105
  },
58
106
  fontSize: {
59
107
  xs: "11px",
@@ -61,30 +109,50 @@ var tokens = {
61
109
  base: "14px",
62
110
  md: "16px",
63
111
  lg: "18px",
64
- xl: "22px"
112
+ xl: "22px",
113
+ "2xl": "28px",
114
+ "3xl": "36px",
115
+ "4xl": "48px",
116
+ /** Big display moments (marketing hero). */
117
+ display: "60px"
65
118
  },
66
119
  lineHeight: {
120
+ /** Display — tight, almost 1:1 to the cap height. */
121
+ display: "1.05",
122
+ /** Headlines. */
67
123
  tight: "1.2",
124
+ /** UI. */
68
125
  normal: "1.5",
126
+ /** Long-form. */
69
127
  relaxed: "1.65"
70
128
  },
129
+ /**
130
+ * Shadows — heavier in light (real visible shadow), lighter in dark
131
+ * (surface lift carries hierarchy; shadow is just a hairline tint).
132
+ *
133
+ * Values match the hub's `--next-shadow-*` tokens.
134
+ */
71
135
  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)"
136
+ /** Dark cards, hover lift. */
137
+ sm: "0 1px 0 oklch(1 0 0 / 0.04), 0 4px 12px oklch(0 0 0 / 0.20)",
138
+ md: "0 1px 0 oklch(1 0 0 / 0.05), 0 12px 28px oklch(0 0 0 / 0.30)",
139
+ lg: "0 1px 0 oklch(1 0 0 / 0.06), 0 24px 56px oklch(0 0 0 / 0.38)",
140
+ /** Light — real shadow values for the light theme. */
141
+ smLight: "0 1px 2px oklch(0.13 0.008 35 / 0.06), 0 4px 12px oklch(0.13 0.008 35 / 0.06)",
142
+ mdLight: "0 2px 4px oklch(0.13 0.008 35 / 0.08), 0 12px 28px oklch(0.13 0.008 35 / 0.10)",
143
+ lgLight: "0 4px 8px oklch(0.13 0.008 35 / 0.10), 0 24px 56px oklch(0.13 0.008 35 / 0.14)"
78
144
  },
79
145
  motion: {
80
- /** Default easing — feels good for most UI. */
81
- ease: "cubic-bezier(0.4, 0.0, 0.2, 1)",
146
+ /** Material easing — standard. Most UI transitions. */
147
+ easeStandard: "cubic-bezier(0.2, 0.0, 0.0, 1.0)",
148
+ /** Material easing — emphasized. Bigger surface motions. */
149
+ easeEmphasized: "cubic-bezier(0.05, 0.7, 0.1, 1.0)",
82
150
  /** Quick interactions — hover, focus. */
83
- fast: "120ms",
84
- /** Standard — most state transitions. */
85
- normal: "180ms",
86
- /** Used for entrance / exit animations. */
87
- slow: "260ms"
151
+ fast: "160ms",
152
+ /** Standard — dialogs, surface moves. */
153
+ normal: "280ms",
154
+ /** Used for big route / page transitions. */
155
+ slow: "400ms"
88
156
  },
89
157
  /** Z-index scale. Use these names, never raw numbers. */
90
158
  z: {
@@ -103,7 +171,18 @@ var tokens = {
103
171
  headerHeight: "56px"
104
172
  }
105
173
  };
174
+ var darkTokens = {
175
+ color: darkPalette,
176
+ ...shared
177
+ };
178
+ var lightTokens = {
179
+ color: lightPalette,
180
+ ...shared
181
+ };
182
+ var tokens = darkTokens;
106
183
 
184
+ exports.darkTokens = darkTokens;
185
+ exports.lightTokens = lightTokens;
107
186
  exports.tokens = tokens;
108
187
  //# sourceMappingURL=tokens.cjs.map
109
188
  //# sourceMappingURL=tokens.cjs.map
@@ -1 +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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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"]}
1
+ {"version":3,"sources":["../src/tokens.ts"],"names":[],"mappings":";;;AA2BA,IAAM,WAAA,GAAc;AAAA;AAAA,EAElB,EAAA,EAAI,sBAAA;AAAA;AAAA,EAEJ,OAAA,EAAS,sBAAA;AAAA;AAAA,EAET,QAAA,EAAU,sBAAA;AAAA,EACV,QAAA,EAAU,sBAAA;AAAA,EACV,QAAA,EAAU,sBAAA;AAAA,EACV,QAAA,EAAU,sBAAA;AAAA,EACV,aAAA,EAAe,sBAAA;AAAA;AAAA,EAEf,UAAA,EAAY,sBAAA;AAAA;AAAA,EAEZ,eAAA,EAAiB,sBAAA;AAAA;AAAA,EAEjB,gBAAA,EAAkB,sBAAA;AAAA;AAAA,EAElB,MAAA,EAAQ,qBAAA;AAAA;AAAA,EAER,YAAA,EAAc,qBAAA;AAAA;AAAA,EAEd,MAAA,EAAQ,qBAAA;AAAA;AAAA,EAER,YAAA,EAAc,qBAAA;AAAA;AAAA,EAEd,eAAA,EAAiB,4BAAA;AAAA;AAAA,EAEjB,iBAAA,EAAmB,sBAAA;AAAA;AAAA,EAEnB,QAAA,EAAU,sBAAA;AAAA;AAAA,EAEV,WAAA,EAAa,qBAAA;AAAA;AAAA,EAEb,OAAA,EAAS,sBAAA;AAAA;AAAA,EAET,O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,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,CAAA;AASO,IAAM,UAAA,GAAa;AAAA,EACxB,KAAA,EAAO,WAAA;AAAA,EACP,GAAG;AACL;AAGO,IAAM,WAAA,GAAc;AAAA,EACzB,KAAA,EAAO,YAAA;AAAA,EACP,GAAG;AACL;AAOO,IAAM,MAAA,GAAS","file":"tokens.cjs","sourcesContent":["/**\n * Design tokens — colors, spacing, typography, radius, motion.\n *\n * **v1.0.0** — major version: palette swap from cool indigo-violet to\n * warm coral, Material 3 elevation model, light + dark themes,\n * Roboto Flex display font. See README for the migration map and the\n * `hub` repo's `docs/DESIGN.md` for the language behind the choices.\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, darkTokens, lightTokens }`\n * from \"@openkeyai/ui/tokens\" for programmatic colour pickups\n * (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 * Dark is the default. Light mode is opt-in by the consumer:\n *\n * <html data-theme=\"light\">\n *\n * Switches every `--okai-*` color variable to the light palette.\n */\n\n/* ─── Dark palette (default) ──────────────────────────────────────────────── */\n\nconst darkPalette = {\n /** App-wide canvas. Warm dark slate (oklch hue 35). */\n bg: \"oklch(0.13 0.008 35)\",\n /** Surface a half-step lighter than `bg`. Card / panel default. */\n surface: \"oklch(0.17 0.010 35)\",\n /** Surface above `surface` — popovers, hover states. */\n surface1: \"oklch(0.17 0.010 35)\",\n surface2: \"oklch(0.21 0.012 35)\",\n surface3: \"oklch(0.25 0.014 35)\",\n surface4: \"oklch(0.29 0.016 35)\",\n surfaceRaised: \"oklch(0.21 0.012 35)\",\n /** Primary readable text. */\n foreground: \"oklch(0.96 0.005 35)\",\n /** Lower-emphasis text. Captions, metadata. */\n foregroundMuted: \"oklch(0.74 0.008 35)\",\n /** Even lower emphasis — placeholder text, ghost labels. */\n foregroundSubtle: \"oklch(0.58 0.010 35)\",\n /** Subtle border default for cards / dividers. */\n border: \"oklch(1 0 0 / 0.08)\",\n /** Stronger border for inputs + outlined buttons. */\n borderStrong: \"oklch(1 0 0 / 0.14)\",\n /** Brand — warm coral (Material 3 key color, Claude warmth). */\n accent: \"oklch(0.76 0.17 35)\",\n /** Brighter accent for focus rings + active links. */\n accentBright: \"oklch(0.82 0.17 35)\",\n /** Tint that sits behind brand-on-brand content. */\n accentContainer: \"oklch(0.30 0.13 28 / 0.25)\",\n /** Text/icon color on top of accentContainer. */\n onAccentContainer: \"oklch(0.88 0.085 35)\",\n /** Text/icon color on top of solid accent. */\n onAccent: \"oklch(0.13 0.008 35)\",\n /** Destructive action accent — warmer than the old red. */\n destructive: \"oklch(0.74 0.18 28)\",\n /** Success / positive accent — sage. */\n success: \"oklch(0.84 0.08 150)\",\n /** Warning accent — amber. */\n warning: \"oklch(0.88 0.12 80)\",\n} as const;\n\n/* ─── Light palette (opt-in via data-theme=\"light\") ───────────────────────── */\n\nconst lightPalette = {\n bg: \"oklch(0.985 0.005 35)\",\n surface: \"oklch(1 0 0)\",\n surface1: \"oklch(1 0 0)\",\n surface2: \"oklch(0.96 0.006 35)\",\n surface3: \"oklch(0.93 0.008 35)\",\n surface4: \"oklch(0.90 0.010 35)\",\n surfaceRaised: \"oklch(0.96 0.006 35)\",\n foreground: \"oklch(0.18 0.012 35)\",\n foregroundMuted: \"oklch(0.42 0.012 50)\",\n foregroundSubtle: \"oklch(0.58 0.010 50)\",\n border: \"oklch(0 0 0 / 0.08)\",\n borderStrong: \"oklch(0 0 0 / 0.16)\",\n accent: \"oklch(0.64 0.21 30)\",\n accentBright: \"oklch(0.56 0.20 28)\",\n accentContainer: \"oklch(0.93 0.045 35)\",\n onAccentContainer: \"oklch(0.30 0.13 28)\",\n onAccent: \"oklch(1 0 0)\",\n destructive: \"oklch(0.55 0.21 28)\",\n success: \"oklch(0.52 0.10 150)\",\n warning: \"oklch(0.60 0.15 70)\",\n} as const;\n\n/* ─── Shared (theme-invariant) ────────────────────────────────────────────── */\n\nconst shared = {\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 /**\n * Material 3 shape scale. Generous radii, predictable family. One\n * radius per element — NO mixed-corner shapes.\n */\n radius: {\n xs: \"6px\",\n sm: \"10px\",\n md: \"14px\",\n lg: \"20px\",\n xl: \"28px\",\n \"2xl\": \"36px\",\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 * Display — Roboto Flex (Apache 2.0 via Google Fonts). Consumer loads\n * via next/font and exposes the CSS variable `--font-display`. If\n * absent, falls back to the body sans.\n */\n display:\n \"var(--font-display, Geist, ui-sans-serif, system-ui, sans-serif)\",\n },\n fontSize: {\n xs: \"11px\",\n sm: \"13px\",\n base: \"14px\",\n md: \"16px\",\n lg: \"18px\",\n xl: \"22px\",\n \"2xl\": \"28px\",\n \"3xl\": \"36px\",\n \"4xl\": \"48px\",\n /** Big display moments (marketing hero). */\n display: \"60px\",\n },\n lineHeight: {\n /** Display — tight, almost 1:1 to the cap height. */\n display: \"1.05\",\n /** Headlines. */\n tight: \"1.2\",\n /** UI. */\n normal: \"1.5\",\n /** Long-form. */\n relaxed: \"1.65\",\n },\n /**\n * Shadows — heavier in light (real visible shadow), lighter in dark\n * (surface lift carries hierarchy; shadow is just a hairline tint).\n *\n * Values match the hub's `--next-shadow-*` tokens.\n */\n shadow: {\n /** Dark — cards, hover lift. */\n sm:\n \"0 1px 0 oklch(1 0 0 / 0.04), 0 4px 12px oklch(0 0 0 / 0.20)\",\n md:\n \"0 1px 0 oklch(1 0 0 / 0.05), 0 12px 28px oklch(0 0 0 / 0.30)\",\n lg:\n \"0 1px 0 oklch(1 0 0 / 0.06), 0 24px 56px oklch(0 0 0 / 0.38)\",\n /** Light — real shadow values for the light theme. */\n smLight:\n \"0 1px 2px oklch(0.13 0.008 35 / 0.06), 0 4px 12px oklch(0.13 0.008 35 / 0.06)\",\n mdLight:\n \"0 2px 4px oklch(0.13 0.008 35 / 0.08), 0 12px 28px oklch(0.13 0.008 35 / 0.10)\",\n lgLight:\n \"0 4px 8px oklch(0.13 0.008 35 / 0.10), 0 24px 56px oklch(0.13 0.008 35 / 0.14)\",\n },\n motion: {\n /** Material easing — standard. Most UI transitions. */\n easeStandard: \"cubic-bezier(0.2, 0.0, 0.0, 1.0)\",\n /** Material easing — emphasized. Bigger surface motions. */\n easeEmphasized: \"cubic-bezier(0.05, 0.7, 0.1, 1.0)\",\n /** Quick interactions — hover, focus. */\n fast: \"160ms\",\n /** Standard — dialogs, surface moves. */\n normal: \"280ms\",\n /** Used for big route / page transitions. */\n slow: \"400ms\",\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\n/* ─── Exports ─────────────────────────────────────────────────────────────── */\n\n/**\n * Tokens for the **dark** theme (default). For programmatic use; UI\n * components should reference the CSS variables in styles.css which\n * automatically swap to the light palette when `data-theme=\"light\"`.\n */\nexport const darkTokens = {\n color: darkPalette,\n ...shared,\n} as const;\n\n/** Tokens for the **light** theme. */\nexport const lightTokens = {\n color: lightPalette,\n ...shared,\n} as const;\n\n/**\n * Default `tokens` export — dark palette. Kept for backwards\n * compatibility with v0.x callers that did `tokens.color.bg`. The shape\n * is unchanged; only color values have shifted from cool to warm.\n */\nexport const tokens = darkTokens;\n\nexport type DesignTokens = typeof tokens;\n\n/** Names for theming. Use to coerce stringly-typed data into the union. */\nexport type ThemeName = \"dark\" | \"light\";\n"]}