@xanui/core 1.2.9 → 1.2.11
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/css/getProps.js +1 -1
- package/css/getProps.js.map +1 -1
- package/css/getProps.mjs +1 -1
- package/css/getProps.mjs.map +1 -1
- package/hooks/useColorTemplate.js +2 -2
- package/hooks/useColorTemplate.js.map +1 -1
- package/hooks/useColorTemplate.mjs +2 -2
- package/hooks/useColorTemplate.mjs.map +1 -1
- package/package.json +1 -1
- package/theme/createTheme.js.map +1 -1
- package/theme/createTheme.mjs.map +1 -1
package/css/getProps.js
CHANGED
package/css/getProps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getProps.js","sources":["../../src/css/getProps.ts"],"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 let c: any = {\n pointerEvents: \"none!important\",\n cursor: \"default!important\",\n userSelect: \"none!important\",\n opacity: \"0.5!important\",\n color: `text.primary!important`,\n borderColor: `divider.secondary!important`,\n }\n\n
|
|
1
|
+
{"version":3,"file":"getProps.js","sources":["../../src/css/getProps.ts"],"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 let c: any = {\n pointerEvents: \"none!important\",\n cursor: \"default!important\",\n userSelect: \"none!important\",\n opacity: \"0.5!important\",\n color: `text.primary!important`,\n borderColor: `divider.secondary!important`,\n }\n\n if ((_css as any).bgcolor && (_css as any).bgcolor !== 'transparent') {\n c.bgcolor = `divider.primary!important`\n }\n return c\n }\n return {}\n }\n\n\n if (prop === \"spacing\" && typeof value === \"number\") {\n const val = value * 8;\n const isFlex =\n (_css as any)?.flexBox ||\n (_css as any)?.flexRow ||\n (_css as any)?.flexColumn ||\n (_css as any)?.display === \"flex\";\n\n if (isFlex) {\n const isColumn = (_css as any)?.flexColumn === true;\n\n return {\n ...(isColumn\n ? { marginTop: `-${val}px${important || \"\"}` }\n : { marginLeft: `-${val}px${important || \"\"}` }),\n\n \"& > *\": isColumn\n ? { marginTop: `${val}px${important || \"\"}` }\n : { marginLeft: `${val}px${important || \"\"}` },\n } as any;\n }\n\n // non-flex fallback (safe & predictable)\n return {\n \"& > * + *\": {\n marginTop: `${val}px${important || \"\"}`,\n },\n } as any;\n }\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.primary\"\n }\n if (!keys.includes(`${prop}Style`)) {\n p[`${prop}Style`] = \"solid\"\n }\n return p\n }\n}\n\nexport default getProps"],"names":[],"mappings":"sEAEA,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,KAAa,EAAE,IAAc,KAAI;AAC7D,IAAA,IAAI,SAAS;AACb,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC3B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;AAC9B,QAAA,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,YAAY,GAAG,EAAE;AACxC,QAAA,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC;IACpB;AAEA,IAAA,IAAI,IAAI,KAAK,UAAU,EAAE;AACrB,QAAA,IAAK,KAAa,KAAK,IAAI,EAAE;AACzB,YAAA,IAAI,CAAC,GAAQ;AACT,gBAAA,aAAa,EAAE,gBAAgB;AAC/B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49
49
|
[`${prop}Width`]: value + 'px' + (important || ""),
|
|
50
50
|
};
|
|
51
51
|
if (!keys.includes(`${prop}Color`)) {
|
|
52
|
-
p[`${prop}Color`] = "
|
|
52
|
+
p[`${prop}Color`] = "divider.primary";
|
|
53
53
|
}
|
|
54
54
|
if (!keys.includes(`${prop}Style`)) {
|
|
55
55
|
p[`${prop}Style`] = "solid";
|
package/css/getProps.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getProps.mjs","sources":["../../src/css/getProps.ts"],"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 let c: any = {\n pointerEvents: \"none!important\",\n cursor: \"default!important\",\n userSelect: \"none!important\",\n opacity: \"0.5!important\",\n color: `text.primary!important`,\n borderColor: `divider.secondary!important`,\n }\n\n
|
|
1
|
+
{"version":3,"file":"getProps.mjs","sources":["../../src/css/getProps.ts"],"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 let c: any = {\n pointerEvents: \"none!important\",\n cursor: \"default!important\",\n userSelect: \"none!important\",\n opacity: \"0.5!important\",\n color: `text.primary!important`,\n borderColor: `divider.secondary!important`,\n }\n\n if ((_css as any).bgcolor && (_css as any).bgcolor !== 'transparent') {\n c.bgcolor = `divider.primary!important`\n }\n return c\n }\n return {}\n }\n\n\n if (prop === \"spacing\" && typeof value === \"number\") {\n const val = value * 8;\n const isFlex =\n (_css as any)?.flexBox ||\n (_css as any)?.flexRow ||\n (_css as any)?.flexColumn ||\n (_css as any)?.display === \"flex\";\n\n if (isFlex) {\n const isColumn = (_css as any)?.flexColumn === true;\n\n return {\n ...(isColumn\n ? { marginTop: `-${val}px${important || \"\"}` }\n : { marginLeft: `-${val}px${important || \"\"}` }),\n\n \"& > *\": isColumn\n ? { marginTop: `${val}px${important || \"\"}` }\n : { marginLeft: `${val}px${important || \"\"}` },\n } as any;\n }\n\n // non-flex fallback (safe & predictable)\n return {\n \"& > * + *\": {\n marginTop: `${val}px${important || \"\"}`,\n },\n } as any;\n }\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.primary\"\n }\n if (!keys.includes(`${prop}Style`)) {\n p[`${prop}Style`] = \"solid\"\n }\n return p\n }\n}\n\nexport default getProps"],"names":[],"mappings":"AAEA,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,KAAa,EAAE,IAAc,KAAI;AAC7D,IAAA,IAAI,SAAS;AACb,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC3B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;AAC9B,QAAA,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,YAAY,GAAG,EAAE;AACxC,QAAA,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC;IACpB;AAEA,IAAA,IAAI,IAAI,KAAK,UAAU,EAAE;AACrB,QAAA,IAAK,KAAa,KAAK,IAAI,EAAE;AACzB,YAAA,IAAI,CAAC,GAAQ;AACT,gBAAA,aAAa,EAAE,gBAAgB;AAC/B,gBAAA,MAAM,EAAE,mBAAmB;AAC3B,gBAAA,UAAU,EAAE,gBAAgB;AAC5B,gBAAA,OAAO,EAAE,eAAe;AACxB,gBAAA,KAAK,EAAE,CAAA,sBAAA,CAAwB;AAC/B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AAK,SAAS,IAAI,EAAE,CAAA,CAAE;AAC3C,sBAAE,EAAE,UAAU,EAAE,CAAA,EAAG,GAAG,CAAA,EAAA,EAAK,SAAS,IAAI,EAAE,CAAA,CAAE,EAAE,GAC9C;QACZ;;QAGA,OAAO;AACH,YAAA,WAAW,EAAE;AACT,gBAAA,SAAS,EAAE,CAAA,EAAG,GAAG,KAAK,SAAS,IAAI,EAAE,CAAA,CAAE;AAC1C,aAAA;SACG;IACZ;IAGA,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC,QAAQ,CAAC,IAAW,CAAC,EAAE;QAClI,MAAM,IAAI,GAAQ,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;AACnC,QAAA,IAAI,CAAC,GAAQ;AACT,YAAA,CAAC,CAAA,EAAG,IAAI,CAAA,KAAA,CAAO,GAAG,KAAK,GAAG,IAAI,IAAI,SAAS,IAAI,EAAE,CAAC;SACrD;QACD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAA,KAAA,CAAO,CAAC,EAAE;AAChC,YAAA,CAAC,CAAC,CAAA,EAAG,IAAI,OAAO,CAAC,GAAG,iBAAiB;QACzC;QACA,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAA,KAAA,CAAO,CAAC,EAAE;AAChC,YAAA,CAAC,CAAC,CAAA,EAAG,IAAI,OAAO,CAAC,GAAG,OAAO;QAC/B;AACA,QAAA,OAAO,CAAC;IACZ;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useColorTemplate.js","sources":["../../src/hooks/useColorTemplate.ts"],"sourcesContent":["export type UseColorTemplateType = \"fill\" | \"outline\" | \"text\" | \"soft\"\nexport type UseColorTemplateColor = \"default\" | \"brand\" | \"accent\" | \"success\" | \"info\" | \"warning\" | \"danger\"\n\nconst useColorTemplate = (color: UseColorTemplateColor, type: UseColorTemplateType) => {\n const is_def = color === \"default\";\n if (is_def) {\n color = \"divider\" as any\n }\n\n if (type === \"outline\") {\n return {\n primary: {\n bgcolor: `transparent`,\n color: is_def ? `text.primary` : `${color}.primary`,\n border: 1,\n borderColor: is_def ? `divider` : `${color}.primary`,\n },\n secondary: {\n bgcolor: `transparent`,\n color: is_def ? `text.primary` : `${color}.secondary`,\n border: 1,\n borderColor: is_def ? `divider.secondary` : `${color}.secondary`,\n }\n }\n } else if (type === \"fill\") {\n return {\n primary: {\n bgcolor: color,\n color: is_def ? `text.primary` : `${color}.text`,\n border: 1,\n borderColor: is_def ? `divider.secondary` : `${color}.secondary`,\n },\n secondary: {\n bgcolor: `${color}.secondary`,\n color: is_def ? `text.primary` : `${color}.text`,\n border:
|
|
1
|
+
{"version":3,"file":"useColorTemplate.js","sources":["../../src/hooks/useColorTemplate.ts"],"sourcesContent":["export type UseColorTemplateType = \"fill\" | \"outline\" | \"text\" | \"soft\"\nexport type UseColorTemplateColor = \"default\" | \"brand\" | \"accent\" | \"success\" | \"info\" | \"warning\" | \"danger\"\n\nconst useColorTemplate = (color: UseColorTemplateColor, type: UseColorTemplateType) => {\n const is_def = color === \"default\";\n if (is_def) {\n color = \"divider\" as any\n }\n\n if (type === \"outline\") {\n return {\n primary: {\n bgcolor: `transparent`,\n color: is_def ? `text.primary` : `${color}.primary`,\n border: 1,\n borderColor: is_def ? `divider` : `${color}.primary`,\n },\n secondary: {\n bgcolor: `transparent`,\n color: is_def ? `text.primary` : `${color}.secondary`,\n border: 1,\n borderColor: is_def ? `divider.secondary` : `${color}.secondary`,\n }\n }\n } else if (type === \"fill\") {\n return {\n primary: {\n bgcolor: color,\n color: is_def ? `text.primary` : `${color}.text`,\n border: 1,\n borderColor: is_def ? `divider.secondary` : `${color}.secondary`,\n },\n secondary: {\n bgcolor: `${color}.secondary`,\n color: is_def ? `text.primary` : `${color}.text`,\n border: 1,\n borderColor: is_def ? `divider.secondary` : `${color}.secondary`,\n }\n }\n } else if (type === \"text\") {\n return {\n primary: {\n bgcolor: \"transparent\",\n color: is_def ? `text.primary` : `${color}.primary`,\n border: 0,\n borderColor: `transparent`,\n },\n secondary: {\n bgcolor: \"transparent\",\n color: is_def ? `text.primary` : `${color}.secondary`,\n border: 0,\n borderColor: `transparent`,\n }\n }\n } else if (type === \"soft\") {\n return {\n primary: {\n bgcolor: `${color}.soft.primary`,\n color: is_def ? `text.primary` : color,\n border: 0,\n borderColor: `transparent`,\n },\n secondary: {\n bgcolor: `${color}.soft.secondary`,\n color: is_def ? `text.primary` : `${color}.secondary`,\n border: 0,\n borderColor: `transparent`,\n }\n }\n }\n\n throw new Error(`useColorTemplate: Unknown type ${type}`);\n}\n\nexport default useColorTemplate"],"names":[],"mappings":"sEAGA,MAAM,gBAAgB,GAAG,CAAC,KAA4B,EAAE,IAA0B,KAAI;AAClF,IAAA,MAAM,MAAM,GAAG,KAAK,KAAK,SAAS;IAClC,IAAI,MAAM,EAAE;QACR,KAAK,GAAG,SAAgB;IAC5B;AAEA,IAAA,IAAI,IAAI,KAAK,SAAS,EAAE;QACpB,OAAO;AACH,YAAA,OAAO,EAAE;AACL,gBAAA,OAAO,EAAE,CAAA,WAAA,CAAa;gBACtB,KAAK,EAAE,MAAM,GAAG,CAAA,YAAA,CAAc,GAAG,CAAA,EAAG,KAAK,CAAA,QAAA,CAAU;AACnD,gBAAA,MAAM,EAAE,CAAC;gBACT,WAAW,EAAE,MAAM,GAAG,CAAA,OAAA,CAAS,GAAG,CAAA,EAAG,KAAK,CAAA,QAAA,CAAU;AACvD,aAAA;AACD,YAAA,SAAS,EAAE;AACP,gBAAA,OAAO,EAAE,CAAA,WAAA,CAAa;gBACtB,KAAK,EAAE,MAAM,GAAG,CAAA,YAAA,CAAc,GAAG,CAAA,EAAG,KAAK,CAAA,UAAA,CAAY;AACrD,gBAAA,MAAM,EAAE,CAAC;gBACT,WAAW,EAAE,MAAM,GAAG,CAAA,iBA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L;AAAO,SAAA,IAAI,IAAI,KAAK,MAAM,EAAE;QACxB,OAAO;AACH,YAAA,OAAO,EAAE;gBACL,OAAO,EAAE,CAAA,EAAG,KAAK,CAAA,aAAA,CAAe;gBAChC,KAAK,EAAE,MAAM,GAAG,CAAA,YAAA,CAAc,GAAG,KAAK;AACtC,gBAAA,MAAM,EAAE,CAAC;AACT,gBAAA,WAAW,EAAE,CAAA,WAAA,CAAa;AAC7B,aAAA;AACD,YAAA,SAAS,EAAE;gBACP,OAAO,EAAE,CAAA,EAAG,KAAK,CAAA,eAAA,CAAiB;gBAClC,KAAK,EAAE,MAAM,GAAG,CAAA,YAAA,CAAc,GAAG,CAAA,EAAG,KAAK,CAAA,UAAA,CAAY;AACrD,gBAAA,MAAM,EAAE,CAAC;AACT,gBAAA,WAAW,EAAE,CAAA,WAAA,CAAa;AAC7B;SACJ;IACL;AAEA,IAAA,MAAM,IAAI,KAAK,CAAC,kCAAkC,IAAI,CAAA,CAAE,CAAC;AAC7D"}
|
|
@@ -30,8 +30,8 @@ const useColorTemplate = (color, type) => {
|
|
|
30
30
|
secondary: {
|
|
31
31
|
bgcolor: `${color}.secondary`,
|
|
32
32
|
color: is_def ? `text.primary` : `${color}.text`,
|
|
33
|
-
border:
|
|
34
|
-
borderColor: `
|
|
33
|
+
border: 1,
|
|
34
|
+
borderColor: is_def ? `divider.secondary` : `${color}.secondary`,
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useColorTemplate.mjs","sources":["../../src/hooks/useColorTemplate.ts"],"sourcesContent":["export type UseColorTemplateType = \"fill\" | \"outline\" | \"text\" | \"soft\"\nexport type UseColorTemplateColor = \"default\" | \"brand\" | \"accent\" | \"success\" | \"info\" | \"warning\" | \"danger\"\n\nconst useColorTemplate = (color: UseColorTemplateColor, type: UseColorTemplateType) => {\n const is_def = color === \"default\";\n if (is_def) {\n color = \"divider\" as any\n }\n\n if (type === \"outline\") {\n return {\n primary: {\n bgcolor: `transparent`,\n color: is_def ? `text.primary` : `${color}.primary`,\n border: 1,\n borderColor: is_def ? `divider` : `${color}.primary`,\n },\n secondary: {\n bgcolor: `transparent`,\n color: is_def ? `text.primary` : `${color}.secondary`,\n border: 1,\n borderColor: is_def ? `divider.secondary` : `${color}.secondary`,\n }\n }\n } else if (type === \"fill\") {\n return {\n primary: {\n bgcolor: color,\n color: is_def ? `text.primary` : `${color}.text`,\n border: 1,\n borderColor: is_def ? `divider.secondary` : `${color}.secondary`,\n },\n secondary: {\n bgcolor: `${color}.secondary`,\n color: is_def ? `text.primary` : `${color}.text`,\n border:
|
|
1
|
+
{"version":3,"file":"useColorTemplate.mjs","sources":["../../src/hooks/useColorTemplate.ts"],"sourcesContent":["export type UseColorTemplateType = \"fill\" | \"outline\" | \"text\" | \"soft\"\nexport type UseColorTemplateColor = \"default\" | \"brand\" | \"accent\" | \"success\" | \"info\" | \"warning\" | \"danger\"\n\nconst useColorTemplate = (color: UseColorTemplateColor, type: UseColorTemplateType) => {\n const is_def = color === \"default\";\n if (is_def) {\n color = \"divider\" as any\n }\n\n if (type === \"outline\") {\n return {\n primary: {\n bgcolor: `transparent`,\n color: is_def ? `text.primary` : `${color}.primary`,\n border: 1,\n borderColor: is_def ? `divider` : `${color}.primary`,\n },\n secondary: {\n bgcolor: `transparent`,\n color: is_def ? `text.primary` : `${color}.secondary`,\n border: 1,\n borderColor: is_def ? `divider.secondary` : `${color}.secondary`,\n }\n }\n } else if (type === \"fill\") {\n return {\n primary: {\n bgcolor: color,\n color: is_def ? `text.primary` : `${color}.text`,\n border: 1,\n borderColor: is_def ? `divider.secondary` : `${color}.secondary`,\n },\n secondary: {\n bgcolor: `${color}.secondary`,\n color: is_def ? `text.primary` : `${color}.text`,\n border: 1,\n borderColor: is_def ? `divider.secondary` : `${color}.secondary`,\n }\n }\n } else if (type === \"text\") {\n return {\n primary: {\n bgcolor: \"transparent\",\n color: is_def ? `text.primary` : `${color}.primary`,\n border: 0,\n borderColor: `transparent`,\n },\n secondary: {\n bgcolor: \"transparent\",\n color: is_def ? `text.primary` : `${color}.secondary`,\n border: 0,\n borderColor: `transparent`,\n }\n }\n } else if (type === \"soft\") {\n return {\n primary: {\n bgcolor: `${color}.soft.primary`,\n color: is_def ? `text.primary` : color,\n border: 0,\n borderColor: `transparent`,\n },\n secondary: {\n bgcolor: `${color}.soft.secondary`,\n color: is_def ? `text.primary` : `${color}.secondary`,\n border: 0,\n borderColor: `transparent`,\n }\n }\n }\n\n throw new Error(`useColorTemplate: Unknown type ${type}`);\n}\n\nexport default useColorTemplate"],"names":[],"mappings":"AAGA,MAAM,gBAAgB,GAAG,CAAC,KAA4B,EAAE,IAA0B,KAAI;AAClF,IAAA,MAAM,MAAM,GAAG,KAAK,KAAK,SAAS;IAClC,IAAI,MAAM,EAAE;QACR,KAAK,GAAG,SAAgB;IAC5B;AAEA,IAAA,IAAI,IAAI,KAAK,SAAS,EAAE;QACpB,OAAO;AACH,YAAA,OAAO,EAAE;AACL,gBAAA,OAAO,EAAE,CAAA,WAAA,CAAa;gBACtB,KAAK,EAAE,MAAM,GAAG,CAAA,YAAA,CAAc,GAAG,CAAA,EAAG,KAAK,CAAA,QAAA,CAAU;AACnD,gBAAA,MAAM,EAAE,CAAC;gBACT,WAAW,EAAE,MAAM,GAAG,CAAA,OAAA,CAAS,GAAG,CAAA,EAAG,KAAK,CAAA,QAAA,CAAU;AACvD,aAAA;AACD,YAAA,SAAS,EAAE;AACP,gBAAA,OAAO,EAAE,CAAA,WAAA,CAAa;gBACtB,KAAK,EAAE,MAAM,GAAG,CAAA,YAAA,CAAc,GAAG,CAAA,EAAG,KAAK,CAAA,UAAA,CAAY;AACrD,gBAAA,MAAM,EAAE,CAAC;gBACT,WAAW,EAAE,MAAM,GAAG,CAAA,iBAAA,CAAmB,GAAG,CAAA,EAAG,KAAK,CAAA,UAAA,CAAY;AACnE;SACJ;IACL;AAAO,SAAA,IAAI,IAAI,KAAK,M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A,EAAG,KAAK,CAAA,aAAA,CAAe;gBAChC,KAAK,EAAE,MAAM,GAAG,CAAA,YAAA,CAAc,GAAG,KAAK;AACtC,gBAAA,MAAM,EAAE,CAAC;AACT,gBAAA,WAAW,EAAE,CAAA,WAAA,CAAa;AAC7B,aAAA;AACD,YAAA,SAAS,EAAE;gBACP,OAAO,EAAE,CAAA,EAAG,KAAK,CAAA,eAAA,CAAiB;gBAClC,KAAK,EAAE,MAAM,GAAG,CAAA,YAAA,CAAc,GAAG,CAAA,EAAG,KAAK,CAAA,UAAA,CAAY;AACrD,gBAAA,MAAM,EAAE,CAAC;AACT,gBAAA,WAAW,EAAE,CAAA,WAAA,CAAa;AAC7B;SACJ;IACL;AAEA,IAAA,MAAM,IAAI,KAAK,CAAC,kCAAkC,IAAI,CAAA,CAAE,CAAC;AAC7D"}
|
package/package.json
CHANGED
package/theme/createTheme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTheme.js","sources":["../../src/theme/createTheme.ts"],"sourcesContent":["import { ThemeOptions, ThemeOptionInput, ThemeOptionsColor } from \"./types\"\nimport { mergeObject, ThemeFactory } from \"./core\"\nimport { alpha, breakpoints } from \"../css\"\nimport { lightThemeOptions } from \"./ThemeDefaultOptions\"\
|
|
1
|
+
{"version":3,"file":"createTheme.js","sources":["../../src/theme/createTheme.ts"],"sourcesContent":["import { ThemeOptions, ThemeOptionInput, ThemeOptionsColor } from \"./types\"\nimport { mergeObject, ThemeFactory } from \"./core\"\nimport { alpha, breakpoints } from \"../css\"\nimport { lightThemeOptions } from \"./ThemeDefaultOptions\"\n\nexport const createTheme = (name: string, options: ThemeOptionInput): ThemeOptions => {\n if (ThemeFactory.has(name)) {\n console.error(`createTheme: The theme '${name}' is already defined. Please choose a different name for the theme.`)\n return ThemeFactory.get(name) as ThemeOptions\n }\n\n let theme: any = mergeObject(lightThemeOptions, {\n ...options,\n name,\n breakpoints: breakpoints\n })\n\n // add alpha colors\n for (let color in theme.colors) {\n const c = theme.colors[color] as ThemeOptionsColor\n const is_common = color === 'divider' || color === 'background' || color === 'text'\n c.soft = {\n primary: is_common ? alpha(c.primary, 0.60) : alpha(c.primary, 0.08),\n secondary: is_common ? alpha(c.primary, 0.90) : alpha(c.primary, 0.12)\n }\n }\n\n ThemeFactory.set(name, theme)\n\n return theme as ThemeOptions\n}\n"],"names":["ThemeFactory","mergeObject","lightThemeOptions","breakpoints","alpha"],"mappings":"mMAKa,WAAW,GAAG,CAAC,IAAY,EAAE,OAAyB,KAAkB;AAClF,IAAA,IAAIA,iBAAY,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;AACzB,QAAA,OAAO,CAAC,KAAK,CAAC,2BAA2B,IAAI,CAAA,mEAAA,CAAqE,CAAC;AACnH,QAAA,OAAOA,iBAAY,CAAC,GAAG,CAAC,IAAI,CAAiB;IAChD;AAEA,IAAA,IAAI,KAAK,GAAQC,gBAAW,CAACC,qCAAiB,EAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACxC,OAAO,CAAA,EAAA,EACV,IAAI,EACJ,WAAW,EAAEC,iBAAW,IACzB;;AAGF,IAAA,KAAK,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE;QAC7B,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAsB;AAClD,QAAA,MAAM,SAAS,GAAG,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,YAAY,IAAI,KAAK,KAAK,MAAM;QACnF,CAAC,CAAC,IAAI,GAAG;YACN,OAAO,EAAE,SAAS,GAAGC,WAAK,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,GAAGA,WAAK,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC;YACpE,SAAS,EAAE,SAAS,GAAGA,WAAK,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,GAAGA,WAAK,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI;SACvE;IACJ;AAEA,IAAAJ,iBAAY,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC;AAE7B,IAAA,OAAO,KAAqB;AAC/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTheme.mjs","sources":["../../src/theme/createTheme.ts"],"sourcesContent":["import { ThemeOptions, ThemeOptionInput, ThemeOptionsColor } from \"./types\"\nimport { mergeObject, ThemeFactory } from \"./core\"\nimport { alpha, breakpoints } from \"../css\"\nimport { lightThemeOptions } from \"./ThemeDefaultOptions\"\
|
|
1
|
+
{"version":3,"file":"createTheme.mjs","sources":["../../src/theme/createTheme.ts"],"sourcesContent":["import { ThemeOptions, ThemeOptionInput, ThemeOptionsColor } from \"./types\"\nimport { mergeObject, ThemeFactory } from \"./core\"\nimport { alpha, breakpoints } from \"../css\"\nimport { lightThemeOptions } from \"./ThemeDefaultOptions\"\n\nexport const createTheme = (name: string, options: ThemeOptionInput): ThemeOptions => {\n if (ThemeFactory.has(name)) {\n console.error(`createTheme: The theme '${name}' is already defined. Please choose a different name for the theme.`)\n return ThemeFactory.get(name) as ThemeOptions\n }\n\n let theme: any = mergeObject(lightThemeOptions, {\n ...options,\n name,\n breakpoints: breakpoints\n })\n\n // add alpha colors\n for (let color in theme.colors) {\n const c = theme.colors[color] as ThemeOptionsColor\n const is_common = color === 'divider' || color === 'background' || color === 'text'\n c.soft = {\n primary: is_common ? alpha(c.primary, 0.60) : alpha(c.primary, 0.08),\n secondary: is_common ? alpha(c.primary, 0.90) : alpha(c.primary, 0.12)\n }\n }\n\n ThemeFactory.set(name, theme)\n\n return theme as ThemeOptions\n}\n"],"names":[],"mappings":"mKAKa,WAAW,GAAG,CAAC,IAAY,EAAE,OAAyB,KAAkB;AAClF,IAAA,IAAI,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;AACzB,QAAA,OAAO,CAAC,KAAK,CAAC,2BAA2B,IAAI,CAAA,mEAAA,CAAqE,CAAC;AACnH,QAAA,OAAO,YAAY,CAAC,GAAG,CAAC,IAAI,CAAiB;IAChD;AAEA,IAAA,IAAI,KAAK,GAAQ,WAAW,CAAC,iBAAiB,EAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACxC,OAAO,CAAA,EAAA,EACV,IAAI,EACJ,WAAW,EAAE,WAAW,IACzB;;AAGF,IAAA,KAAK,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE;QAC7B,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAsB;AAClD,QAAA,MAAM,SAAS,GAAG,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,YAAY,IAAI,KAAK,KAAK,MAAM;QACnF,CAAC,CAAC,IAAI,GAAG;YACN,OAAO,EAAE,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC;YACpE,SAAS,EAAE,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI;SACvE;IACJ;AAEA,IAAA,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC;AAE7B,IAAA,OAAO,KAAqB;AAC/B"}
|