rupoui 1.3.7 → 1.4.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
@@ -248,6 +248,61 @@ import { DatePicker } from "rupoui";
248
248
  - `size`: `sm`, `md`, `lg`.
249
249
  - `radius`: `sm`, `md`, `lg`, `full`.
250
250
 
251
+ ### DateRangePicker
252
+
253
+ A component for selecting a start and end date with calendar range selection, hover preview, and text/segmented input modes.
254
+
255
+ ```tsx
256
+ import { DateRangePicker } from "rupoui";
257
+ import { useState } from "react";
258
+
259
+ const Example = () => {
260
+ const [range, setRange] = useState<{ start: Date | null; end: Date | null }>({
261
+ start: null,
262
+ end: null,
263
+ });
264
+
265
+ return (
266
+ <>
267
+ <DateRangePicker
268
+ label="Travel Dates"
269
+ value={range}
270
+ onChange={setRange}
271
+ />
272
+
273
+ <DateRangePicker
274
+ label="Range (Two Inputs)"
275
+ rangeInput="two"
276
+ value={range}
277
+ onChange={setRange}
278
+ />
279
+
280
+ <DateRangePicker
281
+ label="Range (Segmented)"
282
+ inputMode="segmented"
283
+ value={range}
284
+ onChange={setRange}
285
+ />
286
+ </>
287
+ );
288
+ };
289
+ ```
290
+
291
+ **Props:**
292
+
293
+ - **Field Props**: `label`, `description`, `errorMessage`, `fullWidth`.
294
+ - **State**: `value`, `defaultValue`, `onChange`.
295
+ - **Validation**: `isInvalid`, `isDisabled`, `isReadOnly`, `minDate`, `maxDate`, `disabledDates`.
296
+ - **Range Input**:
297
+ - `rangeInput`: `single` (default) or `two`.
298
+ - `separator`: separator string between start/end (default: ` – `).
299
+ - `inputMode`: `text` (default) or `segmented`.
300
+ - **Style Variants**:
301
+ - `variant`: `solid` (default), `bordered`, `flat`, `ghost`.
302
+ - `color`: `primary`, `secondary`, `success`, `warning`, `danger`.
303
+ - `size`: `sm`, `md`, `lg`.
304
+ - `radius`: `sm`, `md`, `lg`, `full`.
305
+
251
306
  ### Calendar
252
307
 
