@geomak/ui 6.29.0 → 6.29.1
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 +313 -433
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -44
- package/dist/index.d.ts +2 -44
- package/dist/index.js +49 -168
- package/dist/index.js.map +1 -1
- package/dist/styles.css +8 -6
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkOAV4TA4B_cjs = require('./chunk-OAV4TA4B.cjs');
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
-
var
|
|
5
|
+
var React28 = require('react');
|
|
6
6
|
var reactDom = require('react-dom');
|
|
7
7
|
var AvatarPrimitive = require('@radix-ui/react-avatar');
|
|
8
8
|
var DropdownMenu = require('@radix-ui/react-dropdown-menu');
|
|
@@ -40,7 +40,7 @@ function _interopNamespace(e) {
|
|
|
40
40
|
return Object.freeze(n);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
var
|
|
43
|
+
var React28__default = /*#__PURE__*/_interopDefault(React28);
|
|
44
44
|
var AvatarPrimitive__namespace = /*#__PURE__*/_interopNamespace(AvatarPrimitive);
|
|
45
45
|
var DropdownMenu__namespace = /*#__PURE__*/_interopNamespace(DropdownMenu);
|
|
46
46
|
var Dialog__namespace = /*#__PURE__*/_interopNamespace(Dialog);
|
|
@@ -216,8 +216,8 @@ Icon.Copy = Copy;
|
|
|
216
216
|
Icon.CircleStack = CircleStack;
|
|
217
217
|
var icons_default = Icon;
|
|
218
218
|
function Portal({ children, target }) {
|
|
219
|
-
const [resolved, setResolved] =
|
|
220
|
-
|
|
219
|
+
const [resolved, setResolved] = React28.useState(null);
|
|
220
|
+
React28.useEffect(() => {
|
|
221
221
|
if (target === null) {
|
|
222
222
|
setResolved(null);
|
|
223
223
|
return;
|
|
@@ -651,7 +651,7 @@ function IconButton({
|
|
|
651
651
|
className = "",
|
|
652
652
|
style
|
|
653
653
|
}) {
|
|
654
|
-
const colorScheme =
|
|
654
|
+
const colorScheme = React28.useMemo(() => {
|
|
655
655
|
if (type === "primary") {
|
|
656
656
|
return "bg-accent text-accent-fg hover:bg-accent-hover";
|
|
657
657
|
}
|
|
@@ -741,7 +741,7 @@ var SIZE_CLASSES = {
|
|
|
741
741
|
md: "h-9 px-4 text-sm gap-1.5 rounded-lg",
|
|
742
742
|
lg: "h-11 px-5 text-sm gap-2 rounded-xl"
|
|
743
743
|
};
|
|
744
|
-
var Button =
|
|
744
|
+
var Button = React28__default.default.forwardRef(function Button2({
|
|
745
745
|
content,
|
|
746
746
|
variant = "primary",
|
|
747
747
|
size = "md",
|
|
@@ -849,7 +849,7 @@ function MenuButton({
|
|
|
849
849
|
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
850
850
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"
|
|
851
851
|
].join(" "),
|
|
852
|
-
children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
852
|
+
children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(React28__default.default.Fragment, { children: [
|
|
853
853
|
item.separatorBefore && /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Separator, { className: "my-1 h-px bg-border" }),
|
|
854
854
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
855
855
|
DropdownMenu__namespace.Item,
|
|
@@ -1092,9 +1092,9 @@ function Tooltip({
|
|
|
1092
1092
|
] }) });
|
|
1093
1093
|
}
|
|
1094
1094
|
var TooltipProvider = TooltipPrimitive__namespace.Provider;
|
|
1095
|
-
var TabsContext =
|
|
1095
|
+
var TabsContext = React28.createContext(null);
|
|
1096
1096
|
function useTabsContext() {
|
|
1097
|
-
const ctx =
|
|
1097
|
+
const ctx = React28.useContext(TabsContext);
|
|
1098
1098
|
if (!ctx) throw new Error("Tabs.List / Tabs.Trigger / Tabs.Panel must be rendered inside <Tabs>.");
|
|
1099
1099
|
return ctx;
|
|
1100
1100
|
}
|
|
@@ -1116,26 +1116,26 @@ function Tabs({
|
|
|
1116
1116
|
children
|
|
1117
1117
|
}) {
|
|
1118
1118
|
const isControlled = value !== void 0;
|
|
1119
|
-
const [internal, setInternal] =
|
|
1119
|
+
const [internal, setInternal] = React28.useState(defaultValue);
|
|
1120
1120
|
const current = isControlled ? value : internal;
|
|
1121
1121
|
const reduced = !!framerMotion.useReducedMotion();
|
|
1122
|
-
const indicatorId =
|
|
1123
|
-
const select =
|
|
1122
|
+
const indicatorId = React28.useId();
|
|
1123
|
+
const select = React28.useCallback((next) => {
|
|
1124
1124
|
if (!isControlled) setInternal(next);
|
|
1125
1125
|
onValueChange?.(next);
|
|
1126
1126
|
}, [isControlled, onValueChange]);
|
|
1127
|
-
const registry =
|
|
1128
|
-
const orderRef =
|
|
1129
|
-
const [, bump] =
|
|
1130
|
-
const registerTab =
|
|
1127
|
+
const registry = React28.useRef(/* @__PURE__ */ new Map());
|
|
1128
|
+
const orderRef = React28.useRef(0);
|
|
1129
|
+
const [, bump] = React28.useState(0);
|
|
1130
|
+
const registerTab = React28.useCallback((val, meta) => {
|
|
1131
1131
|
const existing = registry.current.get(val);
|
|
1132
1132
|
registry.current.set(val, { ...meta, order: existing?.order ?? orderRef.current++ });
|
|
1133
1133
|
if (!existing) bump((v) => v + 1);
|
|
1134
1134
|
}, []);
|
|
1135
|
-
const unregisterTab =
|
|
1135
|
+
const unregisterTab = React28.useCallback((val) => {
|
|
1136
1136
|
if (registry.current.delete(val)) bump((v) => v + 1);
|
|
1137
1137
|
}, []);
|
|
1138
|
-
const getTabs =
|
|
1138
|
+
const getTabs = React28.useCallback(() => [...registry.current.entries()].sort((a, b) => a[1].order - b[1].order).map(([val, m]) => ({ value: val, label: m.label, icon: m.icon, disabled: m.disabled })), []);
|
|
1139
1139
|
return /* @__PURE__ */ jsxRuntime.jsx(TabsContext.Provider, { value: { value: current, variant, size, orientation, indicatorId, reduced, select, registerTab, unregisterTab, getTabs }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1140
1140
|
TabsPrimitive__namespace.Root,
|
|
1141
1141
|
{
|
|
@@ -1155,10 +1155,10 @@ function Tabs({
|
|
|
1155
1155
|
function TabsList({ children, "aria-label": ariaLabel, className = "" }) {
|
|
1156
1156
|
const { variant, orientation, reduced, value } = useTabsContext();
|
|
1157
1157
|
const horizontal = orientation === "horizontal";
|
|
1158
|
-
const scrollRef =
|
|
1159
|
-
const [edges, setEdges] =
|
|
1158
|
+
const scrollRef = React28.useRef(null);
|
|
1159
|
+
const [edges, setEdges] = React28.useState({ start: false, end: false });
|
|
1160
1160
|
const scrollable = variant !== "segmented";
|
|
1161
|
-
|
|
1161
|
+
React28.useLayoutEffect(() => {
|
|
1162
1162
|
const el = scrollRef.current;
|
|
1163
1163
|
if (!el || !scrollable) return;
|
|
1164
1164
|
const update = () => {
|
|
@@ -1183,13 +1183,13 @@ function TabsList({ children, "aria-label": ariaLabel, className = "" }) {
|
|
|
1183
1183
|
ro.disconnect();
|
|
1184
1184
|
};
|
|
1185
1185
|
}, [horizontal, scrollable, children]);
|
|
1186
|
-
const nudge =
|
|
1186
|
+
const nudge = React28.useCallback((dir) => {
|
|
1187
1187
|
const el = scrollRef.current;
|
|
1188
1188
|
if (!el) return;
|
|
1189
1189
|
const amount = (horizontal ? el.clientWidth : el.clientHeight) * 0.7 * dir;
|
|
1190
1190
|
el.scrollBy({ [horizontal ? "left" : "top"]: amount, behavior: reduced ? "auto" : "smooth" });
|
|
1191
1191
|
}, [horizontal, reduced]);
|
|
1192
|
-
|
|
1192
|
+
React28.useLayoutEffect(() => {
|
|
1193
1193
|
const el = scrollRef.current;
|
|
1194
1194
|
if (!el || !scrollable) return;
|
|
1195
1195
|
const active = el.querySelector("[role=tab][data-state=active]");
|
|
@@ -1247,9 +1247,9 @@ function Chevron2({ side, orientation, onClick }) {
|
|
|
1247
1247
|
function OverflowMenu() {
|
|
1248
1248
|
const { getTabs, value, select, orientation } = useTabsContext();
|
|
1249
1249
|
const horizontal = orientation === "horizontal";
|
|
1250
|
-
const [open, setOpen] =
|
|
1251
|
-
const wrapRef =
|
|
1252
|
-
const timer =
|
|
1250
|
+
const [open, setOpen] = React28.useState(false);
|
|
1251
|
+
const wrapRef = React28.useRef(null);
|
|
1252
|
+
const timer = React28.useRef(null);
|
|
1253
1253
|
const openNow = () => {
|
|
1254
1254
|
if (timer.current) clearTimeout(timer.current);
|
|
1255
1255
|
setOpen(true);
|
|
@@ -1257,7 +1257,7 @@ function OverflowMenu() {
|
|
|
1257
1257
|
const closeSoon = () => {
|
|
1258
1258
|
timer.current = setTimeout(() => setOpen(false), 160);
|
|
1259
1259
|
};
|
|
1260
|
-
|
|
1260
|
+
React28.useLayoutEffect(() => {
|
|
1261
1261
|
if (!open) return;
|
|
1262
1262
|
const onDoc = (e) => {
|
|
1263
1263
|
if (wrapRef.current && !wrapRef.current.contains(e.target)) setOpen(false);
|
|
@@ -1338,7 +1338,7 @@ function TabsTrigger({ value, icon, badge, closeable, onClose, disabled, classNa
|
|
|
1338
1338
|
const isActive = active === value;
|
|
1339
1339
|
const horizontal = orientation === "horizontal";
|
|
1340
1340
|
const sz = SIZE[size];
|
|
1341
|
-
|
|
1341
|
+
React28.useLayoutEffect(() => {
|
|
1342
1342
|
registerTab(value, { label: children, icon, disabled });
|
|
1343
1343
|
return () => unregisterTab(value);
|
|
1344
1344
|
}, [value, children, icon, disabled, registerTab, unregisterTab]);
|
|
@@ -1536,7 +1536,7 @@ function Tree({
|
|
|
1536
1536
|
item.key
|
|
1537
1537
|
)) });
|
|
1538
1538
|
}
|
|
1539
|
-
var AccordionCtx =
|
|
1539
|
+
var AccordionCtx = React28.createContext({ variant: "separated" });
|
|
1540
1540
|
function Accordion2({
|
|
1541
1541
|
children,
|
|
1542
1542
|
type = "single",
|
|
@@ -1595,7 +1595,7 @@ var Chevron3 = /* @__PURE__ */ jsxRuntime.jsx(
|
|
|
1595
1595
|
}
|
|
1596
1596
|
);
|
|
1597
1597
|
function AccordionItem({ value, title, icon, children, disabled, className = "" }) {
|
|
1598
|
-
const { variant } =
|
|
1598
|
+
const { variant } = React28.useContext(AccordionCtx);
|
|
1599
1599
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1600
1600
|
AccordionPrimitive__namespace.Item,
|
|
1601
1601
|
{
|
|
@@ -1654,7 +1654,7 @@ function Breadcrumbs({
|
|
|
1654
1654
|
className = "",
|
|
1655
1655
|
style
|
|
1656
1656
|
}) {
|
|
1657
|
-
const [expanded, setExpanded] =
|
|
1657
|
+
const [expanded, setExpanded] = React28.useState(false);
|
|
1658
1658
|
const shouldCollapse = maxItems > 0 && items.length > maxItems && !expanded;
|
|
1659
1659
|
const visible = [];
|
|
1660
1660
|
if (shouldCollapse) {
|
|
@@ -1838,8 +1838,8 @@ function Stepper({
|
|
|
1838
1838
|
className = ""
|
|
1839
1839
|
}) {
|
|
1840
1840
|
const reduced = framerMotion.useReducedMotion();
|
|
1841
|
-
const [forcedVertical, setForcedVertical] =
|
|
1842
|
-
|
|
1841
|
+
const [forcedVertical, setForcedVertical] = React28.useState(false);
|
|
1842
|
+
React28.useEffect(() => {
|
|
1843
1843
|
if (!responsive || orientation === "vertical") return;
|
|
1844
1844
|
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
|
|
1845
1845
|
const mq = window.matchMedia("(max-width: 767px)");
|
|
@@ -1948,7 +1948,7 @@ function Kbd({
|
|
|
1948
1948
|
style
|
|
1949
1949
|
}) {
|
|
1950
1950
|
if (keys && keys.length > 0) {
|
|
1951
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: ["inline-flex items-center gap-1", className].filter(Boolean).join(" "), style, children: keys.map((k, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1951
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: ["inline-flex items-center gap-1", className].filter(Boolean).join(" "), style, children: keys.map((k, i) => /* @__PURE__ */ jsxRuntime.jsxs(React28__default.default.Fragment, { children: [
|
|
1952
1952
|
i > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground-muted text-xs select-none", children: separator }),
|
|
1953
1953
|
/* @__PURE__ */ jsxRuntime.jsx("kbd", { className: [cap, SIZE3[size]].join(" "), children: k })
|
|
1954
1954
|
] }, `${k}-${i}`)) });
|
|
@@ -2039,13 +2039,13 @@ function FlatCarousel({
|
|
|
2039
2039
|
className = "",
|
|
2040
2040
|
style
|
|
2041
2041
|
}) {
|
|
2042
|
-
const scrollerRef =
|
|
2043
|
-
const slides =
|
|
2044
|
-
const [active, setActive] =
|
|
2045
|
-
const [atStart, setAtStart] =
|
|
2046
|
-
const [atEnd, setAtEnd] =
|
|
2042
|
+
const scrollerRef = React28.useRef(null);
|
|
2043
|
+
const slides = React28__default.default.Children.toArray(children);
|
|
2044
|
+
const [active, setActive] = React28.useState(0);
|
|
2045
|
+
const [atStart, setAtStart] = React28.useState(true);
|
|
2046
|
+
const [atEnd, setAtEnd] = React28.useState(false);
|
|
2047
2047
|
const width = typeof itemWidth === "number" ? `${itemWidth}px` : itemWidth;
|
|
2048
|
-
const update =
|
|
2048
|
+
const update = React28.useCallback(() => {
|
|
2049
2049
|
const el = scrollerRef.current;
|
|
2050
2050
|
if (!el) return;
|
|
2051
2051
|
setAtStart(el.scrollLeft <= 1);
|
|
@@ -2054,7 +2054,7 @@ function FlatCarousel({
|
|
|
2054
2054
|
const slideW = first ? first.getBoundingClientRect().width + gap : el.clientWidth;
|
|
2055
2055
|
setActive(Math.round(el.scrollLeft / slideW));
|
|
2056
2056
|
}, [gap]);
|
|
2057
|
-
|
|
2057
|
+
React28.useEffect(() => {
|
|
2058
2058
|
update();
|
|
2059
2059
|
const el = scrollerRef.current;
|
|
2060
2060
|
if (!el) return;
|
|
@@ -2095,9 +2095,9 @@ function RotatingCarousel({
|
|
|
2095
2095
|
className = "",
|
|
2096
2096
|
style
|
|
2097
2097
|
}) {
|
|
2098
|
-
const slides =
|
|
2098
|
+
const slides = React28__default.default.Children.toArray(children);
|
|
2099
2099
|
const count = slides.length;
|
|
2100
|
-
const [active, setActive] =
|
|
2100
|
+
const [active, setActive] = React28.useState(0);
|
|
2101
2101
|
const reduced = framerMotion.useReducedMotion();
|
|
2102
2102
|
const wrap = (n) => count > 0 ? (n % count + count) % count : 0;
|
|
2103
2103
|
const idx = wrap(active);
|
|
@@ -2321,14 +2321,14 @@ function Chat({
|
|
|
2321
2321
|
className = "",
|
|
2322
2322
|
style
|
|
2323
2323
|
}) {
|
|
2324
|
-
const listRef =
|
|
2325
|
-
const atBottomRef =
|
|
2326
|
-
const [showJump, setShowJump] =
|
|
2327
|
-
const [draft, setDraft] =
|
|
2328
|
-
const taRef =
|
|
2324
|
+
const listRef = React28.useRef(null);
|
|
2325
|
+
const atBottomRef = React28.useRef(true);
|
|
2326
|
+
const [showJump, setShowJump] = React28.useState(false);
|
|
2327
|
+
const [draft, setDraft] = React28.useState("");
|
|
2328
|
+
const taRef = React28.useRef(null);
|
|
2329
2329
|
const hasHeader = title != null || subtitle != null || avatar != null || headerActions != null;
|
|
2330
2330
|
const isTyping = typingNames.length > 0;
|
|
2331
|
-
const scrollToBottom =
|
|
2331
|
+
const scrollToBottom = React28.useCallback((smooth = true) => {
|
|
2332
2332
|
const el = listRef.current;
|
|
2333
2333
|
if (!el) return;
|
|
2334
2334
|
if (typeof el.scrollTo === "function") el.scrollTo({ top: el.scrollHeight, behavior: smooth ? "smooth" : "auto" });
|
|
@@ -2341,13 +2341,13 @@ function Chat({
|
|
|
2341
2341
|
atBottomRef.current = near;
|
|
2342
2342
|
setShowJump(!near);
|
|
2343
2343
|
};
|
|
2344
|
-
|
|
2344
|
+
React28.useEffect(() => {
|
|
2345
2345
|
if (atBottomRef.current) scrollToBottom(messages.length > 0);
|
|
2346
2346
|
}, [messages.length, isTyping]);
|
|
2347
|
-
|
|
2347
|
+
React28.useEffect(() => {
|
|
2348
2348
|
scrollToBottom(false);
|
|
2349
2349
|
}, [scrollToBottom]);
|
|
2350
|
-
|
|
2350
|
+
React28.useLayoutEffect(() => {
|
|
2351
2351
|
const ta = taRef.current;
|
|
2352
2352
|
if (!ta) return;
|
|
2353
2353
|
ta.style.height = "auto";
|
|
@@ -2541,7 +2541,7 @@ function FAB({
|
|
|
2541
2541
|
className = "",
|
|
2542
2542
|
style
|
|
2543
2543
|
}) {
|
|
2544
|
-
const [open, setOpen] =
|
|
2544
|
+
const [open, setOpen] = React28.useState(false);
|
|
2545
2545
|
const reduced = framerMotion.useReducedMotion();
|
|
2546
2546
|
const hasDial = !!actions && actions.length > 0;
|
|
2547
2547
|
const bottom = position.startsWith("bottom");
|
|
@@ -2643,8 +2643,8 @@ function PopConfirm({
|
|
|
2643
2643
|
onOpenChange,
|
|
2644
2644
|
className = ""
|
|
2645
2645
|
}) {
|
|
2646
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
2647
|
-
const [loading, setLoading] =
|
|
2646
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React28.useState(false);
|
|
2647
|
+
const [loading, setLoading] = React28.useState(false);
|
|
2648
2648
|
const isOpen = open ?? uncontrolledOpen;
|
|
2649
2649
|
const setOpen = (next) => {
|
|
2650
2650
|
onOpenChange?.(next);
|
|
@@ -2731,16 +2731,16 @@ function LogoutTimer({
|
|
|
2731
2731
|
logoutLabel = "Sign out now"
|
|
2732
2732
|
}) {
|
|
2733
2733
|
const reduced = framerMotion.useReducedMotion();
|
|
2734
|
-
const [warning, setWarning] =
|
|
2735
|
-
const [remaining, setRemaining] =
|
|
2736
|
-
const idleTimer =
|
|
2737
|
-
const tick =
|
|
2738
|
-
const deadline =
|
|
2739
|
-
const warningRef =
|
|
2740
|
-
const lastReset =
|
|
2741
|
-
const cbs =
|
|
2734
|
+
const [warning, setWarning] = React28.useState(false);
|
|
2735
|
+
const [remaining, setRemaining] = React28.useState(countdown);
|
|
2736
|
+
const idleTimer = React28.useRef(null);
|
|
2737
|
+
const tick = React28.useRef(null);
|
|
2738
|
+
const deadline = React28.useRef(0);
|
|
2739
|
+
const warningRef = React28.useRef(false);
|
|
2740
|
+
const lastReset = React28.useRef(0);
|
|
2741
|
+
const cbs = React28.useRef({ onLogout, onContinue, onWarning });
|
|
2742
2742
|
cbs.current = { onLogout, onContinue, onWarning };
|
|
2743
|
-
const clearTimers =
|
|
2743
|
+
const clearTimers = React28.useCallback(() => {
|
|
2744
2744
|
if (idleTimer.current) {
|
|
2745
2745
|
clearTimeout(idleTimer.current);
|
|
2746
2746
|
idleTimer.current = null;
|
|
@@ -2750,13 +2750,13 @@ function LogoutTimer({
|
|
|
2750
2750
|
tick.current = null;
|
|
2751
2751
|
}
|
|
2752
2752
|
}, []);
|
|
2753
|
-
const logout =
|
|
2753
|
+
const logout = React28.useCallback(() => {
|
|
2754
2754
|
clearTimers();
|
|
2755
2755
|
warningRef.current = false;
|
|
2756
2756
|
setWarning(false);
|
|
2757
2757
|
cbs.current.onLogout();
|
|
2758
2758
|
}, [clearTimers]);
|
|
2759
|
-
const startIdle =
|
|
2759
|
+
const startIdle = React28.useCallback(() => {
|
|
2760
2760
|
if (idleTimer.current) clearTimeout(idleTimer.current);
|
|
2761
2761
|
idleTimer.current = setTimeout(() => {
|
|
2762
2762
|
warningRef.current = true;
|
|
@@ -2771,7 +2771,7 @@ function LogoutTimer({
|
|
|
2771
2771
|
}, 250);
|
|
2772
2772
|
}, timeout);
|
|
2773
2773
|
}, [timeout, countdown, logout]);
|
|
2774
|
-
const stay =
|
|
2774
|
+
const stay = React28.useCallback(() => {
|
|
2775
2775
|
if (tick.current) {
|
|
2776
2776
|
clearInterval(tick.current);
|
|
2777
2777
|
tick.current = null;
|
|
@@ -2781,7 +2781,7 @@ function LogoutTimer({
|
|
|
2781
2781
|
cbs.current.onContinue?.();
|
|
2782
2782
|
startIdle();
|
|
2783
2783
|
}, [startIdle]);
|
|
2784
|
-
|
|
2784
|
+
React28.useEffect(() => {
|
|
2785
2785
|
if (!enabled) {
|
|
2786
2786
|
clearTimers();
|
|
2787
2787
|
warningRef.current = false;
|
|
@@ -2823,125 +2823,6 @@ function LogoutTimer({
|
|
|
2823
2823
|
] })
|
|
2824
2824
|
] }) });
|
|
2825
2825
|
}
|
|
2826
|
-
var WEEKDAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
2827
|
-
var MONTHS = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
2828
|
-
var startOfDay = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
|
2829
|
-
var sameDay = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
2830
|
-
var addMonths = (d, n) => new Date(d.getFullYear(), d.getMonth() + n, 1);
|
|
2831
|
-
function buildGrid(month, weekStartsOn) {
|
|
2832
|
-
const first = new Date(month.getFullYear(), month.getMonth(), 1);
|
|
2833
|
-
const offset = (first.getDay() - weekStartsOn + 7) % 7;
|
|
2834
|
-
const start = new Date(first);
|
|
2835
|
-
start.setDate(first.getDate() - offset);
|
|
2836
|
-
return Array.from({ length: 42 }, (_, i) => {
|
|
2837
|
-
const d = new Date(start);
|
|
2838
|
-
d.setDate(start.getDate() + i);
|
|
2839
|
-
return d;
|
|
2840
|
-
});
|
|
2841
|
-
}
|
|
2842
|
-
var NavIcon = ({ dir }) => /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, "aria-hidden": "true", className: "h-4 w-4", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: dir === "left" ? "M15 19l-7-7 7-7" : "M9 5l7 7-7 7" }) });
|
|
2843
|
-
function Calendar2({
|
|
2844
|
-
value,
|
|
2845
|
-
onChange,
|
|
2846
|
-
month,
|
|
2847
|
-
defaultMonth,
|
|
2848
|
-
onMonthChange,
|
|
2849
|
-
events,
|
|
2850
|
-
min,
|
|
2851
|
-
max,
|
|
2852
|
-
weekStartsOn = 0,
|
|
2853
|
-
className = "",
|
|
2854
|
-
style
|
|
2855
|
-
}) {
|
|
2856
|
-
const today = React29.useMemo(() => startOfDay(/* @__PURE__ */ new Date()), []);
|
|
2857
|
-
const [internalMonth, setInternalMonth] = React29.useState(() => month ?? defaultMonth ?? value ?? today);
|
|
2858
|
-
const visible = month ?? internalMonth;
|
|
2859
|
-
const setMonth = (next) => {
|
|
2860
|
-
onMonthChange?.(next);
|
|
2861
|
-
if (month === void 0) setInternalMonth(next);
|
|
2862
|
-
};
|
|
2863
|
-
const grid = React29.useMemo(() => buildGrid(visible, weekStartsOn), [visible, weekStartsOn]);
|
|
2864
|
-
const weekdays = React29.useMemo(() => Array.from({ length: 7 }, (_, i) => WEEKDAYS[(i + weekStartsOn) % 7]), [weekStartsOn]);
|
|
2865
|
-
const eventsByDay = React29.useMemo(() => {
|
|
2866
|
-
const map = /* @__PURE__ */ new Map();
|
|
2867
|
-
for (const ev of events ?? []) {
|
|
2868
|
-
const key = startOfDay(ev.date).toDateString();
|
|
2869
|
-
const arr = map.get(key) ?? [];
|
|
2870
|
-
arr.push(ev);
|
|
2871
|
-
map.set(key, arr);
|
|
2872
|
-
}
|
|
2873
|
-
return map;
|
|
2874
|
-
}, [events]);
|
|
2875
|
-
const disabled = (d) => min && d < startOfDay(min) || max && d > startOfDay(max);
|
|
2876
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ["inline-block rounded-lg border border-border bg-surface p-3 select-none", className].filter(Boolean).join(" "), style, children: [
|
|
2877
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-2 flex items-center justify-between px-1", children: [
|
|
2878
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2879
|
-
"button",
|
|
2880
|
-
{
|
|
2881
|
-
type: "button",
|
|
2882
|
-
"aria-label": "Previous month",
|
|
2883
|
-
onClick: () => setMonth(addMonths(visible, -1)),
|
|
2884
|
-
className: "flex h-7 w-7 items-center justify-center rounded-md text-foreground-secondary hover:bg-surface-raised hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-accent",
|
|
2885
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(NavIcon, { dir: "left" })
|
|
2886
|
-
}
|
|
2887
|
-
),
|
|
2888
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-sm font-semibold text-foreground", "aria-live": "polite", children: [
|
|
2889
|
-
MONTHS[visible.getMonth()],
|
|
2890
|
-
" ",
|
|
2891
|
-
visible.getFullYear()
|
|
2892
|
-
] }),
|
|
2893
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2894
|
-
"button",
|
|
2895
|
-
{
|
|
2896
|
-
type: "button",
|
|
2897
|
-
"aria-label": "Next month",
|
|
2898
|
-
onClick: () => setMonth(addMonths(visible, 1)),
|
|
2899
|
-
className: "flex h-7 w-7 items-center justify-center rounded-md text-foreground-secondary hover:bg-surface-raised hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-accent",
|
|
2900
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(NavIcon, { dir: "right" })
|
|
2901
|
-
}
|
|
2902
|
-
)
|
|
2903
|
-
] }),
|
|
2904
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-7 mb-1", children: weekdays.map((w) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center text-[11px] font-medium uppercase tracking-wide text-foreground-muted py-1", children: w }, w)) }),
|
|
2905
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-7 gap-0.5", role: "grid", children: grid.map((d, i) => {
|
|
2906
|
-
const inMonth = d.getMonth() === visible.getMonth();
|
|
2907
|
-
const isSelected = value != null && sameDay(d, value);
|
|
2908
|
-
const isToday2 = sameDay(d, today);
|
|
2909
|
-
const isDisabled = disabled(d);
|
|
2910
|
-
const dayEvents = eventsByDay.get(d.toDateString()) ?? [];
|
|
2911
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2912
|
-
"button",
|
|
2913
|
-
{
|
|
2914
|
-
type: "button",
|
|
2915
|
-
role: "gridcell",
|
|
2916
|
-
"aria-selected": isSelected,
|
|
2917
|
-
"aria-current": isToday2 ? "date" : void 0,
|
|
2918
|
-
disabled: isDisabled,
|
|
2919
|
-
onClick: () => onChange?.(startOfDay(d)),
|
|
2920
|
-
className: [
|
|
2921
|
-
"relative flex h-9 w-9 flex-col items-center justify-center rounded-md text-sm transition-colors",
|
|
2922
|
-
"focus:outline-none focus-visible:ring-2 focus-visible:ring-accent",
|
|
2923
|
-
isSelected ? "bg-accent text-accent-fg font-semibold" : inMonth ? "text-foreground hover:bg-surface-raised" : "text-foreground-muted hover:bg-surface-raised",
|
|
2924
|
-
isDisabled ? "opacity-40 cursor-not-allowed hover:bg-transparent" : "",
|
|
2925
|
-
!isSelected && isToday2 ? "ring-1 ring-inset ring-accent/60" : ""
|
|
2926
|
-
].filter(Boolean).join(" "),
|
|
2927
|
-
children: [
|
|
2928
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "leading-none", children: d.getDate() }),
|
|
2929
|
-
dayEvents.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute bottom-1 flex gap-0.5", children: dayEvents.slice(0, 3).map((ev, j) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2930
|
-
"span",
|
|
2931
|
-
{
|
|
2932
|
-
title: ev.label,
|
|
2933
|
-
className: "h-1 w-1 rounded-full",
|
|
2934
|
-
style: { backgroundColor: ev.color ?? (isSelected ? "var(--color-accent-fg)" : "var(--color-accent)") }
|
|
2935
|
-
},
|
|
2936
|
-
j
|
|
2937
|
-
)) })
|
|
2938
|
-
]
|
|
2939
|
-
},
|
|
2940
|
-
i
|
|
2941
|
-
);
|
|
2942
|
-
}) })
|
|
2943
|
-
] });
|
|
2944
|
-
}
|
|
2945
2826
|
var SIZE5 = {
|
|
2946
2827
|
sm: { h: "h-control-sm", text: "text-xs", pad: "px-2.5" },
|
|
2947
2828
|
md: { h: "h-control-md", text: "text-sm", pad: "px-3.5" },
|
|
@@ -2965,11 +2846,11 @@ function SegmentedControl({
|
|
|
2965
2846
|
"aria-label": ariaLabel
|
|
2966
2847
|
}) {
|
|
2967
2848
|
const sz = SIZE5[size];
|
|
2968
|
-
const groupId =
|
|
2969
|
-
const errorId =
|
|
2849
|
+
const groupId = React28.useId();
|
|
2850
|
+
const errorId = React28.useId();
|
|
2970
2851
|
const hasError = errorMessage != null;
|
|
2971
2852
|
const isControlled = value !== void 0;
|
|
2972
|
-
const [internal, setInternal] =
|
|
2853
|
+
const [internal, setInternal] = React28.useState(defaultValue);
|
|
2973
2854
|
const current = isControlled ? value : internal;
|
|
2974
2855
|
const handle = (v) => {
|
|
2975
2856
|
if (!v) return;
|
|
@@ -3040,7 +2921,7 @@ function SegmentedControl({
|
|
|
3040
2921
|
}
|
|
3041
2922
|
|
|
3042
2923
|
// src/components/core/scheduler.utils.ts
|
|
3043
|
-
var
|
|
2924
|
+
var MONTHS = [
|
|
3044
2925
|
"January",
|
|
3045
2926
|
"February",
|
|
3046
2927
|
"March",
|
|
@@ -3054,23 +2935,23 @@ var MONTHS2 = [
|
|
|
3054
2935
|
"November",
|
|
3055
2936
|
"December"
|
|
3056
2937
|
];
|
|
3057
|
-
var MONTHS_SHORT =
|
|
3058
|
-
var
|
|
2938
|
+
var MONTHS_SHORT = MONTHS.map((m) => m.slice(0, 3));
|
|
2939
|
+
var WEEKDAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
3059
2940
|
var toDate2 = (d) => d instanceof Date ? d : new Date(d);
|
|
3060
|
-
var
|
|
2941
|
+
var startOfDay = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
|
3061
2942
|
var addDays = (d, n) => {
|
|
3062
2943
|
const x = new Date(d);
|
|
3063
2944
|
x.setDate(x.getDate() + n);
|
|
3064
2945
|
return x;
|
|
3065
2946
|
};
|
|
3066
|
-
var
|
|
3067
|
-
var
|
|
3068
|
-
var isToday = (d) =>
|
|
2947
|
+
var addMonths = (d, n) => new Date(d.getFullYear(), d.getMonth() + n, 1);
|
|
2948
|
+
var sameDay = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
2949
|
+
var isToday = (d) => sameDay(d, /* @__PURE__ */ new Date());
|
|
3069
2950
|
var isSameMonth = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth();
|
|
3070
2951
|
var startOfMonth = (d) => new Date(d.getFullYear(), d.getMonth(), 1);
|
|
3071
2952
|
var endOfMonth = (d) => new Date(d.getFullYear(), d.getMonth() + 1, 0);
|
|
3072
2953
|
var startOfWeek = (d, weekStartsOn) => {
|
|
3073
|
-
const x =
|
|
2954
|
+
const x = startOfDay(d);
|
|
3074
2955
|
const diff = (x.getDay() - weekStartsOn + 7) % 7;
|
|
3075
2956
|
return addDays(x, -diff);
|
|
3076
2957
|
};
|
|
@@ -3090,12 +2971,12 @@ var weekRange = (cursor, weekStartsOn) => {
|
|
|
3090
2971
|
const from = startOfWeek(cursor, weekStartsOn);
|
|
3091
2972
|
return { from, to: addDays(from, 6) };
|
|
3092
2973
|
};
|
|
3093
|
-
var weekdayLabels = (weekStartsOn) => Array.from({ length: 7 }, (_, i) =>
|
|
3094
|
-
var monthYearLabel = (d) => `${
|
|
2974
|
+
var weekdayLabels = (weekStartsOn) => Array.from({ length: 7 }, (_, i) => WEEKDAYS[(i + weekStartsOn) % 7]);
|
|
2975
|
+
var monthYearLabel = (d) => `${MONTHS[d.getMonth()]} ${d.getFullYear()}`;
|
|
3095
2976
|
var weekLabel = (cursor, weekStartsOn) => {
|
|
3096
2977
|
const from = startOfWeek(cursor, weekStartsOn);
|
|
3097
2978
|
const to = addDays(from, 6);
|
|
3098
|
-
const m = (d) =>
|
|
2979
|
+
const m = (d) => MONTHS[d.getMonth()].slice(0, 3);
|
|
3099
2980
|
if (from.getMonth() === to.getMonth()) {
|
|
3100
2981
|
return `${m(from)} ${from.getDate()} \u2013 ${to.getDate()}, ${to.getFullYear()}`;
|
|
3101
2982
|
}
|
|
@@ -3129,22 +3010,22 @@ function Scheduler({
|
|
|
3129
3010
|
style
|
|
3130
3011
|
}) {
|
|
3131
3012
|
const reduced = framerMotion.useReducedMotion();
|
|
3132
|
-
const [view, setView] =
|
|
3133
|
-
const [cursor, setCursor] =
|
|
3134
|
-
const [loaded, setLoaded] =
|
|
3135
|
-
const [loading, setLoading] =
|
|
3136
|
-
const [error, setError] =
|
|
3137
|
-
const [reloadKey, setReloadKey] =
|
|
3138
|
-
const [dir, setDir] =
|
|
3139
|
-
const cbRef =
|
|
3013
|
+
const [view, setView] = React28.useState(defaultView);
|
|
3014
|
+
const [cursor, setCursor] = React28.useState(() => defaultDate ?? /* @__PURE__ */ new Date());
|
|
3015
|
+
const [loaded, setLoaded] = React28.useState([]);
|
|
3016
|
+
const [loading, setLoading] = React28.useState(false);
|
|
3017
|
+
const [error, setError] = React28.useState(null);
|
|
3018
|
+
const [reloadKey, setReloadKey] = React28.useState(0);
|
|
3019
|
+
const [dir, setDir] = React28.useState(0);
|
|
3020
|
+
const cbRef = React28.useRef({ loadEvents, onError });
|
|
3140
3021
|
cbRef.current = { loadEvents, onError };
|
|
3141
|
-
const range =
|
|
3022
|
+
const range = React28.useMemo(
|
|
3142
3023
|
() => view === "month" ? monthRange(cursor) : weekRange(cursor, weekStartsOn),
|
|
3143
3024
|
[view, cursor, weekStartsOn]
|
|
3144
3025
|
);
|
|
3145
3026
|
const fromKey = range.from.getTime();
|
|
3146
3027
|
const toKey = range.to.getTime();
|
|
3147
|
-
|
|
3028
|
+
React28.useEffect(() => {
|
|
3148
3029
|
const { loadEvents: loader, onError: onErr } = cbRef.current;
|
|
3149
3030
|
if (!loader) return;
|
|
3150
3031
|
let cancelled = false;
|
|
@@ -3164,16 +3045,16 @@ function Scheduler({
|
|
|
3164
3045
|
cancelled = true;
|
|
3165
3046
|
};
|
|
3166
3047
|
}, [fromKey, toKey, view, reloadKey]);
|
|
3167
|
-
const retry =
|
|
3168
|
-
const events =
|
|
3048
|
+
const retry = React28.useCallback(() => setReloadKey((k) => k + 1), []);
|
|
3049
|
+
const events = React28.useMemo(
|
|
3169
3050
|
() => (controlledEvents ?? loaded).map(normalize),
|
|
3170
3051
|
[controlledEvents, loaded]
|
|
3171
3052
|
);
|
|
3172
|
-
const go =
|
|
3053
|
+
const go = React28.useCallback((delta) => {
|
|
3173
3054
|
setDir(delta);
|
|
3174
|
-
setCursor((c) => view === "month" ?
|
|
3055
|
+
setCursor((c) => view === "month" ? addMonths(c, delta) : addDays(c, delta * 7));
|
|
3175
3056
|
}, [view]);
|
|
3176
|
-
const goToday =
|
|
3057
|
+
const goToday = React28.useCallback(() => {
|
|
3177
3058
|
setDir(0);
|
|
3178
3059
|
setCursor(/* @__PURE__ */ new Date());
|
|
3179
3060
|
}, []);
|
|
@@ -3283,9 +3164,9 @@ function SchedulerError({ onRetry }) {
|
|
|
3283
3164
|
] });
|
|
3284
3165
|
}
|
|
3285
3166
|
function MonthYearPicker({ label, cursor, onPick }) {
|
|
3286
|
-
const [open, setOpen] =
|
|
3287
|
-
const [viewYear, setViewYear] =
|
|
3288
|
-
|
|
3167
|
+
const [open, setOpen] = React28.useState(false);
|
|
3168
|
+
const [viewYear, setViewYear] = React28.useState(cursor.getFullYear());
|
|
3169
|
+
React28.useEffect(() => {
|
|
3289
3170
|
if (open) setViewYear(cursor.getFullYear());
|
|
3290
3171
|
}, [open, cursor]);
|
|
3291
3172
|
return /* @__PURE__ */ jsxRuntime.jsxs(Popover__namespace.Root, { open, onOpenChange: setOpen, children: [
|
|
@@ -3348,13 +3229,13 @@ function MonthView({
|
|
|
3348
3229
|
onSelectSlot,
|
|
3349
3230
|
onSelectEvent
|
|
3350
3231
|
}) {
|
|
3351
|
-
const grid =
|
|
3232
|
+
const grid = React28.useMemo(() => buildMonthGrid(cursor, weekStartsOn), [cursor, weekStartsOn]);
|
|
3352
3233
|
const labels = weekdayLabels(weekStartsOn);
|
|
3353
3234
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-full flex-col", children: [
|
|
3354
3235
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-7 border-b border-border", children: labels.map((l) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-2 py-1.5 text-center text-[11px] font-medium uppercase tracking-wide text-foreground-muted", children: l }, l)) }),
|
|
3355
3236
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid flex-1 grid-cols-7 grid-rows-6", children: grid.map((day, i) => {
|
|
3356
3237
|
const inMonth = isSameMonth(day, cursor);
|
|
3357
|
-
const dayEvents = events.filter((e) =>
|
|
3238
|
+
const dayEvents = events.filter((e) => sameDay(e.start, day));
|
|
3358
3239
|
const today = isToday(day);
|
|
3359
3240
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3360
3241
|
"button",
|
|
@@ -3422,11 +3303,11 @@ function WeekView({
|
|
|
3422
3303
|
onSelectSlot,
|
|
3423
3304
|
onSelectEvent
|
|
3424
3305
|
}) {
|
|
3425
|
-
const days =
|
|
3426
|
-
const labels =
|
|
3306
|
+
const days = React28.useMemo(() => getWeekDays(cursor, weekStartsOn), [cursor, weekStartsOn]);
|
|
3307
|
+
const labels = React28.useMemo(() => weekdayLabels(weekStartsOn), [weekStartsOn]);
|
|
3427
3308
|
const dow = (d) => labels[(d.getDay() - weekStartsOn + 7) % 7];
|
|
3428
3309
|
const [startHour, endHour] = dayHours;
|
|
3429
|
-
const hours =
|
|
3310
|
+
const hours = React28.useMemo(
|
|
3430
3311
|
() => Array.from({ length: endHour - startHour }, (_, i) => startHour + i),
|
|
3431
3312
|
[startHour, endHour]
|
|
3432
3313
|
);
|
|
@@ -3443,7 +3324,7 @@ function WeekView({
|
|
|
3443
3324
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid", style: { gridTemplateColumns: `3.5rem repeat(7, 1fr)`, height: gridHeight }, children: [
|
|
3444
3325
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative border-r border-border", children: hours.map((h, i) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute right-1 -translate-y-1/2 text-[10px] tabular-nums text-foreground-muted", style: { top: i * hourHeight }, children: i === 0 ? "" : hourLabel(h) }, h)) }),
|
|
3445
3326
|
days.map((day) => {
|
|
3446
|
-
const dayEvents = events.filter((e) =>
|
|
3327
|
+
const dayEvents = events.filter((e) => sameDay(e.start, day) && !e.allDay);
|
|
3447
3328
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative border-r border-border last:border-r-0", children: [
|
|
3448
3329
|
hours.map((h, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3449
3330
|
"button",
|
|
@@ -3617,17 +3498,17 @@ function Cart({
|
|
|
3617
3498
|
] })
|
|
3618
3499
|
] });
|
|
3619
3500
|
}
|
|
3620
|
-
var CartContext =
|
|
3501
|
+
var CartContext = React28.createContext(null);
|
|
3621
3502
|
var clampQty = (qty, max) => {
|
|
3622
3503
|
const lower = Math.max(1, Math.round(qty));
|
|
3623
3504
|
return max != null ? Math.min(lower, max) : lower;
|
|
3624
3505
|
};
|
|
3625
3506
|
function CartProvider({ children, initialItems = [], onChange }) {
|
|
3626
|
-
const [items, setItems] =
|
|
3627
|
-
|
|
3507
|
+
const [items, setItems] = React28.useState(initialItems);
|
|
3508
|
+
React28.useEffect(() => {
|
|
3628
3509
|
onChange?.(items);
|
|
3629
3510
|
}, [items]);
|
|
3630
|
-
const addToCart =
|
|
3511
|
+
const addToCart = React28.useCallback((item, quantity) => {
|
|
3631
3512
|
const addQty = quantity ?? item.quantity ?? 1;
|
|
3632
3513
|
setItems((prev) => {
|
|
3633
3514
|
const existing = prev.find((it) => it.id === item.id);
|
|
@@ -3640,29 +3521,29 @@ function CartProvider({ children, initialItems = [], onChange }) {
|
|
|
3640
3521
|
return [...prev, { ...rest, quantity: clampQty(addQty, item.max) }];
|
|
3641
3522
|
});
|
|
3642
3523
|
}, []);
|
|
3643
|
-
const removeFromCart =
|
|
3524
|
+
const removeFromCart = React28.useCallback((id) => {
|
|
3644
3525
|
setItems((prev) => prev.filter((it) => it.id !== id));
|
|
3645
3526
|
}, []);
|
|
3646
|
-
const updateQuantity =
|
|
3527
|
+
const updateQuantity = React28.useCallback((id, quantity) => {
|
|
3647
3528
|
setItems(
|
|
3648
3529
|
(prev) => prev.map((it) => it.id === id ? { ...it, quantity: clampQty(quantity, it.max) } : it)
|
|
3649
3530
|
);
|
|
3650
3531
|
}, []);
|
|
3651
|
-
const clearCart =
|
|
3652
|
-
const isInCart =
|
|
3653
|
-
const getItemCount =
|
|
3654
|
-
const getCartTotal =
|
|
3532
|
+
const clearCart = React28.useCallback(() => setItems([]), []);
|
|
3533
|
+
const isInCart = React28.useCallback((id) => items.some((it) => it.id === id), [items]);
|
|
3534
|
+
const getItemCount = React28.useCallback(() => items.reduce((sum, it) => sum + it.quantity, 0), [items]);
|
|
3535
|
+
const getCartTotal = React28.useCallback(
|
|
3655
3536
|
() => items.reduce((sum, it) => sum + it.price * it.quantity, 0),
|
|
3656
3537
|
[items]
|
|
3657
3538
|
);
|
|
3658
|
-
const value =
|
|
3539
|
+
const value = React28.useMemo(
|
|
3659
3540
|
() => ({ items, addToCart, removeFromCart, updateQuantity, clearCart, isInCart, getItemCount, getCartTotal }),
|
|
3660
3541
|
[items, addToCart, removeFromCart, updateQuantity, clearCart, isInCart, getItemCount, getCartTotal]
|
|
3661
3542
|
);
|
|
3662
3543
|
return /* @__PURE__ */ jsxRuntime.jsx(CartContext.Provider, { value, children });
|
|
3663
3544
|
}
|
|
3664
3545
|
function useCart() {
|
|
3665
|
-
const ctx =
|
|
3546
|
+
const ctx = React28.useContext(CartContext);
|
|
3666
3547
|
if (!ctx) {
|
|
3667
3548
|
throw new Error("useCart must be used within a <CartProvider>.");
|
|
3668
3549
|
}
|
|
@@ -3996,11 +3877,11 @@ function buildBindings(store, name, kind, snap) {
|
|
|
3996
3877
|
|
|
3997
3878
|
// src/form/useForm.ts
|
|
3998
3879
|
function useForm(options = {}) {
|
|
3999
|
-
const ref =
|
|
3880
|
+
const ref = React28.useRef(null);
|
|
4000
3881
|
if (ref.current === null) ref.current = new FormStore(options);
|
|
4001
3882
|
const store = ref.current;
|
|
4002
|
-
|
|
4003
|
-
const make =
|
|
3883
|
+
React28.useSyncExternalStore(store.subscribe, store.getRootSnapshot, store.getRootSnapshot);
|
|
3884
|
+
const make = React28.useCallback(
|
|
4004
3885
|
(kind) => (name, rules) => {
|
|
4005
3886
|
if (rules !== void 0) store.setRule(name, rules);
|
|
4006
3887
|
return buildBindings(store, name, kind, store.getFieldSnapshot(name));
|
|
@@ -4029,9 +3910,9 @@ function useForm(options = {}) {
|
|
|
4029
3910
|
fieldTarget: make("target")
|
|
4030
3911
|
};
|
|
4031
3912
|
}
|
|
4032
|
-
var FormContext =
|
|
3913
|
+
var FormContext = React28.createContext(null);
|
|
4033
3914
|
function useFormStore() {
|
|
4034
|
-
const store =
|
|
3915
|
+
const store = React28.useContext(FormContext);
|
|
4035
3916
|
if (!store) {
|
|
4036
3917
|
throw new Error("useFormStore must be used within a <Form>. Did you forget to wrap your fields?");
|
|
4037
3918
|
}
|
|
@@ -4045,8 +3926,8 @@ function Form({
|
|
|
4045
3926
|
children,
|
|
4046
3927
|
...rest
|
|
4047
3928
|
}) {
|
|
4048
|
-
const ref =
|
|
4049
|
-
const bypass =
|
|
3929
|
+
const ref = React28.useRef(null);
|
|
3930
|
+
const bypass = React28.useRef(false);
|
|
4050
3931
|
const handleSubmit = async (e) => {
|
|
4051
3932
|
if (bypass.current) {
|
|
4052
3933
|
bypass.current = false;
|
|
@@ -4098,12 +3979,12 @@ function useFormField(name, options = {}) {
|
|
|
4098
3979
|
const store = useFormStore();
|
|
4099
3980
|
const { kind = "value", rules } = options;
|
|
4100
3981
|
if (rules !== void 0 && store.getRule(name) !== rules) store.setRule(name, rules);
|
|
4101
|
-
|
|
3982
|
+
React28.useEffect(() => {
|
|
4102
3983
|
return () => {
|
|
4103
3984
|
if (rules !== void 0) store.removeRule(name);
|
|
4104
3985
|
};
|
|
4105
3986
|
}, [store, name]);
|
|
4106
|
-
const snap =
|
|
3987
|
+
const snap = React28.useSyncExternalStore(
|
|
4107
3988
|
store.subscribe,
|
|
4108
3989
|
() => store.getFieldSnapshot(name)
|
|
4109
3990
|
);
|
|
@@ -4115,7 +3996,7 @@ function FormField({ name, kind, rules, children }) {
|
|
|
4115
3996
|
}
|
|
4116
3997
|
function useFieldArray(name) {
|
|
4117
3998
|
const store = useFormStore();
|
|
4118
|
-
|
|
3999
|
+
React28.useSyncExternalStore(store.subscribe, store.getRootSnapshot, store.getRootSnapshot);
|
|
4119
4000
|
const arr = store.getValue(name) ?? [];
|
|
4120
4001
|
const keys = store.getKeys(name);
|
|
4121
4002
|
return {
|
|
@@ -4148,7 +4029,7 @@ function TextInput({
|
|
|
4148
4029
|
suffix,
|
|
4149
4030
|
id
|
|
4150
4031
|
}) {
|
|
4151
|
-
const errorId =
|
|
4032
|
+
const errorId = React28.useId();
|
|
4152
4033
|
const hasError = errorMessage != null;
|
|
4153
4034
|
const hasAdornment = prefix != null || suffix != null;
|
|
4154
4035
|
const inputId = htmlFor ?? id;
|
|
@@ -4309,7 +4190,7 @@ function CreditCardForm({
|
|
|
4309
4190
|
className = "",
|
|
4310
4191
|
style
|
|
4311
4192
|
}) {
|
|
4312
|
-
const initial =
|
|
4193
|
+
const initial = React28.useRef({
|
|
4313
4194
|
number: formatCardNumber(defaultValue?.number ?? ""),
|
|
4314
4195
|
name: defaultValue?.name ?? "",
|
|
4315
4196
|
expiry: formatExpiry(defaultValue?.expiry ?? ""),
|
|
@@ -4318,7 +4199,7 @@ function CreditCardForm({
|
|
|
4318
4199
|
const form = useForm({ initialValues: initial });
|
|
4319
4200
|
const numberStr = String(form.values.number ?? "");
|
|
4320
4201
|
const brand = detectBrand(numberStr);
|
|
4321
|
-
|
|
4202
|
+
React28.useEffect(() => {
|
|
4322
4203
|
onChange?.(toCard(form.values));
|
|
4323
4204
|
}, [form.values.number, form.values.name, form.values.expiry, form.values.cvv]);
|
|
4324
4205
|
const numberBind = form.fieldNative("number", {
|
|
@@ -4441,7 +4322,7 @@ function Checkout({
|
|
|
4441
4322
|
] })
|
|
4442
4323
|
] });
|
|
4443
4324
|
}
|
|
4444
|
-
var NotificationContext =
|
|
4325
|
+
var NotificationContext = React28.createContext({
|
|
4445
4326
|
open: () => void 0,
|
|
4446
4327
|
close: () => void 0
|
|
4447
4328
|
});
|
|
@@ -4499,26 +4380,26 @@ function NotificationItem({
|
|
|
4499
4380
|
onClose,
|
|
4500
4381
|
reduced
|
|
4501
4382
|
}) {
|
|
4502
|
-
const [paused, setPaused] =
|
|
4383
|
+
const [paused, setPaused] = React28.useState(false);
|
|
4503
4384
|
const duration = n.duration ?? 4e3;
|
|
4504
4385
|
const isAutoDismissing = isFinite(duration) && duration > 0;
|
|
4505
4386
|
const showProgress = !reduced && isAutoDismissing;
|
|
4506
|
-
const timerRef =
|
|
4507
|
-
const startTimeRef =
|
|
4508
|
-
const remainingRef =
|
|
4509
|
-
const clearTimer =
|
|
4387
|
+
const timerRef = React28.useRef(null);
|
|
4388
|
+
const startTimeRef = React28.useRef(0);
|
|
4389
|
+
const remainingRef = React28.useRef(duration);
|
|
4390
|
+
const clearTimer = React28.useCallback(() => {
|
|
4510
4391
|
if (timerRef.current !== null) {
|
|
4511
4392
|
clearTimeout(timerRef.current);
|
|
4512
4393
|
timerRef.current = null;
|
|
4513
4394
|
}
|
|
4514
4395
|
}, []);
|
|
4515
|
-
const scheduleDismiss =
|
|
4396
|
+
const scheduleDismiss = React28.useCallback((ms) => {
|
|
4516
4397
|
clearTimer();
|
|
4517
4398
|
if (!isAutoDismissing) return;
|
|
4518
4399
|
startTimeRef.current = Date.now();
|
|
4519
4400
|
timerRef.current = setTimeout(() => onClose(n.id), ms);
|
|
4520
4401
|
}, [clearTimer, isAutoDismissing, n.id, onClose]);
|
|
4521
|
-
|
|
4402
|
+
React28.useEffect(() => {
|
|
4522
4403
|
if (paused || !isAutoDismissing) return;
|
|
4523
4404
|
scheduleDismiss(remainingRef.current);
|
|
4524
4405
|
return clearTimer;
|
|
@@ -4601,15 +4482,15 @@ function NotificationProvider({
|
|
|
4601
4482
|
children,
|
|
4602
4483
|
position = "top-right"
|
|
4603
4484
|
}) {
|
|
4604
|
-
const [notifications, setNotifications] =
|
|
4485
|
+
const [notifications, setNotifications] = React28.useState([]);
|
|
4605
4486
|
const reduced = framerMotion.useReducedMotion();
|
|
4606
|
-
const open =
|
|
4487
|
+
const open = React28.useCallback((payload) => {
|
|
4607
4488
|
setNotifications((prev) => [
|
|
4608
4489
|
...prev,
|
|
4609
4490
|
{ duration: 4e3, ...payload, id: Date.now() + Math.random() }
|
|
4610
4491
|
]);
|
|
4611
4492
|
}, []);
|
|
4612
|
-
const close =
|
|
4493
|
+
const close = React28.useCallback((id) => {
|
|
4613
4494
|
setNotifications((prev) => prev.filter((n) => n.id !== id));
|
|
4614
4495
|
}, []);
|
|
4615
4496
|
return /* @__PURE__ */ jsxRuntime.jsxs(NotificationContext.Provider, { value: { open, close }, children: [
|
|
@@ -4638,7 +4519,7 @@ function NotificationProvider({
|
|
|
4638
4519
|
] });
|
|
4639
4520
|
}
|
|
4640
4521
|
function useNotification() {
|
|
4641
|
-
const { open } =
|
|
4522
|
+
const { open } = React28.useContext(NotificationContext);
|
|
4642
4523
|
return {
|
|
4643
4524
|
info: (props) => open({ type: "info", ...props }),
|
|
4644
4525
|
success: (props) => open({ type: "success", ...props }),
|
|
@@ -4755,10 +4636,10 @@ function FadingBase({
|
|
|
4755
4636
|
isMounted = false,
|
|
4756
4637
|
children
|
|
4757
4638
|
}) {
|
|
4758
|
-
const [shouldRender, setShouldRender] =
|
|
4759
|
-
const [visible, setVisible] =
|
|
4760
|
-
const timerRef =
|
|
4761
|
-
|
|
4639
|
+
const [shouldRender, setShouldRender] = React28.useState(isMounted);
|
|
4640
|
+
const [visible, setVisible] = React28.useState(false);
|
|
4641
|
+
const timerRef = React28.useRef(null);
|
|
4642
|
+
React28.useEffect(() => {
|
|
4762
4643
|
if (isMounted) {
|
|
4763
4644
|
setShouldRender(true);
|
|
4764
4645
|
const rafId = requestAnimationFrame(() => setVisible(true));
|
|
@@ -4856,8 +4737,8 @@ function ScalableContainer({
|
|
|
4856
4737
|
togglePosition = "top-right",
|
|
4857
4738
|
className = ""
|
|
4858
4739
|
}) {
|
|
4859
|
-
const containerRef =
|
|
4860
|
-
const [internalScaled, setInternalScaled] =
|
|
4740
|
+
const containerRef = React28.useRef(null);
|
|
4741
|
+
const [internalScaled, setInternalScaled] = React28.useState(false);
|
|
4861
4742
|
const isScaled = expanded ?? internalScaled;
|
|
4862
4743
|
const reduced = framerMotion.useReducedMotion();
|
|
4863
4744
|
const onToggle = () => {
|
|
@@ -4995,17 +4876,17 @@ function CatalogGrid({ items, buttonText, onOpen, className = "" }) {
|
|
|
4995
4876
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `flex flex-wrap gap-2 ${className}`.trim(), children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(GridCard, { item, buttonText, onOpen }, item.key)) });
|
|
4996
4877
|
}
|
|
4997
4878
|
function CatalogCarousel({ items, buttonText, onOpen, className = "" }) {
|
|
4998
|
-
const [activeIndex, setActiveIndex] =
|
|
4999
|
-
const [indexPool, setIndexPool] =
|
|
5000
|
-
const cardRefs =
|
|
5001
|
-
const getIndexes =
|
|
4879
|
+
const [activeIndex, setActiveIndex] = React28.useState(0);
|
|
4880
|
+
const [indexPool, setIndexPool] = React28.useState([]);
|
|
4881
|
+
const cardRefs = React28.useRef([]);
|
|
4882
|
+
const getIndexes = React28.useMemo(() => {
|
|
5002
4883
|
let nextIndex = activeIndex + 1;
|
|
5003
4884
|
let previousIndex = activeIndex - 1;
|
|
5004
4885
|
if (activeIndex === 0) previousIndex = items.length - 1;
|
|
5005
4886
|
if (activeIndex === items.length - 1) nextIndex = 0;
|
|
5006
4887
|
return { previousIndex, nextIndex };
|
|
5007
4888
|
}, [activeIndex, items.length]);
|
|
5008
|
-
|
|
4889
|
+
React28.useEffect(() => {
|
|
5009
4890
|
const { nextIndex, previousIndex } = getIndexes;
|
|
5010
4891
|
let indexes = [previousIndex, activeIndex, nextIndex];
|
|
5011
4892
|
if (activeIndex !== 0 && activeIndex !== items.length - 1) {
|
|
@@ -5178,8 +5059,8 @@ function writeDismissed(key) {
|
|
|
5178
5059
|
}
|
|
5179
5060
|
}
|
|
5180
5061
|
function useTargetBbox(ref) {
|
|
5181
|
-
const [bbox, setBbox] =
|
|
5182
|
-
|
|
5062
|
+
const [bbox, setBbox] = React28.useState(null);
|
|
5063
|
+
React28.useLayoutEffect(() => {
|
|
5183
5064
|
const el = ref?.current;
|
|
5184
5065
|
if (!el) {
|
|
5185
5066
|
setBbox(null);
|
|
@@ -5209,7 +5090,7 @@ function tooltipStyleFor(bbox, placement) {
|
|
|
5209
5090
|
return { left: bbox.left + bbox.width / 2, top: bbox.top - TOOLTIP_GAP, transform: "translate(-50%, -100%)", width: TOOLTIP_WIDTH };
|
|
5210
5091
|
}
|
|
5211
5092
|
function useFocusTrap(containerRef, active) {
|
|
5212
|
-
|
|
5093
|
+
React28.useEffect(() => {
|
|
5213
5094
|
if (!active) return;
|
|
5214
5095
|
const el = containerRef.current;
|
|
5215
5096
|
if (!el) return;
|
|
@@ -5248,16 +5129,16 @@ function Wizard({
|
|
|
5248
5129
|
onComplete,
|
|
5249
5130
|
onSkip
|
|
5250
5131
|
}) {
|
|
5251
|
-
const tooltipRef =
|
|
5252
|
-
const tooltipTitleId =
|
|
5253
|
-
const tooltipBodyId =
|
|
5132
|
+
const tooltipRef = React28.useRef(null);
|
|
5133
|
+
const tooltipTitleId = React28.useId();
|
|
5134
|
+
const tooltipBodyId = React28.useId();
|
|
5254
5135
|
const reduced = framerMotion.useReducedMotion();
|
|
5255
|
-
const [open, setOpen] =
|
|
5256
|
-
const [activeIndex, setActiveIndex] =
|
|
5136
|
+
const [open, setOpen] = React28.useState(() => steps.length > 0 && !readDismissed(storageKey));
|
|
5137
|
+
const [activeIndex, setActiveIndex] = React28.useState(0);
|
|
5257
5138
|
const step = steps[activeIndex];
|
|
5258
5139
|
const bbox = useTargetBbox(step?.stepRef);
|
|
5259
5140
|
useFocusTrap(tooltipRef, open);
|
|
5260
|
-
|
|
5141
|
+
React28.useEffect(() => {
|
|
5261
5142
|
if (!open || !dismissible) return;
|
|
5262
5143
|
const onKey = (e) => {
|
|
5263
5144
|
if (e.key === "Escape") {
|
|
@@ -5268,12 +5149,12 @@ function Wizard({
|
|
|
5268
5149
|
document.addEventListener("keydown", onKey);
|
|
5269
5150
|
return () => document.removeEventListener("keydown", onKey);
|
|
5270
5151
|
}, [open, dismissible]);
|
|
5271
|
-
const handleSkip =
|
|
5152
|
+
const handleSkip = React28.useCallback(() => {
|
|
5272
5153
|
writeDismissed(storageKey);
|
|
5273
5154
|
setOpen(false);
|
|
5274
5155
|
onSkip?.();
|
|
5275
5156
|
}, [storageKey, onSkip]);
|
|
5276
|
-
const handleComplete =
|
|
5157
|
+
const handleComplete = React28.useCallback(() => {
|
|
5277
5158
|
writeDismissed(storageKey);
|
|
5278
5159
|
setOpen(false);
|
|
5279
5160
|
onComplete?.();
|
|
@@ -5416,7 +5297,7 @@ function Wizard({
|
|
|
5416
5297
|
] });
|
|
5417
5298
|
}
|
|
5418
5299
|
var SearchIcon = /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.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" }) });
|
|
5419
|
-
var SearchInput =
|
|
5300
|
+
var SearchInput = React28__default.default.forwardRef(function SearchInput2({ value, onChange, disabled, label, htmlFor, placeholder, name, inputStyle, style, layout = "vertical", size = "md", icon, helperText, className }, ref) {
|
|
5420
5301
|
return /* @__PURE__ */ jsxRuntime.jsx(Field, { className, label, htmlFor, layout, helperText, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5421
5302
|
"div",
|
|
5422
5303
|
{
|
|
@@ -5600,7 +5481,7 @@ function TableBody({
|
|
|
5600
5481
|
expandRow,
|
|
5601
5482
|
getRowKey
|
|
5602
5483
|
}) {
|
|
5603
|
-
const [expanded, setExpanded] =
|
|
5484
|
+
const [expanded, setExpanded] = React28.useState(() => /* @__PURE__ */ new Set());
|
|
5604
5485
|
const reduced = framerMotion.useReducedMotion();
|
|
5605
5486
|
const toggleRow = (rowKey) => {
|
|
5606
5487
|
setExpanded((prev) => {
|
|
@@ -5615,7 +5496,7 @@ function TableBody({
|
|
|
5615
5496
|
return /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: rows.map((row, i) => {
|
|
5616
5497
|
const rowKey = getRowKey(row, i);
|
|
5617
5498
|
const isExpanded = expanded.has(rowKey);
|
|
5618
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5499
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React28__default.default.Fragment, { children: [
|
|
5619
5500
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5620
5501
|
"tr",
|
|
5621
5502
|
{
|
|
@@ -5671,9 +5552,9 @@ function Pagination({
|
|
|
5671
5552
|
const matchedOption = picker.find(
|
|
5672
5553
|
(o) => o.label === options.perPage || o.value === options.perPage
|
|
5673
5554
|
);
|
|
5674
|
-
const [perPageKey, setPerPageKey] =
|
|
5555
|
+
const [perPageKey, setPerPageKey] = React28.useState(() => matchedOption?.key ?? picker[0]?.key);
|
|
5675
5556
|
const displayPerPageKey = serverSide ? matchedOption?.key ?? perPageKey : perPageKey;
|
|
5676
|
-
|
|
5557
|
+
React28.useEffect(() => {
|
|
5677
5558
|
if (serverSide && options.perPage != null) {
|
|
5678
5559
|
const next = picker.find((o) => o.label === options.perPage || o.value === options.perPage);
|
|
5679
5560
|
if (next) setPerPageKey(next.key);
|
|
@@ -5681,7 +5562,7 @@ function Pagination({
|
|
|
5681
5562
|
}, [serverSide, options.perPage, picker]);
|
|
5682
5563
|
const currentOpt = picker.find((o) => o.key === displayPerPageKey);
|
|
5683
5564
|
const currentPerPageLabel = currentOpt?.label ?? currentOpt?.value ?? options.perPage ?? "";
|
|
5684
|
-
const navBtn = (icon, disabled, onClick, title) => /* @__PURE__ */ jsxRuntime.jsx(Button_default, { variant: "outline", size: "sm", disabled, onClick, icon, className: "w-7 !px-0 focus-visible:!ring-offset-0", "aria-label": title, title });
|
|
5565
|
+
const navBtn = (icon, disabled, onClick, title) => /* @__PURE__ */ jsxRuntime.jsx(Button_default, { variant: "outline", size: "sm", disabled, onClick, icon, className: "w-7 !px-0 focus-visible:!ring-[3px] focus-visible:!ring-focus-ring focus-visible:!ring-offset-0", "aria-label": title, title });
|
|
5685
5566
|
const chevronRight = /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "h-4 w-4", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) });
|
|
5686
5567
|
const doubleChevronRight = /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "h-4 w-4", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 5l7 7-7 7M5 5l7 7-7 7" }) });
|
|
5687
5568
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center justify-end gap-x-4 gap-y-3", children: [
|
|
@@ -5693,7 +5574,7 @@ function Pagination({
|
|
|
5693
5574
|
variant: "outline",
|
|
5694
5575
|
size: "sm",
|
|
5695
5576
|
side: "top",
|
|
5696
|
-
className: "focus-visible:!ring-offset-0",
|
|
5577
|
+
className: "focus-visible:!ring-[3px] focus-visible:!ring-focus-ring focus-visible:!ring-offset-0",
|
|
5697
5578
|
label: String(currentPerPageLabel),
|
|
5698
5579
|
items: picker.map((o) => ({
|
|
5699
5580
|
key: o.key,
|
|
@@ -5736,14 +5617,14 @@ function Table({
|
|
|
5736
5617
|
className = "",
|
|
5737
5618
|
style
|
|
5738
5619
|
}) {
|
|
5739
|
-
const searchRef =
|
|
5740
|
-
const [searchTerm, setSearchTerm] =
|
|
5741
|
-
const [perPage, setPerPage] =
|
|
5620
|
+
const searchRef = React28.useRef(null);
|
|
5621
|
+
const [searchTerm, setSearchTerm] = React28.useState("");
|
|
5622
|
+
const [perPage, setPerPage] = React28.useState(
|
|
5742
5623
|
typeof pagination.perPage === "number" ? pagination.perPage : 15
|
|
5743
5624
|
);
|
|
5744
|
-
const [activePage, setActivePage] =
|
|
5625
|
+
const [activePage, setActivePage] = React28.useState(0);
|
|
5745
5626
|
const isServerSide = !!(pagination.enabled && pagination.serverSide);
|
|
5746
|
-
const filteredRows =
|
|
5627
|
+
const filteredRows = React28.useMemo(() => {
|
|
5747
5628
|
if (isServerSide || !searchTerm) return rows;
|
|
5748
5629
|
const term = searchTerm.toLowerCase();
|
|
5749
5630
|
return rows.filter(
|
|
@@ -5752,29 +5633,29 @@ function Table({
|
|
|
5752
5633
|
)
|
|
5753
5634
|
);
|
|
5754
5635
|
}, [rows, searchTerm, isServerSide]);
|
|
5755
|
-
const datasets =
|
|
5636
|
+
const datasets = React28.useMemo(() => {
|
|
5756
5637
|
if (isServerSide) return [rows];
|
|
5757
5638
|
return createDatasets(filteredRows, pagination.enabled ? perPage : null);
|
|
5758
5639
|
}, [filteredRows, perPage, pagination.enabled, isServerSide, rows]);
|
|
5759
|
-
const MAX_PAGE =
|
|
5640
|
+
const MAX_PAGE = React28.useMemo(() => {
|
|
5760
5641
|
if (isServerSide && typeof pagination.maxPage === "number") return Math.max(0, pagination.maxPage);
|
|
5761
5642
|
if (isServerSide && typeof pagination.totalCount === "number")
|
|
5762
5643
|
return Math.max(0, Math.ceil(pagination.totalCount / perPage) - 1);
|
|
5763
5644
|
return datasets.length ? datasets.length - 1 : 0;
|
|
5764
5645
|
}, [isServerSide, pagination.maxPage, pagination.totalCount, perPage, datasets.length]);
|
|
5765
|
-
const currentPageRows =
|
|
5646
|
+
const currentPageRows = React28.useMemo(() => {
|
|
5766
5647
|
if (isServerSide) return rows;
|
|
5767
5648
|
return datasets[activePage] ?? [];
|
|
5768
5649
|
}, [isServerSide, rows, datasets, activePage]);
|
|
5769
|
-
|
|
5650
|
+
React28.useEffect(() => {
|
|
5770
5651
|
if (pagination.enabled && !isServerSide && typeof pagination.perPage === "number") {
|
|
5771
5652
|
setPerPage(pagination.perPage);
|
|
5772
5653
|
}
|
|
5773
5654
|
}, [pagination.enabled, pagination.perPage, isServerSide]);
|
|
5774
|
-
|
|
5655
|
+
React28.useEffect(() => {
|
|
5775
5656
|
if (isServerSide && typeof pagination.perPage === "number") setPerPage(pagination.perPage);
|
|
5776
5657
|
}, [isServerSide, pagination.perPage]);
|
|
5777
|
-
|
|
5658
|
+
React28.useEffect(() => {
|
|
5778
5659
|
if (isServerSide && typeof pagination.page === "number" && pagination.page >= 1)
|
|
5779
5660
|
setActivePage(pagination.page - 1);
|
|
5780
5661
|
}, [isServerSide, pagination.page]);
|
|
@@ -5858,7 +5739,7 @@ function TableSkeletonBody({
|
|
|
5858
5739
|
)) });
|
|
5859
5740
|
}
|
|
5860
5741
|
function ThemeSwitch({ checked, onChange, label = "Toggle dark mode", className = "" }) {
|
|
5861
|
-
const id =
|
|
5742
|
+
const id = React28.useId();
|
|
5862
5743
|
return /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: id, className: `flex items-center gap-2 cursor-pointer select-none ${className}`.trim(), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5863
5744
|
SwitchPrimitive__namespace.Root,
|
|
5864
5745
|
{
|
|
@@ -6042,7 +5923,7 @@ function Sidebar({
|
|
|
6042
5923
|
}
|
|
6043
5924
|
) });
|
|
6044
5925
|
}
|
|
6045
|
-
var MegaMenuContext =
|
|
5926
|
+
var MegaMenuContext = React28.createContext({ align: "start" });
|
|
6046
5927
|
function MegaMenu({
|
|
6047
5928
|
children,
|
|
6048
5929
|
align = "start",
|
|
@@ -6073,7 +5954,7 @@ function MegaMenu({
|
|
|
6073
5954
|
}
|
|
6074
5955
|
var TOP_ITEM = "group/top inline-flex items-center gap-1.5 h-10 px-3 rounded-md text-sm font-medium select-none text-foreground-secondary hover:text-foreground hover:bg-surface-raised data-[state=open]:text-accent data-[active]:text-accent transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-accent";
|
|
6075
5956
|
function MegaMenuItem({ label, icon, href, children, className = "" }) {
|
|
6076
|
-
const { align } =
|
|
5957
|
+
const { align } = React28.useContext(MegaMenuContext);
|
|
6077
5958
|
const pos = align === "center" ? "left-1/2 -translate-x-1/2" : align === "end" ? "right-0" : "left-0";
|
|
6078
5959
|
if (!children) {
|
|
6079
5960
|
return /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu__namespace.Item, { children: /* @__PURE__ */ jsxRuntime.jsxs(NavigationMenu__namespace.Link, { href, className: [TOP_ITEM, className].filter(Boolean).join(" "), children: [
|
|
@@ -6158,8 +6039,8 @@ function MegaMenuLink({ href, icon, description, active, onClick, children, clas
|
|
|
6158
6039
|
function MegaMenuFeatured({ children, className = "" }) {
|
|
6159
6040
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: ["min-w-0 rounded-lg bg-surface-raised border border-border p-4 flex flex-col", className].filter(Boolean).join(" "), children });
|
|
6160
6041
|
}
|
|
6161
|
-
var elementsOfType = (children, type) =>
|
|
6162
|
-
(c) =>
|
|
6042
|
+
var elementsOfType = (children, type) => React28__default.default.Children.toArray(children).filter(
|
|
6043
|
+
(c) => React28__default.default.isValidElement(c) && c.type === type
|
|
6163
6044
|
);
|
|
6164
6045
|
var MOBILE_CHEVRON = /* @__PURE__ */ jsxRuntime.jsx(
|
|
6165
6046
|
"svg",
|
|
@@ -6196,9 +6077,9 @@ function MobileLinkRow({ link, onNavigate }) {
|
|
|
6196
6077
|
);
|
|
6197
6078
|
}
|
|
6198
6079
|
function MobilePanel({ panel, onNavigate }) {
|
|
6199
|
-
const nodes =
|
|
6080
|
+
const nodes = React28__default.default.Children.toArray(panel.props.children);
|
|
6200
6081
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-4 px-2 pb-3 pt-1", children: nodes.map((node, i) => {
|
|
6201
|
-
if (!
|
|
6082
|
+
if (!React28__default.default.isValidElement(node)) return null;
|
|
6202
6083
|
const el = node;
|
|
6203
6084
|
if (el.type === MegaMenuSection) {
|
|
6204
6085
|
const { title, children } = el.props;
|
|
@@ -6217,8 +6098,8 @@ function MegaMenuMobile({
|
|
|
6217
6098
|
children,
|
|
6218
6099
|
label
|
|
6219
6100
|
}) {
|
|
6220
|
-
const [open, setOpen] =
|
|
6221
|
-
const [expanded, setExpanded] =
|
|
6101
|
+
const [open, setOpen] = React28.useState(false);
|
|
6102
|
+
const [expanded, setExpanded] = React28.useState(null);
|
|
6222
6103
|
const items = elementsOfType(children, MegaMenuItem);
|
|
6223
6104
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "md:hidden w-full", children: [
|
|
6224
6105
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -6291,17 +6172,17 @@ function AppShell({
|
|
|
6291
6172
|
children,
|
|
6292
6173
|
className = ""
|
|
6293
6174
|
}) {
|
|
6294
|
-
const [expanded, setExpanded] =
|
|
6295
|
-
const [isMobile, setIsMobile] =
|
|
6296
|
-
const [mobileOpen, setMobileOpen] =
|
|
6297
|
-
|
|
6175
|
+
const [expanded, setExpanded] = React28.useState(sidebarDefaultExpanded);
|
|
6176
|
+
const [isMobile, setIsMobile] = React28.useState(false);
|
|
6177
|
+
const [mobileOpen, setMobileOpen] = React28.useState(false);
|
|
6178
|
+
React28.useEffect(() => {
|
|
6298
6179
|
const mq = window.matchMedia("(max-width: 767px)");
|
|
6299
6180
|
const update = (e) => setIsMobile(e.matches);
|
|
6300
6181
|
update(mq);
|
|
6301
6182
|
mq.addEventListener("change", update);
|
|
6302
6183
|
return () => mq.removeEventListener("change", update);
|
|
6303
6184
|
}, []);
|
|
6304
|
-
|
|
6185
|
+
React28.useEffect(() => {
|
|
6305
6186
|
if (!isMobile) setMobileOpen(false);
|
|
6306
6187
|
}, [isMobile]);
|
|
6307
6188
|
const hasSidebar = sidebarSections.length > 0;
|
|
@@ -6428,7 +6309,7 @@ function SecureLayout({
|
|
|
6428
6309
|
className = ""
|
|
6429
6310
|
}) {
|
|
6430
6311
|
const reduced = framerMotion.useReducedMotion();
|
|
6431
|
-
const cbs =
|
|
6312
|
+
const cbs = React28.useRef({ canAccess, onGranted, onDeny });
|
|
6432
6313
|
cbs.current = { canAccess, onGranted, onDeny };
|
|
6433
6314
|
const rolesKey = JSON.stringify(roles);
|
|
6434
6315
|
const requiredRolesKey = JSON.stringify(requiredRoles);
|
|
@@ -6443,10 +6324,10 @@ function SecureLayout({
|
|
|
6443
6324
|
if (requiredPermissions?.length && !has(permissions, requiredPermissions, requireAllPermissions)) return false;
|
|
6444
6325
|
return true;
|
|
6445
6326
|
};
|
|
6446
|
-
const [state, setState] =
|
|
6327
|
+
const [state, setState] = React28.useState(
|
|
6447
6328
|
() => !passesSync() ? "denied" : canAccess ? "checking" : "granted"
|
|
6448
6329
|
);
|
|
6449
|
-
|
|
6330
|
+
React28.useEffect(() => {
|
|
6450
6331
|
let cancelled = false;
|
|
6451
6332
|
const { canAccess: check, onGranted: granted, onDeny: deny } = cbs.current;
|
|
6452
6333
|
const finish = (ok) => {
|
|
@@ -6607,10 +6488,10 @@ function ThemeProvider({
|
|
|
6607
6488
|
className = "",
|
|
6608
6489
|
style
|
|
6609
6490
|
}) {
|
|
6610
|
-
const id =
|
|
6491
|
+
const id = React28__default.default.useId().replace(/:/g, "");
|
|
6611
6492
|
const scopeClass = `geo-th-${id}`;
|
|
6612
|
-
const divRef =
|
|
6613
|
-
|
|
6493
|
+
const divRef = React28.useRef(null);
|
|
6494
|
+
React28.useEffect(() => {
|
|
6614
6495
|
const el = divRef.current;
|
|
6615
6496
|
if (!el) return;
|
|
6616
6497
|
if (colorScheme === "auto") return;
|
|
@@ -6625,8 +6506,8 @@ function ThemeProvider({
|
|
|
6625
6506
|
}
|
|
6626
6507
|
el.classList.toggle("dark", colorScheme === "dark");
|
|
6627
6508
|
}, [colorScheme]);
|
|
6628
|
-
const lightVars =
|
|
6629
|
-
const darkVarStr =
|
|
6509
|
+
const lightVars = React28.useMemo(() => toCssVars(theme), [theme]);
|
|
6510
|
+
const darkVarStr = React28.useMemo(() => {
|
|
6630
6511
|
if (!darkTheme) return "";
|
|
6631
6512
|
const dvars = toCssVars(darkTheme);
|
|
6632
6513
|
if (!Object.keys(dvars).length) return "";
|
|
@@ -6668,7 +6549,7 @@ function NumberInput({
|
|
|
6668
6549
|
readOnly = false,
|
|
6669
6550
|
precision
|
|
6670
6551
|
}) {
|
|
6671
|
-
const errorId =
|
|
6552
|
+
const errorId = React28.useId();
|
|
6672
6553
|
const hasError = errorMessage != null;
|
|
6673
6554
|
const inferredPrecision = precision ?? (Number.isInteger(step) ? 0 : String(step).split(".")[1]?.length ?? 0);
|
|
6674
6555
|
const round = (n) => {
|
|
@@ -6799,8 +6680,8 @@ function Password({
|
|
|
6799
6680
|
showIcon,
|
|
6800
6681
|
hideIcon
|
|
6801
6682
|
}) {
|
|
6802
|
-
const [visible, setVisible] =
|
|
6803
|
-
const errorId =
|
|
6683
|
+
const [visible, setVisible] = React28.useState(false);
|
|
6684
|
+
const errorId = React28.useId();
|
|
6804
6685
|
const hasError = errorMessage != null;
|
|
6805
6686
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6806
6687
|
Field,
|
|
@@ -6873,7 +6754,7 @@ function Checkbox({
|
|
|
6873
6754
|
}) {
|
|
6874
6755
|
const isChecked = checked ?? value ?? false;
|
|
6875
6756
|
const labelFirst = labelPosition === "left";
|
|
6876
|
-
const errorId =
|
|
6757
|
+
const errorId = React28.useId();
|
|
6877
6758
|
const hasError = errorMessage != null;
|
|
6878
6759
|
const box = /* @__PURE__ */ jsxRuntime.jsx(
|
|
6879
6760
|
CheckboxPrimitive__namespace.Root,
|
|
@@ -6981,8 +6862,8 @@ function RadioGroup({
|
|
|
6981
6862
|
className,
|
|
6982
6863
|
errorMessage
|
|
6983
6864
|
}) {
|
|
6984
|
-
const errorId =
|
|
6985
|
-
const groupId =
|
|
6865
|
+
const errorId = React28.useId();
|
|
6866
|
+
const groupId = React28.useId();
|
|
6986
6867
|
const hasError = errorMessage != null;
|
|
6987
6868
|
const labelFirst = labelPosition === "left";
|
|
6988
6869
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7082,11 +6963,11 @@ function Switch({
|
|
|
7082
6963
|
disabled,
|
|
7083
6964
|
errorMessage
|
|
7084
6965
|
}) {
|
|
7085
|
-
const id =
|
|
7086
|
-
const errorId =
|
|
6966
|
+
const id = React28.useId();
|
|
6967
|
+
const errorId = React28.useId();
|
|
7087
6968
|
const hasError = errorMessage != null;
|
|
7088
6969
|
const isControlled = checked !== void 0;
|
|
7089
|
-
const [internal, setInternal] =
|
|
6970
|
+
const [internal, setInternal] = React28.useState(defaultChecked);
|
|
7090
6971
|
const isOn = isControlled ? checked : internal;
|
|
7091
6972
|
const handle = (c) => {
|
|
7092
6973
|
if (!isControlled) setInternal(c);
|
|
@@ -7162,11 +7043,11 @@ function MultiTagRow({
|
|
|
7162
7043
|
labelFor,
|
|
7163
7044
|
onRemove
|
|
7164
7045
|
}) {
|
|
7165
|
-
const wrapRef =
|
|
7166
|
-
const measureRef =
|
|
7167
|
-
const [visibleCount, setVisibleCount] =
|
|
7046
|
+
const wrapRef = React28.useRef(null);
|
|
7047
|
+
const measureRef = React28.useRef(null);
|
|
7048
|
+
const [visibleCount, setVisibleCount] = React28.useState(values.length);
|
|
7168
7049
|
const key = values.map(String).join("|");
|
|
7169
|
-
|
|
7050
|
+
React28.useLayoutEffect(() => {
|
|
7170
7051
|
const wrap = wrapRef.current;
|
|
7171
7052
|
const measure = measureRef.current;
|
|
7172
7053
|
if (!wrap || !measure) return;
|
|
@@ -7260,16 +7141,16 @@ function Dropdown({
|
|
|
7260
7141
|
size = "md",
|
|
7261
7142
|
className = ""
|
|
7262
7143
|
}) {
|
|
7263
|
-
const [open, setOpen] =
|
|
7264
|
-
const [selectedItems, setSelectedItems] =
|
|
7265
|
-
const [searchTerm, setSearchTerm] =
|
|
7266
|
-
const [innerItems, setInnerItems] =
|
|
7267
|
-
const errorId =
|
|
7144
|
+
const [open, setOpen] = React28.useState(false);
|
|
7145
|
+
const [selectedItems, setSelectedItems] = React28.useState([]);
|
|
7146
|
+
const [searchTerm, setSearchTerm] = React28.useState("");
|
|
7147
|
+
const [innerItems, setInnerItems] = React28.useState([]);
|
|
7148
|
+
const errorId = React28.useId();
|
|
7268
7149
|
const hasError = errorMessage != null;
|
|
7269
|
-
|
|
7150
|
+
React28.useEffect(() => {
|
|
7270
7151
|
setInnerItems(items);
|
|
7271
7152
|
}, [items]);
|
|
7272
|
-
|
|
7153
|
+
React28.useEffect(() => {
|
|
7273
7154
|
if (isMultiselect && Array.isArray(value)) {
|
|
7274
7155
|
setSelectedItems(value);
|
|
7275
7156
|
}
|
|
@@ -7461,19 +7342,19 @@ function AutoComplete({
|
|
|
7461
7342
|
required,
|
|
7462
7343
|
htmlFor
|
|
7463
7344
|
}) {
|
|
7464
|
-
const errorId =
|
|
7345
|
+
const errorId = React28.useId();
|
|
7465
7346
|
const hasError = errorMessage != null;
|
|
7466
|
-
const [term, setTerm] =
|
|
7467
|
-
const [open, setOpen] =
|
|
7468
|
-
const [asyncItems, setAsyncItems] =
|
|
7469
|
-
const [loading, setLoading] =
|
|
7347
|
+
const [term, setTerm] = React28.useState("");
|
|
7348
|
+
const [open, setOpen] = React28.useState(false);
|
|
7349
|
+
const [asyncItems, setAsyncItems] = React28.useState([]);
|
|
7350
|
+
const [loading, setLoading] = React28.useState(false);
|
|
7470
7351
|
const isAsync = typeof onSearch === "function";
|
|
7471
|
-
const debounceRef =
|
|
7472
|
-
const requestIdRef =
|
|
7352
|
+
const debounceRef = React28.useRef(null);
|
|
7353
|
+
const requestIdRef = React28.useRef(0);
|
|
7473
7354
|
const staticFiltered = isAsync || !items ? [] : term.trim() ? items.filter(
|
|
7474
7355
|
({ key, label: label2 }) => label2.toLowerCase().includes(term.toLowerCase()) || key.toLowerCase().includes(term.toLowerCase())
|
|
7475
7356
|
) : [];
|
|
7476
|
-
|
|
7357
|
+
React28.useEffect(() => {
|
|
7477
7358
|
if (!isAsync) return;
|
|
7478
7359
|
if (debounceRef.current) clearTimeout(debounceRef.current);
|
|
7479
7360
|
if (!term.trim()) {
|
|
@@ -7629,15 +7510,15 @@ function TreeSelect({
|
|
|
7629
7510
|
defaultExpandedKeys = [],
|
|
7630
7511
|
size = "md"
|
|
7631
7512
|
}) {
|
|
7632
|
-
const errorId =
|
|
7513
|
+
const errorId = React28.useId();
|
|
7633
7514
|
const hasError = errorMessage != null;
|
|
7634
|
-
const [open, setOpen] =
|
|
7635
|
-
const [expanded, setExpanded] =
|
|
7636
|
-
const [activeIndex, setActiveIndex] =
|
|
7637
|
-
const listRef =
|
|
7638
|
-
const visible =
|
|
7639
|
-
const didSyncOnOpenRef =
|
|
7640
|
-
|
|
7515
|
+
const [open, setOpen] = React28.useState(false);
|
|
7516
|
+
const [expanded, setExpanded] = React28.useState(() => new Set(defaultExpandedKeys));
|
|
7517
|
+
const [activeIndex, setActiveIndex] = React28.useState(0);
|
|
7518
|
+
const listRef = React28.useRef(null);
|
|
7519
|
+
const visible = React28.useMemo(() => flattenVisible(items, expanded), [items, expanded]);
|
|
7520
|
+
const didSyncOnOpenRef = React28.useRef(false);
|
|
7521
|
+
React28.useEffect(() => {
|
|
7641
7522
|
if (!open) {
|
|
7642
7523
|
didSyncOnOpenRef.current = false;
|
|
7643
7524
|
return;
|
|
@@ -7647,7 +7528,7 @@ function TreeSelect({
|
|
|
7647
7528
|
setActiveIndex(selectedIdx >= 0 ? selectedIdx : 0);
|
|
7648
7529
|
didSyncOnOpenRef.current = true;
|
|
7649
7530
|
}, [open, value]);
|
|
7650
|
-
const selectedNode =
|
|
7531
|
+
const selectedNode = React28.useMemo(
|
|
7651
7532
|
() => value != null ? findNodeByKey(items, value) : null,
|
|
7652
7533
|
[items, value]
|
|
7653
7534
|
);
|
|
@@ -7878,11 +7759,11 @@ function FileInput({
|
|
|
7878
7759
|
required,
|
|
7879
7760
|
icon
|
|
7880
7761
|
}) {
|
|
7881
|
-
const inputRef =
|
|
7882
|
-
const errorId =
|
|
7883
|
-
const [files, setFiles] =
|
|
7884
|
-
const [dragging, setDragging] =
|
|
7885
|
-
const [sizeError, setSizeError] =
|
|
7762
|
+
const inputRef = React28.useRef(null);
|
|
7763
|
+
const errorId = React28.useId();
|
|
7764
|
+
const [files, setFiles] = React28.useState([]);
|
|
7765
|
+
const [dragging, setDragging] = React28.useState(false);
|
|
7766
|
+
const [sizeError, setSizeError] = React28.useState(null);
|
|
7886
7767
|
const effectiveError = errorMessage ?? sizeError ?? void 0;
|
|
7887
7768
|
const openPicker = () => {
|
|
7888
7769
|
if (!disabled) inputRef.current?.click();
|
|
@@ -8028,7 +7909,7 @@ function addDays2(d, n) {
|
|
|
8028
7909
|
c.setDate(c.getDate() + n);
|
|
8029
7910
|
return c;
|
|
8030
7911
|
}
|
|
8031
|
-
function
|
|
7912
|
+
function addMonths2(d, n) {
|
|
8032
7913
|
const c = new Date(d);
|
|
8033
7914
|
c.setMonth(c.getMonth() + n);
|
|
8034
7915
|
return c;
|
|
@@ -8039,7 +7920,7 @@ function defaultFormat3(d) {
|
|
|
8039
7920
|
const day = d.getDate().toString().padStart(2, "0");
|
|
8040
7921
|
return `${y}-${m}-${day}`;
|
|
8041
7922
|
}
|
|
8042
|
-
function
|
|
7923
|
+
function buildGrid(viewMonth, weekStartsOn) {
|
|
8043
7924
|
const first = startOfMonth2(viewMonth);
|
|
8044
7925
|
const startOffset = (first.getDay() - weekStartsOn + 7) % 7;
|
|
8045
7926
|
const gridStart = addDays2(first, -startOffset);
|
|
@@ -8073,30 +7954,30 @@ function DatePicker({
|
|
|
8073
7954
|
size = "md",
|
|
8074
7955
|
className = ""
|
|
8075
7956
|
}) {
|
|
8076
|
-
const errorId =
|
|
7957
|
+
const errorId = React28.useId();
|
|
8077
7958
|
const hasError = errorMessage != null;
|
|
8078
|
-
const [open, setOpen] =
|
|
8079
|
-
const [viewMonth, setViewMonth] =
|
|
8080
|
-
const [focusDate, setFocusDate] =
|
|
8081
|
-
const [view, setView] =
|
|
8082
|
-
const gridRef =
|
|
8083
|
-
|
|
7959
|
+
const [open, setOpen] = React28.useState(false);
|
|
7960
|
+
const [viewMonth, setViewMonth] = React28.useState(() => startOfMonth2(value ?? /* @__PURE__ */ new Date()));
|
|
7961
|
+
const [focusDate, setFocusDate] = React28.useState(() => value ?? /* @__PURE__ */ new Date());
|
|
7962
|
+
const [view, setView] = React28.useState("days");
|
|
7963
|
+
const gridRef = React28.useRef(null);
|
|
7964
|
+
React28.useEffect(() => {
|
|
8084
7965
|
if (!open) return;
|
|
8085
7966
|
const target = value ?? /* @__PURE__ */ new Date();
|
|
8086
7967
|
setViewMonth(startOfMonth2(target));
|
|
8087
7968
|
setFocusDate(target);
|
|
8088
7969
|
setView("days");
|
|
8089
7970
|
}, [open, value]);
|
|
8090
|
-
|
|
7971
|
+
React28.useEffect(() => {
|
|
8091
7972
|
if (!open) return;
|
|
8092
7973
|
const cell = gridRef.current?.querySelector(`[data-day="${defaultFormat3(focusDate)}"]`);
|
|
8093
7974
|
cell?.focus();
|
|
8094
7975
|
}, [open, focusDate]);
|
|
8095
|
-
const weekdays =
|
|
7976
|
+
const weekdays = React28.useMemo(() => {
|
|
8096
7977
|
const ordered = WEEKDAY_SHORT.slice(weekStartsOn).concat(WEEKDAY_SHORT.slice(0, weekStartsOn));
|
|
8097
7978
|
return ordered;
|
|
8098
7979
|
}, [weekStartsOn]);
|
|
8099
|
-
const grid =
|
|
7980
|
+
const grid = React28.useMemo(() => buildGrid(viewMonth, weekStartsOn), [viewMonth, weekStartsOn]);
|
|
8100
7981
|
const isDisabled = (d) => {
|
|
8101
7982
|
if (min && d < min) return true;
|
|
8102
7983
|
if (max && d > max) return true;
|
|
@@ -8127,14 +8008,14 @@ function DatePicker({
|
|
|
8127
8008
|
next(7);
|
|
8128
8009
|
} else if (e.key === "PageUp") {
|
|
8129
8010
|
e.preventDefault();
|
|
8130
|
-
const nm =
|
|
8011
|
+
const nm = addMonths2(viewMonth, -1);
|
|
8131
8012
|
setViewMonth(nm);
|
|
8132
|
-
setFocusDate((d) =>
|
|
8013
|
+
setFocusDate((d) => addMonths2(d, -1));
|
|
8133
8014
|
} else if (e.key === "PageDown") {
|
|
8134
8015
|
e.preventDefault();
|
|
8135
|
-
const nm =
|
|
8016
|
+
const nm = addMonths2(viewMonth, 1);
|
|
8136
8017
|
setViewMonth(nm);
|
|
8137
|
-
setFocusDate((d) =>
|
|
8018
|
+
setFocusDate((d) => addMonths2(d, 1));
|
|
8138
8019
|
} else if (e.key === "Home") {
|
|
8139
8020
|
e.preventDefault();
|
|
8140
8021
|
const dow = (focusDate.getDay() - weekStartsOn + 7) % 7;
|
|
@@ -8199,7 +8080,7 @@ function DatePicker({
|
|
|
8199
8080
|
{
|
|
8200
8081
|
type: "button",
|
|
8201
8082
|
onClick: () => {
|
|
8202
|
-
if (view === "days") setViewMonth(
|
|
8083
|
+
if (view === "days") setViewMonth(addMonths2(viewMonth, -1));
|
|
8203
8084
|
else if (view === "months") setViewMonth(new Date(viewMonth.getFullYear() - 1, viewMonth.getMonth(), 1));
|
|
8204
8085
|
else setViewMonth(new Date(viewMonth.getFullYear() - 10, viewMonth.getMonth(), 1));
|
|
8205
8086
|
},
|
|
@@ -8234,7 +8115,7 @@ function DatePicker({
|
|
|
8234
8115
|
{
|
|
8235
8116
|
type: "button",
|
|
8236
8117
|
onClick: () => {
|
|
8237
|
-
if (view === "days") setViewMonth(
|
|
8118
|
+
if (view === "days") setViewMonth(addMonths2(viewMonth, 1));
|
|
8238
8119
|
else if (view === "months") setViewMonth(new Date(viewMonth.getFullYear() + 1, viewMonth.getMonth(), 1));
|
|
8239
8120
|
else setViewMonth(new Date(viewMonth.getFullYear() + 10, viewMonth.getMonth(), 1));
|
|
8240
8121
|
},
|
|
@@ -8386,10 +8267,10 @@ function TextArea({
|
|
|
8386
8267
|
style,
|
|
8387
8268
|
inputStyle
|
|
8388
8269
|
}) {
|
|
8389
|
-
const errorId =
|
|
8270
|
+
const errorId = React28.useId();
|
|
8390
8271
|
const hasError = errorMessage != null;
|
|
8391
|
-
const ref =
|
|
8392
|
-
|
|
8272
|
+
const ref = React28.useRef(null);
|
|
8273
|
+
React28.useLayoutEffect(() => {
|
|
8393
8274
|
if (!autoGrow) return;
|
|
8394
8275
|
const el = ref.current;
|
|
8395
8276
|
if (!el) return;
|
|
@@ -8461,14 +8342,14 @@ function Slider({
|
|
|
8461
8342
|
name,
|
|
8462
8343
|
htmlFor
|
|
8463
8344
|
}) {
|
|
8464
|
-
const errorId =
|
|
8345
|
+
const errorId = React28.useId();
|
|
8465
8346
|
const hasError = errorMessage != null;
|
|
8466
8347
|
const isRange = Array.isArray(value ?? defaultValue);
|
|
8467
|
-
const [internal, setInternal] =
|
|
8348
|
+
const [internal, setInternal] = React28.useState(
|
|
8468
8349
|
() => toArray(value) ?? toArray(defaultValue) ?? [min]
|
|
8469
8350
|
);
|
|
8470
8351
|
const current = toArray(value) ?? internal;
|
|
8471
|
-
const [dragging, setDragging] =
|
|
8352
|
+
const [dragging, setDragging] = React28.useState(false);
|
|
8472
8353
|
const emit = (arr) => {
|
|
8473
8354
|
setInternal(arr);
|
|
8474
8355
|
const next = isRange ? [arr[0], arr[1]] : arr[0];
|
|
@@ -8563,11 +8444,11 @@ function TagsInput({
|
|
|
8563
8444
|
validate,
|
|
8564
8445
|
separators = ["Enter", ","]
|
|
8565
8446
|
}) {
|
|
8566
|
-
const errorId =
|
|
8567
|
-
const inputRef =
|
|
8568
|
-
const [internal, setInternal] =
|
|
8569
|
-
const [draft, setDraft] =
|
|
8570
|
-
const [localError, setLocalError] =
|
|
8447
|
+
const errorId = React28.useId();
|
|
8448
|
+
const inputRef = React28.useRef(null);
|
|
8449
|
+
const [internal, setInternal] = React28.useState(defaultValue ?? []);
|
|
8450
|
+
const [draft, setDraft] = React28.useState("");
|
|
8451
|
+
const [localError, setLocalError] = React28.useState(null);
|
|
8571
8452
|
const tags = value ?? internal;
|
|
8572
8453
|
const hasError = errorMessage != null || localError != null;
|
|
8573
8454
|
const errorText = errorMessage ?? localError ?? void 0;
|
|
@@ -8698,9 +8579,9 @@ function OtpInput({
|
|
|
8698
8579
|
className,
|
|
8699
8580
|
groupAfter
|
|
8700
8581
|
}) {
|
|
8701
|
-
const errorId =
|
|
8582
|
+
const errorId = React28.useId();
|
|
8702
8583
|
const hasError = errorMessage != null;
|
|
8703
|
-
const refs =
|
|
8584
|
+
const refs = React28.useRef([]);
|
|
8704
8585
|
const chars = Array.from({ length }, (_, i) => value[i] ?? "");
|
|
8705
8586
|
const pattern = mode === "numeric" ? /[0-9]/ : /[a-zA-Z0-9]/;
|
|
8706
8587
|
const emit = (next) => {
|
|
@@ -8749,7 +8630,7 @@ function OtpInput({
|
|
|
8749
8630
|
emit(valid.join(""));
|
|
8750
8631
|
focusBox(valid.length);
|
|
8751
8632
|
};
|
|
8752
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Field, { className, label, htmlFor, errorId, errorMessage, required, layout, helperText, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap items-center gap-2", role: "group", "aria-label": typeof label === "string" ? label : "One-time code", children: chars.map((char, idx) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8633
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Field, { className, label, htmlFor, errorId, errorMessage, required, layout, helperText, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap items-center gap-2", role: "group", "aria-label": typeof label === "string" ? label : "One-time code", children: chars.map((char, idx) => /* @__PURE__ */ jsxRuntime.jsxs(React28__default.default.Fragment, { children: [
|
|
8753
8634
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8754
8635
|
"input",
|
|
8755
8636
|
{
|
|
@@ -8807,9 +8688,9 @@ function Rating({
|
|
|
8807
8688
|
className,
|
|
8808
8689
|
required
|
|
8809
8690
|
}) {
|
|
8810
|
-
const errorId =
|
|
8811
|
-
const [internal, setInternal] =
|
|
8812
|
-
const [hover, setHover] =
|
|
8691
|
+
const errorId = React28.useId();
|
|
8692
|
+
const [internal, setInternal] = React28.useState(defaultValue);
|
|
8693
|
+
const [hover, setHover] = React28.useState(null);
|
|
8813
8694
|
const current = value ?? internal;
|
|
8814
8695
|
const display2 = hover ?? current;
|
|
8815
8696
|
const interactive = !readOnly && !disabled;
|
|
@@ -8932,9 +8813,9 @@ function TimePicker({
|
|
|
8932
8813
|
required,
|
|
8933
8814
|
style
|
|
8934
8815
|
}) {
|
|
8935
|
-
const errorId =
|
|
8816
|
+
const errorId = React28.useId();
|
|
8936
8817
|
const hasError = errorMessage != null;
|
|
8937
|
-
const [open, setOpen] =
|
|
8818
|
+
const [open, setOpen] = React28.useState(false);
|
|
8938
8819
|
const parsed = parse(value) ?? { h: 0, m: 0, s: 0 };
|
|
8939
8820
|
const update = (next) => {
|
|
8940
8821
|
const merged = { ...parsed, ...next };
|
|
@@ -9020,16 +8901,16 @@ function TimePicker({
|
|
|
9020
8901
|
var MONTH_NAMES2 = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
9021
8902
|
var WEEKDAY = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
9022
8903
|
var startOfMonth3 = (d) => new Date(d.getFullYear(), d.getMonth(), 1);
|
|
9023
|
-
var
|
|
8904
|
+
var addMonths3 = (d, n) => new Date(d.getFullYear(), d.getMonth() + n, 1);
|
|
9024
8905
|
var addDays3 = (d, n) => {
|
|
9025
8906
|
const c = new Date(d);
|
|
9026
8907
|
c.setDate(c.getDate() + n);
|
|
9027
8908
|
return c;
|
|
9028
8909
|
};
|
|
9029
8910
|
var isSameDay2 = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
9030
|
-
var
|
|
8911
|
+
var startOfDay2 = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
|
9031
8912
|
var defaultFmt = (d) => `${d.getFullYear()}-${`${d.getMonth() + 1}`.padStart(2, "0")}-${`${d.getDate()}`.padStart(2, "0")}`;
|
|
9032
|
-
function
|
|
8913
|
+
function buildGrid2(viewMonth, weekStartsOn) {
|
|
9033
8914
|
const first = startOfMonth3(viewMonth);
|
|
9034
8915
|
const offset = (first.getDay() - weekStartsOn + 7) % 7;
|
|
9035
8916
|
const gridStart = addDays3(first, -offset);
|
|
@@ -9058,23 +8939,23 @@ function DateRangePicker({
|
|
|
9058
8939
|
required,
|
|
9059
8940
|
style
|
|
9060
8941
|
}) {
|
|
9061
|
-
const errorId =
|
|
8942
|
+
const errorId = React28.useId();
|
|
9062
8943
|
const hasError = errorMessage != null;
|
|
9063
|
-
const [open, setOpen] =
|
|
9064
|
-
const [leftMonth, setLeftMonth] =
|
|
9065
|
-
const [pendingStart, setPendingStart] =
|
|
9066
|
-
const [hoverDate, setHoverDate] =
|
|
9067
|
-
const weekdays =
|
|
8944
|
+
const [open, setOpen] = React28.useState(false);
|
|
8945
|
+
const [leftMonth, setLeftMonth] = React28.useState(() => startOfMonth3(value.start ?? /* @__PURE__ */ new Date()));
|
|
8946
|
+
const [pendingStart, setPendingStart] = React28.useState(null);
|
|
8947
|
+
const [hoverDate, setHoverDate] = React28.useState(null);
|
|
8948
|
+
const weekdays = React28.useMemo(
|
|
9068
8949
|
() => WEEKDAY.slice(weekStartsOn).concat(WEEKDAY.slice(0, weekStartsOn)),
|
|
9069
8950
|
[weekStartsOn]
|
|
9070
8951
|
);
|
|
9071
|
-
const isDisabled = (d) => min && d <
|
|
8952
|
+
const isDisabled = (d) => min && d < startOfDay2(min) || max && d > startOfDay2(max);
|
|
9072
8953
|
const effective = pendingStart ? { start: pendingStart, end: hoverDate } : value;
|
|
9073
8954
|
const inRange = (d) => {
|
|
9074
8955
|
const { start, end } = effective;
|
|
9075
8956
|
if (!start || !end) return false;
|
|
9076
8957
|
const [a, b] = start <= end ? [start, end] : [end, start];
|
|
9077
|
-
return d >=
|
|
8958
|
+
return d >= startOfDay2(a) && d <= startOfDay2(b);
|
|
9078
8959
|
};
|
|
9079
8960
|
const onDayClick = (d) => {
|
|
9080
8961
|
if (isDisabled(d)) return;
|
|
@@ -9092,7 +8973,7 @@ function DateRangePicker({
|
|
|
9092
8973
|
};
|
|
9093
8974
|
const triggerText = value.start && value.end ? `${format(value.start)} \u2013 ${format(value.end)}` : value.start ? `${format(value.start)} \u2013 \u2026` : "";
|
|
9094
8975
|
const renderMonth = (viewMonth) => {
|
|
9095
|
-
const cells =
|
|
8976
|
+
const cells = buildGrid2(viewMonth, weekStartsOn);
|
|
9096
8977
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
9097
8978
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-sm font-semibold text-center mb-2 select-none", children: [
|
|
9098
8979
|
MONTH_NAMES2[viewMonth.getMonth()],
|
|
@@ -9181,7 +9062,7 @@ function DateRangePicker({
|
|
|
9181
9062
|
"button",
|
|
9182
9063
|
{
|
|
9183
9064
|
type: "button",
|
|
9184
|
-
onClick: () => setLeftMonth(
|
|
9065
|
+
onClick: () => setLeftMonth(addMonths3(leftMonth, -1)),
|
|
9185
9066
|
"aria-label": "Previous month",
|
|
9186
9067
|
className: "absolute -top-1 left-0 w-7 h-7 inline-flex items-center justify-center rounded-md hover:bg-surface-raised focus:outline-none focus-visible:ring-2 focus-visible:ring-accent",
|
|
9187
9068
|
children: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "w-4 h-4", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) })
|
|
@@ -9194,13 +9075,13 @@ function DateRangePicker({
|
|
|
9194
9075
|
"button",
|
|
9195
9076
|
{
|
|
9196
9077
|
type: "button",
|
|
9197
|
-
onClick: () => setLeftMonth(
|
|
9078
|
+
onClick: () => setLeftMonth(addMonths3(leftMonth, 1)),
|
|
9198
9079
|
"aria-label": "Next month",
|
|
9199
9080
|
className: "absolute -top-1 right-0 w-7 h-7 inline-flex items-center justify-center rounded-md hover:bg-surface-raised focus:outline-none focus-visible:ring-2 focus-visible:ring-accent",
|
|
9200
9081
|
children: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "w-4 h-4", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) })
|
|
9201
9082
|
}
|
|
9202
9083
|
),
|
|
9203
|
-
renderMonth(
|
|
9084
|
+
renderMonth(addMonths3(leftMonth, 1))
|
|
9204
9085
|
] })
|
|
9205
9086
|
] })
|
|
9206
9087
|
]
|
|
@@ -9240,10 +9121,10 @@ function ColorPicker({
|
|
|
9240
9121
|
required,
|
|
9241
9122
|
placeholder = "Pick a colour\u2026"
|
|
9242
9123
|
}) {
|
|
9243
|
-
const errorId =
|
|
9124
|
+
const errorId = React28.useId();
|
|
9244
9125
|
const hasError = errorMessage != null;
|
|
9245
|
-
const [open, setOpen] =
|
|
9246
|
-
const [draft, setDraft] =
|
|
9126
|
+
const [open, setOpen] = React28.useState(false);
|
|
9127
|
+
const [draft, setDraft] = React28.useState(value);
|
|
9247
9128
|
const valid = HEX_RE.test(value);
|
|
9248
9129
|
const pick = (hex) => {
|
|
9249
9130
|
onChange?.(hex);
|
|
@@ -9330,7 +9211,7 @@ function ColorPicker({
|
|
|
9330
9211
|
}
|
|
9331
9212
|
var CUSTOM_EVENT = "oxy-local-storage";
|
|
9332
9213
|
function useLocalStorage(key, initialValue) {
|
|
9333
|
-
const read =
|
|
9214
|
+
const read = React28.useCallback(() => {
|
|
9334
9215
|
if (typeof window === "undefined") return initialValue;
|
|
9335
9216
|
try {
|
|
9336
9217
|
const item = window.localStorage.getItem(key);
|
|
@@ -9339,8 +9220,8 @@ function useLocalStorage(key, initialValue) {
|
|
|
9339
9220
|
return initialValue;
|
|
9340
9221
|
}
|
|
9341
9222
|
}, [key]);
|
|
9342
|
-
const [stored, setStored] =
|
|
9343
|
-
const setValue =
|
|
9223
|
+
const [stored, setStored] = React28.useState(read);
|
|
9224
|
+
const setValue = React28.useCallback((value) => {
|
|
9344
9225
|
setStored((prev) => {
|
|
9345
9226
|
const next = value instanceof Function ? value(prev) : value;
|
|
9346
9227
|
try {
|
|
@@ -9353,7 +9234,7 @@ function useLocalStorage(key, initialValue) {
|
|
|
9353
9234
|
return next;
|
|
9354
9235
|
});
|
|
9355
9236
|
}, [key]);
|
|
9356
|
-
const remove =
|
|
9237
|
+
const remove = React28.useCallback(() => {
|
|
9357
9238
|
try {
|
|
9358
9239
|
if (typeof window !== "undefined") {
|
|
9359
9240
|
window.localStorage.removeItem(key);
|
|
@@ -9363,10 +9244,10 @@ function useLocalStorage(key, initialValue) {
|
|
|
9363
9244
|
}
|
|
9364
9245
|
setStored(initialValue);
|
|
9365
9246
|
}, [key]);
|
|
9366
|
-
|
|
9247
|
+
React28.useEffect(() => {
|
|
9367
9248
|
setStored(read());
|
|
9368
9249
|
}, [key, read]);
|
|
9369
|
-
|
|
9250
|
+
React28.useEffect(() => {
|
|
9370
9251
|
if (typeof window === "undefined") return;
|
|
9371
9252
|
const onStorage = (e) => {
|
|
9372
9253
|
if (e.key === null || e.key === key) setStored(read());
|
|
@@ -9385,8 +9266,8 @@ function useLocalStorage(key, initialValue) {
|
|
|
9385
9266
|
}
|
|
9386
9267
|
function useMediaQuery(query) {
|
|
9387
9268
|
const get = () => typeof window !== "undefined" && typeof window.matchMedia === "function" ? window.matchMedia(query).matches : false;
|
|
9388
|
-
const [matches, setMatches] =
|
|
9389
|
-
|
|
9269
|
+
const [matches, setMatches] = React28.useState(get);
|
|
9270
|
+
React28.useEffect(() => {
|
|
9390
9271
|
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
|
|
9391
9272
|
const mql = window.matchMedia(query);
|
|
9392
9273
|
const onChange = () => setMatches(mql.matches);
|
|
@@ -9417,8 +9298,8 @@ function decodeSegment(seg) {
|
|
|
9417
9298
|
}
|
|
9418
9299
|
}
|
|
9419
9300
|
function useJwt(token) {
|
|
9420
|
-
const [, tick] =
|
|
9421
|
-
const decoded =
|
|
9301
|
+
const [, tick] = React28.useState(0);
|
|
9302
|
+
const decoded = React28.useMemo(() => {
|
|
9422
9303
|
if (!token) return { payload: null, header: null, exp: null };
|
|
9423
9304
|
const [h, p] = token.split(".");
|
|
9424
9305
|
const header = decodeSegment(h);
|
|
@@ -9426,7 +9307,7 @@ function useJwt(token) {
|
|
|
9426
9307
|
const exp = payload && typeof payload.exp === "number" ? payload.exp : null;
|
|
9427
9308
|
return { payload, header, exp };
|
|
9428
9309
|
}, [token]);
|
|
9429
|
-
|
|
9310
|
+
React28.useEffect(() => {
|
|
9430
9311
|
if (decoded.exp == null) return;
|
|
9431
9312
|
const ms = decoded.exp * 1e3 - Date.now();
|
|
9432
9313
|
if (ms <= 0) return;
|
|
@@ -9464,7 +9345,6 @@ exports.Box = Box;
|
|
|
9464
9345
|
exports.Breadcrumbs = Breadcrumbs;
|
|
9465
9346
|
exports.Button = Button_default;
|
|
9466
9347
|
exports.CARD_BRANDS = CARD_BRANDS;
|
|
9467
|
-
exports.Calendar = Calendar2;
|
|
9468
9348
|
exports.Card = Card_default;
|
|
9469
9349
|
exports.CardCarousel = CardCarousel;
|
|
9470
9350
|
exports.Cart = Cart;
|