@pixpilot/shadcn-ui 1.23.0 → 1.25.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/AbsoluteFill.d.cts +2 -2
- package/dist/Alert.cjs +21 -17
- package/dist/Alert.js +21 -17
- package/dist/Button.d.cts +2 -2
- package/dist/ButtonExtended.d.cts +2 -2
- 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 +3 -2
- 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/ContentCard.d.cts +2 -2
- package/dist/ContentCard.d.ts +2 -2
- package/dist/DatePicker.cjs +2 -1
- package/dist/DatePicker.d.cts +3 -2
- package/dist/DatePicker.d.ts +3 -2
- 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 +4 -3
- package/dist/Rating.d.ts +4 -3
- package/dist/Rating.js +7 -2
- package/dist/Select.cjs +1 -1
- package/dist/Select.d.cts +2 -2
- package/dist/Select.js +1 -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.cts +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-root/FileUploadRoot.cjs +3 -1
- package/dist/file-upload-root/FileUploadRoot.d.cts +2 -2
- 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/input/Input.d.ts +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 +4 -2
- package/dist/tags-input/TagsInput.d.ts +2 -0
- 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
package/dist/Rating.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime5 from "react/jsx-runtime";
|
|
2
2
|
import * as React$1 from "react";
|
|
3
3
|
import { VariantProps } from "class-variance-authority";
|
|
4
4
|
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
@@ -35,7 +35,7 @@ declare function RatingButton({
|
|
|
35
35
|
index,
|
|
36
36
|
className,
|
|
37
37
|
...props
|
|
38
|
-
}: RatingButtonProps):
|
|
38
|
+
}: RatingButtonProps): react_jsx_runtime5.JSX.Element;
|
|
39
39
|
declare function Rating({
|
|
40
40
|
value: valueProp,
|
|
41
41
|
defaultValue,
|
|
@@ -51,7 +51,8 @@ declare function Rating({
|
|
|
51
51
|
color,
|
|
52
52
|
className,
|
|
53
53
|
children,
|
|
54
|
+
id,
|
|
54
55
|
...props
|
|
55
|
-
}: React$1.PropsWithChildren<RatingProps>):
|
|
56
|
+
}: React$1.PropsWithChildren<RatingProps>): react_jsx_runtime5.JSX.Element;
|
|
56
57
|
//#endregion
|
|
57
58
|
export { Rating, RatingButton, RatingButtonProps, RatingColor, RatingOption, RatingProps };
|
package/dist/Rating.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime5 from "react/jsx-runtime";
|
|
3
3
|
import { VariantProps } from "class-variance-authority";
|
|
4
4
|
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
5
5
|
|
|
@@ -35,7 +35,7 @@ declare function RatingButton({
|
|
|
35
35
|
index,
|
|
36
36
|
className,
|
|
37
37
|
...props
|
|
38
|
-
}: RatingButtonProps):
|
|
38
|
+
}: RatingButtonProps): react_jsx_runtime5.JSX.Element;
|
|
39
39
|
declare function Rating({
|
|
40
40
|
value: valueProp,
|
|
41
41
|
defaultValue,
|
|
@@ -51,7 +51,8 @@ declare function Rating({
|
|
|
51
51
|
color,
|
|
52
52
|
className,
|
|
53
53
|
children,
|
|
54
|
+
id,
|
|
54
55
|
...props
|
|
55
|
-
}: React$1.PropsWithChildren<RatingProps>):
|
|
56
|
+
}: React$1.PropsWithChildren<RatingProps>): react_jsx_runtime5.JSX.Element;
|
|
56
57
|
//#endregion
|
|
57
58
|
export { Rating, RatingButton, RatingButtonProps, RatingColor, RatingOption, RatingProps };
|
package/dist/Rating.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getId } from "./utils/get-id.js";
|
|
1
2
|
import { cn } from "@pixpilot/shadcn";
|
|
2
3
|
import { Circle, Star } from "lucide-react";
|
|
3
4
|
import * as React$1 from "react";
|
|
@@ -118,7 +119,7 @@ function RatingButton({ index, className,...props }) {
|
|
|
118
119
|
}) : null]
|
|
119
120
|
});
|
|
120
121
|
}
|
|
121
|
-
function Rating({ value: valueProp, defaultValue, onValueChange, options: optionsProp, max: maxProp = DEFAULT_MAX_RATING, iconType = "star", size = "default", readOnly = false, disabled = false, name, required, color = "default", className, children,...props }) {
|
|
122
|
+
function Rating({ value: valueProp, defaultValue, onValueChange, options: optionsProp, max: maxProp = DEFAULT_MAX_RATING, iconType = "star", size = "default", readOnly = false, disabled = false, name, required, color = "default", className, children, id,...props }) {
|
|
122
123
|
const isControlled = valueProp !== void 0;
|
|
123
124
|
const [internalValue, setInternalValue] = React$1.useState(defaultValue ?? 0);
|
|
124
125
|
const [hoverIndex, setHoverIndex] = React$1.useState(0);
|
|
@@ -179,12 +180,16 @@ function Rating({ value: valueProp, defaultValue, onValueChange, options: option
|
|
|
179
180
|
return /* @__PURE__ */ jsx(RatingContext, {
|
|
180
181
|
value: contextValue,
|
|
181
182
|
children: /* @__PURE__ */ jsxs("div", {
|
|
183
|
+
id: getId(id, "rating-group"),
|
|
182
184
|
role: "radiogroup",
|
|
183
185
|
tabIndex: 0,
|
|
184
186
|
className: cn(ratingVariants({ size }), className),
|
|
185
187
|
onMouseLeave: handleMouseLeave,
|
|
186
188
|
...props,
|
|
187
|
-
children: [children ?? Array.from({ length: max }, (_, index) => /* @__PURE__ */ jsx(RatingButton, {
|
|
189
|
+
children: [children ?? Array.from({ length: max }, (_, index) => /* @__PURE__ */ jsx(RatingButton, {
|
|
190
|
+
id: index === 0 ? id : getId(id, `option-${index + 1}`),
|
|
191
|
+
index: index + 1
|
|
192
|
+
}, index)), hasNameText ? /* @__PURE__ */ jsx("input", {
|
|
188
193
|
type: "hidden",
|
|
189
194
|
name: nameTextOrEmpty,
|
|
190
195
|
value: value || "",
|
package/dist/Select.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_use_select_keyboard = require('./hooks/use-select-keyboard.cjs');
|
|
3
2
|
const require_get_id = require('./utils/get-id.cjs');
|
|
3
|
+
const require_use_select_keyboard = require('./hooks/use-select-keyboard.cjs');
|
|
4
4
|
let __pixpilot_shadcn = require("@pixpilot/shadcn");
|
|
5
5
|
__pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
|
|
6
6
|
let lucide_react = require("lucide-react");
|
package/dist/Select.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime7 from "react/jsx-runtime";
|
|
2
2
|
import { Select, SelectContent } from "@pixpilot/shadcn";
|
|
3
3
|
import React, { ComponentProps } from "react";
|
|
4
4
|
|
|
@@ -51,6 +51,6 @@ type BaseSelectProps = {
|
|
|
51
51
|
required?: boolean;
|
|
52
52
|
className?: string;
|
|
53
53
|
} & Omit<ComponentProps<typeof Select>, 'value' | 'onValueChange' | 'children' | 'disabled' | 'name' | 'required'>;
|
|
54
|
-
declare function Select$1(props: BaseSelectProps):
|
|
54
|
+
declare function Select$1(props: BaseSelectProps): react_jsx_runtime7.JSX.Element;
|
|
55
55
|
//#endregion
|
|
56
56
|
export { Select$1 as Select, SelectContentProps, SelectOption };
|
package/dist/Select.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useSelectKeyboard } from "./hooks/use-select-keyboard.js";
|
|
2
1
|
import { getId } from "./utils/get-id.js";
|
|
2
|
+
import { useSelectKeyboard } from "./hooks/use-select-keyboard.js";
|
|
3
3
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, cn } from "@pixpilot/shadcn";
|
|
4
4
|
import { XIcon } from "lucide-react";
|
|
5
5
|
import React from "react";
|
|
@@ -27,7 +27,7 @@ const sizeClasses = {
|
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
const AvatarUpload = (props) => {
|
|
30
|
-
const { className, messages, value, onAccept, onFileSuccess, onFileError, onChange, size = "md", clearable = true,...rest } = props;
|
|
30
|
+
const { className, messages, value, onAccept, onFileSuccess, onFileError, onChange, size = "md", clearable = true, id,...rest } = props;
|
|
31
31
|
const { upload = "Upload", change = "Change" } = messages || {};
|
|
32
32
|
const hasValue = value != null && Object.keys(value).length > 0;
|
|
33
33
|
const currentSize = sizeClasses[size];
|
|
@@ -56,6 +56,7 @@ const AvatarUpload = (props) => {
|
|
|
56
56
|
accept: "image/*",
|
|
57
57
|
"data-slots": "avatar-upload",
|
|
58
58
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.FileUploadDropzone, {
|
|
59
|
+
id,
|
|
59
60
|
className: require_utils.cn(error != null && "border-red-500", currentSize.dropZone),
|
|
60
61
|
children: selectedFile != null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.FileUploadList, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_AvatarUploadItem.AvatarUploadItem, {
|
|
61
62
|
file: selectedFile.file,
|
|
@@ -65,10 +66,12 @@ const AvatarUpload = (props) => {
|
|
|
65
66
|
onError: setError,
|
|
66
67
|
onFileError,
|
|
67
68
|
onClear: showClearButton ? handleClear : void 0,
|
|
68
|
-
size
|
|
69
|
+
size,
|
|
70
|
+
id
|
|
69
71
|
}, selectedFile.id) }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_AvatarUploadComponents.MainWrapper, {
|
|
70
72
|
currentSize,
|
|
71
73
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_AvatarUploadComponents.AvatarWrap, {
|
|
74
|
+
id,
|
|
72
75
|
showChangeIcon: hasValue,
|
|
73
76
|
onClear: showClearButton ? handleClear : void 0,
|
|
74
77
|
size,
|
|
@@ -22,7 +22,7 @@ const sizeClasses = {
|
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
const AvatarUpload = (props) => {
|
|
25
|
-
const { className, messages, value, onAccept, onFileSuccess, onFileError, onChange, size = "md", clearable = true,...rest } = props;
|
|
25
|
+
const { className, messages, value, onAccept, onFileSuccess, onFileError, onChange, size = "md", clearable = true, id,...rest } = props;
|
|
26
26
|
const { upload = "Upload", change = "Change" } = messages || {};
|
|
27
27
|
const hasValue = value != null && Object.keys(value).length > 0;
|
|
28
28
|
const currentSize = sizeClasses[size];
|
|
@@ -51,6 +51,7 @@ const AvatarUpload = (props) => {
|
|
|
51
51
|
accept: "image/*",
|
|
52
52
|
"data-slots": "avatar-upload",
|
|
53
53
|
children: /* @__PURE__ */ jsx(FileUploadDropzone, {
|
|
54
|
+
id,
|
|
54
55
|
className: cn$1(error != null && "border-red-500", currentSize.dropZone),
|
|
55
56
|
children: selectedFile != null ? /* @__PURE__ */ jsx(FileUploadList, { children: /* @__PURE__ */ jsx(AvatarUploadItem, {
|
|
56
57
|
file: selectedFile.file,
|
|
@@ -60,10 +61,12 @@ const AvatarUpload = (props) => {
|
|
|
60
61
|
onError: setError,
|
|
61
62
|
onFileError,
|
|
62
63
|
onClear: showClearButton ? handleClear : void 0,
|
|
63
|
-
size
|
|
64
|
+
size,
|
|
65
|
+
id
|
|
64
66
|
}, selectedFile.id) }) : /* @__PURE__ */ jsxs(MainWrapper, {
|
|
65
67
|
currentSize,
|
|
66
68
|
children: [/* @__PURE__ */ jsx(AvatarWrap, {
|
|
69
|
+
id,
|
|
67
70
|
showChangeIcon: hasValue,
|
|
68
71
|
onClear: showClearButton ? handleClear : void 0,
|
|
69
72
|
size,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_get_id = require('../utils/get-id.cjs');
|
|
2
3
|
const require_utils = require('../shadcn/src/lib/utils.cjs');
|
|
3
4
|
let __pixpilot_shadcn = require("@pixpilot/shadcn");
|
|
4
5
|
__pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
|
|
@@ -16,7 +17,7 @@ const MessageComponent = ({ message, className }) => {
|
|
|
16
17
|
children: message
|
|
17
18
|
});
|
|
18
19
|
};
|
|
19
|
-
const AvatarWrap = ({ children, className, showChangeIcon, size, onClear }) => {
|
|
20
|
+
const AvatarWrap = ({ id, children, className, showChangeIcon, size, onClear }) => {
|
|
20
21
|
const editIcon = {
|
|
21
22
|
sm: "size-5.5 bottom-0 right-0",
|
|
22
23
|
md: "size-6.5 bottom-1 right-1",
|
|
@@ -37,6 +38,7 @@ const AvatarWrap = ({ children, className, showChangeIcon, size, onClear }) => {
|
|
|
37
38
|
children,
|
|
38
39
|
showChangeIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Pencil, { className: require_utils.cn(editIcon[size], `absolute bg-secondary text-secondary-foreground rounded-full p-1.5 shadow-md`) }),
|
|
39
40
|
onClear != null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.Button, {
|
|
41
|
+
id: require_get_id.getId(id, "clear-button"),
|
|
40
42
|
type: "button",
|
|
41
43
|
variant: "secondary",
|
|
42
44
|
size: "icon",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getId } from "../utils/get-id.js";
|
|
1
2
|
import { cn as cn$1 } from "../shadcn/src/lib/utils.js";
|
|
2
3
|
import { Button } from "@pixpilot/shadcn";
|
|
3
4
|
import { Pencil, X } from "lucide-react";
|
|
@@ -11,7 +12,7 @@ const MessageComponent = ({ message, className }) => {
|
|
|
11
12
|
children: message
|
|
12
13
|
});
|
|
13
14
|
};
|
|
14
|
-
const AvatarWrap = ({ children, className, showChangeIcon, size, onClear }) => {
|
|
15
|
+
const AvatarWrap = ({ id, children, className, showChangeIcon, size, onClear }) => {
|
|
15
16
|
const editIcon = {
|
|
16
17
|
sm: "size-5.5 bottom-0 right-0",
|
|
17
18
|
md: "size-6.5 bottom-1 right-1",
|
|
@@ -32,6 +33,7 @@ const AvatarWrap = ({ children, className, showChangeIcon, size, onClear }) => {
|
|
|
32
33
|
children,
|
|
33
34
|
showChangeIcon && /* @__PURE__ */ jsx(Pencil, { className: cn$1(editIcon[size], `absolute bg-secondary text-secondary-foreground rounded-full p-1.5 shadow-md`) }),
|
|
34
35
|
onClear != null && /* @__PURE__ */ jsx(Button, {
|
|
36
|
+
id: getId(id, "clear-button"),
|
|
35
37
|
type: "button",
|
|
36
38
|
variant: "secondary",
|
|
37
39
|
size: "icon",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_get_id = require('../utils/get-id.cjs');
|
|
2
3
|
const require_use_file_error = require('../file-upload/hooks/use-file-error.cjs');
|
|
3
4
|
const require_use_file_upload_progress_callbacks = require('../file-upload/hooks/use-file-upload-progress-callbacks.cjs');
|
|
4
5
|
require('../file-upload/index.cjs');
|
|
@@ -14,7 +15,7 @@ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
|
14
15
|
|
|
15
16
|
//#region src/avatar-upload/AvatarUploadItem.tsx
|
|
16
17
|
const AvatarUploadItem = (props) => {
|
|
17
|
-
const { file, currentSize, change = "Change", onFileSuccess, onFileError, onClear, onError, size = "md" } = props;
|
|
18
|
+
const { file, currentSize, change = "Change", id, onFileSuccess, onFileError, onClear, onError, size = "md" } = props;
|
|
18
19
|
require_use_file_upload_progress_callbacks.useFileUploadProgressCallbacks(file, {
|
|
19
20
|
onFileSuccess,
|
|
20
21
|
onFileError
|
|
@@ -39,6 +40,7 @@ const AvatarUploadItem = (props) => {
|
|
|
39
40
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
40
41
|
className: (0, __pixpilot_shadcn.cn)("relative"),
|
|
41
42
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_AvatarUploadComponents.AvatarWrap, {
|
|
43
|
+
id,
|
|
42
44
|
showChangeIcon: true,
|
|
43
45
|
onClear,
|
|
44
46
|
size,
|
|
@@ -46,6 +48,7 @@ const AvatarUploadItem = (props) => {
|
|
|
46
48
|
}), fileError != null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.TooltipProvider, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.Tooltip, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.TooltipTrigger, {
|
|
47
49
|
asChild: true,
|
|
48
50
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
51
|
+
id: require_get_id.getId(id, "error-button"),
|
|
49
52
|
type: "button",
|
|
50
53
|
className: "absolute -top-3 -left-3 p-1",
|
|
51
54
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.AlertCircle, { className: "h-5 w-5 text-red-500" })
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getId } from "../utils/get-id.js";
|
|
1
2
|
import { useFileError } from "../file-upload/hooks/use-file-error.js";
|
|
2
3
|
import { useFileUploadProgressCallbacks } from "../file-upload/hooks/use-file-upload-progress-callbacks.js";
|
|
3
4
|
import "../file-upload/index.js";
|
|
@@ -9,7 +10,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
9
10
|
|
|
10
11
|
//#region src/avatar-upload/AvatarUploadItem.tsx
|
|
11
12
|
const AvatarUploadItem = (props) => {
|
|
12
|
-
const { file, currentSize, change = "Change", onFileSuccess, onFileError, onClear, onError, size = "md" } = props;
|
|
13
|
+
const { file, currentSize, change = "Change", id, onFileSuccess, onFileError, onClear, onError, size = "md" } = props;
|
|
13
14
|
useFileUploadProgressCallbacks(file, {
|
|
14
15
|
onFileSuccess,
|
|
15
16
|
onFileError
|
|
@@ -34,6 +35,7 @@ const AvatarUploadItem = (props) => {
|
|
|
34
35
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
35
36
|
className: cn("relative"),
|
|
36
37
|
children: [/* @__PURE__ */ jsx(AvatarWrap, {
|
|
38
|
+
id,
|
|
37
39
|
showChangeIcon: true,
|
|
38
40
|
onClear,
|
|
39
41
|
size,
|
|
@@ -41,6 +43,7 @@ const AvatarUploadItem = (props) => {
|
|
|
41
43
|
}), fileError != null && /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
42
44
|
asChild: true,
|
|
43
45
|
children: /* @__PURE__ */ jsx("button", {
|
|
46
|
+
id: getId(id, "error-button"),
|
|
44
47
|
type: "button",
|
|
45
48
|
className: "absolute -top-3 -left-3 p-1",
|
|
46
49
|
children: /* @__PURE__ */ jsx(AlertCircle, { className: "h-5 w-5 text-red-500" })
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_get_id = require('../utils/get-id.cjs');
|
|
2
3
|
const require_variant_config = require('../variant-config.cjs');
|
|
3
4
|
let __pixpilot_shadcn = require("@pixpilot/shadcn");
|
|
4
5
|
__pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
|
|
@@ -15,7 +16,7 @@ const variantMap = {
|
|
|
15
16
|
default: "default"
|
|
16
17
|
};
|
|
17
18
|
const ConfirmationDialog = __ebay_nice_modal_react.default.create((props) => {
|
|
18
|
-
const { title = "Confirmation Dialog", variant, showIcon = true } = props;
|
|
19
|
+
const { id, title = "Confirmation Dialog", variant, showIcon = true } = props;
|
|
19
20
|
const modal = (0, __ebay_nice_modal_react.useModal)();
|
|
20
21
|
const handleConfirm = () => {
|
|
21
22
|
props.onConfirm?.();
|
|
@@ -54,11 +55,13 @@ const ConfirmationDialog = __ebay_nice_modal_react.default.create((props) => {
|
|
|
54
55
|
children: props.description
|
|
55
56
|
})]
|
|
56
57
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.DialogFooter, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.Button, {
|
|
58
|
+
id: require_get_id.getId(id, "cancel-button"),
|
|
57
59
|
"data-slots": "button-cancel",
|
|
58
60
|
variant: "outline",
|
|
59
61
|
onClick: handleCancel,
|
|
60
62
|
children: props.cancelText ?? "Cancel"
|
|
61
63
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.Button, {
|
|
64
|
+
id,
|
|
62
65
|
"data-slots": "button-confirm",
|
|
63
66
|
variant: confirmBtnVariant,
|
|
64
67
|
className: confirmBtnClassName,
|
|
@@ -3,6 +3,7 @@ import "react";
|
|
|
3
3
|
//#region src/confirmation-dialog/ConfirmationDialog.d.ts
|
|
4
4
|
type ConfirmationDialogVariant = 'destructive' | 'warning' | 'primary' | 'default';
|
|
5
5
|
interface ConfirmationDialogProps {
|
|
6
|
+
id?: string;
|
|
6
7
|
title: string;
|
|
7
8
|
description?: string | React.ReactNode;
|
|
8
9
|
confirmText?: string;
|
|
@@ -4,6 +4,7 @@ import "@ebay/nice-modal-react";
|
|
|
4
4
|
//#region src/confirmation-dialog/ConfirmationDialog.d.ts
|
|
5
5
|
type ConfirmationDialogVariant = 'destructive' | 'warning' | 'primary' | 'default';
|
|
6
6
|
interface ConfirmationDialogProps {
|
|
7
|
+
id?: string;
|
|
7
8
|
title: string;
|
|
8
9
|
description?: string | React.ReactNode;
|
|
9
10
|
confirmText?: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getId } from "../utils/get-id.js";
|
|
1
2
|
import { variantConfig } from "../variant-config.js";
|
|
2
3
|
import { Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, cn } from "@pixpilot/shadcn";
|
|
3
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -11,7 +12,7 @@ const variantMap = {
|
|
|
11
12
|
default: "default"
|
|
12
13
|
};
|
|
13
14
|
const ConfirmationDialog = NiceModal.create((props) => {
|
|
14
|
-
const { title = "Confirmation Dialog", variant, showIcon = true } = props;
|
|
15
|
+
const { id, title = "Confirmation Dialog", variant, showIcon = true } = props;
|
|
15
16
|
const modal = useModal();
|
|
16
17
|
const handleConfirm = () => {
|
|
17
18
|
props.onConfirm?.();
|
|
@@ -50,11 +51,13 @@ const ConfirmationDialog = NiceModal.create((props) => {
|
|
|
50
51
|
children: props.description
|
|
51
52
|
})]
|
|
52
53
|
}), /* @__PURE__ */ jsxs(DialogFooter, { children: [/* @__PURE__ */ jsx(Button, {
|
|
54
|
+
id: getId(id, "cancel-button"),
|
|
53
55
|
"data-slots": "button-cancel",
|
|
54
56
|
variant: "outline",
|
|
55
57
|
onClick: handleCancel,
|
|
56
58
|
children: props.cancelText ?? "Cancel"
|
|
57
59
|
}), /* @__PURE__ */ jsx(Button, {
|
|
60
|
+
id,
|
|
58
61
|
"data-slots": "button-confirm",
|
|
59
62
|
variant: confirmBtnVariant,
|
|
60
63
|
className: confirmBtnClassName,
|
package/dist/dialog/Dialog.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime8 from "react/jsx-runtime";
|
|
2
2
|
import { DialogContent } from "@pixpilot/shadcn";
|
|
3
3
|
import * as React$1 from "react";
|
|
4
4
|
import * as _radix_ui_react_dialog0 from "@radix-ui/react-dialog";
|
|
@@ -13,14 +13,14 @@ declare const DialogContent$1: React$1.ForwardRefExoticComponent<Omit<_radix_ui_
|
|
|
13
13
|
declare function DialogHeader({
|
|
14
14
|
className,
|
|
15
15
|
...props
|
|
16
|
-
}: React$1.HTMLAttributes<HTMLDivElement>):
|
|
16
|
+
}: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime8.JSX.Element;
|
|
17
17
|
declare function DialogBody({
|
|
18
18
|
className,
|
|
19
19
|
...props
|
|
20
|
-
}: React$1.HTMLAttributes<HTMLDivElement>):
|
|
20
|
+
}: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime8.JSX.Element;
|
|
21
21
|
declare function DialogFooter({
|
|
22
22
|
className,
|
|
23
23
|
...props
|
|
24
|
-
}: React$1.HTMLAttributes<HTMLDivElement>):
|
|
24
|
+
}: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime8.JSX.Element;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { DialogBody, DialogContent$1 as DialogContent, DialogContentProps, DialogFooter, DialogHeader };
|
|
@@ -12,7 +12,7 @@ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
|
12
12
|
|
|
13
13
|
//#region src/file-upload/FileUpload.tsx
|
|
14
14
|
function FileUpload(props) {
|
|
15
|
-
const { value, onChange, className, onAccept, maxFiles, preventDuplicates, onFileReject, onFileSuccess, onFileError,...rest } = props;
|
|
15
|
+
const { value, onChange, className, onAccept, maxFiles, preventDuplicates, onFileReject, onFileSuccess, onFileError, id,...rest } = props;
|
|
16
16
|
const multiple = props.multiple ?? true;
|
|
17
17
|
const { handleAccept, displayFiles, deleteFile, getFile, orgValue } = require_use_file_upload_store.useFileUploadStore({
|
|
18
18
|
value,
|
|
@@ -38,6 +38,7 @@ function FileUpload(props) {
|
|
|
38
38
|
multiple,
|
|
39
39
|
className: (0, __pixpilot_shadcn.cn)("w-full", className),
|
|
40
40
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.FileUploadDropzone, {
|
|
41
|
+
id,
|
|
41
42
|
className: containerClasses,
|
|
42
43
|
children: displayFiles.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
43
44
|
className: "flex flex-col items-center gap-1 text-center p-2",
|
|
@@ -63,6 +64,7 @@ function FileUpload(props) {
|
|
|
63
64
|
itemSize,
|
|
64
65
|
onFileSuccess,
|
|
65
66
|
onFileError,
|
|
67
|
+
id,
|
|
66
68
|
className: containerClasses
|
|
67
69
|
})
|
|
68
70
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FileUploadProps } from "./types/index.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime14 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_runtime14.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { FileUpload };
|
|
@@ -7,7 +7,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
7
7
|
|
|
8
8
|
//#region src/file-upload/FileUpload.tsx
|
|
9
9
|
function FileUpload$1(props) {
|
|
10
|
-
const { value, onChange, className, onAccept, maxFiles, preventDuplicates, onFileReject, onFileSuccess, onFileError,...rest } = props;
|
|
10
|
+
const { value, onChange, className, onAccept, maxFiles, preventDuplicates, onFileReject, onFileSuccess, onFileError, id,...rest } = props;
|
|
11
11
|
const multiple = props.multiple ?? true;
|
|
12
12
|
const { handleAccept, displayFiles, deleteFile, getFile, orgValue } = useFileUploadStore({
|
|
13
13
|
value,
|
|
@@ -33,6 +33,7 @@ function FileUpload$1(props) {
|
|
|
33
33
|
multiple,
|
|
34
34
|
className: cn("w-full", className),
|
|
35
35
|
children: /* @__PURE__ */ jsx(FileUploadDropzone, {
|
|
36
|
+
id,
|
|
36
37
|
className: containerClasses,
|
|
37
38
|
children: displayFiles.length === 0 ? /* @__PURE__ */ jsxs("div", {
|
|
38
39
|
className: "flex flex-col items-center gap-1 text-center p-2",
|
|
@@ -58,6 +59,7 @@ function FileUpload$1(props) {
|
|
|
58
59
|
itemSize,
|
|
59
60
|
onFileSuccess,
|
|
60
61
|
onFileError,
|
|
62
|
+
id,
|
|
61
63
|
className: containerClasses
|
|
62
64
|
})
|
|
63
65
|
})
|
|
@@ -11,7 +11,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
11
11
|
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
12
12
|
|
|
13
13
|
//#region src/file-upload/FileUploadItems.tsx
|
|
14
|
-
function FileUploadItems({ displayFiles, deleteFile, getFile, maxFiles, itemSize, onFileSuccess, onFileError, className }) {
|
|
14
|
+
function FileUploadItems({ id, displayFiles, deleteFile, getFile, maxFiles, itemSize, onFileSuccess, onFileError, className }) {
|
|
15
15
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.FileUploadList, {
|
|
16
16
|
orientation: "horizontal",
|
|
17
17
|
forceMount: true,
|
|
@@ -20,6 +20,7 @@ function FileUploadItems({ displayFiles, deleteFile, getFile, maxFiles, itemSize
|
|
|
20
20
|
const { name, lastModified } = fileMeta;
|
|
21
21
|
const key = `${name}-${lastModified}`;
|
|
22
22
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FileUploadListItem.FileUploadListItem, {
|
|
23
|
+
id,
|
|
23
24
|
fileMeta,
|
|
24
25
|
deleteFile,
|
|
25
26
|
getFile,
|
|
@@ -7,7 +7,7 @@ import { Plus } from "lucide-react";
|
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
|
|
9
9
|
//#region src/file-upload/FileUploadItems.tsx
|
|
10
|
-
function FileUploadItems({ displayFiles, deleteFile, getFile, maxFiles, itemSize, onFileSuccess, onFileError, className }) {
|
|
10
|
+
function FileUploadItems({ id, displayFiles, deleteFile, getFile, maxFiles, itemSize, onFileSuccess, onFileError, className }) {
|
|
11
11
|
return /* @__PURE__ */ jsxs(FileUploadList, {
|
|
12
12
|
orientation: "horizontal",
|
|
13
13
|
forceMount: true,
|
|
@@ -16,6 +16,7 @@ function FileUploadItems({ displayFiles, deleteFile, getFile, maxFiles, itemSize
|
|
|
16
16
|
const { name, lastModified } = fileMeta;
|
|
17
17
|
const key = `${name}-${lastModified}`;
|
|
18
18
|
return /* @__PURE__ */ jsx(FileUploadListItem, {
|
|
19
|
+
id,
|
|
19
20
|
fileMeta,
|
|
20
21
|
deleteFile,
|
|
21
22
|
getFile,
|
|
@@ -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
|
const require_use_file_upload_progress_callbacks = require('./hooks/use-file-upload-progress-callbacks.cjs');
|
|
6
7
|
require('./hooks/index.cjs');
|
|
7
8
|
let __pixpilot_shadcn = require("@pixpilot/shadcn");
|
|
@@ -22,7 +23,7 @@ const Backdrop = ({ className, children }) => {
|
|
|
22
23
|
children
|
|
23
24
|
});
|
|
24
25
|
};
|
|
25
|
-
const FileUploadListItem = react.default.memo(({ fileMeta, deleteFile, getFile, itemSize, onFileSuccess, onFileError }) => {
|
|
26
|
+
const FileUploadListItem = react.default.memo(({ id, fileMeta, deleteFile, getFile, itemSize, onFileSuccess, onFileError }) => {
|
|
26
27
|
const file = getFile(fileMeta);
|
|
27
28
|
require_use_file_upload_progress_callbacks.useFileUploadProgressCallbacks(file, {
|
|
28
29
|
onFileSuccess,
|
|
@@ -74,6 +75,7 @@ const FileUploadListItem = react.default.memo(({ fileMeta, deleteFile, getFile,
|
|
|
74
75
|
})] })] }),
|
|
75
76
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.FileUploadItemMetadata, { className: "sr-only" }),
|
|
76
77
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.Button, {
|
|
78
|
+
id: require_get_id.getId(id, `remove-button-${fileMeta.name}-${fileMeta.lastModified}`),
|
|
77
79
|
type: "button",
|
|
78
80
|
variant: "secondary",
|
|
79
81
|
size: "icon",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
import { getId } from "../utils/get-id.js";
|
|
4
5
|
import { useFileUploadProgressCallbacks } from "./hooks/use-file-upload-progress-callbacks.js";
|
|
5
6
|
import "./hooks/index.js";
|
|
6
7
|
import { Button, FileUploadItem, FileUploadItemMetadata, FileUploadItemPreview, FileUploadItemProgress, Tooltip, TooltipContent, TooltipTrigger, cn, useFileUpload } from "@pixpilot/shadcn";
|
|
@@ -16,7 +17,7 @@ const Backdrop = ({ className, children }) => {
|
|
|
16
17
|
children
|
|
17
18
|
});
|
|
18
19
|
};
|
|
19
|
-
const FileUploadListItem = React.memo(({ fileMeta, deleteFile, getFile, itemSize, onFileSuccess, onFileError }) => {
|
|
20
|
+
const FileUploadListItem = React.memo(({ id, fileMeta, deleteFile, getFile, itemSize, onFileSuccess, onFileError }) => {
|
|
20
21
|
const file = getFile(fileMeta);
|
|
21
22
|
useFileUploadProgressCallbacks(file, {
|
|
22
23
|
onFileSuccess,
|
|
@@ -68,6 +69,7 @@ const FileUploadListItem = React.memo(({ fileMeta, deleteFile, getFile, itemSize
|
|
|
68
69
|
})] })] }),
|
|
69
70
|
/* @__PURE__ */ jsx(FileUploadItemMetadata, { className: "sr-only" }),
|
|
70
71
|
/* @__PURE__ */ jsx(Button, {
|
|
72
|
+
id: getId(id, `remove-button-${fileMeta.name}-${fileMeta.lastModified}`),
|
|
71
73
|
type: "button",
|
|
72
74
|
variant: "secondary",
|
|
73
75
|
size: "icon",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { FileUploadInlineProps } from "./types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime12 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_runtime12.JSX.Element;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { FileUploadInline };
|
|
@@ -17,7 +17,7 @@ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
|
17
17
|
* FileUploadInline - An inline file upload component using FileUpload primitives
|
|
18
18
|
*/
|
|
19
19
|
function FileUploadRoot(props) {
|
|
20
|
-
const { value, onChange, className, disabled, children, onAccept, maxFiles, preventDuplicates, slots, onFileSuccess, onFileError,...rest } = props;
|
|
20
|
+
const { value, onChange, className, disabled, children, onAccept, maxFiles, preventDuplicates, slots, onFileSuccess, onFileError, id,...rest } = props;
|
|
21
21
|
const multiple = props.multiple ?? false;
|
|
22
22
|
const effectiveMaxFiles = multiple ? maxFiles : 1;
|
|
23
23
|
const { handleAccept, displayFiles, deleteFile, getFile, orgValue } = require_use_file_upload_store.useFileUploadStore({
|
|
@@ -52,6 +52,7 @@ function FileUploadRoot(props) {
|
|
|
52
52
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.FileUploadTrigger, {
|
|
53
53
|
asChild: true,
|
|
54
54
|
...slots?.trigger || {},
|
|
55
|
+
id: id ?? slots?.trigger?.id,
|
|
55
56
|
children
|
|
56
57
|
})
|
|
57
58
|
}), displayFiles.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.FileUploadList, {
|
|
@@ -64,6 +65,7 @@ function FileUploadRoot(props) {
|
|
|
64
65
|
...data,
|
|
65
66
|
file: getFile(data),
|
|
66
67
|
disabled,
|
|
68
|
+
id,
|
|
67
69
|
onDelete: deleteFile,
|
|
68
70
|
onFileSuccess,
|
|
69
71
|
onFileError,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { FileUploadRootProps } from "./types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime13 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/file-upload-root/FileUploadRoot.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* FileUploadInline - An inline file upload component using FileUpload primitives
|
|
7
7
|
*/
|
|
8
|
-
declare function FileUploadRoot(props: FileUploadRootProps):
|
|
8
|
+
declare function FileUploadRoot(props: FileUploadRootProps): react_jsx_runtime13.JSX.Element;
|
|
9
9
|
declare namespace FileUploadRoot {
|
|
10
10
|
var displayName: string;
|
|
11
11
|
}
|
|
@@ -13,7 +13,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
* FileUploadInline - An inline file upload component using FileUpload primitives
|
|
14
14
|
*/
|
|
15
15
|
function FileUploadRoot(props) {
|
|
16
|
-
const { value, onChange, className, disabled, children, onAccept, maxFiles, preventDuplicates, slots, onFileSuccess, onFileError,...rest } = props;
|
|
16
|
+
const { value, onChange, className, disabled, children, onAccept, maxFiles, preventDuplicates, slots, onFileSuccess, onFileError, id,...rest } = props;
|
|
17
17
|
const multiple = props.multiple ?? false;
|
|
18
18
|
const effectiveMaxFiles = multiple ? maxFiles : 1;
|
|
19
19
|
const { handleAccept, displayFiles, deleteFile, getFile, orgValue } = useFileUploadStore({
|
|
@@ -46,6 +46,7 @@ function FileUploadRoot(props) {
|
|
|
46
46
|
children: /* @__PURE__ */ jsx(FileUploadTrigger, {
|
|
47
47
|
asChild: true,
|
|
48
48
|
...slots?.trigger || {},
|
|
49
|
+
id: id ?? slots?.trigger?.id,
|
|
49
50
|
children
|
|
50
51
|
})
|
|
51
52
|
}), displayFiles.length > 0 && /* @__PURE__ */ jsx(FileUploadList, {
|
|
@@ -58,6 +59,7 @@ function FileUploadRoot(props) {
|
|
|
58
59
|
...data,
|
|
59
60
|
file: getFile(data),
|
|
60
61
|
disabled,
|
|
62
|
+
id,
|
|
61
63
|
onDelete: deleteFile,
|
|
62
64
|
onFileSuccess,
|
|
63
65
|
onFileError,
|