@spark-ui/checkbox 1.15.3 → 1.15.5

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/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.15.5](https://github.com/adevinta/spark/compare/@spark-ui/checkbox@1.15.4...@spark-ui/checkbox@1.15.5) (2023-06-19)
7
+
8
+ **Note:** Version bump only for package @spark-ui/checkbox
9
+
10
+ ## [1.15.4](https://github.com/adevinta/spark/compare/@spark-ui/checkbox@1.15.3...@spark-ui/checkbox@1.15.4) (2023-06-16)
11
+
12
+ **Note:** Version bump only for package @spark-ui/checkbox
13
+
6
14
  ## [1.15.3](https://github.com/adevinta/spark/compare/@spark-ui/checkbox@1.15.2...@spark-ui/checkbox@1.15.3) (2023-06-15)
7
15
 
8
16
  **Note:** Version bump only for package @spark-ui/checkbox
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),_e=require("@radix-ui/react-id"),V=require("class-variance-authority");require("react-dom");const vr=require("@spark-ui/use-merge-refs"),At=require("@radix-ui/react-checkbox"),yr=require("@spark-ui/icon"),gr=require("@spark-ui/internal-utils"),_r=require("@spark-ui/label");function pe(){return pe=Object.assign?Object.assign.bind():function(a){for(var s=1;s<arguments.length;s++){var o=arguments[s];for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(a[i]=o[i])}return a},pe.apply(this,arguments)}function kr(...a){return s=>a.forEach(o=>function(i,l){typeof i=="function"?i(l):i!=null&&(i.current=l)}(o,s))}const Xe=n.forwardRef((a,s)=>{const{children:o,...i}=a,l=n.Children.toArray(o),f=l.find(wr);if(f){const u=f.props.children,v=l.map(C=>C===f?n.Children.count(u)>1?n.Children.only(null):n.isValidElement(u)?u.props.children:null:C);return n.createElement(Ke,pe({},i,{ref:s}),n.isValidElement(u)?n.cloneElement(u,void 0,v):null)}return n.createElement(Ke,pe({},i,{ref:s}),o)});Xe.displayName="Slot";const Ke=n.forwardRef((a,s)=>{const{children:o,...i}=a;return n.isValidElement(o)?n.cloneElement(o,{...jr(i,o.props),ref:kr(s,o.ref)}):n.Children.count(o)>1?n.Children.only(null):null});Ke.displayName="SlotClone";const St=({children:a})=>n.createElement(n.Fragment,null,a);function wr(a){return n.isValidElement(a)&&a.type===St}function jr(a,s){const o={...s};for(const i in s){const l=a[i],f=s[i];/^on[A-Z]/.test(i)?l&&f?o[i]=(...u)=>{f(...u),l(...u)}:l&&(o[i]=l):i==="style"?o[i]={...l,...f}:i==="className"&&(o[i]=[l,f].filter(Boolean).join(" "))}return{...a,...o}}const Cr=n.forwardRef((a,s)=>n.createElement(Xe,{ref:s,...a})),xr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((a,s)=>{const o=n.forwardRef((i,l)=>{const{asChild:f,...u}=i,v=f?Xe:s;return n.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),n.createElement(v,pe({},u,{ref:l}))});return o.displayName=`Primitive.${s}`,{...a,[s]:o}},{}),Er=n.forwardRef((a,s)=>n.createElement(xr.label,pe({},a,{ref:s,onMouseDown:o=>{var i;(i=a.onMouseDown)===null||i===void 0||i.call(a,o),!o.defaultPrevented&&o.detail>1&&o.preventDefault()}}))),Ye=n.createContext(null),et=()=>{const a=n.useContext(Ye);if(!a)throw Error("useFormField must be used within a FormField provider");return a},Mt=({id:a,name:s,isInvalid:o,isRequired:i,children:l})=>{const f=_e.useId(),[u,v]=n.useState([]),C=u.length>0?u.join(" "):void 0,N=n.useCallback(I=>{v(R=>[...R,I])},[]),E=n.useCallback(I=>{v(R=>R.filter(z=>z!==I))},[]),L=n.useMemo(()=>({id:a,labelId:f,name:s,isInvalid:o,isRequired:i,description:C,onMessageIdAdd:N,onMessageIdRemove:E}),[a,f,s,C,o,i,N,E]);return n.createElement(Ye.Provider,{value:L},l)};Mt.displayName="FormFieldProvider";const Lt=n.forwardRef(({className:a,name:s,isInvalid:o=!1,isRequired:i=!1,asChild:l=!1,...f},u)=>{const v=_e.useId(),C=l?Cr:"div";return n.createElement(Mt,{id:v,name:s,isRequired:i,isInvalid:o},n.createElement(C,{ref:u,"data-spark-component":"form-control",className:V.cx(a,"flex flex-col gap-xl"),...f}))});Lt.displayName="FormField";const tt=n.forwardRef(({id:a,className:s,...o},i)=>{const{onMessageIdAdd:l,onMessageIdRemove:f}=et(),u=_e.useId(),v=a||u;return n.useEffect(()=>(l(v),()=>{f(v)}),[v,l,f]),n.createElement("span",{ref:i,id:v,className:V.cx(s,"text-caption"),...o})});tt.displayName="FormField.Message";const Pt=n.forwardRef(({className:a,...s},o)=>{const{isInvalid:i}=et();return i?n.createElement(tt,{ref:o,"data-spark-component":"form-error-message","aria-live":"polite",className:V.cx(a,"text-error"),...s}):null});Pt.displayName="FormField.ErrorMessage";const Tt=n.forwardRef(({className:a,...s},o)=>n.createElement(tt,{ref:o,"data-spark-component":"form-helper-message",className:V.cx(a,"text-neutral"),...s}));Tt.displayName="FormField.HelperMessage";const rt=n.forwardRef(({className:a,children:s="*",...o},i)=>n.createElement("span",{ref:i,"data-spark-component":"form-required-indicator",role:"presentation","aria-hidden":"true",className:V.cx(a,"text-error"),...o},s));rt.displayName="FormField.RequiredIndicator";const Vt=n.forwardRef(({htmlFor:a,className:s,children:o,requiredIndicator:i=n.createElement(rt,null),asChild:l,...f},u)=>{const v=et(),{labelId:C,isRequired:N}=v,E=l?void 0:a||v.id;return n.createElement(Er,{ref:u,id:C,"data-spark-component":"form-label",htmlFor:E,className:V.cx(s,"flex items-center gap-sm text-body-1"),asChild:l,...f},n.createElement(St,null,o),N&&i)});Vt.displayName="FormField.Label";const nt=()=>{const{id:a,name:s,description:o,labelId:i,isRequired:l,isInvalid:f}=n.useContext(Ye)||{};return{id:a,name:s,description:o,labelId:i,isRequired:l,isInvalid:f}},qt=({children:a})=>{const{id:s,name:o,isInvalid:i,labelId:l,isRequired:f,description:u}=nt();return n.createElement(n.Fragment,null,a({id:s,labelId:l,name:o,isRequired:f,isInvalid:i,description:u}))};qt.displayName="FormField.State",Object.assign(Lt,{Label:Vt,State:qt,ErrorMessage:Pt,HelperMessage:Tt,RequiredIndicator:rt});const $t=n.createContext({}),Bt=n.forwardRef(({title:a,fill:s="currentColor",stroke:o="none",...i},l)=>n.createElement("svg",{ref:l,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a&&{"data-title":a},fill:s,stroke:o,...i,dangerouslySetInnerHTML:{__html:(a===void 0?"":`<title>${a}</title>`)+'<path d="M8.91958 20.1667C8.73748 20.1667 8.56045 20.1323 8.38847 20.0635C8.21649 19.9947 8.05969 19.8915 7.91806 19.7539L2.42489 14.4176C2.14163 14.1425 2 13.8083 2 13.4152C2 13.0222 2.14163 12.688 2.42489 12.4129C2.70814 12.1377 3.04704 12.0001 3.44158 12.0001C3.83612 12.0001 4.18513 12.1377 4.48862 12.4129L8.91958 16.7173L19.5417 6.42797C19.825 6.1528 20.1639 6.0103 20.5584 6.00048C20.953 5.99065 21.2919 6.13315 21.5751 6.42797C21.8584 6.70313 22 7.03727 22 7.43036C22 7.82346 21.8584 8.15759 21.5751 8.43276L9.92109 19.7539C9.77946 19.8915 9.62266 19.9947 9.45068 20.0635C9.27871 20.1323 9.10167 20.1667 8.91958 20.1667Z"/>'}}));Bt.displayName="Check";const Dt=n.forwardRef(({title:a,fill:s="currentColor",stroke:o="none",...i},l)=>n.createElement("svg",{ref:l,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a&&{"data-title":a},fill:s,stroke:o,...i,dangerouslySetInnerHTML:{__html:(a===void 0?"":`<title>${a}</title>`)+'<path fill-rule="evenodd" clip-rule="evenodd" d="M2 11.9999C2 11.379 2.44772 10.8756 3 10.8756H21C21.5523 10.8756 22 11.379 22 11.9999C22 12.6208 21.5523 13.1242 21 13.1242H3C2.44772 13.1242 2 12.6208 2 11.9999Z"/>'}}));Dt.displayName="Minus";const Ht=n.forwardRef((a,s)=>n.createElement(At.CheckboxIndicator,{ref:s,className:"text-surface flex h-full w-full items-center justify-center",...a}));Ht.displayName="CheckboxIndicator";const Ir=V.cva(["h-sz-16 w-sz-16 border-md box-content items-center justify-center rounded-sm bg-transparent outline-none","spark-disabled:opacity-dim-3 spark-disabled:cursor-not-allowed spark-disabled:hover:ring-0","focus-visible:ring-outline-high focus-visible:ring-2","hover:border-primary-container hover:ring-2","u-shadow-border-transition"],{variants:{intent:gr.makeVariants({primary:["spark-state-unchecked:border-outline","spark-state-indeterminate:border-primary spark-state-indeterminate:bg-primary","spark-state-checked:border-primary spark-state-checked:bg-primary"],success:["spark-state-unchecked:border-success","spark-state-indeterminate:border-success spark-state-indeterminate:bg-success","spark-state-checked:border-success spark-state-checked:bg-success"],alert:["spark-state-unchecked:border-alert","spark-state-indeterminate:border-alert spark-state-indeterminate:bg-alert","spark-state-checked:border-alert spark-state-checked:bg-alert"],error:["spark-state-unchecked:border-error","spark-state-indeterminate:border-error spark-state-indeterminate:bg-error","spark-state-checked:border-error spark-state-checked:bg-error"],info:["spark-state-unchecked:border-info","spark-state-indeterminate:border-info spark-state-indeterminate:bg-info","spark-state-checked:border-info spark-state-checked:bg-info"],neutral:["spark-state-unchecked:border-neutral","spark-state-indeterminate:border-neutral spark-state-indeterminate:bg-neutral","spark-state-checked:border-neutral spark-state-checked:bg-neutral"]})},defaultVariants:{intent:"primary"}}),Ut=n.forwardRef(({className:a,icon:s=n.createElement(Bt,null),indeterminateIcon:o=n.createElement(Dt,null),intent:i,checked:l,...f},u)=>n.createElement(At.Checkbox,{ref:u,className:Ir({intent:i,className:a}),checked:l,...f},n.createElement(Ht,null,n.createElement(yr.Icon,{size:"sm"},l==="indeterminate"?o:s))));Ut.displayName="CheckboxInput";const Nr=V.cva("",{variants:{disabled:{true:["text-neutral/dim-2","cursor-not-allowed"],false:["cursor-pointer"]}},defaultVariants:{disabled:!1}}),Gt=({disabled:a,...s})=>n.createElement(_r.Label,{className:Nr({disabled:a}),...s});Gt.displayName="CheckboxLabel";const Zt=n.forwardRef(({className:a,intent:s,checked:o,value:i,disabled:l,onCheckedChange:f,children:u,...v},C)=>{const N=_e.useId(),E=_e.useId(),L=nt(),I=n.useContext($t),R=n.useRef(),z=vr.useMergeRefs(C,R),oe=i?I.value?.includes(i):o,{id:W,name:A,isInvalid:Y,isRequired:se,description:ce,intent:F}=(({fieldState:w,groupState:j,checkboxIntent:O})=>{const $=w.name??j.name,le=w.isRequired??j.isRequired,B=w.isInvalid??j.isInvalid,D=w.id!==j.id;return{name:$,isRequired:le,isInvalid:B,id:D?w.id:void 0,description:D?w.description:void 0,intent:B?"error":O??j.intent}})({fieldState:L,groupState:I,checkboxIntent:s});return n.createElement("div",{"data-spark-component":"checkbox",className:V.cx("gap-md text-body-1 flex items-center",a)},n.createElement(Ut,{ref:z,id:W||N,name:A,value:i,intent:F,checked:oe,disabled:l,required:se,"aria-describedby":ce,"aria-invalid":Y,onCheckedChange:w=>{f?.(w);const j=R.current?.value;j&&I.onCheckedChange&&I.onCheckedChange(w,j)},"aria-labelledby":u?E:L.labelId,...v}),u&&n.createElement(Gt,{disabled:l,htmlFor:W||N,id:E},u))});Zt.displayName="Checkbox";var Le=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rr(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Qe={exports:{}};(function(a,s){var o="__lodash_hash_undefined__",i=1,l=2,f=9007199254740991,u="[object Arguments]",v="[object Array]",C="[object AsyncFunction]",N="[object Boolean]",E="[object Date]",L="[object Error]",I="[object Function]",R="[object GeneratorFunction]",z="[object Map]",oe="[object Number]",W="[object Null]",A="[object Object]",Y="[object Promise]",se="[object Proxy]",ce="[object RegExp]",F="[object Set]",w="[object String]",j="[object Symbol]",O="[object Undefined]",$="[object WeakMap]",le="[object ArrayBuffer]",B="[object DataView]",D=/^\[object .+?Constructor\]$/,Pe=/^(?:0|[1-9]\d*)$/,p={};p["[object Float32Array]"]=p["[object Float64Array]"]=p["[object Int8Array]"]=p["[object Int16Array]"]=p["[object Int32Array]"]=p["[object Uint8Array]"]=p["[object Uint8ClampedArray]"]=p["[object Uint16Array]"]=p["[object Uint32Array]"]=!0,p[u]=p[v]=p[le]=p[N]=p[B]=p[E]=p[L]=p[I]=p[z]=p[oe]=p[A]=p[ce]=p[F]=p[w]=p[$]=!1;var ke=typeof Le=="object"&&Le&&Le.Object===Object&&Le,ee=typeof self=="object"&&self&&self.Object===Object&&self,S=ke||ee||Function("return this")(),at=s&&!s.nodeType&&s,it=at&&a&&!a.nodeType&&a,ot=it&&it.exports===at,Te=ot&&ke.process,st=function(){try{return Te&&Te.binding&&Te.binding("util")}catch{}}(),ct=st&&st.isTypedArray;function Wt(e,t){for(var r=-1,c=e==null?0:e.length;++r<c;)if(t(e[r],r,e))return!0;return!1}function Jt(e){var t=-1,r=Array(e.size);return e.forEach(function(c,b){r[++t]=[b,c]}),r}function Kt(e){var t=-1,r=Array(e.size);return e.forEach(function(c){r[++t]=c}),r}var lt,ut,dt,Qt=Array.prototype,Xt=Function.prototype,we=Object.prototype,Ve=S["__core-js_shared__"],ft=Xt.toString,P=we.hasOwnProperty,pt=(lt=/[^.]+$/.exec(Ve&&Ve.keys&&Ve.keys.IE_PROTO||""))?"Symbol(src)_1."+lt:"",ht=we.toString,Yt=RegExp("^"+ft.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),mt=ot?S.Buffer:void 0,je=S.Symbol,bt=S.Uint8Array,vt=we.propertyIsEnumerable,er=Qt.splice,te=je?je.toStringTag:void 0,yt=Object.getOwnPropertySymbols,tr=mt?mt.isBuffer:void 0,rr=(ut=Object.keys,dt=Object,function(e){return ut(dt(e))}),$e=ue(S,"DataView"),he=ue(S,"Map"),Be=ue(S,"Promise"),De=ue(S,"Set"),He=ue(S,"WeakMap"),me=ue(Object,"create"),nr=ae($e),ar=ae(he),ir=ae(Be),or=ae(De),sr=ae(He),gt=je?je.prototype:void 0,Ue=gt?gt.valueOf:void 0;function re(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var c=e[t];this.set(c[0],c[1])}}function H(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var c=e[t];this.set(c[0],c[1])}}function ne(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var c=e[t];this.set(c[0],c[1])}}function Ce(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new ne;++t<r;)this.add(e[t])}function J(e){var t=this.__data__=new H(e);this.size=t.size}function cr(e,t){var r=Ie(e),c=!r&&pr(e),b=!r&&!c&&Ge(e),d=!r&&!c&&!b&&Nt(e),y=r||c||b||d,g=y?function(k,T){for(var U=-1,x=Array(k);++U<k;)x[U]=T(U);return x}(e.length,String):[],M=g.length;for(var _ in e)!t&&!P.call(e,_)||y&&(_=="length"||b&&(_=="offset"||_=="parent")||d&&(_=="buffer"||_=="byteLength"||_=="byteOffset")||fr(_,M))||g.push(_);return g}function xe(e,t){for(var r=e.length;r--;)if(Ct(e[r][0],t))return r;return-1}function be(e){return e==null?e===void 0?O:W:te&&te in Object(e)?function(t){var r=P.call(t,te),c=t[te];try{t[te]=void 0;var b=!0}catch{}var d=ht.call(t);return b&&(r?t[te]=c:delete t[te]),d}(e):function(t){return ht.call(t)}(e)}function _t(e){return ve(e)&&be(e)==u}function kt(e,t,r,c,b){return e===t||(e==null||t==null||!ve(e)&&!ve(t)?e!=e&&t!=t:function(d,y,g,M,_,k){var T=Ie(d),U=Ie(y),x=T?v:K(d),G=U?v:K(y),de=(x=x==u?A:x)==A,Ne=(G=G==u?A:G)==A,fe=x==G;if(fe&&Ge(d)){if(!Ge(y))return!1;T=!0,de=!1}if(fe&&!de)return k||(k=new J),T||Nt(d)?wt(d,y,g,M,_,k):function(m,h,Re,Q,Ze,q,Z){switch(Re){case B:if(m.byteLength!=h.byteLength||m.byteOffset!=h.byteOffset)return!1;m=m.buffer,h=h.buffer;case le:return!(m.byteLength!=h.byteLength||!q(new bt(m),new bt(h)));case N:case E:case oe:return Ct(+m,+h);case L:return m.name==h.name&&m.message==h.message;case ce:case w:return m==h+"";case z:var X=Jt;case F:var ge=Q&i;if(X||(X=Kt),m.size!=h.size&&!ge)return!1;var Fe=Z.get(m);if(Fe)return Fe==h;Q|=l,Z.set(m,h);var We=wt(X(m),X(h),Q,Ze,q,Z);return Z.delete(m),We;case j:if(Ue)return Ue.call(m)==Ue.call(h)}return!1}(d,y,x,g,M,_,k);if(!(g&i)){var ye=de&&P.call(d,"__wrapped__"),Rt=Ne&&P.call(y,"__wrapped__");if(ye||Rt){var mr=ye?d.value():d,br=Rt?y.value():y;return k||(k=new J),_(mr,br,g,M,k)}}return fe?(k||(k=new J),function(m,h,Re,Q,Ze,q){var Z=Re&i,X=jt(m),ge=X.length,Fe=jt(h),We=Fe.length;if(ge!=We&&!Z)return!1;for(var Oe=ge;Oe--;){var ie=X[Oe];if(!(Z?ie in h:P.call(h,ie)))return!1}var Ft=q.get(m);if(Ft&&q.get(h))return Ft==h;var qe=!0;q.set(m,h),q.set(h,m);for(var Je=Z;++Oe<ge;){var ze=m[ie=X[Oe]],Ae=h[ie];if(Q)var Ot=Z?Q(Ae,ze,ie,h,m,q):Q(ze,Ae,ie,m,h,q);if(!(Ot===void 0?ze===Ae||Ze(ze,Ae,Re,Q,q):Ot)){qe=!1;break}Je||(Je=ie=="constructor")}if(qe&&!Je){var Se=m.constructor,Me=h.constructor;Se==Me||!("constructor"in m)||!("constructor"in h)||typeof Se=="function"&&Se instanceof Se&&typeof Me=="function"&&Me instanceof Me||(qe=!1)}return q.delete(m),q.delete(h),qe}(d,y,g,M,_,k)):!1}(e,t,r,c,kt,b))}function lr(e){return!(!It(e)||function(t){return!!pt&&pt in t}(e))&&(xt(e)?Yt:D).test(ae(e))}function ur(e){if(r=(t=e)&&t.constructor,c=typeof r=="function"&&r.prototype||we,t!==c)return rr(e);var t,r,c,b=[];for(var d in Object(e))P.call(e,d)&&d!="constructor"&&b.push(d);return b}function wt(e,t,r,c,b,d){var y=r&i,g=e.length,M=t.length;if(g!=M&&!(y&&M>g))return!1;var _=d.get(e);if(_&&d.get(t))return _==t;var k=-1,T=!0,U=r&l?new Ce:void 0;for(d.set(e,t),d.set(t,e);++k<g;){var x=e[k],G=t[k];if(c)var de=y?c(G,x,k,t,e,d):c(x,G,k,e,t,d);if(de!==void 0){if(de)continue;T=!1;break}if(U){if(!Wt(t,function(Ne,fe){if(ye=fe,!U.has(ye)&&(x===Ne||b(x,Ne,r,c,d)))return U.push(fe);var ye})){T=!1;break}}else if(x!==G&&!b(x,G,r,c,d)){T=!1;break}}return d.delete(e),d.delete(t),T}function jt(e){return function(t,r,c){var b=r(t);return Ie(t)?b:function(d,y){for(var g=-1,M=y.length,_=d.length;++g<M;)d[_+g]=y[g];return d}(b,c(t))}(e,hr,dr)}function Ee(e,t){var r,c,b=e.__data__;return((c=typeof(r=t))=="string"||c=="number"||c=="symbol"||c=="boolean"?r!=="__proto__":r===null)?b[typeof t=="string"?"string":"hash"]:b.map}function ue(e,t){var r=function(c,b){return c?.[b]}(e,t);return lr(r)?r:void 0}re.prototype.clear=function(){this.__data__=me?me(null):{},this.size=0},re.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},re.prototype.get=function(e){var t=this.__data__;if(me){var r=t[e];return r===o?void 0:r}return P.call(t,e)?t[e]:void 0},re.prototype.has=function(e){var t=this.__data__;return me?t[e]!==void 0:P.call(t,e)},re.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=me&&t===void 0?o:t,this},H.prototype.clear=function(){this.__data__=[],this.size=0},H.prototype.delete=function(e){var t=this.__data__,r=xe(t,e);return!(r<0)&&(r==t.length-1?t.pop():er.call(t,r,1),--this.size,!0)},H.prototype.get=function(e){var t=this.__data__,r=xe(t,e);return r<0?void 0:t[r][1]},H.prototype.has=function(e){return xe(this.__data__,e)>-1},H.prototype.set=function(e,t){var r=this.__data__,c=xe(r,e);return c<0?(++this.size,r.push([e,t])):r[c][1]=t,this},ne.prototype.clear=function(){this.size=0,this.__data__={hash:new re,map:new(he||H),string:new re}},ne.prototype.delete=function(e){var t=Ee(this,e).delete(e);return this.size-=t?1:0,t},ne.prototype.get=function(e){return Ee(this,e).get(e)},ne.prototype.has=function(e){return Ee(this,e).has(e)},ne.prototype.set=function(e,t){var r=Ee(this,e),c=r.size;return r.set(e,t),this.size+=r.size==c?0:1,this},Ce.prototype.add=Ce.prototype.push=function(e){return this.__data__.set(e,o),this},Ce.prototype.has=function(e){return this.__data__.has(e)},J.prototype.clear=function(){this.__data__=new H,this.size=0},J.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},J.prototype.get=function(e){return this.__data__.get(e)},J.prototype.has=function(e){return this.__data__.has(e)},J.prototype.set=function(e,t){var r=this.__data__;if(r instanceof H){var c=r.__data__;if(!he||c.length<199)return c.push([e,t]),this.size=++r.size,this;r=this.__data__=new ne(c)}return r.set(e,t),this.size=r.size,this};var dr=yt?function(e){return e==null?[]:(e=Object(e),function(t,r){for(var c=-1,b=t==null?0:t.length,d=0,y=[];++c<b;){var g=t[c];r(g,c,t)&&(y[d++]=g)}return y}(yt(e),function(t){return vt.call(e,t)}))}:function(){return[]},K=be;function fr(e,t){return!!(t=t??f)&&(typeof e=="number"||Pe.test(e))&&e>-1&&e%1==0&&e<t}function ae(e){if(e!=null){try{return ft.call(e)}catch{}try{return e+""}catch{}}return""}function Ct(e,t){return e===t||e!=e&&t!=t}($e&&K(new $e(new ArrayBuffer(1)))!=B||he&&K(new he)!=z||Be&&K(Be.resolve())!=Y||De&&K(new De)!=F||He&&K(new He)!=$)&&(K=function(e){var t=be(e),r=t==A?e.constructor:void 0,c=r?ae(r):"";if(c)switch(c){case nr:return B;case ar:return z;case ir:return Y;case or:return F;case sr:return $}return t});var pr=_t(function(){return arguments}())?_t:function(e){return ve(e)&&P.call(e,"callee")&&!vt.call(e,"callee")},Ie=Array.isArray,Ge=tr||function(){return!1};function xt(e){if(!It(e))return!1;var t=be(e);return t==I||t==R||t==C||t==se}function Et(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=f}function It(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function ve(e){return e!=null&&typeof e=="object"}var Nt=ct?function(e){return function(t){return e(t)}}(ct):function(e){return ve(e)&&Et(e.length)&&!!p[be(e)]};function hr(e){return(t=e)!=null&&Et(t.length)&&!xt(t)?cr(e):ur(e);var t}a.exports=function(e,t){return kt(e,t)}})(Qe,Qe.exports);const Fr=Rr(Qe.exports),Or=V.cva(["flex","gap-lg"],{variants:{orientation:{vertical:["flex-col"],horizontal:[]}}}),zt=n.forwardRef(({name:a,value:s,defaultValue:o,className:i,intent:l,orientation:f="vertical",onCheckedChange:u,children:v,...C},N)=>{const[E,L]=function(F,w,j){const O=F!==void 0,{current:$}=n.useRef(O?F:w),[le,B]=n.useState(w),D=O?F:le,Pe=n.useCallback((p,ke=(ee,S)=>!Fr(ee,S))=>{const ee=typeof p!="function"?p:p(D);ke(D,ee)&&!O&&B(ee),j&&j(ee)},[O,D]);return[D,Pe,O,$]}(s,o),I=nt(),R=n.useRef(u),{id:z,labelId:oe,description:W,isInvalid:A,isRequired:Y}=I,se=a??I.name,ce=n.useMemo(()=>({id:z,name:se,value:E,intent:l,isInvalid:A,description:W,isRequired:Y,onCheckedChange:(F,w)=>{const j=E||[],O=F?[...j,w]:j.filter($=>$!==w);L(O),R.current&&R.current(O)}}),[z,se,E,l,A,W,Y,L]);return n.useEffect(()=>{R.current=u},[u]),n.createElement($t.Provider,{value:ce},n.createElement("div",{ref:N,className:Or({className:i,orientation:f}),role:"group","aria-labelledby":oe,"aria-describedby":W,...C},v))});zt.displayName="CheckboxGroup",exports.Checkbox=Zt,exports.CheckboxGroup=zt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),ge=require("@radix-ui/react-id"),Z=require("class-variance-authority"),Xe=require("@spark-ui/label"),yr=require("@spark-ui/use-merge-refs"),At=require("@radix-ui/react-checkbox"),gr=require("@spark-ui/icon"),_r=require("@spark-ui/internal-utils");function Le(){return Le=Object.assign?Object.assign.bind():function(a){for(var s=1;s<arguments.length;s++){var c=arguments[s];for(var o in c)Object.prototype.hasOwnProperty.call(c,o)&&(a[o]=c[o])}return a},Le.apply(this,arguments)}function kr(...a){return s=>a.forEach(c=>function(o,l){typeof o=="function"?o(l):o!=null&&(o.current=l)}(c,s))}const St=n.forwardRef((a,s)=>{const{children:c,...o}=a,l=n.Children.toArray(c),f=l.find(wr);if(f){const d=f.props.children,v=l.map(C=>C===f?n.Children.count(d)>1?n.Children.only(null):n.isValidElement(d)?d.props.children:null:C);return n.createElement(Ke,Le({},o,{ref:s}),n.isValidElement(d)?n.cloneElement(d,void 0,v):null)}return n.createElement(Ke,Le({},o,{ref:s}),c)});St.displayName="Slot";const Ke=n.forwardRef((a,s)=>{const{children:c,...o}=a;return n.isValidElement(c)?n.cloneElement(c,{...jr(o,c.props),ref:kr(s,c.ref)}):n.Children.count(c)>1?n.Children.only(null):null});Ke.displayName="SlotClone";const Mt=({children:a})=>n.createElement(n.Fragment,null,a);function wr(a){return n.isValidElement(a)&&a.type===Mt}function jr(a,s){const c={...s};for(const o in s){const l=a[o],f=s[o];/^on[A-Z]/.test(o)?l&&f?c[o]=(...d)=>{f(...d),l(...d)}:l&&(c[o]=l):o==="style"?c[o]={...l,...f}:o==="className"&&(c[o]=[l,f].filter(Boolean).join(" "))}return{...a,...c}}const Cr=n.forwardRef((a,s)=>n.createElement(St,{ref:s,...a})),Ye=n.createContext(null),et=()=>{const a=n.useContext(Ye);if(!a)throw Error("useFormField must be used within a FormField provider");return a},Lt=({id:a,name:s,isInvalid:c,isRequired:o,children:l})=>{const f=ge.useId(),[d,v]=n.useState([]),C=d.length>0?d.join(" "):void 0,R=n.useCallback(E=>{v(N=>[...N,E])},[]),I=n.useCallback(E=>{v(N=>N.filter(z=>z!==E))},[]),L=n.useMemo(()=>({id:a,labelId:f,name:s,isInvalid:c,isRequired:o,description:C,onMessageIdAdd:R,onMessageIdRemove:I}),[a,f,s,C,c,o,R,I]);return n.createElement(Ye.Provider,{value:L},l)};Lt.displayName="FormFieldProvider";const Pt=n.forwardRef(({className:a,name:s,isInvalid:c=!1,isRequired:o=!1,asChild:l=!1,...f},d)=>{const v=ge.useId(),C=l?Cr:"div";return n.createElement(Lt,{id:v,name:s,isRequired:o,isInvalid:c},n.createElement(C,{ref:d,"data-spark-component":"form-field",className:Z.cx(a,"flex flex-col gap-xl"),...f}))});Pt.displayName="FormField";const tt=n.forwardRef(({id:a,className:s,...c},o)=>{const{onMessageIdAdd:l,onMessageIdRemove:f}=et(),d=ge.useId(),v=a||d;return n.useEffect(()=>(l(v),()=>{f(v)}),[v,l,f]),n.createElement("span",{ref:o,id:v,"data-spark-component":"form-field-message",className:Z.cx(s,"text-caption"),...c})});tt.displayName="FormField.Message";const Tt=n.forwardRef(({className:a,...s},c)=>{const{isInvalid:o}=et();return o?n.createElement(tt,{ref:c,"data-spark-component":"form-field-error-message","aria-live":"polite",className:Z.cx(a,"text-error"),...s}):null});Tt.displayName="FormField.ErrorMessage";const Vt=n.forwardRef(({className:a,...s},c)=>n.createElement(tt,{ref:c,"data-spark-component":"form-field-helper-message",className:Z.cx(a,"text-neutral"),...s}));Vt.displayName="FormField.HelperMessage";const rt=n.forwardRef((a,s)=>n.createElement(Xe.Label.RequiredIndicator,{ref:s,...a}));rt.displayName="FormField.RequiredIndicator";const $t=n.forwardRef(({htmlFor:a,className:s,children:c,requiredIndicator:o=n.createElement(rt,null),asChild:l,...f},d)=>{const v=et(),{labelId:C,isRequired:R}=v,I=l?void 0:a||v.id;return n.createElement(Xe.Label,{ref:d,id:C,"data-spark-component":"form-field-label",htmlFor:I,className:Z.cx(s,"flex items-center gap-sm"),asChild:l,...f},n.createElement(Mt,null,c),R&&o)});$t.displayName="FormField.Label";const nt=()=>{const{id:a,name:s,description:c,labelId:o,isRequired:l,isInvalid:f}=n.useContext(Ye)||{};return{id:a,name:s,description:c,labelId:o,isRequired:l,isInvalid:f}},qt=({children:a})=>{const{id:s,name:c,isInvalid:o,labelId:l,isRequired:f,description:d}=nt();return n.createElement(n.Fragment,null,a({id:s,labelId:l,name:c,isRequired:f,isInvalid:o,description:d}))};qt.displayName="FormField.State",Object.assign(Pt,{Label:$t,State:qt,ErrorMessage:Tt,HelperMessage:Vt,RequiredIndicator:rt});const Bt=n.createContext({}),Ht=n.forwardRef(({title:a,fill:s="currentColor",stroke:c="none",...o},l)=>n.createElement("svg",{ref:l,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a&&{"data-title":a},fill:s,stroke:c,...o,dangerouslySetInnerHTML:{__html:(a===void 0?"":`<title>${a}</title>`)+'<path d="M8.91958 20.1667C8.73748 20.1667 8.56045 20.1323 8.38847 20.0635C8.21649 19.9947 8.05969 19.8915 7.91806 19.7539L2.42489 14.4176C2.14163 14.1425 2 13.8083 2 13.4152C2 13.0222 2.14163 12.688 2.42489 12.4129C2.70814 12.1377 3.04704 12.0001 3.44158 12.0001C3.83612 12.0001 4.18513 12.1377 4.48862 12.4129L8.91958 16.7173L19.5417 6.42797C19.825 6.1528 20.1639 6.0103 20.5584 6.00048C20.953 5.99065 21.2919 6.13315 21.5751 6.42797C21.8584 6.70313 22 7.03727 22 7.43036C22 7.82346 21.8584 8.15759 21.5751 8.43276L9.92109 19.7539C9.77946 19.8915 9.62266 19.9947 9.45068 20.0635C9.27871 20.1323 9.10167 20.1667 8.91958 20.1667Z"/>'}}));Ht.displayName="Check";const Ut=n.forwardRef(({title:a,fill:s="currentColor",stroke:c="none",...o},l)=>n.createElement("svg",{ref:l,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...a&&{"data-title":a},fill:s,stroke:c,...o,dangerouslySetInnerHTML:{__html:(a===void 0?"":`<title>${a}</title>`)+'<path fill-rule="evenodd" clip-rule="evenodd" d="M2 11.9999C2 11.379 2.44772 10.8756 3 10.8756H21C21.5523 10.8756 22 11.379 22 11.9999C22 12.6208 21.5523 13.1242 21 13.1242H3C2.44772 13.1242 2 12.6208 2 11.9999Z"/>'}}));Ut.displayName="Minus";const Dt=n.forwardRef((a,s)=>n.createElement(At.CheckboxIndicator,{ref:s,className:"text-surface flex h-full w-full items-center justify-center",...a}));Dt.displayName="CheckboxIndicator";const xr=Z.cva(["h-sz-16 w-sz-16 border-md box-content items-center justify-center rounded-sm bg-transparent outline-none","spark-disabled:opacity-dim-3 spark-disabled:cursor-not-allowed spark-disabled:hover:ring-0","focus-visible:ring-outline-high focus-visible:ring-2","hover:border-primary-container hover:ring-2","u-shadow-border-transition"],{variants:{intent:_r.makeVariants({primary:["spark-state-unchecked:border-outline","spark-state-indeterminate:border-primary spark-state-indeterminate:bg-primary","spark-state-checked:border-primary spark-state-checked:bg-primary"],success:["spark-state-unchecked:border-success","spark-state-indeterminate:border-success spark-state-indeterminate:bg-success","spark-state-checked:border-success spark-state-checked:bg-success"],alert:["spark-state-unchecked:border-alert","spark-state-indeterminate:border-alert spark-state-indeterminate:bg-alert","spark-state-checked:border-alert spark-state-checked:bg-alert"],error:["spark-state-unchecked:border-error","spark-state-indeterminate:border-error spark-state-indeterminate:bg-error","spark-state-checked:border-error spark-state-checked:bg-error"],info:["spark-state-unchecked:border-info","spark-state-indeterminate:border-info spark-state-indeterminate:bg-info","spark-state-checked:border-info spark-state-checked:bg-info"],neutral:["spark-state-unchecked:border-neutral","spark-state-indeterminate:border-neutral spark-state-indeterminate:bg-neutral","spark-state-checked:border-neutral spark-state-checked:bg-neutral"]})},defaultVariants:{intent:"primary"}}),Gt=n.forwardRef(({className:a,icon:s=n.createElement(Ht,null),indeterminateIcon:c=n.createElement(Ut,null),intent:o,checked:l,...f},d)=>n.createElement(At.Checkbox,{ref:d,className:xr({intent:o,className:a}),checked:l,...f},n.createElement(Dt,null,n.createElement(gr.Icon,{size:"sm"},l==="indeterminate"?c:s))));Gt.displayName="CheckboxInput";const Ir=Z.cva("",{variants:{disabled:{true:["text-neutral/dim-2","cursor-not-allowed"],false:["cursor-pointer"]}},defaultVariants:{disabled:!1}}),Zt=({disabled:a,...s})=>n.createElement(Xe.Label,{className:Ir({disabled:a}),...s});Zt.displayName="CheckboxLabel";const Wt=n.forwardRef(({className:a,intent:s,checked:c,value:o,disabled:l,onCheckedChange:f,children:d,...v},C)=>{const R=ge.useId(),I=ge.useId(),L=nt(),E=n.useContext(Bt),N=n.useRef(),z=yr.useMergeRefs(C,N),oe=o?E.value?.includes(o):c,{id:W,name:A,isInvalid:Y,isRequired:se,description:ce,intent:F}=(({fieldState:w,groupState:j,checkboxIntent:O})=>{const V=w.name??j.name,le=w.isRequired??j.isRequired,$=w.isInvalid??j.isInvalid,B=w.id!==j.id;return{name:V,isRequired:le,isInvalid:$,id:B?w.id:void 0,description:B?w.description:void 0,intent:$?"error":O??j.intent}})({fieldState:L,groupState:E,checkboxIntent:s});return n.createElement("div",{"data-spark-component":"checkbox",className:Z.cx("gap-md text-body-1 flex items-center",a)},n.createElement(Gt,{ref:z,id:W||R,name:A,value:o,intent:F,checked:oe,disabled:l,required:se,"aria-describedby":ce,"aria-invalid":Y,onCheckedChange:w=>{f?.(w);const j=N.current?.value;j&&E.onCheckedChange&&E.onCheckedChange(w,j)},"aria-labelledby":d?I:L.labelId,...v}),d&&n.createElement(Zt,{disabled:l,htmlFor:W||R,id:I},d))});Wt.displayName="Checkbox";var Me=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Er(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Qe={exports:{}};(function(a,s){var c="__lodash_hash_undefined__",o=1,l=2,f=9007199254740991,d="[object Arguments]",v="[object Array]",C="[object AsyncFunction]",R="[object Boolean]",I="[object Date]",L="[object Error]",E="[object Function]",N="[object GeneratorFunction]",z="[object Map]",oe="[object Number]",W="[object Null]",A="[object Object]",Y="[object Promise]",se="[object Proxy]",ce="[object RegExp]",F="[object Set]",w="[object String]",j="[object Symbol]",O="[object Undefined]",V="[object WeakMap]",le="[object ArrayBuffer]",$="[object DataView]",B=/^\[object .+?Constructor\]$/,Pe=/^(?:0|[1-9]\d*)$/,p={};p["[object Float32Array]"]=p["[object Float64Array]"]=p["[object Int8Array]"]=p["[object Int16Array]"]=p["[object Int32Array]"]=p["[object Uint8Array]"]=p["[object Uint8ClampedArray]"]=p["[object Uint16Array]"]=p["[object Uint32Array]"]=!0,p[d]=p[v]=p[le]=p[R]=p[$]=p[I]=p[L]=p[E]=p[z]=p[oe]=p[A]=p[ce]=p[F]=p[w]=p[V]=!1;var _e=typeof Me=="object"&&Me&&Me.Object===Object&&Me,ee=typeof self=="object"&&self&&self.Object===Object&&self,S=_e||ee||Function("return this")(),at=s&&!s.nodeType&&s,it=at&&a&&!a.nodeType&&a,ot=it&&it.exports===at,Te=ot&&_e.process,st=function(){try{return Te&&Te.binding&&Te.binding("util")}catch{}}(),ct=st&&st.isTypedArray;function Jt(e,t){for(var r=-1,i=e==null?0:e.length;++r<i;)if(t(e[r],r,e))return!0;return!1}function Kt(e){var t=-1,r=Array(e.size);return e.forEach(function(i,b){r[++t]=[b,i]}),r}function Qt(e){var t=-1,r=Array(e.size);return e.forEach(function(i){r[++t]=i}),r}var lt,ut,dt,Xt=Array.prototype,Yt=Function.prototype,ke=Object.prototype,Ve=S["__core-js_shared__"],ft=Yt.toString,P=ke.hasOwnProperty,pt=(lt=/[^.]+$/.exec(Ve&&Ve.keys&&Ve.keys.IE_PROTO||""))?"Symbol(src)_1."+lt:"",ht=ke.toString,er=RegExp("^"+ft.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),mt=ot?S.Buffer:void 0,we=S.Symbol,bt=S.Uint8Array,vt=ke.propertyIsEnumerable,tr=Xt.splice,te=we?we.toStringTag:void 0,yt=Object.getOwnPropertySymbols,rr=mt?mt.isBuffer:void 0,nr=(ut=Object.keys,dt=Object,function(e){return ut(dt(e))}),$e=ue(S,"DataView"),pe=ue(S,"Map"),Be=ue(S,"Promise"),He=ue(S,"Set"),Ue=ue(S,"WeakMap"),he=ue(Object,"create"),ar=ae($e),ir=ae(pe),or=ae(Be),sr=ae(He),cr=ae(Ue),gt=we?we.prototype:void 0,De=gt?gt.valueOf:void 0;function re(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function H(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function ne(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function je(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new ne;++t<r;)this.add(e[t])}function J(e){var t=this.__data__=new H(e);this.size=t.size}function lr(e,t){var r=Ie(e),i=!r&&hr(e),b=!r&&!i&&Ge(e),u=!r&&!i&&!b&&Rt(e),y=r||i||b||u,g=y?function(k,T){for(var U=-1,x=Array(k);++U<k;)x[U]=T(U);return x}(e.length,String):[],M=g.length;for(var _ in e)!t&&!P.call(e,_)||y&&(_=="length"||b&&(_=="offset"||_=="parent")||u&&(_=="buffer"||_=="byteLength"||_=="byteOffset")||pr(_,M))||g.push(_);return g}function Ce(e,t){for(var r=e.length;r--;)if(Ct(e[r][0],t))return r;return-1}function me(e){return e==null?e===void 0?O:W:te&&te in Object(e)?function(t){var r=P.call(t,te),i=t[te];try{t[te]=void 0;var b=!0}catch{}var u=ht.call(t);return b&&(r?t[te]=i:delete t[te]),u}(e):function(t){return ht.call(t)}(e)}function _t(e){return be(e)&&me(e)==d}function kt(e,t,r,i,b){return e===t||(e==null||t==null||!be(e)&&!be(t)?e!=e&&t!=t:function(u,y,g,M,_,k){var T=Ie(u),U=Ie(y),x=T?v:K(u),D=U?v:K(y),de=(x=x==d?A:x)==A,Ee=(D=D==d?A:D)==A,fe=x==D;if(fe&&Ge(u)){if(!Ge(y))return!1;T=!0,de=!1}if(fe&&!de)return k||(k=new J),T||Rt(u)?wt(u,y,g,M,_,k):function(m,h,Re,Q,Ze,q,G){switch(Re){case $:if(m.byteLength!=h.byteLength||m.byteOffset!=h.byteOffset)return!1;m=m.buffer,h=h.buffer;case le:return!(m.byteLength!=h.byteLength||!q(new bt(m),new bt(h)));case R:case I:case oe:return Ct(+m,+h);case L:return m.name==h.name&&m.message==h.message;case ce:case w:return m==h+"";case z:var X=Kt;case F:var ye=Q&o;if(X||(X=Qt),m.size!=h.size&&!ye)return!1;var Ne=G.get(m);if(Ne)return Ne==h;Q|=l,G.set(m,h);var We=wt(X(m),X(h),Q,Ze,q,G);return G.delete(m),We;case j:if(De)return De.call(m)==De.call(h)}return!1}(u,y,x,g,M,_,k);if(!(g&o)){var ve=de&&P.call(u,"__wrapped__"),Nt=Ee&&P.call(y,"__wrapped__");if(ve||Nt){var br=ve?u.value():u,vr=Nt?y.value():y;return k||(k=new J),_(br,vr,g,M,k)}}return fe?(k||(k=new J),function(m,h,Re,Q,Ze,q){var G=Re&o,X=jt(m),ye=X.length,Ne=jt(h),We=Ne.length;if(ye!=We&&!G)return!1;for(var Fe=ye;Fe--;){var ie=X[Fe];if(!(G?ie in h:P.call(h,ie)))return!1}var Ft=q.get(m);if(Ft&&q.get(h))return Ft==h;var Oe=!0;q.set(m,h),q.set(h,m);for(var Je=G;++Fe<ye;){var qe=m[ie=X[Fe]],ze=h[ie];if(Q)var Ot=G?Q(ze,qe,ie,h,m,q):Q(qe,ze,ie,m,h,q);if(!(Ot===void 0?qe===ze||Ze(qe,ze,Re,Q,q):Ot)){Oe=!1;break}Je||(Je=ie=="constructor")}if(Oe&&!Je){var Ae=m.constructor,Se=h.constructor;Ae==Se||!("constructor"in m)||!("constructor"in h)||typeof Ae=="function"&&Ae instanceof Ae&&typeof Se=="function"&&Se instanceof Se||(Oe=!1)}return q.delete(m),q.delete(h),Oe}(u,y,g,M,_,k)):!1}(e,t,r,i,kt,b))}function ur(e){return!(!Et(e)||function(t){return!!pt&&pt in t}(e))&&(xt(e)?er:B).test(ae(e))}function dr(e){if(r=(t=e)&&t.constructor,i=typeof r=="function"&&r.prototype||ke,t!==i)return nr(e);var t,r,i,b=[];for(var u in Object(e))P.call(e,u)&&u!="constructor"&&b.push(u);return b}function wt(e,t,r,i,b,u){var y=r&o,g=e.length,M=t.length;if(g!=M&&!(y&&M>g))return!1;var _=u.get(e);if(_&&u.get(t))return _==t;var k=-1,T=!0,U=r&l?new je:void 0;for(u.set(e,t),u.set(t,e);++k<g;){var x=e[k],D=t[k];if(i)var de=y?i(D,x,k,t,e,u):i(x,D,k,e,t,u);if(de!==void 0){if(de)continue;T=!1;break}if(U){if(!Jt(t,function(Ee,fe){if(ve=fe,!U.has(ve)&&(x===Ee||b(x,Ee,r,i,u)))return U.push(fe);var ve})){T=!1;break}}else if(x!==D&&!b(x,D,r,i,u)){T=!1;break}}return u.delete(e),u.delete(t),T}function jt(e){return function(t,r,i){var b=r(t);return Ie(t)?b:function(u,y){for(var g=-1,M=y.length,_=u.length;++g<M;)u[_+g]=y[g];return u}(b,i(t))}(e,mr,fr)}function xe(e,t){var r,i,b=e.__data__;return((i=typeof(r=t))=="string"||i=="number"||i=="symbol"||i=="boolean"?r!=="__proto__":r===null)?b[typeof t=="string"?"string":"hash"]:b.map}function ue(e,t){var r=function(i,b){return i?.[b]}(e,t);return ur(r)?r:void 0}re.prototype.clear=function(){this.__data__=he?he(null):{},this.size=0},re.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},re.prototype.get=function(e){var t=this.__data__;if(he){var r=t[e];return r===c?void 0:r}return P.call(t,e)?t[e]:void 0},re.prototype.has=function(e){var t=this.__data__;return he?t[e]!==void 0:P.call(t,e)},re.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=he&&t===void 0?c:t,this},H.prototype.clear=function(){this.__data__=[],this.size=0},H.prototype.delete=function(e){var t=this.__data__,r=Ce(t,e);return!(r<0)&&(r==t.length-1?t.pop():tr.call(t,r,1),--this.size,!0)},H.prototype.get=function(e){var t=this.__data__,r=Ce(t,e);return r<0?void 0:t[r][1]},H.prototype.has=function(e){return Ce(this.__data__,e)>-1},H.prototype.set=function(e,t){var r=this.__data__,i=Ce(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this},ne.prototype.clear=function(){this.size=0,this.__data__={hash:new re,map:new(pe||H),string:new re}},ne.prototype.delete=function(e){var t=xe(this,e).delete(e);return this.size-=t?1:0,t},ne.prototype.get=function(e){return xe(this,e).get(e)},ne.prototype.has=function(e){return xe(this,e).has(e)},ne.prototype.set=function(e,t){var r=xe(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this},je.prototype.add=je.prototype.push=function(e){return this.__data__.set(e,c),this},je.prototype.has=function(e){return this.__data__.has(e)},J.prototype.clear=function(){this.__data__=new H,this.size=0},J.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},J.prototype.get=function(e){return this.__data__.get(e)},J.prototype.has=function(e){return this.__data__.has(e)},J.prototype.set=function(e,t){var r=this.__data__;if(r instanceof H){var i=r.__data__;if(!pe||i.length<199)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new ne(i)}return r.set(e,t),this.size=r.size,this};var fr=yt?function(e){return e==null?[]:(e=Object(e),function(t,r){for(var i=-1,b=t==null?0:t.length,u=0,y=[];++i<b;){var g=t[i];r(g,i,t)&&(y[u++]=g)}return y}(yt(e),function(t){return vt.call(e,t)}))}:function(){return[]},K=me;function pr(e,t){return!!(t=t??f)&&(typeof e=="number"||Pe.test(e))&&e>-1&&e%1==0&&e<t}function ae(e){if(e!=null){try{return ft.call(e)}catch{}try{return e+""}catch{}}return""}function Ct(e,t){return e===t||e!=e&&t!=t}($e&&K(new $e(new ArrayBuffer(1)))!=$||pe&&K(new pe)!=z||Be&&K(Be.resolve())!=Y||He&&K(new He)!=F||Ue&&K(new Ue)!=V)&&(K=function(e){var t=me(e),r=t==A?e.constructor:void 0,i=r?ae(r):"";if(i)switch(i){case ar:return $;case ir:return z;case or:return Y;case sr:return F;case cr:return V}return t});var hr=_t(function(){return arguments}())?_t:function(e){return be(e)&&P.call(e,"callee")&&!vt.call(e,"callee")},Ie=Array.isArray,Ge=rr||function(){return!1};function xt(e){if(!Et(e))return!1;var t=me(e);return t==E||t==N||t==C||t==se}function It(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=f}function Et(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function be(e){return e!=null&&typeof e=="object"}var Rt=ct?function(e){return function(t){return e(t)}}(ct):function(e){return be(e)&&It(e.length)&&!!p[me(e)]};function mr(e){return(t=e)!=null&&It(t.length)&&!xt(t)?lr(e):dr(e);var t}a.exports=function(e,t){return kt(e,t)}})(Qe,Qe.exports);const Rr=Er(Qe.exports),Nr=Z.cva(["flex","gap-lg"],{variants:{orientation:{vertical:["flex-col"],horizontal:[]}}}),zt=n.forwardRef(({name:a,value:s,defaultValue:c,className:o,intent:l,orientation:f="vertical",onCheckedChange:d,children:v,...C},R)=>{const[I,L]=function(F,w,j){const O=F!==void 0,{current:V}=n.useRef(O?F:w),[le,$]=n.useState(w),B=O?F:le,Pe=n.useCallback((p,_e=(ee,S)=>!Rr(ee,S))=>{const ee=typeof p!="function"?p:p(B);_e(B,ee)&&!O&&$(ee),j&&j(ee)},[O,B]);return[B,Pe,O,V]}(s,c),E=nt(),N=n.useRef(d),{id:z,labelId:oe,description:W,isInvalid:A,isRequired:Y}=E,se=a??E.name,ce=n.useMemo(()=>({id:z,name:se,value:I,intent:l,isInvalid:A,description:W,isRequired:Y,onCheckedChange:(F,w)=>{const j=I||[],O=F?[...j,w]:j.filter(V=>V!==w);L(O),N.current&&N.current(O)}}),[z,se,I,l,A,W,Y,L]);return n.useEffect(()=>{N.current=d},[d]),n.createElement(Bt.Provider,{value:ce},n.createElement("div",{ref:R,className:Nr({className:o,orientation:f}),role:"group","aria-labelledby":oe,"aria-describedby":W,...C},v))});zt.displayName="CheckboxGroup",exports.Checkbox=Wt,exports.CheckboxGroup=zt;
package/dist/index.mjs CHANGED
@@ -1,433 +1,421 @@
1
- import h, { forwardRef as I, Children as ke, isValidElement as Be, createElement as je, cloneElement as Vt, Fragment as Nr, useEffect as at, createContext as Dt, useContext as it, useState as Ht, useCallback as et, useMemo as Ut, useRef as tt } from "react";
2
- import { useId as we } from "@radix-ui/react-id";
3
- import { cx as oe, cva as ot } from "class-variance-authority";
4
- import "react-dom";
5
- import { useMergeRefs as Er } from "@spark-ui/use-merge-refs";
6
- import { CheckboxIndicator as Fr, Checkbox as zr } from "@radix-ui/react-checkbox";
7
- import { Icon as Or } from "@spark-ui/icon";
8
- import { makeVariants as Rr } from "@spark-ui/internal-utils";
9
- import { Label as Ar } from "@spark-ui/label";
10
- function he() {
11
- return he = Object.assign ? Object.assign.bind() : function(n) {
1
+ import h, { forwardRef as N, Children as ge, isValidElement as Te, createElement as Qe, cloneElement as Bt, Fragment as Nr, createContext as Vt, useEffect as Ht, useContext as at, useState as Ut, useCallback as et, useMemo as Dt, useRef as tt } from "react";
2
+ import { useId as ke } from "@radix-ui/react-id";
3
+ import { cx as pe, cva as it } from "class-variance-authority";
4
+ import { Label as ot } from "@spark-ui/label";
5
+ import { useMergeRefs as Fr } from "@spark-ui/use-merge-refs";
6
+ import { CheckboxIndicator as zr, Checkbox as Or } from "@radix-ui/react-checkbox";
7
+ import { Icon as Rr } from "@spark-ui/icon";
8
+ import { makeVariants as Ar } from "@spark-ui/internal-utils";
9
+ function $e() {
10
+ return $e = Object.assign ? Object.assign.bind() : function(n) {
12
11
  for (var o = 1; o < arguments.length; o++) {
13
- var i = arguments[o];
14
- for (var a in i)
15
- Object.prototype.hasOwnProperty.call(i, a) && (n[a] = i[a]);
12
+ var s = arguments[o];
13
+ for (var i in s)
14
+ Object.prototype.hasOwnProperty.call(s, i) && (n[i] = s[i]);
16
15
  }
17
16
  return n;
18
- }, he.apply(this, arguments);
17
+ }, $e.apply(this, arguments);
19
18
  }
20
- function Mr(...n) {
21
- return (o) => n.forEach((i) => function(a, c) {
22
- typeof a == "function" ? a(c) : a != null && (a.current = c);
23
- }(i, o));
19
+ function Sr(...n) {
20
+ return (o) => n.forEach((s) => function(i, c) {
21
+ typeof i == "function" ? i(c) : i != null && (i.current = c);
22
+ }(s, o));
24
23
  }
25
- const st = I((n, o) => {
26
- const { children: i, ...a } = n, c = ke.toArray(i), d = c.find(Sr);
24
+ const Gt = N((n, o) => {
25
+ const { children: s, ...i } = n, c = ge.toArray(s), d = c.find(Mr);
27
26
  if (d) {
28
- const l = d.props.children, v = c.map((C) => C === d ? ke.count(l) > 1 ? ke.only(null) : Be(l) ? l.props.children : null : C);
29
- return je(rt, he({}, a, { ref: o }), Be(l) ? Vt(l, void 0, v) : null);
27
+ const u = d.props.children, v = c.map((C) => C === d ? ge.count(u) > 1 ? ge.only(null) : Te(u) ? u.props.children : null : C);
28
+ return Qe(rt, $e({}, i, { ref: o }), Te(u) ? Bt(u, void 0, v) : null);
30
29
  }
31
- return je(rt, he({}, a, { ref: o }), i);
30
+ return Qe(rt, $e({}, i, { ref: o }), s);
32
31
  });
33
- st.displayName = "Slot";
34
- const rt = I((n, o) => {
35
- const { children: i, ...a } = n;
36
- return Be(i) ? Vt(i, { ...qr(a, i.props), ref: Mr(o, i.ref) }) : ke.count(i) > 1 ? ke.only(null) : null;
32
+ Gt.displayName = "Slot";
33
+ const rt = N((n, o) => {
34
+ const { children: s, ...i } = n;
35
+ return Te(s) ? Bt(s, { ...qr(i, s.props), ref: Sr(o, s.ref) }) : ge.count(s) > 1 ? ge.only(null) : null;
37
36
  });
38
37
  rt.displayName = "SlotClone";
39
- const Gt = ({ children: n }) => je(Nr, null, n);
40
- function Sr(n) {
41
- return Be(n) && n.type === Gt;
38
+ const Zt = ({ children: n }) => Qe(Nr, null, n);
39
+ function Mr(n) {
40
+ return Te(n) && n.type === Zt;
42
41
  }
43
42
  function qr(n, o) {
44
- const i = { ...o };
45
- for (const a in o) {
46
- const c = n[a], d = o[a];
47
- /^on[A-Z]/.test(a) ? c && d ? i[a] = (...l) => {
48
- d(...l), c(...l);
49
- } : c && (i[a] = c) : a === "style" ? i[a] = { ...c, ...d } : a === "className" && (i[a] = [c, d].filter(Boolean).join(" "));
43
+ const s = { ...o };
44
+ for (const i in o) {
45
+ const c = n[i], d = o[i];
46
+ /^on[A-Z]/.test(i) ? c && d ? s[i] = (...u) => {
47
+ d(...u), c(...u);
48
+ } : c && (s[i] = c) : i === "style" ? s[i] = { ...c, ...d } : i === "className" && (s[i] = [c, d].filter(Boolean).join(" "));
50
49
  }
51
- return { ...n, ...i };
50
+ return { ...n, ...s };
52
51
  }
53
- const Lr = I((n, o) => h.createElement(st, { ref: o, ...n })), Pr = ["a", "button", "div", "form", "h2", "h3", "img", "input", "label", "li", "nav", "ol", "p", "span", "svg", "ul"].reduce((n, o) => {
54
- const i = I((a, c) => {
55
- const { asChild: d, ...l } = a, v = d ? st : o;
56
- return at(() => {
57
- window[Symbol.for("radix-ui")] = !0;
58
- }, []), je(v, he({}, l, { ref: c }));
59
- });
60
- return i.displayName = `Primitive.${o}`, { ...n, [o]: i };
61
- }, {}), $r = I((n, o) => je(Pr.label, he({}, n, { ref: o, onMouseDown: (i) => {
62
- var a;
63
- (a = n.onMouseDown) === null || a === void 0 || a.call(n, i), !i.defaultPrevented && i.detail > 1 && i.preventDefault();
64
- } }))), ct = Dt(null), lt = () => {
65
- const n = it(ct);
52
+ const Lr = N((n, o) => h.createElement(Gt, { ref: o, ...n })), st = Vt(null), ct = () => {
53
+ const n = at(st);
66
54
  if (!n)
67
55
  throw Error("useFormField must be used within a FormField provider");
68
56
  return n;
69
- }, Zt = ({ id: n, name: o, isInvalid: i, isRequired: a, children: c }) => {
70
- const d = we(), [l, v] = Ht([]), C = l.length > 0 ? l.join(" ") : void 0, F = et((E) => {
57
+ }, Wt = ({ id: n, name: o, isInvalid: s, isRequired: i, children: c }) => {
58
+ const d = ke(), [u, v] = Ut([]), C = u.length > 0 ? u.join(" ") : void 0, F = et((E) => {
71
59
  v((z) => [...z, E]);
72
- }, []), N = et((E) => {
73
- v((z) => z.filter((M) => M !== E));
74
- }, []), P = Ut(() => ({ id: n, labelId: d, name: o, isInvalid: i, isRequired: a, description: C, onMessageIdAdd: F, onMessageIdRemove: N }), [n, d, o, C, i, a, F, N]);
75
- return h.createElement(ct.Provider, { value: P }, c);
60
+ }, []), x = et((E) => {
61
+ v((z) => z.filter((S) => S !== E));
62
+ }, []), P = Dt(() => ({ id: n, labelId: d, name: o, isInvalid: s, isRequired: i, description: C, onMessageIdAdd: F, onMessageIdRemove: x }), [n, d, o, C, s, i, F, x]);
63
+ return h.createElement(st.Provider, { value: P }, c);
76
64
  };
77
- Zt.displayName = "FormFieldProvider";
78
- const Wt = I(({ className: n, name: o, isInvalid: i = !1, isRequired: a = !1, asChild: c = !1, ...d }, l) => {
79
- const v = we(), C = c ? Lr : "div";
80
- return h.createElement(Zt, { id: v, name: o, isRequired: a, isInvalid: i }, h.createElement(C, { ref: l, "data-spark-component": "form-control", className: oe(n, "flex flex-col gap-xl"), ...d }));
65
+ Wt.displayName = "FormFieldProvider";
66
+ const Jt = N(({ className: n, name: o, isInvalid: s = !1, isRequired: i = !1, asChild: c = !1, ...d }, u) => {
67
+ const v = ke(), C = c ? Lr : "div";
68
+ return h.createElement(Wt, { id: v, name: o, isRequired: i, isInvalid: s }, h.createElement(C, { ref: u, "data-spark-component": "form-field", className: pe(n, "flex flex-col gap-xl"), ...d }));
81
69
  });
82
- Wt.displayName = "FormField";
83
- const ut = I(({ id: n, className: o, ...i }, a) => {
84
- const { onMessageIdAdd: c, onMessageIdRemove: d } = lt(), l = we(), v = n || l;
85
- return at(() => (c(v), () => {
70
+ Jt.displayName = "FormField";
71
+ const lt = N(({ id: n, className: o, ...s }, i) => {
72
+ const { onMessageIdAdd: c, onMessageIdRemove: d } = ct(), u = ke(), v = n || u;
73
+ return Ht(() => (c(v), () => {
86
74
  d(v);
87
- }), [v, c, d]), h.createElement("span", { ref: a, id: v, className: oe(o, "text-caption"), ...i });
75
+ }), [v, c, d]), h.createElement("span", { ref: i, id: v, "data-spark-component": "form-field-message", className: pe(o, "text-caption"), ...s });
88
76
  });
89
- ut.displayName = "FormField.Message";
90
- const Jt = I(({ className: n, ...o }, i) => {
91
- const { isInvalid: a } = lt();
92
- return a ? h.createElement(ut, { ref: i, "data-spark-component": "form-error-message", "aria-live": "polite", className: oe(n, "text-error"), ...o }) : null;
77
+ lt.displayName = "FormField.Message";
78
+ const Kt = N(({ className: n, ...o }, s) => {
79
+ const { isInvalid: i } = ct();
80
+ return i ? h.createElement(lt, { ref: s, "data-spark-component": "form-field-error-message", "aria-live": "polite", className: pe(n, "text-error"), ...o }) : null;
93
81
  });
94
- Jt.displayName = "FormField.ErrorMessage";
95
- const Kt = I(({ className: n, ...o }, i) => h.createElement(ut, { ref: i, "data-spark-component": "form-helper-message", className: oe(n, "text-neutral"), ...o }));
96
- Kt.displayName = "FormField.HelperMessage";
97
- const dt = I(({ className: n, children: o = "*", ...i }, a) => h.createElement("span", { ref: a, "data-spark-component": "form-required-indicator", role: "presentation", "aria-hidden": "true", className: oe(n, "text-error"), ...i }, o));
98
- dt.displayName = "FormField.RequiredIndicator";
99
- const Qt = I(({ htmlFor: n, className: o, children: i, requiredIndicator: a = h.createElement(dt, null), asChild: c, ...d }, l) => {
100
- const v = lt(), { labelId: C, isRequired: F } = v, N = c ? void 0 : n || v.id;
101
- return h.createElement($r, { ref: l, id: C, "data-spark-component": "form-label", htmlFor: N, className: oe(o, "flex items-center gap-sm text-body-1"), asChild: c, ...d }, h.createElement(Gt, null, i), F && a);
82
+ Kt.displayName = "FormField.ErrorMessage";
83
+ const Xt = N(({ className: n, ...o }, s) => h.createElement(lt, { ref: s, "data-spark-component": "form-field-helper-message", className: pe(n, "text-neutral"), ...o }));
84
+ Xt.displayName = "FormField.HelperMessage";
85
+ const ut = N((n, o) => h.createElement(ot.RequiredIndicator, { ref: o, ...n }));
86
+ ut.displayName = "FormField.RequiredIndicator";
87
+ const Yt = N(({ htmlFor: n, className: o, children: s, requiredIndicator: i = h.createElement(ut, null), asChild: c, ...d }, u) => {
88
+ const v = ct(), { labelId: C, isRequired: F } = v, x = c ? void 0 : n || v.id;
89
+ return h.createElement(ot, { ref: u, id: C, "data-spark-component": "form-field-label", htmlFor: x, className: pe(o, "flex items-center gap-sm"), asChild: c, ...d }, h.createElement(Zt, null, s), F && i);
102
90
  });
103
- Qt.displayName = "FormField.Label";
104
- const ft = () => {
105
- const { id: n, name: o, description: i, labelId: a, isRequired: c, isInvalid: d } = it(ct) || {};
106
- return { id: n, name: o, description: i, labelId: a, isRequired: c, isInvalid: d };
107
- }, Bt = ({ children: n }) => {
108
- const { id: o, name: i, isInvalid: a, labelId: c, isRequired: d, description: l } = ft();
109
- return h.createElement(h.Fragment, null, n({ id: o, labelId: c, name: i, isRequired: d, isInvalid: a, description: l }));
91
+ Yt.displayName = "FormField.Label";
92
+ const dt = () => {
93
+ const { id: n, name: o, description: s, labelId: i, isRequired: c, isInvalid: d } = at(st) || {};
94
+ return { id: n, name: o, description: s, labelId: i, isRequired: c, isInvalid: d };
95
+ }, $t = ({ children: n }) => {
96
+ const { id: o, name: s, isInvalid: i, labelId: c, isRequired: d, description: u } = dt();
97
+ return h.createElement(h.Fragment, null, n({ id: o, labelId: c, name: s, isRequired: d, isInvalid: i, description: u }));
110
98
  };
111
- Bt.displayName = "FormField.State", Object.assign(Wt, { Label: Qt, State: Bt, ErrorMessage: Jt, HelperMessage: Kt, RequiredIndicator: dt });
112
- const Xt = Dt({}), Yt = h.forwardRef(({ title: n, fill: o = "currentColor", stroke: i = "none", ...a }, c) => h.createElement("svg", { ref: c, viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", ...n && { "data-title": n }, fill: o, stroke: i, ...a, dangerouslySetInnerHTML: { __html: (n === void 0 ? "" : `<title>${n}</title>`) + '<path d="M8.91958 20.1667C8.73748 20.1667 8.56045 20.1323 8.38847 20.0635C8.21649 19.9947 8.05969 19.8915 7.91806 19.7539L2.42489 14.4176C2.14163 14.1425 2 13.8083 2 13.4152C2 13.0222 2.14163 12.688 2.42489 12.4129C2.70814 12.1377 3.04704 12.0001 3.44158 12.0001C3.83612 12.0001 4.18513 12.1377 4.48862 12.4129L8.91958 16.7173L19.5417 6.42797C19.825 6.1528 20.1639 6.0103 20.5584 6.00048C20.953 5.99065 21.2919 6.13315 21.5751 6.42797C21.8584 6.70313 22 7.03727 22 7.43036C22 7.82346 21.8584 8.15759 21.5751 8.43276L9.92109 19.7539C9.77946 19.8915 9.62266 19.9947 9.45068 20.0635C9.27871 20.1323 9.10167 20.1667 8.91958 20.1667Z"/>' } }));
113
- Yt.displayName = "Check";
114
- const er = h.forwardRef(({ title: n, fill: o = "currentColor", stroke: i = "none", ...a }, c) => h.createElement("svg", { ref: c, viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", ...n && { "data-title": n }, fill: o, stroke: i, ...a, dangerouslySetInnerHTML: { __html: (n === void 0 ? "" : `<title>${n}</title>`) + '<path fill-rule="evenodd" clip-rule="evenodd" d="M2 11.9999C2 11.379 2.44772 10.8756 3 10.8756H21C21.5523 10.8756 22 11.379 22 11.9999C22 12.6208 21.5523 13.1242 21 13.1242H3C2.44772 13.1242 2 12.6208 2 11.9999Z"/>' } }));
115
- er.displayName = "Minus";
116
- const tr = I((n, o) => h.createElement(Fr, { ref: o, className: "text-surface flex h-full w-full items-center justify-center", ...n }));
117
- tr.displayName = "CheckboxIndicator";
118
- const Tr = ot(["h-sz-16 w-sz-16 border-md box-content items-center justify-center rounded-sm bg-transparent outline-none", "spark-disabled:opacity-dim-3 spark-disabled:cursor-not-allowed spark-disabled:hover:ring-0", "focus-visible:ring-outline-high focus-visible:ring-2", "hover:border-primary-container hover:ring-2", "u-shadow-border-transition"], { variants: { intent: Rr({ primary: ["spark-state-unchecked:border-outline", "spark-state-indeterminate:border-primary spark-state-indeterminate:bg-primary", "spark-state-checked:border-primary spark-state-checked:bg-primary"], success: ["spark-state-unchecked:border-success", "spark-state-indeterminate:border-success spark-state-indeterminate:bg-success", "spark-state-checked:border-success spark-state-checked:bg-success"], alert: ["spark-state-unchecked:border-alert", "spark-state-indeterminate:border-alert spark-state-indeterminate:bg-alert", "spark-state-checked:border-alert spark-state-checked:bg-alert"], error: ["spark-state-unchecked:border-error", "spark-state-indeterminate:border-error spark-state-indeterminate:bg-error", "spark-state-checked:border-error spark-state-checked:bg-error"], info: ["spark-state-unchecked:border-info", "spark-state-indeterminate:border-info spark-state-indeterminate:bg-info", "spark-state-checked:border-info spark-state-checked:bg-info"], neutral: ["spark-state-unchecked:border-neutral", "spark-state-indeterminate:border-neutral spark-state-indeterminate:bg-neutral", "spark-state-checked:border-neutral spark-state-checked:bg-neutral"] }) }, defaultVariants: { intent: "primary" } }), rr = I(({ className: n, icon: o = h.createElement(Yt, null), indeterminateIcon: i = h.createElement(er, null), intent: a, checked: c, ...d }, l) => h.createElement(zr, { ref: l, className: Tr({ intent: a, className: n }), checked: c, ...d }, h.createElement(tr, null, h.createElement(Or, { size: "sm" }, c === "indeterminate" ? i : o))));
119
- rr.displayName = "CheckboxInput";
120
- const Br = ot("", { variants: { disabled: { true: ["text-neutral/dim-2", "cursor-not-allowed"], false: ["cursor-pointer"] } }, defaultVariants: { disabled: !1 } }), nr = ({ disabled: n, ...o }) => h.createElement(Ar, { className: Br({ disabled: n }), ...o });
121
- nr.displayName = "CheckboxLabel";
122
- const Vr = I(({ className: n, intent: o, checked: i, value: a, disabled: c, onCheckedChange: d, children: l, ...v }, C) => {
123
- const F = we(), N = we(), P = ft(), E = it(Xt), z = tt(), M = Er(C, z), se = a ? E.value?.includes(a) : i, { id: W, name: S, isInvalid: Y, isRequired: ce, description: le, intent: O } = (({ fieldState: j, groupState: w, checkboxIntent: R }) => {
124
- const B = j.name ?? w.name, ue = j.isRequired ?? w.isRequired, V = j.isInvalid ?? w.isInvalid, D = j.id !== w.id;
125
- return { name: B, isRequired: ue, isInvalid: V, id: D ? j.id : void 0, description: D ? j.description : void 0, intent: V ? "error" : R ?? w.intent };
99
+ $t.displayName = "FormField.State", Object.assign(Jt, { Label: Yt, State: $t, ErrorMessage: Kt, HelperMessage: Xt, RequiredIndicator: ut });
100
+ const Qt = Vt({}), er = h.forwardRef(({ title: n, fill: o = "currentColor", stroke: s = "none", ...i }, c) => h.createElement("svg", { ref: c, viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", ...n && { "data-title": n }, fill: o, stroke: s, ...i, dangerouslySetInnerHTML: { __html: (n === void 0 ? "" : `<title>${n}</title>`) + '<path d="M8.91958 20.1667C8.73748 20.1667 8.56045 20.1323 8.38847 20.0635C8.21649 19.9947 8.05969 19.8915 7.91806 19.7539L2.42489 14.4176C2.14163 14.1425 2 13.8083 2 13.4152C2 13.0222 2.14163 12.688 2.42489 12.4129C2.70814 12.1377 3.04704 12.0001 3.44158 12.0001C3.83612 12.0001 4.18513 12.1377 4.48862 12.4129L8.91958 16.7173L19.5417 6.42797C19.825 6.1528 20.1639 6.0103 20.5584 6.00048C20.953 5.99065 21.2919 6.13315 21.5751 6.42797C21.8584 6.70313 22 7.03727 22 7.43036C22 7.82346 21.8584 8.15759 21.5751 8.43276L9.92109 19.7539C9.77946 19.8915 9.62266 19.9947 9.45068 20.0635C9.27871 20.1323 9.10167 20.1667 8.91958 20.1667Z"/>' } }));
101
+ er.displayName = "Check";
102
+ const tr = h.forwardRef(({ title: n, fill: o = "currentColor", stroke: s = "none", ...i }, c) => h.createElement("svg", { ref: c, viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", ...n && { "data-title": n }, fill: o, stroke: s, ...i, dangerouslySetInnerHTML: { __html: (n === void 0 ? "" : `<title>${n}</title>`) + '<path fill-rule="evenodd" clip-rule="evenodd" d="M2 11.9999C2 11.379 2.44772 10.8756 3 10.8756H21C21.5523 10.8756 22 11.379 22 11.9999C22 12.6208 21.5523 13.1242 21 13.1242H3C2.44772 13.1242 2 12.6208 2 11.9999Z"/>' } }));
103
+ tr.displayName = "Minus";
104
+ const rr = N((n, o) => h.createElement(zr, { ref: o, className: "text-surface flex h-full w-full items-center justify-center", ...n }));
105
+ rr.displayName = "CheckboxIndicator";
106
+ const Pr = it(["h-sz-16 w-sz-16 border-md box-content items-center justify-center rounded-sm bg-transparent outline-none", "spark-disabled:opacity-dim-3 spark-disabled:cursor-not-allowed spark-disabled:hover:ring-0", "focus-visible:ring-outline-high focus-visible:ring-2", "hover:border-primary-container hover:ring-2", "u-shadow-border-transition"], { variants: { intent: Ar({ primary: ["spark-state-unchecked:border-outline", "spark-state-indeterminate:border-primary spark-state-indeterminate:bg-primary", "spark-state-checked:border-primary spark-state-checked:bg-primary"], success: ["spark-state-unchecked:border-success", "spark-state-indeterminate:border-success spark-state-indeterminate:bg-success", "spark-state-checked:border-success spark-state-checked:bg-success"], alert: ["spark-state-unchecked:border-alert", "spark-state-indeterminate:border-alert spark-state-indeterminate:bg-alert", "spark-state-checked:border-alert spark-state-checked:bg-alert"], error: ["spark-state-unchecked:border-error", "spark-state-indeterminate:border-error spark-state-indeterminate:bg-error", "spark-state-checked:border-error spark-state-checked:bg-error"], info: ["spark-state-unchecked:border-info", "spark-state-indeterminate:border-info spark-state-indeterminate:bg-info", "spark-state-checked:border-info spark-state-checked:bg-info"], neutral: ["spark-state-unchecked:border-neutral", "spark-state-indeterminate:border-neutral spark-state-indeterminate:bg-neutral", "spark-state-checked:border-neutral spark-state-checked:bg-neutral"] }) }, defaultVariants: { intent: "primary" } }), nr = N(({ className: n, icon: o = h.createElement(er, null), indeterminateIcon: s = h.createElement(tr, null), intent: i, checked: c, ...d }, u) => h.createElement(Or, { ref: u, className: Pr({ intent: i, className: n }), checked: c, ...d }, h.createElement(rr, null, h.createElement(Rr, { size: "sm" }, c === "indeterminate" ? s : o))));
107
+ nr.displayName = "CheckboxInput";
108
+ const Tr = it("", { variants: { disabled: { true: ["text-neutral/dim-2", "cursor-not-allowed"], false: ["cursor-pointer"] } }, defaultVariants: { disabled: !1 } }), ar = ({ disabled: n, ...o }) => h.createElement(ot, { className: Tr({ disabled: n }), ...o });
109
+ ar.displayName = "CheckboxLabel";
110
+ const $r = N(({ className: n, intent: o, checked: s, value: i, disabled: c, onCheckedChange: d, children: u, ...v }, C) => {
111
+ const F = ke(), x = ke(), P = dt(), E = at(Qt), z = tt(), S = Fr(C, z), oe = i ? E.value?.includes(i) : s, { id: W, name: M, isInvalid: Q, isRequired: se, description: ce, intent: O } = (({ fieldState: j, groupState: w, checkboxIntent: R }) => {
112
+ const B = j.name ?? w.name, le = j.isRequired ?? w.isRequired, V = j.isInvalid ?? w.isInvalid, H = j.id !== w.id;
113
+ return { name: B, isRequired: le, isInvalid: V, id: H ? j.id : void 0, description: H ? j.description : void 0, intent: V ? "error" : R ?? w.intent };
126
114
  })({ fieldState: P, groupState: E, checkboxIntent: o });
127
- return h.createElement("div", { "data-spark-component": "checkbox", className: oe("gap-md text-body-1 flex items-center", n) }, h.createElement(rr, { ref: M, id: W || F, name: S, value: a, intent: O, checked: se, disabled: c, required: ce, "aria-describedby": le, "aria-invalid": Y, onCheckedChange: (j) => {
115
+ return h.createElement("div", { "data-spark-component": "checkbox", className: pe("gap-md text-body-1 flex items-center", n) }, h.createElement(nr, { ref: S, id: W || F, name: M, value: i, intent: O, checked: oe, disabled: c, required: se, "aria-describedby": ce, "aria-invalid": Q, onCheckedChange: (j) => {
128
116
  d?.(j);
129
117
  const w = z.current?.value;
130
118
  w && E.onCheckedChange && E.onCheckedChange(j, w);
131
- }, "aria-labelledby": l ? N : P.labelId, ...v }), l && h.createElement(nr, { disabled: c, htmlFor: W || F, id: N }, l));
119
+ }, "aria-labelledby": u ? x : P.labelId, ...v }), u && h.createElement(ar, { disabled: c, htmlFor: W || F, id: x }, u));
132
120
  });
133
- Vr.displayName = "Checkbox";
134
- var Te = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
135
- function Dr(n) {
121
+ $r.displayName = "Checkbox";
122
+ var Pe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
123
+ function Br(n) {
136
124
  return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
137
125
  }
138
126
  var nt = { exports: {} };
139
127
  (function(n, o) {
140
- var i = "__lodash_hash_undefined__", a = 1, c = 2, d = 9007199254740991, l = "[object Arguments]", v = "[object Array]", C = "[object AsyncFunction]", F = "[object Boolean]", N = "[object Date]", P = "[object Error]", E = "[object Function]", z = "[object GeneratorFunction]", M = "[object Map]", se = "[object Number]", W = "[object Null]", S = "[object Object]", Y = "[object Promise]", ce = "[object Proxy]", le = "[object RegExp]", O = "[object Set]", j = "[object String]", w = "[object Symbol]", R = "[object Undefined]", B = "[object WeakMap]", ue = "[object ArrayBuffer]", V = "[object DataView]", D = /^\[object .+?Constructor\]$/, Ve = /^(?:0|[1-9]\d*)$/, f = {};
141
- f["[object Float32Array]"] = f["[object Float64Array]"] = f["[object Int8Array]"] = f["[object Int16Array]"] = f["[object Int32Array]"] = f["[object Uint8Array]"] = f["[object Uint8ClampedArray]"] = f["[object Uint16Array]"] = f["[object Uint32Array]"] = !0, f[l] = f[v] = f[ue] = f[F] = f[V] = f[N] = f[P] = f[E] = f[M] = f[se] = f[S] = f[le] = f[O] = f[j] = f[B] = !1;
142
- var Ce = typeof Te == "object" && Te && Te.Object === Object && Te, ee = typeof self == "object" && self && self.Object === Object && self, q = Ce || ee || Function("return this")(), pt = o && !o.nodeType && o, ht = pt && n && !n.nodeType && n, mt = ht && ht.exports === pt, De = mt && Ce.process, bt = function() {
128
+ var s = "__lodash_hash_undefined__", i = 1, c = 2, d = 9007199254740991, u = "[object Arguments]", v = "[object Array]", C = "[object AsyncFunction]", F = "[object Boolean]", x = "[object Date]", P = "[object Error]", E = "[object Function]", z = "[object GeneratorFunction]", S = "[object Map]", oe = "[object Number]", W = "[object Null]", M = "[object Object]", Q = "[object Promise]", se = "[object Proxy]", ce = "[object RegExp]", O = "[object Set]", j = "[object String]", w = "[object Symbol]", R = "[object Undefined]", B = "[object WeakMap]", le = "[object ArrayBuffer]", V = "[object DataView]", H = /^\[object .+?Constructor\]$/, Be = /^(?:0|[1-9]\d*)$/, f = {};
129
+ f["[object Float32Array]"] = f["[object Float64Array]"] = f["[object Int8Array]"] = f["[object Int16Array]"] = f["[object Int32Array]"] = f["[object Uint8Array]"] = f["[object Uint8ClampedArray]"] = f["[object Uint16Array]"] = f["[object Uint32Array]"] = !0, f[u] = f[v] = f[le] = f[F] = f[V] = f[x] = f[P] = f[E] = f[S] = f[oe] = f[M] = f[ce] = f[O] = f[j] = f[B] = !1;
130
+ var je = typeof Pe == "object" && Pe && Pe.Object === Object && Pe, ee = typeof self == "object" && self && self.Object === Object && self, q = je || ee || Function("return this")(), ft = o && !o.nodeType && o, pt = ft && n && !n.nodeType && n, ht = pt && pt.exports === ft, Ve = ht && je.process, mt = function() {
143
131
  try {
144
- return De && De.binding && De.binding("util");
132
+ return Ve && Ve.binding && Ve.binding("util");
145
133
  } catch {
146
134
  }
147
- }(), vt = bt && bt.isTypedArray;
148
- function ar(e, t) {
149
- for (var r = -1, s = e == null ? 0 : e.length; ++r < s; )
135
+ }(), bt = mt && mt.isTypedArray;
136
+ function ir(e, t) {
137
+ for (var r = -1, a = e == null ? 0 : e.length; ++r < a; )
150
138
  if (t(e[r], r, e))
151
139
  return !0;
152
140
  return !1;
153
141
  }
154
- function ir(e) {
142
+ function or(e) {
155
143
  var t = -1, r = Array(e.size);
156
- return e.forEach(function(s, b) {
157
- r[++t] = [b, s];
144
+ return e.forEach(function(a, b) {
145
+ r[++t] = [b, a];
158
146
  }), r;
159
147
  }
160
- function or(e) {
148
+ function sr(e) {
161
149
  var t = -1, r = Array(e.size);
162
- return e.forEach(function(s) {
163
- r[++t] = s;
150
+ return e.forEach(function(a) {
151
+ r[++t] = a;
164
152
  }), r;
165
153
  }
166
- var yt, _t, gt, sr = Array.prototype, cr = Function.prototype, xe = Object.prototype, He = q["__core-js_shared__"], kt = cr.toString, $ = xe.hasOwnProperty, jt = (yt = /[^.]+$/.exec(He && He.keys && He.keys.IE_PROTO || "")) ? "Symbol(src)_1." + yt : "", wt = xe.toString, lr = RegExp("^" + kt.call($).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"), Ct = mt ? q.Buffer : void 0, Ie = q.Symbol, xt = q.Uint8Array, It = xe.propertyIsEnumerable, ur = sr.splice, te = Ie ? Ie.toStringTag : void 0, Nt = Object.getOwnPropertySymbols, dr = Ct ? Ct.isBuffer : void 0, fr = (_t = Object.keys, gt = Object, function(e) {
167
- return _t(gt(e));
168
- }), Ue = de(q, "DataView"), me = de(q, "Map"), Ge = de(q, "Promise"), Ze = de(q, "Set"), We = de(q, "WeakMap"), be = de(Object, "create"), pr = ae(Ue), hr = ae(me), mr = ae(Ge), br = ae(Ze), vr = ae(We), Et = Ie ? Ie.prototype : void 0, Je = Et ? Et.valueOf : void 0;
154
+ var vt, yt, _t, cr = Array.prototype, lr = Function.prototype, we = Object.prototype, He = q["__core-js_shared__"], gt = lr.toString, T = we.hasOwnProperty, kt = (vt = /[^.]+$/.exec(He && He.keys && He.keys.IE_PROTO || "")) ? "Symbol(src)_1." + vt : "", jt = we.toString, ur = RegExp("^" + gt.call(T).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"), wt = ht ? q.Buffer : void 0, Ce = q.Symbol, Ct = q.Uint8Array, It = we.propertyIsEnumerable, dr = cr.splice, te = Ce ? Ce.toStringTag : void 0, xt = Object.getOwnPropertySymbols, fr = wt ? wt.isBuffer : void 0, pr = (yt = Object.keys, _t = Object, function(e) {
155
+ return yt(_t(e));
156
+ }), Ue = ue(q, "DataView"), he = ue(q, "Map"), De = ue(q, "Promise"), Ge = ue(q, "Set"), Ze = ue(q, "WeakMap"), me = ue(Object, "create"), hr = ae(Ue), mr = ae(he), br = ae(De), vr = ae(Ge), yr = ae(Ze), Et = Ce ? Ce.prototype : void 0, We = Et ? Et.valueOf : void 0;
169
157
  function re(e) {
170
158
  var t = -1, r = e == null ? 0 : e.length;
171
159
  for (this.clear(); ++t < r; ) {
172
- var s = e[t];
173
- this.set(s[0], s[1]);
160
+ var a = e[t];
161
+ this.set(a[0], a[1]);
174
162
  }
175
163
  }
176
- function H(e) {
164
+ function U(e) {
177
165
  var t = -1, r = e == null ? 0 : e.length;
178
166
  for (this.clear(); ++t < r; ) {
179
- var s = e[t];
180
- this.set(s[0], s[1]);
167
+ var a = e[t];
168
+ this.set(a[0], a[1]);
181
169
  }
182
170
  }
183
171
  function ne(e) {
184
172
  var t = -1, r = e == null ? 0 : e.length;
185
173
  for (this.clear(); ++t < r; ) {
186
- var s = e[t];
187
- this.set(s[0], s[1]);
174
+ var a = e[t];
175
+ this.set(a[0], a[1]);
188
176
  }
189
177
  }
190
- function Ne(e) {
178
+ function Ie(e) {
191
179
  var t = -1, r = e == null ? 0 : e.length;
192
180
  for (this.__data__ = new ne(); ++t < r; )
193
181
  this.add(e[t]);
194
182
  }
195
183
  function J(e) {
196
- var t = this.__data__ = new H(e);
184
+ var t = this.__data__ = new U(e);
197
185
  this.size = t.size;
198
186
  }
199
- function yr(e, t) {
200
- var r = ze(e), s = !r && wr(e), b = !r && !s && Ke(e), u = !r && !s && !b && Lt(e), y = r || s || b || u, _ = y ? function(k, T) {
201
- for (var U = -1, x = Array(k); ++U < k; )
202
- x[U] = T(U);
203
- return x;
187
+ function _r(e, t) {
188
+ var r = Ne(e), a = !r && Cr(e), b = !r && !a && Je(e), l = !r && !a && !b && qt(e), y = r || a || b || l, _ = y ? function(k, $) {
189
+ for (var D = -1, I = Array(k); ++D < k; )
190
+ I[D] = $(D);
191
+ return I;
204
192
  }(e.length, String) : [], L = _.length;
205
193
  for (var g in e)
206
- !t && !$.call(e, g) || y && (g == "length" || b && (g == "offset" || g == "parent") || u && (g == "buffer" || g == "byteLength" || g == "byteOffset") || jr(g, L)) || _.push(g);
194
+ !t && !T.call(e, g) || y && (g == "length" || b && (g == "offset" || g == "parent") || l && (g == "buffer" || g == "byteLength" || g == "byteOffset") || wr(g, L)) || _.push(g);
207
195
  return _;
208
196
  }
209
- function Ee(e, t) {
197
+ function xe(e, t) {
210
198
  for (var r = e.length; r--; )
211
- if (At(e[r][0], t))
199
+ if (Rt(e[r][0], t))
212
200
  return r;
213
201
  return -1;
214
202
  }
215
- function ve(e) {
203
+ function be(e) {
216
204
  return e == null ? e === void 0 ? R : W : te && te in Object(e) ? function(t) {
217
- var r = $.call(t, te), s = t[te];
205
+ var r = T.call(t, te), a = t[te];
218
206
  try {
219
207
  t[te] = void 0;
220
208
  var b = !0;
221
209
  } catch {
222
210
  }
223
- var u = wt.call(t);
224
- return b && (r ? t[te] = s : delete t[te]), u;
211
+ var l = jt.call(t);
212
+ return b && (r ? t[te] = a : delete t[te]), l;
225
213
  }(e) : function(t) {
226
- return wt.call(t);
214
+ return jt.call(t);
227
215
  }(e);
228
216
  }
229
- function Ft(e) {
230
- return ye(e) && ve(e) == l;
217
+ function Nt(e) {
218
+ return ve(e) && be(e) == u;
231
219
  }
232
- function zt(e, t, r, s, b) {
233
- return e === t || (e == null || t == null || !ye(e) && !ye(t) ? e != e && t != t : function(u, y, _, L, g, k) {
234
- var T = ze(u), U = ze(y), x = T ? v : K(u), G = U ? v : K(y), fe = (x = x == l ? S : x) == S, Oe = (G = G == l ? S : G) == S, pe = x == G;
235
- if (pe && Ke(u)) {
236
- if (!Ke(y))
220
+ function Ft(e, t, r, a, b) {
221
+ return e === t || (e == null || t == null || !ve(e) && !ve(t) ? e != e && t != t : function(l, y, _, L, g, k) {
222
+ var $ = Ne(l), D = Ne(y), I = $ ? v : K(l), G = D ? v : K(y), de = (I = I == u ? M : I) == M, Fe = (G = G == u ? M : G) == M, fe = I == G;
223
+ if (fe && Je(l)) {
224
+ if (!Je(y))
237
225
  return !1;
238
- T = !0, fe = !1;
226
+ $ = !0, de = !1;
239
227
  }
240
- if (pe && !fe)
241
- return k || (k = new J()), T || Lt(u) ? Ot(u, y, _, L, g, k) : function(m, p, Re, Q, Qe, A, Z) {
242
- switch (Re) {
228
+ if (fe && !de)
229
+ return k || (k = new J()), $ || qt(l) ? zt(l, y, _, L, g, k) : function(m, p, ze, X, Ke, A, Z) {
230
+ switch (ze) {
243
231
  case V:
244
232
  if (m.byteLength != p.byteLength || m.byteOffset != p.byteOffset)
245
233
  return !1;
246
234
  m = m.buffer, p = p.buffer;
247
- case ue:
248
- return !(m.byteLength != p.byteLength || !A(new xt(m), new xt(p)));
235
+ case le:
236
+ return !(m.byteLength != p.byteLength || !A(new Ct(m), new Ct(p)));
249
237
  case F:
250
- case N:
251
- case se:
252
- return At(+m, +p);
238
+ case x:
239
+ case oe:
240
+ return Rt(+m, +p);
253
241
  case P:
254
242
  return m.name == p.name && m.message == p.message;
255
- case le:
243
+ case ce:
256
244
  case j:
257
245
  return m == p + "";
258
- case M:
259
- var X = ir;
246
+ case S:
247
+ var Y = or;
260
248
  case O:
261
- var ge = Q & a;
262
- if (X || (X = or), m.size != p.size && !ge)
249
+ var _e = X & i;
250
+ if (Y || (Y = sr), m.size != p.size && !_e)
263
251
  return !1;
264
- var Ae = Z.get(m);
265
- if (Ae)
266
- return Ae == p;
267
- Q |= c, Z.set(m, p);
268
- var Xe = Ot(X(m), X(p), Q, Qe, A, Z);
252
+ var Oe = Z.get(m);
253
+ if (Oe)
254
+ return Oe == p;
255
+ X |= c, Z.set(m, p);
256
+ var Xe = zt(Y(m), Y(p), X, Ke, A, Z);
269
257
  return Z.delete(m), Xe;
270
258
  case w:
271
- if (Je)
272
- return Je.call(m) == Je.call(p);
259
+ if (We)
260
+ return We.call(m) == We.call(p);
273
261
  }
274
262
  return !1;
275
- }(u, y, x, _, L, g, k);
276
- if (!(_ & a)) {
277
- var _e = fe && $.call(u, "__wrapped__"), Pt = Oe && $.call(y, "__wrapped__");
278
- if (_e || Pt) {
279
- var xr = _e ? u.value() : u, Ir = Pt ? y.value() : y;
280
- return k || (k = new J()), g(xr, Ir, _, L, k);
263
+ }(l, y, I, _, L, g, k);
264
+ if (!(_ & i)) {
265
+ var ye = de && T.call(l, "__wrapped__"), Lt = Fe && T.call(y, "__wrapped__");
266
+ if (ye || Lt) {
267
+ var xr = ye ? l.value() : l, Er = Lt ? y.value() : y;
268
+ return k || (k = new J()), g(xr, Er, _, L, k);
281
269
  }
282
270
  }
283
- return pe ? (k || (k = new J()), function(m, p, Re, Q, Qe, A) {
284
- var Z = Re & a, X = Rt(m), ge = X.length, Ae = Rt(p), Xe = Ae.length;
285
- if (ge != Xe && !Z)
271
+ return fe ? (k || (k = new J()), function(m, p, ze, X, Ke, A) {
272
+ var Z = ze & i, Y = Ot(m), _e = Y.length, Oe = Ot(p), Xe = Oe.length;
273
+ if (_e != Xe && !Z)
286
274
  return !1;
287
- for (var Me = ge; Me--; ) {
288
- var ie = X[Me];
289
- if (!(Z ? ie in p : $.call(p, ie)))
275
+ for (var Re = _e; Re--; ) {
276
+ var ie = Y[Re];
277
+ if (!(Z ? ie in p : T.call(p, ie)))
290
278
  return !1;
291
279
  }
292
- var $t = A.get(m);
293
- if ($t && A.get(p))
294
- return $t == p;
295
- var Se = !0;
280
+ var Pt = A.get(m);
281
+ if (Pt && A.get(p))
282
+ return Pt == p;
283
+ var Ae = !0;
296
284
  A.set(m, p), A.set(p, m);
297
- for (var Ye = Z; ++Me < ge; ) {
298
- var qe = m[ie = X[Me]], Le = p[ie];
299
- if (Q)
300
- var Tt = Z ? Q(Le, qe, ie, p, m, A) : Q(qe, Le, ie, m, p, A);
301
- if (!(Tt === void 0 ? qe === Le || Qe(qe, Le, Re, Q, A) : Tt)) {
302
- Se = !1;
285
+ for (var Ye = Z; ++Re < _e; ) {
286
+ var Se = m[ie = Y[Re]], Me = p[ie];
287
+ if (X)
288
+ var Tt = Z ? X(Me, Se, ie, p, m, A) : X(Se, Me, ie, m, p, A);
289
+ if (!(Tt === void 0 ? Se === Me || Ke(Se, Me, ze, X, A) : Tt)) {
290
+ Ae = !1;
303
291
  break;
304
292
  }
305
293
  Ye || (Ye = ie == "constructor");
306
294
  }
307
- if (Se && !Ye) {
308
- var Pe = m.constructor, $e = p.constructor;
309
- Pe == $e || !("constructor" in m) || !("constructor" in p) || typeof Pe == "function" && Pe instanceof Pe && typeof $e == "function" && $e instanceof $e || (Se = !1);
295
+ if (Ae && !Ye) {
296
+ var qe = m.constructor, Le = p.constructor;
297
+ qe == Le || !("constructor" in m) || !("constructor" in p) || typeof qe == "function" && qe instanceof qe && typeof Le == "function" && Le instanceof Le || (Ae = !1);
310
298
  }
311
- return A.delete(m), A.delete(p), Se;
312
- }(u, y, _, L, g, k)) : !1;
313
- }(e, t, r, s, zt, b));
314
- }
315
- function _r(e) {
316
- return !(!qt(e) || function(t) {
317
- return !!jt && jt in t;
318
- }(e)) && (Mt(e) ? lr : D).test(ae(e));
299
+ return A.delete(m), A.delete(p), Ae;
300
+ }(l, y, _, L, g, k)) : !1;
301
+ }(e, t, r, a, Ft, b));
319
302
  }
320
303
  function gr(e) {
321
- if (r = (t = e) && t.constructor, s = typeof r == "function" && r.prototype || xe, t !== s)
322
- return fr(e);
323
- var t, r, s, b = [];
324
- for (var u in Object(e))
325
- $.call(e, u) && u != "constructor" && b.push(u);
304
+ return !(!Mt(e) || function(t) {
305
+ return !!kt && kt in t;
306
+ }(e)) && (At(e) ? ur : H).test(ae(e));
307
+ }
308
+ function kr(e) {
309
+ if (r = (t = e) && t.constructor, a = typeof r == "function" && r.prototype || we, t !== a)
310
+ return pr(e);
311
+ var t, r, a, b = [];
312
+ for (var l in Object(e))
313
+ T.call(e, l) && l != "constructor" && b.push(l);
326
314
  return b;
327
315
  }
328
- function Ot(e, t, r, s, b, u) {
329
- var y = r & a, _ = e.length, L = t.length;
316
+ function zt(e, t, r, a, b, l) {
317
+ var y = r & i, _ = e.length, L = t.length;
330
318
  if (_ != L && !(y && L > _))
331
319
  return !1;
332
- var g = u.get(e);
333
- if (g && u.get(t))
320
+ var g = l.get(e);
321
+ if (g && l.get(t))
334
322
  return g == t;
335
- var k = -1, T = !0, U = r & c ? new Ne() : void 0;
336
- for (u.set(e, t), u.set(t, e); ++k < _; ) {
337
- var x = e[k], G = t[k];
338
- if (s)
339
- var fe = y ? s(G, x, k, t, e, u) : s(x, G, k, e, t, u);
340
- if (fe !== void 0) {
341
- if (fe)
323
+ var k = -1, $ = !0, D = r & c ? new Ie() : void 0;
324
+ for (l.set(e, t), l.set(t, e); ++k < _; ) {
325
+ var I = e[k], G = t[k];
326
+ if (a)
327
+ var de = y ? a(G, I, k, t, e, l) : a(I, G, k, e, t, l);
328
+ if (de !== void 0) {
329
+ if (de)
342
330
  continue;
343
- T = !1;
331
+ $ = !1;
344
332
  break;
345
333
  }
346
- if (U) {
347
- if (!ar(t, function(Oe, pe) {
348
- if (_e = pe, !U.has(_e) && (x === Oe || b(x, Oe, r, s, u)))
349
- return U.push(pe);
350
- var _e;
334
+ if (D) {
335
+ if (!ir(t, function(Fe, fe) {
336
+ if (ye = fe, !D.has(ye) && (I === Fe || b(I, Fe, r, a, l)))
337
+ return D.push(fe);
338
+ var ye;
351
339
  })) {
352
- T = !1;
340
+ $ = !1;
353
341
  break;
354
342
  }
355
- } else if (x !== G && !b(x, G, r, s, u)) {
356
- T = !1;
343
+ } else if (I !== G && !b(I, G, r, a, l)) {
344
+ $ = !1;
357
345
  break;
358
346
  }
359
347
  }
360
- return u.delete(e), u.delete(t), T;
348
+ return l.delete(e), l.delete(t), $;
361
349
  }
362
- function Rt(e) {
363
- return function(t, r, s) {
350
+ function Ot(e) {
351
+ return function(t, r, a) {
364
352
  var b = r(t);
365
- return ze(t) ? b : function(u, y) {
366
- for (var _ = -1, L = y.length, g = u.length; ++_ < L; )
367
- u[g + _] = y[_];
368
- return u;
369
- }(b, s(t));
370
- }(e, Cr, kr);
353
+ return Ne(t) ? b : function(l, y) {
354
+ for (var _ = -1, L = y.length, g = l.length; ++_ < L; )
355
+ l[g + _] = y[_];
356
+ return l;
357
+ }(b, a(t));
358
+ }(e, Ir, jr);
371
359
  }
372
- function Fe(e, t) {
373
- var r, s, b = e.__data__;
374
- return ((s = typeof (r = t)) == "string" || s == "number" || s == "symbol" || s == "boolean" ? r !== "__proto__" : r === null) ? b[typeof t == "string" ? "string" : "hash"] : b.map;
360
+ function Ee(e, t) {
361
+ var r, a, b = e.__data__;
362
+ return ((a = typeof (r = t)) == "string" || a == "number" || a == "symbol" || a == "boolean" ? r !== "__proto__" : r === null) ? b[typeof t == "string" ? "string" : "hash"] : b.map;
375
363
  }
376
- function de(e, t) {
377
- var r = function(s, b) {
378
- return s?.[b];
364
+ function ue(e, t) {
365
+ var r = function(a, b) {
366
+ return a?.[b];
379
367
  }(e, t);
380
- return _r(r) ? r : void 0;
368
+ return gr(r) ? r : void 0;
381
369
  }
382
370
  re.prototype.clear = function() {
383
- this.__data__ = be ? be(null) : {}, this.size = 0;
371
+ this.__data__ = me ? me(null) : {}, this.size = 0;
384
372
  }, re.prototype.delete = function(e) {
385
373
  var t = this.has(e) && delete this.__data__[e];
386
374
  return this.size -= t ? 1 : 0, t;
387
375
  }, re.prototype.get = function(e) {
388
376
  var t = this.__data__;
389
- if (be) {
377
+ if (me) {
390
378
  var r = t[e];
391
- return r === i ? void 0 : r;
379
+ return r === s ? void 0 : r;
392
380
  }
393
- return $.call(t, e) ? t[e] : void 0;
381
+ return T.call(t, e) ? t[e] : void 0;
394
382
  }, re.prototype.has = function(e) {
395
383
  var t = this.__data__;
396
- return be ? t[e] !== void 0 : $.call(t, e);
384
+ return me ? t[e] !== void 0 : T.call(t, e);
397
385
  }, re.prototype.set = function(e, t) {
398
386
  var r = this.__data__;
399
- return this.size += this.has(e) ? 0 : 1, r[e] = be && t === void 0 ? i : t, this;
400
- }, H.prototype.clear = function() {
387
+ return this.size += this.has(e) ? 0 : 1, r[e] = me && t === void 0 ? s : t, this;
388
+ }, U.prototype.clear = function() {
401
389
  this.__data__ = [], this.size = 0;
402
- }, H.prototype.delete = function(e) {
403
- var t = this.__data__, r = Ee(t, e);
404
- return !(r < 0) && (r == t.length - 1 ? t.pop() : ur.call(t, r, 1), --this.size, !0);
405
- }, H.prototype.get = function(e) {
406
- var t = this.__data__, r = Ee(t, e);
390
+ }, U.prototype.delete = function(e) {
391
+ var t = this.__data__, r = xe(t, e);
392
+ return !(r < 0) && (r == t.length - 1 ? t.pop() : dr.call(t, r, 1), --this.size, !0);
393
+ }, U.prototype.get = function(e) {
394
+ var t = this.__data__, r = xe(t, e);
407
395
  return r < 0 ? void 0 : t[r][1];
408
- }, H.prototype.has = function(e) {
409
- return Ee(this.__data__, e) > -1;
410
- }, H.prototype.set = function(e, t) {
411
- var r = this.__data__, s = Ee(r, e);
412
- return s < 0 ? (++this.size, r.push([e, t])) : r[s][1] = t, this;
396
+ }, U.prototype.has = function(e) {
397
+ return xe(this.__data__, e) > -1;
398
+ }, U.prototype.set = function(e, t) {
399
+ var r = this.__data__, a = xe(r, e);
400
+ return a < 0 ? (++this.size, r.push([e, t])) : r[a][1] = t, this;
413
401
  }, ne.prototype.clear = function() {
414
- this.size = 0, this.__data__ = { hash: new re(), map: new (me || H)(), string: new re() };
402
+ this.size = 0, this.__data__ = { hash: new re(), map: new (he || U)(), string: new re() };
415
403
  }, ne.prototype.delete = function(e) {
416
- var t = Fe(this, e).delete(e);
404
+ var t = Ee(this, e).delete(e);
417
405
  return this.size -= t ? 1 : 0, t;
418
406
  }, ne.prototype.get = function(e) {
419
- return Fe(this, e).get(e);
407
+ return Ee(this, e).get(e);
420
408
  }, ne.prototype.has = function(e) {
421
- return Fe(this, e).has(e);
409
+ return Ee(this, e).has(e);
422
410
  }, ne.prototype.set = function(e, t) {
423
- var r = Fe(this, e), s = r.size;
424
- return r.set(e, t), this.size += r.size == s ? 0 : 1, this;
425
- }, Ne.prototype.add = Ne.prototype.push = function(e) {
426
- return this.__data__.set(e, i), this;
427
- }, Ne.prototype.has = function(e) {
411
+ var r = Ee(this, e), a = r.size;
412
+ return r.set(e, t), this.size += r.size == a ? 0 : 1, this;
413
+ }, Ie.prototype.add = Ie.prototype.push = function(e) {
414
+ return this.__data__.set(e, s), this;
415
+ }, Ie.prototype.has = function(e) {
428
416
  return this.__data__.has(e);
429
417
  }, J.prototype.clear = function() {
430
- this.__data__ = new H(), this.size = 0;
418
+ this.__data__ = new U(), this.size = 0;
431
419
  }, J.prototype.delete = function(e) {
432
420
  var t = this.__data__, r = t.delete(e);
433
421
  return this.size = t.size, r;
@@ -437,34 +425,34 @@ var nt = { exports: {} };
437
425
  return this.__data__.has(e);
438
426
  }, J.prototype.set = function(e, t) {
439
427
  var r = this.__data__;
440
- if (r instanceof H) {
441
- var s = r.__data__;
442
- if (!me || s.length < 199)
443
- return s.push([e, t]), this.size = ++r.size, this;
444
- r = this.__data__ = new ne(s);
428
+ if (r instanceof U) {
429
+ var a = r.__data__;
430
+ if (!he || a.length < 199)
431
+ return a.push([e, t]), this.size = ++r.size, this;
432
+ r = this.__data__ = new ne(a);
445
433
  }
446
434
  return r.set(e, t), this.size = r.size, this;
447
435
  };
448
- var kr = Nt ? function(e) {
436
+ var jr = xt ? function(e) {
449
437
  return e == null ? [] : (e = Object(e), function(t, r) {
450
- for (var s = -1, b = t == null ? 0 : t.length, u = 0, y = []; ++s < b; ) {
451
- var _ = t[s];
452
- r(_, s, t) && (y[u++] = _);
438
+ for (var a = -1, b = t == null ? 0 : t.length, l = 0, y = []; ++a < b; ) {
439
+ var _ = t[a];
440
+ r(_, a, t) && (y[l++] = _);
453
441
  }
454
442
  return y;
455
- }(Nt(e), function(t) {
443
+ }(xt(e), function(t) {
456
444
  return It.call(e, t);
457
445
  }));
458
446
  } : function() {
459
447
  return [];
460
- }, K = ve;
461
- function jr(e, t) {
462
- return !!(t = t ?? d) && (typeof e == "number" || Ve.test(e)) && e > -1 && e % 1 == 0 && e < t;
448
+ }, K = be;
449
+ function wr(e, t) {
450
+ return !!(t = t ?? d) && (typeof e == "number" || Be.test(e)) && e > -1 && e % 1 == 0 && e < t;
463
451
  }
464
452
  function ae(e) {
465
453
  if (e != null) {
466
454
  try {
467
- return kt.call(e);
455
+ return gt.call(e);
468
456
  } catch {
469
457
  }
470
458
  try {
@@ -474,81 +462,81 @@ var nt = { exports: {} };
474
462
  }
475
463
  return "";
476
464
  }
477
- function At(e, t) {
465
+ function Rt(e, t) {
478
466
  return e === t || e != e && t != t;
479
467
  }
480
- (Ue && K(new Ue(new ArrayBuffer(1))) != V || me && K(new me()) != M || Ge && K(Ge.resolve()) != Y || Ze && K(new Ze()) != O || We && K(new We()) != B) && (K = function(e) {
481
- var t = ve(e), r = t == S ? e.constructor : void 0, s = r ? ae(r) : "";
482
- if (s)
483
- switch (s) {
484
- case pr:
485
- return V;
468
+ (Ue && K(new Ue(new ArrayBuffer(1))) != V || he && K(new he()) != S || De && K(De.resolve()) != Q || Ge && K(new Ge()) != O || Ze && K(new Ze()) != B) && (K = function(e) {
469
+ var t = be(e), r = t == M ? e.constructor : void 0, a = r ? ae(r) : "";
470
+ if (a)
471
+ switch (a) {
486
472
  case hr:
487
- return M;
473
+ return V;
488
474
  case mr:
489
- return Y;
475
+ return S;
490
476
  case br:
491
- return O;
477
+ return Q;
492
478
  case vr:
479
+ return O;
480
+ case yr:
493
481
  return B;
494
482
  }
495
483
  return t;
496
484
  });
497
- var wr = Ft(function() {
485
+ var Cr = Nt(function() {
498
486
  return arguments;
499
- }()) ? Ft : function(e) {
500
- return ye(e) && $.call(e, "callee") && !It.call(e, "callee");
501
- }, ze = Array.isArray, Ke = dr || function() {
487
+ }()) ? Nt : function(e) {
488
+ return ve(e) && T.call(e, "callee") && !It.call(e, "callee");
489
+ }, Ne = Array.isArray, Je = fr || function() {
502
490
  return !1;
503
491
  };
504
- function Mt(e) {
505
- if (!qt(e))
492
+ function At(e) {
493
+ if (!Mt(e))
506
494
  return !1;
507
- var t = ve(e);
508
- return t == E || t == z || t == C || t == ce;
495
+ var t = be(e);
496
+ return t == E || t == z || t == C || t == se;
509
497
  }
510
498
  function St(e) {
511
499
  return typeof e == "number" && e > -1 && e % 1 == 0 && e <= d;
512
500
  }
513
- function qt(e) {
501
+ function Mt(e) {
514
502
  var t = typeof e;
515
503
  return e != null && (t == "object" || t == "function");
516
504
  }
517
- function ye(e) {
505
+ function ve(e) {
518
506
  return e != null && typeof e == "object";
519
507
  }
520
- var Lt = vt ? function(e) {
508
+ var qt = bt ? function(e) {
521
509
  return function(t) {
522
510
  return e(t);
523
511
  };
524
- }(vt) : function(e) {
525
- return ye(e) && St(e.length) && !!f[ve(e)];
512
+ }(bt) : function(e) {
513
+ return ve(e) && St(e.length) && !!f[be(e)];
526
514
  };
527
- function Cr(e) {
528
- return (t = e) != null && St(t.length) && !Mt(t) ? yr(e) : gr(e);
515
+ function Ir(e) {
516
+ return (t = e) != null && St(t.length) && !At(t) ? _r(e) : kr(e);
529
517
  var t;
530
518
  }
531
519
  n.exports = function(e, t) {
532
- return zt(e, t);
520
+ return Ft(e, t);
533
521
  };
534
522
  })(nt, nt.exports);
535
- const Hr = Dr(nt.exports), Ur = ot(["flex", "gap-lg"], { variants: { orientation: { vertical: ["flex-col"], horizontal: [] } } }), Gr = I(({ name: n, value: o, defaultValue: i, className: a, intent: c, orientation: d = "vertical", onCheckedChange: l, children: v, ...C }, F) => {
536
- const [N, P] = function(O, j, w) {
537
- const R = O !== void 0, { current: B } = tt(R ? O : j), [ue, V] = Ht(j), D = R ? O : ue, Ve = et((f, Ce = (ee, q) => !Hr(ee, q)) => {
538
- const ee = typeof f != "function" ? f : f(D);
539
- Ce(D, ee) && !R && V(ee), w && w(ee);
540
- }, [R, D]);
541
- return [D, Ve, R, B];
542
- }(o, i), E = ft(), z = tt(l), { id: M, labelId: se, description: W, isInvalid: S, isRequired: Y } = E, ce = n ?? E.name, le = Ut(() => ({ id: M, name: ce, value: N, intent: c, isInvalid: S, description: W, isRequired: Y, onCheckedChange: (O, j) => {
543
- const w = N || [], R = O ? [...w, j] : w.filter((B) => B !== j);
523
+ const Vr = Br(nt.exports), Hr = it(["flex", "gap-lg"], { variants: { orientation: { vertical: ["flex-col"], horizontal: [] } } }), Ur = N(({ name: n, value: o, defaultValue: s, className: i, intent: c, orientation: d = "vertical", onCheckedChange: u, children: v, ...C }, F) => {
524
+ const [x, P] = function(O, j, w) {
525
+ const R = O !== void 0, { current: B } = tt(R ? O : j), [le, V] = Ut(j), H = R ? O : le, Be = et((f, je = (ee, q) => !Vr(ee, q)) => {
526
+ const ee = typeof f != "function" ? f : f(H);
527
+ je(H, ee) && !R && V(ee), w && w(ee);
528
+ }, [R, H]);
529
+ return [H, Be, R, B];
530
+ }(o, s), E = dt(), z = tt(u), { id: S, labelId: oe, description: W, isInvalid: M, isRequired: Q } = E, se = n ?? E.name, ce = Dt(() => ({ id: S, name: se, value: x, intent: c, isInvalid: M, description: W, isRequired: Q, onCheckedChange: (O, j) => {
531
+ const w = x || [], R = O ? [...w, j] : w.filter((B) => B !== j);
544
532
  P(R), z.current && z.current(R);
545
- } }), [M, ce, N, c, S, W, Y, P]);
546
- return at(() => {
547
- z.current = l;
548
- }, [l]), h.createElement(Xt.Provider, { value: le }, h.createElement("div", { ref: F, className: Ur({ className: a, orientation: d }), role: "group", "aria-labelledby": se, "aria-describedby": W, ...C }, v));
533
+ } }), [S, se, x, c, M, W, Q, P]);
534
+ return Ht(() => {
535
+ z.current = u;
536
+ }, [u]), h.createElement(Qt.Provider, { value: ce }, h.createElement("div", { ref: F, className: Hr({ className: i, orientation: d }), role: "group", "aria-labelledby": oe, "aria-describedby": W, ...C }, v));
549
537
  });
550
- Gr.displayName = "CheckboxGroup";
538
+ Ur.displayName = "CheckboxGroup";
551
539
  export {
552
- Vr as Checkbox,
553
- Gr as CheckboxGroup
540
+ $r as Checkbox,
541
+ Ur as CheckboxGroup
554
542
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spark-ui/checkbox",
3
- "version": "1.15.3",
3
+ "version": "1.15.5",
4
4
  "description": "A control that allows the user to toggle between checked and not checked.",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -17,7 +17,7 @@
17
17
  "@spark-ui/icon": "^1.7.4",
18
18
  "@spark-ui/icons": "^1.15.0",
19
19
  "@spark-ui/internal-utils": "^1.6.1",
20
- "@spark-ui/label": "^1.2.3",
20
+ "@spark-ui/label": "^1.4.0",
21
21
  "@spark-ui/use-merge-refs": "^0.3.4",
22
22
  "class-variance-authority": "0.5.2"
23
23
  },
@@ -36,5 +36,5 @@
36
36
  },
37
37
  "homepage": "https://sparkui.vercel.app",
38
38
  "license": "MIT",
39
- "gitHead": "cf57bd12f1267bbe7131c630e861cd691b150b2a"
39
+ "gitHead": "aaeeedcf67bfb0bd08a02ebfb53af4742233ac3b"
40
40
  }