@camtomlabs/malix-design-system 0.3.0 → 0.4.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.cts CHANGED
@@ -366,7 +366,14 @@ type ModalProps = {
366
366
  cancelLabel?: string;
367
367
  children: React__default.ReactNode;
368
368
  };
369
- declare function Modal({ open, title, onClose, onConfirm, confirmLabel, cancelLabel, children, }: ModalProps): react_jsx_runtime.JSX.Element | null;
369
+ /**
370
+ * <Modal> — opinionated glass-style modal with header/body/footer preset.
371
+ *
372
+ * For custom layouts, prefer <Dialog> with slot composition
373
+ * (<Dialog.Header>, <Dialog.Body>, <Dialog.Footer>). Modal is kept as a
374
+ * quick preset for simple title + content + confirm flows.
375
+ */
376
+ declare function Modal({ open, title, onClose, onConfirm, confirmLabel, cancelLabel, children, }: ModalProps): React__default.ReactPortal | null;
370
377
 
371
378
  type ConfirmDialogVariant = 'default' | 'danger' | 'warning' | 'info';
372
379
  type ConfirmDialogProps = {
@@ -382,7 +389,94 @@ type ConfirmDialogProps = {
382
389
  children?: React__default.ReactNode;
383
390
  loading?: boolean;
384
391
  };
385
- declare function ConfirmDialog({ open, title, description, onConfirm, onCancel, confirmLabel, cancelLabel, variant, icon, children, loading, }: ConfirmDialogProps): react_jsx_runtime.JSX.Element | null;
392
+ /**
393
+ * <ConfirmDialog> — semantic confirmation preset built on top of the
394
+ * overlay primitives. Use for binary confirm/cancel flows with a single
395
+ * message. For custom layouts (reason textareas, multi-step, extra
396
+ * controls), use <Dialog> instead.
397
+ */
398
+ declare function ConfirmDialog({ open, title, description, onConfirm, onCancel, confirmLabel, cancelLabel, variant, icon, children, loading, }: ConfirmDialogProps): React__default.ReactPortal | null;
399
+
400
+ /**
401
+ * <Dialog> — canonical composable modal dialog.
402
+ *
403
+ * Composition:
404
+ * <Dialog open={open} onClose={close} variant="danger">
405
+ * <Dialog.Header>Delete catalog?</Dialog.Header>
406
+ * <Dialog.Body>
407
+ * This action can't be undone.
408
+ * <textarea ... />
409
+ * </Dialog.Body>
410
+ * <Dialog.Footer>
411
+ * <Button hierarchy="secondary" onClick={close}>Cancel</Button>
412
+ * <Button hierarchy="danger" onClick={confirm}>Delete</Button>
413
+ * </Dialog.Footer>
414
+ * </Dialog>
415
+ *
416
+ * Behavior (from useOverlayBehavior):
417
+ * - Rendered via React portal into document.body
418
+ * - Focus trap + Tab cycling
419
+ * - Escape closes (disable via closeOnEsc={false})
420
+ * - Backdrop click closes (disable via closeOnBackdropClick={false})
421
+ * - Body scroll lock while open
422
+ * - Focus restored to the previously-focused element on close
423
+ * - Automatic ARIA wiring via useId (labelled by Dialog.Header,
424
+ * described by Dialog.Body)
425
+ *
426
+ * For the confirm-primitive preset, use <ConfirmDialog> instead.
427
+ */
428
+ type DialogVariant = 'default' | 'danger' | 'warning' | 'info';
429
+ type DialogSize = 'sm' | 'md' | 'lg';
430
+ type DialogProps = {
431
+ /** Whether the dialog is visible. */
432
+ open: boolean;
433
+ /** Called when the user requests the dialog to close (esc, backdrop, close button). */
434
+ onClose: () => void;
435
+ /** Semantic variant — affects accent color of the header border and icons. */
436
+ variant?: DialogVariant;
437
+ /** Controls max-width of the panel. */
438
+ size?: DialogSize;
439
+ /** Clicking the backdrop closes the dialog. Default true. */
440
+ closeOnBackdropClick?: boolean;
441
+ /** Pressing Escape closes the dialog. Default true. */
442
+ closeOnEsc?: boolean;
443
+ /** Element to focus when the dialog opens. Defaults to the first focusable. */
444
+ initialFocusRef?: React__default.RefObject<HTMLElement | null>;
445
+ /** Optional className on the panel. */
446
+ className?: string;
447
+ /**
448
+ * Role — `dialog` (default) or `alertdialog` for urgent confirmations.
449
+ * Use `alertdialog` for destructive confirm flows so screen readers
450
+ * announce immediately.
451
+ */
452
+ role?: 'dialog' | 'alertdialog';
453
+ children: React__default.ReactNode;
454
+ };
455
+ declare function Dialog({ open, onClose, variant, size, closeOnBackdropClick, closeOnEsc, initialFocusRef, className, role, children, }: DialogProps): React__default.ReactPortal | null;
456
+ declare namespace Dialog {
457
+ var Header: typeof DialogHeader;
458
+ var Body: typeof DialogBody;
459
+ var Footer: typeof DialogFooter;
460
+ }
461
+ type DialogHeaderProps = {
462
+ children: React__default.ReactNode;
463
+ /** Show the built-in close (X) button. Default true. */
464
+ showClose?: boolean;
465
+ /** Accessible label for the close button. */
466
+ closeLabel?: string;
467
+ };
468
+ declare function DialogHeader({ children, showClose, closeLabel, }: DialogHeaderProps): react_jsx_runtime.JSX.Element;
469
+ type DialogBodyProps = {
470
+ children: React__default.ReactNode;
471
+ className?: string;
472
+ };
473
+ declare function DialogBody({ children, className }: DialogBodyProps): react_jsx_runtime.JSX.Element;
474
+ type DialogFooterProps = {
475
+ children: React__default.ReactNode;
476
+ /** Where to align action buttons. Default "end". */
477
+ align?: 'start' | 'center' | 'end' | 'between';
478
+ };
479
+ declare function DialogFooter({ children, align }: DialogFooterProps): react_jsx_runtime.JSX.Element;
386
480
 
387
481
  type GlassPopoverProps = React__default.HTMLAttributes<HTMLDivElement> & {
388
482
  title?: string;
@@ -659,4 +753,4 @@ interface IconProps extends Omit<SVGProps<SVGSVGElement>, 'children' | 'ref'> {
659
753
  */
660
754
  declare const Icon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
661
755
 
662
- export { type AIAssistantMessage, AIAssistantPanel, type AIAssistantPanelProps, Accordion, type AccordionProps, Avatar, type AvatarProps, Badge, type BadgeProps, type BadgeVariant, Banner, type BannerProps, type BannerVariant, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonHierarchy, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardLevel, type CardProps, ChatBubble, type ChatBubbleProps, type ChatBubbleVariant, ChatInput, type ChatInputProps, Checkbox, type CheckboxProps, ConfirmDialog, type ConfirmDialogProps, type ConfirmDialogVariant, CreditsIndicator, type CreditsIndicatorProps, DataTable, type DataTableProps, DateInput, type DateInputProps, Divider, type DividerProps, Dropzone, type DropzoneProps, EmptyState, type EmptyStateProps, FileCard, type FileCardProps, type FilterTabItem, FilterTabs, type FilterTabsProps, FlyoutMenu, type FlyoutMenuItem, type FlyoutMenuProps, GlassPopover, type GlassPopoverProps, Header, type HeaderProps, Icon, type IconComponent, type IconProps, type IconSize, Input, InputGroup, type InputGroupProps, type InputProps, LanguageSelector, type LanguageSelectorOption, type LanguageSelectorProps, type MalixTheme, MalixThemeProvider, Modal, type ModalProps, OnboardingPopover, type OnboardingPopoverProps, OperationStatus, type OperationStatusProps, type OperationStatusType, Overlay, type OverlayProps, Pagination, type PaginationProps, type PaginationVariant, Pill, type PillProps, type PillVariant, PricingCard, type PricingCardProps, ProgressBar, type ProgressBarProps, type ProgressBarVariant, Radio, type RadioProps, SearchInput, SectionHeader, type SectionHeaderProps, SegmentedControl, type SegmentedControlItem, type SegmentedControlProps, Select, SelectGroup, type SelectGroupProps, type SelectOption, type SelectProps, SelectionCard, type SelectionCardProps, SidebarItem, type SidebarItemProps, SidebarPanel, type SidebarPanelProps, SplitPane, type SplitPaneProps, StatCard, type StatCardChangeType, type StatCardProps, StatusDot, type StatusDotProps, type StatusDotVariant, type StepItem, type StepStatus, Stepper, type StepperProps, TabBar, type TabBarProps, type TabItem, type TableColumn, type TableRow, Textarea, type TextareaProps, Toggle, type ToggleProps, Tooltip, type TooltipPlacement, type TooltipProps, type UserProfileMenuItem, UserProfilePopover, type UserProfilePopoverProps, ValidationAlert, type ValidationAlertProps, type ValidationAlertVariant, tokens_registry as tokenRegistry, useMalixTheme };
756
+ export { type AIAssistantMessage, AIAssistantPanel, type AIAssistantPanelProps, Accordion, type AccordionProps, Avatar, type AvatarProps, Badge, type BadgeProps, type BadgeVariant, Banner, type BannerProps, type BannerVariant, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonHierarchy, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardLevel, type CardProps, ChatBubble, type ChatBubbleProps, type ChatBubbleVariant, ChatInput, type ChatInputProps, Checkbox, type CheckboxProps, ConfirmDialog, type ConfirmDialogProps, type ConfirmDialogVariant, CreditsIndicator, type CreditsIndicatorProps, DataTable, type DataTableProps, DateInput, type DateInputProps, Dialog, type DialogBodyProps, type DialogFooterProps, type DialogHeaderProps, type DialogProps, type DialogSize, type DialogVariant, Divider, type DividerProps, Dropzone, type DropzoneProps, EmptyState, type EmptyStateProps, FileCard, type FileCardProps, type FilterTabItem, FilterTabs, type FilterTabsProps, FlyoutMenu, type FlyoutMenuItem, type FlyoutMenuProps, GlassPopover, type GlassPopoverProps, Header, type HeaderProps, Icon, type IconComponent, type IconProps, type IconSize, Input, InputGroup, type InputGroupProps, type InputProps, LanguageSelector, type LanguageSelectorOption, type LanguageSelectorProps, type MalixTheme, MalixThemeProvider, Modal, type ModalProps, OnboardingPopover, type OnboardingPopoverProps, OperationStatus, type OperationStatusProps, type OperationStatusType, Overlay, type OverlayProps, Pagination, type PaginationProps, type PaginationVariant, Pill, type PillProps, type PillVariant, PricingCard, type PricingCardProps, ProgressBar, type ProgressBarProps, type ProgressBarVariant, Radio, type RadioProps, SearchInput, SectionHeader, type SectionHeaderProps, SegmentedControl, type SegmentedControlItem, type SegmentedControlProps, Select, SelectGroup, type SelectGroupProps, type SelectOption, type SelectProps, SelectionCard, type SelectionCardProps, SidebarItem, type SidebarItemProps, SidebarPanel, type SidebarPanelProps, SplitPane, type SplitPaneProps, StatCard, type StatCardChangeType, type StatCardProps, StatusDot, type StatusDotProps, type StatusDotVariant, type StepItem, type StepStatus, Stepper, type StepperProps, TabBar, type TabBarProps, type TabItem, type TableColumn, type TableRow, Textarea, type TextareaProps, Toggle, type ToggleProps, Tooltip, type TooltipPlacement, type TooltipProps, type UserProfileMenuItem, UserProfilePopover, type UserProfilePopoverProps, ValidationAlert, type ValidationAlertProps, type ValidationAlertVariant, tokens_registry as tokenRegistry, useMalixTheme };
package/dist/index.d.ts CHANGED
@@ -366,7 +366,14 @@ type ModalProps = {
366
366
  cancelLabel?: string;
367
367
  children: React__default.ReactNode;
368
368
  };
369
- declare function Modal({ open, title, onClose, onConfirm, confirmLabel, cancelLabel, children, }: ModalProps): react_jsx_runtime.JSX.Element | null;
369
+ /**
370
+ * <Modal> — opinionated glass-style modal with header/body/footer preset.
371
+ *
372
+ * For custom layouts, prefer <Dialog> with slot composition
373
+ * (<Dialog.Header>, <Dialog.Body>, <Dialog.Footer>). Modal is kept as a
374
+ * quick preset for simple title + content + confirm flows.
375
+ */
376
+ declare function Modal({ open, title, onClose, onConfirm, confirmLabel, cancelLabel, children, }: ModalProps): React__default.ReactPortal | null;
370
377
 
371
378
  type ConfirmDialogVariant = 'default' | 'danger' | 'warning' | 'info';
372
379
  type ConfirmDialogProps = {
@@ -382,7 +389,94 @@ type ConfirmDialogProps = {
382
389
  children?: React__default.ReactNode;
383
390
  loading?: boolean;
384
391
  };
385
- declare function ConfirmDialog({ open, title, description, onConfirm, onCancel, confirmLabel, cancelLabel, variant, icon, children, loading, }: ConfirmDialogProps): react_jsx_runtime.JSX.Element | null;
392
+ /**
393
+ * <ConfirmDialog> — semantic confirmation preset built on top of the
394
+ * overlay primitives. Use for binary confirm/cancel flows with a single
395
+ * message. For custom layouts (reason textareas, multi-step, extra
396
+ * controls), use <Dialog> instead.
397
+ */
398
+ declare function ConfirmDialog({ open, title, description, onConfirm, onCancel, confirmLabel, cancelLabel, variant, icon, children, loading, }: ConfirmDialogProps): React__default.ReactPortal | null;
399
+
400
+ /**
401
+ * <Dialog> — canonical composable modal dialog.
402
+ *
403
+ * Composition:
404
+ * <Dialog open={open} onClose={close} variant="danger">
405
+ * <Dialog.Header>Delete catalog?</Dialog.Header>
406
+ * <Dialog.Body>
407
+ * This action can't be undone.
408
+ * <textarea ... />
409
+ * </Dialog.Body>
410
+ * <Dialog.Footer>
411
+ * <Button hierarchy="secondary" onClick={close}>Cancel</Button>
412
+ * <Button hierarchy="danger" onClick={confirm}>Delete</Button>
413
+ * </Dialog.Footer>
414
+ * </Dialog>
415
+ *
416
+ * Behavior (from useOverlayBehavior):
417
+ * - Rendered via React portal into document.body
418
+ * - Focus trap + Tab cycling
419
+ * - Escape closes (disable via closeOnEsc={false})
420
+ * - Backdrop click closes (disable via closeOnBackdropClick={false})
421
+ * - Body scroll lock while open
422
+ * - Focus restored to the previously-focused element on close
423
+ * - Automatic ARIA wiring via useId (labelled by Dialog.Header,
424
+ * described by Dialog.Body)
425
+ *
426
+ * For the confirm-primitive preset, use <ConfirmDialog> instead.
427
+ */
428
+ type DialogVariant = 'default' | 'danger' | 'warning' | 'info';
429
+ type DialogSize = 'sm' | 'md' | 'lg';
430
+ type DialogProps = {
431
+ /** Whether the dialog is visible. */
432
+ open: boolean;
433
+ /** Called when the user requests the dialog to close (esc, backdrop, close button). */
434
+ onClose: () => void;
435
+ /** Semantic variant — affects accent color of the header border and icons. */
436
+ variant?: DialogVariant;
437
+ /** Controls max-width of the panel. */
438
+ size?: DialogSize;
439
+ /** Clicking the backdrop closes the dialog. Default true. */
440
+ closeOnBackdropClick?: boolean;
441
+ /** Pressing Escape closes the dialog. Default true. */
442
+ closeOnEsc?: boolean;
443
+ /** Element to focus when the dialog opens. Defaults to the first focusable. */
444
+ initialFocusRef?: React__default.RefObject<HTMLElement | null>;
445
+ /** Optional className on the panel. */
446
+ className?: string;
447
+ /**
448
+ * Role — `dialog` (default) or `alertdialog` for urgent confirmations.
449
+ * Use `alertdialog` for destructive confirm flows so screen readers
450
+ * announce immediately.
451
+ */
452
+ role?: 'dialog' | 'alertdialog';
453
+ children: React__default.ReactNode;
454
+ };
455
+ declare function Dialog({ open, onClose, variant, size, closeOnBackdropClick, closeOnEsc, initialFocusRef, className, role, children, }: DialogProps): React__default.ReactPortal | null;
456
+ declare namespace Dialog {
457
+ var Header: typeof DialogHeader;
458
+ var Body: typeof DialogBody;
459
+ var Footer: typeof DialogFooter;
460
+ }
461
+ type DialogHeaderProps = {
462
+ children: React__default.ReactNode;
463
+ /** Show the built-in close (X) button. Default true. */
464
+ showClose?: boolean;
465
+ /** Accessible label for the close button. */
466
+ closeLabel?: string;
467
+ };
468
+ declare function DialogHeader({ children, showClose, closeLabel, }: DialogHeaderProps): react_jsx_runtime.JSX.Element;
469
+ type DialogBodyProps = {
470
+ children: React__default.ReactNode;
471
+ className?: string;
472
+ };
473
+ declare function DialogBody({ children, className }: DialogBodyProps): react_jsx_runtime.JSX.Element;
474
+ type DialogFooterProps = {
475
+ children: React__default.ReactNode;
476
+ /** Where to align action buttons. Default "end". */
477
+ align?: 'start' | 'center' | 'end' | 'between';
478
+ };
479
+ declare function DialogFooter({ children, align }: DialogFooterProps): react_jsx_runtime.JSX.Element;
386
480
 
387
481
  type GlassPopoverProps = React__default.HTMLAttributes<HTMLDivElement> & {
388
482
  title?: string;
@@ -659,4 +753,4 @@ interface IconProps extends Omit<SVGProps<SVGSVGElement>, 'children' | 'ref'> {
659
753
  */
660
754
  declare const Icon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
661
755
 
662
- export { type AIAssistantMessage, AIAssistantPanel, type AIAssistantPanelProps, Accordion, type AccordionProps, Avatar, type AvatarProps, Badge, type BadgeProps, type BadgeVariant, Banner, type BannerProps, type BannerVariant, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonHierarchy, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardLevel, type CardProps, ChatBubble, type ChatBubbleProps, type ChatBubbleVariant, ChatInput, type ChatInputProps, Checkbox, type CheckboxProps, ConfirmDialog, type ConfirmDialogProps, type ConfirmDialogVariant, CreditsIndicator, type CreditsIndicatorProps, DataTable, type DataTableProps, DateInput, type DateInputProps, Divider, type DividerProps, Dropzone, type DropzoneProps, EmptyState, type EmptyStateProps, FileCard, type FileCardProps, type FilterTabItem, FilterTabs, type FilterTabsProps, FlyoutMenu, type FlyoutMenuItem, type FlyoutMenuProps, GlassPopover, type GlassPopoverProps, Header, type HeaderProps, Icon, type IconComponent, type IconProps, type IconSize, Input, InputGroup, type InputGroupProps, type InputProps, LanguageSelector, type LanguageSelectorOption, type LanguageSelectorProps, type MalixTheme, MalixThemeProvider, Modal, type ModalProps, OnboardingPopover, type OnboardingPopoverProps, OperationStatus, type OperationStatusProps, type OperationStatusType, Overlay, type OverlayProps, Pagination, type PaginationProps, type PaginationVariant, Pill, type PillProps, type PillVariant, PricingCard, type PricingCardProps, ProgressBar, type ProgressBarProps, type ProgressBarVariant, Radio, type RadioProps, SearchInput, SectionHeader, type SectionHeaderProps, SegmentedControl, type SegmentedControlItem, type SegmentedControlProps, Select, SelectGroup, type SelectGroupProps, type SelectOption, type SelectProps, SelectionCard, type SelectionCardProps, SidebarItem, type SidebarItemProps, SidebarPanel, type SidebarPanelProps, SplitPane, type SplitPaneProps, StatCard, type StatCardChangeType, type StatCardProps, StatusDot, type StatusDotProps, type StatusDotVariant, type StepItem, type StepStatus, Stepper, type StepperProps, TabBar, type TabBarProps, type TabItem, type TableColumn, type TableRow, Textarea, type TextareaProps, Toggle, type ToggleProps, Tooltip, type TooltipPlacement, type TooltipProps, type UserProfileMenuItem, UserProfilePopover, type UserProfilePopoverProps, ValidationAlert, type ValidationAlertProps, type ValidationAlertVariant, tokens_registry as tokenRegistry, useMalixTheme };
756
+ export { type AIAssistantMessage, AIAssistantPanel, type AIAssistantPanelProps, Accordion, type AccordionProps, Avatar, type AvatarProps, Badge, type BadgeProps, type BadgeVariant, Banner, type BannerProps, type BannerVariant, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonHierarchy, type ButtonProps, type ButtonSize, type ButtonVariant, Card, type CardLevel, type CardProps, ChatBubble, type ChatBubbleProps, type ChatBubbleVariant, ChatInput, type ChatInputProps, Checkbox, type CheckboxProps, ConfirmDialog, type ConfirmDialogProps, type ConfirmDialogVariant, CreditsIndicator, type CreditsIndicatorProps, DataTable, type DataTableProps, DateInput, type DateInputProps, Dialog, type DialogBodyProps, type DialogFooterProps, type DialogHeaderProps, type DialogProps, type DialogSize, type DialogVariant, Divider, type DividerProps, Dropzone, type DropzoneProps, EmptyState, type EmptyStateProps, FileCard, type FileCardProps, type FilterTabItem, FilterTabs, type FilterTabsProps, FlyoutMenu, type FlyoutMenuItem, type FlyoutMenuProps, GlassPopover, type GlassPopoverProps, Header, type HeaderProps, Icon, type IconComponent, type IconProps, type IconSize, Input, InputGroup, type InputGroupProps, type InputProps, LanguageSelector, type LanguageSelectorOption, type LanguageSelectorProps, type MalixTheme, MalixThemeProvider, Modal, type ModalProps, OnboardingPopover, type OnboardingPopoverProps, OperationStatus, type OperationStatusProps, type OperationStatusType, Overlay, type OverlayProps, Pagination, type PaginationProps, type PaginationVariant, Pill, type PillProps, type PillVariant, PricingCard, type PricingCardProps, ProgressBar, type ProgressBarProps, type ProgressBarVariant, Radio, type RadioProps, SearchInput, SectionHeader, type SectionHeaderProps, SegmentedControl, type SegmentedControlItem, type SegmentedControlProps, Select, SelectGroup, type SelectGroupProps, type SelectOption, type SelectProps, SelectionCard, type SelectionCardProps, SidebarItem, type SidebarItemProps, SidebarPanel, type SidebarPanelProps, SplitPane, type SplitPaneProps, StatCard, type StatCardChangeType, type StatCardProps, StatusDot, type StatusDotProps, type StatusDotVariant, type StepItem, type StepStatus, Stepper, type StepperProps, TabBar, type TabBarProps, type TabItem, type TableColumn, type TableRow, Textarea, type TextareaProps, Toggle, type ToggleProps, Tooltip, type TooltipPlacement, type TooltipProps, type UserProfileMenuItem, UserProfilePopover, type UserProfilePopoverProps, ValidationAlert, type ValidationAlertProps, type ValidationAlertVariant, tokens_registry as tokenRegistry, useMalixTheme };