@atlaskit/tokens 1.5.2 → 1.7.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/CHANGELOG.md +16 -0
- package/dist/cjs/artifacts/palettes-raw/shape-palette.js +3 -3
- package/dist/cjs/artifacts/themes/atlassian-shape.js +2 -2
- package/dist/cjs/artifacts/token-default-values.js +12 -10
- package/dist/cjs/artifacts/token-names.js +12 -10
- package/dist/cjs/artifacts/tokens-raw/atlassian-dark-new-input-border.js +3 -267
- package/dist/cjs/artifacts/tokens-raw/atlassian-dark.js +33 -33
- package/dist/cjs/artifacts/tokens-raw/atlassian-legacy-dark.js +33 -33
- package/dist/cjs/artifacts/tokens-raw/atlassian-legacy-light.js +33 -33
- package/dist/cjs/artifacts/tokens-raw/atlassian-light-new-input-border.js +3 -267
- package/dist/cjs/artifacts/tokens-raw/atlassian-light.js +33 -33
- package/dist/cjs/artifacts/tokens-raw/atlassian-shape.js +81 -37
- package/dist/cjs/constants.js +1 -1
- package/dist/cjs/get-token-value.js +1 -1
- package/dist/cjs/get-token.js +1 -1
- package/dist/cjs/palettes/shape-palette.js +2 -1
- package/dist/cjs/set-global-theme.js +38 -3
- package/dist/cjs/tokens/atlassian-shape/shape.js +7 -1
- package/dist/cjs/tokens/default/shape/shape.js +33 -17
- package/dist/cjs/utils/theme-state-transformer.js +2 -1
- package/dist/cjs/utils/token-order.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/artifacts/palettes-raw/shape-palette.js +3 -3
- package/dist/es2019/artifacts/themes/atlassian-shape.js +12 -10
- package/dist/es2019/artifacts/token-default-values.js +12 -10
- package/dist/es2019/artifacts/token-names.js +12 -10
- package/dist/es2019/artifacts/tokens-raw/atlassian-dark-new-input-border.js +3 -267
- package/dist/es2019/artifacts/tokens-raw/atlassian-dark.js +33 -33
- package/dist/es2019/artifacts/tokens-raw/atlassian-legacy-dark.js +33 -33
- package/dist/es2019/artifacts/tokens-raw/atlassian-legacy-light.js +33 -33
- package/dist/es2019/artifacts/tokens-raw/atlassian-light-new-input-border.js +3 -267
- package/dist/es2019/artifacts/tokens-raw/atlassian-light.js +33 -33
- package/dist/es2019/artifacts/tokens-raw/atlassian-shape.js +81 -37
- package/dist/es2019/constants.js +1 -1
- package/dist/es2019/get-token-value.js +1 -1
- package/dist/es2019/get-token.js +1 -1
- package/dist/es2019/palettes/shape-palette.js +2 -1
- package/dist/es2019/set-global-theme.js +34 -2
- package/dist/es2019/tokens/atlassian-shape/shape.js +7 -1
- package/dist/es2019/tokens/default/shape/shape.js +33 -17
- package/dist/es2019/utils/theme-state-transformer.js +2 -1
- package/dist/es2019/utils/token-order.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/artifacts/palettes-raw/shape-palette.js +3 -3
- package/dist/esm/artifacts/themes/atlassian-shape.js +2 -2
- package/dist/esm/artifacts/token-default-values.js +12 -10
- package/dist/esm/artifacts/token-names.js +12 -10
- package/dist/esm/artifacts/tokens-raw/atlassian-dark-new-input-border.js +3 -267
- package/dist/esm/artifacts/tokens-raw/atlassian-dark.js +33 -33
- package/dist/esm/artifacts/tokens-raw/atlassian-legacy-dark.js +33 -33
- package/dist/esm/artifacts/tokens-raw/atlassian-legacy-light.js +33 -33
- package/dist/esm/artifacts/tokens-raw/atlassian-light-new-input-border.js +3 -267
- package/dist/esm/artifacts/tokens-raw/atlassian-light.js +33 -33
- package/dist/esm/artifacts/tokens-raw/atlassian-shape.js +81 -37
- package/dist/esm/constants.js +1 -1
- package/dist/esm/get-token-value.js +1 -1
- package/dist/esm/get-token.js +1 -1
- package/dist/esm/palettes/shape-palette.js +2 -1
- package/dist/esm/set-global-theme.js +38 -3
- package/dist/esm/tokens/atlassian-shape/shape.js +7 -1
- package/dist/esm/tokens/default/shape/shape.js +33 -17
- package/dist/esm/utils/theme-state-transformer.js +2 -1
- package/dist/esm/utils/token-order.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/artifacts/palettes-raw/shape-palette.d.ts +3 -18
- package/dist/types/artifacts/themes/atlassian-shape.d.ts +2 -2
- package/dist/types/artifacts/token-default-values.d.ts +12 -10
- package/dist/types/artifacts/token-names.d.ts +23 -19
- package/dist/types/artifacts/tokens-raw/atlassian-shape.d.ts +1 -1
- package/dist/types/artifacts/types-internal.d.ts +2 -2
- package/dist/types/artifacts/types.d.ts +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/palettes/shape-palette.d.ts +1 -1
- package/dist/types/set-global-theme.d.ts +10 -7
- package/dist/types/types.d.ts +3 -1
- package/dist/types-ts4.5/artifacts/palettes-raw/shape-palette.d.ts +3 -18
- package/dist/types-ts4.5/artifacts/themes/atlassian-shape.d.ts +2 -2
- package/dist/types-ts4.5/artifacts/token-default-values.d.ts +12 -10
- package/dist/types-ts4.5/artifacts/token-names.d.ts +23 -19
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-dark-new-input-border.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-dark.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-legacy-dark.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-legacy-light.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-light-new-input-border.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-light.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-shape.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/types-internal.d.ts +2 -2
- package/dist/types-ts4.5/artifacts/types.d.ts +2 -2
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/palettes/shape-palette.d.ts +1 -1
- package/dist/types-ts4.5/set-global-theme.d.ts +10 -7
- package/dist/types-ts4.5/types.d.ts +3 -1
- package/figma/atlassian-dark.json +16 -16
- package/figma/atlassian-legacy-dark.json +16 -16
- package/figma/atlassian-legacy-light.json +16 -16
- package/figma/atlassian-light.json +16 -16
- package/figma/atlassian-shape.json +36 -18
- package/package.json +6 -4
- package/report.api.md +125 -22
- package/tmp/api-report-tmp.d.ts +107 -27
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
3
|
+
* @codegen <<SignedSource::8b50feb722f3a686c5a45c85ec5545b2>>
|
|
4
4
|
* @codegenCommand yarn build tokens
|
|
5
5
|
*/
|
|
6
6
|
var tokens = [{
|
|
7
7
|
"attributes": {
|
|
8
8
|
"group": "shape",
|
|
9
|
-
"state": "
|
|
9
|
+
"state": "active",
|
|
10
10
|
"introduced": "1.1.0",
|
|
11
|
-
"description": "
|
|
11
|
+
"description": "Used for selection indicators, like tabs."
|
|
12
12
|
},
|
|
13
13
|
"value": "2px",
|
|
14
14
|
"filePath": "src/tokens/atlassian-shape/shape.tsx",
|
|
@@ -16,9 +16,9 @@ var tokens = [{
|
|
|
16
16
|
"original": {
|
|
17
17
|
"attributes": {
|
|
18
18
|
"group": "shape",
|
|
19
|
-
"state": "
|
|
19
|
+
"state": "active",
|
|
20
20
|
"introduced": "1.1.0",
|
|
21
|
-
"description": "
|
|
21
|
+
"description": "Used for selection indicators, like tabs."
|
|
22
22
|
},
|
|
23
23
|
"value": "Radius050"
|
|
24
24
|
},
|
|
@@ -28,9 +28,31 @@ var tokens = [{
|
|
|
28
28
|
}, {
|
|
29
29
|
"attributes": {
|
|
30
30
|
"group": "shape",
|
|
31
|
-
"state": "
|
|
31
|
+
"state": "active",
|
|
32
|
+
"introduced": "1.5.2",
|
|
33
|
+
"description": "The default border radius."
|
|
34
|
+
},
|
|
35
|
+
"value": "4px",
|
|
36
|
+
"filePath": "src/tokens/atlassian-shape/shape.tsx",
|
|
37
|
+
"isSource": true,
|
|
38
|
+
"original": {
|
|
39
|
+
"attributes": {
|
|
40
|
+
"group": "shape",
|
|
41
|
+
"state": "active",
|
|
42
|
+
"introduced": "1.5.2",
|
|
43
|
+
"description": "The default border radius."
|
|
44
|
+
},
|
|
45
|
+
"value": "Radius100"
|
|
46
|
+
},
|
|
47
|
+
"name": "border.radius.[default]",
|
|
48
|
+
"path": ["border", "radius", "[default]"],
|
|
49
|
+
"cleanName": "border.radius"
|
|
50
|
+
}, {
|
|
51
|
+
"attributes": {
|
|
52
|
+
"group": "shape",
|
|
53
|
+
"state": "active",
|
|
32
54
|
"introduced": "1.1.0",
|
|
33
|
-
"description": "
|
|
55
|
+
"description": "Used for buttons and inputs."
|
|
34
56
|
},
|
|
35
57
|
"value": "4px",
|
|
36
58
|
"filePath": "src/tokens/atlassian-shape/shape.tsx",
|
|
@@ -38,9 +60,9 @@ var tokens = [{
|
|
|
38
60
|
"original": {
|
|
39
61
|
"attributes": {
|
|
40
62
|
"group": "shape",
|
|
41
|
-
"state": "
|
|
63
|
+
"state": "active",
|
|
42
64
|
"introduced": "1.1.0",
|
|
43
|
-
"description": "
|
|
65
|
+
"description": "Used for buttons and inputs."
|
|
44
66
|
},
|
|
45
67
|
"value": "Radius100"
|
|
46
68
|
},
|
|
@@ -50,9 +72,9 @@ var tokens = [{
|
|
|
50
72
|
}, {
|
|
51
73
|
"attributes": {
|
|
52
74
|
"group": "shape",
|
|
53
|
-
"state": "
|
|
75
|
+
"state": "active",
|
|
54
76
|
"introduced": "1.1.0",
|
|
55
|
-
"description": "
|
|
77
|
+
"description": "Used for smaller cards."
|
|
56
78
|
},
|
|
57
79
|
"value": "8px",
|
|
58
80
|
"filePath": "src/tokens/atlassian-shape/shape.tsx",
|
|
@@ -60,9 +82,9 @@ var tokens = [{
|
|
|
60
82
|
"original": {
|
|
61
83
|
"attributes": {
|
|
62
84
|
"group": "shape",
|
|
63
|
-
"state": "
|
|
85
|
+
"state": "active",
|
|
64
86
|
"introduced": "1.1.0",
|
|
65
|
-
"description": "
|
|
87
|
+
"description": "Used for smaller cards."
|
|
66
88
|
},
|
|
67
89
|
"value": "Radius200"
|
|
68
90
|
},
|
|
@@ -72,9 +94,9 @@ var tokens = [{
|
|
|
72
94
|
}, {
|
|
73
95
|
"attributes": {
|
|
74
96
|
"group": "shape",
|
|
75
|
-
"state": "
|
|
97
|
+
"state": "active",
|
|
76
98
|
"introduced": "1.1.0",
|
|
77
|
-
"description": "
|
|
99
|
+
"description": "Used for cards and larger containers."
|
|
78
100
|
},
|
|
79
101
|
"value": "12px",
|
|
80
102
|
"filePath": "src/tokens/atlassian-shape/shape.tsx",
|
|
@@ -82,9 +104,9 @@ var tokens = [{
|
|
|
82
104
|
"original": {
|
|
83
105
|
"attributes": {
|
|
84
106
|
"group": "shape",
|
|
85
|
-
"state": "
|
|
107
|
+
"state": "active",
|
|
86
108
|
"introduced": "1.1.0",
|
|
87
|
-
"description": "
|
|
109
|
+
"description": "Used for cards and larger containers."
|
|
88
110
|
},
|
|
89
111
|
"value": "Radius300"
|
|
90
112
|
},
|
|
@@ -94,9 +116,9 @@ var tokens = [{
|
|
|
94
116
|
}, {
|
|
95
117
|
"attributes": {
|
|
96
118
|
"group": "shape",
|
|
97
|
-
"state": "
|
|
119
|
+
"state": "active",
|
|
98
120
|
"introduced": "1.1.0",
|
|
99
|
-
"description": "
|
|
121
|
+
"description": "Used for modals."
|
|
100
122
|
},
|
|
101
123
|
"value": "16px",
|
|
102
124
|
"filePath": "src/tokens/atlassian-shape/shape.tsx",
|
|
@@ -104,9 +126,9 @@ var tokens = [{
|
|
|
104
126
|
"original": {
|
|
105
127
|
"attributes": {
|
|
106
128
|
"group": "shape",
|
|
107
|
-
"state": "
|
|
129
|
+
"state": "active",
|
|
108
130
|
"introduced": "1.1.0",
|
|
109
|
-
"description": "
|
|
131
|
+
"description": "Used for modals."
|
|
110
132
|
},
|
|
111
133
|
"value": "Radius400"
|
|
112
134
|
},
|
|
@@ -116,25 +138,47 @@ var tokens = [{
|
|
|
116
138
|
}, {
|
|
117
139
|
"attributes": {
|
|
118
140
|
"group": "shape",
|
|
119
|
-
"state": "
|
|
141
|
+
"state": "active",
|
|
120
142
|
"introduced": "1.1.0",
|
|
121
|
-
"description": "
|
|
143
|
+
"description": "Used for circular containers, like a rounded button."
|
|
122
144
|
},
|
|
123
|
-
"value": "
|
|
145
|
+
"value": "32032px",
|
|
124
146
|
"filePath": "src/tokens/atlassian-shape/shape.tsx",
|
|
125
147
|
"isSource": true,
|
|
126
148
|
"original": {
|
|
127
149
|
"attributes": {
|
|
128
150
|
"group": "shape",
|
|
129
|
-
"state": "
|
|
151
|
+
"state": "active",
|
|
130
152
|
"introduced": "1.1.0",
|
|
131
|
-
"description": "
|
|
153
|
+
"description": "Used for circular containers, like a rounded button."
|
|
132
154
|
},
|
|
133
155
|
"value": "RadiusCircle"
|
|
134
156
|
},
|
|
135
|
-
"name": "border.radius.
|
|
136
|
-
"path": ["border", "radius", "
|
|
137
|
-
"cleanName": "border.radius.
|
|
157
|
+
"name": "border.radius.circle",
|
|
158
|
+
"path": ["border", "radius", "circle"],
|
|
159
|
+
"cleanName": "border.radius.circle"
|
|
160
|
+
}, {
|
|
161
|
+
"attributes": {
|
|
162
|
+
"group": "shape",
|
|
163
|
+
"state": "active",
|
|
164
|
+
"introduced": "1.5.2",
|
|
165
|
+
"description": "The default border width."
|
|
166
|
+
},
|
|
167
|
+
"value": "1px",
|
|
168
|
+
"filePath": "src/tokens/atlassian-shape/shape.tsx",
|
|
169
|
+
"isSource": true,
|
|
170
|
+
"original": {
|
|
171
|
+
"attributes": {
|
|
172
|
+
"group": "shape",
|
|
173
|
+
"state": "active",
|
|
174
|
+
"introduced": "1.5.2",
|
|
175
|
+
"description": "The default border width."
|
|
176
|
+
},
|
|
177
|
+
"value": "Size050"
|
|
178
|
+
},
|
|
179
|
+
"name": "border.width.[default]",
|
|
180
|
+
"path": ["border", "width", "[default]"],
|
|
181
|
+
"cleanName": "border.width"
|
|
138
182
|
}, {
|
|
139
183
|
"attributes": {
|
|
140
184
|
"group": "shape",
|
|
@@ -160,9 +204,9 @@ var tokens = [{
|
|
|
160
204
|
}, {
|
|
161
205
|
"attributes": {
|
|
162
206
|
"group": "shape",
|
|
163
|
-
"state": "
|
|
207
|
+
"state": "active",
|
|
164
208
|
"introduced": "1.1.0",
|
|
165
|
-
"description": "
|
|
209
|
+
"description": "Used for all borders and dividers."
|
|
166
210
|
},
|
|
167
211
|
"value": "1px",
|
|
168
212
|
"filePath": "src/tokens/atlassian-shape/shape.tsx",
|
|
@@ -170,9 +214,9 @@ var tokens = [{
|
|
|
170
214
|
"original": {
|
|
171
215
|
"attributes": {
|
|
172
216
|
"group": "shape",
|
|
173
|
-
"state": "
|
|
217
|
+
"state": "active",
|
|
174
218
|
"introduced": "1.1.0",
|
|
175
|
-
"description": "
|
|
219
|
+
"description": "Used for all borders and dividers."
|
|
176
220
|
},
|
|
177
221
|
"value": "Size050"
|
|
178
222
|
},
|
|
@@ -182,9 +226,9 @@ var tokens = [{
|
|
|
182
226
|
}, {
|
|
183
227
|
"attributes": {
|
|
184
228
|
"group": "shape",
|
|
185
|
-
"state": "
|
|
229
|
+
"state": "active",
|
|
186
230
|
"introduced": "1.1.0",
|
|
187
|
-
"description": "
|
|
231
|
+
"description": "Used for bolder dividers and interaction states."
|
|
188
232
|
},
|
|
189
233
|
"value": "2px",
|
|
190
234
|
"filePath": "src/tokens/atlassian-shape/shape.tsx",
|
|
@@ -192,9 +236,9 @@ var tokens = [{
|
|
|
192
236
|
"original": {
|
|
193
237
|
"attributes": {
|
|
194
238
|
"group": "shape",
|
|
195
|
-
"state": "
|
|
239
|
+
"state": "active",
|
|
196
240
|
"introduced": "1.1.0",
|
|
197
|
-
"description": "
|
|
241
|
+
"description": "Used for bolder dividers and interaction states."
|
|
198
242
|
},
|
|
199
243
|
"value": "Size100"
|
|
200
244
|
},
|
package/dist/esm/constants.js
CHANGED
|
@@ -2,5 +2,5 @@ export var THEME_DATA_ATTRIBUTE = 'data-theme';
|
|
|
2
2
|
export var COLOR_MODE_ATTRIBUTE = 'data-color-mode';
|
|
3
3
|
export var DEFAULT_THEME = 'light';
|
|
4
4
|
export var CSS_PREFIX = 'ds';
|
|
5
|
-
export var CSS_VAR_FULL = ['opacity', 'font', 'space'];
|
|
5
|
+
export var CSS_VAR_FULL = ['opacity', 'font', 'space', 'border'];
|
|
6
6
|
export var TOKEN_NOT_FOUND_CSS_VAR = "--".concat(CSS_PREFIX, "-token-not-found");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import warnOnce from '@atlaskit/ds-lib/warn-once';
|
|
2
2
|
import tokens from './artifacts/token-names';
|
|
3
3
|
var name = "@atlaskit/tokens";
|
|
4
|
-
var version = "1.
|
|
4
|
+
var version = "1.7.0";
|
|
5
5
|
/**
|
|
6
6
|
* Takes a dot-separated token name and and an optional fallback, and returns the current computed CSS value for the
|
|
7
7
|
* resulting CSS Custom Property.
|
package/dist/esm/get-token.js
CHANGED
|
@@ -2,7 +2,7 @@ import warnOnce from '@atlaskit/ds-lib/warn-once';
|
|
|
2
2
|
import tokens from './artifacts/token-names';
|
|
3
3
|
import { TOKEN_NOT_FOUND_CSS_VAR } from './constants';
|
|
4
4
|
var name = "@atlaskit/tokens";
|
|
5
|
-
var version = "1.
|
|
5
|
+
var version = "1.7.0";
|
|
6
6
|
/**
|
|
7
7
|
* Takes a dot-separated token name and an optional fallback, and returns the CSS custom property for the corresponding token.
|
|
8
8
|
* This should be used to implement design decisions throughout your application.
|
|
@@ -21,6 +21,7 @@ var themeStateDefaults = {
|
|
|
21
21
|
colorMode: 'auto',
|
|
22
22
|
dark: 'dark',
|
|
23
23
|
light: 'light',
|
|
24
|
+
shape: undefined,
|
|
24
25
|
spacing: undefined,
|
|
25
26
|
typography: undefined
|
|
26
27
|
};
|
|
@@ -38,10 +39,11 @@ var getThemePreferences = function getThemePreferences(themeState) {
|
|
|
38
39
|
var colorMode = themeState.colorMode,
|
|
39
40
|
dark = themeState.dark,
|
|
40
41
|
light = themeState.light,
|
|
42
|
+
shape = themeState.shape,
|
|
41
43
|
spacing = themeState.spacing,
|
|
42
44
|
typography = themeState.typography;
|
|
43
45
|
var themePreferences = colorMode === 'auto' ? [light, dark] : [themeState[colorMode]];
|
|
44
|
-
[spacing, typography].forEach(function (themeId) {
|
|
46
|
+
[shape, spacing, typography].forEach(function (themeId) {
|
|
45
47
|
if (themeId) {
|
|
46
48
|
themePreferences.push(themeId);
|
|
47
49
|
}
|
|
@@ -49,6 +51,16 @@ var getThemePreferences = function getThemePreferences(themeState) {
|
|
|
49
51
|
if (getBooleanFF('platform.design-system-team.update-border-input_ff9l1')) {
|
|
50
52
|
themePreferences.push("".concat(themePreferences.includes('dark') ? 'dark' : 'light', "-new-input-border"));
|
|
51
53
|
}
|
|
54
|
+
|
|
55
|
+
// Load shape and spacing by default, currently behind a feature flag
|
|
56
|
+
if (getBooleanFF('platform.design-system-team.space-and-shape-tokens_q5me6')) {
|
|
57
|
+
if (!themePreferences.includes('shape')) {
|
|
58
|
+
themePreferences.push('shape');
|
|
59
|
+
}
|
|
60
|
+
if (!themePreferences.includes('spacing')) {
|
|
61
|
+
themePreferences.push('spacing');
|
|
62
|
+
}
|
|
63
|
+
}
|
|
52
64
|
return _toConsumableArray(new Set(themePreferences));
|
|
53
65
|
};
|
|
54
66
|
|
|
@@ -59,6 +71,7 @@ var getThemePreferences = function getThemePreferences(themeState) {
|
|
|
59
71
|
* @param {string} themeState.colorMode Determines which color theme is applied. If set to `auto`, the theme applied will be determined by the OS setting.
|
|
60
72
|
* @param {string} themeState.dark The color theme to be applied when the color mode resolves to 'dark'.
|
|
61
73
|
* @param {string} themeState.light The color theme to be applied when the color mode resolves to 'light'.
|
|
74
|
+
* @param {string} themeState.shape The shape theme to be applied.
|
|
62
75
|
* @param {string} themeState.spacing The spacing theme to be applied.
|
|
63
76
|
* @param {string} themeState.typography The typography theme to be applied.
|
|
64
77
|
*
|
|
@@ -78,6 +91,8 @@ var setGlobalTheme = /*#__PURE__*/function () {
|
|
|
78
91
|
dark,
|
|
79
92
|
_ref2$light,
|
|
80
93
|
light,
|
|
94
|
+
_ref2$shape,
|
|
95
|
+
shape,
|
|
81
96
|
_ref2$spacing,
|
|
82
97
|
spacing,
|
|
83
98
|
_ref2$typography,
|
|
@@ -88,11 +103,12 @@ var setGlobalTheme = /*#__PURE__*/function () {
|
|
|
88
103
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
89
104
|
while (1) switch (_context2.prev = _context2.next) {
|
|
90
105
|
case 0:
|
|
91
|
-
_ref2 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}, _ref2$colorMode = _ref2.colorMode, colorMode = _ref2$colorMode === void 0 ? themeStateDefaults['colorMode'] : _ref2$colorMode, _ref2$dark = _ref2.dark, dark = _ref2$dark === void 0 ? themeStateDefaults['dark'] : _ref2$dark, _ref2$light = _ref2.light, light = _ref2$light === void 0 ? themeStateDefaults['light'] : _ref2$light, _ref2$spacing = _ref2.spacing, spacing = _ref2$spacing === void 0 ? themeStateDefaults['spacing'] : _ref2$spacing, _ref2$typography = _ref2.typography, typography = _ref2$typography === void 0 ? themeStateDefaults['typography'] : _ref2$typography;
|
|
106
|
+
_ref2 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}, _ref2$colorMode = _ref2.colorMode, colorMode = _ref2$colorMode === void 0 ? themeStateDefaults['colorMode'] : _ref2$colorMode, _ref2$dark = _ref2.dark, dark = _ref2$dark === void 0 ? themeStateDefaults['dark'] : _ref2$dark, _ref2$light = _ref2.light, light = _ref2$light === void 0 ? themeStateDefaults['light'] : _ref2$light, _ref2$shape = _ref2.shape, shape = _ref2$shape === void 0 ? themeStateDefaults['shape'] : _ref2$shape, _ref2$spacing = _ref2.spacing, spacing = _ref2$spacing === void 0 ? themeStateDefaults['spacing'] : _ref2$spacing, _ref2$typography = _ref2.typography, typography = _ref2$typography === void 0 ? themeStateDefaults['typography'] : _ref2$typography;
|
|
92
107
|
themePreferences = getThemePreferences({
|
|
93
108
|
colorMode: colorMode,
|
|
94
109
|
dark: dark,
|
|
95
110
|
light: light,
|
|
111
|
+
shape: shape,
|
|
96
112
|
spacing: spacing,
|
|
97
113
|
typography: typography
|
|
98
114
|
});
|
|
@@ -155,6 +171,7 @@ var setGlobalTheme = /*#__PURE__*/function () {
|
|
|
155
171
|
colorMode: colorMode,
|
|
156
172
|
dark: dark,
|
|
157
173
|
light: light,
|
|
174
|
+
shape: shape,
|
|
158
175
|
spacing: spacing,
|
|
159
176
|
typography: typography
|
|
160
177
|
});
|
|
@@ -183,6 +200,7 @@ var setGlobalTheme = /*#__PURE__*/function () {
|
|
|
183
200
|
* @param {string} themeState.colorMode Determines which color theme is applied. If set to `auto`, the theme applied will be determined by the OS setting.
|
|
184
201
|
* @param {string} themeState.dark The color theme to be applied when the color mode resolves to 'dark'.
|
|
185
202
|
* @param {string} themeState.light The color theme to be applied when the color mode resolves to 'light'.
|
|
203
|
+
* @param {string} themeState.shape The shape theme to be applied.
|
|
186
204
|
* @param {string} themeState.spacing The spacing theme to be applied.
|
|
187
205
|
* @param {string} themeState.typography The typography theme to be applied.
|
|
188
206
|
*
|
|
@@ -198,6 +216,8 @@ export var getThemeStyles = /*#__PURE__*/function () {
|
|
|
198
216
|
dark,
|
|
199
217
|
_ref7$light,
|
|
200
218
|
light,
|
|
219
|
+
_ref7$shape,
|
|
220
|
+
shape,
|
|
201
221
|
_ref7$spacing,
|
|
202
222
|
spacing,
|
|
203
223
|
_ref7$typography,
|
|
@@ -208,11 +228,12 @@ export var getThemeStyles = /*#__PURE__*/function () {
|
|
|
208
228
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
209
229
|
while (1) switch (_context4.prev = _context4.next) {
|
|
210
230
|
case 0:
|
|
211
|
-
_ref7 = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {}, _ref7$colorMode = _ref7.colorMode, colorMode = _ref7$colorMode === void 0 ? themeStateDefaults['colorMode'] : _ref7$colorMode, _ref7$dark = _ref7.dark, dark = _ref7$dark === void 0 ? themeStateDefaults['dark'] : _ref7$dark, _ref7$light = _ref7.light, light = _ref7$light === void 0 ? themeStateDefaults['light'] : _ref7$light, _ref7$spacing = _ref7.spacing, spacing = _ref7$spacing === void 0 ? themeStateDefaults['spacing'] : _ref7$spacing, _ref7$typography = _ref7.typography, typography = _ref7$typography === void 0 ? themeStateDefaults['typography'] : _ref7$typography;
|
|
231
|
+
_ref7 = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {}, _ref7$colorMode = _ref7.colorMode, colorMode = _ref7$colorMode === void 0 ? themeStateDefaults['colorMode'] : _ref7$colorMode, _ref7$dark = _ref7.dark, dark = _ref7$dark === void 0 ? themeStateDefaults['dark'] : _ref7$dark, _ref7$light = _ref7.light, light = _ref7$light === void 0 ? themeStateDefaults['light'] : _ref7$light, _ref7$shape = _ref7.shape, shape = _ref7$shape === void 0 ? themeStateDefaults['shape'] : _ref7$shape, _ref7$spacing = _ref7.spacing, spacing = _ref7$spacing === void 0 ? themeStateDefaults['spacing'] : _ref7$spacing, _ref7$typography = _ref7.typography, typography = _ref7$typography === void 0 ? themeStateDefaults['typography'] : _ref7$typography;
|
|
212
232
|
themePreferences = getThemePreferences({
|
|
213
233
|
colorMode: colorMode,
|
|
214
234
|
dark: dark,
|
|
215
235
|
light: light,
|
|
236
|
+
shape: shape,
|
|
216
237
|
spacing: spacing,
|
|
217
238
|
typography: typography
|
|
218
239
|
});
|
|
@@ -296,6 +317,8 @@ export var getThemeHtmlAttrs = function getThemeHtmlAttrs() {
|
|
|
296
317
|
dark = _ref9$dark === void 0 ? themeStateDefaults['dark'] : _ref9$dark,
|
|
297
318
|
_ref9$light = _ref9.light,
|
|
298
319
|
light = _ref9$light === void 0 ? themeStateDefaults['light'] : _ref9$light,
|
|
320
|
+
_ref9$shape = _ref9.shape,
|
|
321
|
+
shape = _ref9$shape === void 0 ? themeStateDefaults['shape'] : _ref9$shape,
|
|
299
322
|
_ref9$spacing = _ref9.spacing,
|
|
300
323
|
spacing = _ref9$spacing === void 0 ? themeStateDefaults['spacing'] : _ref9$spacing,
|
|
301
324
|
_ref9$typography = _ref9.typography,
|
|
@@ -303,9 +326,21 @@ export var getThemeHtmlAttrs = function getThemeHtmlAttrs() {
|
|
|
303
326
|
var themePreferences = {
|
|
304
327
|
dark: dark,
|
|
305
328
|
light: light,
|
|
329
|
+
shape: shape,
|
|
306
330
|
spacing: spacing,
|
|
307
331
|
typography: typography
|
|
308
332
|
};
|
|
333
|
+
|
|
334
|
+
// Load shape and spacing by default, currently behind a feature flag
|
|
335
|
+
if (getBooleanFF('platform.design-system-team.space-and-shape-tokens_q5me6')) {
|
|
336
|
+
themePreferences = {
|
|
337
|
+
dark: dark,
|
|
338
|
+
light: light,
|
|
339
|
+
shape: 'shape',
|
|
340
|
+
spacing: 'spacing',
|
|
341
|
+
typography: typography
|
|
342
|
+
};
|
|
343
|
+
}
|
|
309
344
|
var themeAttribute = themeObjectToString(themePreferences);
|
|
310
345
|
return _ref10 = {}, _defineProperty(_ref10, THEME_DATA_ATTRIBUTE, themeAttribute), _defineProperty(_ref10, COLOR_MODE_ATTRIBUTE, colorMode === 'auto' ? defaultColorMode : colorMode), _ref10;
|
|
311
346
|
};
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
var shape = {
|
|
6
6
|
border: {
|
|
7
7
|
width: {
|
|
8
|
+
'[default]': {
|
|
9
|
+
value: 'Size050'
|
|
10
|
+
},
|
|
8
11
|
'0': {
|
|
9
12
|
value: 'Size0'
|
|
10
13
|
},
|
|
@@ -16,6 +19,9 @@ var shape = {
|
|
|
16
19
|
}
|
|
17
20
|
},
|
|
18
21
|
radius: {
|
|
22
|
+
'[default]': {
|
|
23
|
+
value: 'Radius100'
|
|
24
|
+
},
|
|
19
25
|
'050': {
|
|
20
26
|
value: 'Radius050'
|
|
21
27
|
},
|
|
@@ -31,7 +37,7 @@ var shape = {
|
|
|
31
37
|
'400': {
|
|
32
38
|
value: 'Radius400'
|
|
33
39
|
},
|
|
34
|
-
|
|
40
|
+
circle: {
|
|
35
41
|
value: 'RadiusCircle'
|
|
36
42
|
}
|
|
37
43
|
}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
var shape = {
|
|
2
2
|
border: {
|
|
3
3
|
width: {
|
|
4
|
+
'[default]': {
|
|
5
|
+
attributes: {
|
|
6
|
+
group: 'shape',
|
|
7
|
+
state: 'active',
|
|
8
|
+
introduced: '1.5.2',
|
|
9
|
+
description: 'The default border width.'
|
|
10
|
+
}
|
|
11
|
+
},
|
|
4
12
|
'0': {
|
|
5
13
|
attributes: {
|
|
6
14
|
group: 'shape',
|
|
@@ -12,67 +20,75 @@ var shape = {
|
|
|
12
20
|
'050': {
|
|
13
21
|
attributes: {
|
|
14
22
|
group: 'shape',
|
|
15
|
-
state: '
|
|
23
|
+
state: 'active',
|
|
16
24
|
introduced: '1.1.0',
|
|
17
|
-
description: '
|
|
25
|
+
description: 'Used for all borders and dividers.'
|
|
18
26
|
}
|
|
19
27
|
},
|
|
20
28
|
'100': {
|
|
21
29
|
attributes: {
|
|
22
30
|
group: 'shape',
|
|
23
|
-
state: '
|
|
31
|
+
state: 'active',
|
|
24
32
|
introduced: '1.1.0',
|
|
25
|
-
description: '
|
|
33
|
+
description: 'Used for bolder dividers and interaction states.'
|
|
26
34
|
}
|
|
27
35
|
}
|
|
28
36
|
},
|
|
29
37
|
radius: {
|
|
38
|
+
'[default]': {
|
|
39
|
+
attributes: {
|
|
40
|
+
group: 'shape',
|
|
41
|
+
state: 'active',
|
|
42
|
+
introduced: '1.5.2',
|
|
43
|
+
description: 'The default border radius.'
|
|
44
|
+
}
|
|
45
|
+
},
|
|
30
46
|
'050': {
|
|
31
47
|
attributes: {
|
|
32
48
|
group: 'shape',
|
|
33
|
-
state: '
|
|
49
|
+
state: 'active',
|
|
34
50
|
introduced: '1.1.0',
|
|
35
|
-
description: '
|
|
51
|
+
description: 'Used for selection indicators, like tabs.'
|
|
36
52
|
}
|
|
37
53
|
},
|
|
38
54
|
'100': {
|
|
39
55
|
attributes: {
|
|
40
56
|
group: 'shape',
|
|
41
|
-
state: '
|
|
57
|
+
state: 'active',
|
|
42
58
|
introduced: '1.1.0',
|
|
43
|
-
description: '
|
|
59
|
+
description: 'Used for buttons and inputs.'
|
|
44
60
|
}
|
|
45
61
|
},
|
|
46
62
|
'200': {
|
|
47
63
|
attributes: {
|
|
48
64
|
group: 'shape',
|
|
49
|
-
state: '
|
|
65
|
+
state: 'active',
|
|
50
66
|
introduced: '1.1.0',
|
|
51
|
-
description: '
|
|
67
|
+
description: 'Used for smaller cards.'
|
|
52
68
|
}
|
|
53
69
|
},
|
|
54
70
|
'300': {
|
|
55
71
|
attributes: {
|
|
56
72
|
group: 'shape',
|
|
57
|
-
state: '
|
|
73
|
+
state: 'active',
|
|
58
74
|
introduced: '1.1.0',
|
|
59
|
-
description: '
|
|
75
|
+
description: 'Used for cards and larger containers.'
|
|
60
76
|
}
|
|
61
77
|
},
|
|
62
78
|
'400': {
|
|
63
79
|
attributes: {
|
|
64
80
|
group: 'shape',
|
|
65
|
-
state: '
|
|
81
|
+
state: 'active',
|
|
66
82
|
introduced: '1.1.0',
|
|
67
|
-
description: '
|
|
83
|
+
description: 'Used for modals.'
|
|
68
84
|
}
|
|
69
85
|
},
|
|
70
|
-
|
|
86
|
+
circle: {
|
|
71
87
|
attributes: {
|
|
72
88
|
group: 'shape',
|
|
73
|
-
state: '
|
|
89
|
+
state: 'active',
|
|
74
90
|
introduced: '1.1.0',
|
|
75
|
-
description: '
|
|
91
|
+
description: 'Used for circular containers, like a rounded button.'
|
|
76
92
|
}
|
|
77
93
|
}
|
|
78
94
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import { themeIds } from '../theme-config';
|
|
3
|
-
var themeKinds = ['light', 'dark', 'spacing', 'typography'];
|
|
3
|
+
var themeKinds = ['light', 'dark', 'spacing', 'typography', 'shape'];
|
|
4
4
|
var isThemeKind = function isThemeKind(themeKind) {
|
|
5
5
|
return themeKinds.find(function (kind) {
|
|
6
6
|
return kind === themeKind;
|
|
@@ -37,6 +37,7 @@ export var themeStringToObject = function themeStringToObject(themeState) {
|
|
|
37
37
|
themeObject[kind] = id;
|
|
38
38
|
}
|
|
39
39
|
if (isThemeKind(kind) && isThemeIds(id)) {
|
|
40
|
+
// @ts-expect-error FIXME - this is a valid ts error
|
|
40
41
|
themeObject[kind] = id;
|
|
41
42
|
}
|
|
42
43
|
return themeObject;
|
package/dist/esm/version.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
3
|
+
* @codegen <<SignedSource::ba57ec0a6991ab386479b6c9006397ba>>
|
|
4
4
|
* @codegenCommand yarn build tokens
|
|
5
5
|
*/
|
|
6
|
-
declare const tokens:
|
|
6
|
+
declare const tokens: {
|
|
7
7
|
value: string;
|
|
8
8
|
attributes: {
|
|
9
9
|
group: string;
|
|
@@ -18,20 +18,5 @@ declare const tokens: ({
|
|
|
18
18
|
};
|
|
19
19
|
name: string;
|
|
20
20
|
path: string[];
|
|
21
|
-
}
|
|
22
|
-
value: string;
|
|
23
|
-
attributes: {
|
|
24
|
-
group: string;
|
|
25
|
-
};
|
|
26
|
-
filePath: string;
|
|
27
|
-
isSource: boolean;
|
|
28
|
-
original: {
|
|
29
|
-
value: string;
|
|
30
|
-
attributes: {
|
|
31
|
-
group: string;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
name: string;
|
|
35
|
-
path: string[];
|
|
36
|
-
})[];
|
|
21
|
+
}[];
|
|
37
22
|
export default tokens;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
3
|
+
* @codegen <<SignedSource::861a4448ac467155c8290f2b211e99c5>>
|
|
4
4
|
* @codegenCommand yarn build tokens
|
|
5
5
|
*/
|
|
6
|
-
declare const _default: "\nhtml[data-theme~=\"shape:shape\"] {\n --ds-radius-050: 0.125rem;\n --ds-radius-100: 0.25rem;\n --ds-radius-200: 0.5rem;\n --ds-radius-300: 0.75rem;\n --ds-radius-400: 1rem;\n --ds-radius-
|
|
6
|
+
declare const _default: "\nhtml[data-theme~=\"shape:shape\"] {\n --ds-border-radius-050: 0.125rem;\n --ds-border-radius: 0.25rem;\n --ds-border-radius-100: 0.25rem;\n --ds-border-radius-200: 0.5rem;\n --ds-border-radius-300: 0.75rem;\n --ds-border-radius-400: 1rem;\n --ds-border-radius-circle: 2002rem;\n --ds-border-width: 0.0625rem;\n --ds-border-width-0: 0rem;\n --ds-border-width-050: 0.0625rem;\n --ds-border-width-100: 0.125rem;\n}\n";
|
|
7
7
|
export default _default;
|