@1771technologies/lytenyte-pro 0.0.42 → 0.0.43

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 (33) hide show
  1. package/dist/CompositeList-CGRaS6LQ.js +149 -0
  2. package/dist/DirectionContext-DIPP5cAe.js +15 -0
  3. package/dist/InternalBackdrop-C4RACVzs.js +324 -0
  4. package/dist/{anchor-context-B9sGQdR5.js → PopoverPortalContext-BdsDjihw.js} +4 -13
  5. package/dist/anchor-context-Cqr_oiJt.js +11 -0
  6. package/dist/column-manager.js +5 -3
  7. package/dist/{MenuRoot-9n64jNWP.js → column-menu-driver-cG-EZgLa.js} +49 -282
  8. package/dist/dialog.js +3 -3
  9. package/dist/{use-grid-DKvzGZWc.js → drag-store-CO3z13Ju.js} +34 -44
  10. package/dist/filter-manager.js +3 -2
  11. package/dist/index.js +97 -120
  12. package/dist/lytenyte-pro.css +9 -0
  13. package/dist/menu-CkfZmNR3.js +1879 -0
  14. package/dist/menu.js +2 -1637
  15. package/dist/{pill-C4Jhdf8E.js → pill-gga9iHqS.js} +44 -49
  16. package/dist/pill-manager.js +73 -10
  17. package/dist/popover.js +30 -5
  18. package/dist/{InternalBackdrop-Dm9czgoC.js → proptypes-BjYr2nFr.js} +25 -299
  19. package/dist/{select-C6xOZZLq.js → select-qluHi8ET.js} +7 -7
  20. package/dist/sort-manager.js +2 -2
  21. package/dist/types/menu/menu-impl.d.ts +1 -1
  22. package/dist/types/menu/menu.d.ts +1 -1
  23. package/dist/types/menu-frame/menu-frame-driver.d.ts +1 -0
  24. package/dist/types/pill-manager/pill-manager-impl.d.ts +1 -0
  25. package/dist/types/pill-manager/pill-manager-pill.d.ts +1 -0
  26. package/dist/{useAnchorPositioning-Cm44rb7y.js → useAnchorPositioning-52zK7jlD.js} +2 -13
  27. package/dist/{useButton-Cy7tjZ__.js → useButton-DWXzFgcr.js} +2 -1
  28. package/dist/{useScrollLock-D6h5lZYs.js → useScrollLock-D4UY33Sb.js} +15 -105
  29. package/package.json +15 -15
  30. package/dist/arrow-svg-evmXDI_J.js +0 -29
  31. package/dist/useBaseUiId-J66PFGv_.js +0 -48
  32. package/dist/useCompositeListItem-I14CpQPi.js +0 -51
  33. /package/dist/types/{popover → anchor-context}/anchor-context.d.ts +0 -0
@@ -1,14 +1,15 @@
1
1
  import * as React from "react";
2
2
  import { useRef, useState, useCallback, useEffect, useMemo, forwardRef } from "react";
3
- import { a as useDragStore, c as useStore, u as useGrid } from "./use-grid-DKvzGZWc.js";
3
+ import { u as useDragStore, b as useStore } from "./drag-store-CO3z13Ju.js";
4
4
  import { arrayOverlap, clsx } from "@1771technologies/js-utils";
5
- import { k as useForkRef, m as mergeProps, O as contains, v as useComponentRenderer, P as PropTypes, Q as pressableTriggerOpenStateMapping } from "./InternalBackdrop-Dm9czgoC.js";
6
- import { u as useButton } from "./useButton-Cy7tjZ__.js";
7
- import { o as ownerDocument } from "./useScrollLock-D6h5lZYs.js";
5
+ import { m as mergeProps, E as contains, P as PropTypes } from "./proptypes-BjYr2nFr.js";
6
+ import { u as useButton } from "./useButton-DWXzFgcr.js";
7
+ import { u as useForkRef, a as useComponentRenderer, c as pressableTriggerOpenStateMapping } from "./InternalBackdrop-C4RACVzs.js";
8
+ import { o as ownerDocument, c as useGrid } from "./useScrollLock-D4UY33Sb.js";
8
9
  import { g as getPseudoElementBounds } from "./getPseudoElementBounds-BSHt6WYm.js";
