@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/tokens.js CHANGED
@@ -1,27 +1,65 @@
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"
24
- },
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 lightPalette = {
41
+ bg: "oklch(0.985 0.005 35)",
42
+ surface: "oklch(1 0 0)",
43
+ surface1: "oklch(1 0 0)",
44
+ surface2: "oklch(0.96 0.006 35)",
45
+ surface3: "oklch(0.93 0.008 35)",
46
+ surface4: "oklch(0.90 0.010 35)",
47
+ surfaceRaised: "oklch(0.96 0.006 35)",
48
+ foreground: "oklch(0.18 0.012 35)",
49
+ foregroundMuted: "oklch(0.42 0.012 50)",
50
+ foregroundSubtle: "oklch(0.58 0.010 50)",
51
+ border: "oklch(0 0 0 / 0.08)",
52
+ borderStrong: "oklch(0 0 0 / 0.16)",
53
+ accent: "oklch(0.64 0.21 30)",
54
+ accentBright: "oklch(0.56 0.20 28)",
55
+ accentContainer: "oklch(0.93 0.045 35)",
56
+ onAccentContainer: "oklch(0.30 0.13 28)",
57
+ onAccent: "oklch(1 0 0)",
58
+ destructive: "oklch(0.55 0.21 28)",
59
+ success: "oklch(0.52 0.10 150)",
60
+ warning: "oklch(0.60 0.15 70)"
61
+ };
62
+ var shared = {
25
63
  /** 4px base. Use multiples of these for layout — keeps the grid honest. */
26
64
  space: {
27
65
  px: "1px",
@@ -38,20 +76,30 @@ var tokens = {
38
76
  "12": "48px",
39
77
  "16": "64px"
40
78
  },
79
+ /**
80
+ * Material 3 shape scale. Generous radii, predictable family. One
81
+ * radius per element — NO mixed-corner shapes.
82
+ */
41
83
  radius: {
42
- sm: "4px",
43
- md: "8px",
44
- lg: "12px",
45
- /** Default for cards and surfaces. */
46
- xl: "16px",
47
- "2xl": "20px",
84
+ xs: "6px",
85
+ sm: "10px",
86
+ md: "14px",
87
+ lg: "20px",
88
+ xl: "28px",
89
+ "2xl": "36px",
48
90
  full: "9999px"
49
91
  },
50
92
  font: {
51
93
  /** Geist Sans — opt-in by the consumer's stack. We just suggest it. */
52
94
  sans: 'Geist, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
53
95
  /** Geist Mono for code + hashes + token displays. */
54
- mono: 'Geist Mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace'
96
+ mono: 'Geist Mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace',
97
+ /**
98
+ * Display — Roboto Flex (Apache 2.0 via Google Fonts). Consumer loads
99
+ * via next/font and exposes the CSS variable `--font-display`. If
100
+ * absent, falls back to the body sans.
101
+ */
102
+ display: "var(--font-display, Geist, ui-sans-serif, system-ui, sans-serif)"
55
103
  },
56
104
  fontSize: {
57
105
  xs: "11px",
@@ -59,30 +107,50 @@ var tokens = {
59
107
  base: "14px",
60
108
  md: "16px",
61
109
  lg: "18px",
62
- xl: "22px"
110
+ xl: "22px",
111
+ "2xl": "28px",
112
+ "3xl": "36px",
113
+ "4xl": "48px",
114
+ /** Big display moments (marketing hero). */
115
+ display: "60px"
63
116
  },
64
117
  lineHeight: {
118
+ /** Display — tight, almost 1:1 to the cap height. */
119
+ display: "1.05",
120
+ /** Headlines. */
65
121
  tight: "1.2",
122
+ /** UI. */
66
123
  normal: "1.5",
124
+ /** Long-form. */
67
125
  relaxed: "1.65"
68
126
  },
127
+ /**
128
+ * Shadows — heavier in light (real visible shadow), lighter in dark
129
+ * (surface lift carries hierarchy; shadow is just a hairline tint).
130
+ *
131
+ * Values match the hub's `--next-shadow-*` tokens.
132
+ */
69
133
  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)"
134
+ /** Dark cards, hover lift. */
135
+ sm: "0 1px 0 oklch(1 0 0 / 0.04), 0 4px 12px oklch(0 0 0 / 0.20)",
136
+ md: "0 1px 0 oklch(1 0 0 / 0.05), 0 12px 28px oklch(0 0 0 / 0.30)",
137
+ lg: "0 1px 0 oklch(1 0 0 / 0.06), 0 24px 56px oklch(0 0 0 / 0.38)",
138
+ /** Light — real shadow values for the light theme. */
139
+ smLight: "0 1px 2px oklch(0.13 0.008 35 / 0.06), 0 4px 12px oklch(0.13 0.008 35 / 0.06)",
140
+ mdLight: "0 2px 4px oklch(0.13 0.008 35 / 0.08), 0 12px 28px oklch(0.13 0.008 35 / 0.10)",
141
+ lgLight: "0 4px 8px oklch(0.13 0.008 35 / 0.10), 0 24px 56px oklch(0.13 0.008 35 / 0.14)"
76
142
  },
77
143
  motion: {
78
- /** Default easing — feels good for most UI. */
79
- ease: "cubic-bezier(0.4, 0.0, 0.2, 1)",
144
+ /** Material easing — standard. Most UI transitions. */
145
+ easeStandard: "cubic-bezier(0.2, 0.0, 0.0, 1.0)",
146
+ /** Material easing — emphasized. Bigger surface motions. */
147
+ easeEmphasized: "cubic-bezier(0.05, 0.7, 0.1, 1.0)",
80
148
  /** Quick interactions — hover, focus. */
81
- fast: "120ms",
82
- /** Standard — most state transitions. */
83
- normal: "180ms",
84
- /** Used for entrance / exit animations. */
85
- slow: "260ms"
149
+ fast: "160ms",
150
+ /** Standard — dialogs, surface moves. */
151
+ normal: "280ms",
152
+ /** Used for big route / page transitions. */
153
+ slow: "400ms"
86
154
  },
87
155
  /** Z-index scale. Use these names, never raw numbers. */
88
156
  z: {
@@ -101,7 +169,16 @@ var tokens = {
101
169
  headerHeight: "56px"
102
170
  }
103
171
  };
172
+ var darkTokens = {
173
+ color: darkPalette,
174
+ ...shared
175
+ };
176
+ var lightTokens = {
177
+ color: lightPalette,
178
+ ...shared
179
+ };
180
+ var tokens = darkTokens;
104
181
 
105
- export { tokens };
182
+ export { darkTokens, lightTokens, tokens };
106
183
  //# sourceMappingURL=tokens.js.map
107
184
  //# sourceMappingURL=tokens.js.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;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,M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;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;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A,GAAc;AAAA,EACzB,KAAA,EAAO,YAAA;AAAA,EACP,GAAG;AACL;AAOO,IAAM,MAAA,GAAS","file":"tokens.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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openkeyai/ui",
3
- "version": "0.1.0",
3
+ "version": "1.0.0",
4
4
  "description": "Design system + mandatory HubHeader for OpenKey AI tools.",
5
5
  "license": "MIT",
6
6
  "author": "Scott Goodwin",