@pixpilot/shadcn-ui 0.1.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Alert.cjs +1 -1
- package/dist/Alert.js +1 -1
- package/dist/Button.cjs +1 -1
- package/dist/Button.d.ts +1 -1
- package/dist/Button.js +1 -1
- package/dist/CloseButtonRounded.cjs +1 -1
- package/dist/CloseButtonRounded.js +1 -1
- package/dist/Combobox.cjs +1 -1
- package/dist/Combobox.js +1 -1
- package/dist/CommandOptionList.cjs +1 -1
- package/dist/CommandOptionList.js +1 -1
- package/dist/DatePicker.cjs +1 -1
- package/dist/DatePicker.js +1 -1
- package/dist/LoadingOverlay.cjs +1 -1
- package/dist/LoadingOverlay.js +1 -1
- package/dist/Select.d.cts +2 -2
- package/dist/Select.d.ts +2 -2
- package/dist/ThemeToggle.d.cts +2 -2
- package/dist/ThemeToggle.d.ts +2 -2
- package/dist/_virtual/rolldown_runtime.cjs +1 -1
- package/dist/_virtual/rolldown_runtime.js +1 -0
- package/dist/confirmation-dialog/ConfirmationDialog.cjs +1 -1
- package/dist/confirmation-dialog/ConfirmationDialog.js +1 -1
- package/dist/confirmation-dialog/index.cjs +1 -1
- package/dist/file-upload/FileUpload.cjs +1 -0
- package/dist/file-upload/FileUpload.d.cts +7 -0
- package/dist/file-upload/FileUpload.d.ts +7 -0
- package/dist/file-upload/FileUpload.js +1 -0
- package/dist/file-upload/FileUploadItems.cjs +1 -0
- package/dist/file-upload/FileUploadItems.js +1 -0
- package/dist/file-upload/FileUploadListItem.cjs +1 -0
- package/dist/file-upload/FileUploadListItem.js +1 -0
- package/dist/file-upload/hooks/index.cjs +1 -0
- package/dist/file-upload/hooks/index.d.ts +2 -0
- package/dist/file-upload/hooks/index.js +1 -0
- package/dist/file-upload/hooks/use-file-error.cjs +1 -0
- package/dist/file-upload/hooks/use-file-error.js +1 -0
- package/dist/file-upload/hooks/use-file-upload-progress-callbacks.cjs +1 -0
- package/dist/file-upload/hooks/use-file-upload-progress-callbacks.d.ts +1 -0
- package/dist/file-upload/hooks/use-file-upload-progress-callbacks.js +1 -0
- package/dist/file-upload/hooks/use-file-upload-store.cjs +1 -0
- package/dist/file-upload/hooks/use-file-upload-store.d.ts +2 -0
- package/dist/file-upload/hooks/use-file-upload-store.js +1 -0
- package/dist/file-upload/index.cjs +1 -0
- package/dist/file-upload/index.d.cts +2 -0
- package/dist/file-upload/index.d.ts +3 -0
- package/dist/file-upload/index.js +1 -0
- package/dist/file-upload/types/index.d.cts +40 -0
- package/dist/file-upload/types/index.d.ts +40 -0
- package/dist/file-upload/utils/create-placeholder-file.cjs +1 -0
- package/dist/file-upload/utils/create-placeholder-file.js +1 -0
- package/dist/file-upload/utils/get-file-key.cjs +1 -0
- package/dist/file-upload/utils/get-file-key.d.ts +1 -0
- package/dist/file-upload/utils/get-file-key.js +1 -0
- package/dist/file-upload/utils/get-file-meta.cjs +1 -0
- package/dist/file-upload/utils/get-file-meta.d.ts +1 -0
- package/dist/file-upload/utils/get-file-meta.js +1 -0
- package/dist/file-upload/utils/index.d.ts +4 -0
- package/dist/file-upload/utils/is-file-equal.cjs +1 -0
- package/dist/file-upload/utils/is-file-equal.d.ts +1 -0
- package/dist/file-upload/utils/is-file-equal.js +1 -0
- package/dist/file-upload/utils/merge-file-metadata.cjs +1 -0
- package/dist/file-upload/utils/merge-file-metadata.d.ts +1 -0
- package/dist/file-upload/utils/merge-file-metadata.js +1 -0
- package/dist/file-upload-inline/FileUploadInline.cjs +1 -0
- package/dist/file-upload-inline/FileUploadInline.d.cts +10 -0
- package/dist/file-upload-inline/FileUploadInline.d.ts +10 -0
- package/dist/file-upload-inline/FileUploadInline.js +1 -0
- package/dist/file-upload-inline/FileUploadInlineItem.cjs +1 -0
- package/dist/file-upload-inline/FileUploadInlineItem.js +1 -0
- package/dist/file-upload-inline/defaults.cjs +1 -0
- package/dist/file-upload-inline/defaults.js +1 -0
- package/dist/file-upload-inline/index.cjs +1 -0
- package/dist/file-upload-inline/index.d.cts +2 -0
- package/dist/file-upload-inline/index.d.ts +2 -0
- package/dist/file-upload-inline/index.js +1 -0
- package/dist/file-upload-inline/types.d.cts +16 -0
- package/dist/file-upload-inline/types.d.ts +16 -0
- package/dist/file-upload-inline/utils.cjs +1 -0
- package/dist/file-upload-inline/utils.js +1 -0
- package/dist/hooks/index.cjs +1 -1
- package/dist/icon-selector/IconPicker.d.cts +3 -2
- package/dist/icon-selector/IconPicker.d.ts +3 -2
- package/dist/icon-selector/constants.cjs +1 -1
- package/dist/icon-selector/icon-picker-content.cjs +1 -1
- package/dist/icon-selector/icon-picker-content.js +1 -1
- package/dist/icon-selector/index.cjs +1 -1
- package/dist/icon-selector/index.d.cts +1 -2
- package/dist/icon-selector/index.d.ts +1 -2
- package/dist/icon-selector/index.js +1 -1
- package/dist/icon-selector/types.d.cts +4 -2
- package/dist/icon-selector/types.d.ts +4 -2
- package/dist/icon-selector/use-async-providers.cjs +1 -1
- package/dist/icon-selector/use-async-providers.js +1 -1
- package/dist/icon-selector/utils/is-valid-provider.cjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +12 -7
- package/dist/index.d.ts +12 -7
- package/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@diceui_shared@0.12.0_@floating-ui_react@0.27.16_react-dom@19.2.0_react@19.2.0__react@1_2c51ffe880f01dd537d5b6a13313daf4/node_modules/@diceui/shared/dist/index.cjs +1 -0
- package/dist/node_modules/.pnpm/@diceui_shared@0.12.0_@floating-ui_react@0.27.16_react-dom@19.2.0_react@19.2.0__react@1_2c51ffe880f01dd537d5b6a13313daf4/node_modules/@diceui/shared/dist/index.js +1 -0
- package/dist/node_modules/.pnpm/@diceui_tags-input@0.7.2_@floating-ui_react@0.27.16_react-dom@19.2.0_react@19.2.0__reac_e193dc2ff0d426ed009417f8d89778fd/node_modules/@diceui/tags-input/dist/index.cjs +1 -0
- package/dist/node_modules/.pnpm/@diceui_tags-input@0.7.2_@floating-ui_react@0.27.16_react-dom@19.2.0_react@19.2.0__reac_e193dc2ff0d426ed009417f8d89778fd/node_modules/@diceui/tags-input/dist/index.js +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.cjs +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.js +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.cjs +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_react-dom@2.1.6_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_react-dom@2.1.6_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_react@0.27.16_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@floating-ui/react/dist/floating-ui.react.esm.cjs +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_react@0.27.16_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@floating-ui/react/dist/floating-ui.react.esm.js +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_react@0.27.16_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@floating-ui/react/dist/floating-ui.react.utils.cjs +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_react@0.27.16_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@floating-ui/react/dist/floating-ui.react.utils.js +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.cjs +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.cjs +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +1 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +1 -0
- package/dist/node_modules/.pnpm/tabbable@6.3.0/node_modules/tabbable/dist/index.cjs +1 -0
- package/dist/node_modules/.pnpm/tabbable@6.3.0/node_modules/tabbable/dist/index.esm.js +1 -0
- package/dist/packages/shadcn/src/components/index.cjs +1 -0
- package/dist/packages/shadcn/src/components/index.js +1 -0
- package/dist/packages/shadcn/src/components/ui/OrContinueWithSeparator.cjs +1 -0
- package/dist/packages/shadcn/src/components/ui/OrContinueWithSeparator.js +1 -0
- package/dist/packages/shadcn/src/components/ui/alert-dialog.cjs +1 -0
- package/dist/packages/shadcn/src/components/ui/alert-dialog.js +1 -0
- package/dist/packages/shadcn/src/components/ui/alert.cjs +1 -0
- package/dist/packages/shadcn/src/components/ui/alert.js +1 -0
- package/dist/packages/shadcn/src/components/ui/avatar.cjs +1 -0
- package/dist/packages/shadcn/src/components/ui/avatar.js +1 -0
- package/dist/packages/shadcn/src/components/ui/badge.cjs +1 -0
- package/dist/packages/shadcn/src/components/ui/badge.js +1 -0
- package/dist/packages/shadcn/src/components/ui/button.cjs +1 -0
- package/dist/packages/shadcn/src/components/ui/button.js +1 -0
- package/dist/packages/shadcn/src/components/ui/calendar.cjs +1 -0
- package/dist/packages/shadcn/src/components/ui/calendar.js +1 -0
- package/dist/packages/shadcn/src/components/ui/card.cjs +1 -0
- package/dist/packages/shadcn/src/components/ui/card.js +1 -0
- package/dist/packages/shadcn/src/components/ui/checkbox.cjs +1 -0
- package/dist/packages/shadcn/src/components/ui/checkbox.js +1 -0
- package/dist/packages/shadcn/src/components/ui/command.cjs +1 -0
- package/dist/packages/shadcn/src/components/ui/command.js +1 -0
- package/dist/packages/shadcn/src/components/ui/dialog.cjs +1 -0
- package/dist/packages/shadcn/src/components/ui/dialog.js +1 -0
- package/dist/packages/shadcn/src/components/ui/dropdown-menu.cjs +1 -0
- package/dist/packages/shadcn/src/components/ui/dropdown-menu.js +1 -0
- package/dist/packages/shadcn/src/components/ui/file-upload.cjs +1 -0
- package/dist/packages/shadcn/src/components/ui/file-upload.js +1 -0
- package/dist/packages/shadcn/src/components/ui/form.cjs +1 -0
- package/dist/packages/shadcn/src/components/ui/form.js +1 -0
- package/dist/packages/shadcn/src/components/ui/index.cjs +1 -0
- package/dist/packages/shadcn/src/components/ui/index.js +1 -0
- package/dist/packages/shadcn/src/components/ui/input.cjs +1 -0
- package/dist/packages/shadcn/src/components/ui/input.js +1 -0
- package/dist/packages/shadcn/src/components/ui/label.cjs +1 -0
- package/dist/packages/shadcn/src/components/ui/label.js +1 -0
- package/dist/packages/shadcn/src/components/ui/pagination.cjs +1 -0
- package/dist/packages/shadcn/src/components/ui/pagination.js +1 -0
- package/dist/packages/shadcn/src/components/ui/popover.cjs +1 -0
- package/dist/packages/shadcn/src/components/ui/popover.js +1 -0
- package/dist/packages/shadcn/src/components/ui/radio-group.cjs +1 -0
- package/dist/packages/shadcn/src/components/ui/radio-group.js +1 -0
- package/dist/packages/shadcn/src/components/ui/select.cjs +1 -0
- package/dist/packages/shadcn/src/components/ui/select.js +1 -0
- package/dist/packages/shadcn/src/components/ui/separator.cjs +1 -0
- package/dist/packages/shadcn/src/components/ui/separator.js +1 -0
- package/dist/packages/shadcn/src/components/ui/shadcn-io/tags/index.cjs +1 -0
- package/dist/packages/shadcn/src/components/ui/shadcn-io/tags/index.js +1 -0
- package/dist/packages/shadcn/src/components/ui/shadcn-io/tags-input-inline/index.cjs +1 -0
- package/dist/packages/shadcn/src/components/ui/shadcn-io/tags-input-inline/index.js +1 -0
- package/dist/packages/shadcn/src/components/ui/sheet.cjs +1 -0
- package/dist/packages/shadcn/src/components/ui/sheet.js +1 -0
- package/dist/packages/shadcn/src/components/ui/slider.cjs +1 -0
- package/dist/packages/shadcn/src/components/ui/slider.js +1 -0
- package/dist/packages/shadcn/src/components/ui/switch.cjs +1 -0
- package/dist/packages/shadcn/src/components/ui/switch.js +1 -0
- package/dist/packages/shadcn/src/components/ui/tabs.cjs +1 -0
- package/dist/packages/shadcn/src/components/ui/tabs.js +1 -0
- package/dist/packages/shadcn/src/components/ui/textarea.cjs +1 -0
- package/dist/packages/shadcn/src/components/ui/textarea.js +1 -0
- package/dist/packages/shadcn/src/components/ui/tooltip.cjs +1 -0
- package/dist/packages/shadcn/src/components/ui/tooltip.js +1 -0
- package/dist/packages/shadcn/src/lib/index.cjs +1 -0
- package/dist/packages/shadcn/src/lib/utils.cjs +1 -0
- package/dist/pagination/Pagination.cjs +1 -0
- package/dist/{Pagination → pagination}/Pagination.d.cts +1 -1
- package/dist/{Pagination → pagination}/Pagination.d.ts +1 -1
- package/dist/pagination/Pagination.js +1 -0
- package/dist/pagination/index.cjs +1 -0
- package/dist/rich-text-editor/RichTextEditor.cjs +1 -0
- package/dist/rich-text-editor/RichTextEditor.d.cts +55 -0
- package/dist/rich-text-editor/RichTextEditor.d.ts +55 -0
- package/dist/rich-text-editor/RichTextEditor.js +1 -0
- package/dist/rich-text-editor/index.cjs +1 -0
- package/dist/rich-text-editor/index.d.cts +1 -0
- package/dist/rich-text-editor/index.d.ts +1 -0
- package/dist/rich-text-editor/index.js +1 -0
- package/dist/rich-text-editor/predefined-toolbar-options.cjs +1 -0
- package/dist/rich-text-editor/predefined-toolbar-options.js +1 -0
- package/dist/spinner/index.cjs +1 -1
- package/dist/spinner/styles.cjs +2 -2
- package/dist/tags-input.d.cts +2 -2
- package/dist/tags-input.d.ts +2 -2
- package/dist/toast/AlertToast.cjs +1 -1
- package/dist/toast/AlertToast.js +1 -1
- package/dist/toast/index.cjs +1 -1
- package/package.json +9 -2
- package/dist/FileUploadInline.cjs +0 -1
- package/dist/FileUploadInline.d.cts +0 -75
- package/dist/FileUploadInline.d.ts +0 -75
- package/dist/FileUploadInline.js +0 -1
- package/dist/Pagination/Pagination.cjs +0 -1
- package/dist/Pagination/Pagination.js +0 -1
- package/dist/Pagination/index.cjs +0 -1
- package/dist/PopoverContent.cjs +0 -1
- package/dist/PopoverContent.d.cts +0 -8
- package/dist/PopoverContent.d.ts +0 -8
- package/dist/PopoverContent.js +0 -1
- package/dist/icon-selector/use-async-providers.d.cts +0 -14
- package/dist/icon-selector/use-async-providers.d.ts +0 -14
- package/dist/shadcn/src/components/ui/alert.cjs +0 -1
- package/dist/shadcn/src/components/ui/alert.js +0 -1
- package/dist/shadcn/src/components/ui/dialog.cjs +0 -1
- package/dist/shadcn/src/components/ui/dialog.js +0 -1
- package/dist/shadcn/src/lib/index.cjs +0 -1
- package/dist/shadcn/src/lib/utils.cjs +0 -1
- /package/dist/{shadcn → packages/shadcn}/src/lib/index.js +0 -0
- /package/dist/{shadcn → packages/shadcn}/src/lib/utils.js +0 -0
- /package/dist/{Pagination → pagination}/index.d.cts +0 -0
- /package/dist/{Pagination → pagination}/index.d.ts +0 -0
- /package/dist/{Pagination → pagination}/index.js +0 -0
package/dist/Alert.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./shadcn/src/lib/utils.cjs`);require(`./shadcn/src/lib/index.cjs`);const n=require(`./shadcn/src/components/ui/alert.cjs`);let r=require(`react`);r=e.__toESM(r);let i=require(`react
|
|
1
|
+
const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./packages/shadcn/src/lib/utils.cjs`);require(`./packages/shadcn/src/lib/index.cjs`);const n=require(`./packages/shadcn/src/components/ui/alert.cjs`);let r=require(`lucide-react`);r=e.__toESM(r);let i=require(`react`);i=e.__toESM(i);let a=require(`react/jsx-runtime`);a=e.__toESM(a);const o=t.cn(`t-0 size-4`),s={error:{descClass:`text-destructive`,textClass:`text-destructive`,class:t.cn(`border-current/80!`),icon:(0,a.jsx)(r.OctagonAlertIcon,{className:o})},warning:{descClass:`text-amber-600/80 dark:text-amber-400/80`,textClass:`text-amber-600 dark:border-amber-400 dark:text-amber-400`,class:t.cn(`border-current/80!`),icon:(0,a.jsx)(r.CircleAlertIcon,{className:o})},info:{descClass:`text-sky-600/80 dark:text-sky-400/80`,textClass:`text-sky-600 dark:border-sky-400 dark:text-sky-400`,class:t.cn(`border-current/80!`),icon:(0,a.jsx)(r.CircleAlertIcon,{className:o})},success:{descClass:`text-green-600/80 dark:text-green-400/80`,textClass:`text-green-600 dark:border-green-400 dark:text-green-400`,class:t.cn(`border-current/80!`),icon:(0,a.jsx)(r.CircleCheckBigIcon,{className:o})},default:{descClass:`text-foreground/80`,textClass:`text-foreground`,class:t.cn(`border-current/60!`),icon:(0,a.jsx)(r.CircleAlertIcon,{className:o})}};function c(e,t){return e===!1?null:e===void 0||e===!0?s[t??`default`].icon:e}const l=e=>{let{description:r,variant:i=`default`,title:o,className:l,children:u,icon:d=!1,...f}=e,p=c(d,i),m=o!=null&&o.trim()!==``,h=s[i]??s.default;return(0,a.jsxs)(n.Alert,{...f,variant:`destructive`,className:t.cn(`bg-card border-accent! flex justify-between rounded-sm border-0 border-l-4`,h.class,h.textClass,l),children:[p&&(0,a.jsx)(`div`,{className:t.cn(`mr-3 flex items-start pt-0.5`),children:p}),(0,a.jsxs)(`div`,{className:`flex flex-1 flex-col gap-1`,children:[m&&(0,a.jsx)(n.AlertTitle,{className:t.cn(h.textClass,{"block!":!m}),children:o}),r!=null&&(0,a.jsx)(n.AlertDescription,{className:t.cn(h.descClass,!m&&h.textClass),children:r})]}),u]})};l.displayName=`Alert`,exports.Alert=l;
|
package/dist/Alert.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cn as e}from"./shadcn/src/lib/utils.js";import"./shadcn/src/lib/index.js";import{Alert as t,AlertDescription as n,AlertTitle as r}from"./shadcn/src/components/ui/alert.js";import i
|
|
1
|
+
import{cn as e}from"./packages/shadcn/src/lib/utils.js";import"./packages/shadcn/src/lib/index.js";import{Alert as t,AlertDescription as n,AlertTitle as r}from"./packages/shadcn/src/components/ui/alert.js";import{CircleAlertIcon as i,CircleCheckBigIcon as a,OctagonAlertIcon as o}from"lucide-react";import s from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";const u=e(`t-0 size-4`),d={error:{descClass:`text-destructive`,textClass:`text-destructive`,class:e(`border-current/80!`),icon:c(o,{className:u})},warning:{descClass:`text-amber-600/80 dark:text-amber-400/80`,textClass:`text-amber-600 dark:border-amber-400 dark:text-amber-400`,class:e(`border-current/80!`),icon:c(i,{className:u})},info:{descClass:`text-sky-600/80 dark:text-sky-400/80`,textClass:`text-sky-600 dark:border-sky-400 dark:text-sky-400`,class:e(`border-current/80!`),icon:c(i,{className:u})},success:{descClass:`text-green-600/80 dark:text-green-400/80`,textClass:`text-green-600 dark:border-green-400 dark:text-green-400`,class:e(`border-current/80!`),icon:c(a,{className:u})},default:{descClass:`text-foreground/80`,textClass:`text-foreground`,class:e(`border-current/60!`),icon:c(i,{className:u})}};function f(e,t){return e===!1?null:e===void 0||e===!0?d[t??`default`].icon:e}const p=i=>{let{description:a,variant:o=`default`,title:s,className:u,children:p,icon:m=!1,...h}=i,g=f(m,o),_=s!=null&&s.trim()!==``,v=d[o]??d.default;return l(t,{...h,variant:`destructive`,className:e(`bg-card border-accent! flex justify-between rounded-sm border-0 border-l-4`,v.class,v.textClass,u),children:[g&&c(`div`,{className:e(`mr-3 flex items-start pt-0.5`),children:g}),l(`div`,{className:`flex flex-1 flex-col gap-1`,children:[_&&c(r,{className:e(v.textClass,{"block!":!_}),children:s}),a!=null&&c(n,{className:e(v.descClass,!_&&v.textClass),children:a})]}),p]})};p.displayName=`Alert`;export{p as Alert};
|
package/dist/Button.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./AbsoluteFill.cjs`);let n=require(`@pixpilot/shadcn`);n=e.__toESM(n);let r=require(`react`);r=e.__toESM(r);let i=require(`react
|
|
1
|
+
const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./AbsoluteFill.cjs`);let n=require(`@pixpilot/shadcn`);n=e.__toESM(n);let r=require(`lucide-react`);r=e.__toESM(r);let i=require(`react`);i=e.__toESM(i);let a=require(`react/jsx-runtime`);a=e.__toESM(a);const o=14,s=16,c=20;function l(e){return e===`sm`||e===`icon-sm`?14:e===`lg`||e===`icon-lg`?20:16}function u(e){let{children:o,disabled:s,onClick:c,disabledTooltip:u,loading:d,LoaderProps:f,onDisabledClick:p,tooltip:m,title:h,TooltipProps:g,className:_,variant:v,size:y,ref:b,...x}=e,{placement:S=`end`}=f||{},C=(0,i.useCallback)(e=>{c&&!s&&c(e)},[s,c]),w=s||d,T=!!m||!!h,E=!!u&&w,D=T||E,O=E?u??``:m??h??``,k=(0,a.jsx)(`div`,{className:(0,n.cn)(`flex items-center justify-center`,S===`center`&&`rounded-0 absolute inset-0`,S===`start`&&`mr-1`,S===`end`&&`ml-1`),children:(0,a.jsx)(r.Loader2,{className:`text-background animate-spin`,style:{height:l(y),width:l(y)}})}),A=(0,a.jsxs)(n.Button,{...x,ref:b,disabled:w,onClick:C,className:(0,n.cn)(`relative`,_),variant:v,size:y,children:[!!u&&w&&(0,a.jsxs)(n.Tooltip,{...g,children:[(0,a.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,a.jsx)(t.AbsoluteFill,{onClick:p,style:{pointerEvents:`all`,cursor:`not-allowed`}})}),(0,a.jsx)(n.TooltipContent,{children:(0,a.jsx)(`p`,{children:u})})]}),d&&S===`start`&&k,o,d&&(S===`end`||S===`center`)&&k]});return D&&!(u&&w)?(0,a.jsxs)(n.Tooltip,{...g,children:[(0,a.jsx)(n.TooltipTrigger,{asChild:!0,children:A}),(0,a.jsx)(n.TooltipContent,{children:(0,a.jsx)(`p`,{children:O})})]}):A}u.displayName=`Button`,exports.Button=u;
|
package/dist/Button.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Button, Tooltip, buttonVariants } from "@pixpilot/shadcn";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
3
|
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/Button.d.ts
|
|
7
7
|
interface ButtonLoaderProps {
|
package/dist/Button.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AbsoluteFill as e}from"./AbsoluteFill.js";import{Button as t,Tooltip as n,TooltipContent as r,TooltipTrigger as i,cn as a}from"@pixpilot/shadcn";import o,{useCallback as
|
|
1
|
+
import{AbsoluteFill as e}from"./AbsoluteFill.js";import{Button as t,Tooltip as n,TooltipContent as r,TooltipTrigger as i,cn as a}from"@pixpilot/shadcn";import{Loader2 as o}from"lucide-react";import s,{useCallback as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";function d(e){return e===`sm`||e===`icon-sm`?14:e===`lg`||e===`icon-lg`?20:16}function f(s){let{children:f,disabled:p,onClick:m,disabledTooltip:h,loading:g,LoaderProps:_,onDisabledClick:v,tooltip:y,title:b,TooltipProps:x,className:S,variant:C,size:w,ref:T,...E}=s,{placement:D=`end`}=_||{},O=c(e=>{m&&!p&&m(e)},[p,m]),k=p||g,A=!!y||!!b,j=!!h&&k,M=A||j,N=j?h??``:y??b??``,P=l(`div`,{className:a(`flex items-center justify-center`,D===`center`&&`rounded-0 absolute inset-0`,D===`start`&&`mr-1`,D===`end`&&`ml-1`),children:l(o,{className:`text-background animate-spin`,style:{height:d(w),width:d(w)}})}),F=u(t,{...E,ref:T,disabled:k,onClick:O,className:a(`relative`,S),variant:C,size:w,children:[!!h&&k&&u(n,{...x,children:[l(i,{asChild:!0,children:l(e,{onClick:v,style:{pointerEvents:`all`,cursor:`not-allowed`}})}),l(r,{children:l(`p`,{children:h})})]}),g&&D===`start`&&P,f,g&&(D===`end`||D===`center`)&&P]});return M&&!(h&&k)?u(n,{...x,children:[l(i,{asChild:!0,children:F}),l(r,{children:l(`p`,{children:N})})]}):F}f.displayName=`Button`;export{f as Button};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./_virtual/rolldown_runtime.cjs`);let t=require(`@pixpilot/shadcn`);t=e.__toESM(t);let n=require(`react`);n=e.__toESM(n);let r=require(`react
|
|
1
|
+
const e=require(`./_virtual/rolldown_runtime.cjs`);let t=require(`@pixpilot/shadcn`);t=e.__toESM(t);let n=require(`lucide-react`);n=e.__toESM(n);let r=require(`react`);r=e.__toESM(r);let i=require(`react/jsx-runtime`);i=e.__toESM(i);const a=e=>(0,i.jsx)(t.Button,{...e,className:(0,t.cn)(`flex h-8 w-8 items-center justify-center rounded-full p-0`,e.className),children:(0,i.jsx)(n.X,{className:`h-5 w-5`})});a.displayName=`CloseButtonRounded`,exports.CloseButtonRounded=a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Button as e,cn as t}from"@pixpilot/shadcn";import n
|
|
1
|
+
import{Button as e,cn as t}from"@pixpilot/shadcn";import{X as n}from"lucide-react";import r from"react";import{jsx as i}from"react/jsx-runtime";const a=r=>i(e,{...r,className:t(`flex h-8 w-8 items-center justify-center rounded-full p-0`,r.className),children:i(n,{className:`h-5 w-5`})});a.displayName=`CloseButtonRounded`;export{a as CloseButtonRounded};
|
package/dist/Combobox.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./CommandOptionList.cjs`);let n=require(`@pixpilot/shadcn`);n=e.__toESM(n);let r=require(`react`);r=e.__toESM(r);let i=require(`react
|
|
1
|
+
"use client";const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./CommandOptionList.cjs`);let n=require(`@pixpilot/shadcn`);n=e.__toESM(n);let r=require(`lucide-react`);r=e.__toESM(r);let i=require(`react`);i=e.__toESM(i);let a=require(`react/jsx-runtime`);a=e.__toESM(a);const o=[],s=e=>{let{value:s=``,onChange:c,options:l=o,placeholder:u=`Select option...`,searchPlaceholder:d=`Search...`,emptyText:f=`No option found.`,...p}=e,[m,h]=(0,i.useState)(!1);return(0,a.jsxs)(n.Popover,{open:m,onOpenChange:h,children:[(0,a.jsx)(n.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(n.Button,{variant:`outline`,role:`combobox`,"aria-expanded":m,className:`w-full justify-between`,children:[s?l.find(e=>e.value===s)?.label:u,(0,a.jsx)(r.ChevronsUpDown,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,a.jsx)(n.PopoverContent,{className:`w-full p-0`,style:{width:`var(--radix-popover-trigger-width)`},children:(0,a.jsxs)(n.Command,{...p,children:[(0,a.jsx)(n.CommandInput,{placeholder:d}),(0,a.jsx)(t.CommandOptionList,{options:l,value:s,onChange:e=>{c?.(e),h(!1)},emptyText:f})]})})]})};s.displayName=`Combobox`,exports.Combobox=s;
|
package/dist/Combobox.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{CommandOptionList as e}from"./CommandOptionList.js";import{Button as t,Command as n,CommandInput as r,Popover as i,PopoverContent as a,PopoverTrigger as o}from"@pixpilot/shadcn";import s,{useState as
|
|
1
|
+
"use client";import{CommandOptionList as e}from"./CommandOptionList.js";import{Button as t,Command as n,CommandInput as r,Popover as i,PopoverContent as a,PopoverTrigger as o}from"@pixpilot/shadcn";import{ChevronsUpDown as s}from"lucide-react";import c,{useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";const f=[],p=c=>{let{value:p=``,onChange:m,options:h=f,placeholder:g=`Select option...`,searchPlaceholder:_=`Search...`,emptyText:v=`No option found.`,...y}=c,[b,x]=l(!1);return d(i,{open:b,onOpenChange:x,children:[u(o,{asChild:!0,children:d(t,{variant:`outline`,role:`combobox`,"aria-expanded":b,className:`w-full justify-between`,children:[p?h.find(e=>e.value===p)?.label:g,u(s,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),u(a,{className:`w-full p-0`,style:{width:`var(--radix-popover-trigger-width)`},children:d(n,{...y,children:[u(r,{placeholder:_}),u(e,{options:h,value:p,onChange:e=>{m?.(e),x(!1)},emptyText:v})]})})]})};p.displayName=`Combobox`;export{p as Combobox};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";const e=require(`./_virtual/rolldown_runtime.cjs`);let t=require(`@pixpilot/shadcn`);t=e.__toESM(t);let n=require(`react
|
|
1
|
+
"use client";const e=require(`./_virtual/rolldown_runtime.cjs`);let t=require(`@pixpilot/shadcn`);t=e.__toESM(t);let n=require(`lucide-react`);n=e.__toESM(n);let r=require(`react/jsx-runtime`);r=e.__toESM(r);const i=e=>{let{options:i,value:a,onChange:o,emptyText:s=`No option found.`}=e;return(0,r.jsxs)(t.CommandList,{children:[(0,r.jsx)(t.CommandEmpty,{children:s}),(0,r.jsx)(t.CommandGroup,{children:i.map(e=>(0,r.jsx)(t.CommandItem,{value:e.value,onSelect:e=>{o?.(e===a?``:e)},children:(0,r.jsxs)(`div`,{className:`w-full flex items-center justify-between`,children:[e.label,(0,r.jsx)(n.Check,{className:(0,t.cn)(`mr-2 h-4 w-4`,a===e.value?`opacity-100`:`opacity-0`)})]})},e.value))})]})};i.displayName=`CommandOptionList`,exports.CommandOptionList=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{CommandEmpty as e,CommandGroup as t,CommandItem as n,CommandList as r,cn as i}from"@pixpilot/shadcn";import{
|
|
1
|
+
"use client";import{CommandEmpty as e,CommandGroup as t,CommandItem as n,CommandList as r,cn as i}from"@pixpilot/shadcn";import{Check as a}from"lucide-react";import{jsx as o,jsxs as s}from"react/jsx-runtime";const c=c=>{let{options:l,value:u,onChange:d,emptyText:f=`No option found.`}=c;return s(r,{children:[o(e,{children:f}),o(t,{children:l.map(e=>o(n,{value:e.value,onSelect:e=>{d?.(e===u?``:e)},children:s(`div`,{className:`w-full flex items-center justify-between`,children:[e.label,o(a,{className:i(`mr-2 h-4 w-4`,u===e.value?`opacity-100`:`opacity-0`)})]})},e.value))})]})};c.displayName=`CommandOptionList`;export{c as CommandOptionList};
|
package/dist/DatePicker.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";const e=require(`./_virtual/rolldown_runtime.cjs`);let t=require(`@pixpilot/shadcn`);t=e.__toESM(t);let n=require(`react`);n=e.__toESM(n);let r=require(`react
|
|
1
|
+
"use client";const e=require(`./_virtual/rolldown_runtime.cjs`);let t=require(`@pixpilot/shadcn`);t=e.__toESM(t);let n=require(`lucide-react`);n=e.__toESM(n);let r=require(`react`);r=e.__toESM(r);let i=require(`react/jsx-runtime`);i=e.__toESM(i);function a(e){let{value:r,onChange:a,placeholder:o=`Pick a date`,...s}=e;return(0,i.jsxs)(t.Popover,{children:[(0,i.jsx)(t.PopoverTrigger,{asChild:!0,children:(0,i.jsxs)(t.Button,{variant:`outline`,className:(0,t.cn)(`w-full justify-start text-left font-normal`,!r&&`text-muted-foreground`),children:[(0,i.jsx)(n.CalendarIcon,{className:`mr-2 h-4 w-4`}),r?r.toLocaleDateString():(0,i.jsx)(`span`,{children:o})]})}),(0,i.jsx)(t.PopoverContent,{className:`w-auto p-0`,children:(0,i.jsx)(t.Calendar,{mode:`single`,selected:r,onSelect:a,initialFocus:!0,...s})})]})}a.displayName=`DatePicker`,exports.DatePicker=a;
|
package/dist/DatePicker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Button as e,Calendar as t,Popover as n,PopoverContent as r,PopoverTrigger as i,cn as a}from"@pixpilot/shadcn";import o from"react";import{jsx as
|
|
1
|
+
"use client";import{Button as e,Calendar as t,Popover as n,PopoverContent as r,PopoverTrigger as i,cn as a}from"@pixpilot/shadcn";import{CalendarIcon as o}from"lucide-react";import s from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";function u(s){let{value:u,onChange:d,placeholder:f=`Pick a date`,...p}=s;return l(n,{children:[c(i,{asChild:!0,children:l(e,{variant:`outline`,className:a(`w-full justify-start text-left font-normal`,!u&&`text-muted-foreground`),children:[c(o,{className:`mr-2 h-4 w-4`}),u?u.toLocaleDateString():c(`span`,{children:f})]})}),c(r,{className:`w-auto p-0`,children:c(t,{mode:`single`,selected:u,onSelect:d,initialFocus:!0,...p})})]})}u.displayName=`DatePicker`;export{u as DatePicker};
|
package/dist/LoadingOverlay.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";const e=require(`./_virtual/rolldown_runtime.cjs`);let t=require(`@pixpilot/shadcn`);t=e.__toESM(t);let n=require(`react`);n=e.__toESM(n);let r=require(`react
|
|
1
|
+
"use client";const e=require(`./_virtual/rolldown_runtime.cjs`);let t=require(`@pixpilot/shadcn`);t=e.__toESM(t);let n=require(`lucide-react`);n=e.__toESM(n);let r=require(`react`);r=e.__toESM(r);let i=require(`react/jsx-runtime`);i=e.__toESM(i);const a=0,o=300,s=e=>{let{backdrop:a=!0,placement:o=`center`,loading:s,delay:c=0,message:l}=e,[u,d]=(0,r.useState)(!1),[f,p]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let e;return s?e=setTimeout(()=>{d(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{p(!0)})})},c):(p(!1),e=setTimeout(()=>{d(!1)},u?300:0)),()=>{clearTimeout(e)}},[s,c,u]);let m={top:`items-start pt-[50px]`,center:`items-center`,bottom:`items-end pb-[50px]`}[o];return u?(0,i.jsx)(`div`,{className:(0,t.cn)(`fixed inset-0 z-[9999] flex justify-center transition-opacity`,m,a?`bg-black/50`:`pointer-events-none`,f?`opacity-100`:`opacity-0`),style:{transitionDuration:`300ms`},children:(0,i.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,i.jsx)(n.Loader2,{className:`text-foreground h-10 w-10 animate-spin`}),l!=null&&(0,i.jsx)(`div`,{className:`mt-2 text-foreground`,children:l})]})}):null};exports.LoadingOverlay=s;
|
package/dist/LoadingOverlay.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{cn as e}from"@pixpilot/shadcn";import t,{useEffect as
|
|
1
|
+
"use client";import{cn as e}from"@pixpilot/shadcn";import{Loader2 as t}from"lucide-react";import n,{useEffect as r,useState as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";const s=n=>{let{backdrop:s=!0,placement:c=`center`,loading:l,delay:u=0,message:d}=n,[f,p]=i(!1),[m,h]=i(!1);r(()=>{let e;return l?e=setTimeout(()=>{p(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{h(!0)})})},u):(h(!1),e=setTimeout(()=>{p(!1)},f?300:0)),()=>{clearTimeout(e)}},[l,u,f]);let g={top:`items-start pt-[50px]`,center:`items-center`,bottom:`items-end pb-[50px]`}[c];return f?a(`div`,{className:e(`fixed inset-0 z-[9999] flex justify-center transition-opacity`,g,s?`bg-black/50`:`pointer-events-none`,m?`opacity-100`:`opacity-0`),style:{transitionDuration:`300ms`},children:o(`div`,{className:`flex flex-col items-center`,children:[a(t,{className:`text-foreground h-10 w-10 animate-spin`}),d!=null&&a(`div`,{className:`mt-2 text-foreground`,children:d})]})}):null};export{s as LoadingOverlay};
|
package/dist/Select.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Select } from "@pixpilot/shadcn";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
3
3
|
import { ComponentProps } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/Select.d.ts
|
|
@@ -13,6 +13,6 @@ type BaseSelectProps = {
|
|
|
13
13
|
onChange?: (value: string) => void;
|
|
14
14
|
placeholder?: string;
|
|
15
15
|
} & Omit<ComponentProps<typeof Select>, 'value' | 'onValueChange' | 'children'>;
|
|
16
|
-
declare function Select$1(props: BaseSelectProps):
|
|
16
|
+
declare function Select$1(props: BaseSelectProps): react_jsx_runtime3.JSX.Element;
|
|
17
17
|
//#endregion
|
|
18
18
|
export { Select$1 as Select, SelectOption };
|
package/dist/Select.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Select } from "@pixpilot/shadcn";
|
|
2
2
|
import { ComponentProps } from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/Select.d.ts
|
|
6
6
|
interface SelectOption {
|
|
@@ -13,6 +13,6 @@ type BaseSelectProps = {
|
|
|
13
13
|
onChange?: (value: string) => void;
|
|
14
14
|
placeholder?: string;
|
|
15
15
|
} & Omit<ComponentProps<typeof Select>, 'value' | 'onValueChange' | 'children'>;
|
|
16
|
-
declare function Select$1(props: BaseSelectProps):
|
|
16
|
+
declare function Select$1(props: BaseSelectProps): react_jsx_runtime3.JSX.Element;
|
|
17
17
|
//#endregion
|
|
18
18
|
export { Select$1 as Select, SelectOption };
|
package/dist/ThemeToggle.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime5 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/ThemeToggle.d.ts
|
|
4
|
-
declare function ThemeToggle():
|
|
4
|
+
declare function ThemeToggle(): react_jsx_runtime5.JSX.Element;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { ThemeToggle };
|
package/dist/ThemeToggle.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime5 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/ThemeToggle.d.ts
|
|
4
|
-
declare function ThemeToggle():
|
|
4
|
+
declare function ThemeToggle(): react_jsx_runtime5.JSX.Element;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { ThemeToggle };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(e&&(t=e(e=0)),t),s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=e=>{let n={};for(var r in e)t(n,r,{get:e[r],enumerable:!0});return n},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),d=e=>l(t({},`__esModule`,{value:!0}),e);exports.__commonJSMin=s,exports.__esmMin=o,exports.__export=c,exports.__toCommonJS=d,exports.__toESM=u;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(e&&(t=e(e=0)),t),s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=e=>{let n={};for(var r in e)t(n,r,{get:e[r],enumerable:!0});return n},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),d=e=>l(t({},`__esModule`,{value:!0}),e),f=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function.")});export{s as __commonJSMin,o as __esmMin,c as __export,f as __require,d as __toCommonJS,u as __toESM};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../_virtual/rolldown_runtime.cjs`),t=require(`../shadcn/src/components/ui/dialog.cjs`);let n=require(`@pixpilot/shadcn`);n=e.__toESM(n);let r=require(`react/jsx-runtime`);r=e.__toESM(r);let i=require(`@ebay/nice-modal-react`);i=e.__toESM(i);const a=i.default.create(e=>{let{title:a=`Confirmation Dialog`}=e,o=(0,i.useModal)(),s=()=>{e.onConfirm?.(),o.resolve(!0),o.hide()},c=()=>{e.onCancel?.(),o.resolve(!1),o.hide()};return(0,r.jsx)(t.Dialog,{open:o.visible,onOpenChange:e=>{e||c()},children:(0,r.jsxs)(t.DialogContent,{children:[(0,r.jsxs)(t.DialogHeader,{children:[(0,r.jsx)(t.DialogTitle,{children:a}),e.description!=null&&(0,r.jsx)(t.DialogDescription,{children:e.description})]}),(0,r.jsxs)(t.DialogFooter,{children:[(0,r.jsx)(t.DialogClose,{asChild:!0,children:(0,r.jsx)(n.Button,{variant:`outline`,onClick:c,children:e.cancelText??`Cancel`})}),(0,r.jsx)(n.Button,{onClick:s,children:e.confirmText??`Confirm`})]})]})})});a.displayName=`ConfirmationDialog`;var o=a;exports.default=o;
|
|
1
|
+
const e=require(`../_virtual/rolldown_runtime.cjs`),t=require(`../packages/shadcn/src/components/ui/dialog.cjs`);let n=require(`@pixpilot/shadcn`);n=e.__toESM(n);let r=require(`react/jsx-runtime`);r=e.__toESM(r);let i=require(`@ebay/nice-modal-react`);i=e.__toESM(i);const a=i.default.create(e=>{let{title:a=`Confirmation Dialog`}=e,o=(0,i.useModal)(),s=()=>{e.onConfirm?.(),o.resolve(!0),o.hide()},c=()=>{e.onCancel?.(),o.resolve(!1),o.hide()};return(0,r.jsx)(t.Dialog,{open:o.visible,onOpenChange:e=>{e||c()},children:(0,r.jsxs)(t.DialogContent,{children:[(0,r.jsxs)(t.DialogHeader,{children:[(0,r.jsx)(t.DialogTitle,{children:a}),e.description!=null&&(0,r.jsx)(t.DialogDescription,{children:e.description})]}),(0,r.jsxs)(t.DialogFooter,{children:[(0,r.jsx)(t.DialogClose,{asChild:!0,children:(0,r.jsx)(n.Button,{variant:`outline`,onClick:c,children:e.cancelText??`Cancel`})}),(0,r.jsx)(n.Button,{onClick:s,children:e.confirmText??`Confirm`})]})]})})});a.displayName=`ConfirmationDialog`;var o=a;exports.default=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Dialog as e,DialogClose as t,DialogContent as n,DialogDescription as r,DialogFooter as i,DialogHeader as a,DialogTitle as o}from"../shadcn/src/components/ui/dialog.js";import{Button as s}from"@pixpilot/shadcn";import{jsx as c,jsxs as l}from"react/jsx-runtime";import u,{useModal as d}from"@ebay/nice-modal-react";const f=u.create(u=>{let{title:f=`Confirmation Dialog`}=u,p=d(),m=()=>{u.onConfirm?.(),p.resolve(!0),p.hide()},h=()=>{u.onCancel?.(),p.resolve(!1),p.hide()};return c(e,{open:p.visible,onOpenChange:e=>{e||h()},children:l(n,{children:[l(a,{children:[c(o,{children:f}),u.description!=null&&c(r,{children:u.description})]}),l(i,{children:[c(t,{asChild:!0,children:c(s,{variant:`outline`,onClick:h,children:u.cancelText??`Cancel`})}),c(s,{onClick:m,children:u.confirmText??`Confirm`})]})]})})});f.displayName=`ConfirmationDialog`;var p=f;export{p as default};
|
|
1
|
+
import{Dialog as e,DialogClose as t,DialogContent as n,DialogDescription as r,DialogFooter as i,DialogHeader as a,DialogTitle as o}from"../packages/shadcn/src/components/ui/dialog.js";import{Button as s}from"@pixpilot/shadcn";import{jsx as c,jsxs as l}from"react/jsx-runtime";import u,{useModal as d}from"@ebay/nice-modal-react";const f=u.create(u=>{let{title:f=`Confirmation Dialog`}=u,p=d(),m=()=>{u.onConfirm?.(),p.resolve(!0),p.hide()},h=()=>{u.onCancel?.(),p.resolve(!1),p.hide()};return c(e,{open:p.visible,onOpenChange:e=>{e||h()},children:l(n,{children:[l(a,{children:[c(o,{children:f}),u.description!=null&&c(r,{children:u.description})]}),l(i,{children:[c(t,{asChild:!0,children:c(s,{variant:`outline`,onClick:h,children:u.cancelText??`Cancel`})}),c(s,{onClick:m,children:u.confirmText??`Confirm`})]})]})})});f.displayName=`ConfirmationDialog`;var p=f;export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";require(`./ConfirmationDialog.cjs`);const
|
|
1
|
+
"use client";const e=require(`../_virtual/rolldown_runtime.cjs`);require(`./ConfirmationDialog.cjs`);const t=require(`./confirmation-dialogs.cjs`),n=require(`./DialogProvider.cjs`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";const e=require(`../_virtual/rolldown_runtime.cjs`),t=require(`./FileUploadItems.cjs`),n=require(`./hooks/use-file-upload-store.cjs`);let r=require(`@pixpilot/shadcn`);r=e.__toESM(r);let i=require(`lucide-react`);i=e.__toESM(i);let a=require(`react`);a=e.__toESM(a);let o=require(`react/jsx-runtime`);o=e.__toESM(o);function s(e){let{value:s,onChange:c,className:l,multiple:u=!0,onAccept:d,maxFiles:f,preventDuplicates:p,...m}=e,{handleAccept:h,displayFiles:g,deleteFile:_,getFile:v,orgValue:y}=n.useFileUploadStore({value:s,onChange:c,multiple:u,preventDuplicates:p}),b=a.useCallback(e=>{d?.(e),h(e)},[h,d]),x=(0,r.cn)(`p-1.5`);return(0,o.jsx)(r.FileUpload,{...m,value:y,onAccept:b,multiple:u,className:(0,r.cn)(`w-full`,l),children:(0,o.jsx)(r.FileUploadDropzone,{className:x,children:g.length===0?(0,o.jsxs)(`div`,{className:`flex flex-col items-center gap-1 text-center p-2`,children:[(0,o.jsx)(`div`,{className:`flex items-center justify-center rounded-full border p-2.5`,children:(0,o.jsx)(i.Upload,{className:`size-6 text-muted-foreground`})}),(0,o.jsx)(`p`,{className:`font-medium text-sm`,children:`Drag & drop files here`}),(0,o.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Or click to browse (max 10 files, up to 5MB each)`})]}):(0,o.jsx)(t.FileUploadItems,{displayFiles:g,deleteFile:_,getFile:v,maxFiles:f,itemSize:`size-22`,className:x})})})}exports.FileUpload=s;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FileUploadProps } from "./types/index.cjs";
|
|
2
|
+
import * as react_jsx_runtime6 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/file-upload/FileUpload.d.ts
|
|
5
|
+
declare function FileUpload(props: FileUploadProps): react_jsx_runtime6.JSX.Element;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { FileUpload };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FileUploadProps } from "./types/index.js";
|
|
2
|
+
import * as react_jsx_runtime6 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/file-upload/FileUpload.d.ts
|
|
5
|
+
declare function FileUpload(props: FileUploadProps): react_jsx_runtime6.JSX.Element;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { FileUpload };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{FileUploadItems as e}from"./FileUploadItems.js";import{useFileUploadStore as t}from"./hooks/use-file-upload-store.js";import{FileUpload as n,FileUploadDropzone as r,cn as i}from"@pixpilot/shadcn";import{Upload as a}from"lucide-react";import*as o from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";function l(l){let{value:u,onChange:d,className:f,multiple:p=!0,onAccept:m,maxFiles:h,preventDuplicates:g,..._}=l,{handleAccept:v,displayFiles:y,deleteFile:b,getFile:x,orgValue:S}=t({value:u,onChange:d,multiple:p,preventDuplicates:g}),C=o.useCallback(e=>{m?.(e),v(e)},[v,m]),w=i(`p-1.5`);return s(n,{..._,value:S,onAccept:C,multiple:p,className:i(`w-full`,f),children:s(r,{className:w,children:y.length===0?c(`div`,{className:`flex flex-col items-center gap-1 text-center p-2`,children:[s(`div`,{className:`flex items-center justify-center rounded-full border p-2.5`,children:s(a,{className:`size-6 text-muted-foreground`})}),s(`p`,{className:`font-medium text-sm`,children:`Drag & drop files here`}),s(`p`,{className:`text-muted-foreground text-xs`,children:`Or click to browse (max 10 files, up to 5MB each)`})]}):s(e,{displayFiles:y,deleteFile:b,getFile:x,maxFiles:h,itemSize:`size-22`,className:w})})})}export{l as FileUpload};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";const e=require(`../_virtual/rolldown_runtime.cjs`),t=require(`./FileUploadListItem.cjs`);let n=require(`@pixpilot/shadcn`);n=e.__toESM(n);let r=require(`lucide-react`);r=e.__toESM(r);let i=require(`react/jsx-runtime`);i=e.__toESM(i);function a({displayFiles:e,deleteFile:a,getFile:o,maxFiles:s,itemSize:c,className:l}){return(0,i.jsxs)(n.FileUploadList,{orientation:`horizontal`,forceMount:!0,className:(0,n.cn)(`flex-wrap gap-4 w-full `,l),children:[e.map(e=>{let{name:n,lastModified:r}=e,s=`${n}-${r}`;return(0,i.jsx)(t.FileUploadListItem,{fileMeta:e,deleteFile:a,getFile:o,itemSize:c},s)}),s===void 0||e.length<s?(0,i.jsx)(`div`,{className:(0,n.cn)(c,`flex items-center justify-center border-2 border-dashed rounded-md`),children:(0,i.jsx)(r.Plus,{className:`size-6 text-muted-foreground`})}):null]})}exports.FileUploadItems=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{FileUploadListItem as e}from"./FileUploadListItem.js";import{FileUploadList as t,cn as n}from"@pixpilot/shadcn";import{Plus as r}from"lucide-react";import{jsx as i,jsxs as a}from"react/jsx-runtime";function o({displayFiles:o,deleteFile:s,getFile:c,maxFiles:l,itemSize:u,className:d}){return a(t,{orientation:`horizontal`,forceMount:!0,className:n(`flex-wrap gap-4 w-full `,d),children:[o.map(t=>{let{name:n,lastModified:r}=t,a=`${n}-${r}`;return i(e,{fileMeta:t,deleteFile:s,getFile:c,itemSize:u},a)}),l===void 0||o.length<l?i(`div`,{className:n(u,`flex items-center justify-center border-2 border-dashed rounded-md`),children:i(r,{className:`size-6 text-muted-foreground`})}):null]})}export{o as FileUploadItems};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";const e=require(`../_virtual/rolldown_runtime.cjs`),t=require(`../packages/shadcn/src/components/ui/button.cjs`);let n=require(`@pixpilot/shadcn`);n=e.__toESM(n);let r=require(`lucide-react`);r=e.__toESM(r);let i=require(`react`);i=e.__toESM(i);let a=require(`pretty-bytes`);a=e.__toESM(a);let o=require(`react/jsx-runtime`);o=e.__toESM(o);const s=({className:e,children:t})=>(0,o.jsx)(`div`,{className:(0,n.cn)(`bg-black/70 inset-0 absolute`,e),children:t}),c=i.default.memo(({fileMeta:e,deleteFile:i,getFile:c,itemSize:l})=>{let u=c(e),d=(0,n.useFileUpload)(e=>e.files.get(u)),f=d?.error!=null,p=typeof e.url==`string`?e.url:``,m=d?.status!==`idle`&&d?.progress!==100&&!f;return(0,o.jsxs)(n.FileUploadItem,{value:u,className:(0,n.cn)(`p-0`),children:[(0,o.jsxs)(n.Tooltip,{children:[(0,o.jsx)(n.TooltipTrigger,{asChild:!0,children:(0,o.jsx)(n.FileUploadItemPreview,{className:(0,n.cn)(l,`relative`),render:(t,n)=>p.length>0&&e.type.startsWith(`image/`)?(0,o.jsx)(`div`,{className:`relative size-full`,children:(0,o.jsx)(`img`,{src:p,alt:e.name,className:`size-full object-cover`})}):n(),children:f?(0,o.jsx)(s,{className:`flex items-center justify-center`,children:(0,o.jsx)(r.AlertTriangle,{className:`text-destructive size-9`})}):m&&(0,o.jsx)(s,{children:(0,o.jsx)(n.FileUploadItemProgress,{variant:`circular`,strokeWidth:4})})})}),(0,o.jsxs)(n.TooltipContent,{children:[(0,o.jsxs)(`p`,{children:[e.name,(0,o.jsx)(`br`,{}),`Size: `,(0,a.default)(e.size)]}),f&&(0,o.jsxs)(`div`,{className:`text-destructive flex items-center gap-2 mt-2`,children:[(0,o.jsx)(r.AlertTriangle,{className:`text-destructive size-4`}),(0,o.jsx)(`p`,{className:`font-bold`,children:d?.error})]})]})]}),(0,o.jsx)(n.FileUploadItemMetadata,{className:`sr-only`}),(0,o.jsx)(t.Button,{type:`button`,variant:`secondary`,size:`icon`,className:`-top-1 -right-1 absolute size-5 rounded-full`,onClick:t=>{t.preventDefault(),t.stopPropagation(),i(e)},children:(0,o.jsx)(r.X,{className:`size-3`})})]})});c.displayName=`FileUploadListItem`,exports.FileUploadListItem=c;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{Button as e}from"../packages/shadcn/src/components/ui/button.js";import{FileUploadItem as t,FileUploadItemMetadata as n,FileUploadItemPreview as r,FileUploadItemProgress as i,Tooltip as a,TooltipContent as o,TooltipTrigger as s,cn as c,useFileUpload as l}from"@pixpilot/shadcn";import{AlertTriangle as u,X as d}from"lucide-react";import f from"react";import p from"pretty-bytes";import{jsx as m,jsxs as h}from"react/jsx-runtime";const g=({className:e,children:t})=>m(`div`,{className:c(`bg-black/70 inset-0 absolute`,e),children:t}),_=f.memo(({fileMeta:f,deleteFile:_,getFile:v,itemSize:y})=>{let b=v(f),x=l(e=>e.files.get(b)),S=x?.error!=null,C=typeof f.url==`string`?f.url:``,w=x?.status!==`idle`&&x?.progress!==100&&!S;return h(t,{value:b,className:c(`p-0`),children:[h(a,{children:[m(s,{asChild:!0,children:m(r,{className:c(y,`relative`),render:(e,t)=>C.length>0&&f.type.startsWith(`image/`)?m(`div`,{className:`relative size-full`,children:m(`img`,{src:C,alt:f.name,className:`size-full object-cover`})}):t(),children:S?m(g,{className:`flex items-center justify-center`,children:m(u,{className:`text-destructive size-9`})}):w&&m(g,{children:m(i,{variant:`circular`,strokeWidth:4})})})}),h(o,{children:[h(`p`,{children:[f.name,m(`br`,{}),`Size: `,p(f.size)]}),S&&h(`div`,{className:`text-destructive flex items-center gap-2 mt-2`,children:[m(u,{className:`text-destructive size-4`}),m(`p`,{className:`font-bold`,children:x?.error})]})]})]}),m(n,{className:`sr-only`}),m(e,{type:`button`,variant:`secondary`,size:`icon`,className:`-top-1 -right-1 absolute size-5 rounded-full`,onClick:e=>{e.preventDefault(),e.stopPropagation(),_(f)},children:m(d,{className:`size-3`})})]})});_.displayName=`FileUploadListItem`;export{_ as FileUploadListItem};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`./use-file-upload-store.cjs`),n=require(`./use-file-error.cjs`),r=require(`./use-file-upload-progress-callbacks.cjs`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useFileUploadStore as e}from"./use-file-upload-store.js";import{useFileError as t}from"./use-file-error.js";import{useFileUploadProgressCallbacks as n}from"./use-file-upload-progress-callbacks.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`../../packages/shadcn/src/components/ui/file-upload.cjs`);require(`../../packages/shadcn/src/components/index.cjs`);function n(e){return t.useStore(t=>{let n=t.files.get(e);return n?.error==null?null:n.error})}exports.useFileError=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useStore as e}from"../../packages/shadcn/src/components/ui/file-upload.js";import"../../packages/shadcn/src/components/index.js";function t(t){return e(e=>{let n=e.files.get(t);return n?.error==null?null:n.error})}export{t as useFileError};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`../utils/get-file-meta.cjs`),n=require(`../../packages/shadcn/src/components/ui/file-upload.cjs`);require(`../../packages/shadcn/src/components/index.cjs`);let r=require(`react`);r=e.__toESM(r);function i(e,i){let{onChange:a}=i,o=(0,r.useMemo)(()=>t.getFileMeta(e),[e]),s=(0,r.useRef)(!1),c=n.useStore(t=>{let n=t.files.get(e);return n?.status===`success`?(n.status=`idle`,!0):!1});(0,r.useEffect)(()=>{c&&!s.current&&(s.current=!0,a?.(o))},[c,a,o])}exports.useFileUploadProgressCallbacks=i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../types/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getFileMeta as e}from"../utils/get-file-meta.js";import{useStore as t}from"../../packages/shadcn/src/components/ui/file-upload.js";import"../../packages/shadcn/src/components/index.js";import{useEffect as n,useMemo as r,useRef as i}from"react";function a(a,o){let{onChange:s}=o,c=r(()=>e(a),[a]),l=i(!1),u=t(e=>{let t=e.files.get(a);return t?.status===`success`?(t.status=`idle`,!0):!1});n(()=>{u&&!l.current&&(l.current=!0,s?.(c))},[u,s,c])}export{a as useFileUploadProgressCallbacks};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`../utils/get-file-key.cjs`),n=require(`../utils/get-file-meta.cjs`),r=require(`../utils/is-file-equal.cjs`),i=require(`../utils/merge-file-metadata.cjs`),a=require(`../../file-upload-inline/utils.cjs`),o=require(`../utils/create-placeholder-file.cjs`);let s=require(`react`);s=e.__toESM(s);function c({value:e,onChange:c,multiple:l,preventDuplicates:u=!1}){let[d,f]=(0,s.useState)([]),p=(0,s.useRef)(c);p.current=c;let m=(0,s.useRef)(new Map),h=(0,s.useCallback)(e=>{if(e.file)return e.file;let n=t.getFileKey(e),r=m.current.get(n);if(r)return r;let i=o.createPlaceholderFile(e);return m.current.set(n,i),i},[]),g=(0,s.useCallback)(n=>{let r=u?n.filter(e=>{let n=t.getFileKey(e);return!d.some(e=>t.getFileKey(e)===n)}):n;f(e=>[...e,...r]),a.handleFileValueChange(a.normalizeToArray(e),r,l,p.current)},[u,l,e,d]),_=(0,s.useMemo)(()=>{let r=(()=>e?i.mergeFileMetadata(a.normalizeToArray(e),d):d.map(e=>n.getFileMetaAndFile(e)))();return r.forEach(e=>{e.file&&m.current.set(t.getFileKey(e),e.file)}),r},[d,e]),v=(0,s.useMemo)(()=>_.map(h),[_,h]),y=(0,s.useCallback)(e=>{f(t=>t.filter(t=>t!==e))},[]);return{uploadFiles:d,handleAccept:g,displayFiles:_,deleteFile:(0,s.useCallback)(e=>{e.file&&y(e.file);let n=t.getFileKey(e);if(m.current.delete(n),!l){p.current?.(null);return}a.callOnChange(_.filter(t=>!r.isFileEqual(t,e)),l,p.current)},[y,l,_]),getFile:h,orgValue:v}}exports.useFileUploadStore=c;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getFileKey as e}from"../utils/get-file-key.js";import{getFileMetaAndFile as t}from"../utils/get-file-meta.js";import{isFileEqual as n}from"../utils/is-file-equal.js";import{mergeFileMetadata as r}from"../utils/merge-file-metadata.js";import{callOnChange as i,handleFileValueChange as a,normalizeToArray as o}from"../../file-upload-inline/utils.js";import{createPlaceholderFile as s}from"../utils/create-placeholder-file.js";import{useCallback as c,useMemo as l,useRef as u,useState as d}from"react";function f({value:f,onChange:p,multiple:m,preventDuplicates:h=!1}){let[g,_]=d([]),v=u(p);v.current=p;let y=u(new Map),b=c(t=>{if(t.file)return t.file;let n=e(t),r=y.current.get(n);if(r)return r;let i=s(t);return y.current.set(n,i),i},[]),x=c(t=>{let n=h?t.filter(t=>{let n=e(t);return!g.some(t=>e(t)===n)}):t;_(e=>[...e,...n]),a(o(f),n,m,v.current)},[h,m,f,g]),S=l(()=>{let n=(()=>f?r(o(f),g):g.map(e=>t(e)))();return n.forEach(t=>{t.file&&y.current.set(e(t),t.file)}),n},[g,f]),C=l(()=>S.map(b),[S,b]),w=c(e=>{_(t=>t.filter(t=>t!==e))},[]);return{uploadFiles:g,handleAccept:x,displayFiles:S,deleteFile:c(t=>{t.file&&w(t.file);let r=e(t);if(y.current.delete(r),!m){v.current?.(null);return}i(S.filter(e=>!n(e,t)),m,v.current)},[w,m,S]),getFile:b,orgValue:C}}export{f as useFileUploadStore};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../_virtual/rolldown_runtime.cjs`),t=require(`./hooks/use-file-upload-store.cjs`),n=require(`./FileUpload.cjs`),r=require(`./hooks/use-file-error.cjs`),i=require(`./hooks/use-file-upload-progress-callbacks.cjs`);require(`./hooks/index.cjs`);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { FileMetadata, FileUploadBaseProps, FileUploadProgressCallBacks, FileUploadProps, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, SingleFileUploadProps } from "./types/index.js";
|
|
2
|
+
import { FileUpload } from "./FileUpload.js";
|
|
3
|
+
import "./hooks/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useFileUploadStore as e}from"./hooks/use-file-upload-store.js";import{FileUpload as t}from"./FileUpload.js";import{useFileError as n}from"./hooks/use-file-error.js";import{useFileUploadProgressCallbacks as r}from"./hooks/use-file-upload-progress-callbacks.js";import"./hooks/index.js";
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { FileUploadProps } from "@pixpilot/shadcn";
|
|
2
|
+
|
|
3
|
+
//#region src/file-upload/types/index.d.ts
|
|
4
|
+
interface FileMetadata {
|
|
5
|
+
name: string;
|
|
6
|
+
size: number;
|
|
7
|
+
type: string;
|
|
8
|
+
url?: string;
|
|
9
|
+
lastModified: number;
|
|
10
|
+
}
|
|
11
|
+
type OnChangeSingleFile = (file: FileMetadata | null) => void;
|
|
12
|
+
type OnChangeMultipleFiles = (files: FileMetadata[]) => void;
|
|
13
|
+
type MainFileUploadProps = Omit<FileUploadProps, 'value'>;
|
|
14
|
+
interface FileUploadBaseProps extends MainFileUploadProps {
|
|
15
|
+
preventDuplicates?: boolean;
|
|
16
|
+
}
|
|
17
|
+
type FileUploadProps$1 = ({
|
|
18
|
+
multiple: true;
|
|
19
|
+
value?: FileMetadata[];
|
|
20
|
+
onChange?: OnChangeMultipleFiles;
|
|
21
|
+
} & FileUploadBaseProps) | ({
|
|
22
|
+
multiple?: false;
|
|
23
|
+
value?: FileMetadata | null;
|
|
24
|
+
onChange?: OnChangeSingleFile;
|
|
25
|
+
} & FileUploadBaseProps);
|
|
26
|
+
interface MultiFileUploadProps extends FileUploadBaseProps {
|
|
27
|
+
value?: FileMetadata[];
|
|
28
|
+
onChange?: OnChangeMultipleFiles;
|
|
29
|
+
}
|
|
30
|
+
interface SingleFileUploadProps extends Omit<FileUploadBaseProps, 'multiple'> {
|
|
31
|
+
value?: FileMetadata | null;
|
|
32
|
+
onChange?: (files: FileMetadata) => void;
|
|
33
|
+
}
|
|
34
|
+
interface FileUploadProgressCallBacks {
|
|
35
|
+
onProgress: (file: File, progress: number) => void;
|
|
36
|
+
onSuccess: (file: File) => void;
|
|
37
|
+
onError: (file: File, error: Error) => void;
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { FileMetadata, FileUploadBaseProps, FileUploadProgressCallBacks, FileUploadProps$1 as FileUploadProps, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, SingleFileUploadProps };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { FileUploadProps } from "@pixpilot/shadcn";
|
|
2
|
+
|
|
3
|
+
//#region src/file-upload/types/index.d.ts
|
|
4
|
+
interface FileMetadata {
|
|
5
|
+
name: string;
|
|
6
|
+
size: number;
|
|
7
|
+
type: string;
|
|
8
|
+
url?: string;
|
|
9
|
+
lastModified: number;
|
|
10
|
+
}
|
|
11
|
+
type OnChangeSingleFile = (file: FileMetadata | null) => void;
|
|
12
|
+
type OnChangeMultipleFiles = (files: FileMetadata[]) => void;
|
|
13
|
+
type MainFileUploadProps = Omit<FileUploadProps, 'value'>;
|
|
14
|
+
interface FileUploadBaseProps extends MainFileUploadProps {
|
|
15
|
+
preventDuplicates?: boolean;
|
|
16
|
+
}
|
|
17
|
+
type FileUploadProps$1 = ({
|
|
18
|
+
multiple: true;
|
|
19
|
+
value?: FileMetadata[];
|
|
20
|
+
onChange?: OnChangeMultipleFiles;
|
|
21
|
+
} & FileUploadBaseProps) | ({
|
|
22
|
+
multiple?: false;
|
|
23
|
+
value?: FileMetadata | null;
|
|
24
|
+
onChange?: OnChangeSingleFile;
|
|
25
|
+
} & FileUploadBaseProps);
|
|
26
|
+
interface MultiFileUploadProps extends FileUploadBaseProps {
|
|
27
|
+
value?: FileMetadata[];
|
|
28
|
+
onChange?: OnChangeMultipleFiles;
|
|
29
|
+
}
|
|
30
|
+
interface SingleFileUploadProps extends Omit<FileUploadBaseProps, 'multiple'> {
|
|
31
|
+
value?: FileMetadata | null;
|
|
32
|
+
onChange?: (files: FileMetadata) => void;
|
|
33
|
+
}
|
|
34
|
+
interface FileUploadProgressCallBacks {
|
|
35
|
+
onProgress: (file: File, progress: number) => void;
|
|
36
|
+
onSuccess: (file: File) => void;
|
|
37
|
+
onError: (file: File, error: Error) => void;
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { FileMetadata, FileUploadBaseProps, FileUploadProgressCallBacks, FileUploadProps$1 as FileUploadProps, MultiFileUploadProps, OnChangeMultipleFiles, OnChangeSingleFile, SingleFileUploadProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../_virtual/rolldown_runtime.cjs`);function t(e){return new File([],e.name,{type:e.type,lastModified:e.lastModified})}exports.createPlaceholderFile=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return new File([],e.name,{type:e.type,lastModified:e.lastModified})}export{e as createPlaceholderFile};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../_virtual/rolldown_runtime.cjs`);function t(e){return`${e.name}-${e.lastModified}-${e.type}-${e.size}`}exports.getFileKey=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../types/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return`${e.name}-${e.lastModified}-${e.type}-${e.size}`}export{e as getFileKey};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../_virtual/rolldown_runtime.cjs`);function t(e){return{name:e.name,size:e.size,type:e.type,lastModified:e.lastModified}}function n(e){return{name:e.name,size:e.size,type:e.type,lastModified:e.lastModified,file:e}}exports.getFileMeta=t,exports.getFileMetaAndFile=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../types/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return{name:e.name,size:e.size,type:e.type,lastModified:e.lastModified}}function t(e){return{name:e.name,size:e.size,type:e.type,lastModified:e.lastModified,file:e}}export{e as getFileMeta,t as getFileMetaAndFile};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../_virtual/rolldown_runtime.cjs`);function t(e,t){return!e||!t?!1:e.name===t.name&&e.size===t.size&&e.lastModified===t.lastModified}exports.isFileEqual=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../types/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t){return!e||!t?!1:e.name===t.name&&e.size===t.size&&e.lastModified===t.lastModified}export{e as isFileEqual};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`./get-file-meta.cjs`);function n(e,n){let r=new Map;return e.forEach(e=>{let t=`${e.name}-${e.lastModified}`;r.set(t,e)}),n.forEach(e=>{let n=`${e.name}-${e.lastModified}`;r.set(n,t.getFileMetaAndFile(e))}),Array.from(r.values())}exports.mergeFileMetadata=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../types/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getFileMetaAndFile as e}from"./get-file-meta.js";function t(t,n){let r=new Map;return t.forEach(e=>{let t=`${e.name}-${e.lastModified}`;r.set(t,e)}),n.forEach(t=>{let n=`${t.name}-${t.lastModified}`;r.set(n,e(t))}),Array.from(r.values())}export{t as mergeFileMetadata};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";const e=require(`../_virtual/rolldown_runtime.cjs`),t=require(`../file-upload/hooks/use-file-upload-store.cjs`);require(`../file-upload/index.cjs`);const n=require(`./defaults.cjs`),r=require(`./FileUploadInlineItem.cjs`);let i=require(`@pixpilot/shadcn`);i=e.__toESM(i);let a=require(`lucide-react`);a=e.__toESM(a);let o=require(`react`);o=e.__toESM(o);let s=require(`react/jsx-runtime`);s=e.__toESM(s);function c(e){let{value:c,onChange:l,className:u,disabled:d=n.defaultOptions.disabled,multiple:f=n.defaultOptions.multiple,buttonText:p,showIcon:m=n.defaultOptions.showIcon,onAccept:h,preventDuplicates:g,..._}=e,{handleAccept:v,displayFiles:y,deleteFile:b,getFile:x,orgValue:S}=t.useFileUploadStore({value:c,onChange:l,multiple:f,preventDuplicates:g}),C=(0,o.useCallback)(e=>{h?.(e),v(e)},[v,h]);return(0,s.jsx)(i.FileUpload,{..._,value:S,onAccept:C,disabled:d,multiple:f,className:(0,i.cn)(`space-y-2`,u),children:(0,s.jsxs)(s.Fragment,{children:[(f||!f&&y.length===0)&&(0,s.jsxs)(i.FileUploadDropzone,{className:(0,i.cn)(`rounded-md border border-input border-solid flex-row bg-background px-3 py-0 display-block w-full cursor-pointer`,`hover:bg-accent/50 transition-colors m-0`,d&&`cursor-not-allowed opacity-50`),children:[m&&(0,s.jsx)(a.CloudUpload,{className:`h-4 w-4 shrink-0 mx-1 text-muted-foreground`}),(0,s.jsx)(i.FileUploadTrigger,{asChild:!0,children:(0,s.jsx)(i.Button,{variant:`link`,size:`sm`,className:`h-auto py-2 px-0 text-sm text-muted-foreground hover:no-underline justify-start flex-1`,disabled:d,children:p})})]}),y.length>0&&(0,s.jsx)(i.FileUploadList,{className:`space-y-1 m-0`,forceMount:!0,children:y.map(e=>{let{name:t,lastModified:n}=e,i=`${t}-${n}`;return(0,s.jsx)(r.FileUploadInlineItem,{...e,file:x(e),disabled:d,onDelete:b},i)})})]})})}exports.FileUploadInline=c;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FileUploadInlineProps } from "./types.cjs";
|
|
2
|
+
import * as react_jsx_runtime7 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/file-upload-inline/FileUploadInline.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* FileUploadInline - An inline file upload component using FileUpload primitives
|
|
7
|
+
*/
|
|
8
|
+
declare function FileUploadInline(props: FileUploadInlineProps): react_jsx_runtime7.JSX.Element;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { FileUploadInline };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FileUploadInlineProps } from "./types.js";
|
|
2
|
+
import * as react_jsx_runtime7 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/file-upload-inline/FileUploadInline.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* FileUploadInline - An inline file upload component using FileUpload primitives
|
|
7
|
+
*/
|
|
8
|
+
declare function FileUploadInline(props: FileUploadInlineProps): react_jsx_runtime7.JSX.Element;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { FileUploadInline };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useFileUploadStore as e}from"../file-upload/hooks/use-file-upload-store.js";import"../file-upload/index.js";import{defaultOptions as t}from"./defaults.js";import{FileUploadInlineItem as n}from"./FileUploadInlineItem.js";import{Button as r,FileUpload as i,FileUploadDropzone as a,FileUploadList as o,FileUploadTrigger as s,cn as c}from"@pixpilot/shadcn";import{CloudUpload as l}from"lucide-react";import{useCallback as u}from"react";import{Fragment as d,jsx as f,jsxs as p}from"react/jsx-runtime";function m(m){let{value:h,onChange:g,className:_,disabled:v=t.disabled,multiple:y=t.multiple,buttonText:b,showIcon:x=t.showIcon,onAccept:S,preventDuplicates:C,...w}=m,{handleAccept:T,displayFiles:E,deleteFile:D,getFile:O,orgValue:k}=e({value:h,onChange:g,multiple:y,preventDuplicates:C}),A=u(e=>{S?.(e),T(e)},[T,S]);return f(i,{...w,value:k,onAccept:A,disabled:v,multiple:y,className:c(`space-y-2`,_),children:p(d,{children:[(y||!y&&E.length===0)&&p(a,{className:c(`rounded-md border border-input border-solid flex-row bg-background px-3 py-0 display-block w-full cursor-pointer`,`hover:bg-accent/50 transition-colors m-0`,v&&`cursor-not-allowed opacity-50`),children:[x&&f(l,{className:`h-4 w-4 shrink-0 mx-1 text-muted-foreground`}),f(s,{asChild:!0,children:f(r,{variant:`link`,size:`sm`,className:`h-auto py-2 px-0 text-sm text-muted-foreground hover:no-underline justify-start flex-1`,disabled:v,children:b})})]}),E.length>0&&f(o,{className:`space-y-1 m-0`,forceMount:!0,children:E.map(e=>{let{name:t,lastModified:r}=e,i=`${t}-${r}`;return f(n,{...e,file:O(e),disabled:v,onDelete:D},i)})})]})})}export{m as FileUploadInline};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";const e=require(`../_virtual/rolldown_runtime.cjs`),t=require(`../packages/shadcn/src/components/ui/file-upload.cjs`);require(`../packages/shadcn/src/components/index.cjs`);const n=require(`../file-upload/hooks/use-file-error.cjs`),r=require(`../file-upload/hooks/use-file-upload-progress-callbacks.cjs`);require(`../file-upload/hooks/index.cjs`);let i=require(`@pixpilot/shadcn`);i=e.__toESM(i);let a=require(`lucide-react`);a=e.__toESM(a);let o=require(`react`);o=e.__toESM(o);let s=require(`pretty-bytes`);s=e.__toESM(s);let c=require(`react/jsx-runtime`);c=e.__toESM(c);const l=({size:e,name:t,children:n})=>(0,c.jsxs)(`div`,{className:(0,i.cn)(`min-w-0 flex-1 flex flex-col`),children:[(0,c.jsx)(`span`,{className:(0,i.cn)(`truncate font-medium text-sm`),children:t}),(0,c.jsx)(`span`,{className:(0,i.cn)(`truncate text-muted-foreground text-xs`),children:(0,s.default)(e)}),n]}),u=({onClick:e})=>(0,c.jsx)(i.Button,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"aria-label":`Remove file`,onClick:e,children:(0,c.jsx)(a.XIcon,{className:`h-3.5 w-3.5`})}),d=({children:e})=>(0,c.jsx)(`div`,{className:`flex flex-col gap-2 rounded-md border border-input bg-background px-3 py-2 m-0 w-full`,children:e}),f=({children:e})=>(0,c.jsx)(`div`,{className:`flex w-full gap-2`,children:e}),p=o.default.memo(({file:e,name:a=``,size:o=0,type:s=``,lastModified:p=0,disabled:m=!1,onDelete:h})=>{r.useFileUploadProgressCallbacks(e,{onChange:()=>{}});let g=n.useFileError(e),_=t.useStore(t=>t.files.get(e)?.status===`uploading`);return(0,c.jsx)(i.FileUploadItem,{className:`p-0 m-0 border-none`,value:e,children:(0,c.jsxs)(d,{children:[(0,c.jsxs)(f,{children:[(0,c.jsx)(l,{name:a,size:o,lastModified:p,type:s,children:g!=null&&_&&(0,c.jsx)(`div`,{className:`text-destructive text-xs`,children:g})}),!m&&(0,c.jsx)(u,{onClick:t=>{t.stopPropagation(),t.preventDefault(),h({name:a,size:o,type:s,lastModified:p,file:e})}})]}),_&&g==null&&(0,c.jsx)(i.FileUploadItemProgress,{variant:`linear`,className:`h-1 w-full`})]})},`${a}-${o}-${p}`)});exports.FileUploadInlineItem=p;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useStore as e}from"../packages/shadcn/src/components/ui/file-upload.js";import"../packages/shadcn/src/components/index.js";import{useFileError as t}from"../file-upload/hooks/use-file-error.js";import{useFileUploadProgressCallbacks as n}from"../file-upload/hooks/use-file-upload-progress-callbacks.js";import"../file-upload/hooks/index.js";import{Button as r,FileUploadItem as i,FileUploadItemProgress as a,cn as o}from"@pixpilot/shadcn";import{XIcon as s}from"lucide-react";import c from"react";import l from"pretty-bytes";import{jsx as u,jsxs as d}from"react/jsx-runtime";const f=({size:e,name:t,children:n})=>d(`div`,{className:o(`min-w-0 flex-1 flex flex-col`),children:[u(`span`,{className:o(`truncate font-medium text-sm`),children:t}),u(`span`,{className:o(`truncate text-muted-foreground text-xs`),children:l(e)}),n]}),p=({onClick:e})=>u(r,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"aria-label":`Remove file`,onClick:e,children:u(s,{className:`h-3.5 w-3.5`})}),m=({children:e})=>u(`div`,{className:`flex flex-col gap-2 rounded-md border border-input bg-background px-3 py-2 m-0 w-full`,children:e}),h=({children:e})=>u(`div`,{className:`flex w-full gap-2`,children:e}),g=c.memo(({file:r,name:o=``,size:s=0,type:c=``,lastModified:l=0,disabled:g=!1,onDelete:_})=>{n(r,{onChange:()=>{}});let v=t(r),y=e(e=>e.files.get(r)?.status===`uploading`);return u(i,{className:`p-0 m-0 border-none`,value:r,children:d(m,{children:[d(h,{children:[u(f,{name:o,size:s,lastModified:l,type:c,children:v!=null&&y&&u(`div`,{className:`text-destructive text-xs`,children:v})}),!g&&u(p,{onClick:e=>{e.stopPropagation(),e.preventDefault(),_({name:o,size:s,type:c,lastModified:l,file:r})}})]}),y&&v==null&&u(a,{variant:`linear`,className:`h-1 w-full`})]})},`${o}-${s}-${l}`)});export{g as FileUploadInlineItem};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../_virtual/rolldown_runtime.cjs`),t={buttonText:`Browse file`,showIcon:!0,disabled:!1,multiple:!1};exports.defaultOptions=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={buttonText:`Browse file`,showIcon:!0,disabled:!1,multiple:!1};export{e as defaultOptions};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../_virtual/rolldown_runtime.cjs`),t=require(`./FileUploadInline.cjs`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{FileUploadInline as e}from"./FileUploadInline.js";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FileUploadProps } from "../file-upload/types/index.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/file-upload-inline/types.d.ts
|
|
4
|
+
interface FileUploadInlineBaseProps {
|
|
5
|
+
/**
|
|
6
|
+
* Button text when no file is selected
|
|
7
|
+
*/
|
|
8
|
+
buttonText?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Show file icon
|
|
11
|
+
*/
|
|
12
|
+
showIcon?: boolean;
|
|
13
|
+
}
|
|
14
|
+
type FileUploadInlineProps = FileUploadInlineBaseProps & FileUploadProps;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { FileUploadInlineBaseProps, FileUploadInlineProps };
|