9
- import { u as useMenuRootContext } from "./MenuRoot-9n64jNWP.js";
10
- import { jsxs, jsx } from "react/jsx-runtime";
11
- import { Menu } from "./menu.js";
10
+ import { u as useMenuRootContext } from "./column-menu-driver-cG-EZgLa.js";
11
+ import { jsx, jsxs } from "react/jsx-runtime";
12
+ import { a as Menu } from "./menu-CkfZmNR3.js";
12
13
  const toJSON = () => "";
13
14
  function getVisibleBoundingBox(element) {
14
15
  if (!element) return null;
@@ -903,27 +904,24 @@ function PillManagerAggMenu({ column, grid }) {
903
904
  let allowed = column.aggFnsAllowed ?? base.aggFnsAllowed ?? [];
904
905
  if (typeof agg === "function") allowed = ["Fn(x)", ...allowed];
905
906
  else if (typeof agg === "string" && !allowed.includes(agg)) allowed = [agg, ...allowed];
906
- return /* @__PURE__ */ jsxs(Menu.Container, { children: [
907
- /* @__PURE__ */ jsx(Menu.Arrow, {}),
908
- /* @__PURE__ */ jsx(
909
- Menu.RadioGroup,
910
- {
911
- value: typeof agg === "function" ? "Fn(x)" : agg ?? "",
912
- onValueChange: (v) => {
913
- if (v === "Fn(x)") return;
914
- const next = { ...aggModel };
915
- next[column.id].fn = v;
916
- grid.state.aggModel.set(next);
917
- },
918
- children: allowed.map((c) => {
919
- return /* @__PURE__ */ jsxs(Menu.Radio, { value: c, closeOnClick: true, children: [
920
- c,
921
- /* @__PURE__ */ jsx(Menu.RadioIndicator, {})
922
- ] }, c);
923
- })
924
- }
925
- )
926
- ] });
907
+ return /* @__PURE__ */ jsx(Menu.Container, { children: /* @__PURE__ */ jsx(
908
+ Menu.RadioGroup,
909
+ {
910
+ value: typeof agg === "function" ? "Fn(x)" : agg ?? "",
911
+ onValueChange: (v) => {
912
+ if (v === "Fn(x)") return;
913
+ const next = { ...aggModel };
914
+ next[column.id].fn = v;
915
+ grid.state.aggModel.set(next);
916
+ },
917
+ children: allowed.map((c) => {
918
+ return /* @__PURE__ */ jsxs(Menu.Radio, { value: c, closeOnClick: true, children: [
919
+ c,
920
+ /* @__PURE__ */ jsx(Menu.RadioIndicator, {})
921
+ ] }, c);
922
+ })
923
+ }
924
+ ) });
927
925
  }
928
926
  function PillManagerMeasureMenu({ column, grid }) {
929
927
  const base = grid.state.columnBase.use();
@@ -932,27 +930,24 @@ function PillManagerMeasureMenu({ column, grid }) {
932
930
  let allowed = column.measureFnsAllowed ?? base.measureFnsAllowed ?? [];
933
931
  if (typeof agg === "function") allowed = ["Fn(x)", ...allowed];
934
932
  else if (typeof agg === "string" && !allowed.includes(agg)) allowed = [agg, ...allowed];
935
- return /* @__PURE__ */ jsxs(Menu.Container, { children: [
936
- /* @__PURE__ */ jsx(Menu.Arrow, {}),
937
- /* @__PURE__ */ jsx(
938
- Menu.RadioGroup,
939
- {
940
- value: typeof agg === "function" ? "Fn(x)" : agg ?? "",
941
- onValueChange: (v) => {
942
- if (v === "Fn(x)") return;
943
- const next = { ...measureModel };
944
- next[column.id].fn = v;
945
- grid.state.measureModel.set(next);
946
- },
947
- children: allowed.map((c) => {
948
- return /* @__PURE__ */ jsxs(Menu.Radio, { value: c, closeOnClick: true, children: [
949
- c,
950
- /* @__PURE__ */ jsx(Menu.RadioIndicator, {})
951
- ] }, c);
952
- })
953
- }
954
- )
955
- ] });
933
+ return /* @__PURE__ */ jsx(Menu.Container, { children: /* @__PURE__ */ jsx(
934
+ Menu.RadioGroup,
935
+ {
936
+ value: typeof agg === "function" ? "Fn(x)" : agg ?? "",
937
+ onValueChange: (v) => {
938
+ if (v === "Fn(x)") return;
939
+ const next = { ...measureModel };
940
+ next[column.id].fn = v;
941
+ grid.state.measureModel.set(next);
942
+ },
943
+ children: allowed.map((c) => {
944
+ return /* @__PURE__ */ jsxs(Menu.Radio, { value: c, closeOnClick: true, children: [
945
+ c,
946
+ /* @__PURE__ */ jsx(Menu.RadioIndicator, {})
947
+ ] }, c);
948
+ })
949
+ }
950
+ ) });
956
951
  }
957
952
  const Pill = forwardRef(
958
953
  function Pill2({ className, interactive, kind = "plain", ...props }, ref) {
@@ -1,18 +1,20 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { u as useGrid, a as useDragStore, b as useDrag, D as DragProvider, G as GridProvider } from "./use-grid-DKvzGZWc.js";
2
+ import { c as useGrid, G as GridProvider } from "./useScrollLock-D4UY33Sb.js";
3
3
  import { useMemo, createContext, useState, useContext, forwardRef, useEffect, useCallback } from "react";
4
4
  import { clsx } from "@1771technologies/js-utils";
5
- import { c as canAgg, a as canMeasure, u as useAggregationSource, b as useMeasuresSource, d as useRowGroupsSource, e as useColumnPivotSource, f as useDroppable, g as useEdgeScroll, P as Pill, M as MenuTrigger, h as useDraggable, i as PillManagerAggMenu, j as PillManagerMeasureMenu } from "./pill-C4Jhdf8E.js";
5
+ import { useDroppable as useDroppable$1 } from "@1771technologies/react-dragon";
6
+ import { c as canAgg, a as canMeasure, u as useAggregationSource, b as useMeasuresSource, d as useRowGroupsSource, e as useColumnPivotSource, f as useDroppable, g as useEdgeScroll, P as Pill, M as MenuTrigger, h as useDraggable, i as PillManagerAggMenu, j as PillManagerMeasureMenu } from "./pill-gga9iHqS.js";
7
+ import { u as useDragStore, a as useDrag, D as DragProvider } from "./drag-store-CO3z13Ju.js";
6
8
  import "@1771technologies/react-sizer";
7
9
  import { useCombinedRefs } from "@1771technologies/react-utils";
8
10
  import "@1771technologies/grid-provider";
9
- import "@1771technologies/react-dragon";
10
11
  import "@1771technologies/grid-core";
11
12
  import { D as DragIcon, M as MeasuresIcon, C as ColumnPivotIcon, R as RowGroupIcon } from "./row-group-icon-D8JA6sh9.js";
12
- import { M as MenuRoot, a as MenuPortal, b as MenuPositioner } from "./MenuRoot-9n64jNWP.js";
13
+ import { M as MoreDotsIcon } from "./more-dots-icon-CzAH3xHG.js";
14
+ import { M as MenuRoot, a as MenuPortal } from "./column-menu-driver-cG-EZgLa.js";
15
+ import { M as MenuPositioner } from "./menu-CkfZmNR3.js";
13
16
  import { M as ManageColumnsIcon, C as CollapseIcon, E as ExpandIcon } from "./manage-columns-icon-D4CElo5H.js";
14
17
  import { createPortal } from "react-dom";
15
- import { M as MoreDotsIcon } from "./more-dots-icon-CzAH3xHG.js";
16
18
  function useColumnSource(source) {
17
19
  const { api, state: sx } = useGrid();
18
20
  const columns = sx.columns.use();
@@ -216,6 +218,25 @@ const PillManagerPills = forwardRef(function PillManagerRow3({ children, ...prop
216
218
  accepted: dropTags,
217
219
  data: dropData
218
220
  });
221
+ const grid = useGrid();
222
+ const gridId = grid.state.gridId.use();
223
+ const {
224
+ canDrop: canDropNative,
225
+ onDragOver,
226
+ onDrop
227
+ } = useDroppable$1({
228
+ tags: pillSource === "row-groups" ? [`${gridId}:grid:groupable`] : [],
229
+ onDrop: (p) => {
230
+ const data = p.getData();
231
+ const column = data?.columns?.[0];
232
+ document.body.classList.remove("lng1771-drag-on");
233
+ if (!column) return;
234
+ const id = column.id;
235
+ grid.state.rowGroupModel.set((prev) => [...prev, id]);
236
+ grid.api.columnUpdate(column, { hide: true });
237
+ }
238
+ });
239
+ const canDropEither = canDrop || canDropNative;
219
240
  const combined = useCombinedRefs(dropRef, ref);
220
241
  const store = useDragStore();
221
242
  const isActive = useDrag(store, (s) => !!s.active);
@@ -225,20 +246,22 @@ const PillManagerPills = forwardRef(function PillManagerRow3({ children, ...prop
225
246
  "div",
226
247
  {
227
248
  ...props,
249
+ onDragOver,
250
+ onDrop,
228
251
  className: clsx("lng1771-pill-manager__pills", props.className),
229
252
  "data-is-drop-target": isTarget,
230
253
  ref: allRefs,
231
254
  "data-pill-source": pillSource,
232
- "data-drop-visible": canDrop && sourceItems.filter((c) => c.active).length === 0,
255
+ "data-drop-visible": canDropEither && sourceItems.filter((c) => c.active).length === 0,
233
256
  tabIndex: -1,
234
257
  children: /* @__PURE__ */ jsxs("div", { className: "lng1771-pill-manager__pills-inner", children: [
235
258
  children({ pills: sourceItems }),
236
- canDrop && isNearestOver && sourceItems.filter((c) => c.active).length > 0 && /* @__PURE__ */ jsx("div", { className: "lng1771-pill-manager__drop-indicator-end" })
259
+ canDropEither && isNearestOver && sourceItems.filter((c) => c.active).length > 0 && /* @__PURE__ */ jsx("div", { className: "lng1771-pill-manager__drop-indicator-end" })
237
260
  ] })
238
261
  }
239
262
  );
240
263
  });
241
- const PillManagerPill = forwardRef(function PillManagerPill2({ item, ...props }, ref) {
264
+ const PillManagerPill = forwardRef(function PillManagerPill2({ item, menu, ...props }, ref) {
242
265
  const {
243
266
  ref: dropRef,
244
267
  isTarget,
@@ -261,12 +284,38 @@ const PillManagerPill = forwardRef(function PillManagerPill2({ item, ...props },
261
284
  menuTriggerIcon: TriggerIcon
262
285
  } = useComponents();
263
286
  const [isDragging, setIsDragging] = useState(false);
287
+ const gridId = grid.state.gridId.use();
288
+ const {
289
+ canDrop: canDropNative,
290
+ onDrop,
291
+ onDragOver
292
+ } = useDroppable$1({
293
+ tags: pillSource === "row-groups" ? [`${gridId}:grid:groupable`] : [],
294
+ onDrop: (p) => {
295
+ const data = p.getData();
296
+ const column = data?.columns?.[0];
297
+ document.body.classList.remove("lng1771-drag-on");
298
+ if (!column) return;
299
+ const id = column.id;
300
+ console.log(item);
301
+ grid.state.rowGroupModel.set((prev) => {
302
+ const index = prev.indexOf(item.dropData?.id ?? "");
303
+ if (index === -1) return prev;
304
+ const next = [...prev];
305
+ next.splice(index, 0, id);
306
+ return next;
307
+ });
308
+ grid.api.columnUpdate(column, { hide: true });
309
+ }
310
+ });
264
311
  return /* @__PURE__ */ jsxs(
265
312
  "div",
266
313
  {
267
314
  ...props,
268
315
  role: "button",
269
316
  ref: combinedRefs,
317
+ onDrop,
318
+ onDragOver,
270
319
  "data-pill-key": item.dropId,
271
320
  "data-pill-active": item.active,
272
321
  "data-is-droppable": isTarget && canDrop,
@@ -312,12 +361,26 @@ const PillManagerPill = forwardRef(function PillManagerPill2({ item, ...props },
312
361
  item.isAggregation && /* @__PURE__ */ jsx(AggMenu, { grid, column: item.column }),
313
362
  item.isMeasure && /* @__PURE__ */ jsx(MeasureMenu, { grid, column: item.column })
314
363
  ] }) })
315
- ] })
364
+ ] }),
365
+ menu && /* @__PURE__ */ jsx(
366
+ "button",
367
+ {
368
+ className: "lng1771-pill-manager__menu-trigger",
369
+ style: { marginRight: -4 },
370
+ onClick: (e) => {
371
+ e.preventDefault();
372
+ e.stopPropagation();
373
+ grid.api.menuFrameOpen(menu, e.currentTarget);
374
+ },
375
+ children: /* @__PURE__ */ jsx(MoreDotsIcon, { width: 14, height: 14 })
376
+ }
377
+ )
316
378
  ]
317
379
  }
318
380
  ),
319
381
  canDrop && (rtl ? "left" : "right") === xHalf && /* @__PURE__ */ jsx("div", { className: "lng1771-pill-manager__drop-indicator-end" }),
320
- canDrop && (rtl ? "right" : "left") === xHalf && /* @__PURE__ */ jsx("div", { className: "lng1771-pill-manager__drop-indicator-start" })
382
+ canDrop && (rtl ? "right" : "left") === xHalf && /* @__PURE__ */ jsx("div", { className: "lng1771-pill-manager__drop-indicator-start" }),
383
+ canDropNative && /* @__PURE__ */ jsx("div", { className: "lng1771-pill-manager__drop-indicator-start" })
321
384
  ]
322
385
  }
