@moondreamsdev/dreamer-ui 1.7.21-test.74 → 1.7.21
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/Toast-CQnaydN2.cjs +2 -0
- package/dist/Toast-CQnaydN2.cjs.map +1 -0
- package/dist/Toast-Cj5L6xNo.js +387 -0
- package/dist/Toast-Cj5L6xNo.js.map +1 -0
- package/dist/components.cjs.js +2 -2
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.esm.js +1961 -2182
- package/dist/components.esm.js.map +1 -1
- package/dist/providers.cjs.js +1 -1
- package/dist/providers.esm.js +1 -1
- package/dist/src/components/accordion/AccordionItem.d.ts +0 -1
- package/dist/src/components/actionmodal/ActionModal.d.ts +1 -1
- package/dist/src/components/calendar/hooks.d.ts +2 -2
- package/dist/src/components/calendar/variants.d.ts +2 -2
- package/dist/src/components/card/Card.d.ts +0 -1
- package/dist/src/components/carousel/hooks.d.ts +0 -1
- package/dist/src/components/clickable/Clickable.d.ts +0 -1
- package/dist/src/components/code-block/CodeBlock.d.ts +0 -1
- package/dist/src/components/code-block/hooks.d.ts +0 -1
- package/dist/src/components/dropdown-menu/DropdownContext.d.ts +0 -1
- package/dist/src/components/dropdown-menu/DropdownMenuOption.d.ts +0 -1
- package/dist/src/components/dropdown-menu/factories.d.ts +1 -1
- package/dist/src/components/dropdown-menu/types.d.ts +0 -1
- package/dist/src/components/form/factories.d.ts +7 -7
- package/dist/src/components/popover/hooks.d.ts +0 -1
- package/dist/src/components/radiogroup/RadioGroupItem.d.ts +0 -1
- package/dist/src/components/scroll-area/hooks.d.ts +0 -1
- package/dist/src/components/tabs/TabsContent.d.ts +0 -1
- package/dist/src/components/tabs/TabsContext.d.ts +0 -1
- package/dist/src/components/tabs/TabsList.d.ts +0 -1
- package/dist/src/components/tabs/TabsTrigger.d.ts +0 -1
- package/dist/src/hooks/useActionModal.d.ts +0 -1
- package/dist/src/hooks/useTheme.d.ts +0 -1
- package/dist/src/hooks/useToast.d.ts +0 -1
- package/package.json +1 -4
- package/dist/Toast-Bzid968E.js +0 -1083
- package/dist/Toast-Bzid968E.js.map +0 -1
- package/dist/Toast-LhdQ1BOc.cjs +0 -2
- package/dist/Toast-LhdQ1BOc.cjs.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),l=require("react"),V=require("react-dom"),h=require("./X-CgjeP2OI.cjs"),m=require("./join-BVMUUvyP.cjs");function C(){const[e,i]=l.useState(0);return l.useEffect(()=>{const r=setInterval(()=>{i(n=>(n+1)%3)},500);return()=>clearInterval(r)},[]),t.jsx("div",{className:"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle",children:[0,1,2].map(r=>t.jsx("div",{className:m.join("rounded-full transition-all ease-in-out size-[0.35em] bg-current",e===r&&"transform -translate-y-1")},r))})}const H={base:"focus:outline-current",primary:"bg-primary text-primary-foreground hover:bg-primary/80 focus:outline-primary outline-offset-2 disabled:bg-muted disabled:text-muted-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 focus:outline-secondary outline-offset-2 disabled:bg-muted/80 disabled:text-muted-foreground/80",tertiary:"text-primary hover:text-primary/80 disabled:text-muted-foreground focus:outline-primary",outline:"border border-primary text-primary hover:border-primary/80 hover:text-primary/80 focus:outline-primary outline-offset-2 disabled:border-muted-foreground disabled:text-muted-foreground",link:"underline-offset-4 hover:underline disabled:underline disabled:text-muted-foreground focus:underline",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/80 focus:outline-destructive outline-offset-2 disabled:bg-muted disabled:text-muted-foreground"},P={stripped:"",fitted:"size-fit leading-0",sm:"px-2 py-1 text-sm",md:"px-4 py-2 text-base",lg:"px-6 py-3 text-lg",icon:"p-1 w-fit aspect-square",full:"p-2 w-full"},X={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},v={variant:"primary",size:"md",rounded:"md"};function N({variant:e=v.variant,size:i,rounded:r=v.rounded,loading:n,className:s,...o}){let d;e==="link"&&!i?d="fitted":d=i||v.size;const c=m.join("appearance-none not-disabled:hover:cursor-pointer outline outline-transparent disabled:opacity-50 disabled:cursor-not-allowed transition-all inline-flex items-center justify-center gap-0.5",H[e],P[d],X[r],n&&"relative pointer-events-none",s);if(o.href&&!o.disabled)return t.jsx("a",{...o,rel:o.rel?o.rel:o.target==="_blank"?"noopener noreferrer":void 0,"aria-label":o["aria-label"],"aria-description":o["aria-description"],href:o.href,className:c,children:o.children});const a=o,b=()=>a.children?typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="boolean"?t.jsx("span",{className:m.join(n&&"invisible"),children:a.children}):l.Children.map(a.children,(f,p)=>{if(l.isValidElement(f)){const g=f.props;return l.cloneElement(f,{key:p,className:m.join(n&&"invisible",g.className)})}return f}):null;return t.jsxs("button",{...a,"aria-label":a["aria-label"],"aria-description":a["aria-description"],"aria-disabled":a.disabled||n,"aria-busy":n,type:a.type??"button",className:c,children:[n&&t.jsx(C,{}),b()]})}function $(e){const[i,r]=l.useState(!1),[n,s]=l.useState(!1);return l.useEffect(()=>{e?(s(!0),setTimeout(()=>r(!0),10)):(r(!1),setTimeout(()=>s(!1),150))},[e]),{show:i,shouldRender:n}}function F(e,i){l.useEffect(()=>{const r=n=>{n.key==="Escape"&&e&&i()};return document.addEventListener("keydown",r),e&&(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",r),document.body.style.overflow="auto"}},[e,i])}function K(e,i){const r=l.useRef(null),n=l.useCallback(()=>{const s=document.getElementById(e);if(!s)return;const o=s.querySelectorAll('[data-modal-action="true"]');if(o.length>0){o[0].focus();return}const d=s.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(d.length>0){const u=Array.from(d).filter(c=>!(c instanceof HTMLButtonElement&&c.getAttribute("data-modal-close-button")==="true"));if(u.length>0){u[0].focus();return}d[0].focus();return}s.focus()},[e]);l.useEffect(()=>(i&&(r.current=document.activeElement,n()),()=>{document.body.style.overflow="auto",r.current instanceof HTMLElement&&r.current.focus()}),[i,n])}function E({id:e,isOpen:i,onClose:r,title:n,children:s,contentOnly:o=!1,className:d,overlayClassName:u,containerClassName:c,hideCloseButton:a=!1,actions:b=[],disableCloseOnOverlayClick:x=!1,ariaLabelledBy:f,ariaDescribedBy:p}){const g=l.useId(),j=e||`modal-${g}`,w=e?`${e}-title`:`modal-title-${g}`,{show:M,shouldRender:y}=$(i);if(K(j,y),F(y,r),!y)return null;const z=()=>n?l.isValidElement(n)?t.jsx("div",{className:"mb-4",children:n}):t.jsx("h2",{className:"mb-4 text-xl font-semibold",id:w,children:n}):null,D=()=>b.length===0?null:t.jsx("div",{className:"mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3",children:b.map((I,S)=>{const{label:q,...B}=I,L=B;return t.jsx(N,{...L,"data-modal-action":"true",children:q},S)})});return t.jsx(t.Fragment,{children:V.createPortal(t.jsx("div",{"aria-labelledby":f??n?w:void 0,"aria-describedby":p,role:"dialog","aria-modal":"true",className:"fixed inset-0 z-[100] overflow-y-auto",children:t.jsxs("div",{className:m.join("flex min-h-screen items-center justify-center p-4",c),children:[t.jsx("div",{className:m.join("fixed inset-0 bg-black/20 transition-all",u),onClick:()=>{x||r()}}),o&&t.jsx("div",{className:m.join("relative w-fit",d),children:s}),!o&&t.jsxs("div",{id:j,tabIndex:-1,className:m.join("relative w-full max-w-xl transform rounded-lg shadow-xl bg-popover text-popover-foreground transition-all p-6 focus:ring ease-in",M?"opacity-100 scale-100":"opacity-0 scale-90",d),children:[!a&&t.jsx("button",{type:"button",onClick:r,"data-modal-close-button":"true",className:"rounded-md p-0.5 top-2.5 right-2.5 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0",children:t.jsx(h.X,{size:18})}),z(),s,D()]})]})}),document.body)})}function R({type:e,message:i,cancelText:r,confirmText:n,onConfirm:s,onClose:o,destructive:d=!1,title:u,...c}){const a=l.useMemo(()=>e==="confirm"?{confirm:n||"Confirm",cancel:r||"Cancel",defaultTitle:u||"Confirm Action"}:{confirm:n||"OK",cancel:null,defaultTitle:u||"Alert"},[e,n,u,r]),b=l.useMemo(()=>[...a.cancel?[{label:a.cancel,variant:"secondary",onClick:o}]:[],{label:a.confirm,variant:d?"destructive":"primary",onClick:()=>{s==null||s(),o()}}],[a,d,s,o]);return t.jsx(E,{...c,title:u||a.defaultTitle,onClose:o,actions:b,disableCloseOnOverlayClick:e==="confirm",hideCloseButton:e==="confirm",children:typeof i=="string"?t.jsx("p",{className:"text-sm",children:i}):i})}const T=l.createContext(null),_=()=>{const e=l.useContext(T);if(!e)throw new Error("DropdownMenu components must be used within a DropdownMenu component");return e},A=l.createContext(null),G=()=>{const e=l.useContext(A);if(!e)throw new Error("Tabs components must be used within a Tabs component");return e},k={info:{className:"bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100",icon:t.jsx(h.InfoCircled,{size:20})},warning:{className:"bg-yellow-50 border-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:border-yellow-950 dark:text-yellow-100",icon:t.jsx(h.ExclamationTriangle,{size:20})},error:{className:"bg-red-50 border-red-200 text-red-900 dark:bg-red-800 dark:border-red-950 dark:text-red-100",icon:t.jsx(h.CrossCircled,{size:20})}};function J({id:e,title:i,description:r,type:n="info",action:s,duration:o=5e3,onRemove:d,customTypes:u,customComponent:c}){const[a,b]=l.useState(!1),x=l.useCallback(()=>{b(!0),setTimeout(()=>{d==null||d(e)},150)},[e,d]);if(l.useEffect(()=>{if(o>0){const p=setTimeout(()=>{x()},o);return()=>clearTimeout(p)}},[o,e,d,x]),c)return t.jsx(c,{id:e,title:i,description:r,type:n,action:s,duration:o,onRemove:d});const f=(u==null?void 0:u[n])||k[n]||k.info;return t.jsxs("div",{role:n==="error"?"alert":"status","aria-live":n==="error"?void 0:"polite",className:m.join("relative flex items-start p-4 rounded-lg border shadow-lg transition-all ease-in-out",s&&"pb-3",f.className,a?"opacity-0 translate-x-full":"opacity-100 translate-x-0"),children:[t.jsx("div",{className:"flex-shrink-0 mr-3",children:f.icon}),t.jsxs("div",{className:"flex-grow min-w-0",children:[t.jsx("div",{className:"font-medium text-sm leading-5",children:i}),r&&t.jsx("div",{className:"mt-1 text-sm opacity-90 leading-5",children:r}),s&&t.jsx("div",{className:"mt-1.5",children:t.jsx("button",{onClick:s.onClick,className:"text-sm font-medium underline hover:no-underline focus:outline-none focus:ring-1 focus:ring-current rounded px-1 py-0.5 hover:cursor-pointer",children:s.label})})]}),t.jsx("button",{onClick:x,className:"flex-shrink-0 ml-3 p-1 rounded-md hover:bg-black/10 dark:hover:bg-white/10 focus:outline-none focus:ring-1 focus:ring-current leading-0",children:t.jsx(h.X,{size:16})})]})}exports.ActionModal=R;exports.Button=N;exports.DropdownMenuContext=T;exports.LoadingDots=C;exports.Modal=E;exports.TabsContext=A;exports.Toast=J;exports.useDropdownMenuContext=_;exports.useTabsContext=G;
|
|
2
|
+
//# sourceMappingURL=Toast-CQnaydN2.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Toast-CQnaydN2.cjs","sources":["../src/components/button/LoadingDots.tsx","../src/components/button/variants.ts","../src/components/button/Button.tsx","../src/components/modal/hooks.ts","../src/components/modal/Modal.tsx","../src/components/actionmodal/ActionModal.tsx","../src/components/dropdown-menu/DropdownContext.tsx","../src/components/tabs/TabsContext.tsx","../src/components/toast/Toast.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { join } from '../../utils';\n\n/**\n * An animated loading indicator with three bouncing dots.\n * Used internally by Button component to show loading state.\n * \n * @example\n * ```tsx\n * <LoadingDots />\n * ```\n */\nexport function LoadingDots() {\n const [activeIndex, setActiveIndex] = useState(0);\n\n useEffect(() => {\n const interval = setInterval(() => {\n setActiveIndex((prevIndex) => (prevIndex + 1) % 3);\n }, 500);\n\n return () => clearInterval(interval);\n }, []);\n\n return (\n <div className='absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle'>\n {[0, 1, 2].map((index) => (\n <div\n key={index}\n className={join(\n 'rounded-full transition-all ease-in-out size-[0.35em] bg-current',\n activeIndex === index && 'transform -translate-y-1'\n )}\n />\n ))}\n </div>\n );\n}","export const buttonVariants = {\n base: 'focus:outline-current',\n primary: 'bg-primary text-primary-foreground hover:bg-primary/80 focus:outline-primary outline-offset-2 disabled:bg-muted disabled:text-muted-foreground',\n secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80 focus:outline-secondary outline-offset-2 disabled:bg-muted/80 disabled:text-muted-foreground/80',\n tertiary: 'text-primary hover:text-primary/80 disabled:text-muted-foreground focus:outline-primary',\n outline: 'border border-primary text-primary hover:border-primary/80 hover:text-primary/80 focus:outline-primary outline-offset-2 disabled:border-muted-foreground disabled:text-muted-foreground',\n link: 'underline-offset-4 hover:underline disabled:underline disabled:text-muted-foreground focus:underline',\n destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/80 focus:outline-destructive outline-offset-2 disabled:bg-muted disabled:text-muted-foreground',\n} as const;\nexport type ButtonVariant = keyof typeof buttonVariants;\n\nexport const sizeVariants = {\n stripped: '',\n fitted: 'size-fit leading-0',\n sm: 'px-2 py-1 text-sm',\n md: 'px-4 py-2 text-base',\n lg: 'px-6 py-3 text-lg',\n icon: 'p-1 w-fit aspect-square',\n full: 'p-2 w-full',\n} as const;\nexport type ButtonSize = keyof typeof sizeVariants;\n\nexport const roundedVariants = {\n none: 'rounded-none',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n full: 'rounded-full',\n} as const;\nexport type ButtonRounded = keyof typeof roundedVariants;\n\nexport interface ButtonVariants {\n /** The visual style variant of the button. */\n variant: ButtonVariant;\n /** The size of the button. */\n size: ButtonSize;\n /** The border radius of the button. */\n rounded: ButtonRounded;\n}\n\nexport const buttonDefaults: ButtonVariants = {\n variant: 'primary',\n size: 'md',\n rounded: 'md',\n} as const;\n","// Button.tsx\nimport React, { ButtonHTMLAttributes, Ref } from 'react';\nimport { join } from '../../utils';\nimport { LoadingDots } from './LoadingDots';\nimport { ButtonSize, ButtonVariants, buttonDefaults, buttonVariants, roundedVariants, sizeVariants } from './variants';\n\ninterface ButtonButtonProps extends Partial<ButtonVariants>, ButtonHTMLAttributes<HTMLButtonElement> {\n\thref?: never;\n\t/** Reference to the button element. */\n\tref?: Ref<HTMLButtonElement>;\n\t/** Whether the button is in a loading state. */\n\tloading?: boolean;\n}\n\ninterface ButtonLinkProps\n\textends Partial<ButtonVariants>,\n\t\tOmit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'role'> {\n\t/** When provided, renders the button as a link. */\n\thref: string;\n\t/** Reference to the anchor element. */\n\tref?: Ref<HTMLAnchorElement>;\n\tloading?: never;\n\t/** Whether the button is disabled. */\n\tdisabled?: boolean;\n}\n\nexport type ButtonProps = ButtonButtonProps | ButtonLinkProps;\n\n/**\n * A versatile button component that can render as either a button or anchor element.\n * Supports loading states, various visual variants, and accessibility features.\n * \n * @example\n * ```tsx\n * // Regular button\n * <Button variant=\"primary\" onClick={() => save()}>Save</Button>\n * \n * // Loading state\n * <Button loading variant=\"primary\">Processing...</Button>\n * \n * // Link button\n * <Button href=\"/dashboard\" variant=\"secondary\">Go to Dashboard</Button>\n * ```\n */\nexport function Button({\n\tvariant = buttonDefaults.variant,\n\tsize,\n\trounded = buttonDefaults.rounded,\n\tloading,\n\tclassName,\n\t...rest\n}: ButtonProps) {\n\tlet adjustedSize: ButtonSize;\n\tif (variant === 'link' && !size) {\n\t\t// default links to fitted size\n\t\tadjustedSize = 'fitted';\n\t} else {\n\t\tadjustedSize = size || buttonDefaults.size;\n\t}\n\n\tconst baseClasses =\n\t\t'appearance-none not-disabled:hover:cursor-pointer outline outline-transparent disabled:opacity-50 disabled:cursor-not-allowed transition-all inline-flex items-center justify-center gap-0.5';\n\n\tconst buttonClasses = join(\n\t\tbaseClasses,\n\t\tbuttonVariants[variant],\n\t\tsizeVariants[adjustedSize],\n\t\troundedVariants[rounded],\n\t\tloading && 'relative pointer-events-none',\n\t\tclassName\n\t);\n\n\tif (rest.href && !rest.disabled) {\n\t\treturn (\n\t\t\t<a\n\t\t\t\t{...rest}\n\t\t\t\trel={rest.rel ? rest.rel : rest.target === '_blank' ? 'noopener noreferrer' : undefined}\n\t\t\t\taria-label={rest['aria-label']}\n\t\t\t\taria-description={rest['aria-description']}\n\t\t\t\thref={rest.href}\n\t\t\t\tclassName={buttonClasses}\n\t\t\t>\n\t\t\t\t{rest.children}\n\t\t\t</a>\n\t\t);\n\t}\n\n\tconst buttonRest = rest as ButtonButtonProps; // necessary to cast to avoid TS complaining\n\tconst getButtonChildren = () => {\n\t\tif (!buttonRest.children) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (\n\t\t\ttypeof buttonRest.children === 'string' ||\n\t\t\ttypeof buttonRest.children === 'number' ||\n\t\t\ttypeof buttonRest.children === 'boolean'\n\t\t) {\n\t\t\treturn <span className={join(loading && 'invisible')}>{buttonRest.children}</span>;\n\t\t}\n\n\t\tconst clonedChildren = React.Children.map(buttonRest.children, (child, index) => {\n\t\t\tif (React.isValidElement(child)) {\n\t\t\t\tconst childrenProps = child.props as { className?: string };\n\t\t\t\treturn React.cloneElement(child, {\n\t\t\t\t\tkey: index,\n\t\t\t\t\tclassName: join(loading && 'invisible', childrenProps.className),\n\t\t\t\t} as Record<string, unknown>);\n\t\t\t}\n\t\t\treturn child;\n\t\t});\n\t\treturn clonedChildren;\n\t};\n\n\treturn (\n\t\t<button\n\t\t\t{...buttonRest}\n\t\t\taria-label={buttonRest['aria-label']}\n\t\t\taria-description={buttonRest['aria-description']}\n\t\t\taria-disabled={buttonRest.disabled || loading}\n\t\t\taria-busy={loading}\n\t\t\ttype={buttonRest.type ?? 'button'}\n\t\t\tclassName={buttonClasses}\n\t\t>\n\t\t\t{loading && <LoadingDots />}\n\t\t\t{getButtonChildren()}\n\t\t</button>\n\t);\n}\n","import { useCallback, useEffect, useRef, useState } from 'react';\n\nexport function useAnimationOpenClose(isOpen: boolean) {\n const [show, setShow] = useState(false);\n const [shouldRender, setShouldRender] = useState(false);\n\n useEffect(() => {\n if (isOpen) {\n setShouldRender(true);\n setTimeout(() => setShow(true), 10);\n } else {\n setShow(false);\n setTimeout(() => setShouldRender(false), 150);\n }\n }, [isOpen]);\n\n return { show, shouldRender };\n}\n\nexport function useDocumentChanges(isOpen: boolean, onClose: () => void) {\n useEffect(() => {\n const handleEscape = (e: KeyboardEvent) => {\n if (e.key === 'Escape' && isOpen) {\n onClose();\n }\n };\n\n document.addEventListener('keydown', handleEscape);\n // Prevent background scrolling when modal is open\n if (isOpen) {\n document.body.style.overflow = 'hidden';\n }\n\n return () => {\n document.removeEventListener('keydown', handleEscape);\n document.body.style.overflow = 'auto';\n };\n }, [isOpen, onClose]);\n}\n\nexport function useHandleFocus(modalId: string, isOpen: boolean) {\n const previousActiveElement = useRef<Element | null>(null);\n\n const focusAppropriateElement = useCallback(() => {\n const modalElement = document.getElementById(modalId);\n if (!modalElement) return;\n\n // 1. First, try to focus on the first action button, if available\n const modalActions = modalElement.querySelectorAll('[data-modal-action=\"true\"]');\n if (modalActions.length > 0) {\n (modalActions[0] as HTMLElement).focus();\n return;\n }\n\n // 2. Then try first focusable element in content (giving preference to non-close button)\n const focusableElements = modalElement.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n );\n\n if (focusableElements.length > 0) {\n const allBesidesCloseButton = Array.from(focusableElements).filter((el) => {\n return !(el instanceof HTMLButtonElement && el.getAttribute('data-modal-close-button') === 'true');\n });\n\n if (allBesidesCloseButton.length > 0) {\n (allBesidesCloseButton[0] as HTMLElement).focus();\n return;\n }\n\n (focusableElements[0] as HTMLElement).focus();\n return;\n }\n\n // 3. Fallback to modal container\n modalElement.focus();\n }, [modalId]);\n\n useEffect(() => {\n if (isOpen) {\n // Store the currently focused element to restore focus later\n previousActiveElement.current = document.activeElement;\n\n focusAppropriateElement();\n }\n\n return () => {\n document.body.style.overflow = 'auto';\n\n // Restore focus to the previously focused element when modal closes\n if (previousActiveElement.current instanceof HTMLElement) {\n previousActiveElement.current.focus();\n }\n };\n }, [isOpen, focusAppropriateElement]);\n}\n","import React, { useId } from 'react';\nimport { createPortal } from 'react-dom';\nimport { X } from '../../symbols';\nimport { Button, ButtonProps } from '../button';\nimport { useAnimationOpenClose, useDocumentChanges, useHandleFocus } from './hooks';\nimport { join } from '../../utils';\n\ninterface ModalAction extends Omit<ButtonProps, 'children'> {\n\t/** The text label for the action button. */\n\tlabel: string;\n}\n\nexport interface ModalProps {\n\t/** Optional ID for the modal element. */\n\tid?: string;\n\t/** Whether the modal is open. */\n\tisOpen: boolean;\n\t/** Callback fired when the modal should close. */\n\tonClose: () => void;\n\t/** Optional title for the modal header. */\n\ttitle?: React.ReactNode;\n\t/** The content to display inside the modal. */\n\tchildren: React.ReactNode;\n\t/** When true, renders only the children with no default modal styling. */\n\tcontentOnly?: boolean;\n\t/** Additional CSS classes to apply to the modal content. */\n\tclassName?: string;\n\t/** Additional CSS classes to apply to the backdrop overlay. */\n\toverlayClassName?: string;\n\t/** Additional CSS classes to apply to the modal container. */\n\tcontainerClassName?: string;\n\t/** Whether to hide the X close button in the top-right corner. */\n\thideCloseButton?: boolean;\n\t/** Array of action buttons to display at the bottom of the modal. */\n\tactions?: ModalAction[];\n\t/** Whether clicking the backdrop/overlay closes the modal. */\n\tdisableCloseOnOverlayClick?: boolean;\n\t/** ID of an element that labels the modal. */\n\tariaLabelledBy?: string;\n\t/** ID of an element that describes the modal. */\n\tariaDescribedBy?: string;\n}\n\n/**\n * A flexible modal dialog component with focus management, animation, and action buttons.\n * Supports both styled and content-only modes with comprehensive accessibility features.\n * \n * @example\n * ```tsx\n * // Basic modal\n * <Modal\n * isOpen={showModal}\n * onClose={() => setShowModal(false)}\n * title=\"Confirm Action\"\n * >\n * <p>Are you sure you want to proceed?</p>\n * </Modal>\n * \n * // Modal with actions\n * <Modal\n * isOpen={showDeleteModal}\n * onClose={handleClose}\n * title=\"Delete Item\"\n * actions={[\n * { label: \"Cancel\", variant: \"secondary\", onClick: handleClose },\n * { label: \"Delete\", variant: \"destructive\", onClick: handleDelete }\n * ]}\n * disableCloseOnOverlayClick\n * >\n * <p>This action cannot be undone.</p>\n * </Modal>\n * ```\n */\nexport function Modal({\n\tid,\n\tisOpen,\n\tonClose,\n\ttitle,\n\tchildren,\n\tcontentOnly = false,\n\tclassName,\n\toverlayClassName,\n\tcontainerClassName,\n\thideCloseButton = false,\n\tactions = [],\n\tdisableCloseOnOverlayClick = false,\n\tariaLabelledBy,\n\tariaDescribedBy,\n}: ModalProps) {\n\tconst generatedId = useId();\n\tconst modalId = id || `modal-${generatedId}`;\n\tconst titleId = id ? `${id}-title` : `modal-title-${generatedId}`;\n\n\tconst { show, shouldRender } = useAnimationOpenClose(isOpen);\n\tuseHandleFocus(modalId, shouldRender);\n\tuseDocumentChanges(shouldRender, onClose);\n\n\tif (!shouldRender) return null;\n\n\tconst renderTitle = () => {\n\t\tif (!title) return null;\n\n\t\tif (React.isValidElement(title)) {\n\t\t\treturn <div className='mb-4'>{title}</div>;\n\t\t}\n\n\t\treturn (\n\t\t\t<h2 className='mb-4 text-xl font-semibold' id={titleId}>\n\t\t\t\t{title}\n\t\t\t</h2>\n\t\t);\n\t};\n\n\tconst renderActions = () => {\n\t\tif (actions.length === 0) return null;\n\n\t\treturn (\n\t\t\t<div className='mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3'>\n\t\t\t\t{actions.map((action, index) => {\n\t\t\t\t\tconst { label, ...rest } = action;\n\t\t\t\t\tconst buttonProps = rest as ButtonProps;\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button key={index} {...buttonProps} data-modal-action='true'>\n\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</div>\n\t\t);\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t{createPortal(\n\t\t\t\t<div\n\t\t\t\t\taria-labelledby={ariaLabelledBy ?? title ? titleId : undefined}\n\t\t\t\t\taria-describedby={ariaDescribedBy}\n\t\t\t\t\trole='dialog'\n\t\t\t\t\taria-modal='true'\n\t\t\t\t\tclassName='fixed inset-0 z-[100] overflow-y-auto'\n\t\t\t\t>\n\t\t\t\t\t<div className={join('flex min-h-screen items-center justify-center p-4', containerClassName)}>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={join('fixed inset-0 bg-black/20 transition-all', overlayClassName)}\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\tif (!disableCloseOnOverlayClick) {\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t{contentOnly && <div className={join('relative w-fit', className)}>{children}</div>}\n\n\t\t\t\t\t\t{!contentOnly && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tid={modalId}\n\t\t\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\t\t\tclassName={join(\n\t\t\t\t\t\t\t\t\t'relative w-full max-w-xl transform rounded-lg shadow-xl bg-popover text-popover-foreground transition-all p-6 focus:ring ease-in',\n\t\t\t\t\t\t\t\t\tshow ? 'opacity-100 scale-100' : 'opacity-0 scale-90',\n\t\t\t\t\t\t\t\t\tclassName\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{!hideCloseButton && (\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\ttype='button'\n\t\t\t\t\t\t\t\t\t\tonClick={onClose}\n\t\t\t\t\t\t\t\t\t\tdata-modal-close-button='true'\n\t\t\t\t\t\t\t\t\t\tclassName='rounded-md p-0.5 top-2.5 right-2.5 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0'\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<X size={18} />\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t\t\t{renderTitle()}\n\n\t\t\t\t\t\t\t\t{children}\n\n\t\t\t\t\t\t\t\t{renderActions()}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</div>,\n\t\t\t\tdocument.body\n\t\t\t)}\n\t\t</>\n\t);\n}\n","import React, { useMemo } from 'react';\nimport { Modal, ModalProps } from '../modal';\n\ninterface BaseActionModalProps extends Omit<ModalProps, 'children' | 'actions'> {\n /** The main content/message to display in the modal. */\n message: React.ReactNode;\n /** Whether to style the confirm button with destructive/danger styling. */\n destructive?: boolean;\n}\n\ninterface AlertModalProps extends BaseActionModalProps {\n /** The type of action modal - alert shows only OK, confirm shows OK and Cancel. */\n type: 'alert';\n /** Custom text for the confirm/OK button. */\n confirmText?: string;\n /** Callback fired when the confirm/OK button is clicked. */\n onConfirm?: () => void;\n // Cancel-related props are not allowed for alerts\n cancelText?: never;\n}\n\ninterface ConfirmModalProps extends BaseActionModalProps {\n /** The type of action modal - alert shows only OK, confirm shows OK and Cancel. */\n type: 'confirm';\n /** Custom text for the confirm/OK button. */\n confirmText?: string;\n /** Custom text for the cancel button (only for confirm type). */\n cancelText?: string;\n /** Callback fired when the confirm/OK button is clicked. */\n onConfirm?: () => void;\n}\n\nexport type ActionModalProps = AlertModalProps | ConfirmModalProps;\n\n/**\n * A modal dialog for user confirmation or alerts with predefined action buttons.\n * Supports both alert (single OK button) and confirm (OK + Cancel buttons) modes.\n * \n * @example\n * ```tsx\n * // Alert modal\n * <ActionModal\n * type=\"alert\"\n * message=\"Operation completed successfully!\"\n * onClose={() => setShowModal(false)}\n * isOpen={showModal}\n * />\n * \n * // Confirmation modal\n * <ActionModal\n * type=\"confirm\"\n * message=\"Are you sure you want to delete this item?\"\n * destructive\n * onConfirm={() => deleteItem()}\n * onClose={() => setShowModal(false)}\n * isOpen={showModal}\n * />\n * ```\n */\nexport function ActionModal({\n type,\n message,\n cancelText,\n confirmText,\n onConfirm,\n onClose,\n destructive = false,\n title,\n ...modalProps\n}: ActionModalProps) {\n const defaultTexts = useMemo(() => {\n if (type === 'confirm') {\n return {\n confirm: confirmText || 'Confirm',\n cancel: cancelText || 'Cancel',\n defaultTitle: title || 'Confirm Action',\n };\n }\n return {\n confirm: confirmText || 'OK',\n cancel: null,\n defaultTitle: title || 'Alert',\n };\n }, [type, confirmText, title, cancelText]);\n\n const actions: ModalProps['actions'] = useMemo(\n () => [\n ...(defaultTexts.cancel\n ? [\n {\n label: defaultTexts.cancel,\n variant: 'secondary' as const,\n onClick: onClose,\n },\n ]\n : []),\n {\n label: defaultTexts.confirm,\n variant: destructive ? 'destructive' : 'primary',\n onClick: () => {\n onConfirm?.();\n onClose();\n },\n },\n ],\n [defaultTexts, destructive, onConfirm, onClose]\n );\n\n return (\n <Modal\n {...modalProps}\n title={title || defaultTexts.defaultTitle}\n onClose={onClose}\n actions={actions}\n disableCloseOnOverlayClick={type === 'confirm'}\n hideCloseButton={type === 'confirm'}\n >\n {typeof message === 'string' ? <p className='text-sm'>{message}</p> : message}\n </Modal>\n );\n}\n","import { createContext, useContext } from 'react';\n\nexport interface DropdownMenuContextFocus {\n level: number;\n index: number;\n}\n\nexport interface DropdownMenuContextValue {\n id: string;\n focus: DropdownMenuContextFocus | null;\n setFocus: (focus: DropdownMenuContextFocus | null) => void;\n isOpen: boolean;\n onItemSelect: (value: string) => void;\n onClose: () => void;\n className?: string;\n}\n\nexport const DropdownMenuContext = createContext<DropdownMenuContextValue | null>(null);\n\nexport const useDropdownMenuContext = () => {\n const context = useContext(DropdownMenuContext);\n if (!context) {\n throw new Error('DropdownMenu components must be used within a DropdownMenu component');\n }\n return context;\n};\n","import { createContext, useContext } from 'react';\nimport { TabsVariant, TabsWidth } from './variants';\n\nexport interface TabsContextValue {\n selectedValue: string;\n onValueChange: (value: string) => void;\n tabsWidth: TabsWidth;\n variant: TabsVariant;\n triggersClassName?: string;\n contentClassName?: string;\n}\n\nexport const TabsContext = createContext<TabsContextValue | null>(null);\n\nexport const useTabsContext = () => {\n const context = useContext(TabsContext);\n if (!context) {\n throw new Error('Tabs components must be used within a Tabs component');\n }\n return context;\n};\n","import { ReactNode, useCallback, useEffect, useState } from 'react';\nimport { CrossCircled, ExclamationTriangle, InfoCircled, X } from '../../symbols';\nimport { join } from '../../utils';\nexport type ToastType = 'info' | 'warning' | 'error';\n\nexport interface ToastAction {\n label: string;\n onClick: () => void;\n}\n\n/** Data for a toast notification */\nexport interface ToastData {\n /** Unique identifier for the toast */\n id: string;\n /** The main message text for the toast */\n title: string;\n /** Optional secondary message text */\n description?: string;\n /** The type of toast which determines styling and icon. Can be extended with customTypes */\n type?: ToastType;\n /** Optional action button configuration */\n action?: ToastAction;\n /** Duration in milliseconds before auto-dismiss. Set to 0 to disable auto-dismiss */\n duration?: number;\n /** Callback fired when the toast is removed */\n onRemove?: (id: string) => void;\n}\n\ninterface ToastProps extends ToastData {\n customTypes?: Record<string, { className: string; icon?: ReactNode }>;\n customComponent?: React.ComponentType<ToastData>;\n}\n\nconst defaultTypeStyles: Record<ToastType, { className: string; icon: ReactNode }> = {\n info: {\n className: 'bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100',\n icon: <InfoCircled size={20} />,\n },\n warning: {\n className:\n 'bg-yellow-50 border-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:border-yellow-950 dark:text-yellow-100',\n icon: <ExclamationTriangle size={20} />,\n },\n error: {\n className: 'bg-red-50 border-red-200 text-red-900 dark:bg-red-800 dark:border-red-950 dark:text-red-100',\n icon: <CrossCircled size={20} />,\n },\n};\n\n/**\n * A notification toast component for displaying temporary messages to users.\n * Supports different types, actions, and auto-dismissal with customizable styling.\n * \n * @example\n * ```tsx\n * // Basic toast\n * <Toast\n * id=\"notification-1\"\n * title=\"Success!\"\n * description=\"Your changes have been saved.\"\n * type=\"info\"\n * />\n * \n * // Toast with action button\n * <Toast\n * id=\"undo-toast\"\n * title=\"Item deleted\"\n * action={{ label: \"Undo\", onClick: restoreItem }}\n * duration={5000}\n * />\n * \n * // Warning toast with custom duration\n * <Toast\n * id=\"warning-toast\"\n * title=\"Connection lost\"\n * description=\"Trying to reconnect...\"\n * type=\"warning\"\n * duration={0}\n * />\n * ```\n */\nexport function Toast({\n id,\n title,\n description,\n type = 'info',\n action,\n duration = 5000,\n onRemove,\n customTypes,\n customComponent: CustomComponent,\n}: ToastProps) {\n const [isExiting, setIsExiting] = useState(false);\n\n const handleRemove = useCallback(() => {\n setIsExiting(true);\n setTimeout(() => {\n onRemove?.(id);\n }, 150); // Match animation duration\n }, [id, onRemove]);\n\n useEffect(() => {\n if (duration > 0) {\n const timer = setTimeout(() => {\n handleRemove();\n }, duration);\n\n return () => clearTimeout(timer);\n }\n }, [duration, id, onRemove, handleRemove]);\n\n if (CustomComponent) {\n return (\n <CustomComponent\n id={id}\n title={title}\n description={description}\n type={type}\n action={action}\n duration={duration}\n onRemove={onRemove}\n />\n );\n }\n\n // Check custom types first, then fall back to default\n const typeStyle = customTypes?.[type] || defaultTypeStyles[type as ToastType] || defaultTypeStyles.info;\n\n return (\n <div\n role={type === 'error' ? 'alert' : 'status'}\n aria-live={type === 'error' ? undefined : 'polite'}\n className={join(\n 'relative flex items-start p-4 rounded-lg border shadow-lg transition-all ease-in-out',\n action && 'pb-3',\n typeStyle.className,\n isExiting ? 'opacity-0 translate-x-full' : 'opacity-100 translate-x-0'\n )}\n >\n {/* Icon */}\n <div className='flex-shrink-0 mr-3'>{typeStyle.icon}</div>\n\n {/* Content */}\n <div className='flex-grow min-w-0'>\n <div className='font-medium text-sm leading-5'>{title}</div>\n {description && <div className='mt-1 text-sm opacity-90 leading-5'>{description}</div>}\n {action && (\n <div className='mt-1.5'>\n <button\n onClick={action.onClick}\n className='text-sm font-medium underline hover:no-underline focus:outline-none focus:ring-1 focus:ring-current rounded px-1 py-0.5 hover:cursor-pointer'\n >\n {action.label}\n </button>\n </div>\n )}\n </div>\n\n {/* Close button */}\n <button\n onClick={handleRemove}\n className='flex-shrink-0 ml-3 p-1 rounded-md hover:bg-black/10 dark:hover:bg-white/10 focus:outline-none focus:ring-1 focus:ring-current leading-0'\n >\n <X size={16} />\n </button>\n </div>\n );\n}\n"],"names":["LoadingDots","activeIndex","setActiveIndex","useState","useEffect","interval","prevIndex","jsx","index","join","buttonVariants","sizeVariants","roundedVariants","buttonDefaults","Button","variant","size","rounded","loading","className","rest","adjustedSize","buttonClasses","buttonRest","getButtonChildren","React","child","childrenProps","jsxs","useAnimationOpenClose","isOpen","show","setShow","shouldRender","setShouldRender","useDocumentChanges","onClose","handleEscape","e","useHandleFocus","modalId","previousActiveElement","useRef","focusAppropriateElement","useCallback","modalElement","modalActions","focusableElements","allBesidesCloseButton","el","Modal","id","title","children","contentOnly","overlayClassName","containerClassName","hideCloseButton","actions","disableCloseOnOverlayClick","ariaLabelledBy","ariaDescribedBy","generatedId","useId","titleId","renderTitle","renderActions","action","label","buttonProps","Fragment","createPortal","X","ActionModal","type","message","cancelText","confirmText","onConfirm","destructive","modalProps","defaultTexts","useMemo","DropdownMenuContext","createContext","useDropdownMenuContext","context","useContext","TabsContext","useTabsContext","defaultTypeStyles","InfoCircled","ExclamationTriangle","CrossCircled","Toast","description","duration","onRemove","customTypes","CustomComponent","isExiting","setIsExiting","handleRemove","timer","typeStyle"],"mappings":"2JAYO,SAASA,GAAc,CAC5B,KAAM,CAACC,EAAaC,CAAc,EAAIC,EAAAA,SAAS,CAAC,EAEhDC,OAAAA,EAAAA,UAAU,IAAM,CACR,MAAAC,EAAW,YAAY,IAAM,CACjCH,EAAgBI,IAAeA,EAAY,GAAK,CAAC,GAChD,GAAG,EAEC,MAAA,IAAM,cAAcD,CAAQ,CACrC,EAAG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AAK,CAAA,GAEhC,CAACP,EAAU7C,EAAI8C,EAAUK,CAAY,CAAC,EAErCH,EAEA,OAAA5F,EAAA,IAAC4F,EAAA,CACC,GAAAhD,EACA,MAAAC,EACA,YAAA2C,EACA,KAAArB,EACA,OAAAP,EACA,SAAA6B,EACA,SAAAC,CAAA,CACF,EAKJ,MAAMO,GAAYN,GAAA,YAAAA,EAAcxB,KAASgB,EAAkBhB,CAAiB,GAAKgB,EAAkB,KAGjG,OAAA9D,EAAA,KAAC,MAAA,CACC,KAAM8C,IAAS,QAAU,QAAU,SACnC,YAAWA,IAAS,QAAU,OAAY,SAC1C,UAAWjE,EAAA,KACT,uFACA0D,GAAU,OACVqC,EAAU,UACVJ,EAAY,6BAA+B,2BAC7C,EAGA,SAAA,CAAA7F,EAAA,IAAC,MAAI,CAAA,UAAU,qBAAsB,SAAAiG,EAAU,KAAK,EAGpD5E,EAAAA,KAAC,MAAI,CAAA,UAAU,oBACb,SAAA,CAACrB,EAAA,IAAA,MAAA,CAAI,UAAU,gCAAiC,SAAM6C,EAAA,EACrD2C,GAAexF,EAAA,IAAC,MAAI,CAAA,UAAU,oCAAqC,SAAYwF,EAAA,EAC/E5B,GACC5D,EAAA,IAAC,MAAI,CAAA,UAAU,SACb,SAAAA,EAAA,IAAC,SAAA,CACC,QAAS4D,EAAO,QAChB,UAAU,+IAET,SAAOA,EAAA,KAAA,CAAA,CAEZ,CAAA,CAAA,EAEJ,EAGA5D,EAAA,IAAC,SAAA,CACC,QAAS+F,EACT,UAAU,0IAEV,SAAA/F,EAAAA,IAACiE,EAAAA,EAAE,CAAA,KAAM,EAAI,CAAA,CAAA,CAAA,CACf,CAAA,CACF,CAEJ"}
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
import { jsx as r, jsxs as h, Fragment as q } from "react/jsx-runtime";
|
|
2
|
+
import y, { useState as v, useEffect as g, useRef as H, useCallback as T, useId as $, useMemo as E, createContext as I, useContext as z } from "react";
|
|
3
|
+
import { createPortal as F } from "react-dom";
|
|
4
|
+
import { X as M, C as K, E as X, I as _ } from "./X-CIoyLewf.js";
|
|
5
|
+
import { j as f } from "./join-BmgR_f4v.js";
|
|
6
|
+
function G() {
|
|
7
|
+
const [e, a] = v(0);
|
|
8
|
+
return g(() => {
|
|
9
|
+
const n = setInterval(() => {
|
|
10
|
+
a((t) => (t + 1) % 3);
|
|
11
|
+
}, 500);
|
|
12
|
+
return () => clearInterval(n);
|
|
13
|
+
}, []), /* @__PURE__ */ r("div", { className: "absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle", children: [0, 1, 2].map((n) => /* @__PURE__ */ r(
|
|
14
|
+
"div",
|
|
15
|
+
{
|
|
16
|
+
className: f(
|
|
17
|
+
"rounded-full transition-all ease-in-out size-[0.35em] bg-current",
|
|
18
|
+
e === n && "transform -translate-y-1"
|
|
19
|
+
)
|
|
20
|
+
},
|
|
21
|
+
n
|
|
22
|
+
)) });
|
|
23
|
+
}
|
|
24
|
+
const J = {
|
|
25
|
+
base: "focus:outline-current",
|
|
26
|
+
primary: "bg-primary text-primary-foreground hover:bg-primary/80 focus:outline-primary outline-offset-2 disabled:bg-muted disabled:text-muted-foreground",
|
|
27
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 focus:outline-secondary outline-offset-2 disabled:bg-muted/80 disabled:text-muted-foreground/80",
|
|
28
|
+
tertiary: "text-primary hover:text-primary/80 disabled:text-muted-foreground focus:outline-primary",
|
|
29
|
+
outline: "border border-primary text-primary hover:border-primary/80 hover:text-primary/80 focus:outline-primary outline-offset-2 disabled:border-muted-foreground disabled:text-muted-foreground",
|
|
30
|
+
link: "underline-offset-4 hover:underline disabled:underline disabled:text-muted-foreground focus:underline",
|
|
31
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/80 focus:outline-destructive outline-offset-2 disabled:bg-muted disabled:text-muted-foreground"
|
|
32
|
+
}, Q = {
|
|
33
|
+
stripped: "",
|
|
34
|
+
fitted: "size-fit leading-0",
|
|
35
|
+
sm: "px-2 py-1 text-sm",
|
|
36
|
+
md: "px-4 py-2 text-base",
|
|
37
|
+
lg: "px-6 py-3 text-lg",
|
|
38
|
+
icon: "p-1 w-fit aspect-square",
|
|
39
|
+
full: "p-2 w-full"
|
|
40
|
+
}, R = {
|
|
41
|
+
none: "rounded-none",
|
|
42
|
+
sm: "rounded-sm",
|
|
43
|
+
md: "rounded-md",
|
|
44
|
+
lg: "rounded-lg",
|
|
45
|
+
full: "rounded-full"
|
|
46
|
+
}, k = {
|
|
47
|
+
variant: "primary",
|
|
48
|
+
size: "md",
|
|
49
|
+
rounded: "md"
|
|
50
|
+
};
|
|
51
|
+
function U({
|
|
52
|
+
variant: e = k.variant,
|
|
53
|
+
size: a,
|
|
54
|
+
rounded: n = k.rounded,
|
|
55
|
+
loading: t,
|
|
56
|
+
className: l,
|
|
57
|
+
...o
|
|
58
|
+
}) {
|
|
59
|
+
let s;
|
|
60
|
+
e === "link" && !a ? s = "fitted" : s = a || k.size;
|
|
61
|
+
const u = f(
|
|
62
|
+
"appearance-none not-disabled:hover:cursor-pointer outline outline-transparent disabled:opacity-50 disabled:cursor-not-allowed transition-all inline-flex items-center justify-center gap-0.5",
|
|
63
|
+
J[e],
|
|
64
|
+
Q[s],
|
|
65
|
+
R[n],
|
|
66
|
+
t && "relative pointer-events-none",
|
|
67
|
+
l
|
|
68
|
+
);
|
|
69
|
+
if (o.href && !o.disabled)
|
|
70
|
+
return /* @__PURE__ */ r(
|
|
71
|
+
"a",
|
|
72
|
+
{
|
|
73
|
+
...o,
|
|
74
|
+
rel: o.rel ? o.rel : o.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
75
|
+
"aria-label": o["aria-label"],
|
|
76
|
+
"aria-description": o["aria-description"],
|
|
77
|
+
href: o.href,
|
|
78
|
+
className: u,
|
|
79
|
+
children: o.children
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
const i = o, m = () => i.children ? typeof i.children == "string" || typeof i.children == "number" || typeof i.children == "boolean" ? /* @__PURE__ */ r("span", { className: f(t && "invisible"), children: i.children }) : y.Children.map(i.children, (c, p) => {
|
|
83
|
+
if (y.isValidElement(c)) {
|
|
84
|
+
const x = c.props;
|
|
85
|
+
return y.cloneElement(c, {
|
|
86
|
+
key: p,
|
|
87
|
+
className: f(t && "invisible", x.className)
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
return c;
|
|
91
|
+
}) : null;
|
|
92
|
+
return /* @__PURE__ */ h(
|
|
93
|
+
"button",
|
|
94
|
+
{
|
|
95
|
+
...i,
|
|
96
|
+
"aria-label": i["aria-label"],
|
|
97
|
+
"aria-description": i["aria-description"],
|
|
98
|
+
"aria-disabled": i.disabled || t,
|
|
99
|
+
"aria-busy": t,
|
|
100
|
+
type: i.type ?? "button",
|
|
101
|
+
className: u,
|
|
102
|
+
children: [
|
|
103
|
+
t && /* @__PURE__ */ r(G, {}),
|
|
104
|
+
m()
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
function W(e) {
|
|
110
|
+
const [a, n] = v(!1), [t, l] = v(!1);
|
|
111
|
+
return g(() => {
|
|
112
|
+
e ? (l(!0), setTimeout(() => n(!0), 10)) : (n(!1), setTimeout(() => l(!1), 150));
|
|
113
|
+
}, [e]), { show: a, shouldRender: t };
|
|
114
|
+
}
|
|
115
|
+
function Y(e, a) {
|
|
116
|
+
g(() => {
|
|
117
|
+
const n = (t) => {
|
|
118
|
+
t.key === "Escape" && e && a();
|
|
119
|
+
};
|
|
120
|
+
return document.addEventListener("keydown", n), e && (document.body.style.overflow = "hidden"), () => {
|
|
121
|
+
document.removeEventListener("keydown", n), document.body.style.overflow = "auto";
|
|
122
|
+
};
|
|
123
|
+
}, [e, a]);
|
|
124
|
+
}
|
|
125
|
+
function Z(e, a) {
|
|
126
|
+
const n = H(null), t = T(() => {
|
|
127
|
+
const l = document.getElementById(e);
|
|
128
|
+
if (!l) return;
|
|
129
|
+
const o = l.querySelectorAll('[data-modal-action="true"]');
|
|
130
|
+
if (o.length > 0) {
|
|
131
|
+
o[0].focus();
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
const s = l.querySelectorAll(
|
|
135
|
+
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
136
|
+
);
|
|
137
|
+
if (s.length > 0) {
|
|
138
|
+
const d = Array.from(s).filter((u) => !(u instanceof HTMLButtonElement && u.getAttribute("data-modal-close-button") === "true"));
|
|
139
|
+
if (d.length > 0) {
|
|
140
|
+
d[0].focus();
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
s[0].focus();
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
l.focus();
|
|
147
|
+
}, [e]);
|
|
148
|
+
g(() => (a && (n.current = document.activeElement, t()), () => {
|
|
149
|
+
document.body.style.overflow = "auto", n.current instanceof HTMLElement && n.current.focus();
|
|
150
|
+
}), [a, t]);
|
|
151
|
+
}
|
|
152
|
+
function O({
|
|
153
|
+
id: e,
|
|
154
|
+
isOpen: a,
|
|
155
|
+
onClose: n,
|
|
156
|
+
title: t,
|
|
157
|
+
children: l,
|
|
158
|
+
contentOnly: o = !1,
|
|
159
|
+
className: s,
|
|
160
|
+
overlayClassName: d,
|
|
161
|
+
containerClassName: u,
|
|
162
|
+
hideCloseButton: i = !1,
|
|
163
|
+
actions: m = [],
|
|
164
|
+
disableCloseOnOverlayClick: b = !1,
|
|
165
|
+
ariaLabelledBy: c,
|
|
166
|
+
ariaDescribedBy: p
|
|
167
|
+
}) {
|
|
168
|
+
const x = $(), N = e || `modal-${x}`, C = e ? `${e}-title` : `modal-title-${x}`, { show: j, shouldRender: w } = W(a);
|
|
169
|
+
if (Z(N, w), Y(w, n), !w) return null;
|
|
170
|
+
const B = () => t ? y.isValidElement(t) ? /* @__PURE__ */ r("div", { className: "mb-4", children: t }) : /* @__PURE__ */ r("h2", { className: "mb-4 text-xl font-semibold", id: C, children: t }) : null, D = () => m.length === 0 ? null : /* @__PURE__ */ r("div", { className: "mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3", children: m.map((S, L) => {
|
|
171
|
+
const { label: V, ...P } = S;
|
|
172
|
+
return /* @__PURE__ */ r(U, { ...P, "data-modal-action": "true", children: V }, L);
|
|
173
|
+
}) });
|
|
174
|
+
return /* @__PURE__ */ r(q, { children: F(
|
|
175
|
+
/* @__PURE__ */ r(
|
|
176
|
+
"div",
|
|
177
|
+
{
|
|
178
|
+
"aria-labelledby": c ?? t ? C : void 0,
|
|
179
|
+
"aria-describedby": p,
|
|
180
|
+
role: "dialog",
|
|
181
|
+
"aria-modal": "true",
|
|
182
|
+
className: "fixed inset-0 z-[100] overflow-y-auto",
|
|
183
|
+
children: /* @__PURE__ */ h("div", { className: f("flex min-h-screen items-center justify-center p-4", u), children: [
|
|
184
|
+
/* @__PURE__ */ r(
|
|
185
|
+
"div",
|
|
186
|
+
{
|
|
187
|
+
className: f("fixed inset-0 bg-black/20 transition-all", d),
|
|
188
|
+
onClick: () => {
|
|
189
|
+
b || n();
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
),
|
|
193
|
+
o && /* @__PURE__ */ r("div", { className: f("relative w-fit", s), children: l }),
|
|
194
|
+
!o && /* @__PURE__ */ h(
|
|
195
|
+
"div",
|
|
196
|
+
{
|
|
197
|
+
id: N,
|
|
198
|
+
tabIndex: -1,
|
|
199
|
+
className: f(
|
|
200
|
+
"relative w-full max-w-xl transform rounded-lg shadow-xl bg-popover text-popover-foreground transition-all p-6 focus:ring ease-in",
|
|
201
|
+
j ? "opacity-100 scale-100" : "opacity-0 scale-90",
|
|
202
|
+
s
|
|
203
|
+
),
|
|
204
|
+
children: [
|
|
205
|
+
!i && /* @__PURE__ */ r(
|
|
206
|
+
"button",
|
|
207
|
+
{
|
|
208
|
+
type: "button",
|
|
209
|
+
onClick: n,
|
|
210
|
+
"data-modal-close-button": "true",
|
|
211
|
+
className: "rounded-md p-0.5 top-2.5 right-2.5 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0",
|
|
212
|
+
children: /* @__PURE__ */ r(M, { size: 18 })
|
|
213
|
+
}
|
|
214
|
+
),
|
|
215
|
+
B(),
|
|
216
|
+
l,
|
|
217
|
+
D()
|
|
218
|
+
]
|
|
219
|
+
}
|
|
220
|
+
)
|
|
221
|
+
] })
|
|
222
|
+
}
|
|
223
|
+
),
|
|
224
|
+
document.body
|
|
225
|
+
) });
|
|
226
|
+
}
|
|
227
|
+
function se({
|
|
228
|
+
type: e,
|
|
229
|
+
message: a,
|
|
230
|
+
cancelText: n,
|
|
231
|
+
confirmText: t,
|
|
232
|
+
onConfirm: l,
|
|
233
|
+
onClose: o,
|
|
234
|
+
destructive: s = !1,
|
|
235
|
+
title: d,
|
|
236
|
+
...u
|
|
237
|
+
}) {
|
|
238
|
+
const i = E(() => e === "confirm" ? {
|
|
239
|
+
confirm: t || "Confirm",
|
|
240
|
+
cancel: n || "Cancel",
|
|
241
|
+
defaultTitle: d || "Confirm Action"
|
|
242
|
+
} : {
|
|
243
|
+
confirm: t || "OK",
|
|
244
|
+
cancel: null,
|
|
245
|
+
defaultTitle: d || "Alert"
|
|
246
|
+
}, [e, t, d, n]), m = E(
|
|
247
|
+
() => [
|
|
248
|
+
...i.cancel ? [
|
|
249
|
+
{
|
|
250
|
+
label: i.cancel,
|
|
251
|
+
variant: "secondary",
|
|
252
|
+
onClick: o
|
|
253
|
+
}
|
|
254
|
+
] : [],
|
|
255
|
+
{
|
|
256
|
+
label: i.confirm,
|
|
257
|
+
variant: s ? "destructive" : "primary",
|
|
258
|
+
onClick: () => {
|
|
259
|
+
l == null || l(), o();
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
],
|
|
263
|
+
[i, s, l, o]
|
|
264
|
+
);
|
|
265
|
+
return /* @__PURE__ */ r(
|
|
266
|
+
O,
|
|
267
|
+
{
|
|
268
|
+
...u,
|
|
269
|
+
title: d || i.defaultTitle,
|
|
270
|
+
onClose: o,
|
|
271
|
+
actions: m,
|
|
272
|
+
disableCloseOnOverlayClick: e === "confirm",
|
|
273
|
+
hideCloseButton: e === "confirm",
|
|
274
|
+
children: typeof a == "string" ? /* @__PURE__ */ r("p", { className: "text-sm", children: a }) : a
|
|
275
|
+
}
|
|
276
|
+
);
|
|
277
|
+
}
|
|
278
|
+
const ee = I(null), de = () => {
|
|
279
|
+
const e = z(ee);
|
|
280
|
+
if (!e)
|
|
281
|
+
throw new Error("DropdownMenu components must be used within a DropdownMenu component");
|
|
282
|
+
return e;
|
|
283
|
+
}, te = I(null), ue = () => {
|
|
284
|
+
const e = z(te);
|
|
285
|
+
if (!e)
|
|
286
|
+
throw new Error("Tabs components must be used within a Tabs component");
|
|
287
|
+
return e;
|
|
288
|
+
}, A = {
|
|
289
|
+
info: {
|
|
290
|
+
className: "bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100",
|
|
291
|
+
icon: /* @__PURE__ */ r(_, { size: 20 })
|
|
292
|
+
},
|
|
293
|
+
warning: {
|
|
294
|
+
className: "bg-yellow-50 border-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:border-yellow-950 dark:text-yellow-100",
|
|
295
|
+
icon: /* @__PURE__ */ r(X, { size: 20 })
|
|
296
|
+
},
|
|
297
|
+
error: {
|
|
298
|
+
className: "bg-red-50 border-red-200 text-red-900 dark:bg-red-800 dark:border-red-950 dark:text-red-100",
|
|
299
|
+
icon: /* @__PURE__ */ r(K, { size: 20 })
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
function ce({
|
|
303
|
+
id: e,
|
|
304
|
+
title: a,
|
|
305
|
+
description: n,
|
|
306
|
+
type: t = "info",
|
|
307
|
+
action: l,
|
|
308
|
+
duration: o = 5e3,
|
|
309
|
+
onRemove: s,
|
|
310
|
+
customTypes: d,
|
|
311
|
+
customComponent: u
|
|
312
|
+
}) {
|
|
313
|
+
const [i, m] = v(!1), b = T(() => {
|
|
314
|
+
m(!0), setTimeout(() => {
|
|
315
|
+
s == null || s(e);
|
|
316
|
+
}, 150);
|
|
317
|
+
}, [e, s]);
|
|
318
|
+
if (g(() => {
|
|
319
|
+
if (o > 0) {
|
|
320
|
+
const p = setTimeout(() => {
|
|
321
|
+
b();
|
|
322
|
+
}, o);
|
|
323
|
+
return () => clearTimeout(p);
|
|
324
|
+
}
|
|
325
|
+
}, [o, e, s, b]), u)
|
|
326
|
+
return /* @__PURE__ */ r(
|
|
327
|
+
u,
|
|
328
|
+
{
|
|
329
|
+
id: e,
|
|
330
|
+
title: a,
|
|
331
|
+
description: n,
|
|
332
|
+
type: t,
|
|
333
|
+
action: l,
|
|
334
|
+
duration: o,
|
|
335
|
+
onRemove: s
|
|
336
|
+
}
|
|
337
|
+
);
|
|
338
|
+
const c = (d == null ? void 0 : d[t]) || A[t] || A.info;
|
|
339
|
+
return /* @__PURE__ */ h(
|
|
340
|
+
"div",
|
|
341
|
+
{
|
|
342
|
+
role: t === "error" ? "alert" : "status",
|
|
343
|
+
"aria-live": t === "error" ? void 0 : "polite",
|
|
344
|
+
className: f(
|
|
345
|
+
"relative flex items-start p-4 rounded-lg border shadow-lg transition-all ease-in-out",
|
|
346
|
+
l && "pb-3",
|
|
347
|
+
c.className,
|
|
348
|
+
i ? "opacity-0 translate-x-full" : "opacity-100 translate-x-0"
|
|
349
|
+
),
|
|
350
|
+
children: [
|
|
351
|
+
/* @__PURE__ */ r("div", { className: "flex-shrink-0 mr-3", children: c.icon }),
|
|
352
|
+
/* @__PURE__ */ h("div", { className: "flex-grow min-w-0", children: [
|
|
353
|
+
/* @__PURE__ */ r("div", { className: "font-medium text-sm leading-5", children: a }),
|
|
354
|
+
n && /* @__PURE__ */ r("div", { className: "mt-1 text-sm opacity-90 leading-5", children: n }),
|
|
355
|
+
l && /* @__PURE__ */ r("div", { className: "mt-1.5", children: /* @__PURE__ */ r(
|
|
356
|
+
"button",
|
|
357
|
+
{
|
|
358
|
+
onClick: l.onClick,
|
|
359
|
+
className: "text-sm font-medium underline hover:no-underline focus:outline-none focus:ring-1 focus:ring-current rounded px-1 py-0.5 hover:cursor-pointer",
|
|
360
|
+
children: l.label
|
|
361
|
+
}
|
|
362
|
+
) })
|
|
363
|
+
] }),
|
|
364
|
+
/* @__PURE__ */ r(
|
|
365
|
+
"button",
|
|
366
|
+
{
|
|
367
|
+
onClick: b,
|
|
368
|
+
className: "flex-shrink-0 ml-3 p-1 rounded-md hover:bg-black/10 dark:hover:bg-white/10 focus:outline-none focus:ring-1 focus:ring-current leading-0",
|
|
369
|
+
children: /* @__PURE__ */ r(M, { size: 16 })
|
|
370
|
+
}
|
|
371
|
+
)
|
|
372
|
+
]
|
|
373
|
+
}
|
|
374
|
+
);
|
|
375
|
+
}
|
|
376
|
+
export {
|
|
377
|
+
se as A,
|
|
378
|
+
U as B,
|
|
379
|
+
ee as D,
|
|
380
|
+
G as L,
|
|
381
|
+
O as M,
|
|
382
|
+
ce as T,
|
|
383
|
+
ue as a,
|
|
384
|
+
te as b,
|
|
385
|
+
de as u
|
|
386
|
+
};
|
|
387
|
+
//# sourceMappingURL=Toast-Cj5L6xNo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Toast-Cj5L6xNo.js","sources":["../src/components/button/LoadingDots.tsx","../src/components/button/variants.ts","../src/components/button/Button.tsx","../src/components/modal/hooks.ts","../src/components/modal/Modal.tsx","../src/components/actionmodal/ActionModal.tsx","../src/components/dropdown-menu/DropdownContext.tsx","../src/components/tabs/TabsContext.tsx","../src/components/toast/Toast.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { join } from '../../utils';\n\n/**\n * An animated loading indicator with three bouncing dots.\n * Used internally by Button component to show loading state.\n * \n * @example\n * ```tsx\n * <LoadingDots />\n * ```\n */\nexport function LoadingDots() {\n const [activeIndex, setActiveIndex] = useState(0);\n\n useEffect(() => {\n const interval = setInterval(() => {\n setActiveIndex((prevIndex) => (prevIndex + 1) % 3);\n }, 500);\n\n return () => clearInterval(interval);\n }, []);\n\n return (\n <div className='absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle'>\n {[0, 1, 2].map((index) => (\n <div\n key={index}\n className={join(\n 'rounded-full transition-all ease-in-out size-[0.35em] bg-current',\n activeIndex === index && 'transform -translate-y-1'\n )}\n />\n ))}\n </div>\n );\n}","export const buttonVariants = {\n base: 'focus:outline-current',\n primary: 'bg-primary text-primary-foreground hover:bg-primary/80 focus:outline-primary outline-offset-2 disabled:bg-muted disabled:text-muted-foreground',\n secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80 focus:outline-secondary outline-offset-2 disabled:bg-muted/80 disabled:text-muted-foreground/80',\n tertiary: 'text-primary hover:text-primary/80 disabled:text-muted-foreground focus:outline-primary',\n outline: 'border border-primary text-primary hover:border-primary/80 hover:text-primary/80 focus:outline-primary outline-offset-2 disabled:border-muted-foreground disabled:text-muted-foreground',\n link: 'underline-offset-4 hover:underline disabled:underline disabled:text-muted-foreground focus:underline',\n destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/80 focus:outline-destructive outline-offset-2 disabled:bg-muted disabled:text-muted-foreground',\n} as const;\nexport type ButtonVariant = keyof typeof buttonVariants;\n\nexport const sizeVariants = {\n stripped: '',\n fitted: 'size-fit leading-0',\n sm: 'px-2 py-1 text-sm',\n md: 'px-4 py-2 text-base',\n lg: 'px-6 py-3 text-lg',\n icon: 'p-1 w-fit aspect-square',\n full: 'p-2 w-full',\n} as const;\nexport type ButtonSize = keyof typeof sizeVariants;\n\nexport const roundedVariants = {\n none: 'rounded-none',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n full: 'rounded-full',\n} as const;\nexport type ButtonRounded = keyof typeof roundedVariants;\n\nexport interface ButtonVariants {\n /** The visual style variant of the button. */\n variant: ButtonVariant;\n /** The size of the button. */\n size: ButtonSize;\n /** The border radius of the button. */\n rounded: ButtonRounded;\n}\n\nexport const buttonDefaults: ButtonVariants = {\n variant: 'primary',\n size: 'md',\n rounded: 'md',\n} as const;\n","// Button.tsx\nimport React, { ButtonHTMLAttributes, Ref } from 'react';\nimport { join } from '../../utils';\nimport { LoadingDots } from './LoadingDots';\nimport { ButtonSize, ButtonVariants, buttonDefaults, buttonVariants, roundedVariants, sizeVariants } from './variants';\n\ninterface ButtonButtonProps extends Partial<ButtonVariants>, ButtonHTMLAttributes<HTMLButtonElement> {\n\thref?: never;\n\t/** Reference to the button element. */\n\tref?: Ref<HTMLButtonElement>;\n\t/** Whether the button is in a loading state. */\n\tloading?: boolean;\n}\n\ninterface ButtonLinkProps\n\textends Partial<ButtonVariants>,\n\t\tOmit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'role'> {\n\t/** When provided, renders the button as a link. */\n\thref: string;\n\t/** Reference to the anchor element. */\n\tref?: Ref<HTMLAnchorElement>;\n\tloading?: never;\n\t/** Whether the button is disabled. */\n\tdisabled?: boolean;\n}\n\nexport type ButtonProps = ButtonButtonProps | ButtonLinkProps;\n\n/**\n * A versatile button component that can render as either a button or anchor element.\n * Supports loading states, various visual variants, and accessibility features.\n * \n * @example\n * ```tsx\n * // Regular button\n * <Button variant=\"primary\" onClick={() => save()}>Save</Button>\n * \n * // Loading state\n * <Button loading variant=\"primary\">Processing...</Button>\n * \n * // Link button\n * <Button href=\"/dashboard\" variant=\"secondary\">Go to Dashboard</Button>\n * ```\n */\nexport function Button({\n\tvariant = buttonDefaults.variant,\n\tsize,\n\trounded = buttonDefaults.rounded,\n\tloading,\n\tclassName,\n\t...rest\n}: ButtonProps) {\n\tlet adjustedSize: ButtonSize;\n\tif (variant === 'link' && !size) {\n\t\t// default links to fitted size\n\t\tadjustedSize = 'fitted';\n\t} else {\n\t\tadjustedSize = size || buttonDefaults.size;\n\t}\n\n\tconst baseClasses =\n\t\t'appearance-none not-disabled:hover:cursor-pointer outline outline-transparent disabled:opacity-50 disabled:cursor-not-allowed transition-all inline-flex items-center justify-center gap-0.5';\n\n\tconst buttonClasses = join(\n\t\tbaseClasses,\n\t\tbuttonVariants[variant],\n\t\tsizeVariants[adjustedSize],\n\t\troundedVariants[rounded],\n\t\tloading && 'relative pointer-events-none',\n\t\tclassName\n\t);\n\n\tif (rest.href && !rest.disabled) {\n\t\treturn (\n\t\t\t<a\n\t\t\t\t{...rest}\n\t\t\t\trel={rest.rel ? rest.rel : rest.target === '_blank' ? 'noopener noreferrer' : undefined}\n\t\t\t\taria-label={rest['aria-label']}\n\t\t\t\taria-description={rest['aria-description']}\n\t\t\t\thref={rest.href}\n\t\t\t\tclassName={buttonClasses}\n\t\t\t>\n\t\t\t\t{rest.children}\n\t\t\t</a>\n\t\t);\n\t}\n\n\tconst buttonRest = rest as ButtonButtonProps; // necessary to cast to avoid TS complaining\n\tconst getButtonChildren = () => {\n\t\tif (!buttonRest.children) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (\n\t\t\ttypeof buttonRest.children === 'string' ||\n\t\t\ttypeof buttonRest.children === 'number' ||\n\t\t\ttypeof buttonRest.children === 'boolean'\n\t\t) {\n\t\t\treturn <span className={join(loading && 'invisible')}>{buttonRest.children}</span>;\n\t\t}\n\n\t\tconst clonedChildren = React.Children.map(buttonRest.children, (child, index) => {\n\t\t\tif (React.isValidElement(child)) {\n\t\t\t\tconst childrenProps = child.props as { className?: string };\n\t\t\t\treturn React.cloneElement(child, {\n\t\t\t\t\tkey: index,\n\t\t\t\t\tclassName: join(loading && 'invisible', childrenProps.className),\n\t\t\t\t} as Record<string, unknown>);\n\t\t\t}\n\t\t\treturn child;\n\t\t});\n\t\treturn clonedChildren;\n\t};\n\n\treturn (\n\t\t<button\n\t\t\t{...buttonRest}\n\t\t\taria-label={buttonRest['aria-label']}\n\t\t\taria-description={buttonRest['aria-description']}\n\t\t\taria-disabled={buttonRest.disabled || loading}\n\t\t\taria-busy={loading}\n\t\t\ttype={buttonRest.type ?? 'button'}\n\t\t\tclassName={buttonClasses}\n\t\t>\n\t\t\t{loading && <LoadingDots />}\n\t\t\t{getButtonChildren()}\n\t\t</button>\n\t);\n}\n","import { useCallback, useEffect, useRef, useState } from 'react';\n\nexport function useAnimationOpenClose(isOpen: boolean) {\n const [show, setShow] = useState(false);\n const [shouldRender, setShouldRender] = useState(false);\n\n useEffect(() => {\n if (isOpen) {\n setShouldRender(true);\n setTimeout(() => setShow(true), 10);\n } else {\n setShow(false);\n setTimeout(() => setShouldRender(false), 150);\n }\n }, [isOpen]);\n\n return { show, shouldRender };\n}\n\nexport function useDocumentChanges(isOpen: boolean, onClose: () => void) {\n useEffect(() => {\n const handleEscape = (e: KeyboardEvent) => {\n if (e.key === 'Escape' && isOpen) {\n onClose();\n }\n };\n\n document.addEventListener('keydown', handleEscape);\n // Prevent background scrolling when modal is open\n if (isOpen) {\n document.body.style.overflow = 'hidden';\n }\n\n return () => {\n document.removeEventListener('keydown', handleEscape);\n document.body.style.overflow = 'auto';\n };\n }, [isOpen, onClose]);\n}\n\nexport function useHandleFocus(modalId: string, isOpen: boolean) {\n const previousActiveElement = useRef<Element | null>(null);\n\n const focusAppropriateElement = useCallback(() => {\n const modalElement = document.getElementById(modalId);\n if (!modalElement) return;\n\n // 1. First, try to focus on the first action button, if available\n const modalActions = modalElement.querySelectorAll('[data-modal-action=\"true\"]');\n if (modalActions.length > 0) {\n (modalActions[0] as HTMLElement).focus();\n return;\n }\n\n // 2. Then try first focusable element in content (giving preference to non-close button)\n const focusableElements = modalElement.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n );\n\n if (focusableElements.length > 0) {\n const allBesidesCloseButton = Array.from(focusableElements).filter((el) => {\n return !(el instanceof HTMLButtonElement && el.getAttribute('data-modal-close-button') === 'true');\n });\n\n if (allBesidesCloseButton.length > 0) {\n (allBesidesCloseButton[0] as HTMLElement).focus();\n return;\n }\n\n (focusableElements[0] as HTMLElement).focus();\n return;\n }\n\n // 3. Fallback to modal container\n modalElement.focus();\n }, [modalId]);\n\n useEffect(() => {\n if (isOpen) {\n // Store the currently focused element to restore focus later\n previousActiveElement.current = document.activeElement;\n\n focusAppropriateElement();\n }\n\n return () => {\n document.body.style.overflow = 'auto';\n\n // Restore focus to the previously focused element when modal closes\n if (previousActiveElement.current instanceof HTMLElement) {\n previousActiveElement.current.focus();\n }\n };\n }, [isOpen, focusAppropriateElement]);\n}\n","import React, { useId } from 'react';\nimport { createPortal } from 'react-dom';\nimport { X } from '../../symbols';\nimport { Button, ButtonProps } from '../button';\nimport { useAnimationOpenClose, useDocumentChanges, useHandleFocus } from './hooks';\nimport { join } from '../../utils';\n\ninterface ModalAction extends Omit<ButtonProps, 'children'> {\n\t/** The text label for the action button. */\n\tlabel: string;\n}\n\nexport interface ModalProps {\n\t/** Optional ID for the modal element. */\n\tid?: string;\n\t/** Whether the modal is open. */\n\tisOpen: boolean;\n\t/** Callback fired when the modal should close. */\n\tonClose: () => void;\n\t/** Optional title for the modal header. */\n\ttitle?: React.ReactNode;\n\t/** The content to display inside the modal. */\n\tchildren: React.ReactNode;\n\t/** When true, renders only the children with no default modal styling. */\n\tcontentOnly?: boolean;\n\t/** Additional CSS classes to apply to the modal content. */\n\tclassName?: string;\n\t/** Additional CSS classes to apply to the backdrop overlay. */\n\toverlayClassName?: string;\n\t/** Additional CSS classes to apply to the modal container. */\n\tcontainerClassName?: string;\n\t/** Whether to hide the X close button in the top-right corner. */\n\thideCloseButton?: boolean;\n\t/** Array of action buttons to display at the bottom of the modal. */\n\tactions?: ModalAction[];\n\t/** Whether clicking the backdrop/overlay closes the modal. */\n\tdisableCloseOnOverlayClick?: boolean;\n\t/** ID of an element that labels the modal. */\n\tariaLabelledBy?: string;\n\t/** ID of an element that describes the modal. */\n\tariaDescribedBy?: string;\n}\n\n/**\n * A flexible modal dialog component with focus management, animation, and action buttons.\n * Supports both styled and content-only modes with comprehensive accessibility features.\n * \n * @example\n * ```tsx\n * // Basic modal\n * <Modal\n * isOpen={showModal}\n * onClose={() => setShowModal(false)}\n * title=\"Confirm Action\"\n * >\n * <p>Are you sure you want to proceed?</p>\n * </Modal>\n * \n * // Modal with actions\n * <Modal\n * isOpen={showDeleteModal}\n * onClose={handleClose}\n * title=\"Delete Item\"\n * actions={[\n * { label: \"Cancel\", variant: \"secondary\", onClick: handleClose },\n * { label: \"Delete\", variant: \"destructive\", onClick: handleDelete }\n * ]}\n * disableCloseOnOverlayClick\n * >\n * <p>This action cannot be undone.</p>\n * </Modal>\n * ```\n */\nexport function Modal({\n\tid,\n\tisOpen,\n\tonClose,\n\ttitle,\n\tchildren,\n\tcontentOnly = false,\n\tclassName,\n\toverlayClassName,\n\tcontainerClassName,\n\thideCloseButton = false,\n\tactions = [],\n\tdisableCloseOnOverlayClick = false,\n\tariaLabelledBy,\n\tariaDescribedBy,\n}: ModalProps) {\n\tconst generatedId = useId();\n\tconst modalId = id || `modal-${generatedId}`;\n\tconst titleId = id ? `${id}-title` : `modal-title-${generatedId}`;\n\n\tconst { show, shouldRender } = useAnimationOpenClose(isOpen);\n\tuseHandleFocus(modalId, shouldRender);\n\tuseDocumentChanges(shouldRender, onClose);\n\n\tif (!shouldRender) return null;\n\n\tconst renderTitle = () => {\n\t\tif (!title) return null;\n\n\t\tif (React.isValidElement(title)) {\n\t\t\treturn <div className='mb-4'>{title}</div>;\n\t\t}\n\n\t\treturn (\n\t\t\t<h2 className='mb-4 text-xl font-semibold' id={titleId}>\n\t\t\t\t{title}\n\t\t\t</h2>\n\t\t);\n\t};\n\n\tconst renderActions = () => {\n\t\tif (actions.length === 0) return null;\n\n\t\treturn (\n\t\t\t<div className='mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3'>\n\t\t\t\t{actions.map((action, index) => {\n\t\t\t\t\tconst { label, ...rest } = action;\n\t\t\t\t\tconst buttonProps = rest as ButtonProps;\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button key={index} {...buttonProps} data-modal-action='true'>\n\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</div>\n\t\t);\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t{createPortal(\n\t\t\t\t<div\n\t\t\t\t\taria-labelledby={ariaLabelledBy ?? title ? titleId : undefined}\n\t\t\t\t\taria-describedby={ariaDescribedBy}\n\t\t\t\t\trole='dialog'\n\t\t\t\t\taria-modal='true'\n\t\t\t\t\tclassName='fixed inset-0 z-[100] overflow-y-auto'\n\t\t\t\t>\n\t\t\t\t\t<div className={join('flex min-h-screen items-center justify-center p-4', containerClassName)}>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={join('fixed inset-0 bg-black/20 transition-all', overlayClassName)}\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\tif (!disableCloseOnOverlayClick) {\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t{contentOnly && <div className={join('relative w-fit', className)}>{children}</div>}\n\n\t\t\t\t\t\t{!contentOnly && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tid={modalId}\n\t\t\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\t\t\tclassName={join(\n\t\t\t\t\t\t\t\t\t'relative w-full max-w-xl transform rounded-lg shadow-xl bg-popover text-popover-foreground transition-all p-6 focus:ring ease-in',\n\t\t\t\t\t\t\t\t\tshow ? 'opacity-100 scale-100' : 'opacity-0 scale-90',\n\t\t\t\t\t\t\t\t\tclassName\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{!hideCloseButton && (\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\ttype='button'\n\t\t\t\t\t\t\t\t\t\tonClick={onClose}\n\t\t\t\t\t\t\t\t\t\tdata-modal-close-button='true'\n\t\t\t\t\t\t\t\t\t\tclassName='rounded-md p-0.5 top-2.5 right-2.5 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0'\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<X size={18} />\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t\t\t{renderTitle()}\n\n\t\t\t\t\t\t\t\t{children}\n\n\t\t\t\t\t\t\t\t{renderActions()}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</div>,\n\t\t\t\tdocument.body\n\t\t\t)}\n\t\t</>\n\t);\n}\n","import React, { useMemo } from 'react';\nimport { Modal, ModalProps } from '../modal';\n\ninterface BaseActionModalProps extends Omit<ModalProps, 'children' | 'actions'> {\n /** The main content/message to display in the modal. */\n message: React.ReactNode;\n /** Whether to style the confirm button with destructive/danger styling. */\n destructive?: boolean;\n}\n\ninterface AlertModalProps extends BaseActionModalProps {\n /** The type of action modal - alert shows only OK, confirm shows OK and Cancel. */\n type: 'alert';\n /** Custom text for the confirm/OK button. */\n confirmText?: string;\n /** Callback fired when the confirm/OK button is clicked. */\n onConfirm?: () => void;\n // Cancel-related props are not allowed for alerts\n cancelText?: never;\n}\n\ninterface ConfirmModalProps extends BaseActionModalProps {\n /** The type of action modal - alert shows only OK, confirm shows OK and Cancel. */\n type: 'confirm';\n /** Custom text for the confirm/OK button. */\n confirmText?: string;\n /** Custom text for the cancel button (only for confirm type). */\n cancelText?: string;\n /** Callback fired when the confirm/OK button is clicked. */\n onConfirm?: () => void;\n}\n\nexport type ActionModalProps = AlertModalProps | ConfirmModalProps;\n\n/**\n * A modal dialog for user confirmation or alerts with predefined action buttons.\n * Supports both alert (single OK button) and confirm (OK + Cancel buttons) modes.\n * \n * @example\n * ```tsx\n * // Alert modal\n * <ActionModal\n * type=\"alert\"\n * message=\"Operation completed successfully!\"\n * onClose={() => setShowModal(false)}\n * isOpen={showModal}\n * />\n * \n * // Confirmation modal\n * <ActionModal\n * type=\"confirm\"\n * message=\"Are you sure you want to delete this item?\"\n * destructive\n * onConfirm={() => deleteItem()}\n * onClose={() => setShowModal(false)}\n * isOpen={showModal}\n * />\n * ```\n */\nexport function ActionModal({\n type,\n message,\n cancelText,\n confirmText,\n onConfirm,\n onClose,\n destructive = false,\n title,\n ...modalProps\n}: ActionModalProps) {\n const defaultTexts = useMemo(() => {\n if (type === 'confirm') {\n return {\n confirm: confirmText || 'Confirm',\n cancel: cancelText || 'Cancel',\n defaultTitle: title || 'Confirm Action',\n };\n }\n return {\n confirm: confirmText || 'OK',\n cancel: null,\n defaultTitle: title || 'Alert',\n };\n }, [type, confirmText, title, cancelText]);\n\n const actions: ModalProps['actions'] = useMemo(\n () => [\n ...(defaultTexts.cancel\n ? [\n {\n label: defaultTexts.cancel,\n variant: 'secondary' as const,\n onClick: onClose,\n },\n ]\n : []),\n {\n label: defaultTexts.confirm,\n variant: destructive ? 'destructive' : 'primary',\n onClick: () => {\n onConfirm?.();\n onClose();\n },\n },\n ],\n [defaultTexts, destructive, onConfirm, onClose]\n );\n\n return (\n <Modal\n {...modalProps}\n title={title || defaultTexts.defaultTitle}\n onClose={onClose}\n actions={actions}\n disableCloseOnOverlayClick={type === 'confirm'}\n hideCloseButton={type === 'confirm'}\n >\n {typeof message === 'string' ? <p className='text-sm'>{message}</p> : message}\n </Modal>\n );\n}\n","import { createContext, useContext } from 'react';\n\nexport interface DropdownMenuContextFocus {\n level: number;\n index: number;\n}\n\nexport interface DropdownMenuContextValue {\n id: string;\n focus: DropdownMenuContextFocus | null;\n setFocus: (focus: DropdownMenuContextFocus | null) => void;\n isOpen: boolean;\n onItemSelect: (value: string) => void;\n onClose: () => void;\n className?: string;\n}\n\nexport const DropdownMenuContext = createContext<DropdownMenuContextValue | null>(null);\n\nexport const useDropdownMenuContext = () => {\n const context = useContext(DropdownMenuContext);\n if (!context) {\n throw new Error('DropdownMenu components must be used within a DropdownMenu component');\n }\n return context;\n};\n","import { createContext, useContext } from 'react';\nimport { TabsVariant, TabsWidth } from './variants';\n\nexport interface TabsContextValue {\n selectedValue: string;\n onValueChange: (value: string) => void;\n tabsWidth: TabsWidth;\n variant: TabsVariant;\n triggersClassName?: string;\n contentClassName?: string;\n}\n\nexport const TabsContext = createContext<TabsContextValue | null>(null);\n\nexport const useTabsContext = () => {\n const context = useContext(TabsContext);\n if (!context) {\n throw new Error('Tabs components must be used within a Tabs component');\n }\n return context;\n};\n","import { ReactNode, useCallback, useEffect, useState } from 'react';\nimport { CrossCircled, ExclamationTriangle, InfoCircled, X } from '../../symbols';\nimport { join } from '../../utils';\nexport type ToastType = 'info' | 'warning' | 'error';\n\nexport interface ToastAction {\n label: string;\n onClick: () => void;\n}\n\n/** Data for a toast notification */\nexport interface ToastData {\n /** Unique identifier for the toast */\n id: string;\n /** The main message text for the toast */\n title: string;\n /** Optional secondary message text */\n description?: string;\n /** The type of toast which determines styling and icon. Can be extended with customTypes */\n type?: ToastType;\n /** Optional action button configuration */\n action?: ToastAction;\n /** Duration in milliseconds before auto-dismiss. Set to 0 to disable auto-dismiss */\n duration?: number;\n /** Callback fired when the toast is removed */\n onRemove?: (id: string) => void;\n}\n\ninterface ToastProps extends ToastData {\n customTypes?: Record<string, { className: string; icon?: ReactNode }>;\n customComponent?: React.ComponentType<ToastData>;\n}\n\nconst defaultTypeStyles: Record<ToastType, { className: string; icon: ReactNode }> = {\n info: {\n className: 'bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100',\n icon: <InfoCircled size={20} />,\n },\n warning: {\n className:\n 'bg-yellow-50 border-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:border-yellow-950 dark:text-yellow-100',\n icon: <ExclamationTriangle size={20} />,\n },\n error: {\n className: 'bg-red-50 border-red-200 text-red-900 dark:bg-red-800 dark:border-red-950 dark:text-red-100',\n icon: <CrossCircled size={20} />,\n },\n};\n\n/**\n * A notification toast component for displaying temporary messages to users.\n * Supports different types, actions, and auto-dismissal with customizable styling.\n * \n * @example\n * ```tsx\n * // Basic toast\n * <Toast\n * id=\"notification-1\"\n * title=\"Success!\"\n * description=\"Your changes have been saved.\"\n * type=\"info\"\n * />\n * \n * // Toast with action button\n * <Toast\n * id=\"undo-toast\"\n * title=\"Item deleted\"\n * action={{ label: \"Undo\", onClick: restoreItem }}\n * duration={5000}\n * />\n * \n * // Warning toast with custom duration\n * <Toast\n * id=\"warning-toast\"\n * title=\"Connection lost\"\n * description=\"Trying to reconnect...\"\n * type=\"warning\"\n * duration={0}\n * />\n * ```\n */\nexport function Toast({\n id,\n title,\n description,\n type = 'info',\n action,\n duration = 5000,\n onRemove,\n customTypes,\n customComponent: CustomComponent,\n}: ToastProps) {\n const [isExiting, setIsExiting] = useState(false);\n\n const handleRemove = useCallback(() => {\n setIsExiting(true);\n setTimeout(() => {\n onRemove?.(id);\n }, 150); // Match animation duration\n }, [id, onRemove]);\n\n useEffect(() => {\n if (duration > 0) {\n const timer = setTimeout(() => {\n handleRemove();\n }, duration);\n\n return () => clearTimeout(timer);\n }\n }, [duration, id, onRemove, handleRemove]);\n\n if (CustomComponent) {\n return (\n <CustomComponent\n id={id}\n title={title}\n description={description}\n type={type}\n action={action}\n duration={duration}\n onRemove={onRemove}\n />\n );\n }\n\n // Check custom types first, then fall back to default\n const typeStyle = customTypes?.[type] || defaultTypeStyles[type as ToastType] || defaultTypeStyles.info;\n\n return (\n <div\n role={type === 'error' ? 'alert' : 'status'}\n aria-live={type === 'error' ? undefined : 'polite'}\n className={join(\n 'relative flex items-start p-4 rounded-lg border shadow-lg transition-all ease-in-out',\n action && 'pb-3',\n typeStyle.className,\n isExiting ? 'opacity-0 translate-x-full' : 'opacity-100 translate-x-0'\n )}\n >\n {/* Icon */}\n <div className='flex-shrink-0 mr-3'>{typeStyle.icon}</div>\n\n {/* Content */}\n <div className='flex-grow min-w-0'>\n <div className='font-medium text-sm leading-5'>{title}</div>\n {description && <div className='mt-1 text-sm opacity-90 leading-5'>{description}</div>}\n {action && (\n <div className='mt-1.5'>\n <button\n onClick={action.onClick}\n className='text-sm font-medium underline hover:no-underline focus:outline-none focus:ring-1 focus:ring-current rounded px-1 py-0.5 hover:cursor-pointer'\n >\n {action.label}\n </button>\n </div>\n )}\n </div>\n\n {/* Close button */}\n <button\n onClick={handleRemove}\n className='flex-shrink-0 ml-3 p-1 rounded-md hover:bg-black/10 dark:hover:bg-white/10 focus:outline-none focus:ring-1 focus:ring-current leading-0'\n >\n <X size={16} />\n </button>\n </div>\n );\n}\n"],"names":["LoadingDots","activeIndex","setActiveIndex","useState","useEffect","interval","prevIndex","jsx","index","join","buttonVariants","sizeVariants","roundedVariants","buttonDefaults","Button","variant","size","rounded","loading","className","rest","adjustedSize","buttonClasses","buttonRest","getButtonChildren","React","child","childrenProps","jsxs","useAnimationOpenClose","isOpen","show","setShow","shouldRender","setShouldRender","useDocumentChanges","onClose","handleEscape","e","useHandleFocus","modalId","previousActiveElement","useRef","focusAppropriateElement","useCallback","modalElement","modalActions","focusableElements","allBesidesCloseButton","el","Modal","id","title","children","contentOnly","overlayClassName","containerClassName","hideCloseButton","actions","disableCloseOnOverlayClick","ariaLabelledBy","ariaDescribedBy","generatedId","useId","titleId","renderTitle","renderActions","action","label","Fragment","createPortal","X","ActionModal","type","message","cancelText","confirmText","onConfirm","destructive","modalProps","defaultTexts","useMemo","DropdownMenuContext","createContext","useDropdownMenuContext","context","useContext","TabsContext","useTabsContext","defaultTypeStyles","InfoCircled","ExclamationTriangle","CrossCircled","Toast","description","duration","onRemove","customTypes","CustomComponent","isExiting","setIsExiting","handleRemove","timer","typeStyle"],"mappings":";;;;;AAYO,SAASA,IAAc;AAC5B,QAAM,CAACC,GAAaC,CAAc,IAAIC,EAAS,CAAC;AAEhD,SAAAC,EAAU,MAAM;AACR,UAAAC,IAAW,YAAY,MAAM;AACjC,MAAAH,EAAe,CAACI,OAAeA,IAAY,KAAK,CAAC;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