@tribepad/themis 1.6.10 → 1.6.11
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/CHANGELOG.md +5 -0
- package/dist/elements/Tabs/Tabs.d.ts.map +1 -1
- package/dist/elements/Tabs/index.js +1 -1
- package/dist/elements/Tabs/index.js.map +1 -1
- package/dist/elements/Tabs/index.mjs +1 -1
- package/dist/elements/Tabs/index.mjs.map +1 -1
- package/dist/elements/index.js +1 -1
- package/dist/elements/index.js.map +1 -1
- package/dist/elements/index.mjs +1 -1
- package/dist/elements/index.mjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.6.11] - 2026-06-16
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- **`Tabs` stepper variant (vertical orientation) now matches the `Wizard` stepper look.** The vertical stepper renders round step circles (`rounded-full`, 36×36) with a primary fill + ring on the active/completed step and a bordered, unfilled circle for upcoming steps, a vertical connector between steps (primary once completed), and the label + optional `sublabel` stacked alongside with Wizard-style weight/colour states. The **horizontal** stepper is unchanged (inline numbered pills with line/chevron separators). Visual-only change to the existing `stepper` variant — no API changes; `completed`/`sublabel`/`separator` behave as before.
|
|
12
|
+
|
|
8
13
|
## [1.6.10] - 2026-06-15
|
|
9
14
|
|
|
10
15
|
### Added
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../src/elements/Tabs/Tabs.tsx"],"names":[],"mappings":"AA+DA,OAAO,KAAK,EACV,SA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GASG;AACH,eAAO,MAAM,IAAI,iBAAW,CAAC;AAC7B,eAAO,MAAM,OAAO,yBAAmB,CAAC;AACxC,eAAO,MAAM,GAAG,qBAAe,CAAC;AAChC,eAAO,MAAM,QAAQ,0BAAoB,CAAC;AAG1C,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,cAAc,EAAE,gBAAgB,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';var react=require('react'),lucideReact=require('lucide-react'),reactAriaComponents=require('react-aria-components'),classVarianceAuthority=require('class-variance-authority'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime'),zod=require('zod');function l(...t){return tailwindMerge.twMerge(clsx.clsx(t))}function q(t,n){return !(t===false||n)}var U="(prefers-reduced-motion: reduce)";function ue(){return typeof window>"u"?false:window.matchMedia(U).matches}function Y(){let[t,n]=react.useState(ue);return react.useEffect(()=>{let i=window.matchMedia(U);n(i.matches);let s=p=>{n(p.matches);};return i.addEventListener("change",s),()=>i.removeEventListener("change",s)},[]),t}var _=react.Activity??function({children:n,mode:i}){return jsxRuntime.jsx("div",{"data-activity-mode":i,children:n})},N;function Te(){return N!==void 0?Promise.resolve(N):import('motion/react').then(t=>(N=t.motion.span,N)).catch(()=>(N=null,null))}var $=react.createContext({variant:"default",orientation:"horizontal",animated:true,separator:"line",visualSize:"sm"}),X=react.createContext({tabKeys:[]}),B=classVarianceAuthority.cva(["inline-flex items-center text-[var(--menu-muted)]"],{variants:{variant:{default:"border-b border-[var(--border)] bg-transparent rounded-none p-0 gap-0",block:"justify-center rounded-md p-1 bg-[var(--accent-background)]",pill:"gap-2 bg-transparent rounded-none p-0 border-none",stepper:"flex items-center justify-center gap-0 border-none bg-[var(--content-background)] p-2 rounded-none"},orientation:{horizontal:"flex-row",vertical:"h-auto flex-col w-full"},visualSize:{sm:"",default:"",lg:""}},compoundVariants:[{variant:"block",orientation:"horizontal",class:"gap-0"},{variant:"block",orientation:"horizontal",visualSize:"sm",class:"h-9"},{variant:"block",orientation:"horizontal",visualSize:"default",class:"h-11"},{variant:"block",orientation:"horizontal",visualSize:"lg",class:"h-[52px]"},{variant:"block",orientation:"vertical",class:"gap-1"},{variant:"default",orientation:"vertical",class:"border-b-0 border-l"},{variant:"stepper",orientation:"vertical",class:"gap-1"}],defaultVariants:{variant:"default",orientation:"horizontal",visualSize:"default"}}),V=classVarianceAuthority.cva(["inline-flex items-center justify-center gap-2 whitespace-nowrap","px-3 py-1.5 text-sm font-medium","ring-offset-[var(--content-background)] transition-colors","focus-visible:outline-none focus-visible:ring-2","focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","min-h-[44px]"],{variants:{variant:{default:["px-4","rounded-none bg-transparent","data-[selected]:text-[var(--content-foreground)]","hover:text-[var(--content-foreground)]"],block:["rounded-sm border-none bg-transparent p-0","hover:bg-transparent"],pill:["rounded-none border-none bg-transparent p-0","hover:bg-transparent"],stepper:["flex items-center gap-2 rounded-none border-none bg-transparent px-3 py-2"]},orientation:{horizontal:"",vertical:"w-full justify-start"}},compoundVariants:[{variant:"default",orientation:"horizontal",class:"relative -mb-px"},{variant:"default",orientation:"vertical",class:"relative -ml-px"}],defaultVariants:{variant:"default",orientation:"horizontal"}}),Pe=classVarianceAuthority.cva(["inline-flex items-center justify-center gap-2 whitespace-nowrap","rounded-lg border font-medium transition-colors"],{variants:{visualSize:{sm:"h-7 px-2.5 text-xs gap-1.5",default:"h-9 px-3 text-sm",lg:"h-11 px-4 text-sm"}},defaultVariants:{visualSize:"sm"}}),ze=classVarianceAuthority.cva(["inline-flex items-center justify-center gap-2 whitespace-nowrap","rounded-sm font-medium transition-colors"],{variants:{visualSize:{sm:"h-7 px-2.5 text-xs gap-1.5",default:"h-9 px-3 text-sm",lg:"h-11 px-4 text-sm"}},defaultVariants:{visualSize:"default"}}),L=classVarianceAuthority.cva(["mt-2 ring-offset-[var(--content-background)]","focus-visible:outline-none focus-visible:ring-2","focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2"],{variants:{},defaultVariants:{}});function Z({children:t,variant:n="default",selectedKey:i,defaultSelectedKey:s,onSelectionChange:p,orientation:b="horizontal",keyboardActivation:d="automatic",isDisabled:r=false,disabledKeys:u,animated:v,separator:x="line",visualSize:S,className:c,...g}){let C=Y(),h=q(v,C),[D,K]=react.useState(i??s),R=A=>{n==="stepper"&&K(A),p?.(A);},T=n==="stepper"?i??D:void 0,E=S??(n==="pill"?"sm":"default");return jsxRuntime.jsx($.Provider,{value:{variant:n,orientation:b,stepperSelectedKey:T,animated:h,separator:x,visualSize:E},children:jsxRuntime.jsx(reactAriaComponents.Tabs,{selectedKey:i,defaultSelectedKey:s,onSelectionChange:R,orientation:b,keyboardActivation:d,isDisabled:r,disabledKeys:u,className:l(c),...g,children:t})})}Z.displayName="Tabs";function ee({children:t,className:n,...i}){let{variant:s,orientation:p,visualSize:b}=react.useContext($);if(s==="stepper"){let d=[];return react.Children.forEach(t,r=>{react.isValidElement(r)&&r.props&&typeof r.props.id<"u"&&d.push(r.props.id);}),jsxRuntime.jsx(X.Provider,{value:{tabKeys:d},children:jsxRuntime.jsx(reactAriaComponents.TabList,{className:reactAriaComponents.composeRenderProps(n,r=>l(B({variant:s,orientation:p,visualSize:b}),r)),...i,children:t})})}return jsxRuntime.jsx(reactAriaComponents.TabList,{className:reactAriaComponents.composeRenderProps(n,d=>l(B({variant:s,orientation:p,visualSize:b}),d)),...i,children:t})}ee.displayName="TabList";function te({children:t,id:n,isDisabled:i=false,href:s,target:p,rel:b,download:d,completed:r,sublabel:u,className:v,...x}){process.env.NODE_ENV!=="production"&&!(typeof t=="string"||Array.isArray(t)&&t.some(m=>typeof m=="string"))&&!x["aria-label"]&&console.warn("Tabs: Icon-only tabs should have an aria-label for accessibility.");let S=s!==void 0?{href:s,target:p,rel:b,download:d}:{},{variant:c,orientation:g,stepperSelectedKey:C,animated:h,separator:D,visualSize:K}=react.useContext($),R=react.useContext(X),[T,E]=react.useState(null),A=react.useRef(false);if(react.useEffect(()=>{c!=="default"&&c!=="block"||!h||A.current||(A.current=true,Te().then(o=>{o&&E(()=>o);}));},[c,h]),c==="stepper"){let o=R.tabKeys.indexOf(n),m=C!==void 0?R.tabKeys.indexOf(C):-1,ie=o===0,I=r!==void 0?r:o>=0&&m>=0&&o<m,O=o>=0&&o===m,se=g==="vertical";return jsxRuntime.jsxs(reactAriaComponents.Tab,{id:n,isDisabled:i,...S,className:reactAriaComponents.composeRenderProps(v,le=>l(V({variant:c,orientation:g}),le)),...x,children:[!ie&&!se&&(D==="chevron"?jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-4 w-4 shrink-0 text-[var(--muted-foreground)]","aria-hidden":"true"}):jsxRuntime.jsx("span",{className:"h-px w-6 bg-[var(--border)]","aria-hidden":"true"})),jsxRuntime.jsxs("span",{className:l("inline-flex items-center gap-2 rounded-lg p-2",O&&"bg-[var(--primary-action)]/10"),children:[jsxRuntime.jsx("span",{className:l("flex min-h-7 min-w-7 shrink-0 items-center justify-center rounded-lg px-1.5 text-xs font-bold",O||I?"bg-[var(--primary-action)] text-white":"bg-[var(--accent-background)] text-[var(--muted-foreground)]"),"aria-hidden":"true",children:I?jsxRuntime.jsx(lucideReact.Check,{className:"h-3.5 w-3.5"}):o+1}),jsxRuntime.jsx("span",{className:"sr-only",children:I?`Step ${o+1}, completed:`:`Step ${o+1}:`}),jsxRuntime.jsxs("span",{className:"flex flex-col items-start text-left",children:[jsxRuntime.jsx("span",{className:l(O&&"font-semibold text-[var(--primary-action)]"),children:t}),u!=null&&u!==false&&jsxRuntime.jsx("span",{className:"text-xs text-[var(--muted-foreground)]",children:u})]})]})]})}if(c==="pill")return jsxRuntime.jsx(reactAriaComponents.Tab,{id:n,isDisabled:i,...S,className:reactAriaComponents.composeRenderProps(v,o=>l(V({variant:c,orientation:g}),o)),...x,children:o=>jsxRuntime.jsx("span",{className:l(Pe({visualSize:K}),o.isSelected?"border-[var(--primary-action)] bg-[var(--primary-action)] text-[var(--primary-action-foreground)]":"border-[var(--border)] bg-[var(--content-background)] text-[var(--content-foreground)] hover:bg-[var(--accent-background)]",o.isSelected&&h&&"motion-safe:selection-pulse"),children:t})});if(c==="block"){let o=g==="horizontal";return jsxRuntime.jsx(reactAriaComponents.Tab,{id:n,isDisabled:i,...S,className:reactAriaComponents.composeRenderProps(v,m=>l(V({variant:c,orientation:g}),m)),...x,children:m=>jsxRuntime.jsxs("span",{className:l(ze({visualSize:K}),"relative",m.isSelected?"font-semibold text-[var(--content-foreground)]":"text-[var(--menu-muted)] hover:text-[var(--content-foreground)]"),children:[m.isSelected&&(h&&T?jsxRuntime.jsx(T,{layoutId:`tab-block-indicator-${o?"h":"v"}`,className:"absolute inset-0 rounded-sm bg-[var(--content-background)] shadow-sm",transition:{type:"spring",stiffness:500,damping:30}}):jsxRuntime.jsx("span",{className:"absolute inset-0 rounded-sm bg-[var(--content-background)] shadow-sm"})),jsxRuntime.jsx("span",{className:"relative z-[1] inline-flex items-center gap-2",children:t})]})})}let H=g==="horizontal",Q=H?"absolute bottom-0 left-0 right-0 h-0.5 bg-[var(--primary-action)]":"absolute top-0 bottom-0 left-0 w-0.5 bg-[var(--primary-action)]";return jsxRuntime.jsx(reactAriaComponents.Tab,{id:n,isDisabled:i,...S,className:reactAriaComponents.composeRenderProps(v,o=>l(V({variant:c,orientation:g}),o)),...x,children:o=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[t,c==="default"&&o.isSelected&&(h&&T?jsxRuntime.jsx(T,{layoutId:`tab-indicator-${H?"h":"v"}`,className:Q,transition:{type:"spring",stiffness:500,damping:30}}):jsxRuntime.jsx("span",{className:Q}))]})})}te.displayName="Tab";function ae({children:t,id:n,shouldForceMount:i=false,preserveState:s=false,className:p,...b}){let d=s||i;return typeof t=="function"?jsxRuntime.jsx(reactAriaComponents.TabPanel,{id:n,shouldForceMount:d,className:reactAriaComponents.composeRenderProps(p,r=>l(L(),r)),...b,children:r=>{let u=!r.isInert,v=t({isSelected:u});return s?jsxRuntime.jsx(_,{mode:u?"visible":"hidden",children:v}):v}}):s?jsxRuntime.jsx(reactAriaComponents.TabPanel,{id:n,shouldForceMount:d,className:reactAriaComponents.composeRenderProps(p,r=>l(L(),r)),...b,children:r=>{let u=!r.isInert;return jsxRuntime.jsx(_,{mode:u?"visible":"hidden",children:t})}}):jsxRuntime.jsx(reactAriaComponents.TabPanel,{id:n,shouldForceMount:d,className:reactAriaComponents.composeRenderProps(p,r=>l(L(),r)),...b,children:t})}ae.displayName="TabPanel";var Ae=Z,Ne=ee,we=te,Ve=ae;var P=zod.z.object({className:zod.z.string().optional(),children:zod.z.any().optional(),id:zod.z.string().optional(),"aria-label":zod.z.string().optional(),"aria-labelledby":zod.z.string().optional(),"aria-describedby":zod.z.string().optional(),"aria-live":zod.z.enum(["off","polite","assertive"]).optional(),"aria-hidden":zod.z.boolean().optional(),"data-testid":zod.z.string().optional()});var Ce=zod.z.enum(["default","block","pill","stepper"]),Ke=zod.z.enum(["line","chevron"]),Re=zod.z.enum(["sm","default","lg"]),ne=zod.z.enum(["horizontal","vertical"]),oe=zod.z.enum(["automatic","manual"]),z=zod.z.union([zod.z.string(),zod.z.number()]),Me=P.extend({variant:Ce.optional().default("default"),selectedKey:z.optional(),defaultSelectedKey:z.optional(),onSelectionChange:zod.z.custom().optional(),orientation:ne.optional().default("horizontal"),keyboardActivation:oe.optional().default("automatic"),isDisabled:zod.z.boolean().optional().default(false),disabledKeys:zod.z.array(z).optional(),children:zod.z.custom(),animated:zod.z.boolean().optional().default(true),separator:Ke.optional().default("line"),visualSize:Re.optional()}),Le=P.extend({"aria-label":zod.z.string().optional(),"aria-labelledby":zod.z.string().optional(),children:zod.z.custom()}),De=P.extend({id:z,isDisabled:zod.z.boolean().optional().default(false),href:zod.z.string().optional(),target:zod.z.string().optional(),rel:zod.z.string().optional(),download:zod.z.union([zod.z.string(),zod.z.boolean()]).optional(),completed:zod.z.boolean().optional(),sublabel:zod.z.custom().optional(),children:zod.z.custom()}),Ee=P.extend({id:z,shouldForceMount:zod.z.boolean().optional().default(false),preserveState:zod.z.boolean().optional().default(false),children:zod.z.custom()}),re=zod.z.enum(["left","right","up","down"]),Ie=P.extend({direction:re,isDisabled:zod.z.boolean().optional().default(false),onPress:zod.z.custom(),"aria-label":zod.z.string()});exports.KeySchema=z;exports.ScrollArrowDirectionSchema=re;exports.ScrollArrowPropsSchema=Ie;exports.Tab=we;exports.TabList=Ne;exports.TabListPropsSchema=Le;exports.TabPanel=Ve;exports.TabPanelPropsSchema=Ee;exports.TabPropsSchema=De;exports.Tabs=Ae;exports.TabsKeyboardActivationSchema=oe;exports.TabsOrientationSchema=ne;exports.TabsPropsSchema=Me;exports.tabListVariants=B;exports.tabPanelVariants=L;exports.tabVariants=V;//# sourceMappingURL=index.js.map
|
|
2
|
+
'use strict';var react=require('react'),lucideReact=require('lucide-react'),reactAriaComponents=require('react-aria-components'),classVarianceAuthority=require('class-variance-authority'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime'),zod=require('zod');function s(...a){return tailwindMerge.twMerge(clsx.clsx(a))}function Y(a,o){return !(a===false||o)}var _="(prefers-reduced-motion: reduce)";function ge(){return typeof window>"u"?false:window.matchMedia(_).matches}function G(){let[a,o]=react.useState(ge);return react.useEffect(()=>{let i=window.matchMedia(_);o(i.matches);let l=d=>{o(d.matches);};return i.addEventListener("change",l),()=>i.removeEventListener("change",l)},[]),a}var W=react.Activity??function({children:o,mode:i}){return jsxRuntime.jsx("div",{"data-activity-mode":i,children:o})},R;function ze(){return R!==void 0?Promise.resolve(R):import('motion/react').then(a=>(R=a.motion.span,R)).catch(()=>(R=null,null))}var H=react.createContext({variant:"default",orientation:"horizontal",animated:true,separator:"line",visualSize:"sm"}),te=react.createContext({tabKeys:[]}),B=classVarianceAuthority.cva(["inline-flex items-center text-[var(--menu-muted)]"],{variants:{variant:{default:"border-b border-[var(--border)] bg-transparent rounded-none p-0 gap-0",block:"justify-center rounded-md p-1 bg-[var(--accent-background)]",pill:"gap-2 bg-transparent rounded-none p-0 border-none",stepper:"flex items-center justify-center gap-0 border-none bg-[var(--content-background)] p-2 rounded-none"},orientation:{horizontal:"flex-row",vertical:"h-auto flex-col w-full"},visualSize:{sm:"",default:"",lg:""}},compoundVariants:[{variant:"block",orientation:"horizontal",class:"gap-0"},{variant:"block",orientation:"horizontal",visualSize:"sm",class:"h-9"},{variant:"block",orientation:"horizontal",visualSize:"default",class:"h-11"},{variant:"block",orientation:"horizontal",visualSize:"lg",class:"h-[52px]"},{variant:"block",orientation:"vertical",class:"gap-1"},{variant:"default",orientation:"vertical",class:"border-b-0 border-l"},{variant:"stepper",orientation:"vertical",class:"gap-1"}],defaultVariants:{variant:"default",orientation:"horizontal",visualSize:"default"}}),z=classVarianceAuthority.cva(["inline-flex items-center justify-center gap-2 whitespace-nowrap","px-3 py-1.5 text-sm font-medium","ring-offset-[var(--content-background)] transition-colors","focus-visible:outline-none focus-visible:ring-2","focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","min-h-[44px]"],{variants:{variant:{default:["px-4","rounded-none bg-transparent","data-[selected]:text-[var(--content-foreground)]","hover:text-[var(--content-foreground)]"],block:["rounded-sm border-none bg-transparent p-0","hover:bg-transparent"],pill:["rounded-none border-none bg-transparent p-0","hover:bg-transparent"],stepper:["flex items-center gap-2 rounded-none border-none bg-transparent px-3 py-2"]},orientation:{horizontal:"",vertical:"w-full justify-start"}},compoundVariants:[{variant:"default",orientation:"horizontal",class:"relative -mb-px"},{variant:"default",orientation:"vertical",class:"relative -ml-px"}],defaultVariants:{variant:"default",orientation:"horizontal"}}),Ae=classVarianceAuthority.cva(["inline-flex items-center justify-center gap-2 whitespace-nowrap","rounded-lg border font-medium transition-colors"],{variants:{visualSize:{sm:"h-7 px-2.5 text-xs gap-1.5",default:"h-9 px-3 text-sm",lg:"h-11 px-4 text-sm"}},defaultVariants:{visualSize:"sm"}}),we=classVarianceAuthority.cva(["inline-flex items-center justify-center gap-2 whitespace-nowrap","rounded-sm font-medium transition-colors"],{variants:{visualSize:{sm:"h-7 px-2.5 text-xs gap-1.5",default:"h-9 px-3 text-sm",lg:"h-11 px-4 text-sm"}},defaultVariants:{visualSize:"default"}}),E=classVarianceAuthority.cva(["mt-2 ring-offset-[var(--content-background)]","focus-visible:outline-none focus-visible:ring-2","focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2"],{variants:{},defaultVariants:{}});function ae({children:a,variant:o="default",selectedKey:i,defaultSelectedKey:l,onSelectionChange:d,orientation:b="horizontal",keyboardActivation:u="automatic",isDisabled:r=false,disabledKeys:c,animated:m,separator:x="line",visualSize:T,className:p,...f}){let L=G(),P=Y(m,L),[I,D]=react.useState(i??l),V=k=>{o==="stepper"&&D(k),d?.(k);},N=o==="stepper"?i??I:void 0,O=T??(o==="pill"?"sm":"default");return jsxRuntime.jsx(H.Provider,{value:{variant:o,orientation:b,stepperSelectedKey:N,animated:P,separator:x,visualSize:O},children:jsxRuntime.jsx(reactAriaComponents.Tabs,{selectedKey:i,defaultSelectedKey:l,onSelectionChange:V,orientation:b,keyboardActivation:u,isDisabled:r,disabledKeys:c,className:s(p),...f,children:a})})}ae.displayName="Tabs";function ne({children:a,className:o,...i}){let{variant:l,orientation:d,visualSize:b}=react.useContext(H);if(l==="stepper"){let u=[];return react.Children.forEach(a,r=>{react.isValidElement(r)&&r.props&&typeof r.props.id<"u"&&u.push(r.props.id);}),jsxRuntime.jsx(te.Provider,{value:{tabKeys:u},children:jsxRuntime.jsx(reactAriaComponents.TabList,{className:reactAriaComponents.composeRenderProps(o,r=>s(B({variant:l,orientation:d,visualSize:b}),r)),...i,children:a})})}return jsxRuntime.jsx(reactAriaComponents.TabList,{className:reactAriaComponents.composeRenderProps(o,u=>s(B({variant:l,orientation:d,visualSize:b}),u)),...i,children:a})}ne.displayName="TabList";function oe({children:a,id:o,isDisabled:i=false,href:l,target:d,rel:b,download:u,completed:r,sublabel:c,className:m,...x}){process.env.NODE_ENV!=="production"&&!(typeof a=="string"||Array.isArray(a)&&a.some(v=>typeof v=="string"))&&!x["aria-label"]&&console.warn("Tabs: Icon-only tabs should have an aria-label for accessibility.");let T=l!==void 0?{href:l,target:d,rel:b,download:u}:{},{variant:p,orientation:f,stepperSelectedKey:L,animated:P,separator:I,visualSize:D}=react.useContext(H),V=react.useContext(te),[N,O]=react.useState(null),k=react.useRef(false);if(react.useEffect(()=>{p!=="default"&&p!=="block"||!P||k.current||(k.current=true,ze().then(n=>{n&&O(()=>n);}));},[p,P]),p==="stepper"){let n=V.tabKeys.indexOf(o),v=L!==void 0?V.tabKeys.indexOf(L):-1,ce=n===0,h=r!==void 0?r:n>=0&&v>=0&&n<v,C=n>=0&&n===v,U=f==="vertical";if(U){let j=n>=0&&n===V.tabKeys.length-1,pe=C||h?"bg-[var(--primary)] text-[var(--primary-foreground)] ring-4 ring-[var(--primary)]/25":"border border-[var(--border)] bg-[var(--content-background)] text-[var(--menu-muted)]",de=C?"font-semibold text-[var(--content-foreground)]":h?"font-medium text-[var(--content-foreground)]":"text-[var(--menu-muted)]";return jsxRuntime.jsxs(reactAriaComponents.Tab,{id:o,isDisabled:i,...T,className:reactAriaComponents.composeRenderProps(m,ue=>s(z({variant:p,orientation:f}),"items-start gap-0 py-0",ue)),...x,children:[jsxRuntime.jsxs("span",{className:"flex shrink-0 flex-col items-center",children:[jsxRuntime.jsx("span",{className:s("flex h-9 w-9 shrink-0 items-center justify-center rounded-full text-sm font-semibold transition-colors",pe),"aria-hidden":"true",children:h?jsxRuntime.jsx(lucideReact.Check,{className:"h-4 w-4"}):n+1}),!j&&jsxRuntime.jsx("span",{className:s("my-0.5 h-5 w-0.5 transition-colors",h?"bg-[var(--primary)]":"bg-[var(--border)]"),"aria-hidden":"true"})]}),jsxRuntime.jsx("span",{className:"sr-only",children:h?`Step ${n+1}, completed:`:`Step ${n+1}:`}),jsxRuntime.jsxs("span",{className:"flex min-h-9 flex-1 flex-col items-start justify-center pl-3 text-left",children:[jsxRuntime.jsx("span",{className:s("text-sm",de),children:a}),c!=null&&c!==false&&jsxRuntime.jsx("span",{className:"text-xs text-[var(--content-foreground)]",children:c})]})]})}return jsxRuntime.jsxs(reactAriaComponents.Tab,{id:o,isDisabled:i,...T,className:reactAriaComponents.composeRenderProps(m,j=>s(z({variant:p,orientation:f}),j)),...x,children:[!ce&&!U&&(I==="chevron"?jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-4 w-4 shrink-0 text-[var(--muted-foreground)]","aria-hidden":"true"}):jsxRuntime.jsx("span",{className:"h-px w-6 bg-[var(--border)]","aria-hidden":"true"})),jsxRuntime.jsxs("span",{className:s("inline-flex items-center gap-2 rounded-lg p-2",C&&"bg-[var(--primary-action)]/10"),children:[jsxRuntime.jsx("span",{className:s("flex min-h-7 min-w-7 shrink-0 items-center justify-center rounded-lg px-1.5 text-xs font-bold",C||h?"bg-[var(--primary-action)] text-white":"bg-[var(--accent-background)] text-[var(--muted-foreground)]"),"aria-hidden":"true",children:h?jsxRuntime.jsx(lucideReact.Check,{className:"h-3.5 w-3.5"}):n+1}),jsxRuntime.jsx("span",{className:"sr-only",children:h?`Step ${n+1}, completed:`:`Step ${n+1}:`}),jsxRuntime.jsxs("span",{className:"flex flex-col items-start text-left",children:[jsxRuntime.jsx("span",{className:s(C&&"font-semibold text-[var(--primary-action)]"),children:a}),c!=null&&c!==false&&jsxRuntime.jsx("span",{className:"text-xs text-[var(--muted-foreground)]",children:c})]})]})]})}if(p==="pill")return jsxRuntime.jsx(reactAriaComponents.Tab,{id:o,isDisabled:i,...T,className:reactAriaComponents.composeRenderProps(m,n=>s(z({variant:p,orientation:f}),n)),...x,children:n=>jsxRuntime.jsx("span",{className:s(Ae({visualSize:D}),n.isSelected?"border-[var(--primary-action)] bg-[var(--primary-action)] text-[var(--primary-action-foreground)]":"border-[var(--border)] bg-[var(--content-background)] text-[var(--content-foreground)] hover:bg-[var(--accent-background)]",n.isSelected&&P&&"motion-safe:selection-pulse"),children:a})});if(p==="block"){let n=f==="horizontal";return jsxRuntime.jsx(reactAriaComponents.Tab,{id:o,isDisabled:i,...T,className:reactAriaComponents.composeRenderProps(m,v=>s(z({variant:p,orientation:f}),v)),...x,children:v=>jsxRuntime.jsxs("span",{className:s(we({visualSize:D}),"relative",v.isSelected?"font-semibold text-[var(--content-foreground)]":"text-[var(--menu-muted)] hover:text-[var(--content-foreground)]"),children:[v.isSelected&&(P&&N?jsxRuntime.jsx(N,{layoutId:`tab-block-indicator-${n?"h":"v"}`,className:"absolute inset-0 rounded-sm bg-[var(--content-background)] shadow-sm",transition:{type:"spring",stiffness:500,damping:30}}):jsxRuntime.jsx("span",{className:"absolute inset-0 rounded-sm bg-[var(--content-background)] shadow-sm"})),jsxRuntime.jsx("span",{className:"relative z-[1] inline-flex items-center gap-2",children:a})]})})}let Q=f==="horizontal",q=Q?"absolute bottom-0 left-0 right-0 h-0.5 bg-[var(--primary-action)]":"absolute top-0 bottom-0 left-0 w-0.5 bg-[var(--primary-action)]";return jsxRuntime.jsx(reactAriaComponents.Tab,{id:o,isDisabled:i,...T,className:reactAriaComponents.composeRenderProps(m,n=>s(z({variant:p,orientation:f}),n)),...x,children:n=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[a,p==="default"&&n.isSelected&&(P&&N?jsxRuntime.jsx(N,{layoutId:`tab-indicator-${Q?"h":"v"}`,className:q,transition:{type:"spring",stiffness:500,damping:30}}):jsxRuntime.jsx("span",{className:q}))]})})}oe.displayName="Tab";function re({children:a,id:o,shouldForceMount:i=false,preserveState:l=false,className:d,...b}){let u=l||i;return typeof a=="function"?jsxRuntime.jsx(reactAriaComponents.TabPanel,{id:o,shouldForceMount:u,className:reactAriaComponents.composeRenderProps(d,r=>s(E(),r)),...b,children:r=>{let c=!r.isInert,m=a({isSelected:c});return l?jsxRuntime.jsx(W,{mode:c?"visible":"hidden",children:m}):m}}):l?jsxRuntime.jsx(reactAriaComponents.TabPanel,{id:o,shouldForceMount:u,className:reactAriaComponents.composeRenderProps(d,r=>s(E(),r)),...b,children:r=>{let c=!r.isInert;return jsxRuntime.jsx(W,{mode:c?"visible":"hidden",children:a})}}):jsxRuntime.jsx(reactAriaComponents.TabPanel,{id:o,shouldForceMount:u,className:reactAriaComponents.composeRenderProps(d,r=>s(E(),r)),...b,children:a})}re.displayName="TabPanel";var Ve=ae,ke=ne,Ce=oe,Ke=re;var A=zod.z.object({className:zod.z.string().optional(),children:zod.z.any().optional(),id:zod.z.string().optional(),"aria-label":zod.z.string().optional(),"aria-labelledby":zod.z.string().optional(),"aria-describedby":zod.z.string().optional(),"aria-live":zod.z.enum(["off","polite","assertive"]).optional(),"aria-hidden":zod.z.boolean().optional(),"data-testid":zod.z.string().optional()});var Me=zod.z.enum(["default","block","pill","stepper"]),Le=zod.z.enum(["line","chevron"]),De=zod.z.enum(["sm","default","lg"]),ie=zod.z.enum(["horizontal","vertical"]),se=zod.z.enum(["automatic","manual"]),w=zod.z.union([zod.z.string(),zod.z.number()]),Ee=A.extend({variant:Me.optional().default("default"),selectedKey:w.optional(),defaultSelectedKey:w.optional(),onSelectionChange:zod.z.custom().optional(),orientation:ie.optional().default("horizontal"),keyboardActivation:se.optional().default("automatic"),isDisabled:zod.z.boolean().optional().default(false),disabledKeys:zod.z.array(w).optional(),children:zod.z.custom(),animated:zod.z.boolean().optional().default(true),separator:Le.optional().default("line"),visualSize:De.optional()}),Ie=A.extend({"aria-label":zod.z.string().optional(),"aria-labelledby":zod.z.string().optional(),children:zod.z.custom()}),Oe=A.extend({id:w,isDisabled:zod.z.boolean().optional().default(false),href:zod.z.string().optional(),target:zod.z.string().optional(),rel:zod.z.string().optional(),download:zod.z.union([zod.z.string(),zod.z.boolean()]).optional(),completed:zod.z.boolean().optional(),sublabel:zod.z.custom().optional(),children:zod.z.custom()}),je=A.extend({id:w,shouldForceMount:zod.z.boolean().optional().default(false),preserveState:zod.z.boolean().optional().default(false),children:zod.z.custom()}),le=zod.z.enum(["left","right","up","down"]),Fe=A.extend({direction:le,isDisabled:zod.z.boolean().optional().default(false),onPress:zod.z.custom(),"aria-label":zod.z.string()});exports.KeySchema=w;exports.ScrollArrowDirectionSchema=le;exports.ScrollArrowPropsSchema=Fe;exports.Tab=Ce;exports.TabList=ke;exports.TabListPropsSchema=Ie;exports.TabPanel=Ke;exports.TabPanelPropsSchema=je;exports.TabPropsSchema=Oe;exports.Tabs=Ve;exports.TabsKeyboardActivationSchema=se;exports.TabsOrientationSchema=ie;exports.TabsPropsSchema=Ee;exports.tabListVariants=B;exports.tabPanelVariants=E;exports.tabVariants=z;//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/cn.ts","../../../src/utils/shouldAnimate.ts","../../../src/hooks/useReducedMotion.ts","../../../src/elements/Tabs/Tabs.tsx","../../../src/schemas/BaseComponentProps.ts","../../../src/elements/Tabs/Tabs.types.ts"],"names":["cn","inputs","twMerge","clsx","shouldAnimate","animated","prefersReducedMotion","QUERY","getInitialState","useReducedMotion","setPrefersReducedMotion","useState","useEffect","mql","handler","event","Activity","ReactActivity","children","mode","jsx","cachedMotionSpan","loadMotionSpan","m","TabsInternalContext","createContext","StepperContext","tabListVariants","cva","tabVariants","tabPillVisualVariants","tabBlockVisualVariants","tabPanelVariants","TabsRoot","variant","selectedKey","defaultSelectedKey","onSelectionChange","orientation","keyboardActivation","isDisabled","disabledKeys","animatedProp","separator","visualSize","className","props","doAnimate","trackedKey","setTrackedKey","handleSelectionChange","key","stepperSelectedKey","effectiveVisualSize","AriaTabs","TabListComponent","useContext","tabKeys","Children","child","isValidElement","AriaTabList","composeRenderProps","TabComponent","id","href","target","rel","download","completed","sublabel","linkProps","stepperCtx","MotionSpan","setMotionSpan","motionLoadedRef","useRef","component","tabIndex","selectedIndex","isFirst","isCompleted","isActive","isVertical","jsxs","AriaTab","ChevronRight","Check","renderProps","blockHorizontal","isHorizontal","indicatorClasses","Fragment","TabPanelComponent","shouldForceMount","preserveState","forceMount","AriaTabPanel","isSelected","content","Tabs","TabList","Tab","TabPanel","BaseComponentPropsSchema","z","TabsVariantSchema","StepperSeparatorSchema","TabsVisualSizeSchema","TabsOrientationSchema","TabsKeyboardActivationSchema","KeySchema","TabsPropsSchema","TabListPropsSchema","TabPropsSchema","TabPanelPropsSchema","ScrollArrowDirectionSchema","ScrollArrowPropsSchema"],"mappings":"oTAcO,SAASA,CAAAA,CAAAA,GAAMC,CAAAA,CAA8B,CAClD,OAAOC,qBAAAA,CAAQC,UAAKF,CAAM,CAAC,CAC7B,CCNO,SAASG,CAAAA,CACdC,EACAC,CAAAA,CACS,CAET,OADI,EAAAD,CAAAA,GAAa,KAAA,EACbC,EAEN,CCbA,IAAMC,CAAAA,CAAQ,kCAAA,CAEd,SAASC,EAAAA,EAA2B,CAClC,OAAI,OAAO,MAAA,CAAW,GAAA,CAAoB,KAAA,CACnC,MAAA,CAAO,UAAA,CAAWD,CAAK,CAAA,CAAE,OAClC,CASO,SAASE,CAAAA,EAA4B,CAC1C,GAAM,CAACH,CAAAA,CAAsBI,CAAuB,CAAA,CAAIC,cAAAA,CAASH,EAAe,EAEhF,OAAAI,eAAAA,CAAU,IAAM,CACd,IAAMC,CAAAA,CAAM,OAAO,UAAA,CAAWN,CAAK,CAAA,CACnCG,CAAAA,CAAwBG,CAAAA,CAAI,OAAO,EAEnC,IAAMC,CAAAA,CAAWC,CAAAA,EAAqC,CACpDL,CAAAA,CAAwBK,CAAAA,CAAM,OAAO,EACvC,CAAA,CAEA,OAAAF,CAAAA,CAAI,gBAAA,CAAiB,QAAA,CAAUC,CAAO,CAAA,CAC/B,IAAMD,CAAAA,CAAI,mBAAA,CAAoB,QAAA,CAAUC,CAAO,CACxD,CAAA,CAAG,EAAE,CAAA,CAEER,CACT,CCM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* Class Name Utility\n * Merges Tailwind CSS classes with conflict resolution\n *\n * Combines clsx for conditional classes and tailwind-merge for deduplication\n *\n * @example\n * cn('px-2 py-1', 'px-4') // => 'py-1 px-4' (px-4 overrides px-2)\n * cn('text-red-500', condition && 'text-blue-500') // => conditional application\n */\n\nimport { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","/**\n * Determines whether a component should animate.\n *\n * Returns `false` if:\n * - The `animated` prop is explicitly `false`\n * - The user prefers reduced motion\n *\n * @param animated - The component's `animated` prop value (default: `true`)\n * @param prefersReducedMotion - Whether the user prefers reduced motion\n */\nexport function shouldAnimate(\n animated: boolean | undefined,\n prefersReducedMotion: boolean,\n): boolean {\n if (animated === false) return false;\n if (prefersReducedMotion) return false;\n return true;\n}\n","'use client';\n\nimport { useState, useEffect } from 'react';\n\nconst QUERY = '(prefers-reduced-motion: reduce)';\n\nfunction getInitialState(): boolean {\n if (typeof window === 'undefined') return false;\n return window.matchMedia(QUERY).matches;\n}\n\n/**\n * Detects whether the user prefers reduced motion.\n *\n * - SSR-safe (returns `false` on the server)\n * - Reacts to changes in the OS preference\n * - Cleans up the listener on unmount\n */\nexport function useReducedMotion(): boolean {\n const [prefersReducedMotion, setPrefersReducedMotion] = useState(getInitialState);\n\n useEffect(() => {\n const mql = window.matchMedia(QUERY);\n setPrefersReducedMotion(mql.matches);\n\n const handler = (event: MediaQueryListEvent): void => {\n setPrefersReducedMotion(event.matches);\n };\n\n mql.addEventListener('change', handler);\n return () => mql.removeEventListener('change', handler);\n }, []);\n\n return prefersReducedMotion;\n}\n","'use client';\n\n/**\n * Tabs Component - Implementation\n *\n * Accessible tabbed interface component combining React Aria primitives with ShadCN styling.\n * Follows Themis library patterns with compound component structure and direct named exports.\n *\n * Key Features:\n * - React Aria Tabs for full accessibility (WCAG 2.2 AAA)\n * - CVA variants for orientation styling\n * - React 19.2 Activity API for state preservation (preserveState prop)\n * - Dual keyboard activation modes (automatic/manual)\n * - Support for icons, badges, and link-based tabs\n *\n * @see tabs-prd.md (Full requirements)\n * @see Tabs.types.ts (Zod schemas)\n * @see plan.md (Implementation approach)\n */\n\n// React 19.2 Activity API - may not be available in all builds\n// Import conditionally to support environments where Activity is unavailable\nimport {\n Activity as ReactActivity,\n Children,\n createContext,\n isValidElement,\n useContext,\n useEffect,\n useRef,\n useState,\n type ReactNode,\n type Key,\n type ReactElement,\n} from 'react';\nimport { Check, ChevronRight } from 'lucide-react';\n\n// Activity component with fallback for environments where it's not available\n// The fallback simply renders children directly - no state preservation when Activity unavailable\n// Note: ActivityFallback doesn't actually preserve state; it's just a pass-through\nconst Activity = ReactActivity ?? function ActivityFallback({\n children,\n mode,\n}: {\n children: ReactNode;\n mode: 'visible' | 'hidden';\n}): ReactElement {\n // When Activity is not available, just render children directly\n // mode is ignored in the fallback\n return <div data-activity-mode={mode}>{children}</div>;\n};\nimport {\n Tabs as AriaTabs,\n TabList as AriaTabList,\n Tab as AriaTab,\n TabPanel as AriaTabPanel,\n composeRenderProps,\n type Key as AriaKey,\n} from 'react-aria-components';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { shouldAnimate } from '../../utils/shouldAnimate';\nimport { useReducedMotion } from '../../hooks/useReducedMotion';\nimport type {\n TabsProps,\n TabsVariant,\n TabsOrientation,\n TabsVisualSize,\n StepperSeparator,\n TabListProps,\n TabProps,\n TabPanelProps,\n} from './Tabs.types';\n\n// ---------------------------------------------------------------------------\n// Motion lazy-loader — avoids hard dep on optional peer\n// ---------------------------------------------------------------------------\n\ntype MotionSpanComponent = React.ComponentType<{\n layoutId?: string;\n className?: string;\n transition?: Record<string, unknown>;\n style?: React.CSSProperties;\n}>;\n\nlet cachedMotionSpan: MotionSpanComponent | null | undefined; // undefined = pending, null = unavailable\n\nfunction loadMotionSpan(): Promise<MotionSpanComponent | null> {\n if (cachedMotionSpan !== undefined) return Promise.resolve(cachedMotionSpan);\n\n return import('motion/react')\n .then((m) => {\n cachedMotionSpan = m.motion.span as unknown as MotionSpanComponent;\n return cachedMotionSpan;\n })\n .catch(() => {\n cachedMotionSpan = null;\n return null;\n });\n}\n\n// ============================================================================\n// Internal Context\n// ============================================================================\n\ninterface TabsContextValue {\n variant: TabsVariant;\n orientation: TabsOrientation;\n /** For stepper variant: tracked selected key from Tabs root */\n stepperSelectedKey?: Key;\n /** Whether the indicator should animate. Default: true */\n animated: boolean;\n /** Stepper separator style. Only applies to horizontal stepper variant. */\n separator: StepperSeparator;\n /** Visual size for Layer 2 (currently consumed only by pill variant) */\n visualSize: TabsVisualSize;\n}\n\nconst TabsInternalContext = createContext<TabsContextValue>({\n variant: 'default',\n orientation: 'horizontal',\n animated: true,\n separator: 'line',\n visualSize: 'sm',\n});\n\n/**\n * Stepper context for tracking tab order.\n * Only used when variant=\"stepper\" to determine completed/active/inactive states.\n */\ninterface StepperContextValue {\n tabKeys: Key[];\n}\n\nconst StepperContext = createContext<StepperContextValue>({\n tabKeys: [],\n});\n\n// ============================================================================\n// CVA Variants\n// ============================================================================\n\n/**\n * TabList CVA variants\n *\n * @see PRD.md FR-002 (TabList Requirements)\n * @see PRD.md DS-001 (Design System - Layout)\n */\nexport const tabListVariants = cva(\n // Base styles\n [\n 'inline-flex items-center text-[var(--menu-muted)]',\n ],\n {\n variants: {\n variant: {\n default: 'border-b border-[var(--border)] bg-transparent rounded-none p-0 gap-0',\n block: 'justify-center rounded-md p-1 bg-[var(--accent-background)]',\n pill: 'gap-2 bg-transparent rounded-none p-0 border-none',\n stepper: 'flex items-center justify-center gap-0 border-none bg-[var(--content-background)] p-2 rounded-none',\n },\n orientation: {\n horizontal: 'flex-row',\n vertical: 'h-auto flex-col w-full',\n },\n // Only the block bar consumes this — its height tracks the visible tab\n // size (Layer 2) while the 44×44px touch targets (Layer 1) overflow it.\n visualSize: {\n sm: '',\n default: '',\n lg: '',\n },\n },\n compoundVariants: [\n { variant: 'block', orientation: 'horizontal', class: 'gap-0' },\n { variant: 'block', orientation: 'horizontal', visualSize: 'sm', class: 'h-9' },\n { variant: 'block', orientation: 'horizontal', visualSize: 'default', class: 'h-11' },\n { variant: 'block', orientation: 'horizontal', visualSize: 'lg', class: 'h-[52px]' },\n { variant: 'block', orientation: 'vertical', class: 'gap-1' },\n { variant: 'default', orientation: 'vertical', class: 'border-b-0 border-l' },\n // Stepper vertical: keep flex-col from orientation base, just add gap\n { variant: 'stepper', orientation: 'vertical', class: 'gap-1' },\n ],\n defaultVariants: {\n variant: 'default',\n orientation: 'horizontal',\n visualSize: 'default',\n },\n }\n);\n\n/**\n * Tab CVA variants\n *\n * @see PRD.md FR-003 (Tab Requirements)\n * @see PRD.md DS-002 (Design System - Tab Styling)\n * @see PRD.md AR-001 (Accessibility - 44×44px touch targets)\n */\nexport const tabVariants = cva(\n // Base styles\n [\n 'inline-flex items-center justify-center gap-2 whitespace-nowrap',\n 'px-3 py-1.5 text-sm font-medium',\n 'ring-offset-[var(--content-background)] transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2',\n 'focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2',\n // States via data attributes\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n // WCAG 2.2 AAA: 44×44px minimum touch target\n 'min-h-[44px]',\n ],\n {\n variants: {\n variant: {\n default: [\n // 16px horizontal padding (overrides the base px-3) so the first tab's\n // text aligns with surrounding 16px content insets (e.g. PageTitle).\n 'px-4',\n 'rounded-none bg-transparent',\n 'data-[selected]:text-[var(--content-foreground)]',\n 'hover:text-[var(--content-foreground)]',\n ],\n // Block is Layer 1 only — transparent 44×44px touch target. The visible\n // segmented \"card\" is an inner Layer 2 span; see tabBlockVisualVariants.\n block: [\n 'rounded-sm border-none bg-transparent p-0',\n 'hover:bg-transparent',\n ],\n // Pill is Layer 1 only — transparent 44×44px touch target.\n // The visible pill is rendered as an inner Layer 2 span; see tabPillVisualVariants.\n pill: [\n 'rounded-none border-none bg-transparent p-0',\n 'hover:bg-transparent',\n ],\n stepper: [\n 'flex items-center gap-2 rounded-none border-none bg-transparent px-3 py-2',\n ],\n },\n orientation: {\n horizontal: '',\n vertical: 'w-full justify-start',\n },\n },\n compoundVariants: [\n {\n variant: 'default',\n orientation: 'horizontal',\n class: 'relative -mb-px',\n },\n {\n variant: 'default',\n orientation: 'vertical',\n class: 'relative -ml-px',\n },\n ],\n defaultVariants: {\n variant: 'default',\n orientation: 'horizontal',\n },\n }\n);\n\n/**\n * Pill visual (Layer 2) CVA variants\n *\n * The pill variant follows the three-layer architecture:\n * - Layer 1 (AriaTab): transparent 44×44px touch target — see tabVariants pill case\n * - Layer 2 (this CVA): the visible pill, sized via `visualSize`\n * - Layer 3: children inside the visual pill\n *\n * Selected/hover/border colours are applied alongside this CVA in the Tab\n * component because they depend on render-time `isSelected` state.\n */\nexport const tabPillVisualVariants = cva(\n [\n 'inline-flex items-center justify-center gap-2 whitespace-nowrap',\n 'rounded-lg border font-medium transition-colors',\n ],\n {\n variants: {\n visualSize: {\n sm: 'h-7 px-2.5 text-xs gap-1.5',\n default: 'h-9 px-3 text-sm',\n lg: 'h-11 px-4 text-sm',\n },\n },\n defaultVariants: {\n visualSize: 'sm',\n },\n }\n);\n\n/**\n * Block visual (Layer 2) CVA variants\n *\n * The block variant follows the three-layer architecture:\n * - Layer 1 (AriaTab): transparent 44×44px touch target — see tabVariants block case\n * - Layer 2 (this CVA): the visible segmented \"card\", sized via `visualSize`\n * - Layer 3: children inside the visual card\n *\n * Selected/hover colours are applied alongside this CVA in the Tab component\n * because they depend on render-time `isSelected` state.\n */\nexport const tabBlockVisualVariants = cva(\n [\n 'inline-flex items-center justify-center gap-2 whitespace-nowrap',\n 'rounded-sm font-medium transition-colors',\n ],\n {\n variants: {\n visualSize: {\n sm: 'h-7 px-2.5 text-xs gap-1.5',\n default: 'h-9 px-3 text-sm',\n lg: 'h-11 px-4 text-sm',\n },\n },\n defaultVariants: {\n visualSize: 'default',\n },\n }\n);\n\n/**\n * TabPanel CVA variants\n *\n * @see PRD.md FR-004 (TabPanel Requirements)\n */\nexport const tabPanelVariants = cva(\n [\n 'mt-2 ring-offset-[var(--content-background)]',\n 'focus-visible:outline-none focus-visible:ring-2',\n 'focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2',\n ],\n {\n variants: {},\n defaultVariants: {},\n }\n);\n\n// ============================================================================\n// Components\n// ============================================================================\n\n/**\n * Tabs Root Component\n *\n * Container for tabbed interface. Manages selection state and provides\n * context to child components.\n *\n * @see PRD.md FR-001 (Compound Component Pattern)\n * @see PRD.md FR-012 (Controlled Mode)\n * @see PRD.md FR-013 (Uncontrolled Mode)\n *\n * @example\n * // Uncontrolled\n * <Tabs defaultSelectedKey=\"tab1\">\n * <TabList aria-label=\"Navigation\">\n * <Tab id=\"tab1\">Tab 1</Tab>\n * <Tab id=\"tab2\">Tab 2</Tab>\n * </TabList>\n * <TabPanel id=\"tab1\">Content 1</TabPanel>\n * <TabPanel id=\"tab2\">Content 2</TabPanel>\n * </Tabs>\n *\n * @example\n * // Controlled\n * <Tabs selectedKey={selected} onSelectionChange={setSelected}>\n * ...\n * </Tabs>\n */\nfunction TabsRoot({\n children,\n variant = 'default',\n selectedKey,\n defaultSelectedKey,\n onSelectionChange,\n orientation = 'horizontal',\n keyboardActivation = 'automatic',\n isDisabled = false,\n disabledKeys,\n animated: animatedProp,\n separator = 'line',\n visualSize,\n className,\n ...props\n}: TabsProps) {\n const prefersReducedMotion = useReducedMotion();\n const doAnimate = shouldAnimate(animatedProp, prefersReducedMotion);\n // For stepper variant, track the selected key internally so Tab children\n // can determine completed/active/inactive state. React Aria's internal\n // TabListStateContext is not accessible from our Tab wrapper since tabs\n // are rendered via the collection system.\n const [trackedKey, setTrackedKey] = useState<Key | undefined>(\n selectedKey ?? defaultSelectedKey\n );\n\n const handleSelectionChange = (key: Key) => {\n if (variant === 'stepper') {\n setTrackedKey(key);\n }\n onSelectionChange?.(key);\n };\n\n // For controlled mode, use the prop directly\n const stepperSelectedKey = variant === 'stepper'\n ? (selectedKey ?? trackedKey)\n : undefined;\n\n // Default visualSize: 'sm' (28px) for pill, 'default' for everything else.\n // Pill uses three-layer architecture; other variants currently ignore visualSize.\n const effectiveVisualSize: TabsVisualSize =\n visualSize ?? (variant === 'pill' ? 'sm' : 'default');\n\n return (\n <TabsInternalContext.Provider\n value={{\n variant,\n orientation,\n stepperSelectedKey,\n animated: doAnimate,\n separator,\n visualSize: effectiveVisualSize,\n }}\n >\n <AriaTabs\n selectedKey={selectedKey}\n defaultSelectedKey={defaultSelectedKey}\n onSelectionChange={handleSelectionChange as (key: Key) => void}\n orientation={orientation}\n keyboardActivation={keyboardActivation}\n isDisabled={isDisabled}\n disabledKeys={disabledKeys as Iterable<AriaKey> | undefined}\n className={cn(className)}\n {...props}\n >\n {children}\n </AriaTabs>\n </TabsInternalContext.Provider>\n );\n}\n\nTabsRoot.displayName = 'Tabs';\n\n/**\n * TabList Component\n *\n * Container for tab buttons. Uses roving tabindex for keyboard navigation.\n * Receives orientation from parent Tabs via React Aria context.\n *\n * @see PRD.md FR-002 (TabList Requirements)\n * @see PRD.md AR-001 (ARIA Requirements)\n */\nfunction TabListComponent({\n children,\n className,\n ...props\n}: TabListProps) {\n // Orientation comes from context (authoritative) rather than AriaTabList\n // render props, so the orientation-keyed CVA compounds (incl. the block bar\n // height) always match.\n const { variant, orientation, visualSize } = useContext(TabsInternalContext);\n\n // For stepper variant, collect tab keys from children to determine order\n if (variant === 'stepper') {\n // Extract keys from Tab children to determine ordering\n const tabKeys: Key[] = [];\n Children.forEach(children as ReactNode, (child) => {\n if (isValidElement(child) && child.props && typeof (child.props as Record<string, unknown>).id !== 'undefined') {\n tabKeys.push((child.props as Record<string, unknown>).id as Key);\n }\n });\n\n return (\n <StepperContext.Provider value={{ tabKeys }}>\n <AriaTabList\n className={composeRenderProps(className, (className) =>\n cn(\n tabListVariants({ variant, orientation, visualSize }),\n className\n )\n )}\n {...props}\n >\n {children}\n </AriaTabList>\n </StepperContext.Provider>\n );\n }\n\n return (\n <AriaTabList\n className={composeRenderProps(className, (className) =>\n cn(\n tabListVariants({ variant, orientation, visualSize }),\n className\n )\n )}\n {...props}\n >\n {children}\n </AriaTabList>\n );\n}\n\nTabListComponent.displayName = 'TabList';\n\n/**\n * Tab Component\n *\n * Individual tab button. Can render as button or anchor (when href provided).\n * Supports icons and badges as children.\n *\n * @see PRD.md FR-003 (Tab Requirements)\n * @see PRD.md FR-007 (Disabled States)\n * @see PRD.md FR-013 (Icon Support)\n * @see PRD.md FR-014 (Link-based Tabs)\n */\nfunction TabComponent({\n children,\n id,\n isDisabled = false,\n href,\n target,\n rel,\n download,\n completed,\n sublabel,\n className,\n ...props\n}: TabProps) {\n // Warn if icon-only tab without aria-label\n if (process.env.NODE_ENV !== 'production') {\n const hasTextContent =\n typeof children === 'string' ||\n (Array.isArray(children) &&\n children.some((child) => typeof child === 'string'));\n\n if (!hasTextContent && !props['aria-label']) {\n console.warn(\n 'Tabs: Icon-only tabs should have an aria-label for accessibility.'\n );\n }\n }\n\n // Only forward link props when this tab is actually a link. Passing\n // `href={undefined}` makes React Aria spread an empty `href=\"\"` onto the\n // tab's `<div>`, which React rejects (\"An empty string was passed to the\n // href attribute\"). Spreading an empty object for non-link tabs avoids it.\n const linkProps = href !== undefined ? { href, target, rel, download } : {};\n\n const { variant, orientation, stepperSelectedKey, animated: doAnimate, separator, visualSize } = useContext(TabsInternalContext);\n const stepperCtx = useContext(StepperContext);\n\n // Motion.dev component for animated indicator (lazy-loaded)\n const [MotionSpan, setMotionSpan] = useState<MotionSpanComponent | null>(null);\n const motionLoadedRef = useRef(false);\n\n useEffect(() => {\n // 'default' (sliding underline) and 'block' (sliding card) both animate\n // their indicator via a shared-layoutId MotionSpan.\n if ((variant !== 'default' && variant !== 'block') || !doAnimate || motionLoadedRef.current) return;\n motionLoadedRef.current = true;\n loadMotionSpan().then((component) => {\n if (component) setMotionSpan(() => component);\n });\n }, [variant, doAnimate]);\n\n // For stepper variant, render numbered circle with optional connecting line\n if (variant === 'stepper') {\n const tabIndex = stepperCtx.tabKeys.indexOf(id);\n const selectedIndex = stepperSelectedKey !== undefined\n ? stepperCtx.tabKeys.indexOf(stepperSelectedKey)\n : -1;\n const isFirst = tabIndex === 0;\n // Explicit `completed` (when provided) overrides the default index-based\n // inference, so a non-linear flow can mark a later step done while an\n // earlier one is still outstanding.\n const isCompleted = completed !== undefined\n ? completed\n : tabIndex >= 0 && selectedIndex >= 0 && tabIndex < selectedIndex;\n const isActive = tabIndex >= 0 && tabIndex === selectedIndex;\n const isVertical = orientation === 'vertical';\n\n return (\n <AriaTab\n id={id}\n isDisabled={isDisabled}\n {...linkProps}\n className={composeRenderProps(className, (className) =>\n cn(\n tabVariants({ variant, orientation }),\n className,\n )\n )}\n {...props}\n >\n {/* Separator before tab (horizontal only, except first) */}\n {!isFirst && !isVertical && (\n separator === 'chevron' ? (\n <ChevronRight\n className=\"h-4 w-4 shrink-0 text-[var(--muted-foreground)]\"\n aria-hidden=\"true\"\n />\n ) : (\n <span\n className=\"h-px w-6 bg-[var(--border)]\"\n aria-hidden=\"true\"\n />\n )\n )}\n {/* Inner wrapper for active highlight (excludes connecting line) */}\n <span\n className={cn(\n 'inline-flex items-center gap-2 rounded-lg p-2',\n isActive && 'bg-[var(--primary-action)]/10',\n )}\n >\n {/* Step circle */}\n <span\n className={cn(\n 'flex min-h-7 min-w-7 shrink-0 items-center justify-center rounded-lg px-1.5 text-xs font-bold',\n isActive\n ? 'bg-[var(--primary-action)] text-white'\n : isCompleted\n ? 'bg-[var(--primary-action)] text-white'\n : 'bg-[var(--accent-background)] text-[var(--muted-foreground)]'\n )}\n aria-hidden=\"true\"\n >\n {isCompleted ? (\n <Check className=\"h-3.5 w-3.5\" />\n ) : (\n tabIndex + 1\n )}\n </span>\n {/* Visually hidden step number for screen readers */}\n <span className=\"sr-only\">\n {isCompleted ? `Step ${tabIndex + 1}, completed:` : `Step ${tabIndex + 1}:`}\n </span>\n {/* Tab label (+ optional sublabel stacked beneath) */}\n <span className=\"flex flex-col items-start text-left\">\n <span className={cn(\n isActive && 'font-semibold text-[var(--primary-action)]',\n )}>{children}</span>\n {sublabel !== undefined && sublabel !== null && sublabel !== false && (\n <span className=\"text-xs text-[var(--muted-foreground)]\">{sublabel}</span>\n )}\n </span>\n </span>\n </AriaTab>\n );\n }\n\n // Pill variant: three-layer architecture.\n // Layer 1 (AriaTab) is a transparent 44×44px touch target; the visible pill\n // is rendered as an inner Layer 2 span sized via the `visualSize` context.\n if (variant === 'pill') {\n return (\n <AriaTab\n id={id}\n isDisabled={isDisabled}\n {...linkProps}\n className={composeRenderProps(className, (className) =>\n cn(tabVariants({ variant, orientation }), className)\n )}\n {...props}\n >\n {(renderProps) => (\n <span\n className={cn(\n tabPillVisualVariants({ visualSize }),\n renderProps.isSelected\n ? 'border-[var(--primary-action)] bg-[var(--primary-action)] text-[var(--primary-action-foreground)]'\n : 'border-[var(--border)] bg-[var(--content-background)] text-[var(--content-foreground)] hover:bg-[var(--accent-background)]',\n // Bump on selection. motion-safe: respects prefers-reduced-motion.\n renderProps.isSelected && doAnimate && 'motion-safe:selection-pulse'\n )}\n >\n {children}\n </span>\n )}\n </AriaTab>\n );\n }\n\n // Block variant: three-layer architecture (mirrors pill).\n // Layer 1 (AriaTab) is a transparent 44×44px touch target that overflows the\n // segmented bar; the visible \"card\" is an inner Layer 2 span sized via the\n // `visualSize` context. The selected card is a shared-layoutId MotionSpan that\n // slides between tabs (same mechanism as the default variant's underline).\n if (variant === 'block') {\n const blockHorizontal = orientation === 'horizontal';\n return (\n <AriaTab\n id={id}\n isDisabled={isDisabled}\n {...linkProps}\n className={composeRenderProps(className, (className) =>\n cn(tabVariants({ variant, orientation }), className)\n )}\n {...props}\n >\n {(renderProps) => (\n <span\n className={cn(\n tabBlockVisualVariants({ visualSize }),\n 'relative',\n renderProps.isSelected\n ? 'font-semibold text-[var(--content-foreground)]'\n : 'text-[var(--menu-muted)] hover:text-[var(--content-foreground)]'\n )}\n >\n {/* Sliding card indicator (behind the label) */}\n {renderProps.isSelected && (\n doAnimate && MotionSpan ? (\n <MotionSpan\n layoutId={`tab-block-indicator-${blockHorizontal ? 'h' : 'v'}`}\n className=\"absolute inset-0 rounded-sm bg-[var(--content-background)] shadow-sm\"\n transition={{ type: 'spring', stiffness: 500, damping: 30 }}\n />\n ) : (\n <span className=\"absolute inset-0 rounded-sm bg-[var(--content-background)] shadow-sm\" />\n )\n )}\n <span className=\"relative z-[1] inline-flex items-center gap-2\">{children}</span>\n </span>\n )}\n </AriaTab>\n );\n }\n\n // Default variant: render with sliding indicator\n const isHorizontal = orientation === 'horizontal';\n const indicatorClasses = isHorizontal\n ? 'absolute bottom-0 left-0 right-0 h-0.5 bg-[var(--primary-action)]'\n : 'absolute top-0 bottom-0 left-0 w-0.5 bg-[var(--primary-action)]';\n\n return (\n <AriaTab\n id={id}\n isDisabled={isDisabled}\n {...linkProps}\n className={composeRenderProps(className, (className) =>\n cn(tabVariants({ variant, orientation }), className)\n )}\n {...props}\n >\n {(renderProps) => (\n <>\n {children}\n {/* Tab indicator — animated slide or instant position */}\n {variant === 'default' && renderProps.isSelected && (\n doAnimate && MotionSpan ? (\n <MotionSpan\n layoutId={`tab-indicator-${isHorizontal ? 'h' : 'v'}`}\n className={indicatorClasses}\n transition={{ type: 'spring', stiffness: 500, damping: 30 }}\n />\n ) : (\n <span className={indicatorClasses} />\n )\n )}\n </>\n )}\n </AriaTab>\n );\n}\n\nTabComponent.displayName = 'Tab';\n\n/**\n * TabPanel Component\n *\n * Content panel associated with a tab. Only the selected panel is visible.\n * Supports preserveState for React Activity state preservation.\n *\n * @see PRD.md FR-004 (TabPanel Requirements)\n * @see PRD.md FR-015 (Force Mount Panels)\n * @see PRD.md FR-016 (React Activity State Preservation)\n *\n * @example\n * // Default behavior - content unmounts when hidden\n * <TabPanel id=\"tab1\">Content</TabPanel>\n *\n * @example\n * // Legacy force mount - keeps content in DOM\n * <TabPanel id=\"tab1\" shouldForceMount>Form with state</TabPanel>\n *\n * @example\n * // React Activity - preserves state with proper effect cleanup\n * <TabPanel id=\"tab1\" preserveState>\n * <FormWithDraft />\n * </TabPanel>\n */\nfunction TabPanelComponent({\n children,\n id,\n shouldForceMount = false,\n preserveState = false,\n className,\n ...props\n}: TabPanelProps) {\n // preserveState takes precedence - both enable force mounting\n const forceMount = preserveState || shouldForceMount;\n\n // If children is a render function (for dynamic content based on selection state),\n // we need to use the render props pattern\n if (typeof children === 'function') {\n return (\n <AriaTabPanel\n id={id}\n shouldForceMount={forceMount}\n className={composeRenderProps(className, (className) =>\n cn(tabPanelVariants(), className)\n )}\n {...props}\n >\n {(renderProps) => {\n // React Aria TabPanelRenderProps includes: state, isInert\n // We derive isSelected from state - if state is undefined, panel is selected\n const isSelected = !renderProps.isInert;\n const content = (\n children as (renderProps: { isSelected: boolean }) => ReactNode\n )({ isSelected });\n\n if (preserveState) {\n return (\n <Activity mode={isSelected ? 'visible' : 'hidden'}>\n {content}\n </Activity>\n );\n }\n\n return content;\n }}\n </AriaTabPanel>\n );\n }\n\n // For static children (not a function), render directly\n // If preserveState is enabled, wrap in Activity\n if (preserveState) {\n return (\n <AriaTabPanel\n id={id}\n shouldForceMount={forceMount}\n className={composeRenderProps(className, (className) =>\n cn(tabPanelVariants(), className)\n )}\n {...props}\n >\n {(renderProps) => {\n const isSelected = !renderProps.isInert;\n return (\n <Activity mode={isSelected ? 'visible' : 'hidden'}>\n {children}\n </Activity>\n );\n }}\n </AriaTabPanel>\n );\n }\n\n // Default: render static children directly\n return (\n <AriaTabPanel\n id={id}\n shouldForceMount={forceMount}\n className={composeRenderProps(className, (className) =>\n cn(tabPanelVariants(), className)\n )}\n {...props}\n >\n {children}\n </AriaTabPanel>\n );\n}\n\nTabPanelComponent.displayName = 'TabPanel';\n\n// ============================================================================\n// Exports\n// ============================================================================\n\n/**\n * Direct named exports (not Object.assign compound pattern)\n *\n * Tabs follows React Aria's direct export pattern because:\n * - Simpler structure (only 4 components vs Dialog's 9)\n * - Better tree-shaking with named exports\n * - Clearer imports: import { Tabs, TabList, Tab, TabPanel } from '...'\n *\n * @see plan.md \"Why Direct Named Exports (Not Object.assign)?\"\n */\nexport const Tabs = TabsRoot;\nexport const TabList = TabListComponent;\nexport const Tab = TabComponent;\nexport const TabPanel = TabPanelComponent;\n\n// Re-export types for convenience\nexport type { TabsProps, TabsVariant, TabsVisualSize, StepperSeparator, TabListProps, TabProps, TabPanelProps };\n","import { z } from 'zod';\n\n/**\n * Base props schema for all Themis components\n * Ensures consistent accessibility and styling APIs across the library\n *\n * @see spec.md FR-009 to FR-014 (Accessibility Requirements)\n * @see constitution.md Principle IV (Accessibility First - WCAG 2.2 AA minimum)\n */\nexport const BaseComponentPropsSchema = z.object({\n // Styling\n className: z.string().optional(),\n\n // React\n children: z.any().optional(), // ReactNode not directly supported by Zod\n id: z.string().optional(),\n\n // Accessibility (WCAG 2.2 AA requirements)\n 'aria-label': z.string().optional(),\n 'aria-labelledby': z.string().optional(),\n 'aria-describedby': z.string().optional(),\n 'aria-live': z.enum(['off', 'polite', 'assertive']).optional(),\n 'aria-hidden': z.boolean().optional(),\n\n // Testing & Development\n 'data-testid': z.string().optional(),\n});\n\nexport type BaseComponentProps = z.infer<typeof BaseComponentPropsSchema>;\n","import { z } from 'zod';\nimport { BaseComponentPropsSchema } from '../../schemas/BaseComponentProps';\nimport type { ReactNode, Key } from 'react';\n\n/**\n * Tab variant schema\n *\n * - 'default': Transparent background with bottom border indicator for active tab\n * - 'block': Segmented control with accent background container and card-style active tab\n * - 'pill': Independent rounded tabs with filled primary-action background when selected\n * - 'stepper': Numbered step circles with connecting lines (free navigation, not a wizard)\n */\nexport const TabsVariantSchema = z.enum(['default', 'block', 'pill', 'stepper']);\nexport type TabsVariant = z.infer<typeof TabsVariantSchema>;\n\n/**\n * Stepper separator style schema\n *\n * - 'line': Horizontal line between steps (default)\n * - 'chevron': Chevron arrow between steps\n *\n * Only applies to horizontal stepper variant.\n */\nexport const StepperSeparatorSchema = z.enum(['line', 'chevron']);\nexport type StepperSeparator = z.infer<typeof StepperSeparatorSchema>;\n\n/**\n * Visual size schema (Layer 2 of three-layer architecture)\n *\n * The outer touch target (Layer 1) always meets the 44×44px WCAG 2.2 AAA minimum;\n * `visualSize` controls the size of the visible element nested inside it.\n *\n * - 'sm': 28px tall — compact (default for pill variant)\n * - 'default': 36px tall — Button-sm equivalent\n * - 'lg': 44px tall — fills the touch target (no transparent gutter)\n *\n * Consumed by the 'pill' and 'block' variants (both three-layer); the 'default'\n * and 'stepper' variants ignore it.\n */\nexport const TabsVisualSizeSchema = z.enum(['sm', 'default', 'lg']);\nexport type TabsVisualSize = z.infer<typeof TabsVisualSizeSchema>;\n\n/**\n * Tab orientation schema\n *\n * @see PRD.md FR-005 (Orientation Support)\n */\nexport const TabsOrientationSchema = z.enum(['horizontal', 'vertical']);\nexport type TabsOrientation = z.infer<typeof TabsOrientationSchema>;\n\n/**\n * Keyboard activation mode schema\n *\n * @see PRD.md FR-006 (Keyboard Activation Modes)\n */\nexport const TabsKeyboardActivationSchema = z.enum(['automatic', 'manual']);\nexport type TabsKeyboardActivation = z.infer<typeof TabsKeyboardActivationSchema>;\n\n/**\n * Key schema for tab identification\n * Supports both string and number keys per React Aria convention\n */\nexport const KeySchema = z.union([z.string(), z.number()]);\n\n/**\n * Tabs root component props schema\n *\n * @see PRD.md FR-001 (Compound Component Pattern)\n * @see PRD.md FR-012 (Controlled Mode)\n * @see PRD.md FR-013 (Uncontrolled Mode)\n */\nexport const TabsPropsSchema = BaseComponentPropsSchema.extend({\n // Visual variant: 'default' (underline), 'block' (segmented), 'pill' (independent rounded tabs), 'stepper' (numbered steps)\n variant: TabsVariantSchema.optional().default('default'),\n\n // Controlled mode: selected tab key\n selectedKey: KeySchema.optional(),\n\n // Uncontrolled mode: default selected tab key\n defaultSelectedKey: KeySchema.optional(),\n\n // Selection change handler\n onSelectionChange: z.custom<(key: Key) => void>().optional(),\n\n // Orientation: horizontal or vertical layout\n orientation: TabsOrientationSchema.optional().default('horizontal'),\n\n // Keyboard activation: automatic (arrows select) or manual (arrows focus, Enter selects)\n keyboardActivation: TabsKeyboardActivationSchema.optional().default('automatic'),\n\n // Disable all tabs\n isDisabled: z.boolean().optional().default(false),\n\n // Keys of tabs to disable individually\n disabledKeys: z.array(KeySchema).optional(),\n\n // Children: TabList and TabPanel components\n children: z.custom<ReactNode>(),\n\n // Animation (ADR 020 - Micro-Interaction Animation System)\n // When true, the tab indicator slides between tabs (default variant only)\n animated: z.boolean().optional().default(true),\n\n // Stepper separator style: 'line' (default) or 'chevron'\n // Only applies to horizontal stepper variant\n separator: StepperSeparatorSchema.optional().default('line'),\n\n // Visual size for Layer 2 in the three-layer architecture\n // Layer 1 (touch target) always meets 44x44px WCAG AAA; this controls Layer 2.\n // Currently consumed only by the 'pill' variant.\n visualSize: TabsVisualSizeSchema.optional(),\n});\n\nexport interface TabsProps {\n className?: string;\n children?: ReactNode;\n id?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n 'aria-live'?: 'off' | 'polite' | 'assertive';\n 'aria-hidden'?: boolean;\n 'data-testid'?: string;\n variant?: TabsVariant;\n selectedKey?: string | number;\n defaultSelectedKey?: string | number;\n onSelectionChange?: (key: Key) => void;\n orientation?: TabsOrientation;\n keyboardActivation?: TabsKeyboardActivation;\n isDisabled?: boolean;\n disabledKeys?: (string | number)[];\n animated?: boolean;\n separator?: StepperSeparator;\n visualSize?: TabsVisualSize;\n}\n\n/**\n * TabList component props schema\n *\n * @see PRD.md FR-002 (TabList Requirements)\n * @see PRD.md AR-001 (ARIA Requirements)\n */\nexport const TabListPropsSchema = BaseComponentPropsSchema.extend({\n // Accessible label (required for accessibility if no aria-labelledby)\n 'aria-label': z.string().optional(),\n\n // Reference to labelling element\n 'aria-labelledby': z.string().optional(),\n\n // Children: Tab components\n children: z.custom<ReactNode>(),\n});\n\nexport interface TabListProps {\n className?: string;\n children?: ReactNode;\n id?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'data-testid'?: string;\n}\n\n/**\n * Tab component props schema\n *\n * @see PRD.md FR-003 (Tab Requirements)\n * @see PRD.md FR-007 (Disabled States)\n * @see PRD.md FR-014 (Link-based Tabs)\n */\nexport const TabPropsSchema = BaseComponentPropsSchema.extend({\n // Unique identifier for the tab (required)\n id: KeySchema,\n\n // Disable this specific tab\n isDisabled: z.boolean().optional().default(false),\n\n // Link tab: URL for navigation-style tabs\n href: z.string().optional(),\n\n // Link tab: target attribute\n target: z.string().optional(),\n\n // Link tab: rel attribute\n rel: z.string().optional(),\n\n // Link tab: download attribute\n download: z.union([z.string(), z.boolean()]).optional(),\n\n // Stepper variant only: explicit completed state. When provided, overrides the\n // default index-based inference (a step is \"completed\" if it precedes the\n // selected one). Lets a consumer mark a later step done while an earlier one\n // is still outstanding (e.g. a non-linear blueprint editor).\n completed: z.boolean().optional(),\n\n // Stepper variant only: small secondary label rendered beneath the tab label\n // (e.g. \"Current step\"). Ignored by other variants.\n sublabel: z.custom<ReactNode>().optional(),\n\n // Tab content (text, icons, badges)\n children: z.custom<ReactNode>(),\n});\n\nexport interface TabProps {\n className?: string;\n children?: ReactNode;\n id: string | number;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n 'data-testid'?: string;\n isDisabled?: boolean;\n href?: string;\n target?: string;\n rel?: string;\n download?: string | boolean;\n /** Stepper variant only: explicit completed state, overriding index-based inference. */\n completed?: boolean;\n /** Stepper variant only: small secondary label beneath the tab label (e.g. \"Current step\"). */\n sublabel?: ReactNode;\n}\n\n/**\n * TabPanel component props schema\n *\n * @see PRD.md FR-004 (TabPanel Requirements)\n * @see PRD.md FR-015 (Force Mount Panels)\n * @see PRD.md FR-016 (React Activity State Preservation)\n */\nexport const TabPanelPropsSchema = BaseComponentPropsSchema.extend({\n // Unique identifier matching a Tab id (required)\n id: KeySchema,\n\n // Legacy: Force panel to stay in DOM when hidden\n // Use preserveState instead for proper effect cleanup\n shouldForceMount: z.boolean().optional().default(false),\n\n // React 19.2 Activity: Preserve state with proper effect cleanup\n // When true, wraps content in <Activity> component\n // Effects are cleaned up when hidden, restored when visible\n preserveState: z.boolean().optional().default(false),\n\n // Panel content\n children: z.custom<ReactNode>(),\n});\n\nexport interface TabPanelProps {\n className?: string;\n children?: ReactNode;\n id: string | number;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'data-testid'?: string;\n shouldForceMount?: boolean;\n preserveState?: boolean;\n}\n\n/**\n * Scroll arrow direction for overflow handling\n *\n * @see PRD.md FR-010 (Overflow Handling)\n */\nexport const ScrollArrowDirectionSchema = z.enum(['left', 'right', 'up', 'down']);\nexport type ScrollArrowDirection = z.infer<typeof ScrollArrowDirectionSchema>;\n\n/**\n * Internal props for scroll arrow buttons\n * Used by overflow handling implementation\n */\nexport const ScrollArrowPropsSchema = BaseComponentPropsSchema.extend({\n // Scroll direction\n direction: ScrollArrowDirectionSchema,\n\n // Disable when can't scroll further\n isDisabled: z.boolean().optional().default(false),\n\n // Click handler for scrolling\n onPress: z.custom<() => void>(),\n\n // Accessible label\n 'aria-label': z.string(),\n});\n\nexport interface ScrollArrowProps {\n className?: string;\n id?: string;\n 'aria-label': string;\n 'data-testid'?: string;\n direction: ScrollArrowDirection;\n isDisabled?: boolean;\n onPress: () => void;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/cn.ts","../../../src/utils/shouldAnimate.ts","../../../src/hooks/useReducedMotion.ts","../../../src/elements/Tabs/Tabs.tsx","../../../src/schemas/BaseComponentProps.ts","../../../src/elements/Tabs/Tabs.types.ts"],"names":["cn","inputs","twMerge","clsx","shouldAnimate","animated","prefersReducedMotion","QUERY","getInitialState","useReducedMotion","setPrefersReducedMotion","useState","useEffect","mql","handler","event","Activity","ReactActivity","children","mode","jsx","cachedMotionSpan","loadMotionSpan","m","TabsInternalContext","createContext","StepperContext","tabListVariants","cva","tabVariants","tabPillVisualVariants","tabBlockVisualVariants","tabPanelVariants","TabsRoot","variant","selectedKey","defaultSelectedKey","onSelectionChange","orientation","keyboardActivation","isDisabled","disabledKeys","animatedProp","separator","visualSize","className","props","doAnimate","trackedKey","setTrackedKey","handleSelectionChange","key","stepperSelectedKey","effectiveVisualSize","AriaTabs","TabListComponent","useContext","tabKeys","Children","child","isValidElement","AriaTabList","composeRenderProps","TabComponent","id","href","target","rel","download","completed","sublabel","linkProps","stepperCtx","MotionSpan","setMotionSpan","motionLoadedRef","useRef","component","tabIndex","selectedIndex","isFirst","isCompleted","isActive","isVertical","isLast","circleStateClass","labelTextClass","jsxs","AriaTab","Check","ChevronRight","renderProps","blockHorizontal","isHorizontal","indicatorClasses","Fragment","TabPanelComponent","shouldForceMount","preserveState","forceMount","AriaTabPanel","isSelected","content","Tabs","TabList","Tab","TabPanel","BaseComponentPropsSchema","z","TabsVariantSchema","StepperSeparatorSchema","TabsVisualSizeSchema","TabsOrientationSchema","TabsKeyboardActivationSchema","KeySchema","TabsPropsSchema","TabListPropsSchema","TabPropsSchema","TabPanelPropsSchema","ScrollArrowDirectionSchema","ScrollArrowPropsSchema"],"mappings":"oTAcO,SAASA,CAAAA,CAAAA,GAAMC,CAAAA,CAA8B,CAClD,OAAOC,qBAAAA,CAAQC,SAAAA,CAAKF,CAAM,CAAC,CAC7B,CCNO,SAASG,CAAAA,CACdC,CAAAA,CACAC,CAAAA,CACS,CAET,OADI,EAAAD,CAAAA,GAAa,KAAA,EACbC,CAAAA,CAEN,CCbA,IAAMC,CAAAA,CAAQ,kCAAA,CAEd,SAASC,EAAAA,EAA2B,CAClC,OAAI,OAAO,MAAA,CAAW,GAAA,CAAoB,KAAA,CACnC,MAAA,CAAO,UAAA,CAAWD,CAAK,CAAA,CAAE,OAClC,CASO,SAASE,CAAAA,EAA4B,CAC1C,GAAM,CAACH,CAAAA,CAAsBI,CAAuB,CAAA,CAAIC,cAAAA,CAASH,EAAe,CAAA,CAEhF,OAAAI,eAAAA,CAAU,IAAM,CACd,IA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OAAQ,OAAA,CAAS,IAAA,CAAM,MAAM,CAAC,CAAA,CAOnEY,EAAAA,CAAyBb,CAAAA,CAAyB,MAAA,CAAO,CAEpE,SAAA,CAAWY,EAAAA,CAGX,UAAA,CAAYX,KAAAA,CAAE,OAAA,EAAQ,CAAE,QAAA,EAAS,CAAE,OAAA,CAAQ,KAAK,CAAA,CAGhD,OAAA,CAASA,KAAAA,CAAE,MAAA,EAAmB,CAG9B,YAAA,CAAcA,KAAAA,CAAE,MAAA,EAClB,CAAC","file":"index.js","sourcesContent":["/**\n * Class Name Utility\n * Merges Tailwind CSS classes with conflict resolution\n *\n * Combines clsx for conditional classes and tailwind-merge for deduplication\n *\n * @example\n * cn('px-2 py-1', 'px-4') // => 'py-1 px-4' (px-4 overrides px-2)\n * cn('text-red-500', condition && 'text-blue-500') // => conditional application\n */\n\nimport { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","/**\n * Determines whether a component should animate.\n *\n * Returns `false` if:\n * - The `animated` prop is explicitly `false`\n * - The user prefers reduced motion\n *\n * @param animated - The component's `animated` prop value (default: `true`)\n * @param prefersReducedMotion - Whether the user prefers reduced motion\n */\nexport function shouldAnimate(\n animated: boolean | undefined,\n prefersReducedMotion: boolean,\n): boolean {\n if (animated === false) return false;\n if (prefersReducedMotion) return false;\n return true;\n}\n","'use client';\n\nimport { useState, useEffect } from 'react';\n\nconst QUERY = '(prefers-reduced-motion: reduce)';\n\nfunction getInitialState(): boolean {\n if (typeof window === 'undefined') return false;\n return window.matchMedia(QUERY).matches;\n}\n\n/**\n * Detects whether the user prefers reduced motion.\n *\n * - SSR-safe (returns `false` on the server)\n * - Reacts to changes in the OS preference\n * - Cleans up the listener on unmount\n */\nexport function useReducedMotion(): boolean {\n const [prefersReducedMotion, setPrefersReducedMotion] = useState(getInitialState);\n\n useEffect(() => {\n const mql = window.matchMedia(QUERY);\n setPrefersReducedMotion(mql.matches);\n\n const handler = (event: MediaQueryListEvent): void => {\n setPrefersReducedMotion(event.matches);\n };\n\n mql.addEventListener('change', handler);\n return () => mql.removeEventListener('change', handler);\n }, []);\n\n return prefersReducedMotion;\n}\n","'use client';\n\n/**\n * Tabs Component - Implementation\n *\n * Accessible tabbed interface component combining React Aria primitives with ShadCN styling.\n * Follows Themis library patterns with compound component structure and direct named exports.\n *\n * Key Features:\n * - React Aria Tabs for full accessibility (WCAG 2.2 AAA)\n * - CVA variants for orientation styling\n * - React 19.2 Activity API for state preservation (preserveState prop)\n * - Dual keyboard activation modes (automatic/manual)\n * - Support for icons, badges, and link-based tabs\n *\n * @see tabs-prd.md (Full requirements)\n * @see Tabs.types.ts (Zod schemas)\n * @see plan.md (Implementation approach)\n */\n\n// React 19.2 Activity API - may not be available in all builds\n// Import conditionally to support environments where Activity is unavailable\nimport {\n Activity as ReactActivity,\n Children,\n createContext,\n isValidElement,\n useContext,\n useEffect,\n useRef,\n useState,\n type ReactNode,\n type Key,\n type ReactElement,\n} from 'react';\nimport { Check, ChevronRight } from 'lucide-react';\n\n// Activity component with fallback for environments where it's not available\n// The fallback simply renders children directly - no state preservation when Activity unavailable\n// Note: ActivityFallback doesn't actually preserve state; it's just a pass-through\nconst Activity = ReactActivity ?? function ActivityFallback({\n children,\n mode,\n}: {\n children: ReactNode;\n mode: 'visible' | 'hidden';\n}): ReactElement {\n // When Activity is not available, just render children directly\n // mode is ignored in the fallback\n return <div data-activity-mode={mode}>{children}</div>;\n};\nimport {\n Tabs as AriaTabs,\n TabList as AriaTabList,\n Tab as AriaTab,\n TabPanel as AriaTabPanel,\n composeRenderProps,\n type Key as AriaKey,\n} from 'react-aria-components';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { shouldAnimate } from '../../utils/shouldAnimate';\nimport { useReducedMotion } from '../../hooks/useReducedMotion';\nimport type {\n TabsProps,\n TabsVariant,\n TabsOrientation,\n TabsVisualSize,\n StepperSeparator,\n TabListProps,\n TabProps,\n TabPanelProps,\n} from './Tabs.types';\n\n// ---------------------------------------------------------------------------\n// Motion lazy-loader — avoids hard dep on optional peer\n// ---------------------------------------------------------------------------\n\ntype MotionSpanComponent = React.ComponentType<{\n layoutId?: string;\n className?: string;\n transition?: Record<string, unknown>;\n style?: React.CSSProperties;\n}>;\n\nlet cachedMotionSpan: MotionSpanComponent | null | undefined; // undefined = pending, null = unavailable\n\nfunction loadMotionSpan(): Promise<MotionSpanComponent | null> {\n if (cachedMotionSpan !== undefined) return Promise.resolve(cachedMotionSpan);\n\n return import('motion/react')\n .then((m) => {\n cachedMotionSpan = m.motion.span as unknown as MotionSpanComponent;\n return cachedMotionSpan;\n })\n .catch(() => {\n cachedMotionSpan = null;\n return null;\n });\n}\n\n// ============================================================================\n// Internal Context\n// ============================================================================\n\ninterface TabsContextValue {\n variant: TabsVariant;\n orientation: TabsOrientation;\n /** For stepper variant: tracked selected key from Tabs root */\n stepperSelectedKey?: Key;\n /** Whether the indicator should animate. Default: true */\n animated: boolean;\n /** Stepper separator style. Only applies to horizontal stepper variant. */\n separator: StepperSeparator;\n /** Visual size for Layer 2 (currently consumed only by pill variant) */\n visualSize: TabsVisualSize;\n}\n\nconst TabsInternalContext = createContext<TabsContextValue>({\n variant: 'default',\n orientation: 'horizontal',\n animated: true,\n separator: 'line',\n visualSize: 'sm',\n});\n\n/**\n * Stepper context for tracking tab order.\n * Only used when variant=\"stepper\" to determine completed/active/inactive states.\n */\ninterface StepperContextValue {\n tabKeys: Key[];\n}\n\nconst StepperContext = createContext<StepperContextValue>({\n tabKeys: [],\n});\n\n// ============================================================================\n// CVA Variants\n// ============================================================================\n\n/**\n * TabList CVA variants\n *\n * @see PRD.md FR-002 (TabList Requirements)\n * @see PRD.md DS-001 (Design System - Layout)\n */\nexport const tabListVariants = cva(\n // Base styles\n [\n 'inline-flex items-center text-[var(--menu-muted)]',\n ],\n {\n variants: {\n variant: {\n default: 'border-b border-[var(--border)] bg-transparent rounded-none p-0 gap-0',\n block: 'justify-center rounded-md p-1 bg-[var(--accent-background)]',\n pill: 'gap-2 bg-transparent rounded-none p-0 border-none',\n stepper: 'flex items-center justify-center gap-0 border-none bg-[var(--content-background)] p-2 rounded-none',\n },\n orientation: {\n horizontal: 'flex-row',\n vertical: 'h-auto flex-col w-full',\n },\n // Only the block bar consumes this — its height tracks the visible tab\n // size (Layer 2) while the 44×44px touch targets (Layer 1) overflow it.\n visualSize: {\n sm: '',\n default: '',\n lg: '',\n },\n },\n compoundVariants: [\n { variant: 'block', orientation: 'horizontal', class: 'gap-0' },\n { variant: 'block', orientation: 'horizontal', visualSize: 'sm', class: 'h-9' },\n { variant: 'block', orientation: 'horizontal', visualSize: 'default', class: 'h-11' },\n { variant: 'block', orientation: 'horizontal', visualSize: 'lg', class: 'h-[52px]' },\n { variant: 'block', orientation: 'vertical', class: 'gap-1' },\n { variant: 'default', orientation: 'vertical', class: 'border-b-0 border-l' },\n // Stepper vertical: keep flex-col from orientation base, just add gap\n { variant: 'stepper', orientation: 'vertical', class: 'gap-1' },\n ],\n defaultVariants: {\n variant: 'default',\n orientation: 'horizontal',\n visualSize: 'default',\n },\n }\n);\n\n/**\n * Tab CVA variants\n *\n * @see PRD.md FR-003 (Tab Requirements)\n * @see PRD.md DS-002 (Design System - Tab Styling)\n * @see PRD.md AR-001 (Accessibility - 44×44px touch targets)\n */\nexport const tabVariants = cva(\n // Base styles\n [\n 'inline-flex items-center justify-center gap-2 whitespace-nowrap',\n 'px-3 py-1.5 text-sm font-medium',\n 'ring-offset-[var(--content-background)] transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2',\n 'focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2',\n // States via data attributes\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n // WCAG 2.2 AAA: 44×44px minimum touch target\n 'min-h-[44px]',\n ],\n {\n variants: {\n variant: {\n default: [\n // 16px horizontal padding (overrides the base px-3) so the first tab's\n // text aligns with surrounding 16px content insets (e.g. PageTitle).\n 'px-4',\n 'rounded-none bg-transparent',\n 'data-[selected]:text-[var(--content-foreground)]',\n 'hover:text-[var(--content-foreground)]',\n ],\n // Block is Layer 1 only — transparent 44×44px touch target. The visible\n // segmented \"card\" is an inner Layer 2 span; see tabBlockVisualVariants.\n block: [\n 'rounded-sm border-none bg-transparent p-0',\n 'hover:bg-transparent',\n ],\n // Pill is Layer 1 only — transparent 44×44px touch target.\n // The visible pill is rendered as an inner Layer 2 span; see tabPillVisualVariants.\n pill: [\n 'rounded-none border-none bg-transparent p-0',\n 'hover:bg-transparent',\n ],\n stepper: [\n 'flex items-center gap-2 rounded-none border-none bg-transparent px-3 py-2',\n ],\n },\n orientation: {\n horizontal: '',\n vertical: 'w-full justify-start',\n },\n },\n compoundVariants: [\n {\n variant: 'default',\n orientation: 'horizontal',\n class: 'relative -mb-px',\n },\n {\n variant: 'default',\n orientation: 'vertical',\n class: 'relative -ml-px',\n },\n ],\n defaultVariants: {\n variant: 'default',\n orientation: 'horizontal',\n },\n }\n);\n\n/**\n * Pill visual (Layer 2) CVA variants\n *\n * The pill variant follows the three-layer architecture:\n * - Layer 1 (AriaTab): transparent 44×44px touch target — see tabVariants pill case\n * - Layer 2 (this CVA): the visible pill, sized via `visualSize`\n * - Layer 3: children inside the visual pill\n *\n * Selected/hover/border colours are applied alongside this CVA in the Tab\n * component because they depend on render-time `isSelected` state.\n */\nexport const tabPillVisualVariants = cva(\n [\n 'inline-flex items-center justify-center gap-2 whitespace-nowrap',\n 'rounded-lg border font-medium transition-colors',\n ],\n {\n variants: {\n visualSize: {\n sm: 'h-7 px-2.5 text-xs gap-1.5',\n default: 'h-9 px-3 text-sm',\n lg: 'h-11 px-4 text-sm',\n },\n },\n defaultVariants: {\n visualSize: 'sm',\n },\n }\n);\n\n/**\n * Block visual (Layer 2) CVA variants\n *\n * The block variant follows the three-layer architecture:\n * - Layer 1 (AriaTab): transparent 44×44px touch target — see tabVariants block case\n * - Layer 2 (this CVA): the visible segmented \"card\", sized via `visualSize`\n * - Layer 3: children inside the visual card\n *\n * Selected/hover colours are applied alongside this CVA in the Tab component\n * because they depend on render-time `isSelected` state.\n */\nexport const tabBlockVisualVariants = cva(\n [\n 'inline-flex items-center justify-center gap-2 whitespace-nowrap',\n 'rounded-sm font-medium transition-colors',\n ],\n {\n variants: {\n visualSize: {\n sm: 'h-7 px-2.5 text-xs gap-1.5',\n default: 'h-9 px-3 text-sm',\n lg: 'h-11 px-4 text-sm',\n },\n },\n defaultVariants: {\n visualSize: 'default',\n },\n }\n);\n\n/**\n * TabPanel CVA variants\n *\n * @see PRD.md FR-004 (TabPanel Requirements)\n */\nexport const tabPanelVariants = cva(\n [\n 'mt-2 ring-offset-[var(--content-background)]',\n 'focus-visible:outline-none focus-visible:ring-2',\n 'focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2',\n ],\n {\n variants: {},\n defaultVariants: {},\n }\n);\n\n// ============================================================================\n// Components\n// ============================================================================\n\n/**\n * Tabs Root Component\n *\n * Container for tabbed interface. Manages selection state and provides\n * context to child components.\n *\n * @see PRD.md FR-001 (Compound Component Pattern)\n * @see PRD.md FR-012 (Controlled Mode)\n * @see PRD.md FR-013 (Uncontrolled Mode)\n *\n * @example\n * // Uncontrolled\n * <Tabs defaultSelectedKey=\"tab1\">\n * <TabList aria-label=\"Navigation\">\n * <Tab id=\"tab1\">Tab 1</Tab>\n * <Tab id=\"tab2\">Tab 2</Tab>\n * </TabList>\n * <TabPanel id=\"tab1\">Content 1</TabPanel>\n * <TabPanel id=\"tab2\">Content 2</TabPanel>\n * </Tabs>\n *\n * @example\n * // Controlled\n * <Tabs selectedKey={selected} onSelectionChange={setSelected}>\n * ...\n * </Tabs>\n */\nfunction TabsRoot({\n children,\n variant = 'default',\n selectedKey,\n defaultSelectedKey,\n onSelectionChange,\n orientation = 'horizontal',\n keyboardActivation = 'automatic',\n isDisabled = false,\n disabledKeys,\n animated: animatedProp,\n separator = 'line',\n visualSize,\n className,\n ...props\n}: TabsProps) {\n const prefersReducedMotion = useReducedMotion();\n const doAnimate = shouldAnimate(animatedProp, prefersReducedMotion);\n // For stepper variant, track the selected key internally so Tab children\n // can determine completed/active/inactive state. React Aria's internal\n // TabListStateContext is not accessible from our Tab wrapper since tabs\n // are rendered via the collection system.\n const [trackedKey, setTrackedKey] = useState<Key | undefined>(\n selectedKey ?? defaultSelectedKey\n );\n\n const handleSelectionChange = (key: Key) => {\n if (variant === 'stepper') {\n setTrackedKey(key);\n }\n onSelectionChange?.(key);\n };\n\n // For controlled mode, use the prop directly\n const stepperSelectedKey = variant === 'stepper'\n ? (selectedKey ?? trackedKey)\n : undefined;\n\n // Default visualSize: 'sm' (28px) for pill, 'default' for everything else.\n // Pill uses three-layer architecture; other variants currently ignore visualSize.\n const effectiveVisualSize: TabsVisualSize =\n visualSize ?? (variant === 'pill' ? 'sm' : 'default');\n\n return (\n <TabsInternalContext.Provider\n value={{\n variant,\n orientation,\n stepperSelectedKey,\n animated: doAnimate,\n separator,\n visualSize: effectiveVisualSize,\n }}\n >\n <AriaTabs\n selectedKey={selectedKey}\n defaultSelectedKey={defaultSelectedKey}\n onSelectionChange={handleSelectionChange as (key: Key) => void}\n orientation={orientation}\n keyboardActivation={keyboardActivation}\n isDisabled={isDisabled}\n disabledKeys={disabledKeys as Iterable<AriaKey> | undefined}\n className={cn(className)}\n {...props}\n >\n {children}\n </AriaTabs>\n </TabsInternalContext.Provider>\n );\n}\n\nTabsRoot.displayName = 'Tabs';\n\n/**\n * TabList Component\n *\n * Container for tab buttons. Uses roving tabindex for keyboard navigation.\n * Receives orientation from parent Tabs via React Aria context.\n *\n * @see PRD.md FR-002 (TabList Requirements)\n * @see PRD.md AR-001 (ARIA Requirements)\n */\nfunction TabListComponent({\n children,\n className,\n ...props\n}: TabListProps) {\n // Orientation comes from context (authoritative) rather than AriaTabList\n // render props, so the orientation-keyed CVA compounds (incl. the block bar\n // height) always match.\n const { variant, orientation, visualSize } = useContext(TabsInternalContext);\n\n // For stepper variant, collect tab keys from children to determine order\n if (variant === 'stepper') {\n // Extract keys from Tab children to determine ordering\n const tabKeys: Key[] = [];\n Children.forEach(children as ReactNode, (child) => {\n if (isValidElement(child) && child.props && typeof (child.props as Record<string, unknown>).id !== 'undefined') {\n tabKeys.push((child.props as Record<string, unknown>).id as Key);\n }\n });\n\n return (\n <StepperContext.Provider value={{ tabKeys }}>\n <AriaTabList\n className={composeRenderProps(className, (className) =>\n cn(\n tabListVariants({ variant, orientation, visualSize }),\n className\n )\n )}\n {...props}\n >\n {children}\n </AriaTabList>\n </StepperContext.Provider>\n );\n }\n\n return (\n <AriaTabList\n className={composeRenderProps(className, (className) =>\n cn(\n tabListVariants({ variant, orientation, visualSize }),\n className\n )\n )}\n {...props}\n >\n {children}\n </AriaTabList>\n );\n}\n\nTabListComponent.displayName = 'TabList';\n\n/**\n * Tab Component\n *\n * Individual tab button. Can render as button or anchor (when href provided).\n * Supports icons and badges as children.\n *\n * @see PRD.md FR-003 (Tab Requirements)\n * @see PRD.md FR-007 (Disabled States)\n * @see PRD.md FR-013 (Icon Support)\n * @see PRD.md FR-014 (Link-based Tabs)\n */\nfunction TabComponent({\n children,\n id,\n isDisabled = false,\n href,\n target,\n rel,\n download,\n completed,\n sublabel,\n className,\n ...props\n}: TabProps) {\n // Warn if icon-only tab without aria-label\n if (process.env.NODE_ENV !== 'production') {\n const hasTextContent =\n typeof children === 'string' ||\n (Array.isArray(children) &&\n children.some((child) => typeof child === 'string'));\n\n if (!hasTextContent && !props['aria-label']) {\n console.warn(\n 'Tabs: Icon-only tabs should have an aria-label for accessibility.'\n );\n }\n }\n\n // Only forward link props when this tab is actually a link. Passing\n // `href={undefined}` makes React Aria spread an empty `href=\"\"` onto the\n // tab's `<div>`, which React rejects (\"An empty string was passed to the\n // href attribute\"). Spreading an empty object for non-link tabs avoids it.\n const linkProps = href !== undefined ? { href, target, rel, download } : {};\n\n const { variant, orientation, stepperSelectedKey, animated: doAnimate, separator, visualSize } = useContext(TabsInternalContext);\n const stepperCtx = useContext(StepperContext);\n\n // Motion.dev component for animated indicator (lazy-loaded)\n const [MotionSpan, setMotionSpan] = useState<MotionSpanComponent | null>(null);\n const motionLoadedRef = useRef(false);\n\n useEffect(() => {\n // 'default' (sliding underline) and 'block' (sliding card) both animate\n // their indicator via a shared-layoutId MotionSpan.\n if ((variant !== 'default' && variant !== 'block') || !doAnimate || motionLoadedRef.current) return;\n motionLoadedRef.current = true;\n loadMotionSpan().then((component) => {\n if (component) setMotionSpan(() => component);\n });\n }, [variant, doAnimate]);\n\n // For stepper variant, render numbered circle with optional connecting line\n if (variant === 'stepper') {\n const tabIndex = stepperCtx.tabKeys.indexOf(id);\n const selectedIndex = stepperSelectedKey !== undefined\n ? stepperCtx.tabKeys.indexOf(stepperSelectedKey)\n : -1;\n const isFirst = tabIndex === 0;\n // Explicit `completed` (when provided) overrides the default index-based\n // inference, so a non-linear flow can mark a later step done while an\n // earlier one is still outstanding.\n const isCompleted = completed !== undefined\n ? completed\n : tabIndex >= 0 && selectedIndex >= 0 && tabIndex < selectedIndex;\n const isActive = tabIndex >= 0 && tabIndex === selectedIndex;\n const isVertical = orientation === 'vertical';\n\n // Vertical stepper matches the Wizard stepper look: round circles with a\n // ring on the active/completed step, a vertical connector between steps, and\n // the label/“Current step” subtitle stacked alongside. (Horizontal keeps the\n // inline numbered-pill look below.)\n if (isVertical) {\n const isLast = tabIndex >= 0 && tabIndex === stepperCtx.tabKeys.length - 1;\n const circleStateClass = isActive || isCompleted\n ? 'bg-[var(--primary)] text-[var(--primary-foreground)] ring-4 ring-[var(--primary)]/25'\n : 'border border-[var(--border)] bg-[var(--content-background)] text-[var(--menu-muted)]';\n const labelTextClass = isActive\n ? 'font-semibold text-[var(--content-foreground)]'\n : isCompleted\n ? 'font-medium text-[var(--content-foreground)]'\n : 'text-[var(--menu-muted)]';\n\n return (\n <AriaTab\n id={id}\n isDisabled={isDisabled}\n {...linkProps}\n className={composeRenderProps(className, (className) =>\n cn(tabVariants({ variant, orientation }), 'items-start gap-0 py-0', className)\n )}\n {...props}\n >\n {/* Indicator column: circle + connector to the next step */}\n <span className=\"flex shrink-0 flex-col items-center\">\n <span\n className={cn(\n 'flex h-9 w-9 shrink-0 items-center justify-center rounded-full text-sm font-semibold transition-colors',\n circleStateClass,\n )}\n aria-hidden=\"true\"\n >\n {isCompleted ? <Check className=\"h-4 w-4\" /> : tabIndex + 1}\n </span>\n {!isLast && (\n <span\n className={cn(\n 'my-0.5 h-5 w-0.5 transition-colors',\n isCompleted ? 'bg-[var(--primary)]' : 'bg-[var(--border)]'\n )}\n aria-hidden=\"true\"\n />\n )}\n </span>\n {/* Visually hidden step number for screen readers */}\n <span className=\"sr-only\">\n {isCompleted ? `Step ${tabIndex + 1}, completed:` : `Step ${tabIndex + 1}:`}\n </span>\n {/* Label (+ optional sublabel stacked beneath) */}\n <span className=\"flex min-h-9 flex-1 flex-col items-start justify-center pl-3 text-left\">\n <span className={cn('text-sm', labelTextClass)}>{children}</span>\n {sublabel !== undefined && sublabel !== null && sublabel !== false && (\n <span className=\"text-xs text-[var(--content-foreground)]\">{sublabel}</span>\n )}\n </span>\n </AriaTab>\n );\n }\n\n return (\n <AriaTab\n id={id}\n isDisabled={isDisabled}\n {...linkProps}\n className={composeRenderProps(className, (className) =>\n cn(\n tabVariants({ variant, orientation }),\n className,\n )\n )}\n {...props}\n >\n {/* Separator before tab (horizontal only, except first) */}\n {!isFirst && !isVertical && (\n separator === 'chevron' ? (\n <ChevronRight\n className=\"h-4 w-4 shrink-0 text-[var(--muted-foreground)]\"\n aria-hidden=\"true\"\n />\n ) : (\n <span\n className=\"h-px w-6 bg-[var(--border)]\"\n aria-hidden=\"true\"\n />\n )\n )}\n {/* Inner wrapper for active highlight (excludes connecting line) */}\n <span\n className={cn(\n 'inline-flex items-center gap-2 rounded-lg p-2',\n isActive && 'bg-[var(--primary-action)]/10',\n )}\n >\n {/* Step circle */}\n <span\n className={cn(\n 'flex min-h-7 min-w-7 shrink-0 items-center justify-center rounded-lg px-1.5 text-xs font-bold',\n isActive\n ? 'bg-[var(--primary-action)] text-white'\n : isCompleted\n ? 'bg-[var(--primary-action)] text-white'\n : 'bg-[var(--accent-background)] text-[var(--muted-foreground)]'\n )}\n aria-hidden=\"true\"\n >\n {isCompleted ? (\n <Check className=\"h-3.5 w-3.5\" />\n ) : (\n tabIndex + 1\n )}\n </span>\n {/* Visually hidden step number for screen readers */}\n <span className=\"sr-only\">\n {isCompleted ? `Step ${tabIndex + 1}, completed:` : `Step ${tabIndex + 1}:`}\n </span>\n {/* Tab label (+ optional sublabel stacked beneath) */}\n <span className=\"flex flex-col items-start text-left\">\n <span className={cn(\n isActive && 'font-semibold text-[var(--primary-action)]',\n )}>{children}</span>\n {sublabel !== undefined && sublabel !== null && sublabel !== false && (\n <span className=\"text-xs text-[var(--muted-foreground)]\">{sublabel}</span>\n )}\n </span>\n </span>\n </AriaTab>\n );\n }\n\n // Pill variant: three-layer architecture.\n // Layer 1 (AriaTab) is a transparent 44×44px touch target; the visible pill\n // is rendered as an inner Layer 2 span sized via the `visualSize` context.\n if (variant === 'pill') {\n return (\n <AriaTab\n id={id}\n isDisabled={isDisabled}\n {...linkProps}\n className={composeRenderProps(className, (className) =>\n cn(tabVariants({ variant, orientation }), className)\n )}\n {...props}\n >\n {(renderProps) => (\n <span\n className={cn(\n tabPillVisualVariants({ visualSize }),\n renderProps.isSelected\n ? 'border-[var(--primary-action)] bg-[var(--primary-action)] text-[var(--primary-action-foreground)]'\n : 'border-[var(--border)] bg-[var(--content-background)] text-[var(--content-foreground)] hover:bg-[var(--accent-background)]',\n // Bump on selection. motion-safe: respects prefers-reduced-motion.\n renderProps.isSelected && doAnimate && 'motion-safe:selection-pulse'\n )}\n >\n {children}\n </span>\n )}\n </AriaTab>\n );\n }\n\n // Block variant: three-layer architecture (mirrors pill).\n // Layer 1 (AriaTab) is a transparent 44×44px touch target that overflows the\n // segmented bar; the visible \"card\" is an inner Layer 2 span sized via the\n // `visualSize` context. The selected card is a shared-layoutId MotionSpan that\n // slides between tabs (same mechanism as the default variant's underline).\n if (variant === 'block') {\n const blockHorizontal = orientation === 'horizontal';\n return (\n <AriaTab\n id={id}\n isDisabled={isDisabled}\n {...linkProps}\n className={composeRenderProps(className, (className) =>\n cn(tabVariants({ variant, orientation }), className)\n )}\n {...props}\n >\n {(renderProps) => (\n <span\n className={cn(\n tabBlockVisualVariants({ visualSize }),\n 'relative',\n renderProps.isSelected\n ? 'font-semibold text-[var(--content-foreground)]'\n : 'text-[var(--menu-muted)] hover:text-[var(--content-foreground)]'\n )}\n >\n {/* Sliding card indicator (behind the label) */}\n {renderProps.isSelected && (\n doAnimate && MotionSpan ? (\n <MotionSpan\n layoutId={`tab-block-indicator-${blockHorizontal ? 'h' : 'v'}`}\n className=\"absolute inset-0 rounded-sm bg-[var(--content-background)] shadow-sm\"\n transition={{ type: 'spring', stiffness: 500, damping: 30 }}\n />\n ) : (\n <span className=\"absolute inset-0 rounded-sm bg-[var(--content-background)] shadow-sm\" />\n )\n )}\n <span className=\"relative z-[1] inline-flex items-center gap-2\">{children}</span>\n </span>\n )}\n </AriaTab>\n );\n }\n\n // Default variant: render with sliding indicator\n const isHorizontal = orientation === 'horizontal';\n const indicatorClasses = isHorizontal\n ? 'absolute bottom-0 left-0 right-0 h-0.5 bg-[var(--primary-action)]'\n : 'absolute top-0 bottom-0 left-0 w-0.5 bg-[var(--primary-action)]';\n\n return (\n <AriaTab\n id={id}\n isDisabled={isDisabled}\n {...linkProps}\n className={composeRenderProps(className, (className) =>\n cn(tabVariants({ variant, orientation }), className)\n )}\n {...props}\n >\n {(renderProps) => (\n <>\n {children}\n {/* Tab indicator — animated slide or instant position */}\n {variant === 'default' && renderProps.isSelected && (\n doAnimate && MotionSpan ? (\n <MotionSpan\n layoutId={`tab-indicator-${isHorizontal ? 'h' : 'v'}`}\n className={indicatorClasses}\n transition={{ type: 'spring', stiffness: 500, damping: 30 }}\n />\n ) : (\n <span className={indicatorClasses} />\n )\n )}\n </>\n )}\n </AriaTab>\n );\n}\n\nTabComponent.displayName = 'Tab';\n\n/**\n * TabPanel Component\n *\n * Content panel associated with a tab. Only the selected panel is visible.\n * Supports preserveState for React Activity state preservation.\n *\n * @see PRD.md FR-004 (TabPanel Requirements)\n * @see PRD.md FR-015 (Force Mount Panels)\n * @see PRD.md FR-016 (React Activity State Preservation)\n *\n * @example\n * // Default behavior - content unmounts when hidden\n * <TabPanel id=\"tab1\">Content</TabPanel>\n *\n * @example\n * // Legacy force mount - keeps content in DOM\n * <TabPanel id=\"tab1\" shouldForceMount>Form with state</TabPanel>\n *\n * @example\n * // React Activity - preserves state with proper effect cleanup\n * <TabPanel id=\"tab1\" preserveState>\n * <FormWithDraft />\n * </TabPanel>\n */\nfunction TabPanelComponent({\n children,\n id,\n shouldForceMount = false,\n preserveState = false,\n className,\n ...props\n}: TabPanelProps) {\n // preserveState takes precedence - both enable force mounting\n const forceMount = preserveState || shouldForceMount;\n\n // If children is a render function (for dynamic content based on selection state),\n // we need to use the render props pattern\n if (typeof children === 'function') {\n return (\n <AriaTabPanel\n id={id}\n shouldForceMount={forceMount}\n className={composeRenderProps(className, (className) =>\n cn(tabPanelVariants(), className)\n )}\n {...props}\n >\n {(renderProps) => {\n // React Aria TabPanelRenderProps includes: state, isInert\n // We derive isSelected from state - if state is undefined, panel is selected\n const isSelected = !renderProps.isInert;\n const content = (\n children as (renderProps: { isSelected: boolean }) => ReactNode\n )({ isSelected });\n\n if (preserveState) {\n return (\n <Activity mode={isSelected ? 'visible' : 'hidden'}>\n {content}\n </Activity>\n );\n }\n\n return content;\n }}\n </AriaTabPanel>\n );\n }\n\n // For static children (not a function), render directly\n // If preserveState is enabled, wrap in Activity\n if (preserveState) {\n return (\n <AriaTabPanel\n id={id}\n shouldForceMount={forceMount}\n className={composeRenderProps(className, (className) =>\n cn(tabPanelVariants(), className)\n )}\n {...props}\n >\n {(renderProps) => {\n const isSelected = !renderProps.isInert;\n return (\n <Activity mode={isSelected ? 'visible' : 'hidden'}>\n {children}\n </Activity>\n );\n }}\n </AriaTabPanel>\n );\n }\n\n // Default: render static children directly\n return (\n <AriaTabPanel\n id={id}\n shouldForceMount={forceMount}\n className={composeRenderProps(className, (className) =>\n cn(tabPanelVariants(), className)\n )}\n {...props}\n >\n {children}\n </AriaTabPanel>\n );\n}\n\nTabPanelComponent.displayName = 'TabPanel';\n\n// ============================================================================\n// Exports\n// ============================================================================\n\n/**\n * Direct named exports (not Object.assign compound pattern)\n *\n * Tabs follows React Aria's direct export pattern because:\n * - Simpler structure (only 4 components vs Dialog's 9)\n * - Better tree-shaking with named exports\n * - Clearer imports: import { Tabs, TabList, Tab, TabPanel } from '...'\n *\n * @see plan.md \"Why Direct Named Exports (Not Object.assign)?\"\n */\nexport const Tabs = TabsRoot;\nexport const TabList = TabListComponent;\nexport const Tab = TabComponent;\nexport const TabPanel = TabPanelComponent;\n\n// Re-export types for convenience\nexport type { TabsProps, TabsVariant, TabsVisualSize, StepperSeparator, TabListProps, TabProps, TabPanelProps };\n","import { z } from 'zod';\n\n/**\n * Base props schema for all Themis components\n * Ensures consistent accessibility and styling APIs across the library\n *\n * @see spec.md FR-009 to FR-014 (Accessibility Requirements)\n * @see constitution.md Principle IV (Accessibility First - WCAG 2.2 AA minimum)\n */\nexport const BaseComponentPropsSchema = z.object({\n // Styling\n className: z.string().optional(),\n\n // React\n children: z.any().optional(), // ReactNode not directly supported by Zod\n id: z.string().optional(),\n\n // Accessibility (WCAG 2.2 AA requirements)\n 'aria-label': z.string().optional(),\n 'aria-labelledby': z.string().optional(),\n 'aria-describedby': z.string().optional(),\n 'aria-live': z.enum(['off', 'polite', 'assertive']).optional(),\n 'aria-hidden': z.boolean().optional(),\n\n // Testing & Development\n 'data-testid': z.string().optional(),\n});\n\nexport type BaseComponentProps = z.infer<typeof BaseComponentPropsSchema>;\n","import { z } from 'zod';\nimport { BaseComponentPropsSchema } from '../../schemas/BaseComponentProps';\nimport type { ReactNode, Key } from 'react';\n\n/**\n * Tab variant schema\n *\n * - 'default': Transparent background with bottom border indicator for active tab\n * - 'block': Segmented control with accent background container and card-style active tab\n * - 'pill': Independent rounded tabs with filled primary-action background when selected\n * - 'stepper': Numbered step circles with connecting lines (free navigation, not a wizard)\n */\nexport const TabsVariantSchema = z.enum(['default', 'block', 'pill', 'stepper']);\nexport type TabsVariant = z.infer<typeof TabsVariantSchema>;\n\n/**\n * Stepper separator style schema\n *\n * - 'line': Horizontal line between steps (default)\n * - 'chevron': Chevron arrow between steps\n *\n * Only applies to horizontal stepper variant.\n */\nexport const StepperSeparatorSchema = z.enum(['line', 'chevron']);\nexport type StepperSeparator = z.infer<typeof StepperSeparatorSchema>;\n\n/**\n * Visual size schema (Layer 2 of three-layer architecture)\n *\n * The outer touch target (Layer 1) always meets the 44×44px WCAG 2.2 AAA minimum;\n * `visualSize` controls the size of the visible element nested inside it.\n *\n * - 'sm': 28px tall — compact (default for pill variant)\n * - 'default': 36px tall — Button-sm equivalent\n * - 'lg': 44px tall — fills the touch target (no transparent gutter)\n *\n * Consumed by the 'pill' and 'block' variants (both three-layer); the 'default'\n * and 'stepper' variants ignore it.\n */\nexport const TabsVisualSizeSchema = z.enum(['sm', 'default', 'lg']);\nexport type TabsVisualSize = z.infer<typeof TabsVisualSizeSchema>;\n\n/**\n * Tab orientation schema\n *\n * @see PRD.md FR-005 (Orientation Support)\n */\nexport const TabsOrientationSchema = z.enum(['horizontal', 'vertical']);\nexport type TabsOrientation = z.infer<typeof TabsOrientationSchema>;\n\n/**\n * Keyboard activation mode schema\n *\n * @see PRD.md FR-006 (Keyboard Activation Modes)\n */\nexport const TabsKeyboardActivationSchema = z.enum(['automatic', 'manual']);\nexport type TabsKeyboardActivation = z.infer<typeof TabsKeyboardActivationSchema>;\n\n/**\n * Key schema for tab identification\n * Supports both string and number keys per React Aria convention\n */\nexport const KeySchema = z.union([z.string(), z.number()]);\n\n/**\n * Tabs root component props schema\n *\n * @see PRD.md FR-001 (Compound Component Pattern)\n * @see PRD.md FR-012 (Controlled Mode)\n * @see PRD.md FR-013 (Uncontrolled Mode)\n */\nexport const TabsPropsSchema = BaseComponentPropsSchema.extend({\n // Visual variant: 'default' (underline), 'block' (segmented), 'pill' (independent rounded tabs), 'stepper' (numbered steps)\n variant: TabsVariantSchema.optional().default('default'),\n\n // Controlled mode: selected tab key\n selectedKey: KeySchema.optional(),\n\n // Uncontrolled mode: default selected tab key\n defaultSelectedKey: KeySchema.optional(),\n\n // Selection change handler\n onSelectionChange: z.custom<(key: Key) => void>().optional(),\n\n // Orientation: horizontal or vertical layout\n orientation: TabsOrientationSchema.optional().default('horizontal'),\n\n // Keyboard activation: automatic (arrows select) or manual (arrows focus, Enter selects)\n keyboardActivation: TabsKeyboardActivationSchema.optional().default('automatic'),\n\n // Disable all tabs\n isDisabled: z.boolean().optional().default(false),\n\n // Keys of tabs to disable individually\n disabledKeys: z.array(KeySchema).optional(),\n\n // Children: TabList and TabPanel components\n children: z.custom<ReactNode>(),\n\n // Animation (ADR 020 - Micro-Interaction Animation System)\n // When true, the tab indicator slides between tabs (default variant only)\n animated: z.boolean().optional().default(true),\n\n // Stepper separator style: 'line' (default) or 'chevron'\n // Only applies to horizontal stepper variant\n separator: StepperSeparatorSchema.optional().default('line'),\n\n // Visual size for Layer 2 in the three-layer architecture\n // Layer 1 (touch target) always meets 44x44px WCAG AAA; this controls Layer 2.\n // Currently consumed only by the 'pill' variant.\n visualSize: TabsVisualSizeSchema.optional(),\n});\n\nexport interface TabsProps {\n className?: string;\n children?: ReactNode;\n id?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n 'aria-live'?: 'off' | 'polite' | 'assertive';\n 'aria-hidden'?: boolean;\n 'data-testid'?: string;\n variant?: TabsVariant;\n selectedKey?: string | number;\n defaultSelectedKey?: string | number;\n onSelectionChange?: (key: Key) => void;\n orientation?: TabsOrientation;\n keyboardActivation?: TabsKeyboardActivation;\n isDisabled?: boolean;\n disabledKeys?: (string | number)[];\n animated?: boolean;\n separator?: StepperSeparator;\n visualSize?: TabsVisualSize;\n}\n\n/**\n * TabList component props schema\n *\n * @see PRD.md FR-002 (TabList Requirements)\n * @see PRD.md AR-001 (ARIA Requirements)\n */\nexport const TabListPropsSchema = BaseComponentPropsSchema.extend({\n // Accessible label (required for accessibility if no aria-labelledby)\n 'aria-label': z.string().optional(),\n\n // Reference to labelling element\n 'aria-labelledby': z.string().optional(),\n\n // Children: Tab components\n children: z.custom<ReactNode>(),\n});\n\nexport interface TabListProps {\n className?: string;\n children?: ReactNode;\n id?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'data-testid'?: string;\n}\n\n/**\n * Tab component props schema\n *\n * @see PRD.md FR-003 (Tab Requirements)\n * @see PRD.md FR-007 (Disabled States)\n * @see PRD.md FR-014 (Link-based Tabs)\n */\nexport const TabPropsSchema = BaseComponentPropsSchema.extend({\n // Unique identifier for the tab (required)\n id: KeySchema,\n\n // Disable this specific tab\n isDisabled: z.boolean().optional().default(false),\n\n // Link tab: URL for navigation-style tabs\n href: z.string().optional(),\n\n // Link tab: target attribute\n target: z.string().optional(),\n\n // Link tab: rel attribute\n rel: z.string().optional(),\n\n // Link tab: download attribute\n download: z.union([z.string(), z.boolean()]).optional(),\n\n // Stepper variant only: explicit completed state. When provided, overrides the\n // default index-based inference (a step is \"completed\" if it precedes the\n // selected one). Lets a consumer mark a later step done while an earlier one\n // is still outstanding (e.g. a non-linear blueprint editor).\n completed: z.boolean().optional(),\n\n // Stepper variant only: small secondary label rendered beneath the tab label\n // (e.g. \"Current step\"). Ignored by other variants.\n sublabel: z.custom<ReactNode>().optional(),\n\n // Tab content (text, icons, badges)\n children: z.custom<ReactNode>(),\n});\n\nexport interface TabProps {\n className?: string;\n children?: ReactNode;\n id: string | number;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n 'data-testid'?: string;\n isDisabled?: boolean;\n href?: string;\n target?: string;\n rel?: string;\n download?: string | boolean;\n /** Stepper variant only: explicit completed state, overriding index-based inference. */\n completed?: boolean;\n /** Stepper variant only: small secondary label beneath the tab label (e.g. \"Current step\"). */\n sublabel?: ReactNode;\n}\n\n/**\n * TabPanel component props schema\n *\n * @see PRD.md FR-004 (TabPanel Requirements)\n * @see PRD.md FR-015 (Force Mount Panels)\n * @see PRD.md FR-016 (React Activity State Preservation)\n */\nexport const TabPanelPropsSchema = BaseComponentPropsSchema.extend({\n // Unique identifier matching a Tab id (required)\n id: KeySchema,\n\n // Legacy: Force panel to stay in DOM when hidden\n // Use preserveState instead for proper effect cleanup\n shouldForceMount: z.boolean().optional().default(false),\n\n // React 19.2 Activity: Preserve state with proper effect cleanup\n // When true, wraps content in <Activity> component\n // Effects are cleaned up when hidden, restored when visible\n preserveState: z.boolean().optional().default(false),\n\n // Panel content\n children: z.custom<ReactNode>(),\n});\n\nexport interface TabPanelProps {\n className?: string;\n children?: ReactNode;\n id: string | number;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'data-testid'?: string;\n shouldForceMount?: boolean;\n preserveState?: boolean;\n}\n\n/**\n * Scroll arrow direction for overflow handling\n *\n * @see PRD.md FR-010 (Overflow Handling)\n */\nexport const ScrollArrowDirectionSchema = z.enum(['left', 'right', 'up', 'down']);\nexport type ScrollArrowDirection = z.infer<typeof ScrollArrowDirectionSchema>;\n\n/**\n * Internal props for scroll arrow buttons\n * Used by overflow handling implementation\n */\nexport const ScrollArrowPropsSchema = BaseComponentPropsSchema.extend({\n // Scroll direction\n direction: ScrollArrowDirectionSchema,\n\n // Disable when can't scroll further\n isDisabled: z.boolean().optional().default(false),\n\n // Click handler for scrolling\n onPress: z.custom<() => void>(),\n\n // Accessible label\n 'aria-label': z.string(),\n});\n\nexport interface ScrollArrowProps {\n className?: string;\n id?: string;\n 'aria-label': string;\n 'data-testid'?: string;\n direction: ScrollArrowDirection;\n isDisabled?: boolean;\n onPress: () => void;\n}\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {createContext,useState,useContext,Children,isValidElement,useRef,useEffect,Activity}from'react';import {ChevronRight,Check}from'lucide-react';import {Tabs,TabList,composeRenderProps,Tab,TabPanel}from'react-aria-components';import {cva}from'class-variance-authority';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {z as z$1}from'zod';function l(...t){return twMerge(clsx(t))}function q(t,n){return !(t===false||n)}var U="(prefers-reduced-motion: reduce)";function ue(){return typeof window>"u"?false:window.matchMedia(U).matches}function Y(){let[t,n]=useState(ue);return useEffect(()=>{let i=window.matchMedia(U);n(i.matches);let s=p=>{n(p.matches);};return i.addEventListener("change",s),()=>i.removeEventListener("change",s)},[]),t}var _=Activity??function({children:n,mode:i}){return jsx("div",{"data-activity-mode":i,children:n})},N;function Te(){return N!==void 0?Promise.resolve(N):import('motion/react').then(t=>(N=t.motion.span,N)).catch(()=>(N=null,null))}var $=createContext({variant:"default",orientation:"horizontal",animated:true,separator:"line",visualSize:"sm"}),X=createContext({tabKeys:[]}),B=cva(["inline-flex items-center text-[var(--menu-muted)]"],{variants:{variant:{default:"border-b border-[var(--border)] bg-transparent rounded-none p-0 gap-0",block:"justify-center rounded-md p-1 bg-[var(--accent-background)]",pill:"gap-2 bg-transparent rounded-none p-0 border-none",stepper:"flex items-center justify-center gap-0 border-none bg-[var(--content-background)] p-2 rounded-none"},orientation:{horizontal:"flex-row",vertical:"h-auto flex-col w-full"},visualSize:{sm:"",default:"",lg:""}},compoundVariants:[{variant:"block",orientation:"horizontal",class:"gap-0"},{variant:"block",orientation:"horizontal",visualSize:"sm",class:"h-9"},{variant:"block",orientation:"horizontal",visualSize:"default",class:"h-11"},{variant:"block",orientation:"horizontal",visualSize:"lg",class:"h-[52px]"},{variant:"block",orientation:"vertical",class:"gap-1"},{variant:"default",orientation:"vertical",class:"border-b-0 border-l"},{variant:"stepper",orientation:"vertical",class:"gap-1"}],defaultVariants:{variant:"default",orientation:"horizontal",visualSize:"default"}}),V=cva(["inline-flex items-center justify-center gap-2 whitespace-nowrap","px-3 py-1.5 text-sm font-medium","ring-offset-[var(--content-background)] transition-colors","focus-visible:outline-none focus-visible:ring-2","focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","min-h-[44px]"],{variants:{variant:{default:["px-4","rounded-none bg-transparent","data-[selected]:text-[var(--content-foreground)]","hover:text-[var(--content-foreground)]"],block:["rounded-sm border-none bg-transparent p-0","hover:bg-transparent"],pill:["rounded-none border-none bg-transparent p-0","hover:bg-transparent"],stepper:["flex items-center gap-2 rounded-none border-none bg-transparent px-3 py-2"]},orientation:{horizontal:"",vertical:"w-full justify-start"}},compoundVariants:[{variant:"default",orientation:"horizontal",class:"relative -mb-px"},{variant:"default",orientation:"vertical",class:"relative -ml-px"}],defaultVariants:{variant:"default",orientation:"horizontal"}}),Pe=cva(["inline-flex items-center justify-center gap-2 whitespace-nowrap","rounded-lg border font-medium transition-colors"],{variants:{visualSize:{sm:"h-7 px-2.5 text-xs gap-1.5",default:"h-9 px-3 text-sm",lg:"h-11 px-4 text-sm"}},defaultVariants:{visualSize:"sm"}}),ze=cva(["inline-flex items-center justify-center gap-2 whitespace-nowrap","rounded-sm font-medium transition-colors"],{variants:{visualSize:{sm:"h-7 px-2.5 text-xs gap-1.5",default:"h-9 px-3 text-sm",lg:"h-11 px-4 text-sm"}},defaultVariants:{visualSize:"default"}}),L=cva(["mt-2 ring-offset-[var(--content-background)]","focus-visible:outline-none focus-visible:ring-2","focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2"],{variants:{},defaultVariants:{}});function Z({children:t,variant:n="default",selectedKey:i,defaultSelectedKey:s,onSelectionChange:p,orientation:b="horizontal",keyboardActivation:d="automatic",isDisabled:r=false,disabledKeys:u,animated:v,separator:x="line",visualSize:S,className:c,...g}){let C=Y(),h=q(v,C),[D,K]=useState(i??s),R=A=>{n==="stepper"&&K(A),p?.(A);},T=n==="stepper"?i??D:void 0,E=S??(n==="pill"?"sm":"default");return jsx($.Provider,{value:{variant:n,orientation:b,stepperSelectedKey:T,animated:h,separator:x,visualSize:E},children:jsx(Tabs,{selectedKey:i,defaultSelectedKey:s,onSelectionChange:R,orientation:b,keyboardActivation:d,isDisabled:r,disabledKeys:u,className:l(c),...g,children:t})})}Z.displayName="Tabs";function ee({children:t,className:n,...i}){let{variant:s,orientation:p,visualSize:b}=useContext($);if(s==="stepper"){let d=[];return Children.forEach(t,r=>{isValidElement(r)&&r.props&&typeof r.props.id<"u"&&d.push(r.props.id);}),jsx(X.Provider,{value:{tabKeys:d},children:jsx(TabList,{className:composeRenderProps(n,r=>l(B({variant:s,orientation:p,visualSize:b}),r)),...i,children:t})})}return jsx(TabList,{className:composeRenderProps(n,d=>l(B({variant:s,orientation:p,visualSize:b}),d)),...i,children:t})}ee.displayName="TabList";function te({children:t,id:n,isDisabled:i=false,href:s,target:p,rel:b,download:d,completed:r,sublabel:u,className:v,...x}){process.env.NODE_ENV!=="production"&&!(typeof t=="string"||Array.isArray(t)&&t.some(m=>typeof m=="string"))&&!x["aria-label"]&&console.warn("Tabs: Icon-only tabs should have an aria-label for accessibility.");let S=s!==void 0?{href:s,target:p,rel:b,download:d}:{},{variant:c,orientation:g,stepperSelectedKey:C,animated:h,separator:D,visualSize:K}=useContext($),R=useContext(X),[T,E]=useState(null),A=useRef(false);if(useEffect(()=>{c!=="default"&&c!=="block"||!h||A.current||(A.current=true,Te().then(o=>{o&&E(()=>o);}));},[c,h]),c==="stepper"){let o=R.tabKeys.indexOf(n),m=C!==void 0?R.tabKeys.indexOf(C):-1,ie=o===0,I=r!==void 0?r:o>=0&&m>=0&&o<m,O=o>=0&&o===m,se=g==="vertical";return jsxs(Tab,{id:n,isDisabled:i,...S,className:composeRenderProps(v,le=>l(V({variant:c,orientation:g}),le)),...x,children:[!ie&&!se&&(D==="chevron"?jsx(ChevronRight,{className:"h-4 w-4 shrink-0 text-[var(--muted-foreground)]","aria-hidden":"true"}):jsx("span",{className:"h-px w-6 bg-[var(--border)]","aria-hidden":"true"})),jsxs("span",{className:l("inline-flex items-center gap-2 rounded-lg p-2",O&&"bg-[var(--primary-action)]/10"),children:[jsx("span",{className:l("flex min-h-7 min-w-7 shrink-0 items-center justify-center rounded-lg px-1.5 text-xs font-bold",O||I?"bg-[var(--primary-action)] text-white":"bg-[var(--accent-background)] text-[var(--muted-foreground)]"),"aria-hidden":"true",children:I?jsx(Check,{className:"h-3.5 w-3.5"}):o+1}),jsx("span",{className:"sr-only",children:I?`Step ${o+1}, completed:`:`Step ${o+1}:`}),jsxs("span",{className:"flex flex-col items-start text-left",children:[jsx("span",{className:l(O&&"font-semibold text-[var(--primary-action)]"),children:t}),u!=null&&u!==false&&jsx("span",{className:"text-xs text-[var(--muted-foreground)]",children:u})]})]})]})}if(c==="pill")return jsx(Tab,{id:n,isDisabled:i,...S,className:composeRenderProps(v,o=>l(V({variant:c,orientation:g}),o)),...x,children:o=>jsx("span",{className:l(Pe({visualSize:K}),o.isSelected?"border-[var(--primary-action)] bg-[var(--primary-action)] text-[var(--primary-action-foreground)]":"border-[var(--border)] bg-[var(--content-background)] text-[var(--content-foreground)] hover:bg-[var(--accent-background)]",o.isSelected&&h&&"motion-safe:selection-pulse"),children:t})});if(c==="block"){let o=g==="horizontal";return jsx(Tab,{id:n,isDisabled:i,...S,className:composeRenderProps(v,m=>l(V({variant:c,orientation:g}),m)),...x,children:m=>jsxs("span",{className:l(ze({visualSize:K}),"relative",m.isSelected?"font-semibold text-[var(--content-foreground)]":"text-[var(--menu-muted)] hover:text-[var(--content-foreground)]"),children:[m.isSelected&&(h&&T?jsx(T,{layoutId:`tab-block-indicator-${o?"h":"v"}`,className:"absolute inset-0 rounded-sm bg-[var(--content-background)] shadow-sm",transition:{type:"spring",stiffness:500,damping:30}}):jsx("span",{className:"absolute inset-0 rounded-sm bg-[var(--content-background)] shadow-sm"})),jsx("span",{className:"relative z-[1] inline-flex items-center gap-2",children:t})]})})}let H=g==="horizontal",Q=H?"absolute bottom-0 left-0 right-0 h-0.5 bg-[var(--primary-action)]":"absolute top-0 bottom-0 left-0 w-0.5 bg-[var(--primary-action)]";return jsx(Tab,{id:n,isDisabled:i,...S,className:composeRenderProps(v,o=>l(V({variant:c,orientation:g}),o)),...x,children:o=>jsxs(Fragment,{children:[t,c==="default"&&o.isSelected&&(h&&T?jsx(T,{layoutId:`tab-indicator-${H?"h":"v"}`,className:Q,transition:{type:"spring",stiffness:500,damping:30}}):jsx("span",{className:Q}))]})})}te.displayName="Tab";function ae({children:t,id:n,shouldForceMount:i=false,preserveState:s=false,className:p,...b}){let d=s||i;return typeof t=="function"?jsx(TabPanel,{id:n,shouldForceMount:d,className:composeRenderProps(p,r=>l(L(),r)),...b,children:r=>{let u=!r.isInert,v=t({isSelected:u});return s?jsx(_,{mode:u?"visible":"hidden",children:v}):v}}):s?jsx(TabPanel,{id:n,shouldForceMount:d,className:composeRenderProps(p,r=>l(L(),r)),...b,children:r=>{let u=!r.isInert;return jsx(_,{mode:u?"visible":"hidden",children:t})}}):jsx(TabPanel,{id:n,shouldForceMount:d,className:composeRenderProps(p,r=>l(L(),r)),...b,children:t})}ae.displayName="TabPanel";var Ae=Z,Ne=ee,we=te,Ve=ae;var P=z$1.object({className:z$1.string().optional(),children:z$1.any().optional(),id:z$1.string().optional(),"aria-label":z$1.string().optional(),"aria-labelledby":z$1.string().optional(),"aria-describedby":z$1.string().optional(),"aria-live":z$1.enum(["off","polite","assertive"]).optional(),"aria-hidden":z$1.boolean().optional(),"data-testid":z$1.string().optional()});var Ce=z$1.enum(["default","block","pill","stepper"]),Ke=z$1.enum(["line","chevron"]),Re=z$1.enum(["sm","default","lg"]),ne=z$1.enum(["horizontal","vertical"]),oe=z$1.enum(["automatic","manual"]),z=z$1.union([z$1.string(),z$1.number()]),Me=P.extend({variant:Ce.optional().default("default"),selectedKey:z.optional(),defaultSelectedKey:z.optional(),onSelectionChange:z$1.custom().optional(),orientation:ne.optional().default("horizontal"),keyboardActivation:oe.optional().default("automatic"),isDisabled:z$1.boolean().optional().default(false),disabledKeys:z$1.array(z).optional(),children:z$1.custom(),animated:z$1.boolean().optional().default(true),separator:Ke.optional().default("line"),visualSize:Re.optional()}),Le=P.extend({"aria-label":z$1.string().optional(),"aria-labelledby":z$1.string().optional(),children:z$1.custom()}),De=P.extend({id:z,isDisabled:z$1.boolean().optional().default(false),href:z$1.string().optional(),target:z$1.string().optional(),rel:z$1.string().optional(),download:z$1.union([z$1.string(),z$1.boolean()]).optional(),completed:z$1.boolean().optional(),sublabel:z$1.custom().optional(),children:z$1.custom()}),Ee=P.extend({id:z,shouldForceMount:z$1.boolean().optional().default(false),preserveState:z$1.boolean().optional().default(false),children:z$1.custom()}),re=z$1.enum(["left","right","up","down"]),Ie=P.extend({direction:re,isDisabled:z$1.boolean().optional().default(false),onPress:z$1.custom(),"aria-label":z$1.string()});export{z as KeySchema,re as ScrollArrowDirectionSchema,Ie as ScrollArrowPropsSchema,we as Tab,Ne as TabList,Le as TabListPropsSchema,Ve as TabPanel,Ee as TabPanelPropsSchema,De as TabPropsSchema,Ae as Tabs,oe as TabsKeyboardActivationSchema,ne as TabsOrientationSchema,Me as TabsPropsSchema,B as tabListVariants,L as tabPanelVariants,V as tabVariants};//# sourceMappingURL=index.mjs.map
|
|
2
|
+
import {createContext,useState,useContext,Children,isValidElement,useRef,useEffect,Activity}from'react';import {Check,ChevronRight}from'lucide-react';import {Tabs,TabList,composeRenderProps,Tab,TabPanel}from'react-aria-components';import {cva}from'class-variance-authority';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {z as z$1}from'zod';function s(...a){return twMerge(clsx(a))}function Y(a,o){return !(a===false||o)}var _="(prefers-reduced-motion: reduce)";function ge(){return typeof window>"u"?false:window.matchMedia(_).matches}function G(){let[a,o]=useState(ge);return useEffect(()=>{let i=window.matchMedia(_);o(i.matches);let l=d=>{o(d.matches);};return i.addEventListener("change",l),()=>i.removeEventListener("change",l)},[]),a}var W=Activity??function({children:o,mode:i}){return jsx("div",{"data-activity-mode":i,children:o})},R;function ze(){return R!==void 0?Promise.resolve(R):import('motion/react').then(a=>(R=a.motion.span,R)).catch(()=>(R=null,null))}var H=createContext({variant:"default",orientation:"horizontal",animated:true,separator:"line",visualSize:"sm"}),te=createContext({tabKeys:[]}),B=cva(["inline-flex items-center text-[var(--menu-muted)]"],{variants:{variant:{default:"border-b border-[var(--border)] bg-transparent rounded-none p-0 gap-0",block:"justify-center rounded-md p-1 bg-[var(--accent-background)]",pill:"gap-2 bg-transparent rounded-none p-0 border-none",stepper:"flex items-center justify-center gap-0 border-none bg-[var(--content-background)] p-2 rounded-none"},orientation:{horizontal:"flex-row",vertical:"h-auto flex-col w-full"},visualSize:{sm:"",default:"",lg:""}},compoundVariants:[{variant:"block",orientation:"horizontal",class:"gap-0"},{variant:"block",orientation:"horizontal",visualSize:"sm",class:"h-9"},{variant:"block",orientation:"horizontal",visualSize:"default",class:"h-11"},{variant:"block",orientation:"horizontal",visualSize:"lg",class:"h-[52px]"},{variant:"block",orientation:"vertical",class:"gap-1"},{variant:"default",orientation:"vertical",class:"border-b-0 border-l"},{variant:"stepper",orientation:"vertical",class:"gap-1"}],defaultVariants:{variant:"default",orientation:"horizontal",visualSize:"default"}}),z=cva(["inline-flex items-center justify-center gap-2 whitespace-nowrap","px-3 py-1.5 text-sm font-medium","ring-offset-[var(--content-background)] transition-colors","focus-visible:outline-none focus-visible:ring-2","focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","min-h-[44px]"],{variants:{variant:{default:["px-4","rounded-none bg-transparent","data-[selected]:text-[var(--content-foreground)]","hover:text-[var(--content-foreground)]"],block:["rounded-sm border-none bg-transparent p-0","hover:bg-transparent"],pill:["rounded-none border-none bg-transparent p-0","hover:bg-transparent"],stepper:["flex items-center gap-2 rounded-none border-none bg-transparent px-3 py-2"]},orientation:{horizontal:"",vertical:"w-full justify-start"}},compoundVariants:[{variant:"default",orientation:"horizontal",class:"relative -mb-px"},{variant:"default",orientation:"vertical",class:"relative -ml-px"}],defaultVariants:{variant:"default",orientation:"horizontal"}}),Ae=cva(["inline-flex items-center justify-center gap-2 whitespace-nowrap","rounded-lg border font-medium transition-colors"],{variants:{visualSize:{sm:"h-7 px-2.5 text-xs gap-1.5",default:"h-9 px-3 text-sm",lg:"h-11 px-4 text-sm"}},defaultVariants:{visualSize:"sm"}}),we=cva(["inline-flex items-center justify-center gap-2 whitespace-nowrap","rounded-sm font-medium transition-colors"],{variants:{visualSize:{sm:"h-7 px-2.5 text-xs gap-1.5",default:"h-9 px-3 text-sm",lg:"h-11 px-4 text-sm"}},defaultVariants:{visualSize:"default"}}),E=cva(["mt-2 ring-offset-[var(--content-background)]","focus-visible:outline-none focus-visible:ring-2","focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2"],{variants:{},defaultVariants:{}});function ae({children:a,variant:o="default",selectedKey:i,defaultSelectedKey:l,onSelectionChange:d,orientation:b="horizontal",keyboardActivation:u="automatic",isDisabled:r=false,disabledKeys:c,animated:m,separator:x="line",visualSize:T,className:p,...f}){let L=G(),P=Y(m,L),[I,D]=useState(i??l),V=k=>{o==="stepper"&&D(k),d?.(k);},N=o==="stepper"?i??I:void 0,O=T??(o==="pill"?"sm":"default");return jsx(H.Provider,{value:{variant:o,orientation:b,stepperSelectedKey:N,animated:P,separator:x,visualSize:O},children:jsx(Tabs,{selectedKey:i,defaultSelectedKey:l,onSelectionChange:V,orientation:b,keyboardActivation:u,isDisabled:r,disabledKeys:c,className:s(p),...f,children:a})})}ae.displayName="Tabs";function ne({children:a,className:o,...i}){let{variant:l,orientation:d,visualSize:b}=useContext(H);if(l==="stepper"){let u=[];return Children.forEach(a,r=>{isValidElement(r)&&r.props&&typeof r.props.id<"u"&&u.push(r.props.id);}),jsx(te.Provider,{value:{tabKeys:u},children:jsx(TabList,{className:composeRenderProps(o,r=>s(B({variant:l,orientation:d,visualSize:b}),r)),...i,children:a})})}return jsx(TabList,{className:composeRenderProps(o,u=>s(B({variant:l,orientation:d,visualSize:b}),u)),...i,children:a})}ne.displayName="TabList";function oe({children:a,id:o,isDisabled:i=false,href:l,target:d,rel:b,download:u,completed:r,sublabel:c,className:m,...x}){process.env.NODE_ENV!=="production"&&!(typeof a=="string"||Array.isArray(a)&&a.some(v=>typeof v=="string"))&&!x["aria-label"]&&console.warn("Tabs: Icon-only tabs should have an aria-label for accessibility.");let T=l!==void 0?{href:l,target:d,rel:b,download:u}:{},{variant:p,orientation:f,stepperSelectedKey:L,animated:P,separator:I,visualSize:D}=useContext(H),V=useContext(te),[N,O]=useState(null),k=useRef(false);if(useEffect(()=>{p!=="default"&&p!=="block"||!P||k.current||(k.current=true,ze().then(n=>{n&&O(()=>n);}));},[p,P]),p==="stepper"){let n=V.tabKeys.indexOf(o),v=L!==void 0?V.tabKeys.indexOf(L):-1,ce=n===0,h=r!==void 0?r:n>=0&&v>=0&&n<v,C=n>=0&&n===v,U=f==="vertical";if(U){let j=n>=0&&n===V.tabKeys.length-1,pe=C||h?"bg-[var(--primary)] text-[var(--primary-foreground)] ring-4 ring-[var(--primary)]/25":"border border-[var(--border)] bg-[var(--content-background)] text-[var(--menu-muted)]",de=C?"font-semibold text-[var(--content-foreground)]":h?"font-medium text-[var(--content-foreground)]":"text-[var(--menu-muted)]";return jsxs(Tab,{id:o,isDisabled:i,...T,className:composeRenderProps(m,ue=>s(z({variant:p,orientation:f}),"items-start gap-0 py-0",ue)),...x,children:[jsxs("span",{className:"flex shrink-0 flex-col items-center",children:[jsx("span",{className:s("flex h-9 w-9 shrink-0 items-center justify-center rounded-full text-sm font-semibold transition-colors",pe),"aria-hidden":"true",children:h?jsx(Check,{className:"h-4 w-4"}):n+1}),!j&&jsx("span",{className:s("my-0.5 h-5 w-0.5 transition-colors",h?"bg-[var(--primary)]":"bg-[var(--border)]"),"aria-hidden":"true"})]}),jsx("span",{className:"sr-only",children:h?`Step ${n+1}, completed:`:`Step ${n+1}:`}),jsxs("span",{className:"flex min-h-9 flex-1 flex-col items-start justify-center pl-3 text-left",children:[jsx("span",{className:s("text-sm",de),children:a}),c!=null&&c!==false&&jsx("span",{className:"text-xs text-[var(--content-foreground)]",children:c})]})]})}return jsxs(Tab,{id:o,isDisabled:i,...T,className:composeRenderProps(m,j=>s(z({variant:p,orientation:f}),j)),...x,children:[!ce&&!U&&(I==="chevron"?jsx(ChevronRight,{className:"h-4 w-4 shrink-0 text-[var(--muted-foreground)]","aria-hidden":"true"}):jsx("span",{className:"h-px w-6 bg-[var(--border)]","aria-hidden":"true"})),jsxs("span",{className:s("inline-flex items-center gap-2 rounded-lg p-2",C&&"bg-[var(--primary-action)]/10"),children:[jsx("span",{className:s("flex min-h-7 min-w-7 shrink-0 items-center justify-center rounded-lg px-1.5 text-xs font-bold",C||h?"bg-[var(--primary-action)] text-white":"bg-[var(--accent-background)] text-[var(--muted-foreground)]"),"aria-hidden":"true",children:h?jsx(Check,{className:"h-3.5 w-3.5"}):n+1}),jsx("span",{className:"sr-only",children:h?`Step ${n+1}, completed:`:`Step ${n+1}:`}),jsxs("span",{className:"flex flex-col items-start text-left",children:[jsx("span",{className:s(C&&"font-semibold text-[var(--primary-action)]"),children:a}),c!=null&&c!==false&&jsx("span",{className:"text-xs text-[var(--muted-foreground)]",children:c})]})]})]})}if(p==="pill")return jsx(Tab,{id:o,isDisabled:i,...T,className:composeRenderProps(m,n=>s(z({variant:p,orientation:f}),n)),...x,children:n=>jsx("span",{className:s(Ae({visualSize:D}),n.isSelected?"border-[var(--primary-action)] bg-[var(--primary-action)] text-[var(--primary-action-foreground)]":"border-[var(--border)] bg-[var(--content-background)] text-[var(--content-foreground)] hover:bg-[var(--accent-background)]",n.isSelected&&P&&"motion-safe:selection-pulse"),children:a})});if(p==="block"){let n=f==="horizontal";return jsx(Tab,{id:o,isDisabled:i,...T,className:composeRenderProps(m,v=>s(z({variant:p,orientation:f}),v)),...x,children:v=>jsxs("span",{className:s(we({visualSize:D}),"relative",v.isSelected?"font-semibold text-[var(--content-foreground)]":"text-[var(--menu-muted)] hover:text-[var(--content-foreground)]"),children:[v.isSelected&&(P&&N?jsx(N,{layoutId:`tab-block-indicator-${n?"h":"v"}`,className:"absolute inset-0 rounded-sm bg-[var(--content-background)] shadow-sm",transition:{type:"spring",stiffness:500,damping:30}}):jsx("span",{className:"absolute inset-0 rounded-sm bg-[var(--content-background)] shadow-sm"})),jsx("span",{className:"relative z-[1] inline-flex items-center gap-2",children:a})]})})}let Q=f==="horizontal",q=Q?"absolute bottom-0 left-0 right-0 h-0.5 bg-[var(--primary-action)]":"absolute top-0 bottom-0 left-0 w-0.5 bg-[var(--primary-action)]";return jsx(Tab,{id:o,isDisabled:i,...T,className:composeRenderProps(m,n=>s(z({variant:p,orientation:f}),n)),...x,children:n=>jsxs(Fragment,{children:[a,p==="default"&&n.isSelected&&(P&&N?jsx(N,{layoutId:`tab-indicator-${Q?"h":"v"}`,className:q,transition:{type:"spring",stiffness:500,damping:30}}):jsx("span",{className:q}))]})})}oe.displayName="Tab";function re({children:a,id:o,shouldForceMount:i=false,preserveState:l=false,className:d,...b}){let u=l||i;return typeof a=="function"?jsx(TabPanel,{id:o,shouldForceMount:u,className:composeRenderProps(d,r=>s(E(),r)),...b,children:r=>{let c=!r.isInert,m=a({isSelected:c});return l?jsx(W,{mode:c?"visible":"hidden",children:m}):m}}):l?jsx(TabPanel,{id:o,shouldForceMount:u,className:composeRenderProps(d,r=>s(E(),r)),...b,children:r=>{let c=!r.isInert;return jsx(W,{mode:c?"visible":"hidden",children:a})}}):jsx(TabPanel,{id:o,shouldForceMount:u,className:composeRenderProps(d,r=>s(E(),r)),...b,children:a})}re.displayName="TabPanel";var Ve=ae,ke=ne,Ce=oe,Ke=re;var A=z$1.object({className:z$1.string().optional(),children:z$1.any().optional(),id:z$1.string().optional(),"aria-label":z$1.string().optional(),"aria-labelledby":z$1.string().optional(),"aria-describedby":z$1.string().optional(),"aria-live":z$1.enum(["off","polite","assertive"]).optional(),"aria-hidden":z$1.boolean().optional(),"data-testid":z$1.string().optional()});var Me=z$1.enum(["default","block","pill","stepper"]),Le=z$1.enum(["line","chevron"]),De=z$1.enum(["sm","default","lg"]),ie=z$1.enum(["horizontal","vertical"]),se=z$1.enum(["automatic","manual"]),w=z$1.union([z$1.string(),z$1.number()]),Ee=A.extend({variant:Me.optional().default("default"),selectedKey:w.optional(),defaultSelectedKey:w.optional(),onSelectionChange:z$1.custom().optional(),orientation:ie.optional().default("horizontal"),keyboardActivation:se.optional().default("automatic"),isDisabled:z$1.boolean().optional().default(false),disabledKeys:z$1.array(w).optional(),children:z$1.custom(),animated:z$1.boolean().optional().default(true),separator:Le.optional().default("line"),visualSize:De.optional()}),Ie=A.extend({"aria-label":z$1.string().optional(),"aria-labelledby":z$1.string().optional(),children:z$1.custom()}),Oe=A.extend({id:w,isDisabled:z$1.boolean().optional().default(false),href:z$1.string().optional(),target:z$1.string().optional(),rel:z$1.string().optional(),download:z$1.union([z$1.string(),z$1.boolean()]).optional(),completed:z$1.boolean().optional(),sublabel:z$1.custom().optional(),children:z$1.custom()}),je=A.extend({id:w,shouldForceMount:z$1.boolean().optional().default(false),preserveState:z$1.boolean().optional().default(false),children:z$1.custom()}),le=z$1.enum(["left","right","up","down"]),Fe=A.extend({direction:le,isDisabled:z$1.boolean().optional().default(false),onPress:z$1.custom(),"aria-label":z$1.string()});export{w as KeySchema,le as ScrollArrowDirectionSchema,Fe as ScrollArrowPropsSchema,Ce as Tab,ke as TabList,Ie as TabListPropsSchema,Ke as TabPanel,je as TabPanelPropsSchema,Oe as TabPropsSchema,Ve as Tabs,se as TabsKeyboardActivationSchema,ie as TabsOrientationSchema,Ee as TabsPropsSchema,B as tabListVariants,E as tabPanelVariants,z as tabVariants};//# sourceMappingURL=index.mjs.map
|
|
3
3
|
//# sourceMappingURL=index.mjs.map
|