@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.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 React29, { createContext, useState, useEffect, useMemo, useId, useCallback, useRef, useLayoutEffect, useContext, useSyncExternalStore } from 'react';
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 = React29.forwardRef(function Button2({
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(React29.Fragment, { children: [
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(React29.Fragment, { children: [
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 = React29.Children.toArray(children);
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 = React29.Children.toArray(children);
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 MONTHS2 = [
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 = MONTHS2.map((m) => m.slice(0, 3));
3021
- var WEEKDAYS2 = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
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 startOfDay2 = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate());
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 addMonths2 = (d, n) => new Date(d.getFullYear(), d.getMonth() + n, 1);
3030
- var sameDay2 = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
3031
- var isToday = (d) => sameDay2(d, /* @__PURE__ */ new Date());
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 = startOfDay2(d);
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) => WEEKDAYS2[(i + weekStartsOn) % 7]);
3057
- var monthYearLabel = (d) => `${MONTHS2[d.getMonth()]} ${d.getFullYear()}`;
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) => MONTHS2[d.getMonth()].slice(0, 3);
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" ? addMonths2(c, delta) : addDays(c, delta * 7));
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) => sameDay2(e.start, day));
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) => sameDay2(e.start, day) && !e.allDay);
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 = React29.forwardRef(function SearchInput2({ value, onChange, disabled, label, htmlFor, placeholder, name, inputStyle, style, layout = "vertical", size = "md", icon, helperText, className }, ref) {
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(React29.Fragment, { children: [
5462
+ return /* @__PURE__ */ jsxs(React28.Fragment, { children: [
5582
5463
  /* @__PURE__ */ jsxs(
5583
5464
  "tr",
5584
5465
  {
@@ -5644,7 +5525,7 @@ 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 navBtn = (icon, disabled, onClick, title) => /* @__PURE__ */ jsx(Button_default, { variant: "outline", size: "sm", disabled, onClick, icon, className: "w-7 !px-0 focus-visible:!ring-offset-0", "aria-label": title, title });
5528
+ const navBtn = (icon, disabled, onClick, title) => /* @__PURE__ */ 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 });
5648
5529
  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 5l7 7-7 7" }) });
5649
5530
  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: "M13 5l7 7-7 7M5 5l7 7-7 7" }) });
5650
5531
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-end gap-x-4 gap-y-3", children: [
@@ -5656,7 +5537,7 @@ function Pagination({
5656
5537
  variant: "outline",
5657
5538
  size: "sm",
5658
5539
  side: "top",
5659
- className: "focus-visible:!ring-offset-0",
5540
+ className: "focus-visible:!ring-[3px] focus-visible:!ring-focus-ring focus-visible:!ring-offset-0",
5660
5541
  label: String(currentPerPageLabel),
5661
5542
  items: picker.map((o) => ({
5662
5543
  key: o.key,
@@ -6121,8 +6002,8 @@ function MegaMenuLink({ href, icon, description, active, onClick, children, clas
6121
6002
  function MegaMenuFeatured({ children, className = "" }) {
6122
6003
  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
6004
  }
6124
- var elementsOfType = (children, type) => React29.Children.toArray(children).filter(
6125
- (c) => React29.isValidElement(c) && c.type === type
6005
+ var elementsOfType = (children, type) => React28.Children.toArray(children).filter(
6006
+ (c) => React28.isValidElement(c) && c.type === type
6126
6007
  );
6127
6008
  var MOBILE_CHEVRON = /* @__PURE__ */ jsx(
6128
6009
  "svg",
@@ -6159,9 +6040,9 @@ function MobileLinkRow({ link, onNavigate }) {
6159
6040
  );
6160
6041
  }
6161
6042
  function MobilePanel({ panel, onNavigate }) {
6162
- const nodes = React29.Children.toArray(panel.props.children);
6043
+ const nodes = React28.Children.toArray(panel.props.children);
6163
6044
  return /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-4 px-2 pb-3 pt-1", children: nodes.map((node, i) => {
6164
- if (!React29.isValidElement(node)) return null;
6045
+ if (!React28.isValidElement(node)) return null;
6165
6046
  const el = node;
6166
6047
  if (el.type === MegaMenuSection) {
6167
6048
  const { title, children } = el.props;
@@ -6570,7 +6451,7 @@ function ThemeProvider({
6570
6451
  className = "",
6571
6452
  style
6572
6453
  }) {
6573
- const id = React29.useId().replace(/:/g, "");
6454
+ const id = React28.useId().replace(/:/g, "");
6574
6455
  const scopeClass = `geo-th-${id}`;
6575
6456
  const divRef = useRef(null);
6576
6457
  useEffect(() => {
@@ -7991,7 +7872,7 @@ function addDays2(d, n) {
7991
7872
  c.setDate(c.getDate() + n);
7992
7873
  return c;
7993
7874
  }
7994
- function addMonths3(d, n) {
7875
+ function addMonths2(d, n) {
7995
7876
  const c = new Date(d);
7996
7877
  c.setMonth(c.getMonth() + n);
7997
7878
  return c;
@@ -8002,7 +7883,7 @@ function defaultFormat3(d) {
8002
7883
  const day = d.getDate().toString().padStart(2, "0");
8003
7884
  return `${y}-${m}-${day}`;
8004
7885
  }
8005
- function buildGrid2(viewMonth, weekStartsOn) {
7886
+ function buildGrid(viewMonth, weekStartsOn) {
8006
7887
  const first = startOfMonth2(viewMonth);
8007
7888
  const startOffset = (first.getDay() - weekStartsOn + 7) % 7;
8008
7889
  const gridStart = addDays2(first, -startOffset);
@@ -8059,7 +7940,7 @@ function DatePicker({
8059
7940
  const ordered = WEEKDAY_SHORT.slice(weekStartsOn).concat(WEEKDAY_SHORT.slice(0, weekStartsOn));
8060
7941
  return ordered;
8061
7942
  }, [weekStartsOn]);
8062
- const grid = useMemo(() => buildGrid2(viewMonth, weekStartsOn), [viewMonth, weekStartsOn]);
7943
+ const grid = useMemo(() => buildGrid(viewMonth, weekStartsOn), [viewMonth, weekStartsOn]);
8063
7944
  const isDisabled = (d) => {
8064
7945
  if (min && d < min) return true;
8065
7946
  if (max && d > max) return true;
@@ -8090,14 +7971,14 @@ function DatePicker({
8090
7971
  next(7);
8091
7972
  } else if (e.key === "PageUp") {
8092
7973
  e.preventDefault();
8093
- const nm = addMonths3(viewMonth, -1);
7974
+ const nm = addMonths2(viewMonth, -1);
8094
7975
  setViewMonth(nm);
8095
- setFocusDate((d) => addMonths3(d, -1));
7976
+ setFocusDate((d) => addMonths2(d, -1));
8096
7977
  } else if (e.key === "PageDown") {
8097
7978
  e.preventDefault();
8098
- const nm = addMonths3(viewMonth, 1);
7979
+ const nm = addMonths2(viewMonth, 1);
8099
7980
  setViewMonth(nm);
8100
- setFocusDate((d) => addMonths3(d, 1));
7981
+ setFocusDate((d) => addMonths2(d, 1));
8101
7982
  } else if (e.key === "Home") {
8102
7983
  e.preventDefault();
8103
7984
  const dow = (focusDate.getDay() - weekStartsOn + 7) % 7;
@@ -8162,7 +8043,7 @@ function DatePicker({
8162
8043
  {
8163
8044
  type: "button",
8164
8045
  onClick: () => {
8165
- if (view === "days") setViewMonth(addMonths3(viewMonth, -1));
8046
+ if (view === "days") setViewMonth(addMonths2(viewMonth, -1));
8166
8047
  else if (view === "months") setViewMonth(new Date(viewMonth.getFullYear() - 1, viewMonth.getMonth(), 1));
8167
8048
  else setViewMonth(new Date(viewMonth.getFullYear() - 10, viewMonth.getMonth(), 1));
8168
8049
  },
@@ -8197,7 +8078,7 @@ function DatePicker({
8197
8078
  {
8198
8079
  type: "button",
8199
8080
  onClick: () => {
8200
- if (view === "days") setViewMonth(addMonths3(viewMonth, 1));
8081
+ if (view === "days") setViewMonth(addMonths2(viewMonth, 1));
8201
8082
  else if (view === "months") setViewMonth(new Date(viewMonth.getFullYear() + 1, viewMonth.getMonth(), 1));
8202
8083
  else setViewMonth(new Date(viewMonth.getFullYear() + 10, viewMonth.getMonth(), 1));
8203
8084
  },
@@ -8712,7 +8593,7 @@ function OtpInput({
8712
8593
  emit(valid.join(""));
8713
8594
  focusBox(valid.length);
8714
8595
  };
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(React29.Fragment, { children: [
8596
+ 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
8597
  /* @__PURE__ */ jsx(
8717
8598
  "input",
8718
8599
  {
@@ -8983,16 +8864,16 @@ function TimePicker({
8983
8864
  var MONTH_NAMES2 = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
8984
8865
  var WEEKDAY = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
8985
8866
  var startOfMonth3 = (d) => new Date(d.getFullYear(), d.getMonth(), 1);
8986
- var addMonths4 = (d, n) => new Date(d.getFullYear(), d.getMonth() + n, 1);
8867
+ var addMonths3 = (d, n) => new Date(d.getFullYear(), d.getMonth() + n, 1);
8987
8868
  var addDays3 = (d, n) => {
8988
8869
  const c = new Date(d);
8989
8870
  c.setDate(c.getDate() + n);
8990
8871
  return c;
8991
8872
  };
8992
8873
  var isSameDay2 = (a, b) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
8993
- var startOfDay3 = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate());
8874
+ var startOfDay2 = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate());
8994
8875
  var defaultFmt = (d) => `${d.getFullYear()}-${`${d.getMonth() + 1}`.padStart(2, "0")}-${`${d.getDate()}`.padStart(2, "0")}`;
8995
- function buildGrid3(viewMonth, weekStartsOn) {
8876
+ function buildGrid2(viewMonth, weekStartsOn) {
8996
8877
  const first = startOfMonth3(viewMonth);
8997
8878
  const offset = (first.getDay() - weekStartsOn + 7) % 7;
8998
8879
  const gridStart = addDays3(first, -offset);
@@ -9031,13 +8912,13 @@ function DateRangePicker({
9031
8912
  () => WEEKDAY.slice(weekStartsOn).concat(WEEKDAY.slice(0, weekStartsOn)),
9032
8913
  [weekStartsOn]
9033
8914
  );
9034
- const isDisabled = (d) => min && d < startOfDay3(min) || max && d > startOfDay3(max);
8915
+ const isDisabled = (d) => min && d < startOfDay2(min) || max && d > startOfDay2(max);
9035
8916
  const effective = pendingStart ? { start: pendingStart, end: hoverDate } : value;
9036
8917
  const inRange = (d) => {
9037
8918
  const { start, end } = effective;
9038
8919
  if (!start || !end) return false;
9039
8920
  const [a, b] = start <= end ? [start, end] : [end, start];
9040
- return d >= startOfDay3(a) && d <= startOfDay3(b);
8921
+ return d >= startOfDay2(a) && d <= startOfDay2(b);
9041
8922
  };
9042
8923
  const onDayClick = (d) => {
9043
8924
  if (isDisabled(d)) return;
@@ -9055,7 +8936,7 @@ function DateRangePicker({
9055
8936
  };
9056
8937
  const triggerText = value.start && value.end ? `${format(value.start)} \u2013 ${format(value.end)}` : value.start ? `${format(value.start)} \u2013 \u2026` : "";
9057
8938
  const renderMonth = (viewMonth) => {
9058
- const cells = buildGrid3(viewMonth, weekStartsOn);
8939
+ const cells = buildGrid2(viewMonth, weekStartsOn);
9059
8940
  return /* @__PURE__ */ jsxs("div", { children: [
9060
8941
  /* @__PURE__ */ jsxs("div", { className: "text-sm font-semibold text-center mb-2 select-none", children: [
9061
8942
  MONTH_NAMES2[viewMonth.getMonth()],
@@ -9144,7 +9025,7 @@ function DateRangePicker({
9144
9025
  "button",
9145
9026
  {
9146
9027
  type: "button",
9147
- onClick: () => setLeftMonth(addMonths4(leftMonth, -1)),
9028
+ onClick: () => setLeftMonth(addMonths3(leftMonth, -1)),
9148
9029
  "aria-label": "Previous month",
9149
9030
  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
9031
  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 +9038,13 @@ function DateRangePicker({
9157
9038
  "button",
9158
9039
  {
9159
9040
  type: "button",
9160
- onClick: () => setLeftMonth(addMonths4(leftMonth, 1)),
9041
+ onClick: () => setLeftMonth(addMonths3(leftMonth, 1)),
9161
9042
  "aria-label": "Next month",
9162
9043
  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
9044
  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
9045
  }
9165
9046
  ),
9166
- renderMonth(addMonths4(leftMonth, 1))
9047
+ renderMonth(addMonths3(leftMonth, 1))
9167
9048
  ] })
9168
9049
  ] })
9169
9050
  ]
@@ -9402,6 +9283,6 @@ function useJwt(token) {
9402
9283
  return { payload: decoded.payload, header: decoded.header, expiresAt, isExpired, isValid, raw: token ?? null };
9403
9284
  }
9404
9285
 
9405
- export { Accordion_default as Accordion, AppShell, AutoComplete, Avatar, Badge, Box, Breadcrumbs, Button_default as Button, CARD_BRANDS, Calendar2 as Calendar, 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 };
9286
+ 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
9287
  //# sourceMappingURL=index.js.map
9407
9288
  //# sourceMappingURL=index.js.map