@zendeskgarden/react-colorpickers 9.0.0 → 9.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +176 -0
- package/dist/esm/elements/ColorPickerDialog/index.js +1 -1
- package/dist/esm/elements/ColorSwatch/index.js +61 -63
- package/dist/esm/elements/ColorSwatchDialog/index.js +1 -1
- 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 +1 -1
- package/dist/esm/styled/ColorPickerDialog/StyledTooltipDialog.js +1 -1
- 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 +86 -88
- package/package.json +9 -8
package/LICENSE.md
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
@@ -95,7 +95,7 @@ const ColorPickerDialog = forwardRef((_ref, ref) => {
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
}, [isOpen, isDialogControlled]);
|
|
98
|
-
return React__default.createElement(React__default.Fragment, null, children ? (
|
|
98
|
+
return React__default.createElement(React__default.Fragment, null, children ? (cloneElement(Children.only(children), {
|
|
99
99
|
onClick,
|
|
100
100
|
ref: buttonRef
|
|
101
101
|
})) : React__default.createElement(StyledButton, Object.assign({
|
|
@@ -70,72 +70,70 @@ 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
|
-
onSelect(null, null);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
if (isCheckboxGroup && event.target.checked) {
|
|
102
|
-
const inputs = gridRef.current?.querySelectorAll('input');
|
|
103
|
-
inputs?.forEach(input => {
|
|
104
|
-
if (input !== event.target) {
|
|
105
|
-
input.checked = false;
|
|
106
|
-
}
|
|
107
|
-
});
|
|
73
|
+
return React__default.createElement(StyledColorSwatch, Object.assign({
|
|
74
|
+
role: "grid",
|
|
75
|
+
ref: mergeRefs([gridRef, ref])
|
|
76
|
+
}, props), React__default.createElement("tbody", null, colors.map((row, _rowIndex) => React__default.createElement("tr", {
|
|
77
|
+
key: row[0].value
|
|
78
|
+
}, row.map((color, _colIndex) => {
|
|
79
|
+
const {
|
|
80
|
+
label,
|
|
81
|
+
value
|
|
82
|
+
} = color;
|
|
83
|
+
const {
|
|
84
|
+
role,
|
|
85
|
+
...gridCellProps
|
|
86
|
+
} = getGridCellProps({
|
|
87
|
+
colIndex: _colIndex,
|
|
88
|
+
rowIndex: _rowIndex
|
|
89
|
+
});
|
|
90
|
+
const checked = isControlled ? selectedRowIndex === _rowIndex && selectedColIndex === _colIndex : undefined;
|
|
91
|
+
const defaultChecked = isControlled ? undefined : defaultSelectedRowIndex === _rowIndex && defaultSelectedColIndex === _colIndex;
|
|
92
|
+
const handleChange = event => {
|
|
93
|
+
if (onSelect) {
|
|
94
|
+
if (event.target.checked) {
|
|
95
|
+
onSelect(_rowIndex, _colIndex);
|
|
96
|
+
} else {
|
|
97
|
+
onSelect(null, null);
|
|
108
98
|
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
if (
|
|
114
|
-
|
|
115
|
-
inputs?.forEach(input => input.setAttribute('tabIndex', input.checked ? '0' : '-1'));
|
|
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;
|
|
116
105
|
}
|
|
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) {
|
|
113
|
+
const inputs = gridRef.current?.querySelectorAll('input');
|
|
114
|
+
inputs?.forEach(input => input.setAttribute('tabIndex', input.checked ? '0' : '-1'));
|
|
117
115
|
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
})))))
|
|
138
|
-
);
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
return React__default.createElement(StyledCell, {
|
|
119
|
+
key: value,
|
|
120
|
+
role: role
|
|
121
|
+
}, React__default.createElement(StyledColorSwatchLabel, {
|
|
122
|
+
$backgroundColor: value
|
|
123
|
+
}, React__default.createElement(Tooltip, {
|
|
124
|
+
content: label,
|
|
125
|
+
zIndex: 1
|
|
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
|
+
})))));
|
|
139
137
|
});
|
|
140
138
|
ColorSwatch.displayName = 'ColorSwatch';
|
|
141
139
|
ColorSwatch.propTypes = {
|
|
@@ -124,7 +124,7 @@ const ColorSwatchDialog = forwardRef((_ref, ref) => {
|
|
|
124
124
|
}
|
|
125
125
|
onSelect && onSelect(row, col);
|
|
126
126
|
};
|
|
127
|
-
return React__default.createElement(React__default.Fragment, null, children ? (
|
|
127
|
+
return React__default.createElement(React__default.Fragment, null, children ? (cloneElement(Children.only(children), {
|
|
128
128
|
onClick,
|
|
129
129
|
ref: buttonRef
|
|
130
130
|
})) : React__default.createElement(StyledButton, Object.assign({
|
|
@@ -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.
|
|
33
|
+
'data-garden-version': '9.1.0'
|
|
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.
|
|
16
|
+
'data-garden-version': '9.1.0'
|
|
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.
|
|
23
|
+
'data-garden-version': '9.1.0',
|
|
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.
|
|
37
|
+
'data-garden-version': '9.1.0',
|
|
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.
|
|
14
|
+
'data-garden-version': '9.1.0',
|
|
15
15
|
spellcheck: false
|
|
16
16
|
}).withConfig({
|
|
17
17
|
displayName: "StyledHexField",
|
|
@@ -10,7 +10,7 @@ import { StyledRange, getTrackMargin, getTrackHeight } from '../common/StyledRan
|
|
|
10
10
|
const COMPONENT_ID = 'colorpickers.colorpicker_hue';
|
|
11
11
|
const StyledHueRange = styled(StyledRange).attrs({
|
|
12
12
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.
|
|
13
|
+
'data-garden-version': '9.1.0'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledHueRange",
|
|
16
16
|
componentId: "sc-1gdhww1-0"
|
|
@@ -11,7 +11,7 @@ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
|
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.
|
|
14
|
+
'data-garden-version': '9.1.0',
|
|
15
15
|
focusInset: false
|
|
16
16
|
}).withConfig({
|
|
17
17
|
displayName: "StyledInput",
|
|
@@ -10,7 +10,7 @@ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
|
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.
|
|
13
|
+
'data-garden-version': '9.1.0'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledInputGroup",
|
|
16
16
|
componentId: "sc-1m9g2wg-0"
|
|
@@ -11,7 +11,7 @@ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
|
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.
|
|
14
|
+
'data-garden-version': '9.1.0'
|
|
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.
|
|
29
|
+
'data-garden-version': '9.1.0',
|
|
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.
|
|
23
|
+
'data-garden-version': '9.1.0'
|
|
24
24
|
}).withConfig({
|
|
25
25
|
displayName: "StyledRGBAField",
|
|
26
26
|
componentId: "sc-13266k8-0"
|
|
@@ -10,7 +10,7 @@ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
|
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.
|
|
13
|
+
'data-garden-version': '9.1.0'
|
|
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.
|
|
36
|
+
'data-garden-version': '9.1.0'
|
|
37
37
|
}).withConfig({
|
|
38
38
|
displayName: "StyledSliders",
|
|
39
39
|
componentId: "sc-1lgr50m-0"
|
|
@@ -9,7 +9,7 @@ import { Button } from '@zendeskgarden/react-buttons';
|
|
|
9
9
|
|
|
10
10
|
const StyledButton = styled(Button).attrs({
|
|
11
11
|
isNeutral: true,
|
|
12
|
-
'data-garden-version': '9.
|
|
12
|
+
'data-garden-version': '9.1.0'
|
|
13
13
|
}).withConfig({
|
|
14
14
|
displayName: "StyledButton",
|
|
15
15
|
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.
|
|
42
|
+
'data-garden-version': '9.1.0',
|
|
43
43
|
'data-test-id': 'dialog-preview'
|
|
44
44
|
})).withConfig({
|
|
45
45
|
displayName: "StyledButtonPreview",
|
|
@@ -11,7 +11,7 @@ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
|
11
11
|
const COMPONENT_ID = 'colorpickers.colordialog_tooltipdialog_body';
|
|
12
12
|
const StyledTooltipBody = styled(TooltipDialog.Body).attrs({
|
|
13
13
|
'data-garden-id': COMPONENT_ID,
|
|
14
|
-
'data-garden-version': '9.
|
|
14
|
+
'data-garden-version': '9.1.0'
|
|
15
15
|
}).withConfig({
|
|
16
16
|
displayName: "StyledTooltipBody",
|
|
17
17
|
componentId: "sc-1ueddpo-0"
|
|
@@ -11,7 +11,7 @@ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
|
11
11
|
const COMPONENT_ID = 'colorpickers.colordialog_tooltipdialog';
|
|
12
12
|
const StyledTooltipDialog = styled(TooltipDialog).attrs({
|
|
13
13
|
'data-garden-id': COMPONENT_ID,
|
|
14
|
-
'data-garden-version': '9.
|
|
14
|
+
'data-garden-version': '9.1.0'
|
|
15
15
|
}).withConfig({
|
|
16
16
|
displayName: "StyledTooltipDialog",
|
|
17
17
|
componentId: "sc-1vbkccl-0"
|
|
@@ -10,7 +10,7 @@ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
|
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.
|
|
13
|
+
'data-garden-version': '9.1.0'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledCell",
|
|
16
16
|
componentId: "sc-qr3oit-0"
|
|
@@ -10,7 +10,7 @@ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
|
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.
|
|
13
|
+
'data-garden-version': '9.1.0'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledColorSwatch",
|
|
16
16
|
componentId: "sc-ajx440-0"
|
|
@@ -10,7 +10,7 @@ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
|
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.
|
|
13
|
+
'data-garden-version': '9.1.0'
|
|
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.
|
|
41
|
+
'data-garden-version': '9.1.0'
|
|
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.
|
|
15
|
+
'data-garden-version': '9.1.0'
|
|
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.
|
|
148
|
+
'data-garden-version': '9.1.0',
|
|
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.
|
|
140
|
+
'data-garden-version': '9.1.0'
|
|
141
141
|
}).withConfig({
|
|
142
142
|
displayName: "StyledColorPicker",
|
|
143
143
|
componentId: "sc-gspq4q-0"
|
|
@@ -279,7 +279,7 @@ const sizeStyles$3 = props => {
|
|
|
279
279
|
};
|
|
280
280
|
const StyledRange = styled__default.default(reactForms.Range).attrs({
|
|
281
281
|
'data-garden-id': COMPONENT_ID$k,
|
|
282
|
-
'data-garden-version': '9.
|
|
282
|
+
'data-garden-version': '9.1.0',
|
|
283
283
|
hasLowerTrack: false
|
|
284
284
|
}).withConfig({
|
|
285
285
|
displayName: "StyledRange",
|
|
@@ -291,7 +291,7 @@ const StyledRange = styled__default.default(reactForms.Range).attrs({
|
|
|
291
291
|
const COMPONENT_ID$j = 'colorpickers.colorpicker_hue';
|
|
292
292
|
const StyledHueRange = styled__default.default(StyledRange).attrs({
|
|
293
293
|
'data-garden-id': COMPONENT_ID$j,
|
|
294
|
-
'data-garden-version': '9.
|
|
294
|
+
'data-garden-version': '9.1.0'
|
|
295
295
|
}).withConfig({
|
|
296
296
|
displayName: "StyledHueRange",
|
|
297
297
|
componentId: "sc-1gdhww1-0"
|
|
@@ -319,7 +319,7 @@ const StyledAlphaRange = styled__default.default(StyledRange).attrs(props => ({
|
|
|
319
319
|
background: background$3(props)
|
|
320
320
|
},
|
|
321
321
|
'data-garden-id': COMPONENT_ID$i,
|
|
322
|
-
'data-garden-version': '9.
|
|
322
|
+
'data-garden-version': '9.1.0'
|
|
323
323
|
})).withConfig({
|
|
324
324
|
displayName: "StyledAlphaRange",
|
|
325
325
|
componentId: "sc-1f6hp2j-0"
|
|
@@ -343,7 +343,7 @@ const StyledPreview = styled__default.default.div.attrs(props => ({
|
|
|
343
343
|
background: background$2(props)
|
|
344
344
|
},
|
|
345
345
|
'data-garden-id': COMPONENT_ID$h,
|
|
346
|
-
'data-garden-version': '9.
|
|
346
|
+
'data-garden-version': '9.1.0',
|
|
347
347
|
'data-test-id': 'preview-box'
|
|
348
348
|
})).withConfig({
|
|
349
349
|
displayName: "StyledPreview",
|
|
@@ -362,7 +362,7 @@ const background$1 = props => {
|
|
|
362
362
|
};
|
|
363
363
|
const StyledColorWell = styled__default.default.div.attrs(props => ({
|
|
364
364
|
'data-garden-id': COMPONENT_ID$g,
|
|
365
|
-
'data-garden-version': '9.
|
|
365
|
+
'data-garden-version': '9.1.0',
|
|
366
366
|
'data-test-id': 'colorwell',
|
|
367
367
|
style: {
|
|
368
368
|
background: background$1(props)
|
|
@@ -398,7 +398,7 @@ const sizeStyles$2 = _ref2 => {
|
|
|
398
398
|
};
|
|
399
399
|
const StyledColorWellThumb = styled__default.default.div.attrs(props => ({
|
|
400
400
|
'data-garden-id': COMPONENT_ID$f,
|
|
401
|
-
'data-garden-version': '9.
|
|
401
|
+
'data-garden-version': '9.1.0',
|
|
402
402
|
'data-test-id': 'colorwell-thumb',
|
|
403
403
|
style: {
|
|
404
404
|
top: `${props.top}%`,
|
|
@@ -412,7 +412,7 @@ const StyledColorWellThumb = styled__default.default.div.attrs(props => ({
|
|
|
412
412
|
const COMPONENT_ID$e = 'colorpickers.colorpicker_slider_group';
|
|
413
413
|
const StyledSliderGroup = styled__default.default.div.attrs({
|
|
414
414
|
'data-garden-id': COMPONENT_ID$e,
|
|
415
|
-
'data-garden-version': '9.
|
|
415
|
+
'data-garden-version': '9.1.0'
|
|
416
416
|
}).withConfig({
|
|
417
417
|
displayName: "StyledSliderGroup",
|
|
418
418
|
componentId: "sc-tigkzg-0"
|
|
@@ -421,7 +421,7 @@ const StyledSliderGroup = styled__default.default.div.attrs({
|
|
|
421
421
|
const COMPONENT_ID$d = 'colorpickers.colorpicker_hex_field';
|
|
422
422
|
const StyledHexField = styled__default.default(reactForms.Field).attrs({
|
|
423
423
|
'data-garden-id': COMPONENT_ID$d,
|
|
424
|
-
'data-garden-version': '9.
|
|
424
|
+
'data-garden-version': '9.1.0',
|
|
425
425
|
spellcheck: false
|
|
426
426
|
}).withConfig({
|
|
427
427
|
displayName: "StyledHexField",
|
|
@@ -431,7 +431,7 @@ const StyledHexField = styled__default.default(reactForms.Field).attrs({
|
|
|
431
431
|
const COMPONENT_ID$c = 'colorpickers.colorpicker_label';
|
|
432
432
|
const StyledLabel = styled__default.default(reactForms.Label).attrs({
|
|
433
433
|
'data-garden-id': COMPONENT_ID$c,
|
|
434
|
-
'data-garden-version': '9.
|
|
434
|
+
'data-garden-version': '9.1.0'
|
|
435
435
|
}).withConfig({
|
|
436
436
|
displayName: "StyledLabel",
|
|
437
437
|
componentId: "sc-1vxt3m9-0"
|
|
@@ -440,7 +440,7 @@ const StyledLabel = styled__default.default(reactForms.Label).attrs({
|
|
|
440
440
|
const COMPONENT_ID$b = 'colorpickers.colorpicker_input';
|
|
441
441
|
const StyledInput = styled__default.default(reactForms.Input).attrs({
|
|
442
442
|
'data-garden-id': COMPONENT_ID$b,
|
|
443
|
-
'data-garden-version': '9.
|
|
443
|
+
'data-garden-version': '9.1.0',
|
|
444
444
|
focusInset: false
|
|
445
445
|
}).withConfig({
|
|
446
446
|
displayName: "StyledInput",
|
|
@@ -450,7 +450,7 @@ const StyledInput = styled__default.default(reactForms.Input).attrs({
|
|
|
450
450
|
const COMPONENT_ID$a = 'colorpickers.colorpicker_input_group';
|
|
451
451
|
const StyledInputGroup = styled__default.default.div.attrs({
|
|
452
452
|
'data-garden-id': COMPONENT_ID$a,
|
|
453
|
-
'data-garden-version': '9.
|
|
453
|
+
'data-garden-version': '9.1.0'
|
|
454
454
|
}).withConfig({
|
|
455
455
|
displayName: "StyledInputGroup",
|
|
456
456
|
componentId: "sc-1m9g2wg-0"
|
|
@@ -468,7 +468,7 @@ const sizeStyles$1 = theme => {
|
|
|
468
468
|
};
|
|
469
469
|
const StyledRGBAField = styled__default.default(reactForms.Field).attrs({
|
|
470
470
|
'data-garden-id': COMPONENT_ID$9,
|
|
471
|
-
'data-garden-version': '9.
|
|
471
|
+
'data-garden-version': '9.1.0'
|
|
472
472
|
}).withConfig({
|
|
473
473
|
displayName: "StyledRGBAField",
|
|
474
474
|
componentId: "sc-13266k8-0"
|
|
@@ -499,7 +499,7 @@ const sizeStyles = props => {
|
|
|
499
499
|
};
|
|
500
500
|
const StyledSliders = styled__default.default.div.attrs({
|
|
501
501
|
'data-garden-id': COMPONENT_ID$8,
|
|
502
|
-
'data-garden-version': '9.
|
|
502
|
+
'data-garden-version': '9.1.0'
|
|
503
503
|
}).withConfig({
|
|
504
504
|
displayName: "StyledSliders",
|
|
505
505
|
componentId: "sc-1lgr50m-0"
|
|
@@ -507,7 +507,7 @@ const StyledSliders = styled__default.default.div.attrs({
|
|
|
507
507
|
|
|
508
508
|
const StyledButton = styled__default.default(reactButtons.Button).attrs({
|
|
509
509
|
isNeutral: true,
|
|
510
|
-
'data-garden-version': '9.
|
|
510
|
+
'data-garden-version': '9.1.0'
|
|
511
511
|
}).withConfig({
|
|
512
512
|
displayName: "StyledButton",
|
|
513
513
|
componentId: "sc-1dlijfv-0"
|
|
@@ -544,7 +544,7 @@ const StyledButtonPreview = styled__default.default.span.attrs(props => ({
|
|
|
544
544
|
})
|
|
545
545
|
},
|
|
546
546
|
'data-garden-id': COMPONENT_ID$7,
|
|
547
|
-
'data-garden-version': '9.
|
|
547
|
+
'data-garden-version': '9.1.0',
|
|
548
548
|
'data-test-id': 'dialog-preview'
|
|
549
549
|
})).withConfig({
|
|
550
550
|
displayName: "StyledButtonPreview",
|
|
@@ -554,7 +554,7 @@ const StyledButtonPreview = styled__default.default.span.attrs(props => ({
|
|
|
554
554
|
const COMPONENT_ID$6 = 'colorpickers.colordialog_tooltipdialog';
|
|
555
555
|
const StyledTooltipDialog = styled__default.default(reactModals.TooltipDialog).attrs({
|
|
556
556
|
'data-garden-id': COMPONENT_ID$6,
|
|
557
|
-
'data-garden-version': '9.
|
|
557
|
+
'data-garden-version': '9.1.0'
|
|
558
558
|
}).withConfig({
|
|
559
559
|
displayName: "StyledTooltipDialog",
|
|
560
560
|
componentId: "sc-1vbkccl-0"
|
|
@@ -563,7 +563,7 @@ const StyledTooltipDialog = styled__default.default(reactModals.TooltipDialog).a
|
|
|
563
563
|
const COMPONENT_ID$5 = 'colorpickers.colordialog_tooltipdialog_body';
|
|
564
564
|
const StyledTooltipBody = styled__default.default(reactModals.TooltipDialog.Body).attrs({
|
|
565
565
|
'data-garden-id': COMPONENT_ID$5,
|
|
566
|
-
'data-garden-version': '9.
|
|
566
|
+
'data-garden-version': '9.1.0'
|
|
567
567
|
}).withConfig({
|
|
568
568
|
displayName: "StyledTooltipBody",
|
|
569
569
|
componentId: "sc-1ueddpo-0"
|
|
@@ -572,7 +572,7 @@ const StyledTooltipBody = styled__default.default(reactModals.TooltipDialog.Body
|
|
|
572
572
|
const COMPONENT_ID$4 = 'colorpickers.color_swatch';
|
|
573
573
|
const StyledColorSwatch = styled__default.default.table.attrs({
|
|
574
574
|
'data-garden-id': COMPONENT_ID$4,
|
|
575
|
-
'data-garden-version': '9.
|
|
575
|
+
'data-garden-version': '9.1.0'
|
|
576
576
|
}).withConfig({
|
|
577
577
|
displayName: "StyledColorSwatch",
|
|
578
578
|
componentId: "sc-ajx440-0"
|
|
@@ -581,7 +581,7 @@ const StyledColorSwatch = styled__default.default.table.attrs({
|
|
|
581
581
|
const COMPONENT_ID$3 = 'colorpickers.color_swatch_input';
|
|
582
582
|
const StyledColorSwatchInput = styled__default.default.input.attrs({
|
|
583
583
|
'data-garden-id': COMPONENT_ID$3,
|
|
584
|
-
'data-garden-version': '9.
|
|
584
|
+
'data-garden-version': '9.1.0'
|
|
585
585
|
}).withConfig({
|
|
586
586
|
displayName: "StyledColorSwatchInput",
|
|
587
587
|
componentId: "sc-em45h0-0"
|
|
@@ -616,7 +616,7 @@ const colorStyles = _ref => {
|
|
|
616
616
|
const StyledColorSwatchLabel = styled__default.default(StyledButtonPreview).attrs({
|
|
617
617
|
as: 'label',
|
|
618
618
|
'data-garden-id': COMPONENT_ID$2,
|
|
619
|
-
'data-garden-version': '9.
|
|
619
|
+
'data-garden-version': '9.1.0'
|
|
620
620
|
}).withConfig({
|
|
621
621
|
displayName: "StyledColorSwatchLabel",
|
|
622
622
|
componentId: "sc-1aghocg-0"
|
|
@@ -648,7 +648,7 @@ var SvgCheckSmFill = function SvgCheckSmFill(props) {
|
|
|
648
648
|
const COMPONENT_ID$1 = 'colorpickers.colorswatch_check';
|
|
649
649
|
const StyledIcon = styled__default.default(SvgCheckSmFill).attrs({
|
|
650
650
|
'data-garden-id': COMPONENT_ID$1,
|
|
651
|
-
'data-garden-version': '9.
|
|
651
|
+
'data-garden-version': '9.1.0'
|
|
652
652
|
}).withConfig({
|
|
653
653
|
displayName: "StyledIcon",
|
|
654
654
|
componentId: "sc-8oigif-0"
|
|
@@ -657,7 +657,7 @@ const StyledIcon = styled__default.default(SvgCheckSmFill).attrs({
|
|
|
657
657
|
const COMPONENT_ID = 'colorpickers.swatch_cell';
|
|
658
658
|
const StyledCell = styled__default.default.td.attrs({
|
|
659
659
|
'data-garden-id': COMPONENT_ID,
|
|
660
|
-
'data-garden-version': '9.
|
|
660
|
+
'data-garden-version': '9.1.0'
|
|
661
661
|
}).withConfig({
|
|
662
662
|
displayName: "StyledCell",
|
|
663
663
|
componentId: "sc-qr3oit-0"
|
|
@@ -1281,7 +1281,7 @@ const ColorPickerDialog = React.forwardRef((_ref, ref) => {
|
|
|
1281
1281
|
}
|
|
1282
1282
|
}
|
|
1283
1283
|
}, [isOpen, isDialogControlled]);
|
|
1284
|
-
return React__namespace.default.createElement(React__namespace.default.Fragment, null, children ? (
|
|
1284
|
+
return React__namespace.default.createElement(React__namespace.default.Fragment, null, children ? (React.cloneElement(React.Children.only(children), {
|
|
1285
1285
|
onClick,
|
|
1286
1286
|
ref: buttonRef
|
|
1287
1287
|
})) : React__namespace.default.createElement(StyledButton, Object.assign({
|
|
@@ -1374,72 +1374,70 @@ const ColorSwatch = React.forwardRef((_ref, ref) => {
|
|
|
1374
1374
|
setColIndex(col);
|
|
1375
1375
|
}
|
|
1376
1376
|
});
|
|
1377
|
-
return (
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
if (
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
onSelect(null, null);
|
|
1403
|
-
}
|
|
1404
|
-
}
|
|
1405
|
-
if (isCheckboxGroup && event.target.checked) {
|
|
1406
|
-
const inputs = gridRef.current?.querySelectorAll('input');
|
|
1407
|
-
inputs?.forEach(input => {
|
|
1408
|
-
if (input !== event.target) {
|
|
1409
|
-
input.checked = false;
|
|
1410
|
-
}
|
|
1411
|
-
});
|
|
1377
|
+
return React__namespace.default.createElement(StyledColorSwatch, Object.assign({
|
|
1378
|
+
role: "grid",
|
|
1379
|
+
ref: reactMergeRefs.mergeRefs([gridRef, ref])
|
|
1380
|
+
}, props), React__namespace.default.createElement("tbody", null, colors.map((row, _rowIndex) => React__namespace.default.createElement("tr", {
|
|
1381
|
+
key: row[0].value
|
|
1382
|
+
}, row.map((color, _colIndex) => {
|
|
1383
|
+
const {
|
|
1384
|
+
label,
|
|
1385
|
+
value
|
|
1386
|
+
} = color;
|
|
1387
|
+
const {
|
|
1388
|
+
role,
|
|
1389
|
+
...gridCellProps
|
|
1390
|
+
} = getGridCellProps({
|
|
1391
|
+
colIndex: _colIndex,
|
|
1392
|
+
rowIndex: _rowIndex
|
|
1393
|
+
});
|
|
1394
|
+
const checked = isControlled ? selectedRowIndex === _rowIndex && selectedColIndex === _colIndex : undefined;
|
|
1395
|
+
const defaultChecked = isControlled ? undefined : defaultSelectedRowIndex === _rowIndex && defaultSelectedColIndex === _colIndex;
|
|
1396
|
+
const handleChange = event => {
|
|
1397
|
+
if (onSelect) {
|
|
1398
|
+
if (event.target.checked) {
|
|
1399
|
+
onSelect(_rowIndex, _colIndex);
|
|
1400
|
+
} else {
|
|
1401
|
+
onSelect(null, null);
|
|
1412
1402
|
}
|
|
1413
|
-
}
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
if (
|
|
1418
|
-
|
|
1419
|
-
inputs?.forEach(input => input.setAttribute('tabIndex', input.checked ? '0' : '-1'));
|
|
1403
|
+
}
|
|
1404
|
+
if (isCheckboxGroup && event.target.checked) {
|
|
1405
|
+
const inputs = gridRef.current?.querySelectorAll('input');
|
|
1406
|
+
inputs?.forEach(input => {
|
|
1407
|
+
if (input !== event.target) {
|
|
1408
|
+
input.checked = false;
|
|
1420
1409
|
}
|
|
1410
|
+
});
|
|
1411
|
+
}
|
|
1412
|
+
};
|
|
1413
|
+
const handleBlur = event => {
|
|
1414
|
+
if (!(isCheckboxGroup || gridRef.current?.contains(event.relatedTarget))) {
|
|
1415
|
+
const selectedInput = gridRef.current?.querySelector(`input[name='${event.target.name}']:checked`);
|
|
1416
|
+
if (selectedInput !== null) {
|
|
1417
|
+
const inputs = gridRef.current?.querySelectorAll('input');
|
|
1418
|
+
inputs?.forEach(input => input.setAttribute('tabIndex', input.checked ? '0' : '-1'));
|
|
1421
1419
|
}
|
|
1422
|
-
}
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
})))))
|
|
1442
|
-
);
|
|
1420
|
+
}
|
|
1421
|
+
};
|
|
1422
|
+
return React__namespace.default.createElement(StyledCell, {
|
|
1423
|
+
key: value,
|
|
1424
|
+
role: role
|
|
1425
|
+
}, React__namespace.default.createElement(StyledColorSwatchLabel, {
|
|
1426
|
+
$backgroundColor: value
|
|
1427
|
+
}, React__namespace.default.createElement(reactTooltips.Tooltip, {
|
|
1428
|
+
content: label,
|
|
1429
|
+
zIndex: 1
|
|
1430
|
+
}, React__namespace.default.createElement(StyledColorSwatchInput, Object.assign({
|
|
1431
|
+
"aria-label": label,
|
|
1432
|
+
name: name,
|
|
1433
|
+
type: isCheckboxGroup ? 'checkbox' : 'radio',
|
|
1434
|
+
value: value,
|
|
1435
|
+
defaultChecked: defaultChecked,
|
|
1436
|
+
checked: checked,
|
|
1437
|
+
onBlur: handleBlur,
|
|
1438
|
+
onChange: handleChange
|
|
1439
|
+
}, gridCellProps))), React__namespace.default.createElement(StyledIcon, null)));
|
|
1440
|
+
})))));
|
|
1443
1441
|
});
|
|
1444
1442
|
ColorSwatch.displayName = 'ColorSwatch';
|
|
1445
1443
|
ColorSwatch.propTypes = {
|
|
@@ -1541,7 +1539,7 @@ const ColorSwatchDialog = React.forwardRef((_ref, ref) => {
|
|
|
1541
1539
|
}
|
|
1542
1540
|
onSelect && onSelect(row, col);
|
|
1543
1541
|
};
|
|
1544
|
-
return React__namespace.default.createElement(React__namespace.default.Fragment, null, children ? (
|
|
1542
|
+
return React__namespace.default.createElement(React__namespace.default.Fragment, null, children ? (React.cloneElement(React.Children.only(children), {
|
|
1545
1543
|
onClick,
|
|
1546
1544
|
ref: buttonRef
|
|
1547
1545
|
})) : React__namespace.default.createElement(StyledButton, Object.assign({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-colorpickers",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.1.0",
|
|
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.
|
|
27
|
-
"@zendeskgarden/react-forms": "^9.
|
|
28
|
-
"@zendeskgarden/react-modals": "^9.
|
|
29
|
-
"@zendeskgarden/react-tooltips": "^9.
|
|
26
|
+
"@zendeskgarden/react-buttons": "^9.1.0",
|
|
27
|
+
"@zendeskgarden/react-forms": "^9.1.0",
|
|
28
|
+
"@zendeskgarden/react-modals": "^9.1.0",
|
|
29
|
+
"@zendeskgarden/react-tooltips": "^9.1.0",
|
|
30
30
|
"lodash.isequal": "^4.5.0",
|
|
31
31
|
"lodash.throttle": "^4.1.1",
|
|
32
32
|
"polished": "^4.3.1",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/lodash.isequal": "4.5.8",
|
|
44
44
|
"@types/lodash.throttle": "4.1.9",
|
|
45
|
-
"@zendeskgarden/react-theming": "^9.
|
|
46
|
-
"@zendeskgarden/svg-icons": "7.
|
|
45
|
+
"@zendeskgarden/react-theming": "^9.1.0",
|
|
46
|
+
"@zendeskgarden/svg-icons": "7.3.0"
|
|
47
47
|
},
|
|
48
48
|
"keywords": [
|
|
49
49
|
"colorpicker",
|
|
@@ -55,5 +55,6 @@
|
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|
|
57
57
|
},
|
|
58
|
-
"zendeskgarden:src": "src/index.ts"
|
|
58
|
+
"zendeskgarden:src": "src/index.ts",
|
|
59
|
+
"gitHead": "a2842d18615ad057d75988fde4df5a0c79d2714e"
|
|
59
60
|
}
|