@zendeskgarden/react-colorpickers 9.0.0-next.9 → 9.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.
Files changed (47) hide show
  1. package/dist/esm/elements/ColorPicker/ColorWell.js +10 -12
  2. package/dist/esm/elements/ColorPicker/index.js +12 -12
  3. package/dist/esm/elements/ColorPickerDialog/index.js +7 -5
  4. package/dist/esm/elements/ColorSwatch/index.js +64 -61
  5. package/dist/esm/elements/ColorSwatchDialog/index.js +7 -4
  6. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/check-sm-fill.svg.js +1 -1
  7. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/chevron-down-stroke.svg.js +1 -1
  8. package/dist/esm/styled/ColorPicker/StyledAlphaRange.js +4 -7
  9. package/dist/esm/styled/ColorPicker/StyledColorPicker.js +3 -6
  10. package/dist/esm/styled/ColorPicker/StyledColorWell.js +3 -6
  11. package/dist/esm/styled/ColorPicker/StyledColorWellThumb.js +23 -15
  12. package/dist/esm/styled/ColorPicker/StyledHexField.js +2 -5
  13. package/dist/esm/styled/ColorPicker/StyledHueRange.js +2 -6
  14. package/dist/esm/styled/ColorPicker/StyledInput.js +2 -5
  15. package/dist/esm/styled/ColorPicker/StyledInputGroup.js +2 -5
  16. package/dist/esm/styled/ColorPicker/StyledLabel.js +2 -5
  17. package/dist/esm/styled/ColorPicker/StyledPreview.js +6 -9
  18. package/dist/esm/styled/ColorPicker/StyledRGBAField.js +2 -5
  19. package/dist/esm/styled/ColorPicker/StyledSliderGroup.js +2 -5
  20. package/dist/esm/styled/ColorPicker/StyledSliders.js +26 -7
  21. package/dist/esm/styled/ColorPickerDialog/StyledButton.js +2 -8
  22. package/dist/esm/styled/ColorPickerDialog/StyledButtonPreview.js +12 -14
  23. package/dist/esm/styled/ColorPickerDialog/StyledTooltipBody.js +5 -8
  24. package/dist/esm/styled/ColorPickerDialog/StyledTooltipDialog.js +20 -0
  25. package/dist/esm/styled/ColorSwatch/StyledCell.js +2 -5
  26. package/dist/esm/styled/ColorSwatch/StyledColorSwatch.js +2 -5
  27. package/dist/esm/styled/ColorSwatch/StyledColorSwatchInput.js +2 -5
  28. package/dist/esm/styled/ColorSwatch/StyledColorSwatchLabel.js +19 -9
  29. package/dist/esm/styled/ColorSwatch/StyledIcon.js +2 -5
  30. package/dist/esm/styled/common/StyledRange.js +38 -32
  31. package/dist/index.cjs.js +277 -288
  32. package/dist/typings/styled/ColorPicker/StyledAlphaRange.d.ts +2 -2
  33. package/dist/typings/styled/ColorPicker/StyledColorPicker.d.ts +1 -1
  34. package/dist/typings/styled/ColorPicker/StyledColorWell.d.ts +1 -1
  35. package/dist/typings/styled/ColorPicker/StyledPreview.d.ts +3 -3
  36. package/dist/typings/styled/ColorPicker/StyledSliders.d.ts +3 -2
  37. package/dist/typings/styled/ColorPickerDialog/StyledButton.d.ts +0 -1
  38. package/dist/typings/styled/ColorPickerDialog/StyledButtonPreview.d.ts +1 -1
  39. package/dist/typings/styled/ColorPickerDialog/{StyledTooltipModal.d.ts → StyledTooltipDialog.d.ts} +2 -2
  40. package/dist/typings/styled/ColorSwatch/StyledColorSwatchLabel.d.ts +1 -1
  41. package/dist/typings/styled/common/StyledRange.d.ts +2 -2
  42. package/dist/typings/styled/index.d.ts +1 -1
  43. package/dist/typings/styled/types.d.ts +12 -0
  44. package/dist/typings/types/index.d.ts +9 -9
  45. package/package.json +11 -12
  46. package/LICENSE.md +0 -176
  47. package/dist/esm/styled/ColorPickerDialog/StyledTooltipModal.js +0 -23
package/dist/index.cjs.js CHANGED
@@ -131,22 +131,19 @@ const getThumbPosition = (x, y, rtl, container) => {
131
131
  };
132
132
  };
133
133
 
134
- const COMPONENT_ID$m = 'colorpickers.colorpicker';
134
+ const COMPONENT_ID$l = 'colorpickers.colorpicker';
135
135
  const getColorPickerWidth = props => {
136
- return props.isOpaque ? 268 : 312;
136
+ return props.$isOpaque ? 268 : 312;
137
137
  };
138
138
  const StyledColorPicker = styled__default.default.div.attrs({
139
- 'data-garden-id': COMPONENT_ID$m,
140
- 'data-garden-version': '9.0.0-next.9'
139
+ 'data-garden-id': COMPONENT_ID$l,
140
+ 'data-garden-version': '9.0.0'
141
141
  }).withConfig({
142
142
  displayName: "StyledColorPicker",
143
143
  componentId: "sc-gspq4q-0"
144
- })(["width:", "px;min-width:", "px;", ";"], getColorPickerWidth, getColorPickerWidth, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$m, props));
145
- StyledColorPicker.defaultProps = {
146
- theme: reactTheming.DEFAULT_THEME
147
- };
144
+ })(["width:", "px;min-width:", "px;", ";"], getColorPickerWidth, getColorPickerWidth, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$l, props));
148
145
 
149
- const COMPONENT_ID$l = 'colorpickers.colorpicker_range';
146
+ const COMPONENT_ID$k = 'colorpickers.colorpicker_range';
150
147
  const thumbStyles = function (styles) {
151
148
  let modifier = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
152
149
  return `
@@ -191,17 +188,36 @@ const trackLowerStyles = function (styles) {
191
188
  }
192
189
  `;
193
190
  };
194
- const colorStyles$1 = props => {
195
- const thumbBackgroundColor = reactTheming.getColorV8('neutralHue', 100, props.theme);
196
- const thumbBorderColor = thumbBackgroundColor;
197
- const thumbActiveBackgroundColor = reactTheming.getColorV8('neutralHue', 200, props.theme);
198
- const thumbActiveBorderColor = reactTheming.getColorV8('primaryHue', 600, props.theme);
199
- const thumbFocusBorderColor = reactTheming.getColorV8('primaryHue', 400, props.theme);
200
- const thumbHoverBackgroundColor = thumbActiveBackgroundColor;
201
- const thumbHoverBorderColor = thumbHoverBackgroundColor;
191
+ const colorStyles$2 = _ref => {
192
+ let {
193
+ theme
194
+ } = _ref;
195
+ const thumbBackgroundColor = reactTheming.getColor({
196
+ theme,
197
+ variable: 'background.default'
198
+ });
199
+ const thumbBorderColor = reactTheming.getColor({
200
+ theme,
201
+ variable: 'border.default',
202
+ dark: {
203
+ offset: -100
204
+ },
205
+ light: {
206
+ offset: 100
207
+ }
208
+ });
209
+ const thumbActiveBackgroundColor = thumbBackgroundColor;
210
+ const thumbActiveBorderColor = reactTheming.getColor({
211
+ theme,
212
+ variable: 'border.primaryEmphasis'
213
+ });
214
+ const thumbFocusBorderColor = thumbActiveBorderColor;
215
+ const thumbHoverBackgroundColor = reactTheming.getColor({
216
+ theme,
217
+ variable: 'background.subtle'
218
+ });
219
+ const thumbHoverBorderColor = thumbActiveBorderColor;
202
220
  return `
203
- border-color: ${props.isOpaque && reactTheming.getColorV8('background', 600 , props.theme)};
204
-
205
221
  ${trackStyles(`
206
222
  background-color: transparent;
207
223
  `)}
@@ -231,32 +247,22 @@ const colorStyles$1 = props => {
231
247
  `, ':active')}
