@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
|
const 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 @@ const 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 @@ const 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 @@ const 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 @@ const 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 @@ const 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 @@ const 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 @@ const 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 @@ const 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 @@ const 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 @@ const 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 @@ const 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 @@ const 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 @@ const 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 @@ const 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/es2019/constants.js
CHANGED
|
@@ -2,5 +2,5 @@ export const THEME_DATA_ATTRIBUTE = 'data-theme';
|
|
|
2
2
|
export const COLOR_MODE_ATTRIBUTE = 'data-color-mode';
|
|
3
3
|
export const DEFAULT_THEME = 'light';
|
|
4
4
|
export const CSS_PREFIX = 'ds';
|
|
5
|
-
export const CSS_VAR_FULL = ['opacity', 'font', 'space'];
|
|
5
|
+
export const CSS_VAR_FULL = ['opacity', 'font', 'space', 'border'];
|
|
6
6
|
export const TOKEN_NOT_FOUND_CSS_VAR = `--${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
|
const name = "@atlaskit/tokens";
|
|
4
|
-
const version = "1.
|
|
4
|
+
const 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/es2019/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
|
const name = "@atlaskit/tokens";
|
|
5
|
-
const version = "1.
|
|
5
|
+
const 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.
|
|
@@ -16,6 +16,7 @@ const themeStateDefaults = {
|
|
|
16
16
|
colorMode: 'auto',
|
|
17
17
|
dark: 'dark',
|
|
18
18
|
light: 'light',
|
|
19
|
+
shape: undefined,
|
|
19
20
|
spacing: undefined,
|
|
20
21
|
typography: undefined
|
|
21
22
|
};
|
|
@@ -34,11 +35,12 @@ const getThemePreferences = themeState => {
|
|
|
34
35
|
colorMode,
|
|
35
36
|
dark,
|
|
36
37
|
light,
|
|
38
|
+
shape,
|
|
37
39
|
spacing,
|
|
38
40
|
typography
|
|
39
41
|
} = themeState;
|
|
40
42
|
const themePreferences = colorMode === 'auto' ? [light, dark] : [themeState[colorMode]];
|
|
41
|
-
[spacing, typography].forEach(themeId => {
|
|
43
|
+
[shape, spacing, typography].forEach(themeId => {
|
|
42
44
|
if (themeId) {
|
|
43
45
|
themePreferences.push(themeId);
|
|
44
46
|
}
|
|
@@ -46,6 +48,16 @@ const getThemePreferences = themeState => {
|
|
|
46
48
|
if (getBooleanFF('platform.design-system-team.update-border-input_ff9l1')) {
|
|
47
49
|
themePreferences.push(`${themePreferences.includes('dark') ? 'dark' : 'light'}-new-input-border`);
|
|
48
50
|
}
|
|
51
|
+
|
|
52
|
+
// Load shape and spacing by default, currently behind a feature flag
|
|
53
|
+
if (getBooleanFF('platform.design-system-team.space-and-shape-tokens_q5me6')) {
|
|
54
|
+
if (!themePreferences.includes('shape')) {
|
|
55
|
+
themePreferences.push('shape');
|
|
56
|
+
}
|
|
57
|
+
if (!themePreferences.includes('spacing')) {
|
|
58
|
+
themePreferences.push('spacing');
|
|
59
|
+
}
|
|
60
|
+
}
|
|
49
61
|
return [...new Set(themePreferences)];
|
|
50
62
|
};
|
|
51
63
|
|
|
@@ -56,6 +68,7 @@ const getThemePreferences = themeState => {
|
|
|
56
68
|
* @param {string} themeState.colorMode Determines which color theme is applied. If set to `auto`, the theme applied will be determined by the OS setting.
|
|
57
69
|
* @param {string} themeState.dark The color theme to be applied when the color mode resolves to 'dark'.
|
|
58
70
|
* @param {string} themeState.light The color theme to be applied when the color mode resolves to 'light'.
|
|
71
|
+
* @param {string} themeState.shape The shape theme to be applied.
|
|
59
72
|
* @param {string} themeState.spacing The spacing theme to be applied.
|
|
60
73
|
* @param {string} themeState.typography The typography theme to be applied.
|
|
61
74
|
*
|
|
@@ -70,6 +83,7 @@ const setGlobalTheme = async ({
|
|
|
70
83
|
colorMode = themeStateDefaults['colorMode'],
|
|
71
84
|
dark = themeStateDefaults['dark'],
|
|
72
85
|
light = themeStateDefaults['light'],
|
|
86
|
+
shape = themeStateDefaults['shape'],
|
|
73
87
|
spacing = themeStateDefaults['spacing'],
|
|
74
88
|
typography = themeStateDefaults['typography']
|
|
75
89
|
} = {}) => {
|
|
@@ -77,6 +91,7 @@ const setGlobalTheme = async ({
|
|
|
77
91
|
colorMode,
|
|
78
92
|
dark,
|
|
79
93
|
light,
|
|
94
|
+
shape,
|
|
80
95
|
spacing,
|
|
81
96
|
typography
|
|
82
97
|
});
|
|
@@ -105,6 +120,7 @@ const setGlobalTheme = async ({
|
|
|
105
120
|
colorMode,
|
|
106
121
|
dark,
|
|
107
122
|
light,
|
|
123
|
+
shape,
|
|
108
124
|
spacing,
|
|
109
125
|
typography
|
|
110
126
|
});
|
|
@@ -121,6 +137,7 @@ const setGlobalTheme = async ({
|
|
|
121
137
|
* @param {string} themeState.colorMode Determines which color theme is applied. If set to `auto`, the theme applied will be determined by the OS setting.
|
|
122
138
|
* @param {string} themeState.dark The color theme to be applied when the color mode resolves to 'dark'.
|
|
123
139
|
* @param {string} themeState.light The color theme to be applied when the color mode resolves to 'light'.
|
|
140
|
+
* @param {string} themeState.shape The shape theme to be applied.
|
|
124
141
|
* @param {string} themeState.spacing The spacing theme to be applied.
|
|
125
142
|
* @param {string} themeState.typography The typography theme to be applied.
|
|
126
143
|
*
|
|
@@ -131,6 +148,7 @@ export const getThemeStyles = async ({
|
|
|
131
148
|
colorMode = themeStateDefaults['colorMode'],
|
|
132
149
|
dark = themeStateDefaults['dark'],
|
|
133
150
|
light = themeStateDefaults['light'],
|
|
151
|
+
shape = themeStateDefaults['shape'],
|
|
134
152
|
spacing = themeStateDefaults['spacing'],
|
|
135
153
|
typography = themeStateDefaults['typography']
|
|
136
154
|
} = {}) => {
|
|
@@ -138,6 +156,7 @@ export const getThemeStyles = async ({
|
|
|
138
156
|
colorMode,
|
|
139
157
|
dark,
|
|
140
158
|
light,
|
|
159
|
+
shape,
|
|
141
160
|
spacing,
|
|
142
161
|
typography
|
|
143
162
|
});
|
|
@@ -185,15 +204,28 @@ export const getThemeHtmlAttrs = ({
|
|
|
185
204
|
colorMode = themeStateDefaults['colorMode'],
|
|
186
205
|
dark = themeStateDefaults['dark'],
|
|
187
206
|
light = themeStateDefaults['light'],
|
|
207
|
+
shape = themeStateDefaults['shape'],
|
|
188
208
|
spacing = themeStateDefaults['spacing'],
|
|
189
209
|
typography = themeStateDefaults['typography']
|
|
190
210
|
} = {}) => {
|
|
191
|
-
|
|
211
|
+
let themePreferences = {
|
|
192
212
|
dark,
|
|
193
213
|
light,
|
|
214
|
+
shape,
|
|
194
215
|
spacing,
|
|
195
216
|
typography
|
|
196
217
|
};
|
|
218
|
+
|
|
219
|
+
// Load shape and spacing by default, currently behind a feature flag
|
|
220
|
+
if (getBooleanFF('platform.design-system-team.space-and-shape-tokens_q5me6')) {
|
|
221
|
+
themePreferences = {
|
|
222
|
+
dark,
|
|
223
|
+
light,
|
|
224
|
+
shape: 'shape',
|
|
225
|
+
spacing: 'spacing',
|
|
226
|
+
typography
|
|
227
|
+
};
|
|
228
|
+
}
|
|
197
229
|
const themeAttribute = themeObjectToString(themePreferences);
|
|
198
230
|
return {
|
|
199
231
|
[THEME_DATA_ATTRIBUTE]: themeAttribute,
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
const 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 @@ const 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 @@ const 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
|
const 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 @@ const 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,5 +1,5 @@
|
|
|
1
1
|
import { themeIds } from '../theme-config';
|
|
2
|
-
const themeKinds = ['light', 'dark', 'spacing', 'typography'];
|
|
2
|
+
const themeKinds = ['light', 'dark', 'spacing', 'typography', 'shape'];
|
|
3
3
|
const isThemeKind = themeKind => {
|
|
4
4
|
return themeKinds.find(kind => kind === themeKind) !== undefined;
|
|
5
5
|
};
|
|
@@ -27,6 +27,7 @@ export const themeStringToObject = themeState => {
|
|
|
27
27
|
themeObject[kind] = id;
|
|
28
28
|
}
|
|
29
29
|
if (isThemeKind(kind) && isThemeIds(id)) {
|
|
30
|
+
// @ts-expect-error FIXME - this is a valid ts error
|
|
30
31
|
themeObject[kind] = id;
|
|
31
32
|
}
|
|
32
33
|
return themeObject;
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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
6
|
var tokens = [{
|
|
@@ -79,14 +79,14 @@ var tokens = [{
|
|
|
79
79
|
"name": "border.radius.Radius400",
|
|
80
80
|
"path": ["border", "radius", "Radius400"]
|
|
81
81
|
}, {
|
|
82
|
-
"value": "
|
|
82
|
+
"value": "32032px",
|
|
83
83
|
"attributes": {
|
|
84
84
|
"group": "shape"
|
|
85
85
|
},
|
|
86
86
|
"filePath": "src/palettes/shape-palette.tsx",
|
|
87
87
|
"isSource": true,
|
|
88
88
|
"original": {
|
|
89
|
-
"value":
|
|
89
|
+
"value": 32032,
|
|
90
90
|
"attributes": {
|
|
91
91
|
"group": "shape"
|
|
92
92
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
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
|
-
export 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
|
+
export 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";
|
|
@@ -4,19 +4,10 @@
|
|
|
4
4
|
* Token names mapped to their value in the default Atlassian themes ('light').
|
|
5
5
|
* These default values are used by the Babel plugin to optionally provide automatic fallbacks.
|
|
6
6
|
*
|
|
7
|
-
* @codegen <<SignedSource::
|
|
7
|
+
* @codegen <<SignedSource::cc9231cd2b7a9797c51b4b8b742bab92>>
|
|
8
8
|
* @codegenCommand yarn build tokens
|
|
9
9
|
*/
|
|
10
10
|
var defaultTokenValues = {
|
|
11
|
-
'border.radius.050': '0.125rem',
|
|
12
|
-
'border.radius.100': '0.25rem',
|
|
13
|
-
'border.radius.200': '0.5rem',
|
|
14
|
-
'border.radius.300': '0.75rem',
|
|
15
|
-
'border.radius.400': '1rem',
|
|
16
|
-
'border.radius.round': '50%',
|
|
17
|
-
'border.width.0': '0rem',
|
|
18
|
-
'border.width.050': '0.0625rem',
|
|
19
|
-
'border.width.100': '0.125rem',
|
|
20
11
|
'color.text': '#172B4D',
|
|
21
12
|
'color.text.accent.red': '#AE2A19',
|
|
22
13
|
'color.text.accent.red.bolder': '#601E16',
|
|
@@ -303,6 +294,17 @@ var defaultTokenValues = {
|
|
|
303
294
|
'opacity.disabled': '0.4',
|
|
304
295
|
'opacity.loading': '0.2',
|
|
305
296
|
'utility.UNSAFE.transparent': 'transparent',
|
|
297
|
+
'border.radius.050': '0.125rem',
|
|
298
|
+
'border.radius': '0.25rem',
|
|
299
|
+
'border.radius.100': '0.25rem',
|
|
300
|
+
'border.radius.200': '0.5rem',
|
|
301
|
+
'border.radius.300': '0.75rem',
|
|
302
|
+
'border.radius.400': '1rem',
|
|
303
|
+
'border.radius.circle': '2002rem',
|
|
304
|
+
'border.width': '0.0625rem',
|
|
305
|
+
'border.width.0': '0rem',
|
|
306
|
+
'border.width.050': '0.0625rem',
|
|
307
|
+
'border.width.100': '0.125rem',
|
|
306
308
|
'space.0': '0rem',
|
|
307
309
|
'space.025': '0.125rem',
|
|
308
310
|
'space.050': '0.25rem',
|