@cryptlex/web-components 6.6.111 → 6.6.113

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.
@@ -1,2 +1,2 @@
1
- import{jsxs as i,jsx as s}from"react/jsx-runtime";import{cva as o}from"class-variance-authority";import{classNames as l}from"../utilities/theme.js";import{IcInfo as u,IcWarning as m,IcCheck as d,IcError as f}from"./icons.js";import"clsx";import"@icons-pack/react-simple-icons";import"react";const p=o("rounded-md transition-colors bg-elevation-1 border p-icon body-sm inline-flex items-start gap-2",{variants:{variant:{destructive:"text-destructive border-destructive",success:"text-success border-success",warning:"text-warning",neutral:"text-muted border-muted",default:""}},defaultVariants:{variant:"default"}}),v=e=>{switch(e){case"destructive":return f;case"success":return d;case"warning":return m;default:return u}};function N({children:e,className:n,variant:t,icon:a,...c}){const r=a??v(t);return i("div",{role:"alert",className:l(p({variant:t}),n),...c,children:[r&&s(r,{className:"inline-block size-icon shrink-0"}),s("span",{className:"inline-block flex-1 min-w-0 mt-0",children:e})]})}export{N as Alert,p as alertVariants};
1
+ import{jsxs as i,jsx as s}from"react/jsx-runtime";import{cva as o}from"class-variance-authority";import{classNames as l}from"../utilities/theme.js";import{IcInfo as u,IcWarning as m,IcCheck as d,IcError as f}from"./icons.js";import"clsx";import"@icons-pack/react-simple-icons";import"react";const p=o("rounded-md transition-colors bg-elevation-1 border p-icon body-sm inline-flex items-start gap-2 w-full sm:w-auto",{variants:{variant:{destructive:"text-destructive border-destructive",success:"text-success border-success",warning:"text-warning",neutral:"text-muted border-muted",default:""}},defaultVariants:{variant:"default"}}),v=e=>{switch(e){case"destructive":return f;case"success":return d;case"warning":return m;default:return u}};function N({children:e,className:n,variant:t,icon:a,...c}){const r=a??v(t);return i("div",{role:"alert",className:l(p({variant:t}),n),...c,children:[r&&s(r,{className:"inline-block size-icon shrink-0"}),s("span",{className:"inline-block flex-1 min-w-0 mt-0",children:e})]})}export{N as Alert,p as alertVariants};
2
2
  //# sourceMappingURL=alert.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"alert.js","sources":["../../lib/components/alert.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport React from 'react';\nimport { classNames } from '../utilities/theme';\nimport type { CtxIcon } from './icons';\nimport { IcCheck, IcError, IcInfo, IcWarning } from './icons';\n\nexport const alertVariants = cva(\n `rounded-md transition-colors bg-elevation-1 border p-icon body-sm inline-flex items-start gap-2`,\n {\n variants: {\n variant: {\n destructive: 'text-destructive border-destructive',\n success: 'text-success border-success',\n warning: 'text-warning',\n neutral: 'text-muted border-muted',\n default: '',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n }\n);\n\n// Default icons for each variant\nconst getDefaultIcon = (variant: string | null | undefined): CtxIcon | null => {\n switch (variant) {\n case 'destructive':\n return IcError;\n case 'success':\n return IcCheck;\n case 'warning':\n return IcWarning;\n case 'neutral':\n case undefined:\n default:\n return IcInfo;\n }\n};\nexport function Alert({\n children,\n className,\n variant,\n icon,\n ...props\n}: React.ComponentProps<'div'> &\n VariantProps<typeof alertVariants> & {\n icon?: CtxIcon;\n }) {\n // Overrides the default icon with the provided icon\n const Icon = icon ?? getDefaultIcon(variant);\n\n return (\n <div role=\"alert\" className={classNames(alertVariants({ variant }), className)} {...props}>\n {Icon && <Icon className=\"inline-block size-icon shrink-0\" />}\n <span className=\"inline-block flex-1 min-w-0 mt-0\">{children}</span>\n </div>\n );\n}\n"],"names":["alertVariants","cva","getDefaultIcon","variant","IcError","IcCheck","IcWarning","IcInfo","Alert","children","className","icon","props","Icon","jsxs","classNames","jsx"],"mappings":"mSAMO,MAAMA,EAAgBC,EACzB,kGACA,CACI,SAAU,CACN,QAAS,CACL,YAAa,sCACb,QAAS,8BACT,QAAS,eACT,QAAS,0BACT,QAAS,EAAA,CACb,EAEJ,gBAAiB,CACb,QAAS,SAAA,CACb,CAER,EAGMC,EAAkBC,GAAuD,CAC3E,OAAQA,EAAA,CACJ,IAAK,cACD,OAAOC,EACX,IAAK,UACD,OAAOC,EACX,IAAK,UACD,OAAOC,EAGX,QACI,OAAOC,CAAA,CAEnB,EACO,SAASC,EAAM,CAClB,SAAAC,EACA,UAAAC,EACA,QAAAP,EACA,KAAAQ,EACA,GAAGC,CACP,EAGO,CAEH,MAAMC,EAAOF,GAAQT,EAAeC,CAAO,EAE3C,OACIW,EAAC,MAAA,CAAI,KAAK,QAAQ,UAAWC,EAAWf,EAAc,CAAE,QAAAG,CAAA,CAAS,EAAGO,CAAS,EAAI,GAAGE,EAC/E,SAAA,CAAAC,GAAQG,EAACH,EAAA,CAAK,UAAU,iCAAA,CAAkC,EAC3DG,EAAC,OAAA,CAAK,UAAU,mCAAoC,SAAAP,CAAA,CAAS,CAAA,EACjE,CAER"}
