rupoui 1.5.0 → 1.6.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/README.md +46 -0
- package/dist/components/drawer/Drawer.d.ts +7 -0
- package/dist/components/drawer/DrawerContent.d.ts +3 -0
- package/dist/components/drawer/DrawerLayout.d.ts +6 -0
- package/dist/components/drawer/DrawerTrigger.d.ts +5 -0
- package/dist/components/drawer/context.d.ts +13 -0
- package/dist/components/drawer/drawer.styles.d.ts +166 -0
- package/dist/components/drawer/drawer.types.d.ts +51 -0
- package/dist/components/drawer/index.d.ts +6 -0
- package/dist/components/drawer/useDrawer.d.ts +11 -0
- package/dist/index.cjs +2 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2363 -2129
- package/dist/provider/types.d.ts +3 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -704,6 +704,52 @@ import { Button, Popover, PopoverContent, PopoverTrigger } from "rupoui";
|
|
|
704
704
|
- `showArrow`: Whether to show an arrow (on `PopoverContent`).
|
|
705
705
|
- `motionPreset`: `scale` (default), `fade`, `slide` (on `PopoverContent`).
|
|
706
706
|
|
|
707
|
+
### Drawer
|
|
708
|
+
|
|
709
|
+
A panel that slides out from the edge of the screen, commonly used for navigation, details, or settings.
|
|
710
|
+
|
|
711
|
+
```tsx
|
|
712
|
+
import {
|
|
713
|
+
Button,
|
|
714
|
+
Drawer,
|
|
715
|
+
DrawerBody,
|
|
716
|
+
DrawerContent,
|
|
717
|
+
DrawerFooter,
|
|
718
|
+
DrawerHeader,
|
|
719
|
+
DrawerTitle,
|
|
720
|
+
DrawerTrigger,
|
|
721
|
+
} from "rupoui";
|
|
722
|
+
|
|
723
|
+
<Drawer side="right" backdrop="blur">
|
|
724
|
+
<DrawerTrigger>
|
|
725
|
+
<Button>Open Drawer</Button>
|
|
726
|
+
</DrawerTrigger>
|
|
727
|
+
<DrawerContent>
|
|
728
|
+
<DrawerHeader>
|
|
729
|
+
<DrawerTitle>Edit Profile</DrawerTitle>
|
|
730
|
+
</DrawerHeader>
|
|
731
|
+
<DrawerBody>
|
|
732
|
+
<p>Make changes to your profile here.</p>
|
|
733
|
+
</DrawerBody>
|
|
734
|
+
<DrawerFooter>
|
|
735
|
+
<Button variant="light">Cancel</Button>
|
|
736
|
+
<Button color="primary">Save</Button>
|
|
737
|
+
</DrawerFooter>
|
|
738
|
+
</DrawerContent>
|
|
739
|
+
</Drawer>;
|
|
740
|
+
```
|
|
741
|
+
|
|
742
|
+
**Props:**
|
|
743
|
+
|
|
744
|
+
- `open` / `defaultOpen` / `onOpenChange`: Controlled and uncontrolled state management.
|
|
745
|
+
- `side`: `left`, `right` (default), `top`, `bottom`.
|
|
746
|
+
- `radius`: `none`, `sm`, `md`, `lg` (default), `xl`.
|
|
747
|
+
- `backdrop`: `opaque` (default), `blur`, `transparent`.
|
|
748
|
+
- `closeOnOverlayClick`: Whether clicking the overlay closes the drawer (default: `true`).
|
|
749
|
+
- `closeOnEscape`: Whether pressing Escape closes the drawer (default: `true`).
|
|
750
|
+
- `blockScrollOnOpen`: Whether to lock body scroll when open (default: `true`).
|
|
751
|
+
- `portal`: Whether to render inside a portal (default: `true`).
|
|
752
|
+
|
|
707
753
|
### Tabs
|
|
708
754
|
|
|
709
755
|
A component that allows users to switch between different views or functional aspects of an application.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { DrawerProps } from './drawer.types';
|
|
3
|
+
|
|
4
|
+
export interface DrawerComponentProps extends DrawerProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const Drawer: (props: DrawerComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DrawerBodyProps, DrawerFooterProps, DrawerHeaderProps, DrawerTitleProps } from './drawer.types';
|
|
2
|
+
|
|
3
|
+
export declare const DrawerHeader: ({ children, className, ...props }: DrawerHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const DrawerTitle: ({ children, className, ...props }: DrawerTitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare const DrawerBody: ({ children, className, ...props }: DrawerBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const DrawerFooter: ({ children, className, ...props }: DrawerFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DrawerProps } from './drawer.types';
|
|
2
|
+
|
|
3
|
+
export interface DrawerContextProps extends Omit<DrawerProps, "children" | "open"> {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
contentId: string;
|
|
6
|
+
titleId: string;
|
|
7
|
+
bodyId: string;
|
|
8
|
+
open: () => void;
|
|
9
|
+
close: () => void;
|
|
10
|
+
toggle: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const DrawerContext: import('react').Context<DrawerContextProps | undefined>;
|
|
13
|
+
export declare const useDrawerContext: () => DrawerContextProps;
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
export declare const drawer: import('tailwind-variants').TVReturnType<{
|
|
2
|
+
side: {
|
|
3
|
+
left: {
|
|
4
|
+
wrapper: string;
|
|
5
|
+
content: string;
|
|
6
|
+
};
|
|
7
|
+
right: {
|
|
8
|
+
wrapper: string;
|
|
9
|
+
content: string;
|
|
10
|
+
};
|
|
11
|
+
top: {
|
|
12
|
+
wrapper: string;
|
|
13
|
+
content: string;
|
|
14
|
+
};
|
|
15
|
+
bottom: {
|
|
16
|
+
wrapper: string;
|
|
17
|
+
content: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
radius: {
|
|
21
|
+
none: {
|
|
22
|
+
content: string;
|
|
23
|
+
};
|
|
24
|
+
sm: {
|
|
25
|
+
content: string;
|
|
26
|
+
};
|
|
27
|
+
md: {
|
|
28
|
+
content: string;
|
|
29
|
+
};
|
|
30
|
+
lg: {
|
|
31
|
+
content: string;
|
|
32
|
+
};
|
|
33
|
+
xl: {
|
|
34
|
+
content: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
backdrop: {
|
|
38
|
+
transparent: {
|
|
39
|
+
overlay: string;
|
|
40
|
+
};
|
|
41
|
+
opaque: {
|
|
42
|
+
overlay: string;
|
|
43
|
+
};
|
|
44
|
+
blur: {
|
|
45
|
+
overlay: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
}, {
|
|
49
|
+
wrapper: string;
|
|
50
|
+
overlay: string;
|
|
51
|
+
content: string;
|
|
52
|
+
header: string;
|
|
53
|
+
title: string;
|
|
54
|
+
body: string;
|
|
55
|
+
footer: string;
|
|
56
|
+
}, undefined, {
|
|
57
|
+
side: {
|
|
58
|
+
left: {
|
|
59
|
+
wrapper: string;
|
|
60
|
+
content: string;
|
|
61
|
+
};
|
|
62
|
+
right: {
|
|
63
|
+
wrapper: string;
|
|
64
|
+
content: string;
|
|
65
|
+
};
|
|
66
|
+
top: {
|
|
67
|
+
wrapper: string;
|
|
68
|
+
content: string;
|
|
69
|
+
};
|
|
70
|
+
bottom: {
|
|
71
|
+
wrapper: string;
|
|
72
|
+
content: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
radius: {
|
|
76
|
+
none: {
|
|
77
|
+
content: string;
|
|
78
|
+
};
|
|
79
|
+
sm: {
|
|
80
|
+
content: string;
|
|
81
|
+
};
|
|
82
|
+
md: {
|
|
83
|
+
content: string;
|
|
84
|
+
};
|
|
85
|
+
lg: {
|
|
86
|
+
content: string;
|
|
87
|
+
};
|
|
88
|
+
xl: {
|
|
89
|
+
content: string;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
backdrop: {
|
|
93
|
+
transparent: {
|
|
94
|
+
overlay: string;
|
|
95
|
+
};
|
|
96
|
+
opaque: {
|
|
97
|
+
overlay: string;
|
|
98
|
+
};
|
|
99
|
+
blur: {
|
|
100
|
+
overlay: string;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
}, {
|
|
104
|
+
wrapper: string;
|
|
105
|
+
overlay: string;
|
|
106
|
+
content: string;
|
|
107
|
+
header: string;
|
|
108
|
+
title: string;
|
|
109
|
+
body: string;
|
|
110
|
+
footer: string;
|
|
111
|
+
}, import('tailwind-variants').TVReturnType<{
|
|
112
|
+
side: {
|
|
113
|
+
left: {
|
|
114
|
+
wrapper: string;
|
|
115
|
+
content: string;
|
|
116
|
+
};
|
|
117
|
+
right: {
|
|
118
|
+
wrapper: string;
|
|
119
|
+
content: string;
|
|
120
|
+
};
|
|
121
|
+
top: {
|
|
122
|
+
wrapper: string;
|
|
123
|
+
content: string;
|
|
124
|
+
};
|
|
125
|
+
bottom: {
|
|
126
|
+
wrapper: string;
|
|
127
|
+
content: string;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
radius: {
|
|
131
|
+
none: {
|
|
132
|
+
content: string;
|
|
133
|
+
};
|
|
134
|
+
sm: {
|
|
135
|
+
content: string;
|
|
136
|
+
};
|
|
137
|
+
md: {
|
|
138
|
+
content: string;
|
|
139
|
+
};
|
|
140
|
+
lg: {
|
|
141
|
+
content: string;
|
|
142
|
+
};
|
|
143
|
+
xl: {
|
|
144
|
+
content: string;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
backdrop: {
|
|
148
|
+
transparent: {
|
|
149
|
+
overlay: string;
|
|
150
|
+
};
|
|
151
|
+
opaque: {
|
|
152
|
+
overlay: string;
|
|
153
|
+
};
|
|
154
|
+
blur: {
|
|
155
|
+
overlay: string;
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
}, {
|
|
159
|
+
wrapper: string;
|
|
160
|
+
overlay: string;
|
|
161
|
+
content: string;
|
|
162
|
+
header: string;
|
|
163
|
+
title: string;
|
|
164
|
+
body: string;
|
|
165
|
+
footer: string;
|
|
166
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { VariantProps } from 'tailwind-variants';
|
|
3
|
+
import { drawer } from './drawer.styles';
|
|
4
|
+
|
|
5
|
+
export type DrawerSide = "left" | "right" | "top" | "bottom";
|
|
6
|
+
export type DrawerRadius = "none" | "sm" | "md" | "lg" | "xl";
|
|
7
|
+
export type DrawerBackdrop = "transparent" | "opaque" | "blur";
|
|
8
|
+
export interface DrawerProps {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
open?: boolean;
|
|
11
|
+
defaultOpen?: boolean;
|
|
12
|
+
onOpenChange?: (open: boolean) => void;
|
|
13
|
+
side?: DrawerSide;
|
|
14
|
+
closeOnOverlayClick?: boolean;
|
|
15
|
+
closeOnEscape?: boolean;
|
|
16
|
+
blockScrollOnOpen?: boolean;
|
|
17
|
+
portal?: boolean;
|
|
18
|
+
radius?: DrawerRadius;
|
|
19
|
+
backdrop?: DrawerBackdrop;
|
|
20
|
+
classNames?: {
|
|
21
|
+
wrapper?: string;
|
|
22
|
+
overlay?: string;
|
|
23
|
+
content?: string;
|
|
24
|
+
header?: string;
|
|
25
|
+
title?: string;
|
|
26
|
+
body?: string;
|
|
27
|
+
footer?: string;
|
|
28
|
+
};
|
|
29
|
+
id?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface DrawerContentProps {
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
className?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface DrawerHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
36
|
+
children: ReactNode;
|
|
37
|
+
className?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface DrawerTitleProps extends HTMLAttributes<HTMLHeadingElement> {
|
|
40
|
+
children: ReactNode;
|
|
41
|
+
className?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface DrawerBodyProps extends HTMLAttributes<HTMLDivElement> {
|
|
44
|
+
children: ReactNode;
|
|
45
|
+
className?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface DrawerFooterProps extends HTMLAttributes<HTMLDivElement> {
|
|
48
|
+
children: ReactNode;
|
|
49
|
+
className?: string;
|
|
50
|
+
}
|
|
51
|
+
export type DrawerVariants = VariantProps<typeof drawer>;
|