@rojaostudio/ds 1.0.0 → 1.0.2
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/components/accordion.js +43 -37
- package/dist/components/alert.js +35 -28
- package/dist/components/avatar.js +41 -34
- package/dist/components/badge.js +21 -14
- package/dist/components/blocker-card.js +11 -2
- package/dist/components/bottom-sheet.js +60 -53
- package/dist/components/breadcrumb.js +32 -22
- package/dist/components/button.js +18 -11
- package/dist/components/card.js +24 -9
- package/dist/components/chat-bubble.js +6 -5
- package/dist/components/checkbox.js +61 -48
- package/dist/components/chip-input.js +98 -81
- package/dist/components/chips.js +36 -29
- package/dist/components/choice-card.js +48 -42
- package/dist/components/choice-carousel.js +79 -74
- package/dist/components/choice-preview-card.js +17 -6
- package/dist/components/color-input.js +41 -35
- package/dist/components/combobox.js +97 -75
- package/dist/components/context-menu.js +17 -13
- package/dist/components/copilot-hint.js +40 -31
- package/dist/components/copy-field.js +8 -5
- package/dist/components/currency-input.js +40 -32
- package/dist/components/danger-zone.js +19 -9
- package/dist/components/data-table-header.js +185 -135
- package/dist/components/date-picker.js +114 -95
- package/dist/components/divider.js +11 -8
- package/dist/components/drawer.js +40 -28
- package/dist/components/dropzone.js +23 -20
- package/dist/components/empty-state.js +26 -23
- package/dist/components/fab.js +38 -26
- package/dist/components/filter-chip.js +20 -16
- package/dist/components/floating-stepper.js +42 -32
- package/dist/components/form-card-header.js +9 -1
- package/dist/components/icon-button.js +19 -13
- package/dist/components/image-crop-modal.js +69 -48
- package/dist/components/image-upload.js +172 -128
- package/dist/components/input.js +90 -62
- package/dist/components/insight-card.js +12 -1
- package/dist/components/label.js +12 -7
- package/dist/components/media-tile.js +11 -8
- package/dist/components/menu.js +28 -25
- package/dist/components/modal.js +43 -28
- package/dist/components/notice.js +34 -16
- package/dist/components/option-tile.js +55 -49
- package/dist/components/page-shell.js +13 -6
- package/dist/components/page-skeleton.js +32 -2
- package/dist/components/page-tabs.js +39 -26
- package/dist/components/pagination.js +38 -33
- package/dist/components/paywall-banner.js +19 -3
- package/dist/components/paywall.js +18 -8
- package/dist/components/phone-frame.js +5 -4
- package/dist/components/phone-input.js +50 -31
- package/dist/components/pix-icon.js +11 -6
- package/dist/components/popover.js +27 -23
- package/dist/components/pricing-card.js +16 -1
- package/dist/components/qr-display.js +16 -11
- package/dist/components/radio.js +73 -56
- package/dist/components/row-actions.js +61 -53
- package/dist/components/saving-bar-context.js +35 -29
- package/dist/components/saving-bar.js +36 -33
- package/dist/components/search.js +49 -44
- package/dist/components/section-card.js +43 -35
- package/dist/components/section-header.js +11 -1
- package/dist/components/select.js +83 -62
- package/dist/components/selectable-card.js +10 -3
- package/dist/components/setting-row.js +11 -1
- package/dist/components/settings-list.js +9 -5
- package/dist/components/skeleton.js +6 -5
- package/dist/components/slider.js +52 -38
- package/dist/components/spinner.js +18 -12
- package/dist/components/step-progress.js +11 -10
- package/dist/components/summary-bar.js +33 -28
- package/dist/components/table.js +20 -15
- package/dist/components/textarea.js +40 -24
- package/dist/components/themed.d.ts +1 -1
- package/dist/components/themed.js +2 -1
- package/dist/components/time-picker.js +117 -97
- package/dist/components/toaster.js +80 -74
- package/dist/components/toggle-card-compact.js +79 -71
- package/dist/components/toggle-card.js +61 -53
- package/dist/components/toggle-group.js +35 -29
- package/dist/components/toggle.js +46 -36
- package/dist/components/tooltip.js +30 -25
- package/dist/components/typing-indicator.js +10 -7
- package/dist/targets/native/components/accordion.js +31 -25
- package/dist/targets/native/components/alert.js +22 -16
- package/dist/targets/native/components/avatar.js +36 -29
- package/dist/targets/native/components/badge.js +4 -3
- package/dist/targets/native/components/button.js +11 -4
- package/dist/targets/native/components/card.js +2 -1
- package/dist/targets/native/components/checkbox.js +18 -15
- package/dist/targets/native/components/chips.js +19 -16
- package/dist/targets/native/components/choice-card.js +29 -23
- package/dist/targets/native/components/context-menu.js +13 -9
- package/dist/targets/native/components/currency-input.js +28 -25
- package/dist/targets/native/components/danger-zone.js +10 -4
- package/dist/targets/native/components/date-picker.js +86 -70
- package/dist/targets/native/components/divider.js +3 -2
- package/dist/targets/native/components/empty-state.js +6 -1
- package/dist/targets/native/components/fab.js +32 -26
- package/dist/targets/native/components/filter-chip.js +9 -8
- package/dist/targets/native/components/form-field.js +20 -10
- package/dist/targets/native/components/form-screen.js +50 -45
- package/dist/targets/native/components/google-icon.js +31 -25
- package/dist/targets/native/components/icon-button.js +6 -4
- package/dist/targets/native/components/icon.js +2 -1
- package/dist/targets/native/components/image-upload.js +59 -50
- package/dist/targets/native/components/input.js +41 -34
- package/dist/targets/native/components/list-item.js +29 -23
- package/dist/targets/native/components/menu.js +12 -10
- package/dist/targets/native/components/modal.js +41 -32
- package/dist/targets/native/components/paywall-banner.js +13 -4
- package/dist/targets/native/components/paywall.js +11 -1
- package/dist/targets/native/components/radio.js +19 -16
- package/dist/targets/native/components/search.js +41 -38
- package/dist/targets/native/components/select.js +71 -63
- package/dist/targets/native/components/sheet.js +36 -30
- package/dist/targets/native/components/skeleton.js +6 -5
- package/dist/targets/native/components/slider.js +51 -43
- package/dist/targets/native/components/spinner.js +2 -1
- package/dist/targets/native/components/stepper.js +14 -9
- package/dist/targets/native/components/switch.js +15 -14
- package/dist/targets/native/components/text.js +2 -1
- package/dist/targets/native/components/textarea.js +2 -1
- package/dist/targets/native/components/theme.js +2 -1
- package/dist/targets/native/components/toaster.js +24 -21
- package/dist/targets/native/index.d.ts +1 -1
- package/dist/targets/native/index.js +1 -3
- package/package.json +190 -194
- package/styles/base.css +3 -3
- package/brand/rojao-black-on-white.png +0 -0
- package/brand/rojao-black.png +0 -0
- package/brand/rojao-white-on-black.png +0 -0
- package/brand/rojao-white.png +0 -0
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
__objRest,
|
|
3
3
|
__spreadValues
|
|
4
4
|
} from "../../../chunk-ORMEWXMH.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
import { useState } from "react";
|
|
6
7
|
import { Pressable, StyleSheet, TextInput, View } from "react-native";
|
|
7
8
|
import { X } from "lucide-react-native";
|
|
@@ -44,44 +45,50 @@ function Input(_a) {
|
|
|
44
45
|
}
|
|
45
46
|
const hasValue = typeof rest.value === "string" ? rest.value.length > 0 : false;
|
|
46
47
|
const showClear = !!clearable && hasValue && rest.editable !== false;
|
|
47
|
-
return /* @__PURE__ */
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
styles.field,
|
|
52
|
-
{ borderColor, backgroundColor: t["--surface-default"] }
|
|
53
|
-
]
|
|
54
|
-
},
|
|
55
|
-
prefix ? /* @__PURE__ */ React.createElement(View, { style: styles.affix }, renderAffix(prefix, t)) : null,
|
|
56
|
-
/* @__PURE__ */ React.createElement(
|
|
57
|
-
TextInput,
|
|
58
|
-
__spreadValues({
|
|
59
|
-
placeholderTextColor: t["--text-placeholder"],
|
|
60
|
-
accessibilityLabel: accessibilityLabel != null ? accessibilityLabel : label,
|
|
61
|
-
accessibilityState: { disabled: rest.editable === false },
|
|
62
|
-
onFocus: handleFocus,
|
|
63
|
-
onBlur: handleBlur,
|
|
64
|
-
onChangeText,
|
|
65
|
-
style: [styles.input, { color: t["--text-primary"] }, style]
|
|
66
|
-
}, rest)
|
|
67
|
-
),
|
|
68
|
-
showClear ? /* @__PURE__ */ React.createElement(
|
|
69
|
-
Pressable,
|
|
48
|
+
return /* @__PURE__ */ jsxs(View, { style: { gap: 6 }, children: [
|
|
49
|
+
label ? /* @__PURE__ */ jsx(Text, { variant: "label", children: label }) : null,
|
|
50
|
+
/* @__PURE__ */ jsxs(
|
|
51
|
+
View,
|
|
70
52
|
{
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
53
|
+
style: [
|
|
54
|
+
styles.field,
|
|
55
|
+
{ borderColor, backgroundColor: t["--surface-default"] }
|
|
56
|
+
],
|
|
57
|
+
children: [
|
|
58
|
+
prefix ? /* @__PURE__ */ jsx(View, { style: styles.affix, children: renderAffix(prefix, t) }) : null,
|
|
59
|
+
/* @__PURE__ */ jsx(
|
|
60
|
+
TextInput,
|
|
61
|
+
__spreadValues({
|
|
62
|
+
placeholderTextColor: t["--text-placeholder"],
|
|
63
|
+
accessibilityLabel: accessibilityLabel != null ? accessibilityLabel : label,
|
|
64
|
+
accessibilityState: { disabled: rest.editable === false },
|
|
65
|
+
onFocus: handleFocus,
|
|
66
|
+
onBlur: handleBlur,
|
|
67
|
+
onChangeText,
|
|
68
|
+
style: [styles.input, { color: t["--text-primary"] }, style]
|
|
69
|
+
}, rest)
|
|
70
|
+
),
|
|
71
|
+
showClear ? /* @__PURE__ */ jsx(
|
|
72
|
+
Pressable,
|
|
73
|
+
{
|
|
74
|
+
onPress: () => onChangeText == null ? void 0 : onChangeText(""),
|
|
75
|
+
accessibilityRole: "button",
|
|
76
|
+
accessibilityLabel: "Clear",
|
|
77
|
+
hitSlop: 8,
|
|
78
|
+
style: styles.affix,
|
|
79
|
+
children: /* @__PURE__ */ jsx(X, { size: 16, color: t["--text-muted"] })
|
|
80
|
+
}
|
|
81
|
+
) : null,
|
|
82
|
+
suffix ? /* @__PURE__ */ jsx(View, { style: styles.affix, children: renderAffix(suffix, t) }) : null
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
typeof error === "string" && error ? /* @__PURE__ */ jsx(Text, { variant: "caption", color: "danger", children: error }) : null
|
|
87
|
+
] });
|
|
81
88
|
}
|
|
82
89
|
function renderAffix(node, t) {
|
|
83
90
|
if (typeof node === "string") {
|
|
84
|
-
return /* @__PURE__ */
|
|
91
|
+
return /* @__PURE__ */ jsx(Text, { variant: "body", style: { color: t["--text-muted"] }, children: node });
|
|
85
92
|
}
|
|
86
93
|
return node;
|
|
87
94
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "../../../chunk-ORMEWXMH.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { ChevronRight } from "lucide-react-native";
|
|
3
4
|
import { Pressable, View } from "react-native";
|
|
4
5
|
import { Text } from "./text.js";
|
|
@@ -14,7 +15,7 @@ function ListItem({
|
|
|
14
15
|
disabled
|
|
15
16
|
}) {
|
|
16
17
|
const t = useTheme();
|
|
17
|
-
const body = /* @__PURE__ */
|
|
18
|
+
const body = /* @__PURE__ */ jsxs(
|
|
18
19
|
View,
|
|
19
20
|
{
|
|
20
21
|
style: {
|
|
@@ -29,27 +30,32 @@ function ListItem({
|
|
|
29
30
|
borderColor: t["--border-subtle"],
|
|
30
31
|
backgroundColor: t["--surface-default"],
|
|
31
32
|
opacity: disabled ? 0.5 : 1
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
leading ? leading : Icon ? /* @__PURE__ */ React.createElement(
|
|
35
|
-
View,
|
|
36
|
-
{
|
|
37
|
-
style: {
|
|
38
|
-
width: 40,
|
|
39
|
-
height: 40,
|
|
40
|
-
borderRadius: 10,
|
|
41
|
-
alignItems: "center",
|
|
42
|
-
justifyContent: "center",
|
|
43
|
-
backgroundColor: t["--surface-raised"]
|
|
44
|
-
}
|
|
45
33
|
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
34
|
+
children: [
|
|
35
|
+
leading ? leading : Icon ? /* @__PURE__ */ jsx(
|
|
36
|
+
View,
|
|
37
|
+
{
|
|
38
|
+
style: {
|
|
39
|
+
width: 40,
|
|
40
|
+
height: 40,
|
|
41
|
+
borderRadius: 10,
|
|
42
|
+
alignItems: "center",
|
|
43
|
+
justifyContent: "center",
|
|
44
|
+
backgroundColor: t["--surface-raised"]
|
|
45
|
+
},
|
|
46
|
+
children: /* @__PURE__ */ jsx(Icon, { color: t["--icon-default"], size: 22 })
|
|
47
|
+
}
|
|
48
|
+
) : null,
|
|
49
|
+
/* @__PURE__ */ jsxs(View, { style: { flex: 1 }, children: [
|
|
50
|
+
/* @__PURE__ */ jsx(Text, { variant: "label", numberOfLines: 1, children: title }),
|
|
51
|
+
subtitle ? /* @__PURE__ */ jsx(Text, { variant: "caption", color: "muted", children: subtitle }) : null
|
|
52
|
+
] }),
|
|
53
|
+
trailing,
|
|
54
|
+
showChevron && onPress ? /* @__PURE__ */ jsx(View, { importantForAccessibility: "no", children: /* @__PURE__ */ jsx(ChevronRight, { color: t["--text-muted"], size: 20 }) }) : null
|
|
55
|
+
]
|
|
56
|
+
}
|
|
51
57
|
);
|
|
52
|
-
return onPress ? /* @__PURE__ */
|
|
58
|
+
return onPress ? /* @__PURE__ */ jsx(
|
|
53
59
|
Pressable,
|
|
54
60
|
{
|
|
55
61
|
onPress: disabled ? void 0 : onPress,
|
|
@@ -61,9 +67,9 @@ function ListItem({
|
|
|
61
67
|
android_ripple: { color: t["--surface-raised"] },
|
|
62
68
|
style: ({ pressed }) => [
|
|
63
69
|
pressed && !disabled ? { backgroundColor: t["--surface-raised"], borderRadius: 12 } : null
|
|
64
|
-
]
|
|
65
|
-
|
|
66
|
-
|
|
70
|
+
],
|
|
71
|
+
children: body
|
|
72
|
+
}
|
|
67
73
|
) : body;
|
|
68
74
|
}
|
|
69
75
|
export {
|
|
@@ -2,27 +2,27 @@ import {
|
|
|
2
2
|
__spreadProps,
|
|
3
3
|
__spreadValues
|
|
4
4
|
} from "../../../chunk-ORMEWXMH.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
import { Pressable, StyleSheet, View } from "react-native";
|
|
6
7
|
import { Sheet } from "./sheet.js";
|
|
7
8
|
import { Text } from "./text.js";
|
|
8
9
|
import { useTheme } from "./theme.js";
|
|
9
10
|
function Menu({ visible, onClose, items, children }) {
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
+
return /* @__PURE__ */ jsx(Sheet, { visible, onClose, children: /* @__PURE__ */ jsx(View, { accessibilityRole: "menu", style: styles.list, children: items ? items.map((item, i) => /* @__PURE__ */ jsx(
|
|
11
12
|
MenuItem,
|
|
12
|
-
__spreadProps(__spreadValues({
|
|
13
|
-
key: `${item.label}-${i}`
|
|
14
|
-
}, item), {
|
|
13
|
+
__spreadProps(__spreadValues({}, item), {
|
|
15
14
|
onPress: () => {
|
|
16
15
|
onClose();
|
|
17
16
|
item.onPress();
|
|
18
17
|
}
|
|
19
|
-
})
|
|
20
|
-
|
|
18
|
+
}),
|
|
19
|
+
`${item.label}-${i}`
|
|
20
|
+
)) : children }) });
|
|
21
21
|
}
|
|
22
22
|
function MenuItem({ label, icon: Icon, destructive, onPress, disabled }) {
|
|
23
23
|
const t = useTheme();
|
|
24
24
|
const fg = destructive ? t["--danger-text"] : t["--text-primary"];
|
|
25
|
-
return /* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ jsxs(
|
|
26
26
|
Pressable,
|
|
27
27
|
{
|
|
28
28
|
accessibilityRole: "menuitem",
|
|
@@ -38,10 +38,12 @@ function MenuItem({ label, icon: Icon, destructive, onPress, disabled }) {
|
|
|
38
38
|
backgroundColor: pressed && !disabled ? t["--surface-raised"] : t["--surface-default"],
|
|
39
39
|
opacity: disabled ? 0.5 : 1
|
|
40
40
|
}
|
|
41
|
+
],
|
|
42
|
+
children: [
|
|
43
|
+
Icon ? /* @__PURE__ */ jsx(View, { style: styles.icon, importantForAccessibility: "no", children: /* @__PURE__ */ jsx(Icon, { color: fg, size: 22 }) }) : null,
|
|
44
|
+
/* @__PURE__ */ jsx(Text, { variant: "label", numberOfLines: 1, style: { flex: 1, color: fg }, children: label })
|
|
41
45
|
]
|
|
42
|
-
}
|
|
43
|
-
Icon ? /* @__PURE__ */ React.createElement(View, { style: styles.icon, importantForAccessibility: "no" }, /* @__PURE__ */ React.createElement(Icon, { color: fg, size: 22 })) : null,
|
|
44
|
-
/* @__PURE__ */ React.createElement(Text, { variant: "label", numberOfLines: 1, style: { flex: 1, color: fg } }, label)
|
|
46
|
+
}
|
|
45
47
|
);
|
|
46
48
|
}
|
|
47
49
|
const styles = StyleSheet.create({
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "../../../chunk-ORMEWXMH.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { useEffect, useRef } from "react";
|
|
3
4
|
import { Animated, Modal as RNModal, Pressable, StyleSheet, Text, View } from "react-native";
|
|
4
5
|
import { Button } from "./button.js";
|
|
@@ -27,40 +28,48 @@ function Modal({
|
|
|
27
28
|
opacity.setValue(0);
|
|
28
29
|
}
|
|
29
30
|
}, [visible, scale, opacity]);
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
accessibilityRole: "alert",
|
|
43
|
-
style: [
|
|
44
|
-
styles.card,
|
|
45
|
-
{
|
|
46
|
-
backgroundColor: t["--surface-default"],
|
|
47
|
-
borderColor: t["--border-default"],
|
|
48
|
-
opacity,
|
|
49
|
-
transform: [{ scale }]
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
},
|
|
53
|
-
/* @__PURE__ */ React.createElement(Text, { style: [styles.title, { color: t["--text-primary"] }] }, title),
|
|
54
|
-
description ? /* @__PURE__ */ React.createElement(Text, { style: [styles.description, { color: t["--text-secondary"] }] }, description) : null,
|
|
55
|
-
/* @__PURE__ */ React.createElement(View, { style: styles.footer }, /* @__PURE__ */ React.createElement(Button, { label: cancelLabel, variant: "ghost", onPress: onCancel }), /* @__PURE__ */ React.createElement(
|
|
56
|
-
Button,
|
|
31
|
+
return /* @__PURE__ */ jsx(RNModal, { visible, transparent: true, animationType: "fade", onRequestClose: onCancel, children: /* @__PURE__ */ jsxs(View, { style: styles.root, children: [
|
|
32
|
+
/* @__PURE__ */ jsx(
|
|
33
|
+
Pressable,
|
|
34
|
+
{
|
|
35
|
+
style: styles.backdrop,
|
|
36
|
+
onPress: onCancel,
|
|
37
|
+
accessibilityRole: "button",
|
|
38
|
+
accessibilityLabel: "Fechar"
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
/* @__PURE__ */ jsxs(
|
|
42
|
+
Animated.View,
|
|
57
43
|
{
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
44
|
+
accessibilityViewIsModal: true,
|
|
45
|
+
accessibilityRole: "alert",
|
|
46
|
+
style: [
|
|
47
|
+
styles.card,
|
|
48
|
+
{
|
|
49
|
+
backgroundColor: t["--surface-default"],
|
|
50
|
+
borderColor: t["--border-default"],
|
|
51
|
+
opacity,
|
|
52
|
+
transform: [{ scale }]
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.title, { color: t["--text-primary"] }], children: title }),
|
|
57
|
+
description ? /* @__PURE__ */ jsx(Text, { style: [styles.description, { color: t["--text-secondary"] }], children: description }) : null,
|
|
58
|
+
/* @__PURE__ */ jsxs(View, { style: styles.footer, children: [
|
|
59
|
+
/* @__PURE__ */ jsx(Button, { label: cancelLabel, variant: "ghost", onPress: onCancel }),
|
|
60
|
+
/* @__PURE__ */ jsx(
|
|
61
|
+
Button,
|
|
62
|
+
{
|
|
63
|
+
label: confirmLabel,
|
|
64
|
+
variant: destructive ? "danger" : "primary",
|
|
65
|
+
onPress: onConfirm
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
] })
|
|
69
|
+
]
|
|
61
70
|
}
|
|
62
|
-
)
|
|
63
|
-
))
|
|
71
|
+
)
|
|
72
|
+
] }) });
|
|
64
73
|
}
|
|
65
74
|
const styles = StyleSheet.create({
|
|
66
75
|
root: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "../../../chunk-ORMEWXMH.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { Lock } from "lucide-react-native";
|
|
3
4
|
import { StyleSheet, View } from "react-native";
|
|
4
5
|
import { Button } from "./button.js";
|
|
@@ -6,17 +7,25 @@ import { Text } from "./text.js";
|
|
|
6
7
|
import { useTheme } from "./theme.js";
|
|
7
8
|
function PaywallBanner({ title, description, ctaLabel = "Ver planos", onPress }) {
|
|
8
9
|
const t = useTheme();
|
|
9
|
-
return /* @__PURE__ */
|
|
10
|
+
return /* @__PURE__ */ jsxs(
|
|
10
11
|
View,
|
|
11
12
|
{
|
|
12
13
|
accessibilityRole: "summary",
|
|
13
14
|
style: [
|
|
14
15
|
styles.container,
|
|
15
16
|
{ backgroundColor: t["--surface-raised"], borderColor: t["--border-default"] }
|
|
17
|
+
],
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ jsxs(View, { style: styles.row, children: [
|
|
20
|
+
/* @__PURE__ */ jsx(View, { style: [styles.iconWrap, { backgroundColor: t["--brand-primary"] }], children: /* @__PURE__ */ jsx(Lock, { size: 20, color: t["--brand-on-primary"] }) }),
|
|
21
|
+
/* @__PURE__ */ jsxs(View, { style: styles.copy, children: [
|
|
22
|
+
/* @__PURE__ */ jsx(Text, { variant: "label", numberOfLines: 2, children: title }),
|
|
23
|
+
description ? /* @__PURE__ */ jsx(Text, { variant: "caption", color: "secondary", style: styles.desc, children: description }) : null
|
|
24
|
+
] })
|
|
25
|
+
] }),
|
|
26
|
+
/* @__PURE__ */ jsx(Button, { label: ctaLabel, variant: "primary", fullWidth: true, onPress })
|
|
16
27
|
]
|
|
17
|
-
}
|
|
18
|
-
/* @__PURE__ */ React.createElement(View, { style: styles.row }, /* @__PURE__ */ React.createElement(View, { style: [styles.iconWrap, { backgroundColor: t["--brand-primary"] }] }, /* @__PURE__ */ React.createElement(Lock, { size: 20, color: t["--brand-on-primary"] })), /* @__PURE__ */ React.createElement(View, { style: styles.copy }, /* @__PURE__ */ React.createElement(Text, { variant: "label", numberOfLines: 2 }, title), description ? /* @__PURE__ */ React.createElement(Text, { variant: "caption", color: "secondary", style: styles.desc }, description) : null)),
|
|
19
|
-
/* @__PURE__ */ React.createElement(Button, { label: ctaLabel, variant: "primary", fullWidth: true, onPress })
|
|
28
|
+
}
|
|
20
29
|
);
|
|
21
30
|
}
|
|
22
31
|
const styles = StyleSheet.create({
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "../../../chunk-ORMEWXMH.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import {
|
|
3
4
|
Lock,
|
|
4
5
|
Package,
|
|
@@ -37,7 +38,16 @@ function PaywallContent({
|
|
|
37
38
|
var _a;
|
|
38
39
|
const t = useTheme();
|
|
39
40
|
const Icon = (_a = ICONS[icon]) != null ? _a : Lock;
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.container, children: [
|
|
42
|
+
/* @__PURE__ */ jsxs(View, { style: styles.iconWrap, children: [
|
|
43
|
+
/* @__PURE__ */ jsx(Icon, { size: 52, strokeWidth: 1.25, color: t["--text-secondary"] }),
|
|
44
|
+
/* @__PURE__ */ jsx(View, { style: [styles.lockBadge, { backgroundColor: t["--brand-primary"] }], children: /* @__PURE__ */ jsx(Lock, { size: 12, strokeWidth: 2.5, color: t["--brand-on-primary"] }) })
|
|
45
|
+
] }),
|
|
46
|
+
/* @__PURE__ */ jsx(View, { style: [styles.pill, { backgroundColor: t["--surface-raised"] }], children: /* @__PURE__ */ jsx(Text, { variant: "caption", color: "secondary", children: planLineText(reason, planLabel) }) }),
|
|
47
|
+
/* @__PURE__ */ jsx(Text, { variant: "title", style: styles.title, children: title }),
|
|
48
|
+
description ? /* @__PURE__ */ jsx(Text, { variant: "body-sm", color: "muted", style: styles.desc, children: description }) : null,
|
|
49
|
+
/* @__PURE__ */ jsx(Button, { label: ctaLabel, variant: "primary", fullWidth: true, onPress: onCta })
|
|
50
|
+
] });
|
|
41
51
|
}
|
|
42
52
|
const styles = StyleSheet.create({
|
|
43
53
|
container: { alignItems: "center", paddingHorizontal: 8, gap: 12, width: "100%" },
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import "../../../chunk-ORMEWXMH.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { Children, isValidElement, cloneElement } from "react";
|
|
3
4
|
import { Pressable, StyleSheet, View } from "react-native";
|
|
4
5
|
import { Text } from "./text.js";
|
|
5
6
|
import { useTheme } from "./theme.js";
|
|
6
7
|
function Radio({ label, value, selected = false, onSelect, disabled }) {
|
|
7
8
|
const t = useTheme();
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
+
return /* @__PURE__ */ jsxs(
|
|
9
10
|
Pressable,
|
|
10
11
|
{
|
|
11
12
|
accessibilityRole: "radio",
|
|
@@ -14,23 +15,25 @@ function Radio({ label, value, selected = false, onSelect, disabled }) {
|
|
|
14
15
|
disabled,
|
|
15
16
|
hitSlop: 8,
|
|
16
17
|
onPress: () => onSelect == null ? void 0 : onSelect(value),
|
|
17
|
-
style: [styles.row, { opacity: disabled ? 0.5 : 1 }]
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
18
|
+
style: [styles.row, { opacity: disabled ? 0.5 : 1 }],
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ jsx(
|
|
21
|
+
View,
|
|
22
|
+
{
|
|
23
|
+
style: [
|
|
24
|
+
styles.ring,
|
|
25
|
+
{ borderColor: selected ? t["--brand-primary"] : t["--border-strong"] }
|
|
26
|
+
],
|
|
27
|
+
children: selected ? /* @__PURE__ */ jsx(View, { style: [styles.dot, { backgroundColor: t["--brand-primary"] }] }) : null
|
|
28
|
+
}
|
|
29
|
+
),
|
|
30
|
+
label ? /* @__PURE__ */ jsx(Text, { variant: "body", style: { color: t["--text-primary"] }, children: label }) : null
|
|
31
|
+
]
|
|
32
|
+
}
|
|
30
33
|
);
|
|
31
34
|
}
|
|
32
35
|
function RadioGroup({ value, onChange, children, disabled }) {
|
|
33
|
-
return /* @__PURE__ */
|
|
36
|
+
return /* @__PURE__ */ jsx(View, { accessibilityRole: "radiogroup", style: styles.group, children: Children.map(children, (child) => {
|
|
34
37
|
var _a;
|
|
35
38
|
if (!isValidElement(child)) return child;
|
|
36
39
|
const el = child;
|
|
@@ -39,7 +42,7 @@ function RadioGroup({ value, onChange, children, disabled }) {
|
|
|
39
42
|
onSelect: onChange,
|
|
40
43
|
disabled: (_a = el.props.disabled) != null ? _a : disabled
|
|
41
44
|
});
|
|
42
|
-
}));
|
|
45
|
+
}) });
|
|
43
46
|
}
|
|
44
47
|
const styles = StyleSheet.create({
|
|
45
48
|
group: {
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
__objRest,
|
|
3
3
|
__spreadValues
|
|
4
4
|
} from "../../../chunk-ORMEWXMH.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
import { Pressable, StyleSheet, TextInput, View } from "react-native";
|
|
6
7
|
import { Search as SearchIcon, X } from "lucide-react-native";
|
|
7
8
|
import { useTheme } from "./theme.js";
|
|
@@ -29,50 +30,52 @@ function Search(_a) {
|
|
|
29
30
|
onChangeText("");
|
|
30
31
|
onClear == null ? void 0 : onClear();
|
|
31
32
|
}
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
+
return /* @__PURE__ */ jsxs(
|
|
33
34
|
View,
|
|
34
35
|
{
|
|
35
36
|
style: [
|
|
36
37
|
styles.wrap,
|
|
37
38
|
{ backgroundColor: t["--surface-raised"], borderColor: t["--border-default"] }
|
|
39
|
+
],
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ jsx(SearchIcon, { size: 18, color: t["--icon-default"] }),
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
43
|
+
TextInput,
|
|
44
|
+
__spreadValues({
|
|
45
|
+
value,
|
|
46
|
+
onChangeText,
|
|
47
|
+
placeholder,
|
|
48
|
+
placeholderTextColor: t["--text-muted"],
|
|
49
|
+
accessibilityLabel: accessibilityLabel != null ? accessibilityLabel : placeholder,
|
|
50
|
+
returnKeyType: "search",
|
|
51
|
+
onSubmitEditing: (e) => onSubmit == null ? void 0 : onSubmit(e.nativeEvent.text),
|
|
52
|
+
style: [styles.input, { color: t["--text-primary"] }]
|
|
53
|
+
}, rest)
|
|
54
|
+
),
|
|
55
|
+
action ? /* @__PURE__ */ jsx(
|
|
56
|
+
Pressable,
|
|
57
|
+
{
|
|
58
|
+
accessibilityRole: "button",
|
|
59
|
+
accessibilityLabel: action.accessibilityLabel,
|
|
60
|
+
hitSlop: 8,
|
|
61
|
+
onPress: action.onPress,
|
|
62
|
+
style: ({ pressed }) => ({ opacity: pressed ? 0.6 : 1 }),
|
|
63
|
+
children: action.icon
|
|
64
|
+
}
|
|
65
|
+
) : null,
|
|
66
|
+
hasValue ? /* @__PURE__ */ jsx(
|
|
67
|
+
Pressable,
|
|
68
|
+
{
|
|
69
|
+
accessibilityRole: "button",
|
|
70
|
+
accessibilityLabel: "Clear search",
|
|
71
|
+
hitSlop: 8,
|
|
72
|
+
onPress: handleClear,
|
|
73
|
+
style: ({ pressed }) => ({ opacity: pressed ? 0.6 : 1 }),
|
|
74
|
+
children: /* @__PURE__ */ jsx(X, { size: 18, color: t["--icon-default"] })
|
|
75
|
+
}
|
|
76
|
+
) : null
|
|
38
77
|
]
|
|
39
|
-
}
|
|
40
|
-
/* @__PURE__ */ React.createElement(SearchIcon, { size: 18, color: t["--icon-default"] }),
|
|
41
|
-
/* @__PURE__ */ React.createElement(
|
|
42
|
-
TextInput,
|
|
43
|
-
__spreadValues({
|
|
44
|
-
value,
|
|
45
|
-
onChangeText,
|
|
46
|
-
placeholder,
|
|
47
|
-
placeholderTextColor: t["--text-muted"],
|
|
48
|
-
accessibilityLabel: accessibilityLabel != null ? accessibilityLabel : placeholder,
|
|
49
|
-
returnKeyType: "search",
|
|
50
|
-
onSubmitEditing: (e) => onSubmit == null ? void 0 : onSubmit(e.nativeEvent.text),
|
|
51
|
-
style: [styles.input, { color: t["--text-primary"] }]
|
|
52
|
-
}, rest)
|
|
53
|
-
),
|
|
54
|
-
action ? /* @__PURE__ */ React.createElement(
|
|
55
|
-
Pressable,
|
|
56
|
-
{
|
|
57
|
-
accessibilityRole: "button",
|
|
58
|
-
accessibilityLabel: action.accessibilityLabel,
|
|
59
|
-
hitSlop: 8,
|
|
60
|
-
onPress: action.onPress,
|
|
61
|
-
style: ({ pressed }) => ({ opacity: pressed ? 0.6 : 1 })
|
|
62
|
-
},
|
|
63
|
-
action.icon
|
|
64
|
-
) : null,
|
|
65
|
-
hasValue ? /* @__PURE__ */ React.createElement(
|
|
66
|
-
Pressable,
|
|
67
|
-
{
|
|
68
|
-
accessibilityRole: "button",
|
|
69
|
-
accessibilityLabel: "Clear search",
|
|
70
|
-
hitSlop: 8,
|
|
71
|
-
onPress: handleClear,
|
|
72
|
-
style: ({ pressed }) => ({ opacity: pressed ? 0.6 : 1 })
|
|
73
|
-
},
|
|
74
|
-
/* @__PURE__ */ React.createElement(X, { size: 18, color: t["--icon-default"] })
|
|
75
|
-
) : null
|
|
78
|
+
}
|
|
76
79
|
);
|
|
77
80
|
}
|
|
78
81
|
const styles = StyleSheet.create({
|