@geomak/ui 1.8.0 → 2.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 +270 -284
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +100 -30
- package/dist/index.d.ts +100 -30
- package/dist/index.js +180 -195
- package/dist/index.js.map +1 -1
- package/dist/styles.css +42 -28
- 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, useCallback, useId } 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,124 +1356,82 @@ 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
|
}
|
|
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
|
+
}
|
|
1476
1435
|
function Wizard({ children, steps, storageKey = "po_wizard" }) {
|
|
1477
1436
|
const wizardRef = useRef(null);
|
|
1478
1437
|
const [activeStep, setActiveStep] = useState(0);
|
|
@@ -1539,7 +1498,7 @@ function Wizard({ children, steps, storageKey = "po_wizard" }) {
|
|
|
1539
1498
|
children
|
|
1540
1499
|
] });
|
|
1541
1500
|
}
|
|
1542
|
-
var SearchInput =
|
|
1501
|
+
var SearchInput = React8.forwardRef(function SearchInput2({
|
|
1543
1502
|
value,
|
|
1544
1503
|
onChange,
|
|
1545
1504
|
disabled,
|
|
@@ -1854,7 +1813,7 @@ function TableBody({
|
|
|
1854
1813
|
return /* @__PURE__ */ jsx("tbody", { children: rows.map((row, i) => {
|
|
1855
1814
|
const rowKey = getRowKey(row, i);
|
|
1856
1815
|
const isExpanded = expanded.has(rowKey);
|
|
1857
|
-
return /* @__PURE__ */ jsxs(
|
|
1816
|
+
return /* @__PURE__ */ jsxs(React8.Fragment, { children: [
|
|
1858
1817
|
/* @__PURE__ */ jsxs(
|
|
1859
1818
|
"tr",
|
|
1860
1819
|
{
|
|
@@ -2451,7 +2410,7 @@ function ThemeProvider({
|
|
|
2451
2410
|
className = "",
|
|
2452
2411
|
style
|
|
2453
2412
|
}) {
|
|
2454
|
-
const id =
|
|
2413
|
+
const id = React8.useId().replace(/:/g, "");
|
|
2455
2414
|
const scopeClass = `geo-th-${id}`;
|
|
2456
2415
|
const divRef = useRef(null);
|
|
2457
2416
|
useEffect(() => {
|
|
@@ -2650,91 +2609,117 @@ function NumberInput({
|
|
|
2650
2609
|
htmlFor,
|
|
2651
2610
|
name,
|
|
2652
2611
|
disabled,
|
|
2653
|
-
layout,
|
|
2612
|
+
layout = "horizontal",
|
|
2654
2613
|
errorMessage,
|
|
2655
2614
|
inputStyle,
|
|
2656
2615
|
labelStyle,
|
|
2657
2616
|
placeholder,
|
|
2658
|
-
style
|
|
2617
|
+
style,
|
|
2659
2618
|
min,
|
|
2660
2619
|
max,
|
|
2661
|
-
readOnly = false
|
|
2620
|
+
readOnly = false,
|
|
2621
|
+
precision
|
|
2662
2622
|
}) {
|
|
2623
|
+
const errorId = useId();
|
|
2624
|
+
const hasError = errorMessage != null;
|
|
2625
|
+
const inferredPrecision = precision ?? (Number.isInteger(step) ? 0 : String(step).split(".")[1]?.length ?? 0);
|
|
2626
|
+
const round = (n) => {
|
|
2627
|
+
if (inferredPrecision === 0) return n;
|
|
2628
|
+
const factor = 10 ** inferredPrecision;
|
|
2629
|
+
return Math.round(n * factor) / factor;
|
|
2630
|
+
};
|
|
2631
|
+
const numeric = typeof value === "number" ? value : 0;
|
|
2663
2632
|
const onIncrement = () => {
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2633
|
+
if (disabled || readOnly) return;
|
|
2634
|
+
const next = round(numeric + step);
|
|
2635
|
+
if (max !== void 0 && next > max) return;
|
|
2636
|
+
onChange?.({ target: { value: next, id: htmlFor, name } });
|
|
2667
2637
|
};
|
|
2668
2638
|
const onDecrement = () => {
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2639
|
+
if (disabled || readOnly) return;
|
|
2640
|
+
const next = round(numeric - step);
|
|
2641
|
+
if (min !== void 0 && next < min) return;
|
|
2642
|
+
onChange?.({ target: { value: next, id: htmlFor, name } });
|
|
2672
2643
|
};
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
{
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2644
|
+
const handleInputChange = (e) => {
|
|
2645
|
+
const raw = e.target.value;
|
|
2646
|
+
if (raw === "") {
|
|
2647
|
+
onChange?.({ target: { value: void 0, id: htmlFor, name } });
|
|
2648
|
+
return;
|
|
2649
|
+
}
|
|
2650
|
+
const parsed = Number(raw);
|
|
2651
|
+
if (Number.isNaN(parsed)) return;
|
|
2652
|
+
onChange?.({ target: { value: round(parsed), id: htmlFor, name } });
|
|
2653
|
+
};
|
|
2654
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
2655
|
+
/* @__PURE__ */ jsxs("div", { className: `flex ${layout === "vertical" ? "flex-col gap-1" : "flex-row items-center gap-2"}`, children: [
|
|
2656
|
+
label && /* @__PURE__ */ jsx(
|
|
2657
|
+
"label",
|
|
2658
|
+
{
|
|
2659
|
+
className: "text-sm font-medium ml-1 max-content select-none text-foreground",
|
|
2660
|
+
style: labelStyle,
|
|
2661
|
+
htmlFor,
|
|
2662
|
+
children: label
|
|
2663
|
+
}
|
|
2664
|
+
),
|
|
2665
|
+
/* @__PURE__ */ jsxs(
|
|
2666
|
+
"div",
|
|
2667
|
+
{
|
|
2668
|
+
style,
|
|
2669
|
+
className: `flex items-center rounded-lg border ${hasError ? "border-status-error" : "border-border"} ${disabled ? "bg-surface-raised text-foreground-muted cursor-not-allowed" : "bg-surface text-foreground"} focus-within:ring-2 focus-within:ring-accent transition-colors`,
|
|
2670
|
+
children: [
|
|
2671
|
+
/* @__PURE__ */ jsx(
|
|
2672
|
+
"input",
|
|
2673
|
+
{
|
|
2674
|
+
min,
|
|
2675
|
+
max,
|
|
2676
|
+
autoComplete: "off",
|
|
2677
|
+
disabled,
|
|
2678
|
+
name,
|
|
2679
|
+
id: htmlFor,
|
|
2680
|
+
step,
|
|
2681
|
+
value: value ?? "",
|
|
2682
|
+
onChange: handleInputChange,
|
|
2683
|
+
type: "number",
|
|
2684
|
+
"aria-invalid": hasError || void 0,
|
|
2685
|
+
"aria-describedby": hasError ? errorId : void 0,
|
|
2686
|
+
className: "bg-transparent focus:outline-none h-9 w-full px-3 disabled:cursor-not-allowed [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",
|
|
2687
|
+
style: inputStyle ?? {},
|
|
2688
|
+
placeholder: placeholder ?? "",
|
|
2689
|
+
readOnly
|
|
2690
|
+
}
|
|
2691
|
+
),
|
|
2692
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col border-l border-border h-9", children: [
|
|
2693
|
+
/* @__PURE__ */ jsx(
|
|
2694
|
+
"button",
|
|
2695
|
+
{
|
|
2696
|
+
type: "button",
|
|
2697
|
+
tabIndex: -1,
|
|
2698
|
+
onClick: onIncrement,
|
|
2699
|
+
disabled: disabled || readOnly || max !== void 0 && numeric >= max,
|
|
2700
|
+
"aria-label": "Increase value",
|
|
2701
|
+
className: "flex-1 px-1.5 flex items-center justify-center hover:bg-surface-raised disabled:opacity-30 disabled:cursor-not-allowed transition-colors focus:outline-none focus-visible:bg-surface-raised",
|
|
2702
|
+
children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, className: "h-3 w-3", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 15l7-7 7 7" }) })
|
|
2703
|
+
}
|
|
2704
|
+
),
|
|
2705
|
+
/* @__PURE__ */ jsx(
|
|
2706
|
+
"button",
|
|
2707
|
+
{
|
|
2708
|
+
type: "button",
|
|
2709
|
+
tabIndex: -1,
|
|
2710
|
+
onClick: onDecrement,
|
|
2711
|
+
disabled: disabled || readOnly || min !== void 0 && numeric <= min,
|
|
2712
|
+
"aria-label": "Decrease value",
|
|
2713
|
+
className: "flex-1 px-1.5 flex items-center justify-center hover:bg-surface-raised disabled:opacity-30 disabled:cursor-not-allowed transition-colors focus:outline-none focus-visible:bg-surface-raised border-t border-border",
|
|
2714
|
+
children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, className: "h-3 w-3", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) })
|
|
2715
|
+
}
|
|
2716
|
+
)
|
|
2717
|
+
] })
|
|
2718
|
+
]
|
|
2719
|
+
}
|
|
2720
|
+
)
|
|
2721
|
+
] }),
|
|
2722
|
+
hasError && /* @__PURE__ */ jsx("div", { id: errorId, className: "text-xs text-status-error ml-1", children: errorMessage })
|
|
2738
2723
|
] });
|
|
2739
2724
|
}
|
|
2740
2725
|
function Password({
|
|
@@ -3267,7 +3252,7 @@ function getMonthDays(year, month) {
|
|
|
3267
3252
|
}
|
|
3268
3253
|
return days;
|
|
3269
3254
|
}
|
|
3270
|
-
var
|
|
3255
|
+
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" }) });
|
|
3271
3256
|
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" }) });
|
|
3272
3257
|
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" }) });
|
|
3273
3258
|
function DatePickerBase({
|
|
@@ -3382,13 +3367,13 @@ function DatePickerBase({
|
|
|
3382
3367
|
children: isExpanded && /* @__PURE__ */ jsxs("div", { className: "pt-3", children: [
|
|
3383
3368
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center mx-auto w-max", children: [
|
|
3384
3369
|
/* @__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, {}) }),
|
|
3385
|
-
/* @__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(
|
|
3370
|
+
/* @__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, {}) }),
|
|
3386
3371
|
/* @__PURE__ */ jsxs("span", { className: "font-bold text-prussian-blue select-none w-[130px] text-center", children: [
|
|
3387
3372
|
currentYear,
|
|
3388
3373
|
" ",
|
|
3389
3374
|
MONTHS[currentMonth]
|
|
3390
3375
|
] }),
|
|
3391
|
-
/* @__PURE__ */ jsx("span", { onClick: toNextMonth, className: "cursor-pointer p-1 rounded-lg hover:bg-ice-dark transition-all duration-300", children: /* @__PURE__ */ jsx(
|
|
3376
|
+
/* @__PURE__ */ jsx("span", { onClick: toNextMonth, className: "cursor-pointer p-1 rounded-lg hover:bg-ice-dark transition-all duration-300", children: /* @__PURE__ */ jsx(ChevronRight3, {}) }),
|
|
3392
3377
|
/* @__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, {}) })
|
|
3393
3378
|
] }),
|
|
3394
3379
|
/* @__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: [
|