toku-ui 0.2.0 → 0.3.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/dist/components/TIconButton/TIconButton.d.ts +4 -2
- package/dist/components/TIconButton/TIconButton.d.ts.map +1 -1
- package/dist/components/TIconButton/TIconButton.styles.d.ts.map +1 -1
- package/dist/components/TIconButton/TIconButton.types.d.ts +2 -1
- package/dist/components/TIconButton/TIconButton.types.d.ts.map +1 -1
- package/dist/index.es.js +8 -3
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -172,5 +172,5 @@ To pass a single animation please supply them in simple values, e.g. animation('
|
|
|
172
172
|
`,77:`remToPx expects a value in "rem" but you provided it in "%s".
|
|
173
173
|
|
|
174
174
|
`,78:`base must be set in "px" or "%" but you set it in "%s".
|
|
175
|
-
`};function Jo(){for(var l=arguments.length,s=new Array(l),u=0;u<l;u++)s[u]=arguments[u];var g=s[0],m=[],T;for(T=1;T<s.length;T+=1)m.push(s[T]);return m.forEach(function(x){g=g.replace(/%[a-z]/,x)}),g}var He=function(l){Ko(s,l);function s(u){var g;if(process.env.NODE_ENV==="production")g=l.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+u+" for more information.")||this;else{for(var m=arguments.length,T=new Array(m>1?m-1:0),x=1;x<m;x++)T[x-1]=arguments[x];g=l.call(this,Jo.apply(void 0,[Xo[u]].concat(T)))||this}return qo(g)}return s}(St(Error));function At(l){return Math.round(l*255)}function Qo(l,s,u){return At(l)+","+At(s)+","+At(u)}function jn(l,s,u,g){if(g===void 0&&(g=Qo),s===0)return g(u,u,u);var m=(l%360+360)%360/60,T=(1-Math.abs(2*u-1))*s,x=T*(1-Math.abs(m%2-1)),$=0,M=0,k=0;m>=0&&m<1?($=T,M=x):m>=1&&m<2?($=x,M=T):m>=2&&m<3?(M=T,k=x):m>=3&&m<4?(M=x,k=T):m>=4&&m<5?($=x,k=T):m>=5&&m<6&&($=T,k=x);var ne=u-T/2,re=$+ne,Se=M+ne,Ue=k+ne;return g(re,Se,Ue)}var ji={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};function Vo(l){if(typeof l!="string")return l;var s=l.toLowerCase();return ji[s]?"#"+ji[s]:l}var jo=/^#[a-fA-F0-9]{6}$/,el=/^#[a-fA-F0-9]{8}$/,nl=/^#[a-fA-F0-9]{3}$/,rl=/^#[a-fA-F0-9]{4}$/,It=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,tl=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,il=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,ul=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;function Tt(l){if(typeof l!="string")throw new He(3);var s=Vo(l);if(s.match(jo))return{red:parseInt(""+s[1]+s[2],16),green:parseInt(""+s[3]+s[4],16),blue:parseInt(""+s[5]+s[6],16)};if(s.match(el)){var u=parseFloat((parseInt(""+s[7]+s[8],16)/255).toFixed(2));return{red:parseInt(""+s[1]+s[2],16),green:parseInt(""+s[3]+s[4],16),blue:parseInt(""+s[5]+s[6],16),alpha:u}}if(s.match(nl))return{red:parseInt(""+s[1]+s[1],16),green:parseInt(""+s[2]+s[2],16),blue:parseInt(""+s[3]+s[3],16)};if(s.match(rl)){var g=parseFloat((parseInt(""+s[4]+s[4],16)/255).toFixed(2));return{red:parseInt(""+s[1]+s[1],16),green:parseInt(""+s[2]+s[2],16),blue:parseInt(""+s[3]+s[3],16),alpha:g}}var m=It.exec(s);if(m)return{red:parseInt(""+m[1],10),green:parseInt(""+m[2],10),blue:parseInt(""+m[3],10)};var T=tl.exec(s.substring(0,50));if(T)return{red:parseInt(""+T[1],10),green:parseInt(""+T[2],10),blue:parseInt(""+T[3],10),alpha:parseFloat(""+T[4])>1?parseFloat(""+T[4])/100:parseFloat(""+T[4])};var x=il.exec(s);if(x){var $=parseInt(""+x[1],10),M=parseInt(""+x[2],10)/100,k=parseInt(""+x[3],10)/100,ne="rgb("+jn($,M,k)+")",re=It.exec(ne);if(!re)throw new He(4,s,ne);return{red:parseInt(""+re[1],10),green:parseInt(""+re[2],10),blue:parseInt(""+re[3],10)}}var Se=ul.exec(s.substring(0,50));if(Se){var Ue=parseInt(""+Se[1],10),ln=parseInt(""+Se[2],10)/100,Pn=parseInt(""+Se[3],10)/100,le="rgb("+jn(Ue,ln,Pn)+")",Ae=It.exec(le);if(!Ae)throw new He(4,s,le);return{red:parseInt(""+Ae[1],10),green:parseInt(""+Ae[2],10),blue:parseInt(""+Ae[3],10),alpha:parseFloat(""+Se[4])>1?parseFloat(""+Se[4])/100:parseFloat(""+Se[4])}}throw new He(5)}function al(l){var s=l.red/255,u=l.green/255,g=l.blue/255,m=Math.max(s,u,g),T=Math.min(s,u,g),x=(m+T)/2;if(m===T)return l.alpha!==void 0?{hue:0,saturation:0,lightness:x,alpha:l.alpha}:{hue:0,saturation:0,lightness:x};var $,M=m-T,k=x>.5?M/(2-m-T):M/(m+T);switch(m){case s:$=(u-g)/M+(u<g?6:0);break;case u:$=(g-s)/M+2;break;default:$=(s-u)/M+4;break}return $*=60,l.alpha!==void 0?{hue:$,saturation:k,lightness:x,alpha:l.alpha}:{hue:$,saturation:k,lightness:x}}function eu(l){return al(Tt(l))}var ol=function(s){return s.length===7&&s[1]===s[2]&&s[3]===s[4]&&s[5]===s[6]?"#"+s[1]+s[3]+s[5]:s},Ct=ol;function yn(l){var s=l.toString(16);return s.length===1?"0"+s:s}function Rt(l){return yn(Math.round(l*255))}function ll(l,s,u){return Ct("#"+Rt(l)+Rt(s)+Rt(u))}function Ir(l,s,u){return jn(l,s,u,ll)}function fl(l,s,u){if(typeof l=="number"&&typeof s=="number"&&typeof u=="number")return Ir(l,s,u);if(typeof l=="object"&&s===void 0&&u===void 0)return Ir(l.hue,l.saturation,l.lightness);throw new He(1)}function sl(l,s,u,g){if(typeof l=="number"&&typeof s=="number"&&typeof u=="number"&&typeof g=="number")return g>=1?Ir(l,s,u):"rgba("+jn(l,s,u)+","+g+")";if(typeof l=="object"&&s===void 0&&u===void 0&&g===void 0)return l.alpha>=1?Ir(l.hue,l.saturation,l.lightness):"rgba("+jn(l.hue,l.saturation,l.lightness)+","+l.alpha+")";throw new He(2)}function Et(l,s,u){if(typeof l=="number"&&typeof s=="number"&&typeof u=="number")return Ct("#"+yn(l)+yn(s)+yn(u));if(typeof l=="object"&&s===void 0&&u===void 0)return Ct("#"+yn(l.red)+yn(l.green)+yn(l.blue));throw new He(6)}function cl(l,s,u,g){if(typeof l=="string"&&typeof s=="number"){var m=Tt(l);return"rgba("+m.red+","+m.green+","+m.blue+","+s+")"}else{if(typeof l=="number"&&typeof s=="number"&&typeof u=="number"&&typeof g=="number")return g>=1?Et(l,s,u):"rgba("+l+","+s+","+u+","+g+")";if(typeof l=="object"&&s===void 0&&u===void 0&&g===void 0)return l.alpha>=1?Et(l.red,l.green,l.blue):"rgba("+l.red+","+l.green+","+l.blue+","+l.alpha+")"}throw new He(7)}var hl=function(s){return typeof s.red=="number"&&typeof s.green=="number"&&typeof s.blue=="number"&&(typeof s.alpha!="number"||typeof s.alpha>"u")},pl=function(s){return typeof s.red=="number"&&typeof s.green=="number"&&typeof s.blue=="number"&&typeof s.alpha=="number"},gl=function(s){return typeof s.hue=="number"&&typeof s.saturation=="number"&&typeof s.lightness=="number"&&(typeof s.alpha!="number"||typeof s.alpha>"u")},dl=function(s){return typeof s.hue=="number"&&typeof s.saturation=="number"&&typeof s.lightness=="number"&&typeof s.alpha=="number"};function nu(l){if(typeof l!="object")throw new He(8);if(pl(l))return cl(l);if(hl(l))return Et(l);if(dl(l))return sl(l);if(gl(l))return fl(l);throw new He(8)}function ru(l,s,u){return function(){var m=u.concat(Array.prototype.slice.call(arguments));return m.length>=s?l.apply(this,m):ru(l,s,m)}}function tu(l){return ru(l,l.length,[])}function iu(l,s,u){return Math.max(l,Math.min(s,u))}function vl(l,s){if(s==="transparent")return s;var u=eu(s);return nu(Sr({},u,{lightness:iu(0,1,u.lightness-parseFloat(l))}))}var ml=tu(vl),_l=ml;function Tr(l){if(l==="transparent")return 0;var s=Tt(l),u=Object.keys(s).map(function(x){var $=s[x]/255;return $<=.03928?$/12.92:Math.pow(($+.055)/1.055,2.4)}),g=u[0],m=u[1],T=u[2];return parseFloat((.2126*g+.7152*m+.0722*T).toFixed(3))}function bl(l,s){if(s==="transparent")return s;var u=eu(s);return nu(Sr({},u,{lightness:iu(0,1,u.lightness+parseFloat(l))}))}var yl=tu(bl),xl=yl;const wl=(l,s)=>_l(Tr(on.colors.primary.main)-Tr(on.colors.primary[s]),l),On=(l,s)=>xl(Tr(on.colors.primary[s])-Tr(on.colors.primary.main),l),Sl=l=>{var g,m;const s=Le.merge(on,l),u=(m=(g=l.colors)==null?void 0:g.primary)==null?void 0:m.main;return u&&(s.colors.primary.ultraDark=wl(u,"ultraDark"),s.colors.primary.dark=u,s.colors.primary.toku=On(u,"toku"),s.colors.primary.light1=On(u,"light1"),s.colors.primary.light2=On(u,"light2"),s.colors.primary.light3=On(u,"light3"),s.colors.primary.light4=On(u,"light4"),s.colors.primary.light5=On(u,"light5")),s},Ft=Symbol("theme"),we=()=>{const l=A.inject(Ft,void 0);return A.computed(()=>(l==null?void 0:l.value)??on)},Al=()=>{const l=we();return A.computed(()=>an.css({"&, *":{margin:0,padding:0,boxSizing:"border-box"},cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"0.625rem",fontWeight:l.value.typography.fontWeight.semibold,"&--primary":{borderRadius:"0.5rem",backgroundColor:l.value.colors.primary.main,boxShadow:"0px 0px 8px 0px rgba(0, 0, 0, 0.1)",border:`1px solid ${l.value.colors.primary.main}`,color:"#FFFFFF","&:hover:not(&:disabled)":{backgroundColor:l.value.colors.primary.ultraDark},"&:focus":{border:`1px solid ${l.value.colors.primary.light1}`},"&:disabled":{cursor:"not-allowed",border:`1px solid ${l.value.colors.gray.light2}`,backgroundColor:l.value.colors.gray.light2,color:l.value.colors.gray.medium2}},"&--secondary":{borderRadius:"0.5rem",backgroundColor:"#FFFFFF",border:`1px solid ${l.value.colors.primary.main}`,boxShadow:"0px 0px 8px 0px rgba(0, 0, 0, 0.1)",color:l.value.colors.primary.main,"&:hover:not(&:disabled)":{backgroundColor:l.value.colors.primary.light3},"&:focus":{border:`1px solid ${l.value.colors.primary.light1}`},"&:disabled":{cursor:"not-allowed",border:`1px solid ${l.value.colors.gray.light2}`,backgroundColor:l.value.colors.gray.light2,color:l.value.colors.gray.medium2}},"&--tertiary":{background:"none",border:"none",margin:0,padding:0,color:l.value.colors.primary.main,"&:hover:not(&:disabled)":{color:l.value.colors.primary.light2},"&:focus":{color:l.value.colors.primary.light1},"&:disabled":{cursor:"not-allowed",color:l.value.colors.gray.medium1}},"&--large":{height:"3rem",padding:"0.5rem 1rem",lineHeight:"1.5rem",fontSize:"1.125rem"},"&--medium":{height:"2.5rem",padding:"0.5rem 1rem",lineHeight:"1.375rem",fontSize:"1rem"},"&--small":{height:"2rem",padding:"0.5rem 0.75rem",lineHeight:"1.25rem",fontSize:"0.875rem"},"&--full-width":{width:"100%"},"&--loading, &--loading:disabled, &--loading:hover:not(&:disabled), &--loading:focus":{color:"transparent",position:"relative"},"&__spinner":{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"},"&--primary &__spinner, &--loading:disabled &__spinner":{color:"#fff"},"&--tertiary:disabled &__spinner":{color:l.value.colors.gray.medium1},"&--secondary &__spinner, &--tertiary &__spinner":{color:l.value.colors.primary.main}}))},Il={variant:"primary",size:"medium",type:"button"},Tl=A.defineComponent({name:"TButton",props:{variant:String,size:String,disabled:Boolean,leftIcon:String,rightIcon:String,type:String,fullWidth:Boolean,loading:Boolean},emits:["click"],setup(l,{attrs:s,slots:u,emit:g}){const m=A.computed(()=>Le.merge({},Il,l,s)),T=Al(),x=we(),$=A.computed(()=>[T.value,`${T.value}--${m.value.variant}`,`${T.value}--${m.value.size}`,{[`${T.value}--full-width`]:m.value.fullWidth,[`${T.value}--loading`]:m.value.loading}]);return()=>{var M;return A.h("button",xt([{class:$.value,attrs:{type:m.value.type,disabled:m.value.disabled},on:{click:()=>g("click")}},s]),[m.value.leftIcon&&A.h(bn.Icon,{attrs:{icon:`${x.value.iconSet}:${m.value.leftIcon}`}}),(M=u.default)==null?void 0:M.call(u),m.value.rightIcon&&A.h(bn.Icon,{attrs:{icon:`${x.value.iconSet}:${m.value.rightIcon}`}}),m.value.loading&&A.h(bn.Icon,{class:`${T.value}__spinner`,attrs:{icon:"svg-spinners:90-ring-with-bg"}})])}}}),Cl=A.defineComponent({name:"TThemeProvider",props:{theme:{type:Object,default:()=>{}}},setup(l,{slots:s}){const u=A.computed(()=>Le.merge(on,l.theme));return A.provide(Ft,u),()=>{var g;return(g=s.default)==null?void 0:g.call(s)}}}),Rl=()=>{const l=we();return A.computed(()=>an.css({margin:0,padding:0,boxSizing:"border-box",color:l.value.typography.color,fontFamily:l.value.typography.fontFamily,"&--h1":{fontSize:"3.25rem",linehHeight:"3.75rem"},"&--h2":{fontSize:"3rem",lineHeight:"3.5rem"},"&--h3":{fontSize:"2.5rem",lineHeight:"3rem"},"&--h4":{fontSize:"2rem",lineHeight:"2.5rem"},"&--s1":{fontSize:"1.75rem",lineHeight:"2.25rem"},"&--s2":{fontSize:"1.5rem",lineHeight:"2rem"},"&--s3":{fontSize:"1.125rem",lineHeight:"1.625rem"},"&--s4":{fontSize:"1rem",lineHeight:"1.5rem"},"&--b0":{fontSize:"1.25rem",lineHeight:"1.625rem"},"&--b1":{fontSize:"1.125rem",lineHeight:"1.5rem"},"&--b2":{fontSize:"1rem",lineHeight:"1.375rem"},"&--b3":{fontSize:"0.875rem",lineHeight:"1.25rem"},"&--b4":{fontSize:"0.75rem",lineHeight:"1.125rem"},"&--b5":{fontSize:"0.625rem",lineHeight:"1rem"},"&--b6":{fontSize:"0.5rem",lineHeight:"1.875rem"},"&--bold":{fontWeight:l.value.typography.fontWeight.bold},"&--semibold":{fontWeight:l.value.typography.fontWeight.semibold},"&--medium":{fontWeight:l.value.typography.fontWeight.medium},"&--regular":{fontWeight:l.value.typography.fontWeight.regular},"&--normal":{fontStyle:"normal"},"&--italic":{fontStyle:"italic"}}))},El={h1:"h1",h2:"h2",h3:"h3",h4:"h4",s1:"h5",s2:"h5",s3:"h6",s4:"h6",b0:"p",b1:"p",b2:"p",b3:"p",b4:"p",b5:"p",b6:"p"},Fl={fontStyle:"normal",fontWeight:"regular",variant:"b0"},Ol=A.defineComponent({name:"TTypography",props:{fontStyle:String,fontWeight:String,variant:String},setup(l,{attrs:s,slots:u}){const g=A.computed(()=>Le.merge({},Fl,l,s)),m=Rl(),T=A.computed(()=>[m.value,`${m.value}--${g.value.variant}`,`${m.value}--${g.value.fontWeight}`,`${m.value}--${g.value.fontStyle}`]),x=A.computed(()=>El[g.value.variant]);return()=>A.h(x.value,{class:T.value},u.default?u.default():null)}}),Pl=()=>{const l=we();return A.computed(()=>an.css({margin:0,padding:0,width:"3.5rem",height:"3.5rem",boxSizing:"border-box",background:"transparent",borderRadius:"50%",border:`0.5rem solid ${l.value.colors.background}`,borderBottomColor:l.value.colors.primary.main,animation:"rotate 0.75s linear infinite",[`@media (min-width: ${l.value.breakpoints.desktop}px)`]:{width:"4.5rem",height:"4.5rem"},"@keyframes rotate":{"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}}))},Ll=A.defineComponent({name:"TSpinner",setup(){const l=Pl();return()=>A.h("div",{class:l.value})}}),Wl=()=>{const l=we(),s=A.computed(()=>an.css({"&, *":{margin:0,padding:0,boxSizing:"border-box"},display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer","&--primary":{borderRadius:"0.5rem",backgroundColor:l.value.colors.primary.main,boxShadow:"0px 0px 8px 0px rgba(0, 0, 0, 0.1)",border:`1px solid ${l.value.colors.primary.main}`,color:"#FFFFFF","&:hover:not(&:disabled)":{backgroundColor:l.value.colors.primary.ultraDark},"&:focus":{border:`1px solid ${l.value.colors.primary.light1}`},"&:disabled":{cursor:"not-allowed",border:`1px solid ${l.value.colors.gray.light2}`,backgroundColor:l.value.colors.gray.light2,color:l.value.colors.gray.medium2}},"&--secondary":{borderRadius:"0.5rem",backgroundColor:"#FFFFFF",border:`1px solid ${l.value.colors.primary.main}`,boxShadow:"0px 0px 8px 0px rgba(0, 0, 0, 0.1)",color:l.value.colors.primary.main,"&:hover:not(&:disabled)":{backgroundColor:l.value.colors.primary.light3},"&:focus":{border:`1px solid ${l.value.colors.primary.light1}`},"&:disabled":{cursor:"not-allowed",border:`1px solid ${l.value.colors.gray.light2}`,backgroundColor:l.value.colors.gray.light2,color:l.value.colors.gray.medium2}},"&--tertiary":{background:"none",border:"none",margin:0,padding:0,color:l.value.colors.primary.main,"&:hover:not(&:disabled)":{color:l.value.colors.primary.light2},"&:focus":{color:l.value.colors.primary.light1},"&:disabled":{cursor:"not-allowed",color:l.value.colors.gray.medium1}},"&--large":{height:"3rem",width:"3rem",lineHeight:"1.5rem",fontSize:"1.125rem"},"&--medium":{height:"2.5rem",width:"2.5rem",lineHeight:"1.375rem",fontSize:"1rem"},"&--small":{height:"2rem",width:"2rem",lineHeight:"1.25rem",fontSize:"0.875rem"}})),u=A.computed(()=>an.css({margin:0,padding:0,"&--large":{height:"1.25rem"},"&--medium":{height:"1.25rem"},"&--small":{height:"1rem"}}));return{baseClass:s,iconClass:u}},$l={variant:"primary",size:"medium",disabled:!1,icon:"academic-cap",type:"button"},Bl=A.defineComponent({name:"TIconButton",props:{variant:String,size:String,disabled:Boolean,icon:String,type:String},emits:["click"],setup(l,{attrs:s,emit:u}){const g=A.computed(()=>Le.merge({},$l,l,s)),{baseClass:m,iconClass:T}=Wl(),x=we(),$=A.computed(()=>[m.value,`${m.value}--${g.value.variant}`,`${m.value}--${g.value.size}`]),M=A.computed(()=>[T.value,`${T.value}--${g.value.variant}`,`${T.value}--${g.value.size}`]);return()=>A.h("button",xt([{class:$.value,attrs:{type:g.value.type,disabled:g.value.disabled},on:{click:()=>u("click")}},s]),[A.h(bn.Icon,{attrs:{icon:`${x.value.iconSet}:${g.value.icon}`},class:M.value})])}}),Dl=()=>{const l=we();return A.computed(()=>an.css({"&, *":{margin:0,padding:0,boxSizing:"border-box",color:l.value.typography.color,fontFamily:l.value.typography.fontFamily},"&__container":{gap:l.value.spacing,display:"flex",flexDirection:"column",width:"358px"},"&__label":{display:"block",fontSize:"14px",fontStyle:"normal",fontWeight:600,lineHeight:"20px"},"&__input-wrapper":{position:"relative"},"&__input":{display:"flex",width:"100%",background:"#FFF",border:`1px solid ${l.value.colors.gray.light2}`,borderRadius:"4px",padding:"4px 8px",gap:"8px",height:"40px",fontSize:"16px",fontStyle:"normal",fontWeight:400,lineHeight:"22px","&::placeholder":{color:l.value.colors.gray.medium2},"&:hover":{borderColor:l.value.colors.gray.medium2},"&:focus":{borderColor:l.value.colors.primary.light1},"&:focus-visible":{outline:"none"},"&:disabled":{background:l.value.colors.gray.light3,borderColor:l.value.colors.gray.light3},"&--left-icon":{paddingLeft:"32px"},"&--right-icon":{paddingRight:"32px"}},"&__icon":{position:"absolute",top:"50%",transform:"translateY(-50%)",fontSize:"16px","&--left":{left:"8px"},"&--right":{right:"8px"}},"&__helper-text":{fontSize:"12px",fontStyle:"normal",fontWeight:400,lineHeight:"18px",color:l.value.colors.gray.medium1},"&--error &__input, &error &__input:focus":{borderColor:l.value.colors.error},"&--error &__helper-text":{color:l.value.colors.error},"&--full-width":{width:"100%"}}))},Ml=A.defineComponent({name:"TTextInput",emits:["input","change"],props:{error:Boolean,disabled:Boolean,leftIcon:String,rightIcon:String,label:String,placeholder:String,helperText:String,value:String,fullWidth:Boolean,id:String},setup(l,{attrs:s,emit:u}){const g=A.computed(()=>Le.merge({},l,s)),m=Dl(),T=we(),x=$=>{u("input",$.target.value),u("change",$.target.value)};return()=>A.h("div",{class:[m.value,`${m.value}__container`,{[`${m.value}--error`]:g.value.error,[`${m.value}--full-width`]:g.value.fullWidth}]},[A.h("label",{class:[`${m.value}__label`],attrs:{for:g.value.id}},[g.value.label]),A.h("div",{class:`${m.value}__input-wrapper`},[g.value.leftIcon&&A.h(bn.Icon,{attrs:{icon:`${T.value.iconSet}:${g.value.leftIcon}`},class:[`${m.value}__icon`,`${m.value}__icon--left`]}),A.h("input",{attrs:{id:g.value.id,type:"text",placeholder:g.value.placeholder,disabled:g.value.disabled},class:[`${m.value}__input`,{[`${m.value}__input--left-icon`]:g.value.leftIcon,[`${m.value}__input--right-icon`]:g.value.rightIcon}],domProps:{value:g.value.value},on:{input:x}}),g.value.rightIcon&&A.h(bn.Icon,{attrs:{icon:`${T.value.iconSet}:${g.value.rightIcon}`},class:[`${m.value}__icon`,`${m.value}__icon--right`]})]),A.h("p",{class:`${m.value}__helper-text`},[g.value.helperText])])}}),zl=()=>{const l=we();return A.computed(()=>an.css({"&, *":{margin:0,padding:0,boxSizing:"border-box",cursor:"pointer"},display:"flex",alignItems:"center",gap:l.value.spacing,padding:"2px","&__switch":{height:"1.25rem",width:"2.5rem",background:l.value.colors.gray.light2,borderRadius:"10px",position:"relative",transition:"background 0.2s ease","&::after":{position:"absolute",content:'""',top:"2px",left:"2px",width:"1rem",height:"1rem",background:"#fff",borderRadius:"50%",transition:"left 0.2s ease"}},"&__label":{fontSize:"1rem",lineHeight:"1.375",fontWeight:l.value.typography.fontWeight.regular},"&:hover &__switch, &:focus &__switch":{background:l.value.colors.primary.light3},"&--checked &__switch, &--checked:focus &__switch":{background:l.value.colors.primary.main,"&::after":{left:"calc(1.5rem - 2px)"}},"&--disabled, &--disabled *":{cursor:"not-allowed"},"&--disabled &__switch, &--disabled:hover &__switch, &--disabled:focus &__switch":{background:l.value.colors.gray.light3},"&--label-left &__switch":{order:1}}))},Hl={labelPosition:"right"},Ul=A.defineComponent({name:"TSwitch",props:{label:String,disabled:Boolean,value:Boolean,labelPosition:String,id:String},emits:["change","input"],setup(l,{attrs:s,emit:u}){const g=A.computed(()=>Le.merge({},Hl,l,s)),m=A.ref(g.value.value),T=()=>{u("change",!m.value),u("input",!m.value),m.value=!m.value},x=ne=>{g.value.disabled?ne==null||ne.preventDefault():T()},$=ne=>{const{key:re}=ne;g.value.disabled||re!=="Enter"&&re!==" "?ne.preventDefault():T()},M=zl(),k=A.computed(()=>[M.value,`${M.value}--label-${g.value.labelPosition}`,{[`${M.value}--checked`]:m.value,[`${M.value}--disabled`]:g.value.disabled}]);return()=>A.h("div",{class:k.value,attrs:{role:"switch","aria-checked":m.value,"aria-disabled":g.value.disabled,"aria-labelledby":g.value.id,tabindex:0},on:{click:x,keydown:$}},[A.h("div",{class:`${M.value}__switch`}),g.value.label&&A.h("label",{class:`${M.value}__label`,attrs:{id:g.value.id}},[g.value.label])])}}),kl=()=>{const l=we();return A.computed(()=>an.css({"&, *":{margin:0,padding:0,boxSizing:"border-box",color:l.value.typography.color,fontFamily:l.value.typography.fontFamily},"&__container":{gap:l.value.spacing,display:"flex",flexDirection:"column",width:"358px"},"&__label":{display:"block",fontSize:"0.875rem",fontStyle:"normal",fontWeight:l.value.typography.fontWeight.semibold,lineHeight:"1.25rem"},"&__wrapper":{position:"relative"},"&__select":{display:"flex",width:"100%",background:"#fff",border:`1px solid ${l.value.colors.gray.light2}`,borderRadius:"4px",padding:"0.25rem 0.5rem",gap:"0.5rem",height:"40px",fontSize:"1rem",fontStyle:"normal",fontWeight:l.value.typography.fontWeight.regular,lineHeight:"22px",MozAppearance:"none",WebkitAppearance:"none",appearance:"none",backgroundImage:`url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path fill-rule='evenodd' d='M12.53 16.28a.75.75 0 01-1.06 0l-7.5-7.5a.75.75 0 011.06-1.06L12 14.69l6.97-6.97a.75.75 0 111.06 1.06l-7.5 7.5z' clip-rule='evenodd' stroke='black' stroke-width='1'/></svg>")`,backgroundRepeat:"no-repeat",backgroundPosition:"right 0.7rem top 50%",backgroundSize:"0.65rem auto","&:hover":{borderColor:l.value.colors.gray.medium2},"&:focus":{borderColor:l.value.colors.primary.light1},"&:focus-visible":{outline:"none"},"&:disabled":{backgroundColor:l.value.colors.gray.light3,borderColor:l.value.colors.gray.light3,cursor:"not-allowed"},"&--left-icon":{paddingLeft:"2rem"}},"&__select:has(&__placeholder:checked)":{color:l.value.colors.gray.medium2},"&__placeholder":{display:"none"},"&__icon":{position:"absolute",top:"50%",transform:"translateY(-50%)",fontSize:"1rem","&--left":{left:"0.5rem"}},"&__helper-text":{fontSize:"0.75rem",fontStyle:"normal",fontWeight:l.value.typography.fontWeight.regular,lineHeight:"1.125rem",color:l.value.colors.gray.medium1},"&--error &__select, &--error &__select:focus":{borderColor:l.value.colors.error},"&--error &__helper-text":{color:l.value.colors.error},"&--full-width":{width:"100%"}}))},Nl=A.defineComponent({name:"TSelect",emits:["input","change"],props:{error:Boolean,disabled:Boolean,leftIcon:String,label:String,placeholder:String,helperText:String,value:String,fullWidth:Boolean,id:String},setup(l,{attrs:s,emit:u,slots:g}){const m=A.computed(()=>Le.merge({},l,s)),T=we(),x=kl(),$=A.computed(()=>[x.value,`${x.value}__container`,{[`${x.value}--error`]:m.value.error,[`${x.value}--full-width`]:m.value.fullWidth}]),M=k=>{u("input",k.target.value),u("change",k.target.value)};return()=>{var k;return A.h("div",{class:$.value},[m.value.label&&A.h("label",{class:`${x.value}__label`,attrs:{for:m.value.id}},[m.value.label]),A.h("div",{class:`${x.value}__wrapper`},[m.value.leftIcon&&A.h(bn.Icon,{attrs:{icon:`${T.value.iconSet}:${m.value.leftIcon}`},class:[`${x.value}__icon`,`${x.value}__icon--left`]}),A.h("select",xt([{class:[`${x.value}__select`,{[`${x.value}__select--left-icon`]:m.value.leftIcon}],attrs:{disabled:m.value.disabled,id:m.value.id},domProps:{value:m.value.value},on:{input:M}},s]),[m.value.placeholder&&A.h("option",{attrs:{value:"",disabled:!0,selected:!0},class:`${x.value}__placeholder`},[m.value.placeholder]),(k=g.default)==null?void 0:k.call(g)])]),m.value.helperText&&A.h("p",{class:`${x.value}__helper-text`},[m.value.helperText])])}}});V.TButton=Tl,V.TIconButton=Bl,V.TSelect=Nl,V.TSpinner=Ll,V.TSwitch=Ul,V.TTextInput=Ml,V.TThemeProvider=Cl,V.TTypography=Ol,V.baseTheme=on,V.createTheme=Sl,V.injectionKey=Ft,V.useTheme=we,Object.defineProperty(V,Symbol.toStringTag,{value:"Module"})});
|
|
175
|
+
`};function Jo(){for(var l=arguments.length,s=new Array(l),u=0;u<l;u++)s[u]=arguments[u];var g=s[0],m=[],T;for(T=1;T<s.length;T+=1)m.push(s[T]);return m.forEach(function(x){g=g.replace(/%[a-z]/,x)}),g}var He=function(l){Ko(s,l);function s(u){var g;if(process.env.NODE_ENV==="production")g=l.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+u+" for more information.")||this;else{for(var m=arguments.length,T=new Array(m>1?m-1:0),x=1;x<m;x++)T[x-1]=arguments[x];g=l.call(this,Jo.apply(void 0,[Xo[u]].concat(T)))||this}return qo(g)}return s}(St(Error));function At(l){return Math.round(l*255)}function Qo(l,s,u){return At(l)+","+At(s)+","+At(u)}function jn(l,s,u,g){if(g===void 0&&(g=Qo),s===0)return g(u,u,u);var m=(l%360+360)%360/60,T=(1-Math.abs(2*u-1))*s,x=T*(1-Math.abs(m%2-1)),$=0,M=0,k=0;m>=0&&m<1?($=T,M=x):m>=1&&m<2?($=x,M=T):m>=2&&m<3?(M=T,k=x):m>=3&&m<4?(M=x,k=T):m>=4&&m<5?($=x,k=T):m>=5&&m<6&&($=T,k=x);var ne=u-T/2,re=$+ne,Se=M+ne,Ue=k+ne;return g(re,Se,Ue)}var ji={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};function Vo(l){if(typeof l!="string")return l;var s=l.toLowerCase();return ji[s]?"#"+ji[s]:l}var jo=/^#[a-fA-F0-9]{6}$/,el=/^#[a-fA-F0-9]{8}$/,nl=/^#[a-fA-F0-9]{3}$/,rl=/^#[a-fA-F0-9]{4}$/,It=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,tl=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,il=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,ul=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;function Tt(l){if(typeof l!="string")throw new He(3);var s=Vo(l);if(s.match(jo))return{red:parseInt(""+s[1]+s[2],16),green:parseInt(""+s[3]+s[4],16),blue:parseInt(""+s[5]+s[6],16)};if(s.match(el)){var u=parseFloat((parseInt(""+s[7]+s[8],16)/255).toFixed(2));return{red:parseInt(""+s[1]+s[2],16),green:parseInt(""+s[3]+s[4],16),blue:parseInt(""+s[5]+s[6],16),alpha:u}}if(s.match(nl))return{red:parseInt(""+s[1]+s[1],16),green:parseInt(""+s[2]+s[2],16),blue:parseInt(""+s[3]+s[3],16)};if(s.match(rl)){var g=parseFloat((parseInt(""+s[4]+s[4],16)/255).toFixed(2));return{red:parseInt(""+s[1]+s[1],16),green:parseInt(""+s[2]+s[2],16),blue:parseInt(""+s[3]+s[3],16),alpha:g}}var m=It.exec(s);if(m)return{red:parseInt(""+m[1],10),green:parseInt(""+m[2],10),blue:parseInt(""+m[3],10)};var T=tl.exec(s.substring(0,50));if(T)return{red:parseInt(""+T[1],10),green:parseInt(""+T[2],10),blue:parseInt(""+T[3],10),alpha:parseFloat(""+T[4])>1?parseFloat(""+T[4])/100:parseFloat(""+T[4])};var x=il.exec(s);if(x){var $=parseInt(""+x[1],10),M=parseInt(""+x[2],10)/100,k=parseInt(""+x[3],10)/100,ne="rgb("+jn($,M,k)+")",re=It.exec(ne);if(!re)throw new He(4,s,ne);return{red:parseInt(""+re[1],10),green:parseInt(""+re[2],10),blue:parseInt(""+re[3],10)}}var Se=ul.exec(s.substring(0,50));if(Se){var Ue=parseInt(""+Se[1],10),ln=parseInt(""+Se[2],10)/100,Pn=parseInt(""+Se[3],10)/100,le="rgb("+jn(Ue,ln,Pn)+")",Ae=It.exec(le);if(!Ae)throw new He(4,s,le);return{red:parseInt(""+Ae[1],10),green:parseInt(""+Ae[2],10),blue:parseInt(""+Ae[3],10),alpha:parseFloat(""+Se[4])>1?parseFloat(""+Se[4])/100:parseFloat(""+Se[4])}}throw new He(5)}function al(l){var s=l.red/255,u=l.green/255,g=l.blue/255,m=Math.max(s,u,g),T=Math.min(s,u,g),x=(m+T)/2;if(m===T)return l.alpha!==void 0?{hue:0,saturation:0,lightness:x,alpha:l.alpha}:{hue:0,saturation:0,lightness:x};var $,M=m-T,k=x>.5?M/(2-m-T):M/(m+T);switch(m){case s:$=(u-g)/M+(u<g?6:0);break;case u:$=(g-s)/M+2;break;default:$=(s-u)/M+4;break}return $*=60,l.alpha!==void 0?{hue:$,saturation:k,lightness:x,alpha:l.alpha}:{hue:$,saturation:k,lightness:x}}function eu(l){return al(Tt(l))}var ol=function(s){return s.length===7&&s[1]===s[2]&&s[3]===s[4]&&s[5]===s[6]?"#"+s[1]+s[3]+s[5]:s},Ct=ol;function yn(l){var s=l.toString(16);return s.length===1?"0"+s:s}function Rt(l){return yn(Math.round(l*255))}function ll(l,s,u){return Ct("#"+Rt(l)+Rt(s)+Rt(u))}function Ir(l,s,u){return jn(l,s,u,ll)}function fl(l,s,u){if(typeof l=="number"&&typeof s=="number"&&typeof u=="number")return Ir(l,s,u);if(typeof l=="object"&&s===void 0&&u===void 0)return Ir(l.hue,l.saturation,l.lightness);throw new He(1)}function sl(l,s,u,g){if(typeof l=="number"&&typeof s=="number"&&typeof u=="number"&&typeof g=="number")return g>=1?Ir(l,s,u):"rgba("+jn(l,s,u)+","+g+")";if(typeof l=="object"&&s===void 0&&u===void 0&&g===void 0)return l.alpha>=1?Ir(l.hue,l.saturation,l.lightness):"rgba("+jn(l.hue,l.saturation,l.lightness)+","+l.alpha+")";throw new He(2)}function Et(l,s,u){if(typeof l=="number"&&typeof s=="number"&&typeof u=="number")return Ct("#"+yn(l)+yn(s)+yn(u));if(typeof l=="object"&&s===void 0&&u===void 0)return Ct("#"+yn(l.red)+yn(l.green)+yn(l.blue));throw new He(6)}function cl(l,s,u,g){if(typeof l=="string"&&typeof s=="number"){var m=Tt(l);return"rgba("+m.red+","+m.green+","+m.blue+","+s+")"}else{if(typeof l=="number"&&typeof s=="number"&&typeof u=="number"&&typeof g=="number")return g>=1?Et(l,s,u):"rgba("+l+","+s+","+u+","+g+")";if(typeof l=="object"&&s===void 0&&u===void 0&&g===void 0)return l.alpha>=1?Et(l.red,l.green,l.blue):"rgba("+l.red+","+l.green+","+l.blue+","+l.alpha+")"}throw new He(7)}var hl=function(s){return typeof s.red=="number"&&typeof s.green=="number"&&typeof s.blue=="number"&&(typeof s.alpha!="number"||typeof s.alpha>"u")},pl=function(s){return typeof s.red=="number"&&typeof s.green=="number"&&typeof s.blue=="number"&&typeof s.alpha=="number"},gl=function(s){return typeof s.hue=="number"&&typeof s.saturation=="number"&&typeof s.lightness=="number"&&(typeof s.alpha!="number"||typeof s.alpha>"u")},dl=function(s){return typeof s.hue=="number"&&typeof s.saturation=="number"&&typeof s.lightness=="number"&&typeof s.alpha=="number"};function nu(l){if(typeof l!="object")throw new He(8);if(pl(l))return cl(l);if(hl(l))return Et(l);if(dl(l))return sl(l);if(gl(l))return fl(l);throw new He(8)}function ru(l,s,u){return function(){var m=u.concat(Array.prototype.slice.call(arguments));return m.length>=s?l.apply(this,m):ru(l,s,m)}}function tu(l){return ru(l,l.length,[])}function iu(l,s,u){return Math.max(l,Math.min(s,u))}function vl(l,s){if(s==="transparent")return s;var u=eu(s);return nu(Sr({},u,{lightness:iu(0,1,u.lightness-parseFloat(l))}))}var ml=tu(vl),_l=ml;function Tr(l){if(l==="transparent")return 0;var s=Tt(l),u=Object.keys(s).map(function(x){var $=s[x]/255;return $<=.03928?$/12.92:Math.pow(($+.055)/1.055,2.4)}),g=u[0],m=u[1],T=u[2];return parseFloat((.2126*g+.7152*m+.0722*T).toFixed(3))}function bl(l,s){if(s==="transparent")return s;var u=eu(s);return nu(Sr({},u,{lightness:iu(0,1,u.lightness+parseFloat(l))}))}var yl=tu(bl),xl=yl;const wl=(l,s)=>_l(Tr(on.colors.primary.main)-Tr(on.colors.primary[s]),l),On=(l,s)=>xl(Tr(on.colors.primary[s])-Tr(on.colors.primary.main),l),Sl=l=>{var g,m;const s=Le.merge(on,l),u=(m=(g=l.colors)==null?void 0:g.primary)==null?void 0:m.main;return u&&(s.colors.primary.ultraDark=wl(u,"ultraDark"),s.colors.primary.dark=u,s.colors.primary.toku=On(u,"toku"),s.colors.primary.light1=On(u,"light1"),s.colors.primary.light2=On(u,"light2"),s.colors.primary.light3=On(u,"light3"),s.colors.primary.light4=On(u,"light4"),s.colors.primary.light5=On(u,"light5")),s},Ft=Symbol("theme"),we=()=>{const l=A.inject(Ft,void 0);return A.computed(()=>(l==null?void 0:l.value)??on)},Al=()=>{const l=we();return A.computed(()=>an.css({"&, *":{margin:0,padding:0,boxSizing:"border-box"},cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"0.625rem",fontWeight:l.value.typography.fontWeight.semibold,"&--primary":{borderRadius:"0.5rem",backgroundColor:l.value.colors.primary.main,boxShadow:"0px 0px 8px 0px rgba(0, 0, 0, 0.1)",border:`1px solid ${l.value.colors.primary.main}`,color:"#FFFFFF","&:hover:not(&:disabled)":{backgroundColor:l.value.colors.primary.ultraDark},"&:focus":{border:`1px solid ${l.value.colors.primary.light1}`},"&:disabled":{cursor:"not-allowed",border:`1px solid ${l.value.colors.gray.light2}`,backgroundColor:l.value.colors.gray.light2,color:l.value.colors.gray.medium2}},"&--secondary":{borderRadius:"0.5rem",backgroundColor:"#FFFFFF",border:`1px solid ${l.value.colors.primary.main}`,boxShadow:"0px 0px 8px 0px rgba(0, 0, 0, 0.1)",color:l.value.colors.primary.main,"&:hover:not(&:disabled)":{backgroundColor:l.value.colors.primary.light3},"&:focus":{border:`1px solid ${l.value.colors.primary.light1}`},"&:disabled":{cursor:"not-allowed",border:`1px solid ${l.value.colors.gray.light2}`,backgroundColor:l.value.colors.gray.light2,color:l.value.colors.gray.medium2}},"&--tertiary":{background:"none",border:"none",margin:0,padding:0,color:l.value.colors.primary.main,"&:hover:not(&:disabled)":{color:l.value.colors.primary.light2},"&:focus":{color:l.value.colors.primary.light1},"&:disabled":{cursor:"not-allowed",color:l.value.colors.gray.medium1}},"&--large":{height:"3rem",padding:"0.5rem 1rem",lineHeight:"1.5rem",fontSize:"1.125rem"},"&--medium":{height:"2.5rem",padding:"0.5rem 1rem",lineHeight:"1.375rem",fontSize:"1rem"},"&--small":{height:"2rem",padding:"0.5rem 0.75rem",lineHeight:"1.25rem",fontSize:"0.875rem"},"&--full-width":{width:"100%"},"&--loading, &--loading:disabled, &--loading:hover:not(&:disabled), &--loading:focus":{color:"transparent",position:"relative"},"&__spinner":{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"},"&--primary &__spinner, &--loading:disabled &__spinner":{color:"#fff"},"&--tertiary:disabled &__spinner":{color:l.value.colors.gray.medium1},"&--secondary &__spinner, &--tertiary &__spinner":{color:l.value.colors.primary.main}}))},Il={variant:"primary",size:"medium",type:"button"},Tl=A.defineComponent({name:"TButton",props:{variant:String,size:String,disabled:Boolean,leftIcon:String,rightIcon:String,type:String,fullWidth:Boolean,loading:Boolean},emits:["click"],setup(l,{attrs:s,slots:u,emit:g}){const m=A.computed(()=>Le.merge({},Il,l,s)),T=Al(),x=we(),$=A.computed(()=>[T.value,`${T.value}--${m.value.variant}`,`${T.value}--${m.value.size}`,{[`${T.value}--full-width`]:m.value.fullWidth,[`${T.value}--loading`]:m.value.loading}]);return()=>{var M;return A.h("button",xt([{class:$.value,attrs:{type:m.value.type,disabled:m.value.disabled},on:{click:()=>g("click")}},s]),[m.value.leftIcon&&A.h(bn.Icon,{attrs:{icon:`${x.value.iconSet}:${m.value.leftIcon}`}}),(M=u.default)==null?void 0:M.call(u),m.value.rightIcon&&A.h(bn.Icon,{attrs:{icon:`${x.value.iconSet}:${m.value.rightIcon}`}}),m.value.loading&&A.h(bn.Icon,{class:`${T.value}__spinner`,attrs:{icon:"svg-spinners:90-ring-with-bg"}})])}}}),Cl=A.defineComponent({name:"TThemeProvider",props:{theme:{type:Object,default:()=>{}}},setup(l,{slots:s}){const u=A.computed(()=>Le.merge(on,l.theme));return A.provide(Ft,u),()=>{var g;return(g=s.default)==null?void 0:g.call(s)}}}),Rl=()=>{const l=we();return A.computed(()=>an.css({margin:0,padding:0,boxSizing:"border-box",color:l.value.typography.color,fontFamily:l.value.typography.fontFamily,"&--h1":{fontSize:"3.25rem",linehHeight:"3.75rem"},"&--h2":{fontSize:"3rem",lineHeight:"3.5rem"},"&--h3":{fontSize:"2.5rem",lineHeight:"3rem"},"&--h4":{fontSize:"2rem",lineHeight:"2.5rem"},"&--s1":{fontSize:"1.75rem",lineHeight:"2.25rem"},"&--s2":{fontSize:"1.5rem",lineHeight:"2rem"},"&--s3":{fontSize:"1.125rem",lineHeight:"1.625rem"},"&--s4":{fontSize:"1rem",lineHeight:"1.5rem"},"&--b0":{fontSize:"1.25rem",lineHeight:"1.625rem"},"&--b1":{fontSize:"1.125rem",lineHeight:"1.5rem"},"&--b2":{fontSize:"1rem",lineHeight:"1.375rem"},"&--b3":{fontSize:"0.875rem",lineHeight:"1.25rem"},"&--b4":{fontSize:"0.75rem",lineHeight:"1.125rem"},"&--b5":{fontSize:"0.625rem",lineHeight:"1rem"},"&--b6":{fontSize:"0.5rem",lineHeight:"1.875rem"},"&--bold":{fontWeight:l.value.typography.fontWeight.bold},"&--semibold":{fontWeight:l.value.typography.fontWeight.semibold},"&--medium":{fontWeight:l.value.typography.fontWeight.medium},"&--regular":{fontWeight:l.value.typography.fontWeight.regular},"&--normal":{fontStyle:"normal"},"&--italic":{fontStyle:"italic"}}))},El={h1:"h1",h2:"h2",h3:"h3",h4:"h4",s1:"h5",s2:"h5",s3:"h6",s4:"h6",b0:"p",b1:"p",b2:"p",b3:"p",b4:"p",b5:"p",b6:"p"},Fl={fontStyle:"normal",fontWeight:"regular",variant:"b0"},Ol=A.defineComponent({name:"TTypography",props:{fontStyle:String,fontWeight:String,variant:String},setup(l,{attrs:s,slots:u}){const g=A.computed(()=>Le.merge({},Fl,l,s)),m=Rl(),T=A.computed(()=>[m.value,`${m.value}--${g.value.variant}`,`${m.value}--${g.value.fontWeight}`,`${m.value}--${g.value.fontStyle}`]),x=A.computed(()=>El[g.value.variant]);return()=>A.h(x.value,{class:T.value},u.default?u.default():null)}}),Pl=()=>{const l=we();return A.computed(()=>an.css({margin:0,padding:0,width:"3.5rem",height:"3.5rem",boxSizing:"border-box",background:"transparent",borderRadius:"50%",border:`0.5rem solid ${l.value.colors.background}`,borderBottomColor:l.value.colors.primary.main,animation:"rotate 0.75s linear infinite",[`@media (min-width: ${l.value.breakpoints.desktop}px)`]:{width:"4.5rem",height:"4.5rem"},"@keyframes rotate":{"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}}))},Ll=A.defineComponent({name:"TSpinner",setup(){const l=Pl();return()=>A.h("div",{class:l.value})}}),Wl=()=>{const l=we(),s=A.computed(()=>an.css({"&, *":{margin:0,padding:0,boxSizing:"border-box"},display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer","&--primary":{borderRadius:"0.5rem",backgroundColor:l.value.colors.primary.main,boxShadow:"0px 0px 8px 0px rgba(0, 0, 0, 0.1)",border:`1px solid ${l.value.colors.primary.main}`,color:"#FFFFFF","&:hover:not(&:disabled)":{backgroundColor:l.value.colors.primary.ultraDark},"&:focus":{border:`1px solid ${l.value.colors.primary.light1}`},"&:disabled":{cursor:"not-allowed",border:`1px solid ${l.value.colors.gray.light2}`,backgroundColor:l.value.colors.gray.light2,color:l.value.colors.gray.medium2}},"&--secondary":{borderRadius:"0.5rem",backgroundColor:"#FFFFFF",border:`1px solid ${l.value.colors.primary.main}`,boxShadow:"0px 0px 8px 0px rgba(0, 0, 0, 0.1)",color:l.value.colors.primary.main,"&:hover:not(&:disabled)":{backgroundColor:l.value.colors.primary.light3},"&:focus":{border:`1px solid ${l.value.colors.primary.light1}`},"&:disabled":{cursor:"not-allowed",border:`1px solid ${l.value.colors.gray.light2}`,backgroundColor:l.value.colors.gray.light2,color:l.value.colors.gray.medium2}},"&--tertiary":{background:"none",border:"none",margin:0,padding:0,color:l.value.colors.primary.main,"&:hover:not(&:disabled)":{color:l.value.colors.primary.light2},"&:focus":{color:l.value.colors.primary.light1},"&:disabled":{cursor:"not-allowed",color:l.value.colors.gray.medium1}},"&--large":{height:"3rem",width:"3rem",lineHeight:"1.5rem",fontSize:"1.125rem"},"&--medium":{height:"2.5rem",width:"2.5rem",lineHeight:"1.375rem",fontSize:"1rem"},"&--small":{height:"2rem",width:"2rem",lineHeight:"1.25rem",fontSize:"0.875rem"},"&--rounded":{borderRadius:"50%"}})),u=A.computed(()=>an.css({margin:0,padding:0,"&--large":{height:"1.25rem"},"&--medium":{height:"1.25rem"},"&--small":{height:"1rem"}}));return{baseClass:s,iconClass:u}},$l={variant:"primary",size:"medium",icon:"academic-cap",type:"button"},Bl=A.defineComponent({name:"TIconButton",props:{variant:String,size:String,disabled:Boolean,icon:String,type:String,rounded:Boolean},emits:["click"],setup(l,{attrs:s,emit:u}){const g=A.computed(()=>Le.merge({},$l,l,s)),{baseClass:m,iconClass:T}=Wl(),x=we(),$=A.computed(()=>[m.value,`${m.value}--${g.value.variant}`,`${m.value}--${g.value.size}`,{[`${m.value}--rounded`]:g.value.rounded}]),M=A.computed(()=>[T.value,`${T.value}--${g.value.variant}`,`${T.value}--${g.value.size}`]);return()=>A.h("button",xt([{class:$.value,attrs:{type:g.value.type,disabled:g.value.disabled},on:{click:()=>u("click")}},s]),[A.h(bn.Icon,{attrs:{icon:`${x.value.iconSet}:${g.value.icon}`},class:M.value})])}}),Dl=()=>{const l=we();return A.computed(()=>an.css({"&, *":{margin:0,padding:0,boxSizing:"border-box",color:l.value.typography.color,fontFamily:l.value.typography.fontFamily},"&__container":{gap:l.value.spacing,display:"flex",flexDirection:"column",width:"358px"},"&__label":{display:"block",fontSize:"14px",fontStyle:"normal",fontWeight:600,lineHeight:"20px"},"&__input-wrapper":{position:"relative"},"&__input":{display:"flex",width:"100%",background:"#FFF",border:`1px solid ${l.value.colors.gray.light2}`,borderRadius:"4px",padding:"4px 8px",gap:"8px",height:"40px",fontSize:"16px",fontStyle:"normal",fontWeight:400,lineHeight:"22px","&::placeholder":{color:l.value.colors.gray.medium2},"&:hover":{borderColor:l.value.colors.gray.medium2},"&:focus":{borderColor:l.value.colors.primary.light1},"&:focus-visible":{outline:"none"},"&:disabled":{background:l.value.colors.gray.light3,borderColor:l.value.colors.gray.light3},"&--left-icon":{paddingLeft:"32px"},"&--right-icon":{paddingRight:"32px"}},"&__icon":{position:"absolute",top:"50%",transform:"translateY(-50%)",fontSize:"16px","&--left":{left:"8px"},"&--right":{right:"8px"}},"&__helper-text":{fontSize:"12px",fontStyle:"normal",fontWeight:400,lineHeight:"18px",color:l.value.colors.gray.medium1},"&--error &__input, &error &__input:focus":{borderColor:l.value.colors.error},"&--error &__helper-text":{color:l.value.colors.error},"&--full-width":{width:"100%"}}))},Ml=A.defineComponent({name:"TTextInput",emits:["input","change"],props:{error:Boolean,disabled:Boolean,leftIcon:String,rightIcon:String,label:String,placeholder:String,helperText:String,value:String,fullWidth:Boolean,id:String},setup(l,{attrs:s,emit:u}){const g=A.computed(()=>Le.merge({},l,s)),m=Dl(),T=we(),x=$=>{u("input",$.target.value),u("change",$.target.value)};return()=>A.h("div",{class:[m.value,`${m.value}__container`,{[`${m.value}--error`]:g.value.error,[`${m.value}--full-width`]:g.value.fullWidth}]},[A.h("label",{class:[`${m.value}__label`],attrs:{for:g.value.id}},[g.value.label]),A.h("div",{class:`${m.value}__input-wrapper`},[g.value.leftIcon&&A.h(bn.Icon,{attrs:{icon:`${T.value.iconSet}:${g.value.leftIcon}`},class:[`${m.value}__icon`,`${m.value}__icon--left`]}),A.h("input",{attrs:{id:g.value.id,type:"text",placeholder:g.value.placeholder,disabled:g.value.disabled},class:[`${m.value}__input`,{[`${m.value}__input--left-icon`]:g.value.leftIcon,[`${m.value}__input--right-icon`]:g.value.rightIcon}],domProps:{value:g.value.value},on:{input:x}}),g.value.rightIcon&&A.h(bn.Icon,{attrs:{icon:`${T.value.iconSet}:${g.value.rightIcon}`},class:[`${m.value}__icon`,`${m.value}__icon--right`]})]),A.h("p",{class:`${m.value}__helper-text`},[g.value.helperText])])}}),zl=()=>{const l=we();return A.computed(()=>an.css({"&, *":{margin:0,padding:0,boxSizing:"border-box",cursor:"pointer"},display:"flex",alignItems:"center",gap:l.value.spacing,padding:"2px","&__switch":{height:"1.25rem",width:"2.5rem",background:l.value.colors.gray.light2,borderRadius:"10px",position:"relative",transition:"background 0.2s ease","&::after":{position:"absolute",content:'""',top:"2px",left:"2px",width:"1rem",height:"1rem",background:"#fff",borderRadius:"50%",transition:"left 0.2s ease"}},"&__label":{fontSize:"1rem",lineHeight:"1.375",fontWeight:l.value.typography.fontWeight.regular},"&:hover &__switch, &:focus &__switch":{background:l.value.colors.primary.light3},"&--checked &__switch, &--checked:focus &__switch":{background:l.value.colors.primary.main,"&::after":{left:"calc(1.5rem - 2px)"}},"&--disabled, &--disabled *":{cursor:"not-allowed"},"&--disabled &__switch, &--disabled:hover &__switch, &--disabled:focus &__switch":{background:l.value.colors.gray.light3},"&--label-left &__switch":{order:1}}))},Hl={labelPosition:"right"},Ul=A.defineComponent({name:"TSwitch",props:{label:String,disabled:Boolean,value:Boolean,labelPosition:String,id:String},emits:["change","input"],setup(l,{attrs:s,emit:u}){const g=A.computed(()=>Le.merge({},Hl,l,s)),m=A.ref(g.value.value),T=()=>{u("change",!m.value),u("input",!m.value),m.value=!m.value},x=ne=>{g.value.disabled?ne==null||ne.preventDefault():T()},$=ne=>{const{key:re}=ne;g.value.disabled||re!=="Enter"&&re!==" "?ne.preventDefault():T()},M=zl(),k=A.computed(()=>[M.value,`${M.value}--label-${g.value.labelPosition}`,{[`${M.value}--checked`]:m.value,[`${M.value}--disabled`]:g.value.disabled}]);return()=>A.h("div",{class:k.value,attrs:{role:"switch","aria-checked":m.value,"aria-disabled":g.value.disabled,"aria-labelledby":g.value.id,tabindex:0},on:{click:x,keydown:$}},[A.h("div",{class:`${M.value}__switch`}),g.value.label&&A.h("label",{class:`${M.value}__label`,attrs:{id:g.value.id}},[g.value.label])])}}),kl=()=>{const l=we();return A.computed(()=>an.css({"&, *":{margin:0,padding:0,boxSizing:"border-box",color:l.value.typography.color,fontFamily:l.value.typography.fontFamily},"&__container":{gap:l.value.spacing,display:"flex",flexDirection:"column",width:"358px"},"&__label":{display:"block",fontSize:"0.875rem",fontStyle:"normal",fontWeight:l.value.typography.fontWeight.semibold,lineHeight:"1.25rem"},"&__wrapper":{position:"relative"},"&__select":{display:"flex",width:"100%",background:"#fff",border:`1px solid ${l.value.colors.gray.light2}`,borderRadius:"4px",padding:"0.25rem 0.5rem",gap:"0.5rem",height:"40px",fontSize:"1rem",fontStyle:"normal",fontWeight:l.value.typography.fontWeight.regular,lineHeight:"22px",MozAppearance:"none",WebkitAppearance:"none",appearance:"none",backgroundImage:`url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path fill-rule='evenodd' d='M12.53 16.28a.75.75 0 01-1.06 0l-7.5-7.5a.75.75 0 011.06-1.06L12 14.69l6.97-6.97a.75.75 0 111.06 1.06l-7.5 7.5z' clip-rule='evenodd' stroke='black' stroke-width='1'/></svg>")`,backgroundRepeat:"no-repeat",backgroundPosition:"right 0.7rem top 50%",backgroundSize:"0.65rem auto","&:hover":{borderColor:l.value.colors.gray.medium2},"&:focus":{borderColor:l.value.colors.primary.light1},"&:focus-visible":{outline:"none"},"&:disabled":{backgroundColor:l.value.colors.gray.light3,borderColor:l.value.colors.gray.light3,cursor:"not-allowed"},"&--left-icon":{paddingLeft:"2rem"}},"&__select:has(&__placeholder:checked)":{color:l.value.colors.gray.medium2},"&__placeholder":{display:"none"},"&__icon":{position:"absolute",top:"50%",transform:"translateY(-50%)",fontSize:"1rem","&--left":{left:"0.5rem"}},"&__helper-text":{fontSize:"0.75rem",fontStyle:"normal",fontWeight:l.value.typography.fontWeight.regular,lineHeight:"1.125rem",color:l.value.colors.gray.medium1},"&--error &__select, &--error &__select:focus":{borderColor:l.value.colors.error},"&--error &__helper-text":{color:l.value.colors.error},"&--full-width":{width:"100%"}}))},Nl=A.defineComponent({name:"TSelect",emits:["input","change"],props:{error:Boolean,disabled:Boolean,leftIcon:String,label:String,placeholder:String,helperText:String,value:String,fullWidth:Boolean,id:String},setup(l,{attrs:s,emit:u,slots:g}){const m=A.computed(()=>Le.merge({},l,s)),T=we(),x=kl(),$=A.computed(()=>[x.value,`${x.value}__container`,{[`${x.value}--error`]:m.value.error,[`${x.value}--full-width`]:m.value.fullWidth}]),M=k=>{u("input",k.target.value),u("change",k.target.value)};return()=>{var k;return A.h("div",{class:$.value},[m.value.label&&A.h("label",{class:`${x.value}__label`,attrs:{for:m.value.id}},[m.value.label]),A.h("div",{class:`${x.value}__wrapper`},[m.value.leftIcon&&A.h(bn.Icon,{attrs:{icon:`${T.value.iconSet}:${m.value.leftIcon}`},class:[`${x.value}__icon`,`${x.value}__icon--left`]}),A.h("select",xt([{class:[`${x.value}__select`,{[`${x.value}__select--left-icon`]:m.value.leftIcon}],attrs:{disabled:m.value.disabled,id:m.value.id},domProps:{value:m.value.value},on:{input:M}},s]),[m.value.placeholder&&A.h("option",{attrs:{value:"",disabled:!0,selected:!0},class:`${x.value}__placeholder`},[m.value.placeholder]),(k=g.default)==null?void 0:k.call(g)])]),m.value.helperText&&A.h("p",{class:`${x.value}__helper-text`},[m.value.helperText])])}}});V.TButton=Tl,V.TIconButton=Bl,V.TSelect=Nl,V.TSpinner=Ll,V.TSwitch=Ul,V.TTextInput=Ml,V.TThemeProvider=Cl,V.TTypography=Ol,V.baseTheme=on,V.createTheme=Sl,V.injectionKey=Ft,V.useTheme=we,Object.defineProperty(V,Symbol.toStringTag,{value:"Module"})});
|
|
176
176
|
//# sourceMappingURL=index.umd.js.map
|