@common-origin/design-system 2.8.2 → 2.10.0

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.
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { IconName } from '../../atoms/Icon';
2
+ import { type IconName } from '../../atoms/Icon';
3
3
  export type AccountType = 'checking' | 'savings' | 'credit' | 'investment' | 'loan';
4
4
  export type TrendDirection = 'up' | 'down' | 'neutral';
5
5
  export interface AccountCardAction {
@@ -39,6 +39,6 @@ export interface AccountCardProps {
39
39
  * name, balance, optional trend indicator, and action buttons. Minimum
40
40
  * 300x200px with elevation and hover effects.
41
41
  *
42
- * Composes: Stack, Box, Icon, Typography, MoneyDisplay, Button
42
+ * Composes: Stack, Box, Avatar, Typography, MoneyDisplay, Button
43
43
  */
44
44
  export declare const AccountCard: React.FC<AccountCardProps>;
@@ -0,0 +1,65 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type IconName } from '../../../types/icons';
3
+ export type ModalSize = 'small' | 'medium' | 'large';
4
+ export interface ModalAction {
5
+ /** Button label text */
6
+ label: string;
7
+ /** Callback when the action is clicked */
8
+ onClick: () => void;
9
+ /** Button variant */
10
+ variant?: 'primary' | 'secondary' | 'naked' | 'emphasis' | 'danger';
11
+ /** Optional leading icon */
12
+ icon?: IconName;
13
+ /** Whether the button is disabled */
14
+ disabled?: boolean;
15
+ }
16
+ export interface ModalProps {
17
+ /** Whether the modal is visible */
18
+ isOpen: boolean;
19
+ /** Callback fired when the modal should close (close button, overlay, Escape) */
20
+ onClose: () => void;
21
+ /** Title displayed in the modal header */
22
+ title: string;
23
+ /** Body content of the modal */
24
+ children: ReactNode;
25
+ /**
26
+ * Width preset. All sizes auto-switch to fullscreen below the `md` breakpoint (768 px).
27
+ * - small → 400 px
28
+ * - medium → 560 px
29
+ * - large → 720 px
30
+ * @default 'medium'
31
+ */
32
+ size?: ModalSize;
33
+ /** Structured action buttons rendered in the footer */
34
+ actions?: ModalAction[];
35
+ /**
36
+ * Close when the backdrop overlay is clicked
37
+ * @default true
38
+ */
39
+ closeOnOverlayClick?: boolean;
40
+ /**
41
+ * Close when the Escape key is pressed
42
+ * @default true
43
+ */
44
+ closeOnEscape?: boolean;
45
+ /** Test identifier for automated testing */
46
+ 'data-testid'?: string;
47
+ /** Accessible label – falls back to `title` */
48
+ 'aria-label'?: string;
49
+ /** ID of an element that describes the modal */
50
+ 'aria-describedby'?: string;
51
+ }
52
+ /**
53
+ * Modal component
54
+ *
55
+ * A centred dialog overlay with a title, close button (IconButton), scrollable
56
+ * body content, and an optional footer with structured action buttons.
57
+ *
58
+ * - Renders via `createPortal` to avoid z-index / overflow issues.
59
+ * - Auto-fullscreen on viewports narrower than 768 px.
60
+ * - Focus trap, Escape-to-close, overlay-click-to-close.
61
+ * - Locks body scroll while open.
62
+ *
63
+ * Composes: IconButton, Button, Typography, Stack, Divider
64
+ */
65
+ export declare const Modal: React.FC<ModalProps>;
@@ -0,0 +1,2 @@
1
+ export { Modal } from './Modal';
2
+ export type { ModalProps, ModalAction, ModalSize } from './Modal';
@@ -13,6 +13,7 @@ export * from './EmptyState';
13
13
  export * from './FeatureBlock';
14
14
  export * from './Dropdown';
15
15
  export * from './List';
16
+ export * from './Modal';
16
17
  export * from './NumberInput';
17
18
  export * from './PageTitle';
18
19
  export * from './PasswordField';