@pixpilot/shadcn-ui 0.28.0 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import { FileUploadProps } from "./types/index.js";
2
- import * as react_jsx_runtime6 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime12 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/file-upload/FileUpload.d.ts
5
- declare function FileUpload(props: FileUploadProps): react_jsx_runtime6.JSX.Element;
5
+ declare function FileUpload(props: FileUploadProps): react_jsx_runtime12.JSX.Element;
6
6
  //#endregion
7
7
  export { FileUpload };
@@ -1,10 +1,10 @@
1
1
  import { FileUploadInlineProps } from "./types.js";
2
- import * as react_jsx_runtime7 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime6 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/file-upload-inline/FileUploadInline.d.ts
5
5
  /**
6
6
  * FileUploadInline - An inline file upload component using FileUpload primitives
7
7
  */
8
- declare function FileUploadInline(props: FileUploadInlineProps): react_jsx_runtime7.JSX.Element;
8
+ declare function FileUploadInline(props: FileUploadInlineProps): react_jsx_runtime6.JSX.Element;
9
9
  //#endregion
10
10
  export { FileUploadInline };
@@ -1,6 +1,6 @@
1
1
  import { InputProps } from "@pixpilot/shadcn";
2
2
  import * as React$1 from "react";
3
- import * as react_jsx_runtime8 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime7 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/input/Input.d.ts
6
6
  type InputProps$1 = InputProps & {
@@ -10,6 +10,6 @@ type InputProps$1 = InputProps & {
10
10
  prefixClassName?: string;
11
11
  suffixClassName?: string;
12
12
  };
13
- declare function Input$1(props: InputProps$1): react_jsx_runtime8.JSX.Element;
13
+ declare function Input$1(props: InputProps$1): react_jsx_runtime7.JSX.Element;
14
14
  //#endregion
15
15
  export { Input$1 as Input, InputProps$1 as InputProps };
@@ -15,11 +15,11 @@ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
15
15
  /**
16
16
  * Theme mode selector dropdown.
17
17
  * Provides Light / Dark / System options.
18
- * Pure component - requires theme and setTheme props.
18
+ * Pure component - requires themeValue and onChange props.
19
19
  */
20
20
  function ThemeModeDropdown(props) {
21
- const { align = "end", className, theme, setTheme, resolvedTheme, disabled } = props;
22
- const isDark = resolvedTheme === "dark";
21
+ const { align = "end", className, themeValue, onChange, value, disabled } = props;
22
+ const isDark = value === "dark";
23
23
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.DropdownMenu, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.DropdownMenuTrigger, {
24
24
  asChild: true,
25
25
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.Button, {
@@ -40,36 +40,36 @@ function ThemeModeDropdown(props) {
40
40
  align,
41
41
  children: [
42
42
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.DropdownMenuItem, {
43
- onClick: () => setTheme?.("light"),
43
+ onClick: () => onChange?.("light"),
44
44
  children: [
45
45
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Sun, { className: "h-4 w-4 mr-2" }),
46
46
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
47
47
  className: "flex-1",
48
48
  children: "Light"
49
49
  }),
50
- theme === "light" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "h-4 w-4 ml-2" })
50
+ themeValue === "light" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "h-4 w-4 ml-2" })
51
51
  ]
52
52
  }),
53
53
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.DropdownMenuItem, {
54
- onClick: () => setTheme?.("dark"),
54
+ onClick: () => onChange?.("dark"),
55
55
  children: [
56
56
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Moon, { className: "h-4 w-4 mr-2" }),
57
57
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
58
58
  className: "flex-1",
59
59
  children: "Dark"
60
60
  }),
61
- theme === "dark" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "h-4 w-4 ml-2" })
61
+ themeValue === "dark" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "h-4 w-4 ml-2" })
62
62
  ]
63
63
  }),
64
64
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.DropdownMenuItem, {
65
- onClick: () => setTheme?.("system"),
65
+ onClick: () => onChange?.("system"),
66
66
  children: [
67
67
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Monitor, { className: "h-4 w-4 mr-2" }),
68
68
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
69
69
  className: "flex-1",
70
70
  children: "System"
71
71
  }),
72
- theme === "system" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "h-4 w-4 ml-2" })
72
+ themeValue === "system" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "h-4 w-4 ml-2" })
73
73
  ]
74
74
  })
75
75
  ]
