@phillips/seldon 1.143.2 → 1.145.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/dist/_virtual/build.js +4 -0
  2. package/dist/_virtual/defaults.js +4 -0
  3. package/dist/_virtual/encode-new-lines.js +4 -0
  4. package/dist/_virtual/encode-param-value.js +4 -0
  5. package/dist/_virtual/fold-line.js +4 -0
  6. package/dist/_virtual/format-date.js +4 -0
  7. package/dist/_virtual/format-duration.js +4 -0
  8. package/dist/_virtual/format-text.js +4 -0
  9. package/dist/_virtual/format.js +4 -0
  10. package/dist/_virtual/index.browser.js +6 -0
  11. package/dist/_virtual/index.cjs.production.min.js +4 -0
  12. package/dist/_virtual/index.esm.js +6 -0
  13. package/dist/_virtual/index10.js +4 -0
  14. package/dist/_virtual/index11.js +4 -0
  15. package/dist/_virtual/index12.js +4 -0
  16. package/dist/_virtual/index7.js +4 -0
  17. package/dist/_virtual/index8.js +4 -0
  18. package/dist/_virtual/index9.js +4 -0
  19. package/dist/_virtual/set-alarm.js +4 -0
  20. package/dist/_virtual/set-contact.js +4 -0
  21. package/dist/_virtual/set-description.js +4 -0
  22. package/dist/_virtual/set-geolocation.js +4 -0
  23. package/dist/_virtual/set-location.js +4 -0
  24. package/dist/_virtual/set-organizer.js +4 -0
  25. package/dist/_virtual/set-summary.js +4 -0
  26. package/dist/_virtual/validate.js +4 -0
  27. package/dist/components/AddToCalendar/AddToCalendar.d.ts +10 -0
  28. package/dist/components/AddToCalendar/AddToCalendar.js +62 -0
  29. package/dist/components/AddToCalendar/AddToCalendar.stories.d.ts +25 -0
  30. package/dist/components/AddToCalendar/AddToCalendar.test.d.ts +1 -0
  31. package/dist/components/AddToCalendar/calendarLinks.d.ts +6 -0
  32. package/dist/components/AddToCalendar/calendarLinks.js +89 -0
  33. package/dist/components/AddToCalendar/calendarLinks.test.d.ts +1 -0
  34. package/dist/components/AddToCalendar/index.d.ts +1 -0
  35. package/dist/components/AddToCalendar/types.d.ts +8 -0
  36. package/dist/components/ComboBox/ComboBox.d.ts +69 -0
  37. package/dist/components/ComboBox/ComboBox.js +221 -0
  38. package/dist/components/ComboBox/ComboBox.stories.d.ts +18 -0
  39. package/dist/components/ComboBox/ComboBox.test.d.ts +1 -0
  40. package/dist/components/ComboBox/index.d.ts +1 -0
  41. package/dist/components/PhoneNumberPicker/PhoneNumberPicker.d.ts +38 -0
  42. package/dist/components/PhoneNumberPicker/PhoneNumberPicker.stories.d.ts +14 -0
  43. package/dist/components/PhoneNumberPicker/PhoneNumberPicker.test.d.ts +1 -0
  44. package/dist/index.d.ts +10 -1
  45. package/dist/index.js +116 -112
  46. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +208 -0
  47. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-primitive/dist/index.js +32 -0
  48. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-slot/dist/index.js +49 -0
  49. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +52 -0
  50. package/dist/node_modules/@radix-ui/react-menu/dist/index.js +608 -0
  51. package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-arrow/dist/index.js +24 -0
  52. package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-collection/dist/index.js +48 -0
  53. package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +127 -0
  54. package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-focus-scope/dist/index.js +136 -0
  55. package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-popper/dist/index.js +218 -0
  56. package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-portal/dist/index.js +15 -0
  57. package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-presence/dist/index.js +70 -0
  58. package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-primitive/dist/index.js +36 -0
  59. package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-roving-focus/dist/index.js +183 -0
  60. package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-slot/dist/index.js +49 -0
  61. package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +52 -0
  62. package/dist/node_modules/@radix-ui/react-popover/dist/index.js +18 -17
  63. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-arrow/dist/index.js +24 -0
  64. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +127 -0
  65. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-focus-scope/dist/index.js +136 -0
  66. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-popper/dist/index.js +218 -0
  67. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-portal/dist/index.js +15 -0
  68. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-presence/dist/index.js +70 -0
  69. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-primitive/dist/index.js +36 -0
  70. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-slot/dist/index.js +49 -0
  71. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +52 -0
  72. package/dist/node_modules/cmdk/dist/chunk-NZJY6EH4.js +17 -0
  73. package/dist/node_modules/cmdk/dist/index.js +312 -0
  74. package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +7 -0
  75. package/dist/node_modules/date-fns/_lib/format/formatters.js +517 -0
  76. package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +59 -0
  77. package/dist/node_modules/date-fns/_lib/format/longFormatters.js +52 -0
  78. package/dist/node_modules/date-fns/_lib/protectedTokens.js +20 -0
  79. package/dist/node_modules/date-fns/addHours.js +9 -0
  80. package/dist/node_modules/date-fns/addMilliseconds.js +9 -0
  81. package/dist/node_modules/date-fns/constants.js +6 -5
  82. package/dist/node_modules/date-fns/format.js +58 -0
  83. package/dist/node_modules/date-fns/getDayOfYear.js +11 -0
  84. package/dist/node_modules/date-fns/getISOWeek.js +12 -0
  85. package/dist/node_modules/date-fns/getISOWeekYear.js +15 -0
  86. package/dist/node_modules/date-fns/getWeek.js +12 -0
  87. package/dist/node_modules/date-fns/getWeekYear.js +16 -0
  88. package/dist/node_modules/date-fns/isDate.js +7 -0
  89. package/dist/node_modules/date-fns/isValid.js +9 -0
  90. package/dist/node_modules/date-fns/startOfISOWeek.js +8 -0
  91. package/dist/node_modules/date-fns/startOfISOWeekYear.js +11 -0
  92. package/dist/node_modules/date-fns/startOfWeekYear.js +12 -0
  93. package/dist/node_modules/date-fns/startOfYear.js +9 -0
  94. package/dist/node_modules/date-fns-tz/dist/esm/_lib/getTimezoneOffsetInMilliseconds/index.js +7 -0
  95. package/dist/node_modules/date-fns-tz/dist/esm/_lib/newDateUTC/index.js +7 -0
  96. package/dist/node_modules/date-fns-tz/dist/esm/_lib/tzParseTimezone/index.js +63 -0
  97. package/dist/node_modules/date-fns-tz/dist/esm/_lib/tzPattern/index.js +4 -0
  98. package/dist/node_modules/date-fns-tz/dist/esm/_lib/tzTokenizeDate/index.js +71 -0
  99. package/dist/node_modules/date-fns-tz/dist/esm/toDate/index.js +180 -0
  100. package/dist/node_modules/date-fns-tz/dist/esm/toZonedTime/index.js +10 -0
  101. package/dist/node_modules/ics/dist/defaults.js +23 -0
  102. package/dist/node_modules/ics/dist/index.js +115 -0
  103. package/dist/node_modules/ics/dist/pipeline/build.js +50 -0
  104. package/dist/node_modules/ics/dist/pipeline/format.js +70 -0
  105. package/dist/node_modules/ics/dist/pipeline/index.js +53 -0
  106. package/dist/node_modules/ics/dist/pipeline/validate.js +17 -0
  107. package/dist/node_modules/ics/dist/schema/index.js +211 -0
  108. package/dist/node_modules/ics/dist/utils/encode-new-lines.js +9 -0
  109. package/dist/node_modules/ics/dist/utils/encode-param-value.js +9 -0
  110. package/dist/node_modules/ics/dist/utils/fold-line.js +14 -0
  111. package/dist/node_modules/ics/dist/utils/format-date.js +68 -0
  112. package/dist/node_modules/ics/dist/utils/format-duration.js +10 -0
  113. package/dist/node_modules/ics/dist/utils/format-text.js +9 -0
  114. package/dist/node_modules/ics/dist/utils/index.js +87 -0
  115. package/dist/node_modules/ics/dist/utils/set-alarm.js +49 -0
  116. package/dist/node_modules/ics/dist/utils/set-contact.js +18 -0
  117. package/dist/node_modules/ics/dist/utils/set-description.js +15 -0
  118. package/dist/node_modules/ics/dist/utils/set-geolocation.js +10 -0
  119. package/dist/node_modules/ics/dist/utils/set-location.js +15 -0
  120. package/dist/node_modules/ics/dist/utils/set-organizer.js +16 -0
  121. package/dist/node_modules/ics/dist/utils/set-summary.js +15 -0
  122. package/dist/node_modules/nanoid/index.browser.js +19 -0
  123. package/dist/node_modules/nanoid/url-alphabet/index.js +4 -0
  124. package/dist/node_modules/property-expr/index.js +77 -0
  125. package/dist/node_modules/runes2/dist/index.cjs.development.js +139 -0
  126. package/dist/node_modules/runes2/dist/index.cjs.production.min.js +86 -0
  127. package/dist/node_modules/runes2/dist/index.js +8 -0
  128. package/dist/node_modules/tiny-case/index.js +17 -0
  129. package/dist/node_modules/toposort/index.js +65 -0
  130. package/dist/node_modules/yup/index.esm.js +1899 -0
  131. package/dist/scss/_vars.scss +3 -0
  132. package/dist/scss/_vars.scss.js +3 -0
  133. package/dist/scss/componentStyles.scss +2 -0
  134. package/dist/scss/components/AddToCalendar/_addToCalendar.scss +64 -0
  135. package/dist/scss/components/ComboBox/_combobox.scss +149 -0
  136. package/package.json +8 -2
