@atlaskit/editor-palette 2.2.0 → 3.0.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 CHANGED
@@ -1,5 +1,31 @@
1
1
  # @atlaskit/editor-palette
2
2
 
3
+ ## 3.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`f2dc9097319f0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2dc9097319f0) - ###
8
+ Dropped support for _legacy_ Typescript 4 types. **Typescript 5 is now the new minimum**.
9
+
10
+ Removes the `typesVersions` property and `dist/types-ts4.5` directory from the dist.
11
+
12
+ Types are now exclusively via the `"types": "dist/types/index.d.ts"` property.
13
+
14
+ ```diff
15
+ - "typesVersions": {
16
+ - ">=4.5 <4.9": {
17
+ - "*": [
18
+ - "dist/types-ts4.5/*",
19
+ - "dist/types-ts4.5/index.d.ts"
20
+ - ]
21
+ - }
22
+ - },
23
+ ```
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies
28
+
3
29
  ## 2.2.0
4
30
 
5
31
  ### Minor Changes
@@ -4,12 +4,5 @@
4
4
  "module": "../dist/esm/entry-points/background.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/background.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/background.d.ts",
8
- "typesVersions": {
9
- ">=4.5 <5.9": {
10
- "*": [
11
- "../dist/types-ts4.5/entry-points/background.d.ts"
12
- ]
13
- }
14
- }
7
+ "types": "../dist/types/entry-points/background.d.ts"
15
8
  }
@@ -4,12 +4,5 @@
4
4
  "module": "../dist/esm/entry-points/border.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/border.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/border.d.ts",
8
- "typesVersions": {
9
- ">=4.5 <5.9": {
10
- "*": [
11
- "../dist/types-ts4.5/entry-points/border.d.ts"
12
- ]
13
- }
14
- }
7
+ "types": "../dist/types/entry-points/border.d.ts"
15
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-palette",
3
- "version": "2.2.0",
3
+ "version": "3.0.0",
4
4
  "description": "The editor palette",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -18,22 +18,16 @@
18
18
  "module": "dist/esm/index.js",
19
19
  "module:es2019": "dist/es2019/index.js",
20
20
  "types": "dist/types/index.d.ts",
21
- "typesVersions": {
22
- ">=4.5 <4.9": {
23
- "*": [
24
- "dist/types-ts4.5/*",
25
- "dist/types-ts4.5/index.d.ts"
26
- ]
27
- }
28
- },
29
21
  "sideEffects": false,
30
22
  "atlaskit:src": "src/index.ts",
31
23
  "dependencies": {
32
- "@atlaskit/tokens": "^13.0.0",
24
+ "@atlaskit/tokens": "^14.0.0",
33
25
  "@babel/runtime": "^7.0.0"
34
26
  },
35
27
  "devDependencies": {
36
28
  "@testing-library/react": "^16.3.0",
29
+ "react": "^18.2.0",
30
+ "react-dom": "^18.2.0",
37
31
  "wait-for-expect": "^1.2.0"
38
32
  },
39
33
  "peerDependencies": {
@@ -4,12 +4,5 @@
4
4
  "module": "../dist/esm/entry-points/table-charts.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/table-charts.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/table-charts.d.ts",
8
- "typesVersions": {
9
- ">=4.5 <5.9": {
10
- "*": [
11
- "../dist/types-ts4.5/entry-points/table-charts.d.ts"
12
- ]
13
- }
14
- }
7
+ "types": "../dist/types/entry-points/table-charts.d.ts"
15
8
  }
package/text/package.json CHANGED
@@ -4,12 +4,5 @@
4
4
  "module": "../dist/esm/entry-points/text.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/text.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/text.d.ts",
8
- "typesVersions": {
9
- ">=4.5 <5.9": {
10
- "*": [
11
- "../dist/types-ts4.5/entry-points/text.d.ts"
12
- ]
13
- }
14
- }
7
+ "types": "../dist/types/entry-points/text.d.ts"
15
8
  }
@@ -4,12 +4,5 @@
4
4
  "module": "../dist/esm/entry-points/text-background-color.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/text-background-color.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/text-background-color.d.ts",
