@atb-as/theme 3.2.0 → 5.0.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.
- package/README.md +20 -19
- package/package.json +3 -3
- package/lib/colors.d.ts +0 -76
- package/lib/colors.js +0 -84
- package/lib/colors.js.map +0 -1
- package/lib/index.d.ts +0 -4
- package/lib/index.js +0 -17
- package/lib/index.js.map +0 -1
- package/lib/sizes.d.ts +0 -22
- package/lib/sizes.js +0 -25
- package/lib/sizes.js.map +0 -1
- package/lib/theme.css +0 -429
- package/lib/theme.d.ts +0 -119
- package/lib/theme.js +0 -197
- package/lib/theme.js.map +0 -1
- package/lib/theme.module.css +0 -429
- package/lib/typography/android.d.ts +0 -3
- package/lib/typography/android.js +0 -59
- package/lib/typography/android.js.map +0 -1
- package/lib/typography/index.d.ts +0 -63
- package/lib/typography/index.js +0 -94
- package/lib/typography/index.js.map +0 -1
- package/lib/typography/ios.d.ts +0 -3
- package/lib/typography/ios.js +0 -58
- package/lib/typography/ios.js.map +0 -1
- package/lib/typography/types.d.ts +0 -20
- package/lib/typography/types.js +0 -18
- package/lib/typography/types.js.map +0 -1
- package/lib/typography.css +0 -156
- package/lib/typography.module.css +0 -156
- package/lib/utils/override-config.d.ts +0 -8
- package/lib/utils/override-config.js +0 -38
- package/lib/utils/override-config.js.map +0 -1
package/README.md
CHANGED
|
@@ -11,16 +11,10 @@ yarn add @atb-as/theme
|
|
|
11
11
|
|
|
12
12
|
Import through `ts`/`js`:
|
|
13
13
|
|
|
14
|
-
```ts
|
|
15
|
-
import {colors} from '@atb-as/theme';
|
|
16
|
-
|
|
17
|
-
console.log(colors.primary.gray_100); //=> #F5F5F6
|
|
18
|
-
console.log(colors.text.dark); //=> #000000
|
|
19
|
-
```
|
|
20
14
|
|
|
21
15
|
```ts
|
|
22
|
-
import {
|
|
23
|
-
|
|
16
|
+
import {createThemesFor,ThemeVariant} from '@atb-as/theme';
|
|
17
|
+
const themes = createThemesFor(ThemeVariant.AtB)
|
|
24
18
|
console.log(themes.light.colors.background_0);
|
|
25
19
|
```
|
|
26
20
|
|
|
@@ -33,28 +27,28 @@ Or you could import CSS files or as CSS Modules. The actual content is currently
|
|
|
33
27
|
```ts
|
|
34
28
|
// When using imports from bundlers
|
|
35
29
|
|
|
36
|
-
// With CSS Modules
|
|
37
|
-
import * as classNamesTheme from '@atb-as/theme/lib/theme.module.css';
|
|
30
|
+
// With CSS Modules for atb-theme
|
|
31
|
+
import * as classNamesTheme from '@atb-as/theme/lib/themes/atb-theme/theme.module.css';
|
|
38
32
|
import * as classNamesTypo from '@atb-as/theme/lib/typography.module.css';
|
|
39
33
|
|
|
40
34
|
|
|
41
|
-
// Without CSS Modules
|
|
42
|
-
import '@atb-as/theme/lib/theme.css';
|
|
35
|
+
// Without CSS Modules for atb-theme
|
|
36
|
+
import '@atb-as/theme/lib/themes/atb-theme/theme.css';
|
|
43
37
|
import '@atb-as/theme/lib/typography.css';
|
|
44
38
|
```
|
|
45
39
|
|
|
46
40
|
```css
|
|
47
41
|
/* Using css/postcss/bundlers */
|
|
48
|
-
@import '@atb-as/theme/lib/theme.module.css';
|
|
42
|
+
@import '@atb-as/theme/lib/themes/atb-theme/theme.module.css';
|
|
49
43
|
@import '@atb-as/theme/lib/typography.module.css';
|
|
50
44
|
|
|
51
45
|
/* or without modules */
|
|
52
|
-
@import '@atb-as/theme/lib/theme.css';
|
|
46
|
+
@import '@atb-as/theme/lib/themes/atb-theme/theme.css';
|
|
53
47
|
@import '@atb-as/theme/lib/typography.css';
|
|
54
48
|
|
|
55
49
|
|
|
56
50
|
/* And potentially */
|
|
57
|
-
@value myClassname from "@atb-as/theme/lib/theme.css";
|
|
51
|
+
@value myClassname from "@atb-as/theme/lib/themes/atb-theme/theme.css";
|
|
58
52
|
```
|
|
59
53
|
|
|
60
54
|
_(note: This all depends on how you setup bundlers and consumes styles.)_
|
|
@@ -109,12 +103,15 @@ With regular CSS.
|
|
|
109
103
|
|
|
110
104
|
### Theme API
|
|
111
105
|
|
|
112
|
-
#### `createThemes(overrides?: ConfigurationOverride<Theme>): Themes`
|
|
106
|
+
#### `createThemes(themes: Themes,overrides?: ConfigurationOverride<Theme>): Themes`
|
|
113
107
|
|
|
114
108
|
Create new themes (light/dark) with optinally overriden defaults
|
|
115
109
|
|
|
116
110
|
```ts
|
|
117
|
-
const
|
|
111
|
+
const themesVariant = createThemesFor(ThemeVariant.AtB)
|
|
112
|
+
const themes = createThemes(
|
|
113
|
+
themesVariant,
|
|
114
|
+
{
|
|
118
115
|
light: {
|
|
119
116
|
spacings: {
|
|
120
117
|
medium: 20,
|
|
@@ -126,7 +123,7 @@ themes.dark.spacings.medium;
|
|
|
126
123
|
```
|
|
127
124
|
|
|
128
125
|
|
|
129
|
-
#### `createExtendedThemes<T>(extension: T)`
|
|
126
|
+
#### `createExtendedThemes<T>(themes: Themes,extension: T)`
|
|
130
127
|
|
|
131
128
|
Use Theme as base and extend with new properties. Properties can be nested and will be deep merged.
|
|
132
129
|
|
|
@@ -134,7 +131,11 @@ Use Theme as base and extend with new properties. Properties can be nested and w
|
|
|
134
131
|
type FooExtension = {
|
|
135
132
|
statusBarStyle: 'dark' | 'light';
|
|
136
133
|
}
|
|
137
|
-
const
|
|
134
|
+
const themesVariant = createThemesFor(ThemeVariant.AtB)
|
|
135
|
+
|
|
136
|
+
const _themes = createExtendedThemes<FooExtension>(
|
|
137
|
+
themesVariant,
|
|
138
|
+
{
|
|
138
139
|
light: {statusBarStyle: 'dark'},
|
|
139
140
|
dark: {statusBarStyle: 'light'}
|
|
140
141
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atb-as/theme",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "AtB Design System Colors",
|
|
6
6
|
"license": "EUPL-1.2",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@types/node": "^14.14.34",
|
|
23
23
|
"copyfiles": "^2.4.1",
|
|
24
24
|
"ts-node": "^9.1.1",
|
|
25
|
-
"typescript": "^4.
|
|
25
|
+
"typescript": "^4.4.3"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"hex-to-rgba": "^2.0.1",
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "8233949a173570decf614d6279c538904e4e471d"
|
|
35
35
|
}
|
package/lib/colors.d.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
export declare const backgrounds: {
|
|
2
|
-
light: {
|
|
3
|
-
level0: string;
|
|
4
|
-
level1: string;
|
|
5
|
-
level2: string;
|
|
6
|
-
level3: string;
|
|
7
|
-
};
|
|
8
|
-
dark: {
|
|
9
|
-
level0: string;
|
|
10
|
-
level1: string;
|
|
11
|
-
level2: string;
|
|
12
|
-
level3: string;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export declare const colors: {
|
|
16
|
-
white: string;
|
|
17
|
-
black: string;
|
|
18
|
-
primary: {
|
|
19
|
-
gray_50: string;
|
|
20
|
-
gray_100: string;
|
|
21
|
-
gray_200: string;
|
|
22
|
-
gray_300: string;
|
|
23
|
-
gray_400: string;
|
|
24
|
-
gray_500: string;
|
|
25
|
-
gray_600: string;
|
|
26
|
-
gray_700: string;
|
|
27
|
-
gray_800: string;
|
|
28
|
-
gray_900: string;
|
|
29
|
-
gray_950: string;
|
|
30
|
-
green_100: string;
|
|
31
|
-
green_200: string;
|
|
32
|
-
green_300: string;
|
|
33
|
-
green_400: string;
|
|
34
|
-
green_500: string;
|
|
35
|
-
green_600: string;
|
|
36
|
-
green_700: string;
|
|
37
|
-
green_800: string;
|
|
38
|
-
green_900: string;
|
|
39
|
-
};
|
|
40
|
-
secondary: {
|
|
41
|
-
cyan_100: string;
|
|
42
|
-
cyan_200: string;
|
|
43
|
-
cyan_300: string;
|
|
44
|
-
cyan_400: string;
|
|
45
|
-
cyan_500: string;
|
|
46
|
-
cyan_600: string;
|
|
47
|
-
cyan_700: string;
|
|
48
|
-
cyan_800: string;
|
|
49
|
-
cyan_900: string;
|
|
50
|
-
blue_100: string;
|
|
51
|
-
blue_200: string;
|
|
52
|
-
blue_300: string;
|
|
53
|
-
blue_400: string;
|
|
54
|
-
blue_500: string;
|
|
55
|
-
blue_600: string;
|
|
56
|
-
blue_700: string;
|
|
57
|
-
blue_800: string;
|
|
58
|
-
blue_900: string;
|
|
59
|
-
brown: string;
|
|
60
|
-
orange: string;
|
|
61
|
-
yellow_100: string;
|
|
62
|
-
yellow_500: string;
|
|
63
|
-
red_100: string;
|
|
64
|
-
red_400: string;
|
|
65
|
-
red_500: string;
|
|
66
|
-
};
|
|
67
|
-
text: {
|
|
68
|
-
light: string;
|
|
69
|
-
dark: string;
|
|
70
|
-
};
|
|
71
|
-
other: {
|
|
72
|
-
orange_500: string;
|
|
73
|
-
ekspressen_500: string;
|
|
74
|
-
ekspressen_600: string;
|
|
75
|
-
};
|
|
76
|
-
};
|
package/lib/colors.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.colors = exports.backgrounds = void 0;
|
|
4
|
-
exports.backgrounds = {
|
|
5
|
-
light: {
|
|
6
|
-
level0: '#FFFFFF',
|
|
7
|
-
level1: '#E7E8E9',
|
|
8
|
-
level2: '#DBDDDE',
|
|
9
|
-
level3: '#CFD2D3',
|
|
10
|
-
},
|
|
11
|
-
dark: {
|
|
12
|
-
level0: '#000000',
|
|
13
|
-
level1: '#242B30',
|
|
14
|
-
level2: '#37424A',
|
|
15
|
-
level3: '#555E65',
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
exports.colors = {
|
|
19
|
-
white: '#ffffff',
|
|
20
|
-
black: '#000000',
|
|
21
|
-
primary: {
|
|
22
|
-
// grays
|
|
23
|
-
gray_50: '#E7E8E9',
|
|
24
|
-
gray_100: '#F5F5F6',
|
|
25
|
-
gray_200: '#AFB3B7',
|
|
26
|
-
gray_300: '#878E92',
|
|
27
|
-
gray_400: '#5F686E',
|
|
28
|
-
gray_500: '#37424A',
|
|
29
|
-
gray_600: '#2C353B',
|
|
30
|
-
gray_700: '#21282C',
|
|
31
|
-
gray_800: '#161A1E',
|
|
32
|
-
gray_900: '#101416',
|
|
33
|
-
gray_950: '#1B1C1D',
|
|
34
|
-
// greens
|
|
35
|
-
green_100: '#E3E6B3',
|
|
36
|
-
green_200: '#DADE99',
|
|
37
|
-
green_300: '#C7CE66',
|
|
38
|
-
green_400: '#B5BD33',
|
|
39
|
-
green_500: '#A2AD00',
|
|
40
|
-
green_600: '#828A00',
|
|
41
|
-
green_700: '#616800',
|
|
42
|
-
green_800: '#414500',
|
|
43
|
-
green_900: '#313400',
|
|
44
|
-
},
|
|
45
|
-
secondary: {
|
|
46
|
-
// cyan
|
|
47
|
-
cyan_100: '#D4F3F6',
|
|
48
|
-
cyan_200: '#C6EFF3',
|
|
49
|
-
cyan_300: '#AAE6EC',
|
|
50
|
-
cyan_400: '#8DDEE6',
|
|
51
|
-
cyan_500: '#71D6E0',
|
|
52
|
-
cyan_600: '#5AABB3',
|
|
53
|
-
cyan_700: '#448086',
|
|
54
|
-
cyan_800: '#2D565A',
|
|
55
|
-
cyan_900: '#224043',
|
|
56
|
-
// i got the blues
|
|
57
|
-
blue_100: '#B3D8DE',
|
|
58
|
-
blue_200: '#99CBD3',
|
|
59
|
-
blue_300: '#66B0BE',
|
|
60
|
-
blue_400: '#3396A8',
|
|
61
|
-
blue_500: '#007C92',
|
|
62
|
-
blue_600: '#006375',
|
|
63
|
-
blue_700: '#004A58',
|
|
64
|
-
blue_800: '#00323A',
|
|
65
|
-
blue_900: '#00252C',
|
|
66
|
-
brown: '#584528',
|
|
67
|
-
orange: '#C75B12',
|
|
68
|
-
yellow_100: '#F7F3B2',
|
|
69
|
-
yellow_500: '#E4D700',
|
|
70
|
-
red_100: '#E4B8C6',
|
|
71
|
-
red_400: '#B74166',
|
|
72
|
-
red_500: '#A51140',
|
|
73
|
-
},
|
|
74
|
-
text: {
|
|
75
|
-
light: '#FFFFFF',
|
|
76
|
-
dark: '#000000',
|
|
77
|
-
},
|
|
78
|
-
other: {
|
|
79
|
-
orange_500: '#BE5604',
|
|
80
|
-
ekspressen_500: '#ED6C05',
|
|
81
|
-
ekspressen_600: '#C75B12',
|
|
82
|
-
},
|
|
83
|
-
};
|
|
84
|
-
//# sourceMappingURL=colors.js.map
|
package/lib/colors.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"colors.js","sourceRoot":"","sources":["../src/colors.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG;IACzB,KAAK,EAAE;QACL,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE,SAAS;KAClB;IACD,IAAI,EAAE;QACJ,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE,SAAS;KAClB;CACF,CAAC;AAEW,QAAA,MAAM,GAAG;IACpB,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE;QACP,QAAQ;QACR,OAAO,EAAE,SAAS;QAClB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,SAAS;QACT,SAAS,EAAE,SAAS;QACpB,SAAS,EAAE,SAAS;QACpB,SAAS,EAAE,SAAS;QACpB,SAAS,EAAE,SAAS;QACpB,SAAS,EAAE,SAAS;QACpB,SAAS,EAAE,SAAS;QACpB,SAAS,EAAE,SAAS;QACpB,SAAS,EAAE,SAAS;QACpB,SAAS,EAAE,SAAS;KACrB;IACD,SAAS,EAAE;QACT,OAAO;QACP,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,kBAAkB;QAClB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;QAEnB,KAAK,EAAE,SAAS;QAEhB,MAAM,EAAE,SAAS;QAEjB,UAAU,EAAE,SAAS;QACrB,UAAU,EAAE,SAAS;QAErB,OAAO,EAAE,SAAS;QAClB,OAAO,EAAE,SAAS;QAClB,OAAO,EAAE,SAAS;KACnB;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,SAAS;KAChB;IACD,KAAK,EAAE;QACL,UAAU,EAAE,SAAS;QACrB,cAAc,EAAE,SAAS;QACzB,cAAc,EAAE,SAAS;KAC1B;CACF,CAAC"}
|
package/lib/index.d.ts
DELETED
package/lib/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./colors"), exports);
|
|
14
|
-
__exportStar(require("./sizes"), exports);
|
|
15
|
-
__exportStar(require("./theme"), exports);
|
|
16
|
-
__exportStar(require("./typography"), exports);
|
|
17
|
-
//# 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,2CAAyB;AACzB,0CAAwB;AACxB,0CAAwB;AACxB,+CAA6B"}
|
package/lib/sizes.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export declare const spacings: {
|
|
2
|
-
xLarge: number;
|
|
3
|
-
large: number;
|
|
4
|
-
medium: number;
|
|
5
|
-
small: number;
|
|
6
|
-
xSmall: number;
|
|
7
|
-
};
|
|
8
|
-
export declare const iconSizes: {
|
|
9
|
-
large: number;
|
|
10
|
-
normal: number;
|
|
11
|
-
small: number;
|
|
12
|
-
};
|
|
13
|
-
export declare const borderRadius: {
|
|
14
|
-
readonly circle: 20;
|
|
15
|
-
readonly regular: 8;
|
|
16
|
-
readonly small: 4;
|
|
17
|
-
};
|
|
18
|
-
export declare const borderWidth: {
|
|
19
|
-
slim: number;
|
|
20
|
-
medium: number;
|
|
21
|
-
};
|
|
22
|
-
export declare type RadiusSizes = keyof typeof borderRadius;
|
package/lib/sizes.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.borderWidth = exports.borderRadius = exports.iconSizes = exports.spacings = void 0;
|
|
4
|
-
exports.spacings = {
|
|
5
|
-
xLarge: 24,
|
|
6
|
-
large: 20,
|
|
7
|
-
medium: 12,
|
|
8
|
-
small: 8,
|
|
9
|
-
xSmall: 4,
|
|
10
|
-
};
|
|
11
|
-
exports.iconSizes = {
|
|
12
|
-
large: 28,
|
|
13
|
-
normal: 20,
|
|
14
|
-
small: 10,
|
|
15
|
-
};
|
|
16
|
-
exports.borderRadius = {
|
|
17
|
-
circle: 20,
|
|
18
|
-
regular: 8,
|
|
19
|
-
small: 4,
|
|
20
|
-
};
|
|
21
|
-
exports.borderWidth = {
|
|
22
|
-
slim: 1,
|
|
23
|
-
medium: 2,
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=sizes.js.map
|
package/lib/sizes.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sizes.js","sourceRoot":"","sources":["../src/sizes.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG;IACtB,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,CAAC;CACV,CAAC;AAEW,QAAA,SAAS,GAAG;IACvB,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,EAAE;CACV,CAAC;AAEW,QAAA,YAAY,GAAG;IAC1B,MAAM,EAAE,EAAE;IACV,OAAO,EAAE,CAAC;IACV,KAAK,EAAE,CAAC;CACA,CAAC;AAEE,QAAA,WAAW,GAAG;IACzB,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,CAAC;CACV,CAAC"}
|