@anker-in/headless-ui 1.3.36-alpha.1784519056607 → 1.3.36-alpha.1784525581056

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var E=Object.create;var f=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,V=Object.prototype.hasOwnProperty;var F=(t,e)=>{for(var a in e)f(t,a,{get:e[a],enumerable:!0})},v=(t,e,a,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of A(e))!V.call(t,o)&&o!==a&&f(t,o,{get:()=>e[o],enumerable:!(s=W(e,o))||s.enumerable});return t};var x=(t,e,a)=>(a=t!=null?E(S(t)):{},v(e||!t||!t.__esModule?f(a,"default",{value:t,enumerable:!0}):a,t)),j=t=>v(f({},"__esModule",{value:!0}),t);var I={};F(I,{Tabs:()=>h,TabsContent:()=>y,TabsList:()=>T,TabsTrigger:()=>R});module.exports=j(I);var l=require("react/jsx-runtime"),r=x(require("react")),c=require("../helpers/index.js"),i=x(require("@radix-ui/react-tabs")),g=require("class-variance-authority");function P(t){return t.trim().replace(/\s+/g,"-")}const b=r.createContext({align:"left",shape:"square"}),h=r.forwardRef(({children:t,align:e="left",shape:a="default",...s},o)=>(0,l.jsx)(i.Root,{ref:o,...s,children:(0,l.jsx)(b.Provider,{value:{align:e,shape:a},children:t})}));h.displayName="Tabs";const q=(0,g.cva)("rounded-tabs",{variants:{shape:{default:"",rounded:"rounded-[28px]",square:"rounded-none"}},defaultVariants:{shape:"default"}}),M=(0,g.cva)("rounded-tabs",{variants:{shape:{default:"",rounded:"rounded-[28px]",square:"rounded-none"}},defaultVariants:{shape:"default"}}),T=r.forwardRef(({className:t,...e},a)=>{const{align:s,shape:o}=r.useContext(b),d=s==="center"?"flex w-full justify-center":s==="right"?"flex w-full justify-end":null,p=(0,l.jsx)(i.List,{ref:a,className:(0,c.cn)("bg-tabs-list-bg flex w-fit max-w-full overflow-x-auto p-1",q({shape:o}),t),style:{scrollbarWidth:"none",msOverflowStyle:"none"},...e});return d?(0,l.jsx)("div",{className:d,children:p}):p});T.displayName=i.List.displayName;const D=["role","aria-selected","aria-controls","tabIndex","data-state","data-disabled","data-radix-collection-item","data-orientation"],R=r.forwardRef(({className:t,onClick:e,value:a,...s},o)=>{const{shape:d}=r.useContext(b),p={};for(const n of Object.keys(s))D.includes(n)||(p[n]=s[n]);const C=n=>{e?.(n);const m=n?.currentTarget,u=n?.currentTarget?.parentElement;if(m&&u){const w=m.offsetLeft,N=m.offsetWidth,k=u.offsetWidth,L=w-k/2+N/2;u.scrollTo({left:L,behavior:"smooth"})}};return(0,l.jsx)(i.Trigger,{ref:o,className:(0,c.cn)("text-info-primary lg-desktop:text-base disabled:text-btn-secondary-disabled lg-desktop:px-[28px] lg-desktop:pt-[15px] lg-desktop:pb-[14px] shrink-0 px-5 pb-2.5 pt-[11px] text-sm font-bold data-[state=active]:bg-white data-[state=active]:text-[#080A0F]",t,M({shape:d})),onClick:C,value:P(a),...p})});R.displayName=i.Trigger.displayName;const y=r.forwardRef(({className:t,value:e,...a},s)=>(0,l.jsx)(i.Content,{ref:s,className:(0,c.cn)(t),value:P(e),...a}));y.displayName=i.Content.displayName;
1
+ "use strict";"use client";var E=Object.create;var f=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,V=Object.prototype.hasOwnProperty;var F=(t,e)=>{for(var a in e)f(t,a,{get:e[a],enumerable:!0})},x=(t,e,a,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of A(e))!V.call(t,o)&&o!==a&&f(t,o,{get:()=>e[o],enumerable:!(s=W(e,o))||s.enumerable});return t};var P=(t,e,a)=>(a=t!=null?E(S(t)):{},x(e||!t||!t.__esModule?f(a,"default",{value:t,enumerable:!0}):a,t)),j=t=>x(f({},"__esModule",{value:!0}),t);var I={};F(I,{Tabs:()=>T,TabsContent:()=>v,TabsList:()=>R,TabsTrigger:()=>y});module.exports=j(I);var l=require("react/jsx-runtime"),r=P(require("react")),c=require("../helpers/index.js"),i=P(require("@radix-ui/react-tabs")),h=require("class-variance-authority");function b(t){return t.trim().replace(/\s+/g,"-")}const g=r.createContext({align:"left",shape:"square"}),T=r.forwardRef(({children:t,align:e="left",shape:a="default",...s},o)=>(0,l.jsx)(i.Root,{ref:o,...s,children:(0,l.jsx)(g.Provider,{value:{align:e,shape:a},children:t})}));T.displayName="Tabs";const q=(0,h.cva)("rounded-tabs",{variants:{shape:{default:"",rounded:"rounded-[28px]",square:"rounded-none"}},defaultVariants:{shape:"default"}}),M=(0,h.cva)("rounded-tabs",{variants:{shape:{default:"",rounded:"rounded-[28px]",square:"rounded-none"}},defaultVariants:{shape:"default"}}),R=r.forwardRef(({className:t,...e},a)=>{const{align:s,shape:o}=r.useContext(g),d=s==="center"?"flex w-full justify-center":s==="right"?"flex w-full justify-end":null,p=(0,l.jsx)(i.List,{ref:a,className:(0,c.cn)("bg-tabs-list-bg flex w-fit max-w-full overflow-x-auto p-1",q({shape:o}),t),style:{scrollbarWidth:"none",msOverflowStyle:"none"},...e});return d?(0,l.jsx)("div",{className:d,children:p}):p});R.displayName=i.List.displayName;const D=["role","aria-selected","aria-controls","tabIndex","data-state","data-disabled","data-orientation"],y=r.forwardRef(({className:t,onClick:e,value:a,...s},o)=>{const{shape:d}=r.useContext(g),p={};for(const n of Object.keys(s))D.includes(n)||(p[n]=s[n]);const C=n=>{e?.(n);const m=n?.currentTarget,u=n?.currentTarget?.parentElement;if(m&&u){const w=m.offsetLeft,N=m.offsetWidth,k=u.offsetWidth,L=w-k/2+N/2;u.scrollTo({left:L,behavior:"smooth"})}};return(0,l.jsx)(i.Trigger,{ref:o,className:(0,c.cn)("text-info-primary lg-desktop:text-base disabled:text-btn-secondary-disabled lg-desktop:px-[28px] lg-desktop:pt-[15px] lg-desktop:pb-[14px] shrink-0 px-5 pb-2.5 pt-[11px] text-sm font-bold data-[state=active]:bg-white data-[state=active]:text-[#080A0F]",t,M({shape:d})),onClick:C,value:b(a),"data-radix-collection-item":b(a),...p})});y.displayName=i.Trigger.displayName;const v=r.forwardRef(({className:t,value:e,...a},s)=>(0,l.jsx)(i.Content,{ref:s,className:(0,c.cn)(t),value:b(e),...a}));v.displayName=i.Content.displayName;
2
2
  //# sourceMappingURL=tabs.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/tabs.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../helpers/index.js'\n\nimport * as TabsPrimitive from '@radix-ui/react-tabs'\nimport { cva } from 'class-variance-authority'\nimport type { Align, Shape } from '../types/props.js'\n\ntype tabShape = Shape | 'default'\n\n/**\n * Sanitize a tab value so it is safe to use as part of an HTML id attribute.\n *\n * HTML ids must not contain whitespace characters. Radix UI uses the value\n * directly in generated ids (e.g. `radix-:r0:-trigger-{value}`), so an\n * unsanitized value like \"best seller\" would produce an invalid id.\n *\n * This function replaces any sequence of whitespace with a single hyphen and\n * trims leading/trailing whitespace, leaving all other characters intact.\n */\nfunction sanitizeTabValue(value: string): string {\n return value.trim().replace(/\\s+/g, '-')\n}\n\nconst TabListContext = React.createContext<{\n align?: Align\n shape: tabShape\n}>({\n align: 'left',\n shape: 'square',\n})\n\nconst Tabs = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root> & {\n align?: Align\n shape?: tabShape\n }\n>(({ children, align = 'left', shape = 'default', ...props }, ref) => (\n <TabsPrimitive.Root ref={ref} {...props}>\n <TabListContext.Provider value={{ align, shape }}>{children}</TabListContext.Provider>\n </TabsPrimitive.Root>\n))\nTabs.displayName = 'Tabs'\n\nconst tabsListVariants = cva('rounded-tabs', {\n variants: {\n shape: {\n default: '',\n rounded: 'rounded-[28px]',\n square: 'rounded-none',\n },\n },\n defaultVariants: {\n shape: 'default',\n },\n})\n\nconst tabsTriggerVariants = cva('rounded-tabs', {\n variants: {\n shape: {\n default: '',\n rounded: 'rounded-[28px]',\n square: 'rounded-none',\n },\n },\n defaultVariants: {\n shape: 'default',\n },\n})\nconst TabsList = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, ...props }, ref) => {\n const { align: alignFromParent, shape: shapeFromParent } = React.useContext(TabListContext)\n\n const wrapperClass =\n alignFromParent === 'center'\n ? 'flex w-full justify-center'\n : alignFromParent === 'right'\n ? 'flex w-full justify-end'\n : null\n\n const list = (\n <TabsPrimitive.List\n ref={ref}\n className={cn(\n 'bg-tabs-list-bg flex w-fit max-w-full overflow-x-auto p-1',\n tabsListVariants({ shape: shapeFromParent }),\n className\n )}\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n {...props}\n />\n )\n\n return wrapperClass ? <div className={wrapperClass}>{list}</div> : list\n})\nTabsList.displayName = TabsPrimitive.List.displayName\n\n/**\n * Radix-internal & ARIA attributes that Radix UI's TabsTrigger manages\n * automatically. Filtering these out of user-passed props prevents conflicts\n * and keeps the rendered DOM ARIA-compliant.\n */\nconst RADIX_MANAGED_ATTRS = [\n 'role',\n 'aria-selected',\n 'aria-controls',\n 'tabIndex',\n 'data-state',\n 'data-disabled',\n 'data-radix-collection-item',\n 'data-orientation',\n] as const\n\nconst TabsTrigger = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, onClick, value, ...props }, ref) => {\n const { shape: shapeFromParent } = React.useContext(TabListContext)\n\n // Strip Radix-managed attributes so the primitive can control them\n const safeProps: Record<string, unknown> = {}\n for (const key of Object.keys(props)) {\n if (!(RADIX_MANAGED_ATTRS as readonly string[]).includes(key)) {\n safeProps[key] = (props as Record<string, unknown>)[key]\n }\n }\n\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(e)\n const tabElement = e?.currentTarget\n const container = e?.currentTarget?.parentElement\n if (tabElement && container) {\n const tabLeft = tabElement.offsetLeft\n const tabWidth = tabElement.offsetWidth\n const containerWidth = container.offsetWidth\n const scrollTo = tabLeft - containerWidth / 2 + tabWidth / 2\n container.scrollTo({\n left: scrollTo,\n behavior: 'smooth',\n })\n }\n }\n return (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n 'text-info-primary lg-desktop:text-base disabled:text-btn-secondary-disabled lg-desktop:px-[28px] lg-desktop:pt-[15px] lg-desktop:pb-[14px] shrink-0 px-5 pb-2.5 pt-[11px] text-sm font-bold data-[state=active]:bg-white data-[state=active]:text-[#080A0F]',\n className,\n tabsTriggerVariants({\n shape: shapeFromParent,\n })\n )}\n onClick={handleClick}\n value={sanitizeTabValue(value)}\n {...safeProps}\n />\n )\n})\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName\n\nconst TabsContent = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, value, ...props }, ref) => (\n <TabsPrimitive.Content ref={ref} className={cn(className)} value={sanitizeTabValue(value)} {...props} />\n))\nTabsContent.displayName = TabsPrimitive.Content.displayName\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent }\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,EAAA,gBAAAC,EAAA,aAAAC,EAAA,gBAAAC,IAAA,eAAAC,EAAAN,GAyCI,IAAAO,EAAA,6BAvCJC,EAAuB,oBACvBC,EAAmB,+BAEnBC,EAA+B,mCAC/BC,EAAoB,oCAepB,SAASC,EAAiBC,EAAuB,CAC/C,OAAOA,EAAM,KAAK,EAAE,QAAQ,OAAQ,GAAG,CACzC,CAEA,MAAMC,EAAiBN,EAAM,cAG1B,CACD,MAAO,OACP,MAAO,QACT,CAAC,EAEKN,EAAOM,EAA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ClD,KAAM,CAAE,MAAOK,CAAgB,EAAIhB,EAAM,WAAWM,CAAc,EAG5De,EAAqC,CAAC,EAC5C,UAAWC,KAAO,OAAO,KAAKZ,CAAK,EAC3BS,EAA0C,SAASG,CAAG,IAC1DD,EAAUC,CAAG,EAAKZ,EAAkCY,CAAG,GAI3D,MAAMC,EAAeC,GAA2C,CAC9DJ,IAAUI,CAAC,EACX,MAAMC,EAAaD,GAAG,cAChBE,EAAYF,GAAG,eAAe,cACpC,GAAIC,GAAcC,EAAW,CAC3B,MAAMC,EAAUF,EAAW,WACrBG,EAAWH,EAAW,YACtBI,EAAiBH,EAAU,YAC3BI,EAAWH,EAAUE,EAAiB,EAAID,EAAW,EAC3DF,EAAU,SAAS,CACjB,KAAMI,EACN,SAAU,QACZ,CAAC,CACH,CACF,EACA,SACE,OAAC5B,EAAc,QAAd,CACC,IAAKS,EACL,aAAW,MACT,8PACAG,EACAD,EAAoB,CAClB,MAAOG,CACT,CAAC,CACH,EACA,QAASO,EACT,MAAOnB,EAAiBC,CAAK,EAC5B,GAAGgB,EACN,CAEJ,CAAC,EACDxB,EAAY,YAAcK,EAAc,QAAQ,YAEhD,MAAMP,EAAcK,EAAM,WAGxB,CAAC,CAAE,UAAAc,EAAW,MAAAT,EAAO,GAAGK,CAAM,EAAGC,OACjC,OAACT,EAAc,QAAd,CAAsB,IAAKS,EAAK,aAAW,MAAGG,CAAS,EAAG,MAAOV,EAAiBC,CAAK,EAAI,GAAGK,EAAO,CACvG,EACDf,EAAY,YAAcO,EAAc,QAAQ",