253
308
  A pure renderer component for displaying a calendar grid with full keyboard navigation and accessibility support. It uses an external engine for state management, giving you complete control over the calendar's behavior.
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { CardProps } from './card.types';
3
+
4
+ export declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLElement>>;
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ import { CardBodyProps, CardFooterProps, CardHeaderProps } from './card.types';
3
+
4
+ export declare const CardHeader: React.ForwardRefExoticComponent<CardHeaderProps & React.RefAttributes<HTMLDivElement>>;
5
+ export declare const CardBody: React.ForwardRefExoticComponent<CardBodyProps & React.RefAttributes<HTMLDivElement>>;
6
+ export declare const CardFooter: React.ForwardRefExoticComponent<CardFooterProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,238 @@
1
+ export declare const card: import('tailwind-variants').TVReturnType<{
2
+ variant: {
3
+ solid: {
4
+ base: string;
5
+ };
6
+ bordered: {
7
+ base: string;
8
+ };
9
+ flat: {
10
+ base: string;
11
+ };
12
+ ghost: {
13
+ base: string;
14
+ };
15
+ };
16
+ color: {
17
+ default: {};
18
+ primary: {};
19
+ secondary: {};
20
+ success: {};
21
+ warning: {};
22
+ danger: {};
23
+ };
24
+ radius: {
25
+ none: {
26
+ base: string;
27
+ };
28
+ sm: {
29
+ base: string;
30
+ };
31
+ md: {
32
+ base: string;
33
+ };
34
+ lg: {
35
+ base: string;
36
+ };
37
+ xl: {
38
+ base: string;
39
+ };
40
+ };
41
+ shadow: {
42
+ none: {
43
+ base: string;
44
+ };
45
+ sm: {
46
+ base: string;
47
+ };
48
+ md: {
49
+ base: string;
50
+ };
51
+ lg: {
52
+ base: string;
53
+ };
54
+ };
55
+ isHoverable: {
56
+ true: {
57
+ base: string;
58
+ };
59
+ };
60
+ isClickable: {
61
+ true: {
62
+ base: string[];
63
+ };
64
+ };
65
+ isBlurred: {
66
+ true: {
67
+ base: string;
68
+ };
69
+ };
70
+ fullWidth: {
71
+ true: {
72
+ base: string;
73
+ };
74
+ };
75
+ }, {
76
+ base: string[];
77
+ header: string;
78
+ body: string;
79
+ footer: string;
80
+ }, undefined, {
81
+ variant: {
82
+ solid: {
83
+ base: string;
84
+ };
85
+ bordered: {
86
+ base: string;
87
+ };
88
+ flat: {
89
+ base: string;
90
+ };
91
+ ghost: {
92
+ base: string;
93
+ };
94
+ };
95
+ color: {
96
+ default: {};
97
+ primary: {};
98
+ secondary: {};
99
+ success: {};
100
+ warning: {};
101
+ danger: {};
102
+ };
103
+ radius: {
104
+ none: {
105
+ base: string;
106
+ };
107
+ sm: {
108
+ base: string;
109
+ };
110
+ md: {
111
+ base: string;
112
+ };
113
+ lg: {
114
+ base: string;
115
+ };
116
+ xl: {
117
+ base: string;
118
+ };
119
+ };
120
+ shadow: {
121
+ none: {
122
+ base: string;
123
+ };
124
+ sm: {
125
+ base: string;
126
+ };
127
+ md: {
128
+ base: string;
129
+ };
130
+ lg: {
131
+ base: string;
132
+ };
133
+ };
134
+ isHoverable: {
135
+ true: {
136
+ base: string;
137
+ };
138
+ };
139
+ isClickable: {
140
+ true: {
141
+ base: string[];
142
+ };
143
+ };
144
+ isBlurred: {
145
+ true: {
146
+ base: string;
147
+ };
148
+ };
149
+ fullWidth: {
150
+ true: {
151
+ base: string;
152
+ };
153
+ };
154
+ }, {
155
+ base: string[];
156
+ header: string;
157
+ body: string;
158
+ footer: string;
159
+ }, import('tailwind-variants').TVReturnType<{
160
+ variant: {
161
+ solid: {
162
+ base: string;
163
+ };
164
+ bordered: {
165
+ base: string;
166
+ };
167
+ flat: {
168
+ base: string;
169
+ };
170
+ ghost: {
171
+ base: string;
172
+ };
173
+ };
174
+ color: {
175
+ default: {};
176
+ primary: {};
177
+ secondary: {};
178
+ success: {};
179
+ warning: {};
180
+ danger: {};
181
+ };
182
+ radius: {
183
+ none: {
184
+ base: string;
185
+ };
186
+ sm: {
187
+ base: string;
188
+ };
189
+ md: {
190
+ base: string;
191
+ };
192
+ lg: {
193
+ base: string;
194
+ };
195
+ xl: {
196
+ base: string;
197
+ };
198
+ };
199
+ shadow: {
200
+ none: {
201
+ base: string;
202
+ };
203
+ sm: {
204
+ base: string;
205
+ };
206
+ md: {
207
+ base: string;
208
+ };
209
+ lg: {
210
+ base: string;
211
+ };
212
+ };
213
+ isHoverable: {
214
+ true: {
215
+ base: string;
216
+ };
217
+ };
218
+ isClickable: {
219
+ true: {
220
+ base: string[];
221
+ };
222
+ };
223
+ isBlurred: {
224
+ true: {
225
+ base: string;
226
+ };
227
+ };
228
+ fullWidth: {
229
+ true: {
230
+ base: string;
231
+ };
232
+ };
233
+ }, {
234
+ base: string[];
235
+ header: string;
236
+ body: string;
237
+ footer: string;
238
+ }, undefined, unknown, unknown, undefined>>;
@@ -0,0 +1,40 @@
1
+ import { HTMLMotionProps } from 'framer-motion';
2
+ import { HTMLAttributes, ReactNode } from 'react';
3
+ import { card } from './card.styles';
4
+
5
+ export type CardVariant = "solid" | "bordered" | "flat" | "ghost";
6
+ export type CardColor = "default" | "primary" | "secondary" | "success" | "warning" | "danger";
7
+ export type CardRadius = "none" | "sm" | "md" | "lg" | "xl";
8
+ export type CardShadow = "none" | "sm" | "md" | "lg";
9
+ export type CardSlots = keyof ReturnType<typeof card>;
10
+ export interface CardProps extends Omit<HTMLMotionProps<"div">, "color" | "onClick" | "ref"> {
11
+ children: ReactNode;
12
+ variant?: CardVariant;
13
+ color?: CardColor;
14
+ radius?: CardRadius;
15
+ shadow?: CardShadow;
16
+ isHoverable?: boolean;
17
+ isClickable?: boolean;
18
+ isBlurred?: boolean;
19
+ fullWidth?: boolean;
20
+ onClick?: (event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>) => void;
21
+ className?: string;
22
+ classNames?: {
23
+ base?: string;
24
+ header?: string;
25
+ body?: string;
26
+ footer?: string;
27
+ };
28
+ }
29
+ export interface CardHeaderProps extends HTMLAttributes<HTMLDivElement> {
30
+ children?: ReactNode;
31
+ className?: string;
32
+ }
33
+ export interface CardBodyProps extends HTMLAttributes<HTMLDivElement> {
34
+ children?: ReactNode;
35
+ className?: string;
36
+ }
37
+ export interface CardFooterProps extends HTMLAttributes<HTMLDivElement> {
38
+ children?: ReactNode;
39
+ className?: string;
40
+ }
@@ -0,0 +1,15 @@
1
+ import { CardProps } from './card.types';
2
+
3
+ export interface CardContextValue {
4
+ variant: NonNullable<CardProps["variant"]>;
5
+ color: NonNullable<CardProps["color"]>;
6
+ radius: NonNullable<CardProps["radius"]>;
7
+ shadow: NonNullable<CardProps["shadow"]>;
8
+ isHoverable: boolean;
9
+ isClickable: boolean;
10
+ isBlurred: boolean;
11
+ fullWidth: boolean;
12
+ classNames?: CardProps["classNames"];
13
+ }
14
+ export declare const CardContext: import('react').Context<CardContextValue | null>;
15
+ export declare const useCardContext: () => CardContextValue;
@@ -0,0 +1,4 @@
1
+ export * from './Card';
2
+ export * from './CardLayout';
3
+ export * from './card.types';
4
+ export * from './card.styles';