@purpurds/tabs 7.3.1 → 7.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LICENSE.txt +1 -1
- package/dist/styles.css +1 -1
- package/dist/tabs.cjs.js +3 -3
- package/dist/tabs.es.js +28 -28
- package/package.json +7 -7
- package/src/tab-header.module.scss +1 -0
package/dist/LICENSE.txt
CHANGED
package/dist/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
._purpur-tab-content_1ugbi_1{position:relative}._purpur-tab-content_1ugbi_1:focus-visible{outline:0}._purpur-tab-content_1ugbi_1:focus-visible:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;outline:var(--purpur-border-width-sm) solid var(--purpur-color-border-interactive-focus);border-radius:var(--purpur-border-radius-xs);pointer-events:none}._purpur-tab-content--force-mount_1ugbi_15[data-state=inactive]{display:none}._purpur-tab-
|
|
1
|
+
._purpur-tab-content_1ugbi_1{position:relative}._purpur-tab-content_1ugbi_1:focus-visible{outline:0}._purpur-tab-content_1ugbi_1:focus-visible:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;outline:var(--purpur-border-width-sm) solid var(--purpur-color-border-interactive-focus);border-radius:var(--purpur-border-radius-xs);pointer-events:none}._purpur-tab-content--force-mount_1ugbi_15[data-state=inactive]{display:none}._purpur-tab-header_ebsfx_1{position:relative;display:flex;align-items:center;justify-content:center;width:100%;padding:calc(var(--purpur-spacing-100) + var(--purpur-spacing-25)) var(--purpur-spacing-200);border:0;border-radius:var(--purpur-border-radius-sm) var(--purpur-border-radius-sm) 0 0;background:transparent;font-family:var(--purpur-typography-family-default);font-weight:var(--purpur-typography-weight-normal);font-size:var(--purpur-typography-scale-100);line-height:var(--purpur-typography-line-height-loose);font-weight:500;white-space:nowrap;cursor:pointer;transition:all var(--purpur-motion-duration-150) var(--purpur-motion-easing-ease-in-out)}._purpur-tab-header_ebsfx_1[aria-selected=true]{cursor:auto}._purpur-tab-header_ebsfx_1:focus-visible{outline:0}._purpur-tab-header_ebsfx_1:focus-visible:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:20;outline:var(--purpur-border-width-sm) solid var(--purpur-color-border-interactive-focus);outline-offset:calc(-1 * var(--purpur-border-width-sm));border-radius:var(--purpur-border-radius-sm) var(--purpur-border-radius-sm) 0 0;pointer-events:none}._purpur-tab-header--contained_ebsfx_36:focus-visible:after,._purpur-tab-header--contained-negative_ebsfx_36:focus-visible:after{top:calc(-1 * var(--purpur-border-width-sm))}._purpur-tab-header--line_ebsfx_39{color:var(--purpur-color-text-interactive-primary);background:var(--purpur-color-functional-transparent)}._purpur-tab-header--line_ebsfx_39:not(._purpur-tab-header_ebsfx_1[aria-selected=true]):hover{color:var(--purpur-color-text-interactive-primary-hover);background:var(--purpur-color-background-interactive-transparent-hover)}._purpur-tab-header--line_ebsfx_39:not(._purpur-tab-header_ebsfx_1[aria-selected=true]):active{color:var(--purpur-color-text-interactive-primary-active);background:var(--purpur-color-background-interactive-transparent-active)}._purpur-tab-header--line-negative_ebsfx_51{color:var(--purpur-color-text-interactive-primary-negative);background:var(--purpur-color-functional-transparent)}._purpur-tab-header--line-negative_ebsfx_51:not(._purpur-tab-header_ebsfx_1[aria-selected=true]):hover{color:var(--purpur-color-text-interactive-primary-negative-hover);background:var(--purpur-color-background-interactive-transparent-negative-hover)}._purpur-tab-header--line-negative_ebsfx_51:not(._purpur-tab-header_ebsfx_1[aria-selected=true]):active{color:var(--purpur-color-text-interactive-primary-negative-active);background:var(--purpur-color-background-interactive-transparent-negative-active)}._purpur-tab-header--contained_ebsfx_36{padding-top:calc(var(--purpur-spacing-100) + var(--purpur-spacing-25) - var(--purpur-border-width-sm));border-top:var(--purpur-border-width-sm) solid transparent;color:var(--purpur-color-text-interactive-primary);background:var(--purpur-color-background-interactive-inactive)}._purpur-tab-header--contained_ebsfx_36._purpur-tab-header_ebsfx_1[aria-selected=true]{border-color:var(--purpur-color-border-interactive-primary);background:var(--purpur-color-background-primary)}._purpur-tab-header--contained_ebsfx_36:not(._purpur-tab-header_ebsfx_1[aria-selected=true]):hover{color:var(--purpur-color-text-interactive-primary-hover);background:var(--purpur-color-background-interactive-transparent-hover)}._purpur-tab-header--contained_ebsfx_36:not(._purpur-tab-header_ebsfx_1[aria-selected=true]):active{color:var(--purpur-color-text-interactive-primary-active);background:var(--purpur-color-background-interactive-transparent-active)}._purpur-tab-header--contained-negative_ebsfx_36{padding-top:calc(var(--purpur-spacing-100) + var(--purpur-spacing-25) - var(--purpur-border-width-sm));border-top:var(--purpur-border-width-sm) solid transparent;color:var(--purpur-color-text-interactive-primary-negative);background:var(--purpur-color-background-interactive-inactive-negative)}._purpur-tab-header--contained-negative_ebsfx_36._purpur-tab-header_ebsfx_1[aria-selected=true]{border-color:var(--purpur-color-border-interactive-primary-negative);color:var(--purpur-color-text-interactive-primary);background:var(--purpur-color-background-primary)}._purpur-tab-header--contained-negative_ebsfx_36:not(._purpur-tab-header_ebsfx_1[aria-selected=true]):hover{color:var(--purpur-color-text-interactive-primary-negative-hover);background:var(--purpur-color-background-interactive-transparent-negative-hover)}._purpur-tab-header--contained-negative_ebsfx_36:not(._purpur-tab-header_ebsfx_1[aria-selected=true]):active{color:var(--purpur-color-text-interactive-primary-negative-active);background:var(--purpur-color-background-interactive-transparent-negative-active)}._purpur-tabs__wrapper_j1jjc_1{position:relative;-ms-overflow-style:none;scrollbar-width:none}._purpur-tabs__wrapper_j1jjc_1 ::-webkit-scrollbar{display:none}._purpur-tabs__wrapper_j1jjc_1 ._purpur-tabs__scroll-button_j1jjc_9{display:none;align-items:center;position:absolute;top:0;z-index:10;height:100%;padding:0;border:var(--purpur-border-width-xs) solid var(--purpur-color-border-interactive-subtle);border-radius:var(--purpur-border-radius-xs);color:var(--purpur-color-text-default);background:var(--purpur-color-background-primary);box-shadow:var(--purpur-shadow-md);cursor:pointer}@media (prefers-reduced-motion: no-preference){._purpur-tabs__wrapper_j1jjc_1 ._purpur-tabs__scroll-button_j1jjc_9{transition:all var(--purpur-motion-duration-150) var(--purpur-motion-easing-ease-in-out)}}._purpur-tabs__wrapper_j1jjc_1 ._purpur-tabs__scroll-button_j1jjc_9:after{content:"";position:absolute;inset:calc(-1 * var(--purpur-border-width-xs));border:var(--purpur-border-width-sm) solid var(--purpur-color-border-interactive-subtle-hover);border-radius:var(--purpur-border-radius-xs);box-sizing:border-box;opacity:0}@media (prefers-reduced-motion: no-preference){._purpur-tabs__wrapper_j1jjc_1 ._purpur-tabs__scroll-button_j1jjc_9:after{transition:all var(--purpur-motion-duration-150) var(--purpur-motion-easing-ease-in-out)}}._purpur-tabs__wrapper_j1jjc_1 ._purpur-tabs__scroll-button_j1jjc_9:hover{box-shadow:none;border-color:transparent;color:var(--purpur-color-text-interactive-primary-hover)}._purpur-tabs__wrapper_j1jjc_1 ._purpur-tabs__scroll-button_j1jjc_9:hover:after{opacity:1}._purpur-tabs__wrapper_j1jjc_1 ._purpur-tabs__scroll-button_j1jjc_9:active:after{border-width:var(--purpur-border-width-xs)}._purpur-tabs__wrapper_j1jjc_1 ._purpur-tabs__scroll-button_j1jjc_9:focus{outline:0}._purpur-tabs__wrapper_j1jjc_1 ._purpur-tabs__scroll-button_j1jjc_9:focus-visible{outline:0;border-color:var(--purpur-color-border-interactive-subtle);box-shadow:none}._purpur-tabs__wrapper_j1jjc_1 ._purpur-tabs__scroll-button_j1jjc_9:focus-visible:after{left:calc(-1 * var(--purpur-border-width-sm) * 2);top:calc(-1 * var(--purpur-border-width-sm) * 2);width:calc(100% + var(--purpur-border-width-sm) * 4);height:calc(100% + var(--purpur-border-width-sm) * 4);border-color:var(--purpur-color-border-interactive-focus);opacity:1;pointer-events:none}._purpur-tabs__wrapper_j1jjc_1 ._purpur-tabs__scroll-button--left_j1jjc_71{left:0}._purpur-tabs__wrapper_j1jjc_1 ._purpur-tabs__scroll-button--right_j1jjc_74{right:0}._purpur-tabs__wrapper--scroll-end_j1jjc_77 ._purpur-tabs__scroll-button--left_j1jjc_71,._purpur-tabs__wrapper--scroll-start_j1jjc_80 ._purpur-tabs__scroll-button--right_j1jjc_74{display:flex}._purpur-tabs--line_j1jjc_83 ._purpur-tabs__wrapper_j1jjc_1:after,._purpur-tabs--line-negative_j1jjc_83 ._purpur-tabs__wrapper_j1jjc_1:after{content:"";position:absolute;bottom:0;left:0;width:100%;height:var(--purpur-border-width-sm)}._purpur-tabs--line_j1jjc_83 ._purpur-tabs__selected-border_j1jjc_91,._purpur-tabs--line-negative_j1jjc_83 ._purpur-tabs__selected-border_j1jjc_91{position:absolute;bottom:0;left:0;z-index:10;height:var(--purpur-border-width-sm)}@media (prefers-reduced-motion: no-preference){._purpur-tabs--line_j1jjc_83 ._purpur-tabs__selected-border_j1jjc_91,._purpur-tabs--line-negative_j1jjc_83 ._purpur-tabs__selected-border_j1jjc_91{transition:all var(--purpur-motion-duration-150) var(--purpur-motion-easing-ease-in-out)}}._purpur-tabs--line_j1jjc_83 ._purpur-tabs__wrapper_j1jjc_1:after{background:var(--purpur-color-border-weak)}._purpur-tabs--line_j1jjc_83 ._purpur-tabs__selected-border_j1jjc_91{background:var(--purpur-color-border-interactive-primary)}._purpur-tabs--line-negative_j1jjc_83 ._purpur-tabs__wrapper_j1jjc_1:after{background:var(--purpur-color-border-weak-negative)}._purpur-tabs--line-negative_j1jjc_83 ._purpur-tabs__selected-border_j1jjc_91{background:var(--purpur-color-border-interactive-primary-negative)}._purpur-tabs__content-wrapper_j1jjc_115{overflow:hidden}@media (prefers-reduced-motion: no-preference){._purpur-tabs__content-wrapper_j1jjc_115{transition:height var(--purpur-motion-duration-200) var(--purpur-motion-easing-ease-in-out)}}._purpur-tabs--contained_j1jjc_123 ._purpur-tabs__list_j1jjc_123,._purpur-tabs--contained-negative_j1jjc_123 ._purpur-tabs__list_j1jjc_123{gap:var(--purpur-spacing-100)}._purpur-tabs--contained_j1jjc_123 ._purpur-tabs__content-container_j1jjc_126,._purpur-tabs--contained-negative_j1jjc_123 ._purpur-tabs__content-container_j1jjc_126{background:var(--purpur-color-background-primary)}._purpur-tabs__list_j1jjc_123{position:relative;display:inline-flex;align-items:flex-end;max-width:100%;overflow:auto}._purpur-tabs--fullWidth_j1jjc_136 ._purpur-tabs__list_j1jjc_123{min-width:100%}
|
package/dist/tabs.cjs.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),v=require("react");require("react-dom");function We(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const a=We(v);function ke(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ae={exports:{}};/*!
|
|
2
2
|
Copyright (c) 2018 Jed Watson.
|
|
3
3
|
Licensed under the MIT License (MIT), see
|
|
4
4
|
http://jedwatson.github.io/classnames
|
|
5
|
-
*/var ue;function qe(){return ue||(ue=1,function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r="",c=0;c<arguments.length;c++){var i=arguments[c];i&&(r=s(r,o.call(this,i)))}return r}function o(r){if(typeof r=="string"||typeof r=="number")return this&&this[r]||r;if(typeof r!="object")return"";if(Array.isArray(r))return n.apply(this,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var c="";for(var i in r)t.call(r,i)&&r[i]&&(c=s(c,this&&this[i]||i));return c}function s(r,c){return c?r?r+" "+c:r+c:r}e.exports?(n.default=n,e.exports=n):window.classNames=n})()}(ae)),ae.exports}var ze=qe();const Ke=ke(ze),Ye={"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"},Ze=Ke.bind(Ye),le="purpur-icon",Xe="md",He=e=>e.filter(t=>Object.keys(t).length>=1).map(t=>`${t.name}="${t.value}"`).join(" "),Je=({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 ${He(n)}>${o}${e}</svg>`},Qe=e=>e.replace(/<(\/?)svg([^>]*)>/g,"").trim(),_e=({["data-testid"]:e,svg:t,allyTitle:n,className:o,size:s=Xe,...r})=>{const c=Je({content:Qe(t.svg),title:n}),i=Ze(o,le,`${le}--${s}`);return d.jsx("span",{className:i,"data-testid":e,dangerouslySetInnerHTML:{__html:c},...r})};_e.displayName="Icon";const et={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"},tt={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"};function A(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function ee(e,t=[]){let n=[];function o(r,c){const i=a.createContext(c),l=n.length;n=[...n,c];const u=f=>{var C;const{scope:v,children:g,...p}=f,h=((C=v==null?void 0:v[e])==null?void 0:C[l])||i,y=a.useMemo(()=>p,Object.values(p));return d.jsx(h.Provider,{value:y,children:g})};u.displayName=r+"Provider";function _(f,v){var h;const g=((h=v==null?void 0:v[e])==null?void 0:h[l])||i,p=a.useContext(g);if(p)return p;if(c!==void 0)return c;throw new Error(`\`${f}\` must be used within \`${r}\``)}return[u,_]}const s=()=>{const r=n.map(c=>a.createContext(c));return function(i){const l=(i==null?void 0:i[e])||r;return a.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return s.scopeName=e,[o,nt(s,...t)]}function nt(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(r){const c=o.reduce((i,{useScope:l,scopeName:u})=>{const f=l(r)[`__scope${u}`];return{...i,...f}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function de(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ve(...e){return t=>{let n=!1;const o=e.map(s=>{const r=de(s,t);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let s=0;s<o.length;s++){const r=o[s];typeof r=="function"?r():de(e[s],null)}}}}function q(...e){return a.useCallback(ve(...e),e)}var z=a.forwardRef((e,t)=>{const{children:n,...o}=e,s=a.Children.toArray(n),r=s.find(ot);if(r){const c=r.props.children,i=s.map(l=>l===r?a.Children.count(c)>1?a.Children.only(null):a.isValidElement(c)?c.props.children:null:l);return d.jsx(H,{...o,ref:t,children:a.isValidElement(c)?a.cloneElement(c,void 0,i):null})}return d.jsx(H,{...o,ref:t,children:n})});z.displayName="Slot";var H=a.forwardRef((e,t)=>{const{children:n,...o}=e;if(a.isValidElement(n)){const s=ct(n),r=st(o,n.props);return n.type!==a.Fragment&&(r.ref=t?ve(t,s):s),a.cloneElement(n,r)}return a.Children.count(n)>1?a.Children.only(null):null});H.displayName="SlotClone";var rt=({children:e})=>d.jsx(d.Fragment,{children:e});function ot(e){return a.isValidElement(e)&&e.type===rt}function st(e,t){const n={...t};for(const o in t){const s=e[o],r=t[o];/^on[A-Z]/.test(o)?s&&r?n[o]=(...i)=>{r(...i),s(...i)}:s&&(n[o]=s):o==="style"?n[o]={...s,...r}:o==="className"&&(n[o]=[s,r].filter(Boolean).join(" "))}return{...e,...n}}function ct(e){var o,s;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function it(e){const t=e+"CollectionProvider",[n,o]=ee(t),[s,r]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=g=>{const{scope:p,children:h}=g,y=b.useRef(null),C=b.useRef(new Map).current;return d.jsx(s,{scope:p,itemMap:C,collectionRef:y,children:h})};c.displayName=t;const i=e+"CollectionSlot",l=b.forwardRef((g,p)=>{const{scope:h,children:y}=g,C=r(i,h),w=q(p,C.collectionRef);return d.jsx(z,{ref:w,children:y})});l.displayName=i;const u=e+"CollectionItemSlot",_="data-radix-collection-item",f=b.forwardRef((g,p)=>{const{scope:h,children:y,...C}=g,w=b.useRef(null),O=q(p,w),x=r(u,h);return b.useEffect(()=>(x.itemMap.set(w,{ref:w,...C}),()=>void x.itemMap.delete(w))),d.jsx(z,{[_]:"",ref:O,children:y})});f.displayName=u;function v(g){const p=r(e+"CollectionConsumer",g);return b.useCallback(()=>{const y=p.collectionRef.current;if(!y)return[];const C=Array.from(y.querySelectorAll(`[${_}]`));return Array.from(p.itemMap.values()).sort((x,I)=>C.indexOf(x.ref.current)-C.indexOf(I.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:c,Slot:l,ItemSlot:f},v,o]}var J=globalThis!=null&&globalThis.document?a.useLayoutEffect:()=>{},at=a.useId||(()=>{}),ut=0;function be(e){const[t,n]=a.useState(at());return J(()=>{n(o=>o??String(ut++))},[e]),t?`radix-${t}`:""}var lt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],$=lt.reduce((e,t)=>{const n=a.forwardRef((o,s)=>{const{asChild:r,...c}=o,i=r?z:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(i,{...c,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function te(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...n)=>{var o;return(o=t.current)==null?void 0:o.call(t,...n)},[])}function ge({prop:e,defaultProp:t,onChange:n=()=>{}}){const[o,s]=dt({defaultProp:t,onChange:n}),r=e!==void 0,c=r?e:o,i=te(n),l=a.useCallback(u=>{if(r){const f=typeof u=="function"?u(e):u;f!==e&&i(f)}else s(u)},[r,e,s,i]);return[c,l]}function dt({defaultProp:e,onChange:t}){const n=a.useState(e),[o]=n,s=a.useRef(o),r=te(t);return a.useEffect(()=>{s.current!==o&&(r(o),s.current=o)},[o,s,r]),n}var ft=a.createContext(void 0);function he(e){const t=a.useContext(ft);return e||t||"ltr"}var Z="rovingFocusGroup.onEntryFocus",pt={bubbles:!1,cancelable:!0},K="RovingFocusGroup",[Q,Ce,mt]=it(K),[_t,we]=ee(K,[mt]),[vt,bt]=_t(K),xe=a.forwardRef((e,t)=>d.jsx(Q.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(Q.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx(gt,{...e,ref:t})})}));xe.displayName=K;var gt=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:s=!1,dir:r,currentTabStopId:c,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:_=!1,...f}=e,v=a.useRef(null),g=q(t,v),p=he(r),[h=null,y]=ge({prop:c,defaultProp:i,onChange:l}),[C,w]=a.useState(!1),O=te(u),x=Ce(n),I=a.useRef(!1),[D,B]=a.useState(0);return a.useEffect(()=>{const S=v.current;if(S)return S.addEventListener(Z,O),()=>S.removeEventListener(Z,O)},[O]),d.jsx(vt,{scope:n,orientation:o,dir:p,loop:s,currentTabStopId:h,onItemFocus:a.useCallback(S=>y(S),[y]),onItemShiftTab:a.useCallback(()=>w(!0),[]),onFocusableItemAdd:a.useCallback(()=>B(S=>S+1),[]),onFocusableItemRemove:a.useCallback(()=>B(S=>S-1),[]),children:d.jsx($.div,{tabIndex:C||D===0?-1:0,"data-orientation":o,...f,ref:g,style:{outline:"none",...e.style},onMouseDown:A(e.onMouseDown,()=>{I.current=!0}),onFocus:A(e.onFocus,S=>{const Y=!I.current;if(S.target===S.currentTarget&&Y&&!C){const F=new CustomEvent(Z,pt);if(S.currentTarget.dispatchEvent(F),!F.defaultPrevented){const L=x().filter(T=>T.focusable),V=L.find(T=>T.active),U=L.find(T=>T.id===h),W=[V,U,...L].filter(Boolean).map(T=>T.ref.current);je(W,_)}}I.current=!1}),onBlur:A(e.onBlur,()=>w(!1))})})}),ye="RovingFocusGroupItem",Se=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:s=!1,tabStopId:r,...c}=e,i=be(),l=r||i,u=bt(ye,n),_=u.currentTabStopId===l,f=Ce(n),{onFocusableItemAdd:v,onFocusableItemRemove:g}=u;return a.useEffect(()=>{if(o)return v(),()=>g()},[o,v,g]),d.jsx(Q.ItemSlot,{scope:n,id:l,focusable:o,active:s,children:d.jsx($.span,{tabIndex:_?0:-1,"data-orientation":u.orientation,...c,ref:t,onMouseDown:A(e.onMouseDown,p=>{o?u.onItemFocus(l):p.preventDefault()}),onFocus:A(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:A(e.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){u.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const h=wt(p,u.orientation,u.dir);if(h!==void 0){if(p.metaKey||p.ctrlKey||p.altKey||p.shiftKey)return;p.preventDefault();let C=f().filter(w=>w.focusable).map(w=>w.ref.current);if(h==="last")C.reverse();else if(h==="prev"||h==="next"){h==="prev"&&C.reverse();const w=C.indexOf(p.currentTarget);C=u.loop?xt(C,w+1):C.slice(w+1)}setTimeout(()=>je(C))}})})})});Se.displayName=ye;var ht={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 wt(e,t,n){const o=Ct(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return ht[o]}function je(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function xt(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var yt=xe,St=Se;function jt(e,t){return a.useReducer((n,o)=>t[n][o]??n,e)}var Ie=e=>{const{present:t,children:n}=e,o=It(t),s=typeof n=="function"?n({present:o.isPresent}):a.Children.only(n),r=q(o.ref,Rt(s));return typeof n=="function"||o.isPresent?a.cloneElement(s,{ref:r}):null};Ie.displayName="Presence";function It(e){const[t,n]=a.useState(),o=a.useRef({}),s=a.useRef(e),r=a.useRef("none"),c=e?"mounted":"unmounted",[i,l]=jt(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const u=k(o.current);r.current=i==="mounted"?u:"none"},[i]),J(()=>{const u=o.current,_=s.current;if(_!==e){const v=r.current,g=k(u);e?l("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(_&&v!==g?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,l]),J(()=>{if(t){let u;const _=t.ownerDocument.defaultView??window,f=g=>{const h=k(o.current).includes(g.animationName);if(g.target===t&&h&&(l("ANIMATION_END"),!s.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=_.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},v=g=>{g.target===t&&(r.current=k(o.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{_.clearTimeout(u),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:a.useCallback(u=>{u&&(o.current=getComputedStyle(u)),n(u)},[])}}function k(e){return(e==null?void 0:e.animationName)||"none"}function Rt(e){var o,s;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ne="Tabs",[Nt,Kt]=ee(ne,[we]),Re=we(),[Tt,re]=Nt(ne),Ne=a.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:s,defaultValue:r,orientation:c="horizontal",dir:i,activationMode:l="automatic",...u}=e,_=he(i),[f,v]=ge({prop:o,onChange:s,defaultProp:r});return d.jsx(Tt,{scope:n,baseId:be(),value:f,onValueChange:v,orientation:c,dir:_,activationMode:l,children:d.jsx($.div,{dir:_,"data-orientation":c,...u,ref:t})})});Ne.displayName=ne;var Te="TabsList",Ee=a.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...s}=e,r=re(Te,n),c=Re(n);return d.jsx(yt,{asChild:!0,...c,orientation:r.orientation,dir:r.dir,loop:o,children:d.jsx($.div,{role:"tablist","aria-orientation":r.orientation,...s,ref:t})})});Ee.displayName=Te;var Ae="TabsTrigger",Oe=a.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:s=!1,...r}=e,c=re(Ae,n),i=Re(n),l=Fe(c.baseId,o),u=$e(c.baseId,o),_=o===c.value;return d.jsx(St,{asChild:!0,...i,focusable:!s,active:_,children:d.jsx($.button,{type:"button",role:"tab","aria-selected":_,"aria-controls":u,"data-state":_?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:l,...r,ref:t,onMouseDown:A(e.onMouseDown,f=>{!s&&f.button===0&&f.ctrlKey===!1?c.onValueChange(o):f.preventDefault()}),onKeyDown:A(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&c.onValueChange(o)}),onFocus:A(e.onFocus,()=>{const f=c.activationMode!=="manual";!_&&!s&&f&&c.onValueChange(o)})})})});Oe.displayName=Ae;var Me="TabsContent",Pe=a.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,forceMount:s,children:r,...c}=e,i=re(Me,n),l=Fe(i.baseId,o),u=$e(i.baseId,o),_=o===i.value,f=a.useRef(_);return a.useEffect(()=>{const v=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(v)},[]),d.jsx(Ie,{present:s||_,children:({present:v})=>d.jsx($.div,{"data-state":_?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":l,hidden:!v,id:u,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:v&&r})})});Pe.displayName=Me;function Fe(e,t){return`${e}-trigger-${t}`}function $e(e,t){return`${e}-content-${t}`}var Et=Ne,At=Ee,Ot=Oe,Mt=Pe;function Pt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var X={exports:{}};/*!
|
|
5
|
+
*/var ue;function qe(){return ue||(ue=1,function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r="",c=0;c<arguments.length;c++){var i=arguments[c];i&&(r=s(r,o.call(this,i)))}return r}function o(r){if(typeof r=="string"||typeof r=="number")return this&&this[r]||r;if(typeof r!="object")return"";if(Array.isArray(r))return n.apply(this,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var c="";for(var i in r)t.call(r,i)&&r[i]&&(c=s(c,this&&this[i]||i));return c}function s(r,c){return c?r?r+" "+c:r+c:r}e.exports?(n.default=n,e.exports=n):window.classNames=n})()}(ae)),ae.exports}var Ke=qe();const ze=ke(Ke),Ye={"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"},Ze=ze.bind(Ye),le="purpur-icon",Xe="md",He=e=>e.filter(t=>Object.keys(t).length>=1).map(t=>`${t.name}="${t.value}"`).join(" "),Je=({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 ${He(n)}>${o}${e}</svg>`},Qe=e=>e.replace(/<(\/?)svg([^>]*)>/g,"").trim(),_e=({["data-testid"]:e,svg:t,allyTitle:n,className:o,size:s=Xe,...r})=>{const c=Je({content:Qe(t.svg),title:n}),i=Ze(o,le,`${le}--${s}`);return d.jsx("span",{className:i,"data-testid":e,dangerouslySetInnerHTML:{__html:c},...r})};_e.displayName="Icon";const et={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"},tt={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"};function A(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function ee(e,t=[]){let n=[];function o(r,c){const i=a.createContext(c),l=n.length;n=[...n,c];const u=f=>{var x;const{scope:b,children:g,...p}=f,h=((x=b==null?void 0:b[e])==null?void 0:x[l])||i,y=a.useMemo(()=>p,Object.values(p));return d.jsx(h.Provider,{value:y,children:g})};u.displayName=r+"Provider";function _(f,b){var h;const g=((h=b==null?void 0:b[e])==null?void 0:h[l])||i,p=a.useContext(g);if(p)return p;if(c!==void 0)return c;throw new Error(`\`${f}\` must be used within \`${r}\``)}return[u,_]}const s=()=>{const r=n.map(c=>a.createContext(c));return function(i){const l=(i==null?void 0:i[e])||r;return a.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return s.scopeName=e,[o,nt(s,...t)]}function nt(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(r){const c=o.reduce((i,{useScope:l,scopeName:u})=>{const f=l(r)[`__scope${u}`];return{...i,...f}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function de(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function be(...e){return t=>{let n=!1;const o=e.map(s=>{const r=de(s,t);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let s=0;s<o.length;s++){const r=o[s];typeof r=="function"?r():de(e[s],null)}}}}function q(...e){return a.useCallback(be(...e),e)}var K=a.forwardRef((e,t)=>{const{children:n,...o}=e,s=a.Children.toArray(n),r=s.find(ot);if(r){const c=r.props.children,i=s.map(l=>l===r?a.Children.count(c)>1?a.Children.only(null):a.isValidElement(c)?c.props.children:null:l);return d.jsx(H,{...o,ref:t,children:a.isValidElement(c)?a.cloneElement(c,void 0,i):null})}return d.jsx(H,{...o,ref:t,children:n})});K.displayName="Slot";var H=a.forwardRef((e,t)=>{const{children:n,...o}=e;if(a.isValidElement(n)){const s=ct(n),r=st(o,n.props);return n.type!==a.Fragment&&(r.ref=t?be(t,s):s),a.cloneElement(n,r)}return a.Children.count(n)>1?a.Children.only(null):null});H.displayName="SlotClone";var rt=({children:e})=>d.jsx(d.Fragment,{children:e});function ot(e){return a.isValidElement(e)&&e.type===rt}function st(e,t){const n={...t};for(const o in t){const s=e[o],r=t[o];/^on[A-Z]/.test(o)?s&&r?n[o]=(...i)=>{r(...i),s(...i)}:s&&(n[o]=s):o==="style"?n[o]={...s,...r}:o==="className"&&(n[o]=[s,r].filter(Boolean).join(" "))}return{...e,...n}}function ct(e){var o,s;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function it(e){const t=e+"CollectionProvider",[n,o]=ee(t),[s,r]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=g=>{const{scope:p,children:h}=g,y=v.useRef(null),x=v.useRef(new Map).current;return d.jsx(s,{scope:p,itemMap:x,collectionRef:y,children:h})};c.displayName=t;const i=e+"CollectionSlot",l=v.forwardRef((g,p)=>{const{scope:h,children:y}=g,x=r(i,h),C=q(p,x.collectionRef);return d.jsx(K,{ref:C,children:y})});l.displayName=i;const u=e+"CollectionItemSlot",_="data-radix-collection-item",f=v.forwardRef((g,p)=>{const{scope:h,children:y,...x}=g,C=v.useRef(null),O=q(p,C),w=r(u,h);return v.useEffect(()=>(w.itemMap.set(C,{ref:C,...x}),()=>void w.itemMap.delete(C))),d.jsx(K,{[_]:"",ref:O,children:y})});f.displayName=u;function b(g){const p=r(e+"CollectionConsumer",g);return v.useCallback(()=>{const y=p.collectionRef.current;if(!y)return[];const x=Array.from(y.querySelectorAll(`[${_}]`));return Array.from(p.itemMap.values()).sort((w,I)=>x.indexOf(w.ref.current)-x.indexOf(I.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:c,Slot:l,ItemSlot:f},b,o]}var J=globalThis!=null&&globalThis.document?a.useLayoutEffect:()=>{},at=a.useId||(()=>{}),ut=0;function ve(e){const[t,n]=a.useState(at());return J(()=>{n(o=>o??String(ut++))},[e]),t?`radix-${t}`:""}var lt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],$=lt.reduce((e,t)=>{const n=a.forwardRef((o,s)=>{const{asChild:r,...c}=o,i=r?K:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(i,{...c,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function te(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...n)=>{var o;return(o=t.current)==null?void 0:o.call(t,...n)},[])}function ge({prop:e,defaultProp:t,onChange:n=()=>{}}){const[o,s]=dt({defaultProp:t,onChange:n}),r=e!==void 0,c=r?e:o,i=te(n),l=a.useCallback(u=>{if(r){const f=typeof u=="function"?u(e):u;f!==e&&i(f)}else s(u)},[r,e,s,i]);return[c,l]}function dt({defaultProp:e,onChange:t}){const n=a.useState(e),[o]=n,s=a.useRef(o),r=te(t);return a.useEffect(()=>{s.current!==o&&(r(o),s.current=o)},[o,s,r]),n}var ft=a.createContext(void 0);function he(e){const t=a.useContext(ft);return e||t||"ltr"}var Z="rovingFocusGroup.onEntryFocus",pt={bubbles:!1,cancelable:!0},z="RovingFocusGroup",[Q,xe,mt]=it(z),[_t,Ce]=ee(z,[mt]),[bt,vt]=_t(z),we=a.forwardRef((e,t)=>d.jsx(Q.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(Q.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx(gt,{...e,ref:t})})}));we.displayName=z;var gt=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:s=!1,dir:r,currentTabStopId:c,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:_=!1,...f}=e,b=a.useRef(null),g=q(t,b),p=he(r),[h=null,y]=ge({prop:c,defaultProp:i,onChange:l}),[x,C]=a.useState(!1),O=te(u),w=xe(n),I=a.useRef(!1),[D,B]=a.useState(0);return a.useEffect(()=>{const S=b.current;if(S)return S.addEventListener(Z,O),()=>S.removeEventListener(Z,O)},[O]),d.jsx(bt,{scope:n,orientation:o,dir:p,loop:s,currentTabStopId:h,onItemFocus:a.useCallback(S=>y(S),[y]),onItemShiftTab:a.useCallback(()=>C(!0),[]),onFocusableItemAdd:a.useCallback(()=>B(S=>S+1),[]),onFocusableItemRemove:a.useCallback(()=>B(S=>S-1),[]),children:d.jsx($.div,{tabIndex:x||D===0?-1:0,"data-orientation":o,...f,ref:g,style:{outline:"none",...e.style},onMouseDown:A(e.onMouseDown,()=>{I.current=!0}),onFocus:A(e.onFocus,S=>{const Y=!I.current;if(S.target===S.currentTarget&&Y&&!x){const F=new CustomEvent(Z,pt);if(S.currentTarget.dispatchEvent(F),!F.defaultPrevented){const L=w().filter(T=>T.focusable),V=L.find(T=>T.active),U=L.find(T=>T.id===h),W=[V,U,...L].filter(Boolean).map(T=>T.ref.current);je(W,_)}}I.current=!1}),onBlur:A(e.onBlur,()=>C(!1))})})}),ye="RovingFocusGroupItem",Se=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:s=!1,tabStopId:r,...c}=e,i=ve(),l=r||i,u=vt(ye,n),_=u.currentTabStopId===l,f=xe(n),{onFocusableItemAdd:b,onFocusableItemRemove:g}=u;return a.useEffect(()=>{if(o)return b(),()=>g()},[o,b,g]),d.jsx(Q.ItemSlot,{scope:n,id:l,focusable:o,active:s,children:d.jsx($.span,{tabIndex:_?0:-1,"data-orientation":u.orientation,...c,ref:t,onMouseDown:A(e.onMouseDown,p=>{o?u.onItemFocus(l):p.preventDefault()}),onFocus:A(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:A(e.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){u.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const h=Ct(p,u.orientation,u.dir);if(h!==void 0){if(p.metaKey||p.ctrlKey||p.altKey||p.shiftKey)return;p.preventDefault();let x=f().filter(C=>C.focusable).map(C=>C.ref.current);if(h==="last")x.reverse();else if(h==="prev"||h==="next"){h==="prev"&&x.reverse();const C=x.indexOf(p.currentTarget);x=u.loop?wt(x,C+1):x.slice(C+1)}setTimeout(()=>je(x))}})})})});Se.displayName=ye;var ht={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function xt(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Ct(e,t,n){const o=xt(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return ht[o]}function je(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function wt(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var yt=we,St=Se;function jt(e,t){return a.useReducer((n,o)=>t[n][o]??n,e)}var Ie=e=>{const{present:t,children:n}=e,o=It(t),s=typeof n=="function"?n({present:o.isPresent}):a.Children.only(n),r=q(o.ref,Rt(s));return typeof n=="function"||o.isPresent?a.cloneElement(s,{ref:r}):null};Ie.displayName="Presence";function It(e){const[t,n]=a.useState(),o=a.useRef({}),s=a.useRef(e),r=a.useRef("none"),c=e?"mounted":"unmounted",[i,l]=jt(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const u=k(o.current);r.current=i==="mounted"?u:"none"},[i]),J(()=>{const u=o.current,_=s.current;if(_!==e){const b=r.current,g=k(u);e?l("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(_&&b!==g?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,l]),J(()=>{if(t){let u;const _=t.ownerDocument.defaultView??window,f=g=>{const h=k(o.current).includes(g.animationName);if(g.target===t&&h&&(l("ANIMATION_END"),!s.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=_.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},b=g=>{g.target===t&&(r.current=k(o.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{_.clearTimeout(u),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:a.useCallback(u=>{u&&(o.current=getComputedStyle(u)),n(u)},[])}}function k(e){return(e==null?void 0:e.animationName)||"none"}function Rt(e){var o,s;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ne="Tabs",[Nt,zt]=ee(ne,[Ce]),Re=Ce(),[Tt,re]=Nt(ne),Ne=a.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:s,defaultValue:r,orientation:c="horizontal",dir:i,activationMode:l="automatic",...u}=e,_=he(i),[f,b]=ge({prop:o,onChange:s,defaultProp:r});return d.jsx(Tt,{scope:n,baseId:ve(),value:f,onValueChange:b,orientation:c,dir:_,activationMode:l,children:d.jsx($.div,{dir:_,"data-orientation":c,...u,ref:t})})});Ne.displayName=ne;var Te="TabsList",Ee=a.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...s}=e,r=re(Te,n),c=Re(n);return d.jsx(yt,{asChild:!0,...c,orientation:r.orientation,dir:r.dir,loop:o,children:d.jsx($.div,{role:"tablist","aria-orientation":r.orientation,...s,ref:t})})});Ee.displayName=Te;var Ae="TabsTrigger",Oe=a.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:s=!1,...r}=e,c=re(Ae,n),i=Re(n),l=Fe(c.baseId,o),u=$e(c.baseId,o),_=o===c.value;return d.jsx(St,{asChild:!0,...i,focusable:!s,active:_,children:d.jsx($.button,{type:"button",role:"tab","aria-selected":_,"aria-controls":u,"data-state":_?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:l,...r,ref:t,onMouseDown:A(e.onMouseDown,f=>{!s&&f.button===0&&f.ctrlKey===!1?c.onValueChange(o):f.preventDefault()}),onKeyDown:A(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&c.onValueChange(o)}),onFocus:A(e.onFocus,()=>{const f=c.activationMode!=="manual";!_&&!s&&f&&c.onValueChange(o)})})})});Oe.displayName=Ae;var Me="TabsContent",Pe=a.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,forceMount:s,children:r,...c}=e,i=re(Me,n),l=Fe(i.baseId,o),u=$e(i.baseId,o),_=o===i.value,f=a.useRef(_);return a.useEffect(()=>{const b=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(b)},[]),d.jsx(Ie,{present:s||_,children:({present:b})=>d.jsx($.div,{"data-state":_?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":l,hidden:!b,id:u,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:b&&r})})});Pe.displayName=Me;function Fe(e,t){return`${e}-trigger-${t}`}function $e(e,t){return`${e}-content-${t}`}var Et=Ne,At=Ee,Ot=Oe,Mt=Pe;function Pt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var X={exports:{}};/*!
|
|
6
6
|
Copyright (c) 2018 Jed Watson.
|
|
7
7
|
Licensed under the MIT License (MIT), see
|
|
8
8
|
http://jedwatson.github.io/classnames
|
|
9
|
-
*/var fe;function Ft(){return fe||(fe=1,function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r="",c=0;c<arguments.length;c++){var i=arguments[c];i&&(r=s(r,o.call(this,i)))}return r}function o(r){if(typeof r=="string"||typeof r=="number")return this&&this[r]||r;if(typeof r!="object")return"";if(Array.isArray(r))return n.apply(this,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var c="";for(var i in r)t.call(r,i)&&r[i]&&(c=s(c,this&&this[i]||i));return c}function s(r,c){return c?r?r+" "+c:r+c:r}e.exports?(n.default=n,e.exports=n):window.classNames=n})()}(X)),X.exports}var $t=Ft();const oe=Pt($t),Dt={"purpur-tab-content":"_purpur-tab-content_1ugbi_1","purpur-tab-content--force-mount":"_purpur-tab-content--force-mount_1ugbi_15"},Lt=oe.bind(Dt),pe="purpur-tab-content",Vt=
|
|
9
|
+
*/var fe;function Ft(){return fe||(fe=1,function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r="",c=0;c<arguments.length;c++){var i=arguments[c];i&&(r=s(r,o.call(this,i)))}return r}function o(r){if(typeof r=="string"||typeof r=="number")return this&&this[r]||r;if(typeof r!="object")return"";if(Array.isArray(r))return n.apply(this,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var c="";for(var i in r)t.call(r,i)&&r[i]&&(c=s(c,this&&this[i]||i));return c}function s(r,c){return c?r?r+" "+c:r+c:r}e.exports?(n.default=n,e.exports=n):window.classNames=n})()}(X)),X.exports}var $t=Ft();const oe=Pt($t),Dt={"purpur-tab-content":"_purpur-tab-content_1ugbi_1","purpur-tab-content--force-mount":"_purpur-tab-content--force-mount_1ugbi_15"},Lt=oe.bind(Dt),pe="purpur-tab-content",Vt=v.forwardRef(({children:e,tabId:t,"data-testid":n,className:o,disableForceMount:s,...r},c)=>d.jsx(Mt,{ref:c,className:Lt([pe,o,{[`${pe}--force-mount`]:!s}]),"data-testid":n,value:t,forceMount:!s||void 0,...r,children:e})),Bt=e=>!!e&&v.isValidElement(e)&&!!e.props.name&&!!e.props.tabId,Ut={"purpur-tab-header":"_purpur-tab-header_ebsfx_1","purpur-tab-header--contained":"_purpur-tab-header--contained_ebsfx_36","purpur-tab-header--contained-negative":"_purpur-tab-header--contained-negative_ebsfx_36","purpur-tab-header--line":"_purpur-tab-header--line_ebsfx_39","purpur-tab-header--line-negative":"_purpur-tab-header--line-negative_ebsfx_51"},Gt=oe.bind(Ut),me="purpur-tab-header",Wt=v.forwardRef(({index:e,tabId:t,variant:n,negative:o,onFocus:s,"data-testid":r,children:c},i)=>d.jsx(Ot,{id:`${t}-trigger`,className:Gt([me,`${me}--${n}${o?"-negative":""}`]),value:t,"data-testid":r,"data-index":e,ref:i,onFocus:s,children:c})),kt={"purpur-tabs__wrapper":"_purpur-tabs__wrapper_j1jjc_1","purpur-tabs__scroll-button":"_purpur-tabs__scroll-button_j1jjc_9","purpur-tabs__scroll-button--left":"_purpur-tabs__scroll-button--left_j1jjc_71","purpur-tabs__scroll-button--right":"_purpur-tabs__scroll-button--right_j1jjc_74","purpur-tabs__wrapper--scroll-end":"_purpur-tabs__wrapper--scroll-end_j1jjc_77","purpur-tabs__wrapper--scroll-start":"_purpur-tabs__wrapper--scroll-start_j1jjc_80","purpur-tabs--line":"_purpur-tabs--line_j1jjc_83","purpur-tabs--line-negative":"_purpur-tabs--line-negative_j1jjc_83","purpur-tabs__selected-border":"_purpur-tabs__selected-border_j1jjc_91","purpur-tabs__content-wrapper":"_purpur-tabs__content-wrapper_j1jjc_115","purpur-tabs--contained":"_purpur-tabs--contained_j1jjc_123","purpur-tabs__list":"_purpur-tabs__list_j1jjc_123","purpur-tabs--contained-negative":"_purpur-tabs--contained-negative_j1jjc_123","purpur-tabs__content-container":"_purpur-tabs__content-container_j1jjc_126","purpur-tabs--fullWidth":"_purpur-tabs--fullWidth_j1jjc_136"},qt=["line","contained"],De=e=>new CustomEvent("tabChangeDetail",{detail:{value:e}}),P=oe.bind(kt),R="purpur-tabs",Kt=(e,t)=>{var l;if(typeof(e==null?void 0:e.getBoundingClientRect)!="function"||typeof(t==null?void 0:t.scroll)!="function")return;const n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),s=t.clientWidth,r=parseInt((l=getComputedStyle(t).borderLeftWidth)==null?void 0:l.split("px")[0],10),c=o.left+(isNaN(r)?0:r);let i;n.right>o.right&&(i=n.left+t.scrollLeft,i=i+n.width-s+s*.1,i=i-c),n.left<o.left&&(i=n.left+t.scrollLeft,i=i-s*.1,i=i-c),i!==void 0&&t.scroll({left:i,behavior:"smooth"})},Le=({children:e,variant:t="line",negative:n=!1,fullWidth:o=!1,onChange:s,className:r,defaultValue:c,animateHeight:i=!1,"data-testid":l,value:u,..._})=>{const f=v.useRef(null),[b,g]=v.useState(-1),[p,h]=v.useState({}),[y,x]=v.useState(0),[C,O]=v.useState(0),w=v.Children.toArray(e).filter(Bt),I=v.useRef(null),D=v.useRef(new Array(w.length)),B=200,S=t==="line",Y=P([R,`${R}--${t}${n?"-negative":""}`,{[`${R}--fullWidth`]:o},r]),F=v.Children.map(w,({props:{tabId:m}})=>m),L=()=>{const m=F.findIndex(j=>j===c);return m>=0?m:0};v.useEffect(()=>{u&&U(w.findIndex(m=>m.props.tabId===u))},[w,u]);const[V,U]=v.useState(L);if(new Set(F).size!==F.length)throw new Error("tabId must be unique");const G=(m,j)=>j||l?`${j||l}-${m}`:void 0,W=()=>{if(!S)return;const m=D.current[V];x((m==null?void 0:m.offsetLeft)||0),O((m==null?void 0:m.getBoundingClientRect().width)||0)},T=m=>{S&&!u&&U(w.findIndex(j=>j.props.tabId===m)),s==null||s(De(m))},Ve=m=>{if(I!=null&&I.current){const{scrollLeft:j}=I.current,M=m==="left"?-200:B;I.current.scroll({left:j+M,behavior:"smooth"})}},se=({side:m})=>d.jsx("button",{className:P(`${R}__scroll-button`,`${R}__scroll-button--${m}`),onClick:()=>Ve(m),type:"button","aria-hidden":"true",tabIndex:-1,"data-testid":G("scroll-button"),children:d.jsx(_e,{svg:m==="left"?et:tt,size:"md"})});return v.useEffect(()=>{const m=()=>{if(f.current&&i){const M=f.current.offsetHeight;g(M)}},j=()=>{m(),W()};return m(),window.addEventListener("resize",j),()=>{window.removeEventListener("resize",j)}},[V,i]),v.useEffect(()=>{W()},[V,o,w.length,t]),v.useEffect(()=>{const m=E=>{if(E.every(N=>N.isIntersecting)&&E.length===w.length){h({});return}E.forEach(N=>{const ie=Number(N.target.getAttribute("data-index")),Be=ie===0,Ue=ie===w.length-1;h(Ge=>({...Ge,...Be&&{[`${R}__wrapper--scroll-end`]:!N.isIntersecting},...Ue&&{[`${R}__wrapper--scroll-start`]:!N.isIntersecting}}))})},j=new IntersectionObserver(m,{threshold:[.99],root:I.current}),M=D.current;return M.forEach(E=>j.observe(E)),()=>{M.forEach(E=>j.unobserve(E))}},[w.length]),d.jsx(Et,{defaultValue:c??w[0].props.tabId,onValueChange:T,"data-testid":l,className:Y,value:u,..._,children:d.jsxs("div",{className:P(`${R}__container`),children:[d.jsxs("div",{className:P([`${R}__wrapper`,p]),children:[d.jsxs(At,{ref:m=>{I.current=m},className:P(`${R}__list`),children:[v.Children.map(w,(m,j)=>{const{name:M,tabId:E,"data-testid":ce}=m.props;return d.jsx(Wt,{"data-testid":G("header",ce),index:j,tabId:E,ref:N=>{N&&(D.current[j]=N)},onFocus:N=>{Kt(N.target,I.current)},variant:t,negative:n,children:M})}),S&&d.jsx("div",{className:P(`${R}__selected-border`),style:{width:C,transform:`translateX(${y}px)`},"data-testid":G("selected-border")})]}),d.jsx(se,{side:"left"}),d.jsx(se,{side:"right"})]}),d.jsx("div",{className:i?P(`${R}__content-wrapper`):"",style:{height:i&&b>-1?`${b}px`:"auto"},children:d.jsx("div",{ref:f,className:P(`${R}__content-container`),children:v.Children.map(w,m=>m)})})]})})};Le.Content=Vt;exports.Tabs=Le;exports.createTabChangeDetailEvent=De;exports.tabsVariants=qt;
|
|
10
10
|
//# sourceMappingURL=tabs.cjs.js.map
|
package/dist/tabs.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as m, Fragment as
|
|
1
|
+
import { jsx as m, Fragment as ze, jsxs as J } from "react/jsx-runtime";
|
|
2
2
|
import * as a from "react";
|
|
3
|
-
import O, { forwardRef as we, isValidElement as Ye, useRef as Q, useState as B, Children as
|
|
3
|
+
import O, { forwardRef as we, isValidElement as Ye, useRef as Q, useState as B, Children as K, useEffect as q } from "react";
|
|
4
4
|
import "react-dom";
|
|
5
5
|
function Ze(e) {
|
|
6
6
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
@@ -193,7 +193,7 @@ var ne = a.forwardRef((e, t) => {
|
|
|
193
193
|
return a.Children.count(n) > 1 ? a.Children.only(null) : null;
|
|
194
194
|
});
|
|
195
195
|
ne.displayName = "SlotClone";
|
|
196
|
-
var at = ({ children: e }) => /* @__PURE__ */ m(
|
|
196
|
+
var at = ({ children: e }) => /* @__PURE__ */ m(ze, { children: e });
|
|
197
197
|
function ut(e) {
|
|
198
198
|
return a.isValidElement(e) && e.type === at;
|
|
199
199
|
}
|
|
@@ -511,19 +511,19 @@ function jt(e) {
|
|
|
511
511
|
}
|
|
512
512
|
});
|
|
513
513
|
return a.useEffect(() => {
|
|
514
|
-
const u =
|
|
514
|
+
const u = z(o.current);
|
|
515
515
|
r.current = c === "mounted" ? u : "none";
|
|
516
516
|
}, [c]), re(() => {
|
|
517
517
|
const u = o.current, _ = s.current;
|
|
518
518
|
if (_ !== e) {
|
|
519
|
-
const v = r.current, b =
|
|
519
|
+
const v = r.current, b = z(u);
|
|
520
520
|
e ? l("MOUNT") : b === "none" || (u == null ? void 0 : u.display) === "none" ? l("UNMOUNT") : l(_ && v !== b ? "ANIMATION_OUT" : "UNMOUNT"), s.current = e;
|
|
521
521
|
}
|
|
522
522
|
}, [e, l]), re(() => {
|
|
523
523
|
if (t) {
|
|
524
524
|
let u;
|
|
525
525
|
const _ = t.ownerDocument.defaultView ?? window, d = (b) => {
|
|
526
|
-
const g =
|
|
526
|
+
const g = z(o.current).includes(b.animationName);
|
|
527
527
|
if (b.target === t && g && (l("ANIMATION_END"), !s.current)) {
|
|
528
528
|
const y = t.style.animationFillMode;
|
|
529
529
|
t.style.animationFillMode = "forwards", u = _.setTimeout(() => {
|
|
@@ -531,7 +531,7 @@ function jt(e) {
|
|
|
531
531
|
});
|
|
532
532
|
}
|
|
533
533
|
}, v = (b) => {
|
|
534
|
-
b.target === t && (r.current =
|
|
534
|
+
b.target === t && (r.current = z(o.current));
|
|
535
535
|
};
|
|
536
536
|
return t.addEventListener("animationstart", v), t.addEventListener("animationcancel", d), t.addEventListener("animationend", d), () => {
|
|
537
537
|
_.clearTimeout(u), t.removeEventListener("animationstart", v), t.removeEventListener("animationcancel", d), t.removeEventListener("animationend", d);
|
|
@@ -545,7 +545,7 @@ function jt(e) {
|
|
|
545
545
|
}, [])
|
|
546
546
|
};
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function z(e) {
|
|
549
549
|
return (e == null ? void 0 : e.animationName) || "none";
|
|
550
550
|
}
|
|
551
551
|
function Mt(e) {
|
|
@@ -765,13 +765,13 @@ const ue = /* @__PURE__ */ Vt(Ut), Gt = {
|
|
|
765
765
|
children: e
|
|
766
766
|
}
|
|
767
767
|
)
|
|
768
|
-
),
|
|
769
|
-
"purpur-tab-header": "_purpur-tab-
|
|
770
|
-
"purpur-tab-header--contained": "_purpur-tab-header--
|
|
771
|
-
"purpur-tab-header--contained-negative": "_purpur-tab-header--contained-
|
|
772
|
-
"purpur-tab-header--line": "_purpur-tab-header--
|
|
773
|
-
"purpur-tab-header--line-negative": "_purpur-tab-header--line-
|
|
774
|
-
},
|
|
768
|
+
), Kt = (e) => !!e && Ye(e) && !!e.props.name && !!e.props.tabId, qt = {
|
|
769
|
+
"purpur-tab-header": "_purpur-tab-header_ebsfx_1",
|
|
770
|
+
"purpur-tab-header--contained": "_purpur-tab-header--contained_ebsfx_36",
|
|
771
|
+
"purpur-tab-header--contained-negative": "_purpur-tab-header--contained-negative_ebsfx_36",
|
|
772
|
+
"purpur-tab-header--line": "_purpur-tab-header--line_ebsfx_39",
|
|
773
|
+
"purpur-tab-header--line-negative": "_purpur-tab-header--line-negative_ebsfx_51"
|
|
774
|
+
}, zt = ue.bind(qt), he = "purpur-tab-header", Yt = we(
|
|
775
775
|
({
|
|
776
776
|
index: e,
|
|
777
777
|
tabId: t,
|
|
@@ -784,7 +784,7 @@ const ue = /* @__PURE__ */ Vt(Ut), Gt = {
|
|
|
784
784
|
Dt,
|
|
785
785
|
{
|
|
786
786
|
id: `${t}-trigger`,
|
|
787
|
-
className:
|
|
787
|
+
className: zt([he, `${he}--${n}${o ? "-negative" : ""}`]),
|
|
788
788
|
value: t,
|
|
789
789
|
"data-testid": r,
|
|
790
790
|
"data-index": e,
|
|
@@ -829,16 +829,16 @@ const ue = /* @__PURE__ */ Vt(Ut), Gt = {
|
|
|
829
829
|
value: u,
|
|
830
830
|
..._
|
|
831
831
|
}) => {
|
|
832
|
-
const d = Q(null), [v, b] = B(-1), [f, g] = B({}), [y, h] = B(0), [w, j] = B(0), C =
|
|
832
|
+
const d = Q(null), [v, b] = B(-1), [f, g] = B({}), [y, h] = B(0), [w, j] = B(0), C = K.toArray(e).filter(Kt), N = Q(null), D = Q(new Array(C.length)), U = 200, I = t === "line", H = P([
|
|
833
833
|
R,
|
|
834
834
|
`${R}--${t}${n ? "-negative" : ""}`,
|
|
835
835
|
{ [`${R}--fullWidth`]: o },
|
|
836
836
|
r
|
|
837
|
-
]), F =
|
|
837
|
+
]), F = K.map(C, ({ props: { tabId: p } }) => p), L = () => {
|
|
838
838
|
const p = F.findIndex((S) => S === i);
|
|
839
839
|
return p >= 0 ? p : 0;
|
|
840
840
|
};
|
|
841
|
-
|
|
841
|
+
q(() => {
|
|
842
842
|
u && G(C.findIndex((p) => p.props.tabId === u));
|
|
843
843
|
}, [C, u]);
|
|
844
844
|
const [V, G] = B(L);
|
|
@@ -868,7 +868,7 @@ const ue = /* @__PURE__ */ Vt(Ut), Gt = {
|
|
|
868
868
|
children: /* @__PURE__ */ m(Ce, { svg: p === "left" ? st : it, size: "md" })
|
|
869
869
|
}
|
|
870
870
|
);
|
|
871
|
-
return
|
|
871
|
+
return q(() => {
|
|
872
872
|
const p = () => {
|
|
873
873
|
if (d.current && c) {
|
|
874
874
|
const M = d.current.offsetHeight;
|
|
@@ -880,22 +880,22 @@ const ue = /* @__PURE__ */ Vt(Ut), Gt = {
|
|
|
880
880
|
return p(), window.addEventListener("resize", S), () => {
|
|
881
881
|
window.removeEventListener("resize", S);
|
|
882
882
|
};
|
|
883
|
-
}, [V, c]),
|
|
883
|
+
}, [V, c]), q(() => {
|
|
884
884
|
k();
|
|
885
|
-
}, [V, o, C.length, t]),
|
|
885
|
+
}, [V, o, C.length, t]), q(() => {
|
|
886
886
|
const p = (E) => {
|
|
887
887
|
if (E.every((T) => T.isIntersecting) && E.length === C.length) {
|
|
888
888
|
g({});
|
|
889
889
|
return;
|
|
890
890
|
}
|
|
891
891
|
E.forEach((T) => {
|
|
892
|
-
const fe = Number(T.target.getAttribute("data-index")), ke = fe === 0,
|
|
893
|
-
g((
|
|
894
|
-
...
|
|
892
|
+
const fe = Number(T.target.getAttribute("data-index")), ke = fe === 0, Ke = fe === C.length - 1;
|
|
893
|
+
g((qe) => ({
|
|
894
|
+
...qe,
|
|
895
895
|
...ke && {
|
|
896
896
|
[`${R}__wrapper--scroll-end`]: !T.isIntersecting
|
|
897
897
|
},
|
|
898
|
-
...
|
|
898
|
+
...Ke && {
|
|
899
899
|
[`${R}__wrapper--scroll-start`]: !T.isIntersecting
|
|
900
900
|
}
|
|
901
901
|
}));
|
|
@@ -926,7 +926,7 @@ const ue = /* @__PURE__ */ Vt(Ut), Gt = {
|
|
|
926
926
|
},
|
|
927
927
|
className: P(`${R}__list`),
|
|
928
928
|
children: [
|
|
929
|
-
|
|
929
|
+
K.map(C, (p, S) => {
|
|
930
930
|
const { name: M, tabId: E, "data-testid": de } = p.props;
|
|
931
931
|
return /* @__PURE__ */ m(
|
|
932
932
|
Yt,
|
|
@@ -968,7 +968,7 @@ const ue = /* @__PURE__ */ Vt(Ut), Gt = {
|
|
|
968
968
|
{
|
|
969
969
|
className: c ? P(`${R}__content-wrapper`) : "",
|
|
970
970
|
style: { height: c && v > -1 ? `${v}px` : "auto" },
|
|
971
|
-
children: /* @__PURE__ */ m("div", { ref: d, className: P(`${R}__content-container`), children:
|
|
971
|
+
children: /* @__PURE__ */ m("div", { ref: d, className: P(`${R}__content-container`), children: K.map(C, (p) => p) })
|
|
972
972
|
}
|
|
973
973
|
)
|
|
974
974
|
] })
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@purpurds/tabs",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.5.0",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"main": "./dist/tabs.cjs.js",
|
|
6
6
|
"types": "./dist/tabs.d.ts",
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"classnames": "~2.5.0",
|
|
19
19
|
"@radix-ui/react-tabs": "~1.1.3",
|
|
20
|
-
"@purpurds/tokens": "7.
|
|
21
|
-
"@purpurds/
|
|
22
|
-
"@purpurds/
|
|
20
|
+
"@purpurds/tokens": "7.5.0",
|
|
21
|
+
"@purpurds/paragraph": "7.5.0",
|
|
22
|
+
"@purpurds/icon": "7.5.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"eslint": "9.24.0",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"typescript": "^5.6.3",
|
|
41
41
|
"vite": "^6.2.1",
|
|
42
42
|
"vitest": "^3.1.2",
|
|
43
|
-
"@purpurds/icon": "7.3.1",
|
|
44
43
|
"@purpurds/component-rig": "1.0.0",
|
|
45
|
-
"@purpurds/button": "7.
|
|
46
|
-
"@purpurds/
|
|
44
|
+
"@purpurds/button": "7.5.0",
|
|
45
|
+
"@purpurds/icon": "7.5.0",
|
|
46
|
+
"@purpurds/paragraph": "7.5.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@types/react": "^18 || ^19",
|