@tydavidson/design-system 1.1.16 → 1.1.18

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.
@@ -1,6 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ThemeProviderProps } from 'next-themes/dist/types';
3
- import * as React from 'react';
4
3
 
5
4
  /**
6
5
  * Utility functions for theme handling
@@ -60,57 +59,6 @@ declare function ThemeProvider({ children, ...props }: ThemeProviderProps): reac
60
59
  */
61
60
  declare function ThemeProviderNoSSR({ children, ...props }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
62
61
 
63
- /**
64
- * Server-safe theme hook that can be used in Server Components
65
- * Returns default theme values without accessing client-side APIs
66
- */
67
- declare function useThemeServer(): {
68
- theme: string;
69
- setTheme: (theme: string) => void;
70
- resolvedTheme: string;
71
- isDark: boolean;
72
- };
73
- /**
74
- * @deprecated Use ThemeProvider from './theme-provider' instead
75
- * This component is kept for backward compatibility but is no longer needed
76
- */
77
- declare function ThemeContextProvider({ children }: {
78
- children: React.ReactNode;
79
- }): react_jsx_runtime.JSX.Element;
80
- /**
81
- * @deprecated Use useTheme from next-themes directly or use the ThemeProvider
82
- * This hook is kept for backward compatibility but is no longer needed
83
- */
84
- declare function useTheme(): {
85
- theme: string;
86
- setTheme: (theme: string) => void;
87
- resolvedTheme: string;
88
- isDark: boolean;
89
- };
90
-
91
- /**
92
- * Props for the ThemeToggle component
93
- */
94
- interface ThemeToggleProps extends React.HTMLAttributes<HTMLButtonElement> {
95
- /**
96
- * Variant of the toggle
97
- * @default 'icon'
98
- */
99
- variant?: 'icon' | 'switch' | 'button';
100
- /**
101
- * Size of the toggle
102
- * @default 'md'
103
- */
104
- size?: 'sm' | 'md' | 'lg';
105
- }
106
- /**
107
- * ThemeToggle component to switch between light and dark themes
108
- *
109
- * IMPORTANT: This component uses React hooks and must only be used in Client Components.
110
- * For Server Components, use ClientThemeToggle from the themes package instead.
111
- */
112
- declare function ThemeToggle({ className, variant, size, ...props }: ThemeToggleProps): react_jsx_runtime.JSX.Element;
113
-
114
62
  /**
115
63
  * Client-only theme provider wrapper
116
64
  * This component ensures theme functionality only runs on the client side
@@ -124,4 +72,15 @@ declare function ClientThemeProvider({ children, ...props }: ThemeProviderProps)
124
72
  */
125
73
  declare function ClientThemeToggle(props: any): react_jsx_runtime.JSX.Element;
126
74
 
127
- export { ClientThemeProvider, ClientThemeToggle, type ComponentVariant, type ThemeColor, ThemeContextProvider, ThemeProvider, ThemeProviderNoSSR, ThemeToggle, getColorVariantClasses, isDarkTheme, mapColorToShadcnVariant, mapVariantToShadcnVariant, useTheme, useThemeServer };
75
+ /**
76
+ * Server-safe theme hook that can be used in Server Components
77
+ * Returns default theme values without accessing client-side APIs
78
+ */
79
+ declare function useThemeServer(): {
80
+ theme: string;
81
+ setTheme: (theme: string) => void;
82
+ resolvedTheme: string;
83
+ isDark: boolean;
84
+ };
85
+
86
+ export { ClientThemeProvider, ClientThemeToggle, type ComponentVariant, type ThemeColor, ThemeProvider, ThemeProviderNoSSR, getColorVariantClasses, isDarkTheme, mapColorToShadcnVariant, mapVariantToShadcnVariant, useThemeServer };
@@ -1,6 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ThemeProviderProps } from 'next-themes/dist/types';
3
- import * as React from 'react';
4
3
 
5
4
  /**
6
5
  * Utility functions for theme handling
@@ -60,57 +59,6 @@ declare function ThemeProvider({ children, ...props }: ThemeProviderProps): reac
60
59
  */