4
+ "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../helpers/index.js'\n\nimport * as TabsPrimitive from '@radix-ui/react-tabs'\nimport { cva } from 'class-variance-authority'\nimport type { Align, Shape } from '../types/props.js'\n\ntype tabShape = Shape | 'default'\n\n/**\n * Sanitize a tab value so it is safe to use as part of an HTML id attribute.\n *\n * HTML ids must not contain whitespace characters. Radix UI uses the value\n * directly in generated ids (e.g. `radix-:r0:-trigger-{value}`), so an\n * unsanitized value like \"best seller\" would produce an invalid id.\n *\n * This function replaces any sequence of whitespace with a single hyphen and\n * trims leading/trailing whitespace, leaving all other characters intact.\n */\nfunction sanitizeTabValue(value: string): string {\n return value.trim().replace(/\\s+/g, '-')\n}\n\nconst TabListContext = React.createContext<{\n align?: Align\n shape: tabShape\n}>({\n align: 'left',\n shape: 'square',\n})\n\nconst Tabs = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root> & {\n align?: Align\n shape?: tabShape\n }\n>(({ children, align = 'left', shape = 'default', ...props }, ref) => (\n <TabsPrimitive.Root ref={ref} {...props}>\n <TabListContext.Provider value={{ align, shape }}>{children}</TabListContext.Provider>\n </TabsPrimitive.Root>\n))\nTabs.displayName = 'Tabs'\n\nconst tabsListVariants = cva('rounded-tabs', {\n variants: {\n shape: {\n default: '',\n rounded: 'rounded-[28px]',\n square: 'rounded-none',\n },\n },\n defaultVariants: {\n shape: 'default',\n },\n})\n\nconst tabsTriggerVariants = cva('rounded-tabs', {\n variants: {\n shape: {\n default: '',\n rounded: 'rounded-[28px]',\n square: 'rounded-none',\n },\n },\n defaultVariants: {\n shape: 'default',\n },\n})\nconst TabsList = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, ...props }, ref) => {\n const { align: alignFromParent, shape: shapeFromParent } = React.useContext(TabListContext)\n\n const wrapperClass =\n alignFromParent === 'center'\n ? 'flex w-full justify-center'\n : alignFromParent === 'right'\n ? 'flex w-full justify-end'\n : null\n\n const list = (\n <TabsPrimitive.List\n ref={ref}\n className={cn(\n 'bg-tabs-list-bg flex w-fit max-w-full overflow-x-auto p-1',\n tabsListVariants({ shape: shapeFromParent }),\n className\n )}\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n {...props}\n />\n )\n\n return wrapperClass ? <div className={wrapperClass}>{list}</div> : list\n})\nTabsList.displayName = TabsPrimitive.List.displayName\n\n/**\n * Radix-internal & ARIA attributes that Radix UI's TabsTrigger manages\n * automatically. Filtering these out of user-passed props prevents conflicts\n * and keeps the rendered DOM ARIA-compliant.\n */\nconst RADIX_MANAGED_ATTRS = [\n 'role',\n 'aria-selected',\n 'aria-controls',\n 'tabIndex',\n 'data-state',\n 'data-disabled',\n 'data-orientation',\n] as const\n\nconst TabsTrigger = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, onClick, value, ...props }, ref) => {\n const { shape: shapeFromParent } = React.useContext(TabListContext)\n\n // Strip Radix-managed attributes so the primitive can control them\n const safeProps: Record<string, unknown> = {}\n for (const key of Object.keys(props)) {\n if (!(RADIX_MANAGED_ATTRS as readonly string[]).includes(key)) {\n safeProps[key] = (props as Record<string, unknown>)[key]\n }\n }\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(e)\n const tabElement = e?.currentTarget\n const container = e?.currentTarget?.parentElement\n if (tabElement && container) {\n const tabLeft = tabElement.offsetLeft\n const tabWidth = tabElement.offsetWidth\n const containerWidth = container.offsetWidth\n const scrollTo = tabLeft - containerWidth / 2 + tabWidth / 2\n container.scrollTo({\n left: scrollTo,\n behavior: 'smooth',\n })\n }\n }\n return (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n 'text-info-primary lg-desktop:text-base disabled:text-btn-secondary-disabled lg-desktop:px-[28px] lg-desktop:pt-[15px] lg-desktop:pb-[14px] shrink-0 px-5 pb-2.5 pt-[11px] text-sm font-bold data-[state=active]:bg-white data-[state=active]:text-[#080A0F]',\n className,\n tabsTriggerVariants({\n shape: shapeFromParent,\n })\n )}\n onClick={handleClick}\n value={sanitizeTabValue(value)}\n data-radix-collection-item={sanitizeTabValue(value)}\n {...safeProps}\n />\n )\n})\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName\n\nconst TabsContent = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, value, ...props }, ref) => (\n <TabsPrimitive.Content ref={ref} className={cn(className)} value={sanitizeTabValue(value)} {...props} />\n))\nTabsContent.displayName = TabsPrimitive.Content.displayName\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent }\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,EAAA,gBAAAC,EAAA,aAAAC,EAAA,gBAAAC,IAAA,eAAAC,EAAAN,GAyCI,IAAAO,EAAA,6BAvCJC,EAAuB,oBACvBC,EAAmB,+BAEnBC,EAA+B,mCAC/BC,EAAoB,oCAepB,SAASC,EAAiBC,EAAuB,CAC/C,OAAOA,EAAM,KAAK,EAAE,QAAQ,OAAQ,GAAG,CACzC,CAEA,MAAMC,EAAiBN,EAAM,cAG1B,CACD,MAAO,OACP,MAAO,QACT,CAAC,EAEKN,EAAOM,EAAM,WAMjB,CAAC,CAAE,SAAAO,EAAU,MAAAC,EAAQ,OAAQ,MAAAC,EAAQ,UAAW,GAAGC,CAAM,EAAGC,OAC5D,OAACT,EAAc,KAAd,CAAmB,IAAKS,EAAM,GAAGD,EAChC,mBAACJ,EAAe,SAAf,CAAwB,MAAO,CAAE,MAAAE,EAAO,MAAAC,CAAM,EAAI,SAAAF,EAAS,EAC9D,CACD,EACDb,EAAK,YAAc,OAEnB,MAAMkB,KAAmB,OAAI,eAAgB,CAC3C,SAAU,CACR,MAAO,CACL,QAAS,GACT,QAAS,iBACT,OAAQ,cACV,CACF,EACA,gBAAiB,CACf,MAAO,SACT,CACF,CAAC,EAEKC,KAAsB,OAAI,eAAgB,CAC9C,SAAU,CACR,MAAO,CACL,QAAS,GACT,QAAS,iBACT,OAAQ,cACV,CACF,EACA,gBAAiB,CACf,MAAO,SACT,CACF,CAAC,EACKjB,EAAWI,EAAM,WAGrB,CAAC,CAAE,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AC,CACH,EACA,QAASO,EACT,MAAOnB,EAAiBC,CAAK,EAC7B,6BAA4BD,EAAiBC,CAAK,EACjD,GAAGgB,EACN,CAEJ,CAAC,EACDxB,EAAY,YAAcK,EAAc,QAAQ,YAEhD,MAAMP,EAAcK,EAAM,WAGxB,CAAC,CAAE,UAAAc,EAAW,MAAAT,EAAO,GAAGK,CAAM,EAAGC,OACjC,OAACT,EAAc,QAAd,CAAsB,IAAKS,EAAK,aAAW,MAAGG,CAAS,EAAG,MAAOV,EAAiBC,CAAK,EAAI,GAAGK,EAAO,CACvG,EACDf,EAAY,YAAcO,EAAc,QAAQ",
6
6
  "names": ["tabs_exports", "__export", "Tabs", "TabsContent", "TabsList", "TabsTrigger", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "TabsPrimitive", "import_class_variance_authority", "sanitizeTabValue", "value", "TabListContext", "children", "align", "shape", "props", "ref", "tabsListVariants", "tabsTriggerVariants", "className", "alignFromParent", "shapeFromParent", "wrapperClass", "list", "RADIX_MANAGED_ATTRS", "onClick", "safeProps", "key", "handleClick", "e", "tabElement", "container", "tabLeft", "tabWidth", "containerWidth", "scrollTo"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as i}from"react/jsx-runtime";import*as n from"react";import{cn as m}from"../helpers/index.js";import*as r from"@radix-ui/react-tabs";import{cva as b}from"class-variance-authority";function g(t){return t.trim().replace(/\s+/g,"-")}const u=n.createContext({align:"left",shape:"square"}),h=n.forwardRef(({children:t,align:a="left",shape:s="default",...e},l)=>i(r.Root,{ref:l,...e,children:i(u.Provider,{value:{align:a,shape:s},children:t})}));h.displayName="Tabs";const N=b("rounded-tabs",{variants:{shape:{default:"",rounded:"rounded-[28px]",square:"rounded-none"}},defaultVariants:{shape:"default"}}),k=b("rounded-tabs",{variants:{shape:{default:"",rounded:"rounded-[28px]",square:"rounded-none"}},defaultVariants:{shape:"default"}}),T=n.forwardRef(({className:t,...a},s)=>{const{align:e,shape:l}=n.useContext(u),d=e==="center"?"flex w-full justify-center":e==="right"?"flex w-full justify-end":null,p=i(r.List,{ref:s,className:m("bg-tabs-list-bg flex w-fit max-w-full overflow-x-auto p-1",N({shape:l}),t),style:{scrollbarWidth:"none",msOverflowStyle:"none"},...a});return d?i("div",{className:d,children:p}):p});T.displayName=r.List.displayName;const L=["role","aria-selected","aria-controls","tabIndex","data-state","data-disabled","data-radix-collection-item","data-orientation"],R=n.forwardRef(({className:t,onClick:a,value:s,...e},l)=>{const{shape:d}=n.useContext(u),p={};for(const o of Object.keys(e))L.includes(o)||(p[o]=e[o]);const v=o=>{a?.(o);const f=o?.currentTarget,c=o?.currentTarget?.parentElement;if(f&&c){const x=f.offsetLeft,P=f.offsetWidth,C=c.offsetWidth,w=x-C/2+P/2;c.scrollTo({left:w,behavior:"smooth"})}};return i(r.Trigger,{ref:l,className:m("text-info-primary lg-desktop:text-base disabled:text-btn-secondary-disabled lg-desktop:px-[28px] lg-desktop:pt-[15px] lg-desktop:pb-[14px] shrink-0 px-5 pb-2.5 pt-[11px] text-sm font-bold data-[state=active]:bg-white data-[state=active]:text-[#080A0F]",t,k({shape:d})),onClick:v,value:g(s),...p})});R.displayName=r.Trigger.displayName;const y=n.forwardRef(({className:t,value:a,...s},e)=>i(r.Content,{ref:e,className:m(t),value:g(a),...s}));y.displayName=r.Content.displayName;export{h as Tabs,y as TabsContent,T as TabsList,R as TabsTrigger};
