@omnia/velcron 8.0.127-dev → 8.0.128-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/Blueprints.d.ts +0 -6
- package/internal-do-not-import-from-here/shared/models/theming/ThemeDefinitionV2.d.ts +6 -4
- package/internal-do-not-import-from-here/shared/models/theming/UseThemeMethods.d.ts +0 -2
- package/internal-do-not-import-from-here/shared/models/theming/UseThemeMethods.js +0 -4
- package/package.json +1 -1
- package/stores/VelcronColorSchema.d.ts +1 -1
- package/stores/VelcronTheming.d.ts +3 -3
- package/stores/VelcronTheming.js +4 -4
|
@@ -5,31 +5,25 @@ import { TypographyValue } from "./Typography";
|
|
|
5
5
|
export interface BoxDimensions extends Spacing {
|
|
6
6
|
}
|
|
7
7
|
import { TypographyBlueprint } from "./Typography";
|
|
8
|
-
export type BlueprintType = "chrome" | "typography" | "spacing" | "component";
|
|
9
8
|
export interface Blueprints {
|
|
10
|
-
type: BlueprintType;
|
|
11
9
|
name?: string;
|
|
12
10
|
}
|
|
13
11
|
export type BlueprintVariant = "primary" | "secondary" | "variant1" | "variant2" | "variant3";
|
|
14
12
|
export type ButtonBlueprintType = "text" | "icon";
|
|
15
13
|
export interface ChromeBlueprints extends Blueprints {
|
|
16
|
-
type: "chrome";
|
|
17
14
|
primary: ChromeBlueprint;
|
|
18
15
|
variant1?: ChromeBlueprint;
|
|
19
16
|
variant2?: ChromeBlueprint;
|
|
20
17
|
variant3?: ChromeBlueprint;
|
|
21
18
|
}
|
|
22
19
|
export interface TypographyBlueprints extends Blueprints {
|
|
23
|
-
type: "typography";
|
|
24
20
|
primary: TypographyBlueprint;
|
|
25
21
|
}
|
|
26
22
|
export interface SpacingBlueprints extends Blueprints {
|
|
27
|
-
type: "spacing";
|
|
28
23
|
primary: SpacingBlueprint;
|
|
29
24
|
}
|
|
30
25
|
export type ButtonTypes = "primary" | "basic" | "accent1" | "warn" | "disabled" | "link";
|
|
31
26
|
export interface ComponentBlueprints extends Blueprints {
|
|
32
|
-
type: "component";
|
|
33
27
|
buttons?: {
|
|
34
28
|
text?: {
|
|
35
29
|
primary?: ButtonBlueprint;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Guid } from "../Guid";
|
|
2
|
-
import {
|
|
2
|
+
import { BoxDimensions, ChromeBlueprints, ComponentBlueprints, SpacingBlueprints, TypographyBlueprints } from "./Blueprints";
|
|
3
3
|
export interface ColorTypeResult<resultType> {
|
|
4
4
|
base: resultType;
|
|
5
5
|
baseTone: resultType;
|
|
@@ -41,10 +41,12 @@ export interface ColorSchemas {
|
|
|
41
41
|
}
|
|
42
42
|
export interface ThemeDefinitionV2 {
|
|
43
43
|
id: Guid;
|
|
44
|
-
name
|
|
45
|
-
dark: boolean;
|
|
44
|
+
name?: string;
|
|
46
45
|
colors: ColorSchemas;
|
|
47
|
-
|
|
46
|
+
typography: TypographyBlueprints;
|
|
47
|
+
spacing: SpacingBlueprints;
|
|
48
|
+
chrome: ChromeBlueprints;
|
|
49
|
+
components: ComponentBlueprints;
|
|
48
50
|
}
|
|
49
51
|
export type ColorSchemaType = keyof typeof ColorSchemaTypes;
|
|
50
52
|
export declare enum ColorSchemaTypes {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { ColorDefinition, ColorSchema, ColorSchemaType, ColorSchemaTypes, ColorType, ColorTypes } from "./ThemeDefinitionV2";
|
|
2
|
-
import { Blueprints, BlueprintType } from "./Blueprints";
|
|
3
2
|
export declare function useThemeMethods(getThemeDefinition: () => any): {
|
|
4
3
|
colorSchema: (colorSchemaType: ColorSchemaTypes | ColorSchemaType) => ColorSchema;
|
|
5
|
-
bluePrintbyType: <TType extends Blueprints>(type: BlueprintType) => TType;
|
|
6
4
|
color: (colorSchemaType: ColorSchemaTypes | ColorSchemaType, colorType: ColorTypes | ColorType) => string;
|
|
7
5
|
colorDefinition: (colorSchemaType: ColorSchemaTypes | ColorSchemaType, colorType: ColorTypes | ColorType) => ColorDefinition;
|
|
8
6
|
complementaryColorType: (colorType: ColorTypes | ColorType) => ColorTypes;
|
|
@@ -5,9 +5,6 @@ exports.useThemeMethods = void 0;
|
|
|
5
5
|
const ThemeDefinitionV2_1 = require("./ThemeDefinitionV2");
|
|
6
6
|
// temp change ThemeDefinitionInstance to any because fx/shared can't reference higher level fx/ux
|
|
7
7
|
function useThemeMethods(getThemeDefinition) {
|
|
8
|
-
function bluePrintbyType(type) {
|
|
9
|
-
return getThemeDefinition().blueprints.find(x => x.type === type);
|
|
10
|
-
}
|
|
11
8
|
function colorSchema(colorSchemaType) {
|
|
12
9
|
if (colorSchemaType === ThemeDefinitionV2_1.ColorSchemaTypes.primary) {
|
|
13
10
|
return getThemeDefinition().colors.primary;
|
|
@@ -92,7 +89,6 @@ function useThemeMethods(getThemeDefinition) {
|
|
|
92
89
|
}
|
|
93
90
|
return {
|
|
94
91
|
colorSchema,
|
|
95
|
-
bluePrintbyType,
|
|
96
92
|
color,
|
|
97
93
|
colorDefinition,
|
|
98
94
|
complementaryColorType,
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@ export declare const useVelcronColorSchemaStore: (newStateWithName?: string) =>
|
|
|
14
14
|
currentTheme: import("@omnia/fx-models").ThemeDefinitionV2;
|
|
15
15
|
};
|
|
16
16
|
get: {
|
|
17
|
-
componentBlueprints: (
|
|
17
|
+
componentBlueprints: () => void;
|
|
18
18
|
colorSchema: (colorSchemaType: "info" | "error" | ColorSchemaTypes | "primary" | "secondary" | "accent1" | "accent2" | "accent3" | "neutral" | "background" | "dynamic") => ColorSchema;
|
|
19
19
|
spacing: () => import("@omnia/fx-models").SpacingDefinition;
|
|
20
20
|
typography: (typographyType: "title" | "text" | "navigation" | import("@omnia/fx-models").TypographyTypes, size: "xs" | "s" | "m" | "l" | "xl" | import("@omnia/fx-models").TypographySizes) => any;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ColorSchemaType, ColorSchemaTypes, ColorType, ColorTypes,
|
|
1
|
+
import { ColorSchemaType, ColorSchemaTypes, ColorType, ColorTypes, ThemeDefinitionV2, TypographySize, TypographySizes, TypographyType, TypographyTypes } from "..";
|
|
2
2
|
export declare const useVelcronThemingStore: (newStateWithName?: string) => {
|
|
3
3
|
state: {
|
|
4
4
|
currentTheme: ThemeDefinitionV2;
|
|
5
5
|
};
|
|
6
6
|
get: {
|
|
7
|
-
componentBlueprints: (
|
|
7
|
+
componentBlueprints: () => void;
|
|
8
8
|
colorSchema: (colorSchemaType: ColorSchemaTypes | ColorSchemaType) => import("..").ColorSchema;
|
|
9
|
-
spacing: () => SpacingDefinition;
|
|
9
|
+
spacing: () => import("..").SpacingDefinition;
|
|
10
10
|
typography: (typographyType: TypographyTypes | TypographyType, size: TypographySizes | TypographySize) => any;
|
|
11
11
|
color: (colorSchemaType: ColorSchemaTypes | ColorSchemaType, colorType: ColorTypes | ColorType) => string;
|
|
12
12
|
colorDefinition: (colorSchemaType: ColorSchemaTypes | ColorSchemaType, colorType: ColorTypes | ColorType) => import("..").ColorDefinition;
|
package/stores/VelcronTheming.js
CHANGED
|
@@ -13,17 +13,17 @@ exports.useVelcronThemingStore = (0, _1.defineVelcronStore)("VelcronTheming", {
|
|
|
13
13
|
},
|
|
14
14
|
getters(state) {
|
|
15
15
|
return {
|
|
16
|
-
componentBlueprints: (
|
|
17
|
-
|
|
16
|
+
componentBlueprints: () => {
|
|
17
|
+
state.currentTheme.components;
|
|
18
18
|
},
|
|
19
19
|
colorSchema: (colorSchemaType) => {
|
|
20
20
|
return (0, __1.useThemeMethods)(() => state.currentTheme).colorSchema(colorSchemaType);
|
|
21
21
|
},
|
|
22
22
|
spacing: () => {
|
|
23
|
-
return
|
|
23
|
+
return state.currentTheme.spacing.primary.inner;
|
|
24
24
|
},
|
|
25
25
|
typography: (typographyType, size) => {
|
|
26
|
-
const typography =
|
|
26
|
+
const typography = state.currentTheme.typography.primary;
|
|
27
27
|
if (typographyType === __1.TypographyTypes.text) {
|
|
28
28
|
return typography.text[size];
|
|
29
29
|
}
|