@pixpilot/shadcn-ui 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AbsoluteFill.cjs +1 -0
- package/dist/AbsoluteFill.d.cts +18 -0
- package/dist/AbsoluteFill.d.ts +18 -0
- package/dist/AbsoluteFill.js +1 -0
- package/dist/Alert.cjs +1 -0
- package/dist/Alert.d.cts +16 -0
- package/dist/Alert.d.ts +16 -0
- package/dist/Alert.js +1 -0
- package/dist/Button.cjs +1 -0
- package/dist/Button.d.cts +47 -0
- package/dist/Button.d.ts +47 -0
- package/dist/Button.js +1 -0
- package/dist/CloseButtonAbsolute.cjs +1 -0
- package/dist/CloseButtonAbsolute.d.cts +8 -0
- package/dist/CloseButtonAbsolute.d.ts +8 -0
- package/dist/CloseButtonAbsolute.js +1 -0
- package/dist/CloseButtonRounded.cjs +1 -0
- package/dist/CloseButtonRounded.d.cts +8 -0
- package/dist/CloseButtonRounded.d.ts +8 -0
- package/dist/CloseButtonRounded.js +1 -0
- package/dist/Combobox.cjs +1 -0
- package/dist/Combobox.d.cts +16 -0
- package/dist/Combobox.d.ts +16 -0
- package/dist/Combobox.js +1 -0
- package/dist/CommandOptionList.cjs +1 -0
- package/dist/CommandOptionList.d.cts +7 -0
- package/dist/CommandOptionList.d.ts +7 -0
- package/dist/CommandOptionList.js +1 -0
- package/dist/ContentCard.cjs +1 -0
- package/dist/ContentCard.d.cts +16 -0
- package/dist/ContentCard.d.ts +16 -0
- package/dist/ContentCard.js +1 -0
- package/dist/DatePicker.cjs +1 -0
- package/dist/DatePicker.d.cts +16 -0
- package/dist/DatePicker.d.ts +16 -0
- package/dist/DatePicker.js +1 -0
- package/dist/FileUploadInline.cjs +1 -0
- package/dist/FileUploadInline.d.cts +75 -0
- package/dist/FileUploadInline.d.ts +75 -0
- package/dist/FileUploadInline.js +1 -0
- package/dist/Loader.cjs +1 -0
- package/dist/Loader.d.cts +21 -0
- package/dist/Loader.d.ts +21 -0
- package/dist/Loader.js +1 -0
- package/dist/Pagination/Pagination.cjs +1 -0
- package/dist/Pagination/Pagination.d.cts +88 -0
- package/dist/Pagination/Pagination.d.ts +88 -0
- package/dist/Pagination/Pagination.js +1 -0
- package/dist/Pagination/index.cjs +1 -0
- package/dist/Pagination/index.d.cts +1 -0
- package/dist/Pagination/index.d.ts +1 -0
- package/dist/Pagination/index.js +1 -0
- package/dist/PopoverContent.cjs +1 -0
- package/dist/PopoverContent.d.cts +8 -0
- package/dist/PopoverContent.d.ts +8 -0
- package/dist/PopoverContent.js +1 -0
- package/dist/Select.cjs +1 -0
- package/dist/Select.d.cts +18 -0
- package/dist/Select.d.ts +18 -0
- package/dist/Select.js +1 -0
- package/dist/Slider.cjs +1 -0
- package/dist/Slider.d.cts +8 -0
- package/dist/Slider.d.ts +8 -0
- package/dist/Slider.js +1 -0
- package/dist/ThemeToggle.cjs +1 -0
- package/dist/ThemeToggle.d.cts +6 -0
- package/dist/ThemeToggle.d.ts +6 -0
- package/dist/ThemeToggle.js +1 -0
- package/dist/_virtual/rolldown_runtime.cjs +1 -0
- package/dist/confirmation-dialog/ConfirmationDialog.cjs +1 -0
- package/dist/confirmation-dialog/ConfirmationDialog.d.cts +13 -0
- package/dist/confirmation-dialog/ConfirmationDialog.d.ts +14 -0
- package/dist/confirmation-dialog/ConfirmationDialog.js +1 -0
- package/dist/confirmation-dialog/DialogProvider.cjs +1 -0
- package/dist/confirmation-dialog/DialogProvider.d.cts +9 -0
- package/dist/confirmation-dialog/DialogProvider.d.ts +9 -0
- package/dist/confirmation-dialog/DialogProvider.js +1 -0
- package/dist/confirmation-dialog/confirmation-dialogs.cjs +1 -0
- package/dist/confirmation-dialog/confirmation-dialogs.d.cts +7 -0
- package/dist/confirmation-dialog/confirmation-dialogs.d.ts +7 -0
- package/dist/confirmation-dialog/confirmation-dialogs.js +1 -0
- package/dist/confirmation-dialog/index.cjs +1 -0
- package/dist/confirmation-dialog/index.d.cts +3 -0
- package/dist/confirmation-dialog/index.d.ts +3 -0
- package/dist/confirmation-dialog/index.js +1 -0
- package/dist/index.cjs +1 -96
- package/dist/index.d.cts +29 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +1 -96
- package/dist/shadcn/src/components/ui/alert.cjs +1 -0
- package/dist/shadcn/src/components/ui/alert.js +1 -0
- package/dist/shadcn/src/components/ui/dialog.cjs +1 -0
- package/dist/shadcn/src/components/ui/dialog.js +1 -0
- package/dist/shadcn/src/lib/index.cjs +1 -0
- package/dist/shadcn/src/lib/index.js +1 -0
- package/dist/shadcn/src/lib/utils.cjs +1 -0
- package/dist/shadcn/src/lib/utils.js +1 -0
- package/dist/spinner/index.cjs +1 -0
- package/dist/spinner/index.d.cts +1 -0
- package/dist/spinner/index.d.ts +1 -0
- package/dist/spinner/index.js +1 -0
- package/dist/spinner/spinner.cjs +7 -0
- package/dist/spinner/spinner.d.cts +46 -0
- package/dist/spinner/spinner.d.ts +46 -0
- package/dist/spinner/spinner.js +7 -0
- package/dist/spinner/styles.cjs +46 -0
- package/dist/spinner/styles.js +46 -0
- package/dist/tags-input.cjs +1 -0
- package/dist/tags-input.d.cts +60 -0
- package/dist/tags-input.d.ts +60 -0
- package/dist/tags-input.js +1 -0
- package/dist/theme-provider/ThemeProvider.cjs +1 -0
- package/dist/theme-provider/ThemeProvider.d.cts +16 -0
- package/dist/theme-provider/ThemeProvider.d.ts +16 -0
- package/dist/theme-provider/ThemeProvider.js +1 -0
- package/dist/theme-provider/index.cjs +1 -0
- package/dist/theme-provider/index.d.cts +3 -0
- package/dist/theme-provider/index.d.ts +3 -0
- package/dist/theme-provider/index.js +1 -0
- package/dist/toast/AlertToast.cjs +1 -0
- package/dist/toast/AlertToast.d.cts +9 -0
- package/dist/toast/AlertToast.d.ts +9 -0
- package/dist/toast/AlertToast.js +1 -0
- package/dist/toast/index.cjs +1 -0
- package/dist/toast/index.d.cts +1 -0
- package/dist/toast/index.d.ts +1 -0
- package/dist/toast/index.js +1 -0
- package/dist/toast/toast.cjs +1 -0
- package/dist/toast/toast.d.cts +20 -0
- package/dist/toast/toast.d.ts +20 -0
- package/dist/toast/toast.js +1 -0
- package/package.json +6 -6
- package/dist/index-BMHRJkpu.d.ts +0 -470
- package/dist/index-JkmaV8h2.d.cts +0 -470
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./_virtual/rolldown_runtime.cjs`);let t=require(`react`);t=e.__toESM(t);let n=require(`react/jsx-runtime`);n=e.__toESM(n);function r(e){let{ref:t,...r}=e;return(0,n.jsx)(`div`,{ref:t,className:`absolute top-0 right-0 bottom-0 left-0`,...r})}r.displayName=`StretchedElement`,exports.AbsoluteFill=r;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/AbsoluteFill.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Stretched element to enable tooltips on disabled buttons
|
|
8
|
+
* When a button is disabled, tooltips don't work by default.
|
|
9
|
+
* This element is positioned absolutely over the button to capture events.
|
|
10
|
+
*/
|
|
11
|
+
declare function AbsoluteFill(props: React.HTMLAttributes<HTMLDivElement> & {
|
|
12
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
13
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
14
|
+
declare namespace AbsoluteFill {
|
|
15
|
+
var displayName: string;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { AbsoluteFill };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/AbsoluteFill.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Stretched element to enable tooltips on disabled buttons
|
|
8
|
+
* When a button is disabled, tooltips don't work by default.
|
|
9
|
+
* This element is positioned absolutely over the button to capture events.
|
|
10
|
+
*/
|
|
11
|
+
declare function AbsoluteFill(props: React.HTMLAttributes<HTMLDivElement> & {
|
|
12
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
13
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
14
|
+
declare namespace AbsoluteFill {
|
|
15
|
+
var displayName: string;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { AbsoluteFill };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"react";import{jsx as t}from"react/jsx-runtime";function n(e){let{ref:n,...r}=e;return t(`div`,{ref:n,className:`absolute top-0 right-0 bottom-0 left-0`,...r})}n.displayName=`StretchedElement`;export{n as AbsoluteFill};
|
package/dist/Alert.cjs
ADDED
|
@@ -0,0 +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/jsx-runtime`);i=e.__toESM(i);let a=require(`lucide-react`);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,i.jsx)(a.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,i.jsx)(a.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,i.jsx)(a.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,i.jsx)(a.CircleCheckBigIcon,{className:o})},default:{descClass:`text-foreground/80`,textClass:`text-foreground`,class:t.cn(`border-current/60!`),icon:(0,i.jsx)(a.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:a=`default`,title:o,className:l,children:u,icon:d=!1,...f}=e,p=c(d,a),m=o!=null&&o.trim()!==``,h=s[a]??s.default;return(0,i.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,i.jsx)(`div`,{className:t.cn(`mr-3 flex items-start pt-0.5`),children:p}),(0,i.jsxs)(`div`,{className:`flex flex-1 flex-col gap-1`,children:[m&&(0,i.jsx)(n.AlertTitle,{className:t.cn(h.textClass,{"block!":!m}),children:o}),r!=null&&(0,i.jsx)(n.AlertDescription,{className:t.cn(h.descClass,!m&&h.textClass),children:r})]}),u]})};l.displayName=`Alert`,exports.Alert=l;
|
package/dist/Alert.d.cts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/Alert.d.ts
|
|
4
|
+
type AlertVariant = 'error' | 'info' | 'warning' | 'success' | 'default';
|
|
5
|
+
interface AlertBaseProps {
|
|
6
|
+
variant?: AlertVariant;
|
|
7
|
+
description?: string;
|
|
8
|
+
duration?: number;
|
|
9
|
+
title?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
icon?: React.JSX.Element | boolean;
|
|
12
|
+
}
|
|
13
|
+
interface AlertProps extends React.HTMLAttributes<HTMLDivElement>, AlertBaseProps {}
|
|
14
|
+
declare const Alert: React.FC<AlertProps>;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Alert, AlertBaseProps, AlertProps, AlertVariant };
|
package/dist/Alert.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/Alert.d.ts
|
|
4
|
+
type AlertVariant = 'error' | 'info' | 'warning' | 'success' | 'default';
|
|
5
|
+
interface AlertBaseProps {
|
|
6
|
+
variant?: AlertVariant;
|
|
7
|
+
description?: string;
|
|
8
|
+
duration?: number;
|
|
9
|
+
title?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
icon?: React.JSX.Element | boolean;
|
|
12
|
+
}
|
|
13
|
+
interface AlertProps extends React.HTMLAttributes<HTMLDivElement>, AlertBaseProps {}
|
|
14
|
+
declare const Alert: React.FC<AlertProps>;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Alert, AlertBaseProps, AlertProps, AlertVariant };
|
package/dist/Alert.js
ADDED
|
@@ -0,0 +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 from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{CircleAlertIcon as s,CircleCheckBigIcon as c,OctagonAlertIcon as l}from"lucide-react";const u=e(`t-0 size-4`),d={error:{descClass:`text-destructive`,textClass:`text-destructive`,class:e(`border-current/80!`),icon:a(l,{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:a(s,{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:a(s,{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:a(c,{className:u})},default:{descClass:`text-foreground/80`,textClass:`text-foreground`,class:e(`border-current/60!`),icon:a(s,{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:s,variant:c=`default`,title:l,className:u,children:p,icon:m=!1,...h}=i,g=f(m,c),_=l!=null&&l.trim()!==``,v=d[c]??d.default;return o(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&&a(`div`,{className:e(`mr-3 flex items-start pt-0.5`),children:g}),o(`div`,{className:`flex flex-1 flex-col gap-1`,children:[_&&a(r,{className:e(v.textClass,{"block!":!_}),children:l}),s!=null&&a(n,{className:e(v.descClass,!_&&v.textClass),children:s})]}),p]})};p.displayName=`Alert`;export{p as Alert};
|
package/dist/Button.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./AbsoluteFill.cjs`),n=require(`./spinner/spinner.cjs`);require(`./spinner/index.cjs`);let r=require(`@pixpilot/shadcn`);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`,...C}=f||{},w=(0,i.useCallback)(e=>{c&&!s&&c(e)},[s,c]),T=s||d,E=!!m||!!h,D=!!u&&T,O=E||D,k=D?u??``:m??h??``,A=(0,a.jsx)(`div`,{className:(0,r.cn)(`flex items-center justify-center`,S===`center`&&`rounded-0 absolute inset-0 bg-white/60 dark:bg-black/60`,S===`start`&&`mr-1`,S===`end`&&`ml-1`),children:(0,a.jsx)(n.Spinner,{className:(0,r.cn)({"text-black dark:text-white":S===`center`}),size:l(y),...C})}),j=(0,a.jsxs)(r.Button,{...x,ref:b,disabled:T,onClick:w,className:(0,r.cn)(`relative`,_),variant:v,size:y,children:[!!u&&T&&(0,a.jsxs)(r.Tooltip,{...g,children:[(0,a.jsx)(r.TooltipTrigger,{asChild:!0,children:(0,a.jsx)(t.AbsoluteFill,{onClick:p,style:{pointerEvents:`all`,cursor:`not-allowed`}})}),(0,a.jsx)(r.TooltipContent,{children:(0,a.jsx)(`p`,{children:u})})]}),d&&S===`start`&&A,o,d&&(S===`end`||S===`center`)&&A]});return O&&!(u&&T)?(0,a.jsxs)(r.Tooltip,{...g,children:[(0,a.jsx)(r.TooltipTrigger,{asChild:!0,children:j}),(0,a.jsx)(r.TooltipContent,{children:(0,a.jsx)(`p`,{children:k})})]}):j}u.displayName=`Button`,exports.Button=u;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Button, Tooltip, buttonVariants } from "@pixpilot/shadcn";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { VariantProps } from "class-variance-authority";
|
|
5
|
+
|
|
6
|
+
//#region src/Button.d.ts
|
|
7
|
+
interface ButtonLoaderProps {
|
|
8
|
+
/**
|
|
9
|
+
* Position of the loader relative to button content
|
|
10
|
+
* @default 'end'
|
|
11
|
+
*/
|
|
12
|
+
placement?: 'start' | 'end' | 'center';
|
|
13
|
+
}
|
|
14
|
+
interface ButtonProps extends React.ComponentProps<typeof Button>, VariantProps<typeof buttonVariants> {
|
|
15
|
+
/**
|
|
16
|
+
* Tooltip message to show when button is disabled
|
|
17
|
+
*/
|
|
18
|
+
disabledTooltip?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Regular tooltip message
|
|
21
|
+
*/
|
|
22
|
+
tooltip?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Loading state
|
|
25
|
+
*/
|
|
26
|
+
loading?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Loader configuration
|
|
29
|
+
*/
|
|
30
|
+
LoaderProps?: ButtonLoaderProps;
|
|
31
|
+
/**
|
|
32
|
+
* Click handler for when disabled button is clicked
|
|
33
|
+
*/
|
|
34
|
+
onDisabledClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Props to pass to the tooltip component
|
|
37
|
+
*/
|
|
38
|
+
TooltipProps?: Omit<React.ComponentProps<typeof Tooltip>, 'children' | 'delayDuration'>;
|
|
39
|
+
}
|
|
40
|
+
declare function Button$1(props: ButtonProps & {
|
|
41
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
42
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
43
|
+
declare namespace Button$1 {
|
|
44
|
+
var displayName: string;
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { Button$1 as Button, ButtonLoaderProps, ButtonProps };
|
package/dist/Button.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Button, Tooltip, buttonVariants } from "@pixpilot/shadcn";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
import { VariantProps } from "class-variance-authority";
|
|
5
|
+
|
|
6
|
+
//#region src/Button.d.ts
|
|
7
|
+
interface ButtonLoaderProps {
|
|
8
|
+
/**
|
|
9
|
+
* Position of the loader relative to button content
|
|
10
|
+
* @default 'end'
|
|
11
|
+
*/
|
|
12
|
+
placement?: 'start' | 'end' | 'center';
|
|
13
|
+
}
|
|
14
|
+
interface ButtonProps extends React.ComponentProps<typeof Button>, VariantProps<typeof buttonVariants> {
|
|
15
|
+
/**
|
|
16
|
+
* Tooltip message to show when button is disabled
|
|
17
|
+
*/
|
|
18
|
+
disabledTooltip?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Regular tooltip message
|
|
21
|
+
*/
|
|
22
|
+
tooltip?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Loading state
|
|
25
|
+
*/
|
|
26
|
+
loading?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Loader configuration
|
|
29
|
+
*/
|
|
30
|
+
LoaderProps?: ButtonLoaderProps;
|
|
31
|
+
/**
|
|
32
|
+
* Click handler for when disabled button is clicked
|
|
33
|
+
*/
|
|
34
|
+
onDisabledClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Props to pass to the tooltip component
|
|
37
|
+
*/
|
|
38
|
+
TooltipProps?: Omit<React.ComponentProps<typeof Tooltip>, 'children' | 'delayDuration'>;
|
|
39
|
+
}
|
|
40
|
+
declare function Button$1(props: ButtonProps & {
|
|
41
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
42
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
43
|
+
declare namespace Button$1 {
|
|
44
|
+
var displayName: string;
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { Button$1 as Button, ButtonLoaderProps, ButtonProps };
|
package/dist/Button.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{AbsoluteFill as e}from"./AbsoluteFill.js";import{Spinner as t}from"./spinner/spinner.js";import"./spinner/index.js";import{Button as n,Tooltip as r,TooltipContent as i,TooltipTrigger as a,cn as o}from"@pixpilot/shadcn";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}=_||{},k=c(e=>{m&&!p&&m(e)},[p,m]),A=p||g,j=!!y||!!b,M=!!h&&A,N=j||M,P=M?h??``:y??b??``,F=l(`div`,{className:o(`flex items-center justify-center`,D===`center`&&`rounded-0 absolute inset-0 bg-white/60 dark:bg-black/60`,D===`start`&&`mr-1`,D===`end`&&`ml-1`),children:l(t,{className:o({"text-black dark:text-white":D===`center`}),size:d(w),...O})}),I=u(n,{...E,ref:T,disabled:A,onClick:k,className:o(`relative`,S),variant:C,size:w,children:[!!h&&A&&u(r,{...x,children:[l(a,{asChild:!0,children:l(e,{onClick:v,style:{pointerEvents:`all`,cursor:`not-allowed`}})}),l(i,{children:l(`p`,{children:h})})]}),g&&D===`start`&&F,f,g&&(D===`end`||D===`center`)&&F]});return N&&!(h&&A)?u(r,{...x,children:[l(a,{asChild:!0,children:I}),l(i,{children:l(`p`,{children:P})})]}):I}f.displayName=`Button`;export{f as Button};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./CloseButtonRounded.cjs`);let n=require(`@pixpilot/shadcn`);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.CloseButtonRounded,{...e,className:(0,n.cn)(`absolute top-1 right-1`,e.className)});a.displayName=`CloseButtonAbsolute`,exports.CloseButtonAbsolute=a;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CloseButtonRounded } from "./CloseButtonRounded.cjs";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/CloseButtonAbsolute.d.ts
|
|
5
|
+
interface PopoverCloseButtonProps extends React.ComponentProps<typeof CloseButtonRounded> {}
|
|
6
|
+
declare const CloseButtonAbsolute: React.FC<PopoverCloseButtonProps>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { CloseButtonAbsolute, PopoverCloseButtonProps };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CloseButtonRounded } from "./CloseButtonRounded.js";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/CloseButtonAbsolute.d.ts
|
|
5
|
+
interface PopoverCloseButtonProps extends React.ComponentProps<typeof CloseButtonRounded> {}
|
|
6
|
+
declare const CloseButtonAbsolute: React.FC<PopoverCloseButtonProps>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { CloseButtonAbsolute, PopoverCloseButtonProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CloseButtonRounded as e}from"./CloseButtonRounded.js";import{cn as t}from"@pixpilot/shadcn";import n from"react";import{jsx as r}from"react/jsx-runtime";const i=n=>r(e,{...n,className:t(`absolute top-1 right-1`,n.className)});i.displayName=`CloseButtonAbsolute`;export{i as CloseButtonAbsolute};
|
|
@@ -0,0 +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/jsx-runtime`);r=e.__toESM(r);let i=require(`lucide-react`);i=e.__toESM(i);const a=e=>(0,r.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,r.jsx)(i.X,{className:`h-5 w-5`})});a.displayName=`CloseButtonRounded`,exports.CloseButtonRounded=a;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Button } from "@pixpilot/shadcn";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/CloseButtonRounded.d.ts
|
|
5
|
+
interface CloseButtonRoundedProps extends React.ComponentProps<typeof Button> {}
|
|
6
|
+
declare const CloseButtonRounded: React.FC<CloseButtonRoundedProps>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { CloseButtonRounded, CloseButtonRoundedProps };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Button } from "@pixpilot/shadcn";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/CloseButtonRounded.d.ts
|
|
5
|
+
interface CloseButtonRoundedProps extends React.ComponentProps<typeof Button> {}
|
|
6
|
+
declare const CloseButtonRounded: React.FC<CloseButtonRoundedProps>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { CloseButtonRounded, CloseButtonRoundedProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Button as e,cn as t}from"@pixpilot/shadcn";import n from"react";import{jsx as r}from"react/jsx-runtime";import{X as i}from"lucide-react";const a=n=>r(e,{...n,className:t(`flex h-8 w-8 items-center justify-center rounded-full p-0`,n.className),children:r(i,{className:`h-5 w-5`})});a.displayName=`CloseButtonRounded`;export{a as CloseButtonRounded};
|
|
@@ -0,0 +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/jsx-runtime`);i=e.__toESM(i);let a=require(`lucide-react`);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,r.useState)(!1);return(0,i.jsxs)(n.Popover,{open:m,onOpenChange:h,children:[(0,i.jsx)(n.PopoverTrigger,{asChild:!0,children:(0,i.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,i.jsx)(a.ChevronsUpDown,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,i.jsx)(n.PopoverContent,{className:`w-full p-0`,style:{width:`var(--radix-popover-trigger-width)`},children:(0,i.jsxs)(n.Command,{...p,children:[(0,i.jsx)(n.CommandInput,{placeholder:d}),(0,i.jsx)(t.CommandOptionList,{options:l,value:s,onChange:e=>{c?.(e),h(!1)},emptyText:f})]})})]})};s.displayName=`Combobox`,exports.Combobox=s;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CommandOptionListItem } from "./CommandOptionList.cjs";
|
|
2
|
+
import { Command } from "@pixpilot/shadcn";
|
|
3
|
+
import React, { ComponentProps } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/Combobox.d.ts
|
|
6
|
+
type ComboboxProps = {
|
|
7
|
+
value?: string;
|
|
8
|
+
onChange?: (value: string) => void;
|
|
9
|
+
options?: CommandOptionListItem[];
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
searchPlaceholder?: string;
|
|
12
|
+
emptyText?: string;
|
|
13
|
+
} & Omit<ComponentProps<typeof Command>, 'value' | 'onValueChange'>;
|
|
14
|
+
declare const Combobox: React.FC<ComboboxProps>;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Combobox };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CommandOptionListItem } from "./CommandOptionList.js";
|
|
2
|
+
import { Command } from "@pixpilot/shadcn";
|
|
3
|
+
import React, { ComponentProps } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/Combobox.d.ts
|
|
6
|
+
type ComboboxProps = {
|
|
7
|
+
value?: string;
|
|
8
|
+
onChange?: (value: string) => void;
|
|
9
|
+
options?: CommandOptionListItem[];
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
searchPlaceholder?: string;
|
|
12
|
+
emptyText?: string;
|
|
13
|
+
} & Omit<ComponentProps<typeof Command>, 'value' | 'onValueChange'>;
|
|
14
|
+
declare const Combobox: React.FC<ComboboxProps>;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Combobox };
|
package/dist/Combobox.js
ADDED
|
@@ -0,0 +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 c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import{ChevronsUpDown as d}from"lucide-react";const f=[],p=s=>{let{value:p=``,onChange:m,options:h=f,placeholder:g=`Select option...`,searchPlaceholder:_=`Search...`,emptyText:v=`No option found.`,...y}=s,[b,x]=c(!1);return u(i,{open:b,onOpenChange:x,children:[l(o,{asChild:!0,children:u(t,{variant:`outline`,role:`combobox`,"aria-expanded":b,className:`w-full justify-between`,children:[p?h.find(e=>e.value===p)?.label:g,l(d,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),l(a,{className:`w-full p-0`,style:{width:`var(--radix-popover-trigger-width)`},children:u(n,{...y,children:[l(r,{placeholder:_}),l(e,{options:h,value:p,onChange:e=>{m?.(e),x(!1)},emptyText:v})]})})]})};p.displayName=`Combobox`;export{p as Combobox};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";const e=require(`./_virtual/rolldown_runtime.cjs`);let t=require(`@pixpilot/shadcn`);t=e.__toESM(t);let n=require(`react/jsx-runtime`);n=e.__toESM(n);let r=require(`lucide-react`);r=e.__toESM(r);const i=e=>{let{options:i,value:a,onChange:o,emptyText:s=`No option found.`}=e;return(0,n.jsxs)(t.CommandList,{children:[(0,n.jsx)(t.CommandEmpty,{children:s}),(0,n.jsx)(t.CommandGroup,{children:i.map(e=>(0,n.jsx)(t.CommandItem,{value:e.value,onSelect:e=>{o?.(e===a?``:e)},children:(0,n.jsxs)(`div`,{className:`w-full flex items-center justify-between`,children:[e.label,(0,n.jsx)(r.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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{CommandEmpty as e,CommandGroup as t,CommandItem as n,CommandList as r,cn as i}from"@pixpilot/shadcn";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{Check as s}from"lucide-react";const c=c=>{let{options:l,value:u,onChange:d,emptyText:f=`No option found.`}=c;return o(r,{children:[a(e,{children:f}),a(t,{children:l.map(e=>a(n,{value:e.value,onSelect:e=>{d?.(e===u?``:e)},children:o(`div`,{className:`w-full flex items-center justify-between`,children:[e.label,a(s,{className:i(`mr-2 h-4 w-4`,u===e.value?`opacity-100`:`opacity-0`)})]})},e.value))})]})};c.displayName=`CommandOptionList`;export{c as CommandOptionList};
|
|
@@ -0,0 +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/jsx-runtime`);r=e.__toESM(r);function i(e){let{title:n,children:i,className:a,marginBottom:o,...s}=e;return(0,r.jsx)(t.Card,{className:(0,t.cn)(`py-4 sm:py-5`,{"mb-2 sm:mb-4":o},a),...s,children:(0,r.jsxs)(t.CardContent,{className:(0,t.cn)(`px-4 sm:px-6`),children:[n!=null&&(0,r.jsx)(`h2`,{className:(0,t.cn)(`text-xl font-semibold`,`mb-1 sm:mb-2`),children:n}),i]})})}i.displayName=`ContentBox`,exports.ContentCard=i;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Card } from "@pixpilot/shadcn";
|
|
2
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
3
|
+
import React, { ReactNode } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/ContentCard.d.ts
|
|
6
|
+
interface SectionCardProps extends React.ComponentProps<typeof Card> {
|
|
7
|
+
title?: string;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
marginBottom?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare function ContentCard(props: SectionCardProps): react_jsx_runtime1.JSX.Element;
|
|
12
|
+
declare namespace ContentCard {
|
|
13
|
+
var displayName: string;
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { ContentCard };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Card } from "@pixpilot/shadcn";
|
|
2
|
+
import React, { ReactNode } from "react";
|
|
3
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/ContentCard.d.ts
|
|
6
|
+
interface SectionCardProps extends React.ComponentProps<typeof Card> {
|
|
7
|
+
title?: string;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
marginBottom?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare function ContentCard(props: SectionCardProps): react_jsx_runtime2.JSX.Element;
|
|
12
|
+
declare namespace ContentCard {
|
|
13
|
+
var displayName: string;
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { ContentCard };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Card as e,CardContent as t,cn as n}from"@pixpilot/shadcn";import r from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";function o(r){let{title:o,children:s,className:c,marginBottom:l,...u}=r;return i(e,{className:n(`py-4 sm:py-5`,{"mb-2 sm:mb-4":l},c),...u,children:a(t,{className:n(`px-4 sm:px-6`),children:[o!=null&&i(`h2`,{className:n(`text-xl font-semibold`,`mb-1 sm:mb-2`),children:o}),s]})})}o.displayName=`ContentBox`;export{o as ContentCard};
|
|
@@ -0,0 +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/jsx-runtime`);r=e.__toESM(r);let i=require(`lucide-react`);i=e.__toESM(i);function a(e){let{value:n,onChange:a,placeholder:o=`Pick a date`,...s}=e;return(0,r.jsxs)(t.Popover,{children:[(0,r.jsx)(t.PopoverTrigger,{asChild:!0,children:(0,r.jsxs)(t.Button,{variant:`outline`,className:(0,t.cn)(`w-full justify-start text-left font-normal`,!n&&`text-muted-foreground`),children:[(0,r.jsx)(i.CalendarIcon,{className:`mr-2 h-4 w-4`}),n?n.toLocaleDateString():(0,r.jsx)(`span`,{children:o})]})}),(0,r.jsx)(t.PopoverContent,{className:`w-auto p-0`,children:(0,r.jsx)(t.Calendar,{mode:`single`,selected:n,onSelect:a,initialFocus:!0,...s})})]})}a.displayName=`DatePicker`,exports.DatePicker=a;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Calendar } from "@pixpilot/shadcn";
|
|
2
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
3
|
+
import { ComponentProps } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/DatePicker.d.ts
|
|
6
|
+
type BaseDatePickerProps = {
|
|
7
|
+
value?: Date;
|
|
8
|
+
onChange?: (date: Date | undefined) => void;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
} & Omit<ComponentProps<typeof Calendar>, 'selected' | 'onSelect' | 'mode'>;
|
|
11
|
+
declare function DatePicker(props: BaseDatePickerProps): react_jsx_runtime2.JSX.Element;
|
|
12
|
+
declare namespace DatePicker {
|
|
13
|
+
var displayName: string;
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { DatePicker };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Calendar } from "@pixpilot/shadcn";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/DatePicker.d.ts
|
|
6
|
+
type BaseDatePickerProps = {
|
|
7
|
+
value?: Date;
|
|
8
|
+
onChange?: (date: Date | undefined) => void;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
} & Omit<ComponentProps<typeof Calendar>, 'selected' | 'onSelect' | 'mode'>;
|
|
11
|
+
declare function DatePicker(props: BaseDatePickerProps): react_jsx_runtime1.JSX.Element;
|
|
12
|
+
declare namespace DatePicker {
|
|
13
|
+
var displayName: string;
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { DatePicker };
|
|
@@ -0,0 +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 s,jsxs as c}from"react/jsx-runtime";import{CalendarIcon as l}from"lucide-react";function u(o){let{value:u,onChange:d,placeholder:f=`Pick a date`,...p}=o;return c(n,{children:[s(i,{asChild:!0,children:c(e,{variant:`outline`,className:a(`w-full justify-start text-left font-normal`,!u&&`text-muted-foreground`),children:[s(l,{className:`mr-2 h-4 w-4`}),u?u.toLocaleDateString():s(`span`,{children:f})]})}),s(r,{className:`w-auto p-0`,children:s(t,{mode:`single`,selected:u,onSelect:d,initialFocus:!0,...p})})]})}u.displayName=`DatePicker`;export{u as DatePicker};
|
|
@@ -0,0 +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/jsx-runtime`);r=e.__toESM(r);let i=require(`lucide-react`);i=e.__toESM(i);function a({value:e,onChange:a,buttonText:o=`Browse file`,showIcon:s=!0,showClear:c=!0,className:l,accept:u,disabled:d=!1,maxSize:f,maxFiles:p=2,multiple:m=!1,...h}){let g=n.useMemo(()=>e?Array.isArray(e)?e:[e]:[],[e]),_=n.useCallback(e=>{a&&a(m?e.length>0?e:null:e.length>0?e[0]:null)},[a,m]);return(0,r.jsxs)(t.FileUpload,{...h,value:g,onValueChange:_,accept:u,maxFiles:p,maxSize:f,disabled:d,multiple:m,className:(0,t.cn)(`space-y-2`,l),children:[(m||!m&&g.length===0)&&(0,r.jsxs)(`div`,{className:(0,t.cn)(`flex items-center gap-2 rounded-md border border-input bg-background px-3 `,`hover:bg-accent/50 transition-colors m-0`,d&&`cursor-not-allowed opacity-50`),children:[s&&(0,r.jsx)(i.FileIcon,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,r.jsx)(t.FileUploadTrigger,{asChild:!0,children:(0,r.jsx)(t.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:o})})]}),g.length>0&&(0,r.jsx)(t.FileUploadList,{className:`space-y-1 m-0`,children:g.map(e=>(0,r.jsxs)(t.FileUploadItem,{value:e,className:`flex items-center gap-2 rounded-md border border-input bg-background px-3 py-2 m-0`,children:[(0,r.jsx)(t.FileUploadItemMetadata,{className:`min-w-0 flex-1`}),c&&!d&&(0,r.jsx)(t.FileUploadItemDelete,{asChild:!0,children:(0,r.jsx)(t.Button,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"aria-label":`Remove file`,children:(0,r.jsx)(i.XIcon,{className:`h-3.5 w-3.5`})})})]},`${e.name}-${e.size}-${e.lastModified}`))})]})}exports.FileUploadInline=a;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { FileUploadProps } from "@pixpilot/shadcn";
|
|
2
|
+
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/FileUploadInline.d.ts
|
|
5
|
+
interface FileUploadInlineProps extends Omit<FileUploadProps, 'value'> {
|
|
6
|
+
/**
|
|
7
|
+
* The current file value (single file or array)
|
|
8
|
+
*/
|
|
9
|
+
value?: File | File[] | null;
|
|
10
|
+
/**
|
|
11
|
+
* Callback when file changes
|
|
12
|
+
*/
|
|
13
|
+
onChange?: (file: File | File[] | null) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Button text when no file is selected
|
|
16
|
+
*/
|
|
17
|
+
buttonText?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Show file icon
|
|
20
|
+
*/
|
|
21
|
+
showIcon?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Whether to show a clear button when a file is selected
|
|
24
|
+
*/
|
|
25
|
+
showClear?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Custom class name for the container
|
|
28
|
+
*/
|
|
29
|
+
className?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Accepted file types
|
|
32
|
+
*/
|
|
33
|
+
accept?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Whether the input is disabled
|
|
36
|
+
*/
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Maximum file size in bytes
|
|
40
|
+
*/
|
|
41
|
+
maxSize?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Maximum number of files (for multiple uploads)
|
|
44
|
+
*/
|
|
45
|
+
maxFiles?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Allow multiple file selection
|
|
48
|
+
*/
|
|
49
|
+
multiple?: boolean;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* FileUploadInline - An inline file upload component using FileUpload primitives
|
|
53
|
+
*
|
|
54
|
+
* Features:
|
|
55
|
+
* - Shows a "Browse file" or custom button text
|
|
56
|
+
* - Displays selected filename with truncation
|
|
57
|
+
* - Uses FileUpload component primitives for proper file handling
|
|
58
|
+
* - Clean inline design
|
|
59
|
+
*/
|
|
60
|
+
declare function FileUploadInline({
|
|
61
|
+
value,
|
|
62
|
+
onChange,
|
|
63
|
+
buttonText,
|
|
64
|
+
showIcon,
|
|
65
|
+
showClear,
|
|
66
|
+
className,
|
|
67
|
+
accept,
|
|
68
|
+
disabled,
|
|
69
|
+
maxSize,
|
|
70
|
+
maxFiles,
|
|
71
|
+
multiple,
|
|
72
|
+
...rest
|
|
73
|
+
}: FileUploadInlineProps): react_jsx_runtime3.JSX.Element;
|
|
74
|
+
//#endregion
|
|
75
|
+
export { FileUploadInline, FileUploadInlineProps };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { FileUploadProps } from "@pixpilot/shadcn";
|
|
2
|
+
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/FileUploadInline.d.ts
|
|
5
|
+
interface FileUploadInlineProps extends Omit<FileUploadProps, 'value'> {
|
|
6
|
+
/**
|
|
7
|
+
* The current file value (single file or array)
|
|
8
|
+
*/
|
|
9
|
+
value?: File | File[] | null;
|
|
10
|
+
/**
|
|
11
|
+
* Callback when file changes
|
|
12
|
+
*/
|
|
13
|
+
onChange?: (file: File | File[] | null) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Button text when no file is selected
|
|
16
|
+
*/
|
|
17
|
+
buttonText?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Show file icon
|
|
20
|
+
*/
|
|
21
|
+
showIcon?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Whether to show a clear button when a file is selected
|
|
24
|
+
*/
|
|
25
|
+
showClear?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Custom class name for the container
|
|
28
|
+
*/
|
|
29
|
+
className?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Accepted file types
|
|
32
|
+
*/
|
|
33
|
+
accept?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Whether the input is disabled
|
|
36
|
+
*/
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Maximum file size in bytes
|
|
40
|
+
*/
|
|
41
|
+
maxSize?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Maximum number of files (for multiple uploads)
|
|
44
|
+
*/
|
|
45
|
+
maxFiles?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Allow multiple file selection
|
|
48
|
+
*/
|
|
49
|
+
multiple?: boolean;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* FileUploadInline - An inline file upload component using FileUpload primitives
|
|
53
|
+
*
|
|
54
|
+
* Features:
|
|
55
|
+
* - Shows a "Browse file" or custom button text
|
|
56
|
+
* - Displays selected filename with truncation
|
|
57
|
+
* - Uses FileUpload component primitives for proper file handling
|
|
58
|
+
* - Clean inline design
|
|
59
|
+
*/
|
|
60
|
+
declare function FileUploadInline({
|
|
61
|
+
value,
|
|
62
|
+
onChange,
|
|
63
|
+
buttonText,
|
|
64
|
+
showIcon,
|
|
65
|
+
showClear,
|
|
66
|
+
className,
|
|
67
|
+
accept,
|
|
68
|
+
disabled,
|
|
69
|
+
maxSize,
|
|
70
|
+
maxFiles,
|
|
71
|
+
multiple,
|
|
72
|
+
...rest
|
|
73
|
+
}: FileUploadInlineProps): react_jsx_runtime3.JSX.Element;
|
|
74
|
+
//#endregion
|
|
75
|
+
export { FileUploadInline, FileUploadInlineProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{Button as e,FileUpload as t,FileUploadItem as n,FileUploadItemDelete as r,FileUploadItemMetadata as i,FileUploadList as a,FileUploadTrigger as o,cn as s}from"@pixpilot/shadcn";import*as c from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import{FileIcon as d,XIcon as f}from"lucide-react";function p({value:p,onChange:m,buttonText:h=`Browse file`,showIcon:g=!0,showClear:_=!0,className:v,accept:y,disabled:b=!1,maxSize:x,maxFiles:S=2,multiple:C=!1,...w}){let T=c.useMemo(()=>p?Array.isArray(p)?p:[p]:[],[p]),E=c.useCallback(e=>{m&&m(C?e.length>0?e:null:e.length>0?e[0]:null)},[m,C]);return u(t,{...w,value:T,onValueChange:E,accept:y,maxFiles:S,maxSize:x,disabled:b,multiple:C,className:s(`space-y-2`,v),children:[(C||!C&&T.length===0)&&u(`div`,{className:s(`flex items-center gap-2 rounded-md border border-input bg-background px-3 `,`hover:bg-accent/50 transition-colors m-0`,b&&`cursor-not-allowed opacity-50`),children:[g&&l(d,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),l(o,{asChild:!0,children:l(e,{variant:`link`,size:`sm`,className:`h-auto py-2 px-0 text-sm text-muted-foreground hover:no-underline justify-start flex-1`,disabled:b,children:h})})]}),T.length>0&&l(a,{className:`space-y-1 m-0`,children:T.map(t=>u(n,{value:t,className:`flex items-center gap-2 rounded-md border border-input bg-background px-3 py-2 m-0`,children:[l(i,{className:`min-w-0 flex-1`}),_&&!b&&l(r,{asChild:!0,children:l(e,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"aria-label":`Remove file`,children:l(f,{className:`h-3.5 w-3.5`})})})]},`${t.name}-${t.size}-${t.lastModified}`))})]})}export{p as FileUploadInline};
|
package/dist/Loader.cjs
ADDED
|
@@ -0,0 +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/jsx-runtime`);r=e.__toESM(r);let i=require(`lucide-react`);i=e.__toESM(i);const a=0,o=e=>{let{backdrop:a=!0,placement:o=`center`,loading:s,delay:c=0}=e,[l,u]=(0,n.useReducer)((e,t)=>{switch(t.type){case`show`:return!0;case`hide`:return!1;default:return e}},!1);(0,n.useEffect)(()=>{if(s){let e=setTimeout(()=>u({type:`show`}),c);return()=>clearTimeout(e)}u({type:`hide`})},[s,c]);let d={top:`items-start pt-[50px]`,center:`items-center`,bottom:`items-end pb-[50px]`}[o];return l?(0,r.jsx)(`div`,{className:(0,t.cn)(`fixed inset-0 z-9999 flex justify-center`,d,a&&`bg-black/50`),children:(0,r.jsx)(i.Loader2,{className:`text-foreground h-10 w-10 animate-spin`})}):null};exports.Loader=o;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/Loader.d.ts
|
|
4
|
+
interface LoaderProps {
|
|
5
|
+
backdrop?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Position of the loader
|
|
8
|
+
* @default 'center'
|
|
9
|
+
*/
|
|
10
|
+
placement?: 'top' | 'bottom' | 'center';
|
|
11
|
+
loading: boolean;
|
|
12
|
+
message?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Delay in milliseconds before showing the loader
|
|
15
|
+
* @default 300
|
|
16
|
+
*/
|
|
17
|
+
delay?: number;
|
|
18
|
+
}
|
|
19
|
+
declare const Loader: React.FC<LoaderProps>;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { Loader, LoaderProps };
|
package/dist/Loader.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/Loader.d.ts
|
|
4
|
+
interface LoaderProps {
|
|
5
|
+
backdrop?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Position of the loader
|
|
8
|
+
* @default 'center'
|
|
9
|
+
*/
|
|
10
|
+
placement?: 'top' | 'bottom' | 'center';
|
|
11
|
+
loading: boolean;
|
|
12
|
+
message?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Delay in milliseconds before showing the loader
|
|
15
|
+
* @default 300
|
|
16
|
+
*/
|
|
17
|
+
delay?: number;
|
|
18
|
+
}
|
|
19
|
+
declare const Loader: React.FC<LoaderProps>;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { Loader, LoaderProps };
|
package/dist/Loader.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{cn as e}from"@pixpilot/shadcn";import t,{useEffect as n,useReducer as r}from"react";import{jsx as i}from"react/jsx-runtime";import{Loader2 as a}from"lucide-react";const o=t=>{let{backdrop:o=!0,placement:s=`center`,loading:c,delay:l=0}=t,[u,d]=r((e,t)=>{switch(t.type){case`show`:return!0;case`hide`:return!1;default:return e}},!1);n(()=>{if(c){let e=setTimeout(()=>d({type:`show`}),l);return()=>clearTimeout(e)}d({type:`hide`})},[c,l]);let f={top:`items-start pt-[50px]`,center:`items-center`,bottom:`items-end pb-[50px]`}[s];return u?i(`div`,{className:e(`fixed inset-0 z-9999 flex justify-center`,f,o&&`bg-black/50`),children:i(a,{className:`text-foreground h-10 w-10 animate-spin`})}):null};export{o as Loader};
|
|
@@ -0,0 +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/jsx-runtime`);r=e.__toESM(r);let i=require(`lucide-react`);i=e.__toESM(i);const a=({page:e,totalPages:n,onPageChange:a,maxVisiblePages:o=6,variant:s=`full`,showPageInfo:c=!1,className:l})=>{if(n<=1)return null;let u=e=>t=>{t.preventDefault(),a(t,e)},d=(()=>{let t=[];if(n<=o){for(let e=1;e<=n;e++)t.push(e);return t}let r=n,i=e<=o-1,a=e>=n-(o-2);if(i){for(let e=1;e<o;e++)t.push(e);t.push(`ellipsis-end`),t.push(r)}else if(a){t.push(1),t.push(`ellipsis-start`);for(let e=n-(o-2);e<=n;e++)t.push(e)}else{let n=o-2;t.push(1),t.push(`ellipsis-start`);let i=e-Math.floor(n/2),a=i+n-1;i=Math.max(2,i),a=Math.min(r-1,a),a-i+1<n&&(i===2?a=i+n-1:i=a-n+1);for(let e=i;e<=a;e++)t.push(e);t.push(`ellipsis-end`),t.push(r)}return t})();return s===`compact`?(0,r.jsx)(t.Pagination,{className:l,children:(0,r.jsxs)(t.PaginationContent,{children:[(0,r.jsx)(t.PaginationItem,{children:(0,r.jsx)(t.PaginationLink,{onClick:u(1),"aria-label":`Go to first page`,className:`gap-1 px-2`,children:(0,r.jsx)(i.ChevronsLeft,{className:`h-4 w-4`})})}),(0,r.jsx)(t.PaginationItem,{children:(0,r.jsx)(t.PaginationPrevious,{onClick:u(Math.max(1,e-1))})}),(0,r.jsx)(t.PaginationItem,{children:(0,r.jsxs)(`span`,{className:`flex h-9 items-center justify-center px-4 text-sm font-medium`,children:[e,`/`,n]})}),(0,r.jsx)(t.PaginationItem,{children:(0,r.jsx)(t.PaginationNext,{onClick:u(Math.min(n,e+1))})}),(0,r.jsx)(t.PaginationItem,{children:(0,r.jsx)(t.PaginationLink,{onClick:u(n),"aria-label":`Go to last page`,className:`gap-1 px-2`,children:(0,r.jsx)(i.ChevronsRight,{className:`h-4 w-4`})})})]})}):s===`simple`?(0,r.jsxs)(`div`,{className:`flex items-center justify-center gap-4 ${l??``}`,children:[c&&(0,r.jsxs)(`span`,{className:`text-sm whitespace-nowrap`,children:[`Page `,e,` of `,n]}),(0,r.jsx)(t.Pagination,{children:(0,r.jsxs)(t.PaginationContent,{children:[(0,r.jsx)(t.PaginationItem,{children:(0,r.jsx)(t.PaginationPrevious,{onClick:u(Math.max(1,e-1))})}),(0,r.jsx)(t.PaginationItem,{children:(0,r.jsx)(t.PaginationNext,{onClick:u(Math.min(n,e+1))})})]})})]}):(0,r.jsxs)(`div`,{className:`flex items-center justify-center gap-4 ${l??``}`,children:[c&&(0,r.jsxs)(`span`,{className:`text-sm whitespace-nowrap`,children:[`Page `,e,` of `,n]}),(0,r.jsx)(t.Pagination,{children:(0,r.jsxs)(t.PaginationContent,{children:[(0,r.jsx)(t.PaginationItem,{children:(0,r.jsx)(t.PaginationPrevious,{onClick:u(Math.max(1,e-1))})}),d.map(n=>typeof n==`string`?(0,r.jsx)(t.PaginationItem,{children:(0,r.jsx)(t.PaginationEllipsis,{})},n):(0,r.jsx)(t.PaginationItem,{children:(0,r.jsx)(t.PaginationLink,{onClick:u(n),isActive:n===e,children:n})},n)),(0,r.jsx)(t.PaginationItem,{children:(0,r.jsx)(t.PaginationNext,{onClick:u(Math.min(n,e+1))})})]})})]})};exports.Pagination=a;
|