@tydavidson/design-system 1.1.8 → 1.1.10

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,7 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ThemeProviderProps } from 'next-themes/dist/types';
3
- import * as React$1 from 'react';
4
- import { ComponentType } from 'react';
3
+ import * as React from 'react';
5
4
 
6
5
  /**
7
6
  * Utility functions for theme handling
@@ -82,7 +81,7 @@ declare function useTheme(): {
82
81
  */
83
82
  declare function useThemeServer(): {
84
83
  theme: string;
85
- setTheme: () => void;
84
+ setTheme: (theme: string) => void;
86
85
  resolvedTheme: string;
87
86
  isDark: boolean;
88
87
  };
@@ -97,7 +96,7 @@ declare function ThemeContextProvider({ children }: {
97
96
  /**
98
97
  * Props for the ThemeToggle component
99
98
  */
100
- interface ThemeToggleProps extends React$1.HTMLAttributes<HTMLButtonElement> {
99
+ interface ThemeToggleProps extends React.HTMLAttributes<HTMLButtonElement> {
101
100
  /**
102
101
  * Variant of the toggle
103
102
  * @default 'icon'
@@ -115,20 +114,15 @@ interface ThemeToggleProps extends React$1.HTMLAttributes<HTMLButtonElement> {
115
114
  declare function ThemeToggle({ className, variant, size, ...props }: ThemeToggleProps): react_jsx_runtime.JSX.Element | null;
116
115
 
117
116
  /**
118
- * Dynamically import theme components to prevent SSR issues
119
- * Use these imports when you need to use theme components in Server Components
117
+ * Client-only theme provider wrapper
118
+ * This component ensures theme functionality only runs on the client side
119
+ * without using next/dynamic which causes Server Component issues
120
120
  */
121
- declare const DynamicThemeProvider: ComponentType<any>;
122
- declare const DynamicThemeProviderNoSSR: ComponentType<any>;
123
- declare const DynamicThemeToggle: ComponentType<any>;
121
+ declare function ClientThemeProvider({ children, ...props }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
124
122
  /**
125
- * Safe theme provider for Next.js App Router
126
- * Automatically handles Server Component compatibility
123
+ * Client-only theme toggle wrapper
124
+ * This component ensures theme toggle only renders on the client side
127
125
  */
128
- declare function SafeThemeProvider({ children, noSSR, ...props }: {
129
- children: React.ReactNode;
130
- noSSR?: boolean;
131
- [key: string]: any;
132
- }): react_jsx_runtime.JSX.Element;
126
+ declare function ClientThemeToggle(props: any): react_jsx_runtime.JSX.Element | null;
133
127
 
134
- export { type ComponentVariant, DynamicThemeProvider, DynamicThemeProviderNoSSR, DynamicThemeToggle, SafeThemeProvider, type ThemeColor, ThemeContextProvider, ThemeProvider, ThemeProviderNoSSR, ThemeToggle, getColorVariantClasses, isDarkTheme, mapColorToShadcnVariant, mapVariantToShadcnVariant, useTheme, useThemeServer };
128
+ export { ClientThemeProvider, ClientThemeToggle, type ComponentVariant, type ThemeColor, ThemeContextProvider, ThemeProvider, ThemeProviderNoSSR, ThemeToggle, getColorVariantClasses, isDarkTheme, mapColorToShadcnVariant, mapVariantToShadcnVariant, useTheme, useThemeServer };
@@ -1,7 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ThemeProviderProps } from 'next-themes/dist/types';
3
- import * as React$1 from 'react';
4
- import { ComponentType } from 'react';
3
+ import * as React from 'react';
5
4
 
6
5
  /**
7
6
  * Utility functions for theme handling
@@ -82,7 +81,7 @@ declare function useTheme(): {
82
81
  */
83
82
  declare function useThemeServer(): {
84
83
  theme: string;
85
- setTheme: () => void;
84
+ setTheme: (theme: string) => void;
86
85
  resolvedTheme: string;
87
86
  isDark: boolean;
88
87
  };
@@ -97,7 +96,7 @@ declare function ThemeContextProvider({ children }: {
97
96
  /**
98
97
  * Props for the ThemeToggle component
99
98
  */
100
- interface ThemeToggleProps extends React$1.HTMLAttributes<HTMLButtonElement> {
99
+ interface ThemeToggleProps extends React.HTMLAttributes<HTMLButtonElement> {
101
100
  /**
102
101
  * Variant of the toggle
103
102
  * @default 'icon'
@@ -115,20 +114,15 @@ interface ThemeToggleProps extends React$1.HTMLAttributes<HTMLButtonElement> {
115
114
  declare function ThemeToggle({ className, variant, size, ...props }: ThemeToggleProps): react_jsx_runtime.JSX.Element | null;
116
115
 
117
116
  /**
118
- * Dynamically import theme components to prevent SSR issues
119
- * Use these imports when you need to use theme components in Server Components
117
+ * Client-only theme provider wrapper
118
+ * This component ensures theme functionality only runs on the client side
119
+ * without using next/dynamic which causes Server Component issues
120
120
  */
121
- declare const DynamicThemeProvider: ComponentType<any>;
122
- declare const DynamicThemeProviderNoSSR: ComponentType<any>;
123
- declare const DynamicThemeToggle: ComponentType<any>;
121
+ declare function ClientThemeProvider({ children, ...props }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
124
122
  /**
125
- * Safe theme provider for Next.js App Router
126
- * Automatically handles Server Component compatibility
123
+ * Client-only theme toggle wrapper
124
+ * This component ensures theme toggle only renders on the client side
127
125
  */
128
- declare function SafeThemeProvider({ children, noSSR, ...props }: {
129
- children: React.ReactNode;
130
- noSSR?: boolean;
131
- [key: string]: any;
132
- }): react_jsx_runtime.JSX.Element;
126
+ declare function ClientThemeToggle(props: any): react_jsx_runtime.JSX.Element | null;
133
127
 
134
- export { type ComponentVariant, DynamicThemeProvider, DynamicThemeProviderNoSSR, DynamicThemeToggle, SafeThemeProvider, type ThemeColor, ThemeContextProvider, ThemeProvider, ThemeProviderNoSSR, ThemeToggle, getColorVariantClasses, isDarkTheme, mapColorToShadcnVariant, mapVariantToShadcnVariant, useTheme, useThemeServer };
128
+ export { ClientThemeProvider, ClientThemeToggle, type ComponentVariant, type ThemeColor, ThemeContextProvider, ThemeProvider, ThemeProviderNoSSR, ThemeToggle, getColorVariantClasses, isDarkTheme, mapColorToShadcnVariant, mapVariantToShadcnVariant, useTheme, useThemeServer };
@@ -1,14 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  var React = require('react');
4
- var nextThemes = require('next-themes');
5
4
  var jsxRuntime = require('react/jsx-runtime');
6
5
  var clsx = require('clsx');
7
6
  var tailwindMerge = require('tailwind-merge');
8
7
  var iconsReact = require('@tabler/icons-react');
9
- var dynamic = require('next/dynamic');
10
-
11
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
12
8
 
13
9
  function _interopNamespace(e) {
14
10
  if (e && e.__esModule) return e;
@@ -29,10 +25,11 @@ function _interopNamespace(e) {
29
25
  }
30
26
 
31
27
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
32
- var dynamic__default = /*#__PURE__*/_interopDefault(dynamic);
33
28
 
34
29
  var __defProp = Object.defineProperty;
30
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
35
31
  var __getOwnPropNames = Object.getOwnPropertyNames;
32
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
36
33
  var __esm = (fn, res) => function __init() {
37
34
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
38
35
  };
@@ -40,50 +37,15 @@ var __export = (target, all) => {
40
37
  for (var name in all)
41
38
  __defProp(target, name, { get: all[name], enumerable: true });
42
39
  };
43
-
44
- // src/themes/theme-provider.tsx
45
- var theme_provider_exports = {};
46
- __export(theme_provider_exports, {
47
- ThemeProvider: () => ThemeProvider,
48
- ThemeProviderNoSSR: () => ThemeProviderNoSSR
49
- });
50
- function ThemeProvider({
51
- children,
52
- ...props
53
- }) {
54
- if (typeof window === "undefined") {
55
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
40
+ var __copyProps = (to, from, except, desc) => {
41
+ if (from && typeof from === "object" || typeof from === "function") {
42
+ for (let key of __getOwnPropNames(from))
43
+ if (!__hasOwnProp.call(to, key) && key !== except)
44
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
56
45
  }
57
- return /* @__PURE__ */ jsxRuntime.jsx(
58
- nextThemes.ThemeProvider,
59
- {
60
- attribute: "class",
61
- defaultTheme: "system",
62
- enableSystem: true,
63
- disableTransitionOnChange: true,
64
- ...props,
65
- children
66
- }
67
- );
68
- }
69
- function ThemeProviderNoSSR({
70
- children,
71
- ...props
72
- }) {
73
- const [mounted, setMounted] = React__namespace.useState(false);
74
- React__namespace.useEffect(() => {
75
- setMounted(true);
76
- }, []);
77
- if (!mounted) {
78
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
79
- }
80
- return /* @__PURE__ */ jsxRuntime.jsx(ThemeProvider, { ...props, children });
81
- }
82
- var init_theme_provider = __esm({
83
- "src/themes/theme-provider.tsx"() {
84
- "use client";
85
- }
86
- });
46
+ return to;
47
+ };
48
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
87
49
 
88
50
  // src/lib/theme-utils.ts
89
51
  exports.mapColorToShadcnVariant = void 0; exports.mapVariantToShadcnVariant = void 0; exports.getColorVariantClasses = void 0; exports.isDarkTheme = void 0;
@@ -147,28 +109,42 @@ var init_theme_utils = __esm({
147
109
  }
148
110
  });
149
111
  function useTheme() {
150
- if (typeof window === "undefined") {
112
+ const [themeData, setThemeData] = React__namespace.useState({
113
+ theme: "system",
114
+ setTheme: (theme) => {
115
+ },
116
+ resolvedTheme: "light",
117
+ isDark: false
118
+ });
119
+ const [mounted, setMounted] = React__namespace.useState(false);
120
+ React__namespace.useEffect(() => {
121
+ import('next-themes').then(({ useTheme: useNextTheme }) => {
122
+ const { theme, setTheme, resolvedTheme, systemTheme } = useNextTheme();
123
+ const isDark = exports.isDarkTheme(theme, systemTheme);
124
+ setThemeData({
125
+ theme: theme || "system",
126
+ setTheme,
127
+ resolvedTheme: resolvedTheme || "light",
128
+ isDark
129
+ });
130
+ setMounted(true);
131
+ });
132
+ }, []);
133
+ if (!mounted) {
151
134
  return {
152
135
  theme: "system",
153
- setTheme: () => {
136
+ setTheme: (theme) => {
154
137
  },
155
138
  resolvedTheme: "light",
156
139
  isDark: false
157
140
  };
158
141
  }
159
- const { theme, setTheme, resolvedTheme, systemTheme } = nextThemes.useTheme();
160
- const isDark = exports.isDarkTheme(theme, systemTheme);
161
- return {
162
- theme: theme || "system",
163
- setTheme,
164
- resolvedTheme: resolvedTheme || "light",
165
- isDark
166
- };
142
+ return themeData;
167
143
  }
168
144
  function useThemeServer() {
169
145
  return {
170
146
  theme: "system",
171
- setTheme: () => {
147
+ setTheme: (theme) => {
172
148
  },
173
149
  resolvedTheme: "light",
174
150
  isDark: false
@@ -297,50 +273,80 @@ var init_theme_toggle2 = __esm({
297
273
  init_theme_toggle();
298
274
  }
299
275
  });
276
+ function ThemeProvider({
277
+ children,
278
+ ...props
279
+ }) {
280
+ const [NextThemesProvider, setNextThemesProvider] = React__namespace.useState(null);
281
+ const [mounted, setMounted] = React__namespace.useState(false);
282
+ React__namespace.useEffect(() => {
283
+ import('next-themes').then(({ ThemeProvider: Provider }) => {
284
+ setNextThemesProvider(() => Provider);
285
+ setMounted(true);
286
+ });
287
+ }, []);
288
+ if (!mounted || !NextThemesProvider) {
289
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
290
+ }
291
+ return /* @__PURE__ */ jsxRuntime.jsx(
292
+ NextThemesProvider,
293
+ {
294
+ attribute: "class",
295
+ defaultTheme: "system",
296
+ enableSystem: true,
297
+ disableTransitionOnChange: true,
298
+ ...props,
299
+ children
300
+ }
301
+ );
302
+ }
303
+ function ThemeProviderNoSSR({
304
+ children,
305
+ ...props
306
+ }) {
307
+ const [mounted, setMounted] = React__namespace.useState(false);
308
+ React__namespace.useEffect(() => {
309
+ setMounted(true);
310
+ }, []);
311
+ if (!mounted) {
312
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
313
+ }
314
+ return /* @__PURE__ */ jsxRuntime.jsx(ThemeProvider, { ...props, children });
315
+ }
300
316
 
301
317
  // src/themes/index.ts
302
- init_theme_provider();
303
318
  init_theme_context();
304
319
  init_theme_toggle2();
305
- var DynamicThemeProvider = dynamic__default.default(
306
- () => Promise.resolve().then(() => (init_theme_provider(), theme_provider_exports)).then((mod) => ({ default: mod.ThemeProvider })),
307
- {
308
- ssr: false,
309
- loading: () => /* @__PURE__ */ jsxRuntime.jsx("div", { style: { visibility: "hidden" } })
310
- }
311
- );
312
- var DynamicThemeProviderNoSSR = dynamic__default.default(
313
- () => Promise.resolve().then(() => (init_theme_provider(), theme_provider_exports)).then((mod) => ({ default: mod.ThemeProviderNoSSR })),
314
- {
315
- ssr: false,
316
- loading: () => /* @__PURE__ */ jsxRuntime.jsx("div", { style: { visibility: "hidden" } })
317
- }
318
- );
319
- var DynamicThemeToggle = dynamic__default.default(
320
- () => Promise.resolve().then(() => (init_theme_toggle2(), theme_toggle_exports)).then((mod) => ({ default: mod.ThemeToggle })),
321
- {
322
- ssr: false,
323
- loading: () => /* @__PURE__ */ jsxRuntime.jsx("div", { style: { visibility: "hidden" } })
324
- }
325
- );
326
- function SafeThemeProvider({
320
+ function ClientThemeProvider({
327
321
  children,
328
- noSSR = false,
329
322
  ...props
330
323
  }) {
331
- if (noSSR) {
332
- return /* @__PURE__ */ jsxRuntime.jsx(DynamicThemeProviderNoSSR, { ...props, children });
324
+ const [mounted, setMounted] = React__namespace.useState(false);
325
+ React__namespace.useEffect(() => {
326
+ setMounted(true);
327
+ }, []);
328
+ if (!mounted) {
329
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
330
+ }
331
+ return /* @__PURE__ */ jsxRuntime.jsx(ThemeProvider, { ...props, children });
332
+ }
333
+ function ClientThemeToggle(props) {
334
+ const [mounted, setMounted] = React__namespace.useState(false);
335
+ React__namespace.useEffect(() => {
336
+ setMounted(true);
337
+ }, []);
338
+ if (!mounted) {
339
+ return null;
333
340
  }
334
- return /* @__PURE__ */ jsxRuntime.jsx(DynamicThemeProvider, { ...props, children });
341
+ const { ThemeToggle: ThemeToggle2 } = (init_theme_toggle2(), __toCommonJS(theme_toggle_exports));
342
+ return /* @__PURE__ */ jsxRuntime.jsx(ThemeToggle2, { ...props });
335
343
  }
336
344
 
337
345
  // src/themes/index.ts
338
346
  init_theme_utils();
339
347
 
340
- exports.DynamicThemeProvider = DynamicThemeProvider;
341
- exports.DynamicThemeProviderNoSSR = DynamicThemeProviderNoSSR;
342
- exports.DynamicThemeToggle = DynamicThemeToggle;
343
- exports.SafeThemeProvider = SafeThemeProvider;
348
+ exports.ClientThemeProvider = ClientThemeProvider;
349
+ exports.ClientThemeToggle = ClientThemeToggle;
344
350
  exports.ThemeContextProvider = ThemeContextProvider;
345
351
  exports.ThemeProvider = ThemeProvider;
346
352
  exports.ThemeProviderNoSSR = ThemeProviderNoSSR;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/themes/theme-provider.tsx","../../src/lib/theme-utils.ts","../../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/index.ts","../../src/themes/dynamic-imports.tsx"],"names":["jsx","NextThemesProvider","React","mapColorToShadcnVariant","mapVariantToShadcnVariant","getColorVariantClasses","isDarkTheme","useNextTheme","Fragment","twMerge","clsx","React2","IconSun","IconMoon","jsxs","init_theme_toggle","dynamic"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,sBAAA,GAAA,EAAA;AAAA,QAAA,CAAA,sBAAA,EAAA;AAAA,EAAA,aAAA,EAAA,MAAA,aAAA;AAAA,EAAA,kBAAA,EAAA,MAAA;AAAA,CAAA,CAAA;AAeO,SAAS,aAAA,CAAc;AAAA,EAC5B,QAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAuB;AAErB,EAAA,IAAI,OAAO,WAAW,WAAA,EAAa;AAEjC,IAAA,6DAAU,QAAA,EAAS,CAAA;AAAA,EACrB;AAEA,EAAA,uBACEA,cAAA;AAAA,IAACC,wBAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAU,OAAA;AAAA,MACV,YAAA,EAAa,QAAA;AAAA,MACb,YAAA,EAAY,IAAA;AAAA,MACZ,yBAAA,EAAyB,IAAA;AAAA,MACxB,GAAG,KAAA;AAAA,MAEH;AAAA;AAAA,GACH;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E,UAAA,EAAY,QAAA,EAAS,EAAG;AAAA;AAEzD;AAMO,SAAS,iBAAA,CAAkB;AAAA,EAChC,QAAA;AAAA,EACA,KAAA,GAAQ,KAAA;AAAA,EACR,GAAG;AACL,CAAA,EAIG;AACD,EAAA,IAAI,KAAA,EAAO;AACT,IAAA,uBAAOA,cAAAA,CAAC,yBAAA,EAAA,EAA2B,GAAG,OAAQ,QAAA,EAAS,CAAA;AAAA,EACzD;AAEA,EAAA,uBAAOA,cAAAA,CAAC,oBAAA,EAAA,EAAsB,GAAG,OAAQ,QAAA,EAAS,CAAA;AACpD;;;ADzCA,gBAAA,EAAA","file":"index.js","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { ThemeProvider as NextThemesProvider } from \"next-themes\"\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 // Ensure we're in a client environment\n if (typeof window === 'undefined') {\n // Return children without theme provider in SSR\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}","/**\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};","\"use client\"\n\nimport { useTheme as useNextTheme } from \"next-themes\"\nimport { isDarkTheme } from \"../lib/theme-utils\"\n\n/**\n * Enhanced useTheme hook that works directly with next-themes\n * \n * This hook provides a simplified interface to next-themes with additional\n * utility properties for better compatibility with Next.js App Router\n * \n * IMPORTANT: This hook must be used within a Client Component.\n * For Server Components, use the useThemeServer hook instead.\n */\nexport function useTheme() {\n // Ensure we're in a client environment\n if (typeof window === 'undefined') {\n // Return default values for SSR\n return {\n theme: \"system\",\n setTheme: () => {},\n resolvedTheme: \"light\",\n isDark: false,\n };\n }\n\n const { theme, setTheme, resolvedTheme, systemTheme } = useNextTheme();\n \n // Determine if the theme is dark\n const isDark = isDarkTheme(theme, systemTheme);\n \n return {\n theme: theme || \"system\",\n setTheme,\n resolvedTheme: resolvedTheme || \"light\",\n isDark,\n };\n}\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: () => {},\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}","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 */\nexport function ThemeToggle({ \n className, \n variant = 'icon', \n size = 'md',\n ...props \n}: ThemeToggleProps) {\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) return null;\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={resolvedTheme === \"dark\" ? \"Switch to light theme\" : \"Switch to dark 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 {...props}\n >\n {resolvedTheme === \"dark\" ? \"Light Mode\" : \"Dark Mode\"}\n </button>\n )\n }\n \n // Switch variant\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={resolvedTheme === \"dark\" ? \"Switch to light theme\" : \"Switch to dark 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';","// 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// Dynamic imports for Server Component compatibility\nexport { \n DynamicThemeProvider, \n DynamicThemeProviderNoSSR, \n DynamicThemeToggle,\n SafeThemeProvider \n} from './dynamic-imports';\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 dynamic from 'next/dynamic'\nimport type { ComponentType } from 'react'\n\n/**\n * Dynamically import theme components to prevent SSR issues\n * Use these imports when you need to use theme components in Server Components\n */\n\n// Dynamic import for ThemeProvider\nexport const DynamicThemeProvider = dynamic(\n () => import('./theme-provider').then(mod => ({ default: mod.ThemeProvider })),\n {\n ssr: false,\n loading: () => <div style={{ visibility: 'hidden' }} />,\n }\n) as ComponentType<any>\n\n// Dynamic import for ThemeProviderNoSSR\nexport const DynamicThemeProviderNoSSR = dynamic(\n () => import('./theme-provider').then(mod => ({ default: mod.ThemeProviderNoSSR })),\n {\n ssr: false,\n loading: () => <div style={{ visibility: 'hidden' }} />,\n }\n) as ComponentType<any>\n\n// Dynamic import for ThemeToggle\nexport const DynamicThemeToggle = dynamic(\n () => import('../components/ui/theme-toggle').then(mod => ({ default: mod.ThemeToggle })),\n {\n ssr: false,\n loading: () => <div style={{ visibility: 'hidden' }} />,\n }\n) as ComponentType<any>\n\n/**\n * Safe theme provider for Next.js App Router\n * Automatically handles Server Component compatibility\n */\nexport function SafeThemeProvider({ \n children, \n noSSR = false,\n ...props \n}: {\n children: React.ReactNode\n noSSR?: boolean\n [key: string]: any\n}) {\n if (noSSR) {\n return <DynamicThemeProviderNoSSR {...props}>{children}</DynamicThemeProviderNoSSR>\n }\n \n return <DynamicThemeProvider {...props}>{children}</DynamicThemeProvider>\n} "]}
1
+ {"version":3,"sources":["../../src/lib/theme-utils.ts","../../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"],"names":["mapColorToShadcnVariant","mapVariantToShadcnVariant","getColorVariantClasses","isDarkTheme","React2","jsx","Fragment","twMerge","clsx","React3","IconSun","IconMoon","jsxs","init_theme_toggle","React","React4","ThemeToggle"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBaA,wCAAA,CAAA,CAiBAC,4CAgBAC,uCAAA,CAAA,CAmCAC;AAxFb,IAAA,gBAAA,GAAA,KAAA,CAAA;AAAA,EAAA,wBAAA,GAAA;AAoBO,IAAMH,+BAAA,GAA0B,CAAC,KAAA,KAAsB;AAC5D,MAAA,QAAQ,KAAA;AAAO,QACb,KAAK,OAAA;AAAS,UAAA,OAAO,SAAA;AAAA,QACrB,KAAK,OAAA;AAAS,UAAA,OAAO,aAAA;AAAA,QACrB,KAAK,SAAA;AAAA,QACL,KAAK,SAAA;AACH,UAAA,OAAO,WAAA;AAAA;AAAA,QACT;AAAS,UAAA,OAAO,SAAA;AAAA;AAClB,IACF,CAAA;AAQO,IAAMC,iCAAA,GAA4B,CAAC,OAAA,KAA8B;AACtE,MAAA,QAAQ,OAAA;AAAS,QACf,KAAK,SAAA;AAAW,UAAA,OAAO,SAAA;AAAA,QACvB,KAAK,WAAA;AAAa,UAAA,OAAO,SAAA;AAAA,QACzB,KAAK,UAAA;AAAY,UAAA,OAAO,OAAA;AAAA,QACxB;AAAS,UAAA,OAAO,SAAA;AAAA;AAClB,IACF,CAAA;AASO,IAAMC,8BAAA,GAAyB,CACpC,KAAA,EACA,OAA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CAAAC,mBAAAA,EAAA,EAAG,QAAA,EAAS,CAAA;AAAA,EACrB;AAGA,EAAA,uBACED,cAAAA,CAAC,aAAA,EAAA,EAAe,GAAG,OAChB,QAAA,EACH,CAAA;AAEJ;AAMO,SAAS,kBAAkB,KAAA,EAAY;AAC5C,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAUU,0BAAS,KAAK,CAAA;AAElD,EAAMA,2BAAU,MAAM;AACpB,IAAA,UAAA,CAAW,IAAI,CAAA;AAAA,EACjB,CAAA,EAAG,EAAE,CAAA;AAGL,EAAA,IAAI,CAAC,OAAA,EAAS;AACZ,IAAA,OAAO,IAAA;AAAA,EACT;AAGA,EAAA,MAAM,EAAE,WAAA,EAAAC,YAAAA,EAAY,IAAI,kBAAA,EAAA,EAAA,YAAA,CAAA,oBAAA,CAAA,CAAA;AACxB,EAAA,uBAAOX,cAAAA,CAACW,YAAAA,EAAA,EAAa,GAAG,KAAA,EAAO,CAAA;AACjC;;;AD5CA,gBAAA,EAAA","file":"index.js","sourcesContent":["/**\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};","\"use client\"\n\nimport * as React from \"react\"\nimport { isDarkTheme } from \"../lib/theme-utils\"\n\n/**\n * Enhanced useTheme hook that works directly with next-themes\n * \n * This hook provides a simplified interface to next-themes with additional\n * utility properties for better compatibility with Next.js App Router\n * \n * IMPORTANT: This hook must be used within a Client Component.\n * For Server Components, use the useThemeServer hook instead.\n */\nexport function useTheme() {\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 import next-themes on the client side\n import('next-themes').then(({ useTheme: useNextTheme }) => {\n const { theme, setTheme, resolvedTheme, systemTheme } = useNextTheme();\n const isDark = isDarkTheme(theme, systemTheme);\n \n setThemeData({\n theme: theme || \"system\",\n setTheme,\n resolvedTheme: resolvedTheme || \"light\",\n isDark,\n });\n setMounted(true);\n });\n }, []);\n\n // Return default values during SSR or before mounting\n if (!mounted) {\n return {\n theme: \"system\",\n setTheme: (theme: string) => {},\n resolvedTheme: \"light\",\n isDark: false,\n };\n }\n\n return themeData;\n}\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}","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 */\nexport function ThemeToggle({ \n className, \n variant = 'icon', \n size = 'md',\n ...props \n}: ThemeToggleProps) {\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) return null;\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={resolvedTheme === \"dark\" ? \"Switch to light theme\" : \"Switch to dark 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 {...props}\n >\n {resolvedTheme === \"dark\" ? \"Light Mode\" : \"Dark Mode\"}\n </button>\n )\n }\n \n // Switch variant\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={resolvedTheme === \"dark\" ? \"Switch to light theme\" : \"Switch to dark 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>(null);\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 */\nexport function ClientThemeToggle(props: any) {\n const [mounted, setMounted] = React.useState(false);\n\n React.useEffect(() => {\n setMounted(true);\n }, []);\n\n // During SSR or before mounting, render nothing\n if (!mounted) {\n return null;\n }\n\n // Once mounted, render the theme toggle\n const { ThemeToggle } = require(\"../components/ui/theme-toggle\");\n return <ThemeToggle {...props} />;\n} "]}