@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,134 +1,18 @@
1
1
  "use client";
2
2
  import {
3
- Drawer,
4
- DrawerClose,
5
- DrawerContent,
6
- DrawerDescription,
7
- DrawerFooter,
8
- DrawerHeader,
9
- DrawerTitle,
10
- DrawerTrigger
11
- } from "../chunk-4HWCNRK4.js";
12
- import {
13
- Dialog,
14
- DialogClose,
15
- DialogContent,
16
- DialogDescription,
17
- DialogFooter,
18
- DialogHeader,
19
- DialogTitle,
20
- DialogTrigger
21
- } from "../chunk-3QT5VYZ3.js";
22
- import {
23
- cn
24
- } from "../chunk-G6SRSWXB.js";
25
-
26
- // src/primitives/responsive-dialog.tsx
27
- import * as React from "react";
28
- import { useMediaQuery } from "react-responsive";
29
- import { jsx } from "react/jsx-runtime";
30
- var DesktopContext = React.createContext(false);
31
- var useIsDesktop = () => React.useContext(DesktopContext);
32
- var DESKTOP_QUERY = { minWidth: 1024 };
33
- var ResponsiveDialog = ({ children, ...props }) => {
34
- const isDesktop = useMediaQuery(DESKTOP_QUERY);
35
- const Root = isDesktop ? Dialog : Drawer;
36
- return /* @__PURE__ */ jsx(DesktopContext.Provider, { value: isDesktop, children: /* @__PURE__ */ jsx(Root, { ...props, children }) });
37
- };
38
- ResponsiveDialog.displayName = "ResponsiveDialog";
39
- var ResponsiveDialogTrigger = ({
40
- children,
41
- ...props
42
- }) => {
43
- const Trigger = useIsDesktop() ? DialogTrigger : DrawerTrigger;
44
- return /* @__PURE__ */ jsx(Trigger, { ...props, children });
45
- };
46
- ResponsiveDialogTrigger.displayName = "ResponsiveDialogTrigger";
47
- var ResponsiveDialogClose = ({
48
- children,
49
- ...props
50
- }) => {
51
- const Close = useIsDesktop() ? DialogClose : DrawerClose;
52
- return /* @__PURE__ */ jsx(Close, { ...props, children });
53
- };
54
- ResponsiveDialogClose.displayName = "ResponsiveDialogClose";
55
- var ResponsiveDialogContent = React.forwardRef(({ className, children, presentation = "default", ...props }, ref) => {
56
- if (useIsDesktop()) {
57
- return /* @__PURE__ */ jsx(
58
- DialogContent,
59
- {
60
- ref,
61
- className: cn(
62
- "flex max-h-[85vh] max-w-md flex-col gap-0 overflow-hidden p-0",
63
- presentation === "preview" && "max-w-2xl sm:h-[85vh] [&>button:last-child]:hidden",
64
- className
65
- ),
66
- ...props,
67
- children
68
- }
69
- );
70
- }
71
- return /* @__PURE__ */ jsx(
72
- DrawerContent,
73
- {
74
- ref,
75
- className: cn("max-h-[92vh]", className),
76
- ...props,
77
- children
78
- }
79
- );
80
- });
81
- ResponsiveDialogContent.displayName = "ResponsiveDialogContent";
82
- var ResponsiveDialogHeader = ({
83
- className,
84
- visibility = "visible",
85
- ...props
86
- }) => {
87
- const Header = useIsDesktop() ? DialogHeader : DrawerHeader;
88
- return /* @__PURE__ */ jsx(
89
- Header,
90
- {
91
- className: cn(useIsDesktop() && "p-4", visibility === "screen-reader" && "sr-only", className),
92
- ...props
93
- }
94
- );
95
- };
96
- ResponsiveDialogHeader.displayName = "ResponsiveDialogHeader";
97
- var ResponsiveDialogBody = ({
98
- className,
99
- ...props
100
- }) => /* @__PURE__ */ jsx("div", { className: cn("min-h-0 flex-1 overflow-y-auto px-4 pb-6", className), ...props });
101
- ResponsiveDialogBody.displayName = "ResponsiveDialogBody";
102
- var ResponsiveDialogFooter = ({
103
- className,
104
- layout = "auto",
105
- ...props
106
- }) => {
107
- const isDesktop = useIsDesktop();
108
- const Footer = isDesktop ? DialogFooter : DrawerFooter;
109
- return /* @__PURE__ */ jsx(
110
- Footer,
111
- {
112
- className: cn(
113
- "mt-0 shrink-0 gap-2 border-t bg-background p-4",
114
- layout === "fill" ? "flex-row space-x-0 [&>*]:min-w-0 [&>*]:flex-1" : isDesktop ? "flex-row justify-end space-x-0 [&>*]:flex-none" : "grid grid-cols-2 [&>*]:w-full",
115
- className
116
- ),
117
- ...props
118
- }
119
- );
120
- };
121
- ResponsiveDialogFooter.displayName = "ResponsiveDialogFooter";
122
- var ResponsiveDialogTitle = React.forwardRef(({ className, visuallyHidden = false, ...props }, ref) => {
123
- const Title = useIsDesktop() ? DialogTitle : DrawerTitle;
124
- return /* @__PURE__ */ jsx(Title, { ref, className: cn(visuallyHidden && "sr-only", className), ...props });
125
- });
126
- ResponsiveDialogTitle.displayName = "ResponsiveDialogTitle";
127
- var ResponsiveDialogDescription = React.forwardRef(({ className, visuallyHidden = false, ...props }, ref) => {
128
- const Description = useIsDesktop() ? DialogDescription : DrawerDescription;
129
- return /* @__PURE__ */ jsx(Description, { ref, className: cn(visuallyHidden && "sr-only", className), ...props });
130
- });
131
- ResponsiveDialogDescription.displayName = "ResponsiveDialogDescription";
3
+ ResponsiveDialog,
4
+ ResponsiveDialogBody,
5
+ ResponsiveDialogClose,
6
+ ResponsiveDialogContent,
7
+ ResponsiveDialogDescription,
8
+ ResponsiveDialogFooter,
9
+ ResponsiveDialogHeader,
10
+ ResponsiveDialogTitle,
11
+ ResponsiveDialogTrigger
12
+ } from "../chunk-JTI4244T.js";
13
+ import "../chunk-4HWCNRK4.js";
14
+ import "../chunk-3QT5VYZ3.js";
15
+ import "../chunk-G6SRSWXB.js";
132
16
  export {
133
17
  ResponsiveDialog,
134
18
  ResponsiveDialogBody,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epicbagel/saas-kit",
3
- "version": "1.2.2",
3
+ "version": "1.3.0",
4
4
  "description": "Accessible React primitives, layout components and design tokens for SaaS apps, built on Radix UI and Tailwind CSS v4.",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -410,6 +410,16 @@
410
410
  "default": "./dist/primitives/dialog.cjs"
411
411
  }
412
412
  },
413
+ "./primitives/document-preview": {
414
+ "import": {
415
+ "types": "./dist/primitives/document-preview.d.ts",
416
+ "default": "./dist/primitives/document-preview.js"
417
+ },
418
+ "require": {
419
+ "types": "./dist/primitives/document-preview.d.cts",
420
+ "default": "./dist/primitives/document-preview.cjs"
421
+ }
422
+ },
413
423
  "./primitives/drawer": {
414
424
  "import": {
415
425
  "types": "./dist/primitives/drawer.d.ts",
@@ -490,6 +500,16 @@
490
500
  "default": "./dist/primitives/file-dropzone.cjs"
491
501
  }
492
502
  },
503
+ "./primitives/file-preview": {
504
+ "import": {
505
+ "types": "./dist/primitives/file-preview.d.ts",
506
+ "default": "./dist/primitives/file-preview.js"
507
+ },
508
+ "require": {
509
+ "types": "./dist/primitives/file-preview.d.cts",
510
+ "default": "./dist/primitives/file-preview.cjs"
511
+ }
512
+ },
493
513
  "./primitives/filter-bar": {
494
514
  "import": {
495
515
  "types": "./dist/primitives/filter-bar.d.ts",