@geomak/ui 5.0.1 → 5.0.3
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 +250 -156
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +60 -66
- package/dist/index.d.ts +60 -66
- package/dist/index.js +252 -154
- package/dist/index.js.map +1 -1
- package/dist/styles.css +112 -19
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -10,7 +10,6 @@ var TooltipPrimitive = require('@radix-ui/react-tooltip');
|
|
|
10
10
|
var TabsPrimitive = require('@radix-ui/react-tabs');
|
|
11
11
|
var Accordion = require('@radix-ui/react-accordion');
|
|
12
12
|
var ToggleGroup = require('@radix-ui/react-toggle-group');
|
|
13
|
-
var Toast = require('@radix-ui/react-toast');
|
|
14
13
|
var ContextMenuPrimitive = require('@radix-ui/react-context-menu');
|
|
15
14
|
var Popover = require('@radix-ui/react-popover');
|
|
16
15
|
var SwitchPrimitive = require('@radix-ui/react-switch');
|
|
@@ -42,7 +41,6 @@ var TooltipPrimitive__namespace = /*#__PURE__*/_interopNamespace(TooltipPrimitiv
|
|
|
42
41
|
var TabsPrimitive__namespace = /*#__PURE__*/_interopNamespace(TabsPrimitive);
|
|
43
42
|
var Accordion__namespace = /*#__PURE__*/_interopNamespace(Accordion);
|
|
44
43
|
var ToggleGroup__namespace = /*#__PURE__*/_interopNamespace(ToggleGroup);
|
|
45
|
-
var Toast__namespace = /*#__PURE__*/_interopNamespace(Toast);
|
|
46
44
|
var ContextMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(ContextMenuPrimitive);
|
|
47
45
|
var Popover__namespace = /*#__PURE__*/_interopNamespace(Popover);
|
|
48
46
|
var SwitchPrimitive__namespace = /*#__PURE__*/_interopNamespace(SwitchPrimitive);
|
|
@@ -816,12 +814,12 @@ var VIEWPORT_CLASSES = {
|
|
|
816
814
|
function getInitialMotion(pos, reduced) {
|
|
817
815
|
if (reduced) return { opacity: 0, y: 0, scale: 1 };
|
|
818
816
|
const bottom = pos.startsWith("bottom");
|
|
819
|
-
return {
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
};
|
|
817
|
+
return { opacity: 0, y: bottom ? 28 : -28, scale: 0.92 };
|
|
818
|
+
}
|
|
819
|
+
function getExitMotion(pos, reduced) {
|
|
820
|
+
if (reduced) return { opacity: 0, y: 0, scale: 1 };
|
|
821
|
+
const bottom = pos.startsWith("bottom");
|
|
822
|
+
return { opacity: 0, y: bottom ? 18 : -18, scale: 0.94 };
|
|
825
823
|
}
|
|
826
824
|
function TypeIcon({ type }) {
|
|
827
825
|
if (type === "success") {
|
|
@@ -853,66 +851,87 @@ function NotificationItem({
|
|
|
853
851
|
onClose,
|
|
854
852
|
reduced
|
|
855
853
|
}) {
|
|
856
|
-
const [
|
|
857
|
-
const initial = getInitialMotion(pos, reduced);
|
|
858
|
-
const center = pos.endsWith("center");
|
|
854
|
+
const [paused, setPaused] = React8.useState(false);
|
|
859
855
|
const duration = n.duration ?? 4e3;
|
|
860
|
-
const
|
|
856
|
+
const isAutoDismissing = isFinite(duration) && duration > 0;
|
|
857
|
+
const showProgress = !reduced && isAutoDismissing;
|
|
858
|
+
const timerRef = React8.useRef(null);
|
|
859
|
+
const startTimeRef = React8.useRef(0);
|
|
860
|
+
const remainingRef = React8.useRef(duration);
|
|
861
|
+
const clearTimer = React8.useCallback(() => {
|
|
862
|
+
if (timerRef.current !== null) {
|
|
863
|
+
clearTimeout(timerRef.current);
|
|
864
|
+
timerRef.current = null;
|
|
865
|
+
}
|
|
866
|
+
}, []);
|
|
867
|
+
const scheduleDismiss = React8.useCallback((ms) => {
|
|
868
|
+
clearTimer();
|
|
869
|
+
if (!isAutoDismissing) return;
|
|
870
|
+
startTimeRef.current = Date.now();
|
|
871
|
+
timerRef.current = setTimeout(() => onClose(n.id), ms);
|
|
872
|
+
}, [clearTimer, isAutoDismissing, n.id, onClose]);
|
|
873
|
+
React8.useEffect(() => {
|
|
874
|
+
if (paused || !isAutoDismissing) return;
|
|
875
|
+
scheduleDismiss(remainingRef.current);
|
|
876
|
+
return clearTimer;
|
|
877
|
+
}, [paused, isAutoDismissing, scheduleDismiss, clearTimer]);
|
|
878
|
+
const onPauseStart = () => {
|
|
879
|
+
if (!isAutoDismissing) return;
|
|
880
|
+
const elapsed = Date.now() - startTimeRef.current;
|
|
881
|
+
remainingRef.current = Math.max(0, remainingRef.current - elapsed);
|
|
882
|
+
setPaused(true);
|
|
883
|
+
};
|
|
884
|
+
const onPauseEnd = () => {
|
|
885
|
+
if (!isAutoDismissing) return;
|
|
886
|
+
setPaused(false);
|
|
887
|
+
};
|
|
861
888
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
862
889
|
framerMotion.motion.div,
|
|
863
890
|
{
|
|
891
|
+
layout: true,
|
|
864
892
|
className: "pointer-events-auto",
|
|
865
|
-
initial,
|
|
893
|
+
initial: getInitialMotion(pos, reduced),
|
|
866
894
|
animate: { opacity: 1, y: 0, scale: 1 },
|
|
867
|
-
exit:
|
|
868
|
-
opacity: 0,
|
|
869
|
-
y: pos.startsWith("bottom") ? 16 : -16,
|
|
870
|
-
scale: 0.94,
|
|
871
|
-
transition: reduced ? { duration: 0 } : {
|
|
872
|
-
opacity: { duration: 0.14, delay: 0.06 },
|
|
873
|
-
y: { type: "tween", duration: 0.22, ease: [0.4, 0, 1, 1] },
|
|
874
|
-
scale: { type: "tween", duration: 0.22, ease: [0.4, 0, 1, 1] }
|
|
875
|
-
}
|
|
876
|
-
},
|
|
895
|
+
exit: getExitMotion(pos, reduced),
|
|
877
896
|
transition: reduced ? { duration: 0 } : {
|
|
878
|
-
// Opacity finishes in 0.15 s
|
|
879
|
-
//
|
|
897
|
+
// Opacity finishes in 0.15 s; y/scale take 0.34 s.
|
|
898
|
+
// Card is opaque while still travelling — movement
|
|
899
|
+
// is clearly visible to the user.
|
|
880
900
|
opacity: { duration: 0.15 },
|
|
881
901
|
y: { type: "tween", duration: 0.34, ease: [0.16, 1, 0.3, 1] },
|
|
882
|
-
scale: { type: "tween", duration: 0.34, ease: [0.16, 1, 0.3, 1] }
|
|
902
|
+
scale: { type: "tween", duration: 0.34, ease: [0.16, 1, 0.3, 1] },
|
|
903
|
+
layout: { duration: 0.22, ease: [0.16, 1, 0.3, 1] }
|
|
883
904
|
},
|
|
884
|
-
onMouseEnter:
|
|
885
|
-
onMouseLeave:
|
|
905
|
+
onMouseEnter: onPauseStart,
|
|
906
|
+
onMouseLeave: onPauseEnd,
|
|
907
|
+
onFocus: onPauseStart,
|
|
908
|
+
onBlur: onPauseEnd,
|
|
909
|
+
role: n.type === "danger" || n.type === "warning" ? "alert" : "status",
|
|
910
|
+
"aria-live": n.type === "danger" || n.type === "warning" ? "assertive" : "polite",
|
|
886
911
|
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
887
|
-
|
|
912
|
+
"div",
|
|
888
913
|
{
|
|
889
|
-
open: true,
|
|
890
|
-
duration,
|
|
891
|
-
onOpenChange: (o) => {
|
|
892
|
-
if (!o) onClose(n.id);
|
|
893
|
-
},
|
|
894
914
|
className: [
|
|
895
|
-
"w-[300px] rounded-md shadow-lg overflow-hidden",
|
|
896
|
-
center ? "mx-auto" : "",
|
|
897
|
-
"focus:outline-none",
|
|
915
|
+
"w-[300px] rounded-md shadow-lg overflow-hidden focus:outline-none",
|
|
898
916
|
TYPE_BG[n.type ?? "info"]
|
|
899
917
|
].join(" "),
|
|
900
918
|
children: [
|
|
901
919
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3 p-3 pr-2.5", children: [
|
|
902
920
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-0.5 flex-shrink-0 text-white/90", children: /* @__PURE__ */ jsxRuntime.jsx(TypeIcon, { type: n.type ?? "info" }) }),
|
|
903
921
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
904
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
905
|
-
n.description && /* @__PURE__ */ jsxRuntime.jsx(
|
|
922
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm font-semibold text-white leading-snug", children: n.title }),
|
|
923
|
+
n.description && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-0.5 text-xs text-white/75 leading-relaxed", children: n.description })
|
|
906
924
|
] }),
|
|
907
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
925
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
908
926
|
"button",
|
|
909
927
|
{
|
|
910
|
-
|
|
928
|
+
type: "button",
|
|
929
|
+
"aria-label": "Close notification",
|
|
911
930
|
onClick: () => onClose(n.id),
|
|
912
931
|
className: "flex-shrink-0 mt-0.5 rounded p-1 text-white/60 hover:text-white hover:bg-white/15 transition-colors duration-100 focus:outline-none focus-visible:ring-1 focus-visible:ring-white/50",
|
|
913
932
|
children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 3L3 9M3 3l6 6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) })
|
|
914
933
|
}
|
|
915
|
-
)
|
|
934
|
+
)
|
|
916
935
|
] }),
|
|
917
936
|
showProgress && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative h-[3px] bg-white/20 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
918
937
|
"div",
|
|
@@ -920,7 +939,7 @@ function NotificationItem({
|
|
|
920
939
|
className: "absolute inset-0 bg-white/60 [transform-origin:left]",
|
|
921
940
|
style: {
|
|
922
941
|
animation: `notification-progress ${duration}ms linear forwards`,
|
|
923
|
-
animationPlayState:
|
|
942
|
+
animationPlayState: paused ? "paused" : "running"
|
|
924
943
|
}
|
|
925
944
|
}
|
|
926
945
|
) })
|
|
@@ -936,26 +955,27 @@ function NotificationProvider({
|
|
|
936
955
|
}) {
|
|
937
956
|
const [notifications, setNotifications] = React8.useState([]);
|
|
938
957
|
const reduced = framerMotion.useReducedMotion();
|
|
939
|
-
const open = (payload) => {
|
|
958
|
+
const open = React8.useCallback((payload) => {
|
|
940
959
|
setNotifications((prev) => [
|
|
941
960
|
...prev,
|
|
942
961
|
{ duration: 4e3, ...payload, id: Date.now() + Math.random() }
|
|
943
962
|
]);
|
|
944
|
-
};
|
|
945
|
-
const close = (id) => {
|
|
963
|
+
}, []);
|
|
964
|
+
const close = React8.useCallback((id) => {
|
|
946
965
|
setNotifications((prev) => prev.filter((n) => n.id !== id));
|
|
947
|
-
};
|
|
948
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
966
|
+
}, []);
|
|
967
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(NotificationContext.Provider, { value: { open, close }, children: [
|
|
949
968
|
children,
|
|
950
969
|
/* @__PURE__ */ jsxRuntime.jsx(Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
951
|
-
|
|
970
|
+
"ul",
|
|
952
971
|
{
|
|
953
|
-
|
|
972
|
+
role: "region",
|
|
973
|
+
"aria-label": "Notifications",
|
|
954
974
|
className: [
|
|
955
975
|
VIEWPORT_CLASSES[position],
|
|
956
|
-
"z-[500000] gap-2 w-[
|
|
976
|
+
"z-[500000] gap-2 w-[316px] outline-none pointer-events-none m-0 p-0 list-none"
|
|
957
977
|
].join(" "),
|
|
958
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
978
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { initial: false, children: notifications.map((n) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
959
979
|
NotificationItem,
|
|
960
980
|
{
|
|
961
981
|
n,
|
|
@@ -964,10 +984,10 @@ function NotificationProvider({
|
|
|
964
984
|
reduced
|
|
965
985
|
},
|
|
966
986
|
n.id
|
|
967
|
-
)) })
|
|
987
|
+
)) })
|
|
968
988
|
}
|
|
969
989
|
) })
|
|
970
|
-
] })
|
|
990
|
+
] });
|
|
971
991
|
}
|
|
972
992
|
function useNotification() {
|
|
973
993
|
const { open } = React8.useContext(NotificationContext);
|
|
@@ -979,6 +999,9 @@ function useNotification() {
|
|
|
979
999
|
};
|
|
980
1000
|
}
|
|
981
1001
|
var SIZE_MAP = {
|
|
1002
|
+
// xs is sized to fit beside button text (~14px) — async AutoComplete,
|
|
1003
|
+
// Button loading prop, inline status badges, etc.
|
|
1004
|
+
xs: { outer: "w-3.5 h-3.5", inner: "w-1.5 h-1.5", dot: "w-0.5 h-0.5", stroke: "border-[1.5px]", text: "text-[10px]" },
|
|
982
1005
|
sm: { outer: "w-8 h-8", inner: "w-4 h-4", dot: "w-1 h-1", stroke: "border-2", text: "text-xs" },
|
|
983
1006
|
md: { outer: "w-20 h-20", inner: "w-12 h-12", dot: "w-2 h-2", stroke: "border-[3px]", text: "text-2xl" },
|
|
984
1007
|
lg: { outer: "w-32 h-32", inner: "w-20 h-20", dot: "w-3 h-3", stroke: "border-4", text: "text-4xl" }
|
|
@@ -1139,53 +1162,82 @@ function List2({ items, onItemClick, activeKey }) {
|
|
|
1139
1162
|
)
|
|
1140
1163
|
)) });
|
|
1141
1164
|
}
|
|
1165
|
+
var TOGGLE_POSITION_CLASS = {
|
|
1166
|
+
"top-left": "top-2 left-2",
|
|
1167
|
+
"top-right": "top-2 right-2",
|
|
1168
|
+
"bottom-left": "bottom-2 left-2",
|
|
1169
|
+
"bottom-right": "bottom-2 right-2"
|
|
1170
|
+
};
|
|
1142
1171
|
function ScalableContainer({
|
|
1143
|
-
width,
|
|
1144
|
-
height,
|
|
1172
|
+
width = "100%",
|
|
1173
|
+
height = "auto",
|
|
1145
1174
|
children,
|
|
1146
|
-
assignClassOnClick
|
|
1175
|
+
assignClassOnClick,
|
|
1176
|
+
expandIcon,
|
|
1177
|
+
collapseIcon,
|
|
1178
|
+
togglePosition = "top-right"
|
|
1147
1179
|
}) {
|
|
1148
1180
|
const containerRef = React8.useRef(null);
|
|
1149
1181
|
const [isScaled, setScaled] = React8.useState(false);
|
|
1150
|
-
const
|
|
1151
|
-
const
|
|
1182
|
+
const reduced = framerMotion.useReducedMotion();
|
|
1183
|
+
const onToggle = () => {
|
|
1152
1184
|
const next = !isScaled;
|
|
1153
1185
|
setScaled(next);
|
|
1154
|
-
|
|
1155
|
-
containerRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
1156
|
-
if (assignClassOnClick) {
|
|
1157
|
-
setWrapperClass(next ? assignClassOnClick : "");
|
|
1158
|
-
}
|
|
1159
|
-
}, 200);
|
|
1186
|
+
requestAnimationFrame(() => containerRef.current?.scrollIntoView({ behavior: "smooth", block: "nearest" }));
|
|
1160
1187
|
};
|
|
1188
|
+
const wrapperClass = isScaled ? assignClassOnClick : void 0;
|
|
1161
1189
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1162
|
-
|
|
1190
|
+
framerMotion.motion.div,
|
|
1163
1191
|
{
|
|
1164
1192
|
ref: containerRef,
|
|
1165
|
-
|
|
1193
|
+
layout: true,
|
|
1194
|
+
animate: {
|
|
1166
1195
|
width: isScaled ? "100%" : width,
|
|
1167
1196
|
height: isScaled ? "100%" : height
|
|
1168
1197
|
},
|
|
1169
|
-
|
|
1198
|
+
transition: reduced ? { duration: 0 } : {
|
|
1199
|
+
width: { type: "tween", duration: 0.32, ease: [0.16, 1, 0.3, 1] },
|
|
1200
|
+
height: { type: "tween", duration: 0.32, ease: [0.16, 1, 0.3, 1] },
|
|
1201
|
+
layout: { duration: 0.32, ease: [0.16, 1, 0.3, 1] }
|
|
1202
|
+
},
|
|
1203
|
+
className: [
|
|
1204
|
+
"relative rounded-lg overflow-hidden",
|
|
1205
|
+
// OS-window aesthetic: subtle elevation at rest, lifted shadow
|
|
1206
|
+
// when expanded. No background colour change.
|
|
1207
|
+
isScaled ? "shadow-2xl" : "shadow-md",
|
|
1208
|
+
"transition-shadow duration-300"
|
|
1209
|
+
].join(" "),
|
|
1170
1210
|
children: [
|
|
1171
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1172
|
-
|
|
1211
|
+
/* @__PURE__ */ jsxRuntime.jsx(Tooltip, { placement: "bottom", title: isScaled ? "Collapse" : "Expand", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1212
|
+
"button",
|
|
1173
1213
|
{
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1214
|
+
type: "button",
|
|
1215
|
+
onClick: onToggle,
|
|
1216
|
+
"aria-label": isScaled ? "Collapse container" : "Expand container",
|
|
1217
|
+
"aria-expanded": isScaled,
|
|
1218
|
+
className: [
|
|
1219
|
+
"absolute z-10",
|
|
1220
|
+
TOGGLE_POSITION_CLASS[togglePosition],
|
|
1221
|
+
"w-7 h-7 inline-flex items-center justify-center",
|
|
1222
|
+
"rounded-md bg-surface/80 backdrop-blur-sm border border-border",
|
|
1223
|
+
"text-foreground-secondary hover:text-foreground hover:bg-surface",
|
|
1224
|
+
"shadow-sm transition-colors duration-150",
|
|
1225
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-accent"
|
|
1226
|
+
].join(" "),
|
|
1227
|
+
children: isScaled ? collapseIcon ?? /* @__PURE__ */ jsxRuntime.jsx(CollapseIcon, {}) : expandIcon ?? /* @__PURE__ */ jsxRuntime.jsx(ExpandIcon, {})
|
|
1182
1228
|
}
|
|
1183
|
-
) })
|
|
1229
|
+
) }),
|
|
1184
1230
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: wrapperClass, children })
|
|
1185
1231
|
]
|
|
1186
1232
|
}
|
|
1187
1233
|
);
|
|
1188
1234
|
}
|
|
1235
|
+
function CollapseIcon() {
|
|
1236
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "w-4 h-4", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 9L4 4M9 9V4M9 9H4M15 9L20 4M15 9V4M15 9H20M9 15L4 20M9 15V20M9 15H4M15 15L20 20M15 15V20M15 15H20" }) });
|
|
1237
|
+
}
|
|
1238
|
+
function ExpandIcon() {
|
|
1239
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "w-4 h-4", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 8V4h4M20 8V4h-4M4 16v4h4M20 16v4h-4" }) });
|
|
1240
|
+
}
|
|
1189
1241
|
function GridCard({ item, buttonText = "Open Application", onOpen }) {
|
|
1190
1242
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col w-[200px] h-[250px] rounded-lg bg-ice dark:bg-independence items-center justify-between p-2 shadow-2xl", children: [
|
|
1191
1243
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-prussian-blue dark:text-white text-lg font-bold text-center h-1/4", children: /* @__PURE__ */ jsxRuntime.jsx("h2", { children: item.title }) }),
|
|
@@ -1346,49 +1398,6 @@ function CatalogCarousel({ items, buttonText, onOpen }) {
|
|
|
1346
1398
|
function Catalog({ display = "grid", items = [], buttonText, onOpen }) {
|
|
1347
1399
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full", children: display === "grid" ? /* @__PURE__ */ jsxRuntime.jsx(CatalogGrid, { items, buttonText, onOpen }) : /* @__PURE__ */ jsxRuntime.jsx(CatalogCarousel, { items, buttonText, onOpen }) });
|
|
1348
1400
|
}
|
|
1349
|
-
function MenuBarItem({ icon, isActive, title, onClick }) {
|
|
1350
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { title, placement: "right", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1351
|
-
"div",
|
|
1352
|
-
{
|
|
1353
|
-
role: "button",
|
|
1354
|
-
"aria-label": title,
|
|
1355
|
-
"aria-current": isActive ? "page" : void 0,
|
|
1356
|
-
className: `transition duration-300 hover:bg-accent hover:text-accent-fg ${isActive ? "bg-accent text-accent-fg" : "text-foreground-secondary"} rounded-lg p-2 cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-accent`,
|
|
1357
|
-
onClick,
|
|
1358
|
-
tabIndex: 0,
|
|
1359
|
-
onKeyDown: (e) => {
|
|
1360
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
1361
|
-
e.preventDefault();
|
|
1362
|
-
onClick?.();
|
|
1363
|
-
}
|
|
1364
|
-
},
|
|
1365
|
-
children: icon
|
|
1366
|
-
}
|
|
1367
|
-
) });
|
|
1368
|
-
}
|
|
1369
|
-
function MenuBar({ items }) {
|
|
1370
|
-
return (
|
|
1371
|
-
// `calculated-height` was an orphaned CSS class. Replaced with `h-full`
|
|
1372
|
-
// so the MenuBar fills whatever vertical space its parent gives it.
|
|
1373
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1374
|
-
"nav",
|
|
1375
|
-
{
|
|
1376
|
-
"aria-label": "Main navigation",
|
|
1377
|
-
className: "w-16 h-full bg-surface-raised rounded-tr-lg rounded-br-lg flex flex-col gap-2 items-center p-2 z-50",
|
|
1378
|
-
children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1379
|
-
MenuBarItem,
|
|
1380
|
-
{
|
|
1381
|
-
icon: item.icon,
|
|
1382
|
-
title: item.title,
|
|
1383
|
-
isActive: item.isActive,
|
|
1384
|
-
onClick: item.onClick
|
|
1385
|
-
},
|
|
1386
|
-
item.key
|
|
1387
|
-
))
|
|
1388
|
-
}
|
|
1389
|
-
)
|
|
1390
|
-
);
|
|
1391
|
-
}
|
|
1392
1401
|
function ContextMenu({ items, children }) {
|
|
1393
1402
|
return /* @__PURE__ */ jsxRuntime.jsxs(ContextMenuPrimitive__namespace.Root, { children: [
|
|
1394
1403
|
/* @__PURE__ */ jsxRuntime.jsx(ContextMenuPrimitive__namespace.Trigger, { asChild: true, children }),
|
|
@@ -1556,6 +1565,7 @@ function Wizard({
|
|
|
1556
1565
|
const tooltipRef = React8.useRef(null);
|
|
1557
1566
|
const tooltipTitleId = React8.useId();
|
|
1558
1567
|
const tooltipBodyId = React8.useId();
|
|
1568
|
+
const reduced = framerMotion.useReducedMotion();
|
|
1559
1569
|
const [open, setOpen] = React8.useState(() => steps.length > 0 && !readDismissed(storageKey));
|
|
1560
1570
|
const [activeIndex, setActiveIndex] = React8.useState(0);
|
|
1561
1571
|
const step = steps[activeIndex];
|
|
@@ -1599,24 +1609,36 @@ function Wizard({
|
|
|
1599
1609
|
const isLast = activeIndex === steps.length - 1;
|
|
1600
1610
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1601
1611
|
children,
|
|
1602
|
-
open && step && /* @__PURE__ */ jsxRuntime.jsxs(Portal, { children: [
|
|
1612
|
+
/* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: open && step && /* @__PURE__ */ jsxRuntime.jsxs(Portal, { children: [
|
|
1603
1613
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1604
|
-
|
|
1614
|
+
framerMotion.motion.div,
|
|
1605
1615
|
{
|
|
1606
1616
|
className: "fixed inset-0 z-[7000000] bg-foreground/40 backdrop-blur-[1px] pointer-events-auto",
|
|
1617
|
+
initial: { opacity: 0 },
|
|
1618
|
+
animate: { opacity: 1 },
|
|
1619
|
+
exit: { opacity: 0 },
|
|
1620
|
+
transition: { duration: reduced ? 0 : 0.18, ease: "easeOut" },
|
|
1607
1621
|
"aria-hidden": "true"
|
|
1608
1622
|
}
|
|
1609
1623
|
),
|
|
1610
1624
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1611
|
-
|
|
1625
|
+
framerMotion.motion.div,
|
|
1612
1626
|
{
|
|
1613
|
-
className: "fixed z-[7000001] pointer-events-none rounded-md ring-2 ring-accent ring-offset-2 ring-offset-background
|
|
1627
|
+
className: "fixed z-[7000001] pointer-events-none rounded-md ring-2 ring-accent ring-offset-2 ring-offset-background",
|
|
1614
1628
|
style: highlightStyle,
|
|
1629
|
+
initial: { opacity: 0, scale: 1.08 },
|
|
1630
|
+
animate: { opacity: 1, scale: 1 },
|
|
1631
|
+
exit: { opacity: 0, scale: 1.08 },
|
|
1632
|
+
transition: {
|
|
1633
|
+
duration: reduced ? 0 : 0.32,
|
|
1634
|
+
ease: [0.16, 1, 0.3, 1]
|
|
1635
|
+
// ease-out-expo — settles softly
|
|
1636
|
+
},
|
|
1615
1637
|
"aria-hidden": "true"
|
|
1616
1638
|
}
|
|
1617
1639
|
),
|
|
1618
1640
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1619
|
-
|
|
1641
|
+
framerMotion.motion.div,
|
|
1620
1642
|
{
|
|
1621
1643
|
ref: tooltipRef,
|
|
1622
1644
|
role: "dialog",
|
|
@@ -1625,6 +1647,14 @@ function Wizard({
|
|
|
1625
1647
|
"aria-describedby": tooltipBodyId,
|
|
1626
1648
|
className: "fixed z-[7000002] rounded-lg bg-surface text-foreground border border-border shadow-xl p-4 pointer-events-auto",
|
|
1627
1649
|
style: tooltipStyle,
|
|
1650
|
+
initial: { opacity: 0, scale: 0.96, y: 6 },
|
|
1651
|
+
animate: { opacity: 1, scale: 1, y: 0 },
|
|
1652
|
+
exit: { opacity: 0, scale: 0.97, y: 4 },
|
|
1653
|
+
transition: reduced ? { duration: 0 } : {
|
|
1654
|
+
opacity: { duration: 0.18 },
|
|
1655
|
+
scale: { type: "tween", duration: 0.26, ease: [0.16, 1, 0.3, 1] },
|
|
1656
|
+
y: { type: "tween", duration: 0.26, ease: [0.16, 1, 0.3, 1] }
|
|
1657
|
+
},
|
|
1628
1658
|
children: [
|
|
1629
1659
|
step.title && /* @__PURE__ */ jsxRuntime.jsx("h3", { id: tooltipTitleId, className: "text-sm font-semibold text-foreground mb-1", children: step.title }),
|
|
1630
1660
|
/* @__PURE__ */ jsxRuntime.jsx("div", { id: tooltipBodyId, className: "text-sm text-foreground-secondary leading-relaxed", children: step.description }),
|
|
@@ -1664,9 +1694,10 @@ function Wizard({
|
|
|
1664
1694
|
] })
|
|
1665
1695
|
] })
|
|
1666
1696
|
]
|
|
1667
|
-
}
|
|
1697
|
+
},
|
|
1698
|
+
activeIndex
|
|
1668
1699
|
)
|
|
1669
|
-
] })
|
|
1700
|
+
] }) })
|
|
1670
1701
|
] });
|
|
1671
1702
|
}
|
|
1672
1703
|
var SearchInput = React8__default.default.forwardRef(function SearchInput2({
|
|
@@ -1688,7 +1719,7 @@ var SearchInput = React8__default.default.forwardRef(function SearchInput2({
|
|
|
1688
1719
|
style: style ?? {},
|
|
1689
1720
|
children: [
|
|
1690
1721
|
label && /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium ml-1 max-content text-foreground", htmlFor, children: label }),
|
|
1691
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-surface text-foreground flex items-center gap-1 rounded-lg border border-border pr-2 focus-within:ring-2 focus-within:ring-accent transition-colors", children: [
|
|
1722
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-surface text-foreground flex items-center gap-1 rounded-lg border border-border pr-2 focus-within:border-transparent focus-within:ring-2 focus-within:ring-accent transition-colors", children: [
|
|
1692
1723
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1693
1724
|
"input",
|
|
1694
1725
|
{
|
|
@@ -1735,7 +1766,8 @@ function Dropdown({
|
|
|
1735
1766
|
htmlFor,
|
|
1736
1767
|
items = [],
|
|
1737
1768
|
labelStyle = {},
|
|
1738
|
-
placeholder
|
|
1769
|
+
placeholder,
|
|
1770
|
+
showSelectedCount = false
|
|
1739
1771
|
}) {
|
|
1740
1772
|
const [open, setOpen] = React8.useState(false);
|
|
1741
1773
|
const [selectedItems, setSelectedItems] = React8.useState([]);
|
|
@@ -1798,7 +1830,7 @@ function Dropdown({
|
|
|
1798
1830
|
"aria-invalid": hasError || void 0,
|
|
1799
1831
|
"aria-describedby": hasError ? errorId : void 0,
|
|
1800
1832
|
style,
|
|
1801
|
-
className: `flex items-center justify-between relative h-9 rounded-lg border border-border cursor-pointer select-none focus:outline-none focus-visible:ring-2 focus-visible:ring-accent ${disabled ? "cursor-not-allowed bg-surface-raised text-foreground-muted" : "bg-surface text-foreground"} ${hasError ? "border-status-error" : ""}`,
|
|
1833
|
+
className: `flex items-center justify-between relative h-9 rounded-lg border border-border cursor-pointer select-none focus:outline-none focus-visible:border-transparent focus-visible:ring-2 focus-visible:ring-accent ${disabled ? "cursor-not-allowed bg-surface-raised text-foreground-muted" : "bg-surface text-foreground"} ${hasError ? "border-status-error" : ""}`,
|
|
1802
1834
|
tabIndex: disabled ? -1 : 0,
|
|
1803
1835
|
onKeyDown: (e) => {
|
|
1804
1836
|
if (disabled) return;
|
|
@@ -1821,7 +1853,7 @@ function Dropdown({
|
|
|
1821
1853
|
},
|
|
1822
1854
|
String(val)
|
|
1823
1855
|
)),
|
|
1824
|
-
value.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(DropdownPill, { value: `+${value.length - 1} more` })
|
|
1856
|
+
showSelectedCount && value.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(DropdownPill, { value: `+${value.length - 1} more` })
|
|
1825
1857
|
] }) : /* @__PURE__ */ jsxRuntime.jsx(DropdownPill, { value: innerItems.find((it) => it.key === value)?.label })
|
|
1826
1858
|
}
|
|
1827
1859
|
),
|
|
@@ -2620,10 +2652,13 @@ function ThemeProvider({
|
|
|
2620
2652
|
] });
|
|
2621
2653
|
}
|
|
2622
2654
|
var SHIMMER = [
|
|
2623
|
-
"
|
|
2624
|
-
|
|
2625
|
-
"bg-gradient-to-r",
|
|
2626
|
-
"
|
|
2655
|
+
"relative overflow-hidden rounded-sm bg-surface-raised",
|
|
2656
|
+
'before:absolute before:inset-0 before:content-[""]',
|
|
2657
|
+
"before:bg-gradient-to-r before:from-transparent before:via-white/30 before:to-transparent",
|
|
2658
|
+
"before:animate-[shimmer_1.6s_linear_infinite]",
|
|
2659
|
+
// Respect prefers-reduced-motion — the resting bg-surface-raised is still
|
|
2660
|
+
// a perfectly legible placeholder for users who have animations off.
|
|
2661
|
+
"motion-reduce:before:hidden"
|
|
2627
2662
|
].join(" ");
|
|
2628
2663
|
function SkeletonBox({ width, height = 16, radius, className = "", style }) {
|
|
2629
2664
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2761,7 +2796,7 @@ function TextInput({
|
|
|
2761
2796
|
id: htmlFor,
|
|
2762
2797
|
"aria-invalid": hasError || void 0,
|
|
2763
2798
|
"aria-describedby": hasError ? errorId : void 0,
|
|
2764
|
-
className: `${hasError ? "border border-status-error" : "border border-border"} bg-surface text-foreground p-2 h-9 w-60 mt-1 rounded-lg disabled:bg-surface-raised disabled:text-foreground-muted disabled:cursor-not-allowed focus:outline-none focus-
|
|
2799
|
+
className: `${hasError ? "border border-status-error" : "border border-border"} bg-surface text-foreground p-2 h-9 w-60 mt-1 rounded-lg disabled:bg-surface-raised disabled:text-foreground-muted disabled:cursor-not-allowed focus:outline-none focus:border-transparent focus:ring-2 focus:ring-accent transition-colors`,
|
|
2765
2800
|
style: inputStyle ?? {},
|
|
2766
2801
|
placeholder: placeholder ?? ""
|
|
2767
2802
|
}
|
|
@@ -2837,7 +2872,7 @@ function NumberInput({
|
|
|
2837
2872
|
"div",
|
|
2838
2873
|
{
|
|
2839
2874
|
style,
|
|
2840
|
-
className: `flex items-center rounded-lg border overflow-hidden ${hasError ? "border-status-error" : "border-border"} ${disabled ? "bg-surface-raised text-foreground-muted cursor-not-allowed" : "bg-surface text-foreground"} focus-within:ring-2 focus-within:ring-accent transition-colors`,
|
|
2875
|
+
className: `flex items-center rounded-lg border overflow-hidden ${hasError ? "border-status-error" : "border-border"} ${disabled ? "bg-surface-raised text-foreground-muted cursor-not-allowed" : "bg-surface text-foreground"} focus-within:border-transparent focus-within:ring-2 focus-within:ring-accent transition-colors`,
|
|
2841
2876
|
children: [
|
|
2842
2877
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2843
2878
|
"input",
|
|
@@ -2937,7 +2972,7 @@ function Password({
|
|
|
2937
2972
|
id: htmlFor,
|
|
2938
2973
|
"aria-invalid": hasError || void 0,
|
|
2939
2974
|
"aria-describedby": hasError ? errorId : void 0,
|
|
2940
|
-
className: `${hasError ? "border border-status-error" : "border border-border"} bg-surface text-foreground p-2 h-9 w-52 mt-1 rounded-lg disabled:bg-surface-raised disabled:text-foreground-muted disabled:cursor-not-allowed focus:outline-none focus-
|
|
2975
|
+
className: `${hasError ? "border border-status-error" : "border border-border"} bg-surface text-foreground p-2 h-9 w-52 mt-1 rounded-lg disabled:bg-surface-raised disabled:text-foreground-muted disabled:cursor-not-allowed focus:outline-none focus:border-transparent focus:ring-2 focus:ring-accent transition-colors`,
|
|
2941
2976
|
style: inputStyle ?? {},
|
|
2942
2977
|
placeholder: placeholder ?? ""
|
|
2943
2978
|
}
|
|
@@ -3104,7 +3139,7 @@ function AutoComplete({
|
|
|
3104
3139
|
children: [
|
|
3105
3140
|
label && /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium ml-1 max-content text-foreground", children: label }),
|
|
3106
3141
|
/* @__PURE__ */ jsxRuntime.jsxs(Popover__namespace.Root, { open: open && !disabled, onOpenChange: (o) => !disabled && setOpen(o), children: [
|
|
3107
|
-
/* @__PURE__ */ jsxRuntime.jsx(Popover__namespace.Anchor, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-surface text-foreground flex items-center gap-1 rounded-lg border border-border pr-2 focus-within:ring-2 focus-within:ring-accent transition-colors", children: [
|
|
3142
|
+
/* @__PURE__ */ jsxRuntime.jsx(Popover__namespace.Anchor, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-surface text-foreground flex items-center gap-1 rounded-lg border border-border pr-2 focus-within:border-transparent focus-within:ring-2 focus-within:ring-accent transition-colors", children: [
|
|
3108
3143
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3109
3144
|
"input",
|
|
3110
3145
|
{
|
|
@@ -3305,7 +3340,7 @@ function TreeSelect({
|
|
|
3305
3340
|
"aria-invalid": hasError || void 0,
|
|
3306
3341
|
"aria-describedby": hasError ? errorId : void 0,
|
|
3307
3342
|
disabled,
|
|
3308
|
-
className: `flex items-center justify-between h-9 rounded-lg border ${hasError ? "border-status-error" : "border-border"} px-3 cursor-pointer select-none focus:outline-none focus-visible:ring-2 focus-visible:ring-accent ${disabled ? "cursor-not-allowed bg-surface-raised text-foreground-muted" : "bg-surface text-foreground"} ${!style?.width ? "min-w-[240px]" : ""}`,
|
|
3343
|
+
className: `flex items-center justify-between h-9 rounded-lg border ${hasError ? "border-status-error" : "border-border"} px-3 cursor-pointer select-none focus:outline-none focus-visible:border-transparent focus-visible:ring-2 focus-visible:ring-accent ${disabled ? "cursor-not-allowed bg-surface-raised text-foreground-muted" : "bg-surface text-foreground"} ${!style?.width ? "min-w-[240px]" : ""}`,
|
|
3309
3344
|
children: [
|
|
3310
3345
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm truncate text-left", children: selectedNode ? selectedNode.label : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground-muted", children: placeholder }) }),
|
|
3311
3346
|
/* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: `h-4 w-4 flex-shrink-0 transition-transform duration-200 ${open ? "rotate-180" : ""}`, "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) })
|
|
@@ -3598,12 +3633,14 @@ function DatePicker({
|
|
|
3598
3633
|
const [open, setOpen] = React8.useState(false);
|
|
3599
3634
|
const [viewMonth, setViewMonth] = React8.useState(() => startOfMonth(value ?? /* @__PURE__ */ new Date()));
|
|
3600
3635
|
const [focusDate, setFocusDate] = React8.useState(() => value ?? /* @__PURE__ */ new Date());
|
|
3636
|
+
const [view, setView] = React8.useState("days");
|
|
3601
3637
|
const gridRef = React8.useRef(null);
|
|
3602
3638
|
React8.useEffect(() => {
|
|
3603
3639
|
if (!open) return;
|
|
3604
3640
|
const target = value ?? /* @__PURE__ */ new Date();
|
|
3605
3641
|
setViewMonth(startOfMonth(target));
|
|
3606
3642
|
setFocusDate(target);
|
|
3643
|
+
setView("days");
|
|
3607
3644
|
}, [open, value]);
|
|
3608
3645
|
React8.useEffect(() => {
|
|
3609
3646
|
if (!open) return;
|
|
@@ -3692,7 +3729,7 @@ function DatePicker({
|
|
|
3692
3729
|
"aria-describedby": hasError ? errorId : void 0,
|
|
3693
3730
|
"aria-haspopup": "dialog",
|
|
3694
3731
|
"aria-expanded": open,
|
|
3695
|
-
className: `flex items-center justify-between h-9 rounded-lg border px-3 cursor-pointer select-none focus:outline-none focus-visible:ring-2 focus-visible:ring-accent ${hasError ? "border-status-error" : "border-border"} ${disabled ? "cursor-not-allowed bg-surface-raised text-foreground-muted" : "bg-surface text-foreground"} ${!style?.width ? "min-w-[200px]" : ""}`,
|
|
3732
|
+
className: `flex items-center justify-between h-9 rounded-lg border px-3 cursor-pointer select-none focus:outline-none focus-visible:border-transparent focus-visible:ring-2 focus-visible:ring-accent ${hasError ? "border-status-error" : "border-border"} ${disabled ? "cursor-not-allowed bg-surface-raised text-foreground-muted" : "bg-surface text-foreground"} ${!style?.width ? "min-w-[200px]" : ""}`,
|
|
3696
3733
|
children: [
|
|
3697
3734
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `text-sm truncate ${displayValue ? "" : "text-foreground-muted"}`, children: displayValue || placeholder }),
|
|
3698
3735
|
/* @__PURE__ */ jsxRuntime.jsx(CalendarIcon, {})
|
|
@@ -3714,29 +3751,89 @@ function DatePicker({
|
|
|
3714
3751
|
"button",
|
|
3715
3752
|
{
|
|
3716
3753
|
type: "button",
|
|
3717
|
-
onClick: () =>
|
|
3718
|
-
|
|
3754
|
+
onClick: () => {
|
|
3755
|
+
if (view === "days") setViewMonth(addMonths(viewMonth, -1));
|
|
3756
|
+
else if (view === "months") setViewMonth(new Date(viewMonth.getFullYear() - 1, viewMonth.getMonth(), 1));
|
|
3757
|
+
else setViewMonth(new Date(viewMonth.getFullYear() - 10, viewMonth.getMonth(), 1));
|
|
3758
|
+
},
|
|
3759
|
+
"aria-label": view === "days" ? "Previous month" : view === "months" ? "Previous year" : "Previous decade",
|
|
3719
3760
|
className: "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 transition-colors",
|
|
3720
3761
|
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronLeft, {})
|
|
3721
3762
|
}
|
|
3722
3763
|
),
|
|
3723
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3764
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3765
|
+
"button",
|
|
3766
|
+
{
|
|
3767
|
+
type: "button",
|
|
3768
|
+
onClick: () => {
|
|
3769
|
+
if (view === "days") setView("months");
|
|
3770
|
+
else if (view === "months") setView("years");
|
|
3771
|
+
},
|
|
3772
|
+
disabled: view === "years",
|
|
3773
|
+
"aria-label": "Change view",
|
|
3774
|
+
className: "text-sm font-semibold select-none rounded-md px-2 py-0.5 hover:bg-surface-raised focus:outline-none focus-visible:ring-2 focus-visible:ring-accent transition-colors disabled:cursor-default disabled:hover:bg-transparent",
|
|
3775
|
+
children: [
|
|
3776
|
+
view === "days" && `${MONTH_NAMES[viewMonth.getMonth()]} ${viewMonth.getFullYear()}`,
|
|
3777
|
+
view === "months" && `${viewMonth.getFullYear()}`,
|
|
3778
|
+
view === "years" && (() => {
|
|
3779
|
+
const decadeStart = Math.floor(viewMonth.getFullYear() / 10) * 10;
|
|
3780
|
+
return `${decadeStart} \u2013 ${decadeStart + 11}`;
|
|
3781
|
+
})()
|
|
3782
|
+
]
|
|
3783
|
+
}
|
|
3784
|
+
),
|
|
3728
3785
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3729
3786
|
"button",
|
|
3730
3787
|
{
|
|
3731
3788
|
type: "button",
|
|
3732
|
-
onClick: () =>
|
|
3733
|
-
|
|
3789
|
+
onClick: () => {
|
|
3790
|
+
if (view === "days") setViewMonth(addMonths(viewMonth, 1));
|
|
3791
|
+
else if (view === "months") setViewMonth(new Date(viewMonth.getFullYear() + 1, viewMonth.getMonth(), 1));
|
|
3792
|
+
else setViewMonth(new Date(viewMonth.getFullYear() + 10, viewMonth.getMonth(), 1));
|
|
3793
|
+
},
|
|
3794
|
+
"aria-label": view === "days" ? "Next month" : view === "months" ? "Next year" : "Next decade",
|
|
3734
3795
|
className: "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 transition-colors",
|
|
3735
3796
|
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronRight3, {})
|
|
3736
3797
|
}
|
|
3737
3798
|
)
|
|
3738
3799
|
] }),
|
|
3739
|
-
/* @__PURE__ */ jsxRuntime.
|
|
3800
|
+
view === "months" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-3 gap-1 min-w-[224px]", children: MONTH_NAMES.map((name, idx) => {
|
|
3801
|
+
const isCurrent = value && value.getFullYear() === viewMonth.getFullYear() && value.getMonth() === idx;
|
|
3802
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3803
|
+
"button",
|
|
3804
|
+
{
|
|
3805
|
+
type: "button",
|
|
3806
|
+
onClick: () => {
|
|
3807
|
+
setViewMonth(new Date(viewMonth.getFullYear(), idx, 1));
|
|
3808
|
+
setView("days");
|
|
3809
|
+
},
|
|
3810
|
+
className: `px-2 py-2 rounded-md text-xs font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-accent ${isCurrent ? "bg-accent text-accent-fg" : "text-foreground hover:bg-surface-raised"}`,
|
|
3811
|
+
children: name.slice(0, 3)
|
|
3812
|
+
},
|
|
3813
|
+
name
|
|
3814
|
+
);
|
|
3815
|
+
}) }),
|
|
3816
|
+
view === "years" && (() => {
|
|
3817
|
+
const decadeStart = Math.floor(viewMonth.getFullYear() / 10) * 10;
|
|
3818
|
+
const years = Array.from({ length: 12 }, (_, i) => decadeStart + i);
|
|
3819
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-3 gap-1 min-w-[224px]", children: years.map((y) => {
|
|
3820
|
+
const isCurrent = value?.getFullYear() === y;
|
|
3821
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3822
|
+
"button",
|
|
3823
|
+
{
|
|
3824
|
+
type: "button",
|
|
3825
|
+
onClick: () => {
|
|
3826
|
+
setViewMonth(new Date(y, viewMonth.getMonth(), 1));
|
|
3827
|
+
setView("months");
|
|
3828
|
+
},
|
|
3829
|
+
className: `px-2 py-2 rounded-md text-xs font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-accent ${isCurrent ? "bg-accent text-accent-fg" : "text-foreground hover:bg-surface-raised"}`,
|
|
3830
|
+
children: y
|
|
3831
|
+
},
|
|
3832
|
+
y
|
|
3833
|
+
);
|
|
3834
|
+
}) });
|
|
3835
|
+
})(),
|
|
3836
|
+
view === "days" && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3740
3837
|
"table",
|
|
3741
3838
|
{
|
|
3742
3839
|
ref: gridRef,
|
|
@@ -3844,7 +3941,6 @@ exports.Checkbox = Checkbox;
|
|
|
3844
3941
|
exports.ContextMenu = ContextMenu;
|
|
3845
3942
|
exports.Drawer = Drawer;
|
|
3846
3943
|
exports.Dropdown = Dropdown;
|
|
3847
|
-
exports.DropdownPill = DropdownPill;
|
|
3848
3944
|
exports.FadingBase = FadingBase;
|
|
3849
3945
|
exports.FileInput = FileInput;
|
|
3850
3946
|
exports.GridCard = GridCard;
|
|
@@ -3852,8 +3948,6 @@ exports.Icon = icons_default;
|
|
|
3852
3948
|
exports.IconButton = IconButton;
|
|
3853
3949
|
exports.List = List2;
|
|
3854
3950
|
exports.LoadingSpinner = LoadingSpinner;
|
|
3855
|
-
exports.MenuBar = MenuBar;
|
|
3856
|
-
exports.MenuBarItem = MenuBarItem;
|
|
3857
3951
|
exports.Modal = Modal;
|
|
3858
3952
|
exports.NotificationProvider = NotificationProvider;
|
|
3859
3953
|
exports.NumberInput = NumberInput;
|