@sincpro/mobile-ui 0.2.1 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -20
- package/dist/Dialog/BottomSheet/BottomSheet.Root.d.ts +13 -9
- package/dist/Dialog/BottomSheet/BottomSheet.Root.js +6 -2
- package/dist/Dialog/Confirmation.context.d.ts +1 -1
- package/dist/Dialog/Dialog.ActionSheet.d.ts +17 -0
- package/dist/Dialog/Dialog.ActionSheet.js +16 -0
- package/dist/Dialog/Dialog.Confirmation.js +5 -1
- package/dist/Dialog/Dialog.EditValue.d.ts +1 -1
- package/dist/Dialog/Dialog.EditValue.js +1 -1
- package/dist/Dialog/Dialog.Sheet.d.ts +26 -0
- package/dist/Dialog/Dialog.Sheet.js +55 -0
- package/dist/Dialog/index.d.ts +9 -7
- package/dist/Dialog/index.js +2 -0
- package/dist/Display/Display.Accordion.d.ts +18 -0
- package/dist/Display/Display.Accordion.js +22 -0
- package/dist/Display/Display.AvatarGroup.d.ts +12 -0
- package/dist/Display/Display.AvatarGroup.js +23 -0
- package/dist/Display/Display.Badge.d.ts +1 -1
- package/dist/Display/Display.Card.d.ts +46 -0
- package/dist/Display/Display.Card.js +36 -0
- package/dist/Display/Display.Carousel.d.ts +13 -0
- package/dist/Display/Display.Carousel.js +19 -0
- package/dist/Display/Display.Chip.d.ts +105 -0
- package/dist/Display/Display.Chip.js +45 -0
- package/dist/Display/Display.CopyableText.d.ts +1 -1
- package/dist/Display/Display.CountRecords.d.ts +1 -1
- package/dist/Display/Display.DataTable.d.ts +19 -0
- package/dist/Display/Display.DataTable.js +22 -0
- package/dist/Display/Display.Date.d.ts +15 -2
- package/dist/Display/Display.Date.js +34 -4
- package/dist/Display/Display.Divider.d.ts +1 -1
- package/dist/Display/Display.GradientSurface.d.ts +116 -0
- package/dist/Display/Display.GradientSurface.js +62 -0
- package/dist/Display/Display.IconBadge.d.ts +13 -0
- package/dist/Display/Display.IconBadge.js +30 -0
- package/dist/Display/Display.Image.d.ts +15 -0
- package/dist/Display/Display.Image.js +17 -0
- package/dist/Display/Display.KeyValue.d.ts +10 -0
- package/dist/Display/Display.KeyValue.js +9 -0
- package/dist/Display/Display.ListItem.d.ts +17 -0
- package/dist/Display/Display.ListItem.js +18 -0
- package/dist/Display/Display.Logo.js +3 -1
- package/dist/Display/Display.MediaCard.d.ts +17 -0
- package/dist/Display/Display.MediaCard.js +12 -0
- package/dist/Display/Display.MediaEmbed.d.ts +19 -0
- package/dist/Display/Display.MediaEmbed.js +39 -0
- package/dist/Display/Display.MenuButton.d.ts +1 -1
- package/dist/Display/Display.Monetary.d.ts +1 -1
- package/dist/Display/Display.Monetary.js +1 -1
- package/dist/Display/Display.Pattern.d.ts +26 -0
- package/dist/Display/Display.Pattern.js +27 -0
- package/dist/Display/Display.PriceTag.d.ts +10 -0
- package/dist/Display/Display.PriceTag.js +23 -0
- package/dist/Display/Display.ProductCard.d.ts +17 -0
- package/dist/Display/Display.ProductCard.js +13 -0
- package/dist/Display/Display.Rating.d.ts +11 -0
- package/dist/Display/Display.Rating.js +16 -0
- package/dist/Display/Display.SearchHistory.d.ts +12 -0
- package/dist/Display/Display.SearchHistory.js +13 -0
- package/dist/Display/Display.SectionHeader.d.ts +13 -0
- package/dist/Display/Display.SectionHeader.js +9 -0
- package/dist/Display/Display.Stat.d.ts +10 -0
- package/dist/Display/Display.Stat.js +9 -0
- package/dist/Display/Display.StatCard.d.ts +14 -0
- package/dist/Display/Display.StatCard.js +13 -0
- package/dist/Display/Display.StatusDot.d.ts +11 -0
- package/dist/Display/Display.StatusDot.js +28 -0
- package/dist/Display/Display.Story.d.ts +15 -0
- package/dist/Display/Display.Story.js +43 -0
- package/dist/Display/Display.StoryTray.d.ts +26 -0
- package/dist/Display/Display.StoryTray.js +43 -0
- package/dist/Display/Display.StoryViewer.d.ts +26 -0
- package/dist/Display/Display.StoryViewer.js +79 -0
- package/dist/Display/Display.SwipeableRow.d.ts +15 -0
- package/dist/Display/Display.SwipeableRow.js +28 -0
- package/dist/Display/Display.Tag.d.ts +11 -0
- package/dist/Display/Display.Tag.js +9 -0
- package/dist/Display/Display.Timeline.d.ts +13 -0
- package/dist/Display/Display.Timeline.js +19 -0
- package/dist/Display/Display.Tooltip.d.ts +10 -0
- package/dist/Display/Display.Tooltip.js +24 -0
- package/dist/Display/index.d.ts +70 -0
- package/dist/Display/index.js +58 -0
- package/dist/Feedback/ErrorBoundary.d.ts +1 -1
- package/dist/Feedback/Feedback.Banner.d.ts +82 -0
- package/dist/Feedback/Feedback.Banner.js +35 -0
- package/dist/Feedback/Feedback.DomainSplashScreen.d.ts +2 -1
- package/dist/Feedback/Feedback.DomainSplashScreen.js +3 -2
- package/dist/Feedback/Feedback.Empty.d.ts +1 -1
- package/dist/Feedback/Feedback.EmptyState.d.ts +15 -0
- package/dist/Feedback/Feedback.EmptyState.js +11 -0
- package/dist/Feedback/Feedback.Error.d.ts +1 -1
- package/dist/Feedback/Feedback.Loading.d.ts +8 -1
- package/dist/Feedback/Feedback.Loading.js +7 -1
- package/dist/Feedback/Feedback.PermissionCard.d.ts +15 -0
- package/dist/Feedback/Feedback.PermissionCard.js +11 -0
- package/dist/Feedback/Feedback.Progress.d.ts +9 -0
- package/dist/Feedback/Feedback.Progress.js +35 -0
- package/dist/Feedback/Feedback.ProgressCircle.d.ts +12 -0
- package/dist/Feedback/Feedback.ProgressCircle.js +15 -0
- package/dist/Feedback/Feedback.Skeleton.d.ts +11 -0
- package/dist/Feedback/Feedback.Skeleton.js +29 -0
- package/dist/Feedback/Feedback.Spinner.js +2 -1
- package/dist/Feedback/Feedback.Splash.d.ts +7 -1
- package/dist/Feedback/Feedback.Splash.js +11 -2
- package/dist/Feedback/Toast.context.d.ts +42 -0
- package/dist/Feedback/Toast.context.js +121 -0
- package/dist/Feedback/index.d.ts +15 -0
- package/dist/Feedback/index.js +15 -0
- package/dist/Form/Form.Button.d.ts +10 -4
- package/dist/Form/Form.Button.js +27 -16
- package/dist/Form/Form.Checkbox.d.ts +1 -1
- package/dist/Form/Form.Checkbox.js +1 -1
- package/dist/Form/Form.ControlledCheckbox.d.ts +1 -1
- package/dist/Form/Form.ControlledInput.d.ts +1 -1
- package/dist/Form/Form.ControlledMonetaryInput.d.ts +1 -1
- package/dist/Form/Form.ControlledRadioButton.d.ts +1 -1
- package/dist/Form/Form.DatePicker.d.ts +20 -0
- package/dist/Form/Form.DatePicker.js +38 -0
- package/dist/Form/Form.Dropdown.d.ts +1 -1
- package/dist/Form/Form.FAB.d.ts +10 -0
- package/dist/Form/Form.FAB.js +17 -0
- package/dist/Form/Form.FilterButton.d.ts +1 -1
- package/dist/Form/Form.FractionalQuantityInput.d.ts +1 -1
- package/dist/Form/Form.IconButton.d.ts +1 -1
- package/dist/Form/Form.Input.d.ts +2 -1
- package/dist/Form/Form.Input.js +1 -1
- package/dist/Form/Form.InputField.js +1 -1
- package/dist/Form/Form.MonetaryInput.d.ts +1 -1
- package/dist/Form/Form.PinInput.d.ts +12 -0
- package/dist/Form/Form.PinInput.js +23 -0
- package/dist/Form/Form.QuantitySelector.d.ts +2 -1
- package/dist/Form/Form.QuantitySelector.js +1 -1
- package/dist/Form/Form.RadioButton.d.ts +1 -1
- package/dist/Form/Form.SearchBar.d.ts +6 -1
- package/dist/Form/Form.SearchBar.js +4 -0
- package/dist/Form/Form.Select.d.ts +17 -0
- package/dist/Form/Form.Select.js +26 -0
- package/dist/Form/Form.Slider.d.ts +20 -0
- package/dist/Form/Form.Slider.js +16 -0
- package/dist/Form/Form.Switch.d.ts +10 -0
- package/dist/Form/Form.Switch.js +9 -0
- package/dist/Form/index.d.ts +12 -0
- package/dist/Form/index.js +12 -0
- package/dist/Navigation/Navigation.AppBar.d.ts +57 -0
- package/dist/Navigation/Navigation.AppBar.js +72 -0
- package/dist/Navigation/Navigation.BottomNav.d.ts +57 -0
- package/dist/Navigation/Navigation.BottomNav.js +108 -0
- package/dist/Navigation/Navigation.CollapsingHeader.d.ts +34 -0
- package/dist/Navigation/Navigation.CollapsingHeader.js +47 -0
- package/dist/Navigation/Navigation.FloatingBar.d.ts +15 -0
- package/dist/Navigation/Navigation.FloatingBar.js +21 -0
- package/dist/Navigation/Navigation.Header.d.ts +6 -2
- package/dist/Navigation/Navigation.Header.js +4 -0
- package/dist/Navigation/Navigation.HeaderToolbar.d.ts +1 -1
- package/dist/Navigation/Navigation.Menu.d.ts +21 -0
- package/dist/Navigation/Navigation.Menu.js +42 -0
- package/dist/Navigation/Navigation.RowItem.d.ts +1 -1
- package/dist/Navigation/Navigation.SearchBar.d.ts +18 -0
- package/dist/Navigation/Navigation.SearchBar.js +28 -0
- package/dist/Navigation/Navigation.SegmentedControl.d.ts +14 -0
- package/dist/Navigation/Navigation.SegmentedControl.js +13 -0
- package/dist/Navigation/Navigation.Steps.d.ts +8 -0
- package/dist/Navigation/Navigation.Steps.js +17 -0
- package/dist/Navigation/Navigation.TabIcon.d.ts +5 -1
- package/dist/Navigation/Navigation.TabIcon.js +4 -0
- package/dist/Navigation/Navigation.TabItem.d.ts +5 -0
- package/dist/Navigation/Navigation.TabItem.js +5 -0
- package/dist/Navigation/Navigation.Tabs.d.ts +28 -0
- package/dist/Navigation/Navigation.Tabs.js +45 -0
- package/dist/Navigation/index.d.ts +32 -1
- package/dist/Navigation/index.js +18 -0
- package/dist/Typography/Typography.Text.d.ts +3 -2
- package/dist/Typography/Typography.Text.js +16 -6
- package/dist/branding.d.ts +6 -0
- package/dist/branding.js +7 -0
- package/dist/icons/ArrowDownIcon.d.ts +2 -1
- package/dist/icons/ArrowUpIcon.d.ts +2 -1
- package/dist/icons/CreditIcon.d.ts +1 -1
- package/dist/icons/OdooIcon.d.ts +6 -1
- package/dist/icons/OdooIcon.js +5 -0
- package/dist/icons/PrinterIcon.d.ts +5 -0
- package/dist/icons/PrinterIcon.js +5 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/layouts/AuthContainer.d.ts +1 -1
- package/dist/layouts/AuthContainer.js +2 -2
- package/dist/layouts/Container.d.ts +1 -0
- package/dist/layouts/Container.js +2 -3
- package/dist/layouts/GradientContainer.d.ts +1 -1
- package/dist/layouts/PlainLayout.d.ts +1 -1
- package/dist/layouts/ScrollContainer.d.ts +2 -2
- package/dist/layouts/ScrollContainer.js +1 -1
- package/dist/layouts/TabNavigatorLayout.d.ts +2 -2
- package/dist/layouts/TabNavigatorLayout.js +4 -0
- package/dist/primitives/AspectRatio.d.ts +10 -0
- package/dist/primitives/AspectRatio.js +8 -0
- package/dist/primitives/Box.d.ts +1 -1
- package/dist/primitives/Pressable.d.ts +10 -0
- package/dist/primitives/Pressable.js +9 -0
- package/dist/primitives/Row.d.ts +1 -1
- package/dist/primitives/Spacer.d.ts +8 -0
- package/dist/primitives/Spacer.js +9 -0
- package/dist/primitives/Stack.d.ts +1 -1
- package/dist/primitives/index.d.ts +3 -0
- package/dist/primitives/index.js +3 -0
- package/dist/theme/active.d.ts +2 -0
- package/dist/theme/active.js +13 -0
- package/dist/theme/components/ThemedActivityIndicator.d.ts +1 -1
- package/dist/theme/components/index.d.ts +1 -1
- package/dist/theme/components/index.js +1 -1
- package/dist/theme/dark.d.ts +7 -0
- package/dist/theme/dark.js +85 -0
- package/dist/theme/default.js +1 -0
- package/dist/theme/define.d.ts +5 -5
- package/dist/theme/define.js +5 -5
- package/dist/theme/index.d.ts +4 -1
- package/dist/theme/index.js +4 -1
- package/dist/theme/theme.d.ts +1 -1
- package/dist/theme/theme.js +1 -1
- package/dist/theme/types.d.ts +15 -14
- package/dist/theme/types.js +2 -2
- package/dist/theme/typography.d.ts +117 -60
- package/dist/theme/typography.js +115 -29
- package/dist/theme/useTheme.d.ts +3 -1
- package/dist/theme/useTheme.js +6 -1
- package/dist/tokens/index.d.ts +2 -0
- package/dist/tokens/index.js +2 -0
- package/dist/tokens/motion.d.ts +71 -0
- package/dist/tokens/motion.js +25 -0
- package/dist/utils/date.d.ts +33 -33
- package/dist/utils/date.js +39 -39
- package/dist/utils/timezone.d.ts +5 -0
- package/dist/views/AuthFormView.d.ts +1 -1
- package/dist/views/FormViewV2.context.d.ts +1 -1
- package/dist/views/FormViewV2.d.ts +12 -11
- package/dist/views/FormViewV2.js +8 -4
- package/dist/views/ListViewV2.context.d.ts +6 -2
- package/dist/views/ListViewV2.context.js +3 -1
- package/dist/views/ListViewV2.d.ts +26 -21
- package/dist/views/ListViewV2.js +18 -20
- package/dist/views/Wizard/Wizard.context.d.ts +1 -1
- package/dist/widgets/CircleButton.d.ts +6 -2
- package/dist/widgets/CircleButton.js +4 -0
- package/dist/widgets/GeoPermissionCard.d.ts +6 -1
- package/dist/widgets/GeoPermissionCard.js +8 -3
- package/dist/widgets/HomeHeader.d.ts +4 -0
- package/dist/widgets/HomeHeader.js +4 -0
- package/dist/widgets/JSONViewer.d.ts +2 -1
- package/dist/widgets/JSONViewer.js +9 -12
- package/dist/widgets/MenuCard.d.ts +1 -1
- package/dist/widgets/ScreenHeader.d.ts +5 -1
- package/dist/widgets/ScreenHeader.js +4 -0
- package/dist/widgets/TimeZoneSelector.d.ts +6 -1
- package/dist/widgets/TimeZoneSelector.js +6 -1
- package/dist/widgets/TimeZoneSelectorModal.d.ts +6 -1
- package/dist/widgets/TimeZoneSelectorModal.js +8 -3
- package/package.json +41 -23
- package/tailwind.preset.js +14 -0
- package/dist/notifications/index.d.ts +0 -1
- package/dist/notifications/index.js +0 -1
- package/dist/providers/index.d.ts +0 -1
- package/dist/providers/index.js +0 -2
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
+
import Icon from "../Display/Display.Icon";
|
|
3
|
+
import Pressable from "../primitives/Pressable";
|
|
4
|
+
import { theme } from "../theme";
|
|
5
|
+
import { Typography } from "../Typography";
|
|
6
|
+
import { LinearGradient } from "expo-linear-gradient";
|
|
7
|
+
import { Image, Modal, Pressable as RNPressable, View, } from "react-native";
|
|
8
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
9
|
+
function StoryViewer({ visible, slides, index, onIndexChange, onClose, title, subtitle, time, avatar, progress = 1, muted, paused, onToggleMute, onTogglePause, onMore, footer, testID, }) {
|
|
10
|
+
const insets = useSafeAreaInsets();
|
|
11
|
+
const current = slides[index];
|
|
12
|
+
const goPrev = () => {
|
|
13
|
+
if (index > 0)
|
|
14
|
+
onIndexChange(index - 1);
|
|
15
|
+
};
|
|
16
|
+
const goNext = () => {
|
|
17
|
+
if (index < slides.length - 1)
|
|
18
|
+
onIndexChange(index + 1);
|
|
19
|
+
else
|
|
20
|
+
onClose();
|
|
21
|
+
};
|
|
22
|
+
if (!current)
|
|
23
|
+
return null;
|
|
24
|
+
return (_jsx(Modal, { animationType: "fade", onRequestClose: onClose, statusBarTranslucent: true, transparent: false, visible: visible, children: _jsxs(View, { style: { flex: 1, backgroundColor: "#000" }, testID: testID, children: [_jsx(Image, { resizeMode: "contain", source: current.image, style: {
|
|
25
|
+
position: "absolute",
|
|
26
|
+
top: 0,
|
|
27
|
+
left: 0,
|
|
28
|
+
right: 0,
|
|
29
|
+
bottom: 0,
|
|
30
|
+
width: "100%",
|
|
31
|
+
height: "100%",
|
|
32
|
+
} }), _jsxs(View, { style: {
|
|
33
|
+
position: "absolute",
|
|
34
|
+
top: 0,
|
|
35
|
+
bottom: 0,
|
|
36
|
+
left: 0,
|
|
37
|
+
right: 0,
|
|
38
|
+
flexDirection: "row",
|
|
39
|
+
}, children: [_jsx(RNPressable, { onPress: goPrev, style: { width: "33%" } }), _jsx(RNPressable, { onPress: goNext, style: { flex: 1 } })] }), _jsxs(LinearGradient, { colors: ["rgba(0,0,0,0.6)", "transparent"], style: {
|
|
40
|
+
position: "absolute",
|
|
41
|
+
top: 0,
|
|
42
|
+
left: 0,
|
|
43
|
+
right: 0,
|
|
44
|
+
paddingTop: insets.top + 8,
|
|
45
|
+
paddingHorizontal: 10,
|
|
46
|
+
}, children: [_jsx(View, { style: { flexDirection: "row", gap: 4 }, children: slides.map((_, i) => (_jsx(View, { style: {
|
|
47
|
+
flex: 1,
|
|
48
|
+
height: 2.5,
|
|
49
|
+
borderRadius: 2,
|
|
50
|
+
backgroundColor: "rgba(255,255,255,0.35)",
|
|
51
|
+
overflow: "hidden",
|
|
52
|
+
}, children: _jsx(View, { style: {
|
|
53
|
+
height: "100%",
|
|
54
|
+
width: i < index
|
|
55
|
+
? "100%"
|
|
56
|
+
: i === index
|
|
57
|
+
? `${Math.round(progress * 100)}%`
|
|
58
|
+
: "0%",
|
|
59
|
+
backgroundColor: "#fff",
|
|
60
|
+
} }) }, i))) }), _jsxs(View, { style: { flexDirection: "row", alignItems: "center", marginTop: 12 }, children: [avatar ? (_jsx(Image, { source: avatar, style: { width: 36, height: 36, borderRadius: 18, marginRight: 8 } })) : null, _jsxs(View, { style: { flex: 1 }, children: [_jsxs(View, { style: { flexDirection: "row", alignItems: "center", gap: 6 }, children: [_jsx(Typography.Text, { className: "text-white", semibold: true, variant: "body", children: title }), time ? (_jsx(Typography.Text, { style: { color: "rgba(255,255,255,0.7)" }, variant: "caption", children: time })) : null] }), subtitle ? (_jsx(Typography.Text, { numberOfLines: 1, style: { color: "rgba(255,255,255,0.8)" }, variant: "caption", children: subtitle })) : null] }), onToggleMute ? (_jsx(Pressable, { accessibilityLabel: muted ? "Activar sonido" : "Silenciar", hitSlop: 8, onPress: onToggleMute, children: _jsx(Icon, { color: "#fff", name: muted ? "volume-mute" : "volume-high", size: 22 }) })) : null, onTogglePause ? (_jsx(Pressable, { accessibilityLabel: paused ? "Reanudar" : "Pausar", hitSlop: 8, onPress: onTogglePause, style: { marginLeft: 14 }, children: _jsx(Icon, { color: "#fff", name: paused ? "play" : "pause", size: 22 }) })) : null, onMore ? (_jsx(Pressable, { accessibilityLabel: "M\u00E1s opciones", hitSlop: 8, onPress: onMore, style: { marginLeft: 14 }, children: _jsx(Icon, { color: "#fff", name: "ellipsis-horizontal", size: 22 }) })) : null, _jsx(Pressable, { accessibilityLabel: "Cerrar", hitSlop: 8, onPress: onClose, style: { marginLeft: 14 }, children: _jsx(Icon, { color: "#fff", name: "close", size: 24 }) })] })] }), index < slides.length - 1 ? (_jsx(Pressable, { accessibilityLabel: "Siguiente", onPress: goNext, style: {
|
|
61
|
+
position: "absolute",
|
|
62
|
+
right: 8,
|
|
63
|
+
top: "50%",
|
|
64
|
+
width: 36,
|
|
65
|
+
height: 36,
|
|
66
|
+
borderRadius: 18,
|
|
67
|
+
backgroundColor: "rgba(255,255,255,0.9)",
|
|
68
|
+
alignItems: "center",
|
|
69
|
+
justifyContent: "center",
|
|
70
|
+
}, children: _jsx(Icon, { color: theme.text.primary, name: "chevron-forward", size: 22 }) })) : null, footer ? (_jsx(View, { style: {
|
|
71
|
+
position: "absolute",
|
|
72
|
+
left: 0,
|
|
73
|
+
right: 0,
|
|
74
|
+
bottom: 0,
|
|
75
|
+
paddingBottom: insets.bottom + 8,
|
|
76
|
+
paddingHorizontal: 16,
|
|
77
|
+
}, children: footer })) : null] }) }));
|
|
78
|
+
}
|
|
79
|
+
export default StoryViewer;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface SwipeRowAction {
|
|
3
|
+
label?: string;
|
|
4
|
+
icon?: string;
|
|
5
|
+
color?: string;
|
|
6
|
+
onPress: () => void;
|
|
7
|
+
}
|
|
8
|
+
export interface SwipeableRowProps {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
rightActions?: SwipeRowAction[];
|
|
11
|
+
leftActions?: SwipeRowAction[];
|
|
12
|
+
testID?: string;
|
|
13
|
+
}
|
|
14
|
+
declare function SwipeableRow({ children, rightActions, leftActions, testID }: SwipeableRowProps): import("react").JSX.Element;
|
|
15
|
+
export default SwipeableRow;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
+
import Icon from "../Display/Display.Icon";
|
|
3
|
+
import { theme } from "../theme";
|
|
4
|
+
import { Typography } from "../Typography";
|
|
5
|
+
import { useRef } from "react";
|
|
6
|
+
import { TouchableOpacity, View } from "react-native";
|
|
7
|
+
import { Swipeable } from "react-native-gesture-handler";
|
|
8
|
+
function ActionButtons({ actions, onDone, }) {
|
|
9
|
+
return (_jsx(View, { style: { flexDirection: "row" }, children: actions.map((action, index) => (_jsxs(TouchableOpacity, { accessibilityLabel: action.label ?? "Acción", accessibilityRole: "button", activeOpacity: 0.8, onPress: () => {
|
|
10
|
+
onDone();
|
|
11
|
+
action.onPress();
|
|
12
|
+
}, style: {
|
|
13
|
+
backgroundColor: action.color ?? theme.danger,
|
|
14
|
+
justifyContent: "center",
|
|
15
|
+
alignItems: "center",
|
|
16
|
+
paddingHorizontal: 20,
|
|
17
|
+
}, children: [action.icon ? (_jsx(Icon, { color: theme.text.inverse, name: action.icon, size: 20 })) : null, action.label ? (_jsx(Typography.Text, { className: "text-text-inverse text-xs mt-1", children: action.label })) : null] }, index))) }));
|
|
18
|
+
}
|
|
19
|
+
function SwipeableRow({ children, rightActions, leftActions, testID }) {
|
|
20
|
+
const ref = useRef(null);
|
|
21
|
+
const close = () => ref.current?.close();
|
|
22
|
+
return (_jsx(Swipeable, { ref: ref, renderLeftActions: leftActions?.length
|
|
23
|
+
? () => _jsx(ActionButtons, { actions: leftActions, onDone: close })
|
|
24
|
+
: undefined, renderRightActions: rightActions?.length
|
|
25
|
+
? () => _jsx(ActionButtons, { actions: rightActions, onDone: close })
|
|
26
|
+
: undefined, testID: testID, children: children }));
|
|
27
|
+
}
|
|
28
|
+
export default SwipeableRow;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface TagProps {
|
|
3
|
+
label: string;
|
|
4
|
+
leading?: ReactNode;
|
|
5
|
+
dotColor?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
testID?: string;
|
|
8
|
+
}
|
|
9
|
+
declare function Tag({ label, leading, dotColor, className, testID }: TagProps): import("react").JSX.Element;
|
|
10
|
+
export default Tag;
|
|
11
|
+
export { Tag };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
+
import { cn } from "../theme/tw";
|
|
3
|
+
import { Typography } from "../Typography";
|
|
4
|
+
import { View } from "react-native";
|
|
5
|
+
function Tag({ label, leading, dotColor, className, testID }) {
|
|
6
|
+
return (_jsxs(View, { className: cn("flex-row items-center self-start rounded-full bg-bg-muted px-2.5 py-1 gap-1.5", className), testID: testID, children: [dotColor ? (_jsx(View, { style: { width: 8, height: 8, borderRadius: 4, backgroundColor: dotColor } })) : null, leading, _jsx(Typography.Text, { className: "text-text-secondary text-xs font-medium", numberOfLines: 1, children: label })] }));
|
|
7
|
+
}
|
|
8
|
+
export default Tag;
|
|
9
|
+
export { Tag };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface TimelineStep {
|
|
2
|
+
title: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
time?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface TimelineProps {
|
|
7
|
+
steps: TimelineStep[];
|
|
8
|
+
current: number;
|
|
9
|
+
className?: string;
|
|
10
|
+
testID?: string;
|
|
11
|
+
}
|
|
12
|
+
declare function Timeline({ steps, current, className, testID }: TimelineProps): import("react").JSX.Element;
|
|
13
|
+
export default Timeline;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
+
import Icon from "../Display/Display.Icon";
|
|
3
|
+
import { theme } from "../theme";
|
|
4
|
+
import { cn } from "../theme/tw";
|
|
5
|
+
import { Typography } from "../Typography";
|
|
6
|
+
import { View } from "react-native";
|
|
7
|
+
function Timeline({ steps, current, className, testID }) {
|
|
8
|
+
return (_jsx(View, { className: className, testID: testID, children: steps.map((step, index) => {
|
|
9
|
+
const done = index < current;
|
|
10
|
+
const active = index === current;
|
|
11
|
+
const reached = done || active;
|
|
12
|
+
const isLast = index === steps.length - 1;
|
|
13
|
+
const dotColor = reached ? theme.primary : theme.bg.muted;
|
|
14
|
+
return (_jsxs(View, { className: "flex-row", children: [_jsxs(View, { className: "items-center", style: { width: 28 }, children: [_jsx(View, { className: "w-6 h-6 rounded-full items-center justify-center", style: { backgroundColor: dotColor }, children: done ? (_jsx(Icon, { color: theme.text.inverse, name: "checkmark", size: 14 })) : (_jsx(View, { className: "w-2 h-2 rounded-full", style: {
|
|
15
|
+
backgroundColor: active ? theme.text.inverse : theme.border.strong,
|
|
16
|
+
} })) }), !isLast ? (_jsx(View, { className: "flex-1 w-0.5 my-1", style: { backgroundColor: done ? theme.primary : theme.border.default } })) : null] }), _jsxs(View, { className: cn("flex-1 pb-5", isLast && "pb-0"), children: [_jsxs(View, { className: "flex-row items-center justify-between", children: [_jsx(Typography.Text, { className: reached ? "text-text-primary" : "text-text-tertiary", semibold: active, variant: "body", children: step.title }), step.time ? (_jsx(Typography.Text, { className: "text-text-tertiary", variant: "caption", children: step.time })) : null] }), step.description ? (_jsx(Typography.Text, { className: "text-text-secondary", variant: "bodySmall", children: step.description })) : null] })] }, step.title));
|
|
17
|
+
}) }));
|
|
18
|
+
}
|
|
19
|
+
export default Timeline;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface TooltipProps {
|
|
3
|
+
content: string;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
placement?: "top" | "bottom";
|
|
6
|
+
width?: number;
|
|
7
|
+
testID?: string;
|
|
8
|
+
}
|
|
9
|
+
declare function Tooltip({ content, children, placement, width, testID, }: TooltipProps): import("react").JSX.Element;
|
|
10
|
+
export default Tooltip;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
+
import Pressable from "../primitives/Pressable";
|
|
3
|
+
import { theme } from "../theme";
|
|
4
|
+
import { Typography } from "../Typography";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { View } from "react-native";
|
|
7
|
+
function Tooltip({ content, children, placement = "top", width = 200, testID, }) {
|
|
8
|
+
const [visible, setVisible] = useState(false);
|
|
9
|
+
const isTop = placement === "top";
|
|
10
|
+
return (_jsxs(View, { style: { position: "relative", alignSelf: "flex-start" }, testID: testID, children: [_jsx(Pressable, { accessibilityHint: content, accessibilityRole: "button", onPress: () => setVisible((v) => !v), children: children }), visible ? (_jsx(View, { style: {
|
|
11
|
+
position: "absolute",
|
|
12
|
+
[isTop ? "bottom" : "top"]: "100%",
|
|
13
|
+
left: 0,
|
|
14
|
+
width,
|
|
15
|
+
marginVertical: 6,
|
|
16
|
+
paddingHorizontal: 10,
|
|
17
|
+
paddingVertical: 8,
|
|
18
|
+
borderRadius: 8,
|
|
19
|
+
backgroundColor: theme.text.primary,
|
|
20
|
+
...theme.shadow.md,
|
|
21
|
+
zIndex: 1700,
|
|
22
|
+
}, children: _jsx(Typography.Text, { style: { color: theme.bg.card }, variant: "bodySmall", children: content }) })) : null] }));
|
|
23
|
+
}
|
|
24
|
+
export default Tooltip;
|
package/dist/Display/index.d.ts
CHANGED
|
@@ -1,22 +1,92 @@
|
|
|
1
|
+
import AvatarGroup from "../Display/Display.AvatarGroup";
|
|
1
2
|
import Badge, { type BadgeProps, BadgeVariants } from "../Display/Display.Badge";
|
|
3
|
+
import Carousel from "../Display/Display.Carousel";
|
|
4
|
+
import Chip from "../Display/Display.Chip";
|
|
2
5
|
import CopyableText from "../Display/Display.CopyableText";
|
|
3
6
|
import CountRecords from "../Display/Display.CountRecords";
|
|
7
|
+
import DataTable from "../Display/Display.DataTable";
|
|
4
8
|
import Date from "../Display/Display.Date";
|
|
5
9
|
import Divider from "../Display/Display.Divider";
|
|
10
|
+
import GradientSurface from "../Display/Display.GradientSurface";
|
|
11
|
+
import IconBadge from "../Display/Display.IconBadge";
|
|
12
|
+
import DisplayImage from "../Display/Display.Image";
|
|
13
|
+
import KeyValue from "../Display/Display.KeyValue";
|
|
14
|
+
import ListItem from "../Display/Display.ListItem";
|
|
15
|
+
import MediaCard from "../Display/Display.MediaCard";
|
|
16
|
+
import MediaEmbed from "../Display/Display.MediaEmbed";
|
|
6
17
|
import MenuButton from "../Display/Display.MenuButton";
|
|
7
18
|
import Monetary from "../Display/Display.Monetary";
|
|
19
|
+
import Pattern from "../Display/Display.Pattern";
|
|
20
|
+
import PriceTag from "../Display/Display.PriceTag";
|
|
21
|
+
import ProductCard from "../Display/Display.ProductCard";
|
|
22
|
+
import Rating from "../Display/Display.Rating";
|
|
23
|
+
import SearchHistory from "../Display/Display.SearchHistory";
|
|
24
|
+
import SectionHeader from "../Display/Display.SectionHeader";
|
|
25
|
+
import Stat from "../Display/Display.Stat";
|
|
26
|
+
import StatCard from "../Display/Display.StatCard";
|
|
27
|
+
import StatusDot from "../Display/Display.StatusDot";
|
|
28
|
+
import Story from "../Display/Display.Story";
|
|
29
|
+
import StoryTray from "../Display/Display.StoryTray";
|
|
30
|
+
import StoryViewer from "../Display/Display.StoryViewer";
|
|
31
|
+
import SwipeableRow from "../Display/Display.SwipeableRow";
|
|
32
|
+
import Tag from "../Display/Display.Tag";
|
|
33
|
+
import Timeline from "../Display/Display.Timeline";
|
|
34
|
+
import Tooltip from "../Display/Display.Tooltip";
|
|
8
35
|
export declare const Display: {
|
|
9
36
|
Badge: typeof Badge;
|
|
10
37
|
BadgeVariants: typeof BadgeVariants;
|
|
38
|
+
Accordion: (({ children, className }: {
|
|
39
|
+
children: import("react").ReactNode;
|
|
40
|
+
className?: string;
|
|
41
|
+
}) => import("react").JSX.Element) & {
|
|
42
|
+
Item: ({ title, children, defaultOpen, className, testID, }: import("../Display/Display.Accordion").AccordionItemProps) => import("react").JSX.Element;
|
|
43
|
+
};
|
|
11
44
|
Avatar: import("react").FC<import("../Display/Display.Avatar").AvatarProps>;
|
|
45
|
+
AvatarGroup: typeof AvatarGroup;
|
|
46
|
+
Card: (({ padding, elevation, onPress, className, children, testID, }: import("../Display/Display.Card").CardProps) => import("react").JSX.Element) & {
|
|
47
|
+
Title: ({ children, className }: {
|
|
48
|
+
children: import("react").ReactNode;
|
|
49
|
+
className?: string;
|
|
50
|
+
}) => import("react").JSX.Element;
|
|
51
|
+
Footer: ({ children, className }: {
|
|
52
|
+
children: import("react").ReactNode;
|
|
53
|
+
className?: string;
|
|
54
|
+
}) => import("react").JSX.Element;
|
|
55
|
+
};
|
|
56
|
+
Carousel: typeof Carousel;
|
|
57
|
+
Chip: typeof Chip;
|
|
58
|
+
Tag: typeof Tag;
|
|
59
|
+
Image: typeof DisplayImage;
|
|
60
|
+
MediaCard: typeof MediaCard;
|
|
61
|
+
MediaEmbed: typeof MediaEmbed;
|
|
62
|
+
Story: typeof Story;
|
|
63
|
+
StoryTray: typeof StoryTray;
|
|
64
|
+
StoryViewer: typeof StoryViewer;
|
|
65
|
+
ListItem: typeof ListItem;
|
|
66
|
+
KeyValue: typeof KeyValue;
|
|
67
|
+
DataTable: typeof DataTable;
|
|
68
|
+
Stat: typeof Stat;
|
|
69
|
+
StatCard: typeof StatCard;
|
|
70
|
+
StatusDot: typeof StatusDot;
|
|
71
|
+
PriceTag: typeof PriceTag;
|
|
72
|
+
ProductCard: typeof ProductCard;
|
|
73
|
+
Timeline: typeof Timeline;
|
|
74
|
+
SearchHistory: typeof SearchHistory;
|
|
75
|
+
SectionHeader: typeof SectionHeader;
|
|
76
|
+
Rating: typeof Rating;
|
|
77
|
+
SwipeableRow: typeof SwipeableRow;
|
|
78
|
+
Tooltip: typeof Tooltip;
|
|
79
|
+
IconBadge: typeof IconBadge;
|
|
12
80
|
CopyableText: typeof CopyableText;
|
|
13
81
|
Date: typeof Date;
|
|
14
82
|
Divider: typeof Divider;
|
|
83
|
+
GradientSurface: typeof GradientSurface;
|
|
15
84
|
Icon: import("react").FC<import("../Display/Display.Icon").IconProps>;
|
|
16
85
|
CountRecords: typeof CountRecords;
|
|
17
86
|
Logo: import("react").FC<import("../Display/Display.Logo").LogoProps>;
|
|
18
87
|
MenuButton: typeof MenuButton;
|
|
19
88
|
Monetary: typeof Monetary;
|
|
89
|
+
Pattern: typeof Pattern;
|
|
20
90
|
};
|
|
21
91
|
export { type BadgeProps, BadgeVariants };
|
|
22
92
|
export default Display;
|
package/dist/Display/index.js
CHANGED
|
@@ -1,25 +1,83 @@
|
|
|
1
|
+
import Accordion from "../Display/Display.Accordion";
|
|
1
2
|
import Avatar from "../Display/Display.Avatar";
|
|
3
|
+
import AvatarGroup from "../Display/Display.AvatarGroup";
|
|
2
4
|
import Badge, { BadgeVariants, } from "../Display/Display.Badge";
|
|
5
|
+
import Card from "../Display/Display.Card";
|
|
6
|
+
import Carousel from "../Display/Display.Carousel";
|
|
7
|
+
import Chip from "../Display/Display.Chip";
|
|
3
8
|
import CopyableText from "../Display/Display.CopyableText";
|
|
4
9
|
import CountRecords from "../Display/Display.CountRecords";
|
|
10
|
+
import DataTable from "../Display/Display.DataTable";
|
|
5
11
|
import Date from "../Display/Display.Date";
|
|
6
12
|
import Divider from "../Display/Display.Divider";
|
|
13
|
+
import GradientSurface from "../Display/Display.GradientSurface";
|
|
7
14
|
import Icon from "../Display/Display.Icon";
|
|
15
|
+
import IconBadge from "../Display/Display.IconBadge";
|
|
16
|
+
import DisplayImage from "../Display/Display.Image";
|
|
17
|
+
import KeyValue from "../Display/Display.KeyValue";
|
|
18
|
+
import ListItem from "../Display/Display.ListItem";
|
|
8
19
|
import Logo from "../Display/Display.Logo";
|
|
20
|
+
import MediaCard from "../Display/Display.MediaCard";
|
|
21
|
+
import MediaEmbed from "../Display/Display.MediaEmbed";
|
|
9
22
|
import MenuButton from "../Display/Display.MenuButton";
|
|
10
23
|
import Monetary from "../Display/Display.Monetary";
|
|
24
|
+
import Pattern from "../Display/Display.Pattern";
|
|
25
|
+
import PriceTag from "../Display/Display.PriceTag";
|
|
26
|
+
import ProductCard from "../Display/Display.ProductCard";
|
|
27
|
+
import Rating from "../Display/Display.Rating";
|
|
28
|
+
import SearchHistory from "../Display/Display.SearchHistory";
|
|
29
|
+
import SectionHeader from "../Display/Display.SectionHeader";
|
|
30
|
+
import Stat from "../Display/Display.Stat";
|
|
31
|
+
import StatCard from "../Display/Display.StatCard";
|
|
32
|
+
import StatusDot from "../Display/Display.StatusDot";
|
|
33
|
+
import Story from "../Display/Display.Story";
|
|
34
|
+
import StoryTray from "../Display/Display.StoryTray";
|
|
35
|
+
import StoryViewer from "../Display/Display.StoryViewer";
|
|
36
|
+
import SwipeableRow from "../Display/Display.SwipeableRow";
|
|
37
|
+
import Tag from "../Display/Display.Tag";
|
|
38
|
+
import Timeline from "../Display/Display.Timeline";
|
|
39
|
+
import Tooltip from "../Display/Display.Tooltip";
|
|
11
40
|
export const Display = {
|
|
12
41
|
Badge,
|
|
13
42
|
BadgeVariants,
|
|
43
|
+
Accordion,
|
|
14
44
|
Avatar,
|
|
45
|
+
AvatarGroup,
|
|
46
|
+
Card,
|
|
47
|
+
Carousel,
|
|
48
|
+
Chip,
|
|
49
|
+
Tag,
|
|
50
|
+
Image: DisplayImage,
|
|
51
|
+
MediaCard,
|
|
52
|
+
MediaEmbed,
|
|
53
|
+
Story,
|
|
54
|
+
StoryTray,
|
|
55
|
+
StoryViewer,
|
|
56
|
+
ListItem,
|
|
57
|
+
KeyValue,
|
|
58
|
+
DataTable,
|
|
59
|
+
Stat,
|
|
60
|
+
StatCard,
|
|
61
|
+
StatusDot,
|
|
62
|
+
PriceTag,
|
|
63
|
+
ProductCard,
|
|
64
|
+
Timeline,
|
|
65
|
+
SearchHistory,
|
|
66
|
+
SectionHeader,
|
|
67
|
+
Rating,
|
|
68
|
+
SwipeableRow,
|
|
69
|
+
Tooltip,
|
|
70
|
+
IconBadge,
|
|
15
71
|
CopyableText,
|
|
16
72
|
Date,
|
|
17
73
|
Divider,
|
|
74
|
+
GradientSurface,
|
|
18
75
|
Icon,
|
|
19
76
|
CountRecords,
|
|
20
77
|
Logo,
|
|
21
78
|
MenuButton,
|
|
22
79
|
Monetary,
|
|
80
|
+
Pattern,
|
|
23
81
|
};
|
|
24
82
|
export { BadgeVariants };
|
|
25
83
|
export default Display;
|
|
@@ -13,6 +13,6 @@ export declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBo
|
|
|
13
13
|
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
14
14
|
componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
|
|
15
15
|
handleRetry: () => void;
|
|
16
|
-
render(): string | number | bigint | boolean |
|
|
16
|
+
render(): string | number | bigint | boolean | React.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
|
|
17
17
|
}
|
|
18
18
|
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { type VariantProps } from "../theme/tw";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
declare const banner: import("tailwind-variants").TVReturnType<{
|
|
4
|
+
tone: {
|
|
5
|
+
info: {
|
|
6
|
+
root: string;
|
|
7
|
+
title: string;
|
|
8
|
+
};
|
|
9
|
+
success: {
|
|
10
|
+
root: string;
|
|
11
|
+
title: string;
|
|
12
|
+
};
|
|
13
|
+
warning: {
|
|
14
|
+
root: string;
|
|
15
|
+
title: string;
|
|
16
|
+
};
|
|
17
|
+
danger: {
|
|
18
|
+
root: string;
|
|
19
|
+
title: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
}, {
|
|
23
|
+
root: string;
|
|
24
|
+
title: string;
|
|
25
|
+
message: string;
|
|
26
|
+
}, undefined, {
|
|
27
|
+
tone: {
|
|
28
|
+
info: {
|
|
29
|
+
root: string;
|
|
30
|
+
title: string;
|
|
31
|
+
};
|
|
32
|
+
success: {
|
|
33
|
+
root: string;
|
|
34
|
+
title: string;
|
|
35
|
+
};
|
|
36
|
+
warning: {
|
|
37
|
+
root: string;
|
|
38
|
+
title: string;
|
|
39
|
+
};
|
|
40
|
+
danger: {
|
|
41
|
+
root: string;
|
|
42
|
+
title: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
}, {
|
|
46
|
+
root: string;
|
|
47
|
+
title: string;
|
|
48
|
+
message: string;
|
|
49
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
50
|
+
tone: {
|
|
51
|
+
info: {
|
|
52
|
+
root: string;
|
|
53
|
+
title: string;
|
|
54
|
+
};
|
|
55
|
+
success: {
|
|
56
|
+
root: string;
|
|
57
|
+
title: string;
|
|
58
|
+
};
|
|
59
|
+
warning: {
|
|
60
|
+
root: string;
|
|
61
|
+
title: string;
|
|
62
|
+
};
|
|
63
|
+
danger: {
|
|
64
|
+
root: string;
|
|
65
|
+
title: string;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
}, {
|
|
69
|
+
root: string;
|
|
70
|
+
title: string;
|
|
71
|
+
message: string;
|
|
72
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
73
|
+
export interface BannerProps extends VariantProps<typeof banner> {
|
|
74
|
+
message: string;
|
|
75
|
+
title?: string;
|
|
76
|
+
onClose?: () => void;
|
|
77
|
+
action?: ReactNode;
|
|
78
|
+
className?: string;
|
|
79
|
+
testID?: string;
|
|
80
|
+
}
|
|
81
|
+
declare function Banner({ message, title, tone, onClose, action, className, testID, }: BannerProps): import("react").JSX.Element;
|
|
82
|
+
export default Banner;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
+
import Icon from "../Display/Display.Icon";
|
|
3
|
+
import Pressable from "../primitives/Pressable";
|
|
4
|
+
import { theme } from "../theme";
|
|
5
|
+
import { tv } from "../theme/tw";
|
|
6
|
+
import { Typography } from "../Typography";
|
|
7
|
+
import { View } from "react-native";
|
|
8
|
+
const banner = tv({
|
|
9
|
+
slots: {
|
|
10
|
+
root: "flex-row items-start gap-3 rounded-lg p-3 border",
|
|
11
|
+
title: "text-sm font-semibold",
|
|
12
|
+
message: "text-sm text-text-secondary",
|
|
13
|
+
},
|
|
14
|
+
variants: {
|
|
15
|
+
tone: {
|
|
16
|
+
info: { root: "bg-info-light border-info/30", title: "text-info" },
|
|
17
|
+
success: { root: "bg-success-light border-success/30", title: "text-success" },
|
|
18
|
+
warning: { root: "bg-warning-light border-warning/30", title: "text-warning" },
|
|
19
|
+
danger: { root: "bg-danger-light border-danger/30", title: "text-danger" },
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: { tone: "info" },
|
|
23
|
+
});
|
|
24
|
+
const iconByTone = {
|
|
25
|
+
info: { name: "information-circle", color: theme.info },
|
|
26
|
+
success: { name: "checkmark-circle", color: theme.success },
|
|
27
|
+
warning: { name: "warning", color: theme.warning },
|
|
28
|
+
danger: { name: "alert-circle", color: theme.danger },
|
|
29
|
+
};
|
|
30
|
+
function Banner({ message, title, tone = "info", onClose, action, className, testID, }) {
|
|
31
|
+
const styles = banner({ tone });
|
|
32
|
+
const icon = iconByTone[tone ?? "info"];
|
|
33
|
+
return (_jsxs(View, { className: styles.root({ className }), testID: testID, children: [_jsx(Icon, { color: icon.color, name: icon.name, size: 20 }), _jsxs(View, { className: "flex-1 gap-0.5", children: [title ? _jsx(Typography.Text, { className: styles.title(), children: title }) : null, _jsx(Typography.Text, { className: styles.message(), children: message }), action ? _jsx(View, { className: "mt-2", children: action }) : null] }), onClose ? (_jsx(Pressable, { accessibilityLabel: "Cerrar", hitSlop: 8, onPress: onClose, children: _jsx(Icon, { color: theme.icon.secondary, name: "close", size: 18 }) })) : null] }));
|
|
34
|
+
}
|
|
35
|
+
export default Banner;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type React from "react";
|
|
1
2
|
import { ReactNode } from "react";
|
|
2
3
|
interface DomainSplashScreenProps {
|
|
3
4
|
domainName: string;
|
|
@@ -6,5 +7,5 @@ interface DomainSplashScreenProps {
|
|
|
6
7
|
onComplete?: () => void;
|
|
7
8
|
minDuration?: number;
|
|
8
9
|
}
|
|
9
|
-
declare function DomainSplashScreen({ domainName, isLoading, children, onComplete, minDuration, }: DomainSplashScreenProps):
|
|
10
|
+
declare function DomainSplashScreen({ domainName, isLoading, children, onComplete, minDuration, }: DomainSplashScreenProps): React.JSX.Element;
|
|
10
11
|
export default DomainSplashScreen;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import GradientSurface from "../Display/Display.GradientSurface";
|
|
3
|
+
import Pattern from "../Display/Display.Pattern";
|
|
3
4
|
import { Typography } from "../Typography";
|
|
4
5
|
import { useCallback, useEffect, useState } from "react";
|
|
5
6
|
import { StyleSheet, View } from "react-native";
|
|
@@ -57,7 +58,7 @@ function DomainSplashScreen({ domainName, isLoading, children, onComplete, minDu
|
|
|
57
58
|
const splashStyle = useAnimatedStyle(() => ({
|
|
58
59
|
opacity: opacityValue.value,
|
|
59
60
|
}));
|
|
60
|
-
return (_jsxs(View, { style: styles.container, children: [children, _jsx(Animated.View, { pointerEvents: isLoading ? "auto" : "none", style: [StyleSheet.
|
|
61
|
+
return (_jsxs(View, { style: styles.container, children: [children, _jsx(Animated.View, { pointerEvents: isLoading ? "auto" : "none", style: [StyleSheet.absoluteFill, splashStyle], children: _jsxs(GradientSurface, { preset: "night-green", radius: "none", style: { position: "absolute", top: 0, left: 0, right: 0, bottom: 0 }, children: [_jsx(Pattern, { color: "#22E584", kind: "dots", opacity: 0.14, size: 26 }), _jsx(View, { className: "flex-1 justify-center items-center px-8", children: _jsxs(View, { className: "w-full items-center gap-5", children: [_jsx(Typography.Text, { bold: true, style: { color: "#FFFFFF", fontSize: 24, letterSpacing: 0.5 }, children: isComplete ? "¡Listo!" : `Cargando ${domainName}` }), !isComplete && (_jsx(View, { className: "w-full rounded-full h-1.5 overflow-hidden", style: { backgroundColor: "rgba(255,255,255,0.18)" }, children: _jsx(Animated.View, { className: "rounded-full h-1.5", style: [{ backgroundColor: "#22E584" }, progressBarStyle] }) })), isComplete && (_jsxs(Typography.Text, { style: { color: "rgba(255,255,255,0.8)", fontSize: 13 }, children: ["Ya puedes comenzar a usar ", domainName, "."] }))] }) })] }) })] }));
|
|
61
62
|
}
|
|
62
63
|
const styles = StyleSheet.create({
|
|
63
64
|
container: {
|
|
@@ -2,5 +2,5 @@ interface EmptyProps {
|
|
|
2
2
|
handleGoHome?: () => void;
|
|
3
3
|
className?: string;
|
|
4
4
|
}
|
|
5
|
-
declare function Empty({ handleGoHome, className }: EmptyProps): import("react
|
|
5
|
+
declare function Empty({ handleGoHome, className }: EmptyProps): import("react").JSX.Element;
|
|
6
6
|
export default Empty;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type ImageSourcePropType } from "react-native";
|
|
3
|
+
export interface EmptyStateProps {
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
image?: ImageSourcePropType;
|
|
8
|
+
actionLabel?: string;
|
|
9
|
+
onAction?: () => void;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
testID?: string;
|
|
13
|
+
}
|
|
14
|
+
declare function EmptyState({ title, description, icon, image, actionLabel, onAction, children, className, testID, }: EmptyStateProps): import("react").JSX.Element;
|
|
15
|
+
export default EmptyState;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
+
import Icon from "../Display/Display.Icon";
|
|
3
|
+
import { BaseButton } from "../primitives/BaseButton";
|
|
4
|
+
import { theme } from "../theme";
|
|
5
|
+
import { cn } from "../theme/tw";
|
|
6
|
+
import { Typography } from "../Typography";
|
|
7
|
+
import { Image, View } from "react-native";
|
|
8
|
+
function EmptyState({ title, description, icon = "file-tray-outline", image, actionLabel, onAction, children, className, testID, }) {
|
|
9
|
+
return (_jsxs(View, { className: cn("flex-1 items-center justify-center px-8 gap-3", className), testID: testID, children: [image ? (_jsx(Image, { resizeMode: "contain", source: image, style: { width: 140, height: 140 } })) : (_jsx(View, { className: "w-20 h-20 rounded-full bg-bg-muted items-center justify-center", children: _jsx(Icon, { color: theme.icon.tertiary, name: icon, size: 40 }) })), _jsx(Typography.Text, { align: "center", className: "text-text-primary", semibold: true, variant: "subtitle", children: title }), description ? (_jsx(Typography.Text, { align: "center", className: "text-text-secondary", variant: "body", children: description })) : null, actionLabel && onAction ? (_jsx(View, { className: "mt-2", children: _jsx(BaseButton, { onPress: onAction, title: actionLabel, variant: "primary" }) })) : null, children] }));
|
|
10
|
+
}
|
|
11
|
+
export default EmptyState;
|
|
@@ -5,5 +5,5 @@ interface ErrorProps {
|
|
|
5
5
|
onHome?: () => void;
|
|
6
6
|
className?: string;
|
|
7
7
|
}
|
|
8
|
-
declare function Error({ message, onRetry, onBack, onHome, className }: ErrorProps): import("react
|
|
8
|
+
declare function Error({ message, onRetry, onBack, onHome, className }: ErrorProps): import("react").JSX.Element;
|
|
9
9
|
export default Error;
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
+
import type React from "react";
|
|
1
2
|
interface LoadingStateProps {
|
|
2
3
|
message?: string;
|
|
3
4
|
size?: "small" | "large";
|
|
4
5
|
style?: object;
|
|
5
6
|
className?: string;
|
|
6
7
|
}
|
|
7
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Full-screen centered loading state. Thin layout convenience over `Spinner` (the atom):
|
|
10
|
+
* `Spinner` is the inline indicator (ActivityIndicator + optional text); `LoadingState`
|
|
11
|
+
* is `Spinner` centered with `flex-1` for an empty screen/section. Use `Spinner` directly
|
|
12
|
+
* when you need an inline/footer indicator (e.g. pagination), `LoadingState` for a blank view.
|
|
13
|
+
*/
|
|
14
|
+
declare function LoadingState({ message, size, style, className, }: LoadingStateProps): React.JSX.Element;
|
|
8
15
|
export default LoadingState;
|
|
@@ -2,7 +2,13 @@ import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
|
2
2
|
import Spinner from "../Feedback/Feedback.Spinner";
|
|
3
3
|
import { cn } from "../theme/tw";
|
|
4
4
|
import { View } from "react-native";
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Full-screen centered loading state. Thin layout convenience over `Spinner` (the atom):
|
|
7
|
+
* `Spinner` is the inline indicator (ActivityIndicator + optional text); `LoadingState`
|
|
8
|
+
* is `Spinner` centered with `flex-1` for an empty screen/section. Use `Spinner` directly
|
|
9
|
+
* when you need an inline/footer indicator (e.g. pagination), `LoadingState` for a blank view.
|
|
10
|
+
*/
|
|
11
|
+
function LoadingState({ message = "Cargando…", size = "small", style = {}, className, }) {
|
|
6
12
|
return (_jsx(View, { className: cn("flex-1 justify-center items-center", className), style: style, children: _jsx(Spinner, { className: "mb-5", size: size, text: message }) }));
|
|
7
13
|
}
|
|
8
14
|
export default LoadingState;
|