@xploreu/components 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-MHG7LM4H.js +2 -0
- package/dist/chunk-MHG7LM4H.js.map +1 -0
- package/dist/chunk-VFZXA6DY.js +2 -0
- package/dist/chunk-VFZXA6DY.js.map +1 -0
- package/dist/chunk-VGDQOHO3.js +2 -0
- package/dist/chunk-VGDQOHO3.js.map +1 -0
- package/dist/chunk-X57LUCWV.js +2 -0
- package/dist/chunk-X57LUCWV.js.map +1 -0
- package/dist/chunk-YMSEOWKF.js +2 -0
- package/dist/chunk-YMSEOWKF.js.map +1 -0
- package/dist/primitives/dialog.d.ts +35 -0
- package/dist/primitives/dialog.js +2 -0
- package/dist/primitives/dialog.js.map +1 -0
- package/dist/primitives/index.d.ts +8 -0
- package/dist/primitives/index.js +2 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/primitives/slot.d.ts +20 -0
- package/dist/primitives/slot.js +2 -0
- package/dist/primitives/slot.js.map +1 -0
- package/dist/primitives/tabs.d.ts +107 -0
- package/dist/primitives/tabs.js +2 -0
- package/dist/primitives/tabs.js.map +1 -0
- package/dist/ui/dialog.d.ts +4 -15
- package/dist/ui/dialog.js +1 -1
- package/dist/ui/index.d.ts +3 -0
- package/dist/ui/index.js +1 -1
- package/dist/ui/tabs.d.ts +5 -33
- package/dist/ui/tabs.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-DRJAHT5N.js +0 -2
- package/dist/chunk-DRJAHT5N.js.map +0 -1
- package/dist/chunk-PC4FRLZM.js +0 -2
- package/dist/chunk-PC4FRLZM.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a}from'./chunk-VFZXA6DY.js';import*as t from'react';import*as C from'@radix-ui/react-tabs';import {useControllableState}from'@radix-ui/react-use-controllable-state';import {AnimatePresence,motion}from'motion/react';import {useAutoHeight}from'@xploreu/hooks/use-auto-height';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {cn}from'@xploreu/lib/cn';import {getStrictContext}from'@xploreu/lib/get-strict-context';function ot({children:e,deps:i=[],transition:o={type:"spring",stiffness:300,damping:30,bounce:0,restDelta:.01},style:a$1,animate:c,asChild:d=false,...b}){let{ref:E,height:H}=useAutoHeight(i),h=d?a:motion.div;return jsx(h,{animate:{height:H,...c},style:{overflow:"hidden",...a$1},transition:o,...b,children:jsx("div",{ref:E,children:e})})}var ht={top:0,left:0,width:0,height:0},st=t.createContext(void 0);function pt(){let e=t.useContext(st);if(!e)throw new Error("useHighlight must be used within a HighlightProvider");return e}function at({ref:e,...i}){let{as:o="div",children:a,value:c,defaultValue:d,onValueChange:b,className:E,style:H,transition:h={type:"spring",stiffness:350,damping:35},hover:q=false,click:G=true,enabled:x=true,controlledItems:W,disabled:J=false,exitDelay:A=200,mode:P="children"}=i,p=t.useRef(null);t.useImperativeHandle(e,()=>p.current);let M=i?.boundsOffset??ht,D=M.top??0,S=M.left??0,O=M.width??0,L=M.height??0,k=t.useRef({top:D,left:S,width:O,height:L});t.useEffect(()=>{k.current={top:D,left:S,width:O,height:L};},[D,S,O,L]);let[N,B]=t.useState(c??d??null),[g,V]=t.useState(null),[U,$]=t.useState(""),_=n=>{B(u=>u!==n?(b?.(n),n):u);},r=t.useRef(void 0);t.useEffect(()=>{r.current=n=>{if(!p.current)return;let u=p.current.getBoundingClientRect(),l=k.current,T={top:n.top-u.top+l.top,left:n.left-u.left+l.left,width:n.width+l.width,height:n.height+l.height};V(s=>s&&s.top===T.top&&s.left===T.left&&s.width===T.width&&s.height===T.height?s:T);};});let v=n=>{r.current?.(n);},R=t.useCallback(()=>{V(n=>n===null?n:null);},[]);t.useEffect(()=>{c!==void 0?B(c):d!==void 0&&B(d);},[c,d]);let z=t.useId();t.useEffect(()=>{if(P!=="parent")return;let n=p.current;if(!n)return;let u=()=>{if(!N)return;let l=n.querySelector(`[data-value="${N}"][data-highlight="true"]`);l&&r.current?.(l.getBoundingClientRect());};return n.addEventListener("scroll",u,{passive:true}),()=>n.removeEventListener("scroll",u)},[P,N]);let f=n=>P==="parent"?jsxs(o,{ref:p,className:i?.containerClassName,"data-slot":"motion-highlight-container",style:{position:"relative",zIndex:1},children:[jsx(AnimatePresence,{initial:false,mode:"wait",children:g&&jsx(motion.div,{animate:{top:g.top,left:g.left,width:g.width,height:g.height,opacity:1},className:cn(E,U),"data-slot":"motion-highlight",exit:{opacity:0,transition:{...h,delay:(h?.delay??0)+(A??0)/1e3}},initial:{top:g.top,left:g.left,width:g.width,height:g.height,opacity:0},style:{position:"absolute",zIndex:0,...H},transition:h})}),n]}):n;return jsx(st.Provider,{value:{mode:P,activeValue:N,setActiveValue:_,id:z,hover:q,click:G,className:E,style:H,transition:h,disabled:J,enabled:x,exitDelay:A,setBounds:v,clearBounds:R,activeClassName:U,setActiveClassName:$,forceUpdateBounds:i?.forceUpdateBounds},children:x?f(W?a:t.Children.map(a,(n,u)=>jsx(tt,{className:i?.itemsClassName,children:n},u))):a})}function X(e,i){return Object.keys(i).reduce((o,a)=>(e.props[a]===void 0&&(o[a]=i[a]),o),{})}function tt({ref:e,as:i,children:o,id:a,value:c,className:d,style:b,transition:E,disabled:H=false,activeClassName:h,exitDelay:q,asChild:G=false,forceUpdateBounds:x,...W}){let J=t.useId(),{activeValue:A,setActiveValue:P,mode:p,setBounds:K,clearBounds:M,hover:D,click:S,enabled:O,className:L,style:k,transition:N,id:B,disabled:g,exitDelay:V,forceUpdateBounds:U,setActiveClassName:$}=pt(),_=i??"div",r=o,v=a??c??r.props?.["data-value"]??r.props?.id??J,R=A===v,z=H===void 0?g:H,f=E??N,n=t.useRef(null);t.useImperativeHandle(e,()=>n.current);let u=t.useCallback(s=>{n.current=s;},[]);if(t.useEffect(()=>{if(p!=="parent")return;let s,I=null,et=x===true||U&&x!==false,Q=()=>{if(!n.current)return;let w=n.current.getBoundingClientRect();if(et){if(I&&I.top===w.top&&I.left===w.left&&I.width===w.width&&I.height===w.height){s=requestAnimationFrame(Q);return}I=w,s=requestAnimationFrame(Q);}K(w);};if(R?(Q(),$(h??"")):A||M(),et)return ()=>cancelAnimationFrame(s)},[p,R,A,K,M,h,$,x,U]),!t.isValidElement(o))return o;let l={"data-active":R?"true":"false","aria-selected":R,"data-disabled":z,"data-value":v,"data-highlight":true},T=D?{onMouseEnter:s=>{P(v),r.props.onMouseEnter?.(s);},onMouseLeave:s=>{P(null),r.props.onMouseLeave?.(s);}}:S?{onClick:s=>{P(v),r.props.onClick?.(s);}}:{};return G?p==="children"?t.cloneElement(r,{key:v,ref:u,className:cn("relative",r.props.className),...X(r,{...l,"data-slot":"motion-highlight-item-container"}),...T,...W},jsxs(Fragment,{children:[jsx(AnimatePresence,{initial:false,mode:"wait",children:R&&!z&&jsx(motion.div,{animate:{opacity:1},className:cn(L,h),"data-slot":"motion-highlight",exit:{opacity:0,transition:{...f,delay:(f?.delay??0)+(q??V??0)/1e3}},initial:{opacity:0},layoutId:`transition-background-${B}`,style:{position:"absolute",zIndex:0,...k,...b},transition:f,...l})}),jsx(_,{className:d,"data-slot":"motion-highlight-item",style:{position:"relative",zIndex:1},...l,children:o})]})):t.cloneElement(r,{ref:u,...X(r,{...l,"data-slot":"motion-highlight-item"}),...T}):O?jsxs(_,{ref:n,className:cn(p==="children"&&"relative",d),"data-slot":"motion-highlight-item-container",...l,...W,...T,children:[p==="children"&&jsx(AnimatePresence,{initial:false,mode:"wait",children:R&&!z&&jsx(motion.div,{animate:{opacity:1},className:cn(L,h),"data-slot":"motion-highlight",exit:{opacity:0,transition:{...f,delay:(f?.delay??0)+(q??V??0)/1e3}},initial:{opacity:0},layoutId:`transition-background-${B}`,style:{position:"absolute",zIndex:0,...k,...b},transition:f,...l})}),t.cloneElement(r,{style:{position:"relative",zIndex:1},className:r.props.className,...X(r,{...l,"data-slot":"motion-highlight-item"})})]},v):o}var[yt,dt]=getStrictContext("TabsContext");function Ot({value:e,defaultValue:i,onValueChange:o,...a}){let[c,d]=useControllableState({prop:e,defaultProp:i||"",onChange:o});return jsx(yt,{value:{value:c,setValue:d},children:jsx(C.Root,{"data-slot":"tabs",value:c,onValueChange:d,...a})})}function kt({transition:e={type:"spring",stiffness:200,damping:25},...i}){let{value:o}=dt();return jsx(at,{click:false,controlledItems:true,"data-slot":"tabs-highlight",transition:e,value:o,...i})}function Vt(e){return jsx(C.List,{"data-slot":"tabs-list",...e})}function Ut(e){return jsx(tt,{"data-slot":"tabs-highlight-item",...e})}function zt(e){return jsx(C.Trigger,{"data-slot":"tabs-trigger",...e})}function Ft({value:e,forceMount:i,transition:o={duration:.5,ease:"easeInOut"},...a}){return jsx(AnimatePresence,{mode:"wait",children:jsx(C.Content,{asChild:true,forceMount:i,value:e,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:e,transition:o,...a})})})}var rt={type:"spring",stiffness:200,damping:30};function bt(e){return !("mode"in e)||e.mode==="auto-height"}function qt(e){let{value:i}=dt();if(bt(e)){let{transition:d=rt,...b}=e;return jsx(ot,{"data-slot":"tabs-contents",deps:[i],transition:d,...b})}let{transition:o=rt,style:a,...c}=e;return jsx(motion.div,{"data-slot":"tabs-contents",layout:"size",layoutDependency:i,style:{overflow:"hidden",...a},transition:{layout:o},...c})}export{Ot as a,kt as b,Vt as c,Ut as d,zt as e,Ft as f,qt as g};//# sourceMappingURL=chunk-MHG7LM4H.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-MHG7LM4H.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/effects/auto-height.tsx","../src/effects/highlight.tsx","../src/primitives/tabs.tsx"],"names":["AutoHeight","children","deps","transition","style","animate","asChild","props","ref","height","useAutoHeight","Comp","Slot","motion","jsx","DEFAULT_BOUNDS_OFFSET","HighlightContext","useHighlight","context","Highlight","Component","value","defaultValue","onValueChange","className","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","AnimatePresence","cn","child","index","HighlightItem","getNonOverridingDataAttributes","element","dataAttributes","acc","key","as","activeClassName","forceUpdateBounds","itemId","setBounds","contextClassName","contextStyle","contextTransition","contextId","contextDisabled","contextExitDelay","contextForceUpdateBounds","setActiveClassName","childValue","isActive","isDisabled","itemTransition","refCallback","node","rafId","previousBounds","shouldUpdateBounds","updateBounds","commonHandlers","e","Fragment","TabsProvider","useTabs","getStrictContext","Tabs","valueProp","setValue","useControllableState","TabsHighlight","TabsList","TabsHighlightItem","TabsTrigger","TabsContent","forceMount","defaultTransition","isAutoMode","TabsContents","autoProps","layoutProps"],"mappings":"4aAwBA,SAASA,EAAAA,CAAW,CAClB,QAAA,CAAAC,CAAAA,CACA,KAAAC,CAAAA,CAAO,GACP,UAAA,CAAAC,CAAAA,CAAa,CACX,IAAA,CAAM,QAAA,CACN,UAAW,GAAA,CACX,OAAA,CAAS,EAAA,CACT,MAAA,CAAQ,CAAA,CACR,SAAA,CAAW,GACb,CAAA,CACA,KAAA,CAAAC,IACA,OAAA,CAAAC,CAAAA,CACA,QAAAC,CAAAA,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,CAAAA,CAAUM,EAAOC,MAAAA,CAAO,GAAA,CAErC,OACEC,GAAAA,CAACH,CAAAA,CAAA,CACC,OAAA,CAAS,CAAE,MAAA,CAAAF,CAAAA,CAAQ,GAAGJ,CAAQ,EAC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6G,CAAAA,CACN,CAEJ,CAEA,GAAM,CAAE,WAAA7G,CAAAA,CAAa0G,EAAAA,CAAmB,MAAAzG,CAAAA,CAAO,GAAG6G,CAAY,CAAA,CAAI1G,CAAAA,CAElE,OACEO,IAACD,MAAAA,CAAO,GAAA,CAAP,CACC,WAAA,CAAU,eAAA,CACV,OAAO,MAAA,CACP,gBAAA,CAAkBQ,CAAAA,CAClB,KAAA,CAAO,CAAE,QAAA,CAAU,SAAU,GAAGjB,CAAM,EACtC,UAAA,CAAY,CAAE,OAAQD,CAAW,CAAA,CAChC,GAAG8G,CAAAA,CACN,CAEJ","file":"chunk-MHG7LM4H.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","\"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}","\"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}"]}
|
|
@@ -0,0 +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
|
|
@@ -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-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"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a,b,c,d,e,g,f as f$1}from'./chunk-MHG7LM4H.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-VGDQOHO3.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-VGDQOHO3.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-VGDQOHO3.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}"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,CAAAA,CACA,eAAA,CAAAC,CAAAA,CAAkB,IAAA,CAClB,cAAA,CAAAC,CAAAA,CACA,aAAAC,GAAAA,CACA,GAAGX,CACL,CAAA,CAAuB,CACrB,OACEY,KAACC,CAAAA,CAAA,CACC,QAAA,CAAA,CA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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"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,IAAA,CACT,GAAGJ,EACN,CAAA,CAEJ,CAEJ,CAQA,SAASQ,CAAAA,CAAc,CACrB,WAAAC,CAAAA,CAAa,CAAE,SAAU,EAAA,CAAK,IAAA,CAA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J,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"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
4
|
+
import { HTMLMotionProps } from 'motion/react';
|
|
5
|
+
|
|
6
|
+
type DialogContextType = {
|
|
7
|
+
open: boolean;
|
|
8
|
+
setOpen: (open: boolean) => void;
|
|
9
|
+
};
|
|
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>;
|
|
14
|
+
declare function DialogTrigger(props: DialogTriggerProps): react_jsx_runtime.JSX.Element;
|
|
15
|
+
type DialogPortalProps = Omit<React.ComponentProps<typeof DialogPrimitive.Portal>, "forceMount">;
|
|
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"> & {
|
|
21
|
+
from?: DialogFlipDirection;
|
|
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>;
|
|
25
|
+
declare function DialogClose(props: DialogCloseProps): react_jsx_runtime.JSX.Element;
|
|
26
|
+
type DialogHeaderProps = React.ComponentProps<"div">;
|
|
27
|
+
declare function DialogHeader(props: DialogHeaderProps): react_jsx_runtime.JSX.Element;
|
|
28
|
+
type DialogFooterProps = React.ComponentProps<"div">;
|
|
29
|
+
declare function DialogFooter(props: DialogFooterProps): react_jsx_runtime.JSX.Element;
|
|
30
|
+
type DialogTitleProps = React.ComponentProps<typeof DialogPrimitive.Title>;
|
|
31
|
+
declare function DialogTitle(props: DialogTitleProps): react_jsx_runtime.JSX.Element;
|
|
32
|
+
type DialogDescriptionProps = React.ComponentProps<typeof DialogPrimitive.Description>;
|
|
33
|
+
declare function DialogDescription(props: DialogDescriptionProps): react_jsx_runtime.JSX.Element;
|
|
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 };
|
|
@@ -0,0 +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
|
|
2
|
+
//# sourceMappingURL=dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"dialog.js"}
|
|
@@ -0,0 +1,8 @@
|
|
|
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';
|
|
3
|
+
export { Tabs, TabsContent, TabsContentProps, TabsContents, TabsContentsProps, TabsHighlight, TabsHighlightItem, TabsHighlightItemProps, TabsHighlightProps, TabsList, TabsListProps, TabsProps, TabsTrigger, TabsTriggerProps } from './tabs.js';
|
|
4
|
+
import 'react/jsx-runtime';
|
|
5
|
+
import 'react';
|
|
6
|
+
import 'motion/react';
|
|
7
|
+
import '@radix-ui/react-dialog';
|
|
8
|
+
import '@radix-ui/react-tabs';
|
|
@@ -0,0 +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-MHG7LM4H.js';export{a as Slot}from'../chunk-VFZXA6DY.js';//# sourceMappingURL=index.js.map
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { HTMLMotionProps } from 'motion/react';
|
|
4
|
+
|
|
5
|
+
type AnyProps = Record<string, unknown>;
|
|
6
|
+
type DOMMotionProps<T extends HTMLElement = HTMLElement> = Omit<HTMLMotionProps<keyof Omit<HTMLElementTagNameMap, `gmpx${string}`>>, "ref"> & {
|
|
7
|
+
ref?: React.Ref<T>;
|
|
8
|
+
};
|
|
9
|
+
type WithAsChild<Base extends object> = (Base & {
|
|
10
|
+
asChild: true;
|
|
11
|
+
children: React.ReactElement;
|
|
12
|
+
}) | (Base & {
|
|
13
|
+
asChild?: false | undefined;
|
|
14
|
+
});
|
|
15
|
+
type SlotProps<T extends HTMLElement = HTMLElement> = {
|
|
16
|
+
children?: any;
|
|
17
|
+
} & DOMMotionProps<T>;
|
|
18
|
+
declare function Slot<T extends HTMLElement = HTMLElement>({ children, ref, ...props }: SlotProps<T>): react_jsx_runtime.JSX.Element | null;
|
|
19
|
+
|
|
20
|
+
export { type AnyProps, type DOMMotionProps, Slot, type SlotProps, type WithAsChild };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"slot.js"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
4
|
+
import { TargetAndTransition, LegacyAnimationControls, Transition, HTMLMotionProps } from 'motion/react';
|
|
5
|
+
import { WithAsChild } from './slot.js';
|
|
6
|
+
|
|
7
|
+
type AutoHeightProps = WithAsChild<{
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
deps?: React.DependencyList;
|
|
10
|
+
animate?: TargetAndTransition | LegacyAnimationControls;
|
|
11
|
+
transition?: Transition;
|
|
12
|
+
} & Omit<HTMLMotionProps<"div">, "animate">>;
|
|
13
|
+
|
|
14
|
+
type HighlightMode = "children" | "parent";
|
|
15
|
+
type Bounds = {
|
|
16
|
+
top: number;
|
|
17
|
+
left: number;
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
};
|
|
21
|
+
type BaseHighlightProps<T extends React.ElementType = "div"> = {
|
|
22
|
+
as?: T;
|
|
23
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
24
|
+
mode?: HighlightMode;
|
|
25
|
+
value?: string | null;
|
|
26
|
+
defaultValue?: string | null;
|
|
27
|
+
onValueChange?: (value: string | null) => void;
|
|
28
|
+
className?: string;
|
|
29
|
+
style?: React.CSSProperties;
|
|
30
|
+
transition?: Transition;
|
|
31
|
+
hover?: boolean;
|
|
32
|
+
click?: boolean;
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
enabled?: boolean;
|
|
35
|
+
exitDelay?: number;
|
|
36
|
+
};
|
|
37
|
+
type ParentModeHighlightProps = {
|
|
38
|
+
boundsOffset?: Partial<Bounds>;
|
|
39
|
+
containerClassName?: string;
|
|
40
|
+
forceUpdateBounds?: boolean;
|
|
41
|
+
};
|
|
42
|
+
type ControlledParentModeHighlightProps<T extends React.ElementType = "div"> = BaseHighlightProps<T> & ParentModeHighlightProps & {
|
|
43
|
+
mode: "parent";
|
|
44
|
+
controlledItems: true;
|
|
45
|
+
children: React.ReactNode;
|
|
46
|
+
};
|
|
47
|
+
type ControlledChildrenModeHighlightProps<T extends React.ElementType = "div"> = BaseHighlightProps<T> & {
|
|
48
|
+
mode?: "children" | undefined;
|
|
49
|
+
controlledItems: true;
|
|
50
|
+
children: React.ReactNode;
|
|
51
|
+
};
|
|
52
|
+
type UncontrolledParentModeHighlightProps<T extends React.ElementType = "div"> = BaseHighlightProps<T> & ParentModeHighlightProps & {
|
|
53
|
+
mode: "parent";
|
|
54
|
+
controlledItems?: false;
|
|
55
|
+
itemsClassName?: string;
|
|
56
|
+
children: React.ReactElement | React.ReactElement[];
|
|
57
|
+
};
|
|
58
|
+
type UncontrolledChildrenModeHighlightProps<T extends React.ElementType = "div"> = BaseHighlightProps<T> & {
|
|
59
|
+
mode?: "children";
|
|
60
|
+
controlledItems?: false;
|
|
61
|
+
itemsClassName?: string;
|
|
62
|
+
children: React.ReactElement | React.ReactElement[];
|
|
63
|
+
};
|
|
64
|
+
type HighlightProps<T extends React.ElementType = "div"> = ControlledParentModeHighlightProps<T> | ControlledChildrenModeHighlightProps<T> | UncontrolledParentModeHighlightProps<T> | UncontrolledChildrenModeHighlightProps<T>;
|
|
65
|
+
type HighlightItemProps<T extends React.ElementType = "div"> = React.ComponentProps<T> & {
|
|
66
|
+
as?: T;
|
|
67
|
+
children: React.ReactElement;
|
|
68
|
+
id?: string;
|
|
69
|
+
value?: string;
|
|
70
|
+
className?: string;
|
|
71
|
+
style?: React.CSSProperties;
|
|
72
|
+
transition?: Transition;
|
|
73
|
+
activeClassName?: string;
|
|
74
|
+
disabled?: boolean;
|
|
75
|
+
exitDelay?: number;
|
|
76
|
+
asChild?: boolean;
|
|
77
|
+
forceUpdateBounds?: boolean;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
type TabsProps = React.ComponentProps<typeof TabsPrimitive.Root>;
|
|
81
|
+
declare function Tabs({ value: valueProp, defaultValue, onValueChange, ...props }: TabsProps): react_jsx_runtime.JSX.Element;
|
|
82
|
+
type TabsHighlightProps = Omit<HighlightProps, "controlledItems" | "value">;
|
|
83
|
+
declare function TabsHighlight({ transition, ...props }: TabsHighlightProps): react_jsx_runtime.JSX.Element;
|
|
84
|
+
type TabsListProps = React.ComponentProps<typeof TabsPrimitive.List>;
|
|
85
|
+
declare function TabsList(props: TabsListProps): react_jsx_runtime.JSX.Element;
|
|
86
|
+
type TabsHighlightItemProps = HighlightItemProps & {
|
|
87
|
+
value: string;
|
|
88
|
+
};
|
|
89
|
+
declare function TabsHighlightItem(props: TabsHighlightItemProps): react_jsx_runtime.JSX.Element;
|
|
90
|
+
type TabsTriggerProps = React.ComponentProps<typeof TabsPrimitive.Trigger>;
|
|
91
|
+
declare function TabsTrigger(props: TabsTriggerProps): react_jsx_runtime.JSX.Element;
|
|
92
|
+
type TabsContentProps = React.ComponentProps<typeof TabsPrimitive.Content> & HTMLMotionProps<"div">;
|
|
93
|
+
declare function TabsContent({ value, forceMount, transition, ...props }: TabsContentProps): react_jsx_runtime.JSX.Element;
|
|
94
|
+
type TabsContentsAutoProps = AutoHeightProps & {
|
|
95
|
+
mode?: "auto-height";
|
|
96
|
+
children: React.ReactNode;
|
|
97
|
+
transition?: Transition;
|
|
98
|
+
};
|
|
99
|
+
type TabsContentsLayoutProps = Omit<HTMLMotionProps<"div">, "transition"> & {
|
|
100
|
+
mode: "layout";
|
|
101
|
+
children: React.ReactNode;
|
|
102
|
+
transition?: Transition;
|
|
103
|
+
};
|
|
104
|
+
type TabsContentsProps = TabsContentsAutoProps | TabsContentsLayoutProps;
|
|
105
|
+
declare function TabsContents(props: TabsContentsProps): react_jsx_runtime.JSX.Element;
|
|
106
|
+
|
|
107
|
+
export { Tabs, TabsContent, type TabsContentProps, TabsContents, type TabsContentsProps, TabsHighlight, TabsHighlightItem, type TabsHighlightItemProps, type TabsHighlightProps, TabsList, type TabsListProps, type TabsProps, TabsTrigger, type TabsTriggerProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"tabs.js"}
|
package/dist/ui/dialog.d.ts
CHANGED
|
@@ -1,19 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
type DialogProps$1 = React$1.ComponentProps<typeof DialogPrimitive.Root>;
|
|
7
|
-
type DialogTriggerProps$1 = React$1.ComponentProps<typeof DialogPrimitive.Trigger>;
|
|
8
|
-
type DialogFlipDirection = "top" | "bottom" | "left" | "right";
|
|
9
|
-
type DialogContentProps$1 = Omit<React$1.ComponentProps<typeof DialogPrimitive.Content>, "forceMount" | "asChild"> & HTMLMotionProps<"div"> & {
|
|
10
|
-
from?: DialogFlipDirection;
|
|
11
|
-
};
|
|
12
|
-
type DialogCloseProps$1 = React$1.ComponentProps<typeof DialogPrimitive.Close>;
|
|
13
|
-
type DialogHeaderProps$1 = React$1.ComponentProps<"div">;
|
|
14
|
-
type DialogFooterProps$1 = React$1.ComponentProps<"div">;
|
|
15
|
-
type DialogTitleProps$1 = React$1.ComponentProps<typeof DialogPrimitive.Title>;
|
|
16
|
-
type DialogDescriptionProps$1 = React$1.ComponentProps<typeof DialogPrimitive.Description>;
|
|
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';
|
|
5
|
+
import 'motion/react';
|
|
17
6
|
|
|
18
7
|
type DialogProps = DialogProps$1;
|
|
19
8
|
declare function Dialog(props: DialogProps): react_jsx_runtime.JSX.Element;
|
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-
|
|
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
|
|
2
2
|
//# sourceMappingURL=dialog.js.map
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -5,6 +5,9 @@ import 'react/jsx-runtime';
|
|
|
5
5
|
import 'class-variance-authority/types';
|
|
6
6
|
import 'react';
|
|
7
7
|
import 'class-variance-authority';
|
|
8
|
+
import '../primitives/dialog.js';
|
|
8
9
|
import '@radix-ui/react-dialog';
|
|
9
10
|
import 'motion/react';
|
|
11
|
+
import '../primitives/tabs.js';
|
|
10
12
|
import '@radix-ui/react-tabs';
|
|
13
|
+
import '../primitives/slot.js';
|
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-
|
|
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-VGDQOHO3.js';import'../chunk-YMSEOWKF.js';import'../chunk-MHG7LM4H.js';import'../chunk-VFZXA6DY.js';//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/ui/tabs.d.ts
CHANGED
|
@@ -1,37 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
asChild: true;
|
|
8
|
-
children: React.ReactElement;
|
|
9
|
-
}) | (Base & {
|
|
10
|
-
asChild?: false | undefined;
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
type AutoHeightProps = WithAsChild<{
|
|
14
|
-
children: React.ReactNode;
|
|
15
|
-
deps?: React.DependencyList;
|
|
16
|
-
animate?: TargetAndTransition | LegacyAnimationControls;
|
|
17
|
-
transition?: Transition;
|
|
18
|
-
} & Omit<HTMLMotionProps<"div">, "animate">>;
|
|
19
|
-
|
|
20
|
-
type TabsProps$1 = React.ComponentProps<typeof TabsPrimitive.Root>;
|
|
21
|
-
type TabsListProps$1 = React.ComponentProps<typeof TabsPrimitive.List>;
|
|
22
|
-
type TabsTriggerProps$1 = React.ComponentProps<typeof TabsPrimitive.Trigger>;
|
|
23
|
-
type TabsContentProps$1 = React.ComponentProps<typeof TabsPrimitive.Content> & HTMLMotionProps<"div">;
|
|
24
|
-
type TabsContentsAutoProps = AutoHeightProps & {
|
|
25
|
-
mode?: "auto-height";
|
|
26
|
-
children: React.ReactNode;
|
|
27
|
-
transition?: Transition;
|
|
28
|
-
};
|
|
29
|
-
type TabsContentsLayoutProps = Omit<HTMLMotionProps<"div">, "transition"> & {
|
|
30
|
-
mode: "layout";
|
|
31
|
-
children: React.ReactNode;
|
|
32
|
-
transition?: Transition;
|
|
33
|
-
};
|
|
34
|
-
type TabsContentsProps$1 = TabsContentsAutoProps | TabsContentsLayoutProps;
|
|
2
|
+
import { TabsProps as TabsProps$1, TabsContentProps as TabsContentProps$1, TabsContentsProps as TabsContentsProps$1, TabsListProps as TabsListProps$1, TabsTriggerProps as TabsTriggerProps$1 } from '../primitives/tabs.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
import '@radix-ui/react-tabs';
|
|
5
|
+
import 'motion/react';
|
|
6
|
+
import '../primitives/slot.js';
|
|
35
7
|
|
|
36
8
|
type TabsProps = TabsProps$1 & {
|
|
37
9
|
variant?: "default" | "underline";
|
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-
|
|
1
|
+
export{a as Tabs,e as TabsContent,d as TabsContents,b as TabsList,c as TabsTrigger}from'../chunk-VGDQOHO3.js';import'../chunk-MHG7LM4H.js';import'../chunk-VFZXA6DY.js';//# sourceMappingURL=tabs.js.map
|
|
2
2
|
//# sourceMappingURL=tabs.js.map
|
package/package.json
CHANGED
package/dist/chunk-DRJAHT5N.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {XIcon}from'lucide-react';import*as n from'react';import*as e 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,jsxs}from'react/jsx-runtime';import {cn}from'@xploreu/lib/cn';var[L,f]=getStrictContext("DialogContext");function C({open:o,defaultOpen:i,onOpenChange:s,...g}){let[l,p]=useControllableState({prop:o,defaultProp:i??false,onChange:s,caller:"DialogOpen"});return jsx(L,{value:{open:l,setOpen:p},children:jsx(e.Root,{"data-slot":"dialog",open:l,onOpenChange:p,...g})})}function x(o){return jsx(e.Trigger,{"data-slot":"dialog-trigger",...o})}function b(o){let{open:i}=f();return jsx(AnimatePresence,{children:i&&jsx(e.Portal,{"data-slot":"dialog-portal",forceMount:true,...o})})}function T({transition:o={duration:.2,ease:"easeInOut"},...i}){return jsx(e.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 O({from:o="left",onOpenAutoFocus:i,onCloseAutoFocus:s,onEscapeKeyDown:g,onPointerDownOutside:l,onInteractOutside:p,transition:M={type:"spring",stiffness:150,damping:25},ref:w,...k}){let D=n.useRef(null);n.useImperativeHandle(w,()=>D.current);let{open:d}=f(),v=o==="bottom"||o==="left"?"20deg":"-20deg",P=o==="top"||o==="bottom"?"rotateX":"rotateY";return n.useEffect(()=>{d||D.current?.classList.remove("transform-none!");},[d]),jsx(e.Content,{asChild:true,forceMount:true,onCloseAutoFocus:s,onEscapeKeyDown:g,onInteractOutside:p,onOpenAutoFocus:i,onPointerDownOutside:l,children:jsx(motion.div,{ref:D,animate:{opacity:1,filter:"blur(0px)",transform:`perspective(500px) ${P}(0deg) scale(1)`},"data-slot":"dialog-content",exit:{opacity:0,filter:"blur(4px)",transform:`perspective(500px) ${P}(${v}) scale(0.8)`},initial:{opacity:0,filter:"blur(4px)",transform:`perspective(500px) ${P}(${v}) scale(0.8)`},transition:M,onAnimationComplete:c=>{typeof c=="object"&&"opacity"in c&&c.opacity!==1||requestAnimationFrame(()=>{D.current?.classList.add("transform-none!");});},...k},"dialog-content")})}function m(o){return jsx(e.Close,{"data-slot":"dialog-close",...o})}function F(o){return jsx("div",{"data-slot":"dialog-header",...o})}function h(o){return jsx("div",{"data-slot":"dialog-footer",...o})}function R(o){return jsx(e.Title,{"data-slot":"dialog-title",...o})}function H(o){return jsx(e.Description,{"data-slot":"dialog-description",...o})}function j(o){return jsx(C,{...o})}function G(o){return jsx(x,{...o})}function J(o){return jsx(m,{...o})}function z({className:o,...i}){return jsx(T,{className:cn("fixed inset-0 z-50 bg-background-overlay-default",o),...i})}function Q({className:o,children:i,showCloseButton:s=true,closeClassName:g,onCloseClick:l,...p}){return jsxs(b,{children:[jsx(z,{}),jsxs(O,{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),...p,children:[i,s&&jsxs(m,{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",g),onClick:l,children:[jsx(XIcon,{}),jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function U({className:o,...i}){return jsx(F,{className:cn("flex flex-col gap-2 text-center sm:text-left bg-bg-primary",o),...i})}function W({className:o,...i}){return jsx(h,{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})}function Z({className:o,...i}){return jsx(R,{className:cn("text-center text-heading-bold-4 text-text-primary",o),...i})}function oo({className:o,...i}){return jsx(H,{className:cn("text-label-semibold-3 text-text-secondary",o),...i})}export{j as a,G as b,J as c,Q as d,U as e,W as f,Z as g,oo as h};//# sourceMappingURL=chunk-DRJAHT5N.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-DRJAHT5N.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/primitives/dialog.tsx","../src/ui/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","className","cn","children","showCloseButton","closeClassName","onCloseClick","jsxs","XIcon"],"mappings":"uWAmBA,GAAM,CAACA,CAAAA,CAAgBC,CAAS,EAC9BC,gBAAAA,CAAoC,eAAe,EAIrD,SAASC,CAAAA,CAAO,CACd,IAAA,CAAMC,CAAAA,CACN,WAAA,CAAAC,CAAAA,CACA,aAAAC,CAAAA,CACA,GAAGC,CACL,CAAA,CAAgB,CACd,GAAM,CAAC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AET,QAAA,CAAA,CAAA7B,GAAAA,CAAC+B,KAAAA,CAAA,EAAM,CAAA,CACP/B,GAAAA,CAAC,MAAA,CAAA,CAAK,SAAA,CAAU,UAAU,QAAA,CAAA,OAAA,CAAK,CAAA,CAAA,CACjC,CAAA,CAAA,CAEJ,CAAA,CAAA,CACF,CAEJ,CAIA,SAASoB,EAAa,CAAE,SAAA,CAAAI,EAAW,GAAG5B,CAAM,CAAA,CAAsB,CAChE,OACEI,GAAAA,CAACoB,CAAAA,CAAA,CACC,SAAA,CAAWK,GAAG,4DAAA,CAA8DD,CAAS,CAAA,CACpF,GAAG5B,EACN,CAEJ,CAIA,SAASyB,CAAAA,CAAa,CAAE,SAAA,CAAAG,CAAAA,CAAW,GAAG5B,CAAM,EAAsB,CAChE,OACEI,GAAAA,CAACqB,CAAAA,CAAA,CACC,SAAA,CAAWI,EAAAA,CACT,sPAAA,CACAD,CACF,EACA,WAAA,CAAU,eAAA,CACT,GAAG5B,CAAAA,CACN,CAEJ,CAIA,SAAS0B,CAAAA,CAAY,CAAE,SAAA,CAAAE,EAAW,GAAG5B,CAAM,CAAA,CAAqB,CAC9D,OACEI,GAAAA,CAACsB,CAAAA,CAAA,CACC,SAAA,CAAWG,GAAG,mDAAA,CAAqDD,CAAS,EAC3E,GAAG5B,CAAAA,CACN,CAEJ,CAIA,SAAS2B,EAAAA,CAAkB,CAAE,UAAAC,CAAAA,CAAW,GAAG5B,CAAM,CAAA,CAA2B,CAC1E,OACEI,GAAAA,CAACuB,CAAAA,CAAA,CACC,UAAWE,EAAAA,CAAG,2CAAA,CAA6CD,CAAS,CAAA,CACnE,GAAG5B,EACN,CAEJ","file":"chunk-DRJAHT5N.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","\"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"]}
|
package/dist/chunk-PC4FRLZM.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import*as n from'react';import*as H from'@radix-ui/react-tabs';import {useControllableState}from'@radix-ui/react-use-controllable-state';import {motion,AnimatePresence,isMotionComponent}from'motion/react';import {cn}from'@xploreu/lib/cn';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useAutoHeight}from'@xploreu/hooks/use-auto-height';import {getStrictContext}from'@xploreu/lib/get-strict-context';function Ct(...t){return e=>{t.forEach(i=>{i&&(typeof i=="function"?i(e):i.current=e);});}}function Ht(t,e){let i={...t,...e};return (t.className||e.className)&&(i.className=cn(t.className,e.className)),(t.style||e.style)&&(i.style={...t.style,...e.style}),i}function st({children:t,ref:e,...i}){let s=typeof t.type=="object"&&t.type!==null&&isMotionComponent(t.type),d=n.useMemo(()=>s?t.type:motion.create(t.type),[s,t.type]);if(!n.isValidElement(t))return null;let{ref:l,...f}=t.props,P=Ht(f,i);return jsx(d,{...P,ref:Ct(l,e)})}function rt({children:t,deps:e=[],transition:i={type:"spring",stiffness:300,damping:30,bounce:0,restDelta:.01},style:s,animate:d,asChild:l=false,...f}){let{ref:P,height:M}=useAutoHeight(e),u=l?st:motion.div;return jsx(u,{animate:{height:M,...d},style:{overflow:"hidden",...s},transition:i,...f,children:jsx("div",{ref:P,children:t})})}var Lt={top:0,left:0,width:0,height:0},lt=n.createContext(void 0);function Nt(){let t=n.useContext(lt);if(!t)throw new Error("useHighlight must be used within a HighlightProvider");return t}function dt({ref:t,...e}){let{as:i="div",children:s,value:d,defaultValue:l,onValueChange:f,className:P,style:M,transition:u={type:"spring",stiffness:350,damping:35},hover:$=false,click:K=true,enabled:L=true,controlledItems:q,disabled:Q=false,exitDelay:N=200,mode:v="children"}=e,g=n.useRef(null);n.useImperativeHandle(t,()=>g.current);let x=e?.boundsOffset??Lt,S=x.top??0,O=x.left??0,k=x.width??0,A=x.height??0,V=n.useRef({top:S,left:O,width:k,height:A});n.useEffect(()=>{V.current={top:S,left:O,width:k,height:A};},[S,O,k,A]);let[B,w]=n.useState(d??l??null),[m,U]=n.useState(null),[z,j]=n.useState(""),G=a=>{w(c=>c!==a?(f?.(a),a):c);},r=n.useRef(void 0);n.useEffect(()=>{r.current=a=>{if(!g.current)return;let c=g.current.getBoundingClientRect(),p=V.current,b={top:a.top-c.top+p.top,left:a.left-c.left+p.left,width:a.width+p.width,height:a.height+p.height};U(o=>o&&o.top===b.top&&o.left===b.left&&o.width===b.width&&o.height===b.height?o:b);};});let R=a=>{r.current?.(a);},C=n.useCallback(()=>{U(a=>a===null?a:null);},[]);n.useEffect(()=>{d!==void 0?w(d):l!==void 0&&w(l);},[d,l]);let F=n.useId();n.useEffect(()=>{if(v!=="parent")return;let a=g.current;if(!a)return;let c=()=>{if(!B)return;let p=a.querySelector(`[data-value="${B}"][data-highlight="true"]`);p&&r.current?.(p.getBoundingClientRect());};return a.addEventListener("scroll",c,{passive:true}),()=>a.removeEventListener("scroll",c)},[v,B]);let T=a=>v==="parent"?jsxs(i,{ref:g,className:e?.containerClassName,"data-slot":"motion-highlight-container",style:{position:"relative",zIndex:1},children:[jsx(AnimatePresence,{initial:false,mode:"wait",children:m&&jsx(motion.div,{animate:{top:m.top,left:m.left,width:m.width,height:m.height,opacity:1},className:cn(P,z),"data-slot":"motion-highlight",exit:{opacity:0,transition:{...u,delay:(u?.delay??0)+(N??0)/1e3}},initial:{top:m.top,left:m.left,width:m.width,height:m.height,opacity:0},style:{position:"absolute",zIndex:0,...M},transition:u})}),a]}):a;return jsx(lt.Provider,{value:{mode:v,activeValue:B,setActiveValue:G,id:F,hover:$,click:K,className:P,style:M,transition:u,disabled:Q,enabled:L,exitDelay:N,setBounds:R,clearBounds:C,activeClassName:z,setActiveClassName:j,forceUpdateBounds:e?.forceUpdateBounds},children:L?T(q?s:n.Children.map(s,(a,c)=>jsx(it,{className:e?.itemsClassName,children:a},c))):s})}function Z(t,e){return Object.keys(e).reduce((i,s)=>(t.props[s]===void 0&&(i[s]=e[s]),i),{})}function it({ref:t,as:e,children:i,id:s,value:d,className:l,style:f,transition:P,disabled:M=false,activeClassName:u,exitDelay:$,asChild:K=false,forceUpdateBounds:L,...q}){let Q=n.useId(),{activeValue:N,setActiveValue:v,mode:g,setBounds:X,clearBounds:x,hover:S,click:O,enabled:k,className:A,style:V,transition:B,id:w,disabled:m,exitDelay:U,forceUpdateBounds:z,setActiveClassName:j}=Nt(),G=e??"div",r=i,R=s??d??r.props?.["data-value"]??r.props?.id??Q,C=N===R,F=M===void 0?m:M,T=P??B,a=n.useRef(null);n.useImperativeHandle(t,()=>a.current);let c=n.useCallback(o=>{a.current=o;},[]);if(n.useEffect(()=>{if(g!=="parent")return;let o,I=null,at=L===true||z&&L!==false,Y=()=>{if(!a.current)return;let D=a.current.getBoundingClientRect();if(at){if(I&&I.top===D.top&&I.left===D.left&&I.width===D.width&&I.height===D.height){o=requestAnimationFrame(Y);return}I=D,o=requestAnimationFrame(Y);}X(D);};if(C?(Y(),j(u??"")):N||x(),at)return ()=>cancelAnimationFrame(o)},[g,C,N,X,x,u,j,L,z]),!n.isValidElement(i))return i;let p={"data-active":C?"true":"false","aria-selected":C,"data-disabled":F,"data-value":R,"data-highlight":true},b=S?{onMouseEnter:o=>{v(R),r.props.onMouseEnter?.(o);},onMouseLeave:o=>{v(null),r.props.onMouseLeave?.(o);}}:O?{onClick:o=>{v(R),r.props.onClick?.(o);}}:{};return K?g==="children"?n.cloneElement(r,{key:R,ref:c,className:cn("relative",r.props.className),...Z(r,{...p,"data-slot":"motion-highlight-item-container"}),...b,...q},jsxs(Fragment,{children:[jsx(AnimatePresence,{initial:false,mode:"wait",children:C&&!F&&jsx(motion.div,{animate:{opacity:1},className:cn(A,u),"data-slot":"motion-highlight",exit:{opacity:0,transition:{...T,delay:(T?.delay??0)+($??U??0)/1e3}},initial:{opacity:0},layoutId:`transition-background-${w}`,style:{position:"absolute",zIndex:0,...V,...f},transition:T,...p})}),jsx(G,{className:l,"data-slot":"motion-highlight-item",style:{position:"relative",zIndex:1},...p,children:i})]})):n.cloneElement(r,{ref:c,...Z(r,{...p,"data-slot":"motion-highlight-item"}),...b}):k?jsxs(G,{ref:a,className:cn(g==="children"&&"relative",l),"data-slot":"motion-highlight-item-container",...p,...q,...b,children:[g==="children"&&jsx(AnimatePresence,{initial:false,mode:"wait",children:C&&!F&&jsx(motion.div,{animate:{opacity:1},className:cn(A,u),"data-slot":"motion-highlight",exit:{opacity:0,transition:{...T,delay:(T?.delay??0)+($??U??0)/1e3}},initial:{opacity:0},layoutId:`transition-background-${w}`,style:{position:"absolute",zIndex:0,...V,...f},transition:T,...p})}),n.cloneElement(r,{style:{position:"relative",zIndex:1},className:r.props.className,...Z(r,{...p,"data-slot":"motion-highlight-item"})})]},R):i}var[Dt,ut]=getStrictContext("TabsContext");function gt({value:t,defaultValue:e,onValueChange:i,...s}){let[d,l]=useControllableState({prop:t,defaultProp:e||"",onChange:i});return jsx(Dt,{value:{value:d,setValue:l},children:jsx(H.Root,{"data-slot":"tabs",value:d,onValueChange:l,...s})})}function mt({transition:t={type:"spring",stiffness:200,damping:25},...e}){let{value:i}=ut();return jsx(dt,{click:false,controlledItems:true,"data-slot":"tabs-highlight",transition:t,value:i,...e})}function ht(t){return jsx(H.List,{"data-slot":"tabs-list",...t})}function ft(t){return jsx(it,{"data-slot":"tabs-highlight-item",...t})}function Tt(t){return jsx(H.Trigger,{"data-slot":"tabs-trigger",...t})}function bt({value:t,forceMount:e,transition:i={duration:.5,ease:"easeInOut"},...s}){return jsx(AnimatePresence,{mode:"wait",children:jsx(H.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,...s})})})}var pt={type:"spring",stiffness:200,damping:30};function St(t){return !("mode"in t)||t.mode==="auto-height"}function yt(t){let{value:e}=ut();if(St(t)){let{transition:l=pt,...f}=t;return jsx(rt,{"data-slot":"tabs-contents",deps:[e],transition:l,...f})}let{transition:i=pt,style:s,...d}=t;return jsx(motion.div,{"data-slot":"tabs-contents",layout:"size",layoutDependency:e,style:{overflow:"hidden",...s},transition:{layout:i},...d})}function re({className:t,variant:e="default",...i}){return jsx(gt,{className:cn("group/tabs flex flex-col gap-2",t),"data-variant":e,...i})}function le({className:t,highlightClassName:e,...i}){return jsx(mt,{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",e),children:jsx(ht,{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",t),...i})})}function de({className:t,...e}){return jsx(ft,{className:"flex-1",value:e.value,children:jsx(Tt,{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",t),...e})})}function pe(t){return jsx(yt,{...t})}function ce({className:t,...e}){return jsx(bt,{className:cn("flex-1 outline-none",t),...e})}export{re as a,le as b,de as c,pe as d,ce as e};//# sourceMappingURL=chunk-PC4FRLZM.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-PC4FRLZM.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/primitives/slot.tsx","../src/effects/auto-height.tsx","../src/effects/highlight.tsx","../src/primitives/tabs.tsx","../src/ui/tabs.tsx"],"names":["mergeRefs","refs","node","ref","mergeProps","childProps","slotProps","merged","cn","Slot","children","props","isAlreadyMotion","isMotionComponent","Base","J","motion","childRef","mergedProps","jsx","AutoHeight","deps","transition","style","animate","asChild","height","useAutoHeight","Comp","DEFAULT_BOUNDS_OFFSET","HighlightContext","useHighlight","context","Highlight","Component","value","defaultValue","onValueChange","className","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","AnimatePresence","child","index","HighlightItem","getNonOverridingDataAttributes","element","dataAttributes","acc","key","as","activeClassName","forceUpdateBounds","itemId","setBounds","contextClassName","contextStyle","contextTransition","contextId","contextDisabled","contextExitDelay","contextForceUpdateBounds","setActiveClassName","childValue","isActive","isDisabled","itemTransition","refCallback","rafId","previousBounds","shouldUpdateBounds","updateBounds","commonHandlers","e","Fragment","TabsProvider","useTabs","getStrictContext","Tabs","valueProp","setValue","useControllableState","TabsHighlight","TabsList","TabsHighlightItem","TabsTrigger","TabsContent","forceMount","defaultTransition","isAutoMode","TabsContents","autoProps","layoutProps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A,CAACkG,EAAAA,CAAA,CACC,SAAA,CAAU,QAAA,CACV,KAAA,CAAO1G,CAAAA,CAAM,KAAA,CAEb,QAAA,CAAAQ,GAAAA,CAACmG,EAAAA,CAAA,CACC,SAAA,CAAW9G,GACT,0gBAAA,CACA,+EAAA,CACA,oFAAA,CACA8B,CACF,CAAA,CACC,GAAG3B,CAAAA,CACN,CAAA,CACF,CAEJ,CAIA,SAASgH,EAAAA,CAAahH,CAAAA,CAA0B,CAC9C,OAAOQ,GAAAA,CAACwG,EAAAA,CAAA,CAAuB,GAAGhH,CAAAA,CAAO,CAC3C,CAIA,SAAS4G,EAAAA,CAAY,CAAE,SAAA,CAAAjF,CAAAA,CAAW,GAAG3B,CAAM,EAAqB,CAC9D,OACEQ,GAAAA,CAACoG,EAAAA,CAAA,CACC,SAAA,CAAW/G,EAAAA,CAAG,qBAAA,CAAuB8B,CAAS,CAAA,CAC7C,GAAG3B,CAAAA,CACN,CAEJ","file":"chunk-PC4FRLZM.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","\"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","\"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}","\"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}","import * as React from \"react\"\n\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}"]}
|