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 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,3 @@
1
+ import { DrawerContentProps } from './drawer.types';
2
+
3
+ export declare const DrawerContent: ({ children, className }: DrawerContentProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -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,5 @@
1
+ import { default as React } from 'react';
2
+
3
+ export declare const DrawerTrigger: ({ children }: {
4
+ children: React.ReactNode;
5
+ }) => 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>;
@@ -0,0 +1,6 @@
1
+ export * from './Drawer';
2
+ export * from './DrawerContent';
3
+ export * from './DrawerTrigger';
4
+ export * from './DrawerLayout';
5
+ export * from './drawer.types';
6
+ export * from './useDrawer';
@@ -0,0 +1,11 @@
1
+ import { DrawerProps } from './drawer.types';
2
+
3
+ export declare function useDrawer(props: DrawerProps): {
4
+ isOpen: boolean;
5
+ open: () => void;
6
+ close: () => void;
7
+ toggle: () => void;
8
+ contentId: string;
9
+ titleId: string;
10
+ bodyId: string;
11
+ };