@pixpilot/shadcn-ui 0.25.1 → 0.27.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.
Files changed (56) hide show
  1. package/dist/AbsoluteFill.cjs +1 -0
  2. package/dist/AbsoluteFill.js +1 -0
  3. package/dist/Button.cjs +1 -0
  4. package/dist/Button.js +1 -0
  5. package/dist/ColorSelect.d.ts +2 -2
  6. package/dist/ContentCard.d.cts +2 -2
  7. package/dist/ContentCard.d.ts +2 -2
  8. package/dist/DatePicker.d.cts +2 -2
  9. package/dist/DatePicker.d.ts +2 -2
  10. package/dist/ScaledPreview.cjs +2 -0
  11. package/dist/ScaledPreview.js +2 -0
  12. package/dist/file-upload/FileUpload.d.cts +2 -2
  13. package/dist/file-upload/FileUpload.d.ts +2 -2
  14. package/dist/file-upload-inline/FileUploadInline.d.ts +2 -2
  15. package/dist/index.cjs +10 -1
  16. package/dist/index.d.cts +7 -2
  17. package/dist/index.d.ts +7 -2
  18. package/dist/index.js +7 -2
  19. package/dist/input/Input.d.ts +2 -2
  20. package/dist/layout/Layout.cjs +1 -0
  21. package/dist/layout/Layout.js +1 -0
  22. package/dist/layout/LayoutFooter.cjs +1 -0
  23. package/dist/layout/LayoutFooter.js +1 -0
  24. package/dist/layout/LayoutHeader.cjs +1 -0
  25. package/dist/layout/LayoutHeader.js +1 -0
  26. package/dist/layout/LayoutMain.cjs +1 -0
  27. package/dist/layout/LayoutMain.js +1 -0
  28. package/dist/theme-provider/index.d.ts +2 -2
  29. package/dist/theme-provider/index.js +2 -2
  30. package/dist/theme-toggle/ThemeModeDropdown.cjs +81 -0
  31. package/dist/theme-toggle/ThemeModeDropdown.d.cts +25 -0
  32. package/dist/theme-toggle/ThemeModeDropdown.d.ts +25 -0
  33. package/dist/theme-toggle/ThemeModeDropdown.js +76 -0
  34. package/dist/theme-toggle/ThemeModeSwitchInside.cjs +86 -0
  35. package/dist/theme-toggle/ThemeModeSwitchInside.d.cts +33 -0
  36. package/dist/theme-toggle/ThemeModeSwitchInside.d.ts +33 -0
  37. package/dist/theme-toggle/ThemeModeSwitchInside.js +82 -0
  38. package/dist/theme-toggle/ThemeModeSwitchOutside.cjs +68 -0
  39. package/dist/theme-toggle/ThemeModeSwitchOutside.d.cts +30 -0
  40. package/dist/theme-toggle/ThemeModeSwitchOutside.d.ts +30 -0
  41. package/dist/theme-toggle/ThemeModeSwitchOutside.js +63 -0
  42. package/dist/theme-toggle/ThemeModeToggleButton.cjs +48 -0
  43. package/dist/theme-toggle/ThemeModeToggleButton.d.cts +21 -0
  44. package/dist/theme-toggle/ThemeModeToggleButton.d.ts +21 -0
  45. package/dist/theme-toggle/ThemeModeToggleButton.js +43 -0
  46. package/dist/{ThemeToggle.cjs → theme-toggle/ThemeToggle.cjs} +13 -23
  47. package/dist/theme-toggle/ThemeToggle.d.cts +17 -0
  48. package/dist/theme-toggle/ThemeToggle.d.ts +17 -0
  49. package/dist/{ThemeToggle.js → theme-toggle/ThemeToggle.js} +13 -22
  50. package/dist/theme-toggle/index.cjs +5 -0
  51. package/dist/theme-toggle/index.d.cts +5 -0
  52. package/dist/theme-toggle/index.d.ts +5 -0
  53. package/dist/theme-toggle/index.js +5 -0
  54. package/package.json +1 -1
  55. package/dist/ThemeToggle.d.cts +0 -6
  56. package/dist/ThemeToggle.d.ts +0 -6
