@xanui/core 1.0.22 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{cjs/ServerStyleTags.js → ServerStyleTags.cjs} +1 -1
- package/{cjs/ServerStyleTags.js.map → ServerStyleTags.cjs.map} +2 -2
- package/{ServerStyleTags.js → ServerStyleTags.mjs} +1 -1
- package/{ServerStyleTags.js.map → ServerStyleTags.mjs.map} +1 -1
- package/{cjs/Tag/cssPropList.js → Tag/cssPropList.cjs} +1 -1
- package/Tag/cssPropList.cjs.map +7 -0
- package/Tag/{cssPropList.js → cssPropList.mjs} +1 -1
- package/Tag/cssPropList.mjs.map +7 -0
- package/{cjs/Tag/index.js → Tag/index.cjs} +1 -1
- package/Tag/index.cjs.map +7 -0
- package/Tag/{index.js → index.mjs} +1 -1
- package/Tag/index.mjs.map +7 -0
- package/{cjs/Tag/types.js → Tag/types.cjs} +1 -1
- package/Tag/types.cjs.map +7 -0
- package/Tag/types.mjs +1 -0
- package/{cjs/Tag/useTagProps.js → Tag/useTagProps.cjs} +1 -1
- package/{cjs/Tag/useTagProps.js.map → Tag/useTagProps.cjs.map} +2 -2
- package/Tag/{useTagProps.js → useTagProps.mjs} +1 -1
- package/Tag/useTagProps.mjs.map +7 -0
- package/Transition/index.cjs +2 -0
- package/Transition/index.cjs.map +7 -0
- package/Transition/index.mjs +2 -0
- package/Transition/index.mjs.map +7 -0
- package/{cjs/Transition/variants.js → Transition/variants.cjs} +1 -1
- package/Transition/variants.cjs.map +7 -0
- package/Transition/{variants.js → variants.mjs} +1 -1
- package/Transition/variants.mjs.map +7 -0
- package/{cjs/breakpoint/index.js → breakpoint/index.cjs} +1 -1
- package/breakpoint/index.cjs.map +7 -0
- package/breakpoint/{index.js → index.mjs} +1 -1
- package/breakpoint/index.mjs.map +7 -0
- package/{cjs/breakpoint/useBreakpoint.js → breakpoint/useBreakpoint.cjs} +1 -1
- package/breakpoint/useBreakpoint.cjs.map +7 -0
- package/breakpoint/{useBreakpoint.js → useBreakpoint.mjs} +1 -1
- package/breakpoint/useBreakpoint.mjs.map +7 -0
- package/{cjs/breakpoint/useBreakpointProps.js → breakpoint/useBreakpointProps.cjs} +1 -1
- package/breakpoint/useBreakpointProps.cjs.map +7 -0
- package/breakpoint/{useBreakpointProps.js → useBreakpointProps.mjs} +1 -1
- package/breakpoint/useBreakpointProps.mjs.map +7 -0
- package/{cjs/css/aliases.js → css/aliases.cjs} +1 -1
- package/css/aliases.cjs.map +7 -0
- package/css/{aliases.js → aliases.mjs} +1 -1
- package/css/aliases.mjs.map +7 -0
- package/{cjs/css/getProps.js → css/getProps.cjs} +1 -1
- package/css/getProps.cjs.map +7 -0
- package/css/{getProps.js → getProps.mjs} +1 -1
- package/css/getProps.mjs.map +7 -0
- package/{cjs/css/getValue.js → css/getValue.cjs} +1 -1
- package/css/getValue.cjs.map +7 -0
- package/css/{getValue.js → getValue.mjs} +1 -1
- package/css/getValue.mjs.map +7 -0
- package/{cjs/css/index.js → css/index.cjs} +1 -1
- package/css/index.cjs.map +7 -0
- package/css/{index.js → index.mjs} +1 -1
- package/css/index.mjs.map +7 -0
- package/{cjs/css/types.js → css/types.cjs} +1 -1
- package/css/types.cjs.map +7 -0
- package/css/types.mjs +1 -0
- package/{cjs/index.js → index.cjs} +1 -1
- package/index.cjs.map +7 -0
- package/{index.js → index.mjs} +1 -1
- package/index.mjs.map +7 -0
- package/{cjs/isWindow.js → isWindow.cjs} +1 -1
- package/{cjs/isWindow.js.map → isWindow.cjs.map} +2 -2
- package/{isWindow.js → isWindow.mjs} +1 -1
- package/{isWindow.js.map → isWindow.mjs.map} +1 -1
- package/package.json +8 -13
- package/{cjs/theme/ThemeCssVars.js → theme/ThemeCssVars.cjs} +1 -1
- package/theme/ThemeCssVars.cjs.map +7 -0
- package/theme/{ThemeCssVars.js → ThemeCssVars.mjs} +1 -1
- package/theme/ThemeCssVars.mjs.map +7 -0
- package/{cjs/theme/ThemeDefaultOptions.js → theme/ThemeDefaultOptions.cjs} +1 -1
- package/theme/ThemeDefaultOptions.cjs.map +7 -0
- package/theme/{ThemeDefaultOptions.js → ThemeDefaultOptions.mjs} +1 -1
- package/theme/ThemeDefaultOptions.mjs.map +7 -0
- package/theme/ThemeProvider.cjs +2 -0
- package/theme/ThemeProvider.cjs.map +7 -0
- package/theme/ThemeProvider.mjs +2 -0
- package/theme/ThemeProvider.mjs.map +7 -0
- package/{cjs/theme/core.js → theme/core.cjs} +1 -1
- package/theme/core.cjs.map +7 -0
- package/theme/{core.js → core.mjs} +1 -1
- package/theme/core.mjs.map +7 -0
- package/{cjs/theme/createColor.js → theme/createColor.cjs} +1 -1
- package/theme/createColor.cjs.map +7 -0
- package/theme/{createColor.js → createColor.mjs} +1 -1
- package/theme/createColor.mjs.map +7 -0
- package/{cjs/theme/createTheme.js → theme/createTheme.cjs} +1 -1
- package/theme/createTheme.cjs.map +7 -0
- package/theme/{createTheme.js → createTheme.mjs} +1 -1
- package/theme/createTheme.mjs.map +7 -0
- package/{cjs/theme/createThemeSwitcher.js → theme/createThemeSwitcher.cjs} +1 -1
- package/{cjs/theme/createThemeSwitcher.js.map → theme/createThemeSwitcher.cjs.map} +2 -2
- package/theme/{createThemeSwitcher.js → createThemeSwitcher.mjs} +1 -1
- package/theme/{createThemeSwitcher.js.map → createThemeSwitcher.mjs.map} +1 -1
- package/{cjs/theme/index.js → theme/index.cjs} +1 -1
- package/theme/index.cjs.map +7 -0
- package/theme/{index.js → index.mjs} +1 -1
- package/theme/index.mjs.map +7 -0
- package/{cjs/theme/types.js → theme/types.cjs} +1 -1
- package/theme/types.cjs.map +7 -0
- package/theme/types.mjs +1 -0
- package/{cjs/useAnimation.js → useAnimation.cjs} +1 -1
- package/useAnimation.cjs.map +7 -0
- package/{useAnimation.js → useAnimation.mjs} +1 -1
- package/useAnimation.mjs.map +7 -0
- package/{cjs/useColorTemplate.js → useColorTemplate.cjs} +1 -1
- package/useColorTemplate.cjs.map +7 -0
- package/{useColorTemplate.js → useColorTemplate.mjs} +1 -1
- package/useColorTemplate.mjs.map +7 -0
- package/{cjs/useInterface.js → useInterface.cjs} +1 -1
- package/{cjs/useInterface.js.map → useInterface.cjs.map} +2 -2
- package/{useInterface.js → useInterface.mjs} +1 -1
- package/{useInterface.js.map → useInterface.mjs.map} +1 -1
- package/Tag/cssPropList.js.map +0 -7
- package/Tag/index.js.map +0 -7
- package/Tag/types.js +0 -1
- package/Tag/useTagProps.js.map +0 -7
- package/Transition/index.js +0 -2
- package/Transition/index.js.map +0 -7
- package/Transition/variants.js.map +0 -7
- package/breakpoint/index.js.map +0 -7
- package/breakpoint/useBreakpoint.js.map +0 -7
- package/breakpoint/useBreakpointProps.js.map +0 -7
- package/cjs/Tag/cssPropList.js.map +0 -7
- package/cjs/Tag/index.js.map +0 -7
- package/cjs/Tag/types.js.map +0 -7
- package/cjs/Transition/index.js +0 -2
- package/cjs/Transition/index.js.map +0 -7
- package/cjs/Transition/variants.js.map +0 -7
- package/cjs/breakpoint/index.js.map +0 -7
- package/cjs/breakpoint/useBreakpoint.js.map +0 -7
- package/cjs/breakpoint/useBreakpointProps.js.map +0 -7
- package/cjs/css/aliases.js.map +0 -7
- package/cjs/css/getProps.js.map +0 -7
- package/cjs/css/getValue.js.map +0 -7
- package/cjs/css/index.js.map +0 -7
- package/cjs/css/types.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/theme/ThemeCssVars.js.map +0 -7
- package/cjs/theme/ThemeDefaultOptions.js.map +0 -7
- package/cjs/theme/ThemeProvider.js +0 -2
- package/cjs/theme/ThemeProvider.js.map +0 -7
- package/cjs/theme/core.js.map +0 -7
- package/cjs/theme/createColor.js.map +0 -7
- package/cjs/theme/createTheme.js.map +0 -7
- package/cjs/theme/index.js.map +0 -7
- package/cjs/theme/types.js.map +0 -7
- package/cjs/useAnimation.js.map +0 -7
- package/cjs/useColorTemplate.js.map +0 -7
- package/css/aliases.js.map +0 -7
- package/css/getProps.js.map +0 -7
- package/css/getValue.js.map +0 -7
- package/css/index.js.map +0 -7
- package/css/types.js +0 -1
- package/index.js.map +0 -7
- package/theme/ThemeCssVars.js.map +0 -7
- package/theme/ThemeDefaultOptions.js.map +0 -7
- package/theme/ThemeProvider.js +0 -2
- package/theme/ThemeProvider.js.map +0 -7
- package/theme/core.js.map +0 -7
- package/theme/createColor.js.map +0 -7
- package/theme/createTheme.js.map +0 -7
- package/theme/index.js.map +0 -7
- package/theme/types.js +0 -1
- package/useAnimation.js.map +0 -7
- package/useColorTemplate.js.map +0 -7
- /package/{types/ServerStyleTags.d.ts → ServerStyleTags.d.ts} +0 -0
- /package/{types/Tag → Tag}/cssPropList.d.ts +0 -0
- /package/{types/Tag → Tag}/index.d.ts +0 -0
- /package/{types/Tag → Tag}/types.d.ts +0 -0
- /package/Tag/{types.js.map → types.mjs.map} +0 -0
- /package/{types/Tag → Tag}/useTagProps.d.ts +0 -0
- /package/{types/Transition → Transition}/index.d.ts +0 -0
- /package/{types/Transition → Transition}/variants.d.ts +0 -0
- /package/{types/breakpoint → breakpoint}/index.d.ts +0 -0
- /package/{types/breakpoint → breakpoint}/useBreakpoint.d.ts +0 -0
- /package/{types/breakpoint → breakpoint}/useBreakpointProps.d.ts +0 -0
- /package/{types/css → css}/aliases.d.ts +0 -0
- /package/{types/css → css}/getProps.d.ts +0 -0
- /package/{types/css → css}/getValue.d.ts +0 -0
- /package/{types/css → css}/index.d.ts +0 -0
- /package/{types/css → css}/types.d.ts +0 -0
- /package/css/{types.js.map → types.mjs.map} +0 -0
- /package/{types/index.d.ts → index.d.ts} +0 -0
- /package/{types/isWindow.d.ts → isWindow.d.ts} +0 -0
- /package/{types/theme → theme}/ThemeCssVars.d.ts +0 -0
- /package/{types/theme → theme}/ThemeDefaultOptions.d.ts +0 -0
- /package/{types/theme → theme}/ThemeProvider.d.ts +0 -0
- /package/{types/theme → theme}/core.d.ts +0 -0
- /package/{types/theme → theme}/createColor.d.ts +0 -0
- /package/{types/theme → theme}/createTheme.d.ts +0 -0
- /package/{types/theme → theme}/createThemeSwitcher.d.ts +0 -0
- /package/{types/theme → theme}/index.d.ts +0 -0
- /package/{types/theme → theme}/types.d.ts +0 -0
- /package/theme/{types.js.map → types.mjs.map} +0 -0
- /package/{types/useAnimation.d.ts → useAnimation.d.ts} +0 -0
- /package/{types/useColorTemplate.d.ts → useColorTemplate.d.ts} +0 -0
- /package/{types/useInterface.d.ts → useInterface.d.ts} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/css/getProps.ts"],
|
|
4
|
+
"sourcesContent": ["import { CSSProps } from \"./types\";\n\nconst getProps = (prop: string, value: string, _css: CSSProps) => {\n let important;\n if (typeof value === 'string') {\n const split = value.split(\"!\")\n important = split[1] ? \"!important\" : \"\"\n value = split[0]\n }\n\n if (prop === 'disabled') {\n if ((value as any) === true) {\n return {\n pointerEvents: \"none!important\",\n cursor: \"default!important\",\n userSelect: \"none!important\",\n opacity: \".8!important\"\n } as any\n }\n return {}\n }\n\n if (value && typeof value === \"number\" && [\"border\", \"borderRight\", \"borderLeft\", \"borderTop\", \"borderBottom\"].includes(prop as any)) {\n const keys: any = Object.keys(_css)\n let p: any = {\n [`${prop}Width`]: value + 'px' + (important || \"\"),\n }\n if (!keys.includes(`${prop}Color`)) {\n p[`${prop}Color`] = \"divider\"\n }\n if (!keys.includes(`${prop}Style`)) {\n p[`${prop}Style`] = \"solid\"\n }\n return p\n }\n}\n\nexport default getProps"],
|
|
5
|
+
"mappings": "AAEA,MAAMA,EAAW,CAACC,EAAcC,EAAeC,IAAmB,CAC9D,IAAIC,EACJ,GAAI,OAAOF,GAAU,SAAU,CAC3B,MAAMG,EAAQH,EAAM,MAAM,GAAG,EAC7BE,EAAYC,EAAM,CAAC,EAAI,aAAe,GACtCH,EAAQG,EAAM,CAAC,CACnB,CAEA,GAAIJ,IAAS,WACT,OAAKC,IAAkB,GACZ,CACH,cAAe,iBACf,OAAQ,oBACR,WAAY,iBACZ,QAAS,cACb,EAEG,CAAC,EAGZ,GAAIA,GAAS,OAAOA,GAAU,UAAY,CAAC,SAAU,cAAe,aAAc,YAAa,cAAc,EAAE,SAASD,CAAW,EAAG,CAClI,MAAMK,EAAY,OAAO,KAAKH,CAAI,EAClC,IAAII,EAAS,CACT,CAAC,GAAGN,CAAI,OAAO,EAAGC,EAAQ,MAAQE,GAAa,GACnD,EACA,OAAKE,EAAK,SAAS,GAAGL,CAAI,OAAO,IAC7BM,EAAE,GAAGN,CAAI,OAAO,EAAI,WAEnBK,EAAK,SAAS,GAAGL,CAAI,OAAO,IAC7BM,EAAE,GAAGN,CAAI,OAAO,EAAI,SAEjBM,CACX,CACJ,EAEA,IAAOC,EAAQR",
|
|
6
|
+
"names": ["getProps", "prop", "value", "_css", "important", "split", "keys", "p", "getProps_default"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";var o=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var g=(n,t)=>{for(var e in t)o(n,e,{get:t[e],enumerable:!0})},d=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let h of f(t))!l.call(n,h)&&h!==e&&o(n,h,{get:()=>t[h],enumerable:!(r=s(t,h))||r.enumerable});return n};var c=n=>d(o({},"__esModule",{value:!0}),n);var z={};g(z,{default:()=>w});module.exports=c(z);const a=n=>({[`${n}`]:`var(--color-${n}-primary)`,[`${n}.primary`]:`var(--color-${n}-primary)`,[`${n}.secondary`]:`var(--color-${n}-secondary)`,[`${n}.text`]:`var(--color-${n}-text)`,[`${n}.alpha`]:`var(--color-${n}-alpha)`}),i=(n,t)=>n?t+n:t,m={text:"var(--color-text-primary)","text.primary":"var(--color-text-primary)","text.secondary":"var(--color-text-secondary)",background:"var(--color-background-primary)","background.primary":"var(--color-background-primary)","background.secondary":"var(--color-background-secondary)","background.alpha":"var(--color-background-alpha)",divider:"var(--color-divider)",...a("brand"),...a("accent"),...a("info"),...a("success"),...a("warning"),...a("danger")},y={xs:"var(--bp-xs)",sm:"var(--bp-sm)",md:"var(--bp-md)",lg:"var(--bp-lg)",xl:"var(--bp-xl)"};let v={h1:"var(--fontsize-h1)",h2:"var(--fontsize-h2)",h3:"var(--fontsize-h3)",h4:"var(--fontsize-h4)",h5:"var(--fontsize-h5)",h6:"var(--fontsize-h6)",text:"var(--fontsize-text)",button:"var(--fontsize-button)",small:"var(--fontsize-small)"},b={h1:"var(--lineheight-h1)",h2:"var(--lineheight-h2)",h3:"var(--lineheight-h3)",h4:"var(--lineheight-h4)",h5:"var(--lineheight-h5)",h6:"var(--lineheight-h6)",text:"var(--lineheight-text)",button:"var(--lineheight-button)",small:"var(--lineheight-small)"},x={h1:"var(--fontweight-h1)",h2:"var(--fontweight-h2)",h3:"var(--fontweight-h3)",h4:"var(--fontweight-h4)",h5:"var(--fontweight-h5)",h6:"var(--fontweight-h6)",text:"var(--fontweight-text)",button:"var(--fontweight-button)",small:"var(--fontweight-small)"},p={h1:"var(--font-h1)",h2:"var(--font-h2)",h3:"var(--font-h3)",h4:"var(--font-h4)",h5:"var(--font-h5)",h6:"var(--font-h6)",text:"var(--font-text)",button:"var(--font-button)",small:"var(--font-small)"};const u=(n,t,e)=>{let r;if(typeof t=="string"){const h=t.split("!");r=h[1]?"!important":"",t=h[0]}return["width","maxWidth","minWidth","max-width","min-width"].includes(n)?i(r,y[t]||t):["fontFamily","font-family"].includes(n)&&t==="default"?i(r,"var(--font-family)"):n==="font"&&typeof t=="string"&&["h1","h2","h3","h4","h5","h6","text","button","small"].includes(t)?i(r,p[t]||t):["fontWeight","font-weight"].includes(n)&&typeof t=="string"&&["h1","h2","h3","h4","h5","h6","text","button","small"].includes(t)?i(r,x[t]||t):["lineHeight","line-height"].includes(n)&&typeof t=="string"&&["h1","h2","h3","h4","h5","h6","text","button","small"].includes(t)?i(r,b[t]||t):["fontSize","font-size"].includes(n)&&typeof t=="string"?i(r,v[t]||t):typeof t=="number"&&["shadow","boxShadow"].includes(n)?i(r,`var(--shadow-${t})`):i(r,m[t]||t)};var w=u;
|
|
2
|
-
//# sourceMappingURL=getValue.
|
|
2
|
+
//# sourceMappingURL=getValue.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/css/getValue.ts"],
|
|
4
|
+
"sourcesContent": ["import { CSSProps } from \"./types\"\n\nconst getColor = (color: string) => {\n return {\n [`${color}`]: `var(--color-${color}-primary)`,\n [`${color}.primary`]: `var(--color-${color}-primary)`,\n [`${color}.secondary`]: `var(--color-${color}-secondary)`,\n [`${color}.text`]: `var(--color-${color}-text)`,\n [`${color}.alpha`]: `var(--color-${color}-alpha)`\n }\n}\n\nconst withImportant = (important: any, value: any) => important ? value + important : value\nconst colors: any = {\n \"text\": `var(--color-text-primary)`,\n \"text.primary\": `var(--color-text-primary)`,\n \"text.secondary\": `var(--color-text-secondary)`,\n\n \"background\": `var(--color-background-primary)`,\n \"background.primary\": `var(--color-background-primary)`,\n \"background.secondary\": `var(--color-background-secondary)`,\n \"background.alpha\": `var(--color-background-alpha)`,\n \"divider\": `var(--color-divider)`,\n\n ...getColor(\"brand\"),\n ...getColor(\"accent\"),\n ...getColor(\"info\"),\n ...getColor(\"success\"),\n ...getColor(\"warning\"),\n ...getColor(\"danger\"),\n}\n\nconst breakpoints: any = {\n \"xs\": \"var(--bp-xs)\",\n \"sm\": \"var(--bp-sm)\",\n \"md\": \"var(--bp-md)\",\n \"lg\": \"var(--bp-lg)\",\n \"xl\": \"var(--bp-xl)\"\n}\n\nlet fontsizes: any = {\n \"h1\": \"var(--fontsize-h1)\",\n \"h2\": \"var(--fontsize-h2)\",\n \"h3\": \"var(--fontsize-h3)\",\n \"h4\": \"var(--fontsize-h4)\",\n \"h5\": \"var(--fontsize-h5)\",\n \"h6\": \"var(--fontsize-h6)\",\n \"text\": \"var(--fontsize-text)\",\n \"button\": \"var(--fontsize-button)\",\n \"small\": \"var(--fontsize-small)\"\n}\n\nlet lineHeights: any = {\n \"h1\": \"var(--lineheight-h1)\",\n \"h2\": \"var(--lineheight-h2)\",\n \"h3\": \"var(--lineheight-h3)\",\n \"h4\": \"var(--lineheight-h4)\",\n \"h5\": \"var(--lineheight-h5)\",\n \"h6\": \"var(--lineheight-h6)\",\n \"text\": \"var(--lineheight-text)\",\n \"button\": \"var(--lineheight-button)\",\n \"small\": \"var(--lineheight-small)\"\n}\n\nlet fontWeights: any = {\n \"h1\": \"var(--fontweight-h1)\",\n \"h2\": \"var(--fontweight-h2)\",\n \"h3\": \"var(--fontweight-h3)\",\n \"h4\": \"var(--fontweight-h4)\",\n \"h5\": \"var(--fontweight-h5)\",\n \"h6\": \"var(--fontweight-h6)\",\n \"text\": \"var(--fontweight-text)\",\n \"button\": \"var(--fontweight-button)\",\n \"small\": \"var(--fontweight-small)\"\n}\n\nlet font: any = {\n \"h1\": \"var(--font-h1)\",\n \"h2\": \"var(--font-h2)\",\n \"h3\": \"var(--font-h3)\",\n \"h4\": \"var(--font-h4)\",\n \"h5\": \"var(--font-h5)\",\n \"h6\": \"var(--font-h6)\",\n \"text\": \"var(--font-text)\",\n \"button\": \"var(--font-button)\",\n \"small\": \"var(--font-small)\"\n}\n\nconst getValue = (prop: any, value: string | number, _css: CSSProps): any => {\n let important;\n\n if (typeof value === 'string') {\n const split = value.split(\"!\")\n important = split[1] ? \"!important\" : \"\"\n value = split[0]\n }\n\n if (['width', 'maxWidth', 'minWidth', 'max-width', 'min-width'].includes(prop)) {\n return withImportant(important, breakpoints[value] || value)\n } else if (['fontFamily', 'font-family'].includes(prop) && value === 'default') {\n return withImportant(important, \"var(--font-family)\")\n } if (prop === 'font' && typeof value === \"string\" && ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'text', 'button', 'small'].includes(value)) {\n return withImportant(important, font[value] || value)\n } if (['fontWeight', 'font-weight'].includes(prop) && typeof value === 'string' && ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'text', 'button', 'small'].includes(value)) {\n return withImportant(important, fontWeights[value] || value)\n } else if (['lineHeight', 'line-height'].includes(prop) && typeof value === 'string' && ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'text', 'button', 'small'].includes(value)) {\n return withImportant(important, lineHeights[value] || value)\n } else if (['fontSize', 'font-size'].includes(prop) && typeof value === 'string') {\n return withImportant(important, fontsizes[value] || value)\n } else if (typeof value === \"number\" && [\"shadow\", \"boxShadow\"].includes(prop)) {\n return withImportant(important, `var(--shadow-${value})`)\n }\n\n return withImportant(important, colors[value] || value)\n}\n\nexport default getValue"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAEA,MAAMI,EAAYC,IACP,CACH,CAAC,GAAGA,CAAK,EAAE,EAAG,eAAeA,CAAK,YAClC,CAAC,GAAGA,CAAK,UAAU,EAAG,eAAeA,CAAK,YAC1C,CAAC,GAAGA,CAAK,YAAY,EAAG,eAAeA,CAAK,cAC5C,CAAC,GAAGA,CAAK,OAAO,EAAG,eAAeA,CAAK,SACvC,CAAC,GAAGA,CAAK,QAAQ,EAAG,eAAeA,CAAK,SAC5C,GAGEC,EAAgB,CAACC,EAAgBC,IAAeD,EAAYC,EAAQD,EAAYC,EAChFC,EAAc,CAChB,KAAQ,4BACR,eAAgB,4BAChB,iBAAkB,8BAElB,WAAc,kCACd,qBAAsB,kCACtB,uBAAwB,oCACxB,mBAAoB,gCACpB,QAAW,uBAEX,GAAGL,EAAS,OAAO,EACnB,GAAGA,EAAS,QAAQ,EACpB,GAAGA,EAAS,MAAM,EAClB,GAAGA,EAAS,SAAS,EACrB,GAAGA,EAAS,SAAS,EACrB,GAAGA,EAAS,QAAQ,CACxB,EAEMM,EAAmB,CACrB,GAAM,eACN,GAAM,eACN,GAAM,eACN,GAAM,eACN,GAAM,cACV,EAEA,IAAIC,EA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tJF,EAAcC,EAAWM,EAAYL,CAAK,GAAKA,CAAK,EACpD,CAAC,aAAc,aAAa,EAAE,SAASQ,CAAI,GAAK,OAAOR,GAAU,UAAY,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,OAAQ,SAAU,OAAO,EAAE,SAASA,CAAK,EAC3JF,EAAcC,EAAWK,EAAYJ,CAAK,GAAKA,CAAK,EACpD,CAAC,WAAY,WAAW,EAAE,SAASQ,CAAI,GAAK,OAAOR,GAAU,SAC7DF,EAAcC,EAAWI,EAAUH,CAAK,GAAKA,CAAK,EAClD,OAAOA,GAAU,UAAY,CAAC,SAAU,WAAW,EAAE,SAASQ,CAAI,EAClEV,EAAcC,EAAW,gBAAgBC,CAAK,GAAG,EAGrDF,EAAcC,EAAWE,EAAOD,CAAK,GAAKA,CAAK,CAC1D,EAEA,IAAON,EAAQa",
|
|
6
|
+
"names": ["getValue_exports", "__export", "getValue_default", "__toCommonJS", "getColor", "color", "withImportant", "important", "value", "colors", "breakpoints", "fontsizes", "lineHeights", "fontWeights", "font", "getValue", "prop", "_css", "split"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const i=n=>({[`${n}`]:`var(--color-${n}-primary)`,[`${n}.primary`]:`var(--color-${n}-primary)`,[`${n}.secondary`]:`var(--color-${n}-secondary)`,[`${n}.text`]:`var(--color-${n}-text)`,[`${n}.alpha`]:`var(--color-${n}-alpha)`}),h=(n,t)=>n?t+n:t,e={text:"var(--color-text-primary)","text.primary":"var(--color-text-primary)","text.secondary":"var(--color-text-secondary)",background:"var(--color-background-primary)","background.primary":"var(--color-background-primary)","background.secondary":"var(--color-background-secondary)","background.alpha":"var(--color-background-alpha)",divider:"var(--color-divider)",...i("brand"),...i("accent"),...i("info"),...i("success"),...i("warning"),...i("danger")},o={xs:"var(--bp-xs)",sm:"var(--bp-sm)",md:"var(--bp-md)",lg:"var(--bp-lg)",xl:"var(--bp-xl)"};let s={h1:"var(--fontsize-h1)",h2:"var(--fontsize-h2)",h3:"var(--fontsize-h3)",h4:"var(--fontsize-h4)",h5:"var(--fontsize-h5)",h6:"var(--fontsize-h6)",text:"var(--fontsize-text)",button:"var(--fontsize-button)",small:"var(--fontsize-small)"},f={h1:"var(--lineheight-h1)",h2:"var(--lineheight-h2)",h3:"var(--lineheight-h3)",h4:"var(--lineheight-h4)",h5:"var(--lineheight-h5)",h6:"var(--lineheight-h6)",text:"var(--lineheight-text)",button:"var(--lineheight-button)",small:"var(--lineheight-small)"},l={h1:"var(--fontweight-h1)",h2:"var(--fontweight-h2)",h3:"var(--fontweight-h3)",h4:"var(--fontweight-h4)",h5:"var(--fontweight-h5)",h6:"var(--fontweight-h6)",text:"var(--fontweight-text)",button:"var(--fontweight-button)",small:"var(--fontweight-small)"},g={h1:"var(--font-h1)",h2:"var(--font-h2)",h3:"var(--font-h3)",h4:"var(--font-h4)",h5:"var(--font-h5)",h6:"var(--font-h6)",text:"var(--font-text)",button:"var(--font-button)",small:"var(--font-small)"};const d=(n,t,c)=>{let r;if(typeof t=="string"){const a=t.split("!");r=a[1]?"!important":"",t=a[0]}return["width","maxWidth","minWidth","max-width","min-width"].includes(n)?h(r,o[t]||t):["fontFamily","font-family"].includes(n)&&t==="default"?h(r,"var(--font-family)"):n==="font"&&typeof t=="string"&&["h1","h2","h3","h4","h5","h6","text","button","small"].includes(t)?h(r,g[t]||t):["fontWeight","font-weight"].includes(n)&&typeof t=="string"&&["h1","h2","h3","h4","h5","h6","text","button","small"].includes(t)?h(r,l[t]||t):["lineHeight","line-height"].includes(n)&&typeof t=="string"&&["h1","h2","h3","h4","h5","h6","text","button","small"].includes(t)?h(r,f[t]||t):["fontSize","font-size"].includes(n)&&typeof t=="string"?h(r,s[t]||t):typeof t=="number"&&["shadow","boxShadow"].includes(n)?h(r,`var(--shadow-${t})`):h(r,e[t]||t)};var v=d;export{v as default};
|
|
2
|
-
//# sourceMappingURL=getValue.
|
|
2
|
+
//# sourceMappingURL=getValue.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/css/getValue.ts"],
|
|
4
|
+
"sourcesContent": ["import { CSSProps } from \"./types\"\n\nconst getColor = (color: string) => {\n return {\n [`${color}`]: `var(--color-${color}-primary)`,\n [`${color}.primary`]: `var(--color-${color}-primary)`,\n [`${color}.secondary`]: `var(--color-${color}-secondary)`,\n [`${color}.text`]: `var(--color-${color}-text)`,\n [`${color}.alpha`]: `var(--color-${color}-alpha)`\n }\n}\n\nconst withImportant = (important: any, value: any) => important ? value + important : value\nconst colors: any = {\n \"text\": `var(--color-text-primary)`,\n \"text.primary\": `var(--color-text-primary)`,\n \"text.secondary\": `var(--color-text-secondary)`,\n\n \"background\": `var(--color-background-primary)`,\n \"background.primary\": `var(--color-background-primary)`,\n \"background.secondary\": `var(--color-background-secondary)`,\n \"background.alpha\": `var(--color-background-alpha)`,\n \"divider\": `var(--color-divider)`,\n\n ...getColor(\"brand\"),\n ...getColor(\"accent\"),\n ...getColor(\"info\"),\n ...getColor(\"success\"),\n ...getColor(\"warning\"),\n ...getColor(\"danger\"),\n}\n\nconst breakpoints: any = {\n \"xs\": \"var(--bp-xs)\",\n \"sm\": \"var(--bp-sm)\",\n \"md\": \"var(--bp-md)\",\n \"lg\": \"var(--bp-lg)\",\n \"xl\": \"var(--bp-xl)\"\n}\n\nlet fontsizes: any = {\n \"h1\": \"var(--fontsize-h1)\",\n \"h2\": \"var(--fontsize-h2)\",\n \"h3\": \"var(--fontsize-h3)\",\n \"h4\": \"var(--fontsize-h4)\",\n \"h5\": \"var(--fontsize-h5)\",\n \"h6\": \"var(--fontsize-h6)\",\n \"text\": \"var(--fontsize-text)\",\n \"button\": \"var(--fontsize-button)\",\n \"small\": \"var(--fontsize-small)\"\n}\n\nlet lineHeights: any = {\n \"h1\": \"var(--lineheight-h1)\",\n \"h2\": \"var(--lineheight-h2)\",\n \"h3\": \"var(--lineheight-h3)\",\n \"h4\": \"var(--lineheight-h4)\",\n \"h5\": \"var(--lineheight-h5)\",\n \"h6\": \"var(--lineheight-h6)\",\n \"text\": \"var(--lineheight-text)\",\n \"button\": \"var(--lineheight-button)\",\n \"small\": \"var(--lineheight-small)\"\n}\n\nlet fontWeights: any = {\n \"h1\": \"var(--fontweight-h1)\",\n \"h2\": \"var(--fontweight-h2)\",\n \"h3\": \"var(--fontweight-h3)\",\n \"h4\": \"var(--fontweight-h4)\",\n \"h5\": \"var(--fontweight-h5)\",\n \"h6\": \"var(--fontweight-h6)\",\n \"text\": \"var(--fontweight-text)\",\n \"button\": \"var(--fontweight-button)\",\n \"small\": \"var(--fontweight-small)\"\n}\n\nlet font: any = {\n \"h1\": \"var(--font-h1)\",\n \"h2\": \"var(--font-h2)\",\n \"h3\": \"var(--font-h3)\",\n \"h4\": \"var(--font-h4)\",\n \"h5\": \"var(--font-h5)\",\n \"h6\": \"var(--font-h6)\",\n \"text\": \"var(--font-text)\",\n \"button\": \"var(--font-button)\",\n \"small\": \"var(--font-small)\"\n}\n\nconst getValue = (prop: any, value: string | number, _css: CSSProps): any => {\n let important;\n\n if (typeof value === 'string') {\n const split = value.split(\"!\")\n important = split[1] ? \"!important\" : \"\"\n value = split[0]\n }\n\n if (['width', 'maxWidth', 'minWidth', 'max-width', 'min-width'].includes(prop)) {\n return withImportant(important, breakpoints[value] || value)\n } else if (['fontFamily', 'font-family'].includes(prop) && value === 'default') {\n return withImportant(important, \"var(--font-family)\")\n } if (prop === 'font' && typeof value === \"string\" && ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'text', 'button', 'small'].includes(value)) {\n return withImportant(important, font[value] || value)\n } if (['fontWeight', 'font-weight'].includes(prop) && typeof value === 'string' && ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'text', 'button', 'small'].includes(value)) {\n return withImportant(important, fontWeights[value] || value)\n } else if (['lineHeight', 'line-height'].includes(prop) && typeof value === 'string' && ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'text', 'button', 'small'].includes(value)) {\n return withImportant(important, lineHeights[value] || value)\n } else if (['fontSize', 'font-size'].includes(prop) && typeof value === 'string') {\n return withImportant(important, fontsizes[value] || value)\n } else if (typeof value === \"number\" && [\"shadow\", \"boxShadow\"].includes(prop)) {\n return withImportant(important, `var(--shadow-${value})`)\n }\n\n return withImportant(important, colors[value] || value)\n}\n\nexport default getValue"],
|
|
5
|
+
"mappings": "AAEA,MAAMA,EAAYC,IACP,CACH,CAAC,GAAGA,CAAK,EAAE,EAAG,eAAeA,CAAK,YAClC,CAAC,GAAGA,CAAK,UAAU,EAAG,eAAeA,CAAK,YAC1C,CAAC,GAAGA,CAAK,YAAY,EAAG,eAAeA,CAAK,cAC5C,CAAC,GAAGA,CAAK,OAAO,EAAG,eAAeA,CAAK,SACvC,CAAC,GAAGA,CAAK,QAAQ,EAAG,eAAeA,CAAK,SAC5C,GAGEC,EAAgB,CAACC,EAAgBC,IAAeD,EAAYC,EAAQD,EAAYC,EAChFC,EAAc,CAChB,KAAQ,4BACR,eAAgB,4BAChB,iBAAkB,8BAElB,WAAc,kCACd,qBAAsB,kCACtB,uBAAwB,oCACxB,mBAAoB,gCACpB,QAAW,uBAEX,GAAGL,EAAS,OAAO,EACnB,GAAGA,EAAS,QAAQ,EACpB,GAAGA,EAAS,MAAM,EAClB,GAAGA,EAAS,SAAS,EACrB,GAAGA,EAAS,SAAS,EACrB,GAAGA,EAAS,QAAQ,CACxB,EAEMM,EAAmB,CACrB,GAAM,eACN,GAAM,eACN,GAAM,eACN,GAAM,eACN,GAAM,cACV,EAEA,IAAIC,EAAiB,CACjB,GAAM,qBACN,GAAM,qBACN,GAAM,qBACN,GAAM,qBACN,GAAM,qBACN,GAAM,qBACN,KAAQ,uBACR,OAAU,yBACV,MAAS,uBACb,EAEIC,EAAmB,CACnB,GAAM,uBACN,GAAM,uBACN,GAAM,uBACN,GAAM,uBACN,GAAM,uBACN,GAAM,uBACN,KAAQ,yBACR,OAAU,2BACV,MAA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K,EACpD,CAAC,WAAY,WAAW,EAAE,SAASQ,CAAI,GAAK,OAAOR,GAAU,SAC7DF,EAAcC,EAAWI,EAAUH,CAAK,GAAKA,CAAK,EAClD,OAAOA,GAAU,UAAY,CAAC,SAAU,WAAW,EAAE,SAASQ,CAAI,EAClEV,EAAcC,EAAW,gBAAgBC,CAAK,GAAG,EAGrDF,EAAcC,EAAWE,EAAOD,CAAK,GAAKA,CAAK,CAC1D,EAEA,IAAOW,EAAQJ",
|
|
6
|
+
"names": ["getColor", "color", "withImportant", "important", "value", "colors", "breakpoints", "fontsizes", "lineHeights", "fontWeights", "font", "getValue", "prop", "_css", "split", "getValue_default"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";var h=Object.create;var i=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var C=(t,r)=>{for(var e in r)i(t,e,{get:r[e],enumerable:!0})},g=(t,r,e,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of x(r))!P.call(t,s)&&s!==e&&i(t,s,{get:()=>r[s],enumerable:!(a=M(r,s))||a.enumerable});return t};var u=(t,r,e)=>(e=t!=null?h(y(t)):{},g(r||!t||!t.__esModule?i(e,"default",{value:t,enumerable:!0}):e,t)),d=t=>g(i({},"__esModule",{value:!0}),t);var V={};C(V,{adjustColor:()=>F,adjustTextContrast:()=>I,alpha:()=>O,breakpoints:()=>f,css:()=>b,getProps:()=>l.default,getValue:()=>p.default});module.exports=d(V);var p=u(require("./getValue"),1),l=u(require("./getProps"),1),S=u(require("./aliases"),1),c=require("oncss");const f={xs:0,sm:600,md:900,lg:1200,xl:1536},b=(t,r)=>{const e={...r,breakpoints:f,aliases:S.default,getValue:(a,s,n,m)=>{if(r?.getValue){let o=r?.getValue(a,s,n,m);if(o)return o}return(0,p.default)(a,s,n)},getProps:(a,s,n,m)=>{if(r?.getProps){let o=r?.getProps(a,s,n,m);if(o)return o}return(0,l.default)(a,s,n)}};return(0,c.css)(t,e)},F=(t,r)=>{t=t.replace(/^#/,"");let e=parseInt(t.slice(0,2),16),a=parseInt(t.slice(2,4),16),s=parseInt(t.slice(4,6),16);return e=Math.floor(e*r),a=Math.floor(a*r),s=Math.floor(s*r),e=Math.min(255,Math.max(0,e)),a=Math.min(255,Math.max(0,a)),s=Math.min(255,Math.max(0,s)),`#${e.toString(16).padStart(2,"0")}${a.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}`},I=t=>{t=t.replace(/^#/,"");const r=parseInt(t.slice(0,2),16),e=parseInt(t.slice(2,4),16),a=parseInt(t.slice(4,6),16);return(.299*r+.587*e+.114*a)/255>.5?"#111111":"#FFFFFF"},O=(t,r=1)=>{if(typeof r!="number")return t;let e=r*100;if(!t.startsWith("#"))throw new Error("color must be hex");return(t+`0${Math.round(255/100*e).toString(16)}`.slice(-2)).toUpperCase()};
|
|
2
|
-
//# sourceMappingURL=index.
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/css/index.ts"],
|
|
4
|
+
"sourcesContent": ["import getValue from \"./getValue\"\nimport getProps from \"./getProps\"\nimport aliases from \"./aliases\"\nimport { Aliases, BreakpointKeys, CSSOptionProps, CSSProps } from './types'\nimport { css as _css } from \"oncss\"\n\nexport {\n getValue,\n getProps\n}\n\nexport const breakpoints = {\n xs: 0,\n sm: 600,\n md: 900,\n lg: 1200,\n xl: 1536\n}\n\nexport const css = (props: CSSProps, options?: CSSOptionProps) => {\n const cssOptions: CSSOptionProps = {\n ...options,\n breakpoints,\n aliases,\n getValue: (p: any, v: any, _c: any, dept) => {\n if (options?.getValue) {\n let _val = options?.getValue(p, v, _c, dept)\n if (_val) return _val\n }\n return getValue(p, v, _c)\n },\n getProps: (p: any, v: any, _c: any, dept) => {\n if (options?.getProps) {\n let _p = options?.getProps(p, v, _c, dept)\n if (_p) return _p\n }\n return getProps(p, v, _c)\n },\n }\n return _css<Aliases, BreakpointKeys>(props, cssOptions)\n}\n\nexport const adjustColor = (hex: string, factor: number) => {\n\n hex = hex.replace(/^#/, '')\n\n let r = parseInt(hex.slice(0, 2), 16)\n let g = parseInt(hex.slice(2, 4), 16)\n let b = parseInt(hex.slice(4, 6), 16)\n\n r = Math.floor(r * factor)\n g = Math.floor(g * factor)\n b = Math.floor(b * factor)\n\n r = Math.min(255, Math.max(0, r))\n g = Math.min(255, Math.max(0, g))\n b = Math.min(255, Math.max(0, b))\n\n return `#${r.toString(16).padStart(2, '0')}${g.toString(16).padStart(2, '0')}${b.toString(16).padStart(2, '0')}`;\n}\n\nexport const adjustTextContrast = (color: string) => {\n color = color.replace(/^#/, '')\n const r = parseInt(color.slice(0, 2), 16);\n const g = parseInt(color.slice(2, 4), 16);\n const b = parseInt(color.slice(4, 6), 16);\n\n const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;\n return luminance > 0.5 ? '#111111' : '#FFFFFF';\n}\n\nexport const alpha = (color: string, opacity = 1) => {\n if (typeof opacity !== 'number') return color\n let _opacity = opacity * 100\n if (!color.startsWith(\"#\")) throw new Error(`color must be hex`)\n return (color + (`0${Math.round((255 / 100) * _opacity).toString(16)}`.slice(-2))).toUpperCase();\n};\n\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,EAAA,uBAAAC,EAAA,UAAAC,EAAA,gBAAAC,EAAA,QAAAC,EAAA,eAAAC,QAAA,eAAAC,UAAA,eAAAC,EAAAT,GAAA,IAAAU,EAAqB,2BACrBC,EAAqB,2BACrBC,EAAoB,0BAEpBC,EAA4B,iBAOrB,MAAMR,EAAc,CACvB,GAAI,EACJ,GAAI,IACJ,GAAI,IACJ,GAAI,KACJ,GAAI,IACR,EAEaC,EAAM,CAACQ,EAAiBC,IAA6B,CAC9D,MAAMC,EAA6B,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SAAS,EAAG,GAAG,CAAC,EAClH,EAEa1B,EAAsB2B,GAAkB,CACjDA,EAAQA,EAAM,QAAQ,KAAM,EAAE,EAC9B,MAAM,EAAI,SAASA,EAAM,MAAM,EAAG,CAAC,EAAG,EAAE,EAClCF,EAAI,SAASE,EAAM,MAAM,EAAG,CAAC,EAAG,EAAE,EAClCD,EAAI,SAASC,EAAM,MAAM,EAAG,CAAC,EAAG,EAAE,EAGxC,OADmB,KAAQ,EAAI,KAAQF,EAAI,KAAQC,GAAK,IACrC,GAAM,UAAY,SACzC,EAEazB,EAAQ,CAAC0B,EAAeC,EAAU,IAAM,CACjD,GAAI,OAAOA,GAAY,SAAU,OAAOD,EACxC,IAAIE,EAAWD,EAAU,IACzB,GAAI,CAACD,EAAM,WAAW,GAAG,EAAG,MAAM,IAAI,MAAM,mBAAmB,EAC/D,OAAQA,EAAS,IAAI,KAAK,MAAO,IAAM,IAAOE,CAAQ,EAAE,SAAS,EAAE,CAAC,GAAG,MAAM,EAAE,GAAI,YAAY,CACnG",
|
|
6
|
+
"names": ["css_exports", "__export", "adjustColor", "adjustTextContrast", "alpha", "breakpoints", "css", "getProps", "getValue", "__toCommonJS", "import_getValue", "import_getProps", "import_aliases", "import_oncss", "props", "options", "cssOptions", "aliases", "p", "v", "_c", "dept", "_val", "_p", "_css", "hex", "factor", "r", "g", "b", "color", "opacity", "_opacity"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import p from"./getValue";import l from"./getProps";import m from"./aliases";import{css as u}from"oncss";const g={xs:0,sm:600,md:900,lg:1200,xl:1536},d=(t,r)=>{const a={...r,breakpoints:g,aliases:m,getValue:(e,s,n,i)=>{if(r?.getValue){let o=r?.getValue(e,s,n,i);if(o)return o}return p(e,s,n)},getProps:(e,s,n,i)=>{if(r?.getProps){let o=r?.getProps(e,s,n,i);if(o)return o}return l(e,s,n)}};return u(t,a)},b=(t,r)=>{t=t.replace(/^#/,"");let a=parseInt(t.slice(0,2),16),e=parseInt(t.slice(2,4),16),s=parseInt(t.slice(4,6),16);return a=Math.floor(a*r),e=Math.floor(e*r),s=Math.floor(s*r),a=Math.min(255,Math.max(0,a)),e=Math.min(255,Math.max(0,e)),s=Math.min(255,Math.max(0,s)),`#${a.toString(16).padStart(2,"0")}${e.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}`},F=t=>{t=t.replace(/^#/,"");const r=parseInt(t.slice(0,2),16),a=parseInt(t.slice(2,4),16),e=parseInt(t.slice(4,6),16);return(.299*r+.587*a+.114*e)/255>.5?"#111111":"#FFFFFF"},I=(t,r=1)=>{if(typeof r!="number")return t;let a=r*100;if(!t.startsWith("#"))throw new Error("color must be hex");return(t+`0${Math.round(255/100*a).toString(16)}`.slice(-2)).toUpperCase()};export{b as adjustColor,F as adjustTextContrast,I as alpha,g as breakpoints,d as css,l as getProps,p as getValue};
|
|
2
|
-
//# sourceMappingURL=index.
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/css/index.ts"],
|
|
4
|
+
"sourcesContent": ["import getValue from \"./getValue\"\nimport getProps from \"./getProps\"\nimport aliases from \"./aliases\"\nimport { Aliases, BreakpointKeys, CSSOptionProps, CSSProps } from './types'\nimport { css as _css } from \"oncss\"\n\nexport {\n getValue,\n getProps\n}\n\nexport const breakpoints = {\n xs: 0,\n sm: 600,\n md: 900,\n lg: 1200,\n xl: 1536\n}\n\nexport const css = (props: CSSProps, options?: CSSOptionProps) => {\n const cssOptions: CSSOptionProps = {\n ...options,\n breakpoints,\n aliases,\n getValue: (p: any, v: any, _c: any, dept) => {\n if (options?.getValue) {\n let _val = options?.getValue(p, v, _c, dept)\n if (_val) return _val\n }\n return getValue(p, v, _c)\n },\n getProps: (p: any, v: any, _c: any, dept) => {\n if (options?.getProps) {\n let _p = options?.getProps(p, v, _c, dept)\n if (_p) return _p\n }\n return getProps(p, v, _c)\n },\n }\n return _css<Aliases, BreakpointKeys>(props, cssOptions)\n}\n\nexport const adjustColor = (hex: string, factor: number) => {\n\n hex = hex.replace(/^#/, '')\n\n let r = parseInt(hex.slice(0, 2), 16)\n let g = parseInt(hex.slice(2, 4), 16)\n let b = parseInt(hex.slice(4, 6), 16)\n\n r = Math.floor(r * factor)\n g = Math.floor(g * factor)\n b = Math.floor(b * factor)\n\n r = Math.min(255, Math.max(0, r))\n g = Math.min(255, Math.max(0, g))\n b = Math.min(255, Math.max(0, b))\n\n return `#${r.toString(16).padStart(2, '0')}${g.toString(16).padStart(2, '0')}${b.toString(16).padStart(2, '0')}`;\n}\n\nexport const adjustTextContrast = (color: string) => {\n color = color.replace(/^#/, '')\n const r = parseInt(color.slice(0, 2), 16);\n const g = parseInt(color.slice(2, 4), 16);\n const b = parseInt(color.slice(4, 6), 16);\n\n const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;\n return luminance > 0.5 ? '#111111' : '#FFFFFF';\n}\n\nexport const alpha = (color: string, opacity = 1) => {\n if (typeof opacity !== 'number') return color\n let _opacity = opacity * 100\n if (!color.startsWith(\"#\")) throw new Error(`color must be hex`)\n return (color + (`0${Math.round((255 / 100) * _opacity).toString(16)}`.slice(-2))).toUpperCase();\n};\n\n"],
|
|
5
|
+
"mappings": "AAAA,OAAOA,MAAc,aACrB,OAAOC,MAAc,aACrB,OAAOC,MAAa,YAEpB,OAAS,OAAOC,MAAY,QAOrB,MAAMC,EAAc,CACvB,GAAI,EACJ,GAAI,IACJ,GAAI,IACJ,GAAI,KACJ,GAAI,IACR,EAEaC,EAAM,CAACC,EAAiBC,IAA6B,CAC9D,MAAMC,EAA6B,CAC/B,GAAGD,EACH,YAAAH,EACA,QAAAF,EACA,SAAU,CAACO,EAAQC,EAAQC,EAASC,IAAS,CACzC,GAAIL,GAAS,SAAU,CACnB,IAAIM,EAAON,GAAS,SAASE,EAAGC,EAAGC,EAAIC,CAAI,EAC3C,GAAIC,EAA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AAE,EAClCF,EAAI,SAASE,EAAM,MAAM,EAAG,CAAC,EAAG,EAAE,EAGxC,OADmB,KAAQ,EAAI,KAAQH,EAAI,KAAQC,GAAK,IACrC,GAAM,UAAY,SACzC,EAEaG,EAAQ,CAACD,EAAeE,EAAU,IAAM,CACjD,GAAI,OAAOA,GAAY,SAAU,OAAOF,EACxC,IAAIG,EAAWD,EAAU,IACzB,GAAI,CAACF,EAAM,WAAW,GAAG,EAAG,MAAM,IAAI,MAAM,mBAAmB,EAC/D,OAAQA,EAAS,IAAI,KAAK,MAAO,IAAM,IAAOG,CAAQ,EAAE,SAAS,EAAE,CAAC,GAAG,MAAM,EAAE,GAAI,YAAY,CACnG",
|
|
6
|
+
"names": ["getValue", "getProps", "aliases", "_css", "breakpoints", "css", "props", "options", "cssOptions", "p", "v", "_c", "dept", "_val", "_p", "adjustColor", "hex", "factor", "r", "g", "b", "adjustTextContrast", "color", "alpha", "opacity", "_opacity"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";var S=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var t=(p,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of l(e))!y.call(p,a)&&a!==r&&S(p,a,{get:()=>e[a],enumerable:!(o=i(e,a))||o.enumerable});return p};var n=p=>t(S({},"__esModule",{value:!0}),p);var s={};module.exports=n(s);
|
|
2
|
-
//# sourceMappingURL=types.
|
|
2
|
+
//# sourceMappingURL=types.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/css/types.ts"],
|
|
4
|
+
"sourcesContent": ["import * as CSS from 'csstype'\nimport { ColorsRefTypes, TypographyRefTypes, ThemeOptions, } from '../theme/types';\nimport * as oncss from 'oncss'\nexport type FN = (theme: ThemeOptions) => string | number\nexport type CSSBreakpointType = { [key in BreakpointKeys]: string | number }\nexport type CSSValueType<T extends keyof CSS.Properties> = CSS.Properties[T] | Partial<CSSBreakpointType> | number\n\nexport type Aliases = {\n bgcolor?: CSSValueType<'background'> | ColorsRefTypes;\n bgimage?: CSSValueType<'backgroundImage'>;\n bg?: CSSValueType<'background'> | ColorsRefTypes;\n p?: CSSValueType<'padding'>;\n pt?: CSSValueType<'padding'>;\n pr?: CSSValueType<'padding'>;\n pb?: CSSValueType<'padding'>;\n pl?: CSSValueType<'padding'>;\n px?: CSSValueType<'padding'>;\n py?: CSSValueType<'margin'>;\n m?: CSSValueType<'margin'>;\n mt?: CSSValueType<'margin'>;\n mr?: CSSValueType<'margin'>;\n mb?: CSSValueType<'margin'>;\n ml?: CSSValueType<'margin'>;\n mx?: CSSValueType<'margin'>;\n my?: CSSValueType<'margin'>;\n size?: CSSValueType<'width'>;\n spacing?: Partial<CSSBreakpointType> | number;\n\n radius?: CSSValueType<'borderRadius'> | number;\n borderRadius?: CSSValueType<'borderRadius'> | number;\n shadow?: CSSValueType<'boxShadow'> | number;\n flexBox?: boolean;\n flexRow?: boolean;\n flexColumn?: boolean;\n flexWraped?: boolean;\n direction?: \"row\" | \"column\" | CSSValueType<'direction'>;\n gap?: CSSValueType<'gap'>;\n\n color?: CSSValueType<'color'> | ColorsRefTypes;\n width?: CSSValueType<'width'> | BreakpointKeys;\n height?: CSSValueType<'height'>\n borderColor?: CSSValueType<'backgroundColor'> | ColorsRefTypes;\n\n fontFamily?: CSSValueType<\"fontFamily\"> | \"default\";\n fontSize?: CSSValueType<\"fontSize\"> | TypographyRefTypes;\n minWidth?: CSSValueType<\"minWidth\"> | BreakpointKeys;\n maxWidth?: CSSValueType<\"maxWidth\"> | BreakpointKeys;\n minHeight?: CSSValueType<\"minHeight\">\n maxHeight?: CSSValueType<\"maxHeight\">\n}\n\n\nexport type BreakpointKeys = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\"\n\nexport type CSSProps = oncss.CSSProps<Aliases, BreakpointKeys>\nexport type CSSOptionProps = oncss.CSSOptionProps<Aliases, BreakpointKeys>\n\nexport type GlobalCSS = {\n [key: string]: oncss.CSSPropsWithoutGlobal<Aliases, BreakpointKeys>;\n}"],
|
|
5
|
+
"mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
|
|
6
|
+
"names": ["types_exports", "__toCommonJS"]
|
|
7
|
+
}
|
package/css/types.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";var S=Object.create;var s=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var w=(e,p)=>{for(var t in p)s(e,t,{get:p[t],enumerable:!0})},f=(e,p,t,l)=>{if(p&&typeof p=="object"||typeof p=="function")for(let i of c(p))!v.call(e,i)&&i!==t&&s(e,i,{get:()=>p[i],enumerable:!(l=b(p,i))||l.enumerable});return e},r=(e,p,t)=>(f(e,p,"default"),t&&f(t,p,"default")),m=(e,p,t)=>(t=e!=null?S(d(e)):{},f(p||!e||!e.__esModule?s(t,"default",{value:e,enumerable:!0}):t,e)),A=e=>f(s({},"__esModule",{value:!0}),e);var o={};w(o,{ServerStyleTags:()=>k.default,Tag:()=>a.default,Transition:()=>P.default,isWindow:()=>g.default,useAnimation:()=>x.default,useBreakpoint:()=>T.default,useBreakpointProps:()=>y.default,useColorTemplate:()=>u.default,useInterface:()=>B.default,useTagProps:()=>n.default});module.exports=A(o);var a=m(require("./Tag"),1),n=m(require("./Tag/useTagProps"),1),x=m(require("./useAnimation"),1),u=m(require("./useColorTemplate"),1),T=m(require("./breakpoint/useBreakpoint"),1),y=m(require("./breakpoint/useBreakpointProps"),1),k=m(require("./ServerStyleTags"),1),g=m(require("./isWindow"),1),B=m(require("./useInterface"),1),P=m(require("./Transition"),1);r(o,require("./css"),module.exports);r(o,require("./theme"),module.exports);r(o,require("./css/types"),module.exports);r(o,require("./Tag/types"),module.exports);r(o,require("./theme/types"),module.exports);r(o,require("./useColorTemplate"),module.exports);r(o,require("./useAnimation"),module.exports);
|
|
2
|
-
//# sourceMappingURL=index.
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
package/index.cjs.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["import Tag from './Tag'\nimport useTagProps from './Tag/useTagProps'\nimport useAnimation from './useAnimation'\nimport useColorTemplate from './useColorTemplate'\nimport useBreakpoint from './breakpoint/useBreakpoint'\nimport useBreakpointProps from './breakpoint/useBreakpointProps'\nimport ServerStyleTags from './ServerStyleTags'\nimport isWindow from './isWindow'\nimport useInterface from './useInterface'\nimport Transition from './Transition'\n\nexport * from './css'\nexport * from \"./theme\"\nexport * from './css/types'\nexport * from './Tag/types'\nexport * from './theme/types'\nexport * from './useColorTemplate'\nexport * from './useAnimation'\nexport type * from './Transition'\nexport type * from './Tag/types'\nexport type { useBreakpointPropsType } from './breakpoint/useBreakpointProps'\n\nexport {\n Tag,\n useTagProps,\n useAnimation,\n Transition,\n useColorTemplate,\n ServerStyleTags,\n useBreakpoint,\n useBreakpointProps,\n isWindow,\n useInterface\n}"],
|
|
5
|
+
"mappings": "wmBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uBAAAE,QAAA,UAAAC,QAAA,iBAAAC,QAAA,eAAAC,QAAA,mBAAAC,QAAA,oBAAAC,QAAA,yBAAAC,QAAA,uBAAAC,QAAA,mBAAAC,QAAA,kBAAAC,UAAA,eAAAC,EAAAZ,GAAA,IAAAa,EAAgB,sBAChBC,EAAwB,kCACxBC,EAAyB,+BACzBC,EAA6B,mCAC7BC,EAA0B,2CAC1BC,EAA+B,gDAC/BC,EAA4B,kCAC5BC,EAAqB,2BACrBC,EAAyB,+BACzBC,EAAuB,6BAEvBC,EAAAvB,EAAc,iBAXd,gBAYAuB,EAAAvB,EAAc,mBAZd,gBAaAuB,EAAAvB,EAAc,uBAbd,gBAcAuB,EAAAvB,EAAc,uBAdd,gBAeAuB,EAAAvB,EAAc,yBAfd,gBAgBAuB,EAAAvB,EAAc,8BAhBd,gBAiBAuB,EAAAvB,EAAc,0BAjBd",
|
|
6
|
+
"names": ["index_exports", "__export", "ServerStyleTags", "Tag", "Transition", "isWindow", "useAnimation", "useBreakpoint", "useBreakpointProps", "useColorTemplate", "useInterface", "useTagProps", "__toCommonJS", "import_Tag", "import_useTagProps", "import_useAnimation", "import_useColorTemplate", "import_useBreakpoint", "import_useBreakpointProps", "import_ServerStyleTags", "import_isWindow", "import_useInterface", "import_Transition", "__reExport"]
|
|
7
|
+
}
|
package/{index.js → index.mjs}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import o from"./Tag";import r from"./Tag/useTagProps";import e from"./useAnimation";import p from"./useColorTemplate";import t from"./breakpoint/useBreakpoint";import m from"./breakpoint/useBreakpointProps";import i from"./ServerStyleTags";import f from"./isWindow";import s from"./useInterface";import a from"./Transition";export*from"./css";export*from"./theme";export*from"./css/types";export*from"./Tag/types";export*from"./theme/types";export*from"./useColorTemplate";export*from"./useAnimation";export{i as ServerStyleTags,o as Tag,a as Transition,f as isWindow,e as useAnimation,t as useBreakpoint,m as useBreakpointProps,p as useColorTemplate,s as useInterface,r as useTagProps};
|
|
2
|
-
//# sourceMappingURL=index.
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
package/index.mjs.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["import Tag from './Tag'\nimport useTagProps from './Tag/useTagProps'\nimport useAnimation from './useAnimation'\nimport useColorTemplate from './useColorTemplate'\nimport useBreakpoint from './breakpoint/useBreakpoint'\nimport useBreakpointProps from './breakpoint/useBreakpointProps'\nimport ServerStyleTags from './ServerStyleTags'\nimport isWindow from './isWindow'\nimport useInterface from './useInterface'\nimport Transition from './Transition'\n\nexport * from './css'\nexport * from \"./theme\"\nexport * from './css/types'\nexport * from './Tag/types'\nexport * from './theme/types'\nexport * from './useColorTemplate'\nexport * from './useAnimation'\nexport type * from './Transition'\nexport type * from './Tag/types'\nexport type { useBreakpointPropsType } from './breakpoint/useBreakpointProps'\n\nexport {\n Tag,\n useTagProps,\n useAnimation,\n Transition,\n useColorTemplate,\n ServerStyleTags,\n useBreakpoint,\n useBreakpointProps,\n isWindow,\n useInterface\n}"],
|
|
5
|
+
"mappings": "AAAA,OAAOA,MAAS,QAChB,OAAOC,MAAiB,oBACxB,OAAOC,MAAkB,iBACzB,OAAOC,MAAsB,qBAC7B,OAAOC,MAAmB,6BAC1B,OAAOC,MAAwB,kCAC/B,OAAOC,MAAqB,oBAC5B,OAAOC,MAAc,aACrB,OAAOC,MAAkB,iBACzB,OAAOC,MAAgB,eAEvB,WAAc,QACd,WAAc,UACd,WAAc,cACd,WAAc,cACd,WAAc,gBACd,WAAc,qBACd,WAAc",
|
|
6
|
+
"names": ["Tag", "useTagProps", "useAnimation", "useColorTemplate", "useBreakpoint", "useBreakpointProps", "ServerStyleTags", "isWindow", "useInterface", "Transition"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";var e=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var t=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var p=(n,d)=>{for(var o in d)e(n,o,{get:d[o],enumerable:!0})},s=(n,d,o,w)=>{if(d&&typeof d=="object"||typeof d=="function")for(let i of t(d))!u.call(n,i)&&i!==o&&e(n,i,{get:()=>d[i],enumerable:!(w=f(d,i))||w.enumerable});return n};var W=n=>s(e({},"__esModule",{value:!0}),n);var l={};p(l,{default:()=>c});module.exports=W(l);const a=()=>typeof window<"u"?window:void 0;var c=a;
|
|
2
|
-
//# sourceMappingURL=isWindow.
|
|
2
|
+
//# sourceMappingURL=isWindow.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
4
|
-
"sourcesContent": ["\
|
|
3
|
+
"sources": ["../src/isWindow.ts"],
|
|
4
|
+
"sourcesContent": ["\nconst isWindow = (): Window | void => typeof window !== 'undefined' ? window : undefined\nexport default isWindow"],
|
|
5
5
|
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GACA,MAAMI,EAAW,IAAqB,OAAO,OAAW,IAAc,OAAS,OAC/E,IAAOF,EAAQE",
|
|
6
6
|
"names": ["isWindow_exports", "__export", "isWindow_default", "__toCommonJS", "isWindow"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const d=()=>typeof window<"u"?window:void 0;var n=d;export{n as default};
|
|
2
|
-
//# sourceMappingURL=isWindow.
|
|
2
|
+
//# sourceMappingURL=isWindow.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/isWindow.ts"],
|
|
4
|
-
"sourcesContent": ["\
|
|
4
|
+
"sourcesContent": ["\nconst isWindow = (): Window | void => typeof window !== 'undefined' ? window : undefined\nexport default isWindow"],
|
|
5
5
|
"mappings": "AACA,MAAMA,EAAW,IAAqB,OAAO,OAAW,IAAc,OAAS,OAC/E,IAAOC,EAAQD",
|
|
6
6
|
"names": ["isWindow", "isWindow_default"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,28 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xanui/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"private": false,
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"scripts": {
|
|
11
|
-
"start": "makepack start",
|
|
12
|
-
"build": "makepack build",
|
|
13
|
-
"build:publish": "makepack publish"
|
|
14
|
-
},
|
|
6
|
+
"main": "./index.cjs",
|
|
7
|
+
"module": "./index.mjs",
|
|
8
|
+
"types": "./index.d.ts",
|
|
9
|
+
"sideEffects": false,
|
|
15
10
|
"dependencies": {
|
|
16
11
|
"oncss": "^1.1.14",
|
|
17
|
-
"pretty-class": "^1.0.
|
|
12
|
+
"pretty-class": "^1.0.4",
|
|
18
13
|
"react": "^19.0.0",
|
|
19
14
|
"react-dom": "^19.0.0",
|
|
20
|
-
"react-state-bucket": "^1.1.
|
|
15
|
+
"react-state-bucket": "^1.1.8"
|
|
21
16
|
},
|
|
22
17
|
"devDependencies": {
|
|
23
18
|
"@types/react": "^19.0.2",
|
|
24
19
|
"@types/react-dom": "^19.0.2",
|
|
25
|
-
"makepack": "^1.5
|
|
20
|
+
"makepack": "^1.6.5",
|
|
26
21
|
"typescript": "^4.9.5"
|
|
27
22
|
},
|
|
28
23
|
"keywords": []
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";var t=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var g=(o,r)=>{for(var a in r)t(o,a,{get:r[a],enumerable:!0})},c=(o,r,a,p)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of i(r))!l.call(o,n)&&n!==a&&t(o,n,{get:()=>r[n],enumerable:!(p=y(r,n))||p.enumerable});return o};var s=o=>c(t({},"__esModule",{value:!0}),o);var d={};g(d,{default:()=>f});module.exports=s(d);const h=o=>{const r={};return o.shadow.forEach((a,p)=>r[`--shadow-${p}`]=a),{"--bp-xs":o.breakpoints.xs,"--bp-sm":o.breakpoints.sm,"--bp-md":o.breakpoints.md,"--bp-lg":o.breakpoints.lg,"--bp-xl":o.breakpoints.xl,"--font-family":o.typography.fontFamily,"--font-h1":`${o.typography.h1.fontWeight} ${o.typography.h1.fontSize}px/${o.typography.h1.lineHeight} ${o.typography.fontFamily}`,"--font-h2":`${o.typography.h2.fontWeight} ${o.typography.h2.fontSize}px/${o.typography.h2.lineHeight} ${o.typography.fontFamily}`,"--font-h3":`${o.typography.h3.fontWeight} ${o.typography.h3.fontSize}px/${o.typography.h3.lineHeight} ${o.typography.fontFamily}`,"--font-h4":`${o.typography.h4.fontWeight} ${o.typography.h4.fontSize}px/${o.typography.h4.lineHeight} ${o.typography.fontFamily}`,"--font-h5":`${o.typography.h5.fontWeight} ${o.typography.h5.fontSize}px/${o.typography.h5.lineHeight} ${o.typography.fontFamily}`,"--font-h6":`${o.typography.h6.fontWeight} ${o.typography.h6.fontSize}px/${o.typography.h6.lineHeight} ${o.typography.fontFamily}`,"--font-text":`${o.typography.text.fontWeight} ${o.typography.text.fontSize}px/${o.typography.text.lineHeight} ${o.typography.fontFamily}`,"--font-button":`${o.typography.button.fontWeight} ${o.typography.button.fontSize}px/${o.typography.button.lineHeight} ${o.typography.fontFamily}`,"--font-small":`${o.typography.small.fontWeight} ${o.typography.small.fontSize}px/${o.typography.small.lineHeight} ${o.typography.fontFamily}`,"--fontsize-h1":`${o.typography.h1.fontSize}px`,"--fontsize-h2":`${o.typography.h2.fontSize}px`,"--fontsize-h3":`${o.typography.h3.fontSize}px`,"--fontsize-h4":`${o.typography.h4.fontSize}px`,"--fontsize-h5":`${o.typography.h5.fontSize}px`,"--fontsize-h6":`${o.typography.h6.fontSize}px`,"--fontsize-text":`${o.typography.text.fontSize}px`,"--fontsize-button":`${o.typography.button.fontSize}px`,"--fontsize-small":`${o.typography.small.fontSize}px`,"--fontweight-h1":o.typography.h1.fontWeight+"","--fontweight-h2":o.typography.h2.fontWeight+"","--fontweight-h3":o.typography.h3.fontWeight+"","--fontweight-h4":o.typography.h4.fontWeight+"","--fontweight-h5":o.typography.h5.fontWeight+"","--fontweight-h6":o.typography.h6.fontWeight+"","--fontweight-text":o.typography.text.fontWeight+"","--fontweight-button":o.typography.button.fontWeight+"","--fontweight-small":o.typography.small.fontWeight+"","--lineheight-h1":o.typography.h1.lineHeight+"","--lineheight-h2":o.typography.h2.lineHeight+"","--lineheight-h3":o.typography.h3.lineHeight+"","--lineheight-h4":o.typography.h4.lineHeight+"","--lineheight-h5":o.typography.h5.lineHeight+"","--lineheight-h6":o.typography.h6.lineHeight+"","--lineheight-text":o.typography.text.lineHeight+"","--lineheight-button":o.typography.button.lineHeight+"","--lineheight-small":o.typography.small.lineHeight+"","--color-text":o.colors.text.primary,"--color-text-primary":o.colors.text.primary,"--color-text-secondary":o.colors.text.secondary,"--color-background":o.colors.background.primary,"--color-background-primary":o.colors.background.primary,"--color-background-secondary":o.colors.background.secondary,"--color-background-alpha":o.colors.background.alpha,"--color-divider":o.colors.divider,"--color-brand":o.colors.brand.primary,"--color-brand-primary":o.colors.brand.primary,"--color-brand-secondary":o.colors.brand.secondary,"--color-brand-alpha":o.colors.brand.alpha,"--color-brand-text":o.colors.brand.text,"--color-accent":o.colors.accent.primary,"--color-accent-primary":o.colors.accent.primary,"--color-accent-secondary":o.colors.accent.secondary,"--color-accent-alpha":o.colors.accent.alpha,"--color-accent-text":o.colors.accent.text,"--color-info":o.colors.info.primary,"--color-info-primary":o.colors.info.primary,"--color-info-secondary":o.colors.info.secondary,"--color-info-alpha":o.colors.info.alpha,"--color-info-text":o.colors.info.text,"--color-success":o.colors.success.primary,"--color-success-primary":o.colors.success.primary,"--color-success-secondary":o.colors.success.secondary,"--color-success-alpha":o.colors.success.alpha,"--color-success-text":o.colors.success.text,"--color-warning":o.colors.warning.primary,"--color-warning-primary":o.colors.warning.primary,"--color-warning-secondary":o.colors.warning.secondary,"--color-warning-alpha":o.colors.warning.alpha,"--color-warning-text":o.colors.warning.text,"--color-danger":o.colors.danger.primary,"--color-danger-primary":o.colors.danger.primary,"--color-danger-secondary":o.colors.danger.secondary,"--color-danger-alpha":o.colors.danger.alpha,"--color-danger-text":o.colors.danger.text,...r}};var f=h;
|
|
2
|
-
//# sourceMappingURL=ThemeCssVars.
|
|
2
|
+
//# sourceMappingURL=ThemeCssVars.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/theme/ThemeCssVars.ts"],
|
|
4
|
+
"sourcesContent": ["import { ThemeOptions } from \"./types\";\n\nconst ThemeCssVars = (theme: ThemeOptions) => {\n\n const shadows: any = {}\n theme.shadow.forEach((s, i) => shadows[`--shadow-${i}`] = s)\n\n return {\n \"--bp-xs\": theme.breakpoints.xs,\n \"--bp-sm\": theme.breakpoints.sm,\n \"--bp-md\": theme.breakpoints.md,\n \"--bp-lg\": theme.breakpoints.lg,\n \"--bp-xl\": theme.breakpoints.xl,\n\n \"--font-family\": theme.typography.fontFamily,\n \"--font-h1\": `${theme.typography.h1.fontWeight} ${theme.typography.h1.fontSize}px/${theme.typography.h1.lineHeight} ${theme.typography.fontFamily}`,\n \"--font-h2\": `${theme.typography.h2.fontWeight} ${theme.typography.h2.fontSize}px/${theme.typography.h2.lineHeight} ${theme.typography.fontFamily}`,\n \"--font-h3\": `${theme.typography.h3.fontWeight} ${theme.typography.h3.fontSize}px/${theme.typography.h3.lineHeight} ${theme.typography.fontFamily}`,\n \"--font-h4\": `${theme.typography.h4.fontWeight} ${theme.typography.h4.fontSize}px/${theme.typography.h4.lineHeight} ${theme.typography.fontFamily}`,\n \"--font-h5\": `${theme.typography.h5.fontWeight} ${theme.typography.h5.fontSize}px/${theme.typography.h5.lineHeight} ${theme.typography.fontFamily}`,\n \"--font-h6\": `${theme.typography.h6.fontWeight} ${theme.typography.h6.fontSize}px/${theme.typography.h6.lineHeight} ${theme.typography.fontFamily}`,\n \"--font-text\": `${theme.typography.text.fontWeight} ${theme.typography.text.fontSize}px/${theme.typography.text.lineHeight} ${theme.typography.fontFamily}`,\n \"--font-button\": `${theme.typography.button.fontWeight} ${theme.typography.button.fontSize}px/${theme.typography.button.lineHeight} ${theme.typography.fontFamily}`,\n \"--font-small\": `${theme.typography.small.fontWeight} ${theme.typography.small.fontSize}px/${theme.typography.small.lineHeight} ${theme.typography.fontFamily}`,\n\n \"--fontsize-h1\": `${theme.typography.h1.fontSize}px`,\n \"--fontsize-h2\": `${theme.typography.h2.fontSize}px`,\n \"--fontsize-h3\": `${theme.typography.h3.fontSize}px`,\n \"--fontsize-h4\": `${theme.typography.h4.fontSize}px`,\n \"--fontsize-h5\": `${theme.typography.h5.fontSize}px`,\n \"--fontsize-h6\": `${theme.typography.h6.fontSize}px`,\n \"--fontsize-text\": `${theme.typography.text.fontSize}px`,\n \"--fontsize-button\": `${theme.typography.button.fontSize}px`,\n \"--fontsize-small\": `${theme.typography.small.fontSize}px`,\n\n \"--fontweight-h1\": theme.typography.h1.fontWeight + \"\",\n \"--fontweight-h2\": theme.typography.h2.fontWeight + \"\",\n \"--fontweight-h3\": theme.typography.h3.fontWeight + \"\",\n \"--fontweight-h4\": theme.typography.h4.fontWeight + \"\",\n \"--fontweight-h5\": theme.typography.h5.fontWeight + \"\",\n \"--fontweight-h6\": theme.typography.h6.fontWeight + \"\",\n \"--fontweight-text\": theme.typography.text.fontWeight + \"\",\n \"--fontweight-button\": theme.typography.button.fontWeight + \"\",\n \"--fontweight-small\": theme.typography.small.fontWeight + \"\",\n\n \"--lineheight-h1\": theme.typography.h1.lineHeight + \"\",\n \"--lineheight-h2\": theme.typography.h2.lineHeight + \"\",\n \"--lineheight-h3\": theme.typography.h3.lineHeight + \"\",\n \"--lineheight-h4\": theme.typography.h4.lineHeight + \"\",\n \"--lineheight-h5\": theme.typography.h5.lineHeight + \"\",\n \"--lineheight-h6\": theme.typography.h6.lineHeight + \"\",\n \"--lineheight-text\": theme.typography.text.lineHeight + \"\",\n \"--lineheight-button\": theme.typography.button.lineHeight + \"\",\n \"--lineheight-small\": theme.typography.small.lineHeight + \"\",\n\n \"--color-text\": theme.colors.text.primary,\n \"--color-text-primary\": theme.colors.text.primary,\n \"--color-text-secondary\": theme.colors.text.secondary,\n\n \"--color-background\": theme.colors.background.primary,\n \"--color-background-primary\": theme.colors.background.primary,\n \"--color-background-secondary\": theme.colors.background.secondary,\n \"--color-background-alpha\": theme.colors.background.alpha,\n\n \"--color-divider\": theme.colors.divider,\n\n \"--color-brand\": theme.colors.brand.primary,\n \"--color-brand-primary\": theme.colors.brand.primary,\n \"--color-brand-secondary\": theme.colors.brand.secondary,\n \"--color-brand-alpha\": theme.colors.brand.alpha,\n \"--color-brand-text\": theme.colors.brand.text,\n\n \"--color-accent\": theme.colors.accent.primary,\n \"--color-accent-primary\": theme.colors.accent.primary,\n \"--color-accent-secondary\": theme.colors.accent.secondary,\n \"--color-accent-alpha\": theme.colors.accent.alpha,\n \"--color-accent-text\": theme.colors.accent.text,\n\n \"--color-info\": theme.colors.info.primary,\n \"--color-info-primary\": theme.colors.info.primary,\n \"--color-info-secondary\": theme.colors.info.secondary,\n \"--color-info-alpha\": theme.colors.info.alpha,\n \"--color-info-text\": theme.colors.info.text,\n\n \"--color-success\": theme.colors.success.primary,\n \"--color-success-primary\": theme.colors.success.primary,\n \"--color-success-secondary\": theme.colors.success.secondary,\n \"--color-success-alpha\": theme.colors.success.alpha,\n \"--color-success-text\": theme.colors.success.text,\n\n \"--color-warning\": theme.colors.warning.primary,\n \"--color-warning-primary\": theme.colors.warning.primary,\n \"--color-warning-secondary\": theme.colors.warning.secondary,\n \"--color-warning-alpha\": theme.colors.warning.alpha,\n \"--color-warning-text\": theme.colors.warning.text,\n\n \"--color-danger\": theme.colors.danger.primary,\n \"--color-danger-primary\": theme.colors.danger.primary,\n \"--color-danger-secondary\": theme.colors.danger.secondary,\n \"--color-danger-alpha\": theme.colors.danger.alpha,\n \"--color-danger-text\": theme.colors.danger.text,\n ...shadows,\n }\n}\n\n\nexport default ThemeCssVars"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAEA,MAAMI,EAAgBC,GA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AAQ,UAClD,wBAAyBA,EAAM,OAAO,QAAQ,MAC9C,uBAAwBA,EAAM,OAAO,QAAQ,KAE7C,iBAAkBA,EAAM,OAAO,OAAO,QACtC,yBAA0BA,EAAM,OAAO,OAAO,QAC9C,2BAA4BA,EAAM,OAAO,OAAO,UAChD,uBAAwBA,EAAM,OAAO,OAAO,MAC5C,sBAAuBA,EAAM,OAAO,OAAO,KAC3C,GAAGC,CACP,CACJ,EAGA,IAAOJ,EAAQE",
|
|
6
|
+
"names": ["ThemeCssVars_exports", "__export", "ThemeCssVars_default", "__toCommonJS", "ThemeCssVars", "theme", "shadows", "s", "i"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const p=o=>{const r={};return o.shadow.forEach((a,n)=>r[`--shadow-${n}`]=a),{"--bp-xs":o.breakpoints.xs,"--bp-sm":o.breakpoints.sm,"--bp-md":o.breakpoints.md,"--bp-lg":o.breakpoints.lg,"--bp-xl":o.breakpoints.xl,"--font-family":o.typography.fontFamily,"--font-h1":`${o.typography.h1.fontWeight} ${o.typography.h1.fontSize}px/${o.typography.h1.lineHeight} ${o.typography.fontFamily}`,"--font-h2":`${o.typography.h2.fontWeight} ${o.typography.h2.fontSize}px/${o.typography.h2.lineHeight} ${o.typography.fontFamily}`,"--font-h3":`${o.typography.h3.fontWeight} ${o.typography.h3.fontSize}px/${o.typography.h3.lineHeight} ${o.typography.fontFamily}`,"--font-h4":`${o.typography.h4.fontWeight} ${o.typography.h4.fontSize}px/${o.typography.h4.lineHeight} ${o.typography.fontFamily}`,"--font-h5":`${o.typography.h5.fontWeight} ${o.typography.h5.fontSize}px/${o.typography.h5.lineHeight} ${o.typography.fontFamily}`,"--font-h6":`${o.typography.h6.fontWeight} ${o.typography.h6.fontSize}px/${o.typography.h6.lineHeight} ${o.typography.fontFamily}`,"--font-text":`${o.typography.text.fontWeight} ${o.typography.text.fontSize}px/${o.typography.text.lineHeight} ${o.typography.fontFamily}`,"--font-button":`${o.typography.button.fontWeight} ${o.typography.button.fontSize}px/${o.typography.button.lineHeight} ${o.typography.fontFamily}`,"--font-small":`${o.typography.small.fontWeight} ${o.typography.small.fontSize}px/${o.typography.small.lineHeight} ${o.typography.fontFamily}`,"--fontsize-h1":`${o.typography.h1.fontSize}px`,"--fontsize-h2":`${o.typography.h2.fontSize}px`,"--fontsize-h3":`${o.typography.h3.fontSize}px`,"--fontsize-h4":`${o.typography.h4.fontSize}px`,"--fontsize-h5":`${o.typography.h5.fontSize}px`,"--fontsize-h6":`${o.typography.h6.fontSize}px`,"--fontsize-text":`${o.typography.text.fontSize}px`,"--fontsize-button":`${o.typography.button.fontSize}px`,"--fontsize-small":`${o.typography.small.fontSize}px`,"--fontweight-h1":o.typography.h1.fontWeight+"","--fontweight-h2":o.typography.h2.fontWeight+"","--fontweight-h3":o.typography.h3.fontWeight+"","--fontweight-h4":o.typography.h4.fontWeight+"","--fontweight-h5":o.typography.h5.fontWeight+"","--fontweight-h6":o.typography.h6.fontWeight+"","--fontweight-text":o.typography.text.fontWeight+"","--fontweight-button":o.typography.button.fontWeight+"","--fontweight-small":o.typography.small.fontWeight+"","--lineheight-h1":o.typography.h1.lineHeight+"","--lineheight-h2":o.typography.h2.lineHeight+"","--lineheight-h3":o.typography.h3.lineHeight+"","--lineheight-h4":o.typography.h4.lineHeight+"","--lineheight-h5":o.typography.h5.lineHeight+"","--lineheight-h6":o.typography.h6.lineHeight+"","--lineheight-text":o.typography.text.lineHeight+"","--lineheight-button":o.typography.button.lineHeight+"","--lineheight-small":o.typography.small.lineHeight+"","--color-text":o.colors.text.primary,"--color-text-primary":o.colors.text.primary,"--color-text-secondary":o.colors.text.secondary,"--color-background":o.colors.background.primary,"--color-background-primary":o.colors.background.primary,"--color-background-secondary":o.colors.background.secondary,"--color-background-alpha":o.colors.background.alpha,"--color-divider":o.colors.divider,"--color-brand":o.colors.brand.primary,"--color-brand-primary":o.colors.brand.primary,"--color-brand-secondary":o.colors.brand.secondary,"--color-brand-alpha":o.colors.brand.alpha,"--color-brand-text":o.colors.brand.text,"--color-accent":o.colors.accent.primary,"--color-accent-primary":o.colors.accent.primary,"--color-accent-secondary":o.colors.accent.secondary,"--color-accent-alpha":o.colors.accent.alpha,"--color-accent-text":o.colors.accent.text,"--color-info":o.colors.info.primary,"--color-info-primary":o.colors.info.primary,"--color-info-secondary":o.colors.info.secondary,"--color-info-alpha":o.colors.info.alpha,"--color-info-text":o.colors.info.text,"--color-success":o.colors.success.primary,"--color-success-primary":o.colors.success.primary,"--color-success-secondary":o.colors.success.secondary,"--color-success-alpha":o.colors.success.alpha,"--color-success-text":o.colors.success.text,"--color-warning":o.colors.warning.primary,"--color-warning-primary":o.colors.warning.primary,"--color-warning-secondary":o.colors.warning.secondary,"--color-warning-alpha":o.colors.warning.alpha,"--color-warning-text":o.colors.warning.text,"--color-danger":o.colors.danger.primary,"--color-danger-primary":o.colors.danger.primary,"--color-danger-secondary":o.colors.danger.secondary,"--color-danger-alpha":o.colors.danger.alpha,"--color-danger-text":o.colors.danger.text,...r}};var i=p;export{i as default};
|
|
2
|
-
//# sourceMappingURL=ThemeCssVars.
|
|
2
|
+
//# sourceMappingURL=ThemeCssVars.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/theme/ThemeCssVars.ts"],
|
|
4
|
+
"sourcesContent": ["import { ThemeOptions } from \"./types\";\n\nconst ThemeCssVars = (theme: ThemeOptions) => {\n\n const shadows: any = {}\n theme.shadow.forEach((s, i) => shadows[`--shadow-${i}`] = s)\n\n return {\n \"--bp-xs\": theme.breakpoints.xs,\n \"--bp-sm\": theme.breakpoints.sm,\n \"--bp-md\": theme.breakpoints.md,\n \"--bp-lg\": theme.breakpoints.lg,\n \"--bp-xl\": theme.breakpoints.xl,\n\n \"--font-family\": theme.typography.fontFamily,\n \"--font-h1\": `${theme.typography.h1.fontWeight} ${theme.typography.h1.fontSize}px/${theme.typography.h1.lineHeight} ${theme.typography.fontFamily}`,\n \"--font-h2\": `${theme.typography.h2.fontWeight} ${theme.typography.h2.fontSize}px/${theme.typography.h2.lineHeight} ${theme.typography.fontFamily}`,\n \"--font-h3\": `${theme.typography.h3.fontWeight} ${theme.typography.h3.fontSize}px/${theme.typography.h3.lineHeight} ${theme.typography.fontFamily}`,\n \"--font-h4\": `${theme.typography.h4.fontWeight} ${theme.typography.h4.fontSize}px/${theme.typography.h4.lineHeight} ${theme.typography.fontFamily}`,\n \"--font-h5\": `${theme.typography.h5.fontWeight} ${theme.typography.h5.fontSize}px/${theme.typography.h5.lineHeight} ${theme.typography.fontFamily}`,\n \"--font-h6\": `${theme.typography.h6.fontWeight} ${theme.typography.h6.fontSize}px/${theme.typography.h6.lineHeight} ${theme.typography.fontFamily}`,\n \"--font-text\": `${theme.typography.text.fontWeight} ${theme.typography.text.fontSize}px/${theme.typography.text.lineHeight} ${theme.typography.fontFamily}`,\n \"--font-button\": `${theme.typography.button.fontWeight} ${theme.typography.button.fontSize}px/${theme.typography.button.lineHeight} ${theme.typography.fontFamily}`,\n \"--font-small\": `${theme.typography.small.fontWeight} ${theme.typography.small.fontSize}px/${theme.typography.small.lineHeight} ${theme.typography.fontFamily}`,\n\n \"--fontsize-h1\": `${theme.typography.h1.fontSize}px`,\n \"--fontsize-h2\": `${theme.typography.h2.fontSize}px`,\n \"--fontsize-h3\": `${theme.typography.h3.fontSize}px`,\n \"--fontsize-h4\": `${theme.typography.h4.fontSize}px`,\n \"--fontsize-h5\": `${theme.typography.h5.fontSize}px`,\n \"--fontsize-h6\": `${theme.typography.h6.fontSize}px`,\n \"--fontsize-text\": `${theme.typography.text.fontSize}px`,\n \"--fontsize-button\": `${theme.typography.button.fontSize}px`,\n \"--fontsize-small\": `${theme.typography.small.fontSize}px`,\n\n \"--fontweight-h1\": theme.typography.h1.fontWeight + \"\",\n \"--fontweight-h2\": theme.typography.h2.fontWeight + \"\",\n \"--fontweight-h3\": theme.typography.h3.fontWeight + \"\",\n \"--fontweight-h4\": theme.typography.h4.fontWeight + \"\",\n \"--fontweight-h5\": theme.typography.h5.fontWeight + \"\",\n \"--fontweight-h6\": theme.typography.h6.fontWeight + \"\",\n \"--fontweight-text\": theme.typography.text.fontWeight + \"\",\n \"--fontweight-button\": theme.typography.button.fontWeight + \"\",\n \"--fontweight-small\": theme.typography.small.fontWeight + \"\",\n\n \"--lineheight-h1\": theme.typography.h1.lineHeight + \"\",\n \"--lineheight-h2\": theme.typography.h2.lineHeight + \"\",\n \"--lineheight-h3\": theme.typography.h3.lineHeight + \"\",\n \"--lineheight-h4\": theme.typography.h4.lineHeight + \"\",\n \"--lineheight-h5\": theme.typography.h5.lineHeight + \"\",\n \"--lineheight-h6\": theme.typography.h6.lineHeight + \"\",\n \"--lineheight-text\": theme.typography.text.lineHeight + \"\",\n \"--lineheight-button\": theme.typography.button.lineHeight + \"\",\n \"--lineheight-small\": theme.typography.small.lineHeight + \"\",\n\n \"--color-text\": theme.colors.text.primary,\n \"--color-text-primary\": theme.colors.text.primary,\n \"--color-text-secondary\": theme.colors.text.secondary,\n\n \"--color-background\": theme.colors.background.primary,\n \"--color-background-primary\": theme.colors.background.primary,\n \"--color-background-secondary\": theme.colors.background.secondary,\n \"--color-background-alpha\": theme.colors.background.alpha,\n\n \"--color-divider\": theme.colors.divider,\n\n \"--color-brand\": theme.colors.brand.primary,\n \"--color-brand-primary\": theme.colors.brand.primary,\n \"--color-brand-secondary\": theme.colors.brand.secondary,\n \"--color-brand-alpha\": theme.colors.brand.alpha,\n \"--color-brand-text\": theme.colors.brand.text,\n\n \"--color-accent\": theme.colors.accent.primary,\n \"--color-accent-primary\": theme.colors.accent.primary,\n \"--color-accent-secondary\": theme.colors.accent.secondary,\n \"--color-accent-alpha\": theme.colors.accent.alpha,\n \"--color-accent-text\": theme.colors.accent.text,\n\n \"--color-info\": theme.colors.info.primary,\n \"--color-info-primary\": theme.colors.info.primary,\n \"--color-info-secondary\": theme.colors.info.secondary,\n \"--color-info-alpha\": theme.colors.info.alpha,\n \"--color-info-text\": theme.colors.info.text,\n\n \"--color-success\": theme.colors.success.primary,\n \"--color-success-primary\": theme.colors.success.primary,\n \"--color-success-secondary\": theme.colors.success.secondary,\n \"--color-success-alpha\": theme.colors.success.alpha,\n \"--color-success-text\": theme.colors.success.text,\n\n \"--color-warning\": theme.colors.warning.primary,\n \"--color-warning-primary\": theme.colors.warning.primary,\n \"--color-warning-secondary\": theme.colors.warning.secondary,\n \"--color-warning-alpha\": theme.colors.warning.alpha,\n \"--color-warning-text\": theme.colors.warning.text,\n\n \"--color-danger\": theme.colors.danger.primary,\n \"--color-danger-primary\": theme.colors.danger.primary,\n \"--color-danger-secondary\": theme.colors.danger.secondary,\n \"--color-danger-alpha\": theme.colors.danger.alpha,\n \"--color-danger-text\": theme.colors.danger.text,\n ...shadows,\n }\n}\n\n\nexport default ThemeCssVars"],
|
|
5
|
+
"mappings": "AAEA,MAAMA,EAAgBC,GAAwB,CAE1C,MAAMC,EAAe,CAAC,EACtB,OAAAD,EAAM,OAAO,QAAQ,CAACE,EAAGC,IAAMF,EAAQ,YAAYE,CAAC,EAAE,EAAID,CAAC,EAEpD,CACH,UAAWF,EAAM,YAAY,GAC7B,UAAWA,EAAM,YAAY,GAC7B,UAAWA,EAAM,YAAY,GAC7B,UAAWA,EAAM,YAAY,GAC7B,UAAWA,EAAM,YAAY,GAE7B,gBAAiBA,EAAM,WAAW,WAClC,YAAa,GAAGA,EAAM,WAAW,GAAG,UAAU,IAAIA,EAAM,WAAW,GAAG,QAAQ,MAAMA,EAAM,WAAW,GAAG,UAAU,IAAIA,EAAM,WAAW,UAAU,GACjJ,YAAa,GAAGA,EAAM,WAAW,GAAG,UAAU,IAAIA,EAAM,WAAW,GAAG,QAAQ,MAAMA,EAAM,WAAW,GAAG,UAAU,IAAIA,EAAM,WAAW,UAAU,GACjJ,YAAa,GAAGA,EAAM,WAAW,GAAG,UAAU,IAAIA,EAAM,WAAW,GAAG,QAAQ,MAAMA,E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,OAAO,QACtC,yBAA0BA,EAAM,OAAO,OAAO,QAC9C,2BAA4BA,EAAM,OAAO,OAAO,UAChD,uBAAwBA,EAAM,OAAO,OAAO,MAC5C,sBAAuBA,EAAM,OAAO,OAAO,KAE3C,eAAgBA,EAAM,OAAO,KAAK,QAClC,uBAAwBA,EAAM,OAAO,KAAK,QAC1C,yBAA0BA,EAAM,OAAO,KAAK,UAC5C,qBAAsBA,EAAM,OAAO,KAAK,MACxC,oBAAqBA,EAAM,OAAO,KAAK,KAEvC,kBAAmBA,EAAM,OAAO,QAAQ,QACxC,0BAA2BA,EAAM,OAAO,QAAQ,QAChD,4BAA6BA,EAAM,OAAO,QAAQ,UAClD,wBAAyBA,EAAM,OAAO,QAAQ,MAC9C,uBAAwBA,EAAM,OAAO,QAAQ,KAE7C,kBAAmBA,EAAM,OAAO,QAAQ,QACxC,0BAA2BA,EAAM,OAAO,QAAQ,QAChD,4BAA6BA,EAAM,OAAO,QAAQ,UAClD,wBAAyBA,EAAM,OAAO,QAAQ,MAC9C,uBAAwBA,EAAM,OAAO,QAAQ,KAE7C,iBAAkBA,EAAM,OAAO,OAAO,QACtC,yBAA0BA,EAAM,OAAO,OAAO,QAC9C,2BAA4BA,EAAM,OAAO,OAAO,UAChD,uBAAwBA,EAAM,OAAO,OAAO,MAC5C,sBAAuBA,EAAM,OAAO,OAAO,KAC3C,GAAGC,CACP,CACJ,EAGA,IAAOG,EAAQL",
|
|
6
|
+
"names": ["ThemeCssVars", "theme", "shadows", "s", "i", "ThemeCssVars_default"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";var e=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var f=(x,p)=>{for(var a in p)e(x,a,{get:p[a],enumerable:!0})},y=(x,p,a,g)=>{if(p&&typeof p=="object"||typeof p=="function")for(let r of F(p))!h.call(x,r)&&r!==a&&e(x,r,{get:()=>p[r],enumerable:!(g=n(p,r))||g.enumerable});return x};var l=x=>y(e({},"__esModule",{value:!0}),x);var d={};f(d,{ThemeColors:()=>b,ThemeTypography:()=>o,darkColorPallete:()=>s,default:()=>c,lightColorPallete:()=>t,shadow:()=>i});module.exports=l(d);const t={text:{primary:"#212B36",secondary:"#637381"},background:{primary:"#FFFFFF",secondary:"#EDEFF7"},divider:"#DADCE0"},s={text:{primary:"#FFFFFF",secondary:"#C4CDD5"},background:{primary:"#272727",secondary:"#1E1E1E"},divider:"#3D3D3D"},b={...t,brand:{primary:"#3b82f6",secondary:"#60a5fa",text:"#FFFFFF"},accent:{primary:"#14b8a6",secondary:"#2dd4bf",text:"#FFFFFF"},info:{primary:"#0ea5e9",secondary:"#60a5fa",text:"#FFFFFF"},success:{primary:"#22c55e",secondary:"#4ade80",text:"#FFFFFF"},warning:{primary:"#f59e0b",secondary:"#fbbf24",text:"#FFFFFF"},danger:{primary:"#ef4444",secondary:"#f87171",text:"#FFFFFF"}},o={fontFamily:'"Inter",sans-serif,"Helvetica","Arial"',h1:{fontSize:47.78,lineHeight:1.3,fontWeight:400},h2:{fontSize:39.81,lineHeight:1.35,fontWeight:400},h3:{fontSize:33.18,lineHeight:1.4,fontWeight:400},h4:{fontSize:27.65,lineHeight:1.45,fontWeight:400},h5:{fontSize:27.65,lineHeight:1.5,fontWeight:400},h6:{fontSize:23.04,lineHeight:1.55,fontWeight:400},text:{fontSize:16,lineHeight:1.6,fontWeight:400},button:{fontSize:13.33,lineHeight:1.6,fontWeight:500},small:{fontSize:12.33,lineHeight:1.6,fontWeight:400}},i=["none","0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12)","0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12)","0px 3px 3px -2px rgba(0,0,0,0.2),0px 3px 4px 0px rgba(0,0,0,0.14),0px 1px 8px 0px rgba(0,0,0,0.12)","0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)","0px 3px 5px -1px rgba(0,0,0,0.2),0px 5px 8px 0px rgba(0,0,0,0.14),0px 1px 14px 0px rgba(0,0,0,0.12)","0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)","0px 4px 5px -2px rgba(0,0,0,0.2),0px 7px 10px 1px rgba(0,0,0,0.14),0px 2px 16px 1px rgba(0,0,0,0.12)","0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12)","0px 5px 6px -3px rgba(0,0,0,0.2),0px 9px 12px 1px rgba(0,0,0,0.14),0px 3px 16px 2px rgba(0,0,0,0.12)","0px 6px 6px -3px rgba(0,0,0,0.2),0px 10px 14px 1px rgba(0,0,0,0.14),0px 4px 18px 3px rgba(0,0,0,0.12)","0px 6px 7px -4px rgba(0,0,0,0.2),0px 11px 15px 1px rgba(0,0,0,0.14),0px 4px 20px 3px rgba(0,0,0,0.12)","0px 7px 8px -4px rgba(0,0,0,0.2),0px 12px 17px 2px rgba(0,0,0,0.14),0px 5px 22px 4px rgba(0,0,0,0.12)","0px 7px 8px -4px rgba(0,0,0,0.2),0px 13px 19px 2px rgba(0,0,0,0.14),0px 5px 24px 4px rgba(0,0,0,0.12)","0px 7px 9px -4px rgba(0,0,0,0.2),0px 14px 21px 2px rgba(0,0,0,0.14),0px 5px 26px 4px rgba(0,0,0,0.12)","0px 8px 9px -5px rgba(0,0,0,0.2),0px 15px 22px 2px rgba(0,0,0,0.14),0px 6px 28px 5px rgba(0,0,0,0.12)","0px 8px 10px -5px rgba(0,0,0,0.2),0px 16px 24px 2px rgba(0,0,0,0.14),0px 6px 30px 5px rgba(0,0,0,0.12)","0px 8px 11px -5px rgba(0,0,0,0.2),0px 17px 26px 2px rgba(0,0,0,0.14),0px 6px 32px 5px rgba(0,0,0,0.12)","0px 9px 11px -5px rgba(0,0,0,0.2),0px 18px 28px 2px rgba(0,0,0,0.14),0px 7px 34px 6px rgba(0,0,0,0.12)","0px 9px 12px -6px rgba(0,0,0,0.2),0px 19px 29px 2px rgba(0,0,0,0.14),0px 7px 36px 6px rgba(0,0,0,0.12)","0px 10px 13px -6px rgba(0,0,0,0.2),0px 20px 31px 3px rgba(0,0,0,0.14),0px 8px 38px 7px rgba(0,0,0,0.12)","0px 10px 13px -6px rgba(0,0,0,0.2),0px 21px 33px 3px rgba(0,0,0,0.14),0px 8px 40px 7px rgba(0,0,0,0.12)","0px 10px 14px -6px rgba(0,0,0,0.2),0px 22px 35px 3px rgba(0,0,0,0.14),0px 8px 42px 7px rgba(0,0,0,0.12)","0px 11px 14px -7px rgba(0,0,0,0.2),0px 23px 36px 3px rgba(0,0,0,0.14),0px 9px 44px 8px rgba(0,0,0,0.12)","0px 11px 15px -7px rgba(0,0,0,0.2),0px 24px 38px 3px rgba(0,0,0,0.14),0px 9px 46px 8px rgba(0,0,0,0.12)"];var c={name:"light",rtl:!1,shadow:i,globalStyle:{},colors:b,typography:o,interfaces:{}};
|
|
2
|
-
//# sourceMappingURL=ThemeDefaultOptions.
|
|
2
|
+
//# sourceMappingURL=ThemeDefaultOptions.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/theme/ThemeDefaultOptions.ts"],
|
|
4
|
+
"sourcesContent": ["import { ThemeOptionInput, ThemeTypographyType } from './types'\n\nexport const lightColorPallete = {\n text: {\n primary: \"#212B36\",\n secondary: \"#637381\",\n },\n background: {\n primary: \"#FFFFFF\",\n secondary: \"#EDEFF7\",\n },\n divider: \"#DADCE0\"\n}\n\nexport const darkColorPallete = {\n text: {\n primary: \"#FFFFFF\",\n secondary: \"#C4CDD5\",\n },\n background: {\n primary: \"#272727\",\n secondary: \"#1E1E1E\",\n },\n divider: \"#3D3D3D\"\n}\n\nexport const ThemeColors = {\n ...lightColorPallete,\n brand: {\n primary: \"#3b82f6\",\n secondary: \"#60a5fa\",\n text: \"#FFFFFF\"\n },\n accent: {\n primary: \"#14b8a6\",\n secondary: \"#2dd4bf\",\n text: \"#FFFFFF\"\n },\n info: {\n primary: \"#0ea5e9\",\n secondary: \"#60a5fa\",\n text: \"#FFFFFF\"\n },\n success: {\n primary: \"#22c55e\",\n secondary: \"#4ade80\",\n text: \"#FFFFFF\"\n },\n warning: {\n primary: \"#f59e0b\",\n secondary: \"#fbbf24\",\n text: \"#FFFFFF\"\n },\n danger: {\n primary: \"#ef4444\",\n secondary: \"#f87171\",\n text: \"#FFFFFF\"\n },\n}\n\nexport const ThemeTypography: ThemeTypographyType = {\n fontFamily: '\"Inter\",sans-serif,\"Helvetica\",\"Arial\"',\n h1: {\n fontSize: 47.78,\n lineHeight: 1.3,\n fontWeight: 400,\n },\n h2: {\n fontSize: 39.81,\n lineHeight: 1.35,\n fontWeight: 400,\n },\n h3: {\n fontSize: 33.18,\n lineHeight: 1.4,\n fontWeight: 400,\n },\n h4: {\n fontSize: 27.65,\n lineHeight: 1.45,\n fontWeight: 400,\n },\n h5: {\n fontSize: 27.65,\n lineHeight: 1.5,\n fontWeight: 400,\n },\n h6: {\n fontSize: 23.04,\n lineHeight: 1.55,\n fontWeight: 400,\n },\n text: {\n fontSize: 16,\n lineHeight: 1.6,\n fontWeight: 400,\n },\n button: {\n fontSize: 13.33,\n lineHeight: 1.6,\n fontWeight: 500,\n },\n small: {\n fontSize: 12.33,\n lineHeight: 1.6,\n fontWeight: 400,\n }\n}\n\nexport const shadow = [\n \"none\",\n \"0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12)\",\n \"0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12)\",\n \"0px 3px 3px -2px rgba(0,0,0,0.2),0px 3px 4px 0px rgba(0,0,0,0.14),0px 1px 8px 0px rgba(0,0,0,0.12)\",\n \"0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)\",\n \"0px 3px 5px -1px rgba(0,0,0,0.2),0px 5px 8px 0px rgba(0,0,0,0.14),0px 1px 14px 0px rgba(0,0,0,0.12)\",\n \"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)\",\n \"0px 4px 5px -2px rgba(0,0,0,0.2),0px 7px 10px 1px rgba(0,0,0,0.14),0px 2px 16px 1px rgba(0,0,0,0.12)\",\n \"0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12)\",\n \"0px 5px 6px -3px rgba(0,0,0,0.2),0px 9px 12px 1px rgba(0,0,0,0.14),0px 3px 16px 2px rgba(0,0,0,0.12)\",\n \"0px 6px 6px -3px rgba(0,0,0,0.2),0px 10px 14px 1px rgba(0,0,0,0.14),0px 4px 18px 3px rgba(0,0,0,0.12)\",\n \"0px 6px 7px -4px rgba(0,0,0,0.2),0px 11px 15px 1px rgba(0,0,0,0.14),0px 4px 20px 3px rgba(0,0,0,0.12)\",\n \"0px 7px 8px -4px rgba(0,0,0,0.2),0px 12px 17px 2px rgba(0,0,0,0.14),0px 5px 22px 4px rgba(0,0,0,0.12)\",\n \"0px 7px 8px -4px rgba(0,0,0,0.2),0px 13px 19px 2px rgba(0,0,0,0.14),0px 5px 24px 4px rgba(0,0,0,0.12)\",\n \"0px 7px 9px -4px rgba(0,0,0,0.2),0px 14px 21px 2px rgba(0,0,0,0.14),0px 5px 26px 4px rgba(0,0,0,0.12)\",\n \"0px 8px 9px -5px rgba(0,0,0,0.2),0px 15px 22px 2px rgba(0,0,0,0.14),0px 6px 28px 5px rgba(0,0,0,0.12)\",\n \"0px 8px 10px -5px rgba(0,0,0,0.2),0px 16px 24px 2px rgba(0,0,0,0.14),0px 6px 30px 5px rgba(0,0,0,0.12)\",\n \"0px 8px 11px -5px rgba(0,0,0,0.2),0px 17px 26px 2px rgba(0,0,0,0.14),0px 6px 32px 5px rgba(0,0,0,0.12)\",\n \"0px 9px 11px -5px rgba(0,0,0,0.2),0px 18px 28px 2px rgba(0,0,0,0.14),0px 7px 34px 6px rgba(0,0,0,0.12)\",\n \"0px 9px 12px -6px rgba(0,0,0,0.2),0px 19px 29px 2px rgba(0,0,0,0.14),0px 7px 36px 6px rgba(0,0,0,0.12)\",\n \"0px 10px 13px -6px rgba(0,0,0,0.2),0px 20px 31px 3px rgba(0,0,0,0.14),0px 8px 38px 7px rgba(0,0,0,0.12)\",\n \"0px 10px 13px -6px rgba(0,0,0,0.2),0px 21px 33px 3px rgba(0,0,0,0.14),0px 8px 40px 7px rgba(0,0,0,0.12)\",\n \"0px 10px 14px -6px rgba(0,0,0,0.2),0px 22px 35px 3px rgba(0,0,0,0.14),0px 8px 42px 7px rgba(0,0,0,0.12)\",\n \"0px 11px 14px -7px rgba(0,0,0,0.2),0px 23px 36px 3px rgba(0,0,0,0.14),0px 9px 44px 8px rgba(0,0,0,0.12)\",\n \"0px 11px 15px -7px rgba(0,0,0,0.2),0px 24px 38px 3px rgba(0,0,0,0.14),0px 9px 46px 8px rgba(0,0,0,0.12)\",\n]\n\nexport default {\n name: \"light\",\n rtl: false,\n shadow,\n globalStyle: {},\n colors: ThemeColors,\n typography: ThemeTypography,\n interfaces: {}\n} as ThemeOptionInput\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,EAAA,oBAAAC,EAAA,qBAAAC,EAAA,YAAAC,EAAA,sBAAAC,EAAA,WAAAC,IAAA,eAAAC,EAAAR,GAEO,MAAMM,EAAoB,CAC7B,KAAM,CACF,QAAS,UACT,UAAW,SACf,EACA,WAAY,CACR,QAAS,UACT,UAAW,SACf,EACA,QAAS,SACb,EAEaF,EAAmB,CAC5B,KAAM,CACF,QAAS,UACT,UAAW,SACf,EACA,WAAY,CACR,QAAS,UACT,UAAW,SACf,EACA,QAAS,SACb,EAEaF,EAAc,CACvB,GAAGI,EACH,MAAO,CACH,QAAS,UACT,UAAW,UACX,KAAM,SACV,EACA,OAAQ,CACJ,QAAS,UACT,UAAW,UACX,KAAM,SACV,EACA,KAAM,CACF,QAAS,UACT,UAAW,UACX,KAAM,SACV,EACA,QAAS,CACL,QAAS,UACT,UAAW,UACX,KAAM,SACV,EACA,QAAS,CACL,QAAS,UACT,UAAW,UACX,KAAM,SACV,EACA,OAAQ,CACJ,QAAS,UACT,UAAW,UACX,KAAM,SACV,CACJ,EAEaH,EAAuC,CAChD,WAAY,yCACZ,GAAI,CACA,SAAU,MACV,WAAY,IACZ,WAAY,GAChB,EACA,GAAI,CACA,SAAU,MACV,WAAY,KACZ,WAAY,GAChB,EACA,GAAI,CACA,SAAU,MACV,WAAY,IACZ,WAAY,GAChB,EACA,GAAI,CACA,SAAU,MACV,WAAY,KACZ,WAAY,GAChB,EACA,GAAI,CACA,SAAU,MACV,WAAY,IACZ,WAAY,GAChB,EACA,GAAI,CACA,SAAU,MACV,WAAY,KACZ,WAAY,GAChB,EACA,KAAM,CACF,SAAU,GACV,WAAY,IACZ,WAAY,GAChB,EACA,OAAQ,CACJ,SAAU,MACV,WAAY,IACZ,WAAY,GAChB,EACA,MAAO,CACH,SAAU,MACV,WAAY,IACZ,WAAY,GAChB,CACJ,EAEaI,EAAS,CAClB,OACA,qGACA,qGACA,qGACA,sGACA,sGACA,uGACA,uGACA,uGACA,uGACA,wGACA,wGACA,wGACA,wGACA,wGACA,wGACA,yGACA,yGACA,yGACA,yGACA,0GACA,0GACA,0GACA,0GACA,yGACJ,EAEA,IAAOF,EAAQ,CACX,KAAM,QACN,IAAK,GACL,OAAAE,EACA,YAAa,CAAC,EACd,OAAQL,EACR,WAAYC,EACZ,WAAY,CAAC,CACjB",
|
|
6
|
+
"names": ["ThemeDefaultOptions_exports", "__export", "ThemeColors", "ThemeTypography", "darkColorPallete", "ThemeDefaultOptions_default", "lightColorPallete", "shadow", "__toCommonJS"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const p={text:{primary:"#212B36",secondary:"#637381"},background:{primary:"#FFFFFF",secondary:"#EDEFF7"},divider:"#DADCE0"},b={text:{primary:"#FFFFFF",secondary:"#C4CDD5"},background:{primary:"#272727",secondary:"#1E1E1E"},divider:"#3D3D3D"},x={...p,brand:{primary:"#3b82f6",secondary:"#60a5fa",text:"#FFFFFF"},accent:{primary:"#14b8a6",secondary:"#2dd4bf",text:"#FFFFFF"},info:{primary:"#0ea5e9",secondary:"#60a5fa",text:"#FFFFFF"},success:{primary:"#22c55e",secondary:"#4ade80",text:"#FFFFFF"},warning:{primary:"#f59e0b",secondary:"#fbbf24",text:"#FFFFFF"},danger:{primary:"#ef4444",secondary:"#f87171",text:"#FFFFFF"}},r={fontFamily:'"Inter",sans-serif,"Helvetica","Arial"',h1:{fontSize:47.78,lineHeight:1.3,fontWeight:400},h2:{fontSize:39.81,lineHeight:1.35,fontWeight:400},h3:{fontSize:33.18,lineHeight:1.4,fontWeight:400},h4:{fontSize:27.65,lineHeight:1.45,fontWeight:400},h5:{fontSize:27.65,lineHeight:1.5,fontWeight:400},h6:{fontSize:23.04,lineHeight:1.55,fontWeight:400},text:{fontSize:16,lineHeight:1.6,fontWeight:400},button:{fontSize:13.33,lineHeight:1.6,fontWeight:500},small:{fontSize:12.33,lineHeight:1.6,fontWeight:400}},a=["none","0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12)","0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12)","0px 3px 3px -2px rgba(0,0,0,0.2),0px 3px 4px 0px rgba(0,0,0,0.14),0px 1px 8px 0px rgba(0,0,0,0.12)","0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)","0px 3px 5px -1px rgba(0,0,0,0.2),0px 5px 8px 0px rgba(0,0,0,0.14),0px 1px 14px 0px rgba(0,0,0,0.12)","0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)","0px 4px 5px -2px rgba(0,0,0,0.2),0px 7px 10px 1px rgba(0,0,0,0.14),0px 2px 16px 1px rgba(0,0,0,0.12)","0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12)","0px 5px 6px -3px rgba(0,0,0,0.2),0px 9px 12px 1px rgba(0,0,0,0.14),0px 3px 16px 2px rgba(0,0,0,0.12)","0px 6px 6px -3px rgba(0,0,0,0.2),0px 10px 14px 1px rgba(0,0,0,0.14),0px 4px 18px 3px rgba(0,0,0,0.12)","0px 6px 7px -4px rgba(0,0,0,0.2),0px 11px 15px 1px rgba(0,0,0,0.14),0px 4px 20px 3px rgba(0,0,0,0.12)","0px 7px 8px -4px rgba(0,0,0,0.2),0px 12px 17px 2px rgba(0,0,0,0.14),0px 5px 22px 4px rgba(0,0,0,0.12)","0px 7px 8px -4px rgba(0,0,0,0.2),0px 13px 19px 2px rgba(0,0,0,0.14),0px 5px 24px 4px rgba(0,0,0,0.12)","0px 7px 9px -4px rgba(0,0,0,0.2),0px 14px 21px 2px rgba(0,0,0,0.14),0px 5px 26px 4px rgba(0,0,0,0.12)","0px 8px 9px -5px rgba(0,0,0,0.2),0px 15px 22px 2px rgba(0,0,0,0.14),0px 6px 28px 5px rgba(0,0,0,0.12)","0px 8px 10px -5px rgba(0,0,0,0.2),0px 16px 24px 2px rgba(0,0,0,0.14),0px 6px 30px 5px rgba(0,0,0,0.12)","0px 8px 11px -5px rgba(0,0,0,0.2),0px 17px 26px 2px rgba(0,0,0,0.14),0px 6px 32px 5px rgba(0,0,0,0.12)","0px 9px 11px -5px rgba(0,0,0,0.2),0px 18px 28px 2px rgba(0,0,0,0.14),0px 7px 34px 6px rgba(0,0,0,0.12)","0px 9px 12px -6px rgba(0,0,0,0.2),0px 19px 29px 2px rgba(0,0,0,0.14),0px 7px 36px 6px rgba(0,0,0,0.12)","0px 10px 13px -6px rgba(0,0,0,0.2),0px 20px 31px 3px rgba(0,0,0,0.14),0px 8px 38px 7px rgba(0,0,0,0.12)","0px 10px 13px -6px rgba(0,0,0,0.2),0px 21px 33px 3px rgba(0,0,0,0.14),0px 8px 40px 7px rgba(0,0,0,0.12)","0px 10px 14px -6px rgba(0,0,0,0.2),0px 22px 35px 3px rgba(0,0,0,0.14),0px 8px 42px 7px rgba(0,0,0,0.12)","0px 11px 14px -7px rgba(0,0,0,0.2),0px 23px 36px 3px rgba(0,0,0,0.14),0px 9px 44px 8px rgba(0,0,0,0.12)","0px 11px 15px -7px rgba(0,0,0,0.2),0px 24px 38px 3px rgba(0,0,0,0.14),0px 9px 46px 8px rgba(0,0,0,0.12)"];var o={name:"light",rtl:!1,shadow:a,globalStyle:{},colors:x,typography:r,interfaces:{}};export{x as ThemeColors,r as ThemeTypography,b as darkColorPallete,o as default,p as lightColorPallete,a as shadow};
|
|
2
|
-
//# sourceMappingURL=ThemeDefaultOptions.
|
|
2
|
+
//# sourceMappingURL=ThemeDefaultOptions.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/theme/ThemeDefaultOptions.ts"],
|
|
4
|
+
"sourcesContent": ["import { ThemeOptionInput, ThemeTypographyType } from './types'\n\nexport const lightColorPallete = {\n text: {\n primary: \"#212B36\",\n secondary: \"#637381\",\n },\n background: {\n primary: \"#FFFFFF\",\n secondary: \"#EDEFF7\",\n },\n divider: \"#DADCE0\"\n}\n\nexport const darkColorPallete = {\n text: {\n primary: \"#FFFFFF\",\n secondary: \"#C4CDD5\",\n },\n background: {\n primary: \"#272727\",\n secondary: \"#1E1E1E\",\n },\n divider: \"#3D3D3D\"\n}\n\nexport const ThemeColors = {\n ...lightColorPallete,\n brand: {\n primary: \"#3b82f6\",\n secondary: \"#60a5fa\",\n text: \"#FFFFFF\"\n },\n accent: {\n primary: \"#14b8a6\",\n secondary: \"#2dd4bf\",\n text: \"#FFFFFF\"\n },\n info: {\n primary: \"#0ea5e9\",\n secondary: \"#60a5fa\",\n text: \"#FFFFFF\"\n },\n success: {\n primary: \"#22c55e\",\n secondary: \"#4ade80\",\n text: \"#FFFFFF\"\n },\n warning: {\n primary: \"#f59e0b\",\n secondary: \"#fbbf24\",\n text: \"#FFFFFF\"\n },\n danger: {\n primary: \"#ef4444\",\n secondary: \"#f87171\",\n text: \"#FFFFFF\"\n },\n}\n\nexport const ThemeTypography: ThemeTypographyType = {\n fontFamily: '\"Inter\",sans-serif,\"Helvetica\",\"Arial\"',\n h1: {\n fontSize: 47.78,\n lineHeight: 1.3,\n fontWeight: 400,\n },\n h2: {\n fontSize: 39.81,\n lineHeight: 1.35,\n fontWeight: 400,\n },\n h3: {\n fontSize: 33.18,\n lineHeight: 1.4,\n fontWeight: 400,\n },\n h4: {\n fontSize: 27.65,\n lineHeight: 1.45,\n fontWeight: 400,\n },\n h5: {\n fontSize: 27.65,\n lineHeight: 1.5,\n fontWeight: 400,\n },\n h6: {\n fontSize: 23.04,\n lineHeight: 1.55,\n fontWeight: 400,\n },\n text: {\n fontSize: 16,\n lineHeight: 1.6,\n fontWeight: 400,\n },\n button: {\n fontSize: 13.33,\n lineHeight: 1.6,\n fontWeight: 500,\n },\n small: {\n fontSize: 12.33,\n lineHeight: 1.6,\n fontWeight: 400,\n }\n}\n\nexport const shadow = [\n \"none\",\n \"0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12)\",\n \"0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12)\",\n \"0px 3px 3px -2px rgba(0,0,0,0.2),0px 3px 4px 0px rgba(0,0,0,0.14),0px 1px 8px 0px rgba(0,0,0,0.12)\",\n \"0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)\",\n \"0px 3px 5px -1px rgba(0,0,0,0.2),0px 5px 8px 0px rgba(0,0,0,0.14),0px 1px 14px 0px rgba(0,0,0,0.12)\",\n \"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)\",\n \"0px 4px 5px -2px rgba(0,0,0,0.2),0px 7px 10px 1px rgba(0,0,0,0.14),0px 2px 16px 1px rgba(0,0,0,0.12)\",\n \"0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12)\",\n \"0px 5px 6px -3px rgba(0,0,0,0.2),0px 9px 12px 1px rgba(0,0,0,0.14),0px 3px 16px 2px rgba(0,0,0,0.12)\",\n \"0px 6px 6px -3px rgba(0,0,0,0.2),0px 10px 14px 1px rgba(0,0,0,0.14),0px 4px 18px 3px rgba(0,0,0,0.12)\",\n \"0px 6px 7px -4px rgba(0,0,0,0.2),0px 11px 15px 1px rgba(0,0,0,0.14),0px 4px 20px 3px rgba(0,0,0,0.12)\",\n \"0px 7px 8px -4px rgba(0,0,0,0.2),0px 12px 17px 2px rgba(0,0,0,0.14),0px 5px 22px 4px rgba(0,0,0,0.12)\",\n \"0px 7px 8px -4px rgba(0,0,0,0.2),0px 13px 19px 2px rgba(0,0,0,0.14),0px 5px 24px 4px rgba(0,0,0,0.12)\",\n \"0px 7px 9px -4px rgba(0,0,0,0.2),0px 14px 21px 2px rgba(0,0,0,0.14),0px 5px 26px 4px rgba(0,0,0,0.12)\",\n \"0px 8px 9px -5px rgba(0,0,0,0.2),0px 15px 22px 2px rgba(0,0,0,0.14),0px 6px 28px 5px rgba(0,0,0,0.12)\",\n \"0px 8px 10px -5px rgba(0,0,0,0.2),0px 16px 24px 2px rgba(0,0,0,0.14),0px 6px 30px 5px rgba(0,0,0,0.12)\",\n \"0px 8px 11px -5px rgba(0,0,0,0.2),0px 17px 26px 2px rgba(0,0,0,0.14),0px 6px 32px 5px rgba(0,0,0,0.12)\",\n \"0px 9px 11px -5px rgba(0,0,0,0.2),0px 18px 28px 2px rgba(0,0,0,0.14),0px 7px 34px 6px rgba(0,0,0,0.12)\",\n \"0px 9px 12px -6px rgba(0,0,0,0.2),0px 19px 29px 2px rgba(0,0,0,0.14),0px 7px 36px 6px rgba(0,0,0,0.12)\",\n \"0px 10px 13px -6px rgba(0,0,0,0.2),0px 20px 31px 3px rgba(0,0,0,0.14),0px 8px 38px 7px rgba(0,0,0,0.12)\",\n \"0px 10px 13px -6px rgba(0,0,0,0.2),0px 21px 33px 3px rgba(0,0,0,0.14),0px 8px 40px 7px rgba(0,0,0,0.12)\",\n \"0px 10px 14px -6px rgba(0,0,0,0.2),0px 22px 35px 3px rgba(0,0,0,0.14),0px 8px 42px 7px rgba(0,0,0,0.12)\",\n \"0px 11px 14px -7px rgba(0,0,0,0.2),0px 23px 36px 3px rgba(0,0,0,0.14),0px 9px 44px 8px rgba(0,0,0,0.12)\",\n \"0px 11px 15px -7px rgba(0,0,0,0.2),0px 24px 38px 3px rgba(0,0,0,0.14),0px 9px 46px 8px rgba(0,0,0,0.12)\",\n]\n\nexport default {\n name: \"light\",\n rtl: false,\n shadow,\n globalStyle: {},\n colors: ThemeColors,\n typography: ThemeTypography,\n interfaces: {}\n} as ThemeOptionInput\n"],
|
|
5
|
+
"mappings": "AAEO,MAAMA,EAAoB,CAC7B,KAAM,CACF,QAAS,UACT,UAAW,SACf,EACA,WAAY,CACR,QAAS,UACT,UAAW,SACf,EACA,QAAS,SACb,EAEaC,EAAmB,CAC5B,KAAM,CACF,QAAS,UACT,UAAW,SACf,EACA,WAAY,CACR,QAAS,UACT,UAAW,SACf,EACA,QAAS,SACb,EAEaC,EAAc,CACvB,GAAGF,EACH,MAAO,CACH,QAAS,UACT,UAAW,UACX,KAAM,SACV,EACA,OAAQ,CACJ,QAAS,UACT,UAAW,UACX,KAAM,SACV,EACA,KAAM,CACF,QAAS,UACT,UAAW,UACX,KAAM,SACV,EACA,QAAS,CACL,QAAS,UACT,UAAW,UACX,KAAM,SACV,EACA,QAAS,CACL,QAAS,UACT,UAAW,UACX,KAAM,SACV,EACA,OAAQ,CACJ,QAAS,UACT,UAAW,UACX,KAAM,SACV,CACJ,EAEaG,EAAuC,CAChD,WAAY,yCACZ,GAAI,CACA,SAAU,MACV,WAAY,IACZ,WAAY,GAChB,EACA,GAAI,CACA,SAAU,MACV,WAAY,KACZ,WAAY,GAChB,EACA,GAAI,CACA,SAAU,MACV,WAAY,IACZ,WAAY,GAChB,EACA,GAAI,CACA,SAAU,MACV,WAAY,KACZ,WAAY,GAChB,EACA,GAAI,CACA,SAAU,MACV,WAAY,IACZ,WAAY,GAChB,EACA,GAAI,CACA,SAAU,MACV,WAAY,KACZ,WAAY,GAChB,EACA,KAAM,CACF,SAAU,GACV,WAAY,IACZ,WAAY,GAChB,EACA,OAAQ,CACJ,SAAU,MACV,WAAY,IACZ,WAAY,GAChB,EACA,MAAO,CACH,SAAU,MACV,WAAY,IACZ,WAAY,GAChB,CACJ,EAEaC,EAAS,CAClB,OACA,qGACA,qGACA,qGACA,sGACA,sGACA,uGACA,uGACA,uGACA,uGACA,wGACA,wGACA,wGACA,wGACA,wGACA,wGACA,yGACA,yGACA,yGACA,yGACA,0GACA,0GACA,0GACA,0GACA,yGACJ,EAEA,IAAOC,EAAQ,CACX,KAAM,QACN,IAAK,GACL,OAAAD,EACA,YAAa,CAAC,EACd,OAAQF,EACR,WAAYC,EACZ,WAAY,CAAC,CACjB",
|
|
6
|
+
"names": ["lightColorPallete", "darkColorPallete", "ThemeColors", "ThemeTypography", "shadow", "ThemeDefaultOptions_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var k=Object.create;var p=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var C=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var w=(r,o)=>{for(var t in o)p(r,t,{get:o[t],enumerable:!0})},c=(r,o,t,l)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of x(o))!P.call(r,i)&&i!==t&&p(r,i,{get:()=>o[i],enumerable:!(l=v(o,i))||l.enumerable});return r};var g=(r,o,t)=>(t=r!=null?k(C(r)):{},c(o||!r||!r.__esModule?p(t,"default",{value:r,enumerable:!0}):t,r)),S=r=>c(p({},"__esModule",{value:!0}),r);var z={};w(z,{default:()=>W});module.exports=S(z);var a=g(require("react"),1),h=g(require("../Tag"),1),f=require("../breakpoint"),s=require("./core"),u=g(require("./ThemeCssVars"),1),n=require("../css");const H=({children:r,theme:o,resetCss:t,scrollbarCss:l,isRootProvider:i,renderIsRoot:T,...m})=>{const e=s.ThemeFactory.get(o);if(!e)throw new Error(`Invalid theme name provided: ${o}`);return t??(t=!0),l??(l=!0),a.useMemo(()=>{if(Object.keys(e.globalStyle).length&&(0,n.css)({"@global":e.globalStyle}),(0,n.css)({"@global":{[`.xui-${o}-theme-root`]:(0,u.default)(e)}}),l&&typeof document<"u"){let d=10,b=e.colors.divider,y=e.colors.background.secondary;(0,n.css)({"@global":{"*":{scrollbarWidth:"thin",scrollbarColor:`${b} ${y}`},"::-webkit-scrollbar":{width:d,height:d},"::-webkit-scrollbar-thumb":{backgroundColor:b,borderRadius:"5px",border:"2px solid #f4f4f4"},"::-webkit-scrollbar-thumb:hover":{backgroundColor:b},"::-webkit-scrollbar-track":{backgroundColor:y,borderRadius:"5px"}}})}t&&(0,n.css)({"@global":{"*":{m:0,p:0,outline:"none",boxSizing:"border-box",verticalAlign:"baseline"},"html, body":{minHeight:"100%","-webkit-font-smoothing":"antialiased"},"img, picture, video, canvas, svg":{maxWidth:"100%",display:"block"},"input, button, textarea, select":{font:"inherit"},table:{borderCollapse:"collapse",borderSpacing:0},"ol, ul":{listStyle:"none"},a:{display:"inline-block"},"p, h1, h2, h3, h4, h5, h6":{overflowWrap:"break-word"}}})},[o]),a.createElement(s.ThemeContex.Provider,{value:o},i?a.createElement(f.BreakpointProvider,null,a.createElement(h.default,{minHeight:"100%",bgcolor:e.colors.background.primary,fontFamily:e.typography.fontFamily,fontSize:e.typography.text.fontSize,fontWeight:e.typography.text.fontWeight,lineHeight:e.typography.text.lineHeight,...m,baseClass:`${o}-theme-root`,direction:e.rtl?"rtl":"ltr"},r,T)):a.createElement(h.default,{minHeight:"100%",bgcolor:e.colors.background.primary,fontFamily:e.typography.fontFamily,fontSize:e.typography.text.fontSize,fontWeight:e.typography.text.fontWeight,lineHeight:e.typography.text.lineHeight,...m,baseClass:`${o}-theme-root`,direction:e.rtl?"rtl":"ltr"},r))};var W=H;
|
|
2
|
+
//# sourceMappingURL=ThemeProvider.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/theme/ThemeProvider.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from \"react\"\nimport { ThemeOptions } from \"./types\"\nimport Tag from \"../Tag\"\nimport { TagComponentType, TagProps } from \"../Tag/types\"\nimport { BreakpointProvider } from \"../breakpoint\"\nimport { ThemeContex, ThemeFactory } from \"./core\"\nimport ThemeCssVars from \"./ThemeCssVars\"\nimport { css } from \"../css\"\n\nexport type ThemeProviderProps<T extends TagComponentType = 'div'> = TagProps<T> & {\n theme: string;\n resetCss?: boolean;\n scrollbarCss?: boolean;\n isRootProvider?: boolean;\n renderIsRoot?: React.ReactElement;\n}\n\nconst ThemeProvider = ({ children, theme, resetCss, scrollbarCss, isRootProvider, renderIsRoot, ...props }: ThemeProviderProps) => {\n const THEME = ThemeFactory.get(theme) as ThemeOptions\n if (!THEME) throw new Error(`Invalid theme name provided: ${theme}`)\n resetCss ??= true\n scrollbarCss ??= true\n\n React.useMemo(() => {\n if (!!Object.keys(THEME.globalStyle).length) {\n css({\n \"@global\": THEME.globalStyle\n })\n }\n\n css({\n \"@global\": {\n [`.xui-${theme}-theme-root`]: ThemeCssVars(THEME)\n }\n })\n\n if (scrollbarCss && typeof document !== 'undefined') {\n let thumbSize = 10\n let thumbColor = THEME.colors.divider\n let trackColor = THEME.colors.background.secondary\n css({\n \"@global\": {\n \"*\": {\n scrollbarWidth: \"thin\",\n scrollbarColor: `${thumbColor} ${trackColor}`,\n },\n \"::-webkit-scrollbar\": {\n width: thumbSize,\n height: thumbSize,\n },\n \"::-webkit-scrollbar-thumb\": {\n backgroundColor: thumbColor,\n borderRadius: \"5px\",\n border: \"2px solid #f4f4f4\",\n },\n \"::-webkit-scrollbar-thumb:hover\": {\n backgroundColor: thumbColor,\n },\n \"::-webkit-scrollbar-track\": {\n backgroundColor: trackColor,\n borderRadius: \"5px\",\n },\n }\n })\n }\n\n resetCss && css({\n \"@global\": {\n \"*\": {\n m: 0,\n p: 0,\n outline: \"none\",\n boxSizing: \"border-box\",\n verticalAlign: \"baseline\",\n },\n \"html, body\": {\n minHeight: \"100%\",\n \"-webkit-font-smoothing\": \"antialiased\"\n } as any,\n \"img, picture, video, canvas, svg\": {\n maxWidth: \"100%\",\n display: \"block\"\n },\n \"input, button, textarea, select\": {\n font: \"inherit\"\n },\n \"table\": {\n borderCollapse: \"collapse\",\n borderSpacing: 0\n },\n \"ol, ul\": {\n listStyle: \"none\"\n },\n \"a\": {\n display: \"inline-block\"\n },\n \"p, h1, h2, h3, h4, h5, h6\": {\n overflowWrap: \"break-word\",\n }\n }\n })\n }, [theme])\n\n return (\n <ThemeContex.Provider value={theme}>\n {\n isRootProvider ? <BreakpointProvider>\n <Tag\n minHeight=\"100%\"\n bgcolor={THEME.colors.background.primary}\n fontFamily={THEME.typography.fontFamily}\n fontSize={THEME.typography.text.fontSize}\n fontWeight={THEME.typography.text.fontWeight}\n lineHeight={THEME.typography.text.lineHeight}\n {...props}\n baseClass={`${theme}-theme-root`}\n direction={THEME.rtl ? \"rtl\" : \"ltr\"}\n >\n {children}\n {renderIsRoot}\n </Tag>\n </BreakpointProvider> : <Tag\n minHeight=\"100%\"\n bgcolor={THEME.colors.background.primary}\n fontFamily={THEME.typography.fontFamily}\n fontSize={THEME.typography.text.fontSize}\n fontWeight={THEME.typography.text.fontWeight}\n lineHeight={THEME.typography.text.lineHeight}\n {...props}\n baseClass={`${theme}-theme-root`}\n direction={THEME.rtl ? \"rtl\" : \"ltr\"}\n >\n {children}\n </Tag>\n }\n </ThemeContex.Provider>\n )\n}\n\nexport default ThemeProvider"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAuB,sBAEvBC,EAAgB,uBAEhBC,EAAmC,yBACnCC,EAA0C,kBAC1CC,EAAyB,+BACzBC,EAAoB,kBAUpB,MAAMC,EAAgB,CAAC,CAAE,SAAAC,EAAU,MAAAC,EAAO,SAAAC,EAAU,aAAAC,EAAc,eAAAC,EAAgB,aAAAC,EAAc,GAAGC,CAAM,IAA0B,CAChI,MAAMC,EAAQ,eAAa,IAAIN,CAAK,EACpC,GAAI,CAACM,EAAO,MAAM,IAAI,MAAM,gCAAgCN,CAAK,EAAE,EACnE,OAAAC,MAAa,IACbC,MAAiB,IAEjBV,EAAM,QAAQ,IAAM,CAajB,GAZM,OAAO,KAAKc,EAAM,WAAW,EAAE,WAClC,OAAI,CACD,UAAWA,EAAM,WACpB,CAAC,KAGJ,OAAI,CACD,UAAW,CACR,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,CACH,EAAwBZ,EAAA,cAAC,EAAAmB,QAAA,CACtB,UAAU,OACV,QAASL,EAAM,OAAO,WAAW,QACjC,WAAYA,EAAM,WAAW,WAC7B,SAAUA,EAAM,WAAW,KAAK,SAChC,WAAYA,EAAM,WAAW,KAAK,WAClC,WAAYA,EAAM,WAAW,KAAK,WACjC,GAAGD,EACJ,UAAW,GAAGL,CAAK,cACnB,UAAWM,EAAM,IAAM,MAAQ,OAE9BP,CACJ,CAEN,CAEN,EAEA,IAAOT,EAAQQ",
|
|
6
|
+
"names": ["ThemeProvider_exports", "__export", "ThemeProvider_default", "__toCommonJS", "React", "import_Tag", "import_breakpoint", "import_core", "import_ThemeCssVars", "import_css", "ThemeProvider", "children", "theme", "resetCss", "scrollbarCss", "isRootProvider", "renderIsRoot", "props", "THEME", "ThemeCssVars", "thumbSize", "thumbColor", "trackColor", "Tag"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as r from"react";import g from"../Tag";import{BreakpointProvider as d}from"../breakpoint";import{ThemeContex as y,ThemeFactory as c}from"./core";import f from"./ThemeCssVars";import{css as t}from"../css";const u=({children:l,theme:e,resetCss:a,scrollbarCss:n,isRootProvider:h,renderIsRoot:m,...p})=>{const o=c.get(e);if(!o)throw new Error(`Invalid theme name provided: ${e}`);return a??(a=!0),n??(n=!0),r.useMemo(()=>{if(Object.keys(o.globalStyle).length&&t({"@global":o.globalStyle}),t({"@global":{[`.xui-${e}-theme-root`]:f(o)}}),n&&typeof document<"u"){let s=10,i=o.colors.divider,b=o.colors.background.secondary;t({"@global":{"*":{scrollbarWidth:"thin",scrollbarColor:`${i} ${b}`},"::-webkit-scrollbar":{width:s,height:s},"::-webkit-scrollbar-thumb":{backgroundColor:i,borderRadius:"5px",border:"2px solid #f4f4f4"},"::-webkit-scrollbar-thumb:hover":{backgroundColor:i},"::-webkit-scrollbar-track":{backgroundColor:b,borderRadius:"5px"}}})}a&&t({"@global":{"*":{m:0,p:0,outline:"none",boxSizing:"border-box",verticalAlign:"baseline"},"html, body":{minHeight:"100%","-webkit-font-smoothing":"antialiased"},"img, picture, video, canvas, svg":{maxWidth:"100%",display:"block"},"input, button, textarea, select":{font:"inherit"},table:{borderCollapse:"collapse",borderSpacing:0},"ol, ul":{listStyle:"none"},a:{display:"inline-block"},"p, h1, h2, h3, h4, h5, h6":{overflowWrap:"break-word"}}})},[e]),r.createElement(y.Provider,{value:e},h?r.createElement(d,null,r.createElement(g,{minHeight:"100%",bgcolor:o.colors.background.primary,fontFamily:o.typography.fontFamily,fontSize:o.typography.text.fontSize,fontWeight:o.typography.text.fontWeight,lineHeight:o.typography.text.lineHeight,...p,baseClass:`${e}-theme-root`,direction:o.rtl?"rtl":"ltr"},l,m)):r.createElement(g,{minHeight:"100%",bgcolor:o.colors.background.primary,fontFamily:o.typography.fontFamily,fontSize:o.typography.text.fontSize,fontWeight:o.typography.text.fontWeight,lineHeight:o.typography.text.lineHeight,...p,baseClass:`${e}-theme-root`,direction:o.rtl?"rtl":"ltr"},l))};var z=u;export{z as default};
|
|
2
|
+
//# sourceMappingURL=ThemeProvider.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/theme/ThemeProvider.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from \"react\"\nimport { ThemeOptions } from \"./types\"\nimport Tag from \"../Tag\"\nimport { TagComponentType, TagProps } from \"../Tag/types\"\nimport { BreakpointProvider } from \"../breakpoint\"\nimport { ThemeContex, ThemeFactory } from \"./core\"\nimport ThemeCssVars from \"./ThemeCssVars\"\nimport { css } from \"../css\"\n\nexport type ThemeProviderProps<T extends TagComponentType = 'div'> = TagProps<T> & {\n theme: string;\n resetCss?: boolean;\n scrollbarCss?: boolean;\n isRootProvider?: boolean;\n renderIsRoot?: React.ReactElement;\n}\n\nconst ThemeProvider = ({ children, theme, resetCss, scrollbarCss, isRootProvider, renderIsRoot, ...props }: ThemeProviderProps) => {\n const THEME = ThemeFactory.get(theme) as ThemeOptions\n if (!THEME) throw new Error(`Invalid theme name provided: ${theme}`)\n resetCss ??= true\n scrollbarCss ??= true\n\n React.useMemo(() => {\n if (!!Object.keys(THEME.globalStyle).length) {\n css({\n \"@global\": THEME.globalStyle\n })\n }\n\n css({\n \"@global\": {\n [`.xui-${theme}-theme-root`]: ThemeCssVars(THEME)\n }\n })\n\n if (scrollbarCss && typeof document !== 'undefined') {\n let thumbSize = 10\n let thumbColor = THEME.colors.divider\n let trackColor = THEME.colors.background.secondary\n css({\n \"@global\": {\n \"*\": {\n scrollbarWidth: \"thin\",\n scrollbarColor: `${thumbColor} ${trackColor}`,\n },\n \"::-webkit-scrollbar\": {\n width: thumbSize,\n height: thumbSize,\n },\n \"::-webkit-scrollbar-thumb\": {\n backgroundColor: thumbColor,\n borderRadius: \"5px\",\n border: \"2px solid #f4f4f4\",\n },\n \"::-webkit-scrollbar-thumb:hover\": {\n backgroundColor: thumbColor,\n },\n \"::-webkit-scrollbar-track\": {\n backgroundColor: trackColor,\n borderRadius: \"5px\",\n },\n }\n })\n }\n\n resetCss && css({\n \"@global\": {\n \"*\": {\n m: 0,\n p: 0,\n outline: \"none\",\n boxSizing: \"border-box\",\n verticalAlign: \"baseline\",\n },\n \"html, body\": {\n minHeight: \"100%\",\n \"-webkit-font-smoothing\": \"antialiased\"\n } as any,\n \"img, picture, video, canvas, svg\": {\n maxWidth: \"100%\",\n display: \"block\"\n },\n \"input, button, textarea, select\": {\n font: \"inherit\"\n },\n \"table\": {\n borderCollapse: \"collapse\",\n borderSpacing: 0\n },\n \"ol, ul\": {\n listStyle: \"none\"\n },\n \"a\": {\n display: \"inline-block\"\n },\n \"p, h1, h2, h3, h4, h5, h6\": {\n overflowWrap: \"break-word\",\n }\n }\n })\n }, [theme])\n\n return (\n <ThemeContex.Provider value={theme}>\n {\n isRootProvider ? <BreakpointProvider>\n <Tag\n minHeight=\"100%\"\n bgcolor={THEME.colors.background.primary}\n fontFamily={THEME.typography.fontFamily}\n fontSize={THEME.typography.text.fontSize}\n fontWeight={THEME.typography.text.fontWeight}\n lineHeight={THEME.typography.text.lineHeight}\n {...props}\n baseClass={`${theme}-theme-root`}\n direction={THEME.rtl ? \"rtl\" : \"ltr\"}\n >\n {children}\n {renderIsRoot}\n </Tag>\n </BreakpointProvider> : <Tag\n minHeight=\"100%\"\n bgcolor={THEME.colors.background.primary}\n fontFamily={THEME.typography.fontFamily}\n fontSize={THEME.typography.text.fontSize}\n fontWeight={THEME.typography.text.fontWeight}\n lineHeight={THEME.typography.text.lineHeight}\n {...props}\n baseClass={`${theme}-theme-root`}\n direction={THEME.rtl ? \"rtl\" : \"ltr\"}\n >\n {children}\n </Tag>\n }\n </ThemeContex.Provider>\n )\n}\n\nexport default ThemeProvider"],
|
|
5
|
+
"mappings": "AAAA,UAAYA,MAAW,QAEvB,OAAOC,MAAS,SAEhB,OAAS,sBAAAC,MAA0B,gBACnC,OAAS,eAAAC,EAAa,gBAAAC,MAAoB,SAC1C,OAAOC,MAAkB,iBACzB,OAAS,OAAAC,MAAW,SAUpB,MAAMC,EAAgB,CAAC,CAAE,SAAAC,EAAU,MAAAC,EAAO,SAAAC,EAAU,aAAAC,EAAc,eAAAC,EAAgB,aAAAC,EAAc,GAAGC,CAAM,IAA0B,CAChI,MAAMC,EAAQX,EAAa,IAAIK,CAAK,EACpC,GAAI,CAACM,EAAO,MAAM,IAAI,MAAM,gCAAgCN,CAAK,EAAE,EACnE,OAAAC,MAAa,IACbC,MAAiB,IAEjBX,EAAM,QAAQ,IAAM,CAajB,GAZM,OAAO,KAAKe,EAAM,WAAW,EAAE,QAClCT,EAAI,CACD,UAAWS,EAAM,WACpB,CAAC,EAGJT,EAAI,CACD,UAAW,CACR,CAAC,QAAQG,CAAK,aAAa,EAAGJ,EAAaU,CAAK,CACnD,CACH,CAAC,EAEGJ,GAAgB,OAAO,SAAa,IAAa,CAClD,IAAIK,EAAY,GACZC,EAAaF,EAAM,O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,EAAM,WAAW,KAAK,WAClC,WAAYA,EAAM,WAAW,KAAK,WACjC,GAAGD,EACJ,UAAW,GAAGL,CAAK,cACnB,UAAWM,EAAM,IAAM,MAAQ,OAE9BP,CACJ,CAEN,CAEN,EAEA,IAAOW,EAAQZ",
|
|
6
|
+
"names": ["React", "Tag", "BreakpointProvider", "ThemeContex", "ThemeFactory", "ThemeCssVars", "css", "ThemeProvider", "children", "theme", "resetCss", "scrollbarCss", "isRootProvider", "renderIsRoot", "props", "THEME", "thumbSize", "thumbColor", "trackColor", "ThemeProvider_default"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";var T=Object.create;var s=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var a=(e,t)=>{for(var o in t)s(e,o,{get:t[o],enumerable:!0})},i=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of x(t))!O.call(e,r)&&r!==o&&s(e,r,{get:()=>t[r],enumerable:!(n=h(t,r))||n.enumerable});return e};var f=(e,t,o)=>(o=e!=null?T(g(e)):{},i(t||!e||!e.__esModule?s(o,"default",{value:e,enumerable:!0}):o,e)),j=e=>i(s({},"__esModule",{value:!0}),e);var C={};a(C,{ThemeContex:()=>m,ThemeFactory:()=>p,getTheme:()=>l,mergeObject:()=>y,useTheme:()=>u});module.exports=j(C);var c=f(require("react"),1);const p=new Map,m=c.default.createContext("light"),l=e=>p.get(e),u=()=>p.get(c.default.useContext(m)),y=(e,t)=>{e={...e},t={...t};for(const o in t){const n=t[o];typeof n=="object"&&!Array.isArray(n)&&!c.default.isValidElement(n)?e[o]=y(e[o],t[o]):e[o]=n}return e};
|
|
2
|
-
//# sourceMappingURL=core.
|
|
2
|
+
//# sourceMappingURL=core.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/theme/core.ts"],
|
|
4
|
+
"sourcesContent": ["import React from \"react\"\nimport { ObjectType, ThemeOptions } from \"./types\"\n\nexport const ThemeFactory = new Map<string, ThemeOptions>()\nexport const ThemeContex = React.createContext(\"light\")\nexport const getTheme = (theme: string) => ThemeFactory.get(theme)\nexport const useTheme = (): ThemeOptions => ThemeFactory.get(React.useContext(ThemeContex)) as any\n\nexport const mergeObject = (a: ObjectType, b: ObjectType) => {\n a = { ...a }\n b = { ...b }\n for (const key in b) {\n const v = (b as any)[key]\n if (typeof v === 'object' && !Array.isArray(v) && !React.isValidElement(v)) {\n a[key] = mergeObject(a[key], b[key])\n } else {\n a[key] = v\n }\n }\n return a\n}\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,EAAA,iBAAAC,EAAA,aAAAC,EAAA,gBAAAC,EAAA,aAAAC,IAAA,eAAAC,EAAAP,GAAA,IAAAQ,EAAkB,sBAGX,MAAML,EAAe,IAAI,IACnBD,EAAc,EAAAO,QAAM,cAAc,OAAO,EACzCL,EAAYM,GAAkBP,EAAa,IAAIO,CAAK,EACpDJ,EAAW,IAAoBH,EAAa,IAAI,EAAAM,QAAM,WAAWP,CAAW,CAAC,EAE7EG,EAAc,CAACM,EAAeC,IAAkB,CAC1DD,EAAI,CAAE,GAAGA,CAAE,EACXC,EAAI,CAAE,GAAGA,CAAE,EACX,UAAWC,KAAOD,EAAG,CAClB,MAAME,EAAKF,EAAUC,CAAG,EACpB,OAAOC,GAAM,UAAY,CAAC,MAAM,QAAQA,CAAC,GAAK,CAAC,EAAAL,QAAM,eAAeK,CAAC,EACtEH,EAAEE,CAAG,EAAIR,EAAYM,EAAEE,CAAG,EAAGD,EAAEC,CAAG,CAAC,EAEnCF,EAAEE,CAAG,EAAIC,CAEf,CACA,OAAOH,CACV",
|
|
6
|
+
"names": ["core_exports", "__export", "ThemeContex", "ThemeFactory", "getTheme", "mergeObject", "useTheme", "__toCommonJS", "import_react", "React", "theme", "a", "b", "key", "v"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import r from"react";const s=new Map,c=r.createContext("light"),h=e=>s.get(e),x=()=>s.get(r.useContext(c)),p=(e,t)=>{e={...e},t={...t};for(const o in t){const n=t[o];typeof n=="object"&&!Array.isArray(n)&&!r.isValidElement(n)?e[o]=p(e[o],t[o]):e[o]=n}return e};export{c as ThemeContex,s as ThemeFactory,h as getTheme,p as mergeObject,x as useTheme};
|
|
2
|
-
//# sourceMappingURL=core.
|
|
2
|
+
//# sourceMappingURL=core.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/theme/core.ts"],
|
|
4
|
+
"sourcesContent": ["import React from \"react\"\nimport { ObjectType, ThemeOptions } from \"./types\"\n\nexport const ThemeFactory = new Map<string, ThemeOptions>()\nexport const ThemeContex = React.createContext(\"light\")\nexport const getTheme = (theme: string) => ThemeFactory.get(theme)\nexport const useTheme = (): ThemeOptions => ThemeFactory.get(React.useContext(ThemeContex)) as any\n\nexport const mergeObject = (a: ObjectType, b: ObjectType) => {\n a = { ...a }\n b = { ...b }\n for (const key in b) {\n const v = (b as any)[key]\n if (typeof v === 'object' && !Array.isArray(v) && !React.isValidElement(v)) {\n a[key] = mergeObject(a[key], b[key])\n } else {\n a[key] = v\n }\n }\n return a\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAOA,MAAW,QAGX,MAAMC,EAAe,IAAI,IACnBC,EAAcF,EAAM,cAAc,OAAO,EACzCG,EAAYC,GAAkBH,EAAa,IAAIG,CAAK,EACpDC,EAAW,IAAoBJ,EAAa,IAAID,EAAM,WAAWE,CAAW,CAAC,EAE7EI,EAAc,CAACC,EAAeC,IAAkB,CAC1DD,EAAI,CAAE,GAAGA,CAAE,EACXC,EAAI,CAAE,GAAGA,CAAE,EACX,UAAWC,KAAOD,EAAG,CAClB,MAAME,EAAKF,EAAUC,CAAG,EACpB,OAAOC,GAAM,UAAY,CAAC,MAAM,QAAQA,CAAC,GAAK,CAACV,EAAM,eAAeU,CAAC,EACtEH,EAAEE,CAAG,EAAIH,EAAYC,EAAEE,CAAG,EAAGD,EAAEC,CAAG,CAAC,EAEnCF,EAAEE,CAAG,EAAIC,CAEf,CACA,OAAOH,CACV",
|
|
6
|
+
"names": ["React", "ThemeFactory", "ThemeContex", "getTheme", "theme", "useTheme", "mergeObject", "a", "b", "key", "v"]
|
|
7
|
+
}
|