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