@omnia/velcron 7.0.524-dev → 7.0.526-dev
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/internal-do-not-import-from-here/shared/models/theming/BlueprintDefinition.d.ts +27 -0
- package/internal-do-not-import-from-here/shared/models/theming/BlueprintDefinition.js +2 -0
- package/internal-do-not-import-from-here/shared/models/theming/ThemeDefinitionV2.d.ts +6 -3
- package/internal-do-not-import-from-here/shared/models/theming/TypographyDefinition.d.ts +1 -0
- package/models/Enums.d.ts +2 -1
- package/models/Enums.js +1 -0
- package/models/VelcronDefinitions.d.ts +18 -10
- package/package.json +1 -1
- package/parser/VelcronRenderers.d.ts +6 -5
- package/parser/VelcronStyles.d.ts +4 -1
- package/parser/VelcronStyles.js +83 -29
- package/stores/VelcronTheming.d.ts +1 -0
- package/stores/VelcronTheming.js +21 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Guid } from "../Guid";
|
|
2
|
+
export interface BoxDimensions {
|
|
3
|
+
top: number;
|
|
4
|
+
right: number;
|
|
5
|
+
bottom: number;
|
|
6
|
+
left: number;
|
|
7
|
+
}
|
|
8
|
+
export interface BoxBorder extends BoxDimensions {
|
|
9
|
+
color: string;
|
|
10
|
+
}
|
|
11
|
+
export interface BlueprintDefinition {
|
|
12
|
+
id: Guid;
|
|
13
|
+
card?: {
|
|
14
|
+
border?: BoxBorder;
|
|
15
|
+
borderRadius?: BoxDimensions;
|
|
16
|
+
};
|
|
17
|
+
image?: {
|
|
18
|
+
borderRadius?: BoxDimensions;
|
|
19
|
+
};
|
|
20
|
+
chip?: {
|
|
21
|
+
borderRadius?: BoxDimensions;
|
|
22
|
+
};
|
|
23
|
+
icon?: {
|
|
24
|
+
borderRadius?: BoxDimensions;
|
|
25
|
+
round?: boolean;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Guid } from "../Guid";
|
|
2
|
+
import { BlueprintDefinition } from "./BlueprintDefinition";
|
|
2
3
|
import { TypographyDefinition } from "./TypographyDefinition";
|
|
3
4
|
export interface ColorDefinition {
|
|
4
5
|
dark: boolean;
|
|
@@ -8,9 +9,9 @@ export interface ColorDefinition {
|
|
|
8
9
|
colorTonedStyles: ColorStyles;
|
|
9
10
|
}
|
|
10
11
|
export interface ColorStyles {
|
|
11
|
-
background: object;
|
|
12
|
-
color: object;
|
|
13
|
-
all: object;
|
|
12
|
+
background: object | string;
|
|
13
|
+
color: object | string;
|
|
14
|
+
all: object | string;
|
|
14
15
|
}
|
|
15
16
|
export interface ColorSchema {
|
|
16
17
|
name: string;
|
|
@@ -25,6 +26,7 @@ export interface ColorGroup {
|
|
|
25
26
|
}
|
|
26
27
|
export interface ThemeDefinitionV2 {
|
|
27
28
|
id: Guid;
|
|
29
|
+
name: string;
|
|
28
30
|
dark: boolean;
|
|
29
31
|
primary: ColorSchema;
|
|
30
32
|
secondary: ColorSchema;
|
|
@@ -36,6 +38,7 @@ export interface ThemeDefinitionV2 {
|
|
|
36
38
|
error: ColorSchema;
|
|
37
39
|
info: ColorSchema;
|
|
38
40
|
typography: TypographyDefinition;
|
|
41
|
+
blueprint: BlueprintDefinition;
|
|
39
42
|
}
|
|
40
43
|
export declare const ColorSchemaTypes: {
|
|
41
44
|
primary: string;
|
package/models/Enums.d.ts
CHANGED
package/models/Enums.js
CHANGED
|
@@ -49,6 +49,7 @@ var VelcronComponentPropertyEditors;
|
|
|
49
49
|
VelcronComponentPropertyEditors[VelcronComponentPropertyEditors["colorPicker"] = 3] = "colorPicker";
|
|
50
50
|
VelcronComponentPropertyEditors[VelcronComponentPropertyEditors["typographyPicker"] = 4] = "typographyPicker";
|
|
51
51
|
VelcronComponentPropertyEditors[VelcronComponentPropertyEditors["ratioPicker"] = 5] = "ratioPicker";
|
|
52
|
+
VelcronComponentPropertyEditors[VelcronComponentPropertyEditors["booleanPicker"] = 6] = "booleanPicker";
|
|
52
53
|
})(VelcronComponentPropertyEditors = exports.VelcronComponentPropertyEditors || (exports.VelcronComponentPropertyEditors = {}));
|
|
53
54
|
var VelcronDataTypes;
|
|
54
55
|
(function (VelcronDataTypes) {
|
|
@@ -23,15 +23,23 @@ export interface BuiltInComponentRenderers {
|
|
|
23
23
|
"Icon": unknown;
|
|
24
24
|
"Chip": unknown;
|
|
25
25
|
}
|
|
26
|
-
export
|
|
26
|
+
export interface ColorSchemaReference {
|
|
27
|
+
name: string;
|
|
28
|
+
schema: string;
|
|
29
|
+
}
|
|
30
|
+
export interface VelcronState {
|
|
31
|
+
colorSchemas?: {
|
|
32
|
+
[key: string]: ColorSchemaReference;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
27
35
|
export interface OnItemRenderedHookResult {
|
|
28
36
|
cssClass: string;
|
|
29
37
|
containerRenderer?: VelcronContainerRenderer;
|
|
30
38
|
}
|
|
31
39
|
export interface VelcronRenderContext {
|
|
32
40
|
id?: string;
|
|
33
|
-
rootContext:
|
|
34
|
-
currentContext:
|
|
41
|
+
rootContext: VelcronState;
|
|
42
|
+
currentContext: VelcronState;
|
|
35
43
|
theming?: ReturnType<typeof useVelcronThemingStore>;
|
|
36
44
|
colorSchemaName?: string;
|
|
37
45
|
colorSchema?: ColorSchema;
|
|
@@ -102,6 +110,8 @@ export interface VelcronDefinitionBase {
|
|
|
102
110
|
}
|
|
103
111
|
export interface VelcronCustomThemeSettings {
|
|
104
112
|
colorSchema?: string;
|
|
113
|
+
color?: string;
|
|
114
|
+
opacity?: number;
|
|
105
115
|
}
|
|
106
116
|
export interface VelcronDefinition extends VelcronDefinitionBase {
|
|
107
117
|
body?: Array<VelcronDefinition>;
|
|
@@ -145,7 +155,7 @@ export interface VelcronAppDefinition extends VelcronDefinitionBase {
|
|
|
145
155
|
[name: string]: [];
|
|
146
156
|
};
|
|
147
157
|
components?: Array<VelcronCustomComponentDefinition>;
|
|
148
|
-
state?:
|
|
158
|
+
state?: VelcronState;
|
|
149
159
|
computed?: {
|
|
150
160
|
[name: string]: [];
|
|
151
161
|
};
|
|
@@ -160,7 +170,7 @@ export interface VelcronViewDefinition extends VelcronDefinition {
|
|
|
160
170
|
style?: VelcronStyling;
|
|
161
171
|
events?: VelcronOnPressEvent;
|
|
162
172
|
}
|
|
163
|
-
export interface VelcronCardDefinition extends VelcronDefinition {
|
|
173
|
+
export interface VelcronCardDefinition extends VelcronDefinition, VelcronCustomThemeSettings {
|
|
164
174
|
type: "Card";
|
|
165
175
|
style?: VelcronCardStyling;
|
|
166
176
|
footer?: Array<VelcronDefinition>;
|
|
@@ -215,10 +225,10 @@ export interface VelcronDialogDefinition extends VelcronDefinition {
|
|
|
215
225
|
visible: string;
|
|
216
226
|
events?: VelcronOnCloseRequestedEvent & VelcronOnClosedEvent;
|
|
217
227
|
}
|
|
218
|
-
export interface VelcronIconDefinition extends VelcronDefinition {
|
|
228
|
+
export interface VelcronIconDefinition extends VelcronDefinition, VelcronCustomThemeSettings {
|
|
219
229
|
type: "Icon";
|
|
220
230
|
icon: string;
|
|
221
|
-
|
|
231
|
+
background?: boolean;
|
|
222
232
|
size?: number;
|
|
223
233
|
events?: VelcronOnPressEvent;
|
|
224
234
|
}
|
|
@@ -232,7 +242,6 @@ export interface VelcronFlexViewDefinition extends VelcronDefinition, VelcronCus
|
|
|
232
242
|
grow?: number;
|
|
233
243
|
border?: VelcronBorder;
|
|
234
244
|
borderRadius?: VelcronDimensions;
|
|
235
|
-
opacity: number;
|
|
236
245
|
width: string;
|
|
237
246
|
}
|
|
238
247
|
export interface VelcronDimensions {
|
|
@@ -244,10 +253,9 @@ export interface VelcronDimensions {
|
|
|
244
253
|
export interface VelcronBorder extends VelcronDimensions {
|
|
245
254
|
color: string;
|
|
246
255
|
}
|
|
247
|
-
export interface VelcronChipDefinition extends VelcronDefinition {
|
|
256
|
+
export interface VelcronChipDefinition extends VelcronDefinition, VelcronCustomThemeSettings {
|
|
248
257
|
type: "Chip";
|
|
249
258
|
text: string;
|
|
250
|
-
colorSchema: string;
|
|
251
259
|
icon?: VelcronIcon;
|
|
252
260
|
disabled?: boolean;
|
|
253
261
|
events?: VelcronOnPressEvent;
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BuiltInComponentRenderers,
|
|
1
|
+
import { BuiltInComponentRenderers, VelcronState, ResolvedComponentRenderer, VelcronCustomComponentDefinition, VelcronDefinition, VelcronRenderContext } from "../models";
|
|
2
2
|
export declare class VelcronRenderers {
|
|
3
3
|
private static components;
|
|
4
4
|
static registerComponent(type: string, component: any): void;
|
|
@@ -7,8 +7,8 @@ export declare class VelcronRenderers {
|
|
|
7
7
|
static registerComponents(components: BuiltInComponentRenderers): void;
|
|
8
8
|
static getComponent(definition: VelcronDefinition, renderContext: VelcronRenderContext): ResolvedComponentRenderer;
|
|
9
9
|
static definitionContainsCustomColorSchema(definition: VelcronDefinition): boolean;
|
|
10
|
-
static createNewRendererContext(currentRenderCtx: VelcronRenderContext, definition: VelcronDefinition, newViewModel?:
|
|
11
|
-
rootContext:
|
|
10
|
+
static createNewRendererContext(currentRenderCtx: VelcronRenderContext, definition: VelcronDefinition, newViewModel?: VelcronState): {
|
|
11
|
+
rootContext: VelcronState;
|
|
12
12
|
theming: {
|
|
13
13
|
state: {
|
|
14
14
|
currentTheme: import("@omnia/fx-models").ThemeDefinitionV2;
|
|
@@ -17,12 +17,13 @@ export declare class VelcronRenderers {
|
|
|
17
17
|
colorSchema: (schema: string) => import("@omnia/fx-models").ColorSchema;
|
|
18
18
|
typography: (name: string) => import("@omnia/fx-models").TypographyType;
|
|
19
19
|
color: (schemaName: string, colorType: string) => string;
|
|
20
|
+
complementaryColor: (colorType: string) => string;
|
|
20
21
|
};
|
|
21
22
|
actions: {
|
|
22
23
|
setTheme(newTheme: import("@omnia/fx-models").ThemeDefinitionV2): void;
|
|
23
24
|
};
|
|
24
25
|
};
|
|
25
|
-
currentContext:
|
|
26
|
+
currentContext: VelcronState;
|
|
26
27
|
actions: {
|
|
27
28
|
[name: string]: [];
|
|
28
29
|
};
|
|
@@ -32,5 +33,5 @@ export declare class VelcronRenderers {
|
|
|
32
33
|
[name: string]: [];
|
|
33
34
|
};
|
|
34
35
|
};
|
|
35
|
-
static ensureRenderContext(rendererInfo: ResolvedComponentRenderer, definition: VelcronDefinition, currentRenderCtx: VelcronRenderContext, newViewModel?:
|
|
36
|
+
static ensureRenderContext(rendererInfo: ResolvedComponentRenderer, definition: VelcronDefinition, currentRenderCtx: VelcronRenderContext, newViewModel?: VelcronState): VelcronRenderContext;
|
|
36
37
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { VelcronDefinition, VelcronRenderContext } from "../models";
|
|
1
|
+
import { VelcronBorder, VelcronCustomThemeSettings, VelcronDefinition, VelcronDimensions, VelcronRenderContext } from "../models";
|
|
2
2
|
import { VelcronUnitProvider } from "../models/VelcronUnitProvider";
|
|
3
3
|
export declare class VelcronStyles {
|
|
4
4
|
static styleProvider: (baseStyles: object, definition: VelcronDefinition, renderCtx: VelcronRenderContext) => any;
|
|
5
5
|
static unitProvider: VelcronUnitProvider;
|
|
6
6
|
static registerStyleProvider(fn: (styleBase: object, definition: VelcronDefinition, renderCtx: VelcronRenderContext) => object | string, unitProvider: VelcronUnitProvider): void;
|
|
7
|
+
static insertBackgroundColor(styleBase: any, definition: VelcronCustomThemeSettings, renderCtx: VelcronRenderContext): void;
|
|
8
|
+
static insertBorderRadiusStyles(styleBase: any, settings: VelcronDimensions): void;
|
|
9
|
+
static insertBorderStyles(styleBase: any, borderSettings: VelcronBorder, renderCtx: VelcronRenderContext): void;
|
|
7
10
|
static create(definition: VelcronDefinition, renderCtx: VelcronRenderContext): object | string;
|
|
8
11
|
static dataBindStyles(styles: object, renderCtx: VelcronRenderContext): object;
|
|
9
12
|
}
|
package/parser/VelcronStyles.js
CHANGED
|
@@ -10,18 +10,66 @@ class VelcronStyles {
|
|
|
10
10
|
VelcronStyles.styleProvider = fn;
|
|
11
11
|
VelcronStyles.unitProvider = unitProvider;
|
|
12
12
|
}
|
|
13
|
+
static insertBackgroundColor(styleBase, definition, renderCtx) {
|
|
14
|
+
if (definition.colorSchema && definition.colorSchema != "") {
|
|
15
|
+
//styleBase["backgroundColor"] = renderCtx.theming.get.activeColorSchema().base.color;
|
|
16
|
+
styleBase["backgroundColor"] = renderCtx.colorSchema.base.color;
|
|
17
|
+
}
|
|
18
|
+
if (definition.opacity || definition.opacity === 0) {
|
|
19
|
+
if (definition.opacity === 0) {
|
|
20
|
+
styleBase["backgroundColor"] = undefined;
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
styleBase["backgroundColor"] = (0, utilities_1.useOpacityOnColor)(styleBase["backgroundColor"], definition.opacity / 100);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
static insertBorderRadiusStyles(styleBase, settings) {
|
|
28
|
+
if (!settings) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (settings.top || settings.top === 0) {
|
|
32
|
+
styleBase["borderTopLeftRadius"] = this.unitProvider.formatDimension(settings.top);
|
|
33
|
+
}
|
|
34
|
+
if (settings.right || settings.right === 0) {
|
|
35
|
+
styleBase["borderTopRightRadius"] = this.unitProvider.formatDimension(settings.right);
|
|
36
|
+
}
|
|
37
|
+
if (settings.bottom || settings.bottom === 0) {
|
|
38
|
+
styleBase["borderBottomRightRadius"] = this.unitProvider.formatDimension(settings.bottom);
|
|
39
|
+
}
|
|
40
|
+
if (settings.left || settings.left === 0) {
|
|
41
|
+
styleBase["borderBottomLeftRadius"] = this.unitProvider.formatDimension(settings.left);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
static insertBorderStyles(styleBase, borderSettings, renderCtx) {
|
|
45
|
+
if (!borderSettings) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (borderSettings.top || borderSettings.top === 0) {
|
|
49
|
+
styleBase["borderTopStyle"] = "solid";
|
|
50
|
+
styleBase["borderTopColor"] = renderCtx.theming.get.color(renderCtx.colorSchemaName, borderSettings.color);
|
|
51
|
+
}
|
|
52
|
+
if (borderSettings.right || borderSettings.right === 0) {
|
|
53
|
+
styleBase["borderRightStyle"] = "solid";
|
|
54
|
+
styleBase["borderRightColor"] = renderCtx.theming.get.color(renderCtx.colorSchemaName, borderSettings.color);
|
|
55
|
+
}
|
|
56
|
+
if (borderSettings.bottom || borderSettings.bottom === 0) {
|
|
57
|
+
styleBase["borderBottomStyle"] = "solid";
|
|
58
|
+
styleBase["borderBottomColor"] = renderCtx.theming.get.color(renderCtx.colorSchemaName, borderSettings.color);
|
|
59
|
+
}
|
|
60
|
+
if (borderSettings.left || borderSettings.left === 0) {
|
|
61
|
+
styleBase["borderLeftStyle"] = "solid";
|
|
62
|
+
styleBase["borderLeftColor"] = renderCtx.theming.get.color(renderCtx.colorSchemaName, borderSettings.color);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
13
65
|
static create(definition, renderCtx) {
|
|
14
66
|
const styleBase = { ...definition.style };
|
|
15
|
-
if (definition.
|
|
67
|
+
if (definition.type === VelcronConstants_1.VelcronConstants.components.image) {
|
|
16
68
|
const imageDefinition = definition;
|
|
17
|
-
if (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
styleBase["borderBottomRightRadius"] = this.unitProvider.formatDimension(imageDefinition.borderRadius.bottom);
|
|
21
|
-
styleBase["borderBottomLeftRadius"] = this.unitProvider.formatDimension(imageDefinition.borderRadius.left);
|
|
69
|
+
if (renderCtx.theming.state.currentTheme.blueprint?.image?.borderRadius) {
|
|
70
|
+
const settings = renderCtx.theming.state.currentTheme.blueprint.image.borderRadius;
|
|
71
|
+
this.insertBorderRadiusStyles(styleBase, settings);
|
|
22
72
|
}
|
|
23
|
-
}
|
|
24
|
-
if (definition.type === VelcronConstants_1.VelcronConstants.components.image) {
|
|
25
73
|
// if (styleBase.width) {
|
|
26
74
|
// styleBase.width = this.unitProvider.formatDimension(200);
|
|
27
75
|
// }
|
|
@@ -29,6 +77,18 @@ class VelcronStyles {
|
|
|
29
77
|
// styleBase.height = this.unitProvider.formatDimension(400);
|
|
30
78
|
// }
|
|
31
79
|
}
|
|
80
|
+
if (definition.type === VelcronConstants_1.VelcronConstants.components.card) {
|
|
81
|
+
const cardDefinition = definition;
|
|
82
|
+
if (renderCtx.theming.state.currentTheme.blueprint?.card?.borderRadius) {
|
|
83
|
+
const settings = renderCtx.theming.state.currentTheme.blueprint.card.borderRadius;
|
|
84
|
+
this.insertBorderRadiusStyles(styleBase, settings);
|
|
85
|
+
}
|
|
86
|
+
if (renderCtx.theming.state.currentTheme.blueprint?.card?.border) {
|
|
87
|
+
const settings = renderCtx.theming.state.currentTheme.blueprint.card.border;
|
|
88
|
+
this.insertBorderStyles(styleBase, settings, renderCtx);
|
|
89
|
+
}
|
|
90
|
+
this.insertBackgroundColor(styleBase, cardDefinition, renderCtx);
|
|
91
|
+
}
|
|
32
92
|
else if (definition.type === VelcronConstants_1.VelcronConstants.components.text) {
|
|
33
93
|
const textDefinition = definition;
|
|
34
94
|
if (textDefinition.color) {
|
|
@@ -67,27 +127,21 @@ class VelcronStyles {
|
|
|
67
127
|
else {
|
|
68
128
|
styleBase[propertyName] = "flex-start";
|
|
69
129
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
styleBase
|
|
85
|
-
styleBase["borderBottomStyle"] = "solid";
|
|
86
|
-
styleBase["borderLeftStyle"] = "solid";
|
|
87
|
-
styleBase["borderTopColor"] = renderCtx.theming.get.color(renderCtx.colorSchemaName, flexViewDefinition.border.color);
|
|
88
|
-
styleBase["borderRightColor"] = renderCtx.theming.get.color(renderCtx.colorSchemaName, flexViewDefinition.border.color);
|
|
89
|
-
styleBase["borderBottomColor"] = renderCtx.theming.get.color(renderCtx.colorSchemaName, flexViewDefinition.border.color);
|
|
90
|
-
styleBase["borderLeftColor"] = renderCtx.theming.get.color(renderCtx.colorSchemaName, flexViewDefinition.border.color);
|
|
130
|
+
this.insertBackgroundColor(styleBase, flexViewDefinition, renderCtx);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
*
|
|
134
|
+
* Generic styles for all components
|
|
135
|
+
*
|
|
136
|
+
*/
|
|
137
|
+
if (definition.border) {
|
|
138
|
+
const typedDefinition = definition;
|
|
139
|
+
this.insertBorderStyles(styleBase, typedDefinition.border, renderCtx);
|
|
140
|
+
}
|
|
141
|
+
if (definition.borderRadius) {
|
|
142
|
+
const typedDefinition = definition;
|
|
143
|
+
if (typedDefinition.borderRadius) {
|
|
144
|
+
this.insertBorderRadiusStyles(styleBase, typedDefinition.borderRadius);
|
|
91
145
|
}
|
|
92
146
|
}
|
|
93
147
|
return VelcronStyles.styleProvider(styleBase, definition, renderCtx);
|
|
@@ -7,6 +7,7 @@ export declare const useVelcronThemingStore: (newStateWithName?: string) => {
|
|
|
7
7
|
colorSchema: (schema: string) => import("..").ColorSchema;
|
|
8
8
|
typography: (name: string) => TypographyType;
|
|
9
9
|
color: (schemaName: string, colorType: string) => string;
|
|
10
|
+
complementaryColor: (colorType: string) => string;
|
|
10
11
|
};
|
|
11
12
|
actions: {
|
|
12
13
|
setTheme(newTheme: ThemeDefinitionV2): void;
|
package/stores/VelcronTheming.js
CHANGED
|
@@ -60,6 +60,25 @@ exports.useVelcronThemingStore = (0, VelcronStore_1.defineVelcronStore)("Velcron
|
|
|
60
60
|
}
|
|
61
61
|
return state.currentTheme.typography.text;
|
|
62
62
|
};
|
|
63
|
+
const complementaryColor = (colorType) => {
|
|
64
|
+
if (colorType === __1.ColorTypes.base
|
|
65
|
+
|| colorType === __1.ColorTypes.baseTone) {
|
|
66
|
+
return __1.ColorTypes.onBase;
|
|
67
|
+
}
|
|
68
|
+
else if (colorType === __1.ColorTypes.onBase
|
|
69
|
+
|| colorType === __1.ColorTypes.onBaseTone) {
|
|
70
|
+
return __1.ColorTypes.base;
|
|
71
|
+
}
|
|
72
|
+
else if (colorType === __1.ColorTypes.container
|
|
73
|
+
|| colorType === __1.ColorTypes.containerTone) {
|
|
74
|
+
return __1.ColorTypes.onContainer;
|
|
75
|
+
}
|
|
76
|
+
else if (colorType === __1.ColorTypes.onContainer
|
|
77
|
+
|| colorType === __1.ColorTypes.onContainerTone) {
|
|
78
|
+
return __1.ColorTypes.container;
|
|
79
|
+
}
|
|
80
|
+
return colorType;
|
|
81
|
+
};
|
|
63
82
|
const color = (schemaName, colorType) => {
|
|
64
83
|
const mappedColorSchema = colorSchema(schemaName);
|
|
65
84
|
if (colorType === __1.ColorTypes.base) {
|
|
@@ -91,7 +110,8 @@ exports.useVelcronThemingStore = (0, VelcronStore_1.defineVelcronStore)("Velcron
|
|
|
91
110
|
return {
|
|
92
111
|
colorSchema,
|
|
93
112
|
typography,
|
|
94
|
-
color
|
|
113
|
+
color,
|
|
114
|
+
complementaryColor
|
|
95
115
|
};
|
|
96
116
|
},
|
|
97
117
|
actions(state) {
|