@purpurds/accordion 5.8.0 → 5.8.2
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 +3 -3
- package/dist/accordion.cjs.js +5 -5
- package/dist/accordion.es.js +97 -97
- package/dist/styles.css +1 -1
- package/package.json +5 -5
- package/src/accordion-item.module.scss +7 -5
- package/src/accordion.module.scss +4 -3
package/dist/LICENSE.txt
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
Name: @purpurds/heading
|
2
|
-
Version: 5.
|
2
|
+
Version: 5.8.1
|
3
3
|
License: AGPL-3.0-only
|
4
4
|
Private: false
|
5
5
|
|
@@ -202,13 +202,13 @@ SOFTWARE.
|
|
202
202
|
---
|
203
203
|
|
204
204
|
Name: @purpurds/icon
|
205
|
-
Version: 5.
|
205
|
+
Version: 5.8.1
|
206
206
|
License: AGPL-3.0-only
|
207
207
|
Private: false
|
208
208
|
|
209
209
|
---
|
210
210
|
|
211
211
|
Name: @purpurds/paragraph
|
212
|
-
Version: 5.
|
212
|
+
Version: 5.8.1
|
213
213
|
License: AGPL-3.0-only
|
214
214
|
Private: false
|
package/dist/accordion.cjs.js
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react/jsx-runtime"),a=require("react"),Ee=require("react-dom");function Ne(e){const r=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(r,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const re=Ne(a);function Ie(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oe={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
|
-
*/(function(e){(function(){var r={}.hasOwnProperty;function n(){for(var t="",c=0;c<arguments.length;c++){var s=arguments[c];s&&(t=i(t,o(s)))}return t}function o(t){if(typeof t=="string"||typeof t=="number")return t;if(typeof t!="object")return"";if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var c="";for(var s in t)r.call(t,s)&&t[s]&&(c=i(c,s));return c}function i(t,c){return c?t?t+" "+c:t+c:t}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(oe);var Pe=oe.exports;const we=Ie(Pe),O={"purpur-heading":"_purpur-heading_k9fhq_1","purpur-heading--hyphens":"_purpur-heading--hyphens_k9fhq_8","purpur-heading--negative":"_purpur-heading--negative_k9fhq_11","purpur-heading--subsection-100":"_purpur-heading--subsection-100_k9fhq_14","purpur-heading--title-100":"_purpur-heading--title-100_k9fhq_20","purpur-heading--title-200":"_purpur-heading--title-200_k9fhq_26","purpur-heading--title-300":"_purpur-heading--title-300_k9fhq_32","purpur-heading--title-400":"_purpur-heading--title-400_k9fhq_38","purpur-heading--title-500":"_purpur-heading--title-500_k9fhq_44","purpur-heading--title-600":"_purpur-heading--title-600_k9fhq_50","purpur-heading--title-700":"_purpur-heading--title-700_k9fhq_56","purpur-heading--display-25":"_purpur-heading--display-25_k9fhq_62","purpur-heading--display-50":"_purpur-heading--display-50_k9fhq_68","purpur-heading--display-100":"_purpur-heading--display-100_k9fhq_74","purpur-heading--display-200":"_purpur-heading--display-200_k9fhq_80"},Se={TITLE100:"title-100",TITLE200:"title-200",TITLE300:"title-300",TITLE400:"title-400",TITLE500:"title-500",TITLE600:"title-600",TITLE700:"title-700",SUBSECTION100:"subsection-100"},T="purpur-heading",ae=({["data-testid"]:e,children:r,className:n="",enableHyphenation:o=!1,negative:i=!1,tag:t,variant:c=Se.TITLE100,...s})=>{const u=t,l=we([n,O[T],O[`${T}--${c}`],{[O[`${T}--hyphens`]]:o,[O[`${T}--negative`]]:i}]);return y.jsx(u,{...s,className:l,"data-testid":e,children:r})};function h(){return h=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},h.apply(this,arguments)}function F(e,r=[]){let n=[];function o(t,c){const s=a.createContext(c),u=n.length;n=[...n,c];function l(p){const{scope:$,children:f,...b}=p,x=($==null?void 0:$[e][u])||s,g=a.useMemo(()=>b,Object.values(b));return a.createElement(x.Provider,{value:g},f)}function d(p,$){const f=($==null?void 0:$[e][u])||s,b=a.useContext(f);if(b)return b;if(c!==void 0)return c;throw new Error(`\`${p}\` must be used within \`${t}\``)}return l.displayName=t+"Provider",[l,d]}const i=()=>{const t=n.map(c=>a.createContext(c));return function(s){const u=(s==null?void 0:s[e])||t;return a.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return i.scopeName=e,[o,Re(i,...r)]}function Re(...e){const r=e[0];if(e.length===1)return r;const n=()=>{const o=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(t){const c=o.reduce((s,{useScope:u,scopeName:l})=>{const p=u(t)[`__scope${l}`];return{...s,...p}},{});return a.useMemo(()=>({[`__scope${r.scopeName}`]:c}),[c])}};return n.scopeName=r.scopeName,n}function Oe(e,r){typeof e=="function"?e(r):e!=null&&(e.current=r)}function ce(...e){return r=>e.forEach(n=>Oe(n,r))}function S(...e){return a.useCallback(ce(...e),e)}const j=a.forwardRef((e,r)=>{const{children:n,...o}=e,i=a.Children.toArray(n),t=i.find(Me);if(t){const c=t.props.children,s=i.map(u=>u===t?a.Children.count(c)>1?a.Children.only(null):a.isValidElement(c)?c.props.children:null:u);return a.createElement(z,h({},o,{ref:r}),a.isValidElement(c)?a.cloneElement(c,void 0,s):null)}return a.createElement(z,h({},o,{ref:r}),n)});j.displayName="Slot";const z=a.forwardRef((e,r)=>{const{children:n,...o}=e;return a.isValidElement(n)?a.cloneElement(n,{...je(o,n.props),ref:r?ce(r,n.ref):n.ref}):a.Children.count(n)>1?a.Children.only(null):null});z.displayName="SlotClone";const Te=({children:e})=>a.createElement(a.Fragment,null,e);function Me(e){return a.isValidElement(e)&&e.type===Te}function je(e,r){const n={...r};for(const o in r){const i=e[o],t=r[o];/^on[A-Z]/.test(o)?i&&t?n[o]=(...s)=>{t(...s),i(...s)}:i&&(n[o]=i):o==="style"?n[o]={...i,...t}:o==="className"&&(n[o]=[i,t].filter(Boolean).join(" "))}return{...e,...n}}function De(e){const r=e+"CollectionProvider",[n,o]=F(r),[i,t]=n(r,{collectionRef:{current:null},itemMap:new Map}),c=f=>{const{scope:b,children:x}=f,g=a.useRef(null),_=a.useRef(new Map).current;return a.createElement(i,{scope:b,itemMap:_,collectionRef:g},x)},s=e+"CollectionSlot",u=a.forwardRef((f,b)=>{const{scope:x,children:g}=f,_=t(s,x),m=S(b,_.collectionRef);return a.createElement(j,{ref:m},g)}),l=e+"CollectionItemSlot",d="data-radix-collection-item",p=a.forwardRef((f,b)=>{const{scope:x,children:g,..._}=f,m=a.useRef(null),v=S(b,m),C=t(l,x);return a.useEffect(()=>(C.itemMap.set(m,{ref:m,..._}),()=>void C.itemMap.delete(m))),a.createElement(j,{[d]:"",ref:v},g)});function $(f){const b=t(e+"CollectionConsumer",f);return a.useCallback(()=>{const g=b.collectionRef.current;if(!g)return[];const _=Array.from(g.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((C,I)=>_.indexOf(C.ref.current)-_.indexOf(I.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:c,Slot:u,ItemSlot:p},$,o]}function ie(e,r,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return r==null?void 0:r(i)}}function se(e){const r=a.useRef(e);return a.useEffect(()=>{r.current=e}),a.useMemo(()=>(...n)=>{var o;return(o=r.current)===null||o===void 0?void 0:o.call(r,...n)},[])}function K({prop:e,defaultProp:r,onChange:n=()=>{}}){const[o,i]=ke({defaultProp:r,onChange:n}),t=e!==void 0,c=t?e:o,s=se(n),u=a.useCallback(l=>{if(t){const p=typeof l=="function"?l(e):l;p!==e&&s(p)}else i(l)},[t,e,i,s]);return[c,u]}function ke({defaultProp:e,onChange:r}){const n=a.useState(e),[o]=n,i=a.useRef(o),t=se(r);return a.useEffect(()=>{i.current!==o&&(t(o),i.current=o)},[o,i,t]),n}const Le=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],R=Le.reduce((e,r)=>{const n=a.forwardRef((o,i)=>{const{asChild:t,...c}=o,s=t?j:r;return a.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),a.createElement(s,h({},c,{ref:i}))});return n.displayName=`Primitive.${r}`,{...e,[r]:n}},{}),D=globalThis!=null&&globalThis.document?a.useLayoutEffect:()=>{};function qe(e,r){return a.useReducer((n,o)=>{const i=r[n][o];return i??n},e)}const le=e=>{const{present:r,children:n}=e,o=Ve(r),i=typeof n=="function"?n({present:o.isPresent}):a.Children.only(n),t=S(o.ref,i.ref);return typeof n=="function"||o.isPresent?a.cloneElement(i,{ref:t}):null};le.displayName="Presence";function Ve(e){const[r,n]=a.useState(),o=a.useRef({}),i=a.useRef(e),t=a.useRef("none"),c=e?"mounted":"unmounted",[s,u]=qe(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const l=M(o.current);t.current=s==="mounted"?l:"none"},[s]),D(()=>{const l=o.current,d=i.current;if(d!==e){const $=t.current,f=M(l);e?u("MOUNT"):f==="none"||(l==null?void 0:l.display)==="none"?u("UNMOUNT"):u(d&&$!==f?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),D(()=>{if(r){const l=p=>{const f=M(o.current).includes(p.animationName);p.target===r&&f&&Ee.flushSync(()=>u("ANIMATION_END"))},d=p=>{p.target===r&&(t.current=M(o.current))};return r.addEventListener("animationstart",d),r.addEventListener("animationcancel",l),r.addEventListener("animationend",l),()=>{r.removeEventListener("animationstart",d),r.removeEventListener("animationcancel",l),r.removeEventListener("animationend",l)}}else u("ANIMATION_END")},[r,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:a.useCallback(l=>{l&&(o.current=getComputedStyle(l)),n(l)},[])}}function M(e){return(e==null?void 0:e.animationName)||"none"}const Ue=re.useId||(()=>{});let Be=0;function ue(e){const[r,n]=re.useState(Ue());return D(()=>{n(o=>o??String(Be++))},[e]),r?`radix-${r}`:""}const pe="Collapsible",[He,de]=F(pe),[ze,Z]=He(pe),Ge=a.forwardRef((e,r)=>{const{__scopeCollapsible:n,open:o,defaultOpen:i,disabled:t,onOpenChange:c,...s}=e,[u=!1,l]=K({prop:o,defaultProp:i,onChange:c});return a.createElement(ze,{scope:n,disabled:t,contentId:ue(),open:u,onOpenToggle:a.useCallback(()=>l(d=>!d),[l])},a.createElement(R.div,h({"data-state":W(u),"data-disabled":t?"":void 0},s,{ref:r})))}),Fe="CollapsibleTrigger",Ke=a.forwardRef((e,r)=>{const{__scopeCollapsible:n,...o}=e,i=Z(Fe,n);return a.createElement(R.button,h({type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":W(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled},o,{ref:r,onClick:ie(e.onClick,i.onOpenToggle)}))}),fe="CollapsibleContent",Ze=a.forwardRef((e,r)=>{const{forceMount:n,...o}=e,i=Z(fe,e.__scopeCollapsible);return a.createElement(le,{present:n||i.open},({present:t})=>a.createElement(We,h({},o,{ref:r,present:t})))}),We=a.forwardRef((e,r)=>{const{__scopeCollapsible:n,present:o,children:i,...t}=e,c=Z(fe,n),[s,u]=a.useState(o),l=a.useRef(null),d=S(r,l),p=a.useRef(0),$=p.current,f=a.useRef(0),b=f.current,x=c.open||s,g=a.useRef(x),_=a.useRef();return a.useEffect(()=>{const m=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(m)},[]),D(()=>{const m=l.current;if(m){_.current=_.current||{transitionDuration:m.style.transitionDuration,animationName:m.style.animationName},m.style.transitionDuration="0s",m.style.animationName="none";const v=m.getBoundingClientRect();p.current=v.height,f.current=v.width,g.current||(m.style.transitionDuration=_.current.transitionDuration,m.style.animationName=_.current.animationName),u(o)}},[c.open,o]),a.createElement(R.div,h({"data-state":W(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!x},t,{ref:d,style:{"--radix-collapsible-content-height":$?`${$}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style}}),x&&i)});function W(e){return e?"open":"closed"}const Ye=Ge,Je=Ke,Qe=Ze,Xe=a.createContext(void 0);function et(e){const r=a.useContext(Xe);return e||r||"ltr"}const E="Accordion",tt=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Y,nt,rt]=De(E),[k,zt]=F(E,[rt,de]),J=de(),be=a.forwardRef((e,r)=>{const{type:n,...o}=e,i=o,t=o;return a.createElement(Y.Provider,{scope:e.__scopeAccordion},n==="multiple"?a.createElement(it,h({},t,{ref:r})):a.createElement(ct,h({},i,{ref:r})))});be.propTypes={type(e){const r=e.value||e.defaultValue;return e.type&&!["single","multiple"].includes(e.type)?new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):e.type==="multiple"&&typeof r=="string"?new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):e.type==="single"&&Array.isArray(r)?new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};const[me,ot]=k(E),[$e,at]=k(E,{collapsible:!1}),ct=a.forwardRef((e,r)=>{const{value:n,defaultValue:o,onValueChange:i=()=>{},collapsible:t=!1,...c}=e,[s,u]=K({prop:n,defaultProp:o,onChange:i});return a.createElement(me,{scope:e.__scopeAccordion,value:s?[s]:[],onItemOpen:u,onItemClose:a.useCallback(()=>t&&u(""),[t,u])},a.createElement($e,{scope:e.__scopeAccordion,collapsible:t},a.createElement(_e,h({},c,{ref:r}))))}),it=a.forwardRef((e,r)=>{const{value:n,defaultValue:o,onValueChange:i=()=>{},...t}=e,[c=[],s]=K({prop:n,defaultProp:o,onChange:i}),u=a.useCallback(d=>s((p=[])=>[...p,d]),[s]),l=a.useCallback(d=>s((p=[])=>p.filter($=>$!==d)),[s]);return a.createElement(me,{scope:e.__scopeAccordion,value:c,onItemOpen:u,onItemClose:l},a.createElement($e,{scope:e.__scopeAccordion,collapsible:!0},a.createElement(_e,h({},t,{ref:r}))))}),[st,L]=k(E),_e=a.forwardRef((e,r)=>{const{__scopeAccordion:n,disabled:o,dir:i,orientation:t="vertical",...c}=e,s=a.useRef(null),u=S(s,r),l=nt(n),p=et(i)==="ltr",$=ie(e.onKeyDown,f=>{var b;if(!tt.includes(f.key))return;const x=f.target,g=l().filter(U=>{var B;return!((B=U.ref.current)!==null&&B!==void 0&&B.disabled)}),_=g.findIndex(U=>U.ref.current===x),m=g.length;if(_===-1)return;f.preventDefault();let v=_;const C=0,I=m-1,q=()=>{v=_+1,v>I&&(v=C)},V=()=>{v=_-1,v<C&&(v=I)};switch(f.key){case"Home":v=C;break;case"End":v=I;break;case"ArrowRight":t==="horizontal"&&(p?q():V());break;case"ArrowDown":t==="vertical"&&q();break;case"ArrowLeft":t==="horizontal"&&(p?V():q());break;case"ArrowUp":t==="vertical"&&V();break}const Ae=v%m;(b=g[Ae].ref.current)===null||b===void 0||b.focus()});return a.createElement(st,{scope:n,disabled:o,direction:i,orientation:t},a.createElement(Y.Slot,{scope:n},a.createElement(R.div,h({},c,{"data-orientation":t,ref:u,onKeyDown:o?void 0:$}))))}),G="AccordionItem",[lt,Q]=k(G),ut=a.forwardRef((e,r)=>{const{__scopeAccordion:n,value:o,...i}=e,t=L(G,n),c=ot(G,n),s=J(n),u=ue(),l=o&&c.value.includes(o)||!1,d=t.disabled||e.disabled;return a.createElement(lt,{scope:n,open:l,disabled:d,triggerId:u},a.createElement(Ye,h({"data-orientation":t.orientation,"data-state":he(l)},s,i,{ref:r,disabled:d,open:l,onOpenChange:p=>{p?c.onItemOpen(o):c.onItemClose(o)}})))}),pt="AccordionHeader",dt=a.forwardRef((e,r)=>{const{__scopeAccordion:n,...o}=e,i=L(E,n),t=Q(pt,n);return a.createElement(R.h3,h({"data-orientation":i.orientation,"data-state":he(t.open),"data-disabled":t.disabled?"":void 0},o,{ref:r}))}),ee="AccordionTrigger",ft=a.forwardRef((e,r)=>{const{__scopeAccordion:n,...o}=e,i=L(E,n),t=Q(ee,n),c=at(ee,n),s=J(n);return a.createElement(Y.ItemSlot,{scope:n},a.createElement(Je,h({"aria-disabled":t.open&&!c.collapsible||void 0,"data-orientation":i.orientation,id:t.triggerId},s,o,{ref:r})))}),bt="AccordionContent",mt=a.forwardRef((e,r)=>{const{__scopeAccordion:n,...o}=e,i=L(E,n),t=Q(bt,n),c=J(n);return a.createElement(Qe,h({role:"region","aria-labelledby":t.triggerId,"data-orientation":i.orientation},c,o,{ref:r,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}}))});function he(e){return e?"open":"closed"}const $t=be,_t=ut,ht=dt,gt=ft,vt=mt;function xt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ge={exports:{}};/*!
|
5
|
+
*/(function(e){(function(){var r={}.hasOwnProperty;function n(){for(var t="",c=0;c<arguments.length;c++){var s=arguments[c];s&&(t=i(t,o(s)))}return t}function o(t){if(typeof t=="string"||typeof t=="number")return t;if(typeof t!="object")return"";if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var c="";for(var s in t)r.call(t,s)&&t[s]&&(c=i(c,s));return c}function i(t,c){return c?t?t+" "+c:t+c:t}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(oe);var Pe=oe.exports;const we=Ie(Pe),O={"purpur-heading":"_purpur-heading_k9fhq_1","purpur-heading--hyphens":"_purpur-heading--hyphens_k9fhq_8","purpur-heading--negative":"_purpur-heading--negative_k9fhq_11","purpur-heading--subsection-100":"_purpur-heading--subsection-100_k9fhq_14","purpur-heading--title-100":"_purpur-heading--title-100_k9fhq_20","purpur-heading--title-200":"_purpur-heading--title-200_k9fhq_26","purpur-heading--title-300":"_purpur-heading--title-300_k9fhq_32","purpur-heading--title-400":"_purpur-heading--title-400_k9fhq_38","purpur-heading--title-500":"_purpur-heading--title-500_k9fhq_44","purpur-heading--title-600":"_purpur-heading--title-600_k9fhq_50","purpur-heading--title-700":"_purpur-heading--title-700_k9fhq_56","purpur-heading--display-25":"_purpur-heading--display-25_k9fhq_62","purpur-heading--display-50":"_purpur-heading--display-50_k9fhq_68","purpur-heading--display-100":"_purpur-heading--display-100_k9fhq_74","purpur-heading--display-200":"_purpur-heading--display-200_k9fhq_80"},Se={TITLE100:"title-100",TITLE200:"title-200",TITLE300:"title-300",TITLE400:"title-400",TITLE500:"title-500",TITLE600:"title-600",TITLE700:"title-700",SUBSECTION100:"subsection-100"},T="purpur-heading",ae=({["data-testid"]:e,children:r,className:n="",enableHyphenation:o=!1,negative:i=!1,tag:t,variant:c=Se.TITLE100,...s})=>{const u=t,l=we([n,O[T],O[`${T}--${c}`],{[O[`${T}--hyphens`]]:o,[O[`${T}--negative`]]:i}]);return C.jsx(u,{...s,className:l,"data-testid":e,children:r})};function h(){return h=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},h.apply(this,arguments)}function F(e,r=[]){let n=[];function o(t,c){const s=a.createContext(c),u=n.length;n=[...n,c];function l(p){const{scope:$,children:f,...b}=p,x=($==null?void 0:$[e][u])||s,g=a.useMemo(()=>b,Object.values(b));return a.createElement(x.Provider,{value:g},f)}function d(p,$){const f=($==null?void 0:$[e][u])||s,b=a.useContext(f);if(b)return b;if(c!==void 0)return c;throw new Error(`\`${p}\` must be used within \`${t}\``)}return l.displayName=t+"Provider",[l,d]}const i=()=>{const t=n.map(c=>a.createContext(c));return function(s){const u=(s==null?void 0:s[e])||t;return a.useMemo(()=>({[`__scope${e}`]:{...s,[e]:u}}),[s,u])}};return i.scopeName=e,[o,Re(i,...r)]}function Re(...e){const r=e[0];if(e.length===1)return r;const n=()=>{const o=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(t){const c=o.reduce((s,{useScope:u,scopeName:l})=>{const p=u(t)[`__scope${l}`];return{...s,...p}},{});return a.useMemo(()=>({[`__scope${r.scopeName}`]:c}),[c])}};return n.scopeName=r.scopeName,n}function Oe(e,r){typeof e=="function"?e(r):e!=null&&(e.current=r)}function ce(...e){return r=>e.forEach(n=>Oe(n,r))}function S(...e){return a.useCallback(ce(...e),e)}const j=a.forwardRef((e,r)=>{const{children:n,...o}=e,i=a.Children.toArray(n),t=i.find(Me);if(t){const c=t.props.children,s=i.map(u=>u===t?a.Children.count(c)>1?a.Children.only(null):a.isValidElement(c)?c.props.children:null:u);return a.createElement(H,h({},o,{ref:r}),a.isValidElement(c)?a.cloneElement(c,void 0,s):null)}return a.createElement(H,h({},o,{ref:r}),n)});j.displayName="Slot";const H=a.forwardRef((e,r)=>{const{children:n,...o}=e;return a.isValidElement(n)?a.cloneElement(n,{...je(o,n.props),ref:r?ce(r,n.ref):n.ref}):a.Children.count(n)>1?a.Children.only(null):null});H.displayName="SlotClone";const Te=({children:e})=>a.createElement(a.Fragment,null,e);function Me(e){return a.isValidElement(e)&&e.type===Te}function je(e,r){const n={...r};for(const o in r){const i=e[o],t=r[o];/^on[A-Z]/.test(o)?i&&t?n[o]=(...s)=>{t(...s),i(...s)}:i&&(n[o]=i):o==="style"?n[o]={...i,...t}:o==="className"&&(n[o]=[i,t].filter(Boolean).join(" "))}return{...e,...n}}function ke(e){const r=e+"CollectionProvider",[n,o]=F(r),[i,t]=n(r,{collectionRef:{current:null},itemMap:new Map}),c=f=>{const{scope:b,children:x}=f,g=a.useRef(null),_=a.useRef(new Map).current;return a.createElement(i,{scope:b,itemMap:_,collectionRef:g},x)},s=e+"CollectionSlot",u=a.forwardRef((f,b)=>{const{scope:x,children:g}=f,_=t(s,x),m=S(b,_.collectionRef);return a.createElement(j,{ref:m},g)}),l=e+"CollectionItemSlot",d="data-radix-collection-item",p=a.forwardRef((f,b)=>{const{scope:x,children:g,..._}=f,m=a.useRef(null),v=S(b,m),y=t(l,x);return a.useEffect(()=>(y.itemMap.set(m,{ref:m,..._}),()=>void y.itemMap.delete(m))),a.createElement(j,{[d]:"",ref:v},g)});function $(f){const b=t(e+"CollectionConsumer",f);return a.useCallback(()=>{const g=b.collectionRef.current;if(!g)return[];const _=Array.from(g.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((y,I)=>_.indexOf(y.ref.current)-_.indexOf(I.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:c,Slot:u,ItemSlot:p},$,o]}function ie(e,r,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return r==null?void 0:r(i)}}function se(e){const r=a.useRef(e);return a.useEffect(()=>{r.current=e}),a.useMemo(()=>(...n)=>{var o;return(o=r.current)===null||o===void 0?void 0:o.call(r,...n)},[])}function K({prop:e,defaultProp:r,onChange:n=()=>{}}){const[o,i]=De({defaultProp:r,onChange:n}),t=e!==void 0,c=t?e:o,s=se(n),u=a.useCallback(l=>{if(t){const p=typeof l=="function"?l(e):l;p!==e&&s(p)}else i(l)},[t,e,i,s]);return[c,u]}function De({defaultProp:e,onChange:r}){const n=a.useState(e),[o]=n,i=a.useRef(o),t=se(r);return a.useEffect(()=>{i.current!==o&&(t(o),i.current=o)},[o,i,t]),n}const Le=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],R=Le.reduce((e,r)=>{const n=a.forwardRef((o,i)=>{const{asChild:t,...c}=o,s=t?j:r;return a.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),a.createElement(s,h({},c,{ref:i}))});return n.displayName=`Primitive.${r}`,{...e,[r]:n}},{}),k=globalThis!=null&&globalThis.document?a.useLayoutEffect:()=>{};function qe(e,r){return a.useReducer((n,o)=>{const i=r[n][o];return i??n},e)}const le=e=>{const{present:r,children:n}=e,o=Ve(r),i=typeof n=="function"?n({present:o.isPresent}):a.Children.only(n),t=S(o.ref,i.ref);return typeof n=="function"||o.isPresent?a.cloneElement(i,{ref:t}):null};le.displayName="Presence";function Ve(e){const[r,n]=a.useState(),o=a.useRef({}),i=a.useRef(e),t=a.useRef("none"),c=e?"mounted":"unmounted",[s,u]=qe(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const l=M(o.current);t.current=s==="mounted"?l:"none"},[s]),k(()=>{const l=o.current,d=i.current;if(d!==e){const $=t.current,f=M(l);e?u("MOUNT"):f==="none"||(l==null?void 0:l.display)==="none"?u("UNMOUNT"):u(d&&$!==f?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),k(()=>{if(r){const l=p=>{const f=M(o.current).includes(p.animationName);p.target===r&&f&&Ee.flushSync(()=>u("ANIMATION_END"))},d=p=>{p.target===r&&(t.current=M(o.current))};return r.addEventListener("animationstart",d),r.addEventListener("animationcancel",l),r.addEventListener("animationend",l),()=>{r.removeEventListener("animationstart",d),r.removeEventListener("animationcancel",l),r.removeEventListener("animationend",l)}}else u("ANIMATION_END")},[r,u]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:a.useCallback(l=>{l&&(o.current=getComputedStyle(l)),n(l)},[])}}function M(e){return(e==null?void 0:e.animationName)||"none"}const Ue=re.useId||(()=>{});let ze=0;function ue(e){const[r,n]=re.useState(Ue());return k(()=>{n(o=>o??String(ze++))},[e]),r?`radix-${r}`:""}const pe="Collapsible",[Be,de]=F(pe),[He,Z]=Be(pe),Ge=a.forwardRef((e,r)=>{const{__scopeCollapsible:n,open:o,defaultOpen:i,disabled:t,onOpenChange:c,...s}=e,[u=!1,l]=K({prop:o,defaultProp:i,onChange:c});return a.createElement(He,{scope:n,disabled:t,contentId:ue(),open:u,onOpenToggle:a.useCallback(()=>l(d=>!d),[l])},a.createElement(R.div,h({"data-state":W(u),"data-disabled":t?"":void 0},s,{ref:r})))}),Fe="CollapsibleTrigger",Ke=a.forwardRef((e,r)=>{const{__scopeCollapsible:n,...o}=e,i=Z(Fe,n);return a.createElement(R.button,h({type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":W(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled},o,{ref:r,onClick:ie(e.onClick,i.onOpenToggle)}))}),fe="CollapsibleContent",Ze=a.forwardRef((e,r)=>{const{forceMount:n,...o}=e,i=Z(fe,e.__scopeCollapsible);return a.createElement(le,{present:n||i.open},({present:t})=>a.createElement(We,h({},o,{ref:r,present:t})))}),We=a.forwardRef((e,r)=>{const{__scopeCollapsible:n,present:o,children:i,...t}=e,c=Z(fe,n),[s,u]=a.useState(o),l=a.useRef(null),d=S(r,l),p=a.useRef(0),$=p.current,f=a.useRef(0),b=f.current,x=c.open||s,g=a.useRef(x),_=a.useRef();return a.useEffect(()=>{const m=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(m)},[]),k(()=>{const m=l.current;if(m){_.current=_.current||{transitionDuration:m.style.transitionDuration,animationName:m.style.animationName},m.style.transitionDuration="0s",m.style.animationName="none";const v=m.getBoundingClientRect();p.current=v.height,f.current=v.width,g.current||(m.style.transitionDuration=_.current.transitionDuration,m.style.animationName=_.current.animationName),u(o)}},[c.open,o]),a.createElement(R.div,h({"data-state":W(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!x},t,{ref:d,style:{"--radix-collapsible-content-height":$?`${$}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style}}),x&&i)});function W(e){return e?"open":"closed"}const Ye=Ge,Je=Ke,Qe=Ze,Xe=a.createContext(void 0);function et(e){const r=a.useContext(Xe);return e||r||"ltr"}const E="Accordion",tt=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Y,nt,rt]=ke(E),[D,Ht]=F(E,[rt,de]),J=de(),be=a.forwardRef((e,r)=>{const{type:n,...o}=e,i=o,t=o;return a.createElement(Y.Provider,{scope:e.__scopeAccordion},n==="multiple"?a.createElement(it,h({},t,{ref:r})):a.createElement(ct,h({},i,{ref:r})))});be.propTypes={type(e){const r=e.value||e.defaultValue;return e.type&&!["single","multiple"].includes(e.type)?new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):e.type==="multiple"&&typeof r=="string"?new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):e.type==="single"&&Array.isArray(r)?new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};const[me,ot]=D(E),[$e,at]=D(E,{collapsible:!1}),ct=a.forwardRef((e,r)=>{const{value:n,defaultValue:o,onValueChange:i=()=>{},collapsible:t=!1,...c}=e,[s,u]=K({prop:n,defaultProp:o,onChange:i});return a.createElement(me,{scope:e.__scopeAccordion,value:s?[s]:[],onItemOpen:u,onItemClose:a.useCallback(()=>t&&u(""),[t,u])},a.createElement($e,{scope:e.__scopeAccordion,collapsible:t},a.createElement(_e,h({},c,{ref:r}))))}),it=a.forwardRef((e,r)=>{const{value:n,defaultValue:o,onValueChange:i=()=>{},...t}=e,[c=[],s]=K({prop:n,defaultProp:o,onChange:i}),u=a.useCallback(d=>s((p=[])=>[...p,d]),[s]),l=a.useCallback(d=>s((p=[])=>p.filter($=>$!==d)),[s]);return a.createElement(me,{scope:e.__scopeAccordion,value:c,onItemOpen:u,onItemClose:l},a.createElement($e,{scope:e.__scopeAccordion,collapsible:!0},a.createElement(_e,h({},t,{ref:r}))))}),[st,L]=D(E),_e=a.forwardRef((e,r)=>{const{__scopeAccordion:n,disabled:o,dir:i,orientation:t="vertical",...c}=e,s=a.useRef(null),u=S(s,r),l=nt(n),p=et(i)==="ltr",$=ie(e.onKeyDown,f=>{var b;if(!tt.includes(f.key))return;const x=f.target,g=l().filter(U=>{var z;return!((z=U.ref.current)!==null&&z!==void 0&&z.disabled)}),_=g.findIndex(U=>U.ref.current===x),m=g.length;if(_===-1)return;f.preventDefault();let v=_;const y=0,I=m-1,q=()=>{v=_+1,v>I&&(v=y)},V=()=>{v=_-1,v<y&&(v=I)};switch(f.key){case"Home":v=y;break;case"End":v=I;break;case"ArrowRight":t==="horizontal"&&(p?q():V());break;case"ArrowDown":t==="vertical"&&q();break;case"ArrowLeft":t==="horizontal"&&(p?V():q());break;case"ArrowUp":t==="vertical"&&V();break}const Ae=v%m;(b=g[Ae].ref.current)===null||b===void 0||b.focus()});return a.createElement(st,{scope:n,disabled:o,direction:i,orientation:t},a.createElement(Y.Slot,{scope:n},a.createElement(R.div,h({},c,{"data-orientation":t,ref:u,onKeyDown:o?void 0:$}))))}),G="AccordionItem",[lt,Q]=D(G),ut=a.forwardRef((e,r)=>{const{__scopeAccordion:n,value:o,...i}=e,t=L(G,n),c=ot(G,n),s=J(n),u=ue(),l=o&&c.value.includes(o)||!1,d=t.disabled||e.disabled;return a.createElement(lt,{scope:n,open:l,disabled:d,triggerId:u},a.createElement(Ye,h({"data-orientation":t.orientation,"data-state":he(l)},s,i,{ref:r,disabled:d,open:l,onOpenChange:p=>{p?c.onItemOpen(o):c.onItemClose(o)}})))}),pt="AccordionHeader",dt=a.forwardRef((e,r)=>{const{__scopeAccordion:n,...o}=e,i=L(E,n),t=Q(pt,n);return a.createElement(R.h3,h({"data-orientation":i.orientation,"data-state":he(t.open),"data-disabled":t.disabled?"":void 0},o,{ref:r}))}),ee="AccordionTrigger",ft=a.forwardRef((e,r)=>{const{__scopeAccordion:n,...o}=e,i=L(E,n),t=Q(ee,n),c=at(ee,n),s=J(n);return a.createElement(Y.ItemSlot,{scope:n},a.createElement(Je,h({"aria-disabled":t.open&&!c.collapsible||void 0,"data-orientation":i.orientation,id:t.triggerId},s,o,{ref:r})))}),bt="AccordionContent",mt=a.forwardRef((e,r)=>{const{__scopeAccordion:n,...o}=e,i=L(E,n),t=Q(bt,n),c=J(n);return a.createElement(Qe,h({role:"region","aria-labelledby":t.triggerId,"data-orientation":i.orientation},c,o,{ref:r,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}}))});function he(e){return e?"open":"closed"}const $t=be,_t=ut,ht=dt,gt=ft,vt=mt;function xt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ge={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
|
-
*/(function(e){(function(){var r={}.hasOwnProperty;function n(){for(var t="",c=0;c<arguments.length;c++){var s=arguments[c];s&&(t=i(t,o.call(this,s)))}return t}function o(t){if(typeof t=="string"||typeof t=="number")return this&&this[t]||t;if(typeof t!="object")return"";if(Array.isArray(t))return n.apply(this,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var c="";for(var s in t)r.call(t,s)&&t[s]&&(c=i(c,this&&this[s]||s));return c}function i(t,c){return c?t?t+" "+c:t+c:t}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(ge);var
|
9
|
+
*/(function(e){(function(){var r={}.hasOwnProperty;function n(){for(var t="",c=0;c<arguments.length;c++){var s=arguments[c];s&&(t=i(t,o.call(this,s)))}return t}function o(t){if(typeof t=="string"||typeof t=="number")return this&&this[t]||t;if(typeof t!="object")return"";if(Array.isArray(t))return n.apply(this,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var c="";for(var s in t)r.call(t,s)&&t[s]&&(c=i(c,this&&this[s]||s));return c}function i(t,c){return c?t?t+" "+c:t+c:t}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(ge);var Ct=ge.exports;const ve=xt(Ct),yt={"purpur-accordion":"_purpur-accordion_u887g_1","purpur-accordion__title":"_purpur-accordion__title_u887g_4","purpur-accordion--negative":"_purpur-accordion--negative_u887g_13"};function At(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var xe={exports:{}};/*!
|
10
10
|
Copyright (c) 2018 Jed Watson.
|
11
11
|
Licensed under the MIT License (MIT), see
|
12
12
|
http://jedwatson.github.io/classnames
|
13
|
-
*/(function(e){(function(){var r={}.hasOwnProperty;function n(){for(var t="",c=0;c<arguments.length;c++){var s=arguments[c];s&&(t=i(t,o.call(this,s)))}return t}function o(t){if(typeof t=="string"||typeof t=="number")return this&&this[t]||t;if(typeof t!="object")return"";if(Array.isArray(t))return n.apply(this,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var c="";for(var s in t)r.call(t,s)&&t[s]&&(c=i(c,this&&this[s]||s));return c}function i(t,c){return c?t?t+" "+c:t+c:t}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(xe);var Et=xe.exports;const Nt=At(Et),It={"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"},Pt={name:"chevron-down",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M20.136 7.864a.9.9 0 0 0-1.272 0L12 14.727 5.136 7.864a.9.9 0 0 0-1.272 1.272l7.5 7.5a.9.9 0 0 0 1.272 0l7.5-7.5a.9.9 0 0 0 0-1.272Z" clip-rule="evenodd"/></svg>',keywords:["chevron-down"],category:"utility"},
|
13
|
+
*/(function(e){(function(){var r={}.hasOwnProperty;function n(){for(var t="",c=0;c<arguments.length;c++){var s=arguments[c];s&&(t=i(t,o.call(this,s)))}return t}function o(t){if(typeof t=="string"||typeof t=="number")return this&&this[t]||t;if(typeof t!="object")return"";if(Array.isArray(t))return n.apply(this,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var c="";for(var s in t)r.call(t,s)&&t[s]&&(c=i(c,this&&this[s]||s));return c}function i(t,c){return c?t?t+" "+c:t+c:t}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(xe);var Et=xe.exports;const Nt=At(Et),It={"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"},Pt={name:"chevron-down",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M20.136 7.864a.9.9 0 0 0-1.272 0L12 14.727 5.136 7.864a.9.9 0 0 0-1.272 1.272l7.5 7.5a.9.9 0 0 0 1.272 0l7.5-7.5a.9.9 0 0 0 0-1.272Z" clip-rule="evenodd"/></svg>',keywords:["chevron-down"],category:"utility"},Ce=e=>C.jsx(Mt,{...e,svg:Pt});Ce.displayName="IconChevronDown";const wt=Nt.bind(It),te="purpur-icon",St="md",Rt=e=>e.filter(r=>Object.keys(r).length>=1).map(r=>`${r.name}="${r.value}"`).join(" "),Ot=({content:e="",title:r}={})=>{const n=[{name:"xmlns",value:"http://www.w3.org/2000/svg"},{name:"fill",value:"currentColor"},{name:"viewBox",value:"0 0 24 24"},r?{name:"role",value:"img"}:{name:"aria-hidden",value:"true"}],o=r?`<title>${r}</title>`:"";return`<svg ${Rt(n)}>${o}${e}</svg>`},Tt=e=>e.replace(/<(\/?)svg([^>]*)>/g,"").trim(),Mt=({["data-testid"]:e,svg:r,allyTitle:n,className:o="",size:i=St,...t})=>{const c=Ot({content:Tt(r.svg),title:n}),s=wt(o,te,`${te}--${i}`);return C.jsx("span",{"aria-label":n,className:s,"data-testid":e,dangerouslySetInnerHTML:{__html:c},...t})};function jt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ye={exports:{}};/*!
|
14
14
|
Copyright (c) 2018 Jed Watson.
|
15
15
|
Licensed under the MIT License (MIT), see
|
16
16
|
http://jedwatson.github.io/classnames
|
17
|
-
*/(function(e){(function(){var r={}.hasOwnProperty;function n(){for(var t="",c=0;c<arguments.length;c++){var s=arguments[c];s&&(t=i(t,o(s)))}return t}function o(t){if(typeof t=="string"||typeof t=="number")return t;if(typeof t!="object")return"";if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var c="";for(var s in t)r.call(t,s)&&t[s]&&(c=i(c,s));return c}function i(t,c){return c?t?t+" "+c:t+c:t}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(
|
17
|
+
*/(function(e){(function(){var r={}.hasOwnProperty;function n(){for(var t="",c=0;c<arguments.length;c++){var s=arguments[c];s&&(t=i(t,o(s)))}return t}function o(t){if(typeof t=="string"||typeof t=="number")return t;if(typeof t!="object")return"";if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var c="";for(var s in t)r.call(t,s)&&t[s]&&(c=i(c,s));return c}function i(t,c){return c?t?t+" "+c:t+c:t}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(ye);var kt=ye.exports;const Dt=jt(kt),P={"purpur-paragraph":"_purpur-paragraph_1rh57_1","purpur-paragraph--disabled":"_purpur-paragraph--disabled_1rh57_7","purpur-paragraph--hyphens":"_purpur-paragraph--hyphens_1rh57_10","purpur-paragraph--negative":"_purpur-paragraph--negative_1rh57_13","purpur-paragraph--paragraph-100":"_purpur-paragraph--paragraph-100_1rh57_16","purpur-paragraph--paragraph-100-medium":"_purpur-paragraph--paragraph-100-medium_1rh57_22","purpur-paragraph--paragraph-100-bold":"_purpur-paragraph--paragraph-100-bold_1rh57_29","purpur-paragraph--paragraph-200":"_purpur-paragraph--paragraph-200_1rh57_36","purpur-paragraph--preamble-100":"_purpur-paragraph--preamble-100_1rh57_42","purpur-paragraph--preamble-200":"_purpur-paragraph--preamble-200_1rh57_48","purpur-paragraph--additional-100":"_purpur-paragraph--additional-100_1rh57_54","purpur-paragraph--additional-100-medium":"_purpur-paragraph--additional-100-medium_1rh57_60","purpur-paragraph--overline-100":"_purpur-paragraph--overline-100_1rh57_67","purpur-paragraph--overline-200":"_purpur-paragraph--overline-200_1rh57_75"},Lt={PARAGRAPH100:"paragraph-100",PARAGRAPH100MEDIUM:"paragraph-100-medium",PARAGRAPH100BOLD:"paragraph-100-bold",PARAGRAPH200:"paragraph-200",PREAMBLE100:"preamble-100",PREAMBLE200:"preamble-200",ADDITIONAL100:"additional-100",ADDITIONAL100MEDIUM:"additional-100-medium",OVERLINE100:"overline-100",OVERLINE200:"overline-200"},w="purpur-paragraph",qt=({["data-testid"]:e,children:r,className:n="",disabled:o,enableHyphenation:i=!1,negative:t=!1,variant:c=Lt.PARAGRAPH100,...s})=>{const u=Dt([n,P[w],P[`${w}--${c}`],{[P[`${w}--hyphens`]]:i,[P[`${w}--disabled`]]:o,[P[`${w}--negative`]]:t}]);return C.jsx("p",{...s,className:u,"data-testid":e,children:r})},Vt="_slideDown_aukzj_1",Ut="_slideUp_aukzj_1",zt={"purpur-accordion-item":"_purpur-accordion-item_aukzj_1","purpur-accordion-item__header":"_purpur-accordion-item__header_aukzj_8","purpur-accordion-item__trigger":"_purpur-accordion-item__trigger_aukzj_11","purpur-accordion-item__content":"_purpur-accordion-item__content_aukzj_41",slideDown:Vt,slideUp:Ut,"purpur-accordion-item__contentText":"_purpur-accordion-item__contentText_aukzj_50","purpur-accordion-item__icon":"_purpur-accordion-item__icon_aukzj_54","purpur-accordion-item__title":"_purpur-accordion-item__title_aukzj_67","purpur-accordion-item--negative":"_purpur-accordion-item--negative_aukzj_88"},N=ve.bind(zt),A="purpur-accordion-item",Bt=({children:e,className:r,title:n,titleTag:o="h3",negative:i,onClick:t,...c})=>{const s=N([r,A,{[`${A}--negative`]:i}]);return C.jsxs(_t,{className:s,value:n,...c,children:[C.jsx(ht,{className:N(`${A}__header`),asChild:!0,children:C.jsx(ae,{tag:o,variant:"title-100",className:N(`${A}__title`),children:C.jsxs(gt,{onClick:t,className:N(`${A}__trigger`,r),children:[n,C.jsx(Ce,{size:"md",className:N(`${A}__icon`),"aria-hidden":!0})]})})}),C.jsx(vt,{className:N(`${A}__content`,r),children:C.jsx("div",{className:N(`${A}__contentText`),children:typeof e=="string"?C.jsx(qt,{variant:"paragraph-200",children:e}):e})})]})},ne=ve.bind(yt),B="purpur-accordion",X=({["data-testid"]:e,children:r,className:n,negative:o=!1,title:i,titleTag:t="h2",titleVariant:c="title-300"})=>{const s=ne([n,B,{[`${B}--negative`]:o}]),u=()=>a.Children.map(r,l=>a.cloneElement(l,{negative:o}));return C.jsxs($t,{className:s,type:"multiple","data-testid":e,children:[i?C.jsx(ae,{tag:t,variant:c,className:ne(`${B}__title`),children:i}):null,u()]})};X.Item=Bt;X.displayName="Accordion";exports.Accordion=X;
|
18
18
|
//# sourceMappingURL=accordion.cjs.js.map
|
package/dist/accordion.es.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
import { jsx as
|
1
|
+
import { jsx as A, jsxs as X } from "react/jsx-runtime";
|
2
2
|
import * as be from "react";
|
3
|
-
import u, { createContext as ee, useMemo as V, createElement as
|
3
|
+
import u, { createContext as ee, useMemo as V, createElement as y, useContext as $e, useCallback as H, forwardRef as S, Children as w, isValidElement as U, cloneElement as G, Fragment as Le, useRef as C, useEffect as k, useState as re, useLayoutEffect as qe, useReducer as Ve } from "react";
|
4
4
|
import { flushSync as Ue } from "react-dom";
|
5
|
-
function
|
5
|
+
function ze(e) {
|
6
6
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
7
7
|
}
|
8
8
|
var _e = { exports: {} };
|
@@ -41,8 +41,8 @@ var _e = { exports: {} };
|
|
41
41
|
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
|
42
42
|
})();
|
43
43
|
})(_e);
|
44
|
-
var
|
45
|
-
const
|
44
|
+
var Be = _e.exports;
|
45
|
+
const He = /* @__PURE__ */ ze(Be), j = {
|
46
46
|
"purpur-heading": "_purpur-heading_k9fhq_1",
|
47
47
|
"purpur-heading--hyphens": "_purpur-heading--hyphens_k9fhq_8",
|
48
48
|
"purpur-heading--negative": "_purpur-heading--negative_k9fhq_11",
|
@@ -58,7 +58,7 @@ const Ge = /* @__PURE__ */ Be(He), k = {
|
|
58
58
|
"purpur-heading--display-50": "_purpur-heading--display-50_k9fhq_68",
|
59
59
|
"purpur-heading--display-100": "_purpur-heading--display-100_k9fhq_74",
|
60
60
|
"purpur-heading--display-200": "_purpur-heading--display-200_k9fhq_80"
|
61
|
-
},
|
61
|
+
}, Ge = {
|
62
62
|
TITLE100: "title-100",
|
63
63
|
TITLE200: "title-200",
|
64
64
|
TITLE300: "title-300",
|
@@ -67,26 +67,26 @@ const Ge = /* @__PURE__ */ Be(He), k = {
|
|
67
67
|
TITLE600: "title-600",
|
68
68
|
TITLE700: "title-700",
|
69
69
|
SUBSECTION100: "subsection-100"
|
70
|
-
},
|
70
|
+
}, L = "purpur-heading", me = ({
|
71
71
|
["data-testid"]: e,
|
72
72
|
children: r,
|
73
73
|
className: n = "",
|
74
74
|
enableHyphenation: o = !1,
|
75
75
|
negative: c = !1,
|
76
76
|
tag: t,
|
77
|
-
variant: a =
|
77
|
+
variant: a = Ge.TITLE100,
|
78
78
|
...i
|
79
79
|
}) => {
|
80
|
-
const l = t, s =
|
80
|
+
const l = t, s = He([
|
81
81
|
n,
|
82
|
-
|
83
|
-
|
82
|
+
j[L],
|
83
|
+
j[`${L}--${a}`],
|
84
84
|
{
|
85
|
-
[
|
86
|
-
[
|
85
|
+
[j[`${L}--hyphens`]]: o,
|
86
|
+
[j[`${L}--negative`]]: c
|
87
87
|
}
|
88
88
|
]);
|
89
|
-
return /* @__PURE__ */
|
89
|
+
return /* @__PURE__ */ A(l, { ...i, className: s, "data-testid": e, children: r });
|
90
90
|
};
|
91
91
|
function h() {
|
92
92
|
return h = Object.assign ? Object.assign.bind() : function(e) {
|
@@ -111,7 +111,7 @@ function oe(e, r = []) {
|
|
111
111
|
() => b,
|
112
112
|
Object.values(b)
|
113
113
|
);
|
114
|
-
return /* @__PURE__ */
|
114
|
+
return /* @__PURE__ */ y(x.Provider, {
|
115
115
|
value: g
|
116
116
|
}, f);
|
117
117
|
}
|
@@ -191,30 +191,30 @@ function he(...e) {
|
|
191
191
|
);
|
192
192
|
}
|
193
193
|
function M(...e) {
|
194
|
-
return
|
194
|
+
return H(he(...e), e);
|
195
195
|
}
|
196
|
-
const
|
196
|
+
const z = /* @__PURE__ */ S((e, r) => {
|
197
197
|
const { children: n, ...o } = e, c = w.toArray(n), t = c.find(We);
|
198
198
|
if (t) {
|
199
199
|
const a = t.props.children, i = c.map((l) => l === t ? w.count(a) > 1 ? w.only(null) : /* @__PURE__ */ U(a) ? a.props.children : null : l);
|
200
|
-
return /* @__PURE__ */
|
200
|
+
return /* @__PURE__ */ y(te, h({}, o, {
|
201
201
|
ref: r
|
202
|
-
}), /* @__PURE__ */ U(a) ? /* @__PURE__ */
|
202
|
+
}), /* @__PURE__ */ U(a) ? /* @__PURE__ */ G(a, void 0, i) : null);
|
203
203
|
}
|
204
|
-
return /* @__PURE__ */
|
204
|
+
return /* @__PURE__ */ y(te, h({}, o, {
|
205
205
|
ref: r
|
206
206
|
}), n);
|
207
207
|
});
|
208
|
-
|
208
|
+
z.displayName = "Slot";
|
209
209
|
const te = /* @__PURE__ */ S((e, r) => {
|
210
210
|
const { children: n, ...o } = e;
|
211
|
-
return /* @__PURE__ */ U(n) ? /* @__PURE__ */
|
211
|
+
return /* @__PURE__ */ U(n) ? /* @__PURE__ */ G(n, {
|
212
212
|
...Ye(o, n.props),
|
213
213
|
ref: r ? he(r, n.ref) : n.ref
|
214
214
|
}) : w.count(n) > 1 ? w.only(null) : null;
|
215
215
|
});
|
216
216
|
te.displayName = "SlotClone";
|
217
|
-
const Ze = ({ children: e }) => /* @__PURE__ */
|
217
|
+
const Ze = ({ children: e }) => /* @__PURE__ */ y(Le, null, e);
|
218
218
|
function We(e) {
|
219
219
|
return /* @__PURE__ */ U(e) && e.type === Ze;
|
220
220
|
}
|
@@ -254,7 +254,7 @@ function Je(e) {
|
|
254
254
|
}, x);
|
255
255
|
}, i = e + "CollectionSlot", l = /* @__PURE__ */ u.forwardRef((f, b) => {
|
256
256
|
const { scope: x, children: g } = f, m = t(i, x), $ = M(b, m.collectionRef);
|
257
|
-
return /* @__PURE__ */ u.createElement(
|
257
|
+
return /* @__PURE__ */ u.createElement(z, {
|
258
258
|
ref: $
|
259
259
|
}, g);
|
260
260
|
}), s = e + "CollectionItemSlot", d = "data-radix-collection-item", p = /* @__PURE__ */ u.forwardRef((f, b) => {
|
@@ -262,7 +262,7 @@ function Je(e) {
|
|
262
262
|
return u.useEffect(() => (N.itemMap.set($, {
|
263
263
|
ref: $,
|
264
264
|
...m
|
265
|
-
}), () => void N.itemMap.delete($))), /* @__PURE__ */ u.createElement(
|
265
|
+
}), () => void N.itemMap.delete($))), /* @__PURE__ */ u.createElement(z, {
|
266
266
|
[d]: "",
|
267
267
|
ref: v
|
268
268
|
}, g);
|
@@ -300,7 +300,7 @@ function ge(e, r, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
300
300
|
}
|
301
301
|
function ve(e) {
|
302
302
|
const r = C(e);
|
303
|
-
return
|
303
|
+
return k(() => {
|
304
304
|
r.current = e;
|
305
305
|
}), V(
|
306
306
|
() => (...n) => {
|
@@ -315,7 +315,7 @@ function ae({ prop: e, defaultProp: r, onChange: n = () => {
|
|
315
315
|
const [o, c] = Qe({
|
316
316
|
defaultProp: r,
|
317
317
|
onChange: n
|
318
|
-
}), t = e !== void 0, a = t ? e : o, i = ve(n), l =
|
318
|
+
}), t = e !== void 0, a = t ? e : o, i = ve(n), l = H((s) => {
|
319
319
|
if (t) {
|
320
320
|
const p = typeof s == "function" ? s(e) : s;
|
321
321
|
p !== e && i(p);
|
@@ -334,7 +334,7 @@ function ae({ prop: e, defaultProp: r, onChange: n = () => {
|
|
334
334
|
}
|
335
335
|
function Qe({ defaultProp: e, onChange: r }) {
|
336
336
|
const n = re(e), [o] = n, c = C(o), t = ve(r);
|
337
|
-
return
|
337
|
+
return k(() => {
|
338
338
|
c.current !== o && (t(o), c.current = o);
|
339
339
|
}, [
|
340
340
|
o,
|
@@ -359,12 +359,12 @@ const Xe = [
|
|
359
359
|
"span",
|
360
360
|
"svg",
|
361
361
|
"ul"
|
362
|
-
],
|
362
|
+
], D = Xe.reduce((e, r) => {
|
363
363
|
const n = /* @__PURE__ */ S((o, c) => {
|
364
|
-
const { asChild: t, ...a } = o, i = t ?
|
365
|
-
return
|
364
|
+
const { asChild: t, ...a } = o, i = t ? z : r;
|
365
|
+
return k(() => {
|
366
366
|
window[Symbol.for("radix-ui")] = !0;
|
367
|
-
}, []), /* @__PURE__ */
|
367
|
+
}, []), /* @__PURE__ */ y(i, h({}, a, {
|
368
368
|
ref: c
|
369
369
|
}));
|
370
370
|
});
|
@@ -372,7 +372,7 @@ const Xe = [
|
|
372
372
|
...e,
|
373
373
|
[r]: n
|
374
374
|
};
|
375
|
-
}, {}),
|
375
|
+
}, {}), B = globalThis != null && globalThis.document ? qe : () => {
|
376
376
|
};
|
377
377
|
function et(e, r) {
|
378
378
|
return Ve((n, o) => {
|
@@ -384,7 +384,7 @@ const xe = (e) => {
|
|
384
384
|
const { present: r, children: n } = e, o = tt(r), c = typeof n == "function" ? n({
|
385
385
|
present: o.isPresent
|
386
386
|
}) : w.only(n), t = M(o.ref, c.ref);
|
387
|
-
return typeof n == "function" || o.isPresent ? /* @__PURE__ */
|
387
|
+
return typeof n == "function" || o.isPresent ? /* @__PURE__ */ G(c, {
|
388
388
|
ref: t
|
389
389
|
}) : null;
|
390
390
|
};
|
@@ -403,12 +403,12 @@ function tt(e) {
|
|
403
403
|
MOUNT: "mounted"
|
404
404
|
}
|
405
405
|
});
|
406
|
-
return
|
406
|
+
return k(() => {
|
407
407
|
const s = q(o.current);
|
408
408
|
t.current = i === "mounted" ? s : "none";
|
409
409
|
}, [
|
410
410
|
i
|
411
|
-
]),
|
411
|
+
]), B(() => {
|
412
412
|
const s = o.current, d = c.current;
|
413
413
|
if (d !== e) {
|
414
414
|
const _ = t.current, f = q(s);
|
@@ -417,7 +417,7 @@ function tt(e) {
|
|
417
417
|
}, [
|
418
418
|
e,
|
419
419
|
l
|
420
|
-
]),
|
420
|
+
]), B(() => {
|
421
421
|
if (r) {
|
422
422
|
const s = (p) => {
|
423
423
|
const f = q(o.current).includes(p.animationName);
|
@@ -440,7 +440,7 @@ function tt(e) {
|
|
440
440
|
"mounted",
|
441
441
|
"unmountSuspended"
|
442
442
|
].includes(i),
|
443
|
-
ref:
|
443
|
+
ref: H((s) => {
|
444
444
|
s && (o.current = getComputedStyle(s)), n(s);
|
445
445
|
}, [])
|
446
446
|
};
|
@@ -451,9 +451,9 @@ function q(e) {
|
|
451
451
|
const nt = be.useId || (() => {
|
452
452
|
});
|
453
453
|
let rt = 0;
|
454
|
-
function
|
454
|
+
function Ae(e) {
|
455
455
|
const [r, n] = be.useState(nt());
|
456
|
-
return
|
456
|
+
return B(() => {
|
457
457
|
n(
|
458
458
|
(o) => o ?? String(rt++)
|
459
459
|
);
|
@@ -461,18 +461,18 @@ function ye(e) {
|
|
461
461
|
e
|
462
462
|
]), r ? `radix-${r}` : "";
|
463
463
|
}
|
464
|
-
const
|
464
|
+
const ye = "Collapsible", [ot, Ce] = oe(ye), [at, ce] = ot(ye), ct = /* @__PURE__ */ S((e, r) => {
|
465
465
|
const { __scopeCollapsible: n, open: o, defaultOpen: c, disabled: t, onOpenChange: a, ...i } = e, [l = !1, s] = ae({
|
466
466
|
prop: o,
|
467
467
|
defaultProp: c,
|
468
468
|
onChange: a
|
469
469
|
});
|
470
|
-
return /* @__PURE__ */
|
470
|
+
return /* @__PURE__ */ y(at, {
|
471
471
|
scope: n,
|
472
472
|
disabled: t,
|
473
|
-
contentId:
|
473
|
+
contentId: Ae(),
|
474
474
|
open: l,
|
475
|
-
onOpenToggle:
|
475
|
+
onOpenToggle: H(
|
476
476
|
() => s(
|
477
477
|
(d) => !d
|
478
478
|
),
|
@@ -480,7 +480,7 @@ const Ae = "Collapsible", [ot, Ce] = oe(Ae), [at, ce] = ot(Ae), ct = /* @__PURE_
|
|
480
480
|
s
|
481
481
|
]
|
482
482
|
)
|
483
|
-
}, /* @__PURE__ */
|
483
|
+
}, /* @__PURE__ */ y(D.div, h({
|
484
484
|
"data-state": ie(l),
|
485
485
|
"data-disabled": t ? "" : void 0
|
486
486
|
}, i, {
|
@@ -488,7 +488,7 @@ const Ae = "Collapsible", [ot, Ce] = oe(Ae), [at, ce] = ot(Ae), ct = /* @__PURE_
|
|
488
488
|
})));
|
489
489
|
}), it = "CollapsibleTrigger", st = /* @__PURE__ */ S((e, r) => {
|
490
490
|
const { __scopeCollapsible: n, ...o } = e, c = ce(it, n);
|
491
|
-
return /* @__PURE__ */
|
491
|
+
return /* @__PURE__ */ y(D.button, h({
|
492
492
|
type: "button",
|
493
493
|
"aria-controls": c.contentId,
|
494
494
|
"aria-expanded": c.open || !1,
|
@@ -501,24 +501,24 @@ const Ae = "Collapsible", [ot, Ce] = oe(Ae), [at, ce] = ot(Ae), ct = /* @__PURE_
|
|
501
501
|
}));
|
502
502
|
}), Ne = "CollapsibleContent", lt = /* @__PURE__ */ S((e, r) => {
|
503
503
|
const { forceMount: n, ...o } = e, c = ce(Ne, e.__scopeCollapsible);
|
504
|
-
return /* @__PURE__ */
|
504
|
+
return /* @__PURE__ */ y(
|
505
505
|
xe,
|
506
506
|
{
|
507
507
|
present: n || c.open
|
508
508
|
},
|
509
|
-
({ present: t }) => /* @__PURE__ */
|
509
|
+
({ present: t }) => /* @__PURE__ */ y(ut, h({}, o, {
|
510
510
|
ref: r,
|
511
511
|
present: t
|
512
512
|
}))
|
513
513
|
);
|
514
514
|
}), ut = /* @__PURE__ */ S((e, r) => {
|
515
515
|
const { __scopeCollapsible: n, present: o, children: c, ...t } = e, a = ce(Ne, n), [i, l] = re(o), s = C(null), d = M(r, s), p = C(0), _ = p.current, f = C(0), b = f.current, x = a.open || i, g = C(x), m = C();
|
516
|
-
return
|
516
|
+
return k(() => {
|
517
517
|
const $ = requestAnimationFrame(
|
518
518
|
() => g.current = !1
|
519
519
|
);
|
520
520
|
return () => cancelAnimationFrame($);
|
521
|
-
}, []),
|
521
|
+
}, []), B(() => {
|
522
522
|
const $ = s.current;
|
523
523
|
if ($) {
|
524
524
|
m.current = m.current || {
|
@@ -531,7 +531,7 @@ const Ae = "Collapsible", [ot, Ce] = oe(Ae), [at, ce] = ot(Ae), ct = /* @__PURE_
|
|
531
531
|
}, [
|
532
532
|
a.open,
|
533
533
|
o
|
534
|
-
]), /* @__PURE__ */
|
534
|
+
]), /* @__PURE__ */ y(D.div, h({
|
535
535
|
"data-state": ie(a.open),
|
536
536
|
"data-disabled": a.disabled ? "" : void 0,
|
537
537
|
id: a.contentId,
|
@@ -567,7 +567,7 @@ const I = "Accordion", _t = [
|
|
567
567
|
const { type: n, ...o } = e, c = o, t = o;
|
568
568
|
return /* @__PURE__ */ u.createElement(se.Provider, {
|
569
569
|
scope: e.__scopeAccordion
|
570
|
-
}, n === "multiple" ? /* @__PURE__ */ u.createElement(
|
570
|
+
}, n === "multiple" ? /* @__PURE__ */ u.createElement(At, h({}, t, {
|
571
571
|
ref: r
|
572
572
|
})) : /* @__PURE__ */ u.createElement(xt, h({}, c, {
|
573
573
|
ref: r
|
@@ -610,7 +610,7 @@ const [Ie, gt] = F(I), [Pe, vt] = F(I, {
|
|
610
610
|
}, /* @__PURE__ */ u.createElement(we, h({}, a, {
|
611
611
|
ref: r
|
612
612
|
}))));
|
613
|
-
}),
|
613
|
+
}), At = /* @__PURE__ */ u.forwardRef((e, r) => {
|
614
614
|
const { value: n, defaultValue: o, onValueChange: c = () => {
|
615
615
|
}, ...t } = e, [a = [], i] = ae({
|
616
616
|
prop: n,
|
@@ -647,7 +647,7 @@ const [Ie, gt] = F(I), [Pe, vt] = F(I, {
|
|
647
647
|
}, /* @__PURE__ */ u.createElement(we, h({}, t, {
|
648
648
|
ref: r
|
649
649
|
}))));
|
650
|
-
}), [
|
650
|
+
}), [yt, K] = F(I), we = /* @__PURE__ */ u.forwardRef((e, r) => {
|
651
651
|
const { __scopeAccordion: n, disabled: o, dir: c, orientation: t = "vertical", ...a } = e, i = u.useRef(null), l = M(i, r), s = mt(n), p = $t(c) === "ltr", _ = ge(e.onKeyDown, (f) => {
|
652
652
|
var b;
|
653
653
|
if (!_t.includes(f.key))
|
@@ -687,23 +687,23 @@ const [Ie, gt] = F(I), [Pe, vt] = F(I, {
|
|
687
687
|
t === "vertical" && W();
|
688
688
|
break;
|
689
689
|
}
|
690
|
-
const
|
691
|
-
(b = g[
|
690
|
+
const je = v % $;
|
691
|
+
(b = g[je].ref.current) === null || b === void 0 || b.focus();
|
692
692
|
});
|
693
|
-
return /* @__PURE__ */ u.createElement(
|
693
|
+
return /* @__PURE__ */ u.createElement(yt, {
|
694
694
|
scope: n,
|
695
695
|
disabled: o,
|
696
696
|
direction: c,
|
697
697
|
orientation: t
|
698
698
|
}, /* @__PURE__ */ u.createElement(se.Slot, {
|
699
699
|
scope: n
|
700
|
-
}, /* @__PURE__ */ u.createElement(
|
700
|
+
}, /* @__PURE__ */ u.createElement(D.div, h({}, a, {
|
701
701
|
"data-orientation": t,
|
702
702
|
ref: l,
|
703
703
|
onKeyDown: o ? void 0 : _
|
704
704
|
}))));
|
705
705
|
}), ne = "AccordionItem", [Ct, ue] = F(ne), Nt = /* @__PURE__ */ u.forwardRef((e, r) => {
|
706
|
-
const { __scopeAccordion: n, value: o, ...c } = e, t = K(ne, n), a = gt(ne, n), i = le(n), l =
|
706
|
+
const { __scopeAccordion: n, value: o, ...c } = e, t = K(ne, n), a = gt(ne, n), i = le(n), l = Ae(), s = o && a.value.includes(o) || !1, d = t.disabled || e.disabled;
|
707
707
|
return /* @__PURE__ */ u.createElement(Ct, {
|
708
708
|
scope: n,
|
709
709
|
open: s,
|
@@ -722,7 +722,7 @@ const [Ie, gt] = F(I), [Pe, vt] = F(I, {
|
|
722
722
|
})));
|
723
723
|
}), Et = "AccordionHeader", It = /* @__PURE__ */ u.forwardRef((e, r) => {
|
724
724
|
const { __scopeAccordion: n, ...o } = e, c = K(I, n), t = ue(Et, n);
|
725
|
-
return /* @__PURE__ */ u.createElement(
|
725
|
+
return /* @__PURE__ */ u.createElement(D.h3, h({
|
726
726
|
"data-orientation": c.orientation,
|
727
727
|
"data-state": Se(t.open),
|
728
728
|
"data-disabled": t.disabled ? "" : void 0
|
@@ -758,8 +758,8 @@ const [Ie, gt] = F(I), [Pe, vt] = F(I, {
|
|
758
758
|
function Se(e) {
|
759
759
|
return e ? "open" : "closed";
|
760
760
|
}
|
761
|
-
const Ot = Ee, Rt = Nt, Tt = It, Mt = Pt,
|
762
|
-
function
|
761
|
+
const Ot = Ee, Rt = Nt, Tt = It, Mt = Pt, kt = St;
|
762
|
+
function Dt(e) {
|
763
763
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
764
764
|
}
|
765
765
|
var Oe = { exports: {} };
|
@@ -798,11 +798,11 @@ var Oe = { exports: {} };
|
|
798
798
|
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
|
799
799
|
})();
|
800
800
|
})(Oe);
|
801
|
-
var
|
802
|
-
const Re = /* @__PURE__ */
|
803
|
-
"purpur-accordion": "_purpur-
|
804
|
-
"purpur-accordion__title": "_purpur-
|
805
|
-
"purpur-accordion--negative": "_purpur-accordion--
|
801
|
+
var jt = Oe.exports;
|
802
|
+
const Re = /* @__PURE__ */ Dt(jt), Lt = {
|
803
|
+
"purpur-accordion": "_purpur-accordion_u887g_1",
|
804
|
+
"purpur-accordion__title": "_purpur-accordion__title_u887g_4",
|
805
|
+
"purpur-accordion--negative": "_purpur-accordion--negative_u887g_13"
|
806
806
|
};
|
807
807
|
function qt(e) {
|
808
808
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
@@ -844,7 +844,7 @@ var Te = { exports: {} };
|
|
844
844
|
})();
|
845
845
|
})(Te);
|
846
846
|
var Vt = Te.exports;
|
847
|
-
const Ut = /* @__PURE__ */ qt(Vt),
|
847
|
+
const Ut = /* @__PURE__ */ qt(Vt), zt = {
|
848
848
|
"purpur-icon": "_purpur-icon_8u1lq_1",
|
849
849
|
"purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
|
850
850
|
"purpur-icon--xs": "_purpur-icon--xs_8u1lq_8",
|
@@ -852,20 +852,20 @@ const Ut = /* @__PURE__ */ qt(Vt), Bt = {
|
|
852
852
|
"purpur-icon--md": "_purpur-icon--md_8u1lq_16",
|
853
853
|
"purpur-icon--lg": "_purpur-icon--lg_8u1lq_20",
|
854
854
|
"purpur-icon--xl": "_purpur-icon--xl_8u1lq_24"
|
855
|
-
},
|
855
|
+
}, Bt = {
|
856
856
|
name: "chevron-down",
|
857
857
|
svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M20.136 7.864a.9.9 0 0 0-1.272 0L12 14.727 5.136 7.864a.9.9 0 0 0-1.272 1.272l7.5 7.5a.9.9 0 0 0 1.272 0l7.5-7.5a.9.9 0 0 0 0-1.272Z" clip-rule="evenodd"/></svg>',
|
858
858
|
keywords: ["chevron-down"],
|
859
859
|
category: "utility"
|
860
|
-
}, Me = (e) => /* @__PURE__ */
|
860
|
+
}, Me = (e) => /* @__PURE__ */ A(
|
861
861
|
Wt,
|
862
862
|
{
|
863
863
|
...e,
|
864
|
-
svg:
|
864
|
+
svg: Bt
|
865
865
|
}
|
866
866
|
);
|
867
867
|
Me.displayName = "IconChevronDown";
|
868
|
-
const
|
868
|
+
const Ht = Ut.bind(zt), de = "purpur-icon", Gt = "md", Ft = (e) => e.filter((r) => Object.keys(r).length >= 1).map((r) => `${r.name}="${r.value}"`).join(" "), Kt = ({ content: e = "", title: r } = {}) => {
|
869
869
|
const n = [
|
870
870
|
{ name: "xmlns", value: "http://www.w3.org/2000/svg" },
|
871
871
|
{ name: "fill", value: "currentColor" },
|
@@ -878,14 +878,14 @@ const Gt = Ut.bind(Bt), de = "purpur-icon", zt = "md", Ft = (e) => e.filter((r)
|
|
878
878
|
svg: r,
|
879
879
|
allyTitle: n,
|
880
880
|
className: o = "",
|
881
|
-
size: c =
|
881
|
+
size: c = Gt,
|
882
882
|
...t
|
883
883
|
}) => {
|
884
884
|
const a = Kt({
|
885
885
|
content: Zt(r.svg),
|
886
886
|
title: n
|
887
|
-
}), i =
|
888
|
-
return /* @__PURE__ */
|
887
|
+
}), i = Ht(o, de, `${de}--${c}`);
|
888
|
+
return /* @__PURE__ */ A(
|
889
889
|
"span",
|
890
890
|
{
|
891
891
|
"aria-label": n,
|
@@ -899,7 +899,7 @@ const Gt = Ut.bind(Bt), de = "purpur-icon", zt = "md", Ft = (e) => e.filter((r)
|
|
899
899
|
function Yt(e) {
|
900
900
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
901
901
|
}
|
902
|
-
var
|
902
|
+
var ke = { exports: {} };
|
903
903
|
/*!
|
904
904
|
Copyright (c) 2018 Jed Watson.
|
905
905
|
Licensed under the MIT License (MIT), see
|
@@ -934,8 +934,8 @@ var De = { exports: {} };
|
|
934
934
|
}
|
935
935
|
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
|
936
936
|
})();
|
937
|
-
})(
|
938
|
-
var Jt =
|
937
|
+
})(ke);
|
938
|
+
var Jt = ke.exports;
|
939
939
|
const Qt = /* @__PURE__ */ Yt(Jt), R = {
|
940
940
|
"purpur-paragraph": "_purpur-paragraph_1rh57_1",
|
941
941
|
"purpur-paragraph--disabled": "_purpur-paragraph--disabled_1rh57_7",
|
@@ -982,18 +982,18 @@ const Qt = /* @__PURE__ */ Yt(Jt), R = {
|
|
982
982
|
[R[`${T}--negative`]]: t
|
983
983
|
}
|
984
984
|
]);
|
985
|
-
return /* @__PURE__ */
|
986
|
-
}, tn = "
|
987
|
-
"purpur-accordion-item": "_purpur-accordion-
|
988
|
-
"purpur-accordion-item__header": "_purpur-accordion-
|
989
|
-
"purpur-accordion-item__trigger": "_purpur-accordion-
|
990
|
-
"purpur-accordion-item__content": "_purpur-accordion-
|
985
|
+
return /* @__PURE__ */ A("p", { ...i, className: l, "data-testid": e, children: r });
|
986
|
+
}, tn = "_slideDown_aukzj_1", nn = "_slideUp_aukzj_1", rn = {
|
987
|
+
"purpur-accordion-item": "_purpur-accordion-item_aukzj_1",
|
988
|
+
"purpur-accordion-item__header": "_purpur-accordion-item__header_aukzj_8",
|
989
|
+
"purpur-accordion-item__trigger": "_purpur-accordion-item__trigger_aukzj_11",
|
990
|
+
"purpur-accordion-item__content": "_purpur-accordion-item__content_aukzj_41",
|
991
991
|
slideDown: tn,
|
992
992
|
slideUp: nn,
|
993
|
-
"purpur-accordion-item__contentText": "_purpur-accordion-
|
994
|
-
"purpur-accordion-item__icon": "_purpur-accordion-
|
995
|
-
"purpur-accordion-item__title": "_purpur-accordion-
|
996
|
-
"purpur-accordion-item--negative": "_purpur-accordion-item--
|
993
|
+
"purpur-accordion-item__contentText": "_purpur-accordion-item__contentText_aukzj_50",
|
994
|
+
"purpur-accordion-item__icon": "_purpur-accordion-item__icon_aukzj_54",
|
995
|
+
"purpur-accordion-item__title": "_purpur-accordion-item__title_aukzj_67",
|
996
|
+
"purpur-accordion-item--negative": "_purpur-accordion-item--negative_aukzj_88"
|
997
997
|
}, P = Re.bind(rn), E = "purpur-accordion-item", on = ({
|
998
998
|
children: e,
|
999
999
|
className: r,
|
@@ -1011,20 +1011,20 @@ const Qt = /* @__PURE__ */ Yt(Jt), R = {
|
|
1011
1011
|
}
|
1012
1012
|
]);
|
1013
1013
|
return /* @__PURE__ */ X(Rt, { className: i, value: n, ...a, children: [
|
1014
|
-
/* @__PURE__ */
|
1014
|
+
/* @__PURE__ */ A(Tt, { className: P(`${E}__header`), asChild: !0, children: /* @__PURE__ */ A(me, { tag: o, variant: "title-100", className: P(`${E}__title`), children: /* @__PURE__ */ X(
|
1015
1015
|
Mt,
|
1016
1016
|
{
|
1017
1017
|
onClick: t,
|
1018
1018
|
className: P(`${E}__trigger`, r),
|
1019
1019
|
children: [
|
1020
1020
|
n,
|
1021
|
-
/* @__PURE__ */
|
1021
|
+
/* @__PURE__ */ A(Me, { size: "md", className: P(`${E}__icon`), "aria-hidden": !0 })
|
1022
1022
|
]
|
1023
1023
|
}
|
1024
1024
|
) }) }),
|
1025
|
-
/* @__PURE__ */
|
1025
|
+
/* @__PURE__ */ A(kt, { className: P(`${E}__content`, r), children: /* @__PURE__ */ A("div", { className: P(`${E}__contentText`), children: typeof e == "string" ? /* @__PURE__ */ A(en, { variant: "paragraph-200", children: e }) : e }) })
|
1026
1026
|
] });
|
1027
|
-
}, fe = Re.bind(
|
1027
|
+
}, fe = Re.bind(Lt), Q = "purpur-accordion", De = ({
|
1028
1028
|
["data-testid"]: e,
|
1029
1029
|
children: r,
|
1030
1030
|
className: n,
|
@@ -1039,17 +1039,17 @@ const Qt = /* @__PURE__ */ Yt(Jt), R = {
|
|
1039
1039
|
{
|
1040
1040
|
[`${Q}--negative`]: o
|
1041
1041
|
}
|
1042
|
-
]), l = () => w.map(r, (s) =>
|
1042
|
+
]), l = () => w.map(r, (s) => G(s, {
|
1043
1043
|
negative: o
|
1044
1044
|
}));
|
1045
1045
|
return /* @__PURE__ */ X(Ot, { className: i, type: "multiple", "data-testid": e, children: [
|
1046
|
-
c ? /* @__PURE__ */
|
1046
|
+
c ? /* @__PURE__ */ A(me, { tag: t, variant: a, className: fe(`${Q}__title`), children: c }) : null,
|
1047
1047
|
l()
|
1048
1048
|
] });
|
1049
1049
|
};
|
1050
|
-
|
1051
|
-
|
1050
|
+
De.Item = on;
|
1051
|
+
De.displayName = "Accordion";
|
1052
1052
|
export {
|
1053
|
-
|
1053
|
+
De as Accordion
|
1054
1054
|
};
|
1055
1055
|
//# sourceMappingURL=accordion.es.js.map
|
package/dist/styles.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
._purpur-
|
1
|
+
._purpur-accordion_u887g_1{container:accordion/inline-size}._purpur-accordion_u887g_1 ._purpur-accordion__title_u887g_4{margin-bottom:var(--purpur-spacing-300);color:var(--purpur-color-text-default)}@container accordion (min-width: 600px){._purpur-accordion_u887g_1 ._purpur-accordion__title_u887g_4{margin-bottom:var(--purpur-spacing-400)}}._purpur-accordion--negative_u887g_13{background-color:var(--purpur-color-purple-900)}._purpur-accordion--negative_u887g_13 ._purpur-accordion__title_u887g_4{color:var(--purpur-color-text-default-negative)}._purpur-accordion-item_aukzj_1{overflow:hidden;border-bottom:var(--purpur-border-width-xs) solid var(--purpur-color-border-weak)}._purpur-accordion-item_aukzj_1:nth-of-type(1){border-top:var(--purpur-border-width-xs) solid var(--purpur-color-border-weak)}._purpur-accordion-item__header_aukzj_8{display:flex}._purpur-accordion-item__trigger_aukzj_11{border:none;padding:0;width:100%;text-align:left;font-family:inherit;font-size:inherit;font-weight:inherit;color:inherit;line-height:inherit;background-color:transparent;transition:background-color var(--purpur-motion-duration-150) ease;display:flex;align-items:center;justify-content:space-between;column-gap:var(--purpur-spacing-100);padding:var(--purpur-spacing-200) var(--purpur-spacing-200) var(--purpur-spacing-200) 0;cursor:pointer;outline:none}@container accordion (min-width: 600px){._purpur-accordion-item__trigger_aukzj_11{padding:var(--purpur-spacing-300) var(--purpur-spacing-300) var(--purpur-spacing-300) 0}}@container accordion (min-width: 1024px){._purpur-accordion-item__trigger_aukzj_11{padding:var(--purpur-spacing-400) var(--purpur-spacing-300) var(--purpur-spacing-400) 0}}._purpur-accordion-item__content_aukzj_41{overflow:hidden}._purpur-accordion-item__content_aukzj_41[data-state=open]{animation:_slideDown_aukzj_1 var(--purpur-motion-duration-150) ease-in-out}._purpur-accordion-item__content_aukzj_41[data-state=closed]{animation:_slideUp_aukzj_1 var(--purpur-motion-duration-150) ease-in-out}._purpur-accordion-item__contentText_aukzj_50{padding:var(--purpur-spacing-200) 0;max-width:calc(var(--purpur-spacing-1200) / .16)}._purpur-accordion-item__icon_aukzj_54{flex-shrink:0;height:var(--purpur-spacing-300);width:var(--purpur-spacing-300);transition:transform var(--purpur-motion-duration-150) ease-in-out}._purpur-accordion-item__trigger_aukzj_11[data-state=open]>._purpur-accordion-item__icon_aukzj_54{transform:rotate(180deg)}._purpur-accordion-item_aukzj_1:has(:focus-visible){outline:none;box-shadow:0 0 0 var(--purpur-border-width-sm) var(--purpur-color-border-interactive-focus)}._purpur-accordion-item_aukzj_1 ._purpur-accordion-item__title_aukzj_67{max-width:100%}._purpur-accordion-item_aukzj_1 ._purpur-accordion-item__title_aukzj_67,._purpur-accordion-item__icon_aukzj_54{color:var(--purpur-color-text-interactive-primary)}._purpur-accordion-item__trigger_aukzj_11:hover{background-color:var(--purpur-color-background-interactive-transparent-hover)}._purpur-accordion-item__trigger_aukzj_11:hover ._purpur-accordion-item__title_aukzj_67,._purpur-accordion-item__trigger_aukzj_11:hover__icon{color:var(--purpur-color-text-interactive-primary-hover)}._purpur-accordion-item__trigger_aukzj_11:active{background-color:var(--purpur-color-background-interactive-transparent-active)}._purpur-accordion-item__trigger_aukzj_11:active ._purpur-accordion-item__title_aukzj_67,._purpur-accordion-item__trigger_aukzj_11:active__icon{color:var(--purpur-color-text-interactive-primary-active)}._purpur-accordion-item__contentText_aukzj_50 p{color:var(--purpur-color-text-default)}._purpur-accordion-item--negative_aukzj_88{border-bottom:var(--purpur-border-width-xs) solid var(--purpur-color-border-weak-negative)}._purpur-accordion-item--negative_aukzj_88:nth-of-type(1){border-top:var(--purpur-border-width-xs) solid var(--purpur-color-border-weak-negative)}._purpur-accordion-item--negative_aukzj_88 ._purpur-accordion-item__title_aukzj_67,._purpur-accordion-item--negative_aukzj_88 ._purpur-accordion-item__icon_aukzj_54{color:var(--purpur-color-text-interactive-primary-negative)}._purpur-accordion-item--negative_aukzj_88 ._purpur-accordion-item__trigger_aukzj_11:hover{background-color:var(--purpur-color-background-interactive-transparent-negative-hover)}._purpur-accordion-item--negative_aukzj_88 ._purpur-accordion-item__trigger_aukzj_11:hover ._purpur-accordion-item__title_aukzj_67,._purpur-accordion-item--negative_aukzj_88 ._purpur-accordion-item__trigger_aukzj_11:hover ._purpur-accordion-item__icon_aukzj_54{color:var(--purpur-color-border-interactive-primary-negative-hover)}._purpur-accordion-item--negative_aukzj_88 ._purpur-accordion-item__trigger_aukzj_11:active{background-color:var(--purpur-color-background-interactive-transparent-negative-active)}._purpur-accordion-item--negative_aukzj_88 ._purpur-accordion-item__trigger_aukzj_11:active ._purpur-accordion-item__title_aukzj_67,._purpur-accordion-item--negative_aukzj_88 ._purpur-accordion-item__trigger_aukzj_11:active ._purpur-accordion-item__icon_aukzj_54{color:var(--purpur-color-border-interactive-primary-negative-active)}._purpur-accordion-item--negative_aukzj_88 ._purpur-accordion-item__contentText_aukzj_50 p{color:var(--purpur-color-text-default-negative)}@keyframes _slideDown_aukzj_1{0%{height:0}to{height:var(--radix-accordion-content-height)}}@keyframes _slideUp_aukzj_1{0%{height:var(--radix-accordion-content-height)}to{height:0}}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@purpurds/accordion",
|
3
|
-
"version": "5.8.
|
3
|
+
"version": "5.8.2",
|
4
4
|
"license": "AGPL-3.0-only",
|
5
5
|
"main": "./dist/accordion.cjs.js",
|
6
6
|
"types": "./dist/accordion.d.ts",
|
@@ -16,10 +16,10 @@
|
|
16
16
|
"dependencies": {
|
17
17
|
"classnames": "~2.5.0",
|
18
18
|
"@radix-ui/react-accordion": "~1.1.2",
|
19
|
-
"@purpurds/
|
20
|
-
"@purpurds/
|
21
|
-
"@purpurds/
|
22
|
-
"@purpurds/
|
19
|
+
"@purpurds/tokens": "5.8.2",
|
20
|
+
"@purpurds/heading": "5.8.2",
|
21
|
+
"@purpurds/icon": "5.8.2",
|
22
|
+
"@purpurds/paragraph": "5.8.2"
|
23
23
|
},
|
24
24
|
"devDependencies": {
|
25
25
|
"@rushstack/eslint-patch": "~1.10.0",
|
@@ -17,6 +17,7 @@
|
|
17
17
|
border: none;
|
18
18
|
padding: 0;
|
19
19
|
width: 100%;
|
20
|
+
text-align: left;
|
20
21
|
font-family: inherit;
|
21
22
|
font-size: inherit;
|
22
23
|
font-weight: inherit;
|
@@ -27,15 +28,16 @@
|
|
27
28
|
display: flex;
|
28
29
|
align-items: center;
|
29
30
|
justify-content: space-between;
|
31
|
+
column-gap: var(--purpur-spacing-100);
|
30
32
|
padding: var(--purpur-spacing-200) var(--purpur-spacing-200) var(--purpur-spacing-200) 0;
|
31
33
|
cursor: pointer;
|
32
34
|
outline: none;
|
33
35
|
|
34
|
-
@
|
36
|
+
@container accordion (min-width: #{$purpur-breakpoint-md}) {
|
35
37
|
padding: var(--purpur-spacing-300) var(--purpur-spacing-300) var(--purpur-spacing-300) 0;
|
36
38
|
}
|
37
39
|
|
38
|
-
@
|
40
|
+
@container accordion (min-width: #{$purpur-breakpoint-lg}) {
|
39
41
|
padding: var(--purpur-spacing-400) var(--purpur-spacing-300) var(--purpur-spacing-400) 0;
|
40
42
|
}
|
41
43
|
}
|
@@ -54,7 +56,7 @@
|
|
54
56
|
|
55
57
|
&__contentText {
|
56
58
|
padding: var(--purpur-spacing-200) 0;
|
57
|
-
max-width:
|
59
|
+
max-width: calc(var(--purpur-spacing-1200) / 0.16);
|
58
60
|
}
|
59
61
|
|
60
62
|
&__icon {
|
@@ -73,8 +75,8 @@
|
|
73
75
|
box-shadow: 0 0 0 var(--purpur-border-width-sm) var(--purpur-color-border-interactive-focus);
|
74
76
|
}
|
75
77
|
|
76
|
-
|
77
|
-
|
78
|
+
#{$root}__title {
|
79
|
+
max-width: 100%;
|
78
80
|
}
|
79
81
|
|
80
82
|
#{$root}__title,
|
@@ -3,12 +3,13 @@
|
|
3
3
|
.purpur-accordion {
|
4
4
|
$root: &;
|
5
5
|
|
6
|
+
container: accordion / inline-size;
|
7
|
+
|
6
8
|
#{$root}__title {
|
7
|
-
max-width: 100%;
|
8
9
|
margin-bottom: var(--purpur-spacing-300);
|
9
10
|
color: var(--purpur-color-text-default);
|
10
11
|
|
11
|
-
@
|
12
|
+
@container accordion (min-width: #{$purpur-breakpoint-md}) {
|
12
13
|
margin-bottom: var(--purpur-spacing-400);
|
13
14
|
}
|
14
15
|
}
|
@@ -20,4 +21,4 @@
|
|
20
21
|
color: var(--purpur-color-text-default-negative);
|
21
22
|
}
|
22
23
|
}
|
23
|
-
}
|
24
|
+
}
|