@xploreu/components 0.1.6 → 0.2.0

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.
Files changed (45) hide show
  1. package/dist/{chunk-VFZXA6DY.js → chunk-2TUGHMFW.js} +2 -2
  2. package/dist/chunk-2TUGHMFW.js.map +1 -0
  3. package/dist/chunk-52U7K5UV.js +2 -0
  4. package/dist/chunk-52U7K5UV.js.map +1 -0
  5. package/dist/chunk-5YDJTHDG.js +2 -0
  6. package/dist/chunk-5YDJTHDG.js.map +1 -0
  7. package/dist/{chunk-P4RPQUEL.js → chunk-AMNHVMRK.js} +2 -2
  8. package/dist/chunk-AMNHVMRK.js.map +1 -0
  9. package/dist/{chunk-CPQOX4RR.js → chunk-GDXL7UNV.js} +2 -2
  10. package/dist/chunk-GDXL7UNV.js.map +1 -0
  11. package/dist/{chunk-MF7T3OYE.js → chunk-KYD4ATTG.js} +2 -2
  12. package/dist/chunk-KYD4ATTG.js.map +1 -0
  13. package/dist/chunk-XK5GMNOS.js +2 -0
  14. package/dist/chunk-XK5GMNOS.js.map +1 -0
  15. package/dist/{chunk-ZXAHA7TB.js → chunk-ZVME3JB3.js} +2 -2
  16. package/dist/chunk-ZVME3JB3.js.map +1 -0
  17. package/dist/effects/auto-height.js +1 -1
  18. package/dist/effects/highlight.js +1 -1
  19. package/dist/effects/index.js +1 -1
  20. package/dist/primitives/dialog.d.ts +17 -17
  21. package/dist/primitives/dialog.js +1 -1
  22. package/dist/primitives/index.d.ts +2 -2
  23. package/dist/primitives/index.js +1 -1
  24. package/dist/primitives/slot.d.ts +2 -2
  25. package/dist/primitives/slot.js +1 -1
  26. package/dist/primitives/tabs.js +1 -1
  27. package/dist/ui/button.d.ts +2 -3
  28. package/dist/ui/button.js +1 -1
  29. package/dist/ui/dialog.d.ts +6 -6
  30. package/dist/ui/dialog.js +1 -1
  31. package/dist/ui/index.d.ts +4 -3
  32. package/dist/ui/index.js +1 -1
  33. package/dist/ui/tabs.js +1 -1
  34. package/package.json +7 -5
  35. package/dist/chunk-CJONAIBS.js +0 -2
  36. package/dist/chunk-CJONAIBS.js.map +0 -1
  37. package/dist/chunk-CPQOX4RR.js.map +0 -1
  38. package/dist/chunk-MF7T3OYE.js.map +0 -1
  39. package/dist/chunk-P4RPQUEL.js.map +0 -1
  40. package/dist/chunk-VFZXA6DY.js.map +0 -1
  41. package/dist/chunk-X57LUCWV.js +0 -2
  42. package/dist/chunk-X57LUCWV.js.map +0 -1
  43. package/dist/chunk-YMSEOWKF.js +0 -2
  44. package/dist/chunk-YMSEOWKF.js.map +0 -1
  45. package/dist/chunk-ZXAHA7TB.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import*as s from'react';import {isMotionComponent,motion}from'motion/react';import {cn}from'@xploreu/lib/cn';import {jsx}from'react/jsx-runtime';function c(...e){return t=>{e.forEach(n=>{n&&(typeof n=="function"?n(t):n.current=t);});}}function f(e,t){let n={...e,...t};return (e.className||t.className)&&(n.className=cn(e.className,t.className)),(e.style||t.style)&&(n.style={...e.style,...t.style}),n}function u({children:e,ref:t,...n}){let o=typeof e.type=="object"&&e.type!==null&&isMotionComponent(e.type),a=s.useMemo(()=>o?e.type:motion.create(e.type),[o,e.type]);if(!s.isValidElement(e))return null;let{ref:r,...p}=e.props,i=f(p,n);return jsx(a,{...i,ref:c(r,t)})}export{u as a};//# sourceMappingURL=chunk-VFZXA6DY.js.map
