@zvoove/unity-ui 2.20.0 → 2.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/unity-ui.cjs.js +1 -1
- package/dist/unity-ui.css +1 -1
- package/dist/unity-ui.es.js +1 -1
- package/package.json +1 -1
package/dist/unity-ui.es.js
CHANGED
|
@@ -947,7 +947,7 @@ return a("div",{className:bs(),children:[c.map(({...t},l)=>/* @__PURE__ */a(n.Fr
|
|
|
947
947
|
/* @__PURE__ */e("div",{className:"mx-[-8px]",children:/* @__PURE__ */e(ud,{items:d,placement:"bottom-left",trigger:"click",density:"-4",children:/* @__PURE__ */e(ks,{variant:"textSecondary",icon:"more-horizontal","aria-label":"Hidden items"})})}),
|
|
948
948
|
/* @__PURE__ */e(ec,{name:"chevron-right",size:"sm",weight:"bold",className:"fill-outline"}),
|
|
949
949
|
/* @__PURE__ */e(r,{className:ws({hasHref:Boolean(o?.href)}),"data-testid":`breadcrumb_${o.label}`,"aria-label":o.label,...o,children:/* @__PURE__ */e(Bm,{truncate:1,color:"on-surface-variant",children:o.label})}),
|
|
950
|
-
/* @__PURE__ */e(ec,{name:"chevron-right",size:"sm",weight:"bold",className:"fill-outline"})]}),1===l.length?/* @__PURE__ */e(ec,{name:"home",size:"sm"}):i&&/* @__PURE__ */e(Bm,{truncate:1,color:"on-surface-variant",children:i.label})]})},ys=$a({base:["size-fit","inline-flex","items-center","justify-center"],variants:{isLoading:{true:["opacity-0"]}}}),Ls=$a({base:["inline-flex","items-center","justify-center","rounded-full","transition-colors","duration-300","disabled:cursor-not-allowed","transition-colors","duration-300","whitespace-nowrap","shrink-0","text-nowrap"],variants:{isLoading:{true:["cursor-progress"],false:["cursor-pointer"]},size:{sm:["text-label-medium","min-h-[24px]"],md:["text-label-large","min-h-[32px]"],lg:["text-label-large","min-h-[40px]"]},hasIconOnly:{false:[]},hasIcon:{true:[]},variant:{filled:["bg-primary","border-primary","text-on-primary","hover:bg-primary-hover","focus:bg-primary-hover","focus:border-primary","focus:text-on-primary","active:bg-primary-active","disabled:bg-on-surface/10","disabled:text-on-surface/40"],outlined:["active:bg-primary/20","bg-transparent","border","disabled:hover:bg-transparent","border-outline","text-on-surface","hover:bg-primary/10","hover:border-primary","hover:text-primary","focus:bg-primary/10","focus:border-primary","focus:text-primary","disabled:border-on-surface/10","disabled:text-on-surface/40","disabled:hover:border-on-surface/10","disabled:hover:text-on-surface/40"],text:["bg-transparent","text-primary","hover:bg-primary/10","active:bg-primary/20","disabled:text-on-surface/40"],textSecondary:["bg-transparent","disabled:text-secondary-70","text-on-surface-variant","hover:bg-secondary/10","hover:bg-on-surface/10","active:bg-on-surface/20"],elevated:["disabled:shadow-none","disabled:bg-on-surface/10","disabled:text-on-surface/40","bg-surface-bright","text-on-surface","hover:bg-primary/10","hover:bg-primary/20","shadow-elevation1","dark:shadow-elevation1-dark"],tonal:["disabled:bg-secondary-95","disabled:text-secondary-70","bg-tertiary-container","text-on-tertiary-container","hover:bg-tertiary-container-hover","active:bg-tertiary-container-active"],linkPrimary:["disabled:text-secondary-70","text-primary","hover:bg-primary/10","active:bg-primary/20","disabled:text-on-surface/40"],linkSecondary:["disabled:text-secondary-70","text-on-surface-variant","hover:bg-on-surface/10","active:bg-on-surface/20"],positive:["bg-green-container","border-green-container","text-on-green-container","hover:bg-green-container-hover","focus:bg-green-container-hover","focus:border-green-container","focus:text-on-green-container"],negative:["bg-error","border-error","text-on-error","hover:bg-error-hover","focus:bg-error-hover","focus:border-error","focus:text-on-error"]}},compoundVariants:[{size:"sm",hasIconOnly:!0,class:["size-[24px]"]},{size:"md",hasIconOnly:!0,class:["size-[32px]"]},{size:"lg",hasIconOnly:!0,class:["size-[40px]"]},{size:"sm",hasIconOnly:!1,hasIcon:!1,class:["px-md"]},{size:"md",hasIconOnly:!1,hasIcon:!1,class:["px-lg"]},{size:"lg",hasIconOnly:!1,hasIcon:!1,class:["px-xl"]},{size:"sm",hasIconOnly:!1,hasIcon:!0,class:["pr-md","pl-sm"]},{size:"md",hasIconOnly:!1,hasIcon:!0,class:["pr-lg","pl-md"]},{size:"lg",hasIconOnly:!1,hasIcon:!0,class:["pr-xl","pl-lg"]},{variant:["linkPrimary","linkSecondary"],class:["min-h-none!","!py-none","!px-none","rounded-xs","bg-transparent","disabled:bg-transparent"]}]}),ks=({children:t,variant:l="filled",hideLabel:n=!1,as:r,icon:i,linkComponent:o,size:s="lg",isLoading:c=!1,...m})=>{const d=cs(s)??"lg",h=cs(l)??"filled",p=cs(n)??!1;jo(!!o&&!!r,'The prop "as" is ignored when the button is an custom link component'),jo(!t&&!("aria-label"in m),'When the children are empty, you must provide an "aria-label" prop to the button to make it accessible');const u=!!i&&!t||p,C="string"==typeof i?{name:i}:i;/* @__PURE__ */
|
|
950
|
+
/* @__PURE__ */e(ec,{name:"chevron-right",size:"sm",weight:"bold",className:"fill-outline"})]}),1===l.length?/* @__PURE__ */e(ec,{name:"home",size:"sm"}):i&&/* @__PURE__ */e(Bm,{truncate:1,color:"on-surface-variant",children:i.label})]})},ys=$a({base:["size-fit","inline-flex","items-center","justify-center"],variants:{isLoading:{true:["opacity-0"]}}}),Ls=$a({base:["inline-flex","items-center","justify-center","rounded-full","transition-colors","duration-300","disabled:cursor-not-allowed","transition-colors","duration-300","whitespace-nowrap","shrink-0","text-nowrap"],variants:{isLoading:{true:["cursor-progress"],false:["cursor-pointer"]},size:{sm:["text-label-medium","min-h-[24px]"],md:["text-label-large","min-h-[32px]"],lg:["text-label-large","min-h-[40px]"]},hasIconOnly:{false:[]},hasIcon:{true:[]},variant:{filled:["bg-primary","border-primary","text-on-primary","hover:bg-primary-hover","focus:bg-primary-hover","focus:border-primary","focus:text-on-primary","active:bg-primary-active","disabled:bg-on-surface/10","disabled:text-on-surface/40"],outlined:["active:bg-primary/20","bg-transparent","border","disabled:hover:bg-transparent","border-outline","text-on-surface","hover:bg-primary/10","hover:border-primary","hover:text-primary","focus:bg-primary/10","focus:border-primary","focus:text-primary","disabled:border-on-surface/10","disabled:text-on-surface/40","disabled:hover:border-on-surface/10","disabled:hover:text-on-surface/40"],text:["bg-transparent","text-primary","hover:bg-primary/10","active:bg-primary/20","disabled:text-on-surface/40"],textSecondary:["bg-transparent","disabled:text-secondary-70","text-on-surface-variant","hover:bg-secondary/10","hover:bg-on-surface/10","active:bg-on-surface/20"],elevated:["disabled:shadow-none","disabled:bg-on-surface/10","disabled:text-on-surface/40","bg-surface-bright","text-on-surface","hover:bg-primary/10","hover:bg-primary/20","shadow-elevation1","dark:shadow-elevation1-dark"],tonal:["disabled:bg-secondary-95","disabled:text-secondary-70","bg-tertiary-container","text-on-tertiary-container","hover:bg-tertiary-container-hover","active:bg-tertiary-container-active"],linkPrimary:["disabled:text-secondary-70","text-primary","hover:bg-primary/10","active:bg-primary/20","disabled:text-on-surface/40","size-fit"],linkSecondary:["disabled:text-secondary-70","text-on-surface-variant","hover:bg-on-surface/10","active:bg-on-surface/20","size-fit"],positive:["bg-green-container","border-green-container","text-on-green-container","hover:bg-green-container-hover","focus:bg-green-container-hover","focus:border-green-container","focus:text-on-green-container"],negative:["bg-error","border-error","text-on-error","hover:bg-error-hover","focus:bg-error-hover","focus:border-error","focus:text-on-error"]}},compoundVariants:[{size:"sm",hasIconOnly:!0,class:["size-[24px]"]},{size:"md",hasIconOnly:!0,class:["size-[32px]"]},{size:"lg",hasIconOnly:!0,class:["size-[40px]"]},{size:"sm",hasIconOnly:!1,hasIcon:!1,class:["px-md"]},{size:"md",hasIconOnly:!1,hasIcon:!1,class:["px-lg"]},{size:"lg",hasIconOnly:!1,hasIcon:!1,class:["px-xl"]},{size:"sm",hasIconOnly:!1,hasIcon:!0,class:["pr-md","pl-sm"]},{size:"md",hasIconOnly:!1,hasIcon:!0,class:["pr-lg","pl-md"]},{size:"lg",hasIconOnly:!1,hasIcon:!0,class:["pr-xl","pl-lg"]},{variant:["linkPrimary","linkSecondary"],class:["min-h-none!","!py-none","!px-none","rounded-xs","bg-transparent","disabled:bg-transparent"]}]}),ks=({children:t,variant:l="filled",hideLabel:n=!1,as:r,icon:i,linkComponent:o,size:s="lg",isLoading:c=!1,...m})=>{const d=cs(s)??"lg",h=cs(l)??"filled",p=cs(n)??!1;jo(!!o&&!!r,'The prop "as" is ignored when the button is an custom link component'),jo(!t&&!("aria-label"in m),'When the children are empty, you must provide an "aria-label" prop to the button to make it accessible');const u=!!i&&!t||p,C="string"==typeof i?{name:i}:i;/* @__PURE__ */
|
|
951
951
|
return a(o??r??"button",{className:Ls({variant:h,hasIconOnly:u,size:d,hasIcon:!!i,isLoading:c}),...m,...c&&{onClick:void 0,"aria-disabled":!0,"aria-busy":!0},children:[c&&/* @__PURE__ */e("span",{className:"size-fit absolute inset-0",children:/* @__PURE__ */e(ec,{name:"circle-notch",size:"sm"===d?"xs":d,className:"animate-spin"})}),
|
|
952
952
|
/* @__PURE__ */e("span",{className:ys({isLoading:c}),children:/* @__PURE__ */a(qh,{direction:"row",align:"center",justify:"center",gap:"xs",children:[i&&/* @__PURE__ */e(ec,{...C,size:"sm"===d?"xs":d}),!u&&t]})})]})};ks.displayName="Button";const Fs=$a({base:["border-b","border-outline-variant"],variants:{bgColor:L}}),_s=$a({base:[],variants:{...R}}),Ns=$a({base:[],variants:{bgColor:L}}),Ss=$a({base:["relative","overflow-hidden","transition-colors"],variants:{hasCustomSize:{false:["w-full"]},variant:{outlined:["border","bg-transparent","border-outline-variant"],filled:["bg-surface"]},clickable:{true:["cursor-pointer"]},bgColor:L,...me,...R,...q,borderRadius:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl"},elevation:{0:["shadow-none"],1:["shadow-elevation1","dark:shadow-elevation1-dark"],2:["shadow-elevation2","dark:shadow-elevation2-dark"],3:["shadow-elevation3","dark:shadow-elevation3-dark"],4:["shadow-elevation4","dark:shadow-elevation4-dark"],5:["shadow-elevation5","dark:shadow-elevation5-dark"]}},compoundVariants:[{elevation:0,bgColor:"surface",class:["dark:bg-surface!"]},{elevation:1,bgColor:"surface",class:["dark:bg-surface-container-low!"]},{elevation:2,bgColor:"surface",class:["dark:bg-surface-container!"]},{elevation:3,bgColor:"surface",class:["dark:bg-surface-container-high!"]},{elevation:4,bgColor:"surface",class:["dark:bg-surface-container-high!"]},{elevation:5,bgColor:"surface",class:["dark:bg-surface-container-highest!"]}],defaultVariants:{}}),Ds=d(({children:t,header:l,headerBgColor:n,footer:r,footerBgColor:i,borderRadius:o="md",elevation:s=0,variant:c="filled",padding:m="md",margin:d="none",className:h,overflow:p="visible",bgColor:u="surface",height:C,width:H,minHeight:g,maxHeight:f,minWidth:V,maxWidth:Z,...x},M)=>{h&&(Uo(!Wo(h),"@Card: className only accepts tailwindcss classes that defines height or width. \n\nExample: h-[200px], w-[200px], h-full, w-full, size-full, size-[500px]"),jo(!!Wo(h),"@Card: className is deprecated. Use the `height`, `width`, `minHeight`, `maxHeight`, `minWidth`, `maxWidth` props instead. In v3.0.0, the className prop will be removed."));const v=cs(C),A=cs(H),b=cs(g),w=cs(f),E=cs(V),y=cs(Z),L=!(!l&&!r),k=os(L?"none":m,d);/* @__PURE__ */
|
|
953
953
|
return a("div",{ref:M,className:Ss({...k,...ps(L?"hidden":p),clickable:Boolean(x.onClick),hasCustomSize:Boolean(h),borderRadius:o,elevation:s,variant:c,bgColor:u,className:h}),...x,style:{height:v,width:A,minHeight:b,maxHeight:w,minWidth:E,maxWidth:y},children:[l&&/* @__PURE__ */e("div",{className:Fs({bgColor:n}),children:l}),L?t&&/* @__PURE__ */e("div",{className:_s(os(m)),children:t}):t,r&&/* @__PURE__ */e("div",{className:Ns({bgColor:i}),children:r})]})});Ds.displayName="Card";const Is=$a({base:["flex","items-center","gap-sm","cursor-pointer"],variants:{disabled:{true:["opacity-50","!cursor-not-allowed"]}}}),Os=$a({base:["size-[18px]","shrink-0","rounded-xs","relative","transition-all","duration-300","border-2","flex","items-center","justify-center","before:shrink-0","after:absolute","after:size-[20px]","after:rounded-full","after:transition-all","after:transform","after:top-[-3px]","after:left-[-3px]","after:scale-100","after:opacity-0","after:z-0","hover:after:opacity-10","hover:after:scale-180","peer-focus:after:opacity-10","peer-focus:after:scale-180","before:shrink-0","before:absolute","before:size-[20px]","before:rounded-full","before:transition-all","before:transform","before:top-[-3px]","before:left-[-3px]","before:opacity-0"],variants:{checked:{true:["border-transparent","text-on-primary"],false:["border-outline"]},error:{true:["before:bg-error","after:bg-error"],false:["before:bg-primary","after:bg-primary"]},animate:{true:["before:animate-ripple"]},disabled:{true:["before:bg-outline!","after:bg-outline!"]}},compoundVariants:[{checked:!0,error:!0,disabled:!1,class:["bg-error"]},{checked:!0,error:!1,disabled:!1,class:["bg-primary","border-primary"]},{error:!0,checked:!1,disabled:!1,class:["border-error!","before:bg-error!"]},{checked:!0,disabled:!0,class:["border-transparent","bg-outline"]}]}),Ts=({checked:t=!1,name:l,id:n,disabled:r=!1,error:o=!1,indeterminate:s=!1,value:c,label:m,onChange:d=()=>{}})=>{const[p,u]=i(!1),C=h();/* @__PURE__ */
|