@@ -0,0 +1,86 @@
1
+ 'use client';
2
+
3
+
4
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
5
+ let __pixpilot_shadcn = require("@pixpilot/shadcn");
6
+ __pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
7
+ let lucide_react = require("lucide-react");
8
+ lucide_react = require_rolldown_runtime.__toESM(lucide_react);
9
+ let react_jsx_runtime = require("react/jsx-runtime");
10
+ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
11
+
12
+ //#region src/theme-toggle/ThemeModeSwitchInside.tsx
13
+ const DEFAULT_ICON_SIZE = 16;
14
+ const TOGGLE_WRAPPER_CLASS_NAME = (0, __pixpilot_shadcn.cn)("relative inline-flex items-center gap-1 rounded-full border border-border p-1 bg-transparent");
15
+ const ICON_CLASS_NAME = (0, __pixpilot_shadcn.cn)("pointer-events-none rounded-full transition-colors");
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
+ const SIZE_STYLES = {
18
+ sm: {
19
+ wrapper: "h-8",
20
+ iconPadding: "p-1",
21
+ defaultIconSize: 22
22
+ },
23
+ md: {
24
+ wrapper: "h-8/5",
25
+ iconPadding: "p-1",
26
+ defaultIconSize: 24
27
+ },
28
+ lg: {
29
+ wrapper: "h-10 p-1.5 gap-1.5",
30
+ iconPadding: "p-1.5",
31
+ defaultIconSize: 30
32
+ }
33
+ };
34
+ /**
35
+ * Light/Dark theme switch with icons inside the switch.
36
+ * Icons are embedded within the switch control.
37
+ * Pure component - requires resolvedTheme and setTheme props.
38
+ */
39
+ function ThemeModeSwitchInside(props) {
40
+ const { showIcons = true, size = "md", iconSize: iconSizeProp, className, switchClassName, disabled, ariaLabel = "Toggle theme", resolvedTheme, setTheme } = props;
41
+ const sizeStyles = SIZE_STYLES[size];
42
+ const iconSize = iconSizeProp ?? sizeStyles.defaultIconSize ?? DEFAULT_ICON_SIZE;
43
+ const isDark = resolvedTheme === "dark";
44
+ const onCheckedChange = (checked) => {
45
+ setTheme?.(checked ? "dark" : "light");
46
+ };
47
+ if (!showIcons) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.Switch, {
48
+ checked: isDark,
49
+ onCheckedChange,
50
+ disabled,
51
+ className: (0, __pixpilot_shadcn.cn)(switchClassName),
52
+ "aria-label": ariaLabel
53
+ });
54
+ const sunClassName = (0, __pixpilot_shadcn.cn)(ICON_CLASS_NAME, sizeStyles.iconPadding, isDark ? "text-muted-foreground" : "bg-primary/10 text-accent-foreground");
55
+ const moonClassName = (0, __pixpilot_shadcn.cn)(ICON_CLASS_NAME, sizeStyles.iconPadding, isDark ? "bg-accent text-accent-foreground" : "text-muted-foreground");
56
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
57
+ className: (0, __pixpilot_shadcn.cn)(TOGGLE_WRAPPER_CLASS_NAME, sizeStyles.wrapper, disabled && "opacity-50", className),
58
+ children: [
59
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.Switch, {
60
+ checked: isDark,
61
+ onCheckedChange,
62
+ disabled,
63
+ className: (0, __pixpilot_shadcn.cn)(SWITCH_OVERLAY_CLASS_NAME, switchClassName),
64
+ "aria-label": ariaLabel
65
+ }),
66
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.SunIcon, {
67
+ className: sunClassName,
68
+ style: {
69
+ width: iconSize,
70
+ height: iconSize
71
+ }
72
+ }),
73
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.MoonIcon, {
74
+ className: moonClassName,
75
+ style: {
76
+ width: iconSize,
77
+ height: iconSize
78
+ }
79
+ })
80
+ ]
81
+ });
82
+ }
83
+ ThemeModeSwitchInside.displayName = "ThemeModeSwitchInside";
84
+
85
+ //#endregion
86
+ exports.ThemeModeSwitchInside = ThemeModeSwitchInside;
@@ -0,0 +1,33 @@
1
+ import * as react_jsx_runtime11 from "react/jsx-runtime";
2
+
3
+ //#region src/theme-toggle/ThemeModeSwitchInside.d.ts
4
+ type ThemeModeSwitchInsideSize = 'sm' | 'md' | 'lg';
5
+ interface ThemeModeSwitchInsideProps {
6
+ /** Whether to render the sun/moon icons at all. */
7
+ showIcons?: boolean;
8
+ /** Visual size of the toggle pill. */
9
+ size?: ThemeModeSwitchInsideSize;
10
+ /** Icon size in pixels. */
11
+ iconSize?: number;
12
+ /** Wrapper class name. */
13
+ className?: string;
14
+ /** Class name applied to the underlying Switch. */
15
+ switchClassName?: string;
16
+ disabled?: boolean;
17
+ ariaLabel?: string;
18
+ /** The resolved theme ("light" | "dark") */
19
+ resolvedTheme?: string;
20
+ /** Function to change the theme */
21
+ setTheme?: (theme: string) => void;
22
+ }
23
+ /**
24
+ * Light/Dark theme switch with icons inside the switch.
25
+ * Icons are embedded within the switch control.
26
+ * Pure component - requires resolvedTheme and setTheme props.
27
+ */
28
+ declare function ThemeModeSwitchInside(props: ThemeModeSwitchInsideProps): react_jsx_runtime11.JSX.Element;
29
+ declare namespace ThemeModeSwitchInside {
30
+ var displayName: string;
31
+ }
32
+ //#endregion
33
+ export { ThemeModeSwitchInside, ThemeModeSwitchInsideProps, ThemeModeSwitchInsideSize };
@@ -0,0 +1,33 @@
1
+ import * as react_jsx_runtime10 from "react/jsx-runtime";
2
+
3
+ //#region src/theme-toggle/ThemeModeSwitchInside.d.ts
4
+ type ThemeModeSwitchInsideSize = 'sm' | 'md' | 'lg';
5
+ interface ThemeModeSwitchInsideProps {
6
+ /** Whether to render the sun/moon icons at all. */
7
+ showIcons?: boolean;
8
+ /** Visual size of the toggle pill. */
9
+ size?: ThemeModeSwitchInsideSize;
10
+ /** Icon size in pixels. */
11
+ iconSize?: number;
12
+ /** Wrapper class name. */
13
+ className?: string;
14
+ /** Class name applied to the underlying Switch. */
15
+ switchClassName?: string;
16
+ disabled?: boolean;
17
+ ariaLabel?: string;
18
+ /** The resolved theme ("light" | "dark") */
19
+ resolvedTheme?: string;
20
+ /** Function to change the theme */
21
+ setTheme?: (theme: string) => void;
22
+ }
23
+ /**
24
+ * Light/Dark theme switch with icons inside the switch.
25
+ * Icons are embedded within the switch control.
26
+ * Pure component - requires resolvedTheme and setTheme props.
27
+ */
28
+ declare function ThemeModeSwitchInside(props: ThemeModeSwitchInsideProps): react_jsx_runtime10.JSX.Element;
29
+ declare namespace ThemeModeSwitchInside {
30
+ var displayName: string;
31
+ }
32
+ //#endregion
33
+ export { ThemeModeSwitchInside, ThemeModeSwitchInsideProps, ThemeModeSwitchInsideSize };
@@ -0,0 +1,82 @@
1
+ 'use client';
2
+
3
+
4
+ import { Switch, cn } from "@pixpilot/shadcn";
5
+ import { MoonIcon, SunIcon } from "lucide-react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+
8
+ //#region src/theme-toggle/ThemeModeSwitchInside.tsx
9
+ const DEFAULT_ICON_SIZE = 16;
10
+ const TOGGLE_WRAPPER_CLASS_NAME = cn("relative inline-flex items-center gap-1 rounded-full border border-border p-1 bg-transparent");
11
+ const ICON_CLASS_NAME = cn("pointer-events-none rounded-full transition-colors");
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
+ const SIZE_STYLES = {
14
+ sm: {
15
+ wrapper: "h-8",
16
+ iconPadding: "p-1",
17
+ defaultIconSize: 22
18
+ },
19
+ md: {
20
+ wrapper: "h-8/5",
21
+ iconPadding: "p-1",
22
+ defaultIconSize: 24
23
+ },
24
+ lg: {
25
+ wrapper: "h-10 p-1.5 gap-1.5",
26
+ iconPadding: "p-1.5",
27
+ defaultIconSize: 30
28
+ }
29
+ };
30
+ /**
31
+ * Light/Dark theme switch with icons inside the switch.
32
+ * Icons are embedded within the switch control.
33
+ * Pure component - requires resolvedTheme and setTheme props.
34
+ */
35
+ function ThemeModeSwitchInside(props) {
36
+ const { showIcons = true, size = "md", iconSize: iconSizeProp, className, switchClassName, disabled, ariaLabel = "Toggle theme", resolvedTheme, setTheme } = props;
37
+ const sizeStyles = SIZE_STYLES[size];
38
+ const iconSize = iconSizeProp ?? sizeStyles.defaultIconSize ?? DEFAULT_ICON_SIZE;
39
+ const isDark = resolvedTheme === "dark";
40
+ const onCheckedChange = (checked) => {
41
+ setTheme?.(checked ? "dark" : "light");
42
+ };
43
+ if (!showIcons) return /* @__PURE__ */ jsx(Switch, {
44
+ checked: isDark,
45
+ onCheckedChange,
46
+ disabled,
47
+ className: cn(switchClassName),
48
+ "aria-label": ariaLabel
49
+ });
50
+ const sunClassName = cn(ICON_CLASS_NAME, sizeStyles.iconPadding, isDark ? "text-muted-foreground" : "bg-primary/10 text-accent-foreground");
51
+ const moonClassName = cn(ICON_CLASS_NAME, sizeStyles.iconPadding, isDark ? "bg-accent text-accent-foreground" : "text-muted-foreground");
52
+ return /* @__PURE__ */ jsxs("div", {
53
+ className: cn(TOGGLE_WRAPPER_CLASS_NAME, sizeStyles.wrapper, disabled && "opacity-50", className),
54
+ children: [
55
+ /* @__PURE__ */ jsx(Switch, {
56
+ checked: isDark,
57
+ onCheckedChange,
58
+ disabled,
59
+ className: cn(SWITCH_OVERLAY_CLASS_NAME, switchClassName),
60
+ "aria-label": ariaLabel
61
+ }),
62
+ /* @__PURE__ */ jsx(SunIcon, {
63
+ className: sunClassName,
64
+ style: {
65
+ width: iconSize,
66
+ height: iconSize
67
+ }
68
+ }),
69
+ /* @__PURE__ */ jsx(MoonIcon, {
70
+ className: moonClassName,
71
+ style: {
72
+ width: iconSize,
73
+ height: iconSize
74
+ }
75
+ })
76
+ ]
77
+ });
78
+ }
79
+ ThemeModeSwitchInside.displayName = "ThemeModeSwitchInside";
80
+
81
+ //#endregion
82
+ export { ThemeModeSwitchInside };
@@ -0,0 +1,68 @@
1
+ 'use client';
2
+
3
+
4
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
5
+ let __pixpilot_shadcn = require("@pixpilot/shadcn");
6
+ __pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
7
+ let lucide_react = require("lucide-react");
8
+ lucide_react = require_rolldown_runtime.__toESM(lucide_react);
9
+ let react = require("react");
10
+ react = require_rolldown_runtime.__toESM(react);
11
+ let react_jsx_runtime = require("react/jsx-runtime");
12
+ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
13
+
14
+ //#region src/theme-toggle/ThemeModeSwitchOutside.tsx
15
+ const DEFAULT_ICON_SIZE = 16;
16
+ /**
17
+ * Light/Dark theme switch with icons outside the switch.
18
+ * Icons flank the switch control on either side.
19
+ * Pure component - requires resolvedTheme and setTheme props.
20
+ */
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";
24
+ const onCheckedChange = (checked) => {
25
+ setTheme?.(checked ? "dark" : "light");
26
+ };
27
+ if (!showIcons) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.Switch, {
28
+ checked: isDark,
29
+ onCheckedChange,
30
+ disabled,
31
+ className: (0, __pixpilot_shadcn.cn)(switchClassName),
32
+ "aria-label": ariaLabel
33
+ });
34
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
35
+ className: (0, __pixpilot_shadcn.cn)("inline-flex items-center gap-2 px-2", className),
36
+ children: [
37
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.SunIcon, {
38
+ className: (0, __pixpilot_shadcn.cn)("transition-opacity ", isDark ? "opacity-50 " : "opacity-100"),
39
+ style: {
40
+ width: iconSize,
41
+ height: iconSize
42
+ }
43
+ }),
44
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.Switch, {
45
+ checked: isDark,
46
+ onCheckedChange,
47
+ disabled,
48
+ className: (0, __pixpilot_shadcn.cn)(switchClassName),
49
+ "aria-label": ariaLabel
50
+ }),
51
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.MoonIcon, {
52
+ className: (0, __pixpilot_shadcn.cn)("transition-opacity", isDark ? "opacity-100" : "opacity-50"),
53
+ style: {
54
+ width: iconSize,
55
+ height: iconSize
56
+ }
57
+ }),
58
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
59
+ className: "sr-only",
60
+ children: ariaLabel
61
+ })
62
+ ]
63
+ });
64
+ }
65
+ ThemeModeSwitchOutside.displayName = "ThemeModeSwitchOutside";
66
+
67
+ //#endregion
68
+ exports.ThemeModeSwitchOutside = ThemeModeSwitchOutside;
@@ -0,0 +1,30 @@
1
+ import * as react_jsx_runtime12 from "react/jsx-runtime";
2
+
3
+ //#region src/theme-toggle/ThemeModeSwitchOutside.d.ts
4
+ interface ThemeModeSwitchOutsideProps {
5
+ /** Whether to render the sun/moon icons at all. */
6
+ showIcons?: boolean;
7
+ /** Icon size in pixels. */
8
+ iconSize?: number;
9
+ /** Wrapper class name. */
10
+ className?: string;
11
+ /** Class name applied to the underlying Switch. */
12
+ switchClassName?: string;
13
+ disabled?: boolean;
14
+ ariaLabel?: string;
15
+ /** The resolved theme ("light" | "dark") */
16
+ resolvedTheme?: string;
17
+ /** Function to change the theme */
18
+ setTheme?: (theme: string) => void;
19
+ }
20
+ /**
21
+ * Light/Dark theme switch with icons outside the switch.
22
+ * Icons flank the switch control on either side.
23
+ * Pure component - requires resolvedTheme and setTheme props.
24
+ */
25
+ declare function ThemeModeSwitchOutside(props: ThemeModeSwitchOutsideProps): react_jsx_runtime12.JSX.Element;
26
+ declare namespace ThemeModeSwitchOutside {
27
+ var displayName: string;
28
+ }
29
+ //#endregion
30
+ export { ThemeModeSwitchOutside, ThemeModeSwitchOutsideProps };
@@ -0,0 +1,30 @@
1
+ import * as react_jsx_runtime11 from "react/jsx-runtime";
2
+
3
+ //#region src/theme-toggle/ThemeModeSwitchOutside.d.ts
4
+ interface ThemeModeSwitchOutsideProps {
5
+ /** Whether to render the sun/moon icons at all. */
6
+ showIcons?: boolean;
7
+ /** Icon size in pixels. */
8
+ iconSize?: number;
9
+ /** Wrapper class name. */
10
+ className?: string;
11
+ /** Class name applied to the underlying Switch. */
12
+ switchClassName?: string;
13
+ disabled?: boolean;
14
+ ariaLabel?: string;
15
+ /** The resolved theme ("light" | "dark") */
16
+ resolvedTheme?: string;
17
+ /** Function to change the theme */
18
+ setTheme?: (theme: string) => void;
19
+ }
20
+ /**
21
+ * Light/Dark theme switch with icons outside the switch.
22
+ * Icons flank the switch control on either side.
23
+ * Pure component - requires resolvedTheme and setTheme props.
24
+ */
25
+ declare function ThemeModeSwitchOutside(props: ThemeModeSwitchOutsideProps): react_jsx_runtime11.JSX.Element;
26
+ declare namespace ThemeModeSwitchOutside {
27
+ var displayName: string;
28
+ }
29
+ //#endregion
30
+ export { ThemeModeSwitchOutside, ThemeModeSwitchOutsideProps };
@@ -0,0 +1,63 @@
1
+ 'use client';
2
+
3
+
4
+ import { Switch, cn } from "@pixpilot/shadcn";
5
+ import { MoonIcon, SunIcon } from "lucide-react";
6
+ import React from "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+
9
+ //#region src/theme-toggle/ThemeModeSwitchOutside.tsx
10
+ const DEFAULT_ICON_SIZE = 16;
11
+ /**
12
+ * Light/Dark theme switch with icons outside the switch.
13
+ * Icons flank the switch control on either side.
14
+ * Pure component - requires resolvedTheme and setTheme props.
15
+ */
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";
19
+ const onCheckedChange = (checked) => {
20
+ setTheme?.(checked ? "dark" : "light");
21
+ };
22
+ if (!showIcons) return /* @__PURE__ */ jsx(Switch, {
23
+ checked: isDark,
24
+ onCheckedChange,
25
+ disabled,
26
+ className: cn(switchClassName),
27
+ "aria-label": ariaLabel
28
+ });
29
+ return /* @__PURE__ */ jsxs("div", {
30
+ className: cn("inline-flex items-center gap-2 px-2", className),
31
+ children: [
32
+ /* @__PURE__ */ jsx(SunIcon, {
33
+ className: cn("transition-opacity ", isDark ? "opacity-50 " : "opacity-100"),
34
+ style: {
35
+ width: iconSize,
36
+ height: iconSize
37
+ }
38
+ }),
39
+ /* @__PURE__ */ jsx(Switch, {
40
+ checked: isDark,
41
+ onCheckedChange,
42
+ disabled,
43
+ className: cn(switchClassName),
44
+ "aria-label": ariaLabel
45
+ }),
46
+ /* @__PURE__ */ jsx(MoonIcon, {
47
+ className: cn("transition-opacity", isDark ? "opacity-100" : "opacity-50"),
48
+ style: {
49
+ width: iconSize,
50
+ height: iconSize
51
+ }
52
+ }),
53
+ /* @__PURE__ */ jsx("span", {
54
+ className: "sr-only",
55
+ children: ariaLabel
56
+ })
57
+ ]
58
+ });
59
+ }
60
+ ThemeModeSwitchOutside.displayName = "ThemeModeSwitchOutside";
61
+
62
+ //#endregion
63
+ export { ThemeModeSwitchOutside };
@@ -0,0 +1,48 @@
1
+ 'use client';
2
+
3
+
4
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
5
+ let __pixpilot_shadcn = require("@pixpilot/shadcn");
6
+ __pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
7
+ let lucide_react = require("lucide-react");
8
+ lucide_react = require_rolldown_runtime.__toESM(lucide_react);
9
+ let react = require("react");
10
+ react = require_rolldown_runtime.__toESM(react);
11
+ let react_jsx_runtime = require("react/jsx-runtime");
12
+ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
13
+
14
+ //#region src/theme-toggle/ThemeModeToggleButton.tsx
15
+ /**
16
+ * Light/Dark toggle button.
17
+ * Pure component - toggles between light and dark.
18
+ */
19
+ function ThemeModeToggleButton(props) {
20
+ const { className, resolvedTheme, setTheme, disabled } = props;
21
+ const toggleTheme = react.default.useCallback(() => {
22
+ if (resolvedTheme === "dark") {
23
+ setTheme?.("light");
24
+ return;
25
+ }
26
+ setTheme?.("dark");
27
+ }, [resolvedTheme, setTheme]);
28
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.Button, {
29
+ variant: "secondary",
30
+ size: "icon",
31
+ className: (0, __pixpilot_shadcn.cn)("group/toggle size-8", className),
32
+ onClick: toggleTheme,
33
+ type: "button",
34
+ disabled,
35
+ children: [
36
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.SunIcon, { className: "hidden [html.dark_&]:block" }),
37
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.MoonIcon, { className: "hidden [html.light_&]:block" }),
38
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
39
+ className: "sr-only",
40
+ children: "Toggle theme"
41
+ })
42
+ ]
43
+ });
44
+ }
45
+ ThemeModeToggleButton.displayName = "ThemeModeToggleButton";
46
+
47
+ //#endregion
48
+ exports.ThemeModeToggleButton = ThemeModeToggleButton;
@@ -0,0 +1,21 @@
1
+ import * as react_jsx_runtime13 from "react/jsx-runtime";
2
+
3
+ //#region src/theme-toggle/ThemeModeToggleButton.d.ts
4
+ interface ThemeModeToggleButtonProps {
5
+ className?: string;
6
+ /** The resolved theme ("light" | "dark") */
7
+ resolvedTheme?: string;
8
+ /** Function to change the theme */
9
+ setTheme?: (theme: string) => void;
10
+ disabled?: boolean;
11
+ }
12
+ /**
13
+ * Light/Dark toggle button.
14
+ * Pure component - toggles between light and dark.
15
+ */
16
+ declare function ThemeModeToggleButton(props: ThemeModeToggleButtonProps): react_jsx_runtime13.JSX.Element;
17
+ declare namespace ThemeModeToggleButton {
18
+ var displayName: string;
19
+ }
20
+ //#endregion
21
+ export { ThemeModeToggleButton, ThemeModeToggleButtonProps };
@@ -0,0 +1,21 @@
1
+ import * as react_jsx_runtime12 from "react/jsx-runtime";
2
+
3
+ //#region src/theme-toggle/ThemeModeToggleButton.d.ts
4
+ interface ThemeModeToggleButtonProps {
5
+ className?: string;
6
+ /** The resolved theme ("light" | "dark") */
7
+ resolvedTheme?: string;
8
+ /** Function to change the theme */
9
+ setTheme?: (theme: string) => void;
10
+ disabled?: boolean;
11
+ }
12
+ /**
13
+ * Light/Dark toggle button.
14
+ * Pure component - toggles between light and dark.
15
+ */
16
+ declare function ThemeModeToggleButton(props: ThemeModeToggleButtonProps): react_jsx_runtime12.JSX.Element;
17
+ declare namespace ThemeModeToggleButton {
18
+ var displayName: string;
19
+ }
20
+ //#endregion
21
+ export { ThemeModeToggleButton, ThemeModeToggleButtonProps };
@@ -0,0 +1,43 @@
1
+ 'use client';
2
+
3
+
4
+ import { Button, cn } from "@pixpilot/shadcn";
5
+ import { MoonIcon, SunIcon } from "lucide-react";
6
+ import React from "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+
9
+ //#region src/theme-toggle/ThemeModeToggleButton.tsx
10
+ /**
11
+ * Light/Dark toggle button.
12
+ * Pure component - toggles between light and dark.
13
+ */
14
+ function ThemeModeToggleButton(props) {
15
+ const { className, resolvedTheme, setTheme, disabled } = props;
16
+ const toggleTheme = React.useCallback(() => {
17
+ if (resolvedTheme === "dark") {
18
+ setTheme?.("light");
19
+ return;
20
+ }
21
+ setTheme?.("dark");
22
+ }, [resolvedTheme, setTheme]);
23
+ return /* @__PURE__ */ jsxs(Button, {
24
+ variant: "secondary",
25
+ size: "icon",
26
+ className: cn("group/toggle size-8", className),
27
+ onClick: toggleTheme,
28
+ type: "button",
29
+ disabled,
30
+ children: [
31
+ /* @__PURE__ */ jsx(SunIcon, { className: "hidden [html.dark_&]:block" }),
32
+ /* @__PURE__ */ jsx(MoonIcon, { className: "hidden [html.light_&]:block" }),
33
+ /* @__PURE__ */ jsx("span", {
34
+ className: "sr-only",
35
+ children: "Toggle theme"
36
+ })
37
+ ]
38
+ });
39
+ }
40
+ ThemeModeToggleButton.displayName = "ThemeModeToggleButton";
41
+
42
+ //#endregion
43
+ export { ThemeModeToggleButton };
@@ -1,15 +1,13 @@
1
1
  'use client';
