@purpurds/toggle 6.0.1 → 6.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/LICENSE.txt CHANGED
@@ -1,62 +1,26 @@
1
1
  Name: @purpurds/icon
2
- Version: 6.0.0
2
+ Version: 6.0.1
3
3
  License: AGPL-3.0-only
4
4
  Private: false
5
5
 
6
6
  ---
7
7
 
8
8
  Name: @purpurds/label
9
- Version: 6.0.0
9
+ Version: 6.0.1
10
10
  License: AGPL-3.0-only
11
11
  Private: false
12
12
 
13
13
  ---
14
14
 
15
15
  Name: @purpurds/paragraph
16
- Version: 6.0.0
16
+ Version: 6.0.1
17
17
  License: AGPL-3.0-only
18
18
  Private: false
19
19
 
20
20
  ---
21
21
 
22
- Name: @babel/runtime
23
- Version: 7.26.0
24
- License: MIT
25
- Private: false
26
- Description: babel's modular runtime helpers
27
- Repository: https://github.com/babel/babel.git
28
- Homepage: https://babel.dev/docs/en/next/babel-runtime
29
- Author: The Babel Team (https://babel.dev/team)
30
- License Copyright:
31
- ===
32
-
33
- MIT License
34
-
35
- Copyright (c) 2014-present Sebastian McKenzie and other contributors
36
-
37
- Permission is hereby granted, free of charge, to any person obtaining
38
- a copy of this software and associated documentation files (the
39
- "Software"), to deal in the Software without restriction, including
40
- without limitation the rights to use, copy, modify, merge, publish,
41
- distribute, sublicense, and/or sell copies of the Software, and to
42
- permit persons to whom the Software is furnished to do so, subject to
43
- the following conditions:
44
-
45
- The above copyright notice and this permission notice shall be
46
- included in all copies or substantial portions of the Software.
47
-
48
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
49
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
50
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
51
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
52
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
53
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
54
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
55
-
56
- ---
57
-
58
22
  Name: @radix-ui/primitive
59
- Version: 1.0.1
23
+ Version: 1.1.1
60
24
  License: MIT
61
25
  Private: false
62
26
  Repository: git+https://github.com/radix-ui/primitives.git
@@ -65,7 +29,7 @@ Homepage: https://radix-ui.com/primitives
65
29
  ---
66
30
 
67
31
  Name: @radix-ui/react-compose-refs
68
- Version: 1.0.1
32
+ Version: 1.1.1
69
33
  License: MIT
70
34
  Private: false
71
35
  Repository: git+https://github.com/radix-ui/primitives.git
@@ -74,7 +38,7 @@ Homepage: https://radix-ui.com/primitives
74
38
  ---
75
39
 
76
40
  Name: @radix-ui/react-context
77
- Version: 1.0.1
41
+ Version: 1.1.1
78
42
  License: MIT
79
43
  Private: false
80
44
  Repository: git+https://github.com/radix-ui/primitives.git
@@ -83,7 +47,7 @@ Homepage: https://radix-ui.com/primitives
83
47
  ---
84
48
 
85
49
  Name: @radix-ui/react-use-callback-ref
86
- Version: 1.0.1
50
+ Version: 1.1.0
87
51
  License: MIT
88
52
  Private: false
89
53
  Repository: git+https://github.com/radix-ui/primitives.git
@@ -92,7 +56,7 @@ Homepage: https://radix-ui.com/primitives
92
56
  ---
93
57
 
94
58
  Name: @radix-ui/react-use-controllable-state
95
- Version: 1.0.1
59
+ Version: 1.1.0
96
60
  License: MIT
97
61
  Private: false
98
62
  Repository: git+https://github.com/radix-ui/primitives.git
@@ -101,7 +65,7 @@ Homepage: https://radix-ui.com/primitives
101
65
  ---
102
66
 
103
67
  Name: @radix-ui/react-use-previous
104
- Version: 1.0.1
68
+ Version: 1.1.0
105
69
  License: MIT
106
70
  Private: false
107
71
  Repository: git+https://github.com/radix-ui/primitives.git
@@ -110,7 +74,7 @@ Homepage: https://radix-ui.com/primitives
110
74
  ---
111
75
 
112
76
  Name: @radix-ui/react-use-layout-effect
113
- Version: 1.0.1
77
+ Version: 1.1.0
114
78
  License: MIT
115
79
  Private: false
116
80
  Repository: git+https://github.com/radix-ui/primitives.git
@@ -119,7 +83,7 @@ Homepage: https://radix-ui.com/primitives
119
83
  ---
120
84
 
121
85
  Name: @radix-ui/react-use-size
122
- Version: 1.0.1
86
+ Version: 1.1.0
123
87
  License: MIT
124
88
  Private: false
125
89
  Repository: git+https://github.com/radix-ui/primitives.git
@@ -128,7 +92,7 @@ Homepage: https://radix-ui.com/primitives
128
92
  ---
129
93
 
130
94
  Name: @radix-ui/react-slot
131
- Version: 1.0.2
95
+ Version: 1.1.2
132
96
  License: MIT
133
97
  Private: false
134
98
  Repository: git+https://github.com/radix-ui/primitives.git
@@ -137,7 +101,7 @@ Homepage: https://radix-ui.com/primitives
137
101
  ---
138
102
 
139
103
  Name: @radix-ui/react-primitive
140
- Version: 1.0.3
104
+ Version: 2.0.2
141
105
  License: MIT
142
106
  Private: false
143
107
  Repository: git+https://github.com/radix-ui/primitives.git
@@ -146,7 +110,7 @@ Homepage: https://radix-ui.com/primitives
146
110
  ---
147
111
 
148
112
  Name: @radix-ui/react-switch
149
- Version: 1.0.3
113
+ Version: 1.1.3
150
114
  License: MIT
151
115
  Private: false
152
116
  Repository: git+https://github.com/radix-ui/primitives.git
@@ -1,18 +1,18 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react/jsx-runtime"),u=require("react");require("react-dom");function ee(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var H={exports:{}};/*!
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),f=require("react");require("react-dom");function ae(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const s=ae(f);function ie(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var I={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 i=arguments[o];i&&(r=c(r,a.call(this,i)))}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 i in r)n.call(r,i)&&r[i]&&(o=c(o,this&&this[i]||i));return o}function c(r,o){return o?r?r+" "+o:r+o:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(H);var re=H.exports;const te=ee(re),ne={"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"},oe=te.bind(ne),M="purpur-icon",ae="md",ue=e=>e.filter(n=>Object.keys(n).length>=1).map(n=>`${n.name}="${n.value}"`).join(" "),ce=({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 ${ue(t)}>${a}${e}</svg>`},ie=e=>e.replace(/<(\/?)svg([^>]*)>/g,"").trim(),q=({["data-testid"]:e,svg:n,allyTitle:t,className:a,size:c=ae,...r})=>{const o=ce({content:ie(n.svg),title:t}),i=oe(a,M,`${M}--${c}`);return v.jsx("span",{"aria-label":t,className:i,"data-testid":e,dangerouslySetInnerHTML:{__html:o},...r})};q.displayName="Icon";const se={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"};function C(){return C=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},C.apply(null,arguments)}function le(e,n){typeof e=="function"?e(n):e!=null&&(e.current=n)}function de(...e){return n=>e.forEach(t=>le(t,n))}const I=u.forwardRef((e,n)=>{const{children:t,...a}=e,c=u.Children.toArray(t),r=c.find(fe);if(r){const o=r.props.children,i=c.map(s=>s===r?u.Children.count(o)>1?u.Children.only(null):u.isValidElement(o)?o.props.children:null:s);return u.createElement(O,C({},a,{ref:n}),u.isValidElement(o)?u.cloneElement(o,void 0,i):null)}return u.createElement(O,C({},a,{ref:n}),t)});I.displayName="Slot";const O=u.forwardRef((e,n)=>{const{children:t,...a}=e;return u.isValidElement(t)?u.cloneElement(t,{...he(a,t.props),ref:n?de(n,t.ref):t.ref}):u.Children.count(t)>1?u.Children.only(null):null});O.displayName="SlotClone";const pe=({children:e})=>u.createElement(u.Fragment,null,e);function fe(e){return u.isValidElement(e)&&e.type===pe}function he(e,n){const t={...n};for(const a in n){const c=e[a],r=n[a];/^on[A-Z]/.test(a)?c&&r?t[a]=(...o)=>{r(...o),c(...o)}:c&&(t[a]=c):a==="style"?t[a]={...c,...r}:a==="className"&&(t[a]=[c,r].filter(Boolean).join(" "))}return{...e,...t}}const ge=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],be=ge.reduce((e,n)=>{const t=u.forwardRef((a,c)=>{const{asChild:r,...o}=a,i=r?I:n;return u.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),u.createElement(i,C({},o,{ref:c}))});return t.displayName=`Primitive.${n}`,{...e,[n]:t}},{}),me=u.forwardRef((e,n)=>u.createElement(be.label,C({},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()}}))),_e=me;function ve(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var T={exports:{}};/*!
5
+ */(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",i=0;i<arguments.length;i++){var u=arguments[i];u&&(r=a(r,o.call(this,u)))}return r}function o(r){if(typeof r=="string"||typeof r=="number")return this&&this[r]||r;if(typeof r!="object")return"";if(Array.isArray(r))return t.apply(this,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var i="";for(var u in r)n.call(r,u)&&r[u]&&(i=a(i,this&&this[u]||u));return i}function a(r,i){return i?r?r+" "+i:r+i:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(I);var ue=I.exports;const se=ie(ue),ce={"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"},le=se.bind(ce),M="purpur-icon",pe="md",de=e=>e.filter(n=>Object.keys(n).length>=1).map(n=>`${n.name}="${n.value}"`).join(" "),fe=({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"}],o=n?`<title>${n}</title>`:"";return`<svg ${de(t)}>${o}${e}</svg>`},ge=e=>e.replace(/<(\/?)svg([^>]*)>/g,"").trim(),H=({["data-testid"]:e,svg:n,allyTitle:t,className:o,size:a=pe,...r})=>{const i=fe({content:ge(n.svg),title:t}),u=le(o,M,`${M}--${a}`);return l.jsx("span",{"aria-label":t,className:u,"data-testid":e,dangerouslySetInnerHTML:{__html:i},...r})};H.displayName="Icon";const he={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"};function z(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function me(...e){return n=>{let t=!1;const o=e.map(a=>{const r=z(a,n);return!t&&typeof r=="function"&&(t=!0),r});if(t)return()=>{for(let a=0;a<o.length;a++){const r=o[a];typeof r=="function"?r():z(e[a],null)}}}}var V=s.forwardRef((e,n)=>{const{children:t,...o}=e,a=s.Children.toArray(t),r=a.find(ve);if(r){const i=r.props.children,u=a.map(c=>c===r?s.Children.count(i)>1?s.Children.only(null):s.isValidElement(i)?i.props.children:null:c);return l.jsx(D,{...o,ref:n,children:s.isValidElement(i)?s.cloneElement(i,void 0,u):null})}return l.jsx(D,{...o,ref:n,children:t})});V.displayName="Slot";var D=s.forwardRef((e,n)=>{const{children:t,...o}=e;if(s.isValidElement(t)){const a=ye(t),r=be(o,t.props);return t.type!==s.Fragment&&(r.ref=n?me(n,a):a),s.cloneElement(t,r)}return s.Children.count(t)>1?s.Children.only(null):null});D.displayName="SlotClone";var _e=({children:e})=>l.jsx(l.Fragment,{children:e});function ve(e){return s.isValidElement(e)&&e.type===_e}function be(e,n){const t={...n};for(const o in n){const a=e[o],r=n[o];/^on[A-Z]/.test(o)?a&&r?t[o]=(...i)=>{r(...i),a(...i)}:a&&(t[o]=a):o==="style"?t[o]={...a,...r}:o==="className"&&(t[o]=[a,r].filter(Boolean).join(" "))}return{...e,...t}}function ye(e){var n,t;let o=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,a=o&&"isReactWarning"in o&&o.isReactWarning;return a?e.ref:(o=(t=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:t.get,a=o&&"isReactWarning"in o&&o.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var we=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],xe=we.reduce((e,n)=>{const t=s.forwardRef((o,a)=>{const{asChild:r,...i}=o,u=r?V:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(u,{...i,ref:a})});return t.displayName=`Primitive.${n}`,{...e,[n]:t}},{}),Se="Label",q=s.forwardRef((e,n)=>l.jsx(xe.label,{...e,ref:n,onMouseDown:t=>{var o;t.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));q.displayName=Se;var Re=q;function Pe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var F={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 i=arguments[o];i&&(r=c(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=c(o,i));return o}function c(r,o){return o?r?r+" "+o:r+o:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(T);var $e=T.exports;const we=ve($e),A={"purpur-label":"_purpur-label_12cfi_1","purpur-label--negative":"_purpur-label--negative_12cfi_9","purpur-label--disabled":"_purpur-label--disabled_12cfi_12"},D="purpur-label",xe=({children:e,className:n,htmlFor:t,"data-testid":a,disabled:c,negative:r=!1,...o})=>{const i=we([n,A[D],{[A[`${D}--disabled`]]:c,[A[`${D}--negative`]]:r}]);return v.jsx(_e,{className:i,"data-testid":a,htmlFor:t,...o,children:e})};function ye(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var V={exports:{}};/*!
9
+ */(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",i=0;i<arguments.length;i++){var u=arguments[i];u&&(r=a(r,o(u)))}return r}function o(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return t.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var i="";for(var u in r)n.call(r,u)&&r[u]&&(i=a(i,u));return i}function a(r,i){return i?r?r+" "+i:r+i:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(F);var je=F.exports;const Ce=Pe(je),$={"purpur-label":"_purpur-label_12cfi_1","purpur-label--negative":"_purpur-label--negative_12cfi_9","purpur-label--disabled":"_purpur-label--disabled_12cfi_12"},k="purpur-label",Ee=({children:e,className:n,htmlFor:t,"data-testid":o,disabled:a,negative:r=!1,...i})=>{const u=Ce([n,$[k],{[$[`${k}--disabled`]]:a,[$[`${k}--negative`]]:r}]);return l.jsx(Re,{className:u,"data-testid":o,htmlFor:t,...i,children:e})};function $e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var U={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 i=arguments[o];i&&(r=c(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=c(o,i));return o}function c(r,o){return o?r?r+" "+o:r+o:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(V);var Se=V.exports;const Ee=ye(Se),P={"purpur-paragraph":"_purpur-paragraph_1rh57_1","purpur-paragraph--disabled":"_purpur-paragraph--disabled_1rh57_7","purpur-paragraph--hyphens":"_purpur-paragraph--hyphens_1rh57_10","purpur-paragraph--negative":"_purpur-paragraph--negative_1rh57_13","purpur-paragraph--paragraph-100":"_purpur-paragraph--paragraph-100_1rh57_16","purpur-paragraph--paragraph-100-medium":"_purpur-paragraph--paragraph-100-medium_1rh57_22","purpur-paragraph--paragraph-100-bold":"_purpur-paragraph--paragraph-100-bold_1rh57_29","purpur-paragraph--paragraph-200":"_purpur-paragraph--paragraph-200_1rh57_36","purpur-paragraph--preamble-100":"_purpur-paragraph--preamble-100_1rh57_42","purpur-paragraph--preamble-200":"_purpur-paragraph--preamble-200_1rh57_48","purpur-paragraph--additional-100":"_purpur-paragraph--additional-100_1rh57_54","purpur-paragraph--additional-100-medium":"_purpur-paragraph--additional-100-medium_1rh57_60","purpur-paragraph--overline-100":"_purpur-paragraph--overline-100_1rh57_67","purpur-paragraph--overline-200":"_purpur-paragraph--overline-200_1rh57_75"},Ce={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"},k="purpur-paragraph",F=({["data-testid"]:e,children:n,className:t,disabled:a,enableHyphenation:c=!1,negative:r=!1,variant:o=Ce.PARAGRAPH100,...i})=>{const s=Ee([t,P[k],P[`${k}--${o}`],{[P[`${k}--hyphens`]]:c,[P[`${k}--disabled`]]:a,[P[`${k}--negative`]]:r}]);return v.jsx("p",{...i,className:s,"data-testid":e,children:n})};F.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)({}).hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},S.apply(null,arguments)}function Pe(e,n,{checkForDefaultPrevented:t=!0}={}){return function(c){if(e==null||e(c),t===!1||!c.defaultPrevented)return n==null?void 0:n(c)}}function ke(e,n){typeof e=="function"?e(n):e!=null&&(e.current=n)}function W(...e){return n=>e.forEach(t=>ke(t,n))}function Re(...e){return u.useCallback(W(...e),e)}function Ae(e,n=[]){let t=[];function a(r,o){const i=u.createContext(o),s=t.length;t=[...t,o];function l(d){const{scope:p,children:h,...f}=d,m=(p==null?void 0:p[e][s])||i,g=u.useMemo(()=>f,Object.values(f));return u.createElement(m.Provider,{value:g},h)}function b(d,p){const h=(p==null?void 0:p[e][s])||i,f=u.useContext(h);if(f)return f;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${r}\``)}return l.displayName=r+"Provider",[l,b]}const c=()=>{const r=t.map(o=>u.createContext(o));return function(i){const s=(i==null?void 0:i[e])||r;return u.useMemo(()=>({[`__scope${e}`]:{...i,[e]:s}}),[i,s])}};return c.scopeName=e,[a,De(c,...n)]}function De(...e){const n=e[0];if(e.length===1)return n;const t=()=>{const a=e.map(c=>({useScope:c(),scopeName:c.scopeName}));return function(r){const o=a.reduce((i,{useScope:s,scopeName:l})=>{const d=s(r)[`__scope${l}`];return{...i,...d}},{});return u.useMemo(()=>({[`__scope${n.scopeName}`]:o}),[o])}};return t.scopeName=n.scopeName,t}function U(e){const n=u.useRef(e);return u.useEffect(()=>{n.current=e}),u.useMemo(()=>(...t)=>{var a;return(a=n.current)===null||a===void 0?void 0:a.call(n,...t)},[])}function Ne({prop:e,defaultProp:n,onChange:t=()=>{}}){const[a,c]=Oe({defaultProp:n,onChange:t}),r=e!==void 0,o=r?e:a,i=U(t),s=u.useCallback(l=>{if(r){const d=typeof l=="function"?l(e):l;d!==e&&i(d)}else c(l)},[r,e,c,i]);return[o,s]}function Oe({defaultProp:e,onChange:n}){const t=u.useState(e),[a]=t,c=u.useRef(a),r=U(n);return u.useEffect(()=>{c.current!==a&&(r(a),c.current=a)},[a,c,r]),t}function je(e){const n=u.useRef({value:e,previous:e});return u.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}const Me=globalThis!=null&&globalThis.document?u.useLayoutEffect:()=>{};function ze(e){const[n,t]=u.useState(void 0);return Me(()=>{if(e){t({width:e.offsetWidth,height:e.offsetHeight});const a=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const r=c[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}const G=u.forwardRef((e,n)=>{const{children:t,...a}=e,c=u.Children.toArray(t),r=c.find(Le);if(r){const o=r.props.children,i=c.map(s=>s===r?u.Children.count(o)>1?u.Children.only(null):u.isValidElement(o)?o.props.children:null:s);return u.createElement(j,S({},a,{ref:n}),u.isValidElement(o)?u.cloneElement(o,void 0,i):null)}return u.createElement(j,S({},a,{ref:n}),t)});G.displayName="Slot";const j=u.forwardRef((e,n)=>{const{children:t,...a}=e;return u.isValidElement(t)?u.cloneElement(t,{...Xe(a,t.props),ref:n?W(n,t.ref):t.ref}):u.Children.count(t)>1?u.Children.only(null):null});j.displayName="SlotClone";const Be=({children:e})=>u.createElement(u.Fragment,null,e);function Le(e){return u.isValidElement(e)&&e.type===Be}function Xe(e,n){const t={...n};for(const a in n){const c=e[a],r=n[a];/^on[A-Z]/.test(a)?c&&r?t[a]=(...i)=>{r(...i),c(...i)}:c&&(t[a]=c):a==="style"?t[a]={...c,...r}:a==="className"&&(t[a]=[c,r].filter(Boolean).join(" "))}return{...e,...t}}const He=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Z=He.reduce((e,n)=>{const t=u.forwardRef((a,c)=>{const{asChild:r,...o}=a,i=r?G:n;return u.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),u.createElement(i,S({},o,{ref:c}))});return t.displayName=`Primitive.${n}`,{...e,[n]:t}},{}),J="Switch",[qe,tr]=Ae(J),[Ie,Te]=qe(J),Ve=u.forwardRef((e,n)=>{const{__scopeSwitch:t,name:a,checked:c,defaultChecked:r,required:o,disabled:i,value:s="on",onCheckedChange:l,...b}=e,[d,p]=u.useState(null),h=Re(n,$=>p($)),f=u.useRef(!1),m=d?!!d.closest("form"):!0,[g=!1,_]=Ne({prop:c,defaultProp:r,onChange:l});return u.createElement(Ie,{scope:t,checked:g,disabled:i},u.createElement(Z.button,S({type:"button",role:"switch","aria-checked":g,"aria-required":o,"data-state":K(g),"data-disabled":i?"":void 0,disabled:i,value:s},b,{ref:h,onClick:Pe(e.onClick,$=>{_(y=>!y),m&&(f.current=$.isPropagationStopped(),f.current||$.stopPropagation())})})),m&&u.createElement(Ue,{control:d,bubbles:!f.current,name:a,value:s,checked:g,required:o,disabled:i,style:{transform:"translateX(-100%)"}}))}),Fe="SwitchThumb",We=u.forwardRef((e,n)=>{const{__scopeSwitch:t,...a}=e,c=Te(Fe,t);return u.createElement(Z.span,S({"data-state":K(c.checked),"data-disabled":c.disabled?"":void 0},a,{ref:n}))}),Ue=e=>{const{control:n,checked:t,bubbles:a=!0,...c}=e,r=u.useRef(null),o=je(t),i=ze(n);return u.useEffect(()=>{const s=r.current,l=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==t&&d){const p=new Event("click",{bubbles:a});d.call(s,t),s.dispatchEvent(p)}},[o,t,a]),u.createElement("input",S({type:"checkbox","aria-hidden":!0,defaultChecked:t},c,{tabIndex:-1,ref:r,style:{...e.style,...i,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function K(e){return e?"checked":"unchecked"}const Ge=Ve,Ze=We;function Je(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Q={exports:{}};/*!
13
+ */(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",i=0;i<arguments.length;i++){var u=arguments[i];u&&(r=a(r,o(u)))}return r}function o(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return t.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var i="";for(var u in r)n.call(r,u)&&r[u]&&(i=a(i,u));return i}function a(r,i){return i?r?r+" "+i:r+i:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(U);var ke=U.exports;const Oe=$e(ke),j={"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"},De={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",G=({["data-testid"]:e,children:n,className:t,disabled:o,enableHyphenation:a=!1,negative:r=!1,variant:i=De.PARAGRAPH100,...u})=>{const c=Oe([t,j[C],j[`${C}--${i}`],{[j[`${C}--hyphens`]]:a,[j[`${C}--disabled`]]:o,[j[`${C}--negative`]]:r}]);return l.jsx("p",{...u,className:c,"data-testid":e,children:n})};G.displayName="Paragraph";function Ne(e,n,{checkForDefaultPrevented:t=!0}={}){return function(a){if(e==null||e(a),t===!1||!a.defaultPrevented)return n==null?void 0:n(a)}}function L(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function Z(...e){return n=>{let t=!1;const o=e.map(a=>{const r=L(a,n);return!t&&typeof r=="function"&&(t=!0),r});if(t)return()=>{for(let a=0;a<o.length;a++){const r=o[a];typeof r=="function"?r():L(e[a],null)}}}}function Ae(...e){return s.useCallback(Z(...e),e)}function Me(e,n=[]){let t=[];function o(r,i){const u=s.createContext(i),c=t.length;t=[...t,i];const p=g=>{var b;const{scope:d,children:m,...h}=g,_=((b=d==null?void 0:d[e])==null?void 0:b[c])||u,y=s.useMemo(()=>h,Object.values(h));return l.jsx(_.Provider,{value:y,children:m})};p.displayName=r+"Provider";function v(g,d){var _;const m=((_=d==null?void 0:d[e])==null?void 0:_[c])||u,h=s.useContext(m);if(h)return h;if(i!==void 0)return i;throw new Error(`\`${g}\` must be used within \`${r}\``)}return[p,v]}const a=()=>{const r=t.map(i=>s.createContext(i));return function(u){const c=(u==null?void 0:u[e])||r;return s.useMemo(()=>({[`__scope${e}`]:{...u,[e]:c}}),[u,c])}};return a.scopeName=e,[o,ze(a,...n)]}function ze(...e){const n=e[0];if(e.length===1)return n;const t=()=>{const o=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(r){const i=o.reduce((u,{useScope:c,scopeName:p})=>{const g=c(r)[`__scope${p}`];return{...u,...g}},{});return s.useMemo(()=>({[`__scope${n.scopeName}`]:i}),[i])}};return t.scopeName=n.scopeName,t}function J(e){const n=s.useRef(e);return s.useEffect(()=>{n.current=e}),s.useMemo(()=>(...t)=>{var o;return(o=n.current)==null?void 0:o.call(n,...t)},[])}function Le({prop:e,defaultProp:n,onChange:t=()=>{}}){const[o,a]=Be({defaultProp:n,onChange:t}),r=e!==void 0,i=r?e:o,u=J(t),c=s.useCallback(p=>{if(r){const g=typeof p=="function"?p(e):p;g!==e&&u(g)}else a(p)},[r,e,a,u]);return[i,c]}function Be({defaultProp:e,onChange:n}){const t=s.useState(e),[o]=t,a=s.useRef(o),r=J(n);return s.useEffect(()=>{a.current!==o&&(r(o),a.current=o)},[o,a,r]),t}function Xe(e){const n=s.useRef({value:e,previous:e});return s.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}var We=globalThis!=null&&globalThis.document?s.useLayoutEffect:()=>{};function Te(e){const[n,t]=s.useState(void 0);return We(()=>{if(e){t({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const r=a[0];let i,u;if("borderBoxSize"in r){const c=r.borderBoxSize,p=Array.isArray(c)?c[0]:c;i=p.inlineSize,u=p.blockSize}else i=e.offsetWidth,u=e.offsetHeight;t({width:i,height:u})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else t(void 0)},[e]),n}var K=s.forwardRef((e,n)=>{const{children:t,...o}=e,a=s.Children.toArray(t),r=a.find(He);if(r){const i=r.props.children,u=a.map(c=>c===r?s.Children.count(i)>1?s.Children.only(null):s.isValidElement(i)?i.props.children:null:c);return l.jsx(N,{...o,ref:n,children:s.isValidElement(i)?s.cloneElement(i,void 0,u):null})}return l.jsx(N,{...o,ref:n,children:t})});K.displayName="Slot";var N=s.forwardRef((e,n)=>{const{children:t,...o}=e;if(s.isValidElement(t)){const a=qe(t),r=Ve(o,t.props);return t.type!==s.Fragment&&(r.ref=n?Z(n,a):a),s.cloneElement(t,r)}return s.Children.count(t)>1?s.Children.only(null):null});N.displayName="SlotClone";var Ie=({children:e})=>l.jsx(l.Fragment,{children:e});function He(e){return s.isValidElement(e)&&e.type===Ie}function Ve(e,n){const t={...n};for(const o in n){const a=e[o],r=n[o];/^on[A-Z]/.test(o)?a&&r?t[o]=(...u)=>{r(...u),a(...u)}:a&&(t[o]=a):o==="style"?t[o]={...a,...r}:o==="className"&&(t[o]=[a,r].filter(Boolean).join(" "))}return{...e,...t}}function qe(e){var o,a;let n=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,t=n&&"isReactWarning"in n&&n.isReactWarning;return t?e.ref:(n=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,t=n&&"isReactWarning"in n&&n.isReactWarning,t?e.props.ref:e.props.ref||e.ref)}var Fe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Q=Fe.reduce((e,n)=>{const t=s.forwardRef((o,a)=>{const{asChild:r,...i}=o,u=r?K:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(u,{...i,ref:a})});return t.displayName=`Primitive.${n}`,{...e,[n]:t}},{}),A="Switch",[Ue,ar]=Me(A),[Ge,Ze]=Ue(A),Y=s.forwardRef((e,n)=>{const{__scopeSwitch:t,name:o,checked:a,defaultChecked:r,required:i,disabled:u,value:c="on",onCheckedChange:p,form:v,...g}=e,[d,m]=s.useState(null),h=Ae(n,w=>m(w)),_=s.useRef(!1),y=d?v||!!d.closest("form"):!0,[b=!1,P]=Le({prop:a,defaultProp:r,onChange:p});return l.jsxs(Ge,{scope:t,checked:b,disabled:u,children:[l.jsx(Q.button,{type:"button",role:"switch","aria-checked":b,"aria-required":i,"data-state":te(b),"data-disabled":u?"":void 0,disabled:u,value:c,...g,ref:h,onClick:Ne(e.onClick,w=>{P(x=>!x),y&&(_.current=w.isPropagationStopped(),_.current||w.stopPropagation())})}),y&&l.jsx(Je,{control:d,bubbles:!_.current,name:o,value:c,checked:b,required:i,disabled:u,form:v,style:{transform:"translateX(-100%)"}})]})});Y.displayName=A;var ee="SwitchThumb",re=s.forwardRef((e,n)=>{const{__scopeSwitch:t,...o}=e,a=Ze(ee,t);return l.jsx(Q.span,{"data-state":te(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:n})});re.displayName=ee;var Je=e=>{const{control:n,checked:t,bubbles:o=!0,...a}=e,r=s.useRef(null),i=Xe(t),u=Te(n);return s.useEffect(()=>{const c=r.current,p=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(p,"checked").set;if(i!==t&&g){const d=new Event("click",{bubbles:o});g.call(c,t),c.dispatchEvent(d)}},[i,t,o]),l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...a,tabIndex:-1,ref:r,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function te(e){return e?"checked":"unchecked"}var Ke=Y,Qe=re;function Ye(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ne={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 i=arguments[o];i&&(r=c(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=c(o,i));return o}function c(r,o){return o?r?r+" "+o:r+o:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(Q);var Ke=Q.exports;const N=Je(Ke),z=e=>e&&"touches"in e,Qe=({children:e,disabled:n,onStart:t,onDrag:a,onStop:c,bounds:r,position:o,style:i})=>{const[s,l]=u.useState(void 0),[b,d]=u.useState(void 0),[p,h]=u.useState(!1),f=_=>{if(!n){_.preventDefault();const $=z(_.nativeEvent)?_.nativeEvent.touches[0].clientX:_.nativeEvent.clientX;d($),t==null||t()}},m=u.useCallback(_=>{if(typeof b!="number")return;const y=(z(_)?_.touches[0].clientX:_.clientX)-b;if(!y)return;const E=o+y;!p&&Math.abs(E)&&h(!0);const R=E>r.right?r.right:E<r.left?r.left:E;l(R),a==null||a({x:R})},[a,l,p,b]),g=u.useCallback(()=>{d(void 0),l(void 0),h(!1),c==null||c()},[c,d]);return u.useEffect(()=>(window.addEventListener("mousemove",m),window.addEventListener("touchmove",m),()=>{window.removeEventListener("mousemove",m),window.removeEventListener("touchmove",m)}),[m]),u.useEffect(()=>(window.addEventListener("mouseup",g),window.addEventListener("touchend",g),()=>{window.removeEventListener("mouseup",g),window.removeEventListener("touchend",g)}),[g]),u.isValidElement(e)?u.cloneElement(u.Children.only(e),{onMouseDown:f,onTouchStart:f,style:{...i,transform:`translateX(${p?s:o}px)`}}):null},B={width:void 0,height:void 0};function L(e){const{ref:n,box:t="content-box",round:a}=e,[{width:c,height:r},o]=u.useState(B),i=Ye(),s=u.useRef({...B}),l=u.useRef(void 0);return l.current=e.onResize,u.useEffect(()=>{if(!n.current||typeof window>"u"||!("ResizeObserver"in window))return;const b=new ResizeObserver(([d])=>{const p=t==="border-box"?"borderBoxSize":t==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",h=X(d,p,"inlineSize"),f=X(d,p,"blockSize");if(s.current.width!==h||s.current.height!==f){const g={width:h&&a?Math.round(h):h,height:f&&a?Math.round(f):f};s.current.width=h,s.current.height=f,l.current?l.current(g):i()&&o(g)}});return b.observe(n.current,{box:t}),()=>{b.disconnect()}},[t,n,i,a]),{width:c,height:r}}function X(e,n,t){return e[n]?Array.isArray(e[n])?e[n][0][t]:e[n][t]:n==="contentBoxSize"?e.contentRect[t==="inlineSize"?"width":"height"]:void 0}function Ye(){const e=u.useRef(!1);return u.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),u.useCallback(()=>e.current,[])}const er=({checked:e,onChange:n})=>{const t=u.useRef(null),a=u.useRef(null),[c,r]=u.useState(void 0),[o,i]=u.useState(!1),[s,l]=u.useState(0),{height:b=0}=L({ref:a,round:!0}),{height:d=0}=L({ref:t,round:!0}),p=(d||0)-b,h=b+p,f=p/2,m=h/2,g=typeof c=="number"&&(e?c<m:c>m);return{trackRef:t,thumbRef:a,isDragging:o,bounds:{left:f,right:h},position:e?h:f,onDrag:({x:E})=>{r(E),Math.abs((e?h:f)-E)>2&&i(!0)},onStop:()=>{i(!1),o&&l(Date.now()),g&&(n==null||n(!e))},onChangeWithDrag:()=>{Date.now()-s>50&&(n==null||n(!e)),r(void 0)}}},w={"purpur-toggle":"_purpur-toggle_1xng6_1","purpur-toggle__track":"_purpur-toggle__track_1xng6_7","purpur-toggle__checkmark-container":"_purpur-toggle__checkmark-container_1xng6_45","purpur-toggle__thumb":"_purpur-toggle__thumb_1xng6_60","purpur-toggle__thumb--dragging":"_purpur-toggle__thumb--dragging_1xng6_80","purpur-toggle__checkmark":"_purpur-toggle__checkmark_1xng6_45","purpur-toggle__label--right":"_purpur-toggle__label--right_1xng6_100","purpur-toggle__label--left":"_purpur-toggle__label--left_1xng6_103","purpur-toggle__container":"_purpur-toggle__container_1xng6_106"},x="purpur-toggle",rr=({["data-testid"]:e,className:n,label:t,onChange:a,labelPosition:c="right",checked:r,disableDrag:o,defaultChecked:i,...s},l)=>{const[b,d]=u.useState(typeof r=="boolean"?r:!!i),p=!!(typeof r=="boolean"?r:b),{thumbRef:h,trackRef:f,isDragging:m,onChangeWithDrag:g,..._}=er({checked:p,onChange:y=>{s.disabled||(a==null||a(y),d(y))}}),$=()=>v.jsx(xe,{htmlFor:s.id,"data-testid":e&&`${e}-label`,disabled:s.disabled,className:N(w[`${x}__label`],w[`${x}__label--${c}`]),children:v.jsx(F,{variant:"paragraph-100",disabled:s.disabled,children:t})});return v.jsxs("div",{className:N([n,w[`${x}__container`]]),children:[t&&c==="left"&&$(),v.jsx(Ge,{...s,ref:l,id:s.id,"data-testid":e,className:w[x],onCheckedChange:g,checked:p,children:v.jsxs("span",{ref:f,className:w[`${x}__track`],children:[v.jsx("span",{className:w[`${x}__checkmark-container`],children:v.jsx(q,{className:w[`${x}__checkmark`],svg:se,size:"xxs"})}),v.jsx(Qe,{disabled:o,..._,children:v.jsx(Ze,{ref:h,"data-testid":e&&`${e}-thumb`,className:N([w[`${x}__thumb`],{[w[`${x}__thumb--dragging`]]:m}])})})]})}),t&&c==="right"&&$()]})},Y=u.forwardRef(rr);Y.displayName="Toggle";exports.Toggle=Y;
17
+ */(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var r="",i=0;i<arguments.length;i++){var u=arguments[i];u&&(r=a(r,o(u)))}return r}function o(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return t.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var i="";for(var u in r)n.call(r,u)&&r[u]&&(i=a(i,u));return i}function a(r,i){return i?r?r+" "+i:r+i:r}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(ne);var er=ne.exports;const O=Ye(er),B=e=>e&&"touches"in e,rr=({children:e,disabled:n,onStart:t,onDrag:o,onStop:a,bounds:r,position:i,style:u})=>{const[c,p]=f.useState(void 0),[v,g]=f.useState(void 0),[d,m]=f.useState(!1),h=b=>{if(!n){b.preventDefault();const P=B(b.nativeEvent)?b.nativeEvent.touches[0].clientX:b.nativeEvent.clientX;g(P),t==null||t()}},_=f.useCallback(b=>{if(typeof v!="number")return;const w=(B(b)?b.touches[0].clientX:b.clientX)-v;if(!w)return;const x=i+w;!d&&Math.abs(x)&&m(!0);const E=x>r.right?r.right:x<r.left?r.left:x;p(E),o==null||o({x:E})},[o,p,d,v]),y=f.useCallback(()=>{g(void 0),p(void 0),m(!1),a==null||a()},[a,g]);return f.useEffect(()=>(window.addEventListener("mousemove",_),window.addEventListener("touchmove",_),()=>{window.removeEventListener("mousemove",_),window.removeEventListener("touchmove",_)}),[_]),f.useEffect(()=>(window.addEventListener("mouseup",y),window.addEventListener("touchend",y),()=>{window.removeEventListener("mouseup",y),window.removeEventListener("touchend",y)}),[y]),f.isValidElement(e)?f.cloneElement(f.Children.only(e),{onMouseDown:h,onTouchStart:h,style:{...u,transform:`translateX(${d?c:i}px)`}}):null},X={width:void 0,height:void 0};function W(e){const{ref:n,box:t="content-box",round:o}=e,[{width:a,height:r},i]=f.useState(X),u=tr(),c=f.useRef({...X}),p=f.useRef(void 0);return p.current=e.onResize,f.useEffect(()=>{if(!n.current||typeof window>"u"||!("ResizeObserver"in window))return;const v=new ResizeObserver(([g])=>{const d=t==="border-box"?"borderBoxSize":t==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",m=T(g,d,"inlineSize"),h=T(g,d,"blockSize");if(c.current.width!==m||c.current.height!==h){const y={width:m&&o?Math.round(m):m,height:h&&o?Math.round(h):h};c.current.width=m,c.current.height=h,p.current?p.current(y):u()&&i(y)}});return v.observe(n.current,{box:t}),()=>{v.disconnect()}},[t,n,u,o]),{width:a,height:r}}function T(e,n,t){return e[n]?Array.isArray(e[n])?e[n][0][t]:e[n][t]:n==="contentBoxSize"?e.contentRect[t==="inlineSize"?"width":"height"]:void 0}function tr(){const e=f.useRef(!1);return f.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),f.useCallback(()=>e.current,[])}const nr=({checked:e,onChange:n})=>{const t=f.useRef(null),o=f.useRef(null),[a,r]=f.useState(void 0),[i,u]=f.useState(!1),[c,p]=f.useState(0),{height:v=0}=W({ref:o,round:!0}),{height:g=0}=W({ref:t,round:!0}),d=(g||0)-v,m=v+d,h=d/2,_=m/2,y=typeof a=="number"&&(e?a<_:a>_);return{trackRef:t,thumbRef:o,isDragging:i,bounds:{left:h,right:m},position:e?m:h,onDrag:({x})=>{r(x),Math.abs((e?m:h)-x)>2&&u(!0)},onStop:()=>{u(!1),i&&p(Date.now()),y&&(n==null||n(!e))},onChangeWithDrag:()=>{Date.now()-c>50&&(n==null||n(!e)),r(void 0)}}},S={"purpur-toggle":"_purpur-toggle_1xng6_1","purpur-toggle__track":"_purpur-toggle__track_1xng6_7","purpur-toggle__checkmark-container":"_purpur-toggle__checkmark-container_1xng6_45","purpur-toggle__thumb":"_purpur-toggle__thumb_1xng6_60","purpur-toggle__thumb--dragging":"_purpur-toggle__thumb--dragging_1xng6_80","purpur-toggle__checkmark":"_purpur-toggle__checkmark_1xng6_45","purpur-toggle__label--right":"_purpur-toggle__label--right_1xng6_100","purpur-toggle__label--left":"_purpur-toggle__label--left_1xng6_103","purpur-toggle__container":"_purpur-toggle__container_1xng6_106"},R="purpur-toggle",or=({["data-testid"]:e,className:n,label:t,onChange:o,labelPosition:a="right",checked:r,disableDrag:i,defaultChecked:u,...c},p)=>{const[v,g]=f.useState(typeof r=="boolean"?r:!!u),d=!!(typeof r=="boolean"?r:v),{thumbRef:m,trackRef:h,isDragging:_,onChangeWithDrag:y,...b}=nr({checked:d,onChange:w=>{c.disabled||(o==null||o(w),g(w))}}),P=()=>l.jsx(Ee,{htmlFor:c.id,"data-testid":e&&`${e}-label`,disabled:c.disabled,className:O(S[`${R}__label`],S[`${R}__label--${a}`]),children:l.jsx(G,{variant:"paragraph-100",disabled:c.disabled,children:t})});return l.jsxs("div",{className:O([n,S[`${R}__container`]]),children:[t&&a==="left"&&P(),l.jsx(Ke,{...c,ref:p,id:c.id,"data-testid":e,className:S[R],onCheckedChange:y,checked:d,children:l.jsxs("span",{ref:h,className:S[`${R}__track`],children:[l.jsx("span",{className:S[`${R}__checkmark-container`],children:l.jsx(H,{className:S[`${R}__checkmark`],svg:he,size:"xxs"})}),l.jsx(rr,{disabled:i,...b,children:l.jsx(Qe,{ref:m,"data-testid":e&&`${e}-thumb`,className:O([S[`${R}__thumb`],{[S[`${R}__thumb--dragging`]]:_}])})})]})}),t&&a==="right"&&P()]})},oe=f.forwardRef(or);oe.displayName="Toggle";exports.Toggle=oe;
18
18
  //# sourceMappingURL=toggle.cjs.js.map