61
60
  declare function ThemeProviderNoSSR({ children, ...props }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
62
61
 
63
- /**
64
- * Server-safe theme hook that can be used in Server Components
65
- * Returns default theme values without accessing client-side APIs
66
- */
67
- declare function useThemeServer(): {
68
- theme: string;
69
- setTheme: (theme: string) => void;
70
- resolvedTheme: string;
71
- isDark: boolean;
72
- };
73
- /**
74
- * @deprecated Use ThemeProvider from './theme-provider' instead
75
- * This component is kept for backward compatibility but is no longer needed
76
- */
77
- declare function ThemeContextProvider({ children }: {
78
- children: React.ReactNode;
79
- }): react_jsx_runtime.JSX.Element;
80
- /**
81
- * @deprecated Use useTheme from next-themes directly or use the ThemeProvider
82
- * This hook is kept for backward compatibility but is no longer needed
83
- */
84
- declare function useTheme(): {
85
- theme: string;
86
- setTheme: (theme: string) => void;
87
- resolvedTheme: string;
88
- isDark: boolean;
89
- };
90
-
91
- /**
92
- * Props for the ThemeToggle component
93
- */
94
- interface ThemeToggleProps extends React.HTMLAttributes<HTMLButtonElement> {
95
- /**
96
- * Variant of the toggle
97
- * @default 'icon'
98
- */
99
- variant?: 'icon' | 'switch' | 'button';
100
- /**
101
- * Size of the toggle
102
- * @default 'md'
103
- */
104
- size?: 'sm' | 'md' | 'lg';
105
- }
106
- /**
107
- * ThemeToggle component to switch between light and dark themes
108
- *
109
- * IMPORTANT: This component uses React hooks and must only be used in Client Components.
110
- * For Server Components, use ClientThemeToggle from the themes package instead.
111
- */
112
- declare function ThemeToggle({ className, variant, size, ...props }: ThemeToggleProps): react_jsx_runtime.JSX.Element;
113
-
114
62
  /**
115
63
  * Client-only theme provider wrapper
116
64
  * This component ensures theme functionality only runs on the client side
@@ -124,4 +72,15 @@ declare function ClientThemeProvider({ children, ...props }: ThemeProviderProps)
124
72
  */
125
73
  declare function ClientThemeToggle(props: any): react_jsx_runtime.JSX.Element;
126
74
 
127
- export { ClientThemeProvider, ClientThemeToggle, type ComponentVariant, type ThemeColor, ThemeContextProvider, ThemeProvider, ThemeProviderNoSSR, ThemeToggle, getColorVariantClasses, isDarkTheme, mapColorToShadcnVariant, mapVariantToShadcnVariant, useTheme, useThemeServer };
75
+ /**
76
+ * Server-safe theme hook that can be used in Server Components
77
+ * Returns default theme values without accessing client-side APIs
78
+ */
79
+ declare function useThemeServer(): {
80
+ theme: string;
81
+ setTheme: (theme: string) => void;
82
+ resolvedTheme: string;
83
+ isDark: boolean;
84
+ };
85
+
86
+ export { ClientThemeProvider, ClientThemeToggle, type ComponentVariant, type ThemeColor, ThemeProvider, ThemeProviderNoSSR, getColorVariantClasses, isDarkTheme, mapColorToShadcnVariant, mapVariantToShadcnVariant, useThemeServer };
@@ -2,9 +2,6 @@
2
2
 
3
3
  var React = require('react');
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
- var clsx = require('clsx');
6
- var tailwindMerge = require('tailwind-merge');
7
- var iconsReact = require('@tabler/icons-react');
8
5
 
9
6
  function _interopNamespace(e) {
10
7
  if (e && e.__esModule) return e;
@@ -26,227 +23,7 @@ function _interopNamespace(e) {
26
23
 
27
24
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
28
25
 
29
- var __defProp = Object.defineProperty;
30
- var __getOwnPropNames = Object.getOwnPropertyNames;
31
- var __esm = (fn, res) => function __init() {
32
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
33
- };
34
- var __export = (target, all) => {
35
- for (var name in all)
36
- __defProp(target, name, { get: all[name], enumerable: true });
37
- };
38
- function useThemeServer() {
39
- return {
40
- theme: "system",
41
- setTheme: (theme) => {
42
- },
43
- resolvedTheme: "light",
44
- isDark: false
45
- };
46
- }
47
- function ThemeContextProvider({
48
- children
49
- }) {
50
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
51
- }
52
- function useTheme() {
53
- const [themeData, setThemeData] = React__namespace.useState({
54
- theme: "system",
55
- setTheme: (theme) => {
56
- },
57
- resolvedTheme: "light",
58
- isDark: false
59
- });
60
- const [mounted, setMounted] = React__namespace.useState(false);
61
- React__namespace.useEffect(() => {
62
- if (typeof window === "undefined") return;
63
- import('next-themes').then((nextThemes) => {
64
- const themeManager = {
65
- getTheme: () => {
66
- if (typeof window !== "undefined") {
67
- const savedTheme = localStorage.getItem("theme");
68
- if (savedTheme) return savedTheme;
69
- if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
70
- return "dark";
71
- }
72
- }
73
- return "light";
74
- },
75
- setTheme: (theme) => {
76
- if (typeof window !== "undefined") {
77
- localStorage.setItem("theme", theme);
78
- document.documentElement.classList.toggle("dark", theme === "dark");
79
- setThemeData((prev) => ({
80
- ...prev,
81
- theme,
82
- resolvedTheme: theme,
83
- isDark: theme === "dark"
84
- }));
85
- }
86
- }
87
- };
88
- const currentTheme = themeManager.getTheme();
89
- const isDark = currentTheme === "dark";
90
- setThemeData({
91
- theme: currentTheme,
92
- setTheme: themeManager.setTheme,
93
- resolvedTheme: currentTheme,
94
- isDark
95
- });
96
- setMounted(true);
97
- });
98
- }, []);
99
- return themeData;
100
- }
101
- var init_theme_context = __esm({
102
- "src/themes/theme-context.tsx"() {
103
- "use client";
104
- }
105
- });
106
- function cn(...inputs) {
107
- return tailwindMerge.twMerge(clsx.clsx(inputs));
108
- }
109
- var init_utils = __esm({
110
- "src/lib/utils.ts"() {
111
- }
112
- });
113
- function ThemeToggle({
114
- className,
115
- variant = "icon",
116
- size = "md",
117
- ...props
118
- }) {
119
- if (typeof window === "undefined") {
120
- return /* @__PURE__ */ jsxRuntime.jsx(
121
- "button",
122
- {
123
- type: "button",
124
- className: cn(
125
- "inline-flex items-center justify-center rounded-md border border-input bg-background",
126
- size === "sm" ? "h-8 w-8" : size === "lg" ? "h-12 w-12" : "h-10 w-10",
127
- className
128
- ),
129
- "aria-label": "Toggle theme",
130
- ...props,
131
- children: /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconSun, { size: size === "sm" ? 16 : size === "lg" ? 24 : 20, stroke: 1.5 })
132
- }
133
- );
134
- }
135
- const { theme, setTheme, resolvedTheme } = useTheme();
136
- const [mounted, setMounted] = React__namespace.useState(false);
137
- React__namespace.useEffect(() => {
138
- setMounted(true);
139
- }, []);
140
- if (!mounted) {
141
- return /* @__PURE__ */ jsxRuntime.jsx(
142
- "button",
143
- {
144
- type: "button",
145
- className: cn(
146
- "inline-flex items-center justify-center rounded-md border border-input bg-background",
147
- size === "sm" ? "h-8 w-8" : size === "lg" ? "h-12 w-12" : "h-10 w-10",
148
- className
149
- ),
150
- "aria-label": "Toggle theme",
151
- ...props,
152
- children: /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconSun, { size: size === "sm" ? 16 : size === "lg" ? 24 : 20, stroke: 1.5 })
153
- }
154
- );
155
- }
156
- const toggleTheme = () => {
157
- setTheme(resolvedTheme === "dark" ? "light" : "dark");
158
- };
159
- const iconSize = {
160
- sm: 16,
161
- md: 20,
162
- lg: 24
163
- };
164
- const sizeClasses = {
165
- sm: "h-8 w-8",
166
- md: "h-10 w-10",
167
- lg: "h-12 w-12"
168
- };
169
- const textSizeClasses = {
170
- sm: "text-xs",
171
- md: "text-sm",
172
- lg: "text-base"
173
- };
174
- if (variant === "icon") {
175
- return /* @__PURE__ */ jsxRuntime.jsx(
176
- "button",
177
- {
178
- type: "button",
179
- onClick: toggleTheme,
180
- className: cn(
181
- "inline-flex items-center justify-center rounded-md border border-input bg-background hover:bg-accent hover:text-accent-foreground",
182
- sizeClasses[size],
183
- className
184
- ),
185
- "aria-label": "Toggle theme",
186
- ...props,
187
- children: resolvedTheme === "dark" ? /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconSun, { size: iconSize[size], stroke: 1.5 }) : /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconMoon, { size: iconSize[size], stroke: 1.5 })
188
- }
189
- );
190
- }
191
- if (variant === "button") {
192
- return /* @__PURE__ */ jsxRuntime.jsx(
193
- "button",
194
- {
195
- type: "button",
196
- onClick: toggleTheme,
197
- className: cn(
198
- "inline-flex items-center justify-center rounded-md border border-input bg-background px-4 py-2",
199
- textSizeClasses[size],
200
- "hover:bg-accent hover:text-accent-foreground",
201
- className
202
- ),
203
- "aria-label": "Toggle theme",
204
- ...props,
205
- children: resolvedTheme === "dark" ? "Light Mode" : "Dark Mode"
206
- }
207
- );
208
- }
209
- return /* @__PURE__ */ jsxRuntime.jsx(
210
- "button",
211
- {
212
- type: "button",
213
- onClick: toggleTheme,
214
- className: cn(
215
- "inline-flex items-center justify-center rounded-md px-3 py-2 font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
216
- textSizeClasses[size],
217
- resolvedTheme === "dark" ? "bg-accent text-accent-foreground hover:bg-accent/80" : "bg-muted text-muted-foreground hover:bg-muted/80",
218
- className
219
- ),
220
- "aria-label": "Toggle theme",
221
- ...props,
222
- children: resolvedTheme === "dark" ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center", children: [
223
- /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconSun, { size: iconSize[size], stroke: 1.5, className: "mr-2" }),
224
- "Light"
225
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center", children: [
226
- /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconMoon, { size: iconSize[size], stroke: 1.5, className: "mr-2" }),
227
- "Dark"
228
- ] })
229
- }
230
- );
231
- }
232
- var init_theme_toggle = __esm({
233
- "src/components/ui/theme-toggle/theme-toggle.tsx"() {
234
- "use client";
235
- init_theme_context();
236
- init_utils();
237
- }
238
- });
239
-
240
- // src/components/ui/theme-toggle/index.ts
241
- var theme_toggle_exports = {};
242
- __export(theme_toggle_exports, {
243
- ThemeToggle: () => ThemeToggle
244
- });
245
- var init_theme_toggle2 = __esm({
246
- "src/components/ui/theme-toggle/index.ts"() {
247
- init_theme_toggle();
248
- }
249
- });
26
+ // src/themes/theme-provider.tsx
250
27
  function ThemeProvider({
251
28
  children,
252
29
  ...props
@@ -287,10 +64,6 @@ function ThemeProviderNoSSR({
287
64
  }
288
65
  return /* @__PURE__ */ jsxRuntime.jsx(ThemeProvider, { ...props, children });
289
66
  }
290
-
291
- // src/themes/index.ts
292
- init_theme_context();
293
- init_theme_toggle2();
294
67
  function ClientThemeProvider({
295
68
  children,
296
69
  ...props
@@ -306,14 +79,25 @@ function ClientThemeProvider({
306
79
  }
307
80
  function ClientThemeToggle(props) {
308
81
  const [mounted, setMounted] = React__namespace.useState(false);
309
- const [ThemeToggleComponent, setThemeToggleComponent] = React__namespace.useState(void 0);
82
+ const [isDark, setIsDark] = React__namespace.useState(false);
310
83
  React__namespace.useEffect(() => {
311
84
  setMounted(true);
312
- Promise.resolve().then(() => (init_theme_toggle2(), theme_toggle_exports)).then(({ ThemeToggle: ThemeToggle2 }) => {
313
- setThemeToggleComponent(() => ThemeToggle2);
314
- });
85
+ if (typeof window !== "undefined") {
86
+ const savedTheme = localStorage.getItem("theme");
87
+ const systemPrefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
88
+ const currentTheme = savedTheme || (systemPrefersDark ? "dark" : "light");
89
+ setIsDark(currentTheme === "dark");
90
+ }
315
91
  }, []);
316
- if (!mounted || !ThemeToggleComponent) {
92
+ const toggleTheme = () => {
93
+ if (typeof window !== "undefined") {
94
+ const newTheme = isDark ? "light" : "dark";
95
+ localStorage.setItem("theme", newTheme);
96
+ document.documentElement.classList.toggle("dark", newTheme === "dark");
97
+ setIsDark(newTheme === "dark");
98
+ }
99
+ };
100
+ if (!mounted) {
317
101
  return /* @__PURE__ */ jsxRuntime.jsx(
318
102
  "button",
319
103
  {
@@ -348,7 +132,62 @@ function ClientThemeToggle(props) {
348
132
  }
349
133
  );
350
134
  }
351
- return /* @__PURE__ */ jsxRuntime.jsx(ThemeToggleComponent, { ...props });
135
+ return /* @__PURE__ */ jsxRuntime.jsx(
136
+ "button",
137
+ {
138
+ type: "button",
139
+ onClick: toggleTheme,
140
+ className: "inline-flex items-center justify-center rounded-md border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 w-10",
141
+ "aria-label": "Toggle theme",
142
+ ...props,
143
+ children: isDark ? /* @__PURE__ */ jsxRuntime.jsxs(
144
+ "svg",
145
+ {
146
+ width: "20",
147
+ height: "20",
148
+ viewBox: "0 0 24 24",
149
+ fill: "none",
150
+ stroke: "currentColor",
151
+ strokeWidth: "2",
152
+ strokeLinecap: "round",
153
+ strokeLinejoin: "round",
154
+ children: [
155
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "4" }),
156
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 2v2" }),
157
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 20v2" }),
158
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m4.93 4.93 1.41 1.41" }),
159
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m17.66 17.66 1.41 1.41" }),
160
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M2 12h2" }),
161
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M20 12h2" }),
162
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m6.34 17.66-1.41 1.41" }),
163
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m19.07 4.93-1.41 1.41" })
164
+ ]
165
+ }
166
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
167
+ "svg",
168
+ {
169
+ width: "20",
170
+ height: "20",
171
+ viewBox: "0 0 24 24",
172
+ fill: "none",
173
+ stroke: "currentColor",
174
+ strokeWidth: "2",
175
+ strokeLinecap: "round",
176
+ strokeLinejoin: "round",
177
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z" })
178
+ }
179
+ )
180
+ }
181
+ );
182
+ }
183
+ function useThemeServer() {
184
+ return {
185
+ theme: "system",
186
+ setTheme: (theme) => {
187
+ },
188
+ resolvedTheme: "light",
189
+ isDark: false
190
+ };
352
191
  }
353
192
 
354
193
  // src/lib/theme-utils.ts
@@ -410,15 +249,12 @@ var isDarkTheme = (theme, systemTheme) => {
410
249
 
411
250
  exports.ClientThemeProvider = ClientThemeProvider;
412
251
  exports.ClientThemeToggle = ClientThemeToggle;
413
- exports.ThemeContextProvider = ThemeContextProvider;
414
252
  exports.ThemeProvider = ThemeProvider;
415
253
  exports.ThemeProviderNoSSR = ThemeProviderNoSSR;
416
- exports.ThemeToggle = ThemeToggle;
417
254
  exports.getColorVariantClasses = getColorVariantClasses;
418
255
  exports.isDarkTheme = isDarkTheme;
419
256
  exports.mapColorToShadcnVariant = mapColorToShadcnVariant;
420
257
  exports.mapVariantToShadcnVariant = mapVariantToShadcnVariant;
421
- exports.useTheme = useTheme;
422
258
  exports.useThemeServer = useThemeServer;
423
259
  //# sourceMappingURL=index.js.map
424
260
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/themes/theme-context.tsx","../../src/lib/utils.ts","../../src/components/ui/theme-toggle/theme-toggle.tsx","../../src/components/ui/theme-toggle/index.ts","../../src/themes/theme-provider.tsx","../../src/themes/index.ts","../../src/themes/client-wrapper.tsx","../../src/lib/theme-utils.ts"],"names":["jsx","Fragment","React2","twMerge","clsx","IconSun","React3","IconMoon","jsxs","init_theme_toggle","React","React4","ThemeToggle"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQO,SAAS,cAAA,GAAiB;AAC/B,EAAA,OAAO;AAAA,IACL,KAAA,EAAO,QAAA;AAAA,IACP,QAAA,EAAU,CAAC,KAAA,KAAkB;AAAA,IAAC,CAAA;AAAA,IAC9B,aAAA,EAAe,OAAA;AAAA,IACf,MAAA,EAAQ;AAAA,GACV;AACF;AAMO,SAAS,oBAAA,CAAqB;AAAA,EACnC;AACF,CAAA,EAEG;AAED,EAAA,uBAAOA,cAAAA,CAAAC,mBAAAA,EAAA,EAAG,QAAA,EAAS,CAAA;AACrB;AAMO,SAAS,QAAA,GAAW;AAEzB,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAUC,gBAAA,CAAA,QAAA,CAAS;AAAA,IAC/C,KAAA,EAAO,QAAA;AAAA,IACP,QAAA,EAAU,CAAC,KAAA,KAAkB;AAAA,IAAC,CAAA;AAAA,IAC9B,aAAA,EAAe,OAAA;AAAA,IACf,MAAA,EAAQ;AAAA,GACT,CAAA;AACD,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAUA,0BAAS,KAAK,CAAA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AK,SAAA;AAAW,MAAA,OAAO,SAAA;AAAA,IACvB,KAAK,WAAA;AAAa,MAAA,OAAO,SAAA;AAAA,IACzB,KAAK,UAAA;AAAY,MAAA,OAAO,OAAA;AAAA,IACxB;AAAS,MAAA,OAAO,SAAA;AAAA;AAEpB;AASO,IAAM,sBAAA,GAAyB,CACpC,KAAA,EACA,OAAA,KACW;AACX,EAAA,MAAM,eAAA,GAAwE;AAAA,IAC5E,OAAA,EAAS;AAAA,MACP,KAAA,EAAO,yEAAA;AAAA,MACP,KAAA,EAAO,yEAAA;AAAA,MACP,OAAA,EAAS,+EAAA;AAAA,MACT,OAAA,EAAS;AAAA,KACX;AAAA,IACA,SAAA,EAAW;AAAA,MACT,KAAA,EAAO,gFAAA;AAAA,MACP,KAAA,EAAO,gFAAA;AAAA,MACP,OAAA,EAAS,wFAAA;AAAA,MACT,OAAA,EAAS;AAAA,KACX;AAAA,IACA,QAAA,EAAU;AAAA,MACR,KAAA,EAAO,+DAAA;AAAA,MACP,KAAA,EAAO,+DAAA;AAAA,MACP,OAAA,EAAS,qEAAA;AAAA,MACT,OAAA,EAAS;AAAA;AACX,GACF;AAEA,EAAA,OAAO,eAAA,CAAgB,OAAO,CAAA,GAAI,KAAK,CAAA,IAAK,EAAA;AAC9C;AASO,IAAM,WAAA,GAAc,CAAC,KAAA,EAA2B,WAAA,KAA6C;AAClG,EAAA,IAAI,UAAU,QAAA,EAAU;AACtB,IAAA,OAAO,WAAA,KAAgB,MAAA;AAAA,EACzB;AACA,EAAA,OAAO,KAAA,KAAU,MAAA;AACnB","file":"index.js","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\n\n/**\n * Server-safe theme hook that can be used in Server Components\n * Returns default theme values without accessing client-side APIs\n */\nexport function useThemeServer() {\n return {\n theme: \"system\",\n setTheme: (theme: string) => {},\n resolvedTheme: \"light\",\n isDark: false,\n };\n}\n\n/**\n * @deprecated Use ThemeProvider from './theme-provider' instead\n * This component is kept for backward compatibility but is no longer needed\n */\nexport function ThemeContextProvider({ \n children \n}: { \n children: React.ReactNode \n}) {\n // This is now a no-op wrapper for backward compatibility\n return <>{children}</>;\n}\n\n/**\n * @deprecated Use useTheme from next-themes directly or use the ThemeProvider\n * This hook is kept for backward compatibility but is no longer needed\n */\nexport function useTheme() {\n // Import next-themes dynamically to avoid SSR issues\n const [themeData, setThemeData] = React.useState({\n theme: \"system\",\n setTheme: (theme: string) => {},\n resolvedTheme: \"light\",\n isDark: false,\n });\n const [mounted, setMounted] = React.useState(false);\n\n React.useEffect(() => {\n // Only run on client side\n if (typeof window === 'undefined') return;\n\n // Import next-themes and use it properly\n import('next-themes').then((nextThemes) => {\n // Create a simple theme manager that doesn't violate hook rules\n const themeManager = {\n getTheme: () => {\n // Get theme from localStorage or system preference\n if (typeof window !== 'undefined') {\n const savedTheme = localStorage.getItem('theme');\n if (savedTheme) return savedTheme;\n \n // Check system preference\n if (window.matchMedia('(prefers-color-scheme: dark)').matches) {\n return 'dark';\n }\n }\n return 'light';\n },\n setTheme: (theme: string) => {\n if (typeof window !== 'undefined') {\n localStorage.setItem('theme', theme);\n document.documentElement.classList.toggle('dark', theme === 'dark');\n // Trigger a re-render\n setThemeData(prev => ({\n ...prev,\n theme,\n resolvedTheme: theme,\n isDark: theme === 'dark'\n }));\n }\n }\n };\n\n const currentTheme = themeManager.getTheme();\n const isDark = currentTheme === 'dark';\n \n setThemeData({\n theme: currentTheme,\n setTheme: themeManager.setTheme,\n resolvedTheme: currentTheme,\n isDark,\n });\n setMounted(true);\n });\n }, []);\n\n return themeData;\n}","import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\n/**\n * Combines multiple class values into a single className string\n * with proper Tailwind CSS class merging.\n * \n * @param inputs - Class values to merge\n * @returns Merged className string\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\n/**\n * Utility function to generate a unique ID.\n * Useful for ensuring unique IDs for form elements.\n * \n * @param prefix - Optional prefix for the ID\n * @returns A unique ID string\n */\nexport function generateId(prefix = 'id'): string {\n const randomId = Math.random().toString(36).substring(2, 9);\n return `${prefix}-${randomId}`;\n}\n\n/**\n * Type guard to check if a value is not null or undefined\n * \n * @param value - Value to check\n * @returns True if value is not null or undefined\n */\nexport function isNotNullOrUndefined<T>(value: T | null | undefined): value is T {\n return value !== null && value !== undefined;\n}\n\n/**\n * Returns only the props that are safe to spread onto a DOM element\n * by filtering out custom props\n * \n * @param props - The props object\n * @param propNames - Names of custom props to filter out\n * @returns Object with only DOM-safe props\n */\nexport function filterDOMProps<T extends Record<string, any>, K extends keyof T>(\n props: T, \n propNames: K[]\n): Omit<T, K> {\n const result = { ...props };\n propNames.forEach(name => delete result[name]);\n return result;\n}","\"use client\"\n\nimport * as React from \"react\"\nimport { useTheme } from \"../../../themes/theme-context\"\nimport { cn } from \"../../../lib/utils\"\nimport { IconMoon, IconSun } from \"@tabler/icons-react\"\n\n/**\n * Props for the ThemeToggle component\n */\nexport interface ThemeToggleProps extends React.HTMLAttributes<HTMLButtonElement> {\n /**\n * Variant of the toggle\n * @default 'icon'\n */\n variant?: 'icon' | 'switch' | 'button';\n \n /**\n * Size of the toggle\n * @default 'md'\n */\n size?: 'sm' | 'md' | 'lg';\n}\n\n/**\n * ThemeToggle component to switch between light and dark themes\n * \n * IMPORTANT: This component uses React hooks and must only be used in Client Components.\n * For Server Components, use ClientThemeToggle from the themes package instead.\n */\nexport function ThemeToggle({ \n className, \n variant = 'icon', \n size = 'md',\n ...props \n}: ThemeToggleProps) {\n // Additional Server Component protection\n if (typeof window === 'undefined') {\n // Return a placeholder during SSR to prevent hydration issues\n return (\n <button\n type=\"button\"\n className={cn(\n \"inline-flex items-center justify-center rounded-md border border-input bg-background\",\n size === 'sm' ? 'h-8 w-8' : size === 'lg' ? 'h-12 w-12' : 'h-10 w-10',\n className\n )}\n aria-label=\"Toggle theme\"\n {...props}\n >\n <IconSun size={size === 'sm' ? 16 : size === 'lg' ? 24 : 20} stroke={1.5} />\n </button>\n );\n }\n\n const { theme, setTheme, resolvedTheme } = useTheme()\n const [mounted, setMounted] = React.useState(false)\n\n // Handle hydration mismatch\n React.useEffect(() => {\n setMounted(true)\n }, [])\n\n // Only render on client to prevent hydration mismatch\n if (!mounted) {\n return (\n <button\n type=\"button\"\n className={cn(\n \"inline-flex items-center justify-center rounded-md border border-input bg-background\",\n size === 'sm' ? 'h-8 w-8' : size === 'lg' ? 'h-12 w-12' : 'h-10 w-10',\n className\n )}\n aria-label=\"Toggle theme\"\n {...props}\n >\n <IconSun size={size === 'sm' ? 16 : size === 'lg' ? 24 : 20} stroke={1.5} />\n </button>\n );\n }\n\n // Toggle between light and dark\n const toggleTheme = () => {\n setTheme(resolvedTheme === \"dark\" ? \"light\" : \"dark\")\n }\n\n // Size mapping for Tabler icons\n const iconSize = {\n sm: 16,\n md: 20,\n lg: 24,\n }\n\n // Size classes for button\n const sizeClasses = {\n sm: 'h-8 w-8',\n md: 'h-10 w-10',\n lg: 'h-12 w-12',\n }\n\n // Text size classes\n const textSizeClasses = {\n sm: 'text-xs',\n md: 'text-sm',\n lg: 'text-base',\n }\n\n // Variant specific rendering\n if (variant === 'icon') {\n return (\n <button\n type=\"button\"\n onClick={toggleTheme}\n className={cn(\n \"inline-flex items-center justify-center rounded-md border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n sizeClasses[size],\n className\n )}\n aria-label=\"Toggle theme\"\n {...props}\n >\n {resolvedTheme === \"dark\" ? (\n <IconSun size={iconSize[size]} stroke={1.5} />\n ) : (\n <IconMoon size={iconSize[size]} stroke={1.5} />\n )}\n </button>\n )\n }\n \n // Button variant\n if (variant === 'button') {\n return (\n <button\n type=\"button\"\n onClick={toggleTheme}\n className={cn(\n \"inline-flex items-center justify-center rounded-md border border-input bg-background px-4 py-2\",\n textSizeClasses[size],\n \"hover:bg-accent hover:text-accent-foreground\",\n className\n )}\n aria-label=\"Toggle theme\"\n {...props}\n >\n {resolvedTheme === \"dark\" ? \"Light Mode\" : \"Dark Mode\"}\n </button>\n )\n }\n\n // Default variant (switch-like)\n return (\n <button\n type=\"button\"\n onClick={toggleTheme}\n className={cn(\n \"inline-flex items-center justify-center rounded-md px-3 py-2 font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n textSizeClasses[size],\n resolvedTheme === \"dark\"\n ? \"bg-accent text-accent-foreground hover:bg-accent/80\"\n : \"bg-muted text-muted-foreground hover:bg-muted/80\",\n className\n )}\n aria-label=\"Toggle theme\"\n {...props}\n >\n {resolvedTheme === \"dark\" ? (\n <span className=\"flex items-center\">\n <IconSun size={iconSize[size]} stroke={1.5} className=\"mr-2\" />\n Light\n </span>\n ) : (\n <span className=\"flex items-center\">\n <IconMoon size={iconSize[size]} stroke={1.5} className=\"mr-2\" />\n Dark\n </span>\n )}\n </button>\n )\n}","export * from './theme-toggle';","\"use client\"\n\nimport * as React from \"react\"\nimport type { ThemeProviderProps } from \"next-themes/dist/types\"\n\n/**\n * ThemeProvider component for handling theme state\n * \n * This wraps the next-themes provider with sensible defaults\n * for handling light/dark themes and system preferences\n * \n * IMPORTANT: This component must be used in a Client Component context.\n * For Server Components, use the NoSSR wrapper or dynamic imports.\n */\nexport function ThemeProvider({ \n children, \n ...props \n}: ThemeProviderProps) {\n const [NextThemesProvider, setNextThemesProvider] = React.useState<any>(undefined);\n const [mounted, setMounted] = React.useState(false);\n\n React.useEffect(() => {\n // Only import next-themes on the client side\n import('next-themes').then(({ ThemeProvider: Provider }) => {\n setNextThemesProvider(() => Provider);\n setMounted(true);\n });\n }, []);\n\n // Return children without theme provider during SSR or before mounting\n if (!mounted || !NextThemesProvider) {\n return <>{children}</>;\n }\n\n return (\n <NextThemesProvider\n attribute=\"class\"\n defaultTheme=\"system\"\n enableSystem\n disableTransitionOnChange\n {...props}\n >\n {children}\n </NextThemesProvider>\n )\n}\n\n/**\n * NoSSR wrapper for theme provider to prevent SSR issues\n * Use this when you need to ensure the theme provider only renders on the client\n */\nexport function ThemeProviderNoSSR({ \n children, \n ...props \n}: ThemeProviderProps) {\n const [mounted, setMounted] = React.useState(false);\n\n React.useEffect(() => {\n setMounted(true);\n }, []);\n\n if (!mounted) {\n return <>{children}</>;\n }\n\n return (\n <ThemeProvider {...props}>\n {children}\n </ThemeProvider>\n );\n}","// Theme system exports\nexport { ThemeProvider, ThemeProviderNoSSR } from './theme-provider';\nexport { ThemeContextProvider, useTheme, useThemeServer } from './theme-context';\nexport { ThemeToggle } from '../components/ui/theme-toggle/index';\n\n// Client-only wrappers for Server Component compatibility\nexport { ClientThemeProvider, ClientThemeToggle } from './client-wrapper';\n\n// Re-export theme utilities\nexport { isDarkTheme, mapColorToShadcnVariant, mapVariantToShadcnVariant, getColorVariantClasses } from '../lib/theme-utils';\n\n// Export types\nexport type { ThemeColor, ComponentVariant } from '../lib/theme-utils';\n","\"use client\"\n\nimport * as React from \"react\"\nimport { ThemeProvider } from \"./theme-provider\"\nimport type { ThemeProviderProps } from \"next-themes/dist/types\"\n\n/**\n * Client-only theme provider wrapper\n * This component ensures theme functionality only runs on the client side\n * without using next/dynamic which causes Server Component issues\n */\nexport function ClientThemeProvider({ \n children, \n ...props \n}: ThemeProviderProps) {\n const [mounted, setMounted] = React.useState(false);\n\n React.useEffect(() => {\n setMounted(true);\n }, []);\n\n // During SSR or before mounting, render children without theme provider\n if (!mounted) {\n return <>{children}</>;\n }\n\n // Once mounted, render with theme provider\n return (\n <ThemeProvider {...props}>\n {children}\n </ThemeProvider>\n );\n}\n\n/**\n * Client-only theme toggle wrapper\n * This component ensures theme toggle only renders on the client side\n * and provides a safe fallback for Server Components\n */\nexport function ClientThemeToggle(props: any) {\n const [mounted, setMounted] = React.useState(false);\n const [ThemeToggleComponent, setThemeToggleComponent] = React.useState<any>(undefined);\n\n React.useEffect(() => {\n setMounted(true);\n import(\"../components/ui/theme-toggle\").then(({ ThemeToggle }) => {\n setThemeToggleComponent(() => ThemeToggle);\n });\n }, []);\n\n // During SSR or before mounting, render a placeholder\n if (!mounted || !ThemeToggleComponent) {\n return (\n <button\n type=\"button\"\n className=\"inline-flex items-center justify-center rounded-md border border-input bg-background h-10 w-10\"\n aria-label=\"Toggle theme\"\n {...props}\n >\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path d=\"M12 2v2\" />\n <path d=\"M12 20v2\" />\n <path d=\"m4.93 4.93 1.41 1.41\" />\n <path d=\"m17.66 17.66 1.41 1.41\" />\n <path d=\"M2 12h2\" />\n <path d=\"M20 12h2\" />\n <path d=\"m6.34 17.66-1.41 1.41\" />\n <path d=\"m19.07 4.93-1.41 1.41\" />\n </svg>\n </button>\n );\n }\n\n return <ThemeToggleComponent {...props} />;\n} ","/**\n * Utility functions for theme handling\n */\n\n/**\n * Supported color theme values\n */\nexport type ThemeColor = 'brand' | 'error' | 'warning' | 'success';\n\n/**\n * Supported component variant types\n */\nexport type ComponentVariant = 'primary' | 'secondary' | 'tertiary';\n\n/**\n * Map design system colors to shadcn variants\n * \n * @param color - The design system color\n * @returns The corresponding shadcn variant\n */\nexport const mapColorToShadcnVariant = (color: ThemeColor) => {\n switch (color) {\n case 'brand': return 'default';\n case 'error': return 'destructive';\n case 'warning':\n case 'success':\n return 'secondary'; // Will need additional classes\n default: return 'default';\n }\n};\n\n/**\n * Map design system variants to shadcn variants\n * \n * @param variant - The design system variant\n * @returns The corresponding shadcn variant\n */\nexport const mapVariantToShadcnVariant = (variant: ComponentVariant) => {\n switch (variant) {\n case 'primary': return 'default';\n case 'secondary': return 'outline';\n case 'tertiary': return 'ghost';\n default: return 'default';\n }\n};\n\n/**\n * Generate Tailwind classes for color/variant combinations\n * \n * @param color - The design system color\n * @param variant - The design system variant\n * @returns String of Tailwind classes\n */\nexport const getColorVariantClasses = (\n color: ThemeColor, \n variant: ComponentVariant\n): string => {\n const colorVariantMap: Record<ComponentVariant, Record<ThemeColor, string>> = {\n primary: {\n brand: 'bg-brand-600 hover:bg-brand-700 text-white focus-visible:ring-brand-500',\n error: 'bg-error-600 hover:bg-error-700 text-white focus-visible:ring-error-500',\n warning: 'bg-warning-600 hover:bg-warning-700 text-white focus-visible:ring-warning-500',\n success: 'bg-success-600 hover:bg-success-700 text-white focus-visible:ring-success-500',\n },\n secondary: {\n brand: 'border-brand-300 text-brand-700 hover:bg-brand-50 focus-visible:ring-brand-500',\n error: 'border-error-300 text-error-700 hover:bg-error-50 focus-visible:ring-error-500',\n warning: 'border-warning-300 text-warning-700 hover:bg-warning-50 focus-visible:ring-warning-500',\n success: 'border-success-300 text-success-700 hover:bg-success-50 focus-visible:ring-success-500',\n },\n tertiary: {\n brand: 'text-brand-700 hover:bg-brand-50 focus-visible:ring-brand-500',\n error: 'text-error-700 hover:bg-error-50 focus-visible:ring-error-500',\n warning: 'text-warning-700 hover:bg-warning-50 focus-visible:ring-warning-500',\n success: 'text-success-700 hover:bg-success-50 focus-visible:ring-success-500',\n }\n };\n\n return colorVariantMap[variant]?.[color] || '';\n};\n\n/**\n * Determine if the current theme is dark\n * \n * @param theme - The current theme\n * @param systemTheme - The system theme\n * @returns True if the theme is dark\n */\nexport const isDarkTheme = (theme: string | undefined, systemTheme: string | undefined): boolean => {\n if (theme === 'system') {\n return systemTheme === 'dark';\n }\n return theme === 'dark';\n};"]}
1
+ {"version":3,"sources":["../../src/themes/theme-provider.tsx","../../src/themes/client-wrapper.tsx","../../src/themes/theme-context.tsx","../../src/lib/theme-utils.ts"],"names":["React","jsx","React2","Fragment","jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAcO,SAAS,aAAA,CAAc;AAAA,EAC5B,QAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAuB;AACrB,EAAA,MAAM,CAAC,kBAAA,EAAoB,qBAAqB,CAAA,GAAUA,0BAAc,MAAS,CAAA;AACjF,EAAA,MAAM,C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,OAAO,OAAA;AAAA,IACxB;AAAS,MAAA,OAAO,SAAA;AAAA;AAEpB;AASO,IAAM,sBAAA,GAAyB,CACpC,KAAA,EACA,OAAA,KACW;AACX,EAAA,MAAM,eAAA,GAAwE;AAAA,IAC5E,OAAA,EAAS;AAAA,MACP,KAAA,EAAO,yEAAA;AAAA,MACP,KAAA,EAAO,yEAAA;AAAA,MACP,OAAA,EAAS,+EAAA;AAAA,MACT,OAAA,EAAS;AAAA,KACX;AAAA,IACA,SAAA,EAAW;AAAA,MACT,KAAA,EAAO,gFAAA;AAAA,MACP,KAAA,EAAO,gFAAA;AAAA,MACP,OAAA,EAAS,wFAAA;AAAA,MACT,OAAA,EAAS;AAAA,KACX;AAAA,IACA,QAAA,EAAU;AAAA,MACR,KAAA,EAAO,+DAAA;AAAA,MACP,KAAA,EAAO,+DAAA;AAAA,MACP,OAAA,EAAS,qEAAA;AAAA,MACT,OAAA,EAAS;AAAA;AACX,GACF;AAEA,EAAA,OAAO,eAAA,CAAgB,OAAO,CAAA,GAAI,KAAK,CAAA,IAAK,EAAA;AAC9C;AASO,IAAM,WAAA,GAAc,CAAC,KAAA,EAA2B,WAAA,KAA6C;AAClG,EAAA,IAAI,UAAU,QAAA,EAAU;AACtB,IAAA,OAAO,WAAA,KAAgB,MAAA;AAAA,EACzB;AACA,EAAA,OAAO,KAAA,KAAU,MAAA;AACnB","file":"index.js","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport type { ThemeProviderProps } from \"next-themes/dist/types\"\n\n/**\n * ThemeProvider component for handling theme state\n * \n * This wraps the next-themes provider with sensible defaults\n * for handling light/dark themes and system preferences\n * \n * IMPORTANT: This component must be used in a Client Component context.\n * For Server Components, use the NoSSR wrapper or dynamic imports.\n */\nexport function ThemeProvider({ \n children, \n ...props \n}: ThemeProviderProps) {\n const [NextThemesProvider, setNextThemesProvider] = React.useState<any>(undefined);\n const [mounted, setMounted] = React.useState(false);\n\n React.useEffect(() => {\n // Only import next-themes on the client side\n import('next-themes').then(({ ThemeProvider: Provider }) => {\n setNextThemesProvider(() => Provider);\n setMounted(true);\n });\n }, []);\n\n // Return children without theme provider during SSR or before mounting\n if (!mounted || !NextThemesProvider) {\n return <>{children}</>;\n }\n\n return (\n <NextThemesProvider\n attribute=\"class\"\n defaultTheme=\"system\"\n enableSystem\n disableTransitionOnChange\n {...props}\n >\n {children}\n </NextThemesProvider>\n )\n}\n\n/**\n * NoSSR wrapper for theme provider to prevent SSR issues\n * Use this when you need to ensure the theme provider only renders on the client\n */\nexport function ThemeProviderNoSSR({ \n children, \n ...props \n}: ThemeProviderProps) {\n const [mounted, setMounted] = React.useState(false);\n\n React.useEffect(() => {\n setMounted(true);\n }, []);\n\n if (!mounted) {\n return <>{children}</>;\n }\n\n return (\n <ThemeProvider {...props}>\n {children}\n </ThemeProvider>\n );\n}","\"use client\"\n\nimport * as React from \"react\"\nimport { ThemeProvider } from \"./theme-provider\"\nimport type { ThemeProviderProps } from \"next-themes/dist/types\"\n\n/**\n * Client-only theme provider wrapper\n * This component ensures theme functionality only runs on the client side\n * without using next/dynamic which causes Server Component issues\n */\nexport function ClientThemeProvider({ \n children, \n ...props \n}: ThemeProviderProps) {\n const [mounted, setMounted] = React.useState(false);\n\n React.useEffect(() => {\n setMounted(true);\n }, []);\n\n // During SSR or before mounting, render children without theme provider\n if (!mounted) {\n return <>{children}</>;\n }\n\n // Once mounted, render with theme provider\n return (\n <ThemeProvider {...props}>\n {children}\n </ThemeProvider>\n );\n}\n\n/**\n * Client-only theme toggle wrapper\n * This component ensures theme toggle only renders on the client side\n * and provides a safe fallback for Server Components\n */\nexport function ClientThemeToggle(props: any) {\n const [mounted, setMounted] = React.useState(false);\n const [isDark, setIsDark] = React.useState(false);\n\n React.useEffect(() => {\n setMounted(true);\n // Check current theme\n if (typeof window !== 'undefined') {\n const savedTheme = localStorage.getItem('theme');\n const systemPrefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;\n const currentTheme = savedTheme || (systemPrefersDark ? 'dark' : 'light');\n setIsDark(currentTheme === 'dark');\n }\n }, []);\n\n const toggleTheme = () => {\n if (typeof window !== 'undefined') {\n const newTheme = isDark ? 'light' : 'dark';\n localStorage.setItem('theme', newTheme);\n document.documentElement.classList.toggle('dark', newTheme === 'dark');\n setIsDark(newTheme === 'dark');\n }\n };\n\n // During SSR or before mounting, render a placeholder\n if (!mounted) {\n return (\n <button\n type=\"button\"\n className=\"inline-flex items-center justify-center rounded-md border border-input bg-background h-10 w-10\"\n aria-label=\"Toggle theme\"\n {...props}\n >\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path d=\"M12 2v2\" />\n <path d=\"M12 20v2\" />\n <path d=\"m4.93 4.93 1.41 1.41\" />\n <path d=\"m17.66 17.66 1.41 1.41\" />\n <path d=\"M2 12h2\" />\n <path d=\"M20 12h2\" />\n <path d=\"m6.34 17.66-1.41 1.41\" />\n <path d=\"m19.07 4.93-1.41 1.41\" />\n </svg>\n </button>\n );\n }\n\n return (\n <button\n type=\"button\"\n onClick={toggleTheme}\n className=\"inline-flex items-center justify-center rounded-md border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 w-10\"\n aria-label=\"Toggle theme\"\n {...props}\n >\n {isDark ? (\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path d=\"M12 2v2\" />\n <path d=\"M12 20v2\" />\n <path d=\"m4.93 4.93 1.41 1.41\" />\n <path d=\"m17.66 17.66 1.41 1.41\" />\n <path d=\"M2 12h2\" />\n <path d=\"M20 12h2\" />\n <path d=\"m6.34 17.66-1.41 1.41\" />\n <path d=\"m19.07 4.93-1.41 1.41\" />\n </svg>\n ) : (\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z\" />\n </svg>\n )}\n </button>\n );\n} ","\"use client\"\n\nimport * as React from \"react\"\n\n/**\n * Server-safe theme hook that can be used in Server Components\n * Returns default theme values without accessing client-side APIs\n */\nexport function useThemeServer() {\n return {\n theme: \"system\",\n setTheme: (theme: string) => {},\n resolvedTheme: \"light\",\n isDark: false,\n };\n}\n\n/**\n * @deprecated Use ThemeProvider from './theme-provider' instead\n * This component is kept for backward compatibility but is no longer needed\n */\nexport function ThemeContextProvider({ \n children \n}: { \n children: React.ReactNode \n}) {\n // This is now a no-op wrapper for backward compatibility\n return <>{children}</>;\n}\n\n/**\n * @deprecated Use useTheme from next-themes directly or use the ThemeProvider\n * This hook is kept for backward compatibility but is no longer needed\n */\nexport function useTheme() {\n // Import next-themes dynamically to avoid SSR issues\n const [themeData, setThemeData] = React.useState({\n theme: \"system\",\n setTheme: (theme: string) => {},\n resolvedTheme: \"light\",\n isDark: false,\n });\n const [mounted, setMounted] = React.useState(false);\n\n React.useEffect(() => {\n // Only run on client side\n if (typeof window === 'undefined') return;\n\n // Import next-themes and use it properly\n import('next-themes').then((nextThemes) => {\n // Create a simple theme manager that doesn't violate hook rules\n const themeManager = {\n getTheme: () => {\n // Get theme from localStorage or system preference\n if (typeof window !== 'undefined') {\n const savedTheme = localStorage.getItem('theme');\n if (savedTheme) return savedTheme;\n \n // Check system preference\n if (window.matchMedia('(prefers-color-scheme: dark)').matches) {\n return 'dark';\n }\n }\n return 'light';\n },\n setTheme: (theme: string) => {\n if (typeof window !== 'undefined') {\n localStorage.setItem('theme', theme);\n document.documentElement.classList.toggle('dark', theme === 'dark');\n // Trigger a re-render\n setThemeData(prev => ({\n ...prev,\n theme,\n resolvedTheme: theme,\n isDark: theme === 'dark'\n }));\n }\n }\n };\n\n const currentTheme = themeManager.getTheme();\n const isDark = currentTheme === 'dark';\n \n setThemeData({\n theme: currentTheme,\n setTheme: themeManager.setTheme,\n resolvedTheme: currentTheme,\n isDark,\n });\n setMounted(true);\n });\n }, []);\n\n return themeData;\n}","/**\n * Utility functions for theme handling\n */\n\n/**\n * Supported color theme values\n */\nexport type ThemeColor = 'brand' | 'error' | 'warning' | 'success';\n\n/**\n * Supported component variant types\n */\nexport type ComponentVariant = 'primary' | 'secondary' | 'tertiary';\n\n/**\n * Map design system colors to shadcn variants\n * \n * @param color - The design system color\n * @returns The corresponding shadcn variant\n */\nexport const mapColorToShadcnVariant = (color: ThemeColor) => {\n switch (color) {\n case 'brand': return 'default';\n case 'error': return 'destructive';\n case 'warning':\n case 'success':\n return 'secondary'; // Will need additional classes\n default: return 'default';\n }\n};\n\n/**\n * Map design system variants to shadcn variants\n * \n * @param variant - The design system variant\n * @returns The corresponding shadcn variant\n */\nexport const mapVariantToShadcnVariant = (variant: ComponentVariant) => {\n switch (variant) {\n case 'primary': return 'default';\n case 'secondary': return 'outline';\n case 'tertiary': return 'ghost';\n default: return 'default';\n }\n};\n\n/**\n * Generate Tailwind classes for color/variant combinations\n * \n * @param color - The design system color\n * @param variant - The design system variant\n * @returns String of Tailwind classes\n */\nexport const getColorVariantClasses = (\n color: ThemeColor, \n variant: ComponentVariant\n): string => {\n const colorVariantMap: Record<ComponentVariant, Record<ThemeColor, string>> = {\n primary: {\n brand: 'bg-brand-600 hover:bg-brand-700 text-white focus-visible:ring-brand-500',\n error: 'bg-error-600 hover:bg-error-700 text-white focus-visible:ring-error-500',\n warning: 'bg-warning-600 hover:bg-warning-700 text-white focus-visible:ring-warning-500',\n success: 'bg-success-600 hover:bg-success-700 text-white focus-visible:ring-success-500',\n },\n secondary: {\n brand: 'border-brand-300 text-brand-700 hover:bg-brand-50 focus-visible:ring-brand-500',\n error: 'border-error-300 text-error-700 hover:bg-error-50 focus-visible:ring-error-500',\n warning: 'border-warning-300 text-warning-700 hover:bg-warning-50 focus-visible:ring-warning-500',\n success: 'border-success-300 text-success-700 hover:bg-success-50 focus-visible:ring-success-500',\n },\n tertiary: {\n brand: 'text-brand-700 hover:bg-brand-50 focus-visible:ring-brand-500',\n error: 'text-error-700 hover:bg-error-50 focus-visible:ring-error-500',\n warning: 'text-warning-700 hover:bg-warning-50 focus-visible:ring-warning-500',\n success: 'text-success-700 hover:bg-success-50 focus-visible:ring-success-500',\n }\n };\n\n return colorVariantMap[variant]?.[color] || '';\n};\n\n/**\n * Determine if the current theme is dark\n * \n * @param theme - The current theme\n * @param systemTheme - The system theme\n * @returns True if the theme is dark\n */\nexport const isDarkTheme = (theme: string | undefined, systemTheme: string | undefined): boolean => {\n if (theme === 'system') {\n return systemTheme === 'dark';\n }\n return theme === 'dark';\n};"]}