232
248
  `;
233
249
  };
234
- const getThumbSize = props => props.theme.space.base * (props.isOpaque ? 6 : 4);
235
- const getTrackHeight = props => props.theme.space.base * (props.isOpaque ? 6 : 3);
250
+ const getThumbSize = props => props.theme.space.base * (props.$isOpaque ? 6 : 4);
251
+ const getTrackHeight = props => props.theme.space.base * (props.$isOpaque ? 6 : 3);
236
252
  const getTrackMargin = props => (getThumbSize(props) - getTrackHeight(props)) / 2 + polished.stripUnit(props.theme.shadowWidths.md);
237
- const sizeStyles$2 = props => {
253
+ const sizeStyles$3 = props => {
238
254
  const thumbSize = getThumbSize(props);
239
255
  const trackHeight = getTrackHeight(props);
240
256
  const trackMargin = getTrackMargin(props);
241
257
  const thumbMargin = (trackHeight - thumbSize) / 2;
242
- const trackOffset = props.theme.space.base * (props.isOpaque ? -2 : -1);
243
- const height = props.isOpaque ? trackHeight : trackMargin * 2 + trackHeight;
244
- let marginHorizontal;
245
- let border;
246
- let borderRadius;
247
- if (props.isOpaque) {
248
- marginHorizontal = `-${trackMargin}px`;
249
- border = `${trackMargin}px ${props.theme.borderStyles.solid}`;
250
- borderRadius = `${trackMargin + polished.stripUnit(props.theme.shadowWidths.md)}px`;
251
- }
258
+ const trackOffset = props.theme.space.base * (props.$isOpaque ? -2 : -1);
259
+ const height = props.$isOpaque ? trackHeight : trackMargin * 2 + trackHeight;
252
260
  return `
253
261
  /* stylelint-disable-next-line declaration-no-important */
254
262
  margin-top: 0 !important;
255
- margin-${props.theme.rtl ? 'right' : 'left'}: ${marginHorizontal};
256
263
  height: ${height}px; /* [1] */
257
264
  box-sizing: content-box; /* [2] */
258
- border: ${border};
259
- border-radius: ${borderRadius};
265
+ border-radius: ${props.$isOpaque && props.theme.borderRadii.md};
260
266
 
261
267
  ${trackStyles(`
262
268
  margin: ${trackMargin}px ${trackOffset}px;
@@ -265,43 +271,37 @@ const sizeStyles$2 = props => {
265
271
 
266
272
  ${thumbStyles(`
267
273
  margin: ${thumbMargin}px 0;
268
- border-width: ${polished.math(`${props.theme.borderWidths.sm} * 2`)};
274
+ border-width: ${props.theme.borderWidths.sm};
269
275
  height: ${thumbSize}px;
270
276
  width: ${thumbSize}px;
271
277
  `)};
272
278
  `;
273
279
  };
274
280
  const StyledRange = styled__default.default(reactForms.Range).attrs({
275
- 'data-garden-id': COMPONENT_ID$l,
276
- 'data-garden-version': '9.0.0-next.9',
281
+ 'data-garden-id': COMPONENT_ID$k,
282
+ 'data-garden-version': '9.0.0',
277
283
  hasLowerTrack: false
278
284
  }).withConfig({
279
285
  displayName: "StyledRange",
280
286
  componentId: "sc-ug3wi9-0"
281
- })(["", ";", " ", ";", ";"], sizeStyles$2, trackStyles(`
287
+ })(["", ";", " ", ";", ";"], sizeStyles$3, trackStyles(`
282
288
  border-radius: 0;
283
- `), colorStyles$1, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$l, props));
284
- StyledRange.defaultProps = {
285
- theme: reactTheming.DEFAULT_THEME
286
- };
289
+ `), colorStyles$2, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$k, props));
287
290
 
288
- const COMPONENT_ID$k = 'colorpickers.colorpicker_hue';
291
+ const COMPONENT_ID$j = 'colorpickers.colorpicker_hue';
289
292
  const StyledHueRange = styled__default.default(StyledRange).attrs({
290
- 'data-garden-id': COMPONENT_ID$k,
291
- 'data-garden-version': '9.0.0-next.9'
293
+ 'data-garden-id': COMPONENT_ID$j,
294
+ 'data-garden-version': '9.0.0'
292
295
  }).withConfig({
293
296
  displayName: "StyledHueRange",
294
297
  componentId: "sc-1gdhww1-0"
295
- })(["background:linear-gradient( to ", ",#f00 0%,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,#f00 100% ) no-repeat;background-position:", ";background-size:100% ", "px;"], props => props.theme.rtl ? 'left' : 'right', props => !props.isOpaque && `0 ${getTrackMargin(props)}px`, props => getTrackHeight(props));
296
- StyledHueRange.defaultProps = {
297
- theme: reactTheming.DEFAULT_THEME
298
- };
298
+ })(["background:linear-gradient( to ", ",#f00 0%,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,#f00 100% ) no-repeat;background-position:", ";background-size:100% ", "px;"], props => props.theme.rtl ? 'left' : 'right', props => !props.$isOpaque && `0 ${getTrackMargin(props)}px`, props => getTrackHeight(props));
299
299
 
300
- const COMPONENT_ID$j = 'colorpickers.colorpicker_alpha';
300
+ const COMPONENT_ID$i = 'colorpickers.colorpicker_alpha';
301
301
  const background$3 = props => {
302
302
  const direction = `to ${props.theme.rtl ? 'left' : 'right'}`;
303
- const fromColor = `rgba(${props.red}, ${props.green}, ${props.blue}, 0)`;
304
- const toColor = `rgb(${props.red}, ${props.green}, ${props.blue})`;
303
+ const fromColor = `rgba(${props.$red}, ${props.$green}, ${props.$blue}, 0)`;
304
+ const toColor = `rgb(${props.$red}, ${props.$green}, ${props.$blue})`;
305
305
  const positionY = getTrackMargin(props);
306
306
  const height = getTrackHeight(props);
307
307
  const overlay = `linear-gradient(${direction}, ${fromColor}, ${toColor}) 0 ${positionY}px / 100% ${height}px no-repeat`;
@@ -318,21 +318,18 @@ const StyledAlphaRange = styled__default.default(StyledRange).attrs(props => ({
318
318
  backgroundSize: 'auto',
319
319
  background: background$3(props)
320
320
  },
321
- 'data-garden-id': COMPONENT_ID$j,
322
- 'data-garden-version': '9.0.0-next.9'
321
+ 'data-garden-id': COMPONENT_ID$i,
322
+ 'data-garden-version': '9.0.0'
323
323
  })).withConfig({
324
324
  displayName: "StyledAlphaRange",
325
325
  componentId: "sc-1f6hp2j-0"
326
326
  })([""]);
