@rehagro/ui 0.1.3 → 1.0.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,236 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React$1 from 'react';
3
+ import { PressableProps, StyleProp, ViewStyle, View, TextInputProps as TextInputProps$1, TextInput as TextInput$1, ViewProps } from 'react-native';
4
+
5
+ /** React Native theme — reuses the same token names as the web theme.
6
+ * Color values are plain CSS hex strings (e.g. "#16a34a").
7
+ * Spacing/radius/border values are numbers (device-independent pixels).
8
+ */
9
+ type RehagroNativeTheme = {
10
+ primary?: string;
11
+ primaryHover?: string;
12
+ secondary?: string;
13
+ secondaryHover?: string;
14
+ danger?: string;
15
+ dangerHover?: string;
16
+ warning?: string;
17
+ success?: string;
18
+ text?: string;
19
+ textMuted?: string;
20
+ surface?: string;
21
+ background?: string;
22
+ border?: string;
23
+ radiusXxs?: number;
24
+ radiusXs?: number;
25
+ radiusSm?: number;
26
+ radiusMd?: number;
27
+ radiusLg?: number;
28
+ radiusXl?: number;
29
+ borderWidthSm?: number;
30
+ borderWidthMd?: number;
31
+ borderWidthLg?: number;
32
+ inputHeightSm?: number;
33
+ inputHeightMd?: number;
34
+ inputHeightLg?: number;
35
+ };
36
+ type RehagroNativeProviderProps = {
37
+ /** Theme overrides — any token not provided keeps the default value */
38
+ theme?: RehagroNativeTheme;
39
+ children: React.ReactNode;
40
+ };
41
+
42
+ declare function RehagroNativeProvider({ theme, children }: RehagroNativeProviderProps): react_jsx_runtime.JSX.Element;
43
+
44
+ declare function useRehagroTheme(): Required<RehagroNativeTheme>;
45
+
46
+ type ButtonVariant = "solid" | "outline" | "ghost";
47
+ type ButtonSize = "sm" | "md" | "lg";
48
+ type ButtonRadius = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "full";
49
+ type ButtonProps = Omit<PressableProps, "style"> & {
50
+ /** Visual style variant */
51
+ variant?: ButtonVariant;
52
+ /** Button size */
53
+ size?: ButtonSize;
54
+ /** Border radius */
55
+ radius?: ButtonRadius;
56
+ /** Shows loading state and disables interaction */
57
+ loading?: boolean;
58
+ /** Icon rendered to the left of children (hidden when loading) */
59
+ leftIcon?: React$1.ReactNode;
60
+ /** Icon rendered to the right of children (hidden when loading) */
61
+ rightIcon?: React$1.ReactNode;
62
+ /** Label text */
63
+ children?: React$1.ReactNode;
64
+ /** Custom style for the outer Pressable */
65
+ style?: StyleProp<ViewStyle>;
66
+ };
67
+ declare const Button: React$1.ForwardRefExoticComponent<Omit<PressableProps, "style"> & {
68
+ /** Visual style variant */
69
+ variant?: ButtonVariant;
70
+ /** Button size */
71
+ size?: ButtonSize;
72
+ /** Border radius */
73
+ radius?: ButtonRadius;
74
+ /** Shows loading state and disables interaction */
75
+ loading?: boolean;
76
+ /** Icon rendered to the left of children (hidden when loading) */
77
+ leftIcon?: React$1.ReactNode;
78
+ /** Icon rendered to the right of children (hidden when loading) */
79
+ rightIcon?: React$1.ReactNode;
80
+ /** Label text */
81
+ children?: React$1.ReactNode;
82
+ /** Custom style for the outer Pressable */
83
+ style?: StyleProp<ViewStyle>;
84
+ } & React$1.RefAttributes<View>>;
85
+
86
+ type IconButtonVariant = "solid" | "outline" | "ghost";
87
+ type IconButtonSize = "sm" | "md" | "lg";
88
+ type IconButtonRadius = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "full";
89
+ type IconButtonColor = "primary" | "danger" | "warning" | "success" | "secondary";
90
+ type IconButtonProps = Omit<PressableProps, "style"> & {
91
+ /** Visual style variant */
92
+ variant?: IconButtonVariant;
93
+ /** Button size */
94
+ size?: IconButtonSize;
95
+ /** Border radius */
96
+ radius?: IconButtonRadius;
97
+ /** Color scheme */
98
+ color?: IconButtonColor;
99
+ /** Shows loading state and disables interaction */
100
+ loading?: boolean;
101
+ /** Icon content */
102
+ children?: React$1.ReactNode;
103
+ /** Custom style for the outer Pressable */
104
+ style?: StyleProp<ViewStyle>;
105
+ };
106
+ declare const IconButton: React$1.ForwardRefExoticComponent<Omit<PressableProps, "style"> & {
107
+ /** Visual style variant */
108
+ variant?: IconButtonVariant;
109
+ /** Button size */
110
+ size?: IconButtonSize;
111
+ /** Border radius */
112
+ radius?: IconButtonRadius;
113
+ /** Color scheme */
114
+ color?: IconButtonColor;
115
+ /** Shows loading state and disables interaction */
116
+ loading?: boolean;
117
+ /** Icon content */
118
+ children?: React$1.ReactNode;
119
+ /** Custom style for the outer Pressable */
120
+ style?: StyleProp<ViewStyle>;
121
+ } & React$1.RefAttributes<View>>;
122
+
123
+ type TextInputStatus = "default" | "error";
124
+ type TextInputSize = "sm" | "md" | "lg";
125
+ type TextInputRadius = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "full";
126
+ type TextInputProps = Omit<TextInputProps$1, "style"> & {
127
+ /** Label text displayed above the input */
128
+ label?: string;
129
+ /** Subtitle displayed next to the label */
130
+ subtitle?: string;
131
+ /** Validation status */
132
+ status?: TextInputStatus;
133
+ /** Input size */
134
+ size?: TextInputSize;
135
+ /** Border radius */
136
+ radius?: TextInputRadius;
137
+ /** Icon rendered to the left of the input */
138
+ leftIcon?: React$1.ReactNode;
139
+ /** Icon rendered to the right of the input */
140
+ rightIcon?: React$1.ReactNode;
141
+ /** Helper/error message displayed below the input */
142
+ helperText?: React$1.ReactNode;
143
+ /** Custom style for the outermost wrapper */
144
+ wrapperStyle?: StyleProp<ViewStyle>;
145
+ /** Custom style for the input container */
146
+ style?: StyleProp<ViewStyle>;
147
+ };
148
+ declare const TextInput: React$1.ForwardRefExoticComponent<Omit<TextInputProps$1, "style"> & {
149
+ /** Label text displayed above the input */
150
+ label?: string;
151
+ /** Subtitle displayed next to the label */
152
+ subtitle?: string;
153
+ /** Validation status */
154
+ status?: TextInputStatus;
155
+ /** Input size */
156
+ size?: TextInputSize;
157
+ /** Border radius */
158
+ radius?: TextInputRadius;
159
+ /** Icon rendered to the left of the input */
160
+ leftIcon?: React$1.ReactNode;
161
+ /** Icon rendered to the right of the input */
162
+ rightIcon?: React$1.ReactNode;
163
+ /** Helper/error message displayed below the input */
164
+ helperText?: React$1.ReactNode;
165
+ /** Custom style for the outermost wrapper */
166
+ wrapperStyle?: StyleProp<ViewStyle>;
167
+ /** Custom style for the input container */
168
+ style?: StyleProp<ViewStyle>;
169
+ } & React$1.RefAttributes<TextInput$1>>;
170
+
171
+ type CheckboxSize = "sm" | "md" | "lg";
172
+ type CheckboxProps = Omit<PressableProps, "style" | "onPress"> & {
173
+ /** Checkbox size */
174
+ size?: CheckboxSize;
175
+ /** Label text displayed next to the checkbox */
176
+ label?: string;
177
+ /** Controlled checked state */
178
+ checked?: boolean;
179
+ /** Default checked state (uncontrolled) */
180
+ defaultChecked?: boolean;
181
+ /** Indeterminate state (partially checked) */
182
+ indeterminate?: boolean;
183
+ /** Callback fired when the value changes */
184
+ onChange?: (checked: boolean) => void;
185
+ /** Custom style for the outer wrapper */
186
+ style?: StyleProp<ViewStyle>;
187
+ };
188
+ declare const Checkbox: React$1.ForwardRefExoticComponent<Omit<PressableProps, "style" | "onPress"> & {
189
+ /** Checkbox size */
190
+ size?: CheckboxSize;
191
+ /** Label text displayed next to the checkbox */
192
+ label?: string;
193
+ /** Controlled checked state */
194
+ checked?: boolean;
195
+ /** Default checked state (uncontrolled) */
196
+ defaultChecked?: boolean;
197
+ /** Indeterminate state (partially checked) */
198
+ indeterminate?: boolean;
199
+ /** Callback fired when the value changes */
200
+ onChange?: (checked: boolean) => void;
201
+ /** Custom style for the outer wrapper */
202
+ style?: StyleProp<ViewStyle>;
203
+ } & React$1.RefAttributes<View>>;
204
+
205
+ type AvatarSize = "sm" | "md" | "lg" | "xl";
206
+ type AvatarVariant = "circle" | "square";
207
+ type AvatarProps = Omit<ViewProps, "style"> & {
208
+ /** Image source URL */
209
+ src?: string;
210
+ /** Alt text (used as accessibility label and initials fallback) */
211
+ alt?: string;
212
+ /** Fallback initials shown when image is unavailable */
213
+ initials?: string;
214
+ /** Avatar size */
215
+ size?: AvatarSize;
216
+ /** Shape variant */
217
+ variant?: AvatarVariant;
218
+ /** Custom style for the outer wrapper */
219
+ style?: StyleProp<ViewStyle>;
220
+ };
221
+ declare const Avatar: React$1.ForwardRefExoticComponent<Omit<ViewProps, "style"> & {
222
+ /** Image source URL */
223
+ src?: string;
224
+ /** Alt text (used as accessibility label and initials fallback) */
225
+ alt?: string;
226
+ /** Fallback initials shown when image is unavailable */
227
+ initials?: string;
228
+ /** Avatar size */
229
+ size?: AvatarSize;
230
+ /** Shape variant */
231
+ variant?: AvatarVariant;
232
+ /** Custom style for the outer wrapper */
233
+ style?: StyleProp<ViewStyle>;
234
+ } & React$1.RefAttributes<View>>;
235
+
236
+ export { Avatar, type AvatarProps, type AvatarSize, type AvatarVariant, Button, type ButtonProps, type ButtonRadius, type ButtonSize, type ButtonVariant, Checkbox, type CheckboxProps, type CheckboxSize, IconButton, type IconButtonColor, type IconButtonProps, type IconButtonRadius, type IconButtonSize, type IconButtonVariant, RehagroNativeProvider, type RehagroNativeProviderProps, type RehagroNativeTheme, TextInput, type TextInputProps, type TextInputRadius, type TextInputSize, type TextInputStatus, useRehagroTheme };
@@ -0,0 +1,236 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React$1 from 'react';
3
+ import { PressableProps, StyleProp, ViewStyle, View, TextInputProps as TextInputProps$1, TextInput as TextInput$1, ViewProps } from 'react-native';
4
+
5
+ /** React Native theme — reuses the same token names as the web theme.
6
+ * Color values are plain CSS hex strings (e.g. "#16a34a").
7
+ * Spacing/radius/border values are numbers (device-independent pixels).
8
+ */
9
+ type RehagroNativeTheme = {
10
+ primary?: string;
11
+ primaryHover?: string;
12
+ secondary?: string;
13
+ secondaryHover?: string;
14
+ danger?: string;
15
+ dangerHover?: string;
16
+ warning?: string;
17
+ success?: string;
18
+ text?: string;
19
+ textMuted?: string;
20
+ surface?: string;
21
+ background?: string;
22
+ border?: string;
23
+ radiusXxs?: number;
24
+ radiusXs?: number;
25
+ radiusSm?: number;
26
+ radiusMd?: number;
27
+ radiusLg?: number;
28
+ radiusXl?: number;
29
+ borderWidthSm?: number;
30
+ borderWidthMd?: number;
31
+ borderWidthLg?: number;
32
+ inputHeightSm?: number;
33
+ inputHeightMd?: number;
34
+ inputHeightLg?: number;
35
+ };
36
+ type RehagroNativeProviderProps = {
37
+ /** Theme overrides — any token not provided keeps the default value */
38
+ theme?: RehagroNativeTheme;
39
+ children: React.ReactNode;
40
+ };
41
+
42
+ declare function RehagroNativeProvider({ theme, children }: RehagroNativeProviderProps): react_jsx_runtime.JSX.Element;
43
+
44
+ declare function useRehagroTheme(): Required<RehagroNativeTheme>;
45
+
46
+ type ButtonVariant = "solid" | "outline" | "ghost";
47
+ type ButtonSize = "sm" | "md" | "lg";
48
+ type ButtonRadius = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "full";
49
+ type ButtonProps = Omit<PressableProps, "style"> & {
50
+ /** Visual style variant */
51
+ variant?: ButtonVariant;
52
+ /** Button size */
53
+ size?: ButtonSize;
54
+ /** Border radius */
55
+ radius?: ButtonRadius;
56
+ /** Shows loading state and disables interaction */
57
+ loading?: boolean;
58
+ /** Icon rendered to the left of children (hidden when loading) */
59
+ leftIcon?: React$1.ReactNode;
60
+ /** Icon rendered to the right of children (hidden when loading) */
61
+ rightIcon?: React$1.ReactNode;
62
+ /** Label text */
63
+ children?: React$1.ReactNode;
64
+ /** Custom style for the outer Pressable */
65
+ style?: StyleProp<ViewStyle>;
66
+ };
67
+ declare const Button: React$1.ForwardRefExoticComponent<Omit<PressableProps, "style"> & {
68
+ /** Visual style variant */
69
+ variant?: ButtonVariant;
70
+ /** Button size */
71
+ size?: ButtonSize;
72
+ /** Border radius */
73
+ radius?: ButtonRadius;
74
+ /** Shows loading state and disables interaction */
75
+ loading?: boolean;
76
+ /** Icon rendered to the left of children (hidden when loading) */
77
+ leftIcon?: React$1.ReactNode;
78
+ /** Icon rendered to the right of children (hidden when loading) */
79
+ rightIcon?: React$1.ReactNode;
80
+ /** Label text */
81
+ children?: React$1.ReactNode;
82
+ /** Custom style for the outer Pressable */
83
+ style?: StyleProp<ViewStyle>;
84
+ } & React$1.RefAttributes<View>>;
85
+
86
+ type IconButtonVariant = "solid" | "outline" | "ghost";
87
+ type IconButtonSize = "sm" | "md" | "lg";
88
+ type IconButtonRadius = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "full";
89
+ type IconButtonColor = "primary" | "danger" | "warning" | "success" | "secondary";
90
+ type IconButtonProps = Omit<PressableProps, "style"> & {
91
+ /** Visual style variant */
92
+ variant?: IconButtonVariant;
93
+ /** Button size */
94
+ size?: IconButtonSize;
95
+ /** Border radius */
96
+ radius?: IconButtonRadius;
97
+ /** Color scheme */
98
+ color?: IconButtonColor;
99
+ /** Shows loading state and disables interaction */
100
+ loading?: boolean;
101
+ /** Icon content */
102
+ children?: React$1.ReactNode;
103
+ /** Custom style for the outer Pressable */
104
+ style?: StyleProp<ViewStyle>;
105
+ };
106
+ declare const IconButton: React$1.ForwardRefExoticComponent<Omit<PressableProps, "style"> & {
107
+ /** Visual style variant */
108
+ variant?: IconButtonVariant;
109
+ /** Button size */
110
+ size?: IconButtonSize;
111
+ /** Border radius */
112
+ radius?: IconButtonRadius;
113
+ /** Color scheme */
114
+ color?: IconButtonColor;
115
+ /** Shows loading state and disables interaction */
116
+ loading?: boolean;
117
+ /** Icon content */
118
+ children?: React$1.ReactNode;
119
+ /** Custom style for the outer Pressable */
120
+ style?: StyleProp<ViewStyle>;
121
+ } & React$1.RefAttributes<View>>;
122
+
123
+ type TextInputStatus = "default" | "error";
124
+ type TextInputSize = "sm" | "md" | "lg";
125
+ type TextInputRadius = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "full";
126
+ type TextInputProps = Omit<TextInputProps$1, "style"> & {
127
+ /** Label text displayed above the input */
128
+ label?: string;
129
+ /** Subtitle displayed next to the label */
130
+ subtitle?: string;
131
+ /** Validation status */
132
+ status?: TextInputStatus;
133
+ /** Input size */
134
+ size?: TextInputSize;
135
+ /** Border radius */
136
+ radius?: TextInputRadius;
137
+ /** Icon rendered to the left of the input */
138
+ leftIcon?: React$1.ReactNode;
139
+ /** Icon rendered to the right of the input */
140
+ rightIcon?: React$1.ReactNode;
141
+ /** Helper/error message displayed below the input */
142
+ helperText?: React$1.ReactNode;
143
+ /** Custom style for the outermost wrapper */
144
+ wrapperStyle?: StyleProp<ViewStyle>;
145
+ /** Custom style for the input container */
146
+ style?: StyleProp<ViewStyle>;
147
+ };
148
+ declare const TextInput: React$1.ForwardRefExoticComponent<Omit<TextInputProps$1, "style"> & {
149
+ /** Label text displayed above the input */
150
+ label?: string;
151
+ /** Subtitle displayed next to the label */
152
+ subtitle?: string;
153
+ /** Validation status */
154
+ status?: TextInputStatus;
155
+ /** Input size */
156
+ size?: TextInputSize;
157
+ /** Border radius */
158
+ radius?: TextInputRadius;
159
+ /** Icon rendered to the left of the input */
160
+ leftIcon?: React$1.ReactNode;
161
+ /** Icon rendered to the right of the input */
162
+ rightIcon?: React$1.ReactNode;
163
+ /** Helper/error message displayed below the input */
164
+ helperText?: React$1.ReactNode;
165
+ /** Custom style for the outermost wrapper */
166
+ wrapperStyle?: StyleProp<ViewStyle>;
167
+ /** Custom style for the input container */
168
+ style?: StyleProp<ViewStyle>;
169
+ } & React$1.RefAttributes<TextInput$1>>;
170
+
171
+ type CheckboxSize = "sm" | "md" | "lg";
172
+ type CheckboxProps = Omit<PressableProps, "style" | "onPress"> & {
173
+ /** Checkbox size */
174
+ size?: CheckboxSize;
175
+ /** Label text displayed next to the checkbox */
176
+ label?: string;
177
+ /** Controlled checked state */
178
+ checked?: boolean;
179
+ /** Default checked state (uncontrolled) */
180
+ defaultChecked?: boolean;
181
+ /** Indeterminate state (partially checked) */
182
+ indeterminate?: boolean;
183
+ /** Callback fired when the value changes */
184
+ onChange?: (checked: boolean) => void;
185
+ /** Custom style for the outer wrapper */
186
+ style?: StyleProp<ViewStyle>;
187
+ };
188
+ declare const Checkbox: React$1.ForwardRefExoticComponent<Omit<PressableProps, "style" | "onPress"> & {
189
+ /** Checkbox size */
190
+ size?: CheckboxSize;
191
+ /** Label text displayed next to the checkbox */
192
+ label?: string;
193
+ /** Controlled checked state */
194
+ checked?: boolean;
195
+ /** Default checked state (uncontrolled) */
196
+ defaultChecked?: boolean;
197
+ /** Indeterminate state (partially checked) */
198
+ indeterminate?: boolean;
199
+ /** Callback fired when the value changes */
200
+ onChange?: (checked: boolean) => void;
201
+ /** Custom style for the outer wrapper */
202
+ style?: StyleProp<ViewStyle>;
203
+ } & React$1.RefAttributes<View>>;
204
+
205
+ type AvatarSize = "sm" | "md" | "lg" | "xl";
206
+ type AvatarVariant = "circle" | "square";
207
+ type AvatarProps = Omit<ViewProps, "style"> & {
208
+ /** Image source URL */
209
+ src?: string;
210
+ /** Alt text (used as accessibility label and initials fallback) */
211
+ alt?: string;
212
+ /** Fallback initials shown when image is unavailable */
213
+ initials?: string;
214
+ /** Avatar size */
215
+ size?: AvatarSize;
216
+ /** Shape variant */
217
+ variant?: AvatarVariant;
218
+ /** Custom style for the outer wrapper */
219
+ style?: StyleProp<ViewStyle>;
220
+ };
221
+ declare const Avatar: React$1.ForwardRefExoticComponent<Omit<ViewProps, "style"> & {
222
+ /** Image source URL */
223
+ src?: string;
224
+ /** Alt text (used as accessibility label and initials fallback) */
225
+ alt?: string;
226
+ /** Fallback initials shown when image is unavailable */
227
+ initials?: string;
228
+ /** Avatar size */
229
+ size?: AvatarSize;
230
+ /** Shape variant */
231
+ variant?: AvatarVariant;
232
+ /** Custom style for the outer wrapper */
233
+ style?: StyleProp<ViewStyle>;
234
+ } & React$1.RefAttributes<View>>;
235
+
236
+ export { Avatar, type AvatarProps, type AvatarSize, type AvatarVariant, Button, type ButtonProps, type ButtonRadius, type ButtonSize, type ButtonVariant, Checkbox, type CheckboxProps, type CheckboxSize, IconButton, type IconButtonColor, type IconButtonProps, type IconButtonRadius, type IconButtonSize, type IconButtonVariant, RehagroNativeProvider, type RehagroNativeProviderProps, type RehagroNativeTheme, TextInput, type TextInputProps, type TextInputRadius, type TextInputSize, type TextInputStatus, useRehagroTheme };