@vaneui/ui 0.2.1-alpha.20250812182914.4e44540 → 0.2.1-alpha.20250813194307.2bb87da
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/themeContext.d.ts +3 -1
- package/dist/components/ui/checkbox.d.ts +1 -0
- package/dist/components/ui/code.d.ts +1 -0
- package/dist/components/ui/divider.d.ts +1 -0
- package/dist/components/ui/img.d.ts +1 -0
- package/dist/components/ui/label.d.ts +1 -1
- package/dist/components/ui/props/keys.d.ts +8 -10
- package/dist/components/ui/theme/buttonTheme.d.ts +1 -1
- package/dist/index.esm.js +21 -25
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +20 -25
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -126,13 +126,15 @@ export type ThemeExtraClasses = {
|
|
|
126
126
|
label?: Partial<StringValueKeys<LabelProps>>;
|
|
127
127
|
img?: Partial<StringValueKeys<ImgProps>>;
|
|
128
128
|
};
|
|
129
|
+
export type MergeStrategy = 'merge' | 'replace';
|
|
129
130
|
export interface ThemeProviderProps {
|
|
130
131
|
children: React.ReactNode;
|
|
131
132
|
theme?: PartialTheme;
|
|
132
133
|
themeDefaults?: ThemeDefaults;
|
|
133
134
|
extraClasses?: ThemeExtraClasses;
|
|
134
135
|
themeOverride?: (theme: ThemeProps) => ThemeProps;
|
|
136
|
+
mergeStrategy?: MergeStrategy;
|
|
135
137
|
}
|
|
136
|
-
export declare function ThemeProvider({ children, theme: themeObject, themeDefaults, extraClasses, themeOverride }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
138
|
+
export declare function ThemeProvider({ children, theme: themeObject, themeDefaults, extraClasses, themeOverride, mergeStrategy }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
137
139
|
export declare function useTheme(): ThemeProps;
|
|
138
140
|
export {};
|
|
@@ -16,6 +16,7 @@ export declare const Checkbox: React.ForwardRefExoticComponent<{
|
|
|
16
16
|
danger?: boolean | undefined;
|
|
17
17
|
warning?: boolean | undefined;
|
|
18
18
|
info?: boolean | undefined;
|
|
19
|
+
link?: boolean | undefined;
|
|
19
20
|
noBorder?: boolean | undefined;
|
|
20
21
|
inline?: boolean | undefined;
|
|
21
22
|
block?: boolean | undefined;
|
|
@@ -19,6 +19,7 @@ export declare const Code: React.ForwardRefExoticComponent<{
|
|
|
19
19
|
danger?: boolean | undefined;
|
|
20
20
|
warning?: boolean | undefined;
|
|
21
21
|
info?: boolean | undefined;
|
|
22
|
+
link?: boolean | undefined;
|
|
22
23
|
noBorder?: boolean | undefined;
|
|
23
24
|
inline?: boolean | undefined;
|
|
24
25
|
block?: boolean | undefined;
|
|
@@ -14,6 +14,7 @@ export declare const Divider: React.ForwardRefExoticComponent<{
|
|
|
14
14
|
danger?: boolean | undefined;
|
|
15
15
|
warning?: boolean | undefined;
|
|
16
16
|
info?: boolean | undefined;
|
|
17
|
+
link?: boolean | undefined;
|
|
17
18
|
inline?: boolean | undefined;
|
|
18
19
|
block?: boolean | undefined;
|
|
19
20
|
inlineBlock?: boolean | undefined;
|
|
@@ -16,6 +16,7 @@ export declare const Img: React.ForwardRefExoticComponent<{
|
|
|
16
16
|
danger?: boolean | undefined;
|
|
17
17
|
warning?: boolean | undefined;
|
|
18
18
|
info?: boolean | undefined;
|
|
19
|
+
link?: boolean | undefined;
|
|
19
20
|
noBorder?: boolean | undefined;
|
|
20
21
|
inline?: boolean | undefined;
|
|
21
22
|
block?: boolean | undefined;
|
|
@@ -6,7 +6,6 @@ export declare const Label: React.ForwardRefExoticComponent<{
|
|
|
6
6
|
transparent?: boolean | undefined;
|
|
7
7
|
gap?: boolean | undefined;
|
|
8
8
|
reverse?: boolean | undefined;
|
|
9
|
-
link?: boolean | undefined;
|
|
10
9
|
default?: boolean | undefined;
|
|
11
10
|
accent?: boolean | undefined;
|
|
12
11
|
primary?: boolean | undefined;
|
|
@@ -16,6 +15,7 @@ export declare const Label: React.ForwardRefExoticComponent<{
|
|
|
16
15
|
danger?: boolean | undefined;
|
|
17
16
|
warning?: boolean | undefined;
|
|
18
17
|
info?: boolean | undefined;
|
|
18
|
+
link?: boolean | undefined;
|
|
19
19
|
inline?: boolean | undefined;
|
|
20
20
|
block?: boolean | undefined;
|
|
21
21
|
inlineBlock?: boolean | undefined;
|
|
@@ -7,12 +7,11 @@ export declare const VISUAL_DECORATION: readonly ["border", "shadow", "ring"];
|
|
|
7
7
|
export declare const SHAPE: readonly ["shape"];
|
|
8
8
|
export declare const TYPOGRAPHY_STYLE: readonly ["fontWeight", "fontStyle", "textDecoration", "textTransform", "fontFamily", "textAlign"];
|
|
9
9
|
export declare const LIST_STYLE: readonly ["listStyle"];
|
|
10
|
-
export declare const LINK: readonly ["link"];
|
|
11
10
|
export declare const VARIANT: readonly ["variant"];
|
|
12
|
-
export declare const COMPONENT_PROPS_CATEGORY: readonly ["appearance", "transparent", "wrap", "gap", "flexDirection", "reverse", "fontWeight", "fontStyle", "textDecoration", "textTransform", "fontFamily", "textAlign", "listStyle", "size", "hide", "items", "justify", "position", "display", "overflow", "breakpoint", "
|
|
11
|
+
export declare const COMPONENT_PROPS_CATEGORY: readonly ["appearance", "transparent", "wrap", "gap", "flexDirection", "reverse", "fontWeight", "fontStyle", "textDecoration", "textTransform", "fontFamily", "textAlign", "listStyle", "size", "hide", "items", "justify", "position", "display", "overflow", "breakpoint", "padding", "border", "shadow", "ring", "shape", "variant", "mode"];
|
|
13
12
|
export type ComponentCategoryKey = typeof COMPONENT_PROPS_CATEGORY[number];
|
|
14
13
|
export declare const ComponentKeys: {
|
|
15
|
-
readonly appearance: readonly ["default", "accent", "primary", "secondary", "tertiary", "success", "danger", "warning", "info"];
|
|
14
|
+
readonly appearance: readonly ["default", "accent", "primary", "secondary", "tertiary", "success", "danger", "warning", "info", "link"];
|
|
16
15
|
readonly border: readonly ["border", "noBorder"];
|
|
17
16
|
readonly breakpoint: readonly ["xsCol", "smCol", "mdCol", "lgCol", "xlCol"];
|
|
18
17
|
readonly display: readonly ["inline", "block", "inlineBlock", "flex", "inlineFlex", "grid", "inlineGrid", "contents", "table", "tableCell", "hidden"];
|
|
@@ -24,7 +23,6 @@ export declare const ComponentKeys: {
|
|
|
24
23
|
readonly hide: readonly ["xsHide", "smHide", "mdHide", "lgHide", "xlHide"];
|
|
25
24
|
readonly items: readonly ["itemsStart", "itemsEnd", "itemsCenter", "itemsBaseline", "itemsStretch"];
|
|
26
25
|
readonly justify: readonly ["justifyStart", "justifyEnd", "justifyCenter", "justifyBetween", "justifyAround", "justifyEvenly", "justifyStretch", "justifyBaseline"];
|
|
27
|
-
readonly link: readonly ["link"];
|
|
28
26
|
readonly listStyle: readonly ["disc", "decimal"];
|
|
29
27
|
readonly mode: readonly ["base", "hover", "active"];
|
|
30
28
|
readonly overflow: readonly ["overflowAuto", "overflowHidden", "overflowClip", "overflowVisible", "overflowScroll", "overflowXAuto", "overflowYAuto", "overflowXHidden", "overflowYHidden", "overflowXClip", "overflowYClip", "overflowXVisible", "overflowYVisible", "overflowXScroll", "overflowYScroll"];
|
|
@@ -52,7 +50,7 @@ export type GapKey = typeof ComponentKeys.gap[number];
|
|
|
52
50
|
export type VariantKey = typeof ComponentKeys.variant[number];
|
|
53
51
|
export type AppearanceKey = typeof ComponentKeys.appearance[number];
|
|
54
52
|
export type TransparentKey = typeof ComponentKeys.transparent[number];
|
|
55
|
-
export type LinkKey =
|
|
53
|
+
export type LinkKey = 'link';
|
|
56
54
|
export type ListStyleKey = typeof ComponentKeys.listStyle[number];
|
|
57
55
|
export type FontFamilyKey = typeof ComponentKeys.fontFamily[number];
|
|
58
56
|
export type FontWeightKey = typeof ComponentKeys.fontWeight[number];
|
|
@@ -71,24 +69,24 @@ export type DisplayKey = typeof ComponentKeys.display[number];
|
|
|
71
69
|
export type OverflowKey = typeof ComponentKeys.overflow[number];
|
|
72
70
|
export declare const LAYOUT_FULL: readonly ["size", "hide", "items", "justify", "position", "display", "overflow", "wrap", "gap", "flexDirection", "reverse"];
|
|
73
71
|
export declare const VISUAL_FULL: readonly ["appearance", "transparent", "border", "shadow", "ring", "shape"];
|
|
74
|
-
export declare const TYPOGRAPHY_FULL: readonly ["fontWeight", "fontStyle", "textDecoration", "textTransform", "fontFamily", "textAlign"
|
|
72
|
+
export declare const TYPOGRAPHY_FULL: readonly ["fontWeight", "fontStyle", "textDecoration", "textTransform", "fontFamily", "textAlign"];
|
|
75
73
|
export declare const INTERACTIVE_CATEGORIES: readonly ["size", "hide", "items", "justify", "position", "display", "overflow", "wrap", "gap", "flexDirection", "reverse", "appearance", "transparent", "border", "shadow", "ring", "shape", "fontWeight", "fontStyle", "textDecoration", "textTransform", "fontFamily", "textAlign", "padding", "variant"];
|
|
76
74
|
export declare const BUTTON_CATEGORIES: readonly ["size", "hide", "items", "justify", "position", "display", "overflow", "wrap", "gap", "flexDirection", "reverse", "appearance", "transparent", "border", "shadow", "ring", "shape", "fontWeight", "fontStyle", "textDecoration", "textTransform", "fontFamily", "textAlign", "padding", "variant"];
|
|
77
75
|
export declare const BADGE_CATEGORIES: readonly ["size", "hide", "items", "justify", "position", "display", "overflow", "wrap", "gap", "flexDirection", "reverse", "appearance", "transparent", "border", "shadow", "ring", "shape", "fontWeight", "fontStyle", "textDecoration", "textTransform", "fontFamily", "textAlign", "padding", "variant"];
|
|
78
76
|
export declare const CHIP_CATEGORIES: readonly ["size", "hide", "items", "justify", "position", "display", "overflow", "wrap", "gap", "flexDirection", "reverse", "appearance", "transparent", "border", "shadow", "ring", "shape", "fontWeight", "fontStyle", "textDecoration", "textTransform", "fontFamily", "textAlign", "padding", "variant"];
|
|
79
77
|
export declare const CODE_CATEGORIES: readonly ["size", "hide", "items", "justify", "position", "display", "overflow", "wrap", "gap", "flexDirection", "reverse", "appearance", "transparent", "border", "shadow", "ring", "shape", "fontWeight", "fontStyle", "textDecoration", "textTransform", "fontFamily", "textAlign", "padding", "variant"];
|
|
80
|
-
export declare const TYPOGRAPHY_CATEGORIES: readonly ["fontWeight", "fontStyle", "textDecoration", "textTransform", "fontFamily", "textAlign", "
|
|
81
|
-
export declare const LIST_CATEGORIES: readonly ["fontWeight", "fontStyle", "textDecoration", "textTransform", "fontFamily", "textAlign", "
|
|
78
|
+
export declare const TYPOGRAPHY_CATEGORIES: readonly ["fontWeight", "fontStyle", "textDecoration", "textTransform", "fontFamily", "textAlign", "size", "hide", "items", "justify", "position", "display", "overflow", "appearance", "transparent"];
|
|
79
|
+
export declare const LIST_CATEGORIES: readonly ["fontWeight", "fontStyle", "textDecoration", "textTransform", "fontFamily", "textAlign", "listStyle", "size", "hide", "items", "justify", "position", "display", "overflow", "appearance", "transparent", "padding"];
|
|
82
80
|
export declare const GRID_CATEGORIES: readonly ["size", "hide", "items", "justify", "position", "display", "overflow", "wrap", "gap", "flexDirection", "reverse", "appearance", "transparent"];
|
|
83
81
|
export declare const CONTAINER_CATEGORIES: readonly ["size", "hide", "items", "justify", "position", "display", "overflow", "wrap", "gap", "flexDirection", "reverse", "appearance", "transparent", "border", "shadow", "ring", "shape"];
|
|
84
82
|
export declare const COL_CATEGORIES: readonly ["size", "hide", "items", "justify", "position", "display", "overflow", "wrap", "gap", "flexDirection", "reverse", "appearance", "transparent", "border", "shadow", "ring", "shape"];
|
|
85
83
|
export declare const ROW_CATEGORIES: readonly ["size", "hide", "items", "justify", "position", "display", "overflow", "wrap", "gap", "flexDirection", "reverse", "breakpoint", "appearance", "transparent", "border", "shadow", "ring", "shape"];
|
|
86
84
|
export declare const STACK_CATEGORIES: readonly ["size", "hide", "items", "justify", "position", "display", "overflow", "wrap", "gap", "flexDirection", "reverse", "breakpoint", "padding", "appearance", "transparent", "border", "shadow", "ring", "shape"];
|
|
87
|
-
export declare const CARD_CATEGORIES: readonly ["fontWeight", "fontStyle", "textDecoration", "textTransform", "fontFamily", "textAlign", "
|
|
85
|
+
export declare const CARD_CATEGORIES: readonly ["fontWeight", "fontStyle", "textDecoration", "textTransform", "fontFamily", "textAlign", "size", "hide", "items", "justify", "position", "display", "overflow", "wrap", "gap", "flexDirection", "reverse", "breakpoint", "appearance", "transparent", "border", "shadow", "ring", "shape", "padding"];
|
|
88
86
|
export declare const DIVIDER_CATEGORIES: readonly ["size", "hide", "items", "justify", "position", "display", "overflow", "appearance", "transparent", "padding"];
|
|
89
87
|
export declare const SECTION_CATEGORIES: readonly ["size", "hide", "items", "justify", "position", "display", "overflow", "wrap", "gap", "flexDirection", "reverse", "appearance", "transparent", "border", "shadow", "ring", "shape", "padding", "breakpoint"];
|
|
90
88
|
export declare const CHECKBOX_CATEGORIES: readonly ["size", "hide", "items", "justify", "position", "display", "overflow", "appearance", "transparent", "border", "shadow", "ring", "shape", "variant"];
|
|
91
|
-
export declare const LABEL_CATEGORIES: readonly ["fontWeight", "fontStyle", "textDecoration", "textTransform", "fontFamily", "textAlign", "
|
|
89
|
+
export declare const LABEL_CATEGORIES: readonly ["fontWeight", "fontStyle", "textDecoration", "textTransform", "fontFamily", "textAlign", "size", "hide", "items", "justify", "position", "display", "overflow", "wrap", "gap", "flexDirection", "reverse", "appearance", "transparent"];
|
|
92
90
|
export declare const IMG_CATEGORIES: readonly ["size", "hide", "items", "justify", "position", "display", "overflow", "appearance", "transparent", "border", "shadow", "ring", "shape"];
|
|
93
91
|
export type CategoryProps = {
|
|
94
92
|
[K in ComponentCategoryKey]?: (typeof ComponentKeys)[K][number];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseTypographyComponentTheme, ComponentTheme, DefaultLayoutThemes } from "./common/ComponentTheme";
|
|
2
|
-
import { ButtonProps } from "../props
|
|
2
|
+
import { ButtonProps } from "../props";
|
|
3
3
|
import { SizeTheme } from "./size/sizeTheme";
|
|
4
4
|
import { GapTheme } from "./size/gapTheme";
|
|
5
5
|
import { RadiusTheme } from "./layout/radiusTheme";
|
package/dist/index.esm.js
CHANGED
|
@@ -18,7 +18,6 @@ const VISUAL_DECORATION = ['border', 'shadow', 'ring'];
|
|
|
18
18
|
const SHAPE = ['shape'];
|
|
19
19
|
const TYPOGRAPHY_STYLE = ['fontWeight', 'fontStyle', 'textDecoration', 'textTransform', 'fontFamily', 'textAlign'];
|
|
20
20
|
const LIST_STYLE = ['listStyle'];
|
|
21
|
-
const LINK = ['link'];
|
|
22
21
|
const VARIANT = ['variant'];
|
|
23
22
|
const COMPONENT_PROPS_CATEGORY = [
|
|
24
23
|
...VISUAL_CORE,
|
|
@@ -27,7 +26,6 @@ const COMPONENT_PROPS_CATEGORY = [
|
|
|
27
26
|
...LIST_STYLE,
|
|
28
27
|
...LAYOUT_CORE,
|
|
29
28
|
...BREAKPOINT,
|
|
30
|
-
...LINK,
|
|
31
29
|
...PADDING,
|
|
32
30
|
...VISUAL_DECORATION,
|
|
33
31
|
...SHAPE,
|
|
@@ -35,7 +33,7 @@ const COMPONENT_PROPS_CATEGORY = [
|
|
|
35
33
|
'mode',
|
|
36
34
|
];
|
|
37
35
|
const ComponentKeys = {
|
|
38
|
-
appearance: ['default', 'accent', 'primary', 'secondary', 'tertiary', 'success', 'danger', 'warning', 'info'],
|
|
36
|
+
appearance: ['default', 'accent', 'primary', 'secondary', 'tertiary', 'success', 'danger', 'warning', 'info', 'link'],
|
|
39
37
|
border: ['border', 'noBorder'],
|
|
40
38
|
breakpoint: ['xsCol', 'smCol', 'mdCol', 'lgCol', 'xlCol'],
|
|
41
39
|
display: ['inline', 'block', 'inlineBlock', 'flex', 'inlineFlex', 'grid', 'inlineGrid', 'contents', 'table', 'tableCell', 'hidden'],
|
|
@@ -47,7 +45,6 @@ const ComponentKeys = {
|
|
|
47
45
|
hide: ['xsHide', 'smHide', 'mdHide', 'lgHide', 'xlHide'],
|
|
48
46
|
items: ['itemsStart', 'itemsEnd', 'itemsCenter', 'itemsBaseline', 'itemsStretch'],
|
|
49
47
|
justify: ['justifyStart', 'justifyEnd', 'justifyCenter', 'justifyBetween', 'justifyAround', 'justifyEvenly', 'justifyStretch', 'justifyBaseline'],
|
|
50
|
-
link: ['link'],
|
|
51
48
|
listStyle: ['disc', 'decimal'],
|
|
52
49
|
mode: ['base', 'hover', 'active'],
|
|
53
50
|
overflow: ['overflowAuto', 'overflowHidden', 'overflowClip', 'overflowVisible', 'overflowScroll', 'overflowXAuto', 'overflowYAuto', 'overflowXHidden', 'overflowYHidden', 'overflowXClip', 'overflowYClip', 'overflowXVisible', 'overflowYVisible', 'overflowXScroll', 'overflowYScroll'],
|
|
@@ -68,7 +65,7 @@ const ComponentKeys = {
|
|
|
68
65
|
// Composite categories built from core blocks
|
|
69
66
|
const LAYOUT_FULL = [...LAYOUT_CORE, ...LAYOUT_FLEX];
|
|
70
67
|
const VISUAL_FULL = [...VISUAL_CORE, ...VISUAL_DECORATION, ...SHAPE];
|
|
71
|
-
const TYPOGRAPHY_FULL = [...TYPOGRAPHY_STYLE
|
|
68
|
+
const TYPOGRAPHY_FULL = [...TYPOGRAPHY_STYLE];
|
|
72
69
|
const INTERACTIVE_CATEGORIES = [...LAYOUT_FULL, ...VISUAL_FULL, ...TYPOGRAPHY_STYLE, ...PADDING, ...VARIANT];
|
|
73
70
|
const BUTTON_CATEGORIES = INTERACTIVE_CATEGORIES;
|
|
74
71
|
const BADGE_CATEGORIES = INTERACTIVE_CATEGORIES;
|
|
@@ -3665,26 +3662,21 @@ class AppearanceTheme extends BaseTheme {
|
|
|
3665
3662
|
this.linkClassSource = options === null || options === void 0 ? void 0 : options.linkClassSource;
|
|
3666
3663
|
}
|
|
3667
3664
|
getClasses(extractedKeys) {
|
|
3668
|
-
var _a
|
|
3669
|
-
// Check for specific transparent
|
|
3665
|
+
var _a;
|
|
3666
|
+
// Check for specific transparent styles first
|
|
3670
3667
|
if (extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.transparent) {
|
|
3671
3668
|
const transparentClass = ((_a = this.transparentClassSource) === null || _a === void 0 ? void 0 : _a[extractedKeys.transparent]) || '';
|
|
3672
3669
|
return [transparentClass];
|
|
3673
3670
|
}
|
|
3674
|
-
|
|
3675
|
-
const linkClass = ((_b = this.linkClassSource) === null || _b === void 0 ? void 0 : _b[extractedKeys.link]) || '';
|
|
3676
|
-
return [linkClass];
|
|
3677
|
-
}
|
|
3678
|
-
// Use regular appearance
|
|
3671
|
+
// Use appearance (now includes link as an appearance option)
|
|
3679
3672
|
const pickedAppearanceKey = extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.appearance;
|
|
3680
|
-
if (
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
return [];
|
|
3673
|
+
if (pickedAppearanceKey) {
|
|
3674
|
+
const modes = this[pickedAppearanceKey];
|
|
3675
|
+
if (modes) {
|
|
3676
|
+
return ComponentKeys.mode.map(mode => modes[mode] || '');
|
|
3677
|
+
}
|
|
3686
3678
|
}
|
|
3687
|
-
return
|
|
3679
|
+
return [];
|
|
3688
3680
|
}
|
|
3689
3681
|
static createTheme(src = {}, options) {
|
|
3690
3682
|
const finalConfig = Object.fromEntries(ComponentKeys.appearance.map(textKey => [
|
|
@@ -4304,7 +4296,6 @@ const linkTheme = new ComponentTheme("a", "hover:underline w-fit cursor-pointer"
|
|
|
4304
4296
|
layout: defaultLayoutTheme,
|
|
4305
4297
|
}, {
|
|
4306
4298
|
link: true,
|
|
4307
|
-
default: true,
|
|
4308
4299
|
sans: true,
|
|
4309
4300
|
}, TYPOGRAPHY_CATEGORIES);
|
|
4310
4301
|
// List specific theme
|
|
@@ -4855,12 +4846,17 @@ function applyExtraClassesRecursively(themeObject, extraClassesObject) {
|
|
|
4855
4846
|
}
|
|
4856
4847
|
}
|
|
4857
4848
|
const ThemeContext = createContext(defaultTheme);
|
|
4858
|
-
function ThemeProvider({ children, theme: themeObject = {}, themeDefaults, extraClasses, themeOverride }) {
|
|
4849
|
+
function ThemeProvider({ children, theme: themeObject = {}, themeDefaults, extraClasses, themeOverride, mergeStrategy = 'merge' }) {
|
|
4850
|
+
const parentTheme = useContext(ThemeContext);
|
|
4859
4851
|
const mergedTheme = useMemo(() => {
|
|
4852
|
+
// Determine the base theme based on merge strategy
|
|
4853
|
+
const baseTheme = mergeStrategy === 'replace'
|
|
4854
|
+
? defaultTheme
|
|
4855
|
+
: parentTheme;
|
|
4860
4856
|
// Always start with a deep clone to ensure isolation
|
|
4861
4857
|
let finalTheme = themeObject
|
|
4862
|
-
? deepMerge(deepClone(
|
|
4863
|
-
: deepClone(
|
|
4858
|
+
? deepMerge(deepClone(baseTheme), themeObject)
|
|
4859
|
+
: deepClone(baseTheme);
|
|
4864
4860
|
if (typeof themeOverride === 'function') {
|
|
4865
4861
|
const themeToModify = deepClone(finalTheme);
|
|
4866
4862
|
finalTheme = themeOverride(themeToModify);
|
|
@@ -4878,7 +4874,7 @@ function ThemeProvider({ children, theme: themeObject = {}, themeDefaults, extra
|
|
|
4878
4874
|
applyExtraClassesRecursively(finalTheme, extraClasses);
|
|
4879
4875
|
}
|
|
4880
4876
|
return finalTheme;
|
|
4881
|
-
}, [themeObject, themeDefaults, extraClasses, themeOverride]);
|
|
4877
|
+
}, [themeObject, themeDefaults, extraClasses, themeOverride, mergeStrategy, parentTheme]);
|
|
4882
4878
|
return (jsx(ThemeContext.Provider, { value: mergedTheme, children: children }));
|
|
4883
4879
|
}
|
|
4884
4880
|
function useTheme() {
|
|
@@ -5025,5 +5021,5 @@ const List = forwardRef(function List(props, ref) {
|
|
|
5025
5021
|
return jsx(ThemedComponent, { ref: ref, theme: theme.list, ...props });
|
|
5026
5022
|
});
|
|
5027
5023
|
|
|
5028
|
-
export { BADGE_CATEGORIES, BREAKPOINT, BUTTON_CATEGORIES, Badge, Button, CARD_CATEGORIES, CHECKBOX_CATEGORIES, CHIP_CATEGORIES, CODE_CATEGORIES, COL_CATEGORIES, COMPONENT, COMPONENT_PROPS_CATEGORY, CONTAINER_CATEGORIES, Card, Checkbox, Chip, Code, Col, ComponentCategories, ComponentKeys, Container, DIVIDER_CATEGORIES, Divider, GRID_CATEGORIES, Grid2, Grid3, Grid4, IMG_CATEGORIES, INTERACTIVE_CATEGORIES, Img, LABEL_CATEGORIES, LAYOUT_CORE, LAYOUT_FLEX, LAYOUT_FULL,
|
|
5024
|
+
export { BADGE_CATEGORIES, BREAKPOINT, BUTTON_CATEGORIES, Badge, Button, CARD_CATEGORIES, CHECKBOX_CATEGORIES, CHIP_CATEGORIES, CODE_CATEGORIES, COL_CATEGORIES, COMPONENT, COMPONENT_PROPS_CATEGORY, CONTAINER_CATEGORIES, Card, Checkbox, Chip, Code, Col, ComponentCategories, ComponentKeys, Container, DIVIDER_CATEGORIES, Divider, GRID_CATEGORIES, Grid2, Grid3, Grid4, IMG_CATEGORIES, INTERACTIVE_CATEGORIES, Img, LABEL_CATEGORIES, LAYOUT_CORE, LAYOUT_FLEX, LAYOUT_FULL, LIST_CATEGORIES, LIST_STYLE, Label, Link, List, ListItem, PADDING, PageTitle, ROW_CATEGORIES, Row, SECTION_CATEGORIES, SHAPE, STACK_CATEGORIES, Section, SectionTitle, Stack, TYPOGRAPHY_CATEGORIES, TYPOGRAPHY_FULL, TYPOGRAPHY_STYLE, Text, ThemeProvider, Title, VARIANT, VISUAL_CORE, VISUAL_DECORATION, VISUAL_FULL, defaultTheme, useTheme };
|
|
5029
5025
|
//# sourceMappingURL=index.esm.js.map
|