@purpurds/radio-card-group 6.10.0 → 6.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/LICENSE.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Name: @purpurds/heading
|
|
2
|
-
Version: 6.
|
|
2
|
+
Version: 6.11.0
|
|
3
3
|
License: AGPL-3.0-only
|
|
4
4
|
Private: false
|
|
5
5
|
|
|
@@ -184,13 +184,13 @@ SOFTWARE.
|
|
|
184
184
|
---
|
|
185
185
|
|
|
186
186
|
Name: @purpurds/paragraph
|
|
187
|
-
Version: 6.
|
|
187
|
+
Version: 6.11.0
|
|
188
188
|
License: AGPL-3.0-only
|
|
189
189
|
Private: false
|
|
190
190
|
|
|
191
191
|
---
|
|
192
192
|
|
|
193
193
|
Name: @purpurds/skeleton
|
|
194
|
-
Version: 6.
|
|
194
|
+
Version: 6.11.0
|
|
195
195
|
License: AGPL-3.0-only
|
|
196
196
|
Private: false
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Copyright (c) 2018 Jed Watson.
|
|
3
3
|
Licensed under the MIT License (MIT), see
|
|
4
4
|
http://jedwatson.github.io/classnames
|
|
5
|
-
*/var ae;function ze(){return ae||(ae=1,function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r="",i=0;i<arguments.length;i++){var u=arguments[i];u&&(r=a(r,o(u)))}return r}function o(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return n.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var i="";for(var u in r)t.call(r,u)&&r[u]&&(i=a(i,u));return i}function a(r,i){return i?r?r+" "+i:r+i:r}e.exports?(n.default=n,e.exports=n):window.classNames=n})()}(oe)),oe.exports}var Ve=ze();const Ke=Ue(Ve),T={"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"},Be={TITLE100:"title-100"},M="purpur-heading",le=({["data-testid"]:e,children:t,className:n="",enableHyphenation:o=!1,negative:a=!1,tag:r,variant:i=Be.TITLE100,...u})=>{const c=r,p=Ke([n,T[M],T[`${M}--${i}`],{[T[`${M}--hyphens`]]:o,[T[`${M}--negative`]]:a}]);return d.jsx(c,{...u,className:p,"data-testid":e,children:t})};le.displayName="Heading";function N(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function ie(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function fe(...e){return t=>{let n=!1;const o=e.map(a=>{const r=ie(a,t);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let a=0;a<o.length;a++){const r=o[a];typeof r=="function"?r():ie(e[a],null)}}}}function O(...e){return s.useCallback(fe(...e),e)}function q(e,t=[]){let n=[];function o(r,i){const u=s.createContext(i),c=n.length;n=[...n,i];const p=m=>{var y;const{scope:_,children:l,...f}=m,h=((y=_==null?void 0:_[e])==null?void 0:y[c])||u,v=s.useMemo(()=>f,Object.values(f));return d.jsx(h.Provider,{value:v,children:l})};p.displayName=r+"Provider";function g(m,_){var h;const l=((h=_==null?void 0:_[e])==null?void 0:h[c])||u,f=s.useContext(l);if(f)return f;if(i!==void 0)return i;throw new Error(`\`${m}\` must be used within \`${r}\``)}return[p,g]}const a=()=>{const r=n.map(i=>s.createContext(i));return function(u){const c=(u==null?void 0:u[e])||r;return s.useMemo(()=>({[`__scope${e}`]:{...u,[e]:c}}),[u,c])}};return a.scopeName=e,[o,We(a,...t)]}function We(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(r){const i=o.reduce((u,{useScope:c,scopeName:p})=>{const m=c(r)[`__scope${p}`];return{...u,...m}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var G=s.forwardRef((e,t)=>{const{children:n,...o}=e,a=s.Children.toArray(n),r=a.find(Ye);if(r){const i=r.props.children,u=a.map(c=>c===r?s.Children.count(i)>1?s.Children.only(null):s.isValidElement(i)?i.props.children:null:c);return d.jsx(X,{...o,ref:t,children:s.isValidElement(i)?s.cloneElement(i,void 0,u):null})}return d.jsx(X,{...o,ref:t,children:n})});G.displayName="Slot";var X=s.forwardRef((e,t)=>{const{children:n,...o}=e;if(s.isValidElement(n)){const a=Ze(n),r=Xe(o,n.props);return n.type!==s.Fragment&&(r.ref=t?fe(t,a):a),s.cloneElement(n,r)}return s.Children.count(n)>1?s.Children.only(null):null});X.displayName="SlotClone";var He=({children:e})=>d.jsx(d.Fragment,{children:e});function Ye(e){return s.isValidElement(e)&&e.type===He}function Xe(e,t){const n={...t};for(const o in t){const a=e[o],r=t[o];/^on[A-Z]/.test(o)?a&&r?n[o]=(...u)=>{r(...u),a(...u)}:a&&(n[o]=a):o==="style"?n[o]={...a,...r}:o==="className"&&(n[o]=[a,r].filter(Boolean).join(" "))}return{...e,...n}}function Ze(e){var o,a;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=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Je=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],k=Je.reduce((e,t)=>{const n=s.forwardRef((o,a)=>{const{asChild:r,...i}=o,u=r?G:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(u,{...i,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Qe(e){const t=e+"CollectionProvider",[n,o]=q(t),[a,r]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=l=>{const{scope:f,children:h}=l,v=R.useRef(null),y=R.useRef(new Map).current;return d.jsx(a,{scope:f,itemMap:y,collectionRef:v,children:h})};i.displayName=t;const u=e+"CollectionSlot",c=R.forwardRef((l,f)=>{const{scope:h,children:v}=l,y=r(u,h),b=O(f,y.collectionRef);return d.jsx(G,{ref:b,children:v})});c.displayName=u;const p=e+"CollectionItemSlot",g="data-radix-collection-item",m=R.forwardRef((l,f)=>{const{scope:h,children:v,...y}=l,b=R.useRef(null),A=O(f,b),w=r(p,h);return R.useEffect(()=>(w.itemMap.set(b,{ref:b,...y}),()=>void w.itemMap.delete(b))),d.jsx(G,{[g]:"",ref:A,children:v})});m.displayName=p;function _(l){const f=r(e+"CollectionConsumer",l);return R.useCallback(()=>{const v=f.collectionRef.current;if(!v)return[];const y=Array.from(v.querySelectorAll(`[${g}]`));return Array.from(f.itemMap.values()).sort((w,E)=>y.indexOf(w.ref.current)-y.indexOf(E.ref.current))},[f.collectionRef,f.itemMap])}return[{Provider:i,Slot:c,ItemSlot:m},_,o]}var L=globalThis!=null&&globalThis.document?s.useLayoutEffect:()=>{},er=s.useId||(()=>{}),rr=0;function tr(e){const[t,n]=s.useState(er());return L(()=>{n(o=>o??String(rr++))},[e]),t?`radix-${t}`:""}function Q(e){const t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>(...n)=>{var o;return(o=t.current)==null?void 0:o.call(t,...n)},[])}function me({prop:e,defaultProp:t,onChange:n=()=>{}}){const[o,a]=nr({defaultProp:t,onChange:n}),r=e!==void 0,i=r?e:o,u=Q(n),c=s.useCallback(p=>{if(r){const m=typeof p=="function"?p(e):p;m!==e&&u(m)}else a(p)},[r,e,a,u]);return[i,c]}function nr({defaultProp:e,onChange:t}){const n=s.useState(e),[o]=n,a=s.useRef(o),r=Q(t);return s.useEffect(()=>{a.current!==o&&(r(o),a.current=o)},[o,a,r]),n}var or=s.createContext(void 0);function _e(e){const t=s.useContext(or);return e||t||"ltr"}var K="rovingFocusGroup.onEntryFocus",ar={bubbles:!1,cancelable:!0},U="RovingFocusGroup",[Z,ge,ir]=Qe(U),[ur,he]=q(U,[ir]),[sr,cr]=ur(U),ve=s.forwardRef((e,t)=>d.jsx(Z.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(Z.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx(pr,{...e,ref:t})})}));ve.displayName=U;var pr=s.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:a=!1,dir:r,currentTabStopId:i,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:c,onEntryFocus:p,preventScrollOnEntryFocus:g=!1,...m}=e,_=s.useRef(null),l=O(t,_),f=_e(r),[h=null,v]=me({prop:i,defaultProp:u,onChange:c}),[y,b]=s.useState(!1),A=Q(p),w=ge(n),E=s.useRef(!1),[$e,te]=s.useState(0);return s.useEffect(()=>{const C=_.current;if(C)return C.addEventListener(K,A),()=>C.removeEventListener(K,A)},[A]),d.jsx(sr,{scope:n,orientation:o,dir:f,loop:a,currentTabStopId:h,onItemFocus:s.useCallback(C=>v(C),[v]),onItemShiftTab:s.useCallback(()=>b(!0),[]),onFocusableItemAdd:s.useCallback(()=>te(C=>C+1),[]),onFocusableItemRemove:s.useCallback(()=>te(C=>C-1),[]),children:d.jsx(k.div,{tabIndex:y||$e===0?-1:0,"data-orientation":o,...m,ref:l,style:{outline:"none",...e.style},onMouseDown:N(e.onMouseDown,()=>{E.current=!0}),onFocus:N(e.onFocus,C=>{const Fe=!E.current;if(C.target===C.currentTarget&&Fe&&!y){const ne=new CustomEvent(K,ar);if(C.currentTarget.dispatchEvent(ne),!ne.defaultPrevented){const V=w().filter(I=>I.focusable),De=V.find(I=>I.active),Ge=V.find(I=>I.id===h),Le=[De,Ge,...V].filter(Boolean).map(I=>I.ref.current);Re(Le,g)}}E.current=!1}),onBlur:N(e.onBlur,()=>b(!1))})})}),ye="RovingFocusGroupItem",be=s.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:a=!1,tabStopId:r,...i}=e,u=tr(),c=r||u,p=cr(ye,n),g=p.currentTabStopId===c,m=ge(n),{onFocusableItemAdd:_,onFocusableItemRemove:l}=p;return s.useEffect(()=>{if(o)return _(),()=>l()},[o,_,l]),d.jsx(Z.ItemSlot,{scope:n,id:c,focusable:o,active:a,children:d.jsx(k.span,{tabIndex:g?0:-1,"data-orientation":p.orientation,...i,ref:t,onMouseDown:N(e.onMouseDown,f=>{o?p.onItemFocus(c):f.preventDefault()}),onFocus:N(e.onFocus,()=>p.onItemFocus(c)),onKeyDown:N(e.onKeyDown,f=>{if(f.key==="Tab"&&f.shiftKey){p.onItemShiftTab();return}if(f.target!==f.currentTarget)return;const h=fr(f,p.orientation,p.dir);if(h!==void 0){if(f.metaKey||f.ctrlKey||f.altKey||f.shiftKey)return;f.preventDefault();let y=m().filter(b=>b.focusable).map(b=>b.ref.current);if(h==="last")y.reverse();else if(h==="prev"||h==="next"){h==="prev"&&y.reverse();const b=y.indexOf(f.currentTarget);y=p.loop?mr(y,b+1):y.slice(b+1)}setTimeout(()=>Re(y))}})})})});be.displayName=ye;var dr={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function lr(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function fr(e,t,n){const o=lr(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return dr[o]}function Re(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function mr(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var _r=ve,gr=be;function hr(e){const[t,n]=s.useState(void 0);return L(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const r=a[0];let i,u;if("borderBoxSize"in r){const c=r.borderBoxSize,p=Array.isArray(c)?c[0]:c;i=p.inlineSize,u=p.blockSize}else i=e.offsetWidth,u=e.offsetHeight;n({width:i,height:u})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}function vr(e){const t=s.useRef({value:e,previous:e});return s.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function yr(e,t){return s.useReducer((n,o)=>t[n][o]??n,e)}var Ce=e=>{const{present:t,children:n}=e,o=br(t),a=typeof n=="function"?n({present:o.isPresent}):s.Children.only(n),r=O(o.ref,Rr(a));return typeof n=="function"||o.isPresent?s.cloneElement(a,{ref:r}):null};Ce.displayName="Presence";function br(e){const[t,n]=s.useState(),o=s.useRef({}),a=s.useRef(e),r=s.useRef("none"),i=e?"mounted":"unmounted",[u,c]=yr(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{const p=$(o.current);r.current=u==="mounted"?p:"none"},[u]),L(()=>{const p=o.current,g=a.current;if(g!==e){const _=r.current,l=$(p);e?c("MOUNT"):l==="none"||(p==null?void 0:p.display)==="none"?c("UNMOUNT"):c(g&&_!==l?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,c]),L(()=>{if(t){let p;const g=t.ownerDocument.defaultView??window,m=l=>{const h=$(o.current).includes(l.animationName);if(l.target===t&&h&&(c("ANIMATION_END"),!a.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",p=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},_=l=>{l.target===t&&(r.current=$(o.current))};return t.addEventListener("animationstart",_),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{g.clearTimeout(p),t.removeEventListener("animationstart",_),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:s.useCallback(p=>{p&&(o.current=getComputedStyle(p)),n(p)},[])}}function $(e){return(e==null?void 0:e.animationName)||"none"}function Rr(e){var o,a;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=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ee="Radio",[Cr,Se]=q(ee),[Sr,xr]=Cr(ee),xe=s.forwardRef((e,t)=>{const{__scopeRadio:n,name:o,checked:a=!1,required:r,disabled:i,value:u="on",onCheck:c,form:p,...g}=e,[m,_]=s.useState(null),l=O(t,v=>_(v)),f=s.useRef(!1),h=m?p||!!m.closest("form"):!0;return d.jsxs(Sr,{scope:n,checked:a,disabled:i,children:[d.jsx(k.button,{type:"button",role:"radio","aria-checked":a,"data-state":Ae(a),"data-disabled":i?"":void 0,disabled:i,value:u,...g,ref:l,onClick:N(e.onClick,v=>{a||c==null||c(),h&&(f.current=v.isPropagationStopped(),f.current||v.stopPropagation())})}),h&&d.jsx(Nr,{control:m,bubbles:!f.current,name:o,value:u,checked:a,required:r,disabled:i,form:p,style:{transform:"translateX(-100%)"}})]})});xe.displayName=ee;var Ne="RadioIndicator",Ie=s.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:o,...a}=e,r=xr(Ne,n);return d.jsx(Ce,{present:o||r.checked,children:d.jsx(k.span,{"data-state":Ae(r.checked),"data-disabled":r.disabled?"":void 0,...a,ref:t})})});Ie.displayName=Ne;var Nr=e=>{const{control:t,checked:n,bubbles:o=!0,...a}=e,r=s.useRef(null),i=vr(n),u=hr(t);return s.useEffect(()=>{const c=r.current,p=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(p,"checked").set;if(i!==n&&m){const _=new Event("click",{bubbles:o});m.call(c,n),c.dispatchEvent(_)}},[i,n,o]),d.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:r,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Ae(e){return e?"checked":"unchecked"}var Ir=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],re="RadioGroup",[Ar,nt]=q(re,[he,Se]),we=he(),Oe=Se(),[wr,Or]=Ar(re),Ee=s.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:o,defaultValue:a,value:r,required:i=!1,disabled:u=!1,orientation:c,dir:p,loop:g=!0,onValueChange:m,..._}=e,l=we(n),f=_e(p),[h,v]=me({prop:r,defaultProp:a,onChange:m});return d.jsx(wr,{scope:n,name:o,required:i,disabled:u,value:h,onValueChange:v,children:d.jsx(_r,{asChild:!0,...l,orientation:c,dir:f,loop:g,children:d.jsx(k.div,{role:"radiogroup","aria-required":i,"aria-orientation":c,"data-disabled":u?"":void 0,dir:f,..._,ref:t})})})});Ee.displayName=re;var Pe="RadioGroupItem",je=s.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:o,...a}=e,r=Or(Pe,n),i=r.disabled||o,u=we(n),c=Oe(n),p=s.useRef(null),g=O(t,p),m=r.value===a.value,_=s.useRef(!1);return s.useEffect(()=>{const l=h=>{Ir.includes(h.key)&&(_.current=!0)},f=()=>_.current=!1;return document.addEventListener("keydown",l),document.addEventListener("keyup",f),()=>{document.removeEventListener("keydown",l),document.removeEventListener("keyup",f)}},[]),d.jsx(gr,{asChild:!0,...u,focusable:!i,active:m,children:d.jsx(xe,{disabled:i,required:r.required,checked:m,...c,...a,name:r.name,ref:g,onCheck:()=>r.onValueChange(a.value),onKeyDown:N(l=>{l.key==="Enter"&&l.preventDefault()}),onFocus:N(a.onFocus,()=>{var l;_.current&&((l=p.current)==null||l.click())})})})});je.displayName=Pe;var Er="RadioGroupIndicator",ke=s.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...o}=e,a=Oe(n);return d.jsx(Ie,{...a,...o,ref:t})});ke.displayName=Er;var Pr=Ee,jr=je,kr=ke;function Tr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var B={exports:{}};/*!
|
|
5
|
+
*/var ae;function ze(){return ae||(ae=1,function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r="",i=0;i<arguments.length;i++){var u=arguments[i];u&&(r=a(r,o(u)))}return r}function o(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return n.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var i="";for(var u in r)t.call(r,u)&&r[u]&&(i=a(i,u));return i}function a(r,i){return i?r?r+" "+i:r+i:r}e.exports?(n.default=n,e.exports=n):window.classNames=n})()}(oe)),oe.exports}var Ve=ze();const Ke=Ue(Ve),T={"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"},Be={TITLE100:"title-100"},M="purpur-heading",le=({children:e,className:t="",enableHyphenation:n=!1,negative:o=!1,tag:a,variant:r=Be.TITLE100,...i})=>{const u=a,c=Ke([t,T[M],T[`${M}--${r}`],{[T[`${M}--hyphens`]]:n,[T[`${M}--negative`]]:o}]);return d.jsx(u,{className:c,...i,children:e})};le.displayName="Heading";function N(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function ie(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function fe(...e){return t=>{let n=!1;const o=e.map(a=>{const r=ie(a,t);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let a=0;a<o.length;a++){const r=o[a];typeof r=="function"?r():ie(e[a],null)}}}}function O(...e){return s.useCallback(fe(...e),e)}function q(e,t=[]){let n=[];function o(r,i){const u=s.createContext(i),c=n.length;n=[...n,i];const p=m=>{var y;const{scope:_,children:l,...f}=m,h=((y=_==null?void 0:_[e])==null?void 0:y[c])||u,v=s.useMemo(()=>f,Object.values(f));return d.jsx(h.Provider,{value:v,children:l})};p.displayName=r+"Provider";function g(m,_){var h;const l=((h=_==null?void 0:_[e])==null?void 0:h[c])||u,f=s.useContext(l);if(f)return f;if(i!==void 0)return i;throw new Error(`\`${m}\` must be used within \`${r}\``)}return[p,g]}const a=()=>{const r=n.map(i=>s.createContext(i));return function(u){const c=(u==null?void 0:u[e])||r;return s.useMemo(()=>({[`__scope${e}`]:{...u,[e]:c}}),[u,c])}};return a.scopeName=e,[o,We(a,...t)]}function We(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(r){const i=o.reduce((u,{useScope:c,scopeName:p})=>{const m=c(r)[`__scope${p}`];return{...u,...m}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var G=s.forwardRef((e,t)=>{const{children:n,...o}=e,a=s.Children.toArray(n),r=a.find(Ye);if(r){const i=r.props.children,u=a.map(c=>c===r?s.Children.count(i)>1?s.Children.only(null):s.isValidElement(i)?i.props.children:null:c);return d.jsx(X,{...o,ref:t,children:s.isValidElement(i)?s.cloneElement(i,void 0,u):null})}return d.jsx(X,{...o,ref:t,children:n})});G.displayName="Slot";var X=s.forwardRef((e,t)=>{const{children:n,...o}=e;if(s.isValidElement(n)){const a=Ze(n),r=Xe(o,n.props);return n.type!==s.Fragment&&(r.ref=t?fe(t,a):a),s.cloneElement(n,r)}return s.Children.count(n)>1?s.Children.only(null):null});X.displayName="SlotClone";var He=({children:e})=>d.jsx(d.Fragment,{children:e});function Ye(e){return s.isValidElement(e)&&e.type===He}function Xe(e,t){const n={...t};for(const o in t){const a=e[o],r=t[o];/^on[A-Z]/.test(o)?a&&r?n[o]=(...u)=>{r(...u),a(...u)}:a&&(n[o]=a):o==="style"?n[o]={...a,...r}:o==="className"&&(n[o]=[a,r].filter(Boolean).join(" "))}return{...e,...n}}function Ze(e){var o,a;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=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Je=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],k=Je.reduce((e,t)=>{const n=s.forwardRef((o,a)=>{const{asChild:r,...i}=o,u=r?G:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(u,{...i,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Qe(e){const t=e+"CollectionProvider",[n,o]=q(t),[a,r]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=l=>{const{scope:f,children:h}=l,v=R.useRef(null),y=R.useRef(new Map).current;return d.jsx(a,{scope:f,itemMap:y,collectionRef:v,children:h})};i.displayName=t;const u=e+"CollectionSlot",c=R.forwardRef((l,f)=>{const{scope:h,children:v}=l,y=r(u,h),b=O(f,y.collectionRef);return d.jsx(G,{ref:b,children:v})});c.displayName=u;const p=e+"CollectionItemSlot",g="data-radix-collection-item",m=R.forwardRef((l,f)=>{const{scope:h,children:v,...y}=l,b=R.useRef(null),A=O(f,b),w=r(p,h);return R.useEffect(()=>(w.itemMap.set(b,{ref:b,...y}),()=>void w.itemMap.delete(b))),d.jsx(G,{[g]:"",ref:A,children:v})});m.displayName=p;function _(l){const f=r(e+"CollectionConsumer",l);return R.useCallback(()=>{const v=f.collectionRef.current;if(!v)return[];const y=Array.from(v.querySelectorAll(`[${g}]`));return Array.from(f.itemMap.values()).sort((w,E)=>y.indexOf(w.ref.current)-y.indexOf(E.ref.current))},[f.collectionRef,f.itemMap])}return[{Provider:i,Slot:c,ItemSlot:m},_,o]}var L=globalThis!=null&&globalThis.document?s.useLayoutEffect:()=>{},er=s.useId||(()=>{}),rr=0;function tr(e){const[t,n]=s.useState(er());return L(()=>{n(o=>o??String(rr++))},[e]),t?`radix-${t}`:""}function Q(e){const t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>(...n)=>{var o;return(o=t.current)==null?void 0:o.call(t,...n)},[])}function me({prop:e,defaultProp:t,onChange:n=()=>{}}){const[o,a]=nr({defaultProp:t,onChange:n}),r=e!==void 0,i=r?e:o,u=Q(n),c=s.useCallback(p=>{if(r){const m=typeof p=="function"?p(e):p;m!==e&&u(m)}else a(p)},[r,e,a,u]);return[i,c]}function nr({defaultProp:e,onChange:t}){const n=s.useState(e),[o]=n,a=s.useRef(o),r=Q(t);return s.useEffect(()=>{a.current!==o&&(r(o),a.current=o)},[o,a,r]),n}var or=s.createContext(void 0);function _e(e){const t=s.useContext(or);return e||t||"ltr"}var K="rovingFocusGroup.onEntryFocus",ar={bubbles:!1,cancelable:!0},U="RovingFocusGroup",[Z,ge,ir]=Qe(U),[ur,he]=q(U,[ir]),[sr,cr]=ur(U),ve=s.forwardRef((e,t)=>d.jsx(Z.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(Z.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx(pr,{...e,ref:t})})}));ve.displayName=U;var pr=s.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:a=!1,dir:r,currentTabStopId:i,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:c,onEntryFocus:p,preventScrollOnEntryFocus:g=!1,...m}=e,_=s.useRef(null),l=O(t,_),f=_e(r),[h=null,v]=me({prop:i,defaultProp:u,onChange:c}),[y,b]=s.useState(!1),A=Q(p),w=ge(n),E=s.useRef(!1),[$e,te]=s.useState(0);return s.useEffect(()=>{const C=_.current;if(C)return C.addEventListener(K,A),()=>C.removeEventListener(K,A)},[A]),d.jsx(sr,{scope:n,orientation:o,dir:f,loop:a,currentTabStopId:h,onItemFocus:s.useCallback(C=>v(C),[v]),onItemShiftTab:s.useCallback(()=>b(!0),[]),onFocusableItemAdd:s.useCallback(()=>te(C=>C+1),[]),onFocusableItemRemove:s.useCallback(()=>te(C=>C-1),[]),children:d.jsx(k.div,{tabIndex:y||$e===0?-1:0,"data-orientation":o,...m,ref:l,style:{outline:"none",...e.style},onMouseDown:N(e.onMouseDown,()=>{E.current=!0}),onFocus:N(e.onFocus,C=>{const Fe=!E.current;if(C.target===C.currentTarget&&Fe&&!y){const ne=new CustomEvent(K,ar);if(C.currentTarget.dispatchEvent(ne),!ne.defaultPrevented){const V=w().filter(I=>I.focusable),De=V.find(I=>I.active),Ge=V.find(I=>I.id===h),Le=[De,Ge,...V].filter(Boolean).map(I=>I.ref.current);Re(Le,g)}}E.current=!1}),onBlur:N(e.onBlur,()=>b(!1))})})}),ye="RovingFocusGroupItem",be=s.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:a=!1,tabStopId:r,...i}=e,u=tr(),c=r||u,p=cr(ye,n),g=p.currentTabStopId===c,m=ge(n),{onFocusableItemAdd:_,onFocusableItemRemove:l}=p;return s.useEffect(()=>{if(o)return _(),()=>l()},[o,_,l]),d.jsx(Z.ItemSlot,{scope:n,id:c,focusable:o,active:a,children:d.jsx(k.span,{tabIndex:g?0:-1,"data-orientation":p.orientation,...i,ref:t,onMouseDown:N(e.onMouseDown,f=>{o?p.onItemFocus(c):f.preventDefault()}),onFocus:N(e.onFocus,()=>p.onItemFocus(c)),onKeyDown:N(e.onKeyDown,f=>{if(f.key==="Tab"&&f.shiftKey){p.onItemShiftTab();return}if(f.target!==f.currentTarget)return;const h=fr(f,p.orientation,p.dir);if(h!==void 0){if(f.metaKey||f.ctrlKey||f.altKey||f.shiftKey)return;f.preventDefault();let y=m().filter(b=>b.focusable).map(b=>b.ref.current);if(h==="last")y.reverse();else if(h==="prev"||h==="next"){h==="prev"&&y.reverse();const b=y.indexOf(f.currentTarget);y=p.loop?mr(y,b+1):y.slice(b+1)}setTimeout(()=>Re(y))}})})})});be.displayName=ye;var dr={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function lr(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function fr(e,t,n){const o=lr(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return dr[o]}function Re(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function mr(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var _r=ve,gr=be;function hr(e){const[t,n]=s.useState(void 0);return L(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const r=a[0];let i,u;if("borderBoxSize"in r){const c=r.borderBoxSize,p=Array.isArray(c)?c[0]:c;i=p.inlineSize,u=p.blockSize}else i=e.offsetWidth,u=e.offsetHeight;n({width:i,height:u})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}function vr(e){const t=s.useRef({value:e,previous:e});return s.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function yr(e,t){return s.useReducer((n,o)=>t[n][o]??n,e)}var Ce=e=>{const{present:t,children:n}=e,o=br(t),a=typeof n=="function"?n({present:o.isPresent}):s.Children.only(n),r=O(o.ref,Rr(a));return typeof n=="function"||o.isPresent?s.cloneElement(a,{ref:r}):null};Ce.displayName="Presence";function br(e){const[t,n]=s.useState(),o=s.useRef({}),a=s.useRef(e),r=s.useRef("none"),i=e?"mounted":"unmounted",[u,c]=yr(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{const p=$(o.current);r.current=u==="mounted"?p:"none"},[u]),L(()=>{const p=o.current,g=a.current;if(g!==e){const _=r.current,l=$(p);e?c("MOUNT"):l==="none"||(p==null?void 0:p.display)==="none"?c("UNMOUNT"):c(g&&_!==l?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,c]),L(()=>{if(t){let p;const g=t.ownerDocument.defaultView??window,m=l=>{const h=$(o.current).includes(l.animationName);if(l.target===t&&h&&(c("ANIMATION_END"),!a.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",p=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},_=l=>{l.target===t&&(r.current=$(o.current))};return t.addEventListener("animationstart",_),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{g.clearTimeout(p),t.removeEventListener("animationstart",_),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:s.useCallback(p=>{p&&(o.current=getComputedStyle(p)),n(p)},[])}}function $(e){return(e==null?void 0:e.animationName)||"none"}function Rr(e){var o,a;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=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ee="Radio",[Cr,Se]=q(ee),[Sr,xr]=Cr(ee),xe=s.forwardRef((e,t)=>{const{__scopeRadio:n,name:o,checked:a=!1,required:r,disabled:i,value:u="on",onCheck:c,form:p,...g}=e,[m,_]=s.useState(null),l=O(t,v=>_(v)),f=s.useRef(!1),h=m?p||!!m.closest("form"):!0;return d.jsxs(Sr,{scope:n,checked:a,disabled:i,children:[d.jsx(k.button,{type:"button",role:"radio","aria-checked":a,"data-state":Ae(a),"data-disabled":i?"":void 0,disabled:i,value:u,...g,ref:l,onClick:N(e.onClick,v=>{a||c==null||c(),h&&(f.current=v.isPropagationStopped(),f.current||v.stopPropagation())})}),h&&d.jsx(Nr,{control:m,bubbles:!f.current,name:o,value:u,checked:a,required:r,disabled:i,form:p,style:{transform:"translateX(-100%)"}})]})});xe.displayName=ee;var Ne="RadioIndicator",Ie=s.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:o,...a}=e,r=xr(Ne,n);return d.jsx(Ce,{present:o||r.checked,children:d.jsx(k.span,{"data-state":Ae(r.checked),"data-disabled":r.disabled?"":void 0,...a,ref:t})})});Ie.displayName=Ne;var Nr=e=>{const{control:t,checked:n,bubbles:o=!0,...a}=e,r=s.useRef(null),i=vr(n),u=hr(t);return s.useEffect(()=>{const c=r.current,p=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(p,"checked").set;if(i!==n&&m){const _=new Event("click",{bubbles:o});m.call(c,n),c.dispatchEvent(_)}},[i,n,o]),d.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:r,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Ae(e){return e?"checked":"unchecked"}var Ir=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],re="RadioGroup",[Ar,nt]=q(re,[he,Se]),we=he(),Oe=Se(),[wr,Or]=Ar(re),Ee=s.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:o,defaultValue:a,value:r,required:i=!1,disabled:u=!1,orientation:c,dir:p,loop:g=!0,onValueChange:m,..._}=e,l=we(n),f=_e(p),[h,v]=me({prop:r,defaultProp:a,onChange:m});return d.jsx(wr,{scope:n,name:o,required:i,disabled:u,value:h,onValueChange:v,children:d.jsx(_r,{asChild:!0,...l,orientation:c,dir:f,loop:g,children:d.jsx(k.div,{role:"radiogroup","aria-required":i,"aria-orientation":c,"data-disabled":u?"":void 0,dir:f,..._,ref:t})})})});Ee.displayName=re;var Pe="RadioGroupItem",je=s.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:o,...a}=e,r=Or(Pe,n),i=r.disabled||o,u=we(n),c=Oe(n),p=s.useRef(null),g=O(t,p),m=r.value===a.value,_=s.useRef(!1);return s.useEffect(()=>{const l=h=>{Ir.includes(h.key)&&(_.current=!0)},f=()=>_.current=!1;return document.addEventListener("keydown",l),document.addEventListener("keyup",f),()=>{document.removeEventListener("keydown",l),document.removeEventListener("keyup",f)}},[]),d.jsx(gr,{asChild:!0,...u,focusable:!i,active:m,children:d.jsx(xe,{disabled:i,required:r.required,checked:m,...c,...a,name:r.name,ref:g,onCheck:()=>r.onValueChange(a.value),onKeyDown:N(l=>{l.key==="Enter"&&l.preventDefault()}),onFocus:N(a.onFocus,()=>{var l;_.current&&((l=p.current)==null||l.click())})})})});je.displayName=Pe;var Er="RadioGroupIndicator",ke=s.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...o}=e,a=Oe(n);return d.jsx(Ie,{...a,...o,ref:t})});ke.displayName=Er;var Pr=Ee,jr=je,kr=ke;function Tr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var B={exports:{}};/*!
|
|
6
6
|
Copyright (c) 2018 Jed Watson.
|
|
7
7
|
Licensed under the MIT License (MIT), see
|
|
8
8
|
http://jedwatson.github.io/classnames
|