@rehagro/ui 0.1.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.
@@ -0,0 +1,361 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React$1 from 'react';
3
+
4
+ type ToastVariant = "info" | "warning" | "success" | "error" | "neutral";
5
+ type ToastAppearance = "solid" | "light" | "outline";
6
+ type ToastLink = {
7
+ label: string;
8
+ href?: string;
9
+ onClick?: () => void;
10
+ };
11
+ type ToastProps = React$1.HTMLAttributes<HTMLDivElement> & {
12
+ /** Toast title */
13
+ title: string;
14
+ /** Optional description below the title */
15
+ description?: string;
16
+ /** Optional link below the content */
17
+ link?: ToastLink;
18
+ /** Visual variant */
19
+ variant?: ToastVariant;
20
+ /** Visual appearance */
21
+ appearance?: ToastAppearance;
22
+ /** Callback when the close button is clicked */
23
+ onClose?: () => void;
24
+ };
25
+ declare const Toast: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & {
26
+ /** Toast title */
27
+ title: string;
28
+ /** Optional description below the title */
29
+ description?: string;
30
+ /** Optional link below the content */
31
+ link?: ToastLink;
32
+ /** Visual variant */
33
+ variant?: ToastVariant;
34
+ /** Visual appearance */
35
+ appearance?: ToastAppearance;
36
+ /** Callback when the close button is clicked */
37
+ onClose?: () => void;
38
+ } & React$1.RefAttributes<HTMLDivElement>>;
39
+
40
+ type ToastPosition = "top-right" | "top-left" | "top-center" | "bottom-right" | "bottom-left" | "bottom-center";
41
+ type ToastItem = {
42
+ id: string;
43
+ title: string;
44
+ description?: string;
45
+ link?: ToastLink;
46
+ variant: ToastVariant;
47
+ appearance: ToastAppearance;
48
+ /** Auto-dismiss duration in ms. 0 = permanent. Default: 5000 */
49
+ duration: number;
50
+ };
51
+ type ToastOptions = {
52
+ description?: string;
53
+ link?: ToastLink;
54
+ appearance?: ToastAppearance;
55
+ /** Auto-dismiss duration in ms. 0 = permanent. Default: 5000 */
56
+ duration?: number;
57
+ };
58
+ type ToastFn = {
59
+ (title: string, options?: ToastOptions): string;
60
+ info: (title: string, options?: ToastOptions) => string;
61
+ warning: (title: string, options?: ToastOptions) => string;
62
+ success: (title: string, options?: ToastOptions) => string;
63
+ error: (title: string, options?: ToastOptions) => string;
64
+ neutral: (title: string, options?: ToastOptions) => string;
65
+ dismiss: (id: string) => void;
66
+ };
67
+ type ToastProviderProps = {
68
+ children: React$1.ReactNode;
69
+ /** Position of the toast container. Default: "top-right" */
70
+ position?: ToastPosition;
71
+ };
72
+ declare function ToastProvider({ children, position, }: ToastProviderProps): react_jsx_runtime.JSX.Element;
73
+ declare function useToast(): {
74
+ toast: ToastFn;
75
+ };
76
+
77
+ declare function ToastContainer(): react_jsx_runtime.JSX.Element | null;
78
+
79
+ type RehagroTheme = {
80
+ /** Brand colors — accepts "#RRGGBB", "r g b", or "rgb(r,g,b)" */
81
+ primary?: string;
82
+ primaryHover?: string;
83
+ secondary?: string;
84
+ secondaryHover?: string;
85
+ danger?: string;
86
+ dangerHover?: string;
87
+ warning?: string;
88
+ success?: string;
89
+ /** Semantic colors */
90
+ text?: string;
91
+ textMuted?: string;
92
+ surface?: string;
93
+ background?: string;
94
+ border?: string;
95
+ ring?: string;
96
+ /** Border radius (xxs:4 → xs:8 → sm:12 → md:16 → lg:24 → xl:32) */
97
+ radiusXxs?: string;
98
+ radiusXs?: string;
99
+ radiusSm?: string;
100
+ radiusMd?: string;
101
+ radiusLg?: string;
102
+ radiusXl?: string;
103
+ /** Border width */
104
+ borderWidthSm?: string;
105
+ borderWidthMd?: string;
106
+ borderWidthLg?: string;
107
+ /** Input sizes */
108
+ inputHeightSm?: string;
109
+ inputHeightMd?: string;
110
+ inputHeightLg?: string;
111
+ inputPxSm?: string;
112
+ inputPxMd?: string;
113
+ inputPxLg?: string;
114
+ };
115
+ type RehagroProviderProps = {
116
+ /** Theme overrides — any token not provided keeps the default value */
117
+ theme?: RehagroTheme;
118
+ /** Toast container position. Default: "top-right" */
119
+ toastPosition?: ToastPosition;
120
+ children: React.ReactNode;
121
+ };
122
+
123
+ declare function RehagroProvider({ theme, toastPosition, children }: RehagroProviderProps): react_jsx_runtime.JSX.Element;
124
+
125
+ type ButtonVariant = "solid" | "outline" | "ghost";
126
+ type ButtonSize = "sm" | "md" | "lg";
127
+ type ButtonRadius = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "full";
128
+ type ButtonProps = React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
129
+ /** Visual style variant */
130
+ variant?: ButtonVariant;
131
+ /** Button size */
132
+ size?: ButtonSize;
133
+ /** Border radius */
134
+ radius?: ButtonRadius;
135
+ /** Shows loading state and disables interaction */
136
+ loading?: boolean;
137
+ /** Icon rendered to the left of children (hidden when loading) */
138
+ leftIcon?: React$1.ReactNode;
139
+ /** Icon rendered to the right of children (hidden when loading) */
140
+ rightIcon?: React$1.ReactNode;
141
+ };
142
+ declare const Button: React$1.ForwardRefExoticComponent<React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
143
+ /** Visual style variant */
144
+ variant?: ButtonVariant;
145
+ /** Button size */
146
+ size?: ButtonSize;
147
+ /** Border radius */
148
+ radius?: ButtonRadius;
149
+ /** Shows loading state and disables interaction */
150
+ loading?: boolean;
151
+ /** Icon rendered to the left of children (hidden when loading) */
152
+ leftIcon?: React$1.ReactNode;
153
+ /** Icon rendered to the right of children (hidden when loading) */
154
+ rightIcon?: React$1.ReactNode;
155
+ } & React$1.RefAttributes<HTMLButtonElement>>;
156
+
157
+ type IconButtonVariant = "solid" | "outline" | "ghost";
158
+ type IconButtonSize = "sm" | "md" | "lg";
159
+ type IconButtonRadius = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "full";
160
+ type IconButtonColor = "primary" | "danger" | "warning" | "success" | "secondary";
161
+ type IconButtonProps = React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
162
+ /** Visual style variant */
163
+ variant?: IconButtonVariant;
164
+ /** Button size */
165
+ size?: IconButtonSize;
166
+ /** Border radius */
167
+ radius?: IconButtonRadius;
168
+ /** Color scheme */
169
+ color?: IconButtonColor;
170
+ /** Shows loading state and disables interaction */
171
+ loading?: boolean;
172
+ };
173
+ declare const IconButton: React$1.ForwardRefExoticComponent<React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
174
+ /** Visual style variant */
175
+ variant?: IconButtonVariant;
176
+ /** Button size */
177
+ size?: IconButtonSize;
178
+ /** Border radius */
179
+ radius?: IconButtonRadius;
180
+ /** Color scheme */
181
+ color?: IconButtonColor;
182
+ /** Shows loading state and disables interaction */
183
+ loading?: boolean;
184
+ } & React$1.RefAttributes<HTMLButtonElement>>;
185
+
186
+ type TextInputStatus = "default" | "error";
187
+ type TextInputSize = "sm" | "md" | "lg";
188
+ type TextInputRadius = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "full";
189
+ type TextInputProps = Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "size"> & {
190
+ /** Label text displayed above the input */
191
+ label?: string;
192
+ /** Subtitle displayed next to the label */
193
+ subtitle?: string;
194
+ /** Validation status */
195
+ status?: TextInputStatus;
196
+ /** Input size */
197
+ size?: TextInputSize;
198
+ /** Border radius */
199
+ radius?: TextInputRadius;
200
+ /** Icon rendered to the left of the input */
201
+ leftIcon?: React$1.ReactNode;
202
+ /** Icon rendered to the right of the input */
203
+ rightIcon?: React$1.ReactNode;
204
+ /** Helper/error message displayed below the input (accepts ReactNode for flexibility) */
205
+ helperText?: React$1.ReactNode;
206
+ /** Custom class for the outermost wrapper */
207
+ wrapperClassName?: string;
208
+ };
209
+ declare const TextInput: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "size"> & {
210
+ /** Label text displayed above the input */
211
+ label?: string;
212
+ /** Subtitle displayed next to the label */
213
+ subtitle?: string;
214
+ /** Validation status */
215
+ status?: TextInputStatus;
216
+ /** Input size */
217
+ size?: TextInputSize;
218
+ /** Border radius */
219
+ radius?: TextInputRadius;
220
+ /** Icon rendered to the left of the input */
221
+ leftIcon?: React$1.ReactNode;
222
+ /** Icon rendered to the right of the input */
223
+ rightIcon?: React$1.ReactNode;
224
+ /** Helper/error message displayed below the input (accepts ReactNode for flexibility) */
225
+ helperText?: React$1.ReactNode;
226
+ /** Custom class for the outermost wrapper */
227
+ wrapperClassName?: string;
228
+ } & React$1.RefAttributes<HTMLInputElement>>;
229
+
230
+ type CheckboxSize = "sm" | "md" | "lg";
231
+ type CheckboxProps = Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
232
+ /** Checkbox size */
233
+ size?: CheckboxSize;
234
+ /** Label text displayed next to the checkbox */
235
+ label?: string;
236
+ /** Indeterminate state (partially checked) */
237
+ indeterminate?: boolean;
238
+ };
239
+ declare const Checkbox: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "type" | "size"> & {
240
+ /** Checkbox size */
241
+ size?: CheckboxSize;
242
+ /** Label text displayed next to the checkbox */
243
+ label?: string;
244
+ /** Indeterminate state (partially checked) */
245
+ indeterminate?: boolean;
246
+ } & React$1.RefAttributes<HTMLInputElement>>;
247
+
248
+ type SelectSize = "sm" | "md" | "lg";
249
+ type SelectRadius = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "full";
250
+ type SelectStatus = "default" | "error";
251
+ type SelectOption = {
252
+ /** Unique value for the option */
253
+ value: string;
254
+ /** Display label */
255
+ label: string;
256
+ /** Whether the option is disabled */
257
+ disabled?: boolean;
258
+ };
259
+ type SelectBaseProps = {
260
+ /** List of available options */
261
+ options: SelectOption[];
262
+ /** Label text displayed above the select */
263
+ label?: string;
264
+ /** Subtitle displayed next to the label */
265
+ subtitle?: string;
266
+ /** Placeholder text when no option is selected */
267
+ placeholder?: string;
268
+ /** Validation status */
269
+ status?: SelectStatus;
270
+ /** Select size */
271
+ size?: SelectSize;
272
+ /** Border radius */
273
+ radius?: SelectRadius;
274
+ /** Helper/error message displayed below the select */
275
+ helperText?: React$1.ReactNode;
276
+ /** Whether the select is disabled */
277
+ disabled?: boolean;
278
+ /** Custom class for the trigger container */
279
+ className?: string;
280
+ /** Custom class for the outermost wrapper */
281
+ wrapperClassName?: string;
282
+ };
283
+ type SelectSingleProps = SelectBaseProps & {
284
+ /** Enables multi-select mode */
285
+ multiple?: false;
286
+ /** Currently selected value (single mode) */
287
+ value?: string;
288
+ /** Default selected value (single mode, uncontrolled) */
289
+ defaultValue?: string;
290
+ /** Called when selection changes (single mode) */
291
+ onChange?: (value: string) => void;
292
+ };
293
+ type SelectMultipleProps = SelectBaseProps & {
294
+ /** Enables multi-select mode */
295
+ multiple: true;
296
+ /** Currently selected values (multi mode) */
297
+ value?: string[];
298
+ /** Default selected values (multi mode, uncontrolled) */
299
+ defaultValue?: string[];
300
+ /** Called when selection changes (multi mode) */
301
+ onChange?: (value: string[]) => void;
302
+ };
303
+ type SelectProps = SelectSingleProps | SelectMultipleProps;
304
+ declare const Select: React$1.ForwardRefExoticComponent<SelectProps & React$1.RefAttributes<HTMLButtonElement>>;
305
+
306
+ type TooltipVariant = "light" | "default" | "dark";
307
+ type TooltipSize = "sm" | "md";
308
+ type TooltipPlacement = "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end";
309
+ type TooltipProps = {
310
+ /** Tooltip title text */
311
+ title: string;
312
+ /** Optional description text below the title */
313
+ description?: string;
314
+ /** Visual style variant */
315
+ variant?: TooltipVariant;
316
+ /** Tooltip size */
317
+ size?: TooltipSize;
318
+ /** Placement relative to the trigger element */
319
+ placement?: TooltipPlacement;
320
+ /** Show a close button (only for md size with description) */
321
+ closable?: boolean;
322
+ /** Show an icon before the title */
323
+ icon?: React$1.ReactNode;
324
+ /** Controlled open state */
325
+ open?: boolean;
326
+ /** Callback when open state changes */
327
+ onOpenChange?: (open: boolean) => void;
328
+ /** Delay before showing tooltip (ms) */
329
+ enterDelay?: number;
330
+ /** Delay before hiding tooltip (ms) */
331
+ leaveDelay?: number;
332
+ /** The trigger element */
333
+ children: React$1.ReactElement;
334
+ /** Additional className for the tooltip container */
335
+ className?: string;
336
+ };
337
+ declare const Tooltip: React$1.ForwardRefExoticComponent<TooltipProps & React$1.RefAttributes<HTMLDivElement>>;
338
+
339
+ type IconProps = React$1.SVGAttributes<SVGSVGElement>;
340
+
341
+ declare const DeleteIcon: (props: IconProps) => react_jsx_runtime.JSX.Element;
342
+
343
+ declare const EditIcon: (props: IconProps) => react_jsx_runtime.JSX.Element;
344
+
345
+ declare const SearchIcon: (props: IconProps) => react_jsx_runtime.JSX.Element;
346
+
347
+ declare const PlusIcon: (props: IconProps) => react_jsx_runtime.JSX.Element;
348
+
349
+ declare const InfoIcon: (props: IconProps) => react_jsx_runtime.JSX.Element;
350
+
351
+ declare const WarningIcon: (props: IconProps) => react_jsx_runtime.JSX.Element;
352
+
353
+ declare const SuccessIcon: (props: IconProps) => react_jsx_runtime.JSX.Element;
354
+
355
+ declare const ErrorIcon: (props: IconProps) => react_jsx_runtime.JSX.Element;
356
+
357
+ declare const NeutralIcon: (props: IconProps) => react_jsx_runtime.JSX.Element;
358
+
359
+ declare const CloseIcon: (props: IconProps) => react_jsx_runtime.JSX.Element;
360
+
361
+ export { Button, type ButtonProps, type ButtonRadius, type ButtonSize, type ButtonVariant, Checkbox, type CheckboxProps, type CheckboxSize, CloseIcon, DeleteIcon, EditIcon, ErrorIcon, IconButton, type IconButtonColor, type IconButtonProps, type IconButtonRadius, type IconButtonSize, type IconButtonVariant, type IconProps, InfoIcon, NeutralIcon, PlusIcon, RehagroProvider, type RehagroProviderProps, type RehagroTheme, SearchIcon, Select, type SelectMultipleProps, type SelectOption, type SelectProps, type SelectRadius, type SelectSingleProps, type SelectSize, type SelectStatus, SuccessIcon, TextInput, type TextInputProps, type TextInputRadius, type TextInputSize, type TextInputStatus, Toast, type ToastAppearance, ToastContainer, type ToastFn, type ToastItem, type ToastLink, type ToastOptions, type ToastPosition, type ToastProps, ToastProvider, type ToastProviderProps, type ToastVariant, Tooltip, type TooltipPlacement, type TooltipProps, type TooltipSize, type TooltipVariant, WarningIcon, useToast };