@zendeskgarden/react-theming 9.0.0-next.8 → 9.0.0-next.9

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.
@@ -9,274 +9,250 @@ const PALETTE = {
9
9
  white: '#fff',
10
10
  product: {
11
11
  support: '#00a656',
12
- message: '#37b8af',
13
12
  explore: '#30aabc',
14
13
  gather: '#f6c8be',
15
14
  guide: '#eb4962',
16
- connect: '#ff6224',
17
15
  chat: '#f79a3e',
18
16
  talk: '#efc93d',
19
17
  sell: '#c38f00'
20
18
  },
21
19
  grey: {
22
- 100: '#f4f6f6',
23
- 200: '#e4e7e9',
24
- 300: '#c7cdd0',
25
- 400: '#afb7bd',
26
- 500: '#88929d',
27
- 600: '#7f8a95',
28
- 700: '#65707a',
29
- 800: '#4b565f',
30
- 900: '#2e373f',
31
- 1000: '#1e252a',
32
- 1100: '#171b1f',
33
- 1200: '#101316'
20
+ 100: '#f8f9f9',
21
+ 200: '#e8eaec',
22
+ 300: '#d8dcde',
23
+ 400: '#b0b8be',
24
+ 500: '#919ca5',
25
+ 600: '#848f99',
26
+ 700: '#5c6970',
27
+ 800: '#39434b',
28
+ 900: '#293239',
29
+ 1000: '#1c2227',
30
+ 1100: '#151a1e',
31
+ 1200: '#0a0d0e'
34
32
  },
35
33
  blue: {
36
34
  100: '#edf7ff',
37
- 200: '#d9eaf7',
38
- 300: '#b3d0e7',
39
- 400: '#92bbdb',
40
- 500: '#5896c9',
41
- 600: '#4b8ec5',
35
+ 200: '#ddecf8',
36
+ 300: '#cce0f1',
37
+ 400: '#93bcdc',
38
+ 500: '#66a0cd',
39
+ 600: '#2694d6',
42
40
  700: '#1f73b7',
43
- 800: '#18578b',
44
- 900: '#103859',
45
- 1000: '#0b253b',
46
- 1100: '#081c2d',
47
- 1200: '#061420'
41
+ 800: '#13456d',
42
+ 900: '#0f3655',
43
+ 1000: '#0a2338',
44
+ 1100: '#061420',
45
+ 1200: '#040d15'
48
46
  },
49
47
  red: {
50
48
  100: '#fff2f3',
51
- 200: '#fde1e3',
52
- 300: '#f5bfc4',
53
- 400: '#f2a0a6',
54
- 500: '#e76973',
55
- 600: '#e35c67',
49
+ 200: '#fee3e5',
50
+ 300: '#f5d5d8',
51
+ 400: '#f2a1a8',
52
+ 500: '#ea7881',
53
+ 600: '#eb5c69',
56
54
  700: '#cd3642',
57
- 800: '#9d2933',
58
- 900: '#6c1219',
59
- 1000: '#431418',
60
- 1100: '#2d1315',
61
- 1200: '#1b1011'
55
+ 800: '#7e1d25',
56
+ 900: '#671219',
57
+ 1000: '#3d1418',
58
+ 1100: '#1d1011',
59
+ 1200: '#100b0c'
62
60
  },
63
61
  yellow: {
64
62
  100: '#fff3e4',
65
- 200: '#ffe2c2',
66
- 300: '#ffc079',
67
- 400: '#fba246',
68
- 500: '#d87916',
69
- 600: '#ce7117',
63
+ 200: '#ffe6cb',
64
+ 300: '#fed6a9',
65
+ 400: '#fca347',
66
+ 500: '#e38215',
67
+ 600: '#d67305',
70
68
  700: '#ac5918',
71
- 800: '#874114',
72
- 900: '#512d17',
73
- 1000: '#312016',
74
- 1100: '#221913',
75
- 1200: '#17120f'
69
+ 800: '#673515',
70
+ 900: '#4c2c17',
71
+ 1000: '#2d1e15',
72
+ 1100: '#18120f',
73
+ 1200: '#0e0c0b'
76
74
  },
77
75
  green: {
78
76
  100: '#eef8f4',
79
- 200: '#d7ede4',
80
- 300: '#b4d3c6',
81
- 400: '#91bfae',
82
- 500: '#3fa17e',
83
- 600: '#329974',
77
+ 200: '#daeee6',
78
+ 300: '#cae3d9',
79
+ 400: '#94c1b0',
80
+ 500: '#4eab89',
81
+ 600: '#26a178',
84
82
  700: '#037f52',
85
- 800: '#186045',
86
- 900: '#0b3e2b',
87
- 1000: '#0c291e',
88
- 1100: '#0b1e17',
89
- 1200: '#0a1511'
83
+ 800: '#104b35',
84
+ 900: '#0b3b29',
85
+ 1000: '#0c261c',
86
+ 1100: '#0a1511',
87
+ 1200: '#080d0c'
90
88
  },
91
89
  kale: {
92
90
  100: '#ecf9f9',
93
- 200: '#d8ebeb',
94
- 300: '#b3d2d0',
95
- 400: '#94bebd',
96
- 500: '#5e9b9c',
97
- 600: '#579394',
91
+ 200: '#daeded',
92
+ 300: '#cbe2e1',
93
+ 400: '#97bfbf',
94
+ 500: '#6ba4a5',
95
+ 600: '#4a9999',
98
96
  700: '#40787a',
99
- 800: '#275c5f',
100
- 900: '#0a3c42',
101
- 1000: '#02282d',
102
- 1100: '#041e22',
103
- 1200: '#061517'
97
+ 800: '#16494f',
98
+ 900: '#063940',
99
+ 1000: '#03252a',
100
+ 1100: '#061517',
101
+ 1200: '#060e0e'
104
102
  },
105
103
  fuschia: {
106
104
  100: '#fbf3f8',
107
- 200: '#f6e2ef',
108
- 300: '#ecc0dc',
109
- 400: '#e3a2cc',
110
- 500: '#d36faf',
111
- 600: '#cf63a8',
105
+ 200: '#f7e6f1',
106
+ 300: '#f2d5e7',
107
+ 400: '#e3a4cc',
108
+ 500: '#d77db7',
109
+ 600: '#d16aac',
112
110
  700: '#b34496',
113
- 800: '#971688',
114
- 900: '#640e59',
115
- 1000: '#430a3d',
116
- 1100: '#34072f',
117
- 1200: '#260523',
118
- M400: '#cf62a8',
119
- M600: '#a8458c'
111
+ 800: '#78116c',
112
+ 900: '#5a0d51',
113
+ 1000: '#3f0939',
114
+ 1100: '#31072c',
115
+ 1200: '#1b0418'
120
116
  },
121
117
  pink: {
122
- 100: '#fcf4f5',
123
- 200: '#f7e3e8',
124
- 300: '#edc1ca',
125
- 400: '#e4a5b3',
126
- 500: '#d57388',
127
- 600: '#e35b72',
118
+ 100: '#fcf3f4',
119
+ 200: '#f7e5e8',
120
+ 300: '#f3d6dc',
121
+ 400: '#e5a6b4',
122
+ 500: '#d98193',
123
+ 600: '#d96b81',
128
124
  700: '#d62054',
129
- 800: '#94304e',
130
- 900: '#611f32',
131
- 1000: '#401522',
132
- 1100: '#31101a',
133
- 1200: '#230b12',
134
- M400: '#d57287',
135
- M600: '#b23a5d'
125
+ 800: '#75263d',
126
+ 900: '#561d2e',
127
+ 1000: '#3c141f',
128
+ 1100: '#2e0f18',
129
+ 1200: '#17080c'
136
130
  },
137
131
  crimson: {
138
- 100: '#fbf4f3',
139
- 200: '#f6e4e1',
140
- 300: '#eac3bc',
141
- 400: '#e1a89e',
142
- 500: '#d1796a',
143
- 600: '#cd6e5d',
132
+ 100: '#fbf3f2',
133
+ 200: '#f7e7e4',
134
+ 300: '#f1d7d2',
135
+ 400: '#e2aaa0',
136
+ 500: '#d58678',
137
+ 600: '#cf7464',
144
138
  700: '#be4938',
145
- 800: '#a32217',
146
- 900: '#6b160f',
147
- 1000: '#480f0a',
148
- 1100: '#370c08',
149
- 1200: '#280806',
150
- M400: '#cc6c5b',
151
- M600: '#b24a3c'
139
+ 800: '#811b12',
140
+ 900: '#61140d',
141
+ 1000: '#440e09',
142
+ 1100: '#340b07',
143
+ 1200: '#1c0604'
152
144
  },
153
145
  orange: {
154
146
  100: '#fdf3ed',
155
- 200: '#f9e3d3',
156
- 300: '#f2c39f',
157
- 400: '#eda671',
158
- 500: '#e2721e',
159
- 600: '#d26e20',
147
+ 200: '#fae7d8',
148
+ 300: '#f7d7be',
149
+ 400: '#eda875',
150
+ 500: '#e58035',
151
+ 600: '#d57428',
160
152
  700: '#af5626',
161
- 800: '#85421d',
162
- 900: '#562b13',
163
- 1000: '#3a1c0d',
164
- 1100: '#2c150a',
165
- 1200: '#1f0f07',
166
- M400: '#d4772c',
167
- M600: '#b35827'
153
+ 800: '#693317',
154
+ 900: '#4d2711',
155
+ 1000: '#361a0c',
156
+ 1100: '#291409',
157
+ 1200: '#150a04'
168
158
  },
169
159
  lemon: {
170
- 100: '#fff6cf',
171
- 200: '#ffe682',
172
- 300: '#ffc417',
173
- 400: '#eda900',
174
- 500: '#ba8900',
175
- 600: '#b08100',
160
+ 100: '#fff7d4',
161
+ 200: '#ffea97',
162
+ 300: '#ffdc4f',
163
+ 400: '#efab00',
164
+ 500: '#c79100',
165
+ 600: '#b68500',
176
166
  700: '#8f6900',
177
- 800: '#6d5000',
178
- 900: '#463300',
179
- 1000: '#2f2200',
180
- 1100: '#231a00',
181
- 1200: '#191200',
182
- M400: '#e7a500',
183
- M600: '#c38f00'
167
+ 800: '#563e00',
168
+ 900: '#3f2e00',
169
+ 1000: '#2b2000',
170
+ 1100: '#221800',
171
+ 1200: '#110c00'
184
172
  },
185
173
  lime: {
186
- 100: '#ebfae6',
187
- 200: '#c9f2bd',
188
- 300: '#88e270',
189
- 400: '#4ecf2a',
190
- 500: '#4da42a',
191
- 600: '#489b20',
174
+ 100: '#ecfae7',
175
+ 200: '#d1f3c7',
176
+ 300: '#b3eda3',
177
+ 400: '#4fd12b',
178
+ 500: '#45b025',
179
+ 600: '#509f2d',
192
180
  700: '#3d7e19',
193
- 800: '#385f23',
194
- 900: '#243c16',
195
- 1000: '#18280f',
196
- 1100: '#121e0b',
197
- 1200: '#0d1508',
198
- M400: '#519e2d',
199
- M600: '#47782c'
181
+ 800: '#2c491b',
182
+ 900: '#203614',
183
+ 1000: '#16250e',
184
+ 1100: '#111d0a',
185
+ 1200: '#090e05'
200
186
  },
201
187
  mint: {
202
188
  100: '#d6ffeb',
203
- 200: '#83ffc3',
204
- 300: '#00ea79',
205
- 400: '#00d16d',
206
- 500: '#00a756',
207
- 600: '#279b65',
208
- 700: '#2d7d55',
209
- 800: '#225f41',
210
- 900: '#163d2a',
211
- 1000: '#0f291c',
212
- 1100: '#0b1e15',
213
- 1200: '#08150f',
214
- M400: '#299c66',
215
- M600: '#2e8057'
189
+ 200: '#9affce',
190
+ 300: '#0afe89',
191
+ 400: '#00d26d',
192
+ 500: '#01b15c',
193
+ 600: '#16a260',
194
+ 700: '#2d7e55',
195
+ 800: '#1b4b33',
196
+ 900: '#143726',
197
+ 1000: '#0e261a',
198
+ 1100: '#0b1d14',
199
+ 1200: '#050e0a'
216
200
  },
217
201
  teal: {
218
- 100: '#d6fefa',
219
- 200: '#70fdef',
220
- 300: '#03e5ce',
221
- 400: '#03ccb8',
222
- 500: '#02a392',
223
- 600: '#1f998b',
202
+ 100: '#d4fefa',
203
+ 200: '#88fdf1',
204
+ 300: '#0bf8e1',
205
+ 400: '#03cdb8',
206
+ 500: '#02ad9c',
207
+ 600: '#2a9d8f',
224
208
  700: '#367a74',
225
- 800: '#2e5c59',
226
- 900: '#1e3b39',
227
- 1000: '#142726',
228
- 1100: '#0f1d1c',
229
- 1200: '#0a1514',
230
- M400: '#2d9e8f',
231
- M600: '#3c7873'
209
+ 800: '#254846',
210
+ 900: '#1b3534',
211
+ 1000: '#122423',
212
+ 1100: '#0e1c1a',
213
+ 1200: '#070d0d'
232
214
  },
233
215
  azure: {
234
- 100: '#f0f7fe',
235
- 200: '#d7eafb',
236
- 300: '#a8d1f7',
237
- 400: '#7fbbf3',
238
- 500: '#3795ed',
239
- 600: '#598ad0',
240
- 700: '#2770c4',
241
- 800: '#2c5689',
242
- 900: '#1d3758',
243
- 1000: '#13253a',
244
- 1100: '#0e1b2c',
245
- 1200: '#0a131f',
246
- M400: '#5f8dcf',
247
- M600: '#3a70b2'
216
+ 100: '#eff7fe',
217
+ 200: '#d9ecfc',
218
+ 300: '#c4e0fa',
219
+ 400: '#82bcf4',
220
+ 500: '#4b9fee',
221
+ 600: '#3191ea',
222
+ 700: '#2770c3',
223
+ 800: '#23446b',
224
+ 900: '#1a3250',
225
+ 1000: '#122238',
226
+ 1100: '#0e1a2a',
227
+ 1200: '#070d14'
248
228
  },
249
229
  royal: {
250
- 100: '#f5f6fc',
251
- 200: '#e3e6f7',
252
- 300: '#c5cbee',
253
- 400: '#abb3e7',
254
- 500: '#7f8cda',
255
- 600: '#7182e1',
256
- 700: '#4d67d3',
257
- 800: '#1f40d8',
258
- 900: '#142a8d',
259
- 1000: '#0e1c5f',
260
- 1100: '#0a1548',
261
- 1200: '#070f34',
262
- M400: '#7986d8',
263
- M600: '#4b61c3'
230
+ 100: '#f4f5fc',
231
+ 200: '#e7e9f8',
232
+ 300: '#d8dcf4',
233
+ 400: '#acb4e7',
234
+ 500: '#8a96dd',
235
+ 600: '#7a88d9',
236
+ 700: '#4c67d3',
237
+ 800: '#1833ab',
238
+ 900: '#122680',
239
+ 1000: '#0d1a5a',
240
+ 1100: '#0a1445',
241
+ 1200: '#050a25'
264
242
  },
265
243
  purple: {
266
- 100: '#f9f4fb',
267
- 200: '#efe3f5',
268
- 300: '#ddc3e9',
269
- 400: '#cea8e0',
270
- 500: '#b57acf',
271
- 600: '#b16ecf',
244
+ 100: '#f9f3fb',
245
+ 200: '#f2e7f6',
246
+ 300: '#e9d8f1',
247
+ 400: '#d0a9e0',
248
+ 500: '#bb86d3',
249
+ 600: '#b276cd',
272
250
  700: '#9256b1',
273
- 800: '#722eb8',
274
- 900: '#491b7f',
275
- 1000: '#311256',
276
- 1100: '#250e41',
277
- 1200: '#1b0a2e',
278
- M400: '#b072cc',
279
- M600: '#9358b0'
251
+ 800: '#58209a',
252
+ 900: '#411973',
253
+ 1000: '#2e1150',
254
+ 1100: '#230d3f',
255
+ 1200: '#120720'
280
256
  }
281
257
  };
