@pixpilot/shadcn-ui 0.26.0 → 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.
- package/dist/ColorSelect.d.ts +2 -2
- package/dist/ContentCard.d.ts +2 -2
- package/dist/DatePicker.d.ts +2 -2
- package/dist/file-upload/FileUpload.d.cts +2 -2
- package/dist/file-upload/FileUpload.d.ts +2 -2
- package/dist/file-upload-inline/FileUploadInline.d.ts +2 -2
- package/dist/index.cjs +10 -1
- package/dist/index.d.cts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +7 -2
- package/dist/input/Input.d.ts +2 -2
- package/dist/theme-provider/index.d.ts +2 -2
- package/dist/theme-provider/index.js +2 -2
- package/dist/theme-toggle/ThemeModeDropdown.cjs +81 -0
- package/dist/theme-toggle/ThemeModeDropdown.d.cts +25 -0
- package/dist/theme-toggle/ThemeModeDropdown.d.ts +25 -0
- package/dist/theme-toggle/ThemeModeDropdown.js +76 -0
- package/dist/theme-toggle/ThemeModeSwitchInside.cjs +86 -0
- package/dist/theme-toggle/ThemeModeSwitchInside.d.cts +33 -0
- package/dist/theme-toggle/ThemeModeSwitchInside.d.ts +33 -0
- package/dist/theme-toggle/ThemeModeSwitchInside.js +82 -0
- package/dist/theme-toggle/ThemeModeSwitchOutside.cjs +68 -0
- package/dist/theme-toggle/ThemeModeSwitchOutside.d.cts +30 -0
- package/dist/theme-toggle/ThemeModeSwitchOutside.d.ts +30 -0
- package/dist/theme-toggle/ThemeModeSwitchOutside.js +63 -0
- package/dist/theme-toggle/ThemeModeToggleButton.cjs +48 -0
- package/dist/theme-toggle/ThemeModeToggleButton.d.cts +21 -0
- package/dist/theme-toggle/ThemeModeToggleButton.d.ts +21 -0
- package/dist/theme-toggle/ThemeModeToggleButton.js +43 -0
- package/dist/{ThemeToggle.cjs → theme-toggle/ThemeToggle.cjs} +13 -23
- package/dist/theme-toggle/ThemeToggle.d.cts +17 -0
- package/dist/theme-toggle/ThemeToggle.d.ts +17 -0
- package/dist/{ThemeToggle.js → theme-toggle/ThemeToggle.js} +13 -22
- package/dist/theme-toggle/index.cjs +5 -0
- package/dist/theme-toggle/index.d.cts +5 -0
- package/dist/theme-toggle/index.d.ts +5 -0
- package/dist/theme-toggle/index.js +5 -0
- package/package.json +2 -2
- package/dist/ThemeToggle.d.cts +0 -6
- package/dist/ThemeToggle.d.ts +0 -6
package/dist/ColorSelect.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Select, SelectContent } from "@pixpilot/shadcn";
|
|
2
2
|
import React, { ComponentProps } from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/ColorSelect.d.ts
|
|
6
6
|
interface ColorSelectOption {
|
|
@@ -15,6 +15,6 @@ type BaseColorSelectProps = {
|
|
|
15
15
|
placeholder?: string;
|
|
16
16
|
keyboardMode?: 'cycle' | 'dropdown';
|
|
17
17
|
} & Omit<ComponentProps<typeof Select>, 'value' | 'onValueChange' | 'children'>;
|
|
18
|
-
declare function ColorSelect(props: BaseColorSelectProps):
|
|
18
|
+
declare function ColorSelect(props: BaseColorSelectProps): react_jsx_runtime2.JSX.Element;
|
|
19
19
|
//#endregion
|
|
20
20
|
export { BaseColorSelectProps, ColorSelect, ColorSelectOption };
|
package/dist/ContentCard.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Card } from "@pixpilot/shadcn";
|
|
2
2
|
import React, { ReactNode } from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/ContentCard.d.ts
|
|
6
6
|
interface SectionCardProps extends React.ComponentProps<typeof Card> {
|
|
@@ -8,7 +8,7 @@ interface SectionCardProps extends React.ComponentProps<typeof Card> {
|
|
|
8
8
|
children: ReactNode;
|
|
9
9
|
marginBottom?: boolean;
|
|
10
10
|
}
|
|
11
|
-
declare function ContentCard(props: SectionCardProps):
|
|
11
|
+
declare function ContentCard(props: SectionCardProps): react_jsx_runtime3.JSX.Element;
|
|
12
12
|
declare namespace ContentCard {
|
|
13
13
|
var displayName: string;
|
|
14
14
|
}
|
package/dist/DatePicker.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Calendar } from "@pixpilot/shadcn";
|
|
2
2
|
import { ComponentProps } from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/DatePicker.d.ts
|
|
6
6
|
type DatePickerProps = {
|
|
@@ -8,7 +8,7 @@ type DatePickerProps = {
|
|
|
8
8
|
onChange?: (date: Date | undefined) => void;
|
|
9
9
|
placeholder?: string;
|
|
10
10
|
} & Omit<ComponentProps<typeof Calendar>, 'selected' | 'onSelect' | 'mode'>;
|
|
11
|
-
declare function DatePicker(props: DatePickerProps):
|
|
11
|
+
declare function DatePicker(props: DatePickerProps): react_jsx_runtime1.JSX.Element;
|
|
12
12
|
declare namespace DatePicker {
|
|
13
13
|
var displayName: string;
|
|
14
14
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FileUploadProps } from "./types/index.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime6 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/file-upload/FileUpload.d.ts
|
|
5
|
-
declare function FileUpload(props: FileUploadProps):
|
|
5
|
+
declare function FileUpload(props: FileUploadProps): react_jsx_runtime6.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { FileUpload };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FileUploadProps } from "./types/index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime6 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/file-upload/FileUpload.d.ts
|
|
5
|
-
declare function FileUpload(props: FileUploadProps):
|
|
5
|
+
declare function FileUpload(props: FileUploadProps): react_jsx_runtime6.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { FileUpload };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { FileUploadInlineProps } from "./types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime7 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):
|
|
8
|
+
declare function FileUploadInline(props: FileUploadInlineProps): react_jsx_runtime7.JSX.Element;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { FileUploadInline };
|
package/dist/index.cjs
CHANGED
|
@@ -53,7 +53,12 @@ require('./tabs/index.cjs');
|
|
|
53
53
|
const require_tags_input = require('./tags-input.cjs');
|
|
54
54
|
const require_ThemeProvider = require('./theme-provider/ThemeProvider.cjs');
|
|
55
55
|
require('./theme-provider/index.cjs');
|
|
56
|
-
const
|
|
56
|
+
const require_ThemeModeDropdown = require('./theme-toggle/ThemeModeDropdown.cjs');
|
|
57
|
+
const require_ThemeModeSwitchInside = require('./theme-toggle/ThemeModeSwitchInside.cjs');
|
|
58
|
+
const require_ThemeModeSwitchOutside = require('./theme-toggle/ThemeModeSwitchOutside.cjs');
|
|
59
|
+
const require_ThemeModeToggleButton = require('./theme-toggle/ThemeModeToggleButton.cjs');
|
|
60
|
+
const require_ThemeToggle = require('./theme-toggle/ThemeToggle.cjs');
|
|
61
|
+
require('./theme-toggle/index.cjs');
|
|
57
62
|
const require_toast = require('./toast/toast.cjs');
|
|
58
63
|
require('./toast/index.cjs');
|
|
59
64
|
let __pixpilot_shadcn = require("@pixpilot/shadcn");
|
|
@@ -98,6 +103,10 @@ exports.TabsContext = require_TabsContext.TabsContext;
|
|
|
98
103
|
exports.TabsList = require_TabsList.TabsList;
|
|
99
104
|
exports.TabsTrigger = require_TabsTrigger.TabsTrigger;
|
|
100
105
|
exports.TagsInput = require_tags_input.TagsInput;
|
|
106
|
+
exports.ThemeModeDropdown = require_ThemeModeDropdown.ThemeModeDropdown;
|
|
107
|
+
exports.ThemeModeSwitchInside = require_ThemeModeSwitchInside.ThemeModeSwitchInside;
|
|
108
|
+
exports.ThemeModeSwitchOutside = require_ThemeModeSwitchOutside.ThemeModeSwitchOutside;
|
|
109
|
+
exports.ThemeModeToggleButton = require_ThemeModeToggleButton.ThemeModeToggleButton;
|
|
101
110
|
exports.ThemeProvider = require_ThemeProvider.ThemeProvider;
|
|
102
111
|
exports.ThemeToggle = require_ThemeToggle.ThemeToggle;
|
|
103
112
|
exports.cn = __pixpilot_shadcn.cn;
|
package/dist/index.d.cts
CHANGED
|
@@ -58,8 +58,13 @@ import "./tabs/index.cjs";
|
|
|
58
58
|
import { TagsInput, TagsInputProps } from "./tags-input.cjs";
|
|
59
59
|
import { ThemeProvider, ThemeProviderProps } from "./theme-provider/ThemeProvider.cjs";
|
|
60
60
|
import { useTheme } from "./theme-provider/index.cjs";
|
|
61
|
-
import {
|
|
61
|
+
import { ThemeModeDropdown, ThemeModeDropdownProps } from "./theme-toggle/ThemeModeDropdown.cjs";
|
|
62
|
+
import { ThemeModeSwitchInside, ThemeModeSwitchInsideProps, ThemeModeSwitchInsideSize } from "./theme-toggle/ThemeModeSwitchInside.cjs";
|
|
63
|
+
import { ThemeModeSwitchOutside, ThemeModeSwitchOutsideProps } from "./theme-toggle/ThemeModeSwitchOutside.cjs";
|
|
64
|
+
import { ThemeModeToggleButton, ThemeModeToggleButtonProps } from "./theme-toggle/ThemeModeToggleButton.cjs";
|
|
65
|
+
import { ThemeToggle, ThemeToggleProps } from "./theme-toggle/ThemeToggle.cjs";
|
|
66
|
+
import "./theme-toggle/index.cjs";
|
|
62
67
|
import { DEFAULT_ALERT_DURATION, ToastMessage, toast, toastError, toastInfo, toastSuccess, toastWarning } from "./toast/toast.cjs";
|
|
63
68
|
import "./toast/index.cjs";
|
|
64
69
|
import { cn } from "@pixpilot/shadcn";
|
|
65
|
-
export { AbsoluteFill, Alert, AlertBaseProps, AlertProps, AlertVariant, AvatarUpload, AvatarUploadProps, BaseTabsTriggerProps, Button, ButtonLoaderProps, ButtonProps, CircleLoader, CircleLoaderProps, CloseButtonAbsolute, CloseButtonRounded, CloseButtonRoundedProps, ColorPicker, ColorPickerBase, ColorPickerBaseProps, ColorPickerBaseSection, ColorPickerProps, ColorSelect, ColorSelectOption, BaseColorSelectProps as ColorSelectProps, Combobox, ConfirmationDialogProps, ContentCard, DEFAULT_ALERT_DURATION, DatePicker, DatePickerProps, DialogProvider, DialogProviderProps, type FileMetadata, FileUpload, FileUploadBaseProps, FileUploadInline, FileUploadInlineBaseProps, FileUploadInlineProps, type FileUploadProgressCallBacks, type FileUploadProps, IconPicker, IconPickerProps, IconPickerVariant, IconProvider, IconProviderLoader, IconProviderProps, Input, InputProps, Layout, LayoutFooter, LayoutFooterProps, LayoutHeader, LayoutHeaderProps, LayoutMain, LayoutMainProps, LayoutProps, LoaderProps, LoadingOverlay, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, Pagination, PaginationProps, PopoverCloseButtonProps, PresetColor, RichTextEditor, RichTextEditorProps, ScaledPreview, ScaledPreviewProps, ScaledPreviewSize, Select, SelectOption, SingleFileUploadProps, Slider, SliderInput, SliderInputProps, SliderProps, SliderSelect, SliderSelectOption, SliderSelectProps, SliderSelectValue, Tabs, TabsContent, TabsContext, TabsContextValue, TabsList, TabsListProps, TabsTrigger, TabsTriggerProps, TabsVariant, TagsInput, TagsInputProps, ThemeProvider, ThemeProviderProps, ThemeToggle, ToastMessage, ToolbarOption, cn, showConfirmDialog, toast, toastError, toastInfo, toastSuccess, toastWarning, useMediaQuery, useSelectKeyboard, useTabsContext, useTheme };
|
|
70
|
+
export { AbsoluteFill, Alert, AlertBaseProps, AlertProps, AlertVariant, AvatarUpload, AvatarUploadProps, BaseTabsTriggerProps, Button, ButtonLoaderProps, ButtonProps, CircleLoader, CircleLoaderProps, CloseButtonAbsolute, CloseButtonRounded, CloseButtonRoundedProps, ColorPicker, ColorPickerBase, ColorPickerBaseProps, ColorPickerBaseSection, ColorPickerProps, ColorSelect, ColorSelectOption, BaseColorSelectProps as ColorSelectProps, Combobox, ConfirmationDialogProps, ContentCard, DEFAULT_ALERT_DURATION, DatePicker, DatePickerProps, DialogProvider, DialogProviderProps, type FileMetadata, FileUpload, FileUploadBaseProps, FileUploadInline, FileUploadInlineBaseProps, FileUploadInlineProps, type FileUploadProgressCallBacks, type FileUploadProps, IconPicker, IconPickerProps, IconPickerVariant, IconProvider, IconProviderLoader, IconProviderProps, Input, InputProps, Layout, LayoutFooter, LayoutFooterProps, LayoutHeader, LayoutHeaderProps, LayoutMain, LayoutMainProps, LayoutProps, LoaderProps, LoadingOverlay, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, Pagination, PaginationProps, PopoverCloseButtonProps, PresetColor, RichTextEditor, RichTextEditorProps, ScaledPreview, ScaledPreviewProps, ScaledPreviewSize, Select, SelectOption, SingleFileUploadProps, Slider, SliderInput, SliderInputProps, SliderProps, SliderSelect, SliderSelectOption, SliderSelectProps, SliderSelectValue, Tabs, TabsContent, TabsContext, TabsContextValue, TabsList, TabsListProps, TabsTrigger, TabsTriggerProps, TabsVariant, TagsInput, TagsInputProps, ThemeModeDropdown, ThemeModeDropdownProps, ThemeModeSwitchInside, ThemeModeSwitchInsideProps, ThemeModeSwitchInsideSize, ThemeModeSwitchOutside, ThemeModeSwitchOutsideProps, ThemeModeToggleButton, ThemeModeToggleButtonProps, ThemeProvider, ThemeProviderProps, ThemeToggle, ThemeToggleProps, ToastMessage, ToolbarOption, cn, showConfirmDialog, toast, toastError, toastInfo, toastSuccess, toastWarning, useMediaQuery, useSelectKeyboard, useTabsContext, useTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -60,8 +60,13 @@ import "./tabs/index.js";
|
|
|
60
60
|
import { TagsInput, TagsInputProps } from "./tags-input.js";
|
|
61
61
|
import { ThemeProvider, ThemeProviderProps } from "./theme-provider/ThemeProvider.js";
|
|
62
62
|
import { useTheme } from "./theme-provider/index.js";
|
|
63
|
-
import {
|
|
63
|
+
import { ThemeModeDropdown, ThemeModeDropdownProps } from "./theme-toggle/ThemeModeDropdown.js";
|
|
64
|
+
import { ThemeModeSwitchInside, ThemeModeSwitchInsideProps, ThemeModeSwitchInsideSize } from "./theme-toggle/ThemeModeSwitchInside.js";
|
|
65
|
+
import { ThemeModeSwitchOutside, ThemeModeSwitchOutsideProps } from "./theme-toggle/ThemeModeSwitchOutside.js";
|
|
66
|
+
import { ThemeModeToggleButton, ThemeModeToggleButtonProps } from "./theme-toggle/ThemeModeToggleButton.js";
|
|
67
|
+
import { ThemeToggle, ThemeToggleProps } from "./theme-toggle/ThemeToggle.js";
|
|
68
|
+
import "./theme-toggle/index.js";
|
|
64
69
|
import { DEFAULT_ALERT_DURATION, ToastMessage, toast, toastError, toastInfo, toastSuccess, toastWarning } from "./toast/toast.js";
|
|
65
70
|
import "./toast/index.js";
|
|
66
71
|
import { cn } from "@pixpilot/shadcn";
|
|
67
|
-
export { AbsoluteFill, Alert, AlertBaseProps, AlertProps, AlertVariant, AvatarUpload, AvatarUploadProps, BaseTabsTriggerProps, Button, ButtonLoaderProps, ButtonProps, CircleLoader, CircleLoaderProps, CloseButtonAbsolute, CloseButtonRounded, CloseButtonRoundedProps, ColorPicker, ColorPickerBase, ColorPickerBaseProps, ColorPickerBaseSection, ColorPickerProps, ColorSelect, ColorSelectOption, BaseColorSelectProps as ColorSelectProps, Combobox, ConfirmationDialogProps, ContentCard, DEFAULT_ALERT_DURATION, DatePicker, DatePickerProps, DialogProvider, DialogProviderProps, type FileMetadata, FileUpload, FileUploadBaseProps, FileUploadInline, FileUploadInlineBaseProps, FileUploadInlineProps, type FileUploadProgressCallBacks, type FileUploadProps, IconPicker, IconPickerProps, IconPickerVariant, IconProvider, IconProviderLoader, IconProviderProps, Input, InputProps, Layout, LayoutFooter, LayoutFooterProps, LayoutHeader, LayoutHeaderProps, LayoutMain, LayoutMainProps, LayoutProps, LoaderProps, LoadingOverlay, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, Pagination, PaginationProps, PopoverCloseButtonProps, PresetColor, RichTextEditor, RichTextEditorProps, ScaledPreview, ScaledPreviewProps, ScaledPreviewSize, Select, SelectOption, SingleFileUploadProps, Slider, SliderInput, SliderInputProps, SliderProps, SliderSelect, SliderSelectOption, SliderSelectProps, SliderSelectValue, Tabs, TabsContent, TabsContext, TabsContextValue, TabsList, TabsListProps, TabsTrigger, TabsTriggerProps, TabsVariant, TagsInput, TagsInputProps, ThemeProvider, ThemeProviderProps, ThemeToggle, ToastMessage, ToolbarOption, cn, showConfirmDialog, toast, toastError, toastInfo, toastSuccess, toastWarning, useMediaQuery, useSelectKeyboard, useTabsContext, useTheme };
|
|
72
|
+
export { AbsoluteFill, Alert, AlertBaseProps, AlertProps, AlertVariant, AvatarUpload, AvatarUploadProps, BaseTabsTriggerProps, Button, ButtonLoaderProps, ButtonProps, CircleLoader, CircleLoaderProps, CloseButtonAbsolute, CloseButtonRounded, CloseButtonRoundedProps, ColorPicker, ColorPickerBase, ColorPickerBaseProps, ColorPickerBaseSection, ColorPickerProps, ColorSelect, ColorSelectOption, BaseColorSelectProps as ColorSelectProps, Combobox, ConfirmationDialogProps, ContentCard, DEFAULT_ALERT_DURATION, DatePicker, DatePickerProps, DialogProvider, DialogProviderProps, type FileMetadata, FileUpload, FileUploadBaseProps, FileUploadInline, FileUploadInlineBaseProps, FileUploadInlineProps, type FileUploadProgressCallBacks, type FileUploadProps, IconPicker, IconPickerProps, IconPickerVariant, IconProvider, IconProviderLoader, IconProviderProps, Input, InputProps, Layout, LayoutFooter, LayoutFooterProps, LayoutHeader, LayoutHeaderProps, LayoutMain, LayoutMainProps, LayoutProps, LoaderProps, LoadingOverlay, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, Pagination, PaginationProps, PopoverCloseButtonProps, PresetColor, RichTextEditor, RichTextEditorProps, ScaledPreview, ScaledPreviewProps, ScaledPreviewSize, Select, SelectOption, SingleFileUploadProps, Slider, SliderInput, SliderInputProps, SliderProps, SliderSelect, SliderSelectOption, SliderSelectProps, SliderSelectValue, Tabs, TabsContent, TabsContext, TabsContextValue, TabsList, TabsListProps, TabsTrigger, TabsTriggerProps, TabsVariant, TagsInput, TagsInputProps, ThemeModeDropdown, ThemeModeDropdownProps, ThemeModeSwitchInside, ThemeModeSwitchInsideProps, ThemeModeSwitchInsideSize, ThemeModeSwitchOutside, ThemeModeSwitchOutsideProps, ThemeModeToggleButton, ThemeModeToggleButtonProps, ThemeProvider, ThemeProviderProps, ThemeToggle, ThemeToggleProps, ToastMessage, ToolbarOption, cn, showConfirmDialog, toast, toastError, toastInfo, toastSuccess, toastWarning, useMediaQuery, useSelectKeyboard, useTabsContext, useTheme };
|
package/dist/index.js
CHANGED
|
@@ -54,9 +54,14 @@ import "./tabs/index.js";
|
|
|
54
54
|
import { TagsInput } from "./tags-input.js";
|
|
55
55
|
import { ThemeProvider } from "./theme-provider/ThemeProvider.js";
|
|
56
56
|
import { useTheme } from "./theme-provider/index.js";
|
|
57
|
-
import {
|
|
57
|
+
import { ThemeModeDropdown } from "./theme-toggle/ThemeModeDropdown.js";
|
|
58
|
+
import { ThemeModeSwitchInside } from "./theme-toggle/ThemeModeSwitchInside.js";
|
|
59
|
+
import { ThemeModeSwitchOutside } from "./theme-toggle/ThemeModeSwitchOutside.js";
|
|
60
|
+
import { ThemeModeToggleButton } from "./theme-toggle/ThemeModeToggleButton.js";
|
|
61
|
+
import { ThemeToggle } from "./theme-toggle/ThemeToggle.js";
|
|
62
|
+
import "./theme-toggle/index.js";
|
|
58
63
|
import { DEFAULT_ALERT_DURATION, toast, toastError, toastInfo, toastSuccess, toastWarning } from "./toast/toast.js";
|
|
59
64
|
import "./toast/index.js";
|
|
60
65
|
import { cn } from "@pixpilot/shadcn";
|
|
61
66
|
|
|
62
|
-
export { AbsoluteFill, Alert, AvatarUpload, Button, CircleLoader, CloseButtonAbsolute, CloseButtonRounded, ColorPicker, ColorPickerBase, ColorSelect, Combobox, ContentCard, DEFAULT_ALERT_DURATION, DatePicker, DialogProvider, FileUpload, FileUploadInline, IconPicker, Input, Layout, LayoutFooter, LayoutHeader, LayoutMain, LoadingOverlay, Pagination, RichTextEditor, ScaledPreview, Select, Slider, SliderInput, SliderSelect, Tabs, TabsContent, TabsContext, TabsList, TabsTrigger, TagsInput, ThemeProvider, ThemeToggle, cn, showConfirmDialog, toast, toastError, toastInfo, toastSuccess, toastWarning, useMediaQuery, useSelectKeyboard, useTabsContext, useTheme };
|
|
67
|
+
export { AbsoluteFill, Alert, AvatarUpload, Button, CircleLoader, CloseButtonAbsolute, CloseButtonRounded, ColorPicker, ColorPickerBase, ColorSelect, Combobox, ContentCard, DEFAULT_ALERT_DURATION, DatePicker, DialogProvider, FileUpload, FileUploadInline, IconPicker, Input, Layout, LayoutFooter, LayoutHeader, LayoutMain, LoadingOverlay, Pagination, RichTextEditor, ScaledPreview, Select, Slider, SliderInput, SliderSelect, Tabs, TabsContent, TabsContext, TabsList, TabsTrigger, TagsInput, ThemeModeDropdown, ThemeModeSwitchInside, ThemeModeSwitchOutside, ThemeModeToggleButton, ThemeProvider, ThemeToggle, cn, showConfirmDialog, toast, toastError, toastInfo, toastSuccess, toastWarning, useMediaQuery, useSelectKeyboard, useTabsContext, useTheme };
|
package/dist/input/Input.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InputProps } from "@pixpilot/shadcn";
|
|
2
2
|
import * as React$1 from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime8 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):
|
|
13
|
+
declare function Input$1(props: InputProps$1): react_jsx_runtime8.JSX.Element;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { Input$1 as Input, InputProps$1 as InputProps };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ThemeProvider as ThemeProvider$1, ThemeProviderProps } from "./ThemeProvider.js";
|
|
2
|
-
import { useTheme
|
|
3
|
-
export { useTheme
|
|
2
|
+
import { useTheme } from "next-themes";
|
|
3
|
+
export { useTheme };
|
|
@@ -0,0 +1,81 @@
|
|
|
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/ThemeModeDropdown.tsx
|
|
15
|
+
/**
|
|
16
|
+
* Theme mode selector dropdown.
|
|
17
|
+
* Provides Light / Dark / System options.
|
|
18
|
+
* Pure component - requires theme and setTheme props.
|
|
19
|
+
*/
|
|
20
|
+
function ThemeModeDropdown(props) {
|
|
21
|
+
const { align = "end", className, theme, setTheme, resolvedTheme, disabled } = props;
|
|
22
|
+
const isDark = resolvedTheme === "dark";
|
|
23
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.DropdownMenu, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.DropdownMenuTrigger, {
|
|
24
|
+
asChild: true,
|
|
25
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.Button, {
|
|
26
|
+
variant: "outline",
|
|
27
|
+
size: "icon",
|
|
28
|
+
className: (0, __pixpilot_shadcn.cn)(className),
|
|
29
|
+
disabled,
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Sun, { className: (0, __pixpilot_shadcn.cn)("h-[1.2rem] w-[1.2rem] transition-all", isDark ? "scale-0 -rotate-90" : "scale-100 rotate-0") }),
|
|
32
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Moon, { className: (0, __pixpilot_shadcn.cn)("absolute h-[1.2rem] w-[1.2rem] transition-all", isDark ? "scale-100 rotate-0" : "scale-0 rotate-90") }),
|
|
33
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
34
|
+
className: "sr-only",
|
|
35
|
+
children: "Toggle theme"
|
|
36
|
+
})
|
|
37
|
+
]
|
|
38
|
+
})
|
|
39
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.DropdownMenuContent, {
|
|
40
|
+
align,
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.DropdownMenuItem, {
|
|
43
|
+
onClick: () => setTheme?.("light"),
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Sun, { className: "h-4 w-4 mr-2" }),
|
|
46
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
47
|
+
className: "flex-1",
|
|
48
|
+
children: "Light"
|
|
49
|
+
}),
|
|
50
|
+
theme === "light" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "h-4 w-4 ml-2" })
|
|
51
|
+
]
|
|
52
|
+
}),
|
|
53
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.DropdownMenuItem, {
|
|
54
|
+
onClick: () => setTheme?.("dark"),
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Moon, { className: "h-4 w-4 mr-2" }),
|
|
57
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
58
|
+
className: "flex-1",
|
|
59
|
+
children: "Dark"
|
|
60
|
+
}),
|
|
61
|
+
theme === "dark" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "h-4 w-4 ml-2" })
|
|
62
|
+
]
|
|
63
|
+
}),
|
|
64
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.DropdownMenuItem, {
|
|
65
|
+
onClick: () => setTheme?.("system"),
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Monitor, { className: "h-4 w-4 mr-2" }),
|
|
68
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
69
|
+
className: "flex-1",
|
|
70
|
+
children: "System"
|
|
71
|
+
}),
|
|
72
|
+
theme === "system" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "h-4 w-4 ml-2" })
|
|
73
|
+
]
|
|
74
|
+
})
|
|
75
|
+
]
|
|
76
|
+
})] });
|
|
77
|
+
}
|
|
78
|
+
ThemeModeDropdown.displayName = "ThemeModeDropdown";
|
|
79
|
+
|
|
80
|
+
//#endregion
|
|
81
|
+
exports.ThemeModeDropdown = ThemeModeDropdown;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as react_jsx_runtime10 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/theme-toggle/ThemeModeDropdown.d.ts
|
|
4
|
+
interface ThemeModeDropdownProps {
|
|
5
|
+
align?: 'start' | 'center' | 'end';
|
|
6
|
+
className?: string;
|
|
7
|
+
/** Current theme value ("light" | "dark" | "system") */
|
|
8
|
+
theme?: string;
|
|
9
|
+
/** Function to change the theme */
|
|
10
|
+
setTheme?: (theme: string) => void;
|
|
11
|
+
/** The resolved theme ("light" | "dark") */
|
|
12
|
+
resolvedTheme?: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Theme mode selector dropdown.
|
|
17
|
+
* Provides Light / Dark / System options.
|
|
18
|
+
* Pure component - requires theme and setTheme props.
|
|
19
|
+
*/
|
|
20
|
+
declare function ThemeModeDropdown(props: ThemeModeDropdownProps): react_jsx_runtime10.JSX.Element;
|
|
21
|
+
declare namespace ThemeModeDropdown {
|
|
22
|
+
var displayName: string;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { ThemeModeDropdown, ThemeModeDropdownProps };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as react_jsx_runtime9 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/theme-toggle/ThemeModeDropdown.d.ts
|
|
4
|
+
interface ThemeModeDropdownProps {
|
|
5
|
+
align?: 'start' | 'center' | 'end';
|
|
6
|
+
className?: string;
|
|
7
|
+
/** Current theme value ("light" | "dark" | "system") */
|
|
8
|
+
theme?: string;
|
|
9
|
+
/** Function to change the theme */
|
|
10
|
+
setTheme?: (theme: string) => void;
|
|
11
|
+
/** The resolved theme ("light" | "dark") */
|
|
12
|
+
resolvedTheme?: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Theme mode selector dropdown.
|
|
17
|
+
* Provides Light / Dark / System options.
|
|
18
|
+
* Pure component - requires theme and setTheme props.
|
|
19
|
+
*/
|
|
20
|
+
declare function ThemeModeDropdown(props: ThemeModeDropdownProps): react_jsx_runtime9.JSX.Element;
|
|
21
|
+
declare namespace ThemeModeDropdown {
|
|
22
|
+
var displayName: string;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { ThemeModeDropdown, ThemeModeDropdownProps };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import { Button, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, cn } from "@pixpilot/shadcn";
|
|
5
|
+
import { Check, Monitor, Moon, Sun } from "lucide-react";
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
//#region src/theme-toggle/ThemeModeDropdown.tsx
|
|
10
|
+
/**
|
|
11
|
+
* Theme mode selector dropdown.
|
|
12
|
+
* Provides Light / Dark / System options.
|
|
13
|
+
* Pure component - requires theme and setTheme props.
|
|
14
|
+
*/
|
|
15
|
+
function ThemeModeDropdown(props) {
|
|
16
|
+
const { align = "end", className, theme, setTheme, resolvedTheme, disabled } = props;
|
|
17
|
+
const isDark = resolvedTheme === "dark";
|
|
18
|
+
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
19
|
+
asChild: true,
|
|
20
|
+
children: /* @__PURE__ */ jsxs(Button, {
|
|
21
|
+
variant: "outline",
|
|
22
|
+
size: "icon",
|
|
23
|
+
className: cn(className),
|
|
24
|
+
disabled,
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ jsx(Sun, { className: cn("h-[1.2rem] w-[1.2rem] transition-all", isDark ? "scale-0 -rotate-90" : "scale-100 rotate-0") }),
|
|
27
|
+
/* @__PURE__ */ jsx(Moon, { className: cn("absolute h-[1.2rem] w-[1.2rem] transition-all", isDark ? "scale-100 rotate-0" : "scale-0 rotate-90") }),
|
|
28
|
+
/* @__PURE__ */ jsx("span", {
|
|
29
|
+
className: "sr-only",
|
|
30
|
+
children: "Toggle theme"
|
|
31
|
+
})
|
|
32
|
+
]
|
|
33
|
+
})
|
|
34
|
+
}), /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
35
|
+
align,
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
38
|
+
onClick: () => setTheme?.("light"),
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ jsx(Sun, { className: "h-4 w-4 mr-2" }),
|
|
41
|
+
/* @__PURE__ */ jsx("span", {
|
|
42
|
+
className: "flex-1",
|
|
43
|
+
children: "Light"
|
|
44
|
+
}),
|
|
45
|
+
theme === "light" && /* @__PURE__ */ jsx(Check, { className: "h-4 w-4 ml-2" })
|
|
46
|
+
]
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
49
|
+
onClick: () => setTheme?.("dark"),
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ jsx(Moon, { className: "h-4 w-4 mr-2" }),
|
|
52
|
+
/* @__PURE__ */ jsx("span", {
|
|
53
|
+
className: "flex-1",
|
|
54
|
+
children: "Dark"
|
|
55
|
+
}),
|
|
56
|
+
theme === "dark" && /* @__PURE__ */ jsx(Check, { className: "h-4 w-4 ml-2" })
|
|
57
|
+
]
|
|
58
|
+
}),
|
|
59
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
60
|
+
onClick: () => setTheme?.("system"),
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ jsx(Monitor, { className: "h-4 w-4 mr-2" }),
|
|
63
|
+
/* @__PURE__ */ jsx("span", {
|
|
64
|
+
className: "flex-1",
|
|
65
|
+
children: "System"
|
|
66
|
+
}),
|
|
67
|
+
theme === "system" && /* @__PURE__ */ jsx(Check, { className: "h-4 w-4 ml-2" })
|
|
68
|
+
]
|
|
69
|
+
})
|
|
70
|
+
]
|
|
71
|
+
})] });
|
|
72
|
+
}
|
|
73
|
+
ThemeModeDropdown.displayName = "ThemeModeDropdown";
|
|
74
|
+
|
|
75
|
+
//#endregion
|
|
76
|
+
export { ThemeModeDropdown };
|
|
@@ -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('
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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 };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
import React
|
|
4
|
+
import React from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import { useTheme } from "next-themes";
|
|
7
6
|
|
|
8
|
-
//#region src/ThemeToggle.tsx
|
|
7
|
+
//#region src/theme-toggle/ThemeToggle.tsx
|
|
9
8
|
function SunIcon() {
|
|
10
9
|
return /* @__PURE__ */ jsx("svg", {
|
|
11
10
|
className: "h-5 w-5",
|
|
@@ -51,25 +50,16 @@ function SystemIcon() {
|
|
|
51
50
|
})
|
|
52
51
|
});
|
|
53
52
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}, 0);
|
|
61
|
-
return () => {
|
|
62
|
-
clearTimeout(timer);
|
|
63
|
-
};
|
|
64
|
-
}, []);
|
|
65
|
-
if (!mounted) return /* @__PURE__ */ jsx("div", {
|
|
66
|
-
className: "flex h-9 w-9 items-center justify-center rounded-md border border-gray-200 dark:border-gray-700",
|
|
67
|
-
children: /* @__PURE__ */ jsx("div", { className: "h-5 w-5 animate-pulse rounded bg-gray-300 dark:bg-gray-600" })
|
|
68
|
-
});
|
|
53
|
+
/**
|
|
54
|
+
* Theme toggle button that cycles through light -> dark -> system.
|
|
55
|
+
* Pure component - requires theme and setTheme props.
|
|
56
|
+
*/
|
|
57
|
+
function ThemeToggle(props) {
|
|
58
|
+
const { theme, setTheme, disabled } = props;
|
|
69
59
|
const toggleTheme = () => {
|
|
70
|
-
if (theme === "light") setTheme("dark");
|
|
71
|
-
else if (theme === "dark") setTheme("system");
|
|
72
|
-
else setTheme("light");
|
|
60
|
+
if (theme === "light") setTheme?.("dark");
|
|
61
|
+
else if (theme === "dark") setTheme?.("system");
|
|
62
|
+
else setTheme?.("light");
|
|
73
63
|
};
|
|
74
64
|
const getIcon = () => {
|
|
75
65
|
if (theme === "light") return /* @__PURE__ */ jsx(MoonIcon, {});
|
|
@@ -83,9 +73,10 @@ function ThemeToggle() {
|
|
|
83
73
|
};
|
|
84
74
|
return /* @__PURE__ */ jsx("button", {
|
|
85
75
|
onClick: toggleTheme,
|
|
86
|
-
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",
|
|
76
|
+
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",
|
|
87
77
|
title: getTitle(),
|
|
88
78
|
type: "button",
|
|
79
|
+
disabled,
|
|
89
80
|
children: getIcon()
|
|
90
81
|
});
|
|
91
82
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
const require_ThemeModeDropdown = require('./ThemeModeDropdown.cjs');
|
|
2
|
+
const require_ThemeModeSwitchInside = require('./ThemeModeSwitchInside.cjs');
|
|
3
|
+
const require_ThemeModeSwitchOutside = require('./ThemeModeSwitchOutside.cjs');
|
|
4
|
+
const require_ThemeModeToggleButton = require('./ThemeModeToggleButton.cjs');
|
|
5
|
+
const require_ThemeToggle = require('./ThemeToggle.cjs');
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ThemeModeDropdown, ThemeModeDropdownProps } from "./ThemeModeDropdown.cjs";
|
|
2
|
+
import { ThemeModeSwitchInside, ThemeModeSwitchInsideProps, ThemeModeSwitchInsideSize } from "./ThemeModeSwitchInside.cjs";
|
|
3
|
+
import { ThemeModeSwitchOutside, ThemeModeSwitchOutsideProps } from "./ThemeModeSwitchOutside.cjs";
|
|
4
|
+
import { ThemeModeToggleButton, ThemeModeToggleButtonProps } from "./ThemeModeToggleButton.cjs";
|
|
5
|
+
import { ThemeToggle, ThemeToggleProps } from "./ThemeToggle.cjs";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ThemeModeDropdown, ThemeModeDropdownProps } from "./ThemeModeDropdown.js";
|
|
2
|
+
import { ThemeModeSwitchInside, ThemeModeSwitchInsideProps, ThemeModeSwitchInsideSize } from "./ThemeModeSwitchInside.js";
|
|
3
|
+
import { ThemeModeSwitchOutside, ThemeModeSwitchOutsideProps } from "./ThemeModeSwitchOutside.js";
|
|
4
|
+
import { ThemeModeToggleButton, ThemeModeToggleButtonProps } from "./ThemeModeToggleButton.js";
|
|
5
|
+
import { ThemeToggle, ThemeToggleProps } from "./ThemeToggle.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ThemeModeDropdown } from "./ThemeModeDropdown.js";
|
|
2
|
+
import { ThemeModeSwitchInside } from "./ThemeModeSwitchInside.js";
|
|
3
|
+
import { ThemeModeSwitchOutside } from "./ThemeModeSwitchOutside.js";
|
|
4
|
+
import { ThemeModeToggleButton } from "./ThemeModeToggleButton.js";
|
|
5
|
+
import { ThemeToggle } from "./ThemeToggle.js";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixpilot/shadcn-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.27.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",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"@internal/eslint-config": "0.3.0",
|
|
61
61
|
"@internal/hooks": "0.0.0",
|
|
62
62
|
"@internal/prettier-config": "0.0.1",
|
|
63
|
-
"@internal/tsdown-config": "0.1.0",
|
|
64
63
|
"@internal/tsconfig": "0.1.0",
|
|
64
|
+
"@internal/tsdown-config": "0.1.0",
|
|
65
65
|
"@internal/vitest-config": "0.1.0"
|
|
66
66
|
},
|
|
67
67
|
"prettier": "@internal/prettier-config",
|
package/dist/ThemeToggle.d.cts
DELETED