@kbach/react-native 1.0.0-beta.13 → 1.0.0-beta.15

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/index.js CHANGED
@@ -22,445 +22,26 @@ var src_exports = {};
22
22
  __export(src_exports, {
23
23
  ThemeProvider: () => ThemeProvider,
24
24
  applyKbachConfig: () => applyKbachConfig,
25
- defaultTheme: () => defaultTheme,
26
- getGlobalDarkMode: () => getGlobalDarkMode,
27
- getGlobalThemeMode: () => getGlobalThemeMode,
28
- getTheme: () => getTheme,
25
+ defaultTheme: () => import_theme4.defaultTheme,
26
+ getGlobalDarkMode: () => import_darkModeStore4.getGlobalDarkMode,
27
+ getGlobalThemeMode: () => import_darkModeStore4.getGlobalThemeMode,
28
+ getTheme: () => import_theme4.getTheme,
29
29
  resolveKbachConfig: () => resolveKbachConfig,
30
30
  resolveStyle: () => resolveStyle,
31
- setGlobalThemeMode: () => setGlobalThemeMode,
32
- setTheme: () => setTheme,
33
- subscribeGlobalDarkMode: () => subscribeGlobalDarkMode,
34
- toggleGlobalDarkMode: () => toggleGlobalDarkMode,
31
+ setGlobalThemeMode: () => import_darkModeStore4.setGlobalThemeMode,
32
+ setTheme: () => import_theme4.setTheme,
33
+ subscribeGlobalDarkMode: () => import_darkModeStore4.subscribeGlobalDarkMode,
34
+ toggleGlobalDarkMode: () => import_darkModeStore4.toggleGlobalDarkMode,
35
35
  useColors: () => useColors,
36
36
  useTheme: () => useTheme
37
37
  });
38
38
  module.exports = __toCommonJS(src_exports);