282
258
 
@@ -158,6 +158,20 @@ const lineHeights = {
158
158
  xxl: `${BASE * 8}px`,
159
159
  xxxl: `${BASE * 11}px`
160
160
  };
161
+ const opacity = {
162
+ 100: 0.08,
163
+ 200: 0.16,
164
+ 300: 0.24,
165
+ 400: 0.32,
166
+ 500: 0.4,
167
+ 600: 0.48,
168
+ 700: 0.56,
169
+ 800: 0.64,
170
+ 900: 0.72,
171
+ 1000: 0.8,
172
+ 1100: 0.88,
173
+ 1200: 0.96
174
+ };
161
175
  const palette = {
162
176
  ...PALETTE
163
177
  };
@@ -199,6 +213,7 @@ const DEFAULT_THEME = {
199
213
  fontWeights,
200
214
  iconSizes,
201
215
  lineHeights,
216
+ opacity,
202
217
  palette,
203
218
  rtl: false,
204
219
  shadowWidths,
package/dist/esm/index.js CHANGED
@@ -10,6 +10,7 @@ export { default as PALETTE } from './elements/palette/index.js';
10
10
  export { default as PALETTE_V8 } from './elements/palette/v8.js';
11
11
  export { default as retrieveComponentStyles } from './utils/retrieveComponentStyles.js';
12
12
  export { getArrowPosition } from './utils/getArrowPosition.js';
13
+ export { getCheckeredBackground } from './utils/getCheckeredBackground.js';
13
14
  export { getColor } from './utils/getColor.js';
14
15
  export { getColorV8 } from './utils/getColorV8.js';
15
16
  export { getFloatingPlacements } from './utils/getFloatingPlacements.js';
@@ -23,4 +24,5 @@ export { useWindow } from './utils/useWindow.js';
23
24
  export { useText } from './utils/useText.js';
24
25
  export { default as menuStyles } from './utils/menuStyles.js';
25
26
  export { SELECTOR_FOCUS_VISIBLE, focusStyles } from './utils/focusStyles.js';
27
+ export { StyledBaseIcon } from './utils/StyledBaseIcon.js';
26
28
  export { ARROW_POSITION, MENU_POSITION, PLACEMENT } from './types/index.js';
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import styled from 'styled-components';
8
+ import React, { Children } from 'react';
9
+
10
+ const StyledBaseIcon = styled(_ref => {
11
+ let {
12
+ children,
13
+ theme,
14
+ ...props
15
+ } = _ref;
16
+ return React.cloneElement(Children.only(children), props);
17
+ }).withConfig({
18
+ displayName: "StyledBaseIcon",
19
+ componentId: "sc-1moykgb-0"
20
+ })([""]);
21
+
22
+ export { StyledBaseIcon };
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import { getColor } from './getColor.js';
8
+
9
+ const getCheckeredBackground = _ref => {
10
+ let {
11
+ theme,
12
+ size,
13
+ overlay,
14
+ positionY = 0,
15
+ repeat = 'repeat'
16
+ } = _ref;
17
+ const color = getColor({
18
+ theme,
19
+ variable: 'border.default'
20
+ });
21
+ const dimensions = `${size}px ${size}px`;
22
+ const positionX1 = theme.rtl ? '100%' : '0';
23
+ const positionX2 = theme.rtl ? `calc(100% - ${size / 2}px)` : `${size / 2}px`;
24
+ const position1 = `${positionX1} ${positionY}px`;
25
+ const position2 = `${positionX2} ${size / 2 + positionY}px`;
26
+ const position3 = `${positionX2} ${positionY}px`;
27
+ const position4 = `${positionX1} ${size / -2 + positionY}px`;
28
+ let retVal = `
29
+ linear-gradient(45deg, ${color} 25%, transparent 25%) ${position1} / ${dimensions} ${repeat},
30
+ linear-gradient(45deg, transparent 75%, ${color} 75%) ${position2} / ${dimensions} ${repeat},
31
+ linear-gradient(135deg, ${color} 25%, transparent 25%) ${position3} / ${dimensions} ${repeat},
32
+ linear-gradient(135deg, transparent 75%, ${color} 75%) ${position4} / ${dimensions} ${repeat}
33
+ `;
34
+ if (overlay) {
35
+ retVal = overlay.startsWith('linear-gradient') ? `${overlay}, ${retVal}` : `linear-gradient(${overlay}, ${overlay}), ${retVal}`;
36
+ }
37
+ return retVal;
38
+ };
39
+
40
+ export { getCheckeredBackground };
@@ -42,7 +42,7 @@ const toHex = (hue, shade, offset, scheme) => {
42
42
  }
43
43
  return retVal;
44
44
  };
