@brickslab./ui-mobile 0.1.1
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/dist/index.cjs +1897 -0
- package/dist/index.d.cts +393 -0
- package/dist/index.d.ts +393 -0
- package/dist/index.js +1836 -0
- package/package.json +34 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ViewStyle, TextStyle } from 'react-native';
|
|
4
|
+
|
|
5
|
+
type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger' | 'custom';
|
|
6
|
+
type ButtonSize = 'sm' | 'md' | 'lg';
|
|
7
|
+
interface ButtonProps {
|
|
8
|
+
variant?: ButtonVariant;
|
|
9
|
+
size?: ButtonSize;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
isLoading?: boolean;
|
|
12
|
+
leftIcon?: React.ReactNode;
|
|
13
|
+
rightIcon?: React.ReactNode;
|
|
14
|
+
fullWidth?: boolean;
|
|
15
|
+
onPress?: () => void;
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* complémentaire à `variant="custom"` ; couleur de fond
|
|
19
|
+
*/
|
|
20
|
+
customBg?: string;
|
|
21
|
+
/**
|
|
22
|
+
* complémentaire à `variant="custom"` ; couleur du texte
|
|
23
|
+
*/
|
|
24
|
+
customColor?: string;
|
|
25
|
+
/**
|
|
26
|
+
* style inline supplémentaire
|
|
27
|
+
*/
|
|
28
|
+
style?: ViewStyle;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
declare function Button({ variant, size, disabled, isLoading, leftIcon, rightIcon, fullWidth, onPress, children, customBg, customColor, style: userStyle, }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
32
|
+
|
|
33
|
+
type InputSize = 'sm' | 'md' | 'lg';
|
|
34
|
+
interface InputProps {
|
|
35
|
+
value: string;
|
|
36
|
+
onChangeText: (value: string) => void;
|
|
37
|
+
keyboardType?: 'default' | 'email-address' | 'numeric' | 'phone-pad' | 'url';
|
|
38
|
+
label?: string;
|
|
39
|
+
placeholder?: string;
|
|
40
|
+
helperText?: string;
|
|
41
|
+
errorText?: string;
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
editable?: boolean;
|
|
44
|
+
leftIcon?: React.ReactNode;
|
|
45
|
+
rightIcon?: React.ReactNode;
|
|
46
|
+
size?: InputSize;
|
|
47
|
+
fullWidth?: boolean;
|
|
48
|
+
style?: ViewStyle;
|
|
49
|
+
inputStyle?: TextStyle;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
declare function Input({ value, onChangeText, keyboardType, label, placeholder, helperText, errorText, disabled, editable, leftIcon, rightIcon, size, fullWidth, style: userStyle, inputStyle: userInputStyle, }: InputProps): react_jsx_runtime.JSX.Element;
|
|
53
|
+
|
|
54
|
+
type CheckboxSize = 'sm' | 'md' | 'lg';
|
|
55
|
+
interface CheckboxProps {
|
|
56
|
+
checked?: boolean;
|
|
57
|
+
defaultChecked?: boolean;
|
|
58
|
+
onValueChange?: (checked: boolean) => void;
|
|
59
|
+
label?: React.ReactNode;
|
|
60
|
+
disabled?: boolean;
|
|
61
|
+
size?: CheckboxSize;
|
|
62
|
+
style?: ViewStyle;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
declare function Checkbox({ checked, defaultChecked, onValueChange, label, disabled, size, style: userStyle, }: CheckboxProps): react_jsx_runtime.JSX.Element;
|
|
66
|
+
|
|
67
|
+
type RadioSize = 'sm' | 'md' | 'lg';
|
|
68
|
+
interface RadioProps {
|
|
69
|
+
value: string;
|
|
70
|
+
checked?: boolean;
|
|
71
|
+
onChange?: (value: string) => void;
|
|
72
|
+
label?: React.ReactNode;
|
|
73
|
+
name?: string;
|
|
74
|
+
disabled?: boolean;
|
|
75
|
+
size?: RadioSize;
|
|
76
|
+
style?: ViewStyle;
|
|
77
|
+
}
|
|
78
|
+
interface RadioGroupProps {
|
|
79
|
+
name: string;
|
|
80
|
+
value?: string;
|
|
81
|
+
onChange?: (value: string) => void;
|
|
82
|
+
children: React.ReactNode;
|
|
83
|
+
direction?: 'vertical' | 'horizontal';
|
|
84
|
+
gap?: number;
|
|
85
|
+
style?: ViewStyle;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
declare function Radio({ value, checked, onChange, label, name, disabled, size, style: userStyle, }: RadioProps): react_jsx_runtime.JSX.Element;
|
|
89
|
+
declare function RadioGroup({ name, value, onChange, children, direction, gap, style: userStyle, }: RadioGroupProps): react_jsx_runtime.JSX.Element;
|
|
90
|
+
|
|
91
|
+
interface ToggleSwitchProps {
|
|
92
|
+
checked: boolean;
|
|
93
|
+
onValueChange: (checked: boolean) => void;
|
|
94
|
+
label?: string;
|
|
95
|
+
disabled?: boolean;
|
|
96
|
+
style?: ViewStyle;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
declare function ToggleSwitch({ checked, onValueChange, label, disabled, style: userStyle, }: ToggleSwitchProps): react_jsx_runtime.JSX.Element;
|
|
100
|
+
|
|
101
|
+
type BadgeVariant = 'default' | 'info' | 'success' | 'warning' | 'error';
|
|
102
|
+
type BadgeSize = 'sm' | 'md' | 'lg';
|
|
103
|
+
interface BadgeProps {
|
|
104
|
+
variant?: BadgeVariant;
|
|
105
|
+
size?: BadgeSize;
|
|
106
|
+
children?: React.ReactNode;
|
|
107
|
+
dot?: boolean;
|
|
108
|
+
outlined?: boolean;
|
|
109
|
+
max?: number;
|
|
110
|
+
style?: ViewStyle;
|
|
111
|
+
textStyle?: TextStyle;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
declare function Badge({ variant, size, children, dot, outlined, max, style: userStyle, textStyle: userTextStyle, }: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
115
|
+
|
|
116
|
+
type TabsVariant = 'underline' | 'pills' | 'boxed';
|
|
117
|
+
type TabsSize = 'sm' | 'md' | 'lg';
|
|
118
|
+
interface TabItem {
|
|
119
|
+
value: string;
|
|
120
|
+
label: React.ReactNode;
|
|
121
|
+
icon?: React.ReactNode;
|
|
122
|
+
disabled?: boolean;
|
|
123
|
+
}
|
|
124
|
+
interface TabsProps {
|
|
125
|
+
tabs: TabItem[];
|
|
126
|
+
value: string;
|
|
127
|
+
onChange: (value: string) => void;
|
|
128
|
+
variant?: TabsVariant;
|
|
129
|
+
size?: TabsSize;
|
|
130
|
+
fullWidth?: boolean;
|
|
131
|
+
style?: ViewStyle;
|
|
132
|
+
}
|
|
133
|
+
interface TabPanelProps {
|
|
134
|
+
value: string;
|
|
135
|
+
activeValue: string;
|
|
136
|
+
children: React.ReactNode;
|
|
137
|
+
style?: ViewStyle;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
declare function Tabs({ tabs, value, onChange, variant, size, fullWidth, style: userStyle, }: TabsProps): react_jsx_runtime.JSX.Element;
|
|
141
|
+
declare function TabPanel({ value, activeValue, children, style: userStyle }: TabPanelProps): react_jsx_runtime.JSX.Element | null;
|
|
142
|
+
|
|
143
|
+
type AlertVariant = 'info' | 'success' | 'warning' | 'error';
|
|
144
|
+
interface AlertProps {
|
|
145
|
+
variant?: AlertVariant;
|
|
146
|
+
title?: string;
|
|
147
|
+
children: React.ReactNode;
|
|
148
|
+
dismissible?: boolean;
|
|
149
|
+
onDismiss?: () => void;
|
|
150
|
+
icon?: boolean;
|
|
151
|
+
fullWidth?: boolean;
|
|
152
|
+
style?: ViewStyle;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
declare function Alert({ variant, title, children, dismissible, onDismiss, icon, fullWidth, style: userStyle, }: AlertProps): react_jsx_runtime.JSX.Element;
|
|
156
|
+
|
|
157
|
+
type ProgressBarColorScheme = 'brand' | 'green' | 'amber' | 'red';
|
|
158
|
+
type ProgressBarSize = 'sm' | 'md';
|
|
159
|
+
interface ProgressBarProps {
|
|
160
|
+
value: number;
|
|
161
|
+
max?: number;
|
|
162
|
+
label?: string;
|
|
163
|
+
colorScheme?: ProgressBarColorScheme;
|
|
164
|
+
size?: ProgressBarSize;
|
|
165
|
+
showValue?: boolean;
|
|
166
|
+
animate?: boolean;
|
|
167
|
+
duration?: number;
|
|
168
|
+
style?: ViewStyle;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
declare function ProgressBar({ value, max, label, colorScheme, size, showValue, animate, duration, style: userStyle, }: ProgressBarProps): react_jsx_runtime.JSX.Element;
|
|
172
|
+
|
|
173
|
+
type SpinnerSize = 'small' | 'large';
|
|
174
|
+
type SpinnerVariant = 'default' | 'brand' | 'success' | 'warning' | 'error' | 'white';
|
|
175
|
+
interface SpinnerProps {
|
|
176
|
+
size?: SpinnerSize;
|
|
177
|
+
variant?: SpinnerVariant;
|
|
178
|
+
label?: string;
|
|
179
|
+
style?: ViewStyle;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
declare function Spinner({ size, variant, label, style: userStyle, }: SpinnerProps): react_jsx_runtime.JSX.Element;
|
|
183
|
+
|
|
184
|
+
type SelectSize = 'sm' | 'md' | 'lg';
|
|
185
|
+
interface SelectOption {
|
|
186
|
+
value: string;
|
|
187
|
+
label: string;
|
|
188
|
+
disabled?: boolean;
|
|
189
|
+
}
|
|
190
|
+
interface SelectProps {
|
|
191
|
+
value: string;
|
|
192
|
+
onChange: (value: string) => void;
|
|
193
|
+
options: SelectOption[];
|
|
194
|
+
label?: string;
|
|
195
|
+
placeholder?: string;
|
|
196
|
+
helperText?: string;
|
|
197
|
+
errorText?: string;
|
|
198
|
+
disabled?: boolean;
|
|
199
|
+
size?: SelectSize;
|
|
200
|
+
fullWidth?: boolean;
|
|
201
|
+
style?: ViewStyle;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
declare function Select({ value, onChange, options, label, placeholder, helperText, errorText, disabled, size, fullWidth, style: userStyle, }: SelectProps): react_jsx_runtime.JSX.Element;
|
|
205
|
+
|
|
206
|
+
type TextareaSize = 'sm' | 'md' | 'lg';
|
|
207
|
+
interface TextareaProps {
|
|
208
|
+
value: string;
|
|
209
|
+
onChangeText: (value: string) => void;
|
|
210
|
+
label?: string;
|
|
211
|
+
placeholder?: string;
|
|
212
|
+
helperText?: string;
|
|
213
|
+
errorText?: string;
|
|
214
|
+
disabled?: boolean;
|
|
215
|
+
editable?: boolean;
|
|
216
|
+
size?: TextareaSize;
|
|
217
|
+
fullWidth?: boolean;
|
|
218
|
+
numberOfLines?: number;
|
|
219
|
+
maxLength?: number;
|
|
220
|
+
style?: ViewStyle;
|
|
221
|
+
inputStyle?: TextStyle;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
declare function Textarea({ value, onChangeText, label, placeholder, helperText, errorText, disabled, editable, size, fullWidth, numberOfLines, maxLength, style: userStyle, inputStyle: userInputStyle, }: TextareaProps): react_jsx_runtime.JSX.Element;
|
|
225
|
+
|
|
226
|
+
type AccordionVariant = 'bordered' | 'separated' | 'ghost';
|
|
227
|
+
type AccordionSize = 'sm' | 'md' | 'lg';
|
|
228
|
+
interface AccordionProps {
|
|
229
|
+
children: React.ReactNode;
|
|
230
|
+
variant?: AccordionVariant;
|
|
231
|
+
size?: AccordionSize;
|
|
232
|
+
style?: ViewStyle;
|
|
233
|
+
}
|
|
234
|
+
interface AccordionItemProps {
|
|
235
|
+
title: React.ReactNode;
|
|
236
|
+
children: React.ReactNode;
|
|
237
|
+
open?: boolean;
|
|
238
|
+
onToggle?: (open: boolean) => void;
|
|
239
|
+
disabled?: boolean;
|
|
240
|
+
icon?: React.ReactNode;
|
|
241
|
+
style?: ViewStyle;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
declare function Accordion({ children, variant, size, style: userStyle, }: AccordionProps): react_jsx_runtime.JSX.Element;
|
|
245
|
+
declare function AccordionItem({ title, children, open: controlledOpen, onToggle, disabled, icon, style: userStyle, }: AccordionItemProps): react_jsx_runtime.JSX.Element;
|
|
246
|
+
|
|
247
|
+
type CalloutVariant = 'info' | 'warning' | 'tip' | 'danger';
|
|
248
|
+
interface CalloutProps {
|
|
249
|
+
variant?: CalloutVariant;
|
|
250
|
+
title?: string;
|
|
251
|
+
children?: React.ReactNode;
|
|
252
|
+
style?: ViewStyle;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
declare function Callout({ variant, title, children, style: userStyle, }: CalloutProps): react_jsx_runtime.JSX.Element;
|
|
256
|
+
|
|
257
|
+
type StatusVariant = 'active' | 'inactive' | 'pending' | 'error';
|
|
258
|
+
interface StatusLabelProps {
|
|
259
|
+
status: StatusVariant;
|
|
260
|
+
label?: string;
|
|
261
|
+
style?: ViewStyle;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
declare function StatusLabel({ status, label, style: userStyle, }: StatusLabelProps): react_jsx_runtime.JSX.Element;
|
|
265
|
+
|
|
266
|
+
interface TagChipProps {
|
|
267
|
+
label: string;
|
|
268
|
+
variant?: 'default' | 'brand' | 'muted';
|
|
269
|
+
size?: 'sm' | 'md';
|
|
270
|
+
style?: ViewStyle;
|
|
271
|
+
textStyle?: TextStyle;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
declare function TagChip({ label, variant, size, style: userStyle, textStyle: userTextStyle, }: TagChipProps): react_jsx_runtime.JSX.Element;
|
|
275
|
+
|
|
276
|
+
interface TextProps {
|
|
277
|
+
texte: string;
|
|
278
|
+
variant?: 'body-sm' | 'body-md' | 'body-lg' | 'caption';
|
|
279
|
+
align?: 'left' | 'center' | 'right';
|
|
280
|
+
tone?: 'default' | 'muted' | 'brand';
|
|
281
|
+
opacity?: number;
|
|
282
|
+
blurPx?: number;
|
|
283
|
+
style?: TextStyle;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
declare function Text({ texte, variant, align, tone, opacity, blurPx, style: userStyle, }: TextProps): react_jsx_runtime.JSX.Element;
|
|
287
|
+
|
|
288
|
+
interface HeadingProps {
|
|
289
|
+
title: string;
|
|
290
|
+
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
291
|
+
align?: 'left' | 'center' | 'right';
|
|
292
|
+
opacity?: number;
|
|
293
|
+
blurPx?: number;
|
|
294
|
+
tone?: 'brand' | 'muted';
|
|
295
|
+
style?: TextStyle;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
declare function Heading({ title, level, align, opacity, blurPx, tone, style: userStyle, }: HeadingProps): react_jsx_runtime.JSX.Element;
|
|
299
|
+
|
|
300
|
+
interface AppShellProps {
|
|
301
|
+
header?: React.ReactNode;
|
|
302
|
+
sidebar?: React.ReactNode;
|
|
303
|
+
footer?: React.ReactNode;
|
|
304
|
+
children: React.ReactNode;
|
|
305
|
+
sidebarWidth?: number;
|
|
306
|
+
headerHeight?: number;
|
|
307
|
+
footerHeight?: number;
|
|
308
|
+
style?: ViewStyle;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
declare function AppShell({ header, sidebar, footer, children, sidebarWidth, headerHeight, footerHeight, style: userStyle, }: AppShellProps): react_jsx_runtime.JSX.Element;
|
|
312
|
+
|
|
313
|
+
interface ScreenProps {
|
|
314
|
+
children: React.ReactNode;
|
|
315
|
+
scrollable?: boolean;
|
|
316
|
+
style?: ViewStyle;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
declare function Screen({ children, scrollable, style: userStyle }: ScreenProps): react_jsx_runtime.JSX.Element;
|
|
320
|
+
|
|
321
|
+
interface CardProps {
|
|
322
|
+
children?: React.ReactNode;
|
|
323
|
+
style?: ViewStyle;
|
|
324
|
+
variant?: 'default' | 'elevated' | 'outlined';
|
|
325
|
+
padding?: 'sm' | 'md' | 'lg';
|
|
326
|
+
}
|
|
327
|
+
declare function Card({ children, style, variant, padding, }: CardProps): react_jsx_runtime.JSX.Element;
|
|
328
|
+
|
|
329
|
+
declare const tokens: {
|
|
330
|
+
colorBg: string;
|
|
331
|
+
colorFg: string;
|
|
332
|
+
colorMuted: string;
|
|
333
|
+
colorBrand: string;
|
|
334
|
+
colorSuccess: string;
|
|
335
|
+
colorWarning: string;
|
|
336
|
+
colorError: string;
|
|
337
|
+
colorInfo: string;
|
|
338
|
+
colorTransparent: string;
|
|
339
|
+
cSurfaceElevated: string;
|
|
340
|
+
cBorder: string;
|
|
341
|
+
cBrandSubtle: string;
|
|
342
|
+
cBrandBorder: string;
|
|
343
|
+
cSuccessSubtle: string;
|
|
344
|
+
cSuccessBorder: string;
|
|
345
|
+
cWarningSubtle: string;
|
|
346
|
+
cWarningBorder: string;
|
|
347
|
+
fontsize2xs: number;
|
|
348
|
+
fontsizeXs: number;
|
|
349
|
+
fontsizeSm: number;
|
|
350
|
+
fontsizeMedium: number;
|
|
351
|
+
fontsizeLg: number;
|
|
352
|
+
fontsizeXl: number;
|
|
353
|
+
fontsize2xl: number;
|
|
354
|
+
fontsize3xl: number;
|
|
355
|
+
fontsize4xl: number;
|
|
356
|
+
fontsize5xl: number;
|
|
357
|
+
fontweightThin: string;
|
|
358
|
+
fontweightNormal: string;
|
|
359
|
+
fontweightLight: string;
|
|
360
|
+
fontweightMedium: string;
|
|
361
|
+
fontweightSemibold: string;
|
|
362
|
+
fontweightBold: string;
|
|
363
|
+
fontweightExtrabold: string;
|
|
364
|
+
fontweightBlack: string;
|
|
365
|
+
heightXm: number;
|
|
366
|
+
heightSm: number;
|
|
367
|
+
heightMd: number;
|
|
368
|
+
heightInput: number;
|
|
369
|
+
heightLg: number;
|
|
370
|
+
heightXl: number;
|
|
371
|
+
height2xl: number;
|
|
372
|
+
space1: number;
|
|
373
|
+
space15: number;
|
|
374
|
+
space2: number;
|
|
375
|
+
space3: number;
|
|
376
|
+
space4: number;
|
|
377
|
+
space5: number;
|
|
378
|
+
space6: number;
|
|
379
|
+
space7: number;
|
|
380
|
+
space8: number;
|
|
381
|
+
space10: number;
|
|
382
|
+
space12: number;
|
|
383
|
+
space16: number;
|
|
384
|
+
radiusSm: number;
|
|
385
|
+
radiusMd: number;
|
|
386
|
+
radiusLg: number;
|
|
387
|
+
radiusFull: number;
|
|
388
|
+
borderXm: number;
|
|
389
|
+
borderSm: number;
|
|
390
|
+
borderMd: number;
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
export { Accordion, AccordionItem, Alert, AppShell, Badge, Button, Callout, Card, Checkbox, Heading, Input, ProgressBar, Radio, RadioGroup, Screen, Select, Spinner, StatusLabel, TabPanel, Tabs, TagChip, Text, Textarea, ToggleSwitch, tokens };
|