@atlaskit/tokens 1.49.1 → 1.51.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 +1593 -1594
- package/README.md +14 -8
- package/codemods/css-to-design-tokens/lib/colors.tsx +47 -49
- package/codemods/css-to-design-tokens/lib/declaration.tsx +26 -26
- package/codemods/css-to-design-tokens/lib/legacy-colors.tsx +326 -326
- package/codemods/css-to-design-tokens/lib/meta.tsx +116 -122
- package/codemods/css-to-design-tokens/lib/tokens.tsx +28 -35
- package/codemods/css-to-design-tokens/lib/value.tsx +70 -72
- package/codemods/css-to-design-tokens/transform.tsx +68 -72
- package/codemods/hypermod.config.tsx +5 -5
- package/codemods/remove-fallbacks-color/transform.tsx +16 -18
- package/codemods/theme-to-design-tokens/transform.tsx +505 -588
- package/codemods/theme-to-design-tokens/utils/ast-meta.tsx +139 -147
- package/codemods/theme-to-design-tokens/utils/ast.tsx +23 -34
- package/codemods/theme-to-design-tokens/utils/color.tsx +25 -26
- package/codemods/theme-to-design-tokens/utils/css-utils.tsx +27 -30
- package/codemods/theme-to-design-tokens/utils/fuzzy-search.tsx +272 -290
- package/codemods/theme-to-design-tokens/utils/legacy-colors.tsx +224 -224
- package/codemods/theme-to-design-tokens/utils/named-colors.tsx +148 -148
- package/codemods/theme-to-design-tokens/utils/string-utils.tsx +10 -16
- package/codemods/utils/tokens.tsx +371 -371
- package/dist/cjs/artifacts/atlassian-dark-token-value-for-contrast-check.js +1 -1
- package/dist/cjs/artifacts/atlassian-light-token-value-for-contrast-check.js +1 -1
- package/dist/cjs/artifacts/generated-pairs.js +1 -1
- package/dist/cjs/artifacts/theme-import-map.js +1 -1
- package/dist/cjs/artifacts/themes/atlassian-typography-minor3.js +2 -2
- package/dist/cjs/artifacts/token-default-values.js +1 -1
- package/dist/cjs/artifacts/token-names.js +1 -1
- package/dist/cjs/artifacts/tokens-raw/atlassian-typography-minor3.js +3 -3
- package/dist/es2019/artifacts/atlassian-dark-token-value-for-contrast-check.js +1 -1
- package/dist/es2019/artifacts/atlassian-light-token-value-for-contrast-check.js +1 -1
- package/dist/es2019/artifacts/generated-pairs.js +1 -1
- package/dist/es2019/artifacts/theme-import-map.js +1 -1
- package/dist/es2019/artifacts/themes/atlassian-typography-minor3.js +2 -2
- package/dist/es2019/artifacts/token-default-values.js +1 -1
- package/dist/es2019/artifacts/token-names.js +1 -1
- package/dist/es2019/artifacts/tokens-raw/atlassian-typography-minor3.js +3 -3
- package/dist/esm/artifacts/atlassian-dark-token-value-for-contrast-check.js +1 -1
- package/dist/esm/artifacts/atlassian-light-token-value-for-contrast-check.js +1 -1
- package/dist/esm/artifacts/generated-pairs.js +1 -1
- package/dist/esm/artifacts/theme-import-map.js +1 -1
- package/dist/esm/artifacts/themes/atlassian-typography-minor3.js +2 -2
- package/dist/esm/artifacts/token-default-values.js +1 -1
- package/dist/esm/artifacts/token-names.js +1 -1
- package/dist/esm/artifacts/tokens-raw/atlassian-typography-minor3.js +3 -3
- package/dist/types/artifacts/atlassian-dark-token-value-for-contrast-check.d.ts +1 -1
- package/dist/types/artifacts/atlassian-light-token-value-for-contrast-check.d.ts +1 -1
- package/dist/types/artifacts/generated-pairs.d.ts +1 -1
- package/dist/types/artifacts/theme-import-map.d.ts +2 -2
- package/dist/types/artifacts/themes/atlassian-typography-minor3.d.ts +2 -2
- package/dist/types/artifacts/token-default-values.d.ts +1 -1
- package/dist/types/artifacts/token-names.d.ts +1 -1
- package/dist/types/artifacts/tokens-raw/atlassian-typography-minor3.d.ts +1 -1
- package/dist/types/artifacts/types-internal.d.ts +1 -1
- package/dist/types/artifacts/types.d.ts +1 -1
- package/dist/types/babel-plugin/plugin.d.ts +1 -1
- package/dist/types/custom-theme.d.ts +2 -2
- package/dist/types/enable-global-theme.d.ts +2 -2
- package/dist/types/entry-points/css-type-schema.codegen.d.ts +1 -1
- package/dist/types/entry-points/token-ids.d.ts +1 -1
- package/dist/types/get-global-theme.d.ts +1 -1
- package/dist/types/get-ssr-auto-script.d.ts +1 -1
- package/dist/types/get-theme-html-attrs.d.ts +1 -1
- package/dist/types/get-theme-styles.d.ts +1 -1
- package/dist/types/get-token.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/load-custom-theme-styles.d.ts +1 -1
- package/dist/types/set-global-theme.d.ts +2 -2
- package/dist/types/theme-state-transformer.d.ts +1 -1
- package/dist/types/utils/color-detection.d.ts +1 -1
- package/dist/types/utils/color-mode-listeners.d.ts +1 -1
- package/dist/types/utils/configure-page.d.ts +1 -1
- package/dist/types/utils/contrast-mode-listeners.d.ts +1 -1
- package/dist/types/utils/custom-theme-loading-utils.d.ts +1 -1
- package/dist/types/utils/custom-theme-token-contrast-check.d.ts +1 -1
- package/dist/types/utils/generate-custom-color-ramp.d.ts +2 -2
- package/dist/types/utils/get-increased-contrast-theme.d.ts +1 -1
- package/dist/types/utils/get-theme-preferences.d.ts +1 -1
- package/dist/types/utils/theme-loading.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/atlassian-dark-token-value-for-contrast-check.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/atlassian-light-token-value-for-contrast-check.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/generated-pairs.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/theme-import-map.d.ts +2 -2
- package/dist/types-ts4.5/artifacts/themes/atlassian-typography-minor3.d.ts +2 -2
- package/dist/types-ts4.5/artifacts/token-default-values.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/token-names.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/tokens-raw/atlassian-typography-minor3.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/types-internal.d.ts +1 -1
- package/dist/types-ts4.5/artifacts/types.d.ts +1 -1
- package/dist/types-ts4.5/babel-plugin/plugin.d.ts +1 -1
- package/dist/types-ts4.5/custom-theme.d.ts +2 -2
- package/dist/types-ts4.5/enable-global-theme.d.ts +2 -2
- package/dist/types-ts4.5/entry-points/css-type-schema.codegen.d.ts +1 -1
- package/dist/types-ts4.5/entry-points/token-ids.d.ts +1 -1
- package/dist/types-ts4.5/get-global-theme.d.ts +1 -1
- package/dist/types-ts4.5/get-ssr-auto-script.d.ts +1 -1
- package/dist/types-ts4.5/get-theme-html-attrs.d.ts +1 -1
- package/dist/types-ts4.5/get-theme-styles.d.ts +1 -1
- package/dist/types-ts4.5/get-token.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/load-custom-theme-styles.d.ts +1 -1
- package/dist/types-ts4.5/set-global-theme.d.ts +2 -2
- package/dist/types-ts4.5/theme-state-transformer.d.ts +1 -1
- package/dist/types-ts4.5/utils/color-detection.d.ts +1 -1
- package/dist/types-ts4.5/utils/color-mode-listeners.d.ts +1 -1
- package/dist/types-ts4.5/utils/configure-page.d.ts +1 -1
- package/dist/types-ts4.5/utils/contrast-mode-listeners.d.ts +1 -1
- package/dist/types-ts4.5/utils/custom-theme-loading-utils.d.ts +1 -1
- package/dist/types-ts4.5/utils/custom-theme-token-contrast-check.d.ts +1 -1
- package/dist/types-ts4.5/utils/generate-custom-color-ramp.d.ts +2 -2
- package/dist/types-ts4.5/utils/get-increased-contrast-theme.d.ts +1 -1
- package/dist/types-ts4.5/utils/get-theme-preferences.d.ts +1 -1
- package/dist/types-ts4.5/utils/theme-loading.d.ts +1 -1
- package/package.json +138 -140
- package/report.api.md +2071 -2090
|
@@ -1,150 +1,150 @@
|
|
|
1
1
|
export const namedColors = [
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
2
|
+
'black',
|
|
3
|
+
'silver',
|
|
4
|
+
'gray',
|
|
5
|
+
'white',
|
|
6
|
+
'maroon',
|
|
7
|
+
'red',
|
|
8
|
+
'purple',
|
|
9
|
+
'fuchsia',
|
|
10
|
+
'green',
|
|
11
|
+
'lime',
|
|
12
|
+
'olive',
|
|
13
|
+
'yellow',
|
|
14
|
+
'navy',
|
|
15
|
+
'blue',
|
|
16
|
+
'teal',
|
|
17
|
+
'aqua',
|
|
18
|
+
'orange',
|
|
19
|
+
'aliceblue',
|
|
20
|
+
'antiquewhite',
|
|
21
|
+
'aquamarine',
|
|
22
|
+
'azure',
|
|
23
|
+
'beige',
|
|
24
|
+
'bisque',
|
|
25
|
+
'blanchedalmond',
|
|
26
|
+
'blueviolet',
|
|
27
|
+
'brown',
|
|
28
|
+
'burlywood',
|
|
29
|
+
'cadetblue',
|
|
30
|
+
'chartreuse',
|
|
31
|
+
'chocolate',
|
|
32
|
+
'coral',
|
|
33
|
+
'cornflowerblue',
|
|
34
|
+
'cornsilk',
|
|
35
|
+
'crimson',
|
|
36
|
+
'cyan',
|
|
37
|
+
'darkblue',
|
|
38
|
+
'darkcyan',
|
|
39
|
+
'darkgoldenrod',
|
|
40
|
+
'darkgray',
|
|
41
|
+
'darkgreen',
|
|
42
|
+
'darkgrey',
|
|
43
|
+
'darkkhaki',
|
|
44
|
+
'darkmagenta',
|
|
45
|
+
'darkolivegreen',
|
|
46
|
+
'darkorange',
|
|
47
|
+
'darkorchid',
|
|
48
|
+
'darkred',
|
|
49
|
+
'darksalmon',
|
|
50
|
+
'darkseagreen',
|
|
51
|
+
'darkslateblue',
|
|
52
|
+
'darkslategray',
|
|
53
|
+
'darkslategrey',
|
|
54
|
+
'darkturquoise',
|
|
55
|
+
'darkviolet',
|
|
56
|
+
'deeppink',
|
|
57
|
+
'deepskyblue',
|
|
58
|
+
'dimgray',
|
|
59
|
+
'dimgrey',
|
|
60
|
+
'dodgerblue',
|
|
61
|
+
'firebrick',
|
|
62
|
+
'floralwhite',
|
|
63
|
+
'forestgreen',
|
|
64
|
+
'gainsboro',
|
|
65
|
+
'ghostwhite',
|
|
66
|
+
'gold',
|
|
67
|
+
'goldenrod',
|
|
68
|
+
'greenyellow',
|
|
69
|
+
'grey',
|
|
70
|
+
'honeydew',
|
|
71
|
+
'hotpink',
|
|
72
|
+
'indianred',
|
|
73
|
+
'indigo',
|
|
74
|
+
'ivory',
|
|
75
|
+
'khaki',
|
|
76
|
+
'lavender',
|
|
77
|
+
'lavenderblush',
|
|
78
|
+
'lawngreen',
|
|
79
|
+
'lemonchiffon',
|
|
80
|
+
'lightblue',
|
|
81
|
+
'lightcoral',
|
|
82
|
+
'lightcyan',
|
|
83
|
+
'lightgoldenrodyellow',
|
|
84
|
+
'lightgray',
|
|
85
|
+
'lightgreen',
|
|
86
|
+
'lightgrey',
|
|
87
|
+
'lightpink',
|
|
88
|
+
'lightsalmon',
|
|
89
|
+
'lightseagreen',
|
|
90
|
+
'lightskyblue',
|
|
91
|
+
'lightslategray',
|
|
92
|
+
'lightslategrey',
|
|
93
|
+
'lightsteelblue',
|
|
94
|
+
'lightyellow',
|
|
95
|
+
'limegreen',
|
|
96
|
+
'linen',
|
|
97
|
+
'magenta',
|
|
98
|
+
'mediumaquamarine',
|
|
99
|
+
'mediumblue',
|
|
100
|
+
'mediumorchid',
|
|
101
|
+
'mediumpurple',
|
|
102
|
+
'mediumseagreen',
|
|
103
|
+
'mediumslateblue',
|
|
104
|
+
'mediumspringgreen',
|
|
105
|
+
'mediumturquoise',
|
|
106
|
+
'mediumvioletred',
|
|
107
|
+
'midnightblue',
|
|
108
|
+
'mintcream',
|
|
109
|
+
'mistyrose',
|
|
110
|
+
'moccasin',
|
|
111
|
+
'navajowhite',
|
|
112
|
+
'oldlace',
|
|
113
|
+
'olivedrab',
|
|
114
|
+
'orangered',
|
|
115
|
+
'orchid',
|
|
116
|
+
'palegoldenrod',
|
|
117
|
+
'palegreen',
|
|
118
|
+
'paleturquoise',
|
|
119
|
+
'palevioletred',
|
|
120
|
+
'papayawhip',
|
|
121
|
+
'peachpuff',
|
|
122
|
+
'peru',
|
|
123
|
+
'pink',
|
|
124
|
+
'plum',
|
|
125
|
+
'powderblue',
|
|
126
|
+
'rosybrown',
|
|
127
|
+
'royalblue',
|
|
128
|
+
'saddlebrown',
|
|
129
|
+
'salmon',
|
|
130
|
+
'sandybrown',
|
|
131
|
+
'seagreen',
|
|
132
|
+
'seashell',
|
|
133
|
+
'sienna',
|
|
134
|
+
'skyblue',
|
|
135
|
+
'slateblue',
|
|
136
|
+
'slategray',
|
|
137
|
+
'slategrey',
|
|
138
|
+
'snow',
|
|
139
|
+
'springgreen',
|
|
140
|
+
'steelblue',
|
|
141
|
+
'tan',
|
|
142
|
+
'thistle',
|
|
143
|
+
'tomato',
|
|
144
|
+
'turquoise',
|
|
145
|
+
'violet',
|
|
146
|
+
'wheat',
|
|
147
|
+
'whitesmoke',
|
|
148
|
+
'yellowgreen',
|
|
149
|
+
'rebeccapurple',
|
|
150
150
|
];
|
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
export const kebabize = (str: string) =>
|
|
2
|
-
|
|
3
|
-
/[A-Z]+(?![a-z])|[A-Z]/g,
|
|
4
|
-
($, ofs) => (ofs ? '-' : '') + $.toLowerCase(),
|
|
5
|
-
);
|
|
2
|
+
str.replace(/[A-Z]+(?![a-z])|[A-Z]/g, ($, ofs) => (ofs ? '-' : '') + $.toLowerCase());
|
|
6
3
|
|
|
7
|
-
export function findFirstNonspaceIndexAfter(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
)
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} else {
|
|
16
|
-
return index + 1 + indexInRest;
|
|
17
|
-
}
|
|
4
|
+
export function findFirstNonspaceIndexAfter(text: string, index: number): number {
|
|
5
|
+
const rest = text.slice(index + 1);
|
|
6
|
+
const indexInRest = rest.search(/\S/);
|
|
7
|
+
if (indexInRest === -1) {
|
|
8
|
+
return text.length;
|
|
9
|
+
} else {
|
|
10
|
+
return index + 1 + indexInRest;
|
|
11
|
+
}
|
|
18
12
|
}
|
|
19
13
|
|
|
20
14
|
export function splitAtIndex(text: string, index: number): [string, string] {
|
|
21
|
-
|
|
15
|
+
return [text.slice(0, index), text.slice(index)];
|
|
22
16
|
}
|