@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.
Files changed (121) hide show
  1. package/dist/index.js +108 -109
  2. package/dist/lib/Components/AmountDisplay/AmountDisplay.d.ts +1 -1
  3. package/dist/lib/Components/AmountDisplay/AmountDisplay.d.ts.map +1 -1
  4. package/dist/lib/Components/AmountDisplay/AmountDisplay.js +117 -78
  5. package/dist/lib/Components/AmountDisplay/index.d.ts +1 -1
  6. package/dist/lib/Components/AmountDisplay/index.d.ts.map +1 -1
  7. package/dist/lib/Components/AmountDisplay/types.d.ts +16 -3
  8. package/dist/lib/Components/AmountDisplay/types.d.ts.map +1 -1
  9. package/dist/lib/Components/AmountInput/AmountInput.d.ts +1 -1
  10. package/dist/lib/Components/AmountInput/AmountInput.d.ts.map +1 -1
  11. package/dist/lib/Components/AmountInput/AmountInput.js +127 -77
  12. package/dist/lib/Components/AmountInput/types.d.ts +12 -0
  13. package/dist/lib/Components/AmountInput/types.d.ts.map +1 -1
  14. package/dist/lib/Components/Avatar/Avatar.d.ts +1 -1
  15. package/dist/lib/Components/Avatar/Avatar.d.ts.map +1 -1
  16. package/dist/lib/Components/Avatar/Avatar.js +47 -60
  17. package/dist/lib/Components/Button/BaseButton.d.ts +2 -2
  18. package/dist/lib/Components/Button/Button.js +10 -10
  19. package/dist/lib/Components/Card/Card.js +12 -12
  20. package/dist/lib/Components/DataTable/DataTable.js +2 -2
  21. package/dist/lib/Components/Divider/Divider.js +4 -4
  22. package/dist/lib/Components/DotCount/DotCount.js +4 -4
  23. package/dist/lib/Components/DotIcon/DotIcon.d.ts +3 -2
  24. package/dist/lib/Components/DotIcon/DotIcon.d.ts.map +1 -1
  25. package/dist/lib/Components/DotIcon/DotIcon.js +55 -40
  26. package/dist/lib/Components/DotIcon/types.d.ts +7 -1
  27. package/dist/lib/Components/DotIcon/types.d.ts.map +1 -1
  28. package/dist/lib/Components/DotIndicator/DotIndicator.js +14 -14
  29. package/dist/lib/Components/DotIndicator/types.d.ts +2 -2
  30. package/dist/lib/Components/DotSymbol/DotSymbol.d.ts +1 -1
  31. package/dist/lib/Components/DotSymbol/DotSymbol.d.ts.map +1 -1
  32. package/dist/lib/Components/DotSymbol/DotSymbol.js +50 -35
  33. package/dist/lib/Components/DotSymbol/types.d.ts +7 -1
  34. package/dist/lib/Components/DotSymbol/types.d.ts.map +1 -1
  35. package/dist/lib/Components/Icon/Icon.js +4 -4
  36. package/dist/lib/Components/Icon/createIcon.js +4 -4
  37. package/dist/lib/Components/InteractiveIcon/InteractiveIcon.js +4 -4
  38. package/dist/lib/Components/Link/Link.js +6 -6
  39. package/dist/lib/Components/ListItem/ListItem.js +3 -3
  40. package/dist/lib/Components/MediaButton/MediaButton.d.ts +3 -3
  41. package/dist/lib/Components/MediaButton/MediaButton.d.ts.map +1 -1
  42. package/dist/lib/Components/MediaButton/MediaButton.js +44 -42
  43. package/dist/lib/Components/MediaButton/types.d.ts +5 -5
  44. package/dist/lib/Components/MediaButton/types.d.ts.map +1 -1
  45. package/dist/lib/Components/MediaImage/MediaImage.d.ts +1 -1
  46. package/dist/lib/Components/MediaImage/MediaImage.d.ts.map +1 -1
  47. package/dist/lib/Components/MediaImage/MediaImage.js +45 -32
  48. package/dist/lib/Components/MediaImage/types.d.ts +7 -1
  49. package/dist/lib/Components/MediaImage/types.d.ts.map +1 -1
  50. package/dist/lib/Components/Menu/Menu.d.ts +11 -16
  51. package/dist/lib/Components/Menu/Menu.d.ts.map +1 -1
  52. package/dist/lib/Components/Menu/Menu.js +186 -125
  53. package/dist/lib/Components/Menu/types.d.ts +50 -145
  54. package/dist/lib/Components/Menu/types.d.ts.map +1 -1
  55. package/dist/lib/Components/NavBar/CoinCapsule.d.ts +2 -2
  56. package/dist/lib/Components/NavBar/CoinCapsule.d.ts.map +1 -1
  57. package/dist/lib/Components/NavBar/CoinCapsule.js +1 -1
  58. package/dist/lib/Components/NavBar/NavBar.d.ts +4 -4
  59. package/dist/lib/Components/NavBar/NavBar.d.ts.map +1 -1
  60. package/dist/lib/Components/NavBar/NavBar.js +34 -26
  61. package/dist/lib/Components/NavBar/types.d.ts +2 -2
  62. package/dist/lib/Components/NavBar/types.d.ts.map +1 -1
  63. package/dist/lib/Components/Popover/Popover.d.ts +2 -2
  64. package/dist/lib/Components/Popover/Popover.js +6 -6
  65. package/dist/lib/Components/Popover/types.d.ts +6 -3
  66. package/dist/lib/Components/Popover/types.d.ts.map +1 -1
  67. package/dist/lib/Components/SideBar/SideBar.js +9 -9
  68. package/dist/lib/Components/Skeleton/Skeleton.js +4 -4
  69. package/dist/lib/Components/Table/Table.js +1 -1
  70. package/dist/lib/Components/Table/utils/useThrottledScrollBottom.js +3 -3
  71. package/dist/lib/Symbols/Icons/Lightbulb.js +3 -3
  72. package/dist/libs/utils-shared/dist/index.js +107 -107
  73. package/dist/node_modules/@base-ui/react/esm/composite/item/CompositeItem.js +30 -0
  74. package/dist/node_modules/@base-ui/react/esm/composite/item/useCompositeItem.js +34 -0
  75. package/dist/node_modules/@base-ui/react/esm/context-menu/root/ContextMenuRootContext.js +14 -0
  76. package/dist/node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingFocusManager.js +10 -10
  77. package/dist/node_modules/@base-ui/react/esm/floating-ui-react/hooks/useFocus.js +97 -0
  78. package/dist/node_modules/@base-ui/react/esm/floating-ui-react/hooks/useHoverFloatingInteraction.js +10 -10
  79. package/dist/node_modules/@base-ui/react/esm/floating-ui-react/hooks/useHoverReferenceInteraction.js +2 -2
  80. package/dist/node_modules/@base-ui/react/esm/floating-ui-react/utils/element.js +31 -20
  81. package/dist/node_modules/@base-ui/react/esm/menu/checkbox-item/MenuCheckboxItem.js +78 -0
  82. package/dist/node_modules/@base-ui/react/esm/menu/checkbox-item/MenuCheckboxItemContext.js +14 -0
  83. package/dist/node_modules/@base-ui/react/esm/menu/checkbox-item/MenuCheckboxItemDataAttributes.js +6 -0
  84. package/dist/node_modules/@base-ui/react/esm/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.js +44 -0
  85. package/dist/node_modules/@base-ui/react/esm/menu/group/MenuGroup.js +28 -0
  86. package/dist/node_modules/@base-ui/react/esm/menu/group/MenuGroupContext.js +14 -0
  87. package/dist/node_modules/@base-ui/react/esm/menu/group-label/MenuGroupLabel.js +29 -0
  88. package/dist/node_modules/@base-ui/react/esm/menu/item/MenuItem.js +47 -0
  89. package/dist/node_modules/@base-ui/react/esm/menu/item/useMenuItem.js +50 -0
  90. package/dist/node_modules/@base-ui/react/esm/menu/item/useMenuItemCommonProps.js +49 -0
  91. package/dist/node_modules/@base-ui/react/esm/menu/popup/MenuPopup.js +89 -0
  92. package/dist/node_modules/@base-ui/react/esm/menu/portal/MenuPortal.js +24 -0
  93. package/dist/node_modules/@base-ui/react/esm/menu/portal/MenuPortalContext.js +14 -0
  94. package/dist/node_modules/@base-ui/react/esm/menu/positioner/MenuPositioner.js +174 -0
  95. package/dist/node_modules/@base-ui/react/esm/menu/positioner/MenuPositionerContext.js +14 -0
  96. package/dist/node_modules/@base-ui/react/esm/menu/radio-group/MenuRadioGroup.js +45 -0
  97. package/dist/node_modules/@base-ui/react/esm/menu/radio-group/MenuRadioGroupContext.js +14 -0
  98. package/dist/node_modules/@base-ui/react/esm/menu/radio-item/MenuRadioItem.js +75 -0
  99. package/dist/node_modules/@base-ui/react/esm/menu/radio-item/MenuRadioItemContext.js +14 -0
  100. package/dist/node_modules/@base-ui/react/esm/menu/radio-item-indicator/MenuRadioItemIndicator.js +44 -0
  101. package/dist/node_modules/@base-ui/react/esm/menu/root/MenuRoot.js +271 -0
  102. package/dist/node_modules/@base-ui/react/esm/menu/root/MenuRootContext.js +14 -0
  103. package/dist/node_modules/@base-ui/react/esm/menu/store/MenuStore.js +109 -0
  104. package/dist/node_modules/@base-ui/react/esm/menu/submenu-root/MenuSubmenuRoot.js +21 -0
  105. package/dist/node_modules/@base-ui/react/esm/menu/submenu-root/MenuSubmenuRootContext.js +10 -0
  106. package/dist/node_modules/@base-ui/react/esm/menu/submenu-trigger/MenuSubmenuTrigger.js +101 -0
  107. package/dist/node_modules/@base-ui/react/esm/menu/trigger/MenuTrigger.js +207 -0
  108. package/dist/node_modules/@base-ui/react/esm/menu/utils/findRootOwnerId.js +10 -0
  109. package/dist/node_modules/@base-ui/react/esm/menu/utils/stateAttributesMapping.js +15 -0
  110. package/dist/node_modules/@base-ui/react/esm/menubar/MenubarContext.js +10 -0
  111. package/dist/node_modules/@base-ui/react/esm/popover/root/PopoverRoot.js +11 -11
  112. package/dist/node_modules/@base-ui/react/esm/popover/store/PopoverStore.js +7 -7
  113. package/dist/node_modules/@base-ui/react/esm/popover/trigger/PopoverTrigger.js +11 -11
  114. package/dist/node_modules/@base-ui/react/esm/utils/constants.js +11 -10
  115. package/dist/node_modules/@base-ui/react/esm/utils/reason-parts.js +11 -8
  116. package/dist/node_modules/@base-ui/react/esm/utils/useMixedToggleClickHandler.js +25 -0
  117. package/dist/node_modules/@base-ui/utils/esm/detectBrowser.js +7 -8
  118. package/dist/node_modules/@base-ui/utils/esm/fastHooks.js +43 -0
  119. package/dist/node_modules/@base-ui/utils/esm/store/useStore.js +54 -13
  120. package/dist/package.json +4 -5
  121. package/package.json +4 -5
