@entur/tokens 3.11.2 → 3.12.1-alpha.0

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 CHANGED
@@ -1,6 +1,8 @@
1
1
  # Entur design tokens
2
2
 
3
- This package contains all design tokens used throughout the design system. You'l find all of them in the `src/tokens.ts` file.
3
+ This package contains all design tokens and design variables used throughout the design system. We are currently in a process to migrate over to a new design variable system based on [Figma Variables](https://help.figma.com/hc/en-us/articles/15339657135383-Guide-to-variables-in-Figma).
4
+
5
+ Since not all values are available as a variable yet and to avoid breaking changes, all previous design tokens will be kept around for a while. These are built from the `src/legacy-tokens.ts` file.
4
6
 
5
7
  > 💡 Looking for the [documentation](https://design.entur.no/komponenter/resources/tokens)?
6
8
 
@@ -97,3 +99,23 @@ StyleSheet.create({
97
99
  #### px vs rem
98
100
 
99
101
  These values are mainly provided in pixels. If you need the values in rem instead, add a `.rem` after the token name, e.g. `space.rem.large` for rem value and `space.large` for pixel value.
102
+
103
+ ## [For maintainers] Updating design variables
104
+
105
+ There are three steps needed to update the set of available designs variables in this repo:
106
+
107
+ 1. generate a JSON-export of the variable set from Figma
108
+ 2. Update the corresponding JSON-file in the `src` folder
109
+ 3. Build the new variables and commit the changes
110
+
111
+ ### 1. Generate a JSON export
112
+
113
+ The JSON is exported from Figma using the [variabels2css-plugin](https://www.figma.com/community/plugin/1261234393153346915), download the plugin if you haven't already. Go to the Figma file containing the variables you want to export, eg. [Semantic Colors](https://www.figma.com/file/zFFjH3gKGON6vFJZQK5ltr/Tokens-Semantic-colors?type=design&mode=design&t=M9cT0w0kaaxyBHiq-1). In you menu bar, select 'Plugins' and choose 'variables2css' – this opens a modal. Under 'choose your collection' choose the variable set you want to export. Under 'type' choose 'JSON', and under 'color' and 'unit' choose 'hex' and 'rem'. Then click 'Generate' and copy the result.
114
+
115
+ ### 2. Update JSON file
116
+
117
+ Back in this repo, find the JSON-variables file you want to update, eg. `semantic.json`, delete its content and paste the generated result you copied in step 1. Then save the file.
118
+
119
+ ### 3. Build variables
120
+
121
+ When the JSON-file content is updated, run the script `yarn build` inside this package or `yarn build:packages` from root. This will generate new files with updated values in both this package and in all other packages where the component color value has been updated. Once the build is finished, commit all changes and push the commit.
package/dist/base.css ADDED
@@ -0,0 +1,73 @@
1
+ @import '~@entur/tokens/dist/semantic.css';
2
+ /* DO NOT CHANGE!*/
3
+ /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
4
+ [data-color-mode='light'],
5
+ :root {
6
+ --basecolors-frame-contrast: var(--fill-background-contrast-light);
7
+ --basecolors-frame-contrastalt: var(--fill-background-contrast-lightalt);
8
+ --basecolors-frame-default: var(--fill-background-standard-light);
9
+ --basecolors-frame-elevated: var(--fill-background-standard-light);
10
+ --basecolors-frame-elevatedalt: var(--fill-background-tint-light);
11
+ --basecolors-frame-subdued: var(--fill-background-subdued-light);
12
+ --basecolors-frame-tint: var(--fill-background-tint-light);
13
+ --basecolors-shape-accent: var(--shape-accent);
14
+ --basecolors-shape-disabled: var(--shape-neutral);
15
+ --basecolors-shape-disabledalt: var(--shape-neutralalt);
16
+ --basecolors-shape-highlight: var(--stroke-highlight);
17
+ --basecolors-shape-light: var(--shape-light);
18
+ --basecolors-shape-mask: var(--shape-light);
19
+ --basecolors-shape-maskalt: var(--shape-light);
20
+ --basecolors-shape-subdued: var(--shape-subdued);
21
+ --basecolors-shape-subduedalt: var(--shape-subduedalt);
22
+ --basecolors-stroke-contrast: var(--stroke-contrast);
23
+ --basecolors-stroke-default: var(--stroke-accent);
24
+ --basecolors-stroke-disabled: var(--stroke-neutralalt);
25
+ --basecolors-stroke-focus-contrast: var(--stroke-contrast);
26
+ --basecolors-stroke-focus-standard: var(--stroke-accent);
27
+ --basecolors-stroke-highlight: var(--stroke-highlight);
28
+ --basecolors-stroke-light: var(--stroke-light);
29
+ --basecolors-stroke-subdued: var(--stroke-subdued);
30
+ --basecolors-stroke-subduedalt: var(--stroke-neutral);
31
+ --basecolors-text-accent: var(--text-accent);
32
+ --basecolors-text-disabled: var(--text-neutral);
33
+ --basecolors-text-disabledalt: var(--text-neutralalt);
34
+ --basecolors-text-highlight: var(--stroke-highlight);
35
+ --basecolors-text-light: var(--text-light);
36
+ --basecolors-text-subdued: var(--text-subdued);
37
+ --basecolors-text-subduedalt: var(--text-subduedalt);
38
+ }
39
+
40
+ [data-color-mode='dark'] {
41
+ --basecolors-frame-contrast: var(--fill-background-contrast-dark);
42
+ --basecolors-frame-contrastalt: var(--fill-background-tint-dark);
43
+ --basecolors-frame-default: var(--fill-background-standard-dark);
44
+ --basecolors-frame-elevated: var(--fill-background-overlay-transparent);
45
+ --basecolors-frame-elevatedalt: var(--fill-background-overlay-solidalt);
46
+ --basecolors-frame-subdued: var(--fill-background-subdued-dark);
47
+ --basecolors-frame-tint: var(--fill-background-tint-dark);
48
+ --basecolors-shape-accent: var(--shape-lightalt);
49
+ --basecolors-shape-disabled: var(--shape-neutralalt);
50
+ --basecolors-shape-disabledalt: var(--shape-darkalt);
51
+ --basecolors-shape-highlight: var(--stroke-highlightalt);
52
+ --basecolors-shape-light: var(--shape-lightalt);
53
+ --basecolors-shape-mask: var(--fill-background-subdued-dark);
54
+ --basecolors-shape-maskalt: var(--fill-background-overlay-solid);
55
+ --basecolors-shape-subdued: var(--shape-darkalt);
56
+ --basecolors-shape-subduedalt: var(--shape-darkalt);
57
+ --basecolors-stroke-contrast: var(--stroke-contrast);
58
+ --basecolors-stroke-default: var(--stroke-dark);
59
+ --basecolors-stroke-disabled: var(--stroke-neutral);
60
+ --basecolors-stroke-focus-contrast: var(--stroke-contrast);
61
+ --basecolors-stroke-focus-standard: var(--stroke-contrast);
62
+ --basecolors-stroke-highlight: var(--stroke-highlightalt);
63
+ --basecolors-stroke-light: var(--stroke-dark);
64
+ --basecolors-stroke-subdued: var(--stroke-darkalt);
65
+ --basecolors-stroke-subduedalt: var(--stroke-darkalt);
66
+ --basecolors-text-accent: var(--text-lightalt);
67
+ --basecolors-text-disabled: var(--text-neutralalt);
68
+ --basecolors-text-disabledalt: var(--text-neutralalt);
69
+ --basecolors-text-highlight: var(--stroke-highlightalt);
70
+ --basecolors-text-light: var(--text-lightalt);
71
+ --basecolors-text-subdued: var(--text-darkalt);
72
+ --basecolors-text-subduedalt: var(--text-darkalt);
73
+ }
package/dist/base.d.ts ADDED
@@ -0,0 +1,90 @@
1
+ export declare const base: {
2
+ light: {
3
+ baseColors: {
4
+ frame: {
5
+ contrast: string;
6
+ contrastalt: string;
7
+ default: string;
8
+ elevated: string;
9
+ elevatedalt: string;
10
+ subdued: string;
11
+ tint: string;
12
+ };
13
+ shape: {
14
+ accent: string;
15
+ disabled: string;
16
+ disabledalt: string;
17
+ highlight: string;
18
+ light: string;
19
+ mask: string;
20
+ maskalt: string;
21
+ subdued: string;
22
+ subduedalt: string;
23
+ };
24
+ stroke: {
25
+ contrast: string;
26
+ default: string;
27
+ disabled: string;
28
+ focusContrast: string;
29
+ focusStandard: string;
30
+ highlight: string;
31
+ light: string;
32
+ subdued: string;
33
+ subduedalt: string;
34
+ };
35
+ text: {
36
+ accent: string;
37
+ disabled: string;
38
+ disabledalt: string;
39
+ highlight: string;
40
+ light: string;
41
+ subdued: string;
42
+ subduedalt: string;
43
+ };
44
+ };
45
+ };
46
+ dark: {
47
+ baseColors: {
48
+ frame: {
49
+ contrast: string;
50
+ contrastalt: string;
51
+ default: string;
52
+ elevated: string;
53
+ elevatedalt: string;
54
+ subdued: string;
55
+ tint: string;
56
+ };
57
+ shape: {
58
+ accent: string;
59
+ disabled: string;
60
+ disabledalt: string;
61
+ highlight: string;
62
+ light: string;
63
+ mask: string;
64
+ maskalt: string;
65
+ subdued: string;
66
+ subduedalt: string;
67
+ };
68
+ stroke: {
69
+ contrast: string;
70
+ default: string;
71
+ disabled: string;
72
+ focusContrast: string;
73
+ focusStandard: string;
74
+ highlight: string;
75
+ light: string;
76
+ subdued: string;
77
+ subduedalt: string;
78
+ };
79
+ text: {
80
+ accent: string;
81
+ disabled: string;
82
+ disabledalt: string;
83
+ highlight: string;
84
+ light: string;
85
+ subdued: string;
86
+ subduedalt: string;
87
+ };
88
+ };
89
+ };
90
+ };
package/dist/base.less ADDED
@@ -0,0 +1,73 @@
1
+ @import '~@entur/tokens/dist/semantic.css';
2
+ /* DO NOT CHANGE!*/
3
+ /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
4
+ [data-color-mode='light'],
5
+ :root {
6
+ @basecolors-frame-contrast: @fill-background-contrast-light;
7
+ @basecolors-frame-contrastalt: @fill-background-contrast-lightalt;
8
+ @basecolors-frame-default: @fill-background-standard-light;
9
+ @basecolors-frame-elevated: @fill-background-standard-light;
10
+ @basecolors-frame-elevatedalt: @fill-background-tint-light;
11
+ @basecolors-frame-subdued: @fill-background-subdued-light;
12
+ @basecolors-frame-tint: @fill-background-tint-light;
13
+ @basecolors-shape-accent: @shape-accent;
14
+ @basecolors-shape-disabled: @shape-neutral;
15
+ @basecolors-shape-disabledalt: @shape-neutralalt;
16
+ @basecolors-shape-highlight: @stroke-highlight;
17
+ @basecolors-shape-light: @shape-light;
18
+ @basecolors-shape-mask: @shape-light;
19
+ @basecolors-shape-maskalt: @shape-light;
20
+ @basecolors-shape-subdued: @shape-subdued;
21
+ @basecolors-shape-subduedalt: @shape-subduedalt;
22
+ @basecolors-stroke-contrast: @stroke-contrast;
23
+ @basecolors-stroke-default: @stroke-accent;
24
+ @basecolors-stroke-disabled: @stroke-neutralalt;
25
+ @basecolors-stroke-focus-contrast: @stroke-contrast;
26
+ @basecolors-stroke-focus-standard: @stroke-accent;
27
+ @basecolors-stroke-highlight: @stroke-highlight;
28
+ @basecolors-stroke-light: @stroke-light;
29
+ @basecolors-stroke-subdued: @stroke-subdued;
30
+ @basecolors-stroke-subduedalt: @stroke-neutral;
31
+ @basecolors-text-accent: @text-accent;
32
+ @basecolors-text-disabled: @text-neutral;
33
+ @basecolors-text-disabledalt: @text-neutralalt;
34
+ @basecolors-text-highlight: @stroke-highlight;
35
+ @basecolors-text-light: @text-light;
36
+ @basecolors-text-subdued: @text-subdued;
37
+ @basecolors-text-subduedalt: @text-subduedalt;
38
+ }
39
+
40
+ [data-color-mode='dark'] {
41
+ @basecolors-frame-contrast: @fill-background-contrast-dark;
42
+ @basecolors-frame-contrastalt: @fill-background-tint-dark;
43
+ @basecolors-frame-default: @fill-background-standard-dark;
44
+ @basecolors-frame-elevated: @fill-background-overlay-transparent;
45
+ @basecolors-frame-elevatedalt: @fill-background-overlay-solidalt;
46
+ @basecolors-frame-subdued: @fill-background-subdued-dark;
47
+ @basecolors-frame-tint: @fill-background-tint-dark;
48
+ @basecolors-shape-accent: @shape-lightalt;
49
+ @basecolors-shape-disabled: @shape-neutralalt;
50
+ @basecolors-shape-disabledalt: @shape-darkalt;
51
+ @basecolors-shape-highlight: @stroke-highlightalt;
52
+ @basecolors-shape-light: @shape-lightalt;
53
+ @basecolors-shape-mask: @fill-background-subdued-dark;
54
+ @basecolors-shape-maskalt: @fill-background-overlay-solid;
55
+ @basecolors-shape-subdued: @shape-darkalt;
56
+ @basecolors-shape-subduedalt: @shape-darkalt;
57
+ @basecolors-stroke-contrast: @stroke-contrast;
58
+ @basecolors-stroke-default: @stroke-dark;
59
+ @basecolors-stroke-disabled: @stroke-neutral;
60
+ @basecolors-stroke-focus-contrast: @stroke-contrast;
61
+ @basecolors-stroke-focus-standard: @stroke-contrast;
62
+ @basecolors-stroke-highlight: @stroke-highlightalt;
63
+ @basecolors-stroke-light: @stroke-dark;
64
+ @basecolors-stroke-subdued: @stroke-darkalt;
65
+ @basecolors-stroke-subduedalt: @stroke-darkalt;
66
+ @basecolors-text-accent: @text-lightalt;
67
+ @basecolors-text-disabled: @text-neutralalt;
68
+ @basecolors-text-disabledalt: @text-neutralalt;
69
+ @basecolors-text-highlight: @stroke-highlightalt;
70
+ @basecolors-text-light: @text-lightalt;
71
+ @basecolors-text-subdued: @text-darkalt;
72
+ @basecolors-text-subduedalt: @text-darkalt;
73
+ }
package/dist/base.scss ADDED
@@ -0,0 +1,73 @@
1
+ @use '~@entur/tokens/dist/semantic.css';
2
+ /* DO NOT CHANGE!*/
3
+ /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
4
+ [data-color-mode='light'],
5
+ :root {
6
+ $basecolors-frame-contrast: $fill-background-contrast-light;
7
+ $basecolors-frame-contrastalt: $fill-background-contrast-lightalt;
8
+ $basecolors-frame-default: $fill-background-standard-light;
9
+ $basecolors-frame-elevated: $fill-background-standard-light;
10
+ $basecolors-frame-elevatedalt: $fill-background-tint-light;
11
+ $basecolors-frame-subdued: $fill-background-subdued-light;
12
+ $basecolors-frame-tint: $fill-background-tint-light;
13
+ $basecolors-shape-accent: $shape-accent;
14
+ $basecolors-shape-disabled: $shape-neutral;
15
+ $basecolors-shape-disabledalt: $shape-neutralalt;
16
+ $basecolors-shape-highlight: $stroke-highlight;
17
+ $basecolors-shape-light: $shape-light;
18
+ $basecolors-shape-mask: $shape-light;
19
+ $basecolors-shape-maskalt: $shape-light;
20
+ $basecolors-shape-subdued: $shape-subdued;
21
+ $basecolors-shape-subduedalt: $shape-subduedalt;
22
+ $basecolors-stroke-contrast: $stroke-contrast;
23
+ $basecolors-stroke-default: $stroke-accent;
24
+ $basecolors-stroke-disabled: $stroke-neutralalt;
25
+ $basecolors-stroke-focus-contrast: $stroke-contrast;
26
+ $basecolors-stroke-focus-standard: $stroke-accent;
27
+ $basecolors-stroke-highlight: $stroke-highlight;
28
+ $basecolors-stroke-light: $stroke-light;
29
+ $basecolors-stroke-subdued: $stroke-subdued;
30
+ $basecolors-stroke-subduedalt: $stroke-neutral;
31
+ $basecolors-text-accent: $text-accent;
32
+ $basecolors-text-disabled: $text-neutral;
33
+ $basecolors-text-disabledalt: $text-neutralalt;
34
+ $basecolors-text-highlight: $stroke-highlight;
35
+ $basecolors-text-light: $text-light;
36
+ $basecolors-text-subdued: $text-subdued;
37
+ $basecolors-text-subduedalt: $text-subduedalt;
38
+ }
39
+
40
+ [data-color-mode='dark'] {
41
+ $basecolors-frame-contrast: $fill-background-contrast-dark;
42
+ $basecolors-frame-contrastalt: $fill-background-tint-dark;
43
+ $basecolors-frame-default: $fill-background-standard-dark;
44
+ $basecolors-frame-elevated: $fill-background-overlay-transparent;
45
+ $basecolors-frame-elevatedalt: $fill-background-overlay-solidalt;
46
+ $basecolors-frame-subdued: $fill-background-subdued-dark;
47
+ $basecolors-frame-tint: $fill-background-tint-dark;
48
+ $basecolors-shape-accent: $shape-lightalt;
49
+ $basecolors-shape-disabled: $shape-neutralalt;
50
+ $basecolors-shape-disabledalt: $shape-darkalt;
51
+ $basecolors-shape-highlight: $stroke-highlightalt;
52
+ $basecolors-shape-light: $shape-lightalt;
53
+ $basecolors-shape-mask: $fill-background-subdued-dark;
54
+ $basecolors-shape-maskalt: $fill-background-overlay-solid;
55
+ $basecolors-shape-subdued: $shape-darkalt;
56
+ $basecolors-shape-subduedalt: $shape-darkalt;
57
+ $basecolors-stroke-contrast: $stroke-contrast;
58
+ $basecolors-stroke-default: $stroke-dark;
59
+ $basecolors-stroke-disabled: $stroke-neutral;
60
+ $basecolors-stroke-focus-contrast: $stroke-contrast;
61
+ $basecolors-stroke-focus-standard: $stroke-contrast;
62
+ $basecolors-stroke-highlight: $stroke-highlightalt;
63
+ $basecolors-stroke-light: $stroke-dark;
64
+ $basecolors-stroke-subdued: $stroke-darkalt;
65
+ $basecolors-stroke-subduedalt: $stroke-darkalt;
66
+ $basecolors-text-accent: $text-lightalt;
67
+ $basecolors-text-disabled: $text-neutralalt;
68
+ $basecolors-text-disabledalt: $text-neutralalt;
69
+ $basecolors-text-highlight: $stroke-highlightalt;
70
+ $basecolors-text-light: $text-lightalt;
71
+ $basecolors-text-subdued: $text-darkalt;
72
+ $basecolors-text-subduedalt: $text-darkalt;
73
+ }