@g4rcez/components 3.0.2 → 4.0.1

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 (151) hide show
  1. package/dist/CaretDown.es-Cj7klWI3.js +33 -0
  2. package/dist/CaretDown.es-Cj7klWI3.js.map +1 -0
  3. package/dist/CaretRight.es-0-M8D9y8.js +33 -0
  4. package/dist/CaretRight.es-0-M8D9y8.js.map +1 -0
  5. package/dist/CheckCircle.es-C6QWLfk_.js +33 -0
  6. package/dist/CheckCircle.es-C6QWLfk_.js.map +1 -0
  7. package/dist/File.es-CA-vuPED.js +33 -0
  8. package/dist/File.es-CA-vuPED.js.map +1 -0
  9. package/dist/IconBase.es-DJ1oCtpo.js +50 -0
  10. package/dist/IconBase.es-DJ1oCtpo.js.map +1 -0
  11. package/dist/Info.es-CrZKs4q4.js +33 -0
  12. package/dist/Info.es-CrZKs4q4.js.map +1 -0
  13. package/dist/MotionConfigContext-C7MqlSdv.js.map +1 -1
  14. package/dist/Warning.es-D_eI6tLe.js +39 -0
  15. package/dist/Warning.es-D_eI6tLe.js.map +1 -0
  16. package/dist/X.es-BJ1O93El.js +39 -0
  17. package/dist/X.es-BJ1O93El.js.map +1 -0
  18. package/dist/ai/docs/Alert.md +1 -1
  19. package/dist/ai/docs/AnimatedList.md +3 -3
  20. package/dist/ai/docs/Button.md +1 -1
  21. package/dist/ai/docs/CommandPalette.md +7 -7
  22. package/dist/ai/docs/Dropdown.md +4 -4
  23. package/dist/ai/docs/Empty.md +9 -9
  24. package/dist/ai/docs/Expand.md +1 -1
  25. package/dist/ai/docs/FileUpload.md +2 -2
  26. package/dist/ai/docs/Input.md +2 -2
  27. package/dist/ai/docs/InputField.md +2 -2
  28. package/dist/ai/docs/List.md +3 -3
  29. package/dist/ai/docs/Menu.md +3 -3
  30. package/dist/ai/docs/MultiSelect.md +1 -1
  31. package/dist/ai/docs/PageCalendar.md +1 -1
  32. package/dist/ai/docs/Select.md +1 -1
  33. package/dist/ai/docs/Slot.md +1 -1
  34. package/dist/ai/docs/Stats.md +11 -11
  35. package/dist/ai/docs/Table.md +1 -1
  36. package/dist/ai/docs/Tag.md +2 -2
  37. package/dist/ai/docs/Timeline.md +5 -5
  38. package/dist/ai/docs/Toolbar.md +2 -2
  39. package/dist/ai/docs/Tooltip.md +3 -3
  40. package/dist/ai/docs/TransferList.md +2 -2
  41. package/dist/{autocomplete-Boida9R7.js → autocomplete-Cn9Z2hLq.js} +48 -48
  42. package/dist/autocomplete-Cn9Z2hLq.js.map +1 -0
  43. package/dist/{calendar-BswV66Nx.js → calendar-B5lSd0ID.js} +599 -571
  44. package/dist/calendar-B5lSd0ID.js.map +1 -0
  45. package/dist/components/display/alert.js +18 -18
  46. package/dist/components/display/alert.js.map +1 -1
  47. package/dist/components/display/calendar.js +4 -4
  48. package/dist/components/display/card.d.ts +2 -2
  49. package/dist/components/display/card.d.ts.map +1 -1
  50. package/dist/components/display/card.js +6 -6
  51. package/dist/components/display/card.js.map +1 -1
  52. package/dist/components/display/empty.d.ts +2 -2
  53. package/dist/components/display/empty.d.ts.map +1 -1
  54. package/dist/components/display/list.js +15 -15
  55. package/dist/components/display/list.js.map +1 -1
  56. package/dist/components/display/notifications.js +5 -5
  57. package/dist/components/display/tabs.js +1 -1
  58. package/dist/components/floating/command-palette.d.ts +3 -3
  59. package/dist/components/floating/command-palette.d.ts.map +1 -1
  60. package/dist/components/floating/dropdown.js +1 -1
  61. package/dist/components/floating/expand.js +1 -1
  62. package/dist/components/floating/menu.d.ts +2 -2
  63. package/dist/components/floating/menu.d.ts.map +1 -1
  64. package/dist/components/floating/menu.js +31 -31
  65. package/dist/components/floating/menu.js.map +1 -1
  66. package/dist/components/floating/modal.js +35 -35
  67. package/dist/components/floating/modal.js.map +1 -1
  68. package/dist/components/floating/tooltip.js +1 -1
  69. package/dist/components/form/autocomplete.js +5 -5
  70. package/dist/components/form/date-picker.js +3 -3
  71. package/dist/components/form/file-upload.d.ts.map +1 -1
  72. package/dist/components/form/file-upload.js +3 -3
  73. package/dist/components/form/input-field.d.ts.map +1 -1
  74. package/dist/components/form/input.js +1 -1
  75. package/dist/components/form/select.js +29 -29
  76. package/dist/components/form/select.js.map +1 -1
  77. package/dist/components/form/task-list.js.map +1 -1
  78. package/dist/components/form/transfer-list.js +15 -15
  79. package/dist/components/form/transfer-list.js.map +1 -1
  80. package/dist/components/page-calendar/calendar-header.d.ts.map +1 -1
  81. package/dist/components/page-calendar/day-view.d.ts.map +1 -1
  82. package/dist/components/page-calendar/month-view.d.ts.map +1 -1
  83. package/dist/components/page-calendar/page-calendar.utils.d.ts +6 -0
  84. package/dist/components/page-calendar/page-calendar.utils.d.ts.map +1 -1
  85. package/dist/components/page-calendar/week-view.d.ts.map +1 -1
  86. package/dist/components/table/table.js +3 -3
  87. package/dist/config/context.d.ts +2 -0
  88. package/dist/config/context.d.ts.map +1 -1
  89. package/dist/context-BFXNJVn2.js.map +1 -1
  90. package/dist/{date-picker-BxPTdZPy.js → date-picker-DwNo22lx.js} +316 -288
  91. package/dist/date-picker-DwNo22lx.js.map +1 -0
  92. package/dist/{file-upload-BB6BdGcE.js → file-upload-Brf2NkLr.js} +1103 -976
  93. package/dist/file-upload-Brf2NkLr.js.map +1 -0
  94. package/dist/{floating-ui.react-DycKASR0.js → floating-ui.react-QNHG9W4N.js} +205 -205
  95. package/dist/{floating-ui.react-DycKASR0.js.map → floating-ui.react-QNHG9W4N.js.map} +1 -1
  96. package/dist/hooks/use-components-provider.d.ts.map +1 -1
  97. package/dist/index-0YMC-_Lt.js.map +1 -1
  98. package/dist/index-BelDtX5M.js +1821 -0
  99. package/dist/index-BelDtX5M.js.map +1 -0
  100. package/dist/{index-BtlhELJ3.js → index-C-PuFUZi.js} +136 -136
  101. package/dist/index-C-PuFUZi.js.map +1 -0
  102. package/dist/index-Z-fZHxfJ.js +335 -0
  103. package/dist/index-Z-fZHxfJ.js.map +1 -0
  104. package/dist/index-t1qLJTt5.js.map +1 -1
  105. package/dist/index.css +1 -1
  106. package/dist/index.js +2583 -2463
  107. package/dist/index.js.map +1 -1
  108. package/dist/{input-CoJoHIhd.js → input-CrGrSnUt.js} +2 -2
  109. package/dist/{input-CoJoHIhd.js.map → input-CrGrSnUt.js.map} +1 -1
  110. package/dist/input-field-5vYcz5tT.js +166 -0
  111. package/dist/input-field-5vYcz5tT.js.map +1 -0
  112. package/dist/notifications-cUdVPs-B.js +2786 -0
  113. package/dist/notifications-cUdVPs-B.js.map +1 -0
  114. package/dist/proxy-BZcQiBrp.js.map +1 -1
  115. package/dist/{slot-CQW8ZzBb.js → slot-CRyweuj0.js} +5 -5
  116. package/dist/{slot-CQW8ZzBb.js.map → slot-CRyweuj0.js.map} +1 -1
  117. package/dist/{tabs-ccIA7vMo.js → tabs-S00a8qq8.js} +5 -5
  118. package/dist/{tabs-ccIA7vMo.js.map → tabs-S00a8qq8.js.map} +1 -1
  119. package/dist/use-motion-value-eGwNuWuw.js.map +1 -1
  120. package/package.json +2 -2
  121. package/dist/autocomplete-Boida9R7.js.map +0 -1
  122. package/dist/calendar-BswV66Nx.js.map +0 -1
  123. package/dist/chevron-down-BBFYYzZq.js +0 -6
  124. package/dist/chevron-down-BBFYYzZq.js.map +0 -1
  125. package/dist/chevron-right-DvXGOiS_.js +0 -6
  126. package/dist/chevron-right-DvXGOiS_.js.map +0 -1
  127. package/dist/circle-check-big-3M5lhTxx.js +0 -9
  128. package/dist/circle-check-big-3M5lhTxx.js.map +0 -1
  129. package/dist/createLucideIcon-CP-mMPfa.js +0 -76
  130. package/dist/createLucideIcon-CP-mMPfa.js.map +0 -1
  131. package/dist/date-picker-BxPTdZPy.js.map +0 -1
  132. package/dist/file-CBCP85VI.js +0 -15
  133. package/dist/file-CBCP85VI.js.map +0 -1
  134. package/dist/file-upload-BB6BdGcE.js.map +0 -1
  135. package/dist/index-BJ1ayTam.js +0 -126
  136. package/dist/index-BJ1ayTam.js.map +0 -1
  137. package/dist/index-BtlhELJ3.js.map +0 -1
  138. package/dist/index-ChfR6F8d.js +0 -1590
  139. package/dist/index-ChfR6F8d.js.map +0 -1
  140. package/dist/index-DE4shK8D.js +0 -215
  141. package/dist/index-DE4shK8D.js.map +0 -1
  142. package/dist/info-N5jWZg2A.js +0 -10
  143. package/dist/info-N5jWZg2A.js.map +0 -1
  144. package/dist/input-field-DTeIrwpK.js +0 -146
  145. package/dist/input-field-DTeIrwpK.js.map +0 -1
  146. package/dist/notifications-NPuFDsBp.js +0 -2550
  147. package/dist/notifications-NPuFDsBp.js.map +0 -1
  148. package/dist/triangle-alert-CHMhQ6yd.js +0 -16
  149. package/dist/triangle-alert-CHMhQ6yd.js.map +0 -1
  150. package/dist/x-B9bYxG31.js +0 -9
  151. package/dist/x-B9bYxG31.js.map +0 -1
