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