@xanui/core 1.2.57 → 1.2.59
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/AppRoot/AppRootProvider.cjs.map +1 -1
- package/AppRoot/AppRootProvider.js.map +1 -1
- package/AppRoot/Renderar.cjs.map +1 -1
- package/AppRoot/Renderar.js.map +1 -1
- package/AppRoot/index.cjs +6 -5
- package/AppRoot/index.cjs.map +1 -1
- package/AppRoot/index.d.ts +1 -0
- package/AppRoot/index.js +7 -6
- package/AppRoot/index.js.map +1 -1
- package/Document/index.cjs.map +1 -1
- package/Document/index.js.map +1 -1
- package/Iframe/index.cjs.map +1 -1
- package/Iframe/index.js.map +1 -1
- package/Portal/index.cjs.map +1 -1
- package/Portal/index.js.map +1 -1
- package/Tag/ServerStyleTag.cjs.map +1 -1
- package/Tag/ServerStyleTag.js.map +1 -1
- package/Tag/cssPropList.cjs.map +1 -1
- package/Tag/cssPropList.js.map +1 -1
- package/Tag/index.cjs.map +1 -1
- package/Tag/index.js.map +1 -1
- package/Tag/useTagProps.cjs.map +1 -1
- package/Tag/useTagProps.js.map +1 -1
- package/Transition/index.cjs.map +1 -1
- package/Transition/index.js.map +1 -1
- package/breakpoint/BreakpointProvider.cjs +37 -39
- package/breakpoint/BreakpointProvider.cjs.map +1 -1
- package/breakpoint/BreakpointProvider.js +37 -39
- package/breakpoint/BreakpointProvider.js.map +1 -1
- package/breakpoint/useBreakpoint.cjs +10 -9
- package/breakpoint/useBreakpoint.cjs.map +1 -1
- package/breakpoint/useBreakpoint.d.ts +4 -5
- package/breakpoint/useBreakpoint.js +10 -9
- package/breakpoint/useBreakpoint.js.map +1 -1
- package/breakpoint/useBreakpointProps.cjs.map +1 -1
- package/breakpoint/useBreakpointProps.js.map +1 -1
- package/css/CSSCacheProvider.cjs.map +1 -1
- package/css/CSSCacheProvider.js.map +1 -1
- package/css/aliases.cjs.map +1 -1
- package/css/aliases.js.map +1 -1
- package/css/getProps.cjs.map +1 -1
- package/css/getProps.js.map +1 -1
- package/css/getValue.cjs.map +1 -1
- package/css/getValue.js.map +1 -1
- package/css/index.cjs.map +1 -1
- package/css/index.js.map +1 -1
- package/hooks/useAnimation.cjs.map +1 -1
- package/hooks/useAnimation.js.map +1 -1
- package/hooks/useColorTemplate.cjs.map +1 -1
- package/hooks/useColorTemplate.js.map +1 -1
- package/hooks/useInterface.cjs.map +1 -1
- package/hooks/useInterface.js.map +1 -1
- package/hooks/useMergeRefs.cjs.map +1 -1
- package/hooks/useMergeRefs.js.map +1 -1
- package/hooks/useTransition/index.cjs +1 -1
- package/hooks/useTransition/index.cjs.map +1 -1
- package/hooks/useTransition/index.js +2 -2
- package/hooks/useTransition/index.js.map +1 -1
- package/hooks/useTransition/variants.cjs.map +1 -1
- package/hooks/useTransition/variants.js.map +1 -1
- package/index.cjs +3 -0
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/readme.md +109 -109
- package/theme/ThemeCssVars.cjs.map +1 -1
- package/theme/ThemeCssVars.js.map +1 -1
- package/theme/ThemeDefaultOptions.cjs +54 -47
- package/theme/ThemeDefaultOptions.cjs.map +1 -1
- package/theme/ThemeDefaultOptions.d.ts +6 -0
- package/theme/ThemeDefaultOptions.js +54 -48
- package/theme/ThemeDefaultOptions.js.map +1 -1
- package/theme/ThemeProvider.cjs.map +1 -1
- package/theme/ThemeProvider.js.map +1 -1
- package/theme/core.cjs.map +1 -1
- package/theme/core.js.map +1 -1
- package/theme/createTheme.cjs +3 -2
- package/theme/createTheme.cjs.map +1 -1
- package/theme/createTheme.d.ts +1 -1
- package/theme/createTheme.js +4 -3
- package/theme/createTheme.js.map +1 -1
- package/theme/createThemeSwitcher.cjs.map +1 -1
- package/theme/createThemeSwitcher.js.map +1 -1
- package/theme/index.cjs.map +1 -1
- package/theme/index.js.map +1 -1
package/theme/createTheme.cjs
CHANGED
|
@@ -4,12 +4,13 @@ var core = require('./core.cjs');
|
|
|
4
4
|
var index = require('../css/index.cjs');
|
|
5
5
|
var ThemeDefaultOptions = require('./ThemeDefaultOptions.cjs');
|
|
6
6
|
|
|
7
|
-
const createTheme = (name, options) => {
|
|
7
|
+
const createTheme = (name, options, mode = "light") => {
|
|
8
8
|
if (core.ThemeFactory.has(name)) {
|
|
9
9
|
console.error(`createTheme: The theme '${name}' is already defined. Please choose a different name for the theme.`);
|
|
10
10
|
return core.ThemeFactory.get(name);
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
const defaultOptions = mode === 'light' ? ThemeDefaultOptions.lightThemeOptions : ThemeDefaultOptions.darkThemeOptions;
|
|
13
|
+
let theme = core.mergeObject(defaultOptions, Object.assign(Object.assign({}, options), { name, breakpoints: index.breakpoints }));
|
|
13
14
|
// add alpha colors
|
|
14
15
|
for (let color in theme.colors) {
|
|
15
16
|
const c = theme.colors[color];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTheme.cjs","sources":["../../src/theme/createTheme.ts"],"sourcesContent":["import { ThemeOptions, ThemeOptionInput, ThemeOptionsColor } from \"./types\"\
|
|
1
|
+
{"version":3,"file":"createTheme.cjs","sources":["../../src/theme/createTheme.ts"],"sourcesContent":["import { ThemeOptions, ThemeOptionInput, ThemeOptionsColor } from \"./types\"\nimport { mergeObject, ThemeFactory } from \"./core\"\nimport { alpha, breakpoints } from \"../css\"\nimport { darkThemeOptions, lightThemeOptions } from \"./ThemeDefaultOptions\"\n\nexport const createTheme = (name: string, options: ThemeOptionInput, mode: \"light\" | \"dark\" = \"light\"): 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 const defaultOptions = mode === 'light' ? lightThemeOptions : darkThemeOptions\n let theme: any = mergeObject(defaultOptions, {\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","lightThemeOptions","darkThemeOptions","mergeObject","breakpoints","alpha"],"mappings":";;;;;;AAKO,MAAM,WAAW,GAAG,CAAC,IAAY,EAAE,OAAyB,EAAE,IAAA,GAAyB,OAAO,KAAkB;AACpH,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;AACA,IAAA,MAAM,cAAc,GAAG,IAAI,KAAK,OAAO,GAAGC,qCAAiB,GAAGC,oCAAgB;AAC9E,IAAA,IAAI,KAAK,GAAQC,gBAAW,CAAC,cAAc,EAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACrC,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,IAAAL,iBAAY,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC;AAE7B,IAAA,OAAO,KAAqB;AAC/B;;;;"}
|
package/theme/createTheme.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ThemeOptionInput, ThemeOptions } from './types.js';
|
|
2
2
|
|
|
3
|
-
declare const createTheme: (name: string, options: ThemeOptionInput) => ThemeOptions;
|
|
3
|
+
declare const createTheme: (name: string, options: ThemeOptionInput, mode?: "light" | "dark") => ThemeOptions;
|
|
4
4
|
|
|
5
5
|
export { createTheme };
|
package/theme/createTheme.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { ThemeFactory, mergeObject } from './core.js';
|
|
2
2
|
import { breakpoints, alpha } from '../css/index.js';
|
|
3
|
-
import { lightThemeOptions } from './ThemeDefaultOptions.js';
|
|
3
|
+
import { lightThemeOptions, darkThemeOptions } from './ThemeDefaultOptions.js';
|
|
4
4
|
|
|
5
|
-
const createTheme = (name, options) => {
|
|
5
|
+
const createTheme = (name, options, mode = "light") => {
|
|
6
6
|
if (ThemeFactory.has(name)) {
|
|
7
7
|
console.error(`createTheme: The theme '${name}' is already defined. Please choose a different name for the theme.`);
|
|
8
8
|
return ThemeFactory.get(name);
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
const defaultOptions = mode === 'light' ? lightThemeOptions : darkThemeOptions;
|
|
11
|
+
let theme = mergeObject(defaultOptions, Object.assign(Object.assign({}, options), { name, breakpoints: breakpoints }));
|
|
11
12
|
// add alpha colors
|
|
12
13
|
for (let color in theme.colors) {
|
|
13
14
|
const c = theme.colors[color];
|
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\"\
|
|
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 { darkThemeOptions, lightThemeOptions } from \"./ThemeDefaultOptions\"\n\nexport const createTheme = (name: string, options: ThemeOptionInput, mode: \"light\" | \"dark\" = \"light\"): 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 const defaultOptions = mode === 'light' ? lightThemeOptions : darkThemeOptions\n let theme: any = mergeObject(defaultOptions, {\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":";;;;AAKO,MAAM,WAAW,GAAG,CAAC,IAAY,EAAE,OAAyB,EAAE,IAAA,GAAyB,OAAO,KAAkB;AACpH,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;AACA,IAAA,MAAM,cAAc,GAAG,IAAI,KAAK,OAAO,GAAG,iBAAiB,GAAG,gBAAgB;AAC9E,IAAA,IAAI,KAAK,GAAQ,WAAW,CAAC,cAAc,EAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACrC,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;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createThemeSwitcher.cjs","sources":["../../src/theme/createThemeSwitcher.ts"],"sourcesContent":["\"use client\";\
|
|
1
|
+
{"version":3,"file":"createThemeSwitcher.cjs","sources":["../../src/theme/createThemeSwitcher.ts"],"sourcesContent":["\"use client\";\nimport { createBucket, xv } from \"react-state-bucket\"\nimport { getTheme } from \"./core\"\nimport { BucketOptions } from \"react-state-bucket\"\n\nexport type ThemeSwitcherOption = {\n store?: BucketOptions['store'],\n onChange?: (theme: string) => void\n}\n\nconst createThemeSwitcher = (defaultTheme: string, option?: ThemeSwitcherOption) => {\n\n const useThemeBucket = createBucket({ name: xv.string().default(defaultTheme) }, {\n store: option?.store || \"memory\",\n onChange: (_key, value) => {\n option?.onChange && option?.onChange(value)\n }\n })\n\n const useThemeSwitcher = () => {\n const bucket = useThemeBucket()\n return {\n name: bucket.state.name,\n theme: getTheme(bucket.state.name),\n change: (theme: string) => bucket.set('name', theme)\n }\n }\n return useThemeSwitcher\n}\n\nexport default createThemeSwitcher"],"names":[],"mappings":";;;;;;AAUA;AAEG;;AAEG;AACG;;AAEL;;AAGE;;AAEG;;AAEA;;AAEN;AACA;AACH;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createThemeSwitcher.js","sources":["../../src/theme/createThemeSwitcher.ts"],"sourcesContent":["\"use client\";\
|
|
1
|
+
{"version":3,"file":"createThemeSwitcher.js","sources":["../../src/theme/createThemeSwitcher.ts"],"sourcesContent":["\"use client\";\nimport { createBucket, xv } from \"react-state-bucket\"\nimport { getTheme } from \"./core\"\nimport { BucketOptions } from \"react-state-bucket\"\n\nexport type ThemeSwitcherOption = {\n store?: BucketOptions['store'],\n onChange?: (theme: string) => void\n}\n\nconst createThemeSwitcher = (defaultTheme: string, option?: ThemeSwitcherOption) => {\n\n const useThemeBucket = createBucket({ name: xv.string().default(defaultTheme) }, {\n store: option?.store || \"memory\",\n onChange: (_key, value) => {\n option?.onChange && option?.onChange(value)\n }\n })\n\n const useThemeSwitcher = () => {\n const bucket = useThemeBucket()\n return {\n name: bucket.state.name,\n theme: getTheme(bucket.state.name),\n change: (theme: string) => bucket.set('name', theme)\n }\n }\n return useThemeSwitcher\n}\n\nexport default createThemeSwitcher"],"names":[],"mappings":";;;;AAUA;AAEG;;AAEG;AACG;;AAEL;;AAGE;;AAEG;;AAEA;;AAEN;AACA;AACH;;"}
|
package/theme/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/theme/index.tsx"],"sourcesContent":["import { createTheme } from \"./createTheme\"\
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/theme/index.tsx"],"sourcesContent":["import { createTheme } from \"./createTheme\"\nimport ThemeProvider from './ThemeProvider'\nimport createThemeSwitcher from './createThemeSwitcher'\nimport { getTheme, useTheme } from './core'\nimport { lightThemeOptions, darkThemeOptions } from './ThemeDefaultOptions'\nexport type { ThemeProviderProps } from './ThemeProvider'\nexport type { ThemeSwitcherOption } from './createThemeSwitcher'\n\nexport const themeRootClass = (theme: string) => `.xui-${theme}-theme-root`\n\nexport {\n ThemeProvider,\n createThemeSwitcher,\n createTheme,\n getTheme,\n useTheme,\n lightThemeOptions,\n darkThemeOptions\n}\n\n"],"names":[],"mappings":";;;;;;;;AAQO,MAAM,cAAc,GAAG,CAAC,KAAa,KAAK,CAAA,KAAA,EAAQ,KAAK,CAAA,WAAA;;;;;;;"}
|
package/theme/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/theme/index.tsx"],"sourcesContent":["import { createTheme } from \"./createTheme\"\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/theme/index.tsx"],"sourcesContent":["import { createTheme } from \"./createTheme\"\nimport ThemeProvider from './ThemeProvider'\nimport createThemeSwitcher from './createThemeSwitcher'\nimport { getTheme, useTheme } from './core'\nimport { lightThemeOptions, darkThemeOptions } from './ThemeDefaultOptions'\nexport type { ThemeProviderProps } from './ThemeProvider'\nexport type { ThemeSwitcherOption } from './createThemeSwitcher'\n\nexport const themeRootClass = (theme: string) => `.xui-${theme}-theme-root`\n\nexport {\n ThemeProvider,\n createThemeSwitcher,\n createTheme,\n getTheme,\n useTheme,\n lightThemeOptions,\n darkThemeOptions\n}\n\n"],"names":[],"mappings":";;;;;;AAQO,MAAM,cAAc,GAAG,CAAC,KAAa,KAAK,CAAA,KAAA,EAAQ,KAAK,CAAA,WAAA;;;;"}
|