haze-ui 1.12.2 → 1.13.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 +63 -0
- package/dist/components/ColorPicker/ColorPickerCore.js +2 -0
- package/dist/components/Combobox/Combobox.js +45 -34
- package/dist/components/Command/Command.js +72 -37
- package/dist/components/ContextMenu/ContextMenu.js +19 -17
- package/dist/components/ContextMenu/ContextMenuContent.js +24 -12
- package/dist/components/ContextMenu/ContextMenuItem.js +2 -0
- package/dist/components/DateRangePicker/DateRangePickerCore.js +2 -0
- package/dist/components/Datepicker/Calendar.js +58 -44
- package/dist/components/Datepicker/DatepickerCore.js +37 -29
- package/dist/components/DropdownMenu/DropdownMenu.js +20 -20
- package/dist/components/DropdownMenu/DropdownMenuContent.js +38 -45
- package/dist/components/DropdownMenu/DropdownMenuTrigger.js +9 -7
- package/dist/components/InlineEdit/InlineEdit.js +1 -0
- package/dist/components/Menu/Menu.js +38 -26
- package/dist/components/Menu/MenuItem.js +1 -0
- package/dist/components/ModelPicker/ModelPicker.js +1 -0
- package/dist/components/OTPInput/OTPInputCore.js +1 -0
- package/dist/components/PasswordInput/PasswordInputCore.js +1 -0
- package/dist/components/Popover/Popover.js +32 -75
- package/dist/components/Progress/Progress.js +2 -0
- package/dist/components/Tooltip/Tooltip.js +50 -24
- package/dist/components/Tree/TreeItem.js +44 -41
- package/dist/components/Upload/Upload.js +1 -0
- package/dist/css/combobox.css +2 -1
- package/dist/css/command.css +1 -1
- package/dist/css/context-menu.css +1 -0
- package/dist/css/datepicker.css +3 -2
- package/dist/css/dropdown-menu.css +2 -1
- package/dist/css/menu.css +2 -1
- package/dist/css/popover.css +2 -1
- package/dist/css/tooltip.css +2 -1
- package/dist/form/FormItem.js +23 -15
- package/dist/haze-ui.css +15 -8
- package/dist/types/components/ContextMenu/ContextMenuContent.d.ts +1 -1
- package/dist/types/components/ContextMenu/ContextMenuContext.d.ts +5 -1
- package/dist/types/components/DropdownMenu/DropdownMenuContent.d.ts +1 -1
- package/dist/types/components/DropdownMenu/DropdownMenuContext.d.ts +3 -0
- package/dist/types/components/DropdownMenu/DropdownMenuTrigger.d.ts +1 -1
- package/dist/types/components/Tooltip/Tooltip.d.ts +5 -1
- package/dist/types/form/FormItem.d.ts +63 -7
- package/dist/types/form/index.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/utils/floating.d.ts +99 -0
- package/dist/types/utils/menuKeyboard.d.ts +43 -0
- package/dist/utils/floating.js +181 -0
- package/dist/utils/menuKeyboard.js +88 -0
- package/package.json +34 -8
- package/dist/components/DropdownMenu/useMenuKeyboard.js +0 -52
- package/dist/types/components/DropdownMenu/useMenuKeyboard.d.ts +0 -19
- package/dist/types/hooks/index.d.ts +0 -1
- package/dist/types/utils/index.d.ts +0 -1
|
@@ -1,42 +1,50 @@
|
|
|
1
1
|
|
|
2
2
|
import { classnames as e } from "../../utils/classnames.js";
|
|
3
|
-
import t from "
|
|
3
|
+
import { FloatingPanel as t, useFloating as n } from "../../utils/floating.js";
|
|
4
|
+
import r from "./Calendar.js";
|
|
4
5
|
/* empty css */
|
|
5
|
-
import { jsx as
|
|
6
|
-
import {
|
|
6
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
7
|
+
import { useCallback as o, useId as s, useRef as c } from "react";
|
|
7
8
|
//#region src/lib/components/Datepicker/DatepickerCore.tsx
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
children: [/* @__PURE__ */ n("input", {
|
|
9
|
+
var l = "haze-DatepickerCore__wrapper", u = "haze-DatepickerCore__input", d = "haze-DatepickerCore__dropdown";
|
|
10
|
+
function f({ value: f, onChange: p, open: m, onOpenChange: h, min: g, max: _, placeholder: v = "Select date", className: y }) {
|
|
11
|
+
let b = c(null), x = c(null), S = s(), C = o((e) => h(typeof e == "function" ? e(m) : e), [h, m]), w = n({
|
|
12
|
+
open: m,
|
|
13
|
+
setOpen: C,
|
|
14
|
+
triggerRef: b,
|
|
15
|
+
panelRef: x
|
|
16
|
+
});
|
|
17
|
+
return /* @__PURE__ */ a("div", {
|
|
18
|
+
className: e([l, y]),
|
|
19
|
+
children: [/* @__PURE__ */ i("input", {
|
|
20
|
+
ref: b,
|
|
21
21
|
readOnly: !0,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
style: w.triggerStyle,
|
|
23
|
+
className: u,
|
|
24
|
+
value: f,
|
|
25
|
+
placeholder: v,
|
|
26
|
+
role: "combobox",
|
|
26
27
|
"aria-haspopup": "dialog",
|
|
27
|
-
"aria-expanded":
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
"aria-expanded": m,
|
|
29
|
+
"aria-controls": S,
|
|
30
|
+
onPointerDown: w.onTriggerPointerDown,
|
|
31
|
+
onClick: w.onTriggerClick
|
|
32
|
+
}), /* @__PURE__ */ i(t, {
|
|
33
|
+
ref: x,
|
|
34
|
+
behavior: w,
|
|
35
|
+
placement: "bottom",
|
|
36
|
+
visualClass: d,
|
|
37
|
+
id: S,
|
|
38
|
+
children: /* @__PURE__ */ i(r, {
|
|
39
|
+
value: f,
|
|
40
|
+
min: g,
|
|
41
|
+
max: _,
|
|
34
42
|
onSelect: (e) => {
|
|
35
|
-
|
|
43
|
+
p(e), h(!1);
|
|
36
44
|
}
|
|
37
45
|
})
|
|
38
46
|
})]
|
|
39
47
|
});
|
|
40
48
|
}
|
|
41
49
|
//#endregion
|
|
42
|
-
export {
|
|
50
|
+
export { f as default };
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
|
|
2
2
|
import { classnames as e } from "../../utils/classnames.js";
|
|
3
|
-
import {
|
|
3
|
+
import { useFloating as t } from "../../utils/floating.js";
|
|
4
|
+
import { DropdownMenuProvider as n } from "./DropdownMenuContext.js";
|
|
4
5
|
/* empty css */
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { useControl as
|
|
7
|
-
import { useCallback as
|
|
6
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
7
|
+
import { useControl as i } from "react-use-control";
|
|
8
|
+
import { useCallback as a, useId as o, useRef as s } from "react";
|
|
8
9
|
//#region src/lib/components/DropdownMenu/DropdownMenu.tsx
|
|
9
10
|
var c = "haze-DropdownMenu__wrapper";
|
|
10
11
|
function l({ open: l, onOpenChange: u, children: d, className: f }) {
|
|
11
|
-
let [p, m] =
|
|
12
|
+
let [p, m] = i(l, !1), h = s(null), g = s(null), _ = o(), v = s(null), y = a((e) => {
|
|
12
13
|
let t = typeof e == "function" ? e(p) : e;
|
|
13
14
|
m(t), u?.(t);
|
|
14
15
|
}, [
|
|
15
16
|
p,
|
|
16
17
|
m,
|
|
17
18
|
u
|
|
18
|
-
])
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}, [p, b]), /* @__PURE__ */ n(t, {
|
|
19
|
+
]), b = t({
|
|
20
|
+
open: p,
|
|
21
|
+
setOpen: y,
|
|
22
|
+
triggerRef: h,
|
|
23
|
+
panelRef: g
|
|
24
|
+
});
|
|
25
|
+
return /* @__PURE__ */ r(n, {
|
|
26
26
|
value: {
|
|
27
27
|
open: p,
|
|
28
|
-
setOpen:
|
|
29
|
-
triggerRef:
|
|
30
|
-
contentRef:
|
|
31
|
-
contentId:
|
|
32
|
-
focusRequestRef:
|
|
28
|
+
setOpen: y,
|
|
29
|
+
triggerRef: h,
|
|
30
|
+
contentRef: g,
|
|
31
|
+
contentId: _,
|
|
32
|
+
focusRequestRef: v,
|
|
33
|
+
floating: b
|
|
33
34
|
},
|
|
34
|
-
children:
|
|
35
|
-
ref: h,
|
|
35
|
+
children: r("div", {
|
|
36
36
|
className: e([c, f]),
|
|
37
37
|
children: d
|
|
38
38
|
})
|
|
@@ -1,55 +1,48 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { FloatingPanel as e } from "../../utils/floating.js";
|
|
3
|
+
import { getEnabledMenuItems as t, useMenuKeyboard as n, useRovingTabindex as r } from "../../utils/menuKeyboard.js";
|
|
4
|
+
import { useDropdownMenuContext as i } from "./DropdownMenuContext.js";
|
|
5
5
|
/* empty css */
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { useCallback as
|
|
6
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
7
|
+
import { useCallback as o, useEffect as s } from "react";
|
|
8
8
|
//#region src/lib/components/DropdownMenu/DropdownMenuContent.tsx
|
|
9
|
-
var
|
|
10
|
-
start: "
|
|
11
|
-
center: "
|
|
12
|
-
end: "
|
|
9
|
+
var c = "haze-DropdownMenuContent__content", l = {
|
|
10
|
+
start: "bottom",
|
|
11
|
+
center: "bottom-center",
|
|
12
|
+
end: "bottom-end"
|
|
13
13
|
};
|
|
14
|
-
function
|
|
15
|
-
let { open:
|
|
16
|
-
|
|
17
|
-
}, [
|
|
18
|
-
menuRef:
|
|
19
|
-
onClose:
|
|
14
|
+
function u({ children: u, align: d = "start", className: f }) {
|
|
15
|
+
let { open: p, setOpen: m, triggerRef: h, contentRef: g, contentId: _, focusRequestRef: v, floating: y } = i(), b = o(() => {
|
|
16
|
+
m(!1), h.current?.focus();
|
|
17
|
+
}, [m, h]), x = n({
|
|
18
|
+
menuRef: g,
|
|
19
|
+
onClose: b
|
|
20
20
|
});
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
_.current = null, r && (r === "first" ? t[0] : t[t.length - 1])?.focus();
|
|
31
|
-
let i = (t) => {
|
|
32
|
-
n(e).forEach((e) => {
|
|
33
|
-
e.tabIndex = e === t.target ? 0 : -1;
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
return e.addEventListener("focusin", i), () => e.removeEventListener("focusin", i);
|
|
21
|
+
return r({
|
|
22
|
+
menuRef: g,
|
|
23
|
+
active: p
|
|
24
|
+
}), s(() => {
|
|
25
|
+
if (!p || !y.shown) return;
|
|
26
|
+
let e = v.current;
|
|
27
|
+
if (v.current = null, !e) return;
|
|
28
|
+
let n = t(g.current);
|
|
29
|
+
(e === "first" ? n[0] : n[n.length - 1])?.focus();
|
|
37
30
|
}, [
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
31
|
+
p,
|
|
32
|
+
y.shown,
|
|
33
|
+
g,
|
|
34
|
+
v
|
|
35
|
+
]), p ? /* @__PURE__ */ a(e, {
|
|
36
|
+
ref: g,
|
|
37
|
+
behavior: y,
|
|
38
|
+
placement: l[d],
|
|
39
|
+
id: _,
|
|
44
40
|
role: "menu",
|
|
45
|
-
|
|
46
|
-
className:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
d
|
|
50
|
-
]),
|
|
51
|
-
children: l
|
|
41
|
+
visualClass: c,
|
|
42
|
+
className: f,
|
|
43
|
+
onKeyDown: x,
|
|
44
|
+
children: u
|
|
52
45
|
}) : null;
|
|
53
46
|
}
|
|
54
47
|
//#endregion
|
|
55
|
-
export {
|
|
48
|
+
export { u as default };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
|
|
2
2
|
import { classnames as e } from "../../utils/classnames.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { getEnabledMenuItems as t } from "../../utils/menuKeyboard.js";
|
|
4
|
+
import { useDropdownMenuContext as n } from "./DropdownMenuContext.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
import { jsx as r } from "react/jsx-runtime";
|
|
7
7
|
//#region src/lib/components/DropdownMenu/DropdownMenuTrigger.tsx
|
|
8
8
|
var i = "haze-DropdownMenuTrigger__trigger";
|
|
9
9
|
function a({ children: a, className: o }) {
|
|
10
|
-
let { open: s, setOpen: c, triggerRef: l, contentRef: u, contentId: d, focusRequestRef: f } =
|
|
10
|
+
let { open: s, setOpen: c, triggerRef: l, contentRef: u, contentId: d, focusRequestRef: f, floating: p } = n(), m = (e) => {
|
|
11
11
|
if (s) {
|
|
12
|
-
let
|
|
13
|
-
(e === "first" ?
|
|
12
|
+
let n = t(u.current);
|
|
13
|
+
(e === "first" ? n[0] : n[n.length - 1])?.focus();
|
|
14
14
|
} else f.current = e, c(!0);
|
|
15
15
|
};
|
|
16
16
|
return /* @__PURE__ */ r("button", {
|
|
@@ -19,9 +19,11 @@ function a({ children: a, className: o }) {
|
|
|
19
19
|
"aria-haspopup": "menu",
|
|
20
20
|
"aria-expanded": s,
|
|
21
21
|
"aria-controls": s ? d : void 0,
|
|
22
|
-
|
|
22
|
+
style: p.triggerStyle,
|
|
23
|
+
onPointerDown: p.onTriggerPointerDown,
|
|
24
|
+
onClick: p.onTriggerClick,
|
|
23
25
|
onKeyDown: (e) => {
|
|
24
|
-
e.key === "ArrowDown" ? (e.preventDefault(),
|
|
26
|
+
e.key === "ArrowDown" ? (e.preventDefault(), m("first")) : e.key === "ArrowUp" && (e.preventDefault(), m("last"));
|
|
25
27
|
},
|
|
26
28
|
className: e([i, o]),
|
|
27
29
|
children: a
|
|
@@ -1,35 +1,47 @@
|
|
|
1
1
|
|
|
2
2
|
import { classnames as e } from "../../utils/classnames.js";
|
|
3
|
+
import { FloatingPanel as t, useFloating as n } from "../../utils/floating.js";
|
|
4
|
+
import { useMenuKeyboard as r, useRovingTabindex as i } from "../../utils/menuKeyboard.js";
|
|
3
5
|
/* empty css */
|
|
4
|
-
import { jsx as
|
|
5
|
-
import { useControl as
|
|
6
|
-
import {
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
import { useControl as s } from "react-use-control";
|
|
8
|
+
import { useRef as c } from "react";
|
|
7
9
|
//#region src/lib/components/Menu/Menu.tsx
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
-
let [
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
10
|
+
var l = "haze-Menu__container", u = "haze-Menu__panel";
|
|
11
|
+
function d({ open: d, trigger: f, className: p, children: m }) {
|
|
12
|
+
let [h, g] = s(d, !1), _ = c(null), v = c(null), y = n({
|
|
13
|
+
open: h,
|
|
14
|
+
setOpen: g,
|
|
15
|
+
triggerRef: _,
|
|
16
|
+
panelRef: v
|
|
17
|
+
});
|
|
18
|
+
i({
|
|
19
|
+
menuRef: v,
|
|
20
|
+
active: h
|
|
21
|
+
});
|
|
22
|
+
let b = r({
|
|
23
|
+
menuRef: v,
|
|
24
|
+
onClose: () => g(!1)
|
|
25
|
+
});
|
|
26
|
+
return /* @__PURE__ */ o("div", {
|
|
27
|
+
className: e(l),
|
|
28
|
+
children: [/* @__PURE__ */ a("span", {
|
|
29
|
+
ref: _,
|
|
30
|
+
style: y.triggerStyle,
|
|
31
|
+
onPointerDown: y.onTriggerPointerDown,
|
|
32
|
+
onClick: y.onTriggerClick,
|
|
30
33
|
children: f
|
|
34
|
+
}), /* @__PURE__ */ a(t, {
|
|
35
|
+
ref: v,
|
|
36
|
+
behavior: y,
|
|
37
|
+
placement: "bottom",
|
|
38
|
+
role: "menu",
|
|
39
|
+
visualClass: u,
|
|
40
|
+
className: p,
|
|
41
|
+
onKeyDown: b,
|
|
42
|
+
children: m
|
|
31
43
|
})]
|
|
32
44
|
});
|
|
33
45
|
}
|
|
34
46
|
//#endregion
|
|
35
|
-
export {
|
|
47
|
+
export { d as default };
|
|
@@ -10,6 +10,7 @@ function o({ value: o, onChange: s, options: c, disabled: l, className: u }) {
|
|
|
10
10
|
return /* @__PURE__ */ t("div", {
|
|
11
11
|
className: e([i, u]),
|
|
12
12
|
children: t("select", {
|
|
13
|
+
"aria-label": "Model",
|
|
13
14
|
value: d,
|
|
14
15
|
onChange: (e) => {
|
|
15
16
|
f(e.target.value), s?.(e.target.value);
|
|
@@ -31,6 +31,7 @@ function o({ length: o = 6, value: s, onChange: c, className: l }) {
|
|
|
31
31
|
type: "text",
|
|
32
32
|
inputMode: "numeric",
|
|
33
33
|
maxLength: 1,
|
|
34
|
+
"aria-label": `Digit ${r + 1} of ${o}`,
|
|
34
35
|
value: s[r] ?? "",
|
|
35
36
|
onChange: (e) => d(r, e.target.value),
|
|
36
37
|
onKeyDown: (e) => f(r, e),
|
|
@@ -11,6 +11,7 @@ function s({ value: s, onChange: c, placeholder: l, disabled: u, className: d })
|
|
|
11
11
|
className: e([i, d]),
|
|
12
12
|
children: [/* @__PURE__ */ t("input", {
|
|
13
13
|
type: f ? "text" : "password",
|
|
14
|
+
"aria-label": "Password",
|
|
14
15
|
value: s,
|
|
15
16
|
onChange: (e) => c(e.target.value),
|
|
16
17
|
placeholder: l,
|
|
@@ -1,82 +1,39 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { FloatingPanel as e, useFloating as t } from "../../utils/floating.js";
|
|
3
3
|
/* empty css */
|
|
4
|
-
import { jsx as
|
|
5
|
-
import { useControl as
|
|
6
|
-
import {
|
|
4
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
|
+
import { useControl as i } from "react-use-control";
|
|
6
|
+
import { useId as a, useRef as o } from "react";
|
|
7
7
|
//#region src/lib/components/Popover/Popover.tsx
|
|
8
|
-
var s =
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
let n = t.getBoundingClientRect(), r = parseFloat(getComputedStyle(e).marginTop) || 0;
|
|
36
|
-
e.style.top = `${n.bottom + r}px`, e.style.left = `${n.left}px`;
|
|
37
|
-
};
|
|
38
|
-
return n(), window.addEventListener("scroll", n, !0), window.addEventListener("resize", n), () => {
|
|
39
|
-
window.removeEventListener("scroll", n, !0), window.removeEventListener("resize", n);
|
|
40
|
-
};
|
|
41
|
-
}, [
|
|
42
|
-
T,
|
|
43
|
-
E,
|
|
44
|
-
x
|
|
45
|
-
]), /* @__PURE__ */ n("span", {
|
|
46
|
-
className: u,
|
|
47
|
-
children: [/* @__PURE__ */ t("span", {
|
|
48
|
-
ref: D,
|
|
49
|
-
"aria-expanded": x,
|
|
50
|
-
"aria-controls": C,
|
|
51
|
-
style: E ? { anchorName: w } : void 0,
|
|
52
|
-
onPointerDown: () => {
|
|
53
|
-
x && (A.current = performance.now());
|
|
54
|
-
},
|
|
55
|
-
onClick: () => {
|
|
56
|
-
if (performance.now() - j.current < s) {
|
|
57
|
-
j.current = 0;
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
S((e) => !e);
|
|
61
|
-
},
|
|
62
|
-
children: b
|
|
63
|
-
}), /* @__PURE__ */ t("div", {
|
|
64
|
-
id: C,
|
|
65
|
-
ref: O,
|
|
66
|
-
popover: T ? "auto" : void 0,
|
|
67
|
-
style: T && E ? { "--haze-popover-anchor": w } : void 0,
|
|
68
|
-
className: e([
|
|
69
|
-
d,
|
|
70
|
-
T && m,
|
|
71
|
-
T && E && h,
|
|
72
|
-
T && !E && g,
|
|
73
|
-
!T && f,
|
|
74
|
-
!T && !x && p,
|
|
75
|
-
y
|
|
76
|
-
]),
|
|
77
|
-
children: _
|
|
8
|
+
var s = "haze-Popover__container", c = "haze-Popover__panelVisuals";
|
|
9
|
+
function l({ content: l, open: u, className: d, children: f }) {
|
|
10
|
+
let [p, m] = i(u, !1), h = a(), g = o(null), _ = o(null), v = t({
|
|
11
|
+
open: p,
|
|
12
|
+
setOpen: m,
|
|
13
|
+
triggerRef: g,
|
|
14
|
+
panelRef: _
|
|
15
|
+
});
|
|
16
|
+
return /* @__PURE__ */ r("span", {
|
|
17
|
+
className: s,
|
|
18
|
+
children: [/* @__PURE__ */ n("span", {
|
|
19
|
+
ref: g,
|
|
20
|
+
style: v.triggerStyle,
|
|
21
|
+
role: "button",
|
|
22
|
+
"aria-expanded": p,
|
|
23
|
+
"aria-controls": h,
|
|
24
|
+
onPointerDown: v.onTriggerPointerDown,
|
|
25
|
+
onClick: v.onTriggerClick,
|
|
26
|
+
children: f
|
|
27
|
+
}), /* @__PURE__ */ n(e, {
|
|
28
|
+
ref: _,
|
|
29
|
+
behavior: v,
|
|
30
|
+
placement: "bottom-span",
|
|
31
|
+
id: h,
|
|
32
|
+
visualClass: c,
|
|
33
|
+
className: d,
|
|
34
|
+
children: l
|
|
78
35
|
})]
|
|
79
36
|
});
|
|
80
37
|
}
|
|
81
38
|
//#endregion
|
|
82
|
-
export {
|
|
39
|
+
export { l as default };
|
|
@@ -36,6 +36,7 @@ function m({ value: m = 0, variant: h = "bar", size: g = "md", color: _ = "prima
|
|
|
36
36
|
let r = p[g], i = f[g], a = 2 * Math.PI * r, o = a - y / 100 * a;
|
|
37
37
|
return /* @__PURE__ */ t("div", {
|
|
38
38
|
role: "progressbar",
|
|
39
|
+
"aria-label": "Progress",
|
|
39
40
|
"aria-valuemin": 0,
|
|
40
41
|
"aria-valuemax": 100,
|
|
41
42
|
"aria-valuenow": y,
|
|
@@ -66,6 +67,7 @@ function m({ value: m = 0, variant: h = "bar", size: g = "md", color: _ = "prima
|
|
|
66
67
|
}
|
|
67
68
|
return /* @__PURE__ */ t("div", {
|
|
68
69
|
role: "progressbar",
|
|
70
|
+
"aria-label": "Progress",
|
|
69
71
|
"aria-valuemin": 0,
|
|
70
72
|
"aria-valuemax": 100,
|
|
71
73
|
"aria-valuenow": y,
|
|
@@ -1,33 +1,59 @@
|
|
|
1
1
|
|
|
2
2
|
import { classnames as e } from "../../utils/classnames.js";
|
|
3
|
+
import { floatingPlacementClasses as t, useFloating as n, useFloatingPosition as r } from "../../utils/floating.js";
|
|
3
4
|
/* empty css */
|
|
4
|
-
import { jsx as
|
|
5
|
-
import {
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import { useControl as o } from "react-use-control";
|
|
7
|
+
import { useEffect as s, useId as c, useRef as l } from "react";
|
|
6
8
|
//#region src/lib/components/Tooltip/Tooltip.tsx
|
|
7
|
-
var
|
|
8
|
-
top: "
|
|
9
|
-
bottom: "
|
|
10
|
-
left: "
|
|
11
|
-
right: "
|
|
12
|
-
}
|
|
13
|
-
function
|
|
14
|
-
let f =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
9
|
+
var u = "haze-Tooltip__wrapper", d = "haze-Tooltip__bubble", f = {
|
|
10
|
+
top: "top",
|
|
11
|
+
bottom: "bottom-center",
|
|
12
|
+
left: "left",
|
|
13
|
+
right: "right"
|
|
14
|
+
};
|
|
15
|
+
function p({ content: p, position: m = "top", delay: h = 150, open: g, className: _, children: v }) {
|
|
16
|
+
let [y, b] = o(g, !1), x = c(), S = l(null), C = l(null), w = f[m], T = n({
|
|
17
|
+
open: y,
|
|
18
|
+
setOpen: b,
|
|
19
|
+
triggerRef: S,
|
|
20
|
+
panelRef: C
|
|
21
|
+
});
|
|
22
|
+
r({
|
|
23
|
+
behavior: T,
|
|
24
|
+
placement: w
|
|
25
|
+
});
|
|
26
|
+
let E = l(0);
|
|
27
|
+
s(() => () => window.clearTimeout(E.current), []);
|
|
28
|
+
let D = () => {
|
|
29
|
+
window.clearTimeout(E.current), E.current = window.setTimeout(() => b(!0), h);
|
|
30
|
+
}, O = () => {
|
|
31
|
+
window.clearTimeout(E.current), b(!1);
|
|
32
|
+
};
|
|
33
|
+
return /* @__PURE__ */ a("span", {
|
|
34
|
+
className: e([u, _]),
|
|
35
|
+
children: [/* @__PURE__ */ i("span", {
|
|
36
|
+
ref: S,
|
|
37
|
+
style: T.triggerStyle,
|
|
38
|
+
"aria-describedby": x,
|
|
39
|
+
onMouseEnter: D,
|
|
40
|
+
onMouseLeave: O,
|
|
41
|
+
onFocus: D,
|
|
42
|
+
onBlur: O,
|
|
43
|
+
children: v
|
|
44
|
+
}), /* @__PURE__ */ i("span", {
|
|
45
|
+
id: x,
|
|
46
|
+
ref: C,
|
|
26
47
|
role: "tooltip",
|
|
27
|
-
|
|
28
|
-
|
|
48
|
+
...T.panelAttrs,
|
|
49
|
+
className: e([
|
|
50
|
+
d,
|
|
51
|
+
...T.panelClasses,
|
|
52
|
+
...t(T, w)
|
|
53
|
+
]),
|
|
54
|
+
children: p
|
|
29
55
|
})]
|
|
30
56
|
});
|
|
31
57
|
}
|
|
32
58
|
//#endregion
|
|
33
|
-
export {
|
|
59
|
+
export { p as default };
|