@sovereignfs/ui 0.92.0 → 0.96.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/README.md +1 -1
- package/dist/AppTile.module.css +100 -0
- package/dist/AvatarStack.module.css +46 -0
- package/dist/DateRangePicker.module.css +33 -0
- package/dist/FloatingActionButton.module.css +70 -0
- package/dist/Map.module.css +110 -0
- package/dist/PhotoGrid.module.css +44 -0
- package/dist/PhotoViewer.module.css +153 -0
- package/dist/chunk-E24U223W.js +36 -0
- package/dist/index.d.ts +173 -3
- package/dist/index.js +1496 -717
- package/dist/map.d.ts +87 -0
- package/dist/map.js +384 -0
- package/package.json +11 -2
package/dist/index.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import {
|
|
3
|
+
useMountTransition,
|
|
4
|
+
usePrefersReducedMotion
|
|
5
|
+
} from "./chunk-E24U223W.js";
|
|
2
6
|
|
|
3
7
|
// src/components/LegalLinks/LegalLinks.tsx
|
|
4
8
|
import styles from "./LegalLinks.module.css";
|
|
@@ -4202,39 +4206,9 @@ function TagInput({
|
|
|
4202
4206
|
}
|
|
4203
4207
|
|
|
4204
4208
|
// src/components/Dialog/Dialog.tsx
|
|
4205
|
-
import { createContext, useContext, useEffect as
|
|
4209
|
+
import { createContext, useContext, useEffect as useEffect4, useRef as useRef6, useState as useState5 } from "react";
|
|
4206
4210
|
import { createPortal } from "react-dom";
|
|
4207
4211
|
|
|
4208
|
-
// src/motion.ts
|
|
4209
|
-
import { useEffect as useEffect4, useState as useState5 } from "react";
|
|
4210
|
-
function useMountTransition(open, durationMs) {
|
|
4211
|
-
const [phase, setPhase] = useState5(open ? "entering" : "closed");
|
|
4212
|
-
useEffect4(() => {
|
|
4213
|
-
if (open) {
|
|
4214
|
-
setPhase("entering");
|
|
4215
|
-
const raf = requestAnimationFrame(() => setPhase("open"));
|
|
4216
|
-
return () => cancelAnimationFrame(raf);
|
|
4217
|
-
}
|
|
4218
|
-
setPhase((p) => p === "closed" ? "closed" : "closing");
|
|
4219
|
-
const timer = setTimeout(() => setPhase("closed"), durationMs);
|
|
4220
|
-
return () => clearTimeout(timer);
|
|
4221
|
-
}, [open, durationMs]);
|
|
4222
|
-
return { mounted: phase !== "closed", phase };
|
|
4223
|
-
}
|
|
4224
|
-
function usePrefersReducedMotion() {
|
|
4225
|
-
const [reduced, setReduced] = useState5(false);
|
|
4226
|
-
useEffect4(() => {
|
|
4227
|
-
const mql = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
4228
|
-
setReduced(mql.matches);
|
|
4229
|
-
function handleChange(e) {
|
|
4230
|
-
setReduced(e.matches);
|
|
4231
|
-
}
|
|
4232
|
-
mql.addEventListener("change", handleChange);
|
|
4233
|
-
return () => mql.removeEventListener("change", handleChange);
|
|
4234
|
-
}, []);
|
|
4235
|
-
return reduced;
|
|
4236
|
-
}
|
|
4237
|
-
|
|
4238
4212
|
// src/components/OverlayHeader/OverlayHeader.tsx
|
|
4239
4213
|
import styles28 from "./OverlayHeader.module.css";
|
|
4240
4214
|
import { jsx as jsx150, jsxs as jsxs124 } from "react/jsx-runtime";
|
|
@@ -4267,7 +4241,7 @@ var OverlaySecondRowContext = createContext(
|
|
|
4267
4241
|
);
|
|
4268
4242
|
function useOverlaySecondRow(node) {
|
|
4269
4243
|
const setSecondRow = useContext(OverlaySecondRowContext);
|
|
4270
|
-
|
|
4244
|
+
useEffect4(() => {
|
|
4271
4245
|
if (!setSecondRow) return;
|
|
4272
4246
|
setSecondRow(node);
|
|
4273
4247
|
return () => setSecondRow(null);
|
|
@@ -4292,7 +4266,7 @@ function Dialog({
|
|
|
4292
4266
|
open,
|
|
4293
4267
|
reducedMotion ? 0 : OVERLAY_MOTION_DURATION_MS
|
|
4294
4268
|
);
|
|
4295
|
-
const [secondRow, setSecondRow] =
|
|
4269
|
+
const [secondRow, setSecondRow] = useState5(null);
|
|
4296
4270
|
const portalTarget = useOverlayPortalTarget();
|
|
4297
4271
|
useOverlayScrollLock(mounted);
|
|
4298
4272
|
useOverlayFocusCapture(panelRef, mounted && portalTarget !== null);
|
|
@@ -4521,7 +4495,7 @@ function Sheet({
|
|
|
4521
4495
|
}
|
|
4522
4496
|
|
|
4523
4497
|
// src/components/ConfirmDialog/ConfirmDialog.tsx
|
|
4524
|
-
import { useEffect as
|
|
4498
|
+
import { useEffect as useEffect5, useRef as useRef9 } from "react";
|
|
4525
4499
|
import styles32 from "./ConfirmDialog.module.css";
|
|
4526
4500
|
import { jsx as jsx154, jsxs as jsxs128 } from "react/jsx-runtime";
|
|
4527
4501
|
function ConfirmDialog({
|
|
@@ -4537,18 +4511,18 @@ function ConfirmDialog({
|
|
|
4537
4511
|
error
|
|
4538
4512
|
}) {
|
|
4539
4513
|
const dialogRef = useRef9(null);
|
|
4540
|
-
|
|
4514
|
+
useEffect5(() => {
|
|
4541
4515
|
if (!open) return;
|
|
4542
4516
|
const id = registerOpenOverlay();
|
|
4543
4517
|
return () => unregisterOpenOverlay(id);
|
|
4544
4518
|
}, [open]);
|
|
4545
|
-
|
|
4519
|
+
useEffect5(() => {
|
|
4546
4520
|
const el = dialogRef.current;
|
|
4547
4521
|
if (!el) return;
|
|
4548
4522
|
if (open) el.showModal();
|
|
4549
4523
|
else el.close();
|
|
4550
4524
|
}, [open]);
|
|
4551
|
-
|
|
4525
|
+
useEffect5(() => {
|
|
4552
4526
|
const el = dialogRef.current;
|
|
4553
4527
|
if (!el) return;
|
|
4554
4528
|
const handleClose = () => onClose();
|
|
@@ -4608,13 +4582,13 @@ function ConfirmDialog({
|
|
|
4608
4582
|
}
|
|
4609
4583
|
|
|
4610
4584
|
// src/hooks/useLongPress.ts
|
|
4611
|
-
import { useCallback as useCallback2, useEffect as
|
|
4585
|
+
import { useCallback as useCallback2, useEffect as useEffect6, useRef as useRef10, useState as useState6 } from "react";
|
|
4612
4586
|
var DEFAULT_DELAY_MS = 500;
|
|
4613
4587
|
var DEFAULT_MOVE_TOLERANCE_PX = 10;
|
|
4614
4588
|
var DEFAULT_SUPPRESS_CLICK_MS = 700;
|
|
4615
4589
|
function usePrefersCoarsePointer() {
|
|
4616
|
-
const [coarse, setCoarse] =
|
|
4617
|
-
|
|
4590
|
+
const [coarse, setCoarse] = useState6(false);
|
|
4591
|
+
useEffect6(() => {
|
|
4618
4592
|
const mql = window.matchMedia("(pointer: coarse)");
|
|
4619
4593
|
setCoarse(mql.matches);
|
|
4620
4594
|
function handleChange(e) {
|
|
@@ -4642,7 +4616,7 @@ function useLongPress({
|
|
|
4642
4616
|
timerRef.current = null;
|
|
4643
4617
|
}
|
|
4644
4618
|
}, []);
|
|
4645
|
-
|
|
4619
|
+
useEffect6(() => clearTimer, [clearTimer]);
|
|
4646
4620
|
const onPointerDown = useCallback2(
|
|
4647
4621
|
(e) => {
|
|
4648
4622
|
if (disabled || e.pointerType !== "touch") return;
|
|
@@ -4745,11 +4719,11 @@ function useSingleOrDoubleTap(onSingle, onDouble) {
|
|
|
4745
4719
|
}
|
|
4746
4720
|
|
|
4747
4721
|
// src/hooks/useIsMobile.ts
|
|
4748
|
-
import { useEffect as
|
|
4722
|
+
import { useEffect as useEffect7, useState as useState7 } from "react";
|
|
4749
4723
|
var MOBILE_BREAKPOINT_PX = 768;
|
|
4750
4724
|
function useIsMobile(breakpointPx = MOBILE_BREAKPOINT_PX) {
|
|
4751
|
-
const [isMobile, setIsMobile] =
|
|
4752
|
-
|
|
4725
|
+
const [isMobile, setIsMobile] = useState7(false);
|
|
4726
|
+
useEffect7(() => {
|
|
4753
4727
|
const mql = window.matchMedia(`(max-width: ${breakpointPx}px)`);
|
|
4754
4728
|
setIsMobile(mql.matches);
|
|
4755
4729
|
function handleChange(e) {
|
|
@@ -4762,10 +4736,10 @@ function useIsMobile(breakpointPx = MOBILE_BREAKPOINT_PX) {
|
|
|
4762
4736
|
}
|
|
4763
4737
|
|
|
4764
4738
|
// src/hooks/useIsOffline.ts
|
|
4765
|
-
import { useEffect as
|
|
4739
|
+
import { useEffect as useEffect8, useState as useState8 } from "react";
|
|
4766
4740
|
function useIsOffline() {
|
|
4767
|
-
const [isOffline, setIsOffline] =
|
|
4768
|
-
|
|
4741
|
+
const [isOffline, setIsOffline] = useState8(false);
|
|
4742
|
+
useEffect8(() => {
|
|
4769
4743
|
setIsOffline(!navigator.onLine);
|
|
4770
4744
|
const handleOffline = () => setIsOffline(true);
|
|
4771
4745
|
const handleOnline = () => setIsOffline(false);
|
|
@@ -4851,7 +4825,7 @@ function useSwipeReveal({
|
|
|
4851
4825
|
}
|
|
4852
4826
|
|
|
4853
4827
|
// src/hooks/useSnapCarousel.ts
|
|
4854
|
-
import { useCallback as useCallback3, useEffect as
|
|
4828
|
+
import { useCallback as useCallback3, useEffect as useEffect9, useRef as useRef13, useState as useState9 } from "react";
|
|
4855
4829
|
function useSnapCarousel({
|
|
4856
4830
|
itemCount,
|
|
4857
4831
|
onSettle,
|
|
@@ -4862,12 +4836,12 @@ function useSnapCarousel({
|
|
|
4862
4836
|
const timerRef = useRef13(null);
|
|
4863
4837
|
const lastIndexRef = useRef13(null);
|
|
4864
4838
|
const restoreSnapRef = useRef13(null);
|
|
4865
|
-
const [liveIndex, setLiveIndex] =
|
|
4839
|
+
const [liveIndex, setLiveIndex] = useState9(initialIndex);
|
|
4866
4840
|
const onSettleRef = useRef13(onSettle);
|
|
4867
4841
|
onSettleRef.current = onSettle;
|
|
4868
4842
|
const lastGestureAtRef = useRef13(0);
|
|
4869
4843
|
const chainTrustedRef = useRef13(false);
|
|
4870
|
-
|
|
4844
|
+
useEffect9(() => {
|
|
4871
4845
|
const el = scrollRef.current;
|
|
4872
4846
|
if (!el) return;
|
|
4873
4847
|
function noteGesture() {
|
|
@@ -4971,7 +4945,7 @@ function useResponsiveLayout({
|
|
|
4971
4945
|
}
|
|
4972
4946
|
|
|
4973
4947
|
// src/hooks/useCarouselRouteSync.ts
|
|
4974
|
-
import { useEffect as
|
|
4948
|
+
import { useEffect as useEffect10, useRef as useRef14, useState as useState10 } from "react";
|
|
4975
4949
|
function useCarouselRouteSync({
|
|
4976
4950
|
indexForPathname,
|
|
4977
4951
|
pathForIndex,
|
|
@@ -4984,10 +4958,10 @@ function useCarouselRouteSync({
|
|
|
4984
4958
|
pathForIndexRef.current = pathForIndex;
|
|
4985
4959
|
const onNavigateRef = useRef14(onNavigate);
|
|
4986
4960
|
onNavigateRef.current = onNavigate;
|
|
4987
|
-
const [activeIndex, setActiveIndex] =
|
|
4961
|
+
const [activeIndex, setActiveIndex] = useState10(() => indexForPathname(pathname));
|
|
4988
4962
|
const isInternalNavRef = useRef14(false);
|
|
4989
4963
|
const didMountRef = useRef14(false);
|
|
4990
|
-
|
|
4964
|
+
useEffect10(() => {
|
|
4991
4965
|
if (!didMountRef.current) {
|
|
4992
4966
|
didMountRef.current = true;
|
|
4993
4967
|
return;
|
|
@@ -5121,10 +5095,10 @@ function useSwipeStack({
|
|
|
5121
5095
|
function flingOut(direction) {
|
|
5122
5096
|
const card = cardRef.current;
|
|
5123
5097
|
if (!card) return;
|
|
5124
|
-
const
|
|
5098
|
+
const distance2 = 1.4 * Math.max(window.innerWidth, window.innerHeight);
|
|
5125
5099
|
const [ux, uy] = UNIT_VECTOR[direction];
|
|
5126
5100
|
card.style.transition = `transform ${SWIPE_STACK_TRANSITION_MS}ms ease`;
|
|
5127
|
-
card.style.transform = `translate(${ux *
|
|
5101
|
+
card.style.transform = `translate(${ux * distance2}px, ${uy * distance2}px) rotate(${ux * ROTATION_MAX_DEG}deg)`;
|
|
5128
5102
|
}
|
|
5129
5103
|
function onPointerDown(e) {
|
|
5130
5104
|
if (disabled) return;
|
|
@@ -5159,8 +5133,8 @@ function useSwipeStack({
|
|
|
5159
5133
|
);
|
|
5160
5134
|
const direction = resolveDirection(dx, dy, live);
|
|
5161
5135
|
writeProgress(null, 0);
|
|
5162
|
-
const
|
|
5163
|
-
if (direction &&
|
|
5136
|
+
const distance2 = Math.max(Math.abs(dx), Math.abs(dy));
|
|
5137
|
+
if (direction && distance2 >= threshold) {
|
|
5164
5138
|
flingOut(direction);
|
|
5165
5139
|
onCommit(direction);
|
|
5166
5140
|
} else {
|
|
@@ -5269,7 +5243,7 @@ function Menu({
|
|
|
5269
5243
|
}
|
|
5270
5244
|
|
|
5271
5245
|
// src/components/UserMenu/UserMenu.tsx
|
|
5272
|
-
import { useState as
|
|
5246
|
+
import { useState as useState11 } from "react";
|
|
5273
5247
|
import styles34 from "./UserMenu.module.css";
|
|
5274
5248
|
import { jsx as jsx156, jsxs as jsxs130 } from "react/jsx-runtime";
|
|
5275
5249
|
function initials(value) {
|
|
@@ -5287,7 +5261,7 @@ function UserMenu({
|
|
|
5287
5261
|
align = "right",
|
|
5288
5262
|
size = "md"
|
|
5289
5263
|
}) {
|
|
5290
|
-
const [open, setOpen] =
|
|
5264
|
+
const [open, setOpen] = useState11(false);
|
|
5291
5265
|
const displayName = name || email || "";
|
|
5292
5266
|
return /* @__PURE__ */ jsxs130(
|
|
5293
5267
|
Popover,
|
|
@@ -5336,7 +5310,7 @@ function UserMenu({
|
|
|
5336
5310
|
}
|
|
5337
5311
|
|
|
5338
5312
|
// src/components/AppsLauncher/AppsLauncher.tsx
|
|
5339
|
-
import { useState as
|
|
5313
|
+
import { useState as useState12 } from "react";
|
|
5340
5314
|
|
|
5341
5315
|
// src/components/Spinner/Spinner.tsx
|
|
5342
5316
|
import styles35 from "./Spinner.module.css";
|
|
@@ -5379,7 +5353,7 @@ function AppsLauncher({
|
|
|
5379
5353
|
"aria-label": ariaLabel = "Apps",
|
|
5380
5354
|
align = "right"
|
|
5381
5355
|
}) {
|
|
5382
|
-
const [open, setOpen] =
|
|
5356
|
+
const [open, setOpen] = useState12(false);
|
|
5383
5357
|
return /* @__PURE__ */ jsxs131(
|
|
5384
5358
|
Popover,
|
|
5385
5359
|
{
|
|
@@ -5409,7 +5383,7 @@ function AppsLauncher({
|
|
|
5409
5383
|
}
|
|
5410
5384
|
|
|
5411
5385
|
// src/components/NotificationsPanel/NotificationsPanel.tsx
|
|
5412
|
-
import { useState as
|
|
5386
|
+
import { useState as useState13 } from "react";
|
|
5413
5387
|
import styles37 from "./NotificationsPanel.module.css";
|
|
5414
5388
|
import { Fragment as Fragment5, jsx as jsx159, jsxs as jsxs132 } from "react/jsx-runtime";
|
|
5415
5389
|
function NotificationRow({ item }) {
|
|
@@ -5454,7 +5428,7 @@ function NotificationsPanel({
|
|
|
5454
5428
|
align = "right",
|
|
5455
5429
|
viewAllHref
|
|
5456
5430
|
}) {
|
|
5457
|
-
const [open, setOpen] =
|
|
5431
|
+
const [open, setOpen] = useState13(false);
|
|
5458
5432
|
return /* @__PURE__ */ jsxs132(
|
|
5459
5433
|
Popover,
|
|
5460
5434
|
{
|
|
@@ -5513,11 +5487,11 @@ import {
|
|
|
5513
5487
|
createContext as createContext2,
|
|
5514
5488
|
useCallback as useCallback4,
|
|
5515
5489
|
useContext as useContext2,
|
|
5516
|
-
useEffect as
|
|
5490
|
+
useEffect as useEffect11,
|
|
5517
5491
|
useId as useId3,
|
|
5518
5492
|
useMemo as useMemo2,
|
|
5519
5493
|
useRef as useRef16,
|
|
5520
|
-
useState as
|
|
5494
|
+
useState as useState14
|
|
5521
5495
|
} from "react";
|
|
5522
5496
|
import styles38 from "./Toast.module.css";
|
|
5523
5497
|
import { jsx as jsx160, jsxs as jsxs133 } from "react/jsx-runtime";
|
|
@@ -5528,7 +5502,7 @@ function useToast() {
|
|
|
5528
5502
|
return ctx;
|
|
5529
5503
|
}
|
|
5530
5504
|
function ToastProvider({ children }) {
|
|
5531
|
-
const [toasts, setToasts] =
|
|
5505
|
+
const [toasts, setToasts] = useState14([]);
|
|
5532
5506
|
const timers = useRef16(/* @__PURE__ */ new Map());
|
|
5533
5507
|
const seedId = useId3();
|
|
5534
5508
|
const counter = useRef16(0);
|
|
@@ -5551,7 +5525,7 @@ function ToastProvider({ children }) {
|
|
|
5551
5525
|
},
|
|
5552
5526
|
[seedId, dismiss]
|
|
5553
5527
|
);
|
|
5554
|
-
|
|
5528
|
+
useEffect11(() => {
|
|
5555
5529
|
const currentTimers = timers.current;
|
|
5556
5530
|
return () => {
|
|
5557
5531
|
currentTimers.forEach((t) => clearTimeout(t));
|
|
@@ -5616,9 +5590,34 @@ function Toast({
|
|
|
5616
5590
|
);
|
|
5617
5591
|
}
|
|
5618
5592
|
|
|
5593
|
+
// src/components/AppTile/AppTile.tsx
|
|
5594
|
+
import styles39 from "./AppTile.module.css";
|
|
5595
|
+
import { Fragment as Fragment6, jsx as jsx161, jsxs as jsxs134 } from "react/jsx-runtime";
|
|
5596
|
+
function AppTile({
|
|
5597
|
+
icon,
|
|
5598
|
+
name,
|
|
5599
|
+
description,
|
|
5600
|
+
tags,
|
|
5601
|
+
href,
|
|
5602
|
+
variant = "solid",
|
|
5603
|
+
className
|
|
5604
|
+
}) {
|
|
5605
|
+
const classes = [styles39.tile, variant === "ghost" && styles39.ghost, href && styles39.link, className].filter(Boolean).join(" ");
|
|
5606
|
+
const content = /* @__PURE__ */ jsxs134(Fragment6, { children: [
|
|
5607
|
+
/* @__PURE__ */ jsx161("span", { className: styles39.icon, "aria-hidden": "true", children: icon }),
|
|
5608
|
+
/* @__PURE__ */ jsx161("span", { className: styles39.name, children: name }),
|
|
5609
|
+
description ? /* @__PURE__ */ jsx161("span", { className: styles39.description, children: description }) : /* @__PURE__ */ jsx161("span", { className: styles39.fill }),
|
|
5610
|
+
tags ? /* @__PURE__ */ jsxs134(Fragment6, { children: [
|
|
5611
|
+
/* @__PURE__ */ jsx161("span", { className: styles39.separator, "aria-hidden": "true" }),
|
|
5612
|
+
/* @__PURE__ */ jsx161("span", { className: styles39.tags, children: tags })
|
|
5613
|
+
] }) : null
|
|
5614
|
+
] });
|
|
5615
|
+
return href ? /* @__PURE__ */ jsx161("a", { className: classes, href, children: content }) : /* @__PURE__ */ jsx161("div", { className: classes, children: content });
|
|
5616
|
+
}
|
|
5617
|
+
|
|
5619
5618
|
// src/components/CardTile/CardTile.tsx
|
|
5620
|
-
import
|
|
5621
|
-
import { jsx as
|
|
5619
|
+
import styles40 from "./CardTile.module.css";
|
|
5620
|
+
import { jsx as jsx162, jsxs as jsxs135 } from "react/jsx-runtime";
|
|
5622
5621
|
function CardTileGrid({
|
|
5623
5622
|
children,
|
|
5624
5623
|
minTileWidth = 200,
|
|
@@ -5626,10 +5625,10 @@ function CardTileGrid({
|
|
|
5626
5625
|
dense = false
|
|
5627
5626
|
}) {
|
|
5628
5627
|
const style = { "--sv-card-tile-min-width": `${minTileWidth}px` };
|
|
5629
|
-
return /* @__PURE__ */
|
|
5628
|
+
return /* @__PURE__ */ jsx162(
|
|
5630
5629
|
"div",
|
|
5631
5630
|
{
|
|
5632
|
-
className: [
|
|
5631
|
+
className: [styles40.grid, dense && styles40.gridDense, className].filter(Boolean).join(" "),
|
|
5633
5632
|
style,
|
|
5634
5633
|
children
|
|
5635
5634
|
}
|
|
@@ -5644,22 +5643,22 @@ function CardTile({
|
|
|
5644
5643
|
...rest
|
|
5645
5644
|
}) {
|
|
5646
5645
|
const isIcon = variant === "icon";
|
|
5647
|
-
return /* @__PURE__ */
|
|
5646
|
+
return /* @__PURE__ */ jsxs135(
|
|
5648
5647
|
"div",
|
|
5649
5648
|
{
|
|
5650
|
-
className: [
|
|
5649
|
+
className: [styles40.tile, isIcon && styles40.tileIcon, className].filter(Boolean).join(" "),
|
|
5651
5650
|
...rest,
|
|
5652
5651
|
children: [
|
|
5653
|
-
/* @__PURE__ */
|
|
5652
|
+
/* @__PURE__ */ jsx162(
|
|
5654
5653
|
"div",
|
|
5655
5654
|
{
|
|
5656
|
-
className:
|
|
5655
|
+
className: styles40.banner,
|
|
5657
5656
|
"aria-hidden": "true",
|
|
5658
5657
|
style: !isIcon && bannerColor ? { backgroundColor: bannerColor } : void 0,
|
|
5659
5658
|
children: banner
|
|
5660
5659
|
}
|
|
5661
5660
|
),
|
|
5662
|
-
/* @__PURE__ */
|
|
5661
|
+
/* @__PURE__ */ jsx162("div", { className: styles40.footer, children })
|
|
5663
5662
|
]
|
|
5664
5663
|
}
|
|
5665
5664
|
);
|
|
@@ -5673,15 +5672,15 @@ function NewCardTile({
|
|
|
5673
5672
|
...rest
|
|
5674
5673
|
}) {
|
|
5675
5674
|
const isIcon = variant === "icon";
|
|
5676
|
-
return /* @__PURE__ */
|
|
5675
|
+
return /* @__PURE__ */ jsxs135(
|
|
5677
5676
|
"button",
|
|
5678
5677
|
{
|
|
5679
5678
|
type,
|
|
5680
|
-
className: [
|
|
5679
|
+
className: [styles40.newTile, isIcon && styles40.newTileIcon, className].filter(Boolean).join(" "),
|
|
5681
5680
|
...rest,
|
|
5682
5681
|
"aria-label": isIcon ? label : void 0,
|
|
5683
5682
|
children: [
|
|
5684
|
-
/* @__PURE__ */
|
|
5683
|
+
/* @__PURE__ */ jsx162(Icon, { name: icon, size: isIcon ? "md" : "sm", "aria-hidden": true }),
|
|
5685
5684
|
!isIcon && label
|
|
5686
5685
|
]
|
|
5687
5686
|
}
|
|
@@ -5690,8 +5689,8 @@ function NewCardTile({
|
|
|
5690
5689
|
|
|
5691
5690
|
// src/components/FormField/FormField.tsx
|
|
5692
5691
|
import { useId as useId4 } from "react";
|
|
5693
|
-
import
|
|
5694
|
-
import { jsx as
|
|
5692
|
+
import styles41 from "./FormField.module.css";
|
|
5693
|
+
import { jsx as jsx163, jsxs as jsxs136 } from "react/jsx-runtime";
|
|
5695
5694
|
function FormField({
|
|
5696
5695
|
label,
|
|
5697
5696
|
hint,
|
|
@@ -5712,27 +5711,27 @@ function FormField({
|
|
|
5712
5711
|
"aria-invalid": error ? true : void 0,
|
|
5713
5712
|
required: required || void 0
|
|
5714
5713
|
};
|
|
5715
|
-
return /* @__PURE__ */
|
|
5716
|
-
/* @__PURE__ */
|
|
5714
|
+
return /* @__PURE__ */ jsxs136("div", { className: [styles41.field, className].filter(Boolean).join(" "), children: [
|
|
5715
|
+
/* @__PURE__ */ jsxs136("label", { className: styles41.label, htmlFor: fieldId, children: [
|
|
5717
5716
|
label,
|
|
5718
|
-
required && /* @__PURE__ */
|
|
5717
|
+
required && /* @__PURE__ */ jsx163("span", { className: styles41.required, "aria-hidden": "true", children: "*" })
|
|
5719
5718
|
] }),
|
|
5720
5719
|
children(field),
|
|
5721
|
-
hint && !error && /* @__PURE__ */
|
|
5722
|
-
error && /* @__PURE__ */
|
|
5720
|
+
hint && !error && /* @__PURE__ */ jsx163("p", { id: hintId, className: styles41.hint, children: hint }),
|
|
5721
|
+
error && /* @__PURE__ */ jsx163("p", { id: errorId, className: styles41.error, role: "alert", children: error })
|
|
5723
5722
|
] });
|
|
5724
5723
|
}
|
|
5725
5724
|
|
|
5726
5725
|
// src/components/ResponsiveSurface/ResponsiveSurface.tsx
|
|
5727
|
-
import { Fragment as
|
|
5726
|
+
import { Fragment as Fragment7, jsx as jsx164 } from "react/jsx-runtime";
|
|
5728
5727
|
function ResponsiveSurface({ web, mobile, breakpointPx }) {
|
|
5729
5728
|
const { value } = useResponsiveLayout({ web, mobile, breakpointPx });
|
|
5730
|
-
return /* @__PURE__ */
|
|
5729
|
+
return /* @__PURE__ */ jsx164(Fragment7, { children: value });
|
|
5731
5730
|
}
|
|
5732
5731
|
|
|
5733
5732
|
// src/components/PageHeader/PageHeader.tsx
|
|
5734
|
-
import
|
|
5735
|
-
import { jsx as
|
|
5733
|
+
import styles42 from "./PageHeader.module.css";
|
|
5734
|
+
import { jsx as jsx165, jsxs as jsxs137 } from "react/jsx-runtime";
|
|
5736
5735
|
var HEADING_TAG = { 1: "h1", 2: "h2", 3: "h3" };
|
|
5737
5736
|
function PageHeaderWeb({
|
|
5738
5737
|
title,
|
|
@@ -5743,15 +5742,15 @@ function PageHeaderWeb({
|
|
|
5743
5742
|
className
|
|
5744
5743
|
}) {
|
|
5745
5744
|
const Heading = HEADING_TAG[headingLevel];
|
|
5746
|
-
return /* @__PURE__ */
|
|
5747
|
-
/* @__PURE__ */
|
|
5748
|
-
/* @__PURE__ */
|
|
5749
|
-
icon && /* @__PURE__ */
|
|
5750
|
-
/* @__PURE__ */
|
|
5745
|
+
return /* @__PURE__ */ jsxs137("header", { className: [styles42.header, className].filter(Boolean).join(" "), children: [
|
|
5746
|
+
/* @__PURE__ */ jsxs137("div", { className: styles42.text, children: [
|
|
5747
|
+
/* @__PURE__ */ jsxs137("div", { className: styles42.titleRow, children: [
|
|
5748
|
+
icon && /* @__PURE__ */ jsx165(Icon, { name: icon, size: "lg", "aria-hidden": true }),
|
|
5749
|
+
/* @__PURE__ */ jsx165(Heading, { className: styles42.title, children: title })
|
|
5751
5750
|
] }),
|
|
5752
|
-
description && /* @__PURE__ */
|
|
5751
|
+
description && /* @__PURE__ */ jsx165("p", { className: styles42.description, children: description })
|
|
5753
5752
|
] }),
|
|
5754
|
-
action && /* @__PURE__ */
|
|
5753
|
+
action && /* @__PURE__ */ jsx165("div", { className: styles42.action, children: action })
|
|
5755
5754
|
] });
|
|
5756
5755
|
}
|
|
5757
5756
|
function PageHeaderMobile({
|
|
@@ -5764,30 +5763,30 @@ function PageHeaderMobile({
|
|
|
5764
5763
|
className
|
|
5765
5764
|
}) {
|
|
5766
5765
|
const Heading = HEADING_TAG[headingLevel];
|
|
5767
|
-
return /* @__PURE__ */
|
|
5768
|
-
onBack && /* @__PURE__ */
|
|
5766
|
+
return /* @__PURE__ */ jsxs137("header", { className: [styles42.mobileHeader, className].filter(Boolean).join(" "), children: [
|
|
5767
|
+
onBack && /* @__PURE__ */ jsx165(
|
|
5769
5768
|
Button,
|
|
5770
5769
|
{
|
|
5771
5770
|
variant: "ghost",
|
|
5772
5771
|
size: "sm",
|
|
5773
5772
|
"aria-label": "Back",
|
|
5774
5773
|
onClick: onBack,
|
|
5775
|
-
className:
|
|
5776
|
-
children: /* @__PURE__ */
|
|
5774
|
+
className: styles42.mobileBack,
|
|
5775
|
+
children: /* @__PURE__ */ jsx165(Icon, { name: "circle-chevron-left", size: "md", "aria-hidden": true })
|
|
5777
5776
|
}
|
|
5778
5777
|
),
|
|
5779
|
-
icon && /* @__PURE__ */
|
|
5780
|
-
/* @__PURE__ */
|
|
5781
|
-
action && /* @__PURE__ */
|
|
5782
|
-
onMenuClick && /* @__PURE__ */
|
|
5778
|
+
icon && /* @__PURE__ */ jsx165(Icon, { name: icon, size: "md", "aria-hidden": true, className: styles42.mobileTitleIcon }),
|
|
5779
|
+
/* @__PURE__ */ jsx165(Heading, { className: styles42.mobileTitle, children: title }),
|
|
5780
|
+
action && /* @__PURE__ */ jsx165("div", { className: styles42.mobileAction, children: action }),
|
|
5781
|
+
onMenuClick && /* @__PURE__ */ jsx165(
|
|
5783
5782
|
Button,
|
|
5784
5783
|
{
|
|
5785
5784
|
variant: "ghost",
|
|
5786
5785
|
size: "sm",
|
|
5787
5786
|
"aria-label": "Menu",
|
|
5788
5787
|
onClick: onMenuClick,
|
|
5789
|
-
className:
|
|
5790
|
-
children: /* @__PURE__ */
|
|
5788
|
+
className: styles42.mobileMenu,
|
|
5789
|
+
children: /* @__PURE__ */ jsx165(Icon, { name: "ellipsis-vertical", size: "md", "aria-hidden": true })
|
|
5791
5790
|
}
|
|
5792
5791
|
)
|
|
5793
5792
|
] });
|
|
@@ -5802,10 +5801,10 @@ function PageHeader({
|
|
|
5802
5801
|
onBack,
|
|
5803
5802
|
onMenuClick
|
|
5804
5803
|
}) {
|
|
5805
|
-
return /* @__PURE__ */
|
|
5804
|
+
return /* @__PURE__ */ jsx165(
|
|
5806
5805
|
ResponsiveSurface,
|
|
5807
5806
|
{
|
|
5808
|
-
web: /* @__PURE__ */
|
|
5807
|
+
web: /* @__PURE__ */ jsx165(
|
|
5809
5808
|
PageHeaderWeb,
|
|
5810
5809
|
{
|
|
5811
5810
|
title,
|
|
@@ -5816,7 +5815,7 @@ function PageHeader({
|
|
|
5816
5815
|
className
|
|
5817
5816
|
}
|
|
5818
5817
|
),
|
|
5819
|
-
mobile: /* @__PURE__ */
|
|
5818
|
+
mobile: /* @__PURE__ */ jsx165(
|
|
5820
5819
|
PageHeaderMobile,
|
|
5821
5820
|
{
|
|
5822
5821
|
title,
|
|
@@ -5833,19 +5832,19 @@ function PageHeader({
|
|
|
5833
5832
|
}
|
|
5834
5833
|
|
|
5835
5834
|
// src/components/PageContainer/PageContainer.tsx
|
|
5836
|
-
import
|
|
5837
|
-
import { jsx as
|
|
5835
|
+
import styles43 from "./PageContainer.module.css";
|
|
5836
|
+
import { jsx as jsx166 } from "react/jsx-runtime";
|
|
5838
5837
|
var maxWidthClass = {
|
|
5839
|
-
sm:
|
|
5840
|
-
md:
|
|
5841
|
-
lg:
|
|
5842
|
-
full:
|
|
5838
|
+
sm: styles43.sm,
|
|
5839
|
+
md: styles43.md,
|
|
5840
|
+
lg: styles43.lg,
|
|
5841
|
+
full: styles43.full
|
|
5843
5842
|
};
|
|
5844
5843
|
var paddingClass2 = {
|
|
5845
|
-
none:
|
|
5846
|
-
sm:
|
|
5847
|
-
md:
|
|
5848
|
-
lg:
|
|
5844
|
+
none: styles43.padNone,
|
|
5845
|
+
sm: styles43.padSm,
|
|
5846
|
+
md: styles43.padMd,
|
|
5847
|
+
lg: styles43.padLg
|
|
5849
5848
|
};
|
|
5850
5849
|
function PageContainer({
|
|
5851
5850
|
maxWidth = "full",
|
|
@@ -5854,13 +5853,13 @@ function PageContainer({
|
|
|
5854
5853
|
children,
|
|
5855
5854
|
...rest
|
|
5856
5855
|
}) {
|
|
5857
|
-
const cls = [
|
|
5858
|
-
return /* @__PURE__ */
|
|
5856
|
+
const cls = [styles43.container, maxWidthClass[maxWidth], paddingClass2[padding], className].filter(Boolean).join(" ");
|
|
5857
|
+
return /* @__PURE__ */ jsx166("div", { className: cls, ...rest, children });
|
|
5859
5858
|
}
|
|
5860
5859
|
|
|
5861
5860
|
// src/components/Header/Header.tsx
|
|
5862
|
-
import
|
|
5863
|
-
import { jsx as
|
|
5861
|
+
import styles44 from "./Header.module.css";
|
|
5862
|
+
import { jsx as jsx167, jsxs as jsxs138 } from "react/jsx-runtime";
|
|
5864
5863
|
function Header({
|
|
5865
5864
|
instanceName,
|
|
5866
5865
|
instanceLogoUrl,
|
|
@@ -5874,20 +5873,20 @@ function Header({
|
|
|
5874
5873
|
...rest
|
|
5875
5874
|
}) {
|
|
5876
5875
|
const brandInitial = instanceName.charAt(0).toUpperCase() || "S";
|
|
5877
|
-
const cls = [
|
|
5878
|
-
return /* @__PURE__ */
|
|
5879
|
-
/* @__PURE__ */
|
|
5876
|
+
const cls = [styles44.header, className].filter(Boolean).join(" ");
|
|
5877
|
+
return /* @__PURE__ */ jsxs138("header", { className: cls, ...rest, children: [
|
|
5878
|
+
/* @__PURE__ */ jsxs138("div", { className: styles44.left, children: [
|
|
5880
5879
|
leading,
|
|
5881
|
-
/* @__PURE__ */
|
|
5882
|
-
plugin && (plugin.href ? /* @__PURE__ */
|
|
5880
|
+
/* @__PURE__ */ jsx167("a", { href: homeHref, className: styles44.brandBadge, "aria-label": `${instanceName} home`, children: instanceLogoUrl ? /* @__PURE__ */ jsx167("img", { src: instanceLogoUrl, alt: "", className: styles44.brandLogoImg }) : brandInitial }),
|
|
5881
|
+
plugin && (plugin.href ? /* @__PURE__ */ jsxs138("a", { href: plugin.href, className: styles44.plugin, children: [
|
|
5883
5882
|
plugin.icon,
|
|
5884
|
-
/* @__PURE__ */
|
|
5885
|
-
] }) : /* @__PURE__ */
|
|
5883
|
+
/* @__PURE__ */ jsx167("span", { className: styles44.pluginName, children: plugin.name })
|
|
5884
|
+
] }) : /* @__PURE__ */ jsxs138("span", { className: styles44.plugin, children: [
|
|
5886
5885
|
plugin.icon,
|
|
5887
|
-
/* @__PURE__ */
|
|
5886
|
+
/* @__PURE__ */ jsx167("span", { className: styles44.pluginName, children: plugin.name })
|
|
5888
5887
|
] }))
|
|
5889
5888
|
] }),
|
|
5890
|
-
/* @__PURE__ */
|
|
5889
|
+
/* @__PURE__ */ jsxs138("div", { className: styles44.right, children: [
|
|
5891
5890
|
launcher,
|
|
5892
5891
|
notifications,
|
|
5893
5892
|
avatarMenu
|
|
@@ -5926,10 +5925,10 @@ function usePublishShellChromeHeight(ref, cssVariable) {
|
|
|
5926
5925
|
}
|
|
5927
5926
|
|
|
5928
5927
|
// src/components/MobileHeader/MobileHeader.tsx
|
|
5929
|
-
import
|
|
5930
|
-
import { jsx as
|
|
5928
|
+
import styles45 from "./MobileHeader.module.css";
|
|
5929
|
+
import { jsx as jsx168, jsxs as jsxs139 } from "react/jsx-runtime";
|
|
5931
5930
|
function DefaultLogo() {
|
|
5932
|
-
return /* @__PURE__ */
|
|
5931
|
+
return /* @__PURE__ */ jsx168("span", { className: styles45.defaultLogo, "aria-hidden": "true", children: "S" });
|
|
5933
5932
|
}
|
|
5934
5933
|
function MobileHeader({
|
|
5935
5934
|
logo,
|
|
@@ -5941,13 +5940,13 @@ function MobileHeader({
|
|
|
5941
5940
|
}) {
|
|
5942
5941
|
const headerRef = useRef17(null);
|
|
5943
5942
|
usePublishShellChromeHeight(headerRef, "--sv-shell-header-height");
|
|
5944
|
-
const cls = [
|
|
5945
|
-
return /* @__PURE__ */
|
|
5946
|
-
/* @__PURE__ */
|
|
5947
|
-
logo ?? /* @__PURE__ */
|
|
5948
|
-
title && /* @__PURE__ */
|
|
5943
|
+
const cls = [styles45.header, className].filter(Boolean).join(" ");
|
|
5944
|
+
return /* @__PURE__ */ jsxs139("div", { className: cls, ...rest, ref: headerRef, children: [
|
|
5945
|
+
/* @__PURE__ */ jsxs139("div", { className: styles45.brandGroup, children: [
|
|
5946
|
+
logo ?? /* @__PURE__ */ jsx168(DefaultLogo, {}),
|
|
5947
|
+
title && /* @__PURE__ */ jsx168("span", { className: styles45.title, children: title })
|
|
5949
5948
|
] }),
|
|
5950
|
-
/* @__PURE__ */
|
|
5949
|
+
/* @__PURE__ */ jsxs139("div", { className: styles45.right, children: [
|
|
5951
5950
|
bell,
|
|
5952
5951
|
avatarMenu
|
|
5953
5952
|
] })
|
|
@@ -5956,12 +5955,12 @@ function MobileHeader({
|
|
|
5956
5955
|
|
|
5957
5956
|
// src/components/MobileFooter/MobileFooter.tsx
|
|
5958
5957
|
import { useRef as useRef18 } from "react";
|
|
5959
|
-
import
|
|
5960
|
-
import { jsx as
|
|
5958
|
+
import styles46 from "./MobileFooter.module.css";
|
|
5959
|
+
import { jsx as jsx169, jsxs as jsxs140 } from "react/jsx-runtime";
|
|
5961
5960
|
function FooterNavItem({ icon, label, href, onClick, active }) {
|
|
5962
|
-
const className = [
|
|
5961
|
+
const className = [styles46.navItem, active ? styles46.navItemActive : ""].filter(Boolean).join(" ");
|
|
5963
5962
|
if (href) {
|
|
5964
|
-
return /* @__PURE__ */
|
|
5963
|
+
return /* @__PURE__ */ jsx169(
|
|
5965
5964
|
"a",
|
|
5966
5965
|
{
|
|
5967
5966
|
href,
|
|
@@ -5972,7 +5971,7 @@ function FooterNavItem({ icon, label, href, onClick, active }) {
|
|
|
5972
5971
|
}
|
|
5973
5972
|
);
|
|
5974
5973
|
}
|
|
5975
|
-
return /* @__PURE__ */
|
|
5974
|
+
return /* @__PURE__ */ jsx169("button", { type: "button", className, "aria-label": label, onClick, children: icon });
|
|
5976
5975
|
}
|
|
5977
5976
|
function MobileFooter({
|
|
5978
5977
|
onOpenApps,
|
|
@@ -5990,15 +5989,15 @@ function MobileFooter({
|
|
|
5990
5989
|
}
|
|
5991
5990
|
const navRef = useRef18(null);
|
|
5992
5991
|
usePublishShellChromeHeight(navRef, "--sv-shell-footer-height");
|
|
5993
|
-
const cls = [
|
|
5992
|
+
const cls = [styles46.footer, className].filter(Boolean).join(" ");
|
|
5994
5993
|
const launcherClassName = [
|
|
5995
|
-
|
|
5996
|
-
|
|
5997
|
-
launcherOpen ?
|
|
5994
|
+
styles46.navItem,
|
|
5995
|
+
styles46.navItemApps,
|
|
5996
|
+
launcherOpen ? styles46.navItemAppsOpen : ""
|
|
5998
5997
|
].filter(Boolean).join(" ");
|
|
5999
|
-
return /* @__PURE__ */
|
|
6000
|
-
leftIcons.map((item) => /* @__PURE__ */
|
|
6001
|
-
/* @__PURE__ */
|
|
5998
|
+
return /* @__PURE__ */ jsxs140("nav", { ...rest, ref: navRef, className: cls, "aria-label": "App navigation", children: [
|
|
5999
|
+
leftIcons.map((item) => /* @__PURE__ */ jsx169(FooterNavItem, { ...item }, item.label)),
|
|
6000
|
+
/* @__PURE__ */ jsx169(
|
|
6002
6001
|
"button",
|
|
6003
6002
|
{
|
|
6004
6003
|
type: "button",
|
|
@@ -6007,49 +6006,49 @@ function MobileFooter({
|
|
|
6007
6006
|
"aria-expanded": launcherOpen,
|
|
6008
6007
|
"aria-haspopup": "dialog",
|
|
6009
6008
|
onClick: onOpenApps,
|
|
6010
|
-
children: launcherIcon ?? /* @__PURE__ */
|
|
6009
|
+
children: launcherIcon ?? /* @__PURE__ */ jsx169(Icon, { name: "grid-2x2", size: "md", "aria-hidden": true })
|
|
6011
6010
|
}
|
|
6012
6011
|
),
|
|
6013
|
-
rightIcons.map((item) => /* @__PURE__ */
|
|
6012
|
+
rightIcons.map((item) => /* @__PURE__ */ jsx169(FooterNavItem, { ...item }, item.label))
|
|
6014
6013
|
] });
|
|
6015
6014
|
}
|
|
6016
6015
|
|
|
6017
6016
|
// src/components/MobileAppsDrawer/MobileAppsDrawer.tsx
|
|
6018
|
-
import
|
|
6019
|
-
import { Fragment as
|
|
6017
|
+
import styles47 from "./MobileAppsDrawer.module.css";
|
|
6018
|
+
import { Fragment as Fragment8, jsx as jsx170, jsxs as jsxs141 } from "react/jsx-runtime";
|
|
6020
6019
|
function DrawerGridTile({ icon, label, href, onClick }) {
|
|
6021
|
-
const content = /* @__PURE__ */
|
|
6022
|
-
/* @__PURE__ */
|
|
6023
|
-
/* @__PURE__ */
|
|
6020
|
+
const content = /* @__PURE__ */ jsxs141(Fragment8, { children: [
|
|
6021
|
+
/* @__PURE__ */ jsx170("span", { className: styles47.gridIcon, "aria-hidden": "true", children: icon }),
|
|
6022
|
+
/* @__PURE__ */ jsx170("span", { className: styles47.gridName, children: label })
|
|
6024
6023
|
] });
|
|
6025
6024
|
if (href) {
|
|
6026
|
-
return /* @__PURE__ */
|
|
6025
|
+
return /* @__PURE__ */ jsx170("a", { href, className: styles47.gridItem, onClick, children: content });
|
|
6027
6026
|
}
|
|
6028
|
-
return /* @__PURE__ */
|
|
6027
|
+
return /* @__PURE__ */ jsx170("button", { type: "button", className: styles47.gridItem, onClick, children: content });
|
|
6029
6028
|
}
|
|
6030
6029
|
function MobileAppsDrawer({ open, onClose, items, ...rest }) {
|
|
6031
6030
|
const ariaLabel = rest["aria-label"];
|
|
6032
|
-
return /* @__PURE__ */
|
|
6031
|
+
return /* @__PURE__ */ jsx170(Drawer, { open, onClose, "aria-label": ariaLabel, children: /* @__PURE__ */ jsx170("nav", { "aria-label": ariaLabel, children: /* @__PURE__ */ jsx170("ul", { className: styles47.grid, children: items.map(({ key, ...item }) => /* @__PURE__ */ jsx170("li", { children: /* @__PURE__ */ jsx170(DrawerGridTile, { ...item }, key) }, key)) }) }) });
|
|
6033
6032
|
}
|
|
6034
6033
|
|
|
6035
6034
|
// src/components/EmptyState/EmptyState.tsx
|
|
6036
|
-
import
|
|
6037
|
-
import { jsx as
|
|
6035
|
+
import styles48 from "./EmptyState.module.css";
|
|
6036
|
+
import { jsx as jsx171, jsxs as jsxs142 } from "react/jsx-runtime";
|
|
6038
6037
|
function EmptyState({ icon, heading, description, action, className }) {
|
|
6039
|
-
return /* @__PURE__ */
|
|
6040
|
-
icon && /* @__PURE__ */
|
|
6041
|
-
/* @__PURE__ */
|
|
6042
|
-
description && /* @__PURE__ */
|
|
6038
|
+
return /* @__PURE__ */ jsxs142("div", { className: [styles48.root, className].filter(Boolean).join(" "), children: [
|
|
6039
|
+
icon && /* @__PURE__ */ jsx171("span", { className: styles48.icon, children: /* @__PURE__ */ jsx171(Icon, { name: icon, size: "lg", "aria-hidden": true }) }),
|
|
6040
|
+
/* @__PURE__ */ jsx171("h2", { className: styles48.heading, children: heading }),
|
|
6041
|
+
description && /* @__PURE__ */ jsx171("p", { className: styles48.description, children: description }),
|
|
6043
6042
|
action
|
|
6044
6043
|
] });
|
|
6045
6044
|
}
|
|
6046
6045
|
|
|
6047
6046
|
// src/components/OfflineGate/OfflineGate.tsx
|
|
6048
|
-
import { Fragment as
|
|
6047
|
+
import { Fragment as Fragment9, jsx as jsx172 } from "react/jsx-runtime";
|
|
6049
6048
|
function OfflineGate({ children, surfaceName, className }) {
|
|
6050
6049
|
const isOffline = useIsOffline();
|
|
6051
|
-
if (!isOffline) return /* @__PURE__ */
|
|
6052
|
-
return /* @__PURE__ */
|
|
6050
|
+
if (!isOffline) return /* @__PURE__ */ jsx172(Fragment9, { children });
|
|
6051
|
+
return /* @__PURE__ */ jsx172(
|
|
6053
6052
|
EmptyState,
|
|
6054
6053
|
{
|
|
6055
6054
|
icon: "alert-triangle",
|
|
@@ -6061,15 +6060,15 @@ function OfflineGate({ children, surfaceName, className }) {
|
|
|
6061
6060
|
}
|
|
6062
6061
|
|
|
6063
6062
|
// src/components/DeviceOnlyGate/DeviceOnlyGate.tsx
|
|
6064
|
-
import { Fragment as
|
|
6063
|
+
import { Fragment as Fragment10, jsx as jsx173 } from "react/jsx-runtime";
|
|
6065
6064
|
function DeviceOnlyGate({
|
|
6066
6065
|
children,
|
|
6067
6066
|
surfaceName,
|
|
6068
6067
|
available,
|
|
6069
6068
|
className
|
|
6070
6069
|
}) {
|
|
6071
|
-
if (available) return /* @__PURE__ */
|
|
6072
|
-
return /* @__PURE__ */
|
|
6070
|
+
if (available) return /* @__PURE__ */ jsx173(Fragment10, { children });
|
|
6071
|
+
return /* @__PURE__ */ jsx173(
|
|
6073
6072
|
EmptyState,
|
|
6074
6073
|
{
|
|
6075
6074
|
icon: "smartphone",
|
|
@@ -6081,7 +6080,7 @@ function DeviceOnlyGate({
|
|
|
6081
6080
|
}
|
|
6082
6081
|
|
|
6083
6082
|
// src/components/DeviceStorageKeyGate/DeviceStorageKeyGate.tsx
|
|
6084
|
-
import { Fragment as
|
|
6083
|
+
import { Fragment as Fragment11, jsx as jsx174 } from "react/jsx-runtime";
|
|
6085
6084
|
function DeviceStorageKeyGate({
|
|
6086
6085
|
children,
|
|
6087
6086
|
surfaceName,
|
|
@@ -6090,9 +6089,9 @@ function DeviceStorageKeyGate({
|
|
|
6090
6089
|
className
|
|
6091
6090
|
}) {
|
|
6092
6091
|
if (status === "checking") return null;
|
|
6093
|
-
if (status === "set-up") return /* @__PURE__ */
|
|
6092
|
+
if (status === "set-up") return /* @__PURE__ */ jsx174(Fragment11, { children });
|
|
6094
6093
|
if (status === "unsupported") {
|
|
6095
|
-
return /* @__PURE__ */
|
|
6094
|
+
return /* @__PURE__ */ jsx174(
|
|
6096
6095
|
EmptyState,
|
|
6097
6096
|
{
|
|
6098
6097
|
icon: "smartphone",
|
|
@@ -6103,7 +6102,7 @@ function DeviceStorageKeyGate({
|
|
|
6103
6102
|
);
|
|
6104
6103
|
}
|
|
6105
6104
|
if (status === "no-device-auth") {
|
|
6106
|
-
return /* @__PURE__ */
|
|
6105
|
+
return /* @__PURE__ */ jsx174(
|
|
6107
6106
|
EmptyState,
|
|
6108
6107
|
{
|
|
6109
6108
|
icon: "alert-triangle",
|
|
@@ -6113,7 +6112,7 @@ function DeviceStorageKeyGate({
|
|
|
6113
6112
|
}
|
|
6114
6113
|
);
|
|
6115
6114
|
}
|
|
6116
|
-
return /* @__PURE__ */
|
|
6115
|
+
return /* @__PURE__ */ jsx174(
|
|
6117
6116
|
EmptyState,
|
|
6118
6117
|
{
|
|
6119
6118
|
icon: "lock",
|
|
@@ -6126,46 +6125,71 @@ function DeviceStorageKeyGate({
|
|
|
6126
6125
|
}
|
|
6127
6126
|
|
|
6128
6127
|
// src/components/Avatar/Avatar.tsx
|
|
6129
|
-
import { useState as
|
|
6130
|
-
import
|
|
6131
|
-
import { jsx as
|
|
6128
|
+
import { useState as useState15 } from "react";
|
|
6129
|
+
import styles49 from "./Avatar.module.css";
|
|
6130
|
+
import { jsx as jsx175 } from "react/jsx-runtime";
|
|
6132
6131
|
function initials2(name) {
|
|
6133
6132
|
const parts = name.trim().split(/\s+/);
|
|
6134
6133
|
if (parts.length === 1) return (parts[0] ?? "").slice(0, 2).toUpperCase();
|
|
6135
6134
|
return ((parts[0]?.[0] ?? "") + (parts[parts.length - 1]?.[0] ?? "")).toUpperCase();
|
|
6136
6135
|
}
|
|
6137
6136
|
var sizeClass2 = {
|
|
6138
|
-
sm:
|
|
6139
|
-
md:
|
|
6140
|
-
lg:
|
|
6137
|
+
sm: styles49.sm,
|
|
6138
|
+
md: styles49.md,
|
|
6139
|
+
lg: styles49.lg
|
|
6141
6140
|
};
|
|
6142
6141
|
function Avatar({ name, src, size = "md", className }) {
|
|
6143
|
-
const [imgFailed, setImgFailed] =
|
|
6144
|
-
const cls = [
|
|
6142
|
+
const [imgFailed, setImgFailed] = useState15(false);
|
|
6143
|
+
const cls = [styles49.avatar, sizeClass2[size], className].filter(Boolean).join(" ");
|
|
6145
6144
|
if (src && !imgFailed) {
|
|
6146
|
-
return /* @__PURE__ */
|
|
6145
|
+
return /* @__PURE__ */ jsx175("span", { className: cls, "aria-label": name, children: /* @__PURE__ */ jsx175("img", { src, alt: name, className: styles49.img, onError: () => setImgFailed(true) }) });
|
|
6147
6146
|
}
|
|
6148
|
-
return /* @__PURE__ */
|
|
6147
|
+
return /* @__PURE__ */ jsx175("span", { className: cls, "aria-label": name, children: initials2(name) });
|
|
6148
|
+
}
|
|
6149
|
+
|
|
6150
|
+
// src/components/AvatarStack/AvatarStack.tsx
|
|
6151
|
+
import styles50 from "./AvatarStack.module.css";
|
|
6152
|
+
import { jsx as jsx176, jsxs as jsxs143 } from "react/jsx-runtime";
|
|
6153
|
+
function namesOf(people) {
|
|
6154
|
+
const names = people.map((person) => person.name.trim()).filter((name) => name !== "");
|
|
6155
|
+
if (names.length <= 1) return names[0] ?? "";
|
|
6156
|
+
return `${names.slice(0, -1).join(", ")} and ${names[names.length - 1]}`;
|
|
6157
|
+
}
|
|
6158
|
+
function AvatarStack({ people, max = 4, size = "md", label, className }) {
|
|
6159
|
+
if (people.length === 0) return null;
|
|
6160
|
+
const limit = Math.max(1, Math.floor(max));
|
|
6161
|
+
const hidden = people.length > limit + 1 ? people.length - limit : 0;
|
|
6162
|
+
const shown = hidden > 0 ? people.slice(0, limit) : people;
|
|
6163
|
+
const names = namesOf(people);
|
|
6164
|
+
const accessible = label ? `${label}: ${names}` : names;
|
|
6165
|
+
const cls = [styles50.stack, styles50[size], className].filter(Boolean).join(" ");
|
|
6166
|
+
return /* @__PURE__ */ jsxs143("span", { className: cls, role: "img", "aria-label": accessible, children: [
|
|
6167
|
+
shown.map((person, index) => /* @__PURE__ */ jsx176("span", { className: styles50.item, "aria-hidden": "true", children: /* @__PURE__ */ jsx176(Avatar, { name: person.name, ...person.src ? { src: person.src } : {}, size }) }, `${index}:${person.name}`)),
|
|
6168
|
+
hidden > 0 ? /* @__PURE__ */ jsxs143("span", { className: `${styles50.item} ${styles50.more}`, "aria-hidden": "true", children: [
|
|
6169
|
+
"+",
|
|
6170
|
+
hidden
|
|
6171
|
+
] }) : null
|
|
6172
|
+
] });
|
|
6149
6173
|
}
|
|
6150
6174
|
|
|
6151
6175
|
// src/components/NavTabs/NavTabs.tsx
|
|
6152
|
-
import { Fragment as
|
|
6153
|
-
import
|
|
6154
|
-
import { jsx as
|
|
6176
|
+
import { Fragment as Fragment12 } from "react";
|
|
6177
|
+
import styles51 from "./NavTabs.module.css";
|
|
6178
|
+
import { jsx as jsx177 } from "react/jsx-runtime";
|
|
6155
6179
|
function NavTabs({ items, className, "aria-label": ariaLabel, renderLink }) {
|
|
6156
|
-
return /* @__PURE__ */
|
|
6180
|
+
return /* @__PURE__ */ jsx177(
|
|
6157
6181
|
"nav",
|
|
6158
6182
|
{
|
|
6159
|
-
className: [
|
|
6183
|
+
className: [styles51.nav, className].filter(Boolean).join(" "),
|
|
6160
6184
|
"aria-label": ariaLabel ?? "Page navigation",
|
|
6161
6185
|
children: items.map((item) => {
|
|
6162
6186
|
const linkProps = {
|
|
6163
6187
|
href: item.href,
|
|
6164
|
-
className: [
|
|
6188
|
+
className: [styles51.link, item.active && styles51.active].filter(Boolean).join(" "),
|
|
6165
6189
|
"aria-current": item.active ? "page" : void 0,
|
|
6166
6190
|
children: item.label
|
|
6167
6191
|
};
|
|
6168
|
-
return /* @__PURE__ */
|
|
6192
|
+
return /* @__PURE__ */ jsx177(Fragment12, { children: renderLink ? renderLink(item, linkProps) : /* @__PURE__ */ jsx177(
|
|
6169
6193
|
"a",
|
|
6170
6194
|
{
|
|
6171
6195
|
href: linkProps.href,
|
|
@@ -6181,25 +6205,25 @@ function NavTabs({ items, className, "aria-label": ariaLabel, renderLink }) {
|
|
|
6181
6205
|
|
|
6182
6206
|
// src/components/Tooltip/Tooltip.tsx
|
|
6183
6207
|
import { useId as useId5 } from "react";
|
|
6184
|
-
import
|
|
6185
|
-
import { jsx as
|
|
6208
|
+
import styles52 from "./Tooltip.module.css";
|
|
6209
|
+
import { jsx as jsx178, jsxs as jsxs144 } from "react/jsx-runtime";
|
|
6186
6210
|
var sideClass = {
|
|
6187
|
-
top:
|
|
6188
|
-
bottom:
|
|
6189
|
-
left:
|
|
6190
|
-
right:
|
|
6211
|
+
top: styles52.top,
|
|
6212
|
+
bottom: styles52.bottom,
|
|
6213
|
+
left: styles52.left,
|
|
6214
|
+
right: styles52.right
|
|
6191
6215
|
};
|
|
6192
6216
|
function Tooltip({ content, children, side = "top" }) {
|
|
6193
6217
|
const tipId = useId5();
|
|
6194
|
-
return /* @__PURE__ */
|
|
6195
|
-
/* @__PURE__ */
|
|
6196
|
-
/* @__PURE__ */
|
|
6218
|
+
return /* @__PURE__ */ jsxs144("span", { className: styles52.wrapper, children: [
|
|
6219
|
+
/* @__PURE__ */ jsx178("span", { "aria-describedby": tipId, children }),
|
|
6220
|
+
/* @__PURE__ */ jsx178("span", { id: tipId, role: "tooltip", className: [styles52.tip, sideClass[side]].join(" "), children: content })
|
|
6197
6221
|
] });
|
|
6198
6222
|
}
|
|
6199
6223
|
|
|
6200
6224
|
// src/components/Checkbox/Checkbox.tsx
|
|
6201
|
-
import
|
|
6202
|
-
import { jsx as
|
|
6225
|
+
import styles53 from "./Checkbox.module.css";
|
|
6226
|
+
import { jsx as jsx179, jsxs as jsxs145 } from "react/jsx-runtime";
|
|
6203
6227
|
function Checkbox({
|
|
6204
6228
|
checked,
|
|
6205
6229
|
onChange,
|
|
@@ -6211,9 +6235,9 @@ function Checkbox({
|
|
|
6211
6235
|
...rest
|
|
6212
6236
|
}) {
|
|
6213
6237
|
const inputId = id ?? `checkbox-${label.toLowerCase().replace(/\s+/g, "-")}`;
|
|
6214
|
-
return /* @__PURE__ */
|
|
6215
|
-
/* @__PURE__ */
|
|
6216
|
-
/* @__PURE__ */
|
|
6238
|
+
return /* @__PURE__ */ jsxs145("span", { className: [styles53.root, className].filter(Boolean).join(" "), children: [
|
|
6239
|
+
/* @__PURE__ */ jsxs145("span", { className: [styles53.box, checked ? styles53.checked : ""].filter(Boolean).join(" "), children: [
|
|
6240
|
+
/* @__PURE__ */ jsx179(
|
|
6217
6241
|
"input",
|
|
6218
6242
|
{
|
|
6219
6243
|
...rest,
|
|
@@ -6221,11 +6245,11 @@ function Checkbox({
|
|
|
6221
6245
|
type: "checkbox",
|
|
6222
6246
|
checked,
|
|
6223
6247
|
disabled,
|
|
6224
|
-
className:
|
|
6248
|
+
className: styles53.input,
|
|
6225
6249
|
onChange: (e) => onChange(e.target.checked)
|
|
6226
6250
|
}
|
|
6227
6251
|
),
|
|
6228
|
-
checked && /* @__PURE__ */
|
|
6252
|
+
checked && /* @__PURE__ */ jsx179("svg", { className: styles53.tick, viewBox: "0 0 10 8", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx179(
|
|
6229
6253
|
"path",
|
|
6230
6254
|
{
|
|
6231
6255
|
d: "M1 4l3 3 5-6",
|
|
@@ -6236,14 +6260,14 @@ function Checkbox({
|
|
|
6236
6260
|
}
|
|
6237
6261
|
) })
|
|
6238
6262
|
] }),
|
|
6239
|
-
label && /* @__PURE__ */
|
|
6263
|
+
label && /* @__PURE__ */ jsx179(
|
|
6240
6264
|
"label",
|
|
6241
6265
|
{
|
|
6242
6266
|
htmlFor: inputId,
|
|
6243
6267
|
className: [
|
|
6244
|
-
|
|
6245
|
-
strikeThrough && checked ?
|
|
6246
|
-
disabled ?
|
|
6268
|
+
styles53.label,
|
|
6269
|
+
strikeThrough && checked ? styles53.struck : "",
|
|
6270
|
+
disabled ? styles53.disabled : ""
|
|
6247
6271
|
].filter(Boolean).join(" "),
|
|
6248
6272
|
children: label
|
|
6249
6273
|
}
|
|
@@ -6253,8 +6277,8 @@ function Checkbox({
|
|
|
6253
6277
|
|
|
6254
6278
|
// src/components/RadioGroup/RadioGroup.tsx
|
|
6255
6279
|
import { useId as useId6 } from "react";
|
|
6256
|
-
import
|
|
6257
|
-
import { jsx as
|
|
6280
|
+
import styles54 from "./RadioGroup.module.css";
|
|
6281
|
+
import { jsx as jsx180, jsxs as jsxs146 } from "react/jsx-runtime";
|
|
6258
6282
|
function RadioGroup({
|
|
6259
6283
|
items,
|
|
6260
6284
|
value,
|
|
@@ -6271,7 +6295,7 @@ function RadioGroup({
|
|
|
6271
6295
|
}) {
|
|
6272
6296
|
const generatedName = useId6();
|
|
6273
6297
|
const groupName = name ?? generatedName;
|
|
6274
|
-
return /* @__PURE__ */
|
|
6298
|
+
return /* @__PURE__ */ jsx180(
|
|
6275
6299
|
"div",
|
|
6276
6300
|
{
|
|
6277
6301
|
id,
|
|
@@ -6281,19 +6305,19 @@ function RadioGroup({
|
|
|
6281
6305
|
"aria-describedby": ariaDescribedBy,
|
|
6282
6306
|
"aria-invalid": ariaInvalid,
|
|
6283
6307
|
"aria-required": required,
|
|
6284
|
-
className: [
|
|
6308
|
+
className: [styles54.root, className].filter(Boolean).join(" "),
|
|
6285
6309
|
children: items.map((item) => {
|
|
6286
6310
|
const checked = item.value === value;
|
|
6287
6311
|
const itemDisabled = disabled || item.disabled;
|
|
6288
6312
|
const inputId = `${groupName}-${item.value}`;
|
|
6289
|
-
return /* @__PURE__ */
|
|
6313
|
+
return /* @__PURE__ */ jsxs146(
|
|
6290
6314
|
"label",
|
|
6291
6315
|
{
|
|
6292
6316
|
htmlFor: inputId,
|
|
6293
|
-
className: [
|
|
6317
|
+
className: [styles54.option, itemDisabled ? styles54.disabled : ""].filter(Boolean).join(" "),
|
|
6294
6318
|
children: [
|
|
6295
|
-
/* @__PURE__ */
|
|
6296
|
-
/* @__PURE__ */
|
|
6319
|
+
/* @__PURE__ */ jsxs146("span", { className: [styles54.circle, checked ? styles54.checked : ""].join(" "), children: [
|
|
6320
|
+
/* @__PURE__ */ jsx180(
|
|
6297
6321
|
"input",
|
|
6298
6322
|
{
|
|
6299
6323
|
id: inputId,
|
|
@@ -6303,13 +6327,13 @@ function RadioGroup({
|
|
|
6303
6327
|
checked,
|
|
6304
6328
|
disabled: itemDisabled,
|
|
6305
6329
|
required,
|
|
6306
|
-
className:
|
|
6330
|
+
className: styles54.input,
|
|
6307
6331
|
onChange: () => onChange(item.value)
|
|
6308
6332
|
}
|
|
6309
6333
|
),
|
|
6310
|
-
checked && /* @__PURE__ */
|
|
6334
|
+
checked && /* @__PURE__ */ jsx180("span", { className: styles54.dot })
|
|
6311
6335
|
] }),
|
|
6312
|
-
/* @__PURE__ */
|
|
6336
|
+
/* @__PURE__ */ jsx180("span", { className: styles54.optionLabel, children: item.label })
|
|
6313
6337
|
]
|
|
6314
6338
|
},
|
|
6315
6339
|
item.value
|
|
@@ -6321,8 +6345,8 @@ function RadioGroup({
|
|
|
6321
6345
|
|
|
6322
6346
|
// src/components/Slider/Slider.tsx
|
|
6323
6347
|
import { useId as useId7 } from "react";
|
|
6324
|
-
import
|
|
6325
|
-
import { jsx as
|
|
6348
|
+
import styles55 from "./Slider.module.css";
|
|
6349
|
+
import { jsx as jsx181, jsxs as jsxs147 } from "react/jsx-runtime";
|
|
6326
6350
|
function Slider({
|
|
6327
6351
|
value,
|
|
6328
6352
|
onChange,
|
|
@@ -6341,9 +6365,9 @@ function Slider({
|
|
|
6341
6365
|
const generatedId = useId7();
|
|
6342
6366
|
const inputId = id ?? generatedId;
|
|
6343
6367
|
const fillPercent = max > min ? (value - min) / (max - min) * 100 : 0;
|
|
6344
|
-
return /* @__PURE__ */
|
|
6345
|
-
label && /* @__PURE__ */
|
|
6346
|
-
/* @__PURE__ */
|
|
6368
|
+
return /* @__PURE__ */ jsxs147("div", { className: [styles55.root, className].filter(Boolean).join(" "), children: [
|
|
6369
|
+
label && /* @__PURE__ */ jsx181("label", { htmlFor: inputId, className: styles55.label, children: label }),
|
|
6370
|
+
/* @__PURE__ */ jsx181(
|
|
6347
6371
|
"input",
|
|
6348
6372
|
{
|
|
6349
6373
|
id: inputId,
|
|
@@ -6357,7 +6381,7 @@ function Slider({
|
|
|
6357
6381
|
"aria-label": label ? void 0 : ariaLabel,
|
|
6358
6382
|
"aria-describedby": ariaDescribedBy,
|
|
6359
6383
|
"aria-invalid": ariaInvalid,
|
|
6360
|
-
className:
|
|
6384
|
+
className: styles55.slider,
|
|
6361
6385
|
style: { "--slider-fill": `${fillPercent}%` },
|
|
6362
6386
|
onChange: (e) => onChange(Number(e.target.value))
|
|
6363
6387
|
}
|
|
@@ -6366,11 +6390,11 @@ function Slider({
|
|
|
6366
6390
|
}
|
|
6367
6391
|
|
|
6368
6392
|
// src/components/Progress/Progress.tsx
|
|
6369
|
-
import
|
|
6370
|
-
import { jsx as
|
|
6393
|
+
import styles56 from "./Progress.module.css";
|
|
6394
|
+
import { jsx as jsx182 } from "react/jsx-runtime";
|
|
6371
6395
|
function Progress({ value, label, id, className }) {
|
|
6372
6396
|
const clamped = Math.min(100, Math.max(0, value));
|
|
6373
|
-
return /* @__PURE__ */
|
|
6397
|
+
return /* @__PURE__ */ jsx182(
|
|
6374
6398
|
"div",
|
|
6375
6399
|
{
|
|
6376
6400
|
id,
|
|
@@ -6379,37 +6403,37 @@ function Progress({ value, label, id, className }) {
|
|
|
6379
6403
|
"aria-valuemin": 0,
|
|
6380
6404
|
"aria-valuemax": 100,
|
|
6381
6405
|
"aria-label": label,
|
|
6382
|
-
className: [
|
|
6383
|
-
children: /* @__PURE__ */
|
|
6406
|
+
className: [styles56.track, className].filter(Boolean).join(" "),
|
|
6407
|
+
children: /* @__PURE__ */ jsx182("div", { className: styles56.fill, style: { width: `${clamped}%` } })
|
|
6384
6408
|
}
|
|
6385
6409
|
);
|
|
6386
6410
|
}
|
|
6387
6411
|
|
|
6388
6412
|
// src/components/Table/Table.tsx
|
|
6389
|
-
import
|
|
6390
|
-
import { jsx as
|
|
6413
|
+
import styles57 from "./Table.module.css";
|
|
6414
|
+
import { jsx as jsx183 } from "react/jsx-runtime";
|
|
6391
6415
|
function Table({ children, className }) {
|
|
6392
|
-
return /* @__PURE__ */
|
|
6416
|
+
return /* @__PURE__ */ jsx183("div", { className: styles57.scrollContainer, children: /* @__PURE__ */ jsx183("table", { className: [styles57.table, className].filter(Boolean).join(" "), children }) });
|
|
6393
6417
|
}
|
|
6394
6418
|
function TableHead({ children }) {
|
|
6395
|
-
return /* @__PURE__ */
|
|
6419
|
+
return /* @__PURE__ */ jsx183("thead", { className: styles57.head, children });
|
|
6396
6420
|
}
|
|
6397
6421
|
function TableBody({ children }) {
|
|
6398
|
-
return /* @__PURE__ */
|
|
6422
|
+
return /* @__PURE__ */ jsx183("tbody", { className: styles57.body, children });
|
|
6399
6423
|
}
|
|
6400
6424
|
function TableRow({ children }) {
|
|
6401
|
-
return /* @__PURE__ */
|
|
6425
|
+
return /* @__PURE__ */ jsx183("tr", { className: styles57.row, children });
|
|
6402
6426
|
}
|
|
6403
6427
|
function TableHeaderCell({ children, ...rest }) {
|
|
6404
|
-
return /* @__PURE__ */
|
|
6428
|
+
return /* @__PURE__ */ jsx183("th", { className: styles57.th, ...rest, children });
|
|
6405
6429
|
}
|
|
6406
6430
|
function TableCell({ children, ...rest }) {
|
|
6407
|
-
return /* @__PURE__ */
|
|
6431
|
+
return /* @__PURE__ */ jsx183("td", { className: styles57.td, ...rest, children });
|
|
6408
6432
|
}
|
|
6409
6433
|
|
|
6410
6434
|
// src/components/Alert/Alert.tsx
|
|
6411
|
-
import
|
|
6412
|
-
import { jsx as
|
|
6435
|
+
import styles58 from "./Alert.module.css";
|
|
6436
|
+
import { jsx as jsx184, jsxs as jsxs148 } from "react/jsx-runtime";
|
|
6413
6437
|
var DEFAULT_ICON = {
|
|
6414
6438
|
info: "info",
|
|
6415
6439
|
success: "circle-check",
|
|
@@ -6419,17 +6443,17 @@ var DEFAULT_ICON = {
|
|
|
6419
6443
|
};
|
|
6420
6444
|
function Alert({ variant, heading, icon, children, id, className }) {
|
|
6421
6445
|
const resolvedIcon = icon === void 0 ? DEFAULT_ICON[variant] : icon || void 0;
|
|
6422
|
-
return /* @__PURE__ */
|
|
6446
|
+
return /* @__PURE__ */ jsxs148(
|
|
6423
6447
|
"div",
|
|
6424
6448
|
{
|
|
6425
6449
|
id,
|
|
6426
6450
|
role: variant === "error" ? "alert" : "status",
|
|
6427
|
-
className: [
|
|
6451
|
+
className: [styles58.alert, styles58[variant], className].filter(Boolean).join(" "),
|
|
6428
6452
|
children: [
|
|
6429
|
-
resolvedIcon && /* @__PURE__ */
|
|
6430
|
-
/* @__PURE__ */
|
|
6431
|
-
heading && /* @__PURE__ */
|
|
6432
|
-
/* @__PURE__ */
|
|
6453
|
+
resolvedIcon && /* @__PURE__ */ jsx184(Icon, { name: resolvedIcon, size: "sm", className: styles58.icon, "aria-hidden": true }),
|
|
6454
|
+
/* @__PURE__ */ jsxs148("div", { className: styles58.content, children: [
|
|
6455
|
+
heading && /* @__PURE__ */ jsx184("p", { className: styles58.heading, children: heading }),
|
|
6456
|
+
/* @__PURE__ */ jsx184("div", { className: styles58.body, children })
|
|
6433
6457
|
] })
|
|
6434
6458
|
]
|
|
6435
6459
|
}
|
|
@@ -6437,26 +6461,26 @@ function Alert({ variant, heading, icon, children, id, className }) {
|
|
|
6437
6461
|
}
|
|
6438
6462
|
|
|
6439
6463
|
// src/components/Breadcrumb/Breadcrumb.tsx
|
|
6440
|
-
import
|
|
6441
|
-
import { jsx as
|
|
6464
|
+
import styles59 from "./Breadcrumb.module.css";
|
|
6465
|
+
import { jsx as jsx185, jsxs as jsxs149 } from "react/jsx-runtime";
|
|
6442
6466
|
function Breadcrumb({
|
|
6443
6467
|
items,
|
|
6444
6468
|
renderLink,
|
|
6445
6469
|
className,
|
|
6446
6470
|
"aria-label": ariaLabel = "Breadcrumb"
|
|
6447
6471
|
}) {
|
|
6448
|
-
return /* @__PURE__ */
|
|
6472
|
+
return /* @__PURE__ */ jsx185("nav", { "aria-label": ariaLabel, className: [styles59.nav, className].filter(Boolean).join(" "), children: /* @__PURE__ */ jsx185("ol", { className: styles59.list, children: items.map((item, index) => {
|
|
6449
6473
|
const isLast = index === items.length - 1;
|
|
6450
|
-
return /* @__PURE__ */
|
|
6451
|
-
item.href ? renderLink ? renderLink(item, item.label) : /* @__PURE__ */
|
|
6452
|
-
!isLast && /* @__PURE__ */
|
|
6474
|
+
return /* @__PURE__ */ jsxs149("li", { className: styles59.item, children: [
|
|
6475
|
+
item.href ? renderLink ? renderLink(item, item.label) : /* @__PURE__ */ jsx185("a", { href: item.href, className: styles59.link, children: item.label }) : /* @__PURE__ */ jsx185("span", { className: styles59.current, "aria-current": "page", children: item.label }),
|
|
6476
|
+
!isLast && /* @__PURE__ */ jsx185(Icon, { name: "chevron-right", size: "xs", "aria-hidden": true, className: styles59.separator })
|
|
6453
6477
|
] }, item.label + index);
|
|
6454
6478
|
}) }) });
|
|
6455
6479
|
}
|
|
6456
6480
|
|
|
6457
6481
|
// src/components/Pagination/Pagination.tsx
|
|
6458
|
-
import
|
|
6459
|
-
import { jsx as
|
|
6482
|
+
import styles60 from "./Pagination.module.css";
|
|
6483
|
+
import { jsx as jsx186, jsxs as jsxs150 } from "react/jsx-runtime";
|
|
6460
6484
|
function getPageList(page, totalPages) {
|
|
6461
6485
|
if (totalPages <= 1) return [1];
|
|
6462
6486
|
const siblingCount = 1;
|
|
@@ -6479,24 +6503,24 @@ function Pagination({
|
|
|
6479
6503
|
"aria-label": ariaLabel = "Pagination"
|
|
6480
6504
|
}) {
|
|
6481
6505
|
const pages = getPageList(page, totalPages);
|
|
6482
|
-
return /* @__PURE__ */
|
|
6483
|
-
/* @__PURE__ */
|
|
6506
|
+
return /* @__PURE__ */ jsxs150("nav", { "aria-label": ariaLabel, className: [styles60.nav, className].filter(Boolean).join(" "), children: [
|
|
6507
|
+
/* @__PURE__ */ jsx186(
|
|
6484
6508
|
"button",
|
|
6485
6509
|
{
|
|
6486
6510
|
type: "button",
|
|
6487
|
-
className:
|
|
6511
|
+
className: styles60.navButton,
|
|
6488
6512
|
onClick: () => onChange(page - 1),
|
|
6489
6513
|
disabled: page <= 1,
|
|
6490
6514
|
"aria-label": "Previous page",
|
|
6491
|
-
children: /* @__PURE__ */
|
|
6515
|
+
children: /* @__PURE__ */ jsx186(Icon, { name: "chevron-left", size: "sm", "aria-hidden": true })
|
|
6492
6516
|
}
|
|
6493
6517
|
),
|
|
6494
|
-
/* @__PURE__ */
|
|
6495
|
-
(p, index) => p === "ellipsis" ? /* @__PURE__ */
|
|
6518
|
+
/* @__PURE__ */ jsx186("ul", { className: styles60.list, children: pages.map(
|
|
6519
|
+
(p, index) => p === "ellipsis" ? /* @__PURE__ */ jsx186("li", { className: styles60.ellipsis, "aria-hidden": "true", children: "\u2026" }, `ellipsis-${index}`) : /* @__PURE__ */ jsx186("li", { children: /* @__PURE__ */ jsx186(
|
|
6496
6520
|
"button",
|
|
6497
6521
|
{
|
|
6498
6522
|
type: "button",
|
|
6499
|
-
className: [
|
|
6523
|
+
className: [styles60.pageButton, p === page ? styles60.active : ""].filter(Boolean).join(" "),
|
|
6500
6524
|
onClick: () => onChange(p),
|
|
6501
6525
|
"aria-current": p === page ? "page" : void 0,
|
|
6502
6526
|
"aria-label": `Page ${p}`,
|
|
@@ -6504,31 +6528,31 @@ function Pagination({
|
|
|
6504
6528
|
}
|
|
6505
6529
|
) }, p)
|
|
6506
6530
|
) }),
|
|
6507
|
-
/* @__PURE__ */
|
|
6531
|
+
/* @__PURE__ */ jsx186(
|
|
6508
6532
|
"button",
|
|
6509
6533
|
{
|
|
6510
6534
|
type: "button",
|
|
6511
|
-
className:
|
|
6535
|
+
className: styles60.navButton,
|
|
6512
6536
|
onClick: () => onChange(page + 1),
|
|
6513
6537
|
disabled: page >= totalPages,
|
|
6514
6538
|
"aria-label": "Next page",
|
|
6515
|
-
children: /* @__PURE__ */
|
|
6539
|
+
children: /* @__PURE__ */ jsx186(Icon, { name: "chevron-right", size: "sm", "aria-hidden": true })
|
|
6516
6540
|
}
|
|
6517
6541
|
)
|
|
6518
6542
|
] });
|
|
6519
6543
|
}
|
|
6520
6544
|
|
|
6521
6545
|
// src/components/Kbd/Kbd.tsx
|
|
6522
|
-
import
|
|
6523
|
-
import { jsx as
|
|
6546
|
+
import styles61 from "./Kbd.module.css";
|
|
6547
|
+
import { jsx as jsx187 } from "react/jsx-runtime";
|
|
6524
6548
|
function Kbd({ children, className }) {
|
|
6525
|
-
return /* @__PURE__ */
|
|
6549
|
+
return /* @__PURE__ */ jsx187("kbd", { className: [styles61.kbd, className].filter(Boolean).join(" "), children });
|
|
6526
6550
|
}
|
|
6527
6551
|
|
|
6528
6552
|
// src/components/Collapsible/Collapsible.tsx
|
|
6529
6553
|
import { useId as useId8 } from "react";
|
|
6530
|
-
import
|
|
6531
|
-
import { jsx as
|
|
6554
|
+
import styles62 from "./Collapsible.module.css";
|
|
6555
|
+
import { jsx as jsx188, jsxs as jsxs151 } from "react/jsx-runtime";
|
|
6532
6556
|
function Collapsible({
|
|
6533
6557
|
open,
|
|
6534
6558
|
onOpenChange,
|
|
@@ -6539,45 +6563,45 @@ function Collapsible({
|
|
|
6539
6563
|
}) {
|
|
6540
6564
|
const generatedId = useId8();
|
|
6541
6565
|
const contentId = `${id ?? generatedId}-content`;
|
|
6542
|
-
return /* @__PURE__ */
|
|
6543
|
-
/* @__PURE__ */
|
|
6566
|
+
return /* @__PURE__ */ jsxs151("div", { className: [styles62.root, className].filter(Boolean).join(" "), children: [
|
|
6567
|
+
/* @__PURE__ */ jsxs151(
|
|
6544
6568
|
"button",
|
|
6545
6569
|
{
|
|
6546
6570
|
type: "button",
|
|
6547
|
-
className:
|
|
6571
|
+
className: styles62.trigger,
|
|
6548
6572
|
"aria-expanded": open,
|
|
6549
6573
|
"aria-controls": contentId,
|
|
6550
6574
|
onClick: () => onOpenChange(!open),
|
|
6551
6575
|
children: [
|
|
6552
|
-
/* @__PURE__ */
|
|
6553
|
-
/* @__PURE__ */
|
|
6576
|
+
/* @__PURE__ */ jsx188("span", { className: styles62.triggerLabel, children: trigger }),
|
|
6577
|
+
/* @__PURE__ */ jsx188(
|
|
6554
6578
|
Icon,
|
|
6555
6579
|
{
|
|
6556
6580
|
name: "chevron-down",
|
|
6557
6581
|
size: "sm",
|
|
6558
6582
|
"aria-hidden": true,
|
|
6559
|
-
className: [
|
|
6583
|
+
className: [styles62.chevron, open ? styles62.chevronOpen : ""].filter(Boolean).join(" ")
|
|
6560
6584
|
}
|
|
6561
6585
|
)
|
|
6562
6586
|
]
|
|
6563
6587
|
}
|
|
6564
6588
|
),
|
|
6565
|
-
/* @__PURE__ */
|
|
6589
|
+
/* @__PURE__ */ jsx188(
|
|
6566
6590
|
"div",
|
|
6567
6591
|
{
|
|
6568
6592
|
id: contentId,
|
|
6569
|
-
className:
|
|
6593
|
+
className: styles62.contentWrapper,
|
|
6570
6594
|
"data-open": open,
|
|
6571
6595
|
inert: !open || void 0,
|
|
6572
|
-
children: /* @__PURE__ */
|
|
6596
|
+
children: /* @__PURE__ */ jsx188("div", { className: styles62.contentInner, children })
|
|
6573
6597
|
}
|
|
6574
6598
|
)
|
|
6575
6599
|
] });
|
|
6576
6600
|
}
|
|
6577
6601
|
|
|
6578
6602
|
// src/components/Accordion/Accordion.tsx
|
|
6579
|
-
import
|
|
6580
|
-
import { jsx as
|
|
6603
|
+
import styles63 from "./Accordion.module.css";
|
|
6604
|
+
import { jsx as jsx189 } from "react/jsx-runtime";
|
|
6581
6605
|
function Accordion({ items, type, openIds, onOpenIdsChange, className }) {
|
|
6582
6606
|
function handleOpenChange(id, open) {
|
|
6583
6607
|
if (type === "single") {
|
|
@@ -6586,7 +6610,7 @@ function Accordion({ items, type, openIds, onOpenIdsChange, className }) {
|
|
|
6586
6610
|
}
|
|
6587
6611
|
onOpenIdsChange(open ? [...openIds, id] : openIds.filter((openId) => openId !== id));
|
|
6588
6612
|
}
|
|
6589
|
-
return /* @__PURE__ */
|
|
6613
|
+
return /* @__PURE__ */ jsx189("div", { className: [styles63.root, className].filter(Boolean).join(" "), children: items.map((item) => /* @__PURE__ */ jsx189(
|
|
6590
6614
|
Collapsible,
|
|
6591
6615
|
{
|
|
6592
6616
|
id: item.id,
|
|
@@ -6600,13 +6624,13 @@ function Accordion({ items, type, openIds, onOpenIdsChange, className }) {
|
|
|
6600
6624
|
}
|
|
6601
6625
|
|
|
6602
6626
|
// src/components/AspectRatio/AspectRatio.tsx
|
|
6603
|
-
import
|
|
6604
|
-
import { jsx as
|
|
6627
|
+
import styles64 from "./AspectRatio.module.css";
|
|
6628
|
+
import { jsx as jsx190 } from "react/jsx-runtime";
|
|
6605
6629
|
function AspectRatio({ ratio, children, className }) {
|
|
6606
|
-
return /* @__PURE__ */
|
|
6630
|
+
return /* @__PURE__ */ jsx190(
|
|
6607
6631
|
"div",
|
|
6608
6632
|
{
|
|
6609
|
-
className: [
|
|
6633
|
+
className: [styles64.root, className].filter(Boolean).join(" "),
|
|
6610
6634
|
style: { aspectRatio: ratio },
|
|
6611
6635
|
children
|
|
6612
6636
|
}
|
|
@@ -6614,8 +6638,8 @@ function AspectRatio({ ratio, children, className }) {
|
|
|
6614
6638
|
}
|
|
6615
6639
|
|
|
6616
6640
|
// src/components/ButtonLink/ButtonLink.tsx
|
|
6617
|
-
import
|
|
6618
|
-
import { jsx as
|
|
6641
|
+
import styles65 from "./Button.module.css";
|
|
6642
|
+
import { jsx as jsx191 } from "react/jsx-runtime";
|
|
6619
6643
|
function ButtonLink({
|
|
6620
6644
|
variant = "primary",
|
|
6621
6645
|
size = "md",
|
|
@@ -6624,29 +6648,29 @@ function ButtonLink({
|
|
|
6624
6648
|
renderLink,
|
|
6625
6649
|
...rest
|
|
6626
6650
|
}) {
|
|
6627
|
-
const classes = [
|
|
6651
|
+
const classes = [styles65.button, styles65[variant], styles65[size], styles65.link, className].filter(Boolean).join(" ");
|
|
6628
6652
|
const props = { ...rest, className: classes, children };
|
|
6629
|
-
return renderLink ? renderLink(props) : /* @__PURE__ */
|
|
6653
|
+
return renderLink ? renderLink(props) : /* @__PURE__ */ jsx191("a", { ...rest, className: classes, children });
|
|
6630
6654
|
}
|
|
6631
6655
|
|
|
6632
6656
|
// src/components/ButtonGroup/ButtonGroup.tsx
|
|
6633
|
-
import
|
|
6634
|
-
import { jsx as
|
|
6657
|
+
import styles66 from "./ButtonGroup.module.css";
|
|
6658
|
+
import { jsx as jsx192 } from "react/jsx-runtime";
|
|
6635
6659
|
function ButtonGroup({ children, className, "aria-label": ariaLabel }) {
|
|
6636
|
-
return /* @__PURE__ */
|
|
6660
|
+
return /* @__PURE__ */ jsx192(
|
|
6637
6661
|
"div",
|
|
6638
6662
|
{
|
|
6639
6663
|
role: "group",
|
|
6640
6664
|
"aria-label": ariaLabel,
|
|
6641
|
-
className: [
|
|
6665
|
+
className: [styles66.root, className].filter(Boolean).join(" "),
|
|
6642
6666
|
children
|
|
6643
6667
|
}
|
|
6644
6668
|
);
|
|
6645
6669
|
}
|
|
6646
6670
|
|
|
6647
6671
|
// src/components/Item/Item.tsx
|
|
6648
|
-
import
|
|
6649
|
-
import { Fragment as
|
|
6672
|
+
import styles67 from "./Item.module.css";
|
|
6673
|
+
import { Fragment as Fragment13, jsx as jsx193, jsxs as jsxs152 } from "react/jsx-runtime";
|
|
6650
6674
|
function Item({
|
|
6651
6675
|
leading,
|
|
6652
6676
|
title,
|
|
@@ -6657,29 +6681,29 @@ function Item({
|
|
|
6657
6681
|
className
|
|
6658
6682
|
}) {
|
|
6659
6683
|
const interactive = Boolean(onClick);
|
|
6660
|
-
const classes = [
|
|
6661
|
-
const content = /* @__PURE__ */
|
|
6662
|
-
leading && /* @__PURE__ */
|
|
6663
|
-
/* @__PURE__ */
|
|
6664
|
-
/* @__PURE__ */
|
|
6665
|
-
description && /* @__PURE__ */
|
|
6684
|
+
const classes = [styles67.root, interactive ? styles67.interactive : "", className].filter(Boolean).join(" ");
|
|
6685
|
+
const content = /* @__PURE__ */ jsxs152(Fragment13, { children: [
|
|
6686
|
+
leading && /* @__PURE__ */ jsx193("span", { className: styles67.leading, children: leading }),
|
|
6687
|
+
/* @__PURE__ */ jsxs152("span", { className: styles67.content, children: [
|
|
6688
|
+
/* @__PURE__ */ jsx193("span", { className: styles67.title, children: title }),
|
|
6689
|
+
description && /* @__PURE__ */ jsx193("span", { className: styles67.description, children: description })
|
|
6666
6690
|
] }),
|
|
6667
|
-
trailing && /* @__PURE__ */
|
|
6691
|
+
trailing && /* @__PURE__ */ jsx193("span", { className: styles67.trailing, children: trailing })
|
|
6668
6692
|
] });
|
|
6669
6693
|
if (interactive) {
|
|
6670
|
-
return /* @__PURE__ */
|
|
6694
|
+
return /* @__PURE__ */ jsx193("button", { type: "button", onClick, disabled, className: classes, children: content });
|
|
6671
6695
|
}
|
|
6672
|
-
return /* @__PURE__ */
|
|
6696
|
+
return /* @__PURE__ */ jsx193("div", { className: classes, children: content });
|
|
6673
6697
|
}
|
|
6674
6698
|
|
|
6675
6699
|
// src/components/Label/Label.tsx
|
|
6676
|
-
import
|
|
6677
|
-
import { jsx as
|
|
6700
|
+
import styles68 from "./Label.module.css";
|
|
6701
|
+
import { jsx as jsx194 } from "react/jsx-runtime";
|
|
6678
6702
|
function Label({ disabled, className, children, ...rest }) {
|
|
6679
|
-
return /* @__PURE__ */
|
|
6703
|
+
return /* @__PURE__ */ jsx194(
|
|
6680
6704
|
"label",
|
|
6681
6705
|
{
|
|
6682
|
-
className: [
|
|
6706
|
+
className: [styles68.label, disabled ? styles68.disabled : "", className].filter(Boolean).join(" "),
|
|
6683
6707
|
...rest,
|
|
6684
6708
|
children
|
|
6685
6709
|
}
|
|
@@ -6687,49 +6711,512 @@ function Label({ disabled, className, children, ...rest }) {
|
|
|
6687
6711
|
}
|
|
6688
6712
|
|
|
6689
6713
|
// src/components/ScrollArea/ScrollArea.tsx
|
|
6690
|
-
import
|
|
6691
|
-
import { jsx as
|
|
6714
|
+
import styles69 from "./ScrollArea.module.css";
|
|
6715
|
+
import { jsx as jsx195 } from "react/jsx-runtime";
|
|
6692
6716
|
function ScrollArea({ children, maxHeight, maxWidth, className }) {
|
|
6693
6717
|
const style = {};
|
|
6694
6718
|
if (maxHeight !== void 0) style.maxHeight = maxHeight;
|
|
6695
6719
|
if (maxWidth !== void 0) style.maxWidth = maxWidth;
|
|
6696
|
-
return /* @__PURE__ */
|
|
6720
|
+
return /* @__PURE__ */ jsx195("div", { className: [styles69.root, className].filter(Boolean).join(" "), style, children });
|
|
6721
|
+
}
|
|
6722
|
+
|
|
6723
|
+
// src/components/FloatingActionButton/FloatingActionButton.tsx
|
|
6724
|
+
import styles70 from "./FloatingActionButton.module.css";
|
|
6725
|
+
import { Fragment as Fragment14, jsx as jsx196, jsxs as jsxs153 } from "react/jsx-runtime";
|
|
6726
|
+
function FloatingActionButton({
|
|
6727
|
+
label,
|
|
6728
|
+
icon,
|
|
6729
|
+
extended = false,
|
|
6730
|
+
className,
|
|
6731
|
+
href,
|
|
6732
|
+
type = "button",
|
|
6733
|
+
disabled,
|
|
6734
|
+
rel,
|
|
6735
|
+
target,
|
|
6736
|
+
...rest
|
|
6737
|
+
}) {
|
|
6738
|
+
const cls = [styles70.fab, extended ? styles70.extended : "", className].filter(Boolean).join(" ");
|
|
6739
|
+
const content = /* @__PURE__ */ jsxs153(Fragment14, { children: [
|
|
6740
|
+
/* @__PURE__ */ jsx196("span", { className: styles70.icon, "aria-hidden": "true", children: icon }),
|
|
6741
|
+
extended ? /* @__PURE__ */ jsx196("span", { className: styles70.label, children: label }) : null
|
|
6742
|
+
] });
|
|
6743
|
+
if (href !== void 0) {
|
|
6744
|
+
return /* @__PURE__ */ jsx196(
|
|
6745
|
+
"a",
|
|
6746
|
+
{
|
|
6747
|
+
...rest,
|
|
6748
|
+
href,
|
|
6749
|
+
...rel !== void 0 ? { rel } : {},
|
|
6750
|
+
...target !== void 0 ? { target } : {},
|
|
6751
|
+
className: cls,
|
|
6752
|
+
"aria-label": label,
|
|
6753
|
+
children: content
|
|
6754
|
+
}
|
|
6755
|
+
);
|
|
6756
|
+
}
|
|
6757
|
+
return /* @__PURE__ */ jsx196("button", { ...rest, type, disabled, className: cls, "aria-label": label, children: content });
|
|
6758
|
+
}
|
|
6759
|
+
|
|
6760
|
+
// src/components/PhotoViewer/PhotoGrid.tsx
|
|
6761
|
+
import { useState as useState17 } from "react";
|
|
6762
|
+
|
|
6763
|
+
// src/components/PhotoViewer/PhotoViewer.tsx
|
|
6764
|
+
import {
|
|
6765
|
+
useCallback as useCallback5,
|
|
6766
|
+
useEffect as useEffect12,
|
|
6767
|
+
useRef as useRef19,
|
|
6768
|
+
useState as useState16
|
|
6769
|
+
} from "react";
|
|
6770
|
+
import { createPortal as createPortal4 } from "react-dom";
|
|
6771
|
+
|
|
6772
|
+
// src/components/PhotoViewer/photoGestures.ts
|
|
6773
|
+
var MIN_SCALE = 1;
|
|
6774
|
+
var MAX_SCALE = 5;
|
|
6775
|
+
var DOUBLE_TAP_SCALE = 2.5;
|
|
6776
|
+
var SWIPE_FRACTION = 0.2;
|
|
6777
|
+
var SWIPE_VELOCITY = 0.5;
|
|
6778
|
+
var DISMISS_DISTANCE = 110;
|
|
6779
|
+
var DISMISS_VELOCITY = 0.6;
|
|
6780
|
+
var DOUBLE_TAP_MS2 = 300;
|
|
6781
|
+
var DOUBLE_TAP_PX = 32;
|
|
6782
|
+
var clamp2 = (value, low, high) => Math.min(high, Math.max(low, value));
|
|
6783
|
+
var clampScale = (scale) => clamp2(scale, MIN_SCALE, MAX_SCALE);
|
|
6784
|
+
var distance = (a, b) => Math.hypot(a.x - b.x, a.y - b.y);
|
|
6785
|
+
var midpoint = (a, b) => ({ x: (a.x + b.x) / 2, y: (a.y + b.y) / 2 });
|
|
6786
|
+
function pinchScale(startScale, startDistance, nowDistance) {
|
|
6787
|
+
if (startDistance <= 0) return clampScale(startScale);
|
|
6788
|
+
return clampScale(startScale * nowDistance / startDistance);
|
|
6789
|
+
}
|
|
6790
|
+
function panLimit(size, box, scale) {
|
|
6791
|
+
return {
|
|
6792
|
+
x: Math.max(0, (size.width * scale - box.width) / 2),
|
|
6793
|
+
y: Math.max(0, (size.height * scale - box.height) / 2)
|
|
6794
|
+
};
|
|
6795
|
+
}
|
|
6796
|
+
function clampPan(pan, size, box, scale) {
|
|
6797
|
+
const limit = panLimit(size, box, scale);
|
|
6798
|
+
return { x: clamp2(pan.x, -limit.x, limit.x), y: clamp2(pan.y, -limit.y, limit.y) };
|
|
6799
|
+
}
|
|
6800
|
+
function panAfterZoom(pan, focus, from, to) {
|
|
6801
|
+
const ratio = to / from;
|
|
6802
|
+
return { x: focus.x - (focus.x - pan.x) * ratio, y: focus.y - (focus.y - pan.y) * ratio };
|
|
6803
|
+
}
|
|
6804
|
+
function judgeDrag(input) {
|
|
6805
|
+
const { dx, dy, width, hasPrevious, hasNext } = input;
|
|
6806
|
+
const ms = Math.max(1, input.ms);
|
|
6807
|
+
if (Math.abs(dx) >= Math.abs(dy)) {
|
|
6808
|
+
const quick = Math.abs(dx) / ms >= SWIPE_VELOCITY && Math.abs(dx) >= 24;
|
|
6809
|
+
if (Math.abs(dx) >= width * SWIPE_FRACTION || quick) {
|
|
6810
|
+
if (dx < 0 && hasNext) return { kind: "next" };
|
|
6811
|
+
if (dx > 0 && hasPrevious) return { kind: "previous" };
|
|
6812
|
+
}
|
|
6813
|
+
return { kind: "stay" };
|
|
6814
|
+
}
|
|
6815
|
+
if (dy > 0 && (dy >= DISMISS_DISTANCE || dy / ms >= DISMISS_VELOCITY && dy >= 40))
|
|
6816
|
+
return { kind: "dismiss" };
|
|
6817
|
+
return { kind: "stay" };
|
|
6818
|
+
}
|
|
6819
|
+
function isDoubleTap(last, now) {
|
|
6820
|
+
return last !== void 0 && now.at - last.at <= DOUBLE_TAP_MS2 && distance(last.point, now.point) <= DOUBLE_TAP_PX;
|
|
6821
|
+
}
|
|
6822
|
+
var doubleTapScale = (scale) => scale > MIN_SCALE + 0.01 ? MIN_SCALE : DOUBLE_TAP_SCALE;
|
|
6823
|
+
var stepIndex = (index, step, count) => clamp2(index + step, 0, Math.max(0, count - 1));
|
|
6824
|
+
|
|
6825
|
+
// src/components/PhotoViewer/PhotoViewer.tsx
|
|
6826
|
+
import styles71 from "./PhotoViewer.module.css";
|
|
6827
|
+
import { jsx as jsx197, jsxs as jsxs154 } from "react/jsx-runtime";
|
|
6828
|
+
var TAP_SLOP_PX = 8;
|
|
6829
|
+
function PhotoViewer({
|
|
6830
|
+
photos,
|
|
6831
|
+
open,
|
|
6832
|
+
index,
|
|
6833
|
+
onIndexChange,
|
|
6834
|
+
onClose,
|
|
6835
|
+
label = "Photos"
|
|
6836
|
+
}) {
|
|
6837
|
+
const panelRef = useRef19(null);
|
|
6838
|
+
const stageRef = useRef19(null);
|
|
6839
|
+
const imageRef = useRef19(null);
|
|
6840
|
+
const reducedMotion = usePrefersReducedMotion();
|
|
6841
|
+
const { mounted, phase } = useMountTransition(
|
|
6842
|
+
open,
|
|
6843
|
+
reducedMotion ? 0 : OVERLAY_MOTION_DURATION_MS
|
|
6844
|
+
);
|
|
6845
|
+
const portalTarget = useOverlayPortalTarget();
|
|
6846
|
+
useOverlayScrollLock(mounted);
|
|
6847
|
+
useOverlayFocusCapture(panelRef, mounted && portalTarget !== null);
|
|
6848
|
+
useOverlayKeyboardTrap(panelRef, open, onClose);
|
|
6849
|
+
const count = photos.length;
|
|
6850
|
+
const current = clamp2(index, 0, Math.max(0, count - 1));
|
|
6851
|
+
const photo = photos[current];
|
|
6852
|
+
const [scale, setScale] = useState16(MIN_SCALE);
|
|
6853
|
+
const [pan, setPan] = useState16({ x: 0, y: 0 });
|
|
6854
|
+
const [drag, setDrag] = useState16({ x: 0, y: 0 });
|
|
6855
|
+
const [dragging, setDragging] = useState16(false);
|
|
6856
|
+
const [failed, setFailed] = useState16(false);
|
|
6857
|
+
const pointers = useRef19(/* @__PURE__ */ new Map());
|
|
6858
|
+
const gesture = useRef19({
|
|
6859
|
+
startScale: 1,
|
|
6860
|
+
startPan: { x: 0, y: 0 },
|
|
6861
|
+
startDistance: 0,
|
|
6862
|
+
start: { x: 0, y: 0 },
|
|
6863
|
+
startAt: 0,
|
|
6864
|
+
axis: void 0,
|
|
6865
|
+
moved: false,
|
|
6866
|
+
pinched: false
|
|
6867
|
+
});
|
|
6868
|
+
const lastTap = useRef19(void 0);
|
|
6869
|
+
useEffect12(() => {
|
|
6870
|
+
setScale(MIN_SCALE);
|
|
6871
|
+
setPan({ x: 0, y: 0 });
|
|
6872
|
+
setDrag({ x: 0, y: 0 });
|
|
6873
|
+
setFailed(false);
|
|
6874
|
+
}, [current, open]);
|
|
6875
|
+
useEffect12(() => {
|
|
6876
|
+
if (!open) return;
|
|
6877
|
+
for (const next of [photos[current - 1], photos[current + 1]]) {
|
|
6878
|
+
if (next) new Image().src = next.src;
|
|
6879
|
+
}
|
|
6880
|
+
}, [open, current, photos]);
|
|
6881
|
+
const go = useCallback5(
|
|
6882
|
+
(step) => {
|
|
6883
|
+
const next = stepIndex(current, step, count);
|
|
6884
|
+
if (next !== current) onIndexChange(next);
|
|
6885
|
+
},
|
|
6886
|
+
[current, count, onIndexChange]
|
|
6887
|
+
);
|
|
6888
|
+
const sizes = useCallback5(() => {
|
|
6889
|
+
const stage = stageRef.current?.getBoundingClientRect();
|
|
6890
|
+
const image = imageRef.current;
|
|
6891
|
+
const box = { width: stage?.width ?? 0, height: stage?.height ?? 0 };
|
|
6892
|
+
const natural = {
|
|
6893
|
+
width: image?.naturalWidth || box.width,
|
|
6894
|
+
height: image?.naturalHeight || box.height
|
|
6895
|
+
};
|
|
6896
|
+
const fit = Math.min(box.width / natural.width, box.height / natural.height) || 1;
|
|
6897
|
+
return { box, size: { width: natural.width * fit, height: natural.height * fit } };
|
|
6898
|
+
}, []);
|
|
6899
|
+
const zoomTo = useCallback5(
|
|
6900
|
+
(next, focus = { x: 0, y: 0 }) => {
|
|
6901
|
+
const to = clampScale(next);
|
|
6902
|
+
const { box, size } = sizes();
|
|
6903
|
+
setPan((from) => clampPan(panAfterZoom(from, focus, scale, to), size, box, to));
|
|
6904
|
+
setScale(to);
|
|
6905
|
+
},
|
|
6906
|
+
[scale, sizes]
|
|
6907
|
+
);
|
|
6908
|
+
useEffect12(() => {
|
|
6909
|
+
if (!open) return;
|
|
6910
|
+
function onKey(event) {
|
|
6911
|
+
if (event.key === "ArrowRight") go(1);
|
|
6912
|
+
else if (event.key === "ArrowLeft") go(-1);
|
|
6913
|
+
else if (event.key === "Home") onIndexChange(0);
|
|
6914
|
+
else if (event.key === "End") onIndexChange(Math.max(0, count - 1));
|
|
6915
|
+
else if (event.key === "+" || event.key === "=") zoomTo(scale * 1.5);
|
|
6916
|
+
else if (event.key === "-") zoomTo(scale / 1.5);
|
|
6917
|
+
else if (event.key === "0") zoomTo(MIN_SCALE);
|
|
6918
|
+
else return;
|
|
6919
|
+
event.preventDefault();
|
|
6920
|
+
}
|
|
6921
|
+
document.addEventListener("keydown", onKey);
|
|
6922
|
+
return () => document.removeEventListener("keydown", onKey);
|
|
6923
|
+
}, [open, go, onIndexChange, count, zoomTo, scale]);
|
|
6924
|
+
const focusOf = (x, y) => {
|
|
6925
|
+
const rect = stageRef.current?.getBoundingClientRect();
|
|
6926
|
+
return rect ? { x: x - rect.left - rect.width / 2, y: y - rect.top - rect.height / 2 } : { x: 0, y: 0 };
|
|
6927
|
+
};
|
|
6928
|
+
function onPointerDown(event) {
|
|
6929
|
+
if (event.pointerType === "mouse" && event.button !== 0) return;
|
|
6930
|
+
event.currentTarget.setPointerCapture?.(event.pointerId);
|
|
6931
|
+
pointers.current.set(event.pointerId, { x: event.clientX, y: event.clientY });
|
|
6932
|
+
const g = gesture.current;
|
|
6933
|
+
if (pointers.current.size === 1) {
|
|
6934
|
+
g.start = { x: event.clientX, y: event.clientY };
|
|
6935
|
+
g.startAt = event.timeStamp;
|
|
6936
|
+
g.startScale = scale;
|
|
6937
|
+
g.startPan = pan;
|
|
6938
|
+
g.axis = void 0;
|
|
6939
|
+
g.moved = false;
|
|
6940
|
+
g.pinched = false;
|
|
6941
|
+
setDragging(true);
|
|
6942
|
+
} else if (pointers.current.size === 2) {
|
|
6943
|
+
const [a, b] = [...pointers.current.values()];
|
|
6944
|
+
g.startDistance = distance(a, b);
|
|
6945
|
+
g.startScale = scale;
|
|
6946
|
+
g.startPan = pan;
|
|
6947
|
+
g.pinched = true;
|
|
6948
|
+
g.moved = true;
|
|
6949
|
+
setDrag({ x: 0, y: 0 });
|
|
6950
|
+
}
|
|
6951
|
+
}
|
|
6952
|
+
function onPointerMove(event) {
|
|
6953
|
+
if (!pointers.current.has(event.pointerId)) return;
|
|
6954
|
+
pointers.current.set(event.pointerId, { x: event.clientX, y: event.clientY });
|
|
6955
|
+
const g = gesture.current;
|
|
6956
|
+
const { box, size } = sizes();
|
|
6957
|
+
if (pointers.current.size >= 2) {
|
|
6958
|
+
const [a, b] = [...pointers.current.values()];
|
|
6959
|
+
const to = pinchScale(g.startScale, g.startDistance, distance(a, b));
|
|
6960
|
+
const mid = midpoint(a, b);
|
|
6961
|
+
const focus = focusOf(mid.x, mid.y);
|
|
6962
|
+
setPan(clampPan(panAfterZoom(g.startPan, focus, g.startScale, to), size, box, to));
|
|
6963
|
+
setScale(to);
|
|
6964
|
+
return;
|
|
6965
|
+
}
|
|
6966
|
+
if (g.pinched) return;
|
|
6967
|
+
const dx = event.clientX - g.start.x;
|
|
6968
|
+
const dy = event.clientY - g.start.y;
|
|
6969
|
+
if (!g.moved && Math.hypot(dx, dy) < TAP_SLOP_PX) return;
|
|
6970
|
+
g.moved = true;
|
|
6971
|
+
if (scale > MIN_SCALE) {
|
|
6972
|
+
setPan(clampPan({ x: g.startPan.x + dx, y: g.startPan.y + dy }, size, box, scale));
|
|
6973
|
+
return;
|
|
6974
|
+
}
|
|
6975
|
+
g.axis ??= Math.abs(dx) >= Math.abs(dy) ? "x" : "y";
|
|
6976
|
+
setDrag(g.axis === "x" ? { x: dx, y: 0 } : { x: 0, y: Math.max(0, dy) });
|
|
6977
|
+
}
|
|
6978
|
+
function onPointerUp(event) {
|
|
6979
|
+
if (!pointers.current.has(event.pointerId)) return;
|
|
6980
|
+
pointers.current.delete(event.pointerId);
|
|
6981
|
+
const g = gesture.current;
|
|
6982
|
+
if (pointers.current.size > 0) return;
|
|
6983
|
+
setDragging(false);
|
|
6984
|
+
if (g.pinched) {
|
|
6985
|
+
g.pinched = false;
|
|
6986
|
+
setDrag({ x: 0, y: 0 });
|
|
6987
|
+
return;
|
|
6988
|
+
}
|
|
6989
|
+
if (!g.moved) {
|
|
6990
|
+
const tap = { at: event.timeStamp, point: { x: event.clientX, y: event.clientY } };
|
|
6991
|
+
if (isDoubleTap(lastTap.current, tap)) {
|
|
6992
|
+
lastTap.current = void 0;
|
|
6993
|
+
zoomTo(doubleTapScale(scale), focusOf(event.clientX, event.clientY));
|
|
6994
|
+
} else lastTap.current = tap;
|
|
6995
|
+
return;
|
|
6996
|
+
}
|
|
6997
|
+
if (scale > MIN_SCALE) return;
|
|
6998
|
+
const result = judgeDrag({
|
|
6999
|
+
dx: event.clientX - g.start.x,
|
|
7000
|
+
dy: event.clientY - g.start.y,
|
|
7001
|
+
ms: event.timeStamp - g.startAt,
|
|
7002
|
+
width: stageRef.current?.getBoundingClientRect().width ?? 1,
|
|
7003
|
+
hasPrevious: current > 0,
|
|
7004
|
+
hasNext: current < count - 1
|
|
7005
|
+
});
|
|
7006
|
+
setDrag({ x: 0, y: 0 });
|
|
7007
|
+
if (result.kind === "next") go(1);
|
|
7008
|
+
else if (result.kind === "previous") go(-1);
|
|
7009
|
+
else if (result.kind === "dismiss") onClose();
|
|
7010
|
+
}
|
|
7011
|
+
function onPointerCancel(event) {
|
|
7012
|
+
pointers.current.delete(event.pointerId);
|
|
7013
|
+
if (pointers.current.size === 0) {
|
|
7014
|
+
gesture.current.pinched = false;
|
|
7015
|
+
setDragging(false);
|
|
7016
|
+
setDrag({ x: 0, y: 0 });
|
|
7017
|
+
}
|
|
7018
|
+
}
|
|
7019
|
+
function onWheel(event) {
|
|
7020
|
+
zoomTo(
|
|
7021
|
+
scale * Math.exp(-event.deltaY * (event.ctrlKey ? 0.01 : 2e-3)),
|
|
7022
|
+
focusOf(event.clientX, event.clientY)
|
|
7023
|
+
);
|
|
7024
|
+
}
|
|
7025
|
+
function onStageKeyDown(event) {
|
|
7026
|
+
if (scale <= MIN_SCALE) return;
|
|
7027
|
+
const step = 60;
|
|
7028
|
+
const moves = {
|
|
7029
|
+
ArrowUp: { x: 0, y: step },
|
|
7030
|
+
ArrowDown: { x: 0, y: -step },
|
|
7031
|
+
ArrowLeft: { x: step, y: 0 },
|
|
7032
|
+
ArrowRight: { x: -step, y: 0 }
|
|
7033
|
+
};
|
|
7034
|
+
const move = moves[event.key];
|
|
7035
|
+
if (!move) return;
|
|
7036
|
+
const { box, size } = sizes();
|
|
7037
|
+
setPan((from) => clampPan({ x: from.x + move.x, y: from.y + move.y }, size, box, scale));
|
|
7038
|
+
event.stopPropagation();
|
|
7039
|
+
event.preventDefault();
|
|
7040
|
+
}
|
|
7041
|
+
if (!mounted || !portalTarget || !photo) return null;
|
|
7042
|
+
const isOpenPhase = phase === "open";
|
|
7043
|
+
const fade = clamp2(1 - drag.y / 400, 0.3, 1);
|
|
7044
|
+
const transform = `translate3d(${pan.x + drag.x}px, ${pan.y + drag.y}px, 0) scale(${scale})`;
|
|
7045
|
+
return createPortal4(
|
|
7046
|
+
/* @__PURE__ */ jsx197(
|
|
7047
|
+
"div",
|
|
7048
|
+
{
|
|
7049
|
+
className: [styles71.scrim, isOpenPhase ? styles71.scrimOpen : ""].filter(Boolean).join(" "),
|
|
7050
|
+
style: { ["--photo-fade"]: String(fade) },
|
|
7051
|
+
children: /* @__PURE__ */ jsxs154(
|
|
7052
|
+
"div",
|
|
7053
|
+
{
|
|
7054
|
+
ref: panelRef,
|
|
7055
|
+
role: "dialog",
|
|
7056
|
+
"aria-modal": "true",
|
|
7057
|
+
"aria-label": label,
|
|
7058
|
+
"aria-roledescription": "photo viewer",
|
|
7059
|
+
tabIndex: -1,
|
|
7060
|
+
className: styles71.panel,
|
|
7061
|
+
children: [
|
|
7062
|
+
/* @__PURE__ */ jsxs154("div", { className: styles71.bar, children: [
|
|
7063
|
+
/* @__PURE__ */ jsxs154("span", { className: styles71.count, "aria-live": "polite", "aria-atomic": "true", children: [
|
|
7064
|
+
current + 1,
|
|
7065
|
+
" of ",
|
|
7066
|
+
count
|
|
7067
|
+
] }),
|
|
7068
|
+
/* @__PURE__ */ jsx197("button", { type: "button", className: styles71.control, "aria-label": "Close", onClick: onClose, children: /* @__PURE__ */ jsx197(Icon, { name: "x", size: "md", "aria-hidden": true }) })
|
|
7069
|
+
] }),
|
|
7070
|
+
/* @__PURE__ */ jsx197(
|
|
7071
|
+
"div",
|
|
7072
|
+
{
|
|
7073
|
+
ref: stageRef,
|
|
7074
|
+
className: styles71.stage,
|
|
7075
|
+
onPointerDown,
|
|
7076
|
+
onPointerMove,
|
|
7077
|
+
onPointerUp,
|
|
7078
|
+
onPointerCancel,
|
|
7079
|
+
onWheel,
|
|
7080
|
+
onKeyDown: onStageKeyDown,
|
|
7081
|
+
children: failed ? /* @__PURE__ */ jsx197("p", { className: styles71.failed, role: "status", children: "This photo could not be shown." }) : /* @__PURE__ */ jsx197(
|
|
7082
|
+
"img",
|
|
7083
|
+
{
|
|
7084
|
+
ref: imageRef,
|
|
7085
|
+
src: photo.src,
|
|
7086
|
+
alt: photo.alt,
|
|
7087
|
+
draggable: false,
|
|
7088
|
+
className: [styles71.image, dragging ? styles71.dragging : ""].filter(Boolean).join(" "),
|
|
7089
|
+
style: { transform },
|
|
7090
|
+
onError: () => setFailed(true)
|
|
7091
|
+
},
|
|
7092
|
+
photo.id
|
|
7093
|
+
)
|
|
7094
|
+
}
|
|
7095
|
+
),
|
|
7096
|
+
current > 0 ? /* @__PURE__ */ jsx197(
|
|
7097
|
+
"button",
|
|
7098
|
+
{
|
|
7099
|
+
type: "button",
|
|
7100
|
+
className: [styles71.control, styles71.previous].join(" "),
|
|
7101
|
+
"aria-label": "Previous photo",
|
|
7102
|
+
onClick: () => go(-1),
|
|
7103
|
+
children: /* @__PURE__ */ jsx197(Icon, { name: "chevron-left", size: "md", "aria-hidden": true })
|
|
7104
|
+
}
|
|
7105
|
+
) : null,
|
|
7106
|
+
current < count - 1 ? /* @__PURE__ */ jsx197(
|
|
7107
|
+
"button",
|
|
7108
|
+
{
|
|
7109
|
+
type: "button",
|
|
7110
|
+
className: [styles71.control, styles71.next].join(" "),
|
|
7111
|
+
"aria-label": "Next photo",
|
|
7112
|
+
onClick: () => go(1),
|
|
7113
|
+
children: /* @__PURE__ */ jsx197(Icon, { name: "chevron-right", size: "md", "aria-hidden": true })
|
|
7114
|
+
}
|
|
7115
|
+
) : null,
|
|
7116
|
+
photo.caption ? /* @__PURE__ */ jsx197("div", { className: styles71.caption, children: photo.caption }) : null
|
|
7117
|
+
]
|
|
7118
|
+
}
|
|
7119
|
+
)
|
|
7120
|
+
}
|
|
7121
|
+
),
|
|
7122
|
+
portalTarget
|
|
7123
|
+
);
|
|
7124
|
+
}
|
|
7125
|
+
|
|
7126
|
+
// src/components/PhotoViewer/PhotoGrid.tsx
|
|
7127
|
+
import styles72 from "./PhotoGrid.module.css";
|
|
7128
|
+
import { Fragment as Fragment15, jsx as jsx198, jsxs as jsxs155 } from "react/jsx-runtime";
|
|
7129
|
+
function PhotoGrid({ photos, onOpen, label = "Photos", className }) {
|
|
7130
|
+
if (photos.length === 0) return null;
|
|
7131
|
+
return /* @__PURE__ */ jsx198("ul", { className: [styles72.grid, className].filter(Boolean).join(" "), "aria-label": label, children: photos.map((photo, index) => /* @__PURE__ */ jsx198("li", { className: styles72.cell, children: /* @__PURE__ */ jsx198(
|
|
7132
|
+
"button",
|
|
7133
|
+
{
|
|
7134
|
+
type: "button",
|
|
7135
|
+
className: styles72.thumb,
|
|
7136
|
+
"aria-label": `Photo ${index + 1} of ${photos.length}: ${photo.alt}`,
|
|
7137
|
+
onClick: () => onOpen(index),
|
|
7138
|
+
children: /* @__PURE__ */ jsx198(
|
|
7139
|
+
"img",
|
|
7140
|
+
{
|
|
7141
|
+
src: photo.thumbSrc ?? photo.src,
|
|
7142
|
+
alt: "",
|
|
7143
|
+
loading: "lazy",
|
|
7144
|
+
decoding: "async",
|
|
7145
|
+
draggable: false,
|
|
7146
|
+
className: styles72.img
|
|
7147
|
+
}
|
|
7148
|
+
)
|
|
7149
|
+
}
|
|
7150
|
+
) }, photo.id)) });
|
|
7151
|
+
}
|
|
7152
|
+
function PhotoGallery({ photos, label, className, onView }) {
|
|
7153
|
+
const [open, setOpen] = useState17(false);
|
|
7154
|
+
const [index, setIndex] = useState17(0);
|
|
7155
|
+
return /* @__PURE__ */ jsxs155(Fragment15, { children: [
|
|
7156
|
+
/* @__PURE__ */ jsx198(
|
|
7157
|
+
PhotoGrid,
|
|
7158
|
+
{
|
|
7159
|
+
photos,
|
|
7160
|
+
...label !== void 0 ? { label } : {},
|
|
7161
|
+
...className !== void 0 ? { className } : {},
|
|
7162
|
+
onOpen: (next) => {
|
|
7163
|
+
setIndex(next);
|
|
7164
|
+
setOpen(true);
|
|
7165
|
+
onView?.(next);
|
|
7166
|
+
}
|
|
7167
|
+
}
|
|
7168
|
+
),
|
|
7169
|
+
/* @__PURE__ */ jsx198(
|
|
7170
|
+
PhotoViewer,
|
|
7171
|
+
{
|
|
7172
|
+
photos,
|
|
7173
|
+
open,
|
|
7174
|
+
index,
|
|
7175
|
+
...label !== void 0 ? { label } : {},
|
|
7176
|
+
onIndexChange: (next) => {
|
|
7177
|
+
setIndex(next);
|
|
7178
|
+
onView?.(next);
|
|
7179
|
+
},
|
|
7180
|
+
onClose: () => setOpen(false)
|
|
7181
|
+
}
|
|
7182
|
+
)
|
|
7183
|
+
] });
|
|
6697
7184
|
}
|
|
6698
7185
|
|
|
6699
7186
|
// src/components/Marker/Marker.tsx
|
|
6700
|
-
import
|
|
6701
|
-
import { jsx as
|
|
7187
|
+
import styles73 from "./Marker.module.css";
|
|
7188
|
+
import { jsx as jsx199 } from "react/jsx-runtime";
|
|
6702
7189
|
function Marker({ index, label, onClick, className }) {
|
|
6703
|
-
const classes = [
|
|
7190
|
+
const classes = [styles73.marker, className].filter(Boolean).join(" ");
|
|
6704
7191
|
if (onClick) {
|
|
6705
|
-
return /* @__PURE__ */
|
|
7192
|
+
return /* @__PURE__ */ jsx199("button", { type: "button", onClick, "aria-label": label, className: classes, children: index });
|
|
6706
7193
|
}
|
|
6707
|
-
return /* @__PURE__ */
|
|
7194
|
+
return /* @__PURE__ */ jsx199("span", { "aria-label": label, className: classes, children: index });
|
|
6708
7195
|
}
|
|
6709
7196
|
|
|
6710
7197
|
// src/components/Message/Message.tsx
|
|
6711
|
-
import
|
|
6712
|
-
import { jsx as
|
|
7198
|
+
import styles74 from "./Message.module.css";
|
|
7199
|
+
import { jsx as jsx200, jsxs as jsxs156 } from "react/jsx-runtime";
|
|
6713
7200
|
function Message({ sender, children, pending, actions, className }) {
|
|
6714
|
-
return /* @__PURE__ */
|
|
6715
|
-
/* @__PURE__ */
|
|
6716
|
-
/* @__PURE__ */
|
|
6717
|
-
/* @__PURE__ */
|
|
6718
|
-
/* @__PURE__ */
|
|
7201
|
+
return /* @__PURE__ */ jsxs156("div", { className: [styles74.row, styles74[sender], className].filter(Boolean).join(" "), children: [
|
|
7202
|
+
/* @__PURE__ */ jsx200("div", { className: styles74.bubble, children: pending ? /* @__PURE__ */ jsxs156("span", { className: styles74.typingDots, "aria-label": "Thinking", children: [
|
|
7203
|
+
/* @__PURE__ */ jsx200("span", { className: styles74.dot }),
|
|
7204
|
+
/* @__PURE__ */ jsx200("span", { className: styles74.dot }),
|
|
7205
|
+
/* @__PURE__ */ jsx200("span", { className: styles74.dot })
|
|
6719
7206
|
] }) : children }),
|
|
6720
|
-
actions && !pending && /* @__PURE__ */
|
|
7207
|
+
actions && !pending && /* @__PURE__ */ jsx200("div", { className: styles74.actions, children: actions })
|
|
6721
7208
|
] });
|
|
6722
7209
|
}
|
|
6723
7210
|
|
|
6724
7211
|
// src/components/MessageScroller/MessageScroller.tsx
|
|
6725
|
-
import { useEffect as useEffect13, useRef as
|
|
6726
|
-
import
|
|
6727
|
-
import { jsx as
|
|
7212
|
+
import { useEffect as useEffect13, useRef as useRef20, useState as useState18 } from "react";
|
|
7213
|
+
import styles75 from "./MessageScroller.module.css";
|
|
7214
|
+
import { jsx as jsx201, jsxs as jsxs157 } from "react/jsx-runtime";
|
|
6728
7215
|
var NEAR_BOTTOM_THRESHOLD_PX = 80;
|
|
6729
7216
|
function MessageScroller({ children, className }) {
|
|
6730
|
-
const containerRef =
|
|
6731
|
-
const isNearBottomRef =
|
|
6732
|
-
const [hasNewMessages, setHasNewMessages] =
|
|
7217
|
+
const containerRef = useRef20(null);
|
|
7218
|
+
const isNearBottomRef = useRef20(true);
|
|
7219
|
+
const [hasNewMessages, setHasNewMessages] = useState18(false);
|
|
6733
7220
|
useEffect13(() => {
|
|
6734
7221
|
const el = containerRef.current;
|
|
6735
7222
|
if (!el) return;
|
|
@@ -6755,23 +7242,23 @@ function MessageScroller({ children, className }) {
|
|
|
6755
7242
|
isNearBottomRef.current = true;
|
|
6756
7243
|
setHasNewMessages(false);
|
|
6757
7244
|
}
|
|
6758
|
-
return /* @__PURE__ */
|
|
6759
|
-
/* @__PURE__ */
|
|
6760
|
-
/* @__PURE__ */
|
|
7245
|
+
return /* @__PURE__ */ jsxs157("div", { className: [styles75.root, className].filter(Boolean).join(" "), children: [
|
|
7246
|
+
/* @__PURE__ */ jsxs157("div", { className: styles75.scrollContainer, ref: containerRef, onScroll: handleScroll, children: [
|
|
7247
|
+
/* @__PURE__ */ jsx201("div", { className: styles75.spacer, "aria-hidden": "true" }),
|
|
6761
7248
|
children
|
|
6762
7249
|
] }),
|
|
6763
|
-
hasNewMessages && /* @__PURE__ */
|
|
7250
|
+
hasNewMessages && /* @__PURE__ */ jsx201("button", { type: "button", className: styles75.jumpButton, onClick: scrollToBottom, children: "New messages \u2193" })
|
|
6764
7251
|
] });
|
|
6765
7252
|
}
|
|
6766
7253
|
|
|
6767
7254
|
// src/components/HoverCard/HoverCard.tsx
|
|
6768
|
-
import { cloneElement, useEffect as useEffect14, useRef as
|
|
6769
|
-
import
|
|
6770
|
-
import { jsx as
|
|
7255
|
+
import { cloneElement, useEffect as useEffect14, useRef as useRef21, useState as useState19 } from "react";
|
|
7256
|
+
import styles76 from "./HoverCard.module.css";
|
|
7257
|
+
import { jsx as jsx202 } from "react/jsx-runtime";
|
|
6771
7258
|
var OPEN_DELAY_MS = 400;
|
|
6772
7259
|
var CLOSE_DELAY_MS = 150;
|
|
6773
7260
|
function useHoverCapable() {
|
|
6774
|
-
const [hoverCapable, setHoverCapable] =
|
|
7261
|
+
const [hoverCapable, setHoverCapable] = useState19(true);
|
|
6775
7262
|
useEffect14(() => {
|
|
6776
7263
|
const mql = window.matchMedia("(hover: hover)");
|
|
6777
7264
|
setHoverCapable(mql.matches);
|
|
@@ -6790,10 +7277,10 @@ function HoverCard({
|
|
|
6790
7277
|
width,
|
|
6791
7278
|
"aria-label": ariaLabel
|
|
6792
7279
|
}) {
|
|
6793
|
-
const [open, setOpen] =
|
|
7280
|
+
const [open, setOpen] = useState19(false);
|
|
6794
7281
|
const hoverCapable = useHoverCapable();
|
|
6795
|
-
const openTimer =
|
|
6796
|
-
const closeTimer =
|
|
7282
|
+
const openTimer = useRef21(void 0);
|
|
7283
|
+
const closeTimer = useRef21(void 0);
|
|
6797
7284
|
function scheduleOpen() {
|
|
6798
7285
|
clearTimeout(closeTimer.current);
|
|
6799
7286
|
openTimer.current = setTimeout(() => setOpen(true), OPEN_DELAY_MS);
|
|
@@ -6812,13 +7299,13 @@ function HoverCard({
|
|
|
6812
7299
|
onBlur: scheduleClose
|
|
6813
7300
|
} : { onClick: () => setOpen((o) => !o) };
|
|
6814
7301
|
const wrappedTrigger = cloneElement(trigger, triggerHandlers);
|
|
6815
|
-
return /* @__PURE__ */
|
|
7302
|
+
return /* @__PURE__ */ jsx202(
|
|
6816
7303
|
"div",
|
|
6817
7304
|
{
|
|
6818
|
-
className:
|
|
7305
|
+
className: styles76.root,
|
|
6819
7306
|
onMouseEnter: hoverCapable ? cancelScheduledClose : void 0,
|
|
6820
7307
|
onMouseLeave: hoverCapable ? scheduleClose : void 0,
|
|
6821
|
-
children: /* @__PURE__ */
|
|
7308
|
+
children: /* @__PURE__ */ jsx202(
|
|
6822
7309
|
Popover,
|
|
6823
7310
|
{
|
|
6824
7311
|
trigger: wrappedTrigger,
|
|
@@ -6835,12 +7322,12 @@ function HoverCard({
|
|
|
6835
7322
|
}
|
|
6836
7323
|
|
|
6837
7324
|
// src/components/ContextMenu/ContextMenu.tsx
|
|
6838
|
-
import { cloneElement as cloneElement2, useState as
|
|
6839
|
-
import { Fragment as
|
|
7325
|
+
import { cloneElement as cloneElement2, useState as useState20 } from "react";
|
|
7326
|
+
import { Fragment as Fragment16, jsx as jsx203, jsxs as jsxs158 } from "react/jsx-runtime";
|
|
6840
7327
|
function ContextMenu({ children, items, "aria-label": ariaLabel }) {
|
|
6841
7328
|
const isMobile = useIsMobile();
|
|
6842
|
-
const [open, setOpen] =
|
|
6843
|
-
const [point, setPoint] =
|
|
7329
|
+
const [open, setOpen] = useState20(false);
|
|
7330
|
+
const [point, setPoint] = useState20({ x: 0, y: 0 });
|
|
6844
7331
|
const longPressHandlers = useLongPress({
|
|
6845
7332
|
onLongPress: () => setOpen(true),
|
|
6846
7333
|
disabled: !isMobile
|
|
@@ -6854,7 +7341,7 @@ function ContextMenu({ children, items, "aria-label": ariaLabel }) {
|
|
|
6854
7341
|
children,
|
|
6855
7342
|
isMobile ? longPressHandlers : { onContextMenu: handleContextMenu }
|
|
6856
7343
|
);
|
|
6857
|
-
const list = /* @__PURE__ */
|
|
7344
|
+
const list = /* @__PURE__ */ jsx203(
|
|
6858
7345
|
MenuEntries,
|
|
6859
7346
|
{
|
|
6860
7347
|
items,
|
|
@@ -6865,17 +7352,17 @@ function ContextMenu({ children, items, "aria-label": ariaLabel }) {
|
|
|
6865
7352
|
}
|
|
6866
7353
|
);
|
|
6867
7354
|
if (isMobile) {
|
|
6868
|
-
return /* @__PURE__ */
|
|
7355
|
+
return /* @__PURE__ */ jsxs158(Fragment16, { children: [
|
|
6869
7356
|
wrappedChild,
|
|
6870
|
-
/* @__PURE__ */
|
|
7357
|
+
/* @__PURE__ */ jsx203(Drawer, { open, onClose: () => setOpen(false), "aria-label": ariaLabel, children: list })
|
|
6871
7358
|
] });
|
|
6872
7359
|
}
|
|
6873
|
-
return /* @__PURE__ */
|
|
7360
|
+
return /* @__PURE__ */ jsxs158(Fragment16, { children: [
|
|
6874
7361
|
wrappedChild,
|
|
6875
|
-
open && /* @__PURE__ */
|
|
7362
|
+
open && /* @__PURE__ */ jsx203("div", { style: { position: "fixed", left: point.x, top: point.y, width: 0, height: 0 }, children: /* @__PURE__ */ jsx203(
|
|
6876
7363
|
Popover,
|
|
6877
7364
|
{
|
|
6878
|
-
trigger: /* @__PURE__ */
|
|
7365
|
+
trigger: /* @__PURE__ */ jsx203("span", {}),
|
|
6879
7366
|
open,
|
|
6880
7367
|
onClose: () => setOpen(false),
|
|
6881
7368
|
"aria-label": ariaLabel,
|
|
@@ -6886,16 +7373,16 @@ function ContextMenu({ children, items, "aria-label": ariaLabel }) {
|
|
|
6886
7373
|
}
|
|
6887
7374
|
|
|
6888
7375
|
// src/components/NavigationMenu/NavigationMenu.tsx
|
|
6889
|
-
import { useRef as
|
|
6890
|
-
import
|
|
6891
|
-
import { jsx as
|
|
7376
|
+
import { useRef as useRef22, useState as useState21 } from "react";
|
|
7377
|
+
import styles77 from "./NavigationMenu.module.css";
|
|
7378
|
+
import { jsx as jsx204 } from "react/jsx-runtime";
|
|
6892
7379
|
function NavigationMenu({
|
|
6893
7380
|
items,
|
|
6894
7381
|
renderLink,
|
|
6895
7382
|
"aria-label": ariaLabel
|
|
6896
7383
|
}) {
|
|
6897
|
-
const [openIndex, setOpenIndex] =
|
|
6898
|
-
const triggerRefs =
|
|
7384
|
+
const [openIndex, setOpenIndex] = useState21(null);
|
|
7385
|
+
const triggerRefs = useRef22([]);
|
|
6899
7386
|
function handleKeyDown(e, index) {
|
|
6900
7387
|
if (e.key === "Escape") {
|
|
6901
7388
|
setOpenIndex(null);
|
|
@@ -6909,26 +7396,26 @@ function NavigationMenu({
|
|
|
6909
7396
|
triggerRefs.current[nextIndex]?.focus();
|
|
6910
7397
|
}
|
|
6911
7398
|
}
|
|
6912
|
-
return /* @__PURE__ */
|
|
7399
|
+
return /* @__PURE__ */ jsx204("nav", { "aria-label": ariaLabel, className: styles77.nav, children: /* @__PURE__ */ jsx204("ul", { className: styles77.list, children: items.map((item, index) => {
|
|
6913
7400
|
if (!item.content) {
|
|
6914
7401
|
const linkChildren = item.label;
|
|
6915
|
-
return /* @__PURE__ */
|
|
7402
|
+
return /* @__PURE__ */ jsx204("li", { children: item.href && renderLink ? renderLink(item.href, linkChildren) : /* @__PURE__ */ jsx204("a", { href: item.href, className: styles77.link, children: linkChildren }) }, item.label);
|
|
6916
7403
|
}
|
|
6917
7404
|
const isOpen = openIndex === index;
|
|
6918
|
-
return /* @__PURE__ */
|
|
7405
|
+
return /* @__PURE__ */ jsx204("li", { children: /* @__PURE__ */ jsx204(
|
|
6919
7406
|
Popover,
|
|
6920
7407
|
{
|
|
6921
7408
|
"aria-label": item.label,
|
|
6922
7409
|
open: isOpen,
|
|
6923
7410
|
onClose: () => setOpenIndex((current) => current === index ? null : current),
|
|
6924
|
-
trigger: /* @__PURE__ */
|
|
7411
|
+
trigger: /* @__PURE__ */ jsx204(
|
|
6925
7412
|
"button",
|
|
6926
7413
|
{
|
|
6927
7414
|
ref: (el) => {
|
|
6928
7415
|
triggerRefs.current[index] = el;
|
|
6929
7416
|
},
|
|
6930
7417
|
type: "button",
|
|
6931
|
-
className: [
|
|
7418
|
+
className: [styles77.trigger, isOpen ? styles77.triggerOpen : ""].filter(Boolean).join(" "),
|
|
6932
7419
|
"aria-expanded": isOpen,
|
|
6933
7420
|
onClick: () => setOpenIndex((current) => current === index ? null : index),
|
|
6934
7421
|
onMouseEnter: () => {
|
|
@@ -6945,15 +7432,15 @@ function NavigationMenu({
|
|
|
6945
7432
|
}
|
|
6946
7433
|
|
|
6947
7434
|
// src/components/Menubar/Menubar.tsx
|
|
6948
|
-
import { jsx as
|
|
7435
|
+
import { jsx as jsx205 } from "react/jsx-runtime";
|
|
6949
7436
|
function Menubar({ menus, "aria-label": ariaLabel = "Menu bar" }) {
|
|
6950
|
-
return /* @__PURE__ */
|
|
7437
|
+
return /* @__PURE__ */ jsx205(
|
|
6951
7438
|
NavigationMenu,
|
|
6952
7439
|
{
|
|
6953
7440
|
"aria-label": ariaLabel,
|
|
6954
7441
|
items: menus.map((menu) => ({
|
|
6955
7442
|
label: menu.label,
|
|
6956
|
-
content: (close) => /* @__PURE__ */
|
|
7443
|
+
content: (close) => /* @__PURE__ */ jsx205(
|
|
6957
7444
|
MenuEntries,
|
|
6958
7445
|
{
|
|
6959
7446
|
items: menu.items,
|
|
@@ -6969,9 +7456,9 @@ function Menubar({ menus, "aria-label": ariaLabel = "Menu bar" }) {
|
|
|
6969
7456
|
}
|
|
6970
7457
|
|
|
6971
7458
|
// src/components/Command/Command.tsx
|
|
6972
|
-
import { useEffect as useEffect15, useId as useId9, useMemo as useMemo3, useRef as
|
|
6973
|
-
import
|
|
6974
|
-
import { jsx as
|
|
7459
|
+
import { useEffect as useEffect15, useId as useId9, useMemo as useMemo3, useRef as useRef23, useState as useState22 } from "react";
|
|
7460
|
+
import styles78 from "./Command.module.css";
|
|
7461
|
+
import { jsx as jsx206, jsxs as jsxs159 } from "react/jsx-runtime";
|
|
6975
7462
|
function matches(item, query) {
|
|
6976
7463
|
if (!query) return true;
|
|
6977
7464
|
const haystack = `${item.label} ${item.keywords ?? ""}`.toLowerCase();
|
|
@@ -6984,9 +7471,9 @@ function Command({
|
|
|
6984
7471
|
placeholder = "Type a command\u2026",
|
|
6985
7472
|
"aria-label": ariaLabel = "Command palette"
|
|
6986
7473
|
}) {
|
|
6987
|
-
const [query, setQuery] =
|
|
6988
|
-
const [highlightedIndex, setHighlightedIndex] =
|
|
6989
|
-
const inputRef =
|
|
7474
|
+
const [query, setQuery] = useState22("");
|
|
7475
|
+
const [highlightedIndex, setHighlightedIndex] = useState22(0);
|
|
7476
|
+
const inputRef = useRef23(null);
|
|
6990
7477
|
const listId = useId9();
|
|
6991
7478
|
const filtered = useMemo3(() => items.filter((item) => matches(item, query)), [items, query]);
|
|
6992
7479
|
useEffect15(() => {
|
|
@@ -7029,8 +7516,8 @@ function Command({
|
|
|
7029
7516
|
return order.map((group) => ({ group, items: byGroup.get(group) ?? [] }));
|
|
7030
7517
|
}, [filtered]);
|
|
7031
7518
|
const highlightedId = filtered[highlightedIndex] ? `${listId}-${filtered[highlightedIndex].id}` : void 0;
|
|
7032
|
-
return /* @__PURE__ */
|
|
7033
|
-
/* @__PURE__ */
|
|
7519
|
+
return /* @__PURE__ */ jsx206(Dialog, { open, onClose, "aria-label": ariaLabel, size: "sm", children: /* @__PURE__ */ jsxs159("div", { className: styles78.root, children: [
|
|
7520
|
+
/* @__PURE__ */ jsx206(
|
|
7034
7521
|
"input",
|
|
7035
7522
|
{
|
|
7036
7523
|
ref: inputRef,
|
|
@@ -7040,35 +7527,35 @@ function Command({
|
|
|
7040
7527
|
"aria-controls": listId,
|
|
7041
7528
|
"aria-activedescendant": highlightedId,
|
|
7042
7529
|
"aria-autocomplete": "list",
|
|
7043
|
-
className:
|
|
7530
|
+
className: styles78.input,
|
|
7044
7531
|
placeholder,
|
|
7045
7532
|
value: query,
|
|
7046
7533
|
onChange: (e) => setQuery(e.target.value),
|
|
7047
7534
|
onKeyDown: handleKeyDown
|
|
7048
7535
|
}
|
|
7049
7536
|
),
|
|
7050
|
-
/* @__PURE__ */
|
|
7051
|
-
filtered.length === 0 && /* @__PURE__ */
|
|
7052
|
-
groups.map(({ group, items: groupItems }) => /* @__PURE__ */
|
|
7053
|
-
group && /* @__PURE__ */
|
|
7054
|
-
/* @__PURE__ */
|
|
7537
|
+
/* @__PURE__ */ jsxs159("ul", { id: listId, role: "listbox", className: styles78.list, children: [
|
|
7538
|
+
filtered.length === 0 && /* @__PURE__ */ jsx206("li", { className: styles78.empty, children: "No matching commands." }),
|
|
7539
|
+
groups.map(({ group, items: groupItems }) => /* @__PURE__ */ jsxs159("li", { children: [
|
|
7540
|
+
group && /* @__PURE__ */ jsx206("div", { className: styles78.groupLabel, children: group }),
|
|
7541
|
+
/* @__PURE__ */ jsx206("ul", { className: styles78.groupList, children: groupItems.map((item) => {
|
|
7055
7542
|
const index = filtered.indexOf(item);
|
|
7056
7543
|
const isHighlighted = index === highlightedIndex;
|
|
7057
|
-
return /* @__PURE__ */
|
|
7544
|
+
return /* @__PURE__ */ jsx206("li", { children: /* @__PURE__ */ jsxs159(
|
|
7058
7545
|
"button",
|
|
7059
7546
|
{
|
|
7060
7547
|
id: `${listId}-${item.id}`,
|
|
7061
7548
|
type: "button",
|
|
7062
7549
|
role: "option",
|
|
7063
7550
|
"aria-selected": isHighlighted,
|
|
7064
|
-
className: [
|
|
7551
|
+
className: [styles78.item, isHighlighted ? styles78.itemHighlighted : ""].filter(Boolean).join(" "),
|
|
7065
7552
|
onMouseEnter: () => setHighlightedIndex(index),
|
|
7066
7553
|
onClick: () => {
|
|
7067
7554
|
onClose();
|
|
7068
7555
|
item.onSelect();
|
|
7069
7556
|
},
|
|
7070
7557
|
children: [
|
|
7071
|
-
item.icon && /* @__PURE__ */
|
|
7558
|
+
item.icon && /* @__PURE__ */ jsx206(Icon, { name: item.icon, size: "sm", "aria-hidden": true }),
|
|
7072
7559
|
item.label
|
|
7073
7560
|
]
|
|
7074
7561
|
}
|
|
@@ -7080,11 +7567,11 @@ function Command({
|
|
|
7080
7567
|
}
|
|
7081
7568
|
|
|
7082
7569
|
// src/components/Resizable/Resizable.tsx
|
|
7083
|
-
import { Children, isValidElement, useEffect as useEffect16, useRef as
|
|
7084
|
-
import
|
|
7085
|
-
import { jsx as
|
|
7570
|
+
import { Children, isValidElement, useEffect as useEffect16, useRef as useRef24, useState as useState23 } from "react";
|
|
7571
|
+
import styles79 from "./Resizable.module.css";
|
|
7572
|
+
import { jsx as jsx207 } from "react/jsx-runtime";
|
|
7086
7573
|
function ResizablePanel({ children, className, style }) {
|
|
7087
|
-
return /* @__PURE__ */
|
|
7574
|
+
return /* @__PURE__ */ jsx207("div", { className: [styles79.panel, className].filter(Boolean).join(" "), style, children });
|
|
7088
7575
|
}
|
|
7089
7576
|
function ResizableHandle({
|
|
7090
7577
|
"aria-label": ariaLabel = "Resize panels",
|
|
@@ -7097,10 +7584,10 @@ function ResizableHandle({
|
|
|
7097
7584
|
}) {
|
|
7098
7585
|
return (
|
|
7099
7586
|
/* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/no-noninteractive-tabindex -- WAI-ARIA "window splitter" pattern: a focusable, keyboard-operable separator is the documented exception to role="separator" being non-interactive (https://www.w3.org/WAI/ARIA/apg/patterns/windowsplitter/). */
|
|
7100
|
-
/* @__PURE__ */
|
|
7587
|
+
/* @__PURE__ */ jsx207(
|
|
7101
7588
|
"div",
|
|
7102
7589
|
{
|
|
7103
|
-
className: [
|
|
7590
|
+
className: [styles79.handle, direction === "vertical" ? styles79.handleVertical : ""].filter(Boolean).join(" "),
|
|
7104
7591
|
role: "separator",
|
|
7105
7592
|
tabIndex: 0,
|
|
7106
7593
|
"aria-orientation": direction === "horizontal" ? "vertical" : "horizontal",
|
|
@@ -7114,7 +7601,7 @@ function ResizableHandle({
|
|
|
7114
7601
|
)
|
|
7115
7602
|
);
|
|
7116
7603
|
}
|
|
7117
|
-
var
|
|
7604
|
+
var clamp3 = (value, min, max) => Math.min(Math.max(value, min), max);
|
|
7118
7605
|
function ResizablePanelGroup({ direction, children, className }) {
|
|
7119
7606
|
const elements = Children.toArray(children).filter(isValidElement);
|
|
7120
7607
|
const panelCount = elements.filter((el) => el.type === ResizablePanel).length;
|
|
@@ -7126,21 +7613,21 @@ function ResizablePanelGroup({ direction, children, className }) {
|
|
|
7126
7613
|
maxSize: props.maxSize ?? 90
|
|
7127
7614
|
};
|
|
7128
7615
|
});
|
|
7129
|
-
const [sizes, setSizes] =
|
|
7616
|
+
const [sizes, setSizes] = useState23(() => constraints.map((c) => c.defaultSize));
|
|
7130
7617
|
if (sizes.length !== constraints.length) {
|
|
7131
7618
|
setSizes(constraints.map((c) => c.defaultSize));
|
|
7132
7619
|
}
|
|
7133
|
-
const containerRef =
|
|
7134
|
-
const constraintsRef =
|
|
7620
|
+
const containerRef = useRef24(null);
|
|
7621
|
+
const constraintsRef = useRef24(constraints);
|
|
7135
7622
|
constraintsRef.current = constraints;
|
|
7136
|
-
const directionRef =
|
|
7623
|
+
const directionRef = useRef24(direction);
|
|
7137
7624
|
directionRef.current = direction;
|
|
7138
|
-
const dragState =
|
|
7625
|
+
const dragState = useRef24(null);
|
|
7139
7626
|
function applyResize(handleIndex2, nextA, combined) {
|
|
7140
7627
|
const a = constraintsRef.current[handleIndex2];
|
|
7141
7628
|
const b = constraintsRef.current[handleIndex2 + 1];
|
|
7142
7629
|
if (!a || !b) return;
|
|
7143
|
-
const clampedA =
|
|
7630
|
+
const clampedA = clamp3(
|
|
7144
7631
|
nextA,
|
|
7145
7632
|
Math.max(a.minSize, combined - b.maxSize),
|
|
7146
7633
|
Math.min(a.maxSize, combined - b.minSize)
|
|
@@ -7211,16 +7698,16 @@ function ResizablePanelGroup({ direction, children, className }) {
|
|
|
7211
7698
|
}
|
|
7212
7699
|
let panelIndex = -1;
|
|
7213
7700
|
let handleIndex = -1;
|
|
7214
|
-
return /* @__PURE__ */
|
|
7701
|
+
return /* @__PURE__ */ jsx207(
|
|
7215
7702
|
"div",
|
|
7216
7703
|
{
|
|
7217
7704
|
ref: containerRef,
|
|
7218
|
-
className: [
|
|
7705
|
+
className: [styles79.group, direction === "vertical" ? styles79.groupVertical : "", className].filter(Boolean).join(" "),
|
|
7219
7706
|
children: elements.map((element, key) => {
|
|
7220
7707
|
if (element.type === ResizablePanel) {
|
|
7221
7708
|
panelIndex += 1;
|
|
7222
7709
|
const size = sizes[panelIndex] ?? constraints[panelIndex]?.defaultSize ?? 0;
|
|
7223
|
-
return /* @__PURE__ */
|
|
7710
|
+
return /* @__PURE__ */ jsx207(
|
|
7224
7711
|
ResizablePanelClone,
|
|
7225
7712
|
{
|
|
7226
7713
|
element,
|
|
@@ -7233,7 +7720,7 @@ function ResizablePanelGroup({ direction, children, className }) {
|
|
|
7233
7720
|
handleIndex += 1;
|
|
7234
7721
|
const index = handleIndex;
|
|
7235
7722
|
const constraint = constraints[index];
|
|
7236
|
-
return /* @__PURE__ */
|
|
7723
|
+
return /* @__PURE__ */ jsx207(
|
|
7237
7724
|
ResizableHandleClone,
|
|
7238
7725
|
{
|
|
7239
7726
|
element,
|
|
@@ -7262,19 +7749,19 @@ function ResizablePanelClone({
|
|
|
7262
7749
|
flexGrow: 0,
|
|
7263
7750
|
flexShrink: 0
|
|
7264
7751
|
};
|
|
7265
|
-
return /* @__PURE__ */
|
|
7752
|
+
return /* @__PURE__ */ jsx207(ResizablePanel, { ...element.props, style });
|
|
7266
7753
|
}
|
|
7267
7754
|
function ResizableHandleClone({
|
|
7268
7755
|
element,
|
|
7269
7756
|
...injected
|
|
7270
7757
|
}) {
|
|
7271
|
-
return /* @__PURE__ */
|
|
7758
|
+
return /* @__PURE__ */ jsx207(ResizableHandle, { ...element.props, ...injected });
|
|
7272
7759
|
}
|
|
7273
7760
|
|
|
7274
7761
|
// src/components/DataTable/DataTable.tsx
|
|
7275
|
-
import { useMemo as useMemo4, useState as
|
|
7276
|
-
import
|
|
7277
|
-
import { jsx as
|
|
7762
|
+
import { useMemo as useMemo4, useState as useState24 } from "react";
|
|
7763
|
+
import styles80 from "./DataTable.module.css";
|
|
7764
|
+
import { jsx as jsx208, jsxs as jsxs160 } from "react/jsx-runtime";
|
|
7278
7765
|
function compareValues(a, b) {
|
|
7279
7766
|
if (typeof a === "number" && typeof b === "number") return a - b;
|
|
7280
7767
|
return String(a).localeCompare(String(b));
|
|
@@ -7288,8 +7775,8 @@ function DataTable({
|
|
|
7288
7775
|
emptyMessage = "No results.",
|
|
7289
7776
|
className
|
|
7290
7777
|
}) {
|
|
7291
|
-
const [sortKey, setSortKey] =
|
|
7292
|
-
const [sortDirection, setSortDirection] =
|
|
7778
|
+
const [sortKey, setSortKey] = useState24(defaultSortKey);
|
|
7779
|
+
const [sortDirection, setSortDirection] = useState24(defaultSortDirection);
|
|
7293
7780
|
const sortColumn = columns.find((c) => c.key === sortKey);
|
|
7294
7781
|
const sortedData = useMemo4(() => {
|
|
7295
7782
|
if (!sortColumn) return data;
|
|
@@ -7310,26 +7797,26 @@ function DataTable({
|
|
|
7310
7797
|
}
|
|
7311
7798
|
}
|
|
7312
7799
|
if (data.length === 0) {
|
|
7313
|
-
return /* @__PURE__ */
|
|
7800
|
+
return /* @__PURE__ */ jsx208(EmptyState, { heading: emptyMessage });
|
|
7314
7801
|
}
|
|
7315
|
-
return /* @__PURE__ */
|
|
7316
|
-
/* @__PURE__ */
|
|
7802
|
+
return /* @__PURE__ */ jsxs160(Table, { className, children: [
|
|
7803
|
+
/* @__PURE__ */ jsx208(TableHead, { children: /* @__PURE__ */ jsx208(TableRow, { children: columns.map((column) => {
|
|
7317
7804
|
const isSorted = sortKey === column.key;
|
|
7318
7805
|
const ariaSort = !column.sortable ? void 0 : isSorted ? sortDirection === "asc" ? "ascending" : "descending" : "none";
|
|
7319
|
-
return /* @__PURE__ */
|
|
7806
|
+
return /* @__PURE__ */ jsx208(
|
|
7320
7807
|
TableHeaderCell,
|
|
7321
7808
|
{
|
|
7322
7809
|
"aria-sort": ariaSort,
|
|
7323
7810
|
style: column.align === "end" ? { textAlign: "end" } : void 0,
|
|
7324
|
-
children: column.sortable ? /* @__PURE__ */
|
|
7811
|
+
children: column.sortable ? /* @__PURE__ */ jsxs160(
|
|
7325
7812
|
"button",
|
|
7326
7813
|
{
|
|
7327
7814
|
type: "button",
|
|
7328
|
-
className:
|
|
7815
|
+
className: styles80.sortButton,
|
|
7329
7816
|
onClick: () => handleSort(column),
|
|
7330
7817
|
children: [
|
|
7331
7818
|
column.header,
|
|
7332
|
-
/* @__PURE__ */
|
|
7819
|
+
/* @__PURE__ */ jsx208("span", { className: styles80.sortIcon, children: isSorted && /* @__PURE__ */ jsx208(
|
|
7333
7820
|
Icon,
|
|
7334
7821
|
{
|
|
7335
7822
|
name: sortDirection === "asc" ? "chevron-up" : "chevron-down",
|
|
@@ -7344,7 +7831,7 @@ function DataTable({
|
|
|
7344
7831
|
column.key
|
|
7345
7832
|
);
|
|
7346
7833
|
}) }) }),
|
|
7347
|
-
/* @__PURE__ */
|
|
7834
|
+
/* @__PURE__ */ jsx208(TableBody, { children: sortedData.map((row) => /* @__PURE__ */ jsx208(TableRow, { children: columns.map((column) => /* @__PURE__ */ jsx208(
|
|
7348
7835
|
TableCell,
|
|
7349
7836
|
{
|
|
7350
7837
|
style: column.align === "end" ? { textAlign: "end" } : void 0,
|
|
@@ -7356,9 +7843,9 @@ function DataTable({
|
|
|
7356
7843
|
}
|
|
7357
7844
|
|
|
7358
7845
|
// src/components/Combobox/Combobox.tsx
|
|
7359
|
-
import { useEffect as useEffect17, useId as useId10, useMemo as useMemo5, useRef as
|
|
7360
|
-
import
|
|
7361
|
-
import { Fragment as
|
|
7846
|
+
import { useEffect as useEffect17, useId as useId10, useMemo as useMemo5, useRef as useRef25, useState as useState25 } from "react";
|
|
7847
|
+
import styles81 from "./Combobox.module.css";
|
|
7848
|
+
import { Fragment as Fragment17, jsx as jsx209, jsxs as jsxs161 } from "react/jsx-runtime";
|
|
7362
7849
|
function matches2(option, query) {
|
|
7363
7850
|
if (!query) return true;
|
|
7364
7851
|
return option.label.toLowerCase().includes(query.toLowerCase());
|
|
@@ -7374,11 +7861,11 @@ function Combobox({
|
|
|
7374
7861
|
disabled = false,
|
|
7375
7862
|
className
|
|
7376
7863
|
}) {
|
|
7377
|
-
const [open, setOpen] =
|
|
7378
|
-
const [query, setQuery] =
|
|
7379
|
-
const [highlightedIndex, setHighlightedIndex] =
|
|
7864
|
+
const [open, setOpen] = useState25(false);
|
|
7865
|
+
const [query, setQuery] = useState25("");
|
|
7866
|
+
const [highlightedIndex, setHighlightedIndex] = useState25(0);
|
|
7380
7867
|
const isMobile = useIsMobile();
|
|
7381
|
-
const inputRef =
|
|
7868
|
+
const inputRef = useRef25(null);
|
|
7382
7869
|
const listId = useId10();
|
|
7383
7870
|
const selected = options.find((o) => o.value === value) ?? null;
|
|
7384
7871
|
const filtered = useMemo5(
|
|
@@ -7412,24 +7899,24 @@ function Combobox({
|
|
|
7412
7899
|
}
|
|
7413
7900
|
}
|
|
7414
7901
|
const highlightedId = filtered[highlightedIndex] ? `${listId}-${filtered[highlightedIndex].value}` : void 0;
|
|
7415
|
-
const trigger = /* @__PURE__ */
|
|
7902
|
+
const trigger = /* @__PURE__ */ jsxs161(
|
|
7416
7903
|
"button",
|
|
7417
7904
|
{
|
|
7418
7905
|
type: "button",
|
|
7419
|
-
className: [
|
|
7906
|
+
className: [styles81.trigger, className].filter(Boolean).join(" "),
|
|
7420
7907
|
disabled,
|
|
7421
7908
|
"aria-label": ariaLabel,
|
|
7422
7909
|
"aria-haspopup": "listbox",
|
|
7423
7910
|
"aria-expanded": open,
|
|
7424
7911
|
onClick: () => setOpen((o) => !o),
|
|
7425
7912
|
children: [
|
|
7426
|
-
/* @__PURE__ */
|
|
7427
|
-
/* @__PURE__ */
|
|
7913
|
+
/* @__PURE__ */ jsx209("span", { className: selected ? styles81.triggerValue : styles81.triggerPlaceholder, children: selected ? selected.label : placeholder }),
|
|
7914
|
+
/* @__PURE__ */ jsx209(Icon, { name: "chevron-down", size: "sm", "aria-hidden": true })
|
|
7428
7915
|
]
|
|
7429
7916
|
}
|
|
7430
7917
|
);
|
|
7431
|
-
const body = /* @__PURE__ */
|
|
7432
|
-
/* @__PURE__ */
|
|
7918
|
+
const body = /* @__PURE__ */ jsxs161("div", { className: styles81.body, children: [
|
|
7919
|
+
/* @__PURE__ */ jsx209(
|
|
7433
7920
|
"input",
|
|
7434
7921
|
{
|
|
7435
7922
|
ref: inputRef,
|
|
@@ -7439,30 +7926,30 @@ function Combobox({
|
|
|
7439
7926
|
"aria-controls": listId,
|
|
7440
7927
|
"aria-activedescendant": highlightedId,
|
|
7441
7928
|
"aria-autocomplete": "list",
|
|
7442
|
-
className:
|
|
7929
|
+
className: styles81.search,
|
|
7443
7930
|
placeholder: searchPlaceholder,
|
|
7444
7931
|
value: query,
|
|
7445
7932
|
onChange: (e) => setQuery(e.target.value),
|
|
7446
7933
|
onKeyDown: handleKeyDown
|
|
7447
7934
|
}
|
|
7448
7935
|
),
|
|
7449
|
-
/* @__PURE__ */
|
|
7450
|
-
filtered.length === 0 && /* @__PURE__ */
|
|
7936
|
+
/* @__PURE__ */ jsxs161("ul", { id: listId, role: "listbox", className: styles81.list, children: [
|
|
7937
|
+
filtered.length === 0 && /* @__PURE__ */ jsx209("li", { className: styles81.empty, children: emptyMessage }),
|
|
7451
7938
|
filtered.map((option, index) => {
|
|
7452
7939
|
const isHighlighted = index === highlightedIndex;
|
|
7453
7940
|
const isSelected = option.value === value;
|
|
7454
|
-
return /* @__PURE__ */
|
|
7941
|
+
return /* @__PURE__ */ jsx209("li", { children: /* @__PURE__ */ jsxs161(
|
|
7455
7942
|
"button",
|
|
7456
7943
|
{
|
|
7457
7944
|
id: `${listId}-${option.value}`,
|
|
7458
7945
|
type: "button",
|
|
7459
7946
|
role: "option",
|
|
7460
7947
|
"aria-selected": isSelected,
|
|
7461
|
-
className: [
|
|
7948
|
+
className: [styles81.option, isHighlighted ? styles81.optionHighlighted : ""].filter(Boolean).join(" "),
|
|
7462
7949
|
onMouseEnter: () => setHighlightedIndex(index),
|
|
7463
7950
|
onClick: () => commit(option),
|
|
7464
7951
|
children: [
|
|
7465
|
-
/* @__PURE__ */
|
|
7952
|
+
/* @__PURE__ */ jsx209("span", { className: styles81.check, children: isSelected && /* @__PURE__ */ jsx209(Icon, { name: "check", size: "sm", "aria-hidden": true }) }),
|
|
7466
7953
|
option.label
|
|
7467
7954
|
]
|
|
7468
7955
|
}
|
|
@@ -7471,12 +7958,12 @@ function Combobox({
|
|
|
7471
7958
|
] })
|
|
7472
7959
|
] });
|
|
7473
7960
|
if (isMobile) {
|
|
7474
|
-
return /* @__PURE__ */
|
|
7961
|
+
return /* @__PURE__ */ jsxs161(Fragment17, { children: [
|
|
7475
7962
|
trigger,
|
|
7476
|
-
/* @__PURE__ */
|
|
7963
|
+
/* @__PURE__ */ jsx209(Drawer, { open, onClose: () => setOpen(false), "aria-label": ariaLabel, children: body })
|
|
7477
7964
|
] });
|
|
7478
7965
|
}
|
|
7479
|
-
return /* @__PURE__ */
|
|
7966
|
+
return /* @__PURE__ */ jsx209(
|
|
7480
7967
|
Popover,
|
|
7481
7968
|
{
|
|
7482
7969
|
trigger,
|
|
@@ -7490,9 +7977,9 @@ function Combobox({
|
|
|
7490
7977
|
}
|
|
7491
7978
|
|
|
7492
7979
|
// src/components/GripIcon/GripIcon.tsx
|
|
7493
|
-
import { jsx as
|
|
7980
|
+
import { jsx as jsx210 } from "react/jsx-runtime";
|
|
7494
7981
|
function GripIcon({ size = 14, className }) {
|
|
7495
|
-
return /* @__PURE__ */
|
|
7982
|
+
return /* @__PURE__ */ jsx210(
|
|
7496
7983
|
"svg",
|
|
7497
7984
|
{
|
|
7498
7985
|
width: size,
|
|
@@ -7502,15 +7989,15 @@ function GripIcon({ size = 14, className }) {
|
|
|
7502
7989
|
"aria-hidden": "true",
|
|
7503
7990
|
className,
|
|
7504
7991
|
children: [3, 7, 11].map(
|
|
7505
|
-
(cy) => [4, 10].map((cx) => /* @__PURE__ */
|
|
7992
|
+
(cy) => [4, 10].map((cx) => /* @__PURE__ */ jsx210("circle", { cx, cy, r: 1.2, fill: "currentColor" }, `${cx}-${cy}`))
|
|
7506
7993
|
)
|
|
7507
7994
|
}
|
|
7508
7995
|
);
|
|
7509
7996
|
}
|
|
7510
7997
|
|
|
7511
7998
|
// src/components/DragHandleRow/DragHandleRow.tsx
|
|
7512
|
-
import
|
|
7513
|
-
import { jsx as
|
|
7999
|
+
import styles82 from "./DragHandleRow.module.css";
|
|
8000
|
+
import { jsx as jsx211, jsxs as jsxs162 } from "react/jsx-runtime";
|
|
7514
8001
|
function DragHandleRow({
|
|
7515
8002
|
children,
|
|
7516
8003
|
handleProps,
|
|
@@ -7518,32 +8005,32 @@ function DragHandleRow({
|
|
|
7518
8005
|
className,
|
|
7519
8006
|
...rest
|
|
7520
8007
|
}) {
|
|
7521
|
-
return /* @__PURE__ */
|
|
8008
|
+
return /* @__PURE__ */ jsxs162(
|
|
7522
8009
|
"div",
|
|
7523
8010
|
{
|
|
7524
8011
|
...rest,
|
|
7525
|
-
className: [
|
|
8012
|
+
className: [styles82.row, isDragging ? styles82.dragging : "", className].filter(Boolean).join(" "),
|
|
7526
8013
|
children: [
|
|
7527
|
-
/* @__PURE__ */
|
|
8014
|
+
/* @__PURE__ */ jsx211(
|
|
7528
8015
|
"button",
|
|
7529
8016
|
{
|
|
7530
8017
|
type: "button",
|
|
7531
8018
|
"aria-label": "Drag to reorder",
|
|
7532
|
-
className:
|
|
8019
|
+
className: styles82.handle,
|
|
7533
8020
|
tabIndex: -1,
|
|
7534
8021
|
...handleProps,
|
|
7535
|
-
children: /* @__PURE__ */
|
|
8022
|
+
children: /* @__PURE__ */ jsx211(GripIcon, { className: styles82.icon })
|
|
7536
8023
|
}
|
|
7537
8024
|
),
|
|
7538
|
-
/* @__PURE__ */
|
|
8025
|
+
/* @__PURE__ */ jsx211("div", { className: styles82.content, children })
|
|
7539
8026
|
]
|
|
7540
8027
|
}
|
|
7541
8028
|
);
|
|
7542
8029
|
}
|
|
7543
8030
|
|
|
7544
8031
|
// src/components/StepStrip/StepStrip.tsx
|
|
7545
|
-
import
|
|
7546
|
-
import { jsx as
|
|
8032
|
+
import styles83 from "./StepStrip.module.css";
|
|
8033
|
+
import { jsx as jsx212, jsxs as jsxs163 } from "react/jsx-runtime";
|
|
7547
8034
|
function StepStrip({
|
|
7548
8035
|
items,
|
|
7549
8036
|
activeId,
|
|
@@ -7553,28 +8040,28 @@ function StepStrip({
|
|
|
7553
8040
|
className,
|
|
7554
8041
|
"aria-label": ariaLabel
|
|
7555
8042
|
}) {
|
|
7556
|
-
return /* @__PURE__ */
|
|
8043
|
+
return /* @__PURE__ */ jsxs163(
|
|
7557
8044
|
"div",
|
|
7558
8045
|
{
|
|
7559
|
-
className: [
|
|
8046
|
+
className: [styles83.strip, className].filter(Boolean).join(" "),
|
|
7560
8047
|
role: "list",
|
|
7561
8048
|
"aria-label": ariaLabel,
|
|
7562
8049
|
children: [
|
|
7563
|
-
items.map((item, index) => /* @__PURE__ */
|
|
8050
|
+
items.map((item, index) => /* @__PURE__ */ jsxs163("div", { className: styles83.step, role: "listitem", children: [
|
|
7564
8051
|
renderItem(item, { isActive: item.id === activeId, index }),
|
|
7565
|
-
(index < items.length - 1 || onAdd) && /* @__PURE__ */
|
|
8052
|
+
(index < items.length - 1 || onAdd) && /* @__PURE__ */ jsx212(
|
|
7566
8053
|
"div",
|
|
7567
8054
|
{
|
|
7568
8055
|
className: [
|
|
7569
|
-
|
|
7570
|
-
index === items.length - 1 ?
|
|
8056
|
+
styles83.connector,
|
|
8057
|
+
index === items.length - 1 ? styles83.connectorDashed : ""
|
|
7571
8058
|
].filter(Boolean).join(" "),
|
|
7572
8059
|
"aria-hidden": "true"
|
|
7573
8060
|
}
|
|
7574
8061
|
)
|
|
7575
8062
|
] }, item.id)),
|
|
7576
|
-
onAdd && /* @__PURE__ */
|
|
7577
|
-
/* @__PURE__ */
|
|
8063
|
+
onAdd && /* @__PURE__ */ jsxs163("button", { type: "button", className: styles83.addChip, onClick: onAdd, children: [
|
|
8064
|
+
/* @__PURE__ */ jsx212(Icon, { name: "plus", size: "sm", "aria-hidden": true }),
|
|
7578
8065
|
addLabel
|
|
7579
8066
|
] })
|
|
7580
8067
|
]
|
|
@@ -7583,9 +8070,9 @@ function StepStrip({
|
|
|
7583
8070
|
}
|
|
7584
8071
|
|
|
7585
8072
|
// src/components/FileDropzone/FileDropzone.tsx
|
|
7586
|
-
import { useRef as
|
|
7587
|
-
import
|
|
7588
|
-
import { jsx as
|
|
8073
|
+
import { useRef as useRef26, useState as useState26 } from "react";
|
|
8074
|
+
import styles84 from "./FileDropzone.module.css";
|
|
8075
|
+
import { jsx as jsx213, jsxs as jsxs164 } from "react/jsx-runtime";
|
|
7589
8076
|
function FileDropzone({
|
|
7590
8077
|
name,
|
|
7591
8078
|
accept,
|
|
@@ -7597,15 +8084,15 @@ function FileDropzone({
|
|
|
7597
8084
|
disabled,
|
|
7598
8085
|
className
|
|
7599
8086
|
}) {
|
|
7600
|
-
const [dragging, setDragging] =
|
|
7601
|
-
const inputRef =
|
|
7602
|
-
return /* @__PURE__ */
|
|
8087
|
+
const [dragging, setDragging] = useState26(false);
|
|
8088
|
+
const inputRef = useRef26(null);
|
|
8089
|
+
return /* @__PURE__ */ jsxs164(
|
|
7603
8090
|
"label",
|
|
7604
8091
|
{
|
|
7605
8092
|
className: [
|
|
7606
|
-
|
|
7607
|
-
dragging ?
|
|
7608
|
-
disabled ?
|
|
8093
|
+
styles84.dropzone,
|
|
8094
|
+
dragging ? styles84.dropzoneActive : "",
|
|
8095
|
+
disabled ? styles84.dropzoneDisabled : "",
|
|
7609
8096
|
className
|
|
7610
8097
|
].filter(Boolean).join(" "),
|
|
7611
8098
|
onDragOver: (event) => {
|
|
@@ -7628,12 +8115,12 @@ function FileDropzone({
|
|
|
7628
8115
|
onFileSelect(dropped);
|
|
7629
8116
|
},
|
|
7630
8117
|
children: [
|
|
7631
|
-
/* @__PURE__ */
|
|
7632
|
-
/* @__PURE__ */
|
|
7633
|
-
/* @__PURE__ */
|
|
7634
|
-
hint && /* @__PURE__ */
|
|
8118
|
+
/* @__PURE__ */ jsx213("span", { className: styles84.icon, "aria-hidden": "true", children: icon ?? /* @__PURE__ */ jsx213(Icon, { name: "file", size: "lg", "aria-hidden": true }) }),
|
|
8119
|
+
/* @__PURE__ */ jsxs164("span", { className: styles84.text, children: [
|
|
8120
|
+
/* @__PURE__ */ jsx213("span", { className: styles84.title, children: label }),
|
|
8121
|
+
hint && /* @__PURE__ */ jsx213("span", { className: styles84.hint, children: hint })
|
|
7635
8122
|
] }),
|
|
7636
|
-
/* @__PURE__ */
|
|
8123
|
+
/* @__PURE__ */ jsx213(
|
|
7637
8124
|
"input",
|
|
7638
8125
|
{
|
|
7639
8126
|
ref: inputRef,
|
|
@@ -7643,7 +8130,7 @@ function FileDropzone({
|
|
|
7643
8130
|
accept,
|
|
7644
8131
|
disabled,
|
|
7645
8132
|
onChange: (event) => onFileSelect(event.target.files?.[0] ?? null),
|
|
7646
|
-
className:
|
|
8133
|
+
className: styles84.hiddenInput
|
|
7647
8134
|
}
|
|
7648
8135
|
)
|
|
7649
8136
|
]
|
|
@@ -7652,7 +8139,7 @@ function FileDropzone({
|
|
|
7652
8139
|
}
|
|
7653
8140
|
|
|
7654
8141
|
// src/components/Calendar/Calendar.tsx
|
|
7655
|
-
import { useRef as
|
|
8142
|
+
import { useRef as useRef27, useState as useState27 } from "react";
|
|
7656
8143
|
|
|
7657
8144
|
// src/components/Calendar/dateUtils.ts
|
|
7658
8145
|
function startOfMonth(date) {
|
|
@@ -7718,8 +8205,8 @@ function formatDateLabel(date) {
|
|
|
7718
8205
|
}
|
|
7719
8206
|
|
|
7720
8207
|
// src/components/Calendar/Calendar.tsx
|
|
7721
|
-
import
|
|
7722
|
-
import { jsx as
|
|
8208
|
+
import styles85 from "./Calendar.module.css";
|
|
8209
|
+
import { jsx as jsx214, jsxs as jsxs165 } from "react/jsx-runtime";
|
|
7723
8210
|
var WEEKDAY_LABEL_WEEK = getMonthGrid(new Date(2026, 0, 1))[0] ?? [];
|
|
7724
8211
|
function Calendar({
|
|
7725
8212
|
value,
|
|
@@ -7728,9 +8215,9 @@ function Calendar({
|
|
|
7728
8215
|
maxDate,
|
|
7729
8216
|
"aria-label": ariaLabel
|
|
7730
8217
|
}) {
|
|
7731
|
-
const [displayedMonth, setDisplayedMonth] =
|
|
7732
|
-
const [focusedDate, setFocusedDate] =
|
|
7733
|
-
const gridRef =
|
|
8218
|
+
const [displayedMonth, setDisplayedMonth] = useState27(() => startOfMonth(value ?? /* @__PURE__ */ new Date()));
|
|
8219
|
+
const [focusedDate, setFocusedDate] = useState27(() => value ?? /* @__PURE__ */ new Date());
|
|
8220
|
+
const gridRef = useRef27(null);
|
|
7734
8221
|
const weeks = getMonthGrid(displayedMonth);
|
|
7735
8222
|
function goToMonth(next) {
|
|
7736
8223
|
setDisplayedMonth(startOfMonth(next));
|
|
@@ -7789,51 +8276,51 @@ function Calendar({
|
|
|
7789
8276
|
default:
|
|
7790
8277
|
}
|
|
7791
8278
|
}
|
|
7792
|
-
return /* @__PURE__ */
|
|
7793
|
-
/* @__PURE__ */
|
|
7794
|
-
/* @__PURE__ */
|
|
8279
|
+
return /* @__PURE__ */ jsxs165("div", { className: styles85.calendar, "aria-label": ariaLabel, children: [
|
|
8280
|
+
/* @__PURE__ */ jsxs165("div", { className: styles85.header, children: [
|
|
8281
|
+
/* @__PURE__ */ jsx214(
|
|
7795
8282
|
"button",
|
|
7796
8283
|
{
|
|
7797
8284
|
type: "button",
|
|
7798
|
-
className:
|
|
8285
|
+
className: styles85.navButton,
|
|
7799
8286
|
"aria-label": "Previous month",
|
|
7800
8287
|
onClick: () => goToMonth(addMonths(displayedMonth, -1)),
|
|
7801
|
-
children: /* @__PURE__ */
|
|
8288
|
+
children: /* @__PURE__ */ jsx214(Icon, { name: "chevron-left", size: "sm", "aria-hidden": true })
|
|
7802
8289
|
}
|
|
7803
8290
|
),
|
|
7804
|
-
/* @__PURE__ */
|
|
7805
|
-
/* @__PURE__ */
|
|
8291
|
+
/* @__PURE__ */ jsx214("span", { className: styles85.monthLabel, children: formatMonthYear(displayedMonth) }),
|
|
8292
|
+
/* @__PURE__ */ jsx214(
|
|
7806
8293
|
"button",
|
|
7807
8294
|
{
|
|
7808
8295
|
type: "button",
|
|
7809
|
-
className:
|
|
8296
|
+
className: styles85.navButton,
|
|
7810
8297
|
"aria-label": "Next month",
|
|
7811
8298
|
onClick: () => goToMonth(addMonths(displayedMonth, 1)),
|
|
7812
|
-
children: /* @__PURE__ */
|
|
8299
|
+
children: /* @__PURE__ */ jsx214(Icon, { name: "chevron-right", size: "sm", "aria-hidden": true })
|
|
7813
8300
|
}
|
|
7814
8301
|
)
|
|
7815
8302
|
] }),
|
|
7816
|
-
/* @__PURE__ */
|
|
8303
|
+
/* @__PURE__ */ jsxs165(
|
|
7817
8304
|
"div",
|
|
7818
8305
|
{
|
|
7819
8306
|
ref: gridRef,
|
|
7820
8307
|
role: "grid",
|
|
7821
8308
|
"aria-label": formatMonthYear(displayedMonth),
|
|
7822
|
-
className:
|
|
8309
|
+
className: styles85.grid,
|
|
7823
8310
|
onKeyDown: handleKeyDown,
|
|
7824
8311
|
tabIndex: -1,
|
|
7825
8312
|
children: [
|
|
7826
|
-
/* @__PURE__ */
|
|
8313
|
+
/* @__PURE__ */ jsx214("div", { role: "row", className: styles85.weekdayRow, children: WEEKDAY_LABEL_WEEK.map((d) => /* @__PURE__ */ jsx214("span", { role: "columnheader", className: styles85.weekday, "aria-hidden": true, children: formatWeekdayShort(d) }, d.getDay())) }),
|
|
7827
8314
|
weeks.map((week) => {
|
|
7828
8315
|
const firstDayOfWeek = week[0];
|
|
7829
8316
|
if (!firstDayOfWeek) return null;
|
|
7830
|
-
return /* @__PURE__ */
|
|
8317
|
+
return /* @__PURE__ */ jsx214("div", { role: "row", className: styles85.week, children: week.map((date) => {
|
|
7831
8318
|
const isCurrentMonth = isSameMonth(date, displayedMonth);
|
|
7832
8319
|
const isSelected = value !== null && isSameDay(date, value);
|
|
7833
8320
|
const isToday = isSameDay(date, /* @__PURE__ */ new Date());
|
|
7834
8321
|
const isFocusTarget = isSameDay(date, focusedDate);
|
|
7835
8322
|
const disabled = !isWithinRange(date, minDate, maxDate);
|
|
7836
|
-
return /* @__PURE__ */
|
|
8323
|
+
return /* @__PURE__ */ jsx214("div", { role: "gridcell", "aria-selected": isSelected, children: /* @__PURE__ */ jsx214(
|
|
7837
8324
|
"button",
|
|
7838
8325
|
{
|
|
7839
8326
|
type: "button",
|
|
@@ -7842,10 +8329,10 @@ function Calendar({
|
|
|
7842
8329
|
"aria-current": isToday ? "date" : void 0,
|
|
7843
8330
|
"aria-label": formatDateLabel(date),
|
|
7844
8331
|
className: [
|
|
7845
|
-
|
|
7846
|
-
!isCurrentMonth ?
|
|
7847
|
-
isSelected ?
|
|
7848
|
-
isToday && !isSelected ?
|
|
8332
|
+
styles85.day,
|
|
8333
|
+
!isCurrentMonth ? styles85.dayOutside : "",
|
|
8334
|
+
isSelected ? styles85.daySelected : "",
|
|
8335
|
+
isToday && !isSelected ? styles85.dayToday : ""
|
|
7849
8336
|
].filter(Boolean).join(" "),
|
|
7850
8337
|
onClick: () => selectDate(date),
|
|
7851
8338
|
onFocus: () => setFocusedDate(date),
|
|
@@ -7861,9 +8348,9 @@ function Calendar({
|
|
|
7861
8348
|
}
|
|
7862
8349
|
|
|
7863
8350
|
// src/components/DatePicker/DatePicker.tsx
|
|
7864
|
-
import { useState as
|
|
7865
|
-
import
|
|
7866
|
-
import { Fragment as
|
|
8351
|
+
import { useState as useState28 } from "react";
|
|
8352
|
+
import styles86 from "./DatePicker.module.css";
|
|
8353
|
+
import { Fragment as Fragment18, jsx as jsx215, jsxs as jsxs166 } from "react/jsx-runtime";
|
|
7867
8354
|
var POPOVER_WIDTH = 320;
|
|
7868
8355
|
function DatePicker({
|
|
7869
8356
|
value,
|
|
@@ -7874,29 +8361,29 @@ function DatePicker({
|
|
|
7874
8361
|
"aria-label": ariaLabel,
|
|
7875
8362
|
disabled = false
|
|
7876
8363
|
}) {
|
|
7877
|
-
const [open, setOpen] =
|
|
8364
|
+
const [open, setOpen] = useState28(false);
|
|
7878
8365
|
const isMobile = useIsMobile();
|
|
7879
8366
|
function handleSelect(date) {
|
|
7880
8367
|
onChange(date);
|
|
7881
8368
|
setOpen(false);
|
|
7882
8369
|
}
|
|
7883
|
-
const trigger = /* @__PURE__ */
|
|
8370
|
+
const trigger = /* @__PURE__ */ jsxs166(
|
|
7884
8371
|
"button",
|
|
7885
8372
|
{
|
|
7886
8373
|
type: "button",
|
|
7887
|
-
className:
|
|
8374
|
+
className: styles86.trigger,
|
|
7888
8375
|
disabled,
|
|
7889
8376
|
"aria-label": ariaLabel,
|
|
7890
8377
|
"aria-haspopup": "dialog",
|
|
7891
8378
|
"aria-expanded": open,
|
|
7892
8379
|
onClick: () => setOpen((o) => !o),
|
|
7893
8380
|
children: [
|
|
7894
|
-
/* @__PURE__ */
|
|
7895
|
-
/* @__PURE__ */
|
|
8381
|
+
/* @__PURE__ */ jsx215("span", { className: value ? styles86.triggerValue : styles86.triggerPlaceholder, children: value ? formatDateShort(value) : placeholder }),
|
|
8382
|
+
/* @__PURE__ */ jsx215(Icon, { name: "calendar", size: "sm", "aria-hidden": true })
|
|
7896
8383
|
]
|
|
7897
8384
|
}
|
|
7898
8385
|
);
|
|
7899
|
-
const calendar = /* @__PURE__ */
|
|
8386
|
+
const calendar = /* @__PURE__ */ jsx215(
|
|
7900
8387
|
Calendar,
|
|
7901
8388
|
{
|
|
7902
8389
|
value,
|
|
@@ -7907,12 +8394,12 @@ function DatePicker({
|
|
|
7907
8394
|
}
|
|
7908
8395
|
);
|
|
7909
8396
|
if (isMobile) {
|
|
7910
|
-
return /* @__PURE__ */
|
|
8397
|
+
return /* @__PURE__ */ jsxs166(Fragment18, { children: [
|
|
7911
8398
|
trigger,
|
|
7912
|
-
/* @__PURE__ */
|
|
8399
|
+
/* @__PURE__ */ jsx215(Drawer, { open, onClose: () => setOpen(false), "aria-label": ariaLabel, children: /* @__PURE__ */ jsx215("div", { className: styles86.drawerBody, children: calendar }) })
|
|
7913
8400
|
] });
|
|
7914
8401
|
}
|
|
7915
|
-
return /* @__PURE__ */
|
|
8402
|
+
return /* @__PURE__ */ jsx215(
|
|
7916
8403
|
Popover,
|
|
7917
8404
|
{
|
|
7918
8405
|
trigger,
|
|
@@ -7920,15 +8407,299 @@ function DatePicker({
|
|
|
7920
8407
|
onClose: () => setOpen(false),
|
|
7921
8408
|
"aria-label": ariaLabel,
|
|
7922
8409
|
width: POPOVER_WIDTH,
|
|
7923
|
-
children: /* @__PURE__ */
|
|
8410
|
+
children: /* @__PURE__ */ jsx215("div", { className: styles86.popoverBody, children: calendar })
|
|
8411
|
+
}
|
|
8412
|
+
);
|
|
8413
|
+
}
|
|
8414
|
+
|
|
8415
|
+
// src/components/DateRangePicker/DateRangePicker.tsx
|
|
8416
|
+
import { useState as useState30 } from "react";
|
|
8417
|
+
import pickerStyles from "./DatePicker.module.css";
|
|
8418
|
+
|
|
8419
|
+
// src/components/DateRangePicker/RangeCalendar.tsx
|
|
8420
|
+
import { useRef as useRef28, useState as useState29 } from "react";
|
|
8421
|
+
import calendarStyles from "./Calendar.module.css";
|
|
8422
|
+
|
|
8423
|
+
// src/components/DateRangePicker/rangeUtils.ts
|
|
8424
|
+
var ISO = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
8425
|
+
function parseIso(text) {
|
|
8426
|
+
const match = text ? ISO.exec(text) : null;
|
|
8427
|
+
if (!match) return void 0;
|
|
8428
|
+
const [year, month, day] = [Number(match[1]), Number(match[2]), Number(match[3])];
|
|
8429
|
+
const date = new Date(year, month - 1, day);
|
|
8430
|
+
return date.getFullYear() === year && date.getMonth() === month - 1 && date.getDate() === day ? date : void 0;
|
|
8431
|
+
}
|
|
8432
|
+
function toIso(date) {
|
|
8433
|
+
const pad = (n, width = 2) => String(n).padStart(width, "0");
|
|
8434
|
+
return `${pad(date.getFullYear(), 4)}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
|
|
8435
|
+
}
|
|
8436
|
+
function nightsBetween(start, end) {
|
|
8437
|
+
const a = Date.UTC(start.getFullYear(), start.getMonth(), start.getDate());
|
|
8438
|
+
const b = Date.UTC(end.getFullYear(), end.getMonth(), end.getDate());
|
|
8439
|
+
return Math.round((b - a) / 864e5);
|
|
8440
|
+
}
|
|
8441
|
+
function nightsLabel(nights) {
|
|
8442
|
+
return nights === 0 ? "same day" : nights === 1 ? "1 night" : `${nights} nights`;
|
|
8443
|
+
}
|
|
8444
|
+
function rangeOf(first, second) {
|
|
8445
|
+
return nightsBetween(first, second) >= 0 ? { start: first, end: second } : { start: second, end: first };
|
|
8446
|
+
}
|
|
8447
|
+
|
|
8448
|
+
// src/components/DateRangePicker/RangeCalendar.tsx
|
|
8449
|
+
import styles87 from "./DateRangePicker.module.css";
|
|
8450
|
+
import { jsx as jsx216, jsxs as jsxs167 } from "react/jsx-runtime";
|
|
8451
|
+
var WEEKDAY_LABEL_WEEK2 = getMonthGrid(new Date(2026, 0, 1))[0] ?? [];
|
|
8452
|
+
function RangeCalendar({
|
|
8453
|
+
value,
|
|
8454
|
+
onChange,
|
|
8455
|
+
minDate,
|
|
8456
|
+
maxDate,
|
|
8457
|
+
"aria-label": ariaLabel
|
|
8458
|
+
}) {
|
|
8459
|
+
const [displayedMonth, setDisplayedMonth] = useState29(
|
|
8460
|
+
() => startOfMonth(value?.start ?? /* @__PURE__ */ new Date())
|
|
8461
|
+
);
|
|
8462
|
+
const [focusedDate, setFocusedDate] = useState29(() => value?.start ?? /* @__PURE__ */ new Date());
|
|
8463
|
+
const [first, setFirst] = useState29(null);
|
|
8464
|
+
const [hover, setHover] = useState29(null);
|
|
8465
|
+
const gridRef = useRef28(null);
|
|
8466
|
+
const weeks = getMonthGrid(displayedMonth);
|
|
8467
|
+
const shown = first ? rangeOf(first, hover ?? first) : value;
|
|
8468
|
+
function goToMonth(next) {
|
|
8469
|
+
setDisplayedMonth(startOfMonth(next));
|
|
8470
|
+
}
|
|
8471
|
+
function moveFocus(next) {
|
|
8472
|
+
setFocusedDate(next);
|
|
8473
|
+
if (first) setHover(next);
|
|
8474
|
+
if (!isSameMonth(next, displayedMonth)) goToMonth(next);
|
|
8475
|
+
requestAnimationFrame(() => {
|
|
8476
|
+
gridRef.current?.querySelector('[tabindex="0"]')?.focus();
|
|
8477
|
+
});
|
|
8478
|
+
}
|
|
8479
|
+
function pick(date) {
|
|
8480
|
+
if (!isWithinRange(date, minDate, maxDate)) return;
|
|
8481
|
+
setFocusedDate(date);
|
|
8482
|
+
if (!first) {
|
|
8483
|
+
setFirst(date);
|
|
8484
|
+
setHover(date);
|
|
8485
|
+
return;
|
|
8486
|
+
}
|
|
8487
|
+
const range = rangeOf(first, date);
|
|
8488
|
+
setFirst(null);
|
|
8489
|
+
setHover(null);
|
|
8490
|
+
onChange(range);
|
|
8491
|
+
}
|
|
8492
|
+
function handleKeyDown(e) {
|
|
8493
|
+
switch (e.key) {
|
|
8494
|
+
case "ArrowLeft":
|
|
8495
|
+
e.preventDefault();
|
|
8496
|
+
return moveFocus(addDays(focusedDate, -1));
|
|
8497
|
+
case "ArrowRight":
|
|
8498
|
+
e.preventDefault();
|
|
8499
|
+
return moveFocus(addDays(focusedDate, 1));
|
|
8500
|
+
case "ArrowUp":
|
|
8501
|
+
e.preventDefault();
|
|
8502
|
+
return moveFocus(addDays(focusedDate, -7));
|
|
8503
|
+
case "ArrowDown":
|
|
8504
|
+
e.preventDefault();
|
|
8505
|
+
return moveFocus(addDays(focusedDate, 7));
|
|
8506
|
+
case "Home":
|
|
8507
|
+
e.preventDefault();
|
|
8508
|
+
return moveFocus(addDays(focusedDate, -focusedDate.getDay()));
|
|
8509
|
+
case "End":
|
|
8510
|
+
e.preventDefault();
|
|
8511
|
+
return moveFocus(addDays(focusedDate, 6 - focusedDate.getDay()));
|
|
8512
|
+
case "PageUp":
|
|
8513
|
+
e.preventDefault();
|
|
8514
|
+
return moveFocus(addMonths(focusedDate, -1));
|
|
8515
|
+
case "PageDown":
|
|
8516
|
+
e.preventDefault();
|
|
8517
|
+
return moveFocus(addMonths(focusedDate, 1));
|
|
8518
|
+
case "Escape":
|
|
8519
|
+
if (first) {
|
|
8520
|
+
setFirst(null);
|
|
8521
|
+
setHover(null);
|
|
8522
|
+
}
|
|
8523
|
+
return;
|
|
8524
|
+
case "Enter":
|
|
8525
|
+
case " ":
|
|
8526
|
+
e.preventDefault();
|
|
8527
|
+
return pick(focusedDate);
|
|
8528
|
+
default:
|
|
8529
|
+
}
|
|
8530
|
+
}
|
|
8531
|
+
const nights = shown ? nightsBetween(shown.start, shown.end) : null;
|
|
8532
|
+
return /* @__PURE__ */ jsxs167("div", { className: calendarStyles.calendar, "aria-label": ariaLabel, children: [
|
|
8533
|
+
/* @__PURE__ */ jsxs167("div", { className: calendarStyles.header, children: [
|
|
8534
|
+
/* @__PURE__ */ jsx216(
|
|
8535
|
+
"button",
|
|
8536
|
+
{
|
|
8537
|
+
type: "button",
|
|
8538
|
+
className: calendarStyles.navButton,
|
|
8539
|
+
"aria-label": "Previous month",
|
|
8540
|
+
onClick: () => goToMonth(addMonths(displayedMonth, -1)),
|
|
8541
|
+
children: /* @__PURE__ */ jsx216(Icon, { name: "chevron-left", size: "sm", "aria-hidden": true })
|
|
8542
|
+
}
|
|
8543
|
+
),
|
|
8544
|
+
/* @__PURE__ */ jsx216("span", { className: calendarStyles.monthLabel, children: formatMonthYear(displayedMonth) }),
|
|
8545
|
+
/* @__PURE__ */ jsx216(
|
|
8546
|
+
"button",
|
|
8547
|
+
{
|
|
8548
|
+
type: "button",
|
|
8549
|
+
className: calendarStyles.navButton,
|
|
8550
|
+
"aria-label": "Next month",
|
|
8551
|
+
onClick: () => goToMonth(addMonths(displayedMonth, 1)),
|
|
8552
|
+
children: /* @__PURE__ */ jsx216(Icon, { name: "chevron-right", size: "sm", "aria-hidden": true })
|
|
8553
|
+
}
|
|
8554
|
+
)
|
|
8555
|
+
] }),
|
|
8556
|
+
/* @__PURE__ */ jsxs167(
|
|
8557
|
+
"div",
|
|
8558
|
+
{
|
|
8559
|
+
ref: gridRef,
|
|
8560
|
+
role: "grid",
|
|
8561
|
+
"aria-label": formatMonthYear(displayedMonth),
|
|
8562
|
+
className: calendarStyles.grid,
|
|
8563
|
+
onKeyDown: handleKeyDown,
|
|
8564
|
+
tabIndex: -1,
|
|
8565
|
+
children: [
|
|
8566
|
+
/* @__PURE__ */ jsx216("div", { role: "row", className: calendarStyles.weekdayRow, children: WEEKDAY_LABEL_WEEK2.map((d) => /* @__PURE__ */ jsx216(
|
|
8567
|
+
"span",
|
|
8568
|
+
{
|
|
8569
|
+
role: "columnheader",
|
|
8570
|
+
className: calendarStyles.weekday,
|
|
8571
|
+
"aria-hidden": true,
|
|
8572
|
+
children: formatWeekdayShort(d)
|
|
8573
|
+
},
|
|
8574
|
+
d.getDay()
|
|
8575
|
+
)) }),
|
|
8576
|
+
weeks.map((week) => {
|
|
8577
|
+
const firstDayOfWeek = week[0];
|
|
8578
|
+
if (!firstDayOfWeek) return null;
|
|
8579
|
+
return /* @__PURE__ */ jsx216("div", { role: "row", className: calendarStyles.week, children: week.map((date) => {
|
|
8580
|
+
const isCurrentMonth = isSameMonth(date, displayedMonth);
|
|
8581
|
+
const isStart = shown !== null && isSameDay(date, shown.start);
|
|
8582
|
+
const isEnd = shown !== null && isSameDay(date, shown.end);
|
|
8583
|
+
const inside = shown !== null && nightsBetween(shown.start, date) > 0 && nightsBetween(date, shown.end) > 0;
|
|
8584
|
+
const isToday = isSameDay(date, /* @__PURE__ */ new Date());
|
|
8585
|
+
const disabled = !isWithinRange(date, minDate, maxDate);
|
|
8586
|
+
return /* @__PURE__ */ jsx216(
|
|
8587
|
+
"div",
|
|
8588
|
+
{
|
|
8589
|
+
role: "gridcell",
|
|
8590
|
+
"aria-selected": isStart || isEnd || inside,
|
|
8591
|
+
className: [
|
|
8592
|
+
styles87.cell,
|
|
8593
|
+
inside ? styles87.cellInside : "",
|
|
8594
|
+
isStart && !isEnd ? styles87.cellStart : "",
|
|
8595
|
+
isEnd && !isStart ? styles87.cellEnd : ""
|
|
8596
|
+
].filter(Boolean).join(" "),
|
|
8597
|
+
children: /* @__PURE__ */ jsx216(
|
|
8598
|
+
"button",
|
|
8599
|
+
{
|
|
8600
|
+
type: "button",
|
|
8601
|
+
tabIndex: isSameDay(date, focusedDate) ? 0 : -1,
|
|
8602
|
+
disabled,
|
|
8603
|
+
"aria-current": isToday ? "date" : void 0,
|
|
8604
|
+
"aria-label": formatDateLabel(date),
|
|
8605
|
+
"aria-pressed": isStart || isEnd,
|
|
8606
|
+
className: [
|
|
8607
|
+
calendarStyles.day,
|
|
8608
|
+
!isCurrentMonth ? calendarStyles.dayOutside : "",
|
|
8609
|
+
isStart || isEnd ? calendarStyles.daySelected : "",
|
|
8610
|
+
isToday && !(isStart || isEnd) ? calendarStyles.dayToday : ""
|
|
8611
|
+
].filter(Boolean).join(" "),
|
|
8612
|
+
onClick: () => pick(date),
|
|
8613
|
+
onFocus: () => {
|
|
8614
|
+
setFocusedDate(date);
|
|
8615
|
+
if (first) setHover(date);
|
|
8616
|
+
},
|
|
8617
|
+
onMouseEnter: () => first && !disabled && setHover(date),
|
|
8618
|
+
children: date.getDate()
|
|
8619
|
+
}
|
|
8620
|
+
)
|
|
8621
|
+
},
|
|
8622
|
+
date.toISOString()
|
|
8623
|
+
);
|
|
8624
|
+
}) }, firstDayOfWeek.toISOString());
|
|
8625
|
+
})
|
|
8626
|
+
]
|
|
8627
|
+
}
|
|
8628
|
+
),
|
|
8629
|
+
/* @__PURE__ */ jsx216("p", { className: styles87.summary, role: "status", children: first ? "Now choose the last day." : nights === null ? "Choose the first day." : nightsLabel(nights) })
|
|
8630
|
+
] });
|
|
8631
|
+
}
|
|
8632
|
+
|
|
8633
|
+
// src/components/DateRangePicker/DateRangePicker.tsx
|
|
8634
|
+
import { Fragment as Fragment19, jsx as jsx217, jsxs as jsxs168 } from "react/jsx-runtime";
|
|
8635
|
+
var POPOVER_WIDTH2 = 320;
|
|
8636
|
+
function DateRangePicker({
|
|
8637
|
+
value,
|
|
8638
|
+
onChange,
|
|
8639
|
+
min,
|
|
8640
|
+
max,
|
|
8641
|
+
placeholder = "Select dates",
|
|
8642
|
+
"aria-label": ariaLabel,
|
|
8643
|
+
disabled = false
|
|
8644
|
+
}) {
|
|
8645
|
+
const [open, setOpen] = useState30(false);
|
|
8646
|
+
const isMobile = useIsMobile();
|
|
8647
|
+
const start = parseIso(value.start);
|
|
8648
|
+
const end = parseIso(value.end);
|
|
8649
|
+
const range = start && end ? { start, end } : null;
|
|
8650
|
+
function handleChange(next) {
|
|
8651
|
+
onChange({ start: toIso(next.start), end: toIso(next.end) });
|
|
8652
|
+
setOpen(false);
|
|
8653
|
+
}
|
|
8654
|
+
const trigger = /* @__PURE__ */ jsxs168(
|
|
8655
|
+
"button",
|
|
8656
|
+
{
|
|
8657
|
+
type: "button",
|
|
8658
|
+
className: pickerStyles.trigger,
|
|
8659
|
+
disabled,
|
|
8660
|
+
"aria-label": ariaLabel,
|
|
8661
|
+
"aria-haspopup": "dialog",
|
|
8662
|
+
"aria-expanded": open,
|
|
8663
|
+
onClick: () => setOpen((o) => !o),
|
|
8664
|
+
children: [
|
|
8665
|
+
/* @__PURE__ */ jsx217("span", { className: range ? pickerStyles.triggerValue : pickerStyles.triggerPlaceholder, children: range ? `${formatDateShort(range.start)} \u2013 ${formatDateShort(range.end)} \xB7 ${nightsLabel(nightsBetween(range.start, range.end))}` : placeholder }),
|
|
8666
|
+
/* @__PURE__ */ jsx217(Icon, { name: "calendar", size: "sm", "aria-hidden": true })
|
|
8667
|
+
]
|
|
8668
|
+
}
|
|
8669
|
+
);
|
|
8670
|
+
const calendar = /* @__PURE__ */ jsx217(
|
|
8671
|
+
RangeCalendar,
|
|
8672
|
+
{
|
|
8673
|
+
value: range,
|
|
8674
|
+
onChange: handleChange,
|
|
8675
|
+
minDate: parseIso(min),
|
|
8676
|
+
maxDate: parseIso(max),
|
|
8677
|
+
"aria-label": ariaLabel
|
|
8678
|
+
}
|
|
8679
|
+
);
|
|
8680
|
+
if (isMobile) {
|
|
8681
|
+
return /* @__PURE__ */ jsxs168(Fragment19, { children: [
|
|
8682
|
+
trigger,
|
|
8683
|
+
/* @__PURE__ */ jsx217(Drawer, { open, onClose: () => setOpen(false), "aria-label": ariaLabel, children: /* @__PURE__ */ jsx217("div", { className: pickerStyles.drawerBody, children: calendar }) })
|
|
8684
|
+
] });
|
|
8685
|
+
}
|
|
8686
|
+
return /* @__PURE__ */ jsx217(
|
|
8687
|
+
Popover,
|
|
8688
|
+
{
|
|
8689
|
+
trigger,
|
|
8690
|
+
open,
|
|
8691
|
+
onClose: () => setOpen(false),
|
|
8692
|
+
"aria-label": ariaLabel,
|
|
8693
|
+
width: POPOVER_WIDTH2,
|
|
8694
|
+
children: /* @__PURE__ */ jsx217("div", { className: pickerStyles.popoverBody, children: calendar })
|
|
7924
8695
|
}
|
|
7925
8696
|
);
|
|
7926
8697
|
}
|
|
7927
8698
|
|
|
7928
8699
|
// src/components/SuggestionInput/SuggestionInput.tsx
|
|
7929
|
-
import { useId as useId11, useRef as
|
|
7930
|
-
import
|
|
7931
|
-
import { Fragment as
|
|
8700
|
+
import { useId as useId11, useRef as useRef29, useState as useState31 } from "react";
|
|
8701
|
+
import styles88 from "./SuggestionInput.module.css";
|
|
8702
|
+
import { Fragment as Fragment20, jsx as jsx218, jsxs as jsxs169 } from "react/jsx-runtime";
|
|
7932
8703
|
function SuggestionInput({
|
|
7933
8704
|
value,
|
|
7934
8705
|
onChange,
|
|
@@ -7946,9 +8717,9 @@ function SuggestionInput({
|
|
|
7946
8717
|
const generatedId = useId11();
|
|
7947
8718
|
const inputId = id ?? generatedId;
|
|
7948
8719
|
const listId = `${inputId}-suggestions`;
|
|
7949
|
-
const inputRef =
|
|
7950
|
-
const [focused, setFocused] =
|
|
7951
|
-
const [activeIndex, setActiveIndex] =
|
|
8720
|
+
const inputRef = useRef29(null);
|
|
8721
|
+
const [focused, setFocused] = useState31(false);
|
|
8722
|
+
const [activeIndex, setActiveIndex] = useState31(-1);
|
|
7952
8723
|
const showCreateRow = Boolean(onCreate && createLabel && value.trim());
|
|
7953
8724
|
const rowCount = options.length + (showCreateRow ? 1 : 0);
|
|
7954
8725
|
const open = focused && (rowCount > 0 || loading);
|
|
@@ -7985,7 +8756,7 @@ function SuggestionInput({
|
|
|
7985
8756
|
close();
|
|
7986
8757
|
}
|
|
7987
8758
|
}
|
|
7988
|
-
const trigger = /* @__PURE__ */
|
|
8759
|
+
const trigger = /* @__PURE__ */ jsx218(
|
|
7989
8760
|
"input",
|
|
7990
8761
|
{
|
|
7991
8762
|
ref: inputRef,
|
|
@@ -7997,7 +8768,7 @@ function SuggestionInput({
|
|
|
7997
8768
|
"aria-autocomplete": "list",
|
|
7998
8769
|
"aria-activedescendant": activeIndex >= 0 ? `${listId}-option-${activeIndex}` : void 0,
|
|
7999
8770
|
"aria-label": ariaLabel,
|
|
8000
|
-
className: [
|
|
8771
|
+
className: [styles88.input, className].filter(Boolean).join(" "),
|
|
8001
8772
|
value,
|
|
8002
8773
|
placeholder,
|
|
8003
8774
|
disabled,
|
|
@@ -8010,7 +8781,7 @@ function SuggestionInput({
|
|
|
8010
8781
|
onKeyDown: handleKeyDown
|
|
8011
8782
|
}
|
|
8012
8783
|
);
|
|
8013
|
-
return /* @__PURE__ */
|
|
8784
|
+
return /* @__PURE__ */ jsx218(
|
|
8014
8785
|
Popover,
|
|
8015
8786
|
{
|
|
8016
8787
|
trigger,
|
|
@@ -8018,29 +8789,29 @@ function SuggestionInput({
|
|
|
8018
8789
|
onClose: close,
|
|
8019
8790
|
width: "trigger",
|
|
8020
8791
|
"aria-label": `${ariaLabel} suggestions`,
|
|
8021
|
-
children: /* @__PURE__ */
|
|
8022
|
-
options.map((option, index) => /* @__PURE__ */
|
|
8792
|
+
children: /* @__PURE__ */ jsx218("ul", { id: listId, role: "listbox", className: styles88.list, children: loading ? /* @__PURE__ */ jsx218("li", { className: styles88.status, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs169(Fragment20, { children: [
|
|
8793
|
+
options.map((option, index) => /* @__PURE__ */ jsx218("li", { role: "none", children: /* @__PURE__ */ jsxs169(
|
|
8023
8794
|
"button",
|
|
8024
8795
|
{
|
|
8025
8796
|
id: `${listId}-option-${index}`,
|
|
8026
8797
|
role: "option",
|
|
8027
8798
|
"aria-selected": index === activeIndex,
|
|
8028
8799
|
type: "button",
|
|
8029
|
-
className: [
|
|
8800
|
+
className: [styles88.option, index === activeIndex ? styles88.optionActive : ""].filter(Boolean).join(" "),
|
|
8030
8801
|
onMouseDown: (e) => {
|
|
8031
8802
|
e.preventDefault();
|
|
8032
8803
|
commitIndex(index);
|
|
8033
8804
|
},
|
|
8034
8805
|
children: [
|
|
8035
|
-
option.icon && /* @__PURE__ */
|
|
8036
|
-
/* @__PURE__ */
|
|
8037
|
-
option.meta && /* @__PURE__ */
|
|
8806
|
+
option.icon && /* @__PURE__ */ jsx218("span", { className: styles88.optionIcon, children: option.icon }),
|
|
8807
|
+
/* @__PURE__ */ jsx218("span", { className: styles88.optionLabel, children: option.label }),
|
|
8808
|
+
option.meta && /* @__PURE__ */ jsx218("span", { className: styles88.optionMeta, children: option.meta })
|
|
8038
8809
|
]
|
|
8039
8810
|
}
|
|
8040
8811
|
) }, option.id)),
|
|
8041
|
-
showCreateRow && createLabel && /* @__PURE__ */
|
|
8042
|
-
options.length > 0 && /* @__PURE__ */
|
|
8043
|
-
/* @__PURE__ */
|
|
8812
|
+
showCreateRow && createLabel && /* @__PURE__ */ jsxs169("li", { role: "none", children: [
|
|
8813
|
+
options.length > 0 && /* @__PURE__ */ jsx218("div", { className: styles88.divider }),
|
|
8814
|
+
/* @__PURE__ */ jsx218(
|
|
8044
8815
|
"button",
|
|
8045
8816
|
{
|
|
8046
8817
|
id: `${listId}-option-${options.length}`,
|
|
@@ -8048,9 +8819,9 @@ function SuggestionInput({
|
|
|
8048
8819
|
"aria-selected": options.length === activeIndex,
|
|
8049
8820
|
type: "button",
|
|
8050
8821
|
className: [
|
|
8051
|
-
|
|
8052
|
-
|
|
8053
|
-
options.length === activeIndex ?
|
|
8822
|
+
styles88.option,
|
|
8823
|
+
styles88.optionCreate,
|
|
8824
|
+
options.length === activeIndex ? styles88.optionActive : ""
|
|
8054
8825
|
].filter(Boolean).join(" "),
|
|
8055
8826
|
onMouseDown: (e) => {
|
|
8056
8827
|
e.preventDefault();
|
|
@@ -8066,9 +8837,9 @@ function SuggestionInput({
|
|
|
8066
8837
|
}
|
|
8067
8838
|
|
|
8068
8839
|
// src/components/IconPicker/IconPicker.tsx
|
|
8069
|
-
import { useState as
|
|
8070
|
-
import
|
|
8071
|
-
import { jsx as
|
|
8840
|
+
import { useState as useState32 } from "react";
|
|
8841
|
+
import styles89 from "./IconPicker.module.css";
|
|
8842
|
+
import { jsx as jsx219, jsxs as jsxs170 } from "react/jsx-runtime";
|
|
8072
8843
|
function IconPicker({
|
|
8073
8844
|
value,
|
|
8074
8845
|
onChange,
|
|
@@ -8078,24 +8849,24 @@ function IconPicker({
|
|
|
8078
8849
|
disabled = false,
|
|
8079
8850
|
className
|
|
8080
8851
|
}) {
|
|
8081
|
-
const [open, setOpen] =
|
|
8082
|
-
const trigger = /* @__PURE__ */
|
|
8852
|
+
const [open, setOpen] = useState32(false);
|
|
8853
|
+
const trigger = /* @__PURE__ */ jsxs170(
|
|
8083
8854
|
"button",
|
|
8084
8855
|
{
|
|
8085
8856
|
type: "button",
|
|
8086
|
-
className: [
|
|
8857
|
+
className: [styles89.trigger, className].filter(Boolean).join(" "),
|
|
8087
8858
|
onClick: () => setOpen((o) => !o),
|
|
8088
8859
|
disabled,
|
|
8089
8860
|
"aria-label": ariaLabel,
|
|
8090
8861
|
"aria-haspopup": "true",
|
|
8091
8862
|
"aria-expanded": open,
|
|
8092
8863
|
children: [
|
|
8093
|
-
value ? /* @__PURE__ */
|
|
8094
|
-
triggerLabel && /* @__PURE__ */
|
|
8864
|
+
value ? /* @__PURE__ */ jsx219(Icon, { name: value, size: "md", "aria-hidden": true }) : /* @__PURE__ */ jsx219("span", { className: styles89.placeholder, "aria-hidden": true, children: "?" }),
|
|
8865
|
+
triggerLabel && /* @__PURE__ */ jsx219("span", { className: styles89.triggerLabel, children: triggerLabel })
|
|
8095
8866
|
]
|
|
8096
8867
|
}
|
|
8097
8868
|
);
|
|
8098
|
-
return /* @__PURE__ */
|
|
8869
|
+
return /* @__PURE__ */ jsx219(
|
|
8099
8870
|
Popover,
|
|
8100
8871
|
{
|
|
8101
8872
|
trigger,
|
|
@@ -8103,18 +8874,18 @@ function IconPicker({
|
|
|
8103
8874
|
onClose: () => setOpen(false),
|
|
8104
8875
|
width: 240,
|
|
8105
8876
|
"aria-label": `${ariaLabel} options`,
|
|
8106
|
-
children: /* @__PURE__ */
|
|
8877
|
+
children: /* @__PURE__ */ jsx219("div", { className: styles89.grid, role: "listbox", "aria-label": ariaLabel, children: options.map((name) => /* @__PURE__ */ jsx219(
|
|
8107
8878
|
"button",
|
|
8108
8879
|
{
|
|
8109
8880
|
type: "button",
|
|
8110
8881
|
role: "option",
|
|
8111
8882
|
"aria-selected": name === value,
|
|
8112
|
-
className: [
|
|
8883
|
+
className: [styles89.option, name === value ? styles89.optionSelected : ""].filter(Boolean).join(" "),
|
|
8113
8884
|
onClick: () => {
|
|
8114
8885
|
onChange(name);
|
|
8115
8886
|
setOpen(false);
|
|
8116
8887
|
},
|
|
8117
|
-
children: /* @__PURE__ */
|
|
8888
|
+
children: /* @__PURE__ */ jsx219(Icon, { name, size: "md", "aria-hidden": true })
|
|
8118
8889
|
},
|
|
8119
8890
|
name
|
|
8120
8891
|
)) })
|
|
@@ -8123,8 +8894,8 @@ function IconPicker({
|
|
|
8123
8894
|
}
|
|
8124
8895
|
|
|
8125
8896
|
// src/components/ColorPicker/ColorPicker.tsx
|
|
8126
|
-
import
|
|
8127
|
-
import { jsx as
|
|
8897
|
+
import styles90 from "./ColorPicker.module.css";
|
|
8898
|
+
import { jsx as jsx220, jsxs as jsxs171 } from "react/jsx-runtime";
|
|
8128
8899
|
function normalize(hex) {
|
|
8129
8900
|
return hex.toLowerCase();
|
|
8130
8901
|
}
|
|
@@ -8144,14 +8915,14 @@ function ColorPicker({
|
|
|
8144
8915
|
const matchedSwatch = swatches.find((s) => normalize(s.value) === normalizedValue);
|
|
8145
8916
|
const isCustomActive = normalizedValue !== null && !matchedSwatch;
|
|
8146
8917
|
const customDialValue = isCustomActive && value ? value : swatches[0]?.value ?? "#000000";
|
|
8147
|
-
return /* @__PURE__ */
|
|
8918
|
+
return /* @__PURE__ */ jsxs171(
|
|
8148
8919
|
"div",
|
|
8149
8920
|
{
|
|
8150
|
-
className: [
|
|
8921
|
+
className: [styles90.row, className].filter(Boolean).join(" "),
|
|
8151
8922
|
role: "group",
|
|
8152
8923
|
"aria-label": ariaLabel,
|
|
8153
8924
|
children: [
|
|
8154
|
-
allowNone && /* @__PURE__ */
|
|
8925
|
+
allowNone && /* @__PURE__ */ jsx220(
|
|
8155
8926
|
"button",
|
|
8156
8927
|
{
|
|
8157
8928
|
type: "button",
|
|
@@ -8160,15 +8931,15 @@ function ColorPicker({
|
|
|
8160
8931
|
"aria-label": noneLabel,
|
|
8161
8932
|
title: noneLabel,
|
|
8162
8933
|
disabled,
|
|
8163
|
-
className: [
|
|
8934
|
+
className: [styles90.swatch, styles90.swatchNone, value === null ? styles90.swatchSelected : ""].filter(Boolean).join(" "),
|
|
8164
8935
|
onClick: () => {
|
|
8165
8936
|
onChange(null);
|
|
8166
8937
|
onSelectionComplete?.();
|
|
8167
8938
|
},
|
|
8168
|
-
children: /* @__PURE__ */
|
|
8939
|
+
children: /* @__PURE__ */ jsx220(Icon, { name: "x", size: "sm", "aria-hidden": true })
|
|
8169
8940
|
}
|
|
8170
8941
|
),
|
|
8171
|
-
swatches.map((s) => /* @__PURE__ */
|
|
8942
|
+
swatches.map((s) => /* @__PURE__ */ jsx220(
|
|
8172
8943
|
"button",
|
|
8173
8944
|
{
|
|
8174
8945
|
type: "button",
|
|
@@ -8178,8 +8949,8 @@ function ColorPicker({
|
|
|
8178
8949
|
title: s.label,
|
|
8179
8950
|
disabled,
|
|
8180
8951
|
className: [
|
|
8181
|
-
|
|
8182
|
-
normalize(s.value) === normalizedValue ?
|
|
8952
|
+
styles90.swatch,
|
|
8953
|
+
normalize(s.value) === normalizedValue ? styles90.swatchSelected : ""
|
|
8183
8954
|
].filter(Boolean).join(" "),
|
|
8184
8955
|
style: { backgroundColor: s.value },
|
|
8185
8956
|
onClick: () => {
|
|
@@ -8189,19 +8960,19 @@ function ColorPicker({
|
|
|
8189
8960
|
},
|
|
8190
8961
|
s.value
|
|
8191
8962
|
)),
|
|
8192
|
-
/* @__PURE__ */
|
|
8963
|
+
/* @__PURE__ */ jsxs171(
|
|
8193
8964
|
"span",
|
|
8194
8965
|
{
|
|
8195
8966
|
className: [
|
|
8196
|
-
|
|
8197
|
-
isCustomActive ?
|
|
8967
|
+
styles90.customWrapper,
|
|
8968
|
+
isCustomActive ? styles90.swatchSelected : styles90.customWrapperEmpty
|
|
8198
8969
|
].filter(Boolean).join(" "),
|
|
8199
8970
|
children: [
|
|
8200
|
-
/* @__PURE__ */
|
|
8971
|
+
/* @__PURE__ */ jsx220(
|
|
8201
8972
|
"input",
|
|
8202
8973
|
{
|
|
8203
8974
|
type: "color",
|
|
8204
|
-
className:
|
|
8975
|
+
className: styles90.customInput,
|
|
8205
8976
|
"aria-label": customLabel,
|
|
8206
8977
|
title: customLabel,
|
|
8207
8978
|
disabled,
|
|
@@ -8209,7 +8980,7 @@ function ColorPicker({
|
|
|
8209
8980
|
onChange: (e) => onChange(e.target.value)
|
|
8210
8981
|
}
|
|
8211
8982
|
),
|
|
8212
|
-
!isCustomActive && /* @__PURE__ */
|
|
8983
|
+
!isCustomActive && /* @__PURE__ */ jsx220(Icon, { name: "plus", size: "sm", "aria-hidden": true, className: styles90.customPlusIcon })
|
|
8213
8984
|
]
|
|
8214
8985
|
}
|
|
8215
8986
|
)
|
|
@@ -8220,8 +8991,8 @@ function ColorPicker({
|
|
|
8220
8991
|
|
|
8221
8992
|
// src/components/QuantityStepper/QuantityStepper.tsx
|
|
8222
8993
|
import { useId as useId12 } from "react";
|
|
8223
|
-
import
|
|
8224
|
-
import { jsx as
|
|
8994
|
+
import styles91 from "./QuantityStepper.module.css";
|
|
8995
|
+
import { jsx as jsx221, jsxs as jsxs172 } from "react/jsx-runtime";
|
|
8225
8996
|
function QuantityStepper({
|
|
8226
8997
|
value,
|
|
8227
8998
|
onChange,
|
|
@@ -8236,7 +9007,7 @@ function QuantityStepper({
|
|
|
8236
9007
|
}) {
|
|
8237
9008
|
const generatedId = useId12();
|
|
8238
9009
|
const inputId = id ?? generatedId;
|
|
8239
|
-
function
|
|
9010
|
+
function clamp4(next) {
|
|
8240
9011
|
let result = next;
|
|
8241
9012
|
if (min !== void 0) result = Math.max(min, result);
|
|
8242
9013
|
if (max !== void 0) result = Math.min(max, result);
|
|
@@ -8244,28 +9015,28 @@ function QuantityStepper({
|
|
|
8244
9015
|
}
|
|
8245
9016
|
function handleInputChange(e) {
|
|
8246
9017
|
const parsed = Number.parseFloat(e.target.value);
|
|
8247
|
-
if (!Number.isNaN(parsed)) onChange(
|
|
9018
|
+
if (!Number.isNaN(parsed)) onChange(clamp4(parsed));
|
|
8248
9019
|
}
|
|
8249
9020
|
const decrementDisabled = disabled || min !== void 0 && value <= min;
|
|
8250
9021
|
const incrementDisabled = disabled || max !== void 0 && value >= max;
|
|
8251
|
-
return /* @__PURE__ */
|
|
8252
|
-
/* @__PURE__ */
|
|
9022
|
+
return /* @__PURE__ */ jsxs172("div", { className: [styles91.root, className].filter(Boolean).join(" "), children: [
|
|
9023
|
+
/* @__PURE__ */ jsx221(
|
|
8253
9024
|
"button",
|
|
8254
9025
|
{
|
|
8255
9026
|
type: "button",
|
|
8256
|
-
className:
|
|
8257
|
-
onClick: () => onChange(
|
|
9027
|
+
className: styles91.button,
|
|
9028
|
+
onClick: () => onChange(clamp4(value - step)),
|
|
8258
9029
|
disabled: decrementDisabled,
|
|
8259
9030
|
"aria-label": `Decrease ${ariaLabel}`,
|
|
8260
9031
|
children: "\u2212"
|
|
8261
9032
|
}
|
|
8262
9033
|
),
|
|
8263
|
-
/* @__PURE__ */
|
|
9034
|
+
/* @__PURE__ */ jsx221(
|
|
8264
9035
|
"input",
|
|
8265
9036
|
{
|
|
8266
9037
|
id: inputId,
|
|
8267
9038
|
type: "number",
|
|
8268
|
-
className:
|
|
9039
|
+
className: styles91.input,
|
|
8269
9040
|
value,
|
|
8270
9041
|
onChange: handleInputChange,
|
|
8271
9042
|
min,
|
|
@@ -8275,13 +9046,13 @@ function QuantityStepper({
|
|
|
8275
9046
|
"aria-label": ariaLabel
|
|
8276
9047
|
}
|
|
8277
9048
|
),
|
|
8278
|
-
unit && /* @__PURE__ */
|
|
8279
|
-
/* @__PURE__ */
|
|
9049
|
+
unit && /* @__PURE__ */ jsx221("span", { className: styles91.unit, "aria-hidden": true, children: unit }),
|
|
9050
|
+
/* @__PURE__ */ jsx221(
|
|
8280
9051
|
"button",
|
|
8281
9052
|
{
|
|
8282
9053
|
type: "button",
|
|
8283
|
-
className:
|
|
8284
|
-
onClick: () => onChange(
|
|
9054
|
+
className: styles91.button,
|
|
9055
|
+
onClick: () => onChange(clamp4(value + step)),
|
|
8285
9056
|
disabled: incrementDisabled,
|
|
8286
9057
|
"aria-label": `Increase ${ariaLabel}`,
|
|
8287
9058
|
children: "+"
|
|
@@ -8291,8 +9062,8 @@ function QuantityStepper({
|
|
|
8291
9062
|
}
|
|
8292
9063
|
|
|
8293
9064
|
// src/components/CheckableListRow/CheckableListRow.tsx
|
|
8294
|
-
import
|
|
8295
|
-
import { jsx as
|
|
9065
|
+
import styles92 from "./CheckableListRow.module.css";
|
|
9066
|
+
import { jsx as jsx222, jsxs as jsxs173 } from "react/jsx-runtime";
|
|
8296
9067
|
function CheckableListRow({
|
|
8297
9068
|
checked,
|
|
8298
9069
|
onCheckedChange,
|
|
@@ -8311,8 +9082,8 @@ function CheckableListRow({
|
|
|
8311
9082
|
toggle();
|
|
8312
9083
|
}
|
|
8313
9084
|
}
|
|
8314
|
-
return /* @__PURE__ */
|
|
8315
|
-
/* @__PURE__ */
|
|
9085
|
+
return /* @__PURE__ */ jsxs173("div", { className: [styles92.row, className].filter(Boolean).join(" "), children: [
|
|
9086
|
+
/* @__PURE__ */ jsxs173(
|
|
8316
9087
|
"div",
|
|
8317
9088
|
{
|
|
8318
9089
|
role: "checkbox",
|
|
@@ -8320,11 +9091,11 @@ function CheckableListRow({
|
|
|
8320
9091
|
"aria-label": label,
|
|
8321
9092
|
"aria-disabled": disabled || void 0,
|
|
8322
9093
|
tabIndex: disabled ? -1 : 0,
|
|
8323
|
-
className:
|
|
9094
|
+
className: styles92.tapTarget,
|
|
8324
9095
|
onClick: toggle,
|
|
8325
9096
|
onKeyDown: handleKeyDown,
|
|
8326
9097
|
children: [
|
|
8327
|
-
/* @__PURE__ */
|
|
9098
|
+
/* @__PURE__ */ jsx222("span", { className: [styles92.box, checked ? styles92.checked : ""].filter(Boolean).join(" "), children: checked && /* @__PURE__ */ jsx222("svg", { className: styles92.tick, viewBox: "0 0 10 8", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx222(
|
|
8328
9099
|
"path",
|
|
8329
9100
|
{
|
|
8330
9101
|
d: "M1 4l3 3 5-6",
|
|
@@ -8334,18 +9105,18 @@ function CheckableListRow({
|
|
|
8334
9105
|
strokeLinejoin: "round"
|
|
8335
9106
|
}
|
|
8336
9107
|
) }) }),
|
|
8337
|
-
icon && /* @__PURE__ */
|
|
8338
|
-
/* @__PURE__ */
|
|
9108
|
+
icon && /* @__PURE__ */ jsx222("span", { className: styles92.icon, children: icon }),
|
|
9109
|
+
/* @__PURE__ */ jsx222("span", { className: [styles92.label, checked ? styles92.struck : ""].filter(Boolean).join(" "), children: label })
|
|
8339
9110
|
]
|
|
8340
9111
|
}
|
|
8341
9112
|
),
|
|
8342
|
-
trailing && /* @__PURE__ */
|
|
9113
|
+
trailing && /* @__PURE__ */ jsx222("span", { className: styles92.trailing, children: trailing })
|
|
8343
9114
|
] });
|
|
8344
9115
|
}
|
|
8345
9116
|
|
|
8346
9117
|
// src/components/CurrencyInput/CurrencyInput.tsx
|
|
8347
|
-
import { useState as
|
|
8348
|
-
import { jsx as
|
|
9118
|
+
import { useState as useState33 } from "react";
|
|
9119
|
+
import { jsx as jsx223 } from "react/jsx-runtime";
|
|
8349
9120
|
function minorToText(minor, decimals) {
|
|
8350
9121
|
return (minor / 10 ** decimals).toFixed(decimals);
|
|
8351
9122
|
}
|
|
@@ -8362,13 +9133,13 @@ function CurrencyInput({
|
|
|
8362
9133
|
decimals = 2,
|
|
8363
9134
|
...rest
|
|
8364
9135
|
}) {
|
|
8365
|
-
const [text, setText] =
|
|
9136
|
+
const [text, setText] = useState33(
|
|
8366
9137
|
() => valueCents != null ? minorToText(valueCents, decimals) : ""
|
|
8367
9138
|
);
|
|
8368
9139
|
if (textToMinor(text, decimals) !== valueCents) {
|
|
8369
9140
|
setText(valueCents != null ? minorToText(valueCents, decimals) : "");
|
|
8370
9141
|
}
|
|
8371
|
-
return /* @__PURE__ */
|
|
9142
|
+
return /* @__PURE__ */ jsx223(
|
|
8372
9143
|
Input,
|
|
8373
9144
|
{
|
|
8374
9145
|
...rest,
|
|
@@ -8385,19 +9156,19 @@ function CurrencyInput({
|
|
|
8385
9156
|
}
|
|
8386
9157
|
|
|
8387
9158
|
// src/components/BalanceChip/BalanceChip.tsx
|
|
8388
|
-
import
|
|
8389
|
-
import { jsx as
|
|
9159
|
+
import styles93 from "./BalanceChip.module.css";
|
|
9160
|
+
import { jsx as jsx224 } from "react/jsx-runtime";
|
|
8390
9161
|
function formatAbsCents(cents) {
|
|
8391
9162
|
return (Math.abs(cents) / 100).toFixed(2);
|
|
8392
9163
|
}
|
|
8393
9164
|
function BalanceChip({ amountCents, currency, className }) {
|
|
8394
9165
|
const direction = amountCents > 0 ? "owed" : amountCents < 0 ? "owes" : "settled";
|
|
8395
9166
|
const text = direction === "settled" ? "Settled up" : `${direction === "owed" ? "Owed" : "Owes"} ${currency} ${formatAbsCents(amountCents)}`;
|
|
8396
|
-
return /* @__PURE__ */
|
|
9167
|
+
return /* @__PURE__ */ jsx224("span", { className: [styles93.chip, styles93[direction], className].filter(Boolean).join(" "), children: text });
|
|
8397
9168
|
}
|
|
8398
9169
|
|
|
8399
9170
|
// src/components/SplitMethodSelector/SplitMethodSelector.tsx
|
|
8400
|
-
import { jsx as
|
|
9171
|
+
import { jsx as jsx225 } from "react/jsx-runtime";
|
|
8401
9172
|
var OPTIONS = [
|
|
8402
9173
|
{ label: "Equal", value: "equal" },
|
|
8403
9174
|
{ label: "Amount", value: "amount" },
|
|
@@ -8410,7 +9181,7 @@ function SplitMethodSelector({
|
|
|
8410
9181
|
size = "sm",
|
|
8411
9182
|
"aria-label": ariaLabel = "Split method"
|
|
8412
9183
|
}) {
|
|
8413
|
-
return /* @__PURE__ */
|
|
9184
|
+
return /* @__PURE__ */ jsx225(
|
|
8414
9185
|
SegmentedControl,
|
|
8415
9186
|
{
|
|
8416
9187
|
value,
|
|
@@ -8423,8 +9194,8 @@ function SplitMethodSelector({
|
|
|
8423
9194
|
}
|
|
8424
9195
|
|
|
8425
9196
|
// src/components/MemberMultiSelect/MemberMultiSelect.tsx
|
|
8426
|
-
import
|
|
8427
|
-
import { jsx as
|
|
9197
|
+
import styles94 from "./MemberMultiSelect.module.css";
|
|
9198
|
+
import { jsx as jsx226, jsxs as jsxs174 } from "react/jsx-runtime";
|
|
8428
9199
|
function MemberMultiSelect({
|
|
8429
9200
|
options,
|
|
8430
9201
|
selectedIds,
|
|
@@ -8434,12 +9205,12 @@ function MemberMultiSelect({
|
|
|
8434
9205
|
hint,
|
|
8435
9206
|
className
|
|
8436
9207
|
}) {
|
|
8437
|
-
return /* @__PURE__ */
|
|
8438
|
-
label && /* @__PURE__ */
|
|
9208
|
+
return /* @__PURE__ */ jsxs174("div", { className: [styles94.group, className].filter(Boolean).join(" "), children: [
|
|
9209
|
+
label && /* @__PURE__ */ jsx226("span", { className: styles94.label, children: label }),
|
|
8439
9210
|
options.map((option) => {
|
|
8440
9211
|
const checked = selectedIds.has(option.id);
|
|
8441
|
-
return /* @__PURE__ */
|
|
8442
|
-
/* @__PURE__ */
|
|
9212
|
+
return /* @__PURE__ */ jsxs174("div", { className: styles94.row, children: [
|
|
9213
|
+
/* @__PURE__ */ jsx226(
|
|
8443
9214
|
Checkbox,
|
|
8444
9215
|
{
|
|
8445
9216
|
checked,
|
|
@@ -8447,16 +9218,16 @@ function MemberMultiSelect({
|
|
|
8447
9218
|
label: option.label
|
|
8448
9219
|
}
|
|
8449
9220
|
),
|
|
8450
|
-
checked && renderTrailing && /* @__PURE__ */
|
|
9221
|
+
checked && renderTrailing && /* @__PURE__ */ jsx226("span", { className: styles94.trailing, children: renderTrailing(option.id) })
|
|
8451
9222
|
] }, option.id);
|
|
8452
9223
|
}),
|
|
8453
|
-
hint && /* @__PURE__ */
|
|
9224
|
+
hint && /* @__PURE__ */ jsx226("span", { className: styles94.hint, children: hint })
|
|
8454
9225
|
] });
|
|
8455
9226
|
}
|
|
8456
9227
|
|
|
8457
9228
|
// src/components/SwipableMobileCarouselDots/SwipableMobileCarouselDots.tsx
|
|
8458
|
-
import
|
|
8459
|
-
import { jsx as
|
|
9229
|
+
import styles95 from "./SwipableMobileCarouselDots.module.css";
|
|
9230
|
+
import { jsx as jsx227 } from "react/jsx-runtime";
|
|
8460
9231
|
function SwipableMobileCarouselDots({
|
|
8461
9232
|
count,
|
|
8462
9233
|
activeIndex,
|
|
@@ -8466,23 +9237,23 @@ function SwipableMobileCarouselDots({
|
|
|
8466
9237
|
density = "default",
|
|
8467
9238
|
className
|
|
8468
9239
|
}) {
|
|
8469
|
-
return /* @__PURE__ */
|
|
9240
|
+
return /* @__PURE__ */ jsx227(
|
|
8470
9241
|
"div",
|
|
8471
9242
|
{
|
|
8472
9243
|
role: "tablist",
|
|
8473
9244
|
"aria-label": ariaLabel,
|
|
8474
|
-
className: [
|
|
9245
|
+
className: [styles95.dots, density === "compact" ? styles95.dotsCompact : "", className].filter(Boolean).join(" "),
|
|
8475
9246
|
children: Array.from({ length: count }, (_, i) => {
|
|
8476
9247
|
const active = i === activeIndex;
|
|
8477
9248
|
const label = labels?.[i] ?? `Slide ${i + 1} of ${count}`;
|
|
8478
|
-
return /* @__PURE__ */
|
|
9249
|
+
return /* @__PURE__ */ jsx227(
|
|
8479
9250
|
"button",
|
|
8480
9251
|
{
|
|
8481
9252
|
type: "button",
|
|
8482
9253
|
role: "tab",
|
|
8483
9254
|
"aria-selected": active,
|
|
8484
9255
|
"aria-label": label,
|
|
8485
|
-
className: [
|
|
9256
|
+
className: [styles95.dot, active ? styles95.dotActive : ""].filter(Boolean).join(" "),
|
|
8486
9257
|
onClick: () => onJump(i)
|
|
8487
9258
|
},
|
|
8488
9259
|
i
|
|
@@ -8499,7 +9270,7 @@ import {
|
|
|
8499
9270
|
useEffect as useEffect18,
|
|
8500
9271
|
useLayoutEffect as useLayoutEffect4,
|
|
8501
9272
|
useMemo as useMemo6,
|
|
8502
|
-
useRef as
|
|
9273
|
+
useRef as useRef30
|
|
8503
9274
|
} from "react";
|
|
8504
9275
|
|
|
8505
9276
|
// src/components/SwipableMobileCarousel/SwipableMobileCarouselSlide.tsx
|
|
@@ -8510,16 +9281,16 @@ import { createContext as createContext3 } from "react";
|
|
|
8510
9281
|
var CarouselSlideMountContext = createContext3(null);
|
|
8511
9282
|
|
|
8512
9283
|
// src/components/SwipableMobileCarousel/SwipableMobileCarouselSlide.tsx
|
|
8513
|
-
import { Fragment as
|
|
9284
|
+
import { Fragment as Fragment21, jsx as jsx228 } from "react/jsx-runtime";
|
|
8514
9285
|
function SwipableMobileCarouselSlide({ children }) {
|
|
8515
9286
|
const ctx = useContext3(CarouselSlideMountContext);
|
|
8516
9287
|
if (!ctx?.isMounted) return null;
|
|
8517
|
-
return /* @__PURE__ */
|
|
9288
|
+
return /* @__PURE__ */ jsx228(Fragment21, { children });
|
|
8518
9289
|
}
|
|
8519
9290
|
|
|
8520
9291
|
// src/components/SwipableMobileCarousel/SwipableMobileCarousel.tsx
|
|
8521
|
-
import
|
|
8522
|
-
import { jsx as
|
|
9292
|
+
import styles96 from "./SwipableMobileCarousel.module.css";
|
|
9293
|
+
import { jsx as jsx229, jsxs as jsxs175 } from "react/jsx-runtime";
|
|
8523
9294
|
function describeChild(child) {
|
|
8524
9295
|
if (isValidElement2(child)) {
|
|
8525
9296
|
const type = child.type;
|
|
@@ -8568,7 +9339,7 @@ function SwipableMobileCarousel({
|
|
|
8568
9339
|
const slides = useMemo6(() => resolveSlides(children), [children]);
|
|
8569
9340
|
const count = slides.length;
|
|
8570
9341
|
const clampedActiveIndex = count === 0 ? 0 : Math.max(0, Math.min(count - 1, activeIndex));
|
|
8571
|
-
const initialActiveIndexRef =
|
|
9342
|
+
const initialActiveIndexRef = useRef30(clampedActiveIndex);
|
|
8572
9343
|
const { scrollRef, scrollToIndex, liveIndex } = useSnapCarousel({
|
|
8573
9344
|
itemCount: count,
|
|
8574
9345
|
onSettle,
|
|
@@ -8578,7 +9349,7 @@ function SwipableMobileCarousel({
|
|
|
8578
9349
|
useLayoutEffect4(() => {
|
|
8579
9350
|
scrollToIndex(initialActiveIndexRef.current, "instant");
|
|
8580
9351
|
}, []);
|
|
8581
|
-
const didMountActiveIndexSyncRef =
|
|
9352
|
+
const didMountActiveIndexSyncRef = useRef30(false);
|
|
8582
9353
|
useEffect18(() => {
|
|
8583
9354
|
if (!didMountActiveIndexSyncRef.current) {
|
|
8584
9355
|
didMountActiveIndexSyncRef.current = true;
|
|
@@ -8586,7 +9357,7 @@ function SwipableMobileCarousel({
|
|
|
8586
9357
|
}
|
|
8587
9358
|
scrollToIndex(clampedActiveIndex, "smooth");
|
|
8588
9359
|
}, [clampedActiveIndex, scrollToIndex]);
|
|
8589
|
-
const prevKeysRef =
|
|
9360
|
+
const prevKeysRef = useRef30(null);
|
|
8590
9361
|
useLayoutEffect4(() => {
|
|
8591
9362
|
const currentKeys = slides.map((s) => s.key);
|
|
8592
9363
|
const prevKeys = prevKeysRef.current;
|
|
@@ -8610,7 +9381,7 @@ function SwipableMobileCarousel({
|
|
|
8610
9381
|
onSettle(index);
|
|
8611
9382
|
}
|
|
8612
9383
|
const labels = slides.map((s) => s.label);
|
|
8613
|
-
const indicator = renderIndicator === null ? null : renderIndicator ? renderIndicator({ count, activeIndex: clampedActiveIndex, labels, onJump: handleJump }) : /* @__PURE__ */
|
|
9384
|
+
const indicator = renderIndicator === null ? null : renderIndicator ? renderIndicator({ count, activeIndex: clampedActiveIndex, labels, onJump: handleJump }) : /* @__PURE__ */ jsx229(
|
|
8614
9385
|
SwipableMobileCarouselDots,
|
|
8615
9386
|
{
|
|
8616
9387
|
count,
|
|
@@ -8620,8 +9391,8 @@ function SwipableMobileCarousel({
|
|
|
8620
9391
|
onJump: handleJump
|
|
8621
9392
|
}
|
|
8622
9393
|
);
|
|
8623
|
-
return /* @__PURE__ */
|
|
8624
|
-
/* @__PURE__ */
|
|
9394
|
+
return /* @__PURE__ */ jsxs175("div", { className: [styles96.wrap, className].filter(Boolean).join(" "), children: [
|
|
9395
|
+
/* @__PURE__ */ jsx229("div", { className: styles96.scroller, ref: scrollRef, role: "region", "aria-label": ariaLabel, children: slides.map((slide, i) => /* @__PURE__ */ jsx229("div", { className: styles96.slide, children: /* @__PURE__ */ jsx229(
|
|
8625
9396
|
CarouselSlideMountContext.Provider,
|
|
8626
9397
|
{
|
|
8627
9398
|
value: {
|
|
@@ -8639,61 +9410,61 @@ function SwipableMobileCarousel({
|
|
|
8639
9410
|
children: slide.element
|
|
8640
9411
|
}
|
|
8641
9412
|
) }, slide.key)) }),
|
|
8642
|
-
indicator && /* @__PURE__ */
|
|
9413
|
+
indicator && /* @__PURE__ */ jsx229("div", { className: styles96.indicatorSlot, children: indicator })
|
|
8643
9414
|
] });
|
|
8644
9415
|
}
|
|
8645
9416
|
|
|
8646
9417
|
// src/components/SwipableMobileCarousel/SwipableMobileCarouselSlideHeader.tsx
|
|
8647
|
-
import
|
|
8648
|
-
import { jsx as
|
|
9418
|
+
import styles97 from "./SwipableMobileCarouselSlideParts.module.css";
|
|
9419
|
+
import { jsx as jsx230 } from "react/jsx-runtime";
|
|
8649
9420
|
function SwipableMobileCarouselSlideHeader({
|
|
8650
9421
|
children,
|
|
8651
9422
|
className
|
|
8652
9423
|
}) {
|
|
8653
|
-
return /* @__PURE__ */
|
|
9424
|
+
return /* @__PURE__ */ jsx230("div", { className: [styles97.header, className].filter(Boolean).join(" "), children });
|
|
8654
9425
|
}
|
|
8655
9426
|
|
|
8656
9427
|
// src/components/SwipableMobileCarousel/SwipableMobileCarouselSlideBody.tsx
|
|
8657
|
-
import
|
|
8658
|
-
import { jsx as
|
|
8659
|
-
var defaultLoadingFallback = /* @__PURE__ */
|
|
9428
|
+
import styles98 from "./SwipableMobileCarouselSlideParts.module.css";
|
|
9429
|
+
import { jsx as jsx231 } from "react/jsx-runtime";
|
|
9430
|
+
var defaultLoadingFallback = /* @__PURE__ */ jsx231("div", { className: styles98.loading, children: "Loading\u2026" });
|
|
8660
9431
|
function SwipableMobileCarouselSlideBody({
|
|
8661
9432
|
children,
|
|
8662
9433
|
loading = false,
|
|
8663
9434
|
loadingFallback,
|
|
8664
9435
|
className
|
|
8665
9436
|
}) {
|
|
8666
|
-
return /* @__PURE__ */
|
|
9437
|
+
return /* @__PURE__ */ jsx231("div", { className: [styles98.body, className].filter(Boolean).join(" "), children: loading ? loadingFallback ?? defaultLoadingFallback : children });
|
|
8667
9438
|
}
|
|
8668
9439
|
|
|
8669
9440
|
// src/components/SwipableMobileCarousel/SwipableMobileCarouselSlideFooter.tsx
|
|
8670
|
-
import
|
|
8671
|
-
import { jsx as
|
|
9441
|
+
import styles99 from "./SwipableMobileCarouselSlideParts.module.css";
|
|
9442
|
+
import { jsx as jsx232 } from "react/jsx-runtime";
|
|
8672
9443
|
function SwipableMobileCarouselSlideFooter({
|
|
8673
9444
|
children,
|
|
8674
9445
|
className
|
|
8675
9446
|
}) {
|
|
8676
|
-
return /* @__PURE__ */
|
|
9447
|
+
return /* @__PURE__ */ jsx232("div", { className: [styles99.footer, className].filter(Boolean).join(" "), children });
|
|
8677
9448
|
}
|
|
8678
9449
|
|
|
8679
9450
|
// src/components/SwipeStack/SwipeStack.tsx
|
|
8680
|
-
import { Children as Children3, isValidElement as isValidElement3, useEffect as useEffect19, useRef as
|
|
9451
|
+
import { Children as Children3, isValidElement as isValidElement3, useEffect as useEffect19, useRef as useRef31, useState as useState34 } from "react";
|
|
8681
9452
|
|
|
8682
9453
|
// src/components/SwipeStack/SwipeStackCard.tsx
|
|
8683
|
-
import { Fragment as
|
|
9454
|
+
import { Fragment as Fragment22, jsx as jsx233 } from "react/jsx-runtime";
|
|
8684
9455
|
function SwipeStackCard({ children }) {
|
|
8685
|
-
return /* @__PURE__ */
|
|
9456
|
+
return /* @__PURE__ */ jsx233(Fragment22, { children });
|
|
8686
9457
|
}
|
|
8687
9458
|
|
|
8688
9459
|
// src/components/SwipeStack/SwipeStack.tsx
|
|
8689
|
-
import
|
|
8690
|
-
import { jsx as
|
|
9460
|
+
import styles100 from "./SwipeStack.module.css";
|
|
9461
|
+
import { jsx as jsx234, jsxs as jsxs176 } from "react/jsx-runtime";
|
|
8691
9462
|
var DIRECTION_KEYS = ["up", "down", "left", "right"];
|
|
8692
9463
|
var STAMP_CLASS = {
|
|
8693
|
-
up:
|
|
8694
|
-
down:
|
|
8695
|
-
left:
|
|
8696
|
-
right:
|
|
9464
|
+
up: styles100.stampUp,
|
|
9465
|
+
down: styles100.stampDown,
|
|
9466
|
+
left: styles100.stampLeft,
|
|
9467
|
+
right: styles100.stampRight
|
|
8697
9468
|
};
|
|
8698
9469
|
function describeChild2(child) {
|
|
8699
9470
|
if (isValidElement3(child)) {
|
|
@@ -8734,9 +9505,9 @@ function SwipeStack({
|
|
|
8734
9505
|
children
|
|
8735
9506
|
}) {
|
|
8736
9507
|
const cards = resolveCards(children);
|
|
8737
|
-
const [dismissed, setDismissed] =
|
|
8738
|
-
const [exiting, setExiting] =
|
|
8739
|
-
const exitTimerRef =
|
|
9508
|
+
const [dismissed, setDismissed] = useState34(() => /* @__PURE__ */ new Set());
|
|
9509
|
+
const [exiting, setExiting] = useState34(null);
|
|
9510
|
+
const exitTimerRef = useRef31(null);
|
|
8740
9511
|
useEffect19(
|
|
8741
9512
|
() => () => {
|
|
8742
9513
|
if (exitTimerRef.current) clearTimeout(exitTimerRef.current);
|
|
@@ -8764,33 +9535,33 @@ function SwipeStack({
|
|
|
8764
9535
|
onSwipe(direction, committed.key);
|
|
8765
9536
|
}
|
|
8766
9537
|
});
|
|
8767
|
-
return /* @__PURE__ */
|
|
8768
|
-
/* @__PURE__ */
|
|
8769
|
-
peek && /* @__PURE__ */
|
|
8770
|
-
current && /* @__PURE__ */
|
|
9538
|
+
return /* @__PURE__ */ jsxs176("div", { className: [styles100.wrap, className].filter(Boolean).join(" "), children: [
|
|
9539
|
+
/* @__PURE__ */ jsxs176("div", { className: styles100.stack, role: "region", "aria-label": ariaLabel, children: [
|
|
9540
|
+
peek && /* @__PURE__ */ jsx234("div", { className: styles100.peek, "aria-hidden": "true", children: peek.element }, peek.key),
|
|
9541
|
+
current && /* @__PURE__ */ jsxs176("div", { className: styles100.cardSlot, ref: wrapRef, children: [
|
|
8771
9542
|
liveDirections.map((d) => {
|
|
8772
9543
|
const meta = directions[d];
|
|
8773
9544
|
if (!meta) return null;
|
|
8774
|
-
return /* @__PURE__ */
|
|
9545
|
+
return /* @__PURE__ */ jsxs176(
|
|
8775
9546
|
"div",
|
|
8776
9547
|
{
|
|
8777
|
-
className: [
|
|
9548
|
+
className: [styles100.stamp, STAMP_CLASS[d]].join(" "),
|
|
8778
9549
|
"aria-hidden": "true",
|
|
8779
9550
|
children: [
|
|
8780
|
-
meta.icon && /* @__PURE__ */
|
|
8781
|
-
/* @__PURE__ */
|
|
9551
|
+
meta.icon && /* @__PURE__ */ jsx234(Icon, { name: meta.icon, size: "sm", "aria-hidden": true }),
|
|
9552
|
+
/* @__PURE__ */ jsx234("span", { children: meta.label })
|
|
8782
9553
|
]
|
|
8783
9554
|
},
|
|
8784
9555
|
d
|
|
8785
9556
|
);
|
|
8786
9557
|
}),
|
|
8787
|
-
/* @__PURE__ */
|
|
9558
|
+
/* @__PURE__ */ jsx234("div", { className: styles100.card, ref: cardRef, style: { touchAction }, ...handlers, children: current.element })
|
|
8788
9559
|
] }, current.key)
|
|
8789
9560
|
] }),
|
|
8790
|
-
liveDirections.length > 0 && /* @__PURE__ */
|
|
9561
|
+
liveDirections.length > 0 && /* @__PURE__ */ jsx234("div", { className: styles100.actions, role: "group", "aria-label": `${ariaLabel} actions`, children: liveDirections.map((d) => {
|
|
8791
9562
|
const meta = directions[d];
|
|
8792
9563
|
if (!meta) return null;
|
|
8793
|
-
return /* @__PURE__ */
|
|
9564
|
+
return /* @__PURE__ */ jsxs176(
|
|
8794
9565
|
Button,
|
|
8795
9566
|
{
|
|
8796
9567
|
variant: "secondary",
|
|
@@ -8798,7 +9569,7 @@ function SwipeStack({
|
|
|
8798
9569
|
disabled: !current,
|
|
8799
9570
|
onClick: () => triggerCommit(d),
|
|
8800
9571
|
children: [
|
|
8801
|
-
meta.icon && /* @__PURE__ */
|
|
9572
|
+
meta.icon && /* @__PURE__ */ jsx234(Icon, { name: meta.icon, size: "sm", "aria-hidden": true }),
|
|
8802
9573
|
meta.label
|
|
8803
9574
|
]
|
|
8804
9575
|
},
|
|
@@ -8810,8 +9581,8 @@ function SwipeStack({
|
|
|
8810
9581
|
|
|
8811
9582
|
// src/components/ThreeColumnLayout/ThreeColumnLayout.tsx
|
|
8812
9583
|
import { Children as Children4 } from "react";
|
|
8813
|
-
import
|
|
8814
|
-
import { jsx as
|
|
9584
|
+
import styles101 from "./ThreeColumnLayout.module.css";
|
|
9585
|
+
import { jsx as jsx235, jsxs as jsxs177 } from "react/jsx-runtime";
|
|
8815
9586
|
function ThreeColumnLayout({
|
|
8816
9587
|
children,
|
|
8817
9588
|
sidebarWidth = 280,
|
|
@@ -8826,24 +9597,24 @@ function ThreeColumnLayout({
|
|
|
8826
9597
|
);
|
|
8827
9598
|
}
|
|
8828
9599
|
const [sidebar, main, detail] = items;
|
|
8829
|
-
return /* @__PURE__ */
|
|
8830
|
-
/* @__PURE__ */
|
|
9600
|
+
return /* @__PURE__ */ jsxs177("div", { className: [styles101.shell, className].filter(Boolean).join(" "), children: [
|
|
9601
|
+
/* @__PURE__ */ jsx235(
|
|
8831
9602
|
"div",
|
|
8832
9603
|
{
|
|
8833
|
-
className: [
|
|
9604
|
+
className: [styles101.sidebar, sidebarHidden && styles101.sidebarHidden].filter(Boolean).join(" "),
|
|
8834
9605
|
style: sidebarHidden ? void 0 : { width: sidebarWidth },
|
|
8835
9606
|
hidden: sidebarHidden,
|
|
8836
9607
|
children: sidebar
|
|
8837
9608
|
}
|
|
8838
9609
|
),
|
|
8839
|
-
/* @__PURE__ */
|
|
8840
|
-
detail && /* @__PURE__ */
|
|
9610
|
+
/* @__PURE__ */ jsx235("div", { className: styles101.main, children: main }),
|
|
9611
|
+
detail && /* @__PURE__ */ jsx235("div", { className: styles101.detail, style: { width: detailWidth }, children: detail })
|
|
8841
9612
|
] });
|
|
8842
9613
|
}
|
|
8843
9614
|
|
|
8844
9615
|
// src/components/HeaderFooterLayout/HeaderFooterLayout.tsx
|
|
8845
|
-
import
|
|
8846
|
-
import { jsx as
|
|
9616
|
+
import styles102 from "./HeaderFooterLayout.module.css";
|
|
9617
|
+
import { jsx as jsx236, jsxs as jsxs178 } from "react/jsx-runtime";
|
|
8847
9618
|
function HeaderFooterLayout({
|
|
8848
9619
|
children,
|
|
8849
9620
|
header,
|
|
@@ -8852,17 +9623,17 @@ function HeaderFooterLayout({
|
|
|
8852
9623
|
footerHeight = 60,
|
|
8853
9624
|
className
|
|
8854
9625
|
}) {
|
|
8855
|
-
return /* @__PURE__ */
|
|
8856
|
-
header && /* @__PURE__ */
|
|
8857
|
-
/* @__PURE__ */
|
|
8858
|
-
footer && /* @__PURE__ */
|
|
9626
|
+
return /* @__PURE__ */ jsxs178("div", { className: [styles102.shell, className].filter(Boolean).join(" "), children: [
|
|
9627
|
+
header && /* @__PURE__ */ jsx236("div", { className: styles102.header, style: { height: headerHeight }, children: header }),
|
|
9628
|
+
/* @__PURE__ */ jsx236("div", { className: styles102.main, children }),
|
|
9629
|
+
footer && /* @__PURE__ */ jsx236("div", { className: styles102.footer, style: { height: footerHeight }, children: footer })
|
|
8859
9630
|
] });
|
|
8860
9631
|
}
|
|
8861
9632
|
|
|
8862
9633
|
// src/components/RootLayout/RootLayout.tsx
|
|
8863
9634
|
import { Children as Children5 } from "react";
|
|
8864
|
-
import
|
|
8865
|
-
import { Fragment as
|
|
9635
|
+
import styles103 from "./RootLayout.module.css";
|
|
9636
|
+
import { Fragment as Fragment23, jsx as jsx237, jsxs as jsxs179 } from "react/jsx-runtime";
|
|
8866
9637
|
var EXPECTED_CHILD_COUNT = {
|
|
8867
9638
|
plain: 1,
|
|
8868
9639
|
sidebar: 2,
|
|
@@ -8872,17 +9643,17 @@ var EXPECTED_CHILD_COUNT = {
|
|
|
8872
9643
|
function RootLayoutWeb({ variant, items, sidebarWidth, headerHeight }) {
|
|
8873
9644
|
if (variant === "sidebar") {
|
|
8874
9645
|
const [sidebar, main2] = items;
|
|
8875
|
-
return /* @__PURE__ */
|
|
9646
|
+
return /* @__PURE__ */ jsxs179(ThreeColumnLayout, { sidebarWidth, children: [
|
|
8876
9647
|
sidebar,
|
|
8877
9648
|
main2
|
|
8878
9649
|
] });
|
|
8879
9650
|
}
|
|
8880
9651
|
if (variant === "header") {
|
|
8881
9652
|
const [header, main2] = items;
|
|
8882
|
-
return /* @__PURE__ */
|
|
9653
|
+
return /* @__PURE__ */ jsx237(HeaderFooterLayout, { header, headerHeight, children: main2 });
|
|
8883
9654
|
}
|
|
8884
9655
|
const main = variant === "shell" ? items[1] : items[0];
|
|
8885
|
-
return /* @__PURE__ */
|
|
9656
|
+
return /* @__PURE__ */ jsx237(Fragment23, { children: main });
|
|
8886
9657
|
}
|
|
8887
9658
|
function RootLayoutMobile({
|
|
8888
9659
|
variant,
|
|
@@ -8892,11 +9663,11 @@ function RootLayoutMobile({
|
|
|
8892
9663
|
}) {
|
|
8893
9664
|
if (variant === "header") {
|
|
8894
9665
|
const [header, main2] = items;
|
|
8895
|
-
return /* @__PURE__ */
|
|
9666
|
+
return /* @__PURE__ */ jsx237(HeaderFooterLayout, { header, headerHeight: mobileHeaderHeight, children: main2 });
|
|
8896
9667
|
}
|
|
8897
9668
|
if (variant === "shell") {
|
|
8898
9669
|
const [header, main2, footer] = items;
|
|
8899
|
-
return /* @__PURE__ */
|
|
9670
|
+
return /* @__PURE__ */ jsx237(
|
|
8900
9671
|
HeaderFooterLayout,
|
|
8901
9672
|
{
|
|
8902
9673
|
header,
|
|
@@ -8908,7 +9679,7 @@ function RootLayoutMobile({
|
|
|
8908
9679
|
);
|
|
8909
9680
|
}
|
|
8910
9681
|
const main = variant === "sidebar" ? items[1] : items[0];
|
|
8911
|
-
return /* @__PURE__ */
|
|
9682
|
+
return /* @__PURE__ */ jsx237(Fragment23, { children: main });
|
|
8912
9683
|
}
|
|
8913
9684
|
function RootLayout({
|
|
8914
9685
|
variant = "plain",
|
|
@@ -8925,10 +9696,10 @@ function RootLayout({
|
|
|
8925
9696
|
`[RootLayout] variant="${variant}" expects ${EXPECTED_CHILD_COUNT[variant]} children; received ${items.length}.`
|
|
8926
9697
|
);
|
|
8927
9698
|
}
|
|
8928
|
-
return /* @__PURE__ */
|
|
9699
|
+
return /* @__PURE__ */ jsx237("div", { className: [styles103.root, className].filter(Boolean).join(" "), children: /* @__PURE__ */ jsx237(
|
|
8929
9700
|
ResponsiveSurface,
|
|
8930
9701
|
{
|
|
8931
|
-
web: /* @__PURE__ */
|
|
9702
|
+
web: /* @__PURE__ */ jsx237(
|
|
8932
9703
|
RootLayoutWeb,
|
|
8933
9704
|
{
|
|
8934
9705
|
variant,
|
|
@@ -8937,7 +9708,7 @@ function RootLayout({
|
|
|
8937
9708
|
headerHeight
|
|
8938
9709
|
}
|
|
8939
9710
|
),
|
|
8940
|
-
mobile: /* @__PURE__ */
|
|
9711
|
+
mobile: /* @__PURE__ */ jsx237(
|
|
8941
9712
|
RootLayoutMobile,
|
|
8942
9713
|
{
|
|
8943
9714
|
variant,
|
|
@@ -8951,25 +9722,25 @@ function RootLayout({
|
|
|
8951
9722
|
}
|
|
8952
9723
|
|
|
8953
9724
|
// src/components/PageLayout/PageLayout.tsx
|
|
8954
|
-
import
|
|
8955
|
-
import { jsx as
|
|
9725
|
+
import styles104 from "./PageLayout.module.css";
|
|
9726
|
+
import { jsx as jsx238, jsxs as jsxs180 } from "react/jsx-runtime";
|
|
8956
9727
|
var paddingClass3 = {
|
|
8957
|
-
none:
|
|
8958
|
-
sm:
|
|
8959
|
-
md:
|
|
8960
|
-
lg:
|
|
9728
|
+
none: styles104.padNone,
|
|
9729
|
+
sm: styles104.padSm,
|
|
9730
|
+
md: styles104.padMd,
|
|
9731
|
+
lg: styles104.padLg
|
|
8961
9732
|
};
|
|
8962
9733
|
function PageLayout({ header, padding = "none", children, className }) {
|
|
8963
|
-
return /* @__PURE__ */
|
|
8964
|
-
header && /* @__PURE__ */
|
|
8965
|
-
/* @__PURE__ */
|
|
9734
|
+
return /* @__PURE__ */ jsxs180("div", { className: [styles104.root, className].filter(Boolean).join(" "), children: [
|
|
9735
|
+
header && /* @__PURE__ */ jsx238("div", { className: styles104.header, children: header }),
|
|
9736
|
+
/* @__PURE__ */ jsx238("div", { className: [styles104.content, paddingClass3[padding]].join(" "), children })
|
|
8966
9737
|
] });
|
|
8967
9738
|
}
|
|
8968
9739
|
|
|
8969
9740
|
// src/components/NavList/NavList.tsx
|
|
8970
|
-
import { Fragment as
|
|
8971
|
-
import
|
|
8972
|
-
import { Fragment as
|
|
9741
|
+
import { Fragment as Fragment24 } from "react";
|
|
9742
|
+
import styles105 from "./NavList.module.css";
|
|
9743
|
+
import { Fragment as Fragment25, jsx as jsx239, jsxs as jsxs181 } from "react/jsx-runtime";
|
|
8973
9744
|
function NavList({
|
|
8974
9745
|
groups,
|
|
8975
9746
|
variant,
|
|
@@ -8978,28 +9749,28 @@ function NavList({
|
|
|
8978
9749
|
className,
|
|
8979
9750
|
renderLink
|
|
8980
9751
|
}) {
|
|
8981
|
-
return /* @__PURE__ */
|
|
9752
|
+
return /* @__PURE__ */ jsx239(
|
|
8982
9753
|
"nav",
|
|
8983
9754
|
{
|
|
8984
|
-
className: [
|
|
9755
|
+
className: [styles105.nav, styles105[variant], density === "compact" && styles105.compact, className].filter(Boolean).join(" "),
|
|
8985
9756
|
"aria-label": ariaLabel,
|
|
8986
|
-
children: groups.map((group) => /* @__PURE__ */
|
|
8987
|
-
group.label && /* @__PURE__ */
|
|
9757
|
+
children: groups.map((group) => /* @__PURE__ */ jsxs181("div", { className: styles105.group, children: [
|
|
9758
|
+
group.label && /* @__PURE__ */ jsx239("div", { className: styles105.groupLabel, children: group.label }),
|
|
8988
9759
|
group.items.map((item) => {
|
|
8989
9760
|
const isActive = variant === "static" && !!item.active;
|
|
8990
|
-
const rowContent = /* @__PURE__ */
|
|
8991
|
-
/* @__PURE__ */
|
|
8992
|
-
/* @__PURE__ */
|
|
8993
|
-
item.badge && /* @__PURE__ */
|
|
8994
|
-
variant === "drilldown" && /* @__PURE__ */
|
|
9761
|
+
const rowContent = /* @__PURE__ */ jsxs181(Fragment25, { children: [
|
|
9762
|
+
/* @__PURE__ */ jsx239(Icon, { name: item.icon, size: "sm", "aria-hidden": true, className: styles105.icon }),
|
|
9763
|
+
/* @__PURE__ */ jsx239("span", { className: styles105.label, children: item.label }),
|
|
9764
|
+
item.badge && /* @__PURE__ */ jsx239("span", { className: styles105.badge, children: item.badge }),
|
|
9765
|
+
variant === "drilldown" && /* @__PURE__ */ jsx239(Icon, { name: "chevron-right", size: "sm", "aria-hidden": true, className: styles105.chevron })
|
|
8995
9766
|
] });
|
|
8996
9767
|
const linkProps = {
|
|
8997
9768
|
href: item.href,
|
|
8998
|
-
className: [
|
|
9769
|
+
className: [styles105.row, isActive && styles105.rowActive].filter(Boolean).join(" "),
|
|
8999
9770
|
"aria-current": isActive ? "page" : void 0,
|
|
9000
9771
|
children: rowContent
|
|
9001
9772
|
};
|
|
9002
|
-
return /* @__PURE__ */
|
|
9773
|
+
return /* @__PURE__ */ jsx239(Fragment24, { children: renderLink ? renderLink(item, linkProps) : /* @__PURE__ */ jsx239(
|
|
9003
9774
|
"a",
|
|
9004
9775
|
{
|
|
9005
9776
|
href: linkProps.href,
|
|
@@ -9057,8 +9828,8 @@ var THEME_PRESETS = {
|
|
|
9057
9828
|
};
|
|
9058
9829
|
|
|
9059
9830
|
// src/components/CopyButton/CopyButton.tsx
|
|
9060
|
-
import { useState as
|
|
9061
|
-
import { jsx as
|
|
9831
|
+
import { useState as useState35 } from "react";
|
|
9832
|
+
import { jsx as jsx240 } from "react/jsx-runtime";
|
|
9062
9833
|
function CopyButton({
|
|
9063
9834
|
text,
|
|
9064
9835
|
label,
|
|
@@ -9067,7 +9838,7 @@ function CopyButton({
|
|
|
9067
9838
|
variant = "secondary",
|
|
9068
9839
|
size = "sm"
|
|
9069
9840
|
}) {
|
|
9070
|
-
const [state, setState] =
|
|
9841
|
+
const [state, setState] = useState35("idle");
|
|
9071
9842
|
async function copy() {
|
|
9072
9843
|
try {
|
|
9073
9844
|
await navigator.clipboard.writeText(text);
|
|
@@ -9076,12 +9847,12 @@ function CopyButton({
|
|
|
9076
9847
|
setState("failed");
|
|
9077
9848
|
}
|
|
9078
9849
|
}
|
|
9079
|
-
return /* @__PURE__ */
|
|
9850
|
+
return /* @__PURE__ */ jsx240(Button, { type: "button", variant, size, onClick: () => void copy(), children: state === "copied" ? copiedLabel : state === "failed" ? failedLabel : label });
|
|
9080
9851
|
}
|
|
9081
9852
|
|
|
9082
9853
|
// src/components/QrCode/QrCode.tsx
|
|
9083
|
-
import
|
|
9084
|
-
import { jsx as
|
|
9854
|
+
import styles106 from "./QrCode.module.css";
|
|
9855
|
+
import { jsx as jsx241 } from "react/jsx-runtime";
|
|
9085
9856
|
var QUIET_ZONE = 2;
|
|
9086
9857
|
function QrCode({ modules, label }) {
|
|
9087
9858
|
const size = modules.length + QUIET_ZONE * 2;
|
|
@@ -9091,7 +9862,7 @@ function QrCode({ modules, label }) {
|
|
|
9091
9862
|
if (dark) path += `M${x + QUIET_ZONE} ${y + QUIET_ZONE}h1v1h-1z`;
|
|
9092
9863
|
});
|
|
9093
9864
|
});
|
|
9094
|
-
return /* @__PURE__ */
|
|
9865
|
+
return /* @__PURE__ */ jsx241("div", { className: styles106.qr, children: /* @__PURE__ */ jsx241(
|
|
9095
9866
|
"svg",
|
|
9096
9867
|
{
|
|
9097
9868
|
viewBox: `0 0 ${size} ${size}`,
|
|
@@ -9099,13 +9870,14 @@ function QrCode({ modules, label }) {
|
|
|
9099
9870
|
"aria-label": label,
|
|
9100
9871
|
shapeRendering: "crispEdges",
|
|
9101
9872
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9102
|
-
children: /* @__PURE__ */
|
|
9873
|
+
children: /* @__PURE__ */ jsx241("path", { d: path })
|
|
9103
9874
|
}
|
|
9104
9875
|
) });
|
|
9105
9876
|
}
|
|
9106
9877
|
export {
|
|
9107
9878
|
Accordion,
|
|
9108
9879
|
Alert,
|
|
9880
|
+
AppTile,
|
|
9109
9881
|
AppsLauncher,
|
|
9110
9882
|
AspectRatio,
|
|
9111
9883
|
AuthButton,
|
|
@@ -9121,6 +9893,7 @@ export {
|
|
|
9121
9893
|
AuthNotice,
|
|
9122
9894
|
AuthShell,
|
|
9123
9895
|
Avatar,
|
|
9896
|
+
AvatarStack,
|
|
9124
9897
|
Badge,
|
|
9125
9898
|
BalanceChip,
|
|
9126
9899
|
BrandBadge,
|
|
@@ -9146,6 +9919,7 @@ export {
|
|
|
9146
9919
|
CurrencyInput,
|
|
9147
9920
|
DataTable,
|
|
9148
9921
|
DatePicker,
|
|
9922
|
+
DateRangePicker,
|
|
9149
9923
|
DeviceOnlyGate,
|
|
9150
9924
|
DeviceStorageKeyGate,
|
|
9151
9925
|
Dialog,
|
|
@@ -9153,6 +9927,7 @@ export {
|
|
|
9153
9927
|
Drawer,
|
|
9154
9928
|
EmptyState,
|
|
9155
9929
|
FileDropzone,
|
|
9930
|
+
FloatingActionButton,
|
|
9156
9931
|
FormField,
|
|
9157
9932
|
GripIcon,
|
|
9158
9933
|
Header,
|
|
@@ -9188,11 +9963,15 @@ export {
|
|
|
9188
9963
|
PageHeader,
|
|
9189
9964
|
PageLayout,
|
|
9190
9965
|
Pagination,
|
|
9966
|
+
PhotoGallery,
|
|
9967
|
+
PhotoGrid,
|
|
9968
|
+
PhotoViewer,
|
|
9191
9969
|
Popover,
|
|
9192
9970
|
Progress,
|
|
9193
9971
|
QrCode,
|
|
9194
9972
|
QuantityStepper,
|
|
9195
9973
|
RadioGroup,
|
|
9974
|
+
RangeCalendar,
|
|
9196
9975
|
ResizableHandle,
|
|
9197
9976
|
ResizablePanel,
|
|
9198
9977
|
ResizablePanelGroup,
|