323
386
  );
package/dist/popover.js CHANGED
@@ -2,11 +2,11 @@ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import { useMemo, forwardRef } from "react";
4
4
  import { clsx } from "@1771technologies/js-utils";
5
- import { A as ArrowSvg } from "./arrow-svg-evmXDI_J.js";
6
- import { u as usePopoverRootContext, a as usePopoverPortalContext, b as useAnchor } from "./anchor-context-B9sGQdR5.js";
7
- import { m as mergeProps, k as useForkRef, v as useComponentRenderer, w as popupStateMapping, I as InternalBackdrop, P as PropTypes, H as HTMLElementType, r as refType, y as useOpenChangeComplete, M as FloatingFocusManager, u as useEnhancedEffect, j as useEventCallback } from "./InternalBackdrop-Dm9czgoC.js";
8
- import { t as transitionStatusMapping, u as useBaseUiId } from "./useBaseUiId-J66PFGv_.js";
9
- import { u as useAnchorPositioning } from "./useAnchorPositioning-Cm44rb7y.js";
5
+ import { u as useAnchor } from "./anchor-context-Cqr_oiJt.js";
6
+ import { m as mergeProps, P as PropTypes, H as HTMLElementType, r as refType, n as useOpenChangeComplete, D as FloatingFocusManager, d as useEnhancedEffect, j as useEventCallback } from "./proptypes-BjYr2nFr.js";
7
+ import { u as usePopoverRootContext, a as usePopoverPortalContext } from "./PopoverPortalContext-BdsDjihw.js";
8
+ import { u as useForkRef, a as useComponentRenderer, p as popupStateMapping, I as InternalBackdrop, t as transitionStatusMapping, b as useBaseUiId } from "./InternalBackdrop-C4RACVzs.js";
9
+ import { u as useAnchorPositioning } from "./useAnchorPositioning-52zK7jlD.js";
10
10
  function usePopoverPositioner(params) {
11
11
  const {
12
12
  open,
@@ -706,6 +706,31 @@ function usePopoverClass(name, className) {
706
706
  return (p) => clsx(name, className(p));
707
707
  }, [className, name]);
708
708
  }