2
2
 
3
3
 
4
- const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
4
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
5
5
  let react = require("react");
6
6
  react = require_rolldown_runtime.__toESM(react);
7
7
  let react_jsx_runtime = require("react/jsx-runtime");
8
8
  react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
9
- let next_themes = require("next-themes");
10
- next_themes = require_rolldown_runtime.__toESM(next_themes);
11
9
 
12
- //#region src/ThemeToggle.tsx
10
+ //#region src/theme-toggle/ThemeToggle.tsx
13
11
  function SunIcon() {
14
12
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
15
13
  className: "h-5 w-5",
@@ -55,25 +53,16 @@ function SystemIcon() {
55
53
  })
56
54
  });
57
55
  }
58
- function ThemeToggle() {
59
- const [mounted, setMounted] = (0, react.useState)(false);
60
- const { theme, setTheme } = (0, next_themes.useTheme)();
61
- (0, react.useEffect)(() => {
62
- const timer = setTimeout(() => {
63
- setMounted(true);
64
- }, 0);
65
- return () => {
66
- clearTimeout(timer);
67
- };
68
- }, []);
69
- if (!mounted) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
70
- className: "flex h-9 w-9 items-center justify-center rounded-md border border-gray-200 dark:border-gray-700",
71
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "h-5 w-5 animate-pulse rounded bg-gray-300 dark:bg-gray-600" })
72
- });
56
+ /**
57
+ * Theme toggle button that cycles through light -> dark -> system.
58
+ * Pure component - requires theme and setTheme props.
59
+ */
60
+ function ThemeToggle(props) {
61
+ const { theme, setTheme, disabled } = props;
73
62
  const toggleTheme = () => {
74
- if (theme === "light") setTheme("dark");
75
- else if (theme === "dark") setTheme("system");
76
- else setTheme("light");
63
+ if (theme === "light") setTheme?.("dark");
64
+ else if (theme === "dark") setTheme?.("system");
65
+ else setTheme?.("light");
77
66
  };
78
67
  const getIcon = () => {
79
68
  if (theme === "light") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MoonIcon, {});
@@ -87,9 +76,10 @@ function ThemeToggle() {
87
76
  };
88
77
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
89
78
  onClick: toggleTheme,
90
- className: "flex h-9 w-9 items-center justify-center rounded-md border border-gray-200 bg-white text-gray-900 transition-colors hover:bg-gray-50 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-100 dark:hover:bg-gray-800",
79
+ className: "flex h-9 w-9 items-center justify-center rounded-md border border-gray-200 bg-white text-gray-900 transition-colors hover:bg-gray-50 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-100 dark:hover:bg-gray-800 disabled:cursor-not-allowed disabled:opacity-50",
91
80
  title: getTitle(),
92
81
  type: "button",
82
+ disabled,
93
83
  children: getIcon()
94
84
  });