@@ -1,13 +1,13 @@
1
- import { jsx as e, jsxs as C, Fragment as R } from "react/jsx-runtime";
2
- import { createSafeContext as V, cn as m, useDisabledContext as q } from "../../../libs/utils-shared/dist/index.js";
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 z } from "../../Symbols/Icons/ExpandRight.js";
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] = V("SideBar"), f = {
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 = q({
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
- (P) => {
136
- l || (i?.(P), v?.(t));
135
+ (z) => {
136
+ l || (i?.(z), v?.(t));
137
137
  },
138
138
  [l, i, v, t]
139
- ), j = /* @__PURE__ */ C(R, { children: [
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 ? z : E, i = /* @__PURE__ */ e(
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
- ), r = {
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 && r[s]) {
72
- const i = r[s];
73
- return /* @__PURE__ */ e(i, { ...d, ref: t, className: a });
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 a, TABLE_CELL_HEIGHT as R } from "../constants.js";
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 = a
13
+ thresholdInRow: c = R
14
14
  }) => {
15
15
  const n = L(
16
- () => c * R,
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 24 24",
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.5,
20
- d: "M15 15.19H9M20 5l1.19-1.19M4 15l-1.19 1.19M5 4 3.81 2.81M20 15l1.19 1.19M21 10h1.69M1.31 10H3m6 8h5.87m-6.33-3.104c-1.78-1.26-2.85-3.45-2.47-5.86.4-2.607 2.57-4.688 5.2-4.995a5.996 5.996 0 0 1 6.725 5.95c0 2.02-1.01 3.81-2.55 4.898-.28.19-.46.49-.46.83v2.76a2.5 2.5 0 0 1-2.5 2.5h-1c-1.39 0-2.5-1.12-2.5-2.5v-2.763c0-.35-.19-.65-.46-.85z"
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 J(e) {
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 = 48, B = 17, F = 2;
9
- function V(e) {
10
- const t = e.replace(/\D/g, "").length;
11
- return Math.max(
12
- B,
13
- N - t * F
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("."), [o, a] = e.split("."), u = o.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
19
- return l && t ? a ? `${u}.${a}` : `${u}.` : u;
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 X(e, t = {}) {
21
+ function H(e, t = {}) {
22
22
  const {
23
23
  allowDecimals: l = !0,
24
- thousandsSeparator: o = !0,
24
+ thousandsSeparator: s = !0,
25
25
  maxIntegerLength: a = 9,
26
- maxDecimalLength: u = 9
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)), o ? w(n) : n;
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 i = n.slice(0, c), d = n.slice(c + 1).replace(/\./g, "");
35
- a > 0 && i.length > a && (i = i.slice(0, a)), d = d.slice(0, u), i === "" && (i = "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 ? `${i}.${d}` : h ? `${i}.` : i;
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 o ? w(n) : n;
40
+ return s ? w(n) : n;
41
41
  }
42
- function z(e, t) {
42
+ function F(e, t) {
43
43
  if (Object.is(e, t)) return !0;
44
- const l = e, o = t, a = Object.keys(l), u = Object.keys(o);
45
- return a.length !== u.length ? !1 : a.every(
46
- (r) => Object.prototype.hasOwnProperty.call(o, r) && Object.is(l[r], o[r])
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 K(e, t) {
50
- const l = L(t), o = ({ children: u, value: r }) => {
49
+ function z(e, t) {
50
+ const l = L(t), s = ({ children: i, value: r }) => {
51
51
  const n = R(r);
52
- return z(n.current, r) || (n.current = r), /* @__PURE__ */ W(l.Provider, { value: n.current, children: u });
52
+ return F(n.current, r) || (n.current = r), /* @__PURE__ */ W(l.Provider, { value: n.current, children: i });
53
53
  };
54
- o.displayName = e + "Provider";
54
+ s.displayName = e + "Provider";
55
55
  function a({
56
- consumerName: u,
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
- `${u} must be used within ${e}`
64
+ `${i} must be used within ${e}`
65
65
  );
66
66
  return t || {};
67
67
  }
68
- return [o, a];
68
+ return [s, a];
69
69
  }
70
- const [ee, U] = K("Disabled", { disabled: !1 }), te = ({
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 o = U({
75
+ const s = B({
76
76
  consumerName: e,
77
77
  contextRequired: t ?? !1
78
78
  });
79
- return !!(l?.disabled || o.disabled);
79
+ return !!(l?.disabled || s.disabled);
80
80
  };
81
- function ne(...e) {
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 H(...e) {
89
+ function K(...e) {
90
90
  const t = /* @__PURE__ */ new Map();
91
91
  return (l) => {
92
92
  if (l === null) {
93
- e.forEach((o) => {
94
- const a = t.get(o);
95
- typeof a == "function" && a(), T(o, null);
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((o) => {
100
- const a = T(o, l);
101
- typeof a == "function" && t.set(o, a);
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 re(...e) {
106
- return M(() => H(...e), e);
105
+ function te(...e) {
106
+ return M(() => K(...e), e);
107
107
  }
108
- const le = ({
108
+ const ne = ({
109
109
  currentStep: e,
110
110
  totalSteps: t,
111
111
  size: l,
112
- label: o,
112
+ label: s,
113
113
  strokeWidth: a = 4,
114
- arcPercentage: u = 0.75
114
+ arcPercentage: i = 0.75
115
115
  }) => {
116
- const r = Math.min(Math.max(e, 0), t), n = o ?? `${r}/${t}`, c = t <= 0 ? 0 : r / t, i = (l - a) / 2, d = l / 2, h = l / 2, f = 2 * Math.PI * i, p = f * u, x = p * (1 - c), g = r <= 0, D = `${p} ${f}`, P = g ? p - 2 : x;
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: i,
120
+ r: u,
121
121
  cx: d,
122
122
  cy: h,
123
- circumference: f,
123
+ circumference: m,
124
124
  trackArcLength: p,
125
- trackDashArray: `${p} ${f}`,
125
+ trackDashArray: `${p} ${m}`,
126
126
  progressDashArray: D,
127
127
  progressDashOffset: P,
128
128
  showMinimalDot: g
129
129
  };
130
- }, ae = (e) => M(
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
- ), oe = (e, t, l) => {
142
+ ), le = (e, t, l) => {
143
143
  if (t) return l;
144
- const o = e.decimalPart ? `${e.decimalSeparator}${e.decimalPart}` : "", a = `${e.integerPart}${o}`;
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 Q(e, t, l = {}) {
148
- const { leading: o = !1, trailing: a = !0, maxWait: u } = l;
149
- let r = null, n = null, c = null, i = 0, d = null, h = null, f;
150
- const p = u !== void 0, x = p ? Math.max(u, t) : 0, g = (s) => {
151
- i = s;
152
- const m = d, b = h;
153
- return d = null, h = null, f = e.apply(b, m), f;
154
- }, D = (s) => {
155
- const m = c ? s - c : 0;
156
- return t - m;
157
- }, P = (s) => {
158
- const m = c ? s - c : t, b = s - i;
159
- return c === null || m >= t || m < 0 || p && b >= x;
160
- }, v = (s) => (r = null, a && d ? g(s) : (d = null, h = null, f)), y = () => {
161
- const s = Date.now();
162
- if (P(s)) {
163
- v(s);
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(s));
167
- }, S = () => {
168
- const s = Date.now();
169
- n = null, d && (g(s), r !== null && (clearTimeout(r), r = setTimeout(y, t)));
170
- }, j = (s) => (i = s, r = setTimeout(y, t), p && (n = setTimeout(S, x)), o ? g(s) : f), k = () => {
171
- r !== null && clearTimeout(r), n !== null && clearTimeout(n), i = 0, d = null, h = null, c = null, r = null, n = null;
172
- }, A = () => r === null && n === null ? f : v(Date.now()), O = () => r !== null || n !== null, $ = function(...s) {
173
- const m = Date.now(), b = P(m);
174
- if (d = s, h = this, c = m, b) {
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 j(m);
176
+ return S(f);
177
177
  if (p)
178
- return clearTimeout(r), r = setTimeout(y, t), g(m);
178
+ return clearTimeout(r), r = setTimeout(y, t), g(f);
179
179
  }
180
- return r === null && (r = setTimeout(y, t)), f;
180
+ return r === null && (r = setTimeout(y, t)), m;
181
181
  };
182
- return $.cancel = k, $.flush = A, $.pending = O, $;
182
+ return $.cancel = j, $.flush = k, $.pending = O, $;
183
183
  }
184
- function se(e, t, l = {}) {
185
- const { leading: o = !0, trailing: a = !0 } = l;
186
- return Q(e, t, {
187
- leading: o,
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 ue = ({
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, C = " ", ie = ({
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 ?? C,
212
+ inputPlaceholder: l ?? A,
213
213
  labelStaysFloatedWithPlaceholder: l !== void 0
214
214
  } : {
215
- inputPlaceholder: t ?? C,
215
+ inputPlaceholder: t ?? A,
216
216
  labelStaysFloatedWithPlaceholder: !1
217
217
  };
218
218
  };
219
219
  export {
220
- ee as DisabledProvider,
220
+ V as DisabledProvider,
221
221
  T as assignRef,
222
- oe as buildAriaLabel,
223
- ne as cn,
224
- K as createSafeContext,
225
- Q as debounce,
222
+ le as buildAriaLabel,
223
+ ee as cn,
224
+ z as createSafeContext,
225
+ _ as debounce,
226
226
  w as formatThousands,
227
- ue as getButtonA11yProps,
228
- V as getFontSize,
229
- le as getStepperCalculations,
230
- H as mergeRefs,
231
- ie as resolveBaseInputPlaceholder,
232
- z as shallowEqual,
233
- X as textFormatter,
234
- se as throttle,
235
- J as toPascalCase,
236
- te as useDisabledContext,
237
- re as useMergedRef,
238
- ae as useSplitText
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
+ };
@@ -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 { getTabbableOptions as se, isOutsideEvent as Le, getNextTabbable as tt, getPreviousTabbable as nt } from "../utils/tabbable.js";
24
- import { getNodeAncestors as Ce, getNodeChildren as Oe } from "../utils/nodes.js";
25
- import { isVirtualClick as rt, isVirtualPointerEvent as ot, stopEvent as st } from "../utils/event.js";
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 && st(b);
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 && (Oe(y.nodesRef.current, Ee).find((R) => d(R.context?.elements.floating, n) || d(R.context?.elements.domReference, n)) || Ce(y.nodesRef.current, Ee).find((R) => [R.context?.elements.floating, ke(R.context?.elements.floating)].includes(n) || R.context?.elements.domReference === n)));
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 ? Ce(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, {
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 (rt(o.nativeEvent) || ot(o.nativeEvent))
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 && Oe(y.nodesRef.current, S(), !1).some((n) => d(n.context?.elements.floating, o)), l = p();
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, Le(e, u.portalNode) ? tt(a)?.focus() : L(q ?? u.beforeOutsideRef)?.focus());
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), Le(e, u.portalNode) ? nt(a)?.focus() : L(V ?? u.afterOutsideRef)?.focus());
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
  });