@atb-as/theme 11.0.0-alpha.1 → 11.0.0-alpha.10
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/lib/index.js +18 -2
- package/lib/index.js.map +1 -1
- package/lib/theme.d.ts +177 -1517
- package/lib/theme.js +38 -19
- package/lib/theme.js.map +1 -1
- package/lib/themes/atb-theme/dark.d.ts +365 -672
- package/lib/themes/atb-theme/dark.js +361 -666
- package/lib/themes/atb-theme/dark.js.map +1 -1
- package/lib/themes/atb-theme/light.d.ts +365 -672
- package/lib/themes/atb-theme/light.js +361 -666
- package/lib/themes/atb-theme/light.js.map +1 -1
- package/lib/themes/atb-theme/theme.css +760 -0
- package/lib/themes/atb-theme/theme.d.ts +730 -1344
- package/lib/themes/atb-theme/theme.js +11 -6
- package/lib/themes/atb-theme/theme.js.map +1 -1
- package/lib/themes/atb-theme/theme.module.css +760 -0
- package/lib/themes/index.js +8 -1
- package/lib/themes/index.js.map +1 -1
- package/lib/themes-fs/atb-theme/dark.d.ts +722 -0
- package/lib/themes-fs/atb-theme/dark.js +724 -0
- package/lib/themes-fs/atb-theme/dark.js.map +1 -0
- package/lib/themes-fs/atb-theme/light.d.ts +722 -0
- package/lib/themes-fs/atb-theme/light.js +724 -0
- package/lib/themes-fs/atb-theme/light.js.map +1 -0
- package/lib/themes-fs/atb-theme/theme.d.ts +1442 -0
- package/lib/themes-fs/atb-theme/theme.js +16 -0
- package/lib/themes-fs/atb-theme/theme.js.map +1 -0
- package/lib/themes-fs/index.d.ts +1 -0
- package/lib/themes-fs/index.js +13 -0
- package/lib/themes-fs/index.js.map +1 -0
- package/lib/typography/android.js +32 -51
- package/lib/typography/android.js.map +1 -1
- package/lib/typography/index.d.ts +3 -3
- package/lib/typography/index.js +44 -19
- package/lib/typography/index.js.map +1 -1
- package/lib/typography/ios.js +32 -51
- package/lib/typography/ios.js.map +1 -1
- package/lib/typography/types.d.ts +5 -5
- package/lib/typography/types.js +4 -1
- package/lib/typography/types.js.map +1 -1
- package/lib/typography.css +260 -0
- package/lib/typography.module.css +260 -0
- package/lib/utils/override-config.d.ts +1 -1
- package/lib/utils/override-config.js +18 -4
- package/lib/utils/override-config.js.map +1 -1
- package/package.json +17 -11
- package/lib/sizes.d.ts +0 -23
- package/lib/sizes.js +0 -23
- package/lib/sizes.js.map +0 -1
package/lib/theme.js
CHANGED
|
@@ -1,32 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ThemeVariant = exports.GeofencingZoneCodes = void 0;
|
|
7
|
+
exports.createThemesFor = createThemesFor;
|
|
8
|
+
exports.createThemes = createThemes;
|
|
9
|
+
exports.createExtendedThemes = createExtendedThemes;
|
|
10
|
+
var ts_deepmerge_1 = __importDefault(require("ts-deepmerge"));
|
|
11
|
+
var override_config_1 = require("./utils/override-config");
|
|
12
|
+
var themes_1 = require("./themes");
|
|
13
|
+
var themes_fs_1 = require("./themes-fs");
|
|
9
14
|
// The colors can be changed, but should follow standard practice as commented:
|
|
10
|
-
|
|
15
|
+
var GeofencingZoneCodes;
|
|
11
16
|
(function (GeofencingZoneCodes) {
|
|
12
17
|
GeofencingZoneCodes["allowed"] = "Allowed";
|
|
13
18
|
GeofencingZoneCodes["slow"] = "Slow";
|
|
14
19
|
GeofencingZoneCodes["noParking"] = "NoParking";
|
|
15
20
|
GeofencingZoneCodes["noEntry"] = "NoEntry";
|
|
16
|
-
})(GeofencingZoneCodes || (GeofencingZoneCodes = {}));
|
|
21
|
+
})(GeofencingZoneCodes || (exports.GeofencingZoneCodes = GeofencingZoneCodes = {}));
|
|
17
22
|
;
|
|
18
|
-
|
|
23
|
+
var ThemeVariant;
|
|
19
24
|
(function (ThemeVariant) {
|
|
20
25
|
ThemeVariant[ThemeVariant["AtB"] = 0] = "AtB";
|
|
21
26
|
ThemeVariant[ThemeVariant["Nfk"] = 1] = "Nfk";
|
|
22
27
|
ThemeVariant[ThemeVariant["FRAM"] = 2] = "FRAM";
|
|
23
28
|
ThemeVariant[ThemeVariant["Troms"] = 3] = "Troms";
|
|
24
29
|
ThemeVariant[ThemeVariant["Innlandet"] = 4] = "Innlandet";
|
|
25
|
-
})(ThemeVariant || (ThemeVariant = {}));
|
|
26
|
-
|
|
30
|
+
})(ThemeVariant || (exports.ThemeVariant = ThemeVariant = {}));
|
|
31
|
+
/**
|
|
32
|
+
* Get a theme object for a specific organization in the desired format.
|
|
33
|
+
*
|
|
34
|
+
* @param themeVariant Organization
|
|
35
|
+
* @param themeOptions Set if the new Figma structure should be used
|
|
36
|
+
* @returns Theme object
|
|
37
|
+
*/
|
|
38
|
+
function createThemesFor(themeVariant, themeOptions) {
|
|
39
|
+
if (themeOptions === void 0) { themeOptions = { useFigmaStructure: false }; }
|
|
27
40
|
switch (themeVariant) {
|
|
28
41
|
case ThemeVariant.AtB:
|
|
29
|
-
|
|
42
|
+
if (themeOptions === null || themeOptions === void 0 ? void 0 : themeOptions.useFigmaStructure) {
|
|
43
|
+
return themes_fs_1.AtBThemesFs;
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
return themes_1.AtBThemes;
|
|
47
|
+
;
|
|
48
|
+
}
|
|
30
49
|
// case ThemeVariant.Nfk:
|
|
31
50
|
// return NfkThemes;
|
|
32
51
|
// case ThemeVariant.FRAM:
|
|
@@ -59,10 +78,10 @@ export function createThemesFor(themeVariant) {
|
|
|
59
78
|
* @param overrides - Properties to override base themes with, on `Theme` level
|
|
60
79
|
* @returns themes
|
|
61
80
|
*/
|
|
62
|
-
|
|
81
|
+
function createThemes(themes, overrides) {
|
|
63
82
|
if (!overrides)
|
|
64
83
|
return themes;
|
|
65
|
-
return overrideConfig(themes, overrides);
|
|
84
|
+
return (0, override_config_1.overrideConfig)(themes, overrides);
|
|
66
85
|
}
|
|
67
86
|
/**
|
|
68
87
|
* Use Theme as base and extend with new properties. Properties
|
|
@@ -85,10 +104,10 @@ export function createThemes(themes, overrides) {
|
|
|
85
104
|
* @param extension - Object to extend original theme. Can be nested with same keys
|
|
86
105
|
* @returns new deep merged intersection themes
|
|
87
106
|
*/
|
|
88
|
-
|
|
107
|
+
function createExtendedThemes(themes, extension) {
|
|
89
108
|
return {
|
|
90
|
-
light:
|
|
91
|
-
dark:
|
|
109
|
+
light: (0, ts_deepmerge_1.default)(themes.light, extension.light),
|
|
110
|
+
dark: (0, ts_deepmerge_1.default)(themes.dark, extension.dark),
|
|
92
111
|
};
|
|
93
112
|
}
|
|
94
113
|
//# sourceMappingURL=theme.js.map
|
package/lib/theme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":";;;;;;AA+SA,0CAsBC;AAsBD,oCAMC;AAuBD,oDAWC;AAnYD,8DAAiC;AACjC,2DAA8E;AAC9E,mCAMkB;AAElB,yCAMqB;AAoCrB,+EAA+E;AAC/E,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,oCAAa,CAAA;IACb,8CAAuB,CAAA;IACvB,0CAAmB,CAAA;AACrB,CAAC,EALW,mBAAmB,mCAAnB,mBAAmB,QAK9B;AA8NA,CAAC;AAIF,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,6CAAG,CAAA;IACH,6CAAG,CAAA;IACH,+CAAI,CAAA;IACJ,iDAAK,CAAA;IACL,yDAAS,CAAA;AACX,CAAC,EANW,YAAY,4BAAZ,YAAY,QAMvB;AAMD;;;;;;GAMG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