@bigbinary/neeto-atoms 1.0.22 → 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/{Callout-B0w4GQtx.js → Callout-CTr3dhBe.js} +6 -6
- package/dist/Callout-CTr3dhBe.js.map +1 -0
- package/dist/{Dialog-B2dcw0Zz.js → Dialog-BURSzxaP.js} +2 -2
- package/dist/Dialog-BURSzxaP.js.map +1 -0
- package/dist/{Sheet-Euk-9qwX.js → Sheet-B99vGwLH.js} +3 -3
- package/dist/Sheet-B99vGwLH.js.map +1 -0
- package/dist/cjs/{Callout-CS2U6pM7.js → Callout-CVNpjTde.js} +6 -6
- package/dist/cjs/Callout-CVNpjTde.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/{Sheet-DLiIp0UN.js → Sheet-BTZe2VQk.js} +3 -3
- package/dist/cjs/Sheet-BTZe2VQk.js.map +1 -0
- package/dist/cjs/components/Alert.js +1 -1
- package/dist/cjs/components/Callout.js +1 -1
- package/dist/cjs/components/Dialog.js +2 -2
- package/dist/cjs/components/Sheet.js +2 -2
- package/dist/cjs/components/index.js +5 -5
- package/dist/cjs/{dialog-gFvX2Ajp.js → dialog-3nRssoAl.js} +4 -4
- package/dist/cjs/dialog-3nRssoAl.js.map +1 -0
- package/dist/cjs/formik/BlockNavigation.js +2 -2
- package/dist/cjs/formik/index.js +2 -2
- package/dist/cjs/index.js +5 -5
- package/dist/cjs/primitives/Command.js +1 -1
- package/dist/cjs/primitives/Dialog.js +4 -4
- package/dist/cjs/primitives/Dialog.js.map +1 -1
- package/dist/cjs/primitives/Sheet.js +3 -3
- package/dist/cjs/primitives/Sheet.js.map +1 -1
- package/dist/cjs/primitives/Sidebar.js +1 -1
- package/dist/cjs/primitives/Sonner.js +4 -4
- package/dist/cjs/primitives/Sonner.js.map +1 -1
- package/dist/cjs/primitives/index.js +2 -2
- package/dist/cjs/{sheet-DKAYuObu.js → sheet-BG5iB_da.js} +3 -3
- package/dist/cjs/{sheet-DKAYuObu.js.map → sheet-BG5iB_da.js.map} +1 -1
- package/dist/components/Alert.js +1 -1
- package/dist/components/Callout.js +1 -1
- package/dist/components/Dialog.js +2 -2
- package/dist/components/Sheet.js +2 -2
- package/dist/components/index.js +5 -5
- package/dist/{dialog-BkQ_IcCo.js → dialog-C6LY-ud7.js} +4 -4
- package/dist/dialog-C6LY-ud7.js.map +1 -0
- package/dist/formik/BlockNavigation.js +2 -2
- package/dist/formik/index.js +2 -2
- package/dist/index.css +68 -16
- package/dist/index.js +5 -5
- package/dist/primitives/Command.js +1 -1
- package/dist/primitives/Dialog.d.ts +2 -2
- package/dist/primitives/Dialog.js +4 -4
- package/dist/primitives/Dialog.js.map +1 -1
- package/dist/primitives/Sheet.d.ts +2 -2
- package/dist/primitives/Sheet.js +3 -3
- package/dist/primitives/Sheet.js.map +1 -1
- package/dist/primitives/Sidebar.js +1 -1
- package/dist/primitives/Sonner.js +4 -4
- package/dist/primitives/Sonner.js.map +1 -1
- package/dist/primitives/index.js +2 -2
- package/dist/{sheet-DMzfkVV_.js → sheet-BbO8NwBJ.js} +3 -3
- package/dist/{sheet-DMzfkVV_.js.map → sheet-BbO8NwBJ.js.map} +1 -1
- package/package.json +1 -1
- package/dist/Callout-B0w4GQtx.js.map +0 -1
- package/dist/Dialog-B2dcw0Zz.js.map +0 -1
- package/dist/Sheet-Euk-9qwX.js.map +0 -1
- package/dist/cjs/Callout-CS2U6pM7.js.map +0 -1
- package/dist/cjs/Dialog-dYYmRaZU.js.map +0 -1
- package/dist/cjs/Sheet-DLiIp0UN.js.map +0 -1
- package/dist/cjs/dialog-gFvX2Ajp.js.map +0 -1
- package/dist/dialog-BkQ_IcCo.js.map +0 -1
|
@@ -37,19 +37,19 @@ const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode);
|
|
|
37
37
|
|
|
38
38
|
const VARIANT_CONFIG = {
|
|
39
39
|
info: {
|
|
40
|
-
container: "border-
|
|
40
|
+
container: "border border-info-border bg-info text-info-foreground",
|
|
41
41
|
icon: Info,
|
|
42
42
|
},
|
|
43
43
|
warning: {
|
|
44
|
-
container: "border-
|
|
44
|
+
container: "border border-warning-border bg-warning text-warning-foreground",
|
|
45
45
|
icon: TriangleAlert,
|
|
46
46
|
},
|
|
47
47
|
danger: {
|
|
48
|
-
container: "border-
|
|
48
|
+
container: "border border-error-border bg-error text-error-foreground",
|
|
49
49
|
icon: CircleAlert,
|
|
50
50
|
},
|
|
51
51
|
success: {
|
|
52
|
-
container: "border-
|
|
52
|
+
container: "border border-success-border bg-success text-success-foreground",
|
|
53
53
|
icon: CircleCheckBig,
|
|
54
54
|
},
|
|
55
55
|
};
|
|
@@ -57,9 +57,9 @@ const VARIANT_CONFIG = {
|
|
|
57
57
|
const Callout = forwardRef(({ variant = "info", icon, title, children, className, ...otherProps }, ref) => {
|
|
58
58
|
const config = VARIANT_CONFIG[variant];
|
|
59
59
|
const resolvedIcon = icon ?? config.icon;
|
|
60
|
-
return (jsxs(Alert, { ref: ref, className: cn(config.container, className), ...otherProps, children: [renderIcon(resolvedIcon, "size-4 shrink-0"), title && jsx(AlertTitle, { children: title }), children && (jsx(AlertDescription, { className: "text-current
|
|
60
|
+
return (jsxs(Alert, { ref: ref, className: cn(config.container, className), ...otherProps, children: [renderIcon(resolvedIcon, "size-4 shrink-0"), title && jsx(AlertTitle, { className: "font-semibold", children: title }), children && (jsx(AlertDescription, { className: "text-current", children: children }))] }));
|
|
61
61
|
});
|
|
62
62
|
Callout.displayName = "Callout";
|
|
63
63
|
|
|
64
64
|
export { Callout as C };
|
|
65
|
-
//# sourceMappingURL=Callout-
|
|
65
|
+
//# sourceMappingURL=Callout-CTr3dhBe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Callout-CTr3dhBe.js","sources":["../node_modules/lucide-react/dist/esm/icons/circle-alert.js","../node_modules/lucide-react/dist/esm/icons/circle-check-big.js","../src/components/Callout/constants.ts","../src/components/Callout/Callout.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.577.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"line\", { x1: \"12\", x2: \"12\", y1: \"8\", y2: \"12\", key: \"1pkeuh\" }],\n [\"line\", { x1: \"12\", x2: \"12.01\", y1: \"16\", y2: \"16\", key: \"4dfq90\" }]\n];\nconst CircleAlert = createLucideIcon(\"circle-alert\", __iconNode);\n\nexport { __iconNode, CircleAlert as default };\n//# sourceMappingURL=circle-alert.js.map\n","/**\n * @license lucide-react v0.577.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M21.801 10A10 10 0 1 1 17 3.335\", key: \"yps3ct\" }],\n [\"path\", { d: \"m9 11 3 3L22 4\", key: \"1pflzl\" }]\n];\nconst CircleCheckBig = createLucideIcon(\"circle-check-big\", __iconNode);\n\nexport { __iconNode, CircleCheckBig as default };\n//# sourceMappingURL=circle-check-big.js.map\n","import React from \"react\";\n\nimport {\n InfoIcon,\n AlertTriangleIcon,\n AlertCircleIcon,\n CheckCircleIcon,\n} from \"lucide-react\";\n\nimport type { CalloutVariant } from \"./Callout\";\n\nexport const VARIANT_CONFIG: Record<\n CalloutVariant,\n {\n container: string;\n icon: React.ComponentType<{ className?: string }>;\n }\n> = {\n info: {\n container: \"border border-info-border bg-info text-info-foreground\",\n icon: InfoIcon,\n },\n warning: {\n container:\n \"border border-warning-border bg-warning text-warning-foreground\",\n icon: AlertTriangleIcon,\n },\n danger: {\n container: \"border border-error-border bg-error text-error-foreground\",\n icon: AlertCircleIcon,\n },\n success: {\n container:\n \"border border-success-border bg-success text-success-foreground\",\n icon: CheckCircleIcon,\n },\n};\n","import React, { forwardRef } from \"react\";\n\nimport {\n Alert as PrimitiveAlert,\n AlertTitle,\n AlertDescription,\n} from \"src/primitives/Alert\";\nimport { cn } from \"src/shadcn/lib/utils\";\nimport { renderIcon, type IconProp } from \"src/lib/renderIcon\";\n\nimport { VARIANT_CONFIG } from \"./constants\";\n\nexport type CalloutVariant = \"info\" | \"warning\" | \"danger\" | \"success\";\n\ntype PrimitiveAlertProps = React.ComponentProps<typeof PrimitiveAlert>;\n\nexport interface CalloutProps extends Omit<PrimitiveAlertProps, \"variant\"> {\n /** Visual style of the callout. */\n variant?: CalloutVariant;\n /** Custom icon. Defaults to a variant-specific icon. */\n icon?: IconProp;\n /** Optional title rendered as AlertTitle. */\n title?: string;\n /** Content rendered as AlertDescription. */\n children?: React.ReactNode;\n}\n\nconst Callout = forwardRef<HTMLDivElement, CalloutProps>(\n (\n { variant = \"info\", icon, title, children, className, ...otherProps },\n ref\n ) => {\n const config = VARIANT_CONFIG[variant];\n const resolvedIcon = icon ?? config.icon;\n\n return (\n <PrimitiveAlert\n ref={ref}\n className={cn(config.container, className)}\n {...otherProps}\n >\n {renderIcon(resolvedIcon, \"size-4 shrink-0\")}\n {title && <AlertTitle className=\"font-semibold\">{title}</AlertTitle>}\n {children && (\n <AlertDescription className=\"text-current\">\n {children}\n </AlertDescription>\n )}\n </PrimitiveAlert>\n );\n }\n);\n\nCallout.displayName = \"Callout\";\n\nexport { Callout };\n"],"names":["__iconNode","InfoIcon","AlertTriangleIcon","AlertCircleIcon","CheckCircleIcon","_jsxs","PrimitiveAlert","_jsx"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;;AAIA,MAAMA,YAAU,GAAG;AACnB,EAAE,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,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,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,UAAU,EAAE,EACrE,GAAG,KACD;AACF,IAAA,MAAM,MAAM,GAAG,cAAc,CAAC,OAAO,CAAC;AACtC,IAAA,MAAM,YAAY,GAAG,IAAI,IAAI,MAAM,CAAC,IAAI;IAExC,QACEC,IAAA,CAACC,KAAc,EAAA,EACb,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,EAAA,GACtC,UAAU,EAAA,QAAA,EAAA,CAEb,UAAU,CAAC,YAAY,EAAE,iBAAiB,CAAC,EAC3C,KAAK,IAAIC,GAAA,CAAC,UAAU,EAAA,EAAC,SAAS,EAAC,eAAe,EAAA,QAAA,EAAE,KAAK,EAAA,CAAc,EACnE,QAAQ,KACPA,GAAA,CAAC,gBAAgB,EAAA,EAAC,SAAS,EAAC,cAAc,EAAA,QAAA,EACvC,QAAQ,EAAA,CACQ,CACpB,CAAA,EAAA,CACc;AAErB,CAAC;AAGH,OAAO,CAAC,WAAW,GAAG,SAAS;;;;","x_google_ignoreList":[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,UAAU,EAAE,GAAG,UAAU,EAAE,EAAE,GAAG,MACrEA,IAAA,CAACC,cAAqB,EAAA,EACpB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,EAAA,aAAA,EACX,UAAU,IAAI,eAAe,EAAA,GACtC,UAAU,aAEb,QAAQ,EACR,WAAW,IAAIC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M,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;;;;"}
|
|
@@ -13,9 +13,9 @@ const SIZE_CLASS_MAP = {
|
|
|
13
13
|
|
|
14
14
|
const SheetHeader = forwardRef(({ children, className, ...otherProps }, ref) => (jsx(SheetHeader$1, { ref: ref, className: cn(className), "data-testid": "sheet-header", ...otherProps, children: children })));
|
|
15
15
|
SheetHeader.displayName = "Sheet.Header";
|
|
16
|
-
const SheetBody = forwardRef(({ children, className, hasFooter = true, ...otherProps }, ref) => (jsx("div", { ref: ref, "data-slot": "sheet-body", "data-testid": "sheet-body", className: cn("flex flex-1 flex-col items-start justify-start overflow-y-auto px-
|
|
16
|
+
const SheetBody = forwardRef(({ children, className, hasFooter = true, ...otherProps }, ref) => (jsx("div", { ref: ref, "data-slot": "sheet-body", "data-testid": "sheet-body", className: cn("flex flex-1 flex-col items-start justify-start overflow-y-auto px-6", hasFooter && "pb-0", className), ...otherProps, children: children })));
|
|
17
17
|
SheetBody.displayName = "Sheet.Body";
|
|
18
|
-
const SheetFooter = forwardRef(({ children, className, ...otherProps }, ref) => (jsx(SheetFooter$1, { ref: ref, className: cn("flex flex-row items-center justify-start gap-2
|
|
18
|
+
const SheetFooter = forwardRef(({ children, className, ...otherProps }, ref) => (jsx(SheetFooter$1, { ref: ref, className: cn("flex flex-row items-center justify-start gap-2", className), "data-testid": "sheet-footer", ...otherProps, children: children })));
|
|
19
19
|
SheetFooter.displayName = "Sheet.Footer";
|
|
20
20
|
const SheetTitle = forwardRef(({ children, className, ...otherProps }, ref) => (jsx(SheetTitle$1, { ref: ref, className: cn("text-2xl font-semibold", className), ...otherProps, children: children })));
|
|
21
21
|
SheetTitle.displayName = "Sheet.Title";
|
|
@@ -60,4 +60,4 @@ Sheet.Title = SheetTitle;
|
|
|
60
60
|
Sheet.Description = SheetDescription;
|
|
61
61
|
|
|
62
62
|
export { Sheet as S };
|
|
63
|
-
//# sourceMappingURL=Sheet-
|
|
63
|
+
//# sourceMappingURL=Sheet-B99vGwLH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sheet-B99vGwLH.js","sources":["../src/components/Sheet/constants.ts","../src/components/Sheet/Sheet.tsx"],"sourcesContent":["type SheetSize = \"small\" | \"large\" | \"extraLarge\";\n\n// Uses data-[side] selector to match primitive specificity so tailwind-merge\n// can override the default sm:max-w-sm from the primitive.\nexport const SIZE_CLASS_MAP: Record<SheetSize, string> = {\n small: \"data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm\",\n large: \"data-[side=left]:sm:max-w-lg data-[side=right]:sm:max-w-lg\",\n extraLarge: \"data-[side=left]:sm:max-w-2xl data-[side=right]:sm:max-w-2xl\",\n};\n","import React, { forwardRef, type ReactNode, type RefObject } from \"react\";\n\nimport { cn } from \"src/shadcn/lib/utils\";\nimport {\n Sheet as PrimitiveSheet,\n SheetContent as PrimitiveSheetContent,\n SheetDescription as PrimitiveSheetDescription,\n SheetFooter as PrimitiveSheetFooter,\n SheetHeader as PrimitiveSheetHeader,\n SheetTitle as PrimitiveSheetTitle,\n} from \"src/primitives/Sheet\";\n\ntype SheetSize = \"small\" | \"large\" | \"extraLarge\";\n\n/** Radix Sheet.Content props we forward via ...otherProps. */\ntype SheetContentProps = React.ComponentProps<typeof PrimitiveSheetContent>;\n\nexport interface SheetProps extends Omit<\n SheetContentProps,\n | \"children\"\n | \"className\"\n | \"side\"\n | \"showCloseButton\"\n | \"onEscapeKeyDown\"\n | \"onInteractOutside\"\n> {\n /** Size of the sheet. */\n size?: SheetSize;\n /** Whether the sheet is open. */\n isOpen?: boolean;\n /** Callback invoked when the sheet is closed. */\n onClose?: () => void;\n /** Content rendered inside the sheet. */\n children?: ReactNode;\n /** Additional CSS class names applied to the sheet 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 sheet. */\n closeOnOutsideClick?: boolean;\n /** Ref of the element to receive focus when the sheet opens. */\n initialFocusRef?: RefObject<HTMLElement | null>;\n /** Ref of the element to receive focus when the sheet closes. */\n finalFocusRef?: RefObject<HTMLElement | null>;\n /** Which side the sheet slides in from. */\n side?: \"top\" | \"right\" | \"bottom\" | \"left\";\n /** Radix Dialog `modal` prop — controls modal vs non-modal behaviour. */\n modal?: boolean;\n /** Radix Dialog `defaultOpen` prop. */\n defaultOpen?: boolean;\n}\n\nimport { SIZE_CLASS_MAP } from \"./constants\";\n\ninterface SheetSubcomponentProps extends React.ComponentProps<\"div\"> {\n children?: ReactNode;\n className?: string;\n}\n\nconst SheetHeader = forwardRef<HTMLDivElement, SheetSubcomponentProps>(\n ({ children, className, ...otherProps }, ref) => (\n <PrimitiveSheetHeader\n ref={ref}\n className={cn(className)}\n data-testid=\"sheet-header\"\n {...otherProps}\n >\n {children}\n </PrimitiveSheetHeader>\n )\n);\nSheetHeader.displayName = \"Sheet.Header\";\n\nconst SheetBody = forwardRef<\n HTMLDivElement,\n SheetSubcomponentProps & { hasFooter?: boolean }\n>(({ children, className, hasFooter = true, ...otherProps }, ref) => (\n <div\n ref={ref}\n data-slot=\"sheet-body\"\n data-testid=\"sheet-body\"\n className={cn(\n \"flex flex-1 flex-col items-start justify-start overflow-y-auto px-6\",\n hasFooter && \"pb-0\",\n className\n )}\n {...otherProps}\n >\n {children}\n </div>\n));\nSheetBody.displayName = \"Sheet.Body\";\n\nconst SheetFooter = forwardRef<HTMLDivElement, SheetSubcomponentProps>(\n ({ children, className, ...otherProps }, ref) => (\n <PrimitiveSheetFooter\n ref={ref}\n className={cn(\n \"flex flex-row items-center justify-start gap-2\",\n className\n )}\n data-testid=\"sheet-footer\"\n {...otherProps}\n >\n {children}\n </PrimitiveSheetFooter>\n )\n);\nSheetFooter.displayName = \"Sheet.Footer\";\n\nconst SheetTitle = forwardRef<\n HTMLHeadingElement,\n React.ComponentProps<typeof PrimitiveSheetTitle>\n>(({ children, className, ...otherProps }, ref) => (\n <PrimitiveSheetTitle\n ref={ref}\n className={cn(\"text-2xl font-semibold\", className)}\n {...otherProps}\n >\n {children}\n </PrimitiveSheetTitle>\n));\nSheetTitle.displayName = \"Sheet.Title\";\n\nconst SheetDescription = forwardRef<\n HTMLParagraphElement,\n React.ComponentProps<typeof PrimitiveSheetDescription>\n>(({ children, className, ...otherProps }, ref) => (\n <PrimitiveSheetDescription\n ref={ref}\n className={cn(className)}\n {...otherProps}\n >\n {children}\n </PrimitiveSheetDescription>\n));\nSheetDescription.displayName = \"Sheet.Description\";\n\nconst Sheet = forwardRef<HTMLDivElement, SheetProps>(\n (\n {\n size = \"small\",\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 side = \"right\",\n modal,\n defaultOpen,\n // Radix content handlers — intercept and merge\n onOpenAutoFocus: onOpenAutoFocusProp,\n onCloseAutoFocus: onCloseAutoFocusProp,\n ...otherProps\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 return (\n <PrimitiveSheet\n open={isOpen}\n onOpenChange={handleOpenChange}\n modal={modal}\n defaultOpen={defaultOpen}\n >\n <PrimitiveSheetContent\n ref={ref}\n side={side}\n showCloseButton={closeButton}\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=\"sheet-wrapper\"\n {...otherProps}\n >\n {children}\n </PrimitiveSheetContent>\n </PrimitiveSheet>\n );\n }\n) as React.ForwardRefExoticComponent<\n SheetProps & React.RefAttributes<HTMLDivElement>\n> & {\n Header: typeof SheetHeader;\n Body: typeof SheetBody;\n Footer: typeof SheetFooter;\n Title: typeof SheetTitle;\n Description: typeof SheetDescription;\n};\n\nSheet.displayName = \"Sheet\";\nSheet.Header = SheetHeader;\nSheet.Body = SheetBody;\nSheet.Footer = SheetFooter;\nSheet.Title = SheetTitle;\nSheet.Description = SheetDescription;\n\nexport { Sheet };\n"],"names":["_jsx","PrimitiveSheetHeader","PrimitiveSheetFooter","PrimitiveSheetTitle","PrimitiveSheetDescription","PrimitiveSheet","PrimitiveSheetContent"],"mappings":";;;;;AAEA;AACA;AACO,MAAM,cAAc,GAA8B;AACvD,IAAA,KAAK,EAAE,4DAA4D;AACnE,IAAA,KAAK,EAAE,4DAA4D;AACnE,IAAA,UAAU,EAAE,8DAA8D;CAC3E;;ACuDD,MAAM,WAAW,GAAG,UAAU,CAC5B,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,UAAU,EAAE,EAAE,GAAG,MAC1CA,GAAA,CAACC,aAAoB,EAAA,EACnB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,EAAA,aAAA,EACZ,cAAc,KACtB,UAAU,EAAA,QAAA,EAEb,QAAQ,EAAA,CACY,CACxB,CACF;AACD,WAAW,CAAC,WAAW,GAAG,cAAc;AAExC,MAAM,SAAS,GAAG,UAAU,CAG1B,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,GAAG,IAAI,EAAE,GAAG,UAAU,EAAE,EAAE,GAAG,MAC9DD,GAAA,CAAA,KAAA,EAAA,EACE,GAAG,EAAE,GAAG,EAAA,WAAA,EACE,YAAY,EAAA,aAAA,EACV,YAAY,EACxB,SAAS,EAAE,EAAE,CACX,qEAAqE,EACrE,SAAS,IAAI,MAAM,EACnB,SAAS,CACV,EAAA,GACG,UAAU,YAEb,QAAQ,EAAA,CACL,CACP,CAAC;AACF,SAAS,CAAC,WAAW,GAAG,YAAY;AAEpC,MAAM,WAAW,GAAG,UAAU,CAC5B,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,UAAU,EAAE,EAAE,GAAG,MAC1CA,GAAA,CAACE,aAAoB,IACnB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,gDAAgD,EAChD,SAAS,CACV,EAAA,aAAA,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ACvB,UAAU,EAAA,QAAA,EAEb,QAAQ,EAAA,CACa,EAAA,CACT;AAErB,CAAC;AAWH,KAAK,CAAC,WAAW,GAAG,OAAO;AAC3B,KAAK,CAAC,MAAM,GAAG,WAAW;AAC1B,KAAK,CAAC,IAAI,GAAG,SAAS;AACtB,KAAK,CAAC,MAAM,GAAG,WAAW;AAC1B,KAAK,CAAC,KAAK,GAAG,UAAU;AACxB,KAAK,CAAC,WAAW,GAAG,gBAAgB;;;;"}
|
|
@@ -39,19 +39,19 @@ const CircleCheckBig = createLucideIcon.createLucideIcon("circle-check-big", __i
|
|
|
39
39
|
|
|
40
40
|
const VARIANT_CONFIG = {
|
|
41
41
|
info: {
|
|
42
|
-
container: "border-
|
|
42
|
+
container: "border border-info-border bg-info text-info-foreground",
|
|
43
43
|
icon: triangleAlert.Info,
|
|
44
44
|
},
|
|
45
45
|
warning: {
|
|
46
|
-
container: "border-
|
|
46
|
+
container: "border border-warning-border bg-warning text-warning-foreground",
|
|
47
47
|
icon: triangleAlert.TriangleAlert,
|
|
48
48
|
},
|
|
49
49
|
danger: {
|
|
50
|
-
container: "border-
|
|
50
|
+
container: "border border-error-border bg-error text-error-foreground",
|
|
51
51
|
icon: CircleAlert,
|
|
52
52
|
},
|
|
53
53
|
success: {
|
|
54
|
-
container: "border-
|
|
54
|
+
container: "border border-success-border bg-success text-success-foreground",
|
|
55
55
|
icon: CircleCheckBig,
|
|
56
56
|
},
|
|
57
57
|
};
|
|
@@ -59,9 +59,9 @@ const VARIANT_CONFIG = {
|
|
|
59
59
|
const Callout = React.forwardRef(({ variant = "info", icon, title, children, className, ...otherProps }, ref) => {
|
|
60
60
|
const config = VARIANT_CONFIG[variant];
|
|
61
61
|
const resolvedIcon = icon ?? config.icon;
|
|
62
|
-
return (jsxRuntime.jsxs(primitives_Alert.Alert, { ref: ref, className: utils.cn(config.container, className), ...otherProps, children: [renderIcon.renderIcon(resolvedIcon, "size-4 shrink-0"), title && jsxRuntime.jsx(primitives_Alert.AlertTitle, { children: title }), children && (jsxRuntime.jsx(primitives_Alert.AlertDescription, { className: "text-current
|
|
62
|
+
return (jsxRuntime.jsxs(primitives_Alert.Alert, { ref: ref, className: utils.cn(config.container, className), ...otherProps, children: [renderIcon.renderIcon(resolvedIcon, "size-4 shrink-0"), title && jsxRuntime.jsx(primitives_Alert.AlertTitle, { className: "font-semibold", children: title }), children && (jsxRuntime.jsx(primitives_Alert.AlertDescription, { className: "text-current", children: children }))] }));
|
|
63
63
|
});
|
|
64
64
|
Callout.displayName = "Callout";
|
|
65
65
|
|
|
66
66
|
exports.Callout = Callout;
|
|
67
|
-
//# sourceMappingURL=Callout-
|
|
67
|
+
//# sourceMappingURL=Callout-CVNpjTde.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Callout-CVNpjTde.js","sources":["../../node_modules/lucide-react/dist/esm/icons/circle-alert.js","../../node_modules/lucide-react/dist/esm/icons/circle-check-big.js","../../../src/components/Callout/constants.ts","../../../src/components/Callout/Callout.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.577.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"line\", { x1: \"12\", x2: \"12\", y1: \"8\", y2: \"12\", key: \"1pkeuh\" }],\n [\"line\", { x1: \"12\", x2: \"12.01\", y1: \"16\", y2: \"16\", key: \"4dfq90\" }]\n];\nconst CircleAlert = createLucideIcon(\"circle-alert\", __iconNode);\n\nexport { __iconNode, CircleAlert as default };\n//# sourceMappingURL=circle-alert.js.map\n","/**\n * @license lucide-react v0.577.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M21.801 10A10 10 0 1 1 17 3.335\", key: \"yps3ct\" }],\n [\"path\", { d: \"m9 11 3 3L22 4\", key: \"1pflzl\" }]\n];\nconst CircleCheckBig = createLucideIcon(\"circle-check-big\", __iconNode);\n\nexport { __iconNode, CircleCheckBig as default };\n//# sourceMappingURL=circle-check-big.js.map\n","import React from \"react\";\n\nimport {\n InfoIcon,\n AlertTriangleIcon,\n AlertCircleIcon,\n CheckCircleIcon,\n} from \"lucide-react\";\n\nimport type { CalloutVariant } from \"./Callout\";\n\nexport const VARIANT_CONFIG: Record<\n CalloutVariant,\n {\n container: string;\n icon: React.ComponentType<{ className?: string }>;\n }\n> = {\n info: {\n container: \"border border-info-border bg-info text-info-foreground\",\n icon: InfoIcon,\n },\n warning: {\n container:\n \"border border-warning-border bg-warning text-warning-foreground\",\n icon: AlertTriangleIcon,\n },\n danger: {\n container: \"border border-error-border bg-error text-error-foreground\",\n icon: AlertCircleIcon,\n },\n success: {\n container:\n \"border border-success-border bg-success text-success-foreground\",\n icon: CheckCircleIcon,\n },\n};\n","import React, { forwardRef } from \"react\";\n\nimport {\n Alert as PrimitiveAlert,\n AlertTitle,\n AlertDescription,\n} from \"src/primitives/Alert\";\nimport { cn } from \"src/shadcn/lib/utils\";\nimport { renderIcon, type IconProp } from \"src/lib/renderIcon\";\n\nimport { VARIANT_CONFIG } from \"./constants\";\n\nexport type CalloutVariant = \"info\" | \"warning\" | \"danger\" | \"success\";\n\ntype PrimitiveAlertProps = React.ComponentProps<typeof PrimitiveAlert>;\n\nexport interface CalloutProps extends Omit<PrimitiveAlertProps, \"variant\"> {\n /** Visual style of the callout. */\n variant?: CalloutVariant;\n /** Custom icon. Defaults to a variant-specific icon. */\n icon?: IconProp;\n /** Optional title rendered as AlertTitle. */\n title?: string;\n /** Content rendered as AlertDescription. */\n children?: React.ReactNode;\n}\n\nconst Callout = forwardRef<HTMLDivElement, CalloutProps>(\n (\n { variant = \"info\", icon, title, children, className, ...otherProps },\n ref\n ) => {\n const config = VARIANT_CONFIG[variant];\n const resolvedIcon = icon ?? config.icon;\n\n return (\n <PrimitiveAlert\n ref={ref}\n className={cn(config.container, className)}\n {...otherProps}\n >\n {renderIcon(resolvedIcon, \"size-4 shrink-0\")}\n {title && <AlertTitle className=\"font-semibold\">{title}</AlertTitle>}\n {children && (\n <AlertDescription className=\"text-current\">\n {children}\n </AlertDescription>\n )}\n </PrimitiveAlert>\n );\n }\n);\n\nCallout.displayName = \"Callout\";\n\nexport { Callout };\n"],"names":["__iconNode","createLucideIcon","InfoIcon","AlertTriangleIcon","AlertCircleIcon","CheckCircleIcon","forwardRef","_jsxs","PrimitiveAlert","cn","renderIcon","_jsx","AlertTitle","AlertDescription"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;;AAIA,MAAMA,YAAU,GAAG;AACnB,EAAE,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AAC5D,EAAE,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AACpE,EAAE,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE;AACvE,CAAC;AACD,MAAM,WAAW,GAAGC,iCAAgB,CAAC,cAAc,EAAED,YAAU,CAAC;;ACdhE;AACA;AACA;AACA;AACA;AACA;;;AAIA,MAAM,UAAU,GAAG;AACnB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,iCAAiC,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AACnE,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,gBAAgB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B,CAAA,EAAA,CACc;AAErB,CAAC;AAGH,OAAO,CAAC,WAAW,GAAG,SAAS;;;;","x_google_ignoreList":[0,1]}
|
|
@@ -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,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,MAAM,UAAU,GAAGL,gBAAU,CAC3B,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,UAAU,EAAE,EAAE,GAAG,MACtDI,cAAA,CAAA,KAAA,EAAA,EACE,GAAG,EAAE,GAAG,EAAA,WAAA,EACE,aAAa,EAAA,aAAA,EACV,UAAU,IAAI,aAAa,EACxC,SAAS,EAAED,QAAE,CAAC,yBAAyB,EAAE,SAAS,CAAC,EAAA,GAC/C,UAAU,YAEb,QAAQ,EAAA,CACL,CACP,CACF;AACD,UAAU,CAAC,WAAW,GAAG,a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AE,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;;;;"}
|
|
@@ -15,9 +15,9 @@ const SIZE_CLASS_MAP = {
|
|
|
15
15
|
|
|
16
16
|
const SheetHeader = React.forwardRef(({ children, className, ...otherProps }, ref) => (jsxRuntime.jsx(primitives_Sheet.SheetHeader, { ref: ref, className: utils.cn(className), "data-testid": "sheet-header", ...otherProps, children: children })));
|
|
17
17
|
SheetHeader.displayName = "Sheet.Header";
|
|
18
|
-
const SheetBody = React.forwardRef(({ children, className, hasFooter = true, ...otherProps }, ref) => (jsxRuntime.jsx("div", { ref: ref, "data-slot": "sheet-body", "data-testid": "sheet-body", className: utils.cn("flex flex-1 flex-col items-start justify-start overflow-y-auto px-
|
|
18
|
+
const SheetBody = React.forwardRef(({ children, className, hasFooter = true, ...otherProps }, ref) => (jsxRuntime.jsx("div", { ref: ref, "data-slot": "sheet-body", "data-testid": "sheet-body", className: utils.cn("flex flex-1 flex-col items-start justify-start overflow-y-auto px-6", hasFooter && "pb-0", className), ...otherProps, children: children })));
|
|
19
19
|
SheetBody.displayName = "Sheet.Body";
|
|
20
|
-
const SheetFooter = React.forwardRef(({ children, className, ...otherProps }, ref) => (jsxRuntime.jsx(primitives_Sheet.SheetFooter, { ref: ref, className: utils.cn("flex flex-row items-center justify-start gap-2
|
|
20
|
+
const SheetFooter = React.forwardRef(({ children, className, ...otherProps }, ref) => (jsxRuntime.jsx(primitives_Sheet.SheetFooter, { ref: ref, className: utils.cn("flex flex-row items-center justify-start gap-2", className), "data-testid": "sheet-footer", ...otherProps, children: children })));
|
|
21
21
|
SheetFooter.displayName = "Sheet.Footer";
|
|
22
22
|
const SheetTitle = React.forwardRef(({ children, className, ...otherProps }, ref) => (jsxRuntime.jsx(primitives_Sheet.SheetTitle, { ref: ref, className: utils.cn("text-2xl font-semibold", className), ...otherProps, children: children })));
|
|
23
23
|
SheetTitle.displayName = "Sheet.Title";
|
|
@@ -62,4 +62,4 @@ Sheet.Title = SheetTitle;
|
|
|
62
62
|
Sheet.Description = SheetDescription;
|
|
63
63
|
|
|
64
64
|
exports.Sheet = Sheet;
|
|
65
|
-
//# sourceMappingURL=Sheet-
|
|
65
|
+
//# sourceMappingURL=Sheet-BTZe2VQk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sheet-BTZe2VQk.js","sources":["../../../src/components/Sheet/constants.ts","../../../src/components/Sheet/Sheet.tsx"],"sourcesContent":["type SheetSize = \"small\" | \"large\" | \"extraLarge\";\n\n// Uses data-[side] selector to match primitive specificity so tailwind-merge\n// can override the default sm:max-w-sm from the primitive.\nexport const SIZE_CLASS_MAP: Record<SheetSize, string> = {\n small: \"data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm\",\n large: \"data-[side=left]:sm:max-w-lg data-[side=right]:sm:max-w-lg\",\n extraLarge: \"data-[side=left]:sm:max-w-2xl data-[side=right]:sm:max-w-2xl\",\n};\n","import React, { forwardRef, type ReactNode, type RefObject } from \"react\";\n\nimport { cn } from \"src/shadcn/lib/utils\";\nimport {\n Sheet as PrimitiveSheet,\n SheetContent as PrimitiveSheetContent,\n SheetDescription as PrimitiveSheetDescription,\n SheetFooter as PrimitiveSheetFooter,\n SheetHeader as PrimitiveSheetHeader,\n SheetTitle as PrimitiveSheetTitle,\n} from \"src/primitives/Sheet\";\n\ntype SheetSize = \"small\" | \"large\" | \"extraLarge\";\n\n/** Radix Sheet.Content props we forward via ...otherProps. */\ntype SheetContentProps = React.ComponentProps<typeof PrimitiveSheetContent>;\n\nexport interface SheetProps extends Omit<\n SheetContentProps,\n | \"children\"\n | \"className\"\n | \"side\"\n | \"showCloseButton\"\n | \"onEscapeKeyDown\"\n | \"onInteractOutside\"\n> {\n /** Size of the sheet. */\n size?: SheetSize;\n /** Whether the sheet is open. */\n isOpen?: boolean;\n /** Callback invoked when the sheet is closed. */\n onClose?: () => void;\n /** Content rendered inside the sheet. */\n children?: ReactNode;\n /** Additional CSS class names applied to the sheet 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 sheet. */\n closeOnOutsideClick?: boolean;\n /** Ref of the element to receive focus when the sheet opens. */\n initialFocusRef?: RefObject<HTMLElement | null>;\n /** Ref of the element to receive focus when the sheet closes. */\n finalFocusRef?: RefObject<HTMLElement | null>;\n /** Which side the sheet slides in from. */\n side?: \"top\" | \"right\" | \"bottom\" | \"left\";\n /** Radix Dialog `modal` prop — controls modal vs non-modal behaviour. */\n modal?: boolean;\n /** Radix Dialog `defaultOpen` prop. */\n defaultOpen?: boolean;\n}\n\nimport { SIZE_CLASS_MAP } from \"./constants\";\n\ninterface SheetSubcomponentProps extends React.ComponentProps<\"div\"> {\n children?: ReactNode;\n className?: string;\n}\n\nconst SheetHeader = forwardRef<HTMLDivElement, SheetSubcomponentProps>(\n ({ children, className, ...otherProps }, ref) => (\n <PrimitiveSheetHeader\n ref={ref}\n className={cn(className)}\n data-testid=\"sheet-header\"\n {...otherProps}\n >\n {children}\n </PrimitiveSheetHeader>\n )\n);\nSheetHeader.displayName = \"Sheet.Header\";\n\nconst SheetBody = forwardRef<\n HTMLDivElement,\n SheetSubcomponentProps & { hasFooter?: boolean }\n>(({ children, className, hasFooter = true, ...otherProps }, ref) => (\n <div\n ref={ref}\n data-slot=\"sheet-body\"\n data-testid=\"sheet-body\"\n className={cn(\n \"flex flex-1 flex-col items-start justify-start overflow-y-auto px-6\",\n hasFooter && \"pb-0\",\n className\n )}\n {...otherProps}\n >\n {children}\n </div>\n));\nSheetBody.displayName = \"Sheet.Body\";\n\nconst SheetFooter = forwardRef<HTMLDivElement, SheetSubcomponentProps>(\n ({ children, className, ...otherProps }, ref) => (\n <PrimitiveSheetFooter\n ref={ref}\n className={cn(\n \"flex flex-row items-center justify-start gap-2\",\n className\n )}\n data-testid=\"sheet-footer\"\n {...otherProps}\n >\n {children}\n </PrimitiveSheetFooter>\n )\n);\nSheetFooter.displayName = \"Sheet.Footer\";\n\nconst SheetTitle = forwardRef<\n HTMLHeadingElement,\n React.ComponentProps<typeof PrimitiveSheetTitle>\n>(({ children, className, ...otherProps }, ref) => (\n <PrimitiveSheetTitle\n ref={ref}\n className={cn(\"text-2xl font-semibold\", className)}\n {...otherProps}\n >\n {children}\n </PrimitiveSheetTitle>\n));\nSheetTitle.displayName = \"Sheet.Title\";\n\nconst SheetDescription = forwardRef<\n HTMLParagraphElement,\n React.ComponentProps<typeof PrimitiveSheetDescription>\n>(({ children, className, ...otherProps }, ref) => (\n <PrimitiveSheetDescription\n ref={ref}\n className={cn(className)}\n {...otherProps}\n >\n {children}\n </PrimitiveSheetDescription>\n));\nSheetDescription.displayName = \"Sheet.Description\";\n\nconst Sheet = forwardRef<HTMLDivElement, SheetProps>(\n (\n {\n size = \"small\",\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 side = \"right\",\n modal,\n defaultOpen,\n // Radix content handlers — intercept and merge\n onOpenAutoFocus: onOpenAutoFocusProp,\n onCloseAutoFocus: onCloseAutoFocusProp,\n ...otherProps\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 return (\n <PrimitiveSheet\n open={isOpen}\n onOpenChange={handleOpenChange}\n modal={modal}\n defaultOpen={defaultOpen}\n >\n <PrimitiveSheetContent\n ref={ref}\n side={side}\n showCloseButton={closeButton}\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=\"sheet-wrapper\"\n {...otherProps}\n >\n {children}\n </PrimitiveSheetContent>\n </PrimitiveSheet>\n );\n }\n) as React.ForwardRefExoticComponent<\n SheetProps & React.RefAttributes<HTMLDivElement>\n> & {\n Header: typeof SheetHeader;\n Body: typeof SheetBody;\n Footer: typeof SheetFooter;\n Title: typeof SheetTitle;\n Description: typeof SheetDescription;\n};\n\nSheet.displayName = \"Sheet\";\nSheet.Header = SheetHeader;\nSheet.Body = SheetBody;\nSheet.Footer = SheetFooter;\nSheet.Title = SheetTitle;\nSheet.Description = SheetDescription;\n\nexport { Sheet };\n"],"names":["forwardRef","_jsx","PrimitiveSheetHeader","cn","PrimitiveSheetFooter","PrimitiveSheetTitle","PrimitiveSheetDescription","PrimitiveSheet","PrimitiveSheetContent"],"mappings":";;;;;;;AAEA;AACA;AACO,MAAM,cAAc,GAA8B;AACvD,IAAA,KAAK,EAAE,4DAA4D;AACnE,IAAA,KAAK,EAAE,4DAA4D;AACnE,IAAA,UAAU,EAAE,8DAA8D;CAC3E;;ACuDD,MAAM,WAAW,GAAGA,gBAAU,CAC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@@ -10,7 +10,7 @@ require('../button-CKlGvVqQ.js');
|
|
|
10
10
|
require('../index-BZhTddX0.js');
|
|
11
11
|
require('../index-DuNgWCXZ.js');
|
|
12
12
|
require('../index-D-iDn9RI.js');
|
|
13
|
-
require('../dialog-
|
|
13
|
+
require('../dialog-3nRssoAl.js');
|
|
14
14
|
require('../x-Brw3FJst.js');
|
|
15
15
|
require('../createLucideIcon-D0tRgV6l.js');
|
|
16
16
|
require('../index-BLGrl3PF.js');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var Dialog = require('../Dialog-
|
|
3
|
+
var Dialog = require('../Dialog-CtI_yWsJ.js');
|
|
4
4
|
require('react/jsx-runtime');
|
|
5
5
|
require('react');
|
|
6
6
|
require('../utils-CTr7wn5d.js');
|
|
@@ -9,7 +9,7 @@ require('../button-CKlGvVqQ.js');
|
|
|
9
9
|
require('../index-BZhTddX0.js');
|
|
10
10
|
require('../index-DuNgWCXZ.js');
|
|
11
11
|
require('../index-D-iDn9RI.js');
|
|
12
|
-
require('../dialog-
|
|
12
|
+
require('../dialog-3nRssoAl.js');
|
|
13
13
|
require('react-i18next');
|
|
14
14
|
require('../x-Brw3FJst.js');
|
|
15
15
|
require('../createLucideIcon-D0tRgV6l.js');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var Sheet = require('../Sheet-
|
|
3
|
+
var Sheet = require('../Sheet-BTZe2VQk.js');
|
|
4
4
|
require('react/jsx-runtime');
|
|
5
5
|
require('react');
|
|
6
6
|
require('../utils-CTr7wn5d.js');
|
|
@@ -9,7 +9,7 @@ require('../button-CKlGvVqQ.js');
|
|
|
9
9
|
require('../index-BZhTddX0.js');
|
|
10
10
|
require('../index-DuNgWCXZ.js');
|
|
11
11
|
require('../index-D-iDn9RI.js');
|
|
12
|
-
require('../sheet-
|
|
12
|
+
require('../sheet-BG5iB_da.js');
|
|
13
13
|
require('react-i18next');
|
|
14
14
|
require('../x-Brw3FJst.js');
|
|
15
15
|
require('../createLucideIcon-D0tRgV6l.js');
|
|
@@ -5,12 +5,12 @@ var Alert = require('../Alert-BVvLyM_d.js');
|
|
|
5
5
|
var Avatar = require('../Avatar-CNao5gvP.js');
|
|
6
6
|
var Badge = require('../Badge-_-PRf6aq.js');
|
|
7
7
|
var Button = require('../Button-Bt_AElge.js');
|
|
8
|
-
var Callout = require('../Callout-
|
|
8
|
+
var Callout = require('../Callout-CVNpjTde.js');
|
|
9
9
|
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');
|
|
@@ -22,7 +22,7 @@ var Popover = require('../Popover-B1d4URJl.js');
|
|
|
22
22
|
var Progress = require('../Progress-DoCxZ_ZH.js');
|
|
23
23
|
var RadioGroup = require('../RadioGroup-1RAoe38m.js');
|
|
24
24
|
var Select = require('../Select-Br1AT_wm.js');
|
|
25
|
-
var Sheet = require('../Sheet-
|
|
25
|
+
var Sheet = require('../Sheet-BTZe2VQk.js');
|
|
26
26
|
var Slider = require('../Slider-jNUS9vt8.js');
|
|
27
27
|
var Spinner = require('../Spinner-DQutDMQq.js');
|
|
28
28
|
var Stepper = require('../Stepper-DCoLl2ZS.js');
|
|
@@ -62,7 +62,7 @@ require('../primitives/Dialog.js');
|
|
|
62
62
|
require('../button-CKlGvVqQ.js');
|
|
63
63
|
require('../index-BZhTddX0.js');
|
|
64
64
|
require('../index-DuNgWCXZ.js');
|
|
65
|
-
require('../dialog-
|
|
65
|
+
require('../dialog-3nRssoAl.js');
|
|
66
66
|
require('../x-Brw3FJst.js');
|
|
67
67
|
require('../index-BLGrl3PF.js');
|
|
68
68
|
require('../index-Bvu9MiFi.js');
|
|
@@ -117,7 +117,7 @@ require('../SelectFieldWrapper-DEA--2wj.js');
|
|
|
117
117
|
require('../primitives/Combobox.js');
|
|
118
118
|
require('../with-selector-DeKHbQY7.js');
|
|
119
119
|
require('../primitives/Sheet.js');
|
|
120
|
-
require('../sheet-
|
|
120
|
+
require('../sheet-BG5iB_da.js');
|
|
121
121
|
require('../primitives/Slider.js');
|
|
122
122
|
require('../index-EyWRfsCG.js');
|
|
123
123
|
require('../primitives/Switch.js');
|
|
@@ -24,13 +24,13 @@ function DialogOverlay({ className, ...props }) {
|
|
|
24
24
|
}
|
|
25
25
|
function DialogContent({ className, children, showCloseButton = true, ...props }) {
|
|
26
26
|
const { t } = reactI18next.useTranslation();
|
|
27
|
-
return (jsxRuntime.jsxs(DialogPortal, { children: [jsxRuntime.jsx(DialogOverlay, {}), 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-
|
|
27
|
+
return (jsxRuntime.jsxs(DialogPortal, { children: [jsxRuntime.jsx(DialogOverlay, {}), 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: t("neetoatoms.dialog.close", "Close") })] }) }))] })] }));
|
|
28
28
|
}
|
|
29
29
|
function DialogHeader({ className, ...props }) {
|
|
30
|
-
return (jsxRuntime.jsx("div", { "data-slot": "dialog-header", className: utils.cn("flex flex-col gap-
|
|
30
|
+
return (jsxRuntime.jsx("div", { "data-slot": "dialog-header", className: utils.cn("flex flex-col gap-3", className), ...props }));
|
|
31
31
|
}
|
|
32
32
|
function DialogFooter({ className, showCloseButton = false, children, ...props }) {
|
|
33
|
-
return (jsxRuntime.jsxs("div", { "data-slot": "dialog-footer", className: utils.cn("-mx-
|
|
33
|
+
return (jsxRuntime.jsxs("div", { "data-slot": "dialog-footer", className: utils.cn("-mx-6 -mb-6 flex flex-col-reverse gap-2 rounded-b-xl bg-muted/50 px-6 py-4 sm:flex-row sm:justify-end", className), ...props, children: [children, showCloseButton && (jsxRuntime.jsx(index.Close, { asChild: true, children: jsxRuntime.jsx(button.Button, { variant: "outline", children: "Close" }) }))] }));
|
|
34
34
|
}
|
|
35
35
|
function DialogTitle({ className, ...props }) {
|
|
36
36
|
return (jsxRuntime.jsx(index.Title, { "data-slot": "dialog-title", className: utils.cn("text-base leading-none font-medium", className), ...props }));
|
|
@@ -49,4 +49,4 @@ exports.DialogOverlay = DialogOverlay;
|
|
|
49
49
|
exports.DialogPortal = DialogPortal;
|
|
50
50
|
exports.DialogTitle = DialogTitle;
|
|
51
51
|
exports.DialogTrigger = DialogTrigger;
|
|
52
|
-
//# sourceMappingURL=dialog-
|
|
52
|
+
//# sourceMappingURL=dialog-3nRssoAl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog-3nRssoAl.js","sources":["../../../src/shadcn/components/dialog.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Dialog as DialogPrimitive } from \"radix-ui\"\nimport { useTranslation } from \"react-i18next\"\n\nimport { cn } from \"src/shadcn/lib/utils\"\nimport { Button } from \"src/shadcn/components/button\"\nimport { XIcon } from \"lucide-react\"\n\nfunction Dialog({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />\n}\n\nfunction DialogTrigger({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />\n}\n\nfunction DialogPortal({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />\n}\n\nfunction DialogClose({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n \"fixed inset-0 isolate 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 className\n )}\n {...props}\n />\n )\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean\n}) {\n const { t } = useTranslation()\n\n return (\n <DialogPortal>\n <DialogOverlay />\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 />\n <span className=\"sr-only\">{t(\"neetoatoms.dialog.close\", \"Close\")}</span>\n </Button>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n )\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\"flex flex-col gap-3\", className)}\n {...props}\n />\n )\n}\n\nfunction DialogFooter({\n className,\n showCloseButton = false,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & {\n showCloseButton?: boolean\n}) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n \"-mx-6 -mb-6 flex flex-col-reverse gap-2 rounded-b-xl bg-muted/50 px-6 py-4 sm:flex-row sm:justify-end\",\n className\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close asChild>\n <Button variant=\"outline\">Close</Button>\n </DialogPrimitive.Close>\n )}\n </div>\n )\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn(\n \"text-base leading-none font-medium\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\n \"text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground\",\n className\n )}\n {...props}\n />\n )\n}\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","DialogPrimitive.Root","DialogPrimitive.Trigger","DialogPrimitive.Portal","DialogPrimitive.Close","DialogPrimitive.Overlay","cn","useTranslation","_jsxs","DialogPrimitive.Content","Button","XIcon","DialogPrimitive.Title","DialogPrimitive.Description"],"mappings":";;;;;;;;;AAQA,SAAS,MAAM,CAAC,EACd,GAAG,KAAK,EAC0C,EAAA;IAClD,OAAOA,cAAA,CAACC,UAAoB,iBAAW,QAAQ,EAAA,GAAK,KAAK,EAAA,CAAI;AAC/D;AAEA,SAAS,aAAa,CAAC,EACrB,GAAG,KAAK,EAC6C,EAAA;IACrD,OAAOD,cAAA,CAACE,aAAuB,iBAAW,gBAAgB,EAAA,GAAK,KAAK,EAAA,CAAI;AAC1E;AAEA,SAAS,YAAY,CAAC,EACpB,GAAG,KAAK,EAC4C,EAAA;IACpD,OAAOF,cAAA,CAACG,YAAsB,iBAAW,eAAe,EAAA,GAAK,KAAK,EAAA,CAAI;AACxE;AAEA,SAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EAC2C,EAAA;IACnD,OAAOH,cAAA,CAACI,WAAqB,iBAAW,cAAc,EAAA,GAAK,KAAK,EAAA,CAAI;AACtE;AAEA,SAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EAC6C,EAAA;IACrD,QACEJ,eAACK,aAAuB,EAAA,EAAA,WAAA,EACZ,gBAAgB,EAC1B,SAAS,EAAEC,QAAE,CACX,uLAAuL,EACvL,SAAS,CACV,KACG,KAAK,EAAA,CACT;AAEN;AAEA,SAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,eAAe,GAAG,IAAI,EACtB,GAAG,KAAK,EAGT,EAAA;AACC,IAAA,MAAM,EAAE,CAAC,EAAE,GAAGC,2BAAc,EAAE;AAE9B,IAAA,QACEC,eAAA,CAAC,YAAY,EAAA,EAAA,QAAA,EAAA,CACXR,cAAA,CAAC,aAAa,EAAA,EAAA,CAAG,EACjBQ,eAAA,CAACC,aAAuB,EAAA,EAAA,WAA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,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EAC2C,EAAA;IACnD,QACEV,eAACY,WAAqB,EAAA,EAAA,WAAA,EACV,cAAc,EACxB,SAAS,EAAEN,QAAE,CACX,oCAAoC,EACpC,SAAS,CACV,KACG,KAAK,EAAA,CACT;AAEN;AAEA,SAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACiD,EAAA;IACzD,QACEN,eAACa,iBAA2B,EAAA,EAAA,WAAA,EAChB,oBAAoB,EAC9B,SAAS,EAAEP,QAAE,CACX,oGAAoG,EACpG,SAAS,CACV,KACG,KAAK,EAAA,CACT;AAEN;;;;;;;;;;;;;"}
|
|
@@ -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');
|
|
@@ -35,7 +35,7 @@ require('../index-DcCSSgb7.js');
|
|
|
35
35
|
require('../index-CyrAgb4H.js');
|
|
36
36
|
require('../index-CB9xFokC.js');
|
|
37
37
|
require('../primitives/Dialog.js');
|
|
38
|
-
require('../dialog-
|
|
38
|
+
require('../dialog-3nRssoAl.js');
|
|
39
39
|
require('../x-Brw3FJst.js');
|
|
40
40
|
require('../index-BLGrl3PF.js');
|
|
41
41
|
require('../index-ChSOMM8b.js');
|
package/dist/cjs/formik/index.js
CHANGED
|
@@ -87,9 +87,9 @@ 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
|
-
require('../dialog-
|
|
92
|
+
require('../dialog-3nRssoAl.js');
|
|
93
93
|
require('../index-BLGrl3PF.js');
|
|
94
94
|
|
|
95
95
|
|
package/dist/cjs/index.js
CHANGED
|
@@ -5,7 +5,7 @@ var Alert = require('./Alert-BVvLyM_d.js');
|
|
|
5
5
|
var Avatar = require('./Avatar-CNao5gvP.js');
|
|
6
6
|
var Badge = require('./Badge-_-PRf6aq.js');
|
|
7
7
|
var Button = require('./Button-Bt_AElge.js');
|
|
8
|
-
var Callout = require('./Callout-
|
|
8
|
+
var Callout = require('./Callout-CVNpjTde.js');
|
|
9
9
|
var Checkbox = require('./Checkbox-DOlS2oCD.js');
|
|
10
10
|
var ColorPicker = require('./ColorPicker-Uxgn8U0h.js');
|
|
11
11
|
var DatePicker = require('./DatePicker-CA113xZV.js');
|
|
@@ -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');
|
|
@@ -28,7 +28,7 @@ var Pagination = require('./Pagination-Byzt9Kmj.js');
|
|
|
28
28
|
var RadioGroup = require('./RadioGroup-1RAoe38m.js');
|
|
29
29
|
var Select = require('./Select-Br1AT_wm.js');
|
|
30
30
|
var MultiEmailInput = require('./MultiEmailInput-l0_YVjbp.js');
|
|
31
|
-
var Sheet = require('./Sheet-
|
|
31
|
+
var Sheet = require('./Sheet-BTZe2VQk.js');
|
|
32
32
|
var Popover = require('./Popover-B1d4URJl.js');
|
|
33
33
|
var Progress = require('./Progress-DoCxZ_ZH.js');
|
|
34
34
|
var Slider = require('./Slider-jNUS9vt8.js');
|
|
@@ -68,7 +68,7 @@ require('./primitives/Dialog.js');
|
|
|
68
68
|
require('./button-CKlGvVqQ.js');
|
|
69
69
|
require('./index-BZhTddX0.js');
|
|
70
70
|
require('./index-DuNgWCXZ.js');
|
|
71
|
-
require('./dialog-
|
|
71
|
+
require('./dialog-3nRssoAl.js');
|
|
72
72
|
require('./x-Brw3FJst.js');
|
|
73
73
|
require('./index-BLGrl3PF.js');
|
|
74
74
|
require('./index-Bvu9MiFi.js');
|
|
@@ -123,7 +123,7 @@ require('./SelectFieldWrapper-DEA--2wj.js');
|
|
|
123
123
|
require('./primitives/Combobox.js');
|
|
124
124
|
require('./with-selector-DeKHbQY7.js');
|
|
125
125
|
require('./primitives/Sheet.js');
|
|
126
|
-
require('./sheet-
|
|
126
|
+
require('./sheet-BG5iB_da.js');
|
|
127
127
|
require('./primitives/HoverCard.js');
|
|
128
128
|
require('./primitives/Progress.js');
|
|
129
129
|
require('./primitives/Slider.js');
|
|
@@ -8,7 +8,7 @@ var index = require('../index-D-iDn9RI.js');
|
|
|
8
8
|
var index$1 = require('../index-BwAq9ba8.js');
|
|
9
9
|
var reactI18next = require('react-i18next');
|
|
10
10
|
var utils = require('../utils-CTr7wn5d.js');
|
|
11
|
-
var dialog = require('../dialog-
|
|
11
|
+
var dialog = require('../dialog-3nRssoAl.js');
|
|
12
12
|
var inputGroup = require('../input-group-DRgJde06.js');
|
|
13
13
|
var createLucideIcon = require('../createLucideIcon-D0tRgV6l.js');
|
|
14
14
|
var check = require('../check-BQgcDXys.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var utils = require('../utils-CTr7wn5d.js');
|
|
5
5
|
var button = require('../button-CKlGvVqQ.js');
|
|
6
|
-
var dialog = require('../dialog-
|
|
6
|
+
var dialog = require('../dialog-3nRssoAl.js');
|
|
7
7
|
var x = require('../x-Brw3FJst.js');
|
|
8
8
|
var index = require('../index-BLGrl3PF.js');
|
|
9
9
|
require('react');
|
|
@@ -31,10 +31,10 @@ const DialogClose = (props) => (jsxRuntime.jsx(dialog.DialogClose, { ...props })
|
|
|
31
31
|
* DialogContent composes Portal + Overlay + Radix Content so that
|
|
32
32
|
* `overlayClassName` can be forwarded to the overlay element.
|
|
33
33
|
*/
|
|
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-
|
|
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-
|
|
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,EAAA,IAAA,EAAA,QAAA,EACrDL,eAAA,CAACM,aAAM,EAAA,EACL,OAAO,EAAC,OAAO,EACf,SAAS,EAAC,sBAAsB,EAChC,IAAI,EAAC,SAAS,EAAA,QAAA,EAAA,CAEdT,cAAA,CAACU,GAAK,EAAA,EAAA,CAAG,EACTV,yBAAM,SAAS,EAAC,SAAS,EAAA,QAAA,EAAA,OAAA,EAAA,CAAa,CAAA,EAAA,CAC/B,GACa,CACzB,CAAA,EAAA,CACuB,CAAA,EAAA,CACP;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