@pixpilot/shadcn 0.1.2 → 0.1.3
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/{OrContinueWithSeparator-BQalGx6O.d.ts → OrContinueWithSeparator-BDH-vep4.d.ts} +2 -2
- package/dist/OrContinueWithSeparator-CkITP0NT.js +27 -0
- package/dist/{alert-BDcOuBrO.d.ts → alert-CKr0C0yG.d.ts} +4 -4
- package/dist/{alert-DuQQzE0M.js → alert-DgTy4F7t.js} +5 -6
- package/dist/{alert-dialog-Iw5UG8d3.d.ts → alert-dialog-BIYOf1qe.d.ts} +1 -1
- package/dist/{avatar-BRZS2oIf.d.ts → avatar-DomHDuSM.d.ts} +4 -4
- package/dist/{avatar-DWlyZZC1.js → avatar-ggnaPAdx.js} +5 -6
- package/dist/{badge-Dwxq7JaA.d.ts → badge-DaNELwZ4.d.ts} +5 -5
- package/dist/{badge-ChGpGKfr.js → badge-OxgStuN-.js} +3 -4
- package/dist/{button-CoM3CepB.js → button-Ct22vvF2.js} +3 -4
- package/dist/{button-CSw4bOk7.d.ts → button-Qk5_S2q2.d.ts} +5 -5
- package/dist/{calendar-Vx7GBiN5.d.ts → calendar-CtMOHJjw.d.ts} +4 -4
- package/dist/{calendar-5J34tX7L.js → calendar-SVLTPCYN.js} +11 -12
- package/dist/{card-CN1Wv1_W.d.ts → card-7m__j7pN.d.ts} +8 -8
- package/dist/{card-Bf0-1Hox.js → card-mGJMSXR3.js} +9 -10
- package/dist/{checkbox-COC2Igpo.d.ts → checkbox-C2ohGs66.d.ts} +2 -2
- package/dist/{checkbox-ChqHvI5Y.js → checkbox-Car6S-YU.js} +5 -6
- package/dist/{command-BzJMrpFw.js → command-Bh0lIHth.js} +17 -18
- package/dist/{command-CJXf3-UR.d.ts → command-J-Z7237Z.d.ts} +11 -11
- package/dist/components/{index-2Smtu_1u.d.ts → index-CjxDeDgS.d.ts} +29 -29
- package/dist/components/index.js +30 -31
- package/dist/components/ui/{OrContinueWithSeparator-OYGOTHTw.d.ts → OrContinueWithSeparator-CHwqvVjX.d.ts} +1 -1
- package/dist/components/ui/OrContinueWithSeparator.js +4 -5
- package/dist/components/ui/alert-1G0clvys.d.ts +2 -0
- package/dist/components/ui/{alert-dialog-CUL8nAeI.d.ts → alert-dialog-B4l6hBX8.d.ts} +1 -1
- package/dist/components/ui/alert-dialog.js +30 -31
- package/dist/components/ui/alert.js +3 -4
- package/dist/components/ui/avatar-utP6R-Uq.d.ts +2 -0
- package/dist/components/ui/avatar.js +3 -4
- package/dist/components/ui/badge-DwySSPk7.d.ts +2 -0
- package/dist/components/ui/badge.js +3 -4
- package/dist/components/ui/button-fWXid_Jg.d.ts +2 -0
- package/dist/components/ui/button.js +3 -4
- package/dist/components/ui/{calendar-B9zfwi7H.d.ts → calendar-DxgOZaJG.d.ts} +1 -1
- package/dist/components/ui/calendar.js +4 -5
- package/dist/components/ui/{card-BYi1Jf3z.d.ts → card-CEc4KDWR.d.ts} +1 -1
- package/dist/components/ui/card.js +3 -4
- package/dist/components/ui/checkbox-Db1hdfQh.d.ts +2 -0
- package/dist/components/ui/checkbox.js +3 -4
- package/dist/components/ui/{command-BkXDbodx.d.ts → command-D5yDsetf.d.ts} +1 -1
- package/dist/components/ui/command.js +4 -5
- package/dist/components/ui/{dialog-BvEqiJH6.d.ts → dialog-C9hWg6Jo.d.ts} +1 -1
- package/dist/components/ui/dialog.js +3 -4
- package/dist/components/ui/{dropdown-menu-BJ2FNIH4.d.ts → dropdown-menu-CZQe3gdP.d.ts} +1 -1
- package/dist/components/ui/dropdown-menu.js +3 -4
- package/dist/components/ui/{file-upload-DZGaOzQS.d.ts → file-upload-DE4ndg6D.d.ts} +1 -1
- package/dist/components/ui/file-upload.js +3 -4
- package/dist/components/ui/{form-CpVuTht7.d.ts → form-_IonQq2g.d.ts} +1 -1
- package/dist/components/ui/form.js +4 -5
- package/dist/components/ui/{index-q7RUuYJ2.d.ts → index-ByU7Ea3g.d.ts} +29 -29
- package/dist/components/ui/index.js +30 -31
- package/dist/components/ui/input-nIiKz0t3.d.ts +2 -0
- package/dist/components/ui/input.js +3 -4
- package/dist/components/ui/label-DcYFARJv.d.ts +2 -0
- package/dist/components/ui/label.js +3 -4
- package/dist/components/ui/{pagination-CDtFyXkC.d.ts → pagination-BzA2nvm7.d.ts} +1 -1
- package/dist/components/ui/pagination.js +30 -31
- package/dist/components/ui/{popover-B6PDCy8U.d.ts → popover-CWkbXPIs.d.ts} +1 -1
- package/dist/components/ui/popover.js +3 -4
- package/dist/components/ui/{radio-group-DuGtPMcp.d.ts → radio-group-B8uVaLcH.d.ts} +1 -1
- package/dist/components/ui/radio-group.js +3 -4
- package/dist/components/ui/{select-DAN9r02Z.d.ts → select-Thz3wmNR.d.ts} +1 -1
- package/dist/components/ui/select.js +3 -4
- package/dist/components/ui/separator-nDjbz769.d.ts +2 -0
- package/dist/components/ui/separator.js +3 -4
- package/dist/components/ui/shadcn-io/tags/{index-CnMq6aeV.d.ts → index-ByG1DLSH.d.ts} +1 -1
- package/dist/components/ui/shadcn-io/tags/index.js +8 -9
- package/dist/components/ui/shadcn-io/tags-input-inline/{index-D7OIPdfu.d.ts → index-Z-lSeFdH.d.ts} +1 -1
- package/dist/components/ui/shadcn-io/tags-input-inline/index.js +2 -3
- package/dist/components/ui/{sheet-Bo7lvlRA.d.ts → sheet-DG1hOjV0.d.ts} +1 -1
- package/dist/components/ui/sheet.js +3 -4
- package/dist/components/ui/slider-BQpp3iiy.d.ts +2 -0
- package/dist/components/ui/slider.js +3 -4
- package/dist/components/ui/switch-nWOTZVXx.d.ts +2 -0
- package/dist/components/ui/switch.js +3 -4
- package/dist/components/ui/tabs-k3ha4bbs.d.ts +2 -0
- package/dist/components/ui/tabs.js +3 -4
- package/dist/components/ui/textarea-BV_2NNxa.d.ts +2 -0
- package/dist/components/ui/textarea.js +3 -4
- package/dist/components/ui/{tooltip-JdLdCVsY.d.ts → tooltip--Q9yXR4z.d.ts} +1 -1
- package/dist/components/ui/tooltip.js +3 -4
- package/dist/{dialog-a61KKgp5.d.ts → dialog-GHzqCUyY.d.ts} +11 -11
- package/dist/{dialog-CnHQjTPX.js → dialog-O7j71U82.js} +15 -16
- package/dist/{dropdown-menu-DTRzUFxv.d.ts → dropdown-menu-B7IpNRT1.d.ts} +16 -16
- package/dist/{dropdown-menu-BytmAQI6.js → dropdown-menu-ChXZkLy7.js} +22 -23
- package/dist/{file-upload-BEeMesnR.js → file-upload-DPXO1W1r.js} +36 -37
- package/dist/{file-upload-C38U9nyT.d.ts → file-upload-DtI7t48f.d.ts} +11 -11
- package/dist/{form-Cx2k120Z.d.ts → form-B1wa9dSK.d.ts} +7 -7
- package/dist/{form-BjnyYpgw.js → form-DITfwajn.js} +11 -12
- package/dist/{index-2apAhpYW.d.ts → index-BBg42y-x.d.ts} +30 -30
- package/dist/{index-B9p9Ocoz.d.ts → index-CbEoBXve.d.ts} +9 -9
- package/dist/{index-B6o0TAoD.d.ts → index-DAxEKRyQ.d.ts} +7 -7
- package/dist/{index-fkXKhUlW.d.ts → index-nhYidbaI.d.ts} +13 -13
- package/dist/index.js +30 -31
- package/dist/{input-DCWzuP_2.d.ts → input-BOo0lKrd.d.ts} +2 -2
- package/dist/{input-CUeyj64L.js → input-Yyz-T5fE.js} +3 -4
- package/dist/{label-DGznqsHm.js → label-CAjd9Y0A.js} +3 -4
- package/dist/{label-pEqCQKel.d.ts → label-VBeDhZRS.d.ts} +2 -2
- package/dist/lib/index-BBZGfoI7.d.ts +2 -0
- package/dist/lib/index.js +2 -2
- package/dist/lib/utils-COdFh0eZ.d.ts +2 -0
- package/dist/lib/utils.js +1 -1
- package/dist/lib-IiLuXmGR.js +0 -0
- package/dist/{popover-CV48KL0e.js → popover-B6K6dK1G.js} +6 -7
- package/dist/{popover-RnfYQfGo.d.ts → popover-BSOEEHRm.d.ts} +5 -5
- package/dist/{radio-group-BNj4EfLg.d.ts → radio-group-2z7Wk4bX.d.ts} +3 -3
- package/dist/{radio-group-jaFHISZ7.js → radio-group-CN-7YDqF.js} +6 -7
- package/dist/{select-B4b-ZC31.d.ts → select-BLcUSgPc.d.ts} +11 -11
- package/dist/{select-C96xvMSx.js → select-D1s3F0et.js} +22 -23
- package/dist/{separator-C71XEO3E.js → separator-BVBCxKBW.js} +3 -4
- package/dist/{separator-izY8KL7y.d.ts → separator-CQdurlbm.d.ts} +2 -2
- package/dist/{sheet-Dag7L2Xd.d.ts → sheet-BBjl1baR.d.ts} +9 -9
- package/dist/{sheet-BlZGrRNt.js → sheet-DrR3eH28.js} +14 -15
- package/dist/{slider-CdK5O4pc.js → slider-BlL5lT8d.js} +6 -7
- package/dist/{slider-DEUGdZC4.d.ts → slider-CYGuuC8k.d.ts} +2 -2
- package/dist/{src-DQlJgy1h.js → src-8ePG_tPo.js} +25 -26
- package/dist/{switch-Bz5Iiy2_.js → switch-BXSa0MEU.js} +4 -5
- package/dist/{switch-RbFzvnvM.d.ts → switch-Y5FN07nj.d.ts} +2 -2
- package/dist/{tabs-had5ildI.d.ts → tabs-C-Tv9y7L.d.ts} +5 -5
- package/dist/{tabs-BjolTUEI.js → tabs-DbvqqMZV.js} +6 -7
- package/dist/{tags-BnJCu0NQ.js → tags-BACevgr_.js} +22 -23
- package/dist/{tags-input-inline-DnEu3Dyw.js → tags-input-inline-Bz5h19zx.js} +11 -12
- package/dist/{textarea-s8H46Zg0.d.ts → textarea-C3eFh4Vd.d.ts} +2 -2
- package/dist/{textarea-BNZyZgAM.js → textarea-DTGK7cx-.js} +3 -4
- package/dist/{tooltip-CS40su1S.d.ts → tooltip-CGDnGnPt.d.ts} +5 -5
- package/dist/{tooltip-CuYs-__e.js → tooltip-CX3NbXUu.js} +7 -8
- package/package.json +1 -1
- package/dist/OrContinueWithSeparator-Cs96m5UB.js +0 -28
- package/dist/components/ui/alert-DuyLuX68.d.ts +0 -2
- package/dist/components/ui/avatar-DAQzpqqD.d.ts +0 -2
- package/dist/components/ui/badge-BM6RVFS5.d.ts +0 -2
- package/dist/components/ui/button-D9y8v_Tt.d.ts +0 -2
- package/dist/components/ui/checkbox-QkowwGnR.d.ts +0 -2
- package/dist/components/ui/input-DVpolrW-.d.ts +0 -2
- package/dist/components/ui/label-BW9JhwyW.d.ts +0 -2
- package/dist/components/ui/separator-D53tTv-J.d.ts +0 -2
- package/dist/components/ui/slider-lAthKpva.d.ts +0 -2
- package/dist/components/ui/switch-D7WzMqgv.d.ts +0 -2
- package/dist/components/ui/tabs-CnjGY6eE.d.ts +0 -2
- package/dist/components/ui/textarea-BJpu8fK5.d.ts +0 -2
- package/dist/jsx-runtime-CjFsk39Z.js +0 -274
- package/dist/lib/index-ChuxSUKt.d.ts +0 -2
- package/dist/lib/utils-45Ez8x6p.d.ts +0 -2
- package/dist/lib-B_fww26I.js +0 -1
- /package/dist/{index-CZUtOTjh.d.ts → index-CCggO_hw.d.ts} +0 -0
- /package/dist/{utils-_VBxPjie.d.ts → utils-Bgl9doaU.d.ts} +0 -0
- /package/dist/{utils-D2WOFi-N.js → utils-CeuVg6RA.js} +0 -0
|
@@ -1,53 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as cn } from "./utils-D2WOFi-N.js";
|
|
1
|
+
import { t as cn } from "./utils-CeuVg6RA.js";
|
|
3
2
|
import "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { XIcon } from "lucide-react";
|
|
5
5
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
6
6
|
|
|
7
7
|
//#region src/components/ui/dialog.tsx
|
|
8
|
-
var import_jsx_runtime = /* @__PURE__ */ __toESM(require_jsx_runtime());
|
|
9
8
|
function Dialog({ ...props }) {
|
|
10
|
-
return /* @__PURE__ */
|
|
9
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Root, {
|
|
11
10
|
"data-slot": "dialog",
|
|
12
11
|
...props
|
|
13
12
|
});
|
|
14
13
|
}
|
|
15
14
|
function DialogTrigger({ ...props }) {
|
|
16
|
-
return /* @__PURE__ */
|
|
15
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, {
|
|
17
16
|
"data-slot": "dialog-trigger",
|
|
18
17
|
...props
|
|
19
18
|
});
|
|
20
19
|
}
|
|
21
20
|
function DialogPortal({ ...props }) {
|
|
22
|
-
return /* @__PURE__ */
|
|
21
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Portal, {
|
|
23
22
|
"data-slot": "dialog-portal",
|
|
24
23
|
...props
|
|
25
24
|
});
|
|
26
25
|
}
|
|
27
26
|
function DialogClose({ ...props }) {
|
|
28
|
-
return /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Close, {
|
|
29
28
|
"data-slot": "dialog-close",
|
|
30
29
|
...props
|
|
31
30
|
});
|
|
32
31
|
}
|
|
33
32
|
function DialogOverlay({ className, ...props }) {
|
|
34
|
-
return /* @__PURE__ */
|
|
33
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Overlay, {
|
|
35
34
|
"data-slot": "dialog-overlay",
|
|
36
35
|
className: cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50", className),
|
|
37
36
|
...props
|
|
38
37
|
});
|
|
39
38
|
}
|
|
40
39
|
function DialogContent({ className, children, showCloseButton = true, ...props }) {
|
|
41
|
-
return /* @__PURE__ */
|
|
40
|
+
return /* @__PURE__ */ jsxs(DialogPortal, {
|
|
42
41
|
"data-slot": "dialog-portal",
|
|
43
|
-
children: [/* @__PURE__ */
|
|
42
|
+
children: [/* @__PURE__ */ jsx(DialogOverlay, {}), /* @__PURE__ */ jsxs(DialogPrimitive.Content, {
|
|
44
43
|
"data-slot": "dialog-content",
|
|
45
44
|
className: cn("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg", className),
|
|
46
45
|
...props,
|
|
47
|
-
children: [children, showCloseButton && /* @__PURE__ */
|
|
46
|
+
children: [children, showCloseButton && /* @__PURE__ */ jsxs(DialogPrimitive.Close, {
|
|
48
47
|
"data-slot": "dialog-close",
|
|
49
48
|
className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
50
|
-
children: [/* @__PURE__ */
|
|
49
|
+
children: [/* @__PURE__ */ jsx(XIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
51
50
|
className: "sr-only",
|
|
52
51
|
children: "Close"
|
|
53
52
|
})]
|
|
@@ -56,28 +55,28 @@ function DialogContent({ className, children, showCloseButton = true, ...props }
|
|
|
56
55
|
});
|
|
57
56
|
}
|
|
58
57
|
function DialogHeader({ className, ...props }) {
|
|
59
|
-
return /* @__PURE__ */
|
|
58
|
+
return /* @__PURE__ */ jsx("div", {
|
|
60
59
|
"data-slot": "dialog-header",
|
|
61
60
|
className: cn("flex flex-col gap-2 text-center sm:text-left", className),
|
|
62
61
|
...props
|
|
63
62
|
});
|
|
64
63
|
}
|
|
65
64
|
function DialogFooter({ className, ...props }) {
|
|
66
|
-
return /* @__PURE__ */
|
|
65
|
+
return /* @__PURE__ */ jsx("div", {
|
|
67
66
|
"data-slot": "dialog-footer",
|
|
68
67
|
className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className),
|
|
69
68
|
...props
|
|
70
69
|
});
|
|
71
70
|
}
|
|
72
71
|
function DialogTitle({ className, ...props }) {
|
|
73
|
-
return /* @__PURE__ */
|
|
72
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Title, {
|
|
74
73
|
"data-slot": "dialog-title",
|
|
75
74
|
className: cn("text-lg leading-none font-semibold", className),
|
|
76
75
|
...props
|
|
77
76
|
});
|
|
78
77
|
}
|
|
79
78
|
function DialogDescription({ className, ...props }) {
|
|
80
|
-
return /* @__PURE__ */
|
|
79
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Description, {
|
|
81
80
|
"data-slot": "dialog-description",
|
|
82
81
|
className: cn("text-muted-foreground text-sm", className),
|
|
83
82
|
...props
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import * as react_jsx_runtime51 from "react/jsx-runtime";
|
|
2
3
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
3
|
-
import * as react_jsx_runtime31 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/components/ui/dropdown-menu.d.ts
|
|
6
6
|
declare function DropdownMenu({
|
|
7
7
|
...props
|
|
8
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>):
|
|
8
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): react_jsx_runtime51.JSX.Element;
|
|
9
9
|
declare function DropdownMenuPortal({
|
|
10
10
|
...props
|
|
11
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>):
|
|
11
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): react_jsx_runtime51.JSX.Element;
|
|
12
12
|
declare function DropdownMenuTrigger({
|
|
13
13
|
...props
|
|
14
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>):
|
|
14
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): react_jsx_runtime51.JSX.Element;
|
|
15
15
|
declare function DropdownMenuContent({
|
|
16
16
|
className,
|
|
17
17
|
sideOffset,
|
|
18
18
|
...props
|
|
19
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>):
|
|
19
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): react_jsx_runtime51.JSX.Element;
|
|
20
20
|
declare function DropdownMenuGroup({
|
|
21
21
|
...props
|
|
22
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>):
|
|
22
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): react_jsx_runtime51.JSX.Element;
|
|
23
23
|
declare function DropdownMenuItem({
|
|
24
24
|
className,
|
|
25
25
|
inset,
|
|
@@ -28,39 +28,39 @@ declare function DropdownMenuItem({
|
|
|
28
28
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
29
29
|
inset?: boolean;
|
|
30
30
|
variant?: 'default' | 'destructive';
|
|
31
|
-
}):
|
|
31
|
+
}): react_jsx_runtime51.JSX.Element;
|
|
32
32
|
declare function DropdownMenuCheckboxItem({
|
|
33
33
|
className,
|
|
34
34
|
children,
|
|
35
35
|
checked,
|
|
36
36
|
...props
|
|
37
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>):
|
|
37
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>): react_jsx_runtime51.JSX.Element;
|
|
38
38
|
declare function DropdownMenuRadioGroup({
|
|
39
39
|
...props
|
|
40
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>):
|
|
40
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): react_jsx_runtime51.JSX.Element;
|
|
41
41
|
declare function DropdownMenuRadioItem({
|
|
42
42
|
className,
|
|
43
43
|
children,
|
|
44
44
|
...props
|
|
45
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>):
|
|
45
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): react_jsx_runtime51.JSX.Element;
|
|
46
46
|
declare function DropdownMenuLabel({
|
|
47
47
|
className,
|
|
48
48
|
inset,
|
|
49
49
|
...props
|
|
50
50
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
51
51
|
inset?: boolean;
|
|
52
|
-
}):
|
|
52
|
+
}): react_jsx_runtime51.JSX.Element;
|
|
53
53
|
declare function DropdownMenuSeparator({
|
|
54
54
|
className,
|
|
55
55
|
...props
|
|
56
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>):
|
|
56
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): react_jsx_runtime51.JSX.Element;
|
|
57
57
|
declare function DropdownMenuShortcut({
|
|
58
58
|
className,
|
|
59
59
|
...props
|
|
60
|
-
}: React.ComponentProps<'span'>):
|
|
60
|
+
}: React.ComponentProps<'span'>): react_jsx_runtime51.JSX.Element;
|
|
61
61
|
declare function DropdownMenuSub({
|
|
62
62
|
...props
|
|
63
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>):
|
|
63
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): react_jsx_runtime51.JSX.Element;
|
|
64
64
|
declare function DropdownMenuSubTrigger({
|
|
65
65
|
className,
|
|
66
66
|
inset,
|
|
@@ -68,10 +68,10 @@ declare function DropdownMenuSubTrigger({
|
|
|
68
68
|
...props
|
|
69
69
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
70
70
|
inset?: boolean;
|
|
71
|
-
}):
|
|
71
|
+
}): react_jsx_runtime51.JSX.Element;
|
|
72
72
|
declare function DropdownMenuSubContent({
|
|
73
73
|
className,
|
|
74
74
|
...props
|
|
75
|
-
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>):
|
|
75
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): react_jsx_runtime51.JSX.Element;
|
|
76
76
|
//#endregion
|
|
77
77
|
export { DropdownMenuItem as a, DropdownMenuRadioGroup as c, DropdownMenuShortcut as d, DropdownMenuSub as f, DropdownMenuTrigger as h, DropdownMenuGroup as i, DropdownMenuRadioItem as l, DropdownMenuSubTrigger as m, DropdownMenuCheckboxItem as n, DropdownMenuLabel as o, DropdownMenuSubContent as p, DropdownMenuContent as r, DropdownMenuPortal as s, DropdownMenu as t, DropdownMenuSeparator as u };
|
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as cn } from "./utils-D2WOFi-N.js";
|
|
1
|
+
import { t as cn } from "./utils-CeuVg6RA.js";
|
|
3
2
|
import "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
|
|
5
5
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
6
6
|
|
|
7
7
|
//#region src/components/ui/dropdown-menu.tsx
|
|
8
|
-
var import_jsx_runtime = /* @__PURE__ */ __toESM(require_jsx_runtime());
|
|
9
8
|
function DropdownMenu({ ...props }) {
|
|
10
|
-
return /* @__PURE__ */
|
|
9
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Root, {
|
|
11
10
|
"data-slot": "dropdown-menu",
|
|
12
11
|
...props
|
|
13
12
|
});
|
|
14
13
|
}
|
|
15
14
|
function DropdownMenuPortal({ ...props }) {
|
|
16
|
-
return /* @__PURE__ */
|
|
15
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, {
|
|
17
16
|
"data-slot": "dropdown-menu-portal",
|
|
18
17
|
...props
|
|
19
18
|
});
|
|
20
19
|
}
|
|
21
20
|
function DropdownMenuTrigger({ ...props }) {
|
|
22
|
-
return /* @__PURE__ */
|
|
21
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Trigger, {
|
|
23
22
|
"data-slot": "dropdown-menu-trigger",
|
|
24
23
|
...props
|
|
25
24
|
});
|
|
26
25
|
}
|
|
27
26
|
function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
28
|
-
return /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.Content, {
|
|
29
28
|
"data-slot": "dropdown-menu-content",
|
|
30
29
|
sideOffset,
|
|
31
30
|
className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md", className),
|
|
@@ -33,13 +32,13 @@ function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
|
33
32
|
}) });
|
|
34
33
|
}
|
|
35
34
|
function DropdownMenuGroup({ ...props }) {
|
|
36
|
-
return /* @__PURE__ */
|
|
35
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Group, {
|
|
37
36
|
"data-slot": "dropdown-menu-group",
|
|
38
37
|
...props
|
|
39
38
|
});
|
|
40
39
|
}
|
|
41
40
|
function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
42
|
-
return /* @__PURE__ */
|
|
41
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Item, {
|
|
43
42
|
"data-slot": "dropdown-menu-item",
|
|
44
43
|
"data-inset": inset,
|
|
45
44
|
"data-variant": variant,
|
|
@@ -48,36 +47,36 @@ function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
|
48
47
|
});
|
|
49
48
|
}
|
|
50
49
|
function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
|
|
51
|
-
return /* @__PURE__ */
|
|
50
|
+
return /* @__PURE__ */ jsxs(DropdownMenuPrimitive.CheckboxItem, {
|
|
52
51
|
"data-slot": "dropdown-menu-checkbox-item",
|
|
53
52
|
className: cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
54
53
|
checked,
|
|
55
54
|
...props,
|
|
56
|
-
children: [/* @__PURE__ */
|
|
55
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
57
56
|
className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",
|
|
58
|
-
children: /* @__PURE__ */
|
|
57
|
+
children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) })
|
|
59
58
|
}), children]
|
|
60
59
|
});
|
|
61
60
|
}
|
|
62
61
|
function DropdownMenuRadioGroup({ ...props }) {
|
|
63
|
-
return /* @__PURE__ */
|
|
62
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.RadioGroup, {
|
|
64
63
|
"data-slot": "dropdown-menu-radio-group",
|
|
65
64
|
...props
|
|
66
65
|
});
|
|
67
66
|
}
|
|
68
67
|
function DropdownMenuRadioItem({ className, children, ...props }) {
|
|
69
|
-
return /* @__PURE__ */
|
|
68
|
+
return /* @__PURE__ */ jsxs(DropdownMenuPrimitive.RadioItem, {
|
|
70
69
|
"data-slot": "dropdown-menu-radio-item",
|
|
71
70
|
className: cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
72
71
|
...props,
|
|
73
|
-
children: [/* @__PURE__ */
|
|
72
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
74
73
|
className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",
|
|
75
|
-
children: /* @__PURE__ */
|
|
74
|
+
children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CircleIcon, { className: "size-2 fill-current" }) })
|
|
76
75
|
}), children]
|
|
77
76
|
});
|
|
78
77
|
}
|
|
79
78
|
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
80
|
-
return /* @__PURE__ */
|
|
79
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Label, {
|
|
81
80
|
"data-slot": "dropdown-menu-label",
|
|
82
81
|
"data-inset": inset,
|
|
83
82
|
className: cn("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", className),
|
|
@@ -85,36 +84,36 @@ function DropdownMenuLabel({ className, inset, ...props }) {
|
|
|
85
84
|
});
|
|
86
85
|
}
|
|
87
86
|
function DropdownMenuSeparator({ className, ...props }) {
|
|
88
|
-
return /* @__PURE__ */
|
|
87
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Separator, {
|
|
89
88
|
"data-slot": "dropdown-menu-separator",
|
|
90
89
|
className: cn("bg-border -mx-1 my-1 h-px", className),
|
|
91
90
|
...props
|
|
92
91
|
});
|
|
93
92
|
}
|
|
94
93
|
function DropdownMenuShortcut({ className, ...props }) {
|
|
95
|
-
return /* @__PURE__ */
|
|
94
|
+
return /* @__PURE__ */ jsx("span", {
|
|
96
95
|
"data-slot": "dropdown-menu-shortcut",
|
|
97
96
|
className: cn("text-muted-foreground ml-auto text-xs tracking-widest", className),
|
|
98
97
|
...props
|
|
99
98
|
});
|
|
100
99
|
}
|
|
101
100
|
function DropdownMenuSub({ ...props }) {
|
|
102
|
-
return /* @__PURE__ */
|
|
101
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Sub, {
|
|
103
102
|
"data-slot": "dropdown-menu-sub",
|
|
104
103
|
...props
|
|
105
104
|
});
|
|
106
105
|
}
|
|
107
106
|
function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
108
|
-
return /* @__PURE__ */
|
|
107
|
+
return /* @__PURE__ */ jsxs(DropdownMenuPrimitive.SubTrigger, {
|
|
109
108
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
110
109
|
"data-inset": inset,
|
|
111
110
|
className: cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
112
111
|
...props,
|
|
113
|
-
children: [children, /* @__PURE__ */
|
|
112
|
+
children: [children, /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto size-4" })]
|
|
114
113
|
});
|
|
115
114
|
}
|
|
116
115
|
function DropdownMenuSubContent({ className, ...props }) {
|
|
117
|
-
return /* @__PURE__ */
|
|
116
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.SubContent, {
|
|
118
117
|
"data-slot": "dropdown-menu-sub-content",
|
|
119
118
|
className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg", className),
|
|
120
119
|
...props
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as cn } from "./utils-D2WOFi-N.js";
|
|
1
|
+
import { t as cn } from "./utils-CeuVg6RA.js";
|
|
3
2
|
import * as React from "react";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { Slot } from "@radix-ui/react-slot";
|
|
5
5
|
import { FileArchiveIcon, FileAudioIcon, FileCodeIcon, FileCogIcon, FileIcon, FileTextIcon, FileVideoIcon } from "lucide-react";
|
|
6
6
|
import { useDirection } from "@radix-ui/react-direction";
|
|
7
7
|
|
|
8
8
|
//#region src/components/ui/file-upload.tsx
|
|
9
|
-
var import_jsx_runtime = /* @__PURE__ */ __toESM(require_jsx_runtime());
|
|
10
9
|
const ROOT_NAME = "FileUpload";
|
|
11
10
|
const DROPZONE_NAME = "FileUploadDropzone";
|
|
12
11
|
const TRIGGER_NAME = "FileUploadTrigger";
|
|
@@ -404,11 +403,11 @@ function FileUploadRoot(props) {
|
|
|
404
403
|
urlCache
|
|
405
404
|
]);
|
|
406
405
|
const RootPrimitive = asChild ? Slot : "div";
|
|
407
|
-
return /* @__PURE__ */
|
|
406
|
+
return /* @__PURE__ */ jsx(StoreContext.Provider, {
|
|
408
407
|
value: store,
|
|
409
|
-
children: /* @__PURE__ */
|
|
408
|
+
children: /* @__PURE__ */ jsx(FileUploadContext.Provider, {
|
|
410
409
|
value: contextValue,
|
|
411
|
-
children: /* @__PURE__ */
|
|
410
|
+
children: /* @__PURE__ */ jsxs(RootPrimitive, {
|
|
412
411
|
"data-disabled": disabled ? "" : void 0,
|
|
413
412
|
"data-slot": "file-upload",
|
|
414
413
|
dir,
|
|
@@ -416,7 +415,7 @@ function FileUploadRoot(props) {
|
|
|
416
415
|
className: cn("relative flex flex-col gap-2", className),
|
|
417
416
|
children: [
|
|
418
417
|
children,
|
|
419
|
-
/* @__PURE__ */
|
|
418
|
+
/* @__PURE__ */ jsx("input", {
|
|
420
419
|
type: "file",
|
|
421
420
|
id: inputId,
|
|
422
421
|
"aria-labelledby": labelId,
|
|
@@ -431,7 +430,7 @@ function FileUploadRoot(props) {
|
|
|
431
430
|
required,
|
|
432
431
|
onChange: onInputChange
|
|
433
432
|
}),
|
|
434
|
-
/* @__PURE__ */
|
|
433
|
+
/* @__PURE__ */ jsx("span", {
|
|
435
434
|
id: labelId,
|
|
436
435
|
className: "sr-only",
|
|
437
436
|
children: label ?? "File upload"
|
|
@@ -539,7 +538,7 @@ function FileUploadDropzone(props) {
|
|
|
539
538
|
context.inputRef.current?.click();
|
|
540
539
|
}
|
|
541
540
|
}, [context.inputRef, onKeyDownProp]);
|
|
542
|
-
return /* @__PURE__ */
|
|
541
|
+
return /* @__PURE__ */ jsx(asChild ? Slot : "div", {
|
|
543
542
|
role: "region",
|
|
544
543
|
id: context.dropzoneId,
|
|
545
544
|
"aria-controls": `${context.inputId} ${context.listId}`,
|
|
@@ -570,7 +569,7 @@ function FileUploadTrigger(props) {
|
|
|
570
569
|
if (event.defaultPrevented) return;
|
|
571
570
|
context.inputRef.current?.click();
|
|
572
571
|
}, [context.inputRef, onClickProp]);
|
|
573
|
-
return /* @__PURE__ */
|
|
572
|
+
return /* @__PURE__ */ jsx(asChild ? Slot : "button", {
|
|
574
573
|
type: "button",
|
|
575
574
|
"aria-controls": context.inputId,
|
|
576
575
|
"data-disabled": context.disabled ? "" : void 0,
|
|
@@ -586,7 +585,7 @@ function FileUploadList(props) {
|
|
|
586
585
|
const fileCount = useStore((state) => state.files.size);
|
|
587
586
|
const shouldRender = forceMount || fileCount > 0;
|
|
588
587
|
if (!shouldRender) return null;
|
|
589
|
-
return /* @__PURE__ */
|
|
588
|
+
return /* @__PURE__ */ jsx(asChild ? Slot : "div", {
|
|
590
589
|
role: "list",
|
|
591
590
|
id: context.listId,
|
|
592
591
|
"aria-orientation": orientation,
|
|
@@ -635,9 +634,9 @@ function FileUploadItem(props) {
|
|
|
635
634
|
if (!fileState) return null;
|
|
636
635
|
const statusText = fileState.error ? `Error: ${fileState.error}` : fileState.status === "uploading" ? `Uploading: ${fileState.progress}% complete` : fileState.status === "success" ? "Upload complete" : "Ready to upload";
|
|
637
636
|
const ItemPrimitive = asChild ? Slot : "div";
|
|
638
|
-
return /* @__PURE__ */
|
|
637
|
+
return /* @__PURE__ */ jsx(FileUploadItemContext.Provider, {
|
|
639
638
|
value: itemContext,
|
|
640
|
-
children: /* @__PURE__ */
|
|
639
|
+
children: /* @__PURE__ */ jsxs(ItemPrimitive, {
|
|
641
640
|
role: "listitem",
|
|
642
641
|
id,
|
|
643
642
|
"aria-setsize": fileCount,
|
|
@@ -648,7 +647,7 @@ function FileUploadItem(props) {
|
|
|
648
647
|
dir: context.dir,
|
|
649
648
|
...itemProps,
|
|
650
649
|
className: cn("relative flex items-center rounded-md border p-3", className),
|
|
651
|
-
children: [props.children, /* @__PURE__ */
|
|
650
|
+
children: [props.children, /* @__PURE__ */ jsx("span", {
|
|
652
651
|
id: statusId,
|
|
653
652
|
className: "sr-only",
|
|
654
653
|
children: statusText
|
|
@@ -671,14 +670,14 @@ function formatBytes(bytes) {
|
|
|
671
670
|
function getFileIcon(file) {
|
|
672
671
|
const { type } = file;
|
|
673
672
|
const extension = file.name.split(".").pop()?.toLowerCase() ?? "";
|
|
674
|
-
if (type.startsWith("video/")) return /* @__PURE__ */
|
|
675
|
-
if (type.startsWith("audio/")) return /* @__PURE__ */
|
|
673
|
+
if (type.startsWith("video/")) return /* @__PURE__ */ jsx(FileVideoIcon, {});
|
|
674
|
+
if (type.startsWith("audio/")) return /* @__PURE__ */ jsx(FileAudioIcon, {});
|
|
676
675
|
if (type.startsWith("text/") || [
|
|
677
676
|
"txt",
|
|
678
677
|
"md",
|
|
679
678
|
"rtf",
|
|
680
679
|
"pdf"
|
|
681
|
-
].includes(extension)) return /* @__PURE__ */
|
|
680
|
+
].includes(extension)) return /* @__PURE__ */ jsx(FileTextIcon, {});
|
|
682
681
|
if ([
|
|
683
682
|
"html",
|
|
684
683
|
"css",
|
|
@@ -695,7 +694,7 @@ function getFileIcon(file) {
|
|
|
695
694
|
"c",
|
|
696
695
|
"cpp",
|
|
697
696
|
"cs"
|
|
698
|
-
].includes(extension)) return /* @__PURE__ */
|
|
697
|
+
].includes(extension)) return /* @__PURE__ */ jsx(FileCodeIcon, {});
|
|
699
698
|
if ([
|
|
700
699
|
"zip",
|
|
701
700
|
"rar",
|
|
@@ -703,7 +702,7 @@ function getFileIcon(file) {
|
|
|
703
702
|
"tar",
|
|
704
703
|
"gz",
|
|
705
704
|
"bz2"
|
|
706
|
-
].includes(extension)) return /* @__PURE__ */
|
|
705
|
+
].includes(extension)) return /* @__PURE__ */ jsx(FileArchiveIcon, {});
|
|
707
706
|
if ([
|
|
708
707
|
"exe",
|
|
709
708
|
"msi",
|
|
@@ -711,8 +710,8 @@ function getFileIcon(file) {
|
|
|
711
710
|
"apk",
|
|
712
711
|
"deb",
|
|
713
712
|
"rpm"
|
|
714
|
-
].includes(extension) || type.startsWith("application/")) return /* @__PURE__ */
|
|
715
|
-
return /* @__PURE__ */
|
|
713
|
+
].includes(extension) || type.startsWith("application/")) return /* @__PURE__ */ jsx(FileCogIcon, {});
|
|
714
|
+
return /* @__PURE__ */ jsx(FileIcon, {});
|
|
716
715
|
}
|
|
717
716
|
function FileUploadItemPreview(props) {
|
|
718
717
|
const { render, asChild, children, className, ...previewProps } = props;
|
|
@@ -725,7 +724,7 @@ function FileUploadItemPreview(props) {
|
|
|
725
724
|
url = URL.createObjectURL(file);
|
|
726
725
|
context.urlCache.set(file, url);
|
|
727
726
|
}
|
|
728
|
-
return /* @__PURE__ */
|
|
727
|
+
return /* @__PURE__ */ jsx("img", {
|
|
729
728
|
src: url,
|
|
730
729
|
alt: file.name,
|
|
731
730
|
className: "size-full object-cover"
|
|
@@ -738,7 +737,7 @@ function FileUploadItemPreview(props) {
|
|
|
738
737
|
return getDefaultRender(file);
|
|
739
738
|
}, [render, getDefaultRender]);
|
|
740
739
|
if (!itemContext.fileState) return null;
|
|
741
|
-
return /* @__PURE__ */
|
|
740
|
+
return /* @__PURE__ */ jsxs(asChild ? Slot : "div", {
|
|
742
741
|
"aria-labelledby": itemContext.nameId,
|
|
743
742
|
"data-slot": "file-upload-preview",
|
|
744
743
|
...previewProps,
|
|
@@ -751,23 +750,23 @@ function FileUploadItemMetadata(props) {
|
|
|
751
750
|
const context = useFileUploadContext(ITEM_METADATA_NAME);
|
|
752
751
|
const itemContext = useFileUploadItemContext(ITEM_METADATA_NAME);
|
|
753
752
|
if (!itemContext.fileState) return null;
|
|
754
|
-
return /* @__PURE__ */
|
|
753
|
+
return /* @__PURE__ */ jsx(asChild ? Slot : "div", {
|
|
755
754
|
"data-slot": "file-upload-metadata",
|
|
756
755
|
dir: context.dir,
|
|
757
756
|
...metadataProps,
|
|
758
757
|
className: cn("flex min-w-0 flex-1 flex-col", className),
|
|
759
|
-
children: children ?? /* @__PURE__ */
|
|
760
|
-
/* @__PURE__ */
|
|
758
|
+
children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
759
|
+
/* @__PURE__ */ jsx("span", {
|
|
761
760
|
id: itemContext.nameId,
|
|
762
761
|
className: cn("truncate font-medium text-sm", size === "sm" && "font-normal text-[13px] leading-snug"),
|
|
763
762
|
children: itemContext.fileState.file.name
|
|
764
763
|
}),
|
|
765
|
-
/* @__PURE__ */
|
|
764
|
+
/* @__PURE__ */ jsx("span", {
|
|
766
765
|
id: itemContext.sizeId,
|
|
767
766
|
className: cn("truncate text-muted-foreground text-xs", size === "sm" && "text-[11px] leading-snug"),
|
|
768
767
|
children: formatBytes(itemContext.fileState.file.size)
|
|
769
768
|
}),
|
|
770
|
-
itemContext.fileState.error && /* @__PURE__ */
|
|
769
|
+
itemContext.fileState.error && /* @__PURE__ */ jsx("span", {
|
|
771
770
|
id: itemContext.messageId,
|
|
772
771
|
className: "text-destructive text-xs",
|
|
773
772
|
children: itemContext.fileState.error
|
|
@@ -785,7 +784,7 @@ function FileUploadItemProgress(props) {
|
|
|
785
784
|
case "circular": {
|
|
786
785
|
const circumference = 2 * Math.PI * ((size - 4) / 2);
|
|
787
786
|
const strokeDashoffset = circumference - itemContext.fileState.progress / 100 * circumference;
|
|
788
|
-
return /* @__PURE__ */
|
|
787
|
+
return /* @__PURE__ */ jsx(ItemProgressPrimitive, {
|
|
789
788
|
role: "progressbar",
|
|
790
789
|
"aria-valuemin": 0,
|
|
791
790
|
"aria-valuemax": 100,
|
|
@@ -795,20 +794,20 @@ function FileUploadItemProgress(props) {
|
|
|
795
794
|
"data-slot": "file-upload-progress",
|
|
796
795
|
...progressProps,
|
|
797
796
|
className: cn("-translate-x-1/2 -translate-y-1/2 absolute top-1/2 left-1/2", className),
|
|
798
|
-
children: /* @__PURE__ */
|
|
797
|
+
children: /* @__PURE__ */ jsxs("svg", {
|
|
799
798
|
className: "-rotate-90 transform",
|
|
800
799
|
width: size,
|
|
801
800
|
height: size,
|
|
802
801
|
viewBox: `0 0 ${size} ${size}`,
|
|
803
802
|
fill: "none",
|
|
804
803
|
stroke: "currentColor",
|
|
805
|
-
children: [/* @__PURE__ */
|
|
804
|
+
children: [/* @__PURE__ */ jsx("circle", {
|
|
806
805
|
className: "text-primary/20",
|
|
807
806
|
strokeWidth: "2",
|
|
808
807
|
cx: size / 2,
|
|
809
808
|
cy: size / 2,
|
|
810
809
|
r: (size - 4) / 2
|
|
811
|
-
}), /* @__PURE__ */
|
|
810
|
+
}), /* @__PURE__ */ jsx("circle", {
|
|
812
811
|
className: "text-primary transition-[stroke-dashoffset] duration-300 ease-linear",
|
|
813
812
|
strokeWidth: "2",
|
|
814
813
|
strokeLinecap: "round",
|
|
@@ -824,7 +823,7 @@ function FileUploadItemProgress(props) {
|
|
|
824
823
|
case "fill": {
|
|
825
824
|
const progressPercentage = itemContext.fileState.progress;
|
|
826
825
|
const topInset = 100 - progressPercentage;
|
|
827
|
-
return /* @__PURE__ */
|
|
826
|
+
return /* @__PURE__ */ jsx(ItemProgressPrimitive, {
|
|
828
827
|
role: "progressbar",
|
|
829
828
|
"aria-valuemin": 0,
|
|
830
829
|
"aria-valuemax": 100,
|
|
@@ -837,7 +836,7 @@ function FileUploadItemProgress(props) {
|
|
|
837
836
|
style: { clipPath: `inset(${topInset}% 0% 0% 0%)` }
|
|
838
837
|
});
|
|
839
838
|
}
|
|
840
|
-
default: return /* @__PURE__ */
|
|
839
|
+
default: return /* @__PURE__ */ jsx(ItemProgressPrimitive, {
|
|
841
840
|
role: "progressbar",
|
|
842
841
|
"aria-valuemin": 0,
|
|
843
842
|
"aria-valuemax": 100,
|
|
@@ -847,7 +846,7 @@ function FileUploadItemProgress(props) {
|
|
|
847
846
|
"data-slot": "file-upload-progress",
|
|
848
847
|
...progressProps,
|
|
849
848
|
className: cn("relative h-1.5 w-full overflow-hidden rounded-full bg-primary/20", className),
|
|
850
|
-
children: /* @__PURE__ */
|
|
849
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
851
850
|
className: "h-full w-full flex-1 bg-primary transition-transform duration-300 ease-linear",
|
|
852
851
|
style: { transform: `translateX(-${100 - itemContext.fileState.progress}%)` }
|
|
853
852
|
})
|
|
@@ -871,7 +870,7 @@ function FileUploadItemDelete(props) {
|
|
|
871
870
|
onClickProp
|
|
872
871
|
]);
|
|
873
872
|
if (!itemContext.fileState) return null;
|
|
874
|
-
return /* @__PURE__ */
|
|
873
|
+
return /* @__PURE__ */ jsx(asChild ? Slot : "button", {
|
|
875
874
|
type: "button",
|
|
876
875
|
"aria-controls": itemContext.id,
|
|
877
876
|
"aria-describedby": itemContext.nameId,
|
|
@@ -892,7 +891,7 @@ function FileUploadClear(props) {
|
|
|
892
891
|
store.dispatch({ type: "CLEAR" });
|
|
893
892
|
}, [store, onClickProp]);
|
|
894
893
|
if (!(forceMount || fileCount > 0)) return null;
|
|
895
|
-
return /* @__PURE__ */
|
|
894
|
+
return /* @__PURE__ */ jsx(asChild ? Slot : "button", {
|
|
896
895
|
type: "button",
|
|
897
896
|
"aria-controls": context.listId,
|
|
898
897
|
"data-slot": "file-upload-clear",
|