@zendeskgarden/react-colorpickers 8.62.0 → 8.62.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/dist/index.cjs.js +143 -136
- package/dist/index.esm.js +35 -25
- package/package.json +7 -7
package/dist/index.cjs.js
CHANGED
|
@@ -7,8 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
-
|
|
12
10
|
var React = require('react');
|
|
13
11
|
var PropTypes = require('prop-types');
|
|
14
12
|
var reactForms = require('@zendeskgarden/react-forms');
|
|
@@ -23,7 +21,7 @@ var containerUtilities = require('@zendeskgarden/container-utilities');
|
|
|
23
21
|
var reactTooltips = require('@zendeskgarden/react-tooltips');
|
|
24
22
|
var containerGrid = require('@zendeskgarden/container-grid');
|
|
25
23
|
|
|
26
|
-
function
|
|
24
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
27
25
|
|
|
28
26
|
function _interopNamespace(e) {
|
|
29
27
|
if (e && e.__esModule) return e;
|
|
@@ -39,16 +37,15 @@ function _interopNamespace(e) {
|
|
|
39
37
|
}
|
|
40
38
|
});
|
|
41
39
|
}
|
|
42
|
-
n
|
|
40
|
+
n.default = e;
|
|
43
41
|
return Object.freeze(n);
|
|
44
42
|
}
|
|
45
43
|
|
|
46
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
47
44
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
48
|
-
var PropTypes__default = /*#__PURE__*/
|
|
49
|
-
var throttle__default = /*#__PURE__*/
|
|
50
|
-
var styled__default = /*#__PURE__*/
|
|
51
|
-
var isEqual__default = /*#__PURE__*/
|
|
45
|
+
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
46
|
+
var throttle__default = /*#__PURE__*/_interopDefault(throttle);
|
|
47
|
+
var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
48
|
+
var isEqual__default = /*#__PURE__*/_interopDefault(isEqual);
|
|
52
49
|
|
|
53
50
|
function _extends$2() {
|
|
54
51
|
_extends$2 = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -153,9 +150,9 @@ const COMPONENT_ID$l = 'colorpickers.colorpicker';
|
|
|
153
150
|
const getColorPickerWidth = props => {
|
|
154
151
|
return props.isOpaque ? 268 : 312;
|
|
155
152
|
};
|
|
156
|
-
const StyledColorPicker = styled__default
|
|
153
|
+
const StyledColorPicker = styled__default.default.div.attrs({
|
|
157
154
|
'data-garden-id': COMPONENT_ID$l,
|
|
158
|
-
'data-garden-version': '8.62.
|
|
155
|
+
'data-garden-version': '8.62.2'
|
|
159
156
|
}).withConfig({
|
|
160
157
|
displayName: "StyledColorPicker",
|
|
161
158
|
componentId: "sc-1donyl9-0"
|
|
@@ -288,9 +285,9 @@ const sizeStyles$2 = props => {
|
|
|
288
285
|
`)};
|
|
289
286
|
`;
|
|
290
287
|
};
|
|
291
|
-
const StyledRange = styled__default
|
|
288
|
+
const StyledRange = styled__default.default(reactForms.Range).attrs({
|
|
292
289
|
'data-garden-id': COMPONENT_ID$k,
|
|
293
|
-
'data-garden-version': '8.62.
|
|
290
|
+
'data-garden-version': '8.62.2',
|
|
294
291
|
hasLowerTrack: false
|
|
295
292
|
}).withConfig({
|
|
296
293
|
displayName: "StyledRange",
|
|
@@ -303,9 +300,9 @@ StyledRange.defaultProps = {
|
|
|
303
300
|
};
|
|
304
301
|
|
|
305
302
|
const COMPONENT_ID$j = 'colorpickers.colorpicker_hue';
|
|
306
|
-
const StyledHueRange = styled__default
|
|
303
|
+
const StyledHueRange = styled__default.default(StyledRange).attrs({
|
|
307
304
|
'data-garden-id': COMPONENT_ID$j,
|
|
308
|
-
'data-garden-version': '8.62.
|
|
305
|
+
'data-garden-version': '8.62.2'
|
|
309
306
|
}).withConfig({
|
|
310
307
|
displayName: "StyledHueRange",
|
|
311
308
|
componentId: "sc-13ly7p-0"
|
|
@@ -343,13 +340,13 @@ const background$3 = props => {
|
|
|
343
340
|
const gradientBackground = `linear-gradient(${direction}, ${fromColor}, ${toColor}) 0 ${positionY}px / 100% ${height}px no-repeat`;
|
|
344
341
|
return `${gradientBackground}, ${checkeredBackground(props.theme, height, positionY, 'repeat-x')}`;
|
|
345
342
|
};
|
|
346
|
-
const StyledAlphaRange = styled__default
|
|
343
|
+
const StyledAlphaRange = styled__default.default(StyledRange).attrs(props => ({
|
|
347
344
|
style: {
|
|
348
345
|
backgroundSize: 'auto',
|
|
349
346
|
background: background$3(props)
|
|
350
347
|
},
|
|
351
348
|
'data-garden-id': COMPONENT_ID$i,
|
|
352
|
-
'data-garden-version': '8.62.
|
|
349
|
+
'data-garden-version': '8.62.2'
|
|
353
350
|
})).withConfig({
|
|
354
351
|
displayName: "StyledAlphaRange",
|
|
355
352
|
componentId: "sc-kuh2xc-0"
|
|
@@ -368,12 +365,12 @@ const background$2 = props => {
|
|
|
368
365
|
}
|
|
369
366
|
return retVal;
|
|
370
367
|
};
|
|
371
|
-
const StyledPreview = styled__default
|
|
368
|
+
const StyledPreview = styled__default.default.div.attrs(props => ({
|
|
372
369
|
style: {
|
|
373
370
|
background: background$2(props)
|
|
374
371
|
},
|
|
375
372
|
'data-garden-id': COMPONENT_ID$h,
|
|
376
|
-
'data-garden-version': '8.62.
|
|
373
|
+
'data-garden-version': '8.62.2',
|
|
377
374
|
'data-test-id': 'preview-box'
|
|
378
375
|
})).withConfig({
|
|
379
376
|
displayName: "StyledPreview",
|
|
@@ -393,9 +390,9 @@ const background$1 = props => {
|
|
|
393
390
|
const color = `linear-gradient(${colorValue}, ${colorValue})`;
|
|
394
391
|
return `${black}, ${white}, ${color}`;
|
|
395
392
|
};
|
|
396
|
-
const StyledColorWell = styled__default
|
|
393
|
+
const StyledColorWell = styled__default.default.div.attrs(props => ({
|
|
397
394
|
'data-garden-id': COMPONENT_ID$g,
|
|
398
|
-
'data-garden-version': '8.62.
|
|
395
|
+
'data-garden-version': '8.62.2',
|
|
399
396
|
'data-test-id': 'colorwell',
|
|
400
397
|
style: {
|
|
401
398
|
background: background$1(props)
|
|
@@ -421,9 +418,9 @@ const sizeStyles$1 = theme => {
|
|
|
421
418
|
height: ${size}px;
|
|
422
419
|
`;
|
|
423
420
|
};
|
|
424
|
-
const StyledColorWellThumb = styled__default
|
|
421
|
+
const StyledColorWellThumb = styled__default.default.div.attrs(props => ({
|
|
425
422
|
'data-garden-id': COMPONENT_ID$f,
|
|
426
|
-
'data-garden-version': '8.62.
|
|
423
|
+
'data-garden-version': '8.62.2',
|
|
427
424
|
'data-test-id': 'colorwell-thumb',
|
|
428
425
|
style: {
|
|
429
426
|
top: `${props.top}%`,
|
|
@@ -438,9 +435,9 @@ StyledColorWellThumb.defaultProps = {
|
|
|
438
435
|
};
|
|
439
436
|
|
|
440
437
|
const COMPONENT_ID$e = 'colorpickers.colorpicker_slider_group';
|
|
441
|
-
const StyledSliderGroup = styled__default
|
|
438
|
+
const StyledSliderGroup = styled__default.default.div.attrs({
|
|
442
439
|
'data-garden-id': COMPONENT_ID$e,
|
|
443
|
-
'data-garden-version': '8.62.
|
|
440
|
+
'data-garden-version': '8.62.2'
|
|
444
441
|
}).withConfig({
|
|
445
442
|
displayName: "StyledSliderGroup",
|
|
446
443
|
componentId: "sc-rsq0ak-0"
|
|
@@ -450,9 +447,9 @@ StyledSliderGroup.defaultProps = {
|
|
|
450
447
|
};
|
|
451
448
|
|
|
452
449
|
const COMPONENT_ID$d = 'colorpickers.colorpicker_hex_field';
|
|
453
|
-
const StyledHexField = styled__default
|
|
450
|
+
const StyledHexField = styled__default.default(reactForms.Field).attrs({
|
|
454
451
|
'data-garden-id': COMPONENT_ID$d,
|
|
455
|
-
'data-garden-version': '8.62.
|
|
452
|
+
'data-garden-version': '8.62.2',
|
|
456
453
|
spellcheck: false
|
|
457
454
|
}).withConfig({
|
|
458
455
|
displayName: "StyledHexField",
|
|
@@ -463,9 +460,9 @@ StyledHexField.defaultProps = {
|
|
|
463
460
|
};
|
|
464
461
|
|
|
465
462
|
const COMPONENT_ID$c = 'colorpickers.colorpicker_label';
|
|
466
|
-
const StyledLabel = styled__default
|
|
463
|
+
const StyledLabel = styled__default.default(reactForms.Label).attrs({
|
|
467
464
|
'data-garden-id': COMPONENT_ID$c,
|
|
468
|
-
'data-garden-version': '8.62.
|
|
465
|
+
'data-garden-version': '8.62.2'
|
|
469
466
|
}).withConfig({
|
|
470
467
|
displayName: "StyledLabel",
|
|
471
468
|
componentId: "sc-1klhp6m-0"
|
|
@@ -475,9 +472,9 @@ StyledLabel.defaultProps = {
|
|
|
475
472
|
};
|
|
476
473
|
|
|
477
474
|
const COMPONENT_ID$b = 'colorpickers.colorpicker_input';
|
|
478
|
-
const StyledInput = styled__default
|
|
475
|
+
const StyledInput = styled__default.default(reactForms.Input).attrs({
|
|
479
476
|
'data-garden-id': COMPONENT_ID$b,
|
|
480
|
-
'data-garden-version': '8.62.
|
|
477
|
+
'data-garden-version': '8.62.2',
|
|
481
478
|
focusInset: false
|
|
482
479
|
}).withConfig({
|
|
483
480
|
displayName: "StyledInput",
|
|
@@ -488,9 +485,9 @@ StyledInput.defaultProps = {
|
|
|
488
485
|
};
|
|
489
486
|
|
|
490
487
|
const COMPONENT_ID$a = 'colorpickers.colorpicker_input_group';
|
|
491
|
-
const StyledInputGroup = styled__default
|
|
488
|
+
const StyledInputGroup = styled__default.default.div.attrs({
|
|
492
489
|
'data-garden-id': COMPONENT_ID$a,
|
|
493
|
-
'data-garden-version': '8.62.
|
|
490
|
+
'data-garden-version': '8.62.2'
|
|
494
491
|
}).withConfig({
|
|
495
492
|
displayName: "StyledInputGroup",
|
|
496
493
|
componentId: "sc-mmy93w-0"
|
|
@@ -509,9 +506,9 @@ const sizeStyles = theme => {
|
|
|
509
506
|
min-width: ${width};
|
|
510
507
|
`;
|
|
511
508
|
};
|
|
512
|
-
const StyledRGBAField = styled__default
|
|
509
|
+
const StyledRGBAField = styled__default.default(reactForms.Field).attrs({
|
|
513
510
|
'data-garden-id': COMPONENT_ID$9,
|
|
514
|
-
'data-garden-version': '8.62.
|
|
511
|
+
'data-garden-version': '8.62.2'
|
|
515
512
|
}).withConfig({
|
|
516
513
|
displayName: "StyledRGBAField",
|
|
517
514
|
componentId: "sc-ibo1yw-0"
|
|
@@ -521,9 +518,9 @@ StyledRGBAField.defaultProps = {
|
|
|
521
518
|
};
|
|
522
519
|
|
|
523
520
|
const COMPONENT_ID$8 = 'colorpickers.colorpicker_sliders';
|
|
524
|
-
const StyledSliders = styled__default
|
|
521
|
+
const StyledSliders = styled__default.default.div.attrs({
|
|
525
522
|
'data-garden-id': COMPONENT_ID$8,
|
|
526
|
-
'data-garden-version': '8.62.
|
|
523
|
+
'data-garden-version': '8.62.2'
|
|
527
524
|
}).withConfig({
|
|
528
525
|
displayName: "StyledSliders",
|
|
529
526
|
componentId: "sc-aclca2-0"
|
|
@@ -533,10 +530,10 @@ StyledSliders.defaultProps = {
|
|
|
533
530
|
};
|
|
534
531
|
|
|
535
532
|
const COMPONENT_ID$7 = 'colorpickers.colordialog_button';
|
|
536
|
-
const StyledButton = styled__default
|
|
533
|
+
const StyledButton = styled__default.default(reactButtons.Button).attrs({
|
|
537
534
|
isNeutral: true,
|
|
538
535
|
'data-garden-id': COMPONENT_ID$7,
|
|
539
|
-
'data-garden-version': '8.62.
|
|
536
|
+
'data-garden-version': '8.62.2'
|
|
540
537
|
}).withConfig({
|
|
541
538
|
displayName: "StyledButton",
|
|
542
539
|
componentId: "sc-101xjve-0"
|
|
@@ -566,12 +563,12 @@ const background = props => {
|
|
|
566
563
|
}
|
|
567
564
|
return `linear-gradient(${color}, ${color})`;
|
|
568
565
|
};
|
|
569
|
-
const StyledButtonPreview = styled__default
|
|
566
|
+
const StyledButtonPreview = styled__default.default.span.attrs(props => ({
|
|
570
567
|
style: {
|
|
571
568
|
background: `${background(props)}, ${checkeredBackground(props.theme, 8)}`
|
|
572
569
|
},
|
|
573
570
|
'data-garden-id': COMPONENT_ID$6,
|
|
574
|
-
'data-garden-version': '8.62.
|
|
571
|
+
'data-garden-version': '8.62.2',
|
|
575
572
|
'data-test-id': 'dialog-preview'
|
|
576
573
|
})).withConfig({
|
|
577
574
|
displayName: "StyledButtonPreview",
|
|
@@ -582,9 +579,9 @@ StyledButtonPreview.defaultProps = {
|
|
|
582
579
|
};
|
|
583
580
|
|
|
584
581
|
const COMPONENT_ID$5 = 'colorpickers.colordialog_tooltipmodal';
|
|
585
|
-
const StyledTooltipModal = styled__default
|
|
582
|
+
const StyledTooltipModal = styled__default.default(reactModals.TooltipModal).attrs({
|
|
586
583
|
'data-garden-id': COMPONENT_ID$5,
|
|
587
|
-
'data-garden-version': '8.62.
|
|
584
|
+
'data-garden-version': '8.62.2'
|
|
588
585
|
}).withConfig({
|
|
589
586
|
displayName: "StyledTooltipModal",
|
|
590
587
|
componentId: "sc-o022s8-0"
|
|
@@ -594,9 +591,9 @@ StyledTooltipModal.defaultProps = {
|
|
|
594
591
|
};
|
|
595
592
|
|
|
596
593
|
const COMPONENT_ID$4 = 'colorpickers.colordialog_tooltipmodal_body';
|
|
597
|
-
const StyledTooltipBody = styled__default
|
|
594
|
+
const StyledTooltipBody = styled__default.default(reactModals.TooltipModal.Body).attrs({
|
|
598
595
|
'data-garden-id': COMPONENT_ID$4,
|
|
599
|
-
'data-garden-version': '8.62.
|
|
596
|
+
'data-garden-version': '8.62.2'
|
|
600
597
|
}).withConfig({
|
|
601
598
|
displayName: "StyledTooltipBody",
|
|
602
599
|
componentId: "sc-6gsgsy-0"
|
|
@@ -606,11 +603,11 @@ StyledTooltipBody.defaultProps = {
|
|
|
606
603
|
};
|
|
607
604
|
|
|
608
605
|
const COMPONENT_ID$3 = 'colorpickers.swatch_button';
|
|
609
|
-
const StyledSwatchButton = styled__default
|
|
606
|
+
const StyledSwatchButton = styled__default.default(StyledButtonPreview).attrs(props => ({
|
|
610
607
|
as: 'button',
|
|
611
608
|
'data-garden-id': COMPONENT_ID$3,
|
|
612
609
|
'data-test-id': props.backgroundColor,
|
|
613
|
-
'data-garden-version': '8.62.
|
|
610
|
+
'data-garden-version': '8.62.2'
|
|
614
611
|
})).withConfig({
|
|
615
612
|
displayName: "StyledSwatchButton",
|
|
616
613
|
componentId: "sc-edpwpp-0"
|
|
@@ -620,9 +617,9 @@ StyledSwatchButton.defaultProps = {
|
|
|
620
617
|
};
|
|
621
618
|
|
|
622
619
|
const COMPONENT_ID$2 = 'colorpickers.color_swatch';
|
|
623
|
-
const StyledColorSwatch = styled__default
|
|
620
|
+
const StyledColorSwatch = styled__default.default.table.attrs({
|
|
624
621
|
'data-garden-id': COMPONENT_ID$2,
|
|
625
|
-
'data-garden-version': '8.62.
|
|
622
|
+
'data-garden-version': '8.62.2',
|
|
626
623
|
role: 'grid'
|
|
627
624
|
}).withConfig({
|
|
628
625
|
displayName: "StyledColorSwatch",
|
|
@@ -649,17 +646,17 @@ const colorStyles = props => {
|
|
|
649
646
|
color: ${checkColor}
|
|
650
647
|
`;
|
|
651
648
|
};
|
|
652
|
-
const StyledIcon = styled__default
|
|
649
|
+
const StyledIcon = styled__default.default(_ref => {
|
|
653
650
|
let {
|
|
654
651
|
children,
|
|
655
652
|
color,
|
|
656
653
|
theme,
|
|
657
654
|
...props
|
|
658
655
|
} = _ref;
|
|
659
|
-
return
|
|
656
|
+
return React__namespace.default.cloneElement(React.Children.only(children), props);
|
|
660
657
|
}).attrs({
|
|
661
658
|
'data-garden-id': COMPONENT_ID$1,
|
|
662
|
-
'data-garden-version': '8.62.
|
|
659
|
+
'data-garden-version': '8.62.2'
|
|
663
660
|
}).withConfig({
|
|
664
661
|
displayName: "StyledIcon",
|
|
665
662
|
componentId: "sc-8oigif-0"
|
|
@@ -669,9 +666,9 @@ StyledIcon.defaultProps = {
|
|
|
669
666
|
};
|
|
670
667
|
|
|
671
668
|
const COMPONENT_ID = 'colorpickers.swatch_cell';
|
|
672
|
-
const StyledCell = styled__default
|
|
669
|
+
const StyledCell = styled__default.default.td.attrs({
|
|
673
670
|
'data-garden-id': COMPONENT_ID,
|
|
674
|
-
'data-garden-version': '8.62.
|
|
671
|
+
'data-garden-version': '8.62.2'
|
|
675
672
|
}).withConfig({
|
|
676
673
|
displayName: "StyledCell",
|
|
677
674
|
componentId: "sc-qr3oit-0"
|
|
@@ -680,7 +677,7 @@ StyledCell.defaultProps = {
|
|
|
680
677
|
theme: reactTheming.DEFAULT_THEME
|
|
681
678
|
};
|
|
682
679
|
|
|
683
|
-
const ColorWell =
|
|
680
|
+
const ColorWell = React__namespace.default.memo(_ref => {
|
|
684
681
|
let {
|
|
685
682
|
hue,
|
|
686
683
|
saturation,
|
|
@@ -706,7 +703,7 @@ const ColorWell = React__default["default"].memo(_ref => {
|
|
|
706
703
|
setLeftPosition(rtl ? 100 - hsv.s : hsv.s);
|
|
707
704
|
}, [hsv.s, hsv.v, rtl]);
|
|
708
705
|
const throttledChange = React.useMemo(() => {
|
|
709
|
-
return throttle__default
|
|
706
|
+
return throttle__default.default(e => {
|
|
710
707
|
if (containerRef.current) {
|
|
711
708
|
const nextHsv = getNextHsv(e, hue, containerRef.current, rtl);
|
|
712
709
|
onChange && onChange(nextHsv, e);
|
|
@@ -741,12 +738,12 @@ const ColorWell = React__default["default"].memo(_ref => {
|
|
|
741
738
|
throttledChange.cancel();
|
|
742
739
|
};
|
|
743
740
|
}, [throttledChange]);
|
|
744
|
-
return
|
|
741
|
+
return React__namespace.default.createElement(StyledColorWell, {
|
|
745
742
|
hue: hue,
|
|
746
743
|
ref: containerRef,
|
|
747
744
|
role: "presentation",
|
|
748
745
|
onMouseDown: handleMouseDown
|
|
749
|
-
},
|
|
746
|
+
}, React__namespace.default.createElement(StyledColorWellThumb, {
|
|
750
747
|
top: mouseActiveRef.current ? topFromMouse : topPosition,
|
|
751
748
|
left: mouseActiveRef.current ? leftFromMouse : leftPosition
|
|
752
749
|
}));
|
|
@@ -799,7 +796,7 @@ const areColorsEqual = (a, b) => {
|
|
|
799
796
|
if (colorA === undefined || colorB === undefined) {
|
|
800
797
|
return false;
|
|
801
798
|
}
|
|
802
|
-
return isEqual__default
|
|
799
|
+
return isEqual__default.default(colorA, colorB);
|
|
803
800
|
};
|
|
804
801
|
function getInitialState(color) {
|
|
805
802
|
const whiteColor = {
|
|
@@ -1120,33 +1117,33 @@ const Colorpicker = React.forwardRef((_ref, ref) => {
|
|
|
1120
1117
|
payload: computedColor
|
|
1121
1118
|
});
|
|
1122
1119
|
}, [computedColor]);
|
|
1123
|
-
return
|
|
1120
|
+
return React__namespace.default.createElement(StyledColorPicker, _extends$2({
|
|
1124
1121
|
ref: ref,
|
|
1125
1122
|
isOpaque: isOpaque
|
|
1126
|
-
}, props),
|
|
1123
|
+
}, props), React__namespace.default.createElement(ColorWell, {
|
|
1127
1124
|
hue: computedColor.hue,
|
|
1128
1125
|
saturation: computedColor.saturation,
|
|
1129
1126
|
lightness: computedColor.lightness,
|
|
1130
1127
|
onChange: handleColorWellChange
|
|
1131
|
-
}),
|
|
1128
|
+
}), React__namespace.default.createElement(StyledSliderGroup, null, React__namespace.default.createElement(StyledPreview, {
|
|
1132
1129
|
red: computedColor.red,
|
|
1133
1130
|
green: computedColor.green,
|
|
1134
1131
|
blue: computedColor.blue,
|
|
1135
1132
|
alpha: computedColor.alpha,
|
|
1136
1133
|
isOpaque: isOpaque
|
|
1137
|
-
}),
|
|
1134
|
+
}), React__namespace.default.createElement(StyledSliders, {
|
|
1138
1135
|
isOpaque: isOpaque
|
|
1139
|
-
},
|
|
1136
|
+
}, React__namespace.default.createElement(reactForms.Field, null, React__namespace.default.createElement(reactForms.Label, {
|
|
1140
1137
|
hidden: true
|
|
1141
|
-
}, labels.hueSlider || 'Hue slider'),
|
|
1138
|
+
}, labels.hueSlider || 'Hue slider'), React__namespace.default.createElement(StyledHueRange, {
|
|
1142
1139
|
step: 1,
|
|
1143
1140
|
max: 360,
|
|
1144
1141
|
value: computedColor.hue,
|
|
1145
1142
|
isOpaque: isOpaque,
|
|
1146
1143
|
onChange: handleHueChange
|
|
1147
|
-
})), !isOpaque &&
|
|
1144
|
+
})), !isOpaque && React__namespace.default.createElement(reactForms.Field, null, React__namespace.default.createElement(reactForms.Label, {
|
|
1148
1145
|
hidden: true
|
|
1149
|
-
}, labels.alphaSlider || 'Alpha slider'),
|
|
1146
|
+
}, labels.alphaSlider || 'Alpha slider'), React__namespace.default.createElement(StyledAlphaRange, {
|
|
1150
1147
|
max: 1,
|
|
1151
1148
|
step: 0.01,
|
|
1152
1149
|
value: computedColor.alpha / 100,
|
|
@@ -1154,9 +1151,9 @@ const Colorpicker = React.forwardRef((_ref, ref) => {
|
|
|
1154
1151
|
red: computedColor.red,
|
|
1155
1152
|
green: computedColor.green,
|
|
1156
1153
|
blue: computedColor.blue
|
|
1157
|
-
})))),
|
|
1154
|
+
})))), React__namespace.default.createElement(StyledInputGroup, null, React__namespace.default.createElement(StyledHexField, null, React__namespace.default.createElement(StyledLabel, {
|
|
1158
1155
|
isRegular: true
|
|
1159
|
-
}, labels.hex || 'Hex'),
|
|
1156
|
+
}, labels.hex || 'Hex'), React__namespace.default.createElement(StyledInput, {
|
|
1160
1157
|
isCompact: true,
|
|
1161
1158
|
maxLength: 7,
|
|
1162
1159
|
value: state.hexInput
|
|
@@ -1165,9 +1162,9 @@ const Colorpicker = React.forwardRef((_ref, ref) => {
|
|
|
1165
1162
|
spellCheck: false,
|
|
1166
1163
|
onBlur: handleBlur,
|
|
1167
1164
|
onChange: handleHexChange
|
|
1168
|
-
})),
|
|
1165
|
+
})), React__namespace.default.createElement(StyledRGBAField, null, React__namespace.default.createElement(StyledLabel, {
|
|
1169
1166
|
isRegular: true
|
|
1170
|
-
}, labels.red || 'R'),
|
|
1167
|
+
}, labels.red || 'R'), React__namespace.default.createElement(StyledInput, {
|
|
1171
1168
|
isCompact: true,
|
|
1172
1169
|
type: "number",
|
|
1173
1170
|
min: "0",
|
|
@@ -1176,9 +1173,9 @@ const Colorpicker = React.forwardRef((_ref, ref) => {
|
|
|
1176
1173
|
value: state.redInput,
|
|
1177
1174
|
onBlur: handleBlur,
|
|
1178
1175
|
onChange: handleRedChange
|
|
1179
|
-
})),
|
|
1176
|
+
})), React__namespace.default.createElement(StyledRGBAField, null, React__namespace.default.createElement(StyledLabel, {
|
|
1180
1177
|
isRegular: true
|
|
1181
|
-
}, labels.green || 'G'),
|
|
1178
|
+
}, labels.green || 'G'), React__namespace.default.createElement(StyledInput, {
|
|
1182
1179
|
isCompact: true,
|
|
1183
1180
|
type: "number",
|
|
1184
1181
|
min: "0",
|
|
@@ -1187,9 +1184,9 @@ const Colorpicker = React.forwardRef((_ref, ref) => {
|
|
|
1187
1184
|
value: state.greenInput,
|
|
1188
1185
|
onBlur: handleBlur,
|
|
1189
1186
|
onChange: handleGreenChange
|
|
1190
|
-
})),
|
|
1187
|
+
})), React__namespace.default.createElement(StyledRGBAField, null, React__namespace.default.createElement(StyledLabel, {
|
|
1191
1188
|
isRegular: true
|
|
1192
|
-
}, labels.blue || 'B'),
|
|
1189
|
+
}, labels.blue || 'B'), React__namespace.default.createElement(StyledInput, {
|
|
1193
1190
|
isCompact: true,
|
|
1194
1191
|
type: "number",
|
|
1195
1192
|
min: "0",
|
|
@@ -1198,9 +1195,9 @@ const Colorpicker = React.forwardRef((_ref, ref) => {
|
|
|
1198
1195
|
value: state.blueInput,
|
|
1199
1196
|
onBlur: handleBlur,
|
|
1200
1197
|
onChange: handleBlueChange
|
|
1201
|
-
})), !isOpaque &&
|
|
1198
|
+
})), !isOpaque && React__namespace.default.createElement(StyledRGBAField, null, React__namespace.default.createElement(StyledLabel, {
|
|
1202
1199
|
isRegular: true
|
|
1203
|
-
}, labels.alpha || 'A'),
|
|
1200
|
+
}, labels.alpha || 'A'), React__namespace.default.createElement(StyledInput, {
|
|
1204
1201
|
isCompact: true,
|
|
1205
1202
|
type: "number",
|
|
1206
1203
|
min: "0",
|
|
@@ -1215,11 +1212,11 @@ Colorpicker.defaultProps = {
|
|
|
1215
1212
|
};
|
|
1216
1213
|
Colorpicker.displayName = 'Colorpicker';
|
|
1217
1214
|
Colorpicker.propTypes = {
|
|
1218
|
-
color: PropTypes__default
|
|
1219
|
-
isOpaque: PropTypes__default
|
|
1220
|
-
onChange: PropTypes__default
|
|
1221
|
-
labels: PropTypes__default
|
|
1222
|
-
defaultColor: PropTypes__default
|
|
1215
|
+
color: PropTypes__default.default.oneOfType([PropTypes__default.default.object, PropTypes__default.default.string]),
|
|
1216
|
+
isOpaque: PropTypes__default.default.bool,
|
|
1217
|
+
onChange: PropTypes__default.default.func,
|
|
1218
|
+
labels: PropTypes__default.default.object,
|
|
1219
|
+
defaultColor: PropTypes__default.default.oneOfType([PropTypes__default.default.object, PropTypes__default.default.string])
|
|
1223
1220
|
};
|
|
1224
1221
|
|
|
1225
1222
|
var _path$1;
|
|
@@ -1259,6 +1256,7 @@ const ColorpickerDialog = React.forwardRef((_ref, ref) => {
|
|
|
1259
1256
|
disabled,
|
|
1260
1257
|
buttonProps,
|
|
1261
1258
|
onDialogChange,
|
|
1259
|
+
'aria-label': ariaLabel,
|
|
1262
1260
|
children,
|
|
1263
1261
|
...props
|
|
1264
1262
|
} = _ref;
|
|
@@ -1268,6 +1266,9 @@ const ColorpickerDialog = React.forwardRef((_ref, ref) => {
|
|
|
1268
1266
|
const colorPickerRef = React.useRef(null);
|
|
1269
1267
|
const [referenceElement, setReferenceElement] = React.useState();
|
|
1270
1268
|
const [uncontrolledColor, setUncontrolledColor] = React.useState(defaultColor);
|
|
1269
|
+
const ariaLabelText = reactTheming.useText(ColorpickerDialog, {
|
|
1270
|
+
'aria-label': ariaLabel
|
|
1271
|
+
}, 'aria-label', 'Color picker');
|
|
1271
1272
|
const openDialog = () => {
|
|
1272
1273
|
setReferenceElement(buttonRef.current);
|
|
1273
1274
|
onDialogChange && onDialogChange({
|
|
@@ -1296,19 +1297,19 @@ const ColorpickerDialog = React.forwardRef((_ref, ref) => {
|
|
|
1296
1297
|
}
|
|
1297
1298
|
}
|
|
1298
1299
|
}, [isOpen, isDialogControlled]);
|
|
1299
|
-
return
|
|
1300
|
+
return React__namespace.default.createElement(React__namespace.default.Fragment, null, children ? React.cloneElement(React.Children.only(children), {
|
|
1300
1301
|
onClick,
|
|
1301
1302
|
ref: buttonRef
|
|
1302
|
-
}) :
|
|
1303
|
+
}) : React__namespace.default.createElement(StyledButton, _extends$2({
|
|
1303
1304
|
disabled: disabled,
|
|
1304
1305
|
focusInset: focusInset,
|
|
1305
1306
|
ref: buttonRef,
|
|
1306
1307
|
onClick: onClick
|
|
1307
|
-
}, buttonProps),
|
|
1308
|
+
}, buttonProps), React__namespace.default.createElement(StyledButtonPreview, {
|
|
1308
1309
|
backgroundColor: isControlled ? color : uncontrolledColor
|
|
1309
|
-
}),
|
|
1310
|
+
}), React__namespace.default.createElement(reactButtons.Button.EndIcon, {
|
|
1310
1311
|
isRotated: referenceElement != null
|
|
1311
|
-
},
|
|
1312
|
+
}, React__namespace.default.createElement(SvgChevronDownStroke, null))), React__namespace.default.createElement(StyledTooltipModal, _extends$2({
|
|
1312
1313
|
ref: ref,
|
|
1313
1314
|
hasArrow: hasArrow,
|
|
1314
1315
|
popperModifiers: popperModifiers,
|
|
@@ -1321,8 +1322,9 @@ const ColorpickerDialog = React.forwardRef((_ref, ref) => {
|
|
|
1321
1322
|
onClose: () => {
|
|
1322
1323
|
closeDialog();
|
|
1323
1324
|
onClose && onClose(isControlled ? color : uncontrolledColor);
|
|
1324
|
-
}
|
|
1325
|
-
|
|
1325
|
+
},
|
|
1326
|
+
"aria-label": ariaLabelText
|
|
1327
|
+
}, props), React__namespace.default.createElement(StyledTooltipBody, null, React__namespace.default.createElement(Colorpicker, {
|
|
1326
1328
|
autofocus: true,
|
|
1327
1329
|
color: color,
|
|
1328
1330
|
isOpaque: isOpaque,
|
|
@@ -1334,18 +1336,18 @@ const ColorpickerDialog = React.forwardRef((_ref, ref) => {
|
|
|
1334
1336
|
});
|
|
1335
1337
|
ColorpickerDialog.propTypes = {
|
|
1336
1338
|
...Colorpicker.propTypes,
|
|
1337
|
-
placement: PropTypes__default
|
|
1338
|
-
onClose: PropTypes__default
|
|
1339
|
-
onDialogChange: PropTypes__default
|
|
1340
|
-
disabled: PropTypes__default
|
|
1341
|
-
labels: PropTypes__default
|
|
1342
|
-
buttonProps: PropTypes__default
|
|
1343
|
-
popperModifiers: PropTypes__default
|
|
1344
|
-
zIndex: PropTypes__default
|
|
1345
|
-
hasArrow: PropTypes__default
|
|
1346
|
-
isAnimated: PropTypes__default
|
|
1347
|
-
isOpen: PropTypes__default
|
|
1348
|
-
focusInset: PropTypes__default
|
|
1339
|
+
placement: PropTypes__default.default.oneOf(reactModals.PLACEMENT),
|
|
1340
|
+
onClose: PropTypes__default.default.func,
|
|
1341
|
+
onDialogChange: PropTypes__default.default.func,
|
|
1342
|
+
disabled: PropTypes__default.default.bool,
|
|
1343
|
+
labels: PropTypes__default.default.object,
|
|
1344
|
+
buttonProps: PropTypes__default.default.object,
|
|
1345
|
+
popperModifiers: PropTypes__default.default.any,
|
|
1346
|
+
zIndex: PropTypes__default.default.number,
|
|
1347
|
+
hasArrow: PropTypes__default.default.bool,
|
|
1348
|
+
isAnimated: PropTypes__default.default.bool,
|
|
1349
|
+
isOpen: PropTypes__default.default.bool,
|
|
1350
|
+
focusInset: PropTypes__default.default.bool
|
|
1349
1351
|
};
|
|
1350
1352
|
ColorpickerDialog.defaultProps = {
|
|
1351
1353
|
placement: 'bottom-start',
|
|
@@ -1396,9 +1398,9 @@ const ColorSwatch = React.forwardRef((_ref, ref) => {
|
|
|
1396
1398
|
idPrefix: containerUtilities.useId(),
|
|
1397
1399
|
...props
|
|
1398
1400
|
});
|
|
1399
|
-
return
|
|
1401
|
+
return React__namespace.default.createElement(StyledColorSwatch, {
|
|
1400
1402
|
ref: ref
|
|
1401
|
-
},
|
|
1403
|
+
}, React__namespace.default.createElement("tbody", null, colors.map((row, rowIdx) => React__namespace.default.createElement("tr", {
|
|
1402
1404
|
key: row[0].value
|
|
1403
1405
|
}, row.map((color, colIdx) => {
|
|
1404
1406
|
const {
|
|
@@ -1414,34 +1416,34 @@ const ColorSwatch = React.forwardRef((_ref, ref) => {
|
|
|
1414
1416
|
type: 'button',
|
|
1415
1417
|
role: undefined
|
|
1416
1418
|
});
|
|
1417
|
-
return
|
|
1419
|
+
return React__namespace.default.createElement(StyledCell, {
|
|
1418
1420
|
key: value,
|
|
1419
1421
|
"aria-selected": ariaSelected
|
|
1420
|
-
},
|
|
1422
|
+
}, React__namespace.default.createElement(reactTooltips.Tooltip, {
|
|
1421
1423
|
content: label
|
|
1422
|
-
},
|
|
1424
|
+
}, React__namespace.default.createElement(StyledSwatchButton, _extends$2({
|
|
1423
1425
|
backgroundColor: value,
|
|
1424
1426
|
"aria-pressed": ariaSelected,
|
|
1425
1427
|
"aria-label": label
|
|
1426
|
-
}, other),
|
|
1428
|
+
}, other), React__namespace.default.createElement(StyledIcon, {
|
|
1427
1429
|
color: value,
|
|
1428
1430
|
selected: ariaSelected
|
|
1429
|
-
},
|
|
1431
|
+
}, React__namespace.default.createElement(SvgCheckSmFill, null)))));
|
|
1430
1432
|
})))));
|
|
1431
1433
|
});
|
|
1432
1434
|
ColorSwatch.displayName = 'ColorSwatch';
|
|
1433
1435
|
ColorSwatch.propTypes = {
|
|
1434
|
-
colors: PropTypes__default
|
|
1435
|
-
rowIndex: PropTypes__default
|
|
1436
|
-
colIndex: PropTypes__default
|
|
1437
|
-
selectedRowIndex: PropTypes__default
|
|
1438
|
-
selectedColIndex: PropTypes__default
|
|
1439
|
-
defaultRowIndex: PropTypes__default
|
|
1440
|
-
defaultColIndex: PropTypes__default
|
|
1441
|
-
defaultSelectedRowIndex: PropTypes__default
|
|
1442
|
-
defaultSelectedColIndex: PropTypes__default
|
|
1443
|
-
onChange: PropTypes__default
|
|
1444
|
-
onSelect: PropTypes__default
|
|
1436
|
+
colors: PropTypes__default.default.arrayOf(PropTypes__default.default.any).isRequired,
|
|
1437
|
+
rowIndex: PropTypes__default.default.number,
|
|
1438
|
+
colIndex: PropTypes__default.default.number,
|
|
1439
|
+
selectedRowIndex: PropTypes__default.default.number,
|
|
1440
|
+
selectedColIndex: PropTypes__default.default.number,
|
|
1441
|
+
defaultRowIndex: PropTypes__default.default.number,
|
|
1442
|
+
defaultColIndex: PropTypes__default.default.number,
|
|
1443
|
+
defaultSelectedRowIndex: PropTypes__default.default.number,
|
|
1444
|
+
defaultSelectedColIndex: PropTypes__default.default.number,
|
|
1445
|
+
onChange: PropTypes__default.default.func,
|
|
1446
|
+
onSelect: PropTypes__default.default.func
|
|
1445
1447
|
};
|
|
1446
1448
|
|
|
1447
1449
|
const ColorSwatchDialog = React.forwardRef((_ref, ref) => {
|
|
@@ -1469,6 +1471,7 @@ const ColorSwatchDialog = React.forwardRef((_ref, ref) => {
|
|
|
1469
1471
|
buttonProps,
|
|
1470
1472
|
onDialogChange,
|
|
1471
1473
|
children,
|
|
1474
|
+
'aria-label': ariaLabel,
|
|
1472
1475
|
...props
|
|
1473
1476
|
} = _ref;
|
|
1474
1477
|
const controlledFocus = rowIndex !== null && colIndex !== null && rowIndex !== undefined && colIndex !== undefined;
|
|
@@ -1482,6 +1485,9 @@ const ColorSwatchDialog = React.forwardRef((_ref, ref) => {
|
|
|
1482
1485
|
const [uncontrolledSelectedColIndex, setUncontrolledSelectedColIndex] = React.useState(defaultSelectedColIndex || 0);
|
|
1483
1486
|
const [uncontrolledRowIndex, setUncontrolledRowIndex] = React.useState(defaultRowIndex || 0);
|
|
1484
1487
|
const [uncontrolledColIndex, setUncontrolledColIndex] = React.useState(defaultColIndex || 0);
|
|
1488
|
+
const ariaLabelText = reactTheming.useText(ColorSwatchDialog, {
|
|
1489
|
+
'aria-label': ariaLabel
|
|
1490
|
+
}, 'aria-label', 'Color swatch');
|
|
1485
1491
|
React.useEffect(() => {
|
|
1486
1492
|
if (isDialogControlled) {
|
|
1487
1493
|
if (isOpen) {
|
|
@@ -1531,19 +1537,19 @@ const ColorSwatchDialog = React.forwardRef((_ref, ref) => {
|
|
|
1531
1537
|
}
|
|
1532
1538
|
}
|
|
1533
1539
|
}, [referenceElement]);
|
|
1534
|
-
return
|
|
1540
|
+
return React__namespace.default.createElement(React__namespace.default.Fragment, null, children ? React.cloneElement(React.Children.only(children), {
|
|
1535
1541
|
onClick,
|
|
1536
1542
|
ref: buttonRef
|
|
1537
|
-
}) :
|
|
1543
|
+
}) : React__namespace.default.createElement(StyledButton, _extends$2({
|
|
1538
1544
|
disabled: disabled,
|
|
1539
1545
|
focusInset: focusInset,
|
|
1540
1546
|
ref: buttonRef,
|
|
1541
1547
|
onClick: onClick
|
|
1542
|
-
}, buttonProps),
|
|
1548
|
+
}, buttonProps), React__namespace.default.createElement(StyledButtonPreview, {
|
|
1543
1549
|
backgroundColor: isControlled ? (_controlledSelectedCo = controlledSelectedColor) === null || _controlledSelectedCo === void 0 ? void 0 : _controlledSelectedCo.value : (_uncontrolledSelected = uncontrolledSelectedColor) === null || _uncontrolledSelected === void 0 ? void 0 : _uncontrolledSelected.value
|
|
1544
|
-
}),
|
|
1550
|
+
}), React__namespace.default.createElement(reactButtons.Button.EndIcon, {
|
|
1545
1551
|
isRotated: referenceElement != null
|
|
1546
|
-
},
|
|
1552
|
+
}, React__namespace.default.createElement(SvgChevronDownStroke, null))), React__namespace.default.createElement(StyledTooltipModal, _extends$2({
|
|
1547
1553
|
ref: ref,
|
|
1548
1554
|
zIndex: zIndex,
|
|
1549
1555
|
hasArrow: hasArrow,
|
|
@@ -1552,8 +1558,9 @@ const ColorSwatchDialog = React.forwardRef((_ref, ref) => {
|
|
|
1552
1558
|
isAnimated: isAnimated,
|
|
1553
1559
|
popperModifiers: popperModifiers,
|
|
1554
1560
|
referenceElement: referenceElement,
|
|
1555
|
-
onClose: closeDialog
|
|
1556
|
-
|
|
1561
|
+
onClose: closeDialog,
|
|
1562
|
+
"aria-label": ariaLabelText
|
|
1563
|
+
}, props), React__namespace.default.createElement(StyledTooltipBody, null, React__namespace.default.createElement(ColorSwatch, {
|
|
1557
1564
|
colors: colors,
|
|
1558
1565
|
ref: colorSwatchRef,
|
|
1559
1566
|
rowIndex: rowIndex,
|
|
@@ -1582,16 +1589,16 @@ const ColorSwatchDialog = React.forwardRef((_ref, ref) => {
|
|
|
1582
1589
|
});
|
|
1583
1590
|
ColorSwatchDialog.propTypes = {
|
|
1584
1591
|
...ColorSwatch.propTypes,
|
|
1585
|
-
placement: PropTypes__default
|
|
1586
|
-
onDialogChange: PropTypes__default
|
|
1587
|
-
disabled: PropTypes__default
|
|
1588
|
-
buttonProps: PropTypes__default
|
|
1589
|
-
popperModifiers: PropTypes__default
|
|
1590
|
-
zIndex: PropTypes__default
|
|
1591
|
-
hasArrow: PropTypes__default
|
|
1592
|
-
isAnimated: PropTypes__default
|
|
1593
|
-
focusInset: PropTypes__default
|
|
1594
|
-
isOpen: PropTypes__default
|
|
1592
|
+
placement: PropTypes__default.default.oneOf(reactModals.PLACEMENT),
|
|
1593
|
+
onDialogChange: PropTypes__default.default.func,
|
|
1594
|
+
disabled: PropTypes__default.default.bool,
|
|
1595
|
+
buttonProps: PropTypes__default.default.object,
|
|
1596
|
+
popperModifiers: PropTypes__default.default.any,
|
|
1597
|
+
zIndex: PropTypes__default.default.number,
|
|
1598
|
+
hasArrow: PropTypes__default.default.bool,
|
|
1599
|
+
isAnimated: PropTypes__default.default.bool,
|
|
1600
|
+
focusInset: PropTypes__default.default.bool,
|
|
1601
|
+
isOpen: PropTypes__default.default.bool
|
|
1595
1602
|
};
|
|
1596
1603
|
ColorSwatchDialog.defaultProps = {
|
|
1597
1604
|
placement: 'bottom-start',
|
package/dist/index.esm.js
CHANGED
|
@@ -11,7 +11,7 @@ import PropTypes from 'prop-types';
|
|
|
11
11
|
import { Range, Field, Label, Input } from '@zendeskgarden/react-forms';
|
|
12
12
|
import throttle from 'lodash.throttle';
|
|
13
13
|
import styled, { ThemeContext } from 'styled-components';
|
|
14
|
-
import { retrieveComponentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
|
|
14
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getColor, useText } from '@zendeskgarden/react-theming';
|
|
15
15
|
import { stripUnit, math, rgba, hsl, parseToRgb, readableColor, parseToHsl, rgb } from 'polished';
|
|
16
16
|
import { Button } from '@zendeskgarden/react-buttons';
|
|
17
17
|
import { TooltipModal, PLACEMENT } from '@zendeskgarden/react-modals';
|
|
@@ -125,7 +125,7 @@ const getColorPickerWidth = props => {
|
|
|
125
125
|
};
|
|
126
126
|
const StyledColorPicker = styled.div.attrs({
|
|
127
127
|
'data-garden-id': COMPONENT_ID$l,
|
|
128
|
-
'data-garden-version': '8.62.
|
|
128
|
+
'data-garden-version': '8.62.2'
|
|
129
129
|
}).withConfig({
|
|
130
130
|
displayName: "StyledColorPicker",
|
|
131
131
|
componentId: "sc-1donyl9-0"
|
|
@@ -260,7 +260,7 @@ const sizeStyles$2 = props => {
|
|
|
260
260
|
};
|
|
261
261
|
const StyledRange = styled(Range).attrs({
|
|
262
262
|
'data-garden-id': COMPONENT_ID$k,
|
|
263
|
-
'data-garden-version': '8.62.
|
|
263
|
+
'data-garden-version': '8.62.2',
|
|
264
264
|
hasLowerTrack: false
|
|
265
265
|
}).withConfig({
|
|
266
266
|
displayName: "StyledRange",
|
|
@@ -275,7 +275,7 @@ StyledRange.defaultProps = {
|
|
|
275
275
|
const COMPONENT_ID$j = 'colorpickers.colorpicker_hue';
|
|
276
276
|
const StyledHueRange = styled(StyledRange).attrs({
|
|
277
277
|
'data-garden-id': COMPONENT_ID$j,
|
|
278
|
-
'data-garden-version': '8.62.
|
|
278
|
+
'data-garden-version': '8.62.2'
|
|
279
279
|
}).withConfig({
|
|
280
280
|
displayName: "StyledHueRange",
|
|
281
281
|
componentId: "sc-13ly7p-0"
|
|
@@ -319,7 +319,7 @@ const StyledAlphaRange = styled(StyledRange).attrs(props => ({
|
|
|
319
319
|
background: background$3(props)
|
|
320
320
|
},
|
|
321
321
|
'data-garden-id': COMPONENT_ID$i,
|
|
322
|
-
'data-garden-version': '8.62.
|
|
322
|
+
'data-garden-version': '8.62.2'
|
|
323
323
|
})).withConfig({
|
|
324
324
|
displayName: "StyledAlphaRange",
|
|
325
325
|
componentId: "sc-kuh2xc-0"
|
|
@@ -343,7 +343,7 @@ const StyledPreview = styled.div.attrs(props => ({
|
|
|
343
343
|
background: background$2(props)
|
|
344
344
|
},
|
|
345
345
|
'data-garden-id': COMPONENT_ID$h,
|
|
346
|
-
'data-garden-version': '8.62.
|
|
346
|
+
'data-garden-version': '8.62.2',
|
|
347
347
|
'data-test-id': 'preview-box'
|
|
348
348
|
})).withConfig({
|
|
349
349
|
displayName: "StyledPreview",
|
|
@@ -365,7 +365,7 @@ const background$1 = props => {
|
|
|
365
365
|
};
|
|
366
366
|
const StyledColorWell = styled.div.attrs(props => ({
|
|
367
367
|
'data-garden-id': COMPONENT_ID$g,
|
|
368
|
-
'data-garden-version': '8.62.
|
|
368
|
+
'data-garden-version': '8.62.2',
|
|
369
369
|
'data-test-id': 'colorwell',
|
|
370
370
|
style: {
|
|
371
371
|
background: background$1(props)
|
|
@@ -393,7 +393,7 @@ const sizeStyles$1 = theme => {
|
|
|
393
393
|
};
|
|
394
394
|
const StyledColorWellThumb = styled.div.attrs(props => ({
|
|
395
395
|
'data-garden-id': COMPONENT_ID$f,
|
|
396
|
-
'data-garden-version': '8.62.
|
|
396
|
+
'data-garden-version': '8.62.2',
|
|
397
397
|
'data-test-id': 'colorwell-thumb',
|
|
398
398
|
style: {
|
|
399
399
|
top: `${props.top}%`,
|
|
@@ -410,7 +410,7 @@ StyledColorWellThumb.defaultProps = {
|
|
|
410
410
|
const COMPONENT_ID$e = 'colorpickers.colorpicker_slider_group';
|
|
411
411
|
const StyledSliderGroup = styled.div.attrs({
|
|
412
412
|
'data-garden-id': COMPONENT_ID$e,
|
|
413
|
-
'data-garden-version': '8.62.
|
|
413
|
+
'data-garden-version': '8.62.2'
|
|
414
414
|
}).withConfig({
|
|
415
415
|
displayName: "StyledSliderGroup",
|
|
416
416
|
componentId: "sc-rsq0ak-0"
|
|
@@ -422,7 +422,7 @@ StyledSliderGroup.defaultProps = {
|
|
|
422
422
|
const COMPONENT_ID$d = 'colorpickers.colorpicker_hex_field';
|
|
423
423
|
const StyledHexField = styled(Field).attrs({
|
|
424
424
|
'data-garden-id': COMPONENT_ID$d,
|
|
425
|
-
'data-garden-version': '8.62.
|
|
425
|
+
'data-garden-version': '8.62.2',
|
|
426
426
|
spellcheck: false
|
|
427
427
|
}).withConfig({
|
|
428
428
|
displayName: "StyledHexField",
|
|
@@ -435,7 +435,7 @@ StyledHexField.defaultProps = {
|
|
|
435
435
|
const COMPONENT_ID$c = 'colorpickers.colorpicker_label';
|
|
436
436
|
const StyledLabel = styled(Label).attrs({
|
|
437
437
|
'data-garden-id': COMPONENT_ID$c,
|
|
438
|
-
'data-garden-version': '8.62.
|
|
438
|
+
'data-garden-version': '8.62.2'
|
|
439
439
|
}).withConfig({
|
|
440
440
|
displayName: "StyledLabel",
|
|
441
441
|
componentId: "sc-1klhp6m-0"
|
|
@@ -447,7 +447,7 @@ StyledLabel.defaultProps = {
|
|
|
447
447
|
const COMPONENT_ID$b = 'colorpickers.colorpicker_input';
|
|
448
448
|
const StyledInput = styled(Input).attrs({
|
|
449
449
|
'data-garden-id': COMPONENT_ID$b,
|
|
450
|
-
'data-garden-version': '8.62.
|
|
450
|
+
'data-garden-version': '8.62.2',
|
|
451
451
|
focusInset: false
|
|
452
452
|
}).withConfig({
|
|
453
453
|
displayName: "StyledInput",
|
|
@@ -460,7 +460,7 @@ StyledInput.defaultProps = {
|
|
|
460
460
|
const COMPONENT_ID$a = 'colorpickers.colorpicker_input_group';
|
|
461
461
|
const StyledInputGroup = styled.div.attrs({
|
|
462
462
|
'data-garden-id': COMPONENT_ID$a,
|
|
463
|
-
'data-garden-version': '8.62.
|
|
463
|
+
'data-garden-version': '8.62.2'
|
|
464
464
|
}).withConfig({
|
|
465
465
|
displayName: "StyledInputGroup",
|
|
466
466
|
componentId: "sc-mmy93w-0"
|
|
@@ -481,7 +481,7 @@ const sizeStyles = theme => {
|
|
|
481
481
|
};
|
|
482
482
|
const StyledRGBAField = styled(Field).attrs({
|
|
483
483
|
'data-garden-id': COMPONENT_ID$9,
|
|
484
|
-
'data-garden-version': '8.62.
|
|
484
|
+
'data-garden-version': '8.62.2'
|
|
485
485
|
}).withConfig({
|
|
486
486
|
displayName: "StyledRGBAField",
|
|
487
487
|
componentId: "sc-ibo1yw-0"
|
|
@@ -493,7 +493,7 @@ StyledRGBAField.defaultProps = {
|
|
|
493
493
|
const COMPONENT_ID$8 = 'colorpickers.colorpicker_sliders';
|
|
494
494
|
const StyledSliders = styled.div.attrs({
|
|
495
495
|
'data-garden-id': COMPONENT_ID$8,
|
|
496
|
-
'data-garden-version': '8.62.
|
|
496
|
+
'data-garden-version': '8.62.2'
|
|
497
497
|
}).withConfig({
|
|
498
498
|
displayName: "StyledSliders",
|
|
499
499
|
componentId: "sc-aclca2-0"
|
|
@@ -506,7 +506,7 @@ const COMPONENT_ID$7 = 'colorpickers.colordialog_button';
|
|
|
506
506
|
const StyledButton = styled(Button).attrs({
|
|
507
507
|
isNeutral: true,
|
|
508
508
|
'data-garden-id': COMPONENT_ID$7,
|
|
509
|
-
'data-garden-version': '8.62.
|
|
509
|
+
'data-garden-version': '8.62.2'
|
|
510
510
|
}).withConfig({
|
|
511
511
|
displayName: "StyledButton",
|
|
512
512
|
componentId: "sc-101xjve-0"
|
|
@@ -541,7 +541,7 @@ const StyledButtonPreview = styled.span.attrs(props => ({
|
|
|
541
541
|
background: `${background(props)}, ${checkeredBackground(props.theme, 8)}`
|
|
542
542
|
},
|
|
543
543
|
'data-garden-id': COMPONENT_ID$6,
|
|
544
|
-
'data-garden-version': '8.62.
|
|
544
|
+
'data-garden-version': '8.62.2',
|
|
545
545
|
'data-test-id': 'dialog-preview'
|
|
546
546
|
})).withConfig({
|
|
547
547
|
displayName: "StyledButtonPreview",
|
|
@@ -554,7 +554,7 @@ StyledButtonPreview.defaultProps = {
|
|
|
554
554
|
const COMPONENT_ID$5 = 'colorpickers.colordialog_tooltipmodal';
|
|
555
555
|
const StyledTooltipModal = styled(TooltipModal).attrs({
|
|
556
556
|
'data-garden-id': COMPONENT_ID$5,
|
|
557
|
-
'data-garden-version': '8.62.
|
|
557
|
+
'data-garden-version': '8.62.2'
|
|
558
558
|
}).withConfig({
|
|
559
559
|
displayName: "StyledTooltipModal",
|
|
560
560
|
componentId: "sc-o022s8-0"
|
|
@@ -566,7 +566,7 @@ StyledTooltipModal.defaultProps = {
|
|
|
566
566
|
const COMPONENT_ID$4 = 'colorpickers.colordialog_tooltipmodal_body';
|
|
567
567
|
const StyledTooltipBody = styled(TooltipModal.Body).attrs({
|
|
568
568
|
'data-garden-id': COMPONENT_ID$4,
|
|
569
|
-
'data-garden-version': '8.62.
|
|
569
|
+
'data-garden-version': '8.62.2'
|
|
570
570
|
}).withConfig({
|
|
571
571
|
displayName: "StyledTooltipBody",
|
|
572
572
|
componentId: "sc-6gsgsy-0"
|
|
@@ -580,7 +580,7 @@ const StyledSwatchButton = styled(StyledButtonPreview).attrs(props => ({
|
|
|
580
580
|
as: 'button',
|
|
581
581
|
'data-garden-id': COMPONENT_ID$3,
|
|
582
582
|
'data-test-id': props.backgroundColor,
|
|
583
|
-
'data-garden-version': '8.62.
|
|
583
|
+
'data-garden-version': '8.62.2'
|
|
584
584
|
})).withConfig({
|
|
585
585
|
displayName: "StyledSwatchButton",
|
|
586
586
|
componentId: "sc-edpwpp-0"
|
|
@@ -592,7 +592,7 @@ StyledSwatchButton.defaultProps = {
|
|
|
592
592
|
const COMPONENT_ID$2 = 'colorpickers.color_swatch';
|
|
593
593
|
const StyledColorSwatch = styled.table.attrs({
|
|
594
594
|
'data-garden-id': COMPONENT_ID$2,
|
|
595
|
-
'data-garden-version': '8.62.
|
|
595
|
+
'data-garden-version': '8.62.2',
|
|
596
596
|
role: 'grid'
|
|
597
597
|
}).withConfig({
|
|
598
598
|
displayName: "StyledColorSwatch",
|
|
@@ -629,7 +629,7 @@ const StyledIcon = styled(_ref => {
|
|
|
629
629
|
return React__default.cloneElement(Children.only(children), props);
|
|
630
630
|
}).attrs({
|
|
631
631
|
'data-garden-id': COMPONENT_ID$1,
|
|
632
|
-
'data-garden-version': '8.62.
|
|
632
|
+
'data-garden-version': '8.62.2'
|
|
633
633
|
}).withConfig({
|
|
634
634
|
displayName: "StyledIcon",
|
|
635
635
|
componentId: "sc-8oigif-0"
|
|
@@ -641,7 +641,7 @@ StyledIcon.defaultProps = {
|
|
|
641
641
|
const COMPONENT_ID = 'colorpickers.swatch_cell';
|
|
642
642
|
const StyledCell = styled.td.attrs({
|
|
643
643
|
'data-garden-id': COMPONENT_ID,
|
|
644
|
-
'data-garden-version': '8.62.
|
|
644
|
+
'data-garden-version': '8.62.2'
|
|
645
645
|
}).withConfig({
|
|
646
646
|
displayName: "StyledCell",
|
|
647
647
|
componentId: "sc-qr3oit-0"
|
|
@@ -1229,6 +1229,7 @@ const ColorpickerDialog = forwardRef((_ref, ref) => {
|
|
|
1229
1229
|
disabled,
|
|
1230
1230
|
buttonProps,
|
|
1231
1231
|
onDialogChange,
|
|
1232
|
+
'aria-label': ariaLabel,
|
|
1232
1233
|
children,
|
|
1233
1234
|
...props
|
|
1234
1235
|
} = _ref;
|
|
@@ -1238,6 +1239,9 @@ const ColorpickerDialog = forwardRef((_ref, ref) => {
|
|
|
1238
1239
|
const colorPickerRef = useRef(null);
|
|
1239
1240
|
const [referenceElement, setReferenceElement] = useState();
|
|
1240
1241
|
const [uncontrolledColor, setUncontrolledColor] = useState(defaultColor);
|
|
1242
|
+
const ariaLabelText = useText(ColorpickerDialog, {
|
|
1243
|
+
'aria-label': ariaLabel
|
|
1244
|
+
}, 'aria-label', 'Color picker');
|
|
1241
1245
|
const openDialog = () => {
|
|
1242
1246
|
setReferenceElement(buttonRef.current);
|
|
1243
1247
|
onDialogChange && onDialogChange({
|
|
@@ -1291,7 +1295,8 @@ const ColorpickerDialog = forwardRef((_ref, ref) => {
|
|
|
1291
1295
|
onClose: () => {
|
|
1292
1296
|
closeDialog();
|
|
1293
1297
|
onClose && onClose(isControlled ? color : uncontrolledColor);
|
|
1294
|
-
}
|
|
1298
|
+
},
|
|
1299
|
+
"aria-label": ariaLabelText
|
|
1295
1300
|
}, props), React__default.createElement(StyledTooltipBody, null, React__default.createElement(Colorpicker, {
|
|
1296
1301
|
autofocus: true,
|
|
1297
1302
|
color: color,
|
|
@@ -1439,6 +1444,7 @@ const ColorSwatchDialog = forwardRef((_ref, ref) => {
|
|
|
1439
1444
|
buttonProps,
|
|
1440
1445
|
onDialogChange,
|
|
1441
1446
|
children,
|
|
1447
|
+
'aria-label': ariaLabel,
|
|
1442
1448
|
...props
|
|
1443
1449
|
} = _ref;
|
|
1444
1450
|
const controlledFocus = rowIndex !== null && colIndex !== null && rowIndex !== undefined && colIndex !== undefined;
|
|
@@ -1452,6 +1458,9 @@ const ColorSwatchDialog = forwardRef((_ref, ref) => {
|
|
|
1452
1458
|
const [uncontrolledSelectedColIndex, setUncontrolledSelectedColIndex] = useState(defaultSelectedColIndex || 0);
|
|
1453
1459
|
const [uncontrolledRowIndex, setUncontrolledRowIndex] = useState(defaultRowIndex || 0);
|
|
1454
1460
|
const [uncontrolledColIndex, setUncontrolledColIndex] = useState(defaultColIndex || 0);
|
|
1461
|
+
const ariaLabelText = useText(ColorSwatchDialog, {
|
|
1462
|
+
'aria-label': ariaLabel
|
|
1463
|
+
}, 'aria-label', 'Color swatch');
|
|
1455
1464
|
useEffect(() => {
|
|
1456
1465
|
if (isDialogControlled) {
|
|
1457
1466
|
if (isOpen) {
|
|
@@ -1522,7 +1531,8 @@ const ColorSwatchDialog = forwardRef((_ref, ref) => {
|
|
|
1522
1531
|
isAnimated: isAnimated,
|
|
1523
1532
|
popperModifiers: popperModifiers,
|
|
1524
1533
|
referenceElement: referenceElement,
|
|
1525
|
-
onClose: closeDialog
|
|
1534
|
+
onClose: closeDialog,
|
|
1535
|
+
"aria-label": ariaLabelText
|
|
1526
1536
|
}, props), React__default.createElement(StyledTooltipBody, null, React__default.createElement(ColorSwatch, {
|
|
1527
1537
|
colors: colors,
|
|
1528
1538
|
ref: colorSwatchRef,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-colorpickers",
|
|
3
|
-
"version": "8.62.
|
|
3
|
+
"version": "8.62.2",
|
|
4
4
|
"description": "Components related to color pickers in the Garden Design System",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Zendesk Garden <garden@zendesk.com>",
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@zendeskgarden/container-grid": "^0.1.1",
|
|
25
25
|
"@zendeskgarden/container-utilities": "^0.7.0",
|
|
26
|
-
"@zendeskgarden/react-buttons": "^8.62.
|
|
27
|
-
"@zendeskgarden/react-forms": "^8.62.
|
|
28
|
-
"@zendeskgarden/react-modals": "^8.62.
|
|
29
|
-
"@zendeskgarden/react-tooltips": "^8.62.
|
|
26
|
+
"@zendeskgarden/react-buttons": "^8.62.2",
|
|
27
|
+
"@zendeskgarden/react-forms": "^8.62.2",
|
|
28
|
+
"@zendeskgarden/react-modals": "^8.62.2",
|
|
29
|
+
"@zendeskgarden/react-tooltips": "^8.62.2",
|
|
30
30
|
"lodash.isequal": "^4.5.0",
|
|
31
31
|
"lodash.throttle": "^4.1.1",
|
|
32
32
|
"polished": "^4.0.0",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/lodash.isequal": "4.5.6",
|
|
43
43
|
"@types/lodash.throttle": "4.1.7",
|
|
44
|
-
"@zendeskgarden/react-theming": "^8.62.
|
|
44
|
+
"@zendeskgarden/react-theming": "^8.62.2",
|
|
45
45
|
"@zendeskgarden/svg-icons": "6.33.0"
|
|
46
46
|
},
|
|
47
47
|
"keywords": [
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
57
|
"zendeskgarden:src": "src/index.ts",
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "27a7d6c021f3360396af60d51ecbf66e9076a405"
|
|
59
59
|
}
|