@geomak/ui 6.29.0 → 6.29.2
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 +317 -436
- 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 +53 -171
- package/dist/index.js.map +1 -1
- package/dist/styles.css +8 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { colors_default } from './chunk-I2P4JJDB.js';
|
|
2
2
|
export { colors_default as COLORS, PALETTE as palette, semanticTokens, vars } from './chunk-I2P4JJDB.js';
|
|
3
3
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
4
|
-
import
|
|
4
|
+
import React28, { createContext, useState, useEffect, useMemo, useId, useCallback, useRef, useLayoutEffect, useContext, useSyncExternalStore } from 'react';
|
|
5
5
|
import { createPortal } from 'react-dom';
|
|
6
6
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
7
7
|
import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
|
|
@@ -704,7 +704,7 @@ var SIZE_CLASSES = {
|
|
|
704
704
|
md: "h-9 px-4 text-sm gap-1.5 rounded-lg",
|
|
705
705
|
lg: "h-11 px-5 text-sm gap-2 rounded-xl"
|
|
706
706
|
};
|
|
707
|
-
var Button =
|
|
707
|
+
var Button = React28.forwardRef(function Button2({
|
|
708
708
|
content,
|
|
709
709
|
variant = "primary",
|
|
710
710
|
size = "md",
|
|
@@ -812,7 +812,7 @@ function MenuButton({
|
|
|
812
812
|
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
813
813
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"
|
|
814
814
|
].join(" "),
|
|
815
|
-
children: items.map((item) => /* @__PURE__ */ jsxs(
|
|
815
|
+
children: items.map((item) => /* @__PURE__ */ jsxs(React28.Fragment, { children: [
|
|
816
816
|
item.separatorBefore && /* @__PURE__ */ jsx(DropdownMenu.Separator, { className: "my-1 h-px bg-border" }),
|
|
817
817
|
/* @__PURE__ */ jsxs(
|
|
818
818
|
DropdownMenu.Item,
|
|
@@ -1911,7 +1911,7 @@ function Kbd({
|
|
|
1911
1911
|
style
|
|
1912
1912
|
}) {
|
|
1913
1913
|
if (keys && keys.length > 0) {
|
|
1914
|
-
return /* @__PURE__ */ jsx("span", { className: ["inline-flex items-center gap-1", className].filter(Boolean).join(" "), style, children: keys.map((k, i) => /* @__PURE__ */ jsxs(
|
|
1914
|
+
return /* @__PURE__ */ jsx("span", { className: ["inline-flex items-center gap-1", className].filter(Boolean).join(" "), style, children: keys.map((k, i) => /* @__PURE__ */ jsxs(React28.Fragment, { children: [
|
|
1915
1915
|
i > 0 && /* @__PURE__ */ jsx("span", { className: "text-foreground-muted text-xs select-none", children: separator }),
|
|
1916
1916
|
/* @__PURE__ */ jsx("kbd", { className: [cap, SIZE3[size]].join(" "), children: k })
|
|
1917
1917
|
] }, `${k}-${i}`)) });
|
|
@@ -2003,7 +2003,7 @@ function FlatCarousel({
|
|
|
2003
2003
|
style
|
|
2004
2004
|
}) {
|
|
2005
2005
|
const scrollerRef = useRef(null);
|
|
2006
|
-
const slides =
|
|
2006
|
+
const slides = React28.Children.toArray(children);
|
|
2007
2007
|
const [active, setActive] = useState(0);
|
|
2008
2008
|
const [atStart, setAtStart] = useState(true);
|
|
2009
2009
|
const [atEnd, setAtEnd] = useState(false);
|
|
@@ -2058,7 +2058,7 @@ function RotatingCarousel({
|
|
|
2058
2058
|
className = "",
|
|
2059
2059
|
style
|
|
2060
2060
|
}) {
|
|
2061
|
-
const slides =
|
|
2061
|
+
const slides = React28.Children.toArray(children);
|
|
2062
2062
|
const count = slides.length;
|
|
2063
2063
|
const [active, setActive] = useState(0);
|
|
2064
2064
|
const reduced = useReducedMotion();
|
|
@@ -2786,125 +2786,6 @@ function LogoutTimer({
|
|
|
2786
2786
|
] })
|
|
2787
2787
|
] }) });
|
|
2788
2788
|
}
|
|
2789
|
-
var WEEKDAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
2790
|
-
var MONTHS = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
2791
|
-
var startOfDay = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
|
2792
|
-
var sameDay = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
2793
|
-
var addMonths = (d, n) => new Date(d.getFullYear(), d.getMonth() + n, 1);
|
|
2794
|
-
function buildGrid(month, weekStartsOn) {
|
|
2795
|
-
const first = new Date(month.getFullYear(), month.getMonth(), 1);
|
|
2796
|
-
const offset = (first.getDay() - weekStartsOn + 7) % 7;
|
|
2797
|
-
const start = new Date(first);
|
|
2798
|
-
start.setDate(first.getDate() - offset);
|
|
2799
|
-
return Array.from({ length: 42 }, (_, i) => {
|
|
2800
|
-
const d = new Date(start);
|
|
2801
|
-
d.setDate(start.getDate() + i);
|
|
2802
|
-
return d;
|
|
2803
|
-
});
|
|
2804
|
-
}
|
|
2805
|
-
var NavIcon = ({ dir }) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, "aria-hidden": "true", className: "h-4 w-4", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: dir === "left" ? "M15 19l-7-7 7-7" : "M9 5l7 7-7 7" }) });
|
|
2806
|
-
function Calendar2({
|
|
2807
|
-
value,
|
|
2808
|
-
onChange,
|
|
2809
|
-
month,
|
|
2810
|
-
defaultMonth,
|
|
2811
|
-
onMonthChange,
|
|
2812
|
-
events,
|
|
2813
|
-
min,
|
|
2814
|
-
max,
|
|
2815
|
-
weekStartsOn = 0,
|
|
2816
|
-
className = "",
|
|
2817
|
-
style
|
|
2818
|
-
}) {
|
|
2819
|
-
const today = useMemo(() => startOfDay(/* @__PURE__ */ new Date()), []);
|
|
2820
|
-
const [internalMonth, setInternalMonth] = useState(() => month ?? defaultMonth ?? value ?? today);
|
|
2821
|
-
const visible = month ?? internalMonth;
|
|
2822
|
-
const setMonth = (next) => {
|
|
2823
|
-
onMonthChange?.(next);
|
|
2824
|
-
if (month === void 0) setInternalMonth(next);
|
|
2825
|
-
};
|
|
2826
|
-
const grid = useMemo(() => buildGrid(visible, weekStartsOn), [visible, weekStartsOn]);
|
|
2827
|
-
const weekdays = useMemo(() => Array.from({ length: 7 }, (_, i) => WEEKDAYS[(i + weekStartsOn) % 7]), [weekStartsOn]);
|
|
2828
|
-
const eventsByDay = useMemo(() => {
|
|
2829
|
-
const map = /* @__PURE__ */ new Map();
|
|
2830
|
-
for (const ev of events ?? []) {
|
|
2831
|
-
const key = startOfDay(ev.date).toDateString();
|
|
2832
|
-
const arr = map.get(key) ?? [];
|
|
2833
|
-
arr.push(ev);
|
|
2834
|
-
map.set(key, arr);
|
|
2835
|
-
}
|
|
2836
|
-
return map;
|
|
2837
|
-
}, [events]);
|
|
2838
|
-
const disabled = (d) => min && d < startOfDay(min) || max && d > startOfDay(max);
|
|
2839
|
-
return /* @__PURE__ */ jsxs("div", { className: ["inline-block rounded-lg border border-border bg-surface p-3 select-none", className].filter(Boolean).join(" "), style, children: [
|
|
2840
|
-
/* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center justify-between px-1", children: [
|
|
2841
|
-
/* @__PURE__ */ jsx(
|
|
2842
|
-
"button",
|
|
2843
|
-
{
|
|
2844
|
-
type: "button",
|
|
2845
|
-
"aria-label": "Previous month",
|
|
2846
|
-
onClick: () => setMonth(addMonths(visible, -1)),
|
|
2847
|
-
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",
|
|
2848
|
-
children: /* @__PURE__ */ jsx(NavIcon, { dir: "left" })
|
|
2849
|
-
}
|
|
2850
|
-
),
|
|
2851
|
-
/* @__PURE__ */ jsxs("div", { className: "text-sm font-semibold text-foreground", "aria-live": "polite", children: [
|
|
2852
|
-
MONTHS[visible.getMonth()],
|
|
2853
|
-
" ",
|
|
2854
|
-
visible.getFullYear()
|
|
2855
|
-
] }),
|
|
2856
|
-
/* @__PURE__ */ jsx(
|
|
2857
|
-
"button",
|
|
2858
|
-
{
|
|
2859
|
-
type: "button",
|
|
2860
|
-
"aria-label": "Next month",
|
|
2861
|
-
onClick: () => setMonth(addMonths(visible, 1)),
|
|
2862
|
-
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",
|
|
2863
|
-
children: /* @__PURE__ */ jsx(NavIcon, { dir: "right" })
|
|
2864
|
-
}
|
|
2865
|
-
)
|
|
2866
|
-
] }),
|
|
2867
|
-
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 mb-1", children: weekdays.map((w) => /* @__PURE__ */ jsx("div", { className: "text-center text-[11px] font-medium uppercase tracking-wide text-foreground-muted py-1", children: w }, w)) }),
|
|
2868
|
-
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 gap-0.5", role: "grid", children: grid.map((d, i) => {
|
|
2869
|
-
const inMonth = d.getMonth() === visible.getMonth();
|
|
2870
|
-
const isSelected = value != null && sameDay(d, value);
|
|
2871
|
-
const isToday2 = sameDay(d, today);
|
|
2872
|
-
const isDisabled = disabled(d);
|
|
2873
|
-
const dayEvents = eventsByDay.get(d.toDateString()) ?? [];
|
|
2874
|
-
return /* @__PURE__ */ jsxs(
|
|
2875
|
-
"button",
|
|
2876
|
-
{
|
|
2877
|
-
type: "button",
|
|
2878
|
-
role: "gridcell",
|
|
2879
|
-
"aria-selected": isSelected,
|
|
2880
|
-
"aria-current": isToday2 ? "date" : void 0,
|
|
2881
|
-
disabled: isDisabled,
|
|
2882
|
-
onClick: () => onChange?.(startOfDay(d)),
|
|
2883
|
-
className: [
|
|
2884
|
-
"relative flex h-9 w-9 flex-col items-center justify-center rounded-md text-sm transition-colors",
|
|
2885
|
-
"focus:outline-none focus-visible:ring-2 focus-visible:ring-accent",
|
|
2886
|
-
isSelected ? "bg-accent text-accent-fg font-semibold" : inMonth ? "text-foreground hover:bg-surface-raised" : "text-foreground-muted hover:bg-surface-raised",
|
|
2887
|
-
isDisabled ? "opacity-40 cursor-not-allowed hover:bg-transparent" : "",
|
|
2888
|
-
!isSelected && isToday2 ? "ring-1 ring-inset ring-accent/60" : ""
|
|
2889
|
-
].filter(Boolean).join(" "),
|
|
2890
|
-
children: [
|
|
2891
|
-
/* @__PURE__ */ jsx("span", { className: "leading-none", children: d.getDate() }),
|
|
2892
|
-
dayEvents.length > 0 && /* @__PURE__ */ jsx("span", { className: "absolute bottom-1 flex gap-0.5", children: dayEvents.slice(0, 3).map((ev, j) => /* @__PURE__ */ jsx(
|
|
2893
|
-
"span",
|
|
2894
|
-
{
|
|
2895
|
-
title: ev.label,
|
|
2896
|
-
className: "h-1 w-1 rounded-full",
|
|
2897
|
-
style: { backgroundColor: ev.color ?? (isSelected ? "var(--color-accent-fg)" : "var(--color-accent)") }
|
|
2898
|
-
},
|
|
2899
|
-
j
|
|
2900
|
-
)) })
|
|
2901
|
-
]
|
|
2902
|
-
},
|
|
2903
|
-
i
|
|
2904
|
-
);
|
|
2905
|
-
}) })
|
|
2906
|
-
] });
|
|
2907
|
-
}
|
|
2908
2789
|
var SIZE5 = {
|
|
2909
2790
|
sm: { h: "h-control-sm", text: "text-xs", pad: "px-2.5" },
|
|
2910
2791
|
md: { h: "h-control-md", text: "text-sm", pad: "px-3.5" },
|
|
@@ -3003,7 +2884,7 @@ function SegmentedControl({
|
|
|
3003
2884
|
}
|
|
3004
2885
|
|
|
3005
2886
|
// src/components/core/scheduler.utils.ts
|
|
3006
|
-
var
|
|
2887
|
+
var MONTHS = [
|
|
3007
2888
|
"January",
|
|
3008
2889
|
"February",
|
|
3009
2890
|
"March",
|
|
@@ -3017,23 +2898,23 @@ var MONTHS2 = [
|
|
|
3017
2898
|
"November",
|
|
3018
2899
|
"December"
|
|
3019
2900
|
];
|
|
3020
|
-
var MONTHS_SHORT =
|
|
3021
|
-
var
|
|
2901
|
+
var MONTHS_SHORT = MONTHS.map((m) => m.slice(0, 3));
|
|
2902
|
+
var WEEKDAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
3022
2903
|
var toDate2 = (d) => d instanceof Date ? d : new Date(d);
|
|
3023
|
-
var
|
|
2904
|
+
var startOfDay = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
|
3024
2905
|
var addDays = (d, n) => {
|
|
3025
2906
|
const x = new Date(d);
|
|
3026
2907
|
x.setDate(x.getDate() + n);
|
|
3027
2908
|
return x;
|
|
3028
2909
|
};
|
|
3029
|
-
var
|
|
3030
|
-
var
|
|
3031
|
-
var isToday = (d) =>
|
|
2910
|
+
var addMonths = (d, n) => new Date(d.getFullYear(), d.getMonth() + n, 1);
|
|
2911
|
+
var sameDay = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
2912
|
+
var isToday = (d) => sameDay(d, /* @__PURE__ */ new Date());
|
|
3032
2913
|
var isSameMonth = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth();
|
|
3033
2914
|
var startOfMonth = (d) => new Date(d.getFullYear(), d.getMonth(), 1);
|
|
3034
2915
|
var endOfMonth = (d) => new Date(d.getFullYear(), d.getMonth() + 1, 0);
|
|
3035
2916
|
var startOfWeek = (d, weekStartsOn) => {
|
|
3036
|
-
const x =
|
|
2917
|
+
const x = startOfDay(d);
|
|
3037
2918
|
const diff = (x.getDay() - weekStartsOn + 7) % 7;
|
|
3038
2919
|
return addDays(x, -diff);
|
|
3039
2920
|
};
|
|
@@ -3053,12 +2934,12 @@ var weekRange = (cursor, weekStartsOn) => {
|
|
|
3053
2934
|
const from = startOfWeek(cursor, weekStartsOn);
|
|
3054
2935
|
return { from, to: addDays(from, 6) };
|
|
3055
2936
|
};
|
|
3056
|
-
var weekdayLabels = (weekStartsOn) => Array.from({ length: 7 }, (_, i) =>
|
|
3057
|
-
var monthYearLabel = (d) => `${
|
|
2937
|
+
var weekdayLabels = (weekStartsOn) => Array.from({ length: 7 }, (_, i) => WEEKDAYS[(i + weekStartsOn) % 7]);
|
|
2938
|
+
var monthYearLabel = (d) => `${MONTHS[d.getMonth()]} ${d.getFullYear()}`;
|
|
3058
2939
|
var weekLabel = (cursor, weekStartsOn) => {
|
|
3059
2940
|
const from = startOfWeek(cursor, weekStartsOn);
|
|
3060
2941
|
const to = addDays(from, 6);
|
|
3061
|
-
const m = (d) =>
|
|
2942
|
+
const m = (d) => MONTHS[d.getMonth()].slice(0, 3);
|
|
3062
2943
|
if (from.getMonth() === to.getMonth()) {
|
|
3063
2944
|
return `${m(from)} ${from.getDate()} \u2013 ${to.getDate()}, ${to.getFullYear()}`;
|
|
3064
2945
|
}
|
|
@@ -3134,7 +3015,7 @@ function Scheduler({
|
|
|
3134
3015
|
);
|
|
3135
3016
|
const go = useCallback((delta) => {
|
|
3136
3017
|
setDir(delta);
|
|
3137
|
-
setCursor((c) => view === "month" ?
|
|
3018
|
+
setCursor((c) => view === "month" ? addMonths(c, delta) : addDays(c, delta * 7));
|
|
3138
3019
|
}, [view]);
|
|
3139
3020
|
const goToday = useCallback(() => {
|
|
3140
3021
|
setDir(0);
|
|
@@ -3317,7 +3198,7 @@ function MonthView({
|
|
|
3317
3198
|
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 border-b border-border", children: labels.map((l) => /* @__PURE__ */ jsx("div", { className: "px-2 py-1.5 text-center text-[11px] font-medium uppercase tracking-wide text-foreground-muted", children: l }, l)) }),
|
|
3318
3199
|
/* @__PURE__ */ jsx("div", { className: "grid flex-1 grid-cols-7 grid-rows-6", children: grid.map((day, i) => {
|
|
3319
3200
|
const inMonth = isSameMonth(day, cursor);
|
|
3320
|
-
const dayEvents = events.filter((e) =>
|
|
3201
|
+
const dayEvents = events.filter((e) => sameDay(e.start, day));
|
|
3321
3202
|
const today = isToday(day);
|
|
3322
3203
|
return /* @__PURE__ */ jsxs(
|
|
3323
3204
|
"button",
|
|
@@ -3406,7 +3287,7 @@ function WeekView({
|
|
|
3406
3287
|
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsxs("div", { className: "grid", style: { gridTemplateColumns: `3.5rem repeat(7, 1fr)`, height: gridHeight }, children: [
|
|
3407
3288
|
/* @__PURE__ */ jsx("div", { className: "relative border-r border-border", children: hours.map((h, i) => /* @__PURE__ */ 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)) }),
|
|
3408
3289
|
days.map((day) => {
|
|
3409
|
-
const dayEvents = events.filter((e) =>
|
|
3290
|
+
const dayEvents = events.filter((e) => sameDay(e.start, day) && !e.allDay);
|
|
3410
3291
|
return /* @__PURE__ */ jsxs("div", { className: "relative border-r border-border last:border-r-0", children: [
|
|
3411
3292
|
hours.map((h, i) => /* @__PURE__ */ jsx(
|
|
3412
3293
|
"button",
|
|
@@ -5379,7 +5260,7 @@ function Wizard({
|
|
|
5379
5260
|
] });
|
|
5380
5261
|
}
|
|
5381
5262
|
var SearchIcon = /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", className: "w-4 h-4", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M10.5 3.75a6.75 6.75 0 100 13.5 6.75 6.75 0 000-13.5zM2.25 10.5a8.25 8.25 0 1114.59 5.28l4.69 4.69a.75.75 0 11-1.06 1.06l-4.69-4.69A8.25 8.25 0 012.25 10.5z", clipRule: "evenodd" }) });
|
|
5382
|
-
var SearchInput =
|
|
5263
|
+
var SearchInput = React28.forwardRef(function SearchInput2({ value, onChange, disabled, label, htmlFor, placeholder, name, inputStyle, style, layout = "vertical", size = "md", icon, helperText, className }, ref) {
|
|
5383
5264
|
return /* @__PURE__ */ jsx(Field, { className, label, htmlFor, layout, helperText, children: /* @__PURE__ */ jsxs(
|
|
5384
5265
|
"div",
|
|
5385
5266
|
{
|
|
@@ -5578,7 +5459,7 @@ function TableBody({
|
|
|
5578
5459
|
return /* @__PURE__ */ jsx("tbody", { children: rows.map((row, i) => {
|
|
5579
5460
|
const rowKey = getRowKey(row, i);
|
|
5580
5461
|
const isExpanded = expanded.has(rowKey);
|
|
5581
|
-
return /* @__PURE__ */ jsxs(
|
|
5462
|
+
return /* @__PURE__ */ jsxs(React28.Fragment, { children: [
|
|
5582
5463
|
/* @__PURE__ */ jsxs(
|
|
5583
5464
|
"tr",
|
|
5584
5465
|
{
|
|
@@ -5644,9 +5525,10 @@ function Pagination({
|
|
|
5644
5525
|
}, [serverSide, options.perPage, picker]);
|
|
5645
5526
|
const currentOpt = picker.find((o) => o.key === displayPerPageKey);
|
|
5646
5527
|
const currentPerPageLabel = currentOpt?.label ?? currentOpt?.value ?? options.perPage ?? "";
|
|
5647
|
-
const
|
|
5648
|
-
const
|
|
5649
|
-
const
|
|
5528
|
+
const FOCUS = "focus-visible:!ring-0 focus-visible:!border-accent";
|
|
5529
|
+
const navBtn = (icon, disabled, onClick, title) => /* @__PURE__ */ jsx(Button_default, { variant: "outline", size: "sm", disabled, onClick, icon, className: `w-7 !px-0 ${FOCUS}`, "aria-label": title, title });
|
|
5530
|
+
const chevronRight = /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "h-4 w-4", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 6l6 6-6 6" }) });
|
|
5531
|
+
const doubleChevronRight = /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "h-4 w-4", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 6l6 6-6 6M12 6l6 6-6 6" }) });
|
|
5650
5532
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-end gap-x-4 gap-y-3", children: [
|
|
5651
5533
|
options.withPicker && /* @__PURE__ */ jsxs("div", { className: "mr-auto flex items-center gap-2", children: [
|
|
5652
5534
|
/* @__PURE__ */ jsx("span", { className: "whitespace-nowrap text-xs text-foreground-muted", children: "Rows per page" }),
|
|
@@ -5656,7 +5538,7 @@ function Pagination({
|
|
|
5656
5538
|
variant: "outline",
|
|
5657
5539
|
size: "sm",
|
|
5658
5540
|
side: "top",
|
|
5659
|
-
className:
|
|
5541
|
+
className: FOCUS,
|
|
5660
5542
|
label: String(currentPerPageLabel),
|
|
5661
5543
|
items: picker.map((o) => ({
|
|
5662
5544
|
key: o.key,
|
|
@@ -5672,7 +5554,7 @@ function Pagination({
|
|
|
5672
5554
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
5673
5555
|
navBtn(/* @__PURE__ */ jsx("span", { className: "inline-flex rotate-180", children: doubleChevronRight }), activePage === 0, () => onPageChange(0), "First page"),
|
|
5674
5556
|
navBtn(/* @__PURE__ */ jsx("span", { className: "inline-flex rotate-180", children: chevronRight }), activePage === 0, () => activePage > 0 && onPageChange(activePage - 1), "Previous page"),
|
|
5675
|
-
/* @__PURE__ */ jsxs("span", { className: "px-2 text-
|
|
5557
|
+
/* @__PURE__ */ jsxs("span", { className: "px-2 text-xs tabular-nums text-foreground-secondary select-none", children: [
|
|
5676
5558
|
activePage + 1,
|
|
5677
5559
|
" ",
|
|
5678
5560
|
/* @__PURE__ */ jsxs("span", { className: "text-foreground-muted", children: [
|
|
@@ -6121,8 +6003,8 @@ function MegaMenuLink({ href, icon, description, active, onClick, children, clas
|
|
|
6121
6003
|
function MegaMenuFeatured({ children, className = "" }) {
|
|
6122
6004
|
return /* @__PURE__ */ jsx("div", { className: ["min-w-0 rounded-lg bg-surface-raised border border-border p-4 flex flex-col", className].filter(Boolean).join(" "), children });
|
|
6123
6005
|
}
|
|
6124
|
-
var elementsOfType = (children, type) =>
|
|
6125
|
-
(c) =>
|
|
6006
|
+
var elementsOfType = (children, type) => React28.Children.toArray(children).filter(
|
|
6007
|
+
(c) => React28.isValidElement(c) && c.type === type
|
|
6126
6008
|
);
|
|
6127
6009
|
var MOBILE_CHEVRON = /* @__PURE__ */ jsx(
|
|
6128
6010
|
"svg",
|
|
@@ -6159,9 +6041,9 @@ function MobileLinkRow({ link, onNavigate }) {
|
|
|
6159
6041
|
);
|
|
6160
6042
|
}
|
|
6161
6043
|
function MobilePanel({ panel, onNavigate }) {
|
|
6162
|
-
const nodes =
|
|
6044
|
+
const nodes = React28.Children.toArray(panel.props.children);
|
|
6163
6045
|
return /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-4 px-2 pb-3 pt-1", children: nodes.map((node, i) => {
|
|
6164
|
-
if (!
|
|
6046
|
+
if (!React28.isValidElement(node)) return null;
|
|
6165
6047
|
const el = node;
|
|
6166
6048
|
if (el.type === MegaMenuSection) {
|
|
6167
6049
|
const { title, children } = el.props;
|
|
@@ -6570,7 +6452,7 @@ function ThemeProvider({
|
|
|
6570
6452
|
className = "",
|
|
6571
6453
|
style
|
|
6572
6454
|
}) {
|
|
6573
|
-
const id =
|
|
6455
|
+
const id = React28.useId().replace(/:/g, "");
|
|
6574
6456
|
const scopeClass = `geo-th-${id}`;
|
|
6575
6457
|
const divRef = useRef(null);
|
|
6576
6458
|
useEffect(() => {
|
|
@@ -7991,7 +7873,7 @@ function addDays2(d, n) {
|
|
|
7991
7873
|
c.setDate(c.getDate() + n);
|
|
7992
7874
|
return c;
|
|
7993
7875
|
}
|
|
7994
|
-
function
|
|
7876
|
+
function addMonths2(d, n) {
|
|
7995
7877
|
const c = new Date(d);
|
|
7996
7878
|
c.setMonth(c.getMonth() + n);
|
|
7997
7879
|
return c;
|
|
@@ -8002,7 +7884,7 @@ function defaultFormat3(d) {
|
|
|
8002
7884
|
const day = d.getDate().toString().padStart(2, "0");
|
|
8003
7885
|
return `${y}-${m}-${day}`;
|
|
8004
7886
|
}
|
|
8005
|
-
function
|
|
7887
|
+
function buildGrid(viewMonth, weekStartsOn) {
|
|
8006
7888
|
const first = startOfMonth2(viewMonth);
|
|
8007
7889
|
const startOffset = (first.getDay() - weekStartsOn + 7) % 7;
|
|
8008
7890
|
const gridStart = addDays2(first, -startOffset);
|
|
@@ -8059,7 +7941,7 @@ function DatePicker({
|
|
|
8059
7941
|
const ordered = WEEKDAY_SHORT.slice(weekStartsOn).concat(WEEKDAY_SHORT.slice(0, weekStartsOn));
|
|
8060
7942
|
return ordered;
|
|
8061
7943
|
}, [weekStartsOn]);
|
|
8062
|
-
const grid = useMemo(() =>
|
|
7944
|
+
const grid = useMemo(() => buildGrid(viewMonth, weekStartsOn), [viewMonth, weekStartsOn]);
|
|
8063
7945
|
const isDisabled = (d) => {
|
|
8064
7946
|
if (min && d < min) return true;
|
|
8065
7947
|
if (max && d > max) return true;
|
|
@@ -8090,14 +7972,14 @@ function DatePicker({
|
|
|
8090
7972
|
next(7);
|
|
8091
7973
|
} else if (e.key === "PageUp") {
|
|
8092
7974
|
e.preventDefault();
|
|
8093
|
-
const nm =
|
|
7975
|
+
const nm = addMonths2(viewMonth, -1);
|
|
8094
7976
|
setViewMonth(nm);
|
|
8095
|
-
setFocusDate((d) =>
|
|
7977
|
+
setFocusDate((d) => addMonths2(d, -1));
|
|
8096
7978
|
} else if (e.key === "PageDown") {
|
|
8097
7979
|
e.preventDefault();
|
|
8098
|
-
const nm =
|
|
7980
|
+
const nm = addMonths2(viewMonth, 1);
|
|
8099
7981
|
setViewMonth(nm);
|
|
8100
|
-
setFocusDate((d) =>
|
|
7982
|
+
setFocusDate((d) => addMonths2(d, 1));
|
|
8101
7983
|
} else if (e.key === "Home") {
|
|
8102
7984
|
e.preventDefault();
|
|
8103
7985
|
const dow = (focusDate.getDay() - weekStartsOn + 7) % 7;
|
|
@@ -8162,7 +8044,7 @@ function DatePicker({
|
|
|
8162
8044
|
{
|
|
8163
8045
|
type: "button",
|
|
8164
8046
|
onClick: () => {
|
|
8165
|
-
if (view === "days") setViewMonth(
|
|
8047
|
+
if (view === "days") setViewMonth(addMonths2(viewMonth, -1));
|
|
8166
8048
|
else if (view === "months") setViewMonth(new Date(viewMonth.getFullYear() - 1, viewMonth.getMonth(), 1));
|
|
8167
8049
|
else setViewMonth(new Date(viewMonth.getFullYear() - 10, viewMonth.getMonth(), 1));
|
|
8168
8050
|
},
|
|
@@ -8197,7 +8079,7 @@ function DatePicker({
|
|
|
8197
8079
|
{
|
|
8198
8080
|
type: "button",
|
|
8199
8081
|
onClick: () => {
|
|
8200
|
-
if (view === "days") setViewMonth(
|
|
8082
|
+
if (view === "days") setViewMonth(addMonths2(viewMonth, 1));
|
|
8201
8083
|
else if (view === "months") setViewMonth(new Date(viewMonth.getFullYear() + 1, viewMonth.getMonth(), 1));
|
|
8202
8084
|
else setViewMonth(new Date(viewMonth.getFullYear() + 10, viewMonth.getMonth(), 1));
|
|
8203
8085
|
},
|
|
@@ -8712,7 +8594,7 @@ function OtpInput({
|
|
|
8712
8594
|
emit(valid.join(""));
|
|
8713
8595
|
focusBox(valid.length);
|
|
8714
8596
|
};
|
|
8715
|
-
return /* @__PURE__ */ jsx(Field, { className, label, htmlFor, errorId, errorMessage, required, layout, helperText, children: /* @__PURE__ */ 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__ */ jsxs(
|
|
8597
|
+
return /* @__PURE__ */ jsx(Field, { className, label, htmlFor, errorId, errorMessage, required, layout, helperText, children: /* @__PURE__ */ 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__ */ jsxs(React28.Fragment, { children: [
|
|
8716
8598
|
/* @__PURE__ */ jsx(
|
|
8717
8599
|
"input",
|
|
8718
8600
|
{
|
|
@@ -8983,16 +8865,16 @@ function TimePicker({
|
|
|
8983
8865
|
var MONTH_NAMES2 = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
8984
8866
|
var WEEKDAY = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
8985
8867
|
var startOfMonth3 = (d) => new Date(d.getFullYear(), d.getMonth(), 1);
|
|
8986
|
-
var
|
|
8868
|
+
var addMonths3 = (d, n) => new Date(d.getFullYear(), d.getMonth() + n, 1);
|
|
8987
8869
|
var addDays3 = (d, n) => {
|
|
8988
8870
|
const c = new Date(d);
|
|
8989
8871
|
c.setDate(c.getDate() + n);
|
|
8990
8872
|
return c;
|
|
8991
8873
|
};
|
|
8992
8874
|
var isSameDay2 = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
8993
|
-
var
|
|
8875
|
+
var startOfDay2 = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
|
8994
8876
|
var defaultFmt = (d) => `${d.getFullYear()}-${`${d.getMonth() + 1}`.padStart(2, "0")}-${`${d.getDate()}`.padStart(2, "0")}`;
|
|
8995
|
-
function
|
|
8877
|
+
function buildGrid2(viewMonth, weekStartsOn) {
|
|
8996
8878
|
const first = startOfMonth3(viewMonth);
|
|
8997
8879
|
const offset = (first.getDay() - weekStartsOn + 7) % 7;
|
|
8998
8880
|
const gridStart = addDays3(first, -offset);
|
|
@@ -9031,13 +8913,13 @@ function DateRangePicker({
|
|
|
9031
8913
|
() => WEEKDAY.slice(weekStartsOn).concat(WEEKDAY.slice(0, weekStartsOn)),
|
|
9032
8914
|
[weekStartsOn]
|
|
9033
8915
|
);
|
|
9034
|
-
const isDisabled = (d) => min && d <
|
|
8916
|
+
const isDisabled = (d) => min && d < startOfDay2(min) || max && d > startOfDay2(max);
|
|
9035
8917
|
const effective = pendingStart ? { start: pendingStart, end: hoverDate } : value;
|
|
9036
8918
|
const inRange = (d) => {
|
|
9037
8919
|
const { start, end } = effective;
|
|
9038
8920
|
if (!start || !end) return false;
|
|
9039
8921
|
const [a, b] = start <= end ? [start, end] : [end, start];
|
|
9040
|
-
return d >=
|
|
8922
|
+
return d >= startOfDay2(a) && d <= startOfDay2(b);
|
|
9041
8923
|
};
|
|
9042
8924
|
const onDayClick = (d) => {
|
|
9043
8925
|
if (isDisabled(d)) return;
|
|
@@ -9055,7 +8937,7 @@ function DateRangePicker({
|
|
|
9055
8937
|
};
|
|
9056
8938
|
const triggerText = value.start && value.end ? `${format(value.start)} \u2013 ${format(value.end)}` : value.start ? `${format(value.start)} \u2013 \u2026` : "";
|
|
9057
8939
|
const renderMonth = (viewMonth) => {
|
|
9058
|
-
const cells =
|
|
8940
|
+
const cells = buildGrid2(viewMonth, weekStartsOn);
|
|
9059
8941
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
9060
8942
|
/* @__PURE__ */ jsxs("div", { className: "text-sm font-semibold text-center mb-2 select-none", children: [
|
|
9061
8943
|
MONTH_NAMES2[viewMonth.getMonth()],
|
|
@@ -9144,7 +9026,7 @@ function DateRangePicker({
|
|
|
9144
9026
|
"button",
|
|
9145
9027
|
{
|
|
9146
9028
|
type: "button",
|
|
9147
|
-
onClick: () => setLeftMonth(
|
|
9029
|
+
onClick: () => setLeftMonth(addMonths3(leftMonth, -1)),
|
|
9148
9030
|
"aria-label": "Previous month",
|
|
9149
9031
|
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",
|
|
9150
9032
|
children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "w-4 h-4", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) })
|
|
@@ -9157,13 +9039,13 @@ function DateRangePicker({
|
|
|
9157
9039
|
"button",
|
|
9158
9040
|
{
|
|
9159
9041
|
type: "button",
|
|
9160
|
-
onClick: () => setLeftMonth(
|
|
9042
|
+
onClick: () => setLeftMonth(addMonths3(leftMonth, 1)),
|
|
9161
9043
|
"aria-label": "Next month",
|
|
9162
9044
|
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",
|
|
9163
9045
|
children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "w-4 h-4", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) })
|
|
9164
9046
|
}
|
|
9165
9047
|
),
|
|
9166
|
-
renderMonth(
|
|
9048
|
+
renderMonth(addMonths3(leftMonth, 1))
|
|
9167
9049
|
] })
|
|
9168
9050
|
] })
|
|
9169
9051
|
]
|
|
@@ -9402,6 +9284,6 @@ function useJwt(token) {
|
|
|
9402
9284
|
return { payload: decoded.payload, header: decoded.header, expiresAt, isExpired, isValid, raw: token ?? null };
|
|
9403
9285
|
}
|
|
9404
9286
|
|
|
9405
|
-
export { Accordion_default as Accordion, AppShell, AutoComplete, Avatar, Badge, Box, Breadcrumbs, Button_default as Button, CARD_BRANDS,
|
|
9287
|
+
export { Accordion_default as Accordion, AppShell, AutoComplete, Avatar, Badge, Box, Breadcrumbs, Button_default as Button, CARD_BRANDS, Card_default as Card, CardCarousel, Cart, CartButton, CartProvider, Catalog, CatalogCarousel, CatalogGrid, Chat, Checkbox, Checkout, ColorPicker, ContextMenu, CreditCardForm, DateRangePicker, Drawer, Dropdown, EmptyCart, FAB, FadingBase, Field, FieldHelpIcon, FieldLabel, FileInput, Flex, Form, FormContext, FormField, FormStore, Grid2 as Grid, GridCard, icons_default as Icon, IconButton, Kbd, List2 as List, LoadingSpinner, LogoutTimer, MegaMenu_default as MegaMenu, MenuButton, Modal, NotificationProvider, NumberInput, OpaqueGridCard, OtpInput, Password, PopConfirm, Portal, RadioGroup, Rating, ScalableContainer, Scheduler, SearchInput_default as SearchInput, SecureLayout, SegmentedControl, Sidebar, SkeletonBox, SkeletonCard, SkeletonCircle, SkeletonText, Slider, Statistic, Stepper, Switch, Table, Tabs_default as Tabs, TagsInput, DatePicker as Temporal, TextArea, TextInput, ThemeProvider, ThemeSwitch, TimePicker, Timeline, Tooltip, TooltipProvider, TopBar, Tree, TreeSelect, Typography, Wizard, cardNumberError, cvvError, detectBrand, expiryError, fieldShell, formatCardNumber, formatExpiry, isRequired, luhnValid, onlyDigits, patterns, runFieldRules, useBreakpoint, useCart, useFieldArray, useForm, useFormField, useFormStore, useJwt, useLocalStorage, useMediaQuery, useNotification };
|
|
9406
9288
|
//# sourceMappingURL=index.js.map
|
|
9407
9289
|
//# sourceMappingURL=index.js.map
|