@zendeskgarden/react-colorpickers 8.49.0 → 8.49.3
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 +42 -34
- package/dist/index.esm.js +43 -35
- package/dist/typings/elements/ColorSwatch/index.d.ts +2 -37
- package/dist/typings/elements/ColorSwatchDialog/index.d.ts +2 -34
- package/dist/typings/elements/Colorpicker/ColorWell.d.ts +1 -1
- package/dist/typings/elements/Colorpicker/index.d.ts +2 -28
- package/dist/typings/elements/Colorpicker/reducer.d.ts +1 -1
- package/dist/typings/elements/ColorpickerDialog/index.d.ts +2 -54
- package/dist/typings/index.d.ts +1 -5
- package/dist/typings/styled/ColorSwatch/StyledCell.d.ts +1 -5
- package/dist/typings/styled/Colorpicker/StyledAlphaRange.d.ts +1 -1
- package/dist/typings/styled/Colorpicker/StyledPreview.d.ts +1 -1
- package/dist/typings/styled/ColorpickerDialog/StyledButtonPreview.d.ts +2 -2
- package/dist/typings/types/index.d.ts +176 -0
- package/dist/typings/utils/saturation.d.ts +2 -4
- package/package.json +8 -8
- package/dist/typings/utils/types.d.ts +0 -33
package/dist/index.cjs.js
CHANGED
|
@@ -291,7 +291,7 @@ var getColorPickerWidth = function getColorPickerWidth(props) {
|
|
|
291
291
|
};
|
|
292
292
|
var StyledColorPicker = styled__default["default"].div.attrs({
|
|
293
293
|
'data-garden-id': COMPONENT_ID$l,
|
|
294
|
-
'data-garden-version': '8.49.
|
|
294
|
+
'data-garden-version': '8.49.3'
|
|
295
295
|
}).withConfig({
|
|
296
296
|
displayName: "StyledColorPicker",
|
|
297
297
|
componentId: "sc-1donyl9-0"
|
|
@@ -352,7 +352,7 @@ var sizeStyles$2 = function sizeStyles(props) {
|
|
|
352
352
|
};
|
|
353
353
|
var StyledRange = styled__default["default"](reactForms.Range).attrs({
|
|
354
354
|
'data-garden-id': COMPONENT_ID$k,
|
|
355
|
-
'data-garden-version': '8.49.
|
|
355
|
+
'data-garden-version': '8.49.3',
|
|
356
356
|
hasLowerTrack: false
|
|
357
357
|
}).withConfig({
|
|
358
358
|
displayName: "StyledRange",
|
|
@@ -367,7 +367,7 @@ StyledRange.defaultProps = {
|
|
|
367
367
|
var COMPONENT_ID$j = 'colorpickers.colorpicker_hue';
|
|
368
368
|
var StyledHueRange = styled__default["default"](StyledRange).attrs({
|
|
369
369
|
'data-garden-id': COMPONENT_ID$j,
|
|
370
|
-
'data-garden-version': '8.49.
|
|
370
|
+
'data-garden-version': '8.49.3'
|
|
371
371
|
}).withConfig({
|
|
372
372
|
displayName: "StyledHueRange",
|
|
373
373
|
componentId: "sc-13ly7p-0"
|
|
@@ -413,7 +413,7 @@ var StyledAlphaRange = styled__default["default"](StyledRange).attrs(function (p
|
|
|
413
413
|
background: background$3(props)
|
|
414
414
|
},
|
|
415
415
|
'data-garden-id': COMPONENT_ID$i,
|
|
416
|
-
'data-garden-version': '8.49.
|
|
416
|
+
'data-garden-version': '8.49.3'
|
|
417
417
|
};
|
|
418
418
|
}).withConfig({
|
|
419
419
|
displayName: "StyledAlphaRange",
|
|
@@ -439,7 +439,7 @@ var StyledPreview = styled__default["default"].div.attrs(function (props) {
|
|
|
439
439
|
background: background$2(props)
|
|
440
440
|
},
|
|
441
441
|
'data-garden-id': COMPONENT_ID$h,
|
|
442
|
-
'data-garden-version': '8.49.
|
|
442
|
+
'data-garden-version': '8.49.3',
|
|
443
443
|
'data-test-id': 'preview-box'
|
|
444
444
|
};
|
|
445
445
|
}).withConfig({
|
|
@@ -475,7 +475,7 @@ var background$1 = function background(props) {
|
|
|
475
475
|
var StyledColorWell = styled__default["default"].div.attrs(function (props) {
|
|
476
476
|
return {
|
|
477
477
|
'data-garden-id': COMPONENT_ID$g,
|
|
478
|
-
'data-garden-version': '8.49.
|
|
478
|
+
'data-garden-version': '8.49.3',
|
|
479
479
|
'data-test-id': 'colorwell',
|
|
480
480
|
style: {
|
|
481
481
|
background: background$1(props)
|
|
@@ -503,7 +503,7 @@ var sizeStyles$1 = function sizeStyles(theme) {
|
|
|
503
503
|
var StyledColorWellThumb = styled__default["default"].div.attrs(function (props) {
|
|
504
504
|
return {
|
|
505
505
|
'data-garden-id': COMPONENT_ID$f,
|
|
506
|
-
'data-garden-version': '8.49.
|
|
506
|
+
'data-garden-version': '8.49.3',
|
|
507
507
|
'data-test-id': 'colorwell-thumb',
|
|
508
508
|
style: {
|
|
509
509
|
top: "".concat(props.top, "%"),
|
|
@@ -529,7 +529,7 @@ StyledColorWellThumb.defaultProps = {
|
|
|
529
529
|
var COMPONENT_ID$e = 'colorpickers.colorpicker_slider_group';
|
|
530
530
|
var StyledSliderGroup = styled__default["default"].div.attrs({
|
|
531
531
|
'data-garden-id': COMPONENT_ID$e,
|
|
532
|
-
'data-garden-version': '8.49.
|
|
532
|
+
'data-garden-version': '8.49.3'
|
|
533
533
|
}).withConfig({
|
|
534
534
|
displayName: "StyledSliderGroup",
|
|
535
535
|
componentId: "sc-rsq0ak-0"
|
|
@@ -545,7 +545,7 @@ StyledSliderGroup.defaultProps = {
|
|
|
545
545
|
var COMPONENT_ID$d = 'colorpickers.colorpicker_hex_field';
|
|
546
546
|
var StyledHexField = styled__default["default"](reactForms.Field).attrs({
|
|
547
547
|
'data-garden-id': COMPONENT_ID$d,
|
|
548
|
-
'data-garden-version': '8.49.
|
|
548
|
+
'data-garden-version': '8.49.3',
|
|
549
549
|
spellcheck: false
|
|
550
550
|
}).withConfig({
|
|
551
551
|
displayName: "StyledHexField",
|
|
@@ -560,7 +560,7 @@ StyledHexField.defaultProps = {
|
|
|
560
560
|
var COMPONENT_ID$c = 'colorpickers.colorpicker_label';
|
|
561
561
|
var StyledLabel = styled__default["default"](reactForms.Label).attrs({
|
|
562
562
|
'data-garden-id': COMPONENT_ID$c,
|
|
563
|
-
'data-garden-version': '8.49.
|
|
563
|
+
'data-garden-version': '8.49.3'
|
|
564
564
|
}).withConfig({
|
|
565
565
|
displayName: "StyledLabel",
|
|
566
566
|
componentId: "sc-1klhp6m-0"
|
|
@@ -574,7 +574,7 @@ StyledLabel.defaultProps = {
|
|
|
574
574
|
var COMPONENT_ID$b = 'colorpickers.colorpicker_input';
|
|
575
575
|
var StyledInput = styled__default["default"](reactForms.Input).attrs({
|
|
576
576
|
'data-garden-id': COMPONENT_ID$b,
|
|
577
|
-
'data-garden-version': '8.49.
|
|
577
|
+
'data-garden-version': '8.49.3',
|
|
578
578
|
focusInset: false
|
|
579
579
|
}).withConfig({
|
|
580
580
|
displayName: "StyledInput",
|
|
@@ -589,7 +589,7 @@ StyledInput.defaultProps = {
|
|
|
589
589
|
var COMPONENT_ID$a = 'colorpickers.colorpicker_input_group';
|
|
590
590
|
var StyledInputGroup = styled__default["default"].div.attrs({
|
|
591
591
|
'data-garden-id': COMPONENT_ID$a,
|
|
592
|
-
'data-garden-version': '8.49.
|
|
592
|
+
'data-garden-version': '8.49.3'
|
|
593
593
|
}).withConfig({
|
|
594
594
|
displayName: "StyledInputGroup",
|
|
595
595
|
componentId: "sc-mmy93w-0"
|
|
@@ -608,7 +608,7 @@ var sizeStyles = function sizeStyles(theme) {
|
|
|
608
608
|
};
|
|
609
609
|
var StyledRGBAField = styled__default["default"](reactForms.Field).attrs({
|
|
610
610
|
'data-garden-id': COMPONENT_ID$9,
|
|
611
|
-
'data-garden-version': '8.49.
|
|
611
|
+
'data-garden-version': '8.49.3'
|
|
612
612
|
}).withConfig({
|
|
613
613
|
displayName: "StyledRGBAField",
|
|
614
614
|
componentId: "sc-ibo1yw-0"
|
|
@@ -624,7 +624,7 @@ StyledRGBAField.defaultProps = {
|
|
|
624
624
|
var COMPONENT_ID$8 = 'colorpickers.colorpicker_sliders';
|
|
625
625
|
var StyledSliders = styled__default["default"].div.attrs({
|
|
626
626
|
'data-garden-id': COMPONENT_ID$8,
|
|
627
|
-
'data-garden-version': '8.49.
|
|
627
|
+
'data-garden-version': '8.49.3'
|
|
628
628
|
}).withConfig({
|
|
629
629
|
displayName: "StyledSliders",
|
|
630
630
|
componentId: "sc-aclca2-0"
|
|
@@ -645,7 +645,7 @@ var COMPONENT_ID$7 = 'colorpickers.colordialog_button';
|
|
|
645
645
|
var StyledButton = styled__default["default"](reactButtons.Button).attrs({
|
|
646
646
|
isNeutral: true,
|
|
647
647
|
'data-garden-id': COMPONENT_ID$7,
|
|
648
|
-
'data-garden-version': '8.49.
|
|
648
|
+
'data-garden-version': '8.49.3'
|
|
649
649
|
}).withConfig({
|
|
650
650
|
displayName: "StyledButton",
|
|
651
651
|
componentId: "sc-101xjve-0"
|
|
@@ -692,7 +692,7 @@ var StyledButtonPreview = styled__default["default"].span.attrs(function (props)
|
|
|
692
692
|
background: "".concat(background(props), ", ").concat(checkeredBackground(props.theme, 8))
|
|
693
693
|
},
|
|
694
694
|
'data-garden-id': COMPONENT_ID$6,
|
|
695
|
-
'data-garden-version': '8.49.
|
|
695
|
+
'data-garden-version': '8.49.3',
|
|
696
696
|
'data-test-id': 'dialog-preview'
|
|
697
697
|
};
|
|
698
698
|
}).withConfig({
|
|
@@ -720,7 +720,7 @@ StyledButtonPreview.defaultProps = {
|
|
|
720
720
|
var COMPONENT_ID$5 = 'colorpickers.colordialog_tooltipmodal';
|
|
721
721
|
var StyledTooltipModal = styled__default["default"](reactModals.TooltipModal).attrs({
|
|
722
722
|
'data-garden-id': COMPONENT_ID$5,
|
|
723
|
-
'data-garden-version': '8.49.
|
|
723
|
+
'data-garden-version': '8.49.3'
|
|
724
724
|
}).withConfig({
|
|
725
725
|
displayName: "StyledTooltipModal",
|
|
726
726
|
componentId: "sc-o022s8-0"
|
|
@@ -734,7 +734,7 @@ StyledTooltipModal.defaultProps = {
|
|
|
734
734
|
var COMPONENT_ID$4 = 'colorpickers.colordialog_tooltipmodal_body';
|
|
735
735
|
var StyledTooltipBody = styled__default["default"](reactModals.TooltipModal.Body).attrs({
|
|
736
736
|
'data-garden-id': COMPONENT_ID$4,
|
|
737
|
-
'data-garden-version': '8.49.
|
|
737
|
+
'data-garden-version': '8.49.3'
|
|
738
738
|
}).withConfig({
|
|
739
739
|
displayName: "StyledTooltipBody",
|
|
740
740
|
componentId: "sc-6gsgsy-0"
|
|
@@ -751,7 +751,7 @@ var StyledSwatchButton = styled__default["default"](StyledButtonPreview).attrs(f
|
|
|
751
751
|
as: 'button',
|
|
752
752
|
'data-garden-id': COMPONENT_ID$3,
|
|
753
753
|
'data-test-id': props.backgroundColor,
|
|
754
|
-
'data-garden-version': '8.49.
|
|
754
|
+
'data-garden-version': '8.49.3'
|
|
755
755
|
};
|
|
756
756
|
}).withConfig({
|
|
757
757
|
displayName: "StyledSwatchButton",
|
|
@@ -770,7 +770,7 @@ StyledSwatchButton.defaultProps = {
|
|
|
770
770
|
var COMPONENT_ID$2 = 'colorpickers.color_swatch';
|
|
771
771
|
var StyledColorSwatch = styled__default["default"].table.attrs({
|
|
772
772
|
'data-garden-id': COMPONENT_ID$2,
|
|
773
|
-
'data-garden-version': '8.49.
|
|
773
|
+
'data-garden-version': '8.49.3',
|
|
774
774
|
role: 'grid'
|
|
775
775
|
}).withConfig({
|
|
776
776
|
displayName: "StyledColorSwatch",
|
|
@@ -803,7 +803,7 @@ var StyledIcon = styled__default["default"](function (_ref) {
|
|
|
803
803
|
return React__default["default"].cloneElement(React.Children.only(children), props);
|
|
804
804
|
}).attrs({
|
|
805
805
|
'data-garden-id': COMPONENT_ID$1,
|
|
806
|
-
'data-garden-version': '8.49.
|
|
806
|
+
'data-garden-version': '8.49.3'
|
|
807
807
|
}).withConfig({
|
|
808
808
|
displayName: "StyledIcon",
|
|
809
809
|
componentId: "sc-8oigif-0"
|
|
@@ -823,7 +823,7 @@ StyledIcon.defaultProps = {
|
|
|
823
823
|
var COMPONENT_ID = 'colorpickers.swatch_cell';
|
|
824
824
|
var StyledCell = styled__default["default"].td.attrs({
|
|
825
825
|
'data-garden-id': COMPONENT_ID,
|
|
826
|
-
'data-garden-version': '8.49.
|
|
826
|
+
'data-garden-version': '8.49.3'
|
|
827
827
|
}).withConfig({
|
|
828
828
|
displayName: "StyledCell",
|
|
829
829
|
componentId: "sc-qr3oit-0"
|
|
@@ -1485,17 +1485,20 @@ var ColorpickerDialog = React.forwardRef(function (_ref, ref) {
|
|
|
1485
1485
|
onChange: isControlled ? onChange : setUncontrolledColor
|
|
1486
1486
|
}))));
|
|
1487
1487
|
});
|
|
1488
|
-
ColorpickerDialog.propTypes = {
|
|
1489
|
-
placement: PropTypes__default["default"].oneOf(
|
|
1488
|
+
ColorpickerDialog.propTypes = _objectSpread2(_objectSpread2({}, Colorpicker.propTypes), {}, {
|
|
1489
|
+
placement: PropTypes__default["default"].oneOf(reactModals.PLACEMENT),
|
|
1490
1490
|
onClose: PropTypes__default["default"].func,
|
|
1491
|
-
onChange: PropTypes__default["default"].func,
|
|
1492
1491
|
onDialogChange: PropTypes__default["default"].func,
|
|
1493
1492
|
disabled: PropTypes__default["default"].bool,
|
|
1494
1493
|
labels: PropTypes__default["default"].object,
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1494
|
+
buttonProps: PropTypes__default["default"].object,
|
|
1495
|
+
popperModifiers: PropTypes__default["default"].any,
|
|
1496
|
+
zIndex: PropTypes__default["default"].number,
|
|
1497
|
+
hasArrow: PropTypes__default["default"].bool,
|
|
1498
|
+
isAnimated: PropTypes__default["default"].bool,
|
|
1499
|
+
isOpen: PropTypes__default["default"].bool,
|
|
1500
|
+
focusInset: PropTypes__default["default"].bool
|
|
1501
|
+
});
|
|
1499
1502
|
ColorpickerDialog.defaultProps = {
|
|
1500
1503
|
placement: 'bottom-start',
|
|
1501
1504
|
isAnimated: true,
|
|
@@ -1738,13 +1741,18 @@ var ColorSwatchDialog = React.forwardRef(function (_ref, ref) {
|
|
|
1738
1741
|
}
|
|
1739
1742
|
}))));
|
|
1740
1743
|
});
|
|
1741
|
-
ColorSwatchDialog.propTypes = {
|
|
1742
|
-
placement: PropTypes__default["default"].oneOf(
|
|
1743
|
-
onChange: PropTypes__default["default"].func,
|
|
1744
|
+
ColorSwatchDialog.propTypes = _objectSpread2(_objectSpread2({}, ColorSwatch.propTypes), {}, {
|
|
1745
|
+
placement: PropTypes__default["default"].oneOf(reactModals.PLACEMENT),
|
|
1744
1746
|
onDialogChange: PropTypes__default["default"].func,
|
|
1745
1747
|
disabled: PropTypes__default["default"].bool,
|
|
1746
|
-
buttonProps: PropTypes__default["default"].object
|
|
1747
|
-
|
|
1748
|
+
buttonProps: PropTypes__default["default"].object,
|
|
1749
|
+
popperModifiers: PropTypes__default["default"].any,
|
|
1750
|
+
zIndex: PropTypes__default["default"].number,
|
|
1751
|
+
hasArrow: PropTypes__default["default"].bool,
|
|
1752
|
+
isAnimated: PropTypes__default["default"].bool,
|
|
1753
|
+
focusInset: PropTypes__default["default"].bool,
|
|
1754
|
+
isOpen: PropTypes__default["default"].bool
|
|
1755
|
+
});
|
|
1748
1756
|
ColorSwatchDialog.defaultProps = {
|
|
1749
1757
|
placement: 'bottom-start',
|
|
1750
1758
|
isAnimated: true,
|
package/dist/index.esm.js
CHANGED
|
@@ -14,7 +14,7 @@ import styled, { ThemeContext } from 'styled-components';
|
|
|
14
14
|
import { retrieveComponentStyles, DEFAULT_THEME, getColor } 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
|
-
import { TooltipModal } from '@zendeskgarden/react-modals';
|
|
17
|
+
import { TooltipModal, PLACEMENT } from '@zendeskgarden/react-modals';
|
|
18
18
|
import isEqual from 'lodash.isequal';
|
|
19
19
|
import { composeEventHandlers, useId } from '@zendeskgarden/container-utilities';
|
|
20
20
|
import { Tooltip } from '@zendeskgarden/react-tooltips';
|
|
@@ -261,7 +261,7 @@ var getColorPickerWidth = function getColorPickerWidth(props) {
|
|
|
261
261
|
};
|
|
262
262
|
var StyledColorPicker = styled.div.attrs({
|
|
263
263
|
'data-garden-id': COMPONENT_ID$l,
|
|
264
|
-
'data-garden-version': '8.49.
|
|
264
|
+
'data-garden-version': '8.49.3'
|
|
265
265
|
}).withConfig({
|
|
266
266
|
displayName: "StyledColorPicker",
|
|
267
267
|
componentId: "sc-1donyl9-0"
|
|
@@ -322,7 +322,7 @@ var sizeStyles$2 = function sizeStyles(props) {
|
|
|
322
322
|
};
|
|
323
323
|
var StyledRange = styled(Range).attrs({
|
|
324
324
|
'data-garden-id': COMPONENT_ID$k,
|
|
325
|
-
'data-garden-version': '8.49.
|
|
325
|
+
'data-garden-version': '8.49.3',
|
|
326
326
|
hasLowerTrack: false
|
|
327
327
|
}).withConfig({
|
|
328
328
|
displayName: "StyledRange",
|
|
@@ -337,7 +337,7 @@ StyledRange.defaultProps = {
|
|
|
337
337
|
var COMPONENT_ID$j = 'colorpickers.colorpicker_hue';
|
|
338
338
|
var StyledHueRange = styled(StyledRange).attrs({
|
|
339
339
|
'data-garden-id': COMPONENT_ID$j,
|
|
340
|
-
'data-garden-version': '8.49.
|
|
340
|
+
'data-garden-version': '8.49.3'
|
|
341
341
|
}).withConfig({
|
|
342
342
|
displayName: "StyledHueRange",
|
|
343
343
|
componentId: "sc-13ly7p-0"
|
|
@@ -383,7 +383,7 @@ var StyledAlphaRange = styled(StyledRange).attrs(function (props) {
|
|
|
383
383
|
background: background$3(props)
|
|
384
384
|
},
|
|
385
385
|
'data-garden-id': COMPONENT_ID$i,
|
|
386
|
-
'data-garden-version': '8.49.
|
|
386
|
+
'data-garden-version': '8.49.3'
|
|
387
387
|
};
|
|
388
388
|
}).withConfig({
|
|
389
389
|
displayName: "StyledAlphaRange",
|
|
@@ -409,7 +409,7 @@ var StyledPreview = styled.div.attrs(function (props) {
|
|
|
409
409
|
background: background$2(props)
|
|
410
410
|
},
|
|
411
411
|
'data-garden-id': COMPONENT_ID$h,
|
|
412
|
-
'data-garden-version': '8.49.
|
|
412
|
+
'data-garden-version': '8.49.3',
|
|
413
413
|
'data-test-id': 'preview-box'
|
|
414
414
|
};
|
|
415
415
|
}).withConfig({
|
|
@@ -445,7 +445,7 @@ var background$1 = function background(props) {
|
|
|
445
445
|
var StyledColorWell = styled.div.attrs(function (props) {
|
|
446
446
|
return {
|
|
447
447
|
'data-garden-id': COMPONENT_ID$g,
|
|
448
|
-
'data-garden-version': '8.49.
|
|
448
|
+
'data-garden-version': '8.49.3',
|
|
449
449
|
'data-test-id': 'colorwell',
|
|
450
450
|
style: {
|
|
451
451
|
background: background$1(props)
|
|
@@ -473,7 +473,7 @@ var sizeStyles$1 = function sizeStyles(theme) {
|
|
|
473
473
|
var StyledColorWellThumb = styled.div.attrs(function (props) {
|
|
474
474
|
return {
|
|
475
475
|
'data-garden-id': COMPONENT_ID$f,
|
|
476
|
-
'data-garden-version': '8.49.
|
|
476
|
+
'data-garden-version': '8.49.3',
|
|
477
477
|
'data-test-id': 'colorwell-thumb',
|
|
478
478
|
style: {
|
|
479
479
|
top: "".concat(props.top, "%"),
|
|
@@ -499,7 +499,7 @@ StyledColorWellThumb.defaultProps = {
|
|
|
499
499
|
var COMPONENT_ID$e = 'colorpickers.colorpicker_slider_group';
|
|
500
500
|
var StyledSliderGroup = styled.div.attrs({
|
|
501
501
|
'data-garden-id': COMPONENT_ID$e,
|
|
502
|
-
'data-garden-version': '8.49.
|
|
502
|
+
'data-garden-version': '8.49.3'
|
|
503
503
|
}).withConfig({
|
|
504
504
|
displayName: "StyledSliderGroup",
|
|
505
505
|
componentId: "sc-rsq0ak-0"
|
|
@@ -515,7 +515,7 @@ StyledSliderGroup.defaultProps = {
|
|
|
515
515
|
var COMPONENT_ID$d = 'colorpickers.colorpicker_hex_field';
|
|
516
516
|
var StyledHexField = styled(Field).attrs({
|
|
517
517
|
'data-garden-id': COMPONENT_ID$d,
|
|
518
|
-
'data-garden-version': '8.49.
|
|
518
|
+
'data-garden-version': '8.49.3',
|
|
519
519
|
spellcheck: false
|
|
520
520
|
}).withConfig({
|
|
521
521
|
displayName: "StyledHexField",
|
|
@@ -530,7 +530,7 @@ StyledHexField.defaultProps = {
|
|
|
530
530
|
var COMPONENT_ID$c = 'colorpickers.colorpicker_label';
|
|
531
531
|
var StyledLabel = styled(Label).attrs({
|
|
532
532
|
'data-garden-id': COMPONENT_ID$c,
|
|
533
|
-
'data-garden-version': '8.49.
|
|
533
|
+
'data-garden-version': '8.49.3'
|
|
534
534
|
}).withConfig({
|
|
535
535
|
displayName: "StyledLabel",
|
|
536
536
|
componentId: "sc-1klhp6m-0"
|
|
@@ -544,7 +544,7 @@ StyledLabel.defaultProps = {
|
|
|
544
544
|
var COMPONENT_ID$b = 'colorpickers.colorpicker_input';
|
|
545
545
|
var StyledInput = styled(Input).attrs({
|
|
546
546
|
'data-garden-id': COMPONENT_ID$b,
|
|
547
|
-
'data-garden-version': '8.49.
|
|
547
|
+
'data-garden-version': '8.49.3',
|
|
548
548
|
focusInset: false
|
|
549
549
|
}).withConfig({
|
|
550
550
|
displayName: "StyledInput",
|
|
@@ -559,7 +559,7 @@ StyledInput.defaultProps = {
|
|
|
559
559
|
var COMPONENT_ID$a = 'colorpickers.colorpicker_input_group';
|
|
560
560
|
var StyledInputGroup = styled.div.attrs({
|
|
561
561
|
'data-garden-id': COMPONENT_ID$a,
|
|
562
|
-
'data-garden-version': '8.49.
|
|
562
|
+
'data-garden-version': '8.49.3'
|
|
563
563
|
}).withConfig({
|
|
564
564
|
displayName: "StyledInputGroup",
|
|
565
565
|
componentId: "sc-mmy93w-0"
|
|
@@ -578,7 +578,7 @@ var sizeStyles = function sizeStyles(theme) {
|
|
|
578
578
|
};
|
|
579
579
|
var StyledRGBAField = styled(Field).attrs({
|
|
580
580
|
'data-garden-id': COMPONENT_ID$9,
|
|
581
|
-
'data-garden-version': '8.49.
|
|
581
|
+
'data-garden-version': '8.49.3'
|
|
582
582
|
}).withConfig({
|
|
583
583
|
displayName: "StyledRGBAField",
|
|
584
584
|
componentId: "sc-ibo1yw-0"
|
|
@@ -594,7 +594,7 @@ StyledRGBAField.defaultProps = {
|
|
|
594
594
|
var COMPONENT_ID$8 = 'colorpickers.colorpicker_sliders';
|
|
595
595
|
var StyledSliders = styled.div.attrs({
|
|
596
596
|
'data-garden-id': COMPONENT_ID$8,
|
|
597
|
-
'data-garden-version': '8.49.
|
|
597
|
+
'data-garden-version': '8.49.3'
|
|
598
598
|
}).withConfig({
|
|
599
599
|
displayName: "StyledSliders",
|
|
600
600
|
componentId: "sc-aclca2-0"
|
|
@@ -615,7 +615,7 @@ var COMPONENT_ID$7 = 'colorpickers.colordialog_button';
|
|
|
615
615
|
var StyledButton = styled(Button).attrs({
|
|
616
616
|
isNeutral: true,
|
|
617
617
|
'data-garden-id': COMPONENT_ID$7,
|
|
618
|
-
'data-garden-version': '8.49.
|
|
618
|
+
'data-garden-version': '8.49.3'
|
|
619
619
|
}).withConfig({
|
|
620
620
|
displayName: "StyledButton",
|
|
621
621
|
componentId: "sc-101xjve-0"
|
|
@@ -662,7 +662,7 @@ var StyledButtonPreview = styled.span.attrs(function (props) {
|
|
|
662
662
|
background: "".concat(background(props), ", ").concat(checkeredBackground(props.theme, 8))
|
|
663
663
|
},
|
|
664
664
|
'data-garden-id': COMPONENT_ID$6,
|
|
665
|
-
'data-garden-version': '8.49.
|
|
665
|
+
'data-garden-version': '8.49.3',
|
|
666
666
|
'data-test-id': 'dialog-preview'
|
|
667
667
|
};
|
|
668
668
|
}).withConfig({
|
|
@@ -690,7 +690,7 @@ StyledButtonPreview.defaultProps = {
|
|
|
690
690
|
var COMPONENT_ID$5 = 'colorpickers.colordialog_tooltipmodal';
|
|
691
691
|
var StyledTooltipModal = styled(TooltipModal).attrs({
|
|
692
692
|
'data-garden-id': COMPONENT_ID$5,
|
|
693
|
-
'data-garden-version': '8.49.
|
|
693
|
+
'data-garden-version': '8.49.3'
|
|
694
694
|
}).withConfig({
|
|
695
695
|
displayName: "StyledTooltipModal",
|
|
696
696
|
componentId: "sc-o022s8-0"
|
|
@@ -704,7 +704,7 @@ StyledTooltipModal.defaultProps = {
|
|
|
704
704
|
var COMPONENT_ID$4 = 'colorpickers.colordialog_tooltipmodal_body';
|
|
705
705
|
var StyledTooltipBody = styled(TooltipModal.Body).attrs({
|
|
706
706
|
'data-garden-id': COMPONENT_ID$4,
|
|
707
|
-
'data-garden-version': '8.49.
|
|
707
|
+
'data-garden-version': '8.49.3'
|
|
708
708
|
}).withConfig({
|
|
709
709
|
displayName: "StyledTooltipBody",
|
|
710
710
|
componentId: "sc-6gsgsy-0"
|
|
@@ -721,7 +721,7 @@ var StyledSwatchButton = styled(StyledButtonPreview).attrs(function (props) {
|
|
|
721
721
|
as: 'button',
|
|
722
722
|
'data-garden-id': COMPONENT_ID$3,
|
|
723
723
|
'data-test-id': props.backgroundColor,
|
|
724
|
-
'data-garden-version': '8.49.
|
|
724
|
+
'data-garden-version': '8.49.3'
|
|
725
725
|
};
|
|
726
726
|
}).withConfig({
|
|
727
727
|
displayName: "StyledSwatchButton",
|
|
@@ -740,7 +740,7 @@ StyledSwatchButton.defaultProps = {
|
|
|
740
740
|
var COMPONENT_ID$2 = 'colorpickers.color_swatch';
|
|
741
741
|
var StyledColorSwatch = styled.table.attrs({
|
|
742
742
|
'data-garden-id': COMPONENT_ID$2,
|
|
743
|
-
'data-garden-version': '8.49.
|
|
743
|
+
'data-garden-version': '8.49.3',
|
|
744
744
|
role: 'grid'
|
|
745
745
|
}).withConfig({
|
|
746
746
|
displayName: "StyledColorSwatch",
|
|
@@ -773,7 +773,7 @@ var StyledIcon = styled(function (_ref) {
|
|
|
773
773
|
return React__default.cloneElement(Children.only(children), props);
|
|
774
774
|
}).attrs({
|
|
775
775
|
'data-garden-id': COMPONENT_ID$1,
|
|
776
|
-
'data-garden-version': '8.49.
|
|
776
|
+
'data-garden-version': '8.49.3'
|
|
777
777
|
}).withConfig({
|
|
778
778
|
displayName: "StyledIcon",
|
|
779
779
|
componentId: "sc-8oigif-0"
|
|
@@ -793,7 +793,7 @@ StyledIcon.defaultProps = {
|
|
|
793
793
|
var COMPONENT_ID = 'colorpickers.swatch_cell';
|
|
794
794
|
var StyledCell = styled.td.attrs({
|
|
795
795
|
'data-garden-id': COMPONENT_ID,
|
|
796
|
-
'data-garden-version': '8.49.
|
|
796
|
+
'data-garden-version': '8.49.3'
|
|
797
797
|
}).withConfig({
|
|
798
798
|
displayName: "StyledCell",
|
|
799
799
|
componentId: "sc-qr3oit-0"
|
|
@@ -1455,17 +1455,20 @@ var ColorpickerDialog = forwardRef(function (_ref, ref) {
|
|
|
1455
1455
|
onChange: isControlled ? onChange : setUncontrolledColor
|
|
1456
1456
|
}))));
|
|
1457
1457
|
});
|
|
1458
|
-
ColorpickerDialog.propTypes = {
|
|
1459
|
-
placement: PropTypes.oneOf(
|
|
1458
|
+
ColorpickerDialog.propTypes = _objectSpread2(_objectSpread2({}, Colorpicker.propTypes), {}, {
|
|
1459
|
+
placement: PropTypes.oneOf(PLACEMENT),
|
|
1460
1460
|
onClose: PropTypes.func,
|
|
1461
|
-
onChange: PropTypes.func,
|
|
1462
1461
|
onDialogChange: PropTypes.func,
|
|
1463
1462
|
disabled: PropTypes.bool,
|
|
1464
1463
|
labels: PropTypes.object,
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1464
|
+
buttonProps: PropTypes.object,
|
|
1465
|
+
popperModifiers: PropTypes.any,
|
|
1466
|
+
zIndex: PropTypes.number,
|
|
1467
|
+
hasArrow: PropTypes.bool,
|
|
1468
|
+
isAnimated: PropTypes.bool,
|
|
1469
|
+
isOpen: PropTypes.bool,
|
|
1470
|
+
focusInset: PropTypes.bool
|
|
1471
|
+
});
|
|
1469
1472
|
ColorpickerDialog.defaultProps = {
|
|
1470
1473
|
placement: 'bottom-start',
|
|
1471
1474
|
isAnimated: true,
|
|
@@ -1708,13 +1711,18 @@ var ColorSwatchDialog = forwardRef(function (_ref, ref) {
|
|
|
1708
1711
|
}
|
|
1709
1712
|
}))));
|
|
1710
1713
|
});
|
|
1711
|
-
ColorSwatchDialog.propTypes = {
|
|
1712
|
-
placement: PropTypes.oneOf(
|
|
1713
|
-
onChange: PropTypes.func,
|
|
1714
|
+
ColorSwatchDialog.propTypes = _objectSpread2(_objectSpread2({}, ColorSwatch.propTypes), {}, {
|
|
1715
|
+
placement: PropTypes.oneOf(PLACEMENT),
|
|
1714
1716
|
onDialogChange: PropTypes.func,
|
|
1715
1717
|
disabled: PropTypes.bool,
|
|
1716
|
-
buttonProps: PropTypes.object
|
|
1717
|
-
|
|
1718
|
+
buttonProps: PropTypes.object,
|
|
1719
|
+
popperModifiers: PropTypes.any,
|
|
1720
|
+
zIndex: PropTypes.number,
|
|
1721
|
+
hasArrow: PropTypes.bool,
|
|
1722
|
+
isAnimated: PropTypes.bool,
|
|
1723
|
+
focusInset: PropTypes.bool,
|
|
1724
|
+
isOpen: PropTypes.bool
|
|
1725
|
+
});
|
|
1718
1726
|
ColorSwatchDialog.defaultProps = {
|
|
1719
1727
|
placement: 'bottom-start',
|
|
1720
1728
|
isAnimated: true,
|
|
@@ -4,43 +4,8 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
-
import React
|
|
8
|
-
|
|
9
|
-
value: string;
|
|
10
|
-
label: string;
|
|
11
|
-
}
|
|
12
|
-
export interface IColorSwatchProps extends Omit<HTMLAttributes<HTMLTableElement>, 'onChange' | 'onSelect'> {
|
|
13
|
-
/** Sets the two-dimension array of labeled HEX and RGB/A string colors */
|
|
14
|
-
colors: ILabeledColor[][];
|
|
15
|
-
/** Sets the focused row index in a controlled color swatch */
|
|
16
|
-
rowIndex?: number;
|
|
17
|
-
/** Sets the focused column index in a controlled color swatch.
|
|
18
|
-
* Can be set to `-1` to clear the row focus.
|
|
19
|
-
*/
|
|
20
|
-
colIndex?: number;
|
|
21
|
-
/** Sets the selected row index in a controlled color swatch.
|
|
22
|
-
* Can be set to `-1` to clear the column focus.
|
|
23
|
-
*/
|
|
24
|
-
selectedRowIndex?: number;
|
|
25
|
-
/** Sets the selected column index in a controlled color swatch.
|
|
26
|
-
* Can be set to `-1` to clear the row selection.
|
|
27
|
-
*/
|
|
28
|
-
selectedColIndex?: number;
|
|
29
|
-
/** Sets the default focused row index in an uncontrolled color swatch.
|
|
30
|
-
* Can be set to `-1` to clear the column selection.
|
|
31
|
-
*/
|
|
32
|
-
defaultRowIndex?: number;
|
|
33
|
-
/** Sets the default focused column index in an uncontrolled color swatch */
|
|
34
|
-
defaultColIndex?: number;
|
|
35
|
-
/** Sets the default selected row index in an uncontrolled color swatch */
|
|
36
|
-
defaultSelectedRowIndex?: number;
|
|
37
|
-
/** Sets the default selected column index in an uncontrolled color swatch */
|
|
38
|
-
defaultSelectedColIndex?: number;
|
|
39
|
-
/** Handles color swatch changes */
|
|
40
|
-
onChange?: (rowIndex: number, colIndex: number) => void;
|
|
41
|
-
/** Handles color swatch select event */
|
|
42
|
-
onSelect?: (rowIndex: number, colIndex: number) => void;
|
|
43
|
-
}
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { IColorSwatchProps } from '../../types';
|
|
44
9
|
/**
|
|
45
10
|
* @extends HTMLAttributes<HTMLTableElement>
|
|
46
11
|
*/
|
|
@@ -4,41 +4,9 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
-
import React
|
|
8
|
-
import {
|
|
9
|
-
import { GARDEN_PLACEMENT } from '@zendeskgarden/react-modals';
|
|
10
|
-
import { IColorSwatchProps } from '../ColorSwatch';
|
|
11
|
-
interface IDialogChanges {
|
|
12
|
-
isOpen?: boolean;
|
|
13
|
-
}
|
|
14
|
-
export interface IColorSwatchDialogProps extends IColorSwatchProps {
|
|
15
|
-
/** Adjusts the placement of the color dialog */
|
|
16
|
-
placement?: GARDEN_PLACEMENT;
|
|
17
|
-
/** Disables the color dialog button */
|
|
18
|
-
disabled?: boolean;
|
|
19
|
-
/** Modifies [Popper instance](https://popper.js.org/docs/v2/modifiers/) to customize positioning logic */
|
|
20
|
-
popperModifiers?: Partial<Modifier<any, any>>[];
|
|
21
|
-
/** Sets the `z-index` of the color dialog */
|
|
22
|
-
zIndex?: number;
|
|
23
|
-
/** Adds an arrow to the color dialog */
|
|
24
|
-
hasArrow?: boolean;
|
|
25
|
-
/** Animates the color dialog */
|
|
26
|
-
isAnimated?: boolean;
|
|
27
|
-
/** Applies inset `box-shadow` styling on focus */
|
|
28
|
-
focusInset?: boolean;
|
|
29
|
-
/** Passes HTML attributes to the color dialog button element */
|
|
30
|
-
buttonProps?: HTMLAttributes<HTMLButtonElement>;
|
|
31
|
-
/** Opens the dialog in a controlled color swatch dialog */
|
|
32
|
-
isOpen?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Handles dialog changes
|
|
35
|
-
*
|
|
36
|
-
* @param {Object} changes The changed dialog state
|
|
37
|
-
*/
|
|
38
|
-
onDialogChange?: (changes: IDialogChanges) => void;
|
|
39
|
-
}
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { IColorSwatchDialogProps } from '../../types';
|
|
40
9
|
/**
|
|
41
10
|
* @extends HTMLAttributes<HTMLDivElement>
|
|
42
11
|
*/
|
|
43
12
|
export declare const ColorSwatchDialog: React.ForwardRefExoticComponent<IColorSwatchDialogProps & React.RefAttributes<HTMLDivElement>>;
|
|
44
|
-
export {};
|
|
@@ -4,34 +4,8 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
-
import React
|
|
8
|
-
import {
|
|
9
|
-
export interface IColorpickerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color' | 'onChange'> {
|
|
10
|
-
/** Sets the color for an uncontrolled color picker */
|
|
11
|
-
defaultColor?: string | IColor;
|
|
12
|
-
/** Sets the color for a controlled color picker */
|
|
13
|
-
color?: string | IColor;
|
|
14
|
-
/** Hides alpha transparency fields */
|
|
15
|
-
isOpaque?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Handles color picker changes
|
|
18
|
-
*
|
|
19
|
-
* @param {Object} color A color picker state
|
|
20
|
-
*/
|
|
21
|
-
onChange?: (color: IColor) => void;
|
|
22
|
-
/** Replaces label text within the color picker */
|
|
23
|
-
labels?: {
|
|
24
|
-
hueSlider?: string;
|
|
25
|
-
alphaSlider?: string;
|
|
26
|
-
hex?: string;
|
|
27
|
-
red?: string;
|
|
28
|
-
green?: string;
|
|
29
|
-
blue?: string;
|
|
30
|
-
alpha?: string;
|
|
31
|
-
};
|
|
32
|
-
/** @ignore */
|
|
33
|
-
autofocus?: boolean;
|
|
34
|
-
}
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { IColorpickerProps } from '../../types';
|
|
35
9
|
/**
|
|
36
10
|
* @extends HTMLAttributes<HTMLDivElement>
|
|
37
11
|
*/
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
-
import { IColor, IHSVColor } from '../../
|
|
7
|
+
import { IColor, IHSVColor } from '../../types';
|
|
8
8
|
declare type ColorPickerActionTypes = {
|
|
9
9
|
type: 'SATURATION_CHANGE';
|
|
10
10
|
payload: IHSVColor;
|
|
@@ -4,60 +4,8 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
-
import React
|
|
8
|
-
import {
|
|
9
|
-
import { GARDEN_PLACEMENT } from '@zendeskgarden/react-modals';
|
|
10
|
-
import { IColorpickerProps } from '../Colorpicker';
|
|
11
|
-
import { IColor } from '../../utils/types';
|
|
12
|
-
export interface IColorpickerDialogChanges {
|
|
13
|
-
isOpen?: boolean;
|
|
14
|
-
}
|
|
15
|
-
export interface IColorpickerDialogProps extends IColorpickerProps {
|
|
16
|
-
/**
|
|
17
|
-
* Handles close actions. Can be triggered from the backdrop.
|
|
18
|
-
*
|
|
19
|
-
* @param {Object} color A color picker state
|
|
20
|
-
*/
|
|
21
|
-
onClose?: (color: IColor) => void;
|
|
22
|
-
/** Adjusts the placement of the color dialog */
|
|
23
|
-
placement?: GARDEN_PLACEMENT;
|
|
24
|
-
/** Disables the color dialog button */
|
|
25
|
-
disabled?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Modifies [Popper instance](https://popper.js.org/docs/v2/modifiers/) to customize positioning logic
|
|
28
|
-
*/
|
|
29
|
-
popperModifiers?: Partial<Modifier<any, any>>[];
|
|
30
|
-
/**
|
|
31
|
-
* Sets the `z-index` of the color dialog
|
|
32
|
-
*/
|
|
33
|
-
zIndex?: number;
|
|
34
|
-
/**
|
|
35
|
-
* Adds an arrow to the color dialog
|
|
36
|
-
*/
|
|
37
|
-
hasArrow?: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Animates the color dialog
|
|
40
|
-
*/
|
|
41
|
-
isAnimated?: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* Opens the dialog in a controlled color picker dialog
|
|
44
|
-
*/
|
|
45
|
-
isOpen?: boolean;
|
|
46
|
-
/**
|
|
47
|
-
* Applies inset `box-shadow` styling on focus
|
|
48
|
-
*/
|
|
49
|
-
focusInset?: boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Passes HTML attributes to the color dialog button element
|
|
52
|
-
*/
|
|
53
|
-
buttonProps?: HTMLAttributes<HTMLButtonElement>;
|
|
54
|
-
/**
|
|
55
|
-
* Handles dialog changes
|
|
56
|
-
*
|
|
57
|
-
* @param {Object} changes The changed dialog state
|
|
58
|
-
*/
|
|
59
|
-
onDialogChange?: (changes: IColorpickerDialogChanges) => void;
|
|
60
|
-
}
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { IColorpickerDialogProps } from '../../types';
|
|
61
9
|
/**
|
|
62
10
|
* @extends HTMLAttributes<HTMLDivElement>
|
|
63
11
|
*/
|
package/dist/typings/index.d.ts
CHANGED
|
@@ -4,12 +4,8 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
-
export type { IColor } from './utils/types';
|
|
8
7
|
export { Colorpicker } from './elements/Colorpicker';
|
|
9
|
-
export type { IColorpickerProps } from './elements/Colorpicker';
|
|
10
8
|
export { ColorpickerDialog } from './elements/ColorpickerDialog';
|
|
11
|
-
export type { IColorpickerDialogProps, IColorpickerDialogChanges } from './elements/ColorpickerDialog';
|
|
12
9
|
export { ColorSwatch } from './elements/ColorSwatch';
|
|
13
|
-
export type { IColorSwatchProps, ILabeledColor } from './elements/ColorSwatch';
|
|
14
10
|
export { ColorSwatchDialog } from './elements/ColorSwatchDialog';
|
|
15
|
-
export type { IColorSwatchDialogProps } from './
|
|
11
|
+
export type { IColor, IColorpickerProps, IColorpickerDialogProps, ILabeledColor, IColorSwatchProps, IColorSwatchDialogProps } from './types';
|
|
@@ -4,11 +4,7 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
-
interface IStyledCell {
|
|
8
|
-
isCompact?: boolean;
|
|
9
|
-
}
|
|
10
7
|
export declare const StyledCell: import("styled-components").StyledComponent<"td", import("styled-components").DefaultTheme, {
|
|
11
8
|
'data-garden-id': string;
|
|
12
9
|
'data-garden-version': string;
|
|
13
|
-
}
|
|
14
|
-
export {};
|
|
10
|
+
}, "data-garden-id" | "data-garden-version">;
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import { DefaultTheme } from 'styled-components';
|
|
8
|
-
import { IRGBColor } from '../../
|
|
8
|
+
import { IRGBColor } from '../../types';
|
|
9
9
|
export declare const StyledAlphaRange: import("styled-components").StyledComponent<"input", DefaultTheme, IRGBColor, never>;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import { DefaultTheme } from 'styled-components';
|
|
8
|
-
import { IRGBColor } from '../../
|
|
8
|
+
import { IRGBColor } from '../../types';
|
|
9
9
|
interface IStyledColorPreviewProps extends IRGBColor {
|
|
10
10
|
isOpaque?: boolean;
|
|
11
11
|
}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import { ThemeProps, DefaultTheme } from 'styled-components';
|
|
8
|
-
import {
|
|
8
|
+
import { IColorpickerDialogProps } from '../../types';
|
|
9
9
|
export interface IStyleButtonPreviewProps extends ThemeProps<DefaultTheme> {
|
|
10
|
-
backgroundColor?:
|
|
10
|
+
backgroundColor?: IColorpickerDialogProps['color'];
|
|
11
11
|
}
|
|
12
12
|
export declare const StyledButtonPreview: import("styled-components").StyledComponent<"span", DefaultTheme, IStyleButtonPreviewProps, never>;
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import { HTMLAttributes } from 'react';
|
|
8
|
+
import { ITooltipModalProps } from '@zendeskgarden/react-modals';
|
|
9
|
+
export interface IColor {
|
|
10
|
+
hex: string;
|
|
11
|
+
hue: number;
|
|
12
|
+
saturation: number;
|
|
13
|
+
lightness: number;
|
|
14
|
+
red: number;
|
|
15
|
+
green: number;
|
|
16
|
+
blue: number;
|
|
17
|
+
alpha: number;
|
|
18
|
+
}
|
|
19
|
+
export interface IHSVColor {
|
|
20
|
+
h: number;
|
|
21
|
+
s: number;
|
|
22
|
+
v: number;
|
|
23
|
+
}
|
|
24
|
+
export interface IHSLColor {
|
|
25
|
+
h: number;
|
|
26
|
+
s: number;
|
|
27
|
+
l: number;
|
|
28
|
+
a?: number;
|
|
29
|
+
}
|
|
30
|
+
export interface IRGBColor {
|
|
31
|
+
red: number;
|
|
32
|
+
green: number;
|
|
33
|
+
blue: number;
|
|
34
|
+
alpha?: number;
|
|
35
|
+
}
|
|
36
|
+
export interface IColorpickerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color' | 'onChange'> {
|
|
37
|
+
/** Sets the color for an uncontrolled color picker */
|
|
38
|
+
defaultColor?: string | IColor;
|
|
39
|
+
/** Sets the color for a controlled color picker */
|
|
40
|
+
color?: string | IColor;
|
|
41
|
+
/** Hides alpha transparency fields */
|
|
42
|
+
isOpaque?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Handles color picker changes
|
|
45
|
+
*
|
|
46
|
+
* @param {Object} color A color picker state
|
|
47
|
+
*/
|
|
48
|
+
onChange?: (color: IColor) => void;
|
|
49
|
+
/** Replaces label text within the color picker */
|
|
50
|
+
labels?: {
|
|
51
|
+
hueSlider?: string;
|
|
52
|
+
alphaSlider?: string;
|
|
53
|
+
hex?: string;
|
|
54
|
+
red?: string;
|
|
55
|
+
green?: string;
|
|
56
|
+
blue?: string;
|
|
57
|
+
alpha?: string;
|
|
58
|
+
};
|
|
59
|
+
/** @ignore */
|
|
60
|
+
autofocus?: boolean;
|
|
61
|
+
}
|
|
62
|
+
export interface IColorpickerDialogProps extends IColorpickerProps {
|
|
63
|
+
/**
|
|
64
|
+
* Handles close actions. Can be triggered from the backdrop.
|
|
65
|
+
*
|
|
66
|
+
* @param {Object} color A color picker state
|
|
67
|
+
*/
|
|
68
|
+
onClose?: (color: IColor) => void;
|
|
69
|
+
/** Adjusts the placement of the color dialog */
|
|
70
|
+
placement?: ITooltipModalProps['placement'];
|
|
71
|
+
/** Disables the color dialog button */
|
|
72
|
+
disabled?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Modifies [Popper instance](https://popper.js.org/docs/v2/modifiers/) to customize positioning logic
|
|
75
|
+
*/
|
|
76
|
+
popperModifiers?: ITooltipModalProps['popperModifiers'];
|
|
77
|
+
/**
|
|
78
|
+
* Sets the `z-index` of the color dialog
|
|
79
|
+
*/
|
|
80
|
+
zIndex?: ITooltipModalProps['zIndex'];
|
|
81
|
+
/**
|
|
82
|
+
* Adds an arrow to the color dialog
|
|
83
|
+
*/
|
|
84
|
+
hasArrow?: ITooltipModalProps['hasArrow'];
|
|
85
|
+
/**
|
|
86
|
+
* Animates the color dialog
|
|
87
|
+
*/
|
|
88
|
+
isAnimated?: ITooltipModalProps['isAnimated'];
|
|
89
|
+
/**
|
|
90
|
+
* Opens the dialog in a controlled color picker dialog
|
|
91
|
+
*/
|
|
92
|
+
isOpen?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Applies inset `box-shadow` styling on focus
|
|
95
|
+
*/
|
|
96
|
+
focusInset?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Passes HTML attributes to the color dialog button element
|
|
99
|
+
*/
|
|
100
|
+
buttonProps?: HTMLAttributes<HTMLButtonElement>;
|
|
101
|
+
/**
|
|
102
|
+
* Handles dialog changes
|
|
103
|
+
*
|
|
104
|
+
* @param {Object} changes The changed dialog state
|
|
105
|
+
*/
|
|
106
|
+
onDialogChange?: (changes: {
|
|
107
|
+
isOpen: boolean;
|
|
108
|
+
}) => void;
|
|
109
|
+
}
|
|
110
|
+
export interface ILabeledColor {
|
|
111
|
+
value: string;
|
|
112
|
+
label: string;
|
|
113
|
+
}
|
|
114
|
+
export interface IColorSwatchProps extends Omit<HTMLAttributes<HTMLTableElement>, 'onChange' | 'onSelect'> {
|
|
115
|
+
/** Sets the two-dimension array of labeled HEX and RGB/A string colors */
|
|
116
|
+
colors: {
|
|
117
|
+
value: string;
|
|
118
|
+
label: string;
|
|
119
|
+
}[][];
|
|
120
|
+
/** Sets the focused row index in a controlled color swatch */
|
|
121
|
+
rowIndex?: number;
|
|
122
|
+
/** Sets the focused column index in a controlled color swatch.
|
|
123
|
+
* Can be set to `-1` to clear the row focus.
|
|
124
|
+
*/
|
|
125
|
+
colIndex?: number;
|
|
126
|
+
/** Sets the selected row index in a controlled color swatch.
|
|
127
|
+
* Can be set to `-1` to clear the column focus.
|
|
128
|
+
*/
|
|
129
|
+
selectedRowIndex?: number;
|
|
130
|
+
/** Sets the selected column index in a controlled color swatch.
|
|
131
|
+
* Can be set to `-1` to clear the row selection.
|
|
132
|
+
*/
|
|
133
|
+
selectedColIndex?: number;
|
|
134
|
+
/** Sets the default focused row index in an uncontrolled color swatch.
|
|
135
|
+
* Can be set to `-1` to clear the column selection.
|
|
136
|
+
*/
|
|
137
|
+
defaultRowIndex?: number;
|
|
138
|
+
/** Sets the default focused column index in an uncontrolled color swatch */
|
|
139
|
+
defaultColIndex?: number;
|
|
140
|
+
/** Sets the default selected row index in an uncontrolled color swatch */
|
|
141
|
+
defaultSelectedRowIndex?: number;
|
|
142
|
+
/** Sets the default selected column index in an uncontrolled color swatch */
|
|
143
|
+
defaultSelectedColIndex?: number;
|
|
144
|
+
/** Handles color swatch changes */
|
|
145
|
+
onChange?: (rowIndex: number, colIndex: number) => void;
|
|
146
|
+
/** Handles color swatch select event */
|
|
147
|
+
onSelect?: (rowIndex: number, colIndex: number) => void;
|
|
148
|
+
}
|
|
149
|
+
export interface IColorSwatchDialogProps extends IColorSwatchProps {
|
|
150
|
+
/** Adjusts the placement of the color dialog */
|
|
151
|
+
placement?: ITooltipModalProps['placement'];
|
|
152
|
+
/** Disables the color dialog button */
|
|
153
|
+
disabled?: boolean;
|
|
154
|
+
/** Modifies [Popper instance](https://popper.js.org/docs/v2/modifiers/) to customize positioning logic */
|
|
155
|
+
popperModifiers?: ITooltipModalProps['popperModifiers'];
|
|
156
|
+
/** Sets the `z-index` of the color dialog */
|
|
157
|
+
zIndex?: ITooltipModalProps['zIndex'];
|
|
158
|
+
/** Adds an arrow to the color dialog */
|
|
159
|
+
hasArrow?: ITooltipModalProps['hasArrow'];
|
|
160
|
+
/** Animates the color dialog */
|
|
161
|
+
isAnimated?: ITooltipModalProps['isAnimated'];
|
|
162
|
+
/** Applies inset `box-shadow` styling on focus */
|
|
163
|
+
focusInset?: boolean;
|
|
164
|
+
/** Passes HTML attributes to the color dialog button element */
|
|
165
|
+
buttonProps?: HTMLAttributes<HTMLButtonElement>;
|
|
166
|
+
/** Opens the dialog in a controlled color swatch dialog */
|
|
167
|
+
isOpen?: boolean;
|
|
168
|
+
/**
|
|
169
|
+
* Handles dialog changes
|
|
170
|
+
*
|
|
171
|
+
* @param {Object} changes The changed dialog state
|
|
172
|
+
*/
|
|
173
|
+
onDialogChange?: (changes: {
|
|
174
|
+
isOpen: boolean;
|
|
175
|
+
}) => void;
|
|
176
|
+
}
|
|
@@ -4,12 +4,10 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
-
import { IHSVColor } from '../
|
|
7
|
+
import { IHSVColor } from '../types';
|
|
8
8
|
export declare function limit(value: number, max: number, min?: number): number;
|
|
9
9
|
export declare function getNextHsv(e: MouseEvent, hue: number, container: HTMLDivElement, rtl: boolean): IHSVColor;
|
|
10
|
-
declare
|
|
10
|
+
export declare const getThumbPosition: (x: number, y: number, rtl: boolean, container: React.RefObject<HTMLDivElement>) => {
|
|
11
11
|
topFromMouse: number;
|
|
12
12
|
leftFromMouse: number;
|
|
13
13
|
};
|
|
14
|
-
export declare const getThumbPosition: GET_THUMB_POSITION;
|
|
15
|
-
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-colorpickers",
|
|
3
|
-
"version": "8.49.
|
|
3
|
+
"version": "8.49.3",
|
|
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>",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"@popperjs/core": "^2.4.4",
|
|
25
25
|
"@zendeskgarden/container-grid": "^0.1.1",
|
|
26
26
|
"@zendeskgarden/container-utilities": "^0.7.0",
|
|
27
|
-
"@zendeskgarden/react-buttons": "^8.49.
|
|
28
|
-
"@zendeskgarden/react-forms": "^8.49.
|
|
29
|
-
"@zendeskgarden/react-modals": "^8.49.
|
|
30
|
-
"@zendeskgarden/react-tooltips": "^8.49.
|
|
27
|
+
"@zendeskgarden/react-buttons": "^8.49.3",
|
|
28
|
+
"@zendeskgarden/react-forms": "^8.49.3",
|
|
29
|
+
"@zendeskgarden/react-modals": "^8.49.3",
|
|
30
|
+
"@zendeskgarden/react-tooltips": "^8.49.3",
|
|
31
31
|
"lodash.isequal": "^4.5.0",
|
|
32
32
|
"lodash.throttle": "^4.1.1",
|
|
33
33
|
"polished": "^4.0.0",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/lodash.isequal": "4.5.5",
|
|
45
45
|
"@types/lodash.throttle": "4.1.6",
|
|
46
|
-
"@zendeskgarden/react-theming": "^8.49.
|
|
47
|
-
"@zendeskgarden/svg-icons": "6.
|
|
46
|
+
"@zendeskgarden/react-theming": "^8.49.3",
|
|
47
|
+
"@zendeskgarden/svg-icons": "6.31.1"
|
|
48
48
|
},
|
|
49
49
|
"keywords": [
|
|
50
50
|
"colorpicker",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"access": "public"
|
|
58
58
|
},
|
|
59
59
|
"zendeskgarden:src": "src/index.ts",
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "983322364971c051ca6ce478770edfc3310e4c4b"
|
|
61
61
|
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright Zendesk, Inc.
|
|
3
|
-
*
|
|
4
|
-
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
-
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
-
*/
|
|
7
|
-
export interface IColor {
|
|
8
|
-
hex: string;
|
|
9
|
-
hue: number;
|
|
10
|
-
saturation: number;
|
|
11
|
-
lightness: number;
|
|
12
|
-
red: number;
|
|
13
|
-
green: number;
|
|
14
|
-
blue: number;
|
|
15
|
-
alpha: number;
|
|
16
|
-
}
|
|
17
|
-
export interface IHSVColor {
|
|
18
|
-
h: number;
|
|
19
|
-
s: number;
|
|
20
|
-
v: number;
|
|
21
|
-
}
|
|
22
|
-
export interface IHSLColor {
|
|
23
|
-
h: number;
|
|
24
|
-
s: number;
|
|
25
|
-
l: number;
|
|
26
|
-
a?: number;
|
|
27
|
-
}
|
|
28
|
-
export interface IRGBColor {
|
|
29
|
-
red: number;
|
|
30
|
-
green: number;
|
|
31
|
-
blue: number;
|
|
32
|
-
alpha?: number;
|
|
33
|
-
}
|