327
- StyledAlphaRange.defaultProps = {
328
- theme: reactTheming.DEFAULT_THEME
329
- };
330
327
 
331
- const COMPONENT_ID$i = 'colorpickers.colorpicker_preview_box';
328
+ const COMPONENT_ID$h = 'colorpickers.colorpicker_preview_box';
332
329
  const background$2 = props => {
333
- const alpha = props.alpha ? props.alpha / 100 : 0;
334
- let retVal = `rgba(${props.red}, ${props.green}, ${props.blue}, ${alpha})`;
335
- if (!props.isOpaque) {
330
+ const alpha = props.$alpha ? props.$alpha / 100 : 0;
331
+ let retVal = `rgba(${props.$red}, ${props.$green}, ${props.$blue}, ${alpha})`;
332
+ if (!props.$isOpaque) {
336
333
  retVal = reactTheming.getCheckeredBackground({
337
334
  theme: props.theme,
338
335
  size: 13,
@@ -345,30 +342,27 @@ const StyledPreview = styled__default.default.div.attrs(props => ({
345
342
  style: {
346
343
  background: background$2(props)
347
344
  },
348
- 'data-garden-id': COMPONENT_ID$i,
349
- 'data-garden-version': '9.0.0-next.9',
345
+ 'data-garden-id': COMPONENT_ID$h,
346
+ 'data-garden-version': '9.0.0',
350
347
  'data-test-id': 'preview-box'
351
348
  })).withConfig({
352
349
  displayName: "StyledPreview",
353
350
  componentId: "sc-1z5nh7-0"
354
- })(["flex-shrink:0;border-radius:", ";box-shadow:inset 0 0 0 ", " ", ";width:", "px;height:", "px;", ";"], props => props.theme.borderRadii.md, props => props.theme.borderWidths.sm, props => polished.rgba(props.theme.palette.black, 0.19), props => props.theme.space.base * (props.isOpaque ? 6 : 8), props => props.theme.space.base * (props.isOpaque ? 6 : 8), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$i, props));
355
- StyledPreview.defaultProps = {
356
- theme: reactTheming.DEFAULT_THEME
357
- };
351
+ })(["flex-shrink:0;border-radius:", ";box-shadow:inset 0 0 0 ", " ", ";width:", "px;height:", "px;", ";"], props => props.theme.borderRadii.md, props => props.theme.borderWidths.sm, props => polished.rgba(props.theme.palette.black, 0.19), props => props.theme.space.base * (props.$isOpaque ? 6 : 8), props => props.theme.space.base * (props.$isOpaque ? 6 : 8), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$h, props));
358
352
 
359
- const COMPONENT_ID$h = 'colorpickers.colorpicker_colorwell';
353
+ const COMPONENT_ID$g = 'colorpickers.colorpicker_colorwell';
360
354
  const background$1 = props => {
361
355
  const blackAlpha = polished.rgba(props.theme.palette.black, 0.9);
362
356
  const black = `linear-gradient(0deg, ${props.theme.palette.black}, ${blackAlpha} 1%, transparent 99%)`;
363
357
  const whiteAngle = `${props.theme.rtl ? -90 : 90}deg`;
364
358
  const white = `linear-gradient(${whiteAngle}, ${props.theme.palette.white} 1%, transparent)`;
365
- const colorValue = polished.hsl(props.hue, 1, 0.5);
359
+ const colorValue = polished.hsl(props.$hue, 1, 0.5);
366
360
  const color = `linear-gradient(${colorValue}, ${colorValue})`;
367
361
  return `${black}, ${white}, ${color}`;
368
362
  };
369
363
  const StyledColorWell = styled__default.default.div.attrs(props => ({
370
- 'data-garden-id': COMPONENT_ID$h,
371
- 'data-garden-version': '9.0.0-next.9',
364
+ 'data-garden-id': COMPONENT_ID$g,
365
+ 'data-garden-version': '9.0.0',
372
366
  'data-test-id': 'colorwell',
373
367
  style: {
374
368
  background: background$1(props)
@@ -376,27 +370,35 @@ const StyledColorWell = styled__default.default.div.attrs(props => ({
376
370
  })).withConfig({
377
371
  displayName: "StyledColorWell",
378
372
  componentId: "sc-1gg9z8m-0"
379
- })(["position:relative;margin-bottom:", "px;cursor:pointer;height:208px;overflow:hidden;", ";"], props => props.theme.space.base * 2, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$h, props));
380
- StyledColorWell.defaultProps = {
381
- theme: reactTheming.DEFAULT_THEME
382
- };
373
+ })(["position:relative;margin-bottom:", "px;cursor:pointer;height:208px;overflow:hidden;", ";"], props => props.theme.space.base * 2, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$g, props));
383
374
 
384
- const COMPONENT_ID$g = 'colorpickers.colorpicker_colorwell_thumb';
385
- const sizeStyles$1 = theme => {
375
+ const COMPONENT_ID$f = 'colorpickers.colorpicker_colorwell_thumb';
376
+ const colorStyles$1 = _ref => {
377
+ let {
378
+ theme
379
+ } = _ref;
380
+ const borderColor = reactTheming.getColor({
381
+ theme,
382
+ hue: 'white'
383
+ });
384
+ const boxShadow = `${theme.shadows.xs(reactTheming.getColor({
385
+ theme,
386
+ hue: 'black'
387
+ }))}`;
388
+ return styled.css(["border-color:", ";box-shadow:", ";"], borderColor, boxShadow);
389
+ };
390
+ const sizeStyles$2 = _ref2 => {
391
+ let {
392
+ theme
393
+ } = _ref2;
386
394
  const borderWidth = polished.stripUnit(theme.borderWidths.sm) * 2;
387
395
  const size = theme.space.base * 5;
388
396
  const translateValue = size / -2;
389
- return `
390
- transform: translate(${translateValue}px, ${translateValue}px);
391
- box-sizing: border-box;
392
- border-width: ${borderWidth}px;
393
- width: ${size}px;
394
- height: ${size}px;
395
- `;
397
+ return styled.css(["transform:translate(", "px,", "px);box-sizing:border-box;border-width:", "px;width:", "px;height:", "px;"], translateValue, translateValue, borderWidth, size, size);
396
398
  };
397
399
  const StyledColorWellThumb = styled__default.default.div.attrs(props => ({
398
- 'data-garden-id': COMPONENT_ID$g,
399
- 'data-garden-version': '9.0.0-next.9',
400
+ 'data-garden-id': COMPONENT_ID$f,
401
+ 'data-garden-version': '9.0.0',
400
402
  'data-test-id': 'colorwell-thumb',
401
403
  style: {
402
404
  top: `${props.top}%`,
@@ -405,75 +407,57 @@ const StyledColorWellThumb = styled__default.default.div.attrs(props => ({
405
407
  })).withConfig({
406
408
  displayName: "StyledColorWellThumb",
407
409
  componentId: "sc-1npyab0-0"
408
- })(["position:absolute;border:solid ", ";border-radius:50%;box-shadow:", ";", ";", ";"], props => props.theme.palette.white, props => props.theme.shadows.lg(`${props.theme.space.base}px`, `${props.theme.space.base * 2}px`, reactTheming.getColorV8('neutralHue', 800, props.theme, 0.24)), props => sizeStyles$1(props.theme), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$g, props));
409
- StyledColorWellThumb.defaultProps = {
410
- theme: reactTheming.DEFAULT_THEME
411
- };
410
+ })(["position:absolute;border:", ";border-radius:50%;", " ", " ", ";"], props => props.theme.borders.sm, sizeStyles$2, colorStyles$1, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$f, props));
412
411
 
413
- const COMPONENT_ID$f = 'colorpickers.colorpicker_slider_group';
412
+ const COMPONENT_ID$e = 'colorpickers.colorpicker_slider_group';
414
413
  const StyledSliderGroup = styled__default.default.div.attrs({
415
- 'data-garden-id': COMPONENT_ID$f,
416
- 'data-garden-version': '9.0.0-next.9'
414
+ 'data-garden-id': COMPONENT_ID$e,
415
+ 'data-garden-version': '9.0.0'
417
416
  }).withConfig({
418
417
  displayName: "StyledSliderGroup",
419
418
  componentId: "sc-tigkzg-0"
420
- })(["display:flex;justify-content:space-between;margin-bottom:", "px;", ";"], props => props.theme.space.base * 2, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$f, props));
421
- StyledSliderGroup.defaultProps = {
422
- theme: reactTheming.DEFAULT_THEME
423
- };
419
+ })(["display:flex;justify-content:space-between;margin-bottom:", "px;", ";"], props => props.theme.space.base * 2, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$e, props));
424
420
 
