@ledgerhq/lumen-ui-react 0.1.35 → 0.1.37
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.js +108 -109
- package/dist/lib/Components/AmountDisplay/AmountDisplay.d.ts +1 -1
- package/dist/lib/Components/AmountDisplay/AmountDisplay.d.ts.map +1 -1
- package/dist/lib/Components/AmountDisplay/AmountDisplay.js +117 -78
- package/dist/lib/Components/AmountDisplay/index.d.ts +1 -1
- package/dist/lib/Components/AmountDisplay/index.d.ts.map +1 -1
- package/dist/lib/Components/AmountDisplay/types.d.ts +16 -3
- package/dist/lib/Components/AmountDisplay/types.d.ts.map +1 -1
- package/dist/lib/Components/AmountInput/AmountInput.d.ts +1 -1
- package/dist/lib/Components/AmountInput/AmountInput.d.ts.map +1 -1
- package/dist/lib/Components/AmountInput/AmountInput.js +127 -77
- package/dist/lib/Components/AmountInput/types.d.ts +12 -0
- package/dist/lib/Components/AmountInput/types.d.ts.map +1 -1
- package/dist/lib/Components/Avatar/Avatar.d.ts +1 -1
- package/dist/lib/Components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/lib/Components/Avatar/Avatar.js +47 -60
- package/dist/lib/Components/Button/BaseButton.d.ts +2 -2
- package/dist/lib/Components/Button/Button.js +10 -10
- package/dist/lib/Components/Card/Card.js +12 -12
- package/dist/lib/Components/DataTable/DataTable.js +2 -2
- package/dist/lib/Components/Divider/Divider.js +4 -4
- package/dist/lib/Components/DotCount/DotCount.js +4 -4
- package/dist/lib/Components/DotIcon/DotIcon.d.ts +3 -2
- package/dist/lib/Components/DotIcon/DotIcon.d.ts.map +1 -1
- package/dist/lib/Components/DotIcon/DotIcon.js +55 -40
- package/dist/lib/Components/DotIcon/types.d.ts +7 -1
- package/dist/lib/Components/DotIcon/types.d.ts.map +1 -1
- package/dist/lib/Components/DotIndicator/DotIndicator.js +14 -14
- package/dist/lib/Components/DotIndicator/types.d.ts +2 -2
- package/dist/lib/Components/DotSymbol/DotSymbol.d.ts +1 -1
- package/dist/lib/Components/DotSymbol/DotSymbol.d.ts.map +1 -1
- package/dist/lib/Components/DotSymbol/DotSymbol.js +50 -35
- package/dist/lib/Components/DotSymbol/types.d.ts +7 -1
- package/dist/lib/Components/DotSymbol/types.d.ts.map +1 -1
- package/dist/lib/Components/Icon/Icon.js +4 -4
- package/dist/lib/Components/Icon/createIcon.js +4 -4
- package/dist/lib/Components/InteractiveIcon/InteractiveIcon.js +4 -4
- package/dist/lib/Components/Link/Link.js +6 -6
- package/dist/lib/Components/ListItem/ListItem.js +3 -3
- package/dist/lib/Components/MediaButton/MediaButton.d.ts +3 -3
- package/dist/lib/Components/MediaButton/MediaButton.d.ts.map +1 -1
- package/dist/lib/Components/MediaButton/MediaButton.js +44 -42
- package/dist/lib/Components/MediaButton/types.d.ts +5 -5
- package/dist/lib/Components/MediaButton/types.d.ts.map +1 -1
- package/dist/lib/Components/MediaImage/MediaImage.d.ts +1 -1
- package/dist/lib/Components/MediaImage/MediaImage.d.ts.map +1 -1
- package/dist/lib/Components/MediaImage/MediaImage.js +45 -32
- package/dist/lib/Components/MediaImage/types.d.ts +7 -1
- package/dist/lib/Components/MediaImage/types.d.ts.map +1 -1
- package/dist/lib/Components/Menu/Menu.d.ts +11 -16
- package/dist/lib/Components/Menu/Menu.d.ts.map +1 -1
- package/dist/lib/Components/Menu/Menu.js +186 -125
- package/dist/lib/Components/Menu/types.d.ts +50 -145
- package/dist/lib/Components/Menu/types.d.ts.map +1 -1
- package/dist/lib/Components/NavBar/CoinCapsule.d.ts +2 -2
- package/dist/lib/Components/NavBar/CoinCapsule.d.ts.map +1 -1
- package/dist/lib/Components/NavBar/CoinCapsule.js +1 -1
- package/dist/lib/Components/NavBar/NavBar.d.ts +4 -4
- package/dist/lib/Components/NavBar/NavBar.d.ts.map +1 -1
- package/dist/lib/Components/NavBar/NavBar.js +34 -26
- package/dist/lib/Components/NavBar/types.d.ts +2 -2
- package/dist/lib/Components/NavBar/types.d.ts.map +1 -1
- package/dist/lib/Components/Popover/Popover.d.ts +2 -2
- package/dist/lib/Components/Popover/Popover.js +6 -6
- package/dist/lib/Components/Popover/types.d.ts +6 -3
- package/dist/lib/Components/Popover/types.d.ts.map +1 -1
- package/dist/lib/Components/SideBar/SideBar.js +9 -9
- package/dist/lib/Components/Skeleton/Skeleton.js +4 -4
- package/dist/lib/Components/Table/Table.js +1 -1
- package/dist/lib/Components/Table/utils/useThrottledScrollBottom.js +3 -3
- package/dist/lib/Symbols/Icons/Lightbulb.js +3 -3
- package/dist/libs/utils-shared/dist/index.js +107 -107
- package/dist/node_modules/@base-ui/react/esm/composite/item/CompositeItem.js +30 -0
- package/dist/node_modules/@base-ui/react/esm/composite/item/useCompositeItem.js +34 -0
- package/dist/node_modules/@base-ui/react/esm/context-menu/root/ContextMenuRootContext.js +14 -0
- package/dist/node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingFocusManager.js +10 -10
- package/dist/node_modules/@base-ui/react/esm/floating-ui-react/hooks/useFocus.js +97 -0
- package/dist/node_modules/@base-ui/react/esm/floating-ui-react/hooks/useHoverFloatingInteraction.js +10 -10
- package/dist/node_modules/@base-ui/react/esm/floating-ui-react/hooks/useHoverReferenceInteraction.js +2 -2
- package/dist/node_modules/@base-ui/react/esm/floating-ui-react/utils/element.js +31 -20
- package/dist/node_modules/@base-ui/react/esm/menu/checkbox-item/MenuCheckboxItem.js +78 -0
- package/dist/node_modules/@base-ui/react/esm/menu/checkbox-item/MenuCheckboxItemContext.js +14 -0
- package/dist/node_modules/@base-ui/react/esm/menu/checkbox-item/MenuCheckboxItemDataAttributes.js +6 -0
- package/dist/node_modules/@base-ui/react/esm/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.js +44 -0
- package/dist/node_modules/@base-ui/react/esm/menu/group/MenuGroup.js +28 -0
- package/dist/node_modules/@base-ui/react/esm/menu/group/MenuGroupContext.js +14 -0
- package/dist/node_modules/@base-ui/react/esm/menu/group-label/MenuGroupLabel.js +29 -0
- package/dist/node_modules/@base-ui/react/esm/menu/item/MenuItem.js +47 -0
- package/dist/node_modules/@base-ui/react/esm/menu/item/useMenuItem.js +50 -0
- package/dist/node_modules/@base-ui/react/esm/menu/item/useMenuItemCommonProps.js +49 -0
- package/dist/node_modules/@base-ui/react/esm/menu/popup/MenuPopup.js +89 -0
- package/dist/node_modules/@base-ui/react/esm/menu/portal/MenuPortal.js +24 -0
- package/dist/node_modules/@base-ui/react/esm/menu/portal/MenuPortalContext.js +14 -0
- package/dist/node_modules/@base-ui/react/esm/menu/positioner/MenuPositioner.js +174 -0
- package/dist/node_modules/@base-ui/react/esm/menu/positioner/MenuPositionerContext.js +14 -0
- package/dist/node_modules/@base-ui/react/esm/menu/radio-group/MenuRadioGroup.js +45 -0
- package/dist/node_modules/@base-ui/react/esm/menu/radio-group/MenuRadioGroupContext.js +14 -0
- package/dist/node_modules/@base-ui/react/esm/menu/radio-item/MenuRadioItem.js +75 -0
- package/dist/node_modules/@base-ui/react/esm/menu/radio-item/MenuRadioItemContext.js +14 -0
- package/dist/node_modules/@base-ui/react/esm/menu/radio-item-indicator/MenuRadioItemIndicator.js +44 -0
- package/dist/node_modules/@base-ui/react/esm/menu/root/MenuRoot.js +271 -0
- package/dist/node_modules/@base-ui/react/esm/menu/root/MenuRootContext.js +14 -0
- package/dist/node_modules/@base-ui/react/esm/menu/store/MenuStore.js +109 -0
- package/dist/node_modules/@base-ui/react/esm/menu/submenu-root/MenuSubmenuRoot.js +21 -0
- package/dist/node_modules/@base-ui/react/esm/menu/submenu-root/MenuSubmenuRootContext.js +10 -0
- package/dist/node_modules/@base-ui/react/esm/menu/submenu-trigger/MenuSubmenuTrigger.js +101 -0
- package/dist/node_modules/@base-ui/react/esm/menu/trigger/MenuTrigger.js +207 -0
- package/dist/node_modules/@base-ui/react/esm/menu/utils/findRootOwnerId.js +10 -0
- package/dist/node_modules/@base-ui/react/esm/menu/utils/stateAttributesMapping.js +15 -0
- package/dist/node_modules/@base-ui/react/esm/menubar/MenubarContext.js +10 -0
- package/dist/node_modules/@base-ui/react/esm/popover/root/PopoverRoot.js +11 -11
- package/dist/node_modules/@base-ui/react/esm/popover/store/PopoverStore.js +7 -7
- package/dist/node_modules/@base-ui/react/esm/popover/trigger/PopoverTrigger.js +11 -11
- package/dist/node_modules/@base-ui/react/esm/utils/constants.js +11 -10
- package/dist/node_modules/@base-ui/react/esm/utils/reason-parts.js +11 -8
- package/dist/node_modules/@base-ui/react/esm/utils/useMixedToggleClickHandler.js +25 -0
- package/dist/node_modules/@base-ui/utils/esm/detectBrowser.js +7 -8
- package/dist/node_modules/@base-ui/utils/esm/fastHooks.js +43 -0
- package/dist/node_modules/@base-ui/utils/esm/store/useStore.js +54 -13
- package/dist/package.json +4 -5
- package/package.json +4 -5
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsx as e, jsxs as C, Fragment as
|
|
2
|
-
import { createSafeContext as
|
|
1
|
+
import { jsx as e, jsxs as C, Fragment as P } from "react/jsx-runtime";
|
|
2
|
+
import { createSafeContext as R, cn as m, useDisabledContext as V } from "../../../libs/utils-shared/dist/index.js";
|
|
3
3
|
import { cva as h } from "class-variance-authority";
|
|
4
4
|
import { useCallback as B } from "react";
|
|
5
5
|
import { Tooltip as S, TooltipTrigger as N, TooltipContent as T } from "../Tooltip/Tooltip.js";
|
|
6
6
|
import { useCommonTranslation as A } from "../../../i18n/useCommonTranslation.js";
|
|
7
7
|
import { useControllableState as x } from "../../../utils/useControllableState/useControllableState.js";
|
|
8
|
-
import { ExpandRight as
|
|
8
|
+
import { ExpandRight as q } from "../../Symbols/Icons/ExpandRight.js";
|
|
9
9
|
import { ExpandLeft as E } from "../../Symbols/Icons/ExpandLeft.js";
|
|
10
|
-
const [O, w] =
|
|
10
|
+
const [O, w] = R("SideBar"), f = {
|
|
11
11
|
root: h(
|
|
12
12
|
[
|
|
13
13
|
"flex h-full flex-col justify-between gap-16 overflow-y-auto rounded-xl bg-surface-transparent p-16",
|
|
@@ -125,18 +125,18 @@ const [O, w] = V("SideBar"), f = {
|
|
|
125
125
|
onClick: i,
|
|
126
126
|
...p
|
|
127
127
|
}) => {
|
|
128
|
-
const l =
|
|
128
|
+
const l = V({
|
|
129
129
|
consumerName: "SideBarItem",
|
|
130
130
|
mergeWith: { disabled: c }
|
|
131
131
|
}), { collapsed: b, active: g, onActiveChange: v } = w({
|
|
132
132
|
consumerName: "SideBarItem",
|
|
133
133
|
contextRequired: !0
|
|
134
134
|
}), u = g === t, y = u ? a : s, I = r ?? o, L = B(
|
|
135
|
-
(
|
|
136
|
-
l || (i?.(
|
|
135
|
+
(z) => {
|
|
136
|
+
l || (i?.(z), v?.(t));
|
|
137
137
|
},
|
|
138
138
|
[l, i, v, t]
|
|
139
|
-
), j = /* @__PURE__ */ C(
|
|
139
|
+
), j = /* @__PURE__ */ C(P, { children: [
|
|
140
140
|
/* @__PURE__ */ e(y, { size: 20 }),
|
|
141
141
|
o != null && /* @__PURE__ */ e("span", { className: "translate-x-8 truncate", children: o })
|
|
142
142
|
] }), k = /* @__PURE__ */ e(
|
|
@@ -169,7 +169,7 @@ const [O, w] = V("SideBar"), f = {
|
|
|
169
169
|
contextRequired: !0
|
|
170
170
|
}), c = B(() => {
|
|
171
171
|
r(!o);
|
|
172
|
-
}, [o, r]), d = o ?
|
|
172
|
+
}, [o, r]), d = o ? q : E, i = /* @__PURE__ */ e(
|
|
173
173
|
"button",
|
|
174
174
|
{
|
|
175
175
|
type: "button",
|
|
@@ -63,14 +63,14 @@ const l = ({ className: a, ref: s, ...t }) => /* @__PURE__ */ e(
|
|
|
63
63
|
] })
|
|
64
64
|
]
|
|
65
65
|
}
|
|
66
|
-
),
|
|
66
|
+
), i = {
|
|
67
67
|
"list-item": o,
|
|
68
68
|
tile: m,
|
|
69
69
|
table: u
|
|
70
70
|
}, N = ({ className: a, component: s, ref: t, ...d }) => {
|
|
71
|
-
if (s &&
|
|
72
|
-
const
|
|
73
|
-
return /* @__PURE__ */ e(
|
|
71
|
+
if (s && i[s]) {
|
|
72
|
+
const r = i[s];
|
|
73
|
+
return /* @__PURE__ */ e(r, { ...d, ref: t, className: a });
|
|
74
74
|
}
|
|
75
75
|
return /* @__PURE__ */ e(
|
|
76
76
|
l,
|
|
@@ -192,7 +192,7 @@ const [H, m] = N("Table"), I = o(
|
|
|
192
192
|
className: A({ align: e, className: a }),
|
|
193
193
|
...i,
|
|
194
194
|
children: [
|
|
195
|
-
/* @__PURE__ */ r("div", { className: "shrink-0", children: t }),
|
|
195
|
+
t && /* @__PURE__ */ r("div", { className: "shrink-0", children: t }),
|
|
196
196
|
/* @__PURE__ */ u("div", { className: "flex min-w-0 flex-col gap-4", children: [
|
|
197
197
|
/* @__PURE__ */ r("div", { className: "shrink-0 body-2 text-base", children: n }),
|
|
198
198
|
/* @__PURE__ */ r("div", { className: "truncate body-3 text-muted", children: l })
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { throttle as h } from "../../../../libs/utils-shared/dist/index.js";
|
|
2
2
|
import { useMemo as L, useRef as s, useEffect as _ } from "react";
|
|
3
|
-
import { TABLE_SCROLL_BOTTOM_THRESHOLD_IN_ROW as
|
|
3
|
+
import { TABLE_SCROLL_BOTTOM_THRESHOLD_IN_ROW as R, TABLE_CELL_HEIGHT as a } from "../constants.js";
|
|
4
4
|
const m = 150, E = ({
|
|
5
5
|
element: t,
|
|
6
6
|
threshold: r = 10
|
|
@@ -10,10 +10,10 @@ const m = 150, E = ({
|
|
|
10
10
|
}, p = ({
|
|
11
11
|
onScrollBottom: t,
|
|
12
12
|
loading: r = !1,
|
|
13
|
-
thresholdInRow: c =
|
|
13
|
+
thresholdInRow: c = R
|
|
14
14
|
}) => {
|
|
15
15
|
const n = L(
|
|
16
|
-
() => c *
|
|
16
|
+
() => c * a,
|
|
17
17
|
[c]
|
|
18
18
|
), e = s(t), u = s(r);
|
|
19
19
|
e.current = t, u.current = r;
|
|
@@ -9,15 +9,15 @@ const i = r(
|
|
|
9
9
|
width: "1em",
|
|
10
10
|
height: "1em",
|
|
11
11
|
fill: "currentColor",
|
|
12
|
-
viewBox: "0 0
|
|
12
|
+
viewBox: "0 0 16 16",
|
|
13
13
|
children: /* @__PURE__ */ o(
|
|
14
14
|
"path",
|
|
15
15
|
{
|
|
16
16
|
stroke: "currentColor",
|
|
17
17
|
strokeLinecap: "round",
|
|
18
18
|
strokeLinejoin: "round",
|
|
19
|
-
strokeWidth: 1.
|
|
20
|
-
d: "
|
|
19
|
+
strokeWidth: 1.3,
|
|
20
|
+
d: "M10 10.127H6m7.333-6.794.794-.793M2.667 10l-.794.793m1.46-8.126-.793-.794M13.333 10l.794.793M14 6.667h1.127m-14.254 0H2M6 12h3.913m-4.22-2.07a3.99 3.99 0 0 1-1.646-3.906c.266-1.738 1.713-3.125 3.466-3.33a3.997 3.997 0 0 1 4.484 3.967c0 1.346-.674 2.54-1.7 3.265a.67.67 0 0 0-.307.553v1.84c0 .92-.747 1.667-1.667 1.667h-.666a1.663 1.663 0 0 1-1.667-1.667v-1.842a.71.71 0 0 0-.307-.566z"
|
|
21
21
|
}
|
|
22
22
|
)
|
|
23
23
|
}
|
|
@@ -2,58 +2,58 @@ import { jsx as W } from "react/jsx-runtime";
|
|
|
2
2
|
import { useMemo as M, createContext as L, useRef as R, useContext as E } from "react";
|
|
3
3
|
import { clsx as q } from "clsx";
|
|
4
4
|
import { twMerge as I } from "tailwind-merge";
|
|
5
|
-
function
|
|
5
|
+
function X(e) {
|
|
6
6
|
return e ? e.split(/[-_ ]+/).map((t) => t.charAt(0).toUpperCase() + t.slice(1).toLowerCase()).join("") : "";
|
|
7
7
|
}
|
|
8
|
-
const N =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
);
|
|
8
|
+
const N = {
|
|
9
|
+
md: { max: 48, min: 17, scale: 2, startAt: 0 },
|
|
10
|
+
sm: { max: 28, min: 12, scale: 2, startAt: 6 }
|
|
11
|
+
};
|
|
12
|
+
function Z(e, t = "md") {
|
|
13
|
+
const { max: l, min: s, scale: a, startAt: i } = N[t], r = e.replace(/\D/g, "").length;
|
|
14
|
+
return Math.max(s, l - Math.max(0, r - i) * a);
|
|
15
15
|
}
|
|
16
16
|
function w(e, t = !0) {
|
|
17
17
|
if (!e) return "";
|
|
18
|
-
const l = e.includes("."), [
|
|
19
|
-
return l && t ? a ? `${
|
|
18
|
+
const l = e.includes("."), [s, a] = e.split("."), i = s.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
|
|
19
|
+
return l && t ? a ? `${i}.${a}` : `${i}.` : i;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function H(e, t = {}) {
|
|
22
22
|
const {
|
|
23
23
|
allowDecimals: l = !0,
|
|
24
|
-
thousandsSeparator:
|
|
24
|
+
thousandsSeparator: s = !0,
|
|
25
25
|
maxIntegerLength: a = 9,
|
|
26
|
-
maxDecimalLength:
|
|
26
|
+
maxDecimalLength: i = 9
|
|
27
27
|
} = t, r = e.replace(",", ".").replace(/[^\d.]/g, "");
|
|
28
28
|
let n = r;
|
|
29
29
|
if (n = n.replace(/^0+(?=\d)/, ""), !l)
|
|
30
|
-
return n = n.replace(/\D/g, ""), a > 0 && n.length > a && (n = n.slice(0, a)),
|
|
30
|
+
return n = n.replace(/\D/g, ""), a > 0 && n.length > a && (n = n.slice(0, a)), s ? w(n) : n;
|
|
31
31
|
n === "." && (n = "0.");
|
|
32
32
|
const c = n.indexOf(".");
|
|
33
33
|
if (c !== -1) {
|
|
34
|
-
let
|
|
35
|
-
a > 0 &&
|
|
34
|
+
let u = n.slice(0, c), d = n.slice(c + 1).replace(/\./g, "");
|
|
35
|
+
a > 0 && u.length > a && (u = u.slice(0, a)), d = d.slice(0, i), u === "" && (u = "0");
|
|
36
36
|
const h = r.endsWith(".") || n.endsWith(".");
|
|
37
|
-
n = d.length > 0 ? `${
|
|
37
|
+
n = d.length > 0 ? `${u}.${d}` : h ? `${u}.` : u;
|
|
38
38
|
} else
|
|
39
39
|
a > 0 && n.length > a && (n = n.slice(0, a));
|
|
40
|
-
return
|
|
40
|
+
return s ? w(n) : n;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function F(e, t) {
|
|
43
43
|
if (Object.is(e, t)) return !0;
|
|
44
|
-
const l = e,
|
|
45
|
-
return a.length !==
|
|
46
|
-
(r) => Object.prototype.hasOwnProperty.call(
|
|
44
|
+
const l = e, s = t, a = Object.keys(l), i = Object.keys(s);
|
|
45
|
+
return a.length !== i.length ? !1 : a.every(
|
|
46
|
+
(r) => Object.prototype.hasOwnProperty.call(s, r) && Object.is(l[r], s[r])
|
|
47
47
|
);
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
const l = L(t),
|
|
49
|
+
function z(e, t) {
|
|
50
|
+
const l = L(t), s = ({ children: i, value: r }) => {
|
|
51
51
|
const n = R(r);
|
|
52
|
-
return
|
|
52
|
+
return F(n.current, r) || (n.current = r), /* @__PURE__ */ W(l.Provider, { value: n.current, children: i });
|
|
53
53
|
};
|
|
54
|
-
|
|
54
|
+
s.displayName = e + "Provider";
|
|
55
55
|
function a({
|
|
56
|
-
consumerName:
|
|
56
|
+
consumerName: i,
|
|
57
57
|
contextRequired: r
|
|
58
58
|
}) {
|
|
59
59
|
const n = E(l);
|
|
@@ -61,24 +61,24 @@ function K(e, t) {
|
|
|
61
61
|
return n;
|
|
62
62
|
if (r)
|
|
63
63
|
throw new Error(
|
|
64
|
-
`${
|
|
64
|
+
`${i} must be used within ${e}`
|
|
65
65
|
);
|
|
66
66
|
return t || {};
|
|
67
67
|
}
|
|
68
|
-
return [
|
|
68
|
+
return [s, a];
|
|
69
69
|
}
|
|
70
|
-
const [
|
|
70
|
+
const [V, B] = z("Disabled", { disabled: !1 }), Y = ({
|
|
71
71
|
consumerName: e,
|
|
72
72
|
contextRequired: t,
|
|
73
73
|
mergeWith: l
|
|
74
74
|
}) => {
|
|
75
|
-
const
|
|
75
|
+
const s = B({
|
|
76
76
|
consumerName: e,
|
|
77
77
|
contextRequired: t ?? !1
|
|
78
78
|
});
|
|
79
|
-
return !!(l?.disabled ||
|
|
79
|
+
return !!(l?.disabled || s.disabled);
|
|
80
80
|
};
|
|
81
|
-
function
|
|
81
|
+
function ee(...e) {
|
|
82
82
|
return I(q(e));
|
|
83
83
|
}
|
|
84
84
|
function T(e, t) {
|
|
@@ -86,48 +86,48 @@ function T(e, t) {
|
|
|
86
86
|
return e(t);
|
|
87
87
|
typeof e == "object" && e !== null && "current" in e && (e.current = t);
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function K(...e) {
|
|
90
90
|
const t = /* @__PURE__ */ new Map();
|
|
91
91
|
return (l) => {
|
|
92
92
|
if (l === null) {
|
|
93
|
-
e.forEach((
|
|
94
|
-
const a = t.get(
|
|
95
|
-
typeof a == "function" && a(), T(
|
|
93
|
+
e.forEach((s) => {
|
|
94
|
+
const a = t.get(s);
|
|
95
|
+
typeof a == "function" && a(), T(s, null);
|
|
96
96
|
}), t.clear();
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
|
-
e.forEach((
|
|
100
|
-
const a = T(
|
|
101
|
-
typeof a == "function" && t.set(
|
|
99
|
+
e.forEach((s) => {
|
|
100
|
+
const a = T(s, l);
|
|
101
|
+
typeof a == "function" && t.set(s, a);
|
|
102
102
|
});
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
|
-
function
|
|
106
|
-
return M(() =>
|
|
105
|
+
function te(...e) {
|
|
106
|
+
return M(() => K(...e), e);
|
|
107
107
|
}
|
|
108
|
-
const
|
|
108
|
+
const ne = ({
|
|
109
109
|
currentStep: e,
|
|
110
110
|
totalSteps: t,
|
|
111
111
|
size: l,
|
|
112
|
-
label:
|
|
112
|
+
label: s,
|
|
113
113
|
strokeWidth: a = 4,
|
|
114
|
-
arcPercentage:
|
|
114
|
+
arcPercentage: i = 0.75
|
|
115
115
|
}) => {
|
|
116
|
-
const r = Math.min(Math.max(e, 0), t), n =
|
|
116
|
+
const r = Math.min(Math.max(e, 0), t), n = s ?? `${r}/${t}`, c = t <= 0 ? 0 : r / t, u = (l - a) / 2, d = l / 2, h = l / 2, m = 2 * Math.PI * u, p = m * i, b = p * (1 - c), g = r <= 0, D = `${p} ${m}`, P = g ? p - 2 : b;
|
|
117
117
|
return {
|
|
118
118
|
displayLabel: n,
|
|
119
119
|
progress: c,
|
|
120
|
-
r:
|
|
120
|
+
r: u,
|
|
121
121
|
cx: d,
|
|
122
122
|
cy: h,
|
|
123
|
-
circumference:
|
|
123
|
+
circumference: m,
|
|
124
124
|
trackArcLength: p,
|
|
125
|
-
trackDashArray: `${p} ${
|
|
125
|
+
trackDashArray: `${p} ${m}`,
|
|
126
126
|
progressDashArray: D,
|
|
127
127
|
progressDashOffset: P,
|
|
128
128
|
showMinimalDot: g
|
|
129
129
|
};
|
|
130
|
-
},
|
|
130
|
+
}, re = (e) => M(
|
|
131
131
|
() => ({
|
|
132
132
|
integerPart: Array.from(e.integerPart, (t) => ({
|
|
133
133
|
value: t,
|
|
@@ -139,57 +139,57 @@ const le = ({
|
|
|
139
139
|
})) : []
|
|
140
140
|
}),
|
|
141
141
|
[e.integerPart, e.decimalPart]
|
|
142
|
-
),
|
|
142
|
+
), le = (e, t, l) => {
|
|
143
143
|
if (t) return l;
|
|
144
|
-
const
|
|
144
|
+
const s = e.decimalPart ? `${e.decimalSeparator}${e.decimalPart}` : "", a = `${e.integerPart}${s}`;
|
|
145
145
|
return e.currencyPosition === "end" ? `${a} ${e.currencyText}` : `${e.currencyText} ${a}`;
|
|
146
146
|
};
|
|
147
|
-
function
|
|
148
|
-
const { leading:
|
|
149
|
-
let r = null, n = null, c = null,
|
|
150
|
-
const p =
|
|
151
|
-
|
|
152
|
-
const
|
|
153
|
-
return d = null, h = null,
|
|
154
|
-
}, D = (
|
|
155
|
-
const
|
|
156
|
-
return t -
|
|
157
|
-
}, P = (
|
|
158
|
-
const
|
|
159
|
-
return c === null ||
|
|
160
|
-
}, v = (
|
|
161
|
-
const
|
|
162
|
-
if (P(
|
|
163
|
-
v(
|
|
147
|
+
function _(e, t, l = {}) {
|
|
148
|
+
const { leading: s = !1, trailing: a = !0, maxWait: i } = l;
|
|
149
|
+
let r = null, n = null, c = null, u = 0, d = null, h = null, m;
|
|
150
|
+
const p = i !== void 0, b = p ? Math.max(i, t) : 0, g = (o) => {
|
|
151
|
+
u = o;
|
|
152
|
+
const f = d, x = h;
|
|
153
|
+
return d = null, h = null, m = e.apply(x, f), m;
|
|
154
|
+
}, D = (o) => {
|
|
155
|
+
const f = c ? o - c : 0;
|
|
156
|
+
return t - f;
|
|
157
|
+
}, P = (o) => {
|
|
158
|
+
const f = c ? o - c : t, x = o - u;
|
|
159
|
+
return c === null || f >= t || f < 0 || p && x >= b;
|
|
160
|
+
}, v = (o) => (r = null, a && d ? g(o) : (d = null, h = null, m)), y = () => {
|
|
161
|
+
const o = Date.now();
|
|
162
|
+
if (P(o)) {
|
|
163
|
+
v(o);
|
|
164
164
|
return;
|
|
165
165
|
}
|
|
166
|
-
r = setTimeout(y, D(
|
|
167
|
-
},
|
|
168
|
-
const
|
|
169
|
-
n = null, d && (g(
|
|
170
|
-
},
|
|
171
|
-
r !== null && clearTimeout(r), n !== null && clearTimeout(n),
|
|
172
|
-
},
|
|
173
|
-
const
|
|
174
|
-
if (d =
|
|
166
|
+
r = setTimeout(y, D(o));
|
|
167
|
+
}, C = () => {
|
|
168
|
+
const o = Date.now();
|
|
169
|
+
n = null, d && (g(o), r !== null && (clearTimeout(r), r = setTimeout(y, t)));
|
|
170
|
+
}, S = (o) => (u = o, r = setTimeout(y, t), p && (n = setTimeout(C, b)), s ? g(o) : m), j = () => {
|
|
171
|
+
r !== null && clearTimeout(r), n !== null && clearTimeout(n), u = 0, d = null, h = null, c = null, r = null, n = null;
|
|
172
|
+
}, k = () => r === null && n === null ? m : v(Date.now()), O = () => r !== null || n !== null, $ = function(...o) {
|
|
173
|
+
const f = Date.now(), x = P(f);
|
|
174
|
+
if (d = o, h = this, c = f, x) {
|
|
175
175
|
if (r === null)
|
|
176
|
-
return
|
|
176
|
+
return S(f);
|
|
177
177
|
if (p)
|
|
178
|
-
return clearTimeout(r), r = setTimeout(y, t), g(
|
|
178
|
+
return clearTimeout(r), r = setTimeout(y, t), g(f);
|
|
179
179
|
}
|
|
180
|
-
return r === null && (r = setTimeout(y, t)),
|
|
180
|
+
return r === null && (r = setTimeout(y, t)), m;
|
|
181
181
|
};
|
|
182
|
-
return $.cancel =
|
|
182
|
+
return $.cancel = j, $.flush = k, $.pending = O, $;
|
|
183
183
|
}
|
|
184
|
-
function
|
|
185
|
-
const { leading:
|
|
186
|
-
return
|
|
187
|
-
leading:
|
|
184
|
+
function ae(e, t, l = {}) {
|
|
185
|
+
const { leading: s = !0, trailing: a = !0 } = l;
|
|
186
|
+
return _(e, t, {
|
|
187
|
+
leading: s,
|
|
188
188
|
trailing: a,
|
|
189
189
|
maxWait: t
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
|
-
const
|
|
192
|
+
const se = ({
|
|
193
193
|
onClick: e,
|
|
194
194
|
disabled: t
|
|
195
195
|
}) => e ? t ? {
|
|
@@ -203,37 +203,37 @@ const ue = ({
|
|
|
203
203
|
(l.key === "Enter" || l.key === " ") && (l.preventDefault(), e?.(l));
|
|
204
204
|
},
|
|
205
205
|
onClick: e
|
|
206
|
-
} : void 0,
|
|
206
|
+
} : void 0, A = " ", oe = ({
|
|
207
207
|
label: e,
|
|
208
208
|
placeholder: t
|
|
209
209
|
}) => {
|
|
210
210
|
const l = typeof t == "string" && t.trim().length > 0 ? t : void 0;
|
|
211
211
|
return e ? {
|
|
212
|
-
inputPlaceholder: l ??
|
|
212
|
+
inputPlaceholder: l ?? A,
|
|
213
213
|
labelStaysFloatedWithPlaceholder: l !== void 0
|
|
214
214
|
} : {
|
|
215
|
-
inputPlaceholder: t ??
|
|
215
|
+
inputPlaceholder: t ?? A,
|
|
216
216
|
labelStaysFloatedWithPlaceholder: !1
|
|
217
217
|
};
|
|
218
218
|
};
|
|
219
219
|
export {
|
|
220
|
-
|
|
220
|
+
V as DisabledProvider,
|
|
221
221
|
T as assignRef,
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
222
|
+
le as buildAriaLabel,
|
|
223
|
+
ee as cn,
|
|
224
|
+
z as createSafeContext,
|
|
225
|
+
_ as debounce,
|
|
226
226
|
w as formatThousands,
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
227
|
+
se as getButtonA11yProps,
|
|
228
|
+
Z as getFontSize,
|
|
229
|
+
ne as getStepperCalculations,
|
|
230
|
+
K as mergeRefs,
|
|
231
|
+
oe as resolveBaseInputPlaceholder,
|
|
232
|
+
F as shallowEqual,
|
|
233
|
+
H as textFormatter,
|
|
234
|
+
ae as throttle,
|
|
235
|
+
X as toPascalCase,
|
|
236
|
+
Y as useDisabledContext,
|
|
237
|
+
te as useMergedRef,
|
|
238
|
+
re as useSplitText
|
|
239
239
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useRenderElement as c } from "../../utils/useRenderElement.js";
|
|
2
|
+
import { useCompositeItem as u } from "./useCompositeItem.js";
|
|
3
|
+
import { EMPTY_ARRAY as t, EMPTY_OBJECT as d } from "../../../../utils/esm/empty.js";
|
|
4
|
+
function M(e) {
|
|
5
|
+
const {
|
|
6
|
+
render: E,
|
|
7
|
+
className: R,
|
|
8
|
+
state: o = d,
|
|
9
|
+
props: r = t,
|
|
10
|
+
refs: s = t,
|
|
11
|
+
metadata: m,
|
|
12
|
+
stateAttributesMapping: p,
|
|
13
|
+
tag: i = "div",
|
|
14
|
+
...a
|
|
15
|
+
} = e, {
|
|
16
|
+
compositeProps: n,
|
|
17
|
+
compositeRef: f
|
|
18
|
+
} = u({
|
|
19
|
+
metadata: m
|
|
20
|
+
});
|
|
21
|
+
return c(i, e, {
|
|
22
|
+
state: o,
|
|
23
|
+
ref: [...s, f],
|
|
24
|
+
props: [n, ...r, a],
|
|
25
|
+
stateAttributesMapping: p
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
M as CompositeItem
|
|
30
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as r from "react";
|
|
2
|
+
import { useMergedRefs as p } from "../../../../utils/esm/useMergedRefs.js";
|
|
3
|
+
import { useCompositeRootContext as h } from "../root/CompositeRootContext.js";
|
|
4
|
+
import { useCompositeListItem as g } from "../list/useCompositeListItem.js";
|
|
5
|
+
function I(m = {}) {
|
|
6
|
+
const {
|
|
7
|
+
highlightItemOnHover: s,
|
|
8
|
+
highlightedIndex: c,
|
|
9
|
+
onHighlightedIndexChange: i
|
|
10
|
+
} = h(), {
|
|
11
|
+
ref: u,
|
|
12
|
+
index: e
|
|
13
|
+
} = g(m), t = c === e, n = r.useRef(null), d = p(u, n);
|
|
14
|
+
return {
|
|
15
|
+
compositeProps: r.useMemo(() => ({
|
|
16
|
+
tabIndex: t ? 0 : -1,
|
|
17
|
+
onFocus() {
|
|
18
|
+
i(e);
|
|
19
|
+
},
|
|
20
|
+
onMouseMove() {
|
|
21
|
+
const o = n.current;
|
|
22
|
+
if (!s || !o)
|
|
23
|
+
return;
|
|
24
|
+
const f = o.hasAttribute("disabled") || o.ariaDisabled === "true";
|
|
25
|
+
!t && !f && o.focus();
|
|
26
|
+
}
|
|
27
|
+
}), [t, i, e, s]),
|
|
28
|
+
compositeRef: d,
|
|
29
|
+
index: e
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
I as useCompositeItem
|
|
34
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import r from "../../../../utils/esm/formatErrorMessage.js";
|
|
2
|
+
import * as e from "react";
|
|
3
|
+
const o = /* @__PURE__ */ e.createContext(void 0);
|
|
4
|
+
process.env.NODE_ENV !== "production" && (o.displayName = "ContextMenuRootContext");
|
|
5
|
+
function u(n = !0) {
|
|
6
|
+
const t = e.useContext(o);
|
|
7
|
+
if (t === void 0 && !n)
|
|
8
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: ContextMenuRootContext is missing. ContextMenu parts must be placed within <ContextMenu.Root>." : r(25));
|
|
9
|
+
return t;
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
o as ContextMenuRootContext,
|
|
13
|
+
u as useContextMenuRootContext
|
|
14
|
+
};
|
package/dist/node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingFocusManager.js
CHANGED
|
@@ -20,9 +20,9 @@ import { CLICK_TRIGGER_IDENTIFIER as Ye } from "../../utils/constants.js";
|
|
|
20
20
|
import { resolveRef as L } from "../../utils/resolveRef.js";
|
|
21
21
|
import { jsxs as Ze, jsx as Ie } from "react/jsx-runtime";
|
|
22
22
|
import { isTypeableCombobox as he, getFloatingFocusElement as ke, contains as d, activeElement as M, isTypeableElement as et, getTarget as re } from "../utils/element.js";
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
23
|
+
import { getNodeAncestors as Le, getNodeChildren as Ce } from "../utils/nodes.js";
|
|
24
|
+
import { isVirtualClick as tt, isVirtualPointerEvent as nt, stopEvent as rt } from "../utils/event.js";
|
|
25
|
+
import { isOutsideEvent as Oe, getNextTabbable as ot, getPreviousTabbable as st, getTabbableOptions as se } from "../utils/tabbable.js";
|
|
26
26
|
import { isElementVisible as ut } from "../utils/composite.js";
|
|
27
27
|
import { triggerHover as it, outsidePress as ct, focusOut as at } from "../../utils/reason-parts.js";
|
|
28
28
|
function ft(t, v) {
|
|
@@ -85,7 +85,7 @@ function Kt(t) {
|
|
|
85
85
|
if (f || !m)
|
|
86
86
|
return;
|
|
87
87
|
function e(b) {
|
|
88
|
-
b.key === "Tab" && d(s, M(N(s))) && D().length === 0 && !I &&
|
|
88
|
+
b.key === "Tab" && d(s, M(N(s))) && D().length === 0 && !I && rt(b);
|
|
89
89
|
}
|
|
90
90
|
const c = N(s);
|
|
91
91
|
return c.addEventListener("keydown", e), () => {
|
|
@@ -124,7 +124,7 @@ function Kt(t) {
|
|
|
124
124
|
function p(l) {
|
|
125
125
|
const n = l.relatedTarget, H = l.currentTarget, $ = re(l);
|
|
126
126
|
queueMicrotask(() => {
|
|
127
|
-
const Ee = S(), ge = x.context.triggerElements, He = k(), We = n?.hasAttribute(Fe("focus-guard")) && [Y.current, Z.current, u?.beforeInsideRef.current, u?.afterInsideRef.current, u?.beforeOutsideRef.current, u?.afterOutsideRef.current, L(q), L(V)].includes(n), _e = !(d(a, n) || d(i, n) || d(n, i) || d(u?.portalNode, n) || He.some((R) => R === n || d(R, n)) || n != null && ge.hasElement(n) || ge.hasMatchingElement((R) => d(R, n)) || We || y && (
|
|
127
|
+
const Ee = S(), ge = x.context.triggerElements, He = k(), We = n?.hasAttribute(Fe("focus-guard")) && [Y.current, Z.current, u?.beforeInsideRef.current, u?.afterInsideRef.current, u?.beforeOutsideRef.current, u?.afterOutsideRef.current, L(q), L(V)].includes(n), _e = !(d(a, n) || d(i, n) || d(n, i) || d(u?.portalNode, n) || He.some((R) => R === n || d(R, n)) || n != null && ge.hasElement(n) || ge.hasMatchingElement((R) => d(R, n)) || We || y && (Ce(y.nodesRef.current, Ee).find((R) => d(R.context?.elements.floating, n) || d(R.context?.elements.domReference, n)) || Le(y.nodesRef.current, Ee).find((R) => [R.context?.elements.floating, ke(R.context?.elements.floating)].includes(n) || R.context?.elements.domReference === n)));
|
|
128
128
|
if (H === a && s && Ae(s, A), O && H !== a && !bt($) && M(e) === e.body) {
|
|
129
129
|
if (P(s) && (s.focus(), O === "popup")) {
|
|
130
130
|
me.request(() => {
|
|
@@ -170,7 +170,7 @@ function Kt(t) {
|
|
|
170
170
|
}, [f, a, i, s, m, y, u, x, G, O, D, I, S, A, w, de, be, me, V, q, k]), E.useEffect(() => {
|
|
171
171
|
if (f || !i || !T)
|
|
172
172
|
return;
|
|
173
|
-
const e = Array.from(u?.portalNode?.querySelectorAll(`[${Fe("portal")}]`) || []), b = (y ?
|
|
173
|
+
const e = Array.from(u?.portalNode?.querySelectorAll(`[${Fe("portal")}]`) || []), b = (y ? Le(y.nodesRef.current, S()) : []).find((n) => he(n.context?.elements.domReference || null))?.context?.elements.domReference, o = [...[i, ...e, Y.current, Z.current, u?.beforeOutsideRef.current, u?.afterOutsideRef.current, ...k()], b, L(q), L(V), I ? a : null].filter((n) => n != null), r = xe(o, {
|
|
174
174
|
ariaHidden: m || I,
|
|
175
175
|
mark: !1
|
|
176
176
|
}), g = [i, ...e].filter((n) => n != null), l = xe(g);
|
|
@@ -199,7 +199,7 @@ function Kt(t) {
|
|
|
199
199
|
if (o.open || (le.current = ft(o.nativeEvent, X.current)), o.reason === it && o.nativeEvent.type === "mouseleave" && (F.current = !0), o.reason === ct)
|
|
200
200
|
if (o.nested)
|
|
201
201
|
F.current = !1;
|
|
202
|
-
else if (
|
|
202
|
+
else if (tt(o.nativeEvent) || nt(o.nativeEvent))
|
|
203
203
|
F.current = !1;
|
|
204
204
|
else {
|
|
205
205
|
let r = !1;
|
|
@@ -225,7 +225,7 @@ function Kt(t) {
|
|
|
225
225
|
}
|
|
226
226
|
return () => {
|
|
227
227
|
J.off("openchange", b);
|
|
228
|
-
const o = M(e), r = k(), g = d(i, o) || r.some((n) => n === o || d(n, o)) || y &&
|
|
228
|
+
const o = M(e), r = k(), g = d(i, o) || r.some((n) => n === o || d(n, o)) || y && Ce(y.nodesRef.current, S(), !1).some((n) => d(n.context?.elements.floating, o)), l = p();
|
|
229
229
|
queueMicrotask(() => {
|
|
230
230
|
const n = dt(l), H = typeof B.current != "boolean";
|
|
231
231
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -268,13 +268,13 @@ function Kt(t) {
|
|
|
268
268
|
if (m) {
|
|
269
269
|
const c = K();
|
|
270
270
|
ne(c[c.length - 1]);
|
|
271
|
-
} else u?.portalNode && (F.current = !1,
|
|
271
|
+
} else u?.portalNode && (F.current = !1, Oe(e, u.portalNode) ? ot(a)?.focus() : L(q ?? u.beforeOutsideRef)?.focus());
|
|
272
272
|
}
|
|
273
273
|
}), h, pe && /* @__PURE__ */ Ie(ye, {
|
|
274
274
|
"data-type": "inside",
|
|
275
275
|
ref: qe,
|
|
276
276
|
onFocus: (e) => {
|
|
277
|
-
m ? ne(K()[0]) : u?.portalNode && (G && (F.current = !0),
|
|
277
|
+
m ? ne(K()[0]) : u?.portalNode && (G && (F.current = !0), Oe(e, u.portalNode) ? st(a)?.focus() : L(V ?? u.afterOutsideRef)?.focus());
|
|
278
278
|
}
|
|
279
279
|
})]
|
|
280
280
|
});
|