1
+ "use client";import{jsx as i}from"react/jsx-runtime";import*as n from"react";import{cn as m}from"../helpers/index.js";import*as r from"@radix-ui/react-tabs";import{cva as g}from"class-variance-authority";function u(t){return t.trim().replace(/\s+/g,"-")}const b=n.createContext({align:"left",shape:"square"}),h=n.forwardRef(({children:t,align:s="left",shape:a="default",...e},l)=>i(r.Root,{ref:l,...e,children:i(b.Provider,{value:{align:s,shape:a},children:t})}));h.displayName="Tabs";const N=g("rounded-tabs",{variants:{shape:{default:"",rounded:"rounded-[28px]",square:"rounded-none"}},defaultVariants:{shape:"default"}}),k=g("rounded-tabs",{variants:{shape:{default:"",rounded:"rounded-[28px]",square:"rounded-none"}},defaultVariants:{shape:"default"}}),T=n.forwardRef(({className:t,...s},a)=>{const{align:e,shape:l}=n.useContext(b),d=e==="center"?"flex w-full justify-center":e==="right"?"flex w-full justify-end":null,p=i(r.List,{ref:a,className:m("bg-tabs-list-bg flex w-fit max-w-full overflow-x-auto p-1",N({shape:l}),t),style:{scrollbarWidth:"none",msOverflowStyle:"none"},...s});return d?i("div",{className:d,children:p}):p});T.displayName=r.List.displayName;const L=["role","aria-selected","aria-controls","tabIndex","data-state","data-disabled","data-orientation"],R=n.forwardRef(({className:t,onClick:s,value:a,...e},l)=>{const{shape:d}=n.useContext(b),p={};for(const o of Object.keys(e))L.includes(o)||(p[o]=e[o]);const v=o=>{s?.(o);const f=o?.currentTarget,c=o?.currentTarget?.parentElement;if(f&&c){const x=f.offsetLeft,P=f.offsetWidth,C=c.offsetWidth,w=x-C/2+P/2;c.scrollTo({left:w,behavior:"smooth"})}};return i(r.Trigger,{ref:l,className:m("text-info-primary lg-desktop:text-base disabled:text-btn-secondary-disabled lg-desktop:px-[28px] lg-desktop:pt-[15px] lg-desktop:pb-[14px] shrink-0 px-5 pb-2.5 pt-[11px] text-sm font-bold data-[state=active]:bg-white data-[state=active]:text-[#080A0F]",t,k({shape:d})),onClick:v,value:u(a),"data-radix-collection-item":u(a),...p})});R.displayName=r.Trigger.displayName;const y=n.forwardRef(({className:t,value:s,...a},e)=>i(r.Content,{ref:e,className:m(t),value:u(s),...a}));y.displayName=r.Content.displayName;export{h as Tabs,y as TabsContent,T as TabsList,R as TabsTrigger};
2
2
  //# sourceMappingURL=tabs.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/tabs.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../helpers/index.js'\n\nimport * as TabsPrimitive from '@radix-ui/react-tabs'\nimport { cva } from 'class-variance-authority'\nimport type { Align, Shape } from '../types/props.js'\n\ntype tabShape = Shape | 'default'\n\n/**\n * Sanitize a tab value so it is safe to use as part of an HTML id attribute.\n *\n * HTML ids must not contain whitespace characters. Radix UI uses the value\n * directly in generated ids (e.g. `radix-:r0:-trigger-{value}`), so an\n * unsanitized value like \"best seller\" would produce an invalid id.\n *\n * This function replaces any sequence of whitespace with a single hyphen and\n * trims leading/trailing whitespace, leaving all other characters intact.\n */\nfunction sanitizeTabValue(value: string): string {\n return value.trim().replace(/\\s+/g, '-')\n}\n\nconst TabListContext = React.createContext<{\n align?: Align\n shape: tabShape\n}>({\n align: 'left',\n shape: 'square',\n})\n\nconst Tabs = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root> & {\n align?: Align\n shape?: tabShape\n }\n>(({ children, align = 'left', shape = 'default', ...props }, ref) => (\n <TabsPrimitive.Root ref={ref} {...props}>\n <TabListContext.Provider value={{ align, shape }}>{children}</TabListContext.Provider>\n </TabsPrimitive.Root>\n))\nTabs.displayName = 'Tabs'\n\nconst tabsListVariants = cva('rounded-tabs', {\n variants: {\n shape: {\n default: '',\n rounded: 'rounded-[28px]',\n square: 'rounded-none',\n },\n },\n defaultVariants: {\n shape: 'default',\n },\n})\n\nconst tabsTriggerVariants = cva('rounded-tabs', {\n variants: {\n shape: {\n default: '',\n rounded: 'rounded-[28px]',\n square: 'rounded-none',\n },\n },\n defaultVariants: {\n shape: 'default',\n },\n})\nconst TabsList = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, ...props }, ref) => {\n const { align: alignFromParent, shape: shapeFromParent } = React.useContext(TabListContext)\n\n const wrapperClass =\n alignFromParent === 'center'\n ? 'flex w-full justify-center'\n : alignFromParent === 'right'\n ? 'flex w-full justify-end'\n : null\n\n const list = (\n <TabsPrimitive.List\n ref={ref}\n className={cn(\n 'bg-tabs-list-bg flex w-fit max-w-full overflow-x-auto p-1',\n tabsListVariants({ shape: shapeFromParent }),\n className\n )}\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n {...props}\n />\n )\n\n return wrapperClass ? <div className={wrapperClass}>{list}</div> : list\n})\nTabsList.displayName = TabsPrimitive.List.displayName\n\n/**\n * Radix-internal & ARIA attributes that Radix UI's TabsTrigger manages\n * automatically. Filtering these out of user-passed props prevents conflicts\n * and keeps the rendered DOM ARIA-compliant.\n */\nconst RADIX_MANAGED_ATTRS = [\n 'role',\n 'aria-selected',\n 'aria-controls',\n 'tabIndex',\n 'data-state',\n 'data-disabled',\n 'data-radix-collection-item',\n 'data-orientation',\n] as const\n\nconst TabsTrigger = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, onClick, value, ...props }, ref) => {\n const { shape: shapeFromParent } = React.useContext(TabListContext)\n\n // Strip Radix-managed attributes so the primitive can control them\n const safeProps: Record<string, unknown> = {}\n for (const key of Object.keys(props)) {\n if (!(RADIX_MANAGED_ATTRS as readonly string[]).includes(key)) {\n safeProps[key] = (props as Record<string, unknown>)[key]\n }\n }\n\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(e)\n const tabElement = e?.currentTarget\n const container = e?.currentTarget?.parentElement\n if (tabElement && container) {\n const tabLeft = tabElement.offsetLeft\n const tabWidth = tabElement.offsetWidth\n const containerWidth = container.offsetWidth\n const scrollTo = tabLeft - containerWidth / 2 + tabWidth / 2\n container.scrollTo({\n left: scrollTo,\n behavior: 'smooth',\n })\n }\n }\n return (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n 'text-info-primary lg-desktop:text-base disabled:text-btn-secondary-disabled lg-desktop:px-[28px] lg-desktop:pt-[15px] lg-desktop:pb-[14px] shrink-0 px-5 pb-2.5 pt-[11px] text-sm font-bold data-[state=active]:bg-white data-[state=active]:text-[#080A0F]',\n className,\n tabsTriggerVariants({\n shape: shapeFromParent,\n })\n )}\n onClick={handleClick}\n value={sanitizeTabValue(value)}\n {...safeProps}\n />\n )\n})\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName\n\nconst TabsContent = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, value, ...props }, ref) => (\n <TabsPrimitive.Content ref={ref} className={cn(className)} value={sanitizeTabValue(value)} {...props} />\n))\nTabsContent.displayName = TabsPrimitive.Content.displayName\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent }\n"],
