@mehdashti/modals 0.2.0 → 0.2.1
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/index.d.ts +2 -2
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -101,7 +101,7 @@ interface ModalContextValue {
|
|
|
101
101
|
/**
|
|
102
102
|
* Open a modal
|
|
103
103
|
*/
|
|
104
|
-
openModal: (id: string, props: Omit<ModalProps, "open"
|
|
104
|
+
openModal: (id: string, props: Omit<ModalProps, "open">) => void;
|
|
105
105
|
/**
|
|
106
106
|
* Close a modal
|
|
107
107
|
*/
|
|
@@ -227,7 +227,7 @@ interface PromptOptions {
|
|
|
227
227
|
* Hook providing global modal utilities
|
|
228
228
|
*/
|
|
229
229
|
declare function useModals(): {
|
|
230
|
-
openModal: (id: string, props: Omit<ModalProps, "open"
|
|
230
|
+
openModal: (id: string, props: Omit<ModalProps, "open">) => void;
|
|
231
231
|
closeModal: (id: string) => void;
|
|
232
232
|
closeAllModals: () => void;
|
|
233
233
|
isModalOpen: (id: string) => boolean;
|
package/dist/index.js
CHANGED
|
@@ -318,19 +318,30 @@ function useModals() {
|
|
|
318
318
|
(options) => {
|
|
319
319
|
return new Promise((resolve) => {
|
|
320
320
|
const modalId = `confirm-${Date.now()}`;
|
|
321
|
+
let resolved = false;
|
|
321
322
|
const handleConfirm = () => {
|
|
323
|
+
if (resolved) return;
|
|
324
|
+
resolved = true;
|
|
322
325
|
context.closeModal(modalId);
|
|
323
326
|
resolve(true);
|
|
324
327
|
};
|
|
325
328
|
const handleCancel = () => {
|
|
329
|
+
if (resolved) return;
|
|
330
|
+
resolved = true;
|
|
326
331
|
context.closeModal(modalId);
|
|
327
332
|
resolve(false);
|
|
328
333
|
};
|
|
334
|
+
const handleDismiss = () => {
|
|
335
|
+
if (resolved) return;
|
|
336
|
+
resolved = true;
|
|
337
|
+
resolve(false);
|
|
338
|
+
};
|
|
329
339
|
context.openModal(modalId, {
|
|
330
340
|
title: options.title,
|
|
331
341
|
size: "sm",
|
|
332
342
|
dismissable: true,
|
|
333
343
|
showClose: false,
|
|
344
|
+
onClose: handleDismiss,
|
|
334
345
|
children: /* @__PURE__ */ jsxs5("div", { className: "space-y-4", children: [
|
|
335
346
|
/* @__PURE__ */ jsx5("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: options.message }),
|
|
336
347
|
/* @__PURE__ */ jsxs5("div", { className: "flex justify-end gap-2", children: [
|
|
@@ -361,15 +372,24 @@ function useModals() {
|
|
|
361
372
|
(options) => {
|
|
362
373
|
return new Promise((resolve) => {
|
|
363
374
|
const modalId = `alert-${Date.now()}`;
|
|
375
|
+
let resolved = false;
|
|
364
376
|
const handleOk = () => {
|
|
377
|
+
if (resolved) return;
|
|
378
|
+
resolved = true;
|
|
365
379
|
context.closeModal(modalId);
|
|
366
380
|
resolve();
|
|
367
381
|
};
|
|
382
|
+
const handleDismiss = () => {
|
|
383
|
+
if (resolved) return;
|
|
384
|
+
resolved = true;
|
|
385
|
+
resolve();
|
|
386
|
+
};
|
|
368
387
|
context.openModal(modalId, {
|
|
369
388
|
title: options.title,
|
|
370
389
|
size: "sm",
|
|
371
390
|
dismissable: true,
|
|
372
391
|
showClose: false,
|
|
392
|
+
onClose: handleDismiss,
|
|
373
393
|
children: /* @__PURE__ */ jsxs5("div", { className: "space-y-4", children: [
|
|
374
394
|
/* @__PURE__ */ jsx5("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: options.message }),
|
|
375
395
|
/* @__PURE__ */ jsx5("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx5(
|
|
@@ -392,6 +412,12 @@ function useModals() {
|
|
|
392
412
|
const modalId = `prompt-${Date.now()}`;
|
|
393
413
|
let inputValue = options.defaultValue || "";
|
|
394
414
|
let errorMessage = "";
|
|
415
|
+
let resolved = false;
|
|
416
|
+
const handleDismiss = () => {
|
|
417
|
+
if (resolved) return;
|
|
418
|
+
resolved = true;
|
|
419
|
+
resolve(null);
|
|
420
|
+
};
|
|
395
421
|
const PromptContent = () => {
|
|
396
422
|
const [value, setValue] = React3.useState(inputValue);
|
|
397
423
|
const [error, setError] = React3.useState("");
|
|
@@ -403,10 +429,14 @@ function useModals() {
|
|
|
403
429
|
return;
|
|
404
430
|
}
|
|
405
431
|
}
|
|
432
|
+
if (resolved) return;
|
|
433
|
+
resolved = true;
|
|
406
434
|
context.closeModal(modalId);
|
|
407
435
|
resolve(value);
|
|
408
436
|
};
|
|
409
437
|
const handleCancel = () => {
|
|
438
|
+
if (resolved) return;
|
|
439
|
+
resolved = true;
|
|
410
440
|
context.closeModal(modalId);
|
|
411
441
|
resolve(null);
|
|
412
442
|
};
|
|
@@ -458,6 +488,7 @@ function useModals() {
|
|
|
458
488
|
size: "sm",
|
|
459
489
|
dismissable: true,
|
|
460
490
|
showClose: false,
|
|
491
|
+
onClose: handleDismiss,
|
|
461
492
|
children: /* @__PURE__ */ jsx5(PromptContent, {})
|
|
462
493
|
});
|
|
463
494
|
});
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/modal.tsx","../src/components/confirm-modal.tsx","../src/components/drawer.tsx","../src/context/modal-context.tsx","../src/hooks/use-modal.ts","../src/hooks/use-modals.tsx"],"sourcesContent":["/**\n * Modal Component\n *\n * Modal dialog with Radix UI.\n */\n\nimport * as React from \"react\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport { clsx } from \"clsx\";\nimport type { ModalProps } from \"../types/index.js\";\n\nconst sizeClasses = {\n sm: \"max-w-md\",\n md: \"max-w-lg\",\n lg: \"max-w-2xl\",\n xl: \"max-w-4xl\",\n full: \"max-w-full\",\n};\n\n/**\n * Modal Component\n *\n * Accessible modal dialog with stacking support.\n */\nexport function Modal({\n open = false,\n onClose,\n title,\n description,\n children,\n size = \"md\",\n showClose = true,\n className,\n dismissable = true,\n}: ModalProps) {\n return (\n <Dialog.Root open={open} onOpenChange={(open) => !open && onClose?.()}>\n <Dialog.Portal>\n <Dialog.Overlay className=\"fixed inset-0 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\" />\n <Dialog.Content\n className={clsx(\n \"fixed left-[50%] top-[50%] z-50 w-full translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out\",\n \"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n \"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95\",\n \"data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]\",\n \"data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]\",\n \"sm:rounded-lg\",\n sizeClasses[size],\n className\n )}\n onEscapeKeyDown={(e) => {\n if (!dismissable) {\n e.preventDefault();\n }\n }}\n onPointerDownOutside={(e) => {\n if (!dismissable) {\n e.preventDefault();\n }\n }}\n >\n {(title || description) && (\n <div className=\"space-y-2\">\n {title && (\n <Dialog.Title className=\"text-lg font-semibold leading-none tracking-tight\">\n {title}\n </Dialog.Title>\n )}\n {description && (\n <Dialog.Description className=\"text-sm text-muted-foreground\">\n {description}\n </Dialog.Description>\n )}\n </div>\n )}\n\n <div className=\"mt-4\">{children}</div>\n\n {showClose && (\n <Dialog.Close className=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"h-4 w-4\"\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n <span className=\"sr-only\">Close</span>\n </Dialog.Close>\n )}\n </Dialog.Content>\n </Dialog.Portal>\n </Dialog.Root>\n );\n}\n","/**\n * Confirm Modal Component\n *\n * Confirmation dialog with confirm/cancel actions.\n */\n\nimport * as React from \"react\";\nimport { Modal } from \"./modal.js\";\nimport type { ConfirmModalProps } from \"../types/index.js\";\n\n/**\n * Confirm Modal\n *\n * Modal for confirming user actions.\n */\nexport function ConfirmModal({\n title,\n message,\n confirmText = \"Confirm\",\n cancelText = \"Cancel\",\n onConfirm,\n onCancel,\n variant = \"default\",\n}: ConfirmModalProps & { open?: boolean; onClose?: () => void }) {\n const [isLoading, setIsLoading] = React.useState(false);\n const [isOpen, setIsOpen] = React.useState(true);\n\n const handleConfirm = async () => {\n setIsLoading(true);\n try {\n await onConfirm();\n setIsOpen(false);\n } finally {\n setIsLoading(false);\n }\n };\n\n const handleCancel = () => {\n onCancel?.();\n setIsOpen(false);\n };\n\n return (\n <Modal\n open={isOpen}\n onClose={handleCancel}\n title={title}\n size=\"sm\"\n dismissable={!isLoading}\n >\n <div className=\"space-y-4\">\n <p className=\"text-sm text-muted-foreground\">{message}</p>\n\n <div className=\"flex justify-end space-x-2\">\n <button\n type=\"button\"\n onClick={handleCancel}\n disabled={isLoading}\n className=\"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2\"\n >\n {cancelText}\n </button>\n <button\n type=\"button\"\n onClick={handleConfirm}\n disabled={isLoading}\n className={`inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 h-10 px-4 py-2 ${\n variant === \"destructive\"\n ? \"bg-destructive text-destructive-foreground hover:bg-destructive/90\"\n : \"bg-primary text-primary-foreground hover:bg-primary/90\"\n }`}\n >\n {isLoading ? \"Loading...\" : confirmText}\n </button>\n </div>\n </div>\n </Modal>\n );\n}\n","/**\n * Drawer Component\n *\n * Side panel that slides in from left, right, top, or bottom.\n * Built on Radix UI Dialog for accessibility.\n */\n\nimport * as React from \"react\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport { clsx } from \"clsx\";\n\nexport interface DrawerProps {\n /**\n * Whether the drawer is open\n */\n open?: boolean;\n\n /**\n * Callback when drawer should close\n */\n onClose?: () => void;\n\n /**\n * Drawer title\n */\n title?: string;\n\n /**\n * Drawer description (for accessibility)\n */\n description?: string;\n\n /**\n * Drawer content\n */\n children: React.ReactNode;\n\n /**\n * Side to slide from\n */\n side?: \"left\" | \"right\" | \"top\" | \"bottom\";\n\n /**\n * Drawer size\n */\n size?: \"sm\" | \"md\" | \"lg\" | \"xl\" | \"full\";\n\n /**\n * Show close button\n */\n showClose?: boolean;\n\n /**\n * Allow dismissing by clicking outside or pressing Escape\n */\n dismissable?: boolean;\n\n /**\n * Custom className\n */\n className?: string;\n\n /**\n * Header content (overrides title)\n */\n header?: React.ReactNode;\n\n /**\n * Footer content\n */\n footer?: React.ReactNode;\n}\n\nconst sizeClasses = {\n sm: \"max-w-sm\",\n md: \"max-w-md\",\n lg: \"max-w-lg\",\n xl: \"max-w-xl\",\n full: \"max-w-full\",\n};\n\nconst sideClasses = {\n left: \"left-0 top-0 h-full animate-slide-in-from-left\",\n right: \"right-0 top-0 h-full animate-slide-in-from-right\",\n top: \"top-0 left-0 w-full animate-slide-in-from-top\",\n bottom: \"bottom-0 left-0 w-full animate-slide-in-from-bottom\",\n};\n\nexport function Drawer({\n open = false,\n onClose,\n title,\n description,\n children,\n side = \"right\",\n size = \"md\",\n showClose = true,\n dismissable = true,\n className,\n header,\n footer,\n}: DrawerProps) {\n return (\n <Dialog.Root open={open} onOpenChange={(open) => !open && onClose?.()}>\n <Dialog.Portal>\n {/* Overlay */}\n <Dialog.Overlay className=\"fixed inset-0 bg-black/50 backdrop-blur-sm z-50 animate-fade-in\" />\n\n {/* Drawer Content */}\n <Dialog.Content\n className={clsx(\n \"fixed z-50 bg-white dark:bg-gray-900 shadow-xl\",\n \"flex flex-col\",\n sideClasses[side],\n (side === \"left\" || side === \"right\") && sizeClasses[size],\n (side === \"top\" || side === \"bottom\") && \"h-auto\",\n className\n )}\n onEscapeKeyDown={(e) => !dismissable && e.preventDefault()}\n onPointerDownOutside={(e) => !dismissable && e.preventDefault()}\n >\n {/* Header */}\n {(header || title || description) && (\n <div className=\"flex-shrink-0 border-b border-gray-200 dark:border-gray-800 p-6\">\n {header ? (\n header\n ) : (\n <>\n <div className=\"flex items-start justify-between\">\n {title && (\n <Dialog.Title className=\"text-lg font-semibold text-gray-900 dark:text-gray-100\">\n {title}\n </Dialog.Title>\n )}\n {showClose && (\n <Dialog.Close\n className=\"rounded-md p-1 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors\"\n aria-label=\"Close\"\n >\n <svg\n className=\"h-5 w-5 text-gray-500\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M6 18L18 6M6 6l12 12\"\n />\n </svg>\n </Dialog.Close>\n )}\n </div>\n {description && (\n <Dialog.Description className=\"mt-2 text-sm text-gray-600 dark:text-gray-400\">\n {description}\n </Dialog.Description>\n )}\n </>\n )}\n </div>\n )}\n\n {/* Body */}\n <div className=\"flex-1 overflow-y-auto p-6\">{children}</div>\n\n {/* Footer */}\n {footer && (\n <div className=\"flex-shrink-0 border-t border-gray-200 dark:border-gray-800 p-6\">\n {footer}\n </div>\n )}\n </Dialog.Content>\n </Dialog.Portal>\n </Dialog.Root>\n );\n}\n","/**\n * Modal Context\n *\n * Context for managing multiple modals with stacking support.\n */\n\nimport * as React from \"react\";\nimport type { ModalContextValue, ModalProps } from \"../types/index.js\";\nimport { Modal } from \"../components/modal.js\";\n\nconst ModalContext = React.createContext<ModalContextValue | undefined>(\n undefined\n);\n\ninterface ModalState {\n id: string;\n props: Omit<ModalProps, \"open\" | \"onClose\">;\n}\n\nexport interface ModalProviderProps {\n children: React.ReactNode;\n}\n\n/**\n * Modal Provider\n *\n * Provides modal management functionality to the app.\n */\nexport function ModalProvider({ children }: ModalProviderProps) {\n const [modals, setModals] = React.useState<ModalState[]>([]);\n\n const openModal = React.useCallback(\n (id: string, props: Omit<ModalProps, \"open\" | \"onClose\">) => {\n setModals((prev) => {\n // If modal already exists, update it\n const existing = prev.find((m) => m.id === id);\n if (existing) {\n return prev.map((m) => (m.id === id ? { id, props } : m));\n }\n // Otherwise add new modal\n return [...prev, { id, props }];\n });\n },\n []\n );\n\n const closeModal = React.useCallback((id: string) => {\n setModals((prev) => prev.filter((m) => m.id !== id));\n }, []);\n\n const closeAllModals = React.useCallback(() => {\n setModals([]);\n }, []);\n\n const isModalOpen = React.useCallback(\n (id: string) => {\n return modals.some((m) => m.id === id);\n },\n [modals]\n );\n\n const value: ModalContextValue = {\n openModal,\n closeModal,\n closeAllModals,\n isModalOpen,\n openModals: modals.map((m) => m.id),\n };\n\n return (\n <ModalContext.Provider value={value}>\n {children}\n {modals.map((modal) => (\n <Modal\n key={modal.id}\n open={true}\n onClose={() => closeModal(modal.id)}\n {...modal.props}\n />\n ))}\n </ModalContext.Provider>\n );\n}\n\n/**\n * Use Modal Context\n *\n * Access modal management functions.\n */\nexport function useModalContext(): ModalContextValue {\n const context = React.useContext(ModalContext);\n\n if (!context) {\n throw new Error(\"useModalContext must be used within ModalProvider\");\n }\n\n return context;\n}\n","/**\n * useModal Hook\n *\n * Hook for programmatic modal control.\n */\n\nimport { useModalContext } from \"../context/modal-context.js\";\nimport type { ModalProps } from \"../types/index.js\";\n\n/**\n * Use Modal\n *\n * Get modal control functions for a specific modal ID.\n */\nexport function useModal(id: string) {\n const { openModal, closeModal, isModalOpen } = useModalContext();\n\n return {\n /**\n * Open this modal\n */\n open: (props: Omit<ModalProps, \"open\" | \"onClose\">) =>\n openModal(id, props),\n\n /**\n * Close this modal\n */\n close: () => closeModal(id),\n\n /**\n * Check if this modal is open\n */\n isOpen: isModalOpen(id),\n };\n}\n","/**\n * Global Modal Utilities Hook\n *\n * Provides convenient methods for common modal patterns:\n * - confirm(): Confirmation dialogs\n * - alert(): Alert dialogs\n * - prompt(): Input dialogs\n */\n\nimport * as React from \"react\";\nimport { useModalContext } from \"../context/index.js\";\nimport type { ModalProps } from \"../types/index.js\";\n\nexport interface ConfirmOptions {\n title: string;\n message: string;\n confirmText?: string;\n cancelText?: string;\n variant?: \"default\" | \"destructive\";\n}\n\nexport interface AlertOptions {\n title: string;\n message: string;\n okText?: string;\n}\n\nexport interface PromptOptions {\n title: string;\n message?: string;\n placeholder?: string;\n defaultValue?: string;\n confirmText?: string;\n cancelText?: string;\n validate?: (value: string) => boolean | string;\n}\n\n/**\n * Hook providing global modal utilities\n */\nexport function useModals() {\n const context = useModalContext();\n\n /**\n * Show confirmation dialog\n * @returns Promise that resolves to true if confirmed, false if cancelled\n */\n const confirm = React.useCallback(\n (options: ConfirmOptions): Promise<boolean> => {\n return new Promise((resolve) => {\n const modalId = `confirm-${Date.now()}`;\n\n const handleConfirm = () => {\n context.closeModal(modalId);\n resolve(true);\n };\n\n const handleCancel = () => {\n context.closeModal(modalId);\n resolve(false);\n };\n\n context.openModal(modalId, {\n title: options.title,\n size: \"sm\",\n dismissable: true,\n showClose: false,\n children: (\n <div className=\"space-y-4\">\n <p className=\"text-sm text-gray-600 dark:text-gray-400\">\n {options.message}\n </p>\n <div className=\"flex justify-end gap-2\">\n <button\n onClick={handleCancel}\n className=\"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 dark:hover:bg-gray-700\"\n >\n {options.cancelText || \"Cancel\"}\n </button>\n <button\n onClick={handleConfirm}\n className={`px-4 py-2 text-sm font-medium text-white rounded-md ${\n options.variant === \"destructive\"\n ? \"bg-red-600 hover:bg-red-700\"\n : \"bg-blue-600 hover:bg-blue-700\"\n }`}\n >\n {options.confirmText || \"Confirm\"}\n </button>\n </div>\n </div>\n ),\n });\n });\n },\n [context]\n );\n\n /**\n * Show alert dialog\n * @returns Promise that resolves when dismissed\n */\n const alert = React.useCallback(\n (options: AlertOptions): Promise<void> => {\n return new Promise((resolve) => {\n const modalId = `alert-${Date.now()}`;\n\n const handleOk = () => {\n context.closeModal(modalId);\n resolve();\n };\n\n context.openModal(modalId, {\n title: options.title,\n size: \"sm\",\n dismissable: true,\n showClose: false,\n children: (\n <div className=\"space-y-4\">\n <p className=\"text-sm text-gray-600 dark:text-gray-400\">\n {options.message}\n </p>\n <div className=\"flex justify-end\">\n <button\n onClick={handleOk}\n className=\"px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-md hover:bg-blue-700\"\n >\n {options.okText || \"OK\"}\n </button>\n </div>\n </div>\n ),\n });\n });\n },\n [context]\n );\n\n /**\n * Show prompt dialog\n * @returns Promise that resolves to the input value if confirmed, null if cancelled\n */\n const prompt = React.useCallback(\n (options: PromptOptions): Promise<string | null> => {\n return new Promise((resolve) => {\n const modalId = `prompt-${Date.now()}`;\n let inputValue = options.defaultValue || \"\";\n let errorMessage = \"\";\n\n const PromptContent = () => {\n const [value, setValue] = React.useState(inputValue);\n const [error, setError] = React.useState(\"\");\n\n const handleConfirm = () => {\n if (options.validate) {\n const validation = options.validate(value);\n if (validation === false || typeof validation === \"string\") {\n setError(typeof validation === \"string\" ? validation : \"Invalid input\");\n return;\n }\n }\n context.closeModal(modalId);\n resolve(value);\n };\n\n const handleCancel = () => {\n context.closeModal(modalId);\n resolve(null);\n };\n\n return (\n <div className=\"space-y-4\">\n {options.message && (\n <p className=\"text-sm text-gray-600 dark:text-gray-400\">\n {options.message}\n </p>\n )}\n <div>\n <input\n type=\"text\"\n value={value}\n onChange={(e) => {\n setValue(e.target.value);\n setError(\"\");\n }}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") handleConfirm();\n if (e.key === \"Escape\") handleCancel();\n }}\n placeholder={options.placeholder}\n autoFocus\n className=\"w-full px-3 py-2 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-800 dark:border-gray-600 dark:text-white\"\n />\n {error && (\n <p className=\"mt-1 text-xs text-red-600 dark:text-red-400\">\n {error}\n </p>\n )}\n </div>\n <div className=\"flex justify-end gap-2\">\n <button\n onClick={handleCancel}\n className=\"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 dark:hover:bg-gray-700\"\n >\n {options.cancelText || \"Cancel\"}\n </button>\n <button\n onClick={handleConfirm}\n className=\"px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-md hover:bg-blue-700\"\n >\n {options.confirmText || \"OK\"}\n </button>\n </div>\n </div>\n );\n };\n\n context.openModal(modalId, {\n title: options.title,\n size: \"sm\",\n dismissable: true,\n showClose: false,\n children: <PromptContent />,\n });\n });\n },\n [context]\n );\n\n return {\n confirm,\n alert,\n prompt,\n ...context,\n };\n}\n"],"mappings":";AAOA,YAAY,YAAY;AACxB,SAAS,YAAY;AA8Bb,cAyBI,YAzBJ;AA3BR,IAAM,cAAc;AAAA,EAClB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,MAAM;AACR;AAOO,SAAS,MAAM;AAAA,EACpB,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,YAAY;AAAA,EACZ;AAAA,EACA,cAAc;AAChB,GAAe;AACb,SACE,oBAAQ,aAAP,EAAY,MA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,eAAc;AACrC,wBAAI,EAAE,QAAQ,SAAU,cAAa;AAAA,kBACvC;AAAA,kBACA,aAAa,QAAQ;AAAA,kBACrB,WAAS;AAAA,kBACT,WAAU;AAAA;AAAA,cACZ;AAAA,cACC,SACC,gBAAAA,KAAC,OAAE,WAAU,+CACV,iBACH;AAAA,eAEJ;AAAA,YACA,gBAAAC,MAAC,SAAI,WAAU,0BACb;AAAA,8BAAAD;AAAA,gBAAC;AAAA;AAAA,kBACC,SAAS;AAAA,kBACT,WAAU;AAAA,kBAET,kBAAQ,cAAc;AAAA;AAAA,cACzB;AAAA,cACA,gBAAAA;AAAA,gBAAC;AAAA;AAAA,kBACC,SAAS;AAAA,kBACT,WAAU;AAAA,kBAET,kBAAQ,eAAe;AAAA;AAAA,cAC1B;AAAA,eACF;AAAA,aACF;AAAA,QAEJ;AAEA,gBAAQ,UAAU,SAAS;AAAA,UACzB,OAAO,QAAQ;AAAA,UACf,MAAM;AAAA,UACN,aAAa;AAAA,UACb,WAAW;AAAA,UACX,UAAU,gBAAAA,KAAC,iBAAc;AAAA,QAC3B,CAAC;AAAA,MACH,CAAC;AAAA,IACH;AAAA,IACA,CAAC,OAAO;AAAA,EACV;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL;AACF;","names":["open","jsx","jsxs","Dialog","clsx","jsx","jsxs","sizeClasses","open","React","jsx","jsxs","React","jsx","jsxs"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/modal.tsx","../src/components/confirm-modal.tsx","../src/components/drawer.tsx","../src/context/modal-context.tsx","../src/hooks/use-modal.ts","../src/hooks/use-modals.tsx"],"sourcesContent":["/**\n * Modal Component\n *\n * Modal dialog with Radix UI.\n */\n\nimport * as React from \"react\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport { clsx } from \"clsx\";\nimport type { ModalProps } from \"../types/index.js\";\n\nconst sizeClasses = {\n sm: \"max-w-md\",\n md: \"max-w-lg\",\n lg: \"max-w-2xl\",\n xl: \"max-w-4xl\",\n full: \"max-w-full\",\n};\n\n/**\n * Modal Component\n *\n * Accessible modal dialog with stacking support.\n */\nexport function Modal({\n open = false,\n onClose,\n title,\n description,\n children,\n size = \"md\",\n showClose = true,\n className,\n dismissable = true,\n}: ModalProps) {\n return (\n <Dialog.Root open={open} onOpenChange={(open) => !open && onClose?.()}>\n <Dialog.Portal>\n <Dialog.Overlay className=\"fixed inset-0 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\" />\n <Dialog.Content\n className={clsx(\n \"fixed left-[50%] top-[50%] z-50 w-full translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out\",\n \"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n \"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95\",\n \"data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]\",\n \"data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]\",\n \"sm:rounded-lg\",\n sizeClasses[size],\n className\n )}\n onEscapeKeyDown={(e) => {\n if (!dismissable) {\n e.preventDefault();\n }\n }}\n onPointerDownOutside={(e) => {\n if (!dismissable) {\n e.preventDefault();\n }\n }}\n >\n {(title || description) && (\n <div className=\"space-y-2\">\n {title && (\n <Dialog.Title className=\"text-lg font-semibold leading-none tracking-tight\">\n {title}\n </Dialog.Title>\n )}\n {description && (\n <Dialog.Description className=\"text-sm text-muted-foreground\">\n {description}\n </Dialog.Description>\n )}\n </div>\n )}\n\n <div className=\"mt-4\">{children}</div>\n\n {showClose && (\n <Dialog.Close className=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"h-4 w-4\"\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n <span className=\"sr-only\">Close</span>\n </Dialog.Close>\n )}\n </Dialog.Content>\n </Dialog.Portal>\n </Dialog.Root>\n );\n}\n","/**\n * Confirm Modal Component\n *\n * Confirmation dialog with confirm/cancel actions.\n */\n\nimport * as React from \"react\";\nimport { Modal } from \"./modal.js\";\nimport type { ConfirmModalProps } from \"../types/index.js\";\n\n/**\n * Confirm Modal\n *\n * Modal for confirming user actions.\n */\nexport function ConfirmModal({\n title,\n message,\n confirmText = \"Confirm\",\n cancelText = \"Cancel\",\n onConfirm,\n onCancel,\n variant = \"default\",\n}: ConfirmModalProps & { open?: boolean; onClose?: () => void }) {\n const [isLoading, setIsLoading] = React.useState(false);\n const [isOpen, setIsOpen] = React.useState(true);\n\n const handleConfirm = async () => {\n setIsLoading(true);\n try {\n await onConfirm();\n setIsOpen(false);\n } finally {\n setIsLoading(false);\n }\n };\n\n const handleCancel = () => {\n onCancel?.();\n setIsOpen(false);\n };\n\n return (\n <Modal\n open={isOpen}\n onClose={handleCancel}\n title={title}\n size=\"sm\"\n dismissable={!isLoading}\n >\n <div className=\"space-y-4\">\n <p className=\"text-sm text-muted-foreground\">{message}</p>\n\n <div className=\"flex justify-end space-x-2\">\n <button\n type=\"button\"\n onClick={handleCancel}\n disabled={isLoading}\n className=\"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2\"\n >\n {cancelText}\n </button>\n <button\n type=\"button\"\n onClick={handleConfirm}\n disabled={isLoading}\n className={`inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 h-10 px-4 py-2 ${\n variant === \"destructive\"\n ? \"bg-destructive text-destructive-foreground hover:bg-destructive/90\"\n : \"bg-primary text-primary-foreground hover:bg-primary/90\"\n }`}\n >\n {isLoading ? \"Loading...\" : confirmText}\n </button>\n </div>\n </div>\n </Modal>\n );\n}\n","/**\n * Drawer Component\n *\n * Side panel that slides in from left, right, top, or bottom.\n * Built on Radix UI Dialog for accessibility.\n */\n\nimport * as React from \"react\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport { clsx } from \"clsx\";\n\nexport interface DrawerProps {\n /**\n * Whether the drawer is open\n */\n open?: boolean;\n\n /**\n * Callback when drawer should close\n */\n onClose?: () => void;\n\n /**\n * Drawer title\n */\n title?: string;\n\n /**\n * Drawer description (for accessibility)\n */\n description?: string;\n\n /**\n * Drawer content\n */\n children: React.ReactNode;\n\n /**\n * Side to slide from\n */\n side?: \"left\" | \"right\" | \"top\" | \"bottom\";\n\n /**\n * Drawer size\n */\n size?: \"sm\" | \"md\" | \"lg\" | \"xl\" | \"full\";\n\n /**\n * Show close button\n */\n showClose?: boolean;\n\n /**\n * Allow dismissing by clicking outside or pressing Escape\n */\n dismissable?: boolean;\n\n /**\n * Custom className\n */\n className?: string;\n\n /**\n * Header content (overrides title)\n */\n header?: React.ReactNode;\n\n /**\n * Footer content\n */\n footer?: React.ReactNode;\n}\n\nconst sizeClasses = {\n sm: \"max-w-sm\",\n md: \"max-w-md\",\n lg: \"max-w-lg\",\n xl: \"max-w-xl\",\n full: \"max-w-full\",\n};\n\nconst sideClasses = {\n left: \"left-0 top-0 h-full animate-slide-in-from-left\",\n right: \"right-0 top-0 h-full animate-slide-in-from-right\",\n top: \"top-0 left-0 w-full animate-slide-in-from-top\",\n bottom: \"bottom-0 left-0 w-full animate-slide-in-from-bottom\",\n};\n\nexport function Drawer({\n open = false,\n onClose,\n title,\n description,\n children,\n side = \"right\",\n size = \"md\",\n showClose = true,\n dismissable = true,\n className,\n header,\n footer,\n}: DrawerProps) {\n return (\n <Dialog.Root open={open} onOpenChange={(open) => !open && onClose?.()}>\n <Dialog.Portal>\n {/* Overlay */}\n <Dialog.Overlay className=\"fixed inset-0 bg-black/50 backdrop-blur-sm z-50 animate-fade-in\" />\n\n {/* Drawer Content */}\n <Dialog.Content\n className={clsx(\n \"fixed z-50 bg-white dark:bg-gray-900 shadow-xl\",\n \"flex flex-col\",\n sideClasses[side],\n (side === \"left\" || side === \"right\") && sizeClasses[size],\n (side === \"top\" || side === \"bottom\") && \"h-auto\",\n className\n )}\n onEscapeKeyDown={(e) => !dismissable && e.preventDefault()}\n onPointerDownOutside={(e) => !dismissable && e.preventDefault()}\n >\n {/* Header */}\n {(header || title || description) && (\n <div className=\"flex-shrink-0 border-b border-gray-200 dark:border-gray-800 p-6\">\n {header ? (\n header\n ) : (\n <>\n <div className=\"flex items-start justify-between\">\n {title && (\n <Dialog.Title className=\"text-lg font-semibold text-gray-900 dark:text-gray-100\">\n {title}\n </Dialog.Title>\n )}\n {showClose && (\n <Dialog.Close\n className=\"rounded-md p-1 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors\"\n aria-label=\"Close\"\n >\n <svg\n className=\"h-5 w-5 text-gray-500\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M6 18L18 6M6 6l12 12\"\n />\n </svg>\n </Dialog.Close>\n )}\n </div>\n {description && (\n <Dialog.Description className=\"mt-2 text-sm text-gray-600 dark:text-gray-400\">\n {description}\n </Dialog.Description>\n )}\n </>\n )}\n </div>\n )}\n\n {/* Body */}\n <div className=\"flex-1 overflow-y-auto p-6\">{children}</div>\n\n {/* Footer */}\n {footer && (\n <div className=\"flex-shrink-0 border-t border-gray-200 dark:border-gray-800 p-6\">\n {footer}\n </div>\n )}\n </Dialog.Content>\n </Dialog.Portal>\n </Dialog.Root>\n );\n}\n","/**\n * Modal Context\n *\n * Context for managing multiple modals with stacking support.\n */\n\nimport * as React from \"react\";\nimport type { ModalContextValue, ModalProps } from \"../types/index.js\";\nimport { Modal } from \"../components/modal.js\";\n\nconst ModalContext = React.createContext<ModalContextValue | undefined>(\n undefined\n);\n\ninterface ModalState {\n id: string;\n props: Omit<ModalProps, \"open\" | \"onClose\">;\n}\n\nexport interface ModalProviderProps {\n children: React.ReactNode;\n}\n\n/**\n * Modal Provider\n *\n * Provides modal management functionality to the app.\n */\nexport function ModalProvider({ children }: ModalProviderProps) {\n const [modals, setModals] = React.useState<ModalState[]>([]);\n\n const openModal = React.useCallback(\n (id: string, props: Omit<ModalProps, \"open\" | \"onClose\">) => {\n setModals((prev) => {\n // If modal already exists, update it\n const existing = prev.find((m) => m.id === id);\n if (existing) {\n return prev.map((m) => (m.id === id ? { id, props } : m));\n }\n // Otherwise add new modal\n return [...prev, { id, props }];\n });\n },\n []\n );\n\n const closeModal = React.useCallback((id: string) => {\n setModals((prev) => prev.filter((m) => m.id !== id));\n }, []);\n\n const closeAllModals = React.useCallback(() => {\n setModals([]);\n }, []);\n\n const isModalOpen = React.useCallback(\n (id: string) => {\n return modals.some((m) => m.id === id);\n },\n [modals]\n );\n\n const value: ModalContextValue = {\n openModal,\n closeModal,\n closeAllModals,\n isModalOpen,\n openModals: modals.map((m) => m.id),\n };\n\n return (\n <ModalContext.Provider value={value}>\n {children}\n {modals.map((modal) => (\n <Modal\n key={modal.id}\n open={true}\n onClose={() => closeModal(modal.id)}\n {...modal.props}\n />\n ))}\n </ModalContext.Provider>\n );\n}\n\n/**\n * Use Modal Context\n *\n * Access modal management functions.\n */\nexport function useModalContext(): ModalContextValue {\n const context = React.useContext(ModalContext);\n\n if (!context) {\n throw new Error(\"useModalContext must be used within ModalProvider\");\n }\n\n return context;\n}\n","/**\n * useModal Hook\n *\n * Hook for programmatic modal control.\n */\n\nimport { useModalContext } from \"../context/modal-context.js\";\nimport type { ModalProps } from \"../types/index.js\";\n\n/**\n * Use Modal\n *\n * Get modal control functions for a specific modal ID.\n */\nexport function useModal(id: string) {\n const { openModal, closeModal, isModalOpen } = useModalContext();\n\n return {\n /**\n * Open this modal\n */\n open: (props: Omit<ModalProps, \"open\" | \"onClose\">) =>\n openModal(id, props),\n\n /**\n * Close this modal\n */\n close: () => closeModal(id),\n\n /**\n * Check if this modal is open\n */\n isOpen: isModalOpen(id),\n };\n}\n","/**\n * Global Modal Utilities Hook\n *\n * Provides convenient methods for common modal patterns:\n * - confirm(): Confirmation dialogs\n * - alert(): Alert dialogs\n * - prompt(): Input dialogs\n */\n\nimport * as React from \"react\";\nimport { useModalContext } from \"../context/index.js\";\nimport type { ModalProps } from \"../types/index.js\";\n\nexport interface ConfirmOptions {\n title: string;\n message: string;\n confirmText?: string;\n cancelText?: string;\n variant?: \"default\" | \"destructive\";\n}\n\nexport interface AlertOptions {\n title: string;\n message: string;\n okText?: string;\n}\n\nexport interface PromptOptions {\n title: string;\n message?: string;\n placeholder?: string;\n defaultValue?: string;\n confirmText?: string;\n cancelText?: string;\n validate?: (value: string) => boolean | string;\n}\n\n/**\n * Hook providing global modal utilities\n */\nexport function useModals() {\n const context = useModalContext();\n\n /**\n * Show confirmation dialog\n * @returns Promise that resolves to true if confirmed, false if cancelled\n */\n const confirm = React.useCallback(\n (options: ConfirmOptions): Promise<boolean> => {\n return new Promise((resolve) => {\n const modalId = `confirm-${Date.now()}`;\n let resolved = false;\n\n const handleConfirm = () => {\n if (resolved) return;\n resolved = true;\n context.closeModal(modalId);\n resolve(true);\n };\n\n const handleCancel = () => {\n if (resolved) return;\n resolved = true;\n context.closeModal(modalId);\n resolve(false);\n };\n\n const handleDismiss = () => {\n if (resolved) return;\n resolved = true;\n resolve(false);\n };\n\n context.openModal(modalId, {\n title: options.title,\n size: \"sm\",\n dismissable: true,\n showClose: false,\n onClose: handleDismiss,\n children: (\n <div className=\"space-y-4\">\n <p className=\"text-sm text-gray-600 dark:text-gray-400\">\n {options.message}\n </p>\n <div className=\"flex justify-end gap-2\">\n <button\n onClick={handleCancel}\n className=\"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 dark:hover:bg-gray-700\"\n >\n {options.cancelText || \"Cancel\"}\n </button>\n <button\n onClick={handleConfirm}\n className={`px-4 py-2 text-sm font-medium text-white rounded-md ${\n options.variant === \"destructive\"\n ? \"bg-red-600 hover:bg-red-700\"\n : \"bg-blue-600 hover:bg-blue-700\"\n }`}\n >\n {options.confirmText || \"Confirm\"}\n </button>\n </div>\n </div>\n ),\n });\n });\n },\n [context]\n );\n\n /**\n * Show alert dialog\n * @returns Promise that resolves when dismissed\n */\n const alert = React.useCallback(\n (options: AlertOptions): Promise<void> => {\n return new Promise((resolve) => {\n const modalId = `alert-${Date.now()}`;\n let resolved = false;\n\n const handleOk = () => {\n if (resolved) return;\n resolved = true;\n context.closeModal(modalId);\n resolve();\n };\n\n const handleDismiss = () => {\n if (resolved) return;\n resolved = true;\n resolve();\n };\n\n context.openModal(modalId, {\n title: options.title,\n size: \"sm\",\n dismissable: true,\n showClose: false,\n onClose: handleDismiss,\n children: (\n <div className=\"space-y-4\">\n <p className=\"text-sm text-gray-600 dark:text-gray-400\">\n {options.message}\n </p>\n <div className=\"flex justify-end\">\n <button\n onClick={handleOk}\n className=\"px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-md hover:bg-blue-700\"\n >\n {options.okText || \"OK\"}\n </button>\n </div>\n </div>\n ),\n });\n });\n },\n [context]\n );\n\n /**\n * Show prompt dialog\n * @returns Promise that resolves to the input value if confirmed, null if cancelled\n */\n const prompt = React.useCallback(\n (options: PromptOptions): Promise<string | null> => {\n return new Promise((resolve) => {\n const modalId = `prompt-${Date.now()}`;\n let inputValue = options.defaultValue || \"\";\n let errorMessage = \"\";\n let resolved = false;\n\n const handleDismiss = () => {\n if (resolved) return;\n resolved = true;\n resolve(null);\n };\n\n const PromptContent = () => {\n const [value, setValue] = React.useState(inputValue);\n const [error, setError] = React.useState(\"\");\n\n const handleConfirm = () => {\n if (options.validate) {\n const validation = options.validate(value);\n if (validation === false || typeof validation === \"string\") {\n setError(typeof validation === \"string\" ? validation : \"Invalid input\");\n return;\n }\n }\n if (resolved) return;\n resolved = true;\n context.closeModal(modalId);\n resolve(value);\n };\n\n const handleCancel = () => {\n if (resolved) return;\n resolved = true;\n context.closeModal(modalId);\n resolve(null);\n };\n\n return (\n <div className=\"space-y-4\">\n {options.message && (\n <p className=\"text-sm text-gray-600 dark:text-gray-400\">\n {options.message}\n </p>\n )}\n <div>\n <input\n type=\"text\"\n value={value}\n onChange={(e) => {\n setValue(e.target.value);\n setError(\"\");\n }}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") handleConfirm();\n if (e.key === \"Escape\") handleCancel();\n }}\n placeholder={options.placeholder}\n autoFocus\n className=\"w-full px-3 py-2 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-800 dark:border-gray-600 dark:text-white\"\n />\n {error && (\n <p className=\"mt-1 text-xs text-red-600 dark:text-red-400\">\n {error}\n </p>\n )}\n </div>\n <div className=\"flex justify-end gap-2\">\n <button\n onClick={handleCancel}\n className=\"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 dark:hover:bg-gray-700\"\n >\n {options.cancelText || \"Cancel\"}\n </button>\n <button\n onClick={handleConfirm}\n className=\"px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-md hover:bg-blue-700\"\n >\n {options.confirmText || \"OK\"}\n </button>\n </div>\n </div>\n );\n };\n\n context.openModal(modalId, {\n title: options.title,\n size: \"sm\",\n dismissable: true,\n showClose: false,\n onClose: handleDismiss,\n children: <PromptContent />,\n });\n });\n },\n [context]\n );\n\n return {\n confirm,\n alert,\n prompt,\n ...context,\n };\n}\n"],"mappings":";AAOA,YAAY,YAAY;AACxB,SAAS,YAAY;AA8Bb,cAyBI,YAzBJ;AA3BR,IAAM,cAAc;AAAA,EAClB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,MAAM;AACR;AAOO,SAAS,MAAM;AAAA,EACpB,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,YAAY;AAAA,EACZ;AAAA,EACA,cAAc;AAChB,GAAe;AACb,SACE,oBAAQ,aAAP,EAAY,MAAY,cAAc,CAACA,UAAS,CAACA,SAAQ,UAAU,GAClE,+BAAQ,eAAP,EACC;AAAA,wBAAQ,gBAAP,EAAe,WAAU,qJAAoJ;AAAA,IAC9K;AAAA,MAAQ;AAAA,MAAP;AAAA,QACC,WAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,YAAY,IAAI;AAAA,UAChB;AAAA,QACF;AAAA,QACA,iBAAiB,CAAC,MAAM;AACtB,cAAI,CAAC,aAAa;AAChB,cAAE,eAAe;AAAA,UACnB;AAAA,QACF;AAAA,QACA,sBAAsB,CAAC,MAAM;AAC3B,cAAI,CAAC,aAAa;AAChB,cAAE,eAAe;AAAA,UACnB;AAAA,QACF;AAAA,QAEE;AAAA,oBAAS,gBACT,qBAAC,SAAI,WAAU,aACZ;AAAA,qBACC,oBAAQ,cAAP,EAAa,WAAU,qDACrB,iBACH;AAAA,YAED,eACC,oBAAQ,oBAAP,EAAmB,WAAU,iCAC3B,uBACH;AAAA,aAEJ;AAAA,UAGF,oBAAC,SAAI,WAAU,Q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