@atb-as/theme 11.0.0-alpha.9 → 11.0.0-rc.1

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.
Files changed (50) hide show
  1. package/package.json +7 -10
  2. package/lib/index.d.ts +0 -2
  3. package/lib/index.js +0 -3
  4. package/lib/index.js.map +0 -1
  5. package/lib/theme.d.ts +0 -301
  6. package/lib/theme.js +0 -113
  7. package/lib/theme.js.map +0 -1
  8. package/lib/themes/atb-theme/dark.d.ts +0 -419
  9. package/lib/themes/atb-theme/dark.js +0 -419
  10. package/lib/themes/atb-theme/dark.js.map +0 -1
  11. package/lib/themes/atb-theme/light.d.ts +0 -419
  12. package/lib/themes/atb-theme/light.js +0 -419
  13. package/lib/themes/atb-theme/light.js.map +0 -1
  14. package/lib/themes/atb-theme/theme.css +0 -760
  15. package/lib/themes/atb-theme/theme.d.ts +0 -836
  16. package/lib/themes/atb-theme/theme.js +0 -11
  17. package/lib/themes/atb-theme/theme.js.map +0 -1
  18. package/lib/themes/atb-theme/theme.module.css +0 -760
  19. package/lib/themes/index.d.ts +0 -1
  20. package/lib/themes/index.js +0 -6
  21. package/lib/themes/index.js.map +0 -1
  22. package/lib/themes-fs/atb-theme/dark.d.ts +0 -722
  23. package/lib/themes-fs/atb-theme/dark.js +0 -722
  24. package/lib/themes-fs/atb-theme/dark.js.map +0 -1
  25. package/lib/themes-fs/atb-theme/light.d.ts +0 -722
  26. package/lib/themes-fs/atb-theme/light.js +0 -722
  27. package/lib/themes-fs/atb-theme/light.js.map +0 -1
  28. package/lib/themes-fs/atb-theme/theme.d.ts +0 -1442
  29. package/lib/themes-fs/atb-theme/theme.js +0 -11
  30. package/lib/themes-fs/atb-theme/theme.js.map +0 -1
  31. package/lib/themes-fs/index.d.ts +0 -1
  32. package/lib/themes-fs/index.js +0 -6
  33. package/lib/themes-fs/index.js.map +0 -1
  34. package/lib/typography/android.d.ts +0 -3
  35. package/lib/typography/android.js +0 -116
  36. package/lib/typography/android.js.map +0 -1
  37. package/lib/typography/index.d.ts +0 -63
  38. package/lib/typography/index.js +0 -73
  39. package/lib/typography/index.js.map +0 -1
  40. package/lib/typography/ios.d.ts +0 -3
  41. package/lib/typography/ios.js +0 -115
  42. package/lib/typography/ios.js.map +0 -1
  43. package/lib/typography/types.d.ts +0 -21
  44. package/lib/typography/types.js +0 -24
  45. package/lib/typography/types.js.map +0 -1
  46. package/lib/typography.css +0 -260
  47. package/lib/typography.module.css +0 -260
  48. package/lib/utils/override-config.d.ts +0 -8
  49. package/lib/utils/override-config.js +0 -23
  50. package/lib/utils/override-config.js.map +0 -1
