react-native-atomic-ui 1.0.2 → 1.0.3
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 +14 -0
- package/dist/advanced/date-picker/index.js.map +1 -1
- package/dist/advanced/date-picker/index.mjs.map +1 -1
- package/dist/advanced/file-picker/index.js.map +1 -1
- package/dist/advanced/file-picker/index.mjs.map +1 -1
- package/dist/advanced/picker/index.js.map +1 -1
- package/dist/advanced/picker/index.mjs.map +1 -1
- package/dist/advanced/rich-text/index.js.map +1 -1
- package/dist/advanced/rich-text/index.mjs.map +1 -1
- package/dist/{chunk-IOIXIQ2F.mjs → chunk-56IADPYY.mjs} +2 -5
- package/dist/chunk-56IADPYY.mjs.map +7 -0
- package/dist/chunk-GSLM4BKO.mjs +789 -0
- package/dist/chunk-GSLM4BKO.mjs.map +7 -0
- package/dist/components/display/Badge.d.ts +7 -0
- package/dist/components/display/Badge.d.ts.map +1 -0
- package/dist/components/display/Badge.js +52 -0
- package/dist/components/display/Badge.js.map +1 -0
- package/dist/components/display/Divider.d.ts +7 -0
- package/dist/components/display/Divider.d.ts.map +1 -0
- package/dist/components/display/Divider.js +19 -0
- package/dist/components/display/Divider.js.map +1 -0
- package/dist/components/display/ProgressBar.d.ts +7 -0
- package/dist/components/display/ProgressBar.d.ts.map +1 -0
- package/dist/components/display/ProgressBar.js +27 -0
- package/dist/components/display/ProgressBar.js.map +1 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +504 -35
- package/dist/components/index.js.map +4 -4
- package/dist/components/index.mjs +18 -2
- package/dist/components/inputs/Button.d.ts.map +1 -1
- package/dist/components/inputs/Button.js +1 -1
- package/dist/components/inputs/Button.js.map +1 -1
- package/dist/components/inputs/CheckBox.d.ts +7 -0
- package/dist/components/inputs/CheckBox.d.ts.map +1 -0
- package/dist/components/inputs/CheckBox.js +56 -0
- package/dist/components/inputs/CheckBox.js.map +1 -0
- package/dist/components/inputs/Input.d.ts +7 -0
- package/dist/components/inputs/Input.d.ts.map +1 -0
- package/dist/components/inputs/Input.js +44 -0
- package/dist/components/inputs/Input.js.map +1 -0
- package/dist/components/inputs/RadioButton.d.ts +7 -0
- package/dist/components/inputs/RadioButton.d.ts.map +1 -0
- package/dist/components/inputs/RadioButton.js +57 -0
- package/dist/components/inputs/RadioButton.js.map +1 -0
- package/dist/components/inputs/Switch.d.ts +7 -0
- package/dist/components/inputs/Switch.d.ts.map +1 -0
- package/dist/components/inputs/Switch.js +14 -0
- package/dist/components/inputs/Switch.js.map +1 -0
- package/dist/components/layouts/Box.d.ts +3 -3
- package/dist/components/layouts/Box.d.ts.map +1 -1
- package/dist/components/layouts/Box.js +23 -4
- package/dist/components/layouts/Box.js.map +1 -1
- package/dist/components/layouts/Collapsible.d.ts +7 -0
- package/dist/components/layouts/Collapsible.d.ts.map +1 -0
- package/dist/components/layouts/Collapsible.js +49 -0
- package/dist/components/layouts/Collapsible.js.map +1 -0
- package/dist/components/typography/Text.d.ts +1 -1
- package/dist/components/typography/Text.d.ts.map +1 -1
- package/dist/components/typography/Text.js +17 -17
- package/dist/components/typography/Text.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +505 -39
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +18 -2
- package/dist/theme/index.d.ts +1 -1
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +1 -4
- package/dist/theme/index.js.map +2 -2
- package/dist/theme/index.mjs +1 -1
- package/dist/types/index.d.ts +64 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +4 -1
- package/dist/chunk-IOIXIQ2F.mjs.map +0 -7
- package/dist/chunk-NUUZYCND.mjs +0 -318
- package/dist/chunk-NUUZYCND.mjs.map +0 -7
package/dist/index.js
CHANGED
|
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
|
+
Badge: () => Badge,
|
|
33
34
|
Body1: () => Body1,
|
|
34
35
|
Body2: () => Body2,
|
|
35
36
|
Body3: () => Body3,
|
|
@@ -39,17 +40,24 @@ __export(index_exports, {
|
|
|
39
40
|
Box: () => Box,
|
|
40
41
|
Button: () => Button,
|
|
41
42
|
Caption: () => Caption,
|
|
43
|
+
CheckBox: () => CheckBox,
|
|
44
|
+
Collapsible: () => Collapsible,
|
|
42
45
|
Column: () => Column,
|
|
46
|
+
Divider: () => Divider,
|
|
43
47
|
H1: () => H1,
|
|
44
48
|
H2: () => H2,
|
|
45
49
|
H3: () => H3,
|
|
46
50
|
H4: () => H4,
|
|
47
51
|
H5: () => H5,
|
|
48
52
|
H6: () => H6,
|
|
53
|
+
Input: () => Input,
|
|
49
54
|
Overline: () => Overline,
|
|
55
|
+
ProgressBar: () => ProgressBar,
|
|
56
|
+
RadioButton: () => RadioButton,
|
|
50
57
|
Row: () => Row,
|
|
51
58
|
SubTitle1: () => SubTitle1,
|
|
52
59
|
SubTitle2: () => SubTitle2,
|
|
60
|
+
Switch: () => Switch,
|
|
53
61
|
Text: () => Text,
|
|
54
62
|
ThemeProvider: () => ThemeProvider,
|
|
55
63
|
darkTheme: () => darkTheme,
|
|
@@ -192,10 +200,7 @@ var darkTheme = {
|
|
|
192
200
|
|
|
193
201
|
// src/theme/index.tsx
|
|
194
202
|
var ThemeContext = (0, import_react.createContext)(null);
|
|
195
|
-
function ThemeProvider({
|
|
196
|
-
children,
|
|
197
|
-
defaultTheme = "system"
|
|
198
|
-
}) {
|
|
203
|
+
function ThemeProvider({ children, defaultTheme = "system" }) {
|
|
199
204
|
const systemColorScheme = (0, import_react_native.useColorScheme)();
|
|
200
205
|
const isSystemDark = systemColorScheme === "dark";
|
|
201
206
|
const [isDark, setIsDark] = (0, import_react.useState)(() => {
|
|
@@ -233,6 +238,11 @@ var import_react2 = __toESM(require("react"));
|
|
|
233
238
|
var import_react_native2 = require("react-native");
|
|
234
239
|
function Box({
|
|
235
240
|
children,
|
|
241
|
+
flex,
|
|
242
|
+
flexDirection,
|
|
243
|
+
alignItems,
|
|
244
|
+
justifyContent,
|
|
245
|
+
flexWrap,
|
|
236
246
|
padding,
|
|
237
247
|
paddingHorizontal,
|
|
238
248
|
paddingVertical,
|
|
@@ -242,11 +252,20 @@ function Box({
|
|
|
242
252
|
gap,
|
|
243
253
|
backgroundColor,
|
|
244
254
|
borderRadius,
|
|
255
|
+
width,
|
|
256
|
+
height,
|
|
245
257
|
style,
|
|
246
258
|
testID
|
|
247
259
|
}) {
|
|
248
260
|
const { theme } = useTheme();
|
|
249
261
|
const boxStyle = [
|
|
262
|
+
flex !== void 0 && { flex },
|
|
263
|
+
flexDirection && { flexDirection },
|
|
264
|
+
alignItems && { alignItems },
|
|
265
|
+
justifyContent && { justifyContent },
|
|
266
|
+
flexWrap && { flexWrap },
|
|
267
|
+
width !== void 0 && { width },
|
|
268
|
+
height !== void 0 && { height },
|
|
250
269
|
padding && { padding: theme.spacing[padding] },
|
|
251
270
|
paddingHorizontal && { paddingHorizontal: theme.spacing[paddingHorizontal] },
|
|
252
271
|
paddingVertical && { paddingVertical: theme.spacing[paddingVertical] },
|
|
@@ -262,6 +281,10 @@ function Box({
|
|
|
262
281
|
}
|
|
263
282
|
function Row({
|
|
264
283
|
children,
|
|
284
|
+
flex,
|
|
285
|
+
alignItems = "center",
|
|
286
|
+
justifyContent,
|
|
287
|
+
flexWrap,
|
|
265
288
|
padding,
|
|
266
289
|
paddingHorizontal,
|
|
267
290
|
paddingVertical,
|
|
@@ -271,12 +294,20 @@ function Row({
|
|
|
271
294
|
gap,
|
|
272
295
|
backgroundColor,
|
|
273
296
|
borderRadius,
|
|
297
|
+
width,
|
|
298
|
+
height,
|
|
274
299
|
style,
|
|
275
300
|
testID
|
|
276
301
|
}) {
|
|
277
302
|
const { theme } = useTheme();
|
|
278
303
|
const rowStyle = [
|
|
279
|
-
{ flexDirection: "row"
|
|
304
|
+
{ flexDirection: "row" },
|
|
305
|
+
flex !== void 0 && { flex },
|
|
306
|
+
alignItems && { alignItems },
|
|
307
|
+
justifyContent && { justifyContent },
|
|
308
|
+
flexWrap && { flexWrap },
|
|
309
|
+
width !== void 0 && { width },
|
|
310
|
+
height !== void 0 && { height },
|
|
280
311
|
padding && { padding: theme.spacing[padding] },
|
|
281
312
|
paddingHorizontal && { paddingHorizontal: theme.spacing[paddingHorizontal] },
|
|
282
313
|
paddingVertical && { paddingVertical: theme.spacing[paddingVertical] },
|
|
@@ -292,6 +323,10 @@ function Row({
|
|
|
292
323
|
}
|
|
293
324
|
function Column({
|
|
294
325
|
children,
|
|
326
|
+
flex,
|
|
327
|
+
alignItems,
|
|
328
|
+
justifyContent,
|
|
329
|
+
flexWrap,
|
|
295
330
|
padding,
|
|
296
331
|
paddingHorizontal,
|
|
297
332
|
paddingVertical,
|
|
@@ -301,12 +336,20 @@ function Column({
|
|
|
301
336
|
gap,
|
|
302
337
|
backgroundColor,
|
|
303
338
|
borderRadius,
|
|
339
|
+
width,
|
|
340
|
+
height,
|
|
304
341
|
style,
|
|
305
342
|
testID
|
|
306
343
|
}) {
|
|
307
344
|
const { theme } = useTheme();
|
|
308
345
|
const columnStyle = [
|
|
309
346
|
{ flexDirection: "column" },
|
|
347
|
+
flex !== void 0 && { flex },
|
|
348
|
+
alignItems && { alignItems },
|
|
349
|
+
justifyContent && { justifyContent },
|
|
350
|
+
flexWrap && { flexWrap },
|
|
351
|
+
width !== void 0 && { width },
|
|
352
|
+
height !== void 0 && { height },
|
|
310
353
|
padding && { padding: theme.spacing[padding] },
|
|
311
354
|
paddingHorizontal && { paddingHorizontal: theme.spacing[paddingHorizontal] },
|
|
312
355
|
paddingVertical && { paddingVertical: theme.spacing[paddingVertical] },
|
|
@@ -321,17 +364,72 @@ function Column({
|
|
|
321
364
|
return /* @__PURE__ */ import_react2.default.createElement(import_react_native2.View, { style: columnStyle, testID }, children);
|
|
322
365
|
}
|
|
323
366
|
|
|
324
|
-
// src/components/
|
|
367
|
+
// src/components/layouts/Collapsible.tsx
|
|
325
368
|
var import_react3 = __toESM(require("react"));
|
|
326
369
|
var import_react_native3 = require("react-native");
|
|
327
|
-
|
|
370
|
+
if (import_react_native3.Platform.OS === "android" && import_react_native3.UIManager.setLayoutAnimationEnabledExperimental) {
|
|
371
|
+
import_react_native3.UIManager.setLayoutAnimationEnabledExperimental(true);
|
|
372
|
+
}
|
|
373
|
+
function Collapsible({
|
|
374
|
+
title,
|
|
328
375
|
children,
|
|
329
|
-
|
|
330
|
-
color,
|
|
331
|
-
textAlign,
|
|
376
|
+
initiallyExpanded = false,
|
|
332
377
|
style,
|
|
333
378
|
testID
|
|
334
379
|
}) {
|
|
380
|
+
const { theme } = useTheme();
|
|
381
|
+
const [expanded, setExpanded] = (0, import_react3.useState)(initiallyExpanded);
|
|
382
|
+
const toggleExpanded = () => {
|
|
383
|
+
import_react_native3.LayoutAnimation.configureNext(import_react_native3.LayoutAnimation.Presets.easeInEaseOut);
|
|
384
|
+
setExpanded(!expanded);
|
|
385
|
+
};
|
|
386
|
+
return /* @__PURE__ */ import_react3.default.createElement(
|
|
387
|
+
import_react_native3.View,
|
|
388
|
+
{
|
|
389
|
+
style: [
|
|
390
|
+
{
|
|
391
|
+
borderWidth: 1,
|
|
392
|
+
borderColor: theme.colors.border,
|
|
393
|
+
borderRadius: theme.borderRadius.md,
|
|
394
|
+
overflow: "hidden"
|
|
395
|
+
},
|
|
396
|
+
style
|
|
397
|
+
],
|
|
398
|
+
testID
|
|
399
|
+
},
|
|
400
|
+
/* @__PURE__ */ import_react3.default.createElement(
|
|
401
|
+
import_react_native3.TouchableOpacity,
|
|
402
|
+
{
|
|
403
|
+
activeOpacity: 0.7,
|
|
404
|
+
onPress: toggleExpanded,
|
|
405
|
+
style: {
|
|
406
|
+
flexDirection: "row",
|
|
407
|
+
justifyContent: "space-between",
|
|
408
|
+
alignItems: "center",
|
|
409
|
+
padding: theme.spacing.md,
|
|
410
|
+
backgroundColor: theme.colors.surface
|
|
411
|
+
}
|
|
412
|
+
},
|
|
413
|
+
/* @__PURE__ */ import_react3.default.createElement(import_react_native3.Text, { style: [theme.typography.body1, { color: theme.colors.text, fontWeight: "600" }] }, title),
|
|
414
|
+
/* @__PURE__ */ import_react3.default.createElement(import_react_native3.Text, { style: [theme.typography.h3, { color: theme.colors.textSecondary }] }, expanded ? "\u2212" : "+")
|
|
415
|
+
),
|
|
416
|
+
expanded && /* @__PURE__ */ import_react3.default.createElement(
|
|
417
|
+
import_react_native3.View,
|
|
418
|
+
{
|
|
419
|
+
style: {
|
|
420
|
+
padding: theme.spacing.md,
|
|
421
|
+
backgroundColor: theme.colors.background
|
|
422
|
+
}
|
|
423
|
+
},
|
|
424
|
+
children
|
|
425
|
+
)
|
|
426
|
+
);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
// src/components/typography/Text.tsx
|
|
430
|
+
var import_react4 = __toESM(require("react"));
|
|
431
|
+
var import_react_native4 = require("react-native");
|
|
432
|
+
function Text({ children, variant = "body1", color, textAlign, style, testID }) {
|
|
335
433
|
const { theme } = useTheme();
|
|
336
434
|
const textStyle = [
|
|
337
435
|
theme.typography[variant],
|
|
@@ -339,60 +437,60 @@ function Text({
|
|
|
339
437
|
textAlign && { textAlign },
|
|
340
438
|
style
|
|
341
439
|
];
|
|
342
|
-
return /* @__PURE__ */
|
|
440
|
+
return /* @__PURE__ */ import_react4.default.createElement(import_react_native4.Text, { style: textStyle, testID }, children);
|
|
343
441
|
}
|
|
344
442
|
function H1(props) {
|
|
345
|
-
return /* @__PURE__ */
|
|
443
|
+
return /* @__PURE__ */ import_react4.default.createElement(Text, { ...props, variant: "h1" });
|
|
346
444
|
}
|
|
347
445
|
function H2(props) {
|
|
348
|
-
return /* @__PURE__ */
|
|
446
|
+
return /* @__PURE__ */ import_react4.default.createElement(Text, { ...props, variant: "h2" });
|
|
349
447
|
}
|
|
350
448
|
function H3(props) {
|
|
351
|
-
return /* @__PURE__ */
|
|
449
|
+
return /* @__PURE__ */ import_react4.default.createElement(Text, { ...props, variant: "h3" });
|
|
352
450
|
}
|
|
353
451
|
function H4(props) {
|
|
354
|
-
return /* @__PURE__ */
|
|
452
|
+
return /* @__PURE__ */ import_react4.default.createElement(Text, { ...props, variant: "h4" });
|
|
355
453
|
}
|
|
356
454
|
function H5(props) {
|
|
357
|
-
return /* @__PURE__ */
|
|
455
|
+
return /* @__PURE__ */ import_react4.default.createElement(Text, { ...props, variant: "h5" });
|
|
358
456
|
}
|
|
359
457
|
function H6(props) {
|
|
360
|
-
return /* @__PURE__ */
|
|
458
|
+
return /* @__PURE__ */ import_react4.default.createElement(Text, { ...props, variant: "h6" });
|
|
361
459
|
}
|
|
362
460
|
function Body1(props) {
|
|
363
|
-
return /* @__PURE__ */
|
|
461
|
+
return /* @__PURE__ */ import_react4.default.createElement(Text, { ...props, variant: "body1" });
|
|
364
462
|
}
|
|
365
463
|
function Body2(props) {
|
|
366
|
-
return /* @__PURE__ */
|
|
464
|
+
return /* @__PURE__ */ import_react4.default.createElement(Text, { ...props, variant: "body2" });
|
|
367
465
|
}
|
|
368
466
|
function Body3(props) {
|
|
369
|
-
return /* @__PURE__ */
|
|
467
|
+
return /* @__PURE__ */ import_react4.default.createElement(Text, { ...props, variant: "body3" });
|
|
370
468
|
}
|
|
371
469
|
function Body4(props) {
|
|
372
|
-
return /* @__PURE__ */
|
|
470
|
+
return /* @__PURE__ */ import_react4.default.createElement(Text, { ...props, variant: "body4" });
|
|
373
471
|
}
|
|
374
472
|
function Body5(props) {
|
|
375
|
-
return /* @__PURE__ */
|
|
473
|
+
return /* @__PURE__ */ import_react4.default.createElement(Text, { ...props, variant: "body5" });
|
|
376
474
|
}
|
|
377
475
|
function Body6(props) {
|
|
378
|
-
return /* @__PURE__ */
|
|
476
|
+
return /* @__PURE__ */ import_react4.default.createElement(Text, { ...props, variant: "body6" });
|
|
379
477
|
}
|
|
380
478
|
function SubTitle1(props) {
|
|
381
|
-
return /* @__PURE__ */
|
|
479
|
+
return /* @__PURE__ */ import_react4.default.createElement(Text, { ...props, variant: "subtitle1" });
|
|
382
480
|
}
|
|
383
481
|
function SubTitle2(props) {
|
|
384
|
-
return /* @__PURE__ */
|
|
482
|
+
return /* @__PURE__ */ import_react4.default.createElement(Text, { ...props, variant: "subtitle2" });
|
|
385
483
|
}
|
|
386
484
|
function Caption(props) {
|
|
387
|
-
return /* @__PURE__ */
|
|
485
|
+
return /* @__PURE__ */ import_react4.default.createElement(Text, { ...props, variant: "caption" });
|
|
388
486
|
}
|
|
389
487
|
function Overline(props) {
|
|
390
|
-
return /* @__PURE__ */
|
|
488
|
+
return /* @__PURE__ */ import_react4.default.createElement(Text, { ...props, variant: "overline" });
|
|
391
489
|
}
|
|
392
490
|
|
|
393
491
|
// src/components/inputs/Button.tsx
|
|
394
|
-
var
|
|
395
|
-
var
|
|
492
|
+
var import_react5 = __toESM(require("react"));
|
|
493
|
+
var import_react_native5 = require("react-native");
|
|
396
494
|
function Button({
|
|
397
495
|
label,
|
|
398
496
|
onPress,
|
|
@@ -469,21 +567,15 @@ function Button({
|
|
|
469
567
|
style
|
|
470
568
|
];
|
|
471
569
|
const textColor = variant === "ghost" ? theme.colors.primary : theme.colors.white;
|
|
472
|
-
return /* @__PURE__ */
|
|
473
|
-
|
|
570
|
+
return /* @__PURE__ */ import_react5.default.createElement(
|
|
571
|
+
import_react_native5.TouchableOpacity,
|
|
474
572
|
{
|
|
475
573
|
style: buttonStyle,
|
|
476
574
|
onPress,
|
|
477
575
|
disabled: disabled || loading,
|
|
478
576
|
testID
|
|
479
577
|
},
|
|
480
|
-
/* @__PURE__ */
|
|
481
|
-
import_react_native4.ActivityIndicator,
|
|
482
|
-
{
|
|
483
|
-
color: textColor,
|
|
484
|
-
size: size === "small" ? "small" : "large"
|
|
485
|
-
}
|
|
486
|
-
) : /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, icon && /* @__PURE__ */ import_react4.default.createElement(import_react_native4.View, { style: styles.icon }, icon), /* @__PURE__ */ import_react4.default.createElement(
|
|
578
|
+
/* @__PURE__ */ import_react5.default.createElement(import_react_native5.View, { style: styles.content }, loading ? /* @__PURE__ */ import_react5.default.createElement(import_react_native5.ActivityIndicator, { color: textColor, size: size === "small" ? "small" : "large" }) : /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null, icon && /* @__PURE__ */ import_react5.default.createElement(import_react_native5.View, { style: styles.icon }, icon), /* @__PURE__ */ import_react5.default.createElement(
|
|
487
579
|
Text,
|
|
488
580
|
{
|
|
489
581
|
variant: size === "small" ? "body3" : "body1",
|
|
@@ -494,7 +586,7 @@ function Button({
|
|
|
494
586
|
)))
|
|
495
587
|
);
|
|
496
588
|
}
|
|
497
|
-
var styles =
|
|
589
|
+
var styles = import_react_native5.StyleSheet.create({
|
|
498
590
|
button: {
|
|
499
591
|
justifyContent: "center",
|
|
500
592
|
alignItems: "center",
|
|
@@ -512,4 +604,378 @@ var styles = import_react_native4.StyleSheet.create({
|
|
|
512
604
|
fontWeight: "600"
|
|
513
605
|
}
|
|
514
606
|
});
|
|
607
|
+
|
|
608
|
+
// src/components/inputs/Input.tsx
|
|
609
|
+
var import_react6 = __toESM(require("react"));
|
|
610
|
+
var import_react_native6 = require("react-native");
|
|
611
|
+
function Input({
|
|
612
|
+
value,
|
|
613
|
+
onChangeText,
|
|
614
|
+
placeholder,
|
|
615
|
+
label,
|
|
616
|
+
error,
|
|
617
|
+
editable = true,
|
|
618
|
+
secureTextEntry = false,
|
|
619
|
+
keyboardType = "default",
|
|
620
|
+
multiline = false,
|
|
621
|
+
numberOfLines = 1,
|
|
622
|
+
style,
|
|
623
|
+
testID
|
|
624
|
+
}) {
|
|
625
|
+
const { theme } = useTheme();
|
|
626
|
+
return /* @__PURE__ */ import_react6.default.createElement(import_react_native6.View, { style: [styles2.container, style] }, label && /* @__PURE__ */ import_react6.default.createElement(
|
|
627
|
+
import_react_native6.Text,
|
|
628
|
+
{
|
|
629
|
+
style: [
|
|
630
|
+
theme.typography.body2,
|
|
631
|
+
{
|
|
632
|
+
color: error ? theme.colors.error : theme.colors.textSecondary,
|
|
633
|
+
marginBottom: theme.spacing.xs
|
|
634
|
+
}
|
|
635
|
+
]
|
|
636
|
+
},
|
|
637
|
+
label
|
|
638
|
+
), /* @__PURE__ */ import_react6.default.createElement(
|
|
639
|
+
import_react_native6.TextInput,
|
|
640
|
+
{
|
|
641
|
+
value,
|
|
642
|
+
onChangeText,
|
|
643
|
+
placeholder,
|
|
644
|
+
placeholderTextColor: theme.colors.textTertiary,
|
|
645
|
+
editable,
|
|
646
|
+
secureTextEntry,
|
|
647
|
+
keyboardType,
|
|
648
|
+
multiline,
|
|
649
|
+
numberOfLines: multiline ? numberOfLines : 1,
|
|
650
|
+
testID,
|
|
651
|
+
style: [
|
|
652
|
+
theme.typography.body1,
|
|
653
|
+
{
|
|
654
|
+
borderWidth: 1,
|
|
655
|
+
borderColor: error ? theme.colors.error : theme.colors.border,
|
|
656
|
+
borderRadius: theme.borderRadius.sm,
|
|
657
|
+
padding: theme.spacing.md,
|
|
658
|
+
color: theme.colors.text,
|
|
659
|
+
backgroundColor: editable ? theme.colors.surface : theme.colors.disabled,
|
|
660
|
+
minHeight: multiline ? numberOfLines * 24 + theme.spacing.md * 2 : void 0
|
|
661
|
+
}
|
|
662
|
+
]
|
|
663
|
+
}
|
|
664
|
+
), error && /* @__PURE__ */ import_react6.default.createElement(
|
|
665
|
+
import_react_native6.Text,
|
|
666
|
+
{
|
|
667
|
+
style: [
|
|
668
|
+
theme.typography.caption,
|
|
669
|
+
{ color: theme.colors.error, marginTop: theme.spacing.xs }
|
|
670
|
+
]
|
|
671
|
+
},
|
|
672
|
+
error
|
|
673
|
+
));
|
|
674
|
+
}
|
|
675
|
+
var styles2 = import_react_native6.StyleSheet.create({
|
|
676
|
+
container: {
|
|
677
|
+
width: "100%"
|
|
678
|
+
}
|
|
679
|
+
});
|
|
680
|
+
|
|
681
|
+
// src/components/inputs/CheckBox.tsx
|
|
682
|
+
var import_react7 = __toESM(require("react"));
|
|
683
|
+
var import_react_native7 = require("react-native");
|
|
684
|
+
function CheckBox({
|
|
685
|
+
value,
|
|
686
|
+
onValueChange,
|
|
687
|
+
label,
|
|
688
|
+
disabled = false,
|
|
689
|
+
style,
|
|
690
|
+
testID
|
|
691
|
+
}) {
|
|
692
|
+
const { theme } = useTheme();
|
|
693
|
+
return /* @__PURE__ */ import_react7.default.createElement(
|
|
694
|
+
import_react_native7.TouchableOpacity,
|
|
695
|
+
{
|
|
696
|
+
activeOpacity: 0.7,
|
|
697
|
+
onPress: () => !disabled && onValueChange(!value),
|
|
698
|
+
disabled,
|
|
699
|
+
style: [styles3.container, style],
|
|
700
|
+
testID
|
|
701
|
+
},
|
|
702
|
+
/* @__PURE__ */ import_react7.default.createElement(
|
|
703
|
+
import_react_native7.View,
|
|
704
|
+
{
|
|
705
|
+
style: [
|
|
706
|
+
styles3.checkbox,
|
|
707
|
+
{
|
|
708
|
+
borderWidth: 2,
|
|
709
|
+
borderColor: disabled ? theme.colors.disabled : value ? theme.colors.primary : theme.colors.border,
|
|
710
|
+
backgroundColor: disabled ? theme.colors.disabled : value ? theme.colors.primary : "transparent",
|
|
711
|
+
borderRadius: theme.borderRadius.xs,
|
|
712
|
+
width: 24,
|
|
713
|
+
height: 24
|
|
714
|
+
}
|
|
715
|
+
]
|
|
716
|
+
},
|
|
717
|
+
value && /* @__PURE__ */ import_react7.default.createElement(import_react_native7.Text, { style: [styles3.checkmark, { color: theme.colors.white }] }, "\u2713")
|
|
718
|
+
),
|
|
719
|
+
label && /* @__PURE__ */ import_react7.default.createElement(
|
|
720
|
+
import_react_native7.Text,
|
|
721
|
+
{
|
|
722
|
+
style: [
|
|
723
|
+
theme.typography.body1,
|
|
724
|
+
{
|
|
725
|
+
color: disabled ? theme.colors.textTertiary : theme.colors.text,
|
|
726
|
+
marginLeft: theme.spacing.sm
|
|
727
|
+
}
|
|
728
|
+
]
|
|
729
|
+
},
|
|
730
|
+
label
|
|
731
|
+
)
|
|
732
|
+
);
|
|
733
|
+
}
|
|
734
|
+
var styles3 = import_react_native7.StyleSheet.create({
|
|
735
|
+
container: {
|
|
736
|
+
flexDirection: "row",
|
|
737
|
+
alignItems: "center"
|
|
738
|
+
},
|
|
739
|
+
checkbox: {
|
|
740
|
+
justifyContent: "center",
|
|
741
|
+
alignItems: "center"
|
|
742
|
+
},
|
|
743
|
+
checkmark: {
|
|
744
|
+
fontSize: 16,
|
|
745
|
+
fontWeight: "bold"
|
|
746
|
+
}
|
|
747
|
+
});
|
|
748
|
+
|
|
749
|
+
// src/components/inputs/RadioButton.tsx
|
|
750
|
+
var import_react8 = __toESM(require("react"));
|
|
751
|
+
var import_react_native8 = require("react-native");
|
|
752
|
+
function RadioButton({
|
|
753
|
+
value,
|
|
754
|
+
selected,
|
|
755
|
+
onSelect,
|
|
756
|
+
label,
|
|
757
|
+
disabled = false,
|
|
758
|
+
style,
|
|
759
|
+
testID
|
|
760
|
+
}) {
|
|
761
|
+
const { theme } = useTheme();
|
|
762
|
+
const isSelected = value === selected;
|
|
763
|
+
return /* @__PURE__ */ import_react8.default.createElement(
|
|
764
|
+
import_react_native8.TouchableOpacity,
|
|
765
|
+
{
|
|
766
|
+
activeOpacity: 0.7,
|
|
767
|
+
onPress: () => !disabled && onSelect(value),
|
|
768
|
+
disabled,
|
|
769
|
+
style: [styles4.container, style],
|
|
770
|
+
testID
|
|
771
|
+
},
|
|
772
|
+
/* @__PURE__ */ import_react8.default.createElement(
|
|
773
|
+
import_react_native8.View,
|
|
774
|
+
{
|
|
775
|
+
style: [
|
|
776
|
+
styles4.radio,
|
|
777
|
+
{
|
|
778
|
+
borderWidth: 2,
|
|
779
|
+
borderColor: disabled ? theme.colors.disabled : isSelected ? theme.colors.primary : theme.colors.border,
|
|
780
|
+
width: 24,
|
|
781
|
+
height: 24,
|
|
782
|
+
borderRadius: 12
|
|
783
|
+
}
|
|
784
|
+
]
|
|
785
|
+
},
|
|
786
|
+
isSelected && /* @__PURE__ */ import_react8.default.createElement(
|
|
787
|
+
import_react_native8.View,
|
|
788
|
+
{
|
|
789
|
+
style: [
|
|
790
|
+
styles4.radioInner,
|
|
791
|
+
{
|
|
792
|
+
backgroundColor: disabled ? theme.colors.disabled : theme.colors.primary,
|
|
793
|
+
width: 12,
|
|
794
|
+
height: 12,
|
|
795
|
+
borderRadius: 6
|
|
796
|
+
}
|
|
797
|
+
]
|
|
798
|
+
}
|
|
799
|
+
)
|
|
800
|
+
),
|
|
801
|
+
label && /* @__PURE__ */ import_react8.default.createElement(
|
|
802
|
+
import_react_native8.Text,
|
|
803
|
+
{
|
|
804
|
+
style: [
|
|
805
|
+
theme.typography.body1,
|
|
806
|
+
{
|
|
807
|
+
color: disabled ? theme.colors.textTertiary : theme.colors.text,
|
|
808
|
+
marginLeft: theme.spacing.sm
|
|
809
|
+
}
|
|
810
|
+
]
|
|
811
|
+
},
|
|
812
|
+
label
|
|
813
|
+
)
|
|
814
|
+
);
|
|
815
|
+
}
|
|
816
|
+
var styles4 = import_react_native8.StyleSheet.create({
|
|
817
|
+
container: {
|
|
818
|
+
flexDirection: "row",
|
|
819
|
+
alignItems: "center"
|
|
820
|
+
},
|
|
821
|
+
radio: {
|
|
822
|
+
justifyContent: "center",
|
|
823
|
+
alignItems: "center"
|
|
824
|
+
},
|
|
825
|
+
radioInner: {}
|
|
826
|
+
});
|
|
827
|
+
|
|
828
|
+
// src/components/inputs/Switch.tsx
|
|
829
|
+
var import_react9 = __toESM(require("react"));
|
|
830
|
+
var import_react_native9 = require("react-native");
|
|
831
|
+
function Switch({ value, onValueChange, disabled = false, style, testID }) {
|
|
832
|
+
const { theme } = useTheme();
|
|
833
|
+
return /* @__PURE__ */ import_react9.default.createElement(
|
|
834
|
+
import_react_native9.Switch,
|
|
835
|
+
{
|
|
836
|
+
value,
|
|
837
|
+
onValueChange,
|
|
838
|
+
disabled,
|
|
839
|
+
trackColor: {
|
|
840
|
+
false: theme.colors.border,
|
|
841
|
+
true: theme.colors.primary
|
|
842
|
+
},
|
|
843
|
+
thumbColor: theme.colors.white,
|
|
844
|
+
ios_backgroundColor: theme.colors.border,
|
|
845
|
+
style,
|
|
846
|
+
testID
|
|
847
|
+
}
|
|
848
|
+
);
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
// src/components/display/ProgressBar.tsx
|
|
852
|
+
var import_react10 = __toESM(require("react"));
|
|
853
|
+
var import_react_native10 = require("react-native");
|
|
854
|
+
function ProgressBar({
|
|
855
|
+
progress,
|
|
856
|
+
height = 8,
|
|
857
|
+
color,
|
|
858
|
+
backgroundColor,
|
|
859
|
+
borderRadius = "full",
|
|
860
|
+
style,
|
|
861
|
+
testID
|
|
862
|
+
}) {
|
|
863
|
+
const { theme } = useTheme();
|
|
864
|
+
const clampedProgress = Math.max(0, Math.min(1, progress));
|
|
865
|
+
return /* @__PURE__ */ import_react10.default.createElement(
|
|
866
|
+
import_react_native10.View,
|
|
867
|
+
{
|
|
868
|
+
style: [
|
|
869
|
+
{
|
|
870
|
+
height,
|
|
871
|
+
backgroundColor: backgroundColor || theme.colors.border,
|
|
872
|
+
borderRadius: theme.borderRadius[borderRadius],
|
|
873
|
+
overflow: "hidden"
|
|
874
|
+
},
|
|
875
|
+
style
|
|
876
|
+
],
|
|
877
|
+
testID
|
|
878
|
+
},
|
|
879
|
+
/* @__PURE__ */ import_react10.default.createElement(
|
|
880
|
+
import_react_native10.View,
|
|
881
|
+
{
|
|
882
|
+
style: {
|
|
883
|
+
height: "100%",
|
|
884
|
+
width: `${clampedProgress * 100}%`,
|
|
885
|
+
backgroundColor: color || theme.colors.primary
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
)
|
|
889
|
+
);
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
// src/components/display/Badge.tsx
|
|
893
|
+
var import_react11 = __toESM(require("react"));
|
|
894
|
+
var import_react_native11 = require("react-native");
|
|
895
|
+
function Badge({
|
|
896
|
+
children,
|
|
897
|
+
variant = "primary",
|
|
898
|
+
size = "medium",
|
|
899
|
+
style,
|
|
900
|
+
testID
|
|
901
|
+
}) {
|
|
902
|
+
const { theme } = useTheme();
|
|
903
|
+
const variantColors = {
|
|
904
|
+
primary: theme.colors.primary,
|
|
905
|
+
secondary: theme.colors.secondary,
|
|
906
|
+
success: theme.colors.success,
|
|
907
|
+
error: theme.colors.error,
|
|
908
|
+
warning: theme.colors.warning,
|
|
909
|
+
info: theme.colors.info
|
|
910
|
+
};
|
|
911
|
+
const sizeStyles = {
|
|
912
|
+
small: {
|
|
913
|
+
paddingHorizontal: theme.spacing.xs,
|
|
914
|
+
paddingVertical: theme.spacing.xs / 2,
|
|
915
|
+
fontSize: 10
|
|
916
|
+
},
|
|
917
|
+
medium: {
|
|
918
|
+
paddingHorizontal: theme.spacing.sm,
|
|
919
|
+
paddingVertical: theme.spacing.xs,
|
|
920
|
+
fontSize: 12
|
|
921
|
+
},
|
|
922
|
+
large: {
|
|
923
|
+
paddingHorizontal: theme.spacing.md,
|
|
924
|
+
paddingVertical: theme.spacing.sm,
|
|
925
|
+
fontSize: 14
|
|
926
|
+
}
|
|
927
|
+
};
|
|
928
|
+
return /* @__PURE__ */ import_react11.default.createElement(
|
|
929
|
+
import_react_native11.View,
|
|
930
|
+
{
|
|
931
|
+
style: [
|
|
932
|
+
{
|
|
933
|
+
backgroundColor: variantColors[variant],
|
|
934
|
+
borderRadius: theme.borderRadius.full,
|
|
935
|
+
alignSelf: "flex-start",
|
|
936
|
+
...sizeStyles[size]
|
|
937
|
+
},
|
|
938
|
+
style
|
|
939
|
+
],
|
|
940
|
+
testID
|
|
941
|
+
},
|
|
942
|
+
/* @__PURE__ */ import_react11.default.createElement(
|
|
943
|
+
import_react_native11.Text,
|
|
944
|
+
{
|
|
945
|
+
style: {
|
|
946
|
+
color: theme.colors.white,
|
|
947
|
+
fontSize: sizeStyles[size].fontSize,
|
|
948
|
+
fontWeight: "600"
|
|
949
|
+
}
|
|
950
|
+
},
|
|
951
|
+
children
|
|
952
|
+
)
|
|
953
|
+
);
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
// src/components/display/Divider.tsx
|
|
957
|
+
var import_react12 = __toESM(require("react"));
|
|
958
|
+
var import_react_native12 = require("react-native");
|
|
959
|
+
function Divider({
|
|
960
|
+
orientation = "horizontal",
|
|
961
|
+
thickness = 1,
|
|
962
|
+
color,
|
|
963
|
+
style,
|
|
964
|
+
testID
|
|
965
|
+
}) {
|
|
966
|
+
const { theme } = useTheme();
|
|
967
|
+
return /* @__PURE__ */ import_react12.default.createElement(
|
|
968
|
+
import_react_native12.View,
|
|
969
|
+
{
|
|
970
|
+
style: [
|
|
971
|
+
{
|
|
972
|
+
backgroundColor: color || theme.colors.border,
|
|
973
|
+
...orientation === "horizontal" ? { height: thickness, width: "100%" } : { width: thickness, height: "100%" }
|
|
974
|
+
},
|
|
975
|
+
style
|
|
976
|
+
],
|
|
977
|
+
testID
|
|
978
|
+
}
|
|
979
|
+
);
|
|
980
|
+
}
|
|
515
981
|
//# sourceMappingURL=index.js.map
|