@overmap-ai/blocks 1.0.23 → 1.0.25-component-forms.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.
package/dist/blocks.js CHANGED
@@ -1,22 +1,23 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { useThemeContext, Badge as Badge$1, Flex as Flex$1, Box, Link, Text as Text$2, Button, IconButton as IconButton$1, Card, Inset, Dialog as Dialog$1, AlertDialog as AlertDialog$1, DropdownMenu as DropdownMenu$1, Kbd, Select as Select$1, Checkbox as Checkbox$1, Switch as Switch$1, Portal, TextField, Popover as Popover$1, TextArea as TextArea$1, Callout, Tooltip as Tooltip$1, Theme, Separator as Separator$1, TableRow } from "@radix-ui/themes";
3
3
  import { Theme as Theme2, updateThemeAppearanceClass, useThemeContext as useThemeContext2 } from "@radix-ui/themes";
4
- import React, { useMemo, useState, useLayoutEffect, useCallback, useEffect, Children, isValidElement, forwardRef, memo, createContext, useContext, cloneElement, createElement, useRef, useReducer, Fragment as Fragment$1 } from "react";
4
+ import React, { useMemo, useState, useLayoutEffect, useCallback, useEffect, Children, isValidElement, forwardRef, memo, createContext, useContext, cloneElement, createElement, useRef, useReducer } from "react";
5
5
  import { useMediaQuery } from "react-responsive";
6
6
  import { Cross1Icon, MagnifyingGlassIcon, CheckIcon, DragHandleDots2Icon, Cross2Icon, DividerHorizontalIcon, CaretSortIcon, ArrowUpIcon, ArrowDownIcon, MixerHorizontalIcon, Pencil1Icon, TrashIcon, DoubleArrowLeftIcon, ChevronLeftIcon, ChevronRightIcon, DoubleArrowRightIcon } from "@radix-ui/react-icons";
7
7
  import * as RadixDropdownMenu from "@radix-ui/react-dropdown-menu";
8
8
  import { isMobile } from "react-device-detect";
9
9
  import * as RadixDialogPrimitive from "@radix-ui/react-dialog";
10
10
  import { Resizable } from "re-resizable";
11
- import { DismissableLayer } from "@radix-ui/react-dismissable-layer";
12
11
  import { CSSTransition, Transition } from "react-transition-group";
13
- import { Root as Root$1, Item as Item$1 } from "@radix-ui/react-toggle-group";
14
- import { Root as Root$2 } from "@radix-ui/react-toolbar";
12
+ import ReactDOM, { flushSync } from "react-dom";
13
+ import { Slot } from "@radix-ui/react-slot";
14
+ import { DismissableLayer } from "@radix-ui/react-dismissable-layer";
15
+ import { Root as Root$2, Item as Item$1 } from "@radix-ui/react-toggle-group";
16
+ import { Root as Root$3 } from "@radix-ui/react-toolbar";
15
17
  import * as RadixToast from "@radix-ui/react-toast";
16
18
  import { ToastProvider as ToastProvider$1, ToastViewport as ToastViewport$1 } from "@radix-ui/react-toast";
17
19
  import { useErrorBoundary, ErrorBoundary } from "react-error-boundary";
18
20
  import FeatherIcon from "feather-icons-react";
19
- import { flushSync } from "react-dom";
20
21
  import { HeaderCell, Table as Table$1, Header, HeaderRow, Body, Cell, Row } from "@table-library/react-table-library/table.js";
21
22
  import { useTheme } from "@table-library/react-table-library/theme.js";
22
23
  import { useSort, HeaderCellSort } from "@table-library/react-table-library/sort.js";
@@ -212,7 +213,7 @@ const Badge = memo(_Badge);
212
213
  const zeroMinWidth = "_zeroMinWidth_curjh_1";
213
214
  const zeroMinHeight = "_zeroMinHeight_curjh_5";
214
215
  const radius = "_radius_curjh_9";