2
- //# sourceMappingURL=chunk-VFZXA6DY.js.map
1
+ import*as s from'react';import {isMotionComponent,motion}from'motion/react';import {cn}from'@xploreu/lib/cn';import {jsx}from'react/jsx-runtime';function c(...e){return t=>{e.forEach(n=>{n&&(typeof n=="function"?n(t):n.current=t);});}}function f(e,t){let n={...e,...t};return (e.className||t.className)&&(n.className=cn(e.className,t.className)),(e.style||t.style)&&(n.style={...e.style,...t.style}),n}function u({children:e,ref:t,...n}){let o=typeof e.type=="object"&&e.type!==null&&isMotionComponent(e.type),a=s.useMemo(()=>o?e.type:motion.create(e.type),[o,e.type]);if(!s.isValidElement(e))return null;let{ref:r,...p}=e.props,y=f(p,n);return jsx(a,{...y,ref:c(r,t)})}export{u as a};//# sourceMappingURL=chunk-2TUGHMFW.js.map
2
+ //# sourceMappingURL=chunk-2TUGHMFW.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/primitives/slot.tsx"],"names":["mergeRefs","refs","node","ref","mergeProps","childProps","slotProps","merged","cn","Slot","children","props","isAlreadyMotion","isMotionComponent","Base","motion","childRef","mergedProps","jsx"],"mappings":"iJA4BA,SAASA,CAAAA,CAAAA,GACJC,CAAAA,CACmB,CACtB,OAAQC,CAAAA,EAAS,CACfD,CAAAA,CAAK,OAAA,CAASE,GAAQ,CACfA,CAAAA,GACD,OAAOA,CAAAA,EAAQ,WACjBA,CAAAA,CAAID,CAAI,CAAA,CAEPC,CAAAA,CAAkC,QAAUD,CAAAA,EAEjD,CAAC,EACH,CACF,CAEA,SAASE,CAAAA,CACPC,CAAAA,CACAC,CAAAA,CACU,CACV,IAAMC,CAAAA,CAAmB,CAAE,GAAGF,EAAY,GAAGC,CAAU,CAAA,CAEvD,OAAA,CAAID,EAAW,SAAA,EAAaC,CAAAA,CAAU,SAAA,IACpCC,CAAAA,CAAO,UAAYC,EAAAA,CACjBH,CAAAA,CAAW,SAAA,CACXC,CAAAA,CAAU,SACZ,CAAA,CAAA,CAAA,CAGED,CAAAA,CAAW,KAAA,EAASC,CAAAA,CAAU,SAChCC,CAAAA,CAAO,KAAA,CAAQ,CACb,GAAIF,EAAW,KAAA,CACf,GAAIC,CAAAA,CAAU,KAChB,GAGKC,CACT,CAEA,SAASE,CAAAA,CAA0C,CACjD,QAAA,CAAAC,CAAAA,CACA,GAAA,CAAAP,CAAAA,CACA,GAAGQ,CACL,CAAA,CAAiB,CACf,IAAMC,EACJ,OAAOF,CAAAA,CAAS,IAAA,EAAS,QAAA,EACzBA,EAAS,IAAA,GAAS,IAAA,EAClBG,iBAAAA,CAAkBH,CAAAA,CAAS,IAAI,CAAA,CAE3BI,CAAAA,CAAa,CAAA,CAAA,OAAA,CACjB,IACEF,EACKF,CAAAA,CAAS,IAAA,CACVK,MAAAA,CAAO,MAAA,CAAOL,EAAS,IAAyB,CAAA,CACtD,CAACE,CAAAA,CAAiBF,EAAS,IAAI,CACjC,CAAA,CAEA,GAAI,CAAO,CAAA,CAAA,cAAA,CAAeA,CAAQ,CAAA,CAAG,OAAO,KAE5C,GAAM,CAAE,GAAA,CAAKM,CAAAA,CAAU,GAAGX,CAAW,CAAA,CAAIK,CAAAA,CAAS,KAAA,CAE5CO,EAAcb,CAAAA,CAAWC,CAAAA,CAAYM,CAAK,CAAA,CAEhD,OAEEO,GAAAA,CAACJ,CAAAA,CAAA,CACE,GAAGG,EACJ,GAAA,CAAKjB,CAAAA,CAAUgB,CAAAA,CAA0Bb,CAAG,EAC9C,CAEJ","file":"chunk-2TUGHMFW.js","sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\n\r\nimport {\r\n type HTMLMotionProps,\r\n isMotionComponent,\r\n motion\r\n} from \"motion/react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\n\r\ntype AnyProps = Record<string, unknown>\r\n\r\ntype DOMMotionProps<T extends HTMLElement = HTMLElement> = Omit<\r\n HTMLMotionProps<Extract<keyof HTMLElementTagNameMap, keyof typeof motion>>,\r\n \"ref\"\r\n> & { ref?: React.Ref<T> }\r\n\r\ntype WithAsChild<Base extends object> =\r\n | (Base & { asChild: true; children: React.ReactElement })\r\n | (Base & { asChild?: false | undefined })\r\n\r\ntype SlotProps<T extends HTMLElement = HTMLElement> = {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n children?: any;\r\n} & DOMMotionProps<T>\r\n\r\nfunction mergeRefs<T>(\r\n ...refs: (React.Ref<T> | undefined)[]\r\n): React.RefCallback<T> {\r\n return (node) => {\r\n refs.forEach((ref) => {\r\n if (!ref) return\r\n if (typeof ref === \"function\") {\r\n ref(node)\r\n } else {\r\n (ref as React.RefObject<T | null>).current = node\r\n }\r\n })\r\n }\r\n}\r\n\r\nfunction mergeProps<T extends HTMLElement>(\r\n childProps: AnyProps,\r\n slotProps: DOMMotionProps<T>,\r\n): AnyProps {\r\n const merged: AnyProps = { ...childProps, ...slotProps }\r\n\r\n if (childProps.className || slotProps.className) {\r\n merged.className = cn(\r\n childProps.className as string,\r\n slotProps.className as string,\r\n )\r\n }\r\n\r\n if (childProps.style || slotProps.style) {\r\n merged.style = {\r\n ...(childProps.style as React.CSSProperties),\r\n ...(slotProps.style as React.CSSProperties),\r\n }\r\n }\r\n\r\n return merged\r\n}\r\n\r\nfunction Slot<T extends HTMLElement = HTMLElement>({\r\n children,\r\n ref,\r\n ...props\r\n}: SlotProps<T>) {\r\n const isAlreadyMotion =\r\n typeof children.type === \"object\" &&\r\n children.type !== null &&\r\n isMotionComponent(children.type)\r\n\r\n const Base = React.useMemo(\r\n () =>\r\n isAlreadyMotion\r\n ? (children.type as React.ElementType)\r\n : motion.create(children.type as React.ElementType),\r\n [isAlreadyMotion, children.type],\r\n )\r\n\r\n if (!React.isValidElement(children)) return null\r\n\r\n const { ref: childRef, ...childProps } = children.props as AnyProps\r\n\r\n const mergedProps = mergeProps(childProps, props)\r\n\r\n return (\r\n // eslint-disable-next-line react-hooks/static-components\r\n <Base\r\n {...mergedProps}\r\n ref={mergeRefs(childRef as React.Ref<T>, ref)}\r\n />\r\n )\r\n}\r\n\r\nexport {\r\n type AnyProps,\r\n type DOMMotionProps,\r\n Slot,\r\n type SlotProps,\r\n type WithAsChild,\r\n}"]}
@@ -0,0 +1,2 @@
1
+ import {b,c,g,d,f,h as h$1,i,j,k,e}from'./chunk-5YDJTHDG.js';import'react';import {XIcon}from'lucide-react';import {cn}from'@xploreu/lib/cn';import {jsx,jsxs}from'react/jsx-runtime';function h(o){return jsx(b,{...o})}function _(o){return jsx(c,{...o})}function w(o){return jsx(g,{...o})}function x({className:o,...i}){return jsx(e,{className:cn("fixed inset-0 z-50 bg-black/50 backdrop-blur-sm",o),...i})}function H({className:o,children:i,showCloseButton:d$1=true,closeClassName:u,onCloseClick:v,...y}){return jsxs(d,{children:[jsx(x,{}),jsxs(f,{className:cn("fixed left-[50%] top-[50%] z-105 grid w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border-primary bg-bg-primary p-6 shadow-xp-lg rounded-xp-card-base overflow-hidden",o),...y,children:[i,d$1&&jsxs(g,{className:cn("ring-offset-neutral-25 focus:ring-neutral-20 data-[state=open]:bg-bg-primary data-[state=open]:text-muted-foreground absolute top-7 right-6 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-6",u),onClick:v,children:[jsx(XIcon,{}),jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function B({className:o,...i}){return jsx(h$1,{className:cn("flex flex-col gap-2 text-center sm:text-left bg-bg-primary",o),...i})}function F({className:o,...i$1}){return jsx(i,{className:cn("flex flex-col gap-2 laptop:flex-row items-center justify-between bg-bg-primary border-t shadow-[0px_16px_44px_-24px_var(--color-background-shadow-light),0px_0px_28px_0px_var(--color-background-shadow-light)] border-border-primary py-4 px-[26px]",o),...i$1})}function N({className:o,...i}){return jsx(j,{className:cn("text-center text-heading-bold-4 text-text-primary",o),...i})}function z({className:o,...i}){return jsx(k,{className:cn("text-label-semibold-3 text-text-secondary",o),...i})}export{h as a,_ as b,w as c,H as d,B as e,F as f,N as g,z as h};//# sourceMappingURL=chunk-52U7K5UV.js.map
2
+ //# sourceMappingURL=chunk-52U7K5UV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ui/dialog.tsx"],"names":["Dialog","props","jsx","DialogTrigger","DialogClose","DialogBackdrop","className","cn","DialogPopup","children","showCloseButton","closeClassName","onCloseClick","jsxs","DialogPortal","XIcon","DialogHeader","DialogFooter","Dial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AAK,GACjC,CAAA,CAAA,CAEJ,CAAA,CAAA,CACF,CAEJ,CAIA,SAASc,CAAAA,CAAa,CAAE,SAAA,CAAAV,CAAAA,CAAW,GAAGL,CAAM,CAAA,CAAsB,CAChE,OACEC,GAAAA,CAACc,GAAAA,CAAA,CACC,SAAA,CAAWT,EAAAA,CAAG,4DAAA,CAA8DD,CAAS,CAAA,CACpF,GAAGL,CAAAA,CACN,CAEJ,CAIA,SAASgB,CAAAA,CAAa,CAAE,SAAA,CAAAX,CAAAA,CAAW,GAAGL,GAAM,CAAA,CAAsB,CAChE,OACEC,GAAAA,CAACe,CAAAA,CAAA,CACC,SAAA,CAAWV,EAAAA,CACT,sPAAA,CACAD,CACF,CAAA,CACC,GAAGL,GAAAA,CACN,CAEJ,CAIA,SAASiB,EAAY,CAAE,SAAA,CAAAZ,CAAAA,CAAW,GAAGL,CAAM,CAAA,CAAqB,CAC9D,OACEC,GAAAA,CAACgB,CAAAA,CAAA,CACC,SAAA,CAAWX,EAAAA,CAAG,oDAAqDD,CAAS,CAAA,CAC3E,GAAGL,CAAAA,CACN,CAEJ,CAIA,SAASkB,CAAAA,CAAkB,CAAE,SAAA,CAAAb,CAAAA,CAAW,GAAGL,CAAM,EAA2B,CAC1E,OACEC,GAAAA,CAACiB,CAAAA,CAAA,CACC,SAAA,CAAWZ,EAAAA,CAAG,2CAAA,CAA6CD,CAAS,CAAA,CACnE,GAAGL,CAAAA,CACN,CAEJ","file":"chunk-52U7K5UV.js","sourcesContent":["import * as React from 'react';\r\nimport { XIcon } from 'lucide-react';\r\n\r\nimport {\r\n Dialog as DialogPrimitive,\r\n DialogPopup as DialogPopupPrimitive,\r\n DialogDescription as DialogDescriptionPrimitive,\r\n DialogFooter as DialogFooterPrimitive,\r\n DialogHeader as DialogHeaderPrimitive,\r\n DialogTitle as DialogTitlePrimitive,\r\n DialogTrigger as DialogTriggerPrimitive,\r\n DialogPortal as DialogPortalPrimitive,\r\n DialogBackdrop as DialogBackdropPrimitive,\r\n DialogClose as DialogClosePrimitive,\r\n type DialogProps as DialogPrimitiveProps,\r\n type DialogPopupProps as DialogPopupPrimitiveProps,\r\n type DialogDescriptionProps as DialogDescriptionPrimitiveProps,\r\n type DialogFooterProps as DialogFooterPrimitiveProps,\r\n type DialogHeaderProps as DialogHeaderPrimitiveProps,\r\n type DialogTitleProps as DialogTitlePrimitiveProps,\r\n type DialogTriggerProps as DialogTriggerPrimitiveProps,\r\n type DialogBackdropProps as DialogBackdropPrimitiveProps,\r\n type DialogCloseProps as DialogClosePrimitiveProps,\r\n} from '../primitives/dialog';\r\nimport { cn } from '@xploreu/lib/cn';\r\n\r\ntype DialogProps = DialogPrimitiveProps;\r\n\r\nfunction Dialog(props: DialogProps) {\r\n return <DialogPrimitive {...props} />;\r\n}\r\n\r\ntype DialogTriggerProps = DialogTriggerPrimitiveProps;\r\n\r\nfunction DialogTrigger(props: DialogTriggerProps) {\r\n return <DialogTriggerPrimitive {...props} />;\r\n}\r\n\r\ntype DialogCloseProps = DialogClosePrimitiveProps;\r\n\r\nfunction DialogClose(props: DialogCloseProps) {\r\n return <DialogClosePrimitive {...props} />;\r\n}\r\n\r\ntype DialogBackdropProps = DialogBackdropPrimitiveProps;\r\n\r\nfunction DialogBackdrop({ className, ...props }: DialogBackdropProps) {\r\n return (\r\n <DialogBackdropPrimitive\r\n className={cn('fixed inset-0 z-50 bg-black/50 backdrop-blur-sm', className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype DialogPopupProps = DialogPopupPrimitiveProps & {\r\n showCloseButton?: boolean;\r\n closeClassName?: string;\r\n onCloseClick?: React.MouseEventHandler;\r\n};\r\n\r\nfunction DialogPopup({\r\n className,\r\n children,\r\n showCloseButton = true,\r\n closeClassName,\r\n onCloseClick,\r\n ...props\r\n}: DialogPopupProps) {\r\n return (\r\n <DialogPortalPrimitive>\r\n <DialogBackdrop />\r\n <DialogPopupPrimitive\r\n className={cn(\r\n \"fixed left-[50%] top-[50%] z-105 grid w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border-primary bg-bg-primary p-6 shadow-xp-lg rounded-xp-card-base overflow-hidden\",\r\n className,\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n {showCloseButton && (\r\n <DialogClosePrimitive\r\n className={cn(\r\n \"ring-offset-neutral-25 focus:ring-neutral-20 data-[state=open]:bg-bg-primary data-[state=open]:text-muted-foreground absolute top-7 right-6 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-6\",\r\n closeClassName\r\n )}\r\n onClick={onCloseClick}\r\n >\r\n <XIcon />\r\n <span className=\"sr-only\">Close</span>\r\n </DialogClosePrimitive>\r\n )}\r\n </DialogPopupPrimitive>\r\n </DialogPortalPrimitive>\r\n );\r\n}\r\n\r\ntype DialogHeaderProps = DialogHeaderPrimitiveProps;\r\n\r\nfunction DialogHeader({ className, ...props }: DialogHeaderProps) {\r\n return (\r\n <DialogHeaderPrimitive\r\n className={cn(\"flex flex-col gap-2 text-center sm:text-left bg-bg-primary\", className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype DialogFooterProps = DialogFooterPrimitiveProps;\r\n\r\nfunction DialogFooter({ className, ...props }: DialogFooterProps) {\r\n return (\r\n <DialogFooterPrimitive\r\n className={cn(\r\n \"flex flex-col gap-2 laptop:flex-row items-center justify-between bg-bg-primary border-t shadow-[0px_16px_44px_-24px_var(--color-background-shadow-light),0px_0px_28px_0px_var(--color-background-shadow-light)] border-border-primary py-4 px-[26px]\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype DialogTitleProps = DialogTitlePrimitiveProps;\r\n\r\nfunction DialogTitle({ className, ...props }: DialogTitleProps) {\r\n return (\r\n <DialogTitlePrimitive\r\n className={cn(\"text-center text-heading-bold-4 text-text-primary\", className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\ntype DialogDescriptionProps = DialogDescriptionPrimitiveProps;\r\n\r\nfunction DialogDescription({ className, ...props }: DialogDescriptionProps) {\r\n return (\r\n <DialogDescriptionPrimitive\r\n className={cn(\"text-label-semibold-3 text-text-secondary\", className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nexport {\r\n Dialog,\r\n DialogTrigger,\r\n DialogClose,\r\n DialogPopup,\r\n DialogHeader,\r\n DialogFooter,\r\n DialogTitle,\r\n DialogDescription,\r\n type DialogProps,\r\n type DialogTriggerProps,\r\n type DialogCloseProps,\r\n type DialogPopupProps,\r\n type DialogHeaderProps,\r\n type DialogFooterProps,\r\n type DialogTitleProps,\r\n type DialogDescriptionProps,\r\n};"]}
@@ -0,0 +1,2 @@
1
+ import*as r from'react';import {Dialog}from'@base-ui/react/dialog';import {AnimatePresence,motion}from'motion/react';import {useControlledState}from'@xploreu/hooks/use-controlled-state';import {getStrictContext}from'@xploreu/lib/get-strict-context';import {cn}from'@xploreu/lib/cn';import {jsx}from'react/jsx-runtime';var [T,D]=getStrictContext("DialogContext");function M(o){let[i,a]=useControlledState({value:o?.open,defaultValue:o?.defaultOpen,onChange:o?.onOpenChange});return jsx(T,{value:{open:i,setOpen:a},children:jsx(Dialog.Root,{"data-slot":"dialog",...o,onOpenChange:a})})}function H(o){return jsx(Dialog.Trigger,{"data-slot":"dialog-trigger",...o})}function h(o){let{open:i}=D();return jsx(AnimatePresence,{children:i&&jsx(Dialog.Portal,{"data-slot":"dialog-portal",keepMounted:true,...o})})}function B({transition:o={duration:.2,ease:"easeInOut"},...i}){return jsx(Dialog.Backdrop,{"data-slot":"dialog-backdrop",render:jsx(motion.div,{initial:{opacity:0,filter:"blur(4px)"},animate:{opacity:1,filter:"blur(0px)"},exit:{opacity:0,filter:"blur(4px)"},transition:o,...i},"dialog-backdrop")})}function A({from:o="left",initialFocus:i,finalFocus:a,transition:P={type:"spring",stiffness:150,damping:25},className:d,...u}){let l=o==="bottom"||o==="left"?"20deg":"-20deg",p=o==="top"||o==="bottom"?"rotateX":"rotateY",[f,s]=r.useState(false),{open:g}=D();return r.useEffect(()=>{g||s(false);},[g]),jsx(Dialog.Popup,{initialFocus:i,finalFocus:a,render:jsx(motion.div,{"data-slot":"dialog-popup","data-opened":f?"":void 0,className:cn("data-[opened]:!transform-none",d),animate:{opacity:1,filter:"blur(0px)",transform:`perspective(500px) ${p}(0deg) scale(1)`},exit:{opacity:0,filter:"blur(4px)",transform:`perspective(500px) ${p}(${l}) scale(0.8)`},initial:{opacity:0,filter:"blur(4px)",transform:`perspective(500px) ${p}(${l}) scale(0.8)`},transition:P,onAnimationComplete:n=>{typeof n=="object"&&"opacity"in n&&n.opacity!==1||requestAnimationFrame(()=>{s(true);});},...u},"dialog-popup")})}function $(o){return jsx(Dialog.Close,{"data-slot":"dialog-close",...o})}function L(o){return jsx("div",{"data-slot":"dialog-header",...o})}function S(o){return jsx("div",{"data-slot":"dialog-footer",...o})}function V(o){return jsx(Dialog.Title,{"data-slot":"dialog-title",...o})}function q(o){return jsx(Dialog.Description,{"data-slot":"dialog-description",...o})}export{D as a,M as b,H as c,h as d,B as e,A as f,$ as g,L as h,S as i,V as j,q as k};//# sourceMappingURL=chunk-5YDJTHDG.js.map
2
+ //# sourceMappingURL=chunk-5YDJTHDG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/primitives/dialog.tsx"],"names":["DialogProvider","useDialog","getStrictContext","Dialog","props","open","setOpen","useControlledState","jsx","DialogPrimitive","DialogTrigger","DialogPortal","AnimatePresence","DialogBackdrop","transition","motion","DialogPopup","from","initialFocus","finalFocus","className","initialRotation","rotateAxis","opened","setOpened","cn","latest","DialogClose","DialogHeader","DialogFooter","DialogTitle","DialogDescription"],"mappings":"8TAeA,IAAM,CAACA,EAAgBC,CAAS,CAAA,CAC9BC,gBAAAA,CAAoC,eAAe,EAIrD,SAASC,EAAOC,CAAAA,CAAoB,CAClC,GAAM,CAACC,CAA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,CAAU,IAAID,CAAe,CAAA,YAAA,CAChE,EACA,OAAA,CAAS,CACP,QAAS,CAAA,CACT,MAAA,CAAQ,WAAA,CACR,SAAA,CAAW,CAAA,mBAAA,EAAsBC,CAAU,IAAID,CAAe,CAAA,YAAA,CAChE,EACA,UAAA,CAAYP,CAAAA,CACZ,oBAAsBY,CAAAA,EAAW,CAC3B,OAAOA,CAAAA,EAAW,QAAA,EAAY,YAAaA,CAAAA,EAAUA,CAAAA,CAAO,UAAY,CAAA,EAE5E,qBAAA,CAAsB,IAAM,CAC1BF,CAAAA,CAAU,IAAI,EAChB,CAAC,EACH,EACC,GAAGpB,CAAAA,CAAAA,CA3BA,cA4BN,CAAA,CAEJ,CAEJ,CAIA,SAASuB,CAAAA,CAAYvB,CAAAA,CAAyB,CAC5C,OAAOI,GAAAA,CAACC,OAAgB,KAAA,CAAhB,CAAsB,YAAU,cAAA,CAAgB,GAAGL,EAAO,CACpE,CAIA,SAASwB,CAAAA,CAAaxB,CAAAA,CAA0B,CAC9C,OAAOI,GAAAA,CAAC,KAAA,CAAA,CAAI,YAAU,eAAA,CAAiB,GAAGJ,EAAO,CACnD,CAIA,SAASyB,CAAAA,CAAazB,CAAAA,CAA0B,CAC9C,OAAOI,GAAAA,CAAC,KAAA,CAAA,CAAI,YAAU,eAAA,CAAiB,GAAGJ,EAAO,CACnD,CAIA,SAAS0B,CAAAA,CAAY1B,CAAAA,CAAyB,CAC5C,OAAOI,GAAAA,CAACC,MAAAA,CAAgB,MAAhB,CAAsB,WAAA,CAAU,eAAgB,GAAGL,CAAAA,CAAO,CACpE,CAMA,SAAS2B,CAAAA,CAAkB3B,EAA+B,CACxD,OACEI,IAACC,MAAAA,CAAgB,WAAA,CAAhB,CAA4B,WAAA,CAAU,oBAAA,CAAsB,GAAGL,CAAAA,CAAO,CAE3E","file":"chunk-5YDJTHDG.js","sourcesContent":["'use client';\r\n\r\nimport * as React from 'react';\r\nimport { Dialog as DialogPrimitive } from '@base-ui/react/dialog';\r\nimport { AnimatePresence, motion, type HTMLMotionProps } from 'motion/react';\r\n\r\nimport { useControlledState } from '@xploreu/hooks/use-controlled-state';\r\nimport { getStrictContext } from '@xploreu/lib/get-strict-context';\r\nimport { cn } from '@xploreu/lib/cn';\r\n\r\ntype DialogContextType = {\r\n open: boolean;\r\n setOpen: DialogProps['onOpenChange'];\r\n};\r\n\r\nconst [DialogProvider, useDialog] =\r\n getStrictContext<DialogContextType>('DialogContext');\r\n\r\ntype DialogProps = React.ComponentProps<typeof DialogPrimitive.Root>;\r\n\r\nfunction Dialog(props: DialogProps) {\r\n const [open, setOpen] = useControlledState({\r\n value: props?.open,\r\n defaultValue: props?.defaultOpen,\r\n onChange: props?.onOpenChange,\r\n });\r\n\r\n return (\r\n <DialogProvider value={{ open, setOpen }}>\r\n <DialogPrimitive.Root\r\n data-slot=\"dialog\"\r\n {...props}\r\n onOpenChange={setOpen}\r\n />\r\n </DialogProvider>\r\n );\r\n}\r\n\r\ntype DialogTriggerProps = React.ComponentProps<typeof DialogPrimitive.Trigger>;\r\n\r\nfunction DialogTrigger(props: DialogTriggerProps) {\r\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\r\n}\r\n\r\ntype DialogPortalProps = Omit<\r\n React.ComponentProps<typeof DialogPrimitive.Portal>,\r\n 'keepMounted'\r\n>;\r\n\r\nfunction DialogPortal(props: DialogPortalProps) {\r\n const { open } = useDialog();\r\n\r\n return (\r\n <AnimatePresence>\r\n {open && (\r\n <DialogPrimitive.Portal\r\n data-slot=\"dialog-portal\"\r\n keepMounted\r\n {...props}\r\n />\r\n )}\r\n </AnimatePresence>\r\n );\r\n}\r\n\r\ntype DialogBackdropProps = Omit<\r\n React.ComponentProps<typeof DialogPrimitive.Backdrop>,\r\n 'render'\r\n> &\r\n HTMLMotionProps<'div'>;\r\n\r\nfunction DialogBackdrop({\r\n transition = { duration: 0.2, ease: 'easeInOut' },\r\n ...props\r\n}: DialogBackdropProps) {\r\n return (\r\n <DialogPrimitive.Backdrop\r\n data-slot=\"dialog-backdrop\"\r\n render={\r\n <motion.div\r\n key=\"dialog-backdrop\"\r\n initial={{ opacity: 0, filter: 'blur(4px)' }}\r\n animate={{ opacity: 1, filter: 'blur(0px)' }}\r\n exit={{ opacity: 0, filter: 'blur(4px)' }}\r\n transition={transition}\r\n {...props}\r\n />\r\n }\r\n />\r\n );\r\n}\r\n\r\ntype DialogFlipDirection = 'top' | 'bottom' | 'left' | 'right';\r\n\r\ntype DialogPopupProps = Omit<\r\n React.ComponentProps<typeof DialogPrimitive.Popup>,\r\n 'render'\r\n> &\r\n HTMLMotionProps<'div'> & {\r\n from?: DialogFlipDirection;\r\n };\r\n\r\nfunction DialogPopup({\r\n from = 'left',\r\n initialFocus,\r\n finalFocus,\r\n transition = { type: 'spring', stiffness: 150, damping: 25 },\r\n className,\r\n ...props\r\n}: DialogPopupProps) {\r\n const initialRotation =\r\n from === 'bottom' || from === 'left' ? '20deg' : '-20deg';\r\n const isVertical = from === 'top' || from === 'bottom';\r\n const rotateAxis = isVertical ? 'rotateX' : 'rotateY';\r\n\r\n const [opened, setOpened] = React.useState(false);\r\n\r\n const { open } = useDialog()\r\n\r\n React.useEffect(() => {\r\n if (open) return\r\n\r\n setOpened(false)\r\n }, [open])\r\n\r\n return (\r\n <DialogPrimitive.Popup\r\n initialFocus={initialFocus}\r\n finalFocus={finalFocus}\r\n render={\r\n <motion.div\r\n key=\"dialog-popup\"\r\n data-slot=\"dialog-popup\"\r\n data-opened={opened ? \"\" : undefined}\r\n className={cn(\"data-[opened]:!transform-none\", className)}\r\n animate={{\r\n opacity: 1,\r\n filter: \"blur(0px)\",\r\n transform: `perspective(500px) ${rotateAxis}(0deg) scale(1)`,\r\n }}\r\n exit={{\r\n opacity: 0,\r\n filter: \"blur(4px)\",\r\n transform: `perspective(500px) ${rotateAxis}(${initialRotation}) scale(0.8)`,\r\n }}\r\n initial={{\r\n opacity: 0,\r\n filter: \"blur(4px)\",\r\n transform: `perspective(500px) ${rotateAxis}(${initialRotation}) scale(0.8)`,\r\n }}\r\n transition={transition}\r\n onAnimationComplete={(latest) => {\r\n if (typeof latest === \"object\" && \"opacity\" in latest && latest.opacity !== 1) return\r\n\r\n requestAnimationFrame(() => {\r\n setOpened(true)\r\n })\r\n }}\r\n {...props}\r\n />\r\n }\r\n />\r\n );\r\n}\r\n\r\ntype DialogCloseProps = React.ComponentProps<typeof DialogPrimitive.Close>;\r\n\r\nfunction DialogClose(props: DialogCloseProps) {\r\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\r\n}\r\n\r\ntype DialogHeaderProps = React.ComponentProps<'div'>;\r\n\r\nfunction DialogHeader(props: DialogHeaderProps) {\r\n return <div data-slot=\"dialog-header\" {...props} />;\r\n}\r\n\r\ntype DialogFooterProps = React.ComponentProps<'div'>;\r\n\r\nfunction DialogFooter(props: DialogFooterProps) {\r\n return <div data-slot=\"dialog-footer\" {...props} />;\r\n}\r\n\r\ntype DialogTitleProps = React.ComponentProps<typeof DialogPrimitive.Title>;\r\n\r\nfunction DialogTitle(props: DialogTitleProps) {\r\n return <DialogPrimitive.Title data-slot=\"dialog-title\" {...props} />;\r\n}\r\n\r\ntype DialogDescriptionProps = React.ComponentProps<\r\n typeof DialogPrimitive.Description\r\n>;\r\n\r\nfunction DialogDescription(props: DialogDescriptionProps) {\r\n return (\r\n <DialogPrimitive.Description data-slot=\"dialog-description\" {...props} />\r\n );\r\n}\r\n\r\nexport {\r\n Dialog,\r\n DialogPortal,\r\n DialogBackdrop,\r\n DialogClose,\r\n DialogTrigger,\r\n DialogPopup,\r\n DialogHeader,\r\n DialogFooter,\r\n DialogTitle,\r\n DialogDescription,\r\n useDialog,\r\n type DialogProps,\r\n type DialogTriggerProps,\r\n type DialogPortalProps,\r\n type DialogCloseProps,\r\n type DialogBackdropProps,\r\n type DialogPopupProps,\r\n type DialogHeaderProps,\r\n type DialogFooterProps,\r\n type DialogTitleProps,\r\n type DialogDescriptionProps,\r\n type DialogContextType,\r\n type DialogFlipDirection,\r\n};"]}
@@ -1,2 +1,2 @@
1
- import {a}from'./chunk-ZXAHA7TB.js';import {b as b$1,c as c$1}from'./chunk-MF7T3OYE.js';import'react';import*as s from'@radix-ui/react-tabs';import {useControllableState}from'@radix-ui/react-use-controllable-state';import {AnimatePresence,motion}from'motion/react';import {getStrictContext}from'@xploreu/lib/get-strict-context';import {jsx}from'react/jsx-runtime';var[c,u]=getStrictContext("TabsContext");function I({value:t,defaultValue:e,onValueChange:i,...n}){let[a,r]=useControllableState({prop:t,defaultProp:e||"",onChange:i});return jsx(c,{value:{value:a,setValue:r},children:jsx(s.Root,{"data-slot":"tabs",value:a,onValueChange:r,...n})})}function A({transition:t={type:"spring",stiffness:200,damping:25},...e}){let{value:i}=u();return jsx(b$1,{click:false,controlledItems:true,"data-slot":"tabs-highlight",transition:t,value:i,...e})}function x(t){return jsx(s.List,{"data-slot":"tabs-list",...t})}function M(t){return jsx(c$1,{"data-slot":"tabs-highlight-item",...t})}function V(t){return jsx(s.Trigger,{"data-slot":"tabs-trigger",...t})}function O({value:t,forceMount:e,transition:i={duration:.5,ease:"easeInOut"},...n}){return jsx(AnimatePresence,{mode:"wait",children:jsx(s.Content,{asChild:true,forceMount:e,value:t,children:jsx(motion.div,{animate:{opacity:1,filter:"blur(0px)"},"data-slot":"tabs-content",exit:{opacity:0,filter:"blur(4px)"},initial:{opacity:0,filter:"blur(4px)"},layout:true,layoutDependency:t,transition:i,...n})})})}var b={type:"spring",stiffness:200,damping:30};function d(t){return !("mode"in t)||t.mode==="auto-height"}function w(t){let{value:e}=u();if(d(t)){let{transition:r=b,...P}=t;return jsx(a,{"data-slot":"tabs-contents",deps:[e],transition:r,...P})}let{transition:i=b,style:n,...a$1}=t;return jsx(motion.div,{"data-slot":"tabs-contents",layout:"size",layoutDependency:e,style:{overflow:"hidden",...n},transition:{layout:i},...a$1})}export{I as a,A as b,x as c,M as d,V as e,O as f,w as g};//# sourceMappingURL=chunk-P4RPQUEL.js.map
2
- //# sourceMappingURL=chunk-P4RPQUEL.js.map
1
+ import {a}from'./chunk-ZVME3JB3.js';import {b as b$1,c as c$1}from'./chunk-KYD4ATTG.js';import'react';import*as s from'@radix-ui/react-tabs';import {useControllableState}from'@radix-ui/react-use-controllable-state';import {AnimatePresence,motion}from'motion/react';import {getStrictContext}from'@xploreu/lib/get-strict-context';import {jsx}from'react/jsx-runtime';var[c,u]=getStrictContext("TabsContext");function I({value:t,defaultValue:e,onValueChange:i,...n}){let[a,r]=useControllableState({prop:t,defaultProp:e||"",onChange:i});return jsx(c,{value:{value:a,setValue:r},children:jsx(s.Root,{"data-slot":"tabs",value:a,onValueChange:r,...n})})}function A({transition:t={type:"spring",stiffness:200,damping:25},...e}){let{value:i}=u();return jsx(b$1,{click:false,controlledItems:true,"data-slot":"tabs-highlight",transition:t,value:i,...e})}function x(t){return jsx(s.List,{"data-slot":"tabs-list",...t})}function M(t){return jsx(c$1,{"data-slot":"tabs-highlight-item",...t})}function V(t){return jsx(s.Trigger,{"data-slot":"tabs-trigger",...t})}function O({value:t,forceMount:e,transition:i={duration:.5,ease:"easeInOut"},...n}){return jsx(AnimatePresence,{mode:"wait",children:jsx(s.Content,{asChild:true,forceMount:e,value:t,children:jsx(motion.div,{animate:{opacity:1,filter:"blur(0px)"},"data-slot":"tabs-content",exit:{opacity:0,filter:"blur(4px)"},initial:{opacity:0,filter:"blur(4px)"},layout:true,layoutDependency:t,transition:i,...n})})})}var b={type:"spring",stiffness:200,damping:30};function d(t){return !("mode"in t)||t.mode==="auto-height"}function w(t){let{value:e}=u();if(d(t)){let{transition:r=b,...P}=t;return jsx(a,{"data-slot":"tabs-contents",deps:[e],transition:r,...P})}let{transition:i=b,style:n,...a$1}=t;return jsx(motion.div,{"data-slot":"tabs-contents",layout:"size",layoutDependency:e,style:{overflow:"hidden",...n},transition:{layout:i},...a$1})}export{I as a,A as b,x as c,M as d,V as e,O as f,w as g};//# sourceMappingURL=chunk-AMNHVMRK.js.map
2
+ //# sourceMappingURL=chunk-AMNHVMRK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/primitives/tabs.tsx"],"names":["TabsProvider","useTabs","getStrictContext","Tabs","valueProp","defaultValue","onValueChange","props","value","setValue","useControllableState","jsx","TabsHighlight","transition","Highlight","TabsList","TabsHighlightItem","HighlightItem","TabsTrigger","TabsContent","forceMount","AnimatePresence","motion","defaultTransition","isAutoMode","TabsContents","autoProps","AutoHeight","style","layoutProps"],"mappings":"4WA2BA,GAAM,CAACA,CAAAA,CAAcC,CAAO,CAAA,CAC1BC,gBAAAA,CAAkC,aAAa,CAAA,CAIjD,SAASC,CAAAA,CAAK,CACZ,MAAOC,CAAAA,CACP,YAAA,CAAAC,EACA,aAAA,CAAAC,CAAAA,CACA,GAAGC,CACL,CAAA,CAAc,CACZ,GAAM,CAACC,CAAAA,CAAOC,CAAQ,CAAA,CAAIC,oBAAAA,CAAqB,CAC7C,IAAA,CAAMN,CAAAA,CACN,WAAA,CAAaC,CAAAA,EAAgB,GAC7B,QAAA,CAAUC,CACZ,CAAC,CAAA,CAED,OACEK,IAACX,CAAAA,CAAA,CAAa,KAAA,CAAO,CAAE,MAAAQ,CAAAA,CAAO,QAAA,CAAAC,CAAS,CAAA,CACrC,QAAA,CAAAE,IAAe,CAAA,CAAA,IAAA,CAAd,CACC,WAAA,CAAU,MAAA,CACV,MAAOH,CAAAA,CACP,aAAA,CAAeC,EACd,GAAGF,CAAAA,CACN,EACF,CAEJ,CAIA,SAASK,CAAAA,CAAc,CACrB,UAAA,CAAAC,CAAAA,CAAa,CAAE,IAAA,CAAM,SAAU,SAAA,CAAW,GAAA,CAAK,OAAA,CAAS,EAAG,EAC3D,GAAGN,CACL,EAAuB,CACrB,GAAM,CAAE,KAAA,CAAAC,CAAM,CAAA,CAAIP,CAAAA,GAElB,OACEU,GAAAA,CAACG,IAAA,CACC,KAAA,CAAO,MACP,eAAA,CAAe,IAAA,CACf,WAAA,CAAU,gBAAA,CACV,WAAYD,CA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A,CACX,OAAA,CAAS,EACX,CAAA,CAEA,SAASC,EAAWjB,CAAAA,CAA0D,CAC5E,OAAO,EAAE,SAAUA,CAAAA,CAAAA,EAAUA,CAAAA,CAAM,IAAA,GAAS,aAC9C,CAEA,SAASkB,CAAAA,CAAalB,CAAAA,CAA0B,CAC9C,GAAM,CAAE,KAAA,CAAAC,CAAM,CAAA,CAAIP,CAAAA,GAElB,GAAIuB,CAAAA,CAAWjB,CAAK,CAAA,CAAG,CACrB,GAAM,CAAE,WAAAM,CAAAA,CAAaU,CAAAA,CAAmB,GAAGG,CAAU,CAAA,CAAInB,CAAAA,CAEzD,OACEI,IAACgB,CAAAA,CAAA,CACC,YAAU,eAAA,CACV,IAAA,CAAM,CAACnB,CAAK,CAAA,CACZ,UAAA,CAAYK,CAAAA,CACX,GAAGa,CAAAA,CACN,CAEJ,CAEA,GAAM,CAAE,WAAAb,CAAAA,CAAaU,CAAAA,CAAmB,KAAA,CAAAK,CAAAA,CAAO,GAAGC,GAAY,CAAA,CAAItB,EAElE,OACEI,GAAAA,CAACW,OAAO,GAAA,CAAP,CACC,WAAA,CAAU,eAAA,CACV,OAAO,MAAA,CACP,gBAAA,CAAkBd,EAClB,KAAA,CAAO,CAAE,SAAU,QAAA,CAAU,GAAGoB,CAAM,CAAA,CACtC,WAAY,CAAE,MAAA,CAAQf,CAAW,CAAA,CAChC,GAAGgB,IACN,CAEJ","file":"chunk-AMNHVMRK.js","sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\n\r\nimport * as TabsPrimitive from \"@radix-ui/react-tabs\"\r\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\"\r\nimport {\r\n AnimatePresence,\r\n type HTMLMotionProps,\r\n motion,\r\n type Transition,\r\n} from \"motion/react\"\r\n\r\nimport { AutoHeight, type AutoHeightProps } from \"../effects/auto-height\"\r\nimport {\r\n Highlight,\r\n HighlightItem,\r\n type HighlightItemProps,\r\n type HighlightProps,\r\n} from \"../effects/highlight\"\r\nimport { getStrictContext } from \"@xploreu/lib/get-strict-context\"\r\n\r\ntype TabsContextType = {\r\n value: string | undefined;\r\n setValue: TabsProps[\"onValueChange\"];\r\n}\r\n\r\nconst [TabsProvider, useTabs] =\r\n getStrictContext<TabsContextType>(\"TabsContext\")\r\n\r\ntype TabsProps = React.ComponentProps<typeof TabsPrimitive.Root>\r\n\r\nfunction Tabs({\r\n value: valueProp,\r\n defaultValue,\r\n onValueChange,\r\n ...props\r\n}: TabsProps) {\r\n const [value, setValue] = useControllableState({\r\n prop: valueProp,\r\n defaultProp: defaultValue || \"\",\r\n onChange: onValueChange,\r\n })\r\n\r\n return (\r\n <TabsProvider value={{ value, setValue }}>\r\n <TabsPrimitive.Root\r\n data-slot=\"tabs\"\r\n value={value}\r\n onValueChange={setValue}\r\n {...props}\r\n />\r\n </TabsProvider>\r\n )\r\n}\r\n\r\ntype TabsHighlightProps = Omit<HighlightProps, \"controlledItems\" | \"value\">\r\n\r\nfunction TabsHighlight({\r\n transition = { type: \"spring\", stiffness: 200, damping: 25 },\r\n ...props\r\n}: TabsHighlightProps) {\r\n const { value } = useTabs()\r\n\r\n return (\r\n <Highlight\r\n click={false}\r\n controlledItems\r\n data-slot=\"tabs-highlight\"\r\n transition={transition}\r\n value={value}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype TabsListProps = React.ComponentProps<typeof TabsPrimitive.List>\r\n\r\nfunction TabsList(props: TabsListProps) {\r\n return <TabsPrimitive.List\r\n data-slot=\"tabs-list\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype TabsHighlightItemProps = HighlightItemProps & {\r\n value: string;\r\n}\r\n\r\nfunction TabsHighlightItem(props: TabsHighlightItemProps) {\r\n return <HighlightItem\r\n data-slot=\"tabs-highlight-item\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype TabsTriggerProps = React.ComponentProps<typeof TabsPrimitive.Trigger>\r\n\r\nfunction TabsTrigger(props: TabsTriggerProps) {\r\n return <TabsPrimitive.Trigger\r\n data-slot=\"tabs-trigger\"\r\n {...props}\r\n />\r\n}\r\n\r\ntype TabsContentProps = React.ComponentProps<typeof TabsPrimitive.Content> &\r\n HTMLMotionProps<\"div\">\r\n\r\nfunction TabsContent({\r\n value,\r\n forceMount,\r\n transition = { duration: 0.5, ease: \"easeInOut\" },\r\n ...props\r\n}: TabsContentProps) {\r\n return (\r\n <AnimatePresence mode=\"wait\">\r\n <TabsPrimitive.Content\r\n asChild\r\n forceMount={forceMount}\r\n value={value}\r\n >\r\n <motion.div\r\n animate={{ opacity: 1, filter: \"blur(0px)\" }}\r\n data-slot=\"tabs-content\"\r\n exit={{ opacity: 0, filter: \"blur(4px)\" }}\r\n initial={{ opacity: 0, filter: \"blur(4px)\" }}\r\n layout\r\n layoutDependency={value}\r\n transition={transition}\r\n {...props}\r\n />\r\n </TabsPrimitive.Content>\r\n </AnimatePresence>\r\n )\r\n}\r\n\r\ntype TabsContentsAutoProps = AutoHeightProps & {\r\n mode?: \"auto-height\";\r\n children: React.ReactNode;\r\n transition?: Transition;\r\n}\r\n\r\ntype TabsContentsLayoutProps = Omit<HTMLMotionProps<\"div\">, \"transition\"> & {\r\n mode: \"layout\";\r\n children: React.ReactNode;\r\n transition?: Transition;\r\n}\r\n\r\ntype TabsContentsProps = TabsContentsAutoProps | TabsContentsLayoutProps\r\n\r\nconst defaultTransition: Transition = {\r\n type: \"spring\",\r\n stiffness: 200,\r\n damping: 30,\r\n}\r\n\r\nfunction isAutoMode(props: TabsContentsProps): props is TabsContentsAutoProps {\r\n return !(\"mode\" in props) || props.mode === \"auto-height\"\r\n}\r\n\r\nfunction TabsContents(props: TabsContentsProps) {\r\n const { value } = useTabs()\r\n\r\n if (isAutoMode(props)) {\r\n const { transition = defaultTransition, ...autoProps } = props\r\n\r\n return (\r\n <AutoHeight\r\n data-slot=\"tabs-contents\"\r\n deps={[value]}\r\n transition={transition}\r\n {...autoProps}\r\n />\r\n )\r\n }\r\n\r\n const { transition = defaultTransition, style, ...layoutProps } = props\r\n\r\n return (\r\n <motion.div\r\n data-slot=\"tabs-contents\"\r\n layout=\"size\"\r\n layoutDependency={value}\r\n style={{ overflow: \"hidden\", ...style }}\r\n transition={{ layout: transition }}\r\n {...layoutProps}\r\n />\r\n )\r\n}\r\n\r\nexport {\r\n Tabs,\r\n TabsContent,\r\n type TabsContentProps,\r\n TabsContents,\r\n type TabsContentsProps,\r\n TabsHighlight,\r\n TabsHighlightItem,\r\n type TabsHighlightItemProps,\r\n type TabsHighlightProps,\r\n TabsList,\r\n type TabsListProps,\r\n type TabsProps,\r\n TabsTrigger,\r\n type TabsTriggerProps,\r\n}"]}
@@ -1,2 +1,2 @@
1
- import {a,b,c,d,e,g,f as f$1}from'./chunk-P4RPQUEL.js';import {cn}from'@xploreu/lib/cn';import {jsx}from'react/jsx-runtime';function T({className:a$1,variant:t="default",...i}){return jsx(a,{className:cn("group/tabs flex flex-col gap-2",a$1),"data-variant":t,...i})}function v({className:a,highlightClassName:t,...i}){return jsx(b,{className:cn("absolute z-0","group-data-[variant=default]/tabs:inset-0 group-data-[variant=default]/tabs:border group-data-[variant=default]/tabs:border-transparent group-data-[variant=default]/tabs:rounded-md group-data-[variant=default]/tabs:bg-primary group-data-[variant=default]/tabs:shadow-sm","group-data-[variant=underline]/tabs:bottom-0 group-data-[variant=underline]/tabs:h-0.5 group-data-[variant=underline]/tabs:w-full group-data-[variant=underline]/tabs:rounded-none group-data-[variant=underline]/tabs:bg-fg-brand-secondary",t),children:jsx(c,{className:cn("inline-flex w-fit items-center justify-center","group-data-[variant=default]/tabs:bg-bg-primary group-data-[variant=default]/tabs:h-9 group-data-[variant=default]/tabs:rounded-lg group-data-[variant=default]/tabs:p-0.75","group-data-[variant=underline]/tabs:gap-7",a),...i})})}function P({className:a,...t}){return jsx(d,{className:"flex-1",value:t.value,children:jsx(e,{className:cn("group/tabs-trigger data-[state=active]:text-text-brand-tertiary-alt focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-text-primary inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md w-full text-label-semibold-2 whitespace-nowrap transition-colors duration-500 ease-in-out focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=default]/tabs:px-2 group-data-[variant=default]/tabs:py-1","group-data-[variant=underline]/tabs:h-8.5 group-data-[variant=underline]/tabs:px-3",a),...t})})}function m(a){return jsx(g,{...a})}function f({className:a,...t}){return jsx(f$1,{className:cn("flex-1 outline-none",a),...t})}export{T as a,v as b,P as c,m as d,f as e};//# sourceMappingURL=chunk-CPQOX4RR.js.map
2
- //# sourceMappingURL=chunk-CPQOX4RR.js.map
1
+ import {a,b,c,d,e,g,f as f$1}from'./chunk-AMNHVMRK.js';import {cn}from'@xploreu/lib/cn';import {jsx}from'react/jsx-runtime';function T({className:a$1,variant:t="default",...i}){return jsx(a,{className:cn("group/tabs flex flex-col gap-2",a$1),"data-variant":t,...i})}function v({className:a,highlightClassName:t,...i}){return jsx(b,{className:cn("absolute z-0","group-data-[variant=default]/tabs:inset-0 group-data-[variant=default]/tabs:border group-data-[variant=default]/tabs:border-transparent group-data-[variant=default]/tabs:rounded-md group-data-[variant=default]/tabs:bg-primary group-data-[variant=default]/tabs:shadow-sm","group-data-[variant=underline]/tabs:bottom-0 group-data-[variant=underline]/tabs:h-0.5 group-data-[variant=underline]/tabs:w-full group-data-[variant=underline]/tabs:rounded-none group-data-[variant=underline]/tabs:bg-fg-brand-secondary",t),children:jsx(c,{className:cn("inline-flex w-fit items-center justify-center","group-data-[variant=default]/tabs:bg-bg-primary group-data-[variant=default]/tabs:h-9 group-data-[variant=default]/tabs:rounded-lg group-data-[variant=default]/tabs:p-0.75","group-data-[variant=underline]/tabs:gap-7",a),...i})})}function P({className:a,...t}){return jsx(d,{className:"flex-1",value:t.value,children:jsx(e,{className:cn("group/tabs-trigger data-[state=active]:text-text-brand-tertiary-alt focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-text-primary inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md w-full text-label-semibold-2 whitespace-nowrap transition-colors duration-500 ease-in-out focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=default]/tabs:px-2 group-data-[variant=default]/tabs:py-1","group-data-[variant=underline]/tabs:h-8.5 group-data-[variant=underline]/tabs:px-3",a),...t})})}function m(a){return jsx(g,{...a})}function f({className:a,...t}){return jsx(f$1,{className:cn("flex-1 outline-none",a),...t})}export{T as a,v as b,P as c,m as d,f as e};//# sourceMappingURL=chunk-GDXL7UNV.js.map
2
+ //# sourceMappingURL=chunk-GDXL7UNV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ui/tabs.tsx"],"names":["Tabs","className","variant","props","jsx","cn","TabsList","highlightClassName","TabsHighlight","TabsTrigger","TabsHighlightItem","TabsContents","TabsContent"],"mappings":"4HAqBA,SAASA,CAAAA,CAAK,CACZ,SAAA,CAAAC,GAAAA,CACA,OAAA,CAAAC,EAAU,SAAA,CACV,GAAGC,CACL,CAAA,CAAc,CACZ,OACEC,GAAAA,CAACJ,CAAAA,CAAA,CACC,SAAA,CAAWK,EAAAA,CAAG,gCAAA,CAAkCJ,GAAS,CAAA,CACzD,cAAA,CAAcC,CAAAA,CACb,GAAGC,EACN,CAEJ,CAMA,SAASG,CAAAA,CAAS,CAChB,SAAA,CAAAL,CAAAA,CACA,kBAAA,CAAAM,CAAAA,CACA,GAAGJ,CACL,CAAA,CAAkB,CAChB,OACEC,GAAAA,CAACI,CAAAA,CAAA,CACC,SAAA,CAAWH,EAAAA,CACT,cAAA,CACA,+QAAA,CACA,8OAAA,CACAE,CACF,CAAA,CAEA,QAAA,CAAAH,IAACE,CAAAA,CAAA,CACC,SAAA,CAAWD,EAAAA,CACT,+CAAA,CACA,6KAAA,CACA,2CAAA,CACAJ,CACF,EACC,GAAGE,CAAAA,CACN,CAAA,CACF,CAEJ,CAIA,SAASM,CAAAA,CAAY,CAAE,SAAA,CAAAR,CAAAA,CAAW,GAAGE,CAAM,CAAA,CAAqB,CAC9D,OACEC,GAAAA,CAACM,EAAA,CACC,SAAA,CAAU,QAAA,CACV,KAAA,CAAOP,CAAAA,CAAM,KAAA,CAEb,QAAA,CAAAC,GAAAA,CAACK,EAAA,CACC,SAAA,CAAWJ,EAAAA,CACT,0gBAAA,CACA,+EAAA,CACA,oFAAA,CACAJ,CACF,CAAA,CACC,GAAGE,CAAAA,CACN,CAAA,CACF,CAEJ,CAIA,SAASQ,CAAAA,CAAaR,CAAAA,CAA0B,CAC9C,OAAOC,GAAAA,CAACO,CAAAA,CAAA,CAAuB,GAAGR,CAAAA,CAAO,CAC3C,CAIA,SAASS,EAAY,CAAE,SAAA,CAAAX,CAAAA,CAAW,GAAGE,CAAM,CAAA,CAAqB,CAC9D,OACEC,IAACQ,GAAAA,CAAA,CACC,SAAA,CAAWP,EAAAA,CAAG,qBAAA,CAAuBJ,CAAS,CAAA,CAC7C,GAAGE,EACN,CAEJ","file":"chunk-GDXL7UNV.js","sourcesContent":["\r\nimport {\r\n Tabs as TabsPrimitive,\r\n TabsContent as TabsContentPrimitive,\r\n type TabsContentProps as TabsContentPrimitiveProps,\r\n TabsContents as TabsContentsPrimitive,\r\n type TabsContentsProps as TabsContentsPrimitiveProps,\r\n TabsHighlight as TabsHighlightPrimitive,\r\n TabsHighlightItem as TabsHighlightItemPrimitive,\r\n TabsList as TabsListPrimitive,\r\n type TabsListProps as TabsListPrimitiveProps,\r\n type TabsProps as TabsPrimitiveProps,\r\n TabsTrigger as TabsTriggerPrimitive,\r\n type TabsTriggerProps as TabsTriggerPrimitiveProps,\r\n} from \"../primitives/tabs\";\r\nimport { cn } from \"@xploreu/lib/cn\";\r\n\r\ntype TabsProps = TabsPrimitiveProps & {\r\n variant?: \"default\" | \"underline\";\r\n}\r\n\r\nfunction Tabs({\r\n className,\r\n variant = \"default\",\r\n ...props\r\n}: TabsProps) {\r\n return (\r\n <TabsPrimitive\r\n className={cn(\"group/tabs flex flex-col gap-2\", className)}\r\n data-variant={variant}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\ntype TabsListProps = TabsListPrimitiveProps & {\r\n highlightClassName?: string;\r\n}\r\n\r\nfunction TabsList({\r\n className,\r\n highlightClassName,\r\n ...props\r\n}: TabsListProps) {\r\n return (\r\n <TabsHighlightPrimitive\r\n className={cn(\r\n \"absolute z-0\",\r\n \"group-data-[variant=default]/tabs:inset-0 group-data-[variant=default]/tabs:border group-data-[variant=default]/tabs:border-transparent group-data-[variant=default]/tabs:rounded-md group-data-[variant=default]/tabs:bg-primary group-data-[variant=default]/tabs:shadow-sm\",\r\n \"group-data-[variant=underline]/tabs:bottom-0 group-data-[variant=underline]/tabs:h-0.5 group-data-[variant=underline]/tabs:w-full group-data-[variant=underline]/tabs:rounded-none group-data-[variant=underline]/tabs:bg-fg-brand-secondary\",\r\n highlightClassName\r\n )}\r\n >\r\n <TabsListPrimitive\r\n className={cn(\r\n \"inline-flex w-fit items-center justify-center\",\r\n \"group-data-[variant=default]/tabs:bg-bg-primary group-data-[variant=default]/tabs:h-9 group-data-[variant=default]/tabs:rounded-lg group-data-[variant=default]/tabs:p-0.75\",\r\n \"group-data-[variant=underline]/tabs:gap-7\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n </TabsHighlightPrimitive>\r\n )\r\n}\r\n\r\ntype TabsTriggerProps = TabsTriggerPrimitiveProps\r\n\r\nfunction TabsTrigger({ className, ...props }: TabsTriggerProps) {\r\n return (\r\n <TabsHighlightItemPrimitive\r\n className=\"flex-1\"\r\n value={props.value}\r\n >\r\n <TabsTriggerPrimitive\r\n className={cn(\r\n \"group/tabs-trigger data-[state=active]:text-text-brand-tertiary-alt focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-text-primary inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md w-full text-label-semibold-2 whitespace-nowrap transition-colors duration-500 ease-in-out focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\r\n \"group-data-[variant=default]/tabs:px-2 group-data-[variant=default]/tabs:py-1\",\r\n \"group-data-[variant=underline]/tabs:h-8.5 group-data-[variant=underline]/tabs:px-3\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n </TabsHighlightItemPrimitive>\r\n )\r\n}\r\n\r\ntype TabsContentsProps = TabsContentsPrimitiveProps\r\n\r\nfunction TabsContents(props: TabsContentsProps) {\r\n return <TabsContentsPrimitive {...props} />\r\n}\r\n\r\ntype TabsContentProps = TabsContentPrimitiveProps\r\n\r\nfunction TabsContent({ className, ...props }: TabsContentProps) {\r\n return (\r\n <TabsContentPrimitive\r\n className={cn(\"flex-1 outline-none\", className)}\r\n {...props}\r\n />\r\n )\r\n}\r\n\r\nexport {\r\n Tabs,\r\n TabsContent,\r\n type TabsContentProps,\r\n TabsContents,\r\n type TabsContentsProps,\r\n TabsList,\r\n type TabsListProps,\r\n type TabsProps,\r\n TabsTrigger,\r\n type TabsTriggerProps,\r\n}"]}
@@ -1,2 +1,2 @@
1
- import*as e from'react';import {AnimatePresence,motion}from'motion/react';import {cn}from'@xploreu/lib/cn';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var ee={top:0,left:0,width:0,height:0},Z=e.createContext(void 0);function te(){let f=e.useContext(Z);if(!f)throw new Error("useHighlight must be used within a HighlightProvider");return f}function se({ref:f,...r}){let{as:d="div",children:c,value:H,defaultValue:y,onValueChange:V,className:U,style:N,transition:u={type:"spring",stiffness:350,damping:35},hover:F=false,click:_=true,enabled:b=true,controlledItems:z,disabled:W=false,exitDelay:E=200,mode:p="children"}=r,s=e.useRef(null);e.useImperativeHandle(f,()=>s.current);let T=r?.boundsOffset??ee,w=T.top??0,I=T.left??0,D=T.width??0,C=T.height??0,S=e.useRef({top:w,left:I,width:D,height:C});e.useEffect(()=>{S.current={top:w,left:I,width:D,height:C};},[w,I,D,C]);let[P,x]=e.useState(H??y??null),[l,k]=e.useState(null),[A,q]=e.useState(""),$=t=>{x(a=>a!==t?(V?.(t),t):a);},i=e.useRef(void 0);e.useEffect(()=>{i.current=t=>{if(!s.current)return;let a=s.current.getBoundingClientRect(),o=S.current,g={top:t.top-a.top+o.top,left:t.left-a.left+o.left,width:t.width+o.width,height:t.height+o.height};k(n=>n&&n.top===g.top&&n.left===g.left&&n.width===g.width&&n.height===g.height?n:g);};});let R=t=>{i.current?.(t);},v=e.useCallback(()=>{k(t=>t===null?t:null);},[]);e.useEffect(()=>{H!==void 0?x(H):y!==void 0&&x(y);},[H,y]);let L=e.useId();e.useEffect(()=>{if(p!=="parent")return;let t=s.current;if(!t)return;let a=()=>{if(!P)return;let o=t.querySelector(`[data-value="${P}"][data-highlight="true"]`);o&&i.current?.(o.getBoundingClientRect());};return t.addEventListener("scroll",a,{passive:true}),()=>t.removeEventListener("scroll",a)},[p,P]);let h=t=>p==="parent"?jsxs(d,{ref:s,className:r?.containerClassName,"data-slot":"motion-highlight-container",style:{position:"relative",zIndex:1},children:[jsx(AnimatePresence,{initial:false,mode:"wait",children:l&&jsx(motion.div,{animate:{top:l.top,left:l.left,width:l.width,height:l.height,opacity:1},className:cn(U,A),"data-slot":"motion-highlight",exit:{opacity:0,transition:{...u,delay:(u?.delay??0)+(E??0)/1e3}},initial:{top:l.top,left:l.left,width:l.width,height:l.height,opacity:0},style:{position:"absolute",zIndex:0,...N},transition:u})}),t]}):t;return jsx(Z.Provider,{value:{mode:p,activeValue:P,setActiveValue:$,id:L,hover:F,click:_,className:U,style:N,transition:u,disabled:W,enabled:b,exitDelay:E,setBounds:R,clearBounds:v,activeClassName:A,setActiveClassName:q,forceUpdateBounds:r?.forceUpdateBounds},children:b?h(z?c:e.Children.map(c,(t,a)=>jsx(ne,{className:r?.itemsClassName,children:t},a))):c})}function J(f,r){return Object.keys(r).reduce((d,c)=>(f.props[c]===void 0&&(d[c]=r[c]),d),{})}function ne({ref:f,as:r,children:d,id:c,value:H,className:y,style:V,transition:U,disabled:N=false,activeClassName:u,exitDelay:F,asChild:_=false,forceUpdateBounds:b,...z}){let W=e.useId(),{activeValue:E,setActiveValue:p,mode:s,setBounds:j,clearBounds:T,hover:w,click:I,enabled:D,className:C,style:S,transition:P,id:x,disabled:l,exitDelay:k,forceUpdateBounds:A,setActiveClassName:q}=te(),$=r??"div",i=d,R=c??H??i.props?.["data-value"]??i.props?.id??W,v=E===R,L=N===void 0?l:N,h=U??P,t=e.useRef(null);e.useImperativeHandle(f,()=>t.current);let a=e.useCallback(n=>{t.current=n;},[]);if(e.useEffect(()=>{if(s!=="parent")return;let n,M=null,Y=b===true||A&&b!==false,G=()=>{if(!t.current)return;let B=t.current.getBoundingClientRect();if(Y){if(M&&M.top===B.top&&M.left===B.left&&M.width===B.width&&M.height===B.height){n=requestAnimationFrame(G);return}M=B,n=requestAnimationFrame(G);}j(B);};if(v?(G(),q(u??"")):E||T(),Y)return ()=>cancelAnimationFrame(n)},[s,v,E,j,T,u,q,b,A]),!e.isValidElement(d))return d;let o={"data-active":v?"true":"false","aria-selected":v,"data-disabled":L,"data-value":R,"data-highlight":true},g=w?{onMouseEnter:n=>{p(R),i.props.onMouseEnter?.(n);},onMouseLeave:n=>{p(null),i.props.onMouseLeave?.(n);}}:I?{onClick:n=>{p(R),i.props.onClick?.(n);}}:{};return _?s==="children"?e.cloneElement(i,{key:R,ref:a,className:cn("relative",i.props.className),...J(i,{...o,"data-slot":"motion-highlight-item-container"}),...g,...z},jsxs(Fragment,{children:[jsx(AnimatePresence,{initial:false,mode:"wait",children:v&&!L&&jsx(motion.div,{animate:{opacity:1},className:cn(C,u),"data-slot":"motion-highlight",exit:{opacity:0,transition:{...h,delay:(h?.delay??0)+(F??k??0)/1e3}},initial:{opacity:0},layoutId:`transition-background-${x}`,style:{position:"absolute",zIndex:0,...S,...V},transition:h,...o})}),jsx($,{className:y,"data-slot":"motion-highlight-item",style:{position:"relative",zIndex:1},...o,children:d})]})):e.cloneElement(i,{ref:a,...J(i,{...o,"data-slot":"motion-highlight-item"}),...g}):D?jsxs($,{ref:t,className:cn(s==="children"&&"relative",y),"data-slot":"motion-highlight-item-container",...o,...z,...g,children:[s==="children"&&jsx(AnimatePresence,{initial:false,mode:"wait",children:v&&!L&&jsx(motion.div,{animate:{opacity:1},className:cn(C,u),"data-slot":"motion-highlight",exit:{opacity:0,transition:{...h,delay:(h?.delay??0)+(F??k??0)/1e3}},initial:{opacity:0},layoutId:`transition-background-${x}`,style:{position:"absolute",zIndex:0,...S,...V},transition:h,...o})}),e.cloneElement(i,{style:{position:"relative",zIndex:1},className:i.props.className,...J(i,{...o,"data-slot":"motion-highlight-item"})})]},R):d}export{te as a,se as b,ne as c};//# sourceMappingURL=chunk-MF7T3OYE.js.map
2
- //# sourceMappingURL=chunk-MF7T3OYE.js.map
1
+ import*as e from'react';import {AnimatePresence,motion}from'motion/react';import {cn}from'@xploreu/lib/cn';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var ee={top:0,left:0,width:0,height:0},Z=e.createContext(void 0);function te(){let f=e.useContext(Z);if(!f)throw new Error("useHighlight must be used within a HighlightProvider");return f}function se({ref:f,...r}){let{as:d="div",children:c,value:H,defaultValue:y,onValueChange:V,className:U,style:N,transition:u={type:"spring",stiffness:350,damping:35},hover:F=false,click:_=true,enabled:b=true,controlledItems:z,disabled:W=false,exitDelay:E=200,mode:p="children"}=r,s=e.useRef(null);e.useImperativeHandle(f,()=>s.current);let T=r?.boundsOffset??ee,w=T.top??0,I=T.left??0,D=T.width??0,C=T.height??0,S=e.useRef({top:w,left:I,width:D,height:C});e.useEffect(()=>{S.current={top:w,left:I,width:D,height:C};},[w,I,D,C]);let[P,x]=e.useState(H??y??null),[l,k]=e.useState(null),[A,q]=e.useState(""),$=t=>{x(a=>a!==t?(V?.(t),t):a);},i=e.useRef(void 0);e.useEffect(()=>{i.current=t=>{if(!s.current)return;let a=s.current.getBoundingClientRect(),o=S.current,g={top:t.top-a.top+o.top,left:t.left-a.left+o.left,width:t.width+o.width,height:t.height+o.height};k(n=>n&&n.top===g.top&&n.left===g.left&&n.width===g.width&&n.height===g.height?n:g);};});let R=t=>{i.current?.(t);},v=e.useCallback(()=>{k(t=>t===null?t:null);},[]);e.useEffect(()=>{H!==void 0?x(H):y!==void 0&&x(y);},[H,y]);let L=e.useId();e.useEffect(()=>{if(p!=="parent")return;let t=s.current;if(!t)return;let a=()=>{if(!P)return;let o=t.querySelector(`[data-value="${P}"][data-highlight="true"]`);o&&i.current?.(o.getBoundingClientRect());};return t.addEventListener("scroll",a,{passive:true}),()=>t.removeEventListener("scroll",a)},[p,P]);let h=t=>p==="parent"?jsxs(d,{ref:s,className:r?.containerClassName,"data-slot":"motion-highlight-container",style:{position:"relative",zIndex:1},children:[jsx(AnimatePresence,{initial:false,mode:"wait",children:l&&jsx(motion.div,{animate:{top:l.top,left:l.left,width:l.width,height:l.height,opacity:1},className:cn(U,A),"data-slot":"motion-highlight",exit:{opacity:0,transition:{...u,delay:(u?.delay??0)+(E??0)/1e3}},initial:{top:l.top,left:l.left,width:l.width,height:l.height,opacity:0},style:{position:"absolute",zIndex:0,...N},transition:u})}),t]}):t;return jsx(Z.Provider,{value:{mode:p,activeValue:P,setActiveValue:$,id:L,hover:F,click:_,className:U,style:N,transition:u,disabled:W,enabled:b,exitDelay:E,setBounds:R,clearBounds:v,activeClassName:A,setActiveClassName:q,forceUpdateBounds:r?.forceUpdateBounds},children:b?h(z?c:e.Children.map(c,(t,a)=>jsx(ne,{className:r?.itemsClassName,children:t},a))):c})}function J(f,r){return Object.keys(r).reduce((d,c)=>(f.props[c]===void 0&&(d[c]=r[c]),d),{})}function ne({ref:f,as:r,children:d,id:c,value:H,className:y,style:V,transition:U,disabled:N=false,activeClassName:u,exitDelay:F,asChild:_=false,forceUpdateBounds:b,...z}){let W=e.useId(),{activeValue:E,setActiveValue:p,mode:s,setBounds:j,clearBounds:T,hover:w,click:I,enabled:D,className:C,style:S,transition:P,id:x,disabled:l,exitDelay:k,forceUpdateBounds:A,setActiveClassName:q}=te(),$=r??"div",i=d,R=c??H??i.props?.["data-value"]??i.props?.id??W,v=E===R,L=N===void 0?l:N,h=U??P,t=e.useRef(null);e.useImperativeHandle(f,()=>t.current);let a=e.useCallback(n=>{t.current=n;},[]);if(e.useEffect(()=>{if(s!=="parent")return;let n,M=null,Y=b===true||A&&b!==false,G=()=>{if(!t.current)return;let B=t.current.getBoundingClientRect();if(Y){if(M&&M.top===B.top&&M.left===B.left&&M.width===B.width&&M.height===B.height){n=requestAnimationFrame(G);return}M=B,n=requestAnimationFrame(G);}j(B);};if(v?(G(),q(u??"")):E||T(),Y)return ()=>cancelAnimationFrame(n)},[s,v,E,j,T,u,q,b,A]),!e.isValidElement(d))return d;let o={"data-active":v?"true":"false","aria-selected":v,"data-disabled":L,"data-value":R,"data-highlight":true},g=w?{onMouseEnter:n=>{p(R),i.props.onMouseEnter?.(n);},onMouseLeave:n=>{p(null),i.props.onMouseLeave?.(n);}}:I?{onClick:n=>{p(R),i.props.onClick?.(n);}}:{};return _?s==="children"?e.cloneElement(i,{key:R,ref:a,className:cn("relative",i.props.className),...J(i,{...o,"data-slot":"motion-highlight-item-container"}),...g,...z},jsxs(Fragment,{children:[jsx(AnimatePresence,{initial:false,mode:"wait",children:v&&!L&&jsx(motion.div,{animate:{opacity:1},className:cn(C,u),"data-slot":"motion-highlight",exit:{opacity:0,transition:{...h,delay:(h?.delay??0)+(F??k??0)/1e3}},initial:{opacity:0},layoutId:`transition-background-${x}`,style:{position:"absolute",zIndex:0,...S,...V},transition:h,...o})}),jsx($,{className:y,"data-slot":"motion-highlight-item",style:{position:"relative",zIndex:1},...o,children:d})]})):e.cloneElement(i,{ref:a,...J(i,{...o,"data-slot":"motion-highlight-item"}),...g}):D?jsxs($,{ref:t,className:cn(s==="children"&&"relative",y),"data-slot":"motion-highlight-item-container",...o,...z,...g,children:[s==="children"&&jsx(AnimatePresence,{initial:false,mode:"wait",children:v&&!L&&jsx(motion.div,{animate:{opacity:1},className:cn(C,u),"data-slot":"motion-highlight",exit:{opacity:0,transition:{...h,delay:(h?.delay??0)+(F??k??0)/1e3}},initial:{opacity:0},layoutId:`transition-background-${x}`,style:{position:"absolute",zIndex:0,...S,...V},transition:h,...o})}),e.cloneElement(i,{style:{position:"relative",zIndex:1},className:i.props.className,...J(i,{...o,"data-slot":"motion-highlight-item"})})]},R):d}export{te as a,se as b,ne as c};//# sourceMappingURL=chunk-KYD4ATTG.js.map
2
+ //# sourceMappingURL=chunk-KYD4ATTG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/effects/highlight.tsx"],"names":["DEFAULT_BOUNDS_OFFSET","HighlightContext","useHighlight","context","Highlight","ref","props","Component","children","value","defaultValue","onValueChange","className","style","transition","hover","click","enabled","controlledItems","disabled","exitDelay","mode","localRef","boundsOffset","boundsOffsetTop","boundsOffsetLeft","boundsOffsetWidth","boundsOffsetHeight","boundsOffsetRef","activeValue","setActiveValue","boundsState","setBoundsState","activeClassNameState","setActiveClassNameState","safeSetActiveValue","id","prev","safeSetBoundsRef","bounds","containerRect","offset","newBounds","safeSetBounds","clearBounds","container","onScroll","activeEl","render","jsxs","jsx","AnimatePresence","motion","cn","child","index","HighlightItem","getNonOverridingDataAttributes","element","dataAttributes","acc","key","as","activeClassName","asChild","forceUpdateBounds","itemId","setBounds","contextClassName","contextStyle","contextTransition","contextId","contextDisabled","contextExitDelay","contextForceUpdateBounds","setActiveClassName","childValue","isActive","isDisabled","itemTransition","refCallback","node","rafId","previousBounds","shouldUpdateBounds","updateBounds","commonHandlers","e","Fragment"],"mappings":"6JAqBA,IAAMA,EAAAA,CAAgC,CACpC,GAAA,CAAK,CAAA,CACL,IAAA,CAAM,CAAA,CACN,KAAA,CAAO,C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,CAAAA,CACN,CAAA,CAEJ,EAGK,CAAA,CAAA,YAAA,CAAaD,CAAAA,CAAS,CAC3B,KAAA,CAAO,CAAE,QAAA,CAAU,UAAA,CAAY,MAAA,CAAQ,CAAE,CAAA,CACzC,SAAA,CAAWA,CAAAA,CAAQ,KAAA,CAAM,SAAA,CACzB,GAAGD,CAAAA,CAA+BC,CAAAA,CAAS,CACzC,GAAGC,CAAAA,CACH,WAAA,CAAa,uBACf,CAAC,CACH,CAAC,CAAA,CAAA,CAAA,CAjDIiB,CAkDP,EAEApE,CAEJ","file":"chunk-KYD4ATTG.js","sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\n\r\nimport {\r\n AnimatePresence,\r\n motion,\r\n type Transition\r\n} from \"motion/react\"\r\n\r\nimport { cn } from \"@xploreu/lib/cn\"\r\n\r\ntype HighlightMode = \"children\" | \"parent\"\r\n\r\ntype Bounds = {\r\n top: number;\r\n left: number;\r\n width: number;\r\n height: number;\r\n}\r\n\r\nconst DEFAULT_BOUNDS_OFFSET: Bounds = {\r\n top: 0,\r\n left: 0,\r\n width: 0,\r\n height: 0,\r\n}\r\n\r\ntype HighlightContextType<T extends string> = {\r\n as?: keyof HTMLElementTagNameMap;\r\n mode: HighlightMode;\r\n activeValue: T | null;\r\n setActiveValue: (value: T | null) => void;\r\n setBounds: (bounds: DOMRect) => void;\r\n clearBounds: () => void;\r\n id: string;\r\n hover: boolean;\r\n click: boolean;\r\n className?: string;\r\n style?: React.CSSProperties;\r\n activeClassName?: string;\r\n setActiveClassName: (className: string) => void;\r\n transition?: Transition;\r\n disabled?: boolean;\r\n enabled?: boolean;\r\n exitDelay?: number;\r\n forceUpdateBounds?: boolean;\r\n}\r\n\r\nconst HighlightContext = React.createContext<\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n HighlightContextType<any> | undefined\r\n>(undefined)\r\n\r\nfunction useHighlight<T extends string>(): HighlightContextType<T> {\r\n const context = React.useContext(HighlightContext)\r\n if (!context) {\r\n throw new Error(\"useHighlight must be used within a HighlightProvider\")\r\n }\r\n return context as unknown as HighlightContextType<T>\r\n}\r\n\r\ntype BaseHighlightProps<T extends React.ElementType = \"div\"> = {\r\n as?: T;\r\n ref?: React.Ref<HTMLDivElement>;\r\n mode?: HighlightMode;\r\n value?: string | null;\r\n defaultValue?: string | null;\r\n onValueChange?: (value: string | null) => void;\r\n className?: string;\r\n style?: React.CSSProperties;\r\n transition?: Transition;\r\n hover?: boolean;\r\n click?: boolean;\r\n disabled?: boolean;\r\n enabled?: boolean;\r\n exitDelay?: number;\r\n}\r\n\r\ntype ParentModeHighlightProps = {\r\n boundsOffset?: Partial<Bounds>;\r\n containerClassName?: string;\r\n forceUpdateBounds?: boolean;\r\n}\r\n\r\ntype ControlledParentModeHighlightProps<T extends React.ElementType = \"div\"> =\r\n BaseHighlightProps<T> &\r\n ParentModeHighlightProps & {\r\n mode: \"parent\";\r\n controlledItems: true;\r\n children: React.ReactNode;\r\n }\r\n\r\ntype ControlledChildrenModeHighlightProps<T extends React.ElementType = \"div\"> =\r\n BaseHighlightProps<T> & {\r\n mode?: \"children\" | undefined;\r\n controlledItems: true;\r\n children: React.ReactNode;\r\n }\r\n\r\ntype UncontrolledParentModeHighlightProps<T extends React.ElementType = \"div\"> =\r\n BaseHighlightProps<T> &\r\n ParentModeHighlightProps & {\r\n mode: \"parent\";\r\n controlledItems?: false;\r\n itemsClassName?: string;\r\n children: React.ReactElement | React.ReactElement[];\r\n }\r\n\r\ntype UncontrolledChildrenModeHighlightProps<\r\n T extends React.ElementType = \"div\",\r\n> = BaseHighlightProps<T> & {\r\n mode?: \"children\";\r\n controlledItems?: false;\r\n itemsClassName?: string;\r\n children: React.ReactElement | React.ReactElement[];\r\n}\r\n\r\ntype HighlightProps<T extends React.ElementType = \"div\"> =\r\n | ControlledParentModeHighlightProps<T>\r\n | ControlledChildrenModeHighlightProps<T>\r\n | UncontrolledParentModeHighlightProps<T>\r\n | UncontrolledChildrenModeHighlightProps<T>\r\n\r\nfunction Highlight<T extends React.ElementType = \"div\">({\r\n ref,\r\n ...props\r\n}: HighlightProps<T>) {\r\n const {\r\n as: Component = \"div\",\r\n children,\r\n value,\r\n defaultValue,\r\n onValueChange,\r\n className,\r\n style,\r\n transition = { type: \"spring\", stiffness: 350, damping: 35 },\r\n hover = false,\r\n click = true,\r\n enabled = true,\r\n controlledItems,\r\n disabled = false,\r\n exitDelay = 200,\r\n mode = \"children\",\r\n } = props\r\n\r\n const localRef = React.useRef<HTMLDivElement>(null)\r\n React.useImperativeHandle(ref, () => localRef.current as HTMLDivElement)\r\n\r\n const propsBoundsOffset = (props as ParentModeHighlightProps)?.boundsOffset\r\n const boundsOffset = propsBoundsOffset ?? DEFAULT_BOUNDS_OFFSET\r\n const boundsOffsetTop = boundsOffset.top ?? 0\r\n const boundsOffsetLeft = boundsOffset.left ?? 0\r\n const boundsOffsetWidth = boundsOffset.width ?? 0\r\n const boundsOffsetHeight = boundsOffset.height ?? 0\r\n\r\n const boundsOffsetRef = React.useRef({\r\n top: boundsOffsetTop,\r\n left: boundsOffsetLeft,\r\n width: boundsOffsetWidth,\r\n height: boundsOffsetHeight,\r\n })\r\n\r\n React.useEffect(() => {\r\n boundsOffsetRef.current = {\r\n top: boundsOffsetTop,\r\n left: boundsOffsetLeft,\r\n width: boundsOffsetWidth,\r\n height: boundsOffsetHeight,\r\n }\r\n }, [\r\n boundsOffsetTop,\r\n boundsOffsetLeft,\r\n boundsOffsetWidth,\r\n boundsOffsetHeight,\r\n ])\r\n\r\n const [activeValue, setActiveValue] = React.useState<string | null>(\r\n value ?? defaultValue ?? null,\r\n )\r\n const [boundsState, setBoundsState] = React.useState<Bounds | null>(null)\r\n const [activeClassNameState, setActiveClassNameState] =\r\n React.useState<string>(\"\")\r\n\r\n const safeSetActiveValue = (id: string | null) => {\r\n setActiveValue((prev) => {\r\n if (prev !== id) {\r\n onValueChange?.(id)\r\n return id\r\n }\r\n return prev\r\n })\r\n }\r\n\r\n const safeSetBoundsRef = React.useRef<\r\n ((bounds: DOMRect) => void) | undefined\r\n >(undefined)\r\n\r\n React.useEffect(() => {\r\n safeSetBoundsRef.current = (bounds: DOMRect) => {\r\n if (!localRef.current) return\r\n\r\n const containerRect = localRef.current.getBoundingClientRect()\r\n const offset = boundsOffsetRef.current\r\n const newBounds: Bounds = {\r\n top: bounds.top - containerRect.top + offset.top,\r\n left: bounds.left - containerRect.left + offset.left,\r\n width: bounds.width + offset.width,\r\n height: bounds.height + offset.height,\r\n }\r\n\r\n setBoundsState((prev) => {\r\n if (\r\n prev &&\r\n prev.top === newBounds.top &&\r\n prev.left === newBounds.left &&\r\n prev.width === newBounds.width &&\r\n prev.height === newBounds.height\r\n ) {\r\n return prev\r\n }\r\n return newBounds\r\n })\r\n }\r\n })\r\n\r\n const safeSetBounds = (bounds: DOMRect) => {\r\n safeSetBoundsRef.current?.(bounds)\r\n }\r\n\r\n const clearBounds = React.useCallback(() => {\r\n setBoundsState((prev) => (prev === null ? prev : null))\r\n }, [])\r\n\r\n React.useEffect(() => {\r\n if (value !== undefined) setActiveValue(value)\r\n else if (defaultValue !== undefined) setActiveValue(defaultValue)\r\n }, [value, defaultValue])\r\n\r\n const id = React.useId()\r\n\r\n React.useEffect(() => {\r\n if (mode !== \"parent\") return\r\n const container = localRef.current\r\n if (!container) return\r\n\r\n const onScroll = () => {\r\n if (!activeValue) return\r\n const activeEl = container.querySelector<HTMLElement>(\r\n `[data-value=\"${activeValue}\"][data-highlight=\"true\"]`,\r\n )\r\n if (activeEl)\r\n safeSetBoundsRef.current?.(activeEl.getBoundingClientRect())\r\n }\r\n\r\n container.addEventListener(\"scroll\", onScroll, { passive: true })\r\n return () => container.removeEventListener(\"scroll\", onScroll)\r\n }, [mode, activeValue])\r\n\r\n const render = (children: React.ReactNode) => {\r\n if (mode === \"parent\") {\r\n return (\r\n <Component\r\n ref={localRef}\r\n className={(props as ParentModeHighlightProps)?.containerClassName}\r\n data-slot=\"motion-highlight-container\"\r\n style={{ position: \"relative\", zIndex: 1 }}\r\n >\r\n <AnimatePresence\r\n initial={false}\r\n mode=\"wait\"\r\n >\r\n {boundsState && (\r\n <motion.div\r\n animate={{\r\n top: boundsState.top,\r\n left: boundsState.left,\r\n width: boundsState.width,\r\n height: boundsState.height,\r\n opacity: 1,\r\n }}\r\n className={cn(className, activeClassNameState)}\r\n data-slot=\"motion-highlight\"\r\n exit={{\r\n opacity: 0,\r\n transition: {\r\n ...transition,\r\n delay: (transition?.delay ?? 0) + (exitDelay ?? 0) / 1000,\r\n },\r\n }}\r\n initial={{\r\n top: boundsState.top,\r\n left: boundsState.left,\r\n width: boundsState.width,\r\n height: boundsState.height,\r\n opacity: 0,\r\n }}\r\n style={{ position: \"absolute\", zIndex: 0, ...style }}\r\n transition={transition}\r\n />\r\n )}\r\n </AnimatePresence>\r\n {children}\r\n </Component>\r\n )\r\n }\r\n\r\n return children\r\n }\r\n\r\n return (\r\n <HighlightContext.Provider\r\n value={{\r\n mode,\r\n activeValue,\r\n setActiveValue: safeSetActiveValue,\r\n id,\r\n hover,\r\n click,\r\n className,\r\n style,\r\n transition,\r\n disabled,\r\n enabled,\r\n exitDelay,\r\n setBounds: safeSetBounds,\r\n clearBounds,\r\n activeClassName: activeClassNameState,\r\n setActiveClassName: setActiveClassNameState,\r\n forceUpdateBounds: (props as ParentModeHighlightProps)\r\n ?.forceUpdateBounds,\r\n }}\r\n >\r\n {enabled\r\n ? controlledItems\r\n ? render(children)\r\n : render(\r\n React.Children.map(children, (child, index) => (\r\n <HighlightItem\r\n key={index}\r\n className={props?.itemsClassName}\r\n >\r\n {child}\r\n </HighlightItem>\r\n )),\r\n )\r\n : children}\r\n </HighlightContext.Provider>\r\n )\r\n}\r\n\r\nfunction getNonOverridingDataAttributes(\r\n element: React.ReactElement,\r\n dataAttributes: Record<string, unknown>,\r\n): Record<string, unknown> {\r\n return Object.keys(dataAttributes).reduce<Record<string, unknown>>(\r\n (acc, key) => {\r\n if ((element.props as Record<string, unknown>)[key] === undefined) {\r\n acc[key] = dataAttributes[key]\r\n }\r\n return acc\r\n },\r\n {},\r\n )\r\n}\r\n\r\ntype ExtendedChildProps = React.ComponentProps<\"div\"> & {\r\n id?: string;\r\n ref?: React.Ref<HTMLElement>;\r\n \"data-active\"?: string;\r\n \"data-value\"?: string;\r\n \"data-disabled\"?: boolean;\r\n \"data-highlight\"?: boolean;\r\n \"data-slot\"?: string;\r\n}\r\n\r\ntype HighlightItemProps<T extends React.ElementType = \"div\"> =\r\n React.ComponentProps<T> & {\r\n as?: T;\r\n children: React.ReactElement;\r\n id?: string;\r\n value?: string;\r\n className?: string;\r\n style?: React.CSSProperties;\r\n transition?: Transition;\r\n activeClassName?: string;\r\n disabled?: boolean;\r\n exitDelay?: number;\r\n asChild?: boolean;\r\n forceUpdateBounds?: boolean;\r\n }\r\n\r\nfunction HighlightItem<T extends React.ElementType>({\r\n ref,\r\n as,\r\n children,\r\n id,\r\n value,\r\n className,\r\n style,\r\n transition,\r\n disabled = false,\r\n activeClassName,\r\n exitDelay,\r\n asChild = false,\r\n forceUpdateBounds,\r\n ...props\r\n}: HighlightItemProps<T>) {\r\n const itemId = React.useId()\r\n const {\r\n activeValue,\r\n setActiveValue,\r\n mode,\r\n setBounds,\r\n clearBounds,\r\n hover,\r\n click,\r\n enabled,\r\n className: contextClassName,\r\n style: contextStyle,\r\n transition: contextTransition,\r\n id: contextId,\r\n disabled: contextDisabled,\r\n exitDelay: contextExitDelay,\r\n forceUpdateBounds: contextForceUpdateBounds,\r\n setActiveClassName,\r\n } = useHighlight()\r\n\r\n const Component = as ?? \"div\"\r\n const element = children as React.ReactElement<ExtendedChildProps>\r\n const childValue =\r\n id ?? value ?? element.props?.[\"data-value\"] ?? element.props?.id ?? itemId\r\n const isActive = activeValue === childValue\r\n const isDisabled = disabled === undefined ? contextDisabled : disabled\r\n const itemTransition = transition ?? contextTransition\r\n\r\n const localRef = React.useRef<HTMLDivElement>(null)\r\n React.useImperativeHandle(ref, () => localRef.current as HTMLDivElement)\r\n\r\n const refCallback = React.useCallback((node: HTMLElement | null) => {\r\n localRef.current = node as HTMLDivElement\r\n }, [])\r\n\r\n React.useEffect(() => {\r\n if (mode !== \"parent\") return\r\n let rafId: number\r\n let previousBounds: Bounds | null = null\r\n const shouldUpdateBounds =\r\n forceUpdateBounds === true ||\r\n (contextForceUpdateBounds && forceUpdateBounds !== false)\r\n\r\n const updateBounds = () => {\r\n if (!localRef.current) return\r\n\r\n const bounds = localRef.current.getBoundingClientRect()\r\n\r\n if (shouldUpdateBounds) {\r\n if (\r\n previousBounds &&\r\n previousBounds.top === bounds.top &&\r\n previousBounds.left === bounds.left &&\r\n previousBounds.width === bounds.width &&\r\n previousBounds.height === bounds.height\r\n ) {\r\n rafId = requestAnimationFrame(updateBounds)\r\n return\r\n }\r\n previousBounds = bounds\r\n rafId = requestAnimationFrame(updateBounds)\r\n }\r\n\r\n setBounds(bounds)\r\n }\r\n\r\n if (isActive) {\r\n updateBounds()\r\n setActiveClassName(activeClassName ?? \"\")\r\n } else if (!activeValue) clearBounds()\r\n\r\n if (shouldUpdateBounds) return () => cancelAnimationFrame(rafId)\r\n }, [\r\n mode,\r\n isActive,\r\n activeValue,\r\n setBounds,\r\n clearBounds,\r\n activeClassName,\r\n setActiveClassName,\r\n forceUpdateBounds,\r\n contextForceUpdateBounds,\r\n ])\r\n\r\n if (!React.isValidElement(children)) return children\r\n\r\n const dataAttributes = {\r\n \"data-active\": isActive ? \"true\" : \"false\",\r\n \"aria-selected\": isActive,\r\n \"data-disabled\": isDisabled,\r\n \"data-value\": childValue,\r\n \"data-highlight\": true,\r\n }\r\n\r\n const commonHandlers = hover\r\n ? {\r\n onMouseEnter: (e: React.MouseEvent<HTMLDivElement>) => {\r\n setActiveValue(childValue)\r\n element.props.onMouseEnter?.(e)\r\n },\r\n onMouseLeave: (e: React.MouseEvent<HTMLDivElement>) => {\r\n setActiveValue(null)\r\n element.props.onMouseLeave?.(e)\r\n },\r\n }\r\n : click\r\n ? {\r\n onClick: (e: React.MouseEvent<HTMLDivElement>) => {\r\n setActiveValue(childValue)\r\n element.props.onClick?.(e)\r\n },\r\n }\r\n : {}\r\n\r\n if (asChild) {\r\n if (mode === \"children\") {\r\n return React.cloneElement(\r\n element,\r\n {\r\n key: childValue,\r\n ref: refCallback,\r\n className: cn(\"relative\", element.props.className),\r\n ...getNonOverridingDataAttributes(element, {\r\n ...dataAttributes,\r\n \"data-slot\": \"motion-highlight-item-container\",\r\n }),\r\n ...commonHandlers,\r\n ...props,\r\n },\r\n <>\r\n <AnimatePresence\r\n initial={false}\r\n mode=\"wait\"\r\n >\r\n {isActive && !isDisabled && (\r\n <motion.div\r\n animate={{ opacity: 1 }}\r\n className={cn(contextClassName, activeClassName)}\r\n data-slot=\"motion-highlight\"\r\n exit={{\r\n opacity: 0,\r\n transition: {\r\n ...itemTransition,\r\n delay:\r\n (itemTransition?.delay ?? 0) +\r\n (exitDelay ?? contextExitDelay ?? 0) / 1000,\r\n },\r\n }}\r\n initial={{ opacity: 0 }}\r\n layoutId={`transition-background-${contextId}`}\r\n style={{\r\n position: \"absolute\",\r\n zIndex: 0,\r\n ...contextStyle,\r\n ...style,\r\n }}\r\n transition={itemTransition}\r\n {...dataAttributes}\r\n />\r\n )}\r\n </AnimatePresence>\r\n\r\n <Component\r\n className={className}\r\n data-slot=\"motion-highlight-item\"\r\n style={{ position: \"relative\", zIndex: 1 }}\r\n {...dataAttributes}\r\n >\r\n {children}\r\n </Component>\r\n </>,\r\n )\r\n }\r\n\r\n return React.cloneElement(element, {\r\n ref: refCallback,\r\n ...getNonOverridingDataAttributes(element, {\r\n ...dataAttributes,\r\n \"data-slot\": \"motion-highlight-item\",\r\n }),\r\n ...commonHandlers,\r\n })\r\n }\r\n\r\n return enabled ? (\r\n <Component\r\n key={childValue}\r\n ref={localRef}\r\n className={cn(mode === \"children\" && \"relative\", className)}\r\n data-slot=\"motion-highlight-item-container\"\r\n {...dataAttributes}\r\n {...props}\r\n {...commonHandlers}\r\n >\r\n {mode === \"children\" && (\r\n <AnimatePresence\r\n initial={false}\r\n mode=\"wait\"\r\n >\r\n {isActive && !isDisabled && (\r\n <motion.div\r\n animate={{ opacity: 1 }}\r\n className={cn(contextClassName, activeClassName)}\r\n data-slot=\"motion-highlight\"\r\n exit={{\r\n opacity: 0,\r\n transition: {\r\n ...itemTransition,\r\n delay:\r\n (itemTransition?.delay ?? 0) +\r\n (exitDelay ?? contextExitDelay ?? 0) / 1000,\r\n },\r\n }}\r\n initial={{ opacity: 0 }}\r\n layoutId={`transition-background-${contextId}`}\r\n style={{\r\n position: \"absolute\",\r\n zIndex: 0,\r\n ...contextStyle,\r\n ...style,\r\n }}\r\n transition={itemTransition}\r\n {...dataAttributes}\r\n />\r\n )}\r\n </AnimatePresence>\r\n )}\r\n\r\n {React.cloneElement(element, {\r\n style: { position: \"relative\", zIndex: 1 },\r\n className: element.props.className,\r\n ...getNonOverridingDataAttributes(element, {\r\n ...dataAttributes,\r\n \"data-slot\": \"motion-highlight-item\",\r\n }),\r\n })}\r\n </Component>\r\n ) : (\r\n children\r\n )\r\n}\r\n\r\nexport {\r\n Highlight,\r\n HighlightItem,\r\n type HighlightItemProps,\r\n type HighlightProps,\r\n useHighlight,\r\n}"]}
@@ -0,0 +1,2 @@
1
+ import {cva}from'class-variance-authority';import {Loader2}from'lucide-react';import {Button}from'@base-ui/react/button';import {cn}from'@xploreu/lib/cn';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var m=cva(cn("group relative inline-flex h-max w-fit cursor-pointer items-center justify-center whitespace-nowrap outline-brand transition duration-100 ease-linear before:absolute focus-visible:outline-2 focus-visible:outline-offset-2 rounded-xp-buttons [&_svg]:shrink-0","disabled:cursor-not-allowed"),{variants:{color:{default:"focus-visible:outline-focus-ring",destructive:"focus-visible:outline-focus-ring-error","gradient-ai":"focus-visible:outline-focus-ring","linear-green":"focus-visible:outline-focus-ring-success","linear-overlay":"focus-visible:outline-focus-ring","linear-destructive":"focus-visible:outline-focus-ring-error"},variant:{primary:"before:rounded-lg before:absolute before:inset-0 before:border-1 before:border-white/12 before:mask-b-from-0% after:absolute after:inset-0 after:rounded-xp-buttons hover:after:bg-alpha-gray-20 after:bg-transparent after:transition-colors disabled:text-fg-disabled disabled:bg-none disabled:bg-[#F5F5F5] disabled:hover:after:bg-transparent disabled:before:border-border-disabled disabled:before:mask-none disabled:before:border-1 shadow-xp-md hover:shadow-xp-brand ",secondary:"border-1 shadow-xp-md hover:shadow-xp-brand disabled:bg-bg-disabled disabled:text-fg-disabled disabled:[&_svg]:text-fg-disabled-subtle disabled:border-border-disabled disabled:hover:text-fg-disabled disabled:hover:[&_svg]:text-fg-disabled-subtle","secondary-accent":"disabled:border-border-disabled disabled:bg-bg-disabled disabled:text-fg-disabled",tertiary:"disabled:bg-bg-disabled disabled:text-fg-disabled disabled:[&_svg]:text-bg-disabled","tertiary-accent":"disabled:bg-bg-disabled disabled:text-fg-disabled disabled:[&_svg]:text-fg-disabled-subtle",link:"underline decoration-transparent hover:decoration-inherit transition-colors disabled:bg-bg-disabled disabled:text-fg-disabled disabled:[&_svg]:text-fg-disabled-subtle disabled:hover:no-underline"},icon:{true:void 0,false:void 0},size:{sm:"text-label-semibold-3 px-xp-lg gap-xp-sm h-9 data-[icon]:size-9 data-[variant=link]:h-5 data-[variant=link]:px-0 [&_svg]:size-5",md:"text-label-semibold-3 px-3.5 gap-xp-sm h-10 data-[icon]:size-10 data-[variant=link]:h-5 data-[variant=link]:px-0 [&_svg]:size-5",lg:"text-label-semibold-2 px-xp-xl gap-xp-md h-11 data-[icon]:size-11 data-[variant=link]:h-[22px] data-[variant=link]:px-0 [&_svg]:size-5",xl:"text-label-semibold-2 px-4.5 gap-xp-md h-12 data-[icon]:size-12 data-[variant=link]:h-[22px] data-[variant=link]:px-0 [&_svg]:size-5"}},compoundVariants:[{variant:"primary",color:"default",className:"bg-gradient-buttons-gradient-blue text-text-primary-on-brand"},{variant:"secondary",color:"default",className:"bg-bg-primary text-text-secondary [&_svg]:text-fg-secondary border-border-primary-icon hover:bg-bg-primary-hover hover:text-text-secondary-hover [&_svg]:hover:text-text-quaternary-hover"},{variant:"secondary-accent",color:"default",className:"border-1 border-border-primary-icon text-fg-primary hover:bg-bg-brand-primary"},{variant:"tertiary",color:"default",className:"text-text-tertiary [&_svg]:text-fg-quaternary hover:bg-bg-primary-hover hover:text-text-tertiary-hover [&_svg]:hover:text-fg-quaternary-hover"},{variant:"tertiary-accent",color:"default",className:"bg-bg-brand-primary text-text-brand-tertiary [&_svg]:text-fg-brand-secondary hover:bg-bg-brand-secondary hover:text-text-brand-tertiary hover:[&_svg]:text-fg-brand-secondary-hover"},{variant:"link",color:"default",className:"text-text-brand-secondary [&_svg]:text-fg-brand-secondary-alt hover:text-text-brand-secondary-hover [&_svg]:hover:text-fg-brand-secondary-hover"},{variant:"primary",color:"destructive",className:"bg-bg-error-solid text-text-primary-on-brand"},{variant:"secondary",color:"destructive",className:"bg-bg-primary text-text-error-primary [&_svg]:text-fg-error-secondary border-border-error hover:bg-bg-error-primary hover:text-text-error-primary-hover [&_svg]:hover:text-fg-error-secondary"},{variant:"secondary-accent",color:"destructive",className:"border-1 border-border-error text-fg-error-primary hover:bg-bg-error-primary"},{variant:"tertiary",color:"destructive",className:"text-text-error-primary [&_svg]:text-fg-error-secondary hover:bg-bg-error-primary hover:text-text-error-primary-hover [&_svg]:hover:text-fg-error-primary"},{variant:"tertiary-accent",color:"destructive",className:"bg-bg-error-primary text-text-error-tertiary [&_svg]:text-fg-error-secondary hover:bg-bg-error-secondary hover:text-text-error-tertiary hover:[&_svg]:text-fg-error-secondary-hover"},{variant:"link",color:"destructive",className:"text-text-error-secondary [&_svg]:text-fg-error-secondary hover:text-text-error-primary-hover [&_svg]:hover:text-fg-error-primary"},{variant:"primary",color:"gradient-ai",className:"bg-gradient-buttons-button-ai text-text-primary-on-brand"},{variant:"secondary",color:"gradient-ai",className:"relative shadow-transparent border-transparent hover:bg-bg-primary bg-[linear-gradient(90deg,var(--color-bg-primary),var(--color-bg-primary)),var(--gradient-buttons-button-ai)] [background-clip:padding-box,border-box] [background-origin:padding-box,border-box] [&>span]:bg-gradient-buttons-button-ai [&>span]:bg-clip-text [&>span]:text-transparent after:absolute after:inset-0 after:rounded-md hover:after:bg-gradient-buttons-button-ai hover:after:opacity-10 disabled:hover:after:bg-transparent disabled:after:opacity-0 disabled:[&>span]:bg-none disabled:[&>span]:text-fg-disabled"},{variant:"secondary-accent",color:"gradient-ai",className:"border-1 border-border-brand text-fg-brand-primary hover:bg-bg-brand-primary"},{variant:"tertiary",color:"gradient-ai",className:"relative [&>span]:bg-gradient-buttons-button-ai [&>span]:bg-clip-text [&>span]:text-transparent after:absolute after:inset-0 after:rounded-md hover:after:bg-gradient-buttons-button-ai hover:after:opacity-10 disabled:hover:after:bg-transparent disabled:after:opacity-0 disabled:[&>span]:bg-none disabled:[&>span]:text-fg-disabled"},{variant:"tertiary-accent",color:"gradient-ai",className:"bg-bg-brand-primary text-text-brand-tertiary [&_svg]:text-fg-brand-secondary hover:bg-bg-brand-secondary hover:text-text-brand-tertiary hover:[&_svg]:text-fg-brand-secondary-hover"},{variant:"link",color:"gradient-ai",className:"text-text-brand-secondary [&_svg]:text-fg-brand-secondary-alt hover:text-text-brand-secondary-hover [&_svg]:hover:text-fg-brand-secondary-hover"},{variant:"primary",color:"linear-green",className:"bg-gradient-buttons-gradient-green text-text-primary-on-brand"},{variant:"secondary",color:"linear-green",className:"bg-bg-primary text-text-secondary [&_svg]:text-green-500 border-border-primary hover:text-text-secondary-hover [&_svg]:hover:text-green-900"},{variant:"secondary-accent",color:"linear-green",className:"border-1 border-border-primary text-fg-primary hover:bg-bg-primary"},{variant:"tertiary",color:"linear-green",className:"text-text-success-primary [&_svg]:text-green-500 hover:bg-bg-success-primary [&_svg]:hover:text-green-900"},{variant:"tertiary-accent",color:"linear-green",className:"bg-bg-success-primary text-text-success-tertiary [&_svg]:text-fg-success-secondary hover:bg-bg-success-secondary hover:text-text-success-tertiary hover:[&_svg]:text-fg-success-secondary-hover"},{variant:"link",color:"linear-green",className:"text-text-success-secondary [&_svg]:text-fg-success-secondary hover:text-text-success-primary-hover [&_svg]:hover:text-fg-success-primary"},{variant:"primary",color:"linear-overlay",className:"relative bg-bg-brand-solid text-text-primary-on-brand [&_svg]:text-button-primary-icon hover:[&_svg]:text-button-primary-icon-hover after:absolute after:inset-0 after:rounded-xp-buttons after:bg-gradient-skuemorphic-gradient-border after:hover:bg-gradient-skuemorphic-gradient-border"},{variant:"secondary",color:"linear-overlay",className:"bg-bg-brand-solid-hover text-text-secondary [&_svg]:text-fg-quaternary border-border-primary hover:bg-bg-primary-hover hover:text-text-secondary-hover [&_svg]:hover:text-text-quaternary-hover"},{variant:"secondary-accent",color:"linear-overlay",className:"border-1 border-border-brand text-fg-brand-primary hover:bg-bg-brand-primary"},{variant:"tertiary",color:"linear-overlay",className:"text-text-tertiary [&_svg]:text-fg-quaternary hover:bg-bg-primary-hover hover:text-text-tertiary-hover [&_svg]:hover:text-fg-quaternary-hover"},{variant:"tertiary-accent",color:"linear-overlay",className:"bg-bg-brand-primary text-text-brand-tertiary [&_svg]:text-fg-brand-secondary hover:bg-bg-brand-secondary hover:text-text-brand-tertiary hover:[&_svg]:text-fg-brand-secondary-hover"},{variant:"link",color:"linear-overlay",className:"text-text-brand-secondary [&_svg]:text-fg-brand-secondary-alt hover:text-text-brand-secondary-hover [&_svg]:hover:text-fg-brand-secondary-hover"},{variant:"primary",color:"linear-destructive",className:"relative bg-bg-error-solid text-text-primary-on-brand [&_svg]:text-button-destructive-primary-icon hover:[&_svg]:text-button-destructive-primary-icon-hover after:absolute after:inset-0 after:rounded-xp-buttons after:bg-gradient-skuemorphic-gradient-border after:hover:bg-gradient-skuemorphic-gradient-border"},{variant:"secondary",color:"linear-destructive",className:"bg-bg-error-solid-hover text-text-secondary [&_svg]:text-fg-quaternary border-border-primary hover:bg-bg-primary-hover hover:text-text-secondary-hover [&_svg]:hover:text-text-quaternary-hover"},{variant:"secondary-accent",color:"linear-destructive",className:"border-1 border-border-error text-fg-error-primary hover:bg-bg-error-primary"},{variant:"tertiary",color:"linear-destructive",className:"text-text-error-primary [&_svg]:text-fg-error-secondary hover:bg-bg-error-primary hover:text-text-tertiary-hover [&_svg]:hover:text-fg-error-secondary"},{variant:"tertiary-accent",color:"linear-destructive",className:"bg-bg-error-primary text-text-error-tertiary [&_svg]:text-fg-error-secondary hover:bg-bg-error-secondary hover:text-text-error-tertiary hover:[&_svg]:text-fg-error-secondary-hover"},{variant:"link",color:"linear-destructive",className:"text-text-error-primary [&_svg]:text-fg-error-secondary hover:text-text-error-primary-hover [&_svg]:hover:text-fg-error-primary"}],defaultVariants:{variant:"primary",color:"default",size:"sm"}});function z({className:s,color:i,variant:e,size:n,loading:t=false,children:d,disabled:b,icon:g,nativeButton:v,render:a,...l}){let c=a!=null?false:v;return jsx(Button,{className:cn(m({color:i,variant:e,size:n,className:s})),"data-icon":g?"":void 0,"data-variant":e,disabled:b||t,nativeButton:c,render:a,...l,children:t?jsxs(Fragment,{children:[jsx(Loader2,{className:"size-4 animate-spin"}),jsx("span",{children:"Loading..."})]}):d})}export{m as a,z as b};//# sourceMappingURL=chunk-XK5GMNOS.js.map
2
+ //# sourceMappingURL=chunk-XK5GMNOS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ui/button.tsx"],"names":["buttonVariants","cva","cn","Button","className","color","variant","size","loading","children","disabled","icon","nativeButton","render","props","resolvedNativeButton","jsx","ButtonPrimitive","jsxs","Fragment","Loader2"],"mappings":"4MAMA,IAAMA,CAAAA,CAAiBC,GAAAA,CACrBC,EAAAA,CACE,kQAAA,CACA,6BACF,CAAA,CACA,CACE,QAAA,CAAU,CACR,KAAA,CAAO,CACL,OAAA,CAAS,kCAAA,CACT,WAAA,CAAa,wCAAA,CACb,aAAA,CAAe,kCAAA,CACf,cAAA,CAAgB,0CAAA,CAChB,iBAAkB,kCAAA,CAClB,oBAAA,CAAsB,wCACxB,CAAA,C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AAA,CAAWf,EAAAA,CAAGF,CAAAA,CAAe,CAAE,KAAA,CAAAK,EAAO,OAAA,CAAAC,CAAAA,CAAS,IAAA,CAAAC,CAAAA,CAAM,SAAA,CAAAH,CAAU,CAAC,CAAC,CAAA,CACjE,WAAA,CAAWO,CAAAA,CAAO,EAAA,CAAK,MAAA,CACvB,cAAA,CAAcL,EACd,QAAA,CAAUI,CAAAA,EAAYF,CAAAA,CACtB,YAAA,CAAcO,CAAAA,CACd,MAAA,CAAQF,CAAAA,CACP,GAAGC,CAAAA,CAEH,QAAA,CAAAN,CAAAA,CACCU,IAAAA,CAAAC,QAAAA,CAAA,CACE,UAAAH,GAAAA,CAACI,OAAAA,CAAA,CAAQ,SAAA,CAAU,qBAAA,CAAsB,CAAA,CACzCJ,GAAAA,CAAC,MAAA,CAAA,CAAK,QAAA,CAAA,YAAA,CAAU,CAAA,CAAA,CAClB,CAAA,CAEAP,CAAAA,CAEJ,CAEJ","file":"chunk-XK5GMNOS.js","sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\"\nimport { Loader2 } from \"lucide-react\"\n\nimport { Button as ButtonPrimitive } from \"@base-ui/react/button\"\nimport { cn } from \"@xploreu/lib/cn\"\n\nconst buttonVariants = cva(\n cn(\n \"group relative inline-flex h-max w-fit cursor-pointer items-center justify-center whitespace-nowrap outline-brand transition duration-100 ease-linear before:absolute focus-visible:outline-2 focus-visible:outline-offset-2 rounded-xp-buttons [&_svg]:shrink-0\",\n \"disabled:cursor-not-allowed\",\n ),\n {\n variants: {\n color: {\n default: \"focus-visible:outline-focus-ring\",\n destructive: \"focus-visible:outline-focus-ring-error\",\n \"gradient-ai\": \"focus-visible:outline-focus-ring\",\n \"linear-green\": \"focus-visible:outline-focus-ring-success\",\n \"linear-overlay\": \"focus-visible:outline-focus-ring\",\n \"linear-destructive\": \"focus-visible:outline-focus-ring-error\",\n },\n variant: {\n primary: \"before:rounded-lg before:absolute before:inset-0 before:border-1 before:border-white/12 before:mask-b-from-0% after:absolute after:inset-0 after:rounded-xp-buttons hover:after:bg-alpha-gray-20 after:bg-transparent after:transition-colors disabled:text-fg-disabled disabled:bg-none disabled:bg-[#F5F5F5] disabled:hover:after:bg-transparent disabled:before:border-border-disabled disabled:before:mask-none disabled:before:border-1 shadow-xp-md hover:shadow-xp-brand \",\n secondary: \"border-1 shadow-xp-md hover:shadow-xp-brand disabled:bg-bg-disabled disabled:text-fg-disabled disabled:[&_svg]:text-fg-disabled-subtle disabled:border-border-disabled disabled:hover:text-fg-disabled disabled:hover:[&_svg]:text-fg-disabled-subtle\",\n \"secondary-accent\": \"disabled:border-border-disabled disabled:bg-bg-disabled disabled:text-fg-disabled\",\n tertiary: \"disabled:bg-bg-disabled disabled:text-fg-disabled disabled:[&_svg]:text-bg-disabled\",\n \"tertiary-accent\": \"disabled:bg-bg-disabled disabled:text-fg-disabled disabled:[&_svg]:text-fg-disabled-subtle\",\n link: \"underline decoration-transparent hover:decoration-inherit transition-colors disabled:bg-bg-disabled disabled:text-fg-disabled disabled:[&_svg]:text-fg-disabled-subtle disabled:hover:no-underline\",\n },\n icon: {\n true: undefined,\n false: undefined\n },\n size: {\n sm: \"text-label-semibold-3 px-xp-lg gap-xp-sm h-9 data-[icon]:size-9 data-[variant=link]:h-5 data-[variant=link]:px-0 [&_svg]:size-5\",\n md: \"text-label-semibold-3 px-3.5 gap-xp-sm h-10 data-[icon]:size-10 data-[variant=link]:h-5 data-[variant=link]:px-0 [&_svg]:size-5\",\n lg: \"text-label-semibold-2 px-xp-xl gap-xp-md h-11 data-[icon]:size-11 data-[variant=link]:h-[22px] data-[variant=link]:px-0 [&_svg]:size-5\",\n xl: \"text-label-semibold-2 px-4.5 gap-xp-md h-12 data-[icon]:size-12 data-[variant=link]:h-[22px] data-[variant=link]:px-0 [&_svg]:size-5\",\n }\n },\n compoundVariants: [\n // Default Color Variants\n {\n variant: \"primary\",\n color: \"default\",\n className: \"bg-gradient-buttons-gradient-blue text-text-primary-on-brand\"\n },\n {\n variant: \"secondary\",\n color: \"default\",\n className: \"bg-bg-primary text-text-secondary [&_svg]:text-fg-secondary border-border-primary-icon hover:bg-bg-primary-hover hover:text-text-secondary-hover [&_svg]:hover:text-text-quaternary-hover\"\n },\n {\n variant: \"secondary-accent\",\n color: \"default\",\n className: \"border-1 border-border-primary-icon text-fg-primary hover:bg-bg-brand-primary\"\n },\n {\n variant: \"tertiary\",\n color: \"default\",\n className: \"text-text-tertiary [&_svg]:text-fg-quaternary hover:bg-bg-primary-hover hover:text-text-tertiary-hover [&_svg]:hover:text-fg-quaternary-hover\"\n },\n {\n variant: \"tertiary-accent\",\n color: \"default\",\n className: \"bg-bg-brand-primary text-text-brand-tertiary [&_svg]:text-fg-brand-secondary hover:bg-bg-brand-secondary hover:text-text-brand-tertiary hover:[&_svg]:text-fg-brand-secondary-hover\"\n },\n {\n variant: \"link\",\n color: \"default\",\n className: \"text-text-brand-secondary [&_svg]:text-fg-brand-secondary-alt hover:text-text-brand-secondary-hover [&_svg]:hover:text-fg-brand-secondary-hover\"\n },\n\n // Destructive Color Variants\n {\n variant: \"primary\",\n color: \"destructive\",\n className: \"bg-bg-error-solid text-text-primary-on-brand\"\n },\n {\n variant: \"secondary\",\n color: \"destructive\",\n className: \"bg-bg-primary text-text-error-primary [&_svg]:text-fg-error-secondary border-border-error hover:bg-bg-error-primary hover:text-text-error-primary-hover [&_svg]:hover:text-fg-error-secondary\"\n },\n {\n // Not existing in design system yet\n variant: \"secondary-accent\",\n color: \"destructive\",\n className: \"border-1 border-border-error text-fg-error-primary hover:bg-bg-error-primary\"\n },\n {\n variant: \"tertiary\",\n color: \"destructive\",\n className: \"text-text-error-primary [&_svg]:text-fg-error-secondary hover:bg-bg-error-primary hover:text-text-error-primary-hover [&_svg]:hover:text-fg-error-primary\"\n },\n {\n // Not existing in design system yet\n variant: \"tertiary-accent\",\n color: \"destructive\",\n className: \"bg-bg-error-primary text-text-error-tertiary [&_svg]:text-fg-error-secondary hover:bg-bg-error-secondary hover:text-text-error-tertiary hover:[&_svg]:text-fg-error-secondary-hover\"\n },\n {\n variant: \"link\",\n color: \"destructive\",\n className: \"text-text-error-secondary [&_svg]:text-fg-error-secondary hover:text-text-error-primary-hover [&_svg]:hover:text-fg-error-primary\"\n },\n\n // Gradient AI\n {\n variant: \"primary\",\n color: \"gradient-ai\",\n className: \"bg-gradient-buttons-button-ai text-text-primary-on-brand\"\n },\n {\n variant: \"secondary\",\n color: \"gradient-ai\",\n className: \"relative shadow-transparent border-transparent hover:bg-bg-primary bg-[linear-gradient(90deg,var(--color-bg-primary),var(--color-bg-primary)),var(--gradient-buttons-button-ai)] [background-clip:padding-box,border-box] [background-origin:padding-box,border-box] [&>span]:bg-gradient-buttons-button-ai [&>span]:bg-clip-text [&>span]:text-transparent after:absolute after:inset-0 after:rounded-md hover:after:bg-gradient-buttons-button-ai hover:after:opacity-10 disabled:hover:after:bg-transparent disabled:after:opacity-0 disabled:[&>span]:bg-none disabled:[&>span]:text-fg-disabled\"\n },\n {\n // Not existing in design system yet\n variant: \"secondary-accent\",\n color: \"gradient-ai\",\n className: \"border-1 border-border-brand text-fg-brand-primary hover:bg-bg-brand-primary\"\n },\n {\n variant: \"tertiary\",\n color: \"gradient-ai\",\n className: \"relative [&>span]:bg-gradient-buttons-button-ai [&>span]:bg-clip-text [&>span]:text-transparent after:absolute after:inset-0 after:rounded-md hover:after:bg-gradient-buttons-button-ai hover:after:opacity-10 disabled:hover:after:bg-transparent disabled:after:opacity-0 disabled:[&>span]:bg-none disabled:[&>span]:text-fg-disabled\"\n },\n {\n // Not existing in design system yet\n variant: \"tertiary-accent\",\n color: \"gradient-ai\",\n className: \"bg-bg-brand-primary text-text-brand-tertiary [&_svg]:text-fg-brand-secondary hover:bg-bg-brand-secondary hover:text-text-brand-tertiary hover:[&_svg]:text-fg-brand-secondary-hover\"\n },\n {\n // Not existing in design system yet\n variant: \"link\",\n color: \"gradient-ai\",\n className: \"text-text-brand-secondary [&_svg]:text-fg-brand-secondary-alt hover:text-text-brand-secondary-hover [&_svg]:hover:text-fg-brand-secondary-hover\"\n },\n\n // Linear Green Color Variants\n {\n variant: \"primary\",\n color: \"linear-green\",\n className: \"bg-gradient-buttons-gradient-green text-text-primary-on-brand\"\n },\n {\n variant: \"secondary\",\n color: \"linear-green\",\n className: \"bg-bg-primary text-text-secondary [&_svg]:text-green-500 border-border-primary hover:text-text-secondary-hover [&_svg]:hover:text-green-900\"\n },\n {\n // Not existing in design system yet\n variant: \"secondary-accent\",\n color: \"linear-green\",\n className: \"border-1 border-border-primary text-fg-primary hover:bg-bg-primary\"\n },\n {\n variant: \"tertiary\",\n color: \"linear-green\",\n className: \"text-text-success-primary [&_svg]:text-green-500 hover:bg-bg-success-primary [&_svg]:hover:text-green-900\"\n },\n {\n // Not existing in design system yet\n variant: \"tertiary-accent\",\n color: \"linear-green\",\n className: \"bg-bg-success-primary text-text-success-tertiary [&_svg]:text-fg-success-secondary hover:bg-bg-success-secondary hover:text-text-success-tertiary hover:[&_svg]:text-fg-success-secondary-hover\"\n },\n {\n // Not existing in design system yet\n variant: \"link\",\n color: \"linear-green\",\n className: \"text-text-success-secondary [&_svg]:text-fg-success-secondary hover:text-text-success-primary-hover [&_svg]:hover:text-fg-success-primary\"\n },\n\n // Linear Overlay Color Variants\n {\n variant: \"primary\",\n color: \"linear-overlay\",\n className: \"relative bg-bg-brand-solid text-text-primary-on-brand [&_svg]:text-button-primary-icon hover:[&_svg]:text-button-primary-icon-hover after:absolute after:inset-0 after:rounded-xp-buttons after:bg-gradient-skuemorphic-gradient-border after:hover:bg-gradient-skuemorphic-gradient-border\"\n },\n {\n variant: \"secondary\",\n color: \"linear-overlay\",\n className: \"bg-bg-brand-solid-hover text-text-secondary [&_svg]:text-fg-quaternary border-border-primary hover:bg-bg-primary-hover hover:text-text-secondary-hover [&_svg]:hover:text-text-quaternary-hover\"\n },\n {\n variant: \"secondary-accent\",\n color: \"linear-overlay\",\n className: \"border-1 border-border-brand text-fg-brand-primary hover:bg-bg-brand-primary\"\n },\n {\n variant: \"tertiary\",\n color: \"linear-overlay\",\n className: \"text-text-tertiary [&_svg]:text-fg-quaternary hover:bg-bg-primary-hover hover:text-text-tertiary-hover [&_svg]:hover:text-fg-quaternary-hover\"\n },\n {\n variant: \"tertiary-accent\",\n color: \"linear-overlay\",\n className: \"bg-bg-brand-primary text-text-brand-tertiary [&_svg]:text-fg-brand-secondary hover:bg-bg-brand-secondary hover:text-text-brand-tertiary hover:[&_svg]:text-fg-brand-secondary-hover\"\n },\n {\n variant: \"link\",\n color: \"linear-overlay\",\n className: \"text-text-brand-secondary [&_svg]:text-fg-brand-secondary-alt hover:text-text-brand-secondary-hover [&_svg]:hover:text-fg-brand-secondary-hover\"\n },\n\n // Linear Destructive Color Variants\n {\n variant: \"primary\",\n color: \"linear-destructive\",\n className: \"relative bg-bg-error-solid text-text-primary-on-brand [&_svg]:text-button-destructive-primary-icon hover:[&_svg]:text-button-destructive-primary-icon-hover after:absolute after:inset-0 after:rounded-xp-buttons after:bg-gradient-skuemorphic-gradient-border after:hover:bg-gradient-skuemorphic-gradient-border\"\n },\n {\n variant: \"secondary\",\n color: \"linear-destructive\",\n className: \"bg-bg-error-solid-hover text-text-secondary [&_svg]:text-fg-quaternary border-border-primary hover:bg-bg-primary-hover hover:text-text-secondary-hover [&_svg]:hover:text-text-quaternary-hover\"\n },\n {\n // Not existing in design system yet\n variant: \"secondary-accent\",\n color: \"linear-destructive\",\n className: \"border-1 border-border-error text-fg-error-primary hover:bg-bg-error-primary\"\n },\n {\n variant: \"tertiary\",\n color: \"linear-destructive\",\n className: \"text-text-error-primary [&_svg]:text-fg-error-secondary hover:bg-bg-error-primary hover:text-text-tertiary-hover [&_svg]:hover:text-fg-error-secondary\"\n },\n {\n // Not existing in design system yet\n variant: \"tertiary-accent\",\n color: \"linear-destructive\",\n className: \"bg-bg-error-primary text-text-error-tertiary [&_svg]:text-fg-error-secondary hover:bg-bg-error-secondary hover:text-text-error-tertiary hover:[&_svg]:text-fg-error-secondary-hover\"\n },\n {\n variant: \"link\",\n color: \"linear-destructive\",\n className: \"text-text-error-primary [&_svg]:text-fg-error-secondary hover:text-text-error-primary-hover [&_svg]:hover:text-fg-error-primary\"\n },\n ],\n defaultVariants: {\n variant: \"primary\",\n color: \"default\",\n size: \"sm\",\n },\n }\n)\n\nfunction Button({\n className,\n color,\n variant,\n size,\n loading = false,\n children,\n disabled,\n icon,\n nativeButton,\n render,\n ...props\n}: ButtonPrimitive.Props &\n VariantProps<typeof buttonVariants> & {\n loading?: boolean\n }) {\n // ponytail: auto-detect nativeButton when render is provided\n const resolvedNativeButton = render != null ? false : nativeButton\n\n return (\n <ButtonPrimitive\n className={cn(buttonVariants({ color, variant, size, className }))}\n data-icon={icon ? \"\" : undefined}\n data-variant={variant}\n disabled={disabled || loading}\n nativeButton={resolvedNativeButton}\n render={render}\n {...props}\n >\n {loading ? (\n <>\n <Loader2 className=\"size-4 animate-spin\" />\n <span>Loading...</span>\n </>\n ) : (\n children\n )}\n </ButtonPrimitive>\n )\n}\n\nexport { Button, buttonVariants }"]}
@@ -1,2 +1,2 @@
1
- import {a}from'./chunk-VFZXA6DY.js';import'react';import {motion}from'motion/react';import {useAutoHeight}from'@xploreu/hooks/use-auto-height';import {jsx}from'react/jsx-runtime';function u({children:o,deps:e=[],transition:n={type:"spring",stiffness:300,damping:30,bounce:0,restDelta:.01},style:r,animate:s,asChild:a$1=false,...p}){let{ref:m,height:d}=useAutoHeight(e),h=a$1?a:motion.div;return jsx(h,{animate:{height:d,...s},style:{overflow:"hidden",...r},transition:n,...p,children:jsx("div",{ref:m,children:o})})}export{u as a};//# sourceMappingURL=chunk-ZXAHA7TB.js.map
2
- //# sourceMappingURL=chunk-ZXAHA7TB.js.map
1
+ import {a}from'./chunk-2TUGHMFW.js';import'react';import {motion}from'motion/react';import {useAutoHeight}from'@xploreu/hooks/use-auto-height';import {jsx}from'react/jsx-runtime';function u({children:o,deps:e=[],transition:n={type:"spring",stiffness:300,damping:30,bounce:0,restDelta:.01},style:r,animate:s,asChild:a$1=false,...p}){let{ref:m,height:d}=useAutoHeight(e),h=a$1?a:motion.div;return jsx(h,{animate:{height:d,...s},style:{overflow:"hidden",...r},transition:n,...p,children:jsx("div",{ref:m,children:o})})}export{u as a};//# sourceMappingURL=chunk-ZVME3JB3.js.map
2
+ //# sourceMappingURL=chunk-ZVME3JB3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/effects/auto-height.tsx"],"names":["AutoHeight","children","deps","transition","style","animate","asChild","props","ref","height","useAutoHeight","Comp","Slot","motion","jsx"],"mappings":"mLAwBA,SAASA,CAAAA,CAAW,CAClB,SAAAC,CAAAA,CACA,IAAA,CAAAC,EAAO,EAAC,CACR,WAAAC,CAAAA,CAAa,CACX,KAAM,QAAA,CACN,SAAA,CAAW,IACX,OAAA,CAAS,EAAA,CACT,OAAQ,CAAA,CACR,SAAA,CAAW,GACb,CAAA,CACA,KAAA,CAAAC,EACA,OAAA,CAAAC,CAAAA,CACA,QAAAC,GAAAA,CAAU,KAAA,CACV,GAAGC,CACL,CAAA,CAAoB,CAClB,GAAM,CAAE,IAAAC,CAAAA,CAAK,MAAA,CAAAC,CAAO,CAAA,CAAIC,aAAAA,CAA8BR,CAAI,CAAA,CAEpDS,CAAAA,CAAOL,IAAUM,CAAAA,CAAOC,MAAAA,CAAO,IAErC,OACEC,GAAAA,CAACH,EAAA,CACC,OAAA,CAAS,CAAE,MAAA,CAAAF,CAAAA,CAAQ,GAAGJ,CAAQ,CAAA,CAC9B,MAAO,CAAE,QAAA,CAAU,SAAU,GAAGD,CAAM,EACtC,UAAA,CAAYD,CAAAA,CACX,GAAGI,CAAAA,CAEJ,QAAA,CAAAO,IAAC,KAAA,CAAA,CAAI,GAAA,CAAKN,EACP,QAAA,CAAAP,CAAAA,CACH,EACF,CAEJ","file":"chunk-ZVME3JB3.js","sourcesContent":["\"use client\"\r\n\r\nimport * as React from \"react\"\r\n\r\nimport {\r\n type HTMLMotionProps,\r\n type LegacyAnimationControls,\r\n motion,\r\n type TargetAndTransition,\r\n type Transition,\r\n} from \"motion/react\"\r\n\r\nimport { Slot, type WithAsChild } from \"../primitives/slot\"\r\nimport { useAutoHeight } from \"@xploreu/hooks/use-auto-height\"\r\n\r\ntype AutoHeightProps = WithAsChild<\r\n {\r\n children: React.ReactNode;\r\n deps?: React.DependencyList;\r\n animate?: TargetAndTransition | LegacyAnimationControls;\r\n transition?: Transition;\r\n } & Omit<HTMLMotionProps<\"div\">, \"animate\">\r\n>\r\n\r\nfunction AutoHeight({\r\n children,\r\n deps = [],\r\n transition = {\r\n type: \"spring\",\r\n stiffness: 300,\r\n damping: 30,\r\n bounce: 0,\r\n restDelta: 0.01,\r\n },\r\n style,\r\n animate,\r\n asChild = false,\r\n ...props\r\n}: AutoHeightProps) {\r\n const { ref, height } = useAutoHeight<HTMLDivElement>(deps)\r\n\r\n const Comp = asChild ? Slot : motion.div\r\n\r\n return (\r\n <Comp\r\n animate={{ height, ...animate }}\r\n style={{ overflow: \"hidden\", ...style }}\r\n transition={transition}\r\n {...props}\r\n >\r\n <div ref={ref}>\r\n {children}\r\n </div>\r\n </Comp>\r\n )\r\n}\r\n\r\nexport { AutoHeight, type AutoHeightProps }\r\n"]}
@@ -1,2 +1,2 @@
1
- export{a as AutoHeight}from'../chunk-ZXAHA7TB.js';import'../chunk-VFZXA6DY.js';//# sourceMappingURL=auto-height.js.map
1
+ export{a as AutoHeight}from'../chunk-ZVME3JB3.js';import'../chunk-2TUGHMFW.js';//# sourceMappingURL=auto-height.js.map
2
2
  //# sourceMappingURL=auto-height.js.map
@@ -1,2 +1,2 @@
1
- export{b as Highlight,c as HighlightItem,a as useHighlight}from'../chunk-MF7T3OYE.js';//# sourceMappingURL=highlight.js.map
1
+ export{b as Highlight,c as HighlightItem,a as useHighlight}from'../chunk-KYD4ATTG.js';//# sourceMappingURL=highlight.js.map
2
2
  //# sourceMappingURL=highlight.js.map
@@ -1,2 +1,2 @@
1
- export{a as AutoHeight}from'../chunk-ZXAHA7TB.js';export{b as Highlight,c as HighlightItem,a as useHighlight}from'../chunk-MF7T3OYE.js';import'../chunk-VFZXA6DY.js';//# sourceMappingURL=index.js.map
1
+ export{a as AutoHeight}from'../chunk-ZVME3JB3.js';export{b as Highlight,c as HighlightItem,a as useHighlight}from'../chunk-KYD4ATTG.js';import'../chunk-2TUGHMFW.js';//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,35 +1,35 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
- import * as DialogPrimitive from '@radix-ui/react-dialog';
3
+ import { Dialog as Dialog$1 } from '@base-ui/react/dialog';
4
4
  import { HTMLMotionProps } from 'motion/react';
5
5
 
6
6
  type DialogContextType = {
7
7
  open: boolean;
8
- setOpen: (open: boolean) => void;
8
+ setOpen: DialogProps['onOpenChange'];
9
9
  };
10
10
  declare const useDialog: () => DialogContextType;
11
- type DialogProps = React.ComponentProps<typeof DialogPrimitive.Root>;
12
- declare function Dialog({ open: openProp, defaultOpen, onOpenChange, ...props }: DialogProps): react_jsx_runtime.JSX.Element;
13
- type DialogTriggerProps = React.ComponentProps<typeof DialogPrimitive.Trigger>;
11
+ type DialogProps = React.ComponentProps<typeof Dialog$1.Root>;
12
+ declare function Dialog(props: DialogProps): react_jsx_runtime.JSX.Element;
13
+ type DialogTriggerProps = React.ComponentProps<typeof Dialog$1.Trigger>;
14
14
  declare function DialogTrigger(props: DialogTriggerProps): react_jsx_runtime.JSX.Element;
15
- type DialogPortalProps = Omit<React.ComponentProps<typeof DialogPrimitive.Portal>, "forceMount">;
15
+ type DialogPortalProps = Omit<React.ComponentProps<typeof Dialog$1.Portal>, 'keepMounted'>;
16
16
  declare function DialogPortal(props: DialogPortalProps): react_jsx_runtime.JSX.Element;
17
- type DialogOverlayProps = Omit<React.ComponentProps<typeof DialogPrimitive.Overlay>, "forceMount" | "asChild"> & HTMLMotionProps<"div">;
18
- declare function DialogOverlay({ transition, ...props }: DialogOverlayProps): react_jsx_runtime.JSX.Element;
19
- type DialogFlipDirection = "top" | "bottom" | "left" | "right";
20
- type DialogContentProps = Omit<React.ComponentProps<typeof DialogPrimitive.Content>, "forceMount" | "asChild"> & HTMLMotionProps<"div"> & {
17
+ type DialogBackdropProps = Omit<React.ComponentProps<typeof Dialog$1.Backdrop>, 'render'> & HTMLMotionProps<'div'>;
18
+ declare function DialogBackdrop({ transition, ...props }: DialogBackdropProps): react_jsx_runtime.JSX.Element;
19
+ type DialogFlipDirection = 'top' | 'bottom' | 'left' | 'right';
20
+ type DialogPopupProps = Omit<React.ComponentProps<typeof Dialog$1.Popup>, 'render'> & HTMLMotionProps<'div'> & {
21
21
  from?: DialogFlipDirection;
22
22
  };
23
- declare function DialogContent({ from, onOpenAutoFocus, onCloseAutoFocus, onEscapeKeyDown, onPointerDownOutside, onInteractOutside, transition, ref, ...props }: DialogContentProps): react_jsx_runtime.JSX.Element;
24
- type DialogCloseProps = React.ComponentProps<typeof DialogPrimitive.Close>;
23
+ declare function DialogPopup({ from, initialFocus, finalFocus, transition, className, ...props }: DialogPopupProps): react_jsx_runtime.JSX.Element;
24
+ type DialogCloseProps = React.ComponentProps<typeof Dialog$1.Close>;
25
25
  declare function DialogClose(props: DialogCloseProps): react_jsx_runtime.JSX.Element;
26
- type DialogHeaderProps = React.ComponentProps<"div">;
26
+ type DialogHeaderProps = React.ComponentProps<'div'>;
27
27
  declare function DialogHeader(props: DialogHeaderProps): react_jsx_runtime.JSX.Element;
28
- type DialogFooterProps = React.ComponentProps<"div">;
28
+ type DialogFooterProps = React.ComponentProps<'div'>;
29
29
  declare function DialogFooter(props: DialogFooterProps): react_jsx_runtime.JSX.Element;
30
- type DialogTitleProps = React.ComponentProps<typeof DialogPrimitive.Title>;
30
+ type DialogTitleProps = React.ComponentProps<typeof Dialog$1.Title>;
31
31
  declare function DialogTitle(props: DialogTitleProps): react_jsx_runtime.JSX.Element;
32
- type DialogDescriptionProps = React.ComponentProps<typeof DialogPrimitive.Description>;
32
+ type DialogDescriptionProps = React.ComponentProps<typeof Dialog$1.Description>;
33
33
  declare function DialogDescription(props: DialogDescriptionProps): react_jsx_runtime.JSX.Element;
34
34
 
35
- export { Dialog, DialogClose, type DialogCloseProps, DialogContent, type DialogContentProps, type DialogContextType, DialogDescription, type DialogDescriptionProps, type DialogFlipDirection, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderProps, DialogOverlay, type DialogOverlayProps, DialogPortal, type DialogPortalProps, type DialogProps, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps, useDialog };
35
+ export { Dialog, DialogBackdrop, type DialogBackdropProps, DialogClose, type DialogCloseProps, type DialogContextType, DialogDescription, type DialogDescriptionProps, type DialogFlipDirection, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderProps, DialogPopup, type DialogPopupProps, DialogPortal, type DialogPortalProps, type DialogProps, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps, useDialog };
@@ -1,2 +1,2 @@
1
- export{b as Dialog,g as DialogClose,f as DialogContent,k as DialogDescription,i as DialogFooter,h as DialogHeader,e as DialogOverlay,d as DialogPortal,j as DialogTitle,c as DialogTrigger,a as useDialog}from'../chunk-YMSEOWKF.js';//# sourceMappingURL=dialog.js.map
1
+ export{b as Dialog,e as DialogBackdrop,g as DialogClose,k as DialogDescription,i as DialogFooter,h as DialogHeader,f as DialogPopup,d as DialogPortal,j as DialogTitle,c as DialogTrigger,a as useDialog}from'../chunk-5YDJTHDG.js';//# sourceMappingURL=dialog.js.map
2
2
  //# sourceMappingURL=dialog.js.map
@@ -1,10 +1,10 @@
1
1
  export { AnyProps, DOMMotionProps, Slot, SlotProps, WithAsChild } from './slot.js';
2
- export { Dialog, DialogClose, DialogCloseProps, DialogContent, DialogContentProps, DialogContextType, DialogDescription, DialogDescriptionProps, DialogFlipDirection, DialogFooter, DialogFooterProps, DialogHeader, DialogHeaderProps, DialogOverlay, DialogOverlayProps, DialogPortal, DialogPortalProps, DialogProps, DialogTitle, DialogTitleProps, DialogTrigger, DialogTriggerProps, useDialog } from './dialog.js';
2
+ export { Dialog, DialogBackdrop, DialogBackdropProps, DialogClose, DialogCloseProps, DialogContextType, DialogDescription, DialogDescriptionProps, DialogFlipDirection, DialogFooter, DialogFooterProps, DialogHeader, DialogHeaderProps, DialogPopup, DialogPopupProps, DialogPortal, DialogPortalProps, DialogProps, DialogTitle, DialogTitleProps, DialogTrigger, DialogTriggerProps, useDialog } from './dialog.js';
3
3
  export { Tabs, TabsContent, TabsContentProps, TabsContents, TabsContentsProps, TabsHighlight, TabsHighlightItem, TabsHighlightItemProps, TabsHighlightProps, TabsList, TabsListProps, TabsProps, TabsTrigger, TabsTriggerProps } from './tabs.js';
4
4
  import 'react/jsx-runtime';
5
5
  import 'react';
6
6
  import 'motion/react';
7
- import '@radix-ui/react-dialog';
7
+ import '@base-ui/react/dialog';
8
8
  import '@radix-ui/react-tabs';
9
9
  import '../effects/auto-height.js';
10
10
  import '../effects/highlight.js';
@@ -1,2 +1,2 @@
1
- export{b as Dialog,g as DialogClose,f as DialogContent,k as DialogDescription,i as DialogFooter,h as DialogHeader,e as DialogOverlay,d as DialogPortal,j as DialogTitle,c as DialogTrigger,a as useDialog}from'../chunk-YMSEOWKF.js';export{a as Tabs,f as TabsContent,g as TabsContents,b as TabsHighlight,d as TabsHighlightItem,c as TabsList,e as TabsTrigger}from'../chunk-P4RPQUEL.js';import'../chunk-ZXAHA7TB.js';import'../chunk-MF7T3OYE.js';export{a as Slot}from'../chunk-VFZXA6DY.js';//# sourceMappingURL=index.js.map
1
+ export{b as Dialog,e as DialogBackdrop,g as DialogClose,k as DialogDescription,i as DialogFooter,h as DialogHeader,f as DialogPopup,d as DialogPortal,j as DialogTitle,c as DialogTrigger,a as useDialog}from'../chunk-5YDJTHDG.js';export{a as Tabs,f as TabsContent,g as TabsContents,b as TabsHighlight,d as TabsHighlightItem,c as TabsList,e as TabsTrigger}from'../chunk-AMNHVMRK.js';import'../chunk-ZVME3JB3.js';import'../chunk-KYD4ATTG.js';export{a as Slot}from'../chunk-2TUGHMFW.js';//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,9 +1,9 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
- import { HTMLMotionProps } from 'motion/react';
3
+ import { HTMLMotionProps, motion } from 'motion/react';
4
4
 
5
5
  type AnyProps = Record<string, unknown>;
6
- type DOMMotionProps<T extends HTMLElement = HTMLElement> = Omit<HTMLMotionProps<keyof Omit<HTMLElementTagNameMap, `gmpx${string}`>>, "ref"> & {
6
+ type DOMMotionProps<T extends HTMLElement = HTMLElement> = Omit<HTMLMotionProps<Extract<keyof HTMLElementTagNameMap, keyof typeof motion>>, "ref"> & {
7
7
  ref?: React.Ref<T>;
8
8
  };
9
9
  type WithAsChild<Base extends object> = (Base & {
@@ -1,2 +1,2 @@
1
- export{a as Slot}from'../chunk-VFZXA6DY.js';//# sourceMappingURL=slot.js.map
1
+ export{a as Slot}from'../chunk-2TUGHMFW.js';//# sourceMappingURL=slot.js.map
2
2
  //# sourceMappingURL=slot.js.map
@@ -1,2 +1,2 @@
1
- export{a as Tabs,f as TabsContent,g as TabsContents,b as TabsHighlight,d as TabsHighlightItem,c as TabsList,e as TabsTrigger}from'../chunk-P4RPQUEL.js';import'../chunk-ZXAHA7TB.js';import'../chunk-MF7T3OYE.js';import'../chunk-VFZXA6DY.js';//# sourceMappingURL=tabs.js.map
1
+ export{a as Tabs,f as TabsContent,g as TabsContents,b as TabsHighlight,d as TabsHighlightItem,c as TabsList,e as TabsTrigger}from'../chunk-AMNHVMRK.js';import'../chunk-ZVME3JB3.js';import'../chunk-KYD4ATTG.js';import'../chunk-2TUGHMFW.js';//# sourceMappingURL=tabs.js.map
2
2
  //# sourceMappingURL=tabs.js.map
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as class_variance_authority_types from 'class-variance-authority/types';
3
- import * as React from 'react';
4
3
  import { VariantProps } from 'class-variance-authority';
4
+ import { Button as Button$1 } from '@base-ui/react/button';
5
5
 
6
6
  declare const buttonVariants: (props?: ({
7
7
  color?: "default" | "destructive" | "gradient-ai" | "linear-green" | "linear-overlay" | "linear-destructive" | null | undefined;
@@ -9,8 +9,7 @@ declare const buttonVariants: (props?: ({
9
9
  icon?: boolean | null | undefined;
10
10
  size?: "sm" | "md" | "lg" | "xl" | null | undefined;
11
11
  } & class_variance_authority_types.ClassProp) | undefined) => string;
12
- declare function Button({ className, color, variant, size, asChild, loading, children, disabled, icon, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
13
- asChild?: boolean;
12
+ declare function Button({ className, color, variant, size, loading, children, disabled, icon, nativeButton, render, ...props }: Button$1.Props & VariantProps<typeof buttonVariants> & {
14
13
  loading?: boolean;
15
14
  }): react_jsx_runtime.JSX.Element;
16
15
 
package/dist/ui/button.js CHANGED
@@ -1,2 +1,2 @@
1
- export{b as Button,a as buttonVariants}from'../chunk-CJONAIBS.js';//# sourceMappingURL=button.js.map
1
+ export{b as Button,a as buttonVariants}from'../chunk-XK5GMNOS.js';//# sourceMappingURL=button.js.map
2
2
  //# sourceMappingURL=button.js.map
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { DialogProps as DialogProps$1, DialogCloseProps as DialogCloseProps$1, DialogContentProps as DialogContentProps$1, DialogDescriptionProps as DialogDescriptionProps$1, DialogFooterProps as DialogFooterProps$1, DialogHeaderProps as DialogHeaderProps$1, DialogTitleProps as DialogTitleProps$1, DialogTriggerProps as DialogTriggerProps$1 } from '../primitives/dialog.js';
3
- import 'react';
4
- import '@radix-ui/react-dialog';
2
+ import * as React from 'react';
3
+ import { DialogProps as DialogProps$1, DialogCloseProps as DialogCloseProps$1, DialogDescriptionProps as DialogDescriptionProps$1, DialogFooterProps as DialogFooterProps$1, DialogHeaderProps as DialogHeaderProps$1, DialogPopupProps as DialogPopupProps$1, DialogTitleProps as DialogTitleProps$1, DialogTriggerProps as DialogTriggerProps$1 } from '../primitives/dialog.js';
4
+ import '@base-ui/react/dialog';
5
5
  import 'motion/react';
6
6
 
7
7
  type DialogProps = DialogProps$1;
@@ -10,12 +10,12 @@ type DialogTriggerProps = DialogTriggerProps$1;
10
10
  declare function DialogTrigger(props: DialogTriggerProps): react_jsx_runtime.JSX.Element;
11
11
  type DialogCloseProps = DialogCloseProps$1;
12
12
  declare function DialogClose(props: DialogCloseProps): react_jsx_runtime.JSX.Element;
13
- type DialogContentProps = DialogContentProps$1 & {
13
+ type DialogPopupProps = DialogPopupProps$1 & {
14
14
  showCloseButton?: boolean;
15
15
  closeClassName?: string;
16
16
  onCloseClick?: React.MouseEventHandler;
17
17
  };
18
- declare function DialogContent({ className, children, showCloseButton, closeClassName, onCloseClick, ...props }: DialogContentProps): react_jsx_runtime.JSX.Element;
18
+ declare function DialogPopup({ className, children, showCloseButton, closeClassName, onCloseClick, ...props }: DialogPopupProps): react_jsx_runtime.JSX.Element;
19
19
  type DialogHeaderProps = DialogHeaderProps$1;
20
20
  declare function DialogHeader({ className, ...props }: DialogHeaderProps): react_jsx_runtime.JSX.Element;
21
21
  type DialogFooterProps = DialogFooterProps$1;
@@ -25,4 +25,4 @@ declare function DialogTitle({ className, ...props }: DialogTitleProps): react_j
25
25
  type DialogDescriptionProps = DialogDescriptionProps$1;
26
26
  declare function DialogDescription({ className, ...props }: DialogDescriptionProps): react_jsx_runtime.JSX.Element;
27
27
 
28
- export { Dialog, DialogClose, type DialogCloseProps, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderProps, type DialogProps, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps };
28
+ export { Dialog, DialogClose, type DialogCloseProps, DialogDescription, type DialogDescriptionProps, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderProps, DialogPopup, type DialogPopupProps, type DialogProps, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps };
package/dist/ui/dialog.js CHANGED
@@ -1,2 +1,2 @@
1
- export{a as Dialog,c as DialogClose,d as DialogContent,h as DialogDescription,f as DialogFooter,e as DialogHeader,g as DialogTitle,b as DialogTrigger}from'../chunk-X57LUCWV.js';import'../chunk-YMSEOWKF.js';//# sourceMappingURL=dialog.js.map
1
+ export{a as Dialog,c as DialogClose,h as DialogDescription,f as DialogFooter,e as DialogHeader,d as DialogPopup,g as DialogTitle,b as DialogTrigger}from'../chunk-52U7K5UV.js';import'../chunk-5YDJTHDG.js';//# sourceMappingURL=dialog.js.map
2
2
  //# sourceMappingURL=dialog.js.map
@@ -1,12 +1,13 @@
1
1
  export { Button, buttonVariants } from './button.js';
2
- export { Dialog, DialogClose, DialogCloseProps, DialogContent, DialogContentProps, DialogDescription, DialogDescriptionProps, DialogFooter, DialogFooterProps, DialogHeader, DialogHeaderProps, DialogProps, DialogTitle, DialogTitleProps, DialogTrigger, DialogTriggerProps } from './dialog.js';
2
+ export { Dialog, DialogClose, DialogCloseProps, DialogDescription, DialogDescriptionProps, DialogFooter, DialogFooterProps, DialogHeader, DialogHeaderProps, DialogPopup, DialogPopupProps, DialogProps, DialogTitle, DialogTitleProps, DialogTrigger, DialogTriggerProps } from './dialog.js';
3
3
  export { Tabs, TabsContent, TabsContentProps, TabsContents, TabsContentsProps, TabsList, TabsListProps, TabsProps, TabsTrigger, TabsTriggerProps } from './tabs.js';
4
4
  import 'react/jsx-runtime';
5
5
  import 'class-variance-authority/types';
6
- import 'react';
7
6
  import 'class-variance-authority';
7
+ import '@base-ui/react/button';
8
+ import 'react';
8
9
  import '../primitives/dialog.js';
9
- import '@radix-ui/react-dialog';
10
+ import '@base-ui/react/dialog';
10
11
  import 'motion/react';
11
12
  import '../primitives/tabs.js';
12
13
  import '@radix-ui/react-tabs';
package/dist/ui/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export{b as Button,a as buttonVariants}from'../chunk-CJONAIBS.js';export{a as Dialog,c as DialogClose,d as DialogContent,h as DialogDescription,f as DialogFooter,e as DialogHeader,g as DialogTitle,b as DialogTrigger}from'../chunk-X57LUCWV.js';export{a as Tabs,e as TabsContent,d as TabsContents,b as TabsList,c as TabsTrigger}from'../chunk-CPQOX4RR.js';import'../chunk-YMSEOWKF.js';import'../chunk-P4RPQUEL.js';import'../chunk-ZXAHA7TB.js';import'../chunk-MF7T3OYE.js';import'../chunk-VFZXA6DY.js';//# sourceMappingURL=index.js.map
1
+ export{b as Button,a as buttonVariants}from'../chunk-XK5GMNOS.js';export{a as Dialog,c as DialogClose,h as DialogDescription,f as DialogFooter,e as DialogHeader,d as DialogPopup,g as DialogTitle,b as DialogTrigger}from'../chunk-52U7K5UV.js';export{a as Tabs,e as TabsContent,d as TabsContents,b as TabsList,c as TabsTrigger}from'../chunk-GDXL7UNV.js';import'../chunk-5YDJTHDG.js';import'../chunk-AMNHVMRK.js';import'../chunk-ZVME3JB3.js';import'../chunk-KYD4ATTG.js';import'../chunk-2TUGHMFW.js';//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
package/dist/ui/tabs.js CHANGED
@@ -1,2 +1,2 @@
1
- export{a as Tabs,e as TabsContent,d as TabsContents,b as TabsList,c as TabsTrigger}from'../chunk-CPQOX4RR.js';import'../chunk-P4RPQUEL.js';import'../chunk-ZXAHA7TB.js';import'../chunk-MF7T3OYE.js';import'../chunk-VFZXA6DY.js';//# sourceMappingURL=tabs.js.map
1
+ export{a as Tabs,e as TabsContent,d as TabsContents,b as TabsList,c as TabsTrigger}from'../chunk-GDXL7UNV.js';import'../chunk-AMNHVMRK.js';import'../chunk-ZVME3JB3.js';import'../chunk-KYD4ATTG.js';import'../chunk-2TUGHMFW.js';//# sourceMappingURL=tabs.js.map
2
2
  //# sourceMappingURL=tabs.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xploreu/components",
3
- "version": "0.1.6",
3
+ "version": "0.2.0",
4
4
  "description": "Shared UI components for XploreU apps",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -41,10 +41,11 @@
41
41
  "dist"
42
42
  ],
43
43
  "peerDependencies": {
44
+ "@base-ui/react": "^1.6.0",
44
45
  "lucide-react": "^0.477.0",
45
46
  "react": ">=18",
46
47
  "react-dom": ">=18",
47
- "@xploreu/hooks": "0.1.1",
48
+ "@xploreu/hooks": "0.2.0",
48
49
  "@xploreu/lib": "0.1.2"
49
50
  },
50
51
  "dependencies": {
@@ -52,10 +53,11 @@
52
53
  "@radix-ui/react-slot": "^1.2.4",
53
54
  "@radix-ui/react-tabs": "^1.1.2",
54
55
  "@radix-ui/react-use-controllable-state": "^1.2.2",
55
- "motion": "^12.16.0",
56
- "class-variance-authority": "^0.7.1"
56
+ "class-variance-authority": "^0.7.1",
57
+ "motion": "^12.16.0"
57
58
  },
58
59
  "devDependencies": {
60
+ "@base-ui/react": "^1.6.0",
59
61
  "@types/react": "^19.2.2",
60
62
  "@types/react-dom": "^19.2.2",
61
63
  "lucide-react": "^0.477.0",
@@ -63,7 +65,7 @@
63
65
  "react-dom": "^19.2.4",
64
66
  "tsup": "^8.4.0",
65
67
  "typescript": "^5",
66
- "@xploreu/hooks": "0.1.1",
68
+ "@xploreu/hooks": "0.2.0",
67
69
  "@xploreu/lib": "0.1.2"
68
70
  },
69
71
  "scripts": {
@@ -1,2 +0,0 @@
1
- import'react';import {Slot}from'@radix-ui/react-slot';import {cva}from'class-variance-authority';import {Loader2}from'lucide-react';import {cn}from'@xploreu/lib/cn';import {jsxs,jsx}from'react/jsx-runtime';var b=cva(cn("group relative inline-flex h-max w-fit cursor-pointer items-center justify-center whitespace-nowrap outline-brand transition duration-100 ease-linear before:absolute focus-visible:outline-2 focus-visible:outline-offset-2 rounded-xp-buttons [&_svg]:shrink-0","disabled:cursor-not-allowed"),{variants:{color:{default:"focus-visible:outline-focus-ring",destructive:"focus-visible:outline-focus-ring-error","gradient-ai":"focus-visible:outline-focus-ring","linear-green":"focus-visible:outline-focus-ring-success","linear-overlay":"focus-visible:outline-focus-ring","linear-destructive":"focus-visible:outline-focus-ring-error"},variant:{primary:"shadow-xp-xs-skeumorphic before:rounded-lg before:absolute before:inset-0 before:border-2 before:border-white/12 before:mask-b-from-0% after:absolute after:inset-0 after:rounded-xp-buttons hover:after:bg-alpha-gray-20 after:bg-transparent after:transition-colors disabled:text-fg-disabled disabled:bg-none disabled:bg-[#F5F5F5] disabled:hover:after:bg-transparent disabled:shadow-xp-xs disabled:before:border-border-disabled disabled:before:mask-none disabled:before:border",secondary:"shadow-xp-xs-skeumorphic border disabled:bg-bg-disabled disabled:text-fg-disabled disabled:[&_svg]:text-fg-disabled-subtle disabled:border-border-disabled disabled:shadow-xp-xs disabled:hover:text-fg-disabled disabled:hover:[&_svg]:text-fg-disabled-subtle","secondary-accent":"disabled:border-border-disabled disabled:bg-bg-disabled disabled:text-fg-disabled",tertiary:"disabled:bg-bg-disabled disabled:text-fg-disabled disabled:[&_svg]:text-bg-disabled","tertiary-accent":"disabled:bg-bg-disabled disabled:text-fg-disabled disabled:[&_svg]:text-fg-disabled-subtle",link:"underline decoration-transparent hover:decoration-inherit transition-colors disabled:bg-bg-disabled disabled:text-fg-disabled disabled:[&_svg]:text-fg-disabled-subtle disabled:hover:no-underline"},icon:{true:void 0,false:void 0},size:{sm:"text-label-semibold-3 px-xp-lg gap-xp-sm h-9 data-[icon]:size-9 data-[variant=link]:h-5 data-[variant=link]:px-0 [&_svg]:size-5",md:"text-label-semibold-3 px-3.5 gap-xp-sm h-10 data-[icon]:size-10 data-[variant=link]:h-5 data-[variant=link]:px-0 [&_svg]:size-5",lg:"text-label-semibold-2 px-xp-xl gap-xp-md h-11 data-[icon]:size-11 data-[variant=link]:h-[22px] data-[variant=link]:px-0 [&_svg]:size-5",xl:"text-label-semibold-2 px-4.5 gap-xp-md h-12 data-[icon]:size-12 data-[variant=link]:h-[22px] data-[variant=link]:px-0 [&_svg]:size-5"}},compoundVariants:[{variant:"primary",color:"default",className:"bg-gradient-buttons-gradient-blue text-text-primary-on-brand"},{variant:"secondary",color:"default",className:"bg-bg-primary text-text-secondary [&_svg]:text-text-quaternary border-border-primary hover:bg-bg-primary-hover hover:text-text-secondary-hover [&_svg]:hover:text-text-quaternary-hover"},{variant:"secondary-accent",color:"default",className:"border border-border-brand text-fg-brand-primary hover:bg-bg-brand-primary"},{variant:"tertiary",color:"default",className:"text-text-tertiary [&_svg]:text-fg-quaternary hover:bg-bg-primary-hover hover:text-text-tertiary-hover [&_svg]:hover:text-fg-quaternary-hover"},{variant:"tertiary-accent",color:"default",className:"bg-bg-brand-primary text-text-brand-tertiary [&_svg]:text-fg-brand-secondary hover:bg-bg-brand-secondary hover:text-text-brand-tertiary hover:[&_svg]:text-fg-brand-secondary-hover"},{variant:"link",color:"default",className:"text-text-brand-secondary [&_svg]:text-fg-brand-secondary-alt hover:text-text-brand-secondary-hover [&_svg]:hover:text-fg-brand-secondary-hover"},{variant:"primary",color:"destructive",className:"bg-bg-error-solid text-text-primary-on-brand"},{variant:"secondary",color:"destructive",className:"bg-bg-primary text-text-error-primary [&_svg]:text-fg-error-secondary border-border-error-subtle hover:bg-bg-error-primary hover:text-text-error-primary-hover [&_svg]:hover:text-fg-error-primary"},{variant:"secondary-accent",color:"destructive",className:"border border-border-error text-fg-error-primary hover:bg-bg-error-primary"},{variant:"tertiary",color:"destructive",className:"text-text-error-primary [&_svg]:text-fg-error-secondary hover:bg-bg-error-primary hover:text-text-error-primary-hover [&_svg]:hover:text-fg-error-primary"},{variant:"tertiary-accent",color:"destructive",className:"bg-bg-error-primary text-text-error-tertiary [&_svg]:text-fg-error-secondary hover:bg-bg-error-secondary hover:text-text-error-tertiary hover:[&_svg]:text-fg-error-secondary-hover"},{variant:"link",color:"destructive",className:"text-text-error-secondary [&_svg]:text-fg-error-secondary hover:text-text-error-primary-hover [&_svg]:hover:text-fg-error-primary"},{variant:"primary",color:"gradient-ai",className:"bg-gradient-buttons-button-ai text-text-primary-on-brand"},{variant:"secondary",color:"gradient-ai",className:"relative shadow-transparent border-transparent hover:bg-bg-primary bg-[linear-gradient(90deg,var(--color-bg-primary),var(--color-bg-primary)),var(--gradient-buttons-button-ai)] [background-clip:padding-box,border-box] [background-origin:padding-box,border-box] [&>span]:bg-gradient-buttons-button-ai [&>span]:bg-clip-text [&>span]:text-transparent after:absolute after:inset-0 after:rounded-md hover:after:bg-gradient-buttons-button-ai hover:after:opacity-10 disabled:hover:after:bg-transparent disabled:after:opacity-0 disabled:[&>span]:bg-none disabled:[&>span]:text-fg-disabled"},{variant:"secondary-accent",color:"gradient-ai",className:"border border-border-brand text-fg-brand-primary hover:bg-bg-brand-primary"},{variant:"tertiary",color:"gradient-ai",className:"relative [&>span]:bg-gradient-buttons-button-ai [&>span]:bg-clip-text [&>span]:text-transparent after:absolute after:inset-0 after:rounded-md hover:after:bg-gradient-buttons-button-ai hover:after:opacity-10 disabled:hover:after:bg-transparent disabled:after:opacity-0 disabled:[&>span]:bg-none disabled:[&>span]:text-fg-disabled"},{variant:"tertiary-accent",color:"gradient-ai",className:"bg-bg-brand-primary text-text-brand-tertiary [&_svg]:text-fg-brand-secondary hover:bg-bg-brand-secondary hover:text-text-brand-tertiary hover:[&_svg]:text-fg-brand-secondary-hover"},{variant:"link",color:"gradient-ai",className:"text-text-brand-secondary [&_svg]:text-fg-brand-secondary-alt hover:text-text-brand-secondary-hover [&_svg]:hover:text-fg-brand-secondary-hover"},{variant:"primary",color:"linear-green",className:"bg-gradient-buttons-gradient-green text-text-primary-on-brand"},{variant:"secondary",color:"linear-green",className:"bg-bg-primary text-text-secondary [&_svg]:text-green-500 border-border-primary hover:text-text-secondary-hover [&_svg]:hover:text-green-900"},{variant:"secondary-accent",color:"linear-green",className:"border border-border-primary text-fg-primary hover:bg-bg-primary"},{variant:"tertiary",color:"linear-green",className:"text-text-success-primary [&_svg]:text-green-500 hover:bg-bg-success-primary [&_svg]:hover:text-green-900"},{variant:"tertiary-accent",color:"linear-green",className:"bg-bg-success-primary text-text-success-tertiary [&_svg]:text-fg-success-secondary hover:bg-bg-success-secondary hover:text-text-success-tertiary hover:[&_svg]:text-fg-success-secondary-hover"},{variant:"link",color:"linear-green",className:"text-text-success-secondary [&_svg]:text-fg-success-secondary hover:text-text-success-primary-hover [&_svg]:hover:text-fg-success-primary"},{variant:"primary",color:"linear-overlay",className:"relative bg-bg-brand-solid text-text-primary-on-brand [&_svg]:text-button-primary-icon hover:[&_svg]:text-button-primary-icon-hover after:absolute after:inset-0 after:rounded-xp-buttons after:bg-gradient-skuemorphic-gradient-border after:hover:bg-gradient-skuemorphic-gradient-border"},{variant:"secondary",color:"linear-overlay",className:"bg-bg-brand-solid-hover text-text-secondary [&_svg]:text-fg-quaternary border-border-primary hover:bg-bg-primary-hover hover:text-text-secondary-hover [&_svg]:hover:text-text-quaternary-hover"},{variant:"secondary-accent",color:"linear-overlay",className:"border border-border-brand text-fg-brand-primary hover:bg-bg-brand-primary"},{variant:"tertiary",color:"linear-overlay",className:"text-text-tertiary [&_svg]:text-fg-quaternary hover:bg-bg-primary-hover hover:text-text-tertiary-hover [&_svg]:hover:text-fg-quaternary-hover"},{variant:"tertiary-accent",color:"linear-overlay",className:"bg-bg-brand-primary text-text-brand-tertiary [&_svg]:text-fg-brand-secondary hover:bg-bg-brand-secondary hover:text-text-brand-tertiary hover:[&_svg]:text-fg-brand-secondary-hover"},{variant:"link",color:"linear-overlay",className:"text-text-brand-secondary [&_svg]:text-fg-brand-secondary-alt hover:text-text-brand-secondary-hover [&_svg]:hover:text-fg-brand-secondary-hover"},{variant:"primary",color:"linear-destructive",className:"relative bg-bg-error-solid text-text-primary-on-brand [&_svg]:text-button-destructive-primary-icon hover:[&_svg]:text-button-destructive-primary-icon-hover after:absolute after:inset-0 after:rounded-xp-buttons after:bg-gradient-skuemorphic-gradient-border after:hover:bg-gradient-skuemorphic-gradient-border"},{variant:"secondary",color:"linear-destructive",className:"bg-bg-error-solid-hover text-text-secondary [&_svg]:text-fg-quaternary border-border-primary hover:bg-bg-primary-hover hover:text-text-secondary-hover [&_svg]:hover:text-text-quaternary-hover"},{variant:"secondary-accent",color:"linear-destructive",className:"border border-border-error text-fg-error-primary hover:bg-bg-error-primary"},{variant:"tertiary",color:"linear-destructive",className:"text-text-error-primary [&_svg]:text-fg-error-secondary hover:bg-bg-error-primary hover:text-text-tertiary-hover [&_svg]:hover:text-fg-error-secondary"},{variant:"tertiary-accent",color:"linear-destructive",className:"bg-bg-error-primary text-text-error-tertiary [&_svg]:text-fg-error-secondary hover:bg-bg-error-secondary hover:text-text-error-tertiary hover:[&_svg]:text-fg-error-secondary-hover"},{variant:"link",color:"linear-destructive",className:"text-text-error-primary [&_svg]:text-fg-error-secondary hover:text-text-error-primary-hover [&_svg]:hover:text-fg-error-primary"}],defaultVariants:{variant:"primary",color:"default",size:"sm"}});function k({className:a,color:o,variant:r,size:s,asChild:g=false,loading:l=false,children:c,disabled:v,icon:i,...n}){let d=g?Slot:"button";return l?jsxs(d,{className:cn(b({color:o,variant:r,size:s,className:a})),"data-icon":i?"":void 0,"data-slot":"button",disabled:true,...n,children:[jsx(Loader2,{className:"size-4 animate-spin"}),jsx("span",{className:"sr-only",children:"Loading..."})]}):jsx(d,{className:cn(b({color:o,variant:r,size:s,className:a})),"data-icon":i?"":void 0,"data-slot":"button","data-variant":r,disabled:v,...n,children:c})}export{b as a,k as b};//# sourceMappingURL=chunk-CJONAIBS.js.map
2
- //# sourceMappingURL=chunk-CJONAIBS.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/ui/button.tsx"],"names":["buttonVariants","cva","cn","Button","className","color","variant","size","asChild","loading","children","disabled","icon","props","Comp","Slot","jsxs","jsx","Loader2"],"mappings":"8MAQA,IAAMA,CAAAA,CAAiBC,GAAAA,CACrBC,EAAAA,CACE,kQAAA,CAEA,6BACF,EACA,CACE,QAAA,CAAU,CACR,KAAA,CAAO,CACL,OAAA,CAAS,kCAAA,CACT,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A,CACA,QAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,GAAGC,CACL,CAAA,CAIK,CACH,IAAMC,CAAAA,CAAON,CAAAA,CAAUO,IAAAA,CAAO,QAAA,CAE9B,OAAIN,CAAAA,CAEAO,IAAAA,CAACF,CAAAA,CAAA,CACC,SAAA,CAAWZ,EAAAA,CAAGF,CAAAA,CAAe,CAAE,KAAA,CAAAK,CAAAA,CAAO,OAAA,CAAAC,CAAAA,CAAS,IAAA,CAAAC,CAAAA,CAAM,SAAA,CAAAH,CAAU,CAAC,CAAC,CAAA,CACjE,WAAA,CAAWQ,CAAAA,CAAO,EAAA,CAAK,MAAA,CACvB,WAAA,CAAU,QAAA,CACV,QAAA,CAAQ,IAAA,CACP,GAAGC,CAAAA,CAEJ,QAAA,CAAA,CAAAI,GAAAA,CAACC,OAAAA,CAAA,CAAQ,SAAA,CAAU,qBAAA,CAAsB,CAAA,CACzCD,GAAAA,CAAC,MAAA,CAAA,CAAK,SAAA,CAAU,SAAA,CAAU,QAAA,CAAA,YAAA,CAAU,CAAA,CAAA,CACtC,CAAA,CAKFA,GAAAA,CAACH,CAAAA,CAAA,CACC,UAAWZ,EAAAA,CAAGF,CAAAA,CAAe,CAAE,KAAA,CAAAK,CAAAA,CAAO,OAAA,CAAAC,CAAAA,CAAS,IAAA,CAAAC,CAAAA,CAAM,SAAA,CAAAH,CAAU,CAAC,CAAC,CAAA,CACjE,WAAA,CAAWQ,CAAAA,CAAO,EAAA,CAAK,MAAA,CACvB,WAAA,CAAU,QAAA,CACV,cAAA,CAAcN,CAAAA,CACd,QAAA,CAAUK,CAAAA,CACT,GAAGE,CAAAA,CAEH,QAAA,CAAAH,CAAAA,CACH,CAEJ","file":"chunk-CJONAIBS.js","sourcesContent":["import * as React from \"react\"\n\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { Loader2 } from \"lucide-react\"\n\nimport { cn } from \"@xploreu/lib/cn\"\n\nconst buttonVariants = cva(\n cn(\n \"group relative inline-flex h-max w-fit cursor-pointer items-center justify-center whitespace-nowrap outline-brand transition duration-100 ease-linear before:absolute focus-visible:outline-2 focus-visible:outline-offset-2 rounded-xp-buttons [&_svg]:shrink-0\",\n // Disabled styles\n \"disabled:cursor-not-allowed\",\n ),\n {\n variants: {\n color: {\n default: \"focus-visible:outline-focus-ring\",\n destructive: \"focus-visible:outline-focus-ring-error\",\n \"gradient-ai\": \"focus-visible:outline-focus-ring\",\n \"linear-green\": \"focus-visible:outline-focus-ring-success\",\n \"linear-overlay\": \"focus-visible:outline-focus-ring\",\n \"linear-destructive\": \"focus-visible:outline-focus-ring-error\",\n },\n variant: {\n primary: \"shadow-xp-xs-skeumorphic before:rounded-lg before:absolute before:inset-0 before:border-2 before:border-white/12 before:mask-b-from-0% after:absolute after:inset-0 after:rounded-xp-buttons hover:after:bg-alpha-gray-20 after:bg-transparent after:transition-colors disabled:text-fg-disabled disabled:bg-none disabled:bg-[#F5F5F5] disabled:hover:after:bg-transparent disabled:shadow-xp-xs disabled:before:border-border-disabled disabled:before:mask-none disabled:before:border\",\n secondary: \"shadow-xp-xs-skeumorphic border disabled:bg-bg-disabled disabled:text-fg-disabled disabled:[&_svg]:text-fg-disabled-subtle disabled:border-border-disabled disabled:shadow-xp-xs disabled:hover:text-fg-disabled disabled:hover:[&_svg]:text-fg-disabled-subtle\",\n \"secondary-accent\": \"disabled:border-border-disabled disabled:bg-bg-disabled disabled:text-fg-disabled\",\n tertiary: \"disabled:bg-bg-disabled disabled:text-fg-disabled disabled:[&_svg]:text-bg-disabled\",\n \"tertiary-accent\": \"disabled:bg-bg-disabled disabled:text-fg-disabled disabled:[&_svg]:text-fg-disabled-subtle\",\n link: \"underline decoration-transparent hover:decoration-inherit transition-colors disabled:bg-bg-disabled disabled:text-fg-disabled disabled:[&_svg]:text-fg-disabled-subtle disabled:hover:no-underline\",\n },\n icon: {\n true: undefined,\n false: undefined\n },\n size: {\n sm: \"text-label-semibold-3 px-xp-lg gap-xp-sm h-9 data-[icon]:size-9 data-[variant=link]:h-5 data-[variant=link]:px-0 [&_svg]:size-5\",\n md: \"text-label-semibold-3 px-3.5 gap-xp-sm h-10 data-[icon]:size-10 data-[variant=link]:h-5 data-[variant=link]:px-0 [&_svg]:size-5\",\n lg: \"text-label-semibold-2 px-xp-xl gap-xp-md h-11 data-[icon]:size-11 data-[variant=link]:h-[22px] data-[variant=link]:px-0 [&_svg]:size-5\",\n xl: \"text-label-semibold-2 px-4.5 gap-xp-md h-12 data-[icon]:size-12 data-[variant=link]:h-[22px] data-[variant=link]:px-0 [&_svg]:size-5\",\n }\n },\n compoundVariants: [\n // Default Color Variants\n {\n variant: \"primary\",\n color: \"default\",\n className: \"bg-gradient-buttons-gradient-blue text-text-primary-on-brand\"\n },\n {\n variant: \"secondary\",\n color: \"default\",\n className: \"bg-bg-primary text-text-secondary [&_svg]:text-text-quaternary border-border-primary hover:bg-bg-primary-hover hover:text-text-secondary-hover [&_svg]:hover:text-text-quaternary-hover\"\n },\n {\n variant: \"secondary-accent\",\n color: \"default\",\n className: \"border border-border-brand text-fg-brand-primary hover:bg-bg-brand-primary\"\n },\n {\n variant: \"tertiary\",\n color: \"default\",\n className: \"text-text-tertiary [&_svg]:text-fg-quaternary hover:bg-bg-primary-hover hover:text-text-tertiary-hover [&_svg]:hover:text-fg-quaternary-hover\"\n },\n {\n variant: \"tertiary-accent\",\n color: \"default\",\n className: \"bg-bg-brand-primary text-text-brand-tertiary [&_svg]:text-fg-brand-secondary hover:bg-bg-brand-secondary hover:text-text-brand-tertiary hover:[&_svg]:text-fg-brand-secondary-hover\"\n },\n {\n variant: \"link\",\n color: \"default\",\n className: \"text-text-brand-secondary [&_svg]:text-fg-brand-secondary-alt hover:text-text-brand-secondary-hover [&_svg]:hover:text-fg-brand-secondary-hover\"\n },\n\n // Destructive Color Variants\n {\n variant: \"primary\",\n color: \"destructive\",\n className: \"bg-bg-error-solid text-text-primary-on-brand\"\n },\n {\n variant: \"secondary\",\n color: \"destructive\",\n className: \"bg-bg-primary text-text-error-primary [&_svg]:text-fg-error-secondary border-border-error-subtle hover:bg-bg-error-primary hover:text-text-error-primary-hover [&_svg]:hover:text-fg-error-primary\"\n },\n {\n // Not existing in design system yet\n variant: \"secondary-accent\",\n color: \"destructive\",\n className: \"border border-border-error text-fg-error-primary hover:bg-bg-error-primary\"\n },\n {\n variant: \"tertiary\",\n color: \"destructive\",\n className: \"text-text-error-primary [&_svg]:text-fg-error-secondary hover:bg-bg-error-primary hover:text-text-error-primary-hover [&_svg]:hover:text-fg-error-primary\"\n },\n {\n // Not existing in design system yet\n variant: \"tertiary-accent\",\n color: \"destructive\",\n className: \"bg-bg-error-primary text-text-error-tertiary [&_svg]:text-fg-error-secondary hover:bg-bg-error-secondary hover:text-text-error-tertiary hover:[&_svg]:text-fg-error-secondary-hover\"\n },\n {\n variant: \"link\",\n color: \"destructive\",\n className: \"text-text-error-secondary [&_svg]:text-fg-error-secondary hover:text-text-error-primary-hover [&_svg]:hover:text-fg-error-primary\"\n },\n\n // Gradient AI\n {\n variant: \"primary\",\n color: \"gradient-ai\",\n className: \"bg-gradient-buttons-button-ai text-text-primary-on-brand\"\n },\n {\n variant: \"secondary\",\n color: \"gradient-ai\",\n className: \"relative shadow-transparent border-transparent hover:bg-bg-primary bg-[linear-gradient(90deg,var(--color-bg-primary),var(--color-bg-primary)),var(--gradient-buttons-button-ai)] [background-clip:padding-box,border-box] [background-origin:padding-box,border-box] [&>span]:bg-gradient-buttons-button-ai [&>span]:bg-clip-text [&>span]:text-transparent after:absolute after:inset-0 after:rounded-md hover:after:bg-gradient-buttons-button-ai hover:after:opacity-10 disabled:hover:after:bg-transparent disabled:after:opacity-0 disabled:[&>span]:bg-none disabled:[&>span]:text-fg-disabled\"\n },\n {\n // Not existing in design system yet\n variant: \"secondary-accent\",\n color: \"gradient-ai\",\n className: \"border border-border-brand text-fg-brand-primary hover:bg-bg-brand-primary\"\n },\n {\n variant: \"tertiary\",\n color: \"gradient-ai\",\n className: \"relative [&>span]:bg-gradient-buttons-button-ai [&>span]:bg-clip-text [&>span]:text-transparent after:absolute after:inset-0 after:rounded-md hover:after:bg-gradient-buttons-button-ai hover:after:opacity-10 disabled:hover:after:bg-transparent disabled:after:opacity-0 disabled:[&>span]:bg-none disabled:[&>span]:text-fg-disabled\"\n },\n {\n // Not existing in design system yet\n variant: \"tertiary-accent\",\n color: \"gradient-ai\",\n className: \"bg-bg-brand-primary text-text-brand-tertiary [&_svg]:text-fg-brand-secondary hover:bg-bg-brand-secondary hover:text-text-brand-tertiary hover:[&_svg]:text-fg-brand-secondary-hover\"\n },\n {\n // Not existing in design system yet\n variant: \"link\",\n color: \"gradient-ai\",\n className: \"text-text-brand-secondary [&_svg]:text-fg-brand-secondary-alt hover:text-text-brand-secondary-hover [&_svg]:hover:text-fg-brand-secondary-hover\"\n },\n\n // Linear Green Color Variants\n {\n variant: \"primary\",\n color: \"linear-green\",\n className: \"bg-gradient-buttons-gradient-green text-text-primary-on-brand\"\n },\n {\n variant: \"secondary\",\n color: \"linear-green\",\n className: \"bg-bg-primary text-text-secondary [&_svg]:text-green-500 border-border-primary hover:text-text-secondary-hover [&_svg]:hover:text-green-900\"\n },\n {\n // Not existing in design system yet\n variant: \"secondary-accent\",\n color: \"linear-green\",\n className: \"border border-border-primary text-fg-primary hover:bg-bg-primary\"\n },\n {\n variant: \"tertiary\",\n color: \"linear-green\",\n className: \"text-text-success-primary [&_svg]:text-green-500 hover:bg-bg-success-primary [&_svg]:hover:text-green-900\"\n },\n {\n // Not existing in design system yet\n variant: \"tertiary-accent\",\n color: \"linear-green\",\n className: \"bg-bg-success-primary text-text-success-tertiary [&_svg]:text-fg-success-secondary hover:bg-bg-success-secondary hover:text-text-success-tertiary hover:[&_svg]:text-fg-success-secondary-hover\"\n },\n {\n // Not existing in design system yet\n variant: \"link\",\n color: \"linear-green\",\n className: \"text-text-success-secondary [&_svg]:text-fg-success-secondary hover:text-text-success-primary-hover [&_svg]:hover:text-fg-success-primary\"\n },\n\n // Linear Overlay Color Variants\n {\n variant: \"primary\",\n color: \"linear-overlay\",\n className: \"relative bg-bg-brand-solid text-text-primary-on-brand [&_svg]:text-button-primary-icon hover:[&_svg]:text-button-primary-icon-hover after:absolute after:inset-0 after:rounded-xp-buttons after:bg-gradient-skuemorphic-gradient-border after:hover:bg-gradient-skuemorphic-gradient-border\"\n },\n {\n variant: \"secondary\",\n color: \"linear-overlay\",\n className: \"bg-bg-brand-solid-hover text-text-secondary [&_svg]:text-fg-quaternary border-border-primary hover:bg-bg-primary-hover hover:text-text-secondary-hover [&_svg]:hover:text-text-quaternary-hover\"\n },\n {\n variant: \"secondary-accent\",\n color: \"linear-overlay\",\n className: \"border border-border-brand text-fg-brand-primary hover:bg-bg-brand-primary\"\n },\n {\n variant: \"tertiary\",\n color: \"linear-overlay\",\n className: \"text-text-tertiary [&_svg]:text-fg-quaternary hover:bg-bg-primary-hover hover:text-text-tertiary-hover [&_svg]:hover:text-fg-quaternary-hover\"\n },\n {\n variant: \"tertiary-accent\",\n color: \"linear-overlay\",\n className: \"bg-bg-brand-primary text-text-brand-tertiary [&_svg]:text-fg-brand-secondary hover:bg-bg-brand-secondary hover:text-text-brand-tertiary hover:[&_svg]:text-fg-brand-secondary-hover\"\n },\n {\n variant: \"link\",\n color: \"linear-overlay\",\n className: \"text-text-brand-secondary [&_svg]:text-fg-brand-secondary-alt hover:text-text-brand-secondary-hover [&_svg]:hover:text-fg-brand-secondary-hover\"\n },\n\n // Linear Destructive Color Variants\n {\n variant: \"primary\",\n color: \"linear-destructive\",\n className: \"relative bg-bg-error-solid text-text-primary-on-brand [&_svg]:text-button-destructive-primary-icon hover:[&_svg]:text-button-destructive-primary-icon-hover after:absolute after:inset-0 after:rounded-xp-buttons after:bg-gradient-skuemorphic-gradient-border after:hover:bg-gradient-skuemorphic-gradient-border\"\n },\n {\n variant: \"secondary\",\n color: \"linear-destructive\",\n className: \"bg-bg-error-solid-hover text-text-secondary [&_svg]:text-fg-quaternary border-border-primary hover:bg-bg-primary-hover hover:text-text-secondary-hover [&_svg]:hover:text-text-quaternary-hover\"\n },\n {\n // Not existing in design system yet\n variant: \"secondary-accent\",\n color: \"linear-destructive\",\n className: \"border border-border-error text-fg-error-primary hover:bg-bg-error-primary\"\n },\n {\n variant: \"tertiary\",\n color: \"linear-destructive\",\n className: \"text-text-error-primary [&_svg]:text-fg-error-secondary hover:bg-bg-error-primary hover:text-text-tertiary-hover [&_svg]:hover:text-fg-error-secondary\"\n },\n {\n // Not existing in design system yet\n variant: \"tertiary-accent\",\n color: \"linear-destructive\",\n className: \"bg-bg-error-primary text-text-error-tertiary [&_svg]:text-fg-error-secondary hover:bg-bg-error-secondary hover:text-text-error-tertiary hover:[&_svg]:text-fg-error-secondary-hover\"\n },\n {\n variant: \"link\",\n color: \"linear-destructive\",\n className: \"text-text-error-primary [&_svg]:text-fg-error-secondary hover:text-text-error-primary-hover [&_svg]:hover:text-fg-error-primary\"\n },\n ],\n defaultVariants: {\n variant: \"primary\",\n color: \"default\",\n size: \"sm\",\n },\n }\n)\n\nfunction Button({\n className,\n color,\n variant,\n size,\n asChild = false,\n loading = false,\n children,\n disabled,\n icon,\n ...props\n}: React.ComponentProps<\"button\"> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean\n loading?: boolean\n }) {\n const Comp = asChild ? Slot : \"button\"\n\n if (loading) {\n return (\n <Comp\n className={cn(buttonVariants({ color, variant, size, className }))}\n data-icon={icon ? \"\" : undefined}\n data-slot=\"button\"\n disabled\n {...props}\n >\n <Loader2 className=\"size-4 animate-spin\" />\n <span className=\"sr-only\">Loading...</span>\n </Comp>\n )\n }\n\n return (\n <Comp\n className={cn(buttonVariants({ color, variant, size, className }))}\n data-icon={icon ? \"\" : undefined}\n data-slot=\"button\"\n data-variant={variant}\n disabled={disabled}\n {...props}\n >\n {children}\n </Comp>\n )\n}\n\nexport { Button, buttonVariants }\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/ui/tabs.tsx"],"names":["Tabs","className","variant","props","jsx","cn","TabsList","highlightClassName","TabsHighlight","TabsTrigger","TabsHighlightItem","TabsContents","TabsContent"],"mappings":"4HAqBA,SAASA,CAAAA,CAAK,CACZ,SAAA,CAAAC,GAAAA,CACA,OAAA,CAAAC,EAAU,SAAA,CACV,GAAGC,CACL,CAAA,CAAc,CACZ,OACEC,GAAAA,CAACJ,CAAAA,CAAA,CACC,SAAA,CAAWK,EAAAA,CAAG,gCAAA,CAAkCJ,GAAS,CAAA,CACzD,cAAA,CAAcC,CAAAA,CACb,GAAGC,EACN,CAEJ,CAMA,SAASG,CAAAA,CAAS,CAChB,SAAA,CAAAL,CAAAA,CACA,kBAAA,CAAAM,CAAAA,CACA,GAAGJ,CACL,CAAA,CAAkB,CAChB,OACEC,GAAAA,CAACI,CAAAA,CAAA,CACC,SAAA,CAAWH,EAAAA,CACT,cAAA,CACA,+QAAA,CACA,8OAAA,CACAE,CACF,CAAA,CAEA,QAAA,CAAAH,IAACE,CAAAA,CAAA,CACC,SAAA,CAAWD,EAAAA,CACT,+CAAA,CACA,6KAAA,CACA,2CAAA,CACAJ,CACF,EACC,GAAGE,CAAAA,CACN,CAAA,CACF,CAEJ,CAIA,SAASM,CAAAA,CAAY,CAAE,SAAA,CAAAR,CAAAA,CAAW,GAAGE,CAAM,CAAA,CAAqB,CAC9D,OACEC,GAAAA,CAACM,EAAA,CACC,SAAA,CAAU,QAAA,CACV,KAAA,CAAOP,CAAAA,CAAM,KAAA,CAEb,QAAA,CAAAC,GAAAA,CAACK,EAAA,CACC,SAAA,CAAWJ,EAAAA,CACT,0gBAAA,CACA,+EAAA,CACA,oFAAA,CACAJ,CACF,CAAA,CACC,GAAGE,CAAAA,CACN,CAAA,CACF,CAEJ,CAIA,SAASQ,CAAAA,CAAaR,CAAAA,CAA0B,CAC9C,OAAOC,GAAAA,CAACO,CAAAA,CAAA,CAAuB,GAAGR,CAAAA,CAAO,CAC3C,CAIA,SAASS,EAAY,CAAE,SAAA,CAAAX,CAAAA,CAAW,GAAGE,CAAM,CAAA,CAAqB,CAC9D,OACEC,IAACQ,GAAAA,CAAA,CACC,SAAA,CAAWP,EAAAA,CAAG,qBAAA,CAAuBJ,CAAS,CAAA,CAC7C,GAAGE,EACN,CAEJ","file":"chunk-CPQOX4RR.js","sourcesContent":["\nimport {\n Tabs as TabsPrimitive,\n TabsContent as TabsContentPrimitive,\n type TabsContentProps as TabsContentPrimitiveProps,\n TabsContents as TabsContentsPrimitive,\n type TabsContentsProps as TabsContentsPrimitiveProps,\n TabsHighlight as TabsHighlightPrimitive,\n TabsHighlightItem as TabsHighlightItemPrimitive,\n TabsList as TabsListPrimitive,\n type TabsListProps as TabsListPrimitiveProps,\n type TabsProps as TabsPrimitiveProps,\n TabsTrigger as TabsTriggerPrimitive,\n type TabsTriggerProps as TabsTriggerPrimitiveProps,\n} from \"../primitives/tabs\";\nimport { cn } from \"@xploreu/lib/cn\";\n\ntype TabsProps = TabsPrimitiveProps & {\n variant?: \"default\" | \"underline\";\n}\n\nfunction Tabs({\n className,\n variant = \"default\",\n ...props\n}: TabsProps) {\n return (\n <TabsPrimitive\n className={cn(\"group/tabs flex flex-col gap-2\", className)}\n data-variant={variant}\n {...props}\n />\n )\n}\n\ntype TabsListProps = TabsListPrimitiveProps & {\n highlightClassName?: string;\n}\n\nfunction TabsList({\n className,\n highlightClassName,\n ...props\n}: TabsListProps) {\n return (\n <TabsHighlightPrimitive\n className={cn(\n \"absolute z-0\",\n \"group-data-[variant=default]/tabs:inset-0 group-data-[variant=default]/tabs:border group-data-[variant=default]/tabs:border-transparent group-data-[variant=default]/tabs:rounded-md group-data-[variant=default]/tabs:bg-primary group-data-[variant=default]/tabs:shadow-sm\",\n \"group-data-[variant=underline]/tabs:bottom-0 group-data-[variant=underline]/tabs:h-0.5 group-data-[variant=underline]/tabs:w-full group-data-[variant=underline]/tabs:rounded-none group-data-[variant=underline]/tabs:bg-fg-brand-secondary\",\n highlightClassName\n )}\n >\n <TabsListPrimitive\n className={cn(\n \"inline-flex w-fit items-center justify-center\",\n \"group-data-[variant=default]/tabs:bg-bg-primary group-data-[variant=default]/tabs:h-9 group-data-[variant=default]/tabs:rounded-lg group-data-[variant=default]/tabs:p-0.75\",\n \"group-data-[variant=underline]/tabs:gap-7\",\n className,\n )}\n {...props}\n />\n </TabsHighlightPrimitive>\n )\n}\n\ntype TabsTriggerProps = TabsTriggerPrimitiveProps\n\nfunction TabsTrigger({ className, ...props }: TabsTriggerProps) {\n return (\n <TabsHighlightItemPrimitive\n className=\"flex-1\"\n value={props.value}\n >\n <TabsTriggerPrimitive\n className={cn(\n \"group/tabs-trigger data-[state=active]:text-text-brand-tertiary-alt focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-text-primary inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md w-full text-label-semibold-2 whitespace-nowrap transition-colors duration-500 ease-in-out focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n \"group-data-[variant=default]/tabs:px-2 group-data-[variant=default]/tabs:py-1\",\n \"group-data-[variant=underline]/tabs:h-8.5 group-data-[variant=underline]/tabs:px-3\",\n className,\n )}\n {...props}\n />\n </TabsHighlightItemPrimitive>\n )\n}\n\ntype TabsContentsProps = TabsContentsPrimitiveProps\n\nfunction TabsContents(props: TabsContentsProps) {\n return <TabsContentsPrimitive {...props} />\n}\n\ntype TabsContentProps = TabsContentPrimitiveProps\n\nfunction TabsContent({ className, ...props }: TabsContentProps) {\n return (\n <TabsContentPrimitive\n className={cn(\"flex-1 outline-none\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Tabs,\n TabsContent,\n type TabsContentProps,\n TabsContents,\n type TabsContentsProps,\n TabsList,\n type TabsListProps,\n type TabsProps,\n TabsTrigger,\n type TabsTriggerProps,\n}"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/effects/highlight.tsx"],"names":["DEFAULT_BOUNDS_OFFSET","HighlightContext","useHighlight","context","Highlight","ref","props","Component","children","value","defaultValue","onValueChange","className","style","transition","hover","click","enabled","controlledItems","disabled","exitDelay","mode","localRef","boundsOffset","boundsOffsetTop","boundsOffsetLeft","boundsOffsetWidth","boundsOffsetHeight","boundsOffsetRef","activeValue","setActiveValue","boundsState","setBoundsState","activeClassNameState","setActiveClassNameState","safeSetActiveValue","id","prev","safeSetBoundsRef","bounds","containerRect","offset","newBounds","safeSetBounds","clearBounds","container","onScroll","activeEl","render","jsxs","jsx","AnimatePresence","motion","cn","child","index","HighlightItem","getNonOverridingDataAttributes","element","dataAttributes","acc","key","as","activeClassName","asChild","forceUpdateBounds","itemId","setBounds","contextClassName","contextStyle","contextTransition","contextId","contextDisabled","contextExitDelay","contextForceUpdateBounds","setActiveClassName","childValue","isActive","isDisabled","itemTransition","refCallback","node","rafId","previousBounds","shouldUpdateBounds","updateBounds","commonHandlers","e","Fragment"],"mappings":"6JAqBA,IAAMA,EAAAA,CAAgC,CACpC,GAAA,CAAK,CAAA,CACL,IAAA,CAAM,CAAA,CACN,KAAA,CAAO,CAAA,CACP,MAAA,CAAQ,CACV,EAuBMC,CAAAA,CAAyB,CAAA,CAAA,aAAA,CAG7B,MAAS,CAAA,CAEX,SAASC,EAAAA,EAA0D,CACjE,IAAMC,EAAgB,CAAA,CAAA,UAAA,CAAWF,CAAgB,CAAA,CACjD,GAAI,CAACE,CAAAA,CACH,MAAM,IAAI,MAAM,sDAAsD,CAAA,CAExE,OAAOA,CACT,CAgEA,SAASC,EAAAA,CAA+C,CACtD,IAAAC,CAAAA,CACA,GAAGC,CACL,CAAA,CAAsB,CACpB,GAAM,CACJ,EAAA,CAAIC,CAAAA,CAAY,MAChB,QAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,aAAA,CAAAC,CAAAA,CACA,UAAAC,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A,GAAS,UAAA,EACR6B,GAAAA,CAACC,eAAAA,CAAA,CACC,OAAA,CAAS,KAAA,CACT,KAAK,MAAA,CAEJ,QAAA,CAAA0B,CAAAA,EAAY,CAACC,CAAAA,EACZ5B,GAAAA,CAACE,MAAAA,CAAO,GAAA,CAAP,CACC,OAAA,CAAS,CAAE,OAAA,CAAS,CAAE,EACtB,SAAA,CAAWC,EAAAA,CAAGe,CAAAA,CAAkBL,CAAe,EAC/C,WAAA,CAAU,kBAAA,CACV,IAAA,CAAM,CACJ,OAAA,CAAS,CAAA,CACT,UAAA,CAAY,CACV,GAAGgB,CAAAA,CACH,KAAA,CAAA,CACGA,CAAAA,EAAgB,KAAA,EAAS,CAAA,EAAA,CACzB3D,CAAAA,EAAaqD,CAAAA,EAAoB,CAAA,EAAK,GAC3C,CACF,CAAA,CACA,OAAA,CAAS,CAAE,OAAA,CAAS,CAAE,CAAA,CACtB,QAAA,CAAU,yBAAyBF,CAAS,CAAA,CAAA,CAC5C,KAAA,CAAO,CACL,SAAU,UAAA,CACV,MAAA,CAAQ,CAAA,CACR,GAAGF,EACH,GAAGxD,CACL,CAAA,CACA,UAAA,CAAYkE,CAAAA,CACX,GAAGpB,CAAAA,CACN,CAAA,CAEJ,EAGK,CAAA,CAAA,YAAA,CAAaD,CAAAA,CAAS,CAC3B,KAAA,CAAO,CAAE,QAAA,CAAU,UAAA,CAAY,MAAA,CAAQ,CAAE,CAAA,CACzC,SAAA,CAAWA,CAAAA,CAAQ,KAAA,CAAM,SAAA,CACzB,GAAGD,CAAAA,CAA+BC,CAAAA,CAAS,CACzC,GAAGC,CAAAA,CACH,WAAA,CAAa,uBACf,CAAC,CACH,CAAC,CAAA,CAAA,CAAA,CAjDIiB,CAkDP,EAEApE,CAEJ","file":"chunk-MF7T3OYE.js","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\n\nimport {\n AnimatePresence,\n motion,\n type Transition\n} from \"motion/react\"\n\nimport { cn } from \"@xploreu/lib/cn\"\n\ntype HighlightMode = \"children\" | \"parent\"\n\ntype Bounds = {\n top: number;\n left: number;\n width: number;\n height: number;\n}\n\nconst DEFAULT_BOUNDS_OFFSET: Bounds = {\n top: 0,\n left: 0,\n width: 0,\n height: 0,\n}\n\ntype HighlightContextType<T extends string> = {\n as?: keyof HTMLElementTagNameMap;\n mode: HighlightMode;\n activeValue: T | null;\n setActiveValue: (value: T | null) => void;\n setBounds: (bounds: DOMRect) => void;\n clearBounds: () => void;\n id: string;\n hover: boolean;\n click: boolean;\n className?: string;\n style?: React.CSSProperties;\n activeClassName?: string;\n setActiveClassName: (className: string) => void;\n transition?: Transition;\n disabled?: boolean;\n enabled?: boolean;\n exitDelay?: number;\n forceUpdateBounds?: boolean;\n}\n\nconst HighlightContext = React.createContext<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n HighlightContextType<any> | undefined\n>(undefined)\n\nfunction useHighlight<T extends string>(): HighlightContextType<T> {\n const context = React.useContext(HighlightContext)\n if (!context) {\n throw new Error(\"useHighlight must be used within a HighlightProvider\")\n }\n return context as unknown as HighlightContextType<T>\n}\n\ntype BaseHighlightProps<T extends React.ElementType = \"div\"> = {\n as?: T;\n ref?: React.Ref<HTMLDivElement>;\n mode?: HighlightMode;\n value?: string | null;\n defaultValue?: string | null;\n onValueChange?: (value: string | null) => void;\n className?: string;\n style?: React.CSSProperties;\n transition?: Transition;\n hover?: boolean;\n click?: boolean;\n disabled?: boolean;\n enabled?: boolean;\n exitDelay?: number;\n}\n\ntype ParentModeHighlightProps = {\n boundsOffset?: Partial<Bounds>;\n containerClassName?: string;\n forceUpdateBounds?: boolean;\n}\n\ntype ControlledParentModeHighlightProps<T extends React.ElementType = \"div\"> =\n BaseHighlightProps<T> &\n ParentModeHighlightProps & {\n mode: \"parent\";\n controlledItems: true;\n children: React.ReactNode;\n }\n\ntype ControlledChildrenModeHighlightProps<T extends React.ElementType = \"div\"> =\n BaseHighlightProps<T> & {\n mode?: \"children\" | undefined;\n controlledItems: true;\n children: React.ReactNode;\n }\n\ntype UncontrolledParentModeHighlightProps<T extends React.ElementType = \"div\"> =\n BaseHighlightProps<T> &\n ParentModeHighlightProps & {\n mode: \"parent\";\n controlledItems?: false;\n itemsClassName?: string;\n children: React.ReactElement | React.ReactElement[];\n }\n\ntype UncontrolledChildrenModeHighlightProps<\n T extends React.ElementType = \"div\",\n> = BaseHighlightProps<T> & {\n mode?: \"children\";\n controlledItems?: false;\n itemsClassName?: string;\n children: React.ReactElement | React.ReactElement[];\n}\n\ntype HighlightProps<T extends React.ElementType = \"div\"> =\n | ControlledParentModeHighlightProps<T>\n | ControlledChildrenModeHighlightProps<T>\n | UncontrolledParentModeHighlightProps<T>\n | UncontrolledChildrenModeHighlightProps<T>\n\nfunction Highlight<T extends React.ElementType = \"div\">({\n ref,\n ...props\n}: HighlightProps<T>) {\n const {\n as: Component = \"div\",\n children,\n value,\n defaultValue,\n onValueChange,\n className,\n style,\n transition = { type: \"spring\", stiffness: 350, damping: 35 },\n hover = false,\n click = true,\n enabled = true,\n controlledItems,\n disabled = false,\n exitDelay = 200,\n mode = \"children\",\n } = props\n\n const localRef = React.useRef<HTMLDivElement>(null)\n React.useImperativeHandle(ref, () => localRef.current as HTMLDivElement)\n\n const propsBoundsOffset = (props as ParentModeHighlightProps)?.boundsOffset\n const boundsOffset = propsBoundsOffset ?? DEFAULT_BOUNDS_OFFSET\n const boundsOffsetTop = boundsOffset.top ?? 0\n const boundsOffsetLeft = boundsOffset.left ?? 0\n const boundsOffsetWidth = boundsOffset.width ?? 0\n const boundsOffsetHeight = boundsOffset.height ?? 0\n\n const boundsOffsetRef = React.useRef({\n top: boundsOffsetTop,\n left: boundsOffsetLeft,\n width: boundsOffsetWidth,\n height: boundsOffsetHeight,\n })\n\n React.useEffect(() => {\n boundsOffsetRef.current = {\n top: boundsOffsetTop,\n left: boundsOffsetLeft,\n width: boundsOffsetWidth,\n height: boundsOffsetHeight,\n }\n }, [\n boundsOffsetTop,\n boundsOffsetLeft,\n boundsOffsetWidth,\n boundsOffsetHeight,\n ])\n\n const [activeValue, setActiveValue] = React.useState<string | null>(\n value ?? defaultValue ?? null,\n )\n const [boundsState, setBoundsState] = React.useState<Bounds | null>(null)\n const [activeClassNameState, setActiveClassNameState] =\n React.useState<string>(\"\")\n\n const safeSetActiveValue = (id: string | null) => {\n setActiveValue((prev) => {\n if (prev !== id) {\n onValueChange?.(id)\n return id\n }\n return prev\n })\n }\n\n const safeSetBoundsRef = React.useRef<\n ((bounds: DOMRect) => void) | undefined\n >(undefined)\n\n React.useEffect(() => {\n safeSetBoundsRef.current = (bounds: DOMRect) => {\n if (!localRef.current) return\n\n const containerRect = localRef.current.getBoundingClientRect()\n const offset = boundsOffsetRef.current\n const newBounds: Bounds = {\n top: bounds.top - containerRect.top + offset.top,\n left: bounds.left - containerRect.left + offset.left,\n width: bounds.width + offset.width,\n height: bounds.height + offset.height,\n }\n\n setBoundsState((prev) => {\n if (\n prev &&\n prev.top === newBounds.top &&\n prev.left === newBounds.left &&\n prev.width === newBounds.width &&\n prev.height === newBounds.height\n ) {\n return prev\n }\n return newBounds\n })\n }\n })\n\n const safeSetBounds = (bounds: DOMRect) => {\n safeSetBoundsRef.current?.(bounds)\n }\n\n const clearBounds = React.useCallback(() => {\n setBoundsState((prev) => (prev === null ? prev : null))\n }, [])\n\n React.useEffect(() => {\n if (value !== undefined) setActiveValue(value)\n else if (defaultValue !== undefined) setActiveValue(defaultValue)\n }, [value, defaultValue])\n\n const id = React.useId()\n\n React.useEffect(() => {\n if (mode !== \"parent\") return\n const container = localRef.current\n if (!container) return\n\n const onScroll = () => {\n if (!activeValue) return\n const activeEl = container.querySelector<HTMLElement>(\n `[data-value=\"${activeValue}\"][data-highlight=\"true\"]`,\n )\n if (activeEl)\n safeSetBoundsRef.current?.(activeEl.getBoundingClientRect())\n }\n\n container.addEventListener(\"scroll\", onScroll, { passive: true })\n return () => container.removeEventListener(\"scroll\", onScroll)\n }, [mode, activeValue])\n\n const render = (children: React.ReactNode) => {\n if (mode === \"parent\") {\n return (\n <Component\n ref={localRef}\n className={(props as ParentModeHighlightProps)?.containerClassName}\n data-slot=\"motion-highlight-container\"\n style={{ position: \"relative\", zIndex: 1 }}\n >\n <AnimatePresence\n initial={false}\n mode=\"wait\"\n >\n {boundsState && (\n <motion.div\n animate={{\n top: boundsState.top,\n left: boundsState.left,\n width: boundsState.width,\n height: boundsState.height,\n opacity: 1,\n }}\n className={cn(className, activeClassNameState)}\n data-slot=\"motion-highlight\"\n exit={{\n opacity: 0,\n transition: {\n ...transition,\n delay: (transition?.delay ?? 0) + (exitDelay ?? 0) / 1000,\n },\n }}\n initial={{\n top: boundsState.top,\n left: boundsState.left,\n width: boundsState.width,\n height: boundsState.height,\n opacity: 0,\n }}\n style={{ position: \"absolute\", zIndex: 0, ...style }}\n transition={transition}\n />\n )}\n </AnimatePresence>\n {children}\n </Component>\n )\n }\n\n return children\n }\n\n return (\n <HighlightContext.Provider\n value={{\n mode,\n activeValue,\n setActiveValue: safeSetActiveValue,\n id,\n hover,\n click,\n className,\n style,\n transition,\n disabled,\n enabled,\n exitDelay,\n setBounds: safeSetBounds,\n clearBounds,\n activeClassName: activeClassNameState,\n setActiveClassName: setActiveClassNameState,\n forceUpdateBounds: (props as ParentModeHighlightProps)\n ?.forceUpdateBounds,\n }}\n >\n {enabled\n ? controlledItems\n ? render(children)\n : render(\n React.Children.map(children, (child, index) => (\n <HighlightItem\n key={index}\n className={props?.itemsClassName}\n >\n {child}\n </HighlightItem>\n )),\n )\n : children}\n </HighlightContext.Provider>\n )\n}\n\nfunction getNonOverridingDataAttributes(\n element: React.ReactElement,\n dataAttributes: Record<string, unknown>,\n): Record<string, unknown> {\n return Object.keys(dataAttributes).reduce<Record<string, unknown>>(\n (acc, key) => {\n if ((element.props as Record<string, unknown>)[key] === undefined) {\n acc[key] = dataAttributes[key]\n }\n return acc\n },\n {},\n )\n}\n\ntype ExtendedChildProps = React.ComponentProps<\"div\"> & {\n id?: string;\n ref?: React.Ref<HTMLElement>;\n \"data-active\"?: string;\n \"data-value\"?: string;\n \"data-disabled\"?: boolean;\n \"data-highlight\"?: boolean;\n \"data-slot\"?: string;\n}\n\ntype HighlightItemProps<T extends React.ElementType = \"div\"> =\n React.ComponentProps<T> & {\n as?: T;\n children: React.ReactElement;\n id?: string;\n value?: string;\n className?: string;\n style?: React.CSSProperties;\n transition?: Transition;\n activeClassName?: string;\n disabled?: boolean;\n exitDelay?: number;\n asChild?: boolean;\n forceUpdateBounds?: boolean;\n }\n\nfunction HighlightItem<T extends React.ElementType>({\n ref,\n as,\n children,\n id,\n value,\n className,\n style,\n transition,\n disabled = false,\n activeClassName,\n exitDelay,\n asChild = false,\n forceUpdateBounds,\n ...props\n}: HighlightItemProps<T>) {\n const itemId = React.useId()\n const {\n activeValue,\n setActiveValue,\n mode,\n setBounds,\n clearBounds,\n hover,\n click,\n enabled,\n className: contextClassName,\n style: contextStyle,\n transition: contextTransition,\n id: contextId,\n disabled: contextDisabled,\n exitDelay: contextExitDelay,\n forceUpdateBounds: contextForceUpdateBounds,\n setActiveClassName,\n } = useHighlight()\n\n const Component = as ?? \"div\"\n const element = children as React.ReactElement<ExtendedChildProps>\n const childValue =\n id ?? value ?? element.props?.[\"data-value\"] ?? element.props?.id ?? itemId\n const isActive = activeValue === childValue\n const isDisabled = disabled === undefined ? contextDisabled : disabled\n const itemTransition = transition ?? contextTransition\n\n const localRef = React.useRef<HTMLDivElement>(null)\n React.useImperativeHandle(ref, () => localRef.current as HTMLDivElement)\n\n const refCallback = React.useCallback((node: HTMLElement | null) => {\n localRef.current = node as HTMLDivElement\n }, [])\n\n React.useEffect(() => {\n if (mode !== \"parent\") return\n let rafId: number\n let previousBounds: Bounds | null = null\n const shouldUpdateBounds =\n forceUpdateBounds === true ||\n (contextForceUpdateBounds && forceUpdateBounds !== false)\n\n const updateBounds = () => {\n if (!localRef.current) return\n\n const bounds = localRef.current.getBoundingClientRect()\n\n if (shouldUpdateBounds) {\n if (\n previousBounds &&\n previousBounds.top === bounds.top &&\n previousBounds.left === bounds.left &&\n previousBounds.width === bounds.width &&\n previousBounds.height === bounds.height\n ) {\n rafId = requestAnimationFrame(updateBounds)\n return\n }\n previousBounds = bounds\n rafId = requestAnimationFrame(updateBounds)\n }\n\n setBounds(bounds)\n }\n\n if (isActive) {\n updateBounds()\n setActiveClassName(activeClassName ?? \"\")\n } else if (!activeValue) clearBounds()\n\n if (shouldUpdateBounds) return () => cancelAnimationFrame(rafId)\n }, [\n mode,\n isActive,\n activeValue,\n setBounds,\n clearBounds,\n activeClassName,\n setActiveClassName,\n forceUpdateBounds,\n contextForceUpdateBounds,\n ])\n\n if (!React.isValidElement(children)) return children\n\n const dataAttributes = {\n \"data-active\": isActive ? \"true\" : \"false\",\n \"aria-selected\": isActive,\n \"data-disabled\": isDisabled,\n \"data-value\": childValue,\n \"data-highlight\": true,\n }\n\n const commonHandlers = hover\n ? {\n onMouseEnter: (e: React.MouseEvent<HTMLDivElement>) => {\n setActiveValue(childValue)\n element.props.onMouseEnter?.(e)\n },\n onMouseLeave: (e: React.MouseEvent<HTMLDivElement>) => {\n setActiveValue(null)\n element.props.onMouseLeave?.(e)\n },\n }\n : click\n ? {\n onClick: (e: React.MouseEvent<HTMLDivElement>) => {\n setActiveValue(childValue)\n element.props.onClick?.(e)\n },\n }\n : {}\n\n if (asChild) {\n if (mode === \"children\") {\n return React.cloneElement(\n element,\n {\n key: childValue,\n ref: refCallback,\n className: cn(\"relative\", element.props.className),\n ...getNonOverridingDataAttributes(element, {\n ...dataAttributes,\n \"data-slot\": \"motion-highlight-item-container\",\n }),\n ...commonHandlers,\n ...props,\n },\n <>\n <AnimatePresence\n initial={false}\n mode=\"wait\"\n >\n {isActive && !isDisabled && (\n <motion.div\n animate={{ opacity: 1 }}\n className={cn(contextClassName, activeClassName)}\n data-slot=\"motion-highlight\"\n exit={{\n opacity: 0,\n transition: {\n ...itemTransition,\n delay:\n (itemTransition?.delay ?? 0) +\n (exitDelay ?? contextExitDelay ?? 0) / 1000,\n },\n }}\n initial={{ opacity: 0 }}\n layoutId={`transition-background-${contextId}`}\n style={{\n position: \"absolute\",\n zIndex: 0,\n ...contextStyle,\n ...style,\n }}\n transition={itemTransition}\n {...dataAttributes}\n />\n )}\n </AnimatePresence>\n\n <Component\n className={className}\n data-slot=\"motion-highlight-item\"\n style={{ position: \"relative\", zIndex: 1 }}\n {...dataAttributes}\n >\n {children}\n </Component>\n </>,\n )\n }\n\n return React.cloneElement(element, {\n ref: refCallback,\n ...getNonOverridingDataAttributes(element, {\n ...dataAttributes,\n \"data-slot\": \"motion-highlight-item\",\n }),\n ...commonHandlers,\n })\n }\n\n return enabled ? (\n <Component\n key={childValue}\n ref={localRef}\n className={cn(mode === \"children\" && \"relative\", className)}\n data-slot=\"motion-highlight-item-container\"\n {...dataAttributes}\n {...props}\n {...commonHandlers}\n >\n {mode === \"children\" && (\n <AnimatePresence\n initial={false}\n mode=\"wait\"\n >\n {isActive && !isDisabled && (\n <motion.div\n animate={{ opacity: 1 }}\n className={cn(contextClassName, activeClassName)}\n data-slot=\"motion-highlight\"\n exit={{\n opacity: 0,\n transition: {\n ...itemTransition,\n delay:\n (itemTransition?.delay ?? 0) +\n (exitDelay ?? contextExitDelay ?? 0) / 1000,\n },\n }}\n initial={{ opacity: 0 }}\n layoutId={`transition-background-${contextId}`}\n style={{\n position: \"absolute\",\n zIndex: 0,\n ...contextStyle,\n ...style,\n }}\n transition={itemTransition}\n {...dataAttributes}\n />\n )}\n </AnimatePresence>\n )}\n\n {React.cloneElement(element, {\n style: { position: \"relative\", zIndex: 1 },\n className: element.props.className,\n ...getNonOverridingDataAttributes(element, {\n ...dataAttributes,\n \"data-slot\": \"motion-highlight-item\",\n }),\n })}\n </Component>\n ) : (\n children\n )\n}\n\nexport {\n Highlight,\n HighlightItem,\n type HighlightItemProps,\n type HighlightProps,\n useHighlight,\n}"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/primitives/tabs.tsx"],"names":["TabsProvider","useTabs","getStrictContext","Tabs","valueProp","defaultValue","onValueChange","props","value","setValue","useControllableState","jsx","TabsHighlight","transition","Highlight","TabsList","TabsHighlightItem","HighlightItem","TabsTrigger","TabsContent","forceMount","AnimatePresence","motion","defaultTransition","isAutoMode","TabsContents","autoProps","AutoHeight","style","layoutProps"],"mappings":"4WA2BA,GAAM,CAACA,CAAAA,CAAcC,CAAO,CAAA,CAC1BC,gBAAAA,CAAkC,aAAa,CAAA,CAIjD,SAASC,CAAAA,CAAK,CACZ,MAAOC,CAAAA,CACP,YAAA,CAAAC,EACA,aAAA,CAAAC,CAAAA,CACA,GAAGC,CACL,CAAA,CAAc,CACZ,GAAM,CAACC,CAAAA,CAAOC,CAAQ,CAAA,CAAIC,oBAAAA,CAAqB,CAC7C,IAAA,CAAMN,CAAAA,CACN,WAAA,CAAaC,CAAAA,EAAgB,GAC7B,QAAA,CAAUC,CACZ,CAAC,CAAA,CAED,OACEK,IAACX,CAAAA,CAAA,CAAa,KAAA,CAAO,CAAE,MAAAQ,CAAAA,CAAO,QAAA,CAAAC,CAAS,CAAA,CACrC,QAAA,CAAAE,IAAe,CAAA,CAAA,IAAA,CAAd,CACC,WAAA,CAAU,MAAA,CACV,MAAOH,CAAAA,CACP,aAAA,CAAeC,EACd,GAAGF,CAAAA,CACN,EACF,CAEJ,CAIA,SAASK,CAAAA,CAAc,CACrB,UAAA,CAAAC,CAAAA,CAAa,CAAE,IAAA,CAAM,SAAU,SAAA,CAAW,GAAA,CAAK,OAAA,CAAS,EAAG,EAC3D,GAAGN,CACL,EAAuB,CACrB,GAAM,CAAE,KAAA,CAAAC,CAAM,CAAA,CAAIP,CAAAA,GAElB,OACEU,GAAAA,CAACG,IAAA,CACC,KAAA,CAAO,MACP,eAAA,CAAe,IAAA,CACf,WAAA,CAAU,gBAAA,CACV,WAAYD,CAAAA,CACZ,KAAA,CAAOL,EACN,GAAGD,CAAAA,CACN,CAEJ,CAIA,SAASQ,CAAAA,CAASR,CAAAA,CAAsB,CACtC,O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A,EAAUA,CAAAA,CAAM,IAAA,GAAS,aAC9C,CAEA,SAASkB,CAAAA,CAAalB,CAAAA,CAA0B,CAC9C,GAAM,CAAE,KAAA,CAAAC,CAAM,CAAA,CAAIP,CAAAA,GAElB,GAAIuB,CAAAA,CAAWjB,CAAK,CAAA,CAAG,CACrB,GAAM,CAAE,WAAAM,CAAAA,CAAaU,CAAAA,CAAmB,GAAGG,CAAU,CAAA,CAAInB,CAAAA,CAEzD,OACEI,IAACgB,CAAAA,CAAA,CACC,YAAU,eAAA,CACV,IAAA,CAAM,CAACnB,CAAK,CAAA,CACZ,UAAA,CAAYK,CAAAA,CACX,GAAGa,CAAAA,CACN,CAEJ,CAEA,GAAM,CAAE,WAAAb,CAAAA,CAAaU,CAAAA,CAAmB,KAAA,CAAAK,CAAAA,CAAO,GAAGC,GAAY,CAAA,CAAItB,EAElE,OACEI,GAAAA,CAACW,OAAO,GAAA,CAAP,CACC,WAAA,CAAU,eAAA,CACV,OAAO,MAAA,CACP,gBAAA,CAAkBd,EAClB,KAAA,CAAO,CAAE,SAAU,QAAA,CAAU,GAAGoB,CAAM,CAAA,CACtC,WAAY,CAAE,MAAA,CAAQf,CAAW,CAAA,CAChC,GAAGgB,IACN,CAEJ","file":"chunk-P4RPQUEL.js","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\n\nimport * as TabsPrimitive from \"@radix-ui/react-tabs\"\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\"\nimport {\n AnimatePresence,\n type HTMLMotionProps,\n motion,\n type Transition,\n} from \"motion/react\"\n\nimport { AutoHeight, type AutoHeightProps } from \"../effects/auto-height\"\nimport {\n Highlight,\n HighlightItem,\n type HighlightItemProps,\n type HighlightProps,\n} from \"../effects/highlight\"\nimport { getStrictContext } from \"@xploreu/lib/get-strict-context\"\n\ntype TabsContextType = {\n value: string | undefined;\n setValue: TabsProps[\"onValueChange\"];\n}\n\nconst [TabsProvider, useTabs] =\n getStrictContext<TabsContextType>(\"TabsContext\")\n\ntype TabsProps = React.ComponentProps<typeof TabsPrimitive.Root>\n\nfunction Tabs({\n value: valueProp,\n defaultValue,\n onValueChange,\n ...props\n}: TabsProps) {\n const [value, setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue || \"\",\n onChange: onValueChange,\n })\n\n return (\n <TabsProvider value={{ value, setValue }}>\n <TabsPrimitive.Root\n data-slot=\"tabs\"\n value={value}\n onValueChange={setValue}\n {...props}\n />\n </TabsProvider>\n )\n}\n\ntype TabsHighlightProps = Omit<HighlightProps, \"controlledItems\" | \"value\">\n\nfunction TabsHighlight({\n transition = { type: \"spring\", stiffness: 200, damping: 25 },\n ...props\n}: TabsHighlightProps) {\n const { value } = useTabs()\n\n return (\n <Highlight\n click={false}\n controlledItems\n data-slot=\"tabs-highlight\"\n transition={transition}\n value={value}\n {...props}\n />\n )\n}\n\ntype TabsListProps = React.ComponentProps<typeof TabsPrimitive.List>\n\nfunction TabsList(props: TabsListProps) {\n return <TabsPrimitive.List\n data-slot=\"tabs-list\"\n {...props}\n />\n}\n\ntype TabsHighlightItemProps = HighlightItemProps & {\n value: string;\n}\n\nfunction TabsHighlightItem(props: TabsHighlightItemProps) {\n return <HighlightItem\n data-slot=\"tabs-highlight-item\"\n {...props}\n />\n}\n\ntype TabsTriggerProps = React.ComponentProps<typeof TabsPrimitive.Trigger>\n\nfunction TabsTrigger(props: TabsTriggerProps) {\n return <TabsPrimitive.Trigger\n data-slot=\"tabs-trigger\"\n {...props}\n />\n}\n\ntype TabsContentProps = React.ComponentProps<typeof TabsPrimitive.Content> &\n HTMLMotionProps<\"div\">\n\nfunction TabsContent({\n value,\n forceMount,\n transition = { duration: 0.5, ease: \"easeInOut\" },\n ...props\n}: TabsContentProps) {\n return (\n <AnimatePresence mode=\"wait\">\n <TabsPrimitive.Content\n asChild\n forceMount={forceMount}\n value={value}\n >\n <motion.div\n animate={{ opacity: 1, filter: \"blur(0px)\" }}\n data-slot=\"tabs-content\"\n exit={{ opacity: 0, filter: \"blur(4px)\" }}\n initial={{ opacity: 0, filter: \"blur(4px)\" }}\n layout\n layoutDependency={value}\n transition={transition}\n {...props}\n />\n </TabsPrimitive.Content>\n </AnimatePresence>\n )\n}\n\ntype TabsContentsAutoProps = AutoHeightProps & {\n mode?: \"auto-height\";\n children: React.ReactNode;\n transition?: Transition;\n}\n\ntype TabsContentsLayoutProps = Omit<HTMLMotionProps<\"div\">, \"transition\"> & {\n mode: \"layout\";\n children: React.ReactNode;\n transition?: Transition;\n}\n\ntype TabsContentsProps = TabsContentsAutoProps | TabsContentsLayoutProps\n\nconst defaultTransition: Transition = {\n type: \"spring\",\n stiffness: 200,\n damping: 30,\n}\n\nfunction isAutoMode(props: TabsContentsProps): props is TabsContentsAutoProps {\n return !(\"mode\" in props) || props.mode === \"auto-height\"\n}\n\nfunction TabsContents(props: TabsContentsProps) {\n const { value } = useTabs()\n\n if (isAutoMode(props)) {\n const { transition = defaultTransition, ...autoProps } = props\n\n return (\n <AutoHeight\n data-slot=\"tabs-contents\"\n deps={[value]}\n transition={transition}\n {...autoProps}\n />\n )\n }\n\n const { transition = defaultTransition, style, ...layoutProps } = props\n\n return (\n <motion.div\n data-slot=\"tabs-contents\"\n layout=\"size\"\n layoutDependency={value}\n style={{ overflow: \"hidden\", ...style }}\n transition={{ layout: transition }}\n {...layoutProps}\n />\n )\n}\n\nexport {\n Tabs,\n TabsContent,\n type TabsContentProps,\n TabsContents,\n type TabsContentsProps,\n TabsHighlight,\n TabsHighlightItem,\n type TabsHighlightItemProps,\n type TabsHighlightProps,\n TabsList,\n type TabsListProps,\n type TabsProps,\n TabsTrigger,\n type TabsTriggerProps,\n}"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/primitives/slot.tsx"],"names":["mergeRefs","refs","node","ref","mergeProps","childProps","slotProps","merged","cn","Slot","children","props","isAlreadyMotion","isMotionComponent","Base","motion","childRef","mergedProps","jsx"],"mappings":"iJA4BA,SAASA,CAAAA,CAAAA,GACJC,CAAAA,CACmB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AAWC,CAAAA,CAAYM,CAAK,CAAA,CAEhD,OAEEO,GAAAA,CAACJ,CAAAA,CAAA,CACE,GAAGG,EACJ,GAAA,CAAKjB,CAAAA,CAAUgB,CAAAA,CAA0Bb,CAAG,EAC9C,CAEJ","file":"chunk-VFZXA6DY.js","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\n\nimport {\n type HTMLMotionProps,\n isMotionComponent,\n motion\n} from \"motion/react\"\n\nimport { cn } from \"@xploreu/lib/cn\"\n\ntype AnyProps = Record<string, unknown>\n\ntype DOMMotionProps<T extends HTMLElement = HTMLElement> = Omit<\n HTMLMotionProps<keyof Omit<HTMLElementTagNameMap, `gmpx${string}`>>,\n \"ref\"\n> & { ref?: React.Ref<T> }\n\ntype WithAsChild<Base extends object> =\n | (Base & { asChild: true; children: React.ReactElement })\n | (Base & { asChild?: false | undefined })\n\ntype SlotProps<T extends HTMLElement = HTMLElement> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n children?: any;\n} & DOMMotionProps<T>\n\nfunction mergeRefs<T>(\n ...refs: (React.Ref<T> | undefined)[]\n): React.RefCallback<T> {\n return (node) => {\n refs.forEach((ref) => {\n if (!ref) return\n if (typeof ref === \"function\") {\n ref(node)\n } else {\n (ref as React.RefObject<T | null>).current = node\n }\n })\n }\n}\n\nfunction mergeProps<T extends HTMLElement>(\n childProps: AnyProps,\n slotProps: DOMMotionProps<T>,\n): AnyProps {\n const merged: AnyProps = { ...childProps, ...slotProps }\n\n if (childProps.className || slotProps.className) {\n merged.className = cn(\n childProps.className as string,\n slotProps.className as string,\n )\n }\n\n if (childProps.style || slotProps.style) {\n merged.style = {\n ...(childProps.style as React.CSSProperties),\n ...(slotProps.style as React.CSSProperties),\n }\n }\n\n return merged\n}\n\nfunction Slot<T extends HTMLElement = HTMLElement>({\n children,\n ref,\n ...props\n}: SlotProps<T>) {\n const isAlreadyMotion =\n typeof children.type === \"object\" &&\n children.type !== null &&\n isMotionComponent(children.type)\n\n const Base = React.useMemo(\n () =>\n isAlreadyMotion\n ? (children.type as React.ElementType)\n : motion.create(children.type as React.ElementType),\n [isAlreadyMotion, children.type],\n )\n\n if (!React.isValidElement(children)) return null\n\n const { ref: childRef, ...childProps } = children.props as AnyProps\n\n const mergedProps = mergeProps(childProps, props)\n\n return (\n // eslint-disable-next-line react-hooks/static-components\n <Base\n {...mergedProps}\n ref={mergeRefs(childRef as React.Ref<T>, ref)}\n />\n )\n}\n\nexport {\n type AnyProps,\n type DOMMotionProps,\n Slot,\n type SlotProps,\n type WithAsChild,\n}\n"]}
@@ -1,2 +0,0 @@
1
- import {b,c,g,d,f,h as h$1,i,j,k as k$1,e}from'./chunk-YMSEOWKF.js';import {XIcon}from'lucide-react';import {cn}from'@xploreu/lib/cn';import {jsx,jsxs}from'react/jsx-runtime';function h(o){return jsx(b,{...o})}function _(o){return jsx(c,{...o})}function w(o){return jsx(g,{...o})}function x({className:o,...i}){return jsx(e,{className:cn("fixed inset-0 z-50 bg-background-overlay-default",o),...i})}function H({className:o,children:i,showCloseButton:v=true,closeClassName:y,onCloseClick:d$1,...u}){return jsxs(d,{children:[jsx(x,{}),jsxs(f,{className:cn("fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border-primary bg-bg-primary p-6 shadow-xp-lg rounded-lg overflow-hidden",o),...u,children:[i,v&&jsxs(g,{className:cn("ring-offset-neutral-25 focus:ring-neutral-20 data-[state=open]:bg-bg-primary data-[state=open]:text-muted-foreground absolute top-7 right-6 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-6",y),onClick:d$1,children:[jsx(XIcon,{}),jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function F({className:o,...i}){return jsx(h$1,{className:cn("flex flex-col gap-2 text-center sm:text-left bg-bg-primary",o),...i})}function N({className:o,...i$1}){return jsx(i,{className:cn("flex flex-col gap-2 laptop:flex-row items-center justify-between bg-bg-primary border-t shadow-[0px_16px_44px_-24px_var(--color-background-shadow-light),0px_0px_28px_0px_var(--color-background-shadow-light)] border-border-primary py-4 px-[26px]",o),"data-slot":"dialog-footer",...i$1})}function O({className:o,...i}){return jsx(j,{className:cn("text-center text-heading-bold-4 text-text-primary",o),...i})}function k({className:o,...i}){return jsx(k$1,{className:cn("text-label-semibold-3 text-text-secondary",o),...i})}export{h as a,_ as b,w as c,H as d,F as e,N as f,O as g,k as h};//# sourceMappingURL=chunk-X57LUCWV.js.map
2
- //# sourceMappingURL=chunk-X57LUCWV.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/ui/dialog.tsx"],"names":["Dialog","props","jsx","DialogTrigger","DialogClose","DialogOverlay","className","cn","DialogContent","children","showCloseButton","closeClassName","onCloseClick","jsxs","DialogPortal","XIcon","DialogHeader","DialogFooter","DialogTitle","DialogDescription"],"mappings":"+KA6BA,SAASA,CAAAA,CAAOC,CAAAA,CAAoB,CAClC,OAAOC,GAAAA,CAACF,CAAAA,CAAA,CAAiB,GAAGC,CAAAA,CAAO,CACrC,CAIA,SAASE,CAAAA,CAAcF,EAA2B,CAChD,OAAOC,GAAAA,CAACC,CAAAA,CAAA,CAAwB,GAAGF,EAAO,CAC5C,CAIA,SAASG,CAAAA,CAAYH,CAAAA,CAAyB,CAC5C,OAAOC,GAAAA,CAACE,CAAAA,CAAA,CAAsB,GAAGH,CAAAA,CAAO,CAC1C,CAIA,SAASI,CAAAA,CAAc,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGL,CAAM,CAAA,CAAuB,CAClE,OACEC,GAAAA,CAACG,CAAAA,CAAA,CACC,UAAWE,EAAAA,CAAG,kDAAA,CAAoDD,CAAS,CAAA,CAC1E,GAAGL,CAAAA,CACN,CAEJ,CAQA,SAASO,CAAAA,CAAc,CACrB,SAAA,CAAAF,CAAAA,CACA,SAAAG,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CAAS,CAAA,CAC3E,GAAGL,CAAAA,CACN,CAEJ,CAIA,SAASkB,CAAAA,CAAkB,CAAE,SAAA,CAAAb,CAAAA,CAAW,GAAGL,CAAM,EAA2B,CAC1E,OACEC,GAAAA,CAACiB,GAAAA,CAAA,CACC,SAAA,CAAWZ,EAAAA,CAAG,2CAAA,CAA6CD,CAAS,CAAA,CACnE,GAAGL,CAAAA,CACN,CAEJ","file":"chunk-X57LUCWV.js","sourcesContent":["\"use client\"\n\nimport { XIcon } from \"lucide-react\"\n\nimport {\n Dialog as DialogPrimitive,\n DialogClose as DialogClosePrimitive,\n type DialogCloseProps as DialogClosePrimitiveProps,\n DialogContent as DialogContentPrimitive,\n type DialogContentProps as DialogContentPrimitiveProps,\n DialogDescription as DialogDescriptionPrimitive,\n type DialogDescriptionProps as DialogDescriptionPrimitiveProps,\n DialogFooter as DialogFooterPrimitive,\n type DialogFooterProps as DialogFooterPrimitiveProps,\n DialogHeader as DialogHeaderPrimitive,\n type DialogHeaderProps as DialogHeaderPrimitiveProps,\n DialogOverlay as DialogOverlayPrimitive,\n type DialogOverlayProps as DialogOverlayPrimitiveProps,\n DialogPortal as DialogPortalPrimitive,\n type DialogProps as DialogPrimitiveProps,\n DialogTitle as DialogTitlePrimitive,\n type DialogTitleProps as DialogTitlePrimitiveProps,\n DialogTrigger as DialogTriggerPrimitive,\n type DialogTriggerProps as DialogTriggerPrimitiveProps,\n} from \"../primitives/dialog\"\nimport { cn } from \"@xploreu/lib/cn\"\n\ntype DialogProps = DialogPrimitiveProps\n\nfunction Dialog(props: DialogProps) {\n return <DialogPrimitive {...props} />\n}\n\ntype DialogTriggerProps = DialogTriggerPrimitiveProps\n\nfunction DialogTrigger(props: DialogTriggerProps) {\n return <DialogTriggerPrimitive {...props} />\n}\n\ntype DialogCloseProps = DialogClosePrimitiveProps\n\nfunction DialogClose(props: DialogCloseProps) {\n return <DialogClosePrimitive {...props} />\n}\n\ntype DialogOverlayProps = DialogOverlayPrimitiveProps\n\nfunction DialogOverlay({ className, ...props }: DialogOverlayProps) {\n return (\n <DialogOverlayPrimitive\n className={cn(\"fixed inset-0 z-50 bg-background-overlay-default\", className)}\n {...props}\n />\n )\n}\n\ntype DialogContentProps = DialogContentPrimitiveProps & {\n showCloseButton?: boolean;\n closeClassName?: string;\n onCloseClick?: React.MouseEventHandler;\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n closeClassName,\n onCloseClick,\n ...props\n}: DialogContentProps) {\n return (\n <DialogPortalPrimitive>\n <DialogOverlay />\n <DialogContentPrimitive\n className={cn(\n \"fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border-primary bg-bg-primary p-6 shadow-xp-lg rounded-lg overflow-hidden\",\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogClosePrimitive\n className={cn(\n \"ring-offset-neutral-25 focus:ring-neutral-20 data-[state=open]:bg-bg-primary data-[state=open]:text-muted-foreground absolute top-7 right-6 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-6\",\n closeClassName\n )}\n onClick={onCloseClick}\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </DialogClosePrimitive>\n )}\n </DialogContentPrimitive>\n </DialogPortalPrimitive>\n )\n}\n\ntype DialogHeaderProps = DialogHeaderPrimitiveProps\n\nfunction DialogHeader({ className, ...props }: DialogHeaderProps) {\n return (\n <DialogHeaderPrimitive\n className={cn(\"flex flex-col gap-2 text-center sm:text-left bg-bg-primary\", className)}\n {...props}\n />\n )\n}\n\ntype DialogFooterProps = DialogFooterPrimitiveProps\n\nfunction DialogFooter({ className, ...props }: DialogFooterProps) {\n return (\n <DialogFooterPrimitive\n className={cn(\n \"flex flex-col gap-2 laptop:flex-row items-center justify-between bg-bg-primary border-t shadow-[0px_16px_44px_-24px_var(--color-background-shadow-light),0px_0px_28px_0px_var(--color-background-shadow-light)] border-border-primary py-4 px-[26px]\",\n className\n )}\n data-slot=\"dialog-footer\"\n {...props}\n />\n )\n}\n\ntype DialogTitleProps = DialogTitlePrimitiveProps\n\nfunction DialogTitle({ className, ...props }: DialogTitleProps) {\n return (\n <DialogTitlePrimitive\n className={cn(\"text-center text-heading-bold-4 text-text-primary\", className)}\n {...props}\n />\n )\n}\n\ntype DialogDescriptionProps = DialogDescriptionPrimitiveProps\n\nfunction DialogDescription({ className, ...props }: DialogDescriptionProps) {\n return (\n <DialogDescriptionPrimitive\n className={cn(\"text-label-semibold-3 text-text-secondary\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Dialog,\n DialogClose, type DialogCloseProps, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderProps,\n type DialogProps, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps\n}\n"]}
@@ -1,2 +0,0 @@
1
- import*as r from'react';import*as t from'@radix-ui/react-dialog';import {useControllableState}from'@radix-ui/react-use-controllable-state';import {AnimatePresence,motion}from'motion/react';import {getStrictContext}from'@xploreu/lib/get-strict-context';import {jsx}from'react/jsx-runtime';var [T,y]=getStrictContext("DialogContext");function M({open:o,defaultOpen:i,onOpenChange:p,...s}){let[a,n]=useControllableState({prop:o,defaultProp:i??false,onChange:p,caller:"DialogOpen"});return jsx(T,{value:{open:a,setOpen:n},children:jsx(t.Root,{"data-slot":"dialog",open:a,onOpenChange:n,...s})})}function H(o){return jsx(t.Trigger,{"data-slot":"dialog-trigger",...o})}function h(o){let{open:i}=y();return jsx(AnimatePresence,{children:i&&jsx(t.Portal,{"data-slot":"dialog-portal",forceMount:true,...o})})}function A({transition:o={duration:.2,ease:"easeInOut"},...i}){return jsx(t.Overlay,{asChild:true,"data-slot":"dialog-overlay",forceMount:true,children:jsx(motion.div,{animate:{opacity:1,backdropFilter:"blur(4px)"},exit:{opacity:0,backdropFilter:"blur(0px)"},initial:{opacity:0,backdropFilter:"blur(0px)"},transition:o,...i},"dialog-overlay")})}function L({from:o="left",onOpenAutoFocus:i,onCloseAutoFocus:p,onEscapeKeyDown:s,onPointerDownOutside:a,onInteractOutside:n,transition:d={type:"spring",stiffness:150,damping:25},ref:u,...f}){let l=r.useRef(null);r.useImperativeHandle(u,()=>l.current);let{open:D}=y(),P=o==="bottom"||o==="left"?"20deg":"-20deg",g=o==="top"||o==="bottom"?"rotateX":"rotateY";return r.useEffect(()=>{D||l.current?.classList.remove("transform-none!");},[D]),jsx(t.Content,{asChild:true,forceMount:true,onCloseAutoFocus:p,onEscapeKeyDown:s,onInteractOutside:n,onOpenAutoFocus:i,onPointerDownOutside:a,children:jsx(motion.div,{ref:l,animate:{opacity:1,filter:"blur(0px)",transform:`perspective(500px) ${g}(0deg) scale(1)`},"data-slot":"dialog-content",exit:{opacity:0,filter:"blur(4px)",transform:`perspective(500px) ${g}(${P}) scale(0.8)`},initial:{opacity:0,filter:"blur(4px)",transform:`perspective(500px) ${g}(${P}) scale(0.8)`},transition:d,onAnimationComplete:c=>{typeof c=="object"&&"opacity"in c&&c.opacity!==1||requestAnimationFrame(()=>{l.current?.classList.add("transform-none!");});},...f},"dialog-content")})}function k(o){return jsx(t.Close,{"data-slot":"dialog-close",...o})}function $(o){return jsx("div",{"data-slot":"dialog-header",...o})}function E(o){return jsx("div",{"data-slot":"dialog-footer",...o})}function I(o){return jsx(t.Title,{"data-slot":"dialog-title",...o})}function w(o){return jsx(t.Description,{"data-slot":"dialog-description",...o})}export{y as a,M as b,H as c,h as d,A as e,L as f,k as g,$ as h,E as i,I as j,w as k};//# sourceMappingURL=chunk-YMSEOWKF.js.map
2
- //# sourceMappingURL=chunk-YMSEOWKF.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/primitives/dialog.tsx"],"names":["DialogProvider","useDialog","getStrictContext","Dialog","openProp","defaultOpen","onOpenChange","props","open","setOpen","useControllableState","jsx","DialogTrigger","DialogPortal","AnimatePresence","DialogOverlay","transition","motion","DialogContent","from","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside","ref","contentRef","initialRotation","rotateAxis","latest","DialogClose","DialogHeader","DialogFooter","DialogTitle","DialogDescription"],"mappings":"gSAmBA,IAAM,CAACA,CAAAA,CAAgBC,CAAS,CAAA,CAC9BC,gBAAAA,CAAoC,eAAe,EAIrD,SAASC,EAAO,CACd,IAAA,CAAMC,CAAAA,CACN,WAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,EACA,GAAGC,CACL,CAAA,CAAgB,CACd,GAAM,CAACC,EAAMC,CAAO,CAAA,CAAIC,oBAAAA,CAAqB,CAC3C,IAAA,CAAMN,CAAAA,CACN,YAAaC,CAAAA,EAAe,KAAA,CAC5B,SAAUC,CAAAA,CACV,MAAA,CAAQ,YACV,CAAC,CAAA,CAED,OACEK,GAAAA,CAACX,CAAAA,CAAA,CAAe,MAAO,CAAE,IAAA,CAAAQ,CAAAA,CAAM,OAAA,CAAAC,CAAQ,CAAA,CACrC,SAAAE,GAAAA,CAAiB,CAAA,CAAA,IAAA,CAAhB,CACC,WAAA,CAAU,QAAA,CACV,IAAA,CAAMH,EACN,YAAA,CAAcC,CAAAA,CACb,GAAGF,CAAAA,CACN,CAAA,CACF,CAEJ,CAIA,SAASK,CAAAA,CAAcL,CAAAA,CAA2B,CAChD,OAAOI,IAAiB,CAAA,CAAA,OAAA,CAAhB,CACN,WAAA,CAAU,gBAAA,CACT,GAAGJ,CAAAA,CACN,CACF,CAOA,SAASM,CAAAA,CAAaN,CAAAA,CAA0B,CAC9C,GAAM,CAAE,IAAA,CAAAC,CAAK,EAAIP,CAAAA,EAAU,CAE3B,OACEU,GAAAA,CAACG,eAAAA,CAAA,CACE,QAAA,CAAAN,CAAAA,EACCG,GAAAA,CAAiB,SAAhB,CACC,WAAA,CAAU,eAAA,CACV,UAAA,CAAU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N,CAAA,CACF,CAEJ,CAIA,SAASuB,CAAAA,CAAYvB,CAAAA,CAAyB,CAC5C,OAAOI,GAAAA,CAAiB,QAAhB,CACN,WAAA,CAAU,cAAA,CACT,GAAGJ,CAAAA,CACN,CACF,CAIA,SAASwB,CAAAA,CAAaxB,EAA0B,CAC9C,OAAOI,IAAC,KAAA,CAAA,CACN,WAAA,CAAU,eAAA,CACT,GAAGJ,CAAAA,CACN,CACF,CAIA,SAASyB,CAAAA,CAAazB,CAAAA,CAA0B,CAC9C,OAAOI,GAAAA,CAAC,OACN,WAAA,CAAU,eAAA,CACT,GAAGJ,CAAAA,CACN,CACF,CAIA,SAAS0B,CAAAA,CAAY1B,CAAAA,CAAyB,CAC5C,OAAOI,GAAAA,CAAiB,CAAA,CAAA,KAAA,CAAhB,CACN,WAAA,CAAU,cAAA,CACT,GAAGJ,CAAAA,CACN,CACF,CAMA,SAAS2B,CAAAA,CAAkB3B,CAAAA,CAA+B,CACxD,OACEI,GAAAA,CAAiB,CAAA,CAAA,WAAA,CAAhB,CACC,WAAA,CAAU,oBAAA,CACT,GAAGJ,CAAAA,CACN,CAEJ","file":"chunk-YMSEOWKF.js","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\n\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\"\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\"\nimport {\n AnimatePresence,\n type HTMLMotionProps,\n motion\n} from \"motion/react\"\n\nimport { getStrictContext } from \"@xploreu/lib/get-strict-context\"\n\ntype DialogContextType = {\n open: boolean;\n setOpen: (open: boolean) => void;\n}\n\nconst [DialogProvider, useDialog] =\n getStrictContext<DialogContextType>(\"DialogContext\")\n\ntype DialogProps = React.ComponentProps<typeof DialogPrimitive.Root>\n\nfunction Dialog({\n open: openProp,\n defaultOpen,\n onOpenChange,\n ...props\n}: DialogProps) {\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: \"DialogOpen\",\n })\n\n return (\n <DialogProvider value={{ open, setOpen }}>\n <DialogPrimitive.Root\n data-slot=\"dialog\"\n open={open}\n onOpenChange={setOpen}\n {...props}\n />\n </DialogProvider>\n )\n}\n\ntype DialogTriggerProps = React.ComponentProps<typeof DialogPrimitive.Trigger>\n\nfunction DialogTrigger(props: DialogTriggerProps) {\n return <DialogPrimitive.Trigger\n data-slot=\"dialog-trigger\"\n {...props}\n />\n}\n\ntype DialogPortalProps = Omit<\n React.ComponentProps<typeof DialogPrimitive.Portal>,\n \"forceMount\"\n>\n\nfunction DialogPortal(props: DialogPortalProps) {\n const { open } = useDialog()\n\n return (\n <AnimatePresence>\n {open && (\n <DialogPrimitive.Portal\n data-slot=\"dialog-portal\"\n forceMount\n {...props}\n />\n )}\n </AnimatePresence>\n )\n}\n\ntype DialogOverlayProps = Omit<\n React.ComponentProps<typeof DialogPrimitive.Overlay>,\n \"forceMount\" | \"asChild\"\n> &\n HTMLMotionProps<\"div\">\n\nfunction DialogOverlay({\n transition = { duration: 0.2, ease: \"easeInOut\" },\n ...props\n}: DialogOverlayProps) {\n return (\n <DialogPrimitive.Overlay\n asChild\n data-slot=\"dialog-overlay\"\n forceMount\n >\n <motion.div\n key=\"dialog-overlay\"\n animate={{ opacity: 1, backdropFilter: \"blur(4px)\" }}\n exit={{ opacity: 0, backdropFilter: \"blur(0px)\" }}\n initial={{ opacity: 0, backdropFilter: \"blur(0px)\" }}\n transition={transition}\n {...props}\n />\n </DialogPrimitive.Overlay>\n )\n}\n\ntype DialogFlipDirection = \"top\" | \"bottom\" | \"left\" | \"right\"\n\ntype DialogContentProps = Omit<\n React.ComponentProps<typeof DialogPrimitive.Content>,\n \"forceMount\" | \"asChild\"\n> &\n HTMLMotionProps<\"div\"> & {\n from?: DialogFlipDirection;\n }\n\nfunction DialogContent({\n from = \"left\",\n onOpenAutoFocus,\n onCloseAutoFocus,\n onEscapeKeyDown,\n onPointerDownOutside,\n onInteractOutside,\n transition = { type: \"spring\", stiffness: 150, damping: 25 },\n ref,\n ...props\n}: DialogContentProps) {\n const contentRef = React.useRef<HTMLDivElement>(null)\n\n React.useImperativeHandle(ref, () => contentRef.current!)\n\n const { open } = useDialog()\n\n const initialRotation =\n from === \"bottom\" || from === \"left\" ? \"20deg\" : \"-20deg\"\n const isVertical = from === \"top\" || from === \"bottom\"\n const rotateAxis = isVertical ? \"rotateX\" : \"rotateY\"\n\n React.useEffect(() => {\n if (open) return\n\n contentRef.current?.classList.remove(\"transform-none!\")\n }, [open])\n\n return (\n <DialogPrimitive.Content\n asChild\n forceMount\n onCloseAutoFocus={onCloseAutoFocus}\n onEscapeKeyDown={onEscapeKeyDown}\n onInteractOutside={onInteractOutside}\n onOpenAutoFocus={onOpenAutoFocus}\n onPointerDownOutside={onPointerDownOutside}\n >\n <motion.div\n key=\"dialog-content\"\n ref={contentRef}\n animate={{\n opacity: 1,\n filter: \"blur(0px)\",\n transform: `perspective(500px) ${rotateAxis}(0deg) scale(1)`,\n }}\n data-slot=\"dialog-content\"\n exit={{\n opacity: 0,\n filter: \"blur(4px)\",\n transform: `perspective(500px) ${rotateAxis}(${initialRotation}) scale(0.8)`,\n }}\n initial={{\n opacity: 0,\n filter: \"blur(4px)\",\n transform: `perspective(500px) ${rotateAxis}(${initialRotation}) scale(0.8)`,\n }}\n transition={transition}\n onAnimationComplete={(latest) => {\n if (typeof latest === \"object\" && \"opacity\" in latest && latest.opacity !== 1) return\n\n requestAnimationFrame(() => {\n contentRef.current?.classList.add(\"transform-none!\")\n })\n }}\n {...props}\n />\n </DialogPrimitive.Content>\n )\n}\n\ntype DialogCloseProps = React.ComponentProps<typeof DialogPrimitive.Close>\n\nfunction DialogClose(props: DialogCloseProps) {\n return <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n {...props}\n />\n}\n\ntype DialogHeaderProps = React.ComponentProps<\"div\">\n\nfunction DialogHeader(props: DialogHeaderProps) {\n return <div\n data-slot=\"dialog-header\"\n {...props}\n />\n}\n\ntype DialogFooterProps = React.ComponentProps<\"div\">\n\nfunction DialogFooter(props: DialogFooterProps) {\n return <div\n data-slot=\"dialog-footer\"\n {...props}\n />\n}\n\ntype DialogTitleProps = React.ComponentProps<typeof DialogPrimitive.Title>\n\nfunction DialogTitle(props: DialogTitleProps) {\n return <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n {...props}\n />\n}\n\ntype DialogDescriptionProps = React.ComponentProps<\n typeof DialogPrimitive.Description\n>\n\nfunction DialogDescription(props: DialogDescriptionProps) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n {...props}\n />\n )\n}\n\nexport {\n Dialog,\n DialogClose,\n type DialogCloseProps,\n DialogContent,\n type DialogContentProps,\n type DialogContextType,\n DialogDescription,\n type DialogDescriptionProps,\n type DialogFlipDirection,\n DialogFooter,\n type DialogFooterProps,\n DialogHeader,\n type DialogHeaderProps,\n DialogOverlay,\n type DialogOverlayProps,\n DialogPortal,\n type DialogPortalProps,\n type DialogProps,\n DialogTitle,\n type DialogTitleProps,\n DialogTrigger,\n type DialogTriggerProps,\n useDialog,\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/effects/auto-height.tsx"],"names":["AutoHeight","children","deps","transition","style","animate","asChild","props","ref","height","useAutoHeight","Comp","Slot","motion","jsx"],"mappings":"mLAwBA,SAASA,CAAAA,CAAW,CAClB,SAAAC,CAAAA,CACA,IAAA,CAAAC,EAAO,EAAC,CACR,WAAAC,CAAAA,CAAa,CACX,KAAM,QAAA,CACN,SAAA,CAAW,IACX,OAAA,CAAS,EAAA,CACT,OAAQ,CAAA,CACR,SAAA,CAAW,GACb,CAAA,CACA,KAAA,CAAAC,EACA,OAAA,CAAAC,CAAAA,CACA,QAAAC,GAAAA,CAAU,KAAA,CACV,GAAGC,CACL,CAAA,CAAoB,CAClB,GAAM,CAAE,IAAAC,CAAAA,CAAK,MAAA,CAAAC,CAAO,CAAA,CAAIC,aAAAA,CAA8BR,CAAI,CAAA,CAEpDS,CAAAA,CAAOL,IAAUM,CAAAA,CAAOC,MAAAA,CAAO,IAErC,OACEC,GAAAA,CAACH,EAAA,CACC,OAAA,CAAS,CAAE,MAAA,CAAAF,CAAAA,CAAQ,GAAGJ,CAAQ,CAAA,CAC9B,MAAO,CAAE,QAAA,CAAU,SAAU,GAAGD,CAAM,EACtC,UAAA,CAAYD,CAAAA,CACX,GAAGI,CAAAA,CAEJ,QAAA,CAAAO,IAAC,KAAA,CAAA,CAAI,GAAA,CAAKN,EACP,QAAA,CAAAP,CAAAA,CACH,EACF,CAEJ","file":"chunk-ZXAHA7TB.js","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\n\nimport {\n type HTMLMotionProps,\n type LegacyAnimationControls,\n motion,\n type TargetAndTransition,\n type Transition,\n} from \"motion/react\"\n\nimport { Slot, type WithAsChild } from \"../primitives/slot\"\nimport { useAutoHeight } from \"@xploreu/hooks/use-auto-height\"\n\ntype AutoHeightProps = WithAsChild<\n {\n children: React.ReactNode;\n deps?: React.DependencyList;\n animate?: TargetAndTransition | LegacyAnimationControls;\n transition?: Transition;\n } & Omit<HTMLMotionProps<\"div\">, \"animate\">\n>\n\nfunction AutoHeight({\n children,\n deps = [],\n transition = {\n type: \"spring\",\n stiffness: 300,\n damping: 30,\n bounce: 0,\n restDelta: 0.01,\n },\n style,\n animate,\n asChild = false,\n ...props\n}: AutoHeightProps) {\n const { ref, height } = useAutoHeight<HTMLDivElement>(deps)\n\n const Comp = asChild ? Slot : motion.div\n\n return (\n <Comp\n animate={{ height, ...animate }}\n style={{ overflow: \"hidden\", ...style }}\n transition={transition}\n {...props}\n >\n <div ref={ref}>\n {children}\n </div>\n </Comp>\n )\n}\n\nexport { AutoHeight, type AutoHeightProps }\n"]}