39
-
40
- // src/generatedPalette.ts
41
- var PALETTE = {
42
- "amber-1": "#fffbeb",
43
- "amber-10": "#78350f",
44
- "amber-11": "#451a03",
45
- "amber-12": "#291002",
46
- "amber-2": "#fef3c7",
47
- "amber-3": "#fde68a",
48
- "amber-4": "#fcd34d",
49
- "amber-5": "#fbbf24",
50
- "amber-6": "#f59e0b",
51
- "amber-7": "#d97706",
52
- "amber-8": "#b45309",
53
- "amber-9": "#92400e",
54
- "black": "#000000",
55
- "blue-1": "#eff6ff",
56
- "blue-10": "#1e3a8a",
57
- "blue-11": "#172554",
58
- "blue-12": "#0d1633",
59
- "blue-2": "#dbeafe",
60
- "blue-3": "#bfdbfe",
61
- "blue-4": "#93c5fd",
62
- "blue-5": "#60a5fa",
63
- "blue-6": "#3b82f6",
64
- "blue-7": "#2563eb",
65
- "blue-8": "#1d4ed8",
66
- "blue-9": "#1e40af",
67
- "bronze": "#cd7f32",
68
- "coal": "#1c1c1c",
69
- "copper": "#b87333",
70
- "current": "currentColor",
71
- "cyan-1": "#ecfeff",
72
- "cyan-10": "#164e63",
73
- "cyan-11": "#083344",
74
- "cyan-12": "#041e28",
75
- "cyan-2": "#cffafe",
76
- "cyan-3": "#a5f3fc",
77
- "cyan-4": "#67e8f9",
78
- "cyan-5": "#22d3ee",
79
- "cyan-6": "#06b6d4",
80
- "cyan-7": "#0891b2",
81
- "cyan-8": "#0e7490",
82
- "cyan-9": "#155e75",
83
- "emerald-1": "#ecfdf5",
84
- "emerald-10": "#064e3b",
85
- "emerald-11": "#022c22",
86
- "emerald-12": "#011a14",
87
- "emerald-2": "#d1fae5",
88
- "emerald-3": "#a7f3d0",
89
- "emerald-4": "#6ee7b7",
90
- "emerald-5": "#34d399",
91
- "emerald-6": "#10b981",
92
- "emerald-7": "#059669",
93
- "emerald-8": "#047857",
94
- "emerald-9": "#065f46",
95
- "fuchsia-1": "#fdf4ff",
96
- "fuchsia-10": "#701a75",
97
- "fuchsia-11": "#4a044e",
98
- "fuchsia-12": "#2d022f",
99
- "fuchsia-2": "#fae8ff",
100
- "fuchsia-3": "#f5d0fe",
101
- "fuchsia-4": "#f0abfc",
102
- "fuchsia-5": "#e879f9",
103
- "fuchsia-6": "#d946ef",
104
- "fuchsia-7": "#c026d3",
105
- "fuchsia-8": "#a21caf",
106
- "fuchsia-9": "#86198f",
107
- "gold": "#d4af37",
108
- "gray-1": "#f9fafb",
109
- "gray-10": "#111827",
110
- "gray-11": "#030712",
111
- "gray-12": "#020409",
112
- "gray-2": "#f3f4f6",
113
- "gray-3": "#e5e7eb",
114
- "gray-4": "#d1d5db",
115
- "gray-5": "#9ca3af",
116
- "gray-6": "#6b7280",
117
- "gray-7": "#4b5563",
118
- "gray-8": "#374151",
119
- "gray-9": "#1f2937",
120
- "green-1": "#f0fdf4",
121
- "green-10": "#14532d",
122
- "green-11": "#052e16",
123
- "green-12": "#031b0d",
124
- "green-2": "#dcfce7",
125
- "green-3": "#bbf7d0",
126
- "green-4": "#86efac",
127
- "green-5": "#4ade80",
128
- "green-6": "#22c55e",
129
- "green-7": "#16a34a",
130
- "green-8": "#15803d",
131
- "green-9": "#166534",
132
- "indigo-1": "#eef2ff",
133
- "indigo-10": "#312e81",
134
- "indigo-11": "#1e1b4b",
135
- "indigo-12": "#12102d",
136
- "indigo-2": "#e0e7ff",
137
- "indigo-3": "#c7d2fe",
138
- "indigo-4": "#a5b4fc",
139
- "indigo-5": "#818cf8",
140
- "indigo-6": "#6366f1",
141
- "indigo-7": "#4f46e5",
142
- "indigo-8": "#4338ca",
143
- "indigo-9": "#3730a3",
144
- "lime-1": "#f7fee7",
145
- "lime-10": "#365314",
146
- "lime-11": "#1a2e05",
147
- "lime-12": "#0f1b03",
148
- "lime-2": "#ecfccb",
149
- "lime-3": "#d9f99d",
150
- "lime-4": "#bef264",
151
- "lime-5": "#a3e635",
152
- "lime-6": "#84cc16",
153
- "lime-7": "#65a30d",
154
- "lime-8": "#4d7c0f",
155
- "lime-9": "#3f6212",
156
- "neutral-1": "#fafafa",
157
- "neutral-10": "#171717",
158
- "neutral-11": "#0a0a0a",
159
- "neutral-12": "#050505",
160
- "neutral-2": "#f5f5f5",
161
- "neutral-3": "#e5e5e5",
162
- "neutral-4": "#d4d4d4",
163
- "neutral-5": "#a3a3a3",
164
- "neutral-6": "#737373",
165
- "neutral-7": "#525252",
166
- "neutral-8": "#404040",
167
- "neutral-9": "#262626",
168
- "orange-1": "#fff7ed",
169
- "orange-10": "#7c2d12",
170
- "orange-11": "#431407",
171
- "orange-12": "#270c04",
172
- "orange-2": "#ffedd5",
173
- "orange-3": "#fed7aa",
174
- "orange-4": "#fdba74",
175
- "orange-5": "#fb923c",
176
- "orange-6": "#f97316",
177
- "orange-7": "#ea580c",
178
- "orange-8": "#c2410c",
179
- "orange-9": "#9a3412",
180
- "pink-1": "#fdf2f8",
181
- "pink-10": "#831843",
182
- "pink-11": "#500724",
183
- "pink-12": "#300415",
184
- "pink-2": "#fce7f3",
185
- "pink-3": "#fbcfe8",
186
- "pink-4": "#f9a8d4",
187
- "pink-5": "#f472b6",
188
- "pink-6": "#ec4899",
189
- "pink-7": "#db2777",
190
- "pink-8": "#be185d",
191
- "pink-9": "#9d174d",
192
- "purple-1": "#faf5ff",
193
- "purple-10": "#581c87",
194
- "purple-11": "#3b0764",
195
- "purple-12": "#23043c",
196
- "purple-2": "#f3e8ff",
197
- "purple-3": "#e9d5ff",
198
- "purple-4": "#d8b4fe",
199
- "purple-5": "#c084fc",
200
- "purple-6": "#a855f7",
201
- "purple-7": "#9333ea",
202
- "purple-8": "#7e22ce",
203
- "purple-9": "#6b21a8",
204
- "red-1": "#fef2f2",
205
- "red-10": "#7f1d1d",
206
- "red-11": "#450a0a",
207
- "red-12": "#280606",
208
- "red-2": "#fee2e2",
209
- "red-3": "#fecaca",
210
- "red-4": "#fca5a5",
211
- "red-5": "#f87171",
212
- "red-6": "#ef4444",
213
- "red-7": "#dc2626",
214
- "red-8": "#b91c1c",
215
- "red-9": "#991b1b",
216
- "rose-1": "#fff1f2",
217
- "rose-10": "#881337",
218
- "rose-11": "#4c0519",
219
- "rose-12": "#2d030e",
220
- "rose-2": "#ffe4e6",
221
- "rose-3": "#fecdd3",
222
- "rose-4": "#fda4af",
223
- "rose-5": "#fb7185",
224
- "rose-6": "#f43f5e",
225
- "rose-7": "#e11d48",
226
- "rose-8": "#be123c",
227
- "rose-9": "#9f1239",
228
- "silver": "#c0c0c0",
229
- "sky-1": "#f0f9ff",
230
- "sky-10": "#0c4a6e",
231
- "sky-11": "#082f49",
232
- "sky-12": "#041b2b",
233
- "sky-2": "#e0f2fe",
234
- "sky-3": "#bae6fd",
235
- "sky-4": "#7dd3fc",
236
- "sky-5": "#38bdf8",
237
- "sky-6": "#0ea5e9",
238
- "sky-7": "#0284c7",
239
- "sky-8": "#0369a1",
240
- "sky-9": "#075985",
241
- "slate-1": "#f8fafc",
242
- "slate-10": "#0f172a",
243
- "slate-11": "#020617",
244
- "slate-12": "#01020a",
245
- "slate-2": "#f1f5f9",
246
- "slate-3": "#e2e8f0",
247
- "slate-4": "#cbd5e1",
248
- "slate-5": "#94a3b8",
249
- "slate-6": "#64748b",
250
- "slate-7": "#475569",
251
- "slate-8": "#334155",
252
- "slate-9": "#1e293b",
253
- "stone-1": "#fafaf9",
254
- "stone-10": "#1c1917",
255
- "stone-11": "#0c0a09",
256
- "stone-12": "#070605",
257
- "stone-2": "#f5f5f4",
258
- "stone-3": "#e7e5e4",
259
- "stone-4": "#d6d3d1",
260
- "stone-5": "#a8a29e",
261
- "stone-6": "#78716c",
262
- "stone-7": "#57534e",
263
- "stone-8": "#44403c",
264
- "stone-9": "#292524",
265
- "teal-1": "#f0fdfa",
266
- "teal-10": "#134e4a",
267
- "teal-11": "#042f2e",
268
- "teal-12": "#021c1b",
269
- "teal-2": "#ccfbf1",
270
- "teal-3": "#99f6e4",
271
- "teal-4": "#5eead4",
272
- "teal-5": "#2dd4bf",
273
- "teal-6": "#14b8a6",
274
- "teal-7": "#0d9488",
275
- "teal-8": "#0f766e",
276
- "teal-9": "#115e59",
277
- "transparent": "transparent",
278
- "violet-1": "#f5f3ff",
279
- "violet-10": "#4c1d95",
280
- "violet-11": "#2e1065",
281
- "violet-12": "#1c0a3d",
282
- "violet-2": "#ede9fe",
283
- "violet-3": "#ddd6fe",
284
- "violet-4": "#c4b5fd",
285
- "violet-5": "#a78bfa",
286
- "violet-6": "#8b5cf6",
287
- "violet-7": "#7c3aed",
288
- "violet-8": "#6d28d9",
289
- "violet-9": "#5b21b6",
290
- "white": "#ffffff",
291
- "yellow-1": "#fefce8",
292
- "yellow-10": "#713f12",
293
- "yellow-11": "#422006",
294
- "yellow-12": "#271304",
295
- "yellow-2": "#fef9c3",
296
- "yellow-3": "#fef08a",
297
- "yellow-4": "#fde047",
298
- "yellow-5": "#facc15",
299
- "yellow-6": "#eab308",
300
- "yellow-7": "#ca8a04",
301
- "yellow-8": "#a16207",
302
- "yellow-9": "#854d0e",
303
- "zinc-1": "#fafafa",
304
- "zinc-10": "#18181b",
305
- "zinc-11": "#09090b",
306
- "zinc-12": "#050506",
307
- "zinc-2": "#f4f4f5",
308
- "zinc-3": "#e4e4e7",
309
- "zinc-4": "#d4d4d8",
310
- "zinc-5": "#a1a1aa",
311
- "zinc-6": "#71717a",
312
- "zinc-7": "#52525b",
313
- "zinc-8": "#3f3f46",
314
- "zinc-9": "#27272a"
315
- };
316
-
317
- // src/theme.ts
318
- var defaultTheme = {
319
- colors: PALETTE,
320
- // Real Tailwind's default spacing scale in full — every step is exactly
321
- // `n * 4px`, including the fractional `.5` steps (`1.5` -> 6px, `2.5` ->
322
- // 10px, `3.5` -> 14px) and the "px" literal (a bare 1px). Only the
323
- // "usual stops", though — `jsEngine/shared.ts`'s `spacingPx` (and the
324
- // native Rust dispatcher's own `spacing_px`) falls back to Tailwind v4's
325
- // live `n * 4px` formula for any bare numeric step not listed here
326
- // (`p-0.25`, `w-13`, ...), so this table names the common values and
327
- // gives a theme override something to target, not the full resolvable
328
- // set. Mirrors @kbach/react's theme.ts exactly.
329
- spacing: {
330
- "0": 0,
331
- "px": 1,
332
- "0.5": 2,
333
- "1": 4,
334
- "1.5": 6,
335
- "2": 8,
336
- "2.5": 10,
337
- "3": 12,
338
- "3.5": 14,
339
- "4": 16,
340
- "5": 20,
341
- "6": 24,
342
- "7": 28,
343
- "8": 32,
344
- "9": 36,
345
- "10": 40,
346
- "11": 44,
347
- "12": 48,
348
- "14": 56,
349
- "16": 64,
350
- "20": 80,
351
- "24": 96,
352
- "28": 112,
353
- "32": 128,
354
- "36": 144,
355
- "40": 160,
356
- "44": 176,
357
- "48": 192,
358
- "52": 208,
359
- "56": 224,
360
- "60": 240,
361
- "64": 256,
362
- "72": 288,
363
- "80": 320,
364
- "96": 384
365
- },
366
- screens: {
367
- sm: 640,
368
- md: 768,
369
- lg: 1024,
370
- xl: 1280,
371
- "2xl": 1536
372
- },
373
- // Byte-for-byte the same three stacks
374
- // packages/core-engine/src/resolvers/typography.rs's `font_family_value`
375
- // falls back to. On native these three still effectively no-op (see
376
- // `first_font_name`'s own doc comment for why a generic CSS keyword
377
- // isn't a real loadable font) — only a caller-configured custom name
378
- // changes native rendering; Expo Web uses the full stack as-is.
379
- fontFamily: {
380
- sans: 'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',
381
- serif: 'ui-serif, Georgia, Cambria, "Times New Roman", Times, serif',
382
- mono: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'
383
- },
384
- darkMode: "attribute",
385
- // Empty by default, matching real Tailwind's own defaults.
386
- container: {}
387
- };
388
- var activeTheme = defaultTheme;
389
- var activeThemeJson = JSON.stringify(defaultTheme);
390
- function setTheme(theme) {
391
- activeTheme = theme;
392
- activeThemeJson = JSON.stringify(theme);
393
- }
394
- function getTheme() {
395
- return activeTheme;
396
- }
397
- function getThemeJson() {
398
- return activeThemeJson;
399
- }
39
+ var import_theme4 = require("./theme");
400
40
 