package/package.json CHANGED
@@ -1,25 +1,22 @@
1
1
  {
2
2
  "name": "@atb-as/theme",
3
- "version": "11.0.0-alpha.9",
3
+ "version": "11.0.0-rc.1",
4
4
  "private": false,
5
5
  "description": "AtB Design System Colors",
6
6
  "license": "EUPL-1.2",
7
- "type": "module",
7
+ "type": "commonjs",
8
8
  "main": "./lib/index.js",
9
- "exports": {
10
- ".": "./lib/index.js"
11
- },
12
9
  "types": "./lib/index.d.ts",
13
10
  "files": [
14
- "lib"
11
+ "./lib/**/*"
15
12
  ],
16
13
  "scripts": {
17
14
  "pack": "yarn pack",
18
15
  "tsc": "tsc",
19
16
  "clean": "rm -rf lib",
20
17
  "test": "echo \"Error: run tests from root\" && exit 1",
21
- "build": "tsc -p tsconfig.build.json && yarn create-css && yarn copy-css",
22
- "copy-css": "copyfiles -u 1 \"src/**/*.{css,woff,woff2,ttf,eot,svg,png}\" lib/",
18
+ "build": "yarn create-css && tsc -p tsconfig.build.json && yarn copy-css",
19
+ "copy-css": "copyfiles -u 1 \"src/**/*.{css,woff,woff2,ttf,eot,svg,png}\" lib",
23
20
  "create-css": "tsx ./tools/create-css.ts",
24
21
  "fetch-variables": "tsx ./tools/fetch-figma-variables.ts"
25
22
  },
@@ -27,7 +24,7 @@
27
24
  "@figma/rest-api-spec": "^0.16.0",
28
25
  "@types/node": "^14.14.34",
29
26
  "copyfiles": "^2.4.1",
30
- "style-dictionary": "^4.0.0",
27
+ "style-dictionary": "^4.1.3",
31
28
  "tsx": "^4.16.2",
32
29
  "typescript": "^5.1.6"
33
30
  },
@@ -39,5 +36,5 @@
39
36
  "publishConfig": {
40
37
  "access": "public"
41
38
  },
42
- "gitHead": "e306152c5f22b5c85b992b12e456e3f47a21d2e0"
39
+ "gitHead": "89e93f28090d58a4ce2c13dd188d0730d7bb136d"
43
40
  }
