ripal-ui 1.1.3 → 1.1.33
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/index.d.ts +235 -0
- package/package.json +2 -1
package/index.d.ts
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
// index.d.ts
|
|
2
|
+
declare module 'ripal-ui' {
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ViewStyle, TextInputProps } from 'react-native';
|
|
5
|
+
|
|
6
|
+
type Size = 'sm' | 'md' | 'lg';
|
|
7
|
+
type Variant = 'primary' | 'secondary' | 'success' | 'warning' | 'danger';
|
|
8
|
+
|
|
9
|
+
// Button
|
|
10
|
+
export interface ButtonProps {
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
accent?: 'primary' | 'secondary' | 'tertiary';
|
|
13
|
+
onPress?: () => void;
|
|
14
|
+
onLongPress?: () => void;
|
|
15
|
+
color?: string;
|
|
16
|
+
height?: number;
|
|
17
|
+
circle?: boolean;
|
|
18
|
+
justifyContent?: ViewStyle['justifyContent'];
|
|
19
|
+
style?: ViewStyle;
|
|
20
|
+
textProps?: Record<string, unknown>;
|
|
21
|
+
}
|
|
22
|
+
export const Button: React.FC<ButtonProps>;
|
|
23
|
+
|
|
24
|
+
// ColorPicker
|
|
25
|
+
export interface ColorPickerProps {
|
|
26
|
+
value?: string;
|
|
27
|
+
label?: string;
|
|
28
|
+
onChange?: (color: string) => void;
|
|
29
|
+
}
|
|
30
|
+
export const ColorPicker: React.FC<ColorPickerProps>;
|
|
31
|
+
|
|
32
|
+
// Input
|
|
33
|
+
export interface InputProps {
|
|
34
|
+
value?: string;
|
|
35
|
+
label?: string | null;
|
|
36
|
+
left?: React.ReactNode | null; // Allows for any valid React node
|
|
37
|
+
right?: React.ReactNode | null; // Allows for any valid React node
|
|
38
|
+
height?: number;
|
|
39
|
+
placeholder?: string | null;
|
|
40
|
+
mode?: TextInputProps["keyboardType"]; // Use keyboardType from TextInputProps
|
|
41
|
+
secureTextEntry?: boolean;
|
|
42
|
+
multiline?: boolean;
|
|
43
|
+
gap?: number;
|
|
44
|
+
onChangeText: (text: string) => void; // Function to handle text changes
|
|
45
|
+
}
|
|
46
|
+
export const Input: React.FC<InputProps>;
|
|
47
|
+
|
|
48
|
+
// ProgressBar
|
|
49
|
+
export interface ProgressBarProps {
|
|
50
|
+
value: number;
|
|
51
|
+
from?: number;
|
|
52
|
+
size?: number;
|
|
53
|
+
style?: ViewStyle;
|
|
54
|
+
percentage?: number | null;
|
|
55
|
+
}
|
|
56
|
+
export const ProgressBar: React.FC<ProgressBarProps>;
|
|
57
|
+
|
|
58
|
+
// Separator
|
|
59
|
+
export interface SeparatorProps {
|
|
60
|
+
width?: any;
|
|
61
|
+
space?: number;
|
|
62
|
+
height?: number;
|
|
63
|
+
color?: string;
|
|
64
|
+
textProps?: React.ComponentProps<typeof Text>;
|
|
65
|
+
style?: ViewStyle;
|
|
66
|
+
children?: React.ReactNode;
|
|
67
|
+
}
|
|
68
|
+
export const Separator: React.FC<SeparatorProps>;
|
|
69
|
+
|
|
70
|
+
// Checkbox
|
|
71
|
+
export interface CheckboxProps {
|
|
72
|
+
checked?: boolean;
|
|
73
|
+
onChange?: (checked: boolean) => void;
|
|
74
|
+
label?: string;
|
|
75
|
+
disabled?: boolean;
|
|
76
|
+
}
|
|
77
|
+
export const Checkbox: React.FC<CheckboxProps>;
|
|
78
|
+
|
|
79
|
+
// Text
|
|
80
|
+
export interface TextProps {
|
|
81
|
+
children: React.ReactNode;
|
|
82
|
+
weight?: '300Light' | '400Regular' | '500Medium' | '600SemiBold' | '700Bold' | '900Black';
|
|
83
|
+
size?: number;
|
|
84
|
+
color?: string;
|
|
85
|
+
align?: 'left' | 'right' | 'center' | 'justify';
|
|
86
|
+
limit?: number;
|
|
87
|
+
spacing?: number;
|
|
88
|
+
lineHeight?: number | null;
|
|
89
|
+
style?: TextStyle;
|
|
90
|
+
}
|
|
91
|
+
export const Text: React.FC<TextProps>;
|
|
92
|
+
|
|
93
|
+
// Circle
|
|
94
|
+
export interface CircleProps {
|
|
95
|
+
size?: number;
|
|
96
|
+
color?: string;
|
|
97
|
+
children?: React.ReactNode;
|
|
98
|
+
}
|
|
99
|
+
export const Circle: React.FC<CircleProps>;
|
|
100
|
+
|
|
101
|
+
// Row
|
|
102
|
+
export interface RowProps {
|
|
103
|
+
children?: React.ReactNode;
|
|
104
|
+
justify?: 'start' | 'center' | 'end' | 'between' | 'around';
|
|
105
|
+
align?: 'start' | 'center' | 'end' | 'stretch';
|
|
106
|
+
gap?: number;
|
|
107
|
+
className?: string;
|
|
108
|
+
}
|
|
109
|
+
export const Row: React.FC<RowProps>;
|
|
110
|
+
|
|
111
|
+
// Inline
|
|
112
|
+
export interface InlineProps {
|
|
113
|
+
children: React.ReactNode;
|
|
114
|
+
alignItems?: "flex-start" | "flex-end" | "center" | "baseline" | "stretch";
|
|
115
|
+
justifyContent?: "flex-start" | "flex-end" | "center" | "space-between" | "space-around" | "space-evenly";
|
|
116
|
+
gap?: number;
|
|
117
|
+
style?: ViewStyle;
|
|
118
|
+
}
|
|
119
|
+
export const Inline: React.FC<InlineProps>;
|
|
120
|
+
|
|
121
|
+
// Cell
|
|
122
|
+
export interface CellProps {
|
|
123
|
+
children?: React.ReactNode;
|
|
124
|
+
width?: number | string;
|
|
125
|
+
}
|
|
126
|
+
export const Cell: React.FC<CellProps>;
|
|
127
|
+
|
|
128
|
+
// // BottomSheet
|
|
129
|
+
// export interface BottomSheetProps {
|
|
130
|
+
// open: boolean;
|
|
131
|
+
// onClose: () => void;
|
|
132
|
+
// children?: React.ReactNode;
|
|
133
|
+
// }
|
|
134
|
+
// export const BottomSheet: React.FC<BottomSheetProps>;
|
|
135
|
+
|
|
136
|
+
// Skeleton
|
|
137
|
+
export interface SkeletonProps {
|
|
138
|
+
color?: string;
|
|
139
|
+
rounded?: number;
|
|
140
|
+
width?: any;
|
|
141
|
+
height?: number;
|
|
142
|
+
aspectRatio?: number | null;
|
|
143
|
+
}
|
|
144
|
+
export const Skeleton: React.FC<SkeletonProps>;
|
|
145
|
+
|
|
146
|
+
// Slider
|
|
147
|
+
export interface SliderProps {
|
|
148
|
+
start?: number;
|
|
149
|
+
end?: number;
|
|
150
|
+
value?: number;
|
|
151
|
+
rounded?: number;
|
|
152
|
+
trackColor?: string;
|
|
153
|
+
color?: string;
|
|
154
|
+
height?: number;
|
|
155
|
+
thumbOpacity?: number;
|
|
156
|
+
thumbColor?: string;
|
|
157
|
+
onChange?: (value: number) => void;
|
|
158
|
+
setScrollEnabled?: (enabled: boolean) => void;
|
|
159
|
+
}
|
|
160
|
+
export const Slider: React.FC<SliderProps>;
|
|
161
|
+
|
|
162
|
+
// Switch
|
|
163
|
+
export interface SwitchProps {
|
|
164
|
+
active?: boolean;
|
|
165
|
+
size?: number;
|
|
166
|
+
spacer?: number;
|
|
167
|
+
onChange?: () => void;
|
|
168
|
+
}
|
|
169
|
+
export const Switch: React.FC<SwitchProps>;
|
|
170
|
+
|
|
171
|
+
// Dialog
|
|
172
|
+
export interface DialogProps {
|
|
173
|
+
spacer?: number;
|
|
174
|
+
children: React.ReactNode;
|
|
175
|
+
visible: boolean;
|
|
176
|
+
onDismiss: () => void;
|
|
177
|
+
}
|
|
178
|
+
export const Dialog: React.FC<DialogProps>;
|
|
179
|
+
|
|
180
|
+
// DialogActions
|
|
181
|
+
export interface DialogActionsProps {
|
|
182
|
+
children: React.ReactNode;
|
|
183
|
+
}
|
|
184
|
+
export const DialogActions: React.FC<DialogActionsProps>;
|
|
185
|
+
|
|
186
|
+
type OptionType<T> = T[] | string[];
|
|
187
|
+
|
|
188
|
+
export interface DropdownProps<T> {
|
|
189
|
+
options: OptionType<T>;
|
|
190
|
+
value: T | null;
|
|
191
|
+
setValue: (value: T) => void;
|
|
192
|
+
onChange?: (value: T) => void;
|
|
193
|
+
color?: string;
|
|
194
|
+
label?: string | null;
|
|
195
|
+
placeholder?: string;
|
|
196
|
+
objectKey?: keyof T | null;
|
|
197
|
+
withSearch?: boolean;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// Generic component declaration
|
|
201
|
+
export function Dropdown<T>(props: DropdownProps<T>): React.ReactElement;
|
|
202
|
+
|
|
203
|
+
// Toast
|
|
204
|
+
export interface ToastProps {
|
|
205
|
+
label?: string;
|
|
206
|
+
color?: string;
|
|
207
|
+
right?: React.ReactNode; // Allows for any valid React node
|
|
208
|
+
visible?: boolean;
|
|
209
|
+
onDismiss: () => void;
|
|
210
|
+
timeout?: number;
|
|
211
|
+
containerStyle?: ViewStyle; // Style for the container View
|
|
212
|
+
style?: ViewStyle; // Additional style for the Toast
|
|
213
|
+
textProps?: React.ComponentProps<typeof Text>; // Props for the Text component
|
|
214
|
+
}
|
|
215
|
+
export const Toast: React.FC<ToastProps>;
|
|
216
|
+
|
|
217
|
+
// Toggle
|
|
218
|
+
export interface ToggleProps {
|
|
219
|
+
options: string[];
|
|
220
|
+
value: any;
|
|
221
|
+
setValue: (value: string) => void;
|
|
222
|
+
}
|
|
223
|
+
export const Toggle: React.FC<ToggleProps>;
|
|
224
|
+
|
|
225
|
+
// // Table
|
|
226
|
+
// export interface TableProps<T = any> {
|
|
227
|
+
// data: T[];
|
|
228
|
+
// columns: {
|
|
229
|
+
// title: string;
|
|
230
|
+
// key: keyof T;
|
|
231
|
+
// render?: (row: T) => React.ReactNode;
|
|
232
|
+
// }[];
|
|
233
|
+
// }
|
|
234
|
+
// export const Table: React.FC<TableProps>;
|
|
235
|
+
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ripal-ui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.33",
|
|
4
4
|
"description": "A collection of React elements and components",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"build": "babel elements components --out-dir dist",
|
|
8
9
|
"postinstall": "node ./scripts/generateConfig.js"
|