@purpurds/radio-card-group 4.3.0 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/LICENSE.txt CHANGED
@@ -1,5 +1,5 @@
1
1
  Name: @purpurds/heading
2
- Version: 4.2.0
2
+ Version: 4.3.0
3
3
  License: AGPL-3.0-only
4
4
  Private: false
5
5
 
@@ -220,13 +220,13 @@ SOFTWARE.
220
220
  ---
221
221
 
222
222
  Name: @purpurds/paragraph
223
- Version: 4.2.0
223
+ Version: 4.3.0
224
224
  License: AGPL-3.0-only
225
225
  Private: false
226
226
 
227
227
  ---
228
228
 
229
229
  Name: @purpurds/skeleton
230
- Version: 4.2.0
230
+ Version: 4.3.0
231
231
  License: AGPL-3.0-only
232
232
  Private: false
@@ -1,2 +1,2 @@
1
- export declare const cx: (...args: import("classnames").ArgumentArray) => string;
1
+ export declare const cx: (...args: import('classnames').ArgumentArray) => string;
2
2
  //# sourceMappingURL=classnames.d.ts.map
@@ -2,11 +2,11 @@
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 n={}.hasOwnProperty;function t(){for(var r="",c=0;c<arguments.length;c++){var i=arguments[c];i&&(r=u(r,o(i)))}return r}function o(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return t.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var c="";for(var i in r)n.call(r,i)&&r[i]&&(c=u(c,i));return c}function u(r,c){return c?r?r+" "+c:r+c:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(ne);var Ne=ne.exports;const Ie=Ae(Ne),M={"purpur-heading":"_purpur-heading_1g237_1","purpur-heading--hyphens":"_purpur-heading--hyphens_1g237_8","purpur-heading--negative":"_purpur-heading--negative_1g237_11","purpur-heading--subsection-100":"_purpur-heading--subsection-100_1g237_14","purpur-heading--title-100":"_purpur-heading--title-100_1g237_20","purpur-heading--title-200":"_purpur-heading--title-200_1g237_26","purpur-heading--title-300":"_purpur-heading--title-300_1g237_32","purpur-heading--title-400":"_purpur-heading--title-400_1g237_38","purpur-heading--title-500":"_purpur-heading--title-500_1g237_44","purpur-heading--title-600":"_purpur-heading--title-600_1g237_50","purpur-heading--title-700":"_purpur-heading--title-700_1g237_56","purpur-heading--display-25":"_purpur-heading--display-25_1g237_62","purpur-heading--display-50":"_purpur-heading--display-50_1g237_68","purpur-heading--display-100":"_purpur-heading--display-100_1g237_74","purpur-heading--display-200":"_purpur-heading--display-200_1g237_80"},we={TITLE100:"title-100",TITLE200:"title-200",TITLE300:"title-300",TITLE400:"title-400",TITLE500:"title-500",TITLE600:"title-600",TITLE700:"title-700",SUBSECTION100:"subsection-100"},k="purpur-heading",Pe=({["data-testid"]:e,children:n,className:t="",enableHyphenation:o=!1,negative:u=!1,tag:r,variant:c=we.TITLE100,...i})=>{const d=r,s=Ie([t,M[k],M[`${k}--${c}`],{[M[`${k}--hyphens`]]:o,[M[`${k}--negative`]]:u}]);return $.jsx(d,{...i,className:s,"data-testid":e,children:n})};function E(){return E=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},E.apply(this,arguments)}function x(e,n,{checkForDefaultPrevented:t=!0}={}){return function(u){if(e==null||e(u),t===!1||!u.defaultPrevented)return n==null?void 0:n(u)}}function Oe(e,n){typeof e=="function"?e(n):e!=null&&(e.current=n)}function oe(...e){return n=>e.forEach(t=>Oe(t,n))}function I(...e){return a.useCallback(oe(...e),e)}function z(e,n=[]){let t=[];function o(r,c){const i=a.createContext(c),d=t.length;t=[...t,c];function s(f){const{scope:m,children:l,...p}=f,b=(m==null?void 0:m[e][d])||i,v=a.useMemo(()=>p,Object.values(p));return a.createElement(b.Provider,{value:v},l)}function _(f,m){const l=(m==null?void 0:m[e][d])||i,p=a.useContext(l);if(p)return p;if(c!==void 0)return c;throw new Error(`\`${f}\` must be used within \`${r}\``)}return s.displayName=r+"Provider",[s,_]}const u=()=>{const r=t.map(c=>a.createContext(c));return function(i){const d=(i==null?void 0:i[e])||r;return a.useMemo(()=>({[`__scope${e}`]:{...i,[e]:d}}),[i,d])}};return u.scopeName=e,[o,Te(u,...n)]}function Te(...e){const n=e[0];if(e.length===1)return n;const t=()=>{const o=e.map(u=>({useScope:u(),scopeName:u.scopeName}));return function(r){const c=o.reduce((i,{useScope:d,scopeName:s})=>{const f=d(r)[`__scope${s}`];return{...i,...f}},{});return a.useMemo(()=>({[`__scope${n.scopeName}`]:c}),[c])}};return t.scopeName=n.scopeName,t}function A(){return A=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},A.apply(this,arguments)}const L=a.forwardRef((e,n)=>{const{children:t,...o}=e,u=a.Children.toArray(t),r=u.find(ke);if(r){const c=r.props.children,i=u.map(d=>d===r?a.Children.count(c)>1?a.Children.only(null):a.isValidElement(c)?c.props.children:null:d);return a.createElement(W,A({},o,{ref:n}),a.isValidElement(c)?a.cloneElement(c,void 0,i):null)}return a.createElement(W,A({},o,{ref:n}),t)});L.displayName="Slot";const W=a.forwardRef((e,n)=>{const{children:t,...o}=e;return a.isValidElement(t)?a.cloneElement(t,{...je(o,t.props),ref:n?oe(n,t.ref):t.ref}):a.Children.count(t)>1?a.Children.only(null):null});W.displayName="SlotClone";const Me=({children:e})=>a.createElement(a.Fragment,null,e);function ke(e){return a.isValidElement(e)&&e.type===Me}function je(e,n){const t={...n};for(const o in n){const u=e[o],r=n[o];/^on[A-Z]/.test(o)?u&&r?t[o]=(...i)=>{r(...i),u(...i)}:u&&(t[o]=u):o==="style"?t[o]={...u,...r}:o==="className"&&(t[o]=[u,r].filter(Boolean).join(" "))}return{...e,...t}}const Fe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],O=Fe.reduce((e,n)=>{const t=a.forwardRef((o,u)=>{const{asChild:r,...c}=o,i=r?L:n;return a.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),a.createElement(i,A({},c,{ref:u}))});return t.displayName=`Primitive.${n}`,{...e,[n]:t}},{});function De(e){const n=e+"CollectionProvider",[t,o]=z(n),[u,r]=t(n,{collectionRef:{current:null},itemMap:new Map}),c=l=>{const{scope:p,children:b}=l,v=a.useRef(null),g=a.useRef(new Map).current;return a.createElement(u,{scope:p,itemMap:g,collectionRef:v},b)},i=e+"CollectionSlot",d=a.forwardRef((l,p)=>{const{scope:b,children:v}=l,g=r(i,b),h=I(p,g.collectionRef);return a.createElement(L,{ref:h},v)}),s=e+"CollectionItemSlot",_="data-radix-collection-item",f=a.forwardRef((l,p)=>{const{scope:b,children:v,...g}=l,h=a.useRef(null),T=I(p,h),S=r(s,b);return a.useEffect(()=>(S.itemMap.set(h,{ref:h,...g}),()=>void S.itemMap.delete(h))),a.createElement(L,{[_]:"",ref:T},v)});function m(l){const p=r(e+"CollectionConsumer",l);return a.useCallback(()=>{const v=p.collectionRef.current;if(!v)return[];const g=Array.from(v.querySelectorAll(`[${_}]`));return Array.from(p.itemMap.values()).sort((S,V)=>g.indexOf(S.ref.current)-g.indexOf(V.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:c,Slot:d,ItemSlot:f},m,o]}const G=globalThis!=null&&globalThis.document?a.useLayoutEffect:()=>{},Le=te.useId||(()=>{});let Ge=0;function ze(e){const[n,t]=te.useState(Le());return G(()=>{e||t(o=>o??String(Ge++))},[e]),e||(n?`radix-${n}`:"")}function Z(e){const n=a.useRef(e);return a.useEffect(()=>{n.current=e}),a.useMemo(()=>(...t)=>{var o;return(o=n.current)===null||o===void 0?void 0:o.call(n,...t)},[])}function ae({prop:e,defaultProp:n,onChange:t=()=>{}}){const[o,u]=Ue({defaultProp:n,onChange:t}),r=e!==void 0,c=r?e:o,i=Z(t),d=a.useCallback(s=>{if(r){const f=typeof s=="function"?s(e):s;f!==e&&i(f)}else u(s)},[r,e,u,i]);return[c,d]}function Ue({defaultProp:e,onChange:n}){const t=a.useState(e),[o]=t,u=a.useRef(o),r=Z(n);return a.useEffect(()=>{u.current!==o&&(r(o),u.current=o)},[o,u,r]),t}const Ve=a.createContext(void 0);function ce(e){const n=a.useContext(Ve);return e||n||"ltr"}const q="rovingFocusGroup.onEntryFocus",Be={bubbles:!1,cancelable:!0},J="RovingFocusGroup",[X,ue,qe]=De(J),[Ke,ie]=z(J,[qe]),[He,Ye]=Ke(J),We=a.forwardRef((e,n)=>a.createElement(X.Provider,{scope:e.__scopeRovingFocusGroup},a.createElement(X.Slot,{scope:e.__scopeRovingFocusGroup},a.createElement(Xe,A({},e,{ref:n}))))),Xe=a.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:t,orientation:o,loop:u=!1,dir:r,currentTabStopId:c,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:d,onEntryFocus:s,..._}=e,f=a.useRef(null),m=I(n,f),l=ce(r),[p=null,b]=ae({prop:c,defaultProp:i,onChange:d}),[v,g]=a.useState(!1),h=Z(s),T=ue(t),S=a.useRef(!1),[V,Q]=a.useState(0);return a.useEffect(()=>{const y=f.current;if(y)return y.addEventListener(q,h),()=>y.removeEventListener(q,h)},[h]),a.createElement(He,{scope:t,orientation:o,dir:l,loop:u,currentTabStopId:p,onItemFocus:a.useCallback(y=>b(y),[b]),onItemShiftTab:a.useCallback(()=>g(!0),[]),onFocusableItemAdd:a.useCallback(()=>Q(y=>y+1),[]),onFocusableItemRemove:a.useCallback(()=>Q(y=>y-1),[])},a.createElement(O.div,A({tabIndex:v||V===0?-1:0,"data-orientation":o},_,{ref:m,style:{outline:"none",...e.style},onMouseDown:x(e.onMouseDown,()=>{S.current=!0}),onFocus:x(e.onFocus,y=>{const ye=!S.current;if(y.target===y.currentTarget&&ye&&!v){const ee=new CustomEvent(q,Be);if(y.currentTarget.dispatchEvent(ee),!ee.defaultPrevented){const B=T().filter(N=>N.focusable),Re=B.find(N=>N.active),Ee=B.find(N=>N.id===p),Ce=[Re,Ee,...B].filter(Boolean).map(N=>N.ref.current);se(Ce)}}S.current=!1}),onBlur:x(e.onBlur,()=>g(!1))})))}),Ze="RovingFocusGroupItem",Je=a.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:t,focusable:o=!0,active:u=!1,tabStopId:r,...c}=e,i=ze(),d=r||i,s=Ye(Ze,t),_=s.currentTabStopId===d,f=ue(t),{onFocusableItemAdd:m,onFocusableItemRemove:l}=s;return a.useEffect(()=>{if(o)return m(),()=>l()},[o,m,l]),a.createElement(X.ItemSlot,{scope:t,id:d,focusable:o,active:u},a.createElement(O.span,A({tabIndex:_?0:-1,"data-orientation":s.orientation},c,{ref:n,onMouseDown:x(e.onMouseDown,p=>{o?s.onItemFocus(d):p.preventDefault()}),onFocus:x(e.onFocus,()=>s.onItemFocus(d)),onKeyDown:x(e.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){s.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const b=rr(p,s.orientation,s.dir);if(b!==void 0){p.preventDefault();let g=f().filter(h=>h.focusable).map(h=>h.ref.current);if(b==="last")g.reverse();else if(b==="prev"||b==="next"){b==="prev"&&g.reverse();const h=g.indexOf(p.currentTarget);g=s.loop?tr(g,h+1):g.slice(h+1)}setTimeout(()=>se(g))}})})))}),Qe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function er(e,n){return n!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function rr(e,n,t){const o=er(e.key,t);if(!(n==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(n==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return Qe[o]}function se(e){const n=document.activeElement;for(const t of e)if(t===n||(t.focus(),document.activeElement!==n))return}function tr(e,n){return e.map((t,o)=>e[(n+o)%e.length])}const nr=We,or=Je;function ar(e){const[n,t]=a.useState(void 0);return G(()=>{if(e){t({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(u=>{if(!Array.isArray(u)||!u.length)return;const r=u[0];let c,i;if("borderBoxSize"in r){const d=r.borderBoxSize,s=Array.isArray(d)?d[0]:d;c=s.inlineSize,i=s.blockSize}else c=e.offsetWidth,i=e.offsetHeight;t({width:c,height:i})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else t(void 0)},[e]),n}function cr(e){const n=a.useRef({value:e,previous:e});return a.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}function ur(e,n){return a.useReducer((t,o)=>{const u=n[t][o];return u??t},e)}const de=e=>{const{present:n,children:t}=e,o=ir(n),u=typeof t=="function"?t({present:o.isPresent}):a.Children.only(t),r=I(o.ref,u.ref);return typeof t=="function"||o.isPresent?a.cloneElement(u,{ref:r}):null};de.displayName="Presence";function ir(e){const[n,t]=a.useState(),o=a.useRef({}),u=a.useRef(e),r=a.useRef("none"),c=e?"mounted":"unmounted",[i,d]=ur(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const s=j(o.current);r.current=i==="mounted"?s:"none"},[i]),G(()=>{const s=o.current,_=u.current;if(_!==e){const m=r.current,l=j(s);e?d("MOUNT"):l==="none"||(s==null?void 0:s.display)==="none"?d("UNMOUNT"):d(_&&m!==l?"ANIMATION_OUT":"UNMOUNT"),u.current=e}},[e,d]),G(()=>{if(n){const s=f=>{const l=j(o.current).includes(f.animationName);f.target===n&&l&&xe.flushSync(()=>d("ANIMATION_END"))},_=f=>{f.target===n&&(r.current=j(o.current))};return n.addEventListener("animationstart",_),n.addEventListener("animationcancel",s),n.addEventListener("animationend",s),()=>{n.removeEventListener("animationstart",_),n.removeEventListener("animationcancel",s),n.removeEventListener("animationend",s)}}else d("ANIMATION_END")},[n,d]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:a.useCallback(s=>{s&&(o.current=getComputedStyle(s)),t(s)},[])}}function j(e){return(e==null?void 0:e.animationName)||"none"}const pe="Radio",[sr,le]=z(pe),[dr,pr]=sr(pe),lr=a.forwardRef((e,n)=>{const{__scopeRadio:t,name:o,checked:u=!1,required:r,disabled:c,value:i="on",onCheck:d,...s}=e,[_,f]=a.useState(null),m=I(n,b=>f(b)),l=a.useRef(!1),p=_?!!_.closest("form"):!0;return a.createElement(dr,{scope:t,checked:u,disabled:c},a.createElement(O.button,E({type:"button",role:"radio","aria-checked":u,"data-state":fe(u),"data-disabled":c?"":void 0,disabled:c,value:i},s,{ref:m,onClick:x(e.onClick,b=>{u||d==null||d(),p&&(l.current=b.isPropagationStopped(),l.current||b.stopPropagation())})})),p&&a.createElement(_r,{control:_,bubbles:!l.current,name:o,value:i,checked:u,required:r,disabled:c,style:{transform:"translateX(-100%)"}}))}),fr="RadioIndicator",mr=a.forwardRef((e,n)=>{const{__scopeRadio:t,forceMount:o,...u}=e,r=pr(fr,t);return a.createElement(de,{present:o||r.checked},a.createElement(O.span,E({"data-state":fe(r.checked),"data-disabled":r.disabled?"":void 0},u,{ref:n})))}),_r=e=>{const{control:n,checked:t,bubbles:o=!0,...u}=e,r=a.useRef(null),c=cr(t),i=ar(n);return a.useEffect(()=>{const d=r.current,s=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(s,"checked").set;if(c!==t&&f){const m=new Event("click",{bubbles:o});f.call(d,t),d.dispatchEvent(m)}},[c,t,o]),a.createElement("input",E({type:"radio","aria-hidden":!0,defaultChecked:t},u,{tabIndex:-1,ref:r,style:{...e.style,...i,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function fe(e){return e?"checked":"unchecked"}const br=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],me="RadioGroup",[$r,Kr]=z(me,[ie,le]),_e=ie(),be=le(),[gr,hr]=$r(me),vr=a.forwardRef((e,n)=>{const{__scopeRadioGroup:t,name:o,defaultValue:u,value:r,required:c=!1,disabled:i=!1,orientation:d,dir:s,loop:_=!0,onValueChange:f,...m}=e,l=_e(t),p=ce(s),[b,v]=ae({prop:r,defaultProp:u,onChange:f});return a.createElement(gr,{scope:t,name:o,required:c,disabled:i,value:b,onValueChange:v},a.createElement(nr,E({asChild:!0},l,{orientation:d,dir:p,loop:_}),a.createElement(O.div,E({role:"radiogroup","aria-required":c,"aria-orientation":d,"data-disabled":i?"":void 0,dir:p},m,{ref:n}))))}),yr="RadioGroupItem",Rr=a.forwardRef((e,n)=>{const{__scopeRadioGroup:t,disabled:o,...u}=e,r=hr(yr,t),c=r.disabled||o,i=_e(t),d=be(t),s=a.useRef(null),_=I(n,s),f=r.value===u.value,m=a.useRef(!1);return a.useEffect(()=>{const l=b=>{br.includes(b.key)&&(m.current=!0)},p=()=>m.current=!1;return document.addEventListener("keydown",l),document.addEventListener("keyup",p),()=>{document.removeEventListener("keydown",l),document.removeEventListener("keyup",p)}},[]),a.createElement(or,E({asChild:!0},i,{focusable:!c,active:f}),a.createElement(lr,E({disabled:c,required:r.required,checked:f},d,u,{name:r.name,ref:_,onCheck:()=>r.onValueChange(u.value),onKeyDown:x(l=>{l.key==="Enter"&&l.preventDefault()}),onFocus:x(u.onFocus,()=>{var l;m.current&&((l=s.current)===null||l===void 0||l.click())})})))}),Er=a.forwardRef((e,n)=>{const{__scopeRadioGroup:t,...o}=e,u=be(t);return a.createElement(mr,E({},u,o,{ref:n}))}),Cr=vr,xr=Rr,Sr=Er;function Ar(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $e={exports:{}};/*!
5
+ */(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",c=0;c<arguments.length;c++){var i=arguments[c];i&&(r=u(r,o(i)))}return r}function o(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return t.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var c="";for(var i in r)n.call(r,i)&&r[i]&&(c=u(c,i));return c}function u(r,c){return c?r?r+" "+c:r+c:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(ne);var Ie=ne.exports;const Ne=Ae(Ie),M={"purpur-heading":"_purpur-heading_1g237_1","purpur-heading--hyphens":"_purpur-heading--hyphens_1g237_8","purpur-heading--negative":"_purpur-heading--negative_1g237_11","purpur-heading--subsection-100":"_purpur-heading--subsection-100_1g237_14","purpur-heading--title-100":"_purpur-heading--title-100_1g237_20","purpur-heading--title-200":"_purpur-heading--title-200_1g237_26","purpur-heading--title-300":"_purpur-heading--title-300_1g237_32","purpur-heading--title-400":"_purpur-heading--title-400_1g237_38","purpur-heading--title-500":"_purpur-heading--title-500_1g237_44","purpur-heading--title-600":"_purpur-heading--title-600_1g237_50","purpur-heading--title-700":"_purpur-heading--title-700_1g237_56","purpur-heading--display-25":"_purpur-heading--display-25_1g237_62","purpur-heading--display-50":"_purpur-heading--display-50_1g237_68","purpur-heading--display-100":"_purpur-heading--display-100_1g237_74","purpur-heading--display-200":"_purpur-heading--display-200_1g237_80"},we={TITLE100:"title-100",TITLE200:"title-200",TITLE300:"title-300",TITLE400:"title-400",TITLE500:"title-500",TITLE600:"title-600",TITLE700:"title-700",SUBSECTION100:"subsection-100"},k="purpur-heading",Pe=({["data-testid"]:e,children:n,className:t="",enableHyphenation:o=!1,negative:u=!1,tag:r,variant:c=we.TITLE100,...i})=>{const d=r,s=Ne([t,M[k],M[`${k}--${c}`],{[M[`${k}--hyphens`]]:o,[M[`${k}--negative`]]:u}]);return $.jsx(d,{...i,className:s,"data-testid":e,children:n})};function E(){return E=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},E.apply(this,arguments)}function x(e,n,{checkForDefaultPrevented:t=!0}={}){return function(u){if(e==null||e(u),t===!1||!u.defaultPrevented)return n==null?void 0:n(u)}}function Oe(e,n){typeof e=="function"?e(n):e!=null&&(e.current=n)}function oe(...e){return n=>e.forEach(t=>Oe(t,n))}function N(...e){return a.useCallback(oe(...e),e)}function z(e,n=[]){let t=[];function o(r,c){const i=a.createContext(c),d=t.length;t=[...t,c];function s(f){const{scope:m,children:l,...p}=f,b=(m==null?void 0:m[e][d])||i,v=a.useMemo(()=>p,Object.values(p));return a.createElement(b.Provider,{value:v},l)}function _(f,m){const l=(m==null?void 0:m[e][d])||i,p=a.useContext(l);if(p)return p;if(c!==void 0)return c;throw new Error(`\`${f}\` must be used within \`${r}\``)}return s.displayName=r+"Provider",[s,_]}const u=()=>{const r=t.map(c=>a.createContext(c));return function(i){const d=(i==null?void 0:i[e])||r;return a.useMemo(()=>({[`__scope${e}`]:{...i,[e]:d}}),[i,d])}};return u.scopeName=e,[o,Te(u,...n)]}function Te(...e){const n=e[0];if(e.length===1)return n;const t=()=>{const o=e.map(u=>({useScope:u(),scopeName:u.scopeName}));return function(r){const c=o.reduce((i,{useScope:d,scopeName:s})=>{const f=d(r)[`__scope${s}`];return{...i,...f}},{});return a.useMemo(()=>({[`__scope${n.scopeName}`]:c}),[c])}};return t.scopeName=n.scopeName,t}function A(){return A=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},A.apply(this,arguments)}const L=a.forwardRef((e,n)=>{const{children:t,...o}=e,u=a.Children.toArray(t),r=u.find(ke);if(r){const c=r.props.children,i=u.map(d=>d===r?a.Children.count(c)>1?a.Children.only(null):a.isValidElement(c)?c.props.children:null:d);return a.createElement(W,A({},o,{ref:n}),a.isValidElement(c)?a.cloneElement(c,void 0,i):null)}return a.createElement(W,A({},o,{ref:n}),t)});L.displayName="Slot";const W=a.forwardRef((e,n)=>{const{children:t,...o}=e;return a.isValidElement(t)?a.cloneElement(t,{...je(o,t.props),ref:n?oe(n,t.ref):t.ref}):a.Children.count(t)>1?a.Children.only(null):null});W.displayName="SlotClone";const Me=({children:e})=>a.createElement(a.Fragment,null,e);function ke(e){return a.isValidElement(e)&&e.type===Me}function je(e,n){const t={...n};for(const o in n){const u=e[o],r=n[o];/^on[A-Z]/.test(o)?u&&r?t[o]=(...i)=>{r(...i),u(...i)}:u&&(t[o]=u):o==="style"?t[o]={...u,...r}:o==="className"&&(t[o]=[u,r].filter(Boolean).join(" "))}return{...e,...t}}const Fe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],O=Fe.reduce((e,n)=>{const t=a.forwardRef((o,u)=>{const{asChild:r,...c}=o,i=r?L:n;return a.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),a.createElement(i,A({},c,{ref:u}))});return t.displayName=`Primitive.${n}`,{...e,[n]:t}},{});function De(e){const n=e+"CollectionProvider",[t,o]=z(n),[u,r]=t(n,{collectionRef:{current:null},itemMap:new Map}),c=l=>{const{scope:p,children:b}=l,v=a.useRef(null),g=a.useRef(new Map).current;return a.createElement(u,{scope:p,itemMap:g,collectionRef:v},b)},i=e+"CollectionSlot",d=a.forwardRef((l,p)=>{const{scope:b,children:v}=l,g=r(i,b),h=N(p,g.collectionRef);return a.createElement(L,{ref:h},v)}),s=e+"CollectionItemSlot",_="data-radix-collection-item",f=a.forwardRef((l,p)=>{const{scope:b,children:v,...g}=l,h=a.useRef(null),T=N(p,h),S=r(s,b);return a.useEffect(()=>(S.itemMap.set(h,{ref:h,...g}),()=>void S.itemMap.delete(h))),a.createElement(L,{[_]:"",ref:T},v)});function m(l){const p=r(e+"CollectionConsumer",l);return a.useCallback(()=>{const v=p.collectionRef.current;if(!v)return[];const g=Array.from(v.querySelectorAll(`[${_}]`));return Array.from(p.itemMap.values()).sort((S,V)=>g.indexOf(S.ref.current)-g.indexOf(V.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:c,Slot:d,ItemSlot:f},m,o]}const G=globalThis!=null&&globalThis.document?a.useLayoutEffect:()=>{},Le=te.useId||(()=>{});let Ge=0;function ze(e){const[n,t]=te.useState(Le());return G(()=>{t(o=>o??String(Ge++))},[e]),n?`radix-${n}`:""}function Z(e){const n=a.useRef(e);return a.useEffect(()=>{n.current=e}),a.useMemo(()=>(...t)=>{var o;return(o=n.current)===null||o===void 0?void 0:o.call(n,...t)},[])}function ae({prop:e,defaultProp:n,onChange:t=()=>{}}){const[o,u]=Ue({defaultProp:n,onChange:t}),r=e!==void 0,c=r?e:o,i=Z(t),d=a.useCallback(s=>{if(r){const f=typeof s=="function"?s(e):s;f!==e&&i(f)}else u(s)},[r,e,u,i]);return[c,d]}function Ue({defaultProp:e,onChange:n}){const t=a.useState(e),[o]=t,u=a.useRef(o),r=Z(n);return a.useEffect(()=>{u.current!==o&&(r(o),u.current=o)},[o,u,r]),t}const Ve=a.createContext(void 0);function ce(e){const n=a.useContext(Ve);return e||n||"ltr"}const q="rovingFocusGroup.onEntryFocus",Be={bubbles:!1,cancelable:!0},J="RovingFocusGroup",[X,ue,qe]=De(J),[Ke,ie]=z(J,[qe]),[He,Ye]=Ke(J),We=a.forwardRef((e,n)=>a.createElement(X.Provider,{scope:e.__scopeRovingFocusGroup},a.createElement(X.Slot,{scope:e.__scopeRovingFocusGroup},a.createElement(Xe,A({},e,{ref:n}))))),Xe=a.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:t,orientation:o,loop:u=!1,dir:r,currentTabStopId:c,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:d,onEntryFocus:s,..._}=e,f=a.useRef(null),m=N(n,f),l=ce(r),[p=null,b]=ae({prop:c,defaultProp:i,onChange:d}),[v,g]=a.useState(!1),h=Z(s),T=ue(t),S=a.useRef(!1),[V,Q]=a.useState(0);return a.useEffect(()=>{const y=f.current;if(y)return y.addEventListener(q,h),()=>y.removeEventListener(q,h)},[h]),a.createElement(He,{scope:t,orientation:o,dir:l,loop:u,currentTabStopId:p,onItemFocus:a.useCallback(y=>b(y),[b]),onItemShiftTab:a.useCallback(()=>g(!0),[]),onFocusableItemAdd:a.useCallback(()=>Q(y=>y+1),[]),onFocusableItemRemove:a.useCallback(()=>Q(y=>y-1),[])},a.createElement(O.div,A({tabIndex:v||V===0?-1:0,"data-orientation":o},_,{ref:m,style:{outline:"none",...e.style},onMouseDown:x(e.onMouseDown,()=>{S.current=!0}),onFocus:x(e.onFocus,y=>{const ye=!S.current;if(y.target===y.currentTarget&&ye&&!v){const ee=new CustomEvent(q,Be);if(y.currentTarget.dispatchEvent(ee),!ee.defaultPrevented){const B=T().filter(I=>I.focusable),Re=B.find(I=>I.active),Ee=B.find(I=>I.id===p),Ce=[Re,Ee,...B].filter(Boolean).map(I=>I.ref.current);se(Ce)}}S.current=!1}),onBlur:x(e.onBlur,()=>g(!1))})))}),Ze="RovingFocusGroupItem",Je=a.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:t,focusable:o=!0,active:u=!1,tabStopId:r,...c}=e,i=ze(),d=r||i,s=Ye(Ze,t),_=s.currentTabStopId===d,f=ue(t),{onFocusableItemAdd:m,onFocusableItemRemove:l}=s;return a.useEffect(()=>{if(o)return m(),()=>l()},[o,m,l]),a.createElement(X.ItemSlot,{scope:t,id:d,focusable:o,active:u},a.createElement(O.span,A({tabIndex:_?0:-1,"data-orientation":s.orientation},c,{ref:n,onMouseDown:x(e.onMouseDown,p=>{o?s.onItemFocus(d):p.preventDefault()}),onFocus:x(e.onFocus,()=>s.onItemFocus(d)),onKeyDown:x(e.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){s.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const b=rr(p,s.orientation,s.dir);if(b!==void 0){p.preventDefault();let g=f().filter(h=>h.focusable).map(h=>h.ref.current);if(b==="last")g.reverse();else if(b==="prev"||b==="next"){b==="prev"&&g.reverse();const h=g.indexOf(p.currentTarget);g=s.loop?tr(g,h+1):g.slice(h+1)}setTimeout(()=>se(g))}})})))}),Qe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function er(e,n){return n!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function rr(e,n,t){const o=er(e.key,t);if(!(n==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(n==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return Qe[o]}function se(e){const n=document.activeElement;for(const t of e)if(t===n||(t.focus(),document.activeElement!==n))return}function tr(e,n){return e.map((t,o)=>e[(n+o)%e.length])}const nr=We,or=Je;function ar(e){const[n,t]=a.useState(void 0);return G(()=>{if(e){t({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(u=>{if(!Array.isArray(u)||!u.length)return;const r=u[0];let c,i;if("borderBoxSize"in r){const d=r.borderBoxSize,s=Array.isArray(d)?d[0]:d;c=s.inlineSize,i=s.blockSize}else c=e.offsetWidth,i=e.offsetHeight;t({width:c,height:i})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else t(void 0)},[e]),n}function cr(e){const n=a.useRef({value:e,previous:e});return a.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}function ur(e,n){return a.useReducer((t,o)=>{const u=n[t][o];return u??t},e)}const de=e=>{const{present:n,children:t}=e,o=ir(n),u=typeof t=="function"?t({present:o.isPresent}):a.Children.only(t),r=N(o.ref,u.ref);return typeof t=="function"||o.isPresent?a.cloneElement(u,{ref:r}):null};de.displayName="Presence";function ir(e){const[n,t]=a.useState(),o=a.useRef({}),u=a.useRef(e),r=a.useRef("none"),c=e?"mounted":"unmounted",[i,d]=ur(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const s=j(o.current);r.current=i==="mounted"?s:"none"},[i]),G(()=>{const s=o.current,_=u.current;if(_!==e){const m=r.current,l=j(s);e?d("MOUNT"):l==="none"||(s==null?void 0:s.display)==="none"?d("UNMOUNT"):d(_&&m!==l?"ANIMATION_OUT":"UNMOUNT"),u.current=e}},[e,d]),G(()=>{if(n){const s=f=>{const l=j(o.current).includes(f.animationName);f.target===n&&l&&xe.flushSync(()=>d("ANIMATION_END"))},_=f=>{f.target===n&&(r.current=j(o.current))};return n.addEventListener("animationstart",_),n.addEventListener("animationcancel",s),n.addEventListener("animationend",s),()=>{n.removeEventListener("animationstart",_),n.removeEventListener("animationcancel",s),n.removeEventListener("animationend",s)}}else d("ANIMATION_END")},[n,d]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:a.useCallback(s=>{s&&(o.current=getComputedStyle(s)),t(s)},[])}}function j(e){return(e==null?void 0:e.animationName)||"none"}const pe="Radio",[sr,le]=z(pe),[dr,pr]=sr(pe),lr=a.forwardRef((e,n)=>{const{__scopeRadio:t,name:o,checked:u=!1,required:r,disabled:c,value:i="on",onCheck:d,...s}=e,[_,f]=a.useState(null),m=N(n,b=>f(b)),l=a.useRef(!1),p=_?!!_.closest("form"):!0;return a.createElement(dr,{scope:t,checked:u,disabled:c},a.createElement(O.button,E({type:"button",role:"radio","aria-checked":u,"data-state":fe(u),"data-disabled":c?"":void 0,disabled:c,value:i},s,{ref:m,onClick:x(e.onClick,b=>{u||d==null||d(),p&&(l.current=b.isPropagationStopped(),l.current||b.stopPropagation())})})),p&&a.createElement(_r,{control:_,bubbles:!l.current,name:o,value:i,checked:u,required:r,disabled:c,style:{transform:"translateX(-100%)"}}))}),fr="RadioIndicator",mr=a.forwardRef((e,n)=>{const{__scopeRadio:t,forceMount:o,...u}=e,r=pr(fr,t);return a.createElement(de,{present:o||r.checked},a.createElement(O.span,E({"data-state":fe(r.checked),"data-disabled":r.disabled?"":void 0},u,{ref:n})))}),_r=e=>{const{control:n,checked:t,bubbles:o=!0,...u}=e,r=a.useRef(null),c=cr(t),i=ar(n);return a.useEffect(()=>{const d=r.current,s=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(s,"checked").set;if(c!==t&&f){const m=new Event("click",{bubbles:o});f.call(d,t),d.dispatchEvent(m)}},[c,t,o]),a.createElement("input",E({type:"radio","aria-hidden":!0,defaultChecked:t},u,{tabIndex:-1,ref:r,style:{...e.style,...i,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function fe(e){return e?"checked":"unchecked"}const br=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],me="RadioGroup",[$r,Kr]=z(me,[ie,le]),_e=ie(),be=le(),[gr,hr]=$r(me),vr=a.forwardRef((e,n)=>{const{__scopeRadioGroup:t,name:o,defaultValue:u,value:r,required:c=!1,disabled:i=!1,orientation:d,dir:s,loop:_=!0,onValueChange:f,...m}=e,l=_e(t),p=ce(s),[b,v]=ae({prop:r,defaultProp:u,onChange:f});return a.createElement(gr,{scope:t,name:o,required:c,disabled:i,value:b,onValueChange:v},a.createElement(nr,E({asChild:!0},l,{orientation:d,dir:p,loop:_}),a.createElement(O.div,E({role:"radiogroup","aria-required":c,"aria-orientation":d,"data-disabled":i?"":void 0,dir:p},m,{ref:n}))))}),yr="RadioGroupItem",Rr=a.forwardRef((e,n)=>{const{__scopeRadioGroup:t,disabled:o,...u}=e,r=hr(yr,t),c=r.disabled||o,i=_e(t),d=be(t),s=a.useRef(null),_=N(n,s),f=r.value===u.value,m=a.useRef(!1);return a.useEffect(()=>{const l=b=>{br.includes(b.key)&&(m.current=!0)},p=()=>m.current=!1;return document.addEventListener("keydown",l),document.addEventListener("keyup",p),()=>{document.removeEventListener("keydown",l),document.removeEventListener("keyup",p)}},[]),a.createElement(or,E({asChild:!0},i,{focusable:!c,active:f}),a.createElement(lr,E({disabled:c,required:r.required,checked:f},d,u,{name:r.name,ref:_,onCheck:()=>r.onValueChange(u.value),onKeyDown:x(l=>{l.key==="Enter"&&l.preventDefault()}),onFocus:x(u.onFocus,()=>{var l;m.current&&((l=s.current)===null||l===void 0||l.click())})})))}),Er=a.forwardRef((e,n)=>{const{__scopeRadioGroup:t,...o}=e,u=be(t);return a.createElement(mr,E({},u,o,{ref:n}))}),Cr=vr,xr=Rr,Sr=Er;function Ar(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $e={exports:{}};/*!
6
6
  Copyright (c) 2018 Jed Watson.
7
7
  Licensed under the MIT License (MIT), see
8
8
  http://jedwatson.github.io/classnames
9
- */(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",c=0;c<arguments.length;c++){var i=arguments[c];i&&(r=u(r,o.call(this,i)))}return r}function o(r){if(typeof r=="string"||typeof r=="number")return this&&this[r]||r;if(typeof r!="object")return"";if(Array.isArray(r))return t.apply(this,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var c="";for(var i in r)n.call(r,i)&&r[i]&&(c=u(c,this&&this[i]||i));return c}function u(r,c){return c?r?r+" "+c:r+c:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})($e);var Nr=$e.exports;const Ir=Ar(Nr),wr={"purpur-radio-card-group":"_purpur-radio-card-group_19msf_1","purpur-radio-card-group--vertical":"_purpur-radio-card-group--vertical_19msf_5","purpur-radio-card-group--horizontal":"_purpur-radio-card-group--horizontal_19msf_9","purpur-radio-card-group--radio-left":"_purpur-radio-card-group--radio-left_19msf_18","purpur-radio-card-group__item":"_purpur-radio-card-group__item_19msf_18","purpur-radio-card-group__item-bottom-container":"_purpur-radio-card-group__item-bottom-container_19msf_21","purpur-radio-card-group__item-top-container":"_purpur-radio-card-group__item-top-container_19msf_24","purpur-radio-card-group__container":"_purpur-radio-card-group__container_19msf_35","purpur-radio-card-group__item-container":"_purpur-radio-card-group__item-container_19msf_42","purpur-radio-card-group__item-radio":"_purpur-radio-card-group__item-radio_19msf_77","purpur-radio-card-group__item-content":"_purpur-radio-card-group__item-content_19msf_108","purpur-radio-card-group__item-title":"_purpur-radio-card-group__item-title_19msf_121","purpur-radio-card-group__item-indicator":"_purpur-radio-card-group__item-indicator_19msf_141","purpur-radio-card-group__item-image-container":"_purpur-radio-card-group__item-image-container_19msf_151","purpur-radio-card-group__item-image":"_purpur-radio-card-group__item-image_19msf_151","purpur-radio-card-group__item-image--loaded":"_purpur-radio-card-group__item-image--loaded_19msf_164","purpur-radio-card-group__item-image-placeholder":"_purpur-radio-card-group__item-image-placeholder_19msf_167","purpur-radio-card-group__item-image-placeholder--loaded":"_purpur-radio-card-group__item-image-placeholder--loaded_19msf_172","purpur-radio-card-group__item-children":"_purpur-radio-card-group__item-children_19msf_175"},R=Ir.bind(wr);function Pr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ge={exports:{}};/*!
9
+ */(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",c=0;c<arguments.length;c++){var i=arguments[c];i&&(r=u(r,o.call(this,i)))}return r}function o(r){if(typeof r=="string"||typeof r=="number")return this&&this[r]||r;if(typeof r!="object")return"";if(Array.isArray(r))return t.apply(this,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var c="";for(var i in r)n.call(r,i)&&r[i]&&(c=u(c,this&&this[i]||i));return c}function u(r,c){return c?r?r+" "+c:r+c:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})($e);var Ir=$e.exports;const Nr=Ar(Ir),wr={"purpur-radio-card-group":"_purpur-radio-card-group_19msf_1","purpur-radio-card-group--vertical":"_purpur-radio-card-group--vertical_19msf_5","purpur-radio-card-group--horizontal":"_purpur-radio-card-group--horizontal_19msf_9","purpur-radio-card-group--radio-left":"_purpur-radio-card-group--radio-left_19msf_18","purpur-radio-card-group__item":"_purpur-radio-card-group__item_19msf_18","purpur-radio-card-group__item-bottom-container":"_purpur-radio-card-group__item-bottom-container_19msf_21","purpur-radio-card-group__item-top-container":"_purpur-radio-card-group__item-top-container_19msf_24","purpur-radio-card-group__container":"_purpur-radio-card-group__container_19msf_35","purpur-radio-card-group__item-container":"_purpur-radio-card-group__item-container_19msf_42","purpur-radio-card-group__item-radio":"_purpur-radio-card-group__item-radio_19msf_77","purpur-radio-card-group__item-content":"_purpur-radio-card-group__item-content_19msf_108","purpur-radio-card-group__item-title":"_purpur-radio-card-group__item-title_19msf_121","purpur-radio-card-group__item-indicator":"_purpur-radio-card-group__item-indicator_19msf_141","purpur-radio-card-group__item-image-container":"_purpur-radio-card-group__item-image-container_19msf_151","purpur-radio-card-group__item-image":"_purpur-radio-card-group__item-image_19msf_151","purpur-radio-card-group__item-image--loaded":"_purpur-radio-card-group__item-image--loaded_19msf_164","purpur-radio-card-group__item-image-placeholder":"_purpur-radio-card-group__item-image-placeholder_19msf_167","purpur-radio-card-group__item-image-placeholder--loaded":"_purpur-radio-card-group__item-image-placeholder--loaded_19msf_172","purpur-radio-card-group__item-children":"_purpur-radio-card-group__item-children_19msf_175"},R=Nr.bind(wr);function Pr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ge={exports:{}};/*!
10
10
  Copyright (c) 2018 Jed Watson.
11
11
  Licensed under the MIT License (MIT), see
12
12
  http://jedwatson.github.io/classnames