5
- "mappings": "aAyCI,cAAAA,MAAA,oBAvCJ,UAAYC,MAAW,QACvB,OAAS,MAAAC,MAAU,sBAEnB,UAAYC,MAAmB,uBAC/B,OAAS,OAAAC,MAAW,2BAepB,SAASC,EAAiBC,EAAuB,CAC/C,OAAOA,EAAM,KAAK,EAAE,QAAQ,OAAQ,GAAG,CACzC,CAEA,MAAMC,EAAiBN,EAAM,cAG1B,CACD,MAAO,OACP,MAAO,QACT,CAAC,EAEKO,EAAOP,EAAM,WAMjB,CAAC,CAAE,SAAAQ,EAAU,MAAAC,EAAQ,OAAQ,MAAAC,EAAQ,UAAW,GAAGC,CAAM,EAAGC,IAC5Db,EAACG,EAAc,KAAd,CAAmB,IAAKU,EAAM,GAAGD,EAChC,SAAAZ,EAACO,EAAe,SAAf,CAAwB,MAAO,CAAE,MAAAG,EAAO,MAAAC,CAAM,EAAI,SAAAF,EAAS,EAC9D,CACD,EACDD,EAAK,YAAc,OAEnB,MAAMM,EAAmBV,EAAI,eAAgB,CAC3C,SAAU,CACR,MAAO,CACL,QAAS,GACT,QAAS,iBACT,OAAQ,cACV,CACF,EACA,gBAAiB,CACf,MAAO,SACT,CACF,CAAC,EAEKW,EAAsBX,EAAI,eAAgB,CAC9C,SAAU,CACR,MAAO,CACL,QAAS,GACT,QAAS,iBACT,OAAQ,cACV,CACF,EACA,gBAAiB,CACf,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ACC,IAAKU,EACL,UAAWX,EACT,8PACAe,EACAF,EAAoB,CAClB,MAAOI,CACT,CAAC,CACH,EACA,QAASQ,EACT,MAAOtB,EAAiBC,CAAK,EAC5B,GAAGmB,EACN,CAEJ,CAAC,EACDF,EAAY,YAAcpB,EAAc,QAAQ,YAEhD,MAAMgC,EAAclC,EAAM,WAGxB,CAAC,CAAE,UAAAgB,EAAW,MAAAX,EAAO,GAAGM,CAAM,EAAGC,IACjCb,EAACG,EAAc,QAAd,CAAsB,IAAKU,EAAK,UAAWX,EAAGe,CAAS,EAAG,MAAOZ,EAAiBC,CAAK,EAAI,GAAGM,EAAO,CACvG,EACDuB,EAAY,YAAchC,EAAc,QAAQ",
4
+ "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../helpers/index.js'\n\nimport * as TabsPrimitive from '@radix-ui/react-tabs'\nimport { cva } from 'class-variance-authority'\nimport type { Align, Shape } from '../types/props.js'\n\ntype tabShape = Shape | 'default'\n\n/**\n * Sanitize a tab value so it is safe to use as part of an HTML id attribute.\n *\n * HTML ids must not contain whitespace characters. Radix UI uses the value\n * directly in generated ids (e.g. `radix-:r0:-trigger-{value}`), so an\n * unsanitized value like \"best seller\" would produce an invalid id.\n *\n * This function replaces any sequence of whitespace with a single hyphen and\n * trims leading/trailing whitespace, leaving all other characters intact.\n */\nfunction sanitizeTabValue(value: string): string {\n return value.trim().replace(/\\s+/g, '-')\n}\n\nconst TabListContext = React.createContext<{\n align?: Align\n shape: tabShape\n}>({\n align: 'left',\n shape: 'square',\n})\n\nconst Tabs = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root> & {\n align?: Align\n shape?: tabShape\n }\n>(({ children, align = 'left', shape = 'default', ...props }, ref) => (\n <TabsPrimitive.Root ref={ref} {...props}>\n <TabListContext.Provider value={{ align, shape }}>{children}</TabListContext.Provider>\n </TabsPrimitive.Root>\n))\nTabs.displayName = 'Tabs'\n\nconst tabsListVariants = cva('rounded-tabs', {\n variants: {\n shape: {\n default: '',\n rounded: 'rounded-[28px]',\n square: 'rounded-none',\n },\n },\n defaultVariants: {\n shape: 'default',\n },\n})\n\nconst tabsTriggerVariants = cva('rounded-tabs', {\n variants: {\n shape: {\n default: '',\n rounded: 'rounded-[28px]',\n square: 'rounded-none',\n },\n },\n defaultVariants: {\n shape: 'default',\n },\n})\nconst TabsList = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, ...props }, ref) => {\n const { align: alignFromParent, shape: shapeFromParent } = React.useContext(TabListContext)\n\n const wrapperClass =\n alignFromParent === 'center'\n ? 'flex w-full justify-center'\n : alignFromParent === 'right'\n ? 'flex w-full justify-end'\n : null\n\n const list = (\n <TabsPrimitive.List\n ref={ref}\n className={cn(\n 'bg-tabs-list-bg flex w-fit max-w-full overflow-x-auto p-1',\n tabsListVariants({ shape: shapeFromParent }),\n className\n )}\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n {...props}\n />\n )\n\n return wrapperClass ? <div className={wrapperClass}>{list}</div> : list\n})\nTabsList.displayName = TabsPrimitive.List.displayName\n\n/**\n * Radix-internal & ARIA attributes that Radix UI's TabsTrigger manages\n * automatically. Filtering these out of user-passed props prevents conflicts\n * and keeps the rendered DOM ARIA-compliant.\n */\nconst RADIX_MANAGED_ATTRS = [\n 'role',\n 'aria-selected',\n 'aria-controls',\n 'tabIndex',\n 'data-state',\n 'data-disabled',\n 'data-orientation',\n] as const\n\nconst TabsTrigger = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, onClick, value, ...props }, ref) => {\n const { shape: shapeFromParent } = React.useContext(TabListContext)\n\n // Strip Radix-managed attributes so the primitive can control them\n const safeProps: Record<string, unknown> = {}\n for (const key of Object.keys(props)) {\n if (!(RADIX_MANAGED_ATTRS as readonly string[]).includes(key)) {\n safeProps[key] = (props as Record<string, unknown>)[key]\n }\n }\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(e)\n const tabElement = e?.currentTarget\n const container = e?.currentTarget?.parentElement\n if (tabElement && container) {\n const tabLeft = tabElement.offsetLeft\n const tabWidth = tabElement.offsetWidth\n const containerWidth = container.offsetWidth\n const scrollTo = tabLeft - containerWidth / 2 + tabWidth / 2\n container.scrollTo({\n left: scrollTo,\n behavior: 'smooth',\n })\n }\n }\n return (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n 'text-info-primary lg-desktop:text-base disabled:text-btn-secondary-disabled lg-desktop:px-[28px] lg-desktop:pt-[15px] lg-desktop:pb-[14px] shrink-0 px-5 pb-2.5 pt-[11px] text-sm font-bold data-[state=active]:bg-white data-[state=active]:text-[#080A0F]',\n className,\n tabsTriggerVariants({\n shape: shapeFromParent,\n })\n )}\n onClick={handleClick}\n value={sanitizeTabValue(value)}\n data-radix-collection-item={sanitizeTabValue(value)}\n {...safeProps}\n />\n )\n})\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName\n\nconst TabsContent = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, value, ...props }, ref) => (\n <TabsPrimitive.Content ref={ref} className={cn(className)} value={sanitizeTabValue(value)} {...props} />\n))\nTabsContent.displayName = TabsPrimitive.Content.displayName\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent }\n"],
5
+ "mappings": "aAyCI,cAAAA,MAAA,oBAvCJ,UAAYC,MAAW,QACvB,OAAS,MAAAC,MAAU,sBAEnB,UAAYC,MAAmB,uBAC/B,OAAS,OAAAC,MAAW,2BAepB,SAASC,EAAiBC,EAAuB,CAC/C,OAAOA,EAAM,KAAK,EAAE,QAAQ,OAAQ,GAAG,CACzC,CAEA,MAAMC,EAAiBN,EAAM,cAG1B,CACD,MAAO,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MAAAlB,EAAO,GAAGM,CAAM,EAAGC,IAAQ,CAClD,KAAM,CAAE,MAAOM,CAAgB,EAAIlB,EAAM,WAAWM,CAAc,EAG5DkB,EAAqC,CAAC,EAC5C,UAAWC,KAAO,OAAO,KAAKd,CAAK,EAC3BU,EAA0C,SAASI,CAAG,IAC1DD,EAAUC,CAAG,EAAKd,EAAkCc,CAAG,GAG3D,MAAMC,EAAeC,GAA2C,CAC9DJ,IAAUI,CAAC,EACX,MAAMC,EAAaD,GAAG,cAChBE,EAAYF,GAAG,eAAe,cACpC,GAAIC,GAAcC,EAAW,CAC3B,MAAMC,EAAUF,EAAW,WACrBG,EAAWH,EAAW,YACtBI,EAAiBH,EAAU,YAC3BI,EAAWH,EAAUE,EAAiB,EAAID,EAAW,EAC3DF,EAAU,SAAS,CACjB,KAAMI,EACN,SAAU,QACZ,CAAC,CACH,CACF,EACA,OACElC,EAACG,EAAc,QAAd,CACC,IAAKU,EACL,UAAWX,EACT,8PACAe,EACAF,EAAoB,CAClB,MAAOI,CACT,CAAC,CACH,EACA,QAASQ,EACT,MAAOtB,EAAiBC,CAAK,EAC7B,6BAA4BD,EAAiBC,CAAK,EACjD,GAAGmB,EACN,CAEJ,CAAC,EACDF,EAAY,YAAcpB,EAAc,QAAQ,YAEhD,MAAMgC,EAAclC,EAAM,WAGxB,CAAC,CAAE,UAAAgB,EAAW,MAAAX,EAAO,GAAGM,CAAM,EAAGC,IACjCb,EAACG,EAAc,QAAd,CAAsB,IAAKU,EAAK,UAAWX,EAAGe,CAAS,EAAG,MAAOZ,EAAiBC,CAAK,EAAI,GAAGM,EAAO,CACvG,EACDuB,EAAY,YAAchC,EAAc,QAAQ",
6
6
  "names": ["jsx", "React", "cn", "TabsPrimitive", "cva", "sanitizeTabValue", "value", "TabListContext", "Tabs", "children", "align", "shape", "props", "ref", "tabsListVariants", "tabsTriggerVariants", "TabsList", "className", "alignFromParent", "shapeFromParent", "wrapperClass", "list", "RADIX_MANAGED_ATTRS", "TabsTrigger", "onClick", "safeProps", "key", "handleClick", "e", "tabElement", "container", "tabLeft", "tabWidth", "containerWidth", "scrollTo", "TabsContent"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anker-in/headless-ui",
3
- "version": "1.3.36-alpha.1784519056607",
3
+ "version": "1.3.36-alpha.1784525581056",
4
4
  "type": "commonjs",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "types": "./dist/cjs/index.d.ts",