@purpurds/tabs 6.11.1 → 6.12.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 +1 -1
- package/dist/styles.css +1 -1
- package/dist/tab-content.d.ts.map +1 -1
- package/dist/tab-header.d.ts.map +1 -1
- package/dist/tabs.cjs.js +3 -3
- package/dist/tabs.cjs.js.map +1 -1
- package/dist/tabs.d.ts +4 -0
- package/dist/tabs.d.ts.map +1 -1
- package/dist/tabs.es.js +390 -371
- package/dist/tabs.es.js.map +1 -1
- package/package.json +8 -6
- package/src/tab-content.tsx +5 -7
- package/src/tab-header.tsx +7 -2
- package/src/tabs.module.scss +20 -3
- package/src/tabs.stories.tsx +46 -3
- package/src/tabs.tsx +38 -7
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-header_18g3c_1{position:relative;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_18g3c_1[aria-selected=true]{cursor:auto}._purpur-tab-header_18g3c_1:focus-visible{outline:0}._purpur-tab-header_18g3c_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_18g3c_33:focus-visible:after,._purpur-tab-header--contained-negative_18g3c_33:focus-visible:after{top:calc(-1 * var(--purpur-border-width-sm))}._purpur-tab-header--line_18g3c_36{color:var(--purpur-color-text-interactive-primary);background:var(--purpur-color-functional-transparent)}._purpur-tab-header--line_18g3c_36:not(._purpur-tab-header_18g3c_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_18g3c_36:not(._purpur-tab-header_18g3c_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_18g3c_48{color:var(--purpur-color-text-interactive-primary-negative);background:var(--purpur-color-functional-transparent)}._purpur-tab-header--line-negative_18g3c_48:not(._purpur-tab-header_18g3c_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_18g3c_48:not(._purpur-tab-header_18g3c_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_18g3c_33{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_18g3c_33._purpur-tab-header_18g3c_1[aria-selected=true]{border-color:var(--purpur-color-border-interactive-primary);background:var(--purpur-color-background-primary)}._purpur-tab-header--contained_18g3c_33:not(._purpur-tab-header_18g3c_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_18g3c_33:not(._purpur-tab-header_18g3c_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_18g3c_33{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_18g3c_33._purpur-tab-header_18g3c_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_18g3c_33:not(._purpur-tab-header_18g3c_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_18g3c_33:not(._purpur-tab-header_18g3c_1[aria-selected=true]):active{color:var(--purpur-color-text-interactive-primary-negative-active);background:var(--purpur-color-background-interactive-transparent-negative-active)}._purpur-
|
|
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_18g3c_1{position:relative;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_18g3c_1[aria-selected=true]{cursor:auto}._purpur-tab-header_18g3c_1:focus-visible{outline:0}._purpur-tab-header_18g3c_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_18g3c_33:focus-visible:after,._purpur-tab-header--contained-negative_18g3c_33:focus-visible:after{top:calc(-1 * var(--purpur-border-width-sm))}._purpur-tab-header--line_18g3c_36{color:var(--purpur-color-text-interactive-primary);background:var(--purpur-color-functional-transparent)}._purpur-tab-header--line_18g3c_36:not(._purpur-tab-header_18g3c_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_18g3c_36:not(._purpur-tab-header_18g3c_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_18g3c_48{color:var(--purpur-color-text-interactive-primary-negative);background:var(--purpur-color-functional-transparent)}._purpur-tab-header--line-negative_18g3c_48:not(._purpur-tab-header_18g3c_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_18g3c_48:not(._purpur-tab-header_18g3c_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_18g3c_33{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_18g3c_33._purpur-tab-header_18g3c_1[aria-selected=true]{border-color:var(--purpur-color-border-interactive-primary);background:var(--purpur-color-background-primary)}._purpur-tab-header--contained_18g3c_33:not(._purpur-tab-header_18g3c_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_18g3c_33:not(._purpur-tab-header_18g3c_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_18g3c_33{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_18g3c_33._purpur-tab-header_18g3c_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_18g3c_33:not(._purpur-tab-header_18g3c_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_18g3c_33:not(._purpur-tab-header_18g3c_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_1nygq_1{position:relative;-ms-overflow-style:none;scrollbar-width:none}._purpur-tabs__wrapper_1nygq_1 ::-webkit-scrollbar{display:none}._purpur-tabs__wrapper_1nygq_1 ._purpur-tabs__scroll-button_1nygq_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_1nygq_1 ._purpur-tabs__scroll-button_1nygq_9{transition:all var(--purpur-motion-duration-150) var(--purpur-motion-easing-ease-in-out)}}._purpur-tabs__wrapper_1nygq_1 ._purpur-tabs__scroll-button_1nygq_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_1nygq_1 ._purpur-tabs__scroll-button_1nygq_9:after{transition:all var(--purpur-motion-duration-150) var(--purpur-motion-easing-ease-in-out)}}._purpur-tabs__wrapper_1nygq_1 ._purpur-tabs__scroll-button_1nygq_9:hover{box-shadow:none;border-color:transparent;color:var(--purpur-color-text-interactive-primary-hover)}._purpur-tabs__wrapper_1nygq_1 ._purpur-tabs__scroll-button_1nygq_9:hover:after{opacity:1}._purpur-tabs__wrapper_1nygq_1 ._purpur-tabs__scroll-button_1nygq_9:active:after{border-width:var(--purpur-border-width-xs)}._purpur-tabs__wrapper_1nygq_1 ._purpur-tabs__scroll-button_1nygq_9:focus{outline:0}._purpur-tabs__wrapper_1nygq_1 ._purpur-tabs__scroll-button_1nygq_9:focus-visible{outline:0;border-color:var(--purpur-color-border-interactive-subtle);box-shadow:none}._purpur-tabs__wrapper_1nygq_1 ._purpur-tabs__scroll-button_1nygq_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_1nygq_1 ._purpur-tabs__scroll-button--left_1nygq_71{left:0}._purpur-tabs__wrapper_1nygq_1 ._purpur-tabs__scroll-button--right_1nygq_74{right:0}._purpur-tabs__wrapper--scroll-end_1nygq_77 ._purpur-tabs__scroll-button--left_1nygq_71,._purpur-tabs__wrapper--scroll-start_1nygq_80 ._purpur-tabs__scroll-button--right_1nygq_74{display:flex}._purpur-tabs--line_1nygq_83 ._purpur-tabs__wrapper_1nygq_1:after,._purpur-tabs--line-negative_1nygq_83 ._purpur-tabs__wrapper_1nygq_1:after{content:"";position:absolute;bottom:0;left:0;width:100%;height:var(--purpur-border-width-sm)}._purpur-tabs--line_1nygq_83 ._purpur-tabs__selected-border_1nygq_91,._purpur-tabs--line-negative_1nygq_83 ._purpur-tabs__selected-border_1nygq_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_1nygq_83 ._purpur-tabs__selected-border_1nygq_91,._purpur-tabs--line-negative_1nygq_83 ._purpur-tabs__selected-border_1nygq_91{transition:all var(--purpur-motion-duration-150) var(--purpur-motion-easing-ease-in-out)}}._purpur-tabs--line_1nygq_83 ._purpur-tabs__wrapper_1nygq_1:after{background:var(--purpur-color-border-weak)}._purpur-tabs--line_1nygq_83 ._purpur-tabs__selected-border_1nygq_91{background:var(--purpur-color-border-interactive-primary)}._purpur-tabs--line-negative_1nygq_83 ._purpur-tabs__wrapper_1nygq_1:after{background:var(--purpur-color-border-weak-negative)}._purpur-tabs--line-negative_1nygq_83 ._purpur-tabs__selected-border_1nygq_91{background:var(--purpur-color-border-interactive-primary-negative)}._purpur-tabs__content-wrapper_1nygq_115{overflow:hidden}@media (prefers-reduced-motion: no-preference){._purpur-tabs__content-wrapper_1nygq_115{transition:height var(--purpur-motion-duration-200) var(--purpur-motion-easing-ease-in-out)}}._purpur-tabs--contained_1nygq_123 ._purpur-tabs__list_1nygq_123,._purpur-tabs--contained-negative_1nygq_123 ._purpur-tabs__list_1nygq_123{gap:var(--purpur-spacing-100)}._purpur-tabs--contained_1nygq_123 ._purpur-tabs__content-container_1nygq_126,._purpur-tabs--contained-negative_1nygq_123 ._purpur-tabs__content-container_1nygq_126{background:var(--purpur-color-background-primary)}._purpur-tabs__list_1nygq_123{position:relative;display:inline-flex;max-width:100%;overflow:auto}._purpur-tabs--fullWidth_1nygq_135 ._purpur-tabs__list_1nygq_123{min-width:100%}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab-content.d.ts","sourceRoot":"","sources":["../src/tab-content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,wBAAwB,
|
|
1
|
+
{"version":3,"file":"tab-content.d.ts","sourceRoot":"","sources":["../src/tab-content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,KAAK,wBAAwB,EAI7B,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAMf,MAAM,MAAM,eAAe,GAAG;IAC5B;;SAEK;IACL,IAAI,EAAE,MAAM,CAAC;IACb;;SAEK;IACL,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,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;wCAiCtB,CAAC;AAEF,eAAO,MAAM,YAAY,WAAY,SAAS,KAAG,KAAK,IAAI,YAAY,CAAC,eAAe,CACU,CAAC"}
|
package/dist/tab-header.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab-header.d.ts","sourceRoot":"","sources":["../src/tab-header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"tab-header.d.ts","sourceRoot":"","sources":["../src/tab-header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,KAAK,iBAAiB,EAGtB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAKf,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,KAAK,cAAc,GAAG;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,WAAW,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAC9C,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAKF,eAAO,MAAM,SAAS,0FAyBrB,CAAC"}
|
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 Ge(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=Ge(v);function We(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 ie;function Be(){return ie||(ie=1,function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r="",i=0;i<arguments.length;i++){var c=arguments[i];c&&(r=s(r,o.call(this,c)))}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 i="";for(var c in r)t.call(r,c)&&r[c]&&(i=s(i,this&&this[c]||c));return i}function s(r,i){return i?r?r+" "+i:r+i:r}e.exports?(n.default=n,e.exports=n):window.classNames=n})()}(se)),se.exports}var Ue=Be();const Ge=Ve(Ue),We={"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"},ke=Ge.bind(We),ce="purpur-icon",Ke="md",ze=e=>e.filter(t=>Object.keys(t).length>=1).map(t=>`${t.name}="${t.value}"`).join(" "),Ye=({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 ${ze(n)}>${o}${e}</svg>`},Ze=e=>e.replace(/<(\/?)svg([^>]*)>/g,"").trim(),fe=({["data-testid"]:e,svg:t,allyTitle:n,className:o,size:s=Ke,...r})=>{const i=Ye({content:Ze(t.svg),title:n}),c=ke(o,ce,`${ce}--${s}`);return d.jsx("span",{"aria-label":n,className:c,"data-testid":e,dangerouslySetInnerHTML:{__html:i},...r})};fe.displayName="Icon";const Xe={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"},Je={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 E(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 Q(e,t=[]){let n=[];function o(r,i){const c=a.createContext(i),u=n.length;n=[...n,i];const l=f=>{var v;const{scope:b,children:h,...p}=f,C=((v=b==null?void 0:b[e])==null?void 0:v[u])||c,g=a.useMemo(()=>p,Object.values(p));return d.jsx(C.Provider,{value:g,children:h})};l.displayName=r+"Provider";function _(f,b){var C;const h=((C=b==null?void 0:b[e])==null?void 0:C[u])||c,p=a.useContext(h);if(p)return p;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${r}\``)}return[l,_]}const s=()=>{const r=n.map(i=>a.createContext(i));return function(c){const u=(c==null?void 0:c[e])||r;return a.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])}};return s.scopeName=e,[o,Qe(s,...t)]}function Qe(...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 i=o.reduce((c,{useScope:u,scopeName:l})=>{const f=u(r)[`__scope${l}`];return{...c,...f}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function ae(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function pe(...e){return t=>{let n=!1;const o=e.map(s=>{const r=ae(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():ae(e[s],null)}}}}function B(...e){return a.useCallback(pe(...e),e)}var U=a.forwardRef((e,t)=>{const{children:n,...o}=e,s=a.Children.toArray(n),r=s.find(et);if(r){const i=r.props.children,c=s.map(u=>u===r?a.Children.count(i)>1?a.Children.only(null):a.isValidElement(i)?i.props.children:null:u);return d.jsx(Z,{...o,ref:t,children:a.isValidElement(i)?a.cloneElement(i,void 0,c):null})}return d.jsx(Z,{...o,ref:t,children:n})});U.displayName="Slot";var Z=a.forwardRef((e,t)=>{const{children:n,...o}=e;if(a.isValidElement(n)){const s=nt(n),r=tt(o,n.props);return n.type!==a.Fragment&&(r.ref=t?pe(t,s):s),a.cloneElement(n,r)}return a.Children.count(n)>1?a.Children.only(null):null});Z.displayName="SlotClone";var He=({children:e})=>d.jsx(d.Fragment,{children:e});function et(e){return a.isValidElement(e)&&e.type===He}function tt(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]=(...c)=>{r(...c),s(...c)}:s&&(n[o]=s):o==="style"?n[o]={...s,...r}:o==="className"&&(n[o]=[s,r].filter(Boolean).join(" "))}return{...e,...n}}function nt(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 rt(e){const t=e+"CollectionProvider",[n,o]=Q(t),[s,r]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=h=>{const{scope:p,children:C}=h,g=y.useRef(null),v=y.useRef(new Map).current;return d.jsx(s,{scope:p,itemMap:v,collectionRef:g,children:C})};i.displayName=t;const c=e+"CollectionSlot",u=y.forwardRef((h,p)=>{const{scope:C,children:g}=h,v=r(c,C),w=B(p,v.collectionRef);return d.jsx(U,{ref:w,children:g})});u.displayName=c;const l=e+"CollectionItemSlot",_="data-radix-collection-item",f=y.forwardRef((h,p)=>{const{scope:C,children:g,...v}=h,w=y.useRef(null),A=B(p,w),N=r(l,C);return y.useEffect(()=>(N.itemMap.set(w,{ref:w,...v}),()=>void N.itemMap.delete(w))),d.jsx(U,{[_]:"",ref:A,children:g})});f.displayName=l;function b(h){const p=r(e+"CollectionConsumer",h);return y.useCallback(()=>{const g=p.collectionRef.current;if(!g)return[];const v=Array.from(g.querySelectorAll(`[${_}]`));return Array.from(p.itemMap.values()).sort((N,O)=>v.indexOf(N.ref.current)-v.indexOf(O.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:i,Slot:u,ItemSlot:f},b,o]}var X=globalThis!=null&&globalThis.document?a.useLayoutEffect:()=>{},ot=a.useId||(()=>{}),st=0;function me(e){const[t,n]=a.useState(ot());return X(()=>{n(o=>o??String(st++))},[e]),t?`radix-${t}`:""}var it=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],$=it.reduce((e,t)=>{const n=a.forwardRef((o,s)=>{const{asChild:r,...i}=o,c=r?U:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(c,{...i,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function H(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 ve({prop:e,defaultProp:t,onChange:n=()=>{}}){const[o,s]=ct({defaultProp:t,onChange:n}),r=e!==void 0,i=r?e:o,c=H(n),u=a.useCallback(l=>{if(r){const f=typeof l=="function"?l(e):l;f!==e&&c(f)}else s(l)},[r,e,s,c]);return[i,u]}function ct({defaultProp:e,onChange:t}){const n=a.useState(e),[o]=n,s=a.useRef(o),r=H(t);return a.useEffect(()=>{s.current!==o&&(r(o),s.current=o)},[o,s,r]),n}var at=a.createContext(void 0);function _e(e){const t=a.useContext(at);return e||t||"ltr"}var z="rovingFocusGroup.onEntryFocus",ut={bubbles:!1,cancelable:!0},G="RovingFocusGroup",[J,be,lt]=rt(G),[dt,ge]=Q(G,[lt]),[ft,pt]=dt(G),he=a.forwardRef((e,t)=>d.jsx(J.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(J.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx(mt,{...e,ref:t})})}));he.displayName=G;var mt=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:s=!1,dir:r,currentTabStopId:i,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:l,preventScrollOnEntryFocus:_=!1,...f}=e,b=a.useRef(null),h=B(t,b),p=_e(r),[C=null,g]=ve({prop:i,defaultProp:c,onChange:u}),[v,w]=a.useState(!1),A=H(l),N=be(n),O=a.useRef(!1),[D,q]=a.useState(0);return a.useEffect(()=>{const I=b.current;if(I)return I.addEventListener(z,A),()=>I.removeEventListener(z,A)},[A]),d.jsx(ft,{scope:n,orientation:o,dir:p,loop:s,currentTabStopId:C,onItemFocus:a.useCallback(I=>g(I),[g]),onItemShiftTab:a.useCallback(()=>w(!0),[]),onFocusableItemAdd:a.useCallback(()=>q(I=>I+1),[]),onFocusableItemRemove:a.useCallback(()=>q(I=>I-1),[]),children:d.jsx($.div,{tabIndex:v||D===0?-1:0,"data-orientation":o,...f,ref:h,style:{outline:"none",...e.style},onMouseDown:E(e.onMouseDown,()=>{O.current=!0}),onFocus:E(e.onFocus,I=>{const L=!O.current;if(I.target===I.currentTarget&&L&&!v){const j=new CustomEvent(z,ut);if(I.currentTarget.dispatchEvent(j),!j.defaultPrevented){const M=N().filter(x=>x.focusable),W=M.find(x=>x.active),k=M.find(x=>x.id===C),m=[W,k,...M].filter(Boolean).map(x=>x.ref.current);xe(m,_)}}O.current=!1}),onBlur:E(e.onBlur,()=>w(!1))})})}),ye="RovingFocusGroupItem",Ce=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:s=!1,tabStopId:r,...i}=e,c=me(),u=r||c,l=pt(ye,n),_=l.currentTabStopId===u,f=be(n),{onFocusableItemAdd:b,onFocusableItemRemove:h}=l;return a.useEffect(()=>{if(o)return b(),()=>h()},[o,b,h]),d.jsx(J.ItemSlot,{scope:n,id:u,focusable:o,active:s,children:d.jsx($.span,{tabIndex:_?0:-1,"data-orientation":l.orientation,...i,ref:t,onMouseDown:E(e.onMouseDown,p=>{o?l.onItemFocus(u):p.preventDefault()}),onFocus:E(e.onFocus,()=>l.onItemFocus(u)),onKeyDown:E(e.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){l.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const C=bt(p,l.orientation,l.dir);if(C!==void 0){if(p.metaKey||p.ctrlKey||p.altKey||p.shiftKey)return;p.preventDefault();let v=f().filter(w=>w.focusable).map(w=>w.ref.current);if(C==="last")v.reverse();else if(C==="prev"||C==="next"){C==="prev"&&v.reverse();const w=v.indexOf(p.currentTarget);v=l.loop?gt(v,w+1):v.slice(w+1)}setTimeout(()=>xe(v))}})})})});Ce.displayName=ye;var vt={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function _t(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function bt(e,t,n){const o=_t(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return vt[o]}function xe(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function gt(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var ht=he,yt=Ce;function Ct(e,t){return a.useReducer((n,o)=>t[n][o]??n,e)}var we=e=>{const{present:t,children:n}=e,o=xt(t),s=typeof n=="function"?n({present:o.isPresent}):a.Children.only(n),r=B(o.ref,wt(s));return typeof n=="function"||o.isPresent?a.cloneElement(s,{ref:r}):null};we.displayName="Presence";function xt(e){const[t,n]=a.useState(),o=a.useRef({}),s=a.useRef(e),r=a.useRef("none"),i=e?"mounted":"unmounted",[c,u]=Ct(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const l=V(o.current);r.current=c==="mounted"?l:"none"},[c]),X(()=>{const l=o.current,_=s.current;if(_!==e){const b=r.current,h=V(l);e?u("MOUNT"):h==="none"||(l==null?void 0:l.display)==="none"?u("UNMOUNT"):u(_&&b!==h?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,u]),X(()=>{if(t){let l;const _=t.ownerDocument.defaultView??window,f=h=>{const C=V(o.current).includes(h.animationName);if(h.target===t&&C&&(u("ANIMATION_END"),!s.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",l=_.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},b=h=>{h.target===t&&(r.current=V(o.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{_.clearTimeout(l),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:a.useCallback(l=>{l&&(o.current=getComputedStyle(l)),n(l)},[])}}function V(e){return(e==null?void 0:e.animationName)||"none"}function wt(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 ee="Tabs",[It,Gt]=Q(ee,[ge]),Ie=ge(),[St,te]=It(ee),Se=a.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:s,defaultValue:r,orientation:i="horizontal",dir:c,activationMode:u="automatic",...l}=e,_=_e(c),[f,b]=ve({prop:o,onChange:s,defaultProp:r});return d.jsx(St,{scope:n,baseId:me(),value:f,onValueChange:b,orientation:i,dir:_,activationMode:u,children:d.jsx($.div,{dir:_,"data-orientation":i,...l,ref:t})})});Se.displayName=ee;var Ne="TabsList",Re=a.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...s}=e,r=te(Ne,n),i=Ie(n);return d.jsx(ht,{asChild:!0,...i,orientation:r.orientation,dir:r.dir,loop:o,children:d.jsx($.div,{role:"tablist","aria-orientation":r.orientation,...s,ref:t})})});Re.displayName=Ne;var Te="TabsTrigger",Ee=a.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:s=!1,...r}=e,i=te(Te,n),c=Ie(n),u=Me(i.baseId,o),l=Pe(i.baseId,o),_=o===i.value;return d.jsx(yt,{asChild:!0,...c,focusable:!s,active:_,children:d.jsx($.button,{type:"button",role:"tab","aria-selected":_,"aria-controls":l,"data-state":_?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:u,...r,ref:t,onMouseDown:E(e.onMouseDown,f=>{!s&&f.button===0&&f.ctrlKey===!1?i.onValueChange(o):f.preventDefault()}),onKeyDown:E(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&i.onValueChange(o)}),onFocus:E(e.onFocus,()=>{const f=i.activationMode!=="manual";!_&&!s&&f&&i.onValueChange(o)})})})});Ee.displayName=Te;var Ae="TabsContent",Oe=a.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,forceMount:s,children:r,...i}=e,c=te(Ae,n),u=Me(c.baseId,o),l=Pe(c.baseId,o),_=o===c.value,f=a.useRef(_);return a.useEffect(()=>{const b=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(b)},[]),d.jsx(we,{present:s||_,children:({present:b})=>d.jsx($.div,{"data-state":_?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!b,id:l,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:b&&r})})});Oe.displayName=Ae;function Me(e,t){return`${e}-trigger-${t}`}function Pe(e,t){return`${e}-content-${t}`}var Nt=Se,Rt=Re,Tt=Ee,Et=Oe;function At(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Y={exports:{}};/*!
|
|
5
|
+
*/var ue;function ke(){return ue||(ue=1,function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r="",i=0;i<arguments.length;i++){var c=arguments[i];c&&(r=s(r,o.call(this,c)))}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 i="";for(var c in r)t.call(r,c)&&r[c]&&(i=s(i,this&&this[c]||c));return i}function s(r,i){return i?r?r+" "+i:r+i:r}e.exports?(n.default=n,e.exports=n):window.classNames=n})()}(ae)),ae.exports}var Ke=ke();const ze=We(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",He="md",Xe=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 ${Xe(n)}>${o}${e}</svg>`},Qe=e=>e.replace(/<(\/?)svg([^>]*)>/g,"").trim(),ge=({["data-testid"]:e,svg:t,allyTitle:n,className:o,size:s=He,...r})=>{const i=Je({content:Qe(t.svg),title:n}),c=Ze(o,le,`${le}--${s}`);return d.jsx("span",{"aria-label":n,className:c,"data-testid":e,dangerouslySetInnerHTML:{__html:i},...r})};ge.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 O(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,i){const c=a.createContext(i),l=n.length;n=[...n,i];const u=f=>{var y;const{scope:_,children:b,...p}=f,h=((y=_==null?void 0:_[e])==null?void 0:y[l])||c,x=a.useMemo(()=>p,Object.values(p));return d.jsx(h.Provider,{value:x,children:b})};u.displayName=r+"Provider";function g(f,_){var h;const b=((h=_==null?void 0:_[e])==null?void 0:h[l])||c,p=a.useContext(b);if(p)return p;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${r}\``)}return[u,g]}const s=()=>{const r=n.map(i=>a.createContext(i));return function(c){const l=(c==null?void 0:c[e])||r;return a.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,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 i=o.reduce((c,{useScope:l,scopeName:u})=>{const f=l(r)[`__scope${u}`];return{...c,...f}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function de(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function _e(...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 k(...e){return a.useCallback(_e(...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 i=r.props.children,c=s.map(l=>l===r?a.Children.count(i)>1?a.Children.only(null):a.isValidElement(i)?i.props.children:null:l);return d.jsx(X,{...o,ref:t,children:a.isValidElement(i)?a.cloneElement(i,void 0,c):null})}return d.jsx(X,{...o,ref:t,children:n})});K.displayName="Slot";var X=a.forwardRef((e,t)=>{const{children:n,...o}=e;if(a.isValidElement(n)){const s=it(n),r=st(o,n.props);return n.type!==a.Fragment&&(r.ref=t?_e(t,s):s),a.cloneElement(n,r)}return a.Children.count(n)>1?a.Children.only(null):null});X.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]=(...c)=>{r(...c),s(...c)}:s&&(n[o]=s):o==="style"?n[o]={...s,...r}:o==="className"&&(n[o]=[s,r].filter(Boolean).join(" "))}return{...e,...n}}function it(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 ct(e){const t=e+"CollectionProvider",[n,o]=ee(t),[s,r]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=b=>{const{scope:p,children:h}=b,x=v.useRef(null),y=v.useRef(new Map).current;return d.jsx(s,{scope:p,itemMap:y,collectionRef:x,children:h})};i.displayName=t;const c=e+"CollectionSlot",l=v.forwardRef((b,p)=>{const{scope:h,children:x}=b,y=r(c,h),C=k(p,y.collectionRef);return d.jsx(K,{ref:C,children:x})});l.displayName=c;const u=e+"CollectionItemSlot",g="data-radix-collection-item",f=v.forwardRef((b,p)=>{const{scope:h,children:x,...y}=b,C=v.useRef(null),M=k(p,C),w=r(u,h);return v.useEffect(()=>(w.itemMap.set(C,{ref:C,...y}),()=>void w.itemMap.delete(C))),d.jsx(K,{[g]:"",ref:M,children:x})});f.displayName=u;function _(b){const p=r(e+"CollectionConsumer",b);return v.useCallback(()=>{const x=p.collectionRef.current;if(!x)return[];const y=Array.from(x.querySelectorAll(`[${g}]`));return Array.from(p.itemMap.values()).sort((w,R)=>y.indexOf(w.ref.current)-y.indexOf(R.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:i,Slot:l,ItemSlot:f},_,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,...i}=o,c=r?K:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(c,{...i,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 be({prop:e,defaultProp:t,onChange:n=()=>{}}){const[o,s]=dt({defaultProp:t,onChange:n}),r=e!==void 0,i=r?e:o,c=te(n),l=a.useCallback(u=>{if(r){const f=typeof u=="function"?u(e):u;f!==e&&c(f)}else s(u)},[r,e,s,c]);return[i,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,ye,mt]=ct(z),[gt,Ce]=ee(z,[mt]),[_t,vt]=gt(z),we=a.forwardRef((e,t)=>d.jsx(Q.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(Q.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx(bt,{...e,ref:t})})}));we.displayName=z;var bt=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:s=!1,dir:r,currentTabStopId:i,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:g=!1,...f}=e,_=a.useRef(null),b=k(t,_),p=he(r),[h=null,x]=be({prop:i,defaultProp:c,onChange:l}),[y,C]=a.useState(!1),M=te(u),w=ye(n),R=a.useRef(!1),[D,V]=a.useState(0);return a.useEffect(()=>{const S=_.current;if(S)return S.addEventListener(Z,M),()=>S.removeEventListener(Z,M)},[M]),d.jsx(_t,{scope:n,orientation:o,dir:p,loop:s,currentTabStopId:h,onItemFocus:a.useCallback(S=>x(S),[x]),onItemShiftTab:a.useCallback(()=>C(!0),[]),onFocusableItemAdd:a.useCallback(()=>V(S=>S+1),[]),onFocusableItemRemove:a.useCallback(()=>V(S=>S-1),[]),children:d.jsx($.div,{tabIndex:y||D===0?-1:0,"data-orientation":o,...f,ref:b,style:{outline:"none",...e.style},onMouseDown:O(e.onMouseDown,()=>{R.current=!0}),onFocus:O(e.onFocus,S=>{const Y=!R.current;if(S.target===S.currentTarget&&Y&&!y){const F=new CustomEvent(Z,pt);if(S.currentTarget.dispatchEvent(F),!F.defaultPrevented){const q=w().filter(E=>E.focusable),L=q.find(E=>E.active),B=q.find(E=>E.id===h),G=[L,B,...q].filter(Boolean).map(E=>E.ref.current);Ie(G,g)}}R.current=!1}),onBlur:O(e.onBlur,()=>C(!1))})})}),xe="RovingFocusGroupItem",Se=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:s=!1,tabStopId:r,...i}=e,c=ve(),l=r||c,u=vt(xe,n),g=u.currentTabStopId===l,f=ye(n),{onFocusableItemAdd:_,onFocusableItemRemove:b}=u;return a.useEffect(()=>{if(o)return _(),()=>b()},[o,_,b]),d.jsx(Q.ItemSlot,{scope:n,id:l,focusable:o,active:s,children:d.jsx($.span,{tabIndex:g?0:-1,"data-orientation":u.orientation,...i,ref:t,onMouseDown:O(e.onMouseDown,p=>{o?u.onItemFocus(l):p.preventDefault()}),onFocus:O(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:O(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 y=f().filter(C=>C.focusable).map(C=>C.ref.current);if(h==="last")y.reverse();else if(h==="prev"||h==="next"){h==="prev"&&y.reverse();const C=y.indexOf(p.currentTarget);y=u.loop?wt(y,C+1):y.slice(C+1)}setTimeout(()=>Ie(y))}})})})});Se.displayName=xe;var ht={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function yt(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Ct(e,t,n){const o=yt(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return ht[o]}function Ie(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 xt=we,St=Se;function It(e,t){return a.useReducer((n,o)=>t[n][o]??n,e)}var Re=e=>{const{present:t,children:n}=e,o=Rt(t),s=typeof n=="function"?n({present:o.isPresent}):a.Children.only(n),r=k(o.ref,Nt(s));return typeof n=="function"||o.isPresent?a.cloneElement(s,{ref:r}):null};Re.displayName="Presence";function Rt(e){const[t,n]=a.useState(),o=a.useRef({}),s=a.useRef(e),r=a.useRef("none"),i=e?"mounted":"unmounted",[c,l]=It(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const u=W(o.current);r.current=c==="mounted"?u:"none"},[c]),J(()=>{const u=o.current,g=s.current;if(g!==e){const _=r.current,b=W(u);e?l("MOUNT"):b==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(g&&_!==b?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,l]),J(()=>{if(t){let u;const g=t.ownerDocument.defaultView??window,f=b=>{const h=W(o.current).includes(b.animationName);if(b.target===t&&h&&(l("ANIMATION_END"),!s.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},_=b=>{b.target===t&&(r.current=W(o.current))};return t.addEventListener("animationstart",_),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{g.clearTimeout(u),t.removeEventListener("animationstart",_),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:a.useCallback(u=>{u&&(o.current=getComputedStyle(u)),n(u)},[])}}function W(e){return(e==null?void 0:e.animationName)||"none"}function Nt(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",[Tt,zt]=ee(ne,[Ce]),Ne=Ce(),[Et,re]=Tt(ne),Te=a.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:s,defaultValue:r,orientation:i="horizontal",dir:c,activationMode:l="automatic",...u}=e,g=he(c),[f,_]=be({prop:o,onChange:s,defaultProp:r});return d.jsx(Et,{scope:n,baseId:ve(),value:f,onValueChange:_,orientation:i,dir:g,activationMode:l,children:d.jsx($.div,{dir:g,"data-orientation":i,...u,ref:t})})});Te.displayName=ne;var Ee="TabsList",Ae=a.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...s}=e,r=re(Ee,n),i=Ne(n);return d.jsx(xt,{asChild:!0,...i,orientation:r.orientation,dir:r.dir,loop:o,children:d.jsx($.div,{role:"tablist","aria-orientation":r.orientation,...s,ref:t})})});Ae.displayName=Ee;var Oe="TabsTrigger",Me=a.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:s=!1,...r}=e,i=re(Oe,n),c=Ne(n),l=Fe(i.baseId,o),u=$e(i.baseId,o),g=o===i.value;return d.jsx(St,{asChild:!0,...c,focusable:!s,active:g,children:d.jsx($.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":u,"data-state":g?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:l,...r,ref:t,onMouseDown:O(e.onMouseDown,f=>{!s&&f.button===0&&f.ctrlKey===!1?i.onValueChange(o):f.preventDefault()}),onKeyDown:O(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&i.onValueChange(o)}),onFocus:O(e.onFocus,()=>{const f=i.activationMode!=="manual";!g&&!s&&f&&i.onValueChange(o)})})})});Me.displayName=Oe;var Pe="TabsContent",je=a.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,forceMount:s,children:r,...i}=e,c=re(Pe,n),l=Fe(c.baseId,o),u=$e(c.baseId,o),g=o===c.value,f=a.useRef(g);return a.useEffect(()=>{const _=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(_)},[]),d.jsx(Re,{present:s||g,children:({present:_})=>d.jsx($.div,{"data-state":g?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":l,hidden:!_,id:u,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:_&&r})})});je.displayName=Pe;function Fe(e,t){return`${e}-trigger-${t}`}function $e(e,t){return`${e}-content-${t}`}var At=Te,Ot=Ae,Mt=Me,Pt=je;function jt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var H={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
|
|
9
|
+
*/var fe;function Ft(){return fe||(fe=1,function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r="",i=0;i<arguments.length;i++){var c=arguments[i];c&&(r=s(r,o.call(this,c)))}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 i="";for(var c in r)t.call(r,c)&&r[c]&&(i=s(i,this&&this[c]||c));return i}function s(r,i){return i?r?r+" "+i:r+i:r}e.exports?(n.default=n,e.exports=n):window.classNames=n})()}(H)),H.exports}var $t=Ft();const oe=jt($t),Dt={"purpur-tab-content":"_purpur-tab-content_1ugbi_1","purpur-tab-content--force-mount":"_purpur-tab-content--force-mount_1ugbi_15"},qt=oe.bind(Dt),pe="purpur-tab-content",Lt=v.forwardRef(({children:e,tabId:t,"data-testid":n,className:o,disableForceMount:s,...r},i)=>d.jsx(Pt,{ref:i,className:qt([pe,o,{[`${pe}--force-mount`]:!s}]),"data-testid":n,value:t,forceMount:!s||void 0,...r,children:e})),Vt=e=>!!e&&v.isValidElement(e)&&!!e.props.name&&!!e.props.tabId,Bt={"purpur-tab-header":"_purpur-tab-header_18g3c_1","purpur-tab-header--contained":"_purpur-tab-header--contained_18g3c_33","purpur-tab-header--contained-negative":"_purpur-tab-header--contained-negative_18g3c_33","purpur-tab-header--line":"_purpur-tab-header--line_18g3c_36","purpur-tab-header--line-negative":"_purpur-tab-header--line-negative_18g3c_48"},Ut=oe.bind(Bt),me="purpur-tab-header",Gt=v.forwardRef(({index:e,tabId:t,variant:n,negative:o,onFocus:s,"data-testid":r,children:i},c)=>d.jsx(Mt,{id:`${t}-trigger`,className:Ut([me,`${me}--${n}${o?"-negative":""}`]),value:t,"data-testid":r,"data-index":e,ref:c,onFocus:s,children:i})),Wt={"purpur-tabs__wrapper":"_purpur-tabs__wrapper_1nygq_1","purpur-tabs__scroll-button":"_purpur-tabs__scroll-button_1nygq_9","purpur-tabs__scroll-button--left":"_purpur-tabs__scroll-button--left_1nygq_71","purpur-tabs__scroll-button--right":"_purpur-tabs__scroll-button--right_1nygq_74","purpur-tabs__wrapper--scroll-end":"_purpur-tabs__wrapper--scroll-end_1nygq_77","purpur-tabs__wrapper--scroll-start":"_purpur-tabs__wrapper--scroll-start_1nygq_80","purpur-tabs--line":"_purpur-tabs--line_1nygq_83","purpur-tabs--line-negative":"_purpur-tabs--line-negative_1nygq_83","purpur-tabs__selected-border":"_purpur-tabs__selected-border_1nygq_91","purpur-tabs__content-wrapper":"_purpur-tabs__content-wrapper_1nygq_115","purpur-tabs--contained":"_purpur-tabs--contained_1nygq_123","purpur-tabs__list":"_purpur-tabs__list_1nygq_123","purpur-tabs--contained-negative":"_purpur-tabs--contained-negative_1nygq_123","purpur-tabs__content-container":"_purpur-tabs__content-container_1nygq_126","purpur-tabs--fullWidth":"_purpur-tabs--fullWidth_1nygq_135"},kt=["line","contained"],De=e=>new CustomEvent("tabChangeDetail",{detail:{value:e}}),j=oe.bind(Wt),N="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),i=o.left+(isNaN(r)?0:r);let c;n.right>o.right&&(c=n.left+t.scrollLeft,c=c+n.width-s+s*.1,c=c-i),n.left<o.left&&(c=n.left+t.scrollLeft,c=c-s*.1,c=c-i),c!==void 0&&t.scroll({left:c,behavior:"smooth"})},qe=({children:e,variant:t="line",negative:n=!1,fullWidth:o=!1,onChange:s,className:r,defaultValue:i,animateHeight:c=!1,"data-testid":l,value:u,...g})=>{const f=v.useRef(null),[_,b]=v.useState(-1),[p,h]=v.useState({}),[x,y]=v.useState(0),[C,M]=v.useState(0),w=v.Children.toArray(e).filter(Vt),R=v.useRef(null),D=v.useRef(new Array(w.length)),V=200,S=t==="line",Y=j([N,`${N}--${t}${n?"-negative":""}`,{[`${N}--fullWidth`]:o},r]),F=v.Children.map(w,({props:{tabId:m}})=>m),q=()=>{const m=F.findIndex(I=>I===i);return m>=0?m:0};v.useEffect(()=>{u&&B(w.findIndex(m=>m.props.tabId===u))},[w,u]);const[L,B]=v.useState(q);if(new Set(F).size!==F.length)throw new Error("tabId must be unique");const U=(m,I)=>I||l?`${I||l}-${m}`:void 0,G=()=>{if(!S)return;const m=D.current[L];y((m==null?void 0:m.offsetLeft)||0),M((m==null?void 0:m.getBoundingClientRect().width)||0)},E=m=>{S&&!u&&B(w.findIndex(I=>I.props.tabId===m)),s==null||s(De(m))},Le=m=>{if(R!=null&&R.current){const{scrollLeft:I}=R.current,P=m==="left"?-200:V;R.current.scroll({left:I+P,behavior:"smooth"})}},se=({side:m})=>d.jsx("button",{className:j(`${N}__scroll-button`,`${N}__scroll-button--${m}`),onClick:()=>Le(m),type:"button","aria-hidden":"true",tabIndex:-1,"data-testid":U("scroll-button"),children:d.jsx(ge,{svg:m==="left"?et:tt,size:"md"})});return v.useEffect(()=>{const m=()=>{if(f.current&&c){const P=f.current.offsetHeight;b(P)}},I=()=>{m(),G()};return m(),window.addEventListener("resize",I),()=>{window.removeEventListener("resize",I)}},[L,c]),v.useEffect(()=>{G()},[L,o,w.length,t]),v.useEffect(()=>{const m=A=>{if(A.every(T=>T.isIntersecting)&&A.length===w.length){h({});return}A.forEach(T=>{const ce=Number(T.target.getAttribute("data-index")),Ve=ce===0,Be=ce===w.length-1;h(Ue=>({...Ue,...Ve&&{[`${N}__wrapper--scroll-end`]:!T.isIntersecting},...Be&&{[`${N}__wrapper--scroll-start`]:!T.isIntersecting}}))})},I=new IntersectionObserver(m,{threshold:[.99],root:R.current}),P=D.current;return P.forEach(A=>I.observe(A)),()=>{P.forEach(A=>I.unobserve(A))}},[w.length]),d.jsx(At,{defaultValue:i??w[0].props.tabId,onValueChange:E,"data-testid":l,className:Y,value:u,...g,children:d.jsxs("div",{className:j(`${N}__container`),children:[d.jsxs("div",{className:j([`${N}__wrapper`,p]),children:[d.jsxs(Ot,{ref:m=>{R.current=m},className:j(`${N}__list`),children:[v.Children.map(w,(m,I)=>{const{name:P,tabId:A,"data-testid":ie}=m.props;return d.jsx(Gt,{"data-testid":U("header",ie),index:I,tabId:A,ref:T=>{T&&(D.current[I]=T)},onFocus:T=>{Kt(T.target,R.current)},variant:t,negative:n,children:P})}),S&&d.jsx("div",{className:j(`${N}__selected-border`),style:{width:C,transform:`translateX(${x}px)`},"data-testid":U("selected-border")})]}),d.jsx(se,{side:"left"}),d.jsx(se,{side:"right"})]}),d.jsx("div",{className:j(`${N}__content-wrapper`),style:{height:c&&_>-1?`${_}px`:"auto"},children:d.jsx("div",{ref:f,className:j(`${N}__content-container`),children:v.Children.map(w,m=>m)})})]})})};qe.Content=Lt;exports.Tabs=qe;exports.createTabChangeDetailEvent=De;exports.tabsVariants=kt;
|
|
10
10
|
//# sourceMappingURL=tabs.cjs.js.map
|