@sincpro/mobile-ui 1.1.0 → 2.0.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 +156 -29
- package/assets/brand-mesh.png +0 -0
- package/assets/fonts/FFL.txt +57 -0
- package/assets/fonts/Satoshi-Black.otf +0 -0
- package/assets/fonts/Satoshi-Bold.otf +0 -0
- package/assets/fonts/Satoshi-Medium.otf +0 -0
- package/assets/fonts/Satoshi-Regular.otf +0 -0
- package/dist/Actions/Actions.Button.d.ts +10 -12
- package/dist/Actions/Actions.Button.js +9 -11
- package/dist/Actions/Actions.Dock.d.ts +20 -0
- package/dist/Actions/Actions.Dock.js +89 -0
- package/dist/Actions/Actions.FAB.d.ts +1 -2
- package/dist/Actions/Actions.FAB.js +5 -7
- package/dist/Actions/Actions.IconButton.d.ts +1 -2
- package/dist/Actions/Actions.IconButton.js +2 -2
- package/dist/Actions/index.d.ts +4 -0
- package/dist/Actions/index.js +3 -0
- package/dist/Dialog/BottomSheet/BottomSheet.Root.js +22 -34
- package/dist/Dialog/Dialog.ActionSheet.js +2 -16
- package/dist/Dialog/Dialog.Confirmation.js +7 -5
- package/dist/Dialog/Dialog.EditValue.js +3 -1
- package/dist/Dialog/Dialog.Sheet.d.ts +3 -3
- package/dist/Dialog/Dialog.Sheet.js +18 -25
- package/dist/Display/Display.Accordion.js +7 -3
- package/dist/Display/Display.AmountSummary.d.ts +28 -0
- package/dist/Display/Display.AmountSummary.js +25 -0
- package/dist/Display/Display.Carousel.d.ts +27 -4
- package/dist/Display/Display.Carousel.js +112 -12
- package/dist/Display/Display.ExpoImage.d.ts +8 -0
- package/dist/Display/Display.ExpoImage.js +15 -0
- package/dist/Display/Display.Image.d.ts +10 -6
- package/dist/Display/Display.Image.js +39 -6
- package/dist/Display/Display.ListItem.d.ts +1 -2
- package/dist/Display/Display.ListItem.js +3 -3
- package/dist/Display/Display.Logo.d.ts +2 -2
- package/dist/Display/Display.Logo.js +3 -2
- package/dist/Display/Display.MediaCard.d.ts +2 -2
- package/dist/Display/Display.MediaEmbed.d.ts +2 -2
- package/dist/Display/Display.ProductCard.d.ts +2 -2
- package/dist/Display/Display.Story.d.ts +3 -3
- package/dist/Display/Display.Story.js +5 -4
- package/dist/Display/Display.StoryTray.d.ts +4 -4
- package/dist/Display/Display.StoryTray.js +3 -2
- package/dist/Display/Display.StoryViewer.d.ts +3 -3
- package/dist/Display/Display.StoryViewer.js +6 -3
- package/dist/Display/index.d.ts +9 -0
- package/dist/Display/index.js +4 -0
- package/dist/Feedback/Feedback.DomainSplashScreen.d.ts +13 -4
- package/dist/Feedback/Feedback.DomainSplashScreen.js +68 -53
- package/dist/Feedback/Feedback.EmptyState.d.ts +3 -4
- package/dist/Feedback/Feedback.EmptyState.js +4 -3
- package/dist/Feedback/Feedback.Error.d.ts +1 -2
- package/dist/Feedback/Feedback.Error.js +2 -2
- package/dist/Feedback/Feedback.Loading.d.ts +6 -2
- package/dist/Feedback/Feedback.Loading.js +2 -2
- package/dist/Feedback/Feedback.Progress.d.ts +6 -3
- package/dist/Feedback/Feedback.Progress.js +29 -19
- package/dist/Feedback/Feedback.ProgressCircle.d.ts +3 -2
- package/dist/Feedback/Feedback.ProgressCircle.js +10 -7
- package/dist/Feedback/Feedback.Skeleton.d.ts +4 -4
- package/dist/Feedback/Feedback.Skeleton.js +15 -3
- package/dist/Feedback/Feedback.Spinner.d.ts +3 -3
- package/dist/Feedback/Feedback.Spinner.js +40 -9
- package/dist/Feedback/Feedback.Splash.d.ts +2 -2
- package/dist/Feedback/Feedback.Splash.js +5 -3
- package/dist/Feedback/Toast.context.d.ts +64 -3
- package/dist/Feedback/Toast.context.js +112 -31
- package/dist/Feedback/index.d.ts +15 -1
- package/dist/Feedback/index.js +4 -1
- package/dist/Form/Form.Checkbox.d.ts +1 -2
- package/dist/Form/Form.Checkbox.js +2 -2
- package/dist/Form/Form.DatePicker.d.ts +1 -2
- package/dist/Form/Form.DatePicker.js +2 -2
- package/dist/Form/Form.Dropdown.d.ts +15 -3
- package/dist/Form/Form.Dropdown.js +21 -6
- package/dist/Form/Form.ErrorSummary.d.ts +23 -0
- package/dist/Form/Form.ErrorSummary.js +53 -0
- package/dist/Form/Form.Input.d.ts +1 -2
- package/dist/Form/Form.Input.js +2 -2
- package/dist/Form/Form.Select.d.ts +1 -2
- package/dist/Form/Form.Select.js +6 -19
- package/dist/Form/index.d.ts +3 -0
- package/dist/Form/index.js +2 -0
- package/dist/Navigation/Navigation.AppBar.d.ts +2 -6
- package/dist/Navigation/Navigation.AppBar.js +9 -7
- package/dist/Navigation/Navigation.BottomNav.d.ts +1 -3
- package/dist/Navigation/Navigation.BottomNav.js +7 -6
- package/dist/Navigation/Navigation.Header.d.ts +2 -2
- package/dist/Navigation/Navigation.Menu.js +10 -3
- package/dist/Navigation/Navigation.Search.d.ts +41 -0
- package/dist/Navigation/Navigation.Search.js +47 -0
- package/dist/Navigation/Navigation.SearchBar.d.ts +1 -2
- package/dist/Navigation/Navigation.SearchBar.js +16 -19
- package/dist/Navigation/Navigation.SegmentedControl.d.ts +11 -3
- package/dist/Navigation/Navigation.SegmentedControl.js +29 -16
- package/dist/Navigation/index.d.ts +11 -2
- package/dist/Navigation/index.js +2 -0
- package/dist/branding.d.ts +3 -2
- package/dist/primitives/BaseButton.d.ts +10 -12
- package/dist/primitives/BaseButton.js +9 -11
- package/dist/theme/typography.d.ts +1 -1
- package/dist/utils/image.d.ts +3 -0
- package/dist/utils/image.js +13 -0
- package/dist/utils/keys.d.ts +1 -0
- package/dist/utils/keys.js +7 -0
- package/dist/utils/progress.d.ts +1 -0
- package/dist/utils/progress.js +5 -0
- package/dist/utils/reorder.js +2 -5
- package/dist/utils/useReducedMotion.d.ts +1 -0
- package/dist/utils/useReducedMotion.js +43 -0
- package/dist/utils/useSheetTranslation.d.ts +5 -0
- package/dist/utils/useSheetTranslation.js +23 -0
- package/dist/views/AppSplashView.d.ts +3 -2
- package/dist/views/AppSplashView.js +3 -2
- package/dist/views/AuthFormView.d.ts +2 -2
- package/dist/views/FormViewV2.d.ts +2 -2
- package/dist/views/ListViewV2.context.d.ts +3 -1
- package/dist/views/ListViewV2.context.js +41 -21
- package/dist/views/ListViewV2.d.ts +15 -7
- package/dist/views/ListViewV2.js +44 -23
- package/dist/views/types/IListView.js +6 -5
- package/dist/widgets/CollectionOptions.js +9 -7
- package/dist/widgets/FilterBar.d.ts +1 -1
- package/dist/widgets/FilterBar.js +1 -1
- package/dist/widgets/FilterBuilder.js +7 -7
- package/dist/widgets/HomeHeader.d.ts +2 -2
- package/dist/widgets/PromoModal.js +3 -1
- package/dist/widgets/ScreenHeader.d.ts +2 -2
- package/package.json +5 -1
|
@@ -6,7 +6,6 @@ export interface FABProps {
|
|
|
6
6
|
className?: string;
|
|
7
7
|
testID?: string;
|
|
8
8
|
accessibilityLabel?: string;
|
|
9
|
-
accessibleSizing?: boolean;
|
|
10
9
|
}
|
|
11
|
-
declare function FAB({ icon, onPress, label, position, className, testID, accessibilityLabel,
|
|
10
|
+
declare function FAB({ icon, onPress, label, position, className, testID, accessibilityLabel, }: FABProps): import("react").JSX.Element;
|
|
12
11
|
export default FAB;
|
|
@@ -5,17 +5,15 @@ import { theme } from "../theme/index.js";
|
|
|
5
5
|
import { cn } from "../theme/tw.js";
|
|
6
6
|
import { Typography } from "../Typography/index.js";
|
|
7
7
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
8
|
-
function FAB({ icon, onPress, label, position = "bottom-right", className, testID, accessibilityLabel,
|
|
8
|
+
function FAB({ icon, onPress, label, position = "bottom-right", className, testID, accessibilityLabel, }) {
|
|
9
9
|
const insets = useSafeAreaInsets();
|
|
10
|
-
return (_jsxs(Pressable, { accessibilityLabel: accessibilityLabel ?? label ?? "Acción", accessibilityRole: "button", className: cn("absolute flex-row items-center justify-center rounded-full bg-primary", label
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
: "h-14 px-5 gap-2"
|
|
14
|
-
: "w-14 h-14", className), onPress: onPress, style: {
|
|
10
|
+
return (_jsxs(Pressable, { accessibilityLabel: accessibilityLabel ?? label ?? "Acción", accessibilityRole: "button", className: cn("absolute flex-row items-center justify-center rounded-full bg-primary", label ? "min-h-14 px-5 py-3 gap-2" : "w-14 h-14", className), onPress: onPress, style: {
|
|
11
|
+
minHeight: 56,
|
|
12
|
+
minWidth: 56,
|
|
15
13
|
bottom: insets.bottom + 16,
|
|
16
14
|
right: position === "bottom-right" ? 16 : undefined,
|
|
17
15
|
left: position === "bottom-left" ? 16 : undefined,
|
|
18
16
|
...theme.shadow.lg,
|
|
19
|
-
}, testID: testID, children: [_jsx(Icon, { color: theme.icon.inverse, name: icon, size: 24 }), label ? (_jsx(Typography.Text, { className: "text-text-on-primary font-semibold", style:
|
|
17
|
+
}, testID: testID, children: [_jsx(Icon, { color: theme.icon.inverse, name: icon, size: 24 }), label ? (_jsx(Typography.Text, { className: "text-text-on-primary font-semibold", style: { flexShrink: 1 }, children: label })) : null] }));
|
|
20
18
|
}
|
|
21
19
|
export default FAB;
|
|
@@ -64,7 +64,6 @@ export interface IconButtonProps extends VariantProps<typeof iconButton>, Access
|
|
|
64
64
|
iconColor?: string;
|
|
65
65
|
className?: string;
|
|
66
66
|
testID?: string;
|
|
67
|
-
accessibleSizing?: boolean;
|
|
68
67
|
}
|
|
69
|
-
declare function IconButton({ icon, type, onPress, variant, size, loading, disabled, rounded, iconColor, className, testID,
|
|
68
|
+
declare function IconButton({ icon, type, onPress, variant, size, loading, disabled, rounded, iconColor, className, testID, accessibilityState, ...accessibilityProps }: IconButtonProps): import("react").JSX.Element;
|
|
70
69
|
export default IconButton;
|
|
@@ -31,12 +31,12 @@ const iconButton = tv({
|
|
|
31
31
|
disabled: false,
|
|
32
32
|
},
|
|
33
33
|
});
|
|
34
|
-
function IconButton({ icon, type = "feather", onPress, variant = "ghost", size = "medium", loading = false, disabled = false, rounded = false, iconColor, className, testID,
|
|
34
|
+
function IconButton({ icon, type = "feather", onPress, variant = "ghost", size = "medium", loading = false, disabled = false, rounded = false, iconColor, className, testID, accessibilityState, ...accessibilityProps }) {
|
|
35
35
|
const resolvedColor = iconColor ?? theme.text.accent;
|
|
36
36
|
return (_jsx(TouchableOpacity, { activeOpacity: 0.7, className: iconButton({ variant, size, rounded, disabled, className }), disabled: disabled || loading, onPress: onPress, ...accessibilityProps, accessibilityRole: "button", accessibilityState: {
|
|
37
37
|
...accessibilityState,
|
|
38
38
|
disabled: disabled || loading,
|
|
39
39
|
busy: loading,
|
|
40
|
-
}, style:
|
|
40
|
+
}, style: { minHeight: 48, minWidth: 48 }, testID: testID, children: loading ? (_jsx(ActivityIndicator, { color: resolvedColor, size: "small" })) : (_jsx(Icon, { color: resolvedColor, name: icon, size: 24, type: type })) }));
|
|
41
41
|
}
|
|
42
42
|
export default IconButton;
|
package/dist/Actions/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import Dock from "./Actions.Dock.js";
|
|
1
2
|
import FAB from "./Actions.FAB.js";
|
|
2
3
|
import { FilterButtonGroup } from "./Actions.FilterButton.js";
|
|
3
4
|
import IconButton from "./Actions.IconButton.js";
|
|
@@ -6,6 +7,8 @@ export declare const Actions: {
|
|
|
6
7
|
Button: import("react").FC<import("./Actions.Button.js").ButtonProps> & {
|
|
7
8
|
Icon: import("react").FC<import("./Actions.Button.js").ButtonIconProps>;
|
|
8
9
|
};
|
|
10
|
+
/** Compact primary-action dock with additional options in a dismissible sheet. */
|
|
11
|
+
Dock: typeof Dock;
|
|
9
12
|
/** Small icon-only tap target — ghost, primary, secondary, tertiary variants. */
|
|
10
13
|
IconButton: typeof IconButton;
|
|
11
14
|
/** Floating Action Button — fixed bottom-right/left, label-optional. */
|
|
@@ -16,6 +19,7 @@ export declare const Actions: {
|
|
|
16
19
|
FilterButtonGroup: typeof FilterButtonGroup;
|
|
17
20
|
};
|
|
18
21
|
export type { ButtonIconProps, ButtonProps } from "./Actions.Button.js";
|
|
22
|
+
export type { DockProps } from "./Actions.Dock.js";
|
|
19
23
|
export type { FABProps } from "./Actions.FAB.js";
|
|
20
24
|
export type { FilterButtonGroupProps, FilterButtonProps, } from "./Actions.FilterButton.js";
|
|
21
25
|
export type { IconButtonProps } from "./Actions.IconButton.js";
|
package/dist/Actions/index.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import ButtonWithIcon from "./Actions.Button.js";
|
|
2
|
+
import Dock from "./Actions.Dock.js";
|
|
2
3
|
import FAB from "./Actions.FAB.js";
|
|
3
4
|
import { FilterButton, FilterButtonGroup, } from "./Actions.FilterButton.js";
|
|
4
5
|
import IconButton from "./Actions.IconButton.js";
|
|
5
6
|
export const Actions = {
|
|
6
7
|
/** Primary action button. The filled one is gold; navy is text. Supports confirm dialog. */
|
|
7
8
|
Button: ButtonWithIcon,
|
|
9
|
+
/** Compact primary-action dock with additional options in a dismissible sheet. */
|
|
10
|
+
Dock,
|
|
8
11
|
/** Small icon-only tap target — ghost, primary, secondary, tertiary variants. */
|
|
9
12
|
IconButton,
|
|
10
13
|
/** Floating Action Button — fixed bottom-right/left, label-optional. */
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
2
|
/* eslint-disable react-hooks/refs */
|
|
3
3
|
import { theme } from "../../theme/index.js";
|
|
4
|
-
import {
|
|
4
|
+
import { useSheetTranslation } from "../../utils/useSheetTranslation.js";
|
|
5
|
+
import { createContext, useContext, useRef } from "react";
|
|
5
6
|
import { Animated, Dimensions, Modal, PanResponder, Pressable, ScrollView, Text, View, } from "react-native";
|
|
6
7
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
7
8
|
const BottomSheetContext = createContext(null);
|
|
@@ -98,27 +99,17 @@ const SIZE_MAP = {
|
|
|
98
99
|
function Root({ visible, onClose, size = "auto", dismissible = true, children }) {
|
|
99
100
|
const insets = useSafeAreaInsets();
|
|
100
101
|
const screenHeight = Dimensions.get("window").height;
|
|
101
|
-
const translateY =
|
|
102
|
+
const { translateY, reducedMotion } = useSheetTranslation(visible, screenHeight);
|
|
103
|
+
const gesture = useRef({ dismissible, onClose, reducedMotion });
|
|
104
|
+
gesture.current = { dismissible, onClose, reducedMotion };
|
|
102
105
|
const maxHeight = size === "auto" ? screenHeight * 0.9 : screenHeight * SIZE_MAP[size];
|
|
103
106
|
const minHeight = size === "auto" ? 0 : screenHeight * SIZE_MAP[size];
|
|
104
|
-
useEffect(() => {
|
|
105
|
-
if (visible) {
|
|
106
|
-
Animated.spring(translateY, {
|
|
107
|
-
toValue: 0,
|
|
108
|
-
useNativeDriver: true,
|
|
109
|
-
damping: 20,
|
|
110
|
-
stiffness: 300,
|
|
111
|
-
}).start();
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
translateY.setValue(screenHeight);
|
|
115
|
-
}
|
|
116
|
-
}, [visible, screenHeight, translateY]);
|
|
117
107
|
const panResponder = useRef(PanResponder.create({
|
|
118
|
-
onStartShouldSetPanResponder: () => dismissible,
|
|
108
|
+
onStartShouldSetPanResponder: () => gesture.current.dismissible,
|
|
119
109
|
onMoveShouldSetPanResponder: (_, gestureState) => {
|
|
120
|
-
return dismissible && Math.abs(gestureState.dy) > 10;
|
|
110
|
+
return gesture.current.dismissible && Math.abs(gestureState.dy) > 10;
|
|
121
111
|
},
|
|
112
|
+
onPanResponderGrant: () => translateY.stopAnimation(),
|
|
122
113
|
onPanResponderMove: (_, gestureState) => {
|
|
123
114
|
if (gestureState.dy > 0) {
|
|
124
115
|
translateY.setValue(gestureState.dy);
|
|
@@ -126,36 +117,33 @@ function Root({ visible, onClose, size = "auto", dismissible = true, children })
|
|
|
126
117
|
},
|
|
127
118
|
onPanResponderRelease: (_, gestureState) => {
|
|
128
119
|
if (gestureState.dy > 100 || gestureState.vy > 0.5) {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
duration: 200,
|
|
132
|
-
useNativeDriver: true,
|
|
133
|
-
}).start(() => onClose());
|
|
120
|
+
translateY.stopAnimation();
|
|
121
|
+
gesture.current.onClose();
|
|
134
122
|
}
|
|
135
123
|
else {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
124
|
+
if (gesture.current.reducedMotion)
|
|
125
|
+
translateY.setValue(0);
|
|
126
|
+
else
|
|
127
|
+
Animated.spring(translateY, {
|
|
128
|
+
toValue: 0,
|
|
129
|
+
useNativeDriver: true,
|
|
130
|
+
damping: 20,
|
|
131
|
+
stiffness: 300,
|
|
132
|
+
}).start();
|
|
142
133
|
}
|
|
143
134
|
},
|
|
144
135
|
})).current;
|
|
145
136
|
function handleBackdropPress() {
|
|
146
137
|
if (dismissible) {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
duration: 200,
|
|
150
|
-
useNativeDriver: true,
|
|
151
|
-
}).start(() => onClose());
|
|
138
|
+
translateY.stopAnimation();
|
|
139
|
+
onClose();
|
|
152
140
|
}
|
|
153
141
|
}
|
|
154
142
|
const contextValue = {
|
|
155
143
|
close: onClose,
|
|
156
144
|
panHandlers: panResponder.panHandlers,
|
|
157
145
|
};
|
|
158
|
-
return (_jsx(Modal, { animationType: "fade", onRequestClose: onClose, presentationStyle: "overFullScreen", transparent: true, visible: visible, children: _jsxs(View, { className: "flex-1 bg-black/50", children: [_jsx(Pressable, { className: "flex-1", onPress: handleBackdropPress }), _jsx(Animated.View, { className: "rounded-t-3xl overflow-hidden", style: {
|
|
146
|
+
return (_jsx(Modal, { animationType: reducedMotion ? "none" : "fade", onRequestClose: onClose, presentationStyle: "overFullScreen", transparent: true, visible: visible, children: _jsxs(View, { className: "flex-1 bg-black/50", children: [_jsx(Pressable, { className: "flex-1", onPress: handleBackdropPress }), _jsx(Animated.View, { className: "rounded-t-3xl overflow-hidden", style: {
|
|
159
147
|
backgroundColor: theme.bg.popover,
|
|
160
148
|
maxHeight,
|
|
161
149
|
minHeight: minHeight || undefined,
|
|
@@ -4,28 +4,14 @@ import Pressable from "../primitives/Pressable.js";
|
|
|
4
4
|
import { themeToVars, useTheme } from "../theme/index.js";
|
|
5
5
|
import { cn } from "../theme/tw.js";
|
|
6
6
|
import { Typography } from "../Typography/index.js";
|
|
7
|
+
import { useSheetTranslation } from "../utils/useSheetTranslation.js";
|
|
7
8
|
import { vars } from "nativewind";
|
|
8
|
-
import { useEffect, useRef } from "react";
|
|
9
9
|
import { Animated, Modal, ScrollView, View } from "react-native";
|
|
10
10
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
11
11
|
function ActionSheet({ visible, onClose, actions, title, message, cancelLabel = "Cancelar", testID, }) {
|
|
12
12
|
const theme = useTheme();
|
|
13
13
|
const insets = useSafeAreaInsets();
|
|
14
|
-
|
|
15
|
-
const translateY = useRef(new Animated.Value(800)).current;
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
if (visible) {
|
|
18
|
-
Animated.spring(translateY, {
|
|
19
|
-
toValue: 0,
|
|
20
|
-
useNativeDriver: true,
|
|
21
|
-
damping: 20,
|
|
22
|
-
stiffness: 300,
|
|
23
|
-
}).start();
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
translateY.setValue(800);
|
|
27
|
-
}
|
|
28
|
-
}, [visible, translateY]);
|
|
14
|
+
const { translateY } = useSheetTranslation(visible);
|
|
29
15
|
return (_jsx(Modal, { animationType: "none", onRequestClose: onClose, presentationStyle: "overFullScreen", transparent: true, visible: visible, children: _jsxs(View, { className: "flex-1 justify-end", testID: testID, children: [_jsx(View, { accessibilityElementsHidden: true, className: "absolute inset-0 bg-black/50", importantForAccessibility: "no-hide-descendants", onResponderRelease: onClose, onStartShouldSetResponder: () => true }), _jsxs(Animated.View, { accessibilityViewIsModal: true, onAccessibilityEscape: onClose, style: [
|
|
30
16
|
vars(themeToVars(theme)),
|
|
31
17
|
{
|
|
@@ -2,12 +2,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
|
2
2
|
import { BaseButton } from "../primitives/BaseButton.js";
|
|
3
3
|
import { theme } from "../theme/index.js";
|
|
4
4
|
import Typography from "../Typography/Typography.Text.js";
|
|
5
|
+
import { useReducedMotion } from "../utils/useReducedMotion.js";
|
|
5
6
|
import { Modal, TouchableWithoutFeedback, View } from "react-native";
|
|
6
7
|
const ConfirmationDialog = ({ visible, onCancel, onConfirm, auxTitle = "Descartar cambios", subtitle = "¿Quieres descartar los cambios realizados?", confirmButtonText = "Descartar cambios", cancelButtonText = "Seguir editando", }) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const reducedMotion = useReducedMotion();
|
|
9
|
+
return (_jsx(Modal, { animationType: reducedMotion ? "none" : "fade", onRequestClose: onCancel, presentationStyle: "overFullScreen", transparent: true, visible: visible, children: _jsxs(View, { className: "flex-1 justify-center items-center p-6 bg-black/50", children: [_jsx(TouchableWithoutFeedback, { accessible: false, onPress: onCancel, children: _jsx(View, { className: "absolute inset-0" }) }), _jsxs(View, { accessibilityViewIsModal: true, className: "p-3 w-full max-w-xs mx-auto", onAccessibilityEscape: onCancel, style: {
|
|
10
|
+
borderRadius: 16,
|
|
11
|
+
backgroundColor: theme.bg.popover,
|
|
12
|
+
...theme.shadow.md,
|
|
13
|
+
}, children: [_jsx(Typography, { accessibilityRole: "header", className: "mb-1.5 text-sm", variant: "body", children: _jsx(Typography, { semibold: true, variant: "body", children: auxTitle }) }), _jsx(Typography, { className: "mb-3 text-xs leading-tight", variant: "body", children: subtitle }), _jsxs(View, { className: "flex-row gap-2", children: [_jsx(BaseButton, { className: "flex-1", onPress: onCancel, size: "small", title: cancelButtonText, variant: "outlineBlack" }), _jsx(BaseButton, { className: "flex-1", onPress: onConfirm, size: "small", title: confirmButtonText, variant: "primary" })] })] })] }) }));
|
|
12
14
|
};
|
|
13
15
|
export default ConfirmationDialog;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
2
|
import { theme } from "../theme/index.js";
|
|
3
3
|
import { Typography } from "../Typography/index.js";
|
|
4
|
+
import { useReducedMotion } from "../utils/useReducedMotion.js";
|
|
4
5
|
import { useEffect, useRef } from "react";
|
|
5
6
|
import { FlatList, Modal, TextInput, TouchableOpacity, View, } from "react-native";
|
|
6
7
|
function EditableValueModal({ visible, title, value, onChangeValue, onConfirm, onCancel, placeholder, helperText, chips, keyboardType = "decimal-pad", rightAdornment, confirmLabel = "Aplicar", cancelLabel = "Cancelar", autoFocus = true, testID, }) {
|
|
7
8
|
const inputRef = useRef(null);
|
|
9
|
+
const reducedMotion = useReducedMotion();
|
|
8
10
|
useEffect(() => {
|
|
9
11
|
if (visible && autoFocus) {
|
|
10
12
|
const t = setTimeout(() => inputRef.current?.focus(), 60);
|
|
11
13
|
return () => clearTimeout(t);
|
|
12
14
|
}
|
|
13
15
|
}, [visible, autoFocus]);
|
|
14
|
-
return (_jsx(Modal, { animationType: "fade", onRequestClose: onCancel, presentationStyle: "overFullScreen", transparent: true, visible: visible, children: _jsx(View, { className: "flex-1 justify-center p-6 bg-black/40", children: _jsxs(View, { className: "p-4", style: { borderRadius: 16, backgroundColor: theme.bg.popover, ...theme.shadow.md }, testID: testID, children: [_jsx(Typography.Text, { className: "mb-3", semibold: true, variant: "h6", children: title }), _jsxs(View, { className: "flex-row items-center", children: [_jsx(TextInput, { className: "flex-1 border border-input rounded-lg p-2.5 text-lg text-text-primary", keyboardType: keyboardType, onChangeText: onChangeValue, onSubmitEditing: onConfirm, placeholder: placeholder, placeholderTextColor: theme.text.tertiary, ref: inputRef, returnKeyType: "done", selectionColor: theme.primary, underlineColorAndroid: "transparent", value: value }), rightAdornment && _jsx(View, { className: "ml-2", children: rightAdornment })] }), helperText ? (_jsx(View, { className: "mt-2", children: typeof helperText === "string" ? (_jsx(Typography.Text, { className: "opacity-70", variant: "bodySmall", children: helperText })) : (helperText) })) : null, chips && chips.length > 0 && (_jsx(FlatList, { contentContainerClassName: "gap-2 py-3", data: chips, horizontal: true, keyExtractor: (c, i) => c.key || `${c.label}-${i}`, renderItem: ({ item }) => (_jsx(TouchableOpacity, { className: "px-3 py-1.5 bg-accent/10 rounded-2xl border border-accent/30", onPress: item.onPress, children: _jsx(Typography.Text, { semibold: true, variant: "bodySmall", children: item.label }) })) })), _jsxs(View, { className: "flex-row justify-end gap-3", children: [_jsx(TouchableOpacity, { className: "px-4 py-2.5 rounded-lg bg-bg-hover", onPress: onCancel, children: _jsx(Typography.Text, { semibold: true, variant: "body", children: cancelLabel }) }), _jsx(TouchableOpacity, { className: "px-4 py-2.5 rounded-lg bg-accent", onPress: onConfirm, children: _jsx(Typography.Text, { className: "text-text-inverse", semibold: true, variant: "body", children: confirmLabel }) })] })] }) }) }));
|
|
16
|
+
return (_jsx(Modal, { animationType: reducedMotion ? "none" : "fade", onRequestClose: onCancel, presentationStyle: "overFullScreen", transparent: true, visible: visible, children: _jsx(View, { className: "flex-1 justify-center p-6 bg-black/40", children: _jsxs(View, { accessibilityViewIsModal: true, className: "p-4", onAccessibilityEscape: onCancel, style: { borderRadius: 16, backgroundColor: theme.bg.popover, ...theme.shadow.md }, testID: testID, children: [_jsx(Typography.Text, { className: "mb-3", semibold: true, variant: "h6", children: title }), _jsxs(View, { className: "flex-row items-center", children: [_jsx(TextInput, { accessibilityLabel: title, className: "flex-1 border border-input rounded-lg p-2.5 text-lg text-text-primary", keyboardType: keyboardType, onChangeText: onChangeValue, onSubmitEditing: onConfirm, placeholder: placeholder, placeholderTextColor: theme.text.tertiary, ref: inputRef, returnKeyType: "done", selectionColor: theme.primary, underlineColorAndroid: "transparent", value: value }), rightAdornment && _jsx(View, { className: "ml-2", children: rightAdornment })] }), helperText ? (_jsx(View, { className: "mt-2", children: typeof helperText === "string" ? (_jsx(Typography.Text, { className: "opacity-70", variant: "bodySmall", children: helperText })) : (helperText) })) : null, chips && chips.length > 0 && (_jsx(FlatList, { contentContainerClassName: "gap-2 py-3", data: chips, horizontal: true, keyExtractor: (c, i) => c.key || `${c.label}-${i}`, renderItem: ({ item }) => (_jsx(TouchableOpacity, { className: "px-3 py-1.5 bg-accent/10 rounded-2xl border border-accent/30", onPress: item.onPress, children: _jsx(Typography.Text, { semibold: true, variant: "bodySmall", children: item.label }) })) })), _jsxs(View, { className: "flex-row justify-end gap-3", children: [_jsx(TouchableOpacity, { className: "px-4 py-2.5 rounded-lg bg-bg-hover", onPress: onCancel, children: _jsx(Typography.Text, { semibold: true, variant: "body", children: cancelLabel }) }), _jsx(TouchableOpacity, { className: "px-4 py-2.5 rounded-lg bg-accent", onPress: onConfirm, children: _jsx(Typography.Text, { className: "text-text-inverse", semibold: true, variant: "body", children: confirmLabel }) })] })] }) }) }));
|
|
15
17
|
}
|
|
16
18
|
export default EditableValueModal;
|
|
@@ -10,6 +10,8 @@ export interface SheetProps {
|
|
|
10
10
|
visible: boolean;
|
|
11
11
|
onClose: () => void;
|
|
12
12
|
children: ReactNode;
|
|
13
|
+
footer?: ReactNode;
|
|
14
|
+
footerClassName?: string;
|
|
13
15
|
title?: string;
|
|
14
16
|
/** Max sheet height (fraction of the screen). Default 0.9. */
|
|
15
17
|
maxHeightRatio?: number;
|
|
@@ -17,8 +19,6 @@ export interface SheetProps {
|
|
|
17
19
|
dismissOnBackdrop?: boolean;
|
|
18
20
|
/** Show a visible close button in the sheet header. */
|
|
19
21
|
showCloseButton?: boolean;
|
|
20
|
-
/** Increase interactive targets to 48 points. */
|
|
21
|
-
accessibleSizing?: boolean;
|
|
22
22
|
testID?: string;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
@@ -26,5 +26,5 @@ export interface SheetProps {
|
|
|
26
26
|
* **swipe-down to close** (handle only). By default it does NOT close on backdrop tap
|
|
27
27
|
* (`dismissOnBackdrop`). No provider or native deps. Import via subpath `Dialog/Sheet`.
|
|
28
28
|
*/
|
|
29
|
-
declare function Sheet({ visible, onClose, children, title, maxHeightRatio, dismissOnBackdrop, showCloseButton,
|
|
29
|
+
declare function Sheet({ visible, onClose, children, footer, footerClassName, title, maxHeightRatio, dismissOnBackdrop, showCloseButton, testID, }: SheetProps): import("react").JSX.Element;
|
|
30
30
|
export default Sheet;
|
|
@@ -6,8 +6,9 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "nativewind/js
|
|
|
6
6
|
import Pressable from "../primitives/Pressable.js";
|
|
7
7
|
import { themeToVars, useTheme } from "../theme/index.js";
|
|
8
8
|
import { Typography } from "../Typography/index.js";
|
|
9
|
+
import { useSheetTranslation } from "../utils/useSheetTranslation.js";
|
|
9
10
|
import { vars } from "nativewind";
|
|
10
|
-
import {
|
|
11
|
+
import { useRef, useState } from "react";
|
|
11
12
|
import { Animated, Modal, PanResponder, ScrollView, View } from "react-native";
|
|
12
13
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
13
14
|
/**
|
|
@@ -22,42 +23,30 @@ export function SheetProvider({ children }) {
|
|
|
22
23
|
* **swipe-down to close** (handle only). By default it does NOT close on backdrop tap
|
|
23
24
|
* (`dismissOnBackdrop`). No provider or native deps. Import via subpath `Dialog/Sheet`.
|
|
24
25
|
*/
|
|
25
|
-
function Sheet({ visible, onClose, children, title, maxHeightRatio = 0.9, dismissOnBackdrop = false, showCloseButton = false,
|
|
26
|
+
function Sheet({ visible, onClose, children, footer, footerClassName, title, maxHeightRatio = 0.9, dismissOnBackdrop = false, showCloseButton = false, testID, }) {
|
|
26
27
|
const theme = useTheme();
|
|
27
28
|
const insets = useSafeAreaInsets();
|
|
28
|
-
const translateY =
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
useEffect(() => {
|
|
32
|
-
if (visible) {
|
|
33
|
-
Animated.spring(translateY, {
|
|
34
|
-
toValue: 0,
|
|
35
|
-
useNativeDriver: true,
|
|
36
|
-
damping: 20,
|
|
37
|
-
stiffness: 300,
|
|
38
|
-
}).start();
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
translateY.setValue(800);
|
|
42
|
-
}
|
|
43
|
-
}, [visible, translateY]);
|
|
29
|
+
const { translateY, reducedMotion } = useSheetTranslation(visible);
|
|
30
|
+
const gesture = useRef({ onClose, reducedMotion });
|
|
31
|
+
gesture.current = { onClose, reducedMotion };
|
|
44
32
|
const [pan] = useState(() => PanResponder.create({
|
|
45
33
|
onStartShouldSetPanResponder: () => true,
|
|
46
34
|
onMoveShouldSetPanResponder: (_, g) => g.dy > 2,
|
|
35
|
+
onPanResponderGrant: () => translateY.stopAnimation(),
|
|
47
36
|
onPanResponderMove: (_, g) => {
|
|
48
37
|
if (g.dy > 0)
|
|
49
38
|
translateY.setValue(g.dy);
|
|
50
39
|
},
|
|
51
40
|
onPanResponderRelease: (_, g) => {
|
|
52
41
|
if (g.dy > 100 || g.vy > 0.5) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
duration: 200,
|
|
56
|
-
useNativeDriver: true,
|
|
57
|
-
}).start(() => onCloseRef.current());
|
|
42
|
+
translateY.stopAnimation();
|
|
43
|
+
gesture.current.onClose();
|
|
58
44
|
}
|
|
59
45
|
else {
|
|
60
|
-
|
|
46
|
+
if (gesture.current.reducedMotion)
|
|
47
|
+
translateY.setValue(0);
|
|
48
|
+
else
|
|
49
|
+
Animated.spring(translateY, { toValue: 0, useNativeDriver: true }).start();
|
|
61
50
|
}
|
|
62
51
|
},
|
|
63
52
|
}));
|
|
@@ -69,6 +58,10 @@ function Sheet({ visible, onClose, children, title, maxHeightRatio = 0.9, dismis
|
|
|
69
58
|
maxHeight: `${Math.round(maxHeightRatio * 100)}%`,
|
|
70
59
|
transform: [{ translateY }],
|
|
71
60
|
},
|
|
72
|
-
], children: [_jsx(View, { accessibilityElementsHidden: true, className: "items-center pt-3 pb-2", ...pan.panHandlers, children: _jsx(View, { className: "w-12 h-1.5 rounded-full bg-border-strong" }) }), title || showCloseButton ? (_jsxs(View, { className: "flex-row items-center px-4 pb-1", children: [title ? (_jsx(Typography.Text, { accessibilityRole: "header", className: "flex-1 text-text-primary", semibold: true, variant: "subtitle", children: title })) : null, showCloseButton ? (_jsx(Pressable, { accessibilityLabel: "Cerrar", accessibilityRole: "button", className: "items-center justify-center rounded-lg", hitSlop: 8, onPress: onClose, style:
|
|
61
|
+
], children: [_jsx(View, { accessibilityElementsHidden: true, className: "items-center pt-3 pb-2", ...pan.panHandlers, children: _jsx(View, { className: "w-12 h-1.5 rounded-full bg-border-strong" }) }), title || showCloseButton ? (_jsxs(View, { className: "flex-row items-center px-4 pb-1", children: [title ? (_jsx(Typography.Text, { accessibilityRole: "header", className: "flex-1 text-text-primary", semibold: true, variant: "subtitle", children: title })) : null, showCloseButton ? (_jsx(Pressable, { accessibilityLabel: "Cerrar", accessibilityRole: "button", className: "items-center justify-center rounded-lg", hitSlop: 8, onPress: onClose, style: { minWidth: 48, minHeight: 48 }, children: _jsx(Typography.Text, { className: "text-text-accent", variant: "bodySmall", children: "Cerrar" }) })) : null] })) : null, _jsx(ScrollView, { contentContainerStyle: {
|
|
62
|
+
paddingHorizontal: 16,
|
|
63
|
+
paddingTop: 4,
|
|
64
|
+
paddingBottom: footer ? 12 : 0,
|
|
65
|
+
}, style: { flexShrink: 1 }, children: children }), footer ? (_jsx(View, { className: `border-t border-border-light px-4 pt-3 ${footerClassName ?? ""}`, children: footer })) : null] })] }) }));
|
|
73
66
|
}
|
|
74
67
|
export default Sheet;
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
2
|
import Icon from "./Display.Icon.js";
|
|
3
3
|
import Pressable from "../primitives/Pressable.js";
|
|
4
|
-
import {
|
|
4
|
+
import { useTheme } from "../theme/index.js";
|
|
5
5
|
import { cn } from "../theme/tw.js";
|
|
6
6
|
import { Typography } from "../Typography/index.js";
|
|
7
|
+
import { useReducedMotion } from "../utils/useReducedMotion.js";
|
|
7
8
|
import { useState } from "react";
|
|
8
9
|
import { LayoutAnimation, View } from "react-native";
|
|
9
10
|
function AccordionItem({ title, children, defaultOpen = false, className, testID, }) {
|
|
10
11
|
const [open, setOpen] = useState(defaultOpen);
|
|
12
|
+
const theme = useTheme();
|
|
13
|
+
const reducedMotion = useReducedMotion();
|
|
11
14
|
const toggle = () => {
|
|
12
|
-
|
|
15
|
+
if (!reducedMotion)
|
|
16
|
+
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
|
|
13
17
|
setOpen((prev) => !prev);
|
|
14
18
|
};
|
|
15
|
-
return (_jsxs(View, { className: cn("border-b border-border-default", className), testID: testID, children: [_jsxs(Pressable, { accessibilityRole: "button", accessibilityState: { expanded: open }, className: "flex-row items-center justify-between py-3", onPress: toggle, children: [_jsx(Typography.Text, { className: "flex-1 text-text-primary", semibold: true, children: title }), _jsx(View, { style: { transform: [{ rotate: open ? "180deg" : "0deg" }] }, children: _jsx(Icon, { color: theme.icon.secondary, name: "chevron-down", size: 18 }) })] }), open ? _jsx(View, { className: "pb-3", children: children }) : null] }));
|
|
19
|
+
return (_jsxs(View, { className: cn("border-b border-border-default", className), testID: testID, children: [_jsxs(Pressable, { accessibilityLabel: title, accessibilityRole: "button", accessibilityState: { expanded: open }, className: "flex-row items-center justify-between py-3", onPress: toggle, style: { minHeight: 48 }, children: [_jsx(Typography.Text, { className: "flex-1 text-text-primary", semibold: true, children: title }), _jsx(View, { style: { transform: [{ rotate: open ? "180deg" : "0deg" }] }, children: _jsx(Icon, { color: theme.icon.secondary, name: "chevron-down", size: 18 }) })] }), open ? _jsx(View, { className: "pb-3", children: children }) : null] }));
|
|
16
20
|
}
|
|
17
21
|
function AccordionRoot({ children, className }) {
|
|
18
22
|
return _jsx(View, { className: cn("bg-bg-card rounded-lg", className), children: children });
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface AmountSummaryRootProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
currencySymbol: string;
|
|
5
|
+
variant?: "card" | "plain";
|
|
6
|
+
className?: string;
|
|
7
|
+
testID?: string;
|
|
8
|
+
}
|
|
9
|
+
declare function Root({ children, currencySymbol, variant, className, testID, }: AmountSummaryRootProps): import("react").JSX.Element;
|
|
10
|
+
export interface AmountSummaryRowProps {
|
|
11
|
+
label: string;
|
|
12
|
+
value: number | string | null | undefined;
|
|
13
|
+
currencySymbol?: string;
|
|
14
|
+
prefix?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
labelClassName?: string;
|
|
17
|
+
valueClassName?: string;
|
|
18
|
+
testID?: string;
|
|
19
|
+
}
|
|
20
|
+
declare function Row({ label, value, currencySymbol, prefix, className, labelClassName, valueClassName, testID, }: AmountSummaryRowProps): import("react").JSX.Element;
|
|
21
|
+
export type AmountSummaryTotalProps = AmountSummaryRowProps;
|
|
22
|
+
declare function Total(props: AmountSummaryTotalProps): import("react").JSX.Element;
|
|
23
|
+
declare const AmountSummary: {
|
|
24
|
+
Root: typeof Root;
|
|
25
|
+
Row: typeof Row;
|
|
26
|
+
Total: typeof Total;
|
|
27
|
+
};
|
|
28
|
+
export default AmountSummary;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "nativewind/jsx-runtime";
|
|
2
|
+
import { cn } from "../theme/tw.js";
|
|
3
|
+
import { Typography } from "../Typography/index.js";
|
|
4
|
+
import { createContext, useContext } from "react";
|
|
5
|
+
import { View } from "react-native";
|
|
6
|
+
import Monetary from "./Display.Monetary";
|
|
7
|
+
const AmountSummaryContext = createContext(undefined);
|
|
8
|
+
function Root({ children, currencySymbol, variant = "card", className, testID, }) {
|
|
9
|
+
return (_jsx(AmountSummaryContext.Provider, { value: { currencySymbol }, children: _jsx(View, { className: cn("gap-1", variant === "card"
|
|
10
|
+
? "rounded-xl border border-border-light bg-bg-card px-4 py-2"
|
|
11
|
+
: "", className), testID: testID, children: children }) }));
|
|
12
|
+
}
|
|
13
|
+
function Row({ label, value, currencySymbol, prefix, className, labelClassName, valueClassName, testID, }) {
|
|
14
|
+
const context = useContext(AmountSummaryContext);
|
|
15
|
+
const resolvedCurrencySymbol = currencySymbol ?? context?.currencySymbol;
|
|
16
|
+
if (resolvedCurrencySymbol === undefined) {
|
|
17
|
+
throw new Error("AmountSummary.Row requires a currencySymbol or an AmountSummary.Root.");
|
|
18
|
+
}
|
|
19
|
+
return (_jsxs(View, { className: cn("flex-row items-center justify-between gap-3 py-1", className), testID: testID, children: [_jsx(Typography.Text, { className: cn("flex-1 text-text-secondary", labelClassName), children: label }), _jsx(Monetary, { className: cn("text-text-primary", valueClassName), currencySymbol: resolvedCurrencySymbol, prefix: prefix, semibold: true, textVariant: "body", value: value })] }));
|
|
20
|
+
}
|
|
21
|
+
function Total(props) {
|
|
22
|
+
return (_jsxs(_Fragment, { children: [_jsx(View, { className: "my-1 border-t border-border-light" }), _jsx(Row, { ...props, className: cn("py-2", props.className), labelClassName: cn("text-text-primary font-semibold", props.labelClassName), valueClassName: cn("text-text-primary", props.valueClassName) })] }));
|
|
23
|
+
}
|
|
24
|
+
const AmountSummary = { Root, Row, Total };
|
|
25
|
+
export default AmountSummary;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { Typography } from "../Typography/index.js";
|
|
2
|
+
import { type ComponentProps, type ReactNode } from "react";
|
|
3
|
+
import { type StyleProp, type ViewProps, type ViewStyle } from "react-native";
|
|
4
|
+
export interface CarouselControlsProps {
|
|
5
|
+
index: number;
|
|
6
|
+
count: number;
|
|
7
|
+
canPrevious: boolean;
|
|
8
|
+
canNext: boolean;
|
|
9
|
+
previous: () => void;
|
|
10
|
+
next: () => void;
|
|
11
|
+
goTo: (index: number) => void;
|
|
12
|
+
}
|
|
13
|
+
export interface CarouselProps<T> extends Omit<ViewProps, "children"> {
|
|
14
|
+
data: readonly T[];
|
|
4
15
|
renderItem: (item: T, index: number) => ReactNode;
|
|
5
16
|
keyExtractor: (item: T, index: number) => string;
|
|
6
17
|
itemWidth: number;
|
|
@@ -8,6 +19,18 @@ export interface CarouselProps<T> {
|
|
|
8
19
|
showDots?: boolean;
|
|
9
20
|
className?: string;
|
|
10
21
|
testID?: string;
|
|
22
|
+
index?: number;
|
|
23
|
+
onIndexChange?: (index: number) => void;
|
|
24
|
+
previousAccessibilityLabel?: string;
|
|
25
|
+
nextAccessibilityLabel?: string;
|
|
26
|
+
formatPageLabel?: (index: number, count: number) => string;
|
|
27
|
+
renderControls?: (props: CarouselControlsProps) => ReactNode;
|
|
28
|
+
controlsClassName?: string;
|
|
29
|
+
paginationTextProps?: ComponentProps<typeof Typography.Text>;
|
|
30
|
+
contentContainerStyle?: StyleProp<ViewStyle>;
|
|
31
|
+
itemStyle?: StyleProp<ViewStyle>;
|
|
32
|
+
dotStyle?: StyleProp<ViewStyle>;
|
|
33
|
+
activeDotStyle?: StyleProp<ViewStyle>;
|
|
11
34
|
}
|
|
12
|
-
declare function Carousel<T>({ data, renderItem, keyExtractor, itemWidth, gap, showDots, className, testID, }: CarouselProps<T>): import("react").JSX.Element;
|
|
35
|
+
declare function Carousel<T>({ data, renderItem, keyExtractor, itemWidth, gap, showDots, className, testID, index: controlledIndex, onIndexChange, previousAccessibilityLabel, nextAccessibilityLabel, formatPageLabel, renderControls, controlsClassName, paginationTextProps, contentContainerStyle, itemStyle, dotStyle, activeDotStyle, ...viewProps }: CarouselProps<T>): import("react").JSX.Element;
|
|
13
36
|
export default Carousel;
|