@rojaostudio/ds 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.
- package/LICENSE +21 -0
- package/README.md +89 -0
- 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
- package/dist/chunk-ORMEWXMH.js +37 -0
- package/dist/compat/generate.d.ts +6 -0
- package/dist/compat/generate.js +1 -0
- package/dist/compat/recipes.d.ts +1 -0
- package/dist/compat/recipes.js +1 -0
- package/dist/compat/themes.d.ts +1 -0
- package/dist/compat/themes.js +1 -0
- package/dist/compat/tokens.d.ts +1 -0
- package/dist/compat/tokens.js +1 -0
- package/dist/components/accordion.d.ts +35 -0
- package/dist/components/accordion.js +95 -0
- package/dist/components/alert.d.ts +24 -0
- package/dist/components/alert.js +72 -0
- package/dist/components/avatar.d.ts +45 -0
- package/dist/components/avatar.js +97 -0
- package/dist/components/badge.d.ts +45 -0
- package/dist/components/badge.js +114 -0
- package/dist/components/blocker-card.d.ts +42 -0
- package/dist/components/blocker-card.js +45 -0
- package/dist/components/bottom-sheet.d.ts +31 -0
- package/dist/components/bottom-sheet.js +120 -0
- package/dist/components/breadcrumb.d.ts +28 -0
- package/dist/components/breadcrumb.js +52 -0
- package/dist/components/button.d.ts +27 -0
- package/dist/components/button.js +124 -0
- package/dist/components/card.d.ts +27 -0
- package/dist/components/card.js +52 -0
- package/dist/components/chat-bubble.d.ts +16 -0
- package/dist/components/chat-bubble.js +55 -0
- package/dist/components/checkbox.d.ts +14 -0
- package/dist/components/checkbox.js +78 -0
- package/dist/components/chip-input.d.ts +26 -0
- package/dist/components/chip-input.js +182 -0
- package/dist/components/chips.d.ts +22 -0
- package/dist/components/chips.js +94 -0
- package/dist/components/choice-card.d.ts +16 -0
- package/dist/components/choice-card.js +60 -0
- package/dist/components/choice-carousel.d.ts +16 -0
- package/dist/components/choice-carousel.js +154 -0
- package/dist/components/choice-preview-card.d.ts +37 -0
- package/dist/components/choice-preview-card.js +39 -0
- package/dist/components/color-input.d.ts +20 -0
- package/dist/components/color-input.js +79 -0
- package/dist/components/combobox.d.ts +70 -0
- package/dist/components/combobox.js +213 -0
- package/dist/components/context-menu.d.ts +33 -0
- package/dist/components/context-menu.js +70 -0
- package/dist/components/copilot-hint.d.ts +18 -0
- package/dist/components/copilot-hint.js +63 -0
- package/dist/components/copy-field.d.ts +16 -0
- package/dist/components/copy-field.js +41 -0
- package/dist/components/currency-input.d.ts +32 -0
- package/dist/components/currency-input.js +138 -0
- package/dist/components/danger-zone.d.ts +20 -0
- package/dist/components/danger-zone.js +21 -0
- package/dist/components/data-table-header.d.ts +43 -0
- package/dist/components/data-table-header.js +205 -0
- package/dist/components/date-picker.d.ts +40 -0
- package/dist/components/date-picker.js +252 -0
- package/dist/components/divider.d.ts +20 -0
- package/dist/components/divider.js +47 -0
- package/dist/components/drawer.d.ts +26 -0
- package/dist/components/drawer.js +82 -0
- package/dist/components/dropzone.d.ts +19 -0
- package/dist/components/dropzone.js +65 -0
- package/dist/components/empty-state.d.ts +48 -0
- package/dist/components/empty-state.js +91 -0
- package/dist/components/fab.d.ts +38 -0
- package/dist/components/fab.js +100 -0
- package/dist/components/filter-chip.d.ts +54 -0
- package/dist/components/filter-chip.js +66 -0
- package/dist/components/floating-stepper.d.ts +44 -0
- package/dist/components/floating-stepper.js +53 -0
- package/dist/components/form-card-header.d.ts +13 -0
- package/dist/components/form-card-header.js +8 -0
- package/dist/components/icon-button.d.ts +17 -0
- package/dist/components/icon-button.js +80 -0
- package/dist/components/image-crop-modal.d.ts +59 -0
- package/dist/components/image-crop-modal.js +240 -0
- package/dist/components/image-upload.d.ts +72 -0
- package/dist/components/image-upload.js +271 -0
- package/dist/components/index.d.ts +85 -0
- package/dist/components/index.js +200 -0
- package/dist/components/input.d.ts +25 -0
- package/dist/components/input.js +136 -0
- package/dist/components/insight-card.d.ts +19 -0
- package/dist/components/insight-card.js +27 -0
- package/dist/components/label.d.ts +16 -0
- package/dist/components/label.js +43 -0
- package/dist/components/media-tile.d.ts +24 -0
- package/dist/components/media-tile.js +28 -0
- package/dist/components/menu.d.ts +50 -0
- package/dist/components/menu.js +80 -0
- package/dist/components/modal.d.ts +25 -0
- package/dist/components/modal.js +71 -0
- package/dist/components/notice.d.ts +50 -0
- package/dist/components/notice.js +103 -0
- package/dist/components/option-tile.d.ts +60 -0
- package/dist/components/option-tile.js +144 -0
- package/dist/components/page-shell.d.ts +29 -0
- package/dist/components/page-shell.js +36 -0
- package/dist/components/page-skeleton.d.ts +35 -0
- package/dist/components/page-skeleton.js +12 -0
- package/dist/components/page-tabs.d.ts +35 -0
- package/dist/components/page-tabs.js +55 -0
- package/dist/components/pagination.d.ts +31 -0
- package/dist/components/pagination.js +80 -0
- package/dist/components/paywall-banner.d.ts +37 -0
- package/dist/components/paywall-banner.js +42 -0
- package/dist/components/paywall.d.ts +44 -0
- package/dist/components/paywall.js +55 -0
- package/dist/components/phone-frame.d.ts +9 -0
- package/dist/components/phone-frame.js +18 -0
- package/dist/components/phone-input.d.ts +24 -0
- package/dist/components/phone-input.js +92 -0
- package/dist/components/pix-icon.d.ts +8 -0
- package/dist/components/pix-icon.js +24 -0
- package/dist/components/popover.d.ts +44 -0
- package/dist/components/popover.js +140 -0
- package/dist/components/pricing-card.d.ts +42 -0
- package/dist/components/pricing-card.js +29 -0
- package/dist/components/qr-display.d.ts +19 -0
- package/dist/components/qr-display.js +24 -0
- package/dist/components/radio.d.ts +33 -0
- package/dist/components/radio.js +97 -0
- package/dist/components/row-actions.d.ts +24 -0
- package/dist/components/row-actions.js +76 -0
- package/dist/components/saving-bar-context.d.ts +40 -0
- package/dist/components/saving-bar-context.js +125 -0
- package/dist/components/saving-bar.d.ts +18 -0
- package/dist/components/saving-bar.js +72 -0
- package/dist/components/search.d.ts +30 -0
- package/dist/components/search.js +81 -0
- package/dist/components/section-card.d.ts +14 -0
- package/dist/components/section-card.js +49 -0
- package/dist/components/section-header.d.ts +29 -0
- package/dist/components/section-header.js +7 -0
- package/dist/components/select.d.ts +21 -0
- package/dist/components/select.js +140 -0
- package/dist/components/selectable-card.d.ts +35 -0
- package/dist/components/selectable-card.js +27 -0
- package/dist/components/setting-row.d.ts +33 -0
- package/dist/components/setting-row.js +19 -0
- package/dist/components/settings-list.d.ts +25 -0
- package/dist/components/settings-list.js +22 -0
- package/dist/components/skeleton.d.ts +24 -0
- package/dist/components/skeleton.js +49 -0
- package/dist/components/slider.d.ts +32 -0
- package/dist/components/slider.js +79 -0
- package/dist/components/spinner.d.ts +14 -0
- package/dist/components/spinner.js +36 -0
- package/dist/components/step-progress.d.ts +12 -0
- package/dist/components/step-progress.js +24 -0
- package/dist/components/summary-bar.d.ts +31 -0
- package/dist/components/summary-bar.js +54 -0
- package/dist/components/table.d.ts +23 -0
- package/dist/components/table.js +80 -0
- package/dist/components/textarea.d.ts +21 -0
- package/dist/components/textarea.js +95 -0
- package/dist/components/themed.d.ts +36 -0
- package/dist/components/themed.js +22 -0
- package/dist/components/time-picker.d.ts +34 -0
- package/dist/components/time-picker.js +213 -0
- package/dist/components/toaster.d.ts +84 -0
- package/dist/components/toaster.js +284 -0
- package/dist/components/toggle-card-compact.d.ts +21 -0
- package/dist/components/toggle-card-compact.js +99 -0
- package/dist/components/toggle-card.d.ts +15 -0
- package/dist/components/toggle-card.js +76 -0
- package/dist/components/toggle-group.d.ts +67 -0
- package/dist/components/toggle-group.js +80 -0
- package/dist/components/toggle.d.ts +13 -0
- package/dist/components/toggle.js +64 -0
- package/dist/components/tooltip.d.ts +17 -0
- package/dist/components/tooltip.js +89 -0
- package/dist/components/typing-indicator.d.ts +8 -0
- package/dist/components/typing-indicator.js +27 -0
- package/dist/components/use-dismiss.d.ts +9 -0
- package/dist/components/use-dismiss.js +28 -0
- package/dist/components/use-focus-trap.d.ts +5 -0
- package/dist/components/use-focus-trap.js +54 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +89 -0
- package/dist/targets/native/components/accordion.d.ts +18 -0
- package/dist/targets/native/components/accordion.js +122 -0
- package/dist/targets/native/components/alert.d.ts +16 -0
- package/dist/targets/native/components/alert.js +58 -0
- package/dist/targets/native/components/avatar.d.ts +25 -0
- package/dist/targets/native/components/avatar.js +88 -0
- package/dist/targets/native/components/badge.d.ts +27 -0
- package/dist/targets/native/components/badge.js +59 -0
- package/dist/targets/native/components/button.d.ts +18 -0
- package/dist/targets/native/components/button.js +84 -0
- package/dist/targets/native/components/card.d.ts +6 -0
- package/dist/targets/native/components/card.js +36 -0
- package/dist/targets/native/components/checkbox.d.ts +12 -0
- package/dist/targets/native/components/checkbox.js +59 -0
- package/dist/targets/native/components/chips.d.ts +17 -0
- package/dist/targets/native/components/chips.js +77 -0
- package/dist/targets/native/components/choice-card.d.ts +11 -0
- package/dist/targets/native/components/choice-card.js +52 -0
- package/dist/targets/native/components/context-menu.d.ts +11 -0
- package/dist/targets/native/components/context-menu.js +19 -0
- package/dist/targets/native/components/currency-input.d.ts +22 -0
- package/dist/targets/native/components/currency-input.js +105 -0
- package/dist/targets/native/components/danger-zone.d.ts +13 -0
- package/dist/targets/native/components/danger-zone.js +27 -0
- package/dist/targets/native/components/date-picker.d.ts +13 -0
- package/dist/targets/native/components/date-picker.js +185 -0
- package/dist/targets/native/components/divider.d.ts +9 -0
- package/dist/targets/native/components/divider.js +36 -0
- package/dist/targets/native/components/empty-state.d.ts +13 -0
- package/dist/targets/native/components/empty-state.js +10 -0
- package/dist/targets/native/components/fab.d.ts +25 -0
- package/dist/targets/native/components/fab.js +112 -0
- package/dist/targets/native/components/filter-chip.d.ts +22 -0
- package/dist/targets/native/components/filter-chip.js +70 -0
- package/dist/targets/native/components/form-field.d.ts +13 -0
- package/dist/targets/native/components/form-field.js +29 -0
- package/dist/targets/native/components/form-screen.d.ts +19 -0
- package/dist/targets/native/components/form-screen.js +88 -0
- package/dist/targets/native/components/google-icon.d.ts +8 -0
- package/dist/targets/native/components/google-icon.js +32 -0
- package/dist/targets/native/components/icon-button.d.ts +18 -0
- package/dist/targets/native/components/icon-button.js +80 -0
- package/dist/targets/native/components/icon.d.ts +11 -0
- package/dist/targets/native/components/icon.js +9 -0
- package/dist/targets/native/components/image-upload.d.ts +12 -0
- package/dist/targets/native/components/image-upload.js +95 -0
- package/dist/targets/native/components/index.d.ts +45 -0
- package/dist/targets/native/components/index.js +100 -0
- package/dist/targets/native/components/input.d.ts +17 -0
- package/dist/targets/native/components/input.js +103 -0
- package/dist/targets/native/components/list-item.d.ts +20 -0
- package/dist/targets/native/components/list-item.js +71 -0
- package/dist/targets/native/components/menu.d.ts +24 -0
- package/dist/targets/native/components/menu.js +71 -0
- package/dist/targets/native/components/modal.d.ts +15 -0
- package/dist/targets/native/components/modal.js +110 -0
- package/dist/targets/native/components/paywall-banner.d.ts +11 -0
- package/dist/targets/native/components/paywall-banner.js +46 -0
- package/dist/targets/native/components/paywall.d.ts +18 -0
- package/dist/targets/native/components/paywall.js +61 -0
- package/dist/targets/native/components/radio.d.ts +20 -0
- package/dist/targets/native/components/radio.js +71 -0
- package/dist/targets/native/components/search.d.ts +22 -0
- package/dist/targets/native/components/search.js +92 -0
- package/dist/targets/native/components/select.d.ts +17 -0
- package/dist/targets/native/components/select.js +86 -0
- package/dist/targets/native/components/sheet.d.ts +11 -0
- package/dist/targets/native/components/sheet.js +51 -0
- package/dist/targets/native/components/skeleton.d.ts +18 -0
- package/dist/targets/native/components/skeleton.js +52 -0
- package/dist/targets/native/components/slider.d.ts +18 -0
- package/dist/targets/native/components/slider.js +153 -0
- package/dist/targets/native/components/spinner.d.ts +7 -0
- package/dist/targets/native/components/spinner.js +10 -0
- package/dist/targets/native/components/stepper.d.ts +10 -0
- package/dist/targets/native/components/stepper.js +33 -0
- package/dist/targets/native/components/switch.d.ts +20 -0
- package/dist/targets/native/components/switch.js +68 -0
- package/dist/targets/native/components/text.d.ts +12 -0
- package/dist/targets/native/components/text.js +31 -0
- package/dist/targets/native/components/textarea.d.ts +13 -0
- package/dist/targets/native/components/textarea.js +92 -0
- package/dist/targets/native/components/theme.d.ts +18 -0
- package/dist/targets/native/components/theme.js +20 -0
- package/dist/targets/native/components/toaster.d.ts +35 -0
- package/dist/targets/native/components/toaster.js +159 -0
- package/dist/targets/native/fonts.d.ts +9 -0
- package/dist/targets/native/fonts.js +10 -0
- package/dist/targets/native/icons.d.ts +1 -0
- package/dist/targets/native/icons.js +1 -0
- package/dist/targets/native/index.d.ts +3 -0
- package/dist/targets/native/index.js +11 -0
- package/dist/targets/native/preset.cjs +69 -0
- package/dist/targets/native/resolve.d.ts +22 -0
- package/dist/targets/native/resolve.js +85 -0
- package/dist/targets/native/theme.css +118 -0
- package/dist/targets/native/theme.d.ts +117 -0
- package/dist/targets/native/theme.js +118 -0
- package/package.json +194 -0
- package/styles/_primitives.generated.css +284 -0
- package/styles/base.css +950 -0
- package/styles/themes/rojao.css +107 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__objRest,
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "../../../chunk-ORMEWXMH.js";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { Pressable, StyleSheet, TextInput, View } from "react-native";
|
|
7
|
+
import { X } from "lucide-react-native";
|
|
8
|
+
import { Text } from "./text.js";
|
|
9
|
+
import { useTheme } from "./theme.js";
|
|
10
|
+
function Input(_a) {
|
|
11
|
+
var _b = _a, {
|
|
12
|
+
label,
|
|
13
|
+
error,
|
|
14
|
+
prefix,
|
|
15
|
+
suffix,
|
|
16
|
+
clearable,
|
|
17
|
+
style,
|
|
18
|
+
onFocus,
|
|
19
|
+
onBlur,
|
|
20
|
+
onChangeText,
|
|
21
|
+
accessibilityLabel
|
|
22
|
+
} = _b, rest = __objRest(_b, [
|
|
23
|
+
"label",
|
|
24
|
+
"error",
|
|
25
|
+
"prefix",
|
|
26
|
+
"suffix",
|
|
27
|
+
"clearable",
|
|
28
|
+
"style",
|
|
29
|
+
"onFocus",
|
|
30
|
+
"onBlur",
|
|
31
|
+
"onChangeText",
|
|
32
|
+
"accessibilityLabel"
|
|
33
|
+
]);
|
|
34
|
+
const t = useTheme();
|
|
35
|
+
const [focused, setFocused] = useState(false);
|
|
36
|
+
const borderColor = error ? t["--danger"] : focused ? t["--border-focus"] : t["--border-default"];
|
|
37
|
+
function handleFocus(e) {
|
|
38
|
+
setFocused(true);
|
|
39
|
+
onFocus == null ? void 0 : onFocus(e);
|
|
40
|
+
}
|
|
41
|
+
function handleBlur(e) {
|
|
42
|
+
setFocused(false);
|
|
43
|
+
onBlur == null ? void 0 : onBlur(e);
|
|
44
|
+
}
|
|
45
|
+
const hasValue = typeof rest.value === "string" ? rest.value.length > 0 : false;
|
|
46
|
+
const showClear = !!clearable && hasValue && rest.editable !== false;
|
|
47
|
+
return /* @__PURE__ */ React.createElement(View, { style: { gap: 6 } }, label ? /* @__PURE__ */ React.createElement(Text, { variant: "label" }, label) : null, /* @__PURE__ */ React.createElement(
|
|
48
|
+
View,
|
|
49
|
+
{
|
|
50
|
+
style: [
|
|
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,
|
|
70
|
+
{
|
|
71
|
+
onPress: () => onChangeText == null ? void 0 : onChangeText(""),
|
|
72
|
+
accessibilityRole: "button",
|
|
73
|
+
accessibilityLabel: "Clear",
|
|
74
|
+
hitSlop: 8,
|
|
75
|
+
style: styles.affix
|
|
76
|
+
},
|
|
77
|
+
/* @__PURE__ */ React.createElement(X, { size: 16, color: t["--text-muted"] })
|
|
78
|
+
) : null,
|
|
79
|
+
suffix ? /* @__PURE__ */ React.createElement(View, { style: styles.affix }, renderAffix(suffix, t)) : null
|
|
80
|
+
), typeof error === "string" && error ? /* @__PURE__ */ React.createElement(Text, { variant: "caption", color: "danger" }, error) : null);
|
|
81
|
+
}
|
|
82
|
+
function renderAffix(node, t) {
|
|
83
|
+
if (typeof node === "string") {
|
|
84
|
+
return /* @__PURE__ */ React.createElement(Text, { variant: "body", style: { color: t["--text-muted"] } }, node);
|
|
85
|
+
}
|
|
86
|
+
return node;
|
|
87
|
+
}
|
|
88
|
+
const styles = StyleSheet.create({
|
|
89
|
+
field: {
|
|
90
|
+
flexDirection: "row",
|
|
91
|
+
alignItems: "center",
|
|
92
|
+
minHeight: 48,
|
|
93
|
+
borderRadius: 12,
|
|
94
|
+
borderWidth: 1,
|
|
95
|
+
paddingHorizontal: 16,
|
|
96
|
+
gap: 8
|
|
97
|
+
},
|
|
98
|
+
input: { flex: 1, height: 46, fontSize: 16, padding: 0 },
|
|
99
|
+
affix: { alignItems: "center", justifyContent: "center" }
|
|
100
|
+
});
|
|
101
|
+
export {
|
|
102
|
+
Input
|
|
103
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentType, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type IconType = ComponentType<{
|
|
5
|
+
color?: string;
|
|
6
|
+
size?: number;
|
|
7
|
+
}>;
|
|
8
|
+
type Props = {
|
|
9
|
+
title: string;
|
|
10
|
+
subtitle?: string;
|
|
11
|
+
icon?: IconType;
|
|
12
|
+
leading?: ReactNode;
|
|
13
|
+
trailing?: ReactNode;
|
|
14
|
+
onPress?: () => void;
|
|
15
|
+
showChevron?: boolean;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
};
|
|
18
|
+
declare function ListItem({ title, subtitle, icon: Icon, leading, trailing, onPress, showChevron, disabled, }: Props): react.JSX.Element;
|
|
19
|
+
|
|
20
|
+
export { ListItem };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import "../../../chunk-ORMEWXMH.js";
|
|
2
|
+
import { ChevronRight } from "lucide-react-native";
|
|
3
|
+
import { Pressable, View } from "react-native";
|
|
4
|
+
import { Text } from "./text.js";
|
|
5
|
+
import { useTheme } from "./theme.js";
|
|
6
|
+
function ListItem({
|
|
7
|
+
title,
|
|
8
|
+
subtitle,
|
|
9
|
+
icon: Icon,
|
|
10
|
+
leading,
|
|
11
|
+
trailing,
|
|
12
|
+
onPress,
|
|
13
|
+
showChevron,
|
|
14
|
+
disabled
|
|
15
|
+
}) {
|
|
16
|
+
const t = useTheme();
|
|
17
|
+
const body = /* @__PURE__ */ React.createElement(
|
|
18
|
+
View,
|
|
19
|
+
{
|
|
20
|
+
style: {
|
|
21
|
+
minHeight: 56,
|
|
22
|
+
flexDirection: "row",
|
|
23
|
+
alignItems: "center",
|
|
24
|
+
gap: 14,
|
|
25
|
+
paddingHorizontal: 16,
|
|
26
|
+
paddingVertical: 10,
|
|
27
|
+
borderRadius: 12,
|
|
28
|
+
borderWidth: 1,
|
|
29
|
+
borderColor: t["--border-subtle"],
|
|
30
|
+
backgroundColor: t["--surface-default"],
|
|
31
|
+
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
|
+
},
|
|
46
|
+
/* @__PURE__ */ React.createElement(Icon, { color: t["--icon-default"], size: 22 })
|
|
47
|
+
) : null,
|
|
48
|
+
/* @__PURE__ */ React.createElement(View, { style: { flex: 1 } }, /* @__PURE__ */ React.createElement(Text, { variant: "label", numberOfLines: 1 }, title), subtitle ? /* @__PURE__ */ React.createElement(Text, { variant: "caption", color: "muted" }, subtitle) : null),
|
|
49
|
+
trailing,
|
|
50
|
+
showChevron && onPress ? /* @__PURE__ */ React.createElement(View, { importantForAccessibility: "no" }, /* @__PURE__ */ React.createElement(ChevronRight, { color: t["--text-muted"], size: 20 })) : null
|
|
51
|
+
);
|
|
52
|
+
return onPress ? /* @__PURE__ */ React.createElement(
|
|
53
|
+
Pressable,
|
|
54
|
+
{
|
|
55
|
+
onPress: disabled ? void 0 : onPress,
|
|
56
|
+
disabled,
|
|
57
|
+
accessibilityRole: "button",
|
|
58
|
+
accessibilityState: { disabled: !!disabled },
|
|
59
|
+
accessibilityLabel: subtitle ? `${title}, ${subtitle}` : title,
|
|
60
|
+
hitSlop: 8,
|
|
61
|
+
android_ripple: { color: t["--surface-raised"] },
|
|
62
|
+
style: ({ pressed }) => [
|
|
63
|
+
pressed && !disabled ? { backgroundColor: t["--surface-raised"], borderRadius: 12 } : null
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
body
|
|
67
|
+
) : body;
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
ListItem
|
|
71
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentType, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type IconType = ComponentType<{
|
|
5
|
+
color?: string;
|
|
6
|
+
size?: number;
|
|
7
|
+
}>;
|
|
8
|
+
type Props = {
|
|
9
|
+
visible: boolean;
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
items?: MenuItem[];
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
};
|
|
14
|
+
declare function Menu({ visible, onClose, items, children }: Props): react.JSX.Element;
|
|
15
|
+
type MenuItem = {
|
|
16
|
+
label: string;
|
|
17
|
+
icon?: IconType;
|
|
18
|
+
destructive?: boolean;
|
|
19
|
+
onPress: () => void;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
};
|
|
22
|
+
declare function MenuItem({ label, icon: Icon, destructive, onPress, disabled }: MenuItem): react.JSX.Element;
|
|
23
|
+
|
|
24
|
+
export { Menu, MenuItem };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__spreadProps,
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "../../../chunk-ORMEWXMH.js";
|
|
5
|
+
import { Pressable, StyleSheet, View } from "react-native";
|
|
6
|
+
import { Sheet } from "./sheet.js";
|
|
7
|
+
import { Text } from "./text.js";
|
|
8
|
+
import { useTheme } from "./theme.js";
|
|
9
|
+
function Menu({ visible, onClose, items, children }) {
|
|
10
|
+
return /* @__PURE__ */ React.createElement(Sheet, { visible, onClose }, /* @__PURE__ */ React.createElement(View, { accessibilityRole: "menu", style: styles.list }, items ? items.map((item, i) => /* @__PURE__ */ React.createElement(
|
|
11
|
+
MenuItem,
|
|
12
|
+
__spreadProps(__spreadValues({
|
|
13
|
+
key: `${item.label}-${i}`
|
|
14
|
+
}, item), {
|
|
15
|
+
onPress: () => {
|
|
16
|
+
onClose();
|
|
17
|
+
item.onPress();
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
)) : children));
|
|
21
|
+
}
|
|
22
|
+
function MenuItem({ label, icon: Icon, destructive, onPress, disabled }) {
|
|
23
|
+
const t = useTheme();
|
|
24
|
+
const fg = destructive ? t["--danger-text"] : t["--text-primary"];
|
|
25
|
+
return /* @__PURE__ */ React.createElement(
|
|
26
|
+
Pressable,
|
|
27
|
+
{
|
|
28
|
+
accessibilityRole: "menuitem",
|
|
29
|
+
accessibilityState: { disabled: !!disabled },
|
|
30
|
+
accessibilityLabel: label,
|
|
31
|
+
disabled,
|
|
32
|
+
onPress: disabled ? void 0 : onPress,
|
|
33
|
+
hitSlop: 8,
|
|
34
|
+
android_ripple: { color: t["--surface-raised"] },
|
|
35
|
+
style: ({ pressed }) => [
|
|
36
|
+
styles.item,
|
|
37
|
+
{
|
|
38
|
+
backgroundColor: pressed && !disabled ? t["--surface-raised"] : t["--surface-default"],
|
|
39
|
+
opacity: disabled ? 0.5 : 1
|
|
40
|
+
}
|
|
41
|
+
]
|
|
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)
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
const styles = StyleSheet.create({
|
|
48
|
+
list: {
|
|
49
|
+
paddingHorizontal: 12,
|
|
50
|
+
paddingTop: 4,
|
|
51
|
+
gap: 2
|
|
52
|
+
},
|
|
53
|
+
item: {
|
|
54
|
+
minHeight: 56,
|
|
55
|
+
flexDirection: "row",
|
|
56
|
+
alignItems: "center",
|
|
57
|
+
gap: 14,
|
|
58
|
+
paddingHorizontal: 16,
|
|
59
|
+
paddingVertical: 10,
|
|
60
|
+
borderRadius: 12
|
|
61
|
+
},
|
|
62
|
+
icon: {
|
|
63
|
+
width: 24,
|
|
64
|
+
alignItems: "center",
|
|
65
|
+
justifyContent: "center"
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
export {
|
|
69
|
+
Menu,
|
|
70
|
+
MenuItem
|
|
71
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
|
|
3
|
+
type Props = {
|
|
4
|
+
visible: boolean;
|
|
5
|
+
title: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
confirmLabel?: string;
|
|
8
|
+
cancelLabel?: string;
|
|
9
|
+
onConfirm: () => void;
|
|
10
|
+
onCancel: () => void;
|
|
11
|
+
destructive?: boolean;
|
|
12
|
+
};
|
|
13
|
+
declare function Modal({ visible, title, description, confirmLabel, cancelLabel, onConfirm, onCancel, destructive, }: Props): react.JSX.Element;
|
|
14
|
+
|
|
15
|
+
export { Modal };
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import "../../../chunk-ORMEWXMH.js";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
3
|
+
import { Animated, Modal as RNModal, Pressable, StyleSheet, Text, View } from "react-native";
|
|
4
|
+
import { Button } from "./button.js";
|
|
5
|
+
import { useTheme } from "./theme.js";
|
|
6
|
+
function Modal({
|
|
7
|
+
visible,
|
|
8
|
+
title,
|
|
9
|
+
description,
|
|
10
|
+
confirmLabel = "Confirm",
|
|
11
|
+
cancelLabel = "Cancel",
|
|
12
|
+
onConfirm,
|
|
13
|
+
onCancel,
|
|
14
|
+
destructive = false
|
|
15
|
+
}) {
|
|
16
|
+
const t = useTheme();
|
|
17
|
+
const scale = useRef(new Animated.Value(0.92)).current;
|
|
18
|
+
const opacity = useRef(new Animated.Value(0)).current;
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (visible) {
|
|
21
|
+
Animated.parallel([
|
|
22
|
+
Animated.timing(scale, { toValue: 1, duration: 180, useNativeDriver: true }),
|
|
23
|
+
Animated.timing(opacity, { toValue: 1, duration: 180, useNativeDriver: true })
|
|
24
|
+
]).start();
|
|
25
|
+
} else {
|
|
26
|
+
scale.setValue(0.92);
|
|
27
|
+
opacity.setValue(0);
|
|
28
|
+
}
|
|
29
|
+
}, [visible, scale, opacity]);
|
|
30
|
+
return /* @__PURE__ */ React.createElement(RNModal, { visible, transparent: true, animationType: "fade", onRequestClose: onCancel }, /* @__PURE__ */ React.createElement(View, { style: styles.root }, /* @__PURE__ */ React.createElement(
|
|
31
|
+
Pressable,
|
|
32
|
+
{
|
|
33
|
+
style: styles.backdrop,
|
|
34
|
+
onPress: onCancel,
|
|
35
|
+
accessibilityRole: "button",
|
|
36
|
+
accessibilityLabel: "Fechar"
|
|
37
|
+
}
|
|
38
|
+
), /* @__PURE__ */ React.createElement(
|
|
39
|
+
Animated.View,
|
|
40
|
+
{
|
|
41
|
+
accessibilityViewIsModal: true,
|
|
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,
|
|
57
|
+
{
|
|
58
|
+
label: confirmLabel,
|
|
59
|
+
variant: destructive ? "danger" : "primary",
|
|
60
|
+
onPress: onConfirm
|
|
61
|
+
}
|
|
62
|
+
))
|
|
63
|
+
)));
|
|
64
|
+
}
|
|
65
|
+
const styles = StyleSheet.create({
|
|
66
|
+
root: {
|
|
67
|
+
flex: 1,
|
|
68
|
+
alignItems: "center",
|
|
69
|
+
justifyContent: "center",
|
|
70
|
+
padding: 24
|
|
71
|
+
},
|
|
72
|
+
backdrop: {
|
|
73
|
+
position: "absolute",
|
|
74
|
+
top: 0,
|
|
75
|
+
left: 0,
|
|
76
|
+
right: 0,
|
|
77
|
+
bottom: 0,
|
|
78
|
+
backgroundColor: "rgba(0, 0, 0, 0.55)"
|
|
79
|
+
},
|
|
80
|
+
card: {
|
|
81
|
+
width: "100%",
|
|
82
|
+
maxWidth: 400,
|
|
83
|
+
borderRadius: 16,
|
|
84
|
+
borderWidth: 1,
|
|
85
|
+
padding: 24,
|
|
86
|
+
shadowColor: "#000",
|
|
87
|
+
shadowOffset: { width: 0, height: 8 },
|
|
88
|
+
shadowOpacity: 0.18,
|
|
89
|
+
shadowRadius: 24,
|
|
90
|
+
elevation: 12
|
|
91
|
+
},
|
|
92
|
+
title: {
|
|
93
|
+
fontSize: 18,
|
|
94
|
+
fontWeight: "600"
|
|
95
|
+
},
|
|
96
|
+
description: {
|
|
97
|
+
fontSize: 15,
|
|
98
|
+
lineHeight: 22,
|
|
99
|
+
marginTop: 8
|
|
100
|
+
},
|
|
101
|
+
footer: {
|
|
102
|
+
flexDirection: "row",
|
|
103
|
+
justifyContent: "flex-end",
|
|
104
|
+
gap: 8,
|
|
105
|
+
marginTop: 24
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
export {
|
|
109
|
+
Modal
|
|
110
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
|
|
3
|
+
type PaywallBannerProps = {
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
ctaLabel?: string;
|
|
7
|
+
onPress: () => void;
|
|
8
|
+
};
|
|
9
|
+
declare function PaywallBanner({ title, description, ctaLabel, onPress }: PaywallBannerProps): react.JSX.Element;
|
|
10
|
+
|
|
11
|
+
export { PaywallBanner, type PaywallBannerProps };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import "../../../chunk-ORMEWXMH.js";
|
|
2
|
+
import { Lock } from "lucide-react-native";
|
|
3
|
+
import { StyleSheet, View } from "react-native";
|
|
4
|
+
import { Button } from "./button.js";
|
|
5
|
+
import { Text } from "./text.js";
|
|
6
|
+
import { useTheme } from "./theme.js";
|
|
7
|
+
function PaywallBanner({ title, description, ctaLabel = "Ver planos", onPress }) {
|
|
8
|
+
const t = useTheme();
|
|
9
|
+
return /* @__PURE__ */ React.createElement(
|
|
10
|
+
View,
|
|
11
|
+
{
|
|
12
|
+
accessibilityRole: "summary",
|
|
13
|
+
style: [
|
|
14
|
+
styles.container,
|
|
15
|
+
{ backgroundColor: t["--surface-raised"], borderColor: t["--border-default"] }
|
|
16
|
+
]
|
|
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 })
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
const styles = StyleSheet.create({
|
|
23
|
+
container: {
|
|
24
|
+
borderWidth: 1,
|
|
25
|
+
borderRadius: 12,
|
|
26
|
+
padding: 16,
|
|
27
|
+
gap: 14
|
|
28
|
+
},
|
|
29
|
+
row: {
|
|
30
|
+
flexDirection: "row",
|
|
31
|
+
alignItems: "flex-start",
|
|
32
|
+
gap: 12
|
|
33
|
+
},
|
|
34
|
+
iconWrap: {
|
|
35
|
+
width: 40,
|
|
36
|
+
height: 40,
|
|
37
|
+
borderRadius: 10,
|
|
38
|
+
alignItems: "center",
|
|
39
|
+
justifyContent: "center"
|
|
40
|
+
},
|
|
41
|
+
copy: { flex: 1 },
|
|
42
|
+
desc: { marginTop: 2 }
|
|
43
|
+
});
|
|
44
|
+
export {
|
|
45
|
+
PaywallBanner
|
|
46
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
|
|
3
|
+
type PaywallReason = 'feature' | 'limit';
|
|
4
|
+
type PaywallIcon = 'lock' | 'catalog' | 'channels' | 'commercial' | 'operation' | 'intelligence' | 'billing';
|
|
5
|
+
type PaywallContentProps = {
|
|
6
|
+
icon?: PaywallIcon;
|
|
7
|
+
title: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
reason?: PaywallReason;
|
|
10
|
+
planLabel?: string;
|
|
11
|
+
ctaLabel?: string;
|
|
12
|
+
onCta: () => void;
|
|
13
|
+
};
|
|
14
|
+
/** Visual puro do paywall — o app envolve num Sheet/overlay (gate de ação) ou
|
|
15
|
+
* num container de tela cheia (gate de seção). */
|
|
16
|
+
declare function PaywallContent({ icon, title, description, reason, planLabel, ctaLabel, onCta, }: PaywallContentProps): react.JSX.Element;
|
|
17
|
+
|
|
18
|
+
export { PaywallContent, type PaywallContentProps, type PaywallIcon, type PaywallReason };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import "../../../chunk-ORMEWXMH.js";
|
|
2
|
+
import {
|
|
3
|
+
Lock,
|
|
4
|
+
Package,
|
|
5
|
+
Send,
|
|
6
|
+
HandCoins,
|
|
7
|
+
Store,
|
|
8
|
+
BarChart3,
|
|
9
|
+
CreditCard
|
|
10
|
+
} from "lucide-react-native";
|
|
11
|
+
import { StyleSheet, View } from "react-native";
|
|
12
|
+
import { Button } from "./button.js";
|
|
13
|
+
import { Text } from "./text.js";
|
|
14
|
+
import { useTheme } from "./theme.js";
|
|
15
|
+
const ICONS = {
|
|
16
|
+
lock: Lock,
|
|
17
|
+
catalog: Package,
|
|
18
|
+
channels: Send,
|
|
19
|
+
commercial: HandCoins,
|
|
20
|
+
operation: Store,
|
|
21
|
+
intelligence: BarChart3,
|
|
22
|
+
billing: CreditCard
|
|
23
|
+
};
|
|
24
|
+
function planLineText(reason, planLabel) {
|
|
25
|
+
if (reason === "limit") return "Limite atingido";
|
|
26
|
+
return planLabel ? `Dispon\xEDvel no ${planLabel}` : "Fa\xE7a upgrade";
|
|
27
|
+
}
|
|
28
|
+
function PaywallContent({
|
|
29
|
+
icon = "lock",
|
|
30
|
+
title,
|
|
31
|
+
description,
|
|
32
|
+
reason = "feature",
|
|
33
|
+
planLabel,
|
|
34
|
+
ctaLabel = "Ver planos",
|
|
35
|
+
onCta
|
|
36
|
+
}) {
|
|
37
|
+
var _a;
|
|
38
|
+
const t = useTheme();
|
|
39
|
+
const Icon = (_a = ICONS[icon]) != null ? _a : Lock;
|
|
40
|
+
return /* @__PURE__ */ React.createElement(View, { style: styles.container }, /* @__PURE__ */ React.createElement(View, { style: styles.iconWrap }, /* @__PURE__ */ React.createElement(Icon, { size: 52, strokeWidth: 1.25, color: t["--text-secondary"] }), /* @__PURE__ */ React.createElement(View, { style: [styles.lockBadge, { backgroundColor: t["--brand-primary"] }] }, /* @__PURE__ */ React.createElement(Lock, { size: 12, strokeWidth: 2.5, color: t["--brand-on-primary"] }))), /* @__PURE__ */ React.createElement(View, { style: [styles.pill, { backgroundColor: t["--surface-raised"] }] }, /* @__PURE__ */ React.createElement(Text, { variant: "caption", color: "secondary" }, planLineText(reason, planLabel))), /* @__PURE__ */ React.createElement(Text, { variant: "title", style: styles.title }, title), description ? /* @__PURE__ */ React.createElement(Text, { variant: "body-sm", color: "muted", style: styles.desc }, description) : null, /* @__PURE__ */ React.createElement(Button, { label: ctaLabel, variant: "primary", fullWidth: true, onPress: onCta }));
|
|
41
|
+
}
|
|
42
|
+
const styles = StyleSheet.create({
|
|
43
|
+
container: { alignItems: "center", paddingHorizontal: 8, gap: 12, width: "100%" },
|
|
44
|
+
iconWrap: { position: "relative", marginBottom: 4 },
|
|
45
|
+
lockBadge: {
|
|
46
|
+
position: "absolute",
|
|
47
|
+
bottom: -4,
|
|
48
|
+
right: -4,
|
|
49
|
+
width: 24,
|
|
50
|
+
height: 24,
|
|
51
|
+
borderRadius: 12,
|
|
52
|
+
alignItems: "center",
|
|
53
|
+
justifyContent: "center"
|
|
54
|
+
},
|
|
55
|
+
pill: { borderRadius: 999, paddingHorizontal: 10, paddingVertical: 4 },
|
|
56
|
+
title: { textAlign: "center" },
|
|
57
|
+
desc: { textAlign: "center", maxWidth: 320 }
|
|
58
|
+
});
|
|
59
|
+
export {
|
|
60
|
+
PaywallContent
|
|
61
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type RadioProps = {
|
|
5
|
+
label?: string;
|
|
6
|
+
value: string;
|
|
7
|
+
selected?: boolean;
|
|
8
|
+
onSelect?: (value: string) => void;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
};
|
|
11
|
+
declare function Radio({ label, value, selected, onSelect, disabled }: RadioProps): react.JSX.Element;
|
|
12
|
+
type RadioGroupProps = {
|
|
13
|
+
value: string | null;
|
|
14
|
+
onChange: (value: string) => void;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
};
|
|
18
|
+
declare function RadioGroup({ value, onChange, children, disabled }: RadioGroupProps): react.JSX.Element;
|
|
19
|
+
|
|
20
|
+
export { Radio, RadioGroup };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import "../../../chunk-ORMEWXMH.js";
|
|
2
|
+
import { Children, isValidElement, cloneElement } from "react";
|
|
3
|
+
import { Pressable, StyleSheet, View } from "react-native";
|
|
4
|
+
import { Text } from "./text.js";
|
|
5
|
+
import { useTheme } from "./theme.js";
|
|
6
|
+
function Radio({ label, value, selected = false, onSelect, disabled }) {
|
|
7
|
+
const t = useTheme();
|
|
8
|
+
return /* @__PURE__ */ React.createElement(
|
|
9
|
+
Pressable,
|
|
10
|
+
{
|
|
11
|
+
accessibilityRole: "radio",
|
|
12
|
+
accessibilityState: { checked: selected, disabled: !!disabled },
|
|
13
|
+
accessibilityLabel: label,
|
|
14
|
+
disabled,
|
|
15
|
+
hitSlop: 8,
|
|
16
|
+
onPress: () => onSelect == null ? void 0 : onSelect(value),
|
|
17
|
+
style: [styles.row, { opacity: disabled ? 0.5 : 1 }]
|
|
18
|
+
},
|
|
19
|
+
/* @__PURE__ */ React.createElement(
|
|
20
|
+
View,
|
|
21
|
+
{
|
|
22
|
+
style: [
|
|
23
|
+
styles.ring,
|
|
24
|
+
{ borderColor: selected ? t["--brand-primary"] : t["--border-strong"] }
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
selected ? /* @__PURE__ */ React.createElement(View, { style: [styles.dot, { backgroundColor: t["--brand-primary"] }] }) : null
|
|
28
|
+
),
|
|
29
|
+
label ? /* @__PURE__ */ React.createElement(Text, { variant: "body", style: { color: t["--text-primary"] } }, label) : null
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
function RadioGroup({ value, onChange, children, disabled }) {
|
|
33
|
+
return /* @__PURE__ */ React.createElement(View, { accessibilityRole: "radiogroup", style: styles.group }, Children.map(children, (child) => {
|
|
34
|
+
var _a;
|
|
35
|
+
if (!isValidElement(child)) return child;
|
|
36
|
+
const el = child;
|
|
37
|
+
return cloneElement(el, {
|
|
38
|
+
selected: el.props.value === value,
|
|
39
|
+
onSelect: onChange,
|
|
40
|
+
disabled: (_a = el.props.disabled) != null ? _a : disabled
|
|
41
|
+
});
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
const styles = StyleSheet.create({
|
|
45
|
+
group: {
|
|
46
|
+
gap: 4
|
|
47
|
+
},
|
|
48
|
+
row: {
|
|
49
|
+
flexDirection: "row",
|
|
50
|
+
alignItems: "center",
|
|
51
|
+
gap: 10,
|
|
52
|
+
minHeight: 44
|
|
53
|
+
},
|
|
54
|
+
ring: {
|
|
55
|
+
width: 20,
|
|
56
|
+
height: 20,
|
|
57
|
+
borderRadius: 10,
|
|
58
|
+
borderWidth: 2,
|
|
59
|
+
alignItems: "center",
|
|
60
|
+
justifyContent: "center"
|
|
61
|
+
},
|
|
62
|
+
dot: {
|
|
63
|
+
width: 10,
|
|
64
|
+
height: 10,
|
|
65
|
+
borderRadius: 5
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
export {
|
|
69
|
+
Radio,
|
|
70
|
+
RadioGroup
|
|
71
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { TextInputProps } from 'react-native';
|
|
4
|
+
|
|
5
|
+
type Props = Omit<TextInputProps, 'value' | 'onChangeText' | 'style'> & {
|
|
6
|
+
value: string;
|
|
7
|
+
onChangeText: (text: string) => void;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
/** Callback do botão clear (X). Limpa o campo. */
|
|
10
|
+
onClear?: () => void;
|
|
11
|
+
/** Disparado no submit (Enter / botão de busca do teclado). */
|
|
12
|
+
onSubmit?: (query: string) => void;
|
|
13
|
+
/** Slot de ação persistente à direita (antes do X). Ex.: scanner de código de barras. */
|
|
14
|
+
action?: {
|
|
15
|
+
icon: ReactNode;
|
|
16
|
+
onPress: () => void;
|
|
17
|
+
accessibilityLabel: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
declare function Search({ value, onChangeText, placeholder, onClear, onSubmit, action, accessibilityLabel, ...rest }: Props): react.JSX.Element;
|
|
21
|
+
|
|
22
|
+
export { Search };
|