@sincpro/mobile-ui 1.1.0 → 2.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.
Files changed (123) hide show
  1. package/README.md +156 -29
  2. package/dist/Actions/Actions.Button.d.ts +10 -12
  3. package/dist/Actions/Actions.Button.js +9 -11
  4. package/dist/Actions/Actions.Dock.d.ts +20 -0
  5. package/dist/Actions/Actions.Dock.js +89 -0
  6. package/dist/Actions/Actions.FAB.d.ts +1 -2
  7. package/dist/Actions/Actions.FAB.js +5 -7
  8. package/dist/Actions/Actions.IconButton.d.ts +1 -2
  9. package/dist/Actions/Actions.IconButton.js +2 -2
  10. package/dist/Actions/index.d.ts +4 -0
  11. package/dist/Actions/index.js +3 -0
  12. package/dist/Dialog/BottomSheet/BottomSheet.Root.js +22 -34
  13. package/dist/Dialog/Dialog.ActionSheet.js +2 -16
  14. package/dist/Dialog/Dialog.Confirmation.js +7 -5
  15. package/dist/Dialog/Dialog.EditValue.js +3 -1
  16. package/dist/Dialog/Dialog.Sheet.d.ts +3 -3
  17. package/dist/Dialog/Dialog.Sheet.js +18 -25
  18. package/dist/Display/Display.Accordion.js +7 -3
  19. package/dist/Display/Display.AmountSummary.d.ts +28 -0
  20. package/dist/Display/Display.AmountSummary.js +25 -0
  21. package/dist/Display/Display.Carousel.d.ts +27 -4
  22. package/dist/Display/Display.Carousel.js +112 -12
  23. package/dist/Display/Display.ExpoImage.d.ts +8 -0
  24. package/dist/Display/Display.ExpoImage.js +15 -0
  25. package/dist/Display/Display.Image.d.ts +10 -6
  26. package/dist/Display/Display.Image.js +39 -6
  27. package/dist/Display/Display.ListItem.d.ts +1 -2
  28. package/dist/Display/Display.ListItem.js +3 -3
  29. package/dist/Display/Display.Logo.d.ts +2 -2
  30. package/dist/Display/Display.Logo.js +3 -2
  31. package/dist/Display/Display.MediaCard.d.ts +2 -2
  32. package/dist/Display/Display.MediaEmbed.d.ts +2 -2
  33. package/dist/Display/Display.ProductCard.d.ts +2 -2
  34. package/dist/Display/Display.Story.d.ts +3 -3
  35. package/dist/Display/Display.Story.js +5 -4
  36. package/dist/Display/Display.StoryTray.d.ts +4 -4
  37. package/dist/Display/Display.StoryTray.js +3 -2
  38. package/dist/Display/Display.StoryViewer.d.ts +3 -3
  39. package/dist/Display/Display.StoryViewer.js +6 -3
  40. package/dist/Display/index.d.ts +9 -0
  41. package/dist/Display/index.js +4 -0
  42. package/dist/Feedback/Feedback.DomainSplashScreen.d.ts +13 -4
  43. package/dist/Feedback/Feedback.DomainSplashScreen.js +68 -53
  44. package/dist/Feedback/Feedback.EmptyState.d.ts +3 -4
  45. package/dist/Feedback/Feedback.EmptyState.js +4 -3
  46. package/dist/Feedback/Feedback.Error.d.ts +1 -2
  47. package/dist/Feedback/Feedback.Error.js +2 -2
  48. package/dist/Feedback/Feedback.Loading.d.ts +6 -2
  49. package/dist/Feedback/Feedback.Loading.js +2 -2
  50. package/dist/Feedback/Feedback.Progress.d.ts +6 -3
  51. package/dist/Feedback/Feedback.Progress.js +29 -19
  52. package/dist/Feedback/Feedback.ProgressCircle.d.ts +3 -2
  53. package/dist/Feedback/Feedback.ProgressCircle.js +10 -7
  54. package/dist/Feedback/Feedback.Skeleton.d.ts +4 -4
  55. package/dist/Feedback/Feedback.Skeleton.js +15 -3
  56. package/dist/Feedback/Feedback.Spinner.d.ts +3 -3
  57. package/dist/Feedback/Feedback.Spinner.js +40 -9
  58. package/dist/Feedback/Feedback.Splash.d.ts +2 -2
  59. package/dist/Feedback/Feedback.Splash.js +5 -3
  60. package/dist/Feedback/Toast.context.d.ts +64 -3
  61. package/dist/Feedback/Toast.context.js +112 -31
  62. package/dist/Feedback/index.d.ts +15 -1
  63. package/dist/Feedback/index.js +4 -1
  64. package/dist/Form/Form.Checkbox.d.ts +1 -2
  65. package/dist/Form/Form.Checkbox.js +2 -2
  66. package/dist/Form/Form.DatePicker.d.ts +1 -2
  67. package/dist/Form/Form.DatePicker.js +2 -2
  68. package/dist/Form/Form.Dropdown.d.ts +15 -3
  69. package/dist/Form/Form.Dropdown.js +21 -6
  70. package/dist/Form/Form.ErrorSummary.d.ts +23 -0
  71. package/dist/Form/Form.ErrorSummary.js +53 -0
  72. package/dist/Form/Form.Input.d.ts +1 -2
  73. package/dist/Form/Form.Input.js +2 -2
  74. package/dist/Form/Form.Select.d.ts +1 -2
  75. package/dist/Form/Form.Select.js +6 -19
  76. package/dist/Form/index.d.ts +3 -0
  77. package/dist/Form/index.js +2 -0
  78. package/dist/Navigation/Navigation.AppBar.d.ts +2 -6
  79. package/dist/Navigation/Navigation.AppBar.js +9 -7
  80. package/dist/Navigation/Navigation.BottomNav.d.ts +1 -3
  81. package/dist/Navigation/Navigation.BottomNav.js +7 -6
  82. package/dist/Navigation/Navigation.Header.d.ts +2 -2
  83. package/dist/Navigation/Navigation.Menu.js +10 -3
  84. package/dist/Navigation/Navigation.Search.d.ts +41 -0
  85. package/dist/Navigation/Navigation.Search.js +47 -0
  86. package/dist/Navigation/Navigation.SearchBar.d.ts +1 -2
  87. package/dist/Navigation/Navigation.SearchBar.js +16 -19
  88. package/dist/Navigation/Navigation.SegmentedControl.d.ts +11 -3
  89. package/dist/Navigation/Navigation.SegmentedControl.js +29 -16
  90. package/dist/Navigation/index.d.ts +11 -2
  91. package/dist/Navigation/index.js +2 -0
  92. package/dist/branding.d.ts +3 -2
  93. package/dist/primitives/BaseButton.d.ts +10 -12
  94. package/dist/primitives/BaseButton.js +9 -11
  95. package/dist/theme/typography.d.ts +1 -1
  96. package/dist/utils/image.d.ts +3 -0
  97. package/dist/utils/image.js +13 -0
  98. package/dist/utils/keys.d.ts +1 -0
  99. package/dist/utils/keys.js +7 -0
  100. package/dist/utils/progress.d.ts +1 -0
  101. package/dist/utils/progress.js +5 -0
  102. package/dist/utils/reorder.js +2 -5
  103. package/dist/utils/useReducedMotion.d.ts +1 -0
  104. package/dist/utils/useReducedMotion.js +43 -0
  105. package/dist/utils/useSheetTranslation.d.ts +5 -0
  106. package/dist/utils/useSheetTranslation.js +23 -0
  107. package/dist/views/AppSplashView.d.ts +3 -2
  108. package/dist/views/AppSplashView.js +3 -2
  109. package/dist/views/AuthFormView.d.ts +2 -2
  110. package/dist/views/FormViewV2.d.ts +2 -2
  111. package/dist/views/ListViewV2.context.d.ts +3 -1
  112. package/dist/views/ListViewV2.context.js +41 -21
  113. package/dist/views/ListViewV2.d.ts +15 -7
  114. package/dist/views/ListViewV2.js +44 -23
  115. package/dist/views/types/IListView.js +6 -5
  116. package/dist/widgets/CollectionOptions.js +9 -7
  117. package/dist/widgets/FilterBar.d.ts +1 -1
  118. package/dist/widgets/FilterBar.js +1 -1
  119. package/dist/widgets/FilterBuilder.js +7 -7
  120. package/dist/widgets/HomeHeader.d.ts +2 -2
  121. package/dist/widgets/PromoModal.js +3 -1
  122. package/dist/widgets/ScreenHeader.d.ts +2 -2
  123. package/package.json +4 -1