45
- const toColor = (colors, palette, scheme, hue, shade, offset, transparency) => {
45
+ const toColor = (colors, palette, opacity, scheme, hue, shade, offset, transparency) => {
46
46
  let retVal;
47
47
  let _hue = colors[hue] || hue;
48
48
  if (Object.hasOwn(palette, _hue)) {
@@ -65,7 +65,11 @@ const toColor = (colors, palette, scheme, hue, shade, offset, transparency) => {
65
65
  }
66
66
  }
67
67
  if (retVal && transparency) {
68
- retVal = rgba(retVal, transparency);
68
+ const alpha = transparency > 1 ? opacity[transparency] : transparency;
69
+ if (alpha === undefined) {
70
+ throw new Error('Error: invalid `transparency` parameter');
71
+ }
72
+ retVal = rgba(retVal, alpha);
69
73
  }
70
74
  return retVal;
71
75
  };
@@ -115,7 +119,8 @@ const getColor = memoize(_ref => {
115
119
  }
116
120
  }
117
121
  if (_hue) {
118
- retVal = toColor(colors, palette, scheme, _hue, _shade, _offset, _transparency);
122
+ const opacity = theme.opacity && Object.keys(theme.opacity).length > 0 ? theme.opacity : DEFAULT_THEME.opacity;
123
+ retVal = toColor(colors, palette, opacity, scheme, _hue, _shade, _offset, _transparency);
119
124
  }
120
125
  if (retVal === undefined) {
121
126
  throw new Error('Error: invalid `getColor` parameters');