401
41
  // src/nativeBridge.ts
402
- var import_react_native2 = require("react-native");
403
-
404
- // src/darkModeStore.ts
405
42
  var import_react_native = require("react-native");
406
- var listeners = /* @__PURE__ */ new Set();
407
- function systemPrefersDark() {
408
- return import_react_native.Appearance.getColorScheme() === "dark";
409
- }
410
- function resolveIsDark(m) {
411
- return m === "system" ? systemPrefersDark() : m === "dark";
412
- }
413
- function applyToDom(dark) {
414
- if (typeof document === "undefined") return;
415
- const root = document.documentElement;
416
- const strategy = getTheme().darkMode;
417
- if (strategy === "class") {
418
- root.classList.toggle("dark", dark);
419
- root.classList.toggle("light", !dark);
420
- } else if (strategy === "attribute") {
421
- root.setAttribute("data-theme", dark ? "dark" : "light");
422
- }
423
- }
424
- var mode = "system";
425
- var isDark = resolveIsDark(mode);
426
- applyToDom(isDark);
427
- var hasExplicitChoice = false;
428
- var subscription = import_react_native.Appearance.addChangeListener(({ colorScheme }) => {
429
- if (mode !== "system") return;
430
- isDark = colorScheme === "dark";
431
- applyToDom(isDark);
432
- notify();
433
- });
434
- function notify() {
435
- for (const listener of listeners) listener();
436
- }
437
- function getGlobalDarkMode() {
438
- return isDark;
439
- }
440
- function getGlobalThemeMode() {
441
- return mode;
442
- }
443
- function setGlobalThemeMode(nextMode) {
444
- mode = nextMode;
445
- isDark = resolveIsDark(nextMode);
446
- hasExplicitChoice = true;
447
- applyToDom(isDark);
448
- notify();
449
- }
450
- function toggleGlobalDarkMode() {
451
- setGlobalThemeMode(isDark ? "light" : "dark");
452
- }
453
- function subscribeGlobalDarkMode(listener) {
454
- listeners.add(listener);
455
- return () => listeners.delete(listener);
456
- }
457
- function seedDefaultMode(fallback) {
458
- if (hasExplicitChoice || mode === fallback) return;
459
- mode = fallback;
460
- isDark = resolveIsDark(fallback);
461
- applyToDom(isDark);
462
- notify();
463
- }
43
+ var import_theme = require("./theme");
44
+ var import_darkModeStore = require("./darkModeStore");
464
45
 
