@pixpilot/shadcn 0.1.7 → 0.1.9

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.
Files changed (170) hide show
  1. package/dist/_virtual/rolldown_runtime.cjs +1 -0
  2. package/dist/components/index.cjs +1 -0
  3. package/dist/components/index.d.cts +30 -0
  4. package/dist/components/index.d.ts +30 -0
  5. package/dist/components/index.js +1 -0
  6. package/dist/components/ui/OrContinueWithSeparator.cjs +1 -0
  7. package/dist/components/ui/OrContinueWithSeparator.d.cts +11 -0
  8. package/dist/components/ui/OrContinueWithSeparator.d.ts +11 -0
  9. package/dist/components/ui/OrContinueWithSeparator.js +1 -0
  10. package/dist/components/ui/alert-dialog.cjs +1 -0
  11. package/dist/components/ui/alert-dialog.d.cts +48 -0
  12. package/dist/components/ui/alert-dialog.d.ts +48 -0
  13. package/dist/components/ui/alert-dialog.js +1 -0
  14. package/dist/components/ui/alert.cjs +1 -0
  15. package/dist/components/ui/alert.d.cts +24 -0
  16. package/dist/components/ui/alert.d.ts +24 -0
  17. package/dist/components/ui/alert.js +1 -0
  18. package/dist/components/ui/avatar.cjs +1 -0
  19. package/dist/components/ui/avatar.d.cts +19 -0
  20. package/dist/components/ui/avatar.d.ts +19 -0
  21. package/dist/components/ui/avatar.js +1 -0
  22. package/dist/components/ui/badge.cjs +1 -0
  23. package/dist/components/ui/badge.d.cts +19 -0
  24. package/dist/components/ui/badge.d.ts +19 -0
  25. package/dist/components/ui/badge.js +1 -0
  26. package/dist/components/ui/button.cjs +1 -0
  27. package/dist/components/ui/button.d.cts +21 -0
  28. package/dist/components/ui/button.d.ts +21 -0
  29. package/dist/components/ui/button.js +1 -0
  30. package/dist/components/ui/calendar.cjs +1 -0
  31. package/dist/components/ui/calendar.d.cts +26 -0
  32. package/dist/components/ui/calendar.d.ts +26 -0
  33. package/dist/components/ui/calendar.js +1 -0
  34. package/dist/components/ui/card.cjs +1 -0
  35. package/dist/components/ui/card.d.cts +34 -0
  36. package/dist/components/ui/card.d.ts +34 -0
  37. package/dist/components/ui/card.js +1 -0
  38. package/dist/components/ui/checkbox.cjs +1 -0
  39. package/dist/components/ui/checkbox.d.cts +11 -0
  40. package/dist/components/ui/checkbox.d.ts +11 -0
  41. package/dist/components/ui/checkbox.js +1 -0
  42. package/dist/components/ui/command.cjs +1 -0
  43. package/dist/components/ui/command.d.cts +52 -0
  44. package/dist/components/ui/command.d.ts +52 -0
  45. package/dist/components/ui/command.js +1 -0
  46. package/dist/components/ui/dialog.cjs +1 -0
  47. package/dist/components/ui/dialog.d.cts +47 -0
  48. package/dist/components/ui/dialog.d.ts +47 -0
  49. package/dist/components/ui/dialog.js +1 -0
  50. package/dist/components/ui/dropdown-menu.cjs +1 -0
  51. package/dist/components/ui/dropdown-menu.d.cts +77 -0
  52. package/dist/components/ui/dropdown-menu.d.ts +77 -0
  53. package/dist/components/ui/dropdown-menu.js +1 -0
  54. package/dist/components/ui/file-upload.cjs +1 -0
  55. package/dist/components/ui/file-upload.d.cts +94 -0
  56. package/dist/components/ui/file-upload.d.ts +94 -0
  57. package/dist/components/ui/file-upload.js +1 -0
  58. package/dist/components/ui/form.cjs +1 -0
  59. package/dist/components/ui/form.d.cts +45 -0
  60. package/dist/components/ui/form.d.ts +45 -0
  61. package/dist/components/ui/form.js +1 -0
  62. package/dist/components/ui/index.cjs +1 -0
  63. package/dist/components/ui/index.d.cts +29 -0
  64. package/dist/components/ui/index.d.ts +29 -0
  65. package/dist/components/ui/index.js +1 -0
  66. package/dist/components/ui/input.cjs +1 -0
  67. package/dist/components/ui/input.d.cts +11 -0
  68. package/dist/components/ui/input.d.ts +11 -0
  69. package/dist/components/ui/input.js +1 -0
  70. package/dist/components/ui/label.cjs +1 -0
  71. package/dist/components/ui/label.d.cts +11 -0
  72. package/dist/components/ui/label.d.ts +11 -0
  73. package/dist/components/ui/label.js +1 -0
  74. package/dist/components/ui/pagination.cjs +1 -0
  75. package/dist/components/ui/pagination.d.cts +40 -0
  76. package/dist/components/ui/pagination.d.ts +39 -0
  77. package/dist/components/ui/pagination.js +1 -0
  78. package/dist/components/ui/popover.cjs +1 -0
  79. package/dist/components/ui/popover.d.cts +22 -0
  80. package/dist/components/ui/popover.d.ts +22 -0
  81. package/dist/components/ui/popover.js +1 -0
  82. package/dist/components/ui/radio-group.cjs +1 -0
  83. package/dist/components/ui/radio-group.d.cts +15 -0
  84. package/dist/components/ui/radio-group.d.ts +15 -0
  85. package/dist/components/ui/radio-group.js +1 -0
  86. package/dist/components/ui/select.cjs +1 -0
  87. package/dist/components/ui/select.d.cts +52 -0
  88. package/dist/components/ui/select.d.ts +52 -0
  89. package/dist/components/ui/select.js +1 -0
  90. package/dist/components/ui/separator.cjs +1 -0
  91. package/dist/components/ui/separator.d.cts +13 -0
  92. package/dist/components/ui/separator.d.ts +13 -0
  93. package/dist/components/ui/separator.js +1 -0
  94. package/dist/components/ui/shadcn-io/tags/index.cjs +1 -0
  95. package/dist/components/ui/shadcn-io/tags/index.d.cts +70 -0
  96. package/dist/components/ui/shadcn-io/tags/index.d.ts +70 -0
  97. package/dist/components/ui/shadcn-io/tags/index.js +1 -0
  98. package/dist/components/ui/shadcn-io/tags-input-inline/index.cjs +1 -0
  99. package/dist/components/ui/shadcn-io/tags-input-inline/index.d.cts +31 -0
  100. package/dist/components/ui/shadcn-io/tags-input-inline/index.d.ts +31 -0
  101. package/dist/components/ui/shadcn-io/tags-input-inline/index.js +1 -0
  102. package/dist/components/ui/sheet.cjs +1 -0
  103. package/dist/components/ui/sheet.d.cts +40 -0
  104. package/dist/components/ui/sheet.d.ts +40 -0
  105. package/dist/components/ui/sheet.js +1 -0
  106. package/dist/components/ui/slider.cjs +1 -0
  107. package/dist/components/ui/slider.d.cts +15 -0
  108. package/dist/components/ui/slider.d.ts +15 -0
  109. package/dist/components/ui/slider.js +1 -0
  110. package/dist/components/ui/switch.cjs +1 -0
  111. package/dist/components/ui/switch.d.cts +11 -0
  112. package/dist/components/ui/switch.d.ts +11 -0
  113. package/dist/components/ui/switch.js +1 -0
  114. package/dist/components/ui/tabs.cjs +1 -0
  115. package/dist/components/ui/tabs.d.cts +23 -0
  116. package/dist/components/ui/tabs.d.ts +23 -0
  117. package/dist/components/ui/tabs.js +1 -0
  118. package/dist/components/ui/textarea.cjs +1 -0
  119. package/dist/components/ui/textarea.d.cts +10 -0
  120. package/dist/components/ui/textarea.d.ts +10 -0
  121. package/dist/components/ui/textarea.js +1 -0
  122. package/dist/components/ui/tooltip.cjs +1 -0
  123. package/dist/components/ui/tooltip.d.cts +23 -0
  124. package/dist/components/ui/tooltip.d.ts +23 -0
  125. package/dist/components/ui/tooltip.js +1 -0
  126. package/dist/dist/components/ui/OrContinueWithSeparator.d.cts +1 -0
  127. package/dist/dist/components/ui/alert-dialog.d.cts +3 -0
  128. package/dist/dist/components/ui/alert.d.cts +3 -0
  129. package/dist/dist/components/ui/avatar.d.cts +3 -0
  130. package/dist/dist/components/ui/badge.d.cts +3 -0
  131. package/dist/dist/components/ui/button.d.cts +23 -0
  132. package/dist/dist/components/ui/calendar.d.cts +4 -0
  133. package/dist/dist/components/ui/card.d.cts +2 -0
  134. package/dist/dist/components/ui/checkbox.d.cts +3 -0
  135. package/dist/dist/components/ui/command.d.cts +4 -0
  136. package/dist/dist/components/ui/dialog.d.cts +3 -0
  137. package/dist/dist/components/ui/dropdown-menu.d.cts +3 -0
  138. package/dist/dist/components/ui/file-upload.d.cts +2 -0
  139. package/dist/dist/components/ui/form.d.cts +5 -0
  140. package/dist/dist/components/ui/input.d.cts +2 -0
  141. package/dist/dist/components/ui/label.d.cts +3 -0
  142. package/dist/dist/components/ui/pagination.d.cts +3 -0
  143. package/dist/dist/components/ui/popover.d.cts +3 -0
  144. package/dist/dist/components/ui/radio-group.d.cts +3 -0
  145. package/dist/dist/components/ui/select.d.cts +3 -0
  146. package/dist/dist/components/ui/separator.d.cts +3 -0
  147. package/dist/dist/components/ui/shadcn-io/tags/index.d.cts +6 -0
  148. package/dist/dist/components/ui/shadcn-io/tags-input-inline/index.d.cts +2 -0
  149. package/dist/dist/components/ui/sheet.d.cts +3 -0
  150. package/dist/dist/components/ui/slider.d.cts +3 -0
  151. package/dist/dist/components/ui/switch.d.cts +3 -0
  152. package/dist/dist/components/ui/tabs.d.cts +3 -0
  153. package/dist/dist/components/ui/textarea.d.cts +2 -0
  154. package/dist/dist/components/ui/tooltip.d.cts +3 -0
  155. package/dist/dist/index.d.cts +30 -0
  156. package/dist/dist/lib/utils.d.cts +1 -0
  157. package/dist/index.cjs +1 -0
  158. package/dist/index.d.cts +33 -0
  159. package/dist/index.d.ts +33 -0
  160. package/dist/index.js +1 -2278
  161. package/dist/lib/index.cjs +1 -0
  162. package/dist/lib/index.d.cts +1 -0
  163. package/dist/lib/index.d.ts +1 -0
  164. package/dist/lib/index.js +1 -0
  165. package/dist/lib/utils.cjs +1 -0
  166. package/dist/lib/utils.d.cts +6 -0
  167. package/dist/lib/utils.d.ts +6 -0
  168. package/dist/lib/utils.js +1 -0
  169. package/package.json +8 -4
  170. package/dist/index-ZnekuREv.d.ts +0 -795
