@purpurds/tabs 5.11.0 → 5.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/LICENSE.txt CHANGED
@@ -1,5 +1,5 @@
1
1
  Name: @purpurds/icon
2
- Version: 5.10.1
2
+ Version: 5.11.0
3
3
  License: AGPL-3.0-only
4
4
  Private: false
5
5
 
@@ -18,5 +18,5 @@ export type TabContentPropsWithChildren = ComponentPropsWithoutRef<"div"> & TabC
18
18
  export declare const TabContent: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & TabContentProps & {
19
19
  children: ReactNode;
20
20
  } & React.RefAttributes<HTMLDivElement>>;
21
- export declare const isTabContent: (child: ReactChild | ReactElement | ReactFragment | ReactPortal | string | number | boolean | null | undefined) => child is React.ReactElement<TabContentProps, string | React.JSXElementConstructor<any>>;
21
+ export declare const isTabContent: (child: ReactChild | ReactElement | ReactFragment | ReactPortal | string | number | boolean | null | undefined) => child is ReactElement<TabContentProps>;
22
22
  //# sourceMappingURL=tab-content.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tab-content.d.ts","sourceRoot":"","sources":["../src/tab-content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,wBAAwB,EAIxB,UAAU,EACV,YAAY,EACZ,aAAa,EACb,SAAS,EACT,WAAW,EACZ,MAAM,OAAO,CAAC;AAMf,MAAM,MAAM,eAAe,GAAG;IAC5B;;SAEK;IACL,IAAI,EAAE,MAAM,CAAC;IACb;;SAEK;IACL,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,wBAAwB,CAAC,KAAK,CAAC,GACvE,eAAe,GAAG;IAChB,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAKJ,eAAO,MAAM,UAAU;cANT,SAAS;wCAqBtB,CAAC;AAEF,eAAO,MAAM,YAAY,UAEnB,UAAU,GACV,YAAY,GACZ,aAAa,GACb,WAAW,GACX,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,4FAEiF,CAAC"}
