@pixpilot/shadcn-ui 1.22.0 → 1.24.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/ColorPicker/ColorPicker.cjs +4 -1
- package/dist/ColorPicker/ColorPicker.js +4 -1
- package/dist/ColorPickerBase/ColorPickerBase.cjs +5 -2
- package/dist/ColorPickerBase/ColorPickerBase.js +5 -2
- package/dist/ColorPickerBase/ColorPickerButton.cjs +6 -2
- package/dist/ColorPickerBase/ColorPickerButton.js +6 -2
- package/dist/ColorPickerBase/ColorPickerCompactControls.cjs +5 -3
- package/dist/ColorPickerBase/ColorPickerCompactControls.js +5 -3
- package/dist/ColorPickerBase/ColorPickerControls.cjs +14 -3
- package/dist/ColorPickerBase/ColorPickerControls.js +14 -3
- package/dist/ColorPickerBase/ColorPickerFormatControls.cjs +3 -2
- package/dist/ColorPickerBase/ColorPickerFormatControls.js +3 -2
- package/dist/ColorPickerBase/ColorPickerFullControls.cjs +8 -4
- package/dist/ColorPickerBase/ColorPickerFullControls.js +8 -4
- package/dist/ColorPickerBase/ColorPickerInput.cjs +6 -2
- package/dist/ColorPickerBase/ColorPickerInput.js +6 -2
- package/dist/ColorPickerBase/ColorPickerRoot.cjs +2 -1
- package/dist/ColorPickerBase/ColorPickerRoot.js +2 -1
- package/dist/ColorPickerBase/color-palette/ColorPalette.cjs +8 -2
- package/dist/ColorPickerBase/color-palette/ColorPalette.js +8 -2
- package/dist/ColorPickerBase/color-palette/PaletteSwatch.cjs +2 -1
- package/dist/ColorPickerBase/color-palette/PaletteSwatch.d.cts +1 -0
- package/dist/ColorPickerBase/color-palette/PaletteSwatch.d.ts +1 -0
- package/dist/ColorPickerBase/color-palette/PaletteSwatch.js +2 -1
- package/dist/ColorPickerBase/color-picker-context.d.cts +1 -0
- package/dist/ColorPickerBase/color-picker-context.d.ts +1 -0
- package/dist/ColorPickerBase/types.d.cts +2 -0
- package/dist/ColorPickerBase/types.d.ts +2 -0
- package/dist/ColorSelect.cjs +4 -1
- package/dist/ColorSelect.d.cts +1 -0
- package/dist/ColorSelect.d.ts +1 -0
- package/dist/ColorSelect.js +4 -1
- package/dist/Combobox.cjs +8 -2
- package/dist/Combobox.d.cts +1 -0
- package/dist/Combobox.d.ts +1 -0
- package/dist/Combobox.js +8 -2
- package/dist/CommandOptionList.cjs +3 -1
- package/dist/CommandOptionList.js +3 -1
- package/dist/DatePicker.cjs +2 -1
- package/dist/DatePicker.d.cts +1 -0
- package/dist/DatePicker.d.ts +1 -0
- package/dist/DatePicker.js +2 -1
- package/dist/IconToggle.cjs +1 -1
- package/dist/IconToggle.js +1 -1
- package/dist/Rating.cjs +7 -2
- package/dist/Rating.d.cts +1 -0
- package/dist/Rating.d.ts +1 -0
- package/dist/Rating.js +7 -2
- package/dist/Select.cjs +5 -1
- package/dist/Select.js +5 -1
- package/dist/avatar-upload/AvatarUpload.cjs +5 -2
- package/dist/avatar-upload/AvatarUpload.js +5 -2
- package/dist/avatar-upload/AvatarUploadComponents.cjs +3 -1
- package/dist/avatar-upload/AvatarUploadComponents.js +3 -1
- package/dist/avatar-upload/AvatarUploadItem.cjs +4 -1
- package/dist/avatar-upload/AvatarUploadItem.js +4 -1
- package/dist/confirmation-dialog/ConfirmationDialog.cjs +4 -1
- package/dist/confirmation-dialog/ConfirmationDialog.d.cts +1 -0
- package/dist/confirmation-dialog/ConfirmationDialog.d.ts +1 -0
- package/dist/confirmation-dialog/ConfirmationDialog.js +4 -1
- package/dist/dialog/Dialog.d.ts +4 -4
- package/dist/file-upload/FileUpload.cjs +3 -1
- package/dist/file-upload/FileUpload.d.cts +2 -2
- package/dist/file-upload/FileUpload.js +3 -1
- package/dist/file-upload/FileUploadItems.cjs +2 -1
- package/dist/file-upload/FileUploadItems.js +2 -1
- package/dist/file-upload/FileUploadListItem.cjs +3 -1
- package/dist/file-upload/FileUploadListItem.js +3 -1
- package/dist/file-upload-inline/FileUploadInline.d.cts +2 -2
- package/dist/file-upload-inline/FileUploadInline.d.ts +2 -2
- package/dist/file-upload-root/FileUploadRoot.cjs +3 -1
- package/dist/file-upload-root/FileUploadRoot.js +3 -1
- package/dist/file-upload-root/FileUploadRootItem.cjs +18 -13
- package/dist/file-upload-root/FileUploadRootItem.d.cts +1 -0
- package/dist/file-upload-root/FileUploadRootItem.d.ts +1 -0
- package/dist/file-upload-root/FileUploadRootItem.js +18 -13
- package/dist/icon-selector/IconPicker.cjs +7 -1
- package/dist/icon-selector/IconPicker.d.cts +1 -0
- package/dist/icon-selector/IconPicker.d.ts +1 -0
- package/dist/icon-selector/IconPicker.js +7 -1
- package/dist/icon-selector/icon-picker-content.cjs +8 -1
- package/dist/icon-selector/icon-picker-content.js +8 -1
- package/dist/icon-selector/virtualized-icon-grid.cjs +5 -2
- package/dist/icon-selector/virtualized-icon-grid.js +5 -2
- package/dist/index.cjs +2 -2
- package/dist/index.js +2 -2
- package/dist/input/Input.d.cts +2 -2
- package/dist/pagination/Pagination.cjs +28 -6
- package/dist/pagination/Pagination.d.cts +1 -0
- package/dist/pagination/Pagination.d.ts +1 -0
- package/dist/pagination/Pagination.js +28 -6
- package/dist/rich-text-editor/ToolbarButton.cjs +1 -1
- package/dist/rich-text-editor/ToolbarButton.js +1 -1
- package/dist/slider/SliderInput.cjs +1 -1
- package/dist/slider/SliderInput.js +1 -1
- package/dist/slider/SliderSelect.cjs +1 -1
- package/dist/slider/SliderSelect.js +1 -1
- package/dist/tags-input/TagsInput.cjs +4 -1
- package/dist/tags-input/TagsInput.d.cts +2 -0
- package/dist/tags-input/TagsInput.d.ts +4 -2
- package/dist/tags-input/TagsInput.js +4 -1
- package/dist/tags-input/TagsInputInline.cjs +9 -2
- package/dist/tags-input/TagsInputInline.d.cts +4 -2
- package/dist/tags-input/TagsInputInline.d.ts +4 -2
- package/dist/tags-input/TagsInputInline.js +9 -2
- package/dist/theme-toggle/ThemeModeDropdown.cjs +6 -1
- package/dist/theme-toggle/ThemeModeDropdown.d.cts +3 -2
- package/dist/theme-toggle/ThemeModeDropdown.d.ts +3 -2
- package/dist/theme-toggle/ThemeModeDropdown.js +6 -1
- package/dist/theme-toggle/ThemeModeSwitchInside.cjs +3 -1
- package/dist/theme-toggle/ThemeModeSwitchInside.d.cts +3 -2
- package/dist/theme-toggle/ThemeModeSwitchInside.d.ts +3 -2
- package/dist/theme-toggle/ThemeModeSwitchInside.js +3 -1
- package/dist/theme-toggle/ThemeModeSwitchOutside.cjs +3 -1
- package/dist/theme-toggle/ThemeModeSwitchOutside.d.cts +3 -2
- package/dist/theme-toggle/ThemeModeSwitchOutside.d.ts +3 -2
- package/dist/theme-toggle/ThemeModeSwitchOutside.js +3 -1
- package/dist/theme-toggle/ThemeModeToggleButton.cjs +2 -1
- package/dist/theme-toggle/ThemeModeToggleButton.d.cts +3 -2
- package/dist/theme-toggle/ThemeModeToggleButton.d.ts +3 -2
- package/dist/theme-toggle/ThemeModeToggleButton.js +2 -1
- package/dist/toast/AlertToast.cjs +2 -1
- package/dist/toast/AlertToast.js +2 -1
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime16 from "react/jsx-runtime";
|
|
2
2
|
import { ChangeEventHandler, FocusEventHandler, KeyboardEventHandler, MouseEventHandler, Ref } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/tags-input/TagsInputInline.d.ts
|
|
@@ -8,6 +8,7 @@ interface TagsInputInlineItem {
|
|
|
8
8
|
label: string;
|
|
9
9
|
}
|
|
10
10
|
interface TagsInputInlineProps {
|
|
11
|
+
id?: string;
|
|
11
12
|
label?: string;
|
|
12
13
|
showLabel?: boolean;
|
|
13
14
|
className?: string;
|
|
@@ -48,6 +49,7 @@ interface TagsInputInlineProps {
|
|
|
48
49
|
showClear?: boolean;
|
|
49
50
|
}
|
|
50
51
|
declare function TagsInputInline({
|
|
52
|
+
id,
|
|
51
53
|
label,
|
|
52
54
|
showLabel,
|
|
53
55
|
className,
|
|
@@ -75,6 +77,6 @@ declare function TagsInputInline({
|
|
|
75
77
|
canAddCurrentValue,
|
|
76
78
|
onAddCurrentInput,
|
|
77
79
|
showClear
|
|
78
|
-
}: TagsInputInlineProps):
|
|
80
|
+
}: TagsInputInlineProps): react_jsx_runtime16.JSX.Element;
|
|
79
81
|
//#endregion
|
|
80
82
|
export { TagsInputInline, TagsInputInlineItem, TagsInputInlineProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChangeEventHandler, FocusEventHandler, KeyboardEventHandler, MouseEventHandler, Ref } from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime15 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/tags-input/TagsInputInline.d.ts
|
|
5
5
|
interface TagsInputInlineItem {
|
|
@@ -8,6 +8,7 @@ interface TagsInputInlineItem {
|
|
|
8
8
|
label: string;
|
|
9
9
|
}
|
|
10
10
|
interface TagsInputInlineProps {
|
|
11
|
+
id?: string;
|
|
11
12
|
label?: string;
|
|
12
13
|
showLabel?: boolean;
|
|
13
14
|
className?: string;
|
|
@@ -48,6 +49,7 @@ interface TagsInputInlineProps {
|
|
|
48
49
|
showClear?: boolean;
|
|
49
50
|
}
|
|
50
51
|
declare function TagsInputInline({
|
|
52
|
+
id,
|
|
51
53
|
label,
|
|
52
54
|
showLabel,
|
|
53
55
|
className,
|
|
@@ -75,6 +77,6 @@ declare function TagsInputInline({
|
|
|
75
77
|
canAddCurrentValue,
|
|
76
78
|
onAddCurrentInput,
|
|
77
79
|
showClear
|
|
78
|
-
}: TagsInputInlineProps):
|
|
80
|
+
}: TagsInputInlineProps): react_jsx_runtime15.JSX.Element;
|
|
79
81
|
//#endregion
|
|
80
82
|
export { TagsInputInline, TagsInputInlineItem, TagsInputInlineProps };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
import { getId } from "../utils/get-id.js";
|
|
4
5
|
import { Button, TagsInputInLineClear, TagsInputInLineInput, TagsInputInLineItem, TagsInputInLineLabel, TagsInputInLineList, TagsInputInLineRoot, cn } from "@pixpilot/shadcn";
|
|
5
6
|
import { Plus } from "lucide-react";
|
|
6
7
|
import { createElement, useMemo } from "react";
|
|
7
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
|
|
9
10
|
//#region src/tags-input/TagsInputInline.tsx
|
|
10
|
-
function TagsInputInline({ label, showLabel = true, className, disabled = false, editable, max, onValueChange, onValidate, readOnly = false, value, delimiter, addOnPaste, addOnTab, items, onListClick, inputRef, inputPlaceholder, inputValue, onInputFocus, onInputChange, onInputKeyDown, onInputMouseDown, addButtonVisibility = "touch", slots, canAddCurrentValue = false, onAddCurrentInput, showClear = false }) {
|
|
11
|
+
function TagsInputInline({ id, label, showLabel = true, className, disabled = false, editable, max, onValueChange, onValidate, readOnly = false, value, delimiter, addOnPaste, addOnTab, items, onListClick, inputRef, inputPlaceholder, inputValue, onInputFocus, onInputChange, onInputKeyDown, onInputMouseDown, addButtonVisibility = "touch", slots, canAddCurrentValue = false, onAddCurrentInput, showClear = false }) {
|
|
11
12
|
const addButtonVisibilityClassName = useMemo(() => {
|
|
12
13
|
if (addButtonVisibility === "always") return "inline-flex";
|
|
13
14
|
if (addButtonVisibility === "touch") return "hidden pointer-coarse:inline-flex";
|
|
@@ -40,10 +41,12 @@ function TagsInputInline({ label, showLabel = true, className, disabled = false,
|
|
|
40
41
|
items.map((item) => /* @__PURE__ */ createElement(TagsInputInLineItem, {
|
|
41
42
|
...slots?.item || {},
|
|
42
43
|
key: item.key,
|
|
44
|
+
id: getId(id, `item-${item.value}`),
|
|
43
45
|
value: item.value
|
|
44
46
|
}, item.label)),
|
|
45
47
|
/* @__PURE__ */ jsx(TagsInputInLineInput, {
|
|
46
48
|
...slots?.input || {},
|
|
49
|
+
id,
|
|
47
50
|
ref: inputRef,
|
|
48
51
|
placeholder: inputPlaceholder,
|
|
49
52
|
value: inputValue,
|
|
@@ -54,6 +57,7 @@ function TagsInputInline({ label, showLabel = true, className, disabled = false,
|
|
|
54
57
|
}),
|
|
55
58
|
addButtonVisibility !== "never" ? /* @__PURE__ */ jsxs(Button, {
|
|
56
59
|
...slots?.addButton,
|
|
60
|
+
id: getId(id, "add-button"),
|
|
57
61
|
type: "button",
|
|
58
62
|
size: "icon",
|
|
59
63
|
variant: "ghost",
|
|
@@ -67,7 +71,10 @@ function TagsInputInline({ label, showLabel = true, className, disabled = false,
|
|
|
67
71
|
}) : null
|
|
68
72
|
]
|
|
69
73
|
}),
|
|
70
|
-
showClear ? /* @__PURE__ */ jsx(TagsInputInLineClear, {
|
|
74
|
+
showClear ? /* @__PURE__ */ jsx(TagsInputInLineClear, {
|
|
75
|
+
id: getId(id, "clear-button"),
|
|
76
|
+
...slots?.clear || {}
|
|
77
|
+
}) : null
|
|
71
78
|
]
|
|
72
79
|
});
|
|
73
80
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
5
|
+
const require_get_id = require('../utils/get-id.cjs');
|
|
5
6
|
let __pixpilot_shadcn = require("@pixpilot/shadcn");
|
|
6
7
|
__pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
|
|
7
8
|
let lucide_react = require("lucide-react");
|
|
@@ -18,11 +19,12 @@ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
|
18
19
|
* Pure component - requires themeValue and onChange props.
|
|
19
20
|
*/
|
|
20
21
|
function ThemeModeDropdown(props) {
|
|
21
|
-
const { align = "end", className, themeValue, onChange, value, disabled } = props;
|
|
22
|
+
const { id, align = "end", className, themeValue, onChange, value, disabled } = props;
|
|
22
23
|
const isDark = value === "dark";
|
|
23
24
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.DropdownMenu, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.DropdownMenuTrigger, {
|
|
24
25
|
asChild: true,
|
|
25
26
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.Button, {
|
|
27
|
+
id,
|
|
26
28
|
variant: "outline",
|
|
27
29
|
size: "icon",
|
|
28
30
|
className: (0, __pixpilot_shadcn.cn)(className),
|
|
@@ -40,6 +42,7 @@ function ThemeModeDropdown(props) {
|
|
|
40
42
|
align,
|
|
41
43
|
children: [
|
|
42
44
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.DropdownMenuItem, {
|
|
45
|
+
id: require_get_id.getId(id, "option-light"),
|
|
43
46
|
onClick: () => onChange?.("light"),
|
|
44
47
|
children: [
|
|
45
48
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Sun, { className: "h-4 w-4 mr-2" }),
|
|
@@ -51,6 +54,7 @@ function ThemeModeDropdown(props) {
|
|
|
51
54
|
]
|
|
52
55
|
}),
|
|
53
56
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.DropdownMenuItem, {
|
|
57
|
+
id: require_get_id.getId(id, "option-dark"),
|
|
54
58
|
onClick: () => onChange?.("dark"),
|
|
55
59
|
children: [
|
|
56
60
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Moon, { className: "h-4 w-4 mr-2" }),
|
|
@@ -62,6 +66,7 @@ function ThemeModeDropdown(props) {
|
|
|
62
66
|
]
|
|
63
67
|
}),
|
|
64
68
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.DropdownMenuItem, {
|
|
69
|
+
id: require_get_id.getId(id, "option-system"),
|
|
65
70
|
onClick: () => onChange?.("system"),
|
|
66
71
|
children: [
|
|
67
72
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Monitor, { className: "h-4 w-4 mr-2" }),
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime18 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/theme-toggle/ThemeModeDropdown.d.ts
|
|
4
4
|
interface ThemeModeDropdownProps {
|
|
5
|
+
id?: string;
|
|
5
6
|
align?: 'start' | 'center' | 'end';
|
|
6
7
|
className?: string;
|
|
7
8
|
/** Current theme selection ("light" | "dark" | "system") */
|
|
@@ -17,7 +18,7 @@ interface ThemeModeDropdownProps {
|
|
|
17
18
|
* Provides Light / Dark / System options.
|
|
18
19
|
* Pure component - requires themeValue and onChange props.
|
|
19
20
|
*/
|
|
20
|
-
declare function ThemeModeDropdown(props: ThemeModeDropdownProps):
|
|
21
|
+
declare function ThemeModeDropdown(props: ThemeModeDropdownProps): react_jsx_runtime18.JSX.Element;
|
|
21
22
|
declare namespace ThemeModeDropdown {
|
|
22
23
|
var displayName: string;
|
|
23
24
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime18 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/theme-toggle/ThemeModeDropdown.d.ts
|
|
4
4
|
interface ThemeModeDropdownProps {
|
|
5
|
+
id?: string;
|
|
5
6
|
align?: 'start' | 'center' | 'end';
|
|
6
7
|
className?: string;
|
|
7
8
|
/** Current theme selection ("light" | "dark" | "system") */
|
|
@@ -17,7 +18,7 @@ interface ThemeModeDropdownProps {
|
|
|
17
18
|
* Provides Light / Dark / System options.
|
|
18
19
|
* Pure component - requires themeValue and onChange props.
|
|
19
20
|
*/
|
|
20
|
-
declare function ThemeModeDropdown(props: ThemeModeDropdownProps):
|
|
21
|
+
declare function ThemeModeDropdown(props: ThemeModeDropdownProps): react_jsx_runtime18.JSX.Element;
|
|
21
22
|
declare namespace ThemeModeDropdown {
|
|
22
23
|
var displayName: string;
|
|
23
24
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
import { getId } from "../utils/get-id.js";
|
|
4
5
|
import { Button, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, cn } from "@pixpilot/shadcn";
|
|
5
6
|
import { Check, Monitor, Moon, Sun } from "lucide-react";
|
|
6
7
|
import React from "react";
|
|
@@ -13,11 +14,12 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
13
14
|
* Pure component - requires themeValue and onChange props.
|
|
14
15
|
*/
|
|
15
16
|
function ThemeModeDropdown(props) {
|
|
16
|
-
const { align = "end", className, themeValue, onChange, value, disabled } = props;
|
|
17
|
+
const { id, align = "end", className, themeValue, onChange, value, disabled } = props;
|
|
17
18
|
const isDark = value === "dark";
|
|
18
19
|
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
19
20
|
asChild: true,
|
|
20
21
|
children: /* @__PURE__ */ jsxs(Button, {
|
|
22
|
+
id,
|
|
21
23
|
variant: "outline",
|
|
22
24
|
size: "icon",
|
|
23
25
|
className: cn(className),
|
|
@@ -35,6 +37,7 @@ function ThemeModeDropdown(props) {
|
|
|
35
37
|
align,
|
|
36
38
|
children: [
|
|
37
39
|
/* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
40
|
+
id: getId(id, "option-light"),
|
|
38
41
|
onClick: () => onChange?.("light"),
|
|
39
42
|
children: [
|
|
40
43
|
/* @__PURE__ */ jsx(Sun, { className: "h-4 w-4 mr-2" }),
|
|
@@ -46,6 +49,7 @@ function ThemeModeDropdown(props) {
|
|
|
46
49
|
]
|
|
47
50
|
}),
|
|
48
51
|
/* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
52
|
+
id: getId(id, "option-dark"),
|
|
49
53
|
onClick: () => onChange?.("dark"),
|
|
50
54
|
children: [
|
|
51
55
|
/* @__PURE__ */ jsx(Moon, { className: "h-4 w-4 mr-2" }),
|
|
@@ -57,6 +61,7 @@ function ThemeModeDropdown(props) {
|
|
|
57
61
|
]
|
|
58
62
|
}),
|
|
59
63
|
/* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
64
|
+
id: getId(id, "option-system"),
|
|
60
65
|
onClick: () => onChange?.("system"),
|
|
61
66
|
children: [
|
|
62
67
|
/* @__PURE__ */ jsx(Monitor, { className: "h-4 w-4 mr-2" }),
|
|
@@ -37,7 +37,7 @@ const SIZE_STYLES = {
|
|
|
37
37
|
* Pure component - requires value and onChange props.
|
|
38
38
|
*/
|
|
39
39
|
function ThemeModeSwitchInside(props) {
|
|
40
|
-
const { showIcons = true, size = "md", iconSize: iconSizeProp, className, switchClassName, disabled, ariaLabel = "Toggle theme", value, onChange } = props;
|
|
40
|
+
const { showIcons = true, id, size = "md", iconSize: iconSizeProp, className, switchClassName, disabled, ariaLabel = "Toggle theme", value, onChange } = props;
|
|
41
41
|
const sizeStyles = SIZE_STYLES[size];
|
|
42
42
|
const iconSize = iconSizeProp ?? sizeStyles.defaultIconSize ?? DEFAULT_ICON_SIZE;
|
|
43
43
|
const isDark = value === "dark";
|
|
@@ -45,6 +45,7 @@ function ThemeModeSwitchInside(props) {
|
|
|
45
45
|
onChange?.(checked ? "dark" : "light");
|
|
46
46
|
};
|
|
47
47
|
if (!showIcons) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.Switch, {
|
|
48
|
+
id,
|
|
48
49
|
checked: isDark,
|
|
49
50
|
onCheckedChange,
|
|
50
51
|
disabled,
|
|
@@ -57,6 +58,7 @@ function ThemeModeSwitchInside(props) {
|
|
|
57
58
|
className: (0, __pixpilot_shadcn.cn)(TOGGLE_WRAPPER_CLASS_NAME, sizeStyles.wrapper, disabled && "opacity-50", className),
|
|
58
59
|
children: [
|
|
59
60
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.Switch, {
|
|
61
|
+
id,
|
|
60
62
|
checked: isDark,
|
|
61
63
|
onCheckedChange,
|
|
62
64
|
disabled,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime19 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/theme-toggle/ThemeModeSwitchInside.d.ts
|
|
4
4
|
type ThemeModeSwitchInsideSize = 'sm' | 'md' | 'lg';
|
|
5
5
|
interface ThemeModeSwitchInsideProps {
|
|
6
|
+
id?: string;
|
|
6
7
|
/** Whether to render the sun/moon icons at all. */
|
|
7
8
|
showIcons?: boolean;
|
|
8
9
|
/** Visual size of the toggle pill. */
|
|
@@ -25,7 +26,7 @@ interface ThemeModeSwitchInsideProps {
|
|
|
25
26
|
* Icons are embedded within the switch control.
|
|
26
27
|
* Pure component - requires value and onChange props.
|
|
27
28
|
*/
|
|
28
|
-
declare function ThemeModeSwitchInside(props: ThemeModeSwitchInsideProps):
|
|
29
|
+
declare function ThemeModeSwitchInside(props: ThemeModeSwitchInsideProps): react_jsx_runtime19.JSX.Element;
|
|
29
30
|
declare namespace ThemeModeSwitchInside {
|
|
30
31
|
var displayName: string;
|
|
31
32
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime19 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/theme-toggle/ThemeModeSwitchInside.d.ts
|
|
4
4
|
type ThemeModeSwitchInsideSize = 'sm' | 'md' | 'lg';
|
|
5
5
|
interface ThemeModeSwitchInsideProps {
|
|
6
|
+
id?: string;
|
|
6
7
|
/** Whether to render the sun/moon icons at all. */
|
|
7
8
|
showIcons?: boolean;
|
|
8
9
|
/** Visual size of the toggle pill. */
|
|
@@ -25,7 +26,7 @@ interface ThemeModeSwitchInsideProps {
|
|
|
25
26
|
* Icons are embedded within the switch control.
|
|
26
27
|
* Pure component - requires value and onChange props.
|
|
27
28
|
*/
|
|
28
|
-
declare function ThemeModeSwitchInside(props: ThemeModeSwitchInsideProps):
|
|
29
|
+
declare function ThemeModeSwitchInside(props: ThemeModeSwitchInsideProps): react_jsx_runtime19.JSX.Element;
|
|
29
30
|
declare namespace ThemeModeSwitchInside {
|
|
30
31
|
var displayName: string;
|
|
31
32
|
}
|
|
@@ -33,7 +33,7 @@ const SIZE_STYLES = {
|
|
|
33
33
|
* Pure component - requires value and onChange props.
|
|
34
34
|
*/
|
|
35
35
|
function ThemeModeSwitchInside(props) {
|
|
36
|
-
const { showIcons = true, size = "md", iconSize: iconSizeProp, className, switchClassName, disabled, ariaLabel = "Toggle theme", value, onChange } = props;
|
|
36
|
+
const { showIcons = true, id, size = "md", iconSize: iconSizeProp, className, switchClassName, disabled, ariaLabel = "Toggle theme", value, onChange } = props;
|
|
37
37
|
const sizeStyles = SIZE_STYLES[size];
|
|
38
38
|
const iconSize = iconSizeProp ?? sizeStyles.defaultIconSize ?? DEFAULT_ICON_SIZE;
|
|
39
39
|
const isDark = value === "dark";
|
|
@@ -41,6 +41,7 @@ function ThemeModeSwitchInside(props) {
|
|
|
41
41
|
onChange?.(checked ? "dark" : "light");
|
|
42
42
|
};
|
|
43
43
|
if (!showIcons) return /* @__PURE__ */ jsx(Switch, {
|
|
44
|
+
id,
|
|
44
45
|
checked: isDark,
|
|
45
46
|
onCheckedChange,
|
|
46
47
|
disabled,
|
|
@@ -53,6 +54,7 @@ function ThemeModeSwitchInside(props) {
|
|
|
53
54
|
className: cn(TOGGLE_WRAPPER_CLASS_NAME, sizeStyles.wrapper, disabled && "opacity-50", className),
|
|
54
55
|
children: [
|
|
55
56
|
/* @__PURE__ */ jsx(Switch, {
|
|
57
|
+
id,
|
|
56
58
|
checked: isDark,
|
|
57
59
|
onCheckedChange,
|
|
58
60
|
disabled,
|
|
@@ -19,12 +19,13 @@ const DEFAULT_ICON_SIZE = 16;
|
|
|
19
19
|
* Pure component - requires value and onChange props.
|
|
20
20
|
*/
|
|
21
21
|
function ThemeModeSwitchOutside(props) {
|
|
22
|
-
const { showIcons = true, iconSize = DEFAULT_ICON_SIZE, className, switchClassName, disabled, ariaLabel = "Toggle theme", value, onChange } = props;
|
|
22
|
+
const { showIcons = true, id, iconSize = DEFAULT_ICON_SIZE, className, switchClassName, disabled, ariaLabel = "Toggle theme", value, onChange } = props;
|
|
23
23
|
const isDark = value === "dark";
|
|
24
24
|
const onCheckedChange = (checked) => {
|
|
25
25
|
onChange?.(checked ? "dark" : "light");
|
|
26
26
|
};
|
|
27
27
|
if (!showIcons) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.Switch, {
|
|
28
|
+
id,
|
|
28
29
|
checked: isDark,
|
|
29
30
|
onCheckedChange,
|
|
30
31
|
disabled,
|
|
@@ -42,6 +43,7 @@ function ThemeModeSwitchOutside(props) {
|
|
|
42
43
|
}
|
|
43
44
|
}),
|
|
44
45
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.Switch, {
|
|
46
|
+
id,
|
|
45
47
|
checked: isDark,
|
|
46
48
|
onCheckedChange,
|
|
47
49
|
disabled,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime20 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/theme-toggle/ThemeModeSwitchOutside.d.ts
|
|
4
4
|
interface ThemeModeSwitchOutsideProps {
|
|
5
|
+
id?: string;
|
|
5
6
|
/** Whether to render the sun/moon icons at all. */
|
|
6
7
|
showIcons?: boolean;
|
|
7
8
|
/** Icon size in pixels. */
|
|
@@ -22,7 +23,7 @@ interface ThemeModeSwitchOutsideProps {
|
|
|
22
23
|
* Icons flank the switch control on either side.
|
|
23
24
|
* Pure component - requires value and onChange props.
|
|
24
25
|
*/
|
|
25
|
-
declare function ThemeModeSwitchOutside(props: ThemeModeSwitchOutsideProps):
|
|
26
|
+
declare function ThemeModeSwitchOutside(props: ThemeModeSwitchOutsideProps): react_jsx_runtime20.JSX.Element;
|
|
26
27
|
declare namespace ThemeModeSwitchOutside {
|
|
27
28
|
var displayName: string;
|
|
28
29
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime20 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/theme-toggle/ThemeModeSwitchOutside.d.ts
|
|
4
4
|
interface ThemeModeSwitchOutsideProps {
|
|
5
|
+
id?: string;
|
|
5
6
|
/** Whether to render the sun/moon icons at all. */
|
|
6
7
|
showIcons?: boolean;
|
|
7
8
|
/** Icon size in pixels. */
|
|
@@ -22,7 +23,7 @@ interface ThemeModeSwitchOutsideProps {
|
|
|
22
23
|
* Icons flank the switch control on either side.
|
|
23
24
|
* Pure component - requires value and onChange props.
|
|
24
25
|
*/
|
|
25
|
-
declare function ThemeModeSwitchOutside(props: ThemeModeSwitchOutsideProps):
|
|
26
|
+
declare function ThemeModeSwitchOutside(props: ThemeModeSwitchOutsideProps): react_jsx_runtime20.JSX.Element;
|
|
26
27
|
declare namespace ThemeModeSwitchOutside {
|
|
27
28
|
var displayName: string;
|
|
28
29
|
}
|
|
@@ -14,12 +14,13 @@ const DEFAULT_ICON_SIZE = 16;
|
|
|
14
14
|
* Pure component - requires value and onChange props.
|
|
15
15
|
*/
|
|
16
16
|
function ThemeModeSwitchOutside(props) {
|
|
17
|
-
const { showIcons = true, iconSize = DEFAULT_ICON_SIZE, className, switchClassName, disabled, ariaLabel = "Toggle theme", value, onChange } = props;
|
|
17
|
+
const { showIcons = true, id, iconSize = DEFAULT_ICON_SIZE, className, switchClassName, disabled, ariaLabel = "Toggle theme", value, onChange } = props;
|
|
18
18
|
const isDark = value === "dark";
|
|
19
19
|
const onCheckedChange = (checked) => {
|
|
20
20
|
onChange?.(checked ? "dark" : "light");
|
|
21
21
|
};
|
|
22
22
|
if (!showIcons) return /* @__PURE__ */ jsx(Switch, {
|
|
23
|
+
id,
|
|
23
24
|
checked: isDark,
|
|
24
25
|
onCheckedChange,
|
|
25
26
|
disabled,
|
|
@@ -37,6 +38,7 @@ function ThemeModeSwitchOutside(props) {
|
|
|
37
38
|
}
|
|
38
39
|
}),
|
|
39
40
|
/* @__PURE__ */ jsx(Switch, {
|
|
41
|
+
id,
|
|
40
42
|
checked: isDark,
|
|
41
43
|
onCheckedChange,
|
|
42
44
|
disabled,
|
|
@@ -17,7 +17,7 @@ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
|
17
17
|
* Pure component - toggles between light and dark.
|
|
18
18
|
*/
|
|
19
19
|
function ThemeModeToggleButton(props) {
|
|
20
|
-
const { className, value, onChange, disabled } = props;
|
|
20
|
+
const { id, className, value, onChange, disabled } = props;
|
|
21
21
|
const toggleTheme = react.default.useCallback(() => {
|
|
22
22
|
if (value === "dark") {
|
|
23
23
|
onChange?.("light");
|
|
@@ -26,6 +26,7 @@ function ThemeModeToggleButton(props) {
|
|
|
26
26
|
onChange?.("dark");
|
|
27
27
|
}, [value, onChange]);
|
|
28
28
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.Button, {
|
|
29
|
+
id,
|
|
29
30
|
variant: "secondary",
|
|
30
31
|
size: "icon",
|
|
31
32
|
className: (0, __pixpilot_shadcn.cn)("group/toggle size-8", className),
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime17 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/theme-toggle/ThemeModeToggleButton.d.ts
|
|
4
4
|
interface ThemeModeToggleButtonProps {
|
|
5
|
+
id?: string;
|
|
5
6
|
className?: string;
|
|
6
7
|
/** The resolved theme value ("light" | "dark") */
|
|
7
8
|
value?: string;
|
|
@@ -13,7 +14,7 @@ interface ThemeModeToggleButtonProps {
|
|
|
13
14
|
* Light/Dark toggle button.
|
|
14
15
|
* Pure component - toggles between light and dark.
|
|
15
16
|
*/
|
|
16
|
-
declare function ThemeModeToggleButton(props: ThemeModeToggleButtonProps):
|
|
17
|
+
declare function ThemeModeToggleButton(props: ThemeModeToggleButtonProps): react_jsx_runtime17.JSX.Element;
|
|
17
18
|
declare namespace ThemeModeToggleButton {
|
|
18
19
|
var displayName: string;
|
|
19
20
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime17 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/theme-toggle/ThemeModeToggleButton.d.ts
|
|
4
4
|
interface ThemeModeToggleButtonProps {
|
|
5
|
+
id?: string;
|
|
5
6
|
className?: string;
|
|
6
7
|
/** The resolved theme value ("light" | "dark") */
|
|
7
8
|
value?: string;
|
|
@@ -13,7 +14,7 @@ interface ThemeModeToggleButtonProps {
|
|
|
13
14
|
* Light/Dark toggle button.
|
|
14
15
|
* Pure component - toggles between light and dark.
|
|
15
16
|
*/
|
|
16
|
-
declare function ThemeModeToggleButton(props: ThemeModeToggleButtonProps):
|
|
17
|
+
declare function ThemeModeToggleButton(props: ThemeModeToggleButtonProps): react_jsx_runtime17.JSX.Element;
|
|
17
18
|
declare namespace ThemeModeToggleButton {
|
|
18
19
|
var displayName: string;
|
|
19
20
|
}
|
|
@@ -12,7 +12,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
12
12
|
* Pure component - toggles between light and dark.
|
|
13
13
|
*/
|
|
14
14
|
function ThemeModeToggleButton(props) {
|
|
15
|
-
const { className, value, onChange, disabled } = props;
|
|
15
|
+
const { id, className, value, onChange, disabled } = props;
|
|
16
16
|
const toggleTheme = React.useCallback(() => {
|
|
17
17
|
if (value === "dark") {
|
|
18
18
|
onChange?.("light");
|
|
@@ -21,6 +21,7 @@ function ThemeModeToggleButton(props) {
|
|
|
21
21
|
onChange?.("dark");
|
|
22
22
|
}, [value, onChange]);
|
|
23
23
|
return /* @__PURE__ */ jsxs(Button, {
|
|
24
|
+
id,
|
|
24
25
|
variant: "secondary",
|
|
25
26
|
size: "icon",
|
|
26
27
|
className: cn("group/toggle size-8", className),
|
|
@@ -11,7 +11,7 @@ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
|
11
11
|
|
|
12
12
|
//#region src/toast/AlertToast.tsx
|
|
13
13
|
const AlertToast = (props) => {
|
|
14
|
-
const { duration, onClose,...rest } = props;
|
|
14
|
+
const { duration, onClose, id,...rest } = props;
|
|
15
15
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Alert.Alert, {
|
|
16
16
|
icon: true,
|
|
17
17
|
...rest,
|
|
@@ -19,6 +19,7 @@ const AlertToast = (props) => {
|
|
|
19
19
|
children: onClose && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
20
20
|
className: "flex items-start pt-0.5 pl-1",
|
|
21
21
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
22
|
+
id,
|
|
22
23
|
type: "button",
|
|
23
24
|
className: "cursor-pointer opacity-80 transition-opacity hover:opacity-100",
|
|
24
25
|
onClick: onClose,
|
package/dist/toast/AlertToast.js
CHANGED
|
@@ -6,7 +6,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
|
|
7
7
|
//#region src/toast/AlertToast.tsx
|
|
8
8
|
const AlertToast = (props) => {
|
|
9
|
-
const { duration, onClose,...rest } = props;
|
|
9
|
+
const { duration, onClose, id,...rest } = props;
|
|
10
10
|
return /* @__PURE__ */ jsx(Alert$1, {
|
|
11
11
|
icon: true,
|
|
12
12
|
...rest,
|
|
@@ -14,6 +14,7 @@ const AlertToast = (props) => {
|
|
|
14
14
|
children: onClose && /* @__PURE__ */ jsx("div", {
|
|
15
15
|
className: "flex items-start pt-0.5 pl-1",
|
|
16
16
|
children: /* @__PURE__ */ jsxs("button", {
|
|
17
|
+
id,
|
|
17
18
|
type: "button",
|
|
18
19
|
className: "cursor-pointer opacity-80 transition-opacity hover:opacity-100",
|
|
19
20
|
onClick: onClose,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixpilot/shadcn-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.24.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",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"pretty-bytes": "^7.1.0",
|
|
49
49
|
"react-responsive": "^10.0.1",
|
|
50
50
|
"sonner": "2.0.7",
|
|
51
|
-
"@pixpilot/shadcn": "1.
|
|
51
|
+
"@pixpilot/shadcn": "1.3.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@storybook/react": "^8.6.18",
|
|
@@ -63,12 +63,12 @@
|
|
|
63
63
|
"tailwindcss": "^4.2.2",
|
|
64
64
|
"tsdown": "^0.15.12",
|
|
65
65
|
"typescript": "^5.9.3",
|
|
66
|
-
"@internal/eslint-config": "0.3.0",
|
|
67
|
-
"@internal/hooks": "0.0.0",
|
|
68
66
|
"@internal/prettier-config": "0.0.1",
|
|
69
67
|
"@internal/tsconfig": "0.1.0",
|
|
70
68
|
"@internal/tsdown-config": "0.1.0",
|
|
71
|
-
"@internal/vitest-config": "0.1.0"
|
|
69
|
+
"@internal/vitest-config": "0.1.0",
|
|
70
|
+
"@internal/hooks": "0.0.0",
|
|
71
|
+
"@internal/eslint-config": "0.3.0"
|
|
72
72
|
},
|
|
73
73
|
"prettier": "@internal/prettier-config",
|
|
74
74
|
"scripts": {
|