@uni-design-system/uni-core 0.0.28 → 0.0.30
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/cjs/core/color/color.helper.d.ts +4 -2
- package/dist/cjs/core/color/color.helper.js +23 -4
- package/dist/cjs/core/color/color.helper.js.map +1 -1
- package/dist/cjs/core/color/color.model.d.ts +14 -3
- package/dist/cjs/core/color/color.types.d.ts +1 -1
- package/dist/cjs/core/color/index.d.ts +1 -0
- package/dist/cjs/core/color/index.js +1 -0
- package/dist/cjs/core/color/index.js.map +1 -1
- package/dist/cjs/core/theme/themes/square.theme.d.ts +2 -0
- package/dist/cjs/core/theme/themes/square.theme.js +21 -0
- package/dist/cjs/core/theme/themes/square.theme.js.map +1 -0
- package/dist/esm/core/color/color.helper.d.ts +4 -2
- package/dist/esm/core/color/color.helper.js +19 -2
- package/dist/esm/core/color/color.helper.js.map +1 -1
- package/dist/esm/core/color/color.model.d.ts +14 -3
- package/dist/esm/core/color/color.types.d.ts +1 -1
- package/dist/esm/core/color/index.d.ts +1 -0
- package/dist/esm/core/color/index.js +1 -0
- package/dist/esm/core/color/index.js.map +1 -1
- package/dist/esm/core/theme/themes/square.theme.d.ts +2 -0
- package/dist/esm/core/theme/themes/square.theme.js +18 -0
- package/dist/esm/core/theme/themes/square.theme.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import { HSLA, UniColor } from './color.model';
|
|
2
|
-
export declare function
|
|
1
|
+
import { HSL, HSLA, RGB, UniColor } from './color.model';
|
|
2
|
+
export declare function HSLAToString({ hue, saturation, lightness, alpha }: HSLA): string;
|
|
3
|
+
export declare function RGBToString({ red, green, blue }: RGB): string;
|
|
3
4
|
export declare function uniColor({ role, category, alpha }: UniColor): string;
|
|
5
|
+
export declare const RGBToHSL: ({ red, green, blue }: RGB) => HSL;
|
|
@@ -1,17 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.uniColor = exports.
|
|
3
|
+
exports.RGBToHSL = exports.uniColor = exports.RGBToString = exports.HSLAToString = void 0;
|
|
4
4
|
const color_records_1 = require("./color.records");
|
|
5
5
|
const color_utils_1 = require("./color.utils");
|
|
6
|
-
function
|
|
6
|
+
function HSLAToString({ hue, saturation, lightness, alpha = 1 }) {
|
|
7
7
|
return `hsla(${hue}, ${saturation}%, ${lightness}%, ${alpha})`;
|
|
8
8
|
}
|
|
9
|
-
exports.
|
|
9
|
+
exports.HSLAToString = HSLAToString;
|
|
10
|
+
function RGBToString({ red, green, blue }) {
|
|
11
|
+
return `rgb(${red}, ${green}, ${blue})`;
|
|
12
|
+
}
|
|
13
|
+
exports.RGBToString = RGBToString;
|
|
10
14
|
function uniColor({ role, category, alpha = 1 }) {
|
|
11
15
|
const hue = (0, color_utils_1.randomRangeValue)(color_records_1.RoleHues[role]);
|
|
12
16
|
const saturation = (0, color_utils_1.randomRangeValue)(color_records_1.CategorySaturation[category]);
|
|
13
17
|
const lightness = (0, color_utils_1.randomRangeValue)(color_records_1.CategoryLightness[category]);
|
|
14
|
-
return
|
|
18
|
+
return HSLAToString({ hue, saturation, lightness, alpha });
|
|
15
19
|
}
|
|
16
20
|
exports.uniColor = uniColor;
|
|
21
|
+
const RGBToHSL = ({ red, green, blue }) => {
|
|
22
|
+
red /= 255;
|
|
23
|
+
green /= 255;
|
|
24
|
+
blue /= 255;
|
|
25
|
+
const l = Math.max(red, green, blue);
|
|
26
|
+
const s = l - Math.min(red, green, blue);
|
|
27
|
+
const h = s ? (l === red ? (green - blue) / s : l === green ? 2 + (blue - red) / s : 4 + (red - green) / s) : 0;
|
|
28
|
+
return {
|
|
29
|
+
hue: 60 * h < 0 ? 60 * h + 360 : 60 * h,
|
|
30
|
+
saturation: 100 * (s ? (l <= 0.5 ? s / (2 * l - s) : s / (2 - (2 * l - s))) : 0),
|
|
31
|
+
lightness: (100 * (2 * l - s)) / 2,
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
exports.RGBToHSL = RGBToHSL;
|
|
35
|
+
// Future Methods - https://codepen.io/jkantner/pen/VVEMRK
|
|
17
36
|
//# sourceMappingURL=color.helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color.helper.js","sourceRoot":"","sources":["../../../../src/core/color/color.helper.ts"],"names":[],"mappings":";;;AACA,mDAAkF;AAClF,+CAAiD;AAEjD,SAAgB,YAAY,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,GAAG,CAAC,EAAQ;IAC1E,OAAO,QAAQ,GAAG,KAAK,UAAU,MAAM,SAAS,MAAM,KAAK,GAAG,CAAC;AACjE,CAAC;AAFD,oCAEC;AAED,SAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,GAAG,CAAC,EAAY;IAC9D,MAAM,GAAG,GAAG,IAAA,8BAAgB,EAAC,wBAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7C,MAAM,UAAU,GAAG,IAAA,8BAAgB,EAAC,kCAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC;IAClE,MAAM,SAAS,GAAG,IAAA,8BAAgB,EAAC,iCAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEhE,OAAO,YAAY,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;AAC7D,CAAC;AAND,4BAMC"}
|
|
1
|
+
{"version":3,"file":"color.helper.js","sourceRoot":"","sources":["../../../../src/core/color/color.helper.ts"],"names":[],"mappings":";;;AACA,mDAAkF;AAClF,+CAAiD;AAEjD,SAAgB,YAAY,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,GAAG,CAAC,EAAQ;IAC1E,OAAO,QAAQ,GAAG,KAAK,UAAU,MAAM,SAAS,MAAM,KAAK,GAAG,CAAC;AACjE,CAAC;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AC,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAChH,OAAO;QACL,GAAG,EAAE,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;QACvC,UAAU,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAChF,SAAS,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;KACnC,CAAC;AACJ,CAAC,CAAC;AAZW,QAAA,QAAQ,YAYnB;AAEF,0DAA0D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColorCategory, ColorRole, ColorScheme,
|
|
1
|
+
import { ColorCategory, ColorRole, ColorScheme, ColorStyles } from './color.types';
|
|
2
2
|
export interface UniColor {
|
|
3
3
|
scheme: ColorScheme;
|
|
4
4
|
role: ColorRole;
|
|
@@ -9,7 +9,7 @@ export interface Color {
|
|
|
9
9
|
scheme?: ColorScheme;
|
|
10
10
|
role?: ColorRole;
|
|
11
11
|
category?: ColorCategory;
|
|
12
|
-
style?:
|
|
12
|
+
style?: ColorStyles;
|
|
13
13
|
GradientPosition?: GradientPosition;
|
|
14
14
|
saturationRange?: Range;
|
|
15
15
|
brightnessRangeMap?: Range;
|
|
@@ -26,9 +26,20 @@ export interface Range {
|
|
|
26
26
|
high: number;
|
|
27
27
|
default?: number;
|
|
28
28
|
}
|
|
29
|
-
export interface
|
|
29
|
+
export interface HSL {
|
|
30
30
|
hue?: number;
|
|
31
31
|
saturation?: number;
|
|
32
32
|
lightness?: number;
|
|
33
33
|
alpha?: number;
|
|
34
34
|
}
|
|
35
|
+
export interface HSLA extends HSL {
|
|
36
|
+
alpha?: number;
|
|
37
|
+
}
|
|
38
|
+
export interface RGB {
|
|
39
|
+
red: number;
|
|
40
|
+
green: number;
|
|
41
|
+
blue: number;
|
|
42
|
+
}
|
|
43
|
+
export interface RGBA extends RGB {
|
|
44
|
+
alpha: number;
|
|
45
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare type ColorScheme = 'monochromatic' | 'analogous' | 'complimentary' | 'splitComplimentary' | 'triadic';
|
|
2
2
|
export declare type ColorCategory = 'jewel' | 'pastel' | 'earth' | 'neutral' | 'florescent' | 'shades';
|
|
3
|
-
export declare type
|
|
3
|
+
export declare type ColorStyles = 'solid' | 'transparent' | 'gradient';
|
|
4
4
|
export declare type ColorOutput = 'HEX' | 'RGB' | 'RGBA' | 'HSL' | 'HSLA';
|
|
5
5
|
export declare type ColorModes = 'base' | 'hover' | 'active' | 'disabled';
|
|
6
6
|
export declare type ColorRole = 'primary' | 'secondary' | 'tertiary' | 'inverse' | 'ghost';
|
|
@@ -18,4 +18,5 @@ __exportStar(require("./color.helper"), exports);
|
|
|
18
18
|
__exportStar(require("./color.model"), exports);
|
|
19
19
|
__exportStar(require("./color.types"), exports);
|
|
20
20
|
__exportStar(require("./color.records"), exports);
|
|
21
|
+
__exportStar(require("./color.utils"), exports);
|
|
21
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/color/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,gDAA8B;AAC9B,gDAA8B;AAC9B,kDAAgC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/color/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,gDAA8B;AAC9B,gDAA8B;AAC9B,kDAAgC;AAChC,gDAA8B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SquareTheme = void 0;
|
|
4
|
+
const base_theme_1 = require("./base.theme");
|
|
5
|
+
const SquareBaseButton = {
|
|
6
|
+
borderRadius: 3,
|
|
7
|
+
color: 'primary-container',
|
|
8
|
+
contentColor: 'on-primary-container',
|
|
9
|
+
verticalPadding: { xs: 5, sm: 8, md: 12, lg: 16, xl: 20 },
|
|
10
|
+
horizontalPadding: { xs: 8, sm: 12, md: 18, lg: 24, xl: 30 },
|
|
11
|
+
};
|
|
12
|
+
exports.SquareTheme = Object.assign(Object.assign({}, base_theme_1.BaseTheme), { id: 'SquareTheme', name: 'Square Theme', buttons: {
|
|
13
|
+
elevated: Object.assign(Object.assign({}, SquareBaseButton), { color: 'surface', contentColor: 'on-surface', shadowElevation: 'raised' }),
|
|
14
|
+
filled: Object.assign(Object.assign({}, SquareBaseButton), { color: 'primary' }),
|
|
15
|
+
'filled-secondary': Object.assign(Object.assign({}, SquareBaseButton), { color: 'secondary', contentColor: 'on-secondary' }),
|
|
16
|
+
outlined: Object.assign(Object.assign({}, SquareBaseButton), { color: 'transparent', borderColor: 'primary', contentColor: 'on-primary', borderWidth: 1 }),
|
|
17
|
+
text: Object.assign(Object.assign({}, SquareBaseButton), { color: 'transparent', contentColor: 'on-surface' }),
|
|
18
|
+
icon: Object.assign(Object.assign({}, SquareBaseButton), { color: 'transparent', contentColor: 'on-surface' }),
|
|
19
|
+
'floating-action': Object.assign(Object.assign({}, SquareBaseButton), { color: 'secondary', contentColor: 'on-secondary', borderRadii: { xs: 5, sm: 8, md: 12, lg: 16, xl: 12 }, shadowElevation: 'navigation', verticalPadding: { xs: 8, sm: 12, md: 18, lg: 24, xl: 30 }, horizontalPadding: { xs: 8, sm: 12, md: 18, lg: 24, xl: 30 } }),
|
|
20
|
+
} });
|
|
21
|
+
//# sourceMappingURL=square.theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"square.theme.js","sourceRoot":"","sources":["../../../../../src/core/theme/themes/square.theme.ts"],"names":[],"mappings":";;;AACA,6CAAyC;AAGzC,MAAM,gBAAgB,GAAW;IAC/B,YAAY,EAAE,CAAC;IACf,KAAK,EAAE,mBAAmB;IAC1B,YAAY,EAAE,sBAAsB;IACpC,eAAe,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;IACzD,iBAAiB,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;CAC7D,CAAC;AAEW,QAAA,WAAW,mCACnB,sBAAS,KACZ,EAAE,EAAE,aAAa,EACjB,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE;QACP,QAAQ,kCACH,gBAAgB,KACnB,KAAK,EAAE,SAAS,EAChB,YAAY,EAAE,YAAY,EAC1B,eAAe,EAAE,QAAQ,GAC1B;QACD,MAAM,kCACD,gBAAgB,KACnB,KAAK,EAAE,SAAS,GACjB;QACD,kBAAkB,kCACb,gBAAgB,KACnB,KAAK,EAAE,WAAW,EAClB,YAAY,EAAE,cAAc,GAC7B;QACD,QAAQ,kCACH,gBAAgB,KACnB,KAAK,EAAE,aAAa,EACpB,WAAW,EAAE,SAAS,EACtB,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,CAAC,GACf;QACD,IAAI,kCACC,gBAAgB,KACnB,KAAK,EAAE,aAAa,EACpB,YAAY,EAAE,YAAY,GAC3B;QACD,IAAI,kCACC,gBAAgB,KACnB,KAAK,EAAE,aAAa,EACpB,YAAY,EAAE,YAAY,GAC3B;QACD,iBAAiB,kCACZ,gBAAgB,KACnB,KAAK,EAAE,WAAW,EAClB,YAAY,EAAE,cAAc,EAC5B,WAAW,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EACrD,eAAe,EAAE,YAAY,EAC7B,eAAe,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAC1D,iBAAiB,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAC7D;KACF,IACD"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import { HSLA, UniColor } from './color.model';
|
|
2
|
-
export declare function
|
|
1
|
+
import { HSL, HSLA, RGB, UniColor } from './color.model';
|
|
2
|
+
export declare function HSLAToString({ hue, saturation, lightness, alpha }: HSLA): string;
|
|
3
|
+
export declare function RGBToString({ red, green, blue }: RGB): string;
|
|
3
4
|
export declare function uniColor({ role, category, alpha }: UniColor): string;
|
|
5
|
+
export declare const RGBToHSL: ({ red, green, blue }: RGB) => HSL;
|
|
@@ -1,12 +1,29 @@
|
|
|
1
1
|
import { CategoryLightness, CategorySaturation, RoleHues } from './color.records';
|
|
2
2
|
import { randomRangeValue } from './color.utils';
|
|
3
|
-
export function
|
|
3
|
+
export function HSLAToString({ hue, saturation, lightness, alpha = 1 }) {
|
|
4
4
|
return `hsla(${hue}, ${saturation}%, ${lightness}%, ${alpha})`;
|
|
5
5
|
}
|
|
6
|
+
export function RGBToString({ red, green, blue }) {
|
|
7
|
+
return `rgb(${red}, ${green}, ${blue})`;
|
|
8
|
+
}
|
|
6
9
|
export function uniColor({ role, category, alpha = 1 }) {
|
|
7
10
|
const hue = randomRangeValue(RoleHues[role]);
|
|
8
11
|
const saturation = randomRangeValue(CategorySaturation[category]);
|
|
9
12
|
const lightness = randomRangeValue(CategoryLightness[category]);
|
|
10
|
-
return
|
|
13
|
+
return HSLAToString({ hue, saturation, lightness, alpha });
|
|
11
14
|
}
|
|
15
|
+
export const RGBToHSL = ({ red, green, blue }) => {
|
|
16
|
+
red /= 255;
|
|
17
|
+
green /= 255;
|
|
18
|
+
blue /= 255;
|
|
19
|
+
const l = Math.max(red, green, blue);
|
|
20
|
+
const s = l - Math.min(red, green, blue);
|
|
21
|
+
const h = s ? (l === red ? (green - blue) / s : l === green ? 2 + (blue - red) / s : 4 + (red - green) / s) : 0;
|
|
22
|
+
return {
|
|
23
|
+
hue: 60 * h < 0 ? 60 * h + 360 : 60 * h,
|
|
24
|
+
saturation: 100 * (s ? (l <= 0.5 ? s / (2 * l - s) : s / (2 - (2 * l - s))) : 0),
|
|
25
|
+
lightness: (100 * (2 * l - s)) / 2,
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
// Future Methods - https://codepen.io/jkantner/pen/VVEMRK
|
|
12
29
|
//# sourceMappingURL=color.helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color.helper.js","sourceRoot":"","sources":["../../../../src/core/color/color.helper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,UAAU,YAAY,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,GAAG,CAAC,EAAQ;IAC1E,OAAO,QAAQ,GAAG,KAAK,UAAU,MAAM,SAAS,MAAM,KAAK,GAAG,CAAC;AACjE,CAAC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GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAChF,SAAS,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;KACnC,CAAC;AACJ,CAAC,CAAC;AAEF,0DAA0D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColorCategory, ColorRole, ColorScheme,
|
|
1
|
+
import { ColorCategory, ColorRole, ColorScheme, ColorStyles } from './color.types';
|
|
2
2
|
export interface UniColor {
|
|
3
3
|
scheme: ColorScheme;
|
|
4
4
|
role: ColorRole;
|
|
@@ -9,7 +9,7 @@ export interface Color {
|
|
|
9
9
|
scheme?: ColorScheme;
|
|
10
10
|
role?: ColorRole;
|
|
11
11
|
category?: ColorCategory;
|
|
12
|
-
style?:
|
|
12
|
+
style?: ColorStyles;
|
|
13
13
|
GradientPosition?: GradientPosition;
|
|
14
14
|
saturationRange?: Range;
|
|
15
15
|
brightnessRangeMap?: Range;
|
|
@@ -26,9 +26,20 @@ export interface Range {
|
|
|
26
26
|
high: number;
|
|
27
27
|
default?: number;
|
|
28
28
|
}
|
|
29
|
-
export interface
|
|
29
|
+
export interface HSL {
|
|
30
30
|
hue?: number;
|
|
31
31
|
saturation?: number;
|
|
32
32
|
lightness?: number;
|
|
33
33
|
alpha?: number;
|
|
34
34
|
}
|
|
35
|
+
export interface HSLA extends HSL {
|
|
36
|
+
alpha?: number;
|
|
37
|
+
}
|
|
38
|
+
export interface RGB {
|
|
39
|
+
red: number;
|
|
40
|
+
green: number;
|
|
41
|
+
blue: number;
|
|
42
|
+
}
|
|
43
|
+
export interface RGBA extends RGB {
|
|
44
|
+
alpha: number;
|
|
45
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare type ColorScheme = 'monochromatic' | 'analogous' | 'complimentary' | 'splitComplimentary' | 'triadic';
|
|
2
2
|
export declare type ColorCategory = 'jewel' | 'pastel' | 'earth' | 'neutral' | 'florescent' | 'shades';
|
|
3
|
-
export declare type
|
|
3
|
+
export declare type ColorStyles = 'solid' | 'transparent' | 'gradient';
|
|
4
4
|
export declare type ColorOutput = 'HEX' | 'RGB' | 'RGBA' | 'HSL' | 'HSLA';
|
|
5
5
|
export declare type ColorModes = 'base' | 'hover' | 'active' | 'disabled';
|
|
6
6
|
export declare type ColorRole = 'primary' | 'secondary' | 'tertiary' | 'inverse' | 'ghost';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/color/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/color/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseTheme } from './base.theme';
|
|
2
|
+
const SquareBaseButton = {
|
|
3
|
+
borderRadius: 3,
|
|
4
|
+
color: 'primary-container',
|
|
5
|
+
contentColor: 'on-primary-container',
|
|
6
|
+
verticalPadding: { xs: 5, sm: 8, md: 12, lg: 16, xl: 20 },
|
|
7
|
+
horizontalPadding: { xs: 8, sm: 12, md: 18, lg: 24, xl: 30 },
|
|
8
|
+
};
|
|
9
|
+
export const SquareTheme = Object.assign(Object.assign({}, BaseTheme), { id: 'SquareTheme', name: 'Square Theme', buttons: {
|
|
10
|
+
elevated: Object.assign(Object.assign({}, SquareBaseButton), { color: 'surface', contentColor: 'on-surface', shadowElevation: 'raised' }),
|
|
11
|
+
filled: Object.assign(Object.assign({}, SquareBaseButton), { color: 'primary' }),
|
|
12
|
+
'filled-secondary': Object.assign(Object.assign({}, SquareBaseButton), { color: 'secondary', contentColor: 'on-secondary' }),
|
|
13
|
+
outlined: Object.assign(Object.assign({}, SquareBaseButton), { color: 'transparent', borderColor: 'primary', contentColor: 'on-primary', borderWidth: 1 }),
|
|
14
|
+
text: Object.assign(Object.assign({}, SquareBaseButton), { color: 'transparent', contentColor: 'on-surface' }),
|
|
15
|
+
icon: Object.assign(Object.assign({}, SquareBaseButton), { color: 'transparent', contentColor: 'on-surface' }),
|
|
16
|
+
'floating-action': Object.assign(Object.assign({}, SquareBaseButton), { color: 'secondary', contentColor: 'on-secondary', borderRadii: { xs: 5, sm: 8, md: 12, lg: 16, xl: 12 }, shadowElevation: 'navigation', verticalPadding: { xs: 8, sm: 12, md: 18, lg: 24, xl: 30 }, horizontalPadding: { xs: 8, sm: 12, md: 18, lg: 24, xl: 30 } }),
|
|
17
|
+
} });
|
|
18
|
+
//# sourceMappingURL=square.theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"square.theme.js","sourceRoot":"","sources":["../../../../../src/core/theme/themes/square.theme.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,MAAM,gBAAgB,GAAW;IAC/B,YAAY,EAAE,CAAC;IACf,KAAK,EAAE,mBAAmB;IAC1B,YAAY,EAAE,sBAAsB;IACpC,eAAe,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;IACzD,iBAAiB,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;CAC7D,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,mCACnB,SAAS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