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