1
+ {"version":3,"file":"tab-content.d.ts","sourceRoot":"","sources":["../src/tab-content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,wBAAwB,EAIxB,UAAU,EACV,YAAY,EACZ,aAAa,EACb,SAAS,EACT,WAAW,EACZ,MAAM,OAAO,CAAC;AAMf,MAAM,MAAM,eAAe,GAAG;IAC5B;;SAEK;IACL,IAAI,EAAE,MAAM,CAAC;IACb;;SAEK;IACL,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,wBAAwB,CAAC,KAAK,CAAC,GACvE,eAAe,GAAG;IAChB,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAKJ,eAAO,MAAM,UAAU;cANT,SAAS;wCAqBtB,CAAC;AAEF,eAAO,MAAM,YAAY,UAEnB,UAAU,GACV,YAAY,GACZ,aAAa,GACb,WAAW,GACX,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,KACZ,KAAK,IAAI,YAAY,CAAC,eAAe,CACwD,CAAC"}
package/dist/tabs.cjs.js CHANGED
@@ -2,7 +2,7 @@
2
2
  Copyright (c) 2018 Jed Watson.
3
3
  Licensed under the MIT License (MIT), see
4
4
  http://jedwatson.github.io/classnames
5
- */(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var c="",s=0;s<arguments.length;s++){var i=arguments[s];i&&(c=a(c,o.call(this,i)))}return c}function o(c){if(typeof c=="string"||typeof c=="number")return this&&this[c]||c;if(typeof c!="object")return"";if(Array.isArray(c))return n.apply(this,c);if(c.toString!==Object.prototype.toString&&!c.toString.toString().includes("[native code]"))return c.toString();var s="";for(var i in c)t.call(c,i)&&c[i]&&(s=a(s,this&&this[i]||i));return s}function a(c,s){return s?c?c+" "+s:c+s:c}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(ce);var Se=ce.exports;const Te=Ie(Se),Ne={"purpur-icon":"_purpur-icon_8u1lq_1","purpur-icon--xxs":"_purpur-icon--xxs_8u1lq_4","purpur-icon--xs":"_purpur-icon--xs_8u1lq_8","purpur-icon--sm":"_purpur-icon--sm_8u1lq_12","purpur-icon--md":"_purpur-icon--md_8u1lq_16","purpur-icon--lg":"_purpur-icon--lg_8u1lq_20","purpur-icon--xl":"_purpur-icon--xl_8u1lq_24"},Re={name:"chevron-left",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M16.175 3.905a.9.9 0 0 1-.08 1.27L8.36 12l7.736 6.825a.9.9 0 0 1-1.191 1.35l-8.5-7.5a.9.9 0 0 1 0-1.35l8.5-7.5a.9.9 0 0 1 1.27.08Z" clip-rule="evenodd"/></svg>',keywords:["chevron-left"],category:"utility"},Ae={name:"chevron-right",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M7.809 3.924a.9.9 0 0 0 .115 1.267L16.094 12l-8.17 6.809a.9.9 0 0 0 1.152 1.382l9-7.5a.9.9 0 0 0 0-1.382l-9-7.5a.9.9 0 0 0-1.267.115Z" clip-rule="evenodd"/></svg>',keywords:["chevron-right"],category:"utility"},Pe=Te.bind(Ne),ne="purpur-icon",Me="md",Oe=e=>e.filter(t=>Object.keys(t).length>=1).map(t=>`${t.name}="${t.value}"`).join(" "),Fe=({content:e="",title:t}={})=>{const n=[{name:"xmlns",value:"http://www.w3.org/2000/svg"},{name:"fill",value:"currentColor"},{name:"viewBox",value:"0 0 24 24"},t?{name:"role",value:"img"}:{name:"aria-hidden",value:"true"}],o=t?`<title>${t}</title>`:"";return`<svg ${Oe(n)}>${o}${e}</svg>`},De=e=>e.replace(/<(\/?)svg([^>]*)>/g,"").trim(),je=({["data-testid"]:e,svg:t,allyTitle:n,className:o="",size:a=Me,...c})=>{const s=Fe({content:De(t.svg),title:n}),i=Pe(o,ne,`${ne}--${a}`);return E.jsx("span",{"aria-label":n,className:i,"data-testid":e,dangerouslySetInnerHTML:{__html:s},...c})};function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},w.apply(this,arguments)}function N(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function Z(e,t=[]){let n=[];function o(c,s){const i=r.createContext(s),l=n.length;n=[...n,s];function u(d){const{scope:m,children:v,...f}=d,$=(m==null?void 0:m[e][l])||i,_=r.useMemo(()=>f,Object.values(f));return r.createElement($.Provider,{value:_},v)}function b(d,m){const v=(m==null?void 0:m[e][l])||i,f=r.useContext(v);if(f)return f;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${c}\``)}return u.displayName=c+"Provider",[u,b]}const a=()=>{const c=n.map(s=>r.createContext(s));return function(i){const l=(i==null?void 0:i[e])||c;return r.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return a.scopeName=e,[o,qe(a,...t)]}function qe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(c){const s=o.reduce((i,{useScope:l,scopeName:u})=>{const d=l(c)[`__scope${u}`];return{...i,...d}},{});return r.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Ve(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function se(...e){return t=>e.forEach(n=>Ve(n,t))}function V(...e){return r.useCallback(se(...e),e)}const L=r.forwardRef((e,t)=>{const{children:n,...o}=e,a=r.Children.toArray(n),c=a.find(Ue);if(c){const s=c.props.children,i=a.map(l=>l===c?r.Children.count(s)>1?r.Children.only(null):r.isValidElement(s)?s.props.children:null:l);return r.createElement(K,w({},o,{ref:t}),r.isValidElement(s)?r.cloneElement(s,void 0,i):null)}return r.createElement(K,w({},o,{ref:t}),n)});L.displayName="Slot";const K=r.forwardRef((e,t)=>{const{children:n,...o}=e;return r.isValidElement(n)?r.cloneElement(n,{...Be(o,n.props),ref:t?se(t,n.ref):n.ref}):r.Children.count(n)>1?r.Children.only(null):null});K.displayName="SlotClone";const Le=({children:e})=>r.createElement(r.Fragment,null,e);function Ue(e){return r.isValidElement(e)&&e.type===Le}function Be(e,t){const n={...t};for(const o in t){const a=e[o],c=t[o];/^on[A-Z]/.test(o)?a&&c?n[o]=(...i)=>{c(...i),a(...i)}:a&&(n[o]=a):o==="style"?n[o]={...a,...c}:o==="className"&&(n[o]=[a,c].filter(Boolean).join(" "))}return{...e,...n}}function ke(e){const t=e+"CollectionProvider",[n,o]=Z(t),[a,c]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=v=>{const{scope:f,children:$}=v,_=r.useRef(null),g=r.useRef(new Map).current;return r.createElement(a,{scope:f,itemMap:g,collectionRef:_},$)},i=e+"CollectionSlot",l=r.forwardRef((v,f)=>{const{scope:$,children:_}=v,g=c(i,$),x=V(f,g.collectionRef);return r.createElement(L,{ref:x},_)}),u=e+"CollectionItemSlot",b="data-radix-collection-item",d=r.forwardRef((v,f)=>{const{scope:$,children:_,...g}=v,x=r.useRef(null),R=V(f,x),I=c(u,$);return r.useEffect(()=>(I.itemMap.set(x,{ref:x,...g}),()=>void I.itemMap.delete(x))),r.createElement(L,{[b]:"",ref:R},_)});function m(v){const f=c(e+"CollectionConsumer",v);return r.useCallback(()=>{const _=f.collectionRef.current;if(!_)return[];const g=Array.from(_.querySelectorAll(`[${b}]`));return Array.from(f.itemMap.values()).sort((I,A)=>g.indexOf(I.ref.current)-g.indexOf(A.ref.current))},[f.collectionRef,f.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},m,o]}const W=globalThis!=null&&globalThis.document?r.useLayoutEffect:()=>{},Ge=oe.useId||(()=>{});let ze=0;function ae(e){const[t,n]=oe.useState(Ge());return W(()=>{e||n(o=>o??String(ze++))},[e]),e||(t?`radix-${t}`:"")}const Ke=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],D=Ke.reduce((e,t)=>{const n=r.forwardRef((o,a)=>{const{asChild:c,...s}=o,i=c?L:t;return r.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),r.createElement(i,w({},s,{ref:a}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function H(e){const t=r.useRef(e);return r.useEffect(()=>{t.current=e}),r.useMemo(()=>(...n)=>{var o;return(o=t.current)===null||o===void 0?void 0:o.call(t,...n)},[])}function ie({prop:e,defaultProp:t,onChange:n=()=>{}}){const[o,a]=We({defaultProp:t,onChange:n}),c=e!==void 0,s=c?e:o,i=H(n),l=r.useCallback(u=>{if(c){const d=typeof u=="function"?u(e):u;d!==e&&i(d)}else a(u)},[c,e,a,i]);return[s,l]}function We({defaultProp:e,onChange:t}){const n=r.useState(e),[o]=n,a=r.useRef(o),c=H(t);return r.useEffect(()=>{a.current!==o&&(c(o),a.current=o)},[o,a,c]),n}const Ye=r.createContext(void 0);function ue(e){const t=r.useContext(Ye);return e||t||"ltr"}const z="rovingFocusGroup.onEntryFocus",Ze={bubbles:!1,cancelable:!0},X="RovingFocusGroup",[Y,le,He]=ke(X),[Xe,de]=Z(X,[He]),[Je,Qe]=Xe(X),et=r.forwardRef((e,t)=>r.createElement(Y.Provider,{scope:e.__scopeRovingFocusGroup},r.createElement(Y.Slot,{scope:e.__scopeRovingFocusGroup},r.createElement(tt,w({},e,{ref:t}))))),tt=r.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:a=!1,dir:c,currentTabStopId:s,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:l,onEntryFocus:u,...b}=e,d=r.useRef(null),m=V(t,d),v=ue(c),[f=null,$]=ie({prop:s,defaultProp:i,onChange:l}),[_,g]=r.useState(!1),x=H(u),R=le(n),I=r.useRef(!1),[A,j]=r.useState(0);return r.useEffect(()=>{const C=d.current;if(C)return C.addEventListener(z,x),()=>C.removeEventListener(z,x)},[x]),r.createElement(Je,{scope:n,orientation:o,dir:v,loop:a,currentTabStopId:f,onItemFocus:r.useCallback(C=>$(C),[$]),onItemShiftTab:r.useCallback(()=>g(!0),[]),onFocusableItemAdd:r.useCallback(()=>j(C=>C+1),[]),onFocusableItemRemove:r.useCallback(()=>j(C=>C-1),[])},r.createElement(D.div,w({tabIndex:_||A===0?-1:0,"data-orientation":o},b,{ref:m,style:{outline:"none",...e.style},onMouseDown:N(e.onMouseDown,()=>{I.current=!0}),onFocus:N(e.onFocus,C=>{const U=!I.current;if(C.target===C.currentTarget&&U&&!_){const O=new CustomEvent(z,Ze);if(C.currentTarget.dispatchEvent(O),!O.defaultPrevented){const P=R().filter(h=>h.focusable),B=P.find(h=>h.active),k=P.find(h=>h.id===f),p=[B,k,...P].filter(Boolean).map(h=>h.ref.current);fe(p)}}I.current=!1}),onBlur:N(e.onBlur,()=>g(!1))})))}),nt="RovingFocusGroupItem",rt=r.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:a=!1,tabStopId:c,...s}=e,i=ae(),l=c||i,u=Qe(nt,n),b=u.currentTabStopId===l,d=le(n),{onFocusableItemAdd:m,onFocusableItemRemove:v}=u;return r.useEffect(()=>{if(o)return m(),()=>v()},[o,m,v]),r.createElement(Y.ItemSlot,{scope:n,id:l,focusable:o,active:a},r.createElement(D.span,w({tabIndex:b?0:-1,"data-orientation":u.orientation},s,{ref:t,onMouseDown:N(e.onMouseDown,f=>{o?u.onItemFocus(l):f.preventDefault()}),onFocus:N(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:N(e.onKeyDown,f=>{if(f.key==="Tab"&&f.shiftKey){u.onItemShiftTab();return}if(f.target!==f.currentTarget)return;const $=st(f,u.orientation,u.dir);if($!==void 0){f.preventDefault();let g=d().filter(x=>x.focusable).map(x=>x.ref.current);if($==="last")g.reverse();else if($==="prev"||$==="next"){$==="prev"&&g.reverse();const x=g.indexOf(f.currentTarget);g=u.loop?at(g,x+1):g.slice(x+1)}setTimeout(()=>fe(g))}})})))}),ot={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ct(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function st(e,t,n){const o=ct(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return ot[o]}function fe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function at(e,t){return e.map((n,o)=>e[(t+o)%e.length])}const it=et,ut=rt;function lt(e,t){return r.useReducer((n,o)=>{const a=t[n][o];return a??n},e)}const pe=e=>{const{present:t,children:n}=e,o=dt(t),a=typeof n=="function"?n({present:o.isPresent}):r.Children.only(n),c=V(o.ref,a.ref);return typeof n=="function"||o.isPresent?r.cloneElement(a,{ref:c}):null};pe.displayName="Presence";function dt(e){const[t,n]=r.useState(),o=r.useRef({}),a=r.useRef(e),c=r.useRef("none"),s=e?"mounted":"unmounted",[i,l]=lt(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return r.useEffect(()=>{const u=q(o.current);c.current=i==="mounted"?u:"none"},[i]),W(()=>{const u=o.current,b=a.current;if(b!==e){const m=c.current,v=q(u);e?l("MOUNT"):v==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(b&&m!==v?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,l]),W(()=>{if(t){const u=d=>{const v=q(o.current).includes(d.animationName);d.target===t&&v&&we.flushSync(()=>l("ANIMATION_END"))},b=d=>{d.target===t&&(c.current=q(o.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:r.useCallback(u=>{u&&(o.current=getComputedStyle(u)),n(u)},[])}}function q(e){return(e==null?void 0:e.animationName)||"none"}const be="Tabs",[ft,qt]=Z(be,[de]),$e=de(),[pt,J]=ft(be),bt=r.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:a,defaultValue:c,orientation:s="horizontal",dir:i,activationMode:l="automatic",...u}=e,b=ue(i),[d,m]=ie({prop:o,onChange:a,defaultProp:c});return r.createElement(pt,{scope:n,baseId:ae(),value:d,onValueChange:m,orientation:s,dir:b,activationMode:l},r.createElement(D.div,w({dir:b,"data-orientation":s},u,{ref:t})))}),$t="TabsList",mt=r.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...a}=e,c=J($t,n),s=$e(n);return r.createElement(it,w({asChild:!0},s,{orientation:c.orientation,dir:c.dir,loop:o}),r.createElement(D.div,w({role:"tablist","aria-orientation":c.orientation},a,{ref:t})))}),vt="TabsTrigger",_t=r.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:a=!1,...c}=e,s=J(vt,n),i=$e(n),l=me(s.baseId,o),u=ve(s.baseId,o),b=o===s.value;return r.createElement(ut,w({asChild:!0},i,{focusable:!a,active:b}),r.createElement(D.button,w({type:"button",role:"tab","aria-selected":b,"aria-controls":u,"data-state":b?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:l},c,{ref:t,onMouseDown:N(e.onMouseDown,d=>{!a&&d.button===0&&d.ctrlKey===!1?s.onValueChange(o):d.preventDefault()}),onKeyDown:N(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&s.onValueChange(o)}),onFocus:N(e.onFocus,()=>{const d=s.activationMode!=="manual";!b&&!a&&d&&s.onValueChange(o)})})))}),gt="TabsContent",ht=r.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,forceMount:a,children:c,...s}=e,i=J(gt,n),l=me(i.baseId,o),u=ve(i.baseId,o),b=o===i.value,d=r.useRef(b);return r.useEffect(()=>{const m=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(m)},[]),r.createElement(pe,{present:a||b},({present:m})=>r.createElement(D.div,w({"data-state":b?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":l,hidden:!m,id:u,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0}}),m&&c))});function me(e,t){return`${e}-trigger-${t}`}function ve(e,t){return`${e}-content-${t}`}const xt=bt,Ct=mt,Et=_t,wt=ht;function yt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _e={exports:{}};/*!
5
+ */(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var c="",s=0;s<arguments.length;s++){var i=arguments[s];i&&(c=a(c,o.call(this,i)))}return c}function o(c){if(typeof c=="string"||typeof c=="number")return this&&this[c]||c;if(typeof c!="object")return"";if(Array.isArray(c))return n.apply(this,c);if(c.toString!==Object.prototype.toString&&!c.toString.toString().includes("[native code]"))return c.toString();var s="";for(var i in c)t.call(c,i)&&c[i]&&(s=a(s,this&&this[i]||i));return s}function a(c,s){return s?c?c+" "+s:c+s:c}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(ce);var Se=ce.exports;const Te=Ie(Se),Ne={"purpur-icon":"_purpur-icon_8u1lq_1","purpur-icon--xxs":"_purpur-icon--xxs_8u1lq_4","purpur-icon--xs":"_purpur-icon--xs_8u1lq_8","purpur-icon--sm":"_purpur-icon--sm_8u1lq_12","purpur-icon--md":"_purpur-icon--md_8u1lq_16","purpur-icon--lg":"_purpur-icon--lg_8u1lq_20","purpur-icon--xl":"_purpur-icon--xl_8u1lq_24"},Re={name:"chevron-left",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M16.175 3.905a.9.9 0 0 1-.08 1.27L8.36 12l7.736 6.825a.9.9 0 0 1-1.191 1.35l-8.5-7.5a.9.9 0 0 1 0-1.35l8.5-7.5a.9.9 0 0 1 1.27.08Z" clip-rule="evenodd"/></svg>',keywords:["chevron-left"],category:"utility"},Ae={name:"chevron-right",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M7.809 3.924a.9.9 0 0 0 .115 1.267L16.094 12l-8.17 6.809a.9.9 0 0 0 1.152 1.382l9-7.5a.9.9 0 0 0 0-1.382l-9-7.5a.9.9 0 0 0-1.267.115Z" clip-rule="evenodd"/></svg>',keywords:["chevron-right"],category:"utility"},Pe=Te.bind(Ne),ne="purpur-icon",Me="md",Oe=e=>e.filter(t=>Object.keys(t).length>=1).map(t=>`${t.name}="${t.value}"`).join(" "),Fe=({content:e="",title:t}={})=>{const n=[{name:"xmlns",value:"http://www.w3.org/2000/svg"},{name:"fill",value:"currentColor"},{name:"viewBox",value:"0 0 24 24"},t?{name:"role",value:"img"}:{name:"aria-hidden",value:"true"}],o=t?`<title>${t}</title>`:"";return`<svg ${Oe(n)}>${o}${e}</svg>`},De=e=>e.replace(/<(\/?)svg([^>]*)>/g,"").trim(),je=({["data-testid"]:e,svg:t,allyTitle:n,className:o,size:a=Me,...c})=>{const s=Fe({content:De(t.svg),title:n}),i=Pe(o,ne,`${ne}--${a}`);return E.jsx("span",{"aria-label":n,className:i,"data-testid":e,dangerouslySetInnerHTML:{__html:s},...c})};function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},w.apply(this,arguments)}function N(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function Z(e,t=[]){let n=[];function o(c,s){const i=r.createContext(s),l=n.length;n=[...n,s];function u(d){const{scope:m,children:v,...f}=d,$=(m==null?void 0:m[e][l])||i,_=r.useMemo(()=>f,Object.values(f));return r.createElement($.Provider,{value:_},v)}function b(d,m){const v=(m==null?void 0:m[e][l])||i,f=r.useContext(v);if(f)return f;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${c}\``)}return u.displayName=c+"Provider",[u,b]}const a=()=>{const c=n.map(s=>r.createContext(s));return function(i){const l=(i==null?void 0:i[e])||c;return r.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return a.scopeName=e,[o,qe(a,...t)]}function qe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(c){const s=o.reduce((i,{useScope:l,scopeName:u})=>{const d=l(c)[`__scope${u}`];return{...i,...d}},{});return r.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Ve(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function se(...e){return t=>e.forEach(n=>Ve(n,t))}function V(...e){return r.useCallback(se(...e),e)}const L=r.forwardRef((e,t)=>{const{children:n,...o}=e,a=r.Children.toArray(n),c=a.find(Ue);if(c){const s=c.props.children,i=a.map(l=>l===c?r.Children.count(s)>1?r.Children.only(null):r.isValidElement(s)?s.props.children:null:l);return r.createElement(K,w({},o,{ref:t}),r.isValidElement(s)?r.cloneElement(s,void 0,i):null)}return r.createElement(K,w({},o,{ref:t}),n)});L.displayName="Slot";const K=r.forwardRef((e,t)=>{const{children:n,...o}=e;return r.isValidElement(n)?r.cloneElement(n,{...Be(o,n.props),ref:t?se(t,n.ref):n.ref}):r.Children.count(n)>1?r.Children.only(null):null});K.displayName="SlotClone";const Le=({children:e})=>r.createElement(r.Fragment,null,e);function Ue(e){return r.isValidElement(e)&&e.type===Le}function Be(e,t){const n={...t};for(const o in t){const a=e[o],c=t[o];/^on[A-Z]/.test(o)?a&&c?n[o]=(...i)=>{c(...i),a(...i)}:a&&(n[o]=a):o==="style"?n[o]={...a,...c}:o==="className"&&(n[o]=[a,c].filter(Boolean).join(" "))}return{...e,...n}}function ke(e){const t=e+"CollectionProvider",[n,o]=Z(t),[a,c]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=v=>{const{scope:f,children:$}=v,_=r.useRef(null),g=r.useRef(new Map).current;return r.createElement(a,{scope:f,itemMap:g,collectionRef:_},$)},i=e+"CollectionSlot",l=r.forwardRef((v,f)=>{const{scope:$,children:_}=v,g=c(i,$),x=V(f,g.collectionRef);return r.createElement(L,{ref:x},_)}),u=e+"CollectionItemSlot",b="data-radix-collection-item",d=r.forwardRef((v,f)=>{const{scope:$,children:_,...g}=v,x=r.useRef(null),R=V(f,x),I=c(u,$);return r.useEffect(()=>(I.itemMap.set(x,{ref:x,...g}),()=>void I.itemMap.delete(x))),r.createElement(L,{[b]:"",ref:R},_)});function m(v){const f=c(e+"CollectionConsumer",v);return r.useCallback(()=>{const _=f.collectionRef.current;if(!_)return[];const g=Array.from(_.querySelectorAll(`[${b}]`));return Array.from(f.itemMap.values()).sort((I,A)=>g.indexOf(I.ref.current)-g.indexOf(A.ref.current))},[f.collectionRef,f.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},m,o]}const W=globalThis!=null&&globalThis.document?r.useLayoutEffect:()=>{},Ge=oe.useId||(()=>{});let ze=0;function ae(e){const[t,n]=oe.useState(Ge());return W(()=>{e||n(o=>o??String(ze++))},[e]),e||(t?`radix-${t}`:"")}const Ke=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],D=Ke.reduce((e,t)=>{const n=r.forwardRef((o,a)=>{const{asChild:c,...s}=o,i=c?L:t;return r.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),r.createElement(i,w({},s,{ref:a}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function H(e){const t=r.useRef(e);return r.useEffect(()=>{t.current=e}),r.useMemo(()=>(...n)=>{var o;return(o=t.current)===null||o===void 0?void 0:o.call(t,...n)},[])}function ie({prop:e,defaultProp:t,onChange:n=()=>{}}){const[o,a]=We({defaultProp:t,onChange:n}),c=e!==void 0,s=c?e:o,i=H(n),l=r.useCallback(u=>{if(c){const d=typeof u=="function"?u(e):u;d!==e&&i(d)}else a(u)},[c,e,a,i]);return[s,l]}function We({defaultProp:e,onChange:t}){const n=r.useState(e),[o]=n,a=r.useRef(o),c=H(t);return r.useEffect(()=>{a.current!==o&&(c(o),a.current=o)},[o,a,c]),n}const Ye=r.createContext(void 0);function ue(e){const t=r.useContext(Ye);return e||t||"ltr"}const z="rovingFocusGroup.onEntryFocus",Ze={bubbles:!1,cancelable:!0},X="RovingFocusGroup",[Y,le,He]=ke(X),[Xe,de]=Z(X,[He]),[Je,Qe]=Xe(X),et=r.forwardRef((e,t)=>r.createElement(Y.Provider,{scope:e.__scopeRovingFocusGroup},r.createElement(Y.Slot,{scope:e.__scopeRovingFocusGroup},r.createElement(tt,w({},e,{ref:t}))))),tt=r.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:a=!1,dir:c,currentTabStopId:s,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:l,onEntryFocus:u,...b}=e,d=r.useRef(null),m=V(t,d),v=ue(c),[f=null,$]=ie({prop:s,defaultProp:i,onChange:l}),[_,g]=r.useState(!1),x=H(u),R=le(n),I=r.useRef(!1),[A,j]=r.useState(0);return r.useEffect(()=>{const C=d.current;if(C)return C.addEventListener(z,x),()=>C.removeEventListener(z,x)},[x]),r.createElement(Je,{scope:n,orientation:o,dir:v,loop:a,currentTabStopId:f,onItemFocus:r.useCallback(C=>$(C),[$]),onItemShiftTab:r.useCallback(()=>g(!0),[]),onFocusableItemAdd:r.useCallback(()=>j(C=>C+1),[]),onFocusableItemRemove:r.useCallback(()=>j(C=>C-1),[])},r.createElement(D.div,w({tabIndex:_||A===0?-1:0,"data-orientation":o},b,{ref:m,style:{outline:"none",...e.style},onMouseDown:N(e.onMouseDown,()=>{I.current=!0}),onFocus:N(e.onFocus,C=>{const U=!I.current;if(C.target===C.currentTarget&&U&&!_){const O=new CustomEvent(z,Ze);if(C.currentTarget.dispatchEvent(O),!O.defaultPrevented){const P=R().filter(h=>h.focusable),B=P.find(h=>h.active),k=P.find(h=>h.id===f),p=[B,k,...P].filter(Boolean).map(h=>h.ref.current);fe(p)}}I.current=!1}),onBlur:N(e.onBlur,()=>g(!1))})))}),nt="RovingFocusGroupItem",rt=r.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:a=!1,tabStopId:c,...s}=e,i=ae(),l=c||i,u=Qe(nt,n),b=u.currentTabStopId===l,d=le(n),{onFocusableItemAdd:m,onFocusableItemRemove:v}=u;return r.useEffect(()=>{if(o)return m(),()=>v()},[o,m,v]),r.createElement(Y.ItemSlot,{scope:n,id:l,focusable:o,active:a},r.createElement(D.span,w({tabIndex:b?0:-1,"data-orientation":u.orientation},s,{ref:t,onMouseDown:N(e.onMouseDown,f=>{o?u.onItemFocus(l):f.preventDefault()}),onFocus:N(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:N(e.onKeyDown,f=>{if(f.key==="Tab"&&f.shiftKey){u.onItemShiftTab();return}if(f.target!==f.currentTarget)return;const $=st(f,u.orientation,u.dir);if($!==void 0){f.preventDefault();let g=d().filter(x=>x.focusable).map(x=>x.ref.current);if($==="last")g.reverse();else if($==="prev"||$==="next"){$==="prev"&&g.reverse();const x=g.indexOf(f.currentTarget);g=u.loop?at(g,x+1):g.slice(x+1)}setTimeout(()=>fe(g))}})})))}),ot={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ct(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function st(e,t,n){const o=ct(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return ot[o]}function fe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function at(e,t){return e.map((n,o)=>e[(t+o)%e.length])}const it=et,ut=rt;function lt(e,t){return r.useReducer((n,o)=>{const a=t[n][o];return a??n},e)}const pe=e=>{const{present:t,children:n}=e,o=dt(t),a=typeof n=="function"?n({present:o.isPresent}):r.Children.only(n),c=V(o.ref,a.ref);return typeof n=="function"||o.isPresent?r.cloneElement(a,{ref:c}):null};pe.displayName="Presence";function dt(e){const[t,n]=r.useState(),o=r.useRef({}),a=r.useRef(e),c=r.useRef("none"),s=e?"mounted":"unmounted",[i,l]=lt(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return r.useEffect(()=>{const u=q(o.current);c.current=i==="mounted"?u:"none"},[i]),W(()=>{const u=o.current,b=a.current;if(b!==e){const m=c.current,v=q(u);e?l("MOUNT"):v==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(b&&m!==v?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,l]),W(()=>{if(t){const u=d=>{const v=q(o.current).includes(d.animationName);d.target===t&&v&&we.flushSync(()=>l("ANIMATION_END"))},b=d=>{d.target===t&&(c.current=q(o.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:r.useCallback(u=>{u&&(o.current=getComputedStyle(u)),n(u)},[])}}function q(e){return(e==null?void 0:e.animationName)||"none"}const be="Tabs",[ft,qt]=Z(be,[de]),$e=de(),[pt,J]=ft(be),bt=r.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:a,defaultValue:c,orientation:s="horizontal",dir:i,activationMode:l="automatic",...u}=e,b=ue(i),[d,m]=ie({prop:o,onChange:a,defaultProp:c});return r.createElement(pt,{scope:n,baseId:ae(),value:d,onValueChange:m,orientation:s,dir:b,activationMode:l},r.createElement(D.div,w({dir:b,"data-orientation":s},u,{ref:t})))}),$t="TabsList",mt=r.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...a}=e,c=J($t,n),s=$e(n);return r.createElement(it,w({asChild:!0},s,{orientation:c.orientation,dir:c.dir,loop:o}),r.createElement(D.div,w({role:"tablist","aria-orientation":c.orientation},a,{ref:t})))}),vt="TabsTrigger",_t=r.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:a=!1,...c}=e,s=J(vt,n),i=$e(n),l=me(s.baseId,o),u=ve(s.baseId,o),b=o===s.value;return r.createElement(ut,w({asChild:!0},i,{focusable:!a,active:b}),r.createElement(D.button,w({type:"button",role:"tab","aria-selected":b,"aria-controls":u,"data-state":b?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:l},c,{ref:t,onMouseDown:N(e.onMouseDown,d=>{!a&&d.button===0&&d.ctrlKey===!1?s.onValueChange(o):d.preventDefault()}),onKeyDown:N(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&s.onValueChange(o)}),onFocus:N(e.onFocus,()=>{const d=s.activationMode!=="manual";!b&&!a&&d&&s.onValueChange(o)})})))}),gt="TabsContent",ht=r.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,forceMount:a,children:c,...s}=e,i=J(gt,n),l=me(i.baseId,o),u=ve(i.baseId,o),b=o===i.value,d=r.useRef(b);return r.useEffect(()=>{const m=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(m)},[]),r.createElement(pe,{present:a||b},({present:m})=>r.createElement(D.div,w({"data-state":b?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":l,hidden:!m,id:u,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0}}),m&&c))});function me(e,t){return`${e}-trigger-${t}`}function ve(e,t){return`${e}-content-${t}`}const xt=bt,Ct=mt,Et=_t,wt=ht;function yt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _e={exports:{}};/*!
6
6
  Copyright (c) 2018 Jed Watson.
7
7
  Licensed under the MIT License (MIT), see
8
8
  http://jedwatson.github.io/classnames