@bigbinary/neeto-atoms 1.0.23 → 1.0.24
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-B2dcw0Zz.js → Dialog-BURSzxaP.js} +2 -2
- package/dist/Dialog-BURSzxaP.js.map +1 -0
- package/dist/cjs/{Dialog-dYYmRaZU.js → Dialog-CtI_yWsJ.js} +2 -2
- package/dist/cjs/Dialog-CtI_yWsJ.js.map +1 -0
- package/dist/cjs/components/Dialog.js +1 -1
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/formik/BlockNavigation.js +1 -1
- package/dist/cjs/formik/index.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/primitives/Dialog.js +2 -2
- package/dist/cjs/primitives/Dialog.js.map +1 -1
- package/dist/cjs/primitives/Sheet.js +2 -2
- package/dist/cjs/primitives/Sheet.js.map +1 -1
- package/dist/components/Dialog.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/formik/BlockNavigation.js +1 -1
- package/dist/formik/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/primitives/Dialog.d.ts +2 -2
- package/dist/primitives/Dialog.js +2 -2
- package/dist/primitives/Dialog.js.map +1 -1
- package/dist/primitives/Sheet.d.ts +2 -2
- package/dist/primitives/Sheet.js +2 -2
- package/dist/primitives/Sheet.js.map +1 -1
- package/package.json +1 -1
- package/dist/Dialog-B2dcw0Zz.js.map +0 -1
- package/dist/cjs/Dialog-dYYmRaZU.js.map +0 -1
|
@@ -14,7 +14,7 @@ const DialogHeader = forwardRef(({ children, className, description, dataTestid,
|
|
|
14
14
|
DialogHeader.displayName = "Dialog.Header";
|
|
15
15
|
const DialogBody = forwardRef(({ children, className, dataTestid, ...otherProps }, ref) => (jsx("div", { ref: ref, "data-slot": "dialog-body", "data-testid": dataTestid ?? "dialog-body", className: cn("text-sm text-foreground", className), ...otherProps, children: children })));
|
|
16
16
|
DialogBody.displayName = "Dialog.Body";
|
|
17
|
-
const DialogFooter = forwardRef(({ children, className, dataTestid, ...otherProps }, ref) => (jsx(DialogFooter$1, { ref: ref, className: cn(
|
|
17
|
+
const DialogFooter = forwardRef(({ children, className, dataTestid, ...otherProps }, ref) => (jsx(DialogFooter$1, { ref: ref, className: cn(className), "data-testid": dataTestid ?? "dialog-footer", ...otherProps, children: children })));
|
|
18
18
|
DialogFooter.displayName = "Dialog.Footer";
|
|
19
19
|
const DialogTitle = forwardRef(({ children, className, ...otherProps }, ref) => (jsx(DialogTitle$1, { ref: ref, className: cn("text-2xl font-semibold", className), ...otherProps, children: children })));
|
|
20
20
|
DialogTitle.displayName = "Dialog.Title";
|
|
@@ -58,4 +58,4 @@ Dialog.Footer = DialogFooter;
|
|
|
58
58
|
Dialog.Title = DialogTitle;
|
|
59
59
|
|
|
60
60
|
export { Dialog as D };
|
|
61
|
-
//# sourceMappingURL=Dialog-
|
|
61
|
+
//# sourceMappingURL=Dialog-BURSzxaP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dialog-BURSzxaP.js","sources":["../src/components/Dialog/constants.ts","../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import type { DialogSize } from \"./Dialog\";\n\nexport const SIZE_CLASS_MAP: Record<DialogSize, string> = {\n small: \"sm:max-w-sm\",\n medium: \"sm:max-w-md\",\n large: \"sm:max-w-lg\",\n fullScreen: \"h-screen w-screen max-w-none rounded-none sm:max-w-none\",\n};\n","import React, { forwardRef, type ReactNode, type RefObject } from \"react\";\n\nimport { cn } from \"src/shadcn/lib/utils\";\nimport {\n Dialog as PrimitiveDialog,\n DialogContent as PrimitiveDialogContent,\n DialogDescription,\n DialogFooter as PrimitiveDialogFooter,\n DialogHeader as PrimitiveDialogHeader,\n DialogTitle as PrimitiveDialogTitle,\n} from \"src/primitives/Dialog\";\n\nimport { SIZE_CLASS_MAP } from \"./constants\";\n\nexport type DialogSize = \"small\" | \"medium\" | \"large\" | \"fullScreen\";\n\n/** Radix Dialog.Content props we forward via ...otherProps. */\ntype DialogContentProps = React.ComponentProps<typeof PrimitiveDialogContent>;\n\nexport interface DialogProps extends Omit<\n DialogContentProps,\n | \"children\"\n | \"className\"\n | \"showCloseButton\"\n | \"onEscapeKeyDown\"\n | \"onInteractOutside\"\n> {\n /** Size of the dialog. */\n size?: DialogSize;\n /** Whether the dialog is open. */\n isOpen?: boolean;\n /** Callback invoked when the dialog is closed. */\n onClose?: () => void;\n /** Content rendered inside the dialog. */\n children?: ReactNode;\n /** Additional CSS class names applied to the dialog content. */\n className?: string;\n /** Close on pressing the Esc key. */\n closeOnEsc?: boolean;\n /** Show the close button. */\n closeButton?: boolean;\n /** Additional CSS class names applied to the backdrop/overlay. */\n backdropClassName?: string;\n /** Close on clicking outside the dialog. */\n closeOnOutsideClick?: boolean;\n /** Ref of the element to receive focus when the dialog opens. */\n initialFocusRef?: RefObject<HTMLElement | null>;\n /** Ref of the element to receive focus when the dialog closes. */\n finalFocusRef?: RefObject<HTMLElement | null>;\n /** Whether to block body scroll when the dialog is mounted. Maps to Radix `modal` prop. */\n blockScrollOnMount?: boolean;\n /** Force children to re-render even when the dialog is closed. */\n forceRender?: boolean;\n /** Radix Dialog `modal` prop — takes precedence over blockScrollOnMount. */\n modal?: boolean;\n /** Radix Dialog `defaultOpen` prop. */\n defaultOpen?: boolean;\n}\n\ninterface DialogSubcomponentProps extends React.ComponentProps<\"div\"> {\n children?: ReactNode;\n className?: string;\n /** Custom data-testid attribute. */\n dataTestid?: string;\n}\n\nconst DialogHeader = forwardRef<\n HTMLDivElement,\n DialogSubcomponentProps & { description?: string }\n>(({ children, className, description, dataTestid, ...otherProps }, ref) => (\n <PrimitiveDialogHeader\n ref={ref}\n className={cn(className)}\n data-testid={dataTestid ?? \"dialog-header\"}\n {...otherProps}\n >\n {children}\n {description && <DialogDescription>{description}</DialogDescription>}\n </PrimitiveDialogHeader>\n));\nDialogHeader.displayName = \"Dialog.Header\";\n\nconst DialogBody = forwardRef<HTMLDivElement, DialogSubcomponentProps>(\n ({ children, className, dataTestid, ...otherProps }, ref) => (\n <div\n ref={ref}\n data-slot=\"dialog-body\"\n data-testid={dataTestid ?? \"dialog-body\"}\n className={cn(\"text-sm text-foreground\", className)}\n {...otherProps}\n >\n {children}\n </div>\n )\n);\nDialogBody.displayName = \"Dialog.Body\";\n\nconst DialogFooter = forwardRef<HTMLDivElement, DialogSubcomponentProps>(\n ({ children, className, dataTestid, ...otherProps }, ref) => (\n <PrimitiveDialogFooter\n ref={ref}\n className={cn(className)}\n data-testid={dataTestid ?? \"dialog-footer\"}\n {...otherProps}\n >\n {children}\n </PrimitiveDialogFooter>\n )\n);\nDialogFooter.displayName = \"Dialog.Footer\";\n\nconst DialogTitle = forwardRef<\n HTMLHeadingElement,\n React.ComponentProps<typeof PrimitiveDialogTitle>\n>(({ children, className, ...otherProps }, ref) => (\n <PrimitiveDialogTitle\n ref={ref}\n className={cn(\"text-2xl font-semibold\", className)}\n {...otherProps}\n >\n {children}\n </PrimitiveDialogTitle>\n));\nDialogTitle.displayName = \"Dialog.Title\";\n\nconst Dialog = forwardRef<HTMLDivElement, DialogProps>(\n (\n {\n size = \"medium\",\n isOpen = false,\n onClose = () => {},\n children,\n className,\n closeOnEsc = true,\n closeButton = true,\n backdropClassName,\n closeOnOutsideClick = true,\n initialFocusRef,\n finalFocusRef,\n blockScrollOnMount = true,\n forceRender = false,\n modal: modalProp,\n defaultOpen,\n // Radix content handlers — intercept and merge\n onOpenAutoFocus: onOpenAutoFocusProp,\n onCloseAutoFocus: onCloseAutoFocusProp,\n ...otherContentProps\n },\n ref\n ) => {\n const handleOpenChange = (open: boolean) => {\n if (!open) onClose();\n };\n\n const handleInteractOutside = (e: Event) => {\n if (!closeOnOutsideClick) e.preventDefault();\n };\n\n const handleEscapeKeyDown = (e: KeyboardEvent) => {\n if (!closeOnEsc) e.preventDefault();\n };\n\n const handleOpenAutoFocus = (e: Event) => {\n if (initialFocusRef?.current) {\n e.preventDefault();\n initialFocusRef.current.focus();\n }\n onOpenAutoFocusProp?.(e);\n };\n\n const handleCloseAutoFocus = (e: Event) => {\n if (finalFocusRef?.current) {\n e.preventDefault();\n finalFocusRef.current.focus();\n }\n onCloseAutoFocusProp?.(e);\n };\n\n // `modal` prop takes precedence; fall back to blockScrollOnMount\n const resolvedModal = modalProp ?? blockScrollOnMount;\n\n return (\n <PrimitiveDialog\n open={isOpen}\n onOpenChange={handleOpenChange}\n modal={resolvedModal}\n defaultOpen={defaultOpen}\n >\n <PrimitiveDialogContent\n ref={ref}\n aria-modal\n showCloseButton={closeButton}\n forceMount={forceRender || undefined}\n overlayClassName={backdropClassName}\n onInteractOutside={handleInteractOutside}\n onEscapeKeyDown={handleEscapeKeyDown}\n onOpenAutoFocus={handleOpenAutoFocus}\n onCloseAutoFocus={handleCloseAutoFocus}\n className={cn(SIZE_CLASS_MAP[size], className)}\n data-testid=\"dialog-wrapper\"\n {...otherContentProps}\n >\n {children}\n </PrimitiveDialogContent>\n </PrimitiveDialog>\n );\n }\n) as React.ForwardRefExoticComponent<\n DialogProps & React.RefAttributes<HTMLDivElement>\n> & {\n Header: typeof DialogHeader;\n Body: typeof DialogBody;\n Footer: typeof DialogFooter;\n Title: typeof DialogTitle;\n};\n\nDialog.displayName = \"Dialog\";\nDialog.Header = DialogHeader;\nDialog.Body = DialogBody;\nDialog.Footer = DialogFooter;\nDialog.Title = DialogTitle;\n\nexport { Dialog };\n"],"names":["_jsxs","PrimitiveDialogHeader","_jsx","PrimitiveDialogFooter","PrimitiveDialogTitle","PrimitiveDialog","PrimitiveDialogContent"],"mappings":";;;;;AAEO,MAAM,cAAc,GAA+B;AACxD,IAAA,KAAK,EAAE,aAAa;AACpB,IAAA,MAAM,EAAE,aAAa;AACrB,IAAA,KAAK,EAAE,aAAa;AACpB,IAAA,UAAU,EAAE,yDAAyD;CACtE;;AC2DD,MAAM,YAAY,GAAG,UAAU,CAG7B,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,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,CAAC,CAAQ,KAAI;AACxC,QAAA,IAAI,aAAa,EAAE,OAAO,EAAE;YAC1B,CAAC,CAAC,cAAc,EAAE;AAClB,YAAA,aAAa,CAAC,OAAO,CAAC,KAAK,EAAE;QAC/B;AACA,QAAA,oBAAoB,GAAG,CAAC,CAAC;AAC3B,IAAA,CAAC;;AAGD,IAAA,MAAM,aAAa,GAAG,SAAS,IAAI,kBAAkB;AAErD,IAAA,QACEF,GAAA,CAACG,QAAe,EAAA,EACd,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,gBAAgB,EAC9B,KAAK,EAAE,aAAa,EACpB,WAAW,EAAE,WAAW,EAAA,QAAA,EAExBH,IAACI,aAAsB,EAAA,EACrB,GAAG,EAAE,GAAG,EAAA,YAAA,EAAA,IAAA,EAER,eAAe,EAAE,WAAW,EAC5B,UAAU,EAAE,WAAW,IAAI,SAAS,EACpC,gBAAgB,EAAE,iBAAiB,EACnC,iBAAiB,EAAE,qBAAqB,EACxC,eAAe,EAAE,mBAAmB,EACpC,eAAe,EAAE,mBAAmB,EACpC,gBAAgB,EAAE,oBAAoB,EACtC,SAAS,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,EAAA,aAAA,EAClC,gBAAgB,KACxB,iBAAiB,EAAA,QAAA,EAEpB,QAAQ,EAAA,CACc,EAAA,CACT;AAEtB,CAAC;AAUH,MAAM,CAAC,WAAW,GAAG,QAAQ;AAC7B,MAAM,CAAC,MAAM,GAAG,YAAY;AAC5B,MAAM,CAAC,IAAI,GAAG,UAAU;AACxB,MAAM,CAAC,MAAM,GAAG,YAAY;AAC5B,MAAM,CAAC,KAAK,GAAG,WAAW;;;;"}
|
|
@@ -16,7 +16,7 @@ const DialogHeader = React.forwardRef(({ children, className, description, dataT
|
|
|
16
16
|
DialogHeader.displayName = "Dialog.Header";
|
|
17
17
|
const DialogBody = React.forwardRef(({ children, className, dataTestid, ...otherProps }, ref) => (jsxRuntime.jsx("div", { ref: ref, "data-slot": "dialog-body", "data-testid": dataTestid ?? "dialog-body", className: utils.cn("text-sm text-foreground", className), ...otherProps, children: children })));
|
|
18
18
|
DialogBody.displayName = "Dialog.Body";
|
|
19
|
-
const DialogFooter = React.forwardRef(({ children, className, dataTestid, ...otherProps }, ref) => (jsxRuntime.jsx(primitives_Dialog.DialogFooter, { ref: ref, className: utils.cn(
|
|
19
|
+
const DialogFooter = React.forwardRef(({ children, className, dataTestid, ...otherProps }, ref) => (jsxRuntime.jsx(primitives_Dialog.DialogFooter, { ref: ref, className: utils.cn(className), "data-testid": dataTestid ?? "dialog-footer", ...otherProps, children: children })));
|
|
20
20
|
DialogFooter.displayName = "Dialog.Footer";
|
|
21
21
|
const DialogTitle = React.forwardRef(({ children, className, ...otherProps }, ref) => (jsxRuntime.jsx(primitives_Dialog.DialogTitle, { ref: ref, className: utils.cn("text-2xl font-semibold", className), ...otherProps, children: children })));
|
|
22
22
|
DialogTitle.displayName = "Dialog.Title";
|
|
@@ -60,4 +60,4 @@ Dialog.Footer = DialogFooter;
|
|
|
60
60
|
Dialog.Title = DialogTitle;
|
|
61
61
|
|
|
62
62
|
exports.Dialog = Dialog;
|
|
63
|
-
//# sourceMappingURL=Dialog-
|
|
63
|
+
//# sourceMappingURL=Dialog-CtI_yWsJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dialog-CtI_yWsJ.js","sources":["../../../src/components/Dialog/constants.ts","../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import type { DialogSize } from \"./Dialog\";\n\nexport const SIZE_CLASS_MAP: Record<DialogSize, string> = {\n small: \"sm:max-w-sm\",\n medium: \"sm:max-w-md\",\n large: \"sm:max-w-lg\",\n fullScreen: \"h-screen w-screen max-w-none rounded-none sm:max-w-none\",\n};\n","import React, { forwardRef, type ReactNode, type RefObject } from \"react\";\n\nimport { cn } from \"src/shadcn/lib/utils\";\nimport {\n Dialog as PrimitiveDialog,\n DialogContent as PrimitiveDialogContent,\n DialogDescription,\n DialogFooter as PrimitiveDialogFooter,\n DialogHeader as PrimitiveDialogHeader,\n DialogTitle as PrimitiveDialogTitle,\n} from \"src/primitives/Dialog\";\n\nimport { SIZE_CLASS_MAP } from \"./constants\";\n\nexport type DialogSize = \"small\" | \"medium\" | \"large\" | \"fullScreen\";\n\n/** Radix Dialog.Content props we forward via ...otherProps. */\ntype DialogContentProps = React.ComponentProps<typeof PrimitiveDialogContent>;\n\nexport interface DialogProps extends Omit<\n DialogContentProps,\n | \"children\"\n | \"className\"\n | \"showCloseButton\"\n | \"onEscapeKeyDown\"\n | \"onInteractOutside\"\n> {\n /** Size of the dialog. */\n size?: DialogSize;\n /** Whether the dialog is open. */\n isOpen?: boolean;\n /** Callback invoked when the dialog is closed. */\n onClose?: () => void;\n /** Content rendered inside the dialog. */\n children?: ReactNode;\n /** Additional CSS class names applied to the dialog content. */\n className?: string;\n /** Close on pressing the Esc key. */\n closeOnEsc?: boolean;\n /** Show the close button. */\n closeButton?: boolean;\n /** Additional CSS class names applied to the backdrop/overlay. */\n backdropClassName?: string;\n /** Close on clicking outside the dialog. */\n closeOnOutsideClick?: boolean;\n /** Ref of the element to receive focus when the dialog opens. */\n initialFocusRef?: RefObject<HTMLElement | null>;\n /** Ref of the element to receive focus when the dialog closes. */\n finalFocusRef?: RefObject<HTMLElement | null>;\n /** Whether to block body scroll when the dialog is mounted. Maps to Radix `modal` prop. */\n blockScrollOnMount?: boolean;\n /** Force children to re-render even when the dialog is closed. */\n forceRender?: boolean;\n /** Radix Dialog `modal` prop — takes precedence over blockScrollOnMount. */\n modal?: boolean;\n /** Radix Dialog `defaultOpen` prop. */\n defaultOpen?: boolean;\n}\n\ninterface DialogSubcomponentProps extends React.ComponentProps<\"div\"> {\n children?: ReactNode;\n className?: string;\n /** Custom data-testid attribute. */\n dataTestid?: string;\n}\n\nconst DialogHeader = forwardRef<\n HTMLDivElement,\n DialogSubcomponentProps & { description?: string }\n>(({ children, className, description, dataTestid, ...otherProps }, ref) => (\n <PrimitiveDialogHeader\n ref={ref}\n className={cn(className)}\n data-testid={dataTestid ?? \"dialog-header\"}\n {...otherProps}\n >\n {children}\n {description && <DialogDescription>{description}</DialogDescription>}\n </PrimitiveDialogHeader>\n));\nDialogHeader.displayName = \"Dialog.Header\";\n\nconst DialogBody = forwardRef<HTMLDivElement, DialogSubcomponentProps>(\n ({ children, className, dataTestid, ...otherProps }, ref) => (\n <div\n ref={ref}\n data-slot=\"dialog-body\"\n data-testid={dataTestid ?? \"dialog-body\"}\n className={cn(\"text-sm text-foreground\", className)}\n {...otherProps}\n >\n {children}\n </div>\n )\n);\nDialogBody.displayName = \"Dialog.Body\";\n\nconst DialogFooter = forwardRef<HTMLDivElement, DialogSubcomponentProps>(\n ({ children, className, dataTestid, ...otherProps }, ref) => (\n <PrimitiveDialogFooter\n ref={ref}\n className={cn(className)}\n data-testid={dataTestid ?? \"dialog-footer\"}\n {...otherProps}\n >\n {children}\n </PrimitiveDialogFooter>\n )\n);\nDialogFooter.displayName = \"Dialog.Footer\";\n\nconst DialogTitle = forwardRef<\n HTMLHeadingElement,\n React.ComponentProps<typeof PrimitiveDialogTitle>\n>(({ children, className, ...otherProps }, ref) => (\n <PrimitiveDialogTitle\n ref={ref}\n className={cn(\"text-2xl font-semibold\", className)}\n {...otherProps}\n >\n {children}\n </PrimitiveDialogTitle>\n));\nDialogTitle.displayName = \"Dialog.Title\";\n\nconst Dialog = forwardRef<HTMLDivElement, DialogProps>(\n (\n {\n size = \"medium\",\n isOpen = false,\n onClose = () => {},\n children,\n className,\n closeOnEsc = true,\n closeButton = true,\n backdropClassName,\n closeOnOutsideClick = true,\n initialFocusRef,\n finalFocusRef,\n blockScrollOnMount = true,\n forceRender = false,\n modal: modalProp,\n defaultOpen,\n // Radix content handlers — intercept and merge\n onOpenAutoFocus: onOpenAutoFocusProp,\n onCloseAutoFocus: onCloseAutoFocusProp,\n ...otherContentProps\n },\n ref\n ) => {\n const handleOpenChange = (open: boolean) => {\n if (!open) onClose();\n };\n\n const handleInteractOutside = (e: Event) => {\n if (!closeOnOutsideClick) e.preventDefault();\n };\n\n const handleEscapeKeyDown = (e: KeyboardEvent) => {\n if (!closeOnEsc) e.preventDefault();\n };\n\n const handleOpenAutoFocus = (e: Event) => {\n if (initialFocusRef?.current) {\n e.preventDefault();\n initialFocusRef.current.focus();\n }\n onOpenAutoFocusProp?.(e);\n };\n\n const handleCloseAutoFocus = (e: Event) => {\n if (finalFocusRef?.current) {\n e.preventDefault();\n finalFocusRef.current.focus();\n }\n onCloseAutoFocusProp?.(e);\n };\n\n // `modal` prop takes precedence; fall back to blockScrollOnMount\n const resolvedModal = modalProp ?? blockScrollOnMount;\n\n return (\n <PrimitiveDialog\n open={isOpen}\n onOpenChange={handleOpenChange}\n modal={resolvedModal}\n defaultOpen={defaultOpen}\n >\n <PrimitiveDialogContent\n ref={ref}\n aria-modal\n showCloseButton={closeButton}\n forceMount={forceRender || undefined}\n overlayClassName={backdropClassName}\n onInteractOutside={handleInteractOutside}\n onEscapeKeyDown={handleEscapeKeyDown}\n onOpenAutoFocus={handleOpenAutoFocus}\n onCloseAutoFocus={handleCloseAutoFocus}\n className={cn(SIZE_CLASS_MAP[size], className)}\n data-testid=\"dialog-wrapper\"\n {...otherContentProps}\n >\n {children}\n </PrimitiveDialogContent>\n </PrimitiveDialog>\n );\n }\n) as React.ForwardRefExoticComponent<\n DialogProps & React.RefAttributes<HTMLDivElement>\n> & {\n Header: typeof DialogHeader;\n Body: typeof DialogBody;\n Footer: typeof DialogFooter;\n Title: typeof DialogTitle;\n};\n\nDialog.displayName = \"Dialog\";\nDialog.Header = DialogHeader;\nDialog.Body = DialogBody;\nDialog.Footer = DialogFooter;\nDialog.Title = DialogTitle;\n\nexport { Dialog };\n"],"names":["forwardRef","_jsxs","PrimitiveDialogHeader","cn","_jsx","DialogDescription","PrimitiveDialogFooter","PrimitiveDialogTitle","PrimitiveDialog","PrimitiveDialogContent"],"mappings":";;;;;;;AAEO,MAAM,cA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AAM,CAAC,MAAM,GAAG,YAAY;AAC5B,MAAM,CAAC,KAAK,GAAG,WAAW;;;;"}
|
|
@@ -10,7 +10,7 @@ var Checkbox = require('../Checkbox-DOlS2oCD.js');
|
|
|
10
10
|
var ColorPicker = require('../ColorPicker-Uxgn8U0h.js');
|
|
11
11
|
var DataTable = require('../DataTable-BOeCq0s4.js');
|
|
12
12
|
var DatePicker = require('../DatePicker-CA113xZV.js');
|
|
13
|
-
var Dialog = require('../Dialog-
|
|
13
|
+
var Dialog = require('../Dialog-CtI_yWsJ.js');
|
|
14
14
|
var components_DropdownMenu = require('./DropdownMenu.js');
|
|
15
15
|
var Empty = require('../Empty-qzle6YvT.js');
|
|
16
16
|
var Input = require('../Input-pkugjUb0.js');
|
|
@@ -5,7 +5,7 @@ var formik = require('formik');
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var reactRouterDom = require('react-router-dom');
|
|
7
7
|
var Button = require('../Button-Bt_AElge.js');
|
|
8
|
-
var Dialog = require('../Dialog-
|
|
8
|
+
var Dialog = require('../Dialog-CtI_yWsJ.js');
|
|
9
9
|
require('../utils-CTr7wn5d.js');
|
|
10
10
|
require('../renderIcon-fLF3odqg.js');
|
|
11
11
|
require('../primitives/Button.js');
|
package/dist/cjs/formik/index.js
CHANGED
|
@@ -87,7 +87,7 @@ require('../primitives/Tooltip.js');
|
|
|
87
87
|
require('../tooltip-C-568jEL.js');
|
|
88
88
|
require('../index-CB9xFokC.js');
|
|
89
89
|
require('react-router-dom');
|
|
90
|
-
require('../Dialog-
|
|
90
|
+
require('../Dialog-CtI_yWsJ.js');
|
|
91
91
|
require('../primitives/Dialog.js');
|
|
92
92
|
require('../dialog-3nRssoAl.js');
|
|
93
93
|
require('../index-BLGrl3PF.js');
|
package/dist/cjs/index.js
CHANGED
|
@@ -18,7 +18,7 @@ var weekday = require('dayjs/plugin/weekday');
|
|
|
18
18
|
var weekOfYear = require('dayjs/plugin/weekOfYear');
|
|
19
19
|
var TranslationProvider = require('./TranslationProvider-DBZHXmzX.js');
|
|
20
20
|
var DirectionProvider = require('./DirectionProvider-Bec-6U8p.js');
|
|
21
|
-
var Dialog = require('./Dialog-
|
|
21
|
+
var Dialog = require('./Dialog-CtI_yWsJ.js');
|
|
22
22
|
var components_DropdownMenu = require('./components/DropdownMenu.js');
|
|
23
23
|
var Empty = require('./Empty-qzle6YvT.js');
|
|
24
24
|
var Input = require('./Input-pkugjUb0.js');
|
|
@@ -33,8 +33,8 @@ const DialogClose = (props) => (jsxRuntime.jsx(dialog.DialogClose, { ...props })
|
|
|
33
33
|
*/
|
|
34
34
|
const DialogContent = ({ className, children, showCloseButton = true, overlayClassName, ...props }) => (jsxRuntime.jsxs(dialog.DialogPortal, { children: [jsxRuntime.jsx(dialog.DialogOverlay, { className: overlayClassName }), jsxRuntime.jsxs(index.Content, { "data-slot": "dialog-content", className: utils.cn("fixed top-1/2 start-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 rtl:translate-x-1/2 -translate-y-1/2 gap-5 rounded-xl bg-popover p-6 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className), ...props, children: [children, showCloseButton && (jsxRuntime.jsx(index.Close, { "data-slot": "dialog-close", asChild: true, children: jsxRuntime.jsxs(button.Button, { variant: "ghost", className: "absolute top-2 end-2", size: "icon-sm", children: [jsxRuntime.jsx(x.X, {}), jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })] }) }))] })] }));
|
|
35
35
|
const DialogDescription = (props) => jsxRuntime.jsx(dialog.DialogDescription, { ...props });
|
|
36
|
-
const DialogFooter = (props) => jsxRuntime.jsx(dialog.DialogFooter, { ...props });
|
|
37
|
-
const DialogHeader = (props) => jsxRuntime.jsx(dialog.DialogHeader, { ...props });
|
|
36
|
+
const DialogFooter = ({ className, ...props }) => (jsxRuntime.jsx(dialog.DialogFooter, { className: utils.cn("-mx-6 -mb-6 border-t-0 px-6 py-4", className), ...props }));
|
|
37
|
+
const DialogHeader = ({ className, ...props }) => (jsxRuntime.jsx(dialog.DialogHeader, { className: utils.cn("gap-3", className), ...props }));
|
|
38
38
|
const DialogOverlay = (props) => jsxRuntime.jsx(dialog.DialogOverlay, { ...props });
|
|
39
39
|
const DialogPortal = (props) => jsxRuntime.jsx(dialog.DialogPortal, { ...props });
|
|
40
40
|
const DialogTitle = (props) => (jsxRuntime.jsx(dialog.DialogTitle, { ...props }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","sources":["../../../../src/primitives/Dialog.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Dialog as DialogPrimitive } from \"radix-ui\";\nimport { XIcon } from \"lucide-react\";\nimport { cn } from \"src/shadcn/lib/utils\";\nimport { Button } from \"src/shadcn/components/button\";\n\nimport {\n Dialog as ShadcnDialog,\n DialogClose as ShadcnDialogClose,\n DialogDescription as ShadcnDialogDescription,\n DialogFooter as ShadcnDialogFooter,\n DialogHeader as ShadcnDialogHeader,\n DialogOverlay as ShadcnDialogOverlay,\n DialogPortal as ShadcnDialogPortal,\n DialogTitle as ShadcnDialogTitle,\n DialogTrigger as ShadcnDialogTrigger,\n} from \"src/shadcn/components/dialog\";\n\nconst Dialog = (props: React.ComponentProps<typeof ShadcnDialog>) => (\n <ShadcnDialog {...props} />\n);\n\nconst DialogClose = (props: React.ComponentProps<typeof ShadcnDialogClose>) => (\n <ShadcnDialogClose {...props} />\n);\n\n/**\n * DialogContent composes Portal + Overlay + Radix Content so that\n * `overlayClassName` can be forwarded to the overlay element.\n */\nconst DialogContent = ({\n className,\n children,\n showCloseButton = true,\n overlayClassName,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean;\n overlayClassName?: string;\n}) => (\n <ShadcnDialogPortal>\n <ShadcnDialogOverlay className={overlayClassName} />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n \"fixed top-1/2 start-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 rtl:translate-x-1/2 -translate-y-1/2 gap-5 rounded-xl bg-popover p-6 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95\",\n className\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close data-slot=\"dialog-close\" asChild>\n <Button\n variant=\"ghost\"\n className=\"absolute top-2 end-2\"\n size=\"icon-sm\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </Button>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </ShadcnDialogPortal>\n);\n\nconst DialogDescription = (\n props: React.ComponentProps<typeof ShadcnDialogDescription>\n) => <ShadcnDialogDescription {...props} />;\n\nconst DialogFooter = (\n props: React.ComponentProps<typeof ShadcnDialogFooter
|
|
1
|
+
{"version":3,"file":"Dialog.js","sources":["../../../../src/primitives/Dialog.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Dialog as DialogPrimitive } from \"radix-ui\";\nimport { XIcon } from \"lucide-react\";\nimport { cn } from \"src/shadcn/lib/utils\";\nimport { Button } from \"src/shadcn/components/button\";\n\nimport {\n Dialog as ShadcnDialog,\n DialogClose as ShadcnDialogClose,\n DialogDescription as ShadcnDialogDescription,\n DialogFooter as ShadcnDialogFooter,\n DialogHeader as ShadcnDialogHeader,\n DialogOverlay as ShadcnDialogOverlay,\n DialogPortal as ShadcnDialogPortal,\n DialogTitle as ShadcnDialogTitle,\n DialogTrigger as ShadcnDialogTrigger,\n} from \"src/shadcn/components/dialog\";\n\nconst Dialog = (props: React.ComponentProps<typeof ShadcnDialog>) => (\n <ShadcnDialog {...props} />\n);\n\nconst DialogClose = (props: React.ComponentProps<typeof ShadcnDialogClose>) => (\n <ShadcnDialogClose {...props} />\n);\n\n/**\n * DialogContent composes Portal + Overlay + Radix Content so that\n * `overlayClassName` can be forwarded to the overlay element.\n */\nconst DialogContent = ({\n className,\n children,\n showCloseButton = true,\n overlayClassName,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean;\n overlayClassName?: string;\n}) => (\n <ShadcnDialogPortal>\n <ShadcnDialogOverlay className={overlayClassName} />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n \"fixed top-1/2 start-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 rtl:translate-x-1/2 -translate-y-1/2 gap-5 rounded-xl bg-popover p-6 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95\",\n className\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close data-slot=\"dialog-close\" asChild>\n <Button\n variant=\"ghost\"\n className=\"absolute top-2 end-2\"\n size=\"icon-sm\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </Button>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </ShadcnDialogPortal>\n);\n\nconst DialogDescription = (\n props: React.ComponentProps<typeof ShadcnDialogDescription>\n) => <ShadcnDialogDescription {...props} />;\n\nconst DialogFooter = ({\n className,\n ...props\n}: React.ComponentProps<typeof ShadcnDialogFooter>) => (\n <ShadcnDialogFooter\n className={cn(\"-mx-6 -mb-6 border-t-0 px-6 py-4\", className)}\n {...props}\n />\n);\n\nconst DialogHeader = ({\n className,\n ...props\n}: React.ComponentProps<typeof ShadcnDialogHeader>) => (\n <ShadcnDialogHeader className={cn(\"gap-3\", className)} {...props} />\n);\n\nconst DialogOverlay = (\n props: React.ComponentProps<typeof ShadcnDialogOverlay>\n) => <ShadcnDialogOverlay {...props} />;\n\nconst DialogPortal = (\n props: React.ComponentProps<typeof ShadcnDialogPortal>\n) => <ShadcnDialogPortal {...props} />;\n\nconst DialogTitle = (props: React.ComponentProps<typeof ShadcnDialogTitle>) => (\n <ShadcnDialogTitle {...props} />\n);\n\nconst DialogTrigger = (\n props: React.ComponentProps<typeof ShadcnDialogTrigger>\n) => <ShadcnDialogTrigger {...props} />;\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n"],"names":["_jsx","ShadcnDialog","ShadcnDialogClose","_jsxs","ShadcnDialogPortal","ShadcnDialogOverlay","DialogPrimitive.Content","cn","DialogPrimitive.Close","Button","XIcon","ShadcnDialogDescription","ShadcnDialogFooter","ShadcnDialogHeader","ShadcnDialogTitle","ShadcnDialogTrigger"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAM,MAAM,GAAG,CAAC,KAAgD,MAC9DA,cAAA,CAACC,aAAY,EAAA,EAAA,GAAK,KAAK,EAAA,CAAI;AAG7B,MAAM,WAAW,GAAG,CAAC,KAAqD,MACxED,cAAA,CAACE,kBAAiB,EAAA,EAAA,GAAK,KAAK,EAAA,CAAI;AAGlC;;;AAGG;AACH,MAAM,aAAa,GAAG,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,eAAe,GAAG,IAAI,EACtB,gBAAgB,EAChB,GAAG,KAAK,EAIT,MACCC,eAAA,CAACC,mBAAkB,EAAA,EAAA,QAAA,EAAA,CACjBJ,cAAA,CAACK,oBAAmB,EAAA,EAAC,SAAS,EAAE,gBAAgB,EAAA,CAAI,EACpDF,eAAA,CAACG,aAAuB,EAAA,EAAA,WAAA,EACZ,gBAAgB,EAC1B,SAAS,EAAEC,QAAE,CACX,6XAA6X,EAC7X,SAAS,CACV,KACG,KAAK,EAAA,QAAA,EAAA,CAER,QAAQ,EACR,eAAe,KACdP,cAAA,CAACQ,WAAqB,iBAAW,cAAc,EAAC,OAAO,EA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props) => (jsxRuntime.jsx(sheet.SheetClose, { ...props }));
|
|
|
33
33
|
* the hardcoded max-w-sm is removed and width is fully consumer-controlled.
|
|
34
34
|
*/
|
|
35
35
|
const SheetContent = ({ className, children, side = "right", showCloseButton = true, overlayClassName, ...props }) => (jsxRuntime.jsxs(index.Portal, { "data-slot": "sheet-portal", children: [jsxRuntime.jsx(index.Overlay, { "data-slot": "sheet-overlay", className: utils.cn("fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", overlayClassName) }), jsxRuntime.jsxs(index.Content, { "data-slot": "sheet-content", "data-side": side, className: utils.cn("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out", "data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:border-border", "data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-e data-[side=left]:border-border data-[side=left]:sm:max-w-sm", "data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-s data-[side=right]:border-border data-[side=right]:sm:max-w-sm", "data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:border-border", "data-open:animate-in data-open:fade-in-0", "data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10", "data-closed:animate-out data-closed:fade-out-0", "data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10", className), ...props, children: [children, showCloseButton && (jsxRuntime.jsx(index.Close, { "data-slot": "sheet-close", asChild: true, children: jsxRuntime.jsxs(button.Button, { variant: "ghost", className: "absolute top-3 end-3", size: "icon-sm", children: [jsxRuntime.jsx(x.X, {}), jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })] }) }))] })] }));
|
|
36
|
-
const SheetHeader = (props) => (jsxRuntime.jsx(sheet.SheetHeader, { ...props }));
|
|
37
|
-
const SheetFooter = (props) => (jsxRuntime.jsx(sheet.SheetFooter, { ...props }));
|
|
36
|
+
const SheetHeader = ({ className, ...props }) => (jsxRuntime.jsx(sheet.SheetHeader, { className: utils.cn("gap-3 p-6", className), ...props }));
|
|
37
|
+
const SheetFooter = ({ className, ...props }) => (jsxRuntime.jsx(sheet.SheetFooter, { className: utils.cn("bg-muted/50 px-6 py-4", className), ...props }));
|
|
38
38
|
const SheetTitle = (props) => (jsxRuntime.jsx(sheet.SheetTitle, { ...props }));
|
|
39
39
|
const SheetDescription = (props) => jsxRuntime.jsx(sheet.SheetDescription, { ...props });
|
|
40
40
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sheet.js","sources":["../../../../src/primitives/Sheet.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Dialog as SheetPrimitive } from \"radix-ui\";\nimport { XIcon } from \"lucide-react\";\nimport { cn } from \"src/shadcn/lib/utils\";\nimport { Button } from \"src/shadcn/components/button\";\n\nimport {\n Sheet as ShadcnSheet,\n SheetTrigger as ShadcnSheetTrigger,\n SheetClose as ShadcnSheetClose,\n SheetHeader as ShadcnSheetHeader,\n SheetFooter as ShadcnSheetFooter,\n SheetTitle as ShadcnSheetTitle,\n SheetDescription as ShadcnSheetDescription,\n} from \"src/shadcn/components/sheet\";\n\nconst Sheet = (props: React.ComponentProps<typeof ShadcnSheet>) => (\n <ShadcnSheet {...props} />\n);\n\nconst SheetTrigger = (\n props: React.ComponentProps<typeof ShadcnSheetTrigger>\n) => <ShadcnSheetTrigger {...props} />;\n\nconst SheetClose = (props: React.ComponentProps<typeof ShadcnSheetClose>) => (\n <ShadcnSheetClose {...props} />\n);\n\n/**\n * SheetContent composes Portal + Overlay + Radix Content directly so\n * the hardcoded max-w-sm is removed and width is fully consumer-controlled.\n */\nconst SheetContent = ({\n className,\n children,\n side = \"right\",\n showCloseButton = true,\n overlayClassName,\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Content> & {\n side?: \"top\" | \"right\" | \"bottom\" | \"left\";\n showCloseButton?: boolean;\n overlayClassName?: string;\n}) => (\n <SheetPrimitive.Portal data-slot=\"sheet-portal\">\n <SheetPrimitive.Overlay\n data-slot=\"sheet-overlay\"\n className={cn(\n \"fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0\",\n overlayClassName\n )}\n />\n <SheetPrimitive.Content\n data-slot=\"sheet-content\"\n data-side={side}\n className={cn(\n \"fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out\",\n \"data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:border-border\",\n \"data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-e data-[side=left]:border-border data-[side=left]:sm:max-w-sm\",\n \"data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-s data-[side=right]:border-border data-[side=right]:sm:max-w-sm\",\n \"data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:border-border\",\n \"data-open:animate-in data-open:fade-in-0\",\n \"data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10\",\n \"data-closed:animate-out data-closed:fade-out-0\",\n \"data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10\",\n className\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <SheetPrimitive.Close data-slot=\"sheet-close\" asChild>\n <Button\n variant=\"ghost\"\n className=\"absolute top-3 end-3\"\n size=\"icon-sm\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </Button>\n </SheetPrimitive.Close>\n )}\n </SheetPrimitive.Content>\n </SheetPrimitive.Portal>\n);\n\nconst SheetHeader = (props: React.ComponentProps<typeof ShadcnSheetHeader>) => (\n <ShadcnSheetHeader {...props} />\n);\n\nconst SheetFooter = (props: React.ComponentProps<typeof ShadcnSheetFooter>) => (\n <ShadcnSheetFooter {...props}
|
|
1
|
+
{"version":3,"file":"Sheet.js","sources":["../../../../src/primitives/Sheet.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Dialog as SheetPrimitive } from \"radix-ui\";\nimport { XIcon } from \"lucide-react\";\nimport { cn } from \"src/shadcn/lib/utils\";\nimport { Button } from \"src/shadcn/components/button\";\n\nimport {\n Sheet as ShadcnSheet,\n SheetTrigger as ShadcnSheetTrigger,\n SheetClose as ShadcnSheetClose,\n SheetHeader as ShadcnSheetHeader,\n SheetFooter as ShadcnSheetFooter,\n SheetTitle as ShadcnSheetTitle,\n SheetDescription as ShadcnSheetDescription,\n} from \"src/shadcn/components/sheet\";\n\nconst Sheet = (props: React.ComponentProps<typeof ShadcnSheet>) => (\n <ShadcnSheet {...props} />\n);\n\nconst SheetTrigger = (\n props: React.ComponentProps<typeof ShadcnSheetTrigger>\n) => <ShadcnSheetTrigger {...props} />;\n\nconst SheetClose = (props: React.ComponentProps<typeof ShadcnSheetClose>) => (\n <ShadcnSheetClose {...props} />\n);\n\n/**\n * SheetContent composes Portal + Overlay + Radix Content directly so\n * the hardcoded max-w-sm is removed and width is fully consumer-controlled.\n */\nconst SheetContent = ({\n className,\n children,\n side = \"right\",\n showCloseButton = true,\n overlayClassName,\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Content> & {\n side?: \"top\" | \"right\" | \"bottom\" | \"left\";\n showCloseButton?: boolean;\n overlayClassName?: string;\n}) => (\n <SheetPrimitive.Portal data-slot=\"sheet-portal\">\n <SheetPrimitive.Overlay\n data-slot=\"sheet-overlay\"\n className={cn(\n \"fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0\",\n overlayClassName\n )}\n />\n <SheetPrimitive.Content\n data-slot=\"sheet-content\"\n data-side={side}\n className={cn(\n \"fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out\",\n \"data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:border-border\",\n \"data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-e data-[side=left]:border-border data-[side=left]:sm:max-w-sm\",\n \"data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-s data-[side=right]:border-border data-[side=right]:sm:max-w-sm\",\n \"data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:border-border\",\n \"data-open:animate-in data-open:fade-in-0\",\n \"data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10\",\n \"data-closed:animate-out data-closed:fade-out-0\",\n \"data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10\",\n className\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <SheetPrimitive.Close data-slot=\"sheet-close\" asChild>\n <Button\n variant=\"ghost\"\n className=\"absolute top-3 end-3\"\n size=\"icon-sm\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </Button>\n </SheetPrimitive.Close>\n )}\n </SheetPrimitive.Content>\n </SheetPrimitive.Portal>\n);\n\nconst SheetHeader = ({\n className,\n ...props\n}: React.ComponentProps<typeof ShadcnSheetHeader>) => (\n <ShadcnSheetHeader className={cn(\"gap-3 p-6\", className)} {...props} />\n);\n\nconst SheetFooter = ({\n className,\n ...props\n}: React.ComponentProps<typeof ShadcnSheetFooter>) => (\n <ShadcnSheetFooter\n className={cn(\"bg-muted/50 px-6 py-4\", className)}\n {...props}\n />\n);\n\nconst SheetTitle = (props: React.ComponentProps<typeof ShadcnSheetTitle>) => (\n <ShadcnSheetTitle {...props} />\n);\n\nconst SheetDescription = (\n props: React.ComponentProps<typeof ShadcnSheetDescription>\n) => <ShadcnSheetDescription {...props} />;\n\nexport {\n Sheet,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n};\n"],"names":["_jsx","ShadcnSheet","ShadcnSheetTrigger","ShadcnSheetClose","_jsxs","SheetPrimitive.Portal","SheetPrimitive.Overlay","cn","SheetPrimitive.Content","SheetPrimitive.Close","Button","XIcon","ShadcnSheetHeader","ShadcnSheetFooter","ShadcnSheetTitle","ShadcnSheetDescription"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,MAAM,KAAK,GAAG,CAAC,KAA+C,MAC5DA,cAAA,CAACC,WAAW,EAAA,EAAA,GAAK,KAAK,EAAA,CAAI;AAG5B,MAAM,YAAY,GAAG,CACnB,KAAsD,KACnDD,cAAA,CAACE,kBAAkB,EAAA,EAAA,GAAK,KAAK,EAAA;AAElC,MAAM,UAAU,GAAG,CAAC,KAAoD,MACtEF,cA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AAEL,QAAE,CAAC,WAAW,EAAE,SAAS,CAAC,EAAA,GAAM,KAAK,EAAA,CAAI;AAGzE,MAAM,WAAW,GAAG,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACuC,MAC/CP,cAAA,CAACa,iBAAiB,EAAA,EAChB,SAAS,EAAEN,QAAE,CAAC,uBAAuB,EAAE,SAAS,CAAC,EAAA,GAC7C,KAAK,EAAA,CACT;AAGJ,MAAM,UAAU,GAAG,CAAC,KAAoD,MACtEP,cAAA,CAACc,gBAAgB,EAAA,EAAA,GAAK,KAAK,EAAA,CAAI;AAGjC,MAAM,gBAAgB,GAAG,CACvB,KAA0D,KACvDd,cAAA,CAACe,sBAAsB,EAAA,EAAA,GAAK,KAAK,EAAA;;;;;;;;;;;"}
|
package/dist/components/index.js
CHANGED
|
@@ -8,7 +8,7 @@ export { C as Checkbox } from '../Checkbox-zCxgcZiC.js';
|
|
|
8
8
|
export { C as ColorPicker } from '../ColorPicker-DtOvy0Gy.js';
|
|
9
9
|
export { D as DataTable, u as useColumnOrdering, a as useColumnPinning, b as useColumnVisibility, c as useTablePagination, d as useTableSelection, e as useTableSort } from '../DataTable-CfcHsQuw.js';
|
|
10
10
|
export { D as DatePicker } from '../DatePicker-RvdQv1LE.js';
|
|
11
|
-
export { D as Dialog } from '../Dialog-
|
|
11
|
+
export { D as Dialog } from '../Dialog-BURSzxaP.js';
|
|
12
12
|
export { DropdownMenu } from './DropdownMenu.js';
|
|
13
13
|
export { E as Empty } from '../Empty-B2JwFmru.js';
|
|
14
14
|
export { I as Input } from '../Input-C1gcv9o2.js';
|
|
@@ -3,7 +3,7 @@ import { useFormikContext } from 'formik';
|
|
|
3
3
|
import { useState, useRef, useCallback, useEffect } from 'react';
|
|
4
4
|
import { useHistory } from 'react-router-dom';
|
|
5
5
|
import { B as Button } from '../Button-Q7MPG6ph.js';
|
|
6
|
-
import { D as Dialog } from '../Dialog-
|
|
6
|
+
import { D as Dialog } from '../Dialog-BURSzxaP.js';
|
|
7
7
|
import '../utils-DdHUxIdC.js';
|
|
8
8
|
import '../renderIcon-tlvMyboj.js';
|
|
9
9
|
import '../primitives/Button.js';
|
package/dist/formik/index.js
CHANGED
|
@@ -85,7 +85,7 @@ import '../primitives/Tooltip.js';
|
|
|
85
85
|
import '../tooltip-XkHLgxlU.js';
|
|
86
86
|
import '../index-CSggBaQF.js';
|
|
87
87
|
import 'react-router-dom';
|
|
88
|
-
import '../Dialog-
|
|
88
|
+
import '../Dialog-BURSzxaP.js';
|
|
89
89
|
import '../primitives/Dialog.js';
|
|
90
90
|
import '../dialog-C6LY-ud7.js';
|
|
91
91
|
import '../index-9HvIbmnI.js';
|
package/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@ import weekday from 'dayjs/plugin/weekday';
|
|
|
16
16
|
import weekOfYear from 'dayjs/plugin/weekOfYear';
|
|
17
17
|
export { T as TranslationProvider, r as translations } from './TranslationProvider-Ba9rn47H.js';
|
|
18
18
|
export { D as DirectionProvider } from './DirectionProvider-DGYDg_He.js';
|
|
19
|
-
export { D as Dialog } from './Dialog-
|
|
19
|
+
export { D as Dialog } from './Dialog-BURSzxaP.js';
|
|
20
20
|
export { DropdownMenu } from './components/DropdownMenu.js';
|
|
21
21
|
export { E as Empty } from './Empty-B2JwFmru.js';
|
|
22
22
|
export { I as Input } from './Input-C1gcv9o2.js';
|
|
@@ -12,8 +12,8 @@ declare const DialogContent: ({ className, children, showCloseButton, overlayCla
|
|
|
12
12
|
overlayClassName?: string;
|
|
13
13
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
declare const DialogDescription: (props: React.ComponentProps<typeof ShadcnDialogDescription>) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
declare const DialogFooter: (props: React.ComponentProps<typeof ShadcnDialogFooter>) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
declare const DialogHeader: (props: React.ComponentProps<typeof ShadcnDialogHeader>) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare const DialogFooter: ({ className, ...props }: React.ComponentProps<typeof ShadcnDialogFooter>) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare const DialogHeader: ({ className, ...props }: React.ComponentProps<typeof ShadcnDialogHeader>) => import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
declare const DialogOverlay: (props: React.ComponentProps<typeof ShadcnDialogOverlay>) => import("react/jsx-runtime").JSX.Element;
|
|
18
18
|
declare const DialogPortal: (props: React.ComponentProps<typeof ShadcnDialogPortal>) => import("react/jsx-runtime").JSX.Element;
|
|
19
19
|
declare const DialogTitle: (props: React.ComponentProps<typeof ShadcnDialogTitle>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -31,8 +31,8 @@ const DialogClose = (props) => (jsx(DialogClose$1, { ...props }));
|
|
|
31
31
|
*/
|
|
32
32
|
const DialogContent = ({ className, children, showCloseButton = true, overlayClassName, ...props }) => (jsxs(DialogPortal$1, { children: [jsx(DialogOverlay$1, { className: overlayClassName }), jsxs(Content, { "data-slot": "dialog-content", className: cn("fixed top-1/2 start-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 rtl:translate-x-1/2 -translate-y-1/2 gap-5 rounded-xl bg-popover p-6 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className), ...props, children: [children, showCloseButton && (jsx(Close, { "data-slot": "dialog-close", asChild: true, children: jsxs(Button, { variant: "ghost", className: "absolute top-2 end-2", size: "icon-sm", children: [jsx(X, {}), jsx("span", { className: "sr-only", children: "Close" })] }) }))] })] }));
|
|
33
33
|
const DialogDescription = (props) => jsx(DialogDescription$1, { ...props });
|
|
34
|
-
const DialogFooter = (props) => jsx(DialogFooter$1, { ...props });
|
|
35
|
-
const DialogHeader = (props) => jsx(DialogHeader$1, { ...props });
|
|
34
|
+
const DialogFooter = ({ className, ...props }) => (jsx(DialogFooter$1, { className: cn("-mx-6 -mb-6 border-t-0 px-6 py-4", className), ...props }));
|
|
35
|
+
const DialogHeader = ({ className, ...props }) => (jsx(DialogHeader$1, { className: cn("gap-3", className), ...props }));
|
|
36
36
|
const DialogOverlay = (props) => jsx(DialogOverlay$1, { ...props });
|
|
37
37
|
const DialogPortal = (props) => jsx(DialogPortal$1, { ...props });
|
|
38
38
|
const DialogTitle = (props) => (jsx(DialogTitle$1, { ...props }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","sources":["../../src/primitives/Dialog.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Dialog as DialogPrimitive } from \"radix-ui\";\nimport { XIcon } from \"lucide-react\";\nimport { cn } from \"src/shadcn/lib/utils\";\nimport { Button } from \"src/shadcn/components/button\";\n\nimport {\n Dialog as ShadcnDialog,\n DialogClose as ShadcnDialogClose,\n DialogDescription as ShadcnDialogDescription,\n DialogFooter as ShadcnDialogFooter,\n DialogHeader as ShadcnDialogHeader,\n DialogOverlay as ShadcnDialogOverlay,\n DialogPortal as ShadcnDialogPortal,\n DialogTitle as ShadcnDialogTitle,\n DialogTrigger as ShadcnDialogTrigger,\n} from \"src/shadcn/components/dialog\";\n\nconst Dialog = (props: React.ComponentProps<typeof ShadcnDialog>) => (\n <ShadcnDialog {...props} />\n);\n\nconst DialogClose = (props: React.ComponentProps<typeof ShadcnDialogClose>) => (\n <ShadcnDialogClose {...props} />\n);\n\n/**\n * DialogContent composes Portal + Overlay + Radix Content so that\n * `overlayClassName` can be forwarded to the overlay element.\n */\nconst DialogContent = ({\n className,\n children,\n showCloseButton = true,\n overlayClassName,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean;\n overlayClassName?: string;\n}) => (\n <ShadcnDialogPortal>\n <ShadcnDialogOverlay className={overlayClassName} />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n \"fixed top-1/2 start-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 rtl:translate-x-1/2 -translate-y-1/2 gap-5 rounded-xl bg-popover p-6 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95\",\n className\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close data-slot=\"dialog-close\" asChild>\n <Button\n variant=\"ghost\"\n className=\"absolute top-2 end-2\"\n size=\"icon-sm\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </Button>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </ShadcnDialogPortal>\n);\n\nconst DialogDescription = (\n props: React.ComponentProps<typeof ShadcnDialogDescription>\n) => <ShadcnDialogDescription {...props} />;\n\nconst DialogFooter = (\n props: React.ComponentProps<typeof ShadcnDialogFooter
|
|
1
|
+
{"version":3,"file":"Dialog.js","sources":["../../src/primitives/Dialog.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Dialog as DialogPrimitive } from \"radix-ui\";\nimport { XIcon } from \"lucide-react\";\nimport { cn } from \"src/shadcn/lib/utils\";\nimport { Button } from \"src/shadcn/components/button\";\n\nimport {\n Dialog as ShadcnDialog,\n DialogClose as ShadcnDialogClose,\n DialogDescription as ShadcnDialogDescription,\n DialogFooter as ShadcnDialogFooter,\n DialogHeader as ShadcnDialogHeader,\n DialogOverlay as ShadcnDialogOverlay,\n DialogPortal as ShadcnDialogPortal,\n DialogTitle as ShadcnDialogTitle,\n DialogTrigger as ShadcnDialogTrigger,\n} from \"src/shadcn/components/dialog\";\n\nconst Dialog = (props: React.ComponentProps<typeof ShadcnDialog>) => (\n <ShadcnDialog {...props} />\n);\n\nconst DialogClose = (props: React.ComponentProps<typeof ShadcnDialogClose>) => (\n <ShadcnDialogClose {...props} />\n);\n\n/**\n * DialogContent composes Portal + Overlay + Radix Content so that\n * `overlayClassName` can be forwarded to the overlay element.\n */\nconst DialogContent = ({\n className,\n children,\n showCloseButton = true,\n overlayClassName,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean;\n overlayClassName?: string;\n}) => (\n <ShadcnDialogPortal>\n <ShadcnDialogOverlay className={overlayClassName} />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n \"fixed top-1/2 start-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 rtl:translate-x-1/2 -translate-y-1/2 gap-5 rounded-xl bg-popover p-6 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95\",\n className\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close data-slot=\"dialog-close\" asChild>\n <Button\n variant=\"ghost\"\n className=\"absolute top-2 end-2\"\n size=\"icon-sm\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </Button>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </ShadcnDialogPortal>\n);\n\nconst DialogDescription = (\n props: React.ComponentProps<typeof ShadcnDialogDescription>\n) => <ShadcnDialogDescription {...props} />;\n\nconst DialogFooter = ({\n className,\n ...props\n}: React.ComponentProps<typeof ShadcnDialogFooter>) => (\n <ShadcnDialogFooter\n className={cn(\"-mx-6 -mb-6 border-t-0 px-6 py-4\", className)}\n {...props}\n />\n);\n\nconst DialogHeader = ({\n className,\n ...props\n}: React.ComponentProps<typeof ShadcnDialogHeader>) => (\n <ShadcnDialogHeader className={cn(\"gap-3\", className)} {...props} />\n);\n\nconst DialogOverlay = (\n props: React.ComponentProps<typeof ShadcnDialogOverlay>\n) => <ShadcnDialogOverlay {...props} />;\n\nconst DialogPortal = (\n props: React.ComponentProps<typeof ShadcnDialogPortal>\n) => <ShadcnDialogPortal {...props} />;\n\nconst DialogTitle = (props: React.ComponentProps<typeof ShadcnDialogTitle>) => (\n <ShadcnDialogTitle {...props} />\n);\n\nconst DialogTrigger = (\n props: React.ComponentProps<typeof ShadcnDialogTrigger>\n) => <ShadcnDialogTrigger {...props} />;\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n"],"names":["_jsx","ShadcnDialog","ShadcnDialogClose","_jsxs","ShadcnDialogPortal","ShadcnDialogOverlay","DialogPrimitive.Content","DialogPrimitive.Close","XIcon","ShadcnDialogDescription","ShadcnDialogFooter","ShadcnDialogHeader","ShadcnDialogTitle","ShadcnDialogTrigger"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAM,MAAM,GAAG,CAAC,KAAgD,MAC9DA,GAAA,CAACC,QAAY,EAAA,EAAA,GAAK,KAAK,EAAA,CAAI;AAG7B,MAAM,WAAW,GAAG,CAAC,KAAqD,MACxED,GAAA,CAACE,aAAiB,EAAA,EAAA,GAAK,KAAK,EAAA,CAAI;AAGlC;;;AAGG;AACH,MAAM,aAAa,GAAG,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,eAAe,GAAG,IAAI,EACtB,gBAAgB,EAChB,GAAG,KAAK,EAIT,MACCC,IAAA,CAACC,cAAkB,EAAA,EAAA,QAAA,EAAA,CACjBJ,GAAA,CAACK,eAAmB,EAAA,EAAC,SAAS,EAAE,gBAAgB,EAAA,CAAI,EACpDF,IAAA,CAACG,OAAuB,EAAA,EAAA,WAAA,EACZ,gBAAgB,EAC1B,SAAS,EAAE,EAAE,CACX,6XAA6X,EAC7X,SAAS,CACV,KACG,KAAK,EAAA,QAAA,EAAA,CAER,QAAQ,EACR,eAAe,KACdN,GAAA,CAACO,KAAqB,iBAAW,cAAc,EAAC,OAAO,EAAA,IAAA,EAAA,QAAA,EACrDJ,IAAA,CAAC,MAAM,EAAA,EACL,OAAO,EAAC,OAAO,EACf,SAAS,EAAC,sBAAsB,EAChC,IAAI,EAAC,SAAS,EAAA,QAAA,EAAA,CAEdH,GAAA,CAACQ,CAAK,EAAA,EAAA,CAAG,EACTR,cAAM,SAAS,EAAC,SAAS,EAAA,QAAA,EAAA,OAAA,EAAA,CAAa,CAAA,EAAA,CAC/B,GACa,CACzB,CAAA,EAAA,CACuB,CAAA,EAAA,CACP;AAGvB,MAAM,iBAAiB,GAAG,CACxB,KAA2D,KACxDA,GAAA,CAACS,mBAAuB,EAAA,EAAA,GAAK,KAAK,EAAA;AAEvC,MAAM,YAAY,GAAG,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EACwC,MAChDT,GAAA,CAACU,cAAkB,EAAA,EACjB,SAAS,EAAE,EAAE,CAAC,kCAAkC,EAAE,SAAS,CAAC,EAAA,GACxD,KAAK,EAAA,CACT;AAGJ,MAAM,YAAY,GAAG,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EACwC,MAChDV,GAAA,CAACW,cAAkB,EAAA,EAAC,SAAS,EAAE,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC,EAAA,GAAM,KAAK,EAAA,CAAI;AAGtE,MAAM,aAAa,GAAG,CACpB,KAAuD,KACpDX,GAAA,CAACK,eAAmB,EAAA,EAAA,GAAK,KAAK,EAAA;AAEnC,MAAM,YAAY,GAAG,CACnB,KAAsD,KACnDL,GAAA,CAACI,cAAkB,EAAA,EAAA,GAAK,KAAK,EAAA;AAElC,MAAM,WAAW,GAAG,CAAC,KAAqD,MACxEJ,GAAA,CAACY,aAAiB,EAAA,EAAA,GAAK,KAAK,EAAA,CAAI;AAGlC,MAAM,aAAa,GAAG,CACpB,KAAuD,KACpDZ,GAAA,CAACa,eAAmB,EAAA,EAAA,GAAK,KAAK,EAAA;;;;"}
|
|
@@ -13,8 +13,8 @@ declare const SheetContent: ({ className, children, side, showCloseButton, overl
|
|
|
13
13
|
showCloseButton?: boolean;
|
|
14
14
|
overlayClassName?: string;
|
|
15
15
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
declare const SheetHeader: (props: React.ComponentProps<typeof ShadcnSheetHeader>) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
declare const SheetFooter: (props: React.ComponentProps<typeof ShadcnSheetFooter>) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare const SheetHeader: ({ className, ...props }: React.ComponentProps<typeof ShadcnSheetHeader>) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
declare const SheetFooter: ({ className, ...props }: React.ComponentProps<typeof ShadcnSheetFooter>) => import("react/jsx-runtime").JSX.Element;
|
|
18
18
|
declare const SheetTitle: (props: React.ComponentProps<typeof ShadcnSheetTitle>) => import("react/jsx-runtime").JSX.Element;
|
|
19
19
|
declare const SheetDescription: (props: React.ComponentProps<typeof ShadcnSheetDescription>) => import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
|
package/dist/primitives/Sheet.js
CHANGED
|
@@ -31,8 +31,8 @@ const SheetClose = (props) => (jsx(SheetClose$1, { ...props }));
|
|
|
31
31
|
* the hardcoded max-w-sm is removed and width is fully consumer-controlled.
|
|
32
32
|
*/
|
|
33
33
|
const SheetContent = ({ className, children, side = "right", showCloseButton = true, overlayClassName, ...props }) => (jsxs(Portal, { "data-slot": "sheet-portal", children: [jsx(Overlay, { "data-slot": "sheet-overlay", className: cn("fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", overlayClassName) }), jsxs(Content, { "data-slot": "sheet-content", "data-side": side, className: cn("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out", "data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:border-border", "data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-e data-[side=left]:border-border data-[side=left]:sm:max-w-sm", "data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-s data-[side=right]:border-border data-[side=right]:sm:max-w-sm", "data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:border-border", "data-open:animate-in data-open:fade-in-0", "data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10", "data-closed:animate-out data-closed:fade-out-0", "data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10", className), ...props, children: [children, showCloseButton && (jsx(Close, { "data-slot": "sheet-close", asChild: true, children: jsxs(Button, { variant: "ghost", className: "absolute top-3 end-3", size: "icon-sm", children: [jsx(X, {}), jsx("span", { className: "sr-only", children: "Close" })] }) }))] })] }));
|
|
34
|
-
const SheetHeader = (props) => (jsx(SheetHeader$1, { ...props }));
|
|
35
|
-
const SheetFooter = (props) => (jsx(SheetFooter$1, { ...props }));
|
|
34
|
+
const SheetHeader = ({ className, ...props }) => (jsx(SheetHeader$1, { className: cn("gap-3 p-6", className), ...props }));
|
|
35
|
+
const SheetFooter = ({ className, ...props }) => (jsx(SheetFooter$1, { className: cn("bg-muted/50 px-6 py-4", className), ...props }));
|
|
36
36
|
const SheetTitle = (props) => (jsx(SheetTitle$1, { ...props }));
|
|
37
37
|
const SheetDescription = (props) => jsx(SheetDescription$1, { ...props });
|
|
38
38
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sheet.js","sources":["../../src/primitives/Sheet.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Dialog as SheetPrimitive } from \"radix-ui\";\nimport { XIcon } from \"lucide-react\";\nimport { cn } from \"src/shadcn/lib/utils\";\nimport { Button } from \"src/shadcn/components/button\";\n\nimport {\n Sheet as ShadcnSheet,\n SheetTrigger as ShadcnSheetTrigger,\n SheetClose as ShadcnSheetClose,\n SheetHeader as ShadcnSheetHeader,\n SheetFooter as ShadcnSheetFooter,\n SheetTitle as ShadcnSheetTitle,\n SheetDescription as ShadcnSheetDescription,\n} from \"src/shadcn/components/sheet\";\n\nconst Sheet = (props: React.ComponentProps<typeof ShadcnSheet>) => (\n <ShadcnSheet {...props} />\n);\n\nconst SheetTrigger = (\n props: React.ComponentProps<typeof ShadcnSheetTrigger>\n) => <ShadcnSheetTrigger {...props} />;\n\nconst SheetClose = (props: React.ComponentProps<typeof ShadcnSheetClose>) => (\n <ShadcnSheetClose {...props} />\n);\n\n/**\n * SheetContent composes Portal + Overlay + Radix Content directly so\n * the hardcoded max-w-sm is removed and width is fully consumer-controlled.\n */\nconst SheetContent = ({\n className,\n children,\n side = \"right\",\n showCloseButton = true,\n overlayClassName,\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Content> & {\n side?: \"top\" | \"right\" | \"bottom\" | \"left\";\n showCloseButton?: boolean;\n overlayClassName?: string;\n}) => (\n <SheetPrimitive.Portal data-slot=\"sheet-portal\">\n <SheetPrimitive.Overlay\n data-slot=\"sheet-overlay\"\n className={cn(\n \"fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0\",\n overlayClassName\n )}\n />\n <SheetPrimitive.Content\n data-slot=\"sheet-content\"\n data-side={side}\n className={cn(\n \"fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out\",\n \"data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:border-border\",\n \"data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-e data-[side=left]:border-border data-[side=left]:sm:max-w-sm\",\n \"data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-s data-[side=right]:border-border data-[side=right]:sm:max-w-sm\",\n \"data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:border-border\",\n \"data-open:animate-in data-open:fade-in-0\",\n \"data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10\",\n \"data-closed:animate-out data-closed:fade-out-0\",\n \"data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10\",\n className\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <SheetPrimitive.Close data-slot=\"sheet-close\" asChild>\n <Button\n variant=\"ghost\"\n className=\"absolute top-3 end-3\"\n size=\"icon-sm\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </Button>\n </SheetPrimitive.Close>\n )}\n </SheetPrimitive.Content>\n </SheetPrimitive.Portal>\n);\n\nconst SheetHeader = (props: React.ComponentProps<typeof ShadcnSheetHeader>) => (\n <ShadcnSheetHeader {...props} />\n);\n\nconst SheetFooter = (props: React.ComponentProps<typeof ShadcnSheetFooter>) => (\n <ShadcnSheetFooter {...props}
|
|
1
|
+
{"version":3,"file":"Sheet.js","sources":["../../src/primitives/Sheet.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Dialog as SheetPrimitive } from \"radix-ui\";\nimport { XIcon } from \"lucide-react\";\nimport { cn } from \"src/shadcn/lib/utils\";\nimport { Button } from \"src/shadcn/components/button\";\n\nimport {\n Sheet as ShadcnSheet,\n SheetTrigger as ShadcnSheetTrigger,\n SheetClose as ShadcnSheetClose,\n SheetHeader as ShadcnSheetHeader,\n SheetFooter as ShadcnSheetFooter,\n SheetTitle as ShadcnSheetTitle,\n SheetDescription as ShadcnSheetDescription,\n} from \"src/shadcn/components/sheet\";\n\nconst Sheet = (props: React.ComponentProps<typeof ShadcnSheet>) => (\n <ShadcnSheet {...props} />\n);\n\nconst SheetTrigger = (\n props: React.ComponentProps<typeof ShadcnSheetTrigger>\n) => <ShadcnSheetTrigger {...props} />;\n\nconst SheetClose = (props: React.ComponentProps<typeof ShadcnSheetClose>) => (\n <ShadcnSheetClose {...props} />\n);\n\n/**\n * SheetContent composes Portal + Overlay + Radix Content directly so\n * the hardcoded max-w-sm is removed and width is fully consumer-controlled.\n */\nconst SheetContent = ({\n className,\n children,\n side = \"right\",\n showCloseButton = true,\n overlayClassName,\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Content> & {\n side?: \"top\" | \"right\" | \"bottom\" | \"left\";\n showCloseButton?: boolean;\n overlayClassName?: string;\n}) => (\n <SheetPrimitive.Portal data-slot=\"sheet-portal\">\n <SheetPrimitive.Overlay\n data-slot=\"sheet-overlay\"\n className={cn(\n \"fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0\",\n overlayClassName\n )}\n />\n <SheetPrimitive.Content\n data-slot=\"sheet-content\"\n data-side={side}\n className={cn(\n \"fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out\",\n \"data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:border-border\",\n \"data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-e data-[side=left]:border-border data-[side=left]:sm:max-w-sm\",\n \"data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-s data-[side=right]:border-border data-[side=right]:sm:max-w-sm\",\n \"data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:border-border\",\n \"data-open:animate-in data-open:fade-in-0\",\n \"data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10\",\n \"data-closed:animate-out data-closed:fade-out-0\",\n \"data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10\",\n className\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <SheetPrimitive.Close data-slot=\"sheet-close\" asChild>\n <Button\n variant=\"ghost\"\n className=\"absolute top-3 end-3\"\n size=\"icon-sm\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </Button>\n </SheetPrimitive.Close>\n )}\n </SheetPrimitive.Content>\n </SheetPrimitive.Portal>\n);\n\nconst SheetHeader = ({\n className,\n ...props\n}: React.ComponentProps<typeof ShadcnSheetHeader>) => (\n <ShadcnSheetHeader className={cn(\"gap-3 p-6\", className)} {...props} />\n);\n\nconst SheetFooter = ({\n className,\n ...props\n}: React.ComponentProps<typeof ShadcnSheetFooter>) => (\n <ShadcnSheetFooter\n className={cn(\"bg-muted/50 px-6 py-4\", className)}\n {...props}\n />\n);\n\nconst SheetTitle = (props: React.ComponentProps<typeof ShadcnSheetTitle>) => (\n <ShadcnSheetTitle {...props} />\n);\n\nconst SheetDescription = (\n props: React.ComponentProps<typeof ShadcnSheetDescription>\n) => <ShadcnSheetDescription {...props} />;\n\nexport {\n Sheet,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n};\n"],"names":["_jsx","ShadcnSheet","ShadcnSheetTrigger","ShadcnSheetClose","_jsxs","SheetPrimitive.Portal","SheetPrimitive.Overlay","SheetPrimitive.Content","SheetPrimitive.Close","XIcon","ShadcnSheetHeader","ShadcnSheetFooter","ShadcnSheetTitle","ShadcnSheetDescription"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,MAAM,KAAK,GAAG,CAAC,KAA+C,MAC5DA,GAAA,CAACC,OAAW,EAAA,EAAA,GAAK,KAAK,EAAA,CAAI;AAG5B,MAAM,YAAY,GAAG,CACnB,KAAsD,KACnDD,GAAA,CAACE,cAAkB,EAAA,EAAA,GAAK,KAAK,EAAA;AAElC,MAAM,UAAU,GAAG,CAAC,KAAoD,MACtEF,GAAA,CAACG,YAAgB,EAAA,EAAA,GAAK,KAAK,EAAA,CAAI;AAGjC;;;AAGG;AACH,MAAM,YAAY,GAAG,CAAC,EACpB,SAAS,EACT,QAAQ,EACR,IAAI,GAAG,OAAO,EACd,eAAe,GAAG,IAAI,EACtB,gBAAgB,EAChB,GAAG,KAAK,EAKT,MACCC,IAAA,CAACC,MAAqB,EAAA,EAAA,WAAA,EAAW,cAAc,EAAA,QAAA,EAAA,CAC7CL,GAAA,CAACM,OAAsB,EAAA,EAAA,WAAA,EACX,eAAe,EACzB,SAAS,EAAE,EAAE,CACX,+KAA+K,EAC/K,gBAAgB,CACjB,EAAA,CACD,EACFF,IAAA,CAACG,OAAsB,EAAA,EAAA,WAAA,EACX,eAAe,EAAA,WAAA,EACd,IAAI,EACf,SAAS,EAAE,EAAE,CACX,yIAAyI,EACzI,iJAAiJ,EACjJ,yLAAyL,EACzL,iMAAiM,EACjM,+HAA+H,EAC/H,0CAA0C,EAC1C,yMAAyM,EACzM,gDAAgD,EAChD,6MAA6M,EAC7M,SAAS,CACV,EAAA,GACG,KAAK,EAAA,QAAA,EAAA,CAER,QAAQ,EACR,eAAe,KACdP,GAAA,CAACQ,KAAoB,iBAAW,aAAa,EAAC,OAAO,EAAA,IAAA,EAAA,QAAA,EACnDJ,IAAA,CAAC,MAAM,EAAA,EACL,OAAO,EAAC,OAAO,EACf,SAAS,EAAC,sBAAsB,EAChC,IAAI,EAAC,SAAS,EAAA,QAAA,EAAA,CAEdJ,GAAA,CAACS,CAAK,EAAA,EAAA,CAAG,EACTT,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,SAAS,EAAA,QAAA,EAAA,OAAA,EAAA,CAAa,CAAA,EAAA,CAC/B,EAAA,CACY,CACxB,CAAA,EAAA,CACsB,CAAA,EAAA,CACH;AAG1B,MAAM,WAAW,GAAG,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACuC,MAC/CA,GAAA,CAACU,aAAiB,EAAA,EAAC,SAAS,EAAE,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC,EAAA,GAAM,KAAK,EAAA,CAAI;AAGzE,MAAM,WAAW,GAAG,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACuC,MAC/CV,GAAA,CAACW,aAAiB,EAAA,EAChB,SAAS,EAAE,EAAE,CAAC,uBAAuB,EAAE,SAAS,CAAC,EAAA,GAC7C,KAAK,EAAA,CACT;AAGJ,MAAM,UAAU,GAAG,CAAC,KAAoD,MACtEX,GAAA,CAACY,YAAgB,EAAA,EAAA,GAAK,KAAK,EAAA,CAAI;AAGjC,MAAM,gBAAgB,GAAG,CACvB,KAA0D,KACvDZ,GAAA,CAACa,kBAAsB,EAAA,EAAA,GAAK,KAAK,EAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog-B2dcw0Zz.js","sources":["../src/components/Dialog/constants.ts","../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import type { DialogSize } from \"./Dialog\";\n\nexport const SIZE_CLASS_MAP: Record<DialogSize, string> = {\n small: \"sm:max-w-sm\",\n medium: \"sm:max-w-md\",\n large: \"sm:max-w-lg\",\n fullScreen: \"h-screen w-screen max-w-none rounded-none sm:max-w-none\",\n};\n","import React, { forwardRef, type ReactNode, type RefObject } from \"react\";\n\nimport { cn } from \"src/shadcn/lib/utils\";\nimport {\n Dialog as PrimitiveDialog,\n DialogContent as PrimitiveDialogContent,\n DialogDescription,\n DialogFooter as PrimitiveDialogFooter,\n DialogHeader as PrimitiveDialogHeader,\n DialogTitle as PrimitiveDialogTitle,\n} from \"src/primitives/Dialog\";\n\nimport { SIZE_CLASS_MAP } from \"./constants\";\n\nexport type DialogSize = \"small\" | \"medium\" | \"large\" | \"fullScreen\";\n\n/** Radix Dialog.Content props we forward via ...otherProps. */\ntype DialogContentProps = React.ComponentProps<typeof PrimitiveDialogContent>;\n\nexport interface DialogProps extends Omit<\n DialogContentProps,\n | \"children\"\n | \"className\"\n | \"showCloseButton\"\n | \"onEscapeKeyDown\"\n | \"onInteractOutside\"\n> {\n /** Size of the dialog. */\n size?: DialogSize;\n /** Whether the dialog is open. */\n isOpen?: boolean;\n /** Callback invoked when the dialog is closed. */\n onClose?: () => void;\n /** Content rendered inside the dialog. */\n children?: ReactNode;\n /** Additional CSS class names applied to the dialog content. */\n className?: string;\n /** Close on pressing the Esc key. */\n closeOnEsc?: boolean;\n /** Show the close button. */\n closeButton?: boolean;\n /** Additional CSS class names applied to the backdrop/overlay. */\n backdropClassName?: string;\n /** Close on clicking outside the dialog. */\n closeOnOutsideClick?: boolean;\n /** Ref of the element to receive focus when the dialog opens. */\n initialFocusRef?: RefObject<HTMLElement | null>;\n /** Ref of the element to receive focus when the dialog closes. */\n finalFocusRef?: RefObject<HTMLElement | null>;\n /** Whether to block body scroll when the dialog is mounted. Maps to Radix `modal` prop. */\n blockScrollOnMount?: boolean;\n /** Force children to re-render even when the dialog is closed. */\n forceRender?: boolean;\n /** Radix Dialog `modal` prop — takes precedence over blockScrollOnMount. */\n modal?: boolean;\n /** Radix Dialog `defaultOpen` prop. */\n defaultOpen?: boolean;\n}\n\ninterface DialogSubcomponentProps extends React.ComponentProps<\"div\"> {\n children?: ReactNode;\n className?: string;\n /** Custom data-testid attribute. */\n dataTestid?: string;\n}\n\nconst DialogHeader = forwardRef<\n HTMLDivElement,\n DialogSubcomponentProps & { description?: string }\n>(({ children, className, description, dataTestid, ...otherProps }, ref) => (\n <PrimitiveDialogHeader\n ref={ref}\n className={cn(className)}\n data-testid={dataTestid ?? \"dialog-header\"}\n {...otherProps}\n >\n {children}\n {description && <DialogDescription>{description}</DialogDescription>}\n </PrimitiveDialogHeader>\n));\nDialogHeader.displayName = \"Dialog.Header\";\n\nconst DialogBody = forwardRef<HTMLDivElement, DialogSubcomponentProps>(\n ({ children, className, dataTestid, ...otherProps }, ref) => (\n <div\n ref={ref}\n data-slot=\"dialog-body\"\n data-testid={dataTestid ?? \"dialog-body\"}\n className={cn(\"text-sm text-foreground\", className)}\n {...otherProps}\n >\n {children}\n </div>\n )\n);\nDialogBody.displayName = \"Dialog.Body\";\n\nconst DialogFooter = forwardRef<HTMLDivElement, DialogSubcomponentProps>(\n ({ children, className, dataTestid, ...otherProps }, ref) => (\n <PrimitiveDialogFooter\n ref={ref}\n className={cn(\"border-border\", className)}\n data-testid={dataTestid ?? \"dialog-footer\"}\n {...otherProps}\n >\n {children}\n </PrimitiveDialogFooter>\n )\n);\nDialogFooter.displayName = \"Dialog.Footer\";\n\nconst DialogTitle = forwardRef<\n HTMLHeadingElement,\n React.ComponentProps<typeof PrimitiveDialogTitle>\n>(({ children, className, ...otherProps }, ref) => (\n <PrimitiveDialogTitle\n ref={ref}\n className={cn(\"text-2xl font-semibold\", className)}\n {...otherProps}\n >\n {children}\n </PrimitiveDialogTitle>\n));\nDialogTitle.displayName = \"Dialog.Title\";\n\nconst Dialog = forwardRef<HTMLDivElement, DialogProps>(\n (\n {\n size = \"medium\",\n isOpen = false,\n onClose = () => {},\n children,\n className,\n closeOnEsc = true,\n closeButton = true,\n backdropClassName,\n closeOnOutsideClick = true,\n initialFocusRef,\n finalFocusRef,\n blockScrollOnMount = true,\n forceRender = false,\n modal: modalProp,\n defaultOpen,\n // Radix content handlers — intercept and merge\n onOpenAutoFocus: onOpenAutoFocusProp,\n onCloseAutoFocus: onCloseAutoFocusProp,\n ...otherContentProps\n },\n ref\n ) => {\n const handleOpenChange = (open: boolean) => {\n if (!open) onClose();\n };\n\n const handleInteractOutside = (e: Event) => {\n if (!closeOnOutsideClick) e.preventDefault();\n };\n\n const handleEscapeKeyDown = (e: KeyboardEvent) => {\n if (!closeOnEsc) e.preventDefault();\n };\n\n const handleOpenAutoFocus = (e: Event) => {\n if (initialFocusRef?.current) {\n e.preventDefault();\n initialFocusRef.current.focus();\n }\n onOpenAutoFocusProp?.(e);\n };\n\n const handleCloseAutoFocus = (e: Event) => {\n if (finalFocusRef?.current) {\n e.preventDefault();\n finalFocusRef.current.focus();\n }\n onCloseAutoFocusProp?.(e);\n };\n\n // `modal` prop takes precedence; fall back to blockScrollOnMount\n const resolvedModal = modalProp ?? blockScrollOnMount;\n\n return (\n <PrimitiveDialog\n open={isOpen}\n onOpenChange={handleOpenChange}\n modal={resolvedModal}\n defaultOpen={defaultOpen}\n >\n <PrimitiveDialogContent\n ref={ref}\n aria-modal\n showCloseButton={closeButton}\n forceMount={forceRender || undefined}\n overlayClassName={backdropClassName}\n onInteractOutside={handleInteractOutside}\n onEscapeKeyDown={handleEscapeKeyDown}\n onOpenAutoFocus={handleOpenAutoFocus}\n onCloseAutoFocus={handleCloseAutoFocus}\n className={cn(SIZE_CLASS_MAP[size], className)}\n data-testid=\"dialog-wrapper\"\n {...otherContentProps}\n >\n {children}\n </PrimitiveDialogContent>\n </PrimitiveDialog>\n );\n }\n) as React.ForwardRefExoticComponent<\n DialogProps & React.RefAttributes<HTMLDivElement>\n> & {\n Header: typeof DialogHeader;\n Body: typeof DialogBody;\n Footer: typeof DialogFooter;\n Title: typeof DialogTitle;\n};\n\nDialog.displayName = \"Dialog\";\nDialog.Header = DialogHeader;\nDialog.Body = DialogBody;\nDialog.Footer = DialogFooter;\nDialog.Title = Dial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B,CAAC;AAUH,MAAM,CAAC,WAAW,GAAG,QAAQ;AAC7B,MAAM,CAAC,MAAM,GAAG,YAAY;AAC5B,MAAM,CAAC,IAAI,GAAG,UAAU;AACxB,MAAM,CAAC,MAAM,GAAG,YAAY;AAC5B,MAAM,CAAC,KAAK,GAAG,WAAW;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog-dYYmRaZU.js","sources":["../../../src/components/Dialog/constants.ts","../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import type { DialogSize } from \"./Dialog\";\n\nexport const SIZE_CLASS_MAP: Record<DialogSize, string> = {\n small: \"sm:max-w-sm\",\n medium: \"sm:max-w-md\",\n large: \"sm:max-w-lg\",\n fullScreen: \"h-screen w-screen max-w-none rounded-none sm:max-w-none\",\n};\n","import React, { forwardRef, type ReactNode, type RefObject } from \"react\";\n\nimport { cn } from \"src/shadcn/lib/utils\";\nimport {\n Dialog as PrimitiveDialog,\n DialogContent as PrimitiveDialogContent,\n DialogDescription,\n DialogFooter as PrimitiveDialogFooter,\n DialogHeader as PrimitiveDialogHeader,\n DialogTitle as PrimitiveDialogTitle,\n} from \"src/primitives/Dialog\";\n\nimport { SIZE_CLASS_MAP } from \"./constants\";\n\nexport type DialogSize = \"small\" | \"medium\" | \"large\" | \"fullScreen\";\n\n/** Radix Dialog.Content props we forward via ...otherProps. */\ntype DialogContentProps = React.ComponentProps<typeof PrimitiveDialogContent>;\n\nexport interface DialogProps extends Omit<\n DialogContentProps,\n | \"children\"\n | \"className\"\n | \"showCloseButton\"\n | \"onEscapeKeyDown\"\n | \"onInteractOutside\"\n> {\n /** Size of the dialog. */\n size?: DialogSize;\n /** Whether the dialog is open. */\n isOpen?: boolean;\n /** Callback invoked when the dialog is closed. */\n onClose?: () => void;\n /** Content rendered inside the dialog. */\n children?: ReactNode;\n /** Additional CSS class names applied to the dialog content. */\n className?: string;\n /** Close on pressing the Esc key. */\n closeOnEsc?: boolean;\n /** Show the close button. */\n closeButton?: boolean;\n /** Additional CSS class names applied to the backdrop/overlay. */\n backdropClassName?: string;\n /** Close on clicking outside the dialog. */\n closeOnOutsideClick?: boolean;\n /** Ref of the element to receive focus when the dialog opens. */\n initialFocusRef?: RefObject<HTMLElement | null>;\n /** Ref of the element to receive focus when the dialog closes. */\n finalFocusRef?: RefObject<HTMLElement | null>;\n /** Whether to block body scroll when the dialog is mounted. Maps to Radix `modal` prop. */\n blockScrollOnMount?: boolean;\n /** Force children to re-render even when the dialog is closed. */\n forceRender?: boolean;\n /** Radix Dialog `modal` prop — takes precedence over blockScrollOnMount. */\n modal?: boolean;\n /** Radix Dialog `defaultOpen` prop. */\n defaultOpen?: boolean;\n}\n\ninterface DialogSubcomponentProps extends React.ComponentProps<\"div\"> {\n children?: ReactNode;\n className?: string;\n /** Custom data-testid attribute. */\n dataTestid?: string;\n}\n\nconst DialogHeader = forwardRef<\n HTMLDivElement,\n DialogSubcomponentProps & { description?: string }\n>(({ children, className, description, dataTestid, ...otherProps }, ref) => (\n <PrimitiveDialogHeader\n ref={ref}\n className={cn(className)}\n data-testid={dataTestid ?? \"dialog-header\"}\n {...otherProps}\n >\n {children}\n {description && <DialogDescription>{description}</DialogDescription>}\n </PrimitiveDialogHeader>\n));\nDialogHeader.displayName = \"Dialog.Header\";\n\nconst DialogBody = forwardRef<HTMLDivElement, DialogSubcomponentProps>(\n ({ children, className, dataTestid, ...otherProps }, ref) => (\n <div\n ref={ref}\n data-slot=\"dialog-body\"\n data-testid={dataTestid ?? \"dialog-body\"}\n className={cn(\"text-sm text-foreground\", className)}\n {...otherProps}\n >\n {children}\n </div>\n )\n);\nDialogBody.displayName = \"Dialog.Body\";\n\nconst DialogFooter = forwardRef<HTMLDivElement, DialogSubcomponentProps>(\n ({ children, className, dataTestid, ...otherProps }, ref) => (\n <PrimitiveDialogFooter\n ref={ref}\n className={cn(\"border-border\", className)}\n data-testid={dataTestid ?? \"dialog-footer\"}\n {...otherProps}\n >\n {children}\n </PrimitiveDialogFooter>\n )\n);\nDialogFooter.displayName = \"Dialog.Footer\";\n\nconst DialogTitle = forwardRef<\n HTMLHeadingElement,\n React.ComponentProps<typeof PrimitiveDialogTitle>\n>(({ children, className, ...otherProps }, ref) => (\n <PrimitiveDialogTitle\n ref={ref}\n className={cn(\"text-2xl font-semibold\", className)}\n {...otherProps}\n >\n {children}\n </PrimitiveDialogTitle>\n));\nDialogTitle.displayName = \"Dialog.Title\";\n\nconst Dialog = forwardRef<HTMLDivElement, DialogProps>(\n (\n {\n size = \"medium\",\n isOpen = false,\n onClose = () => {},\n children,\n className,\n closeOnEsc = true,\n closeButton = true,\n backdropClassName,\n closeOnOutsideClick = true,\n initialFocusRef,\n finalFocusRef,\n blockScrollOnMount = true,\n forceRender = false,\n modal: modalProp,\n defaultOpen,\n // Radix content handlers — intercept and merge\n onOpenAutoFocus: onOpenAutoFocusProp,\n onCloseAutoFocus: onCloseAutoFocusProp,\n ...otherContentProps\n },\n ref\n ) => {\n const handleOpenChange = (open: boolean) => {\n if (!open) onClose();\n };\n\n const handleInteractOutside = (e: Event) => {\n if (!closeOnOutsideClick) e.preventDefault();\n };\n\n const handleEscapeKeyDown = (e: KeyboardEvent) => {\n if (!closeOnEsc) e.preventDefault();\n };\n\n const handleOpenAutoFocus = (e: Event) => {\n if (initialFocusRef?.current) {\n e.preventDefault();\n initialFocusRef.current.focus();\n }\n onOpenAutoFocusProp?.(e);\n };\n\n const handleCloseAutoFocus = (e: Event) => {\n if (finalFocusRef?.current) {\n e.preventDefault();\n finalFocusRef.current.focus();\n }\n onCloseAutoFocusProp?.(e);\n };\n\n // `modal` prop takes precedence; fall back to blockScrollOnMount\n const resolvedModal = modalProp ?? blockScrollOnMount;\n\n return (\n <PrimitiveDialog\n open={isOpen}\n onOpenChange={handleOpenChange}\n modal={resolvedModal}\n defaultOpen={defaultOpen}\n >\n <PrimitiveDialogContent\n ref={ref}\n aria-modal\n showCloseButton={closeButton}\n forceMount={forceRender || undefined}\n overlayClassName={backdropClassName}\n onInteractOutside={handleInteractOutside}\n onEscapeKeyDown={handleEscapeKeyDown}\n onOpenAutoFocus={handleOpenAutoFocus}\n onCloseAutoFocus={handleCloseAutoFocus}\n className={cn(SIZE_CLASS_MAP[size], className)}\n data-testid=\"dialog-wrapper\"\n {...otherContentProps}\n >\n {children}\n </PrimitiveDialogContent>\n </PrimitiveDialog>\n );\n }\n) as React.ForwardRefExoticComponent<\n DialogProps & React.RefAttributes<HTMLDivElement>\n> & {\n Header: typeof DialogHeader;\n Body: typeof DialogBody;\n Footer: typeof DialogFooter;\n Title: typeof DialogTitle;\n};\n\nDialog.displayName = \"Dialog\";\nDialog.Header = DialogHeader;\nDialog.Body = DialogBody;\nDialog.Footer = DialogFooter;\nDialog.Title = DialogTitle;\n\nexport { Dialog };\n"],"names":["forwardRef","_jsxs","PrimitiveDialogHeader","cn","_jsx","DialogDescription","PrimitiveDialogFooter","PrimitiveDialogTitle","PrimitiveDialog","PrimitiveDialogContent"],"mappings":";;;;;;;AAEO,MAAM,cAAc,GAA+B;AACxD,IAAA,KAAK,EAAE,aAAa;AACpB,IAAA,MAAM,EAAE,aAAa;AACrB,IAAA,KAAK,EAAE,aAAa;AACpB,IAAA,UAAU,EAAE,yDAAyD;CACtE;;AC2DD,MAAM,YAAY,GAAGA,gBAAU,CAG7B,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,UAAU,EAAE,EAAE,GAAG,MACrEC,eAAA,CAACC,8BAAqB,EAAA,EACpB,GAAG,EAAE,GAAG,EACR,SAAS,EAAEC,QAAE,CAAC,SAAS,CAAC,EAAA,aAAA,EACX,UAAU,IAAI,eAAe,EAAA,GACtC,UAAU,aAEb,QAAQ,EACR,WAAW,IAAIC,cAAA,CAACC,mCAAiB,EAAA,EAAA,QAAA,EAAE,WAAW,EAAA,CAAqB,CAAA,EAAA,CAC9C,CACzB,CAAC;AACF,YAAY,CAAC,WAAW,GAAG,eAAe;AAE1C,M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