@epicbagel/saas-kit 1.2.2 → 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.
@@ -1,56 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _chunkVKIGJNJRcjs = require('../chunk-VKIGJNJR.cjs');
4
+ var _chunkVLXPLKFRcjs = require('../chunk-VLXPLKFR.cjs');
5
+ require('../chunk-VKIGJNJR.cjs');
5
6
  require('../chunk-L4DH72UF.cjs');
6
7
  require('../chunk-4LXN6GLZ.cjs');
8
+ require('../chunk-KWLSBTB2.cjs');
7
9
 
8
10
 
9
- var _chunkKWLSBTB2cjs = require('../chunk-KWLSBTB2.cjs');
10
-
11
- // src/primitives/code-block.tsx
12
- var _jsxruntime = require('react/jsx-runtime');
13
- var HEIGHTS = {
14
- none: "",
15
- sm: "max-h-40 overflow-y-auto",
16
- md: "max-h-64 overflow-y-auto",
17
- lg: "max-h-96 overflow-y-auto",
18
- viewport: "min-h-[55vh] max-h-[65vh] overflow-y-auto"
19
- };
20
- function CodeBlock({
21
- children,
22
- copy,
23
- copyLabel,
24
- wrap = false,
25
- maxHeight = "none",
26
- className
27
- }) {
28
- const copyText = typeof copy === "string" ? copy : children;
29
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkKWLSBTB2cjs.cn.call(void 0, "relative", className), children: [
30
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
31
- "pre",
32
- {
33
- className: _chunkKWLSBTB2cjs.cn.call(void 0,
34
- "rounded-md border border-border bg-muted/40 p-3 font-mono text-xs leading-relaxed",
35
- wrap ? "whitespace-pre-wrap break-words" : "overflow-x-auto",
36
- HEIGHTS[maxHeight],
37
- copy ? "pr-12" : void 0
38
- ),
39
- children
40
- }
41
- ),
42
- copy ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
43
- _chunkVKIGJNJRcjs.CopyButton,
44
- {
45
- text: copyText,
46
- label: copyLabel,
47
- size: "sm",
48
- variant: "ghost",
49
- className: "absolute right-1.5 top-1.5"
50
- }
51
- ) : null
52
- ] });
53
- }
54
-
55
-
56
- exports.CodeBlock = CodeBlock;
11
+ exports.CodeBlock = _chunkVLXPLKFRcjs.CodeBlock;
@@ -1,56 +1,11 @@
1
1
  "use client";
2
2
  import {
3
- CopyButton
4
- } from "../chunk-NW3OWKBN.js";
3
+ CodeBlock
4
+ } from "../chunk-HHV4G77I.js";
5
+ import "../chunk-NW3OWKBN.js";
5
6
  import "../chunk-HQRWRRZJ.js";
6
7
  import "../chunk-ZWZAAGQF.js";
7
- import {
8
- cn
9
- } from "../chunk-G6SRSWXB.js";
10
-
11
- // src/primitives/code-block.tsx
12
- import { jsx, jsxs } from "react/jsx-runtime";
13
- var HEIGHTS = {
14
- none: "",
15
- sm: "max-h-40 overflow-y-auto",
16
- md: "max-h-64 overflow-y-auto",
17
- lg: "max-h-96 overflow-y-auto",
18
- viewport: "min-h-[55vh] max-h-[65vh] overflow-y-auto"
19
- };
20
- function CodeBlock({
21
- children,
22
- copy,
23
- copyLabel,
24
- wrap = false,
25
- maxHeight = "none",
26
- className
27
- }) {
28
- const copyText = typeof copy === "string" ? copy : children;
29
- return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
30
- /* @__PURE__ */ jsx(
31
- "pre",
32
- {
33
- className: cn(
34
- "rounded-md border border-border bg-muted/40 p-3 font-mono text-xs leading-relaxed",
35
- wrap ? "whitespace-pre-wrap break-words" : "overflow-x-auto",
36
- HEIGHTS[maxHeight],
37
- copy ? "pr-12" : void 0
38
- ),
39
- children
40
- }
41
- ),
42
- copy ? /* @__PURE__ */ jsx(
43
- CopyButton,
44
- {
45
- text: copyText,
46
- label: copyLabel,
47
- size: "sm",
48
- variant: "ghost",
49
- className: "absolute right-1.5 top-1.5"
50
- }
51
- ) : null
52
- ] });
53
- }
8
+ import "../chunk-G6SRSWXB.js";
54
9
  export {
55
10
  CodeBlock
56
11
  };