709
+ function ArrowSvg(props) {
710
+ return /* @__PURE__ */ jsxs("svg", { width: "20", height: "10", viewBox: "0 0 20 10", fill: "currentcolor", ...props, children: [
711
+ /* @__PURE__ */ jsx(
712
+ "path",
713
+ {
714
+ fill: "var(--lng1771-gray-05)",
715
+ d: "M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z"
716
+ }
717
+ ),
718
+ /* @__PURE__ */ jsx(
719
+ "path",
720
+ {
721
+ fill: "var(--lng1771-gray-05)",
722
+ d: "M8.99542 1.85876C9.75604 1.17425 10.9106 1.17422 11.6713 1.85878L16.5281 6.22989C17.0789 6.72568 17.7938 7.00001 18.5349 7.00001L15.89 7L11.0023 2.60207C10.622 2.2598 10.0447 2.2598 9.66436 2.60207L4.77734 7L2.13171 7.00001C2.87284 7.00001 3.58774 6.72568 4.13861 6.22989L8.99542 1.85876Z"
723
+ }
724
+ ),
725
+ /* @__PURE__ */ jsx(
726
+ "path",
727
+ {
728
+ fill: "var(--lng1771-gray-30)",
729
+ d: "M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z"
730
+ }
731
+ )
732
+ ] });
733
+ }
709
734
  const PopoverBackdrop2 = forwardRef(function PopoverBackdrop22({ className, ...props }, ref) {
710
735
  const cl = usePopoverClass("lng1771-popover__backdrop", className);
711
736
  return /* @__PURE__ */ jsx(PopoverBackdrop$1, { ...props, ref, className: cl });
@@ -950,30 +950,6 @@ function requirePropTypes() {
950
950
  }
951
951
  var propTypesExports = /* @__PURE__ */ requirePropTypes();
952
952
  const PropTypes = /* @__PURE__ */ getDefaultExportFromCjs(propTypesExports);
953
- function getStyleHookProps(state, customMapping) {
954
- let props = {};
955
- Object.entries(state).forEach(([key, value]) => {
956
- if (customMapping?.hasOwnProperty(key)) {
957
- const customProps = customMapping[key](value);
958
- if (customProps != null) {
959
- props = {
960
- ...props,
961
- ...customProps
962
- };
963
- }
964
- return;
965
- }
966
- if (value === true) {
967
- props[`data-${key.toLowerCase()}`] = "";
968
- } else if (value) {
969
- props[`data-${key.toLowerCase()}`] = value.toString();
970
- }
971
- });
972
- return props;
973
- }
974
- function resolveClassName(className, state) {
975
- return typeof className === "function" ? className(state) : className;
976
- }
977
953
  function mergeProps$1(...props) {
978
954
  if (props.length === 0) {
979
955
  return {};
@@ -1076,224 +1052,6 @@ function mergeClassNames(ourClassName, theirClassName) {
1076
1052
  function isSyntheticEvent(event) {
1077
1053
  return event != null && typeof event === "object" && "nativeEvent" in event;
1078
1054
  }
1079
- function evaluateRenderProp(render, props, state) {
1080
- return typeof render === "function" ? render(props, state) : /* @__PURE__ */ React.cloneElement(render, {
1081
- ...mergeProps$1(props, render.props),
1082
- ref: props.ref
1083
- });
1084
- }
1085
- function useForkRef(...refs) {
1086
- const cleanupRef = React.useRef(void 0);
1087
- const refEffect = React.useCallback((instance) => {
1088
- const cleanups = refs.map((ref) => {
1089
- if (ref == null) {
1090
- return null;
1091
- }
1092
- if (typeof ref === "function") {
1093
- const refCallback = ref;
1094
- const refCleanup = refCallback(instance);
1095
- return typeof refCleanup === "function" ? refCleanup : () => {
1096
- refCallback(null);
1097
- };
1098
- }
1099
- ref.current = instance;
1100
- return () => {
1101
- ref.current = null;
1102
- };
1103
- });
1104
- return () => {
1105
- cleanups.forEach((refCleanup) => refCleanup?.());
1106
- };
1107
- }, refs);
1108
- return React.useMemo(() => {
1109
- if (refs.every((ref) => ref == null)) {
1110
- return null;
1111
- }
1112
- return (value) => {
1113
- if (cleanupRef.current) {
1114
- cleanupRef.current();
1115
- cleanupRef.current = void 0;
1116
- }
1117
- if (value != null) {
1118
- cleanupRef.current = refEffect(value);
1119
- }
1120
- };
1121
- }, refs);
1122
- }
1123
- const majorVersion = parseInt(React.version, 10);
1124
- function isReactVersionAtLeast(reactVersionToCheck) {
1125
- return majorVersion >= reactVersionToCheck;
1126
- }
1127
- function useRenderPropForkRef(render, ...refs) {
1128
- let childRef;
1129
- if (typeof render !== "function") {
1130
- childRef = isReactVersionAtLeast(19) ? render.props.ref : render.ref;
1131
- } else {
1132
- childRef = null;
1133
- }
1134
- return useForkRef(childRef, ...refs);
1135
- }
1136
- const defaultRenderFunctions = {
1137
- button: (props) => {
1138
- return /* @__PURE__ */ jsx("button", {
1139
- type: "button",
1140
- ...props
1141
- });
1142
- },
1143
- div: (props) => {
1144
- return /* @__PURE__ */ jsx("div", {
1145
- ...props
1146
- });
1147
- },
1148
- h2: (props) => {
1149
- return /* @__PURE__ */ jsx("h2", {
1150
- ...props
1151
- });
1152
- },
1153
- h3: (props) => {
1154
- return /* @__PURE__ */ jsx("h3", {
1155
- ...props
1156
- });
1157
- },
1158
- output: (props) => {
1159
- return /* @__PURE__ */ jsx("output", {
1160
- ...props
1161
- });
1162
- },
1163
- p: (props) => {
1164
- return /* @__PURE__ */ jsx("p", {
1165
- ...props
1166
- });
1167
- },
1168
- span: (props) => {
1169
- return /* @__PURE__ */ jsx("span", {
1170
- ...props
1171
- });
1172
- },
1173
- a: (props) => {
1174
- return /* @__PURE__ */ jsx("a", {
1175
- ...props
1176
- });
1177
- },
1178
- label: (props) => {
1179
- return /* @__PURE__ */ jsx("label", {
1180
- ...props
1181
- });
1182
- },
1183
- input: (props) => {
1184
- return /* @__PURE__ */ jsx("input", {
1185
- ...props
1186
- });
1187
- },
1188
- fieldset: (props) => {
1189
- return /* @__PURE__ */ jsx("fieldset", {
1190
- ...props
1191
- });
1192
- },
1193
- form: (props) => {
1194
- return /* @__PURE__ */ jsx("form", {
1195
- ...props
1196
- });
1197
- },
1198
- img: (props) => {
1199
- return /* @__PURE__ */ jsx("img", {
1200
- alt: "",
1201
- ...props
1202
- });
1203
- }
1204
- };
1205
- const emptyObject = {};
1206
- function useComponentRenderer(settings) {
1207
- const {
1208
- render: renderProp,
1209
- className: classNameProp,
1210
- state,
1211
- ref,
1212
- propGetter = (props) => props,
1213
- extraProps,
1214
- customStyleHookMapping,
1215
- styleHooks: generateStyleHooks = true
1216
- } = settings;
1217
- const className = resolveClassName(classNameProp, state);
1218
- const styleHooks = React.useMemo(() => {
1219
- if (!generateStyleHooks) {
1220
- return emptyObject;
1221
- }
1222
- return getStyleHookProps(state, customStyleHookMapping);
1223
- }, [state, customStyleHookMapping, generateStyleHooks]);
1224
- const ownProps = {
1225
- ...styleHooks,
1226
- ...extraProps
1227
- };
1228
- let resolvedRenderProp;
1229
- if (typeof renderProp === "string") {
1230
- resolvedRenderProp = defaultRenderFunctions[renderProp];
1231
- } else {
1232
- resolvedRenderProp = renderProp;
1233
- }
1234
- let refs = [];
1235
- if (ref !== void 0) {
1236
- refs = Array.isArray(ref) ? ref : [ref];
1237
- }
1238
- const renderedElementProps = propGetter(ownProps);
1239
- const propsWithRef = {
1240
- ...renderedElementProps,
1241
- ref: useRenderPropForkRef(resolvedRenderProp, renderedElementProps.ref, ...refs)
1242
- };
1243
- if (className !== void 0) {
1244
- propsWithRef.className = className;
1245
- }
1246
- const renderElement = () => evaluateRenderProp(resolvedRenderProp, propsWithRef, state);
1247
- return {
1248
- renderElement
1249
- };
1250
- }
1251
- const TRIGGER_HOOK = {
1252
- "data-popup-open": ""
1253
- };
1254
- const PRESSABLE_TRIGGER_HOOK = {
1255
- "data-popup-open": "",
1256
- "data-pressed": ""
1257
- };
1258
- const POPUP_OPEN_HOOK = {
1259
- "data-open": ""
1260
- };
1261
- const POPUP_CLOSED_HOOK = {
1262
- "data-closed": ""
1263
- };
1264
- const ANCHOR_HIDDEN_HOOK = {
1265
- "data-anchor-hidden": ""
1266
- };
1267
- const triggerOpenStateMapping = {
1268
- open(value) {
1269
- if (value) {
1270
- return TRIGGER_HOOK;
1271
- }
1272
- return null;
1273
- }
1274
- };
1275
- const pressableTriggerOpenStateMapping = {
1276
- open(value) {
1277
- if (value) {
1278
- return PRESSABLE_TRIGGER_HOOK;
1279
- }
1280
- return null;
1281
- }
1282
- };
1283
- const popupStateMapping = {
1284
- open(value) {
1285
- if (value) {
1286
- return POPUP_OPEN_HOOK;
1287
- }
1288
- return POPUP_CLOSED_HOOK;
1289
- },
1290
- anchorHidden(value) {
1291
- if (value) {
1292
- return ANCHOR_HIDDEN_HOOK;
1293
- }
1294
- return null;
1295
- }
1296
- };
1297
1055
  function hasWindow() {
1298
1056
  return typeof window !== "undefined";
1299
1057
  }
@@ -6671,76 +6429,44 @@ function HTMLElementType(props, propName, componentName, location, propFullName)
6671
6429
  }
6672
6430
  return null;
6673
6431
  }
6674
- const InternalBackdrop = /* @__PURE__ */ React.forwardRef(function InternalBackdrop2(props, ref) {
6675
- return /* @__PURE__ */ jsx("div", {
6676
- ref,
6677
- role: "presentation",
6678
- "data-floating-ui-inert": true,
6679
- ...props,
6680
- style: {
6681
- position: "fixed",
6682
- inset: 0
6683
- }
6684
- });
6685
- });
6686
- process.env.NODE_ENV !== "production" ? InternalBackdrop.propTypes = {
6687
- // ┌────────────────────────────── Warning ──────────────────────────────┐
6688
- // │ These PropTypes are generated from the TypeScript type definitions. │
6689
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
6690
- // └─────────────────────────────────────────────────────────────────────┘
6691
- /**
6692
- * @ignore
6693
- */
6694
- children: PropTypes.node,
6695
- /**
6696
- * @ignore
6697
- */
6698
- className: PropTypes.string
6699
- } : void 0;
6700
6432
  export {
6701
- useHover as A,
6702
- safePolygon as B,
6703
- useClick as C,
6704
- useDismiss as D,
6705
- useRole as E,
6433
+ useInteractions as A,
6434
+ FloatingTree as B,
6435
+ getUserAgent as C,
6436
+ FloatingFocusManager as D,
6437
+ contains as E,
6706
6438
  FloatingPortal as F,
6707
- useListNavigation as G,
6439
+ useFloatingTree as G,
6708
6440
  HTMLElementType as H,
6709
- InternalBackdrop as I,
6710
- useTypeahead as J,
6711
- useInteractions as K,
6712
- FloatingTree as L,
6713
- FloatingFocusManager as M,
6714
- getUserAgent as N,
6715
- contains as O,
6441
+ useFloatingNodeId as I,
6442
+ useFloatingParentNodeId as J,
6443
+ FloatingNode as K,
6444
+ getTarget as L,
6716
6445
  PropTypes as P,
6717
- pressableTriggerOpenStateMapping as Q,
6718
- triggerOpenStateMapping as R,
6719
- getTarget as S,
6720
- useLatestRef as a,
6721
- size as b,
6722
- arrow as c,
6723
- useFloating as d,
6446
+ size as a,
6447
+ arrow as b,
6448
+ useFloating as c,
6449
+ useEnhancedEffect as d,
6724
6450
  autoUpdate as e,
6725
6451
  getAlignment as f,
6726
6452
  getSide as g,
6727
6453
  hide as h,
6728
6454
  flip as i,
6729
6455
  useEventCallback as j,
6730
- useForkRef as k,
6456
+ makeEventPreventable as k,
6731
6457
  limitShift as l,
6732
6458
  mergeProps$1 as m,
6733
- makeEventPreventable as n,
6459
+ useOpenChangeComplete as n,
6734
6460
  offset as o,
6735
- useFloatingTree as p,
6736
- useFloatingNodeId as q,
6461
+ useFloatingRootContext as p,
6462
+ useHover as q,
6737
6463
  refType as r,
6738
6464
  shift as s,
6739
- useFloatingParentNodeId as t,
6740
- useEnhancedEffect as u,
6741
- useComponentRenderer as v,
6742
- popupStateMapping as w,
6743
- FloatingNode as x,
6744
- useOpenChangeComplete as y,
6745
- useFloatingRootContext as z
6465
+ safePolygon as t,
6466
+ useLatestRef as u,
6467
+ useClick as v,
6468
+ useDismiss as w,
6469
+ useRole as x,
6470
+ useListNavigation as y,
6471
+ useTypeahead as z
6746
6472
  };