425
- const COMPONENT_ID$e = 'colorpickers.colorpicker_hex_field';
421
+ const COMPONENT_ID$d = 'colorpickers.colorpicker_hex_field';
426
422
  const StyledHexField = styled__default.default(reactForms.Field).attrs({
427
- 'data-garden-id': COMPONENT_ID$e,
428
- 'data-garden-version': '9.0.0-next.9',
423
+ 'data-garden-id': COMPONENT_ID$d,
424
+ 'data-garden-version': '9.0.0',
429
425
  spellcheck: false
430
426
  }).withConfig({
431
427
  displayName: "StyledHexField",
432
428
  componentId: "sc-ijq1c-0"
433
- })(["display:flex;flex-basis:0;flex-direction:column;flex-grow:1;width:auto;text-align:center;input{direction:ltr;}", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$e, props));
434
- StyledHexField.defaultProps = {
435
- theme: reactTheming.DEFAULT_THEME
436
- };
429
+ })(["display:flex;flex-basis:0;flex-direction:column;flex-grow:1;width:auto;text-align:center;input{direction:ltr;}", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$d, props));
437
430
 
438
- const COMPONENT_ID$d = 'colorpickers.colorpicker_label';
431
+ const COMPONENT_ID$c = 'colorpickers.colorpicker_label';
439
432
  const StyledLabel = styled__default.default(reactForms.Label).attrs({
440
- 'data-garden-id': COMPONENT_ID$d,
441
- 'data-garden-version': '9.0.0-next.9'
433
+ 'data-garden-id': COMPONENT_ID$c,
434
+ 'data-garden-version': '9.0.0'
442
435
  }).withConfig({
443
436
  displayName: "StyledLabel",
444
437
  componentId: "sc-1vxt3m9-0"
445
- })(["overflow:hidden;text-overflow:ellipsis;white-space:nowrap;", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$d, props));
446
- StyledLabel.defaultProps = {
447
- theme: reactTheming.DEFAULT_THEME
448
- };
438
+ })(["overflow:hidden;text-overflow:ellipsis;white-space:nowrap;", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$c, props));
449
439
 
450
- const COMPONENT_ID$c = 'colorpickers.colorpicker_input';
440
+ const COMPONENT_ID$b = 'colorpickers.colorpicker_input';
451
441
  const StyledInput = styled__default.default(reactForms.Input).attrs({
452
- 'data-garden-id': COMPONENT_ID$c,
453
- 'data-garden-version': '9.0.0-next.9',
442
+ 'data-garden-id': COMPONENT_ID$b,
443
+ 'data-garden-version': '9.0.0',
454
444
  focusInset: false
455
445
  }).withConfig({
456
446
  displayName: "StyledInput",
457
447
  componentId: "sc-1uzlutt-0"
458
- })(["text-align:center;", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$c, props));
459
- StyledInput.defaultProps = {
460
- theme: reactTheming.DEFAULT_THEME
461
- };
448
+ })(["text-align:center;", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$b, props));
462
449
 
463
- const COMPONENT_ID$b = 'colorpickers.colorpicker_input_group';
450
+ const COMPONENT_ID$a = 'colorpickers.colorpicker_input_group';
464
451
  const StyledInputGroup = styled__default.default.div.attrs({
465
- 'data-garden-id': COMPONENT_ID$b,
466
- 'data-garden-version': '9.0.0-next.9'
452
+ 'data-garden-id': COMPONENT_ID$a,
453
+ 'data-garden-version': '9.0.0'
467
454
  }).withConfig({
468
455
  displayName: "StyledInputGroup",
469
456
  componentId: "sc-1m9g2wg-0"
470
- })(["display:flex;justify-content:space-between;", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$b, props));
471
- StyledInputGroup.defaultProps = {
472
- theme: reactTheming.DEFAULT_THEME
473
- };
457
+ })(["display:flex;justify-content:space-between;", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$a, props));
474
458
 
