@purpurds/checkbox 5.14.0 → 5.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LICENSE.txt +5 -5
- package/dist/checkbox.cjs.js +7 -7
- package/dist/checkbox.cjs.js.map +1 -1
- package/dist/checkbox.es.js +236 -258
- package/dist/checkbox.es.js.map +1 -1
- package/package.json +6 -6
package/dist/LICENSE.txt
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
Name: @purpurds/field-error-text
|
|
2
|
-
Version: 5.
|
|
2
|
+
Version: 5.15.0
|
|
3
3
|
License: AGPL-3.0-only
|
|
4
4
|
Private: false
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
Name: @purpurds/icon
|
|
9
|
-
Version: 5.
|
|
9
|
+
Version: 5.15.0
|
|
10
10
|
License: AGPL-3.0-only
|
|
11
11
|
Private: false
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
15
15
|
Name: @purpurds/label
|
|
16
|
-
Version: 5.
|
|
16
|
+
Version: 5.15.0
|
|
17
17
|
License: AGPL-3.0-only
|
|
18
18
|
Private: false
|
|
19
19
|
|
|
20
20
|
---
|
|
21
21
|
|
|
22
22
|
Name: @purpurds/paragraph
|
|
23
|
-
Version: 5.
|
|
23
|
+
Version: 5.15.0
|
|
24
24
|
License: AGPL-3.0-only
|
|
25
25
|
Private: false
|
|
26
26
|
|
|
27
27
|
---
|
|
28
28
|
|
|
29
29
|
Name: @babel/runtime
|
|
30
|
-
Version: 7.
|
|
30
|
+
Version: 7.25.6
|
|
31
31
|
License: MIT
|
|
32
32
|
Private: false
|
|
33
33
|
Description: babel's modular runtime helpers
|
package/dist/checkbox.cjs.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),c=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),c=require("react"),ue=require("react-dom");function ie(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var U={exports:{}};/*!
|
|
2
2
|
Copyright (c) 2018 Jed Watson.
|
|
3
3
|
Licensed under the MIT License (MIT), see
|
|
4
4
|
http://jedwatson.github.io/classnames
|
|
5
|
-
*/(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",o=0;o<arguments.length;o++){var
|
|
5
|
+
*/(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",o=0;o<arguments.length;o++){var u=arguments[o];u&&(r=i(r,a.call(this,u)))}return r}function a(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 o="";for(var u in r)n.call(r,u)&&r[u]&&(o=i(o,this&&this[u]||u));return o}function i(r,o){return o?r?r+" "+o:r+o:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(U);var ce=U.exports;const se=ie(ce),le={"purpur-icon":"_purpur-icon_8u1lq_1","purpur-icon--xxs":"_purpur-icon--xxs_8u1lq_4","purpur-icon--xs":"_purpur-icon--xs_8u1lq_8","purpur-icon--sm":"_purpur-icon--sm_8u1lq_12","purpur-icon--md":"_purpur-icon--md_8u1lq_16","purpur-icon--lg":"_purpur-icon--lg_8u1lq_20","purpur-icon--xl":"_purpur-icon--xl_8u1lq_24"},pe={name:"error-filled",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 24" fill="currentColor"><path fill-rule="evenodd" d="M14.268 3.5c-.77-1.333-2.694-1.333-3.464 0l-8.66 15c-.77 1.333.192 3 1.732 3h17.32c1.54 0 2.502-1.667 1.733-3l-8.66-15Zm-.694 5.067-.247 6.876h-1.566l-.247-6.876a1.03 1.03 0 1 1 2.06 0Zm.212 8.917c0 .649-.585 1.234-1.25 1.234-.648 0-1.25-.585-1.25-1.234 0-.633.602-1.234 1.25-1.234.665 0 1.25.601 1.25 1.234Z" clip-rule="evenodd"/></svg>',keywords:["error-filled"],category:"status"},de=se.bind(le),D="purpur-icon",fe="md",he=e=>e.filter(n=>Object.keys(n).length>=1).map(n=>`${n.name}="${n.value}"`).join(" "),me=({content:e="",title:n}={})=>{const t=[{name:"xmlns",value:"http://www.w3.org/2000/svg"},{name:"fill",value:"currentColor"},{name:"viewBox",value:"0 0 24 24"},n?{name:"role",value:"img"}:{name:"aria-hidden",value:"true"}],a=n?`<title>${n}</title>`:"";return`<svg ${he(t)}>${a}${e}</svg>`},ve=e=>e.replace(/<(\/?)svg([^>]*)>/g,"").trim(),be=({["data-testid"]:e,svg:n,allyTitle:t,className:a,size:i=fe,...r})=>{const o=me({content:ve(n.svg),title:t}),u=de(a,D,`${D}--${i}`);return d.jsx("span",{"aria-label":t,className:u,"data-testid":e,dangerouslySetInnerHTML:{__html:o},...r})};function _e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var V={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="",o=0;o<arguments.length;o++){var
|
|
9
|
+
*/(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",o=0;o<arguments.length;o++){var u=arguments[o];u&&(r=i(r,a(u)))}return r}function a(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 o="";for(var u in r)n.call(r,u)&&r[u]&&(o=i(o,u));return o}function i(r,o){return o?r?r+" "+o:r+o:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(V);var ge=V.exports;const $e=_e(ge),L={"purpur-field-error-text":"_purpur-field-error-text_1u768_1","purpur-field-error-text__icon":"_purpur-field-error-text__icon_1u768_12"},I="purpur-field-error-text",xe=({["data-testid"]:e,children:n,className:t,relevant:a="additions text",...i})=>d.jsxs("div",{className:$e([t,L[I]]),"data-testid":e,"aria-live":"assertive","aria-relevant":a,...i,children:[d.jsx(be,{svg:pe,size:"xs",className:L[`${I}__icon`]}),n]});function ye(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var H={exports:{}};/*!
|
|
10
10
|
Copyright (c) 2018 Jed Watson.
|
|
11
11
|
Licensed under the MIT License (MIT), see
|
|
12
12
|
http://jedwatson.github.io/classnames
|
|
13
|
-
*/(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",o=0;o<arguments.length;o++){var
|
|
13
|
+
*/(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",o=0;o<arguments.length;o++){var u=arguments[o];u&&(r=i(r,a.call(this,u)))}return r}function a(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 o="";for(var u in r)n.call(r,u)&&r[u]&&(o=i(o,this&&this[u]||u));return o}function i(r,o){return o?r?r+" "+o:r+o:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(H);var we=H.exports;const Ce=ye(we),Se={"purpur-icon":"_purpur-icon_8u1lq_1","purpur-icon--xxs":"_purpur-icon--xxs_8u1lq_4","purpur-icon--xs":"_purpur-icon--xs_8u1lq_8","purpur-icon--sm":"_purpur-icon--sm_8u1lq_12","purpur-icon--md":"_purpur-icon--md_8u1lq_16","purpur-icon--lg":"_purpur-icon--lg_8u1lq_20","purpur-icon--xl":"_purpur-icon--xl_8u1lq_24"},Ne={name:"checkmark-bold",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M21.243 4.176a2 2 0 0 1 .324 2.81l-10.45 13.176a2.092 2.092 0 0 1-3.118.18l-5.413-5.413A2 2 0 1 1 5.414 12.1l3.9 3.9 9.118-11.5a2 2 0 0 1 2.81-.324Z" clip-rule="evenodd"/></svg>',keywords:["checkmark-bold"],category:"utility"},Ee={name:"minus-bold",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M3 12c0-1.105.711-2 1.588-2h14.824c.877 0 1.588.895 1.588 2s-.711 2-1.588 2H4.588C3.711 14 3 13.105 3 12Z" clip-rule="evenodd"/></svg>',keywords:["minus-bold"],category:"utility"},Ae=Ce.bind(Se),B="purpur-icon",ke="md",Pe=e=>e.filter(n=>Object.keys(n).length>=1).map(n=>`${n.name}="${n.value}"`).join(" "),Oe=({content:e="",title:n}={})=>{const t=[{name:"xmlns",value:"http://www.w3.org/2000/svg"},{name:"fill",value:"currentColor"},{name:"viewBox",value:"0 0 24 24"},n?{name:"role",value:"img"}:{name:"aria-hidden",value:"true"}],a=n?`<title>${n}</title>`:"";return`<svg ${Pe(t)}>${a}${e}</svg>`},je=e=>e.replace(/<(\/?)svg([^>]*)>/g,"").trim(),z=({["data-testid"]:e,svg:n,allyTitle:t,className:a,size:i=ke,...r})=>{const o=Oe({content:je(n.svg),title:t}),u=Ae(a,B,`${B}--${i}`);return d.jsx("span",{"aria-label":t,className:u,"data-testid":e,dangerouslySetInnerHTML:{__html:o},...r})};function w(){return w=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var a in t)({}).hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},w.apply(null,arguments)}function Me(e,n){typeof e=="function"?e(n):e!=null&&(e.current=n)}function Re(...e){return n=>e.forEach(t=>Me(t,n))}const F=c.forwardRef((e,n)=>{const{children:t,...a}=e,i=c.Children.toArray(t),r=i.find(De);if(r){const o=r.props.children,u=i.map(s=>s===r?c.Children.count(o)>1?c.Children.only(null):c.isValidElement(o)?o.props.children:null:s);return c.createElement(M,w({},a,{ref:n}),c.isValidElement(o)?c.cloneElement(o,void 0,u):null)}return c.createElement(M,w({},a,{ref:n}),t)});F.displayName="Slot";const M=c.forwardRef((e,n)=>{const{children:t,...a}=e;return c.isValidElement(t)?c.cloneElement(t,{...Le(a,t.props),ref:n?Re(n,t.ref):t.ref}):c.Children.count(t)>1?c.Children.only(null):null});M.displayName="SlotClone";const qe=({children:e})=>c.createElement(c.Fragment,null,e);function De(e){return c.isValidElement(e)&&e.type===qe}function Le(e,n){const t={...n};for(const a in n){const i=e[a],r=n[a];/^on[A-Z]/.test(a)?i&&r?t[a]=(...o)=>{r(...o),i(...o)}:i&&(t[a]=i):a==="style"?t[a]={...i,...r}:a==="className"&&(t[a]=[i,r].filter(Boolean).join(" "))}return{...e,...t}}const Ie=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Be=Ie.reduce((e,n)=>{const t=c.forwardRef((a,i)=>{const{asChild:r,...o}=a,u=r?F:n;return c.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),c.createElement(u,w({},o,{ref:i}))});return t.displayName=`Primitive.${n}`,{...e,[n]:t}},{}),ze=c.forwardRef((e,n)=>c.createElement(Be.label,w({},e,{ref:n,onMouseDown:t=>{var a;(a=e.onMouseDown)===null||a===void 0||a.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault()}}))),Te=ze;function Ue(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Z={exports:{}};/*!
|
|
14
14
|
Copyright (c) 2018 Jed Watson.
|
|
15
15
|
Licensed under the MIT License (MIT), see
|
|
16
16
|
http://jedwatson.github.io/classnames
|
|
17
|
-
*/(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",o=0;o<arguments.length;o++){var
|
|
17
|
+
*/(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",o=0;o<arguments.length;o++){var u=arguments[o];u&&(r=i(r,a(u)))}return r}function a(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 o="";for(var u in r)n.call(r,u)&&r[u]&&(o=i(o,u));return o}function i(r,o){return o?r?r+" "+o:r+o:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(Z);var Ve=Z.exports;const He=Ue(Ve),P={"purpur-label":"_purpur-label_12cfi_1","purpur-label--negative":"_purpur-label--negative_12cfi_9","purpur-label--disabled":"_purpur-label--disabled_12cfi_12"},O="purpur-label",Fe=({children:e,className:n,htmlFor:t,"data-testid":a,disabled:i,negative:r=!1,...o})=>{const u=He([n,P[O],{[P[`${O}--disabled`]]:i,[P[`${O}--negative`]]:r}]);return d.jsx(Te,{className:u,"data-testid":a,htmlFor:t,...o,children:e})};function Ze(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var G={exports:{}};/*!
|
|
18
18
|
Copyright (c) 2018 Jed Watson.
|
|
19
19
|
Licensed under the MIT License (MIT), see
|
|
20
20
|
http://jedwatson.github.io/classnames
|
|
21
|
-
*/(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",o=0;o<arguments.length;o++){var i=arguments[o];i&&(r=u(r,a(i)))}return r}function a(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 o="";for(var i in r)n.call(r,i)&&r[i]&&(o=u(o,i));return o}function u(r,o){return o?r?r+" "+o:r+o:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(X);var Xe=X.exports;const We=Ke(Xe),w={"purpur-paragraph":"_purpur-paragraph_1rh57_1","purpur-paragraph--disabled":"_purpur-paragraph--disabled_1rh57_7","purpur-paragraph--hyphens":"_purpur-paragraph--hyphens_1rh57_10","purpur-paragraph--negative":"_purpur-paragraph--negative_1rh57_13","purpur-paragraph--paragraph-100":"_purpur-paragraph--paragraph-100_1rh57_16","purpur-paragraph--paragraph-100-medium":"_purpur-paragraph--paragraph-100-medium_1rh57_22","purpur-paragraph--paragraph-100-bold":"_purpur-paragraph--paragraph-100-bold_1rh57_29","purpur-paragraph--paragraph-200":"_purpur-paragraph--paragraph-200_1rh57_36","purpur-paragraph--preamble-100":"_purpur-paragraph--preamble-100_1rh57_42","purpur-paragraph--preamble-200":"_purpur-paragraph--preamble-200_1rh57_48","purpur-paragraph--additional-100":"_purpur-paragraph--additional-100_1rh57_54","purpur-paragraph--additional-100-medium":"_purpur-paragraph--additional-100-medium_1rh57_60","purpur-paragraph--overline-100":"_purpur-paragraph--overline-100_1rh57_67","purpur-paragraph--overline-200":"_purpur-paragraph--overline-200_1rh57_75"},Je={PARAGRAPH100:"paragraph-100",PARAGRAPH100MEDIUM:"paragraph-100-medium",PARAGRAPH100BOLD:"paragraph-100-bold",PARAGRAPH200:"paragraph-200",PREAMBLE100:"preamble-100",PREAMBLE200:"preamble-200",ADDITIONAL100:"additional-100",ADDITIONAL100MEDIUM:"additional-100-medium",OVERLINE100:"overline-100",OVERLINE200:"overline-200"},C="purpur-paragraph",W=({["data-testid"]:e,children:n,className:t,disabled:a,enableHyphenation:u=!1,negative:r=!1,variant:o=Je.PARAGRAPH100,...i})=>{const s=We([t,w[C],w[`${C}--${o}`],{[w[`${C}--hyphens`]]:u,[w[`${C}--disabled`]]:a,[w[`${C}--negative`]]:r}]);return d.jsx("p",{...i,className:s,"data-testid":e,children:n})};W.displayName="Paragraph";function S(){return S=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},S.apply(this,arguments)}function Ye(e,n){typeof e=="function"?e(n):e!=null&&(e.current=n)}function J(...e){return n=>e.forEach(t=>Ye(t,n))}function Y(...e){return c.useCallback(J(...e),e)}function Qe(e,n=[]){let t=[];function a(r,o){const i=c.createContext(o),s=t.length;t=[...t,o];function l(p){const{scope:f,children:v,...b}=p,O=(f==null?void 0:f[e][s])||i,g=c.useMemo(()=>b,Object.values(b));return c.createElement(O.Provider,{value:g},v)}function h(p,f){const v=(f==null?void 0:f[e][s])||i,b=c.useContext(v);if(b)return b;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${r}\``)}return l.displayName=r+"Provider",[l,h]}const u=()=>{const r=t.map(o=>c.createContext(o));return function(i){const s=(i==null?void 0:i[e])||r;return c.useMemo(()=>({[`__scope${e}`]:{...i,[e]:s}}),[i,s])}};return u.scopeName=e,[a,er(u,...n)]}function er(...e){const n=e[0];if(e.length===1)return n;const t=()=>{const a=e.map(u=>({useScope:u(),scopeName:u.scopeName}));return function(r){const o=a.reduce((i,{useScope:s,scopeName:l})=>{const p=s(r)[`__scope${l}`];return{...i,...p}},{});return c.useMemo(()=>({[`__scope${n.scopeName}`]:o}),[o])}};return t.scopeName=n.scopeName,t}function V(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 Q(e){const n=c.useRef(e);return c.useEffect(()=>{n.current=e}),c.useMemo(()=>(...t)=>{var a;return(a=n.current)===null||a===void 0?void 0:a.call(n,...t)},[])}function rr({prop:e,defaultProp:n,onChange:t=()=>{}}){const[a,u]=tr({defaultProp:n,onChange:t}),r=e!==void 0,o=r?e:a,i=Q(t),s=c.useCallback(l=>{if(r){const p=typeof l=="function"?l(e):l;p!==e&&i(p)}else u(l)},[r,e,u,i]);return[o,s]}function tr({defaultProp:e,onChange:n}){const t=c.useState(e),[a]=t,u=c.useRef(a),r=Q(n);return c.useEffect(()=>{u.current!==a&&(r(a),u.current=a)},[a,u,r]),t}function nr(e){const n=c.useRef({value:e,previous:e});return c.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}const D=globalThis!=null&&globalThis.document?c.useLayoutEffect:()=>{};function or(e){const[n,t]=c.useState(void 0);return D(()=>{if(e){t({width:e.offsetWidth,height:e.offsetHeight});const a=new ResizeObserver(u=>{if(!Array.isArray(u)||!u.length)return;const r=u[0];let o,i;if("borderBoxSize"in r){const s=r.borderBoxSize,l=Array.isArray(s)?s[0]:s;o=l.inlineSize,i=l.blockSize}else o=e.offsetWidth,i=e.offsetHeight;t({width:o,height:i})});return a.observe(e,{box:"border-box"}),()=>a.unobserve(e)}else t(void 0)},[e]),n}function ar(e,n){return c.useReducer((t,a)=>{const u=n[t][a];return u??t},e)}const ee=e=>{const{present:n,children:t}=e,a=ir(n),u=typeof t=="function"?t({present:a.isPresent}):c.Children.only(t),r=Y(a.ref,u.ref);return typeof t=="function"||a.isPresent?c.cloneElement(u,{ref:r}):null};ee.displayName="Presence";function ir(e){const[n,t]=c.useState(),a=c.useRef({}),u=c.useRef(e),r=c.useRef("none"),o=e?"mounted":"unmounted",[i,s]=ar(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const l=A(a.current);r.current=i==="mounted"?l:"none"},[i]),D(()=>{const l=a.current,h=u.current;if(h!==e){const f=r.current,v=A(l);e?s("MOUNT"):v==="none"||(l==null?void 0:l.display)==="none"?s("UNMOUNT"):s(h&&f!==v?"ANIMATION_OUT":"UNMOUNT"),u.current=e}},[e,s]),D(()=>{if(n){const l=p=>{const v=A(a.current).includes(p.animationName);p.target===n&&v&&ce.flushSync(()=>s("ANIMATION_END"))},h=p=>{p.target===n&&(r.current=A(a.current))};return n.addEventListener("animationstart",h),n.addEventListener("animationcancel",l),n.addEventListener("animationend",l),()=>{n.removeEventListener("animationstart",h),n.removeEventListener("animationcancel",l),n.removeEventListener("animationend",l)}}else s("ANIMATION_END")},[n,s]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:c.useCallback(l=>{l&&(a.current=getComputedStyle(l)),t(l)},[])}}function A(e){return(e==null?void 0:e.animationName)||"none"}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 a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},E.apply(this,arguments)}const re=c.forwardRef((e,n)=>{const{children:t,...a}=e,u=c.Children.toArray(t),r=u.find(cr);if(r){const o=r.props.children,i=u.map(s=>s===r?c.Children.count(o)>1?c.Children.only(null):c.isValidElement(o)?o.props.children:null:s);return c.createElement(L,E({},a,{ref:n}),c.isValidElement(o)?c.cloneElement(o,void 0,i):null)}return c.createElement(L,E({},a,{ref:n}),t)});re.displayName="Slot";const L=c.forwardRef((e,n)=>{const{children:t,...a}=e;return c.isValidElement(t)?c.cloneElement(t,{...sr(a,t.props),ref:n?J(n,t.ref):t.ref}):c.Children.count(t)>1?c.Children.only(null):null});L.displayName="SlotClone";const ur=({children:e})=>c.createElement(c.Fragment,null,e);function cr(e){return c.isValidElement(e)&&e.type===ur}function sr(e,n){const t={...n};for(const a in n){const u=e[a],r=n[a];/^on[A-Z]/.test(a)?u&&r?t[a]=(...i)=>{r(...i),u(...i)}:u&&(t[a]=u):a==="style"?t[a]={...u,...r}:a==="className"&&(t[a]=[u,r].filter(Boolean).join(" "))}return{...e,...t}}const lr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],te=lr.reduce((e,n)=>{const t=c.forwardRef((a,u)=>{const{asChild:r,...o}=a,i=r?re:n;return c.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),c.createElement(i,E({},o,{ref:u}))});return t.displayName=`Primitive.${n}`,{...e,[n]:t}},{}),ne="Checkbox",[pr,Cr]=Qe(ne),[dr,fr]=pr(ne),hr=c.forwardRef((e,n)=>{const{__scopeCheckbox:t,name:a,checked:u,defaultChecked:r,required:o,disabled:i,value:s="on",onCheckedChange:l,...h}=e,[p,f]=c.useState(null),v=Y(n,m=>f(m)),b=c.useRef(!1),O=p?!!p.closest("form"):!0,[g=!1,P]=rr({prop:u,defaultProp:r,onChange:l}),ue=c.useRef(g);return c.useEffect(()=>{const m=p==null?void 0:p.form;if(m){const y=()=>P(ue.current);return m.addEventListener("reset",y),()=>m.removeEventListener("reset",y)}},[p,P]),c.createElement(dr,{scope:t,state:g,disabled:i},c.createElement(te.button,S({type:"button",role:"checkbox","aria-checked":x(g)?"mixed":g,"aria-required":o,"data-state":oe(g),"data-disabled":i?"":void 0,disabled:i,value:s},h,{ref:v,onKeyDown:V(e.onKeyDown,m=>{m.key==="Enter"&&m.preventDefault()}),onClick:V(e.onClick,m=>{P(y=>x(y)?!0:!y),O&&(b.current=m.isPropagationStopped(),b.current||m.stopPropagation())})})),O&&c.createElement(br,{control:p,bubbles:!b.current,name:a,value:s,checked:g,required:o,disabled:i,style:{transform:"translateX(-100%)"}}))}),mr="CheckboxIndicator",vr=c.forwardRef((e,n)=>{const{__scopeCheckbox:t,forceMount:a,...u}=e,r=fr(mr,t);return c.createElement(ee,{present:a||x(r.state)||r.state===!0},c.createElement(te.span,S({"data-state":oe(r.state),"data-disabled":r.disabled?"":void 0},u,{ref:n,style:{pointerEvents:"none",...e.style}})))}),br=e=>{const{control:n,checked:t,bubbles:a=!0,...u}=e,r=c.useRef(null),o=nr(t),i=or(n);return c.useEffect(()=>{const s=r.current,l=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==t&&p){const f=new Event("click",{bubbles:a});s.indeterminate=x(t),p.call(s,x(t)?!1:t),s.dispatchEvent(f)}},[o,t,a]),c.createElement("input",S({type:"checkbox","aria-hidden":!0,defaultChecked:x(t)?!1:t},u,{tabIndex:-1,ref:r,style:{...e.style,...i,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function x(e){return e==="indeterminate"}function oe(e){return x(e)?"indeterminate":e?"checked":"unchecked"}const gr=hr,_r=vr;function $r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ae={exports:{}};/*!
|
|
21
|
+
*/(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",o=0;o<arguments.length;o++){var u=arguments[o];u&&(r=i(r,a(u)))}return r}function a(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 o="";for(var u in r)n.call(r,u)&&r[u]&&(o=i(o,u));return o}function i(r,o){return o?r?r+" "+o:r+o:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(G);var Ge=G.exports;const Ke=Ze(Ge),S={"purpur-paragraph":"_purpur-paragraph_1rh57_1","purpur-paragraph--disabled":"_purpur-paragraph--disabled_1rh57_7","purpur-paragraph--hyphens":"_purpur-paragraph--hyphens_1rh57_10","purpur-paragraph--negative":"_purpur-paragraph--negative_1rh57_13","purpur-paragraph--paragraph-100":"_purpur-paragraph--paragraph-100_1rh57_16","purpur-paragraph--paragraph-100-medium":"_purpur-paragraph--paragraph-100-medium_1rh57_22","purpur-paragraph--paragraph-100-bold":"_purpur-paragraph--paragraph-100-bold_1rh57_29","purpur-paragraph--paragraph-200":"_purpur-paragraph--paragraph-200_1rh57_36","purpur-paragraph--preamble-100":"_purpur-paragraph--preamble-100_1rh57_42","purpur-paragraph--preamble-200":"_purpur-paragraph--preamble-200_1rh57_48","purpur-paragraph--additional-100":"_purpur-paragraph--additional-100_1rh57_54","purpur-paragraph--additional-100-medium":"_purpur-paragraph--additional-100-medium_1rh57_60","purpur-paragraph--overline-100":"_purpur-paragraph--overline-100_1rh57_67","purpur-paragraph--overline-200":"_purpur-paragraph--overline-200_1rh57_75"},Xe={PARAGRAPH100:"paragraph-100",PARAGRAPH100MEDIUM:"paragraph-100-medium",PARAGRAPH100BOLD:"paragraph-100-bold",PARAGRAPH200:"paragraph-200",PREAMBLE100:"preamble-100",PREAMBLE200:"preamble-200",ADDITIONAL100:"additional-100",ADDITIONAL100MEDIUM:"additional-100-medium",OVERLINE100:"overline-100",OVERLINE200:"overline-200"},N="purpur-paragraph",K=({["data-testid"]:e,children:n,className:t,disabled:a,enableHyphenation:i=!1,negative:r=!1,variant:o=Xe.PARAGRAPH100,...u})=>{const s=Ke([t,S[N],S[`${N}--${o}`],{[S[`${N}--hyphens`]]:i,[S[`${N}--disabled`]]:a,[S[`${N}--negative`]]:r}]);return d.jsx("p",{...u,className:s,"data-testid":e,children:n})};K.displayName="Paragraph";function g(){return g=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var a in t)({}).hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},g.apply(null,arguments)}function We(e,n){typeof e=="function"?e(n):e!=null&&(e.current=n)}function X(...e){return n=>e.forEach(t=>We(t,n))}function W(...e){return c.useCallback(X(...e),e)}function Je(e,n=[]){let t=[];function a(r,o){const u=c.createContext(o),s=t.length;t=[...t,o];function l(p){const{scope:f,children:v,...b}=p,E=(f==null?void 0:f[e][s])||u,_=c.useMemo(()=>b,Object.values(b));return c.createElement(E.Provider,{value:_},v)}function h(p,f){const v=(f==null?void 0:f[e][s])||u,b=c.useContext(v);if(b)return b;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${r}\``)}return l.displayName=r+"Provider",[l,h]}const i=()=>{const r=t.map(o=>c.createContext(o));return function(u){const s=(u==null?void 0:u[e])||r;return c.useMemo(()=>({[`__scope${e}`]:{...u,[e]:s}}),[u,s])}};return i.scopeName=e,[a,Ye(i,...n)]}function Ye(...e){const n=e[0];if(e.length===1)return n;const t=()=>{const a=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(r){const o=a.reduce((u,{useScope:s,scopeName:l})=>{const p=s(r)[`__scope${l}`];return{...u,...p}},{});return c.useMemo(()=>({[`__scope${n.scopeName}`]:o}),[o])}};return t.scopeName=n.scopeName,t}function T(e,n,{checkForDefaultPrevented:t=!0}={}){return function(i){if(e==null||e(i),t===!1||!i.defaultPrevented)return n==null?void 0:n(i)}}function J(e){const n=c.useRef(e);return c.useEffect(()=>{n.current=e}),c.useMemo(()=>(...t)=>{var a;return(a=n.current)===null||a===void 0?void 0:a.call(n,...t)},[])}function Qe({prop:e,defaultProp:n,onChange:t=()=>{}}){const[a,i]=er({defaultProp:n,onChange:t}),r=e!==void 0,o=r?e:a,u=J(t),s=c.useCallback(l=>{if(r){const p=typeof l=="function"?l(e):l;p!==e&&u(p)}else i(l)},[r,e,i,u]);return[o,s]}function er({defaultProp:e,onChange:n}){const t=c.useState(e),[a]=t,i=c.useRef(a),r=J(n);return c.useEffect(()=>{i.current!==a&&(r(a),i.current=a)},[a,i,r]),t}function rr(e){const n=c.useRef({value:e,previous:e});return c.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}const R=globalThis!=null&&globalThis.document?c.useLayoutEffect:()=>{};function tr(e){const[n,t]=c.useState(void 0);return R(()=>{if(e){t({width:e.offsetWidth,height:e.offsetHeight});const a=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const r=i[0];let o,u;if("borderBoxSize"in r){const s=r.borderBoxSize,l=Array.isArray(s)?s[0]:s;o=l.inlineSize,u=l.blockSize}else o=e.offsetWidth,u=e.offsetHeight;t({width:o,height:u})});return a.observe(e,{box:"border-box"}),()=>a.unobserve(e)}else t(void 0)},[e]),n}function nr(e,n){return c.useReducer((t,a)=>{const i=n[t][a];return i??t},e)}const Y=e=>{const{present:n,children:t}=e,a=or(n),i=typeof t=="function"?t({present:a.isPresent}):c.Children.only(t),r=W(a.ref,i.ref);return typeof t=="function"||a.isPresent?c.cloneElement(i,{ref:r}):null};Y.displayName="Presence";function or(e){const[n,t]=c.useState(),a=c.useRef({}),i=c.useRef(e),r=c.useRef("none"),o=e?"mounted":"unmounted",[u,s]=nr(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const l=A(a.current);r.current=u==="mounted"?l:"none"},[u]),R(()=>{const l=a.current,h=i.current;if(h!==e){const f=r.current,v=A(l);e?s("MOUNT"):v==="none"||(l==null?void 0:l.display)==="none"?s("UNMOUNT"):s(h&&f!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,s]),R(()=>{if(n){const l=p=>{const v=A(a.current).includes(p.animationName);p.target===n&&v&&ue.flushSync(()=>s("ANIMATION_END"))},h=p=>{p.target===n&&(r.current=A(a.current))};return n.addEventListener("animationstart",h),n.addEventListener("animationcancel",l),n.addEventListener("animationend",l),()=>{n.removeEventListener("animationstart",h),n.removeEventListener("animationcancel",l),n.removeEventListener("animationend",l)}}else s("ANIMATION_END")},[n,s]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:c.useCallback(l=>{l&&(a.current=getComputedStyle(l)),t(l)},[])}}function A(e){return(e==null?void 0:e.animationName)||"none"}const Q=c.forwardRef((e,n)=>{const{children:t,...a}=e,i=c.Children.toArray(t),r=i.find(ur);if(r){const o=r.props.children,u=i.map(s=>s===r?c.Children.count(o)>1?c.Children.only(null):c.isValidElement(o)?o.props.children:null:s);return c.createElement(q,g({},a,{ref:n}),c.isValidElement(o)?c.cloneElement(o,void 0,u):null)}return c.createElement(q,g({},a,{ref:n}),t)});Q.displayName="Slot";const q=c.forwardRef((e,n)=>{const{children:t,...a}=e;return c.isValidElement(t)?c.cloneElement(t,{...ir(a,t.props),ref:n?X(n,t.ref):t.ref}):c.Children.count(t)>1?c.Children.only(null):null});q.displayName="SlotClone";const ar=({children:e})=>c.createElement(c.Fragment,null,e);function ur(e){return c.isValidElement(e)&&e.type===ar}function ir(e,n){const t={...n};for(const a in n){const i=e[a],r=n[a];/^on[A-Z]/.test(a)?i&&r?t[a]=(...u)=>{r(...u),i(...u)}:i&&(t[a]=i):a==="style"?t[a]={...i,...r}:a==="className"&&(t[a]=[i,r].filter(Boolean).join(" "))}return{...e,...t}}const cr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ee=cr.reduce((e,n)=>{const t=c.forwardRef((a,i)=>{const{asChild:r,...o}=a,u=r?Q:n;return c.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),c.createElement(u,g({},o,{ref:i}))});return t.displayName=`Primitive.${n}`,{...e,[n]:t}},{}),re="Checkbox",[sr,yr]=Je(re),[lr,pr]=sr(re),dr=c.forwardRef((e,n)=>{const{__scopeCheckbox:t,name:a,checked:i,defaultChecked:r,required:o,disabled:u,value:s="on",onCheckedChange:l,...h}=e,[p,f]=c.useState(null),v=W(n,m=>f(m)),b=c.useRef(!1),E=p?!!p.closest("form"):!0,[_=!1,k]=Qe({prop:i,defaultProp:r,onChange:l}),ae=c.useRef(_);return c.useEffect(()=>{const m=p==null?void 0:p.form;if(m){const C=()=>k(ae.current);return m.addEventListener("reset",C),()=>m.removeEventListener("reset",C)}},[p,k]),c.createElement(lr,{scope:t,state:_,disabled:u},c.createElement(ee.button,g({type:"button",role:"checkbox","aria-checked":y(_)?"mixed":_,"aria-required":o,"data-state":te(_),"data-disabled":u?"":void 0,disabled:u,value:s},h,{ref:v,onKeyDown:T(e.onKeyDown,m=>{m.key==="Enter"&&m.preventDefault()}),onClick:T(e.onClick,m=>{k(C=>y(C)?!0:!C),E&&(b.current=m.isPropagationStopped(),b.current||m.stopPropagation())})})),E&&c.createElement(mr,{control:p,bubbles:!b.current,name:a,value:s,checked:_,required:o,disabled:u,style:{transform:"translateX(-100%)"}}))}),fr="CheckboxIndicator",hr=c.forwardRef((e,n)=>{const{__scopeCheckbox:t,forceMount:a,...i}=e,r=pr(fr,t);return c.createElement(Y,{present:a||y(r.state)||r.state===!0},c.createElement(ee.span,g({"data-state":te(r.state),"data-disabled":r.disabled?"":void 0},i,{ref:n,style:{pointerEvents:"none",...e.style}})))}),mr=e=>{const{control:n,checked:t,bubbles:a=!0,...i}=e,r=c.useRef(null),o=rr(t),u=tr(n);return c.useEffect(()=>{const s=r.current,l=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==t&&p){const f=new Event("click",{bubbles:a});s.indeterminate=y(t),p.call(s,y(t)?!1:t),s.dispatchEvent(f)}},[o,t,a]),c.createElement("input",g({type:"checkbox","aria-hidden":!0,defaultChecked:y(t)?!1:t},i,{tabIndex:-1,ref:r,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function y(e){return e==="indeterminate"}function te(e){return y(e)?"indeterminate":e?"checked":"unchecked"}const vr=dr,br=hr;function _r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ne={exports:{}};/*!
|
|
22
22
|
Copyright (c) 2018 Jed Watson.
|
|
23
23
|
Licensed under the MIT License (MIT), see
|
|
24
24
|
http://jedwatson.github.io/classnames
|
|
25
|
-
*/(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",o=0;o<arguments.length;o++){var
|
|
25
|
+
*/(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",o=0;o<arguments.length;o++){var u=arguments[o];u&&(r=i(r,a(u)))}return r}function a(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 o="";for(var u in r)n.call(r,u)&&r[u]&&(o=i(o,u));return o}function i(r,o){return o?r?r+" "+o:r+o:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(ne);var gr=ne.exports;const j=_r(gr),$={"purpur-checkbox":"_purpur-checkbox_10fl8_1","purpur-checkbox__box":"_purpur-checkbox__box_10fl8_7","purpur-checkbox--error":"_purpur-checkbox--error_10fl8_16","purpur-checkbox__indicator":"_purpur-checkbox__indicator_10fl8_59","purpur-checkbox__label":"_purpur-checkbox__label_10fl8_70","purpur-checkbox__wrapper":"_purpur-checkbox__wrapper_10fl8_73","purpur-checkbox__container":"_purpur-checkbox__container_10fl8_79"},$r=["indeterminate",!0,!1],x="purpur-checkbox",xr=({["data-testid"]:e,checked:n,className:t,errorText:a,label:i,onChange:r,...o},u)=>{const s=a&&!n;return d.jsxs("div",{className:j([t,$[`${x}__wrapper`]]),children:[d.jsxs("div",{className:j([t,$[`${x}__container`]]),children:[d.jsx(vr,{...o,checked:n,className:j($[x],{[$[`${x}--error`]]:s}),"data-testid":e,onCheckedChange:r,ref:u,children:d.jsx("span",{className:$[`${x}__box`],children:d.jsx(br,{className:$[`${x}__indicator`],children:n==="indeterminate"?d.jsx(z,{"data-testid":e&&`${e}-checked-icon`,size:"xs",svg:Ee}):d.jsx(z,{"data-testid":e&&`${e}-indeterminate-icon`,size:"xs",svg:Ne})})})}),i&&d.jsx(Fe,{htmlFor:o.id,"data-testid":e&&`${e}-label`,disabled:o.disabled,className:$[`${x}__label`],children:d.jsx(K,{variant:"paragraph-100",disabled:o.disabled,children:`${o.required?"* ":""}${i}`})})]}),s&&d.jsx(xe,{"data-testid":e&&`${e}-error-text`,children:a})]})},oe=c.forwardRef(xr);oe.displayName="Checkbox";exports.Checkbox=oe;exports.checkedState=$r;
|
|
26
26
|
//# sourceMappingURL=checkbox.cjs.js.map
|