@wello-dev/core 1.0.4 → 1.0.6
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-FIAJMBSD.js → chunk-2TFJ4SMR.js} +3 -3
- package/dist/chunk-2TFJ4SMR.js.map +1 -0
- package/dist/{chunk-6U4Y3AUT.js → chunk-2WHZJI3S.js} +3 -3
- package/dist/{chunk-F2FJLMJF.js → chunk-652ZEQV7.js} +4 -4
- package/dist/{chunk-YQOS23WP.js → chunk-7EINGVGG.js} +2 -2
- package/dist/{chunk-YOL5PMHU.js → chunk-7S7RIVCI.js} +2 -2
- package/dist/{chunk-PPKKOBHB.js → chunk-A76QHCP5.js} +2 -2
- package/dist/{chunk-TJUOXXLK.js → chunk-BZPG4NZ6.js} +2 -2
- package/dist/chunk-DRSBB5T4.js +206 -0
- package/dist/chunk-DRSBB5T4.js.map +1 -0
- package/dist/{chunk-HGYIOR5F.js → chunk-ESMDK5GY.js} +2 -2
- package/dist/{chunk-GD5URO3H.js → chunk-FSR3OEUP.js} +4 -4
- package/dist/{chunk-52P4CIAK.js → chunk-HBBXBVK6.js} +2 -2
- package/dist/{chunk-63PSLIW5.js → chunk-K3B2RENY.js} +2 -2
- package/dist/{chunk-ZTOAB4HM.js → chunk-NGXT7GNE.js} +2 -2
- package/dist/{chunk-O4MQLZEH.js → chunk-NH26XE7T.js} +2 -2
- package/dist/{chunk-7GLDYLJ6.js → chunk-O6A7IBIW.js} +2 -2
- package/dist/{chunk-F4OMXH3E.js → chunk-QCMTAQSP.js} +17 -10
- package/dist/chunk-QCMTAQSP.js.map +1 -0
- package/dist/{chunk-2XGMU4QA.js → chunk-RVFCTNPD.js} +20 -4
- package/dist/chunk-RVFCTNPD.js.map +1 -0
- package/dist/{chunk-KEYIOWAG.js → chunk-TIVOXLDX.js} +3 -3
- package/dist/{chunk-KEYIOWAG.js.map → chunk-TIVOXLDX.js.map} +1 -1
- package/dist/{chunk-QZFPW75D.js → chunk-XBLREJCR.js} +30 -3
- package/dist/chunk-XBLREJCR.js.map +1 -0
- package/dist/{chunk-K2Q5Q6WQ.js → chunk-YRKCM3OL.js} +10 -6
- package/dist/chunk-YRKCM3OL.js.map +1 -0
- package/dist/components/ColorPicker/ColorInput.js +4 -4
- package/dist/components/Combobox/Combobox.js +4 -4
- package/dist/components/Combobox/Select.js +5 -5
- package/dist/components/Combobox/TagsInput.js +5 -5
- package/dist/components/Dialog/Dialog.js +2 -2
- package/dist/components/Dropzone/Dropzone.js +4 -4
- package/dist/components/Menu/Menu.js +4 -4
- package/dist/components/Modal/Drawer.js +3 -3
- package/dist/components/Modal/Modal.js +3 -3
- package/dist/components/Modal/ModalBase.js +2 -2
- package/dist/components/NumberFormatter/NumberFormatter.js +1 -1
- package/dist/components/PhoneInput/PhoneInput.js +6 -6
- package/dist/components/Popover/Popover.js +3 -3
- package/dist/components/Portal/Portal.js +1 -1
- package/dist/components/TextInput/TextInput.js +2 -2
- package/dist/components/Tooltip/Tooltip.js +3 -3
- package/dist/index.cjs +163 -95
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +114 -114
- package/dist/shadcn/Command.js +6 -6
- package/dist/shadcn/Dialog.js +5 -5
- package/dist/shadcn/Floating.js +6 -6
- package/dist/styles.css +123 -15
- package/package.json +1 -1
- package/dist/chunk-2XGMU4QA.js.map +0 -1
- package/dist/chunk-F4OMXH3E.js.map +0 -1
- package/dist/chunk-FIAJMBSD.js.map +0 -1
- package/dist/chunk-K2Q5Q6WQ.js.map +0 -1
- package/dist/chunk-QZFPW75D.js.map +0 -1
- package/dist/chunk-YHPHWOAE.js +0 -192
- package/dist/chunk-YHPHWOAE.js.map +0 -1
- /package/dist/{chunk-6U4Y3AUT.js.map → chunk-2WHZJI3S.js.map} +0 -0
- /package/dist/{chunk-F2FJLMJF.js.map → chunk-652ZEQV7.js.map} +0 -0
- /package/dist/{chunk-YQOS23WP.js.map → chunk-7EINGVGG.js.map} +0 -0
- /package/dist/{chunk-YOL5PMHU.js.map → chunk-7S7RIVCI.js.map} +0 -0
- /package/dist/{chunk-PPKKOBHB.js.map → chunk-A76QHCP5.js.map} +0 -0
- /package/dist/{chunk-TJUOXXLK.js.map → chunk-BZPG4NZ6.js.map} +0 -0
- /package/dist/{chunk-HGYIOR5F.js.map → chunk-ESMDK5GY.js.map} +0 -0
- /package/dist/{chunk-GD5URO3H.js.map → chunk-FSR3OEUP.js.map} +0 -0
- /package/dist/{chunk-52P4CIAK.js.map → chunk-HBBXBVK6.js.map} +0 -0
- /package/dist/{chunk-63PSLIW5.js.map → chunk-K3B2RENY.js.map} +0 -0
- /package/dist/{chunk-ZTOAB4HM.js.map → chunk-NGXT7GNE.js.map} +0 -0
- /package/dist/{chunk-O4MQLZEH.js.map → chunk-NH26XE7T.js.map} +0 -0
- /package/dist/{chunk-7GLDYLJ6.js.map → chunk-O6A7IBIW.js.map} +0 -0
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-4QBFXTYH.js";
|
|
5
5
|
|
|
6
6
|
// src/components/Portal/Portal.tsx
|
|
7
|
-
import { useEffect, useRef, useState } from "react";
|
|
7
|
+
import { useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
8
8
|
import { createPortal } from "react-dom";
|
|
9
9
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
10
10
|
var sharedNode = null;
|
|
@@ -17,7 +17,7 @@ function Portal(_props) {
|
|
|
17
17
|
const { target, reuseTargetNode, className, id, children } = useProps("Portal", { reuseTargetNode: true }, _props);
|
|
18
18
|
const [node, setNode] = useState(null);
|
|
19
19
|
const created = useRef(null);
|
|
20
|
-
|
|
20
|
+
useLayoutEffect(() => {
|
|
21
21
|
if (target) {
|
|
22
22
|
const el = typeof target === "string" ? document.querySelector(target) : target;
|
|
23
23
|
if (el) syncPortalDir(el);
|
|
@@ -64,4 +64,4 @@ export {
|
|
|
64
64
|
Portal,
|
|
65
65
|
OptionalPortal
|
|
66
66
|
};
|
|
67
|
-
//# sourceMappingURL=chunk-
|
|
67
|
+
//# sourceMappingURL=chunk-2TFJ4SMR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/Portal/Portal.tsx"],"sourcesContent":["import { useEffect, useLayoutEffect, useRef, useState, type ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { useProps } from \"../../core/styles-api/styles-api\";\n\nexport interface PortalProps {\n /** Element or selector to render into. Default: a new `<div>` in `document.body` */\n target?: HTMLElement | string | null;\n /** Share one container `<div>` between every portal without a target. Default: true */\n reuseTargetNode?: boolean;\n /** Class / id on the created container */\n className?: string;\n id?: string;\n children?: ReactNode;\n}\n\nlet sharedNode: HTMLDivElement | null = null;\n\n/** Keep portal roots aligned with `<html dir>` so RTL PhoneInput / Select menus match. */\nfunction syncPortalDir(el: HTMLElement) {\n const dir = document.documentElement.getAttribute(\"dir\");\n if (dir) el.setAttribute(\"dir\", dir);\n else el.removeAttribute(\"dir\");\n}\n\n/**\n * Renders children elsewhere in the DOM (body by default), after the first client render.\n *\n * @example\n * <Portal><div className=\"toast\">…</div></Portal>\n */\nexport function Portal(_props: PortalProps) {\n const { target, reuseTargetNode, className, id, children } = useProps(\"Portal\", { reuseTargetNode: true }, _props);\n const [node, setNode] = useState<HTMLElement | null>(null);\n const created = useRef<HTMLDivElement | null>(null);\n\n // Layout effect so the first open paint already has a portal target (avoids a\n // frame at 0,0 / missing anchor while useEffect hasn't run yet).\n useLayoutEffect(() => {\n if (target) {\n const el = typeof target === \"string\" ? document.querySelector<HTMLElement>(target) : target;\n if (el) syncPortalDir(el);\n setNode(el);\n return;\n }\n // Your own class or id needs its own element.\n if (reuseTargetNode && !className && !id) {\n if (!sharedNode || !sharedNode.isConnected) {\n sharedNode = document.createElement(\"div\");\n sharedNode.setAttribute(\"data-wello-portal\", \"shared\");\n document.body.appendChild(sharedNode);\n }\n syncPortalDir(sharedNode);\n setNode(sharedNode);\n return;\n }\n const div = document.createElement(\"div\");\n div.setAttribute(\"data-wello-portal\", \"\");\n if (className) div.className = className;\n if (id) div.id = id;\n syncPortalDir(div);\n document.body.appendChild(div);\n created.current = div;\n setNode(div);\n return () => {\n div.remove();\n created.current = null;\n };\n }, [target, reuseTargetNode, className, id]);\n\n // Dir can change while a dropdown is open (language switch).\n useEffect(() => {\n if (!node) return;\n syncPortalDir(node);\n const observer = new MutationObserver(() => syncPortalDir(node));\n observer.observe(document.documentElement, { attributes: true, attributeFilter: [\"dir\"] });\n return () => observer.disconnect();\n }, [node]);\n\n return node ? createPortal(children, node) : null;\n}\n\n/** `withinPortal` helper used by overlays: portal or inline. */\nexport function OptionalPortal({ withinPortal = true, children, ...props }: PortalProps & { withinPortal?: boolean }) {\n return withinPortal ? <Portal {...props}>{children}</Portal> : <>{children}</>;\n}\n"],"mappings":";;;;;;AAAA,SAAS,WAAW,iBAAiB,QAAQ,gBAAgC;AAC7E,SAAS,oBAAoB;AAkFL,SAAyC,UAAzC;AApExB,IAAI,aAAoC;AAGxC,SAAS,cAAc,IAAiB;AACtC,QAAM,MAAM,SAAS,gBAAgB,aAAa,KAAK;AACvD,MAAI,IAAK,IAAG,aAAa,OAAO,GAAG;AAAA,MAC9B,IAAG,gBAAgB,KAAK;AAC/B;AAQO,SAAS,OAAO,QAAqB;AAC1C,QAAM,EAAE,QAAQ,iBAAiB,WAAW,IAAI,SAAS,IAAI,SAAS,UAAU,EAAE,iBAAiB,KAAK,GAAG,MAAM;AACjH,QAAM,CAAC,MAAM,OAAO,IAAI,SAA6B,IAAI;AACzD,QAAM,UAAU,OAA8B,IAAI;AAIlD,kBAAgB,MAAM;AACpB,QAAI,QAAQ;AACV,YAAM,KAAK,OAAO,WAAW,WAAW,SAAS,cAA2B,MAAM,IAAI;AACtF,UAAI,GAAI,eAAc,EAAE;AACxB,cAAQ,EAAE;AACV;AAAA,IACF;AAEA,QAAI,mBAAmB,CAAC,aAAa,CAAC,IAAI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FJ4SMR.js";
|
|
8
8
|
import {
|
|
9
9
|
Transition
|
|
10
10
|
} from "./chunk-H4D7LXZL.js";
|
|
@@ -200,4 +200,4 @@ export {
|
|
|
200
200
|
Tooltip,
|
|
201
201
|
TooltipFloating
|
|
202
202
|
};
|
|
203
|
-
//# sourceMappingURL=chunk-
|
|
203
|
+
//# sourceMappingURL=chunk-2WHZJI3S.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
Drawer
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-O6A7IBIW.js";
|
|
5
5
|
import {
|
|
6
6
|
Modal,
|
|
7
7
|
ModalRoot
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-7EINGVGG.js";
|
|
9
9
|
import {
|
|
10
10
|
ModalBaseBody,
|
|
11
11
|
ModalBaseCloseButton,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
ModalBaseHeader,
|
|
14
14
|
ModalBaseOverlay,
|
|
15
15
|
ModalBaseTitle
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ESMDK5GY.js";
|
|
17
17
|
import {
|
|
18
18
|
Button
|
|
19
19
|
} from "./chunk-7KIXQ2XG.js";
|
|
@@ -265,4 +265,4 @@ export {
|
|
|
265
265
|
AlertDialogCancel,
|
|
266
266
|
AlertDialogPortal
|
|
267
267
|
};
|
|
268
|
-
//# sourceMappingURL=chunk-
|
|
268
|
+
//# sourceMappingURL=chunk-652ZEQV7.js.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
ModalBaseRoot,
|
|
9
9
|
ModalBaseTitle,
|
|
10
10
|
sizeValue
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ESMDK5GY.js";
|
|
12
12
|
import {
|
|
13
13
|
getRadius,
|
|
14
14
|
getShadow,
|
|
@@ -64,4 +64,4 @@ export {
|
|
|
64
64
|
ModalRoot,
|
|
65
65
|
Modal
|
|
66
66
|
};
|
|
67
|
-
//# sourceMappingURL=chunk-
|
|
67
|
+
//# sourceMappingURL=chunk-7EINGVGG.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
formatNumber
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TIVOXLDX.js";
|
|
5
5
|
import {
|
|
6
6
|
InputBase
|
|
7
7
|
} from "./chunk-JJXJXOZ7.js";
|
|
@@ -351,4 +351,4 @@ export {
|
|
|
351
351
|
NumberInput,
|
|
352
352
|
InputNumber
|
|
353
353
|
};
|
|
354
|
-
//# sourceMappingURL=chunk-
|
|
354
|
+
//# sourceMappingURL=chunk-7S7RIVCI.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
PopoverDropdown,
|
|
5
5
|
PopoverTarget,
|
|
6
6
|
usePopoverContext
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-YRKCM3OL.js";
|
|
8
8
|
import {
|
|
9
9
|
UnstyledButton
|
|
10
10
|
} from "./chunk-5SQC5LKY.js";
|
|
@@ -216,4 +216,4 @@ export {
|
|
|
216
216
|
MenuLabel,
|
|
217
217
|
MenuDivider
|
|
218
218
|
};
|
|
219
|
-
//# sourceMappingURL=chunk-
|
|
219
|
+
//# sourceMappingURL=chunk-A76QHCP5.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
Popover,
|
|
7
7
|
PopoverDropdown,
|
|
8
8
|
PopoverTarget
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YRKCM3OL.js";
|
|
10
10
|
import {
|
|
11
11
|
factory
|
|
12
12
|
} from "./chunk-CJ7I6UM7.js";
|
|
@@ -341,4 +341,4 @@ export {
|
|
|
341
341
|
ComboboxClearButton,
|
|
342
342
|
CheckIcon
|
|
343
343
|
};
|
|
344
|
-
//# sourceMappingURL=chunk-
|
|
344
|
+
//# sourceMappingURL=chunk-BZPG4NZ6.js.map
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
ColorPicker,
|
|
4
|
+
convertHsvaTo,
|
|
5
|
+
isColorValid,
|
|
6
|
+
parseColor
|
|
7
|
+
} from "./chunk-VIO22OUP.js";
|
|
8
|
+
import {
|
|
9
|
+
ColorSwatch
|
|
10
|
+
} from "./chunk-MWYGXAJQ.js";
|
|
11
|
+
import {
|
|
12
|
+
InputBase
|
|
13
|
+
} from "./chunk-JJXJXOZ7.js";
|
|
14
|
+
import {
|
|
15
|
+
ActionIcon
|
|
16
|
+
} from "./chunk-YFBYWNYF.js";
|
|
17
|
+
import {
|
|
18
|
+
Popover,
|
|
19
|
+
PopoverDropdown,
|
|
20
|
+
PopoverTarget
|
|
21
|
+
} from "./chunk-YRKCM3OL.js";
|
|
22
|
+
import {
|
|
23
|
+
factory
|
|
24
|
+
} from "./chunk-CJ7I6UM7.js";
|
|
25
|
+
import {
|
|
26
|
+
useProps,
|
|
27
|
+
useStyles
|
|
28
|
+
} from "./chunk-4QBFXTYH.js";
|
|
29
|
+
import {
|
|
30
|
+
useWelloLabels,
|
|
31
|
+
useWelloTheme
|
|
32
|
+
} from "./chunk-IK562BNJ.js";
|
|
33
|
+
|
|
34
|
+
// src/components/ColorPicker/ColorInput.tsx
|
|
35
|
+
import { useEffect, useRef, useState } from "react";
|
|
36
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
37
|
+
var PREVIEW_SIZE = { xs: 16, sm: 18, md: 22, lg: 28, xl: 36 };
|
|
38
|
+
var ICON_SIZE = { xs: 14, sm: 16, md: 18, lg: 20, xl: 22 };
|
|
39
|
+
function EyeDropperIcon({ size, ...props }) {
|
|
40
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", width: size, height: size, fill: "none", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...props, children: [
|
|
41
|
+
/* @__PURE__ */ jsx("path", { d: "M11 7l6 6" }),
|
|
42
|
+
/* @__PURE__ */ jsx("path", { d: "M4 16l11.7-11.7a1 1 0 0 1 1.4 0l2.6 2.6a1 1 0 0 1 0 1.4L8 20H4v-4z" })
|
|
43
|
+
] });
|
|
44
|
+
}
|
|
45
|
+
var ColorInput = factory((_props, ref) => {
|
|
46
|
+
const props = useProps("ColorInput", { format: "hex", fixOnBlur: true, withPreview: true, swatchesPerRow: 7, withPicker: true, withEyeDropper: true, size: "sm" }, _props);
|
|
47
|
+
const {
|
|
48
|
+
classNames,
|
|
49
|
+
styles,
|
|
50
|
+
unstyled,
|
|
51
|
+
vars,
|
|
52
|
+
attributes,
|
|
53
|
+
disallowInput,
|
|
54
|
+
fixOnBlur,
|
|
55
|
+
popoverProps,
|
|
56
|
+
withPreview,
|
|
57
|
+
withEyeDropper,
|
|
58
|
+
eyeDropperIcon,
|
|
59
|
+
eyeDropperButtonProps,
|
|
60
|
+
closeOnColorSwatchClick,
|
|
61
|
+
value,
|
|
62
|
+
defaultValue,
|
|
63
|
+
onChange,
|
|
64
|
+
onChangeEnd,
|
|
65
|
+
onFocus,
|
|
66
|
+
onBlur,
|
|
67
|
+
onClick,
|
|
68
|
+
format = "hex",
|
|
69
|
+
readOnly,
|
|
70
|
+
withPicker,
|
|
71
|
+
swatches,
|
|
72
|
+
swatchesPerRow,
|
|
73
|
+
disabled,
|
|
74
|
+
leftSection,
|
|
75
|
+
rightSection,
|
|
76
|
+
size,
|
|
77
|
+
fullWidth,
|
|
78
|
+
...others
|
|
79
|
+
} = props;
|
|
80
|
+
const labels = useWelloLabels();
|
|
81
|
+
const theme = useWelloTheme();
|
|
82
|
+
const partClasses = typeof classNames === "function" ? classNames(theme, props) : classNames;
|
|
83
|
+
const partStyles = typeof styles === "function" ? styles(theme, props) : styles;
|
|
84
|
+
const getStyles = useStyles({ name: "ColorInput", props, classNames: partClasses, styles: partStyles, unstyled, vars, attributes, rootSelector: "wrapper" });
|
|
85
|
+
const [opened, setOpened] = useState(false);
|
|
86
|
+
const [internal, setInternal] = useState(defaultValue ?? "");
|
|
87
|
+
const current = value !== void 0 ? value : internal;
|
|
88
|
+
const setValue = (next) => {
|
|
89
|
+
if (value === void 0) setInternal(next);
|
|
90
|
+
onChange?.(next);
|
|
91
|
+
};
|
|
92
|
+
const lastValid = useRef("");
|
|
93
|
+
useEffect(() => {
|
|
94
|
+
if (isColorValid(current) || current.trim() === "") lastValid.current = current;
|
|
95
|
+
}, [current]);
|
|
96
|
+
const lastFormat = useRef(format);
|
|
97
|
+
useEffect(() => {
|
|
98
|
+
if (lastFormat.current === format) return;
|
|
99
|
+
lastFormat.current = format;
|
|
100
|
+
if (isColorValid(current)) setValue(convertHsvaTo(format, parseColor(current)));
|
|
101
|
+
}, [format]);
|
|
102
|
+
const [eyeDropperSupported, setSupported] = useState(false);
|
|
103
|
+
useEffect(() => setSupported(typeof window !== "undefined" && "EyeDropper" in window), []);
|
|
104
|
+
const named = typeof size === "string" ? size : "sm";
|
|
105
|
+
return /* @__PURE__ */ jsxs(
|
|
106
|
+
Popover,
|
|
107
|
+
{
|
|
108
|
+
position: "bottom-start",
|
|
109
|
+
offset: 5,
|
|
110
|
+
opened,
|
|
111
|
+
width: fullWidth ? "target" : void 0,
|
|
112
|
+
transitionProps: { duration: 0 },
|
|
113
|
+
...popoverProps,
|
|
114
|
+
dir: popoverProps?.dir ?? "ltr",
|
|
115
|
+
withRoles: false,
|
|
116
|
+
disabled: readOnly || withPicker === false && !swatches?.length,
|
|
117
|
+
children: [
|
|
118
|
+
/* @__PURE__ */ jsx(PopoverTarget, { children: /* @__PURE__ */ jsx(
|
|
119
|
+
InputBase,
|
|
120
|
+
{
|
|
121
|
+
autoComplete: "off",
|
|
122
|
+
spellCheck: false,
|
|
123
|
+
...others,
|
|
124
|
+
__staticSelector: "ColorInput",
|
|
125
|
+
ref,
|
|
126
|
+
classNames: partClasses,
|
|
127
|
+
styles: partStyles,
|
|
128
|
+
unstyled,
|
|
129
|
+
size,
|
|
130
|
+
disabled,
|
|
131
|
+
readOnly: disallowInput || readOnly,
|
|
132
|
+
pointer: disallowInput,
|
|
133
|
+
value: current,
|
|
134
|
+
onFocus: (event) => {
|
|
135
|
+
onFocus?.(event);
|
|
136
|
+
setOpened(true);
|
|
137
|
+
},
|
|
138
|
+
onBlur: (event) => {
|
|
139
|
+
if (fixOnBlur && current !== lastValid.current) setValue(lastValid.current);
|
|
140
|
+
onBlur?.(event);
|
|
141
|
+
setOpened(false);
|
|
142
|
+
},
|
|
143
|
+
onClick: (event) => {
|
|
144
|
+
onClick?.(event);
|
|
145
|
+
setOpened(true);
|
|
146
|
+
},
|
|
147
|
+
onChange: (event) => {
|
|
148
|
+
const next = event.currentTarget.value;
|
|
149
|
+
setValue(next);
|
|
150
|
+
if (isColorValid(next)) onChangeEnd?.(convertHsvaTo(format, parseColor(next)));
|
|
151
|
+
},
|
|
152
|
+
leftSection: leftSection || (withPreview ? /* @__PURE__ */ jsx(ColorSwatch, { color: isColorValid(current) ? current : "#fff", size: PREVIEW_SIZE[named] ?? 18, ...getStyles("colorPreview") }) : null),
|
|
153
|
+
rightSectionPointerEvents: "auto",
|
|
154
|
+
rightSection: rightSection || (withEyeDropper && !disabled && !readOnly && eyeDropperSupported ? /* @__PURE__ */ jsx(
|
|
155
|
+
ActionIcon,
|
|
156
|
+
{
|
|
157
|
+
"aria-label": labels.colorEyeDropper,
|
|
158
|
+
...eyeDropperButtonProps,
|
|
159
|
+
...getStyles("eyeDropperButton"),
|
|
160
|
+
variant: "subtle",
|
|
161
|
+
color: "gray",
|
|
162
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
163
|
+
onClick: () => {
|
|
164
|
+
const EyeDropper = window.EyeDropper;
|
|
165
|
+
new EyeDropper().open().then(({ sRGBHex }) => {
|
|
166
|
+
const color = convertHsvaTo(format, parseColor(sRGBHex));
|
|
167
|
+
setValue(color);
|
|
168
|
+
onChangeEnd?.(color);
|
|
169
|
+
}).catch(() => void 0);
|
|
170
|
+
},
|
|
171
|
+
children: eyeDropperIcon || /* @__PURE__ */ jsx(EyeDropperIcon, { size: ICON_SIZE[named] ?? 16, ...getStyles("eyeDropperIcon") })
|
|
172
|
+
}
|
|
173
|
+
) : null)
|
|
174
|
+
}
|
|
175
|
+
) }),
|
|
176
|
+
/* @__PURE__ */ jsx(PopoverDropdown, { ...getStyles("dropdown"), onMouseDown: (event) => event.preventDefault(), children: /* @__PURE__ */ jsx(
|
|
177
|
+
ColorPicker,
|
|
178
|
+
{
|
|
179
|
+
value: current,
|
|
180
|
+
onChange: setValue,
|
|
181
|
+
onChangeEnd,
|
|
182
|
+
format,
|
|
183
|
+
swatches,
|
|
184
|
+
swatchesPerRow,
|
|
185
|
+
withPicker,
|
|
186
|
+
size,
|
|
187
|
+
focusable: false,
|
|
188
|
+
unstyled,
|
|
189
|
+
classNames: partClasses,
|
|
190
|
+
styles: partStyles,
|
|
191
|
+
fullWidth,
|
|
192
|
+
onColorSwatchClick: () => {
|
|
193
|
+
if (closeOnColorSwatchClick) setOpened(false);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
) })
|
|
197
|
+
]
|
|
198
|
+
}
|
|
199
|
+
);
|
|
200
|
+
});
|
|
201
|
+
ColorInput.displayName = "ColorInput";
|
|
202
|
+
|
|
203
|
+
export {
|
|
204
|
+
ColorInput
|
|
205
|
+
};
|
|
206
|
+
//# sourceMappingURL=chunk-DRSBB5T4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/ColorPicker/ColorInput.tsx"],"sourcesContent":["import { useEffect, useRef, useState, type ReactNode } from \"react\";\nimport { factory } from \"../../core/factory/factory\";\nimport { useWelloLabels } from \"../../core/provider/labels\";\nimport { useWelloTheme } from \"../../core/provider/WelloProvider\";\nimport { useProps, useStyles, type StylesApiProps } from \"../../core/styles-api/styles-api\";\nimport { ActionIcon } from \"../ActionIcon/ActionIcon\";\nimport { InputBase, type InputBaseProps, type InputStylesNames, type InputWrapperStylesNames } from \"../Input/Input\";\nimport { Popover, PopoverDropdown, PopoverTarget, type PopoverProps } from \"../Popover/Popover\";\nimport { ColorSwatch } from \"../ThemeIcon/ThemeIcon\";\nimport { convertHsvaTo, isColorValid, parseColor } from \"./color-converters\";\nimport { ColorPicker, type ColorPickerBaseProps, type ColorPickerStylesNames } from \"./ColorPicker\";\n\nexport type ColorInputStylesNames = \"dropdown\" | \"eyeDropperButton\" | \"eyeDropperIcon\" | \"colorPreview\" | ColorPickerStylesNames | InputStylesNames | InputWrapperStylesNames;\n\nexport interface ColorInputProps extends Omit<InputBaseProps, \"value\" | \"defaultValue\" | \"onChange\" | \"size\" | keyof StylesApiProps<string>>, ColorPickerBaseProps, StylesApiProps<ColorInputStylesNames, ColorInputProps> {\n placeholder?: string;\n name?: string;\n readOnly?: boolean;\n /** Only the picker and swatches can change it */\n disallowInput?: boolean;\n /** Back to the last valid color on blur. Default: true */\n fixOnBlur?: boolean;\n popoverProps?: Partial<PopoverProps>;\n /** Color sample on the left. Default: true */\n withPreview?: boolean;\n /** Button to pick from the screen, where the browser supports it. Default: true */\n withEyeDropper?: boolean;\n eyeDropperIcon?: ReactNode;\n eyeDropperButtonProps?: Record<string, unknown>;\n /** Clicking a swatch closes the dropdown */\n closeOnColorSwatchClick?: boolean;\n onFocus?: React.FocusEventHandler<HTMLInputElement>;\n onBlur?: React.FocusEventHandler<HTMLInputElement>;\n onClick?: React.MouseEventHandler<HTMLInputElement>;\n}\n\nconst PREVIEW_SIZE: Record<string, number> = { xs: 16, sm: 18, md: 22, lg: 28, xl: 36 };\nconst ICON_SIZE: Record<string, number> = { xs: 14, sm: 16, md: 18, lg: 20, xl: 22 };\n\nfunction EyeDropperIcon({ size, ...props }: { size: number } & React.SVGProps<SVGSVGElement>) {\n return (\n <svg viewBox=\"0 0 24 24\" width={size} height={size} fill=\"none\" stroke=\"currentColor\" strokeWidth={1.5} strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\" {...props}>\n <path d=\"M11 7l6 6\" />\n <path d=\"M4 16l11.7-11.7a1 1 0 0 1 1.4 0l2.6 2.6a1 1 0 0 1 0 1.4L8 20H4v-4z\" />\n </svg>\n );\n}\n\ntype EyeDropperConstructor = new () => { open: () => Promise<{ sRGBHex: string }> };\n\n/**\n * Text field with a color picker in a dropdown.\n *\n * @example\n * <ColorInput label=\"Brand color\" value={color} onChange={setColor} />\n * <ColorInput {...field} format=\"rgba\" swatches={[\"#2563eb\", \"#dc2626\"]} />\n */\nexport const ColorInput = factory<{ props: ColorInputProps; ref: HTMLInputElement; stylesNames: ColorInputStylesNames }>((_props, ref) => {\n const props = useProps(\"ColorInput\", { format: \"hex\", fixOnBlur: true, withPreview: true, swatchesPerRow: 7, withPicker: true, withEyeDropper: true, size: \"sm\" }, _props);\n const {\n classNames,\n styles,\n unstyled,\n vars,\n attributes,\n disallowInput,\n fixOnBlur,\n popoverProps,\n withPreview,\n withEyeDropper,\n eyeDropperIcon,\n eyeDropperButtonProps,\n closeOnColorSwatchClick,\n value,\n defaultValue,\n onChange,\n onChangeEnd,\n onFocus,\n onBlur,\n onClick,\n format = \"hex\",\n readOnly,\n withPicker,\n swatches,\n swatchesPerRow,\n disabled,\n leftSection,\n rightSection,\n size,\n fullWidth,\n ...others\n } = props;\n const labels = useWelloLabels();\n const theme = useWelloTheme();\n const partClasses = typeof classNames === \"function\" ? classNames(theme, props) : classNames;\n const partStyles = typeof styles === \"function\" ? styles(theme, props) : styles;\n const getStyles = useStyles<ColorInputStylesNames, ColorInputProps>({ name: \"ColorInput\", props, classNames: partClasses, styles: partStyles, unstyled, vars, attributes, rootSelector: \"wrapper\" });\n\n const [opened, setOpened] = useState(false);\n const [internal, setInternal] = useState(defaultValue ?? \"\");\n const current = value !== undefined ? value : internal;\n const setValue = (next: string) => {\n if (value === undefined) setInternal(next);\n onChange?.(next);\n };\n const lastValid = useRef(\"\");\n useEffect(() => {\n if (isColorValid(current) || current.trim() === \"\") lastValid.current = current;\n }, [current]);\n\n // Compared, not \"skip the first run\": StrictMode runs effects twice on mount.\n const lastFormat = useRef(format);\n useEffect(() => {\n if (lastFormat.current === format) return;\n lastFormat.current = format;\n if (isColorValid(current)) setValue(convertHsvaTo(format, parseColor(current)));\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [format]);\n\n // Checked after mount, so the server and the browser render the same thing.\n const [eyeDropperSupported, setSupported] = useState(false);\n useEffect(() => setSupported(typeof window !== \"undefined\" && \"EyeDropper\" in window), []);\n const named = typeof size === \"string\" ? size : \"sm\";\n\n return (\n <Popover\n position=\"bottom-start\"\n offset={5}\n opened={opened}\n width={fullWidth ? \"target\" : undefined}\n transitionProps={{ duration: 0 }}\n {...popoverProps}\n dir={popoverProps?.dir ?? \"ltr\"}\n withRoles={false}\n disabled={readOnly || (withPicker === false && !swatches?.length)}\n >\n <PopoverTarget>\n <InputBase\n autoComplete=\"off\"\n spellCheck={false}\n {...(others as object)}\n __staticSelector=\"ColorInput\"\n ref={ref}\n classNames={partClasses}\n styles={partStyles}\n unstyled={unstyled}\n size={size}\n disabled={disabled}\n readOnly={disallowInput || readOnly}\n pointer={disallowInput}\n value={current}\n onFocus={(event: React.FocusEvent<HTMLInputElement>) => {\n onFocus?.(event);\n setOpened(true);\n }}\n onBlur={(event: React.FocusEvent<HTMLInputElement>) => {\n if (fixOnBlur && current !== lastValid.current) setValue(lastValid.current);\n onBlur?.(event);\n setOpened(false);\n }}\n onClick={(event: React.MouseEvent<HTMLInputElement>) => {\n onClick?.(event);\n setOpened(true);\n }}\n onChange={(event: React.ChangeEvent<HTMLInputElement>) => {\n const next = event.currentTarget.value;\n setValue(next);\n if (isColorValid(next)) onChangeEnd?.(convertHsvaTo(format, parseColor(next)));\n }}\n leftSection={leftSection || (withPreview ? <ColorSwatch color={isColorValid(current) ? current : \"#fff\"} size={PREVIEW_SIZE[named] ?? 18} {...getStyles(\"colorPreview\")} /> : null)}\n rightSectionPointerEvents=\"auto\"\n rightSection={\n rightSection ||\n (withEyeDropper && !disabled && !readOnly && eyeDropperSupported ? (\n <ActionIcon\n aria-label={labels.colorEyeDropper}\n {...eyeDropperButtonProps}\n {...getStyles(\"eyeDropperButton\")}\n variant=\"subtle\"\n color=\"gray\"\n onMouseDown={(event: React.MouseEvent) => event.preventDefault()}\n onClick={() => {\n const EyeDropper = (window as unknown as { EyeDropper: EyeDropperConstructor }).EyeDropper;\n new EyeDropper()\n .open()\n .then(({ sRGBHex }) => {\n const color = convertHsvaTo(format, parseColor(sRGBHex));\n setValue(color);\n onChangeEnd?.(color);\n })\n .catch(() => undefined);\n }}\n >\n {eyeDropperIcon || <EyeDropperIcon size={ICON_SIZE[named] ?? 16} {...(getStyles(\"eyeDropperIcon\") as object)} />}\n </ActionIcon>\n ) : null)\n }\n />\n </PopoverTarget>\n <PopoverDropdown {...getStyles(\"dropdown\")} onMouseDown={(event: React.MouseEvent) => event.preventDefault()}>\n <ColorPicker\n value={current}\n onChange={setValue}\n onChangeEnd={onChangeEnd}\n format={format}\n swatches={swatches}\n swatchesPerRow={swatchesPerRow}\n withPicker={withPicker}\n size={size}\n focusable={false}\n unstyled={unstyled}\n classNames={partClasses as never}\n styles={partStyles as never}\n fullWidth={fullWidth}\n onColorSwatchClick={() => {\n if (closeOnColorSwatchClick) setOpened(false);\n }}\n />\n </PopoverDropdown>\n </Popover>\n );\n});\nColorInput.displayName = \"ColorInput\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,WAAW,QAAQ,gBAAgC;AAyCxD,SACE,KADF;AALJ,IAAM,eAAuC,EAAE,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,GAAG;AACtF,IAAM,YAAoC,EAAE,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,GAAG;AAEnF,SAAS,eAAe,EAAE,MAAM,GAAG,MAAM,GAAqD;AAC5F,SACE,qBAAC,SAAI,SA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A4B,MAAM,eAAe,GACzG;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,YACP,UAAU;AAAA,YACV;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA,WAAW;AAAA,YACX;AAAA,YACA,YAAY;AAAA,YACZ,QAAQ;AAAA,YACR;AAAA,YACA,oBAAoB,MAAM;AACxB,kBAAI,wBAAyB,WAAU,KAAK;AAAA,YAC9C;AAAA;AAAA,QACF,GACF;AAAA;AAAA;AAAA,EACF;AAEJ,CAAC;AACD,WAAW,cAAc;","names":[]}
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "./chunk-AZ4WBNXD.js";
|
|
13
13
|
import {
|
|
14
14
|
OptionalPortal
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-2TFJ4SMR.js";
|
|
16
16
|
import {
|
|
17
17
|
transitionStyles,
|
|
18
18
|
useTransition
|
|
@@ -209,4 +209,4 @@ export {
|
|
|
209
209
|
ModalBaseCloseButton,
|
|
210
210
|
sizeValue
|
|
211
211
|
};
|
|
212
|
-
//# sourceMappingURL=chunk-
|
|
212
|
+
//# sourceMappingURL=chunk-ESMDK5GY.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Tooltip,
|
|
4
4
|
TooltipFloating
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-2WHZJI3S.js";
|
|
6
6
|
import {
|
|
7
7
|
Menu,
|
|
8
8
|
MenuDivider,
|
|
@@ -10,12 +10,12 @@ import {
|
|
|
10
10
|
MenuItem,
|
|
11
11
|
MenuLabel,
|
|
12
12
|
MenuTarget
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-A76QHCP5.js";
|
|
14
14
|
import {
|
|
15
15
|
Popover,
|
|
16
16
|
PopoverDropdown,
|
|
17
17
|
PopoverTarget
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-YRKCM3OL.js";
|
|
19
19
|
import {
|
|
20
20
|
part,
|
|
21
21
|
toPosition,
|
|
@@ -273,4 +273,4 @@ export {
|
|
|
273
273
|
DropdownMenuSubTrigger,
|
|
274
274
|
DropdownMenuSubContent
|
|
275
275
|
};
|
|
276
|
-
//# sourceMappingURL=chunk-
|
|
276
|
+
//# sourceMappingURL=chunk-FSR3OEUP.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Dialog,
|
|
4
4
|
DialogContent
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-652ZEQV7.js";
|
|
6
6
|
import {
|
|
7
7
|
cx
|
|
8
8
|
} from "./chunk-ORHFHJKL.js";
|
|
@@ -58,4 +58,4 @@ export {
|
|
|
58
58
|
CommandItem,
|
|
59
59
|
CommandShortcut
|
|
60
60
|
};
|
|
61
|
-
//# sourceMappingURL=chunk-
|
|
61
|
+
//# sourceMappingURL=chunk-HBBXBVK6.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-57ZKN6G3.js";
|
|
5
5
|
import {
|
|
6
6
|
OptionalPortal
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2TFJ4SMR.js";
|
|
8
8
|
import {
|
|
9
9
|
Transition
|
|
10
10
|
} from "./chunk-H4D7LXZL.js";
|
|
@@ -58,4 +58,4 @@ Dialog.displayName = "Dialog";
|
|
|
58
58
|
export {
|
|
59
59
|
Dialog
|
|
60
60
|
};
|
|
61
|
-
//# sourceMappingURL=chunk-
|
|
61
|
+
//# sourceMappingURL=chunk-K3B2RENY.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
Modal
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7EINGVGG.js";
|
|
5
5
|
import {
|
|
6
6
|
Button
|
|
7
7
|
} from "./chunk-7KIXQ2XG.js";
|
|
@@ -459,4 +459,4 @@ export {
|
|
|
459
459
|
formatFileSize,
|
|
460
460
|
Dropzone
|
|
461
461
|
};
|
|
462
|
-
//# sourceMappingURL=chunk-
|
|
462
|
+
//# sourceMappingURL=chunk-NGXT7GNE.js.map
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
ComboboxOptions,
|
|
20
20
|
ComboboxTarget,
|
|
21
21
|
useCombobox
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-BZPG4NZ6.js";
|
|
23
23
|
|
|
24
24
|
// src/components/Combobox/TagsInput.tsx
|
|
25
25
|
import { useMemo, useState } from "react";
|
|
@@ -197,4 +197,4 @@ function TagsInput({
|
|
|
197
197
|
export {
|
|
198
198
|
TagsInput
|
|
199
199
|
};
|
|
200
|
-
//# sourceMappingURL=chunk-
|
|
200
|
+
//# sourceMappingURL=chunk-NH26XE7T.js.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
ModalBaseRoot,
|
|
9
9
|
ModalBaseTitle,
|
|
10
10
|
sizeValue
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ESMDK5GY.js";
|
|
12
12
|
import {
|
|
13
13
|
getRadius,
|
|
14
14
|
getShadow,
|
|
@@ -71,4 +71,4 @@ export {
|
|
|
71
71
|
DrawerRoot,
|
|
72
72
|
Drawer
|
|
73
73
|
};
|
|
74
|
-
//# sourceMappingURL=chunk-
|
|
74
|
+
//# sourceMappingURL=chunk-O6A7IBIW.js.map
|
|
@@ -7,6 +7,15 @@ function split(position) {
|
|
|
7
7
|
const [side, align] = position.split("-");
|
|
8
8
|
return [side, align ?? "center"];
|
|
9
9
|
}
|
|
10
|
+
function toPlaceAlign(align, dir, side) {
|
|
11
|
+
if (align === "center") return "center";
|
|
12
|
+
if (align === "left") return "start";
|
|
13
|
+
if (align === "right") return "end";
|
|
14
|
+
if (dir === "rtl" && (side === "top" || side === "bottom")) {
|
|
15
|
+
return align === "start" ? "end" : "start";
|
|
16
|
+
}
|
|
17
|
+
return align;
|
|
18
|
+
}
|
|
10
19
|
function place(ref, width, height, side, align, offset) {
|
|
11
20
|
let x = 0;
|
|
12
21
|
let y = 0;
|
|
@@ -50,10 +59,8 @@ function useFloating(options) {
|
|
|
50
59
|
const height = el.offsetHeight;
|
|
51
60
|
const vw = document.documentElement.clientWidth;
|
|
52
61
|
const vh = document.documentElement.clientHeight;
|
|
53
|
-
let [side,
|
|
54
|
-
|
|
55
|
-
align = align === "start" ? "end" : "start";
|
|
56
|
-
}
|
|
62
|
+
let [side, rawAlign] = split(position);
|
|
63
|
+
const align = toPlaceAlign(rawAlign, dir, side);
|
|
57
64
|
const locked = preventPositionChangeWhenVisible ? lockedSide.current : null;
|
|
58
65
|
if (locked) side = locked;
|
|
59
66
|
let { x, y } = place(rect, width, height, side, align, offset);
|
|
@@ -93,7 +100,7 @@ function useFloating(options) {
|
|
|
93
100
|
arrowY = Math.min(Math.max(target, min), height - min);
|
|
94
101
|
}
|
|
95
102
|
}
|
|
96
|
-
const placement =
|
|
103
|
+
const placement = rawAlign === "center" ? side : `${side}-${rawAlign}`;
|
|
97
104
|
if (placement !== lastPlacement.current) {
|
|
98
105
|
lastPlacement.current = placement;
|
|
99
106
|
changed.current?.(placement);
|
|
@@ -128,17 +135,17 @@ function useFloating(options) {
|
|
|
128
135
|
}, [opened, update]);
|
|
129
136
|
const setReference = useCallback(
|
|
130
137
|
(node) => {
|
|
131
|
-
if (
|
|
138
|
+
if (node === reference.current) return;
|
|
132
139
|
reference.current = node;
|
|
133
|
-
if (opened) update();
|
|
140
|
+
if (node && opened) update();
|
|
134
141
|
},
|
|
135
142
|
[opened, update]
|
|
136
143
|
);
|
|
137
144
|
const setFloating = useCallback(
|
|
138
145
|
(node) => {
|
|
139
|
-
if (
|
|
146
|
+
if (node === floating.current) return;
|
|
140
147
|
floating.current = node;
|
|
141
|
-
update();
|
|
148
|
+
if (node) update();
|
|
142
149
|
},
|
|
143
150
|
[update]
|
|
144
151
|
);
|
|
@@ -148,4 +155,4 @@ function useFloating(options) {
|
|
|
148
155
|
export {
|
|
149
156
|
useFloating
|
|
150
157
|
};
|
|
151
|
-
//# sourceMappingURL=chunk-
|
|
158
|
+
//# sourceMappingURL=chunk-QCMTAQSP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/overlay/use-floating.ts"],"sourcesContent":["import { useCallback, useEffect, useLayoutEffect, useRef, useState } from \"react\";\n\nexport type FloatingSide = \"top\" | \"right\" | \"bottom\" | \"left\";\n/** `start`/`end` follow `dir`; `left`/`right` are physical and never RTL-flipped. */\nexport type FloatingAlign = \"start\" | \"center\" | \"end\" | \"left\" | \"right\";\nexport type FloatingPosition =\n | FloatingSide\n | `${FloatingSide}-start`\n | `${FloatingSide}-end`\n | `${FloatingSide}-left`\n | `${FloatingSide}-right`;\n\nexport interface UseFloatingOptions {\n opened: boolean;\n /** Default: 'bottom' */\n position?: FloatingPosition;\n /** Gap between target and dropdown, px. Default: 8 */\n offset?: number;\n /** Move to the opposite side when there is no room. Default: true */\n flip?: boolean;\n /** Slide along the target to stay in the viewport. Default: true */\n shift?: boolean;\n /** Distance kept from the viewport edges, px. Default: 8 */\n padding?: number;\n /** RTL swaps logical start / end on top and bottom (not physical left / right) */\n dir?: \"ltr\" | \"rtl\";\n /** Arrow size, for keeping it inside rounded corners */\n arrowSize?: number;\n /** Space between the arrow and the dropdown corner. Default: 5 */\n arrowOffset?: number;\n /** Arrow at the side edge or centered on the target. Default: 'side' */\n arrowPosition?: \"side\" | \"center\";\n onPositionChange?: (position: FloatingPosition) => void;\n /** Stay on the side it opened on, instead of flipping while scrolling. Default: true */\n preventPositionChangeWhenVisible?: boolean;\n}\n\nexport interface FloatingState {\n x: number;\n y: number;\n /** Final position after flipping */\n placement: FloatingPosition;\n arrowX?: number;\n arrowY?: number;\n /** Target size, for `width=\"target\"` */\n referenceWidth: number;\n ready: boolean;\n /** The target is scrolled out of sight */\n referenceHidden: boolean;\n}\n\nconst OPPOSITE: Record<FloatingSide, FloatingSide> = { top: \"bottom\", bottom: \"top\", left: \"right\", right: \"left\" };\n\ntype PlaceAlign = \"start\" | \"center\" | \"end\";\n\nfunction split(position: FloatingPosition): [FloatingSide, FloatingAlign] {\n const [side, align] = position.split(\"-\") as [FloatingSide, FloatingAlign | undefined];\n return [side, align ?? \"center\"];\n}\n\n/** Map alignment to place() coords. Physical left/right never pass through RTL mirroring. */\nfunction toPlaceAlign(align: FloatingAlign, dir: \"ltr\" | \"rtl\", side: FloatingSide): PlaceAlign {\n if (align === \"center\") return \"center\";\n if (align === \"left\") return \"start\";\n if (align === \"right\") return \"end\";\n // Logical start/end — mirror only for top/bottom in RTL.\n if (dir === \"rtl\" && (side === \"top\" || side === \"bottom\")) {\n return align === \"start\" ? \"end\" : \"start\";\n }\n return align;\n}\n\n/** Coordinates of a dropdown for a side / alignment, in viewport (fixed) coordinates. */\nfunction place(ref: DOMRect, width: number, height: number, side: FloatingSide, align: PlaceAlign, offset: number) {\n let x = 0;\n let y = 0;\n if (side === \"top\" || side === \"bottom\") {\n y = side === \"bottom\" ? ref.bottom + offset : ref.top - offset - height;\n x = align === \"start\" ? ref.left : align === \"end\" ? ref.right - width : ref.left + ref.width / 2 - width / 2;\n } else {\n x = side === \"right\" ? ref.right + offset : ref.left - offset - width;\n y = align === \"start\" ? ref.top : align === \"end\" ? ref.bottom - height : ref.top + ref.height / 2 - height / 2;\n }\n return { x, y };\n}\n\n/**\n * Positions a floating element next to a reference element (position: fixed), with flip,\n * shift and an arrow. Updates on scroll, resize and size changes.\n */\nexport function useFloating(options: UseFloatingOptions) {\n const {\n opened,\n position = \"bottom\",\n offset = 8,\n flip = true,\n shift = true,\n padding = 8,\n dir = \"ltr\",\n arrowSize = 0,\n arrowOffset = 5,\n arrowPosition = \"side\",\n onPositionChange,\n preventPositionChangeWhenVisible = true,\n } = options;\n const reference = useRef<HTMLElement | null>(null);\n const floating = useRef<HTMLElement | null>(null);\n const [state, setState] = useState<FloatingState>({ x: 0, y: 0, placement: position, referenceWidth: 0, ready: false, referenceHidden: false });\n const lastPlacement = useRef(position);\n const lockedSide = useRef<FloatingSide | null>(null);\n const changed = useRef(onPositionChange);\n changed.current = onPositionChange;\n\n const update = useCallback(() => {\n const ref = reference.current;\n const el = floating.current;\n if (!ref || !el) return;\n const rect = ref.getBoundingClientRect();\n const width = el.offsetWidth;\n const height = el.offsetHeight;\n const vw = document.documentElement.clientWidth;\n const vh = document.documentElement.clientHeight;\n let [side, rawAlign] = split(position);\n const align = toPlaceAlign(rawAlign, dir, side);\n\n const locked = preventPositionChangeWhenVisible ? lockedSide.current : null;\n if (locked) side = locked;\n let { x, y } = place(rect, width, height, side, align, offset);\n if (flip && !locked) {\n const overflows = (s: FloatingSide, px: number, py: number) =>\n s === \"bottom\" ? py + height > vh - padding : s === \"top\" ? py < padding : s === \"right\" ? px + width > vw - padding : px < padding;\n if (overflows(side, x, y)) {\n const other = OPPOSITE[side];\n const flipped = place(rect, width, height, other, align, offset);\n const room = (s: FloatingSide) =>\n s === \"bottom\" ? vh - rect.bottom : s === \"top\" ? rect.top : s === \"right\" ? vw - rect.right : rect.left;\n if (!overflows(other, flipped.x, flipped.y) || room(other) > room(side)) {\n side = other;\n ({ x, y } = flipped);\n }\n }\n }\n if (shift) {\n if (side === \"top\" || side === \"bottom\") x = Math.min(Math.max(x, padding), Math.max(padding, vw - width - padding));\n else y = Math.min(Math.max(y, padding), Math.max(padding, vh - height - padding));\n }\n\n // Nothing measured yet means it isn't really open, so it may still pick a side.\n if (width > 0) lockedSide.current = side;\n\n // Outside the viewport, or cut off by a scrolling parent.\n let referenceHidden = rect.bottom <= 0 || rect.top >= vh || rect.right <= 0 || rect.left >= vw;\n for (let parent = ref.parentElement; parent && !referenceHidden && parent !== document.body; parent = parent.parentElement) {\n const style = getComputedStyle(parent);\n if (style.overflowX === \"visible\" && style.overflowY === \"visible\") continue;\n const box = parent.getBoundingClientRect();\n referenceHidden = rect.bottom <= box.top || rect.top >= box.bottom || rect.right <= box.left || rect.left >= box.right;\n }\n\n // Arrow: points at the target, kept away from the rounded corners.\n let arrowX: number | undefined;\n let arrowY: number | undefined;\n if (arrowSize) {\n const min = arrowOffset + arrowSize;\n if (side === \"top\" || side === \"bottom\") {\n const target =\n arrowPosition === \"center\" || align === \"center\"\n ? rect.left + rect.width / 2 - x\n : align === \"start\"\n ? Math.min(rect.width / 2, min + arrowSize) + (rect.left - x)\n : rect.right - x - Math.min(rect.width / 2, min + arrowSize);\n arrowX = Math.min(Math.max(target, min), width - min);\n } else {\n const target =\n arrowPosition === \"center\" || align === \"center\"\n ? rect.top + rect.height / 2 - y\n : align === \"start\"\n ? Math.min(rect.height / 2, min + arrowSize) + (rect.top - y)\n : rect.bottom - y - Math.min(rect.height / 2, min + arrowSize);\n arrowY = Math.min(Math.max(target, min), height - min);\n }\n }\n\n // Keep the caller's alignment token (left/right/start/end) so RTL remounts don't rewrite it.\n const placement = (rawAlign === \"center\" ? side : `${side}-${rawAlign}`) as FloatingPosition;\n if (placement !== lastPlacement.current) {\n lastPlacement.current = placement;\n changed.current?.(placement);\n }\n setState((prev) =>\n prev.referenceHidden === referenceHidden && prev.x === x && prev.y === y && prev.placement === placement && prev.arrowX === arrowX && prev.arrowY === arrowY && prev.referenceWidth === rect.width && prev.ready\n ? prev\n : { x, y, placement, arrowX, arrowY, referenceWidth: rect.width, ready: true, referenceHidden },\n );\n }, [position, offset, flip, shift, padding, dir, arrowSize, arrowOffset, arrowPosition, preventPositionChangeWhenVisible]);\n\n useLayoutEffect(() => {\n lockedSide.current = null;\n if (opened) update();\n else setState((prev) => (prev.ready ? { ...prev, ready: false } : prev));\n }, [opened, update]);\n\n useEffect(() => {\n if (!opened) return;\n let frame = requestAnimationFrame(update);\n const onChange = () => {\n cancelAnimationFrame(frame);\n frame = requestAnimationFrame(update);\n };\n window.addEventListener(\"scroll\", onChange, true);\n window.addEventListener(\"resize\", onChange);\n const observer = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(onChange) : null;\n if (reference.current) observer?.observe(reference.current);\n if (floating.current) observer?.observe(floating.current);\n return () => {\n cancelAnimationFrame(frame);\n window.removeEventListener(\"scroll\", onChange, true);\n window.removeEventListener(\"resize\", onChange);\n observer?.disconnect();\n };\n }, [opened, update]);\n\n // React calls an old ref callback with null and the new one with the node on every render when the\n // callback changes, so only a different node counts. Measuring here on each render can feed itself.\n const setReference = useCallback(\n (node: HTMLElement | null) => {\n if (node === reference.current) return;\n reference.current = node;\n if (node && opened) update();\n },\n [opened, update],\n );\n const setFloating = useCallback(\n (node: HTMLElement | null) => {\n if (node === floating.current) return;\n floating.current = node;\n if (node) update();\n },\n [update],\n );\n return { ...state, update, reference, floating, setReference, setFloating };\n}\n"],"mappings":";;;AAAA,SAAS,aAAa,WAAW,iBAAiB,QAAQ,gBAAgB;AAmD1E,IAAM,WAA+C,EAAE,KAAK,UAAU,QAAQ,OAAO,MAAM,SAAS,OAAO,OAAO;AAIlH,SAAS,MAAM,UAA2D;AACxE,QAAM,CAAC,MAAM,KAAK,IAAI,SAAS,MAAM,GAAG;AACxC,SAAO,CAAC,MAAM,SAAS,QAAQ;AACjC;AAGA,SAAS,aAAa,OAAsB,KAAoB,MAAgC;AAC9F,MAAI,UAAU,SAAU,QAAO;AAC/B,MAAI,UAAU,OAAQ,QAAO;AAC7B,MAAI,UAAU,QAAS,QAAO;AAE9B,MAAI,QAAQ,UAAU,SAAS,SAAS,SAAS,WAAW;AAC1D,WAAO,UAAU,UAAU,QAAQ;AAAA,EACrC;AACA,SAAO;AACT;AAGA,SAAS,MAAM,KAAc,OAAe,QAAgB,MAAoB,OAAmB,QAAgB;AACjH,MAAI,IAAI;AACR,MAAI,IAAI;AACR,MAAI,SAAS,SAAS,SAAS,UAAU;AACvC,QAAI,SAAS,WAAW,IAAI,SAAS,SAAS,IAAI,MAAM,SAAS;AACjE,QAAI,UAAU,UAAU,IAAI,OAAO,UAAU,QAAQ,IAAI,QAAQ,QAAQ,IAAI,OAAO,IA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