@@ -1,18 +1,18 @@
1
1
  import { jsxs as x, jsx as t } from "react/jsx-runtime";
2
- import { p as Y, q, r as te, t as $, u as se, o as ne, f as oe, s as ae, b as ie, d as re, i as le, v as de, w as ce, n as ue, j as fe, x as me, c as ge, y as ve, z as pe, F as Ie, l as xe, A as he } from "../../floating-ui.react-DycKASR0.js";
3
- import { S as Fe } from "../../slot-CQW8ZzBb.js";
4
- import M, { createContext as be, useState as R, useRef as _, useContext as G, useEffect as j, Fragment as ye } from "react";
5
- import { F as Ne, T as Ce } from "../../constants-r-AHn273.js";
6
- import { c as w, m as k } from "../../dom-Dl8XH0CK.js";
7
- import { C as Pe } from "../../chevron-right-DvXGOiS_.js";
8
- const U = (o = "") => w(
2
+ import { p as Y, q, r as te, t as $, u as se, o as ne, f as oe, s as ae, b as ie, d as re, i as le, v as de, w as ce, n as ue, j as fe, x as me, c as ge, y as ve, z as pe, F as Ie, l as xe, A as Fe } from "../../floating-ui.react-QNHG9W4N.js";
3
+ import { S as be } from "../../slot-CRyweuj0.js";
4
+ import { e as he } from "../../CaretRight.es-0-M8D9y8.js";
5
+ import M, { createContext as ye, useState as C, useRef as _, useContext as G, useEffect as j, Fragment as Ne } from "react";
6
+ import { F as Pe, T as we } from "../../constants-r-AHn273.js";
7
+ import { c as R, m as k } from "../../dom-Dl8XH0CK.js";
8
+ const U = (o = "") => R(
9
9
  "w-full min-w-36 outline-none p-2.5 items-center flex justify-between text-left",
10
10
  "hover:bg-primary focus:bg-primary aria-expanded:opacity-80",
11
11
  "focus:text-primary-foreground hover:text-primary-foreground",
12
12
  "first-of-type:rounded-t-lg last-of-type:rounded-b-lg",
13
13
  "disabled:opacity-40 disabled:cursor-not-allowed",
14
14
  o
15
- ), A = be({
15
+ ), A = ye({
16
16
  isOpen: !1,
17
17
  activeIndex: null,
18
18
  getItemProps: () => ({}),
@@ -21,20 +21,20 @@ const U = (o = "") => w(
21
21
  setHasFocusInside: () => {
22
22
  }
23
23
  }), D = M.forwardRef(
24
- ({ children: o, FloatingComponent: i = "div", hover: g = !0, open: h, isParent: r = !1, restoreFocus: F = !1, floatingClassName: d = "", label: v, ...n }, c) => {
25
- const [s, b] = R(h ?? !1), [E, y] = R(!1), [N, C] = R(null), H = _([]), T = _([]), u = G(A), p = Y(), a = q(), f = te(), I = $(), e = p !== null, { floatingStyles: B, refs: P, context: l } = se({
24
+ ({ children: o, FloatingComponent: i = "div", hover: g = !0, open: F, isParent: r = !1, restoreFocus: b = !1, floatingClassName: d = "", label: v, ...n }, c) => {
25
+ const [s, h] = C(F ?? !1), [E, y] = C(!1), [N, P] = C(null), H = _([]), T = _([]), u = G(A), p = Y(), a = q(), f = te(), I = $(), e = p !== null, { floatingStyles: B, refs: w, context: l } = se({
26
26
  nodeId: f,
27
27
  open: s,
28
28
  transform: !0,
29
29
  strategy: "absolute",
30
- onOpenChange: b,
30
+ onOpenChange: h,
31
31
  whileElementsMounted: ie,
32
32
  placement: e ? "right" : "bottom-start",
33
33
  middleware: [ne({ mainAxis: e ? 0 : 4, alignmentAxis: e ? -4 : 0 }), oe(), ae()]
34
34
  }), J = re(l, { role: "menu" }), K = le(l, { bubbles: !0 }), Q = de(l, {
35
35
  move: !1,
36
36
  enabled: g,
37
- delay: { open: Ne },
37
+ delay: { open: Pe },
38
38
  handleClose: ce({ blockPointerEvents: !0, requireIntent: !1 })
39
39
  }), V = ue(l, {
40
40
  toggle: !e,
@@ -46,17 +46,17 @@ const U = (o = "") => w(
46
46
  activeIndex: N,
47
47
  nested: e,
48
48
  listRef: H,
49
- onNavigate: C
49
+ onNavigate: P
50
50
  }), X = me(l, {
51
51
  activeIndex: N,
52
52
  listRef: T,
53
- resetMs: Ce,
54
- onMatch: s ? C : void 0
53
+ resetMs: we,
54
+ onMatch: s ? P : void 0
55
55
  }), { getReferenceProps: L, getFloatingProps: Z, getItemProps: ee } = ge([Q, V, J, K, W, X]);
56
56
  j(() => {
57
57
  if (!a) return;
58
- const m = () => b(!1), S = (z) => {
59
- z.nodeId !== f && z.parentId === p && b(!1);
58
+ const m = () => h(!1), S = (z) => {
59
+ z.nodeId !== f && z.parentId === p && h(!1);
60
60
  };
61
61
  return a.events.on("click", m), a.events.on("menuopen", S), () => {
62
62
  a.events.off("click", m), a.events.off("menuopen", S);
@@ -64,10 +64,10 @@ const U = (o = "") => w(
64
64
  }, [a, f, p]), j(() => {
65
65
  s && a && a.events.emit("menuopen", { parentId: p, nodeId: f });
66
66
  }, [a, s, f, p]);
67
- const O = r ? n.className : w(U(n.className));
67
+ const O = r ? n.className : R(U(n.className));
68
68
  return /* @__PURE__ */ x(ve, { id: f, children: [
69
- /* @__PURE__ */ t(ye, { children: n.asChild ? /* @__PURE__ */ t(
70
- Fe,
69
+ /* @__PURE__ */ t(Ne, { children: n.asChild ? /* @__PURE__ */ t(
70
+ be,
71
71
  {
72
72
  ...L(
73
73
  u.getItemProps({
@@ -83,7 +83,7 @@ const U = (o = "") => w(
83
83
  "data-nested": e ? "" : void 0,
84
84
  role: e ? "menuitem" : void 0,
85
85
  "data-focus-inside": E ? "" : void 0,
86
- ref: k(P.setReference, I.ref, c),
86
+ ref: k(w.setReference, I.ref, c),
87
87
  tabIndex: e ? u.activeIndex === I.index ? 0 : -1 : void 0
88
88
  }
89
89
  ) : /* @__PURE__ */ x(
@@ -95,7 +95,7 @@ const U = (o = "") => w(
95
95
  "data-nested": e ? "" : void 0,
96
96
  role: e ? "menuitem" : void 0,
97
97
  "data-focus-inside": E ? "" : void 0,
98
- ref: k(P.setReference, I.ref, c),
98
+ ref: k(w.setReference, I.ref, c),
99
99
  tabIndex: e ? u.activeIndex === I.index ? 0 : -1 : void 0,
100
100
  ...L(
101
101
  u.getItemProps({
@@ -109,25 +109,25 @@ const U = (o = "") => w(
109
109
  v,
110
110
  e && /* @__PURE__ */ x("span", { style: { marginLeft: 10, fontSize: 10 }, children: [
111
111
  /* @__PURE__ */ t("span", { className: "sr-only", children: "Next menu" }),
112
- /* @__PURE__ */ t(Pe, { size: 14 })
112
+ /* @__PURE__ */ t(he, { size: 14 })
113
113
  ] })
114
114
  ]
115
115
  }
116
116
  ) }),
117
- /* @__PURE__ */ t(A.Provider, { value: { activeIndex: N, setActiveIndex: C, getItemProps: ee, setHasFocusInside: y, isOpen: s }, children: /* @__PURE__ */ t(pe, { elementsRef: H, labelsRef: T, children: s && /* @__PURE__ */ t(Ie, { children: /* @__PURE__ */ t(
117
+ /* @__PURE__ */ t(A.Provider, { value: { activeIndex: N, setActiveIndex: P, getItemProps: ee, setHasFocusInside: y, isOpen: s }, children: /* @__PURE__ */ t(pe, { elementsRef: H, labelsRef: T, children: s && /* @__PURE__ */ t(Ie, { children: /* @__PURE__ */ t(
118
118
  xe,
119
119
  {
120
120
  context: l,
121
121
  modal: !1,
122
122
  initialFocus: e ? -1 : 0,
123
- returnFocus: r ? F : !e,
123
+ returnFocus: r ? b : !e,
124
124
  children: /* @__PURE__ */ t(
125
125
  i,
126
126
  {
127
127
  ...Z(),
128
- ref: P.setFloating,
128
+ ref: w.setFloating,
129
129
  style: { ...n.style, ...B },
130
- className: w(
130
+ className: R(
131
131
  "isolate z-tooltip flex max-h-80 flex-col items-start overflow-y-auto rounded-lg border border-floating-border bg-floating-background text-left shadow-shadow-floating outline-none",
132
132
  d
133
133
  ),
@@ -139,7 +139,7 @@ const U = (o = "") => w(
139
139
  ] });
140
140
  }
141
141
  ), Te = M.forwardRef(
142
- ({ title: o, Right: i, disabled: g, children: h, ...r }, F) => {
142
+ ({ title: o, Right: i, disabled: g, children: F, ...r }, b) => {
143
143
  const d = G(A), v = $({ label: g ? null : o }), n = q(), c = v.index === d.activeIndex;
144
144
  return /* @__PURE__ */ x(
145
145
  "button",
@@ -152,7 +152,7 @@ const U = (o = "") => w(
152
152
  "data-active": c,
153
153
  "data-open": d.isOpen,
154
154
  tabIndex: c ? 0 : -1,
155
- ref: k(v.ref, F),
155
+ ref: k(v.ref, b),
156
156
  className: U(`${r.className ?? ""} ${c ? "bg-primary text-primary-foreground" : ""}`),
157
157
  ...d.getItemProps({
158
158
  onClick(s) {
@@ -163,13 +163,13 @@ const U = (o = "") => w(
163
163
  }
164
164
  }),
165
165
  children: [
166
- h,
166
+ F,
167
167
  i ? /* @__PURE__ */ t(i, { size: 16 }) : null
168
168
  ]
169
169
  }
170
170
  );
171
171
  }
172
- ), Le = M.forwardRef((o, i) => Y() === null ? /* @__PURE__ */ t(he, { children: /* @__PURE__ */ t(D, { ...o, isParent: !0, ref: i }) }) : /* @__PURE__ */ t(D, { ...o, isParent: !1, ref: i }));
172
+ ), Le = M.forwardRef((o, i) => Y() === null ? /* @__PURE__ */ t(Fe, { children: /* @__PURE__ */ t(D, { ...o, isParent: !0, ref: i }) }) : /* @__PURE__ */ t(D, { ...o, isParent: !1, ref: i }));
173
173
  export {
174
174
  Le as Menu,
175
175
  Te as MenuItem
@@ -1 +1 @@
1
- {"version":3,"file":"menu.js","sources":["../../../src/components/floating/menu.tsx"],"sourcesContent":["\"use client\";\nimport {\n autoUpdate,\n flip,\n FloatingFocusManager,\n FloatingList,\n FloatingNode,\n FloatingPortal,\n FloatingTree,\n offset,\n safePolygon,\n shift,\n useClick,\n useDismiss,\n useFloating,\n useFloatingNodeId,\n useFloatingParentNodeId,\n useFloatingTree,\n useHover,\n useInteractions,\n useListItem,\n useListNavigation,\n useRole,\n useTypeahead,\n} from \"@floating-ui/react\";\nimport { Slot } from \"../core/slot\";\nimport { ChevronRightIcon, LucideProps } from \"lucide-react\";\nimport React, { createContext, Fragment, useContext, useEffect, useRef, useState } from \"react\";\nimport { FLOATING_DELAY, TYPEAHEAD_RESET_DELAY } from \"../../constants\";\nimport { css, mergeRefs } from \"../../lib/dom\";\nimport { Override } from \"../../types\";\n\nconst menuItemClassName = (highlight: string = \"\") =>\n css(\n \"w-full min-w-36 outline-none p-2.5 items-center flex justify-between text-left\",\n \"hover:bg-primary focus:bg-primary aria-expanded:opacity-80\",\n \"focus:text-primary-foreground hover:text-primary-foreground\",\n \"first-of-type:rounded-t-lg last-of-type:rounded-b-lg\",\n \"disabled:opacity-40 disabled:cursor-not-allowed\",\n highlight\n );\n\nconst MenuContext = createContext<{\n activeIndex: number | null;\n getItemProps: (props?: React.HTMLProps<HTMLElement>) => Record<string, unknown>;\n isOpen: boolean;\n setActiveIndex: React.Dispatch<React.SetStateAction<number | null>>;\n setHasFocusInside: React.Dispatch<React.SetStateAction<boolean>>;\n}>({\n isOpen: false,\n activeIndex: null,\n getItemProps: () => ({}),\n setActiveIndex: () => {},\n setHasFocusInside: () => {},\n});\n\nexport type MenuProps = Partial<\n {\n hover: boolean;\n open?: boolean;\n nested: boolean;\n asChild: boolean;\n isParent: boolean;\n restoreFocus: boolean;\n children: React.ReactNode;\n floatingClassName: string;\n FloatingComponent: React.ElementType;\n } & ({ label: string } | { label: React.ReactElement; title: string })\n>;\n\nconst MenuComponent = React.forwardRef<HTMLButtonElement, Override<React.HTMLProps<HTMLButtonElement>, MenuProps>>(\n (\n { children, FloatingComponent = \"div\", hover = true, open, isParent = false, restoreFocus = false, floatingClassName = \"\", label, ...props },\n forwardedRef\n ) => {\n const [isOpen, setIsOpen] = useState<boolean>(open ?? false);\n const [hasFocusInside, setHasFocusInside] = useState(false);\n const [activeIndex, setActiveIndex] = useState<number | null>(null);\n const elementsRef = useRef<Array<HTMLButtonElement | null>>([]);\n const labelsRef = useRef<Array<string | null>>([]);\n const parent = useContext(MenuContext);\n\n const parentId = useFloatingParentNodeId();\n const tree = useFloatingTree();\n const nodeId = useFloatingNodeId();\n const item = useListItem();\n\n const isNested = parentId !== null;\n\n const { floatingStyles, refs, context } = useFloating<HTMLButtonElement>({\n nodeId,\n open: isOpen,\n transform: true,\n strategy: \"absolute\",\n onOpenChange: setIsOpen,\n whileElementsMounted: autoUpdate,\n placement: isNested ? \"right\" : \"bottom-start\",\n middleware: [offset({ mainAxis: isNested ? 0 : 4, alignmentAxis: isNested ? -4 : 0 }), flip(), shift()],\n });\n const role = useRole(context, { role: \"menu\" });\n const dismiss = useDismiss(context, { bubbles: true });\n const hoverModule = useHover(context, {\n move: false,\n enabled: hover,\n delay: { open: FLOATING_DELAY },\n handleClose: safePolygon({ blockPointerEvents: true, requireIntent: false }),\n });\n\n const click = useClick(context, {\n toggle: !isNested,\n event: \"mousedown\",\n ignoreMouse: isNested,\n keyboardHandlers: true,\n });\n\n const listNavigation = useListNavigation(context, {\n loop: true,\n activeIndex,\n nested: isNested,\n listRef: elementsRef,\n onNavigate: setActiveIndex,\n });\n\n const typeahead = useTypeahead(context, {\n activeIndex,\n listRef: labelsRef,\n resetMs: TYPEAHEAD_RESET_DELAY,\n onMatch: isOpen ? setActiveIndex : undefined,\n });\n\n const { getReferenceProps, getFloatingProps, getItemProps } = useInteractions([hoverModule, click, role, dismiss, listNavigation, typeahead]);\n\n useEffect(() => {\n if (!tree) return;\n const handleTreeClick = () => setIsOpen(false);\n const onSubMenuOpen = (event: { nodeId: string; parentId: string }) => {\n if (event.nodeId !== nodeId && event.parentId === parentId) setIsOpen(false);\n };\n tree.events.on(\"click\", handleTreeClick);\n tree.events.on(\"menuopen\", onSubMenuOpen);\n return () => {\n tree.events.off(\"click\", handleTreeClick);\n tree.events.off(\"menuopen\", onSubMenuOpen);\n };\n }, [tree, nodeId, parentId]);\n\n useEffect(() => {\n if (isOpen && tree) tree.events.emit(\"menuopen\", { parentId, nodeId });\n }, [tree, isOpen, nodeId, parentId]);\n\n const className = isParent ? props.className : css(menuItemClassName(props.className));\n\n return (\n <FloatingNode id={nodeId}>\n <Fragment>\n {props.asChild ? (\n <Slot\n {...getReferenceProps(\n parent.getItemProps({\n ...props,\n onFocus(event: React.FocusEvent<HTMLButtonElement>) {\n props.onFocus?.(event);\n setHasFocusInside(false);\n parent.setHasFocusInside(true);\n },\n })\n )}\n children={label}\n className={className}\n data-open={isOpen ? \"\" : undefined}\n data-nested={isNested ? \"\" : undefined}\n role={isNested ? \"menuitem\" : undefined}\n data-focus-inside={hasFocusInside ? \"\" : undefined}\n ref={mergeRefs(refs.setReference, item.ref, forwardedRef) as any}\n tabIndex={!isNested ? undefined : parent.activeIndex === item.index ? 0 : -1}\n />\n ) : (\n <button\n type=\"button\"\n className={className}\n data-open={isOpen ? \"\" : undefined}\n data-nested={isNested ? \"\" : undefined}\n role={isNested ? \"menuitem\" : undefined}\n data-focus-inside={hasFocusInside ? \"\" : undefined}\n ref={mergeRefs(refs.setReference, item.ref, forwardedRef)}\n tabIndex={!isNested ? undefined : parent.activeIndex === item.index ? 0 : -1}\n {...getReferenceProps(\n parent.getItemProps({\n ...props,\n onFocus(event: React.FocusEvent<HTMLButtonElement>) {\n props.onFocus?.(event);\n setHasFocusInside(false);\n parent.setHasFocusInside(true);\n },\n })\n )}\n >\n {label}\n {isNested && (\n <span style={{ marginLeft: 10, fontSize: 10 }}>\n <span className=\"sr-only\">Next menu</span>\n <ChevronRightIcon size={14} />\n </span>\n )}\n </button>\n )}\n </Fragment>\n <MenuContext.Provider value={{ activeIndex, setActiveIndex, getItemProps, setHasFocusInside, isOpen } as any}>\n <FloatingList elementsRef={elementsRef} labelsRef={labelsRef}>\n {isOpen && (\n <FloatingPortal>\n <FloatingFocusManager\n context={context}\n modal={false}\n initialFocus={isNested ? -1 : 0}\n returnFocus={isParent ? restoreFocus : !isNested}\n >\n <FloatingComponent\n {...getFloatingProps()}\n ref={refs.setFloating}\n style={{ ...props.style, ...floatingStyles }}\n className={css(\n \"isolate z-tooltip flex max-h-80 flex-col items-start overflow-y-auto rounded-lg border border-floating-border bg-floating-background text-left shadow-shadow-floating outline-none\",\n floatingClassName\n )}\n >\n {children}\n </FloatingComponent>\n </FloatingFocusManager>\n </FloatingPortal>\n )}\n </FloatingList>\n </MenuContext.Provider>\n </FloatingNode>\n );\n }\n);\n\ntype MenuItemProps = { title: string; disabled?: boolean; Right?: React.FC<LucideProps> };\n\nexport const MenuItem = React.forwardRef<HTMLButtonElement, Override<React.ButtonHTMLAttributes<HTMLButtonElement>, MenuItemProps>>(\n ({ title, Right, disabled, children, ...props }, forwardedRef) => {\n const menu = useContext(MenuContext);\n const item = useListItem({ label: disabled ? null : title });\n const tree = useFloatingTree();\n const isActive = item.index === menu.activeIndex;\n return (\n <button\n {...props}\n title={title}\n type=\"button\"\n role=\"menuitem\"\n disabled={disabled}\n data-active={isActive}\n data-open={menu.isOpen}\n tabIndex={isActive ? 0 : -1}\n ref={mergeRefs(item.ref, forwardedRef)}\n className={menuItemClassName(`${props.className ?? \"\"} ${isActive ? \"bg-primary text-primary-foreground\" : \"\"}`)}\n {...menu.getItemProps({\n onClick(event: React.MouseEvent<HTMLButtonElement>) {\n props.onClick?.(event);\n tree?.events.emit(\"click\");\n },\n onFocus(event: React.FocusEvent<HTMLButtonElement>) {\n props.onFocus?.(event);\n menu.setHasFocusInside(true);\n },\n })}\n >\n {children}\n {Right ? <Right size={16} /> : null}\n </button>\n );\n }\n);\n\nexport const Menu = React.forwardRef<HTMLButtonElement, Override<React.ComponentProps<\"button\">, MenuProps>>((props, ref) => {\n const parentId = useFloatingParentNodeId();\n return parentId === null ? (\n <FloatingTree>\n <MenuComponent {...props} isParent ref={ref} />\n </FloatingTree>\n ) : (\n <MenuComponent {...props} isParent={false} ref={ref} />\n );\n});\n"],"names":["menuItemClassName","highlight","css","MenuContext","createContext","MenuComponent","React","children","FloatingComponent","hover","open","isParent","restoreFocus","floatingClassName","label","props","forwardedRef","isOpen","setIsOpen","useState","hasFocusInside","setHasFocusInside","activeIndex","setActiveIndex","elementsRef","useRef","labelsRef","parent","useContext","parentId","useFloatingParentNodeId","tree","useFloatingTree","nodeId","useFloatingNodeId","item","useListItem","isNested","floatingStyles","refs","context","useFloating","autoUpdate","offset","flip","shift","role","useRole","dismiss","useDismiss","hoverModule","useHover","FLOATING_DELAY","safePolygon","click","useClick","listNavigation","useListNavigation","typeahead","useTypeahead","TYPEAHEAD_RESET_DELAY","getReferenceProps","getFloatingProps","getItemProps","useInteractions","useEffect","handleTreeClick","onSubMenuOpen","event","className","jsxs","FloatingNode","jsx","Fragment","Slot","mergeRefs","ChevronRightIcon","FloatingList","FloatingPortal","FloatingFocusManager","MenuItem","title","Right","disabled","menu","isActive","Menu","ref","FloatingTree"],"mappings":";;;;;;;AAgCA,MAAMA,IAAoB,CAACC,IAAoB,OAC3CC;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACAD;AACJ,GAEEE,IAAcC,GAMjB;AAAA,EACC,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,cAAc,OAAO,CAAA;AAAA,EACrB,gBAAgB,MAAM;AAAA,EAAA;AAAA,EACtB,mBAAmB,MAAM;AAAA,EAAA;AAC7B,CAAC,GAgBKC,IAAgBC,EAAM;AAAA,EACxB,CACI,EAAE,UAAAC,GAAU,mBAAAC,IAAoB,OAAO,OAAAC,IAAQ,IAAM,MAAAC,GAAM,UAAAC,IAAW,IAAO,cAAAC,IAAe,IAAO,mBAAAC,IAAoB,IAAI,OAAAC,GAAO,GAAGC,EAAA,GACrIC,MACC;AACD,UAAM,CAACC,GAAQC,CAAS,IAAIC,EAAkBT,KAAQ,EAAK,GACrD,CAACU,GAAgBC,CAAiB,IAAIF,EAAS,EAAK,GACpD,CAACG,GAAaC,CAAc,IAAIJ,EAAwB,IAAI,GAC5DK,IAAcC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,aAAa;AAAA,UAClB,QAAQhB,GAA4C;AAChD,YAAArD,EAAM,UAAUqD,CAAK,GACrBrC,GAAM,OAAO,KAAK,OAAO;AAAA,UAAA;AAAA,UAE7B,QAAQqC,GAA4C;AAChD,YAAArD,EAAM,UAAUqD,CAAK,GACrBgB,EAAK,kBAAkB,EAAI;AAAA,UAAA;AAAA,QAC/B,CACH;AAAA,QAEA,UAAA;AAAA,UAAA7E;AAAA,UACA2E,IAAQ,gBAAAV,EAACU,GAAA,EAAM,MAAM,IAAI,IAAK;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACnC;AAGZ,GAEaI,KAAOhF,EAAM,WAAmF,CAACS,GAAOwE,MAChGzD,EAAA,MACG,OAChB,gBAAA0C,EAACgB,MACG,UAAA,gBAAAhB,EAACnE,GAAA,EAAe,GAAGU,GAAO,UAAQ,IAAC,KAAAwE,GAAU,EAAA,CACjD,IAEA,gBAAAf,EAACnE,GAAA,EAAe,GAAGU,GAAO,UAAU,IAAO,KAAAwE,GAAU,CAE5D;"}
1
+ {"version":3,"file":"menu.js","sources":["../../../src/components/floating/menu.tsx"],"sourcesContent":["\"use client\";\nimport {\n autoUpdate,\n flip,\n FloatingFocusManager,\n FloatingList,\n FloatingNode,\n FloatingPortal,\n FloatingTree,\n offset,\n safePolygon,\n shift,\n useClick,\n useDismiss,\n useFloating,\n useFloatingNodeId,\n useFloatingParentNodeId,\n useFloatingTree,\n useHover,\n useInteractions,\n useListItem,\n useListNavigation,\n useRole,\n useTypeahead,\n} from \"@floating-ui/react\";\nimport { Slot } from \"../core/slot\";\nimport { CaretRightIcon, type Icon } from \"@phosphor-icons/react\";\nimport React, { createContext, Fragment, useContext, useEffect, useRef, useState } from \"react\";\nimport { FLOATING_DELAY, TYPEAHEAD_RESET_DELAY } from \"../../constants\";\nimport { css, mergeRefs } from \"../../lib/dom\";\nimport { Override } from \"../../types\";\n\nconst menuItemClassName = (highlight: string = \"\") =>\n css(\n \"w-full min-w-36 outline-none p-2.5 items-center flex justify-between text-left\",\n \"hover:bg-primary focus:bg-primary aria-expanded:opacity-80\",\n \"focus:text-primary-foreground hover:text-primary-foreground\",\n \"first-of-type:rounded-t-lg last-of-type:rounded-b-lg\",\n \"disabled:opacity-40 disabled:cursor-not-allowed\",\n highlight\n );\n\nconst MenuContext = createContext<{\n activeIndex: number | null;\n getItemProps: (props?: React.HTMLProps<HTMLElement>) => Record<string, unknown>;\n isOpen: boolean;\n setActiveIndex: React.Dispatch<React.SetStateAction<number | null>>;\n setHasFocusInside: React.Dispatch<React.SetStateAction<boolean>>;\n}>({\n isOpen: false,\n activeIndex: null,\n getItemProps: () => ({}),\n setActiveIndex: () => {},\n setHasFocusInside: () => {},\n});\n\nexport type MenuProps = Partial<\n {\n hover: boolean;\n open?: boolean;\n nested: boolean;\n asChild: boolean;\n isParent: boolean;\n restoreFocus: boolean;\n children: React.ReactNode;\n floatingClassName: string;\n FloatingComponent: React.ElementType;\n } & ({ label: string } | { label: React.ReactElement; title: string })\n>;\n\nconst MenuComponent = React.forwardRef<HTMLButtonElement, Override<React.HTMLProps<HTMLButtonElement>, MenuProps>>(\n (\n { children, FloatingComponent = \"div\", hover = true, open, isParent = false, restoreFocus = false, floatingClassName = \"\", label, ...props },\n forwardedRef\n ) => {\n const [isOpen, setIsOpen] = useState<boolean>(open ?? false);\n const [hasFocusInside, setHasFocusInside] = useState(false);\n const [activeIndex, setActiveIndex] = useState<number | null>(null);\n const elementsRef = useRef<Array<HTMLButtonElement | null>>([]);\n const labelsRef = useRef<Array<string | null>>([]);\n const parent = useContext(MenuContext);\n\n const parentId = useFloatingParentNodeId();\n const tree = useFloatingTree();\n const nodeId = useFloatingNodeId();\n const item = useListItem();\n\n const isNested = parentId !== null;\n\n const { floatingStyles, refs, context } = useFloating<HTMLButtonElement>({\n nodeId,\n open: isOpen,\n transform: true,\n strategy: \"absolute\",\n onOpenChange: setIsOpen,\n whileElementsMounted: autoUpdate,\n placement: isNested ? \"right\" : \"bottom-start\",\n middleware: [offset({ mainAxis: isNested ? 0 : 4, alignmentAxis: isNested ? -4 : 0 }), flip(), shift()],\n });\n const role = useRole(context, { role: \"menu\" });\n const dismiss = useDismiss(context, { bubbles: true });\n const hoverModule = useHover(context, {\n move: false,\n enabled: hover,\n delay: { open: FLOATING_DELAY },\n handleClose: safePolygon({ blockPointerEvents: true, requireIntent: false }),\n });\n\n const click = useClick(context, {\n toggle: !isNested,\n event: \"mousedown\",\n ignoreMouse: isNested,\n keyboardHandlers: true,\n });\n\n const listNavigation = useListNavigation(context, {\n loop: true,\n activeIndex,\n nested: isNested,\n listRef: elementsRef,\n onNavigate: setActiveIndex,\n });\n\n const typeahead = useTypeahead(context, {\n activeIndex,\n listRef: labelsRef,\n resetMs: TYPEAHEAD_RESET_DELAY,\n onMatch: isOpen ? setActiveIndex : undefined,\n });\n\n const { getReferenceProps, getFloatingProps, getItemProps } = useInteractions([hoverModule, click, role, dismiss, listNavigation, typeahead]);\n\n useEffect(() => {\n if (!tree) return;\n const handleTreeClick = () => setIsOpen(false);\n const onSubMenuOpen = (event: { nodeId: string; parentId: string }) => {\n if (event.nodeId !== nodeId && event.parentId === parentId) setIsOpen(false);\n };\n tree.events.on(\"click\", handleTreeClick);\n tree.events.on(\"menuopen\", onSubMenuOpen);\n return () => {\n tree.events.off(\"click\", handleTreeClick);\n tree.events.off(\"menuopen\", onSubMenuOpen);\n };\n }, [tree, nodeId, parentId]);\n\n useEffect(() => {\n if (isOpen && tree) tree.events.emit(\"menuopen\", { parentId, nodeId });\n }, [tree, isOpen, nodeId, parentId]);\n\n const className = isParent ? props.className : css(menuItemClassName(props.className));\n\n return (\n <FloatingNode id={nodeId}>\n <Fragment>\n {props.asChild ? (\n <Slot\n {...getReferenceProps(\n parent.getItemProps({\n ...props,\n onFocus(event: React.FocusEvent<HTMLButtonElement>) {\n props.onFocus?.(event);\n setHasFocusInside(false);\n parent.setHasFocusInside(true);\n },\n })\n )}\n children={label}\n className={className}\n data-open={isOpen ? \"\" : undefined}\n data-nested={isNested ? \"\" : undefined}\n role={isNested ? \"menuitem\" : undefined}\n data-focus-inside={hasFocusInside ? \"\" : undefined}\n ref={mergeRefs(refs.setReference, item.ref, forwardedRef) as any}\n tabIndex={!isNested ? undefined : parent.activeIndex === item.index ? 0 : -1}\n />\n ) : (\n <button\n type=\"button\"\n className={className}\n data-open={isOpen ? \"\" : undefined}\n data-nested={isNested ? \"\" : undefined}\n role={isNested ? \"menuitem\" : undefined}\n data-focus-inside={hasFocusInside ? \"\" : undefined}\n ref={mergeRefs(refs.setReference, item.ref, forwardedRef)}\n tabIndex={!isNested ? undefined : parent.activeIndex === item.index ? 0 : -1}\n {...getReferenceProps(\n parent.getItemProps({\n ...props,\n onFocus(event: React.FocusEvent<HTMLButtonElement>) {\n props.onFocus?.(event);\n setHasFocusInside(false);\n parent.setHasFocusInside(true);\n },\n })\n )}\n >\n {label}\n {isNested && (\n <span style={{ marginLeft: 10, fontSize: 10 }}>\n <span className=\"sr-only\">Next menu</span>\n <CaretRightIcon size={14} />\n </span>\n )}\n </button>\n )}\n </Fragment>\n <MenuContext.Provider value={{ activeIndex, setActiveIndex, getItemProps, setHasFocusInside, isOpen } as any}>\n <FloatingList elementsRef={elementsRef} labelsRef={labelsRef}>\n {isOpen && (\n <FloatingPortal>\n <FloatingFocusManager\n context={context}\n modal={false}\n initialFocus={isNested ? -1 : 0}\n returnFocus={isParent ? restoreFocus : !isNested}\n >\n <FloatingComponent\n {...getFloatingProps()}\n ref={refs.setFloating}\n style={{ ...props.style, ...floatingStyles }}\n className={css(\n \"isolate z-tooltip flex max-h-80 flex-col items-start overflow-y-auto rounded-lg border border-floating-border bg-floating-background text-left shadow-shadow-floating outline-none\",\n floatingClassName\n )}\n >\n {children}\n </FloatingComponent>\n </FloatingFocusManager>\n </FloatingPortal>\n )}\n </FloatingList>\n </MenuContext.Provider>\n </FloatingNode>\n );\n }\n);\n\ntype MenuItemProps = { title: string; disabled?: boolean; Right?: Icon };\n\nexport const MenuItem = React.forwardRef<HTMLButtonElement, Override<React.ButtonHTMLAttributes<HTMLButtonElement>, MenuItemProps>>(\n ({ title, Right, disabled, children, ...props }, forwardedRef) => {\n const menu = useContext(MenuContext);\n const item = useListItem({ label: disabled ? null : title });\n const tree = useFloatingTree();\n const isActive = item.index === menu.activeIndex;\n return (\n <button\n {...props}\n title={title}\n type=\"button\"\n role=\"menuitem\"\n disabled={disabled}\n data-active={isActive}\n data-open={menu.isOpen}\n tabIndex={isActive ? 0 : -1}\n ref={mergeRefs(item.ref, forwardedRef)}\n className={menuItemClassName(`${props.className ?? \"\"} ${isActive ? \"bg-primary text-primary-foreground\" : \"\"}`)}\n {...menu.getItemProps({\n onClick(event: React.MouseEvent<HTMLButtonElement>) {\n props.onClick?.(event);\n tree?.events.emit(\"click\");\n },\n onFocus(event: React.FocusEvent<HTMLButtonElement>) {\n props.onFocus?.(event);\n menu.setHasFocusInside(true);\n },\n })}\n >\n {children}\n {Right ? <Right size={16} /> : null}\n </button>\n );\n }\n);\n\nexport const Menu = React.forwardRef<HTMLButtonElement, Override<React.ComponentProps<\"button\">, MenuProps>>((props, ref) => {\n const parentId = useFloatingParentNodeId();\n return parentId === null ? (\n <FloatingTree>\n <MenuComponent {...props} isParent ref={ref} />\n </FloatingTree>\n ) : (\n <MenuComponent {...props} isParent={false} ref={ref} />\n );\n});\n"],"names":["menuItemClassName","highlight","css","MenuContext","createContext","MenuComponent","React","children","FloatingComponent","hover","open","isParent","restoreFocus","floatingClassName","label","props","forwardedRef","isOpen","setIsOpen","useState","hasFocusInside","setHasFocusInside","activeIndex","setActiveIndex","elementsRef","useRef","labelsRef","parent","useContext","parentId","useFloatingParentNodeId","tree","useFloatingTree","nodeId","useFloatingNodeId","item","useListItem","isNested","floatingStyles","refs","context","useFloating","autoUpdate","offset","flip","shift","role","useRole","dismiss","useDismiss","hoverModule","useHover","FLOATING_DELAY","safePolygon","click","useClick","listNavigation","useListNavigation","typeahead","useTypeahead","TYPEAHEAD_RESET_DELAY","getReferenceProps","getFloatingProps","getItemProps","useInteractions","useEffect","handleTreeClick","onSubMenuOpen","event","className","jsxs","FloatingNode","jsx","Fragment","Slot","mergeRefs","CaretRightIcon","FloatingList","FloatingPortal","FloatingFocusManager","MenuItem","title","Right","disabled","menu","isActive","Menu","ref","FloatingTree"],"mappings":";;;;;;;AAgCA,MAAMA,IAAoB,CAACC,IAAoB,OAC3CC;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACAD;AACJ,GAEEE,IAAcC,GAMjB;AAAA,EACC,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,cAAc,OAAO,CAAA;AAAA,EACrB,gBAAgB,MAAM;AAAA,EAAA;AAAA,EACtB,mBAAmB,MAAM;AAAA,EAAA;AAC7B,CAAC,GAgBKC,IAAgBC,EAAM;AAAA,EACxB,CACI,EAAE,UAAAC,GAAU,mBAAAC,IAAoB,OAAO,OAAAC,IAAQ,IAAM,MAAAC,GAAM,UAAAC,IAAW,IAAO,cAAAC,IAAe,IAAO,mBAAAC,IAAoB,IAAI,OAAAC,GAAO,GAAGC,EAAA,GACrIC,MACC;AACD,UAAM,CAACC,GAAQC,CAAS,IAAIC,EAAkBT,KAAQ,EAAK,GACrD,CAACU,GAAgBC,CAAiB,IAAIF,EAAS,EAAK,GACpD,CAACG,GAAaC,CAAc,IAAIJ,EAAwB,IAAI,GAC5DK,IAAcC,EAAwC,EAAE,GACxDC,IAAYD,EAA6B,EAAE,GAC3CE,IAASC,EAAWzB,CAAW,GAE/B0B,IAAWC,EAAA,GACXC,IAAOC,EAAA,GACPC,IAASC,GAAA,GACTC,IAAOC,EAAA,GAEPC,IAAWR,MAAa,MAExB,EAAE,gBAAAS,GAAgB,MAAAC,GAAM,SAAAC,EAAA,IAAYC,GAA+B;AAAA,MACrE,QAAAR;AAAA,MACA,MAAMhB;AAAA,MACN,WAAW;AAAA,MACX,UAAU;AAAA,MACV,cAAcC;AAAA,MACd,sBAAsBwB;AA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A;AAAA,IAAA;AAAA,EACnC;AAGZ,GAEaI,KAAOhF,EAAM,WAAmF,CAACS,GAAOwE,MAChGzD,EAAA,MACG,OAChB,gBAAA0C,EAACgB,MACG,UAAA,gBAAAhB,EAACnE,GAAA,EAAe,GAAGU,GAAO,UAAQ,IAAC,KAAAwE,GAAU,EAAA,CACjD,IAEA,gBAAAf,EAACnE,GAAA,EAAe,GAAGU,GAAO,UAAU,IAAO,KAAAwE,GAAU,CAE5D;"}
@@ -1,33 +1,33 @@
1
1
  import { jsxs as F, jsx as t } from "react/jsx-runtime";
2
- import { u as Re, n as Pe, d as ke, i as Le, c as Te, F as De, k as Ee, l as Ne } from "../../floating-ui.react-DycKASR0.js";
2
+ import { u as Pe, n as Re, d as ke, i as Le, c as Te, F as De, k as Ee, l as Ne } from "../../floating-ui.react-QNHG9W4N.js";
3
3
  import { c as Fe } from "../../index-DJSMaZR4.js";
4
- import { S as He } from "../../slot-CQW8ZzBb.js";
5
- import $, { useState as E, useLayoutEffect as Oe, useContext as Se, forwardRef as ze, useRef as L, useId as J, useEffect as _, useImperativeHandle as Ie, Fragment as Ye, useCallback as je } from "react";
6
- import { i as Be } from "../../fns-D2eyJKd5.js";
7
- import { c as N, m as Ae } from "../../dom-Dl8XH0CK.js";
8
- import { C as Ge } from "../../context-BFXNJVn2.js";
9
- import { Button as U } from "../core/button.js";
10
- import { m as R, A as W } from "../../proxy-BZcQiBrp.js";
4
+ import { e as He } from "../../X.es-BJ1O93El.js";
5
+ import { S as Oe } from "../../slot-CRyweuj0.js";
6
+ import $, { useState as E, useLayoutEffect as Se, useContext as ze, forwardRef as Ie, useRef as L, useId as U, useEffect as _, useImperativeHandle as Ye, Fragment as je, useCallback as Be } from "react";
7
+ import { i as Ae } from "../../fns-D2eyJKd5.js";
8
+ import { c as N, m as Ge } from "../../dom-Dl8XH0CK.js";
9
+ import { C as Ke } from "../../context-BFXNJVn2.js";
10
+ import { Button as W } from "../core/button.js";
11
+ import { m as P, A as X } from "../../proxy-BZcQiBrp.js";
11
12
  import { a as Z } from "../../index-t1qLJTt5.js";
12
- import { X as Ke } from "../../x-B9bYxG31.js";
13
13
  import { u as T } from "../../use-motion-value-eGwNuWuw.js";
14
14
  import { M as Qe } from "../../index-0YMC-_Lt.js";
15
- const Ve = (e, r) => Be() ? r : window.matchMedia(e).matches, Xe = (e, r = !0) => {
15
+ const Ve = (e, r) => Ae() ? r : window.matchMedia(e).matches, Je = (e, r = !0) => {
16
16
  const [a, o] = E(r);
17
- return Oe(() => {
17
+ return Se(() => {
18
18
  const n = window.matchMedia(e), i = () => o(Ve(e, r));
19
19
  return i(), n.addListener ? (n.addListener(i), () => n.removeListener ? n.removeListener(i) : void 0) : (n.addEventListener("change", i), () => n.removeEventListener("change", i));
20
20
  }, [e]), a;
21
- }, Je = () => Se(Ge).floatingRef ?? void 0, q = $.createContext(async () => !1), ht = () => $.useContext(q), s = "500ms", Ue = {
21
+ }, Ue = () => ze(Ke).floatingRef ?? void 0, q = $.createContext(async () => !1), ht = () => $.useContext(q), s = "500ms", We = {
22
22
  exit: { x: ["0%", "-30%"], opacity: 0, animationDuration: s },
23
23
  enter: { x: ["-30%", "0%"], opacity: 1, animationDuration: s },
24
24
  initial: { x: ["-30%", "0%"], opacity: 0.8, animationDuration: s }
25
- }, We = {
25
+ }, Xe = {
26
26
  enter: { x: "0%", opacity: 1, animationDuration: s },
27
27
  exit: { x: ["0%", "30%"], opacity: 0, animationDuration: s },
28
28
  initial: { x: ["30%", "0%"], opacity: 0.8, animationDuration: s }
29
29
  }, B = {
30
- drawer: (e) => e === "left" ? Ue : We,
30
+ drawer: (e) => e === "left" ? We : Xe,
31
31
  sheet: {
32
32
  enter: { opacity: 1, y: "0%", animationDuration: s, transformOrigin: "bottom" },
33
33
  exit: { opacity: 0.4, y: "10%", animationDuration: s, transformOrigin: "bottom" },
@@ -67,7 +67,7 @@ const Ve = (e, r) => Be() ? r : window.matchMedia(e).matches, Xe = (e, r = !0) =
67
67
  }
68
68
  };
69
69
  return /* @__PURE__ */ t(
70
- R.button,
70
+ P.button,
71
71
  {
72
72
  draggable: !0,
73
73
  dragListener: !0,
@@ -94,7 +94,7 @@ const Ve = (e, r) => Be() ? r : window.matchMedia(e).matches, Xe = (e, r = !0) =
94
94
  }, D = { drawer: "right", sheet: "none", dialog: "none" }, _e = (e, r, a, o) => {
95
95
  const n = a || "dialog";
96
96
  return e ? a === "drawer" ? o ?? D.drawer : D[n] : r ? D[n] : D.sheet;
97
- }, qe = [], oe = ze(
97
+ }, qe = [], oe = Ie(
98
98
  ({
99
99
  open: e,
100
100
  title: r,
@@ -104,7 +104,7 @@ const Ve = (e, r) => Be() ? r : window.matchMedia(e).matches, Xe = (e, r = !0) =
104
104
  children: i,
105
105
  onChange: l,
106
106
  ariaTitle: p,
107
- className: P,
107
+ className: R,
108
108
  bodyClassName: w,
109
109
  resizer: d = !0,
110
110
  animated: v = !0,
@@ -119,7 +119,7 @@ const Ve = (e, r) => Be() ? r : window.matchMedia(e).matches, Xe = (e, r = !0) =
119
119
  interactions: ce = qe,
120
120
  ...le
121
121
  }, de) => {
122
- const ue = Je(), G = L(null), O = L(null), K = J(), ge = J(), S = Xe("(min-width: 64rem)"), z = _e(S, C, M, ae), I = S || C ? B[M] : B.sheet, fe = typeof I == "function" ? I(z) : I, g = S || C ? M : "sheet", me = g !== "dialog", c = Re({ open: e, onOpenChange: l, strategy: "fixed" }), he = Pe(c.context, {}), pe = ke(c.context, { role: "dialog" }), ve = Le(c.context, {
122
+ const ue = Ue(), G = L(null), O = L(null), K = U(), ge = U(), S = Je("(min-width: 64rem)"), z = _e(S, C, M, ae), I = S || C ? B[M] : B.sheet, fe = typeof I == "function" ? I(z) : I, g = S || C ? M : "sheet", me = g !== "dialog", c = Pe({ open: e, onOpenChange: l, strategy: "fixed" }), he = Re(c.context, {}), pe = ke(c.context, { role: "dialog" }), ve = Le(c.context, {
123
123
  bubbles: !0,
124
124
  escapeKey: !0,
125
125
  outsidePress: (h) => {
@@ -131,7 +131,7 @@ const Ve = (e, r) => Be() ? r : window.matchMedia(e).matches, Xe = (e, r = !0) =
131
131
  f.set(void 0), m.set(void 0);
132
132
  }, [g, f, m]);
133
133
  const be = () => l(!1);
134
- Ie(de, () => ({ context: c.context, floating: O.current }), [
134
+ Ye(de, () => ({ context: c.context, floating: O.current }), [
135
135
  c.context,
136
136
  O
137
137
  ]);
@@ -152,10 +152,10 @@ const Ve = (e, r) => Be() ? r : window.matchMedia(e).matches, Xe = (e, r = !0) =
152
152
  dragSnapToOrigin: !0,
153
153
  dragDirectionLock: !0,
154
154
  whileDrag: { cursor: "grabbing" }
155
- } : { animate: v, initial: !1 }, X = T(void 0), k = T(void 0), we = o ? He : R.button;
156
- return /* @__PURE__ */ F(Ye, { children: [
155
+ } : { animate: v, initial: !1 }, J = T(void 0), k = T(void 0), we = o ? Oe : P.button;
156
+ return /* @__PURE__ */ F(je, { children: [
157
157
  n ? /* @__PURE__ */ t(we, { ref: c.refs.setReference, ...Q.getReferenceProps(), layoutId: A, type: "button", children: xe }) : null,
158
- /* @__PURE__ */ t(Qe, { reducedMotion: v ? "user" : "always", children: /* @__PURE__ */ t(De, { preserveTabOrder: !0, root: ue, children: /* @__PURE__ */ t(W, { mode: "wait", propagate: !0, children: e ? /* @__PURE__ */ t(
158
+ /* @__PURE__ */ t(Qe, { reducedMotion: v ? "user" : "always", children: /* @__PURE__ */ t(De, { preserveTabOrder: !0, root: ue, children: /* @__PURE__ */ t(X, { mode: "wait", propagate: !0, children: e ? /* @__PURE__ */ t(
159
159
  Ee,
160
160
  {
161
161
  lockScroll: !0,
@@ -164,8 +164,8 @@ const Ve = (e, r) => Be() ? r : window.matchMedia(e).matches, Xe = (e, r = !0) =
164
164
  g === "drawer" ? "" : "items-start justify-center pt-10 lg:p-10",
165
165
  re
166
166
  ),
167
- children: /* @__PURE__ */ t(Ne, { guards: !0, modal: !0, closeOnFocusOut: se, context: c.context, children: /* @__PURE__ */ t(W, { propagate: !0, children: /* @__PURE__ */ F(
168
- R.div,
167
+ children: /* @__PURE__ */ t(Ne, { guards: !0, modal: !0, closeOnFocusOut: se, context: c.context, children: /* @__PURE__ */ t(X, { propagate: !0, children: /* @__PURE__ */ F(
168
+ P.div,
169
169
  {
170
170
  ...le,
171
171
  ...r ? {
@@ -174,8 +174,8 @@ const Ve = (e, r) => Be() ? r : window.matchMedia(e).matches, Xe = (e, r = !0) =
174
174
  } : { "aria-label": p },
175
175
  ...Q.getFloatingProps({
176
176
  "aria-modal": e,
177
- ref: Ae(c.refs.setFloating, O),
178
- className: N(Ze({ position: z, type: g }), P, "isolate overscroll-contain")
177
+ ref: Ge(c.refs.setFloating, O),
178
+ className: N(Ze({ position: z, type: g }), R, "isolate overscroll-contain")
179
179
  }),
180
180
  exit: "exit",
181
181
  layout: !0,
@@ -196,7 +196,7 @@ const Ve = (e, r) => Be() ? r : window.matchMedia(e).matches, Xe = (e, r = !0) =
196
196
  parent: c.refs.floating
197
197
  }
198
198
  ) : null,
199
- r ? /* @__PURE__ */ t(R.header, { ...ye, className: "relative isolate w-full", children: r ? /* @__PURE__ */ t(
199
+ r ? /* @__PURE__ */ t(P.header, { ...ye, className: "relative isolate w-full", children: r ? /* @__PURE__ */ t(
200
200
  "h2",
201
201
  {
202
202
  id: K,
@@ -205,20 +205,20 @@ const Ve = (e, r) => Be() ? r : window.matchMedia(e).matches, Xe = (e, r = !0) =
205
205
  }
206
206
  ) : null }) : null,
207
207
  /* @__PURE__ */ t(
208
- R.section,
208
+ P.section,
209
209
  {
210
210
  ref: G,
211
211
  "data-component": "modal-body",
212
212
  className: N("flex-1 select-text overflow-y-auto px-8 py-1", w),
213
213
  onTouchEnd: async () => {
214
- if (k.set(void 0), X.set(void 0), x.current) {
214
+ if (k.set(void 0), J.set(void 0), x.current) {
215
215
  const h = m.get() || 0, u = window.innerHeight * 0.2;
216
216
  h > u ? (await Z(m, window.innerHeight, { duration: 0.2, ease: "easeIn" }).finished, l(!1)) : Z(m, 0, { type: "spring", bounce: 0, duration: 0.3 }), x.current = !1;
217
217
  }
218
218
  },
219
219
  onTouchStart: (h) => {
220
220
  const u = h.changedTouches[0];
221
- X.set(u.pageY), k.set(u.pageY), x.current = !1;
221
+ J.set(u.pageY), k.set(u.pageY), x.current = !1;
222
222
  },
223
223
  onTouchMove: (h) => {
224
224
  const b = h.changedTouches[0].pageY, Y = k.get() || b, j = G.current?.scrollTop || 0;
@@ -238,7 +238,7 @@ const Ve = (e, r) => Be() ? r : window.matchMedia(e).matches, Xe = (e, r = !0) =
238
238
  type: "button",
239
239
  onClick: be,
240
240
  className: "p-1 opacity-70 transition-colors hover:text-danger hover:opacity-100 focus:text-danger",
241
- children: /* @__PURE__ */ t(Ke, {})
241
+ children: /* @__PURE__ */ t(He, {})
242
242
  }
243
243
  ) }) : null
244
244
  ]
@@ -253,13 +253,13 @@ let ne = async (e) => (typeof window < "u" && console.warn("ConfirmationProvider
253
253
  oe.confirm = (e) => ne(e);
254
254
  const pt = ({ children: e }) => {
255
255
  const [r, a] = E(!1), [o, n] = E({}), [i, l] = E(() => {
256
- }), p = je((d) => (n(d), a(!0), new Promise((v) => {
256
+ }), p = Be((d) => (n(d), a(!0), new Promise((v) => {
257
257
  l(() => v);
258
258
  })), []);
259
259
  _(() => {
260
260
  ne = p;
261
261
  }, [p]);
262
- const P = () => {
262
+ const R = () => {
263
263
  a(!1);
264
264
  const d = o.confirm?.value ?? !0;
265
265
  i(d ?? !0);
@@ -281,8 +281,8 @@ const pt = ({ children: e }) => {
281
281
  title: o.title || "Confirmation",
282
282
  className: "container max-w-dialog lg:max-w-96",
283
283
  footer: /* @__PURE__ */ F("div", { className: "flex justify-end gap-2", children: [
284
- /* @__PURE__ */ t(U, { theme: o.cancel?.theme || "ghost-muted", onClick: w, children: o.cancel?.text || "Cancel" }),
285
- /* @__PURE__ */ t(U, { autoFocus: !0, theme: o.confirm?.theme || "primary", onClick: P, children: o.confirm?.text || "Confirm" })
284
+ /* @__PURE__ */ t(W, { theme: o.cancel?.theme || "ghost-muted", onClick: w, children: o.cancel?.text || "Cancel" }),
285
+ /* @__PURE__ */ t(W, { autoFocus: !0, theme: o.confirm?.theme || "primary", onClick: R, children: o.confirm?.text || "Confirm" })
286
286
  ] }),
287
287
  children: /* @__PURE__ */ t("div", { className: "py-2 text-foreground", children: o.description })
288
288
  }