react-iro-gradient-picker 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +16 -11
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +16 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
@@ -91,13 +91,18 @@ var ThemeProvider = function (_a) {
|
|
91
91
|
return defaultTheme;
|
92
92
|
}), 2), theme = _c[0], setTheme = _c[1];
|
93
93
|
useEffect(function () {
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
94
|
+
// Apply theme to local container instead of document root for better scoping
|
95
|
+
var containers = document.querySelectorAll('[data-color-picker-theme]');
|
96
|
+
containers.forEach(function (container) {
|
97
|
+
// Remove previous theme class
|
98
|
+
container.classList.remove('light', 'dark');
|
99
|
+
// Add new theme class
|
100
|
+
container.classList.add(theme);
|
101
|
+
});
|
99
102
|
// Store theme preference
|
100
|
-
|
103
|
+
if (typeof window !== 'undefined') {
|
104
|
+
localStorage.setItem('color-picker-theme', theme);
|
105
|
+
}
|
101
106
|
}, [theme]);
|
102
107
|
var toggleTheme = function () {
|
103
108
|
setTheme(function (prevTheme) { return (prevTheme === 'light' ? 'dark' : 'light'); });
|
@@ -7947,9 +7952,9 @@ var IroGradient = function (_a) {
|
|
7947
7952
|
height: colorBoardHeight + pickerWidth
|
7948
7953
|
} },
|
7949
7954
|
React.createElement(IroColorPicker, { ref: iroPickerRef, width: pickerWidth, color: iroColorValue, layout: layoutConfig, onColorChange: handleIroColorChange }))),
|
7950
|
-
React.createElement("div", { className: 'rounded-lg colorpicker-glass' },
|
7955
|
+
React.createElement("div", { className: 'rounded-lg colorpicker-glass px-4' },
|
7951
7956
|
React.createElement(GradientPanel$1, { color: color, activeColor: activeColor, setActiveColor: handleSetActiveColor, setColor: updateGradient, setInit: setInit, format: format, showAlpha: showAlpha, showGradientResult: showGradientResult, showGradientStops: showGradientStops, showGradientMode: showGradientMode, showGradientAngle: showGradientAngle, showGradientPosition: showGradientPosition, allowAddGradientStops: allowAddGradientStops })),
|
7952
|
-
React.createElement("div", { className: 'pt-4' },
|
7957
|
+
React.createElement("div", { className: 'pt-4 px-2' },
|
7953
7958
|
React.createElement(DefaultColorPanel, { defaultColors: defaultColors, setColor: handleColorFromPanel, setInit: function () { }, setActiveColor: handleSetActiveColor, colorType: 'gradient' })),
|
7954
7959
|
showInputs && (React.createElement("div", { className: 'rounded-lg colorpicker-glass' },
|
7955
7960
|
React.createElement(InputRgba, { hex: activeColor.hex, alpha: activeColor.alpha, showAlpha: showAlpha, onChange: function (value) {
|
@@ -8208,7 +8213,7 @@ var PopupTabs = function (_a) {
|
|
8208
8213
|
activeTab: activeTab
|
8209
8214
|
});
|
8210
8215
|
});
|
8211
|
-
return (React.createElement("div", { className: 'relative rounded-md
|
8216
|
+
return (React.createElement("div", { className: 'relative rounded-md', style: { width: "".concat(popupWidth, "px") } }, childrenContact));
|
8212
8217
|
};
|
8213
8218
|
var PopupTabsHeaderLabel = function (_a) {
|
8214
8219
|
var children = _a.children, activeTab = _a.activeTab, tabName = _a.tabName, onClick = _a.onClick;
|
@@ -8259,7 +8264,7 @@ var ColorPicker = function (_a) {
|
|
8259
8264
|
};
|
8260
8265
|
if (solid && gradient) {
|
8261
8266
|
return (React.createElement(ThemeProvider, null,
|
8262
|
-
React.createElement("div", { className: 'relative' },
|
8267
|
+
React.createElement("div", { className: 'relative dark', "data-color-picker-theme": true },
|
8263
8268
|
React.createElement(ThemeToggle, null),
|
8264
8269
|
React.createElement(PopupTabs, { activeTab: activeTab, popupWidth: popupWidth },
|
8265
8270
|
React.createElement(PopupTabsHeader, null,
|
@@ -8272,7 +8277,7 @@ var ColorPicker = function (_a) {
|
|
8272
8277
|
React.createElement(IroGradient, { onChange: onChangeGradient, value: value, 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 })))))));
|
8273
8278
|
}
|
8274
8279
|
return (React.createElement(ThemeProvider, null,
|
8275
|
-
React.createElement("div", { className: 'relative' },
|
8280
|
+
React.createElement("div", { className: 'relative dark', "data-color-picker-theme": true },
|
8276
8281
|
React.createElement(ThemeToggle, null),
|
8277
8282
|
solid || gradient ? (React.createElement(PopupTabs, { popupWidth: popupWidth },
|
8278
8283
|
React.createElement(PopupTabsBody, null,
|