@common-origin/design-system 1.13.0 → 1.14.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.
- package/dist/components/molecules/Sheet/Sheet.d.ts +96 -0
- package/dist/components/molecules/Sheet/index.d.ts +2 -0
- package/dist/components/molecules/index.d.ts +1 -0
- package/dist/index.esm.js +349 -148
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +349 -147
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the Sheet component
|
|
4
|
+
*/
|
|
5
|
+
export interface SheetProps {
|
|
6
|
+
/**
|
|
7
|
+
* Whether the sheet is open
|
|
8
|
+
*/
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Callback fired when the sheet should close
|
|
12
|
+
*/
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
/**
|
|
15
|
+
* Position of the sheet
|
|
16
|
+
* @default 'right'
|
|
17
|
+
*/
|
|
18
|
+
position?: 'top' | 'right' | 'bottom' | 'left';
|
|
19
|
+
/**
|
|
20
|
+
* Variant of the sheet
|
|
21
|
+
* - 'sheet': Full height/width edge-to-edge
|
|
22
|
+
* - 'drawer': Floating with rounded corners and margin
|
|
23
|
+
* @default 'sheet'
|
|
24
|
+
*/
|
|
25
|
+
variant?: 'sheet' | 'drawer';
|
|
26
|
+
/**
|
|
27
|
+
* Width of the sheet (for left/right positions)
|
|
28
|
+
* @default '400px'
|
|
29
|
+
*/
|
|
30
|
+
width?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Height of the sheet (for top/bottom positions)
|
|
33
|
+
* @default '400px'
|
|
34
|
+
*/
|
|
35
|
+
height?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Content to display in the sheet
|
|
38
|
+
*/
|
|
39
|
+
children?: ReactNode;
|
|
40
|
+
/**
|
|
41
|
+
* Whether clicking the overlay should close the sheet
|
|
42
|
+
* @default true
|
|
43
|
+
*/
|
|
44
|
+
closeOnOverlayClick?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Whether pressing Escape should close the sheet
|
|
47
|
+
* @default true
|
|
48
|
+
*/
|
|
49
|
+
closeOnEscape?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Optional title for the sheet (improves accessibility)
|
|
52
|
+
*/
|
|
53
|
+
title?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Test identifier for automated testing
|
|
56
|
+
*/
|
|
57
|
+
'data-testid'?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Accessible label for the sheet
|
|
60
|
+
*/
|
|
61
|
+
'aria-label'?: string;
|
|
62
|
+
/**
|
|
63
|
+
* ID of element describing the sheet
|
|
64
|
+
*/
|
|
65
|
+
'aria-describedby'?: string;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Sheet component for side panels and drawers
|
|
69
|
+
*
|
|
70
|
+
* Provides a sliding panel that appears from any edge of the screen.
|
|
71
|
+
* Can be used for navigation menus, filters, forms, or additional content.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```tsx
|
|
75
|
+
* // Right-positioned sheet (default)
|
|
76
|
+
* <Sheet isOpen={isOpen} onClose={() => setIsOpen(false)}>
|
|
77
|
+
* <h2>Sheet Content</h2>
|
|
78
|
+
* <p>Your content here</p>
|
|
79
|
+
* </Sheet>
|
|
80
|
+
*
|
|
81
|
+
* // Drawer variant from bottom
|
|
82
|
+
* <Sheet
|
|
83
|
+
* isOpen={isOpen}
|
|
84
|
+
* onClose={() => setIsOpen(false)}
|
|
85
|
+
* position="bottom"
|
|
86
|
+
* variant="drawer"
|
|
87
|
+
* height="60vh"
|
|
88
|
+
* >
|
|
89
|
+
* <h2>Mobile Menu</h2>
|
|
90
|
+
* </Sheet>
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export declare const Sheet: {
|
|
94
|
+
({ isOpen, onClose, position, variant, width, height, children, closeOnOverlayClick, closeOnEscape, title, "data-testid": dataTestId, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, }: SheetProps): import("react").JSX.Element | null;
|
|
95
|
+
displayName: string;
|
|
96
|
+
};
|