@yamada-ui/color-picker 1.0.5 → 1.0.6-dev-20240216040013
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/{chunk-5FH26WWX.mjs → chunk-3HWVWHMW.mjs} +1 -1
- package/dist/{chunk-AW3DGG4U.mjs → chunk-RSF3HAQH.mjs} +9 -5
- package/dist/color-picker.js +13 -9
- package/dist/color-picker.mjs +2 -2
- package/dist/index.js +13 -9
- package/dist/index.mjs +2 -2
- package/dist/use-color-picker.js +9 -5
- package/dist/use-color-picker.mjs +1 -1
- package/package.json +1 -1
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
useFormControlProps,
|
|
5
5
|
getFormControlProperties
|
|
6
6
|
} from "@yamada-ui/form-control";
|
|
7
|
+
import { popoverProperties } from "@yamada-ui/popover";
|
|
7
8
|
import { useControllableState } from "@yamada-ui/use-controllable-state";
|
|
8
9
|
import { useEyeDropper } from "@yamada-ui/use-eye-dropper";
|
|
9
10
|
import { useOutsideClick } from "@yamada-ui/use-outside-click";
|
|
@@ -65,7 +66,10 @@ var useColorPicker = ({
|
|
|
65
66
|
getFormControlProperties({ omit: ["aria-readonly"] })
|
|
66
67
|
);
|
|
67
68
|
const { disabled, readOnly } = formControlProps;
|
|
68
|
-
const
|
|
69
|
+
const [containerProps, inputProps] = splitObject(
|
|
70
|
+
omitObject(rest, [...popoverProperties]),
|
|
71
|
+
[...layoutStyleProperties, "aria-readonly"]
|
|
72
|
+
);
|
|
69
73
|
const containerRef = useRef(null);
|
|
70
74
|
const fieldRef = useRef(null);
|
|
71
75
|
const { supported: eyeDropperSupported, onOpen: onEyeDropperOpen } = useEyeDropper();
|
|
@@ -217,19 +221,19 @@ var useColorPicker = ({
|
|
|
217
221
|
const getContainerProps = useCallback(
|
|
218
222
|
(props = {}, ref = null) => ({
|
|
219
223
|
ref: mergeRefs(containerRef, ref),
|
|
220
|
-
...
|
|
224
|
+
...containerProps,
|
|
221
225
|
...props,
|
|
222
226
|
...formControlProps,
|
|
223
227
|
onClick: handlerAll(props.onClick, rest.onClick, onContainerClick),
|
|
224
228
|
onBlur: handlerAll(props.onBlur, rest.onBlur, onContainerBlur)
|
|
225
229
|
}),
|
|
226
|
-
[
|
|
230
|
+
[containerProps, formControlProps, onContainerBlur, onContainerClick, rest]
|
|
227
231
|
);
|
|
228
232
|
const getFieldProps = useCallback(
|
|
229
233
|
(props = {}, ref = null) => ({
|
|
230
234
|
ref: mergeRefs(fieldRef, ref),
|
|
231
235
|
tabIndex: !allowInput ? -1 : 0,
|
|
232
|
-
...
|
|
236
|
+
...inputProps,
|
|
233
237
|
...props,
|
|
234
238
|
style: {
|
|
235
239
|
...props.style,
|
|
@@ -245,7 +249,7 @@ var useColorPicker = ({
|
|
|
245
249
|
}),
|
|
246
250
|
[
|
|
247
251
|
allowInput,
|
|
248
|
-
|
|
252
|
+
inputProps,
|
|
249
253
|
inputValue,
|
|
250
254
|
isOpen,
|
|
251
255
|
rest,
|
package/dist/color-picker.js
CHANGED
|
@@ -24,7 +24,7 @@ __export(color_picker_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(color_picker_exports);
|
|
26
26
|
var import_core12 = require("@yamada-ui/core");
|
|
27
|
-
var
|
|
27
|
+
var import_popover2 = require("@yamada-ui/popover");
|
|
28
28
|
var import_portal = require("@yamada-ui/portal");
|
|
29
29
|
var import_utils15 = require("@yamada-ui/utils");
|
|
30
30
|
var import_react6 = require("react");
|
|
@@ -1753,6 +1753,7 @@ var ColorSelector = (0, import_core10.forwardRef)(
|
|
|
1753
1753
|
// src/use-color-picker.ts
|
|
1754
1754
|
var import_core11 = require("@yamada-ui/core");
|
|
1755
1755
|
var import_form_control4 = require("@yamada-ui/form-control");
|
|
1756
|
+
var import_popover = require("@yamada-ui/popover");
|
|
1756
1757
|
var import_use_controllable_state4 = require("@yamada-ui/use-controllable-state");
|
|
1757
1758
|
var import_use_eye_dropper2 = require("@yamada-ui/use-eye-dropper");
|
|
1758
1759
|
var import_use_outside_click = require("@yamada-ui/use-outside-click");
|
|
@@ -1801,7 +1802,10 @@ var useColorPicker = ({
|
|
|
1801
1802
|
(0, import_form_control4.getFormControlProperties)({ omit: ["aria-readonly"] })
|
|
1802
1803
|
);
|
|
1803
1804
|
const { disabled, readOnly } = formControlProps;
|
|
1804
|
-
const
|
|
1805
|
+
const [containerProps, inputProps] = (0, import_utils14.splitObject)(
|
|
1806
|
+
(0, import_utils14.omitObject)(rest, [...import_popover.popoverProperties]),
|
|
1807
|
+
[...import_core11.layoutStyleProperties, "aria-readonly"]
|
|
1808
|
+
);
|
|
1805
1809
|
const containerRef = (0, import_react5.useRef)(null);
|
|
1806
1810
|
const fieldRef = (0, import_react5.useRef)(null);
|
|
1807
1811
|
const { supported: eyeDropperSupported, onOpen: onEyeDropperOpen } = (0, import_use_eye_dropper2.useEyeDropper)();
|
|
@@ -1953,19 +1957,19 @@ var useColorPicker = ({
|
|
|
1953
1957
|
const getContainerProps = (0, import_react5.useCallback)(
|
|
1954
1958
|
(props = {}, ref = null) => ({
|
|
1955
1959
|
ref: (0, import_utils14.mergeRefs)(containerRef, ref),
|
|
1956
|
-
...
|
|
1960
|
+
...containerProps,
|
|
1957
1961
|
...props,
|
|
1958
1962
|
...formControlProps,
|
|
1959
1963
|
onClick: (0, import_utils14.handlerAll)(props.onClick, rest.onClick, onContainerClick),
|
|
1960
1964
|
onBlur: (0, import_utils14.handlerAll)(props.onBlur, rest.onBlur, onContainerBlur)
|
|
1961
1965
|
}),
|
|
1962
|
-
[
|
|
1966
|
+
[containerProps, formControlProps, onContainerBlur, onContainerClick, rest]
|
|
1963
1967
|
);
|
|
1964
1968
|
const getFieldProps = (0, import_react5.useCallback)(
|
|
1965
1969
|
(props = {}, ref = null) => ({
|
|
1966
1970
|
ref: (0, import_utils14.mergeRefs)(fieldRef, ref),
|
|
1967
1971
|
tabIndex: !allowInput ? -1 : 0,
|
|
1968
|
-
...
|
|
1972
|
+
...inputProps,
|
|
1969
1973
|
...props,
|
|
1970
1974
|
style: {
|
|
1971
1975
|
...props.style,
|
|
@@ -1981,7 +1985,7 @@ var useColorPicker = ({
|
|
|
1981
1985
|
}),
|
|
1982
1986
|
[
|
|
1983
1987
|
allowInput,
|
|
1984
|
-
|
|
1988
|
+
inputProps,
|
|
1985
1989
|
inputValue,
|
|
1986
1990
|
isOpen,
|
|
1987
1991
|
rest,
|
|
@@ -2104,7 +2108,7 @@ var ColorPicker = (0, import_core12.forwardRef)(
|
|
|
2104
2108
|
color,
|
|
2105
2109
|
...styles.container
|
|
2106
2110
|
};
|
|
2107
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ColorPickerProvider, { value: { styles, ...rest }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ColorPickerProvider, { value: { styles, ...rest }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_popover2.Popover, { ...getPopoverProps(), children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
2108
2112
|
import_core12.ui.div,
|
|
2109
2113
|
{
|
|
2110
2114
|
className: (0, import_utils15.cx)("ui-color-picker", className),
|
|
@@ -2122,7 +2126,7 @@ var ColorPicker = (0, import_core12.forwardRef)(
|
|
|
2122
2126
|
},
|
|
2123
2127
|
children: [
|
|
2124
2128
|
withSwatch ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ColorPickerSwatch, { ...swatchProps }) : null,
|
|
2125
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2129
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_popover2.PopoverTrigger, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2126
2130
|
ColorPickerField,
|
|
2127
2131
|
{
|
|
2128
2132
|
h,
|
|
@@ -2140,7 +2144,7 @@ var ColorPicker = (0, import_core12.forwardRef)(
|
|
|
2140
2144
|
}
|
|
2141
2145
|
),
|
|
2142
2146
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_portal.Portal, { ...portalProps, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2143
|
-
|
|
2147
|
+
import_popover2.PopoverContent,
|
|
2144
2148
|
{
|
|
2145
2149
|
className: "ui-color-picker__popover",
|
|
2146
2150
|
__css: { ...styles.list },
|
package/dist/color-picker.mjs
CHANGED
package/dist/index.js
CHANGED
|
@@ -1752,7 +1752,7 @@ var ColorSelector = (0, import_core10.forwardRef)(
|
|
|
1752
1752
|
|
|
1753
1753
|
// src/color-picker.tsx
|
|
1754
1754
|
var import_core12 = require("@yamada-ui/core");
|
|
1755
|
-
var
|
|
1755
|
+
var import_popover2 = require("@yamada-ui/popover");
|
|
1756
1756
|
var import_portal = require("@yamada-ui/portal");
|
|
1757
1757
|
var import_utils15 = require("@yamada-ui/utils");
|
|
1758
1758
|
var import_react6 = require("react");
|
|
@@ -1760,6 +1760,7 @@ var import_react6 = require("react");
|
|
|
1760
1760
|
// src/use-color-picker.ts
|
|
1761
1761
|
var import_core11 = require("@yamada-ui/core");
|
|
1762
1762
|
var import_form_control4 = require("@yamada-ui/form-control");
|
|
1763
|
+
var import_popover = require("@yamada-ui/popover");
|
|
1763
1764
|
var import_use_controllable_state4 = require("@yamada-ui/use-controllable-state");
|
|
1764
1765
|
var import_use_eye_dropper2 = require("@yamada-ui/use-eye-dropper");
|
|
1765
1766
|
var import_use_outside_click = require("@yamada-ui/use-outside-click");
|
|
@@ -1808,7 +1809,10 @@ var useColorPicker = ({
|
|
|
1808
1809
|
(0, import_form_control4.getFormControlProperties)({ omit: ["aria-readonly"] })
|
|
1809
1810
|
);
|
|
1810
1811
|
const { disabled, readOnly } = formControlProps;
|
|
1811
|
-
const
|
|
1812
|
+
const [containerProps, inputProps] = (0, import_utils14.splitObject)(
|
|
1813
|
+
(0, import_utils14.omitObject)(rest, [...import_popover.popoverProperties]),
|
|
1814
|
+
[...import_core11.layoutStyleProperties, "aria-readonly"]
|
|
1815
|
+
);
|
|
1812
1816
|
const containerRef = (0, import_react5.useRef)(null);
|
|
1813
1817
|
const fieldRef = (0, import_react5.useRef)(null);
|
|
1814
1818
|
const { supported: eyeDropperSupported, onOpen: onEyeDropperOpen } = (0, import_use_eye_dropper2.useEyeDropper)();
|
|
@@ -1960,19 +1964,19 @@ var useColorPicker = ({
|
|
|
1960
1964
|
const getContainerProps = (0, import_react5.useCallback)(
|
|
1961
1965
|
(props = {}, ref = null) => ({
|
|
1962
1966
|
ref: (0, import_utils14.mergeRefs)(containerRef, ref),
|
|
1963
|
-
...
|
|
1967
|
+
...containerProps,
|
|
1964
1968
|
...props,
|
|
1965
1969
|
...formControlProps,
|
|
1966
1970
|
onClick: (0, import_utils14.handlerAll)(props.onClick, rest.onClick, onContainerClick),
|
|
1967
1971
|
onBlur: (0, import_utils14.handlerAll)(props.onBlur, rest.onBlur, onContainerBlur)
|
|
1968
1972
|
}),
|
|
1969
|
-
[
|
|
1973
|
+
[containerProps, formControlProps, onContainerBlur, onContainerClick, rest]
|
|
1970
1974
|
);
|
|
1971
1975
|
const getFieldProps = (0, import_react5.useCallback)(
|
|
1972
1976
|
(props = {}, ref = null) => ({
|
|
1973
1977
|
ref: (0, import_utils14.mergeRefs)(fieldRef, ref),
|
|
1974
1978
|
tabIndex: !allowInput ? -1 : 0,
|
|
1975
|
-
...
|
|
1979
|
+
...inputProps,
|
|
1976
1980
|
...props,
|
|
1977
1981
|
style: {
|
|
1978
1982
|
...props.style,
|
|
@@ -1988,7 +1992,7 @@ var useColorPicker = ({
|
|
|
1988
1992
|
}),
|
|
1989
1993
|
[
|
|
1990
1994
|
allowInput,
|
|
1991
|
-
|
|
1995
|
+
inputProps,
|
|
1992
1996
|
inputValue,
|
|
1993
1997
|
isOpen,
|
|
1994
1998
|
rest,
|
|
@@ -2111,7 +2115,7 @@ var ColorPicker = (0, import_core12.forwardRef)(
|
|
|
2111
2115
|
color,
|
|
2112
2116
|
...styles.container
|
|
2113
2117
|
};
|
|
2114
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ColorPickerProvider, { value: { styles, ...rest }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ColorPickerProvider, { value: { styles, ...rest }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_popover2.Popover, { ...getPopoverProps(), children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
2115
2119
|
import_core12.ui.div,
|
|
2116
2120
|
{
|
|
2117
2121
|
className: (0, import_utils15.cx)("ui-color-picker", className),
|
|
@@ -2129,7 +2133,7 @@ var ColorPicker = (0, import_core12.forwardRef)(
|
|
|
2129
2133
|
},
|
|
2130
2134
|
children: [
|
|
2131
2135
|
withSwatch ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ColorPickerSwatch, { ...swatchProps }) : null,
|
|
2132
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2136
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_popover2.PopoverTrigger, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2133
2137
|
ColorPickerField,
|
|
2134
2138
|
{
|
|
2135
2139
|
h,
|
|
@@ -2147,7 +2151,7 @@ var ColorPicker = (0, import_core12.forwardRef)(
|
|
|
2147
2151
|
}
|
|
2148
2152
|
),
|
|
2149
2153
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_portal.Portal, { ...portalProps, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2150
|
-
|
|
2154
|
+
import_popover2.PopoverContent,
|
|
2151
2155
|
{
|
|
2152
2156
|
className: "ui-color-picker__popover",
|
|
2153
2157
|
__css: { ...styles.list },
|
package/dist/index.mjs
CHANGED
package/dist/use-color-picker.js
CHANGED
|
@@ -27,6 +27,7 @@ __export(use_color_picker_exports, {
|
|
|
27
27
|
module.exports = __toCommonJS(use_color_picker_exports);
|
|
28
28
|
var import_core = require("@yamada-ui/core");
|
|
29
29
|
var import_form_control = require("@yamada-ui/form-control");
|
|
30
|
+
var import_popover = require("@yamada-ui/popover");
|
|
30
31
|
var import_use_controllable_state = require("@yamada-ui/use-controllable-state");
|
|
31
32
|
var import_use_eye_dropper = require("@yamada-ui/use-eye-dropper");
|
|
32
33
|
var import_use_outside_click = require("@yamada-ui/use-outside-click");
|
|
@@ -75,7 +76,10 @@ var useColorPicker = ({
|
|
|
75
76
|
(0, import_form_control.getFormControlProperties)({ omit: ["aria-readonly"] })
|
|
76
77
|
);
|
|
77
78
|
const { disabled, readOnly } = formControlProps;
|
|
78
|
-
const
|
|
79
|
+
const [containerProps, inputProps] = (0, import_utils.splitObject)(
|
|
80
|
+
(0, import_utils.omitObject)(rest, [...import_popover.popoverProperties]),
|
|
81
|
+
[...import_core.layoutStyleProperties, "aria-readonly"]
|
|
82
|
+
);
|
|
79
83
|
const containerRef = (0, import_react.useRef)(null);
|
|
80
84
|
const fieldRef = (0, import_react.useRef)(null);
|
|
81
85
|
const { supported: eyeDropperSupported, onOpen: onEyeDropperOpen } = (0, import_use_eye_dropper.useEyeDropper)();
|
|
@@ -227,19 +231,19 @@ var useColorPicker = ({
|
|
|
227
231
|
const getContainerProps = (0, import_react.useCallback)(
|
|
228
232
|
(props = {}, ref = null) => ({
|
|
229
233
|
ref: (0, import_utils.mergeRefs)(containerRef, ref),
|
|
230
|
-
...
|
|
234
|
+
...containerProps,
|
|
231
235
|
...props,
|
|
232
236
|
...formControlProps,
|
|
233
237
|
onClick: (0, import_utils.handlerAll)(props.onClick, rest.onClick, onContainerClick),
|
|
234
238
|
onBlur: (0, import_utils.handlerAll)(props.onBlur, rest.onBlur, onContainerBlur)
|
|
235
239
|
}),
|
|
236
|
-
[
|
|
240
|
+
[containerProps, formControlProps, onContainerBlur, onContainerClick, rest]
|
|
237
241
|
);
|
|
238
242
|
const getFieldProps = (0, import_react.useCallback)(
|
|
239
243
|
(props = {}, ref = null) => ({
|
|
240
244
|
ref: (0, import_utils.mergeRefs)(fieldRef, ref),
|
|
241
245
|
tabIndex: !allowInput ? -1 : 0,
|
|
242
|
-
...
|
|
246
|
+
...inputProps,
|
|
243
247
|
...props,
|
|
244
248
|
style: {
|
|
245
249
|
...props.style,
|
|
@@ -255,7 +259,7 @@ var useColorPicker = ({
|
|
|
255
259
|
}),
|
|
256
260
|
[
|
|
257
261
|
allowInput,
|
|
258
|
-
|
|
262
|
+
inputProps,
|
|
259
263
|
inputValue,
|
|
260
264
|
isOpen,
|
|
261
265
|
rest,
|