215
- const styles$m = {
216
+ const styles$n = {
216
217
  zeroMinWidth,
217
218
  zeroMinHeight,
218
219
  radius
@@ -224,9 +225,9 @@ const Flex = memo(
224
225
  Flex$1,
225
226
  {
226
227
  className: classNames(className, {
227
- [styles$m.radius]: radius2,
228
- [styles$m.zeroMinWidth]: zeroMinWidth2,
229
- [styles$m.zeroMinHeight]: zeroMinHeight2
228
+ [styles$n.radius]: radius2,
229
+ [styles$n.zeroMinWidth]: zeroMinWidth2,
230
+ [styles$n.zeroMinHeight]: zeroMinHeight2
230
231
  }),
231
232
  ref,
232
233
  ...rest,
@@ -279,16 +280,16 @@ const fluid$1 = "_fluid_r73gr_1";
279
280
  const hoverSpin90Clockwise = "_hoverSpin90Clockwise_r73gr_15";
280
281
  const hoverSpin180Clockwise = "_hoverSpin180Clockwise_r73gr_25";
281
282
  const hoverSpin360Clockwise = "_hoverSpin360Clockwise_r73gr_35";
282
- const styles$l = {
283
+ const styles$m = {
283
284
  fluid: fluid$1,
284
285
  hoverSpin90Clockwise,
285
286
  hoverSpin180Clockwise,
286
287
  hoverSpin360Clockwise
287
288
  };
288
289
  const hoverEffectClassNameMapping = {
289
- spin90Clockwise: styles$l.hoverSpin90Clockwise,
290
- spin180Clockwise: styles$l.hoverSpin180Clockwise,
291
- spin360Clockwise: styles$l.hoverSpin360Clockwise
290
+ spin90Clockwise: styles$m.hoverSpin90Clockwise,
291
+ spin180Clockwise: styles$m.hoverSpin180Clockwise,
292
+ spin360Clockwise: styles$m.hoverSpin360Clockwise
292
293
  };
293
294
  const clickOnEnterOrSpace = (e) => {
294
295
  if (e.key === "Enter" || e.key === " ") {
@@ -309,12 +310,12 @@ const ButtonGroupContext = createContext({});
309
310
  const useButtonGroupContext = () => useContext(ButtonGroupContext);
310
311
  const spinner = "_spinner_isifr_9";
311
312
  const spin = "_spin_isifr_9";
312
- const styles$k = {
313
+ const styles$l = {
313
314
  spinner,
314
315
  spin
315
316
  };
316
317
  const Spinner = memo(() => {
317
- return /* @__PURE__ */ jsx("div", { className: styles$k.spinner });
318
+ return /* @__PURE__ */ jsx("div", { className: styles$l.spinner });
318
319
  });
319
320
  Spinner.displayName = "Spinner";
320
321
  const _Button$1 = forwardRef(function Button$1(props, ref) {
@@ -350,7 +351,7 @@ const _Button$1 = forwardRef(function Button$1(props, ref) {
350
351
  ref,
351
352
  type,
352
353
  className: classNames(className, hoverEffectClasses, {
353
- [styles$l.fluid]: fluid2
354
+ [styles$m.fluid]: fluid2
354
355
  }),
355
356
  color,
356
357
  size: useResponsiveMapping(size, SizeMapping),
@@ -392,7 +393,7 @@ const _Button = forwardRef(function Button3(props, ref) {
392
393
  IconButton$1,
393
394
  {
394
395
  className: classNames(className, hoverEffectClasses, {
395
- [styles$l.fluid]: fluid2
396
+ [styles$m.fluid]: fluid2
396
397
  }),
397
398
  ref,
398
399
  color,
@@ -407,7 +408,7 @@ const _Button = forwardRef(function Button3(props, ref) {
407
408
  });
408
409
  const IconButton = React.memo(_Button);
409
410
  const merged = "_merged_wdgxo_1";
410
- const styles$j = {
411
+ const styles$k = {
411
412
  merged
412
413
  };
413
414
  const GhostVariantSizeToGapMapping = {
@@ -434,7 +435,7 @@ const _ButtonGroup = forwardRef(function ButtonGroup2({
434
435
  Flex$1,
435
436
  {
436
437
  className: classNames("overmap-button-group", className, {
437
- [styles$j.merged]: merged2
438
+ [styles$k.merged]: merged2
438
439
  }),
439
440
  ref,
440
441
  gap: merged2 ? gap ?? mergedAutoGap : gap ?? "2",
@@ -447,7 +448,7 @@ const _ButtonGroup = forwardRef(function ButtonGroup2({
447
448
  });
448
449
  const ButtonGroup = memo(_ButtonGroup);
449
450
  const separators = "_separators_1f7v1_1";
450
- const styles$i = {
451
+ const styles$j = {
451
452
  separators
452
453
  };
453
454
  const ButtonListBorder = memo(
@@ -478,7 +479,7 @@ const ButtonListRoot = memo(
478
479
  size,
479
480
  severity: "info",
480
481
  variant: buttonVariant,
481
- className: classNames(className, styles$i.separators),
482
+ className: classNames(className, styles$j.separators),
482
483
  merged: true,
483
484
  gap: "0",
484
485
  direction: "column",
@@ -673,7 +674,7 @@ const BaseMenuItem$1 = "_BaseMenuItem_5r3et_1";
673
674
  const RemoveOutline = "_RemoveOutline_5r3et_15";
674
675
  const BaseMenuSeparator$1 = "_BaseMenuSeparator_5r3et_19";
675
676
  const BaseMenuInput$1 = "_BaseMenuInput_5r3et_27";
676
- const styles$h = {
677
+ const styles$i = {
677
678
  BaseMenuItem: BaseMenuItem$1,
678
679
  RemoveOutline,
679
680
  BaseMenuSeparator: BaseMenuSeparator$1,
@@ -684,7 +685,7 @@ const BaseMenuItem = memo(
684
685
  return /* @__PURE__ */ jsx(
685
686
  Box,
686
687
  {
687
- className: classNames(styles$h.BaseMenuItem, className),
688
+ className: classNames(styles$i.BaseMenuItem, className),
688
689
  ref,
689
690
  position: "relative",
690
691
  px: "2",
@@ -700,11 +701,11 @@ const BaseMenuItem = memo(
700
701
  );
701
702
  const BaseMenuInput = memo(
702
703
  forwardRef((props) => {
703
- return /* @__PURE__ */ jsx(Box, { className: styles$h.BaseMenuInput, px: "2", height: "6", width: "max-content", children: /* @__PURE__ */ jsx(Input, { ...props, variant: "ghost" }) });
704
+ return /* @__PURE__ */ jsx(Box, { className: styles$i.BaseMenuInput, px: "2", height: "6", width: "max-content", children: /* @__PURE__ */ jsx(Input, { ...props, variant: "ghost" }) });
704
705
  })
705
706
  );
706
707
  const BaseMenuSeparator = memo(function BaseMenuSeparator2() {
707
- return /* @__PURE__ */ jsx(Box, { className: styles$h.BaseMenuSeparator, width: "100%", py: "1", children: /* @__PURE__ */ jsx(Box, { height: "0", width: "100%" }) });
708
+ return /* @__PURE__ */ jsx(Box, { className: styles$i.BaseMenuSeparator, width: "100%", py: "1", children: /* @__PURE__ */ jsx(Box, { height: "0", width: "100%" }) });
708
709
  });
709
710
  const useCloseOnSelectHandler = (closeOnSelect) => {
710
711
  return useCallback(
@@ -767,7 +768,7 @@ const BaseItemGroup = memo(function BaseItemGroup2({
767
768
  const itemContent = /* @__PURE__ */ jsx(
768
769
  ItemElement,
769
770
  {
770
- className: classNames(className, styles$h.RemoveOutline),
771
+ className: classNames(className, styles$i.RemoveOutline),
771
772
  onSelect: closeOnSelectHandler(onSelect),
772
773
  textValue: "",
773
774
  asChild: true,
@@ -830,7 +831,7 @@ const BaseSelectGroup = memo(function BaseSelectGroup2({
830
831
  items.map(({ content, value: itemValue, onSelect, ...rest }, index) => /* @__PURE__ */ jsx(
831
832
  ItemElement,
832
833
  {
833
- className: styles$h.RemoveOutline,
834
+ className: styles$i.RemoveOutline,
834
835
  checked: itemValue === value,
835
836
  onCheckedChange: handleCheckedChange(itemValue),
836
837
  onSelect: closeOnSelectHandler(onSelect),
@@ -909,7 +910,7 @@ const BaseMultiSelectGroup = memo(function BaseMultiSelectGroup2({
909
910
  items.map(({ value, content, className, onSelect, ...rest }, index) => /* @__PURE__ */ jsx(
910
911
  ItemElement,
911
912
  {
912
- className: classNames(className, styles$h.RemoveOutline),
913
+ className: classNames(className, styles$i.RemoveOutline),
913
914
  onSelect: closeOnSelectHandler(onSelect),
914
915
  onCheckedChange: handleCheckedChange(value),
915
916
  checked: values.includes(value),
@@ -941,7 +942,7 @@ const BaseSubMenuGroup = memo(function BaseSubMenuGroup2({
941
942
  }) {
942
943
  return /* @__PURE__ */ jsxs(Fragment, { children: [
943
944
  /* @__PURE__ */ jsx(GroupElement, { ...rest, children: items.map(({ triggerIndicator, content, subContent, className, ...rest2 }, index) => /* @__PURE__ */ jsxs(SubElement, { children: [
944
- /* @__PURE__ */ jsx(SubTriggerElement, { className: classNames(className, styles$h.RemoveOutline), asChild: true, ...rest2, children: /* @__PURE__ */ jsx(BaseMenuItem, { rightSlot: triggerIndicator, children: content }) }),
945
+ /* @__PURE__ */ jsx(SubTriggerElement, { className: classNames(className, styles$i.RemoveOutline), asChild: true, ...rest2, children: /* @__PURE__ */ jsx(BaseMenuItem, { rightSlot: triggerIndicator, children: content }) }),
945
946
  /* @__PURE__ */ jsx(SubContentElement, { sideOffset: 10, children: subContent })
946
947
  ] }, index)) }),
947
948
  separator && /* @__PURE__ */ jsx(BaseMenuSeparator, {})
@@ -1098,7 +1099,7 @@ const HoverUtility = memo(function Root({ children }) {
1098
1099
  });
1099
1100
  });
1100
1101
  const fluid = "_fluid_7n1wr_1";
1101
- const styles$g = {
1102
+ const styles$h = {
1102
1103
  fluid
1103
1104
  };
1104
1105
  const _Select = forwardRef(function Select2({
@@ -1122,7 +1123,7 @@ const _Select = forwardRef(function Select2({
1122
1123
  Select$1.Trigger,
1123
1124
  {
1124
1125
  className: classNames(className, {
1125
- [styles$g.fluid]: fluid2
1126
+ [styles$h.fluid]: fluid2
1126
1127
  }),
1127
1128
  id,
1128
1129
  ref,
@@ -1134,7 +1135,7 @@ const _Select = forwardRef(function Select2({
1134
1135
  Select$1.Content,
1135
1136
  {
1136
1137
  side,
1137
- className: styles$g.contentDefault,
1138
+ className: styles$h.contentDefault,
1138
1139
  position: "popper",
1139
1140
  variant: variant !== "surface" ? "soft" : "solid",
1140
1141
  color: itemSeverityColor,
@@ -1247,7 +1248,7 @@ const MultiSelect = memo(
1247
1248
  );
1248
1249
  })
1249
1250
  );
1250
- const styles$f = {
1251
+ const styles$g = {
1251
1252
  "default": "_default_u936h_1"
1252
1253
  };
1253
1254
  const _Switch = forwardRef(function Switch2({ className, severity = "primary", icon, defaultChecked = false, onCheckedChange, ...rest }, ref) {
@@ -1275,7 +1276,7 @@ const _Switch = forwardRef(function Switch2({ className, severity = "primary", i
1275
1276
  /* @__PURE__ */ jsx(
1276
1277
  Switch$1,
1277
1278
  {
1278
- className: classNames("overmap-switch", className, styles$f.default),
1279
+ className: classNames("overmap-switch", className, styles$g.default),
1279
1280
  ref: ref ? ref : fallbackRef,
1280
1281
  color: severityColor,
1281
1282
  radius: "full",
@@ -1289,15 +1290,15 @@ const _Switch = forwardRef(function Switch2({ className, severity = "primary", i
1289
1290
  });
1290
1291
  const Switch = memo(_Switch);
1291
1292
  const sidebarContent = "_sidebarContent_1onyo_1";
1292
- const right$2 = "_right_1onyo_7";
1293
+ const right$1 = "_right_1onyo_7";
1293
1294
  const resizeHandle$1 = "_resizeHandle_1onyo_10";
1294
- const left$2 = "_left_1onyo_13";
1295
+ const left$1 = "_left_1onyo_13";
1295
1296
  const overlay = "_overlay_1onyo_33";
1296
- const styles$e = {
1297
+ const styles$f = {
1297
1298
  sidebarContent,
1298
- right: right$2,
1299
+ right: right$1,
1299
1300
  resizeHandle: resizeHandle$1,
1300
- left: left$2,
1301
+ left: left$1,
1301
1302
  overlay
1302
1303
  };
1303
1304
  const defaultSidebarSize = { width: "auto", height: "100%" };
@@ -1326,13 +1327,13 @@ const _Sidebar = forwardRef(function Sidebar2({
1326
1327
  setContainer(tempContainer);
1327
1328
  }, [containerSelector]);
1328
1329
  return /* @__PURE__ */ jsx(RadixDialogPrimitive.Root, { open, modal, children: /* @__PURE__ */ jsxs(RadixDialogPrimitive.Portal, { container, children: [
1329
- overlay2 && /* @__PURE__ */ jsx(RadixDialogPrimitive.Overlay, { className: classNames(styles$e.overlay) }),
1330
+ overlay2 && /* @__PURE__ */ jsx(RadixDialogPrimitive.Overlay, { className: classNames(styles$f.overlay) }),
1330
1331
  /* @__PURE__ */ jsx(
1331
1332
  RadixDialogPrimitive.Content,
1332
1333
  {
1333
- className: classNames("overmap-sidebar", "rt-DialogContent", styles$e.sidebarContent, {
1334
- [styles$e.left]: isLeft,
1335
- [styles$e.right]: isRight
1334
+ className: classNames("overmap-sidebar", "rt-DialogContent", styles$f.sidebarContent, {
1335
+ [styles$f.left]: isLeft,
1336
+ [styles$f.right]: isRight
1336
1337
  }),
1337
1338
  ref,
1338
1339
  asChild: true,
@@ -1344,7 +1345,7 @@ const _Sidebar = forwardRef(function Sidebar2({
1344
1345
  maxWidth,
1345
1346
  defaultSize: defaultSidebarSize,
1346
1347
  enable: { right: resizable2 && isLeft, left: resizable2 && isRight },
1347
- handleClasses: { left: styles$e.resizeHandle, right: styles$e.resizeHandle },
1348
+ handleClasses: { left: styles$f.resizeHandle, right: styles$f.resizeHandle },
1348
1349
  handleComponent: {
1349
1350
  right: /* @__PURE__ */ jsx(DragHandleDots2Icon, {}),
1350
1351
  left: /* @__PURE__ */ jsx(DragHandleDots2Icon, {})
@@ -1357,111 +1358,568 @@ const _Sidebar = forwardRef(function Sidebar2({
1357
1358
  ] }) });
1358
1359
  });
1359
1360
  const Sidebar = memo(_Sidebar);
1360
- const outerContent = "_outerContent_n84eo_1";
1361
- const enter = "_enter_n84eo_4";
1362
- const right$1 = "_right_n84eo_7";
1363
- const left$1 = "_left_n84eo_11";
1364
- const enterActive = "_enterActive_n84eo_15";
1365
- const exitActive = "_exitActive_n84eo_28";
1366
- const exitDone = "_exitDone_n84eo_41";
1367
- const resizable$1 = "_resizable_n84eo_53";
1368
- const slideOutOverlay = "_slideOutOverlay_n84eo_59";
1369
- const styles$d = {
1370
- outerContent,
1371
- enter,
1372
- right: right$1,
1373
- left: left$1,
1374
- enterActive,
1375
- exitActive,
1376
- exitDone,
1377
- resizable: resizable$1,
1378
- slideOutOverlay
1361
+ const LayoutContext = createContext({});
1362
+ const Root$1 = memo((props) => {
1363
+ const { children, small = false, hideLayout = false } = props;
1364
+ const [showLeftSlideOut, setShowLeftSlideOut] = useState(false);
1365
+ const [showRightSlideOut, setShowRightSlideOut] = useState(false);
1366
+ const contextValue = useMemo(
1367
+ () => ({
1368
+ small,
1369
+ hideLayout,
1370
+ showLeftSlideOut,
1371
+ setShowLeftSlideOut,
1372
+ showRightSlideOut,
1373
+ setShowRightSlideOut
1374
+ }),
1375
+ [hideLayout, showLeftSlideOut, showRightSlideOut, small]
1376
+ );
1377
+ return /* @__PURE__ */ jsx(LayoutContext.Provider, { value: contextValue, children });
1378
+ });
1379
+ Root$1.displayName = "Layout.Root";
1380
+ const useLayoutContext = () => useContext(LayoutContext);
1381
+ const Container = memo(
1382
+ forwardRef((props, ref) => {
1383
+ const { children, style, grow = "1", height = "100%", position, ...rest } = props;
1384
+ const { hideLayout = false } = useLayoutContext();
1385
+ return !hideLayout && /* @__PURE__ */ jsx(Flex$1, { ref, grow, height, position, style, ...rest, children });
1386
+ })
1387
+ );
1388
+ const SlideOutOverlay = memo(
1389
+ forwardRef((props, ref) => {
1390
+ const { className, style, active, side, smallModeOnly = false } = props;
1391
+ const { small, hideLayout, showLeftSlideOut, showRightSlideOut } = useLayoutContext();
1392
+ const showOverlay = useMemo(() => {
1393
+ if (active !== void 0)
1394
+ return active;
1395
+ if (hideLayout)
1396
+ return false;
1397
+ if (smallModeOnly && !small)
1398
+ return false;
1399
+ return side === "left" ? showLeftSlideOut : showRightSlideOut;
1400
+ }, [active, hideLayout, showLeftSlideOut, showRightSlideOut, side, small, smallModeOnly]);
1401
+ return showOverlay && /* @__PURE__ */ jsx(
1402
+ Flex$1,
1403
+ {
1404
+ className: classNames("overmap-layout-overlay", className),
1405
+ style: { ...style },
1406
+ ref,
1407
+ position: "absolute",
1408
+ inset: "0"
1409
+ }
1410
+ );
1411
+ })
1412
+ );
1413
+ function usePointerDownOutside(onPointerDownOutside, ownerElement = globalThis == null ? void 0 : globalThis.document.body) {
1414
+ const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
1415
+ const isPointerInsideReactTreeRef = useRef(false);
1416
+ const handleClickRef = useRef(() => {
1417
+ });
1418
+ useEffect(() => {
1419
+ const handlePointerDown = (event) => {
1420
+ if (event.target && !isPointerInsideReactTreeRef.current) {
1421
+ const eventDetail = { originalEvent: event };
1422
+ const handleAndDispatchPointerDownOutsideEvent = () => {
1423
+ handleAndDispatchCustomEvent("pointerDownOutside", handlePointerDownOutside, eventDetail, {
1424
+ discrete: true
1425
+ });
1426
+ };
1427
+ if (event.pointerType === "touch") {
1428
+ ownerElement.removeEventListener("click", handleClickRef.current);
1429
+ handleClickRef.current = handleAndDispatchPointerDownOutsideEvent;
1430
+ ownerElement.addEventListener("click", handleClickRef.current, { once: true });
1431
+ } else {
1432
+ handleAndDispatchPointerDownOutsideEvent();
1433
+ }
1434
+ } else {
1435
+ ownerElement.removeEventListener("click", handleClickRef.current);
1436
+ }
1437
+ isPointerInsideReactTreeRef.current = false;
1438
+ };
1439
+ const timerId = window.setTimeout(() => {
1440
+ ownerElement.addEventListener("pointerdown", handlePointerDown);
1441
+ }, 0);
1442
+ return () => {
1443
+ window.clearTimeout(timerId);
1444
+ ownerElement.removeEventListener("pointerdown", handlePointerDown);
1445
+ ownerElement.removeEventListener("click", handleClickRef.current);
1446
+ };
1447
+ }, [ownerElement, handlePointerDownOutside]);
1448
+ return {
1449
+ // ensures we check React component tree (not just DOM tree)
1450
+ onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
1451
+ };
1452
+ }
1453
+ function dispatchDiscreteCustomEvent(target, event) {
1454
+ if (target)
1455
+ ReactDOM.flushSync(() => target.dispatchEvent(event));
1456
+ }
1457
+ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
1458
+ const target = detail.originalEvent.target;
1459
+ const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });
1460
+ if (handler)
1461
+ target.addEventListener(name, handler, { once: true });
1462
+ if (discrete) {
1463
+ dispatchDiscreteCustomEvent(target, event);
1464
+ } else {
1465
+ target.dispatchEvent(event);
1466
+ }
1467
+ }
1468
+ function useCallbackRef(callback) {
1469
+ const callbackRef = useRef(callback);
1470
+ useEffect(() => {
1471
+ callbackRef.current = callback;
1472
+ });
1473
+ return useMemo(() => (...args) => {
1474
+ var _a;
1475
+ return (_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef, ...args);
1476
+ }, []);
1477
+ }
1478
+ const EnterRight$1 = "_EnterRight_1jwyv_2";
1479
+ const EnterActiveRight$1 = "_EnterActiveRight_1jwyv_6";
1480
+ const EnterDoneRight$1 = "_EnterDoneRight_1jwyv_11";
1481
+ const ExitRight$1 = "_ExitRight_1jwyv_15";
1482
+ const ExitActiveRight$1 = "_ExitActiveRight_1jwyv_19";
1483
+ const ExitDoneRight$1 = "_ExitDoneRight_1jwyv_24";
1484
+ const EnterLeft$1 = "_EnterLeft_1jwyv_29";
1485
+ const EnterActiveLeft$1 = "_EnterActiveLeft_1jwyv_33";
1486
+ const EnterDoneLeft$1 = "_EnterDoneLeft_1jwyv_38";
1487
+ const ExitLeft$1 = "_ExitLeft_1jwyv_42";
1488
+ const ExitActiveLeft$1 = "_ExitActiveLeft_1jwyv_46";
1489
+ const ExitDoneLeft$1 = "_ExitDoneLeft_1jwyv_51";
1490
+ const Overlay$1 = "_Overlay_1jwyv_56";
1491
+ const styles$e = {
1492
+ EnterRight: EnterRight$1,
1493
+ EnterActiveRight: EnterActiveRight$1,
1494
+ EnterDoneRight: EnterDoneRight$1,
1495
+ ExitRight: ExitRight$1,
1496
+ ExitActiveRight: ExitActiveRight$1,
1497
+ ExitDoneRight: ExitDoneRight$1,
1498
+ EnterLeft: EnterLeft$1,
1499
+ EnterActiveLeft: EnterActiveLeft$1,
1500
+ EnterDoneLeft: EnterDoneLeft$1,
1501
+ ExitLeft: ExitLeft$1,
1502
+ ExitActiveLeft: ExitActiveLeft$1,
1503
+ ExitDoneLeft: ExitDoneLeft$1,
1504
+ Overlay: Overlay$1
1379
1505
  };
1380
- const TRANSITION_DURATION$1 = 200;
1381
- const SlideOut = memo(function SlideOut2({
1382
- className,
1383
- open,
1384
- side = "left",
1385
- children,
1386
- minWidth,
1387
- maxWidth,
1388
- resizable: resizable2 = true,
1389
- overlay: overlay2 = false,
1390
- modal = false,
1391
- resizeHandle: resizeHandle2,
1392
- position = "absolute",
1393
- overlayClassName,
1394
- ...rest
1395
- }) {
1396
- const contentRef = useRef(null);
1397
- const [slideOutWidth, setSideBarWith] = useState(minWidth);
1398
- const isSideLeft = side === "left";
1399
- const isSideRight = side === "right";
1400
- const handleResize = useCallback(
1401
- (_event, _dir, ref, _delta) => {
1402
- setSideBarWith(ref.clientWidth);
1403
- if (contentRef.current) {
1404
- contentRef.current.style.width = `${ref.clientWidth}px`;
1506
+ const TIMEOUT_DURATION$1 = 200;
1507
+ const SlideOutV3 = memo(
1508
+ forwardRef((props, ref) => {
1509
+ const {
1510
+ className,
1511
+ style,
1512
+ children,
1513
+ open,
1514
+ modal = false,
1515
+ overlayComponent,
1516
+ resizeable = true,
1517
+ side,
1518
+ position = "relative",
1519
+ initialWidth,
1520
+ minWidth,
1521
+ maxWidth,
1522
+ onDismiss,
1523
+ onOpening,
1524
+ onClosed,
1525
+ content
1526
+ } = props;
1527
+ const isLeft = side === "left";
1528
+ const [parentContainer, setParentContainer] = useState(document.body);
1529
+ const childrenContainerRef = useRef(null);
1530
+ const [slideOutWidth, setSlideOutWidth] = useState(initialWidth);
1531
+ const handleResize = useCallback(
1532
+ (_event, _dir, ref2, _delta) => {
1533
+ setSlideOutWidth(ref2.clientWidth);
1534
+ },
1535
+ []
1536
+ );
1537
+ const handleDismiss = useCallback(() => {
1538
+ if (modal && onDismiss) {
1539
+ onDismiss();
1405
1540
  }
1406
- },
1407
- []
1408
- );
1409
- return /* @__PURE__ */ jsx(
1410
- CSSTransition,
1411
- {
1412
- in: open,
1413
- classNames: {
1414
- enter: styles$d.enter,
1415
- enterActive: styles$d.enterActive,
1416
- exitActive: styles$d.exitActive,
1417
- exitDone: styles$d.exitDone
1541
+ }, [modal, onDismiss]);
1542
+ const handleAssignParentContainer = useCallback((element) => {
1543
+ if (element) {
1544
+ setParentContainer(element);
1545
+ }
1546
+ }, []);
1547
+ useEffect(() => {
1548
+ setSlideOutWidth(initialWidth);
1549
+ }, [initialWidth]);
1550
+ useEffect(() => {
1551
+ if (!childrenContainerRef.current)
1552
+ return;
1553
+ const originalParentPointerEvents = childrenContainerRef.current.style.pointerEvents;
1554
+ if (open && modal) {
1555
+ childrenContainerRef.current.style.pointerEvents = "none";
1556
+ }
1557
+ return () => {
1558
+ if (childrenContainerRef.current) {
1559
+ childrenContainerRef.current.style.pointerEvents = originalParentPointerEvents;
1560
+ }
1561
+ };
1562
+ }, [modal, open, parentContainer.style]);
1563
+ const { onPointerDownCapture: handlePointerDownCapture } = usePointerDownOutside(handleDismiss, parentContainer);
1564
+ const CSSTransitionClassNames = useMemo(
1565
+ () => ({
1566
+ enter: isLeft ? styles$e.EnterLeft : styles$e.EnterRight,
1567
+ enterActive: isLeft ? styles$e.EnterActiveLeft : styles$e.EnterActiveRight,
1568
+ enterDone: isLeft ? styles$e.EnterDoneLeft : styles$e.EnterDoneRight,
1569
+ exit: isLeft ? styles$e.ExitLeft : styles$e.ExitRight,
1570
+ exitActive: isLeft ? styles$e.ExitActiveLeft : styles$e.ExitActiveRight,
1571
+ exitDone: isLeft ? styles$e.ExitDoneLeft : styles$e.ExitDoneRight
1572
+ }),
1573
+ [isLeft]
1574
+ );
1575
+ const resizableSize = useMemo(
1576
+ () => (
1577
+ // prettier-ignore
1578
+ { width: slideOutWidth, height: "100%" }
1579
+ ),
1580
+ [slideOutWidth]
1581
+ );
1582
+ const resizableStyle = useMemo(
1583
+ () => ({
1584
+ position,
1585
+ "--slide-out-width": `${slideOutWidth}${typeof slideOutWidth === "number" ? "px" : ""}`
1586
+ }),
1587
+ [position, slideOutWidth]
1588
+ );
1589
+ const resizableEnable = useMemo(
1590
+ () => ({ left: resizeable && !isLeft, right: resizeable && isLeft }),
1591
+ [isLeft, resizeable]
1592
+ );
1593
+ const SlideOut2 = useMemo(
1594
+ () => /* @__PURE__ */ jsx(
1595
+ CSSTransition,
1596
+ {
1597
+ classNames: CSSTransitionClassNames,
1598
+ in: open,
1599
+ timeout: TIMEOUT_DURATION$1,
1600
+ unmountOnExit: true,
1601
+ mountOnEnter: true,
1602
+ onEntering: onOpening,
1603
+ onExited: onClosed,
1604
+ children: /* @__PURE__ */ jsx(
1605
+ Flex$1,
1606
+ {
1607
+ className,
1608
+ top: "0",
1609
+ bottom: "0",
1610
+ left: isLeft ? "0" : void 0,
1611
+ right: !isLeft ? "0" : void 0,
1612
+ position,
1613
+ asChild: true,
1614
+ style,
1615
+ onPointerDownCapture: handlePointerDownCapture,
1616
+ ref,
1617
+ children: /* @__PURE__ */ jsx(
1618
+ Resizable,
1619
+ {
1620
+ as: "div",
1621
+ onResize: handleResize,
1622
+ size: resizableSize,
1623
+ style: resizableStyle,
1624
+ minWidth,
1625
+ maxWidth,
1626
+ enable: resizableEnable,
1627
+ children: content
1628
+ }
1629
+ )
1630
+ }
1631
+ )
1632
+ }
1633
+ ),
1634
+ [
1635
+ CSSTransitionClassNames,
1636
+ open,
1637
+ onOpening,
1638
+ onClosed,
1639
+ className,
1640
+ isLeft,
1641
+ position,
1642
+ style,
1643
+ handlePointerDownCapture,
1644
+ ref,
1645
+ handleResize,
1646
+ resizableSize,
1647
+ resizableStyle,
1648
+ minWidth,
1649
+ maxWidth,
1650
+ resizableEnable,
1651
+ content
1652
+ ]
1653
+ );
1654
+ return /* @__PURE__ */ jsxs(
1655
+ Flex$1,
1656
+ {
1657
+ ref: handleAssignParentContainer,
1658
+ width: "100%",
1659
+ height: "100%",
1660
+ direction: "row",
1661
+ position: "relative",
1662
+ style: { overflow: "hidden" },
1663
+ children: [
1664
+ side === "left" && /* @__PURE__ */ jsxs(Fragment, { children: [
1665
+ open && overlayComponent,
1666
+ " ",
1667
+ SlideOut2
1668
+ ] }),
1669
+ /* @__PURE__ */ jsx(Flex$1, { ref: childrenContainerRef, grow: "1", height: "100%", children }),
1670
+ side === "right" && /* @__PURE__ */ jsxs(Fragment, { children: [
1671
+ open && overlayComponent,
1672
+ " ",
1673
+ SlideOut2
1674
+ ] })
1675
+ ]
1676
+ }
1677
+ );
1678
+ })
1679
+ );
1680
+ const DEFAULT_INITIAL_WIDTH = "30%";
1681
+ const SlideOut = memo(
1682
+ forwardRef((props, ref) => {
1683
+ const { small, hideLayout } = useLayoutContext();
1684
+ const { className, showSlideOut, setShowSlideOut, defaultOpen, side, ...rest } = props;
1685
+ useEffect(() => {
1686
+ if (small && (defaultOpen == null ? void 0 : defaultOpen.small) !== void 0) {
1687
+ setShowSlideOut(defaultOpen == null ? void 0 : defaultOpen.small);
1688
+ } else if (!small && (defaultOpen == null ? void 0 : defaultOpen.large) !== void 0) {
1689
+ setShowSlideOut(defaultOpen == null ? void 0 : defaultOpen.large);
1690
+ }
1691
+ }, [defaultOpen, setShowSlideOut, small]);
1692
+ const handleDismiss = useCallback(() => {
1693
+ setShowSlideOut(false);
1694
+ }, [setShowSlideOut]);
1695
+ const mergedProps = useMemo(
1696
+ () => ({
1697
+ // controlled props
1698
+ ...{
1699
+ open: showSlideOut,
1700
+ initialWidth: DEFAULT_INITIAL_WIDTH,
1701
+ modal: small,
1702
+ onDismiss: handleDismiss,
1703
+ position: small ? "absolute" : "relative"
1704
+ },
1705
+ // uncontrolled props
1706
+ ...rest
1707
+ }),
1708
+ [handleDismiss, rest, showSlideOut, small]
1709
+ );
1710
+ return !hideLayout && /* @__PURE__ */ jsx(
1711
+ SlideOutV3,
1712
+ {
1713
+ className: classNames(`overmap-layout-slideOut-${side}`, className),
1714
+ side,
1715
+ ref,
1716
+ ...mergedProps
1717
+ }
1718
+ );
1719
+ })
1720
+ );
1721
+ const LeftSlideOut = memo(
1722
+ forwardRef((props, ref) => {
1723
+ const { showLeftSlideOut, setShowLeftSlideOut } = useLayoutContext();
1724
+ return /* @__PURE__ */ jsx(
1725
+ SlideOut,
1726
+ {
1727
+ side: "left",
1728
+ showSlideOut: showLeftSlideOut,
1729
+ setShowSlideOut: setShowLeftSlideOut,
1730
+ ref,
1731
+ ...props
1732
+ }
1733
+ );
1734
+ })
1735
+ );
1736
+ const RightSlideOut = memo(
1737
+ forwardRef((props, ref) => {
1738
+ const { showRightSlideOut, setShowRightSlideOut } = useLayoutContext();
1739
+ return /* @__PURE__ */ jsx(
1740
+ SlideOut,
1741
+ {
1742
+ side: "right",
1743
+ showSlideOut: showRightSlideOut,
1744
+ setShowSlideOut: setShowRightSlideOut,
1745
+ ref,
1746
+ ...props
1747
+ }
1748
+ );
1749
+ })
1750
+ );
1751
+ const SlideOutTrigger = memo(
1752
+ forwardRef((props, ref) => {
1753
+ const { side, children } = props;
1754
+ const { setShowLeftSlideOut, setShowRightSlideOut } = useLayoutContext();
1755
+ const handleClick = useCallback(() => {
1756
+ if (side === "left") {
1757
+ setShowLeftSlideOut((prevState) => !prevState);
1758
+ } else {
1759
+ setShowRightSlideOut((prevState) => !prevState);
1760
+ }
1761
+ }, [setShowLeftSlideOut, setShowRightSlideOut, side]);
1762
+ return /* @__PURE__ */ jsx(Slot, { ref, onClick: handleClick, children });
1763
+ })
1764
+ );
1765
+ const Layout = {
1766
+ Root: Root$1,
1767
+ Container,
1768
+ SlideOutOverlay,
1769
+ LeftSlideOut,
1770
+ RightSlideOut,
1771
+ SlideOutTrigger
1772
+ };
1773
+ const EnterRight = "_EnterRight_1jwyv_2";
1774
+ const EnterActiveRight = "_EnterActiveRight_1jwyv_6";
1775
+ const EnterDoneRight = "_EnterDoneRight_1jwyv_11";
1776
+ const ExitRight = "_ExitRight_1jwyv_15";
1777
+ const ExitActiveRight = "_ExitActiveRight_1jwyv_19";
1778
+ const ExitDoneRight = "_ExitDoneRight_1jwyv_24";
1779
+ const EnterLeft = "_EnterLeft_1jwyv_29";
1780
+ const EnterActiveLeft = "_EnterActiveLeft_1jwyv_33";
1781
+ const EnterDoneLeft = "_EnterDoneLeft_1jwyv_38";
1782
+ const ExitLeft = "_ExitLeft_1jwyv_42";
1783
+ const ExitActiveLeft = "_ExitActiveLeft_1jwyv_46";
1784
+ const ExitDoneLeft = "_ExitDoneLeft_1jwyv_51";
1785
+ const Overlay = "_Overlay_1jwyv_56";
1786
+ const styles$d = {
1787
+ EnterRight,
1788
+ EnterActiveRight,
1789
+ EnterDoneRight,
1790
+ ExitRight,
1791
+ ExitActiveRight,
1792
+ ExitDoneRight,
1793
+ EnterLeft,
1794
+ EnterActiveLeft,
1795
+ EnterDoneLeft,
1796
+ ExitLeft,
1797
+ ExitActiveLeft,
1798
+ ExitDoneLeft,
1799
+ Overlay
1800
+ };
1801
+ const TIMEOUT_DURATION = 200;
1802
+ const SlideOutV2 = memo(
1803
+ forwardRef((props, ref) => {
1804
+ const {
1805
+ className,
1806
+ style,
1807
+ children,
1808
+ open,
1809
+ modal = false,
1810
+ resizeable = true,
1811
+ side,
1812
+ position = "relative",
1813
+ initialWidth,
1814
+ minWidth,
1815
+ maxWidth,
1816
+ onDismiss,
1817
+ onOpening,
1818
+ onClosed
1819
+ } = props;
1820
+ const isLeft = side === "left";
1821
+ const [slideOutWidth, setSlideOutWidth] = useState(initialWidth);
1822
+ const handleResize = useCallback(
1823
+ (_event, _dir, ref2, _delta) => {
1824
+ setSlideOutWidth(ref2.clientWidth);
1418
1825
  },
1419
- timeout: TRANSITION_DURATION$1,
1420
- nodeRef: contentRef,
1421
- unmountOnExit: true,
1422
- mountOnEnter: true,
1423
- children: /* @__PURE__ */ jsxs(Fragment, { children: [
1424
- overlay2 && /* @__PURE__ */ jsx(
1425
- "div",
1426
- {
1427
- className: classNames("overmap-slide-out-overlay", styles$d.slideOutOverlay, overlayClassName)
1428
- }
1429
- ),
1430
- /* @__PURE__ */ jsx(DismissableLayer, { disableOutsidePointerEvents: modal, asChild: true, ...rest, children: /* @__PURE__ */ jsx(
1431
- Flex$1,
1432
- {
1433
- className: classNames("overmap-slide-out", className, styles$d.outerContent, {
1434
- [styles$d.left]: isSideLeft,
1435
- [styles$d.right]: isSideRight
1436
- }),
1437
- style: { "--slide-out-width": `${slideOutWidth}px` },
1438
- height: "100%",
1439
- width: "auto",
1440
- position,
1441
- top: "0",
1442
- bottom: "0",
1443
- left: isSideLeft ? "0" : void 0,
1444
- right: isSideRight ? "0" : void 0,
1445
- ref: contentRef,
1446
- children: /* @__PURE__ */ jsx(
1447
- Resizable,
1448
- {
1449
- className: styles$d.resizable,
1450
- defaultSize: { width: slideOutWidth, height: "100%" },
1451
- onResize: handleResize,
1452
- enable: { right: resizable2 && isSideLeft, left: resizable2 && isSideRight },
1453
- handleComponent: { left: resizeHandle2, right: resizeHandle2 },
1454
- minWidth,
1455
- maxWidth,
1456
- children
1457
- }
1458
- )
1459
- }
1460
- ) })
1461
- ] })
1462
- }
1463
- );
1464
- });
1826
+ []
1827
+ );
1828
+ const handleDismiss = useCallback(
1829
+ (event) => {
1830
+ if (modal && onDismiss) {
1831
+ onDismiss(event);
1832
+ }
1833
+ },
1834
+ [modal, onDismiss]
1835
+ );
1836
+ useEffect(() => {
1837
+ setSlideOutWidth(initialWidth);
1838
+ }, [initialWidth]);
1839
+ const CSSTransitionClassNames = useMemo(
1840
+ () => ({
1841
+ enter: isLeft ? styles$d.EnterLeft : styles$d.EnterRight,
1842
+ enterActive: isLeft ? styles$d.EnterActiveLeft : styles$d.EnterActiveRight,
1843
+ enterDone: isLeft ? styles$d.EnterDoneLeft : styles$d.EnterDoneRight,
1844
+ exit: isLeft ? styles$d.ExitLeft : styles$d.ExitRight,
1845
+ exitActive: isLeft ? styles$d.ExitActiveLeft : styles$d.ExitActiveRight,
1846
+ exitDone: isLeft ? styles$d.ExitDoneLeft : styles$d.ExitDoneRight
1847
+ }),
1848
+ [isLeft]
1849
+ );
1850
+ return (
1851
+ /** The DismissableLayer Component is strictly a functionality-based component for emulating an overlay. Its main use is for
1852
+ * detecting interactions OUTSIDE whatever content is placed within it, allowing the developer to decide what to do with that
1853
+ * content when it is 'dismissed' (i.e closed, to be hidden, etc.).
1854
+ *
1855
+ * There are three main events that trigger this 'dismissal' behavior
1856
+ * 1) Focus is given to an element outside the content rendered within the DismissableLayer component
1857
+ * 2) PointerEvent occurs on an element outside the content rendered within the DismissableLayer component
1858
+ * 3) Escape key is pressed
1859
+ *
1860
+ * The 'disableOutsidePointerEvents' prop is used for disabling focus and PointerEvents on outside elements.
1861
+ * The dismissal behavior will still eb trigger, it just won't allow any elements to be interacted with until
1862
+ * the DismissableLayer is removed from the DOM, or 'disableOutsidePointerEvents' is set to false
1863
+ *
1864
+ * In this use case, Overmap's SlideOut will have two specific behaviors
1865
+ * 1) Modal mode - the SlideOut has modal-like behavior where it will dismiss PointerEvents and Focus of
1866
+ * outside elements
1867
+ * 2) Non-modal mode - the SlideOut behaves like a side panel the co-exists with content outside of it
1868
+ * */
1869
+ /* @__PURE__ */ jsx(
1870
+ CSSTransition,
1871
+ {
1872
+ classNames: CSSTransitionClassNames,
1873
+ in: open,
1874
+ timeout: TIMEOUT_DURATION,
1875
+ unmountOnExit: true,
1876
+ mountOnEnter: true,
1877
+ onEntering: onOpening,
1878
+ onExited: onClosed,
1879
+ children: /* @__PURE__ */ jsx(
1880
+ DismissableLayer,
1881
+ {
1882
+ disableOutsidePointerEvents: modal,
1883
+ style,
1884
+ onInteractOutside: handleDismiss,
1885
+ onEscapeKeyDown: handleDismiss,
1886
+ asChild: true,
1887
+ children: /* @__PURE__ */ jsx(
1888
+ Flex$1,
1889
+ {
1890
+ className,
1891
+ ref,
1892
+ top: "0",
1893
+ bottom: "0",
1894
+ left: isLeft ? "0" : void 0,
1895
+ right: !isLeft ? "0" : void 0,
1896
+ position,
1897
+ asChild: true,
1898
+ children: /* @__PURE__ */ jsx(
1899
+ Resizable,
1900
+ {
1901
+ onResize: handleResize,
1902
+ size: { width: slideOutWidth, height: "100%" },
1903
+ style: {
1904
+ position,
1905
+ "--slide-out-width": `${slideOutWidth}${typeof slideOutWidth === "number" ? "px" : ""}`
1906
+ },
1907
+ minWidth,
1908
+ maxWidth,
1909
+ enable: { left: resizeable && !isLeft, right: resizeable && isLeft },
1910
+ children
1911
+ }
1912
+ )
1913
+ }
1914
+ )
1915
+ },
1916
+ modal ? "1" : "0"
1917
+ )
1918
+ }
1919
+ )
1920
+ );
1921
+ })
1922
+ );
1465
1923
  const accommodateCharCount = "_accommodateCharCount_1octa_1";
1466
1924
  const wrapper$2 = "_wrapper_1octa_5";
1467
1925
  const noLeftIcon = "_noLeftIcon_1octa_14";
@@ -1984,7 +2442,7 @@ const _ToggleGroup = forwardRef(function ToggleGroup2({
1984
2442
  ...rest
1985
2443
  }, ref) {
1986
2444
  return /* @__PURE__ */ jsx(
1987
- Root$1,
2445
+ Root$2,
1988
2446
  {
1989
2447
  type,
1990
2448
  className: classNames("overmap-toggle-group", className),
@@ -2016,7 +2474,7 @@ const styles$7 = {
2016
2474
  const Root2 = memo(
2017
2475
  forwardRef(({ className, minContentGap = "2", children, ...rest }, ref) => {
2018
2476
  return /* @__PURE__ */ jsx(
2019
- Root$2,
2477
+ Root$3,
2020
2478
  {
2021
2479
  className: classNames(className, "overmap-toolbar", styles$7.default),
2022
2480
  ref,
@@ -2651,77 +3109,6 @@ function $921a889cee6df7e8$var$usePresence(present) {
2651
3109
  function $921a889cee6df7e8$var$getAnimationName(styles2) {
2652
3110
  return (styles2 === null || styles2 === void 0 ? void 0 : styles2.animationName) || "none";
2653
3111
  }
2654
- const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
2655
- const { children, ...slotProps } = props;
2656
- const childrenArray = Children.toArray(children);
2657
- const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);
2658
- if (slottable) {
2659
- const newElement = slottable.props.children;
2660
- const newChildren = childrenArray.map((child) => {
2661
- if (child === slottable) {
2662
- if (Children.count(newElement) > 1)
2663
- return Children.only(null);
2664
- return /* @__PURE__ */ isValidElement(newElement) ? newElement.props.children : null;
2665
- } else
2666
- return child;
2667
- });
2668
- return /* @__PURE__ */ createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
2669
- ref: forwardedRef
2670
- }), /* @__PURE__ */ isValidElement(newElement) ? /* @__PURE__ */ cloneElement(newElement, void 0, newChildren) : null);
2671
- }
2672
- return /* @__PURE__ */ createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
2673
- ref: forwardedRef
2674
- }), children);
2675
- });
2676
- $5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = "Slot";
2677
- const $5e63c961fc1ce211$var$SlotClone = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
2678
- const { children, ...slotProps } = props;
2679
- if (/* @__PURE__ */ isValidElement(children))
2680
- return /* @__PURE__ */ cloneElement(children, {
2681
- ...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),
2682
- ref: forwardedRef ? $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref) : children.ref
2683
- });
2684
- return Children.count(children) > 1 ? Children.only(null) : null;
2685
- });
2686
- $5e63c961fc1ce211$var$SlotClone.displayName = "SlotClone";
2687
- const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children }) => {
2688
- return /* @__PURE__ */ createElement(Fragment$1, null, children);
2689
- };
2690
- function $5e63c961fc1ce211$var$isSlottable(child) {
2691
- return /* @__PURE__ */ isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;
2692
- }
2693
- function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {
2694
- const overrideProps = {
2695
- ...childProps
2696
- };
2697
- for (const propName in childProps) {
2698
- const slotPropValue = slotProps[propName];
2699
- const childPropValue = childProps[propName];
2700
- const isHandler = /^on[A-Z]/.test(propName);
2701
- if (isHandler) {
2702
- if (slotPropValue && childPropValue)
2703
- overrideProps[propName] = (...args) => {
2704
- childPropValue(...args);
2705
- slotPropValue(...args);
2706
- };
2707
- else if (slotPropValue)
2708
- overrideProps[propName] = slotPropValue;
2709
- } else if (propName === "style")
2710
- overrideProps[propName] = {
2711
- ...slotPropValue,
2712
- ...childPropValue
2713
- };
2714
- else if (propName === "className")
2715
- overrideProps[propName] = [
2716
- slotPropValue,
2717
- childPropValue
2718
- ].filter(Boolean).join(" ");
2719
- }
2720
- return {
2721
- ...slotProps,
2722
- ...overrideProps
2723
- };
2724
- }
2725
3112
  const $8927f6f2acc4f386$var$NODES = [
2726
3113
  "a",
2727
3114
  "button",
@@ -2743,7 +3130,7 @@ const $8927f6f2acc4f386$var$NODES = [
2743
3130
  const $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node) => {
2744
3131
  const Node = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
2745
3132
  const { asChild, ...primitiveProps } = props;
2746
- const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : node;
3133
+ const Comp = asChild ? Slot : node;
2747
3134
  useEffect(() => {
2748
3135
  window[Symbol.for("radix-ui")] = true;
2749
3136
  }, []);
@@ -2893,22 +3280,29 @@ function $e698a72e93240346$var$getState(checked) {
2893
3280
  }
2894
3281
  const $e698a72e93240346$export$be92b6f5f03c0fe9 = $e698a72e93240346$export$48513f6b9f8ce62d;
2895
3282
  const $e698a72e93240346$export$adb584737d712b70 = $e698a72e93240346$export$59aad738f51d1c05;
2896
- const checkboxContainer = "_checkboxContainer_pb9za_5";
2897
- const checkbox = "_checkbox_pb9za_5";
2898
- const checkboxIndicator = "_checkboxIndicator_pb9za_27";
2899
- const checkboxLabel = "_checkboxLabel_pb9za_38";
2900
- const noTextHighlight = "_noTextHighlight_pb9za_42";
2901
- const checkboxHidden = "_checkboxHidden_pb9za_51";
3283
+ const checkbox = "_checkbox_yl8iy_5";
3284
+ const checkboxIndicator = "_checkboxIndicator_yl8iy_22";
3285
+ const checkboxLabel = "_checkboxLabel_yl8iy_33";
3286
+ const noTextHighlight = "_noTextHighlight_yl8iy_37";
3287
+ const checkboxHidden = "_checkboxHidden_yl8iy_46";
2902
3288
  const styles$2 = {
2903
- checkboxContainer,
2904
3289
  checkbox,
2905
3290
  checkboxIndicator,
2906
3291
  checkboxLabel,
2907
3292
  noTextHighlight,
2908
3293
  checkboxHidden
2909
3294
  };
2910
- const _Checkbox = forwardRef(function Checkbox2({ className, labelClassName, label, checked, onCheckedChange, alwaysShow = true, ...rest }, ref) {
2911
- return /* @__PURE__ */ jsx(HoverUtility, { children: ({ isHovered, ...props }) => /* @__PURE__ */ jsxs(Flex$1, { className: styles$2.checkboxContainer, ...props, children: [
3295
+ const _Checkbox = forwardRef(function Checkbox2({
3296
+ className,
3297
+ labelClassName,
3298
+ label,
3299
+ checked,
3300
+ onCheckedChange,
3301
+ checkboxPosition = "center",
3302
+ alwaysShow = true,
3303
+ ...rest
3304
+ }, ref) {
3305
+ return /* @__PURE__ */ jsx(HoverUtility, { children: ({ isHovered, ...props }) => /* @__PURE__ */ jsxs(Flex$1, { align: checkboxPosition, ...props, children: [
2912
3306
  /* @__PURE__ */ jsx(
2913
3307
  $e698a72e93240346$export$be92b6f5f03c0fe9,
2914
3308
  {
@@ -3721,17 +4115,18 @@ export {
3721
4115
  IconButton,
3722
4116
  IconColorUtility,
3723
4117
  Input,
4118
+ Layout,
3724
4119
  LeftAndRightPanels,
3725
4120
  MultiPagePopover,
3726
4121
  MultiSelect,
3727
4122
  OvermapErrorBoundary,
3728
4123
  Popover,
3729
- Root2 as Root,
3730
4124
  Select,
3731
4125
  SelectAllCheckbox,
3732
4126
  Separator,
3733
4127
  Sidebar,
3734
- SlideOut,
4128
+ SlideOutV2,
4129
+ SlideOutV3,
3735
4130
  Spinner,
3736
4131
  Switch,
3737
4132
  Table,
@@ -3751,6 +4146,7 @@ export {
3751
4146
  useAlertDialog,
3752
4147
  useDiscardAlertDialog,
3753
4148
  useKeyboardShortcut,
4149
+ useLayoutContext,
3754
4150
  useSeverityColor,
3755
4151
  useStopEventPropagation,
3756
4152
  useTextFilter,