8
- "typesVersions": {
9
- ">=4.5 <5.9": {
10
- "*": [
11
- "../dist/types-ts4.5/entry-points/text-background-color.d.ts"
12
- ]
13
- }
14
- }
7
+ "types": "../dist/types/entry-points/text-background-color.d.ts"
15
8
  }
@@ -1,149 +0,0 @@
1
- /**
2
- * This takes an adf hex color and returns a matching background palette
3
- * color.
4
- *
5
- * By providing a design token, this enables ADF content to be rendered in new themes such as dark mode.
6
- *
7
- * Example usage
8
- * ```tsx
9
- * const cssValue = hexToBackgroundPaletteColor('#FFFFFF');
10
- * // ^? const cssValue: string
11
- * <div style={{backgroundColor: cssValue}} />
12
- * ```
13
- *
14
- * The names of tokens can change over time, and the values of tokens will differ between themes.
15
- * The exact output of this function is an implementation detail and should only be used when rendering
16
- * content to the user, on a client with a matching major version of `@atlaskit/tokens`.
17
- * - **DO NOT**: store the output of these functions in any user-generated content or back-end.
18
- * - **DO**: store the ADF hex color, and use these utilities at render time to display the themed version of the color.
19
- */
20
- export declare function hexToEditorBackgroundPaletteColor<HexColor extends string>(hexColor: HexColor): HexColor extends EditorBackgroundPaletteKey ? EditorBackgroundPalette[HexColor]['token'] : string | undefined;
21
- /**
22
- * Takes an ADF hex color and returns the rendered hex code for the associated background palette design token using getTokenValue.
23
- * If the provided color does not exist in the Editor color palette, this function returns undefined.
24
- *
25
- * This should only be used when rendering content where CSS variables are not feasible, such as a non-CSS environment
26
- * or to enable cross-app copy/paste.
27
- *
28
- * WARNING: If the rendered theme changes (such as from light -> dark mode) the value returned here will no longer match
29
- * the surrounding UI and will need to be re-fetched.
30
- * In addition, the values of tokens will differ between themes and the value for a given theme can and will change.
31
- * - **DO NOT**: store the output of these functions in any user-generated content or back-end.
32
- * - **DO**: store the ADF hex color, and use these utilities at render time to display the themed version of the color.
33
- */
34
- export declare function hexToEditorBackgroundPaletteRawValue<HexColor extends string>(hexColor: HexColor): HexColor extends EditorBackgroundPaletteKey ? string : undefined;
35
- type EditorBackgroundPalette = typeof editorBackgroundPalette;
36
- export type EditorBackgroundPaletteKey = keyof EditorBackgroundPalette;
37
- /**
38
- * Values are asserted to improve generated type declarations
39
- * Using object structure as getValue() function needed for table values, and other
40
- * properties may be needed in the future.
41
- */
42
- export declare const editorBackgroundPalette: {
43
- /** blue - light */
44
- "#DEEBFF": {
45
- getValue: (fallback: string) => string;
46
- token: "var(--ds-background-accent-blue-subtlest, #DEEBFF)";
47
- };
48
- /** blue - medium */
49
- "#B3D4FF": {
50
- getValue: (fallback: string) => string;
51
- token: "var(--ds-background-accent-blue-subtler, #B3D4FF)";
52
- };
53
- /** blue - strong */
54
- "#4C9AFF": {
55
- getValue: (fallback: string) => string;
56
- token: "var(--ds-background-accent-blue-subtle, #4C9AFF)";
57
- };
58
- /** teal - light */
59
- "#E6FCFF": {
60
- getValue: (fallback: string) => string;
61
- token: "var(--ds-background-accent-teal-subtlest, #E6FCFF)";
62
- };
63
- /** teal - medium */
64
- "#B3F5FF": {
65
- getValue: (fallback: string) => string;
66
- token: "var(--ds-background-accent-teal-subtler, #B3F5FF)";
67
- };
68
- /** teal - strong */
69
- "#79E2F2": {
70
- getValue: (fallback: string) => string;
71
- token: "var(--ds-background-accent-teal-subtle, #79E2F2)";
72
- };
73
- /** green - light */
74
- "#E3FCEF": {
75
- getValue: (fallback: string) => string;
76
- token: "var(--ds-background-accent-green-subtlest, #E3FCEF)";
77
- };
78
- /** green - medium */
79
- "#ABF5D1": {
80
- getValue: (fallback: string) => string;
81
- token: "var(--ds-background-accent-green-subtler, #ABF5D1)";
82
- };
83
- /** green - strong */
84
- "#57D9A3": {
85
- getValue: (fallback: string) => string;
86
- token: "var(--ds-background-accent-green-subtle, #57D9A3)";
87
- };
88
- /** yellowOrange - light */
89
- "#FFFAE6": {
90
- getValue: (fallback: string) => string;
91
- token: "var(--ds-background-accent-yellow-subtlest, #FFFAE6)";
92
- };
93
- /** yellowOrange - medium */
94
- "#FFF0B3": {
95
- getValue: (fallback: string) => string;
96
- token: "var(--ds-background-accent-yellow-subtler, #FFF0B3)";
97
- };
98
- /** yellowOrange - strong */
99
- "#FFC400": {
100
- getValue: (fallback: string) => string;
101
- token: "var(--ds-background-accent-orange-subtle, #FFC400)";
102
- };
103
- /** red - light */
104
- "#FFEBE6": {
105
- getValue: (fallback: string) => string;
106
- token: "var(--ds-background-accent-red-subtlest, #FFEBE6)";
107
- };
108
- /** red - medium */
109
- "#FFBDAD": {
110
- getValue: (fallback: string) => string;
111
- token: "var(--ds-background-accent-red-subtler, #FFBDAD)";
112
- };
113
- /** red - strong */
114
- "#FF8F73": {
115
- getValue: (fallback: string) => string;
116
- token: "var(--ds-background-accent-red-subtle, #FF8F73)";
117
- };
118
- /** purple - light */
119
- "#EAE6FF": {
120
- getValue: (fallback: string) => string;
121
- token: "var(--ds-background-accent-purple-subtlest, #EAE6FF)";
122
- };
123
- /** purple - medium */
124
- "#C0B6F2": {
125
- getValue: (fallback: string) => string;
126
- token: "var(--ds-background-accent-purple-subtler, #C0B6F2)";
127
- };
128
- /** purple - strong */
129
- "#998DD9": {
130
- getValue: (fallback: string) => string;
131
- token: "var(--ds-background-accent-purple-subtle, #998DD9)";
132
- };
133
- /** whiteGray - light */
134
- "#FFFFFF": {
135
- getValue: (fallback: string) => string;
136
- token: "var(--ds-surface, #FFFFFF)";
137
- };
138
- /** whiteGray - medium */
139
- "#F4F5F7": {
140
- getValue: (fallback: string) => string;
141
- token: "var(--ds-background-accent-gray-subtlest, #F4F5F7)";
142
- };
143
- /** whiteGray - strong */
144
- "#B3BAC5": {
145
- getValue: (fallback: string) => string;
146
- token: "var(--ds-background-accent-gray-subtle, #B3BAC5)";
147
- };
148
- };
149
- export {};
@@ -1,29 +0,0 @@
1
- /**
2
- * This takes an adf hex color and returns a matching border palette color.
3
- *
4
- * By providing a design token, this enables ADF content to be rendered in new themes such as dark mode.
5
- *
6
- * Example usage
7
- * ```tsx
8
- * const cssValue = hexToEditorBorderPaletteColor('#091E4224');
9
- * // ^? const cssValue: string
10
- * <div style={{borderColor: cssValue}} />
11
- * ```
12
- * The names of tokens can change over time, and the values of tokens will differ between themes.
13
- * The exact output of this function is an implementation detail and should only be used when rendering
14
- * content to the user, on a client with a matching major version of `@atlaskit/tokens`.
15
- * - **DO NOT**: store the output of these functions in any user-generated content or back-end.
16
- * - **DO**: store the ADF hex color, and use these utilities at render time to display the themed version of the color
17
- */
18
- export declare function hexToEditorBorderPaletteColor<HexColor extends string>(hexColor: HexColor): HexColor extends EditorBorderPaletteKey ? EditorBorderPalette[HexColor] : string | undefined;
19
- type EditorBorderPalette = typeof editorBorderPalette;
20
- export type EditorBorderPaletteKey = keyof EditorBorderPalette;
21
- export declare const editorBorderPalette: {
22
- /** gray - subtle */
23
- "#091E4224": "var(--ds-border, #091E4224)";
24
- /** gray */
25
- "#758195": "var(--ds-border-bold, #758195)";
26
- /** gray - bold */
27
- "#172B4D": "var(--ds-text, #172B4D)";
28
- };
29
- export {};
@@ -1 +0,0 @@
1
- export { hexToEditorBackgroundPaletteColor, hexToEditorBackgroundPaletteRawValue, } from '../background';
@@ -1 +0,0 @@
1
- export { hexToEditorBorderPaletteColor } from '../border';
@@ -1 +0,0 @@
1
- export { hexToEditorTableChartsPaletteColor, hexToEditorTableChartsPaletteRawValue, } from '../table-charts';
@@ -1 +0,0 @@
1
- export { hexToEditorTextBackgroundPaletteColor } from '../text-background-color';
@@ -1 +0,0 @@
1
- export { hexToEditorTextPaletteColor } from '../text';
@@ -1,5 +0,0 @@
1
- export { hexToEditorBackgroundPaletteColor, hexToEditorBackgroundPaletteRawValue, } from './background';
2
- export { hexToEditorBorderPaletteColor } from './border';
3
- export { hexToEditorTextPaletteColor } from './text';
4
- export { hexToEditorTableChartsPaletteColor, hexToEditorTableChartsPaletteRawValue, } from './table-charts';
5
- export { hexToEditorTextBackgroundPaletteColor } from './text-background-color';
@@ -1,193 +0,0 @@
1
- /**
2
- * This takes an adf hex color and returns a matching chart palette
3
- * color.
4
- *
5
- * By providing a design token, this enables ADF content to be rendered in new themes such as dark mode.
6
- *
7
- * Example usage
8
- * ```tsx
9
- * const cssValue = hexToEditorTableChartsPaletteColor('#FFFFFF');
10
- * // ^? const cssValue: string
11
- * <div style={{backgroundColor: cssValue}} />
12
- * ```
13
- *
14
- * The names of tokens can change over time, and the values of tokens will differ between themes.
15
- * The exact output of this function is an implementation detail and should only be used when rendering
16
- * content to the user, on a client with a matching major version of `@atlaskit/tokens`.
17
- * - **DO NOT**: store the output of these functions in any user-generated content or back-end.
18
- * - **DO**: store the ADF hex color, and use these utilities at render time to display the themed version of the color
19
- */
20
- export declare function hexToEditorTableChartsPaletteColor<HexColor extends string>(hexColor: HexColor): HexColor extends EditorTableChartsPaletteKey ? EditorTableChartsPalette[HexColor]['token'] : string | undefined;
21
- /**
22
- * Takes an ADF hex color and returns the rendered hex code for the associated chart palette design token using getTokenValue.
23
- * If the provided color does not exist in the Editor color palette, this function returns undefined.
24
- *
25
- * This should only be used when rendering content where CSS variables are not feasible, such as a non-CSS environment
26
- * or to enable cross-app copy/paste.
27
- *
28
- * WARNING: If the rendered theme changes (such as from light -> dark mode) the value returned here will no longer match
29
- * the surrounding UI and will need to be re-fetched.
30
- * In addition, the values of tokens will differ between themes and the value for a given theme can and will change.
31
- * - **DO NOT**: store the output of these functions in any user-generated content or back-end.
32
- * - **DO**: store the ADF hex color, and use these utilities at render time to display the themed version of the color.
33
- */
34
- export declare function hexToEditorTableChartsPaletteRawValue<HexColor extends string>(hexColor: HexColor): HexColor extends EditorTableChartsPaletteKey ? string : undefined;
35
- type EditorTableChartsPalette = typeof editorTableChartsPalette;
36
- export type EditorTableChartsPaletteKey = keyof EditorTableChartsPalette;
37
- /**
38
- * Tokenize hex codes into DST chart colors or
39
- * into DST background.accent colors.
40
- *
41
- * The hex codes do not match the DST tokens, they are
42
- * constants that are saved in the ADF that will be rendered
43
- * as the mapped DST token.
44
- *
45
- * https://product-fabric.atlassian.net/browse/ED-17042
46
- */
47
- declare const editorTableChartsPalette: {
48
- "#7AB2FF": {
49
- getValue: (fallback: string) => string;
50
- token: "var(--ds-background-accent-blue-subtle, #7AB2FF)";
51
- };
52
- "#60C6D2": {
53
- getValue: (fallback: string) => string;
54
- token: "var(--ds-background-accent-teal-subtle, #60C6D2)";
55
- };
56
- "#6BE1B0": {
57
- getValue: (fallback: string) => string;
58
- token: "var(--ds-background-accent-green-subtle, #6BE1B0)";
59
- };
60
- "#FFDB57": {
61
- getValue: (fallback: string) => string;
62
- token: "var(--ds-background-accent-yellow-subtle, #FFDB57)";
63
- };
64
- "#FAA53D": {
65
- getValue: (fallback: string) => string;
66
- token: "var(--ds-background-accent-orange-subtle, #FAA53D)";
67
- };
68
- "#FF8F73": {
69
- getValue: (fallback: string) => string;
70
- token: "var(--ds-background-accent-red-subtle, #FF8F73)";
71
- };
72
- "#E774BB": {
73
- getValue: (fallback: string) => string;
74
- token: "var(--ds-background-accent-magenta-subtle, #E774BB)";
75
- };
76
- "#B5A7FB": {
77
- getValue: (fallback: string) => string;
78
- token: "var(--ds-background-accent-purple-subtle, #B5A7FB)";
79
- };
80
- "#8993A5": {
81
- getValue: (fallback: string) => string;
82
- token: "var(--ds-background-accent-gray-subtler, #8993A5)";
83
- };
84
- "#247FFF": {
85
- getValue: (fallback: string) => string;
86
- token: "var(--ds-chart-blue-bold, #247FFF)";
87
- };
88
- "#1D9AAA": {
89
- getValue: (fallback: string) => string;
90
- token: "var(--ds-chart-teal-bold, #1D9AAA)";
91
- };
92
- "#23A971": {
93
- getValue: (fallback: string) => string;
94
- token: "var(--ds-chart-green-bold, #23A971)";
95
- };
96
- "#FFBE33": {
97
- getValue: (fallback: string) => string;
98
- token: "var(--ds-chart-yellow-bold, #FFBE33)";
99
- };
100
- "#D97008": {
101
- getValue: (fallback: string) => string;
102
- token: "var(--ds-chart-orange-bold, #D97008)";
103
- };
104
- "#FC552C": {
105
- getValue: (fallback: string) => string;
106
- token: "var(--ds-chart-red-bold, #FC552C)";
107
- };
108
- "#DA62AC": {
109
- getValue: (fallback: string) => string;
110
- token: "var(--ds-chart-magenta-bold, #DA62AC)";
111
- };
112
- "#8B77EE": {
113
- getValue: (fallback: string) => string;
114
- token: "var(--ds-chart-purple-bold, #8B77EE)";
115
- };
116
- "#8590A2": {
117
- getValue: (fallback: string) => string;
118
- token: "var(--ds-chart-gray-bold, #8590A2)";
119
- };
120
- "#0055CC": {
121
- getValue: (fallback: string) => string;
122
- token: "var(--ds-chart-blue-bolder, #0055CC)";
123
- };
124
- "#1D7F8C": {
125
- getValue: (fallback: string) => string;
126
- token: "var(--ds-chart-teal-bolder, #1D7F8C)";
127
- };
128
- "#177D52": {
129
- getValue: (fallback: string) => string;
130
- token: "var(--ds-chart-green-bolder, #177D52)";
131
- };
132
- "#FF9D00": {
133
- getValue: (fallback: string) => string;
134
- token: "var(--ds-chart-yellow-bolder, #FF9D00)";
135
- };
136
- "#B65C02": {
137
- getValue: (fallback: string) => string;
138
- token: "var(--ds-chart-orange-bolder, #B65C02)";
139
- };
140
- "#D32D03": {
141
- getValue: (fallback: string) => string;
142
- token: "var(--ds-chart-red-bolder, #D32D03)";
143
- };
144
- "#CD519D": {
145
- getValue: (fallback: string) => string;
146
- token: "var(--ds-chart-magenta-bolder, #CD519D)";
147
- };
148
- "#5A43D0": {
149
- getValue: (fallback: string) => string;
150
- token: "var(--ds-chart-purple-bolder, #5A43D0)";
151
- };
152
- "#758195": {
153
- getValue: (fallback: string) => string;
154
- token: "var(--ds-chart-gray-bolder, #758195)";
155
- };
156
- "#003884": {
157
- getValue: (fallback: string) => string;
158
- token: "var(--ds-chart-blue-boldest, #003884)";
159
- };
160
- "#206B74": {
161
- getValue: (fallback: string) => string;
162
- token: "var(--ds-chart-teal-boldest, #206B74)";
163
- };
164
- "#055C3F": {
165
- getValue: (fallback: string) => string;
166
- token: "var(--ds-chart-green-boldest, #055C3F)";
167
- };
168
- "#946104": {
169
- getValue: (fallback: string) => string;
170
- token: "var(--ds-chart-yellow-boldest, #946104)";
171
- };
172
- "#974F0C": {
173
- getValue: (fallback: string) => string;
174
- token: "var(--ds-chart-orange-boldest, #974F0C)";
175
- };
176
- "#A32000": {
177
- getValue: (fallback: string) => string;
178
- token: "var(--ds-chart-red-boldest, #A32000)";
179
- };
180
- "#943D73": {
181
- getValue: (fallback: string) => string;
182
- token: "var(--ds-chart-magenta-boldest, #943D73)";
183
- };
184
- "#44368B": {
185
- getValue: (fallback: string) => string;
186
- token: "var(--ds-chart-purple-boldest, #44368B)";
187
- };
188
- "#44546F": {
189
- getValue: (fallback: string) => string;
190
- token: "var(--ds-chart-gray-boldest, #44546F)";
191
- };
192
- };
193
- export {};
@@ -1,37 +0,0 @@
1
- export declare const textBackgroundColorPalette: {
2
- /** Gray - light */
3
- "#DCDFE4": "var(--ds-background-accent-gray-subtler, #DCDFE4)";
4
- /** Teal - light */
5
- "#C6EDFB": "var(--ds-background-accent-teal-subtler, #C6EDFB)";
6
- /** Lime - light */
7
- "#D3F1A7": "var(--ds-background-accent-lime-subtler, #D3F1A7)";
8
- /** Yellow - light */
9
- "#F8E6A0": "var(--ds-background-accent-yellow-subtler, #F8E6A0)";
10
- /** Orange - light */
11
- "#FEDEC8": "var(--ds-background-accent-orange-subtler, #FEDEC8)";
12
- /** Magenta - light */
13
- "#FDD0EC": "var(--ds-background-accent-magenta-subtler, #FDD0EC)";
14
- /** Purple - light */
15
- "#DFD8FD": "var(--ds-background-accent-purple-subtler, #DFD8FD)";
16
- };
17
- type TextBackgroundColorPalette = typeof textBackgroundColorPalette;
18
- export type TextBackgroundColorPaletteKey = keyof TextBackgroundColorPalette;
19
- /**
20
- * This takes an ADF hex color and returns a matching text background palette color.
21
- *
22
- * By providing a design token, this enables ADF content to be rendered in new themes such as dark mode.
23
- *
24
- * Example usage
25
- * ```tsx
26
- * const cssValue = hexToEditorTextBackgroundPaletteColor('#D3F1A7');
27
- *
28
- * <span style={{backgroundColor: cssValue}} />
29
- * ```
30
- * The names of tokens can change over time, and the values of tokens will differ between themes.
31
- * The exact output of this function is an implementation detail and should only be used when rendering
32
- * content to the user, on a client with a matching major version of `@atlaskit/tokens`.
33
- * - **DO NOT**: store the output of these functions in any user-generated content or back-end.
34
- * - **DO**: store the ADF hex color, and use these utilities at render time to display the themed version of the color
35
- */
36
- export declare function hexToEditorTextBackgroundPaletteColor<HexColor extends string>(hexColor: HexColor): HexColor extends TextBackgroundColorPaletteKey ? TextBackgroundColorPalette[HexColor] : string | undefined;
37
- export {};
@@ -1,65 +0,0 @@
1
- /**
2
- * This takes an adf hex color and returns a matching text palette color.
3
- *
4
- * By providing a design token, this enables ADF content to be rendered in new themes such as dark mode.
5
- *
6
- * Example usage
7
- * ```tsx
8
- * const cssValue = hexToTextPaletteColor('#0747A6');
9
- * // ^? const cssValue: string
10
- * <span style={{textColor: cssValue}} />
11
- * ```
12
- * The names of tokens can change over time, and the values of tokens will differ between themes.
13
- * The exact output of this function is an implementation detail and should only be used when rendering
14
- * content to the user, on a client with a matching major version of `@atlaskit/tokens`.
15
- * - **DO NOT**: store the output of these functions in any user-generated content or back-end.
16
- * - **DO**: store the ADF hex color, and use these utilities at render time to display the themed version of the color
17
- */
18
- export declare function hexToEditorTextPaletteColor<HexColor extends string>(hexColor: HexColor): HexColor extends EditorTextPaletteKey ? EditorTextPalette[HexColor] : string | undefined;
19
- type EditorTextPalette = typeof editorTextPalette;
20
- export type EditorTextPaletteKey = keyof EditorTextPalette;
21
- export declare const editorTextPalette: {
22
- /** blue - light */
23
- "#B3D4FF": "var(--ds-background-accent-blue-subtler, #B3D4FF)";
24
- /** blue - medium */
25
- "#4C9AFF": "var(--ds-icon-accent-blue, #4C9AFF)";
26
- /** blue - strong */
27
- "#0747A6": "var(--ds-text-accent-blue, #0747A6)";
28
- /** teal - light */
29
- "#B3F5FF": "var(--ds-background-accent-teal-subtler, #B3F5FF)";
30
- /** teal - medium */
31
- "#00B8D9": "var(--ds-icon-accent-teal, #00B8D9)";
32
- /** teal - strong */
33
- "#008DA6": "var(--ds-text-accent-teal, #008DA6)";
34
- /** green - light */
35
- "#ABF5D1": "var(--ds-background-accent-green-subtler, #ABF5D1)";
36
- /** green - medium */
37
- "#36B37E": "var(--ds-icon-accent-green, #36B37E)";
38
- /** green - strong */
39
- "#006644": "var(--ds-text-accent-green, #006644)";
40
- /** yellowOrange - light */
41
- "#FFF0B3": "var(--ds-background-accent-yellow-subtler, #FFF0B3)";
42
- /** yellowOrange - medium */
43
- "#FFC400": "var(--ds-background-accent-orange-subtle, #FFC400)";
44
- /** yellowOrange - strong */
45
- "#FF991F": "var(--ds-icon-accent-orange, #FF991F)";
46
- /** red - light */
47
- "#FFBDAD": "var(--ds-background-accent-red-subtler, #FFBDAD)";
48
- /** red - medium */
49
- "#FF5630": "var(--ds-icon-accent-red, #FF5630)";
50
- /** red - strong */
51
- "#BF2600": "var(--ds-text-accent-red, #BF2600)";
52
- /** purple - light */
53
- "#EAE6FF": "var(--ds-background-accent-purple-subtler, #EAE6FF)";
54
- /** purple - medium */
55
- "#6554C0": "var(--ds-icon-accent-purple, #6554C0)";
56
- /** purple - strong */
57
- "#403294": "var(--ds-text-accent-purple, #403294)";
58
- /** whiteGray - light */
59
- "#FFFFFF": "var(--ds-text-inverse, #FFFFFF)";
60
- /** whiteGray - medium */
61
- "#97A0AF": "var(--ds-icon-accent-gray, #97A0AF)";
62
- /** whiteGray - strong */
63
- "#172B4D": "var(--ds-text, #172B4D)";
64
- };
65
- export {};