475
- const COMPONENT_ID$a = 'colorpickers.colorpicker_rgb_field';
476
- const sizeStyles = theme => {
459
+ const COMPONENT_ID$9 = 'colorpickers.colorpicker_rgb_field';
460
+ const sizeStyles$1 = theme => {
477
461
  const margin = `${theme.space.base * 1.5}px`;
478
462
  const width = `${theme.space.base * 12.75}px`;
479
463
  return `
@@ -483,58 +467,70 @@ const sizeStyles = theme => {
483
467
  `;
484
468
  };
485
469
  const StyledRGBAField = styled__default.default(reactForms.Field).attrs({
486
- 'data-garden-id': COMPONENT_ID$a,
487
- 'data-garden-version': '9.0.0-next.9'
470
+ 'data-garden-id': COMPONENT_ID$9,
471
+ 'data-garden-version': '9.0.0'
488
472
  }).withConfig({
489
473
  displayName: "StyledRGBAField",
490
474
  componentId: "sc-13266k8-0"
491
- })(["display:flex;flex-direction:column;text-align:center;", ";", ";"], props => sizeStyles(props.theme), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$a, props));
492
- StyledRGBAField.defaultProps = {
493
- theme: reactTheming.DEFAULT_THEME
494
- };
475
+ })(["display:flex;flex-direction:column;text-align:center;", ";", ";"], props => sizeStyles$1(props.theme), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$9, props));
476
+
477
+ const COMPONENT_ID$8 = 'colorpickers.colorpicker_sliders';
478
+ const sizeStyles = props => {
479
+ if (props.$isOpaque) {
480
+ return undefined;
481
+ }
482
+ const trackHeight = getTrackHeight(props);
483
+ const trackMargin = getTrackMargin(props);
484
+ return `
485
+ & > * {
486
+ position: absolute;
487
+ width: 100%;
488
+ height: ${trackMargin * 2 + trackHeight}px;
489
+ }
495
490
 
496
- const COMPONENT_ID$9 = 'colorpickers.colorpicker_sliders';
491
+ & > :first-child {
492
+ top: -${trackMargin}px;
493
+ }
494
+
495
+ & > :last-child {
496
+ bottom: -${trackMargin}px;
497
+ }
498
+ `;
499
+ };
497
500
  const StyledSliders = styled__default.default.div.attrs({
498
- 'data-garden-id': COMPONENT_ID$9,
499
- 'data-garden-version': '9.0.0-next.9'
501
+ 'data-garden-id': COMPONENT_ID$8,
502
+ 'data-garden-version': '9.0.0'
500
503
  }).withConfig({
501
504
  displayName: "StyledSliders",
502
505
  componentId: "sc-1lgr50m-0"
503
- })(["position:relative;margin-", ":", "px;width:100%;& > *{position:absolute;width:100%;height:", "px;}& > :first-child{top:-", "px;}& > :last-child{bottom:-", "px;}", ";"], props => props.theme.rtl ? 'right' : 'left', props => props.theme.space.base * 2, props => getTrackMargin(props) * 2 + getTrackHeight(props), getTrackMargin, getTrackMargin, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$9, props));
504
- StyledSliders.defaultProps = {
505
- theme: reactTheming.DEFAULT_THEME
506
- };
506
+ })(["position:relative;margin-", ":", "px;width:100%;", " ", ";"], props => props.theme.rtl ? 'right' : 'left', props => props.theme.space.base * 2, sizeStyles, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$8, props));
507
507
 
508
- const COMPONENT_ID$8 = 'colorpickers.colordialog_button';
509
508
  const StyledButton = styled__default.default(reactButtons.Button).attrs({
510
509
  isNeutral: true,
511
- 'data-garden-id': COMPONENT_ID$8,
512
- 'data-garden-version': '9.0.0-next.9'
510
+ 'data-garden-version': '9.0.0'
513
511
  }).withConfig({
514
512
  displayName: "StyledButton",
515
513
  componentId: "sc-1dlijfv-0"
516
- })(["padding:0;width:", "px;max-width:", "px;&:last-of-type:not(:first-child){border-top-", "-radius:", " !important;border-bottom-", "-radius:", " !important;}", ";"], props => props.theme.space.base * 17, props => props.theme.space.base * 17, props => props.theme.rtl ? 'left' : 'right', props => props.theme.borderRadii.md, props => props.theme.rtl ? 'left' : 'right', props => props.theme.borderRadii.md, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$8, props));
517
- StyledButton.defaultProps = {
518
- theme: reactTheming.DEFAULT_THEME
519
- };
514
+ })(["padding:0;width:", "px;max-width:", "px;&:last-of-type:not(:first-child){border-top-", "-radius:", " !important;border-bottom-", "-radius:", " !important;}"], props => props.theme.space.base * 17, props => props.theme.space.base * 17, props => props.theme.rtl ? 'left' : 'right', props => props.theme.borderRadii.md, props => props.theme.rtl ? 'left' : 'right', props => props.theme.borderRadii.md);
520
515
 
521
516
  const COMPONENT_ID$7 = 'colorpickers.colordialog_preview';
522
- const background = props => {
523
- const {
524
- backgroundColor
525
- } = props;
517
+ const background = _ref => {
518
+ let {
519
+ $backgroundColor,
520
+ theme
521
+ } = _ref;
526
522
  let retVal;
527
- if (typeof backgroundColor === 'string') {
528
- retVal = backgroundColor;
529
- } else if (backgroundColor === undefined) {
530
- retVal = props.theme.palette.white;
523
+ if (typeof $backgroundColor === 'string') {
524
+ retVal = $backgroundColor;
525
+ } else if ($backgroundColor === undefined) {
526
+ retVal = theme.palette.white;
531
527
  } else {
532
528
  const {
533
529
  red,
534
530
  green,
535
531
  blue,
536
532
  alpha = 1
537
- } = backgroundColor;
533
+ } = $backgroundColor;
538
534
  retVal = `rgba(${red}, ${green}, ${blue}, ${alpha ? alpha / 100 : 0})`;
539
535
  }
540
536
  return retVal;
@@ -548,72 +544,70 @@ const StyledButtonPreview = styled__default.default.span.attrs(props => ({
548
544
  })
549
545
  },
550
546
  'data-garden-id': COMPONENT_ID$7,
551
- 'data-garden-version': '9.0.0-next.9',
547
+ 'data-garden-version': '9.0.0',
552
548
  'data-test-id': 'dialog-preview'
553
549
  })).withConfig({
554
550
  displayName: "StyledButtonPreview",
555
551
  componentId: "sc-yxis8h-0"
556
552
  })(["display:inline-block;bottom:", "px;border-radius:", ";box-shadow:inset 0 0 0 ", " ", ";width:", "px;height:", "px;", ";"], props => props.theme.space.base, props => props.theme.borderRadii.sm, props => props.theme.borderWidths.sm, props => polished.rgba(props.theme.palette.black, 0.19), props => props.theme.space.base * 5, props => props.theme.space.base * 5, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$7, props));
557
- StyledButtonPreview.defaultProps = {
558
- theme: reactTheming.DEFAULT_THEME
559
- };
560
553
 
