@appcorp/shadcn 2.0.8 → 2.0.10

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.
@@ -7,6 +7,12 @@ interface Props {
7
7
  formDrawer: ReactNode;
8
8
  formDrawerFooter: ReactNode;
9
9
  formDrawerHeader: ReactNode;
10
+ misc1Drawer?: ReactNode;
11
+ misc1DrawerFooter?: ReactNode;
12
+ misc1DrawerHeader?: ReactNode;
13
+ misc2Drawer?: ReactNode;
14
+ misc2DrawerFooter?: ReactNode;
15
+ misc2DrawerHeader?: ReactNode;
10
16
  moreActionsDrawer: ReactNode;
11
17
  moreActionsDrawerFooter: ReactNode;
12
18
  moreActionsDrawerHeader: ReactNode;
@@ -1 +1 @@
1
- "use strict";"use client";import{Drawer as D,DrawerClose as N,DrawerContent as g,DrawerHeader as C,DrawerFooter as v}from"../components/ui/drawer";import{X as y}from"lucide-react";import{Button as F}from"../components/ui/button";import e from"react";import{Separator as r}from"../components/ui/separator";import{cn as S}from"../lib/utils";export const DrawerGeneric=({direction:t="right",filterDrawer:a,filterDrawerFooter:l,filterDrawerHeader:m,formDrawer:n,formDrawerFooter:o,formDrawerHeader:c,moreActionsDrawer:s,moreActionsDrawerFooter:i,moreActionsDrawerHeader:w,onOpenChange:p,open:f,viewDrawer:u,viewDrawerFooter:E,viewDrawerHeader:d,width:h="small"})=>{const x={small:"w-[400px]",medium:"w-[700px]",large:"w-[1000px]",full:"w-screen"};return e.createElement(e.Fragment,null,e.createElement(D,{direction:t,onOpenChange:p,open:f},e.createElement(g,{className:S("",x[h])},e.createElement(C,{className:"flex flex-row justify-center items-start"},e.createElement("div",{className:"w-full"},w,m,c,d),e.createElement(N,{asChild:!0},e.createElement(F,{size:"icon",variant:"ghost",className:"h-8 w-8"},e.createElement(y,{className:"h-4 w-4"})))),e.createElement(r,null),e.createElement("div",{className:"overflow-y-auto p-4 flex-1"},s,a,n,u),e.createElement(r,null),e.createElement(v,null,i,l,o,E))))};
1
+ "use strict";"use client";import{Drawer as F,DrawerClose as S,DrawerContent as j,DrawerHeader as z,DrawerFooter as B}from"../components/ui/drawer";import{X as G}from"lucide-react";import{Button as H}from"../components/ui/button";import e from"react";import{Separator as r}from"../components/ui/separator";import{cn as O}from"../lib/utils";export const DrawerGeneric=({direction:t="right",filterDrawer:a,filterDrawerFooter:l,filterDrawerHeader:m,formDrawer:n,formDrawerFooter:o,formDrawerHeader:c,misc1Drawer:s,misc1DrawerFooter:i,misc1DrawerHeader:w,misc2Drawer:p,misc2DrawerFooter:f,misc2DrawerHeader:u,moreActionsDrawer:E,moreActionsDrawerFooter:d,moreActionsDrawerHeader:h,onOpenChange:x,open:D,viewDrawer:N,viewDrawerFooter:g,viewDrawerHeader:C,width:v="small"})=>{const y={small:"w-[400px]",medium:"w-[700px]",large:"w-[1000px]",full:"w-screen"};return e.createElement(e.Fragment,null,e.createElement(F,{direction:t,onOpenChange:x,open:D},e.createElement(j,{className:O("",y[v])},e.createElement(z,{className:"flex flex-row justify-center items-start"},e.createElement("div",{className:"w-full"},h,m,c,C,w,u),e.createElement(S,{asChild:!0},e.createElement(H,{size:"icon",variant:"ghost",className:"h-8 w-8"},e.createElement(G,{className:"h-4 w-4"})))),e.createElement(r,null),e.createElement("div",{className:"overflow-y-auto p-4 flex-1"},E,a,n,N,s,p),e.createElement(r,null),e.createElement(B,null,d,l,o,g,i,f))))};
@@ -1,4 +1,2 @@
1
- import React from "react";
2
- import type { EnhancedDropzoneProps } from "./enhanced-dropzone-impl";
3
- export type { EnhancedDropzoneProps };
4
- export declare const EnhancedDropzone: React.FC<EnhancedDropzoneProps>;
1
+ export type { EnhancedDropzoneProps } from "./enhanced-dropzone-impl";
2
+ export { EnhancedDropzone } from "./enhanced-dropzone-impl";
@@ -1 +1 @@
1
- "use strict";"use client";import e,{Suspense as n}from"react";const r=e.lazy(()=>import("./enhanced-dropzone-impl").then(t=>({default:t.EnhancedDropzone})));export const EnhancedDropzone=t=>e.createElement(n,{fallback:e.createElement("div",{className:"w-full min-h-70 rounded-md border border-dashed p-6 text-center flex items-center justify-center"},e.createElement("p",{className:"text-sm text-muted-foreground"},"Loading dropzone..."))},e.createElement(r,Object.assign({},t)));
1
+ "use strict";export{EnhancedDropzone}from"./enhanced-dropzone-impl";
@@ -1 +1 @@
1
- "use strict";"use client";import e,{Suspense as v,useCallback as u,useState as g}from"react";import{Dialog as y,DialogContent as x,DialogDescription as z,DialogFooter as C,DialogHeader as D,DialogTitle as I}from"./ui/dialog";import{Button as p}from"./ui/button";import{Slider as j}from"./ui/slider";const N=e.lazy(()=>import("react-easy-crop"));async function b(c,t,n="cropped-image.jpg"){const a=await S(c),o=document.createElement("canvas"),m=o.getContext("2d");if(!m)throw new Error("No 2d context");return o.width=t.width,o.height=t.height,m.drawImage(a,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise((d,s)=>{o.toBlob(i=>{if(!i){s(new Error("Canvas is empty"));return}const l=new File([i],n,{type:"image/jpeg"});d(l)},"image/jpeg")})}function S(c){return new Promise((t,n)=>{const a=new Image;a.addEventListener("load",()=>t(a)),a.addEventListener("error",o=>n(o)),a.src=c})}export const ImageResizeDialog=({open:c,onClose:t,imageUrl:n,onCropComplete:a,fileName:o="cropped-image.jpg"})=>{const[m,d]=g({x:0,y:0}),[s,i]=g(1),[l,h]=g(null),E=u((r,w)=>{h(w)},[]),f=u(async()=>{if(l)try{const r=await b(n,l,o);a(r),t()}catch(r){console.error("Failed to crop image:",r)}},[l,n,o,a,t]);return e.createElement(y,{open:c,onOpenChange:t},e.createElement(x,{className:"max-w-3xl","data-slot":"image-resize-dialog","data-testid":"image-resize-dialog"},e.createElement(D,null,e.createElement(I,null,"Resize Image"),e.createElement(z,null,"Adjust the crop area to create a square image. Use the slider to zoom in or out.")),e.createElement("div",{className:"relative h-[400px] w-full bg-muted rounded-md overflow-hidden"},e.createElement(v,{fallback:e.createElement("div",{className:"flex h-full w-full items-center justify-center text-muted-foreground text-sm"},"Loading crop editor...")},e.createElement(N,{image:n,crop:m,zoom:s,aspect:1,onCropChange:d,onCropComplete:E,onZoomChange:i}))),e.createElement("div",{className:"space-y-2"},e.createElement("label",{className:"text-sm font-medium"},"Zoom"),e.createElement(j,{value:[s],onValueChange:r=>i(r[0]||1),min:1,max:3,step:.1,className:"w-full","data-testid":"zoom-slider"})),e.createElement(C,null,e.createElement(p,{variant:"outline",onClick:t,"data-testid":"cancel-button"},"Cancel"),e.createElement(p,{onClick:f,"data-testid":"save-button"},"Save"))))};
1
+ "use strict";"use client";import t,{useCallback as u,useState as g}from"react";import v from"react-easy-crop";import{Dialog as y,DialogContent as z,DialogDescription as C,DialogFooter as D,DialogHeader as I,DialogTitle as x}from"./ui/dialog";import{Button as p}from"./ui/button";import{Slider as j}from"./ui/slider";async function N(c,e,n="cropped-image.jpg"){const a=await b(c),o=document.createElement("canvas"),l=o.getContext("2d");if(!l)throw new Error("No 2d context");return o.width=e.width,o.height=e.height,l.drawImage(a,e.x,e.y,e.width,e.height,0,0,e.width,e.height),new Promise((d,s)=>{o.toBlob(i=>{if(!i){s(new Error("Canvas is empty"));return}const m=new File([i],n,{type:"image/jpeg"});d(m)},"image/jpeg")})}function b(c){return new Promise((e,n)=>{const a=new Image;a.addEventListener("load",()=>e(a)),a.addEventListener("error",o=>n(o)),a.src=c})}export const ImageResizeDialog=({open:c,onClose:e,imageUrl:n,onCropComplete:a,fileName:o="cropped-image.jpg"})=>{const[l,d]=g({x:0,y:0}),[s,i]=g(1),[m,h]=g(null),w=u((r,f)=>{h(f)},[]),E=u(async()=>{if(m)try{const r=await N(n,m,o);a(r),e()}catch(r){console.error("Failed to crop image:",r)}},[m,n,o,a,e]);return t.createElement(y,{open:c,onOpenChange:e},t.createElement(z,{className:"max-w-3xl","data-slot":"image-resize-dialog","data-testid":"image-resize-dialog"},t.createElement(I,null,t.createElement(x,null,"Resize Image"),t.createElement(C,null,"Adjust the crop area to create a square image. Use the slider to zoom in or out.")),t.createElement("div",{className:"relative h-[400px] w-full bg-muted rounded-md overflow-hidden"},t.createElement(v,{image:n,crop:l,zoom:s,aspect:1,onCropChange:d,onCropComplete:w,onZoomChange:i})),t.createElement("div",{className:"space-y-2"},t.createElement("label",{className:"text-sm font-medium"},"Zoom"),t.createElement(j,{value:[s],onValueChange:r=>i(r[0]||1),min:1,max:3,step:.1,className:"w-full","data-testid":"zoom-slider"})),t.createElement(D,null,t.createElement(p,{variant:"outline",onClick:e,"data-testid":"cancel-button"},"Cancel"),t.createElement(p,{onClick:E,"data-testid":"save-button"},"Save"))))};
@@ -1,4 +1,2 @@
1
- import * as React from "react";
2
- import { type AreaChartV1Props } from "./area-chart-v1-impl";
3
- export type { AreaChartV1Props };
4
- export declare const AreaChartV1: (props: AreaChartV1Props) => React.JSX.Element;
1
+ export type { AreaChartV1Props } from "./area-chart-v1-impl";
2
+ export { AreaChartV1 } from "./area-chart-v1-impl";
@@ -1 +1 @@
1
- "use strict";"use client";import*as e from"react";const a=e.lazy(()=>import("./area-chart-v1-impl").then(t=>({default:t.AreaChartV1})));export const AreaChartV1=t=>e.createElement(e.Suspense,{fallback:e.createElement("div",{className:"h-[250px] w-full animate-pulse rounded-xl bg-muted"})},e.createElement(a,Object.assign({},t)));
1
+ "use strict";export{AreaChartV1}from"./area-chart-v1-impl";
@@ -1,2 +1 @@
1
- export declare const Calendar: typeof import("./calendar-impl")["Calendar"];
2
- export declare const CalendarDayButton: typeof import("./calendar-impl")["CalendarDayButton"];
1
+ export { Calendar, CalendarDayButton } from "./calendar-impl";
@@ -1 +1 @@
1
- "use strict";"use client";import*as n from"react";const o=import("./calendar-impl"),t=a=>n.lazy(()=>o.then(e=>({default:e[a]})));export const Calendar=t("Calendar"),CalendarDayButton=t("CalendarDayButton");
1
+ "use strict";export{Calendar,CalendarDayButton}from"./calendar-impl";
@@ -1,6 +1,2 @@
1
1
  export type { CarouselApi } from "./carousel-impl";
2
- export declare const Carousel: typeof import("./carousel-impl")["Carousel"];
3
- export declare const CarouselContent: typeof import("./carousel-impl")["CarouselContent"];
4
- export declare const CarouselItem: typeof import("./carousel-impl")["CarouselItem"];
5
- export declare const CarouselPrevious: typeof import("./carousel-impl")["CarouselPrevious"];
6
- export declare const CarouselNext: typeof import("./carousel-impl")["CarouselNext"];
2
+ export { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, } from "./carousel-impl";
@@ -1 +1 @@
1
- "use strict";"use client";import*as s from"react";const r=import("./carousel-impl"),o=e=>s.lazy(()=>r.then(t=>({default:t[e]})));export const Carousel=o("Carousel"),CarouselContent=o("CarouselContent"),CarouselItem=o("CarouselItem"),CarouselPrevious=o("CarouselPrevious"),CarouselNext=o("CarouselNext");
1
+ "use strict";export{Carousel,CarouselContent,CarouselItem,CarouselPrevious,CarouselNext}from"./carousel-impl";
@@ -1,9 +1 @@
1
- export declare const Command: typeof import("./command-impl")["Command"];
2
- export declare const CommandDialog: typeof import("./command-impl")["CommandDialog"];
3
- export declare const CommandInput: typeof import("./command-impl")["CommandInput"];
4
- export declare const CommandList: typeof import("./command-impl")["CommandList"];
5
- export declare const CommandEmpty: typeof import("./command-impl")["CommandEmpty"];
6
- export declare const CommandGroup: typeof import("./command-impl")["CommandGroup"];
7
- export declare const CommandItem: typeof import("./command-impl")["CommandItem"];
8
- export declare const CommandShortcut: typeof import("./command-impl")["CommandShortcut"];
9
- export declare const CommandSeparator: typeof import("./command-impl")["CommandSeparator"];
1
+ export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, } from "./command-impl";
@@ -1 +1 @@
1
- "use strict";"use client";import*as n from"react";const a=import("./command-impl"),o=m=>n.lazy(()=>a.then(t=>({default:t[m]})));export const Command=o("Command"),CommandDialog=o("CommandDialog"),CommandInput=o("CommandInput"),CommandList=o("CommandList"),CommandEmpty=o("CommandEmpty"),CommandGroup=o("CommandGroup"),CommandItem=o("CommandItem"),CommandShortcut=o("CommandShortcut"),CommandSeparator=o("CommandSeparator");
1
+ "use strict";export{Command,CommandDialog,CommandInput,CommandList,CommandEmpty,CommandGroup,CommandItem,CommandShortcut,CommandSeparator}from"./command-impl";
@@ -1,4 +1 @@
1
- export declare const InputOTP: typeof import("./input-otp-impl")["InputOTP"];
2
- export declare const InputOTPGroup: typeof import("./input-otp-impl")["InputOTPGroup"];
3
- export declare const InputOTPSlot: typeof import("./input-otp-impl")["InputOTPSlot"];
4
- export declare const InputOTPSeparator: typeof import("./input-otp-impl")["InputOTPSeparator"];
1
+ export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator, } from "./input-otp-impl";
@@ -1 +1 @@
1
- "use strict";"use client";import*as n from"react";const r=import("./input-otp-impl"),t=o=>n.lazy(()=>r.then(p=>({default:p[o]})));export const InputOTP=t("InputOTP"),InputOTPGroup=t("InputOTPGroup"),InputOTPSlot=t("InputOTPSlot"),InputOTPSeparator=t("InputOTPSeparator");
1
+ "use strict";export{InputOTP,InputOTPGroup,InputOTPSlot,InputOTPSeparator}from"./input-otp-impl";
@@ -1,3 +1 @@
1
- export declare const ResizablePanelGroup: typeof import("./resizable-impl")["ResizablePanelGroup"];
2
- export declare const ResizablePanel: typeof import("./resizable-impl")["ResizablePanel"];
3
- export declare const ResizableHandle: typeof import("./resizable-impl")["ResizableHandle"];
1
+ export { ResizablePanelGroup, ResizablePanel, ResizableHandle, } from "./resizable-impl";
@@ -1 +1 @@
1
- "use strict";"use client";import o from"react";const t=import("./resizable-impl"),e=l=>o.lazy(()=>t.then(a=>({default:a[l]})));export const ResizablePanelGroup=e("ResizablePanelGroup"),ResizablePanel=e("ResizablePanel"),ResizableHandle=e("ResizableHandle");
1
+ "use strict";export{ResizablePanelGroup,ResizablePanel,ResizableHandle}from"./resizable-impl";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appcorp/shadcn",
3
- "version": "2.0.8",
3
+ "version": "2.0.10",
4
4
  "license": "MIT",
5
5
  "author": "Taimoor Khan <taimoor.m.k@live.com>",
6
6
  "repository": "https://github.com/app-corp/shadcn",