@arolariu/components 0.0.8 → 0.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.
- package/dist/cjs/components/ui/breadcrumb.js +1 -1
- package/dist/cjs/components/ui/form.js +1 -1
- package/dist/cjs/components/ui/sidebar.js +1 -1
- package/dist/es/components/ui/breadcrumb.js +13 -13
- package/dist/es/components/ui/form.js +17 -16
- package/dist/es/components/ui/sidebar.js +30 -30
- package/dist/umd/arolariu-components.umd.js +3 -3
- package/package.json +19 -4
- package/src/components/ui/accordion.tsx +66 -0
- package/src/components/ui/alert-dialog.tsx +157 -0
- package/src/components/ui/alert.tsx +66 -0
- package/src/components/ui/aspect-ratio.tsx +11 -0
- package/src/components/ui/avatar.tsx +53 -0
- package/src/components/ui/badge.tsx +46 -0
- package/src/components/ui/breadcrumb.tsx +109 -0
- package/src/components/ui/button.tsx +58 -0
- package/src/components/ui/calendar.tsx +75 -0
- package/src/components/ui/card.tsx +68 -0
- package/src/components/ui/carousel.tsx +241 -0
- package/src/components/ui/chart.tsx +353 -0
- package/src/components/ui/checkbox.tsx +32 -0
- package/src/components/ui/collapsible.tsx +33 -0
- package/src/components/ui/command.tsx +177 -0
- package/src/components/ui/context-menu.tsx +252 -0
- package/src/components/ui/dialog.tsx +135 -0
- package/src/components/ui/drawer.tsx +132 -0
- package/src/components/ui/dropdown-menu.tsx +257 -0
- package/src/components/ui/form.tsx +167 -0
- package/src/components/ui/hover-card.tsx +42 -0
- package/src/components/ui/input-otp.tsx +78 -0
- package/src/components/ui/input.tsx +21 -0
- package/src/components/ui/label.tsx +24 -0
- package/src/components/ui/menubar.tsx +276 -0
- package/src/components/ui/navigation-menu.tsx +170 -0
- package/src/components/ui/pagination.tsx +127 -0
- package/src/components/ui/popover.tsx +48 -0
- package/src/components/ui/progress.tsx +31 -0
- package/src/components/ui/radio-group.tsx +45 -0
- package/src/components/ui/resizable.tsx +56 -0
- package/src/components/ui/scroll-area.tsx +58 -0
- package/src/components/ui/select.tsx +181 -0
- package/src/components/ui/separator.tsx +28 -0
- package/src/components/ui/sheet.tsx +139 -0
- package/src/components/ui/sidebar.tsx +723 -0
- package/src/components/ui/skeleton.tsx +13 -0
- package/src/components/ui/slider.tsx +63 -0
- package/src/components/ui/sonner.tsx +29 -0
- package/src/components/ui/switch.tsx +31 -0
- package/src/components/ui/table.tsx +116 -0
- package/src/components/ui/tabs.tsx +66 -0
- package/src/components/ui/textarea.tsx +18 -0
- package/src/components/ui/toggle-group.tsx +73 -0
- package/src/components/ui/toggle.tsx +47 -0
- package/src/components/ui/tooltip.tsx +61 -0
- package/src/hooks/use-mobile.ts +19 -0
- package/src/hooks/use-mobile.tsx +19 -0
- package/src/index.css +137 -0
- package/src/index.ts +326 -0
- package/src/lib/utils.ts +6 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),u=require("@radix-ui/react-slot"),n=require("lucide-react"),t=require("../../lib/utils.js");function i({...e}){return a.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function l({className:e,...r}){return a.jsx("ol",{"data-slot":"breadcrumb-list",className:t.cn("text-neutral-500 flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5 dark:text-neutral-400",e),...r})}function o({className:e,...r}){return a.jsx("li",{"data-slot":"breadcrumb-item",className:t.cn("inline-flex items-center gap-1.5",e),...r})}function m({asChild:e,className:r,...s}){const c=e?u.Slot:"a";return a.jsx(c,{"data-slot":"breadcrumb-link",className:t.cn("hover:text-neutral-950 transition-colors dark:hover:text-neutral-50",r),...s})}function d({className:e,...r}){return a.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:t.cn("text-neutral-950 font-normal dark:text-neutral-50",e),...r})}function b({children:e,className:r,...s}){return a.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:t.cn("[&>svg]:size-3.5",r),...s,children:e!=null?e:a.jsx(n.ChevronRight,{})})}function x({className:e,...r}){return a.jsxs("span",{"data-slot":"breadcrumb-ellipsis",role:"presentation","aria-hidden":"true",className:t.cn("flex size-9 items-center justify-center",e),...r,children:[a.jsx(n.MoreHorizontal,{className:"size-4"}),a.jsx("span",{className:"sr-only",children:"More"})]})}exports.Breadcrumb=i;exports.BreadcrumbEllipsis=x;exports.BreadcrumbItem=o;exports.BreadcrumbLink=m;exports.BreadcrumbList=l;exports.BreadcrumbPage=d;exports.BreadcrumbSeparator=b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),f=require("react"),F=require("@radix-ui/react-slot"),c=require("react-hook-form"),l=require("../../lib/utils.js"),x=require("./label.js");function g(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),f=require("react"),F=require("@radix-ui/react-slot"),c=require("react-hook-form"),l=require("../../lib/utils.js"),x=require("./label.js");function g(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const i=g(f),b=c.FormProvider,d=i.createContext({}),I=({...e})=>n.jsx(d.Provider,{value:{name:e.name},children:n.jsx(c.Controller,{...e})}),m=()=>{const e=i.useContext(d),r=i.useContext(u),{getFieldState:t}=c.useFormContext(),o=c.useFormState({name:e.name}),a=t(e.name,o);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:s}=r;return{id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...a}},u=i.createContext({});function j({className:e,...r}){const t=i.useId();return n.jsx(u.Provider,{value:{id:t},children:n.jsx("div",{"data-slot":"form-item",className:l.cn("grid gap-2",e),...r})})}function p({className:e,...r}){const{error:t,formItemId:o}=m();return n.jsx(x.Label,{"data-slot":"form-label","data-error":!!t,className:l.cn("data-[error=true]:text-neutral-50 dark:data-[error=true]:text-neutral-50",e),htmlFor:o,...r})}function C({...e}){const{error:r,formItemId:t,formDescriptionId:o,formMessageId:a}=m();return n.jsx(F.Slot,{"data-slot":"form-control",id:t,"aria-describedby":r?`${o} ${a}`:`${o}`,"aria-invalid":!!r,...e})}function S({className:e,...r}){const{formDescriptionId:t}=m();return n.jsx("p",{"data-slot":"form-description",id:t,className:l.cn("text-neutral-500 text-sm dark:text-neutral-400",e),...r})}function v({className:e,...r}){var s;const{error:t,formMessageId:o}=m(),a=t?String((s=t==null?void 0:t.message)!=null?s:""):r.children;return a?n.jsx("p",{"data-slot":"form-message",id:o,className:l.cn("text-neutral-50 text-sm dark:text-neutral-50",e),...r,children:a}):null}exports.Form=b;exports.FormControl=C;exports.FormDescription=S;exports.FormField=I;exports.FormItem=j;exports.FormLabel=p;exports.FormMessage=v;exports.useFormField=m;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),I=require("react"),h=require("@radix-ui/react-slot"),z=require("class-variance-authority"),C=require("lucide-react"),O=require("../../hooks/use-mobile.js"),i=require("../../lib/utils.js"),T=require("./button.js"),D=require("./input.js"),B=require("./separator.js"),m=require("./sheet.js"),M=require("./skeleton.js"),j=require("./tooltip.js");function E(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const r in a)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(a,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>a[r]})}}return e.default=a,Object.freeze(e)}const c=E(I),q="sidebar_state",A=60*60*24*7,R="16rem",G="18rem",H="3rem",P="b",N=c.createContext(null);function x(){const a=c.useContext(N);if(!a)throw new Error("useSidebar must be used within a SidebarProvider.");return a}function K({defaultOpen:a=!0,open:e,onOpenChange:r,className:n,style:s,children:o,...p}){const l=O.useIsMobile(),[f,u]=c.useState(!1),[v,_]=c.useState(a),g=e??v,S=c.useCallback(d=>{const b=typeof d=="function"?d(g):d;r?r(b):_(b),document.cookie=`${q}=${b}; path=/; max-age=${A}`},[r,g]),w=c.useCallback(()=>l?u(d=>!d):S(d=>!d),[l,S,u]);c.useEffect(()=>{const d=b=>{b.key===P&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),w())};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[w]);const y=g?"expanded":"collapsed",k=c.useMemo(()=>({state:y,open:g,setOpen:S,isMobile:l,openMobile:f,setOpenMobile:u,toggleSidebar:w}),[y,g,S,l,f,u,w]);return t.jsx(N.Provider,{value:k,children:t.jsx(j.TooltipProvider,{delayDuration:0,children:t.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":R,"--sidebar-width-icon":H,...s},className:i.cn("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",n),...p,children:o})})})}function L({side:a="left",variant:e="sidebar",collapsible:r="offcanvas",className:n,children:s,...o}){const{isMobile:p,state:l,openMobile:f,setOpenMobile:u}=x();return r==="none"?t.jsx("div",{"data-slot":"sidebar",className:i.cn("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",n),...o,children:s}):p?t.jsx(m.Sheet,{open:f,onOpenChange:u,...o,children:t.jsxs(m.SheetContent,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":G},side:a,children:[t.jsxs(m.SheetHeader,{className:"sr-only",children:[t.jsx(m.SheetTitle,{children:"Sidebar"}),t.jsx(m.SheetDescription,{children:"Displays the mobile sidebar."})]}),t.jsx("div",{className:"flex h-full w-full flex-col",children:s})]})}):t.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":l,"data-collapsible":l==="collapsed"?r:"","data-variant":e,"data-side":a,"data-slot":"sidebar",children:[t.jsx("div",{className:i.cn("relative h-svh w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),t.jsx("div",{className:i.cn("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",a==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...o,children:t.jsx("div",{"data-sidebar":"sidebar",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:s})})]})}function V({className:a,onClick:e,...r}){const{toggleSidebar:n}=x();return t.jsxs(T.Button,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:i.cn("h-7 w-7",a),onClick:s=>{e==null||e(s),n()},...r,children:[t.jsx(C.PanelLeftIcon,{}),t.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function W({className:a,...e}){const{toggleSidebar:r}=x();return t.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:i.cn("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",a),...e})}function F({className:a,...e}){return t.jsx("main",{"data-slot":"sidebar-inset",className:i.cn("bg-white relative flex min-h-svh w-full flex-1 flex-col dark:bg-neutral-950","peer-data-[variant=inset]:min-h-[calc(100svh-(--spacing(4)))] md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",a),...e})}function U({className:a,...e}){return t.jsx(D.Input,{"data-slot":"sidebar-input","data-sidebar":"input",className:i.cn("bg-white h-8 w-full shadow-none dark:bg-neutral-950",a),...e})}function X({className:a,...e}){return t.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:i.cn("flex flex-col gap-2 p-2",a),...e})}function Y({className:a,...e}){return t.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:i.cn("flex flex-col gap-2 p-2",a),...e})}function J({className:a,...e}){return t.jsx(B.Separator,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:i.cn("bg-sidebar-border mx-2 w-auto",a),...e})}function Q({className:a,...e}){return t.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:i.cn("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",a),...e})}function Z({className:a,...e}){return t.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:i.cn("relative flex w-full min-w-0 flex-col p-2",a),...e})}function $({className:a,asChild:e=!1,...r}){const n=e?h.Slot:"div";return t.jsx(n,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:i.cn("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",a),...r})}function ee({className:a,asChild:e=!1,...r}){const n=e?h.Slot:"button";return t.jsx(n,{"data-slot":"sidebar-group-action","data-sidebar":"group-action",className:i.cn("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",a),...r})}function ae({className:a,...e}){return t.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:i.cn("w-full text-sm",a),...e})}function te({className:a,...e}){return t.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:i.cn("flex w-full min-w-0 flex-col gap-1",a),...e})}function re({className:a,...e}){return t.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:i.cn("group/menu-item relative",a),...e})}const ie=z.cva("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-white shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))] dark:bg-neutral-950"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function ne({asChild:a=!1,isActive:e=!1,variant:r="default",size:n="default",tooltip:s,className:o,...p}){const l=a?h.Slot:"button",{isMobile:f,state:u}=x(),v=t.jsx(l,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":n,"data-active":e,className:i.cn(ie({variant:r,size:n}),o),...p});return s?(typeof s=="string"&&(s={children:s}),t.jsxs(j.Tooltip,{children:[t.jsx(j.TooltipTrigger,{asChild:!0,children:v}),t.jsx(j.TooltipContent,{side:"right",align:"center",hidden:u!=="collapsed"||f,...s})]})):v}function se({className:a,asChild:e=!1,showOnHover:r=!1,...n}){const s=e?h.Slot:"button";return t.jsx(s,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:i.cn("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",a),...n})}function de({className:a,...e}){return t.jsx("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:i.cn("text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",a),...e})}function oe({className:a,showIcon:e=!1,...r}){const n=c.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return t.jsxs("div",{"data-slot":"sidebar-menu-skeleton","data-sidebar":"menu-skeleton",className:i.cn("flex h-8 items-center gap-2 rounded-md px-2",a),...r,children:[e&&t.jsx(M.Skeleton,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),t.jsx(M.Skeleton,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":n}})]})}function le({className:a,...e}){return t.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:i.cn("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",a),...e})}function ce({className:a,...e}){return t.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:i.cn("group/menu-sub-item relative",a),...e})}function ue({asChild:a=!1,size:e="md",isActive:r=!1,className:n,...s}){const o=a?h.Slot:"a";return t.jsx(o,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":e,"data-active":r,className:i.cn("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",e==="sm"&&"text-xs",e==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",n),...s})}exports.Sidebar=L;exports.SidebarContent=Q;exports.SidebarFooter=Y;exports.SidebarGroup=Z;exports.SidebarGroupAction=ee;exports.SidebarGroupContent=ae;exports.SidebarGroupLabel=$;exports.SidebarHeader=X;exports.SidebarInput=U;exports.SidebarInset=F;exports.SidebarMenu=te;exports.SidebarMenuAction=se;exports.SidebarMenuBadge=de;exports.SidebarMenuButton=ne;exports.SidebarMenuItem=re;exports.SidebarMenuSkeleton=oe;exports.SidebarMenuSub=le;exports.SidebarMenuSubButton=ue;exports.SidebarMenuSubItem=ce;exports.SidebarProvider=K;exports.SidebarRail=W;exports.SidebarSeparator=J;exports.SidebarTrigger=V;exports.useSidebar=x;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),I=require("react"),h=require("@radix-ui/react-slot"),z=require("class-variance-authority"),C=require("lucide-react"),O=require("../../hooks/use-mobile.js"),i=require("../../lib/utils.js"),T=require("./button.js"),D=require("./input.js"),B=require("./separator.js"),m=require("./sheet.js"),M=require("./skeleton.js"),j=require("./tooltip.js");function E(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const r in a)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(a,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>a[r]})}}return e.default=a,Object.freeze(e)}const c=E(I),q="sidebar_state",A=60*60*24*7,R="16rem",G="18rem",H="3rem",K="b",N=c.createContext(null);function x(){const a=c.useContext(N);if(!a)throw new Error("useSidebar must be used within a SidebarProvider.");return a}function L({defaultOpen:a=!0,open:e,onOpenChange:r,className:n,style:s,children:o,...p}){const l=O.useIsMobile(),[f,u]=c.useState(!1),[v,_]=c.useState(a),g=e!=null?e:v,S=c.useCallback(d=>{const b=typeof d=="function"?d(g):d;r?r(b):_(b),document.cookie=`${q}=${b}; path=/; max-age=${A}`},[r,g]),w=c.useCallback(()=>l?u(d=>!d):S(d=>!d),[l,S,u]);c.useEffect(()=>{const d=b=>{b.key===K&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),w())};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[w]);const y=g?"expanded":"collapsed",k=c.useMemo(()=>({state:y,open:g,setOpen:S,isMobile:l,openMobile:f,setOpenMobile:u,toggleSidebar:w}),[y,g,S,l,f,u,w]);return t.jsx(N.Provider,{value:k,children:t.jsx(j.TooltipProvider,{delayDuration:0,children:t.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":R,"--sidebar-width-icon":H,...s},className:i.cn("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",n),...p,children:o})})})}function V({side:a="left",variant:e="sidebar",collapsible:r="offcanvas",className:n,children:s,...o}){const{isMobile:p,state:l,openMobile:f,setOpenMobile:u}=x();return r==="none"?t.jsx("div",{"data-slot":"sidebar",className:i.cn("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",n),...o,children:s}):p?t.jsx(m.Sheet,{open:f,onOpenChange:u,...o,children:t.jsxs(m.SheetContent,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":G},side:a,children:[t.jsxs(m.SheetHeader,{className:"sr-only",children:[t.jsx(m.SheetTitle,{children:"Sidebar"}),t.jsx(m.SheetDescription,{children:"Displays the mobile sidebar."})]}),t.jsx("div",{className:"flex h-full w-full flex-col",children:s})]})}):t.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":l,"data-collapsible":l==="collapsed"?r:"","data-variant":e,"data-side":a,"data-slot":"sidebar",children:[t.jsx("div",{className:i.cn("relative h-svh w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),t.jsx("div",{className:i.cn("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",a==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...o,children:t.jsx("div",{"data-sidebar":"sidebar",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:s})})]})}function P({className:a,onClick:e,...r}){const{toggleSidebar:n}=x();return t.jsxs(T.Button,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:i.cn("h-7 w-7",a),onClick:s=>{e==null||e(s),n()},...r,children:[t.jsx(C.PanelLeftIcon,{}),t.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function W({className:a,...e}){const{toggleSidebar:r}=x();return t.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:i.cn("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",a),...e})}function F({className:a,...e}){return t.jsx("main",{"data-slot":"sidebar-inset",className:i.cn("bg-white relative flex min-h-svh w-full flex-1 flex-col dark:bg-neutral-950","peer-data-[variant=inset]:min-h-[calc(100svh-(--spacing(4)))] md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",a),...e})}function U({className:a,...e}){return t.jsx(D.Input,{"data-slot":"sidebar-input","data-sidebar":"input",className:i.cn("bg-white h-8 w-full shadow-none dark:bg-neutral-950",a),...e})}function X({className:a,...e}){return t.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:i.cn("flex flex-col gap-2 p-2",a),...e})}function Y({className:a,...e}){return t.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:i.cn("flex flex-col gap-2 p-2",a),...e})}function J({className:a,...e}){return t.jsx(B.Separator,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:i.cn("bg-sidebar-border mx-2 w-auto",a),...e})}function Q({className:a,...e}){return t.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:i.cn("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",a),...e})}function Z({className:a,...e}){return t.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:i.cn("relative flex w-full min-w-0 flex-col p-2",a),...e})}function $({className:a,asChild:e=!1,...r}){const n=e?h.Slot:"div";return t.jsx(n,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:i.cn("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",a),...r})}function ee({className:a,asChild:e=!1,...r}){const n=e?h.Slot:"button";return t.jsx(n,{"data-slot":"sidebar-group-action","data-sidebar":"group-action",className:i.cn("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",a),...r})}function ae({className:a,...e}){return t.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:i.cn("w-full text-sm",a),...e})}function te({className:a,...e}){return t.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:i.cn("flex w-full min-w-0 flex-col gap-1",a),...e})}function re({className:a,...e}){return t.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:i.cn("group/menu-item relative",a),...e})}const ie=z.cva("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-white shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))] dark:bg-neutral-950"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function ne({asChild:a=!1,isActive:e=!1,variant:r="default",size:n="default",tooltip:s,className:o,...p}){const l=a?h.Slot:"button",{isMobile:f,state:u}=x(),v=t.jsx(l,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":n,"data-active":e,className:i.cn(ie({variant:r,size:n}),o),...p});return s?(typeof s=="string"&&(s={children:s}),t.jsxs(j.Tooltip,{children:[t.jsx(j.TooltipTrigger,{asChild:!0,children:v}),t.jsx(j.TooltipContent,{side:"right",align:"center",hidden:u!=="collapsed"||f,...s})]})):v}function se({className:a,asChild:e=!1,showOnHover:r=!1,...n}){const s=e?h.Slot:"button";return t.jsx(s,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:i.cn("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",a),...n})}function de({className:a,...e}){return t.jsx("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:i.cn("text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",a),...e})}function oe({className:a,showIcon:e=!1,...r}){const n=c.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return t.jsxs("div",{"data-slot":"sidebar-menu-skeleton","data-sidebar":"menu-skeleton",className:i.cn("flex h-8 items-center gap-2 rounded-md px-2",a),...r,children:[e&&t.jsx(M.Skeleton,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),t.jsx(M.Skeleton,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":n}})]})}function le({className:a,...e}){return t.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:i.cn("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",a),...e})}function ce({className:a,...e}){return t.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:i.cn("group/menu-sub-item relative",a),...e})}function ue({asChild:a=!1,size:e="md",isActive:r=!1,className:n,...s}){const o=a?h.Slot:"a";return t.jsx(o,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":e,"data-active":r,className:i.cn("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",e==="sm"&&"text-xs",e==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",n),...s})}exports.Sidebar=V;exports.SidebarContent=Q;exports.SidebarFooter=Y;exports.SidebarGroup=Z;exports.SidebarGroupAction=ee;exports.SidebarGroupContent=ae;exports.SidebarGroupLabel=$;exports.SidebarHeader=X;exports.SidebarInput=U;exports.SidebarInset=F;exports.SidebarMenu=te;exports.SidebarMenuAction=se;exports.SidebarMenuBadge=de;exports.SidebarMenuButton=ne;exports.SidebarMenuItem=re;exports.SidebarMenuSkeleton=oe;exports.SidebarMenuSub=le;exports.SidebarMenuSubButton=ue;exports.SidebarMenuSubItem=ce;exports.SidebarProvider=L;exports.SidebarRail=W;exports.SidebarSeparator=J;exports.SidebarTrigger=P;exports.useSidebar=x;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as a, jsxs as s } from "react/jsx-runtime";
|
|
2
|
-
import { Slot as
|
|
3
|
-
import { ChevronRight as
|
|
2
|
+
import { Slot as o } from "@radix-ui/react-slot";
|
|
3
|
+
import { ChevronRight as l, MoreHorizontal as i } from "lucide-react";
|
|
4
4
|
import { cn as t } from "../../lib/utils.js";
|
|
5
5
|
function p({ ...r }) {
|
|
6
6
|
return /* @__PURE__ */ a("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...r });
|
|
@@ -28,13 +28,13 @@ function x({ className: r, ...e }) {
|
|
|
28
28
|
}
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function g({
|
|
32
32
|
asChild: r,
|
|
33
33
|
className: e,
|
|
34
34
|
...n
|
|
35
35
|
}) {
|
|
36
36
|
return /* @__PURE__ */ a(
|
|
37
|
-
r ?
|
|
37
|
+
r ? o : "a",
|
|
38
38
|
{
|
|
39
39
|
"data-slot": "breadcrumb-link",
|
|
40
40
|
className: t("hover:text-neutral-950 transition-colors dark:hover:text-neutral-50", e),
|
|
@@ -42,7 +42,7 @@ function h({
|
|
|
42
42
|
}
|
|
43
43
|
);
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function N({ className: r, ...e }) {
|
|
46
46
|
return /* @__PURE__ */ a(
|
|
47
47
|
"span",
|
|
48
48
|
{
|
|
@@ -55,7 +55,7 @@ function g({ className: r, ...e }) {
|
|
|
55
55
|
}
|
|
56
56
|
);
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function k({
|
|
59
59
|
children: r,
|
|
60
60
|
className: e,
|
|
61
61
|
...n
|
|
@@ -68,11 +68,11 @@ function N({
|
|
|
68
68
|
"aria-hidden": "true",
|
|
69
69
|
className: t("[&>svg]:size-3.5", e),
|
|
70
70
|
...n,
|
|
71
|
-
children: r
|
|
71
|
+
children: r != null ? r : /* @__PURE__ */ a(l, {})
|
|
72
72
|
}
|
|
73
73
|
);
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function B({
|
|
76
76
|
className: r,
|
|
77
77
|
...e
|
|
78
78
|
}) {
|
|
@@ -85,7 +85,7 @@ function k({
|
|
|
85
85
|
className: t("flex size-9 items-center justify-center", r),
|
|
86
86
|
...e,
|
|
87
87
|
children: [
|
|
88
|
-
/* @__PURE__ */ a(
|
|
88
|
+
/* @__PURE__ */ a(i, { className: "size-4" }),
|
|
89
89
|
/* @__PURE__ */ a("span", { className: "sr-only", children: "More" })
|
|
90
90
|
]
|
|
91
91
|
}
|
|
@@ -93,10 +93,10 @@ function k({
|
|
|
93
93
|
}
|
|
94
94
|
export {
|
|
95
95
|
p as Breadcrumb,
|
|
96
|
-
|
|
96
|
+
B as BreadcrumbEllipsis,
|
|
97
97
|
x as BreadcrumbItem,
|
|
98
|
-
|
|
98
|
+
g as BreadcrumbLink,
|
|
99
99
|
f as BreadcrumbList,
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
N as BreadcrumbPage,
|
|
101
|
+
k as BreadcrumbSeparator
|
|
102
102
|
};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
2
|
+
import * as s from "react";
|
|
3
3
|
import { Slot as f } from "@radix-ui/react-slot";
|
|
4
4
|
import { FormProvider as u, useFormContext as F, useFormState as x, Controller as I } from "react-hook-form";
|
|
5
5
|
import { cn as i } from "../../lib/utils.js";
|
|
6
6
|
import { Label as p } from "./label.js";
|
|
7
|
-
const S = u, l =
|
|
7
|
+
const S = u, l = s.createContext(
|
|
8
8
|
{}
|
|
9
9
|
), $ = ({
|
|
10
10
|
...t
|
|
11
11
|
}) => /* @__PURE__ */ n(l.Provider, { value: { name: t.name }, children: /* @__PURE__ */ n(I, { ...t }) }), d = () => {
|
|
12
|
-
const t =
|
|
12
|
+
const t = s.useContext(l), r = s.useContext(c), { getFieldState: e } = F(), o = x({ name: t.name }), a = e(t.name, o);
|
|
13
13
|
if (!t)
|
|
14
14
|
throw new Error("useFormField should be used within <FormField>");
|
|
15
|
-
const { id:
|
|
15
|
+
const { id: m } = r;
|
|
16
16
|
return {
|
|
17
|
-
id:
|
|
17
|
+
id: m,
|
|
18
18
|
name: t.name,
|
|
19
|
-
formItemId: `${
|
|
20
|
-
formDescriptionId: `${
|
|
21
|
-
formMessageId: `${
|
|
22
|
-
...
|
|
19
|
+
formItemId: `${m}-form-item`,
|
|
20
|
+
formDescriptionId: `${m}-form-item-description`,
|
|
21
|
+
formMessageId: `${m}-form-item-message`,
|
|
22
|
+
...a
|
|
23
23
|
};
|
|
24
|
-
}, c =
|
|
24
|
+
}, c = s.createContext(
|
|
25
25
|
{}
|
|
26
26
|
);
|
|
27
27
|
function D({ className: t, ...r }) {
|
|
28
|
-
const e =
|
|
28
|
+
const e = s.useId();
|
|
29
29
|
return /* @__PURE__ */ n(c.Provider, { value: { id: e }, children: /* @__PURE__ */ n(
|
|
30
30
|
"div",
|
|
31
31
|
{
|
|
@@ -52,13 +52,13 @@ function M({
|
|
|
52
52
|
);
|
|
53
53
|
}
|
|
54
54
|
function N({ ...t }) {
|
|
55
|
-
const { error: r, formItemId: e, formDescriptionId: o, formMessageId:
|
|
55
|
+
const { error: r, formItemId: e, formDescriptionId: o, formMessageId: a } = d();
|
|
56
56
|
return /* @__PURE__ */ n(
|
|
57
57
|
f,
|
|
58
58
|
{
|
|
59
59
|
"data-slot": "form-control",
|
|
60
60
|
id: e,
|
|
61
|
-
"aria-describedby": r ? `${o} ${
|
|
61
|
+
"aria-describedby": r ? `${o} ${a}` : `${o}`,
|
|
62
62
|
"aria-invalid": !!r,
|
|
63
63
|
...t
|
|
64
64
|
}
|
|
@@ -77,15 +77,16 @@ function k({ className: t, ...r }) {
|
|
|
77
77
|
);
|
|
78
78
|
}
|
|
79
79
|
function w({ className: t, ...r }) {
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
var m;
|
|
81
|
+
const { error: e, formMessageId: o } = d(), a = e ? String((m = e == null ? void 0 : e.message) != null ? m : "") : r.children;
|
|
82
|
+
return a ? /* @__PURE__ */ n(
|
|
82
83
|
"p",
|
|
83
84
|
{
|
|
84
85
|
"data-slot": "form-message",
|
|
85
86
|
id: o,
|
|
86
87
|
className: i("text-neutral-50 text-sm dark:text-neutral-50", t),
|
|
87
88
|
...r,
|
|
88
|
-
children:
|
|
89
|
+
children: a
|
|
89
90
|
}
|
|
90
91
|
) : null;
|
|
91
92
|
}
|
|
@@ -11,34 +11,34 @@ import { Separator as T } from "./separator.js";
|
|
|
11
11
|
import { Sheet as B, SheetContent as A, SheetHeader as O, SheetTitle as R, SheetDescription as H } from "./sheet.js";
|
|
12
12
|
import { Skeleton as y } from "./skeleton.js";
|
|
13
13
|
import { Tooltip as K, TooltipTrigger as j, TooltipContent as G, TooltipProvider as L } from "./tooltip.js";
|
|
14
|
-
const $ = "sidebar_state",
|
|
14
|
+
const $ = "sidebar_state", V = 60 * 60 * 24 * 7, W = "16rem", q = "18rem", F = "3rem", U = "b", _ = l.createContext(null);
|
|
15
15
|
function S() {
|
|
16
16
|
const a = l.useContext(_);
|
|
17
17
|
if (!a)
|
|
18
18
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
19
19
|
return a;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function oe({
|
|
22
22
|
defaultOpen: a = !0,
|
|
23
23
|
open: e,
|
|
24
24
|
onOpenChange: i,
|
|
25
25
|
className: n,
|
|
26
|
-
style:
|
|
26
|
+
style: d,
|
|
27
27
|
children: u,
|
|
28
28
|
...m
|
|
29
29
|
}) {
|
|
30
|
-
const s = I(), [f, c] = l.useState(!1), [v, M] = l.useState(a), g = e
|
|
31
|
-
(
|
|
32
|
-
const b = typeof
|
|
33
|
-
i ? i(b) : M(b), document.cookie = `${$}=${b}; path=/; max-age=${
|
|
30
|
+
const s = I(), [f, c] = l.useState(!1), [v, M] = l.useState(a), g = e != null ? e : v, x = l.useCallback(
|
|
31
|
+
(o) => {
|
|
32
|
+
const b = typeof o == "function" ? o(g) : o;
|
|
33
|
+
i ? i(b) : M(b), document.cookie = `${$}=${b}; path=/; max-age=${V}`;
|
|
34
34
|
},
|
|
35
35
|
[i, g]
|
|
36
|
-
), w = l.useCallback(() => s ? c((
|
|
36
|
+
), w = l.useCallback(() => s ? c((o) => !o) : x((o) => !o), [s, x, c]);
|
|
37
37
|
l.useEffect(() => {
|
|
38
|
-
const
|
|
39
|
-
b.key ===
|
|
38
|
+
const o = (b) => {
|
|
39
|
+
b.key === U && (b.metaKey || b.ctrlKey) && (b.preventDefault(), w());
|
|
40
40
|
};
|
|
41
|
-
return window.addEventListener("keydown",
|
|
41
|
+
return window.addEventListener("keydown", o), () => window.removeEventListener("keydown", o);
|
|
42
42
|
}, [w]);
|
|
43
43
|
const N = g ? "expanded" : "collapsed", C = l.useMemo(
|
|
44
44
|
() => ({
|
|
@@ -57,9 +57,9 @@ function de({
|
|
|
57
57
|
{
|
|
58
58
|
"data-slot": "sidebar-wrapper",
|
|
59
59
|
style: {
|
|
60
|
-
"--sidebar-width":
|
|
61
|
-
"--sidebar-width-icon":
|
|
62
|
-
...
|
|
60
|
+
"--sidebar-width": W,
|
|
61
|
+
"--sidebar-width-icon": F,
|
|
62
|
+
...d
|
|
63
63
|
},
|
|
64
64
|
className: r(
|
|
65
65
|
"group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",
|
|
@@ -75,7 +75,7 @@ function se({
|
|
|
75
75
|
variant: e = "sidebar",
|
|
76
76
|
collapsible: i = "offcanvas",
|
|
77
77
|
className: n,
|
|
78
|
-
children:
|
|
78
|
+
children: d,
|
|
79
79
|
...u
|
|
80
80
|
}) {
|
|
81
81
|
const { isMobile: m, state: s, openMobile: f, setOpenMobile: c } = S();
|
|
@@ -88,7 +88,7 @@ function se({
|
|
|
88
88
|
n
|
|
89
89
|
),
|
|
90
90
|
...u,
|
|
91
|
-
children:
|
|
91
|
+
children: d
|
|
92
92
|
}
|
|
93
93
|
) : m ? /* @__PURE__ */ t(B, { open: f, onOpenChange: c, ...u, children: /* @__PURE__ */ p(
|
|
94
94
|
A,
|
|
@@ -98,7 +98,7 @@ function se({
|
|
|
98
98
|
"data-mobile": "true",
|
|
99
99
|
className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",
|
|
100
100
|
style: {
|
|
101
|
-
"--sidebar-width":
|
|
101
|
+
"--sidebar-width": q
|
|
102
102
|
},
|
|
103
103
|
side: a,
|
|
104
104
|
children: [
|
|
@@ -106,7 +106,7 @@ function se({
|
|
|
106
106
|
/* @__PURE__ */ t(R, { children: "Sidebar" }),
|
|
107
107
|
/* @__PURE__ */ t(H, { children: "Displays the mobile sidebar." })
|
|
108
108
|
] }),
|
|
109
|
-
/* @__PURE__ */ t("div", { className: "flex h-full w-full flex-col", children:
|
|
109
|
+
/* @__PURE__ */ t("div", { className: "flex h-full w-full flex-col", children: d })
|
|
110
110
|
]
|
|
111
111
|
}
|
|
112
112
|
) }) : /* @__PURE__ */ p(
|
|
@@ -146,7 +146,7 @@ function se({
|
|
|
146
146
|
{
|
|
147
147
|
"data-sidebar": "sidebar",
|
|
148
148
|
className: "bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",
|
|
149
|
-
children:
|
|
149
|
+
children: d
|
|
150
150
|
}
|
|
151
151
|
)
|
|
152
152
|
}
|
|
@@ -169,8 +169,8 @@ function le({
|
|
|
169
169
|
variant: "ghost",
|
|
170
170
|
size: "icon",
|
|
171
171
|
className: r("h-7 w-7", a),
|
|
172
|
-
onClick: (
|
|
173
|
-
e == null || e(
|
|
172
|
+
onClick: (d) => {
|
|
173
|
+
e == null || e(d), n();
|
|
174
174
|
},
|
|
175
175
|
...i,
|
|
176
176
|
children: [
|
|
@@ -369,7 +369,7 @@ function Ne({ className: a, ...e }) {
|
|
|
369
369
|
}
|
|
370
370
|
);
|
|
371
371
|
}
|
|
372
|
-
const
|
|
372
|
+
const X = k(
|
|
373
373
|
"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
|
|
374
374
|
{
|
|
375
375
|
variants: {
|
|
@@ -394,7 +394,7 @@ function ye({
|
|
|
394
394
|
isActive: e = !1,
|
|
395
395
|
variant: i = "default",
|
|
396
396
|
size: n = "default",
|
|
397
|
-
tooltip:
|
|
397
|
+
tooltip: d,
|
|
398
398
|
className: u,
|
|
399
399
|
...m
|
|
400
400
|
}) {
|
|
@@ -405,12 +405,12 @@ function ye({
|
|
|
405
405
|
"data-sidebar": "menu-button",
|
|
406
406
|
"data-size": n,
|
|
407
407
|
"data-active": e,
|
|
408
|
-
className: r(
|
|
408
|
+
className: r(X({ variant: i, size: n }), u),
|
|
409
409
|
...m
|
|
410
410
|
}
|
|
411
411
|
);
|
|
412
|
-
return
|
|
413
|
-
children:
|
|
412
|
+
return d ? (typeof d == "string" && (d = {
|
|
413
|
+
children: d
|
|
414
414
|
}), /* @__PURE__ */ p(K, { children: [
|
|
415
415
|
/* @__PURE__ */ t(j, { asChild: !0, children: v }),
|
|
416
416
|
/* @__PURE__ */ t(
|
|
@@ -419,7 +419,7 @@ function ye({
|
|
|
419
419
|
side: "right",
|
|
420
420
|
align: "center",
|
|
421
421
|
hidden: c !== "collapsed" || f,
|
|
422
|
-
...
|
|
422
|
+
...d
|
|
423
423
|
}
|
|
424
424
|
)
|
|
425
425
|
] })) : v;
|
|
@@ -541,7 +541,7 @@ function Ie({
|
|
|
541
541
|
size: e = "md",
|
|
542
542
|
isActive: i = !1,
|
|
543
543
|
className: n,
|
|
544
|
-
...
|
|
544
|
+
...d
|
|
545
545
|
}) {
|
|
546
546
|
return /* @__PURE__ */ t(
|
|
547
547
|
a ? h : "a",
|
|
@@ -558,7 +558,7 @@ function Ie({
|
|
|
558
558
|
"group-data-[collapsible=icon]:hidden",
|
|
559
559
|
n
|
|
560
560
|
),
|
|
561
|
-
...
|
|
561
|
+
...d
|
|
562
562
|
}
|
|
563
563
|
);
|
|
564
564
|
}
|
|
@@ -582,7 +582,7 @@ export {
|
|
|
582
582
|
ke as SidebarMenuSub,
|
|
583
583
|
Ie as SidebarMenuSubButton,
|
|
584
584
|
ze as SidebarMenuSubItem,
|
|
585
|
-
|
|
585
|
+
oe as SidebarProvider,
|
|
586
586
|
ue as SidebarRail,
|
|
587
587
|
me as SidebarSeparator,
|
|
588
588
|
le as SidebarTrigger,
|