@@ -0,0 +1 @@
1
+ import{cn as e}from"../../lib/utils.js";import"../../lib/index.js";import"react";import{jsx as t}from"react/jsx-runtime";function n({className:n,...r}){return t(`div`,{"data-slot":`card`,className:e(`bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm`,n),...r})}function r({className:n,...r}){return t(`div`,{"data-slot":`card-header`,className:e(`@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6`,n),...r})}function i({className:n,...r}){return t(`div`,{"data-slot":`card-title`,className:e(`leading-none font-semibold`,n),...r})}function a({className:n,...r}){return t(`div`,{"data-slot":`card-description`,className:e(`text-muted-foreground text-sm`,n),...r})}function o({className:n,...r}){return t(`div`,{"data-slot":`card-action`,className:e(`col-start-2 row-span-2 row-start-1 self-start justify-self-end`,n),...r})}function s({className:n,...r}){return t(`div`,{"data-slot":`card-content`,className:e(`px-6`,n),...r})}function c({className:n,...r}){return t(`div`,{"data-slot":`card-footer`,className:e(`flex items-center px-6 [.border-t]:pt-6`,n),...r})}export{n as Card,o as CardAction,s as CardContent,a as CardDescription,c as CardFooter,r as CardHeader,i as CardTitle};
@@ -0,0 +1 @@
1
+ "use client";const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`../../lib/utils.cjs`);require(`../../lib/index.cjs`);let n=require(`react`);n=e.__toESM(n);let r=require(`react/jsx-runtime`);r=e.__toESM(r);let i=require(`lucide-react`);i=e.__toESM(i);let a=require(`@radix-ui/react-checkbox`);a=e.__toESM(a);function o({className:e,...n}){return(0,r.jsx)(a.Root,{"data-slot":`checkbox`,className:t.cn(`peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50`,e),...n,children:(0,r.jsx)(a.Indicator,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none`,children:(0,r.jsx)(i.CheckIcon,{className:`size-3.5`})})})}exports.Checkbox=o;
@@ -0,0 +1,11 @@
1
+ import * as react_jsx_runtime46 from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
4
+
5
+ //#region src/components/ui/checkbox.d.ts
6
+ declare function Checkbox({
7
+ className,
8
+ ...props
9
+ }: React.ComponentProps<typeof CheckboxPrimitive.Root>): react_jsx_runtime46.JSX.Element;
10
+ //#endregion
11
+ export { Checkbox };
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ import * as react_jsx_runtime27 from "react/jsx-runtime";
3
+ import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
4
+
5
+ //#region src/components/ui/checkbox.d.ts
6
+ declare function Checkbox({
7
+ className,
8
+ ...props
9
+ }: React.ComponentProps<typeof CheckboxPrimitive.Root>): react_jsx_runtime27.JSX.Element;
10
+ //#endregion
11
+ export { Checkbox };
@@ -0,0 +1 @@
1
+ "use client";import{cn as e}from"../../lib/utils.js";import"../../lib/index.js";import"react";import{jsx as t}from"react/jsx-runtime";import{CheckIcon as n}from"lucide-react";import*as r from"@radix-ui/react-checkbox";function i({className:i,...a}){return t(r.Root,{"data-slot":`checkbox`,className:e(`peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50`,i),...a,children:t(r.Indicator,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none`,children:t(n,{className:`size-3.5`})})})}export{i as Checkbox};
@@ -0,0 +1 @@
1
+ "use client";const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`../../lib/utils.cjs`);require(`../../lib/index.cjs`);const n=require(`./dialog.cjs`);let r=require(`react`);r=e.__toESM(r);let i=require(`react/jsx-runtime`);i=e.__toESM(i);let a=require(`lucide-react`);a=e.__toESM(a);let o=require(`cmdk`);o=e.__toESM(o);function s({className:e,...n}){return(0,i.jsx)(o.Command,{"data-slot":`command`,className:t.cn(`bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md`,e),...n})}function c({title:e=`Command Palette`,description:r=`Search for a command to run...`,children:a,className:o,showCloseButton:c=!0,...l}){return(0,i.jsxs)(n.Dialog,{...l,children:[(0,i.jsxs)(n.DialogHeader,{className:`sr-only`,children:[(0,i.jsx)(n.DialogTitle,{children:e}),(0,i.jsx)(n.DialogDescription,{children:r})]}),(0,i.jsx)(n.DialogContent,{className:t.cn(`overflow-hidden p-0`,o),showCloseButton:c,children:(0,i.jsx)(s,{className:`[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,children:a})})]})}function l({className:e,...n}){return(0,i.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex h-9 items-center gap-2 border-b px-3`,children:[(0,i.jsx)(a.SearchIcon,{className:`size-4 shrink-0 opacity-50`}),(0,i.jsx)(o.Command.Input,{"data-slot":`command-input`,className:t.cn(`placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...n})]})}function u({className:e,...n}){return(0,i.jsx)(o.Command.List,{"data-slot":`command-list`,className:t.cn(`max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto`,e),...n})}function d({...e}){return(0,i.jsx)(o.Command.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e})}function f({className:e,...n}){return(0,i.jsx)(o.Command.Group,{"data-slot":`command-group`,className:t.cn(`text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium`,e),...n})}function p({className:e,...n}){return(0,i.jsx)(o.Command.Separator,{"data-slot":`command-separator`,className:t.cn(`bg-border -mx-1 h-px`,e),...n})}function m({className:e,...n}){return(0,i.jsx)(o.Command.Item,{"data-slot":`command-item`,className:t.cn(`data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n})}function h({className:e,...n}){return(0,i.jsx)(`span`,{"data-slot":`command-shortcut`,className:t.cn(`text-muted-foreground ml-auto text-xs tracking-widest`,e),...n})}exports.Command=s,exports.CommandDialog=c,exports.CommandEmpty=d,exports.CommandGroup=f,exports.CommandInput=l,exports.CommandItem=m,exports.CommandList=u,exports.CommandSeparator=p,exports.CommandShortcut=h;
@@ -0,0 +1,52 @@
1
+ import { Dialog } from "./dialog.cjs";
2
+ import * as react_jsx_runtime27 from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { Command } from "cmdk";
5
+
6
+ //#region src/components/ui/command.d.ts
7
+ declare function Command$1({
8
+ className,
9
+ ...props
10
+ }: React.ComponentProps<typeof Command>): react_jsx_runtime27.JSX.Element;
11
+ declare function CommandDialog({
12
+ title,
13
+ description,
14
+ children,
15
+ className,
16
+ showCloseButton,
17
+ ...props
18
+ }: React.ComponentProps<typeof Dialog> & {
19
+ title?: string;
20
+ description?: string;
21
+ className?: string;
22
+ showCloseButton?: boolean;
23
+ }): react_jsx_runtime27.JSX.Element;
24
+ declare function CommandInput({
25
+ className,
26
+ ...props
27
+ }: React.ComponentProps<typeof Command.Input>): react_jsx_runtime27.JSX.Element;
28
+ declare function CommandList({
29
+ className,
30
+ ...props
31
+ }: React.ComponentProps<typeof Command.List>): react_jsx_runtime27.JSX.Element;
32
+ declare function CommandEmpty({
33
+ ...props
34
+ }: React.ComponentProps<typeof Command.Empty>): react_jsx_runtime27.JSX.Element;
35
+ declare function CommandGroup({
36
+ className,
37
+ ...props
38
+ }: React.ComponentProps<typeof Command.Group>): react_jsx_runtime27.JSX.Element;
39
+ declare function CommandSeparator({
40
+ className,
41
+ ...props
42
+ }: React.ComponentProps<typeof Command.Separator>): react_jsx_runtime27.JSX.Element;
43
+ declare function CommandItem({
44
+ className,
45
+ ...props
46
+ }: React.ComponentProps<typeof Command.Item>): react_jsx_runtime27.JSX.Element;
47
+ declare function CommandShortcut({
48
+ className,
49
+ ...props
50
+ }: React.ComponentProps<'span'>): react_jsx_runtime27.JSX.Element;
51
+ //#endregion
52
+ export { Command$1 as Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut };
@@ -0,0 +1,52 @@
1
+ import { Dialog } from "./dialog.js";
2
+ import * as React from "react";
3
+ import * as react_jsx_runtime28 from "react/jsx-runtime";
4
+ import { Command } from "cmdk";
5
+
6
+ //#region src/components/ui/command.d.ts
7
+ declare function Command$1({
8
+ className,
9
+ ...props
10
+ }: React.ComponentProps<typeof Command>): react_jsx_runtime28.JSX.Element;
11
+ declare function CommandDialog({
12
+ title,
13
+ description,
14
+ children,
15
+ className,
16
+ showCloseButton,
17
+ ...props
18
+ }: React.ComponentProps<typeof Dialog> & {
19
+ title?: string;
20
+ description?: string;
21
+ className?: string;
22
+ showCloseButton?: boolean;
23
+ }): react_jsx_runtime28.JSX.Element;
24
+ declare function CommandInput({
25
+ className,
26
+ ...props
27
+ }: React.ComponentProps<typeof Command.Input>): react_jsx_runtime28.JSX.Element;
28
+ declare function CommandList({
29
+ className,
30
+ ...props
31
+ }: React.ComponentProps<typeof Command.List>): react_jsx_runtime28.JSX.Element;
32
+ declare function CommandEmpty({
33
+ ...props
34
+ }: React.ComponentProps<typeof Command.Empty>): react_jsx_runtime28.JSX.Element;
35
+ declare function CommandGroup({
36
+ className,
37
+ ...props
38
+ }: React.ComponentProps<typeof Command.Group>): react_jsx_runtime28.JSX.Element;
39
+ declare function CommandSeparator({
40
+ className,
41
+ ...props
42
+ }: React.ComponentProps<typeof Command.Separator>): react_jsx_runtime28.JSX.Element;
43
+ declare function CommandItem({
44
+ className,
45
+ ...props
46
+ }: React.ComponentProps<typeof Command.Item>): react_jsx_runtime28.JSX.Element;
47
+ declare function CommandShortcut({
48
+ className,
49
+ ...props
50
+ }: React.ComponentProps<'span'>): react_jsx_runtime28.JSX.Element;
51
+ //#endregion
52
+ export { Command$1 as Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut };
@@ -0,0 +1 @@
1
+ "use client";import{cn as e}from"../../lib/utils.js";import"../../lib/index.js";import{Dialog as t,DialogContent as n,DialogDescription as r,DialogHeader as i,DialogTitle as a}from"./dialog.js";import"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{SearchIcon as c}from"lucide-react";import{Command as l}from"cmdk";function u({className:t,...n}){return o(l,{"data-slot":`command`,className:e(`bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md`,t),...n})}function d({title:c=`Command Palette`,description:l=`Search for a command to run...`,children:d,className:f,showCloseButton:p=!0,...m}){return s(t,{...m,children:[s(i,{className:`sr-only`,children:[o(a,{children:c}),o(r,{children:l})]}),o(n,{className:e(`overflow-hidden p-0`,f),showCloseButton:p,children:o(u,{className:`[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,children:d})})]})}function f({className:t,...n}){return s(`div`,{"data-slot":`command-input-wrapper`,className:`flex h-9 items-center gap-2 border-b px-3`,children:[o(c,{className:`size-4 shrink-0 opacity-50`}),o(l.Input,{"data-slot":`command-input`,className:e(`placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,t),...n})]})}function p({className:t,...n}){return o(l.List,{"data-slot":`command-list`,className:e(`max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto`,t),...n})}function m({...e}){return o(l.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e})}function h({className:t,...n}){return o(l.Group,{"data-slot":`command-group`,className:e(`text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium`,t),...n})}function g({className:t,...n}){return o(l.Separator,{"data-slot":`command-separator`,className:e(`bg-border -mx-1 h-px`,t),...n})}function _({className:t,...n}){return o(l.Item,{"data-slot":`command-item`,className:e(`data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,t),...n})}function v({className:t,...n}){return o(`span`,{"data-slot":`command-shortcut`,className:e(`text-muted-foreground ml-auto text-xs tracking-widest`,t),...n})}export{u as Command,d as CommandDialog,m as CommandEmpty,h as CommandGroup,f as CommandInput,_ as CommandItem,p as CommandList,g as CommandSeparator,v as CommandShortcut};
@@ -0,0 +1 @@
1
+ const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`../../lib/utils.cjs`);require(`../../lib/index.cjs`);let n=require(`react`);n=e.__toESM(n);let r=require(`react/jsx-runtime`);r=e.__toESM(r);let i=require(`lucide-react`);i=e.__toESM(i);let a=require(`@radix-ui/react-dialog`);a=e.__toESM(a);function o({...e}){return(0,r.jsx)(a.Root,{"data-slot":`dialog`,...e})}function s({...e}){return(0,r.jsx)(a.Trigger,{"data-slot":`dialog-trigger`,...e})}function c({...e}){return(0,r.jsx)(a.Portal,{"data-slot":`dialog-portal`,...e})}function l({...e}){return(0,r.jsx)(a.Close,{"data-slot":`dialog-close`,...e})}function u({className:e,...n}){return(0,r.jsx)(a.Overlay,{"data-slot":`dialog-overlay`,className:t.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`,e),...n})}function d({className:e,children:n,showCloseButton:o=!0,...s}){return(0,r.jsxs)(c,{"data-slot":`dialog-portal`,children:[(0,r.jsx)(u,{}),(0,r.jsxs)(a.Content,{"data-slot":`dialog-content`,className:t.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`,e),...s,children:[n,o&&(0,r.jsxs)(a.Close,{"data-slot":`dialog-close`,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`,children:[(0,r.jsx)(i.XIcon,{}),(0,r.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function f({className:e,...n}){return(0,r.jsx)(`div`,{"data-slot":`dialog-header`,className:t.cn(`flex flex-col gap-2 text-center sm:text-left`,e),...n})}function p({className:e,...n}){return(0,r.jsx)(`div`,{"data-slot":`dialog-footer`,className:t.cn(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...n})}function m({className:e,...n}){return(0,r.jsx)(a.Title,{"data-slot":`dialog-title`,className:t.cn(`text-lg leading-none font-semibold`,e),...n})}function h({className:e,...n}){return(0,r.jsx)(a.Description,{"data-slot":`dialog-description`,className:t.cn(`text-muted-foreground text-sm`,e),...n})}exports.Dialog=o,exports.DialogClose=l,exports.DialogContent=d,exports.DialogDescription=h,exports.DialogFooter=p,exports.DialogHeader=f,exports.DialogOverlay=u,exports.DialogPortal=c,exports.DialogTitle=m,exports.DialogTrigger=s;
@@ -0,0 +1,47 @@
1
+ import * as react_jsx_runtime36 from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
4
+
5
+ //#region src/components/ui/dialog.d.ts
6
+ declare function Dialog({
7
+ ...props
8
+ }: React.ComponentProps<typeof DialogPrimitive.Root>): react_jsx_runtime36.JSX.Element;
9
+ declare function DialogTrigger({
10
+ ...props
11
+ }: React.ComponentProps<typeof DialogPrimitive.Trigger>): react_jsx_runtime36.JSX.Element;
12
+ declare function DialogPortal({
13
+ ...props
14
+ }: React.ComponentProps<typeof DialogPrimitive.Portal>): react_jsx_runtime36.JSX.Element;
15
+ declare function DialogClose({
16
+ ...props
17
+ }: React.ComponentProps<typeof DialogPrimitive.Close>): react_jsx_runtime36.JSX.Element;
18
+ declare function DialogOverlay({
19
+ className,
20
+ ...props
21
+ }: React.ComponentProps<typeof DialogPrimitive.Overlay>): react_jsx_runtime36.JSX.Element;
22
+ declare function DialogContent({
23
+ className,
24
+ children,
25
+ showCloseButton,
26
+ ...props
27
+ }: React.ComponentProps<typeof DialogPrimitive.Content> & {
28
+ showCloseButton?: boolean;
29
+ }): react_jsx_runtime36.JSX.Element;
30
+ declare function DialogHeader({
31
+ className,
32
+ ...props
33
+ }: React.ComponentProps<'div'>): react_jsx_runtime36.JSX.Element;
34
+ declare function DialogFooter({
35
+ className,
36
+ ...props
37
+ }: React.ComponentProps<'div'>): react_jsx_runtime36.JSX.Element;
38
+ declare function DialogTitle({
39
+ className,
40
+ ...props
41
+ }: React.ComponentProps<typeof DialogPrimitive.Title>): react_jsx_runtime36.JSX.Element;
42
+ declare function DialogDescription({
43
+ className,
44
+ ...props
45
+ }: React.ComponentProps<typeof DialogPrimitive.Description>): react_jsx_runtime36.JSX.Element;
46
+ //#endregion
47
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
@@ -0,0 +1,47 @@
1
+ import * as React from "react";
2
+ import * as react_jsx_runtime37 from "react/jsx-runtime";
3
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
4
+
5
+ //#region src/components/ui/dialog.d.ts
6
+ declare function Dialog({
7
+ ...props
8
+ }: React.ComponentProps<typeof DialogPrimitive.Root>): react_jsx_runtime37.JSX.Element;
9
+ declare function DialogTrigger({
10
+ ...props
11
+ }: React.ComponentProps<typeof DialogPrimitive.Trigger>): react_jsx_runtime37.JSX.Element;
12
+ declare function DialogPortal({
13
+ ...props
14
+ }: React.ComponentProps<typeof DialogPrimitive.Portal>): react_jsx_runtime37.JSX.Element;
15
+ declare function DialogClose({
16
+ ...props
17
+ }: React.ComponentProps<typeof DialogPrimitive.Close>): react_jsx_runtime37.JSX.Element;
18
+ declare function DialogOverlay({
19
+ className,
20
+ ...props
21
+ }: React.ComponentProps<typeof DialogPrimitive.Overlay>): react_jsx_runtime37.JSX.Element;
22
+ declare function DialogContent({
23
+ className,
24
+ children,
25
+ showCloseButton,
26
+ ...props
27
+ }: React.ComponentProps<typeof DialogPrimitive.Content> & {
28
+ showCloseButton?: boolean;
29
+ }): react_jsx_runtime37.JSX.Element;
30
+ declare function DialogHeader({
31
+ className,
32
+ ...props
33
+ }: React.ComponentProps<'div'>): react_jsx_runtime37.JSX.Element;
34
+ declare function DialogFooter({
35
+ className,
36
+ ...props
37
+ }: React.ComponentProps<'div'>): react_jsx_runtime37.JSX.Element;
38
+ declare function DialogTitle({
39
+ className,
40
+ ...props
41
+ }: React.ComponentProps<typeof DialogPrimitive.Title>): react_jsx_runtime37.JSX.Element;
42
+ declare function DialogDescription({
43
+ className,
44
+ ...props
45
+ }: React.ComponentProps<typeof DialogPrimitive.Description>): react_jsx_runtime37.JSX.Element;
46
+ //#endregion
47
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
@@ -0,0 +1 @@
1
+ import{cn as e}from"../../lib/utils.js";import"../../lib/index.js";import"react";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{XIcon as r}from"lucide-react";import*as i from"@radix-ui/react-dialog";function a({...e}){return t(i.Root,{"data-slot":`dialog`,...e})}function o({...e}){return t(i.Trigger,{"data-slot":`dialog-trigger`,...e})}function s({...e}){return t(i.Portal,{"data-slot":`dialog-portal`,...e})}function c({...e}){return t(i.Close,{"data-slot":`dialog-close`,...e})}function l({className:n,...r}){return t(i.Overlay,{"data-slot":`dialog-overlay`,className:e(`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`,n),...r})}function u({className:a,children:o,showCloseButton:c=!0,...u}){return n(s,{"data-slot":`dialog-portal`,children:[t(l,{}),n(i.Content,{"data-slot":`dialog-content`,className:e(`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`,a),...u,children:[o,c&&n(i.Close,{"data-slot":`dialog-close`,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`,children:[t(r,{}),t(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function d({className:n,...r}){return t(`div`,{"data-slot":`dialog-header`,className:e(`flex flex-col gap-2 text-center sm:text-left`,n),...r})}function f({className:n,...r}){return t(`div`,{"data-slot":`dialog-footer`,className:e(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,n),...r})}function p({className:n,...r}){return t(i.Title,{"data-slot":`dialog-title`,className:e(`text-lg leading-none font-semibold`,n),...r})}function m({className:n,...r}){return t(i.Description,{"data-slot":`dialog-description`,className:e(`text-muted-foreground text-sm`,n),...r})}export{a as Dialog,c as DialogClose,u as DialogContent,m as DialogDescription,f as DialogFooter,d as DialogHeader,l as DialogOverlay,s as DialogPortal,p as DialogTitle,o as DialogTrigger};
@@ -0,0 +1 @@
1
+ const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`../../lib/utils.cjs`);require(`../../lib/index.cjs`);let n=require(`react`);n=e.__toESM(n);let r=require(`react/jsx-runtime`);r=e.__toESM(r);let i=require(`lucide-react`);i=e.__toESM(i);let a=require(`@radix-ui/react-dropdown-menu`);a=e.__toESM(a);function o({...e}){return(0,r.jsx)(a.Root,{"data-slot":`dropdown-menu`,...e})}function s({...e}){return(0,r.jsx)(a.Portal,{"data-slot":`dropdown-menu-portal`,...e})}function c({...e}){return(0,r.jsx)(a.Trigger,{"data-slot":`dropdown-menu-trigger`,...e})}function l({className:e,sideOffset:n=4,...i}){return(0,r.jsx)(a.Portal,{children:(0,r.jsx)(a.Content,{"data-slot":`dropdown-menu-content`,sideOffset:n,className:t.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`,e),...i})})}function u({...e}){return(0,r.jsx)(a.Group,{"data-slot":`dropdown-menu-group`,...e})}function d({className:e,inset:n,variant:i=`default`,...o}){return(0,r.jsx)(a.Item,{"data-slot":`dropdown-menu-item`,"data-inset":n,"data-variant":i,className:t.cn(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...o})}function f({className:e,children:n,checked:o,...s}){return(0,r.jsxs)(a.CheckboxItem,{"data-slot":`dropdown-menu-checkbox-item`,className:t.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`,e),checked:o,...s,children:[(0,r.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,r.jsx)(a.ItemIndicator,{children:(0,r.jsx)(i.CheckIcon,{className:`size-4`})})}),n]})}function p({...e}){return(0,r.jsx)(a.RadioGroup,{"data-slot":`dropdown-menu-radio-group`,...e})}function m({className:e,children:n,...o}){return(0,r.jsxs)(a.RadioItem,{"data-slot":`dropdown-menu-radio-item`,className:t.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`,e),...o,children:[(0,r.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,r.jsx)(a.ItemIndicator,{children:(0,r.jsx)(i.CircleIcon,{className:`size-2 fill-current`})})}),n]})}function h({className:e,inset:n,...i}){return(0,r.jsx)(a.Label,{"data-slot":`dropdown-menu-label`,"data-inset":n,className:t.cn(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,e),...i})}function g({className:e,...n}){return(0,r.jsx)(a.Separator,{"data-slot":`dropdown-menu-separator`,className:t.cn(`bg-border -mx-1 my-1 h-px`,e),...n})}function _({className:e,...n}){return(0,r.jsx)(`span`,{"data-slot":`dropdown-menu-shortcut`,className:t.cn(`text-muted-foreground ml-auto text-xs tracking-widest`,e),...n})}function v({...e}){return(0,r.jsx)(a.Sub,{"data-slot":`dropdown-menu-sub`,...e})}function y({className:e,inset:n,children:o,...s}){return(0,r.jsxs)(a.SubTrigger,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":n,className:t.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`,e),...s,children:[o,(0,r.jsx)(i.ChevronRightIcon,{className:`ml-auto size-4`})]})}function b({className:e,...n}){return(0,r.jsx)(a.SubContent,{"data-slot":`dropdown-menu-sub-content`,className:t.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`,e),...n})}exports.DropdownMenu=o,exports.DropdownMenuCheckboxItem=f,exports.DropdownMenuContent=l,exports.DropdownMenuGroup=u,exports.DropdownMenuItem=d,exports.DropdownMenuLabel=h,exports.DropdownMenuPortal=s,exports.DropdownMenuRadioGroup=p,exports.DropdownMenuRadioItem=m,exports.DropdownMenuSeparator=g,exports.DropdownMenuShortcut=_,exports.DropdownMenuSub=v,exports.DropdownMenuSubContent=b,exports.DropdownMenuSubTrigger=y,exports.DropdownMenuTrigger=c;
@@ -0,0 +1,77 @@
1
+ import * as react_jsx_runtime47 from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
4
+
5
+ //#region src/components/ui/dropdown-menu.d.ts
6
+ declare function DropdownMenu({
7
+ ...props
8
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): react_jsx_runtime47.JSX.Element;
9
+ declare function DropdownMenuPortal({
10
+ ...props
11
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): react_jsx_runtime47.JSX.Element;
12
+ declare function DropdownMenuTrigger({
13
+ ...props
14
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): react_jsx_runtime47.JSX.Element;
15
+ declare function DropdownMenuContent({
16
+ className,
17
+ sideOffset,
18
+ ...props
19
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): react_jsx_runtime47.JSX.Element;
20
+ declare function DropdownMenuGroup({
21
+ ...props
22
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): react_jsx_runtime47.JSX.Element;
23
+ declare function DropdownMenuItem({
24
+ className,
25
+ inset,
26
+ variant,
27
+ ...props
28
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
29
+ inset?: boolean;
30
+ variant?: 'default' | 'destructive';
31
+ }): react_jsx_runtime47.JSX.Element;
32
+ declare function DropdownMenuCheckboxItem({
33
+ className,
34
+ children,
35
+ checked,
36
+ ...props
37
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>): react_jsx_runtime47.JSX.Element;
38
+ declare function DropdownMenuRadioGroup({
39
+ ...props
40
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): react_jsx_runtime47.JSX.Element;
41
+ declare function DropdownMenuRadioItem({
42
+ className,
43
+ children,
44
+ ...props
45
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): react_jsx_runtime47.JSX.Element;
46
+ declare function DropdownMenuLabel({
47
+ className,
48
+ inset,
49
+ ...props
50
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
51
+ inset?: boolean;
52
+ }): react_jsx_runtime47.JSX.Element;
53
+ declare function DropdownMenuSeparator({
54
+ className,
55
+ ...props
56
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): react_jsx_runtime47.JSX.Element;
57
+ declare function DropdownMenuShortcut({
58
+ className,
59
+ ...props
60
+ }: React.ComponentProps<'span'>): react_jsx_runtime47.JSX.Element;
61
+ declare function DropdownMenuSub({
62
+ ...props
63
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): react_jsx_runtime47.JSX.Element;
64
+ declare function DropdownMenuSubTrigger({
65
+ className,
66
+ inset,
67
+ children,
68
+ ...props
69
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
70
+ inset?: boolean;
71
+ }): react_jsx_runtime47.JSX.Element;
72
+ declare function DropdownMenuSubContent({
73
+ className,
74
+ ...props
75
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): react_jsx_runtime47.JSX.Element;
76
+ //#endregion
77
+ export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
@@ -0,0 +1,77 @@
1
+ import * as React from "react";
2
+ import * as react_jsx_runtime63 from "react/jsx-runtime";
3
+ import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
4
+
5
+ //#region src/components/ui/dropdown-menu.d.ts
6
+ declare function DropdownMenu({
7
+ ...props
8
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): react_jsx_runtime63.JSX.Element;
9
+ declare function DropdownMenuPortal({
10
+ ...props
11
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): react_jsx_runtime63.JSX.Element;
12
+ declare function DropdownMenuTrigger({
13
+ ...props
14
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): react_jsx_runtime63.JSX.Element;
15
+ declare function DropdownMenuContent({
16
+ className,
17
+ sideOffset,
18
+ ...props
19
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): react_jsx_runtime63.JSX.Element;
20
+ declare function DropdownMenuGroup({
21
+ ...props
22
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): react_jsx_runtime63.JSX.Element;
23
+ declare function DropdownMenuItem({
24
+ className,
25
+ inset,
26
+ variant,
27
+ ...props
28
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
29
+ inset?: boolean;
30
+ variant?: 'default' | 'destructive';
31
+ }): react_jsx_runtime63.JSX.Element;
32
+ declare function DropdownMenuCheckboxItem({
33
+ className,
34
+ children,
35
+ checked,
36
+ ...props
37
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>): react_jsx_runtime63.JSX.Element;
38
+ declare function DropdownMenuRadioGroup({
39
+ ...props
40
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): react_jsx_runtime63.JSX.Element;
41
+ declare function DropdownMenuRadioItem({
42
+ className,
43
+ children,
44
+ ...props
45
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): react_jsx_runtime63.JSX.Element;
46
+ declare function DropdownMenuLabel({
47
+ className,
48
+ inset,
49
+ ...props
50
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
51
+ inset?: boolean;
52
+ }): react_jsx_runtime63.JSX.Element;
53
+ declare function DropdownMenuSeparator({
54
+ className,
55
+ ...props
56
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): react_jsx_runtime63.JSX.Element;
57
+ declare function DropdownMenuShortcut({
58
+ className,
59
+ ...props
60
+ }: React.ComponentProps<'span'>): react_jsx_runtime63.JSX.Element;
61
+ declare function DropdownMenuSub({
62
+ ...props
63
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): react_jsx_runtime63.JSX.Element;
64
+ declare function DropdownMenuSubTrigger({
65
+ className,
66
+ inset,
67
+ children,
68
+ ...props
69
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
70
+ inset?: boolean;
71
+ }): react_jsx_runtime63.JSX.Element;
72
+ declare function DropdownMenuSubContent({
73
+ className,
74
+ ...props
75
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): react_jsx_runtime63.JSX.Element;
76
+ //#endregion
77
+ export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
@@ -0,0 +1 @@
1
+ import{cn as e}from"../../lib/utils.js";import"../../lib/index.js";import"react";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{CheckIcon as r,ChevronRightIcon as i,CircleIcon as a}from"lucide-react";import*as o from"@radix-ui/react-dropdown-menu";function s({...e}){return t(o.Root,{"data-slot":`dropdown-menu`,...e})}function c({...e}){return t(o.Portal,{"data-slot":`dropdown-menu-portal`,...e})}function l({...e}){return t(o.Trigger,{"data-slot":`dropdown-menu-trigger`,...e})}function u({className:n,sideOffset:r=4,...i}){return t(o.Portal,{children:t(o.Content,{"data-slot":`dropdown-menu-content`,sideOffset:r,className:e(`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`,n),...i})})}function d({...e}){return t(o.Group,{"data-slot":`dropdown-menu-group`,...e})}function f({className:n,inset:r,variant:i=`default`,...a}){return t(o.Item,{"data-slot":`dropdown-menu-item`,"data-inset":r,"data-variant":i,className:e(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,n),...a})}function p({className:i,children:a,checked:s,...c}){return n(o.CheckboxItem,{"data-slot":`dropdown-menu-checkbox-item`,className:e(`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`,i),checked:s,...c,children:[t(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:t(o.ItemIndicator,{children:t(r,{className:`size-4`})})}),a]})}function m({...e}){return t(o.RadioGroup,{"data-slot":`dropdown-menu-radio-group`,...e})}function h({className:r,children:i,...s}){return n(o.RadioItem,{"data-slot":`dropdown-menu-radio-item`,className:e(`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`,r),...s,children:[t(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:t(o.ItemIndicator,{children:t(a,{className:`size-2 fill-current`})})}),i]})}function g({className:n,inset:r,...i}){return t(o.Label,{"data-slot":`dropdown-menu-label`,"data-inset":r,className:e(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,n),...i})}function _({className:n,...r}){return t(o.Separator,{"data-slot":`dropdown-menu-separator`,className:e(`bg-border -mx-1 my-1 h-px`,n),...r})}function v({className:n,...r}){return t(`span`,{"data-slot":`dropdown-menu-shortcut`,className:e(`text-muted-foreground ml-auto text-xs tracking-widest`,n),...r})}function y({...e}){return t(o.Sub,{"data-slot":`dropdown-menu-sub`,...e})}function b({className:r,inset:a,children:s,...c}){return n(o.SubTrigger,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":a,className:e(`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`,r),...c,children:[s,t(i,{className:`ml-auto size-4`})]})}function x({className:n,...r}){return t(o.SubContent,{"data-slot":`dropdown-menu-sub-content`,className:e(`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`,n),...r})}export{s as DropdownMenu,p as DropdownMenuCheckboxItem,u as DropdownMenuContent,d as DropdownMenuGroup,f as DropdownMenuItem,g as DropdownMenuLabel,c as DropdownMenuPortal,m as DropdownMenuRadioGroup,h as DropdownMenuRadioItem,_ as DropdownMenuSeparator,v as DropdownMenuShortcut,y as DropdownMenuSub,x as DropdownMenuSubContent,b as DropdownMenuSubTrigger,l as DropdownMenuTrigger};
@@ -0,0 +1 @@
1
+ "use client";const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`../../lib/utils.cjs`);require(`../../lib/index.cjs`);let n=require(`react`);n=e.__toESM(n);let r=require(`react/jsx-runtime`);r=e.__toESM(r);let i=require(`@radix-ui/react-slot`);i=e.__toESM(i);let a=require(`lucide-react`);a=e.__toESM(a);let o=require(`@radix-ui/react-direction`);o=e.__toESM(o);const s=`FileUpload`,c=`FileUploadDropzone`,l=`FileUploadTrigger`,u=`FileUploadList`,d=`FileUploadItem`,f=`FileUploadItemPreview`,p=`FileUploadItemMetadata`,m=`FileUploadItemProgress`,h=`FileUploadItemDelete`,g=`FileUploadClear`;function _(e){let t=n.useRef(null);return t.current===null&&(t.current=e()),t}function v(e,t,n,r,i){let a={files:t,dragOver:!1,invalid:r};function o(e,r){switch(r.type){case`ADD_FILES`:for(let e of r.files)t.set(e,{file:e,progress:0,status:`idle`});return i&&i(Array.from(t.values()).map(e=>e.file)),{...e,files:t};case`SET_FILES`:{let n=new Set(r.files);for(let e of t.keys())n.has(e)||t.delete(e);for(let e of r.files)t.get(e)||t.set(e,{file:e,progress:0,status:`idle`});return{...e,files:t}}case`SET_PROGRESS`:{let n=t.get(r.file);return n&&t.set(r.file,{...n,progress:r.progress,status:`uploading`}),{...e,files:t}}case`SET_SUCCESS`:{let n=t.get(r.file);return n&&t.set(r.file,{...n,progress:100,status:`success`}),{...e,files:t}}case`SET_ERROR`:{let n=t.get(r.file);return n&&t.set(r.file,{...n,error:r.error,status:`error`}),{...e,files:t}}case`REMOVE_FILE`:if(n){let e=n.get(r.file);e&&(URL.revokeObjectURL(e),n.delete(r.file))}return t.delete(r.file),i&&i(Array.from(t.values()).map(e=>e.file)),{...e,files:t};case`SET_DRAG_OVER`:return{...e,dragOver:r.dragOver};case`SET_INVALID`:return{...e,invalid:r.invalid};case`CLEAR`:if(n)for(let e of t.keys()){let t=n.get(e);t&&(URL.revokeObjectURL(t),n.delete(e))}return t.clear(),i&&i([]),{...e,files:t,invalid:!1};default:return e}}function s(){return a}function c(t){a=o(a,t);for(let t of e)t()}function l(t){return e.add(t),()=>e.delete(t)}return{getState:s,dispatch:c,subscribe:l}}const y=n.createContext(null);function b(e){let t=n.use(y);if(!t)throw Error(`\`${e}\` must be used within \`${s}\``);return t}function x(e){let t=b(`useStore`),r=_(()=>null),i=n.useCallback(()=>{let n=t.getState(),i=r.current;if(i&&i.state===n)return i.value;let a=e(n);return r.current={value:a,state:n},a},[t,e,r]);return n.useSyncExternalStore(t.subscribe,i,i)}const S=n.createContext(null);function C(e){let t=n.use(S);if(!t)throw Error(`\`${e}\` must be used within \`${s}\``);return t}function w(e){let{value:a,defaultValue:s,onValueChange:c,onAccept:l,onFileAccept:u,onFileReject:d,onFilesReject:f,onFileValidate:p,onUpload:m,accept:h,maxFiles:g,maxSize:b,dir:x,label:C,name:w,asChild:T,disabled:E=!1,invalid:D=!1,multiple:O=!1,required:k=!1,children:A,className:j,...M}=e,N=n.useId(),P=n.useId(),F=n.useId(),I=n.useId(),L=(0,o.useDirection)(x),R=_(()=>new Set).current,z=_(()=>new Map).current,B=_(()=>new WeakMap).current,V=n.useRef(null),H=a!==void 0,U=n.useMemo(()=>v(R,z,B,D,c),[R,z,D,c,B]),W=n.useMemo(()=>h?.split(`,`).map(e=>e.trim())??null,[h]),G=_(()=>{let e=0;return(t,n)=>{e||=requestAnimationFrame(()=>{e=0,U.dispatch({type:`SET_PROGRESS`,file:t,progress:Math.min(Math.max(0,n),100)})})}}).current;n.useEffect(()=>{H?U.dispatch({type:`SET_FILES`,files:a}):s&&s.length>0&&!U.getState().files.size&&U.dispatch({type:`SET_FILES`,files:s})},[a,s,H,U]),n.useEffect(()=>()=>{for(let e of z.keys()){let t=B.get(e);t&&URL.revokeObjectURL(t)}},[z,B]);let K=n.useCallback(async e=>{try{for(let t of e)U.dispatch({type:`SET_PROGRESS`,file:t,progress:0});if(m)await m(e,{onProgress:G,onSuccess:e=>{U.dispatch({type:`SET_SUCCESS`,file:e})},onError:(e,t)=>{U.dispatch({type:`SET_ERROR`,file:e,error:t.message??`Upload failed`})}});else for(let t of e)U.dispatch({type:`SET_SUCCESS`,file:t})}catch(t){let n=t instanceof Error?t.message:`Upload failed`;for(let t of e)U.dispatch({type:`SET_ERROR`,file:t,error:n})}},[U,m,G]),q=n.useCallback(e=>{if(E)return;let t=[...e],n=!1,r=[];if(g){let e=U.getState().files.size,i=Math.max(0,g-e);if(i<t.length){let e=t.slice(i);n=!0,t=t.slice(0,i);for(let t of e){let e=`Maximum ${g} files allowed`;if(p){let n=p(t);n&&(e=n)}d?.(t,e),r.push({file:t,message:e})}}}let i=[],a=[];for(let e of t){let t=!1,r=``;if(p){let i=p(e);if(i){r=i,d?.(e,r),t=!0,n=!0;continue}}if(W){let i=e.type,a=`.${e.name.split(`.`).pop()}`;W.some(e=>e===i||e===a||e.includes(`/*`)&&i.startsWith(e.replace(`/*`,`/`)))||(r=`File type not accepted`,d?.(e,r),t=!0,n=!0)}b&&e.size>b&&(r=`File too large`,d?.(e,r),t=!0,n=!0),t?a.push({file:e,message:r}):i.push(e)}if(r.push(...a),n&&(U.dispatch({type:`SET_INVALID`,invalid:n}),setTimeout(()=>{U.dispatch({type:`SET_INVALID`,invalid:!1})},2e3)),r.length>0&&f?.(r),i.length>0){U.dispatch({type:`ADD_FILES`,files:i}),H&&c&&c([...Array.from(U.getState().files.values()).map(e=>e.file)]),l&&l(i);for(let e of i)u?.(e);m&&requestAnimationFrame(()=>{K(i)})}},[U,H,c,l,u,m,K,g,p,d,f,W,b,E]),J=n.useCallback(e=>{q(Array.from(e.target.files??[])),e.target.value=``},[q]),Y=n.useMemo(()=>({dropzoneId:P,inputId:N,listId:F,labelId:I,dir:L,disabled:E,inputRef:V,urlCache:B}),[P,N,F,I,L,E,B]),X=T?i.Slot:`div`;return(0,r.jsx)(y.Provider,{value:U,children:(0,r.jsx)(S.Provider,{value:Y,children:(0,r.jsxs)(X,{"data-disabled":E?``:void 0,"data-slot":`file-upload`,dir:L,...M,className:t.cn(`relative flex flex-col gap-2`,j),children:[A,(0,r.jsx)(`input`,{type:`file`,id:N,"aria-labelledby":I,"aria-describedby":P,ref:V,tabIndex:-1,accept:h,name:w,className:`sr-only`,disabled:E,multiple:O,required:k,onChange:J}),(0,r.jsx)(`span`,{id:I,className:`sr-only`,children:C??`File upload`})]})})})}function T(e){let{asChild:a,className:o,onClick:s,onDragOver:l,onDragEnter:u,onDragLeave:d,onDrop:f,onPaste:p,onKeyDown:m,...h}=e,g=C(c),_=b(c),v=x(e=>e.dragOver),y=x(e=>e.invalid),S=n.useCallback(e=>{if(s?.(e),e.defaultPrevented)return;let{target:t}=e;t instanceof HTMLElement&&t.closest(`[data-slot="file-upload-trigger"]`)||g.inputRef.current?.click()},[g.inputRef,s]),w=n.useCallback(e=>{l?.(e),!e.defaultPrevented&&(e.preventDefault(),_.dispatch({type:`SET_DRAG_OVER`,dragOver:!0}))},[_,l]),T=n.useCallback(e=>{u?.(e),!e.defaultPrevented&&(e.preventDefault(),_.dispatch({type:`SET_DRAG_OVER`,dragOver:!0}))},[_,u]),E=n.useCallback(e=>{if(d?.(e),e.defaultPrevented)return;let{relatedTarget:t}=e;t&&t instanceof Node&&e.currentTarget.contains(t)||(e.preventDefault(),_.dispatch({type:`SET_DRAG_OVER`,dragOver:!1}))},[_,d]),D=n.useCallback(e=>{if(f?.(e),e.defaultPrevented)return;e.preventDefault(),_.dispatch({type:`SET_DRAG_OVER`,dragOver:!1});let t=Array.from(e.dataTransfer.files),n=g.inputRef.current;if(!n)return;let r=new DataTransfer;for(let e of t)r.items.add(e);n.files=r.files,n.dispatchEvent(new Event(`change`,{bubbles:!0}))},[_,g.inputRef,f]),O=n.useCallback(e=>{if(p?.(e),e.defaultPrevented)return;e.preventDefault(),_.dispatch({type:`SET_DRAG_OVER`,dragOver:!1});let t=e.clipboardData?.items;if(!t)return;let n=[];for(let e=0;e<t.length;e++){let r=t[e];if(r?.kind===`file`){let e=r.getAsFile();e&&n.push(e)}}if(n.length===0)return;let r=g.inputRef.current;if(!r)return;let i=new DataTransfer;for(let e of n)i.items.add(e);r.files=i.files,r.dispatchEvent(new Event(`change`,{bubbles:!0}))},[_,g.inputRef,p]),k=n.useCallback(e=>{m?.(e),!e.defaultPrevented&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),g.inputRef.current?.click())},[g.inputRef,m]);return(0,r.jsx)(a?i.Slot:`div`,{role:`region`,id:g.dropzoneId,"aria-controls":`${g.inputId} ${g.listId}`,"aria-disabled":g.disabled,"aria-invalid":y,"data-disabled":g.disabled?``:void 0,"data-dragging":v?``:void 0,"data-invalid":y?``:void 0,"data-slot":`file-upload-dropzone`,dir:g.dir,tabIndex:g.disabled?void 0:0,...h,className:t.cn(`relative flex select-none flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed p-6 outline-none transition-colors hover:bg-accent/30 focus-visible:border-ring/50 data-disabled:pointer-events-none data-dragging:border-primary/30 data-invalid:border-destructive data-dragging:bg-accent/30 data-invalid:ring-destructive/20`,o),onClick:S,onDragEnter:T,onDragLeave:E,onDragOver:w,onDrop:D,onKeyDown:k,onPaste:O})}function E(e){let{asChild:t,onClick:a,...o}=e,s=C(`FileUploadTrigger`),c=n.useCallback(e=>{a?.(e),!e.defaultPrevented&&s.inputRef.current?.click()},[s.inputRef,a]);return(0,r.jsx)(t?i.Slot:`button`,{type:`button`,"aria-controls":s.inputId,"data-disabled":s.disabled?``:void 0,"data-slot":`file-upload-trigger`,...o,disabled:s.disabled,onClick:c})}function D(e){let{className:n,orientation:a=`vertical`,asChild:o,forceMount:s,...c}=e,l=C(`FileUploadList`),u=x(e=>e.files.size),d=s||u>0;return d?(0,r.jsx)(o?i.Slot:`div`,{role:`list`,id:l.listId,"aria-orientation":a,"data-orientation":a,"data-slot":`file-upload-list`,"data-state":d?`active`:`inactive`,dir:l.dir,...c,className:t.cn(`data-[state=inactive]:fade-out-0 data-[state=active]:fade-in-0 data-[state=inactive]:slide-out-to-top-2 data-[state=active]:slide-in-from-top-2 flex flex-col gap-2 data-[state=active]:animate-in data-[state=inactive]:animate-out`,a===`horizontal`&&`flex-row overflow-x-auto p-1.5`,n)}):null}const O=n.createContext(null);function k(e){let t=n.use(O);if(!t)throw Error(`\`${e}\` must be used within \`${d}\``);return t}function A(e){let{value:a,asChild:o,className:s,...c}=e,l=n.useId(),u=`${l}-status`,f=`${l}-name`,p=`${l}-size`,m=`${l}-message`,h=C(d),g=x(e=>e.files.get(a)),_=x(e=>e.files.size),v=x(e=>Array.from(e.files.keys()).indexOf(a)+1),y=n.useMemo(()=>({id:l,fileState:g,nameId:f,sizeId:p,statusId:u,messageId:m}),[l,g,u,f,p,m]);if(!g)return null;let b=g.error?`Error: ${g.error}`:g.status===`uploading`?`Uploading: ${g.progress}% complete`:g.status===`success`?`Upload complete`:`Ready to upload`,S=o?i.Slot:`div`;return(0,r.jsx)(O.Provider,{value:y,children:(0,r.jsxs)(S,{role:`listitem`,id:l,"aria-setsize":_,"aria-posinset":v,"aria-describedby":`${f} ${p} ${u} ${g.error?m:``}`,"aria-labelledby":f,"data-slot":`file-upload-item`,dir:h.dir,...c,className:t.cn(`relative flex items-center rounded-md border p-3`,s),children:[e.children,(0,r.jsx)(`span`,{id:u,className:`sr-only`,children:b})]})})}function j(e){if(e===0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=Math.floor(Math.log(e)/Math.log(1024));return`${(e/1024**n).toFixed(n?1:0)} ${t[n]}`}function M(e){let{type:t}=e,n=e.name.split(`.`).pop()?.toLowerCase()??``;return t.startsWith(`video/`)?(0,r.jsx)(a.FileVideoIcon,{}):t.startsWith(`audio/`)?(0,r.jsx)(a.FileAudioIcon,{}):t.startsWith(`text/`)||[`txt`,`md`,`rtf`,`pdf`].includes(n)?(0,r.jsx)(a.FileTextIcon,{}):[`html`,`css`,`js`,`jsx`,`ts`,`tsx`,`json`,`xml`,`php`,`py`,`rb`,`java`,`c`,`cpp`,`cs`].includes(n)?(0,r.jsx)(a.FileCodeIcon,{}):[`zip`,`rar`,`7z`,`tar`,`gz`,`bz2`].includes(n)?(0,r.jsx)(a.FileArchiveIcon,{}):[`exe`,`msi`,`app`,`apk`,`deb`,`rpm`].includes(n)||t.startsWith(`application/`)?(0,r.jsx)(a.FileCogIcon,{}):(0,r.jsx)(a.FileIcon,{})}function N(e){let{render:a,asChild:o,children:s,className:c,...l}=e,u=k(f),d=C(f),p=n.useCallback(e=>{if(u.fileState?.file.type.startsWith(`image/`)){let t=d.urlCache.get(e);return t||(t=URL.createObjectURL(e),d.urlCache.set(e,t)),(0,r.jsx)(`img`,{src:t,alt:e.name,className:`size-full object-cover`})}return M(e)},[u.fileState?.file.type,d.urlCache]),m=n.useCallback(async e=>a?a(e,()=>p(e)):p(e),[a,p]);return u.fileState?(0,r.jsxs)(o?i.Slot:`div`,{"aria-labelledby":u.nameId,"data-slot":`file-upload-preview`,...l,className:t.cn(`relative flex size-10 shrink-0 items-center justify-center overflow-hidden rounded border bg-accent/50 [&>svg]:size-10`,c),children:[m(u.fileState.file),s]}):null}function P(e){let{asChild:n,size:a=`default`,children:o,className:s,...c}=e,l=C(p),u=k(p);return u.fileState?(0,r.jsx)(n?i.Slot:`div`,{"data-slot":`file-upload-metadata`,dir:l.dir,...c,className:t.cn(`flex min-w-0 flex-1 flex-col`,s),children:o??(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`span`,{id:u.nameId,className:t.cn(`truncate font-medium text-sm`,a===`sm`&&`font-normal text-[13px] leading-snug`),children:u.fileState.file.name}),(0,r.jsx)(`span`,{id:u.sizeId,className:t.cn(`truncate text-muted-foreground text-xs`,a===`sm`&&`text-[11px] leading-snug`),children:j(u.fileState.file.size)}),u.fileState.error&&(0,r.jsx)(`span`,{id:u.messageId,className:`text-destructive text-xs`,children:u.fileState.error})]})}):null}function F(e){let{variant:n=`linear`,size:a=40,asChild:o,forceMount:s,className:c,...l}=e,u=k(`FileUploadItemProgress`);if(!u.fileState||!(s||u.fileState.progress!==100))return null;let d=o?i.Slot:`div`;switch(n){case`circular`:{let e=2*Math.PI*((a-4)/2),n=e-u.fileState.progress/100*e;return(0,r.jsx)(d,{role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":u.fileState.progress,"aria-valuetext":`${u.fileState.progress}%`,"aria-labelledby":u.nameId,"data-slot":`file-upload-progress`,...l,className:t.cn(`-translate-x-1/2 -translate-y-1/2 absolute top-1/2 left-1/2`,c),children:(0,r.jsxs)(`svg`,{className:`-rotate-90 transform`,width:a,height:a,viewBox:`0 0 ${a} ${a}`,fill:`none`,stroke:`currentColor`,children:[(0,r.jsx)(`circle`,{className:`text-primary/20`,strokeWidth:`2`,cx:a/2,cy:a/2,r:(a-4)/2}),(0,r.jsx)(`circle`,{className:`text-primary transition-[stroke-dashoffset] duration-300 ease-linear`,strokeWidth:`2`,strokeLinecap:`round`,strokeDasharray:e,strokeDashoffset:n,cx:a/2,cy:a/2,r:(a-4)/2})]})})}case`fill`:{let e=u.fileState.progress,n=100-e;return(0,r.jsx)(d,{role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":e,"aria-valuetext":`${e}%`,"aria-labelledby":u.nameId,"data-slot":`file-upload-progress`,...l,className:t.cn(`absolute inset-0 bg-primary/50 transition-[clip-path] duration-300 ease-linear`,c),style:{clipPath:`inset(${n}% 0% 0% 0%)`}})}default:return(0,r.jsx)(d,{role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":u.fileState.progress,"aria-valuetext":`${u.fileState.progress}%`,"aria-labelledby":u.nameId,"data-slot":`file-upload-progress`,...l,className:t.cn(`relative h-1.5 w-full overflow-hidden rounded-full bg-primary/20`,c),children:(0,r.jsx)(`div`,{className:`h-full w-full flex-1 bg-primary transition-transform duration-300 ease-linear`,style:{transform:`translateX(-${100-u.fileState.progress}%)`}})})}}function I(e){let{asChild:t,onClick:a,...o}=e,s=b(h),c=k(h),l=n.useCallback(e=>{a?.(e),!(!c.fileState||e.defaultPrevented)&&s.dispatch({type:`REMOVE_FILE`,file:c.fileState.file})},[s,c.fileState,a]);return c.fileState?(0,r.jsx)(t?i.Slot:`button`,{type:`button`,"aria-controls":c.id,"aria-describedby":c.nameId,"data-slot":`file-upload-item-delete`,...o,onClick:l}):null}function L(e){let{asChild:t,forceMount:a,disabled:o,onClick:s,...c}=e,l=C(g),u=b(g),d=x(e=>e.files.size),f=o||l.disabled,p=n.useCallback(e=>{s?.(e),!e.defaultPrevented&&u.dispatch({type:`CLEAR`})},[u,s]);return a||d>0?(0,r.jsx)(t?i.Slot:`button`,{type:`button`,"aria-controls":l.listId,"data-slot":`file-upload-clear`,"data-disabled":f?``:void 0,...c,disabled:f,onClick:p}):null}exports.FileUploadClear=L,exports.FileUploadDropzone=T,exports.FileUploadItem=A,exports.FileUploadItemDelete=I,exports.FileUploadItemMetadata=P,exports.FileUploadItemPreview=N,exports.FileUploadItemProgress=F,exports.FileUploadList=D,exports.FileUploadRoot=w,exports.FileUploadTrigger=E,exports.useStore=x;
@@ -0,0 +1,94 @@
1
+ import * as react_jsx_runtime62 from "react/jsx-runtime";
2
+ import * as React from "react";
3
+
4
+ //#region src/components/ui/file-upload.d.ts
5
+ type Direction = 'ltr' | 'rtl';
6
+ interface FileState {
7
+ file: File;
8
+ progress: number;
9
+ error?: string;
10
+ status: 'idle' | 'uploading' | 'error' | 'success';
11
+ }
12
+ interface StoreState {
13
+ files: Map<File, FileState>;
14
+ dragOver: boolean;
15
+ invalid: boolean;
16
+ }
17
+ declare function useStore<T>(selector: (state: StoreState) => T): T;
18
+ interface FileUploadRootProps extends Omit<React.ComponentProps<'div'>, 'defaultValue' | 'onChange'> {
19
+ value?: File[];
20
+ defaultValue?: File[];
21
+ onValueChange?: (files: File[]) => void;
22
+ onAccept?: (files: File[]) => void;
23
+ onFileAccept?: (file: File) => void;
24
+ onFileReject?: (file: File, message: string) => void;
25
+ onFilesReject?: (files: Array<{
26
+ file: File;
27
+ message: string;
28
+ }>) => void;
29
+ onFileValidate?: (file: File) => string | null | undefined;
30
+ onUpload?: (files: File[], options: {
31
+ onProgress: (file: File, progress: number) => void;
32
+ onSuccess: (file: File) => void;
33
+ onError: (file: File, error: Error) => void;
34
+ }) => Promise<void> | void;
35
+ accept?: string;
36
+ maxFiles?: number;
37
+ maxSize?: number;
38
+ dir?: Direction;
39
+ label?: string;
40
+ name?: string;
41
+ asChild?: boolean;
42
+ disabled?: boolean;
43
+ invalid?: boolean;
44
+ multiple?: boolean;
45
+ required?: boolean;
46
+ }
47
+ declare function FileUploadRoot(props: FileUploadRootProps): react_jsx_runtime62.JSX.Element;
48
+ interface FileUploadDropzoneProps extends React.ComponentProps<'div'> {
49
+ asChild?: boolean;
50
+ }
51
+ declare function FileUploadDropzone(props: FileUploadDropzoneProps): react_jsx_runtime62.JSX.Element;
52
+ interface FileUploadTriggerProps extends React.ComponentProps<'button'> {
53
+ asChild?: boolean;
54
+ }
55
+ declare function FileUploadTrigger(props: FileUploadTriggerProps): react_jsx_runtime62.JSX.Element;
56
+ interface FileUploadListProps extends React.ComponentProps<'div'> {
57
+ orientation?: 'horizontal' | 'vertical';
58
+ asChild?: boolean;
59
+ forceMount?: boolean;
60
+ }
61
+ declare function FileUploadList(props: FileUploadListProps): react_jsx_runtime62.JSX.Element | null;
62
+ interface FileUploadItemProps extends React.ComponentProps<'div'> {
63
+ value: File;
64
+ asChild?: boolean;
65
+ }
66
+ declare function FileUploadItem(props: FileUploadItemProps): react_jsx_runtime62.JSX.Element | null;
67
+ interface FileUploadItemPreviewProps extends React.ComponentProps<'div'> {
68
+ render?: (file: File, fallback: () => React.ReactNode) => React.ReactNode;
69
+ asChild?: boolean;
70
+ }
71
+ declare function FileUploadItemPreview(props: FileUploadItemPreviewProps): react_jsx_runtime62.JSX.Element | null;
72
+ interface FileUploadItemMetadataProps extends React.ComponentProps<'div'> {
73
+ asChild?: boolean;
74
+ size?: 'default' | 'sm';
75
+ }
76
+ declare function FileUploadItemMetadata(props: FileUploadItemMetadataProps): react_jsx_runtime62.JSX.Element | null;
77
+ interface FileUploadItemProgressProps extends React.ComponentProps<'div'> {
78
+ variant?: 'linear' | 'circular' | 'fill';
79
+ size?: number;
80
+ asChild?: boolean;
81
+ forceMount?: boolean;
82
+ }
83
+ declare function FileUploadItemProgress(props: FileUploadItemProgressProps): react_jsx_runtime62.JSX.Element | null;
84
+ interface FileUploadItemDeleteProps extends React.ComponentProps<'button'> {
85
+ asChild?: boolean;
86
+ }
87
+ declare function FileUploadItemDelete(props: FileUploadItemDeleteProps): react_jsx_runtime62.JSX.Element | null;
88
+ interface FileUploadClearProps extends React.ComponentProps<'button'> {
89
+ forceMount?: boolean;
90
+ asChild?: boolean;
91
+ }
92
+ declare function FileUploadClear(props: FileUploadClearProps): react_jsx_runtime62.JSX.Element | null;
93
+ //#endregion
94
+ export { FileUploadClear, FileUploadDropzone, FileUploadItem, FileUploadItemDelete, FileUploadItemMetadata, FileUploadItemPreview, FileUploadItemProgress, FileUploadList, FileUploadRoot, FileUploadRootProps, FileUploadTrigger, useStore };