react-iro-gradient-picker 1.4.9 → 2.0.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/README.md +64 -0
- package/dist/components/ui/ColorPickerWrapper/ColorPickerWrapper.d.ts +33 -0
- package/dist/components/ui/ColorPickerWrapper/index.d.ts +2 -0
- package/dist/index.css +1 -1
- package/dist/index.es.css +1 -1
- package/dist/index.es.js +287 -85
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +287 -85
- package/dist/index.js.map +1 -1
- package/dist/lib/types/types.d.ts +10 -0
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -121,7 +121,12 @@ var ThemeProvider = function (_a) {
|
|
|
121
121
|
, defaultTheme = _b === void 0 ? 'dark' : _b // Dark theme as default
|
|
122
122
|
;
|
|
123
123
|
var _c = __read(useState(function () {
|
|
124
|
-
//
|
|
124
|
+
// If defaultTheme is explicitly provided (not default 'dark'), use it
|
|
125
|
+
// This allows stories to override localStorage
|
|
126
|
+
if (defaultTheme !== 'dark') {
|
|
127
|
+
return defaultTheme;
|
|
128
|
+
}
|
|
129
|
+
// Otherwise check localStorage first, then use default
|
|
125
130
|
if (typeof window !== 'undefined') {
|
|
126
131
|
var stored = localStorage.getItem('color-picker-theme');
|
|
127
132
|
return stored || defaultTheme;
|
|
@@ -5085,10 +5090,10 @@ var InputRgba = function (_a) {
|
|
|
5085
5090
|
};
|
|
5086
5091
|
return (React.createElement("div", { className: 'w-full' },
|
|
5087
5092
|
React.createElement("div", { className: 'flex flex-wrap gap-3' }, inputsData(inputsProps).map(function (item, index) {
|
|
5088
|
-
var wrapClass = item.wrapClass
|
|
5089
|
-
return (React.createElement("div", { key: index, className: cn('flex-1 min-w-0
|
|
5093
|
+
var wrapClass = item.wrapClass; item.labelSymbol; var idInput = item.idInput, valueInput = item.valueInput, labelArea = item.labelArea, onChangeInput = item.onChangeInput, name = item.name;
|
|
5094
|
+
return (React.createElement("div", { key: index, className: cn('flex-1 min-w-0', 'relative group', wrapClass) },
|
|
5090
5095
|
React.createElement("div", { className: 'relative' },
|
|
5091
|
-
React.createElement("input", { type: 'text', id: idInput, value: "#".concat(valueInput), "aria-label": labelArea, onChange: function (e) { return onChangeInput(e); }, onBlur: onHandleSubmit, onKeyPress: function (e) { return handlePressEnter(e, onHandleSubmit); }, className: cn('w-full py-2.5 text-md font-mono rounded-lg', 'focus:ring-2 focus:ring-blue-500/20 transition-all duration-200',
|
|
5096
|
+
React.createElement("input", { type: 'text', id: idInput, value: "#".concat(valueInput), "aria-label": labelArea, onChange: function (e) { return onChangeInput(e); }, onBlur: onHandleSubmit, onKeyPress: function (e) { return handlePressEnter(e, onHandleSubmit); }, className: cn('w-full py-2.5 px-3 text-md font-mono rounded-lg', 'focus:ring-2 focus:ring-blue-500/20 transition-all duration-200', name === 'alpha' && 'pr-7'), style: {
|
|
5092
5097
|
backgroundColor: 'var(--colorpicker-input-bg)',
|
|
5093
5098
|
color: 'var(--colorpicker-text)',
|
|
5094
5099
|
border: 'none',
|
|
@@ -5101,20 +5106,49 @@ var InputRgba = function (_a) {
|
|
|
5101
5106
|
|
|
5102
5107
|
// Lazy load iro.js to improve initial bundle size
|
|
5103
5108
|
var iroPromise = null;
|
|
5104
|
-
var loadIro = function () {
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5109
|
+
var loadIro = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
5110
|
+
return __generator(this, function (_a) {
|
|
5111
|
+
if (!iroPromise) {
|
|
5112
|
+
iroPromise = Promise.resolve().then(function () { return iro_es; }).then(function (module) { return module.default || module; });
|
|
5113
|
+
}
|
|
5114
|
+
return [2 /*return*/, iroPromise];
|
|
5115
|
+
});
|
|
5116
|
+
}); };
|
|
5110
5117
|
var IroColorPicker$1 = forwardRef(function (_a, ref) {
|
|
5111
5118
|
var width = _a.width, _b = _a.color, color = _b === void 0 ? '#ffffff' : _b, colors = _a.colors, _c = _a.display, display = _c === void 0 ? 'block' : _c, id = _a.id, layout = _a.layout, _d = _a.layoutDirection, layoutDirection = _d === void 0 ? 'vertical' : _d, _e = _a.padding, padding = _e === void 0 ? 6 : _e, _f = _a.margin, margin = _f === void 0 ? 12 : _f, _g = _a.handleRadius, handleRadius = _g === void 0 ? 8 : _g, activeHandleRadius = _a.activeHandleRadius, handleSvg = _a.handleSvg, _h = _a.handleProps, handleProps = _h === void 0 ? { x: 0, y: 0 } : _h, _j = _a.wheelLightness, wheelLightness = _j === void 0 ? true : _j, _k = _a.wheelAngle, wheelAngle = _k === void 0 ? 0 : _k, _l = _a.wheelDirection, wheelDirection = _l === void 0 ? 'anticlockwise' : _l, sliderSize = _a.sliderSize, boxHeight = _a.boxHeight, onColorChange = _a.onColorChange, onInputChange = _a.onInputChange, onInputStart = _a.onInputStart, onInputMove = _a.onInputMove, onInputEnd = _a.onInputEnd, onMount = _a.onMount;
|
|
5112
|
-
var
|
|
5119
|
+
var contextTheme = useTheme().theme;
|
|
5113
5120
|
var containerRef = useRef(null);
|
|
5114
5121
|
var colorPickerRef = useRef(null);
|
|
5122
|
+
// Detect theme from parent element as fallback
|
|
5123
|
+
var _m = __read(useState(contextTheme), 2), detectedTheme = _m[0], setDetectedTheme = _m[1];
|
|
5124
|
+
useEffect(function () {
|
|
5125
|
+
if (!containerRef.current)
|
|
5126
|
+
return;
|
|
5127
|
+
// Check parent elements for light/dark class
|
|
5128
|
+
var element = containerRef.current;
|
|
5129
|
+
var foundTheme = null;
|
|
5130
|
+
while (element) {
|
|
5131
|
+
if (element.classList.contains('light')) {
|
|
5132
|
+
foundTheme = 'light';
|
|
5133
|
+
break;
|
|
5134
|
+
}
|
|
5135
|
+
if (element.classList.contains('dark')) {
|
|
5136
|
+
foundTheme = 'dark';
|
|
5137
|
+
break;
|
|
5138
|
+
}
|
|
5139
|
+
element = element.parentElement;
|
|
5140
|
+
}
|
|
5141
|
+
if (foundTheme) {
|
|
5142
|
+
setDetectedTheme(foundTheme);
|
|
5143
|
+
}
|
|
5144
|
+
else {
|
|
5145
|
+
setDetectedTheme(contextTheme);
|
|
5146
|
+
}
|
|
5147
|
+
}, [contextTheme]);
|
|
5148
|
+
var theme = detectedTheme;
|
|
5115
5149
|
var isUpdatingColor = useRef(false);
|
|
5116
|
-
var
|
|
5117
|
-
var
|
|
5150
|
+
var _o = __read(useState(width || 200), 2), containerWidth = _o[0], setContainerWidth = _o[1];
|
|
5151
|
+
var _p = __read(useState(true), 2), isLoading = _p[0], setIsLoading = _p[1];
|
|
5118
5152
|
// Set up ResizeObserver to make the color picker responsive
|
|
5119
5153
|
// Only when width prop is NOT provided (parent doesn't control width)
|
|
5120
5154
|
useEffect(function () {
|
|
@@ -5163,7 +5197,7 @@ var IroColorPicker$1 = forwardRef(function (_a, ref) {
|
|
|
5163
5197
|
}); });
|
|
5164
5198
|
// Create a shared picker creation function with enhanced error handling
|
|
5165
5199
|
var createColorPicker = useCallback(function (pickerWidth) { return __awaiter(void 0, void 0, void 0, function () {
|
|
5166
|
-
var
|
|
5200
|
+
var iro, layoutConfig, themeBorderColor, themeBorderWidth, options, applyThemeStyles, observer;
|
|
5167
5201
|
return __generator(this, function (_a) {
|
|
5168
5202
|
switch (_a.label) {
|
|
5169
5203
|
case 0:
|
|
@@ -5195,14 +5229,14 @@ var IroColorPicker$1 = forwardRef(function (_a, ref) {
|
|
|
5195
5229
|
console.warn('IroColorPicker: Error cleaning up existing picker:', error);
|
|
5196
5230
|
}
|
|
5197
5231
|
}
|
|
5198
|
-
currentContainer = containerRef.current;
|
|
5199
|
-
// IMPORTANT: Clear any existing DOM content first
|
|
5200
|
-
if (currentContainer) {
|
|
5201
|
-
currentContainer.innerHTML = '';
|
|
5202
|
-
}
|
|
5203
5232
|
return [4 /*yield*/, loadIro()];
|
|
5204
5233
|
case 1:
|
|
5205
5234
|
iro = _a.sent();
|
|
5235
|
+
// Check if component is still mounted after async load
|
|
5236
|
+
if (!containerRef.current) {
|
|
5237
|
+
console.warn('IroColorPicker: Component unmounted during iro.js load');
|
|
5238
|
+
return [2 /*return*/];
|
|
5239
|
+
}
|
|
5206
5240
|
layoutConfig = layout;
|
|
5207
5241
|
if (typeof layout === 'string') {
|
|
5208
5242
|
if (layout === 'wheel-value') {
|
|
@@ -5292,30 +5326,59 @@ var IroColorPicker$1 = forwardRef(function (_a, ref) {
|
|
|
5292
5326
|
applyThemeStyles = function () {
|
|
5293
5327
|
if (!containerRef.current)
|
|
5294
5328
|
return;
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
rect.setAttribute('stroke', '#e5e7eb');
|
|
5305
|
-
rect.setAttribute('stroke-width', '1');
|
|
5306
|
-
}
|
|
5307
|
-
else {
|
|
5308
|
-
rect.setAttribute('fill', '#374151');
|
|
5309
|
-
rect.setAttribute('stroke', '#6b7280');
|
|
5310
|
-
rect.setAttribute('stroke-width', '1');
|
|
5311
|
-
}
|
|
5329
|
+
// Target the main iro containers including IroColorPicker wrapper
|
|
5330
|
+
var pickers = containerRef.current.querySelectorAll('.IroColorPicker');
|
|
5331
|
+
var wheels = containerRef.current.querySelectorAll('.IroWheel');
|
|
5332
|
+
var sliders = containerRef.current.querySelectorAll('.IroSlider');
|
|
5333
|
+
var boxes = containerRef.current.querySelectorAll('.IroBox');
|
|
5334
|
+
if (theme === 'light') {
|
|
5335
|
+
// Light theme - keep iro elements transparent so container bg shows
|
|
5336
|
+
pickers.forEach(function (el) {
|
|
5337
|
+
el.style.setProperty('background-color', 'transparent', 'important');
|
|
5312
5338
|
});
|
|
5313
|
-
|
|
5339
|
+
wheels.forEach(function (el) {
|
|
5340
|
+
el.style.setProperty('background-color', 'transparent', 'important');
|
|
5341
|
+
});
|
|
5342
|
+
sliders.forEach(function (el) {
|
|
5343
|
+
el.style.setProperty('background-color', 'transparent', 'important');
|
|
5344
|
+
});
|
|
5345
|
+
boxes.forEach(function (el) {
|
|
5346
|
+
el.style.setProperty('background-color', 'transparent', 'important');
|
|
5347
|
+
});
|
|
5348
|
+
}
|
|
5349
|
+
else {
|
|
5350
|
+
// Dark theme - transparent to let parent bg show
|
|
5351
|
+
pickers.forEach(function (el) {
|
|
5352
|
+
el.style.setProperty('background-color', 'transparent', 'important');
|
|
5353
|
+
});
|
|
5354
|
+
wheels.forEach(function (el) {
|
|
5355
|
+
el.style.setProperty('background-color', 'transparent', 'important');
|
|
5356
|
+
});
|
|
5357
|
+
sliders.forEach(function (el) {
|
|
5358
|
+
el.style.setProperty('background-color', 'transparent', 'important');
|
|
5359
|
+
});
|
|
5360
|
+
boxes.forEach(function (el) {
|
|
5361
|
+
el.style.setProperty('background-color', 'transparent', 'important');
|
|
5362
|
+
});
|
|
5363
|
+
}
|
|
5314
5364
|
};
|
|
5315
|
-
// Apply styles immediately
|
|
5365
|
+
// Apply styles immediately
|
|
5316
5366
|
applyThemeStyles();
|
|
5317
|
-
|
|
5318
|
-
|
|
5367
|
+
observer = new MutationObserver(function () {
|
|
5368
|
+
applyThemeStyles();
|
|
5369
|
+
});
|
|
5370
|
+
if (containerRef.current) {
|
|
5371
|
+
observer.observe(containerRef.current, {
|
|
5372
|
+
childList: true,
|
|
5373
|
+
subtree: true,
|
|
5374
|
+
attributes: true
|
|
5375
|
+
});
|
|
5376
|
+
}
|
|
5377
|
+
// Apply on timers as fallback
|
|
5378
|
+
setTimeout(applyThemeStyles, 50);
|
|
5379
|
+
setTimeout(applyThemeStyles, 200);
|
|
5380
|
+
setTimeout(applyThemeStyles, 500);
|
|
5381
|
+
// Set up event listeners BEFORE returning the cleanup function
|
|
5319
5382
|
if (onColorChange) {
|
|
5320
5383
|
colorPickerRef.current.on('color:change', function (color) {
|
|
5321
5384
|
if (!isUpdatingColor.current) {
|
|
@@ -5338,7 +5401,8 @@ var IroColorPicker$1 = forwardRef(function (_a, ref) {
|
|
|
5338
5401
|
if (onMount) {
|
|
5339
5402
|
colorPickerRef.current.on('mount', onMount);
|
|
5340
5403
|
}
|
|
5341
|
-
|
|
5404
|
+
// Cleanup observer on unmount
|
|
5405
|
+
return [2 /*return*/, function () { return observer.disconnect(); }];
|
|
5342
5406
|
}
|
|
5343
5407
|
});
|
|
5344
5408
|
}); }, [
|
|
@@ -5368,7 +5432,7 @@ var IroColorPicker$1 = forwardRef(function (_a, ref) {
|
|
|
5368
5432
|
onMount
|
|
5369
5433
|
]);
|
|
5370
5434
|
// Cleanup function
|
|
5371
|
-
|
|
5435
|
+
useCallback(function () {
|
|
5372
5436
|
if (colorPickerRef.current) {
|
|
5373
5437
|
try {
|
|
5374
5438
|
// Clean up event listeners
|
|
@@ -5433,13 +5497,12 @@ var IroColorPicker$1 = forwardRef(function (_a, ref) {
|
|
|
5433
5497
|
}, 100); // Increased from 50ms to 100ms
|
|
5434
5498
|
return function () { return clearTimeout(timeoutId); };
|
|
5435
5499
|
};
|
|
5436
|
-
var
|
|
5500
|
+
var cleanupFn = createWithRetry();
|
|
5437
5501
|
return function () {
|
|
5438
|
-
if (
|
|
5439
|
-
|
|
5440
|
-
cleanup();
|
|
5502
|
+
if (cleanupFn)
|
|
5503
|
+
cleanupFn();
|
|
5441
5504
|
};
|
|
5442
|
-
}, [width, theme, createColorPicker
|
|
5505
|
+
}, [width, theme, createColorPicker]);
|
|
5443
5506
|
// useEffect for when containerWidth is used (internal ResizeObserver)
|
|
5444
5507
|
useEffect(function () {
|
|
5445
5508
|
if (width)
|
|
@@ -5468,13 +5531,12 @@ var IroColorPicker$1 = forwardRef(function (_a, ref) {
|
|
|
5468
5531
|
}, 100); // Increased from 50ms to 100ms
|
|
5469
5532
|
return function () { return clearTimeout(timeoutId); };
|
|
5470
5533
|
};
|
|
5471
|
-
var
|
|
5534
|
+
var cleanupFn = createWithRetry();
|
|
5472
5535
|
return function () {
|
|
5473
|
-
if (
|
|
5474
|
-
|
|
5475
|
-
cleanup();
|
|
5536
|
+
if (cleanupFn)
|
|
5537
|
+
cleanupFn();
|
|
5476
5538
|
};
|
|
5477
|
-
}, [containerWidth, theme, createColorPicker,
|
|
5539
|
+
}, [containerWidth, theme, createColorPicker, width]);
|
|
5478
5540
|
// Update color when prop changes
|
|
5479
5541
|
useEffect(function () {
|
|
5480
5542
|
if (colorPickerRef.current && !colors && color) {
|
|
@@ -5517,6 +5579,59 @@ var IroColorPicker$1 = forwardRef(function (_a, ref) {
|
|
|
5517
5579
|
});
|
|
5518
5580
|
}
|
|
5519
5581
|
}, [colors]);
|
|
5582
|
+
// Apply theme styles when theme changes without recreating picker
|
|
5583
|
+
useEffect(function () {
|
|
5584
|
+
if (!colorPickerRef.current || !containerRef.current)
|
|
5585
|
+
return;
|
|
5586
|
+
var applyThemeStyles = function () {
|
|
5587
|
+
if (!containerRef.current)
|
|
5588
|
+
return;
|
|
5589
|
+
var pickers = containerRef.current.querySelectorAll('.IroColorPicker');
|
|
5590
|
+
var wheels = containerRef.current.querySelectorAll('.IroWheel');
|
|
5591
|
+
var sliders = containerRef.current.querySelectorAll('.IroSlider');
|
|
5592
|
+
var boxes = containerRef.current.querySelectorAll('.IroBox');
|
|
5593
|
+
if (theme === 'light') {
|
|
5594
|
+
pickers.forEach(function (el) {
|
|
5595
|
+
el.style.setProperty('background-color', 'transparent', 'important');
|
|
5596
|
+
});
|
|
5597
|
+
wheels.forEach(function (el) {
|
|
5598
|
+
el.style.setProperty('background-color', 'transparent', 'important');
|
|
5599
|
+
});
|
|
5600
|
+
sliders.forEach(function (el) {
|
|
5601
|
+
el.style.setProperty('background-color', 'transparent', 'important');
|
|
5602
|
+
});
|
|
5603
|
+
boxes.forEach(function (el) {
|
|
5604
|
+
el.style.setProperty('background-color', 'transparent', 'important');
|
|
5605
|
+
});
|
|
5606
|
+
var borders = containerRef.current.querySelectorAll('.IroWheelBorder');
|
|
5607
|
+
borders.forEach(function (el) {
|
|
5608
|
+
el.style.setProperty('border-color', '#e5e7eb', 'important');
|
|
5609
|
+
});
|
|
5610
|
+
}
|
|
5611
|
+
else {
|
|
5612
|
+
// Dark theme - transparent to let parent bg show
|
|
5613
|
+
pickers.forEach(function (el) {
|
|
5614
|
+
el.style.setProperty('background-color', 'transparent', 'important');
|
|
5615
|
+
});
|
|
5616
|
+
wheels.forEach(function (el) {
|
|
5617
|
+
el.style.setProperty('background-color', 'transparent', 'important');
|
|
5618
|
+
});
|
|
5619
|
+
sliders.forEach(function (el) {
|
|
5620
|
+
el.style.setProperty('background-color', 'transparent', 'important');
|
|
5621
|
+
});
|
|
5622
|
+
boxes.forEach(function (el) {
|
|
5623
|
+
el.style.setProperty('background-color', 'transparent', 'important');
|
|
5624
|
+
});
|
|
5625
|
+
}
|
|
5626
|
+
};
|
|
5627
|
+
applyThemeStyles();
|
|
5628
|
+
var timer1 = setTimeout(applyThemeStyles, 50);
|
|
5629
|
+
var timer2 = setTimeout(applyThemeStyles, 150);
|
|
5630
|
+
return function () {
|
|
5631
|
+
clearTimeout(timer1);
|
|
5632
|
+
clearTimeout(timer2);
|
|
5633
|
+
};
|
|
5634
|
+
}, [theme]);
|
|
5520
5635
|
return (React.createElement("div", { ref: containerRef, style: {
|
|
5521
5636
|
display: 'flex',
|
|
5522
5637
|
width: '100%',
|
|
@@ -5524,8 +5639,9 @@ var IroColorPicker$1 = forwardRef(function (_a, ref) {
|
|
|
5524
5639
|
minWidth: 0,
|
|
5525
5640
|
overflow: 'hidden',
|
|
5526
5641
|
justifyContent: 'center',
|
|
5527
|
-
minHeight: isLoading ?
|
|
5528
|
-
position: 'relative'
|
|
5642
|
+
minHeight: isLoading ? width || containerWidth : 'auto',
|
|
5643
|
+
position: 'relative',
|
|
5644
|
+
backgroundColor: 'transparent'
|
|
5529
5645
|
} }, isLoading && (React.createElement("div", { style: {
|
|
5530
5646
|
position: 'absolute',
|
|
5531
5647
|
inset: 0,
|
|
@@ -6354,7 +6470,7 @@ var useDebounce = (function (value, delay) {
|
|
|
6354
6470
|
});
|
|
6355
6471
|
|
|
6356
6472
|
var IroGradient = function (_a) {
|
|
6357
|
-
var _b = _a.value, value = _b === void 0 ? 'linear-gradient(90deg, #ffffff 0%, #000000 100%)' : _b, _c = _a.onChange, onChange = _c === void 0 ? function () { return ({}); } : _c, _d = _a.format, format = _d === void 0 ? 'rgb' : _d, _e = _a.debounceMS, debounceMS = _e === void 0 ? 300 : _e, _f = _a.debounce, debounce = _f === void 0 ? true : _f, _g = _a.showAlpha, showAlpha = _g === void 0 ? true : _g, _h = _a.showInputs, showInputs = _h === void 0 ? true : _h, _j = _a.showGradientResult, showGradientResult = _j === void 0 ? true : _j, _k = _a.showGradientStops, showGradientStops = _k === void 0 ? true : _k, _l = _a.showGradientMode, showGradientMode = _l === void 0 ? true : _l, _m = _a.showGradientAngle, showGradientAngle = _m === void 0 ? true : _m, _o = _a.showGradientPosition, showGradientPosition = _o === void 0 ? true : _o, _p = _a.allowAddGradientStops, allowAddGradientStops = _p === void 0 ? true : _p, _q = _a.colorBoardHeight, colorBoardHeight = _q === void 0 ? 120 : _q, defaultColors = _a.defaultColors, _r = _a.showReset, showReset = _r === void 0 ? false : _r, onReset = _a.onReset, _s = _a.popupWidth, popupWidth = _s === void 0 ? 280 : _s;
|
|
6473
|
+
var _b = _a.value, value = _b === void 0 ? 'linear-gradient(90deg, #ffffff 0%, #000000 100%)' : _b, _c = _a.onChange, onChange = _c === void 0 ? function () { return ({}); } : _c, onColorChangeImmediate = _a.onColorChangeImmediate, _d = _a.format, format = _d === void 0 ? 'rgb' : _d, _e = _a.debounceMS, debounceMS = _e === void 0 ? 300 : _e, _f = _a.debounce, debounce = _f === void 0 ? true : _f, _g = _a.showAlpha, showAlpha = _g === void 0 ? true : _g, _h = _a.showInputs, showInputs = _h === void 0 ? true : _h, _j = _a.showGradientResult, showGradientResult = _j === void 0 ? true : _j, _k = _a.showGradientStops, showGradientStops = _k === void 0 ? true : _k, _l = _a.showGradientMode, showGradientMode = _l === void 0 ? true : _l, _m = _a.showGradientAngle, showGradientAngle = _m === void 0 ? true : _m, _o = _a.showGradientPosition, showGradientPosition = _o === void 0 ? true : _o, _p = _a.allowAddGradientStops, allowAddGradientStops = _p === void 0 ? true : _p, _q = _a.colorBoardHeight, colorBoardHeight = _q === void 0 ? 120 : _q, defaultColors = _a.defaultColors, _r = _a.showReset, showReset = _r === void 0 ? false : _r, onReset = _a.onReset, _s = _a.popupWidth, popupWidth = _s === void 0 ? 280 : _s;
|
|
6358
6474
|
// Store the initial value for reset functionality
|
|
6359
6475
|
var initialValue = useRef(value);
|
|
6360
6476
|
var parsedColors = useCallback(function () {
|
|
@@ -6573,6 +6689,13 @@ var IroGradient = function (_a) {
|
|
|
6573
6689
|
}
|
|
6574
6690
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6575
6691
|
}, [debounceColor]);
|
|
6692
|
+
// Call immediate callback for real-time updates (e.g., wrapper background)
|
|
6693
|
+
useEffect(function () {
|
|
6694
|
+
if (onColorChangeImmediate && color.gradient) {
|
|
6695
|
+
onColorChangeImmediate(color.gradient);
|
|
6696
|
+
}
|
|
6697
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6698
|
+
}, [color.gradient]);
|
|
6576
6699
|
// Initialize iro picker with current activeColor when component mounts or picker becomes ready
|
|
6577
6700
|
useEffect(function () {
|
|
6578
6701
|
var initializeIroPicker = function () {
|
|
@@ -6759,7 +6882,8 @@ var IroGradient = function (_a) {
|
|
|
6759
6882
|
} },
|
|
6760
6883
|
React.createElement("div", { className: 'relative', ref: containerRef },
|
|
6761
6884
|
React.createElement("div", { className: 'flex justify-center items-center rounded-lg', style: {
|
|
6762
|
-
height: colorBoardHeight + pickerWidth
|
|
6885
|
+
height: colorBoardHeight + pickerWidth,
|
|
6886
|
+
backgroundColor: 'transparent'
|
|
6763
6887
|
} },
|
|
6764
6888
|
React.createElement(IroColorPicker$1, { ref: iroPickerRef, width: pickerWidth, color: iroColorValue, layout: layoutConfig, onColorChange: handleIroColorChange }))),
|
|
6765
6889
|
React.createElement("div", { className: 'rounded-lg colorpicker-glass px-4' },
|
|
@@ -6783,7 +6907,7 @@ var IroGradient = function (_a) {
|
|
|
6783
6907
|
};
|
|
6784
6908
|
|
|
6785
6909
|
var IroSolidColorPicker = function (_a) {
|
|
6786
|
-
var _b = _a.value, value = _b === void 0 ? '#ffffff' : _b, _c = _a.onChange, onChange = _c === void 0 ? function () { return ({}); } : _c, _d = _a.format, format = _d === void 0 ? 'rgb' : _d, _e = _a.debounceMS, debounceMS = _e === void 0 ? 300 : _e, _f = _a.debounce, debounce = _f === void 0 ? true : _f, _g = _a.showAlpha, showAlpha = _g === void 0 ? true : _g, _h = _a.showInputs, showInputs = _h === void 0 ? true : _h, defaultColors = _a.defaultColors, _j = _a.showReset, showReset = _j === void 0 ? false : _j, onReset = _a.onReset, _k = _a.popupWidth, popupWidth = _k === void 0 ? 280 : _k;
|
|
6910
|
+
var _b = _a.value, value = _b === void 0 ? '#ffffff' : _b, _c = _a.onChange, onChange = _c === void 0 ? function () { return ({}); } : _c, onColorChangeImmediate = _a.onColorChangeImmediate, _d = _a.format, format = _d === void 0 ? 'rgb' : _d, _e = _a.debounceMS, debounceMS = _e === void 0 ? 300 : _e, _f = _a.debounce, debounce = _f === void 0 ? true : _f, _g = _a.showAlpha, showAlpha = _g === void 0 ? true : _g, _h = _a.showInputs, showInputs = _h === void 0 ? true : _h, defaultColors = _a.defaultColors, _j = _a.showReset, showReset = _j === void 0 ? false : _j, onReset = _a.onReset, _k = _a.popupWidth, popupWidth = _k === void 0 ? 280 : _k;
|
|
6787
6911
|
var node = useRef(null);
|
|
6788
6912
|
var iroPickerRef = useRef(null);
|
|
6789
6913
|
// Store the initial value for reset functionality
|
|
@@ -6909,6 +7033,13 @@ var IroSolidColorPicker = function (_a) {
|
|
|
6909
7033
|
};
|
|
6910
7034
|
setInit(false);
|
|
6911
7035
|
setColor(newColor);
|
|
7036
|
+
// Call immediate callback for real-time updates (e.g., wrapper background)
|
|
7037
|
+
if (onColorChangeImmediate) {
|
|
7038
|
+
var rgba = tinycolor(newColor.hex);
|
|
7039
|
+
rgba.setAlpha(newColor.alpha / 100);
|
|
7040
|
+
var formattedColor = checkFormat(rgba.toRgbString(), format, showAlpha, newColor.alpha);
|
|
7041
|
+
onColorChangeImmediate(formattedColor);
|
|
7042
|
+
}
|
|
6912
7043
|
};
|
|
6913
7044
|
var handleInputChange = function (newColor) {
|
|
6914
7045
|
setColor(newColor);
|
|
@@ -7002,18 +7133,21 @@ var IroSolidColorPicker = function (_a) {
|
|
|
7002
7133
|
minWidth: 0,
|
|
7003
7134
|
boxSizing: 'border-box'
|
|
7004
7135
|
} },
|
|
7005
|
-
React.createElement("div", { className: 'relative overflow-hidden' },
|
|
7006
|
-
React.createElement("div", { className: 'flex justify-center items-center rounded-lg
|
|
7136
|
+
React.createElement("div", { className: 'relative overflow-hidden', style: { backgroundColor: 'transparent' } },
|
|
7137
|
+
React.createElement("div", { className: 'flex justify-center items-center rounded-lg w-full overflow-hidden', style: {
|
|
7007
7138
|
height: Math.max(pickerWidth + 80, 220), // Better height calculation
|
|
7008
7139
|
width: '100%',
|
|
7009
7140
|
minWidth: 0,
|
|
7010
7141
|
maxWidth: '100%',
|
|
7011
|
-
boxSizing: 'border-box'
|
|
7142
|
+
boxSizing: 'border-box',
|
|
7143
|
+
backgroundColor: 'var(--colorpicker-panel-bg)',
|
|
7144
|
+
border: '1px solid var(--colorpicker-border)'
|
|
7012
7145
|
} },
|
|
7013
7146
|
React.createElement("div", { style: {
|
|
7014
7147
|
width: pickerWidth,
|
|
7015
7148
|
height: 'fit-content',
|
|
7016
|
-
maxWidth: '90%'
|
|
7149
|
+
maxWidth: '90%',
|
|
7150
|
+
backgroundColor: 'transparent'
|
|
7017
7151
|
} },
|
|
7018
7152
|
React.createElement(IroColorPicker$1, { ref: iroPickerRef, width: pickerWidth, color: iroColorValue, layout: layoutConfig, onColorChange: handleColorChange })))),
|
|
7019
7153
|
React.createElement("div", { className: 'border-t pt-4 colorpicker-glass rounded-lg' },
|
|
@@ -7038,7 +7172,11 @@ var PopupTabs = function (_a) {
|
|
|
7038
7172
|
activeTab: activeTab
|
|
7039
7173
|
});
|
|
7040
7174
|
});
|
|
7041
|
-
return (React.createElement("div", { className: 'relative rounded-md', style: {
|
|
7175
|
+
return (React.createElement("div", { className: 'relative rounded-md', style: {
|
|
7176
|
+
width: "".concat(popupWidth, "px"),
|
|
7177
|
+
backgroundColor: 'var(--colorpicker-bg)',
|
|
7178
|
+
color: 'var(--colorpicker-text)'
|
|
7179
|
+
} }, childrenContact));
|
|
7042
7180
|
};
|
|
7043
7181
|
var PopupTabsHeaderLabel = function (_a) {
|
|
7044
7182
|
var children = _a.children, activeTab = _a.activeTab, tabName = _a.tabName, onClick = _a.onClick;
|
|
@@ -7053,7 +7191,7 @@ var PopupTabsHeader = function (_a) {
|
|
|
7053
7191
|
activeTab: activeTab
|
|
7054
7192
|
});
|
|
7055
7193
|
});
|
|
7056
|
-
return (React.createElement("div", { className: 'w-full h-12 flex rounded-md rounded-b-none overflow-hidden colorpicker-glass shadow-inner' }, childrenContact));
|
|
7194
|
+
return (React.createElement("div", { className: 'w-full h-12 flex rounded-md rounded-b-none overflow-hidden colorpicker-glass shadow-inner', style: { backgroundColor: 'var(--colorpicker-panel-bg)' } }, childrenContact));
|
|
7057
7195
|
};
|
|
7058
7196
|
var PopupTabsBody = function (_a) {
|
|
7059
7197
|
var children = _a.children, activeTab = _a.activeTab;
|
|
@@ -7062,7 +7200,10 @@ var PopupTabsBody = function (_a) {
|
|
|
7062
7200
|
activeTab: activeTab
|
|
7063
7201
|
});
|
|
7064
7202
|
});
|
|
7065
|
-
return React.createElement("div", { className: 'p-4'
|
|
7203
|
+
return (React.createElement("div", { className: 'p-4', style: {
|
|
7204
|
+
backgroundColor: 'var(--colorpicker-bg)',
|
|
7205
|
+
color: 'var(--colorpicker-text)'
|
|
7206
|
+
} }, childrenContact));
|
|
7066
7207
|
};
|
|
7067
7208
|
var PopupTabsBodyItem = function (_a) {
|
|
7068
7209
|
var children = _a.children, activeTab = _a.activeTab, tabName = _a.tabName;
|
|
@@ -7073,14 +7214,22 @@ var PopupTabsBodyItem = function (_a) {
|
|
|
7073
7214
|
};
|
|
7074
7215
|
|
|
7075
7216
|
var ColorPicker = function (_a) {
|
|
7076
|
-
var _b = _a.value, value = _b === void 0 ? '#ffffff' : _b, _c = _a.format, format = _c === void 0 ? 'rgb' : _c, _d = _a.gradient, gradient = _d === void 0 ? false : _d, _e = _a.solid, solid = _e === void 0 ? true : _e, _f = _a.debounceMS, debounceMS = _f === void 0 ? 300 : _f, _g = _a.debounce, debounce = _g === void 0 ? true : _g, _h = _a.showAlpha, showAlpha = _h === void 0 ? true : _h, _j = _a.showInputs, showInputs = _j === void 0 ? true : _j, _k = _a.showGradientResult, showGradientResult = _k === void 0 ? true : _k, _l = _a.showGradientStops, showGradientStops = _l === void 0 ? true : _l, _m = _a.showGradientMode, showGradientMode = _m === void 0 ? true : _m, _o = _a.showGradientAngle, showGradientAngle = _o === void 0 ? true : _o, _p = _a.showGradientPosition, showGradientPosition = _p === void 0 ? true : _p, _q = _a.allowAddGradientStops, allowAddGradientStops = _q === void 0 ? true : _q, _r = _a.popupWidth, popupWidth = _r === void 0 ? 267 : _r, _s = _a.colorBoardHeight, colorBoardHeight = _s === void 0 ? 120 : _s, _t = _a.defaultColors, defaultColors = _t === void 0 ? DEFAULT_COLORS : _t, defaultActiveTab = _a.defaultActiveTab, _u = _a.defaultGradientIndex, defaultGradientIndex = _u === void 0 ? 7 : _u, onChangeTabs = _a.onChangeTabs, _v = _a.onChange, onChange = _v === void 0 ? function () { return ({}); } : _v, _w = _a.showReset, showReset = _w === void 0 ? false : _w, onReset = _a.onReset
|
|
7217
|
+
var _b = _a.value, value = _b === void 0 ? '#ffffff' : _b, _c = _a.format, format = _c === void 0 ? 'rgb' : _c, _d = _a.gradient, gradient = _d === void 0 ? false : _d, _e = _a.solid, solid = _e === void 0 ? true : _e, _f = _a.debounceMS, debounceMS = _f === void 0 ? 300 : _f, _g = _a.debounce, debounce = _g === void 0 ? true : _g, _h = _a.showAlpha, showAlpha = _h === void 0 ? true : _h, _j = _a.showInputs, showInputs = _j === void 0 ? true : _j, _k = _a.showGradientResult, showGradientResult = _k === void 0 ? true : _k, _l = _a.showGradientStops, showGradientStops = _l === void 0 ? true : _l, _m = _a.showGradientMode, showGradientMode = _m === void 0 ? true : _m, _o = _a.showGradientAngle, showGradientAngle = _o === void 0 ? true : _o, _p = _a.showGradientPosition, showGradientPosition = _p === void 0 ? true : _p, _q = _a.allowAddGradientStops, allowAddGradientStops = _q === void 0 ? true : _q, _r = _a.popupWidth, popupWidth = _r === void 0 ? 267 : _r, _s = _a.colorBoardHeight, colorBoardHeight = _s === void 0 ? 120 : _s, _t = _a.defaultColors, defaultColors = _t === void 0 ? DEFAULT_COLORS : _t, defaultActiveTab = _a.defaultActiveTab, _u = _a.defaultGradientIndex, defaultGradientIndex = _u === void 0 ? 7 : _u, onChangeTabs = _a.onChangeTabs, _v = _a.onChange, onChange = _v === void 0 ? function () { return ({}); } : _v, _w = _a.showReset, showReset = _w === void 0 ? false : _w, onReset = _a.onReset,
|
|
7218
|
+
// Theme prop
|
|
7219
|
+
_x = _a.theme,
|
|
7220
|
+
// Theme prop
|
|
7221
|
+
theme = _x === void 0 ? 'dark' : _x,
|
|
7222
|
+
// Wrapper props
|
|
7223
|
+
_y = _a.showWrapper,
|
|
7224
|
+
// Wrapper props
|
|
7225
|
+
showWrapper = _y === void 0 ? false : _y, wrapperBackground = _a.wrapperBackground, _z = _a.wrapperClassName, wrapperClassName = _z === void 0 ? '' : _z, _0 = _a.wrapperHeight, wrapperHeight = _0 === void 0 ? 'auto' : _0, _1 = _a.wrapperWidth, wrapperWidth = _1 === void 0 ? 'auto' : _1, _2 = _a.wrapperPadding, wrapperPadding = _2 === void 0 ? '24px' : _2, _3 = _a.wrapperRounded, wrapperRounded = _3 === void 0 ? true : _3;
|
|
7077
7226
|
// Convert object value to CSS string for internal use
|
|
7078
7227
|
var cssValue = normalizeGradientValue(value);
|
|
7079
7228
|
// Auto-switch to gradient tab if receiving gradient object
|
|
7080
7229
|
var initialTab = isGradientObject(value)
|
|
7081
7230
|
? 'gradient'
|
|
7082
7231
|
: defaultActiveTab || getIndexActiveTag(value);
|
|
7083
|
-
var
|
|
7232
|
+
var _4 = __read(useState(initialTab), 2), activeTab = _4[0], setActiveTab = _4[1];
|
|
7084
7233
|
// Track the gradient value separately - use default gradient at specified index or fallback
|
|
7085
7234
|
var getDefaultGradient = function () {
|
|
7086
7235
|
var gradients = defaultColors.filter(function (color) {
|
|
@@ -7094,9 +7243,11 @@ var ColorPicker = function (_a) {
|
|
|
7094
7243
|
}
|
|
7095
7244
|
return 'linear-gradient(90deg, rgb(255, 177, 153) 0%, rgb(255, 8, 68) 100%)';
|
|
7096
7245
|
};
|
|
7097
|
-
var
|
|
7246
|
+
var _5 = __read(useState(isGradientObject(value) || getIndexActiveTag(value) === 'gradient'
|
|
7098
7247
|
? cssValue
|
|
7099
|
-
: getDefaultGradient()), 2), gradientValue =
|
|
7248
|
+
: getDefaultGradient()), 2), gradientValue = _5[0], setGradientValue = _5[1];
|
|
7249
|
+
// Track current color for wrapper background (updates in real-time)
|
|
7250
|
+
var _6 = __read(useState(cssValue), 2), currentWrapperColor = _6[0], setCurrentWrapperColor = _6[1];
|
|
7100
7251
|
// Auto-switch tab when value changes from object to string or vice versa
|
|
7101
7252
|
React.useEffect(function () {
|
|
7102
7253
|
if (isGradientObject(value) && activeTab !== 'gradient') {
|
|
@@ -7111,12 +7262,16 @@ var ColorPicker = function (_a) {
|
|
|
7111
7262
|
// Update gradient value if external value is a gradient
|
|
7112
7263
|
setGradientValue(cssValue);
|
|
7113
7264
|
}
|
|
7265
|
+
// Also update wrapper color when value prop changes
|
|
7266
|
+
setCurrentWrapperColor(cssValue);
|
|
7114
7267
|
}, [value, cssValue, activeTab, onChangeTabs]);
|
|
7115
7268
|
var onChangeSolid = function (value) {
|
|
7269
|
+
setCurrentWrapperColor(value); // Update wrapper immediately
|
|
7116
7270
|
onChange(value);
|
|
7117
7271
|
};
|
|
7118
7272
|
var onChangeGradient = function (value) {
|
|
7119
7273
|
setGradientValue(value); // Track gradient changes
|
|
7274
|
+
setCurrentWrapperColor(value); // Update wrapper immediately
|
|
7120
7275
|
onChange(value);
|
|
7121
7276
|
};
|
|
7122
7277
|
var onChangeTab = function (tab) {
|
|
@@ -7129,24 +7284,71 @@ var ColorPicker = function (_a) {
|
|
|
7129
7284
|
onChange(gradientValue);
|
|
7130
7285
|
}
|
|
7131
7286
|
};
|
|
7132
|
-
|
|
7133
|
-
|
|
7134
|
-
|
|
7135
|
-
|
|
7136
|
-
|
|
7137
|
-
|
|
7138
|
-
|
|
7139
|
-
|
|
7140
|
-
|
|
7141
|
-
|
|
7142
|
-
|
|
7143
|
-
|
|
7144
|
-
|
|
7145
|
-
|
|
7146
|
-
|
|
7287
|
+
// Wrapper styling - use currentWrapperColor for real-time updates
|
|
7288
|
+
var wrapperStyle = showWrapper
|
|
7289
|
+
? {
|
|
7290
|
+
background: wrapperBackground || currentWrapperColor || 'transparent',
|
|
7291
|
+
height: wrapperHeight,
|
|
7292
|
+
width: wrapperWidth,
|
|
7293
|
+
padding: wrapperPadding,
|
|
7294
|
+
borderRadius: wrapperRounded ? '1rem' : '0',
|
|
7295
|
+
display: 'flex',
|
|
7296
|
+
justifyContent: 'center',
|
|
7297
|
+
alignItems: 'center',
|
|
7298
|
+
minHeight: 'auto',
|
|
7299
|
+
textAlign: 'center',
|
|
7300
|
+
transition: 'background 0.3s ease',
|
|
7301
|
+
boxSizing: 'border-box'
|
|
7302
|
+
}
|
|
7303
|
+
: undefined;
|
|
7304
|
+
// Theme-specific inline styles for maximum specificity
|
|
7305
|
+
var themeStyles = theme === 'light'
|
|
7306
|
+
? {
|
|
7307
|
+
backgroundColor: '#ffffff',
|
|
7308
|
+
color: '#1a1d23',
|
|
7309
|
+
'--colorpicker-bg': '#ffffff',
|
|
7310
|
+
'--colorpicker-text': '#1a1d23',
|
|
7311
|
+
'--colorpicker-panel-bg': '#f8f9fa',
|
|
7312
|
+
'--colorpicker-input-bg': '#f3f4f6',
|
|
7313
|
+
'--colorpicker-border': '#e5e7eb',
|
|
7314
|
+
'--colorpicker-input-border': '#d1d5db',
|
|
7315
|
+
'--color-background': '#ffffff',
|
|
7316
|
+
'--color-foreground': '#1a1d23',
|
|
7317
|
+
'--color-muted-foreground': '#6b7280',
|
|
7318
|
+
'--colorpicker-shadow': '0 4px 6px -1px rgb(0 0 0 / 0.1)'
|
|
7319
|
+
}
|
|
7320
|
+
: {
|
|
7321
|
+
backgroundColor: 'rgba(26, 26, 28, 0.8)',
|
|
7322
|
+
color: '#f7f8f9',
|
|
7323
|
+
'--colorpicker-bg': 'rgba(26, 26, 28, 0.8)',
|
|
7324
|
+
'--colorpicker-text': '#ffffff',
|
|
7325
|
+
'--colorpicker-panel-bg': 'rgba(0, 0, 0, 1)',
|
|
7326
|
+
'--colorpicker-input-bg': 'rgba(39, 39, 42, 0.8)',
|
|
7327
|
+
'--colorpicker-border': 'rgba(39, 39, 42, 0.8)',
|
|
7328
|
+
'--colorpicker-input-border': 'rgba(39, 39, 42, 0.8)',
|
|
7329
|
+
'--color-background': '#000000',
|
|
7330
|
+
'--color-foreground': '#f7f8f9',
|
|
7331
|
+
'--color-muted-foreground': '#a1a1aa'
|
|
7332
|
+
};
|
|
7333
|
+
var pickerContent = solid && gradient ? (React.createElement(ThemeProvider, { defaultTheme: theme },
|
|
7334
|
+
React.createElement("div", { className: "relative ".concat(theme, " iro-gradient-picker"), "data-color-picker-theme": true, style: themeStyles },
|
|
7335
|
+
React.createElement(PopupTabs, { activeTab: activeTab, popupWidth: popupWidth },
|
|
7336
|
+
React.createElement(PopupTabsHeader, null,
|
|
7337
|
+
React.createElement(PopupTabsHeaderLabel, { tabName: 'solid', onClick: function () { return onChangeTab('solid'); } }, "Solid"),
|
|
7338
|
+
React.createElement(PopupTabsHeaderLabel, { tabName: 'gradient', onClick: function () { return onChangeTab('gradient'); } }, "Gradient")),
|
|
7339
|
+
React.createElement(PopupTabsBody, null,
|
|
7340
|
+
React.createElement(PopupTabsBodyItem, { tabName: 'solid' },
|
|
7341
|
+
React.createElement(IroSolidColorPicker, { onChange: onChangeSolid, onColorChangeImmediate: setCurrentWrapperColor, value: cssValue, format: format, defaultColors: defaultColors, debounceMS: debounceMS, debounce: debounce, showAlpha: showAlpha, showInputs: showInputs, colorBoardHeight: colorBoardHeight, showReset: showReset, onReset: onReset, popupWidth: popupWidth })),
|
|
7342
|
+
React.createElement(PopupTabsBodyItem, { tabName: 'gradient' },
|
|
7343
|
+
React.createElement(IroGradient, { onChange: onChangeGradient, onColorChangeImmediate: setCurrentWrapperColor, value: gradientValue, format: format, defaultColors: defaultColors, debounceMS: debounceMS, debounce: debounce, showAlpha: showAlpha, showInputs: showInputs, showGradientResult: showGradientResult, showGradientStops: showGradientStops, showGradientMode: showGradientMode, showGradientAngle: showGradientAngle, showGradientPosition: showGradientPosition, allowAddGradientStops: allowAddGradientStops, colorBoardHeight: colorBoardHeight, showReset: showReset, onReset: onReset, popupWidth: popupWidth }))))))) : (React.createElement(ThemeProvider, { defaultTheme: theme },
|
|
7344
|
+
React.createElement("div", { className: "relative ".concat(theme, " iro-gradient-picker"), "data-color-picker-theme": true, style: themeStyles }, solid || gradient ? (React.createElement(PopupTabs, { popupWidth: popupWidth },
|
|
7147
7345
|
React.createElement(PopupTabsBody, null,
|
|
7148
|
-
solid ? (React.createElement(IroSolidColorPicker, { onChange: onChangeSolid, value: cssValue, format: format, defaultColors: defaultColors, debounceMS: debounceMS, debounce: debounce, showAlpha: showAlpha, showInputs: showInputs, colorBoardHeight: colorBoardHeight, showReset: showReset, onReset: onReset, popupWidth: popupWidth })) : (React.createElement(Fragment, null)),
|
|
7149
|
-
gradient ? (React.createElement(IroGradient, { onChange: onChangeGradient, value: cssValue, format: format, defaultColors: defaultColors, debounceMS: debounceMS, debounce: debounce, showAlpha: showAlpha, showInputs: showInputs, showGradientResult: showGradientResult, showGradientStops: showGradientStops, showGradientMode: showGradientMode, showGradientAngle: showGradientAngle, showGradientPosition: showGradientPosition, allowAddGradientStops: allowAddGradientStops, colorBoardHeight: colorBoardHeight, showReset: showReset, onReset: onReset, popupWidth: popupWidth })) : (React.createElement(Fragment, null))))) : null)));
|
|
7346
|
+
solid ? (React.createElement(IroSolidColorPicker, { onChange: onChangeSolid, onColorChangeImmediate: setCurrentWrapperColor, value: cssValue, format: format, defaultColors: defaultColors, debounceMS: debounceMS, debounce: debounce, showAlpha: showAlpha, showInputs: showInputs, colorBoardHeight: colorBoardHeight, showReset: showReset, onReset: onReset, popupWidth: popupWidth })) : (React.createElement(Fragment, null)),
|
|
7347
|
+
gradient ? (React.createElement(IroGradient, { onChange: onChangeGradient, onColorChangeImmediate: setCurrentWrapperColor, value: cssValue, format: format, defaultColors: defaultColors, debounceMS: debounceMS, debounce: debounce, showAlpha: showAlpha, showInputs: showInputs, showGradientResult: showGradientResult, showGradientStops: showGradientStops, showGradientMode: showGradientMode, showGradientAngle: showGradientAngle, showGradientPosition: showGradientPosition, allowAddGradientStops: allowAddGradientStops, colorBoardHeight: colorBoardHeight, showReset: showReset, onReset: onReset, popupWidth: popupWidth })) : (React.createElement(Fragment, null))))) : null)));
|
|
7348
|
+
if (showWrapper) {
|
|
7349
|
+
return (React.createElement("div", { className: "iro-picker-wrapper ".concat(wrapperClassName), style: wrapperStyle }, pickerContent));
|
|
7350
|
+
}
|
|
7351
|
+
return pickerContent;
|
|
7150
7352
|
};
|
|
7151
7353
|
|
|
7152
7354
|
// Simple sun and moon icons as SVG components
|