465
46
  // src/jsEngine/parser.ts
466
47
  var VALUE_PREFIXES = [
@@ -1677,17 +1258,18 @@ function resolveStyleJs(classString, theme, colorScheme, pressed, width) {
1677
1258
 
1678
1259
  // src/nativeBridge.ts
1679
1260
  function resolveStyle(classString, pressed = false) {
1680
- const colorScheme = getGlobalDarkMode() ? "dark" : "light";
1681
- const width = import_react_native2.Dimensions.get("window").width;
1682
- const KbachModule = import_react_native2.TurboModuleRegistry.get("KbachModule");
1261
+ const colorScheme = (0, import_darkModeStore.getGlobalDarkMode)() ? "dark" : "light";
1262
+ const width = import_react_native.Dimensions.get("window").width;
1263
+ const KbachModule = import_react_native.TurboModuleRegistry.get("KbachModule");
1683
1264
  if (!KbachModule) {
1684
- return resolveStyleJs(classString, getTheme(), colorScheme, pressed, width);
1265
+ return resolveStyleJs(classString, (0, import_theme.getTheme)(), colorScheme, pressed, width);
1685
1266
  }
1686
- const json = KbachModule.resolveStyle(classString, getThemeJson(), colorScheme, pressed, width);
1267
+ const json = KbachModule.resolveStyle(classString, (0, import_theme.getThemeJson)(), colorScheme, pressed, width);
1687
1268
  return JSON.parse(json);
1688
1269
  }
1689
1270
 
1690
1271
  // src/config.ts
1272
+ var import_theme2 = require("./theme");
1691
1273
  function parseHexRgb(hex) {
1692
1274
  const m = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(hex.trim());
1693
1275
  if (!m) return null;
@@ -1723,7 +1305,7 @@ function resolveColors(extend, existing) {
1723
1305
  return resolved;
1724
1306
  }
1725
1307
  function resolveKbachConfig(config) {
1726
- let theme = { ...defaultTheme, ...config.theme };
1308
+ let theme = { ...import_theme2.defaultTheme, ...config.theme };
1727
1309
  if (config.extend?.colors) {
1728
1310
  theme = { ...theme, colors: { ...theme.colors, ...resolveColors(config.extend.colors, theme.colors) } };
1729
1311
  }
@@ -1746,23 +1328,25 @@ function resolveKbachConfig(config) {
1746
1328
  }
1747
1329
  function applyKbachConfig(config) {
1748
1330
  const theme = resolveKbachConfig(config);
1749
- setTheme(theme);
1331
+ (0, import_theme2.setTheme)(theme);
1750
1332
  return theme;
1751
1333
  }
1752
1334
 
1753
1335
  // src/useTheme.ts
1754
1336
  var import_react = require("react");
1337
+ var import_darkModeStore2 = require("./darkModeStore");
1755
1338
  function useTheme() {
1756
- const isDark2 = (0, import_react.useSyncExternalStore)(subscribeGlobalDarkMode, getGlobalDarkMode);
1757
- const mode2 = (0, import_react.useSyncExternalStore)(subscribeGlobalDarkMode, getGlobalThemeMode);
1339
+ const isDark = (0, import_react.useSyncExternalStore)(import_darkModeStore2.subscribeGlobalDarkMode, import_darkModeStore2.getGlobalDarkMode);
1340
+ const mode = (0, import_react.useSyncExternalStore)(import_darkModeStore2.subscribeGlobalDarkMode, import_darkModeStore2.getGlobalThemeMode);
1758
1341
  return (0, import_react.useMemo)(
1759
- () => ({ mode: mode2, isDark: isDark2, setMode: setGlobalThemeMode, toggle: toggleGlobalDarkMode }),
1760
- [mode2, isDark2]
1342
+ () => ({ mode, isDark, setMode: import_darkModeStore2.setGlobalThemeMode, toggle: import_darkModeStore2.toggleGlobalDarkMode }),
1343
+ [mode, isDark]
1761
1344
  );
1762
1345
  }
1763
1346
 
1764
1347
  // src/ThemeProvider.tsx
1765
1348
  var import_react2 = require("react");
1349
+ var import_darkModeStore3 = require("./darkModeStore");
1766
1350
  var import_jsx_runtime = require("react/jsx-runtime");
1767
1351
  var mountedProviderCount = 0;
1768
1352
  var warnedMultipleProviders = false;
@@ -1783,12 +1367,16 @@ function ThemeProvider({ children, defaultMode = "system" }) {
1783
1367
  (0, import_react2.useEffect)(() => {
1784
1368
  if (seeded.current) return;
1785
1369
  seeded.current = true;
1786
- seedDefaultMode(defaultMode);
1370
+ (0, import_darkModeStore3.seedDefaultMode)(defaultMode);
1787
1371
  }, []);
1788
1372
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
1789
1373
  }
1790
1374
 
1375
+ // src/index.ts
1376
+ var import_darkModeStore4 = require("./darkModeStore");
1377
+
1791
1378
  // src/useColors.ts
1379
+ var import_theme3 = require("./theme");
1792
1380
  function parseHexRgb2(hex) {
1793
1381
  const m = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(hex.trim());
1794
1382
  if (!m) return null;
@@ -1807,10 +1395,10 @@ function applyOpacity(color, opacity) {
1807
1395
  if (color.startsWith("rgba(")) return color.replace(/,\s*[\d.]+\)$/, `,${a})`);
1808
1396
  return color;
1809
1397
  }
1810
- function resolveEntry(entry, isDark2) {
1811
- return typeof entry === "string" ? entry : isDark2 ? entry.dark : entry.light;
1398
+ function resolveEntry(entry, isDark) {
1399
+ return typeof entry === "string" ? entry : isDark ? entry.dark : entry.light;
1812
1400
  }
1813
- function makeColorsProxy(theme, isDark2) {
1401
+ function makeColorsProxy(theme, isDark) {
1814
1402
  const alpha = (color, opacity) => opacity === void 0 ? color : applyOpacity(color, opacity);
1815
1403
  const cache = /* @__PURE__ */ new Map();
1816
1404
  function resolveNamed(key) {
@@ -1823,7 +1411,7 @@ function makeColorsProxy(theme, isDark2) {
1823
1411
  }
1824
1412
  const entry = theme.colors[name];
1825
1413
  if (entry === void 0) return void 0;
1826
- const value = resolveEntry(entry, isDark2);
1414
+ const value = resolveEntry(entry, isDark);
1827
1415
  return opacity === void 0 ? value : applyOpacity(value, opacity);
1828
1416
  }
1829
1417
  function makeFamilyProxy(family) {
@@ -1848,8 +1436,8 @@ function makeColorsProxy(theme, isDark2) {
1848
1436
  });
1849
1437
  }
1850
1438
  function useColors() {
1851
- const { isDark: isDark2 } = useTheme();
1852
- return makeColorsProxy(getTheme(), isDark2);
1439
+ const { isDark } = useTheme();
1440
+ return makeColorsProxy((0, import_theme3.getTheme)(), isDark);
1853
1441
  }
1854
1442
  // Annotate the CommonJS export names for ESM import in node:
1855
1443
  0 && (module.exports = {