@zendeskgarden/react-colorpickers 9.0.0-next.22 → 9.0.0-next.23
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/esm/elements/ColorPicker/ColorWell.js +10 -12
- package/dist/esm/elements/ColorPicker/index.js +1 -1
- package/dist/esm/elements/ColorPickerDialog/index.js +2 -2
- package/dist/esm/elements/ColorSwatch/index.js +63 -61
- package/dist/esm/elements/ColorSwatchDialog/index.js +2 -2
- package/dist/esm/styled/ColorPicker/StyledAlphaRange.js +1 -1
- package/dist/esm/styled/ColorPicker/StyledColorPicker.js +1 -1
- package/dist/esm/styled/ColorPicker/StyledColorWell.js +1 -1
- package/dist/esm/styled/ColorPicker/StyledColorWellThumb.js +1 -1
- package/dist/esm/styled/ColorPicker/StyledHexField.js +1 -1
- package/dist/esm/styled/ColorPicker/StyledHueRange.js +1 -1
- package/dist/esm/styled/ColorPicker/StyledInput.js +1 -1
- package/dist/esm/styled/ColorPicker/StyledInputGroup.js +1 -1
- package/dist/esm/styled/ColorPicker/StyledLabel.js +1 -1
- package/dist/esm/styled/ColorPicker/StyledPreview.js +1 -1
- package/dist/esm/styled/ColorPicker/StyledRGBAField.js +1 -1
- package/dist/esm/styled/ColorPicker/StyledSliderGroup.js +1 -1
- package/dist/esm/styled/ColorPicker/StyledSliders.js +1 -1
- package/dist/esm/styled/ColorPickerDialog/StyledButton.js +1 -1
- package/dist/esm/styled/ColorPickerDialog/StyledButtonPreview.js +1 -1
- package/dist/esm/styled/ColorPickerDialog/StyledTooltipBody.js +4 -4
- package/dist/esm/styled/ColorPickerDialog/{StyledTooltipModal.js → StyledTooltipDialog.js} +8 -8
- package/dist/esm/styled/ColorSwatch/StyledCell.js +1 -1
- package/dist/esm/styled/ColorSwatch/StyledColorSwatch.js +1 -1
- package/dist/esm/styled/ColorSwatch/StyledColorSwatchInput.js +1 -1
- package/dist/esm/styled/ColorSwatch/StyledColorSwatchLabel.js +1 -1
- package/dist/esm/styled/ColorSwatch/StyledIcon.js +1 -1
- package/dist/esm/styled/common/StyledRange.js +1 -1
- package/dist/index.cjs.js +103 -103
- package/dist/typings/styled/ColorPickerDialog/{StyledTooltipModal.d.ts → StyledTooltipDialog.d.ts} +2 -2
- package/dist/typings/styled/index.d.ts +1 -1
- package/dist/typings/types/index.d.ts +9 -9
- package/package.json +10 -10
|
@@ -24,7 +24,7 @@ import '../../styled/ColorPicker/StyledRGBAField.js';
|
|
|
24
24
|
import '../../styled/ColorPicker/StyledSliders.js';
|
|
25
25
|
import '../../styled/ColorPickerDialog/StyledButton.js';
|
|
26
26
|
import '../../styled/ColorPickerDialog/StyledButtonPreview.js';
|
|
27
|
-
import '../../styled/ColorPickerDialog/
|
|
27
|
+
import '../../styled/ColorPickerDialog/StyledTooltipDialog.js';
|
|
28
28
|
import '../../styled/ColorPickerDialog/StyledTooltipBody.js';
|
|
29
29
|
import '../../styled/ColorSwatch/StyledColorSwatch.js';
|
|
30
30
|
import '../../styled/ColorSwatch/StyledColorSwatchInput.js';
|
|
@@ -93,17 +93,15 @@ const ColorWell = React__default.memo(_ref => {
|
|
|
93
93
|
throttledChange.cancel();
|
|
94
94
|
};
|
|
95
95
|
}, [throttledChange]);
|
|
96
|
-
return (
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}))
|
|
106
|
-
);
|
|
96
|
+
return React__default.createElement(StyledColorWell, {
|
|
97
|
+
$hue: hue,
|
|
98
|
+
ref: containerRef,
|
|
99
|
+
role: "presentation",
|
|
100
|
+
onMouseDown: handleMouseDown
|
|
101
|
+
}, React__default.createElement(StyledColorWellThumb, {
|
|
102
|
+
top: mouseActiveRef.current ? topFromMouse : topPosition,
|
|
103
|
+
left: mouseActiveRef.current ? leftFromMouse : leftPosition
|
|
104
|
+
}));
|
|
107
105
|
});
|
|
108
106
|
ColorWell.displayName = 'ColorWell';
|
|
109
107
|
|
|
@@ -23,7 +23,7 @@ import { StyledRGBAField } from '../../styled/ColorPicker/StyledRGBAField.js';
|
|
|
23
23
|
import { StyledSliders } from '../../styled/ColorPicker/StyledSliders.js';
|
|
24
24
|
import '../../styled/ColorPickerDialog/StyledButton.js';
|
|
25
25
|
import '../../styled/ColorPickerDialog/StyledButtonPreview.js';
|
|
26
|
-
import '../../styled/ColorPickerDialog/
|
|
26
|
+
import '../../styled/ColorPickerDialog/StyledTooltipDialog.js';
|
|
27
27
|
import '../../styled/ColorPickerDialog/StyledTooltipBody.js';
|
|
28
28
|
import '../../styled/ColorSwatch/StyledColorSwatch.js';
|
|
29
29
|
import '../../styled/ColorSwatch/StyledColorSwatchInput.js';
|
|
@@ -26,7 +26,7 @@ import '../../styled/ColorPicker/StyledRGBAField.js';
|
|
|
26
26
|
import '../../styled/ColorPicker/StyledSliders.js';
|
|
27
27
|
import { StyledButton } from '../../styled/ColorPickerDialog/StyledButton.js';
|
|
28
28
|
import { StyledButtonPreview } from '../../styled/ColorPickerDialog/StyledButtonPreview.js';
|
|
29
|
-
import {
|
|
29
|
+
import { StyledTooltipDialog } from '../../styled/ColorPickerDialog/StyledTooltipDialog.js';
|
|
30
30
|
import { StyledTooltipBody } from '../../styled/ColorPickerDialog/StyledTooltipBody.js';
|
|
31
31
|
import '../../styled/ColorSwatch/StyledColorSwatch.js';
|
|
32
32
|
import '../../styled/ColorSwatch/StyledColorSwatchInput.js';
|
|
@@ -105,7 +105,7 @@ const ColorPickerDialog = forwardRef((_ref, ref) => {
|
|
|
105
105
|
$backgroundColor: isControlled ? color : uncontrolledColor
|
|
106
106
|
}), React__default.createElement(Button.EndIcon, {
|
|
107
107
|
isRotated: referenceElement != null
|
|
108
|
-
}, React__default.createElement(SvgChevronDownStroke, null))), React__default.createElement(
|
|
108
|
+
}, React__default.createElement(SvgChevronDownStroke, null))), React__default.createElement(StyledTooltipDialog, Object.assign({
|
|
109
109
|
ref: ref,
|
|
110
110
|
hasArrow: hasArrow,
|
|
111
111
|
zIndex: zIndex,
|
|
@@ -27,7 +27,7 @@ import '../../styled/ColorPicker/StyledRGBAField.js';
|
|
|
27
27
|
import '../../styled/ColorPicker/StyledSliders.js';
|
|
28
28
|
import '../../styled/ColorPickerDialog/StyledButton.js';
|
|
29
29
|
import '../../styled/ColorPickerDialog/StyledButtonPreview.js';
|
|
30
|
-
import '../../styled/ColorPickerDialog/
|
|
30
|
+
import '../../styled/ColorPickerDialog/StyledTooltipDialog.js';
|
|
31
31
|
import '../../styled/ColorPickerDialog/StyledTooltipBody.js';
|
|
32
32
|
import { StyledColorSwatch } from '../../styled/ColorSwatch/StyledColorSwatch.js';
|
|
33
33
|
import { StyledColorSwatchInput } from '../../styled/ColorSwatch/StyledColorSwatchInput.js';
|
|
@@ -70,69 +70,71 @@ const ColorSwatch = forwardRef((_ref, ref) => {
|
|
|
70
70
|
setColIndex(col);
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
|
-
return
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
if (
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
if (isCheckboxGroup && event.target.checked) {
|
|
101
|
-
const inputs = gridRef.current?.querySelectorAll('input');
|
|
102
|
-
inputs?.forEach(input => {
|
|
103
|
-
if (input !== event.target) {
|
|
104
|
-
input.checked = false;
|
|
73
|
+
return (
|
|
74
|
+
React__default.createElement(StyledColorSwatch, Object.assign({
|
|
75
|
+
role: "grid",
|
|
76
|
+
ref: mergeRefs([gridRef, ref])
|
|
77
|
+
}, props), React__default.createElement("tbody", null, colors.map((row, _rowIndex) => React__default.createElement("tr", {
|
|
78
|
+
key: row[0].value
|
|
79
|
+
}, row.map((color, _colIndex) => {
|
|
80
|
+
const {
|
|
81
|
+
label,
|
|
82
|
+
value
|
|
83
|
+
} = color;
|
|
84
|
+
const {
|
|
85
|
+
role,
|
|
86
|
+
...gridCellProps
|
|
87
|
+
} = getGridCellProps({
|
|
88
|
+
colIndex: _colIndex,
|
|
89
|
+
rowIndex: _rowIndex
|
|
90
|
+
});
|
|
91
|
+
const checked = isControlled ? selectedRowIndex === _rowIndex && selectedColIndex === _colIndex : undefined;
|
|
92
|
+
const defaultChecked = isControlled ? undefined : defaultSelectedRowIndex === _rowIndex && defaultSelectedColIndex === _colIndex;
|
|
93
|
+
const handleChange = event => {
|
|
94
|
+
if (onSelect) {
|
|
95
|
+
if (event.target.checked) {
|
|
96
|
+
onSelect(_rowIndex, _colIndex);
|
|
97
|
+
} else {
|
|
98
|
+
onSelect(null, null);
|
|
105
99
|
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
};
|
|
109
|
-
const handleBlur = event => {
|
|
110
|
-
if (!(isCheckboxGroup || gridRef.current?.contains(event.relatedTarget))) {
|
|
111
|
-
const selectedInput = gridRef.current?.querySelector(`input[name='${event.target.name}']:checked`);
|
|
112
|
-
if (selectedInput !== null) {
|
|
100
|
+
}
|
|
101
|
+
if (isCheckboxGroup && event.target.checked) {
|
|
113
102
|
const inputs = gridRef.current?.querySelectorAll('input');
|
|
114
|
-
inputs?.forEach(input =>
|
|
103
|
+
inputs?.forEach(input => {
|
|
104
|
+
if (input !== event.target) {
|
|
105
|
+
input.checked = false;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
const handleBlur = event => {
|
|
111
|
+
if (!(isCheckboxGroup || gridRef.current?.contains(event.relatedTarget))) {
|
|
112
|
+
const selectedInput = gridRef.current?.querySelector(`input[name='${event.target.name}']:checked`);
|
|
113
|
+
if (selectedInput !== null) {
|
|
114
|
+
const inputs = gridRef.current?.querySelectorAll('input');
|
|
115
|
+
inputs?.forEach(input => input.setAttribute('tabIndex', input.checked ? '0' : '-1'));
|
|
116
|
+
}
|
|
115
117
|
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
|
|
118
|
+
};
|
|
119
|
+
return React__default.createElement(StyledCell, {
|
|
120
|
+
key: value,
|
|
121
|
+
role: role
|
|
122
|
+
}, React__default.createElement(StyledColorSwatchLabel, {
|
|
123
|
+
$backgroundColor: value
|
|
124
|
+
}, React__default.createElement(Tooltip, {
|
|
125
|
+
content: label
|
|
126
|
+
}, React__default.createElement(StyledColorSwatchInput, Object.assign({
|
|
127
|
+
"aria-label": label,
|
|
128
|
+
name: name,
|
|
129
|
+
type: isCheckboxGroup ? 'checkbox' : 'radio',
|
|
130
|
+
value: value,
|
|
131
|
+
defaultChecked: defaultChecked,
|
|
132
|
+
checked: checked,
|
|
133
|
+
onBlur: handleBlur,
|
|
134
|
+
onChange: handleChange
|
|
135
|
+
}, gridCellProps))), React__default.createElement(StyledIcon, null)));
|
|
136
|
+
})))))
|
|
137
|
+
);
|
|
136
138
|
});
|
|
137
139
|
ColorSwatch.displayName = 'ColorSwatch';
|
|
138
140
|
ColorSwatch.propTypes = {
|
|
@@ -27,7 +27,7 @@ import '../../styled/ColorPicker/StyledRGBAField.js';
|
|
|
27
27
|
import '../../styled/ColorPicker/StyledSliders.js';
|
|
28
28
|
import { StyledButton } from '../../styled/ColorPickerDialog/StyledButton.js';
|
|
29
29
|
import { StyledButtonPreview } from '../../styled/ColorPickerDialog/StyledButtonPreview.js';
|
|
30
|
-
import {
|
|
30
|
+
import { StyledTooltipDialog } from '../../styled/ColorPickerDialog/StyledTooltipDialog.js';
|
|
31
31
|
import { StyledTooltipBody } from '../../styled/ColorPickerDialog/StyledTooltipBody.js';
|
|
32
32
|
import '../../styled/ColorSwatch/StyledColorSwatch.js';
|
|
33
33
|
import '../../styled/ColorSwatch/StyledColorSwatchInput.js';
|
|
@@ -134,7 +134,7 @@ const ColorSwatchDialog = forwardRef((_ref, ref) => {
|
|
|
134
134
|
$backgroundColor: backgroundColor
|
|
135
135
|
}), React__default.createElement(Button.EndIcon, {
|
|
136
136
|
isRotated: referenceElement !== null
|
|
137
|
-
}, React__default.createElement(SvgChevronDownStroke, null))), React__default.createElement(
|
|
137
|
+
}, React__default.createElement(SvgChevronDownStroke, null))), React__default.createElement(StyledTooltipDialog, Object.assign({
|
|
138
138
|
ref: ref,
|
|
139
139
|
zIndex: zIndex,
|
|
140
140
|
hasArrow: hasArrow,
|
|
@@ -30,7 +30,7 @@ const StyledAlphaRange = styled(StyledRange).attrs(props => ({
|
|
|
30
30
|
background: background(props)
|
|
31
31
|
},
|
|
32
32
|
'data-garden-id': COMPONENT_ID,
|
|
33
|
-
'data-garden-version': '9.0.0-next.
|
|
33
|
+
'data-garden-version': '9.0.0-next.23'
|
|
34
34
|
})).withConfig({
|
|
35
35
|
displayName: "StyledAlphaRange",
|
|
36
36
|
componentId: "sc-1f6hp2j-0"
|
|
@@ -13,7 +13,7 @@ const getColorPickerWidth = props => {
|
|
|
13
13
|
};
|
|
14
14
|
const StyledColorPicker = styled.div.attrs({
|
|
15
15
|
'data-garden-id': COMPONENT_ID,
|
|
16
|
-
'data-garden-version': '9.0.0-next.
|
|
16
|
+
'data-garden-version': '9.0.0-next.23'
|
|
17
17
|
}).withConfig({
|
|
18
18
|
displayName: "StyledColorPicker",
|
|
19
19
|
componentId: "sc-gspq4q-0"
|
|
@@ -20,7 +20,7 @@ const background = props => {
|
|
|
20
20
|
};
|
|
21
21
|
const StyledColorWell = styled.div.attrs(props => ({
|
|
22
22
|
'data-garden-id': COMPONENT_ID,
|
|
23
|
-
'data-garden-version': '9.0.0-next.
|
|
23
|
+
'data-garden-version': '9.0.0-next.23',
|
|
24
24
|
'data-test-id': 'colorwell',
|
|
25
25
|
style: {
|
|
26
26
|
background: background(props)
|
|
@@ -34,7 +34,7 @@ const sizeStyles = _ref2 => {
|
|
|
34
34
|
};
|
|
35
35
|
const StyledColorWellThumb = styled.div.attrs(props => ({
|
|
36
36
|
'data-garden-id': COMPONENT_ID,
|
|
37
|
-
'data-garden-version': '9.0.0-next.
|
|
37
|
+
'data-garden-version': '9.0.0-next.23',
|
|
38
38
|
'data-test-id': 'colorwell-thumb',
|
|
39
39
|
style: {
|
|
40
40
|
top: `${props.top}%`,
|
|
@@ -11,7 +11,7 @@ import { Field } from '@zendeskgarden/react-forms';
|
|
|
11
11
|
const COMPONENT_ID = 'colorpickers.colorpicker_hex_field';
|
|
12
12
|
const StyledHexField = styled(Field).attrs({
|
|
13
13
|
'data-garden-id': COMPONENT_ID,
|
|
14
|
-
'data-garden-version': '9.0.0-next.
|
|
14
|
+
'data-garden-version': '9.0.0-next.23',
|
|
15
15
|
spellcheck: false
|
|
16
16
|
}).withConfig({
|
|
17
17
|
displayName: "StyledHexField",
|
|
@@ -11,7 +11,7 @@ import { StyledRange, getTrackMargin, getTrackHeight } from '../common/StyledRan
|
|
|
11
11
|
const COMPONENT_ID = 'colorpickers.colorpicker_hue';
|
|
12
12
|
const StyledHueRange = styled(StyledRange).attrs({
|
|
13
13
|
'data-garden-id': COMPONENT_ID,
|
|
14
|
-
'data-garden-version': '9.0.0-next.
|
|
14
|
+
'data-garden-version': '9.0.0-next.23'
|
|
15
15
|
}).withConfig({
|
|
16
16
|
displayName: "StyledHueRange",
|
|
17
17
|
componentId: "sc-1gdhww1-0"
|
|
@@ -11,7 +11,7 @@ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-the
|
|
|
11
11
|
const COMPONENT_ID = 'colorpickers.colorpicker_input';
|
|
12
12
|
const StyledInput = styled(Input).attrs({
|
|
13
13
|
'data-garden-id': COMPONENT_ID,
|
|
14
|
-
'data-garden-version': '9.0.0-next.
|
|
14
|
+
'data-garden-version': '9.0.0-next.23',
|
|
15
15
|
focusInset: false
|
|
16
16
|
}).withConfig({
|
|
17
17
|
displayName: "StyledInput",
|
|
@@ -10,7 +10,7 @@ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-the
|
|
|
10
10
|
const COMPONENT_ID = 'colorpickers.colorpicker_input_group';
|
|
11
11
|
const StyledInputGroup = styled.div.attrs({
|
|
12
12
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.0.0-next.
|
|
13
|
+
'data-garden-version': '9.0.0-next.23'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledInputGroup",
|
|
16
16
|
componentId: "sc-1m9g2wg-0"
|
|
@@ -11,7 +11,7 @@ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-the
|
|
|
11
11
|
const COMPONENT_ID = 'colorpickers.colorpicker_label';
|
|
12
12
|
const StyledLabel = styled(Label).attrs({
|
|
13
13
|
'data-garden-id': COMPONENT_ID,
|
|
14
|
-
'data-garden-version': '9.0.0-next.
|
|
14
|
+
'data-garden-version': '9.0.0-next.23'
|
|
15
15
|
}).withConfig({
|
|
16
16
|
displayName: "StyledLabel",
|
|
17
17
|
componentId: "sc-1vxt3m9-0"
|
|
@@ -26,7 +26,7 @@ const StyledPreview = styled.div.attrs(props => ({
|
|
|
26
26
|
background: background(props)
|
|
27
27
|
},
|
|
28
28
|
'data-garden-id': COMPONENT_ID,
|
|
29
|
-
'data-garden-version': '9.0.0-next.
|
|
29
|
+
'data-garden-version': '9.0.0-next.23',
|
|
30
30
|
'data-test-id': 'preview-box'
|
|
31
31
|
})).withConfig({
|
|
32
32
|
displayName: "StyledPreview",
|
|
@@ -20,7 +20,7 @@ const sizeStyles = theme => {
|
|
|
20
20
|
};
|
|
21
21
|
const StyledRGBAField = styled(Field).attrs({
|
|
22
22
|
'data-garden-id': COMPONENT_ID,
|
|
23
|
-
'data-garden-version': '9.0.0-next.
|
|
23
|
+
'data-garden-version': '9.0.0-next.23'
|
|
24
24
|
}).withConfig({
|
|
25
25
|
displayName: "StyledRGBAField",
|
|
26
26
|
componentId: "sc-13266k8-0"
|
|
@@ -10,7 +10,7 @@ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-the
|
|
|
10
10
|
const COMPONENT_ID = 'colorpickers.colorpicker_slider_group';
|
|
11
11
|
const StyledSliderGroup = styled.div.attrs({
|
|
12
12
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.0.0-next.
|
|
13
|
+
'data-garden-version': '9.0.0-next.23'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledSliderGroup",
|
|
16
16
|
componentId: "sc-tigkzg-0"
|
|
@@ -33,7 +33,7 @@ const sizeStyles = props => {
|
|
|
33
33
|
};
|
|
34
34
|
const StyledSliders = styled.div.attrs({
|
|
35
35
|
'data-garden-id': COMPONENT_ID,
|
|
36
|
-
'data-garden-version': '9.0.0-next.
|
|
36
|
+
'data-garden-version': '9.0.0-next.23'
|
|
37
37
|
}).withConfig({
|
|
38
38
|
displayName: "StyledSliders",
|
|
39
39
|
componentId: "sc-1lgr50m-0"
|
|
@@ -10,7 +10,7 @@ import { Button } from '@zendeskgarden/react-buttons';
|
|
|
10
10
|
|
|
11
11
|
const StyledButton = styled(Button).attrs({
|
|
12
12
|
isNeutral: true,
|
|
13
|
-
'data-garden-version': '9.0.0-next.
|
|
13
|
+
'data-garden-version': '9.0.0-next.23'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledButton",
|
|
16
16
|
componentId: "sc-1dlijfv-0"
|
|
@@ -39,7 +39,7 @@ const StyledButtonPreview = styled.span.attrs(props => ({
|
|
|
39
39
|
})
|
|
40
40
|
},
|
|
41
41
|
'data-garden-id': COMPONENT_ID,
|
|
42
|
-
'data-garden-version': '9.0.0-next.
|
|
42
|
+
'data-garden-version': '9.0.0-next.23',
|
|
43
43
|
'data-test-id': 'dialog-preview'
|
|
44
44
|
})).withConfig({
|
|
45
45
|
displayName: "StyledButtonPreview",
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import {
|
|
8
|
+
import { TooltipDialog } from '@zendeskgarden/react-modals';
|
|
9
9
|
import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
10
10
|
|
|
11
|
-
const COMPONENT_ID = 'colorpickers.
|
|
12
|
-
const StyledTooltipBody = styled(
|
|
11
|
+
const COMPONENT_ID = 'colorpickers.colordialog_tooltipdialog_body';
|
|
12
|
+
const StyledTooltipBody = styled(TooltipDialog.Body).attrs({
|
|
13
13
|
'data-garden-id': COMPONENT_ID,
|
|
14
|
-
'data-garden-version': '9.0.0-next.
|
|
14
|
+
'data-garden-version': '9.0.0-next.23'
|
|
15
15
|
}).withConfig({
|
|
16
16
|
displayName: "StyledTooltipBody",
|
|
17
17
|
componentId: "sc-1ueddpo-0"
|
|
@@ -5,19 +5,19 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import {
|
|
8
|
+
import { TooltipDialog } from '@zendeskgarden/react-modals';
|
|
9
9
|
import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
10
10
|
|
|
11
|
-
const COMPONENT_ID = 'colorpickers.
|
|
12
|
-
const
|
|
11
|
+
const COMPONENT_ID = 'colorpickers.colordialog_tooltipdialog';
|
|
12
|
+
const StyledTooltipDialog = styled(TooltipDialog).attrs({
|
|
13
13
|
'data-garden-id': COMPONENT_ID,
|
|
14
|
-
'data-garden-version': '9.0.0-next.
|
|
14
|
+
'data-garden-version': '9.0.0-next.23'
|
|
15
15
|
}).withConfig({
|
|
16
|
-
displayName: "
|
|
17
|
-
componentId: "sc-
|
|
16
|
+
displayName: "StyledTooltipDialog",
|
|
17
|
+
componentId: "sc-1vbkccl-0"
|
|
18
18
|
})(["width:auto !important;", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
19
|
-
|
|
19
|
+
StyledTooltipDialog.defaultProps = {
|
|
20
20
|
theme: DEFAULT_THEME
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
export {
|
|
23
|
+
export { StyledTooltipDialog };
|
|
@@ -10,7 +10,7 @@ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-the
|
|
|
10
10
|
const COMPONENT_ID = 'colorpickers.swatch_cell';
|
|
11
11
|
const StyledCell = styled.td.attrs({
|
|
12
12
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.0.0-next.
|
|
13
|
+
'data-garden-version': '9.0.0-next.23'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledCell",
|
|
16
16
|
componentId: "sc-qr3oit-0"
|
|
@@ -10,7 +10,7 @@ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-the
|
|
|
10
10
|
const COMPONENT_ID = 'colorpickers.color_swatch';
|
|
11
11
|
const StyledColorSwatch = styled.table.attrs({
|
|
12
12
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.0.0-next.
|
|
13
|
+
'data-garden-version': '9.0.0-next.23'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledColorSwatch",
|
|
16
16
|
componentId: "sc-ajx440-0"
|
|
@@ -10,7 +10,7 @@ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-the
|
|
|
10
10
|
const COMPONENT_ID = 'colorpickers.color_swatch_input';
|
|
11
11
|
const StyledColorSwatchInput = styled.input.attrs({
|
|
12
12
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.0.0-next.
|
|
13
|
+
'data-garden-version': '9.0.0-next.23'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledColorSwatchInput",
|
|
16
16
|
componentId: "sc-em45h0-0"
|
|
@@ -38,7 +38,7 @@ const colorStyles = _ref => {
|
|
|
38
38
|
const StyledColorSwatchLabel = styled(StyledButtonPreview).attrs({
|
|
39
39
|
as: 'label',
|
|
40
40
|
'data-garden-id': COMPONENT_ID,
|
|
41
|
-
'data-garden-version': '9.0.0-next.
|
|
41
|
+
'data-garden-version': '9.0.0-next.23'
|
|
42
42
|
}).withConfig({
|
|
43
43
|
displayName: "StyledColorSwatchLabel",
|
|
44
44
|
componentId: "sc-1aghocg-0"
|
|
@@ -12,7 +12,7 @@ import { StyledColorSwatchInput } from './StyledColorSwatchInput.js';
|
|
|
12
12
|
const COMPONENT_ID = 'colorpickers.colorswatch_check';
|
|
13
13
|
const StyledIcon = styled(SvgCheckSmFill).attrs({
|
|
14
14
|
'data-garden-id': COMPONENT_ID,
|
|
15
|
-
'data-garden-version': '9.0.0-next.
|
|
15
|
+
'data-garden-version': '9.0.0-next.23'
|
|
16
16
|
}).withConfig({
|
|
17
17
|
displayName: "StyledIcon",
|
|
18
18
|
componentId: "sc-8oigif-0"
|
|
@@ -145,7 +145,7 @@ const sizeStyles = props => {
|
|
|
145
145
|
};
|
|
146
146
|
const StyledRange = styled(Range).attrs({
|
|
147
147
|
'data-garden-id': COMPONENT_ID,
|
|
148
|
-
'data-garden-version': '9.0.0-next.
|
|
148
|
+
'data-garden-version': '9.0.0-next.23',
|
|
149
149
|
hasLowerTrack: false
|
|
150
150
|
}).withConfig({
|
|
151
151
|
displayName: "StyledRange",
|
package/dist/index.cjs.js
CHANGED
|
@@ -137,7 +137,7 @@ const getColorPickerWidth = props => {
|
|
|
137
137
|
};
|
|
138
138
|
const StyledColorPicker = styled__default.default.div.attrs({
|
|
139
139
|
'data-garden-id': COMPONENT_ID$l,
|
|
140
|
-
'data-garden-version': '9.0.0-next.
|
|
140
|
+
'data-garden-version': '9.0.0-next.23'
|
|
141
141
|
}).withConfig({
|
|
142
142
|
displayName: "StyledColorPicker",
|
|
143
143
|
componentId: "sc-gspq4q-0"
|
|
@@ -282,7 +282,7 @@ const sizeStyles$3 = props => {
|
|
|
282
282
|
};
|
|
283
283
|
const StyledRange = styled__default.default(reactForms.Range).attrs({
|
|
284
284
|
'data-garden-id': COMPONENT_ID$k,
|
|
285
|
-
'data-garden-version': '9.0.0-next.
|
|
285
|
+
'data-garden-version': '9.0.0-next.23',
|
|
286
286
|
hasLowerTrack: false
|
|
287
287
|
}).withConfig({
|
|
288
288
|
displayName: "StyledRange",
|
|
@@ -297,7 +297,7 @@ StyledRange.defaultProps = {
|
|
|
297
297
|
const COMPONENT_ID$j = 'colorpickers.colorpicker_hue';
|
|
298
298
|
const StyledHueRange = styled__default.default(StyledRange).attrs({
|
|
299
299
|
'data-garden-id': COMPONENT_ID$j,
|
|
300
|
-
'data-garden-version': '9.0.0-next.
|
|
300
|
+
'data-garden-version': '9.0.0-next.23'
|
|
301
301
|
}).withConfig({
|
|
302
302
|
displayName: "StyledHueRange",
|
|
303
303
|
componentId: "sc-1gdhww1-0"
|
|
@@ -328,7 +328,7 @@ const StyledAlphaRange = styled__default.default(StyledRange).attrs(props => ({
|
|
|
328
328
|
background: background$3(props)
|
|
329
329
|
},
|
|
330
330
|
'data-garden-id': COMPONENT_ID$i,
|
|
331
|
-
'data-garden-version': '9.0.0-next.
|
|
331
|
+
'data-garden-version': '9.0.0-next.23'
|
|
332
332
|
})).withConfig({
|
|
333
333
|
displayName: "StyledAlphaRange",
|
|
334
334
|
componentId: "sc-1f6hp2j-0"
|
|
@@ -355,7 +355,7 @@ const StyledPreview = styled__default.default.div.attrs(props => ({
|
|
|
355
355
|
background: background$2(props)
|
|
356
356
|
},
|
|
357
357
|
'data-garden-id': COMPONENT_ID$h,
|
|
358
|
-
'data-garden-version': '9.0.0-next.
|
|
358
|
+
'data-garden-version': '9.0.0-next.23',
|
|
359
359
|
'data-test-id': 'preview-box'
|
|
360
360
|
})).withConfig({
|
|
361
361
|
displayName: "StyledPreview",
|
|
@@ -377,7 +377,7 @@ const background$1 = props => {
|
|
|
377
377
|
};
|
|
378
378
|
const StyledColorWell = styled__default.default.div.attrs(props => ({
|
|
379
379
|
'data-garden-id': COMPONENT_ID$g,
|
|
380
|
-
'data-garden-version': '9.0.0-next.
|
|
380
|
+
'data-garden-version': '9.0.0-next.23',
|
|
381
381
|
'data-test-id': 'colorwell',
|
|
382
382
|
style: {
|
|
383
383
|
background: background$1(props)
|
|
@@ -416,7 +416,7 @@ const sizeStyles$2 = _ref2 => {
|
|
|
416
416
|
};
|
|
417
417
|
const StyledColorWellThumb = styled__default.default.div.attrs(props => ({
|
|
418
418
|
'data-garden-id': COMPONENT_ID$f,
|
|
419
|
-
'data-garden-version': '9.0.0-next.
|
|
419
|
+
'data-garden-version': '9.0.0-next.23',
|
|
420
420
|
'data-test-id': 'colorwell-thumb',
|
|
421
421
|
style: {
|
|
422
422
|
top: `${props.top}%`,
|
|
@@ -433,7 +433,7 @@ StyledColorWellThumb.defaultProps = {
|
|
|
433
433
|
const COMPONENT_ID$e = 'colorpickers.colorpicker_slider_group';
|
|
434
434
|
const StyledSliderGroup = styled__default.default.div.attrs({
|
|
435
435
|
'data-garden-id': COMPONENT_ID$e,
|
|
436
|
-
'data-garden-version': '9.0.0-next.
|
|
436
|
+
'data-garden-version': '9.0.0-next.23'
|
|
437
437
|
}).withConfig({
|
|
438
438
|
displayName: "StyledSliderGroup",
|
|
439
439
|
componentId: "sc-tigkzg-0"
|
|
@@ -445,7 +445,7 @@ StyledSliderGroup.defaultProps = {
|
|
|
445
445
|
const COMPONENT_ID$d = 'colorpickers.colorpicker_hex_field';
|
|
446
446
|
const StyledHexField = styled__default.default(reactForms.Field).attrs({
|
|
447
447
|
'data-garden-id': COMPONENT_ID$d,
|
|
448
|
-
'data-garden-version': '9.0.0-next.
|
|
448
|
+
'data-garden-version': '9.0.0-next.23',
|
|
449
449
|
spellcheck: false
|
|
450
450
|
}).withConfig({
|
|
451
451
|
displayName: "StyledHexField",
|
|
@@ -458,7 +458,7 @@ StyledHexField.defaultProps = {
|
|
|
458
458
|
const COMPONENT_ID$c = 'colorpickers.colorpicker_label';
|
|
459
459
|
const StyledLabel = styled__default.default(reactForms.Label).attrs({
|
|
460
460
|
'data-garden-id': COMPONENT_ID$c,
|
|
461
|
-
'data-garden-version': '9.0.0-next.
|
|
461
|
+
'data-garden-version': '9.0.0-next.23'
|
|
462
462
|
}).withConfig({
|
|
463
463
|
displayName: "StyledLabel",
|
|
464
464
|
componentId: "sc-1vxt3m9-0"
|
|
@@ -470,7 +470,7 @@ StyledLabel.defaultProps = {
|
|
|
470
470
|
const COMPONENT_ID$b = 'colorpickers.colorpicker_input';
|
|
471
471
|
const StyledInput = styled__default.default(reactForms.Input).attrs({
|
|
472
472
|
'data-garden-id': COMPONENT_ID$b,
|
|
473
|
-
'data-garden-version': '9.0.0-next.
|
|
473
|
+
'data-garden-version': '9.0.0-next.23',
|
|
474
474
|
focusInset: false
|
|
475
475
|
}).withConfig({
|
|
476
476
|
displayName: "StyledInput",
|
|
@@ -483,7 +483,7 @@ StyledInput.defaultProps = {
|
|
|
483
483
|
const COMPONENT_ID$a = 'colorpickers.colorpicker_input_group';
|
|
484
484
|
const StyledInputGroup = styled__default.default.div.attrs({
|
|
485
485
|
'data-garden-id': COMPONENT_ID$a,
|
|
486
|
-
'data-garden-version': '9.0.0-next.
|
|
486
|
+
'data-garden-version': '9.0.0-next.23'
|
|
487
487
|
}).withConfig({
|
|
488
488
|
displayName: "StyledInputGroup",
|
|
489
489
|
componentId: "sc-1m9g2wg-0"
|
|
@@ -504,7 +504,7 @@ const sizeStyles$1 = theme => {
|
|
|
504
504
|
};
|
|
505
505
|
const StyledRGBAField = styled__default.default(reactForms.Field).attrs({
|
|
506
506
|
'data-garden-id': COMPONENT_ID$9,
|
|
507
|
-
'data-garden-version': '9.0.0-next.
|
|
507
|
+
'data-garden-version': '9.0.0-next.23'
|
|
508
508
|
}).withConfig({
|
|
509
509
|
displayName: "StyledRGBAField",
|
|
510
510
|
componentId: "sc-13266k8-0"
|
|
@@ -538,7 +538,7 @@ const sizeStyles = props => {
|
|
|
538
538
|
};
|
|
539
539
|
const StyledSliders = styled__default.default.div.attrs({
|
|
540
540
|
'data-garden-id': COMPONENT_ID$8,
|
|
541
|
-
'data-garden-version': '9.0.0-next.
|
|
541
|
+
'data-garden-version': '9.0.0-next.23'
|
|
542
542
|
}).withConfig({
|
|
543
543
|
displayName: "StyledSliders",
|
|
544
544
|
componentId: "sc-1lgr50m-0"
|
|
@@ -549,7 +549,7 @@ StyledSliders.defaultProps = {
|
|
|
549
549
|
|
|
550
550
|
const StyledButton = styled__default.default(reactButtons.Button).attrs({
|
|
551
551
|
isNeutral: true,
|
|
552
|
-
'data-garden-version': '9.0.0-next.
|
|
552
|
+
'data-garden-version': '9.0.0-next.23'
|
|
553
553
|
}).withConfig({
|
|
554
554
|
displayName: "StyledButton",
|
|
555
555
|
componentId: "sc-1dlijfv-0"
|
|
@@ -589,7 +589,7 @@ const StyledButtonPreview = styled__default.default.span.attrs(props => ({
|
|
|
589
589
|
})
|
|
590
590
|
},
|
|
591
591
|
'data-garden-id': COMPONENT_ID$7,
|
|
592
|
-
'data-garden-version': '9.0.0-next.
|
|
592
|
+
'data-garden-version': '9.0.0-next.23',
|
|
593
593
|
'data-test-id': 'dialog-preview'
|
|
594
594
|
})).withConfig({
|
|
595
595
|
displayName: "StyledButtonPreview",
|
|
@@ -599,22 +599,22 @@ StyledButtonPreview.defaultProps = {
|
|
|
599
599
|
theme: reactTheming.DEFAULT_THEME
|
|
600
600
|
};
|
|
601
601
|
|
|
602
|
-
const COMPONENT_ID$6 = 'colorpickers.
|
|
603
|
-
const
|
|
602
|
+
const COMPONENT_ID$6 = 'colorpickers.colordialog_tooltipdialog';
|
|
603
|
+
const StyledTooltipDialog = styled__default.default(reactModals.TooltipDialog).attrs({
|
|
604
604
|
'data-garden-id': COMPONENT_ID$6,
|
|
605
|
-
'data-garden-version': '9.0.0-next.
|
|
605
|
+
'data-garden-version': '9.0.0-next.23'
|
|
606
606
|
}).withConfig({
|
|
607
|
-
displayName: "
|
|
608
|
-
componentId: "sc-
|
|
607
|
+
displayName: "StyledTooltipDialog",
|
|
608
|
+
componentId: "sc-1vbkccl-0"
|
|
609
609
|
})(["width:auto !important;", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$6, props));
|
|
610
|
-
|
|
610
|
+
StyledTooltipDialog.defaultProps = {
|
|
611
611
|
theme: reactTheming.DEFAULT_THEME
|
|
612
612
|
};
|
|
613
613
|
|
|
614
|
-
const COMPONENT_ID$5 = 'colorpickers.
|
|
615
|
-
const StyledTooltipBody = styled__default.default(reactModals.
|
|
614
|
+
const COMPONENT_ID$5 = 'colorpickers.colordialog_tooltipdialog_body';
|
|
615
|
+
const StyledTooltipBody = styled__default.default(reactModals.TooltipDialog.Body).attrs({
|
|
616
616
|
'data-garden-id': COMPONENT_ID$5,
|
|
617
|
-
'data-garden-version': '9.0.0-next.
|
|
617
|
+
'data-garden-version': '9.0.0-next.23'
|
|
618
618
|
}).withConfig({
|
|
619
619
|
displayName: "StyledTooltipBody",
|
|
620
620
|
componentId: "sc-1ueddpo-0"
|
|
@@ -626,7 +626,7 @@ StyledTooltipBody.defaultProps = {
|
|
|
626
626
|
const COMPONENT_ID$4 = 'colorpickers.color_swatch';
|
|
627
627
|
const StyledColorSwatch = styled__default.default.table.attrs({
|
|
628
628
|
'data-garden-id': COMPONENT_ID$4,
|
|
629
|
-
'data-garden-version': '9.0.0-next.
|
|
629
|
+
'data-garden-version': '9.0.0-next.23'
|
|
630
630
|
}).withConfig({
|
|
631
631
|
displayName: "StyledColorSwatch",
|
|
632
632
|
componentId: "sc-ajx440-0"
|
|
@@ -638,7 +638,7 @@ StyledColorSwatch.defaultProps = {
|
|
|
638
638
|
const COMPONENT_ID$3 = 'colorpickers.color_swatch_input';
|
|
639
639
|
const StyledColorSwatchInput = styled__default.default.input.attrs({
|
|
640
640
|
'data-garden-id': COMPONENT_ID$3,
|
|
641
|
-
'data-garden-version': '9.0.0-next.
|
|
641
|
+
'data-garden-version': '9.0.0-next.23'
|
|
642
642
|
}).withConfig({
|
|
643
643
|
displayName: "StyledColorSwatchInput",
|
|
644
644
|
componentId: "sc-em45h0-0"
|
|
@@ -676,7 +676,7 @@ const colorStyles = _ref => {
|
|
|
676
676
|
const StyledColorSwatchLabel = styled__default.default(StyledButtonPreview).attrs({
|
|
677
677
|
as: 'label',
|
|
678
678
|
'data-garden-id': COMPONENT_ID$2,
|
|
679
|
-
'data-garden-version': '9.0.0-next.
|
|
679
|
+
'data-garden-version': '9.0.0-next.23'
|
|
680
680
|
}).withConfig({
|
|
681
681
|
displayName: "StyledColorSwatchLabel",
|
|
682
682
|
componentId: "sc-1aghocg-0"
|
|
@@ -711,7 +711,7 @@ var SvgCheckSmFill = function SvgCheckSmFill(props) {
|
|
|
711
711
|
const COMPONENT_ID$1 = 'colorpickers.colorswatch_check';
|
|
712
712
|
const StyledIcon = styled__default.default(SvgCheckSmFill).attrs({
|
|
713
713
|
'data-garden-id': COMPONENT_ID$1,
|
|
714
|
-
'data-garden-version': '9.0.0-next.
|
|
714
|
+
'data-garden-version': '9.0.0-next.23'
|
|
715
715
|
}).withConfig({
|
|
716
716
|
displayName: "StyledIcon",
|
|
717
717
|
componentId: "sc-8oigif-0"
|
|
@@ -723,7 +723,7 @@ StyledIcon.defaultProps = {
|
|
|
723
723
|
const COMPONENT_ID = 'colorpickers.swatch_cell';
|
|
724
724
|
const StyledCell = styled__default.default.td.attrs({
|
|
725
725
|
'data-garden-id': COMPONENT_ID,
|
|
726
|
-
'data-garden-version': '9.0.0-next.
|
|
726
|
+
'data-garden-version': '9.0.0-next.23'
|
|
727
727
|
}).withConfig({
|
|
728
728
|
displayName: "StyledCell",
|
|
729
729
|
componentId: "sc-qr3oit-0"
|
|
@@ -793,17 +793,15 @@ const ColorWell = React__namespace.default.memo(_ref => {
|
|
|
793
793
|
throttledChange.cancel();
|
|
794
794
|
};
|
|
795
795
|
}, [throttledChange]);
|
|
796
|
-
return (
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
}))
|
|
806
|
-
);
|
|
796
|
+
return React__namespace.default.createElement(StyledColorWell, {
|
|
797
|
+
$hue: hue,
|
|
798
|
+
ref: containerRef,
|
|
799
|
+
role: "presentation",
|
|
800
|
+
onMouseDown: handleMouseDown
|
|
801
|
+
}, React__namespace.default.createElement(StyledColorWellThumb, {
|
|
802
|
+
top: mouseActiveRef.current ? topFromMouse : topPosition,
|
|
803
|
+
left: mouseActiveRef.current ? leftFromMouse : leftPosition
|
|
804
|
+
}));
|
|
807
805
|
});
|
|
808
806
|
ColorWell.displayName = 'ColorWell';
|
|
809
807
|
|
|
@@ -1363,7 +1361,7 @@ const ColorPickerDialog = React.forwardRef((_ref, ref) => {
|
|
|
1363
1361
|
$backgroundColor: isControlled ? color : uncontrolledColor
|
|
1364
1362
|
}), React__namespace.default.createElement(reactButtons.Button.EndIcon, {
|
|
1365
1363
|
isRotated: referenceElement != null
|
|
1366
|
-
}, React__namespace.default.createElement(SvgChevronDownStroke, null))), React__namespace.default.createElement(
|
|
1364
|
+
}, React__namespace.default.createElement(SvgChevronDownStroke, null))), React__namespace.default.createElement(StyledTooltipDialog, Object.assign({
|
|
1367
1365
|
ref: ref,
|
|
1368
1366
|
hasArrow: hasArrow,
|
|
1369
1367
|
zIndex: zIndex,
|
|
@@ -1443,69 +1441,71 @@ const ColorSwatch = React.forwardRef((_ref, ref) => {
|
|
|
1443
1441
|
setColIndex(col);
|
|
1444
1442
|
}
|
|
1445
1443
|
});
|
|
1446
|
-
return
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
if (
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
}
|
|
1473
|
-
if (isCheckboxGroup && event.target.checked) {
|
|
1474
|
-
const inputs = gridRef.current?.querySelectorAll('input');
|
|
1475
|
-
inputs?.forEach(input => {
|
|
1476
|
-
if (input !== event.target) {
|
|
1477
|
-
input.checked = false;
|
|
1444
|
+
return (
|
|
1445
|
+
React__namespace.default.createElement(StyledColorSwatch, Object.assign({
|
|
1446
|
+
role: "grid",
|
|
1447
|
+
ref: reactMergeRefs.mergeRefs([gridRef, ref])
|
|
1448
|
+
}, props), React__namespace.default.createElement("tbody", null, colors.map((row, _rowIndex) => React__namespace.default.createElement("tr", {
|
|
1449
|
+
key: row[0].value
|
|
1450
|
+
}, row.map((color, _colIndex) => {
|
|
1451
|
+
const {
|
|
1452
|
+
label,
|
|
1453
|
+
value
|
|
1454
|
+
} = color;
|
|
1455
|
+
const {
|
|
1456
|
+
role,
|
|
1457
|
+
...gridCellProps
|
|
1458
|
+
} = getGridCellProps({
|
|
1459
|
+
colIndex: _colIndex,
|
|
1460
|
+
rowIndex: _rowIndex
|
|
1461
|
+
});
|
|
1462
|
+
const checked = isControlled ? selectedRowIndex === _rowIndex && selectedColIndex === _colIndex : undefined;
|
|
1463
|
+
const defaultChecked = isControlled ? undefined : defaultSelectedRowIndex === _rowIndex && defaultSelectedColIndex === _colIndex;
|
|
1464
|
+
const handleChange = event => {
|
|
1465
|
+
if (onSelect) {
|
|
1466
|
+
if (event.target.checked) {
|
|
1467
|
+
onSelect(_rowIndex, _colIndex);
|
|
1468
|
+
} else {
|
|
1469
|
+
onSelect(null, null);
|
|
1478
1470
|
}
|
|
1479
|
-
}
|
|
1480
|
-
|
|
1481
|
-
};
|
|
1482
|
-
const handleBlur = event => {
|
|
1483
|
-
if (!(isCheckboxGroup || gridRef.current?.contains(event.relatedTarget))) {
|
|
1484
|
-
const selectedInput = gridRef.current?.querySelector(`input[name='${event.target.name}']:checked`);
|
|
1485
|
-
if (selectedInput !== null) {
|
|
1471
|
+
}
|
|
1472
|
+
if (isCheckboxGroup && event.target.checked) {
|
|
1486
1473
|
const inputs = gridRef.current?.querySelectorAll('input');
|
|
1487
|
-
inputs?.forEach(input =>
|
|
1474
|
+
inputs?.forEach(input => {
|
|
1475
|
+
if (input !== event.target) {
|
|
1476
|
+
input.checked = false;
|
|
1477
|
+
}
|
|
1478
|
+
});
|
|
1488
1479
|
}
|
|
1489
|
-
}
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1480
|
+
};
|
|
1481
|
+
const handleBlur = event => {
|
|
1482
|
+
if (!(isCheckboxGroup || gridRef.current?.contains(event.relatedTarget))) {
|
|
1483
|
+
const selectedInput = gridRef.current?.querySelector(`input[name='${event.target.name}']:checked`);
|
|
1484
|
+
if (selectedInput !== null) {
|
|
1485
|
+
const inputs = gridRef.current?.querySelectorAll('input');
|
|
1486
|
+
inputs?.forEach(input => input.setAttribute('tabIndex', input.checked ? '0' : '-1'));
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
};
|
|
1490
|
+
return React__namespace.default.createElement(StyledCell, {
|
|
1491
|
+
key: value,
|
|
1492
|
+
role: role
|
|
1493
|
+
}, React__namespace.default.createElement(StyledColorSwatchLabel, {
|
|
1494
|
+
$backgroundColor: value
|
|
1495
|
+
}, React__namespace.default.createElement(reactTooltips.Tooltip, {
|
|
1496
|
+
content: label
|
|
1497
|
+
}, React__namespace.default.createElement(StyledColorSwatchInput, Object.assign({
|
|
1498
|
+
"aria-label": label,
|
|
1499
|
+
name: name,
|
|
1500
|
+
type: isCheckboxGroup ? 'checkbox' : 'radio',
|
|
1501
|
+
value: value,
|
|
1502
|
+
defaultChecked: defaultChecked,
|
|
1503
|
+
checked: checked,
|
|
1504
|
+
onBlur: handleBlur,
|
|
1505
|
+
onChange: handleChange
|
|
1506
|
+
}, gridCellProps))), React__namespace.default.createElement(StyledIcon, null)));
|
|
1507
|
+
})))))
|
|
1508
|
+
);
|
|
1509
1509
|
});
|
|
1510
1510
|
ColorSwatch.displayName = 'ColorSwatch';
|
|
1511
1511
|
ColorSwatch.propTypes = {
|
|
@@ -1618,7 +1618,7 @@ const ColorSwatchDialog = React.forwardRef((_ref, ref) => {
|
|
|
1618
1618
|
$backgroundColor: backgroundColor
|
|
1619
1619
|
}), React__namespace.default.createElement(reactButtons.Button.EndIcon, {
|
|
1620
1620
|
isRotated: referenceElement !== null
|
|
1621
|
-
}, React__namespace.default.createElement(SvgChevronDownStroke, null))), React__namespace.default.createElement(
|
|
1621
|
+
}, React__namespace.default.createElement(SvgChevronDownStroke, null))), React__namespace.default.createElement(StyledTooltipDialog, Object.assign({
|
|
1622
1622
|
ref: ref,
|
|
1623
1623
|
zIndex: zIndex,
|
|
1624
1624
|
hasArrow: hasArrow,
|
package/dist/typings/styled/ColorPickerDialog/{StyledTooltipModal.d.ts → StyledTooltipDialog.d.ts}
RENAMED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
|
-
* 1. Override default
|
|
8
|
+
* 1. Override default TooltipDialog styling
|
|
9
9
|
*/
|
|
10
|
-
export declare const
|
|
10
|
+
export declare const StyledTooltipDialog: import("styled-components").StyledComponent<any, import("styled-components").DefaultTheme, object & {
|
|
11
11
|
'data-garden-id': string;
|
|
12
12
|
'data-garden-version': string;
|
|
13
13
|
}, string | number | symbol>;
|
|
@@ -19,7 +19,7 @@ export * from './ColorPicker/StyledRGBAField';
|
|
|
19
19
|
export * from './ColorPicker/StyledSliders';
|
|
20
20
|
export * from './ColorPickerDialog/StyledButton';
|
|
21
21
|
export * from './ColorPickerDialog/StyledButtonPreview';
|
|
22
|
-
export * from './ColorPickerDialog/
|
|
22
|
+
export * from './ColorPickerDialog/StyledTooltipDialog';
|
|
23
23
|
export * from './ColorPickerDialog/StyledTooltipBody';
|
|
24
24
|
export * from './ColorSwatch/StyledColorSwatch';
|
|
25
25
|
export * from './ColorSwatch/StyledColorSwatchInput';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import { HTMLAttributes } from 'react';
|
|
8
|
-
import {
|
|
8
|
+
import { ITooltipDialogProps } from '@zendeskgarden/react-modals';
|
|
9
9
|
export interface IColor {
|
|
10
10
|
hex: string;
|
|
11
11
|
hue: number;
|
|
@@ -67,21 +67,21 @@ export interface IColorPickerDialogProps extends IColorPickerProps {
|
|
|
67
67
|
*/
|
|
68
68
|
onClose?: (color: IColor) => void;
|
|
69
69
|
/** Adjusts the placement of the color dialog */
|
|
70
|
-
placement?:
|
|
70
|
+
placement?: ITooltipDialogProps['placement'];
|
|
71
71
|
/** Disables the color dialog button */
|
|
72
72
|
disabled?: boolean;
|
|
73
73
|
/**
|
|
74
74
|
* Sets the `z-index` of the color dialog
|
|
75
75
|
*/
|
|
76
|
-
zIndex?:
|
|
76
|
+
zIndex?: ITooltipDialogProps['zIndex'];
|
|
77
77
|
/**
|
|
78
78
|
* Adds an arrow to the color dialog
|
|
79
79
|
*/
|
|
80
|
-
hasArrow?:
|
|
80
|
+
hasArrow?: ITooltipDialogProps['hasArrow'];
|
|
81
81
|
/**
|
|
82
82
|
* Animates the color dialog
|
|
83
83
|
*/
|
|
84
|
-
isAnimated?:
|
|
84
|
+
isAnimated?: ITooltipDialogProps['isAnimated'];
|
|
85
85
|
/**
|
|
86
86
|
* Opens the dialog in a controlled color picker dialog
|
|
87
87
|
*/
|
|
@@ -130,15 +130,15 @@ export interface IColorSwatchProps extends Omit<HTMLAttributes<HTMLTableElement>
|
|
|
130
130
|
}
|
|
131
131
|
export interface IColorSwatchDialogProps extends IColorSwatchProps {
|
|
132
132
|
/** Adjusts the placement of the color dialog */
|
|
133
|
-
placement?:
|
|
133
|
+
placement?: ITooltipDialogProps['placement'];
|
|
134
134
|
/** Disables the color dialog button */
|
|
135
135
|
disabled?: boolean;
|
|
136
136
|
/** Sets the `z-index` of the color dialog */
|
|
137
|
-
zIndex?:
|
|
137
|
+
zIndex?: ITooltipDialogProps['zIndex'];
|
|
138
138
|
/** Adds an arrow to the color dialog */
|
|
139
|
-
hasArrow?:
|
|
139
|
+
hasArrow?: ITooltipDialogProps['hasArrow'];
|
|
140
140
|
/** Animates the color dialog */
|
|
141
|
-
isAnimated?:
|
|
141
|
+
isAnimated?: ITooltipDialogProps['isAnimated'];
|
|
142
142
|
/** Applies inset `box-shadow` styling on focus */
|
|
143
143
|
focusInset?: boolean;
|
|
144
144
|
/** Passes HTML attributes to the color dialog button element */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-colorpickers",
|
|
3
|
-
"version": "9.0.0-next.
|
|
3
|
+
"version": "9.0.0-next.23",
|
|
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": "^3.0.0",
|
|
25
25
|
"@zendeskgarden/container-utilities": "^2.0.0",
|
|
26
|
-
"@zendeskgarden/react-buttons": "^9.0.0-next.
|
|
27
|
-
"@zendeskgarden/react-forms": "^9.0.0-next.
|
|
28
|
-
"@zendeskgarden/react-modals": "^9.0.0-next.
|
|
29
|
-
"@zendeskgarden/react-tooltips": "^9.0.0-next.
|
|
26
|
+
"@zendeskgarden/react-buttons": "^9.0.0-next.23",
|
|
27
|
+
"@zendeskgarden/react-forms": "^9.0.0-next.23",
|
|
28
|
+
"@zendeskgarden/react-modals": "^9.0.0-next.23",
|
|
29
|
+
"@zendeskgarden/react-tooltips": "^9.0.0-next.23",
|
|
30
30
|
"lodash.isequal": "^4.5.0",
|
|
31
31
|
"lodash.throttle": "^4.1.1",
|
|
32
32
|
"polished": "^4.3.1",
|
|
@@ -35,15 +35,15 @@
|
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"@zendeskgarden/react-theming": ">=9.0.0-next",
|
|
38
|
-
"react": "
|
|
39
|
-
"react-dom": "
|
|
38
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
39
|
+
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
40
40
|
"styled-components": "^5.3.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/lodash.isequal": "4.5.8",
|
|
44
44
|
"@types/lodash.throttle": "4.1.9",
|
|
45
|
-
"@zendeskgarden/react-theming": "^9.0.0-next.
|
|
46
|
-
"@zendeskgarden/svg-icons": "7.
|
|
45
|
+
"@zendeskgarden/react-theming": "^9.0.0-next.23",
|
|
46
|
+
"@zendeskgarden/svg-icons": "7.2.0"
|
|
47
47
|
},
|
|
48
48
|
"keywords": [
|
|
49
49
|
"colorpicker",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"access": "public"
|
|
57
57
|
},
|
|
58
58
|
"zendeskgarden:src": "src/index.ts",
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "5e7d2ed69a1615e09406a3f9285359346bb90cc7"
|
|
60
60
|
}
|