@@ -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";
@@ -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 { createContext, useContext, useEffect, useRef } from "react";
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 = useRef(new Animated.Value(screenHeight)).current;
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
- Animated.timing(translateY, {
130
- toValue: screenHeight,
131
- duration: 200,
132
- useNativeDriver: true,
133
- }).start(() => onClose());
120
+ translateY.stopAnimation();
121
+ gesture.current.onClose();
134
122
  }
135
123
  else {
136
- Animated.spring(translateY, {
137
- toValue: 0,
138
- useNativeDriver: true,
139
- damping: 20,
140
- stiffness: 300,
141
- }).start();
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
- Animated.timing(translateY, {
148
- toValue: screenHeight,
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
- // eslint-disable-next-line react-hooks/refs
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
- return (_jsx(Modal, { animationType: "fade", onRequestClose: onCancel, presentationStyle: "overFullScreen", transparent: true, visible: visible, children: _jsx(TouchableWithoutFeedback, { onPress: onCancel, children: _jsx(View, { className: "flex-1 justify-center items-center p-6 bg-black/50", children: _jsx(TouchableWithoutFeedback, { children: _jsxs(View, { accessibilityViewIsModal: true, className: "p-3 w-full max-w-xs mx-auto", style: {
8
- borderRadius: 16,
9
- backgroundColor: theme.bg.popover,
10
- ...theme.shadow.md,
11
- }, 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" })] })] }) }) }) }) }));
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, accessibleSizing, testID, }: SheetProps): import("react").JSX.Element;
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 { useEffect, useRef, useState } from "react";
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, accessibleSizing = false, testID, }) {
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 = useRef(new Animated.Value(800)).current;
29
- const onCloseRef = useRef(onClose);
30
- onCloseRef.current = onClose;
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
- Animated.timing(translateY, {
54
- toValue: 800,
55
- duration: 200,
56
- useNativeDriver: true,
57
- }).start(() => onCloseRef.current());
42
+ translateY.stopAnimation();
43
+ gesture.current.onClose();
58
44
  }
59
45
  else {
60
- Animated.spring(translateY, { toValue: 0, useNativeDriver: true }).start();
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: accessibleSizing ? { minWidth: 48, minHeight: 48 } : undefined, children: _jsx(Typography.Text, { className: "text-text-accent", variant: "bodySmall", children: "Cerrar" }) })) : null] })) : null, _jsx(ScrollView, { contentContainerStyle: { paddingHorizontal: 16, paddingTop: 4 }, children: children })] })] }) }));
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 { theme } from "../theme/index.js";
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
- LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
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 { type ReactNode } from "react";
2
- export interface CarouselProps<T> {
3
- data: T[];
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;
@@ -1,19 +1,119 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
2
- import { theme } from "../theme/index.js";
3
- import { cn } from "../theme/tw.js";
4
- import { useState } from "react";
2
+ import IconButton from "../Actions/Actions.IconButton.js";
3
+ import { useTheme } from "../theme/index.js";
4
+ import { Typography } from "../Typography/index.js";
5
+ import { uniqueKeys } from "../utils/keys.js";
6
+ import { useReducedMotion } from "../utils/useReducedMotion.js";
7
+ import { useEffect, useRef, useState } from "react";
5
8
  import { ScrollView, View, } from "react-native";
6
- function Carousel({ data, renderItem, keyExtractor, itemWidth, gap = 12, showDots = true, className, testID, }) {
9
+ function Carousel({ data, renderItem, keyExtractor, itemWidth, gap = 12, showDots = true, className, testID, index: controlledIndex, onIndexChange, previousAccessibilityLabel = "Elemento anterior", nextAccessibilityLabel = "Elemento siguiente", formatPageLabel = (index, count) => `Elemento ${index + 1} de ${count}`, renderControls, controlsClassName, paginationTextProps, contentContainerStyle, itemStyle, dotStyle, activeDotStyle, ...viewProps }) {
10
+ if (!Number.isFinite(itemWidth) ||
11
+ itemWidth <= 0 ||
12
+ !Number.isFinite(gap) ||
13
+ gap < 0 ||
14
+ !Number.isFinite(itemWidth + gap))
15
+ throw new RangeError("Carousel requires a positive finite itemWidth and a non-negative finite gap.");
16
+ if (controlledIndex !== undefined &&
17
+ (!Number.isInteger(controlledIndex) || controlledIndex < 0))
18
+ throw new RangeError("Carousel index must be a non-negative integer.");
19
+ if (controlledIndex !== undefined && !onIndexChange)
20
+ throw new Error("Carousel requires onIndexChange when index is controlled.");
21
+ const keys = uniqueKeys(data, keyExtractor, "Carousel");
22
+ const theme = useTheme();
23
+ const reducedMotion = useReducedMotion();
7
24
  const [active, setActive] = useState(0);
25
+ const [viewportWidth, setViewportWidth] = useState(0);
26
+ const [scrollRevision, setScrollRevision] = useState(0);
27
+ const scrollRef = useRef(null);
28
+ const mounted = useRef(false);
8
29
  const snap = itemWidth + gap;
9
- const onScroll = (e) => {
10
- const index = Math.round(e.nativeEvent.contentOffset.x / snap);
11
- if (index !== active)
12
- setActive(index);
30
+ const current = Math.min(controlledIndex ?? active, Math.max(0, data.length - 1));
31
+ const nativePosition = useRef({ index: 0, snap, count: data.length, width: 0 });
32
+ if (controlledIndex === undefined && active !== current)
33
+ setActive(current);
34
+ useEffect(() => {
35
+ const previous = nativePosition.current;
36
+ if (previous.index !== current ||
37
+ previous.snap !== snap ||
38
+ previous.width !== viewportWidth) {
39
+ scrollRef.current?.scrollTo({
40
+ x: current * snap,
41
+ y: 0,
42
+ animated: mounted.current &&
43
+ !reducedMotion &&
44
+ previous.snap === snap &&
45
+ previous.count === data.length &&
46
+ previous.width === viewportWidth,
47
+ });
48
+ }
49
+ nativePosition.current = {
50
+ index: current,
51
+ snap,
52
+ count: data.length,
53
+ width: viewportWidth,
54
+ };
55
+ mounted.current = true;
56
+ if (controlledIndex === undefined &&
57
+ previous.count > data.length &&
58
+ previous.index !== current) {
59
+ onIndexChange?.(current);
60
+ }
61
+ }, [
62
+ active,
63
+ current,
64
+ controlledIndex,
65
+ data.length,
66
+ onIndexChange,
67
+ reducedMotion,
68
+ snap,
69
+ viewportWidth,
70
+ scrollRevision,
71
+ ]);
72
+ const changeIndex = (next) => {
73
+ setActive(next);
74
+ if (next !== current)
75
+ onIndexChange?.(next);
13
76
  };
14
- return (_jsxs(View, { className: className, testID: testID, children: [_jsx(ScrollView, { decelerationRate: "fast", horizontal: true, onMomentumScrollEnd: onScroll, showsHorizontalScrollIndicator: false, snapToInterval: snap, children: data.map((item, index) => (_jsx(View, { style: { width: itemWidth, marginRight: index < data.length - 1 ? gap : 0 }, children: renderItem(item, index) }, keyExtractor(item, index)))) }), showDots && data.length > 1 ? (_jsx(View, { className: "flex-row justify-center gap-1.5 mt-3", children: data.map((item, index) => (_jsx(View, { className: cn("h-1.5 rounded-full"), style: {
15
- width: index === active ? 16 : 6,
16
- backgroundColor: index === active ? theme.primary : theme.border.strong,
17
- } }, keyExtractor(item, index)))) })) : null] }));
77
+ const goTo = (next) => {
78
+ if (!Number.isInteger(next) || next < 0 || next >= data.length)
79
+ throw new RangeError("Carousel goTo requires an index within the current data.");
80
+ changeIndex(next);
81
+ };
82
+ const onScroll = (event) => {
83
+ const offset = event.nativeEvent.contentOffset.x;
84
+ if (!Number.isFinite(offset))
85
+ throw new RangeError("Carousel received a non-finite scroll offset.");
86
+ const next = Math.max(0, Math.min(Math.round(offset / snap), data.length - 1));
87
+ nativePosition.current = { index: next, snap, count: data.length, width: viewportWidth };
88
+ changeIndex(next);
89
+ if (controlledIndex !== undefined)
90
+ setScrollRevision((revision) => revision + 1);
91
+ };
92
+ const controls = {
93
+ index: current,
94
+ count: data.length,
95
+ canPrevious: current > 0,
96
+ canNext: current < data.length - 1,
97
+ previous: () => {
98
+ if (current > 0)
99
+ goTo(current - 1);
100
+ },
101
+ next: () => {
102
+ if (current < data.length - 1)
103
+ goTo(current + 1);
104
+ },
105
+ goTo,
106
+ };
107
+ return (_jsxs(View, { ...viewProps, className: className, testID: testID, children: [_jsxs(ScrollView, { contentContainerStyle: contentContainerStyle, decelerationRate: "fast", horizontal: true, onLayout: (event) => setViewportWidth(event.nativeEvent.layout.width), onMomentumScrollEnd: onScroll, ref: scrollRef, showsHorizontalScrollIndicator: false, snapToInterval: snap, testID: testID ? `${testID}-scroll` : undefined, children: [data.map((item, index) => (_jsx(View, { style: [
108
+ itemStyle,
109
+ { width: itemWidth, marginRight: index < data.length - 1 ? gap : 0 },
110
+ ], children: renderItem(item, index) }, keys[index]))), data.length > 0 ? (_jsx(View, { accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", style: { width: Math.max(0, viewportWidth - itemWidth) }, testID: testID ? `${testID}-end-spacing` : undefined })) : null] }), showDots && data.length > 1 ? (_jsx(View, { accessibilityElementsHidden: true, className: "flex-row justify-center gap-1.5 mt-3", importantForAccessibility: "no-hide-descendants", children: data.map((_item, index) => (_jsx(View, { className: "h-1.5 rounded-full", style: [
111
+ {
112
+ width: index === current ? 16 : 6,
113
+ backgroundColor: index === current ? theme.primary : theme.border.strong,
114
+ },
115
+ dotStyle,
116
+ index === current ? activeDotStyle : undefined,
117
+ ] }, keys[index]))) })) : null, data.length > 1 ? (renderControls ? (renderControls(controls)) : (_jsxs(View, { className: controlsClassName ?? "flex-row items-center justify-center gap-3 mt-2", children: [_jsx(IconButton, { accessibilityLabel: previousAccessibilityLabel, disabled: !controls.canPrevious, icon: "chevron-left", onPress: controls.previous }), _jsx(Typography.Text, { ...paginationTextProps, accessibilityLiveRegion: "polite", children: formatPageLabel(current, data.length) }), _jsx(IconButton, { accessibilityLabel: nextAccessibilityLabel, disabled: !controls.canNext, icon: "chevron-right", onPress: controls.next })] }))) : null] }));
18
118
  }
19
119
  export default Carousel;
@@ -0,0 +1,8 @@
1
+ import { Image } from "expo-image";
2
+ import type { ComponentPropsWithRef } from "react";
3
+ export type ExpoImageProps = Omit<ComponentPropsWithRef<typeof Image>, "resizeMode" | "defaultSource" | "loadingIndicatorSource"> & {
4
+ className?: string;
5
+ };
6
+ declare function ExpoImage({ cachePolicy, transition, autoplay, sfEffect, onError, source, recyclingKey, ...props }: ExpoImageProps): import("react").JSX.Element;
7
+ export default ExpoImage;
8
+ export { ExpoImage };
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx } from "nativewind/jsx-runtime";
2
+ import { imageSourceKey } from "../utils/image.js";
3
+ import { useReducedMotion } from "../utils/useReducedMotion.js";
4
+ import { Image } from "expo-image";
5
+ import { cssInterop } from "nativewind";
6
+ const StyledImage = cssInterop(Image, { className: "style" });
7
+ function ExpoImage({ cachePolicy = "disk", transition = 0, autoplay = true, sfEffect, onError, source, recyclingKey, ...props }) {
8
+ const reducedMotion = useReducedMotion();
9
+ return (_jsx(StyledImage, { ...props, autoplay: autoplay && !reducedMotion, cachePolicy: cachePolicy, onError: (event) => {
10
+ console.error("[ExpoImage] Image load failed", event.error);
11
+ onError?.(event);
12
+ }, recyclingKey: recyclingKey === undefined ? imageSourceKey(source) : recyclingKey, sfEffect: reducedMotion ? null : sfEffect, source: source, transition: reducedMotion ? 0 : transition }));
13
+ }
14
+ export default ExpoImage;
15
+ export { ExpoImage };