@geomak/ui 1.9.0 → 3.0.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/index.cjs +364 -266
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +129 -39
- package/dist/index.d.ts +129 -39
- package/dist/index.js +279 -182
- package/dist/index.js.map +1 -1
- package/dist/styles.css +74 -35
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { colors_default } from './chunk-GKXP6OJJ.js';
|
|
2
2
|
export { colors_default as COLORS, PALETTE as palette, semanticTokens, vars } from './chunk-GKXP6OJJ.js';
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
|
-
import
|
|
4
|
+
import React8, { createContext, useState, useEffect, useMemo, useContext, useRef, useId, useCallback, useLayoutEffect } from 'react';
|
|
5
5
|
import { createPortal } from 'react-dom';
|
|
6
6
|
import * as Dialog from '@radix-ui/react-dialog';
|
|
7
7
|
import { useReducedMotion, AnimatePresence, motion } from 'framer-motion';
|
|
@@ -10,6 +10,7 @@ import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
|
10
10
|
import * as Accordion from '@radix-ui/react-accordion';
|
|
11
11
|
import * as ToggleGroup from '@radix-ui/react-toggle-group';
|
|
12
12
|
import * as Toast from '@radix-ui/react-toast';
|
|
13
|
+
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
13
14
|
import * as Popover from '@radix-ui/react-popover';
|
|
14
15
|
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
15
16
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
@@ -1355,191 +1356,287 @@ function MenuBar({ items }) {
|
|
|
1355
1356
|
)
|
|
1356
1357
|
);
|
|
1357
1358
|
}
|
|
1358
|
-
function ContextMenu({ items,
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
const clickAway = ({ target }) => {
|
|
1368
|
-
if (contextRef.current && !contextRef.current.contains(target)) {
|
|
1369
|
-
if (childMenuRef.current) {
|
|
1370
|
-
childMenuRef.current.classList.add("opacity-0");
|
|
1371
|
-
childMenuRef.current.style.left = "0px";
|
|
1372
|
-
childMenuRef.current.style.top = "0px";
|
|
1373
|
-
}
|
|
1374
|
-
setActiveChildren([]);
|
|
1375
|
-
onClose();
|
|
1376
|
-
}
|
|
1377
|
-
};
|
|
1378
|
-
window.addEventListener("click", clickAway);
|
|
1379
|
-
return () => window.removeEventListener("click", clickAway);
|
|
1380
|
-
}, [onClose]);
|
|
1381
|
-
useEffect(() => {
|
|
1382
|
-
const current = contextRef.current;
|
|
1383
|
-
const child = childMenuRef.current;
|
|
1384
|
-
if (!current || !child) return;
|
|
1385
|
-
const { height, width } = current.getBoundingClientRect();
|
|
1386
|
-
if (position.y + height >= window.innerHeight) {
|
|
1387
|
-
current.style.top = `${position.y - (height - 40)}px`;
|
|
1388
|
-
setHasArrowUp(false);
|
|
1389
|
-
} else {
|
|
1390
|
-
current.style.top = `${position.y}px`;
|
|
1391
|
-
setHasArrowUp(true);
|
|
1392
|
-
}
|
|
1393
|
-
current.style.left = `${position.x}px`;
|
|
1394
|
-
child.style.width = `${width}px`;
|
|
1395
|
-
child.classList.add("opacity-0");
|
|
1396
|
-
}, [position]);
|
|
1397
|
-
const onItemClick = (e, item) => {
|
|
1398
|
-
if (item.onClick) {
|
|
1399
|
-
if (childMenuRef.current) {
|
|
1400
|
-
childMenuRef.current.classList.add("opacity-0");
|
|
1401
|
-
childMenuRef.current.style.left = "0px";
|
|
1402
|
-
childMenuRef.current.style.top = "0px";
|
|
1403
|
-
}
|
|
1404
|
-
setActiveChildren([]);
|
|
1405
|
-
item.onClick(item.path, item.reportType);
|
|
1406
|
-
} else if (item.children?.length) {
|
|
1407
|
-
const targetBbox = e.target.getBoundingClientRect();
|
|
1408
|
-
const childHeight = childMenuRef.current?.getBoundingClientRect().height ?? 0;
|
|
1409
|
-
const contextBbox = contextRef.current?.getBoundingClientRect() ?? { y: 0, width: 0};
|
|
1410
|
-
const contextWidth = contextBbox.width;
|
|
1411
|
-
if (targetBbox.y + childHeight >= window.innerHeight) {
|
|
1412
|
-
setChildArrowUp(false);
|
|
1413
|
-
if (childMenuRef.current) childMenuRef.current.style.top = `${targetBbox.y - childHeight}px`;
|
|
1414
|
-
} else {
|
|
1415
|
-
setChildArrowUp(true);
|
|
1416
|
-
if (childMenuRef.current)
|
|
1417
|
-
childMenuRef.current.style.top = `${targetBbox.y - contextBbox.y + targetBbox.height / 2 - 10}px`;
|
|
1418
|
-
}
|
|
1419
|
-
setActiveChildren(item.children);
|
|
1420
|
-
if (childMenuRef.current) {
|
|
1421
|
-
childMenuRef.current.classList.remove("opacity-0");
|
|
1422
|
-
childMenuRef.current.style.left = `${Math.round(contextWidth + 10)}px`;
|
|
1359
|
+
function ContextMenu({ items, children }) {
|
|
1360
|
+
return /* @__PURE__ */ jsxs(ContextMenuPrimitive.Root, { children: [
|
|
1361
|
+
/* @__PURE__ */ jsx(ContextMenuPrimitive.Trigger, { asChild: true, children }),
|
|
1362
|
+
/* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
1363
|
+
ContextMenuPrimitive.Content,
|
|
1364
|
+
{
|
|
1365
|
+
className: CONTENT_CLASSNAME,
|
|
1366
|
+
collisionPadding: 8,
|
|
1367
|
+
children: items.map((item) => renderItem(item))
|
|
1423
1368
|
}
|
|
1424
|
-
}
|
|
1425
|
-
};
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1369
|
+
) })
|
|
1370
|
+
] });
|
|
1371
|
+
}
|
|
1372
|
+
var CONTENT_CLASSNAME = [
|
|
1373
|
+
// Surface — semantic tokens, both modes covered
|
|
1374
|
+
"min-w-[180px] rounded-lg border border-border bg-surface shadow-lg",
|
|
1375
|
+
"p-1 z-[500000] text-sm text-foreground",
|
|
1376
|
+
// Entry animation matches the Tooltip / Dropdown style
|
|
1377
|
+
"animate-in fade-in-0 zoom-in-95",
|
|
1378
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
1379
|
+
// Outline reset — Radix handles focus internally
|
|
1380
|
+
"focus:outline-none"
|
|
1381
|
+
].join(" ");
|
|
1382
|
+
var ITEM_CLASSNAME = [
|
|
1383
|
+
"flex items-center justify-between gap-3 rounded-md px-2 py-1.5 cursor-pointer select-none",
|
|
1384
|
+
"transition-colors duration-100",
|
|
1385
|
+
"data-[highlighted]:bg-accent data-[highlighted]:text-accent-fg",
|
|
1386
|
+
"data-[disabled]:opacity-40 data-[disabled]:cursor-not-allowed data-[disabled]:bg-transparent data-[disabled]:text-foreground-muted",
|
|
1387
|
+
"focus:outline-none"
|
|
1388
|
+
].join(" ");
|
|
1389
|
+
function renderItem(item) {
|
|
1390
|
+
if (item.children && item.children.length > 0) {
|
|
1391
|
+
return /* @__PURE__ */ jsxs(ContextMenuPrimitive.Sub, { children: [
|
|
1392
|
+
/* @__PURE__ */ jsxs(
|
|
1393
|
+
ContextMenuPrimitive.SubTrigger,
|
|
1394
|
+
{
|
|
1395
|
+
disabled: item.disabled,
|
|
1396
|
+
className: ITEM_CLASSNAME,
|
|
1397
|
+
children: [
|
|
1398
|
+
/* @__PURE__ */ jsx(ContextMenuLabel, { icon: item.icon, value: item.value }),
|
|
1399
|
+
/* @__PURE__ */ jsx(ChevronRight2, {})
|
|
1400
|
+
]
|
|
1401
|
+
}
|
|
1402
|
+
),
|
|
1403
|
+
/* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
1404
|
+
ContextMenuPrimitive.SubContent,
|
|
1405
|
+
{
|
|
1406
|
+
className: CONTENT_CLASSNAME,
|
|
1407
|
+
sideOffset: 2,
|
|
1408
|
+
alignOffset: -4,
|
|
1409
|
+
collisionPadding: 8,
|
|
1410
|
+
children: item.children.map((sub) => renderItem(sub))
|
|
1411
|
+
}
|
|
1412
|
+
) })
|
|
1413
|
+
] }, item.key);
|
|
1414
|
+
}
|
|
1415
|
+
return /* @__PURE__ */ jsx(
|
|
1416
|
+
ContextMenuPrimitive.Item,
|
|
1429
1417
|
{
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
onContextMenu: (e) => e.preventDefault(),
|
|
1437
|
-
onMouseEnter: () => setHoveredItem(index),
|
|
1438
|
-
onMouseLeave: () => setHoveredItem(-1),
|
|
1439
|
-
className: `flex items-center justify-between transition-all duration-300 p-2 cursor-pointer hover:bg-ice-dark ${index === 0 ? "rounded-tl-lg rounded-tr-lg" : ""} ${index === items.length - 1 ? "rounded-bl-lg rounded-br-lg" : ""}`,
|
|
1440
|
-
onClick: (e) => onItemClick(e, item),
|
|
1441
|
-
children: [
|
|
1442
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 pointer-events-none", children: [
|
|
1443
|
-
item.icon,
|
|
1444
|
-
item.value
|
|
1445
|
-
] }),
|
|
1446
|
-
/* @__PURE__ */ jsx("div", { className: "pointer-events-none", children: item.children && /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: colors_default.PALETTE["prussian-blue"], strokeWidth: 2, className: "h-4 w-4", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) })
|
|
1447
|
-
]
|
|
1448
|
-
},
|
|
1449
|
-
item.key
|
|
1450
|
-
)) }),
|
|
1451
|
-
/* @__PURE__ */ jsx(
|
|
1452
|
-
"div",
|
|
1453
|
-
{
|
|
1454
|
-
ref: childMenuRef,
|
|
1455
|
-
className: `transition-all duration-150 absolute rounded-lg bg-ice text-prussian-blue ${childArrowUp && hoveredChild === 0 ? "context-arrow-up context-arrow-hovered" : !childArrowUp && hoveredChild === activeChildren.length - 1 ? "context-arrow-down context-arrow-hovered" : childArrowUp ? "context-arrow-up" : "context-arrow-down"}`,
|
|
1456
|
-
children: /* @__PURE__ */ jsx("ul", { children: activeChildren.map((item, index) => /* @__PURE__ */ jsxs(
|
|
1457
|
-
"li",
|
|
1458
|
-
{
|
|
1459
|
-
className: `flex items-center gap-2 p-2 cursor-pointer transition-all duration-150 hover:bg-ice-dark ${index === 0 ? "rounded-tl-lg rounded-tr-lg" : ""} ${index === activeChildren.length - 1 ? "rounded-bl-lg rounded-br-lg" : ""}`,
|
|
1460
|
-
onClick: () => item.onClick?.(item.path, item.reportType),
|
|
1461
|
-
onMouseEnter: () => setHoveredChild(index),
|
|
1462
|
-
onMouseLeave: () => setHoveredChild(-1),
|
|
1463
|
-
children: [
|
|
1464
|
-
item.icon,
|
|
1465
|
-
item.value
|
|
1466
|
-
]
|
|
1467
|
-
},
|
|
1468
|
-
index
|
|
1469
|
-
)) })
|
|
1470
|
-
}
|
|
1471
|
-
)
|
|
1472
|
-
]
|
|
1473
|
-
}
|
|
1418
|
+
disabled: item.disabled,
|
|
1419
|
+
onSelect: () => item.onClick?.(),
|
|
1420
|
+
className: ITEM_CLASSNAME,
|
|
1421
|
+
children: /* @__PURE__ */ jsx(ContextMenuLabel, { icon: item.icon, value: item.value })
|
|
1422
|
+
},
|
|
1423
|
+
item.key
|
|
1474
1424
|
);
|
|
1475
1425
|
}
|
|
1476
|
-
function
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
);
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1426
|
+
function ContextMenuLabel({ icon, value }) {
|
|
1427
|
+
return /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2 flex-1 min-w-0", children: [
|
|
1428
|
+
icon && /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", children: icon }),
|
|
1429
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: value })
|
|
1430
|
+
] });
|
|
1431
|
+
}
|
|
1432
|
+
function ChevronRight2() {
|
|
1433
|
+
return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "h-4 w-4 flex-shrink-0", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) });
|
|
1434
|
+
}
|
|
1435
|
+
function readDismissed(key) {
|
|
1436
|
+
if (key === null) return false;
|
|
1437
|
+
if (typeof window === "undefined") return false;
|
|
1438
|
+
try {
|
|
1439
|
+
return window.localStorage.getItem(key) === "true";
|
|
1440
|
+
} catch {
|
|
1441
|
+
return false;
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
function writeDismissed(key) {
|
|
1445
|
+
if (key === null) return;
|
|
1446
|
+
if (typeof window === "undefined") return;
|
|
1447
|
+
try {
|
|
1448
|
+
window.localStorage.setItem(key, "true");
|
|
1449
|
+
} catch {
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
function useTargetBbox(ref) {
|
|
1453
|
+
const [bbox, setBbox] = useState(null);
|
|
1454
|
+
useLayoutEffect(() => {
|
|
1455
|
+
const el = ref?.current;
|
|
1456
|
+
if (!el) {
|
|
1457
|
+
setBbox(null);
|
|
1492
1458
|
return;
|
|
1493
1459
|
}
|
|
1494
|
-
const
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
const
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1460
|
+
const update = () => setBbox(el.getBoundingClientRect());
|
|
1461
|
+
update();
|
|
1462
|
+
window.addEventListener("scroll", update, true);
|
|
1463
|
+
window.addEventListener("resize", update);
|
|
1464
|
+
const ro = typeof ResizeObserver !== "undefined" ? new ResizeObserver(update) : null;
|
|
1465
|
+
ro?.observe(el);
|
|
1466
|
+
return () => {
|
|
1467
|
+
window.removeEventListener("scroll", update, true);
|
|
1468
|
+
window.removeEventListener("resize", update);
|
|
1469
|
+
ro?.disconnect();
|
|
1470
|
+
};
|
|
1471
|
+
}, [ref]);
|
|
1472
|
+
return bbox;
|
|
1473
|
+
}
|
|
1474
|
+
var TOOLTIP_WIDTH = 280;
|
|
1475
|
+
var TOOLTIP_GAP = 12;
|
|
1476
|
+
function tooltipStyleFor(bbox, placement) {
|
|
1477
|
+
const pl = placement ?? "right";
|
|
1478
|
+
if (pl === "right") return { left: bbox.right + TOOLTIP_GAP, top: bbox.top + bbox.height / 2, transform: "translateY(-50%)", width: TOOLTIP_WIDTH };
|
|
1479
|
+
if (pl === "left") return { left: bbox.left - TOOLTIP_WIDTH - TOOLTIP_GAP, top: bbox.top + bbox.height / 2, transform: "translateY(-50%)", width: TOOLTIP_WIDTH };
|
|
1480
|
+
if (pl === "bottom") return { left: bbox.left + bbox.width / 2, top: bbox.bottom + TOOLTIP_GAP, transform: "translateX(-50%)", width: TOOLTIP_WIDTH };
|
|
1481
|
+
return { left: bbox.left + bbox.width / 2, top: bbox.top - TOOLTIP_GAP, transform: "translate(-50%, -100%)", width: TOOLTIP_WIDTH };
|
|
1482
|
+
}
|
|
1483
|
+
function useFocusTrap(containerRef, active) {
|
|
1484
|
+
useEffect(() => {
|
|
1485
|
+
if (!active) return;
|
|
1486
|
+
const el = containerRef.current;
|
|
1487
|
+
if (!el) return;
|
|
1488
|
+
const t = setTimeout(() => {
|
|
1489
|
+
const first = el.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
1490
|
+
first?.focus();
|
|
1491
|
+
}, 0);
|
|
1492
|
+
const onKey = (e) => {
|
|
1493
|
+
if (e.key !== "Tab") return;
|
|
1494
|
+
const focusables = el.querySelectorAll(
|
|
1495
|
+
'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'
|
|
1496
|
+
);
|
|
1497
|
+
if (focusables.length === 0) return;
|
|
1498
|
+
const first = focusables[0];
|
|
1499
|
+
const last = focusables[focusables.length - 1];
|
|
1500
|
+
if (e.shiftKey && document.activeElement === first) {
|
|
1501
|
+
e.preventDefault();
|
|
1502
|
+
last.focus();
|
|
1503
|
+
} else if (!e.shiftKey && document.activeElement === last) {
|
|
1504
|
+
e.preventDefault();
|
|
1505
|
+
first.focus();
|
|
1506
|
+
}
|
|
1507
|
+
};
|
|
1508
|
+
document.addEventListener("keydown", onKey);
|
|
1509
|
+
return () => {
|
|
1510
|
+
clearTimeout(t);
|
|
1511
|
+
document.removeEventListener("keydown", onKey);
|
|
1512
|
+
};
|
|
1513
|
+
}, [containerRef, active]);
|
|
1514
|
+
}
|
|
1515
|
+
function Wizard({
|
|
1516
|
+
children,
|
|
1517
|
+
steps,
|
|
1518
|
+
storageKey = "oxygen.wizard.completed",
|
|
1519
|
+
dismissible = true,
|
|
1520
|
+
onComplete,
|
|
1521
|
+
onSkip
|
|
1522
|
+
}) {
|
|
1523
|
+
const tooltipRef = useRef(null);
|
|
1524
|
+
const tooltipTitleId = useId();
|
|
1525
|
+
const tooltipBodyId = useId();
|
|
1526
|
+
const [open, setOpen] = useState(() => steps.length > 0 && !readDismissed(storageKey));
|
|
1527
|
+
const [activeIndex, setActiveIndex] = useState(0);
|
|
1528
|
+
const step = steps[activeIndex];
|
|
1529
|
+
const bbox = useTargetBbox(step?.stepRef);
|
|
1530
|
+
useFocusTrap(tooltipRef, open);
|
|
1531
|
+
useEffect(() => {
|
|
1532
|
+
if (!open || !dismissible) return;
|
|
1533
|
+
const onKey = (e) => {
|
|
1534
|
+
if (e.key === "Escape") {
|
|
1535
|
+
e.preventDefault();
|
|
1536
|
+
handleSkip();
|
|
1537
1537
|
}
|
|
1538
|
-
|
|
1539
|
-
|
|
1538
|
+
};
|
|
1539
|
+
document.addEventListener("keydown", onKey);
|
|
1540
|
+
return () => document.removeEventListener("keydown", onKey);
|
|
1541
|
+
}, [open, dismissible]);
|
|
1542
|
+
const handleSkip = useCallback(() => {
|
|
1543
|
+
writeDismissed(storageKey);
|
|
1544
|
+
setOpen(false);
|
|
1545
|
+
onSkip?.();
|
|
1546
|
+
}, [storageKey, onSkip]);
|
|
1547
|
+
const handleComplete = useCallback(() => {
|
|
1548
|
+
writeDismissed(storageKey);
|
|
1549
|
+
setOpen(false);
|
|
1550
|
+
onComplete?.();
|
|
1551
|
+
}, [storageKey, onComplete]);
|
|
1552
|
+
const handleNext = () => {
|
|
1553
|
+
if (activeIndex < steps.length - 1) setActiveIndex((i) => i + 1);
|
|
1554
|
+
else handleComplete();
|
|
1555
|
+
};
|
|
1556
|
+
const handlePrev = () => {
|
|
1557
|
+
if (activeIndex > 0) setActiveIndex((i) => i - 1);
|
|
1558
|
+
};
|
|
1559
|
+
const highlightStyle = bbox ? {
|
|
1560
|
+
left: bbox.left - 4,
|
|
1561
|
+
top: bbox.top - 4,
|
|
1562
|
+
width: bbox.width + 8,
|
|
1563
|
+
height: bbox.height + 8
|
|
1564
|
+
} : { display: "none" };
|
|
1565
|
+
const tooltipStyle = bbox ? tooltipStyleFor(bbox, step?.placement) : { display: "none" };
|
|
1566
|
+
const isLast = activeIndex === steps.length - 1;
|
|
1567
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1568
|
+
children,
|
|
1569
|
+
open && step && /* @__PURE__ */ jsxs(Portal, { children: [
|
|
1570
|
+
/* @__PURE__ */ jsx(
|
|
1571
|
+
"div",
|
|
1572
|
+
{
|
|
1573
|
+
className: "fixed inset-0 z-[7000000] bg-foreground/40 backdrop-blur-[1px] pointer-events-auto",
|
|
1574
|
+
"aria-hidden": "true"
|
|
1575
|
+
}
|
|
1576
|
+
),
|
|
1577
|
+
/* @__PURE__ */ jsx(
|
|
1578
|
+
"div",
|
|
1579
|
+
{
|
|
1580
|
+
className: "fixed z-[7000001] pointer-events-none rounded-md ring-2 ring-accent ring-offset-2 ring-offset-background transition-all duration-200",
|
|
1581
|
+
style: highlightStyle,
|
|
1582
|
+
"aria-hidden": "true"
|
|
1583
|
+
}
|
|
1584
|
+
),
|
|
1585
|
+
/* @__PURE__ */ jsxs(
|
|
1586
|
+
"div",
|
|
1587
|
+
{
|
|
1588
|
+
ref: tooltipRef,
|
|
1589
|
+
role: "dialog",
|
|
1590
|
+
"aria-modal": "true",
|
|
1591
|
+
"aria-labelledby": step.title ? tooltipTitleId : void 0,
|
|
1592
|
+
"aria-describedby": tooltipBodyId,
|
|
1593
|
+
className: "fixed z-[7000002] rounded-lg bg-surface text-foreground border border-border shadow-xl p-4 pointer-events-auto",
|
|
1594
|
+
style: tooltipStyle,
|
|
1595
|
+
children: [
|
|
1596
|
+
step.title && /* @__PURE__ */ jsx("h3", { id: tooltipTitleId, className: "text-sm font-semibold text-foreground mb-1", children: step.title }),
|
|
1597
|
+
/* @__PURE__ */ jsx("div", { id: tooltipBodyId, className: "text-sm text-foreground-secondary leading-relaxed", children: step.description }),
|
|
1598
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-4 flex items-center justify-between", children: [
|
|
1599
|
+
/* @__PURE__ */ jsxs("span", { className: "text-xs text-foreground-muted tabular-nums", children: [
|
|
1600
|
+
activeIndex + 1,
|
|
1601
|
+
" / ",
|
|
1602
|
+
steps.length
|
|
1603
|
+
] }),
|
|
1604
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1605
|
+
dismissible && !isLast && /* @__PURE__ */ jsx(
|
|
1606
|
+
Button,
|
|
1607
|
+
{
|
|
1608
|
+
variant: "ghost",
|
|
1609
|
+
size: "sm",
|
|
1610
|
+
content: "Skip",
|
|
1611
|
+
onClick: handleSkip
|
|
1612
|
+
}
|
|
1613
|
+
),
|
|
1614
|
+
activeIndex > 0 && /* @__PURE__ */ jsx(
|
|
1615
|
+
Button,
|
|
1616
|
+
{
|
|
1617
|
+
variant: "secondary",
|
|
1618
|
+
size: "sm",
|
|
1619
|
+
content: "Back",
|
|
1620
|
+
onClick: handlePrev
|
|
1621
|
+
}
|
|
1622
|
+
),
|
|
1623
|
+
/* @__PURE__ */ jsx(
|
|
1624
|
+
Button,
|
|
1625
|
+
{
|
|
1626
|
+
size: "sm",
|
|
1627
|
+
content: isLast ? "Done" : "Next",
|
|
1628
|
+
onClick: handleNext
|
|
1629
|
+
}
|
|
1630
|
+
)
|
|
1631
|
+
] })
|
|
1632
|
+
] })
|
|
1633
|
+
]
|
|
1634
|
+
}
|
|
1635
|
+
)
|
|
1636
|
+
] })
|
|
1540
1637
|
] });
|
|
1541
1638
|
}
|
|
1542
|
-
var SearchInput =
|
|
1639
|
+
var SearchInput = React8.forwardRef(function SearchInput2({
|
|
1543
1640
|
value,
|
|
1544
1641
|
onChange,
|
|
1545
1642
|
disabled,
|
|
@@ -1854,7 +1951,7 @@ function TableBody({
|
|
|
1854
1951
|
return /* @__PURE__ */ jsx("tbody", { children: rows.map((row, i) => {
|
|
1855
1952
|
const rowKey = getRowKey(row, i);
|
|
1856
1953
|
const isExpanded = expanded.has(rowKey);
|
|
1857
|
-
return /* @__PURE__ */ jsxs(
|
|
1954
|
+
return /* @__PURE__ */ jsxs(React8.Fragment, { children: [
|
|
1858
1955
|
/* @__PURE__ */ jsxs(
|
|
1859
1956
|
"tr",
|
|
1860
1957
|
{
|
|
@@ -2451,7 +2548,7 @@ function ThemeProvider({
|
|
|
2451
2548
|
className = "",
|
|
2452
2549
|
style
|
|
2453
2550
|
}) {
|
|
2454
|
-
const id =
|
|
2551
|
+
const id = React8.useId().replace(/:/g, "");
|
|
2455
2552
|
const scopeClass = `geo-th-${id}`;
|
|
2456
2553
|
const divRef = useRef(null);
|
|
2457
2554
|
useEffect(() => {
|
|
@@ -3293,7 +3390,7 @@ function getMonthDays(year, month) {
|
|
|
3293
3390
|
}
|
|
3294
3391
|
return days;
|
|
3295
3392
|
}
|
|
3296
|
-
var
|
|
3393
|
+
var ChevronRight3 = ({ color = colors_default.PALETTE["prussian-blue"] }) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: color, strokeWidth: 2, className: "w-4 h-4", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) });
|
|
3297
3394
|
var DoubleChevronRight2 = ({ color = colors_default.PALETTE["prussian-blue"] }) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: color, strokeWidth: 2, className: "w-4 h-4", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 5l7 7-7 7M5 5l7 7-7 7" }) });
|
|
3298
3395
|
var ChevronDown2 = ({ color = colors_default.PALETTE["prussian-blue"] }) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: color, strokeWidth: 2, className: "w-4 h-4", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) });
|
|
3299
3396
|
function DatePickerBase({
|
|
@@ -3408,13 +3505,13 @@ function DatePickerBase({
|
|
|
3408
3505
|
children: isExpanded && /* @__PURE__ */ jsxs("div", { className: "pt-3", children: [
|
|
3409
3506
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center mx-auto w-max", children: [
|
|
3410
3507
|
/* @__PURE__ */ jsx("span", { onClick: () => setCurrentYear((y) => y - 1), className: "cursor-pointer rotate-180 p-1 rounded-lg hover:bg-ice-dark transition-all duration-300", children: /* @__PURE__ */ jsx(DoubleChevronRight2, {}) }),
|
|
3411
|
-
/* @__PURE__ */ jsx("span", { onClick: toPrevMonth, className: "cursor-pointer rotate-180 p-1 rounded-lg hover:bg-ice-dark transition-all duration-300", children: /* @__PURE__ */ jsx(
|
|
3508
|
+
/* @__PURE__ */ jsx("span", { onClick: toPrevMonth, className: "cursor-pointer rotate-180 p-1 rounded-lg hover:bg-ice-dark transition-all duration-300", children: /* @__PURE__ */ jsx(ChevronRight3, {}) }),
|
|
3412
3509
|
/* @__PURE__ */ jsxs("span", { className: "font-bold text-prussian-blue select-none w-[130px] text-center", children: [
|
|
3413
3510
|
currentYear,
|
|
3414
3511
|
" ",
|
|
3415
3512
|
MONTHS[currentMonth]
|
|
3416
3513
|
] }),
|
|
3417
|
-
/* @__PURE__ */ jsx("span", { onClick: toNextMonth, className: "cursor-pointer p-1 rounded-lg hover:bg-ice-dark transition-all duration-300", children: /* @__PURE__ */ jsx(
|
|
3514
|
+
/* @__PURE__ */ jsx("span", { onClick: toNextMonth, className: "cursor-pointer p-1 rounded-lg hover:bg-ice-dark transition-all duration-300", children: /* @__PURE__ */ jsx(ChevronRight3, {}) }),
|
|
3418
3515
|
/* @__PURE__ */ jsx("span", { onClick: () => setCurrentYear((y) => y + 1), className: "cursor-pointer p-1 rounded-lg hover:bg-ice-dark transition-all duration-300", children: /* @__PURE__ */ jsx(DoubleChevronRight2, {}) })
|
|
3419
3516
|
] }),
|
|
3420
3517
|
/* @__PURE__ */ jsx("div", { className: "flex gap-3 p-2", children: renderCalendar().map((weekDay, index) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-2", children: [
|