New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@purpurds/radio-button-group

Package Overview
Dependencies
Maintainers
4
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@purpurds/radio-button-group - npm Package Compare versions

Comparing version 5.31.0 to 5.32.0

8

dist/LICENSE.txt
Name: @purpurds/field-helper-text
Version: 5.30.1
Version: 5.31.0
License: AGPL-3.0-only

@@ -9,3 +9,3 @@ Private: false

Name: @purpurds/label
Version: 5.30.1
Version: 5.31.0
License: AGPL-3.0-only

@@ -17,3 +17,3 @@ Private: false

Name: @babel/runtime
Version: 7.25.6
Version: 7.26.0
License: MIT

@@ -232,4 +232,4 @@ Private: false

Name: @purpurds/heading
Version: 5.30.1
Version: 5.31.0
License: AGPL-3.0-only
Private: false

@@ -5,15 +5,15 @@ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react/jsx-runtime"),c=require("react"),we=require("react-dom");function Ie(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 ee=Ie(c);function Ae(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var te={exports:{}};/*!

http://jedwatson.github.io/classnames
*/(function(e){(function(){var r={}.hasOwnProperty;function n(){for(var t="",a=0;a<arguments.length;a++){var u=arguments[a];u&&(t=i(t,o(u)))}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 a="";for(var u in t)r.call(t,u)&&t[u]&&(a=i(a,u));return a}function i(t,a){return a?t?t+" "+a:t+a:t}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(te);var Oe=te.exports;const Pe=Ae(Oe),X={"purpur-field-helper-text":"_purpur-field-helper-text_atw6b_1","purpur-field-helper-text--disabled":"_purpur-field-helper-text--disabled_atw6b_9"},J="purpur-field-helper-text",Te=({["data-testid"]:e,children:r,className:n,disabled:o,id:i,...t})=>{const a=Pe([n,X[J],{[X[`${J}--disabled`]]:o}]);return y.jsx("span",{id:i,className:a,"data-testid":e,...t,children:r})};function w(){return w=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},w.apply(null,arguments)}function ke(e,r){typeof e=="function"?e(r):e!=null&&(e.current=r)}function Me(...e){return r=>e.forEach(n=>ke(n,r))}const ne=c.forwardRef((e,r)=>{const{children:n,...o}=e,i=c.Children.toArray(n),t=i.find(je);if(t){const a=t.props.children,u=i.map(s=>s===t?c.Children.count(a)>1?c.Children.only(null):c.isValidElement(a)?a.props.children:null:s);return c.createElement(B,w({},o,{ref:r}),c.isValidElement(a)?c.cloneElement(a,void 0,u):null)}return c.createElement(B,w({},o,{ref:r}),n)});ne.displayName="Slot";const B=c.forwardRef((e,r)=>{const{children:n,...o}=e;return c.isValidElement(n)?c.cloneElement(n,{...De(o,n.props),ref:r?Me(r,n.ref):n.ref}):c.Children.count(n)>1?c.Children.only(null):null});B.displayName="SlotClone";const Fe=({children:e})=>c.createElement(c.Fragment,null,e);function je(e){return c.isValidElement(e)&&e.type===Fe}function De(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]=(...a)=>{t(...a),i(...a)}:i&&(n[o]=i):o==="style"?n[o]={...i,...t}:o==="className"&&(n[o]=[i,t].filter(Boolean).join(" "))}return{...e,...n}}const Le=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ge=Le.reduce((e,r)=>{const n=c.forwardRef((o,i)=>{const{asChild:t,...a}=o,u=t?ne:r;return c.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),c.createElement(u,w({},a,{ref:i}))});return n.displayName=`Primitive.${r}`,{...e,[r]:n}},{}),qe=c.forwardRef((e,r)=>c.createElement(Ge.label,w({},e,{ref:r,onMouseDown:n=>{var o;(o=e.onMouseDown)===null||o===void 0||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault()}}))),Ue=qe;function Be(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var re={exports:{}};/*!
*/(function(e){(function(){var r={}.hasOwnProperty;function n(){for(var t="",a=0;a<arguments.length;a++){var i=arguments[a];i&&(t=u(t,o(i)))}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 a="";for(var i in t)r.call(t,i)&&t[i]&&(a=u(a,i));return a}function u(t,a){return a?t?t+" "+a:t+a:t}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(te);var Oe=te.exports;const Pe=Ae(Oe),X={"purpur-field-helper-text":"_purpur-field-helper-text_atw6b_1","purpur-field-helper-text--disabled":"_purpur-field-helper-text--disabled_atw6b_9"},J="purpur-field-helper-text",Te=({["data-testid"]:e,children:r,className:n,disabled:o,id:u,...t})=>{const a=Pe([n,X[J],{[X[`${J}--disabled`]]:o}]);return y.jsx("span",{id:u,className:a,"data-testid":e,...t,children:r})};function w(){return w=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},w.apply(null,arguments)}function ke(e,r){typeof e=="function"?e(r):e!=null&&(e.current=r)}function Me(...e){return r=>e.forEach(n=>ke(n,r))}const ne=c.forwardRef((e,r)=>{const{children:n,...o}=e,u=c.Children.toArray(n),t=u.find(je);if(t){const a=t.props.children,i=u.map(s=>s===t?c.Children.count(a)>1?c.Children.only(null):c.isValidElement(a)?a.props.children:null:s);return c.createElement(B,w({},o,{ref:r}),c.isValidElement(a)?c.cloneElement(a,void 0,i):null)}return c.createElement(B,w({},o,{ref:r}),n)});ne.displayName="Slot";const B=c.forwardRef((e,r)=>{const{children:n,...o}=e;return c.isValidElement(n)?c.cloneElement(n,{...De(o,n.props),ref:r?Me(r,n.ref):n.ref}):c.Children.count(n)>1?c.Children.only(null):null});B.displayName="SlotClone";const Fe=({children:e})=>c.createElement(c.Fragment,null,e);function je(e){return c.isValidElement(e)&&e.type===Fe}function De(e,r){const n={...r};for(const o in r){const u=e[o],t=r[o];/^on[A-Z]/.test(o)?u&&t?n[o]=(...a)=>{t(...a),u(...a)}:u&&(n[o]=u):o==="style"?n[o]={...u,...t}:o==="className"&&(n[o]=[u,t].filter(Boolean).join(" "))}return{...e,...n}}const Le=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ge=Le.reduce((e,r)=>{const n=c.forwardRef((o,u)=>{const{asChild:t,...a}=o,i=t?ne:r;return c.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),c.createElement(i,w({},a,{ref:u}))});return n.displayName=`Primitive.${r}`,{...e,[r]:n}},{}),qe=c.forwardRef((e,r)=>c.createElement(Ge.label,w({},e,{ref:r,onMouseDown:n=>{var o;(o=e.onMouseDown)===null||o===void 0||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault()}}))),Ue=qe;function Be(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var re={exports:{}};/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/(function(e){(function(){var r={}.hasOwnProperty;function n(){for(var t="",a=0;a<arguments.length;a++){var u=arguments[a];u&&(t=i(t,o(u)))}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 a="";for(var u in t)r.call(t,u)&&t[u]&&(a=i(a,u));return a}function i(t,a){return a?t?t+" "+a:t+a:t}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(re);var Ve=re.exports;const ze=Be(Ve),G={"purpur-label":"_purpur-label_12cfi_1","purpur-label--negative":"_purpur-label--negative_12cfi_9","purpur-label--disabled":"_purpur-label--disabled_12cfi_12"},q="purpur-label",Ke=({children:e,className:r,htmlFor:n,"data-testid":o,disabled:i,negative:t=!1,...a})=>{const u=ze([r,G[q],{[G[`${q}--disabled`]]:i,[G[`${q}--negative`]]:t}]);return y.jsx(Ue,{className:u,"data-testid":o,htmlFor:n,...a,children:e})};function g(){return g=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},g.apply(null,arguments)}function R(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 Ye(e,r){typeof e=="function"?e(r):e!=null&&(e.current=r)}function oe(...e){return r=>e.forEach(n=>Ye(n,r))}function I(...e){return c.useCallback(oe(...e),e)}function j(e,r=[]){let n=[];function o(t,a){const u=c.createContext(a),s=n.length;n=[...n,a];function l(p){const{scope:b,children:d,...f}=p,m=(b==null?void 0:b[e][s])||u,_=c.useMemo(()=>f,Object.values(f));return c.createElement(m.Provider,{value:_},d)}function $(p,b){const d=(b==null?void 0:b[e][s])||u,f=c.useContext(d);if(f)return f;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${t}\``)}return l.displayName=t+"Provider",[l,$]}const i=()=>{const t=n.map(a=>c.createContext(a));return function(u){const s=(u==null?void 0:u[e])||t;return c.useMemo(()=>({[`__scope${e}`]:{...u,[e]:s}}),[u,s])}};return i.scopeName=e,[o,He(i,...r)]}function He(...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 a=o.reduce((u,{useScope:s,scopeName:l})=>{const p=s(t)[`__scope${l}`];return{...u,...p}},{});return c.useMemo(()=>({[`__scope${r.scopeName}`]:a}),[a])}};return n.scopeName=r.scopeName,n}const M=c.forwardRef((e,r)=>{const{children:n,...o}=e,i=c.Children.toArray(n),t=i.find(Ze);if(t){const a=t.props.children,u=i.map(s=>s===t?c.Children.count(a)>1?c.Children.only(null):c.isValidElement(a)?a.props.children:null:s);return c.createElement(V,g({},o,{ref:r}),c.isValidElement(a)?c.cloneElement(a,void 0,u):null)}return c.createElement(V,g({},o,{ref:r}),n)});M.displayName="Slot";const V=c.forwardRef((e,r)=>{const{children:n,...o}=e;return c.isValidElement(n)?c.cloneElement(n,{...Xe(o,n.props),ref:r?oe(r,n.ref):n.ref}):c.Children.count(n)>1?c.Children.only(null):null});V.displayName="SlotClone";const We=({children:e})=>c.createElement(c.Fragment,null,e);function Ze(e){return c.isValidElement(e)&&e.type===We}function Xe(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]=(...u)=>{t(...u),i(...u)}:i&&(n[o]=i):o==="style"?n[o]={...i,...t}:o==="className"&&(n[o]=[i,t].filter(Boolean).join(" "))}return{...e,...n}}const Je=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],A=Je.reduce((e,r)=>{const n=c.forwardRef((o,i)=>{const{asChild:t,...a}=o,u=t?M:r;return c.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),c.createElement(u,g({},a,{ref:i}))});return n.displayName=`Primitive.${r}`,{...e,[r]:n}},{});function Qe(e){const r=e+"CollectionProvider",[n,o]=j(r),[i,t]=n(r,{collectionRef:{current:null},itemMap:new Map}),a=d=>{const{scope:f,children:m}=d,_=c.useRef(null),h=c.useRef(new Map).current;return c.createElement(i,{scope:f,itemMap:h,collectionRef:_},m)},u=e+"CollectionSlot",s=c.forwardRef((d,f)=>{const{scope:m,children:_}=d,h=t(u,m),v=I(f,h.collectionRef);return c.createElement(M,{ref:v},_)}),l=e+"CollectionItemSlot",$="data-radix-collection-item",p=c.forwardRef((d,f)=>{const{scope:m,children:_,...h}=d,v=c.useRef(null),O=I(f,v),x=t(l,m);return c.useEffect(()=>(x.itemMap.set(v,{ref:v,...h}),()=>void x.itemMap.delete(v))),c.createElement(M,{[$]:"",ref:O},_)});function b(d){const f=t(e+"CollectionConsumer",d);return c.useCallback(()=>{const _=f.collectionRef.current;if(!_)return[];const h=Array.from(_.querySelectorAll(`[${$}]`));return Array.from(f.itemMap.values()).sort((x,D)=>h.indexOf(x.ref.current)-h.indexOf(D.ref.current))},[f.collectionRef,f.itemMap])}return[{Provider:a,Slot:s,ItemSlot:p},b,o]}const F=globalThis!=null&&globalThis.document?c.useLayoutEffect:()=>{},et=ee.useId||(()=>{});let tt=0;function nt(e){const[r,n]=ee.useState(et());return F(()=>{n(o=>o??String(tt++))},[e]),r?`radix-${r}`:""}function K(e){const r=c.useRef(e);return c.useEffect(()=>{r.current=e}),c.useMemo(()=>(...n)=>{var o;return(o=r.current)===null||o===void 0?void 0:o.call(r,...n)},[])}function ce({prop:e,defaultProp:r,onChange:n=()=>{}}){const[o,i]=rt({defaultProp:r,onChange:n}),t=e!==void 0,a=t?e:o,u=K(n),s=c.useCallback(l=>{if(t){const p=typeof l=="function"?l(e):l;p!==e&&u(p)}else i(l)},[t,e,i,u]);return[a,s]}function rt({defaultProp:e,onChange:r}){const n=c.useState(e),[o]=n,i=c.useRef(o),t=K(r);return c.useEffect(()=>{i.current!==o&&(t(o),i.current=o)},[o,i,t]),n}const ot=c.createContext(void 0);function ae(e){const r=c.useContext(ot);return e||r||"ltr"}const U="rovingFocusGroup.onEntryFocus",ct={bubbles:!1,cancelable:!0},Y="RovingFocusGroup",[z,ie,at]=Qe(Y),[it,ue]=j(Y,[at]),[ut,st]=it(Y),lt=c.forwardRef((e,r)=>c.createElement(z.Provider,{scope:e.__scopeRovingFocusGroup},c.createElement(z.Slot,{scope:e.__scopeRovingFocusGroup},c.createElement(dt,g({},e,{ref:r}))))),dt=c.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:i=!1,dir:t,currentTabStopId:a,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:s,onEntryFocus:l,...$}=e,p=c.useRef(null),b=I(r,p),d=ae(t),[f=null,m]=ce({prop:a,defaultProp:u,onChange:s}),[_,h]=c.useState(!1),v=K(l),O=ie(n),x=c.useRef(!1),[D,W]=c.useState(0);return c.useEffect(()=>{const E=p.current;if(E)return E.addEventListener(U,v),()=>E.removeEventListener(U,v)},[v]),c.createElement(ut,{scope:n,orientation:o,dir:d,loop:i,currentTabStopId:f,onItemFocus:c.useCallback(E=>m(E),[m]),onItemShiftTab:c.useCallback(()=>h(!0),[]),onFocusableItemAdd:c.useCallback(()=>W(E=>E+1),[]),onFocusableItemRemove:c.useCallback(()=>W(E=>E-1),[])},c.createElement(A.div,g({tabIndex:_||D===0?-1:0,"data-orientation":o},$,{ref:b,style:{outline:"none",...e.style},onMouseDown:R(e.onMouseDown,()=>{x.current=!0}),onFocus:R(e.onFocus,E=>{const xe=!x.current;if(E.target===E.currentTarget&&xe&&!_){const Z=new CustomEvent(U,ct);if(E.currentTarget.dispatchEvent(Z),!Z.defaultPrevented){const L=O().filter(S=>S.focusable),Se=L.find(S=>S.active),Ce=L.find(S=>S.id===f),Ne=[Se,Ce,...L].filter(Boolean).map(S=>S.ref.current);se(Ne)}}x.current=!1}),onBlur:R(e.onBlur,()=>h(!1))})))}),ft="RovingFocusGroupItem",pt=c.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:i=!1,tabStopId:t,...a}=e,u=nt(),s=t||u,l=st(ft,n),$=l.currentTabStopId===s,p=ie(n),{onFocusableItemAdd:b,onFocusableItemRemove:d}=l;return c.useEffect(()=>{if(o)return b(),()=>d()},[o,b,d]),c.createElement(z.ItemSlot,{scope:n,id:s,focusable:o,active:i},c.createElement(A.span,g({tabIndex:$?0:-1,"data-orientation":l.orientation},a,{ref:r,onMouseDown:R(e.onMouseDown,f=>{o?l.onItemFocus(s):f.preventDefault()}),onFocus:R(e.onFocus,()=>l.onItemFocus(s)),onKeyDown:R(e.onKeyDown,f=>{if(f.key==="Tab"&&f.shiftKey){l.onItemShiftTab();return}if(f.target!==f.currentTarget)return;const m=mt(f,l.orientation,l.dir);if(m!==void 0){f.preventDefault();let h=p().filter(v=>v.focusable).map(v=>v.ref.current);if(m==="last")h.reverse();else if(m==="prev"||m==="next"){m==="prev"&&h.reverse();const v=h.indexOf(f.currentTarget);h=l.loop?ht(h,v+1):h.slice(v+1)}setTimeout(()=>se(h))}})})))}),bt={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function $t(e,r){return r!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function mt(e,r,n){const o=$t(e.key,n);if(!(r==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(r==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return bt[o]}function se(e){const r=document.activeElement;for(const n of e)if(n===r||(n.focus(),document.activeElement!==r))return}function ht(e,r){return e.map((n,o)=>e[(r+o)%e.length])}const vt=lt,_t=pt;function gt(e){const[r,n]=c.useState(void 0);return F(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const t=i[0];let a,u;if("borderBoxSize"in t){const s=t.borderBoxSize,l=Array.isArray(s)?s[0]:s;a=l.inlineSize,u=l.blockSize}else a=e.offsetWidth,u=e.offsetHeight;n({width:a,height:u})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),r}function yt(e){const r=c.useRef({value:e,previous:e});return c.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}function Et(e,r){return c.useReducer((n,o)=>{const i=r[n][o];return i??n},e)}const le=e=>{const{present:r,children:n}=e,o=Rt(r),i=typeof n=="function"?n({present:o.isPresent}):c.Children.only(n),t=I(o.ref,i.ref);return typeof n=="function"||o.isPresent?c.cloneElement(i,{ref:t}):null};le.displayName="Presence";function Rt(e){const[r,n]=c.useState(),o=c.useRef({}),i=c.useRef(e),t=c.useRef("none"),a=e?"mounted":"unmounted",[u,s]=Et(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const l=P(o.current);t.current=u==="mounted"?l:"none"},[u]),F(()=>{const l=o.current,$=i.current;if($!==e){const b=t.current,d=P(l);e?s("MOUNT"):d==="none"||(l==null?void 0:l.display)==="none"?s("UNMOUNT"):s($&&b!==d?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,s]),F(()=>{if(r){const l=p=>{const d=P(o.current).includes(p.animationName);p.target===r&&d&&we.flushSync(()=>s("ANIMATION_END"))},$=p=>{p.target===r&&(t.current=P(o.current))};return r.addEventListener("animationstart",$),r.addEventListener("animationcancel",l),r.addEventListener("animationend",l),()=>{r.removeEventListener("animationstart",$),r.removeEventListener("animationcancel",l),r.removeEventListener("animationend",l)}}else s("ANIMATION_END")},[r,s]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:c.useCallback(l=>{l&&(o.current=getComputedStyle(l)),n(l)},[])}}function P(e){return(e==null?void 0:e.animationName)||"none"}const de="Radio",[xt,fe]=j(de),[St,Ct]=xt(de),Nt=c.forwardRef((e,r)=>{const{__scopeRadio:n,name:o,checked:i=!1,required:t,disabled:a,value:u="on",onCheck:s,...l}=e,[$,p]=c.useState(null),b=I(r,m=>p(m)),d=c.useRef(!1),f=$?!!$.closest("form"):!0;return c.createElement(St,{scope:n,checked:i,disabled:a},c.createElement(A.button,g({type:"button",role:"radio","aria-checked":i,"data-state":pe(i),"data-disabled":a?"":void 0,disabled:a,value:u},l,{ref:b,onClick:R(e.onClick,m=>{i||s==null||s(),f&&(d.current=m.isPropagationStopped(),d.current||m.stopPropagation())})})),f&&c.createElement(At,{control:$,bubbles:!d.current,name:o,value:u,checked:i,required:t,disabled:a,style:{transform:"translateX(-100%)"}}))}),wt="RadioIndicator",It=c.forwardRef((e,r)=>{const{__scopeRadio:n,forceMount:o,...i}=e,t=Ct(wt,n);return c.createElement(le,{present:o||t.checked},c.createElement(A.span,g({"data-state":pe(t.checked),"data-disabled":t.disabled?"":void 0},i,{ref:r})))}),At=e=>{const{control:r,checked:n,bubbles:o=!0,...i}=e,t=c.useRef(null),a=yt(n),u=gt(r);return c.useEffect(()=>{const s=t.current,l=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(l,"checked").set;if(a!==n&&p){const b=new Event("click",{bubbles:o});p.call(s,n),s.dispatchEvent(b)}},[a,n,o]),c.createElement("input",g({type:"radio","aria-hidden":!0,defaultChecked:n},i,{tabIndex:-1,ref:t,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function pe(e){return e?"checked":"unchecked"}const Ot=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],be="RadioGroup",[Pt,Qt]=j(be,[ue,fe]),$e=ue(),me=fe(),[Tt,kt]=Pt(be),Mt=c.forwardRef((e,r)=>{const{__scopeRadioGroup:n,name:o,defaultValue:i,value:t,required:a=!1,disabled:u=!1,orientation:s,dir:l,loop:$=!0,onValueChange:p,...b}=e,d=$e(n),f=ae(l),[m,_]=ce({prop:t,defaultProp:i,onChange:p});return c.createElement(Tt,{scope:n,name:o,required:a,disabled:u,value:m,onValueChange:_},c.createElement(vt,g({asChild:!0},d,{orientation:s,dir:f,loop:$}),c.createElement(A.div,g({role:"radiogroup","aria-required":a,"aria-orientation":s,"data-disabled":u?"":void 0,dir:f},b,{ref:r}))))}),Ft="RadioGroupItem",jt=c.forwardRef((e,r)=>{const{__scopeRadioGroup:n,disabled:o,...i}=e,t=kt(Ft,n),a=t.disabled||o,u=$e(n),s=me(n),l=c.useRef(null),$=I(r,l),p=t.value===i.value,b=c.useRef(!1);return c.useEffect(()=>{const d=m=>{Ot.includes(m.key)&&(b.current=!0)},f=()=>b.current=!1;return document.addEventListener("keydown",d),document.addEventListener("keyup",f),()=>{document.removeEventListener("keydown",d),document.removeEventListener("keyup",f)}},[]),c.createElement(_t,g({asChild:!0},u,{focusable:!a,active:p}),c.createElement(Nt,g({disabled:a,required:t.required,checked:p},s,i,{name:t.name,ref:$,onCheck:()=>t.onValueChange(i.value),onKeyDown:R(d=>{d.key==="Enter"&&d.preventDefault()}),onFocus:R(i.onFocus,()=>{var d;b.current&&((d=l.current)===null||d===void 0||d.click())})})))}),Dt=c.forwardRef((e,r)=>{const{__scopeRadioGroup:n,...o}=e,i=me(n);return c.createElement(It,g({},i,o,{ref:r}))}),Lt=Mt,Gt=jt,qt=Dt;function Ut(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var he={exports:{}};/*!
*/(function(e){(function(){var r={}.hasOwnProperty;function n(){for(var t="",a=0;a<arguments.length;a++){var i=arguments[a];i&&(t=u(t,o(i)))}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 a="";for(var i in t)r.call(t,i)&&t[i]&&(a=u(a,i));return a}function u(t,a){return a?t?t+" "+a:t+a:t}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(re);var Ve=re.exports;const ze=Be(Ve),G={"purpur-label":"_purpur-label_12cfi_1","purpur-label--negative":"_purpur-label--negative_12cfi_9","purpur-label--disabled":"_purpur-label--disabled_12cfi_12"},q="purpur-label",Ke=({children:e,className:r,htmlFor:n,"data-testid":o,disabled:u,negative:t=!1,...a})=>{const i=ze([r,G[q],{[G[`${q}--disabled`]]:u,[G[`${q}--negative`]]:t}]);return y.jsx(Ue,{className:i,"data-testid":o,htmlFor:n,...a,children:e})};function g(){return g=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},g.apply(null,arguments)}function R(e,r,{checkForDefaultPrevented:n=!0}={}){return function(u){if(e==null||e(u),n===!1||!u.defaultPrevented)return r==null?void 0:r(u)}}function Ye(e,r){typeof e=="function"?e(r):e!=null&&(e.current=r)}function oe(...e){return r=>e.forEach(n=>Ye(n,r))}function I(...e){return c.useCallback(oe(...e),e)}function j(e,r=[]){let n=[];function o(t,a){const i=c.createContext(a),s=n.length;n=[...n,a];function d(p){const{scope:b,children:l,...f}=p,m=(b==null?void 0:b[e][s])||i,v=c.useMemo(()=>f,Object.values(f));return c.createElement(m.Provider,{value:v},l)}function $(p,b){const l=(b==null?void 0:b[e][s])||i,f=c.useContext(l);if(f)return f;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${t}\``)}return d.displayName=t+"Provider",[d,$]}const u=()=>{const t=n.map(a=>c.createContext(a));return function(i){const s=(i==null?void 0:i[e])||t;return c.useMemo(()=>({[`__scope${e}`]:{...i,[e]:s}}),[i,s])}};return u.scopeName=e,[o,He(u,...r)]}function He(...e){const r=e[0];if(e.length===1)return r;const n=()=>{const o=e.map(u=>({useScope:u(),scopeName:u.scopeName}));return function(t){const a=o.reduce((i,{useScope:s,scopeName:d})=>{const p=s(t)[`__scope${d}`];return{...i,...p}},{});return c.useMemo(()=>({[`__scope${r.scopeName}`]:a}),[a])}};return n.scopeName=r.scopeName,n}const M=c.forwardRef((e,r)=>{const{children:n,...o}=e,u=c.Children.toArray(n),t=u.find(Ze);if(t){const a=t.props.children,i=u.map(s=>s===t?c.Children.count(a)>1?c.Children.only(null):c.isValidElement(a)?a.props.children:null:s);return c.createElement(V,g({},o,{ref:r}),c.isValidElement(a)?c.cloneElement(a,void 0,i):null)}return c.createElement(V,g({},o,{ref:r}),n)});M.displayName="Slot";const V=c.forwardRef((e,r)=>{const{children:n,...o}=e;return c.isValidElement(n)?c.cloneElement(n,{...Xe(o,n.props),ref:r?oe(r,n.ref):n.ref}):c.Children.count(n)>1?c.Children.only(null):null});V.displayName="SlotClone";const We=({children:e})=>c.createElement(c.Fragment,null,e);function Ze(e){return c.isValidElement(e)&&e.type===We}function Xe(e,r){const n={...r};for(const o in r){const u=e[o],t=r[o];/^on[A-Z]/.test(o)?u&&t?n[o]=(...i)=>{t(...i),u(...i)}:u&&(n[o]=u):o==="style"?n[o]={...u,...t}:o==="className"&&(n[o]=[u,t].filter(Boolean).join(" "))}return{...e,...n}}const Je=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],A=Je.reduce((e,r)=>{const n=c.forwardRef((o,u)=>{const{asChild:t,...a}=o,i=t?M:r;return c.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),c.createElement(i,g({},a,{ref:u}))});return n.displayName=`Primitive.${r}`,{...e,[r]:n}},{});function Qe(e){const r=e+"CollectionProvider",[n,o]=j(r),[u,t]=n(r,{collectionRef:{current:null},itemMap:new Map}),a=l=>{const{scope:f,children:m}=l,v=c.useRef(null),h=c.useRef(new Map).current;return c.createElement(u,{scope:f,itemMap:h,collectionRef:v},m)},i=e+"CollectionSlot",s=c.forwardRef((l,f)=>{const{scope:m,children:v}=l,h=t(i,m),_=I(f,h.collectionRef);return c.createElement(M,{ref:_},v)}),d=e+"CollectionItemSlot",$="data-radix-collection-item",p=c.forwardRef((l,f)=>{const{scope:m,children:v,...h}=l,_=c.useRef(null),O=I(f,_),x=t(d,m);return c.useEffect(()=>(x.itemMap.set(_,{ref:_,...h}),()=>void x.itemMap.delete(_))),c.createElement(M,{[$]:"",ref:O},v)});function b(l){const f=t(e+"CollectionConsumer",l);return c.useCallback(()=>{const v=f.collectionRef.current;if(!v)return[];const h=Array.from(v.querySelectorAll(`[${$}]`));return Array.from(f.itemMap.values()).sort((x,D)=>h.indexOf(x.ref.current)-h.indexOf(D.ref.current))},[f.collectionRef,f.itemMap])}return[{Provider:a,Slot:s,ItemSlot:p},b,o]}const F=globalThis!=null&&globalThis.document?c.useLayoutEffect:()=>{},et=ee.useId||(()=>{});let tt=0;function nt(e){const[r,n]=ee.useState(et());return F(()=>{n(o=>o??String(tt++))},[e]),r?`radix-${r}`:""}function K(e){const r=c.useRef(e);return c.useEffect(()=>{r.current=e}),c.useMemo(()=>(...n)=>{var o;return(o=r.current)===null||o===void 0?void 0:o.call(r,...n)},[])}function ce({prop:e,defaultProp:r,onChange:n=()=>{}}){const[o,u]=rt({defaultProp:r,onChange:n}),t=e!==void 0,a=t?e:o,i=K(n),s=c.useCallback(d=>{if(t){const p=typeof d=="function"?d(e):d;p!==e&&i(p)}else u(d)},[t,e,u,i]);return[a,s]}function rt({defaultProp:e,onChange:r}){const n=c.useState(e),[o]=n,u=c.useRef(o),t=K(r);return c.useEffect(()=>{u.current!==o&&(t(o),u.current=o)},[o,u,t]),n}const ot=c.createContext(void 0);function ae(e){const r=c.useContext(ot);return e||r||"ltr"}const U="rovingFocusGroup.onEntryFocus",ct={bubbles:!1,cancelable:!0},Y="RovingFocusGroup",[z,ue,at]=Qe(Y),[ut,ie]=j(Y,[at]),[it,st]=ut(Y),dt=c.forwardRef((e,r)=>c.createElement(z.Provider,{scope:e.__scopeRovingFocusGroup},c.createElement(z.Slot,{scope:e.__scopeRovingFocusGroup},c.createElement(lt,g({},e,{ref:r}))))),lt=c.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:u=!1,dir:t,currentTabStopId:a,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:s,onEntryFocus:d,...$}=e,p=c.useRef(null),b=I(r,p),l=ae(t),[f=null,m]=ce({prop:a,defaultProp:i,onChange:s}),[v,h]=c.useState(!1),_=K(d),O=ue(n),x=c.useRef(!1),[D,W]=c.useState(0);return c.useEffect(()=>{const E=p.current;if(E)return E.addEventListener(U,_),()=>E.removeEventListener(U,_)},[_]),c.createElement(it,{scope:n,orientation:o,dir:l,loop:u,currentTabStopId:f,onItemFocus:c.useCallback(E=>m(E),[m]),onItemShiftTab:c.useCallback(()=>h(!0),[]),onFocusableItemAdd:c.useCallback(()=>W(E=>E+1),[]),onFocusableItemRemove:c.useCallback(()=>W(E=>E-1),[])},c.createElement(A.div,g({tabIndex:v||D===0?-1:0,"data-orientation":o},$,{ref:b,style:{outline:"none",...e.style},onMouseDown:R(e.onMouseDown,()=>{x.current=!0}),onFocus:R(e.onFocus,E=>{const xe=!x.current;if(E.target===E.currentTarget&&xe&&!v){const Z=new CustomEvent(U,ct);if(E.currentTarget.dispatchEvent(Z),!Z.defaultPrevented){const L=O().filter(S=>S.focusable),Se=L.find(S=>S.active),Ce=L.find(S=>S.id===f),Ne=[Se,Ce,...L].filter(Boolean).map(S=>S.ref.current);se(Ne)}}x.current=!1}),onBlur:R(e.onBlur,()=>h(!1))})))}),ft="RovingFocusGroupItem",pt=c.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:u=!1,tabStopId:t,...a}=e,i=nt(),s=t||i,d=st(ft,n),$=d.currentTabStopId===s,p=ue(n),{onFocusableItemAdd:b,onFocusableItemRemove:l}=d;return c.useEffect(()=>{if(o)return b(),()=>l()},[o,b,l]),c.createElement(z.ItemSlot,{scope:n,id:s,focusable:o,active:u},c.createElement(A.span,g({tabIndex:$?0:-1,"data-orientation":d.orientation},a,{ref:r,onMouseDown:R(e.onMouseDown,f=>{o?d.onItemFocus(s):f.preventDefault()}),onFocus:R(e.onFocus,()=>d.onItemFocus(s)),onKeyDown:R(e.onKeyDown,f=>{if(f.key==="Tab"&&f.shiftKey){d.onItemShiftTab();return}if(f.target!==f.currentTarget)return;const m=mt(f,d.orientation,d.dir);if(m!==void 0){f.preventDefault();let h=p().filter(_=>_.focusable).map(_=>_.ref.current);if(m==="last")h.reverse();else if(m==="prev"||m==="next"){m==="prev"&&h.reverse();const _=h.indexOf(f.currentTarget);h=d.loop?ht(h,_+1):h.slice(_+1)}setTimeout(()=>se(h))}})})))}),bt={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function $t(e,r){return r!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function mt(e,r,n){const o=$t(e.key,n);if(!(r==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(r==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return bt[o]}function se(e){const r=document.activeElement;for(const n of e)if(n===r||(n.focus(),document.activeElement!==r))return}function ht(e,r){return e.map((n,o)=>e[(r+o)%e.length])}const _t=dt,vt=pt;function gt(e){const[r,n]=c.useState(void 0);return F(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(u=>{if(!Array.isArray(u)||!u.length)return;const t=u[0];let a,i;if("borderBoxSize"in t){const s=t.borderBoxSize,d=Array.isArray(s)?s[0]:s;a=d.inlineSize,i=d.blockSize}else a=e.offsetWidth,i=e.offsetHeight;n({width:a,height:i})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),r}function yt(e){const r=c.useRef({value:e,previous:e});return c.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}function Et(e,r){return c.useReducer((n,o)=>{const u=r[n][o];return u??n},e)}const de=e=>{const{present:r,children:n}=e,o=Rt(r),u=typeof n=="function"?n({present:o.isPresent}):c.Children.only(n),t=I(o.ref,u.ref);return typeof n=="function"||o.isPresent?c.cloneElement(u,{ref:t}):null};de.displayName="Presence";function Rt(e){const[r,n]=c.useState(),o=c.useRef({}),u=c.useRef(e),t=c.useRef("none"),a=e?"mounted":"unmounted",[i,s]=Et(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const d=P(o.current);t.current=i==="mounted"?d:"none"},[i]),F(()=>{const d=o.current,$=u.current;if($!==e){const b=t.current,l=P(d);e?s("MOUNT"):l==="none"||(d==null?void 0:d.display)==="none"?s("UNMOUNT"):s($&&b!==l?"ANIMATION_OUT":"UNMOUNT"),u.current=e}},[e,s]),F(()=>{if(r){const d=p=>{const l=P(o.current).includes(p.animationName);p.target===r&&l&&we.flushSync(()=>s("ANIMATION_END"))},$=p=>{p.target===r&&(t.current=P(o.current))};return r.addEventListener("animationstart",$),r.addEventListener("animationcancel",d),r.addEventListener("animationend",d),()=>{r.removeEventListener("animationstart",$),r.removeEventListener("animationcancel",d),r.removeEventListener("animationend",d)}}else s("ANIMATION_END")},[r,s]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:c.useCallback(d=>{d&&(o.current=getComputedStyle(d)),n(d)},[])}}function P(e){return(e==null?void 0:e.animationName)||"none"}const le="Radio",[xt,fe]=j(le),[St,Ct]=xt(le),Nt=c.forwardRef((e,r)=>{const{__scopeRadio:n,name:o,checked:u=!1,required:t,disabled:a,value:i="on",onCheck:s,...d}=e,[$,p]=c.useState(null),b=I(r,m=>p(m)),l=c.useRef(!1),f=$?!!$.closest("form"):!0;return c.createElement(St,{scope:n,checked:u,disabled:a},c.createElement(A.button,g({type:"button",role:"radio","aria-checked":u,"data-state":pe(u),"data-disabled":a?"":void 0,disabled:a,value:i},d,{ref:b,onClick:R(e.onClick,m=>{u||s==null||s(),f&&(l.current=m.isPropagationStopped(),l.current||m.stopPropagation())})})),f&&c.createElement(At,{control:$,bubbles:!l.current,name:o,value:i,checked:u,required:t,disabled:a,style:{transform:"translateX(-100%)"}}))}),wt="RadioIndicator",It=c.forwardRef((e,r)=>{const{__scopeRadio:n,forceMount:o,...u}=e,t=Ct(wt,n);return c.createElement(de,{present:o||t.checked},c.createElement(A.span,g({"data-state":pe(t.checked),"data-disabled":t.disabled?"":void 0},u,{ref:r})))}),At=e=>{const{control:r,checked:n,bubbles:o=!0,...u}=e,t=c.useRef(null),a=yt(n),i=gt(r);return c.useEffect(()=>{const s=t.current,d=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(d,"checked").set;if(a!==n&&p){const b=new Event("click",{bubbles:o});p.call(s,n),s.dispatchEvent(b)}},[a,n,o]),c.createElement("input",g({type:"radio","aria-hidden":!0,defaultChecked:n},u,{tabIndex:-1,ref:t,style:{...e.style,...i,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function pe(e){return e?"checked":"unchecked"}const Ot=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],be="RadioGroup",[Pt,Qt]=j(be,[ie,fe]),$e=ie(),me=fe(),[Tt,kt]=Pt(be),Mt=c.forwardRef((e,r)=>{const{__scopeRadioGroup:n,name:o,defaultValue:u,value:t,required:a=!1,disabled:i=!1,orientation:s,dir:d,loop:$=!0,onValueChange:p,...b}=e,l=$e(n),f=ae(d),[m,v]=ce({prop:t,defaultProp:u,onChange:p});return c.createElement(Tt,{scope:n,name:o,required:a,disabled:i,value:m,onValueChange:v},c.createElement(_t,g({asChild:!0},l,{orientation:s,dir:f,loop:$}),c.createElement(A.div,g({role:"radiogroup","aria-required":a,"aria-orientation":s,"data-disabled":i?"":void 0,dir:f},b,{ref:r}))))}),Ft="RadioGroupItem",jt=c.forwardRef((e,r)=>{const{__scopeRadioGroup:n,disabled:o,...u}=e,t=kt(Ft,n),a=t.disabled||o,i=$e(n),s=me(n),d=c.useRef(null),$=I(r,d),p=t.value===u.value,b=c.useRef(!1);return c.useEffect(()=>{const l=m=>{Ot.includes(m.key)&&(b.current=!0)},f=()=>b.current=!1;return document.addEventListener("keydown",l),document.addEventListener("keyup",f),()=>{document.removeEventListener("keydown",l),document.removeEventListener("keyup",f)}},[]),c.createElement(vt,g({asChild:!0},i,{focusable:!a,active:p}),c.createElement(Nt,g({disabled:a,required:t.required,checked:p},s,u,{name:t.name,ref:$,onCheck:()=>t.onValueChange(u.value),onKeyDown:R(l=>{l.key==="Enter"&&l.preventDefault()}),onFocus:R(u.onFocus,()=>{var l;b.current&&((l=d.current)===null||l===void 0||l.click())})})))}),Dt=c.forwardRef((e,r)=>{const{__scopeRadioGroup:n,...o}=e,u=me(n);return c.createElement(It,g({},u,o,{ref:r}))}),Lt=Mt,Gt=jt,qt=Dt;function Ut(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var he={exports:{}};/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/(function(e){(function(){var r={}.hasOwnProperty;function n(){for(var t="",a=0;a<arguments.length;a++){var u=arguments[a];u&&(t=i(t,o.call(this,u)))}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 a="";for(var u in t)r.call(t,u)&&t[u]&&(a=i(a,this&&this[u]||u));return a}function i(t,a){return a?t?t+" "+a:t+a:t}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(he);var Bt=he.exports;const ve=Ut(Bt),Vt={"purpur-radio-button-group-item":"_purpur-radio-button-group-item_5ncfs_1","purpur-radio-button-group-item__radio":"_purpur-radio-button-group-item__radio_5ncfs_14","purpur-radio-button-group-item__label":"_purpur-radio-button-group-item__label_5ncfs_42","purpur-radio-button-group-item__container":"_purpur-radio-button-group-item__container_5ncfs_45","purpur-radio-button-group-item__item-label-container":"_purpur-radio-button-group-item__item-label-container_5ncfs_53","purpur-radio-button-group-item__item-helper":"_purpur-radio-button-group-item__item-helper_5ncfs_53","purpur-radio-button-group-item__label-container":"_purpur-radio-button-group-item__label-container_5ncfs_56","purpur-radio-button-group-item__indicator":"_purpur-radio-button-group-item__indicator_5ncfs_78"},C=ve.bind(Vt),zt=["ltr","rtl"],Kt=["horizontal","vertical"],N="purpur-radio-button-group-item",_e=c.forwardRef(({disabled:e,id:r,required:n,value:o,label:i,"data-testid":t,helperText:a,...u},s)=>y.jsxs("div",{className:C(`${N}__container`),...u,children:[y.jsx(Gt,{className:C(N),"data-testid":t,disabled:e,id:r,ref:s,required:n,value:o,"aria-labelledby":`${r}-label ${r}-helper-text`,children:y.jsx("span",{className:C(`${N}__radio`),children:y.jsx(qt,{className:C(`${N}__indicator`)})})}),y.jsxs("span",{className:C(`${N}__label-container`),children:[y.jsx(Ke,{htmlFor:r,id:`${r}-label`,className:C(`${N}__label`),disabled:e,children:i}),a&&y.jsx(Te,{className:C(`${N}__helper`),"data-testid":t&&`${t}-helper-text`,disabled:e,id:`${r}-helper-text`,children:a})]})]},r));function Yt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ge={exports:{}};/*!
*/(function(e){(function(){var r={}.hasOwnProperty;function n(){for(var t="",a=0;a<arguments.length;a++){var i=arguments[a];i&&(t=u(t,o.call(this,i)))}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 a="";for(var i in t)r.call(t,i)&&t[i]&&(a=u(a,this&&this[i]||i));return a}function u(t,a){return a?t?t+" "+a:t+a:t}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(he);var Bt=he.exports;const _e=Ut(Bt),Vt={"purpur-radio-button-group-item":"_purpur-radio-button-group-item_5ncfs_1","purpur-radio-button-group-item__radio":"_purpur-radio-button-group-item__radio_5ncfs_14","purpur-radio-button-group-item__label":"_purpur-radio-button-group-item__label_5ncfs_42","purpur-radio-button-group-item__container":"_purpur-radio-button-group-item__container_5ncfs_45","purpur-radio-button-group-item__item-label-container":"_purpur-radio-button-group-item__item-label-container_5ncfs_53","purpur-radio-button-group-item__item-helper":"_purpur-radio-button-group-item__item-helper_5ncfs_53","purpur-radio-button-group-item__label-container":"_purpur-radio-button-group-item__label-container_5ncfs_56","purpur-radio-button-group-item__indicator":"_purpur-radio-button-group-item__indicator_5ncfs_78"},C=_e.bind(Vt),zt=["ltr","rtl"],Kt=["horizontal","vertical"],N="purpur-radio-button-group-item",ve=c.forwardRef(({disabled:e,id:r,required:n,value:o,label:u,"data-testid":t,helperText:a,...i},s)=>y.jsxs("div",{className:C(`${N}__container`),...i,children:[y.jsx(Gt,{className:C(N),"data-testid":t,disabled:e,id:r,ref:s,required:n,value:o,"aria-labelledby":`${r}-label ${r}-helper-text`,children:y.jsx("span",{className:C(`${N}__radio`),children:y.jsx(qt,{className:C(`${N}__indicator`)})})}),y.jsxs("span",{className:C(`${N}__label-container`),children:[y.jsx(Ke,{htmlFor:r,id:`${r}-label`,className:C(`${N}__label`),disabled:e,children:u}),a&&y.jsx(Te,{className:C(`${N}__helper`),"data-testid":t&&`${t}-helper-text`,disabled:e,id:`${r}-helper-text`,children:a})]})]},r));function Yt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ge={exports:{}};/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/(function(e){(function(){var r={}.hasOwnProperty;function n(){for(var t="",a=0;a<arguments.length;a++){var u=arguments[a];u&&(t=i(t,o(u)))}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 a="";for(var u in t)r.call(t,u)&&t[u]&&(a=i(a,u));return a}function i(t,a){return a?t?t+" "+a:t+a:t}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(ge);var Ht=ge.exports;const Wt=Yt(Ht),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"},Zt={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",ye=({["data-testid"]:e,children:r,className:n="",enableHyphenation:o=!1,negative:i=!1,tag:t,variant:a=Zt.TITLE100,...u})=>{const s=t,l=Wt([n,T[k],T[`${k}--${a}`],{[T[`${k}--hyphens`]]:o,[T[`${k}--negative`]]:i}]);return y.jsx(s,{...u,className:l,"data-testid":e,children:r})};ye.displayName="Heading";const Ee={"purpur-radio-button-group":"_purpur-radio-button-group_v7z64_1","purpur-radio-button-group__item-container":"_purpur-radio-button-group__item-container_v7z64_10","purpur-radio-button-group__container":"_purpur-radio-button-group__container_v7z64_13"},Xt=ve.bind(Ee),Q="purpur-radio-button-group",Re=c.forwardRef(({id:e,"data-testid":r,className:n,items:o,label:i,loop:t=!0,orientation:a="vertical",labelTag:u="h2",children:s,required:l,...$},p)=>{if(!(o!=null&&o.length)&&!s)return null;const b=()=>o==null?void 0:o.map(d=>y.jsx(_e,{disabled:$.disabled,...d},`radio-item-${d.value}`));return y.jsxs("div",{className:Xt(n,`${Q}__container`),children:[i&&y.jsx(ye,{tag:u,"data-testid":r?`${r}-label`:void 0,id:`${e}-label`,variant:"subsection-100",children:`${l?"* ":""}${i}`}),y.jsx(Lt,{...$,"aria-labelledby":i?`${e}-label`:void 0,className:Ee[Q],"data-testid":r,loop:t,orientation:a,ref:p,children:o!=null&&o.length?b():s})]})});Re.displayName="RadioButtonGroupRoot";const H=({children:e,...r})=>y.jsx(Re,{...r,children:e});H.Item=_e;H.displayName="RadioButtonGroup";exports.DIRECTION=zt;exports.ORIENTATION=Kt;exports.RadioButtonGroup=H;
*/(function(e){(function(){var r={}.hasOwnProperty;function n(){for(var t="",a=0;a<arguments.length;a++){var i=arguments[a];i&&(t=u(t,o(i)))}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 a="";for(var i in t)r.call(t,i)&&t[i]&&(a=u(a,i));return a}function u(t,a){return a?t?t+" "+a:t+a:t}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(ge);var Ht=ge.exports;const Wt=Yt(Ht),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"},Zt={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",ye=({["data-testid"]:e,children:r,className:n="",enableHyphenation:o=!1,negative:u=!1,tag:t,variant:a=Zt.TITLE100,...i})=>{const s=t,d=Wt([n,T[k],T[`${k}--${a}`],{[T[`${k}--hyphens`]]:o,[T[`${k}--negative`]]:u}]);return y.jsx(s,{...i,className:d,"data-testid":e,children:r})};ye.displayName="Heading";const Ee={"purpur-radio-button-group":"_purpur-radio-button-group_v7z64_1","purpur-radio-button-group__item-container":"_purpur-radio-button-group__item-container_v7z64_10","purpur-radio-button-group__container":"_purpur-radio-button-group__container_v7z64_13"},Xt=_e.bind(Ee),Q="purpur-radio-button-group",Re=c.forwardRef(({id:e,"data-testid":r,className:n,items:o,label:u,loop:t=!0,orientation:a="vertical",labelTag:i="h2",children:s,required:d,...$},p)=>{if(!(o!=null&&o.length)&&!s)return null;const b=()=>o==null?void 0:o.map(l=>y.jsx(ve,{disabled:$.disabled,...l},`radio-item-${l.value}`));return y.jsxs("div",{className:Xt(n,`${Q}__container`),children:[u&&y.jsx(ye,{tag:i,"data-testid":r?`${r}-label`:void 0,id:`${e}-label`,variant:"subsection-100",children:`${d?"* ":""}${u}`}),y.jsx(Lt,{...$,"aria-labelledby":u?`${e}-label`:void 0,className:Ee[Q],"data-testid":r,loop:t,orientation:a,ref:p,children:o!=null&&o.length?b():s})]})});Re.displayName="RadioButtonGroupRoot";const H=({children:e,...r})=>y.jsx(Re,{...r,children:e});H.Item=ve;H.displayName="RadioButtonGroup";exports.DIRECTION=zt;exports.ORIENTATION=Kt;exports.RadioButtonGroup=H;
//# sourceMappingURL=radio-button-group.cjs.js.map
import { jsx as x, jsxs as Q } from "react/jsx-runtime";
import * as le from "react";
import R, { forwardRef as _, Children as C, isValidElement as w, createElement as b, cloneElement as G, useEffect as A, Fragment as fe, useCallback as M, createContext as ee, useMemo as L, useContext as pe, useLayoutEffect as je, useRef as N, useState as k, useReducer as Be } from "react";
import R, { forwardRef as v, Children as C, isValidElement as w, createElement as b, cloneElement as G, useEffect as A, Fragment as fe, useCallback as M, createContext as ee, useMemo as L, useContext as pe, useLayoutEffect as je, useRef as N, useState as k, useReducer as Be } from "react";
import { flushSync as ze } from "react-dom";

@@ -19,4 +19,4 @@ function Ve(e) {

for (var t = "", c = 0; c < arguments.length; c++) {
var a = arguments[c];
a && (t = i(t, o(a)));
var i = arguments[c];
i && (t = u(t, o(i)));
}

@@ -35,7 +35,7 @@ return t;

var c = "";
for (var a in t)
r.call(t, a) && t[a] && (c = i(c, a));
for (var i in t)
r.call(t, i) && t[i] && (c = u(c, i));
return c;
}
function i(t, c) {
function u(t, c) {
return c ? t ? t + " " + c : t + c : t;

@@ -47,3 +47,3 @@ }

var Ke = be.exports;
const Ye = /* @__PURE__ */ Ve(Ke), ue = {
const Ye = /* @__PURE__ */ Ve(Ke), ae = {
"purpur-field-helper-text": "_purpur-field-helper-text_atw6b_1",

@@ -56,3 +56,3 @@ "purpur-field-helper-text--disabled": "_purpur-field-helper-text--disabled_atw6b_9"

disabled: o,
id: i,
id: u,
...t

@@ -62,8 +62,8 @@ }) => {

n,
ue[se],
ae[se],
{
[ue[`${se}--disabled`]]: o
[ae[`${se}--disabled`]]: o
}
]);
return /* @__PURE__ */ x("span", { id: i, className: c, "data-testid": e, ...t, children: r });
return /* @__PURE__ */ x("span", { id: u, className: c, "data-testid": e, ...t, children: r });
};

@@ -87,9 +87,9 @@ function F() {

}
const $e = /* @__PURE__ */ _((e, r) => {
const { children: n, ...o } = e, i = C.toArray(n), t = i.find(Je);
const $e = /* @__PURE__ */ v((e, r) => {
const { children: n, ...o } = e, u = C.toArray(n), t = u.find(Je);
if (t) {
const c = t.props.children, a = i.map((u) => u === t ? C.count(c) > 1 ? C.only(null) : /* @__PURE__ */ w(c) ? c.props.children : null : u);
const c = t.props.children, i = u.map((a) => a === t ? C.count(c) > 1 ? C.only(null) : /* @__PURE__ */ w(c) ? c.props.children : null : a);
return /* @__PURE__ */ b(te, F({}, o, {
ref: r
}), /* @__PURE__ */ w(c) ? /* @__PURE__ */ G(c, void 0, a) : null);
}), /* @__PURE__ */ w(c) ? /* @__PURE__ */ G(c, void 0, i) : null);
}

@@ -101,3 +101,3 @@ return /* @__PURE__ */ b(te, F({}, o, {

$e.displayName = "Slot";
const te = /* @__PURE__ */ _((e, r) => {
const te = /* @__PURE__ */ v((e, r) => {
const { children: n, ...o } = e;

@@ -119,10 +119,10 @@ return /* @__PURE__ */ w(n) ? /* @__PURE__ */ G(n, {

for (const o in r) {
const i = e[o], t = r[o];
/^on[A-Z]/.test(o) ? i && t ? n[o] = (...c) => {
t(...c), i(...c);
} : i && (n[o] = i) : o === "style" ? n[o] = {
...i,
const u = e[o], t = r[o];
/^on[A-Z]/.test(o) ? u && t ? n[o] = (...c) => {
t(...c), u(...c);
} : u && (n[o] = u) : o === "style" ? n[o] = {
...u,
...t
} : o === "className" && (n[o] = [
i,
u,
t

@@ -154,8 +154,8 @@ ].filter(Boolean).join(" "));

], tt = et.reduce((e, r) => {
const n = /* @__PURE__ */ _((o, i) => {
const { asChild: t, ...c } = o, a = t ? $e : r;
const n = /* @__PURE__ */ v((o, u) => {
const { asChild: t, ...c } = o, i = t ? $e : r;
return A(() => {
window[Symbol.for("radix-ui")] = !0;
}, []), /* @__PURE__ */ b(a, F({}, c, {
ref: i
}, []), /* @__PURE__ */ b(i, F({}, c, {
ref: u
}));

@@ -167,3 +167,3 @@ });

};
}, {}), nt = /* @__PURE__ */ _((e, r) => /* @__PURE__ */ b(tt.label, F({}, e, {
}, {}), nt = /* @__PURE__ */ v((e, r) => /* @__PURE__ */ b(tt.label, F({}, e, {
ref: r,

@@ -189,4 +189,4 @@ onMouseDown: (n) => {

for (var t = "", c = 0; c < arguments.length; c++) {
var a = arguments[c];
a && (t = i(t, o(a)));
var i = arguments[c];
i && (t = u(t, o(i)));
}

@@ -205,7 +205,7 @@ return t;

var c = "";
for (var a in t)
r.call(t, a) && t[a] && (c = i(c, a));
for (var i in t)
r.call(t, i) && t[i] && (c = u(c, i));
return c;
}
function i(t, c) {
function u(t, c) {
return c ? t ? t + " " + c : t + c : t;

@@ -217,7 +217,7 @@ }

var ct = me.exports;
const it = /* @__PURE__ */ ot(ct), Z = {
const ut = /* @__PURE__ */ ot(ct), Z = {
"purpur-label": "_purpur-label_12cfi_1",
"purpur-label--negative": "_purpur-label--negative_12cfi_9",
"purpur-label--disabled": "_purpur-label--disabled_12cfi_12"
}, X = "purpur-label", at = ({
}, X = "purpur-label", it = ({
children: e,

@@ -227,15 +227,15 @@ className: r,

"data-testid": o,
disabled: i,
disabled: u,
negative: t = !1,
...c
}) => {
const a = it([
const i = ut([
r,
Z[X],
{
[Z[`${X}--disabled`]]: i,
[Z[`${X}--disabled`]]: u,
[Z[`${X}--negative`]]: t
}
]);
return /* @__PURE__ */ x(rt, { className: a, "data-testid": o, htmlFor: n, ...c, children: e });
return /* @__PURE__ */ x(rt, { className: i, "data-testid": o, htmlFor: n, ...c, children: e });
};

@@ -252,16 +252,16 @@ function y() {

function I(e, r, { checkForDefaultPrevented: n = !0 } = {}) {
return function(i) {
if (e == null || e(i), n === !1 || !i.defaultPrevented) return r == null ? void 0 : r(i);
return function(u) {
if (e == null || e(u), n === !1 || !u.defaultPrevented) return r == null ? void 0 : r(u);
};
}
function ut(e, r) {
function at(e, r) {
typeof e == "function" ? e(r) : e != null && (e.current = r);
}
function ve(...e) {
function he(...e) {
return (r) => e.forEach(
(n) => ut(n, r)
(n) => at(n, r)
);
}
function D(...e) {
return M(ve(...e), e);
return M(he(...e), e);
}

@@ -271,3 +271,3 @@ function Y(e, r = []) {

function o(t, c) {
const a = /* @__PURE__ */ ee(c), u = n.length;
const i = /* @__PURE__ */ ee(c), a = n.length;
n = [

@@ -278,3 +278,3 @@ ...n,

function s(f) {
const { scope: p, children: d, ...l } = f, m = (p == null ? void 0 : p[e][u]) || a, g = L(
const { scope: p, children: d, ...l } = f, m = (p == null ? void 0 : p[e][a]) || i, g = L(
() => l,

@@ -288,3 +288,3 @@ Object.values(l)

function $(f, p) {
const d = (p == null ? void 0 : p[e][u]) || a, l = pe(d);
const d = (p == null ? void 0 : p[e][a]) || i, l = pe(d);
if (l) return l;

@@ -299,16 +299,16 @@ if (c !== void 0) return c;

}
const i = () => {
const u = () => {
const t = n.map((c) => /* @__PURE__ */ ee(c));
return function(a) {
const u = (a == null ? void 0 : a[e]) || t;
return function(i) {
const a = (i == null ? void 0 : i[e]) || t;
return L(
() => ({
[`__scope${e}`]: {
...a,
[e]: u
...i,
[e]: a
}
}),
[
a,
u
i,
a
]

@@ -318,5 +318,5 @@ );

};
return i.scopeName = e, [
return u.scopeName = e, [
o,
st(i, ...r)
st(u, ...r)
];

@@ -329,12 +329,12 @@ }

const o = e.map(
(i) => ({
useScope: i(),
scopeName: i.scopeName
(u) => ({
useScope: u(),
scopeName: u.scopeName
})
);
return function(t) {
const c = o.reduce((a, { useScope: u, scopeName: s }) => {
const f = u(t)[`__scope${s}`];
const c = o.reduce((i, { useScope: a, scopeName: s }) => {
const f = a(t)[`__scope${s}`];
return {
...a,
...i,
...f

@@ -355,9 +355,9 @@ };

}
const V = /* @__PURE__ */ _((e, r) => {
const { children: n, ...o } = e, i = C.toArray(n), t = i.find(lt);
const V = /* @__PURE__ */ v((e, r) => {
const { children: n, ...o } = e, u = C.toArray(n), t = u.find(lt);
if (t) {
const c = t.props.children, a = i.map((u) => u === t ? C.count(c) > 1 ? C.only(null) : /* @__PURE__ */ w(c) ? c.props.children : null : u);
const c = t.props.children, i = u.map((a) => a === t ? C.count(c) > 1 ? C.only(null) : /* @__PURE__ */ w(c) ? c.props.children : null : a);
return /* @__PURE__ */ b(ne, y({}, o, {
ref: r
}), /* @__PURE__ */ w(c) ? /* @__PURE__ */ G(c, void 0, a) : null);
}), /* @__PURE__ */ w(c) ? /* @__PURE__ */ G(c, void 0, i) : null);
}

@@ -369,7 +369,7 @@ return /* @__PURE__ */ b(ne, y({}, o, {

V.displayName = "Slot";
const ne = /* @__PURE__ */ _((e, r) => {
const ne = /* @__PURE__ */ v((e, r) => {
const { children: n, ...o } = e;
return /* @__PURE__ */ w(n) ? /* @__PURE__ */ G(n, {
...ft(o, n.props),
ref: r ? ve(r, n.ref) : n.ref
ref: r ? he(r, n.ref) : n.ref
}) : C.count(n) > 1 ? C.only(null) : null;

@@ -387,10 +387,10 @@ });

for (const o in r) {
const i = e[o], t = r[o];
/^on[A-Z]/.test(o) ? i && t ? n[o] = (...a) => {
t(...a), i(...a);
} : i && (n[o] = i) : o === "style" ? n[o] = {
...i,
const u = e[o], t = r[o];
/^on[A-Z]/.test(o) ? u && t ? n[o] = (...i) => {
t(...i), u(...i);
} : u && (n[o] = u) : o === "style" ? n[o] = {
...u,
...t
} : o === "className" && (n[o] = [
i,
u,
t

@@ -422,8 +422,8 @@ ].filter(Boolean).join(" "));

], U = pt.reduce((e, r) => {
const n = /* @__PURE__ */ _((o, i) => {
const { asChild: t, ...c } = o, a = t ? V : r;
const n = /* @__PURE__ */ v((o, u) => {
const { asChild: t, ...c } = o, i = t ? V : r;
return A(() => {
window[Symbol.for("radix-ui")] = !0;
}, []), /* @__PURE__ */ b(a, y({}, c, {
ref: i
}, []), /* @__PURE__ */ b(i, y({}, c, {
ref: u
}));

@@ -437,3 +437,3 @@ });

function bt(e) {
const r = e + "CollectionProvider", [n, o] = Y(r), [i, t] = n(r, {
const r = e + "CollectionProvider", [n, o] = Y(r), [u, t] = n(r, {
collectionRef: {

@@ -444,19 +444,19 @@ current: null

}), c = (d) => {
const { scope: l, children: m } = d, g = R.useRef(null), v = R.useRef(/* @__PURE__ */ new Map()).current;
return /* @__PURE__ */ R.createElement(i, {
const { scope: l, children: m } = d, g = R.useRef(null), h = R.useRef(/* @__PURE__ */ new Map()).current;
return /* @__PURE__ */ R.createElement(u, {
scope: l,
itemMap: v,
itemMap: h,
collectionRef: g
}, m);
}, a = e + "CollectionSlot", u = /* @__PURE__ */ R.forwardRef((d, l) => {
const { scope: m, children: g } = d, v = t(a, m), h = D(l, v.collectionRef);
}, i = e + "CollectionSlot", a = /* @__PURE__ */ R.forwardRef((d, l) => {
const { scope: m, children: g } = d, h = t(i, m), _ = D(l, h.collectionRef);
return /* @__PURE__ */ R.createElement(V, {
ref: h
ref: _
}, g);
}), s = e + "CollectionItemSlot", $ = "data-radix-collection-item", f = /* @__PURE__ */ R.forwardRef((d, l) => {
const { scope: m, children: g, ...v } = d, h = R.useRef(null), q = D(l, h), E = t(s, m);
return R.useEffect(() => (E.itemMap.set(h, {
ref: h,
...v
}), () => void E.itemMap.delete(h))), /* @__PURE__ */ R.createElement(V, {
const { scope: m, children: g, ...h } = d, _ = R.useRef(null), q = D(l, _), E = t(s, m);
return R.useEffect(() => (E.itemMap.set(_, {
ref: _,
...h
}), () => void E.itemMap.delete(_))), /* @__PURE__ */ R.createElement(V, {
[$]: "",

@@ -471,5 +471,5 @@ ref: q

if (!g) return [];
const v = Array.from(g.querySelectorAll(`[${$}]`));
const h = Array.from(g.querySelectorAll(`[${$}]`));
return Array.from(l.itemMap.values()).sort(
(E, H) => v.indexOf(E.ref.current) - v.indexOf(H.ref.current)
(E, H) => h.indexOf(E.ref.current) - h.indexOf(H.ref.current)
);

@@ -484,3 +484,3 @@ }, [

Provider: c,
Slot: u,
Slot: a,
ItemSlot: f

@@ -496,3 +496,3 @@ },

let mt = 0;
function vt(e) {
function ht(e) {
const [r, n] = le.useState($t());

@@ -519,36 +519,36 @@ return K(() => {

}
function he({ prop: e, defaultProp: r, onChange: n = () => {
function _e({ prop: e, defaultProp: r, onChange: n = () => {
} }) {
const [o, i] = ht({
const [o, u] = _t({
defaultProp: r,
onChange: n
}), t = e !== void 0, c = t ? e : o, a = oe(n), u = M((s) => {
}), t = e !== void 0, c = t ? e : o, i = oe(n), a = M((s) => {
if (t) {
const f = typeof s == "function" ? s(e) : s;
f !== e && a(f);
} else i(s);
f !== e && i(f);
} else u(s);
}, [
t,
e,
i,
a
u,
i
]);
return [
c,
u
a
];
}
function ht({ defaultProp: e, onChange: r }) {
const n = k(e), [o] = n, i = N(o), t = oe(r);
function _t({ defaultProp: e, onChange: r }) {
const n = k(e), [o] = n, u = N(o), t = oe(r);
return A(() => {
i.current !== o && (t(o), i.current = o);
u.current !== o && (t(o), u.current = o);
}, [
o,
i,
u,
t
]), n;
}
const _t = /* @__PURE__ */ ee(void 0);
function _e(e) {
const r = pe(_t);
const vt = /* @__PURE__ */ ee(void 0);
function ve(e) {
const r = pe(vt);
return e || r || "ltr";

@@ -561,3 +561,3 @@ }

yt
]), [xt, Nt] = St(ce), Ct = /* @__PURE__ */ _((e, r) => /* @__PURE__ */ b(re.Provider, {
]), [xt, Nt] = St(ce), Ct = /* @__PURE__ */ v((e, r) => /* @__PURE__ */ b(re.Provider, {
scope: e.__scopeRovingFocusGroup

@@ -568,14 +568,14 @@ }, /* @__PURE__ */ b(re.Slot, {

ref: r
}))))), Rt = /* @__PURE__ */ _((e, r) => {
const { __scopeRovingFocusGroup: n, orientation: o, loop: i = !1, dir: t, currentTabStopId: c, defaultCurrentTabStopId: a, onCurrentTabStopIdChange: u, onEntryFocus: s, ...$ } = e, f = N(null), p = D(r, f), d = _e(t), [l = null, m] = he({
}))))), Rt = /* @__PURE__ */ v((e, r) => {
const { __scopeRovingFocusGroup: n, orientation: o, loop: u = !1, dir: t, currentTabStopId: c, defaultCurrentTabStopId: i, onCurrentTabStopIdChange: a, onEntryFocus: s, ...$ } = e, f = N(null), p = D(r, f), d = ve(t), [l = null, m] = _e({
prop: c,
defaultProp: a,
onChange: u
}), [g, v] = k(!1), h = oe(s), q = ge(n), E = N(!1), [H, ie] = k(0);
defaultProp: i,
onChange: a
}), [g, h] = k(!1), _ = oe(s), q = ge(n), E = N(!1), [H, ue] = k(0);
return A(() => {
const S = f.current;
if (S)
return S.addEventListener(J, h), () => S.removeEventListener(J, h);
return S.addEventListener(J, _), () => S.removeEventListener(J, _);
}, [
h
_
]), /* @__PURE__ */ b(xt, {

@@ -585,3 +585,3 @@ scope: n,

dir: d,
loop: i,
loop: u,
currentTabStopId: l,

@@ -595,7 +595,7 @@ onItemFocus: M(

onItemShiftTab: M(
() => v(!0),
() => h(!0),
[]
),
onFocusableItemAdd: M(
() => ie(
() => ue(
(S) => S + 1

@@ -606,3 +606,3 @@ ),

onFocusableItemRemove: M(
() => ie(
() => ue(
(S) => S - 1

@@ -627,4 +627,4 @@ ),

if (S.target === S.currentTarget && Le && !g) {
const ae = new CustomEvent(J, gt);
if (S.currentTarget.dispatchEvent(ae), !ae.defaultPrevented) {
const ie = new CustomEvent(J, gt);
if (S.currentTarget.dispatchEvent(ie), !ie.defaultPrevented) {
const W = q().filter(

@@ -650,7 +650,7 @@ (P) => P.focusable

e.onBlur,
() => v(!1)
() => h(!1)
)
})));
}), It = "RovingFocusGroupItem", At = /* @__PURE__ */ _((e, r) => {
const { __scopeRovingFocusGroup: n, focusable: o = !0, active: i = !1, tabStopId: t, ...c } = e, a = vt(), u = t || a, s = Nt(It, n), $ = s.currentTabStopId === u, f = ge(n), { onFocusableItemAdd: p, onFocusableItemRemove: d } = s;
}), It = "RovingFocusGroupItem", At = /* @__PURE__ */ v((e, r) => {
const { __scopeRovingFocusGroup: n, focusable: o = !0, active: u = !1, tabStopId: t, ...c } = e, i = ht(), a = t || i, s = Nt(It, n), $ = s.currentTabStopId === a, f = ge(n), { onFocusableItemAdd: p, onFocusableItemRemove: d } = s;
return A(() => {

@@ -665,5 +665,5 @@ if (o)

scope: n,
id: u,
id: a,
focusable: o,
active: i
active: u
}, /* @__PURE__ */ b(U.span, y({

@@ -675,7 +675,7 @@ tabIndex: $ ? 0 : -1,

onMouseDown: I(e.onMouseDown, (l) => {
o ? s.onItemFocus(u) : l.preventDefault();
o ? s.onItemFocus(a) : l.preventDefault();
}),
onFocus: I(
e.onFocus,
() => s.onItemFocus(u)
() => s.onItemFocus(a)
),

@@ -691,15 +691,15 @@ onKeyDown: I(e.onKeyDown, (l) => {

l.preventDefault();
let v = f().filter(
(h) => h.focusable
let h = f().filter(
(_) => _.focusable
).map(
(h) => h.ref.current
(_) => _.ref.current
);
if (m === "last") v.reverse();
if (m === "last") h.reverse();
else if (m === "prev" || m === "next") {
m === "prev" && v.reverse();
const h = v.indexOf(l.currentTarget);
v = s.loop ? Tt(v, h + 1) : v.slice(h + 1);
m === "prev" && h.reverse();
const _ = h.indexOf(l.currentTarget);
h = s.loop ? Tt(h, _ + 1) : h.slice(_ + 1);
}
setTimeout(
() => Se(v)
() => Se(h)
);

@@ -752,14 +752,14 @@ }

});
const o = new ResizeObserver((i) => {
if (!Array.isArray(i) || !i.length) return;
const t = i[0];
let c, a;
const o = new ResizeObserver((u) => {
if (!Array.isArray(u) || !u.length) return;
const t = u[0];
let c, i;
if ("borderBoxSize" in t) {
const u = t.borderBoxSize, s = Array.isArray(u) ? u[0] : u;
c = s.inlineSize, a = s.blockSize;
const a = t.borderBoxSize, s = Array.isArray(a) ? a[0] : a;
c = s.inlineSize, i = s.blockSize;
} else
c = e.offsetWidth, a = e.offsetHeight;
c = e.offsetWidth, i = e.offsetHeight;
n({
width: c,
height: a
height: i
});

@@ -787,11 +787,11 @@ });

return Be((n, o) => {
const i = r[n][o];
return i ?? n;
const u = r[n][o];
return u ?? n;
}, e);
}
const xe = (e) => {
const { present: r, children: n } = e, o = Lt(r), i = typeof n == "function" ? n({
const { present: r, children: n } = e, o = Lt(r), u = typeof n == "function" ? n({
present: o.isPresent
}) : C.only(n), t = D(o.ref, i.ref);
return typeof n == "function" || o.isPresent ? /* @__PURE__ */ G(i, {
}) : C.only(n), t = D(o.ref, u.ref);
return typeof n == "function" || o.isPresent ? /* @__PURE__ */ G(u, {
ref: t

@@ -802,3 +802,3 @@ }) : null;

function Lt(e) {
const [r, n] = k(), o = N({}), i = N(e), t = N("none"), c = e ? "mounted" : "unmounted", [a, u] = Dt(c, {
const [r, n] = k(), o = N({}), u = N(e), t = N("none"), c = e ? "mounted" : "unmounted", [i, a] = Dt(c, {
mounted: {

@@ -818,14 +818,14 @@ UNMOUNT: "unmounted",

const s = j(o.current);
t.current = a === "mounted" ? s : "none";
t.current = i === "mounted" ? s : "none";
}, [
a
i
]), K(() => {
const s = o.current, $ = i.current;
const s = o.current, $ = u.current;
if ($ !== e) {
const p = t.current, d = j(s);
e ? u("MOUNT") : d === "none" || (s == null ? void 0 : s.display) === "none" ? u("UNMOUNT") : u($ && p !== d ? "ANIMATION_OUT" : "UNMOUNT"), i.current = e;
e ? a("MOUNT") : d === "none" || (s == null ? void 0 : s.display) === "none" ? a("UNMOUNT") : a($ && p !== d ? "ANIMATION_OUT" : "UNMOUNT"), u.current = e;
}
}, [
e,
u
a
]), K(() => {

@@ -836,3 +836,3 @@ if (r) {

f.target === r && d && ze(
() => u("ANIMATION_END")
() => a("ANIMATION_END")
);

@@ -846,6 +846,6 @@ }, $ = (f) => {

} else
u("ANIMATION_END");
a("ANIMATION_END");
}, [
r,
u
a
]), {

@@ -855,3 +855,3 @@ isPresent: [

"unmountSuspended"
].includes(a),
].includes(i),
ref: M((s) => {

@@ -865,4 +865,4 @@ s && (o.current = getComputedStyle(s)), n(s);

}
const Ne = "Radio", [Gt, Ce] = Y(Ne), [Ut, qt] = Gt(Ne), jt = /* @__PURE__ */ _((e, r) => {
const { __scopeRadio: n, name: o, checked: i = !1, required: t, disabled: c, value: a = "on", onCheck: u, ...s } = e, [$, f] = k(null), p = D(
const Ne = "Radio", [Gt, Ce] = Y(Ne), [Ut, qt] = Gt(Ne), jt = /* @__PURE__ */ v((e, r) => {
const { __scopeRadio: n, name: o, checked: u = !1, required: t, disabled: c, value: i = "on", onCheck: a, ...s } = e, [$, f] = k(null), p = D(
r,

@@ -873,3 +873,3 @@ (m) => f(m)

scope: n,
checked: i,
checked: u,
disabled: c

@@ -879,11 +879,11 @@ }, /* @__PURE__ */ b(U.button, y({

role: "radio",
"aria-checked": i,
"data-state": Re(i),
"aria-checked": u,
"data-state": Re(u),
"data-disabled": c ? "" : void 0,
disabled: c,
value: a
value: i
}, s, {
ref: p,
onClick: I(e.onClick, (m) => {
i || u == null || u(), l && (d.current = m.isPropagationStopped(), d.current || m.stopPropagation());
u || a == null || a(), l && (d.current = m.isPropagationStopped(), d.current || m.stopPropagation());
})

@@ -894,4 +894,4 @@ })), l && /* @__PURE__ */ b(Vt, {

name: o,
value: a,
checked: i,
value: i,
checked: u,
required: t,

@@ -903,4 +903,4 @@ disabled: c,

}));
}), Bt = "RadioIndicator", zt = /* @__PURE__ */ _((e, r) => {
const { __scopeRadio: n, forceMount: o, ...i } = e, t = qt(Bt, n);
}), Bt = "RadioIndicator", zt = /* @__PURE__ */ v((e, r) => {
const { __scopeRadio: n, forceMount: o, ...u } = e, t = qt(Bt, n);
return /* @__PURE__ */ b(xe, {

@@ -911,9 +911,9 @@ present: o || t.checked

"data-disabled": t.disabled ? "" : void 0
}, i, {
}, u, {
ref: r
})));
}), Vt = (e) => {
const { control: r, checked: n, bubbles: o = !0, ...i } = e, t = N(null), c = Ft(n), a = kt(r);
const { control: r, checked: n, bubbles: o = !0, ...u } = e, t = N(null), c = Ft(n), i = kt(r);
return A(() => {
const u = t.current, s = window.HTMLInputElement.prototype, f = Object.getOwnPropertyDescriptor(s, "checked").set;
const a = t.current, s = window.HTMLInputElement.prototype, f = Object.getOwnPropertyDescriptor(s, "checked").set;
if (c !== n && f) {

@@ -923,3 +923,3 @@ const p = new Event("click", {

});
f.call(u, n), u.dispatchEvent(p);
f.call(a, n), a.dispatchEvent(p);
}

@@ -934,3 +934,3 @@ }, [

defaultChecked: n
}, i, {
}, u, {
tabIndex: -1,

@@ -940,3 +940,3 @@ ref: t,

...e.style,
...a,
...i,
position: "absolute",

@@ -960,6 +960,6 @@ pointerEvents: "none",

Ce
]), Ae = ye(), Ee = Ce(), [Ht, Wt] = Yt(Ie), Zt = /* @__PURE__ */ _((e, r) => {
const { __scopeRadioGroup: n, name: o, defaultValue: i, value: t, required: c = !1, disabled: a = !1, orientation: u, dir: s, loop: $ = !0, onValueChange: f, ...p } = e, d = Ae(n), l = _e(s), [m, g] = he({
]), Ae = ye(), Ee = Ce(), [Ht, Wt] = Yt(Ie), Zt = /* @__PURE__ */ v((e, r) => {
const { __scopeRadioGroup: n, name: o, defaultValue: u, value: t, required: c = !1, disabled: i = !1, orientation: a, dir: s, loop: $ = !0, onValueChange: f, ...p } = e, d = Ae(n), l = ve(s), [m, g] = _e({
prop: t,
defaultProp: i,
defaultProp: u,
onChange: f

@@ -971,3 +971,3 @@ });

required: c,
disabled: a,
disabled: i,
value: m,

@@ -978,3 +978,3 @@ onValueChange: g

}, d, {
orientation: u,
orientation: a,
dir: l,

@@ -985,4 +985,4 @@ loop: $

"aria-required": c,
"aria-orientation": u,
"data-disabled": a ? "" : void 0,
"aria-orientation": a,
"data-disabled": i ? "" : void 0,
dir: l

@@ -992,4 +992,4 @@ }, p, {

}))));
}), Xt = "RadioGroupItem", Jt = /* @__PURE__ */ _((e, r) => {
const { __scopeRadioGroup: n, disabled: o, ...i } = e, t = Wt(Xt, n), c = t.disabled || o, a = Ae(n), u = Ee(n), s = N(null), $ = D(r, s), f = t.value === i.value, p = N(!1);
}), Xt = "RadioGroupItem", Jt = /* @__PURE__ */ v((e, r) => {
const { __scopeRadioGroup: n, disabled: o, ...u } = e, t = Wt(Xt, n), c = t.disabled || o, i = Ae(n), a = Ee(n), s = N(null), $ = D(r, s), f = t.value === u.value, p = N(!1);
return A(() => {

@@ -1004,3 +1004,3 @@ const d = (m) => {

asChild: !0
}, a, {
}, i, {
focusable: !c,

@@ -1012,10 +1012,10 @@ active: f

checked: f
}, u, i, {
}, a, u, {
name: t.name,
ref: $,
onCheck: () => t.onValueChange(i.value),
onCheck: () => t.onValueChange(u.value),
onKeyDown: I((d) => {
d.key === "Enter" && d.preventDefault();
}),
onFocus: I(i.onFocus, () => {
onFocus: I(u.onFocus, () => {
var d;

@@ -1025,5 +1025,5 @@ p.current && ((d = s.current) === null || d === void 0 || d.click());

})));
}), Qt = /* @__PURE__ */ _((e, r) => {
const { __scopeRadioGroup: n, ...o } = e, i = Ee(n);
return /* @__PURE__ */ b(zt, y({}, i, o, {
}), Qt = /* @__PURE__ */ v((e, r) => {
const { __scopeRadioGroup: n, ...o } = e, u = Ee(n);
return /* @__PURE__ */ b(zt, y({}, u, o, {
ref: r

@@ -1046,4 +1046,4 @@ }));

for (var t = "", c = 0; c < arguments.length; c++) {
var a = arguments[c];
a && (t = i(t, o.call(this, a)));
var i = arguments[c];
i && (t = u(t, o.call(this, i)));
}

@@ -1062,7 +1062,7 @@ return t;

var c = "";
for (var a in t)
r.call(t, a) && t[a] && (c = i(c, this && this[a] || a));
for (var i in t)
r.call(t, i) && t[i] && (c = u(c, this && this[i] || i));
return c;
}
function i(t, c) {
function u(t, c) {
return c ? t ? t + " " + c : t + c : t;

@@ -1083,3 +1083,3 @@ }

"purpur-radio-button-group-item__indicator": "_purpur-radio-button-group-item__indicator_5ncfs_78"
}, T = Pe.bind(cn), vn = ["ltr", "rtl"], hn = ["horizontal", "vertical"], O = "purpur-radio-button-group-item", Te = _(
}, T = Pe.bind(cn), hn = ["ltr", "rtl"], _n = ["horizontal", "vertical"], O = "purpur-radio-button-group-item", Te = v(
({

@@ -1090,7 +1090,7 @@ disabled: e,

value: o,
label: i,
label: u,
"data-testid": t,
helperText: c,
...a
}, u) => /* @__PURE__ */ Q("div", { className: T(`${O}__container`), ...a, children: [
...i
}, a) => /* @__PURE__ */ Q("div", { className: T(`${O}__container`), ...i, children: [
/* @__PURE__ */ x(

@@ -1103,3 +1103,3 @@ tn,

id: r,
ref: u,
ref: a,
required: n,

@@ -1113,3 +1113,3 @@ value: o,

/* @__PURE__ */ x(
at,
it,
{

@@ -1120,3 +1120,3 @@ htmlFor: r,

disabled: e,
children: i
children: u
}

@@ -1137,3 +1137,3 @@ ),

);
function an(e) {
function un(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;

@@ -1152,4 +1152,4 @@ }

for (var t = "", c = 0; c < arguments.length; c++) {
var a = arguments[c];
a && (t = i(t, o(a)));
var i = arguments[c];
i && (t = u(t, o(i)));
}

@@ -1168,7 +1168,7 @@ return t;

var c = "";
for (var a in t)
r.call(t, a) && t[a] && (c = i(c, a));
for (var i in t)
r.call(t, i) && t[i] && (c = u(c, i));
return c;
}
function i(t, c) {
function u(t, c) {
return c ? t ? t + " " + c : t + c : t;

@@ -1179,4 +1179,4 @@ }

})(Oe);
var un = Oe.exports;
const sn = /* @__PURE__ */ an(un), B = {
var an = Oe.exports;
const sn = /* @__PURE__ */ un(an), B = {
"purpur-heading": "_purpur-heading_k9fhq_1",

@@ -1211,8 +1211,8 @@ "purpur-heading--hyphens": "_purpur-heading--hyphens_k9fhq_8",

enableHyphenation: o = !1,
negative: i = !1,
negative: u = !1,
tag: t,
variant: c = dn.TITLE100,
...a
...i
}) => {
const u = t, s = sn([
const a = t, s = sn([
n,

@@ -1223,6 +1223,6 @@ B[z],

[B[`${z}--hyphens`]]: o,
[B[`${z}--negative`]]: i
[B[`${z}--negative`]]: u
}
]);
return /* @__PURE__ */ x(u, { ...a, className: s, "data-testid": e, children: r });
return /* @__PURE__ */ x(a, { ...i, className: s, "data-testid": e, children: r });
};

@@ -1234,3 +1234,3 @@ Me.displayName = "Heading";

"purpur-radio-button-group__container": "_purpur-radio-button-group__container_v7z64_13"
}, ln = Pe.bind(ke), de = "purpur-radio-button-group", Fe = _(
}, ln = Pe.bind(ke), de = "purpur-radio-button-group", Fe = v(
({

@@ -1241,11 +1241,11 @@ id: e,

items: o,
label: i,
label: u,
loop: t = !0,
orientation: c = "vertical",
labelTag: a = "h2",
children: u,
labelTag: i = "h2",
children: a,
required: s,
...$
}, f) => {
if (!(o != null && o.length) && !u)
if (!(o != null && o.length) && !a)
return null;

@@ -1261,10 +1261,10 @@ const p = () => o == null ? void 0 : o.map((d) => /* @__PURE__ */ x(

return /* @__PURE__ */ Q("div", { className: ln(n, `${de}__container`), children: [
i && /* @__PURE__ */ x(
u && /* @__PURE__ */ x(
Me,
{
tag: a,
tag: i,
"data-testid": r ? `${r}-label` : void 0,
id: `${e}-label`,
variant: "subsection-100",
children: `${s ? "* " : ""}${i}`
children: `${s ? "* " : ""}${u}`
}

@@ -1276,3 +1276,3 @@ ),

...$,
"aria-labelledby": i ? `${e}-label` : void 0,
"aria-labelledby": u ? `${e}-label` : void 0,
className: ke[de],

@@ -1283,3 +1283,3 @@ "data-testid": r,

ref: f,
children: o != null && o.length ? p() : u
children: o != null && o.length ? p() : a
}

@@ -1298,6 +1298,6 @@ )

export {
vn as DIRECTION,
hn as ORIENTATION,
hn as DIRECTION,
_n as ORIENTATION,
De as RadioButtonGroup
};
//# sourceMappingURL=radio-button-group.es.js.map
{
"name": "@purpurds/radio-button-group",
"version": "5.31.0",
"version": "5.32.0",
"license": "AGPL-3.0-only",

@@ -19,7 +19,7 @@ "main": "./dist/radio-button-group.cjs.js",

"classnames": "~2.5.0",
"@purpurds/heading": "5.31.0",
"@purpurds/paragraph": "5.31.0",
"@purpurds/label": "5.31.0",
"@purpurds/field-helper-text": "5.31.0",
"@purpurds/tokens": "5.31.0"
"@purpurds/label": "5.32.0",
"@purpurds/paragraph": "5.32.0",
"@purpurds/tokens": "5.32.0",
"@purpurds/field-helper-text": "5.32.0",
"@purpurds/heading": "5.32.0"
},

@@ -49,3 +49,3 @@ "devDependencies": {

"vitest": "^2.1.2",
"@purpurds/button": "5.31.0",
"@purpurds/button": "5.32.0",
"@purpurds/component-rig": "1.0.0"

@@ -52,0 +52,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc