@geomak/ui 5.8.0 → 5.10.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 +105 -54
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +126 -38
- package/dist/index.d.ts +126 -38
- package/dist/index.js +105 -54
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -607,7 +607,9 @@ function IconButton({
|
|
|
607
607
|
disabled = false,
|
|
608
608
|
size = "lg",
|
|
609
609
|
loading = false,
|
|
610
|
-
loadingIcon
|
|
610
|
+
loadingIcon,
|
|
611
|
+
className = "",
|
|
612
|
+
style
|
|
611
613
|
}) {
|
|
612
614
|
const colorScheme = useMemo(() => {
|
|
613
615
|
if (type === "primary") {
|
|
@@ -624,7 +626,8 @@ function IconButton({
|
|
|
624
626
|
type: buttonType,
|
|
625
627
|
disabled: disabled || loading,
|
|
626
628
|
onClick,
|
|
627
|
-
|
|
629
|
+
style,
|
|
630
|
+
className: `${size === "sm" ? "p-1" : "p-2"} rounded-lg shadow-md transition-colors duration-150 ${colorScheme} disabled:bg-surface-raised disabled:text-foreground-muted disabled:cursor-not-allowed focus:outline-none focus-visible:ring-2 focus-visible:ring-accent ${className}`.trim(),
|
|
628
631
|
children: loading ? loadingIcon : icon
|
|
629
632
|
}
|
|
630
633
|
);
|
|
@@ -675,7 +678,8 @@ function Button({
|
|
|
675
678
|
disabled,
|
|
676
679
|
style,
|
|
677
680
|
icon,
|
|
678
|
-
onClick
|
|
681
|
+
onClick,
|
|
682
|
+
className = ""
|
|
679
683
|
}) {
|
|
680
684
|
return /* @__PURE__ */ jsxs(
|
|
681
685
|
"button",
|
|
@@ -690,8 +694,9 @@ function Button({
|
|
|
690
694
|
"outline-none transition-colors duration-150 select-none",
|
|
691
695
|
"whitespace-nowrap",
|
|
692
696
|
SIZE_CLASSES[size],
|
|
693
|
-
VARIANT_CLASSES[variant]
|
|
694
|
-
|
|
697
|
+
VARIANT_CLASSES[variant],
|
|
698
|
+
className
|
|
699
|
+
].filter(Boolean).join(" "),
|
|
695
700
|
children: [
|
|
696
701
|
loading ? /* @__PURE__ */ jsx(
|
|
697
702
|
"svg",
|
|
@@ -726,7 +731,8 @@ function Modal({
|
|
|
726
731
|
cancelText = "Cancel",
|
|
727
732
|
hasFooter = true,
|
|
728
733
|
title,
|
|
729
|
-
children
|
|
734
|
+
children,
|
|
735
|
+
className = ""
|
|
730
736
|
}) {
|
|
731
737
|
const reduced = useReducedMotion();
|
|
732
738
|
const maxWidth = width ?? size?.[0] ?? 600;
|
|
@@ -746,7 +752,7 @@ function Modal({
|
|
|
746
752
|
/* @__PURE__ */ jsx(AnimatePresence, { children: isOpen && /* @__PURE__ */ jsx(Dialog.Content, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
747
753
|
motion.div,
|
|
748
754
|
{
|
|
749
|
-
className:
|
|
755
|
+
className: `fixed left-1/2 top-1/2 z-modal flex flex-col w-[calc(100%-2rem)] max-h-[90dvh] bg-surface rounded-2xl shadow-xl overflow-hidden focus:outline-none ${className}`.trim(),
|
|
750
756
|
style: {
|
|
751
757
|
maxWidth,
|
|
752
758
|
x: "-50%",
|
|
@@ -808,7 +814,8 @@ function Drawer({
|
|
|
808
814
|
onOk,
|
|
809
815
|
onCancel,
|
|
810
816
|
title,
|
|
811
|
-
children
|
|
817
|
+
children,
|
|
818
|
+
className = ""
|
|
812
819
|
}) {
|
|
813
820
|
const reduced = useReducedMotion();
|
|
814
821
|
const isRight = placement === "right";
|
|
@@ -829,7 +836,7 @@ function Drawer({
|
|
|
829
836
|
/* @__PURE__ */ jsx(AnimatePresence, { children: isOpen && /* @__PURE__ */ jsx(Dialog.Content, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
830
837
|
motion.div,
|
|
831
838
|
{
|
|
832
|
-
className: `fixed top-0 bottom-0 ${isRight ? "right-0" : "left-0"} z-modal flex flex-col bg-surface shadow-xl focus:outline-none
|
|
839
|
+
className: `fixed top-0 bottom-0 ${isRight ? "right-0" : "left-0"} z-modal flex flex-col bg-surface shadow-xl focus:outline-none ${className}`.trim(),
|
|
833
840
|
style: { width: `min(calc(100vw - 1rem), ${width}px)` },
|
|
834
841
|
initial: { x: reduced ? 0 : hiddenX, opacity: reduced ? 0 : 1 },
|
|
835
842
|
animate: { x: 0, opacity: 1 },
|
|
@@ -876,7 +883,8 @@ function Tooltip({
|
|
|
876
883
|
title,
|
|
877
884
|
placement = "top",
|
|
878
885
|
delayDuration = 300,
|
|
879
|
-
sideOffset = 8
|
|
886
|
+
sideOffset = 8,
|
|
887
|
+
className = ""
|
|
880
888
|
}) {
|
|
881
889
|
return /* @__PURE__ */ jsx(TooltipPrimitive.Provider, { delayDuration, children: /* @__PURE__ */ jsxs(TooltipPrimitive.Root, { children: [
|
|
882
890
|
/* @__PURE__ */ jsx(TooltipPrimitive.Trigger, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "inline-flex", children }) }),
|
|
@@ -896,8 +904,9 @@ function Tooltip({
|
|
|
896
904
|
// Out animation (always the same — just fade)
|
|
897
905
|
"data-[state=closed]:animate-tooltip-out",
|
|
898
906
|
// In animation — direction-aware
|
|
899
|
-
ANIMATION[placement]
|
|
900
|
-
|
|
907
|
+
ANIMATION[placement],
|
|
908
|
+
className
|
|
909
|
+
].filter(Boolean).join(" "),
|
|
901
910
|
children: [
|
|
902
911
|
title,
|
|
903
912
|
/* @__PURE__ */ jsx(
|
|
@@ -1130,9 +1139,11 @@ function Tree({
|
|
|
1130
1139
|
nodes,
|
|
1131
1140
|
onNodeClick,
|
|
1132
1141
|
defaultExpandAll = false,
|
|
1133
|
-
defaultExpandedKeys = []
|
|
1142
|
+
defaultExpandedKeys = [],
|
|
1143
|
+
className = "",
|
|
1144
|
+
style
|
|
1134
1145
|
}) {
|
|
1135
|
-
return /* @__PURE__ */ jsx("div", { className:
|
|
1146
|
+
return /* @__PURE__ */ jsx("div", { className: `p-1 w-full ${className}`.trim(), style, children: nodes.map((item) => /* @__PURE__ */ jsx(
|
|
1136
1147
|
TreeNodeItem,
|
|
1137
1148
|
{
|
|
1138
1149
|
item,
|
|
@@ -1399,7 +1410,8 @@ function LoadingSpinner({
|
|
|
1399
1410
|
inline = false,
|
|
1400
1411
|
spinnerColor,
|
|
1401
1412
|
textColor,
|
|
1402
|
-
backdropOpacity = 0.8
|
|
1413
|
+
backdropOpacity = 0.8,
|
|
1414
|
+
className = ""
|
|
1403
1415
|
}) {
|
|
1404
1416
|
const reduced = useReducedMotion();
|
|
1405
1417
|
const letters = prompt ? Array.from(prompt) : [];
|
|
@@ -1434,7 +1446,7 @@ function LoadingSpinner({
|
|
|
1434
1446
|
role: "status",
|
|
1435
1447
|
"aria-live": "polite",
|
|
1436
1448
|
"aria-label": prompt ?? "Loading",
|
|
1437
|
-
className:
|
|
1449
|
+
className: `flex flex-col items-center justify-center gap-3 ${className}`.trim(),
|
|
1438
1450
|
children: content
|
|
1439
1451
|
}
|
|
1440
1452
|
);
|
|
@@ -1445,7 +1457,7 @@ function LoadingSpinner({
|
|
|
1445
1457
|
role: "status",
|
|
1446
1458
|
"aria-live": "polite",
|
|
1447
1459
|
"aria-label": prompt ?? "Loading",
|
|
1448
|
-
className:
|
|
1460
|
+
className: `fixed inset-0 z-[8000000] flex flex-col items-center justify-center gap-6 bg-background backdrop-blur-sm ${className}`.trim(),
|
|
1449
1461
|
style: { opacity: backdropOpacity },
|
|
1450
1462
|
children: content
|
|
1451
1463
|
}
|
|
@@ -1496,9 +1508,11 @@ function List2({
|
|
|
1496
1508
|
items,
|
|
1497
1509
|
onItemClick,
|
|
1498
1510
|
activeKey,
|
|
1499
|
-
density = "comfortable"
|
|
1511
|
+
density = "comfortable",
|
|
1512
|
+
className = "",
|
|
1513
|
+
style
|
|
1500
1514
|
}) {
|
|
1501
|
-
return /* @__PURE__ */ jsx("div", { role: "listbox", className:
|
|
1515
|
+
return /* @__PURE__ */ jsx("div", { role: "listbox", className: `flex flex-col ${className}`.trim(), style, children: items.map((item) => {
|
|
1502
1516
|
const isActive = activeKey === item.key;
|
|
1503
1517
|
const isDisabled = !!item.disabled;
|
|
1504
1518
|
return /* @__PURE__ */ jsxs(
|
|
@@ -1552,7 +1566,8 @@ function ScalableContainer({
|
|
|
1552
1566
|
assignClassOnClick,
|
|
1553
1567
|
expandIcon,
|
|
1554
1568
|
collapseIcon,
|
|
1555
|
-
togglePosition = "top-right"
|
|
1569
|
+
togglePosition = "top-right",
|
|
1570
|
+
className = ""
|
|
1556
1571
|
}) {
|
|
1557
1572
|
const containerRef = useRef(null);
|
|
1558
1573
|
const [internalScaled, setInternalScaled] = useState(false);
|
|
@@ -1587,8 +1602,9 @@ function ScalableContainer({
|
|
|
1587
1602
|
// OS-window aesthetic: subtle elevation at rest, lifted shadow
|
|
1588
1603
|
// when expanded. No background colour change.
|
|
1589
1604
|
isScaled ? "shadow-2xl" : "shadow-md",
|
|
1590
|
-
"transition-shadow duration-300"
|
|
1591
|
-
|
|
1605
|
+
"transition-shadow duration-300",
|
|
1606
|
+
className
|
|
1607
|
+
].filter(Boolean).join(" "),
|
|
1592
1608
|
children: [
|
|
1593
1609
|
/* @__PURE__ */ jsx(Tooltip, { placement: "bottom", title: isScaled ? "Collapse" : "Expand", children: /* @__PURE__ */ jsx(
|
|
1594
1610
|
"button",
|
|
@@ -1620,8 +1636,8 @@ function CollapseIcon() {
|
|
|
1620
1636
|
function ExpandIcon() {
|
|
1621
1637
|
return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "w-4 h-4", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 8V4h4M20 8V4h-4M4 16v4h4M20 16v4h-4" }) });
|
|
1622
1638
|
}
|
|
1623
|
-
function GridCard({ item, buttonText = "Open Application", onOpen }) {
|
|
1624
|
-
return /* @__PURE__ */ jsxs("div", { className:
|
|
1639
|
+
function GridCard({ item, buttonText = "Open Application", onOpen, className = "", style }) {
|
|
1640
|
+
return /* @__PURE__ */ jsxs("div", { className: `flex flex-col w-[200px] h-[250px] rounded-lg bg-ice dark:bg-independence items-center justify-between p-2 shadow-2xl ${className}`.trim(), style, children: [
|
|
1625
1641
|
/* @__PURE__ */ jsx("div", { className: "text-prussian-blue dark:text-white text-lg font-bold text-center h-1/4", children: /* @__PURE__ */ jsx("h2", { children: item.title }) }),
|
|
1626
1642
|
/* @__PURE__ */ jsx("div", { className: "h-1/4 flex items-center justify-center", children: typeof item.cover === "string" ? /* @__PURE__ */ jsx("img", { src: item.cover, alt: "Grid Card Cover" }) : item.cover }),
|
|
1627
1643
|
/* @__PURE__ */ jsx("div", { className: "text-prussian-blue text-sm dark:text-white text-center h-1/4", children: /* @__PURE__ */ jsx("p", { children: item.description }) }),
|
|
@@ -1640,12 +1656,13 @@ function OpaqueGridCard({
|
|
|
1640
1656
|
item,
|
|
1641
1657
|
isRight = false,
|
|
1642
1658
|
buttonText = "Open Application",
|
|
1643
|
-
onOpen
|
|
1659
|
+
onOpen,
|
|
1660
|
+
className = ""
|
|
1644
1661
|
}) {
|
|
1645
1662
|
return /* @__PURE__ */ jsxs(
|
|
1646
1663
|
"div",
|
|
1647
1664
|
{
|
|
1648
|
-
className: `flex flex-col w-[200px] h-[250px] rounded-lg items-center p-2 ${!isRight ? "opaque-carousel-card-left dark:opaque-carousel-card-dark-left" : "opaque-carousel-card-right dark:opaque-carousel-card-dark-right"}
|
|
1665
|
+
className: `flex flex-col w-[200px] h-[250px] rounded-lg items-center p-2 ${!isRight ? "opaque-carousel-card-left dark:opaque-carousel-card-dark-left" : "opaque-carousel-card-right dark:opaque-carousel-card-dark-right"} ${className}`.trim(),
|
|
1649
1666
|
children: [
|
|
1650
1667
|
/* @__PURE__ */ jsx(
|
|
1651
1668
|
"div",
|
|
@@ -1687,10 +1704,10 @@ function OpaqueGridCard({
|
|
|
1687
1704
|
}
|
|
1688
1705
|
);
|
|
1689
1706
|
}
|
|
1690
|
-
function CatalogGrid({ items, buttonText, onOpen }) {
|
|
1691
|
-
return /* @__PURE__ */ jsx("div", { className:
|
|
1707
|
+
function CatalogGrid({ items, buttonText, onOpen, className = "" }) {
|
|
1708
|
+
return /* @__PURE__ */ jsx("div", { className: `flex flex-wrap gap-2 ${className}`.trim(), children: items.map((item) => /* @__PURE__ */ jsx(GridCard, { item, buttonText, onOpen }, item.key)) });
|
|
1692
1709
|
}
|
|
1693
|
-
function CatalogCarousel({ items, buttonText, onOpen }) {
|
|
1710
|
+
function CatalogCarousel({ items, buttonText, onOpen, className = "" }) {
|
|
1694
1711
|
const [activeIndex, setActiveIndex] = useState(0);
|
|
1695
1712
|
const [indexPool, setIndexPool] = useState([]);
|
|
1696
1713
|
const cardRefs = useRef([]);
|
|
@@ -1727,7 +1744,7 @@ function CatalogCarousel({ items, buttonText, onOpen }) {
|
|
|
1727
1744
|
}, [activeIndex, getIndexes, items.length]);
|
|
1728
1745
|
const nextApp = () => setActiveIndex((prev) => prev + 1 === items.length ? 0 : prev + 1);
|
|
1729
1746
|
const previousApp = () => setActiveIndex((prev) => prev - 1 === -1 ? items.length - 1 : prev - 1);
|
|
1730
|
-
return /* @__PURE__ */ jsx("div", { className:
|
|
1747
|
+
return /* @__PURE__ */ jsx("div", { className: `flex items-center justify-center w-full h-full ${className}`.trim(), children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-10", children: [
|
|
1731
1748
|
/* @__PURE__ */ jsx(
|
|
1732
1749
|
"button",
|
|
1733
1750
|
{
|
|
@@ -1777,16 +1794,16 @@ function CatalogCarousel({ items, buttonText, onOpen }) {
|
|
|
1777
1794
|
)
|
|
1778
1795
|
] }) });
|
|
1779
1796
|
}
|
|
1780
|
-
function Catalog({ display: display2 = "grid", items = [], buttonText, onOpen }) {
|
|
1781
|
-
return /* @__PURE__ */ jsx("div", { className:
|
|
1797
|
+
function Catalog({ display: display2 = "grid", items = [], buttonText, onOpen, className = "" }) {
|
|
1798
|
+
return /* @__PURE__ */ jsx("div", { className: `w-full h-full ${className}`.trim(), children: display2 === "grid" ? /* @__PURE__ */ jsx(CatalogGrid, { items, buttonText, onOpen }) : /* @__PURE__ */ jsx(CatalogCarousel, { items, buttonText, onOpen }) });
|
|
1782
1799
|
}
|
|
1783
|
-
function ContextMenu({ items, children }) {
|
|
1800
|
+
function ContextMenu({ items, children, className = "" }) {
|
|
1784
1801
|
return /* @__PURE__ */ jsxs(ContextMenuPrimitive.Root, { children: [
|
|
1785
1802
|
/* @__PURE__ */ jsx(ContextMenuPrimitive.Trigger, { asChild: true, children }),
|
|
1786
1803
|
/* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
1787
1804
|
ContextMenuPrimitive.Content,
|
|
1788
1805
|
{
|
|
1789
|
-
className: CONTENT_CLASSNAME,
|
|
1806
|
+
className: `${CONTENT_CLASSNAME} ${className}`.trim(),
|
|
1790
1807
|
collisionPadding: 8,
|
|
1791
1808
|
children: items.map((item) => renderItem(item))
|
|
1792
1809
|
}
|
|
@@ -2240,8 +2257,8 @@ function Field({
|
|
|
2240
2257
|
);
|
|
2241
2258
|
}
|
|
2242
2259
|
var SearchIcon = /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", className: "w-4 h-4", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M10.5 3.75a6.75 6.75 0 100 13.5 6.75 6.75 0 000-13.5zM2.25 10.5a8.25 8.25 0 1114.59 5.28l4.69 4.69a.75.75 0 11-1.06 1.06l-4.69-4.69A8.25 8.25 0 012.25 10.5z", clipRule: "evenodd" }) });
|
|
2243
|
-
var SearchInput = React8.forwardRef(function SearchInput2({ value, onChange, disabled, label, htmlFor, placeholder, name, inputStyle, style, layout = "vertical", size = "md", icon, helperText }, ref) {
|
|
2244
|
-
return /* @__PURE__ */ jsx(Field, { label, htmlFor, layout, helperText, children: /* @__PURE__ */ jsxs(
|
|
2260
|
+
var SearchInput = React8.forwardRef(function SearchInput2({ value, onChange, disabled, label, htmlFor, placeholder, name, inputStyle, style, layout = "vertical", size = "md", icon, helperText, className }, ref) {
|
|
2261
|
+
return /* @__PURE__ */ jsx(Field, { className, label, htmlFor, layout, helperText, children: /* @__PURE__ */ jsxs(
|
|
2245
2262
|
"div",
|
|
2246
2263
|
{
|
|
2247
2264
|
className: `flex items-center ${fieldShell({ size, disabled, focusWithin: true })}`,
|
|
@@ -2389,7 +2406,8 @@ function Dropdown({
|
|
|
2389
2406
|
items = [],
|
|
2390
2407
|
labelStyle = {},
|
|
2391
2408
|
placeholder,
|
|
2392
|
-
size = "md"
|
|
2409
|
+
size = "md",
|
|
2410
|
+
className = ""
|
|
2393
2411
|
}) {
|
|
2394
2412
|
const [open, setOpen] = useState(false);
|
|
2395
2413
|
const [selectedItems, setSelectedItems] = useState([]);
|
|
@@ -2437,7 +2455,7 @@ function Dropdown({
|
|
|
2437
2455
|
);
|
|
2438
2456
|
};
|
|
2439
2457
|
const isSelected = (key) => Array.isArray(value) ? value.includes(key) : value === key;
|
|
2440
|
-
return /* @__PURE__ */ jsxs("div", { children: [
|
|
2458
|
+
return /* @__PURE__ */ jsxs("div", { className: className || void 0, children: [
|
|
2441
2459
|
/* @__PURE__ */ jsxs(
|
|
2442
2460
|
"div",
|
|
2443
2461
|
{
|
|
@@ -2845,7 +2863,9 @@ function Table({
|
|
|
2845
2863
|
footer = null,
|
|
2846
2864
|
header = null,
|
|
2847
2865
|
loading = false,
|
|
2848
|
-
loadingRowCount = 8
|
|
2866
|
+
loadingRowCount = 8,
|
|
2867
|
+
className = "",
|
|
2868
|
+
style
|
|
2849
2869
|
}) {
|
|
2850
2870
|
const searchRef = useRef(null);
|
|
2851
2871
|
const [searchTerm, setSearchTerm] = useState("");
|
|
@@ -2905,7 +2925,7 @@ function Table({
|
|
|
2905
2925
|
}
|
|
2906
2926
|
setActivePage(newPage);
|
|
2907
2927
|
};
|
|
2908
|
-
return /* @__PURE__ */ jsxs("div", { className:
|
|
2928
|
+
return /* @__PURE__ */ jsxs("div", { className: `w-full h-max rounded-lg ${className}`.trim(), style, children: [
|
|
2909
2929
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
|
|
2910
2930
|
hasSearch && /* @__PURE__ */ jsx(
|
|
2911
2931
|
SearchInput_default,
|
|
@@ -2968,9 +2988,9 @@ function TableSkeletonBody({
|
|
|
2968
2988
|
i
|
|
2969
2989
|
)) });
|
|
2970
2990
|
}
|
|
2971
|
-
function ThemeSwitch({ checked, onChange, label = "Toggle dark mode" }) {
|
|
2991
|
+
function ThemeSwitch({ checked, onChange, label = "Toggle dark mode", className = "" }) {
|
|
2972
2992
|
const id = useId();
|
|
2973
|
-
return /* @__PURE__ */ jsx("label", { htmlFor: id, className:
|
|
2993
|
+
return /* @__PURE__ */ jsx("label", { htmlFor: id, className: `flex items-center gap-2 cursor-pointer select-none ${className}`.trim(), children: /* @__PURE__ */ jsx(
|
|
2974
2994
|
SwitchPrimitive.Root,
|
|
2975
2995
|
{
|
|
2976
2996
|
id,
|
|
@@ -3082,7 +3102,8 @@ function Sidebar({
|
|
|
3082
3102
|
onToggle,
|
|
3083
3103
|
expandedWidth = 220,
|
|
3084
3104
|
collapsedWidth = 52,
|
|
3085
|
-
footer
|
|
3105
|
+
footer,
|
|
3106
|
+
className = ""
|
|
3086
3107
|
}) {
|
|
3087
3108
|
return /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ jsxs(
|
|
3088
3109
|
motion.aside,
|
|
@@ -3090,7 +3111,7 @@ function Sidebar({
|
|
|
3090
3111
|
initial: false,
|
|
3091
3112
|
animate: { width: isExpanded ? expandedWidth : collapsedWidth },
|
|
3092
3113
|
transition: { type: "tween", duration: 0.22, ease: [0.16, 1, 0.3, 1] },
|
|
3093
|
-
className:
|
|
3114
|
+
className: `relative flex h-full flex-col border-r border-border bg-surface overflow-hidden flex-shrink-0 ${className}`.trim(),
|
|
3094
3115
|
children: [
|
|
3095
3116
|
/* @__PURE__ */ jsxs("div", { className: [
|
|
3096
3117
|
"flex h-14 flex-shrink-0 items-center border-b border-border",
|
|
@@ -3416,6 +3437,7 @@ function TextInput({
|
|
|
3416
3437
|
onBlur,
|
|
3417
3438
|
errorMessage,
|
|
3418
3439
|
helperText,
|
|
3440
|
+
className,
|
|
3419
3441
|
required,
|
|
3420
3442
|
prefix,
|
|
3421
3443
|
suffix
|
|
@@ -3444,6 +3466,7 @@ function TextInput({
|
|
|
3444
3466
|
return /* @__PURE__ */ jsx(
|
|
3445
3467
|
Field,
|
|
3446
3468
|
{
|
|
3469
|
+
className,
|
|
3447
3470
|
label,
|
|
3448
3471
|
htmlFor,
|
|
3449
3472
|
errorId,
|
|
@@ -3478,6 +3501,7 @@ function NumberInput({
|
|
|
3478
3501
|
size = "md",
|
|
3479
3502
|
errorMessage,
|
|
3480
3503
|
helperText,
|
|
3504
|
+
className,
|
|
3481
3505
|
required,
|
|
3482
3506
|
inputStyle,
|
|
3483
3507
|
labelStyle,
|
|
@@ -3522,6 +3546,7 @@ function NumberInput({
|
|
|
3522
3546
|
return /* @__PURE__ */ jsx(
|
|
3523
3547
|
Field,
|
|
3524
3548
|
{
|
|
3549
|
+
className,
|
|
3525
3550
|
label,
|
|
3526
3551
|
htmlFor,
|
|
3527
3552
|
errorId,
|
|
@@ -3613,6 +3638,7 @@ function Password({
|
|
|
3613
3638
|
onBlur,
|
|
3614
3639
|
errorMessage,
|
|
3615
3640
|
helperText,
|
|
3641
|
+
className,
|
|
3616
3642
|
required,
|
|
3617
3643
|
showIcon,
|
|
3618
3644
|
hideIcon
|
|
@@ -3623,6 +3649,7 @@ function Password({
|
|
|
3623
3649
|
return /* @__PURE__ */ jsx(
|
|
3624
3650
|
Field,
|
|
3625
3651
|
{
|
|
3652
|
+
className,
|
|
3626
3653
|
label,
|
|
3627
3654
|
htmlFor,
|
|
3628
3655
|
errorId,
|
|
@@ -3685,7 +3712,8 @@ function Checkbox({
|
|
|
3685
3712
|
disabled = false,
|
|
3686
3713
|
required,
|
|
3687
3714
|
layout = "horizontal",
|
|
3688
|
-
labelPosition = "right"
|
|
3715
|
+
labelPosition = "right",
|
|
3716
|
+
className = ""
|
|
3689
3717
|
}) {
|
|
3690
3718
|
const isChecked = checked ?? value ?? false;
|
|
3691
3719
|
const labelFirst = labelPosition === "left";
|
|
@@ -3763,7 +3791,7 @@ function Checkbox({
|
|
|
3763
3791
|
] })
|
|
3764
3792
|
] });
|
|
3765
3793
|
}
|
|
3766
|
-
return /* @__PURE__ */ jsxs("div", { className:
|
|
3794
|
+
return /* @__PURE__ */ jsxs("div", { className: `flex flex-col gap-1 ${className}`.trim(), children: [
|
|
3767
3795
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-1", children: [
|
|
3768
3796
|
content,
|
|
3769
3797
|
helperText != null && /* @__PURE__ */ jsx(FieldHelpIcon, { text: helperText })
|
|
@@ -3794,6 +3822,7 @@ function RadioGroup({
|
|
|
3794
3822
|
disabled,
|
|
3795
3823
|
required,
|
|
3796
3824
|
helperText,
|
|
3825
|
+
className,
|
|
3797
3826
|
errorMessage
|
|
3798
3827
|
}) {
|
|
3799
3828
|
const errorId = useId();
|
|
@@ -3803,6 +3832,7 @@ function RadioGroup({
|
|
|
3803
3832
|
return /* @__PURE__ */ jsx(
|
|
3804
3833
|
Field,
|
|
3805
3834
|
{
|
|
3835
|
+
className,
|
|
3806
3836
|
label,
|
|
3807
3837
|
htmlFor: groupId,
|
|
3808
3838
|
errorId,
|
|
@@ -3888,6 +3918,7 @@ function Switch({
|
|
|
3888
3918
|
label,
|
|
3889
3919
|
layout = "horizontal",
|
|
3890
3920
|
helperText,
|
|
3921
|
+
className,
|
|
3891
3922
|
offLabel,
|
|
3892
3923
|
onLabel,
|
|
3893
3924
|
name,
|
|
@@ -3913,6 +3944,7 @@ function Switch({
|
|
|
3913
3944
|
return /* @__PURE__ */ jsx(
|
|
3914
3945
|
Field,
|
|
3915
3946
|
{
|
|
3947
|
+
className,
|
|
3916
3948
|
label,
|
|
3917
3949
|
htmlFor: id,
|
|
3918
3950
|
errorId,
|
|
@@ -3967,6 +3999,7 @@ function AutoComplete({
|
|
|
3967
3999
|
icon,
|
|
3968
4000
|
errorMessage,
|
|
3969
4001
|
helperText,
|
|
4002
|
+
className,
|
|
3970
4003
|
required,
|
|
3971
4004
|
htmlFor
|
|
3972
4005
|
}) {
|
|
@@ -4021,6 +4054,7 @@ function AutoComplete({
|
|
|
4021
4054
|
return /* @__PURE__ */ jsx(
|
|
4022
4055
|
Field,
|
|
4023
4056
|
{
|
|
4057
|
+
className,
|
|
4024
4058
|
label,
|
|
4025
4059
|
htmlFor,
|
|
4026
4060
|
errorId,
|
|
@@ -4126,6 +4160,7 @@ function TreeSelect({
|
|
|
4126
4160
|
disabled,
|
|
4127
4161
|
layout = "horizontal",
|
|
4128
4162
|
helperText,
|
|
4163
|
+
className,
|
|
4129
4164
|
required,
|
|
4130
4165
|
errorMessage,
|
|
4131
4166
|
style,
|
|
@@ -4213,6 +4248,7 @@ function TreeSelect({
|
|
|
4213
4248
|
return /* @__PURE__ */ jsx(
|
|
4214
4249
|
Field,
|
|
4215
4250
|
{
|
|
4251
|
+
className,
|
|
4216
4252
|
label,
|
|
4217
4253
|
htmlFor,
|
|
4218
4254
|
errorId,
|
|
@@ -4379,6 +4415,7 @@ function FileInput({
|
|
|
4379
4415
|
maxSize,
|
|
4380
4416
|
errorMessage,
|
|
4381
4417
|
helperText,
|
|
4418
|
+
className,
|
|
4382
4419
|
disabled,
|
|
4383
4420
|
required,
|
|
4384
4421
|
icon
|
|
@@ -4421,6 +4458,7 @@ function FileInput({
|
|
|
4421
4458
|
return /* @__PURE__ */ jsxs(
|
|
4422
4459
|
Field,
|
|
4423
4460
|
{
|
|
4461
|
+
className,
|
|
4424
4462
|
label,
|
|
4425
4463
|
htmlFor,
|
|
4426
4464
|
errorId,
|
|
@@ -4574,7 +4612,8 @@ function DatePicker({
|
|
|
4574
4612
|
format = defaultFormat,
|
|
4575
4613
|
weekStartsOn = 0,
|
|
4576
4614
|
clearable = true,
|
|
4577
|
-
size = "md"
|
|
4615
|
+
size = "md",
|
|
4616
|
+
className = ""
|
|
4578
4617
|
}) {
|
|
4579
4618
|
const errorId = useId();
|
|
4580
4619
|
const hasError = errorMessage != null;
|
|
@@ -4655,7 +4694,7 @@ function DatePicker({
|
|
|
4655
4694
|
}
|
|
4656
4695
|
};
|
|
4657
4696
|
const displayValue = value ? format(value) : "";
|
|
4658
|
-
return /* @__PURE__ */ jsxs("div", { className:
|
|
4697
|
+
return /* @__PURE__ */ jsxs("div", { className: `flex flex-col gap-1 ${className}`.trim(), children: [
|
|
4659
4698
|
/* @__PURE__ */ jsxs("div", { className: `flex ${layout === "vertical" ? "flex-col gap-1.5" : "flex-row items-start gap-3"}`, children: [
|
|
4660
4699
|
/* @__PURE__ */ jsx(
|
|
4661
4700
|
FieldLabel,
|
|
@@ -4884,6 +4923,7 @@ function TextArea({
|
|
|
4884
4923
|
resize,
|
|
4885
4924
|
errorMessage,
|
|
4886
4925
|
helperText,
|
|
4926
|
+
className,
|
|
4887
4927
|
required,
|
|
4888
4928
|
style,
|
|
4889
4929
|
inputStyle
|
|
@@ -4905,6 +4945,7 @@ function TextArea({
|
|
|
4905
4945
|
return /* @__PURE__ */ jsxs(
|
|
4906
4946
|
Field,
|
|
4907
4947
|
{
|
|
4948
|
+
className,
|
|
4908
4949
|
label,
|
|
4909
4950
|
htmlFor,
|
|
4910
4951
|
errorId,
|
|
@@ -4953,6 +4994,7 @@ function SegmentedControl({
|
|
|
4953
4994
|
label,
|
|
4954
4995
|
layout = "vertical",
|
|
4955
4996
|
helperText,
|
|
4997
|
+
className,
|
|
4956
4998
|
name,
|
|
4957
4999
|
required,
|
|
4958
5000
|
errorMessage,
|
|
@@ -4973,6 +5015,7 @@ function SegmentedControl({
|
|
|
4973
5015
|
return /* @__PURE__ */ jsxs(
|
|
4974
5016
|
Field,
|
|
4975
5017
|
{
|
|
5018
|
+
className,
|
|
4976
5019
|
label,
|
|
4977
5020
|
htmlFor: groupId,
|
|
4978
5021
|
errorId,
|
|
@@ -5051,6 +5094,7 @@ function Slider({
|
|
|
5051
5094
|
disabled,
|
|
5052
5095
|
errorMessage,
|
|
5053
5096
|
helperText,
|
|
5097
|
+
className,
|
|
5054
5098
|
required,
|
|
5055
5099
|
name,
|
|
5056
5100
|
htmlFor
|
|
@@ -5069,7 +5113,7 @@ function Slider({
|
|
|
5069
5113
|
onChange?.(next);
|
|
5070
5114
|
};
|
|
5071
5115
|
const valueText = current.map(formatValue).join(" \u2013 ");
|
|
5072
|
-
return /* @__PURE__ */ jsxs(Field, { label: void 0, errorId, errorMessage, children: [
|
|
5116
|
+
return /* @__PURE__ */ jsxs(Field, { className, label: void 0, errorId, errorMessage, children: [
|
|
5073
5117
|
(label || showValue) && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-2", children: [
|
|
5074
5118
|
label && /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1", children: [
|
|
5075
5119
|
/* @__PURE__ */ jsxs("label", { htmlFor, className: "text-sm font-medium text-foreground select-none", children: [
|
|
@@ -5150,6 +5194,7 @@ function TagsInput({
|
|
|
5150
5194
|
disabled,
|
|
5151
5195
|
errorMessage,
|
|
5152
5196
|
helperText,
|
|
5197
|
+
className,
|
|
5153
5198
|
required,
|
|
5154
5199
|
maxTags,
|
|
5155
5200
|
dedupe = true,
|
|
@@ -5213,6 +5258,7 @@ function TagsInput({
|
|
|
5213
5258
|
return /* @__PURE__ */ jsx(
|
|
5214
5259
|
Field,
|
|
5215
5260
|
{
|
|
5261
|
+
className,
|
|
5216
5262
|
label,
|
|
5217
5263
|
htmlFor,
|
|
5218
5264
|
errorId,
|
|
@@ -5287,6 +5333,7 @@ function OtpInput({
|
|
|
5287
5333
|
required,
|
|
5288
5334
|
layout = "vertical",
|
|
5289
5335
|
helperText,
|
|
5336
|
+
className,
|
|
5290
5337
|
groupAfter
|
|
5291
5338
|
}) {
|
|
5292
5339
|
const errorId = useId();
|
|
@@ -5340,7 +5387,7 @@ function OtpInput({
|
|
|
5340
5387
|
emit(valid.join(""));
|
|
5341
5388
|
focusBox(valid.length);
|
|
5342
5389
|
};
|
|
5343
|
-
return /* @__PURE__ */ jsx(Field, { label, htmlFor, errorId, errorMessage, required, layout, helperText, children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", role: "group", "aria-label": typeof label === "string" ? label : "One-time code", children: chars.map((char, idx) => /* @__PURE__ */ jsxs(React8.Fragment, { children: [
|
|
5390
|
+
return /* @__PURE__ */ jsx(Field, { className, label, htmlFor, errorId, errorMessage, required, layout, helperText, children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", role: "group", "aria-label": typeof label === "string" ? label : "One-time code", children: chars.map((char, idx) => /* @__PURE__ */ jsxs(React8.Fragment, { children: [
|
|
5344
5391
|
/* @__PURE__ */ jsx(
|
|
5345
5392
|
"input",
|
|
5346
5393
|
{
|
|
@@ -5395,6 +5442,7 @@ function Rating({
|
|
|
5395
5442
|
name,
|
|
5396
5443
|
layout = "vertical",
|
|
5397
5444
|
helperText,
|
|
5445
|
+
className,
|
|
5398
5446
|
required
|
|
5399
5447
|
}) {
|
|
5400
5448
|
const errorId = useId();
|
|
@@ -5425,7 +5473,7 @@ function Rating({
|
|
|
5425
5473
|
commit(count);
|
|
5426
5474
|
}
|
|
5427
5475
|
};
|
|
5428
|
-
return /* @__PURE__ */ jsx(Field, { label, errorId, errorMessage, layout, required, helperText, children: /* @__PURE__ */ jsxs(
|
|
5476
|
+
return /* @__PURE__ */ jsx(Field, { className, label, errorId, errorMessage, layout, required, helperText, children: /* @__PURE__ */ jsxs(
|
|
5429
5477
|
"div",
|
|
5430
5478
|
{
|
|
5431
5479
|
role: interactive ? "slider" : "img",
|
|
@@ -5518,6 +5566,7 @@ function TimePicker({
|
|
|
5518
5566
|
disabled,
|
|
5519
5567
|
errorMessage,
|
|
5520
5568
|
helperText,
|
|
5569
|
+
className,
|
|
5521
5570
|
required,
|
|
5522
5571
|
style
|
|
5523
5572
|
}) {
|
|
@@ -5550,7 +5599,7 @@ function TimePicker({
|
|
|
5550
5599
|
},
|
|
5551
5600
|
n
|
|
5552
5601
|
)) });
|
|
5553
|
-
return /* @__PURE__ */ jsxs(Field, { label, htmlFor, errorId, errorMessage, helperText, layout, required, children: [
|
|
5602
|
+
return /* @__PURE__ */ jsxs(Field, { className, label, htmlFor, errorId, errorMessage, helperText, layout, required, children: [
|
|
5554
5603
|
/* @__PURE__ */ jsxs(Popover.Root, { open: open && !disabled, onOpenChange: (o) => !disabled && setOpen(o), children: [
|
|
5555
5604
|
/* @__PURE__ */ jsx(Popover.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
5556
5605
|
"button",
|
|
@@ -5643,6 +5692,7 @@ function DateRangePicker({
|
|
|
5643
5692
|
disabled,
|
|
5644
5693
|
errorMessage,
|
|
5645
5694
|
helperText,
|
|
5695
|
+
className,
|
|
5646
5696
|
required,
|
|
5647
5697
|
style
|
|
5648
5698
|
}) {
|
|
@@ -5715,7 +5765,7 @@ function DateRangePicker({
|
|
|
5715
5765
|
] })
|
|
5716
5766
|
] });
|
|
5717
5767
|
};
|
|
5718
|
-
return /* @__PURE__ */ jsx(Field, { label, htmlFor, errorId, errorMessage, helperText, layout, required, children: /* @__PURE__ */ jsxs(Popover.Root, { open: open && !disabled, onOpenChange: (o) => {
|
|
5768
|
+
return /* @__PURE__ */ jsx(Field, { className, label, htmlFor, errorId, errorMessage, helperText, layout, required, children: /* @__PURE__ */ jsxs(Popover.Root, { open: open && !disabled, onOpenChange: (o) => {
|
|
5719
5769
|
if (!disabled) {
|
|
5720
5770
|
setOpen(o);
|
|
5721
5771
|
if (!o) {
|
|
@@ -5824,6 +5874,7 @@ function ColorPicker({
|
|
|
5824
5874
|
disabled,
|
|
5825
5875
|
errorMessage,
|
|
5826
5876
|
helperText,
|
|
5877
|
+
className,
|
|
5827
5878
|
required,
|
|
5828
5879
|
placeholder = "Pick a colour\u2026"
|
|
5829
5880
|
}) {
|
|
@@ -5841,7 +5892,7 @@ function ColorPicker({
|
|
|
5841
5892
|
setDraft(hex);
|
|
5842
5893
|
if (HEX_RE.test(hex)) onChange?.(hex);
|
|
5843
5894
|
};
|
|
5844
|
-
return /* @__PURE__ */ jsxs(Field, { label, htmlFor, errorId, errorMessage, helperText, layout, required, children: [
|
|
5895
|
+
return /* @__PURE__ */ jsxs(Field, { className, label, htmlFor, errorId, errorMessage, helperText, layout, required, children: [
|
|
5845
5896
|
/* @__PURE__ */ jsxs(Popover.Root, { open: open && !disabled, onOpenChange: (o) => !disabled && setOpen(o), children: [
|
|
5846
5897
|
/* @__PURE__ */ jsx(Popover.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
5847
5898
|
"button",
|