@popgrids/ui 0.0.14 → 0.0.15
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/dist/dialog.cjs +11 -11
- package/dist/dialog.cjs.map +1 -1
- package/dist/dialog.d.cts +1 -1
- package/dist/dialog.d.ts +1 -1
- package/dist/dialog.js +1 -1
- package/dist/dialog.js.map +1 -1
- package/dist/index.cjs +15 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/package.json +7 -6
package/dist/dialog.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var dialog = require('@base-ui/react/dialog');
|
|
4
4
|
var icons = require('@untitledui/icons');
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var tailwindMerge = require('tailwind-merge');
|
|
@@ -10,23 +10,23 @@ function cn(...inputs) {
|
|
|
10
10
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
11
11
|
}
|
|
12
12
|
function DialogRoot(props) {
|
|
13
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
13
|
+
return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Root, { ...props });
|
|
14
14
|
}
|
|
15
15
|
function DialogPortal(props) {
|
|
16
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16
|
+
return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Portal, { ...props });
|
|
17
17
|
}
|
|
18
18
|
function DialogTrigger(props) {
|
|
19
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19
|
+
return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Trigger, { ...props });
|
|
20
20
|
}
|
|
21
21
|
function DialogClose(props) {
|
|
22
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
22
|
+
return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Close, { ...props });
|
|
23
23
|
}
|
|
24
24
|
function DialogBackdrop({
|
|
25
25
|
className,
|
|
26
26
|
...props
|
|
27
27
|
}) {
|
|
28
28
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
29
|
-
|
|
29
|
+
dialog.Dialog.Backdrop,
|
|
30
30
|
{
|
|
31
31
|
className: cn(
|
|
32
32
|
"fixed inset-0 min-h-dvh bg-[rgb(0_0_32/0.01)] opacity-0 backdrop-blur-sm transition-[opacity,backdrop-filter] duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-[-webkit-touch-callout:none]:absolute dark:bg-[rgb(255_255_255/0.01)] dark:opacity-70",
|
|
@@ -42,7 +42,7 @@ function DialogViewport({
|
|
|
42
42
|
...props
|
|
43
43
|
}) {
|
|
44
44
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
45
|
-
|
|
45
|
+
dialog.Dialog.Viewport,
|
|
46
46
|
{
|
|
47
47
|
className: cn(
|
|
48
48
|
"fixed inset-0 flex items-center justify-center overflow-hidden py-6 [@media(min-height:600px)]:pt-8 [@media(min-height:600px)]:pb-12",
|
|
@@ -59,9 +59,9 @@ function DialogPopup({
|
|
|
59
59
|
showCloseButton = true,
|
|
60
60
|
...props
|
|
61
61
|
}) {
|
|
62
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
62
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(dialog.Dialog.Portal, { children: [
|
|
63
63
|
/* @__PURE__ */ jsxRuntime.jsx(DialogBackdrop, {}),
|
|
64
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
64
|
+
/* @__PURE__ */ jsxRuntime.jsxs(dialog.Dialog.Popup, { className: "group/popup pointer-events-none flex h-full max-h-full min-h-0 w-full max-w-full justify-center overflow-hidden transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0", children: [
|
|
65
65
|
showCloseButton && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
66
66
|
DialogClose,
|
|
67
67
|
{
|
|
@@ -99,7 +99,7 @@ function DialogFooter({ className, ...props }) {
|
|
|
99
99
|
}
|
|
100
100
|
function DialogTitle({ className, ...props }) {
|
|
101
101
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
102
|
-
|
|
102
|
+
dialog.Dialog.Title,
|
|
103
103
|
{
|
|
104
104
|
className: cn("text-lg leading-none font-semibold", className),
|
|
105
105
|
...props
|
|
@@ -111,7 +111,7 @@ function DialogDescription({
|
|
|
111
111
|
...props
|
|
112
112
|
}) {
|
|
113
113
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
114
|
-
|
|
114
|
+
dialog.Dialog.Description,
|
|
115
115
|
{
|
|
116
116
|
className: cn("text-muted-foreground text-sm", className),
|
|
117
117
|
...props
|
package/dist/dialog.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/utils.ts","../src/components/dialog/dialog.tsx"],"names":["twMerge","clsx","jsx","DialogPrimitive","jsxs","XClose"],"mappings":";;;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAOA,qBAAA,CAAQC,SAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACKA,SAAS,WAAW,KAAA,EAA0D;AAC5E,EAAA,uBAAOC,cAAA,CAACC,YAAA,CAAgB,IAAA,EAAhB,EAAsB,GAAG,KAAA,EAAO,CAAA;AAC1C;AAMA,SAAS,aAAa,KAAA,EAA4D;AAChF,EAAA,uBAAOD,cAAA,CAACC,YAAA,CAAgB,MAAA,EAAhB,EAAwB,GAAG,KAAA,EAAO,CAAA;AAC5C;AAMA,SAAS,cAAc,KAAA,EAA6D;AAClF,EAAA,uBAAOD,cAAA,CAACC,YAAA,CAAgB,OAAA,EAAhB,EAAyB,GAAG,KAAA,EAAO,CAAA;AAC7C;AAMA,SAAS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A,EAA6D;AAC3D,EAAA,uBACED,cAAA;AAAA,IAACC,YAAA,CAAgB,WAAA;AAAA,IAAhB;AAAA,MACC,SAAA,EAAW,EAAA,CAAG,+BAAA,EAAiC,SAAS,CAAA;AAAA,MACvD,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,WAAW,EAAE,SAAA,EAAW,QAAA,EAAU,GAAG,OAAM,EAAgC;AAClF,EAAA,uBACED,cAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,EAAA,CAAG,8DAAA,EAAgE,SAAS,CAAA;AAAA,MACtF,GAAG,KAAA;AAAA,MAEJ,QAAA,kBAAAA,cAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,uFAAA,EACZ,QAAA,EACH;AAAA;AAAA,GACF;AAEJ","file":"dialog.cjs","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport { Dialog as DialogPrimitive } from \"@base-ui/react\";\nimport { XClose } from \"@untitledui/icons\";\nimport { cn } from \"../../lib/utils\";\n\n/* ---------------------------------------------\n * Root\n * --------------------------------------------- */\n\nfunction DialogRoot(props: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root {...props} />;\n}\n\n/* ---------------------------------------------\n * Portal\n * --------------------------------------------- */\n\nfunction DialogPortal(props: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal {...props} />;\n}\n\n/* ---------------------------------------------\n * Trigger\n * --------------------------------------------- */\n\nfunction DialogTrigger(props: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger {...props} />;\n}\n\n/* ---------------------------------------------\n * Close\n * --------------------------------------------- */\n\nfunction DialogClose(props: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close {...props} />;\n}\n\n/* ---------------------------------------------\n * Overlay (Backdrop)\n * --------------------------------------------- */\n\nfunction DialogBackdrop({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Backdrop>) {\n return (\n <DialogPrimitive.Backdrop\n className={cn(\n \"fixed inset-0 min-h-dvh bg-[rgb(0_0_32/0.01)] opacity-0 backdrop-blur-sm transition-[opacity,backdrop-filter] duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-[-webkit-touch-callout:none]:absolute dark:bg-[rgb(255_255_255/0.01)] dark:opacity-70\",\n \"data-closed:opacity-0 data-open:opacity-100\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogViewport({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Viewport>) {\n return (\n <DialogPrimitive.Viewport\n className={cn(\n \"fixed inset-0 flex items-center justify-center overflow-hidden py-6 [@media(min-height:600px)]:pt-8 [@media(min-height:600px)]:pb-12\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/* ---------------------------------------------\n * Content (Popup)\n * --------------------------------------------- */\n\nfunction DialogPopup({\n className,\n children,\n bottom = false,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Popup> & {\n bottom?: boolean;\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPrimitive.Portal>\n <DialogBackdrop />\n <DialogPrimitive.Popup className=\"group/popup pointer-events-none flex h-full max-h-full min-h-0 w-full max-w-full justify-center overflow-hidden transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0\">\n {showCloseButton && (\n <DialogClose\n className=\"pointer-events-auto fixed top-[15px] left-5 z-50\"\n aria-label=\"Close\"\n >\n <span className=\"sr-only\">Close</span>\n <span className=\"before:bg-tint-700-reversed relative block before:absolute before:-inset-1.5 before:rounded-full before:backdrop-blur-sm\">\n <span className=\"bg-primary-foreground text-background relative z-10 flex size-10 items-center justify-center rounded-full\">\n <XClose className=\"size-[18px]\" />\n </span>\n </span>\n </DialogClose>\n )}\n <div\n className={cn(\n \"bg-background pointer-events-auto fixed top-1/2 left-1/2 flex h-full max-h-[calc(100%-2rem)] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl shadow-2xl transition-all\",\n {\n \"group-data-closed/popup:duration-pop-hover group-data-open/popup:duration-pop-hover group-data-open/popup:ease-pop-hover group-data-closed/popup:ease-out group-data-ending-style/popup:scale-[0.96] group-data-ending-style/popup:opacity-0 group-data-starting-style/popup:scale-[0.96] group-data-starting-style/popup:opacity-0\":\n !bottom,\n \"group-data-open/popup:slide-in-from-bottom group-data-closed/popup:slide-out-to-bottom group-data-starting-style/popup-scale-100 group-data-ending-style/popup-scale-100 group-data-open/popup:animate-in group-data-closed/popup:animate-out top-auto bottom-0 h-full translate-y-0 rounded-b-none group-data-closed/popup:duration-200 group-data-closed/popup:ease-[cubic-bezier(1,0,0.72,0.32)] group-data-ending-style/popup:translate-y-full group-data-open/popup:duration-300 group-data-open/popup:ease-[cubic-bezier(0.32,0.72,0,1)] group-data-starting-style/popup:translate-y-full\":\n bottom,\n },\n className,\n )}\n {...props}\n >\n {children}\n </div>\n </DialogPrimitive.Popup>\n </DialogPrimitive.Portal>\n );\n}\n\n/* ---------------------------------------------\n * Header / Footer\n * --------------------------------------------- */\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)} {...props} />\n );\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div className={cn(\"flex flex-col-reverse gap-2 sm:flex-row\", className)} {...props} />;\n}\n\n/* ---------------------------------------------\n * Title / Description\n * --------------------------------------------- */\n\nfunction DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n className={cn(\"text-lg leading-none font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogBody({ className, children, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n className={cn(\"flex shrink-0 grow basis-0 flex-col items-start self-stretch\", className)}\n {...props}\n >\n <div className=\"flex shrink-0 grow basis-0 flex-col items-start gap-10 self-stretch overflow-auto p-4\">\n {children}\n </div>\n </div>\n );\n}\n/* ---------------------------------------------\n * Exports (preserve your public API)\n * --------------------------------------------- */\n\nexport {\n DialogRoot as Dialog,\n DialogBackdrop,\n DialogBody,\n DialogClose,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogPopup,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n DialogViewport,\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/lib/utils.ts","../src/components/dialog/dialog.tsx"],"names":["twMerge","clsx","jsx","DialogPrimitive","jsxs","XClose"],"mappings":";;;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAOA,qBAAA,CAAQC,SAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACKA,SAAS,WAAW,KAAA,EAA0D;AAC5E,EAAA,uBAAOC,cAAA,CAACC,aAAA,CAAgB,IAAA,EAAhB,EAAsB,GAAG,KAAA,EAAO,CAAA;AAC1C;AAMA,SAAS,aAAa,KAAA,EAA4D;AAChF,EAAA,uBAAOD,cAAA,CAACC,aAAA,CAAgB,MAAA,EAAhB,EAAwB,GAAG,KAAA,EAAO,CAAA;AAC5C;AAMA,SAAS,cAAc,KAAA,EAA6D;AAClF,EAAA,uBAAOD,cAAA,CAACC,aAAA,CAAgB,OAAA,EAAhB,EAAyB,GAAG,KAAA,EAAO,CAAA;AAC7C;AAMA,SAAS,YAAY,KAAA,EAA2D;AAC9E,EAAA,uBAAOD,cAAA,CAACC,aAAA,CAAgB,KAAA,EAAhB,EAAuB,GAAG,KAAA,EAAO,CAAA;AAC3C;AAMA,SAAS,cAAA,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AA;AAAA,MACvD,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,WAAW,EAAE,SAAA,EAAW,QAAA,EAAU,GAAG,OAAM,EAAgC;AAClF,EAAA,uBACED,cAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,EAAA,CAAG,8DAAA,EAAgE,SAAS,CAAA;AAAA,MACtF,GAAG,KAAA;AAAA,MAEJ,QAAA,kBAAAA,cAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,uFAAA,EACZ,QAAA,EACH;AAAA;AAAA,GACF;AAEJ","file":"dialog.cjs","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport { Dialog as DialogPrimitive } from \"@base-ui/react/dialog\";\nimport { XClose } from \"@untitledui/icons\";\nimport { cn } from \"../../lib/utils\";\n\n/* ---------------------------------------------\n * Root\n * --------------------------------------------- */\n\nfunction DialogRoot(props: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root {...props} />;\n}\n\n/* ---------------------------------------------\n * Portal\n * --------------------------------------------- */\n\nfunction DialogPortal(props: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal {...props} />;\n}\n\n/* ---------------------------------------------\n * Trigger\n * --------------------------------------------- */\n\nfunction DialogTrigger(props: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger {...props} />;\n}\n\n/* ---------------------------------------------\n * Close\n * --------------------------------------------- */\n\nfunction DialogClose(props: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close {...props} />;\n}\n\n/* ---------------------------------------------\n * Overlay (Backdrop)\n * --------------------------------------------- */\n\nfunction DialogBackdrop({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Backdrop>) {\n return (\n <DialogPrimitive.Backdrop\n className={cn(\n \"fixed inset-0 min-h-dvh bg-[rgb(0_0_32/0.01)] opacity-0 backdrop-blur-sm transition-[opacity,backdrop-filter] duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-[-webkit-touch-callout:none]:absolute dark:bg-[rgb(255_255_255/0.01)] dark:opacity-70\",\n \"data-closed:opacity-0 data-open:opacity-100\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogViewport({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Viewport>) {\n return (\n <DialogPrimitive.Viewport\n className={cn(\n \"fixed inset-0 flex items-center justify-center overflow-hidden py-6 [@media(min-height:600px)]:pt-8 [@media(min-height:600px)]:pb-12\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/* ---------------------------------------------\n * Content (Popup)\n * --------------------------------------------- */\n\nfunction DialogPopup({\n className,\n children,\n bottom = false,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Popup> & {\n bottom?: boolean;\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPrimitive.Portal>\n <DialogBackdrop />\n <DialogPrimitive.Popup className=\"group/popup pointer-events-none flex h-full max-h-full min-h-0 w-full max-w-full justify-center overflow-hidden transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0\">\n {showCloseButton && (\n <DialogClose\n className=\"pointer-events-auto fixed top-[15px] left-5 z-50\"\n aria-label=\"Close\"\n >\n <span className=\"sr-only\">Close</span>\n <span className=\"before:bg-tint-700-reversed relative block before:absolute before:-inset-1.5 before:rounded-full before:backdrop-blur-sm\">\n <span className=\"bg-primary-foreground text-background relative z-10 flex size-10 items-center justify-center rounded-full\">\n <XClose className=\"size-[18px]\" />\n </span>\n </span>\n </DialogClose>\n )}\n <div\n className={cn(\n \"bg-background pointer-events-auto fixed top-1/2 left-1/2 flex h-full max-h-[calc(100%-2rem)] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl shadow-2xl transition-all\",\n {\n \"group-data-closed/popup:duration-pop-hover group-data-open/popup:duration-pop-hover group-data-open/popup:ease-pop-hover group-data-closed/popup:ease-out group-data-ending-style/popup:scale-[0.96] group-data-ending-style/popup:opacity-0 group-data-starting-style/popup:scale-[0.96] group-data-starting-style/popup:opacity-0\":\n !bottom,\n \"group-data-open/popup:slide-in-from-bottom group-data-closed/popup:slide-out-to-bottom group-data-starting-style/popup-scale-100 group-data-ending-style/popup-scale-100 group-data-open/popup:animate-in group-data-closed/popup:animate-out top-auto bottom-0 h-full translate-y-0 rounded-b-none group-data-closed/popup:duration-200 group-data-closed/popup:ease-[cubic-bezier(1,0,0.72,0.32)] group-data-ending-style/popup:translate-y-full group-data-open/popup:duration-300 group-data-open/popup:ease-[cubic-bezier(0.32,0.72,0,1)] group-data-starting-style/popup:translate-y-full\":\n bottom,\n },\n className,\n )}\n {...props}\n >\n {children}\n </div>\n </DialogPrimitive.Popup>\n </DialogPrimitive.Portal>\n );\n}\n\n/* ---------------------------------------------\n * Header / Footer\n * --------------------------------------------- */\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)} {...props} />\n );\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div className={cn(\"flex flex-col-reverse gap-2 sm:flex-row\", className)} {...props} />;\n}\n\n/* ---------------------------------------------\n * Title / Description\n * --------------------------------------------- */\n\nfunction DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n className={cn(\"text-lg leading-none font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogBody({ className, children, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n className={cn(\"flex shrink-0 grow basis-0 flex-col items-start self-stretch\", className)}\n {...props}\n >\n <div className=\"flex shrink-0 grow basis-0 flex-col items-start gap-10 self-stretch overflow-auto p-4\">\n {children}\n </div>\n </div>\n );\n}\n/* ---------------------------------------------\n * Exports (preserve your public API)\n * --------------------------------------------- */\n\nexport {\n DialogRoot as Dialog,\n DialogBackdrop,\n DialogBody,\n DialogClose,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogPopup,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n DialogViewport\n};\n"]}
|
package/dist/dialog.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { Dialog } from '@base-ui/react';
|
|
2
|
+
import { Dialog } from '@base-ui/react/dialog';
|
|
3
3
|
|
|
4
4
|
declare function DialogRoot(props: React.ComponentProps<typeof Dialog.Root>): react_jsx_runtime.JSX.Element;
|
|
5
5
|
declare function DialogPortal(props: React.ComponentProps<typeof Dialog.Portal>): react_jsx_runtime.JSX.Element;
|
package/dist/dialog.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { Dialog } from '@base-ui/react';
|
|
2
|
+
import { Dialog } from '@base-ui/react/dialog';
|
|
3
3
|
|
|
4
4
|
declare function DialogRoot(props: React.ComponentProps<typeof Dialog.Root>): react_jsx_runtime.JSX.Element;
|
|
5
5
|
declare function DialogPortal(props: React.ComponentProps<typeof Dialog.Portal>): react_jsx_runtime.JSX.Element;
|
package/dist/dialog.js
CHANGED
package/dist/dialog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/utils.ts","../src/components/dialog/dialog.tsx"],"names":["DialogPrimitive"],"mappings":";;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CA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AC,SAAI,SAAA,EAAW,EAAA,CAAG,2CAA2C,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO,CAAA;AAC9F;AAMA,SAAS,WAAA,CAAY,EAAE,SAAA,EAAW,GAAG,OAAM,EAAuD;AAChG,EAAA,uBACE,GAAA;AAAA,IAACA,MAAA,CAAgB,KAAA;AAAA,IAAhB;AAAA,MACC,SAAA,EAAW,EAAA,CAAG,oCAAA,EAAsC,SAAS,CAAA;AAAA,MAC5D,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,iBAAA,CAAkB;AAAA,EACzB,SAAA;AAAA,EACA,GAAG;AACL,CAAA,EAA6D;AAC3D,EAAA,uBACE,GAAA;AAAA,IAACA,MAAA,CAAgB,WAAA;AAAA,IAAhB;AAAA,MACC,SAAA,EAAW,EAAA,CAAG,+BAAA,EAAiC,SAAS,CAAA;AAAA,MACvD,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,WAAW,EAAE,SAAA,EAAW,QAAA,EAAU,GAAG,OAAM,EAAgC;AAClF,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,EAAA,CAAG,8DAAA,EAAgE,SAAS,CAAA;AAAA,MACtF,GAAG,KAAA;AAAA,MAEJ,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,uFAAA,EACZ,QAAA,EACH;AAAA;AAAA,GACF;AAEJ","file":"dialog.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport { Dialog as DialogPrimitive } from \"@base-ui/react\";\nimport { XClose } from \"@untitledui/icons\";\nimport { cn } from \"../../lib/utils\";\n\n/* ---------------------------------------------\n * Root\n * --------------------------------------------- */\n\nfunction DialogRoot(props: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root {...props} />;\n}\n\n/* ---------------------------------------------\n * Portal\n * --------------------------------------------- */\n\nfunction DialogPortal(props: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal {...props} />;\n}\n\n/* ---------------------------------------------\n * Trigger\n * --------------------------------------------- */\n\nfunction DialogTrigger(props: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger {...props} />;\n}\n\n/* ---------------------------------------------\n * Close\n * --------------------------------------------- */\n\nfunction DialogClose(props: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close {...props} />;\n}\n\n/* ---------------------------------------------\n * Overlay (Backdrop)\n * --------------------------------------------- */\n\nfunction DialogBackdrop({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Backdrop>) {\n return (\n <DialogPrimitive.Backdrop\n className={cn(\n \"fixed inset-0 min-h-dvh bg-[rgb(0_0_32/0.01)] opacity-0 backdrop-blur-sm transition-[opacity,backdrop-filter] duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-[-webkit-touch-callout:none]:absolute dark:bg-[rgb(255_255_255/0.01)] dark:opacity-70\",\n \"data-closed:opacity-0 data-open:opacity-100\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogViewport({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Viewport>) {\n return (\n <DialogPrimitive.Viewport\n className={cn(\n \"fixed inset-0 flex items-center justify-center overflow-hidden py-6 [@media(min-height:600px)]:pt-8 [@media(min-height:600px)]:pb-12\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/* ---------------------------------------------\n * Content (Popup)\n * --------------------------------------------- */\n\nfunction DialogPopup({\n className,\n children,\n bottom = false,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Popup> & {\n bottom?: boolean;\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPrimitive.Portal>\n <DialogBackdrop />\n <DialogPrimitive.Popup className=\"group/popup pointer-events-none flex h-full max-h-full min-h-0 w-full max-w-full justify-center overflow-hidden transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0\">\n {showCloseButton && (\n <DialogClose\n className=\"pointer-events-auto fixed top-[15px] left-5 z-50\"\n aria-label=\"Close\"\n >\n <span className=\"sr-only\">Close</span>\n <span className=\"before:bg-tint-700-reversed relative block before:absolute before:-inset-1.5 before:rounded-full before:backdrop-blur-sm\">\n <span className=\"bg-primary-foreground text-background relative z-10 flex size-10 items-center justify-center rounded-full\">\n <XClose className=\"size-[18px]\" />\n </span>\n </span>\n </DialogClose>\n )}\n <div\n className={cn(\n \"bg-background pointer-events-auto fixed top-1/2 left-1/2 flex h-full max-h-[calc(100%-2rem)] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl shadow-2xl transition-all\",\n {\n \"group-data-closed/popup:duration-pop-hover group-data-open/popup:duration-pop-hover group-data-open/popup:ease-pop-hover group-data-closed/popup:ease-out group-data-ending-style/popup:scale-[0.96] group-data-ending-style/popup:opacity-0 group-data-starting-style/popup:scale-[0.96] group-data-starting-style/popup:opacity-0\":\n !bottom,\n \"group-data-open/popup:slide-in-from-bottom group-data-closed/popup:slide-out-to-bottom group-data-starting-style/popup-scale-100 group-data-ending-style/popup-scale-100 group-data-open/popup:animate-in group-data-closed/popup:animate-out top-auto bottom-0 h-full translate-y-0 rounded-b-none group-data-closed/popup:duration-200 group-data-closed/popup:ease-[cubic-bezier(1,0,0.72,0.32)] group-data-ending-style/popup:translate-y-full group-data-open/popup:duration-300 group-data-open/popup:ease-[cubic-bezier(0.32,0.72,0,1)] group-data-starting-style/popup:translate-y-full\":\n bottom,\n },\n className,\n )}\n {...props}\n >\n {children}\n </div>\n </DialogPrimitive.Popup>\n </DialogPrimitive.Portal>\n );\n}\n\n/* ---------------------------------------------\n * Header / Footer\n * --------------------------------------------- */\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)} {...props} />\n );\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div className={cn(\"flex flex-col-reverse gap-2 sm:flex-row\", className)} {...props} />;\n}\n\n/* ---------------------------------------------\n * Title / Description\n * --------------------------------------------- */\n\nfunction DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n className={cn(\"text-lg leading-none font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogBody({ className, children, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n className={cn(\"flex shrink-0 grow basis-0 flex-col items-start self-stretch\", className)}\n {...props}\n >\n <div className=\"flex shrink-0 grow basis-0 flex-col items-start gap-10 self-stretch overflow-auto p-4\">\n {children}\n </div>\n </div>\n );\n}\n/* ---------------------------------------------\n * Exports (preserve your public API)\n * --------------------------------------------- */\n\nexport {\n DialogRoot as Dialog,\n DialogBackdrop,\n DialogBody,\n DialogClose,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogPopup,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n DialogViewport,\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/lib/utils.ts","../src/components/dialog/dialog.tsx"],"names":["DialogPrimitive"],"mappings":";;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACKA,SAAS,WAAW,KAAA,EAA0D;AAC5E,EAAA,uBAAO,GAAA,CAACA,MAAA,CAAgB,IAAA,EAAhB,EAAsB,GAAG,KAAA,EAAO,CAAA;AAC1C;AAMA,SAAS,aAAa,KAAA,EAA4D;AAChF,EAAA,uB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AA,CAAgB,KAAA;AAAA,IAAhB;AAAA,MACC,SAAA,EAAW,EAAA,CAAG,oCAAA,EAAsC,SAAS,CAAA;AAAA,MAC5D,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,iBAAA,CAAkB;AAAA,EACzB,SAAA;AAAA,EACA,GAAG;AACL,CAAA,EAA6D;AAC3D,EAAA,uBACE,GAAA;AAAA,IAACA,MAAA,CAAgB,WAAA;AAAA,IAAhB;AAAA,MACC,SAAA,EAAW,EAAA,CAAG,+BAAA,EAAiC,SAAS,CAAA;AAAA,MACvD,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,WAAW,EAAE,SAAA,EAAW,QAAA,EAAU,GAAG,OAAM,EAAgC;AAClF,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,EAAA,CAAG,8DAAA,EAAgE,SAAS,CAAA;AAAA,MACtF,GAAG,KAAA;AAAA,MAEJ,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,uFAAA,EACZ,QAAA,EACH;AAAA;AAAA,GACF;AAEJ","file":"dialog.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport { Dialog as DialogPrimitive } from \"@base-ui/react/dialog\";\nimport { XClose } from \"@untitledui/icons\";\nimport { cn } from \"../../lib/utils\";\n\n/* ---------------------------------------------\n * Root\n * --------------------------------------------- */\n\nfunction DialogRoot(props: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root {...props} />;\n}\n\n/* ---------------------------------------------\n * Portal\n * --------------------------------------------- */\n\nfunction DialogPortal(props: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal {...props} />;\n}\n\n/* ---------------------------------------------\n * Trigger\n * --------------------------------------------- */\n\nfunction DialogTrigger(props: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger {...props} />;\n}\n\n/* ---------------------------------------------\n * Close\n * --------------------------------------------- */\n\nfunction DialogClose(props: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close {...props} />;\n}\n\n/* ---------------------------------------------\n * Overlay (Backdrop)\n * --------------------------------------------- */\n\nfunction DialogBackdrop({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Backdrop>) {\n return (\n <DialogPrimitive.Backdrop\n className={cn(\n \"fixed inset-0 min-h-dvh bg-[rgb(0_0_32/0.01)] opacity-0 backdrop-blur-sm transition-[opacity,backdrop-filter] duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-[-webkit-touch-callout:none]:absolute dark:bg-[rgb(255_255_255/0.01)] dark:opacity-70\",\n \"data-closed:opacity-0 data-open:opacity-100\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogViewport({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Viewport>) {\n return (\n <DialogPrimitive.Viewport\n className={cn(\n \"fixed inset-0 flex items-center justify-center overflow-hidden py-6 [@media(min-height:600px)]:pt-8 [@media(min-height:600px)]:pb-12\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/* ---------------------------------------------\n * Content (Popup)\n * --------------------------------------------- */\n\nfunction DialogPopup({\n className,\n children,\n bottom = false,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Popup> & {\n bottom?: boolean;\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPrimitive.Portal>\n <DialogBackdrop />\n <DialogPrimitive.Popup className=\"group/popup pointer-events-none flex h-full max-h-full min-h-0 w-full max-w-full justify-center overflow-hidden transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0\">\n {showCloseButton && (\n <DialogClose\n className=\"pointer-events-auto fixed top-[15px] left-5 z-50\"\n aria-label=\"Close\"\n >\n <span className=\"sr-only\">Close</span>\n <span className=\"before:bg-tint-700-reversed relative block before:absolute before:-inset-1.5 before:rounded-full before:backdrop-blur-sm\">\n <span className=\"bg-primary-foreground text-background relative z-10 flex size-10 items-center justify-center rounded-full\">\n <XClose className=\"size-[18px]\" />\n </span>\n </span>\n </DialogClose>\n )}\n <div\n className={cn(\n \"bg-background pointer-events-auto fixed top-1/2 left-1/2 flex h-full max-h-[calc(100%-2rem)] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl shadow-2xl transition-all\",\n {\n \"group-data-closed/popup:duration-pop-hover group-data-open/popup:duration-pop-hover group-data-open/popup:ease-pop-hover group-data-closed/popup:ease-out group-data-ending-style/popup:scale-[0.96] group-data-ending-style/popup:opacity-0 group-data-starting-style/popup:scale-[0.96] group-data-starting-style/popup:opacity-0\":\n !bottom,\n \"group-data-open/popup:slide-in-from-bottom group-data-closed/popup:slide-out-to-bottom group-data-starting-style/popup-scale-100 group-data-ending-style/popup-scale-100 group-data-open/popup:animate-in group-data-closed/popup:animate-out top-auto bottom-0 h-full translate-y-0 rounded-b-none group-data-closed/popup:duration-200 group-data-closed/popup:ease-[cubic-bezier(1,0,0.72,0.32)] group-data-ending-style/popup:translate-y-full group-data-open/popup:duration-300 group-data-open/popup:ease-[cubic-bezier(0.32,0.72,0,1)] group-data-starting-style/popup:translate-y-full\":\n bottom,\n },\n className,\n )}\n {...props}\n >\n {children}\n </div>\n </DialogPrimitive.Popup>\n </DialogPrimitive.Portal>\n );\n}\n\n/* ---------------------------------------------\n * Header / Footer\n * --------------------------------------------- */\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)} {...props} />\n );\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div className={cn(\"flex flex-col-reverse gap-2 sm:flex-row\", className)} {...props} />;\n}\n\n/* ---------------------------------------------\n * Title / Description\n * --------------------------------------------- */\n\nfunction DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n className={cn(\"text-lg leading-none font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogBody({ className, children, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n className={cn(\"flex shrink-0 grow basis-0 flex-col items-start self-stretch\", className)}\n {...props}\n >\n <div className=\"flex shrink-0 grow basis-0 flex-col items-start gap-10 self-stretch overflow-auto p-4\">\n {children}\n </div>\n </div>\n );\n}\n/* ---------------------------------------------\n * Exports (preserve your public API)\n * --------------------------------------------- */\n\nexport {\n DialogRoot as Dialog,\n DialogBackdrop,\n DialogBody,\n DialogClose,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogPopup,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n DialogViewport\n};\n"]}
|
package/dist/index.cjs
CHANGED
|
@@ -5,13 +5,13 @@ var classVarianceAuthority = require('class-variance-authority');
|
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var tailwindMerge = require('tailwind-merge');
|
|
7
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
-
var
|
|
8
|
+
var dialog = require('@base-ui/react/dialog');
|
|
9
9
|
var icons = require('@untitledui/icons');
|
|
10
10
|
var menu = require('@base-ui/react/menu');
|
|
11
11
|
var input = require('@base-ui/react/input');
|
|
12
12
|
var mergeProps = require('@base-ui/react/merge-props');
|
|
13
13
|
var useRender = require('@base-ui/react/use-render');
|
|
14
|
-
var react
|
|
14
|
+
var react = require('react');
|
|
15
15
|
var tooltip = require('@base-ui/react/tooltip');
|
|
16
16
|
|
|
17
17
|
// src/components/button/button.tsx
|
|
@@ -276,23 +276,23 @@ function ContentBlock({ className, children, title, subhead, cta }) {
|
|
|
276
276
|
] });
|
|
277
277
|
}
|
|
278
278
|
function DialogRoot(props) {
|
|
279
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
279
|
+
return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Root, { ...props });
|
|
280
280
|
}
|
|
281
281
|
function DialogPortal(props) {
|
|
282
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
282
|
+
return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Portal, { ...props });
|
|
283
283
|
}
|
|
284
284
|
function DialogTrigger(props) {
|
|
285
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
285
|
+
return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Trigger, { ...props });
|
|
286
286
|
}
|
|
287
287
|
function DialogClose(props) {
|
|
288
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
288
|
+
return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Close, { ...props });
|
|
289
289
|
}
|
|
290
290
|
function DialogBackdrop({
|
|
291
291
|
className,
|
|
292
292
|
...props
|
|
293
293
|
}) {
|
|
294
294
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
295
|
-
|
|
295
|
+
dialog.Dialog.Backdrop,
|
|
296
296
|
{
|
|
297
297
|
className: cn(
|
|
298
298
|
"fixed inset-0 min-h-dvh bg-[rgb(0_0_32/0.01)] opacity-0 backdrop-blur-sm transition-[opacity,backdrop-filter] duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-[-webkit-touch-callout:none]:absolute dark:bg-[rgb(255_255_255/0.01)] dark:opacity-70",
|
|
@@ -308,7 +308,7 @@ function DialogViewport({
|
|
|
308
308
|
...props
|
|
309
309
|
}) {
|
|
310
310
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
311
|
-
|
|
311
|
+
dialog.Dialog.Viewport,
|
|
312
312
|
{
|
|
313
313
|
className: cn(
|
|
314
314
|
"fixed inset-0 flex items-center justify-center overflow-hidden py-6 [@media(min-height:600px)]:pt-8 [@media(min-height:600px)]:pb-12",
|
|
@@ -325,9 +325,9 @@ function DialogPopup({
|
|
|
325
325
|
showCloseButton = true,
|
|
326
326
|
...props
|
|
327
327
|
}) {
|
|
328
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
328
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(dialog.Dialog.Portal, { children: [
|
|
329
329
|
/* @__PURE__ */ jsxRuntime.jsx(DialogBackdrop, {}),
|
|
330
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
330
|
+
/* @__PURE__ */ jsxRuntime.jsxs(dialog.Dialog.Popup, { className: "group/popup pointer-events-none flex h-full max-h-full min-h-0 w-full max-w-full justify-center overflow-hidden transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0", children: [
|
|
331
331
|
showCloseButton && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
332
332
|
DialogClose,
|
|
333
333
|
{
|
|
@@ -365,7 +365,7 @@ function DialogFooter({ className, ...props }) {
|
|
|
365
365
|
}
|
|
366
366
|
function DialogTitle({ className, ...props }) {
|
|
367
367
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
368
|
-
|
|
368
|
+
dialog.Dialog.Title,
|
|
369
369
|
{
|
|
370
370
|
className: cn("text-lg leading-none font-semibold", className),
|
|
371
371
|
...props
|
|
@@ -377,7 +377,7 @@ function DialogDescription({
|
|
|
377
377
|
...props
|
|
378
378
|
}) {
|
|
379
379
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
380
|
-
|
|
380
|
+
dialog.Dialog.Description,
|
|
381
381
|
{
|
|
382
382
|
className: cn("text-muted-foreground text-sm", className),
|
|
383
383
|
...props
|
|
@@ -1035,8 +1035,8 @@ function SectionHeader({
|
|
|
1035
1035
|
description = void 0,
|
|
1036
1036
|
numberChecked = 0
|
|
1037
1037
|
}) {
|
|
1038
|
-
const [labelText, setLabelText] = react
|
|
1039
|
-
const updateLabel = react
|
|
1038
|
+
const [labelText, setLabelText] = react.useState("");
|
|
1039
|
+
const updateLabel = react.useCallback(() => {
|
|
1040
1040
|
if (required) {
|
|
1041
1041
|
if (numberChecked === 0) {
|
|
1042
1042
|
setLabelText(`${min}\u2013${max} Required`);
|
|
@@ -1057,7 +1057,7 @@ function SectionHeader({
|
|
|
1057
1057
|
}
|
|
1058
1058
|
}
|
|
1059
1059
|
}, [required, numberChecked, min, max]);
|
|
1060
|
-
react
|
|
1060
|
+
react.useEffect(() => {
|
|
1061
1061
|
updateLabel();
|
|
1062
1062
|
}, [updateLabel]);
|
|
1063
1063
|
return /* @__PURE__ */ jsxRuntime.jsx(
|