@shmidko61/lc-ui-kit 0.9.0 → 0.12.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/README.md +111 -0
- package/dist/box/box.d.ts +1 -1
- package/dist/box/box.types.d.ts +34 -1
- package/dist/box.cjs +1 -1
- package/dist/box.js +299 -190
- package/dist/button/button.helpers.d.ts +4 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +152 -141
- package/dist/flex.cjs +1 -1
- package/dist/flex.js +18 -18
- package/dist/grid.cjs +1 -1
- package/dist/grid.js +57 -57
- package/dist/icons/icons.d.ts +6 -0
- package/dist/icons.cjs +1 -1
- package/dist/icons.js +34 -33
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +64 -63
- package/dist/styles.css +1 -1
- package/package.json +9 -3
- package/dist/vite.config.d.ts +0 -2
package/dist/button.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react/jsx-runtime"),E=require("./box.cjs"),st=require("./responsive-style.config-B2m9jVlX.cjs"),lt=require("class-variance-authority"),B=require("./responsive-style.utils-BdyoDkKg.cjs"),G={default:"bg-[var(--color-primary-accent)] text-[var(--color-background-default)] hover:bg-[color-mix(in_srgb,var(--color-primary-accent)_80%,#fff)] active:bg-[color-mix(in_srgb,var(--color-primary-accent)_80%,#000)]",secondary:"bg-[var(--color-background-subtle)] text-[var(--color-text-primary)] hover:bg-[color-mix(in_srgb,var(--color-background-subtle)_90%,#000)] active:bg-[color-mix(in_srgb,var(--color-background-subtle)_80%,#fff)]",destructive:"bg-[var(--color-secondary-accent-2)] text-[var(--color-background-default)] hover:bg-[color-mix(in_srgb,var(--color-secondary-accent-2)_80%,#fff)] active:bg-[color-mix(in_srgb,var(--color-secondary-accent-2)_80%,#000)]",success:"bg-[var(--color-secondary-accent-1)] text-[var(--color-background-default)] hover:bg-[color-mix(in_srgb,var(--color-secondary-accent-1)_80%,#fff)] active:bg-[color-mix(in_srgb,var(--color-secondary-accent-1)_80%,#000)]",dark:"bg-[var(--color-text-primary)] text-[var(--color-background-default)] hover:bg-[color-mix(in_srgb,var(--color-text-primary)_80%,#fff)] active:bg-[color-mix(in_srgb,var(--color-text-primary)_80%,#000)]",transparent:"bg-transparent text-[var(--color-text-primary)] hover:bg-transparent active:bg-transparent"},J={sm:"text-[13px] font-medium leading-[120%] [&_svg]:size-4",md:"text-[15px] font-medium leading-[140%] [&_svg]:size-5",lg:"text-[18px] font-medium leading-[140%] [&_svg]:size-5"},w={sm:"6px",md:"8px",lg:"12px"},K="box-border shrink-0 items-center overflow-hidden tracking-normal transition-colors duration-150 [font-family:var(--font-family)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color-mix(in_srgb,var(--color-primary-accent)_35%,transparent)] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",ct=lt.cva([K,"[justify-content:var(--button-justify-content,center)]"].join(" "),{variants:{variant:G,size:J,fullWidth:{true:"w-full"}},defaultVariants:{variant:"default",size:"md"}}),T={sm:{minWidth:32,p:{px:12,py:8}},md:{p:{px:16,py:10}},lg:{p:{px:32,py:16}}},gt={base:"[justify-content:var(--button-justify-content)]",md:"md:[justify-content:var(--md-button-justify-content)]",lg:"lg:[justify-content:var(--lg-button-justify-content)]",xl:"xl:[justify-content:var(--xl-button-justify-content)]"},ut={default:{activeBg:"color-mix(in srgb, var(--color-primary-accent) 80%, #000)",bg:"--color-primary-accent",color:"--color-background-default",hoverBg:"color-mix(in srgb, var(--color-primary-accent) 80%, #fff)"},secondary:{activeBg:"color-mix(in srgb, var(--color-background-subtle) 80%, #fff)",bg:"--color-background-subtle",color:"--color-text-primary",hoverBg:"color-mix(in srgb, var(--color-background-subtle) 90%, #000)"},destructive:{activeBg:"color-mix(in srgb, var(--color-secondary-accent-2) 80%, #000)",bg:"--color-secondary-accent-2",color:"--color-background-default",hoverBg:"color-mix(in srgb, var(--color-secondary-accent-2) 80%, #fff)"},success:{activeBg:"color-mix(in srgb, var(--color-secondary-accent-1) 80%, #000)",bg:"--color-secondary-accent-1",color:"--color-background-default",hoverBg:"color-mix(in srgb, var(--color-secondary-accent-1) 80%, #fff)"},dark:{activeBg:"color-mix(in srgb, var(--color-text-primary) 80%, #000)",bg:"--color-text-primary",color:"--color-background-default",hoverBg:"color-mix(in srgb, var(--color-text-primary) 80%, #fff)"},transparent:{activeBg:"transparent",bg:"transparent",color:"--color-text-primary",hoverBg:"transparent"}},bt={sm:"[&_svg]:size-4",md:"[&_svg]:size-5",lg:"[&_svg]:size-5"},vt={sm:{fontSize:"13px",fontWeight:500,lineHeight:"120%"},md:{fontSize:"15px",fontWeight:500,lineHeight:"140%"},lg:{fontSize:"18px",fontWeight:500,lineHeight:"140%"}};function dt({alignContent:o,md:t,lg:r,xl:a}){const e=[],n={};return m(o,e,n,"base"),m(t?.alignContent,e,n,"md","md-"),m(r?.alignContent,e,n,"lg","lg-"),m(a?.alignContent,e,n,"xl","xl-"),{className:e.join(" "),style:Object.keys(n).length?n:void 0}}function ft({variant:o,md:t,lg:r,xl:a},e={}){const n=[],i={};return x(o,e,n,i),x(t?.variant,e.md,n,i,"md"),x(r?.variant,e.lg,n,i,"lg"),x(a?.variant,e.xl,n,i,"xl"),{className:n.join(" "),style:Object.keys(i).length?i:void 0}}function mt({activeBg:o,bg:t,color:r,hoverBg:a,md:e,lg:n,xl:i}){const s=[],l={};return y({activeBg:o,bg:t,color:r,hoverBg:a},s,l),y(e,s,l,"md"),y(n,s,l,"lg"),y(i,s,l,"xl"),{className:s.join(" "),style:Object.keys(l).length?l:void 0}}function ht({fontSize:o,fontWeight:t,lineHeight:r,md:a,lg:e,xl:n}){const i=[],s={};return z({fontSize:o,fontWeight:t,lineHeight:r},i,s),z(a,i,s,"md"),z(e,i,s,"lg"),z(n,i,s,"xl"),{className:i.join(" "),style:Object.keys(s).length?s:void 0}}function xt({size:o="md",md:t,lg:r,xl:a}){const e=[bt[o],p.fontSize,p.fontWeight,p.lineHeight],n={};return h(o,e,n),h(t?.size,e,n,"md"),h(r?.size,e,n,"lg"),h(a?.size,e,n,"xl"),{className:e.join(" "),style:n}}function H(o){if(!o)return;const t={...o};return(o.size||o.border)&&(t.border={radius:o.size?w[o.size]:void 0,...o.border}),o.size&&o.p===void 0&&(t.p=T[o.size].p),delete t.activeBg,delete t.alignContent,delete t.bg,delete t.color,delete t.fontSize,delete t.fontWeight,delete t.hoverBg,delete t.lineHeight,delete t.size,delete t.variant,t}function m(o,t,r,a,e=""){if(!o)return;const n=`${e}button-justify-content`;r[`--${n}`]=zt(o),t.push(gt[a])}function h(o,t,r,a){if(!o)return;const{fontSize:e,fontWeight:n,lineHeight:i}=vt[o];if(!a){r["--button-font-size"]=e,r["--button-font-weight"]=n,r["--button-line-height"]=i;return}r[`--${a}-button-font-size`]=e,r[`--${a}-button-font-weight`]=n,r[`--${a}-button-line-height`]=i,t.push(yt[a][o],_[a].fontSize,_[a].fontWeight,_[a].lineHeight)}function x(o,t,r,a,e){if(!o)return;const n=e?Q[e]:L,i=e?`${e}-`:"",s=ut[o];t?.bg===void 0&&(a[`--${i}button-bg`]=c(s.bg),r.push(n.bg)),t?.color===void 0&&(a[`--${i}button-color`]=c(s.color),r.push(n.color)),t?.bg===void 0&&t?.hoverBg===void 0&&(a[`--${i}button-hover-bg`]=c(s.hoverBg),r.push(n.hoverBg)),t?.bg===void 0&&t?.hoverBg===void 0&&t?.activeBg===void 0&&(a[`--${i}button-active-bg`]=c(s.activeBg),r.push(n.activeBg))}function y(o,t,r,a){if(!o)return;const{activeBg:e,bg:n,color:i,hoverBg:s}=o,l=a?Q[a]:L,v=a?`${a}-`:"";n!==void 0&&(r[`--${v}button-bg`]=c(n),t.push(l.bg,l.hoverBg,l.activeBg)),s!==void 0&&(r[`--${v}button-hover-bg`]=c(s),t.push(l.hoverBg)),e!==void 0&&(r[`--${v}button-active-bg`]=c(e),t.push(l.activeBg)),i!==void 0&&(r[`--${v}button-color`]=c(i),t.push(l.color))}function z(o,t,r,a){if(!o)return;const{fontSize:e,fontWeight:n,lineHeight:i}=o,s=a?_[a]:p,l=a?`${a}-`:"";e!==void 0&&(r[`--${l}button-font-size`]=B.normalizeCssTokenValue(e),t.push(s.fontSize)),n!==void 0&&(r[`--${l}button-font-weight`]=B.normalizeCssTokenValue(n),t.push(s.fontWeight)),i!==void 0&&(r[`--${l}button-line-height`]=B.normalizeCssTokenValue(i),t.push(s.lineHeight))}const L={activeBg:"active:bg-[var(--button-active-bg,var(--button-hover-bg,var(--button-bg)))]",bg:"bg-[var(--button-bg)]",color:"text-[var(--button-color)]",hoverBg:"hover:bg-[var(--button-hover-bg,var(--button-bg))]"},p={fontSize:"text-[length:var(--button-font-size)]",fontWeight:"font-[var(--button-font-weight)]",lineHeight:"leading-[var(--button-line-height)]"},Q={md:{activeBg:"md:active:bg-[var(--md-button-active-bg,var(--md-button-hover-bg,var(--md-button-bg)))]",bg:"md:bg-[var(--md-button-bg)]",color:"md:text-[var(--md-button-color)]",hoverBg:"md:hover:bg-[var(--md-button-hover-bg,var(--md-button-bg))]"},lg:{activeBg:"lg:active:bg-[var(--lg-button-active-bg,var(--lg-button-hover-bg,var(--lg-button-bg)))]",bg:"lg:bg-[var(--lg-button-bg)]",color:"lg:text-[var(--lg-button-color)]",hoverBg:"lg:hover:bg-[var(--lg-button-hover-bg,var(--lg-button-bg))]"},xl:{activeBg:"xl:active:bg-[var(--xl-button-active-bg,var(--xl-button-hover-bg,var(--xl-button-bg)))]",bg:"xl:bg-[var(--xl-button-bg)]",color:"xl:text-[var(--xl-button-color)]",hoverBg:"xl:hover:bg-[var(--xl-button-hover-bg,var(--xl-button-bg))]"}},_={md:{fontSize:"md:text-[length:var(--md-button-font-size)]",fontWeight:"md:font-[var(--md-button-font-weight)]",lineHeight:"md:leading-[var(--md-button-line-height)]"},lg:{fontSize:"lg:text-[length:var(--lg-button-font-size)]",fontWeight:"lg:font-[var(--lg-button-font-weight)]",lineHeight:"lg:leading-[var(--lg-button-line-height)]"},xl:{fontSize:"xl:text-[length:var(--xl-button-font-size)]",fontWeight:"xl:font-[var(--xl-button-font-weight)]",lineHeight:"xl:leading-[var(--xl-button-line-height)]"}},yt={md:{sm:"md:[&_svg]:size-4",md:"md:[&_svg]:size-5",lg:"md:[&_svg]:size-5"},lg:{sm:"lg:[&_svg]:size-4",md:"lg:[&_svg]:size-5",lg:"lg:[&_svg]:size-5"},xl:{sm:"xl:[&_svg]:size-4",md:"xl:[&_svg]:size-5",lg:"xl:[&_svg]:size-5"}};function c(o){return String(B.normalizeCssTokenValue(o))}function zt(o){return{center:"center",end:"flex-end",start:"flex-start"}[o]}function Bt({alignContent:o,children:t,className:r,disabled:a,display:e,border:n,bg:i,color:s,cursor:l,fullWidth:v,href:C,hoverBg:A,activeBg:R,fontSize:U,fontWeight:X,isLoading:Y=!1,lineHeight:Z,minHeight:O,minWidth:tt,md:g,lg:u,xl:b,p:ot,position:nt,size:et,style:q,variant:at,width:rt,...S}){const d=a||Y,N=et??"md",j=xt({size:N,md:g,lg:u,xl:b}),$=dt({alignContent:o,md:g,lg:u,xl:b}),V=ft({variant:at??"default",md:g,lg:u,xl:b},{activeBg:R,bg:i,color:s,hoverBg:A,md:g,lg:u,xl:b}),W=mt({activeBg:R,bg:i,color:s,hoverBg:A,md:g,lg:u,xl:b}),P=ht({fontSize:U,fontWeight:X,lineHeight:Z,md:g,lg:u,xl:b}),k={...S,border:{radius:w[N],style:"none",width:"0",...n},cursor:d?"not-allowed":l??"pointer",display:e??"inline-flex",minHeight:O,minWidth:tt,md:H(g),lg:H(u),xl:H(b),p:ot??T[N].p,position:nt??{type:"relative"},width:rt??(v?"100%":void 0)},I=st.cn(K,j.className,C&&"no-underline",$.className,V.className,W.className,P.className,r),D=j.style||$.style||V.style||W.style||P.style||q?{...j.style,...$.style,...V.style,...W.style,...P.style,...q}:void 0,F=f.jsx(f.Fragment,{children:t});if(C){const M=S;return f.jsx(E.Box,{...M,...k,"aria-disabled":d||void 0,as:"a",className:I,href:d?void 0:C,style:D,tabIndex:d?-1:M.tabIndex,children:F})}const it=S;return f.jsx(E.Box,{...it,...k,as:"button",className:I,disabled:d,style:D,children:F})}exports.Button=Bt;exports.buttonSizeBorderRadius=w;exports.buttonSizeBoxProps=T;exports.buttonSizeClassNames=J;exports.buttonVariantClassNames=G;exports.buttonVariants=ct;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react/jsx-runtime"),E=require("./box.cjs"),st=require("./responsive-style.config-B2m9jVlX.cjs"),lt=require("class-variance-authority"),z=require("./responsive-style.utils-BdyoDkKg.cjs"),G={default:"bg-[var(--color-primary-accent)] text-[var(--color-background-default)] hover:bg-[color-mix(in_srgb,var(--color-primary-accent)_80%,#fff)] active:bg-[color-mix(in_srgb,var(--color-primary-accent)_80%,#000)]",secondary:"bg-[var(--color-background-subtle)] text-[var(--color-text-primary)] hover:bg-[color-mix(in_srgb,var(--color-background-subtle)_90%,#000)] active:bg-[color-mix(in_srgb,var(--color-background-subtle)_80%,#fff)]",destructive:"bg-[var(--color-secondary-accent-2)] text-[var(--color-background-default)] hover:bg-[color-mix(in_srgb,var(--color-secondary-accent-2)_80%,#fff)] active:bg-[color-mix(in_srgb,var(--color-secondary-accent-2)_80%,#000)]",success:"bg-[var(--color-secondary-accent-1)] text-[var(--color-background-default)] hover:bg-[color-mix(in_srgb,var(--color-secondary-accent-1)_80%,#fff)] active:bg-[color-mix(in_srgb,var(--color-secondary-accent-1)_80%,#000)]",dark:"bg-[var(--color-text-primary)] text-[var(--color-background-default)] hover:bg-[color-mix(in_srgb,var(--color-text-primary)_80%,#fff)] active:bg-[color-mix(in_srgb,var(--color-text-primary)_80%,#000)]",transparent:"bg-transparent text-[var(--color-text-primary)] hover:bg-transparent active:bg-transparent"},J={sm:"text-[13px] font-medium leading-[120%] [&_svg]:size-4",md:"text-[15px] font-medium leading-[140%] [&_svg]:size-5",lg:"text-[18px] font-medium leading-[140%] [&_svg]:size-5"},w={sm:"6px",md:"8px",lg:"12px"},K="box-border shrink-0 items-center overflow-hidden tracking-normal transition-colors duration-150 [font-family:var(--font-family)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color-mix(in_srgb,var(--color-primary-accent)_35%,transparent)] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",ct=lt.cva([K,"[justify-content:var(--button-justify-content,center)]"].join(" "),{variants:{variant:G,size:J,fullWidth:{true:"w-full"}},defaultVariants:{variant:"default",size:"md"}}),T={sm:{minWidth:32,p:{px:12,py:8}},md:{p:{px:16,py:10}},lg:{p:{px:32,py:16}}},gt={base:"[justify-content:var(--button-justify-content)]",md:"md:[justify-content:var(--md-button-justify-content)]",lg:"lg:[justify-content:var(--lg-button-justify-content)]",xl:"xl:[justify-content:var(--xl-button-justify-content)]"},ut={default:{activeBg:"color-mix(in srgb, var(--color-primary-accent) 80%, #000)",bg:"--color-primary-accent",color:"--color-background-default",hoverBg:"color-mix(in srgb, var(--color-primary-accent) 80%, #fff)"},secondary:{activeBg:"color-mix(in srgb, var(--color-background-subtle) 80%, #fff)",bg:"--color-background-subtle",color:"--color-text-primary",hoverBg:"color-mix(in srgb, var(--color-background-subtle) 90%, #000)"},destructive:{activeBg:"color-mix(in srgb, var(--color-secondary-accent-2) 80%, #000)",bg:"--color-secondary-accent-2",color:"--color-background-default",hoverBg:"color-mix(in srgb, var(--color-secondary-accent-2) 80%, #fff)"},success:{activeBg:"color-mix(in srgb, var(--color-secondary-accent-1) 80%, #000)",bg:"--color-secondary-accent-1",color:"--color-background-default",hoverBg:"color-mix(in srgb, var(--color-secondary-accent-1) 80%, #fff)"},dark:{activeBg:"color-mix(in srgb, var(--color-text-primary) 80%, #000)",bg:"--color-text-primary",color:"--color-background-default",hoverBg:"color-mix(in srgb, var(--color-text-primary) 80%, #fff)"},transparent:{activeBg:"transparent",bg:"transparent",color:"--color-text-primary",hoverBg:"transparent"}},bt={sm:"[&_svg]:size-4",md:"[&_svg]:size-5",lg:"[&_svg]:size-5"},vt={sm:{fontSize:"13px",fontWeight:500,lineHeight:"120%"},md:{fontSize:"15px",fontWeight:500,lineHeight:"140%"},lg:{fontSize:"18px",fontWeight:500,lineHeight:"140%"}},L={activeBg:"active:bg-[var(--button-active-bg,var(--button-hover-bg,var(--button-bg)))]",bg:"bg-[var(--button-bg)]",color:"text-[var(--button-color)]",hoverBg:"hover:bg-[var(--button-hover-bg,var(--button-bg))]"},p={fontSize:"text-[length:var(--button-font-size)]",fontWeight:"font-[var(--button-font-weight)]",lineHeight:"leading-[var(--button-line-height)]"},Q={md:{activeBg:"md:active:bg-[var(--md-button-active-bg,var(--md-button-hover-bg,var(--md-button-bg)))]",bg:"md:bg-[var(--md-button-bg)]",color:"md:text-[var(--md-button-color)]",hoverBg:"md:hover:bg-[var(--md-button-hover-bg,var(--md-button-bg))]"},lg:{activeBg:"lg:active:bg-[var(--lg-button-active-bg,var(--lg-button-hover-bg,var(--lg-button-bg)))]",bg:"lg:bg-[var(--lg-button-bg)]",color:"lg:text-[var(--lg-button-color)]",hoverBg:"lg:hover:bg-[var(--lg-button-hover-bg,var(--lg-button-bg))]"},xl:{activeBg:"xl:active:bg-[var(--xl-button-active-bg,var(--xl-button-hover-bg,var(--xl-button-bg)))]",bg:"xl:bg-[var(--xl-button-bg)]",color:"xl:text-[var(--xl-button-color)]",hoverBg:"xl:hover:bg-[var(--xl-button-hover-bg,var(--xl-button-bg))]"}},_={md:{fontSize:"md:text-[length:var(--md-button-font-size)]",fontWeight:"md:font-[var(--md-button-font-weight)]",lineHeight:"md:leading-[var(--md-button-line-height)]"},lg:{fontSize:"lg:text-[length:var(--lg-button-font-size)]",fontWeight:"lg:font-[var(--lg-button-font-weight)]",lineHeight:"lg:leading-[var(--lg-button-line-height)]"},xl:{fontSize:"xl:text-[length:var(--xl-button-font-size)]",fontWeight:"xl:font-[var(--xl-button-font-weight)]",lineHeight:"xl:leading-[var(--xl-button-line-height)]"}},dt={md:{sm:"md:[&_svg]:size-4",md:"md:[&_svg]:size-5",lg:"md:[&_svg]:size-5"},lg:{sm:"lg:[&_svg]:size-4",md:"lg:[&_svg]:size-5",lg:"lg:[&_svg]:size-5"},xl:{sm:"xl:[&_svg]:size-4",md:"xl:[&_svg]:size-5",lg:"xl:[&_svg]:size-5"}};function ft({alignContent:o,md:t,lg:r,xl:a}){const e=[],n={};return m(o,e,n,{breakpoint:"base"}),m(t?.alignContent,e,n,{breakpoint:"md",variablePrefix:"md-"}),m(r?.alignContent,e,n,{breakpoint:"lg",variablePrefix:"lg-"}),m(a?.alignContent,e,n,{breakpoint:"xl",variablePrefix:"xl-"}),{className:e.join(" "),style:Object.keys(n).length?n:void 0}}function mt({variant:o,md:t,lg:r,xl:a},e={}){const n=[],i={};return x(o,e,{classNames:n,style:i}),x(t?.variant,e.md,{classNames:n,style:i},"md"),x(r?.variant,e.lg,{classNames:n,style:i},"lg"),x(a?.variant,e.xl,{classNames:n,style:i},"xl"),{className:n.join(" "),style:Object.keys(i).length?i:void 0}}function ht({activeBg:o,bg:t,color:r,hoverBg:a,md:e,lg:n,xl:i}){const s=[],l={};return y({activeBg:o,bg:t,color:r,hoverBg:a},s,l),y(e,s,l,"md"),y(n,s,l,"lg"),y(i,s,l,"xl"),{className:s.join(" "),style:Object.keys(l).length?l:void 0}}function xt({fontSize:o,fontWeight:t,lineHeight:r,md:a,lg:e,xl:n}){const i=[],s={};return B({fontSize:o,fontWeight:t,lineHeight:r},i,s),B(a,i,s,"md"),B(e,i,s,"lg"),B(n,i,s,"xl"),{className:i.join(" "),style:Object.keys(s).length?s:void 0}}function yt({size:o="md",md:t,lg:r,xl:a}){const e=[bt[o],p.fontSize,p.fontWeight,p.lineHeight],n={};return h(o,e,n),h(t?.size,e,n,"md"),h(r?.size,e,n,"lg"),h(a?.size,e,n,"xl"),{className:e.join(" "),style:n}}function H(o){if(!o)return;const t={...o};return(o.size||o.border)&&(t.border={radius:o.size?w[o.size]:void 0,...o.border}),o.size&&o.p===void 0&&(t.p=T[o.size].p),delete t.activeBg,delete t.alignContent,delete t.bg,delete t.color,delete t.fontSize,delete t.fontWeight,delete t.hoverBg,delete t.lineHeight,delete t.size,delete t.variant,t}function m(o,t,r,{breakpoint:a,variablePrefix:e=""}){if(!o)return;const n=`${e}button-justify-content`;r[`--${n}`]=Bt(o),t.push(gt[a])}function h(o,t,r,a){if(!o)return;const{fontSize:e,fontWeight:n,lineHeight:i}=vt[o];if(!a){r["--button-font-size"]=e,r["--button-font-weight"]=n,r["--button-line-height"]=i;return}r[`--${a}-button-font-size`]=e,r[`--${a}-button-font-weight`]=n,r[`--${a}-button-line-height`]=i,t.push(dt[a][o],_[a].fontSize,_[a].fontWeight,_[a].lineHeight)}function x(o,t,{classNames:r,style:a},e){if(!o)return;const n=e?Q[e]:L,i=e?`${e}-`:"",s=ut[o];t?.bg===void 0&&(a[`--${i}button-bg`]=c(s.bg),r.push(n.bg)),t?.color===void 0&&(a[`--${i}button-color`]=c(s.color),r.push(n.color)),t?.bg===void 0&&t?.hoverBg===void 0&&(a[`--${i}button-hover-bg`]=c(s.hoverBg),r.push(n.hoverBg)),t?.bg===void 0&&t?.hoverBg===void 0&&t?.activeBg===void 0&&(a[`--${i}button-active-bg`]=c(s.activeBg),r.push(n.activeBg))}function y(o,t,r,a){if(!o)return;const{activeBg:e,bg:n,color:i,hoverBg:s}=o,l=a?Q[a]:L,v=a?`${a}-`:"";n!==void 0&&(r[`--${v}button-bg`]=c(n),t.push(l.bg,l.hoverBg,l.activeBg)),s!==void 0&&(r[`--${v}button-hover-bg`]=c(s),t.push(l.hoverBg)),e!==void 0&&(r[`--${v}button-active-bg`]=c(e),t.push(l.activeBg)),i!==void 0&&(r[`--${v}button-color`]=c(i),t.push(l.color))}function B(o,t,r,a){if(!o)return;const{fontSize:e,fontWeight:n,lineHeight:i}=o,s=a?_[a]:p,l=a?`${a}-`:"";e!==void 0&&(r[`--${l}button-font-size`]=z.normalizeCssTokenValue(e),t.push(s.fontSize)),n!==void 0&&(r[`--${l}button-font-weight`]=z.normalizeCssTokenValue(n),t.push(s.fontWeight)),i!==void 0&&(r[`--${l}button-line-height`]=z.normalizeCssTokenValue(i),t.push(s.lineHeight))}function c(o){return String(z.normalizeCssTokenValue(o))}function Bt(o){return{center:"center",end:"flex-end",start:"flex-start"}[o]}function zt({alignContent:o,children:t,className:r,disabled:a,display:e,border:n,bg:i,color:s,cursor:l,fullWidth:v,href:C,hoverBg:k,activeBg:A,fontSize:U,fontWeight:X,isLoading:Y=!1,lineHeight:Z,minHeight:O,minWidth:tt,md:g,lg:u,xl:b,p:ot,position:nt,size:et,style:R,variant:at,width:rt,...S}){const d=!!a||Y,N=et??"md",j=yt({size:N,md:g,lg:u,xl:b}),$=ft({alignContent:o,md:g,lg:u,xl:b}),P=mt({variant:at??"default",md:g,lg:u,xl:b},{activeBg:A,bg:i,color:s,hoverBg:k,md:g,lg:u,xl:b}),V=ht({activeBg:A,bg:i,color:s,hoverBg:k,md:g,lg:u,xl:b}),W=xt({fontSize:U,fontWeight:X,lineHeight:Z,md:g,lg:u,xl:b}),q={...S,border:{radius:w[N],style:"none",width:"0",...n},cursor:d?"not-allowed":l??"pointer",display:e??"inline-flex",minHeight:O,minWidth:tt,md:H(g),lg:H(u),xl:H(b),p:ot??T[N].p,position:nt??{type:"relative"},width:rt??(v?"100%":void 0)},I=st.cn(K,j.className,C&&"no-underline",$.className,P.className,V.className,W.className,r),D=j.style||$.style||P.style||V.style||W.style||R?{...j.style,...$.style,...P.style,...V.style,...W.style,...R}:void 0,F=f.jsx(f.Fragment,{children:t});if(C){const M=S;return f.jsx(E.Box,{...M,...q,"aria-disabled":d||void 0,as:"a",className:I,href:d?void 0:C,style:D,tabIndex:d?-1:M.tabIndex,children:F})}const it=S;return f.jsx(E.Box,{...it,...q,as:"button",className:I,disabled:d,style:D,children:F})}exports.Button=zt;exports.buttonSizeBorderRadius=w;exports.buttonSizeBoxProps=T;exports.buttonSizeClassNames=J;exports.buttonVariantClassNames=G;exports.buttonVariants=ct;
|
package/dist/button.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as H, Fragment as at } from "react/jsx-runtime";
|
|
2
2
|
import { Box as q } from "./box.js";
|
|
3
|
-
import { c as
|
|
3
|
+
import { c as rt } from "./responsive-style.config-DFuATrIM.js";
|
|
4
4
|
import { cva as it } from "class-variance-authority";
|
|
5
5
|
import { n as p } from "./responsive-style.utils-D10sC561.js";
|
|
6
6
|
const lt = {
|
|
@@ -86,11 +86,11 @@ const lt = {
|
|
|
86
86
|
color: "--color-text-primary",
|
|
87
87
|
hoverBg: "transparent"
|
|
88
88
|
}
|
|
89
|
-
},
|
|
89
|
+
}, bt = {
|
|
90
90
|
sm: "[&_svg]:size-4",
|
|
91
91
|
md: "[&_svg]:size-5",
|
|
92
92
|
lg: "[&_svg]:size-5"
|
|
93
|
-
},
|
|
93
|
+
}, ut = {
|
|
94
94
|
sm: {
|
|
95
95
|
fontSize: "13px",
|
|
96
96
|
fontWeight: 500,
|
|
@@ -106,68 +106,137 @@ const lt = {
|
|
|
106
106
|
fontWeight: 500,
|
|
107
107
|
lineHeight: "140%"
|
|
108
108
|
}
|
|
109
|
+
}, K = {
|
|
110
|
+
activeBg: "active:bg-[var(--button-active-bg,var(--button-hover-bg,var(--button-bg)))]",
|
|
111
|
+
bg: "bg-[var(--button-bg)]",
|
|
112
|
+
color: "text-[var(--button-color)]",
|
|
113
|
+
hoverBg: "hover:bg-[var(--button-hover-bg,var(--button-bg))]"
|
|
114
|
+
}, B = {
|
|
115
|
+
fontSize: "text-[length:var(--button-font-size)]",
|
|
116
|
+
fontWeight: "font-[var(--button-font-weight)]",
|
|
117
|
+
lineHeight: "leading-[var(--button-line-height)]"
|
|
118
|
+
}, L = {
|
|
119
|
+
md: {
|
|
120
|
+
activeBg: "md:active:bg-[var(--md-button-active-bg,var(--md-button-hover-bg,var(--md-button-bg)))]",
|
|
121
|
+
bg: "md:bg-[var(--md-button-bg)]",
|
|
122
|
+
color: "md:text-[var(--md-button-color)]",
|
|
123
|
+
hoverBg: "md:hover:bg-[var(--md-button-hover-bg,var(--md-button-bg))]"
|
|
124
|
+
},
|
|
125
|
+
lg: {
|
|
126
|
+
activeBg: "lg:active:bg-[var(--lg-button-active-bg,var(--lg-button-hover-bg,var(--lg-button-bg)))]",
|
|
127
|
+
bg: "lg:bg-[var(--lg-button-bg)]",
|
|
128
|
+
color: "lg:text-[var(--lg-button-color)]",
|
|
129
|
+
hoverBg: "lg:hover:bg-[var(--lg-button-hover-bg,var(--lg-button-bg))]"
|
|
130
|
+
},
|
|
131
|
+
xl: {
|
|
132
|
+
activeBg: "xl:active:bg-[var(--xl-button-active-bg,var(--xl-button-hover-bg,var(--xl-button-bg)))]",
|
|
133
|
+
bg: "xl:bg-[var(--xl-button-bg)]",
|
|
134
|
+
color: "xl:text-[var(--xl-button-color)]",
|
|
135
|
+
hoverBg: "xl:hover:bg-[var(--xl-button-hover-bg,var(--xl-button-bg))]"
|
|
136
|
+
}
|
|
137
|
+
}, z = {
|
|
138
|
+
md: {
|
|
139
|
+
fontSize: "md:text-[length:var(--md-button-font-size)]",
|
|
140
|
+
fontWeight: "md:font-[var(--md-button-font-weight)]",
|
|
141
|
+
lineHeight: "md:leading-[var(--md-button-line-height)]"
|
|
142
|
+
},
|
|
143
|
+
lg: {
|
|
144
|
+
fontSize: "lg:text-[length:var(--lg-button-font-size)]",
|
|
145
|
+
fontWeight: "lg:font-[var(--lg-button-font-weight)]",
|
|
146
|
+
lineHeight: "lg:leading-[var(--lg-button-line-height)]"
|
|
147
|
+
},
|
|
148
|
+
xl: {
|
|
149
|
+
fontSize: "xl:text-[length:var(--xl-button-font-size)]",
|
|
150
|
+
fontWeight: "xl:font-[var(--xl-button-font-weight)]",
|
|
151
|
+
lineHeight: "xl:leading-[var(--xl-button-line-height)]"
|
|
152
|
+
}
|
|
153
|
+
}, vt = {
|
|
154
|
+
md: {
|
|
155
|
+
sm: "md:[&_svg]:size-4",
|
|
156
|
+
md: "md:[&_svg]:size-5",
|
|
157
|
+
lg: "md:[&_svg]:size-5"
|
|
158
|
+
},
|
|
159
|
+
lg: {
|
|
160
|
+
sm: "lg:[&_svg]:size-4",
|
|
161
|
+
md: "lg:[&_svg]:size-5",
|
|
162
|
+
lg: "lg:[&_svg]:size-5"
|
|
163
|
+
},
|
|
164
|
+
xl: {
|
|
165
|
+
sm: "xl:[&_svg]:size-4",
|
|
166
|
+
md: "xl:[&_svg]:size-5",
|
|
167
|
+
lg: "xl:[&_svg]:size-5"
|
|
168
|
+
}
|
|
109
169
|
};
|
|
110
|
-
function
|
|
170
|
+
function dt({
|
|
111
171
|
alignContent: o,
|
|
112
172
|
md: t,
|
|
113
|
-
lg:
|
|
114
|
-
xl:
|
|
173
|
+
lg: r,
|
|
174
|
+
xl: a
|
|
115
175
|
}) {
|
|
116
176
|
const e = [], n = {};
|
|
117
|
-
return f(o, e, n,
|
|
177
|
+
return f(o, e, n, { breakpoint: "base" }), f(t?.alignContent, e, n, {
|
|
178
|
+
breakpoint: "md",
|
|
179
|
+
variablePrefix: "md-"
|
|
180
|
+
}), f(r?.alignContent, e, n, {
|
|
181
|
+
breakpoint: "lg",
|
|
182
|
+
variablePrefix: "lg-"
|
|
183
|
+
}), f(a?.alignContent, e, n, {
|
|
184
|
+
breakpoint: "xl",
|
|
185
|
+
variablePrefix: "xl-"
|
|
186
|
+
}), {
|
|
118
187
|
className: e.join(" "),
|
|
119
188
|
style: Object.keys(n).length ? n : void 0
|
|
120
189
|
};
|
|
121
190
|
}
|
|
122
|
-
function
|
|
191
|
+
function ft({ variant: o, md: t, lg: r, xl: a }, e = {}) {
|
|
123
192
|
const n = [], i = {};
|
|
124
|
-
return h(o, e, n, i), h(t?.variant, e.md, n, i, "md"), h(
|
|
193
|
+
return h(o, e, { classNames: n, style: i }), h(t?.variant, e.md, { classNames: n, style: i }, "md"), h(r?.variant, e.lg, { classNames: n, style: i }, "lg"), h(a?.variant, e.xl, { classNames: n, style: i }, "xl"), {
|
|
125
194
|
className: n.join(" "),
|
|
126
195
|
style: Object.keys(i).length ? i : void 0
|
|
127
196
|
};
|
|
128
197
|
}
|
|
129
|
-
function
|
|
198
|
+
function mt({
|
|
130
199
|
activeBg: o,
|
|
131
200
|
bg: t,
|
|
132
|
-
color:
|
|
133
|
-
hoverBg:
|
|
201
|
+
color: r,
|
|
202
|
+
hoverBg: a,
|
|
134
203
|
md: e,
|
|
135
204
|
lg: n,
|
|
136
205
|
xl: i
|
|
137
206
|
}) {
|
|
138
207
|
const l = [], s = {};
|
|
139
|
-
return x({ activeBg: o, bg: t, color:
|
|
208
|
+
return x({ activeBg: o, bg: t, color: r, hoverBg: a }, l, s), x(e, l, s, "md"), x(n, l, s, "lg"), x(i, l, s, "xl"), {
|
|
140
209
|
className: l.join(" "),
|
|
141
210
|
style: Object.keys(s).length ? s : void 0
|
|
142
211
|
};
|
|
143
212
|
}
|
|
144
|
-
function
|
|
213
|
+
function ht({
|
|
145
214
|
fontSize: o,
|
|
146
215
|
fontWeight: t,
|
|
147
|
-
lineHeight:
|
|
148
|
-
md:
|
|
216
|
+
lineHeight: r,
|
|
217
|
+
md: a,
|
|
149
218
|
lg: e,
|
|
150
219
|
xl: n
|
|
151
220
|
}) {
|
|
152
221
|
const i = [], l = {};
|
|
153
|
-
return y({ fontSize: o, fontWeight: t, lineHeight:
|
|
222
|
+
return y({ fontSize: o, fontWeight: t, lineHeight: r }, i, l), y(a, i, l, "md"), y(e, i, l, "lg"), y(n, i, l, "xl"), {
|
|
154
223
|
className: i.join(" "),
|
|
155
224
|
style: Object.keys(l).length ? l : void 0
|
|
156
225
|
};
|
|
157
226
|
}
|
|
158
|
-
function
|
|
227
|
+
function xt({
|
|
159
228
|
size: o = "md",
|
|
160
229
|
md: t,
|
|
161
|
-
lg:
|
|
162
|
-
xl:
|
|
230
|
+
lg: r,
|
|
231
|
+
xl: a
|
|
163
232
|
}) {
|
|
164
233
|
const e = [
|
|
165
|
-
|
|
234
|
+
bt[o],
|
|
166
235
|
B.fontSize,
|
|
167
236
|
B.fontWeight,
|
|
168
237
|
B.lineHeight
|
|
169
238
|
], n = {};
|
|
170
|
-
return m(o, e, n), m(t?.size, e, n, "md"), m(
|
|
239
|
+
return m(o, e, n), m(t?.size, e, n, "md"), m(r?.size, e, n, "lg"), m(a?.size, e, n, "xl"), {
|
|
171
240
|
className: e.join(" "),
|
|
172
241
|
style: n
|
|
173
242
|
};
|
|
@@ -181,106 +250,48 @@ function w(o) {
|
|
|
181
250
|
...o.border
|
|
182
251
|
}), o.size && o.p === void 0 && (t.p = J[o.size].p), delete t.activeBg, delete t.alignContent, delete t.bg, delete t.color, delete t.fontSize, delete t.fontWeight, delete t.hoverBg, delete t.lineHeight, delete t.size, delete t.variant, t;
|
|
183
252
|
}
|
|
184
|
-
function f(o, t,
|
|
253
|
+
function f(o, t, r, {
|
|
254
|
+
breakpoint: a,
|
|
255
|
+
variablePrefix: e = ""
|
|
256
|
+
}) {
|
|
185
257
|
if (!o)
|
|
186
258
|
return;
|
|
187
259
|
const n = `${e}button-justify-content`;
|
|
188
|
-
|
|
260
|
+
r[`--${n}`] = yt(o), t.push(ct[a]);
|
|
189
261
|
}
|
|
190
|
-
function m(o, t,
|
|
262
|
+
function m(o, t, r, a) {
|
|
191
263
|
if (!o)
|
|
192
264
|
return;
|
|
193
|
-
const { fontSize: e, fontWeight: n, lineHeight: i } =
|
|
194
|
-
if (!
|
|
195
|
-
|
|
265
|
+
const { fontSize: e, fontWeight: n, lineHeight: i } = ut[o];
|
|
266
|
+
if (!a) {
|
|
267
|
+
r["--button-font-size"] = e, r["--button-font-weight"] = n, r["--button-line-height"] = i;
|
|
196
268
|
return;
|
|
197
269
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
z[
|
|
201
|
-
z[
|
|
202
|
-
z[
|
|
270
|
+
r[`--${a}-button-font-size`] = e, r[`--${a}-button-font-weight`] = n, r[`--${a}-button-line-height`] = i, t.push(
|
|
271
|
+
vt[a][o],
|
|
272
|
+
z[a].fontSize,
|
|
273
|
+
z[a].fontWeight,
|
|
274
|
+
z[a].lineHeight
|
|
203
275
|
);
|
|
204
276
|
}
|
|
205
|
-
function h(o, t,
|
|
277
|
+
function h(o, t, { classNames: r, style: a }, e) {
|
|
206
278
|
if (!o)
|
|
207
279
|
return;
|
|
208
280
|
const n = e ? L[e] : K, i = e ? `${e}-` : "", l = gt[o];
|
|
209
|
-
t?.bg === void 0 && (
|
|
281
|
+
t?.bg === void 0 && (a[`--${i}button-bg`] = c(l.bg), r.push(n.bg)), t?.color === void 0 && (a[`--${i}button-color`] = c(l.color), r.push(n.color)), t?.bg === void 0 && t?.hoverBg === void 0 && (a[`--${i}button-hover-bg`] = c(l.hoverBg), r.push(n.hoverBg)), t?.bg === void 0 && t?.hoverBg === void 0 && t?.activeBg === void 0 && (a[`--${i}button-active-bg`] = c(l.activeBg), r.push(n.activeBg));
|
|
210
282
|
}
|
|
211
|
-
function x(o, t,
|
|
283
|
+
function x(o, t, r, a) {
|
|
212
284
|
if (!o)
|
|
213
285
|
return;
|
|
214
|
-
const { activeBg: e, bg: n, color: i, hoverBg: l } = o, s =
|
|
215
|
-
n !== void 0 && (
|
|
286
|
+
const { activeBg: e, bg: n, color: i, hoverBg: l } = o, s = a ? L[a] : K, v = a ? `${a}-` : "";
|
|
287
|
+
n !== void 0 && (r[`--${v}button-bg`] = c(n), t.push(s.bg, s.hoverBg, s.activeBg)), l !== void 0 && (r[`--${v}button-hover-bg`] = c(l), t.push(s.hoverBg)), e !== void 0 && (r[`--${v}button-active-bg`] = c(e), t.push(s.activeBg)), i !== void 0 && (r[`--${v}button-color`] = c(i), t.push(s.color));
|
|
216
288
|
}
|
|
217
|
-
function y(o, t,
|
|
289
|
+
function y(o, t, r, a) {
|
|
218
290
|
if (!o)
|
|
219
291
|
return;
|
|
220
|
-
const { fontSize: e, fontWeight: n, lineHeight: i } = o, l =
|
|
221
|
-
e !== void 0 && (
|
|
292
|
+
const { fontSize: e, fontWeight: n, lineHeight: i } = o, l = a ? z[a] : B, s = a ? `${a}-` : "";
|
|
293
|
+
e !== void 0 && (r[`--${s}button-font-size`] = p(e), t.push(l.fontSize)), n !== void 0 && (r[`--${s}button-font-weight`] = p(n), t.push(l.fontWeight)), i !== void 0 && (r[`--${s}button-line-height`] = p(i), t.push(l.lineHeight));
|
|
222
294
|
}
|
|
223
|
-
const K = {
|
|
224
|
-
activeBg: "active:bg-[var(--button-active-bg,var(--button-hover-bg,var(--button-bg)))]",
|
|
225
|
-
bg: "bg-[var(--button-bg)]",
|
|
226
|
-
color: "text-[var(--button-color)]",
|
|
227
|
-
hoverBg: "hover:bg-[var(--button-hover-bg,var(--button-bg))]"
|
|
228
|
-
}, B = {
|
|
229
|
-
fontSize: "text-[length:var(--button-font-size)]",
|
|
230
|
-
fontWeight: "font-[var(--button-font-weight)]",
|
|
231
|
-
lineHeight: "leading-[var(--button-line-height)]"
|
|
232
|
-
}, L = {
|
|
233
|
-
md: {
|
|
234
|
-
activeBg: "md:active:bg-[var(--md-button-active-bg,var(--md-button-hover-bg,var(--md-button-bg)))]",
|
|
235
|
-
bg: "md:bg-[var(--md-button-bg)]",
|
|
236
|
-
color: "md:text-[var(--md-button-color)]",
|
|
237
|
-
hoverBg: "md:hover:bg-[var(--md-button-hover-bg,var(--md-button-bg))]"
|
|
238
|
-
},
|
|
239
|
-
lg: {
|
|
240
|
-
activeBg: "lg:active:bg-[var(--lg-button-active-bg,var(--lg-button-hover-bg,var(--lg-button-bg)))]",
|
|
241
|
-
bg: "lg:bg-[var(--lg-button-bg)]",
|
|
242
|
-
color: "lg:text-[var(--lg-button-color)]",
|
|
243
|
-
hoverBg: "lg:hover:bg-[var(--lg-button-hover-bg,var(--lg-button-bg))]"
|
|
244
|
-
},
|
|
245
|
-
xl: {
|
|
246
|
-
activeBg: "xl:active:bg-[var(--xl-button-active-bg,var(--xl-button-hover-bg,var(--xl-button-bg)))]",
|
|
247
|
-
bg: "xl:bg-[var(--xl-button-bg)]",
|
|
248
|
-
color: "xl:text-[var(--xl-button-color)]",
|
|
249
|
-
hoverBg: "xl:hover:bg-[var(--xl-button-hover-bg,var(--xl-button-bg))]"
|
|
250
|
-
}
|
|
251
|
-
}, z = {
|
|
252
|
-
md: {
|
|
253
|
-
fontSize: "md:text-[length:var(--md-button-font-size)]",
|
|
254
|
-
fontWeight: "md:font-[var(--md-button-font-weight)]",
|
|
255
|
-
lineHeight: "md:leading-[var(--md-button-line-height)]"
|
|
256
|
-
},
|
|
257
|
-
lg: {
|
|
258
|
-
fontSize: "lg:text-[length:var(--lg-button-font-size)]",
|
|
259
|
-
fontWeight: "lg:font-[var(--lg-button-font-weight)]",
|
|
260
|
-
lineHeight: "lg:leading-[var(--lg-button-line-height)]"
|
|
261
|
-
},
|
|
262
|
-
xl: {
|
|
263
|
-
fontSize: "xl:text-[length:var(--xl-button-font-size)]",
|
|
264
|
-
fontWeight: "xl:font-[var(--xl-button-font-weight)]",
|
|
265
|
-
lineHeight: "xl:leading-[var(--xl-button-line-height)]"
|
|
266
|
-
}
|
|
267
|
-
}, xt = {
|
|
268
|
-
md: {
|
|
269
|
-
sm: "md:[&_svg]:size-4",
|
|
270
|
-
md: "md:[&_svg]:size-5",
|
|
271
|
-
lg: "md:[&_svg]:size-5"
|
|
272
|
-
},
|
|
273
|
-
lg: {
|
|
274
|
-
sm: "lg:[&_svg]:size-4",
|
|
275
|
-
md: "lg:[&_svg]:size-5",
|
|
276
|
-
lg: "lg:[&_svg]:size-5"
|
|
277
|
-
},
|
|
278
|
-
xl: {
|
|
279
|
-
sm: "xl:[&_svg]:size-4",
|
|
280
|
-
md: "xl:[&_svg]:size-5",
|
|
281
|
-
lg: "xl:[&_svg]:size-5"
|
|
282
|
-
}
|
|
283
|
-
};
|
|
284
295
|
function c(o) {
|
|
285
296
|
return String(p(o));
|
|
286
297
|
}
|
|
@@ -294,8 +305,8 @@ function yt(o) {
|
|
|
294
305
|
function jt({
|
|
295
306
|
alignContent: o,
|
|
296
307
|
children: t,
|
|
297
|
-
className:
|
|
298
|
-
disabled:
|
|
308
|
+
className: r,
|
|
309
|
+
disabled: a,
|
|
299
310
|
display: e,
|
|
300
311
|
border: n,
|
|
301
312
|
bg: i,
|
|
@@ -312,8 +323,8 @@ function jt({
|
|
|
312
323
|
minHeight: Y,
|
|
313
324
|
minWidth: Z,
|
|
314
325
|
md: g,
|
|
315
|
-
lg:
|
|
316
|
-
xl:
|
|
326
|
+
lg: b,
|
|
327
|
+
xl: u,
|
|
317
328
|
p: O,
|
|
318
329
|
position: tt,
|
|
319
330
|
size: ot,
|
|
@@ -322,22 +333,22 @@ function jt({
|
|
|
322
333
|
width: et,
|
|
323
334
|
...C
|
|
324
335
|
}) {
|
|
325
|
-
const d =
|
|
336
|
+
const d = !!a || U, N = ot ?? "md", S = xt({
|
|
326
337
|
size: N,
|
|
327
338
|
md: g,
|
|
328
|
-
lg:
|
|
329
|
-
xl:
|
|
330
|
-
}), j =
|
|
339
|
+
lg: b,
|
|
340
|
+
xl: u
|
|
341
|
+
}), j = dt({
|
|
331
342
|
alignContent: o,
|
|
332
343
|
md: g,
|
|
333
|
-
lg:
|
|
334
|
-
xl:
|
|
335
|
-
}), $ =
|
|
344
|
+
lg: b,
|
|
345
|
+
xl: u
|
|
346
|
+
}), $ = ft(
|
|
336
347
|
{
|
|
337
348
|
variant: nt ?? "default",
|
|
338
349
|
md: g,
|
|
339
|
-
lg:
|
|
340
|
-
xl:
|
|
350
|
+
lg: b,
|
|
351
|
+
xl: u
|
|
341
352
|
},
|
|
342
353
|
{
|
|
343
354
|
activeBg: A,
|
|
@@ -345,25 +356,25 @@ function jt({
|
|
|
345
356
|
color: l,
|
|
346
357
|
hoverBg: V,
|
|
347
358
|
md: g,
|
|
348
|
-
lg:
|
|
349
|
-
xl:
|
|
359
|
+
lg: b,
|
|
360
|
+
xl: u
|
|
350
361
|
}
|
|
351
|
-
),
|
|
362
|
+
), P = mt({
|
|
352
363
|
activeBg: A,
|
|
353
364
|
bg: i,
|
|
354
365
|
color: l,
|
|
355
366
|
hoverBg: V,
|
|
356
367
|
md: g,
|
|
357
|
-
lg:
|
|
358
|
-
xl:
|
|
359
|
-
}),
|
|
368
|
+
lg: b,
|
|
369
|
+
xl: u
|
|
370
|
+
}), W = ht({
|
|
360
371
|
fontSize: M,
|
|
361
372
|
fontWeight: Q,
|
|
362
373
|
lineHeight: X,
|
|
363
374
|
md: g,
|
|
364
|
-
lg:
|
|
365
|
-
xl:
|
|
366
|
-
}),
|
|
375
|
+
lg: b,
|
|
376
|
+
xl: u
|
|
377
|
+
}), k = {
|
|
367
378
|
...C,
|
|
368
379
|
border: {
|
|
369
380
|
radius: E[N],
|
|
@@ -376,54 +387,54 @@ function jt({
|
|
|
376
387
|
minHeight: Y,
|
|
377
388
|
minWidth: Z,
|
|
378
389
|
md: w(g),
|
|
379
|
-
lg: w(
|
|
380
|
-
xl: w(
|
|
390
|
+
lg: w(b),
|
|
391
|
+
xl: w(u),
|
|
381
392
|
p: O ?? J[N].p,
|
|
382
393
|
position: tt ?? { type: "relative" },
|
|
383
394
|
width: et ?? (v ? "100%" : void 0)
|
|
384
|
-
},
|
|
395
|
+
}, I = rt(
|
|
385
396
|
G,
|
|
386
397
|
S.className,
|
|
387
398
|
_ && "no-underline",
|
|
388
399
|
j.className,
|
|
389
400
|
$.className,
|
|
401
|
+
P.className,
|
|
390
402
|
W.className,
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
), k = S.style || j.style || $.style || W.style || H.style || T ? {
|
|
403
|
+
r
|
|
404
|
+
), R = S.style || j.style || $.style || P.style || W.style || T ? {
|
|
394
405
|
...S.style,
|
|
395
406
|
...j.style,
|
|
396
407
|
...$.style,
|
|
408
|
+
...P.style,
|
|
397
409
|
...W.style,
|
|
398
|
-
...H.style,
|
|
399
410
|
...T
|
|
400
|
-
} : void 0, D = /* @__PURE__ */
|
|
411
|
+
} : void 0, D = /* @__PURE__ */ H(at, { children: t });
|
|
401
412
|
if (_) {
|
|
402
413
|
const F = C;
|
|
403
|
-
return /* @__PURE__ */
|
|
414
|
+
return /* @__PURE__ */ H(
|
|
404
415
|
q,
|
|
405
416
|
{
|
|
406
417
|
...F,
|
|
407
|
-
...
|
|
418
|
+
...k,
|
|
408
419
|
"aria-disabled": d || void 0,
|
|
409
420
|
as: "a",
|
|
410
|
-
className:
|
|
421
|
+
className: I,
|
|
411
422
|
href: d ? void 0 : _,
|
|
412
|
-
style:
|
|
423
|
+
style: R,
|
|
413
424
|
tabIndex: d ? -1 : F.tabIndex,
|
|
414
425
|
children: D
|
|
415
426
|
}
|
|
416
427
|
);
|
|
417
428
|
}
|
|
418
|
-
return /* @__PURE__ */
|
|
429
|
+
return /* @__PURE__ */ H(
|
|
419
430
|
q,
|
|
420
431
|
{
|
|
421
432
|
...C,
|
|
422
|
-
...
|
|
433
|
+
...k,
|
|
423
434
|
as: "button",
|
|
424
|
-
className:
|
|
435
|
+
className: I,
|
|
425
436
|
disabled: d,
|
|
426
|
-
style:
|
|
437
|
+
style: R,
|
|
427
438
|
children: D
|
|
428
439
|
}
|
|
429
440
|
);
|
package/dist/flex.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("react/jsx-runtime"),w=require("./box.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("react/jsx-runtime"),w=require("./box.cjs"),v=require("./responsive-style.config-B2m9jVlX.cjs");function k(e){const t=[],n={},r={md:e.md,lg:e.lg,xl:e.xl};j(e,t,n);for(const i of v.responsiveBreakpoints){const o=r[i];o&&j(o,t,n,{classPrefix:`${i}:`,variablePrefix:`${i}-`})}return{className:t.join(" "),style:Object.keys(n).length>0?n:void 0}}function j({justify:e,align:t,gap:n,flexDirection:r,flexWrap:i,order:o,shrink:y,grow:p},d,m,{classPrefix:b="",variablePrefix:a=""}={}){const c={justifyContent:e,alignItems:t,gap:n===void 0?void 0:h(n),flexDirection:r,flexWrap:i,order:o,flexShrink:y,flexGrow:p};for(const[l,s]of Object.entries(c)){if(s==null)continue;const f=`${a}${S(l)}`,g=C(l,f);g&&(m[`--${f}`]=String(s),d.push(`${b}${g}`))}}function C(e,t){const n=`var(--${t})`;return{alignItems:x("align-items",n),flexDirection:x("flex-direction",n),flexGrow:u("grow",n),flexShrink:u("shrink",n),flexWrap:x("flex-wrap",n),gap:u("gap",n),justifyContent:x("justify-content",n),order:u("order",n)}[e]}function u(e,t){return[e,"-[",t,"]"].join("")}function x(e,t){return["[",e,":",t,"]"].join("")}function S(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function h(e){return typeof e=="number"?`${e}px`:e}function B({align:e,children:t,className:n,flexDirection:r,flexWrap:i,gap:o,grow:y,inline:p=!1,justify:d,order:m,shrink:b,md:a,lg:c,xl:l,style:s,...f}){const P=k({align:e,flexDirection:r,flexWrap:i,gap:o,grow:y,justify:d,order:m,shrink:b,md:a,lg:c,xl:l}),N=P.style||s?{...P.style,...s}:void 0;return $.jsx(w.Box,{className:v.cn(P.className,n),display:p?"inline-flex":"flex",md:a,lg:c,xl:l,style:N,...f,children:t})}exports.Flex=B;
|
package/dist/flex.js
CHANGED
|
@@ -1,29 +1,26 @@
|
|
|
1
1
|
import { jsx as j } from "react/jsx-runtime";
|
|
2
|
-
import { Box as
|
|
3
|
-
import { a as
|
|
2
|
+
import { Box as v } from "./box.js";
|
|
3
|
+
import { a as w, c as k } from "./responsive-style.config-DFuATrIM.js";
|
|
4
4
|
function C(e) {
|
|
5
5
|
const t = [], n = {}, o = {
|
|
6
6
|
md: e.md,
|
|
7
7
|
lg: e.lg,
|
|
8
8
|
xl: e.xl
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
for (const i of
|
|
10
|
+
N(e, t, n);
|
|
11
|
+
for (const i of w) {
|
|
12
12
|
const r = o[i];
|
|
13
|
-
r &&
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
`${i}:`,
|
|
18
|
-
`${i}-`
|
|
19
|
-
);
|
|
13
|
+
r && N(r, t, n, {
|
|
14
|
+
classPrefix: `${i}:`,
|
|
15
|
+
variablePrefix: `${i}-`
|
|
16
|
+
});
|
|
20
17
|
}
|
|
21
18
|
return {
|
|
22
19
|
className: t.join(" "),
|
|
23
20
|
style: Object.keys(n).length > 0 ? n : void 0
|
|
24
21
|
};
|
|
25
22
|
}
|
|
26
|
-
function
|
|
23
|
+
function N({
|
|
27
24
|
justify: e,
|
|
28
25
|
align: t,
|
|
29
26
|
gap: n,
|
|
@@ -32,7 +29,10 @@ function P({
|
|
|
32
29
|
order: r,
|
|
33
30
|
shrink: p,
|
|
34
31
|
grow: x
|
|
35
|
-
}, y, d,
|
|
32
|
+
}, y, d, {
|
|
33
|
+
classPrefix: b = "",
|
|
34
|
+
variablePrefix: l = ""
|
|
35
|
+
} = {}) {
|
|
36
36
|
const c = {
|
|
37
37
|
justifyContent: e,
|
|
38
38
|
alignItems: t,
|
|
@@ -93,7 +93,7 @@ function G({
|
|
|
93
93
|
style: s,
|
|
94
94
|
...f
|
|
95
95
|
}) {
|
|
96
|
-
const
|
|
96
|
+
const P = C({
|
|
97
97
|
align: e,
|
|
98
98
|
flexDirection: o,
|
|
99
99
|
flexWrap: i,
|
|
@@ -105,14 +105,14 @@ function G({
|
|
|
105
105
|
md: l,
|
|
106
106
|
lg: c,
|
|
107
107
|
xl: a
|
|
108
|
-
}), $ =
|
|
109
|
-
...
|
|
108
|
+
}), $ = P.style || s ? {
|
|
109
|
+
...P.style,
|
|
110
110
|
...s
|
|
111
111
|
} : void 0;
|
|
112
112
|
return /* @__PURE__ */ j(
|
|
113
|
-
|
|
113
|
+
v,
|
|
114
114
|
{
|
|
115
|
-
className:
|
|
115
|
+
className: k(P.className, n),
|
|
116
116
|
display: x ? "inline-flex" : "flex",
|
|
117
117
|
md: l,
|
|
118
118
|
lg: c,
|
package/dist/grid.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),w=require("./box.cjs"),g=require("./responsive-style.config-B2m9jVlX.cjs");function j(
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),w=require("./box.cjs"),g=require("./responsive-style.config-B2m9jVlX.cjs");function j(i){const t=[],n={},l={md:i.md,lg:i.lg,xl:i.xl};a(i,t,n);for(const e of g.responsiveBreakpoints){const o=l[e];o&&a(o,t,n,{classPrefix:`${e}:`,variablePrefix:`${e}-`})}return{className:t.join(" "),style:Object.keys(n).length>0?n:void 0}}function a({cols:i,gap:t},n,l,{classPrefix:e="",variablePrefix:o=""}={}){if(i!==void 0){const c=`${o}grid-template-columns`;l[`--${c}`]=`repeat(${i}, minmax(0, 1fr))`,n.push(`${e}${m("grid-cols",`var(--${c})`)}`)}if(t!==void 0){const c=`${o}grid-gap`;l[`--${c}`]=G(t),n.push(`${e}${m("gap",`var(--${c})`)}`)}}function m(i,t){return[i,"-[",t,"]"].join("")}function G(i){return typeof i=="number"?`${i}px`:i}function N({children:i,className:t,cols:n=1,gap:l=0,md:e,lg:o,xl:c,style:s,...h}){const r=j({cols:n,gap:l,md:e,lg:o,xl:c}),v=d(e),x=d(o),y=d(c),$=r.style||s?{...r.style,...s}:void 0;return u.jsx(w.Box,{...h,display:"grid",className:g.cn(r.className,t),md:v,lg:x,xl:y,style:$,children:i})}function f({children:i,className:t,...n}){return u.jsx("div",{className:t,...n,children:i})}const S=Object.assign(N,{Item:f});function d(i){if(i)return{aspectRatio:i.aspectRatio,background:i.background,backgroundColor:i.backgroundColor,boxShadow:i.boxShadow,color:i.color,height:i.height,maxHeight:i.maxHeight,maxWidth:i.maxWidth,minHeight:i.minHeight,minWidth:i.minWidth,m:i.m,p:i.p,opacity:i.opacity,overflow:i.overflow,overflowX:i.overflowX,overflowY:i.overflowY,pointerEvents:i.pointerEvents,transform:i.transform,transformOrigin:i.transformOrigin,width:i.width}}exports.Grid=S;exports.GridItem=f;
|