@epicbagel/saas-kit 1.2.3 → 1.3.0
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 +59 -0
- package/dist/chunk-2TKLS73N.js +121 -0
- package/dist/chunk-4UUTKR3V.cjs +53 -0
- package/dist/chunk-BTHYGHOH.cjs +143 -0
- package/dist/chunk-GRY77463.cjs +121 -0
- package/dist/chunk-HHV4G77I.js +55 -0
- package/dist/{chunk-KYQPX754.js → chunk-HRLP4BHJ.js} +7 -7
- package/dist/{chunk-N6V3DDKU.cjs → chunk-IH3COANJ.cjs} +7 -7
- package/dist/chunk-JTI4244T.js +143 -0
- package/dist/chunk-QEJ2STIV.js +53 -0
- package/dist/chunk-VLXPLKFR.cjs +55 -0
- package/dist/primitives/activity-feed.cjs +3 -3
- package/dist/primitives/activity-feed.js +4 -4
- package/dist/primitives/board-view.cjs +6 -6
- package/dist/primitives/board-view.js +5 -5
- package/dist/primitives/chat.cjs +14 -14
- package/dist/primitives/chat.js +12 -12
- package/dist/primitives/code-block.cjs +5 -50
- package/dist/primitives/code-block.js +5 -50
- package/dist/primitives/connection.cjs +6 -6
- package/dist/primitives/connection.js +7 -7
- package/dist/primitives/copy-button.cjs +3 -3
- package/dist/primitives/copy-button.js +2 -2
- package/dist/primitives/document-preview.cjs +54 -0
- package/dist/primitives/document-preview.d.cts +30 -0
- package/dist/primitives/document-preview.d.ts +30 -0
- package/dist/primitives/document-preview.js +54 -0
- package/dist/primitives/editable-list.cjs +1 -1
- package/dist/primitives/editable-list.js +1 -1
- package/dist/primitives/file-dropzone.cjs +3 -3
- package/dist/primitives/file-dropzone.js +2 -2
- package/dist/primitives/file-preview-internals.cjs +20 -0
- package/dist/primitives/file-preview-internals.d.cts +44 -0
- package/dist/primitives/file-preview-internals.d.ts +44 -0
- package/dist/primitives/file-preview-internals.js +20 -0
- package/dist/primitives/file-preview.cjs +327 -0
- package/dist/primitives/file-preview.d.cts +92 -0
- package/dist/primitives/file-preview.d.ts +92 -0
- package/dist/primitives/file-preview.js +327 -0
- package/dist/primitives/filter-bar.cjs +4 -4
- package/dist/primitives/filter-bar.js +3 -3
- package/dist/primitives/image.cjs +4 -48
- package/dist/primitives/image.js +3 -47
- package/dist/primitives/resource-list.cjs +6 -6
- package/dist/primitives/resource-list.js +5 -5
- package/dist/primitives/responsive-dialog.cjs +26 -142
- package/dist/primitives/responsive-dialog.js +13 -129
- package/dist/primitives/section.cjs +2 -2
- package/dist/primitives/section.js +3 -3
- package/dist/primitives/switch-field.cjs +2 -2
- package/dist/primitives/switch-field.js +3 -3
- package/package.json +21 -1
- package/dist/{chunk-6OTAGP2I.cjs → chunk-KADJ56AH.cjs} +2 -2
- package/dist/{chunk-EHKMVJ6O.js → chunk-M7FYGAGO.js} +3 -3
- package/dist/{chunk-PVZ4JGDU.js → chunk-MLHNYRFX.js} +6 -6
- package/dist/{chunk-PWOQMTPX.js → chunk-NW3OWKBN.js} +3 -3
- package/dist/{chunk-CYH63OCL.cjs → chunk-SGW4FWBX.cjs} +6 -6
- package/dist/{chunk-ENJNZ323.cjs → chunk-VKIGJNJR.cjs} +2 -2
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import {
|
|
4
|
+
Image
|
|
5
|
+
} from "../chunk-QEJ2STIV.js";
|
|
6
|
+
import {
|
|
7
|
+
PreviewDialog,
|
|
8
|
+
PreviewLoading,
|
|
9
|
+
PreviewNotice,
|
|
10
|
+
PreviewStage
|
|
11
|
+
} from "../chunk-2TKLS73N.js";
|
|
12
|
+
import "../chunk-JTI4244T.js";
|
|
13
|
+
import "../chunk-4HWCNRK4.js";
|
|
14
|
+
import "../chunk-3QT5VYZ3.js";
|
|
15
|
+
import {
|
|
16
|
+
CodeBlock
|
|
17
|
+
} from "../chunk-HHV4G77I.js";
|
|
18
|
+
import "../chunk-NW3OWKBN.js";
|
|
19
|
+
import {
|
|
20
|
+
LazyMarkdown
|
|
21
|
+
} from "../chunk-VY5U4VGV.js";
|
|
22
|
+
import "../chunk-INNGGLMZ.js";
|
|
23
|
+
import {
|
|
24
|
+
Text
|
|
25
|
+
} from "../chunk-EIY5LLSP.js";
|
|
26
|
+
import {
|
|
27
|
+
Icon
|
|
28
|
+
} from "../chunk-KN4RPX35.js";
|
|
29
|
+
import {
|
|
30
|
+
Button
|
|
31
|
+
} from "../chunk-HQRWRRZJ.js";
|
|
32
|
+
import "../chunk-ZWZAAGQF.js";
|
|
33
|
+
import "../chunk-G6SRSWXB.js";
|
|
34
|
+
|
|
35
|
+
// src/primitives/file-preview.tsx
|
|
36
|
+
import { Download, FileQuestion, FileWarning, Loader2 } from "lucide-react";
|
|
37
|
+
import { useEffect, useLayoutEffect, useState } from "react";
|
|
38
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
39
|
+
var UNTYPED = /* @__PURE__ */ new Set([
|
|
40
|
+
"",
|
|
41
|
+
"application/octet-stream",
|
|
42
|
+
"binary/octet-stream",
|
|
43
|
+
"application/binary",
|
|
44
|
+
"application/unknown",
|
|
45
|
+
"application/x-download",
|
|
46
|
+
"application/force-download"
|
|
47
|
+
]);
|
|
48
|
+
var TYPE_KINDS = {
|
|
49
|
+
"application/pdf": "pdf",
|
|
50
|
+
"application/x-pdf": "pdf",
|
|
51
|
+
"image/apng": "image",
|
|
52
|
+
"image/avif": "image",
|
|
53
|
+
"image/bmp": "image",
|
|
54
|
+
"image/gif": "image",
|
|
55
|
+
"image/jpeg": "image",
|
|
56
|
+
"image/jpg": "image",
|
|
57
|
+
"image/pjpeg": "image",
|
|
58
|
+
"image/png": "image",
|
|
59
|
+
"image/svg+xml": "image",
|
|
60
|
+
"image/vnd.microsoft.icon": "image",
|
|
61
|
+
"image/webp": "image",
|
|
62
|
+
"image/x-icon": "image",
|
|
63
|
+
"text/markdown": "markdown",
|
|
64
|
+
"text/x-markdown": "markdown",
|
|
65
|
+
// RTF is text/*, but its source is control words, not the document.
|
|
66
|
+
"text/rtf": "none",
|
|
67
|
+
"application/ecmascript": "text",
|
|
68
|
+
"application/graphql": "text",
|
|
69
|
+
"application/javascript": "text",
|
|
70
|
+
"application/json": "text",
|
|
71
|
+
"application/sql": "text",
|
|
72
|
+
"application/toml": "text",
|
|
73
|
+
"application/typescript": "text",
|
|
74
|
+
"application/x-httpd-php": "text",
|
|
75
|
+
"application/x-javascript": "text",
|
|
76
|
+
"application/x-ndjson": "text",
|
|
77
|
+
"application/x-sh": "text",
|
|
78
|
+
"application/x-typescript": "text",
|
|
79
|
+
"application/x-yaml": "text",
|
|
80
|
+
"application/xml": "text",
|
|
81
|
+
"application/yaml": "text",
|
|
82
|
+
"audio/aac": "audio",
|
|
83
|
+
"audio/flac": "audio",
|
|
84
|
+
"audio/mp3": "audio",
|
|
85
|
+
"audio/mp4": "audio",
|
|
86
|
+
"audio/mpeg": "audio",
|
|
87
|
+
"audio/ogg": "audio",
|
|
88
|
+
"audio/opus": "audio",
|
|
89
|
+
"audio/wav": "audio",
|
|
90
|
+
"audio/wave": "audio",
|
|
91
|
+
"audio/webm": "audio",
|
|
92
|
+
"audio/x-flac": "audio",
|
|
93
|
+
"audio/x-m4a": "audio",
|
|
94
|
+
"audio/x-wav": "audio",
|
|
95
|
+
"video/mp4": "video",
|
|
96
|
+
"video/ogg": "video",
|
|
97
|
+
"video/quicktime": "video",
|
|
98
|
+
"video/webm": "video",
|
|
99
|
+
"video/x-m4v": "video"
|
|
100
|
+
};
|
|
101
|
+
var EXTENSION_KINDS = new Map(
|
|
102
|
+
[
|
|
103
|
+
["pdf", "pdf"],
|
|
104
|
+
["image", "apng avif bmp gif ico jfif jpeg jpg png svg webp"],
|
|
105
|
+
["markdown", "markdown md mdown mkd"],
|
|
106
|
+
["audio", "aac flac m4a mp3 oga ogg opus wav weba"],
|
|
107
|
+
["video", "m4v mov mp4 ogv webm"],
|
|
108
|
+
[
|
|
109
|
+
"text",
|
|
110
|
+
"adoc bash bat c cc cfg cjs clj conf cpp cs css csv cts cxx dart diff env erl ex exs fish go gql graphql h hpp hs htm html ini java js json jsonc jsonl jsx kt kts less log lua mjs mts ndjson patch php pl properties ps1 py r rb rs rst sass scala scss sh sql srt svelte swift tex text toml ts tsv tsx txt vtt vue xml yaml yml zsh"
|
|
111
|
+
]
|
|
112
|
+
].flatMap(
|
|
113
|
+
([kind, extensions]) => extensions.split(" ").map((extension) => [extension, kind])
|
|
114
|
+
)
|
|
115
|
+
);
|
|
116
|
+
function kindOfName(name) {
|
|
117
|
+
const base = (name ?? "").trim().toLowerCase().split(/[\\/]/).pop() ?? "";
|
|
118
|
+
const dot = base.lastIndexOf(".");
|
|
119
|
+
return dot >= 0 ? EXTENSION_KINDS.get(base.slice(dot + 1)) : void 0;
|
|
120
|
+
}
|
|
121
|
+
function kindOfType(type) {
|
|
122
|
+
const known = TYPE_KINDS[type];
|
|
123
|
+
if (known) return known;
|
|
124
|
+
if (type.startsWith("text/")) return "text";
|
|
125
|
+
if (/^application\/[\w.-]+\+(?:json|xml)$/.test(type)) return "text";
|
|
126
|
+
return void 0;
|
|
127
|
+
}
|
|
128
|
+
function filePreviewKind({ name, mediaType }) {
|
|
129
|
+
const type = (mediaType ?? "").split(";", 1)[0].trim().toLowerCase();
|
|
130
|
+
const byName = kindOfName(name);
|
|
131
|
+
if (UNTYPED.has(type)) return byName ?? "none";
|
|
132
|
+
const byType = kindOfType(type);
|
|
133
|
+
if (byType === "text" && byName === "markdown") return "markdown";
|
|
134
|
+
if (byType) return byType;
|
|
135
|
+
return byName === "text" || byName === "markdown" ? byName : "none";
|
|
136
|
+
}
|
|
137
|
+
function FilePreview({
|
|
138
|
+
open,
|
|
139
|
+
onOpenChange,
|
|
140
|
+
title,
|
|
141
|
+
mediaType,
|
|
142
|
+
kind,
|
|
143
|
+
file,
|
|
144
|
+
src,
|
|
145
|
+
loading = false,
|
|
146
|
+
error,
|
|
147
|
+
onDownload,
|
|
148
|
+
downloading = false,
|
|
149
|
+
downloadLabel = "Download file",
|
|
150
|
+
fallback,
|
|
151
|
+
markdownComponents,
|
|
152
|
+
loadingLabel = "Loading preview\u2026",
|
|
153
|
+
unavailableLabel = "No preview for this file.",
|
|
154
|
+
failedLabel = "This file couldn't be shown here.",
|
|
155
|
+
truncatedLabel = "Showing the start of this file. Download it to see the rest."
|
|
156
|
+
}) {
|
|
157
|
+
return /* @__PURE__ */ jsx(
|
|
158
|
+
PreviewDialog,
|
|
159
|
+
{
|
|
160
|
+
open,
|
|
161
|
+
onOpenChange,
|
|
162
|
+
title,
|
|
163
|
+
onDownload,
|
|
164
|
+
downloading,
|
|
165
|
+
downloadLabel,
|
|
166
|
+
children: /* @__PURE__ */ jsx(
|
|
167
|
+
FilePreviewBody,
|
|
168
|
+
{
|
|
169
|
+
kind: kind ?? filePreviewKind({ name: title, mediaType: mediaType ?? file?.type }),
|
|
170
|
+
title,
|
|
171
|
+
file: file ?? null,
|
|
172
|
+
src: src ?? null,
|
|
173
|
+
loading,
|
|
174
|
+
error: error ?? null,
|
|
175
|
+
fallback,
|
|
176
|
+
download: onDownload ? (
|
|
177
|
+
// Under a muted message: the action keeps the foreground colour.
|
|
178
|
+
/* @__PURE__ */ jsxs(
|
|
179
|
+
Button,
|
|
180
|
+
{
|
|
181
|
+
type: "button",
|
|
182
|
+
variant: "outline",
|
|
183
|
+
size: "sm",
|
|
184
|
+
className: "text-foreground",
|
|
185
|
+
onClick: onDownload,
|
|
186
|
+
disabled: downloading,
|
|
187
|
+
children: [
|
|
188
|
+
/* @__PURE__ */ jsx(Icon, { icon: downloading ? Loader2 : Download, size: "sm", spin: downloading }),
|
|
189
|
+
downloadLabel
|
|
190
|
+
]
|
|
191
|
+
}
|
|
192
|
+
)
|
|
193
|
+
) : null,
|
|
194
|
+
markdownComponents,
|
|
195
|
+
loadingLabel,
|
|
196
|
+
unavailableLabel,
|
|
197
|
+
failedLabel,
|
|
198
|
+
truncatedLabel
|
|
199
|
+
}
|
|
200
|
+
)
|
|
201
|
+
}
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
var TEXT_PREVIEW_LIMIT = 5e5;
|
|
205
|
+
function NewTabLink({ node: _node, ...props }) {
|
|
206
|
+
return /* @__PURE__ */ jsx("a", { ...props, target: "_blank", rel: "noopener noreferrer" });
|
|
207
|
+
}
|
|
208
|
+
function startOf(text) {
|
|
209
|
+
if (text.length <= TEXT_PREVIEW_LIMIT) return { text, truncated: false };
|
|
210
|
+
const end = text.lastIndexOf("\n", TEXT_PREVIEW_LIMIT);
|
|
211
|
+
return { text: text.slice(0, end > 0 ? end : TEXT_PREVIEW_LIMIT), truncated: true };
|
|
212
|
+
}
|
|
213
|
+
function useFileText(file, src) {
|
|
214
|
+
const source = file ?? src;
|
|
215
|
+
const [read, setRead] = useState(null);
|
|
216
|
+
useEffect(() => {
|
|
217
|
+
if (!source) return void 0;
|
|
218
|
+
let current = true;
|
|
219
|
+
const controller = new AbortController();
|
|
220
|
+
const text = typeof source === "string" ? fetch(source, { signal: controller.signal }).then((response) => {
|
|
221
|
+
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
|
222
|
+
return response.text();
|
|
223
|
+
}) : source.text();
|
|
224
|
+
text.then(
|
|
225
|
+
(value) => {
|
|
226
|
+
if (current) setRead({ source, result: { status: "read", ...startOf(value) } });
|
|
227
|
+
},
|
|
228
|
+
() => {
|
|
229
|
+
if (current) setRead({ source, result: { status: "failed" } });
|
|
230
|
+
}
|
|
231
|
+
);
|
|
232
|
+
return () => {
|
|
233
|
+
current = false;
|
|
234
|
+
controller.abort();
|
|
235
|
+
};
|
|
236
|
+
}, [source]);
|
|
237
|
+
if (!source) return null;
|
|
238
|
+
return read?.source === source ? read.result : { status: "reading" };
|
|
239
|
+
}
|
|
240
|
+
function useObjectUrl(file, type) {
|
|
241
|
+
const [made, setMade] = useState(null);
|
|
242
|
+
useLayoutEffect(() => {
|
|
243
|
+
if (!file) return void 0;
|
|
244
|
+
const url = URL.createObjectURL(type && file.type !== type ? new Blob([file], { type }) : file);
|
|
245
|
+
setMade({ file, type, url });
|
|
246
|
+
return () => URL.revokeObjectURL(url);
|
|
247
|
+
}, [file, type]);
|
|
248
|
+
return file && made?.file === file && made.type === type ? made.url : null;
|
|
249
|
+
}
|
|
250
|
+
function FilePreviewBody({
|
|
251
|
+
kind,
|
|
252
|
+
title,
|
|
253
|
+
file,
|
|
254
|
+
src,
|
|
255
|
+
loading,
|
|
256
|
+
error,
|
|
257
|
+
fallback,
|
|
258
|
+
download,
|
|
259
|
+
markdownComponents,
|
|
260
|
+
loadingLabel,
|
|
261
|
+
unavailableLabel,
|
|
262
|
+
failedLabel,
|
|
263
|
+
truncatedLabel
|
|
264
|
+
}) {
|
|
265
|
+
const ready = !loading && !error && kind !== "none";
|
|
266
|
+
const reads = kind === "text" || kind === "markdown";
|
|
267
|
+
const text = useFileText(ready && reads ? file : null, ready && reads ? src : null);
|
|
268
|
+
const objectUrl = useObjectUrl(ready && !reads ? file : null, kind === "pdf" ? "application/pdf" : void 0);
|
|
269
|
+
const pending = /* @__PURE__ */ jsx(PreviewStage, { children: /* @__PURE__ */ jsx(PreviewLoading, { label: loadingLabel }) });
|
|
270
|
+
const failed = (message) => /* @__PURE__ */ jsx(PreviewStage, { children: /* @__PURE__ */ jsx(PreviewNotice, { icon: FileWarning, alert: true, message, children: fallback ?? download }) });
|
|
271
|
+
if (loading) return pending;
|
|
272
|
+
if (error) return failed(error);
|
|
273
|
+
if (kind === "none" || !file && !src) {
|
|
274
|
+
return /* @__PURE__ */ jsx(PreviewStage, { children: fallback ?? /* @__PURE__ */ jsx(PreviewNotice, { icon: FileQuestion, message: unavailableLabel, children: download }) });
|
|
275
|
+
}
|
|
276
|
+
if (reads) {
|
|
277
|
+
if (!text || text.status === "reading") return pending;
|
|
278
|
+
if (text.status === "failed") return failed(failedLabel);
|
|
279
|
+
return /* @__PURE__ */ jsxs(PreviewStage, { layout: "scroll", label: `Preview of ${title}`, children: [
|
|
280
|
+
text.truncated && /* @__PURE__ */ jsx(Text, { variant: "caption", marginBottom: "sm", children: truncatedLabel }),
|
|
281
|
+
kind === "markdown" ? /* @__PURE__ */ jsx(LazyMarkdown, { components: { a: NewTabLink, ...markdownComponents }, children: text.text }) : (
|
|
282
|
+
// The theme's relaxed leading is a fixed 1.8rem, which spaces a
|
|
283
|
+
// file's small monospace lines apart; read it at 20px lines.
|
|
284
|
+
/* @__PURE__ */ jsx(CodeBlock, { wrap: true, className: "[&>pre]:leading-5", children: text.text })
|
|
285
|
+
)
|
|
286
|
+
] });
|
|
287
|
+
}
|
|
288
|
+
const url = file ? objectUrl : src;
|
|
289
|
+
if (!url) return pending;
|
|
290
|
+
return /* @__PURE__ */ jsx(ShownFile, { kind, url, title, failed: failed(failedLabel) }, url);
|
|
291
|
+
}
|
|
292
|
+
function ShownFile({
|
|
293
|
+
kind,
|
|
294
|
+
url,
|
|
295
|
+
title,
|
|
296
|
+
failed
|
|
297
|
+
}) {
|
|
298
|
+
const [broken, setBroken] = useState(false);
|
|
299
|
+
if (broken) return failed;
|
|
300
|
+
const fail = () => setBroken(true);
|
|
301
|
+
const label = `Preview of ${title}`;
|
|
302
|
+
if (kind === "image") {
|
|
303
|
+
return /* @__PURE__ */ jsx(PreviewStage, { children: /* @__PURE__ */ jsx("div", { className: "flex h-full w-full items-center justify-center p-4", children: /* @__PURE__ */ jsx(Image, { src: url, alt: title, fit: "contain", radius: "sm", className: "max-h-full max-w-full", onError: fail }) }) });
|
|
304
|
+
}
|
|
305
|
+
if (kind === "audio") {
|
|
306
|
+
return /* @__PURE__ */ jsx(PreviewStage, { children: /* @__PURE__ */ jsx("div", { className: "w-full max-w-md p-6", children: /* @__PURE__ */ jsx("audio", { src: url, controls: true, preload: "metadata", "aria-label": label, className: "w-full", onError: fail }) }) });
|
|
307
|
+
}
|
|
308
|
+
if (kind === "video") {
|
|
309
|
+
return /* @__PURE__ */ jsx(PreviewStage, { children: /* @__PURE__ */ jsx("div", { className: "flex h-full w-full items-center justify-center p-4", children: /* @__PURE__ */ jsx(
|
|
310
|
+
"video",
|
|
311
|
+
{
|
|
312
|
+
src: url,
|
|
313
|
+
controls: true,
|
|
314
|
+
playsInline: true,
|
|
315
|
+
preload: "metadata",
|
|
316
|
+
"aria-label": label,
|
|
317
|
+
className: "max-h-full max-w-full rounded-sm",
|
|
318
|
+
onError: fail
|
|
319
|
+
}
|
|
320
|
+
) }) });
|
|
321
|
+
}
|
|
322
|
+
return /* @__PURE__ */ jsx(PreviewStage, { children: /* @__PURE__ */ jsx("iframe", { src: url, title: label, referrerPolicy: "no-referrer", className: "h-full w-full border-0 bg-background" }) });
|
|
323
|
+
}
|
|
324
|
+
export {
|
|
325
|
+
FilePreview,
|
|
326
|
+
filePreviewKind
|
|
327
|
+
};
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkSGW4FWBXcjs = require('../chunk-SGW4FWBX.cjs');
|
|
6
6
|
require('../chunk-PPX2VPGI.cjs');
|
|
7
7
|
require('../chunk-WNXVGUBF.cjs');
|
|
8
8
|
require('../chunk-IQZLUT2Y.cjs');
|
|
9
|
+
require('../chunk-R5L4CM6V.cjs');
|
|
9
10
|
require('../chunk-JH4GAGOQ.cjs');
|
|
10
11
|
require('../chunk-V5SPFLKW.cjs');
|
|
11
|
-
require('../chunk-R5L4CM6V.cjs');
|
|
12
|
-
require('../chunk-R35FT53G.cjs');
|
|
13
12
|
require('../chunk-PQUSJEXL.cjs');
|
|
14
13
|
require('../chunk-VGTINL5Q.cjs');
|
|
15
14
|
require('../chunk-I6GUOEBO.cjs');
|
|
16
15
|
require('../chunk-L4DH72UF.cjs');
|
|
16
|
+
require('../chunk-R35FT53G.cjs');
|
|
17
17
|
require('../chunk-KWLSBTB2.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
exports.FilterBar =
|
|
20
|
+
exports.FilterBar = _chunkSGW4FWBXcjs.FilterBar;
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
import {
|
|
4
4
|
FilterBar
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-MLHNYRFX.js";
|
|
6
6
|
import "../chunk-G76JANB4.js";
|
|
7
7
|
import "../chunk-YG7FBJRM.js";
|
|
8
8
|
import "../chunk-E2TQMDO7.js";
|
|
9
|
+
import "../chunk-RRRD5EUI.js";
|
|
9
10
|
import "../chunk-OICAYRVH.js";
|
|
10
11
|
import "../chunk-J6NXDZR5.js";
|
|
11
|
-
import "../chunk-RRRD5EUI.js";
|
|
12
|
-
import "../chunk-PIU5SSUV.js";
|
|
13
12
|
import "../chunk-QMA3WVB7.js";
|
|
14
13
|
import "../chunk-H7TETFLB.js";
|
|
15
14
|
import "../chunk-D4ZL2OEQ.js";
|
|
16
15
|
import "../chunk-HQRWRRZJ.js";
|
|
16
|
+
import "../chunk-PIU5SSUV.js";
|
|
17
17
|
import "../chunk-G6SRSWXB.js";
|
|
18
18
|
export {
|
|
19
19
|
FilterBar
|
|
@@ -1,52 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk4UUTKR3Vcjs = require('../chunk-4UUTKR3V.cjs');
|
|
5
|
+
require('../chunk-KWLSBTB2.cjs');
|
|
5
6
|
|
|
6
|
-
// src/primitives/image.tsx
|
|
7
|
-
var _react = require('react');
|
|
8
|
-
var _jsxruntime = require('react/jsx-runtime');
|
|
9
|
-
var fitStyles = { cover: "object-cover", contain: "object-contain" };
|
|
10
|
-
var radiusStyles = { none: "", sm: "rounded-sm", md: "rounded-md", xl: "rounded-xl", full: "rounded-full" };
|
|
11
|
-
var Image = _react.forwardRef.call(void 0, function Image2({ fit = "cover", frameHeight, radius = "none", width = "auto", align = "start", border = false, shadow = "none", emphasis = "full", loadingIndicator = "none", className, onLoad, onError, src, ...props }, ref) {
|
|
12
|
-
const [loaded, setLoaded] = _react.useState.call(void 0, loadingIndicator === "none" || !src);
|
|
13
|
-
_react.useEffect.call(void 0, () => {
|
|
14
|
-
setLoaded(loadingIndicator === "none" || !src);
|
|
15
|
-
}, [loadingIndicator, src]);
|
|
16
|
-
const loading = loadingIndicator === "pulse" && !loaded;
|
|
17
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
18
|
-
"img",
|
|
19
|
-
{
|
|
20
|
-
ref,
|
|
21
|
-
className: _chunkKWLSBTB2cjs.cn.call(void 0,
|
|
22
|
-
fitStyles[fit],
|
|
23
|
-
radiusStyles[radius],
|
|
24
|
-
frameHeight === "sm" && "h-16",
|
|
25
|
-
frameHeight === "md" && "h-28",
|
|
26
|
-
width === "full" && "w-full",
|
|
27
|
-
width === "preview" && "w-full max-w-[380px]",
|
|
28
|
-
width === "preview-lg" && "w-full max-w-[440px]",
|
|
29
|
-
align === "center" && "mx-auto",
|
|
30
|
-
border && "border",
|
|
31
|
-
shadow === "subtle" && "shadow-xs",
|
|
32
|
-
loading && "animate-pulse bg-muted",
|
|
33
|
-
emphasis === "soft-until-parent-hover" && "transition-opacity duration-200 md:opacity-70 md:group-hover:opacity-100",
|
|
34
|
-
className
|
|
35
|
-
),
|
|
36
|
-
src,
|
|
37
|
-
...props,
|
|
38
|
-
"aria-busy": loading || void 0,
|
|
39
|
-
onLoad: (event) => {
|
|
40
|
-
setLoaded(true);
|
|
41
|
-
_optionalChain([onLoad, 'optionalCall', _ => _(event)]);
|
|
42
|
-
},
|
|
43
|
-
onError: (event) => {
|
|
44
|
-
setLoaded(true);
|
|
45
|
-
_optionalChain([onError, 'optionalCall', _2 => _2(event)]);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
);
|
|
49
|
-
});
|
|
50
7
|
|
|
51
|
-
|
|
52
|
-
exports.Image = Image;
|
|
8
|
+
exports.Image = _chunk4UUTKR3Vcjs.Image;
|
package/dist/primitives/image.js
CHANGED
|
@@ -1,52 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
|
|
6
|
-
// src/primitives/image.tsx
|
|
7
|
-
import { forwardRef, useEffect, useState } from "react";
|
|
8
|
-
import { jsx } from "react/jsx-runtime";
|
|
9
|
-
var fitStyles = { cover: "object-cover", contain: "object-contain" };
|
|
10
|
-
var radiusStyles = { none: "", sm: "rounded-sm", md: "rounded-md", xl: "rounded-xl", full: "rounded-full" };
|
|
11
|
-
var Image = forwardRef(function Image2({ fit = "cover", frameHeight, radius = "none", width = "auto", align = "start", border = false, shadow = "none", emphasis = "full", loadingIndicator = "none", className, onLoad, onError, src, ...props }, ref) {
|
|
12
|
-
const [loaded, setLoaded] = useState(loadingIndicator === "none" || !src);
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
setLoaded(loadingIndicator === "none" || !src);
|
|
15
|
-
}, [loadingIndicator, src]);
|
|
16
|
-
const loading = loadingIndicator === "pulse" && !loaded;
|
|
17
|
-
return /* @__PURE__ */ jsx(
|
|
18
|
-
"img",
|
|
19
|
-
{
|
|
20
|
-
ref,
|
|
21
|
-
className: cn(
|
|
22
|
-
fitStyles[fit],
|
|
23
|
-
radiusStyles[radius],
|
|
24
|
-
frameHeight === "sm" && "h-16",
|
|
25
|
-
frameHeight === "md" && "h-28",
|
|
26
|
-
width === "full" && "w-full",
|
|
27
|
-
width === "preview" && "w-full max-w-[380px]",
|
|
28
|
-
width === "preview-lg" && "w-full max-w-[440px]",
|
|
29
|
-
align === "center" && "mx-auto",
|
|
30
|
-
border && "border",
|
|
31
|
-
shadow === "subtle" && "shadow-xs",
|
|
32
|
-
loading && "animate-pulse bg-muted",
|
|
33
|
-
emphasis === "soft-until-parent-hover" && "transition-opacity duration-200 md:opacity-70 md:group-hover:opacity-100",
|
|
34
|
-
className
|
|
35
|
-
),
|
|
36
|
-
src,
|
|
37
|
-
...props,
|
|
38
|
-
"aria-busy": loading || void 0,
|
|
39
|
-
onLoad: (event) => {
|
|
40
|
-
setLoaded(true);
|
|
41
|
-
onLoad?.(event);
|
|
42
|
-
},
|
|
43
|
-
onError: (event) => {
|
|
44
|
-
setLoaded(true);
|
|
45
|
-
onError?.(event);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
);
|
|
49
|
-
});
|
|
3
|
+
Image
|
|
4
|
+
} from "../chunk-QEJ2STIV.js";
|
|
5
|
+
import "../chunk-G6SRSWXB.js";
|
|
50
6
|
export {
|
|
51
7
|
Image
|
|
52
8
|
};
|
|
@@ -2,27 +2,27 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkIH3COANJcjs = require('../chunk-IH3COANJ.cjs');
|
|
6
6
|
require('../chunk-PNWNU6JW.cjs');
|
|
7
7
|
require('../chunk-FNDBM67K.cjs');
|
|
8
|
-
require('../chunk-
|
|
8
|
+
require('../chunk-SGW4FWBX.cjs');
|
|
9
9
|
require('../chunk-PPX2VPGI.cjs');
|
|
10
10
|
require('../chunk-WNXVGUBF.cjs');
|
|
11
11
|
require('../chunk-IQZLUT2Y.cjs');
|
|
12
|
+
require('../chunk-LELBCBDT.cjs');
|
|
13
|
+
require('../chunk-R5L4CM6V.cjs');
|
|
12
14
|
require('../chunk-U2NES7VR.cjs');
|
|
13
15
|
require('../chunk-JH4GAGOQ.cjs');
|
|
14
|
-
require('../chunk-LELBCBDT.cjs');
|
|
15
16
|
require('../chunk-YYFVG5A6.cjs');
|
|
16
17
|
require('../chunk-XLIAY56V.cjs');
|
|
17
18
|
require('../chunk-V5SPFLKW.cjs');
|
|
18
|
-
require('../chunk-R5L4CM6V.cjs');
|
|
19
|
-
require('../chunk-R35FT53G.cjs');
|
|
20
19
|
require('../chunk-PQUSJEXL.cjs');
|
|
21
20
|
require('../chunk-VGTINL5Q.cjs');
|
|
22
21
|
require('../chunk-I6GUOEBO.cjs');
|
|
23
22
|
require('../chunk-VBPPFC7X.cjs');
|
|
24
23
|
require('../chunk-L4DH72UF.cjs');
|
|
24
|
+
require('../chunk-R35FT53G.cjs');
|
|
25
25
|
require('../chunk-KWLSBTB2.cjs');
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
exports.ResourceList =
|
|
28
|
+
exports.ResourceList = _chunkIH3COANJcjs.ResourceList;
|
|
@@ -2,26 +2,26 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
import {
|
|
4
4
|
ResourceList
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-HRLP4BHJ.js";
|
|
6
6
|
import "../chunk-LI5EOSQG.js";
|
|
7
7
|
import "../chunk-J3GQXM37.js";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-MLHNYRFX.js";
|
|
9
9
|
import "../chunk-G76JANB4.js";
|
|
10
10
|
import "../chunk-YG7FBJRM.js";
|
|
11
11
|
import "../chunk-E2TQMDO7.js";
|
|
12
|
+
import "../chunk-H2O6NMLZ.js";
|
|
13
|
+
import "../chunk-RRRD5EUI.js";
|
|
12
14
|
import "../chunk-ZRLUUZHK.js";
|
|
13
15
|
import "../chunk-OICAYRVH.js";
|
|
14
|
-
import "../chunk-H2O6NMLZ.js";
|
|
15
16
|
import "../chunk-62UTAG2C.js";
|
|
16
17
|
import "../chunk-LELFPLTE.js";
|
|
17
18
|
import "../chunk-J6NXDZR5.js";
|
|
18
|
-
import "../chunk-RRRD5EUI.js";
|
|
19
|
-
import "../chunk-PIU5SSUV.js";
|
|
20
19
|
import "../chunk-QMA3WVB7.js";
|
|
21
20
|
import "../chunk-H7TETFLB.js";
|
|
22
21
|
import "../chunk-D4ZL2OEQ.js";
|
|
23
22
|
import "../chunk-YEW65ASC.js";
|
|
24
23
|
import "../chunk-HQRWRRZJ.js";
|
|
24
|
+
import "../chunk-PIU5SSUV.js";
|
|
25
25
|
import "../chunk-G6SRSWXB.js";
|
|
26
26
|
export {
|
|
27
27
|
ResourceList
|