@scripso-homepad/ui 0.4.7 → 0.4.9
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/README.md +1 -1
- package/dist/{chunk-7KLVMNDM.js → chunk-YSDLHEJ7.js} +218 -28
- package/dist/chunk-YSDLHEJ7.js.map +1 -0
- package/dist/index.cjs +24 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -29
- package/dist/index.d.ts +29 -29
- package/dist/index.js +63 -249
- package/dist/index.js.map +1 -1
- package/dist/web/index.cjs +482 -21
- package/dist/web/index.cjs.map +1 -1
- package/dist/web/index.d.cts +43 -3
- package/dist/web/index.d.ts +43 -3
- package/dist/web/index.js +249 -6
- package/dist/web/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Button.tsx +10 -3
- package/src/components/Select.tsx +1 -1
- package/src/icons/ArrowUpRightIcon.tsx +1 -1
- package/src/icons/ArrowUpRightIcon.web.tsx +1 -1
- package/src/theme/input.ts +2 -2
- package/src/theme/select.ts +2 -2
- package/src/theme/tokens.ts +12 -12
- package/src/web/components/ConfirmModal.stories.tsx +55 -0
- package/src/web/components/ConfirmModal.tsx +116 -0
- package/src/web/components/Modal.stories.tsx +130 -0
- package/src/web/components/Modal.tsx +162 -0
- package/src/web/components/TableActionButton.tsx +6 -1
- package/src/web/components/TableActionsMenu.tsx +2 -2
- package/src/web/icons/TableMenuInfoIcon.tsx +2 -2
- package/src/web/index.ts +6 -0
- package/dist/chunk-7KLVMNDM.js.map +0 -1
package/dist/web/index.d.cts
CHANGED
|
@@ -390,7 +390,7 @@ type TableActionButtonProps = {
|
|
|
390
390
|
ariaLabel?: string;
|
|
391
391
|
className?: string;
|
|
392
392
|
disabled?: boolean;
|
|
393
|
-
} & Pick<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'aria-expanded' | 'aria-haspopup' | 'aria-controls'>;
|
|
393
|
+
} & Pick<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'title' | 'aria-expanded' | 'aria-haspopup' | 'aria-controls'>;
|
|
394
394
|
declare const TableActionButton: react.ForwardRefExoticComponent<{
|
|
395
395
|
variant: TableActionButtonVariant;
|
|
396
396
|
children?: ReactNode;
|
|
@@ -398,7 +398,7 @@ declare const TableActionButton: react.ForwardRefExoticComponent<{
|
|
|
398
398
|
ariaLabel?: string;
|
|
399
399
|
className?: string;
|
|
400
400
|
disabled?: boolean;
|
|
401
|
-
} & Pick<ButtonHTMLAttributes<HTMLButtonElement>, "aria-expanded" | "onClick" | "aria-controls" | "aria-haspopup"> & react.RefAttributes<HTMLButtonElement>>;
|
|
401
|
+
} & Pick<ButtonHTMLAttributes<HTMLButtonElement>, "aria-expanded" | "title" | "onClick" | "aria-controls" | "aria-haspopup"> & react.RefAttributes<HTMLButtonElement>>;
|
|
402
402
|
|
|
403
403
|
type TableIconTextProps = {
|
|
404
404
|
icon: ReactNode;
|
|
@@ -407,6 +407,46 @@ type TableIconTextProps = {
|
|
|
407
407
|
};
|
|
408
408
|
declare function TableIconText({ icon, children, className }: TableIconTextProps): react.JSX.Element;
|
|
409
409
|
|
|
410
|
+
type ModalFooterAlign = 'left' | 'center' | 'right';
|
|
411
|
+
type ModalFooterLayout = 'inline' | 'split';
|
|
412
|
+
type ModalProps = {
|
|
413
|
+
open: boolean;
|
|
414
|
+
title: string;
|
|
415
|
+
subtitle?: string;
|
|
416
|
+
icon?: ReactNode;
|
|
417
|
+
iconContainerClassName?: string;
|
|
418
|
+
children: ReactNode;
|
|
419
|
+
cancelText: string;
|
|
420
|
+
confirmText: string;
|
|
421
|
+
onCancel: () => void;
|
|
422
|
+
onConfirm: () => void;
|
|
423
|
+
footerAlign?: ModalFooterAlign;
|
|
424
|
+
footerLayout?: ModalFooterLayout;
|
|
425
|
+
cancelDisabled?: boolean;
|
|
426
|
+
confirmDisabled?: boolean;
|
|
427
|
+
closeOnBackdrop?: boolean;
|
|
428
|
+
containerClassName?: string;
|
|
429
|
+
contentClassName?: string;
|
|
430
|
+
buttonClassName?: string;
|
|
431
|
+
};
|
|
432
|
+
declare function Modal({ open, title, subtitle, icon, iconContainerClassName, children, cancelText, confirmText, onCancel, onConfirm, footerAlign, footerLayout, cancelDisabled, confirmDisabled, closeOnBackdrop, containerClassName, contentClassName, buttonClassName, }: ModalProps): react.JSX.Element | null;
|
|
433
|
+
|
|
434
|
+
type ConfirmModalProps = {
|
|
435
|
+
open: boolean;
|
|
436
|
+
title: string;
|
|
437
|
+
description: ReactNode;
|
|
438
|
+
cancelText: string;
|
|
439
|
+
confirmText: string;
|
|
440
|
+
onCancel: () => void;
|
|
441
|
+
onConfirm: () => void;
|
|
442
|
+
cancelDisabled?: boolean;
|
|
443
|
+
confirmDisabled?: boolean;
|
|
444
|
+
closeOnBackdrop?: boolean;
|
|
445
|
+
containerClassName?: string;
|
|
446
|
+
buttonClassName?: string;
|
|
447
|
+
};
|
|
448
|
+
declare function ConfirmModal({ open, title, description, cancelText, confirmText, onCancel, onConfirm, cancelDisabled, confirmDisabled, closeOnBackdrop, containerClassName, buttonClassName, }: ConfirmModalProps): react.JSX.Element | null;
|
|
449
|
+
|
|
410
450
|
declare function useMediaQuery(query: string): boolean;
|
|
411
451
|
|
|
412
452
|
type OutsideTarget<T extends HTMLElement> = RefObject<T | null> | Array<RefObject<T | null>>;
|
|
@@ -414,4 +454,4 @@ declare function useOnClickOutside<T extends HTMLElement>(ref: OutsideTarget<T>,
|
|
|
414
454
|
|
|
415
455
|
declare function cn(...inputs: ClassValue[]): string;
|
|
416
456
|
|
|
417
|
-
export { type AdminBuildingOption, type AdminHeaderLabels, type AdminLayoutLabels, type AdminNavItem, type AdminSidebarBranding, type AdminSidebarLabels, type AdminSidebarUser, AppHeader, type AppHeaderProps, Badge, type BadgeProps, type BadgeVariant, BellIcon, BuildingIcon, BuildingSelect, type BuildingSelectProps, DEFAULT_TABLE_BODY_MIN_HEIGHT, DashboardLayout, type DashboardLayoutProps, DataTable, type DataTableClassNames, type DataTableProps, Pagination, type PaginationLabels, type PaginationProps, type PaginationVariant, Sidebar, SidebarMobileHeader, type SidebarMobileHeaderProps, SidebarNavItem, type SidebarNavItemProps, type SidebarProps, SidebarUserCard, type SidebarUserCardProps, StatusBadge, type StatusBadgeProps, type StatusBadgeTone, Table, TableActionButton, type TableActionButtonProps, type TableActionButtonVariant, TableActionsCell, type TableActionsCellProps, TableActionsMenu, type TableActionsMenuItem, type TableActionsMenuItemTone, type TableActionsMenuProps, TableBody, type TableBodyProps, TableCell, type TableCellProps, type TableCellVariant, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, TableIconText, type TableIconTextProps, TableMenuActivateIcon, TableMenuCheckIcon, TableMenuCloseIcon, TableMenuEditIcon, TableMenuInfoIcon, TableMenuRefreshIcon, TableMenuSuspendIcon, TableMenuTrashIcon, TableMoreIcon, type TableProps, TableRow, type TableRowActionsConfig, type TableRowProps, TableRowStatusActions, type TableRowStatusActionsProps, TableScrollArea, type TableScrollAreaProps, type TableSortDirection, TableSortIcon, TableStatusActionsCell, type TableStatusActionsCellProps, cn, getPaginationRange, getTotalPages, getVisiblePageNumbers, tableRowDisabledCellClassName, useMediaQuery, useOnClickOutside };
|
|
457
|
+
export { type AdminBuildingOption, type AdminHeaderLabels, type AdminLayoutLabels, type AdminNavItem, type AdminSidebarBranding, type AdminSidebarLabels, type AdminSidebarUser, AppHeader, type AppHeaderProps, Badge, type BadgeProps, type BadgeVariant, BellIcon, BuildingIcon, BuildingSelect, type BuildingSelectProps, ConfirmModal, type ConfirmModalProps, DEFAULT_TABLE_BODY_MIN_HEIGHT, DashboardLayout, type DashboardLayoutProps, DataTable, type DataTableClassNames, type DataTableProps, Modal, type ModalFooterAlign, type ModalFooterLayout, type ModalProps, Pagination, type PaginationLabels, type PaginationProps, type PaginationVariant, Sidebar, SidebarMobileHeader, type SidebarMobileHeaderProps, SidebarNavItem, type SidebarNavItemProps, type SidebarProps, SidebarUserCard, type SidebarUserCardProps, StatusBadge, type StatusBadgeProps, type StatusBadgeTone, Table, TableActionButton, type TableActionButtonProps, type TableActionButtonVariant, TableActionsCell, type TableActionsCellProps, TableActionsMenu, type TableActionsMenuItem, type TableActionsMenuItemTone, type TableActionsMenuProps, TableBody, type TableBodyProps, TableCell, type TableCellProps, type TableCellVariant, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, TableIconText, type TableIconTextProps, TableMenuActivateIcon, TableMenuCheckIcon, TableMenuCloseIcon, TableMenuEditIcon, TableMenuInfoIcon, TableMenuRefreshIcon, TableMenuSuspendIcon, TableMenuTrashIcon, TableMoreIcon, type TableProps, TableRow, type TableRowActionsConfig, type TableRowProps, TableRowStatusActions, type TableRowStatusActionsProps, TableScrollArea, type TableScrollAreaProps, type TableSortDirection, TableSortIcon, TableStatusActionsCell, type TableStatusActionsCellProps, cn, getPaginationRange, getTotalPages, getVisiblePageNumbers, tableRowDisabledCellClassName, useMediaQuery, useOnClickOutside };
|
package/dist/web/index.d.ts
CHANGED
|
@@ -390,7 +390,7 @@ type TableActionButtonProps = {
|
|
|
390
390
|
ariaLabel?: string;
|
|
391
391
|
className?: string;
|
|
392
392
|
disabled?: boolean;
|
|
393
|
-
} & Pick<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'aria-expanded' | 'aria-haspopup' | 'aria-controls'>;
|
|
393
|
+
} & Pick<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'title' | 'aria-expanded' | 'aria-haspopup' | 'aria-controls'>;
|
|
394
394
|
declare const TableActionButton: react.ForwardRefExoticComponent<{
|
|
395
395
|
variant: TableActionButtonVariant;
|
|
396
396
|
children?: ReactNode;
|
|
@@ -398,7 +398,7 @@ declare const TableActionButton: react.ForwardRefExoticComponent<{
|
|
|
398
398
|
ariaLabel?: string;
|
|
399
399
|
className?: string;
|
|
400
400
|
disabled?: boolean;
|
|
401
|
-
} & Pick<ButtonHTMLAttributes<HTMLButtonElement>, "aria-expanded" | "onClick" | "aria-controls" | "aria-haspopup"> & react.RefAttributes<HTMLButtonElement>>;
|
|
401
|
+
} & Pick<ButtonHTMLAttributes<HTMLButtonElement>, "aria-expanded" | "title" | "onClick" | "aria-controls" | "aria-haspopup"> & react.RefAttributes<HTMLButtonElement>>;
|
|
402
402
|
|
|
403
403
|
type TableIconTextProps = {
|
|
404
404
|
icon: ReactNode;
|
|
@@ -407,6 +407,46 @@ type TableIconTextProps = {
|
|
|
407
407
|
};
|
|
408
408
|
declare function TableIconText({ icon, children, className }: TableIconTextProps): react.JSX.Element;
|
|
409
409
|
|
|
410
|
+
type ModalFooterAlign = 'left' | 'center' | 'right';
|
|
411
|
+
type ModalFooterLayout = 'inline' | 'split';
|
|
412
|
+
type ModalProps = {
|
|
413
|
+
open: boolean;
|
|
414
|
+
title: string;
|
|
415
|
+
subtitle?: string;
|
|
416
|
+
icon?: ReactNode;
|
|
417
|
+
iconContainerClassName?: string;
|
|
418
|
+
children: ReactNode;
|
|
419
|
+
cancelText: string;
|
|
420
|
+
confirmText: string;
|
|
421
|
+
onCancel: () => void;
|
|
422
|
+
onConfirm: () => void;
|
|
423
|
+
footerAlign?: ModalFooterAlign;
|
|
424
|
+
footerLayout?: ModalFooterLayout;
|
|
425
|
+
cancelDisabled?: boolean;
|
|
426
|
+
confirmDisabled?: boolean;
|
|
427
|
+
closeOnBackdrop?: boolean;
|
|
428
|
+
containerClassName?: string;
|
|
429
|
+
contentClassName?: string;
|
|
430
|
+
buttonClassName?: string;
|
|
431
|
+
};
|
|
432
|
+
declare function Modal({ open, title, subtitle, icon, iconContainerClassName, children, cancelText, confirmText, onCancel, onConfirm, footerAlign, footerLayout, cancelDisabled, confirmDisabled, closeOnBackdrop, containerClassName, contentClassName, buttonClassName, }: ModalProps): react.JSX.Element | null;
|
|
433
|
+
|
|
434
|
+
type ConfirmModalProps = {
|
|
435
|
+
open: boolean;
|
|
436
|
+
title: string;
|
|
437
|
+
description: ReactNode;
|
|
438
|
+
cancelText: string;
|
|
439
|
+
confirmText: string;
|
|
440
|
+
onCancel: () => void;
|
|
441
|
+
onConfirm: () => void;
|
|
442
|
+
cancelDisabled?: boolean;
|
|
443
|
+
confirmDisabled?: boolean;
|
|
444
|
+
closeOnBackdrop?: boolean;
|
|
445
|
+
containerClassName?: string;
|
|
446
|
+
buttonClassName?: string;
|
|
447
|
+
};
|
|
448
|
+
declare function ConfirmModal({ open, title, description, cancelText, confirmText, onCancel, onConfirm, cancelDisabled, confirmDisabled, closeOnBackdrop, containerClassName, buttonClassName, }: ConfirmModalProps): react.JSX.Element | null;
|
|
449
|
+
|
|
410
450
|
declare function useMediaQuery(query: string): boolean;
|
|
411
451
|
|
|
412
452
|
type OutsideTarget<T extends HTMLElement> = RefObject<T | null> | Array<RefObject<T | null>>;
|
|
@@ -414,4 +454,4 @@ declare function useOnClickOutside<T extends HTMLElement>(ref: OutsideTarget<T>,
|
|
|
414
454
|
|
|
415
455
|
declare function cn(...inputs: ClassValue[]): string;
|
|
416
456
|
|
|
417
|
-
export { type AdminBuildingOption, type AdminHeaderLabels, type AdminLayoutLabels, type AdminNavItem, type AdminSidebarBranding, type AdminSidebarLabels, type AdminSidebarUser, AppHeader, type AppHeaderProps, Badge, type BadgeProps, type BadgeVariant, BellIcon, BuildingIcon, BuildingSelect, type BuildingSelectProps, DEFAULT_TABLE_BODY_MIN_HEIGHT, DashboardLayout, type DashboardLayoutProps, DataTable, type DataTableClassNames, type DataTableProps, Pagination, type PaginationLabels, type PaginationProps, type PaginationVariant, Sidebar, SidebarMobileHeader, type SidebarMobileHeaderProps, SidebarNavItem, type SidebarNavItemProps, type SidebarProps, SidebarUserCard, type SidebarUserCardProps, StatusBadge, type StatusBadgeProps, type StatusBadgeTone, Table, TableActionButton, type TableActionButtonProps, type TableActionButtonVariant, TableActionsCell, type TableActionsCellProps, TableActionsMenu, type TableActionsMenuItem, type TableActionsMenuItemTone, type TableActionsMenuProps, TableBody, type TableBodyProps, TableCell, type TableCellProps, type TableCellVariant, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, TableIconText, type TableIconTextProps, TableMenuActivateIcon, TableMenuCheckIcon, TableMenuCloseIcon, TableMenuEditIcon, TableMenuInfoIcon, TableMenuRefreshIcon, TableMenuSuspendIcon, TableMenuTrashIcon, TableMoreIcon, type TableProps, TableRow, type TableRowActionsConfig, type TableRowProps, TableRowStatusActions, type TableRowStatusActionsProps, TableScrollArea, type TableScrollAreaProps, type TableSortDirection, TableSortIcon, TableStatusActionsCell, type TableStatusActionsCellProps, cn, getPaginationRange, getTotalPages, getVisiblePageNumbers, tableRowDisabledCellClassName, useMediaQuery, useOnClickOutside };
|
|
457
|
+
export { type AdminBuildingOption, type AdminHeaderLabels, type AdminLayoutLabels, type AdminNavItem, type AdminSidebarBranding, type AdminSidebarLabels, type AdminSidebarUser, AppHeader, type AppHeaderProps, Badge, type BadgeProps, type BadgeVariant, BellIcon, BuildingIcon, BuildingSelect, type BuildingSelectProps, ConfirmModal, type ConfirmModalProps, DEFAULT_TABLE_BODY_MIN_HEIGHT, DashboardLayout, type DashboardLayoutProps, DataTable, type DataTableClassNames, type DataTableProps, Modal, type ModalFooterAlign, type ModalFooterLayout, type ModalProps, Pagination, type PaginationLabels, type PaginationProps, type PaginationVariant, Sidebar, SidebarMobileHeader, type SidebarMobileHeaderProps, SidebarNavItem, type SidebarNavItemProps, type SidebarProps, SidebarUserCard, type SidebarUserCardProps, StatusBadge, type StatusBadgeProps, type StatusBadgeTone, Table, TableActionButton, type TableActionButtonProps, type TableActionButtonVariant, TableActionsCell, type TableActionsCellProps, TableActionsMenu, type TableActionsMenuItem, type TableActionsMenuItemTone, type TableActionsMenuProps, TableBody, type TableBodyProps, TableCell, type TableCellProps, type TableCellVariant, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, TableIconText, type TableIconTextProps, TableMenuActivateIcon, TableMenuCheckIcon, TableMenuCloseIcon, TableMenuEditIcon, TableMenuInfoIcon, TableMenuRefreshIcon, TableMenuSuspendIcon, TableMenuTrashIcon, TableMoreIcon, type TableProps, TableRow, type TableRowActionsConfig, type TableRowProps, TableRowStatusActions, type TableRowStatusActionsProps, TableScrollArea, type TableScrollAreaProps, type TableSortDirection, TableSortIcon, TableStatusActionsCell, type TableStatusActionsCellProps, cn, getPaginationRange, getTotalPages, getVisiblePageNumbers, tableRowDisabledCellClassName, useMediaQuery, useOnClickOutside };
|
package/dist/web/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __commonJS, __require, __toESM, Input } from '../chunk-
|
|
1
|
+
import { __commonJS, __require, __toESM, Input, Button } from '../chunk-YSDLHEJ7.js';
|
|
2
2
|
import { ChevronsUpDown, Search, LogOut, PanelLeftClose, PanelLeftOpen, X, Menu, ChevronLeft, ChevronRight } from 'lucide-react';
|
|
3
3
|
import { clsx } from 'clsx';
|
|
4
4
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -29354,8 +29354,8 @@ function TableMenuInfoIcon({ className }) {
|
|
|
29354
29354
|
children: /* @__PURE__ */ jsx(
|
|
29355
29355
|
"path",
|
|
29356
29356
|
{
|
|
29357
|
-
d: "
|
|
29358
|
-
stroke: "
|
|
29357
|
+
d: "M10.0013 13.3337V10.0003M10.0013 6.66699H10.0096M18.3346 10.0003C18.3346 14.6027 14.6037 18.3337 10.0013 18.3337C5.39893 18.3337 1.66797 14.6027 1.66797 10.0003C1.66797 5.39795 5.39893 1.66699 10.0013 1.66699C14.6037 1.66699 18.3346 5.39795 18.3346 10.0003Z",
|
|
29358
|
+
stroke: "currentColor",
|
|
29359
29359
|
strokeWidth: "2",
|
|
29360
29360
|
strokeLinecap: "round",
|
|
29361
29361
|
strokeLinejoin: "round"
|
|
@@ -29854,6 +29854,7 @@ var TableActionButton = forwardRef(
|
|
|
29854
29854
|
...props
|
|
29855
29855
|
}, ref) {
|
|
29856
29856
|
const isInlineAction = variant === "approve" || variant === "reject";
|
|
29857
|
+
const hasLabel = Boolean(children);
|
|
29857
29858
|
return /* @__PURE__ */ jsxs(
|
|
29858
29859
|
"button",
|
|
29859
29860
|
{
|
|
@@ -29864,6 +29865,7 @@ var TableActionButton = forwardRef(
|
|
|
29864
29865
|
"aria-label": ariaLabel,
|
|
29865
29866
|
className: cn(
|
|
29866
29867
|
variantClasses[variant],
|
|
29868
|
+
isInlineAction && !hasLabel && "px-2",
|
|
29867
29869
|
disabled && "cursor-not-allowed opacity-50",
|
|
29868
29870
|
className
|
|
29869
29871
|
),
|
|
@@ -29992,12 +29994,12 @@ function TableActionsMenu({
|
|
|
29992
29994
|
item.onSelect();
|
|
29993
29995
|
},
|
|
29994
29996
|
className: cn(
|
|
29995
|
-
"flex w-full cursor-pointer items-center gap-2.5 px-3
|
|
29997
|
+
"flex h-[51px] w-full cursor-pointer items-center gap-2.5 px-3 text-left font-sans text-sm font-medium leading-none text-storm-gray-900 transition-colors hover:bg-storm-gray-0",
|
|
29996
29998
|
index > 0 && "border-t border-storm-gray-50",
|
|
29997
29999
|
item.disabled && "cursor-not-allowed opacity-50"
|
|
29998
30000
|
),
|
|
29999
30001
|
children: [
|
|
30000
|
-
icon ? /* @__PURE__ */ jsx("span", { className: "inline-flex size-5 shrink-0 items-center justify-center", children: icon }) : null,
|
|
30002
|
+
icon ? /* @__PURE__ */ jsx("span", { className: "inline-flex size-5 shrink-0 items-center justify-center text-storm-gray-200", children: icon }) : null,
|
|
30001
30003
|
/* @__PURE__ */ jsx("span", { children: item.label })
|
|
30002
30004
|
]
|
|
30003
30005
|
},
|
|
@@ -30252,6 +30254,247 @@ function TableIconText({ icon, children, className }) {
|
|
|
30252
30254
|
}
|
|
30253
30255
|
);
|
|
30254
30256
|
}
|
|
30257
|
+
var footerAlignClasses = {
|
|
30258
|
+
left: "justify-start",
|
|
30259
|
+
center: "justify-center",
|
|
30260
|
+
right: "justify-end"
|
|
30261
|
+
};
|
|
30262
|
+
function Modal({
|
|
30263
|
+
open,
|
|
30264
|
+
title,
|
|
30265
|
+
subtitle,
|
|
30266
|
+
icon,
|
|
30267
|
+
iconContainerClassName,
|
|
30268
|
+
children,
|
|
30269
|
+
cancelText,
|
|
30270
|
+
confirmText,
|
|
30271
|
+
onCancel,
|
|
30272
|
+
onConfirm,
|
|
30273
|
+
footerAlign = "right",
|
|
30274
|
+
footerLayout = "inline",
|
|
30275
|
+
cancelDisabled = false,
|
|
30276
|
+
confirmDisabled = false,
|
|
30277
|
+
closeOnBackdrop = true,
|
|
30278
|
+
containerClassName,
|
|
30279
|
+
contentClassName,
|
|
30280
|
+
buttonClassName
|
|
30281
|
+
}) {
|
|
30282
|
+
useEffect(() => {
|
|
30283
|
+
if (!open) {
|
|
30284
|
+
return;
|
|
30285
|
+
}
|
|
30286
|
+
const handleKeyDown = (event) => {
|
|
30287
|
+
if (event.key === "Escape") {
|
|
30288
|
+
onCancel();
|
|
30289
|
+
}
|
|
30290
|
+
};
|
|
30291
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
30292
|
+
return () => {
|
|
30293
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
30294
|
+
};
|
|
30295
|
+
}, [open, onCancel]);
|
|
30296
|
+
if (!open) {
|
|
30297
|
+
return null;
|
|
30298
|
+
}
|
|
30299
|
+
const sharedButtonClassName = cn(
|
|
30300
|
+
"btn h-13 justify-center!",
|
|
30301
|
+
footerLayout === "split" && "min-w-0 flex-1",
|
|
30302
|
+
buttonClassName
|
|
30303
|
+
);
|
|
30304
|
+
return /* @__PURE__ */ jsx(
|
|
30305
|
+
"div",
|
|
30306
|
+
{
|
|
30307
|
+
className: "fixed inset-0 z-50 flex items-center justify-center p-4 backdrop-blur-[12px] bg-storm-gray-850/40",
|
|
30308
|
+
onClick: closeOnBackdrop ? onCancel : void 0,
|
|
30309
|
+
role: "presentation",
|
|
30310
|
+
children: /* @__PURE__ */ jsxs(
|
|
30311
|
+
"div",
|
|
30312
|
+
{
|
|
30313
|
+
role: "dialog",
|
|
30314
|
+
"aria-modal": "true",
|
|
30315
|
+
"aria-labelledby": "homepad-modal-title",
|
|
30316
|
+
...subtitle ? { "aria-describedby": "homepad-modal-subtitle" } : {},
|
|
30317
|
+
className: cn(
|
|
30318
|
+
"flex w-full max-w-2xl flex-col gap-6 rounded-2xl bg-white p-4 opacity-100 md:p-6",
|
|
30319
|
+
containerClassName
|
|
30320
|
+
),
|
|
30321
|
+
onClick: (event) => {
|
|
30322
|
+
event.stopPropagation();
|
|
30323
|
+
},
|
|
30324
|
+
children: [
|
|
30325
|
+
/* @__PURE__ */ jsxs("header", { className: cn("flex", icon ? "items-center gap-2.5" : void 0), children: [
|
|
30326
|
+
icon ? /* @__PURE__ */ jsx(
|
|
30327
|
+
"div",
|
|
30328
|
+
{
|
|
30329
|
+
className: cn(
|
|
30330
|
+
"flex size-11 shrink-0 items-center justify-center rounded-lg bg-storm-gray-50 p-3 opacity-100",
|
|
30331
|
+
iconContainerClassName
|
|
30332
|
+
),
|
|
30333
|
+
children: /* @__PURE__ */ jsx("div", { className: "flex size-5 shrink-0 items-center justify-center [&>*]:size-5 [&_svg]:size-5", children: icon })
|
|
30334
|
+
}
|
|
30335
|
+
) : null,
|
|
30336
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-2", children: [
|
|
30337
|
+
/* @__PURE__ */ jsx(
|
|
30338
|
+
"h2",
|
|
30339
|
+
{
|
|
30340
|
+
id: "homepad-modal-title",
|
|
30341
|
+
className: "font-sans text-lg font-bold leading-none tracking-normal text-black",
|
|
30342
|
+
children: title
|
|
30343
|
+
}
|
|
30344
|
+
),
|
|
30345
|
+
subtitle ? /* @__PURE__ */ jsx(
|
|
30346
|
+
"p",
|
|
30347
|
+
{
|
|
30348
|
+
id: "homepad-modal-subtitle",
|
|
30349
|
+
className: "font-sans text-xs font-normal leading-none tracking-normal text-storm-gray-400",
|
|
30350
|
+
children: subtitle
|
|
30351
|
+
}
|
|
30352
|
+
) : null
|
|
30353
|
+
] })
|
|
30354
|
+
] }),
|
|
30355
|
+
/* @__PURE__ */ jsx("div", { className: cn("min-w-0", contentClassName), children }),
|
|
30356
|
+
/* @__PURE__ */ jsxs(
|
|
30357
|
+
"footer",
|
|
30358
|
+
{
|
|
30359
|
+
className: cn(
|
|
30360
|
+
"flex gap-4",
|
|
30361
|
+
footerLayout === "split" ? "w-full" : footerAlignClasses[footerAlign]
|
|
30362
|
+
),
|
|
30363
|
+
children: [
|
|
30364
|
+
/* @__PURE__ */ jsx(
|
|
30365
|
+
Button,
|
|
30366
|
+
{
|
|
30367
|
+
title: cancelText,
|
|
30368
|
+
onPress: onCancel,
|
|
30369
|
+
variant: "gray",
|
|
30370
|
+
disabled: cancelDisabled,
|
|
30371
|
+
className: sharedButtonClassName,
|
|
30372
|
+
textClassName: "text-center!"
|
|
30373
|
+
}
|
|
30374
|
+
),
|
|
30375
|
+
/* @__PURE__ */ jsx(
|
|
30376
|
+
Button,
|
|
30377
|
+
{
|
|
30378
|
+
title: confirmText,
|
|
30379
|
+
onPress: onConfirm,
|
|
30380
|
+
variant: "primary",
|
|
30381
|
+
disabled: confirmDisabled,
|
|
30382
|
+
className: sharedButtonClassName,
|
|
30383
|
+
textClassName: "text-center!"
|
|
30384
|
+
}
|
|
30385
|
+
)
|
|
30386
|
+
]
|
|
30387
|
+
}
|
|
30388
|
+
)
|
|
30389
|
+
]
|
|
30390
|
+
}
|
|
30391
|
+
)
|
|
30392
|
+
}
|
|
30393
|
+
);
|
|
30394
|
+
}
|
|
30395
|
+
function ConfirmModal({
|
|
30396
|
+
open,
|
|
30397
|
+
title,
|
|
30398
|
+
description,
|
|
30399
|
+
cancelText,
|
|
30400
|
+
confirmText,
|
|
30401
|
+
onCancel,
|
|
30402
|
+
onConfirm,
|
|
30403
|
+
cancelDisabled = false,
|
|
30404
|
+
confirmDisabled = false,
|
|
30405
|
+
closeOnBackdrop = true,
|
|
30406
|
+
containerClassName,
|
|
30407
|
+
buttonClassName
|
|
30408
|
+
}) {
|
|
30409
|
+
useEffect(() => {
|
|
30410
|
+
if (!open) {
|
|
30411
|
+
return;
|
|
30412
|
+
}
|
|
30413
|
+
const handleKeyDown = (event) => {
|
|
30414
|
+
if (event.key === "Escape") {
|
|
30415
|
+
onCancel();
|
|
30416
|
+
}
|
|
30417
|
+
};
|
|
30418
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
30419
|
+
return () => {
|
|
30420
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
30421
|
+
};
|
|
30422
|
+
}, [open, onCancel]);
|
|
30423
|
+
if (!open) {
|
|
30424
|
+
return null;
|
|
30425
|
+
}
|
|
30426
|
+
const sharedButtonClassName = cn("btn h-10 min-w-0 flex-1 justify-center!", buttonClassName);
|
|
30427
|
+
return /* @__PURE__ */ jsx(
|
|
30428
|
+
"div",
|
|
30429
|
+
{
|
|
30430
|
+
className: "fixed inset-0 z-50 flex items-center justify-center p-4 backdrop-blur-md bg-storm-gray-850/40",
|
|
30431
|
+
onClick: closeOnBackdrop ? onCancel : void 0,
|
|
30432
|
+
role: "presentation",
|
|
30433
|
+
children: /* @__PURE__ */ jsxs(
|
|
30434
|
+
"div",
|
|
30435
|
+
{
|
|
30436
|
+
role: "dialog",
|
|
30437
|
+
"aria-modal": "true",
|
|
30438
|
+
"aria-labelledby": "homepad-confirm-modal-title",
|
|
30439
|
+
"aria-describedby": "homepad-confirm-modal-description",
|
|
30440
|
+
className: cn(
|
|
30441
|
+
"flex w-full max-w-md flex-col gap-8 rounded-2xl bg-white p-4 opacity-100 md:p-6",
|
|
30442
|
+
containerClassName
|
|
30443
|
+
),
|
|
30444
|
+
onClick: (event) => {
|
|
30445
|
+
event.stopPropagation();
|
|
30446
|
+
},
|
|
30447
|
+
children: [
|
|
30448
|
+
/* @__PURE__ */ jsxs("header", { className: "flex flex-col gap-3 text-center", children: [
|
|
30449
|
+
/* @__PURE__ */ jsx(
|
|
30450
|
+
"h2",
|
|
30451
|
+
{
|
|
30452
|
+
id: "homepad-confirm-modal-title",
|
|
30453
|
+
className: "font-sans text-xl font-bold leading-6.75 tracking-normal text-black",
|
|
30454
|
+
children: title
|
|
30455
|
+
}
|
|
30456
|
+
),
|
|
30457
|
+
/* @__PURE__ */ jsx(
|
|
30458
|
+
"div",
|
|
30459
|
+
{
|
|
30460
|
+
id: "homepad-confirm-modal-description",
|
|
30461
|
+
className: "text-center font-sans text-sm font-normal leading-4.75 tracking-normal text-storm-gray-400",
|
|
30462
|
+
children: description
|
|
30463
|
+
}
|
|
30464
|
+
)
|
|
30465
|
+
] }),
|
|
30466
|
+
/* @__PURE__ */ jsxs("footer", { className: "flex w-full gap-4", children: [
|
|
30467
|
+
/* @__PURE__ */ jsx(
|
|
30468
|
+
Button,
|
|
30469
|
+
{
|
|
30470
|
+
title: cancelText,
|
|
30471
|
+
onPress: onCancel,
|
|
30472
|
+
variant: "gray",
|
|
30473
|
+
size: "sm",
|
|
30474
|
+
disabled: cancelDisabled,
|
|
30475
|
+
className: sharedButtonClassName,
|
|
30476
|
+
textClassName: "text-center!"
|
|
30477
|
+
}
|
|
30478
|
+
),
|
|
30479
|
+
/* @__PURE__ */ jsx(
|
|
30480
|
+
Button,
|
|
30481
|
+
{
|
|
30482
|
+
title: confirmText,
|
|
30483
|
+
onPress: onConfirm,
|
|
30484
|
+
variant: "primary",
|
|
30485
|
+
size: "sm",
|
|
30486
|
+
disabled: confirmDisabled,
|
|
30487
|
+
className: sharedButtonClassName,
|
|
30488
|
+
textClassName: "text-center!"
|
|
30489
|
+
}
|
|
30490
|
+
)
|
|
30491
|
+
] })
|
|
30492
|
+
]
|
|
30493
|
+
}
|
|
30494
|
+
)
|
|
30495
|
+
}
|
|
30496
|
+
);
|
|
30497
|
+
}
|
|
30255
30498
|
/*! Bundled license information:
|
|
30256
30499
|
|
|
30257
30500
|
scheduler/cjs/scheduler.production.min.js:
|
|
@@ -30312,6 +30555,6 @@ react-dom/cjs/react-dom.development.js:
|
|
|
30312
30555
|
*)
|
|
30313
30556
|
*/
|
|
30314
30557
|
|
|
30315
|
-
export { AppHeader, Badge, BellIcon, BuildingIcon, BuildingSelect, DEFAULT_TABLE_BODY_MIN_HEIGHT, DashboardLayout, DataTable, Pagination, Sidebar, SidebarMobileHeader, SidebarNavItem, SidebarUserCard, StatusBadge, Table, TableActionButton, TableActionsCell, TableActionsMenu, TableBody, TableCell, TableHead, TableHeader, TableIconText, TableMenuActivateIcon, TableMenuCheckIcon, TableMenuCloseIcon, TableMenuEditIcon, TableMenuInfoIcon, TableMenuRefreshIcon, TableMenuSuspendIcon, TableMenuTrashIcon, TableMoreIcon, TableRow, TableRowStatusActions, TableScrollArea, TableSortIcon, TableStatusActionsCell, cn, getPaginationRange, getTotalPages, getVisiblePageNumbers, tableRowDisabledCellClassName, useMediaQuery, useOnClickOutside };
|
|
30558
|
+
export { AppHeader, Badge, BellIcon, BuildingIcon, BuildingSelect, ConfirmModal, DEFAULT_TABLE_BODY_MIN_HEIGHT, DashboardLayout, DataTable, Modal, Pagination, Sidebar, SidebarMobileHeader, SidebarNavItem, SidebarUserCard, StatusBadge, Table, TableActionButton, TableActionsCell, TableActionsMenu, TableBody, TableCell, TableHead, TableHeader, TableIconText, TableMenuActivateIcon, TableMenuCheckIcon, TableMenuCloseIcon, TableMenuEditIcon, TableMenuInfoIcon, TableMenuRefreshIcon, TableMenuSuspendIcon, TableMenuTrashIcon, TableMoreIcon, TableRow, TableRowStatusActions, TableScrollArea, TableSortIcon, TableStatusActionsCell, cn, getPaginationRange, getTotalPages, getVisiblePageNumbers, tableRowDisabledCellClassName, useMediaQuery, useOnClickOutside };
|
|
30316
30559
|
//# sourceMappingURL=index.js.map
|
|
30317
30560
|
//# sourceMappingURL=index.js.map
|