561
- const COMPONENT_ID$6 = 'colorpickers.colordialog_tooltipmodal';
562
- const StyledTooltipModal = styled__default.default(reactModals.TooltipModal).attrs({
554
+ const COMPONENT_ID$6 = 'colorpickers.colordialog_tooltipdialog';
555
+ const StyledTooltipDialog = styled__default.default(reactModals.TooltipDialog).attrs({
563
556
  'data-garden-id': COMPONENT_ID$6,
564
- 'data-garden-version': '9.0.0-next.9'
557
+ 'data-garden-version': '9.0.0'
565
558
  }).withConfig({
566
- displayName: "StyledTooltipModal",
567
- componentId: "sc-gykkrw-0"
559
+ displayName: "StyledTooltipDialog",
560
+ componentId: "sc-1vbkccl-0"
568
561
  })(["width:auto !important;", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$6, props));
569
- StyledTooltipModal.defaultProps = {
570
- theme: reactTheming.DEFAULT_THEME
571
- };
572
562
 
573
- const COMPONENT_ID$5 = 'colorpickers.colordialog_tooltipmodal_body';
574
- const StyledTooltipBody = styled__default.default(reactModals.TooltipModal.Body).attrs({
563
+ const COMPONENT_ID$5 = 'colorpickers.colordialog_tooltipdialog_body';
564
+ const StyledTooltipBody = styled__default.default(reactModals.TooltipDialog.Body).attrs({
575
565
  'data-garden-id': COMPONENT_ID$5,
576
- 'data-garden-version': '9.0.0-next.9'
566
+ 'data-garden-version': '9.0.0'
577
567
  }).withConfig({
578
568
  displayName: "StyledTooltipBody",
579
569
  componentId: "sc-1ueddpo-0"
580
570
  })(["padding:0;", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$5, props));
581
- StyledTooltipBody.defaultProps = {
582
- theme: reactTheming.DEFAULT_THEME
583
- };
584
571
 
585
572
  const COMPONENT_ID$4 = 'colorpickers.color_swatch';
586
573
  const StyledColorSwatch = styled__default.default.table.attrs({
587
574
  'data-garden-id': COMPONENT_ID$4,
588
- 'data-garden-version': '9.0.0-next.9'
575
+ 'data-garden-version': '9.0.0'
589
576
  }).withConfig({
590
577
  displayName: "StyledColorSwatch",
591
578
  componentId: "sc-ajx440-0"
592
579
  })(["border-collapse:collapse;line-height:normal;", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$4, props));
593
- StyledColorSwatch.defaultProps = {
594
- theme: reactTheming.DEFAULT_THEME
595
- };
596
580
 
597
581
  const COMPONENT_ID$3 = 'colorpickers.color_swatch_input';
598
582
  const StyledColorSwatchInput = styled__default.default.input.attrs({
599
583
  'data-garden-id': COMPONENT_ID$3,
600
- 'data-garden-version': '9.0.0-next.9'
584
+ 'data-garden-version': '9.0.0'
601
585
  }).withConfig({
602
586
  displayName: "StyledColorSwatchInput",
603
587
  componentId: "sc-em45h0-0"
604
588
  })(["position:absolute;opacity:0;z-index:1;margin:0;cursor:pointer;width:100%;height:100%;", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$3, props));
605
- StyledColorSwatchInput.defaultProps = {
606
- theme: reactTheming.DEFAULT_THEME
607
- };
608
589
 
609
590
  const COMPONENT_ID$2 = 'colorpickers.color_swatch_label';
610
- const colorStyles = props => {
591
+ const colorStyles = _ref => {
592
+ let {
593
+ $backgroundColor,
594
+ theme
595
+ } = _ref;
611
596
  const {
612
597
  alpha
613
- } = polished.parseToRgb(props.backgroundColor);
614
- let foregroundColor = reactTheming.getColorV8('foreground', 600 , props.theme);
598
+ } = polished.parseToRgb($backgroundColor);
599
+ const returnIfLightColor = reactTheming.getColor({
600
+ theme,
601
+ hue: 'neutralHue',
602
+ shade: 900
603
+ });
604
+ let foregroundColor = returnIfLightColor;
615
605
  if (alpha === undefined || alpha >= 0.4) {
616
- foregroundColor = polished.readableColor(props.backgroundColor, foregroundColor, reactTheming.getColorV8('background', 600 , props.theme), false );
606
+ const returnIfDarkColor = reactTheming.getColor({
607
+ theme,
608
+ hue: 'white'
609
+ });
610
+ foregroundColor = polished.readableColor($backgroundColor, returnIfLightColor, returnIfDarkColor, false );
617
611
  }
618
612
  return `
619
613
  color: ${foregroundColor};
@@ -622,7 +616,7 @@ const colorStyles = props => {
622
616
  const StyledColorSwatchLabel = styled__default.default(StyledButtonPreview).attrs({
623
617
  as: 'label',
624
618
  'data-garden-id': COMPONENT_ID$2,
625
- 'data-garden-version': '9.0.0-next.9'
619
+ 'data-garden-version': '9.0.0'
626
620
  }).withConfig({
627
621
  displayName: "StyledColorSwatchLabel",
628
622
  componentId: "sc-1aghocg-0"
@@ -630,12 +624,9 @@ const StyledColorSwatchLabel = styled__default.default(StyledButtonPreview).attr
630
624
  theme: props.theme,
631
625
  selector: '&:has(:focus-visible)'
632
626
  }), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$2, props));
633
- StyledColorSwatchLabel.defaultProps = {
634
- theme: reactTheming.DEFAULT_THEME
635
- };
636
627
 
637
628
  var _path$1;
638
- function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
629
+ function _extends$1() { return _extends$1 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$1.apply(null, arguments); }
639
630
  var SvgCheckSmFill = function SvgCheckSmFill(props) {
640
631
  return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
641
632
  xmlns: "http://www.w3.org/2000/svg",
@@ -657,26 +648,20 @@ var SvgCheckSmFill = function SvgCheckSmFill(props) {
657
648
  const COMPONENT_ID$1 = 'colorpickers.colorswatch_check';
658
649
  const StyledIcon = styled__default.default(SvgCheckSmFill).attrs({
659
650
  'data-garden-id': COMPONENT_ID$1,
660
- 'data-garden-version': '9.0.0-next.9'
651
+ 'data-garden-version': '9.0.0'
661
652
  }).withConfig({
662
653
  displayName: "StyledIcon",
663
654
  componentId: "sc-8oigif-0"
664
655
  })(["position:absolute;top:0;left:0;transition:opacity 0.2s ease-in-out;opacity:0;width:100%;height:100%;", ":checked ~ &{opacity:1;}", ";"], StyledColorSwatchInput, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$1, props));
665
- StyledIcon.defaultProps = {
666
- theme: reactTheming.DEFAULT_THEME
667
- };
668
656
 
669
657
  const COMPONENT_ID = 'colorpickers.swatch_cell';
670
658
  const StyledCell = styled__default.default.td.attrs({
671
659
  'data-garden-id': COMPONENT_ID,
672
- 'data-garden-version': '9.0.0-next.9'
660
+ 'data-garden-version': '9.0.0'
673
661
  }).withConfig({
674
662
  displayName: "StyledCell",
675
663
  componentId: "sc-qr3oit-0"
676
664
  })(["padding:", "px;font-size:0;", ";"], props => props.theme.space.base, props => reactTheming.retrieveComponentStyles(COMPONENT_ID, props));
677
- StyledCell.defaultProps = {
678
- theme: reactTheming.DEFAULT_THEME
679
- };
680
665
 
681
666
  const ColorWell = React__namespace.default.memo(_ref => {
682
667
  let {
@@ -739,17 +724,15 @@ const ColorWell = React__namespace.default.memo(_ref => {
739
724
  throttledChange.cancel();
740
725
  };
741
726
  }, [throttledChange]);
742
- return (
743
- React__namespace.default.createElement(StyledColorWell, {
744
- hue: hue,
745
- ref: containerRef,
746
- role: "presentation",
747
- onMouseDown: handleMouseDown
748
- }, React__namespace.default.createElement(StyledColorWellThumb, {
749
- top: mouseActiveRef.current ? topFromMouse : topPosition,
750
- left: mouseActiveRef.current ? leftFromMouse : leftPosition
751
- }))
752
- );
727
+ return React__namespace.default.createElement(StyledColorWell, {
728
+ $hue: hue,
729
+ ref: containerRef,
730
+ role: "presentation",
731
+ onMouseDown: handleMouseDown
732
+ }, React__namespace.default.createElement(StyledColorWellThumb, {
733
+ top: mouseActiveRef.current ? topFromMouse : topPosition,
734
+ left: mouseActiveRef.current ? leftFromMouse : leftPosition
735
+ }));
753
736
  });
754
737
  ColorWell.displayName = 'ColorWell';
755
738
 
@@ -1123,27 +1106,27 @@ const ColorPicker = React.forwardRef((_ref, ref) => {
1123
1106
  }, [computedColor]);
1124
1107
  return React__namespace.default.createElement(StyledColorPicker, Object.assign({
1125
1108
  ref: ref,
1126
- isOpaque: isOpaque
1109
+ $isOpaque: isOpaque
1127
1110
  }, props), React__namespace.default.createElement(ColorWell, {
1128
1111
  hue: computedColor.hue,
1129
1112
  saturation: computedColor.saturation,
1130
1113
  lightness: computedColor.lightness,
1131
1114
  onChange: handleColorWellChange
1132
1115
  }), React__namespace.default.createElement(StyledSliderGroup, null, React__namespace.default.createElement(StyledPreview, {
1133
- red: computedColor.red,
1134
- green: computedColor.green,
1135
- blue: computedColor.blue,
1136
- alpha: computedColor.alpha,
1137
- isOpaque: isOpaque
1116
+ $red: computedColor.red,
1117
+ $green: computedColor.green,
1118
+ $blue: computedColor.blue,
1119
+ $alpha: computedColor.alpha,
1120
+ $isOpaque: isOpaque
1138
1121
  }), React__namespace.default.createElement(StyledSliders, {
1139
- isOpaque: isOpaque
1122
+ $isOpaque: isOpaque
1140
1123
  }, React__namespace.default.createElement(reactForms.Field, null, React__namespace.default.createElement(reactForms.Field.Label, {
1141
1124
  hidden: true
1142
1125
  }, labels.hueSlider || 'Hue slider'), React__namespace.default.createElement(StyledHueRange, {
1143
1126
  step: 1,
1144
1127
  max: 360,
1145
1128
  value: computedColor.hue,
1146
- isOpaque: isOpaque,
1129
+ $isOpaque: isOpaque,
1147
1130
  onChange: handleHueChange
1148
1131
  })), !isOpaque && React__namespace.default.createElement(reactForms.Field, null, React__namespace.default.createElement(reactForms.Field.Label, {
1149
1132
  hidden: true
@@ -1152,9 +1135,9 @@ const ColorPicker = React.forwardRef((_ref, ref) => {
1152
1135
  step: 0.01,
1153
1136
  value: computedColor.alpha / 100,
1154
1137
  onChange: handleAlphaSliderChange,
1155
- red: computedColor.red,
1156
- green: computedColor.green,
1157
- blue: computedColor.blue
1138
+ $red: computedColor.red,
1139
+ $green: computedColor.green,
1140
+ $blue: computedColor.blue
1158
1141
  })))), React__namespace.default.createElement(StyledInputGroup, null, React__namespace.default.createElement(StyledHexField, null, React__namespace.default.createElement(StyledLabel, {
1159
1142
  isRegular: true
1160
1143
  }, labels.hex || 'Hex'), React__namespace.default.createElement(StyledInput, {
@@ -1224,7 +1207,7 @@ ColorPicker.propTypes = {
1224
1207
  };
1225
1208
 
1226
1209
  var _path;
1227
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1210
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
1228
1211
  var SvgChevronDownStroke = function SvgChevronDownStroke(props) {
1229
1212
  return /*#__PURE__*/React__namespace.createElement("svg", _extends({
1230
1213
  xmlns: "http://www.w3.org/2000/svg",
@@ -1269,6 +1252,7 @@ const ColorPickerDialog = React.forwardRef((_ref, ref) => {
1269
1252
  const ariaLabelText = reactTheming.useText(ColorPickerDialog, {
1270
1253
  'aria-label': ariaLabel
1271
1254
  }, 'aria-label', 'Color picker');
1255
+ const theme = styled.useTheme() || reactTheming.DEFAULT_THEME;
1272
1256
  const openDialog = () => {
1273
1257
  setReferenceElement(buttonRef.current);
1274
1258
  onDialogChange && onDialogChange({
@@ -1306,17 +1290,17 @@ const ColorPickerDialog = React.forwardRef((_ref, ref) => {
1306
1290
  ref: buttonRef,
1307
1291
  onClick: onClick
1308
1292
  }, buttonProps), React__namespace.default.createElement(StyledButtonPreview, {
1309
- backgroundColor: isControlled ? color : uncontrolledColor
1293
+ $backgroundColor: isControlled ? color : uncontrolledColor
1310
1294
  }), React__namespace.default.createElement(reactButtons.Button.EndIcon, {
1311
1295
  isRotated: referenceElement != null
1312
- }, React__namespace.default.createElement(SvgChevronDownStroke, null))), React__namespace.default.createElement(StyledTooltipModal, Object.assign({
1296
+ }, React__namespace.default.createElement(SvgChevronDownStroke, null))), React__namespace.default.createElement(StyledTooltipDialog, Object.assign({
1313
1297
  ref: ref,
1314
1298
  hasArrow: hasArrow,
1315
1299
  zIndex: zIndex,
1316
1300
  isAnimated: isAnimated,
1317
- isOpaque: isOpaque,
1318
1301
  focusOnMount: false,
1319
1302
  placement: placement,
1303
+ offset: theme.space.base,
1320
1304
  referenceElement: referenceElement,
1321
1305
  onClose: () => {
1322
1306
  closeDialog();
@@ -1390,69 +1374,72 @@ const ColorSwatch = React.forwardRef((_ref, ref) => {
1390
1374
  setColIndex(col);
1391
1375
  }
1392
1376
  });
1393
- return React__namespace.default.createElement(StyledColorSwatch, Object.assign({
1394
- role: "grid",
1395
- ref: reactMergeRefs.mergeRefs([gridRef, ref])
1396
- }, props), React__namespace.default.createElement("tbody", null, colors.map((row, _rowIndex) => React__namespace.default.createElement("tr", {
1397
- key: row[0].value
1398
- }, row.map((color, _colIndex) => {
1399
- const {
1400
- label,
1401
- value
1402
- } = color;
1403
- const {
1404
- role,
1405
- ...gridCellProps
1406
- } = getGridCellProps({
1407
- colIndex: _colIndex,
1408
- rowIndex: _rowIndex
1409
- });
1410
- const checked = isControlled ? selectedRowIndex === _rowIndex && selectedColIndex === _colIndex : undefined;
1411
- const defaultChecked = isControlled ? undefined : defaultSelectedRowIndex === _rowIndex && defaultSelectedColIndex === _colIndex;
1412
- const handleChange = event => {
1413
- if (onSelect) {
1414
- if (event.target.checked) {
1415
- onSelect(_rowIndex, _colIndex);
1416
- } else {
1417
- onSelect(null, null);
1418
- }
1419
- }
1420
- if (isCheckboxGroup && event.target.checked) {
1421
- const inputs = gridRef.current?.querySelectorAll('input');
1422
- inputs?.forEach(input => {
1423
- if (input !== event.target) {
1424
- input.checked = false;
1377
+ return (
1378
+ React__namespace.default.createElement(StyledColorSwatch, Object.assign({
1379
+ role: "grid",
1380
+ ref: reactMergeRefs.mergeRefs([gridRef, ref])
1381
+ }, props), React__namespace.default.createElement("tbody", null, colors.map((row, _rowIndex) => React__namespace.default.createElement("tr", {
1382
+ key: row[0].value
1383
+ }, row.map((color, _colIndex) => {
1384
+ const {
1385
+ label,
1386
+ value
1387
+ } = color;
1388
+ const {
1389
+ role,
1390
+ ...gridCellProps
1391
+ } = getGridCellProps({
1392
+ colIndex: _colIndex,
1393
+ rowIndex: _rowIndex
1394
+ });
1395
+ const checked = isControlled ? selectedRowIndex === _rowIndex && selectedColIndex === _colIndex : undefined;
1396
+ const defaultChecked = isControlled ? undefined : defaultSelectedRowIndex === _rowIndex && defaultSelectedColIndex === _colIndex;
1397
+ const handleChange = event => {
1398
+ if (onSelect) {
1399
+ if (event.target.checked) {
1400
+ onSelect(_rowIndex, _colIndex);
1401
+ } else {
1402
+ onSelect(null, null);
1425
1403
  }
1426
- });
1427
- }
1428
- };
1429
- const handleBlur = event => {
1430
- if (!(isCheckboxGroup || gridRef.current?.contains(event.relatedTarget))) {
1431
- const selectedInput = gridRef.current?.querySelector(`input[name='${event.target.name}']:checked`);
1432
- if (selectedInput !== null) {
1404
+ }
1405
+ if (isCheckboxGroup && event.target.checked) {
1433
1406
  const inputs = gridRef.current?.querySelectorAll('input');
1434
- inputs?.forEach(input => input.setAttribute('tabIndex', input.checked ? '0' : '-1'));
1407
+ inputs?.forEach(input => {
1408
+ if (input !== event.target) {
1409
+ input.checked = false;
1410
+ }
1411
+ });
1435
1412
  }
1436
- }
1437
- };
1438
- return React__namespace.default.createElement(StyledCell, {
1439
- key: value,
1440
- role: role
1441
- }, React__namespace.default.createElement(StyledColorSwatchLabel, {
1442
- backgroundColor: value
1443
- }, React__namespace.default.createElement(reactTooltips.Tooltip, {
1444
- content: label
1445
- }, React__namespace.default.createElement(StyledColorSwatchInput, Object.assign({
1446
- "aria-label": label,
1447
- name: name,
1448
- type: isCheckboxGroup ? 'checkbox' : 'radio',
1449
- value: value,
1450
- defaultChecked: defaultChecked,
1451
- checked: checked,
1452
- onBlur: handleBlur,
1453
- onChange: handleChange
1454
- }, gridCellProps))), React__namespace.default.createElement(StyledIcon, null)));
1455
- })))));
1413
+ };
1414
+ const handleBlur = event => {
1415
+ if (!(isCheckboxGroup || gridRef.current?.contains(event.relatedTarget))) {
1416
+ const selectedInput = gridRef.current?.querySelector(`input[name='${event.target.name}']:checked`);
1417
+ if (selectedInput !== null) {
1418
+ const inputs = gridRef.current?.querySelectorAll('input');
1419
+ inputs?.forEach(input => input.setAttribute('tabIndex', input.checked ? '0' : '-1'));
1420
+ }
1421
+ }
1422
+ };
1423
+ return React__namespace.default.createElement(StyledCell, {
1424
+ key: value,
1425
+ role: role
1426
+ }, React__namespace.default.createElement(StyledColorSwatchLabel, {
1427
+ $backgroundColor: value
1428
+ }, React__namespace.default.createElement(reactTooltips.Tooltip, {
1429
+ content: label,
1430
+ zIndex: 1
1431
+ }, React__namespace.default.createElement(StyledColorSwatchInput, Object.assign({
1432
+ "aria-label": label,
1433
+ name: name,
1434
+ type: isCheckboxGroup ? 'checkbox' : 'radio',
1435
+ value: value,
1436
+ defaultChecked: defaultChecked,
1437
+ checked: checked,
1438
+ onBlur: handleBlur,
1439
+ onChange: handleChange
1440
+ }, gridCellProps))), React__namespace.default.createElement(StyledIcon, null)));
1441
+ })))))
1442
+ );
1456
1443
  });
1457
1444
  ColorSwatch.displayName = 'ColorSwatch';
1458
1445
  ColorSwatch.propTypes = {
@@ -1496,6 +1483,7 @@ const ColorSwatchDialog = React.forwardRef((_ref, ref) => {
1496
1483
  const [referenceElement, setReferenceElement] = React.useState(null);
1497
1484
  const [rowIndex, setRowIndex] = React.useState(defaultSelectedRowIndex);
1498
1485
  const [colIndex, setColIndex] = React.useState(defaultSelectedColIndex);
1486
+ const theme = styled.useTheme() || reactTheming.DEFAULT_THEME;
1499
1487
  let backgroundColor;
1500
1488
  if (isControlled) {
1501
1489
  if (selectedRowIndex !== null && selectedColIndex !== null) {
@@ -1562,15 +1550,16 @@ const ColorSwatchDialog = React.forwardRef((_ref, ref) => {
1562
1550
  ref: buttonRef,
1563
1551
  onClick: onClick
1564
1552
  }, buttonProps), React__namespace.default.createElement(StyledButtonPreview, {
1565
- backgroundColor: backgroundColor
1553
+ $backgroundColor: backgroundColor
1566
1554
  }), React__namespace.default.createElement(reactButtons.Button.EndIcon, {
1567
1555
  isRotated: referenceElement !== null
1568
- }, React__namespace.default.createElement(SvgChevronDownStroke, null))), React__namespace.default.createElement(StyledTooltipModal, Object.assign({
1556
+ }, React__namespace.default.createElement(SvgChevronDownStroke, null))), React__namespace.default.createElement(StyledTooltipDialog, Object.assign({
1569
1557
  ref: ref,
1570
1558
  zIndex: zIndex,
1571
1559
  hasArrow: hasArrow,
1572
1560
  focusOnMount: false,
1573
1561
  placement: placement,
1562
+ offset: theme.space.base,
1574
1563
  isAnimated: isAnimated,
1575
1564
  referenceElement: referenceElement,
1576
1565
  onClose: closeDialog,