95
85
  }
@@ -0,0 +1,17 @@
1
+ import * as react_jsx_runtime9 from "react/jsx-runtime";
2
+
3
+ //#region src/theme-toggle/ThemeToggle.d.ts
4
+ interface ThemeToggleProps {
5
+ /** Current theme value ("light" | "dark" | "system") */
6
+ theme?: string;
7
+ /** Function to change the theme */
8
+ setTheme?: (theme: string) => void;
9
+ disabled?: boolean;
10
+ }
11
+ /**
12
+ * Theme toggle button that cycles through light -> dark -> system.
13
+ * Pure component - requires theme and setTheme props.
14
+ */
15
+ declare function ThemeToggle(props: ThemeToggleProps): react_jsx_runtime9.JSX.Element;
16
+ //#endregion
17
+ export { ThemeToggle, ThemeToggleProps };
@@ -0,0 +1,17 @@
1
+ import * as react_jsx_runtime13 from "react/jsx-runtime";
2
+
3
+ //#region src/theme-toggle/ThemeToggle.d.ts
4
+ interface ThemeToggleProps {
5
+ /** Current theme value ("light" | "dark" | "system") */
6
+ theme?: string;
7
+ /** Function to change the theme */
8
+ setTheme?: (theme: string) => void;
9
+ disabled?: boolean;
10
+ }
11
+ /**
12
+ * Theme toggle button that cycles through light -> dark -> system.
13
+ * Pure component - requires theme and setTheme props.
14
+ */
15
+ declare function ThemeToggle(props: ThemeToggleProps): react_jsx_runtime13.JSX.Element;
16
+ //#endregion
17
+ export { ThemeToggle, ThemeToggleProps };