@pixpilot/shadcn-ui 0.30.0 → 0.31.1
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/file-upload-inline/FileUploadInline.d.cts +2 -2
- package/dist/icon-selector/IconPicker.cjs +16 -18
- package/dist/icon-selector/IconPicker.d.cts +21 -2
- package/dist/icon-selector/IconPicker.d.ts +21 -2
- package/dist/icon-selector/IconPicker.js +17 -19
- package/dist/icon-selector/icon-picker-container.cjs +8 -2
- package/dist/icon-selector/icon-picker-container.js +8 -2
- package/dist/input/Input.d.cts +2 -2
- package/dist/theme-toggle/ThemeModeDropdown.d.cts +2 -2
- package/dist/theme-toggle/ThemeModeSwitchInside.d.cts +2 -2
- package/package.json +2 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { FileUploadInlineProps } from "./types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime8 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_runtime8.JSX.Element;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { FileUploadInline };
|
|
@@ -17,7 +17,8 @@ let __iconify_react = require("@iconify/react");
|
|
|
17
17
|
__iconify_react = require_rolldown_runtime.__toESM(__iconify_react);
|
|
18
18
|
|
|
19
19
|
//#region src/icon-selector/IconPicker.tsx
|
|
20
|
-
const
|
|
20
|
+
const ICON_SIZE = "!h-4 !w-4";
|
|
21
|
+
const IconPicker = ({ value, onChange, onOpenChange, pickerMode = "dialog", popoverProps, variant = "default", providers: providersProp, showValueText = true, emptyText = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Plus, { className: ICON_SIZE }), showClearButton = true, slots }) => {
|
|
21
22
|
const [isOpen, setIsOpen] = (0, react.useState)(false);
|
|
22
23
|
const isMobile = require_use_media_query.useMediaQuery({ maxWidth: 768 });
|
|
23
24
|
const handleSelectIcon = (0, react.useCallback)((iconName) => {
|
|
@@ -63,19 +64,16 @@ const IconPicker = ({ value, onChange, onOpenChange, pickerMode = "dialog", popo
|
|
|
63
64
|
isOpen,
|
|
64
65
|
setIsOpen,
|
|
65
66
|
selectorContent,
|
|
66
|
-
popover,
|
|
67
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
"aria-label": iconButtonLabel,
|
|
74
|
-
children: iconButtonContent
|
|
75
|
-
}), shouldShowClearButton && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Button.Button, {
|
|
67
|
+
popover: popoverProps,
|
|
68
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Button.Button, {
|
|
69
|
+
type: "button",
|
|
70
|
+
variant: "outline",
|
|
71
|
+
"aria-label": iconButtonLabel,
|
|
72
|
+
className: (0, __pixpilot_shadcn.cn)("p-2 min-w-10", slots?.preview?.className),
|
|
73
|
+
children: [iconButtonContent, shouldShowClearButton && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Button.Button, {
|
|
76
74
|
type: "button",
|
|
77
75
|
title: "Clear selected icon",
|
|
78
|
-
className: (0, __pixpilot_shadcn.cn)(
|
|
76
|
+
className: (0, __pixpilot_shadcn.cn)(`absolute -right-1 -top-1 inline-flex ${ICON_SIZE} items-center justify-center rounded-full !p-1`, "border border-border bg-background text-foreground", "hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", slots?.clearIcon?.className),
|
|
79
77
|
"aria-label": "Clear icon",
|
|
80
78
|
onClick: (event) => {
|
|
81
79
|
event.preventDefault();
|
|
@@ -87,12 +85,12 @@ const IconPicker = ({ value, onChange, onOpenChange, pickerMode = "dialog", popo
|
|
|
87
85
|
})
|
|
88
86
|
});
|
|
89
87
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
90
|
-
className: "flex items-center gap-2",
|
|
88
|
+
className: (0, __pixpilot_shadcn.cn)("flex items-center gap-2", slots?.root?.className),
|
|
91
89
|
children: [
|
|
92
90
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
93
|
-
className: "flex items-center gap-2 rounded-md border border-input bg-background px-3 py-2",
|
|
91
|
+
className: (0, __pixpilot_shadcn.cn)("flex items-center gap-2 rounded-md border border-input bg-background px-3 py-2", slots?.preview?.className),
|
|
94
92
|
children: [displayIcon, showValueText && hasValue && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
95
|
-
className: "text-sm text-muted-foreground",
|
|
93
|
+
className: (0, __pixpilot_shadcn.cn)("text-sm text-muted-foreground", slots?.valueText?.className),
|
|
96
94
|
children: value
|
|
97
95
|
})]
|
|
98
96
|
}),
|
|
@@ -101,18 +99,18 @@ const IconPicker = ({ value, onChange, onOpenChange, pickerMode = "dialog", popo
|
|
|
101
99
|
isOpen,
|
|
102
100
|
setIsOpen,
|
|
103
101
|
selectorContent,
|
|
104
|
-
popover,
|
|
102
|
+
popover: popoverProps,
|
|
105
103
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Button.Button, {
|
|
106
104
|
type: "button",
|
|
107
105
|
variant: "outline",
|
|
108
|
-
className: "whitespace-nowrap",
|
|
106
|
+
className: (0, __pixpilot_shadcn.cn)("whitespace-nowrap", slots?.trigger?.className),
|
|
109
107
|
children: hasValue ? "Change Icon" : "Select Icon"
|
|
110
108
|
})
|
|
111
109
|
}),
|
|
112
110
|
shouldShowClearButton && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Button.Button, {
|
|
113
111
|
type: "button",
|
|
114
112
|
variant: "outline",
|
|
115
|
-
className: "whitespace-nowrap",
|
|
113
|
+
className: (0, __pixpilot_shadcn.cn)("whitespace-nowrap", slots?.clearButton?.className),
|
|
116
114
|
onClick: handleClearIcon,
|
|
117
115
|
children: "Clear"
|
|
118
116
|
})
|
|
@@ -5,7 +5,6 @@ import { FC } from "react";
|
|
|
5
5
|
//#region src/icon-selector/IconPicker.d.ts
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* Mount type for the icon selector picker
|
|
9
8
|
* - 'dialog': Always display as a modal dialog
|
|
10
9
|
* - 'popover': Always display as a popover anchored to the trigger button
|
|
11
10
|
*/
|
|
@@ -20,7 +19,7 @@ interface IconPickerProps {
|
|
|
20
19
|
onChange?: (value: string) => void;
|
|
21
20
|
onOpenChange?: (open: boolean) => void;
|
|
22
21
|
pickerMode?: MountType;
|
|
23
|
-
|
|
22
|
+
popoverProps?: Partial<React.ComponentProps<typeof PopoverContent>>;
|
|
24
23
|
variant?: IconPickerVariant;
|
|
25
24
|
providers: IconProvider[];
|
|
26
25
|
isLoading?: boolean;
|
|
@@ -31,6 +30,26 @@ interface IconPickerProps {
|
|
|
31
30
|
showValueText?: boolean;
|
|
32
31
|
emptyText?: React.ReactNode;
|
|
33
32
|
showClearButton?: boolean;
|
|
33
|
+
slots?: {
|
|
34
|
+
root?: {
|
|
35
|
+
className?: string;
|
|
36
|
+
};
|
|
37
|
+
preview?: {
|
|
38
|
+
className?: string;
|
|
39
|
+
};
|
|
40
|
+
trigger?: {
|
|
41
|
+
className?: string;
|
|
42
|
+
};
|
|
43
|
+
clearButton?: {
|
|
44
|
+
className?: string;
|
|
45
|
+
};
|
|
46
|
+
valueText?: {
|
|
47
|
+
className?: string;
|
|
48
|
+
};
|
|
49
|
+
clearIcon?: {
|
|
50
|
+
className?: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
34
53
|
}
|
|
35
54
|
declare const IconPicker: FC<IconPickerProps>;
|
|
36
55
|
//#endregion
|
|
@@ -5,7 +5,6 @@ import { FC } from "react";
|
|
|
5
5
|
//#region src/icon-selector/IconPicker.d.ts
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* Mount type for the icon selector picker
|
|
9
8
|
* - 'dialog': Always display as a modal dialog
|
|
10
9
|
* - 'popover': Always display as a popover anchored to the trigger button
|
|
11
10
|
*/
|
|
@@ -20,7 +19,7 @@ interface IconPickerProps {
|
|
|
20
19
|
onChange?: (value: string) => void;
|
|
21
20
|
onOpenChange?: (open: boolean) => void;
|
|
22
21
|
pickerMode?: MountType;
|
|
23
|
-
|
|
22
|
+
popoverProps?: Partial<React.ComponentProps<typeof PopoverContent>>;
|
|
24
23
|
variant?: IconPickerVariant;
|
|
25
24
|
providers: IconProvider[];
|
|
26
25
|
isLoading?: boolean;
|
|
@@ -31,6 +30,26 @@ interface IconPickerProps {
|
|
|
31
30
|
showValueText?: boolean;
|
|
32
31
|
emptyText?: React.ReactNode;
|
|
33
32
|
showClearButton?: boolean;
|
|
33
|
+
slots?: {
|
|
34
|
+
root?: {
|
|
35
|
+
className?: string;
|
|
36
|
+
};
|
|
37
|
+
preview?: {
|
|
38
|
+
className?: string;
|
|
39
|
+
};
|
|
40
|
+
trigger?: {
|
|
41
|
+
className?: string;
|
|
42
|
+
};
|
|
43
|
+
clearButton?: {
|
|
44
|
+
className?: string;
|
|
45
|
+
};
|
|
46
|
+
valueText?: {
|
|
47
|
+
className?: string;
|
|
48
|
+
};
|
|
49
|
+
clearIcon?: {
|
|
50
|
+
className?: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
34
53
|
}
|
|
35
54
|
declare const IconPicker: FC<IconPickerProps>;
|
|
36
55
|
//#endregion
|
|
@@ -5,13 +5,14 @@ import { ICON_SELECTOR_ERROR_MESSAGE } from "./constants.js";
|
|
|
5
5
|
import { IconPickerContainer } from "./icon-picker-container.js";
|
|
6
6
|
import icon_picker_content_default from "./icon-picker-content.js";
|
|
7
7
|
import { cn } from "@pixpilot/shadcn";
|
|
8
|
-
import { X } from "lucide-react";
|
|
8
|
+
import { Plus, X } from "lucide-react";
|
|
9
9
|
import { useCallback, useState } from "react";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { Icon } from "@iconify/react";
|
|
12
12
|
|
|
13
13
|
//#region src/icon-selector/IconPicker.tsx
|
|
14
|
-
const
|
|
14
|
+
const ICON_SIZE = "!h-4 !w-4";
|
|
15
|
+
const IconPicker = ({ value, onChange, onOpenChange, pickerMode = "dialog", popoverProps, variant = "default", providers: providersProp, showValueText = true, emptyText = /* @__PURE__ */ jsx(Plus, { className: ICON_SIZE }), showClearButton = true, slots }) => {
|
|
15
16
|
const [isOpen, setIsOpen] = useState(false);
|
|
16
17
|
const isMobile = useMediaQuery({ maxWidth: 768 });
|
|
17
18
|
const handleSelectIcon = useCallback((iconName) => {
|
|
@@ -56,19 +57,16 @@ const IconPicker = ({ value, onChange, onOpenChange, pickerMode = "dialog", popo
|
|
|
56
57
|
isOpen,
|
|
57
58
|
setIsOpen,
|
|
58
59
|
selectorContent,
|
|
59
|
-
popover,
|
|
60
|
-
children: /* @__PURE__ */ jsxs(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"aria-label": iconButtonLabel,
|
|
67
|
-
children: iconButtonContent
|
|
68
|
-
}), shouldShowClearButton && /* @__PURE__ */ jsx(Button$1, {
|
|
60
|
+
popover: popoverProps,
|
|
61
|
+
children: /* @__PURE__ */ jsxs(Button$1, {
|
|
62
|
+
type: "button",
|
|
63
|
+
variant: "outline",
|
|
64
|
+
"aria-label": iconButtonLabel,
|
|
65
|
+
className: cn("p-2 min-w-10", slots?.preview?.className),
|
|
66
|
+
children: [iconButtonContent, shouldShowClearButton && /* @__PURE__ */ jsx(Button$1, {
|
|
69
67
|
type: "button",
|
|
70
68
|
title: "Clear selected icon",
|
|
71
|
-
className: cn(
|
|
69
|
+
className: cn(`absolute -right-1 -top-1 inline-flex ${ICON_SIZE} items-center justify-center rounded-full !p-1`, "border border-border bg-background text-foreground", "hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", slots?.clearIcon?.className),
|
|
72
70
|
"aria-label": "Clear icon",
|
|
73
71
|
onClick: (event) => {
|
|
74
72
|
event.preventDefault();
|
|
@@ -80,12 +78,12 @@ const IconPicker = ({ value, onChange, onOpenChange, pickerMode = "dialog", popo
|
|
|
80
78
|
})
|
|
81
79
|
});
|
|
82
80
|
return /* @__PURE__ */ jsxs("div", {
|
|
83
|
-
className: "flex items-center gap-2",
|
|
81
|
+
className: cn("flex items-center gap-2", slots?.root?.className),
|
|
84
82
|
children: [
|
|
85
83
|
/* @__PURE__ */ jsxs("div", {
|
|
86
|
-
className: "flex items-center gap-2 rounded-md border border-input bg-background px-3 py-2",
|
|
84
|
+
className: cn("flex items-center gap-2 rounded-md border border-input bg-background px-3 py-2", slots?.preview?.className),
|
|
87
85
|
children: [displayIcon, showValueText && hasValue && /* @__PURE__ */ jsx("span", {
|
|
88
|
-
className: "text-sm text-muted-foreground",
|
|
86
|
+
className: cn("text-sm text-muted-foreground", slots?.valueText?.className),
|
|
89
87
|
children: value
|
|
90
88
|
})]
|
|
91
89
|
}),
|
|
@@ -94,18 +92,18 @@ const IconPicker = ({ value, onChange, onOpenChange, pickerMode = "dialog", popo
|
|
|
94
92
|
isOpen,
|
|
95
93
|
setIsOpen,
|
|
96
94
|
selectorContent,
|
|
97
|
-
popover,
|
|
95
|
+
popover: popoverProps,
|
|
98
96
|
children: /* @__PURE__ */ jsx(Button$1, {
|
|
99
97
|
type: "button",
|
|
100
98
|
variant: "outline",
|
|
101
|
-
className: "whitespace-nowrap",
|
|
99
|
+
className: cn("whitespace-nowrap", slots?.trigger?.className),
|
|
102
100
|
children: hasValue ? "Change Icon" : "Select Icon"
|
|
103
101
|
})
|
|
104
102
|
}),
|
|
105
103
|
shouldShowClearButton && /* @__PURE__ */ jsx(Button$1, {
|
|
106
104
|
type: "button",
|
|
107
105
|
variant: "outline",
|
|
108
|
-
className: "whitespace-nowrap",
|
|
106
|
+
className: cn("whitespace-nowrap", slots?.clearButton?.className),
|
|
109
107
|
onClick: handleClearIcon,
|
|
110
108
|
children: "Clear"
|
|
111
109
|
})
|
|
@@ -22,11 +22,17 @@ const IconPickerContainer = ({ effectiveMode, isOpen, setIsOpen, selectorContent
|
|
|
22
22
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.PopoverTrigger, {
|
|
23
23
|
asChild: true,
|
|
24
24
|
children
|
|
25
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.
|
|
25
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.PopoverContent, {
|
|
26
26
|
side: "right",
|
|
27
27
|
...popover,
|
|
28
28
|
className: (0, __pixpilot_shadcn.cn)("w-full min-w-sm lg:min-w-lg p-4", "max-h-dvh md:max-h-auto", popover?.className),
|
|
29
|
-
children:
|
|
29
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
30
|
+
className: "mb-4",
|
|
31
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
|
|
32
|
+
className: "text-lg font-semibold",
|
|
33
|
+
children: "Select an Icon"
|
|
34
|
+
})
|
|
35
|
+
}), selectorContent]
|
|
30
36
|
})]
|
|
31
37
|
})] });
|
|
32
38
|
};
|
|
@@ -19,11 +19,17 @@ const IconPickerContainer = ({ effectiveMode, isOpen, setIsOpen, selectorContent
|
|
|
19
19
|
children: [/* @__PURE__ */ jsx(PopoverTrigger, {
|
|
20
20
|
asChild: true,
|
|
21
21
|
children
|
|
22
|
-
}), /* @__PURE__ */
|
|
22
|
+
}), /* @__PURE__ */ jsxs(PopoverContent, {
|
|
23
23
|
side: "right",
|
|
24
24
|
...popover,
|
|
25
25
|
className: cn("w-full min-w-sm lg:min-w-lg p-4", "max-h-dvh md:max-h-auto", popover?.className),
|
|
26
|
-
children:
|
|
26
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
27
|
+
className: "mb-4",
|
|
28
|
+
children: /* @__PURE__ */ jsx("h3", {
|
|
29
|
+
className: "text-lg font-semibold",
|
|
30
|
+
children: "Select an Icon"
|
|
31
|
+
})
|
|
32
|
+
}), selectorContent]
|
|
27
33
|
})]
|
|
28
34
|
})] });
|
|
29
35
|
};
|
package/dist/input/Input.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime7 from "react/jsx-runtime";
|
|
2
2
|
import { InputProps } from "@pixpilot/shadcn";
|
|
3
3
|
import * as React$1 from "react";
|
|
4
4
|
|
|
@@ -10,6 +10,6 @@ type InputProps$1 = InputProps & {
|
|
|
10
10
|
prefixClassName?: string;
|
|
11
11
|
suffixClassName?: string;
|
|
12
12
|
};
|
|
13
|
-
declare function Input(props: InputProps$1):
|
|
13
|
+
declare function Input(props: InputProps$1): react_jsx_runtime7.JSX.Element;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { Input, InputProps$1 as InputProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime10 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/theme-toggle/ThemeModeDropdown.d.ts
|
|
4
4
|
interface ThemeModeDropdownProps {
|
|
@@ -17,7 +17,7 @@ interface ThemeModeDropdownProps {
|
|
|
17
17
|
* Provides Light / Dark / System options.
|
|
18
18
|
* Pure component - requires themeValue and onChange props.
|
|
19
19
|
*/
|
|
20
|
-
declare function ThemeModeDropdown(props: ThemeModeDropdownProps):
|
|
20
|
+
declare function ThemeModeDropdown(props: ThemeModeDropdownProps): react_jsx_runtime10.JSX.Element;
|
|
21
21
|
declare namespace ThemeModeDropdown {
|
|
22
22
|
var displayName: string;
|
|
23
23
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime11 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/theme-toggle/ThemeModeSwitchInside.d.ts
|
|
4
4
|
type ThemeModeSwitchInsideSize = 'sm' | 'md' | 'lg';
|
|
@@ -25,7 +25,7 @@ interface ThemeModeSwitchInsideProps {
|
|
|
25
25
|
* Icons are embedded within the switch control.
|
|
26
26
|
* Pure component - requires value and onChange props.
|
|
27
27
|
*/
|
|
28
|
-
declare function ThemeModeSwitchInside(props: ThemeModeSwitchInsideProps):
|
|
28
|
+
declare function ThemeModeSwitchInside(props: ThemeModeSwitchInsideProps): react_jsx_runtime11.JSX.Element;
|
|
29
29
|
declare namespace ThemeModeSwitchInside {
|
|
30
30
|
var displayName: string;
|
|
31
31
|
}
|
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.31.1",
|
|
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",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"tsdown": "^0.15.12",
|
|
59
59
|
"typescript": "^5.9.3",
|
|
60
60
|
"@internal/eslint-config": "0.3.0",
|
|
61
|
-
"@internal/prettier-config": "0.0.1",
|
|
62
61
|
"@internal/hooks": "0.0.0",
|
|
62
|
+
"@internal/prettier-config": "0.0.1",
|
|
63
63
|
"@internal/tsconfig": "0.1.0",
|
|
64
64
|
"@internal/tsdown-config": "0.1.0",
|
|
65
65
|
"@internal/vitest-config": "0.1.0"
|