@abumble/design-system 0.0.32 → 0.0.33
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/shared/Dialog.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as a, jsxs as o, Fragment as
|
|
1
|
+
import { jsx as a, jsxs as o, Fragment as m } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { XIcon as
|
|
3
|
+
import { XIcon as u } from "lucide-react";
|
|
4
4
|
import * as n from "@radix-ui/react-dialog";
|
|
5
5
|
import { c as i } from "./utils.js";
|
|
6
6
|
import { B as f } from "./Button.js";
|
|
@@ -54,7 +54,7 @@ function v({
|
|
|
54
54
|
{
|
|
55
55
|
"data-slot": "dialog-content",
|
|
56
56
|
className: i(
|
|
57
|
-
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(
|
|
57
|
+
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100vw-2rem)] sm:max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 rounded border p-6 shadow-lg duration-200 outline-none",
|
|
58
58
|
e
|
|
59
59
|
),
|
|
60
60
|
...l,
|
|
@@ -66,7 +66,7 @@ function v({
|
|
|
66
66
|
"data-slot": "dialog-close",
|
|
67
67
|
className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
68
68
|
children: [
|
|
69
|
-
/* @__PURE__ */ a(
|
|
69
|
+
/* @__PURE__ */ a(u, {}),
|
|
70
70
|
/* @__PURE__ */ a("span", { className: "sr-only", children: "Close" })
|
|
71
71
|
]
|
|
72
72
|
}
|
|
@@ -169,7 +169,7 @@ function y({
|
|
|
169
169
|
/* @__PURE__ */ a("span", { className: "text-foreground", children: e }),
|
|
170
170
|
/* @__PURE__ */ a("span", { children: "/" }),
|
|
171
171
|
/* @__PURE__ */ a("span", { children: t }),
|
|
172
|
-
g && /* @__PURE__ */ o(
|
|
172
|
+
g && /* @__PURE__ */ o(m, { children: [
|
|
173
173
|
/* @__PURE__ */ a("span", { className: "text-border", children: "·" }),
|
|
174
174
|
/* @__PURE__ */ a("span", { className: "hidden sm:inline", children: g })
|
|
175
175
|
] })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","sources":["../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport { XIcon } from 'lucide-react'\nimport * as DialogPrimitive from '@radix-ui/react-dialog'\n\nimport { cn } from '@/utils'\nimport { Button } from '@/components/Button/Button'\n\n/** Class for create/edit form dialogs: consistent width and scroll. Use via FormDialog or apply to DialogContent. */\nexport const FORM_DIALOG_CONTENT_CLASS =\n\t'max-w-[calc(100vw-2rem)] sm:max-w-2xl max-h-[90vh] overflow-y-auto'\n\nexport function Dialog({\n\t...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n\treturn <DialogPrimitive.Root data-slot=\"dialog\" {...props} />\n}\n\nexport function DialogTrigger({\n\t...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n\treturn <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />\n}\n\nexport function DialogPortal({\n\t...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n\treturn <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />\n}\n\nexport function DialogClose({\n\t...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n\treturn <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />\n}\n\nexport function DialogOverlay({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n\treturn (\n\t\t<DialogPrimitive.Overlay\n\t\t\tdata-slot=\"dialog-overlay\"\n\t\t\tclassName={cn(\n\t\t\t\t'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\nexport function DialogContent({\n\tclassName,\n\tchildren,\n\tshowCloseIcon = true,\n\t...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n\tshowCloseIcon?: boolean\n}) {\n\treturn (\n\t\t<DialogPortal data-slot=\"dialog-portal\">\n\t\t\t<DialogOverlay />\n\t\t\t<DialogPrimitive.Content\n\t\t\t\tdata-slot=\"dialog-content\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded border p-6 shadow-lg duration-200 outline-none',\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t\t{showCloseIcon && (\n\t\t\t\t\t<DialogPrimitive.Close\n\t\t\t\t\t\tdata-slot=\"dialog-close\"\n\t\t\t\t\t\tclassName=\"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<XIcon />\n\t\t\t\t\t\t<span className=\"sr-only\">Close</span>\n\t\t\t\t\t</DialogPrimitive.Close>\n\t\t\t\t)}\n\t\t\t</DialogPrimitive.Content>\n\t\t</DialogPortal>\n\t)\n}\n\nexport function DialogHeader({\n\tclassName,\n\t...props\n}: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"dialog-header\"\n\t\t\tclassName={cn('flex flex-col gap-2 text-center sm:text-left', className)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\nexport function DialogFooter({\n\tclassName,\n\tshowCloseAction = false,\n\tchildren,\n\t...props\n}: React.ComponentProps<'div'> & {\n\tshowCloseAction?: boolean\n}) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"dialog-footer\"\n\t\t\tclassName={cn(\n\t\t\t\t'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\t{showCloseAction && (\n\t\t\t\t<DialogPrimitive.Close asChild>\n\t\t\t\t\t<Button variant=\"outline\">Close</Button>\n\t\t\t\t</DialogPrimitive.Close>\n\t\t\t)}\n\t\t</div>\n\t)\n}\n\nexport function DialogTitle({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n\treturn (\n\t\t<DialogPrimitive.Title\n\t\t\tdata-slot=\"dialog-title\"\n\t\t\tclassName={cn('text-lg leading-none font-semibold', className)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\nexport function DialogDescription({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n\treturn (\n\t\t<DialogPrimitive.Description\n\t\t\tdata-slot=\"dialog-description\"\n\t\t\tclassName={cn('text-muted-foreground text-sm', className)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\nexport interface FormDialogProps {\n\topen: boolean\n\tonOpenChange: (open: boolean) => void\n\ttitle: string\n\tdescription: React.ReactNode\n\t/** Optional trigger (e.g. \"Add\" button); when provided, render as first child of Dialog. */\n\ttrigger?: React.ReactNode\n\tchildren: React.ReactNode\n\t/** Optional custom className for DialogContent (overrides FORM_DIALOG_CONTENT_CLASS). Use for wider dialogs (e.g., sm:max-w-5xl for wizards). */\n\tclassName?: string\n\t/** Optional wizard configuration for multi-step forms. Renders a stepper bar at the top of the header. */\n\twizard?: {\n\t\tcurrentStep: number\n\t\ttotalSteps: number\n\t\tstepTitle: string\n\t\tstepLabels?: Array<string>\n\t}\n}\n\n/** Compact glass-styled stepper for top-right corner of wizard dialogs. */\nexport function WizardStepper({\n\tcurrentStep,\n\ttotalSteps,\n\tstepLabels,\n}: {\n\tcurrentStep: number\n\ttotalSteps: number\n\tstepLabels?: Array<string>\n}) {\n\tconst steps = Array.from({ length: totalSteps }, (_, i) => i + 1)\n\tconst currentLabel = stepLabels?.[currentStep - 1]\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"absolute top-4 right-12 z-20 flex items-center gap-2 rounded-full border border-border/50 bg-background/80 px-3 py-1.5 backdrop-blur-sm\"\n\t\t\taria-label=\"Progress\"\n\t\t>\n\t\t\t{/* Step dots */}\n\t\t\t<div className=\"flex items-center gap-1.5\">\n\t\t\t\t{steps.map((step) => {\n\t\t\t\t\tconst isCompleted = step < currentStep\n\t\t\t\t\tconst isCurrent = step === currentStep\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tkey={step}\n\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t'h-1.5 w-1.5 rounded-full transition-all duration-300',\n\t\t\t\t\t\t\t\tisCurrent && 'bg-primary w-6',\n\t\t\t\t\t\t\t\tisCompleted && 'bg-primary',\n\t\t\t\t\t\t\t\t!isCurrent && !isCompleted && 'bg-muted',\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\taria-current={isCurrent ? 'step' : undefined}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t})}\n\t\t\t</div>\n\n\t\t\t{/* Step label/counter */}\n\t\t\t<div className=\"text-muted-foreground flex items-center gap-1.5 text-xs font-medium\">\n\t\t\t\t<span className=\"text-foreground\">{currentStep}</span>\n\t\t\t\t<span>/</span>\n\t\t\t\t<span>{totalSteps}</span>\n\t\t\t\t{currentLabel && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<span className=\"text-border\">·</span>\n\t\t\t\t\t\t<span className=\"hidden sm:inline\">{currentLabel}</span>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</div>\n\t)\n}\n\n/** Dialog shell for create/edit forms: standard width, header with title + description. */\nexport function FormDialog({\n\topen,\n\tonOpenChange,\n\ttitle,\n\tdescription,\n\ttrigger,\n\tchildren,\n\tclassName,\n\twizard,\n}: FormDialogProps) {\n\treturn (\n\t\t<Dialog open={open} onOpenChange={onOpenChange}>\n\t\t\t{trigger}\n\t\t\t<DialogContent className={className ?? FORM_DIALOG_CONTENT_CLASS}>\n\t\t\t\t{wizard && (\n\t\t\t\t\t<WizardStepper\n\t\t\t\t\t\tcurrentStep={wizard.currentStep}\n\t\t\t\t\t\ttotalSteps={wizard.totalSteps}\n\t\t\t\t\t\tstepLabels={wizard.stepLabels}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t<div className=\"bg-muted -m-6 p-6 -mb-4\">\n\t\t\t\t\t<DialogTitle>{title}</DialogTitle>\n\t\t\t\t\t<DialogDescription>{description}</DialogDescription>\n\t\t\t\t</div>\n\t\t\t\t{children}\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t)\n}\n"],"names":["FORM_DIALOG_CONTENT_CLASS","Dialog","props","DialogPrimitive","DialogTrigger","DialogPortal","DialogClose","DialogOverlay","className","jsx","cn","DialogContent","children","showCloseIcon","jsxs","XIcon","DialogHeader","DialogFooter","showCloseAction","Button","DialogTitle","DialogDescription","WizardStepper","currentStep","totalSteps","stepLabels","steps","_","i","currentLabel","step","isCompleted","isCurrent","Fragment","FormDialog","open","onOpenChange","title","description","trigger","wizard"],"mappings":";;;;;;AAUO,MAAMA,IACZ;AAEM,SAASC,EAAO;AAAA,EACtB,GAAGC;AACJ,GAAsD;AACrD,2BAAQC,EAAgB,MAAhB,EAAqB,aAAU,UAAU,GAAGD,GAAO;AAC5D;AAEO,SAASE,EAAc;AAAA,EAC7B,GAAGF;AACJ,GAAyD;AACxD,2BAAQC,EAAgB,SAAhB,EAAwB,aAAU,kBAAkB,GAAGD,GAAO;AACvE;AAEO,SAASG,EAAa;AAAA,EAC5B,GAAGH;AACJ,GAAwD;AACvD,2BAAQC,EAAgB,QAAhB,EAAuB,aAAU,iBAAiB,GAAGD,GAAO;AACrE;AAEO,SAASI,EAAY;AAAA,EAC3B,GAAGJ;AACJ,GAAuD;AACtD,2BAAQC,EAAgB,OAAhB,EAAsB,aAAU,gBAAgB,GAAGD,GAAO;AACnE;AAEO,SAASK,EAAc;AAAA,EAC7B,WAAAC;AAAA,EACA,GAAGN;AACJ,GAAyD;AACxD,SACC,gBAAAO;AAAA,IAACN,EAAgB;AAAA,IAAhB;AAAA,MACA,aAAU;AAAA,MACV,WAAWO;AAAA,QACV;AAAA,QACAF;AAAA,MAAA;AAAA,MAEA,GAAGN;AAAA,IAAA;AAAA,EAAA;AAGP;AAEO,SAASS,EAAc;AAAA,EAC7B,WAAAH;AAAA,EACA,UAAAI;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,GAAGX;AACJ,GAEG;AACF,SACC,gBAAAY,EAACT,GAAA,EAAa,aAAU,iBACvB,UAAA;AAAA,IAAA,gBAAAI,EAACF,GAAA,EAAc;AAAA,IACf,gBAAAO;AAAA,MAACX,EAAgB;AAAA,MAAhB;AAAA,QACA,aAAU;AAAA,QACV,WAAWO;AAAA,UACV;AAAA,UACAF;AAAA,QA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EAAAmB,GAAA,EACC,UAAA;AAAA,YAAA,gBAAAxB,EAAC,QAAA,EAAK,WAAU,eAAc,UAAA,KAAC;AAAA,YAC/B,gBAAAA,EAAC,QAAA,EAAK,WAAU,oBAAoB,UAAAoB,EAAA,CAAa;AAAA,UAAA,EAAA,CAClD;AAAA,QAAA,EAAA,CAEF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGH;AAGO,SAASK,EAAW;AAAA,EAC1B,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAA3B;AAAA,EACA,WAAAJ;AAAA,EACA,QAAAgC;AACD,GAAoB;AACnB,SACC,gBAAA1B,EAACb,GAAA,EAAO,MAAAkC,GAAY,cAAAC,GAClB,UAAA;AAAA,IAAAG;AAAA,IACD,gBAAAzB,EAACH,GAAA,EAAc,WAAWH,KAAaR,GACrC,UAAA;AAAA,MAAAwC,KACA,gBAAA/B;AAAA,QAACa;AAAA,QAAA;AAAA,UACA,aAAakB,EAAO;AAAA,UACpB,YAAYA,EAAO;AAAA,UACnB,YAAYA,EAAO;AAAA,QAAA;AAAA,MAAA;AAAA,MAGrB,gBAAA1B,EAAC,OAAA,EAAI,WAAU,2BACd,UAAA;AAAA,QAAA,gBAAAL,EAACW,KAAa,UAAAiB,EAAA,CAAM;AAAA,QACpB,gBAAA5B,EAACY,KAAmB,UAAAiB,EAAA,CAAY;AAAA,MAAA,GACjC;AAAA,MACC1B;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACD;AAEF;"}
|
|
1
|
+
{"version":3,"file":"Dialog.js","sources":["../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport { XIcon } from 'lucide-react'\nimport * as DialogPrimitive from '@radix-ui/react-dialog'\n\nimport { cn } from '@/utils'\nimport { Button } from '@/components/Button/Button'\n\n/** Class for create/edit form dialogs: consistent width and scroll. Use via FormDialog or apply to DialogContent. */\nexport const FORM_DIALOG_CONTENT_CLASS =\n\t'max-w-[calc(100vw-2rem)] sm:max-w-2xl max-h-[90vh] overflow-y-auto'\n\nexport function Dialog({\n\t...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n\treturn <DialogPrimitive.Root data-slot=\"dialog\" {...props} />\n}\n\nexport function DialogTrigger({\n\t...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n\treturn <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />\n}\n\nexport function DialogPortal({\n\t...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n\treturn <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />\n}\n\nexport function DialogClose({\n\t...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n\treturn <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />\n}\n\nexport function DialogOverlay({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n\treturn (\n\t\t<DialogPrimitive.Overlay\n\t\t\tdata-slot=\"dialog-overlay\"\n\t\t\tclassName={cn(\n\t\t\t\t'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\nexport function DialogContent({\n\tclassName,\n\tchildren,\n\tshowCloseIcon = true,\n\t...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n\tshowCloseIcon?: boolean\n}) {\n\treturn (\n\t\t<DialogPortal data-slot=\"dialog-portal\">\n\t\t\t<DialogOverlay />\n\t\t\t<DialogPrimitive.Content\n\t\t\t\tdata-slot=\"dialog-content\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100vw-2rem)] sm:max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 rounded border p-6 shadow-lg duration-200 outline-none',\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t\t{showCloseIcon && (\n\t\t\t\t\t<DialogPrimitive.Close\n\t\t\t\t\t\tdata-slot=\"dialog-close\"\n\t\t\t\t\t\tclassName=\"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<XIcon />\n\t\t\t\t\t\t<span className=\"sr-only\">Close</span>\n\t\t\t\t\t</DialogPrimitive.Close>\n\t\t\t\t)}\n\t\t\t</DialogPrimitive.Content>\n\t\t</DialogPortal>\n\t)\n}\n\nexport function DialogHeader({\n\tclassName,\n\t...props\n}: React.ComponentProps<'div'>) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"dialog-header\"\n\t\t\tclassName={cn('flex flex-col gap-2 text-center sm:text-left', className)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\nexport function DialogFooter({\n\tclassName,\n\tshowCloseAction = false,\n\tchildren,\n\t...props\n}: React.ComponentProps<'div'> & {\n\tshowCloseAction?: boolean\n}) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"dialog-footer\"\n\t\t\tclassName={cn(\n\t\t\t\t'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\t{showCloseAction && (\n\t\t\t\t<DialogPrimitive.Close asChild>\n\t\t\t\t\t<Button variant=\"outline\">Close</Button>\n\t\t\t\t</DialogPrimitive.Close>\n\t\t\t)}\n\t\t</div>\n\t)\n}\n\nexport function DialogTitle({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n\treturn (\n\t\t<DialogPrimitive.Title\n\t\t\tdata-slot=\"dialog-title\"\n\t\t\tclassName={cn('text-lg leading-none font-semibold', className)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\nexport function DialogDescription({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n\treturn (\n\t\t<DialogPrimitive.Description\n\t\t\tdata-slot=\"dialog-description\"\n\t\t\tclassName={cn('text-muted-foreground text-sm', className)}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\nexport interface FormDialogProps {\n\topen: boolean\n\tonOpenChange: (open: boolean) => void\n\ttitle: string\n\tdescription: React.ReactNode\n\t/** Optional trigger (e.g. \"Add\" button); when provided, render as first child of Dialog. */\n\ttrigger?: React.ReactNode\n\tchildren: React.ReactNode\n\t/** Optional custom className for DialogContent (overrides FORM_DIALOG_CONTENT_CLASS). Use for wider dialogs (e.g., sm:max-w-5xl for wizards). */\n\tclassName?: string\n\t/** Optional wizard configuration for multi-step forms. Renders a stepper bar at the top of the header. */\n\twizard?: {\n\t\tcurrentStep: number\n\t\ttotalSteps: number\n\t\tstepTitle: string\n\t\tstepLabels?: Array<string>\n\t}\n}\n\n/** Compact glass-styled stepper for top-right corner of wizard dialogs. */\nexport function WizardStepper({\n\tcurrentStep,\n\ttotalSteps,\n\tstepLabels,\n}: {\n\tcurrentStep: number\n\ttotalSteps: number\n\tstepLabels?: Array<string>\n}) {\n\tconst steps = Array.from({ length: totalSteps }, (_, i) => i + 1)\n\tconst currentLabel = stepLabels?.[currentStep - 1]\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"absolute top-4 right-12 z-20 flex items-center gap-2 rounded-full border border-border/50 bg-background/80 px-3 py-1.5 backdrop-blur-sm\"\n\t\t\taria-label=\"Progress\"\n\t\t>\n\t\t\t{/* Step dots */}\n\t\t\t<div className=\"flex items-center gap-1.5\">\n\t\t\t\t{steps.map((step) => {\n\t\t\t\t\tconst isCompleted = step < currentStep\n\t\t\t\t\tconst isCurrent = step === currentStep\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tkey={step}\n\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t'h-1.5 w-1.5 rounded-full transition-all duration-300',\n\t\t\t\t\t\t\t\tisCurrent && 'bg-primary w-6',\n\t\t\t\t\t\t\t\tisCompleted && 'bg-primary',\n\t\t\t\t\t\t\t\t!isCurrent && !isCompleted && 'bg-muted',\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\taria-current={isCurrent ? 'step' : undefined}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t})}\n\t\t\t</div>\n\n\t\t\t{/* Step label/counter */}\n\t\t\t<div className=\"text-muted-foreground flex items-center gap-1.5 text-xs font-medium\">\n\t\t\t\t<span className=\"text-foreground\">{currentStep}</span>\n\t\t\t\t<span>/</span>\n\t\t\t\t<span>{totalSteps}</span>\n\t\t\t\t{currentLabel && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<span className=\"text-border\">·</span>\n\t\t\t\t\t\t<span className=\"hidden sm:inline\">{currentLabel}</span>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</div>\n\t)\n}\n\n/** Dialog shell for create/edit forms: standard width, header with title + description. */\nexport function FormDialog({\n\topen,\n\tonOpenChange,\n\ttitle,\n\tdescription,\n\ttrigger,\n\tchildren,\n\tclassName,\n\twizard,\n}: FormDialogProps) {\n\treturn (\n\t\t<Dialog open={open} onOpenChange={onOpenChange}>\n\t\t\t{trigger}\n\t\t\t<DialogContent className={className ?? FORM_DIALOG_CONTENT_CLASS}>\n\t\t\t\t{wizard && (\n\t\t\t\t\t<WizardStepper\n\t\t\t\t\t\tcurrentStep={wizard.currentStep}\n\t\t\t\t\t\ttotalSteps={wizard.totalSteps}\n\t\t\t\t\t\tstepLabels={wizard.stepLabels}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t<div className=\"bg-muted -m-6 p-6 -mb-4\">\n\t\t\t\t\t<DialogTitle>{title}</DialogTitle>\n\t\t\t\t\t<DialogDescription>{description}</DialogDescription>\n\t\t\t\t</div>\n\t\t\t\t{children}\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t)\n}\n"],"names":["FORM_DIALOG_CONTENT_CLASS","Dialog","props","DialogPrimitive","DialogTrigger","DialogPortal","DialogClose","DialogOverlay","className","jsx","cn","DialogContent","children","showCloseIcon","jsxs","XIcon","DialogHeader","DialogFooter","showCloseAction","Button","DialogTitle","DialogDescription","WizardStepper","currentStep","totalSteps","stepLabels","steps","_","i","currentLabel","step","isCompleted","isCurrent","Fragment","FormDialog","open","onOpenChange","title","description","trigger","wizard"],"mappings":";;;;;;AAUO,MAAMA,IACZ;AAEM,SAASC,EAAO;AAAA,EACtB,GAAGC;AACJ,GAAsD;AACrD,2BAAQC,EAAgB,MAAhB,EAAqB,aAAU,UAAU,GAAGD,GAAO;AAC5D;AAEO,SAASE,EAAc;AAAA,EAC7B,GAAGF;AACJ,GAAyD;AACxD,2BAAQC,EAAgB,SAAhB,EAAwB,aAAU,kBAAkB,GAAGD,GAAO;AACvE;AAEO,SAASG,EAAa;AAAA,EAC5B,GAAGH;AACJ,GAAwD;AACvD,2BAAQC,EAAgB,QAAhB,EAAuB,aAAU,iBAAiB,GAAGD,GAAO;AACrE;AAEO,SAASI,EAAY;AAAA,EAC3B,GAAGJ;AACJ,GAAuD;AACtD,2BAAQC,EAAgB,OAAhB,EAAsB,aAAU,gBAAgB,GAAGD,GAAO;AACnE;AAEO,SAASK,EAAc;AAAA,EAC7B,WAAAC;AAAA,EACA,GAAGN;AACJ,GAAyD;AACxD,SACC,gBAAAO;AAAA,IAACN,EAAgB;AAA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