package/lib/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './theme';
2
- export * from './typography';
package/lib/index.js DELETED
@@ -1,3 +0,0 @@
1
- export * from './theme';
2
- export * from './typography';
3
- //# sourceMappingURL=index.js.map
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"}
package/lib/theme.d.ts DELETED
@@ -1,301 +0,0 @@
1
- import { ConfigurationOverride } from './utils/override-config';
2
- export type Themes<T = Theme> = {
3
- light: T;
4
- dark: T;
5
- };
6
- export type Mode = keyof Themes;
7
- export type TextColor = 'primary' | 'secondary' | 'disabled';
8
- export type TextColorType = 'dark' | 'light';
9
- export type RadiusSizes = keyof Theme['border']['radius'];
10
- export type ContrastColor = {
11
- background: string;
12
- text: string;
13
- };
14
- export type TransportColor<T = ContrastColor> = {
15
- primary: T;
16
- secondary: T;
17
- };
18
- export type StatusColor<T = ContrastColor> = {
19
- primary: T;
20
- secondary: T;
21
- };
22
- export type InteractiveColor<T = ContrastColor> = {
23
- default: T;
24
- hover: T;
25
- active: T;
26
- disabled: T;
27
- outline: T;
28
- };
29
- export declare enum GeofencingZoneCodes {
30
- allowed = "Allowed",// blue
31
- slow = "Slow",// yellow
32
- noParking = "NoParking",// red
33
- noEntry = "NoEntry"
34
- }
35
- export type GeofencingZoneKeys = keyof typeof GeofencingZoneCodes;
36
- export type GeofencingZoneStyle<T = ContrastColor> = {
37
- color: T;
38
- fillOpacity: number;
39
- strokeOpacity: number;
40
- layerIndexWeight: number;
41
- };
42
- export type GeofencingZoneStyles<T = ContrastColor> = {
43
- [GZKey in GeofencingZoneKeys]: GeofencingZoneStyle<T>;
44
- };
45
- export interface Theme {
46
- spacings: {
47
- xSmall: number;
48
- small: number;
49
- medium: number;
50
- large: number;
51
- xLarge: number;
52
- };
53
- interactive: {
54
- interactive_0: InteractiveColor;
55
- interactive_1: InteractiveColor;
56
- interactive_2: InteractiveColor;
57
- interactive_3: InteractiveColor;
58
- interactive_destructive: InteractiveColor;
59
- };
60
- transport: {
61
- transport_city: TransportColor;
62
- transport_region: TransportColor;
63
- transport_airport_express: TransportColor;
64
- transport_boat: TransportColor;
65
- transport_train: TransportColor;
66
- transport_flexible: TransportColor;
67
- transport_scooter: TransportColor;
68
- transport_bike: TransportColor;
69
- transport_car: TransportColor;
70
- transport_other: TransportColor;
71
- };
72
- status: {
73
- valid: StatusColor;
74
- info: StatusColor;
75
- warning: StatusColor;
76
- error: StatusColor;
77
- };
78
- static: {
79
- background: {
80
- background_0: ContrastColor;
81
- background_1: ContrastColor;
82
- background_2: ContrastColor;
83
- background_3: ContrastColor;
84
- background_accent_0: ContrastColor;
85
- background_accent_1: ContrastColor;
86
- background_accent_2: ContrastColor;
87
- background_accent_3: ContrastColor;
88
- background_accent_4: ContrastColor;
89
- background_accent_5: ContrastColor;
90
- };
91
- zone_selection: {
92
- from: ContrastColor;
93
- to: ContrastColor;
94
- };
95
- };
96
- text: {
97
- colors: {
98
- [key in TextColor]: string;
99
- };
100
- };
101
- border: {
102
- primary: string;
103
- secondary: string;
104
- focus: string;
105
- radius: {
106
- small: number;
107
- regular: number;
108
- circle: number;
109
- };
110
- width: {
111
- slim: number;
112
- medium: number;
113
- };
114
- };
115
- icon: {
116
- size: {
117
- xSmall: number;
118
- small: number;
119
- normal: number;
120
- large: number;
121
- };
122
- };
123
- geofencingZones: GeofencingZoneStyles;
124
- }
125
- export type ContrastColorFs = {
126
- background: string;
127
- foreground: {
128
- primary: string;
129
- secondary: string;
130
- disabled: string;
131
- };
132
- };
133
- export interface ThemeFs {
134
- color: {
135
- foreground: {
136
- dark: ContrastColorFs['foreground'];
137
- light: ContrastColorFs['foreground'];
138
- dynamic: ContrastColorFs['foreground'];
139
- inverse: ContrastColorFs['foreground'];
140
- };
141
- interactive: {
142
- 0: InteractiveColor<ContrastColorFs>;
143
- 1: InteractiveColor<ContrastColorFs>;
144
- 2: InteractiveColor<ContrastColorFs>;
145
- 3: InteractiveColor<ContrastColorFs>;
146
- destructive: InteractiveColor<ContrastColorFs>;
147
- };
148
- transport: {
149
- city: TransportColor<ContrastColorFs>;
150
- region: TransportColor<ContrastColorFs>;
151
- airportExpress: TransportColor<ContrastColorFs>;
152
- boat: TransportColor<ContrastColorFs>;
153
- train: TransportColor<ContrastColorFs>;
154
- flexible: TransportColor<ContrastColorFs>;
155
- scooter: TransportColor<ContrastColorFs>;
156
- bike: TransportColor<ContrastColorFs>;
157
- car: TransportColor<ContrastColorFs>;
158
- other: TransportColor<ContrastColorFs>;
159
- };
160
- status: {
161
- valid: StatusColor<ContrastColorFs>;
162
- info: StatusColor<ContrastColorFs>;
163
- warning: StatusColor<ContrastColorFs>;
164
- error: StatusColor<ContrastColorFs>;
165
- };
166
- background: {
167
- neutral: {
168
- 0: ContrastColorFs;
169
- 1: ContrastColorFs;
170
- 2: ContrastColorFs;
171
- 3: ContrastColorFs;
172
- };
173
- accent: {
174
- 0: ContrastColorFs;
175
- 1: ContrastColorFs;
176
- 2: ContrastColorFs;
177
- 3: ContrastColorFs;
178
- 4: ContrastColorFs;
179
- 5: ContrastColorFs;
180
- };
181
- };
182
- zone: {
183
- from: ContrastColorFs;
184
- to: ContrastColorFs;
185
- };
186
- geofencingZone: GeofencingZoneStyles<ContrastColorFs>;
187
- border: {
188
- primary: ContrastColorFs;
189
- secondary: ContrastColorFs;
190
- focus: ContrastColorFs;
191
- };
192
- };
193
- border: {
194
- radius: {
195
- small: number;
196
- regular: number;
197
- circle: number;
198
- };
199
- width: {
200
- slim: number;
201
- medium: number;
202
- };
203
- };
204
- icon: {
205
- size: {
206
- xSmall: number;
207
- small: number;
208
- normal: number;
209
- large: number;
210
- };
211
- };
212
- spacing: {
213
- xSmall: number;
214
- small: number;
215
- medium: number;
216
- large: number;
217
- xLarge: number;
218
- };
219
- typography: {
220
- ios: {
221
- font: string;
222
- number: number;
223
- };
224
- android: {
225
- font: string;
226
- number: number;
227
- };
228
- web: {
229
- font: string;
230
- number: number;
231
- };
232
- };
233
- }
234
- export type Statuses = keyof Theme['status'];
235
- export declare enum ThemeVariant {
236
- AtB = 0,
237
- Nfk = 1,
238
- FRAM = 2,
239
- Troms = 3,
240
- Innlandet = 4
241
- }
242
- export interface ThemeOptions {
243
- useFigmaStructure?: boolean;
244
- }
245
- /**
246
- * Get a theme object for a specific organization in the desired format.
247
- *
248
- * @param themeVariant Organization
249
- * @param themeOptions Set if the new Figma structure should be used
250
- * @returns Theme object
251
- */
252
- export declare function createThemesFor<T extends ThemeOptions>(themeVariant: ThemeVariant, themeOptions?: T): T['useFigmaStructure'] extends true ? Themes<ThemeFs> : Themes<Theme>;
253
- /**
254
- * Create new themes (light/dark) with optinally overriden defaults.
255
- *
256
- * @example extending nested features
257
- * ```ts
258
- * const themes = createThemes({
259
- * light: {
260
- * spacings: {
261
- * medium: 20,
262
- * },
263
- * },
264
- * });
265
- *
266
- * themes.dark.spacings.medium;
267
- * //=> 20
268
- * ```
269
- *
270
- * @param overrides - Properties to override base themes with, on `Theme` level
271
- * @returns themes
272
- */
273
- export declare function createThemes(themes: Themes, overrides?: ConfigurationOverride<Themes>): Themes;
274
- /**
275
- * Use Theme as base and extend with new properties. Properties
276
- * can be nested and will be deep merged.
277
- *
278
- * @example extending nested features
279
- * ```ts
280
- * type FooExtension = {
281
- * statusBarStyle: 'dark' | 'light';
282
- * }
283
- * const _themes = createExtendedThemes<FooExtension>({
284
- * light: {statusBarStyle: 'dark'},
285
- * dark: {statusBarStyle: 'light'}
286
- * });
287
- *
288
- * _themes.dark.statusBarStyle;
289
- * //=> (property) statusBarStyle: "dark" | "light"
290
- * ```
291
- *
292
- * @param extension - Object to extend original theme. Can be nested with same keys
293
- * @returns new deep merged intersection themes
294
- */
295
- export declare function createExtendedThemes<T extends {}, M extends Theme | ThemeFs = Theme>(themes: Themes<M>, extension: {
296
- light: T;
297
- dark: T;
298
- }): {
299
- light: Themes<M>['light'] & T;
300
- dark: Themes<M>['dark'] & T;
301
- };
package/lib/theme.js DELETED
@@ -1,113 +0,0 @@
1
- import merge from 'ts-deepmerge';
2
- import { overrideConfig } from './utils/override-config';
3
- import { AtBThemes,
4
- // NfkThemes,
5
- // FRAMThemes,
6
- // TromsThemes,
7
- // InnlandetThemes,
8
- } from './themes';
9
- import { AtBThemesFs,
10
- // NfkThemes,
11
- // FRAMThemes,
12
- // TromsThemes,
13
- // InnlandetThemes,
14
- } from './themes-fs';
15
- // The colors can be changed, but should follow standard practice as commented:
16
- export var GeofencingZoneCodes;
17
- (function (GeofencingZoneCodes) {
18
- GeofencingZoneCodes["allowed"] = "Allowed";
19
- GeofencingZoneCodes["slow"] = "Slow";
20
- GeofencingZoneCodes["noParking"] = "NoParking";
21
- GeofencingZoneCodes["noEntry"] = "NoEntry";
22
- })(GeofencingZoneCodes || (GeofencingZoneCodes = {}));
23
- ;
24
- export var ThemeVariant;
25
- (function (ThemeVariant) {
26
- ThemeVariant[ThemeVariant["AtB"] = 0] = "AtB";
27
- ThemeVariant[ThemeVariant["Nfk"] = 1] = "Nfk";
28
- ThemeVariant[ThemeVariant["FRAM"] = 2] = "FRAM";
29
- ThemeVariant[ThemeVariant["Troms"] = 3] = "Troms";
30
- ThemeVariant[ThemeVariant["Innlandet"] = 4] = "Innlandet";
31
- })(ThemeVariant || (ThemeVariant = {}));
32
- /**
33
- * Get a theme object for a specific organization in the desired format.
34
- *
35
- * @param themeVariant Organization
36
- * @param themeOptions Set if the new Figma structure should be used
37
- * @returns Theme object
38
- */
39
- export function createThemesFor(themeVariant, themeOptions = { useFigmaStructure: false }) {
40
- switch (themeVariant) {
41
- case ThemeVariant.AtB:
42
- if (themeOptions?.useFigmaStructure) {
43
- return AtBThemesFs;
44
- }
45
- else {
46
- return AtBThemes;
47
- ;
48
- }
49
- // case ThemeVariant.Nfk:
50
- // return NfkThemes;
51
- // case ThemeVariant.FRAM:
52
- // return FRAMThemes;
53
- // case ThemeVariant.Troms:
54
- // return TromsThemes;
55
- // case ThemeVariant.Innlandet:
56
- // return InnlandetThemes;
57
- default:
58
- throw Error('A valid ThemeVariant must be provided');
59
- }
60
- }
61
- /**
62
- * Create new themes (light/dark) with optinally overriden defaults.
63
- *
64
- * @example extending nested features
65
- * ```ts
66
- * const themes = createThemes({
67
- * light: {
68
- * spacings: {
69
- * medium: 20,
70
- * },
71
- * },
72
- * });
73
- *
74
- * themes.dark.spacings.medium;
75
- * //=> 20
76
- * ```
77
- *
78
- * @param overrides - Properties to override base themes with, on `Theme` level
79
- * @returns themes
80
- */
81
- export function createThemes(themes, overrides) {
82
- if (!overrides)
83
- return themes;
84
- return overrideConfig(themes, overrides);
85
- }
86
- /**
87
- * Use Theme as base and extend with new properties. Properties
88
- * can be nested and will be deep merged.
89
- *
90
- * @example extending nested features
91
- * ```ts
92
- * type FooExtension = {
93
- * statusBarStyle: 'dark' | 'light';
94
- * }
95
- * const _themes = createExtendedThemes<FooExtension>({
96
- * light: {statusBarStyle: 'dark'},
97
- * dark: {statusBarStyle: 'light'}
98
- * });
99
- *
100
- * _themes.dark.statusBarStyle;
101
- * //=> (property) statusBarStyle: "dark" | "light"
102
- * ```
103
- *
104
- * @param extension - Object to extend original theme. Can be nested with same keys
105
- * @returns new deep merged intersection themes
106
- */
107
- export function createExtendedThemes(themes, extension) {
108
- return {
109
- light: merge(themes.light, extension.light),
110
- dark: merge(themes.dark, extension.dark),
111
- };
112
- }
113
- //# sourceMappingURL=theme.js.map
package/lib/theme.js.map DELETED
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