@@ -0,0 +1,54 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }"use client";
2
+ "use client";
3
+
4
+
5
+
6
+
7
+
8
+ var _chunkGRY77463cjs = require('../chunk-GRY77463.cjs');
9
+ require('../chunk-BTHYGHOH.cjs');
10
+ require('../chunk-2BHI5ZWJ.cjs');
11
+ require('../chunk-WDXEJDMO.cjs');
12
+ require('../chunk-T2ZFSPE4.cjs');
13
+ require('../chunk-L4DH72UF.cjs');
14
+ require('../chunk-KWLSBTB2.cjs');
15
+
16
+ // src/primitives/document-preview.tsx
17
+ var _lucidereact = require('lucide-react');
18
+ var _jsxruntime = require('react/jsx-runtime');
19
+ function DocumentPreview({
20
+ open,
21
+ onOpenChange,
22
+ title,
23
+ src,
24
+ loading = false,
25
+ error,
26
+ onDownload,
27
+ downloading = false,
28
+ downloadLabel = "Download document",
29
+ fallback
30
+ }) {
31
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
32
+ _chunkGRY77463cjs.PreviewDialog,
33
+ {
34
+ open,
35
+ onOpenChange,
36
+ title,
37
+ onDownload,
38
+ downloading,
39
+ downloadLabel,
40
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGRY77463cjs.PreviewStage, { children: loading ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGRY77463cjs.PreviewLoading, { label: "Loading preview\u2026" }) : error ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGRY77463cjs.PreviewNotice, { icon: _lucidereact.FileWarning, alert: true, message: error, children: fallback }) : src ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
41
+ "iframe",
42
+ {
43
+ src,
44
+ title: `Preview of ${title}`,
45
+ referrerPolicy: "no-referrer",
46
+ className: "h-full w-full border-0 bg-background"
47
+ }
48
+ ) : _nullishCoalesce(fallback, () => ( /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-6 text-center text-sm text-muted-foreground", children: "Preview unavailable." }))) })
49
+ }
50
+ );
51
+ }
52
+
53
+
54
+ exports.DocumentPreview = DocumentPreview;
@@ -0,0 +1,30 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+
4
+ interface DocumentPreviewProps {
5
+ open: boolean;
6
+ onOpenChange: (open: boolean) => void;
7
+ title: string;
8
+ src?: string | null;
9
+ loading?: boolean;
10
+ error?: string | null;
11
+ onDownload?: () => void;
12
+ downloading?: boolean;
13
+ downloadLabel?: string;
14
+ fallback?: ReactNode;
15
+ }
16
+ /**
17
+ * Responsive, presentation-only shell for a browser-renderable document.
18
+ *
19
+ * The consumer owns authentication and URL acquisition; `src` is expected to
20
+ * be a short-lived or otherwise safe URL. Desktop uses the kit's large preview
21
+ * dialog and mobile uses its near-full-height drawer. PDF rendering is left to
22
+ * the browser so this primitive adds no PDF engine to every consuming app.
23
+ *
24
+ * Every `src` opens in the browser's own viewer. For a file that may be an
25
+ * image, text, Markdown or media, use `FilePreview`
26
+ * (`primitives/file-preview`): the same dialog, showing each type its own way.
27
+ */
28
+ declare function DocumentPreview({ open, onOpenChange, title, src, loading, error, onDownload, downloading, downloadLabel, fallback, }: DocumentPreviewProps): react_jsx_runtime.JSX.Element;
29
+
30
+ export { DocumentPreview, type DocumentPreviewProps };
@@ -0,0 +1,30 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+
4
+ interface DocumentPreviewProps {
5
+ open: boolean;
6
+ onOpenChange: (open: boolean) => void;
7
+ title: string;
8
+ src?: string | null;
9
+ loading?: boolean;
10
+ error?: string | null;
11
+ onDownload?: () => void;
12
+ downloading?: boolean;
13
+ downloadLabel?: string;
14
+ fallback?: ReactNode;
15
+ }
16
+ /**
17
+ * Responsive, presentation-only shell for a browser-renderable document.
18
+ *
19
+ * The consumer owns authentication and URL acquisition; `src` is expected to
20
+ * be a short-lived or otherwise safe URL. Desktop uses the kit's large preview
21
+ * dialog and mobile uses its near-full-height drawer. PDF rendering is left to
22
+ * the browser so this primitive adds no PDF engine to every consuming app.
23
+ *
24
+ * Every `src` opens in the browser's own viewer. For a file that may be an
25
+ * image, text, Markdown or media, use `FilePreview`
26
+ * (`primitives/file-preview`): the same dialog, showing each type its own way.
27
+ */
28
+ declare function DocumentPreview({ open, onOpenChange, title, src, loading, error, onDownload, downloading, downloadLabel, fallback, }: DocumentPreviewProps): react_jsx_runtime.JSX.Element;
29
+
30
+ export { DocumentPreview, type DocumentPreviewProps };
@@ -0,0 +1,54 @@
1
+ "use client";
2
+ "use client";
3
+ import {
4
+ PreviewDialog,
5
+ PreviewLoading,
6
+ PreviewNotice,
7
+ PreviewStage
8
+ } from "../chunk-2TKLS73N.js";
9
+ import "../chunk-JTI4244T.js";
10
+ import "../chunk-4HWCNRK4.js";
11
+ import "../chunk-3QT5VYZ3.js";
12
+ import "../chunk-KN4RPX35.js";
13
+ import "../chunk-HQRWRRZJ.js";
14
+ import "../chunk-G6SRSWXB.js";
15
+
16
+ // src/primitives/document-preview.tsx
17
+ import { FileWarning } from "lucide-react";
18
+ import { jsx } from "react/jsx-runtime";
19
+ function DocumentPreview({
20
+ open,
21
+ onOpenChange,
22
+ title,
23
+ src,
24
+ loading = false,
25
+ error,
26
+ onDownload,
27
+ downloading = false,
28
+ downloadLabel = "Download document",
29
+ fallback
30
+ }) {
31
+ return /* @__PURE__ */ jsx(
32
+ PreviewDialog,
33
+ {
34
+ open,
35
+ onOpenChange,
36
+ title,
37
+ onDownload,
38
+ downloading,
39
+ downloadLabel,
40
+ children: /* @__PURE__ */ jsx(PreviewStage, { children: loading ? /* @__PURE__ */ jsx(PreviewLoading, { label: "Loading preview\u2026" }) : error ? /* @__PURE__ */ jsx(PreviewNotice, { icon: FileWarning, alert: true, message: error, children: fallback }) : src ? /* @__PURE__ */ jsx(
41
+ "iframe",
42
+ {
43
+ src,
44
+ title: `Preview of ${title}`,
45
+ referrerPolicy: "no-referrer",
46
+ className: "h-full w-full border-0 bg-background"
47
+ }
48
+ ) : fallback ?? /* @__PURE__ */ jsx("div", { className: "p-6 text-center text-sm text-muted-foreground", children: "Preview unavailable." }) })
49
+ }
50
+ );
51
+ }
52
+ export {
53
+ DocumentPreview
54
+ };
@@ -0,0 +1,20 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
+ "use client";
3
+
4
+
5
+
6
+
7
+
8
+ var _chunkGRY77463cjs = require('../chunk-GRY77463.cjs');
9
+ require('../chunk-BTHYGHOH.cjs');
10
+ require('../chunk-2BHI5ZWJ.cjs');
11
+ require('../chunk-WDXEJDMO.cjs');
12
+ require('../chunk-T2ZFSPE4.cjs');
13
+ require('../chunk-L4DH72UF.cjs');
14
+ require('../chunk-KWLSBTB2.cjs');
15
+
16
+
17
+
18
+
19
+
20
+ exports.PreviewDialog = _chunkGRY77463cjs.PreviewDialog; exports.PreviewLoading = _chunkGRY77463cjs.PreviewLoading; exports.PreviewNotice = _chunkGRY77463cjs.PreviewNotice; exports.PreviewStage = _chunkGRY77463cjs.PreviewStage;
@@ -0,0 +1,44 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { LucideIcon } from 'lucide-react';
3
+ import { ReactNode } from 'react';
4
+
5
+ interface PreviewDialogProps {
6
+ open: boolean;
7
+ onOpenChange: (open: boolean) => void;
8
+ title: string;
9
+ onDownload?: () => void;
10
+ downloading: boolean;
11
+ downloadLabel: string;
12
+ children: ReactNode;
13
+ }
14
+ /**
15
+ * The kit's large preview dialog on desktop and its near-full-height drawer
16
+ * on mobile, with the file's name, a download action when there is one, and
17
+ * a close button in the header.
18
+ */
19
+ declare function PreviewDialog({ open, onOpenChange, title, onDownload, downloading, downloadLabel, children, }: PreviewDialogProps): react_jsx_runtime.JSX.Element;
20
+ /**
21
+ * The area under the header. `center` holds one thing in the middle (a
22
+ * frame, an image, a player, a message); `scroll` is a page of text that
23
+ * scrolls inside the dialog, a named region that takes focus so the keyboard
24
+ * can scroll it too.
25
+ */
26
+ declare function PreviewStage({ layout, label, children, }: {
27
+ layout?: "center" | "scroll";
28
+ /** The scrolling region's accessible name. */
29
+ label?: string;
30
+ children: ReactNode;
31
+ }): react_jsx_runtime.JSX.Element;
32
+ declare function PreviewLoading({ label }: {
33
+ label: string;
34
+ }): react_jsx_runtime.JSX.Element;
35
+ /** A message in place of the preview: why there is none, with what to do instead under it. */
36
+ declare function PreviewNotice({ icon, alert, message, children, }: {
37
+ icon: LucideIcon;
38
+ /** Announce it: the preview failed. */
39
+ alert?: boolean;
40
+ message: ReactNode;
41
+ children?: ReactNode;
42
+ }): react_jsx_runtime.JSX.Element;
43
+
44
+ export { PreviewDialog, type PreviewDialogProps, PreviewLoading, PreviewNotice, PreviewStage };
@@ -0,0 +1,44 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { LucideIcon } from 'lucide-react';
3
+ import { ReactNode } from 'react';
4
+
5
+ interface PreviewDialogProps {
6
+ open: boolean;
7
+ onOpenChange: (open: boolean) => void;
8
+ title: string;
9
+ onDownload?: () => void;
10
+ downloading: boolean;
11
+ downloadLabel: string;
12
+ children: ReactNode;
13
+ }
14
+ /**
15
+ * The kit's large preview dialog on desktop and its near-full-height drawer
16
+ * on mobile, with the file's name, a download action when there is one, and
17
+ * a close button in the header.
18
+ */
19
+ declare function PreviewDialog({ open, onOpenChange, title, onDownload, downloading, downloadLabel, children, }: PreviewDialogProps): react_jsx_runtime.JSX.Element;
20
+ /**
21
+ * The area under the header. `center` holds one thing in the middle (a
22
+ * frame, an image, a player, a message); `scroll` is a page of text that
23
+ * scrolls inside the dialog, a named region that takes focus so the keyboard
24
+ * can scroll it too.
25
+ */
26
+ declare function PreviewStage({ layout, label, children, }: {
27
+ layout?: "center" | "scroll";
28
+ /** The scrolling region's accessible name. */
29
+ label?: string;
30
+ children: ReactNode;
31
+ }): react_jsx_runtime.JSX.Element;
32
+ declare function PreviewLoading({ label }: {
33
+ label: string;
34
+ }): react_jsx_runtime.JSX.Element;
35
+ /** A message in place of the preview: why there is none, with what to do instead under it. */
36
+ declare function PreviewNotice({ icon, alert, message, children, }: {
37
+ icon: LucideIcon;
38
+ /** Announce it: the preview failed. */
39
+ alert?: boolean;
40
+ message: ReactNode;
41
+ children?: ReactNode;
42
+ }): react_jsx_runtime.JSX.Element;
43
+
44
+ export { PreviewDialog, type PreviewDialogProps, PreviewLoading, PreviewNotice, PreviewStage };
@@ -0,0 +1,20 @@
1
+ "use client";
2
+ "use client";
3
+ import {
4
+ PreviewDialog,
5
+ PreviewLoading,
6
+ PreviewNotice,
7
+ PreviewStage
8
+ } from "../chunk-2TKLS73N.js";
9
+ import "../chunk-JTI4244T.js";
10
+ import "../chunk-4HWCNRK4.js";
11
+ import "../chunk-3QT5VYZ3.js";
12
+ import "../chunk-KN4RPX35.js";
13
+ import "../chunk-HQRWRRZJ.js";
14
+ import "../chunk-G6SRSWXB.js";
15
+ export {
16
+ PreviewDialog,
17
+ PreviewLoading,
18
+ PreviewNotice,
19
+ PreviewStage
20
+ };