@spacesync/client 0.1.5 → 0.1.7
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 +26 -10
- package/dist/analog-clock-picker.js +2 -2
- package/dist/booking-schedule-calendars.js +2 -2
- package/dist/chat-stick-to-bottom.js +1 -1
- package/dist/{chunk-FVKJSPW4.js → chunk-34332W2P.js} +3 -3
- package/dist/{chunk-FVKJSPW4.js.map → chunk-34332W2P.js.map} +1 -1
- package/dist/{chunk-3DI67RMP.js → chunk-H3CNZCYU.js} +6 -2
- package/dist/{chunk-3DI67RMP.js.map → chunk-H3CNZCYU.js.map} +1 -1
- package/dist/file-viewer-dialog.js +36 -17
- package/dist/file-viewer-dialog.js.map +1 -1
- package/dist/floor-switcher.d.ts +2 -1
- package/dist/floor-switcher.js +19 -6
- package/dist/floor-switcher.js.map +1 -1
- package/dist/layout-canvas-view.js +1 -1
- package/dist/platform-support-message-composer.js +1 -1
- package/dist/ui.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ResponsiveDialog, ResponsiveDialogContent, ResponsiveDialogTitle } from './chunk-
|
|
1
|
+
import { ResponsiveDialog, ResponsiveDialogContent, ResponsiveDialogTitle } from './chunk-H3CNZCYU.js';
|
|
2
2
|
import './chunk-RV5PMZYZ.js';
|
|
3
3
|
import './chunk-L65F4EMK.js';
|
|
4
4
|
import './chunk-PBNBLCC2.js';
|
|
@@ -9,9 +9,9 @@ import './chunk-LUB7QWGU.js';
|
|
|
9
9
|
import { Button } from './chunk-VHINHHZQ.js';
|
|
10
10
|
import './chunk-FCY5FYJB.js';
|
|
11
11
|
import './chunk-OWNUMPUC.js';
|
|
12
|
-
import './chunk-DMPSQ22Q.js';
|
|
12
|
+
import { cn } from './chunk-DMPSQ22Q.js';
|
|
13
13
|
import { useState, useRef, useEffect, useMemo } from 'react';
|
|
14
|
-
import { Minus, Plus, RotateCcw, Download, ExternalLink, FileText } from 'lucide-react';
|
|
14
|
+
import { Minus, Plus, RotateCcw, Download, ExternalLink, Loader2, FileText } from 'lucide-react';
|
|
15
15
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
16
16
|
|
|
17
17
|
function FileViewerDialog({
|
|
@@ -21,10 +21,12 @@ function FileViewerDialog({
|
|
|
21
21
|
}) {
|
|
22
22
|
const [zoom, setZoom] = useState(1);
|
|
23
23
|
const [dragging, setDragging] = useState(false);
|
|
24
|
+
const [imageStatus, setImageStatus] = useState("loading");
|
|
24
25
|
const scrollRef = useRef(null);
|
|
25
26
|
const dragStateRef = useRef(null);
|
|
26
27
|
useEffect(() => {
|
|
27
28
|
if (open) setZoom(1);
|
|
29
|
+
setImageStatus("loading");
|
|
28
30
|
}, [open, file?.url]);
|
|
29
31
|
const kind = useMemo(() => {
|
|
30
32
|
if (!file) return "other";
|
|
@@ -146,21 +148,38 @@ function FileViewerDialog({
|
|
|
146
148
|
onPointerMove: handleImagePointerMove,
|
|
147
149
|
onPointerUp: handleImagePointerEnd,
|
|
148
150
|
onPointerCancel: handleImagePointerEnd,
|
|
149
|
-
children: /* @__PURE__ */
|
|
150
|
-
"
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
maxWidth: "none",
|
|
159
|
-
cursor: isDraggable ? dragging ? "grabbing" : "grab" : "default",
|
|
160
|
-
touchAction: isDraggable ? "none" : "auto"
|
|
151
|
+
children: /* @__PURE__ */ jsxs("div", { className: "relative flex min-h-[240px] w-full items-center justify-center", children: [
|
|
152
|
+
imageStatus !== "ready" ? /* @__PURE__ */ jsx(
|
|
153
|
+
"div",
|
|
154
|
+
{
|
|
155
|
+
className: "absolute inset-0 z-10 flex items-center justify-center",
|
|
156
|
+
role: "status",
|
|
157
|
+
"aria-live": "polite",
|
|
158
|
+
"aria-label": imageStatus === "error" ? "Couldn't load image" : "Loading image",
|
|
159
|
+
children: imageStatus === "error" ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Couldn't load image" }) : /* @__PURE__ */ jsx(Loader2, { size: 28, className: "animate-spin text-muted-foreground" })
|
|
161
160
|
}
|
|
162
|
-
|
|
163
|
-
|
|
161
|
+
) : null,
|
|
162
|
+
/* @__PURE__ */ jsx(
|
|
163
|
+
"img",
|
|
164
|
+
{
|
|
165
|
+
src: file.url,
|
|
166
|
+
alt: file.name,
|
|
167
|
+
className: cn(
|
|
168
|
+
"block shrink-0 select-none rounded-lg border border-border bg-card shadow-sm",
|
|
169
|
+
imageStatus !== "ready" && "opacity-0"
|
|
170
|
+
),
|
|
171
|
+
draggable: false,
|
|
172
|
+
onLoad: () => setImageStatus("ready"),
|
|
173
|
+
onError: () => setImageStatus("error"),
|
|
174
|
+
style: {
|
|
175
|
+
width: `${zoom * 100}%`,
|
|
176
|
+
maxWidth: "none",
|
|
177
|
+
cursor: isDraggable ? dragging ? "grabbing" : "grab" : "default",
|
|
178
|
+
touchAction: isDraggable ? "none" : "auto"
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
)
|
|
182
|
+
] })
|
|
164
183
|
}
|
|
165
184
|
) }) : kind === "pdf" ? /* @__PURE__ */ jsx("object", { data: file.url, type: "application/pdf", className: "h-full w-full", children: /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col items-center justify-center gap-3 p-6 text-center", children: [
|
|
166
185
|
/* @__PURE__ */ jsx(FileText, { size: 34, className: "text-muted-foreground" }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/files/file-viewer-dialog.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAgBO,SAAS,gBAAA,CAAiB;AAAA,EAC/B,IAAA;AAAA,EACA,IAAA;AAAA,EACA;AACF,CAAA,EAIG;AACD,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAS,CAAC,CAAA;AAClC,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW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AAAA,cACpB,QAAA,EAAU,MAAA;AAAA,cACV,MAAA,EAAQ,WAAA,GAAe,QAAA,GAAW,UAAA,GAAa,MAAA,GAAU,SAAA;AAAA,cACzD,WAAA,EAAa,cAAc,MAAA,GAAS;AAAA;AACtC;AAAA;AACF;AAAA,OAEJ,CAAA,GACE,IAAA,KAAS,KAAA,mBACX,GAAA,CAAC,YAAO,IAAA,EAAM,IAAA,CAAK,GAAA,EAAK,IAAA,EAAK,mBAAkB,SAAA,EAAU,eAAA,EACvD,QAAA,kBAAA,IAAA,CAAC,KAAA,EAAA,EAAI,WAAU,wEAAA,EACb,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,QAAA,EAAA,EAAS,IAAA,EAAM,EAAA,EAAI,SAAA,EAAU,uBAAA,EAAwB,CAAA;AAAA,sBACtD,GAAA,CAAC,GAAA,EAAA,EAAE,SAAA,EAAU,wCAAA,EAAyC,QAAA,EAAA,6FAAA,EAEtD;AAAA,KAAA,EACF,CAAA,EACF,CAAA,mBAEA,IAAA,CAAC,KAAA,EAAA,EAAI,WAAU,wEAAA,EACb,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,QAAA,EAAA,EAAS,IAAA,EAAM,EAAA,EAAI,SAAA,EAAU,uBAAA,EAAwB,CAAA;AAAA,sBACtD,GAAA,CAAC,GAAA,EAAA,EAAE,SAAA,EAAU,wCAAA,EAAyC,QAAA,EAAA,gFAAA,EAEtD;AAAA,KAAA,EACF,CAAA,EAEJ;AAAA,GAAA,EACF,CAAA,EACF,CAAA;AAEJ","file":"file-viewer-dialog.js","sourcesContent":["import { useEffect, useMemo, useRef, useState } from \"react\";\nimport { Download, ExternalLink, FileText, Minus, Plus, RotateCcw } from \"lucide-react\";\nimport {\n Button,\n ResponsiveDialog,\n ResponsiveDialogContent,\n ResponsiveDialogTitle,\n} from \"../ui\";\n\nexport interface FileViewerFile {\n name: string;\n mimeType: string;\n sizeLabel?: string;\n url: string;\n}\n\nexport function FileViewerDialog({\n file,\n open,\n onOpenChange,\n}: {\n file: FileViewerFile | null;\n open: boolean;\n onOpenChange: (open: boolean) => void;\n}) {\n const [zoom, setZoom] = useState(1);\n const [dragging, setDragging] = useState(false);\n const scrollRef = useRef<HTMLDivElement | null>(null);\n const dragStateRef = useRef<{\n pointerId: number;\n startX: number;\n startY: number;\n scrollLeft: number;\n scrollTop: number;\n } | null>(null);\n\n useEffect(() => {\n if (open) setZoom(1);\n }, [open, file?.url]);\n\n const kind = useMemo(() => {\n if (!file) return \"other\";\n if (file.mimeType.startsWith(\"image/\")) return \"image\";\n if (file.mimeType === \"application/pdf\" || file.name.toLowerCase().endsWith(\".pdf\")) return \"pdf\";\n return \"other\";\n }, [file]);\n\n const zoomPercent = Math.round(zoom * 100);\n const isDraggable = kind === \"image\" && zoom > 1;\n\n const handleImagePointerDown = (event: React.PointerEvent<HTMLDivElement>) => {\n if (!isDraggable || !scrollRef.current) return;\n event.preventDefault();\n dragStateRef.current = {\n pointerId: event.pointerId,\n startX: event.clientX,\n startY: event.clientY,\n scrollLeft: scrollRef.current.scrollLeft,\n scrollTop: scrollRef.current.scrollTop,\n };\n setDragging(true);\n event.currentTarget.setPointerCapture(event.pointerId);\n };\n\n const handleImagePointerMove = (event: React.PointerEvent<HTMLDivElement>) => {\n const state = dragStateRef.current;\n if (!state || state.pointerId !== event.pointerId || !scrollRef.current) return;\n scrollRef.current.scrollLeft = state.scrollLeft - (event.clientX - state.startX);\n scrollRef.current.scrollTop = state.scrollTop - (event.clientY - state.startY);\n };\n\n const handleImagePointerEnd = (event: React.PointerEvent<HTMLDivElement>) => {\n const state = dragStateRef.current;\n if (!state || state.pointerId !== event.pointerId) return;\n dragStateRef.current = null;\n setDragging(false);\n if (event.currentTarget.hasPointerCapture(event.pointerId)) {\n event.currentTarget.releasePointerCapture(event.pointerId);\n }\n };\n\n return (\n <ResponsiveDialog open={open} onOpenChange={onOpenChange}>\n <ResponsiveDialogContent className=\"flex h-[min(88vh,900px)] w-[min(96vw,1100px)] max-w-none flex-col gap-0 overflow-hidden rounded-xl border-border bg-card p-0\">\n <div className=\"flex shrink-0 flex-col gap-3 border-b border-border py-3 pl-4 pr-14 lg:flex-row lg:items-center lg:justify-between\">\n <div className=\"min-w-0 flex-1\">\n <ResponsiveDialogTitle className=\"truncate text-base font-semibold text-foreground\">\n {file?.name ?? \"File preview\"}\n </ResponsiveDialogTitle>\n {file?.sizeLabel ? (\n <p className=\"mt-1 text-xs text-muted-foreground\">{file.sizeLabel}</p>\n ) : null}\n </div>\n {file ? (\n <div className=\"flex shrink-0 flex-wrap items-center gap-1.5 lg:justify-end\">\n {kind === \"image\" ? (\n <div className=\"flex items-center gap-0.5 rounded-lg border border-border bg-background p-0.5\">\n <button\n type=\"button\"\n className=\"inline-flex size-8 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground disabled:opacity-40\"\n onClick={() => setZoom((value) => Math.max(0.25, Number((value - 0.25).toFixed(2))))}\n disabled={zoom <= 0.25}\n aria-label=\"Zoom out\"\n >\n <Minus size={14} />\n </button>\n <span className=\"min-w-11 text-center text-xs font-medium tabular-nums text-muted-foreground\">\n {zoomPercent}%\n </span>\n <button\n type=\"button\"\n className=\"inline-flex size-8 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground disabled:opacity-40\"\n onClick={() => setZoom((value) => Math.min(4, Number((value + 0.25).toFixed(2))))}\n disabled={zoom >= 4}\n aria-label=\"Zoom in\"\n >\n <Plus size={14} />\n </button>\n <button\n type=\"button\"\n className=\"inline-flex size-8 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground\"\n onClick={() => setZoom(1)}\n aria-label=\"Reset zoom\"\n >\n <RotateCcw size={14} />\n </button>\n </div>\n ) : null}\n <Button\n asChild\n variant=\"ghost\"\n size=\"icon\"\n className=\"size-9\"\n title=\"Download\"\n >\n <a href={file.url} download={file.name}>\n <Download size={14} />\n <span className=\"sr-only\">Download</span>\n </a>\n </Button>\n <Button\n asChild\n variant=\"ghost\"\n size=\"icon\"\n className=\"size-9\"\n title=\"Open in new tab\"\n >\n <a href={file.url} target=\"_blank\" rel=\"noreferrer\">\n <ExternalLink size={14} />\n <span className=\"sr-only\">Open in new tab</span>\n </a>\n </Button>\n </div>\n ) : null}\n </div>\n <div className=\"min-h-0 flex-1 overflow-hidden bg-muted/60\">\n {!file ? (\n <div className=\"flex h-full items-center justify-center text-sm text-muted-foreground\">\n No file selected.\n </div>\n ) : kind === \"image\" ? (\n <div ref={scrollRef} className=\"h-full overflow-auto p-4\">\n <div\n className=\"flex min-h-full items-center justify-center\"\n style={{ minWidth: `${zoom * 100}%` }}\n onPointerDown={handleImagePointerDown}\n onPointerMove={handleImagePointerMove}\n onPointerUp={handleImagePointerEnd}\n onPointerCancel={handleImagePointerEnd}\n >\n <img\n src={file.url}\n alt={file.name}\n className=\"block shrink-0 select-none rounded-lg border border-border bg-card shadow-sm\"\n draggable={false}\n style={{\n width: `${zoom * 100}%`,\n maxWidth: \"none\",\n cursor: isDraggable ? (dragging ? \"grabbing\" : \"grab\") : \"default\",\n touchAction: isDraggable ? \"none\" : \"auto\",\n }}\n />\n </div>\n </div>\n ) : kind === \"pdf\" ? (\n <object data={file.url} type=\"application/pdf\" className=\"h-full w-full\">\n <div className=\"flex h-full flex-col items-center justify-center gap-3 p-6 text-center\">\n <FileText size={34} className=\"text-muted-foreground\" />\n <p className=\"max-w-md text-sm text-muted-foreground\">\n This browser cannot preview the PDF inline. You can still download or open it in a new tab.\n </p>\n </div>\n </object>\n ) : (\n <div className=\"flex h-full flex-col items-center justify-center gap-3 p-6 text-center\">\n <FileText size={34} className=\"text-muted-foreground\" />\n <p className=\"max-w-md text-sm text-muted-foreground\">\n Preview is not available for this file type. Download or open it in a new tab.\n </p>\n </div>\n )}\n </div>\n </ResponsiveDialogContent>\n </ResponsiveDialog>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/files/file-viewer-dialog.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAi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EACF;AAAA;AAAA,OAEJ,CAAA,GACE,IAAA,KAAS,KAAA,mBACX,GAAA,CAAC,YAAO,IAAA,EAAM,IAAA,CAAK,GAAA,EAAK,IAAA,EAAK,mBAAkB,SAAA,EAAU,eAAA,EACvD,QAAA,kBAAA,IAAA,CAAC,KAAA,EAAA,EAAI,WAAU,wEAAA,EACb,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,QAAA,EAAA,EAAS,IAAA,EAAM,EAAA,EAAI,SAAA,EAAU,uBAAA,EAAwB,CAAA;AAAA,sBACtD,GAAA,CAAC,GAAA,EAAA,EAAE,SAAA,EAAU,wCAAA,EAAyC,QAAA,EAAA,6FAAA,EAEtD;AAAA,KAAA,EACF,CAAA,EACF,CAAA,mBAEA,IAAA,CAAC,KAAA,EAAA,EAAI,WAAU,wEAAA,EACb,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,QAAA,EAAA,EAAS,IAAA,EAAM,EAAA,EAAI,SAAA,EAAU,uBAAA,EAAwB,CAAA;AAAA,sBACtD,GAAA,CAAC,GAAA,EAAA,EAAE,SAAA,EAAU,wCAAA,EAAyC,QAAA,EAAA,gFAAA,EAEtD;AAAA,KAAA,EACF,CAAA,EAEJ;AAAA,GAAA,EACF,CAAA,EACF,CAAA;AAEJ","file":"file-viewer-dialog.js","sourcesContent":["import { useEffect, useMemo, useRef, useState } from \"react\";\nimport { Download, ExternalLink, FileText, Loader2, Minus, Plus, RotateCcw } from \"lucide-react\";\nimport {\n Button,\n ResponsiveDialog,\n ResponsiveDialogContent,\n ResponsiveDialogTitle,\n cn,\n} from \"../ui\";\n\nexport interface FileViewerFile {\n name: string;\n mimeType: string;\n sizeLabel?: string;\n url: string;\n}\n\nexport function FileViewerDialog({\n file,\n open,\n onOpenChange,\n}: {\n file: FileViewerFile | null;\n open: boolean;\n onOpenChange: (open: boolean) => void;\n}) {\n const [zoom, setZoom] = useState(1);\n const [dragging, setDragging] = useState(false);\n const [imageStatus, setImageStatus] = useState<\"loading\" | \"ready\" | \"error\">(\"loading\");\n const scrollRef = useRef<HTMLDivElement | null>(null);\n const dragStateRef = useRef<{\n pointerId: number;\n startX: number;\n startY: number;\n scrollLeft: number;\n scrollTop: number;\n } | null>(null);\n\n useEffect(() => {\n if (open) setZoom(1);\n setImageStatus(\"loading\");\n }, [open, file?.url]);\n\n const kind = useMemo(() => {\n if (!file) return \"other\";\n if (file.mimeType.startsWith(\"image/\")) return \"image\";\n if (file.mimeType === \"application/pdf\" || file.name.toLowerCase().endsWith(\".pdf\")) return \"pdf\";\n return \"other\";\n }, [file]);\n\n const zoomPercent = Math.round(zoom * 100);\n const isDraggable = kind === \"image\" && zoom > 1;\n\n const handleImagePointerDown = (event: React.PointerEvent<HTMLDivElement>) => {\n if (!isDraggable || !scrollRef.current) return;\n event.preventDefault();\n dragStateRef.current = {\n pointerId: event.pointerId,\n startX: event.clientX,\n startY: event.clientY,\n scrollLeft: scrollRef.current.scrollLeft,\n scrollTop: scrollRef.current.scrollTop,\n };\n setDragging(true);\n event.currentTarget.setPointerCapture(event.pointerId);\n };\n\n const handleImagePointerMove = (event: React.PointerEvent<HTMLDivElement>) => {\n const state = dragStateRef.current;\n if (!state || state.pointerId !== event.pointerId || !scrollRef.current) return;\n scrollRef.current.scrollLeft = state.scrollLeft - (event.clientX - state.startX);\n scrollRef.current.scrollTop = state.scrollTop - (event.clientY - state.startY);\n };\n\n const handleImagePointerEnd = (event: React.PointerEvent<HTMLDivElement>) => {\n const state = dragStateRef.current;\n if (!state || state.pointerId !== event.pointerId) return;\n dragStateRef.current = null;\n setDragging(false);\n if (event.currentTarget.hasPointerCapture(event.pointerId)) {\n event.currentTarget.releasePointerCapture(event.pointerId);\n }\n };\n\n return (\n <ResponsiveDialog open={open} onOpenChange={onOpenChange}>\n <ResponsiveDialogContent className=\"flex h-[min(88vh,900px)] w-[min(96vw,1100px)] max-w-none flex-col gap-0 overflow-hidden rounded-xl border-border bg-card p-0\">\n <div className=\"flex shrink-0 flex-col gap-3 border-b border-border py-3 pl-4 pr-14 lg:flex-row lg:items-center lg:justify-between\">\n <div className=\"min-w-0 flex-1\">\n <ResponsiveDialogTitle className=\"truncate text-base font-semibold text-foreground\">\n {file?.name ?? \"File preview\"}\n </ResponsiveDialogTitle>\n {file?.sizeLabel ? (\n <p className=\"mt-1 text-xs text-muted-foreground\">{file.sizeLabel}</p>\n ) : null}\n </div>\n {file ? (\n <div className=\"flex shrink-0 flex-wrap items-center gap-1.5 lg:justify-end\">\n {kind === \"image\" ? (\n <div className=\"flex items-center gap-0.5 rounded-lg border border-border bg-background p-0.5\">\n <button\n type=\"button\"\n className=\"inline-flex size-8 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground disabled:opacity-40\"\n onClick={() => setZoom((value) => Math.max(0.25, Number((value - 0.25).toFixed(2))))}\n disabled={zoom <= 0.25}\n aria-label=\"Zoom out\"\n >\n <Minus size={14} />\n </button>\n <span className=\"min-w-11 text-center text-xs font-medium tabular-nums text-muted-foreground\">\n {zoomPercent}%\n </span>\n <button\n type=\"button\"\n className=\"inline-flex size-8 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground disabled:opacity-40\"\n onClick={() => setZoom((value) => Math.min(4, Number((value + 0.25).toFixed(2))))}\n disabled={zoom >= 4}\n aria-label=\"Zoom in\"\n >\n <Plus size={14} />\n </button>\n <button\n type=\"button\"\n className=\"inline-flex size-8 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground\"\n onClick={() => setZoom(1)}\n aria-label=\"Reset zoom\"\n >\n <RotateCcw size={14} />\n </button>\n </div>\n ) : null}\n <Button\n asChild\n variant=\"ghost\"\n size=\"icon\"\n className=\"size-9\"\n title=\"Download\"\n >\n <a href={file.url} download={file.name}>\n <Download size={14} />\n <span className=\"sr-only\">Download</span>\n </a>\n </Button>\n <Button\n asChild\n variant=\"ghost\"\n size=\"icon\"\n className=\"size-9\"\n title=\"Open in new tab\"\n >\n <a href={file.url} target=\"_blank\" rel=\"noreferrer\">\n <ExternalLink size={14} />\n <span className=\"sr-only\">Open in new tab</span>\n </a>\n </Button>\n </div>\n ) : null}\n </div>\n <div className=\"min-h-0 flex-1 overflow-hidden bg-muted/60\">\n {!file ? (\n <div className=\"flex h-full items-center justify-center text-sm text-muted-foreground\">\n No file selected.\n </div>\n ) : kind === \"image\" ? (\n <div ref={scrollRef} className=\"h-full overflow-auto p-4\">\n <div\n className=\"flex min-h-full items-center justify-center\"\n style={{ minWidth: `${zoom * 100}%` }}\n onPointerDown={handleImagePointerDown}\n onPointerMove={handleImagePointerMove}\n onPointerUp={handleImagePointerEnd}\n onPointerCancel={handleImagePointerEnd}\n >\n <div className=\"relative flex min-h-[240px] w-full items-center justify-center\">\n {imageStatus !== \"ready\" ? (\n <div\n className=\"absolute inset-0 z-10 flex items-center justify-center\"\n role=\"status\"\n aria-live=\"polite\"\n aria-label={imageStatus === \"error\" ? \"Couldn't load image\" : \"Loading image\"}\n >\n {imageStatus === \"error\" ? (\n <p className=\"text-sm text-muted-foreground\">Couldn't load image</p>\n ) : (\n <Loader2 size={28} className=\"animate-spin text-muted-foreground\" />\n )}\n </div>\n ) : null}\n <img\n src={file.url}\n alt={file.name}\n className={cn(\n \"block shrink-0 select-none rounded-lg border border-border bg-card shadow-sm\",\n imageStatus !== \"ready\" && \"opacity-0\",\n )}\n draggable={false}\n onLoad={() => setImageStatus(\"ready\")}\n onError={() => setImageStatus(\"error\")}\n style={{\n width: `${zoom * 100}%`,\n maxWidth: \"none\",\n cursor: isDraggable ? (dragging ? \"grabbing\" : \"grab\") : \"default\",\n touchAction: isDraggable ? \"none\" : \"auto\",\n }}\n />\n </div>\n </div>\n </div>\n ) : kind === \"pdf\" ? (\n <object data={file.url} type=\"application/pdf\" className=\"h-full w-full\">\n <div className=\"flex h-full flex-col items-center justify-center gap-3 p-6 text-center\">\n <FileText size={34} className=\"text-muted-foreground\" />\n <p className=\"max-w-md text-sm text-muted-foreground\">\n This browser cannot preview the PDF inline. You can still download or open it in a new tab.\n </p>\n </div>\n </object>\n ) : (\n <div className=\"flex h-full flex-col items-center justify-center gap-3 p-6 text-center\">\n <FileText size={34} className=\"text-muted-foreground\" />\n <p className=\"max-w-md text-sm text-muted-foreground\">\n Preview is not available for this file type. Download or open it in a new tab.\n </p>\n </div>\n )}\n </div>\n </ResponsiveDialogContent>\n </ResponsiveDialog>\n );\n}\n"]}
|
package/dist/floor-switcher.d.ts
CHANGED
|
@@ -4,11 +4,12 @@ interface FloorSwitcherFloor {
|
|
|
4
4
|
id: string;
|
|
5
5
|
name: string;
|
|
6
6
|
}
|
|
7
|
-
declare function FloorSwitcher({ floors, activeFloorId, onFloorChange, onAddFloor, }: {
|
|
7
|
+
declare function FloorSwitcher({ floors, activeFloorId, onFloorChange, onAddFloor, onDeleteFloor, }: {
|
|
8
8
|
floors: FloorSwitcherFloor[];
|
|
9
9
|
activeFloorId: string;
|
|
10
10
|
onFloorChange: (floorId: string) => void;
|
|
11
11
|
onAddFloor?: (name: string) => void;
|
|
12
|
+
onDeleteFloor?: (floorId: string) => void;
|
|
12
13
|
}): React.JSX.Element;
|
|
13
14
|
|
|
14
15
|
export { FloorSwitcher, type FloorSwitcherFloor };
|
package/dist/floor-switcher.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator } from './chunk-
|
|
1
|
+
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator } from './chunk-H3CNZCYU.js';
|
|
2
2
|
import { Label } from './chunk-RV5PMZYZ.js';
|
|
3
3
|
import './chunk-L65F4EMK.js';
|
|
4
4
|
import './chunk-PBNBLCC2.js';
|
|
@@ -10,7 +10,7 @@ import { Button } from './chunk-VHINHHZQ.js';
|
|
|
10
10
|
import { shellTopBarMutedIconClass, shellTopBarSecondaryButtonClass } from './chunk-FCY5FYJB.js';
|
|
11
11
|
import './chunk-OWNUMPUC.js';
|
|
12
12
|
import { cn } from './chunk-DMPSQ22Q.js';
|
|
13
|
-
import { Layers, ChevronDown, Check, Plus } from 'lucide-react';
|
|
13
|
+
import { Layers, ChevronDown, Check, Plus, Trash2 } from 'lucide-react';
|
|
14
14
|
import { useState, useEffect } from 'react';
|
|
15
15
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
16
16
|
|
|
@@ -18,11 +18,13 @@ function FloorSwitcher({
|
|
|
18
18
|
floors,
|
|
19
19
|
activeFloorId,
|
|
20
20
|
onFloorChange,
|
|
21
|
-
onAddFloor
|
|
21
|
+
onAddFloor,
|
|
22
|
+
onDeleteFloor
|
|
22
23
|
}) {
|
|
23
24
|
const activeFloor = floors.find((f) => f.id === activeFloorId) ?? floors[0];
|
|
24
25
|
const [addOpen, setAddOpen] = useState(false);
|
|
25
26
|
const [name, setName] = useState("");
|
|
27
|
+
const canDeleteFloor = Boolean(onDeleteFloor) && floors.length > 1;
|
|
26
28
|
useEffect(() => {
|
|
27
29
|
if (addOpen) {
|
|
28
30
|
setName(`Floor ${floors.length + 1}`);
|
|
@@ -63,12 +65,23 @@ function FloorSwitcher({
|
|
|
63
65
|
},
|
|
64
66
|
floor.id
|
|
65
67
|
)),
|
|
66
|
-
onAddFloor ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
68
|
+
onAddFloor || canDeleteFloor ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
67
69
|
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
68
|
-
/* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: () => setAddOpen(true), children: [
|
|
70
|
+
onAddFloor ? /* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: () => setAddOpen(true), children: [
|
|
69
71
|
/* @__PURE__ */ jsx(Plus, { size: 14, className: "mr-1.5" }),
|
|
70
72
|
"Add floor\u2026"
|
|
71
|
-
] })
|
|
73
|
+
] }) : null,
|
|
74
|
+
canDeleteFloor ? /* @__PURE__ */ jsxs(
|
|
75
|
+
DropdownMenuItem,
|
|
76
|
+
{
|
|
77
|
+
variant: "destructive",
|
|
78
|
+
onClick: () => onDeleteFloor?.(activeFloorId),
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ jsx(Trash2, { size: 14, className: "mr-1.5" }),
|
|
81
|
+
"Delete floor\u2026"
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
) : null
|
|
72
85
|
] }) : null
|
|
73
86
|
] })
|
|
74
87
|
] }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/live-space/floor-switcher.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA0BO,SAAS,aAAA,CAAc;AAAA,EAC5B,MAAA;AAAA,EACA,aAAA;AAAA,EACA,aAAA;AAAA,EACA;AACF,CAAA,
|
|
1
|
+
{"version":3,"sources":["../src/live-space/floor-switcher.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA0BO,SAAS,aAAA,CAAc;AAAA,EAC5B,MAAA;AAAA,EACA,aAAA;AAAA,EACA,aAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF,CAAA,EAMG;AACD,EAAA,MAAM,WAAA,GAAc,MAAA,CAAO,IAAA,CAAK,CAAC,CAAA,KAAM,EAAE,EAAA,KAAO,aAAa,CAAA,IAAK,MAAA,CAAO,CAAC,CAAA;AAC1E,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAS,KAAK,CAAA;AAC5C,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAS,EAAE,CAAA;AACnC,EAAA,MAAM,cAAA,GAAiB,OAAA,CAAQ,aAAa,CAAA,IAAK,OAAO,MAAA,GAAS,CAAA;AAEjE,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,OAAA,EAAS;AACX,MAAA,OAAA,CAAQ,CAAA,MAAA,EAAS,MAAA,CAAO,MAAA,GAAS,CAAC,CAAA,CAAE,CA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,QAAA,EAE1E,CAAA;AAAA,4BACC,MAAA,EAAA,EAAO,IAAA,EAAK,QAAA,EAAS,OAAA,EAAS,WAAW,QAAA,EAAA,WAAA,EAE1C;AAAA,OAAA,EACF;AAAA,KAAA,EACF,GACF,CAAA,GACE;AAAA,GAAA,EACN,CAAA;AAEJ","file":"floor-switcher.js","sourcesContent":["import { Check, ChevronDown, Layers, Plus, Trash2 } from \"lucide-react\";\nimport { shellTopBarMutedIconClass, shellTopBarSecondaryButtonClass } from \"../shell/shell-top-bar-chrome\";\nimport {\n Button,\n cn,\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n Input,\n Label,\n} from \"../ui\";\nimport { useEffect, useState } from \"react\";\n\nexport interface FloorSwitcherFloor {\n id: string;\n name: string;\n}\n\nexport function FloorSwitcher({\n floors,\n activeFloorId,\n onFloorChange,\n onAddFloor,\n onDeleteFloor,\n}: {\n floors: FloorSwitcherFloor[];\n activeFloorId: string;\n onFloorChange: (floorId: string) => void;\n onAddFloor?: (name: string) => void;\n onDeleteFloor?: (floorId: string) => void;\n}) {\n const activeFloor = floors.find((f) => f.id === activeFloorId) ?? floors[0];\n const [addOpen, setAddOpen] = useState(false);\n const [name, setName] = useState(\"\");\n const canDeleteFloor = Boolean(onDeleteFloor) && floors.length > 1;\n\n useEffect(() => {\n if (addOpen) {\n setName(`Floor ${floors.length + 1}`);\n }\n }, [addOpen, floors.length]);\n\n const handleAdd = () => {\n onAddFloor?.(name.trim() || `Floor ${floors.length + 1}`);\n setAddOpen(false);\n };\n\n return (\n <>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <button\n type=\"button\"\n className={cn(\n shellTopBarSecondaryButtonClass,\n \"min-w-0 max-w-[10rem] outline-none focus-visible:ring-2 focus-visible:ring-blue-500/30\",\n )}\n aria-label=\"Switch floor\"\n >\n <Layers size={12} className={cn(\"shrink-0\", shellTopBarMutedIconClass)} aria-hidden />\n <span className=\"truncate\">{activeFloor?.name ?? \"Floor\"}</span>\n <ChevronDown size={12} className={cn(\"shrink-0\", shellTopBarMutedIconClass)} aria-hidden />\n </button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\" className=\"w-48\">\n {floors.map((floor) => (\n <DropdownMenuItem\n key={floor.id}\n onClick={() => onFloorChange(floor.id)}\n className=\"flex items-center justify-between gap-2\"\n >\n <span className=\"truncate\">{floor.name}</span>\n {floor.id === activeFloorId ? (\n <Check size={14} className=\"shrink-0 text-blue-600\" aria-hidden />\n ) : (\n <span className=\"size-3.5 shrink-0\" aria-hidden />\n )}\n </DropdownMenuItem>\n ))}\n {onAddFloor || canDeleteFloor ? (\n <>\n <DropdownMenuSeparator />\n {onAddFloor ? (\n <DropdownMenuItem onClick={() => setAddOpen(true)}>\n <Plus size={14} className=\"mr-1.5\" />\n Add floor…\n </DropdownMenuItem>\n ) : null}\n {canDeleteFloor ? (\n <DropdownMenuItem\n variant=\"destructive\"\n onClick={() => onDeleteFloor?.(activeFloorId)}\n >\n <Trash2 size={14} className=\"mr-1.5\" />\n Delete floor…\n </DropdownMenuItem>\n ) : null}\n </>\n ) : null}\n </DropdownMenuContent>\n </DropdownMenu>\n\n {onAddFloor ? (\n <Dialog open={addOpen} onOpenChange={setAddOpen}>\n <DialogContent className=\"sm:max-w-md border-border\">\n <DialogHeader>\n <DialogTitle>Add floor</DialogTitle>\n <DialogDescription>\n Create a new floor with its own resources and 2D layout.\n </DialogDescription>\n </DialogHeader>\n <div className=\"py-1\">\n <Label htmlFor=\"new-floor-name\">Name</Label>\n <Input\n id=\"new-floor-name\"\n value={name}\n onChange={(e) => setName(e.target.value)}\n placeholder=\"e.g. Floor 2\"\n className=\"mt-2 h-9\"\n autoFocus\n onKeyDown={(e) => {\n if (e.key === \"Enter\") handleAdd();\n }}\n />\n </div>\n <DialogFooter>\n <Button type=\"button\" variant=\"outline\" onClick={() => setAddOpen(false)}>\n Cancel\n </Button>\n <Button type=\"button\" onClick={handleAdd}>\n Add floor\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n ) : null}\n </>\n );\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useTheme } from './chunk-XU3EFSQX.js';
|
|
2
2
|
import './chunk-4Y5DBM6Z.js';
|
|
3
3
|
import { LIVE_RESOURCE_TYPE_META } from './chunk-ZIJQ7BXU.js';
|
|
4
|
-
import { Tooltip, TooltipTrigger, TooltipContent, Popover, PopoverAnchor, PopoverContent } from './chunk-
|
|
4
|
+
import { Tooltip, TooltipTrigger, TooltipContent, Popover, PopoverAnchor, PopoverContent } from './chunk-H3CNZCYU.js';
|
|
5
5
|
import './chunk-RV5PMZYZ.js';
|
|
6
6
|
import './chunk-L65F4EMK.js';
|
|
7
7
|
import './chunk-PBNBLCC2.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FilePickerField } from './chunk-OMSJWTSZ.js';
|
|
2
|
-
import { Tooltip, TooltipTrigger, TooltipContent, Textarea } from './chunk-
|
|
2
|
+
import { Tooltip, TooltipTrigger, TooltipContent, Textarea } from './chunk-H3CNZCYU.js';
|
|
3
3
|
import './chunk-RV5PMZYZ.js';
|
|
4
4
|
import './chunk-L65F4EMK.js';
|
|
5
5
|
import './chunk-PBNBLCC2.js';
|
package/dist/ui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Calendar, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, CheckboxField, Collapsible, CollapsibleContent, CollapsibleTrigger, ColorPicker, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContentFade, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DashFade, DateField, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FeedSkeleton, FieldLabel, FilterPopover, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, IconInput, InputGroup, InputGroupInput, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, NumberInput, PasswordInput, PhoneInput, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, ReceiptCard, ReceiptSummaryRow, ResizableHandle, ResizablePanel, ResizablePanelGroup, ResponsiveAlertDialog, ResponsiveAlertDialogAction, ResponsiveAlertDialogCancel, ResponsiveAlertDialogContent, ResponsiveAlertDialogDescription, AlertDialogFooter as ResponsiveAlertDialogFooter, AlertDialogHeader as ResponsiveAlertDialogHeader, ResponsiveAlertDialogTitle, ResponsiveDialog, ResponsiveDialogClose, ResponsiveDialogContent, ResponsiveDialogDescription, ResponsiveDialogTitle, ResponsiveDialogTrigger, ScrollArea, ScrollBar, SegmentedTabList, SegmentedTabTrigger, SelectableCard, SelectableListRow, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, ShellTopBarViewToggle, ShellTopBarViewToggleItem, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Slider, SmoothSize, Switch, TabCountBadge, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Text, Textarea, TimeField, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, fieldLabelClass, formatTimeForDisplay, navigationMenuTriggerStyle, parseHm, tabsListVariants, tabsTriggerVariants, textVariants, toTimeStr, toggleVariants, useFormField, useIsMobile, useResponsiveDialogDrawer, useSidebar } from './chunk-
|
|
1
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Calendar, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, CheckboxField, Collapsible, CollapsibleContent, CollapsibleTrigger, ColorPicker, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContentFade, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DashFade, DateField, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FeedSkeleton, FieldLabel, FilterPopover, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, IconInput, InputGroup, InputGroupInput, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, NumberInput, PasswordInput, PhoneInput, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, ReceiptCard, ReceiptSummaryRow, ResizableHandle, ResizablePanel, ResizablePanelGroup, ResponsiveAlertDialog, ResponsiveAlertDialogAction, ResponsiveAlertDialogCancel, ResponsiveAlertDialogContent, ResponsiveAlertDialogDescription, AlertDialogFooter as ResponsiveAlertDialogFooter, AlertDialogHeader as ResponsiveAlertDialogHeader, ResponsiveAlertDialogTitle, ResponsiveDialog, ResponsiveDialogClose, ResponsiveDialogContent, ResponsiveDialogDescription, ResponsiveDialogTitle, ResponsiveDialogTrigger, ScrollArea, ScrollBar, SegmentedTabList, SegmentedTabTrigger, SelectableCard, SelectableListRow, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, ShellTopBarViewToggle, ShellTopBarViewToggleItem, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Slider, SmoothSize, Switch, TabCountBadge, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Text, Textarea, TimeField, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, fieldLabelClass, formatTimeForDisplay, navigationMenuTriggerStyle, parseHm, tabsListVariants, tabsTriggerVariants, textVariants, toTimeStr, toggleVariants, useFormField, useIsMobile, useResponsiveDialogDrawer, useSidebar } from './chunk-H3CNZCYU.js';
|
|
2
2
|
export { Label, RadioGroup, RadioGroupItem } from './chunk-RV5PMZYZ.js';
|
|
3
3
|
export { HoverCard, HoverCardContent, HoverCardTrigger } from './chunk-L65F4EMK.js';
|
|
4
4
|
import './chunk-PBNBLCC2.js';
|