@atlaskit/editor-palette 1.4.0 → 1.4.2

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,17 @@
1
1
  # @atlaskit/editor-palette
2
2
 
3
+ ## 1.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
8
+
9
+ ## 1.4.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
14
+
3
15
  ## 1.4.0
4
16
 
5
17
  ### Minor Changes
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-palette",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-palette",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-palette",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "sideEffects": false
5
5
  }
@@ -19,8 +19,8 @@
19
19
  */
20
20
  export declare function hexToEditorBackgroundPaletteColor<HexColor extends string>(hexColor: HexColor): HexColor extends EditorBackgroundPaletteKey ? EditorBackgroundPalette[HexColor]['token'] : string | undefined;
21
21
  export declare function hexToEditorBackgroundPaletteColorTokenName<HexColor extends string>(hexColor: HexColor): HexColor extends EditorBackgroundPaletteKey ? EditorBackgroundPalette[HexColor]['tokenName'] : EditorBackgroundPaletteTokenNames | undefined;
22
- declare type EditorBackgroundPalette = typeof editorBackgroundPalette;
23
- export declare type EditorBackgroundPaletteKey = keyof EditorBackgroundPalette;
22
+ type EditorBackgroundPalette = typeof editorBackgroundPalette;
23
+ export type EditorBackgroundPaletteKey = keyof EditorBackgroundPalette;
24
24
  export declare const editorBackgroundPalette: {
25
25
  /** blue - light */
26
26
  "#DEEBFF": {
@@ -129,5 +129,5 @@ export declare const editorBackgroundPalette: {
129
129
  };
130
130
  };
131
131
  declare const tokenNames: ("color.background.accent.blue.subtlest" | "color.background.accent.blue.subtler" | "color.background.accent.blue.subtle" | "color.background.accent.teal.subtlest" | "color.background.accent.teal.subtler" | "color.background.accent.teal.subtle" | "color.background.accent.green.subtlest" | "color.background.accent.green.subtler" | "color.background.accent.green.subtle" | "color.background.accent.yellow.subtlest" | "color.background.accent.yellow.subtler" | "color.background.accent.orange.subtle" | "color.background.accent.red.subtlest" | "color.background.accent.red.subtler" | "color.background.accent.red.subtle" | "color.background.accent.purple.subtlest" | "color.background.accent.purple.subtler" | "color.background.accent.purple.subtle" | "elevation.surface" | "color.background.accent.gray.subtlest" | "color.background.accent.gray.subtle")[];
132
- export declare type EditorBackgroundPaletteTokenNames = (typeof tokenNames)[number];
132
+ export type EditorBackgroundPaletteTokenNames = (typeof tokenNames)[number];
133
133
  export {};
@@ -16,8 +16,8 @@
16
16
  * - **DO**: store the ADF hex color, and use these utilities at render time to display the themed version of the color
17
17
  */
18
18
  export declare function hexToEditorBorderPaletteColor<HexColor extends string>(hexColor: HexColor): HexColor extends EditorBorderPaletteKey ? EditorBorderPalette[HexColor] : string | undefined;
19
- declare type EditorBorderPalette = typeof editorBorderPalette;
20
- export declare type EditorBorderPaletteKey = keyof EditorBorderPalette;
19
+ type EditorBorderPalette = typeof editorBorderPalette;
20
+ export type EditorBorderPaletteKey = keyof EditorBorderPalette;
21
21
  export declare const editorBorderPalette: {
22
22
  /** gray - subtle */
23
23
  "#091E4224": "var(--ds-border, #091E4224)";
@@ -19,8 +19,8 @@
19
19
  */
20
20
  export declare function hexToEditorTableChartsPaletteColor<HexColor extends string>(hexColor: HexColor): HexColor extends EditorTableChartsPaletteKey ? EditorTableChartsPalette[HexColor]['token'] : string | undefined;
21
21
  export declare function hexToEditorTableChartsPaletteColorTokenName<HexColor extends string>(hexColor: HexColor): HexColor extends EditorTableChartsPaletteKey ? EditorTableChartsPalette[HexColor]['tokenName'] : EditorBackgroundPaletteTokenNames | undefined;
22
- declare type EditorTableChartsPalette = typeof editorTableChartsPalette;
23
- export declare type EditorTableChartsPaletteKey = keyof EditorTableChartsPalette;
22
+ type EditorTableChartsPalette = typeof editorTableChartsPalette;
23
+ export type EditorTableChartsPaletteKey = keyof EditorTableChartsPalette;
24
24
  /**
25
25
  * Tokenize hex codes into DST chart colors or
26
26
  * into DST background.accent colors.
@@ -178,5 +178,5 @@ declare const editorTableChartsPalette: {
178
178
  };
179
179
  };
180
180
  declare const tokenNames: ("color.background.accent.blue.subtle" | "color.background.accent.teal.subtle" | "color.background.accent.green.subtle" | "color.background.accent.orange.subtle" | "color.background.accent.red.subtle" | "color.background.accent.purple.subtle" | "color.background.accent.yellow.subtle" | "color.background.accent.magenta.subtle" | "color.background.accent.gray.subtler" | "color.chart.blue.bold" | "color.chart.teal.bold" | "color.chart.green.bold" | "color.chart.yellow.bold" | "color.chart.orange.bold" | "color.chart.red.bold" | "color.chart.magenta.bold" | "color.chart.purple.bold" | "color.chart.gray.bold" | "color.chart.blue.bolder" | "color.chart.teal.bolder" | "color.chart.green.bolder" | "color.chart.yellow.bolder" | "color.chart.orange.bolder" | "color.chart.red.bolder" | "color.chart.magenta.bolder" | "color.chart.purple.bolder" | "color.chart.gray.bolder" | "color.chart.blue.boldest" | "color.chart.teal.boldest" | "color.chart.green.boldest" | "color.chart.yellow.boldest" | "color.chart.orange.boldest" | "color.chart.red.boldest" | "color.chart.magenta.boldest" | "color.chart.purple.boldest" | "color.chart.gray.boldest")[];
181
- export declare type EditorBackgroundPaletteTokenNames = (typeof tokenNames)[number];
181
+ export type EditorBackgroundPaletteTokenNames = (typeof tokenNames)[number];
182
182
  export {};
@@ -16,8 +16,8 @@
16
16
  * - **DO**: store the ADF hex color, and use these utilities at render time to display the themed version of the color
17
17
  */
18
18
  export declare function hexToEditorTextPaletteColor<HexColor extends string>(hexColor: HexColor): HexColor extends EditorTextPaletteKey ? EditorTextPalette[HexColor] : string | undefined;
19
- declare type EditorTextPalette = typeof editorTextPalette;
20
- export declare type EditorTextPaletteKey = keyof EditorTextPalette;
19
+ type EditorTextPalette = typeof editorTextPalette;
20
+ export type EditorTextPaletteKey = keyof EditorTextPalette;
21
21
  export declare const editorTextPalette: {
22
22
  /** blue - light */
23
23
  "#B3D4FF": "var(--ds-background-accent-blue-subtler, #B3D4FF)";
@@ -0,0 +1,133 @@
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
+ export declare function hexToEditorBackgroundPaletteColorTokenName<HexColor extends string>(hexColor: HexColor): HexColor extends EditorBackgroundPaletteKey ? EditorBackgroundPalette[HexColor]['tokenName'] : EditorBackgroundPaletteTokenNames | undefined;
22
+ type EditorBackgroundPalette = typeof editorBackgroundPalette;
23
+ export type EditorBackgroundPaletteKey = keyof EditorBackgroundPalette;
24
+ export declare const editorBackgroundPalette: {
25
+ /** blue - light */
26
+ "#DEEBFF": {
27
+ tokenName: "color.background.accent.blue.subtlest";
28
+ token: "var(--ds-background-accent-blue-subtlest, #DEEBFF)";
29
+ };
30
+ /** blue - medium */
31
+ "#B3D4FF": {
32
+ tokenName: "color.background.accent.blue.subtler";
33
+ token: "var(--ds-background-accent-blue-subtler, #B3D4FF)";
34
+ };
35
+ /** blue - strong */
36
+ "#4C9AFF": {
37
+ tokenName: "color.background.accent.blue.subtle";
38
+ token: "var(--ds-background-accent-blue-subtle, #4C9AFF)";
39
+ };
40
+ /** teal - light */
41
+ "#E6FCFF": {
42
+ tokenName: "color.background.accent.teal.subtlest";
43
+ token: "var(--ds-background-accent-teal-subtlest, #E6FCFF)";
44
+ };
45
+ /** teal - medium */
46
+ "#B3F5FF": {
47
+ tokenName: "color.background.accent.teal.subtler";
48
+ token: "var(--ds-background-accent-teal-subtler, #B3F5FF)";
49
+ };
50
+ /** teal - strong */
51
+ "#79E2F2": {
52
+ tokenName: "color.background.accent.teal.subtle";
53
+ token: "var(--ds-background-accent-teal-subtle, #79E2F2)";
54
+ };
55
+ /** green - light */
56
+ "#E3FCEF": {
57
+ tokenName: "color.background.accent.green.subtlest";
58
+ token: "var(--ds-background-accent-green-subtlest, #E3FCEF)";
59
+ };
60
+ /** green - medium */
61
+ "#ABF5D1": {
62
+ tokenName: "color.background.accent.green.subtler";
63
+ token: "var(--ds-background-accent-green-subtler, #ABF5D1)";
64
+ };
65
+ /** green - strong */
66
+ "#57D9A3": {
67
+ tokenName: "color.background.accent.green.subtle";
68
+ token: "var(--ds-background-accent-green-subtle, #57D9A3)";
69
+ };
70
+ /** yellowOrange - light */
71
+ "#FFFAE6": {
72
+ tokenName: "color.background.accent.yellow.subtlest";
73
+ token: "var(--ds-background-accent-yellow-subtlest, #FFFAE6)";
74
+ };
75
+ /** yellowOrange - medium */
76
+ "#FFF0B3": {
77
+ tokenName: "color.background.accent.yellow.subtler";
78
+ token: "var(--ds-background-accent-yellow-subtler, #FFF0B3)";
79
+ };
80
+ /** yellowOrange - strong */
81
+ "#FFC400": {
82
+ tokenName: "color.background.accent.orange.subtle";
83
+ token: "var(--ds-background-accent-orange-subtle, #FFC400)";
84
+ };
85
+ /** red - light */
86
+ "#FFEBE6": {
87
+ tokenName: "color.background.accent.red.subtlest";
88
+ token: "var(--ds-background-accent-red-subtlest, #FFEBE6)";
89
+ };
90
+ /** red - medium */
91
+ "#FFBDAD": {
92
+ tokenName: "color.background.accent.red.subtler";
93
+ token: "var(--ds-background-accent-red-subtler, #FFBDAD)";
94
+ };
95
+ /** red - strong */
96
+ "#FF8F73": {
97
+ tokenName: "color.background.accent.red.subtle";
98
+ token: "var(--ds-background-accent-red-subtle, #FF8F73)";
99
+ };
100
+ /** purple - light */
101
+ "#EAE6FF": {
102
+ tokenName: "color.background.accent.purple.subtlest";
103
+ token: "var(--ds-background-accent-purple-subtlest, #EAE6FF)";
104
+ };
105
+ /** purple - medium */
106
+ "#C0B6F2": {
107
+ tokenName: "color.background.accent.purple.subtler";
108
+ token: "var(--ds-background-accent-purple-subtler, #C0B6F2)";
109
+ };
110
+ /** purple - strong */
111
+ "#998DD9": {
112
+ tokenName: "color.background.accent.purple.subtle";
113
+ token: "var(--ds-background-accent-purple-subtle, #998DD9)";
114
+ };
115
+ /** whiteGray - light */
116
+ "#FFFFFF": {
117
+ tokenName: "elevation.surface";
118
+ token: "var(--ds-surface, #FFFFFF)";
119
+ };
120
+ /** whiteGray - medium */
121
+ "#F4F5F7": {
122
+ tokenName: "color.background.accent.gray.subtlest";
123
+ token: "var(--ds-background-accent-gray-subtlest, #F4F5F7)";
124
+ };
125
+ /** whiteGray - strong */
126
+ "#B3BAC5": {
127
+ tokenName: "color.background.accent.gray.subtle";
128
+ token: "var(--ds-background-accent-gray-subtle, #B3BAC5)";
129
+ };
130
+ };
131
+ declare const tokenNames: ("color.background.accent.blue.subtlest" | "color.background.accent.blue.subtler" | "color.background.accent.blue.subtle" | "color.background.accent.teal.subtlest" | "color.background.accent.teal.subtler" | "color.background.accent.teal.subtle" | "color.background.accent.green.subtlest" | "color.background.accent.green.subtler" | "color.background.accent.green.subtle" | "color.background.accent.yellow.subtlest" | "color.background.accent.yellow.subtler" | "color.background.accent.orange.subtle" | "color.background.accent.red.subtlest" | "color.background.accent.red.subtler" | "color.background.accent.red.subtle" | "color.background.accent.purple.subtlest" | "color.background.accent.purple.subtler" | "color.background.accent.purple.subtle" | "elevation.surface" | "color.background.accent.gray.subtlest" | "color.background.accent.gray.subtle")[];
132
+ export type EditorBackgroundPaletteTokenNames = (typeof tokenNames)[number];
133
+ export {};
@@ -0,0 +1,29 @@
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 {};
@@ -0,0 +1,4 @@
1
+ export { hexToEditorBackgroundPaletteColor, hexToEditorBackgroundPaletteColorTokenName, } from './background';
2
+ export { hexToEditorBorderPaletteColor } from './border';
3
+ export { hexToEditorTextPaletteColor } from './text';
4
+ export { hexToEditorTableChartsPaletteColor, hexToEditorTableChartsPaletteColorTokenName, } from './table-charts';
@@ -0,0 +1,182 @@
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
+ export declare function hexToEditorTableChartsPaletteColorTokenName<HexColor extends string>(hexColor: HexColor): HexColor extends EditorTableChartsPaletteKey ? EditorTableChartsPalette[HexColor]['tokenName'] : EditorBackgroundPaletteTokenNames | undefined;
22
+ type EditorTableChartsPalette = typeof editorTableChartsPalette;
23
+ export type EditorTableChartsPaletteKey = keyof EditorTableChartsPalette;
24
+ /**
25
+ * Tokenize hex codes into DST chart colors or
26
+ * into DST background.accent colors.
27
+ *
28
+ * The hex codes do not match the DST tokens, they are
29
+ * constants that are saved in the ADF that will be rendered
30
+ * as the mapped DST token.
31
+ *
32
+ * https://product-fabric.atlassian.net/browse/ED-17042
33
+ */
34
+ declare const editorTableChartsPalette: {
35
+ "#7AB2FF": {
36
+ tokenName: "color.background.accent.blue.subtle";
37
+ token: "var(--ds-background-accent-blue-subtle, #7AB2FF)";
38
+ };
39
+ "#60C6D2": {
40
+ tokenName: "color.background.accent.teal.subtle";
41
+ token: "var(--ds-background-accent-teal-subtle, #60C6D2)";
42
+ };
43
+ "#6BE1B0": {
44
+ tokenName: "color.background.accent.green.subtle";
45
+ token: "var(--ds-background-accent-green-subtle, #6BE1B0)";
46
+ };
47
+ "#FFDB57": {
48
+ tokenName: "color.background.accent.yellow.subtle";
49
+ token: "var(--ds-background-accent-yellow-subtle, #FFDB57)";
50
+ };
51
+ "#FAA53D": {
52
+ tokenName: "color.background.accent.orange.subtle";
53
+ token: "var(--ds-background-accent-orange-subtle, #FAA53D)";
54
+ };
55
+ "#FF8F73": {
56
+ tokenName: "color.background.accent.red.subtle";
57
+ token: "var(--ds-background-accent-red-subtle, #FF8F73)";
58
+ };
59
+ "#E774BB": {
60
+ tokenName: "color.background.accent.magenta.subtle";
61
+ token: "var(--ds-background-accent-magenta-subtle, #E774BB)";
62
+ };
63
+ "#B5A7FB": {
64
+ tokenName: "color.background.accent.purple.subtle";
65
+ token: "var(--ds-background-accent-purple-subtle, #B5A7FB)";
66
+ };
67
+ "#8993A5": {
68
+ tokenName: "color.background.accent.gray.subtler";
69
+ token: "var(--ds-background-accent-gray-subtler, #8993A5)";
70
+ };
71
+ "#247FFF": {
72
+ tokenName: "color.chart.blue.bold";
73
+ token: "var(--ds-chart-blue-bold, #247FFF)";
74
+ };
75
+ "#1D9AAA": {
76
+ tokenName: "color.chart.teal.bold";
77
+ token: "var(--ds-chart-teal-bold, #1D9AAA)";
78
+ };
79
+ "#23A971": {
80
+ tokenName: "color.chart.green.bold";
81
+ token: "var(--ds-chart-green-bold, #23A971)";
82
+ };
83
+ "#FFBE33": {
84
+ tokenName: "color.chart.yellow.bold";
85
+ token: "var(--ds-chart-yellow-bold, #FFBE33)";
86
+ };
87
+ "#D97008": {
88
+ tokenName: "color.chart.orange.bold";
89
+ token: "var(--ds-chart-orange-bold, #D97008)";
90
+ };
91
+ "#FC552C": {
92
+ tokenName: "color.chart.red.bold";
93
+ token: "var(--ds-chart-red-bold, #FC552C)";
94
+ };
95
+ "#DA62AC": {
96
+ tokenName: "color.chart.magenta.bold";
97
+ token: "var(--ds-chart-magenta-bold, #DA62AC)";
98
+ };
99
+ "#8B77EE": {
100
+ tokenName: "color.chart.purple.bold";
101
+ token: "var(--ds-chart-purple-bold, #8B77EE)";
102
+ };
103
+ "#8590A2": {
104
+ tokenName: "color.chart.gray.bold";
105
+ token: "var(--ds-chart-gray-bold, #8590A2)";
106
+ };
107
+ "#0055CC": {
108
+ tokenName: "color.chart.blue.bolder";
109
+ token: "var(--ds-chart-blue-bolder, #0055CC)";
110
+ };
111
+ "#1D7F8C": {
112
+ tokenName: "color.chart.teal.bolder";
113
+ token: "var(--ds-chart-teal-bolder, #1D7F8C)";
114
+ };
115
+ "#177D52": {
116
+ tokenName: "color.chart.green.bolder";
117
+ token: "var(--ds-chart-green-bolder, #177D52)";
118
+ };
119
+ "#FF9D00": {
120
+ tokenName: "color.chart.yellow.bolder";
121
+ token: "var(--ds-chart-yellow-bolder, #FF9D00)";
122
+ };
123
+ "#B65C02": {
124
+ tokenName: "color.chart.orange.bolder";
125
+ token: "var(--ds-chart-orange-bolder, #B65C02)";
126
+ };
127
+ "#D32D03": {
128
+ tokenName: "color.chart.red.bolder";
129
+ token: "var(--ds-chart-red-bolder, #D32D03)";
130
+ };
131
+ "#CD519D": {
132
+ tokenName: "color.chart.magenta.bolder";
133
+ token: "var(--ds-chart-magenta-bolder, #CD519D)";
134
+ };
135
+ "#5A43D0": {
136
+ tokenName: "color.chart.purple.bolder";
137
+ token: "var(--ds-chart-purple-bolder, #5A43D0)";
138
+ };
139
+ "#758195": {
140
+ tokenName: "color.chart.gray.bolder";
141
+ token: "var(--ds-chart-gray-bolder, #758195)";
142
+ };
143
+ "#003884": {
144
+ tokenName: "color.chart.blue.boldest";
145
+ token: "var(--ds-chart-blue-boldest, #003884)";
146
+ };
147
+ "#206B74": {
148
+ tokenName: "color.chart.teal.boldest";
149
+ token: "var(--ds-chart-teal-boldest, #206B74)";
150
+ };
151
+ "#055C3F": {
152
+ tokenName: "color.chart.green.boldest";
153
+ token: "var(--ds-chart-green-boldest, #055C3F)";
154
+ };
155
+ "#946104": {
156
+ tokenName: "color.chart.yellow.boldest";
157
+ token: "var(--ds-chart-yellow-boldest, #946104)";
158
+ };
159
+ "#974F0C": {
160
+ tokenName: "color.chart.orange.boldest";
161
+ token: "var(--ds-chart-orange-boldest, #974F0C)";
162
+ };
163
+ "#A32000": {
164
+ tokenName: "color.chart.red.boldest";
165
+ token: "var(--ds-chart-red-boldest, #A32000)";
166
+ };
167
+ "#943D73": {
168
+ tokenName: "color.chart.magenta.boldest";
169
+ token: "var(--ds-chart-magenta-boldest, #943D73)";
170
+ };
171
+ "#44368B": {
172
+ tokenName: "color.chart.purple.boldest";
173
+ token: "var(--ds-chart-purple-boldest, #44368B)";
174
+ };
175
+ "#44546F": {
176
+ tokenName: "color.chart.gray.boldest";
177
+ token: "var(--ds-chart-gray-boldest, #44546F)";
178
+ };
179
+ };
180
+ declare const tokenNames: ("color.background.accent.blue.subtle" | "color.background.accent.teal.subtle" | "color.background.accent.green.subtle" | "color.background.accent.orange.subtle" | "color.background.accent.red.subtle" | "color.background.accent.purple.subtle" | "color.background.accent.yellow.subtle" | "color.background.accent.magenta.subtle" | "color.background.accent.gray.subtler" | "color.chart.blue.bold" | "color.chart.teal.bold" | "color.chart.green.bold" | "color.chart.yellow.bold" | "color.chart.orange.bold" | "color.chart.red.bold" | "color.chart.magenta.bold" | "color.chart.purple.bold" | "color.chart.gray.bold" | "color.chart.blue.bolder" | "color.chart.teal.bolder" | "color.chart.green.bolder" | "color.chart.yellow.bolder" | "color.chart.orange.bolder" | "color.chart.red.bolder" | "color.chart.magenta.bolder" | "color.chart.purple.bolder" | "color.chart.gray.bolder" | "color.chart.blue.boldest" | "color.chart.teal.boldest" | "color.chart.green.boldest" | "color.chart.yellow.boldest" | "color.chart.orange.boldest" | "color.chart.red.boldest" | "color.chart.magenta.boldest" | "color.chart.purple.boldest" | "color.chart.gray.boldest")[];
181
+ export type EditorBackgroundPaletteTokenNames = (typeof tokenNames)[number];
182
+ export {};
@@ -0,0 +1,65 @@
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 {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-palette",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "description": "The editor palette",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -19,6 +19,14 @@
19
19
  "module": "dist/esm/index.js",
20
20
  "module:es2019": "dist/es2019/index.js",
21
21
  "types": "dist/types/index.d.ts",
22
+ "typesVersions": {
23
+ ">=4.5 <4.9": {
24
+ "*": [
25
+ "dist/types-ts4.5/*",
26
+ "dist/types-ts4.5/index.d.ts"
27
+ ]
28
+ }
29
+ },
22
30
  "sideEffects": false,
23
31
  "atlaskit:src": "src/index.ts",
24
32
  "af:exports": {
@@ -31,14 +39,14 @@
31
39
  "@atlaskit/docs": "*",
32
40
  "@atlaskit/section-message": "^6.4.0",
33
41
  "@atlaskit/ssr": "*",
34
- "@atlaskit/tokens": "^1.3.0",
42
+ "@atlaskit/tokens": "^1.4.0",
35
43
  "@atlaskit/visual-regression": "*",
36
44
  "@atlaskit/webdriver-runner": "*",
37
45
  "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
38
46
  "@testing-library/react": "^12.1.5",
39
47
  "react": "^16.8.0",
40
48
  "react-dom": "^16.8.0",
41
- "typescript": "4.5.5",
49
+ "typescript": "~4.9.5",
42
50
  "wait-for-expect": "^1.2.0"
43
51
  },
44
52
  "techstack": {