@@ -0,0 +1,608 @@
1
+ import * as o from "react";
2
+ import { composeEventHandlers as M } from "../../primitive/dist/index.js";
3
+ import { createCollection as Ye } from "../node_modules/@radix-ui/react-collection/dist/index.js";
4
+ import { useComposedRefs as D, composeRefs as Xe } from "../../react-compose-refs/dist/index.js";
5
+ import { createContextScope as je } from "../../react-context/dist/index.js";
6
+ import { useDirection as He } from "../../react-direction/dist/index.js";
7
+ import { DismissableLayer as We } from "../node_modules/@radix-ui/react-dismissable-layer/dist/index.js";
8
+ import { useFocusGuards as ze } from "../../react-focus-guards/dist/index.js";
9
+ import { FocusScope as Ze } from "../node_modules/@radix-ui/react-focus-scope/dist/index.js";
10
+ import { createPopperScope as le, Anchor as $e, Content as qe, Arrow as Je, Root as Qe } from "../node_modules/@radix-ui/react-popper/dist/index.js";
11
+ import { Portal as et } from "../node_modules/@radix-ui/react-portal/dist/index.js";
12
+ import { Presence as Y } from "../node_modules/@radix-ui/react-presence/dist/index.js";
13
+ import { Primitive as N, dispatchDiscreteCustomEvent as tt } from "../node_modules/@radix-ui/react-primitive/dist/index.js";
14
+ import { createRovingFocusGroupScope as de, Root as nt, Item as ot } from "../node_modules/@radix-ui/react-roving-focus/dist/index.js";
15
+ import { createSlot as rt } from "../node_modules/@radix-ui/react-slot/dist/index.js";
16
+ import { useCallbackRef as fe } from "../../react-use-callback-ref/dist/index.js";
17
+ import { hideOthers as ct } from "../../../aria-hidden/dist/es2015/index.js";
18
+ import at from "../../../react-remove-scroll/dist/es2015/Combination.js";
19
+ import { jsx as s } from "react/jsx-runtime";
20
+ var $ = ["Enter", " "], st = ["ArrowDown", "PageUp", "Home"], me = ["ArrowUp", "PageDown", "End"], ut = [...st, ...me], it = {
21
+ ltr: [...$, "ArrowRight"],
22
+ rtl: [...$, "ArrowLeft"]
23
+ }, lt = {
24
+ ltr: ["ArrowLeft"],
25
+ rtl: ["ArrowRight"]
26
+ }, F = "Menu", [O, dt, ft] = Ye(F), [P, Qt] = je(F, [
27
+ ft,
28
+ le,
29
+ de
30
+ ]), X = le(), pe = de(), [mt, S] = P(F), [pt, L] = P(F), ve = (e) => {
31
+ const { __scopeMenu: n, open: t = !1, children: r, dir: u, onOpenChange: c, modal: d = !0 } = e, p = X(n), [h, m] = o.useState(null), l = o.useRef(!1), a = fe(c), f = He(u);
32
+ return o.useEffect(() => {
33
+ const g = () => {
34
+ l.current = !0, document.addEventListener("pointerdown", v, { capture: !0, once: !0 }), document.addEventListener("pointermove", v, { capture: !0, once: !0 });
35
+ }, v = () => l.current = !1;
36
+ return document.addEventListener("keydown", g, { capture: !0 }), () => {
37
+ document.removeEventListener("keydown", g, { capture: !0 }), document.removeEventListener("pointerdown", v, { capture: !0 }), document.removeEventListener("pointermove", v, { capture: !0 });
38
+ };
39
+ }, []), /* @__PURE__ */ s(Qe, { ...p, children: /* @__PURE__ */ s(
40
+ mt,
41
+ {
42
+ scope: n,
43
+ open: t,
44
+ onOpenChange: a,
45
+ content: h,
46
+ onContentChange: m,
47
+ children: /* @__PURE__ */ s(
48
+ pt,
49
+ {
50
+ scope: n,
51
+ onClose: o.useCallback(() => a(!1), [a]),
52
+ isUsingKeyboardRef: l,
53
+ dir: f,
54
+ modal: d,
55
+ children: r
56
+ }
57
+ )
58
+ }
59
+ ) });
60
+ };
61
+ ve.displayName = F;
62
+ var vt = "MenuAnchor", q = o.forwardRef(
63
+ (e, n) => {
64
+ const { __scopeMenu: t, ...r } = e, u = X(t);
65
+ return /* @__PURE__ */ s($e, { ...u, ...r, ref: n });
66
+ }
67
+ );
68
+ q.displayName = vt;
69
+ var J = "MenuPortal", [Mt, Me] = P(J, {
70
+ forceMount: void 0
71
+ }), he = (e) => {
72
+ const { __scopeMenu: n, forceMount: t, children: r, container: u } = e, c = S(J, n);
73
+ return /* @__PURE__ */ s(Mt, { scope: n, forceMount: t, children: /* @__PURE__ */ s(Y, { present: t || c.open, children: /* @__PURE__ */ s(et, { asChild: !0, container: u, children: r }) }) });
74
+ };
75
+ he.displayName = J;
76
+ var _ = "MenuContent", [ht, Q] = P(_), Ce = o.forwardRef(
77
+ (e, n) => {
78
+ const t = Me(_, e.__scopeMenu), { forceMount: r = t.forceMount, ...u } = e, c = S(_, e.__scopeMenu), d = L(_, e.__scopeMenu);
79
+ return /* @__PURE__ */ s(O.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ s(Y, { present: r || c.open, children: /* @__PURE__ */ s(O.Slot, { scope: e.__scopeMenu, children: d.modal ? /* @__PURE__ */ s(Ct, { ...u, ref: n }) : /* @__PURE__ */ s(gt, { ...u, ref: n }) }) }) });
80
+ }
81
+ ), Ct = o.forwardRef(
82
+ (e, n) => {
83
+ const t = S(_, e.__scopeMenu), r = o.useRef(null), u = D(n, r);
84
+ return o.useEffect(() => {
85
+ const c = r.current;
86
+ if (c) return ct(c);
87
+ }, []), /* @__PURE__ */ s(
88
+ ee,
89
+ {
90
+ ...e,
91
+ ref: u,
92
+ trapFocus: t.open,
93
+ disableOutsidePointerEvents: t.open,
94
+ disableOutsideScroll: !0,
95
+ onFocusOutside: M(
96
+ e.onFocusOutside,
97
+ (c) => c.preventDefault(),
98
+ { checkForDefaultPrevented: !1 }
99
+ ),
100
+ onDismiss: () => t.onOpenChange(!1)
101
+ }
102
+ );
103
+ }
104
+ ), gt = o.forwardRef((e, n) => {
105
+ const t = S(_, e.__scopeMenu);
106
+ return /* @__PURE__ */ s(
107
+ ee,
108
+ {
109
+ ...e,
110
+ ref: n,
111
+ trapFocus: !1,
112
+ disableOutsidePointerEvents: !1,
113
+ disableOutsideScroll: !1,
114
+ onDismiss: () => t.onOpenChange(!1)
115
+ }
116
+ );
117
+ }), _t = rt("MenuContent.ScrollLock"), ee = o.forwardRef(
118
+ (e, n) => {
119
+ const {
120
+ __scopeMenu: t,
121
+ loop: r = !1,
122
+ trapFocus: u,
123
+ onOpenAutoFocus: c,
124
+ onCloseAutoFocus: d,
125
+ disableOutsidePointerEvents: p,
126
+ onEntryFocus: h,
127
+ onEscapeKeyDown: m,
128
+ onPointerDownOutside: l,
129
+ onFocusOutside: a,
130
+ onInteractOutside: f,
131
+ onDismiss: g,
132
+ disableOutsideScroll: v,
133
+ ...E
134
+ } = e, x = S(_, t), w = L(_, t), Ne = X(t), Fe = pe(t), re = dt(t), [Le, ce] = o.useState(null), K = o.useRef(null), Ke = D(n, K, x.onContentChange), G = o.useRef(0), U = o.useRef(""), Ge = o.useRef(0), H = o.useRef(null), ae = o.useRef("right"), W = o.useRef(0), Ue = v ? at : o.Fragment, Be = v ? { as: _t, allowPinchZoom: !0 } : void 0, Ve = (i) => {
135
+ const y = U.current + i, R = re().filter((C) => !C.disabled), b = document.activeElement, z = R.find((C) => C.ref.current === b)?.textValue, Z = R.map((C) => C.textValue), se = Ot(Z, y, z), T = R.find((C) => C.textValue === se)?.ref.current;
136
+ (function C(ue) {
137
+ U.current = ue, window.clearTimeout(G.current), ue !== "" && (G.current = window.setTimeout(() => C(""), 1e3));
138
+ })(y), T && setTimeout(() => T.focus());
139
+ };
140
+ o.useEffect(() => () => window.clearTimeout(G.current), []), ze();
141
+ const I = o.useCallback((i) => ae.current === H.current?.side && Dt(i, H.current?.area), []);
142
+ return /* @__PURE__ */ s(
143
+ ht,
144
+ {
145
+ scope: t,
146
+ searchRef: U,
147
+ onItemEnter: o.useCallback(
148
+ (i) => {
149
+ I(i) && i.preventDefault();
150
+ },
151
+ [I]
152
+ ),
153
+ onItemLeave: o.useCallback(
154
+ (i) => {
155
+ I(i) || (K.current?.focus(), ce(null));
156
+ },
157
+ [I]
158
+ ),
159
+ onTriggerLeave: o.useCallback(
160
+ (i) => {
161
+ I(i) && i.preventDefault();
162
+ },
163
+ [I]
164
+ ),
165
+ pointerGraceTimerRef: Ge,
166
+ onPointerGraceIntentChange: o.useCallback((i) => {
167
+ H.current = i;
168
+ }, []),
169
+ children: /* @__PURE__ */ s(Ue, { ...Be, children: /* @__PURE__ */ s(
170
+ Ze,
171
+ {
172
+ asChild: !0,
173
+ trapped: u,
174
+ onMountAutoFocus: M(c, (i) => {
175
+ i.preventDefault(), K.current?.focus({ preventScroll: !0 });
176
+ }),
177
+ onUnmountAutoFocus: d,
178
+ children: /* @__PURE__ */ s(
179
+ We,
180
+ {
181
+ asChild: !0,
182
+ disableOutsidePointerEvents: p,
183
+ onEscapeKeyDown: m,
184
+ onPointerDownOutside: l,
185
+ onFocusOutside: a,
186
+ onInteractOutside: f,
187
+ onDismiss: g,
188
+ children: /* @__PURE__ */ s(
189
+ nt,
190
+ {
191
+ asChild: !0,
192
+ ...Fe,
193
+ dir: w.dir,
194
+ orientation: "vertical",
195
+ loop: r,
196
+ currentTabStopId: Le,
197
+ onCurrentTabStopIdChange: ce,
198
+ onEntryFocus: M(h, (i) => {
199
+ w.isUsingKeyboardRef.current || i.preventDefault();
200
+ }),
201
+ preventScrollOnEntryFocus: !0,
202
+ children: /* @__PURE__ */ s(
203
+ qe,
204
+ {
205
+ role: "menu",
206
+ "aria-orientation": "vertical",
207
+ "data-state": De(x.open),
208
+ "data-radix-menu-content": "",
209
+ dir: w.dir,
210
+ ...Ne,
211
+ ...E,
212
+ ref: Ke,
213
+ style: { outline: "none", ...E.style },
214
+ onKeyDown: M(E.onKeyDown, (i) => {
215
+ const R = i.target.closest("[data-radix-menu-content]") === i.currentTarget, b = i.ctrlKey || i.altKey || i.metaKey, z = i.key.length === 1;
216
+ R && (i.key === "Tab" && i.preventDefault(), !b && z && Ve(i.key));
217
+ const Z = K.current;
218
+ if (i.target !== Z || !ut.includes(i.key)) return;
219
+ i.preventDefault();
220
+ const T = re().filter((C) => !C.disabled).map((C) => C.ref.current);
221
+ me.includes(i.key) && T.reverse(), Tt(T);
222
+ }),
223
+ onBlur: M(e.onBlur, (i) => {
224
+ i.currentTarget.contains(i.target) || (window.clearTimeout(G.current), U.current = "");
225
+ }),
226
+ onPointerMove: M(
227
+ e.onPointerMove,
228
+ k((i) => {
229
+ const y = i.target, R = W.current !== i.clientX;
230
+ if (i.currentTarget.contains(y) && R) {
231
+ const b = i.clientX > W.current ? "right" : "left";
232
+ ae.current = b, W.current = i.clientX;
233
+ }
234
+ })
235
+ )
236
+ }
237
+ )
238
+ }
239
+ )
240
+ }
241
+ )
242
+ }
243
+ ) })
244
+ }
245
+ );
246
+ }
247
+ );
248
+ Ce.displayName = _;
249
+ var Rt = "MenuGroup", te = o.forwardRef(
250
+ (e, n) => {
251
+ const { __scopeMenu: t, ...r } = e;
252
+ return /* @__PURE__ */ s(N.div, { role: "group", ...r, ref: n });
253
+ }
254
+ );
255
+ te.displayName = Rt;
256
+ var Pt = "MenuLabel", ge = o.forwardRef(
257
+ (e, n) => {
258
+ const { __scopeMenu: t, ...r } = e;
259
+ return /* @__PURE__ */ s(N.div, { ...r, ref: n });
260
+ }
261
+ );
262
+ ge.displayName = Pt;
263
+ var B = "MenuItem", ie = "menu.itemSelect", j = o.forwardRef(
264
+ (e, n) => {
265
+ const { disabled: t = !1, onSelect: r, ...u } = e, c = o.useRef(null), d = L(B, e.__scopeMenu), p = Q(B, e.__scopeMenu), h = D(n, c), m = o.useRef(!1), l = () => {
266
+ const a = c.current;
267
+ if (!t && a) {
268
+ const f = new CustomEvent(ie, { bubbles: !0, cancelable: !0 });
269
+ a.addEventListener(ie, (g) => r?.(g), { once: !0 }), tt(a, f), f.defaultPrevented ? m.current = !1 : d.onClose();
270
+ }
271
+ };
272
+ return /* @__PURE__ */ s(
273
+ _e,
274
+ {
275
+ ...u,
276
+ ref: h,
277
+ disabled: t,
278
+ onClick: M(e.onClick, l),
279
+ onPointerDown: (a) => {
280
+ e.onPointerDown?.(a), m.current = !0;
281
+ },
282
+ onPointerUp: M(e.onPointerUp, (a) => {
283
+ m.current || a.currentTarget?.click();
284
+ }),
285
+ onKeyDown: M(e.onKeyDown, (a) => {
286
+ const f = p.searchRef.current !== "";
287
+ t || f && a.key === " " || $.includes(a.key) && (a.currentTarget.click(), a.preventDefault());
288
+ })
289
+ }
290
+ );
291
+ }
292
+ );
293
+ j.displayName = B;
294
+ var _e = o.forwardRef(
295
+ (e, n) => {
296
+ const { __scopeMenu: t, disabled: r = !1, textValue: u, ...c } = e, d = Q(B, t), p = pe(t), h = o.useRef(null), m = D(n, h), [l, a] = o.useState(!1), [f, g] = o.useState("");
297
+ return o.useEffect(() => {
298
+ const v = h.current;
299
+ v && g((v.textContent ?? "").trim());
300
+ }, [c.children]), /* @__PURE__ */ s(
301
+ O.ItemSlot,
302
+ {
303
+ scope: t,
304
+ disabled: r,
305
+ textValue: u ?? f,
306
+ children: /* @__PURE__ */ s(ot, { asChild: !0, ...p, focusable: !r, children: /* @__PURE__ */ s(
307
+ N.div,
308
+ {
309
+ role: "menuitem",
310
+ "data-highlighted": l ? "" : void 0,
311
+ "aria-disabled": r || void 0,
312
+ "data-disabled": r ? "" : void 0,
313
+ ...c,
314
+ ref: m,
315
+ onPointerMove: M(
316
+ e.onPointerMove,
317
+ k((v) => {
318
+ r ? d.onItemLeave(v) : (d.onItemEnter(v), v.defaultPrevented || v.currentTarget.focus({ preventScroll: !0 }));
319
+ })
320
+ ),
321
+ onPointerLeave: M(
322
+ e.onPointerLeave,
323
+ k((v) => d.onItemLeave(v))
324
+ ),
325
+ onFocus: M(e.onFocus, () => a(!0)),
326
+ onBlur: M(e.onBlur, () => a(!1))
327
+ }
328
+ ) })
329
+ }
330
+ );
331
+ }
332
+ ), St = "MenuCheckboxItem", Re = o.forwardRef(
333
+ (e, n) => {
334
+ const { checked: t = !1, onCheckedChange: r, ...u } = e;
335
+ return /* @__PURE__ */ s(Ie, { scope: e.__scopeMenu, checked: t, children: /* @__PURE__ */ s(
336
+ j,
337
+ {
338
+ role: "menuitemcheckbox",
339
+ "aria-checked": V(t) ? "mixed" : t,
340
+ ...u,
341
+ ref: n,
342
+ "data-state": oe(t),
343
+ onSelect: M(
344
+ u.onSelect,
345
+ () => r?.(V(t) ? !0 : !t),
346
+ { checkForDefaultPrevented: !1 }
347
+ )
348
+ }
349
+ ) });
350
+ }
351
+ );
352
+ Re.displayName = St;
353
+ var Pe = "MenuRadioGroup", [Et, wt] = P(
354
+ Pe,
355
+ { value: void 0, onValueChange: () => {
356
+ } }
357
+ ), Se = o.forwardRef(
358
+ (e, n) => {
359
+ const { value: t, onValueChange: r, ...u } = e, c = fe(r);
360
+ return /* @__PURE__ */ s(Et, { scope: e.__scopeMenu, value: t, onValueChange: c, children: /* @__PURE__ */ s(te, { ...u, ref: n }) });
361
+ }
362
+ );
363
+ Se.displayName = Pe;
364
+ var Ee = "MenuRadioItem", we = o.forwardRef(
365
+ (e, n) => {
366
+ const { value: t, ...r } = e, u = wt(Ee, e.__scopeMenu), c = t === u.value;
367
+ return /* @__PURE__ */ s(Ie, { scope: e.__scopeMenu, checked: c, children: /* @__PURE__ */ s(
368
+ j,
369
+ {
370
+ role: "menuitemradio",
371
+ "aria-checked": c,
372
+ ...r,
373
+ ref: n,
374
+ "data-state": oe(c),
375
+ onSelect: M(
376
+ r.onSelect,
377
+ () => u.onValueChange?.(t),
378
+ { checkForDefaultPrevented: !1 }
379
+ )
380
+ }
381
+ ) });
382
+ }
383
+ );
384
+ we.displayName = Ee;
385
+ var ne = "MenuItemIndicator", [Ie, It] = P(
386
+ ne,
387
+ { checked: !1 }
388
+ ), ye = o.forwardRef(
389
+ (e, n) => {
390
+ const { __scopeMenu: t, forceMount: r, ...u } = e, c = It(ne, t);
391
+ return /* @__PURE__ */ s(
392
+ Y,
393
+ {
394
+ present: r || V(c.checked) || c.checked === !0,
395
+ children: /* @__PURE__ */ s(
396
+ N.span,
397
+ {
398
+ ...u,
399
+ ref: n,
400
+ "data-state": oe(c.checked)
401
+ }
402
+ )
403
+ }
404
+ );
405
+ }
406
+ );
407
+ ye.displayName = ne;
408
+ var yt = "MenuSeparator", xe = o.forwardRef(
409
+ (e, n) => {
410
+ const { __scopeMenu: t, ...r } = e;
411
+ return /* @__PURE__ */ s(
412
+ N.div,
413
+ {
414
+ role: "separator",
415
+ "aria-orientation": "horizontal",
416
+ ...r,
417
+ ref: n
418
+ }
419
+ );
420
+ }
421
+ );
422
+ xe.displayName = yt;
423
+ var xt = "MenuArrow", be = o.forwardRef(
424
+ (e, n) => {
425
+ const { __scopeMenu: t, ...r } = e, u = X(t);
426
+ return /* @__PURE__ */ s(Je, { ...u, ...r, ref: n });
427
+ }
428
+ );
429
+ be.displayName = xt;
430
+ var bt = "MenuSub", [en, Te] = P(bt), A = "MenuSubTrigger", Ae = o.forwardRef(
431
+ (e, n) => {
432
+ const t = S(A, e.__scopeMenu), r = L(A, e.__scopeMenu), u = Te(A, e.__scopeMenu), c = Q(A, e.__scopeMenu), d = o.useRef(null), { pointerGraceTimerRef: p, onPointerGraceIntentChange: h } = c, m = { __scopeMenu: e.__scopeMenu }, l = o.useCallback(() => {
433
+ d.current && window.clearTimeout(d.current), d.current = null;
434
+ }, []);
435
+ return o.useEffect(() => l, [l]), o.useEffect(() => {
436
+ const a = p.current;
437
+ return () => {
438
+ window.clearTimeout(a), h(null);
439
+ };
440
+ }, [p, h]), /* @__PURE__ */ s(q, { asChild: !0, ...m, children: /* @__PURE__ */ s(
441
+ _e,
442
+ {
443
+ id: u.triggerId,
444
+ "aria-haspopup": "menu",
445
+ "aria-expanded": t.open,
446
+ "aria-controls": u.contentId,
447
+ "data-state": De(t.open),
448
+ ...e,
449
+ ref: Xe(n, u.onTriggerChange),
450
+ onClick: (a) => {
451
+ e.onClick?.(a), !(e.disabled || a.defaultPrevented) && (a.currentTarget.focus(), t.open || t.onOpenChange(!0));
452
+ },
453
+ onPointerMove: M(
454
+ e.onPointerMove,
455
+ k((a) => {
456
+ c.onItemEnter(a), !a.defaultPrevented && !e.disabled && !t.open && !d.current && (c.onPointerGraceIntentChange(null), d.current = window.setTimeout(() => {
457
+ t.onOpenChange(!0), l();
458
+ }, 100));
459
+ })
460
+ ),
461
+ onPointerLeave: M(
462
+ e.onPointerLeave,
463
+ k((a) => {
464
+ l();
465
+ const f = t.content?.getBoundingClientRect();
466
+ if (f) {
467
+ const g = t.content?.dataset.side, v = g === "right", E = v ? -5 : 5, x = f[v ? "left" : "right"], w = f[v ? "right" : "left"];
468
+ c.onPointerGraceIntentChange({
469
+ area: [
470
+ // Apply a bleed on clientX to ensure that our exit point is
471
+ // consistently within polygon bounds
472
+ { x: a.clientX + E, y: a.clientY },
473
+ { x, y: f.top },
474
+ { x: w, y: f.top },
475
+ { x: w, y: f.bottom },
476
+ { x, y: f.bottom }
477
+ ],
478
+ side: g
479
+ }), window.clearTimeout(p.current), p.current = window.setTimeout(
480
+ () => c.onPointerGraceIntentChange(null),
481
+ 300
482
+ );
483
+ } else {
484
+ if (c.onTriggerLeave(a), a.defaultPrevented) return;
485
+ c.onPointerGraceIntentChange(null);
486
+ }
487
+ })
488
+ ),
489
+ onKeyDown: M(e.onKeyDown, (a) => {
490
+ const f = c.searchRef.current !== "";
491
+ e.disabled || f && a.key === " " || it[r.dir].includes(a.key) && (t.onOpenChange(!0), t.content?.focus(), a.preventDefault());
492
+ })
493
+ }
494
+ ) });
495
+ }
496
+ );
497
+ Ae.displayName = A;
498
+ var Oe = "MenuSubContent", ke = o.forwardRef(
499
+ (e, n) => {
500
+ const t = Me(_, e.__scopeMenu), { forceMount: r = t.forceMount, ...u } = e, c = S(_, e.__scopeMenu), d = L(_, e.__scopeMenu), p = Te(Oe, e.__scopeMenu), h = o.useRef(null), m = D(n, h);
501
+ return /* @__PURE__ */ s(O.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ s(Y, { present: r || c.open, children: /* @__PURE__ */ s(O.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ s(
502
+ ee,
503
+ {
504
+ id: p.contentId,
505
+ "aria-labelledby": p.triggerId,
506
+ ...u,
507
+ ref: m,
508
+ align: "start",
509
+ side: d.dir === "rtl" ? "left" : "right",
510
+ disableOutsidePointerEvents: !1,
511
+ disableOutsideScroll: !1,
512
+ trapFocus: !1,
513
+ onOpenAutoFocus: (l) => {
514
+ d.isUsingKeyboardRef.current && h.current?.focus(), l.preventDefault();
515
+ },
516
+ onCloseAutoFocus: (l) => l.preventDefault(),
517
+ onFocusOutside: M(e.onFocusOutside, (l) => {
518
+ l.target !== p.trigger && c.onOpenChange(!1);
519
+ }),
520
+ onEscapeKeyDown: M(e.onEscapeKeyDown, (l) => {
521
+ d.onClose(), l.preventDefault();
522
+ }),
523
+ onKeyDown: M(e.onKeyDown, (l) => {
524
+ const a = l.currentTarget.contains(l.target), f = lt[d.dir].includes(l.key);
525
+ a && f && (c.onOpenChange(!1), p.trigger?.focus(), l.preventDefault());
526
+ })
527
+ }
528
+ ) }) }) });
529
+ }
530
+ );
531
+ ke.displayName = Oe;
532
+ function De(e) {
533
+ return e ? "open" : "closed";
534
+ }
535
+ function V(e) {
536
+ return e === "indeterminate";
537
+ }
538
+ function oe(e) {
539
+ return V(e) ? "indeterminate" : e ? "checked" : "unchecked";
540
+ }
541
+ function Tt(e) {
542
+ const n = document.activeElement;
543
+ for (const t of e)
544
+ if (t === n || (t.focus(), document.activeElement !== n)) return;
545
+ }
546
+ function At(e, n) {
547
+ return e.map((t, r) => e[(n + r) % e.length]);
548
+ }
549
+ function Ot(e, n, t) {
550
+ const u = n.length > 1 && Array.from(n).every((m) => m === n[0]) ? n[0] : n, c = t ? e.indexOf(t) : -1;
551
+ let d = At(e, Math.max(c, 0));
552
+ u.length === 1 && (d = d.filter((m) => m !== t));
553
+ const h = d.find(
554
+ (m) => m.toLowerCase().startsWith(u.toLowerCase())
555
+ );
556
+ return h !== t ? h : void 0;
557
+ }
558
+ function kt(e, n) {
559
+ const { x: t, y: r } = e;
560
+ let u = !1;
561
+ for (let c = 0, d = n.length - 1; c < n.length; d = c++) {
562
+ const p = n[c], h = n[d], m = p.x, l = p.y, a = h.x, f = h.y;
563
+ l > r != f > r && t < (a - m) * (r - l) / (f - l) + m && (u = !u);
564
+ }
565
+ return u;
566
+ }
567
+ function Dt(e, n) {
568
+ if (!n) return !1;
569
+ const t = { x: e.clientX, y: e.clientY };
570
+ return kt(t, n);
571
+ }
572
+ function k(e) {
573
+ return (n) => n.pointerType === "mouse" ? e(n) : void 0;
574
+ }
575
+ var tn = ve, nn = q, on = he, rn = Ce, cn = te, an = ge, sn = j, un = Re, ln = Se, dn = we, fn = ye, mn = xe, pn = be, vn = Ae, Mn = ke;
576
+ export {
577
+ nn as Anchor,
578
+ pn as Arrow,
579
+ un as CheckboxItem,
580
+ rn as Content,
581
+ cn as Group,
582
+ sn as Item,
583
+ fn as ItemIndicator,
584
+ an as Label,
585
+ ve as Menu,
586
+ q as MenuAnchor,
587
+ be as MenuArrow,
588
+ Re as MenuCheckboxItem,
589
+ Ce as MenuContent,
590
+ te as MenuGroup,
591
+ j as MenuItem,
592
+ ye as MenuItemIndicator,
593
+ ge as MenuLabel,
594
+ he as MenuPortal,
595
+ Se as MenuRadioGroup,
596
+ we as MenuRadioItem,
597
+ xe as MenuSeparator,
598
+ ke as MenuSubContent,
599
+ Ae as MenuSubTrigger,
600
+ on as Portal,
601
+ ln as RadioGroup,
602
+ dn as RadioItem,
603
+ tn as Root,
604
+ mn as Separator,
605
+ Mn as SubContent,
606
+ vn as SubTrigger,
607
+ Qt as createMenuScope
608
+ };
@@ -0,0 +1,24 @@
1
+ import * as n from "react";
2
+ import { Primitive as p } from "../../react-primitive/dist/index.js";
3
+ import { jsx as o } from "react/jsx-runtime";
4
+ var v = "Arrow", e = n.forwardRef((r, i) => {
5
+ const { children: t, width: a = 10, height: s = 5, ...m } = r;
6
+ return /* @__PURE__ */ o(
7
+ p.svg,
8
+ {
9
+ ...m,
10
+ ref: i,
11
+ width: a,
12
+ height: s,
13
+ viewBox: "0 0 30 10",
14
+ preserveAspectRatio: "none",
15
+ children: r.asChild ? t : /* @__PURE__ */ o("polygon", { points: "0,0 30,0 15,10" })
16
+ }
17
+ );
18
+ });
19
+ e.displayName = v;
20
+ var h = e;
21
+ export {
22
+ e as Arrow,
23
+ h as Root
24
+ };
@@ -0,0 +1,48 @@
1
+ import r from "react";
2
+ import { createContextScope as y } from "../../../../../react-context/dist/index.js";
3
+ import { useComposedRefs as M } from "../../../../../react-compose-refs/dist/index.js";
4
+ import { createSlot as x } from "../../react-slot/dist/index.js";
5
+ import { jsx as u } from "react/jsx-runtime";
6
+ function g(s) {
7
+ const m = s + "CollectionProvider", [A, N] = y(m), [_, f] = A(
8
+ m,
9
+ { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
10
+ ), p = (c) => {
11
+ const { scope: e, children: l } = c, o = r.useRef(null), t = r.useRef(/* @__PURE__ */ new Map()).current;
12
+ return /* @__PURE__ */ u(_, { scope: e, itemMap: t, collectionRef: o, children: l });
13
+ };
14
+ p.displayName = m;
15
+ const a = s + "CollectionSlot", E = x(a), C = r.forwardRef(
16
+ (c, e) => {
17
+ const { scope: l, children: o } = c, t = f(a, l), n = M(e, t.collectionRef);
18
+ return /* @__PURE__ */ u(E, { ref: n, children: o });
19
+ }
20
+ );
21
+ C.displayName = a;
22
+ const d = s + "CollectionItemSlot", R = "data-radix-collection-item", T = x(d), I = r.forwardRef(
23
+ (c, e) => {
24
+ const { scope: l, children: o, ...t } = c, n = r.useRef(null), S = M(e, n), i = f(d, l);
25
+ return r.useEffect(() => (i.itemMap.set(n, { ref: n, ...t }), () => void i.itemMap.delete(n))), /* @__PURE__ */ u(T, { [R]: "", ref: S, children: o });
26
+ }
27
+ );
28
+ I.displayName = d;
29
+ function O(c) {
30
+ const e = f(s + "CollectionConsumer", c);
31
+ return r.useCallback(() => {
32
+ const o = e.collectionRef.current;
33
+ if (!o) return [];
34
+ const t = Array.from(o.querySelectorAll(`[${R}]`));
35
+ return Array.from(e.itemMap.values()).sort(
36
+ (i, v) => t.indexOf(i.ref.current) - t.indexOf(v.ref.current)
37
+ );
38
+ }, [e.collectionRef, e.itemMap]);
39
+ }
40
+ return [
41
+ { Provider: p, Slot: C, ItemSlot: I },
42
+ O,
43
+ N
44
+ ];
45
+ }
46
+ export {
47
+ g as createCollection
48
+ };