@spark-ui/chip
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -6,2 +6,9 @@ # Change Log | ||
## [1.1.1](https://github.com/adevinta/spark/compare/@spark-ui/chip@1.1.0...@spark-ui/chip@1.1.1) (2023-09-29) | ||
### Bug Fixes | ||
- **chip:** doc ([be9df15](https://github.com/adevinta/spark/commit/be9df157b3b19dbfc6d09e506e43afa95cac64a3)) | ||
- doc ([5506203](https://github.com/adevinta/spark/commit/55062039dc67c3532be42a4661540052094163d9)) | ||
# [1.1.0](https://github.com/adevinta/spark/compare/@spark-ui/chip@1.0.1...@spark-ui/chip@1.1.0) (2023-09-28) | ||
@@ -8,0 +15,0 @@ |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react"),a=require("@spark-ui/internal-utils"),Y=require("class-variance-authority"),jt=require("@spark-ui/slot"),Ct=require("emulate-tab"),sn=require("@spark-ui/icon"),on=[{design:"outlined",intent:"main",class:a.tw(["enabled:hover:bg-main/dim-5","enabled:active:bg-main/dim-5","focus-visible:bg-main/dim-5","aria-pressed:bg-main-container aria-pressed:text-on-main-container aria-pressed:enabled:hover:bg-main-container/dim-1","text-main"])},{design:"outlined",intent:"support",class:a.tw(["enabled:hover:bg-support/dim-5","enabled:active:bg-support/dim-5","focus-visible:bg-support/dim-5","aria-pressed:bg-support-container aria-pressed:text-on-support-container aria-pressed:enabled:hover:bg-support-container/dim-1","text-support"])},{design:"outlined",intent:"basic",class:a.tw(["enabled:hover:bg-basic/dim-5","enabled:active:bg-basic/dim-5","focus-visible:bg-basic/dim-5","aria-pressed:bg-basic-container aria-pressed:text-on-basic-container aria-pressed:enabled:hover:bg-basic-container/dim-1","text-basic"])},{intent:"accent",design:"outlined",class:a.tw(["enabled:hover:bg-accent/dim-5","enabled:active:bg-accent/dim-5","focus-visible:bg-accent/dim-5","aria-pressed:bg-accent-container","aria-pressed:bg-accent-container aria-pressed:text-on-accent-container aria-pressed:enabled:hover:bg-accent-container/dim-1","text-accent"])},{design:"outlined",intent:"success",class:a.tw(["enabled:hover:bg-success/dim-5","enabled:active:bg-success/dim-5","focus-visible:bg-success/dim-5","aria-pressed:bg-success-container aria-pressed:text-on-success-container aria-pressed:enabled:hover:bg-success-container/dim-1","text-success"])},{intent:"alert",design:"outlined",class:a.tw(["enabled:hover:bg-alert/dim-5","enabled:active:bg-alert/dim-5","focus-visible:bg-alert/dim-5","aria-pressed:bg-alert-container aria-pressed:text-on-alert-container aria-pressed:enabled:hover:bg-alert-container/dim-1","text-alert"])},{design:"outlined",intent:"danger",class:a.tw(["enabled:hover:bg-error/dim-5","enabled:active:bg-error/dim-5","focus-visible:bg-error/dim-5","aria-pressed:bg-error-container aria-pressed:text-on-error-container aria-pressed:enabled:hover:bg-error-container/dim-1","text-error"])},{design:"outlined",intent:"info",class:a.tw(["enabled:hover:bg-info/dim-5","enabled:active:bg-info/dim-5","focus-visible:bg-info/dim-5","aria-pressed:bg-info-container aria-pressed:text-on-info-container aria-pressed:enabled:hover:bg-info-container/dim-1","text-info"])},{design:"outlined",intent:"neutral",class:a.tw(["enabled:hover:bg-neutral/dim-5","enabled:active:bg-neutral/dim-5","focus-visible:bg-neutral/dim-5","aria-pressed:bg-neutral-container aria-pressed:text-on-neutral-container aria-pressed:enabled:hover:bg-neutral-container/dim-1","text-neutral"])},{design:"outlined",intent:"surface",class:a.tw(["enabled:hover:bg-surface/dim-5","enabled:active:bg-surface/dim-5","focus-visible:bg-surface/dim-5","aria-pressed:bg-surface aria-pressed:text-on-surface aria-pressed:enabled:hover:bg-surface-hovered","text-surface"])},{design:"outlined",hasClearButton:!1,class:a.tw(["px-md"])},{design:"outlined",hasClearButton:!0,class:a.tw(["pl-md"])}],cn=[{intent:"main",design:"tinted",class:a.tw(["bg-main-container","enabled:hover:bg-main-container-hovered","enabled:active:bg-main-container-pressed","focus-visible:bg-main-container-focused","aria-pressed:bg-main aria-pressed:text-on-main aria-pressed:enabled:hover:bg-main/dim-1","text-on-main-container"])},{intent:"support",design:"tinted",class:a.tw(["bg-support-container","enabled:hover:bg-support-container-hovered","enabled:active:bg-support-container-pressed","focus-visible:bg-support-container-focused","aria-pressed:bg-support aria-pressed:text-on-support aria-pressed:enabled:hover:bg-support/dim-1","text-on-support-container"])},{intent:"basic",design:"tinted",class:a.tw(["bg-basic-container","enabled:hover:bg-basic-container-hovered","enabled:active:bg-basic-container-pressed","focus-visible:bg-basic-container-focused","aria-pressed:bg-basic aria-pressed:text-on-basic aria-pressed:enabled:hover:bg-basic/dim-1","text-on-basic-container"])},{intent:"accent",design:"tinted",class:a.tw(["bg-accent-container","enabled:hover:bg-accent-container-hovered","enabled:active:bg-accent-container-pressed","focus-visible:bg-accent-container-focused","aria-pressed:bg-accent aria-pressed:text-on-accent aria-pressed:enabled:hover:bg-accent/dim-1","text-on-accent-container"])},{intent:"success",design:"tinted",class:a.tw(["bg-success-container","enabled:hover:bg-success-container-hovered","enabled:active:bg-success-container-pressed","focus-visible:bg-success-container-focused","aria-pressed:bg-success aria-pressed:text-on-success aria-pressed:enabled:hover:bg-success/dim-1","text-on-success-container"])},{intent:"alert",design:"tinted",class:a.tw(["bg-alert-container","enabled:hover:bg-alert-container-hovered","enabled:active:bg-alert-container-pressed","focus-visible:bg-alert-container-focused","aria-pressed:bg-alert aria-pressed:text-on-alert aria-pressed:enabled:hover:bg-alert/dim-1","text-on-alert-container"])},{intent:"danger",design:"tinted",class:a.tw(["bg-error-container","enabled:hover:bg-error-container-hovered","enabled:active:bg-error-container-pressed","focus-visible:bg-error-container-focused","aria-pressed:bg-error aria-pressed:text-on-error aria-pressed:enabled:hover:bg-error/dim-1","text-on-error-container"])},{intent:"info",design:"tinted",class:a.tw(["bg-info-container","enabled:hover:bg-info-container-hovered","enabled:active:bg-info-container-pressed","focus-visible:bg-info-container-focused","aria-pressed:bg-info aria-pressed:text-on-info aria-pressed:enabled:hover:bg-info/dim-1","text-on-info-container"])},{intent:"neutral",design:"tinted",class:a.tw(["bg-neutral-container","enabled:hover:bg-neutral-container-hovered","enabled:active:bg-neutral-container-pressed","focus-visible:bg-neutral-container-focused","aria-pressed:bg-neutral aria-pressed:text-on-neutral aria-pressed:enabled:hover:bg-neutral/dim-1","text-on-neutral-container"])},{intent:"surface",design:"tinted",class:a.tw(["bg-surface/dim-1","enabled:hover:bg-surface-hovered/dim-1","enabled:active:bg-surface-pressed/dim-1","focus-visible:bg-surface-focused/dim-1","aria-pressed:bg-surface aria-pressed:text-on-surface aria-pressed:enabled:hover:bg-surface-hovered","text-on-surface/dim-1"])},{design:"tinted",hasClearButton:!1,class:a.tw(["px-md"])},{design:"tinted",hasClearButton:!0,class:a.tw(["pl-md"])}],dn=[{intent:"main",design:"dashed",class:a.tw(["enabled:hover:bg-main/dim-5","enabled:active:bg-main/dim-5","focus-visible:bg-main/dim-5","aria-pressed:bg-main-container aria-pressed:text-on-main-container aria-pressed:enabled:hover:bg-main-container/dim-1","text-main"])},{intent:"support",design:"dashed",class:a.tw(["enabled:hover:bg-support/dim-5","enabled:active:bg-support/dim-5","focus-visible:bg-support/dim-5","aria-pressed:bg-support-container aria-pressed:text-on-support-container aria-pressed:enabled:hover:bg-support-container/dim-1","text-support"])},{intent:"basic",design:"dashed",class:a.tw(["enabled:hover:bg-basic/dim-5","enabled:active:bg-basic/dim-5","focus-visible:bg-basic/dim-5","aria-pressed:bg-basic-container aria-pressed:text-on-basic-container aria-pressed:enabled:hover:bg-basic-container/dim-1","text-basic"])},{intent:"accent",design:"dashed",class:a.tw(["enabled:hover:bg-accent/dim-5","enabled:active:bg-accent/dim-5","focus-visible:bg-accent/dim-5","aria-pressed:bg-accent-container aria-pressed:text-on-accent-container aria-pressed:enabled:hover:bg-accent-container/dim-1","text-accent"])},{intent:"success",design:"dashed",class:a.tw(["enabled:hover:bg-success/dim-5","enabled:active:bg-success/dim-5","focus-visible:bg-success/dim-5","aria-pressed:bg-success-container aria-pressed:text-on-success-container aria-pressed:enabled:hover:bg-success-container/dim-1","text-success"])},{intent:"alert",design:"dashed",class:a.tw(["enabled:hover:bg-alert/dim-5","enabled:active:bg-alert/dim-5","focus-visible:bg-alert/dim-5","aria-pressed:bg-alert-container aria-pressed:text-on-alert-container aria-pressed:enabled:hover:bg-alert-container/dim-1","text-alert"])},{intent:"danger",design:"dashed",class:a.tw(["enabled:hover:bg-error/dim-5","enabled:active:bg-error/dim-5","focus-visible:bg-error/dim-5","aria-pressed:bg-error-container aria-pressed:text-on-error-container aria-pressed:enabled:hover:bg-error-container/dim-1","text-error"])},{intent:"info",design:"dashed",class:a.tw(["enabled:hover:bg-info/dim-5","enabled:active:bg-info/dim-5","focus-visible:bg-info/dim-5","aria-pressed:bg-info-container aria-pressed:text-on-info-container aria-pressed:enabled:hover:bg-info-container/dim-1","text-info"])},{intent:"neutral",design:"dashed",class:a.tw(["enabled:hover:bg-neutral/dim-5","enabled:active:bg-neutral/dim-5","focus-visible:bg-neutral/dim-5","aria-pressed:bg-neutral-container aria-pressed:text-on-neutral-container aria-pressed:enabled:hover:bg-neutral-container/dim-1","text-neutral"])},{intent:"surface",design:"dashed",class:a.tw(["enabled:hover:bg-surface/dim-5","enabled:active:bg-surface/dim-5","focus-visible:bg-surface/dim-5","aria-pressed:bg-surface aria-pressed:text-on-surface aria-pressed:enabled:hover:bg-surface-hovered","text-surface"])},{design:"dashed",hasClearButton:!1,class:a.tw(["px-[calc(var(--spacing-md)-var(--border-width-sm))]"])},{design:"dashed",hasClearButton:!0,class:a.tw(["pl-[calc(var(--spacing-md)-var(--border-width-sm))]"])}],ln=Y.cva(["box-border inline-flex h-sz-32 flex-nowrap items-center justify-center rounded-md text-body-1 font-regular","max-w-sz-240 focus-visible:outline-none focus-visible:u-ring-inset","ease-out duration-150"],{variants:{design:a.makeVariants({outlined:["bg-transparent ring-1 ring-current"],tinted:[""],dashed:["bg-transparent border-sm border-dashed shadow-none focus-visible:border-outline-high"]}),intent:a.makeVariants({main:[],support:[],basic:[],accent:[],success:[],alert:[],danger:[],info:[],neutral:[],surface:[]}),disabled:{true:["cursor-not-allowed","opacity-dim-3"]},hasClearButton:{true:[],false:[]}},compoundVariants:[...on,...cn,...dn],defaultVariants:{design:"outlined",intent:"basic"}}),kt=o.createContext({});var Ae=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function un(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Ze={exports:{}};(function(i,l){var p="__lodash_hash_undefined__",v=1,_=2,j=9007199254740991,C="[object Arguments]",w="[object Array]",O="[object AsyncFunction]",y="[object Boolean]",A="[object Date]",N="[object Error]",z="[object Function]",P="[object GeneratorFunction]",$="[object Map]",T="[object Number]",L="[object Null]",q="[object Object]",ie="[object Promise]",be="[object Proxy]",k="[object RegExp]",ee="[object Set]",pe="[object String]",Ie="[object Symbol]",fe="[object Undefined]",Se="[object WeakMap]",We="[object ArrayBuffer]",ge="[object DataView]",St=/^\[object .+?Constructor\]$/,Pt=/^(?:0|[1-9]\d*)$/,u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u[C]=u[w]=u[We]=u[y]=u[ge]=u[A]=u[N]=u[z]=u[$]=u[T]=u[q]=u[k]=u[ee]=u[pe]=u[Se]=!1;var Ge=typeof Ae=="object"&&Ae&&Ae.Object===Object&&Ae,Tt=typeof self=="object"&&self&&self.Object===Object&&self,R=Ge||Tt||Function("return this")(),He=l&&!l.nodeType&&l,Je=He&&i&&!i.nodeType&&i,Qe=Je&&Je.exports===He,Pe=Qe&&Ge.process,Xe=function(){try{return Pe&&Pe.binding&&Pe.binding("util")}catch{}}(),Ye=Xe&&Xe.isTypedArray;function Lt(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function Rt(e){var t=-1,n=Array(e.size);return e.forEach(function(r,b){n[++t]=[b,r]}),n}function Vt(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var et,tt,nt,Dt=Array.prototype,Ft=Function.prototype,ve=Object.prototype,Te=R["__core-js_shared__"],rt=Ft.toString,I=ve.hasOwnProperty,at=(et=/[^.]+$/.exec(Te&&Te.keys&&Te.keys.IE_PROTO||""))?"Symbol(src)_1."+et:"",it=ve.toString,Mt=RegExp("^"+rt.call(I).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),st=Qe?R.Buffer:void 0,he=R.Symbol,ot=R.Uint8Array,ct=ve.propertyIsEnumerable,$t=Dt.splice,G=he?he.toStringTag:void 0,dt=Object.getOwnPropertySymbols,qt=st?st.isBuffer:void 0,Ut=(tt=Object.keys,nt=Object,function(e){return tt(nt(e))}),Le=te(R,"DataView"),se=te(R,"Map"),Re=te(R,"Promise"),Ve=te(R,"Set"),De=te(R,"WeakMap"),oe=te(Object,"create"),Zt=Q(Le),Kt=Q(se),Wt=Q(Re),Gt=Q(Ve),Ht=Q(De),lt=he?he.prototype:void 0,Fe=lt?lt.valueOf:void 0;function H(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function V(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function J(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function me(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new J;++t<n;)this.add(e[t])}function U(e){var t=this.__data__=new V(e);this.size=t.size}function Jt(e,t){var n=we(e),r=!n&&tn(e),b=!n&&!r&&Me(e),s=!n&&!r&&!b&&yt(e),f=n||r||b||s,g=f?function(m,S){for(var D=-1,x=Array(m);++D<m;)x[D]=S(D);return x}(e.length,String):[],B=g.length;for(var h in e)!t&&!I.call(e,h)||f&&(h=="length"||b&&(h=="offset"||h=="parent")||s&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||en(h,B))||g.push(h);return g}function ye(e,t){for(var n=e.length;n--;)if(gt(e[n][0],t))return n;return-1}function ce(e){return e==null?e===void 0?fe:L:G&&G in Object(e)?function(t){var n=I.call(t,G),r=t[G];try{t[G]=void 0;var b=!0}catch{}var s=it.call(t);return b&&(n?t[G]=r:delete t[G]),s}(e):function(t){return it.call(t)}(e)}function ut(e){return de(e)&&ce(e)==C}function bt(e,t,n,r,b){return e===t||(e==null||t==null||!de(e)&&!de(t)?e!=e&&t!=t:function(s,f,g,B,h,m){var S=we(s),D=we(f),x=S?w:Z(s),F=D?w:Z(f),ne=(x=x==C?q:x)==q,xe=(F=F==C?q:F)==q,re=x==F;if(re&&Me(s)){if(!Me(f))return!1;S=!0,ne=!1}if(re&&!ne)return m||(m=new U),S||yt(s)?pt(s,f,g,B,h,m):function(d,c,je,K,$e,E,M){switch(je){case ge:if(d.byteLength!=c.byteLength||d.byteOffset!=c.byteOffset)return!1;d=d.buffer,c=c.buffer;case We:return!(d.byteLength!=c.byteLength||!E(new ot(d),new ot(c)));case y:case A:case T:return gt(+d,+c);case N:return d.name==c.name&&d.message==c.message;case k:case pe:return d==c+"";case $:var W=Rt;case ee:var ue=K&v;if(W||(W=Vt),d.size!=c.size&&!ue)return!1;var Ce=M.get(d);if(Ce)return Ce==c;K|=_,M.set(d,c);var qe=pt(W(d),W(c),K,$e,E,M);return M.delete(d),qe;case Ie:if(Fe)return Fe.call(d)==Fe.call(c)}return!1}(s,f,x,g,B,h,m);if(!(g&v)){var le=ne&&I.call(s,"__wrapped__"),_t=xe&&I.call(f,"__wrapped__");if(le||_t){var rn=le?s.value():s,an=_t?f.value():f;return m||(m=new U),h(rn,an,g,B,m)}}return re?(m||(m=new U),function(d,c,je,K,$e,E){var M=je&v,W=ft(d),ue=W.length,Ce=ft(c),qe=Ce.length;if(ue!=qe&&!M)return!1;for(var Ne=ue;Ne--;){var X=W[Ne];if(!(M?X in c:I.call(c,X)))return!1}var wt=E.get(d);if(wt&&E.get(c))return wt==c;var ke=!0;E.set(d,c),E.set(c,d);for(var Ue=M;++Ne<ue;){var Ee=d[X=W[Ne]],Oe=c[X];if(K)var xt=M?K(Oe,Ee,X,c,d,E):K(Ee,Oe,X,d,c,E);if(!(xt===void 0?Ee===Oe||$e(Ee,Oe,je,K,E):xt)){ke=!1;break}Ue||(Ue=X=="constructor")}if(ke&&!Ue){var ze=d.constructor,Be=c.constructor;ze==Be||!("constructor"in d)||!("constructor"in c)||typeof ze=="function"&&ze instanceof ze&&typeof Be=="function"&&Be instanceof Be||(ke=!1)}return E.delete(d),E.delete(c),ke}(s,f,g,B,h,m)):!1}(e,t,n,r,bt,b))}function Qt(e){return!(!mt(e)||function(t){return!!at&&at in t}(e))&&(vt(e)?Mt:St).test(Q(e))}function Xt(e){if(n=(t=e)&&t.constructor,r=typeof n=="function"&&n.prototype||ve,t!==r)return Ut(e);var t,n,r,b=[];for(var s in Object(e))I.call(e,s)&&s!="constructor"&&b.push(s);return b}function pt(e,t,n,r,b,s){var f=n&v,g=e.length,B=t.length;if(g!=B&&!(f&&B>g))return!1;var h=s.get(e);if(h&&s.get(t))return h==t;var m=-1,S=!0,D=n&_?new me:void 0;for(s.set(e,t),s.set(t,e);++m<g;){var x=e[m],F=t[m];if(r)var ne=f?r(F,x,m,t,e,s):r(x,F,m,e,t,s);if(ne!==void 0){if(ne)continue;S=!1;break}if(D){if(!Lt(t,function(xe,re){if(le=re,!D.has(le)&&(x===xe||b(x,xe,n,r,s)))return D.push(re);var le})){S=!1;break}}else if(x!==F&&!b(x,F,n,r,s)){S=!1;break}}return s.delete(e),s.delete(t),S}function ft(e){return function(t,n,r){var b=n(t);return we(t)?b:function(s,f){for(var g=-1,B=f.length,h=s.length;++g<B;)s[h+g]=f[g];return s}(b,r(t))}(e,nn,Yt)}function _e(e,t){var n,r,b=e.__data__;return((r=typeof(n=t))=="string"||r=="number"||r=="symbol"||r=="boolean"?n!=="__proto__":n===null)?b[typeof t=="string"?"string":"hash"]:b.map}function te(e,t){var n=function(r,b){return r?.[b]}(e,t);return Qt(n)?n:void 0}H.prototype.clear=function(){this.__data__=oe?oe(null):{},this.size=0},H.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},H.prototype.get=function(e){var t=this.__data__;if(oe){var n=t[e];return n===p?void 0:n}return I.call(t,e)?t[e]:void 0},H.prototype.has=function(e){var t=this.__data__;return oe?t[e]!==void 0:I.call(t,e)},H.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=oe&&t===void 0?p:t,this},V.prototype.clear=function(){this.__data__=[],this.size=0},V.prototype.delete=function(e){var t=this.__data__,n=ye(t,e);return!(n<0)&&(n==t.length-1?t.pop():$t.call(t,n,1),--this.size,!0)},V.prototype.get=function(e){var t=this.__data__,n=ye(t,e);return n<0?void 0:t[n][1]},V.prototype.has=function(e){return ye(this.__data__,e)>-1},V.prototype.set=function(e,t){var n=this.__data__,r=ye(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},J.prototype.clear=function(){this.size=0,this.__data__={hash:new H,map:new(se||V),string:new H}},J.prototype.delete=function(e){var t=_e(this,e).delete(e);return this.size-=t?1:0,t},J.prototype.get=function(e){return _e(this,e).get(e)},J.prototype.has=function(e){return _e(this,e).has(e)},J.prototype.set=function(e,t){var n=_e(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},me.prototype.add=me.prototype.push=function(e){return this.__data__.set(e,p),this},me.prototype.has=function(e){return this.__data__.has(e)},U.prototype.clear=function(){this.__data__=new V,this.size=0},U.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},U.prototype.get=function(e){return this.__data__.get(e)},U.prototype.has=function(e){return this.__data__.has(e)},U.prototype.set=function(e,t){var n=this.__data__;if(n instanceof V){var r=n.__data__;if(!se||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new J(r)}return n.set(e,t),this.size=n.size,this};var Yt=dt?function(e){return e==null?[]:(e=Object(e),function(t,n){for(var r=-1,b=t==null?0:t.length,s=0,f=[];++r<b;){var g=t[r];n(g,r,t)&&(f[s++]=g)}return f}(dt(e),function(t){return ct.call(e,t)}))}:function(){return[]},Z=ce;function en(e,t){return!!(t=t??j)&&(typeof e=="number"||Pt.test(e))&&e>-1&&e%1==0&&e<t}function Q(e){if(e!=null){try{return rt.call(e)}catch{}try{return e+""}catch{}}return""}function gt(e,t){return e===t||e!=e&&t!=t}(Le&&Z(new Le(new ArrayBuffer(1)))!=ge||se&&Z(new se)!=$||Re&&Z(Re.resolve())!=ie||Ve&&Z(new Ve)!=ee||De&&Z(new De)!=Se)&&(Z=function(e){var t=ce(e),n=t==q?e.constructor:void 0,r=n?Q(n):"";if(r)switch(r){case Zt:return ge;case Kt:return $;case Wt:return ie;case Gt:return ee;case Ht:return Se}return t});var tn=ut(function(){return arguments}())?ut:function(e){return de(e)&&I.call(e,"callee")&&!ct.call(e,"callee")},we=Array.isArray,Me=qt||function(){return!1};function vt(e){if(!mt(e))return!1;var t=ce(e);return t==z||t==P||t==O||t==be}function ht(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=j}function mt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function de(e){return e!=null&&typeof e=="object"}var yt=Ye?function(e){return function(t){return e(t)}}(Ye):function(e){return de(e)&&ht(e.length)&&!!u[ce(e)]};function nn(e){return(t=e)!=null&&ht(t.length)&&!vt(t)?Jt(e):Xt(e);var t}i.exports=function(e,t){return bt(e,t)}})(Ze,Ze.exports);const bn=un(Ze.exports);function Nt(i,l,p){const v=i!==void 0,{current:_}=o.useRef(v?i:l),[j,C]=o.useState(l),w=v?i:j,O=o.useCallback((y,A=(N,z)=>!bn(N,z))=>{const N=typeof y!="function"?y:y(w);A(w,N)&&!v&&C(N),p&&p(N)},[v,w]);return[w,O,v,_]}const pn=({onClick:i,asChild:l,pressed:p,defaultPressed:v,disabled:_,value:j,defaultValue:C,children:w,onClear:O})=>{const[y,A]=Nt(p,v),[N]=Nt(j,C),z=(k=>(...ee)=>o.Children.toArray(k).filter(o.isValidElement).find(pe=>{const Ie=(fe=pe)?fe.type.displayName:"";var fe;return ee.includes(Ie||"")}))(w),P=z("Chip.LeadingIcon"),$=z("Chip.TrailingIcon"),T=z("Chip.Content"),L=z("Chip.ClearButton"),q=(i||y)!==void 0,ie=[P,T,L].every(k=>k===void 0)?o.createElement("span",{className:"inline-block grow truncate"},w):o.createElement(o.Fragment,null,P,T,P===void 0?$:null,L),be=k=>{L&&!_&&["Delete","Backspace"].includes(k.key)&&O&&(O(),k.key==="Delete"&&Ct.emulateTab(),k.key==="Backspace"&&Ct.emulateTab.backwards())};return q?{Element:l?jt.Slot:"button",chipProps:{type:"button",...y!==void 0&&{"aria-pressed":y,"data-state":y?"on":"off"},onClick:k=>{y!==void 0&&A(!y),i&&i(k,{pressed:y,value:N})},onKeyDown:be,disabled:_,children:ie},compoundElements:{leadingIcon:P,content:T,clearButton:L}}:{Element:l?jt.Slot:"div",chipProps:{"aria-disabled":_,children:ie,onKeyDown:be},compoundElements:{leadingIcon:P,content:T,clearButton:L}}},Et=o.forwardRef(({design:i="outlined",disabled:l,children:p,intent:v="basic",defaultPressed:_,pressed:j,asChild:C,className:w,onClick:O,onClear:y,...A},N)=>{const{Element:z,chipProps:{children:P,...$},compoundElements:T}=pn({asChild:C,pressed:j,defaultPressed:_,onClick:O,disabled:!!l,value:A.value,defaultValue:A.defaultValue,children:p,onClear:y}),{clearButton:L}=T;return o.createElement(kt.Provider,{value:{disabled:l,design:i,intent:v,onClear:y}},o.createElement(z,{ref:N,className:ln({className:w,design:i,disabled:l,intent:v,hasClearButton:!!L}),...$,...A,"data-spark-component":"chip"},P))});Et.displayName="Chip";const Ot=o.forwardRef(({title:i,fill:l="currentColor",stroke:p="none",...v},_)=>o.createElement("svg",{ref:_,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-title":"DeleteOutline",...i&&{"data-title":i},fill:l,stroke:p,...v,dangerouslySetInnerHTML:{__html:(i===void 0?"":`<title>${i}</title>`)+'<path fill-rule="evenodd" d="m12,4c-4.42,0-8,3.58-8,8s3.58,8,8,8,8-3.58,8-8-3.58-8-8-8ZM2,12C2,6.48,6.48,2,12,2s10,4.48,10,10-4.48,10-10,10S2,17.52,2,12Zm6.33-3.67c.39-.39,1.02-.39,1.41,0l2.23,2.23,2.23-2.23c.39-.39,1.02-.39,1.41,0,.39.39.39,1.02,0,1.41l-2.23,2.23,2.23,2.23c.39.39.39,1.02,0,1.41-.39.39-1.02.39-1.41,0l-2.23-2.23-2.23,2.23c-.39.39-1.02.39-1.41,0-.39-.39-.39-1.02,0-1.41l2.23-2.23-2.23-2.23c-.39-.39-.39-1.02,0-1.41Z"/>'}}));Ot.displayName="DeleteOutline";const fn=Y.cva(["ml-md flex h-full items-center justify-center focus-visible:outline-none"],{variants:{disabled:{false:["cursor-pointer"],true:["cursor-not-allowed"]},isBordered:{false:["pr-md"],true:["pr-[7px]"]},design:{outlined:[],tinted:[],dashed:[]}},compoundVariants:[{design:"outlined",disabled:!1,class:a.tw(["hover:opacity-dim-1"])},{design:"outlined",disabled:!0,class:a.tw(["opacity-dim-3"])},{design:"tinted",disabled:!1,class:a.tw(["hover:opacity-dim-1"])},{design:"tinted",disabled:!0,class:a.tw(["opacity-dim-3"])},{design:"dashed",disabled:!1,class:a.tw(["hover:opacity-dim-1"])},{design:"dashed",disabled:!0,class:a.tw(["opacity-dim-3"])}]}),gn=Y.cva(["rounded-full","focus-visible:outline-none focus-visible:u-ring-inset"],{variants:{disabled:{true:["cursor-not-allowed"],false:["cursor-pointer"]}}}),zt=o.forwardRef(({children:i=o.createElement(sn.Icon,{className:""},o.createElement(Ot,null)),tabIndex:l=0,label:p},v)=>{const{design:_,disabled:j,onClear:C}=o.useContext({...kt})||{},w=o.useCallback(O=>{O.stopPropagation(),!j&&C&&C(O)},[j,C]);return o.createElement("span",{className:fn({isBordered:_==="dashed",disabled:!!j,design:_}),onClick:w,ref:v},o.createElement("button",{tabIndex:l,type:"button",disabled:!!j,className:gn({disabled:j}),"aria-label":p},i&&o.cloneElement(i,{"aria-label":p})))});zt.displayName="Chip.ClearButton";const Bt=o.forwardRef(({children:i,className:l},p)=>o.createElement("span",{className:Y.cx("inline-block grow truncate",l),ref:p},i));Bt.displayName="Chip.Content";const Ke=o.forwardRef(({children:i,className:l},p)=>o.createElement("span",{className:Y.cx("flex h-full items-center justify-center",l),ref:p},i));Ke.displayName="Chip.Icon";const At=o.forwardRef(({className:i,...l},p)=>o.createElement(Ke,{className:Y.cx("mr-sm",i),ref:p,...l}));At.displayName="Chip.LeadingIcon";const It=o.forwardRef(({className:i,...l},p)=>o.createElement(Ke,{className:Y.cx("ml-md",i),ref:p,...l}));It.displayName="Chip.TrailingIcon";const ae=Object.assign(Et,{Content:Bt,LeadingIcon:At,TrailingIcon:It,ClearButton:zt});ae.displayName="Chip",ae.ClearButton.displayName="Chip.ClearButton",ae.Content.displayName="Chip.Content",ae.LeadingIcon.displayName="Chip.LeadingIcon",ae.TrailingIcon.displayName="Chip.TrailingIcon",exports.Chip=ae; | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react"),a=require("@spark-ui/internal-utils"),Y=require("class-variance-authority"),jt=require("@spark-ui/slot"),Ct=require("emulate-tab"),sn=require("@spark-ui/icon"),on=[{design:"outlined",intent:"main",class:a.tw(["enabled:hover:bg-main/dim-5","enabled:active:bg-main/dim-5","focus-visible:bg-main/dim-5","aria-pressed:bg-main-container aria-pressed:text-on-main-container aria-pressed:enabled:hover:bg-main-container/dim-1","text-main"])},{design:"outlined",intent:"support",class:a.tw(["enabled:hover:bg-support/dim-5","enabled:active:bg-support/dim-5","focus-visible:bg-support/dim-5","aria-pressed:bg-support-container aria-pressed:text-on-support-container aria-pressed:enabled:hover:bg-support-container/dim-1","text-support"])},{design:"outlined",intent:"basic",class:a.tw(["enabled:hover:bg-basic/dim-5","enabled:active:bg-basic/dim-5","focus-visible:bg-basic/dim-5","aria-pressed:bg-basic-container aria-pressed:text-on-basic-container aria-pressed:enabled:hover:bg-basic-container/dim-1","text-basic"])},{intent:"accent",design:"outlined",class:a.tw(["enabled:hover:bg-accent/dim-5","enabled:active:bg-accent/dim-5","focus-visible:bg-accent/dim-5","aria-pressed:bg-accent-container","aria-pressed:bg-accent-container aria-pressed:text-on-accent-container aria-pressed:enabled:hover:bg-accent-container/dim-1","text-accent"])},{design:"outlined",intent:"success",class:a.tw(["enabled:hover:bg-success/dim-5","enabled:active:bg-success/dim-5","focus-visible:bg-success/dim-5","aria-pressed:bg-success-container aria-pressed:text-on-success-container aria-pressed:enabled:hover:bg-success-container/dim-1","text-success"])},{intent:"alert",design:"outlined",class:a.tw(["enabled:hover:bg-alert/dim-5","enabled:active:bg-alert/dim-5","focus-visible:bg-alert/dim-5","aria-pressed:bg-alert-container aria-pressed:text-on-alert-container aria-pressed:enabled:hover:bg-alert-container/dim-1","text-alert"])},{design:"outlined",intent:"danger",class:a.tw(["enabled:hover:bg-error/dim-5","enabled:active:bg-error/dim-5","focus-visible:bg-error/dim-5","aria-pressed:bg-error-container aria-pressed:text-on-error-container aria-pressed:enabled:hover:bg-error-container/dim-1","text-error"])},{design:"outlined",intent:"info",class:a.tw(["enabled:hover:bg-info/dim-5","enabled:active:bg-info/dim-5","focus-visible:bg-info/dim-5","aria-pressed:bg-info-container aria-pressed:text-on-info-container aria-pressed:enabled:hover:bg-info-container/dim-1","text-info"])},{design:"outlined",intent:"neutral",class:a.tw(["enabled:hover:bg-neutral/dim-5","enabled:active:bg-neutral/dim-5","focus-visible:bg-neutral/dim-5","aria-pressed:bg-neutral-container aria-pressed:text-on-neutral-container aria-pressed:enabled:hover:bg-neutral-container/dim-1","text-neutral"])},{design:"outlined",intent:"surface",class:a.tw(["enabled:hover:bg-surface/dim-5","enabled:active:bg-surface/dim-5","focus-visible:bg-surface/dim-5","aria-pressed:bg-surface aria-pressed:text-on-surface aria-pressed:enabled:hover:bg-surface-hovered","text-surface"])},{design:"outlined",hasClearButton:!1,class:a.tw(["px-md"])},{design:"outlined",hasClearButton:!0,class:a.tw(["pl-md"])}],cn=[{intent:"main",design:"tinted",class:a.tw(["bg-main-container","enabled:hover:bg-main-container-hovered","enabled:active:bg-main-container-pressed","focus-visible:bg-main-container-focused","aria-pressed:bg-main aria-pressed:text-on-main aria-pressed:enabled:hover:bg-main/dim-1","text-on-main-container"])},{intent:"support",design:"tinted",class:a.tw(["bg-support-container","enabled:hover:bg-support-container-hovered","enabled:active:bg-support-container-pressed","focus-visible:bg-support-container-focused","aria-pressed:bg-support aria-pressed:text-on-support aria-pressed:enabled:hover:bg-support/dim-1","text-on-support-container"])},{intent:"basic",design:"tinted",class:a.tw(["bg-basic-container","enabled:hover:bg-basic-container-hovered","enabled:active:bg-basic-container-pressed","focus-visible:bg-basic-container-focused","aria-pressed:bg-basic aria-pressed:text-on-basic aria-pressed:enabled:hover:bg-basic/dim-1","text-on-basic-container"])},{intent:"accent",design:"tinted",class:a.tw(["bg-accent-container","enabled:hover:bg-accent-container-hovered","enabled:active:bg-accent-container-pressed","focus-visible:bg-accent-container-focused","aria-pressed:bg-accent aria-pressed:text-on-accent aria-pressed:enabled:hover:bg-accent/dim-1","text-on-accent-container"])},{intent:"success",design:"tinted",class:a.tw(["bg-success-container","enabled:hover:bg-success-container-hovered","enabled:active:bg-success-container-pressed","focus-visible:bg-success-container-focused","aria-pressed:bg-success aria-pressed:text-on-success aria-pressed:enabled:hover:bg-success/dim-1","text-on-success-container"])},{intent:"alert",design:"tinted",class:a.tw(["bg-alert-container","enabled:hover:bg-alert-container-hovered","enabled:active:bg-alert-container-pressed","focus-visible:bg-alert-container-focused","aria-pressed:bg-alert aria-pressed:text-on-alert aria-pressed:enabled:hover:bg-alert/dim-1","text-on-alert-container"])},{intent:"danger",design:"tinted",class:a.tw(["bg-error-container","enabled:hover:bg-error-container-hovered","enabled:active:bg-error-container-pressed","focus-visible:bg-error-container-focused","aria-pressed:bg-error aria-pressed:text-on-error aria-pressed:enabled:hover:bg-error/dim-1","text-on-error-container"])},{intent:"info",design:"tinted",class:a.tw(["bg-info-container","enabled:hover:bg-info-container-hovered","enabled:active:bg-info-container-pressed","focus-visible:bg-info-container-focused","aria-pressed:bg-info aria-pressed:text-on-info aria-pressed:enabled:hover:bg-info/dim-1","text-on-info-container"])},{intent:"neutral",design:"tinted",class:a.tw(["bg-neutral-container","enabled:hover:bg-neutral-container-hovered","enabled:active:bg-neutral-container-pressed","focus-visible:bg-neutral-container-focused","aria-pressed:bg-neutral aria-pressed:text-on-neutral aria-pressed:enabled:hover:bg-neutral/dim-1","text-on-neutral-container"])},{intent:"surface",design:"tinted",class:a.tw(["bg-surface/dim-1","enabled:hover:bg-surface-hovered/dim-1","enabled:active:bg-surface-pressed/dim-1","focus-visible:bg-surface-focused/dim-1","aria-pressed:bg-surface aria-pressed:text-on-surface aria-pressed:enabled:hover:bg-surface-hovered","text-on-surface/dim-1"])},{design:"tinted",hasClearButton:!1,class:a.tw(["px-md"])},{design:"tinted",hasClearButton:!0,class:a.tw(["pl-md"])}],dn=[{intent:"main",design:"dashed",class:a.tw(["enabled:hover:bg-main/dim-5","enabled:active:bg-main/dim-5","focus-visible:bg-main/dim-5","aria-pressed:bg-main-container aria-pressed:text-on-main-container aria-pressed:enabled:hover:bg-main-container/dim-1","text-main"])},{intent:"support",design:"dashed",class:a.tw(["enabled:hover:bg-support/dim-5","enabled:active:bg-support/dim-5","focus-visible:bg-support/dim-5","aria-pressed:bg-support-container aria-pressed:text-on-support-container aria-pressed:enabled:hover:bg-support-container/dim-1","text-support"])},{intent:"basic",design:"dashed",class:a.tw(["enabled:hover:bg-basic/dim-5","enabled:active:bg-basic/dim-5","focus-visible:bg-basic/dim-5","aria-pressed:bg-basic-container aria-pressed:text-on-basic-container aria-pressed:enabled:hover:bg-basic-container/dim-1","text-basic"])},{intent:"accent",design:"dashed",class:a.tw(["enabled:hover:bg-accent/dim-5","enabled:active:bg-accent/dim-5","focus-visible:bg-accent/dim-5","aria-pressed:bg-accent-container aria-pressed:text-on-accent-container aria-pressed:enabled:hover:bg-accent-container/dim-1","text-accent"])},{intent:"success",design:"dashed",class:a.tw(["enabled:hover:bg-success/dim-5","enabled:active:bg-success/dim-5","focus-visible:bg-success/dim-5","aria-pressed:bg-success-container aria-pressed:text-on-success-container aria-pressed:enabled:hover:bg-success-container/dim-1","text-success"])},{intent:"alert",design:"dashed",class:a.tw(["enabled:hover:bg-alert/dim-5","enabled:active:bg-alert/dim-5","focus-visible:bg-alert/dim-5","aria-pressed:bg-alert-container aria-pressed:text-on-alert-container aria-pressed:enabled:hover:bg-alert-container/dim-1","text-alert"])},{intent:"danger",design:"dashed",class:a.tw(["enabled:hover:bg-error/dim-5","enabled:active:bg-error/dim-5","focus-visible:bg-error/dim-5","aria-pressed:bg-error-container aria-pressed:text-on-error-container aria-pressed:enabled:hover:bg-error-container/dim-1","text-error"])},{intent:"info",design:"dashed",class:a.tw(["enabled:hover:bg-info/dim-5","enabled:active:bg-info/dim-5","focus-visible:bg-info/dim-5","aria-pressed:bg-info-container aria-pressed:text-on-info-container aria-pressed:enabled:hover:bg-info-container/dim-1","text-info"])},{intent:"neutral",design:"dashed",class:a.tw(["enabled:hover:bg-neutral/dim-5","enabled:active:bg-neutral/dim-5","focus-visible:bg-neutral/dim-5","aria-pressed:bg-neutral-container aria-pressed:text-on-neutral-container aria-pressed:enabled:hover:bg-neutral-container/dim-1","text-neutral"])},{intent:"surface",design:"dashed",class:a.tw(["enabled:hover:bg-surface/dim-5","enabled:active:bg-surface/dim-5","focus-visible:bg-surface/dim-5","aria-pressed:bg-surface aria-pressed:text-on-surface aria-pressed:enabled:hover:bg-surface-hovered","text-surface"])},{design:"dashed",hasClearButton:!1,class:a.tw(["px-[calc(var(--spacing-md)-var(--border-width-sm))]"])},{design:"dashed",hasClearButton:!0,class:a.tw(["pl-[calc(var(--spacing-md)-var(--border-width-sm))]"])}],ln=Y.cva(["box-border inline-flex h-sz-32 flex-nowrap items-center justify-center rounded-md text-body-1 font-regular","max-w-sz-240 focus-visible:outline-none focus-visible:u-ring-inset","ease-out duration-150"],{variants:{design:a.makeVariants({outlined:["bg-transparent ring-1 ring-current"],tinted:[""],dashed:["bg-transparent border-sm border-dashed shadow-none focus-visible:border-outline-high"]}),intent:a.makeVariants({main:[],support:[],basic:[],accent:[],success:[],alert:[],danger:[],info:[],neutral:[],surface:[]}),disabled:{true:["cursor-not-allowed","opacity-dim-3"]},hasClearButton:{true:[],false:[]}},compoundVariants:[...on,...cn,...dn],defaultVariants:{design:"outlined",intent:"basic"}}),kt=o.createContext({});var Ae=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function un(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Ze={exports:{}};(function(i,l){var p="__lodash_hash_undefined__",v=1,_=2,j=9007199254740991,C="[object Arguments]",w="[object Array]",O="[object AsyncFunction]",y="[object Boolean]",A="[object Date]",N="[object Error]",z="[object Function]",P="[object GeneratorFunction]",$="[object Map]",T="[object Number]",L="[object Null]",q="[object Object]",ie="[object Promise]",be="[object Proxy]",k="[object RegExp]",ee="[object Set]",pe="[object String]",Ie="[object Symbol]",fe="[object Undefined]",Se="[object WeakMap]",We="[object ArrayBuffer]",ge="[object DataView]",St=/^\[object .+?Constructor\]$/,Pt=/^(?:0|[1-9]\d*)$/,u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u[C]=u[w]=u[We]=u[y]=u[ge]=u[A]=u[N]=u[z]=u[$]=u[T]=u[q]=u[k]=u[ee]=u[pe]=u[Se]=!1;var Ge=typeof Ae=="object"&&Ae&&Ae.Object===Object&&Ae,Tt=typeof self=="object"&&self&&self.Object===Object&&self,R=Ge||Tt||Function("return this")(),He=l&&!l.nodeType&&l,Je=He&&i&&!i.nodeType&&i,Qe=Je&&Je.exports===He,Pe=Qe&&Ge.process,Xe=function(){try{return Pe&&Pe.binding&&Pe.binding("util")}catch{}}(),Ye=Xe&&Xe.isTypedArray;function Lt(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function Rt(e){var t=-1,n=Array(e.size);return e.forEach(function(r,b){n[++t]=[b,r]}),n}function Vt(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var et,tt,nt,Dt=Array.prototype,Ft=Function.prototype,ve=Object.prototype,Te=R["__core-js_shared__"],rt=Ft.toString,I=ve.hasOwnProperty,at=(et=/[^.]+$/.exec(Te&&Te.keys&&Te.keys.IE_PROTO||""))?"Symbol(src)_1."+et:"",it=ve.toString,Mt=RegExp("^"+rt.call(I).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),st=Qe?R.Buffer:void 0,he=R.Symbol,ot=R.Uint8Array,ct=ve.propertyIsEnumerable,$t=Dt.splice,G=he?he.toStringTag:void 0,dt=Object.getOwnPropertySymbols,qt=st?st.isBuffer:void 0,Ut=(tt=Object.keys,nt=Object,function(e){return tt(nt(e))}),Le=te(R,"DataView"),se=te(R,"Map"),Re=te(R,"Promise"),Ve=te(R,"Set"),De=te(R,"WeakMap"),oe=te(Object,"create"),Zt=Q(Le),Kt=Q(se),Wt=Q(Re),Gt=Q(Ve),Ht=Q(De),lt=he?he.prototype:void 0,Fe=lt?lt.valueOf:void 0;function H(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function V(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function J(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function me(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new J;++t<n;)this.add(e[t])}function U(e){var t=this.__data__=new V(e);this.size=t.size}function Jt(e,t){var n=we(e),r=!n&&tn(e),b=!n&&!r&&Me(e),s=!n&&!r&&!b&&yt(e),f=n||r||b||s,g=f?function(m,S){for(var D=-1,x=Array(m);++D<m;)x[D]=S(D);return x}(e.length,String):[],B=g.length;for(var h in e)!t&&!I.call(e,h)||f&&(h=="length"||b&&(h=="offset"||h=="parent")||s&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||en(h,B))||g.push(h);return g}function ye(e,t){for(var n=e.length;n--;)if(gt(e[n][0],t))return n;return-1}function ce(e){return e==null?e===void 0?fe:L:G&&G in Object(e)?function(t){var n=I.call(t,G),r=t[G];try{t[G]=void 0;var b=!0}catch{}var s=it.call(t);return b&&(n?t[G]=r:delete t[G]),s}(e):function(t){return it.call(t)}(e)}function ut(e){return de(e)&&ce(e)==C}function bt(e,t,n,r,b){return e===t||(e==null||t==null||!de(e)&&!de(t)?e!=e&&t!=t:function(s,f,g,B,h,m){var S=we(s),D=we(f),x=S?w:Z(s),F=D?w:Z(f),ne=(x=x==C?q:x)==q,xe=(F=F==C?q:F)==q,re=x==F;if(re&&Me(s)){if(!Me(f))return!1;S=!0,ne=!1}if(re&&!ne)return m||(m=new U),S||yt(s)?pt(s,f,g,B,h,m):function(d,c,je,K,$e,E,M){switch(je){case ge:if(d.byteLength!=c.byteLength||d.byteOffset!=c.byteOffset)return!1;d=d.buffer,c=c.buffer;case We:return!(d.byteLength!=c.byteLength||!E(new ot(d),new ot(c)));case y:case A:case T:return gt(+d,+c);case N:return d.name==c.name&&d.message==c.message;case k:case pe:return d==c+"";case $:var W=Rt;case ee:var ue=K&v;if(W||(W=Vt),d.size!=c.size&&!ue)return!1;var Ce=M.get(d);if(Ce)return Ce==c;K|=_,M.set(d,c);var qe=pt(W(d),W(c),K,$e,E,M);return M.delete(d),qe;case Ie:if(Fe)return Fe.call(d)==Fe.call(c)}return!1}(s,f,x,g,B,h,m);if(!(g&v)){var le=ne&&I.call(s,"__wrapped__"),_t=xe&&I.call(f,"__wrapped__");if(le||_t){var rn=le?s.value():s,an=_t?f.value():f;return m||(m=new U),h(rn,an,g,B,m)}}return re?(m||(m=new U),function(d,c,je,K,$e,E){var M=je&v,W=ft(d),ue=W.length,Ce=ft(c),qe=Ce.length;if(ue!=qe&&!M)return!1;for(var Ne=ue;Ne--;){var X=W[Ne];if(!(M?X in c:I.call(c,X)))return!1}var wt=E.get(d);if(wt&&E.get(c))return wt==c;var ke=!0;E.set(d,c),E.set(c,d);for(var Ue=M;++Ne<ue;){var Ee=d[X=W[Ne]],Oe=c[X];if(K)var xt=M?K(Oe,Ee,X,c,d,E):K(Ee,Oe,X,d,c,E);if(!(xt===void 0?Ee===Oe||$e(Ee,Oe,je,K,E):xt)){ke=!1;break}Ue||(Ue=X=="constructor")}if(ke&&!Ue){var ze=d.constructor,Be=c.constructor;ze==Be||!("constructor"in d)||!("constructor"in c)||typeof ze=="function"&&ze instanceof ze&&typeof Be=="function"&&Be instanceof Be||(ke=!1)}return E.delete(d),E.delete(c),ke}(s,f,g,B,h,m)):!1}(e,t,n,r,bt,b))}function Qt(e){return!(!mt(e)||function(t){return!!at&&at in t}(e))&&(vt(e)?Mt:St).test(Q(e))}function Xt(e){if(n=(t=e)&&t.constructor,r=typeof n=="function"&&n.prototype||ve,t!==r)return Ut(e);var t,n,r,b=[];for(var s in Object(e))I.call(e,s)&&s!="constructor"&&b.push(s);return b}function pt(e,t,n,r,b,s){var f=n&v,g=e.length,B=t.length;if(g!=B&&!(f&&B>g))return!1;var h=s.get(e);if(h&&s.get(t))return h==t;var m=-1,S=!0,D=n&_?new me:void 0;for(s.set(e,t),s.set(t,e);++m<g;){var x=e[m],F=t[m];if(r)var ne=f?r(F,x,m,t,e,s):r(x,F,m,e,t,s);if(ne!==void 0){if(ne)continue;S=!1;break}if(D){if(!Lt(t,function(xe,re){if(le=re,!D.has(le)&&(x===xe||b(x,xe,n,r,s)))return D.push(re);var le})){S=!1;break}}else if(x!==F&&!b(x,F,n,r,s)){S=!1;break}}return s.delete(e),s.delete(t),S}function ft(e){return function(t,n,r){var b=n(t);return we(t)?b:function(s,f){for(var g=-1,B=f.length,h=s.length;++g<B;)s[h+g]=f[g];return s}(b,r(t))}(e,nn,Yt)}function _e(e,t){var n,r,b=e.__data__;return((r=typeof(n=t))=="string"||r=="number"||r=="symbol"||r=="boolean"?n!=="__proto__":n===null)?b[typeof t=="string"?"string":"hash"]:b.map}function te(e,t){var n=function(r,b){return r?.[b]}(e,t);return Qt(n)?n:void 0}H.prototype.clear=function(){this.__data__=oe?oe(null):{},this.size=0},H.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},H.prototype.get=function(e){var t=this.__data__;if(oe){var n=t[e];return n===p?void 0:n}return I.call(t,e)?t[e]:void 0},H.prototype.has=function(e){var t=this.__data__;return oe?t[e]!==void 0:I.call(t,e)},H.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=oe&&t===void 0?p:t,this},V.prototype.clear=function(){this.__data__=[],this.size=0},V.prototype.delete=function(e){var t=this.__data__,n=ye(t,e);return!(n<0)&&(n==t.length-1?t.pop():$t.call(t,n,1),--this.size,!0)},V.prototype.get=function(e){var t=this.__data__,n=ye(t,e);return n<0?void 0:t[n][1]},V.prototype.has=function(e){return ye(this.__data__,e)>-1},V.prototype.set=function(e,t){var n=this.__data__,r=ye(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},J.prototype.clear=function(){this.size=0,this.__data__={hash:new H,map:new(se||V),string:new H}},J.prototype.delete=function(e){var t=_e(this,e).delete(e);return this.size-=t?1:0,t},J.prototype.get=function(e){return _e(this,e).get(e)},J.prototype.has=function(e){return _e(this,e).has(e)},J.prototype.set=function(e,t){var n=_e(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},me.prototype.add=me.prototype.push=function(e){return this.__data__.set(e,p),this},me.prototype.has=function(e){return this.__data__.has(e)},U.prototype.clear=function(){this.__data__=new V,this.size=0},U.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},U.prototype.get=function(e){return this.__data__.get(e)},U.prototype.has=function(e){return this.__data__.has(e)},U.prototype.set=function(e,t){var n=this.__data__;if(n instanceof V){var r=n.__data__;if(!se||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new J(r)}return n.set(e,t),this.size=n.size,this};var Yt=dt?function(e){return e==null?[]:(e=Object(e),function(t,n){for(var r=-1,b=t==null?0:t.length,s=0,f=[];++r<b;){var g=t[r];n(g,r,t)&&(f[s++]=g)}return f}(dt(e),function(t){return ct.call(e,t)}))}:function(){return[]},Z=ce;function en(e,t){return!!(t=t??j)&&(typeof e=="number"||Pt.test(e))&&e>-1&&e%1==0&&e<t}function Q(e){if(e!=null){try{return rt.call(e)}catch{}try{return e+""}catch{}}return""}function gt(e,t){return e===t||e!=e&&t!=t}(Le&&Z(new Le(new ArrayBuffer(1)))!=ge||se&&Z(new se)!=$||Re&&Z(Re.resolve())!=ie||Ve&&Z(new Ve)!=ee||De&&Z(new De)!=Se)&&(Z=function(e){var t=ce(e),n=t==q?e.constructor:void 0,r=n?Q(n):"";if(r)switch(r){case Zt:return ge;case Kt:return $;case Wt:return ie;case Gt:return ee;case Ht:return Se}return t});var tn=ut(function(){return arguments}())?ut:function(e){return de(e)&&I.call(e,"callee")&&!ct.call(e,"callee")},we=Array.isArray,Me=qt||function(){return!1};function vt(e){if(!mt(e))return!1;var t=ce(e);return t==z||t==P||t==O||t==be}function ht(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=j}function mt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function de(e){return e!=null&&typeof e=="object"}var yt=Ye?function(e){return function(t){return e(t)}}(Ye):function(e){return de(e)&&ht(e.length)&&!!u[ce(e)]};function nn(e){return(t=e)!=null&&ht(t.length)&&!vt(t)?Jt(e):Xt(e);var t}i.exports=function(e,t){return bt(e,t)}})(Ze,Ze.exports);const bn=un(Ze.exports);function Nt(i,l,p){const v=i!==void 0,{current:_}=o.useRef(v?i:l),[j,C]=o.useState(l),w=v?i:j,O=o.useCallback((y,A=(N,z)=>!bn(N,z))=>{const N=typeof y!="function"?y:y(w);A(w,N)&&!v&&C(N),p&&p(N)},[v,w,p]);return[w,O,v,_]}const pn=({onClick:i,asChild:l,pressed:p,defaultPressed:v,disabled:_,value:j,defaultValue:C,children:w,onClear:O})=>{const[y,A]=Nt(p,v),[N]=Nt(j,C),z=(k=>(...ee)=>o.Children.toArray(k).filter(o.isValidElement).find(pe=>{const Ie=(fe=pe)?fe.type.displayName:"";var fe;return ee.includes(Ie||"")}))(w),P=z("Chip.LeadingIcon"),$=z("Chip.TrailingIcon"),T=z("Chip.Content"),L=z("Chip.ClearButton"),q=(i||y)!==void 0,ie=[P,T,L].every(k=>k===void 0)?o.createElement("span",{className:"inline-block grow truncate"},w):o.createElement(o.Fragment,null,P,T,P===void 0?$:null,L),be=k=>{L&&!_&&["Delete","Backspace"].includes(k.key)&&O&&(O(),k.key==="Delete"&&Ct.emulateTab(),k.key==="Backspace"&&Ct.emulateTab.backwards())};return q?{Element:l?jt.Slot:"button",chipProps:{type:"button",...y!==void 0&&{"aria-pressed":y,"data-state":y?"on":"off"},onClick:k=>{y!==void 0&&A(!y),i&&i(k,{pressed:y,value:N})},onKeyDown:be,disabled:_,children:ie},compoundElements:{leadingIcon:P,content:T,clearButton:L}}:{Element:l?jt.Slot:"div",chipProps:{"aria-disabled":_,children:ie,onKeyDown:be},compoundElements:{leadingIcon:P,content:T,clearButton:L}}},Et=o.forwardRef(({design:i="outlined",disabled:l,children:p,intent:v="basic",defaultPressed:_,pressed:j,asChild:C,className:w,onClick:O,onClear:y,...A},N)=>{const{Element:z,chipProps:{children:P,...$},compoundElements:T}=pn({asChild:C,pressed:j,defaultPressed:_,onClick:O,disabled:!!l,value:A.value,defaultValue:A.defaultValue,children:p,onClear:y}),{clearButton:L}=T;return o.createElement(kt.Provider,{value:{disabled:l,design:i,intent:v,onClear:y}},o.createElement(z,{ref:N,className:ln({className:w,design:i,disabled:l,intent:v,hasClearButton:!!L}),...$,...A,"data-spark-component":"chip"},P))});Et.displayName="Chip";const Ot=o.forwardRef(({title:i,fill:l="currentColor",stroke:p="none",...v},_)=>o.createElement("svg",{ref:_,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-title":"DeleteOutline",...i&&{"data-title":i},fill:l,stroke:p,...v,dangerouslySetInnerHTML:{__html:(i===void 0?"":`<title>${i}</title>`)+'<path fill-rule="evenodd" d="m12,4c-4.42,0-8,3.58-8,8s3.58,8,8,8,8-3.58,8-8-3.58-8-8-8ZM2,12C2,6.48,6.48,2,12,2s10,4.48,10,10-4.48,10-10,10S2,17.52,2,12Zm6.33-3.67c.39-.39,1.02-.39,1.41,0l2.23,2.23,2.23-2.23c.39-.39,1.02-.39,1.41,0,.39.39.39,1.02,0,1.41l-2.23,2.23,2.23,2.23c.39.39.39,1.02,0,1.41-.39.39-1.02.39-1.41,0l-2.23-2.23-2.23,2.23c-.39.39-1.02.39-1.41,0-.39-.39-.39-1.02,0-1.41l2.23-2.23-2.23-2.23c-.39-.39-.39-1.02,0-1.41Z"/>'}}));Ot.displayName="DeleteOutline";const fn=Y.cva(["ml-md flex h-full items-center justify-center focus-visible:outline-none"],{variants:{disabled:{false:["cursor-pointer"],true:["cursor-not-allowed"]},isBordered:{false:["pr-md"],true:["pr-[7px]"]},design:{outlined:[],tinted:[],dashed:[]}},compoundVariants:[{design:"outlined",disabled:!1,class:a.tw(["hover:opacity-dim-1"])},{design:"outlined",disabled:!0,class:a.tw(["opacity-dim-3"])},{design:"tinted",disabled:!1,class:a.tw(["hover:opacity-dim-1"])},{design:"tinted",disabled:!0,class:a.tw(["opacity-dim-3"])},{design:"dashed",disabled:!1,class:a.tw(["hover:opacity-dim-1"])},{design:"dashed",disabled:!0,class:a.tw(["opacity-dim-3"])}]}),gn=Y.cva(["rounded-full","focus-visible:outline-none focus-visible:u-ring-inset"],{variants:{disabled:{true:["cursor-not-allowed"],false:["cursor-pointer"]}}}),zt=o.forwardRef(({children:i=o.createElement(sn.Icon,{className:""},o.createElement(Ot,null)),tabIndex:l=0,label:p},v)=>{const{design:_,disabled:j,onClear:C}=o.useContext({...kt})||{},w=o.useCallback(O=>{O.stopPropagation(),!j&&C&&C(O)},[j,C]);return o.createElement("span",{className:fn({isBordered:_==="dashed",disabled:!!j,design:_}),onClick:w,ref:v},o.createElement("button",{tabIndex:l,type:"button",disabled:!!j,className:gn({disabled:j}),"aria-label":p},i&&o.cloneElement(i,{"aria-label":p})))});zt.displayName="Chip.ClearButton";const Bt=o.forwardRef(({children:i,className:l},p)=>o.createElement("span",{className:Y.cx("inline-block grow truncate",l),ref:p},i));Bt.displayName="Chip.Content";const Ke=o.forwardRef(({children:i,className:l},p)=>o.createElement("span",{className:Y.cx("flex h-full items-center justify-center",l),ref:p},i));Ke.displayName="Chip.Icon";const At=o.forwardRef(({className:i,...l},p)=>o.createElement(Ke,{className:Y.cx("mr-sm",i),ref:p,...l}));At.displayName="Chip.LeadingIcon";const It=o.forwardRef(({className:i,...l},p)=>o.createElement(Ke,{className:Y.cx("ml-md",i),ref:p,...l}));It.displayName="Chip.TrailingIcon";const ae=Object.assign(Et,{Content:Bt,LeadingIcon:At,TrailingIcon:It,ClearButton:zt});ae.displayName="Chip",ae.ClearButton.displayName="Chip.ClearButton",ae.Content.displayName="Chip.Content",ae.LeadingIcon.displayName="Chip.LeadingIcon",ae.TrailingIcon.displayName="Chip.TrailingIcon",exports.Chip=ae; |
{ | ||
"name": "@spark-ui/chip", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "To help people enter information, make selections, filter content, or trigger actions.", | ||
@@ -52,3 +52,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "60a8f00aef92177084ac744bc4fd56ef13bc9948" | ||
"gitHead": "de227a8b264be41733e8889fb99f7fa0404efd53" | ||
} |
# Chip | ||
> @spark-ui/chip | ||
![storybook](https://img.shields.io/badge/storybook-black?logo=storybook&link=https%3A%2F%2Fsparkui.vercel.app%2F%3Fpath%3D%2Fdocs%2Fcomponents-chip--docs) | ||
![documentation](https://img.shields.io/badge/documentation-black?logo=googledocs&link=https%3A%2F%2Fsparkui-adv.vercel.app%2Fdocs%2Fcomponents%2Fchip) | ||
![issue](https://img.shields.io/badge/report%20a%20bug-black?logo=openbugbounty&logoColor=red&link=https%3A%2F%2Fgithub.com%2Fadevinta%2Fspark%2Fissues%2Fnew%3F%26projects%3D4%26template%3Dbug-report.yml%26assignees%3D%26labels%3Dcomponent%2Cchip) | ||
![npm](https://img.shields.io/npm/dt/%40spark-ui/chip?logo=npm&labelColor=black&link=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2F%40spark-ui%2Fchip) | ||
[![storybook](https://img.shields.io/badge/storybook-black?logo=storybook)](https://sparkui.vercel.app/?path=/docs/components-chip--docs) | ||
[![documentation](https://img.shields.io/badge/documentation-black?logo=googledocs)](https://sparkui-adv.vercel.app/docs/components/chip) | ||
[![issue](https://img.shields.io/badge/report%20a%20bug-black?logo=openbugbounty&logoColor=red)](https://github.com/adevinta/spark/issues/new?&projects=4&template=bug-report.yml&assignees=&labels=component,chips) | ||
[![npm](https://img.shields.io/npm/dt/%40spark-ui/chip?logo=npm&labelColor=black)](https://www.npmjs.com/package/@spark-ui/chip) | ||
@@ -13,3 +13,3 @@ | ||
![Issues open](https://img.shields.io/github/issues-search/adevinta/spark?query=is%3Aopen%20label%3Acomponent%20label%3Achip&logo=openbugbounty&logoColor=red&label=issues%20open&color=red&link=https%3A%2F%2Fgithub.com%2Fadevinta%2Fspark%2Fissues%3Fq%3Dis%253Aopen%2Blabel%253Acomponent%2Blabel%253Achip) | ||
![NPM](https://img.shields.io/npm/l/%40spark-ui%2Fchip) | ||
[![Issues open](https://img.shields.io/github/issues-search/adevinta/spark?query=is%3Aopen%20label%3Acomponent%20label%3Achip&logo=openbugbounty&logoColor=red&label=issues%20open&color=red)](https://github.com/adevinta/spark/issues?q=is%3Aopen+label%3Acomponent+label%3Achip) | ||
[![NPM](https://img.shields.io/npm/l/%40spark-ui%2Fchip)]](https://github.com/adevinta/spark/blob/main/packages/components/chip/LICENSE.md) |
Sorry, the diff of this file is not supported yet
89920