1
+ {"version":3,"file":"alert.js","sources":["../../lib/components/alert.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport React from 'react';\nimport { classNames } from '../utilities/theme';\nimport type { CtxIcon } from './icons';\nimport { IcCheck, IcError, IcInfo, IcWarning } from './icons';\n\nexport const alertVariants = cva(\n `rounded-md transition-colors bg-elevation-1 border p-icon body-sm inline-flex items-start gap-2 w-full sm:w-auto`,\n {\n variants: {\n variant: {\n destructive: 'text-destructive border-destructive',\n success: 'text-success border-success',\n warning: 'text-warning',\n neutral: 'text-muted border-muted',\n default: '',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n }\n);\n\n// Default icons for each variant\nconst getDefaultIcon = (variant: string | null | undefined): CtxIcon | null => {\n switch (variant) {\n case 'destructive':\n return IcError;\n case 'success':\n return IcCheck;\n case 'warning':\n return IcWarning;\n case 'neutral':\n case undefined:\n default:\n return IcInfo;\n }\n};\nexport function Alert({\n children,\n className,\n variant,\n icon,\n ...props\n}: React.ComponentProps<'div'> &\n VariantProps<typeof alertVariants> & {\n icon?: CtxIcon;\n }) {\n // Overrides the default icon with the provided icon\n const Icon = icon ?? getDefaultIcon(variant);\n\n return (\n <div role=\"alert\" className={classNames(alertVariants({ variant }), className)} {...props}>\n {Icon && <Icon className=\"inline-block size-icon shrink-0\" />}\n <span className=\"inline-block flex-1 min-w-0 mt-0\">{children}</span>\n </div>\n );\n}\n"],"names":["alertVariants","cva","getDefaultIcon","variant","IcError","IcCheck","IcWarning","IcInfo","Alert","children","className","icon","props","Icon","jsxs","classNames","jsx"],"mappings":"mSAMO,MAAMA,EAAgBC,EACzB,mHACA,CACI,SAAU,CACN,QAAS,CACL,YAAa,sCACb,QAAS,8BACT,QAAS,eACT,QAAS,0BACT,QAAS,EAAA,CACb,EAEJ,gBAAiB,CACb,QAAS,SAAA,CACb,CAER,EAGMC,EAAkBC,GAAuD,CAC3E,OAAQA,EAAA,CACJ,IAAK,cACD,OAAOC,EACX,IAAK,UACD,OAAOC,EACX,IAAK,UACD,OAAOC,EAGX,QACI,OAAOC,CAAA,CAEnB,EACO,SAASC,EAAM,CAClB,SAAAC,EACA,UAAAC,EACA,QAAAP,EACA,KAAAQ,EACA,GAAGC,CACP,EAGO,CAEH,MAAMC,EAAOF,GAAQT,EAAeC,CAAO,EAE3C,OACIW,EAAC,MAAA,CAAI,KAAK,QAAQ,UAAWC,EAAWf,EAAc,CAAE,QAAAG,CAAA,CAAS,EAAGO,CAAS,EAAI,GAAGE,EAC/E,SAAA,CAAAC,GAAQG,EAACH,EAAA,CAAK,UAAU,iCAAA,CAAkC,EAC3DG,EAAC,OAAA,CAAK,UAAU,mCAAoC,SAAAP,CAAA,CAAS,CAAA,EACjE,CAER"}
@@ -1,2 +1,2 @@
1
- "use client";import{jsxs as g,jsx as i,Fragment as x}from"react/jsx-runtime";import{cva as p}from"class-variance-authority";import{createContext as h,useState as c,useContext as b}from"react";import{DialogTrigger as D,Modal as v,Dialog as C,composeRenderProps as m,ModalOverlay as w,Heading as N}from"react-aria-components";import{Button as y}from"./button.js";import{classNames as n}from"../utilities/theme.js";import{useIsMobile as z}from"../utilities/use-mobile.js";import{IcClose as O}from"./icons.js";import"./loader.js";import"clsx";import"@icons-pack/react-simple-icons";const P=p(["fixed z-50 gap-icon bg-elevation-1 transition ease-in-out","data-[entering]:duration-200 data-[entering]:animate-in data-[entering]:fade-in-0 data-[exiting]:duration-200 data-[exiting]:animate-out data-[exiting]:fade-out-0"],{variants:{side:{top:"inset-x-0 top-0 border-b data-[entering]:slide-in-from-top data-[exiting]:slide-out-to-top max-h-table",bottom:"inset-x-0 bottom-0 border-t data-[entering]:slide-in-from-bottom data-[exiting]:slide-out-to-bottom max-h-table",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[entering]:slide-in-from-left data-[exiting]:slide-out-to-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[entering]:slide-in-from-right data-[exiting]:slide-out-to-right sm:max-w-sm"}}}),M=D,T=({className:t,isDismissable:e=!0,...o})=>i(w,{isDismissable:e,className:m(t,a=>n("fixed inset-0 z-50 bg-background/50","data-[exiting]:duration-100 data-[exiting]:animate-out","data-[entering]:animate-in",a)),...o});function j({className:t,children:e,side:o,role:a,closeButton:l=!0,...s}){return i(v,{className:m(t,r=>n(o?P({side:o}):["fixed left-[50vw] top-1/2 z-50 w-full max-w-lg -translate-x-1/2 -translate-y-1/2 border rounded-md bg-elevation-1 duration-100 data-[exiting]:duration-100 data-[entering]:animate-in data-[exiting]:animate-out data-[entering]:fade-in-0 data-[exiting]:fade-out-0 data-[entering]:zoom-in-95 data-[exiting]:zoom-out-95 md:w-full"],r)),...s,children:i(C,{role:a,className:n(!o&&"grid h-full gap-icon relative","h-full outline-none"),children:m(e,(r,d)=>g(x,{children:[r,l&&i("div",{className:"absolute right-2 top-1",children:g(y,{size:"icon",variant:"ghost",onPress:d.close,className:"!rounded-full",children:[i(O,{}),i("span",{className:"sr-only",children:"Close"})]})})]}))})})}function A({className:t,...e}){return i("div",{className:n("flex flex-col p-icon border-b gap-y-2 text-left",t),...e})}function G({className:t,...e}){return i("div",{className:n("flex flex-col-reverse sm:flex-row sm:justify-end gap-2 p-icon border-t",t),...e})}function J({className:t,...e}){return i("div",{className:n("flex flex-col gap-2 p-icon",t),...e})}function K({className:t,...e}){return i(N,{slot:"title",className:n("heading-3 font-semibold leading-none tracking-tight",t),...e})}function L({className:t,...e}){return i("p",{className:n("flex flex-col gap-y-1 text-center sm:text-left",t),...e})}const u=h(null);function Q({children:t}){const[e,o]=c(!1),[a,l]=c(null),s=f=>{l(f),o(!0)},r=()=>{o(!1)},d=z();return g(u.Provider,{value:{openDialog:s,closeDialog:r,isOpen:e},children:[t,i(M,{isOpen:e,onOpenChange:o,children:i(T,{isDismissable:!0,children:i(j,{side:d?"bottom":void 0,children:a})})})]})}function U(){const t=b(u);if(!t)throw new Error("useControlledDialog must be used within ControlledDialogProvider");return t}export{Q as ControlledDialogProvider,J as DialogBody,j as DialogContent,L as DialogDescription,G as DialogFooter,A as DialogHeader,T as DialogOverlay,K as DialogTitle,M as DialogTrigger,U as useControlledDialog};
1
+ "use client";import{jsxs as g,jsx as i,Fragment as x}from"react/jsx-runtime";import{cva as p}from"class-variance-authority";import{createContext as h,useState as u,useContext as b}from"react";import{DialogTrigger as v,Modal as D,Dialog as w,composeRenderProps as m,ModalOverlay as C,Heading as N}from"react-aria-components";import{Button as y}from"./button.js";import{classNames as n}from"../utilities/theme.js";import{useIsMobile as z}from"../utilities/use-mobile.js";import{IcClose as O}from"./icons.js";import"./loader.js";import"clsx";import"@icons-pack/react-simple-icons";const P=p(["fixed z-50 gap-icon bg-elevation-mid transition ease-in-out","data-[entering]:duration-200 data-[entering]:animate-in data-[entering]:fade-in-0 data-[exiting]:duration-200 data-[exiting]:animate-out data-[exiting]:fade-out-0"],{variants:{side:{top:"inset-x-0 top-0 border-b data-[entering]:slide-in-from-top data-[exiting]:slide-out-to-top max-h-table",bottom:"inset-x-0 bottom-0 border-t rounded-t-xl data-[entering]:slide-in-from-bottom data-[exiting]:slide-out-to-bottom max-h-[80dvh]",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[entering]:slide-in-from-left data-[exiting]:slide-out-to-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[entering]:slide-in-from-right data-[exiting]:slide-out-to-right sm:max-w-sm"}}}),M=v,T=({className:t,isDismissable:e=!0,...o})=>i(C,{isDismissable:e,className:m(t,a=>n("fixed inset-0 z-50 bg-background/50","data-[exiting]:duration-100 data-[exiting]:animate-out","data-[entering]:animate-in",a)),...o});function j({className:t,children:e,side:o,role:a,closeButton:l=!0,...s}){return i(D,{className:m(t,r=>n(o?P({side:o}):["fixed left-[50vw] top-1/2 z-50 w-full max-w-lg -translate-x-1/2 -translate-y-1/2 border rounded-md bg-elevation-mid duration-100 data-[exiting]:duration-100 data-[entering]:animate-in data-[exiting]:animate-out data-[entering]:fade-in-0 data-[exiting]:fade-out-0 data-[entering]:zoom-in-95 data-[exiting]:zoom-out-95 md:w-full"],r)),...s,children:i(w,{role:a,className:n(!o&&"grid h-full gap-icon relative","h-full outline-none"),children:m(e,(r,d)=>g(x,{children:[r,l&&i("div",{className:"absolute right-2 top-1",children:g(y,{size:"icon",variant:"ghost",onPress:d.close,className:"!rounded-full",children:[i(O,{}),i("span",{className:"sr-only",children:"Close"})]})})]}))})})}function A({className:t,...e}){return i("div",{className:n("flex flex-col p-icon border-b gap-y-2 text-left bg-elevation-mid",t),...e})}function G({className:t,...e}){return i("div",{className:n("flex flex-row justify-end gap-2 p-icon border-t *:flex-1 sm:*:flex-none",t),...e})}function J({className:t,...e}){return i("div",{className:n("flex flex-col gap-2 p-icon max-h-[60dvh] overflow-auto",t),...e})}function K({className:t,...e}){return i(N,{slot:"title",className:n("heading-3 font-semibold leading-none tracking-tight",t),...e})}function L({className:t,...e}){return i("p",{className:n("flex flex-col gap-y-1 text-center sm:text-left",t),...e})}const c=h(null);function Q({children:t}){const[e,o]=u(!1),[a,l]=u(null),s=f=>{l(f),o(!0)},r=()=>{o(!1)},d=z();return g(c.Provider,{value:{openDialog:s,closeDialog:r,isOpen:e},children:[t,i(M,{isOpen:e,onOpenChange:o,children:i(T,{isDismissable:!0,children:i(j,{side:d?"bottom":void 0,children:a})})})]})}function U(){const t=b(c);if(!t)throw new Error("useControlledDialog must be used within ControlledDialogProvider");return t}export{Q as ControlledDialogProvider,J as DialogBody,j as DialogContent,L as DialogDescription,G as DialogFooter,A as DialogHeader,T as DialogOverlay,K as DialogTitle,M as DialogTrigger,U as useControlledDialog};
2
2
  //# sourceMappingURL=dialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.js","sources":["../../lib/components/dialog.tsx"],"sourcesContent":["'use client';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport type { ReactNode } from 'react';\nimport { createContext, useContext, useState } from 'react';\nimport {\n Dialog as AriaDialog,\n DialogProps as AriaDialogProps,\n DialogTrigger as AriaDialogTrigger,\n Heading as AriaHeading,\n HeadingProps as AriaHeadingProps,\n Modal as AriaModal,\n ModalOverlay as AriaModalOverlay,\n ModalOverlayProps as AriaModalOverlayProps,\n composeRenderProps,\n} from 'react-aria-components';\n\nimport { Button } from '../components/button';\nimport { classNames } from '../utilities/theme';\nimport { useIsMobile } from '../utilities/use-mobile';\nimport { IcClose } from './icons';\n\n/**\n * Visual variants for the sheet-style dialog (slide in from an edge).\n *\n * @remarks\n * Internally used to style `<DialogContent side=\"...\">`.\n */\nconst sheetVariants = cva(\n [\n 'fixed z-50 gap-icon bg-elevation-1 transition ease-in-out',\n 'data-[entering]:duration-200 data-[entering]:animate-in data-[entering]:fade-in-0 data-[exiting]:duration-200 data-[exiting]:animate-out data-[exiting]:fade-out-0',\n ],\n {\n variants: {\n side: {\n top: 'inset-x-0 top-0 border-b data-[entering]:slide-in-from-top data-[exiting]:slide-out-to-top max-h-table',\n bottom: 'inset-x-0 bottom-0 border-t data-[entering]:slide-in-from-bottom data-[exiting]:slide-out-to-bottom max-h-table',\n left: 'inset-y-0 left-0 h-full w-3/4 border-r data-[entering]:slide-in-from-left data-[exiting]:slide-out-to-left sm:max-w-sm',\n right: 'inset-y-0 right-0 h-full w-3/4 border-l data-[entering]:slide-in-from-right data-[exiting]:slide-out-to-right sm:max-w-sm',\n },\n },\n }\n);\n\n/**\n * Opens the dialog when interacted with (click/press).\n *\n * @remarks\n * Compose this around any control that should open the dialog.\n *\n * @example\n * ```tsx\n * <DialogTrigger>\n * <Button>Open</Button>\n * <DialogOverlay>\n * <DialogContent>...</DialogContent>\n * </DialogOverlay>\n * </DialogTrigger>\n * ```\n */\nexport const DialogTrigger = AriaDialogTrigger;\n\nexport const DialogOverlay = ({ className, isDismissable = true, ...props }: AriaModalOverlayProps) => {\n return (\n <AriaModalOverlay\n isDismissable={isDismissable}\n className={composeRenderProps(className, className =>\n classNames(\n 'fixed inset-0 z-50 bg-background/50',\n /* Exiting */\n 'data-[exiting]:duration-100 data-[exiting]:animate-out',\n /* Entering */\n 'data-[entering]:animate-in',\n className\n )\n )}\n {...props}\n />\n );\n};\n\n/** Props for {@link DialogContent}. */\nexport interface DialogContentProps\n extends Omit<React.ComponentProps<typeof AriaModal>, 'children'>,\n VariantProps<typeof sheetVariants> {\n /**\n * Render function or nodes for the dialog panel contents.\n */\n children?: AriaDialogProps['children'];\n\n /**\n * ARIA role of the dialog.\n *\n * Use `\"alertdialog\"` for destructive/confirmation flows that require\n * explicit acknowledgement.\n * @defaultValue \"dialog\"\n */\n role?: AriaDialogProps['role'];\n\n /**\n * Show a built-in close button in the top-right corner.\n * @defaultValue true\n */\n closeButton?: boolean;\n}\n\n/**\n * Dialog panel container. Renders either a centered modal or a sheet\n * from an edge when `side` is provided.\n *\n * @example Basic\n * ```tsx\n * <DialogTrigger>\n * <Button>Open</Button>\n * <DialogOverlay>\n * <DialogContent>\n * <DialogHeader>\n * <DialogTitle>Sign up</DialogTitle>\n * </DialogHeader>\n * ...\n * </DialogContent>\n * </DialogOverlay>\n * </DialogTrigger>\n * ```\n */\nexport function DialogContent({ className, children, side, role, closeButton = true, ...props }: DialogContentProps) {\n return (\n <AriaModal\n className={composeRenderProps(className, className =>\n classNames(\n side\n ? sheetVariants({ side })\n : [\n 'fixed left-[50vw] top-1/2 z-50 w-full max-w-lg -translate-x-1/2 -translate-y-1/2 border rounded-md bg-elevation-1 duration-100 data-[exiting]:duration-100 data-[entering]:animate-in data-[exiting]:animate-out data-[entering]:fade-in-0 data-[exiting]:fade-out-0 data-[entering]:zoom-in-95 data-[exiting]:zoom-out-95 md:w-full',\n ],\n className\n )\n )}\n {...props}\n >\n <AriaDialog\n role={role}\n className={classNames(!side && 'grid h-full gap-icon relative', 'h-full outline-none')}\n >\n {composeRenderProps(children, (children, renderProps) => (\n <>\n {children}\n {closeButton && (\n <div className=\"absolute right-2 top-1\">\n <Button\n size={'icon'}\n variant={'ghost'}\n onPress={renderProps.close}\n className=\"!rounded-full\"\n >\n <IcClose />\n <span className=\"sr-only\">Close</span>\n </Button>\n </div>\n )}\n </>\n ))}\n </AriaDialog>\n </AriaModal>\n );\n}\n\n/**\n * Header region for the dialog panel.\n *\n * @example\n * ```tsx\n * <DialogHeader>\n * <DialogTitle>Settings</DialogTitle>\n * </DialogHeader>\n * ```\n */\nexport function DialogHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n return <div className={classNames('flex flex-col p-icon border-b gap-y-2 text-left', className)} {...props} />;\n}\n\n/**\n * Footer region that aligns action buttons.\n *\n * @example\n * ```tsx\n * <DialogFooter>\n * <Button variant=\"outline\">Cancel</Button>\n * <Button>Save</Button>\n * </DialogFooter>\n * ```\n */\nexport function DialogFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n className={classNames('flex flex-col-reverse sm:flex-row sm:justify-end gap-2 p-icon border-t', className)}\n {...props}\n />\n );\n}\n\n/**\n * Body section of the dialog\n */\nexport function DialogBody({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n return <div className={classNames('flex flex-col gap-2 p-icon', className)} {...props} />;\n}\n\n/**\n * Heading element mapped to the dialog title (announced by screen readers).\n *\n * @remarks\n * Sets `slot=\"title\"` so RAC wires it to the dialog.\n */\nexport function DialogTitle({ className, ...props }: AriaHeadingProps) {\n return (\n <AriaHeading\n slot=\"title\"\n className={classNames('heading-3 font-semibold leading-none tracking-tight', className)}\n {...props}\n />\n );\n}\n\n/**\n * Short explanatory text under the title.\n *\n * @example\n * ```tsx\n * <DialogDescription>\n * This action cannot be undone.\n * </DialogDescription>\n * ```\n */\nexport function DialogDescription({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>) {\n return <p className={classNames('flex flex-col gap-y-1 text-center sm:text-left', className)} {...props} />;\n}\n\n/**\n * Context type for controlled dialog state and actions.\n */\ntype ControlledDialogContextType = {\n /** Opens the dialog with the provided content */\n openDialog: (content: ReactNode) => void;\n /** Closes the dialog */\n closeDialog: () => void;\n /** Whether the dialog is currently open */\n isOpen: boolean;\n};\n\nconst ControlledDialogContext = createContext<ControlledDialogContextType | null>(null);\n\n/**\n * Provider that manages a scoped dialog controlled via hooks.\n *\n * @example\n * ```tsx\n * <ControlledDialogProvider>\n * <MyComponent />\n * </ControlledDialogProvider>\n *\n * // Inside MyComponent:\n * function MyComponent() {\n * const { openDialog } = useControlledDialog();\n * return (\n * <Button onPress={() => openDialog(<div>Dialog content</div>)}>\n * Open Dialog\n * </Button>\n * );\n * }\n * ```\n */\nexport function ControlledDialogProvider({ children }: { children: ReactNode }) {\n const [isOpen, setIsOpen] = useState(false);\n const [content, setContent] = useState<ReactNode>(null);\n\n const openDialog = (dialogContent: ReactNode) => {\n setContent(dialogContent);\n setIsOpen(true);\n };\n\n const closeDialog = () => {\n setIsOpen(false);\n };\n const isMobile = useIsMobile();\n return (\n <ControlledDialogContext.Provider value={{ openDialog, closeDialog, isOpen }}>\n {children}\n <DialogTrigger isOpen={isOpen} onOpenChange={setIsOpen}>\n <DialogOverlay isDismissable>\n <DialogContent side={isMobile ? 'bottom' : undefined}>{content}</DialogContent>\n </DialogOverlay>\n </DialogTrigger>\n </ControlledDialogContext.Provider>\n );\n}\n\n/**\n * Hook to access the controlled dialog from within a ControlledDialogProvider.\n *\n * @throws Error if used outside of ControlledDialogProvider\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const { openDialog, closeDialog, isOpen } = useControlledDialog();\n *\n * return (\n * <Button onPress={() => openDialog(\n * <DialogHeader>\n * <DialogTitle>Confirm</DialogTitle>\n * </DialogHeader>\n * )}>\n * Open\n * </Button>\n * );\n * }\n * ```\n */\nexport function useControlledDialog() {\n const context = useContext(ControlledDialogContext);\n if (!context) {\n throw new Error('useControlledDialog must be used within ControlledDialogProvider');\n }\n return context;\n}\n"],"names":["sheetVariants","cva","DialogTrigger","AriaDialogTrigger","DialogOverlay","className","isDismissable","props","jsx","AriaModalOverlay","composeRenderProps","classNames","DialogContent","children","side","role","closeButton","AriaModal","AriaDialog","renderProps","jsxs","Fragment","Button","IcClose","DialogHeader","DialogFooter","DialogBody","DialogTitle","AriaHeading","DialogDescription","ControlledDialogContext","createContext","ControlledDialogProvider","isOpen","setIsOpen","useState","content","setContent","openDialog","dialogContent","closeDialog","isMobile","useIsMobile","useControlledDialog","context","useContext"],"mappings":"kkBA2BA,MAAMA,EAAgBC,EAClB,CACI,4DACA,qKAAA,EAEJ,CACI,SAAU,CACN,KAAM,CACF,IAAK,yGACL,OAAQ,kHACR,KAAM,yHACN,MAAO,4HAAA,CACX,CACJ,CAER,EAkBaC,EAAgBC,EAEhBC,EAAgB,CAAC,CAAE,UAAAC,EAAW,cAAAC,EAAgB,GAAM,GAAGC,KAE5DC,EAACC,EAAA,CACG,cAAAH,EACA,UAAWI,EAAmBL,EAAWA,GACrCM,EACI,sCAEA,yDAEA,6BACAN,CAAA,CACJ,EAEH,GAAGE,CAAA,CAAA,EAiDT,SAASK,EAAc,CAAE,UAAAP,EAAW,SAAAQ,EAAU,KAAAC,EAAM,KAAAC,EAAM,YAAAC,EAAc,GAAM,GAAGT,GAA6B,CACjH,OACIC,EAACS,EAAA,CACG,UAAWP,EAAmBL,EAAWA,GACrCM,EACIG,EACMd,EAAc,CAAE,KAAAc,CAAA,CAAM,EACtB,CACI,sUAAA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,SAASC,EAAyB,CAAE,SAAAnB,GAAqC,CAC5E,KAAM,CAACoB,EAAQC,CAAS,EAAIC,EAAS,EAAK,EACpC,CAACC,EAASC,CAAU,EAAIF,EAAoB,IAAI,EAEhDG,EAAcC,GAA6B,CAC7CF,EAAWE,CAAa,EACxBL,EAAU,EAAI,CAClB,EAEMM,EAAc,IAAM,CACtBN,EAAU,EAAK,CACnB,EACMO,EAAWC,EAAA,EACjB,OACItB,EAACU,EAAwB,SAAxB,CAAiC,MAAO,CAAE,WAAAQ,EAAY,YAAAE,EAAa,OAAAP,CAAA,EAC/D,SAAA,CAAApB,IACAX,EAAA,CAAc,OAAA+B,EAAgB,aAAcC,EACzC,WAAC9B,EAAA,CAAc,cAAa,GACxB,SAAAI,EAACI,GAAc,KAAM6B,EAAW,SAAW,OAAY,SAAAL,EAAQ,EACnE,CAAA,CACJ,CAAA,EACJ,CAER,CAwBO,SAASO,GAAsB,CAClC,MAAMC,EAAUC,EAAWf,CAAuB,EAClD,GAAI,CAACc,EACD,MAAM,IAAI,MAAM,kEAAkE,EAEtF,OAAOA,CACX"}
1
+ {"version":3,"file":"dialog.js","sources":["../../lib/components/dialog.tsx"],"sourcesContent":["'use client';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport type { ReactNode } from 'react';\nimport { createContext, useContext, useState } from 'react';\nimport {\n Dialog as AriaDialog,\n DialogProps as AriaDialogProps,\n DialogTrigger as AriaDialogTrigger,\n Heading as AriaHeading,\n HeadingProps as AriaHeadingProps,\n Modal as AriaModal,\n ModalOverlay as AriaModalOverlay,\n ModalOverlayProps as AriaModalOverlayProps,\n composeRenderProps,\n} from 'react-aria-components';\n\nimport { Button } from '../components/button';\nimport { classNames } from '../utilities/theme';\nimport { useIsMobile } from '../utilities/use-mobile';\nimport { IcClose } from './icons';\n\n/**\n * Visual variants for the sheet-style dialog (slide in from an edge).\n *\n * @remarks\n * Internally used to style `<DialogContent side=\"...\">`.\n */\nconst sheetVariants = cva(\n [\n 'fixed z-50 gap-icon bg-elevation-mid transition ease-in-out',\n 'data-[entering]:duration-200 data-[entering]:animate-in data-[entering]:fade-in-0 data-[exiting]:duration-200 data-[exiting]:animate-out data-[exiting]:fade-out-0',\n ],\n {\n variants: {\n side: {\n top: 'inset-x-0 top-0 border-b data-[entering]:slide-in-from-top data-[exiting]:slide-out-to-top max-h-table',\n bottom: 'inset-x-0 bottom-0 border-t rounded-t-xl data-[entering]:slide-in-from-bottom data-[exiting]:slide-out-to-bottom max-h-[80dvh]',\n left: 'inset-y-0 left-0 h-full w-3/4 border-r data-[entering]:slide-in-from-left data-[exiting]:slide-out-to-left sm:max-w-sm',\n right: 'inset-y-0 right-0 h-full w-3/4 border-l data-[entering]:slide-in-from-right data-[exiting]:slide-out-to-right sm:max-w-sm',\n },\n },\n }\n);\n\n/**\n * Opens the dialog when interacted with (click/press).\n *\n * @remarks\n * Compose this around any control that should open the dialog.\n *\n * @example\n * ```tsx\n * <DialogTrigger>\n * <Button>Open</Button>\n * <DialogOverlay>\n * <DialogContent>...</DialogContent>\n * </DialogOverlay>\n * </DialogTrigger>\n * ```\n */\nexport const DialogTrigger = AriaDialogTrigger;\n\nexport const DialogOverlay = ({ className, isDismissable = true, ...props }: AriaModalOverlayProps) => {\n return (\n <AriaModalOverlay\n isDismissable={isDismissable}\n className={composeRenderProps(className, className =>\n classNames(\n 'fixed inset-0 z-50 bg-background/50',\n /* Exiting */\n 'data-[exiting]:duration-100 data-[exiting]:animate-out',\n /* Entering */\n 'data-[entering]:animate-in',\n className\n )\n )}\n {...props}\n />\n );\n};\n\n/** Props for {@link DialogContent}. */\nexport interface DialogContentProps\n extends Omit<React.ComponentProps<typeof AriaModal>, 'children'>,\n VariantProps<typeof sheetVariants> {\n /**\n * Render function or nodes for the dialog panel contents.\n */\n children?: AriaDialogProps['children'];\n\n /**\n * ARIA role of the dialog.\n *\n * Use `\"alertdialog\"` for destructive/confirmation flows that require\n * explicit acknowledgement.\n * @defaultValue \"dialog\"\n */\n role?: AriaDialogProps['role'];\n\n /**\n * Show a built-in close button in the top-right corner.\n * @defaultValue true\n */\n closeButton?: boolean;\n}\n\n/**\n * Dialog panel container. Renders either a centered modal or a sheet\n * from an edge when `side` is provided.\n *\n * @example Basic\n * ```tsx\n * <DialogTrigger>\n * <Button>Open</Button>\n * <DialogOverlay>\n * <DialogContent>\n * <DialogHeader>\n * <DialogTitle>Sign up</DialogTitle>\n * </DialogHeader>\n * ...\n * </DialogContent>\n * </DialogOverlay>\n * </DialogTrigger>\n * ```\n */\nexport function DialogContent({ className, children, side, role, closeButton = true, ...props }: DialogContentProps) {\n return (\n <AriaModal\n className={composeRenderProps(className, className =>\n classNames(\n side\n ? sheetVariants({ side })\n : [\n 'fixed left-[50vw] top-1/2 z-50 w-full max-w-lg -translate-x-1/2 -translate-y-1/2 border rounded-md bg-elevation-mid duration-100 data-[exiting]:duration-100 data-[entering]:animate-in data-[exiting]:animate-out data-[entering]:fade-in-0 data-[exiting]:fade-out-0 data-[entering]:zoom-in-95 data-[exiting]:zoom-out-95 md:w-full',\n ],\n className\n )\n )}\n {...props}\n >\n <AriaDialog\n role={role}\n className={classNames(!side && 'grid h-full gap-icon relative', 'h-full outline-none')}\n >\n {composeRenderProps(children, (children, renderProps) => (\n <>\n {children}\n {closeButton && (\n <div className=\"absolute right-2 top-1\">\n <Button\n size={'icon'}\n variant={'ghost'}\n onPress={renderProps.close}\n className=\"!rounded-full\"\n >\n <IcClose />\n <span className=\"sr-only\">Close</span>\n </Button>\n </div>\n )}\n </>\n ))}\n </AriaDialog>\n </AriaModal>\n );\n}\n\n/**\n * Header region for the dialog panel.\n *\n * @example\n * ```tsx\n * <DialogHeader>\n * <DialogTitle>Settings</DialogTitle>\n * </DialogHeader>\n * ```\n */\nexport function DialogHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n className={classNames('flex flex-col p-icon border-b gap-y-2 text-left bg-elevation-mid', className)}\n {...props}\n />\n );\n}\n\n/**\n * Footer region that aligns action buttons.\n *\n * @example\n * ```tsx\n * <DialogFooter>\n * <Button variant=\"outline\">Cancel</Button>\n * <Button>Save</Button>\n * </DialogFooter>\n * ```\n */\nexport function DialogFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n className={classNames('flex flex-row justify-end gap-2 p-icon border-t *:flex-1 sm:*:flex-none', className)}\n {...props}\n />\n );\n}\n\n/**\n * Body section of the dialog\n */\nexport function DialogBody({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n return (\n <div className={classNames('flex flex-col gap-2 p-icon max-h-[60dvh] overflow-auto', className)} {...props} />\n );\n}\n\n/**\n * Heading element mapped to the dialog title (announced by screen readers).\n *\n * @remarks\n * Sets `slot=\"title\"` so RAC wires it to the dialog.\n */\nexport function DialogTitle({ className, ...props }: AriaHeadingProps) {\n return (\n <AriaHeading\n slot=\"title\"\n className={classNames('heading-3 font-semibold leading-none tracking-tight', className)}\n {...props}\n />\n );\n}\n\n/**\n * Short explanatory text under the title.\n *\n * @example\n * ```tsx\n * <DialogDescription>\n * This action cannot be undone.\n * </DialogDescription>\n * ```\n */\nexport function DialogDescription({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>) {\n return <p className={classNames('flex flex-col gap-y-1 text-center sm:text-left', className)} {...props} />;\n}\n\n/**\n * Context type for controlled dialog state and actions.\n */\ntype ControlledDialogContextType = {\n /** Opens the dialog with the provided content */\n openDialog: (content: ReactNode) => void;\n /** Closes the dialog */\n closeDialog: () => void;\n /** Whether the dialog is currently open */\n isOpen: boolean;\n};\n\nconst ControlledDialogContext = createContext<ControlledDialogContextType | null>(null);\n\n/**\n * Provider that manages a scoped dialog controlled via hooks.\n *\n * @example\n * ```tsx\n * <ControlledDialogProvider>\n * <MyComponent />\n * </ControlledDialogProvider>\n *\n * // Inside MyComponent:\n * function MyComponent() {\n * const { openDialog } = useControlledDialog();\n * return (\n * <Button onPress={() => openDialog(<div>Dialog content</div>)}>\n * Open Dialog\n * </Button>\n * );\n * }\n * ```\n */\nexport function ControlledDialogProvider({ children }: { children: ReactNode }) {\n const [isOpen, setIsOpen] = useState(false);\n const [content, setContent] = useState<ReactNode>(null);\n\n const openDialog = (dialogContent: ReactNode) => {\n setContent(dialogContent);\n setIsOpen(true);\n };\n\n const closeDialog = () => {\n setIsOpen(false);\n };\n const isMobile = useIsMobile();\n return (\n <ControlledDialogContext.Provider value={{ openDialog, closeDialog, isOpen }}>\n {children}\n <DialogTrigger isOpen={isOpen} onOpenChange={setIsOpen}>\n <DialogOverlay isDismissable>\n <DialogContent side={isMobile ? 'bottom' : undefined}>{content}</DialogContent>\n </DialogOverlay>\n </DialogTrigger>\n </ControlledDialogContext.Provider>\n );\n}\n\n/**\n * Hook to access the controlled dialog from within a ControlledDialogProvider.\n *\n * @throws Error if used outside of ControlledDialogProvider\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const { openDialog, closeDialog, isOpen } = useControlledDialog();\n *\n * return (\n * <Button onPress={() => openDialog(\n * <DialogHeader>\n * <DialogTitle>Confirm</DialogTitle>\n * </DialogHeader>\n * )}>\n * Open\n * </Button>\n * );\n * }\n * ```\n */\nexport function useControlledDialog() {\n const context = useContext(ControlledDialogContext);\n if (!context) {\n throw new Error('useControlledDialog must be used within ControlledDialogProvider');\n }\n return context;\n}\n"],"names":["sheetVariants","cva","DialogTrigger","AriaDialogTrigger","DialogOverlay","className","isDismissable","props","jsx","AriaModalOverlay","composeRenderProps","classNames","DialogContent","children","side","role","closeButton","AriaModal","AriaDialog","renderProps","jsxs","Fragment","Button","IcClose","DialogHeader","DialogFooter","DialogBody","DialogTitle","AriaHeading","DialogDescription","ControlledDialogContext","createContext","ControlledDialogProvider","isOpen","setIsOpen","useState","content","setContent","openDialog","dialogContent","closeDialog","isMobile","useIsMobile","useControlledDialog","context","useContext"],"mappings":"kkBA2BA,MAAMA,EAAgBC,EAClB,CACI,8DACA,qKAAA,EAEJ,CACI,SAAU,CACN,KAAM,CACF,IAAK,yGACL,OAAQ,iIACR,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sx-runtime";import{createContext as _,useState as w,useCallback as S,useEffect as j,useMemo as D,use as z}from"react";import{Button as N}from"./button.js";import{DialogTrigger as B,DialogOverlay as I,DialogContent as T}from"./dialog.js";import{TooltipTrigger as E,Tooltip as G}from"./tooltip.js";import{classNames as i}from"../utilities/theme.js";import{useIsMobile as H}from"../utilities/use-mobile.js";import{IcMoreHorizontal as K,IcLeft as L,IcRight as R}from"./icons.js";import"class-variance-authority";import"react-aria-components";import"./loader.js";import"clsx";import"@icons-pack/react-simple-icons";const A="/",y=_(null);function v(){const e=z(y);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function ae({defaultOpen:e=!0,open:t,onOpenChange:n,className:o,style:r,children:s,...c}){const d=H(),[u,p]=w(!1),[C,k]=w(e),f=t??C,m=S(l=>{const b=typeof l=="function"?l(f):l;n?n(b):k(b)},[n,f]),g=S(()=>d?p(l=>!l):m(l=>!l),[d,m,p]);j(()=>{const l=b=>{b.key===A&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),g())};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[g]);const x=f?"expanded":"collapsed",O=D(()=>({state:x,open:f,setOpen:m,isMobile:d,openMobile:u,setOpenMobile:p,toggleSidebar:g}),[x,f,m,d,u,p,g]);return a(y.Provider,{value:O,children:a("div",{className:i("group/sidebar-wrapper flex w-full has-[[data-variant=inset]]:bg-elevation-1",o),...c,children:s})})}function ie({side:e="left",variant:t="sidebar",collapsible:n="icon",className:o,children:r,...s}){const{isMobile:c,state:d,openMobile:u,setOpenMobile:p}=v();return n==="none"?a("div",{className:i("flex h-full w-(--sidebar-width) flex-col bg-elevation-1 text-foreground",o),...s,children:r}):c?a(B,{isOpen:u,onOpenChange:p,...s,children:a(I,{children:a(T,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) max-h-svh overflow-auto p-0 [&>button]:hidden",side:"left",children:()=>a("div",{className:"flex h-full w-full flex-col",children:r})})})}):h("div",{className:"group peer hidden text-foreground md:block","data-state":d,"data-collapsible":d==="collapsed"?n:"","data-variant":t,"data-side":e,children:[a("div",{className:i("relative w-(--sidebar-width) bg-elevation-1 transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),a("div",{className:i("absolute z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="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)]",t==="floating"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",o),...s,children:a("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-elevation-1 group-data-[variant=floating]:border group-data-[variant=floating]:border-border",children:r})})]})}function F({className:e,onClick:t,...n}){const{toggleSidebar:o,open:r,isMobile:s}=v();return a(N,{"data-sidebar":"trigger",variant:"neutral",size:"icon-sm",className:i(e,"!rounded-full"),onClick:c=>{t?.(c),o()},...n,children:s?a(K,{}):r?a(L,{}):a(R,{})})}function ne({className:e,...t}){return a("div",{"data-sidebar":"content",className:i("flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto overflow-x-hidden",e),...t})}function oe({className:e,...t}){return a("div",{"data-sidebar":"group",className:i("group/section relative flex w-full min-w-0 flex-col px-3 group-data-[collapsible=icon]:items-center",e),...t})}function re({className:e,...t}){return a("div",{"data-sidebar":"group-label",className:i("flex h-input shrink-0 items-center overflow-hidden px-2 text-xs select-none font-medium uppercase text-muted-foreground outline-none ring-ring transition-[height,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-icon [&>svg]:shrink-0","group-data-[collapsible=icon]:pointer-events-none group-data-[collapsible=icon]:!h-0 group-data-[collapsible=icon]:min-h-0 group-data-[collapsible=icon]:opacity-0",e),...t})}function le({className:e,...t}){return a("div",{"data-sidebar":"group-content",className:i("w-full body-sm",e),...t})}function se({className:e,...t}){return a("ul",{"data-sidebar":"menu",className:i("flex w-full min-w-0 flex-col gap-px",e),...t})}function de({className:e,...t}){return a("li",{"data-sidebar":"menu-item",className:i("group/menu-item relative list-none group-data-[collapsible=icon]:[&>*:not([data-sidebar=menu-button])]:hidden",e),...t})}function ue({className:e,...t}){return a("button",{"data-sidebar":"menu-action",className:i("absolute top-0 right-0 btn btn-ghost h-input","group-data-[collapsible=icon]:hidden",e),...t})}function ce({className:e,number:t,...n}){return a("div",{"data-sidebar":"menu-badge",className:i("absolute pointer-events-none top-0 right-0 font-light h-input select-none flex items-center justify-center body-sm tabular-nums","group-data-[collapsible=icon]:hidden",e),...n,children:new Intl.NumberFormat(navigator.language,{useGrouping:!0}).format(t)})}function be({className:e,...t}){return a("ul",{"data-sidebar":"menu-sub",className:i("ms-2 flex min-w-0 flex-col","group-data-[collapsible=icon]:hidden",e),...t})}function pe({className:e,...t}){return a("li",{className:i("list-none ms-0",e),...t})}const M="btn-tab relative rounded-md border-0 justify-start w-full group-data-[collapsible=icon]:justify-center";function fe({isActive:e=!1,className:t,children:n,icon:o,leading:r,...s}){const{isMobile:c,state:d}=v(),u=!c&&d==="collapsed";return h(E,{isDisabled:!u,children:[h(N,{size:u?"icon":void 0,"data-sidebar":"menu-button",...e&&{"data-selected":!0},className:i("peer/menu-button group/active group-has-[[data-sidebar=menu-action]]/menu-item:pr-input",M,t),...s,children:[a("span",{"aria-hidden":!0,className:"absolute inset-y-2 -left-1 w-[7px] rounded-full bg-primary opacity-0 group-data-[selected=true]/active:opacity-100"}),r!==void 0?r:o?a(o,{}):null,!u&&n]}),a(G,{placement:"right",children:a("span",{className:"flex items-center gap-2",children:n})})]})}function me({isActive:e,className:t,...n}){return a("button",{"data-sidebar":"menu-sub-button","data-active":e,className:i(M,t),...n})}function ge({className:e,logo:t,children:n,showTrigger:o=!0,...r}){return h("div",{"data-sidebar":"header",className:i("flex items-center h-header select-none shrink-0 border-b px-2 gap-2 group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:px-0",e),...r,children:[t&&a("div",{className:"flex items-center justify-center size-input shrink-0",children:t}),n&&a("div",{className:"flex-1 min-w-0 group-data-[collapsible=icon]:hidden",children:n}),o&&a(F,{className:"hidden bg-elevation-1 lg:flex lg:absolute lg:-right-4 lg:z-50"})]})}function he({className:e,...t}){return a("div",{"data-sidebar":"footer",className:i("mt-auto flex shrink-0 select-none items-center gap-2 border-t py-2 group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:px-0",e),...t})}function ve({className:e,...t}){return a("div",{className:i(e,"flex flex-col flex-1 overflow-auto"),...t})}function xe({className:e,...t}){return a("div",{className:i(e,"flex-1 overflow-auto"),...t})}function we({className:e,...t}){return a("nav",{className:i("flex items-center h-header bg-elevation-1 p-2 border-b",e),...t})}export{ie as Sidebar,ne as SidebarContent,y as SidebarContext,he as SidebarFooter,oe as SidebarGroup,le as SidebarGroupContent,re as SidebarGroupLabel,ge as SidebarHeader,se as SidebarMenu,ue as SidebarMenuAction,ce as SidebarMenuBadge,fe as SidebarMenuButton,de as SidebarMenuItem,be as SidebarMenuSub,me as SidebarMenuSubButton,pe as SidebarMenuSubItem,ve as SidebarOutlet,xe as SidebarOutletContent,we as SidebarOutletHeader,ae as SidebarProvider,F as SidebarTrigger,M as sidebarMenuButtonClasses,v as useSidebar};
1
+ "use client";import{jsx as a,jsxs as h}from"react/jsx-runtime";import{createContext as _,useState as w,useCallback as S,useEffect as j,useMemo as D,use as B}from"react";import{Button as N}from"./button.js";import{DialogTrigger as I,DialogOverlay as T,DialogContent as z}from"./dialog.js";import{TooltipTrigger as E,Tooltip as G}from"./tooltip.js";import{classNames as i}from"../utilities/theme.js";import{useIsMobile as K}from"../utilities/use-mobile.js";import{IcMenu as L,IcLeft as R,IcRight as A}from"./icons.js";import"class-variance-authority";import"react-aria-components";import"./loader.js";import"clsx";import"@icons-pack/react-simple-icons";const H="/",y=_(null);function v(){const e=B(y);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function ae({defaultOpen:e=!0,open:t,onOpenChange:n,className:o,style:r,children:s,...c}){const d=K(),[u,p]=w(!1),[C,k]=w(e),f=t??C,m=S(l=>{const b=typeof l=="function"?l(f):l;n?n(b):k(b)},[n,f]),g=S(()=>d?p(l=>!l):m(l=>!l),[d,m,p]);j(()=>{const l=b=>{b.key===H&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),g())};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[g]);const x=f?"expanded":"collapsed",O=D(()=>({state:x,open:f,setOpen:m,isMobile:d,openMobile:u,setOpenMobile:p,toggleSidebar:g}),[x,f,m,d,u,p,g]);return a(y.Provider,{value:O,children:a("div",{className:i("group/sidebar-wrapper flex w-full has-[[data-variant=inset]]:bg-elevation-1",o),...c,children:s})})}function ie({side:e="left",variant:t="sidebar",collapsible:n="icon",className:o,children:r,...s}){const{isMobile:c,state:d,openMobile:u,setOpenMobile:p}=v();return n==="none"?a("div",{className:i("flex h-full w-(--sidebar-width) flex-col bg-elevation-1 text-foreground",o),...s,children:r}):c?a(I,{isOpen:u,onOpenChange:p,...s,children:a(T,{children:a(z,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) max-h-svh overflow-auto p-0 [&>button]:hidden",side:"left",children:()=>a("div",{className:"flex h-full w-full flex-col",children:r})})})}):h("div",{className:"group peer hidden text-foreground md:block","data-state":d,"data-collapsible":d==="collapsed"?n:"","data-variant":t,"data-side":e,children:[a("div",{className:i("relative w-(--sidebar-width) bg-elevation-1 transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),a("div",{className:i("absolute z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="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)]",t==="floating"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",o),...s,children:a("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-elevation-1 group-data-[variant=floating]:border group-data-[variant=floating]:border-border",children:r})})]})}function F({className:e,onClick:t,...n}){const{toggleSidebar:o,open:r,isMobile:s}=v();return a(N,{"data-sidebar":"trigger",variant:"neutral",size:"icon-sm",className:i(e,"!rounded-full p-icon"),onClick:c=>{t?.(c),o()},"aria-label":"trigger",...n,children:s?a(L,{}):r?a(R,{}):a(A,{})})}function ne({className:e,...t}){return a("div",{"data-sidebar":"content",className:i("flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto overflow-x-hidden",e),...t})}function oe({className:e,...t}){return a("div",{"data-sidebar":"group",className:i("group/section relative flex w-full min-w-0 flex-col px-3 group-data-[collapsible=icon]:items-center",e),...t})}function re({className:e,...t}){return a("div",{"data-sidebar":"group-label",className:i("flex h-input shrink-0 items-center overflow-hidden px-2 text-xs select-none font-medium uppercase text-muted-foreground outline-none ring-ring transition-[height,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-icon [&>svg]:shrink-0","group-data-[collapsible=icon]:pointer-events-none group-data-[collapsible=icon]:!h-0 group-data-[collapsible=icon]:min-h-0 group-data-[collapsible=icon]:opacity-0",e),...t})}function le({className:e,...t}){return a("div",{"data-sidebar":"group-content",className:i("w-full body-sm",e),...t})}function se({className:e,...t}){return a("ul",{"data-sidebar":"menu",className:i("flex w-full min-w-0 flex-col gap-px",e),...t})}function de({className:e,...t}){return a("li",{"data-sidebar":"menu-item",className:i("group/menu-item relative list-none group-data-[collapsible=icon]:[&>*:not([data-sidebar=menu-button])]:hidden",e),...t})}function ue({className:e,...t}){return a("button",{"data-sidebar":"menu-action",className:i("absolute top-0 right-0 btn btn-ghost h-input","group-data-[collapsible=icon]:hidden",e),...t})}function ce({className:e,number:t,...n}){return a("div",{"data-sidebar":"menu-badge",className:i("absolute pointer-events-none top-0 right-0 font-light h-input select-none flex items-center justify-center body-sm tabular-nums","group-data-[collapsible=icon]:hidden",e),...n,children:new Intl.NumberFormat(navigator.language,{useGrouping:!0}).format(t)})}function be({className:e,...t}){return a("ul",{"data-sidebar":"menu-sub",className:i("ms-2 flex min-w-0 flex-col","group-data-[collapsible=icon]:hidden",e),...t})}function pe({className:e,...t}){return a("li",{className:i("list-none ms-0",e),...t})}const M="btn-tab relative rounded-md border-0 justify-start w-full group-data-[collapsible=icon]:justify-center";function fe({isActive:e=!1,className:t,children:n,icon:o,leading:r,...s}){const{isMobile:c,state:d}=v(),u=!c&&d==="collapsed";return h(E,{isDisabled:!u,children:[h(N,{size:u?"icon":void 0,"data-sidebar":"menu-button",...e&&{"data-selected":!0},className:i("peer/menu-button group/active group-has-[[data-sidebar=menu-action]]/menu-item:pr-input",M,t),...s,children:[a("span",{"aria-hidden":!0,className:"absolute inset-y-2 -left-1 w-[7px] rounded-full bg-primary opacity-0 group-data-[selected=true]/active:opacity-100"}),r!==void 0?r:o?a(o,{}):null,!u&&n]}),a(G,{placement:"right",children:a("span",{className:"flex items-center gap-2",children:n})})]})}function me({isActive:e,className:t,...n}){return a("button",{"data-sidebar":"menu-sub-button","data-active":e,className:i(M,t),...n})}function ge({className:e,logo:t,children:n,showTrigger:o=!0,...r}){return h("div",{"data-sidebar":"header",className:i("flex items-center h-header select-none shrink-0 border-b px-2 gap-2 group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:px-0",e),...r,children:[t&&a("div",{className:"flex items-center justify-center size-input shrink-0",children:t}),n&&a("div",{className:"flex-1 min-w-0 group-data-[collapsible=icon]:hidden",children:n}),o&&a(F,{className:"hidden bg-elevation-1 lg:flex lg:absolute lg:-right-4 lg:z-50"})]})}function he({className:e,...t}){return a("div",{"data-sidebar":"footer",className:i("mt-auto flex shrink-0 select-none items-center gap-2 border-t py-2 group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:px-0",e),...t})}function ve({className:e,...t}){return a("div",{className:i(e,"flex flex-col flex-1 overflow-auto"),...t})}function xe({className:e,...t}){return a("div",{className:i(e,"flex-1 overflow-auto"),...t})}function we({className:e,...t}){return a("nav",{className:i("flex items-center h-header bg-elevation-1 p-2 border-b",e),...t})}export{ie as Sidebar,ne as SidebarContent,y as SidebarContext,he as SidebarFooter,oe as SidebarGroup,le as SidebarGroupContent,re as SidebarGroupLabel,ge as SidebarHeader,se as SidebarMenu,ue as SidebarMenuAction,ce as SidebarMenuBadge,fe as SidebarMenuButton,de as SidebarMenuItem,be as SidebarMenuSub,me as SidebarMenuSubButton,pe as SidebarMenuSubItem,ve as SidebarOutlet,xe as SidebarOutletContent,we as SidebarOutletHeader,ae as SidebarProvider,F as SidebarTrigger,M as sidebarMenuButtonClasses,v as useSidebar};
2
2
  //# sourceMappingURL=sidebar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar.js","sources":["../../lib/components/sidebar.tsx"],"sourcesContent":["'use client';\nimport { createContext, use, useCallback, useEffect, useMemo, useState } from 'react';\nimport { Button } from '../components/button';\nimport { DialogContent, DialogOverlay, DialogTrigger } from '../components/dialog';\nimport { Tooltip, TooltipTrigger } from '../components/tooltip';\nimport { classNames } from '../utilities/theme';\nimport { useIsMobile } from '../utilities/use-mobile';\nimport { IcLeft, IcMoreHorizontal, IcRight, type CtxIcon } from './icons';\n\nconst SIDEBAR_KEYBOARD_SHORTCUT = '/';\n\ntype SidebarContextProps = {\n state: 'expanded' | 'collapsed';\n open: boolean;\n setOpen: (open: boolean) => void;\n openMobile: boolean;\n setOpenMobile: (open: boolean) => void;\n isMobile: boolean;\n toggleSidebar: () => void;\n};\n\nexport const SidebarContext = createContext<SidebarContextProps | null>(null);\n\n/**\n * Get the current sidebar state and controls. Must be inside SidebarProvider.\n * @throws When used outside of SidebarProvider\n */\nexport function useSidebar() {\n const context = use(SidebarContext);\n if (!context) {\n throw new Error('useSidebar must be used within a SidebarProvider.');\n }\n\n return context;\n}\n\n/**\n * Wraps your app layout and manages sidebar state. Handles keyboard shortcuts (Cmd/Ctrl + /)\n * and mobile vs desktop behavior.\n *\n * @example\n * <SidebarProvider>\n * <Sidebar>...</Sidebar>\n * <SidebarOutlet>\n * <main>Your app content</main>\n * </SidebarOutlet>\n * </SidebarProvider>\n */\nexport function SidebarProvider({\n defaultOpen = true,\n open: openProp,\n onOpenChange: setOpenProp,\n className,\n style,\n children,\n ...props\n}: React.ComponentProps<'div'> & {\n /** Initial open state. Defaults to true */\n defaultOpen?: boolean;\n /** Control the open state yourself */\n open?: boolean;\n /** Callback when sidebar opens/closes */\n onOpenChange?: (open: boolean) => void;\n}) {\n const isMobile = useIsMobile();\n const [openMobile, setOpenMobile] = useState(false);\n\n // This is the internal state of the sidebar.\n // We use openProp and setOpenProp for control from outside the component.\n const [_open, _setOpen] = useState(defaultOpen);\n const open = openProp ?? _open;\n const setOpen = useCallback(\n (value: boolean | ((value: boolean) => boolean)) => {\n const openState = typeof value === 'function' ? value(open) : value;\n if (setOpenProp) {\n setOpenProp(openState);\n } else {\n _setOpen(openState);\n }\n },\n [setOpenProp, open]\n );\n\n // Helper to toggle the sidebar.\n const toggleSidebar = useCallback(() => {\n return isMobile ? setOpenMobile(open => !open) : setOpen(open => !open);\n }, [isMobile, setOpen, setOpenMobile]);\n\n // Adds a keyboard shortcut to toggle the sidebar.\n useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {\n event.preventDefault();\n toggleSidebar();\n }\n };\n\n window.addEventListener('keydown', handleKeyDown);\n return () => window.removeEventListener('keydown', handleKeyDown);\n }, [toggleSidebar]);\n\n // We add a state so that we can do data-state=\"expanded\" or \"collapsed\".\n // This makes it easier to style the sidebar with Tailwind classes.\n const state = open ? 'expanded' : 'collapsed';\n\n const contextValue = useMemo<SidebarContextProps>(\n () => ({\n state,\n open,\n setOpen,\n isMobile,\n openMobile,\n setOpenMobile,\n toggleSidebar,\n }),\n [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]\n );\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <div\n className={classNames(\n 'group/sidebar-wrapper flex w-full has-[[data-variant=inset]]:bg-elevation-1',\n className\n )}\n {...props}\n >\n {children}\n </div>\n </SidebarContext.Provider>\n );\n}\n\n/**\n * The actual sidebar panel. On mobile it becomes a modal dialog.\n */\nexport function Sidebar({\n side = 'left',\n variant = 'sidebar',\n collapsible = 'icon',\n className,\n children,\n ...props\n}: React.ComponentProps<'div'> & {\n /** Where to dock the sidebar. Default: left */\n side?: 'left' | 'right';\n /** Style variant. Default: sidebar */\n variant?: 'sidebar' | 'floating';\n /** How it collapses. Default: offcanvas */\n collapsible?: 'offcanvas' | 'icon' | 'none';\n}) {\n const { isMobile, state, openMobile, setOpenMobile } = useSidebar();\n\n if (collapsible === 'none') {\n return (\n <div\n className={classNames(\n 'flex h-full w-(--sidebar-width) flex-col bg-elevation-1 text-foreground',\n className\n )}\n {...props}\n >\n {children}\n </div>\n );\n }\n\n if (isMobile) {\n return (\n <DialogTrigger isOpen={openMobile} onOpenChange={setOpenMobile} {...props}>\n <DialogOverlay>\n <DialogContent\n data-sidebar=\"sidebar\"\n data-mobile=\"true\"\n className=\"w-(--sidebar-width) max-h-svh overflow-auto p-0 [&>button]:hidden\"\n side=\"left\"\n >\n {() => <div className=\"flex h-full w-full flex-col\">{children}</div>}\n </DialogContent>\n </DialogOverlay>\n </DialogTrigger>\n );\n }\n\n return (\n <div\n className=\"group peer hidden text-foreground md:block\"\n data-state={state}\n data-collapsible={state === 'collapsed' ? collapsible : ''}\n data-variant={variant}\n data-side={side}\n >\n {/* This is what handles the sidebar gap on desktop */}\n <div\n className={classNames(\n 'relative w-(--sidebar-width) bg-elevation-1 transition-[width] duration-200 ease-linear',\n 'group-data-[collapsible=offcanvas]:w-0',\n 'group-data-[side=right]:rotate-180',\n variant === 'floating'\n ? 'group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]'\n : 'group-data-[collapsible=icon]:w-(--sidebar-width-icon)'\n )}\n />\n <div\n className={classNames(\n 'absolute z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex',\n side === 'left'\n ? 'left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]'\n : 'right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]',\n // Adjust the padding for floating variant.\n variant === 'floating'\n ? 'group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]'\n : 'group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l',\n className\n )}\n {...props}\n >\n <div\n data-sidebar=\"sidebar\"\n className=\"flex h-full w-full flex-col bg-elevation-1 group-data-[variant=floating]:border group-data-[variant=floating]:border-border\"\n >\n {children}\n </div>\n </div>\n </div>\n );\n}\n\n/**\n * Button that toggles the sidebar. Shows arrow icons.\n */\nexport function SidebarTrigger({ className, onClick, ...props }: React.ComponentProps<typeof Button>) {\n const { toggleSidebar, open, isMobile } = useSidebar();\n\n return (\n <Button\n data-sidebar=\"trigger\"\n variant=\"neutral\"\n size=\"icon-sm\"\n className={classNames(className, '!rounded-full')}\n onClick={event => {\n onClick?.(event);\n toggleSidebar();\n }}\n {...props}\n >\n {/* Use transition to rotate a single icon */}\n {isMobile ? <IcMoreHorizontal /> : open ? <IcLeft /> : <IcRight />}\n </Button>\n );\n}\n\n/**\n * Scrollable container for sidebar content\n */\nexport function SidebarContent({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-sidebar=\"content\"\n className={classNames('flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto overflow-x-hidden', className)}\n {...props}\n />\n );\n}\n\n/**\n * Groups related menu items together\n */\nexport function SidebarGroup({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-sidebar=\"group\"\n className={classNames(\n 'group/section relative flex w-full min-w-0 flex-col px-3 group-data-[collapsible=icon]:items-center',\n className\n )}\n {...props}\n />\n );\n}\n\n/**\n * Label for a group.\n */\nexport function SidebarGroupLabel({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-sidebar=\"group-label\"\n className={classNames(\n 'flex h-input shrink-0 items-center overflow-hidden px-2 text-xs select-none font-medium uppercase text-muted-foreground outline-none ring-ring transition-[height,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-icon [&>svg]:shrink-0',\n 'group-data-[collapsible=icon]:pointer-events-none group-data-[collapsible=icon]:!h-0 group-data-[collapsible=icon]:min-h-0 group-data-[collapsible=icon]:opacity-0',\n className\n )}\n {...props}\n />\n );\n}\n\n/**\n * Content wrapper for a group\n */\nexport function SidebarGroupContent({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-sidebar=\"group-content\" className={classNames('w-full body-sm', className)} {...props} />;\n}\n\n/**\n * Container for menu items\n */\nexport function SidebarMenu({ className, ...props }: React.ComponentProps<'ul'>) {\n return (\n <ul data-sidebar=\"menu\" className={classNames('flex w-full min-w-0 flex-col gap-px', className)} {...props} />\n );\n}\n\n/**\n * Single menu item wrapper\n */\nexport function SidebarMenuItem({ className, ...props }: React.ComponentProps<'li'>) {\n return (\n <li\n data-sidebar=\"menu-item\"\n className={classNames(\n 'group/menu-item relative list-none group-data-[collapsible=icon]:[&>*:not([data-sidebar=menu-button])]:hidden',\n className\n )}\n {...props}\n />\n );\n}\n\n/**\n * Extra action button that appears on the right side of menu items\n */\nexport function SidebarMenuAction({\n className,\n ...props\n}: React.ComponentProps<'button'> & {\n /** Only show on hover */\n showOnHover?: boolean;\n}) {\n return (\n <button\n data-sidebar=\"menu-action\"\n className={classNames(\n 'absolute top-0 right-0 btn btn-ghost h-input',\n 'group-data-[collapsible=icon]:hidden',\n className\n )}\n {...props}\n />\n );\n}\n\n/**\n * Shows a number badge on menu items. Auto-formats large numbers.\n */\nexport function SidebarMenuBadge({\n className,\n number,\n ...props\n}: Omit<React.ComponentProps<'div'>, 'children'> & {\n /** The count to display */\n number: number | bigint;\n}) {\n return (\n <div\n data-sidebar=\"menu-badge\"\n className={classNames(\n 'absolute pointer-events-none top-0 right-0 font-light h-input select-none flex items-center justify-center body-sm tabular-nums',\n 'group-data-[collapsible=icon]:hidden',\n className\n )}\n {...props}\n >\n {/* Format the number */}\n {new Intl.NumberFormat(navigator.language, { useGrouping: true }).format(number)}\n </div>\n );\n}\n\n/**\n * Nested submenu container\n */\nexport function SidebarMenuSub({ className, ...props }: React.ComponentProps<'ul'>) {\n return (\n <ul\n data-sidebar=\"menu-sub\"\n className={classNames('ms-2 flex min-w-0 flex-col', 'group-data-[collapsible=icon]:hidden', className)}\n {...props}\n />\n );\n}\n\n/**\n * Submenu item wrapper\n */\nexport function SidebarMenuSubItem({ className, ...props }: React.ComponentProps<'li'>) {\n return <li className={classNames('list-none ms-0', className)} {...props} />;\n}\n\nexport const sidebarMenuButtonClasses =\n 'btn-tab relative rounded-md border-0 justify-start w-full group-data-[collapsible=icon]:justify-center';\n\n// Common interaction logic for SidebarMenuButton and SidebarMenuSubButton\n/**\n * Main menu button. Pass isActive for current page.\n */\nexport function SidebarMenuButton({\n isActive = false,\n className,\n children,\n icon: Icon,\n leading,\n ...props\n}: Omit<React.ComponentProps<typeof Button>, 'children'> & {\n /** Mark as currently active page */\n icon?: CtxIcon;\n leading?: React.ReactNode;\n isActive?: boolean;\n children?: React.ReactNode;\n}) {\n const { isMobile, state } = useSidebar();\n const isCollapsed = !isMobile && state === 'collapsed';\n\n return (\n <TooltipTrigger isDisabled={!isCollapsed}>\n <Button\n size={isCollapsed ? 'icon' : undefined}\n data-sidebar=\"menu-button\"\n {...(isActive && { 'data-selected': true })}\n className={classNames(\n 'peer/menu-button group/active group-has-[[data-sidebar=menu-action]]/menu-item:pr-input',\n sidebarMenuButtonClasses,\n className\n )}\n {...props}\n >\n <span\n aria-hidden\n className=\"absolute inset-y-2 -left-1 w-[7px] rounded-full bg-primary opacity-0 group-data-[selected=true]/active:opacity-100\"\n />\n {leading !== undefined ? leading : Icon ? <Icon /> : null}\n {!isCollapsed && children}\n </Button>\n <Tooltip placement=\"right\">\n <span className=\"flex items-center gap-2\">{children}</span>\n </Tooltip>\n </TooltipTrigger>\n );\n}\n\n/**\n * Button for submenu items\n */\nexport function SidebarMenuSubButton({\n isActive,\n className,\n ...props\n}: React.ComponentProps<'button'> & {\n isActive?: boolean;\n}) {\n return (\n <button\n data-sidebar=\"menu-sub-button\"\n data-active={isActive}\n className={classNames(sidebarMenuButtonClasses, className)}\n {...props}\n />\n );\n}\n\n/**\n * Sticky header at the top of the sidebar. Displays a square logo slot aligned with the outlet header.\n */\nexport function SidebarHeader({\n className,\n logo,\n children,\n showTrigger = true,\n ...props\n}: React.ComponentProps<'div'> & {\n /** Square logo/icon to display */\n logo?: React.ReactNode;\n showTrigger?: boolean;\n}) {\n return (\n <div\n data-sidebar=\"header\"\n className={classNames(\n 'flex items-center h-header select-none shrink-0 border-b px-2 gap-2 group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:px-0',\n className\n )}\n {...props}\n >\n {logo && <div className=\"flex items-center justify-center size-input shrink-0\">{logo}</div>}\n {children && <div className=\"flex-1 min-w-0 group-data-[collapsible=icon]:hidden\">{children}</div>}\n {showTrigger && (\n <SidebarTrigger className={'hidden bg-elevation-1 lg:flex lg:absolute lg:-right-4 lg:z-50'} />\n )}\n </div>\n );\n}\n\nexport function SidebarFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-sidebar=\"footer\"\n className={classNames(\n 'mt-auto flex shrink-0 select-none items-center gap-2 border-t py-2 group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:px-0',\n className\n )}\n {...props}\n />\n );\n}\n\n/**\n *\n * @example Basic usage\n * ```tsx\n * <SidebarOutlet>\n * <SidebarOutletHeader><SidebarTrigger/></SidebarOutletHeader>\n * <SidebarOutletContent><Outlet/></SidebarOutletContent>\n * </SidebarOutlet>\n * ```\n */\nexport function SidebarOutlet({ className, ...props }: React.ComponentProps<'div'>) {\n return <div className={classNames(className, 'flex flex-col flex-1 overflow-auto')} {...props} />;\n}\n\nexport function SidebarOutletContent({ className, ...props }: React.ComponentProps<'div'>) {\n return <div className={classNames(className, 'flex-1 overflow-auto')} {...props} />;\n}\n\nexport function SidebarOutletHeader({ className, ...props }: React.ComponentProps<'nav'>) {\n return (\n <nav className={classNames('flex items-center h-header bg-elevation-1 p-2 border-b', className)} {...props} />\n );\n}\n"],"names":["SIDEBAR_KEYBOARD_SHORTCUT","SidebarContext","createContext","useSidebar","context","use","SidebarProvider","defaultOpen","openProp","setOpenProp","className","style","children","props","isMobile","useIsMobile","openMobile","setOpenMobile","useState","_open","_setOpen","open","setOpen","useCallback","value","openState","toggleSidebar","useEffect","handleKeyDown","event","state","contextValue","useMemo","jsx","classNames","Sidebar","side","variant","collapsible","DialogTrigger","DialogOverlay","DialogContent","jsxs","SidebarTrigger","onClick","Button","IcMoreHorizontal","IcLeft","IcRight","SidebarContent","SidebarGroup","SidebarGroupLabel","SidebarGroupContent","SidebarMenu","SidebarMenuItem","SidebarMenuAction","SidebarMenuBadge","number","SidebarMenuSub","SidebarMenuSubItem","sidebarMenuButtonClasses","SidebarMenuButton","isActive","Icon","leading","isCollapsed","TooltipTrigger","Tooltip","SidebarMenuSubButton","SidebarHeader","logo","showTrigger","SidebarFooter","SidebarOutlet","SidebarOutletContent","SidebarOutletHeader"],"mappings":"qpBASA,MAAMA,EAA4B,I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UAAWC,EAAWxB,EAAW,sBAAsB,EAAI,GAAGG,EAAO,CACrF,CAEO,SAAS8D,GAAoB,CAAE,UAAAjE,EAAW,GAAGG,GAAsC,CACtF,OACIoB,EAAC,OAAI,UAAWC,EAAW,yDAA0DxB,CAAS,EAAI,GAAGG,EAAO,CAEpH"}
1
+ {"version":3,"file":"sidebar.js","sources":["../../lib/components/sidebar.tsx"],"sourcesContent":["'use client';\nimport { createContext, use, useCallback, useEffect, useMemo, useState } from 'react';\nimport { Button } from '../components/button';\nimport { DialogContent, DialogOverlay, DialogTrigger } from '../components/dialog';\nimport { Tooltip, TooltipTrigger } from '../components/tooltip';\nimport { classNames } from '../utilities/theme';\nimport { useIsMobile } from '../utilities/use-mobile';\nimport { IcLeft, IcMenu, IcRight, type CtxIcon } from './icons';\n\nconst SIDEBAR_KEYBOARD_SHORTCUT = '/';\n\ntype SidebarContextProps = {\n state: 'expanded' | 'collapsed';\n open: boolean;\n setOpen: (open: boolean) => void;\n openMobile: boolean;\n setOpenMobile: (open: boolean) => void;\n isMobile: boolean;\n toggleSidebar: () => void;\n};\n\nexport const SidebarContext = createContext<SidebarContextProps | null>(null);\n\n/**\n * Get the current sidebar state and controls. Must be inside SidebarProvider.\n * @throws When used outside of SidebarProvider\n */\nexport function useSidebar() {\n const context = use(SidebarContext);\n if (!context) {\n throw new Error('useSidebar must be used within a SidebarProvider.');\n }\n\n return context;\n}\n\n/**\n * Wraps your app layout and manages sidebar state. Handles keyboard shortcuts (Cmd/Ctrl + /)\n * and mobile vs desktop behavior.\n *\n * @example\n * <SidebarProvider>\n * <Sidebar>...</Sidebar>\n * <SidebarOutlet>\n * <main>Your app content</main>\n * </SidebarOutlet>\n * </SidebarProvider>\n */\nexport function SidebarProvider({\n defaultOpen = true,\n open: openProp,\n onOpenChange: setOpenProp,\n className,\n style,\n children,\n ...props\n}: React.ComponentProps<'div'> & {\n /** Initial open state. Defaults to true */\n defaultOpen?: boolean;\n /** Control the open state yourself */\n open?: boolean;\n /** Callback when sidebar opens/closes */\n onOpenChange?: (open: boolean) => void;\n}) {\n const isMobile = useIsMobile();\n const [openMobile, setOpenMobile] = useState(false);\n\n // This is the internal state of the sidebar.\n // We use openProp and setOpenProp for control from outside the component.\n const [_open, _setOpen] = useState(defaultOpen);\n const open = openProp ?? _open;\n const setOpen = useCallback(\n (value: boolean | ((value: boolean) => boolean)) => {\n const openState = typeof value === 'function' ? value(open) : value;\n if (setOpenProp) {\n setOpenProp(openState);\n } else {\n _setOpen(openState);\n }\n },\n [setOpenProp, open]\n );\n\n // Helper to toggle the sidebar.\n const toggleSidebar = useCallback(() => {\n return isMobile ? setOpenMobile(open => !open) : setOpen(open => !open);\n }, [isMobile, setOpen, setOpenMobile]);\n\n // Adds a keyboard shortcut to toggle the sidebar.\n useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {\n event.preventDefault();\n toggleSidebar();\n }\n };\n\n window.addEventListener('keydown', handleKeyDown);\n return () => window.removeEventListener('keydown', handleKeyDown);\n }, [toggleSidebar]);\n\n // We add a state so that we can do data-state=\"expanded\" or \"collapsed\".\n // This makes it easier to style the sidebar with Tailwind classes.\n const state = open ? 'expanded' : 'collapsed';\n\n const contextValue = useMemo<SidebarContextProps>(\n () => ({\n state,\n open,\n setOpen,\n isMobile,\n openMobile,\n setOpenMobile,\n toggleSidebar,\n }),\n [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]\n );\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <div\n className={classNames(\n 'group/sidebar-wrapper flex w-full has-[[data-variant=inset]]:bg-elevation-1',\n className\n )}\n {...props}\n >\n {children}\n </div>\n </SidebarContext.Provider>\n );\n}\n\n/**\n * The actual sidebar panel. On mobile it becomes a modal dialog.\n */\nexport function Sidebar({\n side = 'left',\n variant = 'sidebar',\n collapsible = 'icon',\n className,\n children,\n ...props\n}: React.ComponentProps<'div'> & {\n /** Where to dock the sidebar. Default: left */\n side?: 'left' | 'right';\n /** Style variant. Default: sidebar */\n variant?: 'sidebar' | 'floating';\n /** How it collapses. Default: offcanvas */\n collapsible?: 'offcanvas' | 'icon' | 'none';\n}) {\n const { isMobile, state, openMobile, setOpenMobile } = useSidebar();\n\n if (collapsible === 'none') {\n return (\n <div\n className={classNames(\n 'flex h-full w-(--sidebar-width) flex-col bg-elevation-1 text-foreground',\n className\n )}\n {...props}\n >\n {children}\n </div>\n );\n }\n\n if (isMobile) {\n return (\n <DialogTrigger isOpen={openMobile} onOpenChange={setOpenMobile} {...props}>\n <DialogOverlay>\n <DialogContent\n data-sidebar=\"sidebar\"\n data-mobile=\"true\"\n className=\"w-(--sidebar-width) max-h-svh overflow-auto p-0 [&>button]:hidden\"\n side=\"left\"\n >\n {() => <div className=\"flex h-full w-full flex-col\">{children}</div>}\n </DialogContent>\n </DialogOverlay>\n </DialogTrigger>\n );\n }\n\n return (\n <div\n className=\"group peer hidden text-foreground md:block\"\n data-state={state}\n data-collapsible={state === 'collapsed' ? collapsible : ''}\n data-variant={variant}\n data-side={side}\n >\n {/* This is what handles the sidebar gap on desktop */}\n <div\n className={classNames(\n 'relative w-(--sidebar-width) bg-elevation-1 transition-[width] duration-200 ease-linear',\n 'group-data-[collapsible=offcanvas]:w-0',\n 'group-data-[side=right]:rotate-180',\n variant === 'floating'\n ? 'group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]'\n : 'group-data-[collapsible=icon]:w-(--sidebar-width-icon)'\n )}\n />\n <div\n className={classNames(\n 'absolute z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex',\n side === 'left'\n ? 'left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]'\n : 'right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]',\n // Adjust the padding for floating variant.\n variant === 'floating'\n ? 'group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]'\n : 'group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l',\n className\n )}\n {...props}\n >\n <div\n data-sidebar=\"sidebar\"\n className=\"flex h-full w-full flex-col bg-elevation-1 group-data-[variant=floating]:border group-data-[variant=floating]:border-border\"\n >\n {children}\n </div>\n </div>\n </div>\n );\n}\n\n/**\n * Button that toggles the sidebar. Shows arrow icons.\n */\nexport function SidebarTrigger({ className, onClick, ...props }: React.ComponentProps<typeof Button>) {\n const { toggleSidebar, open, isMobile } = useSidebar();\n\n return (\n <Button\n data-sidebar=\"trigger\"\n variant=\"neutral\"\n size=\"icon-sm\"\n className={classNames(className, '!rounded-full p-icon')}\n onClick={event => {\n onClick?.(event);\n toggleSidebar();\n }}\n aria-label=\"trigger\"\n {...props}\n >\n {/* Use transition to rotate a single icon */}\n {isMobile ? <IcMenu /> : open ? <IcLeft /> : <IcRight />}\n </Button>\n );\n}\n\n/**\n * Scrollable container for sidebar content\n */\nexport function SidebarContent({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-sidebar=\"content\"\n className={classNames('flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto overflow-x-hidden', className)}\n {...props}\n />\n );\n}\n\n/**\n * Groups related menu items together\n */\nexport function SidebarGroup({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-sidebar=\"group\"\n className={classNames(\n 'group/section relative flex w-full min-w-0 flex-col px-3 group-data-[collapsible=icon]:items-center',\n className\n )}\n {...props}\n />\n );\n}\n\n/**\n * Label for a group.\n */\nexport function SidebarGroupLabel({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-sidebar=\"group-label\"\n className={classNames(\n 'flex h-input shrink-0 items-center overflow-hidden px-2 text-xs select-none font-medium uppercase text-muted-foreground outline-none ring-ring transition-[height,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-icon [&>svg]:shrink-0',\n 'group-data-[collapsible=icon]:pointer-events-none group-data-[collapsible=icon]:!h-0 group-data-[collapsible=icon]:min-h-0 group-data-[collapsible=icon]:opacity-0',\n className\n )}\n {...props}\n />\n );\n}\n\n/**\n * Content wrapper for a group\n */\nexport function SidebarGroupContent({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-sidebar=\"group-content\" className={classNames('w-full body-sm', className)} {...props} />;\n}\n\n/**\n * Container for menu items\n */\nexport function SidebarMenu({ className, ...props }: React.ComponentProps<'ul'>) {\n return (\n <ul data-sidebar=\"menu\" className={classNames('flex w-full min-w-0 flex-col gap-px', className)} {...props} />\n );\n}\n\n/**\n * Single menu item wrapper\n */\nexport function SidebarMenuItem({ className, ...props }: React.ComponentProps<'li'>) {\n return (\n <li\n data-sidebar=\"menu-item\"\n className={classNames(\n 'group/menu-item relative list-none group-data-[collapsible=icon]:[&>*:not([data-sidebar=menu-button])]:hidden',\n className\n )}\n {...props}\n />\n );\n}\n\n/**\n * Extra action button that appears on the right side of menu items\n */\nexport function SidebarMenuAction({\n className,\n ...props\n}: React.ComponentProps<'button'> & {\n /** Only show on hover */\n showOnHover?: boolean;\n}) {\n return (\n <button\n data-sidebar=\"menu-action\"\n className={classNames(\n 'absolute top-0 right-0 btn btn-ghost h-input',\n 'group-data-[collapsible=icon]:hidden',\n className\n )}\n {...props}\n />\n );\n}\n\n/**\n * Shows a number badge on menu items. Auto-formats large numbers.\n */\nexport function SidebarMenuBadge({\n className,\n number,\n ...props\n}: Omit<React.ComponentProps<'div'>, 'children'> & {\n /** The count to display */\n number: number | bigint;\n}) {\n return (\n <div\n data-sidebar=\"menu-badge\"\n className={classNames(\n 'absolute pointer-events-none top-0 right-0 font-light h-input select-none flex items-center justify-center body-sm tabular-nums',\n 'group-data-[collapsible=icon]:hidden',\n className\n )}\n {...props}\n >\n {/* Format the number */}\n {new Intl.NumberFormat(navigator.language, { useGrouping: true }).format(number)}\n </div>\n );\n}\n\n/**\n * Nested submenu container\n */\nexport function SidebarMenuSub({ className, ...props }: React.ComponentProps<'ul'>) {\n return (\n <ul\n data-sidebar=\"menu-sub\"\n className={classNames('ms-2 flex min-w-0 flex-col', 'group-data-[collapsible=icon]:hidden', className)}\n {...props}\n />\n );\n}\n\n/**\n * Submenu item wrapper\n */\nexport function SidebarMenuSubItem({ className, ...props }: React.ComponentProps<'li'>) {\n return <li className={classNames('list-none ms-0', className)} {...props} />;\n}\n\nexport const sidebarMenuButtonClasses =\n 'btn-tab relative rounded-md border-0 justify-start w-full group-data-[collapsible=icon]:justify-center';\n\n// Common interaction logic for SidebarMenuButton and SidebarMenuSubButton\n/**\n * Main menu button. Pass isActive for current page.\n */\nexport function SidebarMenuButton({\n isActive = false,\n className,\n children,\n icon: Icon,\n leading,\n ...props\n}: Omit<React.ComponentProps<typeof Button>, 'children'> & {\n /** Mark as currently active page */\n icon?: CtxIcon;\n leading?: React.ReactNode;\n isActive?: boolean;\n children?: React.ReactNode;\n}) {\n const { isMobile, state } = useSidebar();\n const isCollapsed = !isMobile && state === 'collapsed';\n\n return (\n <TooltipTrigger isDisabled={!isCollapsed}>\n <Button\n size={isCollapsed ? 'icon' : undefined}\n data-sidebar=\"menu-button\"\n {...(isActive && { 'data-selected': true })}\n className={classNames(\n 'peer/menu-button group/active group-has-[[data-sidebar=menu-action]]/menu-item:pr-input',\n sidebarMenuButtonClasses,\n className\n )}\n {...props}\n >\n <span\n aria-hidden\n className=\"absolute inset-y-2 -left-1 w-[7px] rounded-full bg-primary opacity-0 group-data-[selected=true]/active:opacity-100\"\n />\n {leading !== undefined ? leading : Icon ? <Icon /> : null}\n {!isCollapsed && children}\n </Button>\n <Tooltip placement=\"right\">\n <span className=\"flex items-center gap-2\">{children}</span>\n </Tooltip>\n </TooltipTrigger>\n );\n}\n\n/**\n * Button for submenu items\n */\nexport function SidebarMenuSubButton({\n isActive,\n className,\n ...props\n}: React.ComponentProps<'button'> & {\n isActive?: boolean;\n}) {\n return (\n <button\n data-sidebar=\"menu-sub-button\"\n data-active={isActive}\n className={classNames(sidebarMenuButtonClasses, className)}\n {...props}\n />\n );\n}\n\n/**\n * Sticky header at the top of the sidebar. Displays a square logo slot aligned with the outlet header.\n */\nexport function SidebarHeader({\n className,\n logo,\n children,\n showTrigger = true,\n ...props\n}: React.ComponentProps<'div'> & {\n /** Square logo/icon to display */\n logo?: React.ReactNode;\n showTrigger?: boolean;\n}) {\n return (\n <div\n data-sidebar=\"header\"\n className={classNames(\n 'flex items-center h-header select-none shrink-0 border-b px-2 gap-2 group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:px-0',\n className\n )}\n {...props}\n >\n {logo && <div className=\"flex items-center justify-center size-input shrink-0\">{logo}</div>}\n {children && <div className=\"flex-1 min-w-0 group-data-[collapsible=icon]:hidden\">{children}</div>}\n {showTrigger && (\n <SidebarTrigger className={'hidden bg-elevation-1 lg:flex lg:absolute lg:-right-4 lg:z-50'} />\n )}\n </div>\n );\n}\n\nexport function SidebarFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-sidebar=\"footer\"\n className={classNames(\n 'mt-auto flex shrink-0 select-none items-center gap-2 border-t py-2 group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:px-0',\n className\n )}\n {...props}\n />\n );\n}\n\n/**\n *\n * @example Basic usage\n * ```tsx\n * <SidebarOutlet>\n * <SidebarOutletHeader><SidebarTrigger/></SidebarOutletHeader>\n * <SidebarOutletContent><Outlet/></SidebarOutletContent>\n * </SidebarOutlet>\n * ```\n */\nexport function SidebarOutlet({ className, ...props }: React.ComponentProps<'div'>) {\n return <div className={classNames(className, 'flex flex-col flex-1 overflow-auto')} {...props} />;\n}\n\nexport function SidebarOutletContent({ className, ...props }: React.ComponentProps<'div'>) {\n return <div className={classNames(className, 'flex-1 overflow-auto')} {...props} />;\n}\n\nexport function SidebarOutletHeader({ className, ...props }: React.ComponentProps<'nav'>) {\n return (\n <nav className={classNames('flex items-center h-header bg-elevation-1 p-2 border-b', className)} {...props} />\n );\n}\n"],"names":["SIDEBAR_KEYBOARD_SHORTCUT","SidebarContext","createContext","useSidebar","context","use","SidebarProvider","defaultOpen","openProp","setOpenProp","className","style","children","props","isMobile","useIsMobile","openMobile","setOpenMobile","useState","_open","_setOpen","open","setOpen","useCallback","value","openState","toggleSidebar","useEffect","handleKeyDown","event","state","contextValue","useMemo","jsx","classNames","Sidebar","side","variant","collapsible","DialogTrigger","DialogOverlay","DialogContent","jsxs","SidebarTrigger","onClick","Button","IcMenu","IcLeft","IcRight","SidebarContent","SidebarGroup","SidebarGroupLabel","SidebarGroupContent","SidebarMenu","SidebarMenuItem","SidebarMenuAction","SidebarMenuBadge","number","SidebarMenuSub","SidebarMenuSubItem","sidebarMenuButtonClasses","SidebarMenuButton","isActive","Icon","leading","isCollapsed","TooltipTrigger","Tooltip","SidebarMenuSubButton","SidebarHeader","logo","showTrigger","SidebarFooter","SidebarOutlet","SidebarOutletContent","SidebarOutletHeader"],"mappings":"2oBASA,MAAMA,EAA4B,IAYrBC,EAAiBC,EAA0C,IAAI,EAMrE,SAASC,GAAa,CACzB,MAAMC,EAAUC,EAAIJ,CAAc,EAClC,GAAI,CAACG,EACD,MAAM,IAAI,MAAM,mDAAmD,EAGvE,OAAOA,CACX,CAcO,SAASE,GAAgB,CAC5B,YAAAC,EAAc,GACd,KAAMC,EACN,aAAcC,EACd,UAAAC,EACA,MAAAC,EACA,SAAAC,EACA,GAAGC,CACP,EAOG,CACC,MAAMC,EAAWC,EAAA,EACX,CAACC,EAAYC,CAAa,EAAIC,EAAS,EAAK,EAI5C,CAACC,EAAOC,CAAQ,EAAIF,EAASX,CAAW,EACxCc,EAAOb,GAAYW,EACnBG,EAAUC,EACXC,GAAmD,CAChD,MAAMC,EAAY,OAAOD,GAAU,WAAaA,EAAMH,CAAI,EAAIG,EAC1Df,EACAA,EAAYgB,CAAS,EAErBL,EAASK,CAAS,CAE1B,EACA,CAAChB,EAAaY,CAAI,CAAA,EAIhBK,EAAgBH,EAAY,IACvBT,EAAWG,EAAc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B,CAAA,EAEH,GAAGG,EAEH,SAAA,CAAAyD,GAAQrC,EAAC,MAAA,CAAI,UAAU,uDAAwD,SAAAqC,EAAK,EACpF1D,GAAYqB,EAAC,MAAA,CAAI,UAAU,sDAAuD,SAAArB,EAAS,EAC3F2D,GACGtC,EAACU,EAAA,CAAe,UAAW,+DAAA,CAAiE,CAAA,CAAA,CAAA,CAI5G,CAEO,SAAS6B,GAAc,CAAE,UAAA9D,EAAW,GAAGG,GAAsC,CAChF,OACIoB,EAAC,MAAA,CACG,eAAa,SACb,UAAWC,EACP,qJACAxB,CAAA,EAEH,GAAGG,CAAA,CAAA,CAGhB,CAYO,SAAS4D,GAAc,CAAE,UAAA/D,EAAW,GAAGG,GAAsC,CAChF,OAAOoB,EAAC,OAAI,UAAWC,EAAWxB,EAAW,oCAAoC,EAAI,GAAGG,EAAO,CACnG,CAEO,SAAS6D,GAAqB,CAAE,UAAAhE,EAAW,GAAGG,GAAsC,CACvF,OAAOoB,EAAC,OAAI,UAAWC,EAAWxB,EAAW,sBAAsB,EAAI,GAAGG,EAAO,CACrF,CAEO,SAAS8D,GAAoB,CAAE,UAAAjE,EAAW,GAAGG,GAAsC,CACtF,OACIoB,EAAC,OAAI,UAAWC,EAAW,yDAA0DxB,CAAS,EAAI,GAAGG,EAAO,CAEpH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cryptlex/web-components",
3
- "version": "6.6.111",
3
+ "version": "6.6.113",
4
4
  "description": "React component library for Cryptlex web applications",
5
5
  "author": "Cryptlex",
6
6
  "type": "module",