@@ -4,18 +4,18 @@ import * as react_jsx_runtime10 from "react/jsx-runtime";
4
4
  interface ThemeModeDropdownProps {
5
5
  align?: 'start' | 'center' | 'end';
6
6
  className?: string;
7
- /** Current theme value ("light" | "dark" | "system") */
8
- theme?: string;
7
+ /** Current theme selection ("light" | "dark" | "system") */
8
+ themeValue?: string;
9
9
  /** Function to change the theme */
10
- setTheme?: (theme: string) => void;
11
- /** The resolved theme ("light" | "dark") */
12
- resolvedTheme?: string;
10
+ onChange?: (theme: string) => void;
11
+ /** The resolved theme value ("light" | "dark") */
12
+ value?: string;
13
13
  disabled?: boolean;
14
14
  }
15
15
  /**
16
16
  * Theme mode selector dropdown.
17
17
  * Provides Light / Dark / System options.
18
- * Pure component - requires theme and setTheme props.
18
+ * Pure component - requires themeValue and onChange props.
19
19
  */
20
20
  declare function ThemeModeDropdown(props: ThemeModeDropdownProps): react_jsx_runtime10.JSX.Element;
21
21
  declare namespace ThemeModeDropdown {
@@ -1,23 +1,23 @@
1
- import * as react_jsx_runtime10 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime9 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/theme-toggle/ThemeModeDropdown.d.ts
4
4
  interface ThemeModeDropdownProps {
5
5
  align?: 'start' | 'center' | 'end';
6
6
  className?: string;
7
- /** Current theme value ("light" | "dark" | "system") */
8
- theme?: string;
7
+ /** Current theme selection ("light" | "dark" | "system") */
8
+ themeValue?: string;
9
9
  /** Function to change the theme */
10
- setTheme?: (theme: string) => void;
11
- /** The resolved theme ("light" | "dark") */
12
- resolvedTheme?: string;
10
+ onChange?: (theme: string) => void;
11
+ /** The resolved theme value ("light" | "dark") */
12
+ value?: string;
13
13
  disabled?: boolean;
14
14
  }
15
15
  /**
16
16
  * Theme mode selector dropdown.
17
17
  * Provides Light / Dark / System options.
18
- * Pure component - requires theme and setTheme props.
18
+ * Pure component - requires themeValue and onChange props.
19
19
  */
20
- declare function ThemeModeDropdown(props: ThemeModeDropdownProps): react_jsx_runtime10.JSX.Element;
20
+ declare function ThemeModeDropdown(props: ThemeModeDropdownProps): react_jsx_runtime9.JSX.Element;
21
21
  declare namespace ThemeModeDropdown {
22
22
  var displayName: string;
23
23
  }
@@ -10,11 +10,11 @@ import { jsx, jsxs } from "react/jsx-runtime";
10
10
  /**
11
11
  * Theme mode selector dropdown.
12
12
  * Provides Light / Dark / System options.
13
- * Pure component - requires theme and setTheme props.
13
+ * Pure component - requires themeValue and onChange props.
14
14
  */
15
15
  function ThemeModeDropdown(props) {
16
- const { align = "end", className, theme, setTheme, resolvedTheme, disabled } = props;
17
- const isDark = resolvedTheme === "dark";
16
+ const { align = "end", className, themeValue, onChange, value, disabled } = props;
17
+ const isDark = value === "dark";
18
18
  return /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
19
19
  asChild: true,
20
20
  children: /* @__PURE__ */ jsxs(Button, {
@@ -35,36 +35,36 @@ function ThemeModeDropdown(props) {
35
35
  align,
36
36
  children: [
37
37
  /* @__PURE__ */ jsxs(DropdownMenuItem, {
38
- onClick: () => setTheme?.("light"),
38
+ onClick: () => onChange?.("light"),
39
39
  children: [
40
40
  /* @__PURE__ */ jsx(Sun, { className: "h-4 w-4 mr-2" }),
41
41
  /* @__PURE__ */ jsx("span", {
42
42
  className: "flex-1",
43
43
  children: "Light"
44
44
  }),
45
- theme === "light" && /* @__PURE__ */ jsx(Check, { className: "h-4 w-4 ml-2" })
45
+ themeValue === "light" && /* @__PURE__ */ jsx(Check, { className: "h-4 w-4 ml-2" })
46
46
  ]
47
47
  }),
48
48
  /* @__PURE__ */ jsxs(DropdownMenuItem, {
49
- onClick: () => setTheme?.("dark"),
49
+ onClick: () => onChange?.("dark"),
50
50
  children: [
51
51
  /* @__PURE__ */ jsx(Moon, { className: "h-4 w-4 mr-2" }),
52
52
  /* @__PURE__ */ jsx("span", {
53
53
  className: "flex-1",
54
54
  children: "Dark"
55
55
  }),
56
- theme === "dark" && /* @__PURE__ */ jsx(Check, { className: "h-4 w-4 ml-2" })
56
+ themeValue === "dark" && /* @__PURE__ */ jsx(Check, { className: "h-4 w-4 ml-2" })
57
57
  ]
58
58
  }),
59
59
  /* @__PURE__ */ jsxs(DropdownMenuItem, {
60
- onClick: () => setTheme?.("system"),
60
+ onClick: () => onChange?.("system"),
61
61
  children: [
62
62
  /* @__PURE__ */ jsx(Monitor, { className: "h-4 w-4 mr-2" }),
63
63
  /* @__PURE__ */ jsx("span", {
64
64
  className: "flex-1",
65
65
  children: "System"
66
66
  }),
67
- theme === "system" && /* @__PURE__ */ jsx(Check, { className: "h-4 w-4 ml-2" })
67
+ themeValue === "system" && /* @__PURE__ */ jsx(Check, { className: "h-4 w-4 ml-2" })
68
68
  ]
69
69
  })
70
70
  ]
@@ -16,9 +16,9 @@ const ICON_CLASS_NAME = (0, __pixpilot_shadcn.cn)("pointer-events-none rounded-f
16
16
  const SWITCH_OVERLAY_CLASS_NAME = (0, __pixpilot_shadcn.cn)("absolute inset-0 h-full w-full opacity-0 cursor-pointer rounded-full", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", "ring-offset-background disabled:cursor-not-allowed");
17
17
  const SIZE_STYLES = {
18
18
  sm: {
19
- wrapper: "h-8",
19
+ wrapper: "h-7",
20
20
  iconPadding: "p-1",
21
- defaultIconSize: 22
21
+ defaultIconSize: 20
22
22
  },
23
23
  md: {
24
24
  wrapper: "h-8/5",
@@ -34,15 +34,15 @@ const SIZE_STYLES = {
34
34
  /**
35
35
  * Light/Dark theme switch with icons inside the switch.
36
36
  * Icons are embedded within the switch control.
37
- * Pure component - requires resolvedTheme and setTheme props.
37
+ * Pure component - requires value and onChange props.
38
38
  */
39
39
  function ThemeModeSwitchInside(props) {
40
- const { showIcons = true, size = "md", iconSize: iconSizeProp, className, switchClassName, disabled, ariaLabel = "Toggle theme", resolvedTheme, setTheme } = props;
40
+ const { showIcons = true, size = "md", iconSize: iconSizeProp, className, switchClassName, disabled, ariaLabel = "Toggle theme", value, onChange } = props;
41
41
  const sizeStyles = SIZE_STYLES[size];
42
42
  const iconSize = iconSizeProp ?? sizeStyles.defaultIconSize ?? DEFAULT_ICON_SIZE;
43
- const isDark = resolvedTheme === "dark";
43
+ const isDark = value === "dark";
44
44
  const onCheckedChange = (checked) => {
45
- setTheme?.(checked ? "dark" : "light");
45
+ onChange?.(checked ? "dark" : "light");
46
46
  };
47
47
  if (!showIcons) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.Switch, {
48
48
  checked: isDark,
@@ -15,15 +15,15 @@ interface ThemeModeSwitchInsideProps {
15
15
  switchClassName?: string;
16
16
  disabled?: boolean;
17
17
  ariaLabel?: string;
18
- /** The resolved theme ("light" | "dark") */
19
- resolvedTheme?: string;
18
+ /** The resolved theme value ("light" | "dark") */
19
+ value?: string;
20
20
  /** Function to change the theme */
21
- setTheme?: (theme: string) => void;
21
+ onChange?: (theme: string) => void;
22
22
  }
23
23
  /**
24
24
  * Light/Dark theme switch with icons inside the switch.
25
25
  * Icons are embedded within the switch control.
26
- * Pure component - requires resolvedTheme and setTheme props.
26
+ * Pure component - requires value and onChange props.
27
27
  */
28
28
  declare function ThemeModeSwitchInside(props: ThemeModeSwitchInsideProps): react_jsx_runtime11.JSX.Element;
29
29
  declare namespace ThemeModeSwitchInside {
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime11 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime10 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/theme-toggle/ThemeModeSwitchInside.d.ts
4
4
  type ThemeModeSwitchInsideSize = 'sm' | 'md' | 'lg';
@@ -15,17 +15,17 @@ interface ThemeModeSwitchInsideProps {
15
15
  switchClassName?: string;
16
16
  disabled?: boolean;
17
17
  ariaLabel?: string;
18
- /** The resolved theme ("light" | "dark") */
19
- resolvedTheme?: string;
18
+ /** The resolved theme value ("light" | "dark") */
19
+ value?: string;
20
20
  /** Function to change the theme */
21
- setTheme?: (theme: string) => void;
21
+ onChange?: (theme: string) => void;
22
22
  }
23
23
  /**
24
24
  * Light/Dark theme switch with icons inside the switch.
25
25
  * Icons are embedded within the switch control.
26
- * Pure component - requires resolvedTheme and setTheme props.
26
+ * Pure component - requires value and onChange props.
27
27
  */
28
- declare function ThemeModeSwitchInside(props: ThemeModeSwitchInsideProps): react_jsx_runtime11.JSX.Element;
28
+ declare function ThemeModeSwitchInside(props: ThemeModeSwitchInsideProps): react_jsx_runtime10.JSX.Element;
29
29
  declare namespace ThemeModeSwitchInside {
30
30
  var displayName: string;
31
31
  }
@@ -12,9 +12,9 @@ const ICON_CLASS_NAME = cn("pointer-events-none rounded-full transition-colors")
12
12
  const SWITCH_OVERLAY_CLASS_NAME = cn("absolute inset-0 h-full w-full opacity-0 cursor-pointer rounded-full", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", "ring-offset-background disabled:cursor-not-allowed");
13
13
  const SIZE_STYLES = {
14
14
  sm: {
15
- wrapper: "h-8",
15
+ wrapper: "h-7",
16
16
  iconPadding: "p-1",
17
- defaultIconSize: 22
17
+ defaultIconSize: 20
18
18
  },
19
19
  md: {
20
20
  wrapper: "h-8/5",
@@ -30,15 +30,15 @@ const SIZE_STYLES = {
30
30
  /**
31
31
  * Light/Dark theme switch with icons inside the switch.
32
32
  * Icons are embedded within the switch control.
33
- * Pure component - requires resolvedTheme and setTheme props.
33
+ * Pure component - requires value and onChange props.
34
34
  */
35
35
  function ThemeModeSwitchInside(props) {
36
- const { showIcons = true, size = "md", iconSize: iconSizeProp, className, switchClassName, disabled, ariaLabel = "Toggle theme", resolvedTheme, setTheme } = props;
36
+ const { showIcons = true, size = "md", iconSize: iconSizeProp, className, switchClassName, disabled, ariaLabel = "Toggle theme", value, onChange } = props;
37
37
  const sizeStyles = SIZE_STYLES[size];
38
38
  const iconSize = iconSizeProp ?? sizeStyles.defaultIconSize ?? DEFAULT_ICON_SIZE;
39
- const isDark = resolvedTheme === "dark";
39
+ const isDark = value === "dark";
40
40
  const onCheckedChange = (checked) => {
41
- setTheme?.(checked ? "dark" : "light");
41
+ onChange?.(checked ? "dark" : "light");
42
42
  };
43
43
  if (!showIcons) return /* @__PURE__ */ jsx(Switch, {
44
44
  checked: isDark,
@@ -16,13 +16,13 @@ const DEFAULT_ICON_SIZE = 16;
16
16
  /**
17
17
  * Light/Dark theme switch with icons outside the switch.
18
18
  * Icons flank the switch control on either side.
19
- * Pure component - requires resolvedTheme and setTheme props.
19
+ * Pure component - requires value and onChange props.
20
20
  */
21
21
  function ThemeModeSwitchOutside(props) {
22
- const { showIcons = true, iconSize = DEFAULT_ICON_SIZE, className, switchClassName, disabled, ariaLabel = "Toggle theme", resolvedTheme, setTheme } = props;
23
- const isDark = resolvedTheme === "dark";
22
+ const { showIcons = true, iconSize = DEFAULT_ICON_SIZE, className, switchClassName, disabled, ariaLabel = "Toggle theme", value, onChange } = props;
23
+ const isDark = value === "dark";
24
24
  const onCheckedChange = (checked) => {
25
- setTheme?.(checked ? "dark" : "light");
25
+ onChange?.(checked ? "dark" : "light");
26
26
  };
27
27
  if (!showIcons) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.Switch, {
28
28
  checked: isDark,
@@ -12,15 +12,15 @@ interface ThemeModeSwitchOutsideProps {
12
12
  switchClassName?: string;
13
13
  disabled?: boolean;
14
14
  ariaLabel?: string;
15
- /** The resolved theme ("light" | "dark") */
16
- resolvedTheme?: string;
15
+ /** The resolved theme value ("light" | "dark") */
16
+ value?: string;
17
17
  /** Function to change the theme */
18
- setTheme?: (theme: string) => void;
18
+ onChange?: (theme: string) => void;
19
19
  }
20
20
  /**
21
21
  * Light/Dark theme switch with icons outside the switch.
22
22
  * Icons flank the switch control on either side.
23
- * Pure component - requires resolvedTheme and setTheme props.
23
+ * Pure component - requires value and onChange props.
24
24
  */
25
25
  declare function ThemeModeSwitchOutside(props: ThemeModeSwitchOutsideProps): react_jsx_runtime12.JSX.Element;
26
26
  declare namespace ThemeModeSwitchOutside {
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime12 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime11 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/theme-toggle/ThemeModeSwitchOutside.d.ts
4
4
  interface ThemeModeSwitchOutsideProps {
@@ -12,17 +12,17 @@ interface ThemeModeSwitchOutsideProps {
12
12
  switchClassName?: string;
13
13
  disabled?: boolean;
14
14
  ariaLabel?: string;
15
- /** The resolved theme ("light" | "dark") */
16
- resolvedTheme?: string;
15
+ /** The resolved theme value ("light" | "dark") */
16
+ value?: string;
17
17
  /** Function to change the theme */
18
- setTheme?: (theme: string) => void;
18
+ onChange?: (theme: string) => void;
19
19
  }
20
20
  /**
21
21
  * Light/Dark theme switch with icons outside the switch.
22
22
  * Icons flank the switch control on either side.
23
- * Pure component - requires resolvedTheme and setTheme props.
23
+ * Pure component - requires value and onChange props.
24
24
  */
25
- declare function ThemeModeSwitchOutside(props: ThemeModeSwitchOutsideProps): react_jsx_runtime12.JSX.Element;
25
+ declare function ThemeModeSwitchOutside(props: ThemeModeSwitchOutsideProps): react_jsx_runtime11.JSX.Element;
26
26
  declare namespace ThemeModeSwitchOutside {
27
27
  var displayName: string;
28
28
  }
@@ -11,13 +11,13 @@ const DEFAULT_ICON_SIZE = 16;
11
11
  /**
12
12
  * Light/Dark theme switch with icons outside the switch.
13
13
  * Icons flank the switch control on either side.
14
- * Pure component - requires resolvedTheme and setTheme props.
14
+ * Pure component - requires value and onChange props.
15
15
  */
16
16
  function ThemeModeSwitchOutside(props) {
17
- const { showIcons = true, iconSize = DEFAULT_ICON_SIZE, className, switchClassName, disabled, ariaLabel = "Toggle theme", resolvedTheme, setTheme } = props;
18
- const isDark = resolvedTheme === "dark";
17
+ const { showIcons = true, iconSize = DEFAULT_ICON_SIZE, className, switchClassName, disabled, ariaLabel = "Toggle theme", value, onChange } = props;
18
+ const isDark = value === "dark";
19
19
  const onCheckedChange = (checked) => {
20
- setTheme?.(checked ? "dark" : "light");
20
+ onChange?.(checked ? "dark" : "light");
21
21
  };
22
22
  if (!showIcons) return /* @__PURE__ */ jsx(Switch, {
23
23
  checked: isDark,
@@ -17,14 +17,14 @@ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
17
17
  * Pure component - toggles between light and dark.
18
18
  */
19
19
  function ThemeModeToggleButton(props) {
20
- const { className, resolvedTheme, setTheme, disabled } = props;
20
+ const { className, value, onChange, disabled } = props;
21
21
  const toggleTheme = react.default.useCallback(() => {
22
- if (resolvedTheme === "dark") {
23
- setTheme?.("light");
22
+ if (value === "dark") {
23
+ onChange?.("light");
24
24
  return;
25
25
  }
26
- setTheme?.("dark");
27
- }, [resolvedTheme, setTheme]);
26
+ onChange?.("dark");
27
+ }, [value, onChange]);
28
28
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.Button, {
29
29
  variant: "secondary",
30
30
  size: "icon",
@@ -3,10 +3,10 @@ import * as react_jsx_runtime9 from "react/jsx-runtime";
3
3
  //#region src/theme-toggle/ThemeModeToggleButton.d.ts
4
4
  interface ThemeModeToggleButtonProps {
5
5
  className?: string;
6
- /** The resolved theme ("light" | "dark") */
7
- resolvedTheme?: string;
6
+ /** The resolved theme value ("light" | "dark") */
7
+ value?: string;
8
8
  /** Function to change the theme */
9
- setTheme?: (theme: string) => void;
9
+ onChange?: (theme: string) => void;
10
10
  disabled?: boolean;
11
11
  }
12
12
  /**
@@ -1,19 +1,19 @@
1
- import * as react_jsx_runtime9 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime8 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/theme-toggle/ThemeModeToggleButton.d.ts
4
4
  interface ThemeModeToggleButtonProps {
5
5
  className?: string;
6
- /** The resolved theme ("light" | "dark") */
7
- resolvedTheme?: string;
6
+ /** The resolved theme value ("light" | "dark") */
7
+ value?: string;
8
8
  /** Function to change the theme */
9
- setTheme?: (theme: string) => void;
9
+ onChange?: (theme: string) => void;
10
10
  disabled?: boolean;
11
11
  }
12
12
  /**
13
13
  * Light/Dark toggle button.
14
14
  * Pure component - toggles between light and dark.
15
15
  */
16
- declare function ThemeModeToggleButton(props: ThemeModeToggleButtonProps): react_jsx_runtime9.JSX.Element;
16
+ declare function ThemeModeToggleButton(props: ThemeModeToggleButtonProps): react_jsx_runtime8.JSX.Element;
17
17
  declare namespace ThemeModeToggleButton {
18
18
  var displayName: string;
19
19
  }
@@ -12,14 +12,14 @@ import { jsx, jsxs } from "react/jsx-runtime";
12
12
  * Pure component - toggles between light and dark.
13
13
  */
14
14
  function ThemeModeToggleButton(props) {
15
- const { className, resolvedTheme, setTheme, disabled } = props;
15
+ const { className, value, onChange, disabled } = props;
16
16
  const toggleTheme = React.useCallback(() => {
17
- if (resolvedTheme === "dark") {
18
- setTheme?.("light");
17
+ if (value === "dark") {
18
+ onChange?.("light");
19
19
  return;
20
20
  }
21
- setTheme?.("dark");
22
- }, [resolvedTheme, setTheme]);
21
+ onChange?.("dark");
22
+ }, [value, onChange]);
23
23
  return /* @__PURE__ */ jsxs(Button, {
24
24
  variant: "secondary",
25
25
  size: "icon",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pixpilot/shadcn-ui",
3
3
  "type": "module",
4
- "version": "0.28.0",
4
+ "version": "0.29.0",
5
5
  "description": "Custom UI components and utilities built with shadcn/ui.",
6
6
  "author": "m.doaie <m.doaie@hotmail.com>",
7
7
  "license": "MIT",
@@ -57,11 +57,11 @@
57
57
  "react-dom": "19.2.0",
58
58
  "tsdown": "^0.15.12",
59
59
  "typescript": "^5.9.3",
60
- "@internal/eslint-config": "0.3.0",
61
60
  "@internal/hooks": "0.0.0",
61
+ "@internal/eslint-config": "0.3.0",
62
62
  "@internal/prettier-config": "0.0.1",
63
- "@internal/tsconfig": "0.1.0",
64
63
  "@internal/tsdown-config": "0.1.0",
64
+ "@internal/tsconfig": "0.1.0",
65
65
  "@internal/vitest-config": "0.1.0"
66
66
  },
67
67
  "prettier": "@internal/prettier-config",