@sincpro/mobile-ui 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Actions/Actions.Button.d.ts +6 -6
- package/dist/Actions/Actions.Button.js +650 -180
- package/dist/Actions/Actions.Dock.d.ts +1 -1
- package/dist/Actions/Actions.Dock.js +297 -18
- package/dist/Actions/Actions.FAB.js +100 -12
- package/dist/Actions/Actions.FilterButton.d.ts +17 -0
- package/dist/Actions/Actions.FilterButton.js +263 -33
- package/dist/Actions/Actions.IconButton.d.ts +1 -0
- package/dist/Actions/Actions.IconButton.js +196 -33
- package/dist/Actions/index.js +13 -13
- package/dist/Dialog/Confirmation.context.js +82 -16
- package/dist/Dialog/Dialog.ActionSheet.js +200 -41
- package/dist/Dialog/Dialog.Confirmation.js +168 -31
- package/dist/Dialog/Dialog.EditValue.js +449 -61
- package/dist/Dialog/Dialog.Sheet.d.ts +7 -3
- package/dist/Dialog/Dialog.Sheet.js +231 -15
- package/dist/Dialog/OverlayHost.d.ts +23 -0
- package/dist/Dialog/OverlayHost.js +196 -0
- package/dist/Dialog/SheetSurface.d.ts +24 -0
- package/dist/Dialog/SheetSurface.js +441 -0
- package/dist/Dialog/dialog-actions.d.ts +17 -0
- package/dist/Dialog/dialog-actions.js +59 -0
- package/dist/Dialog/index.d.ts +4 -1
- package/dist/Dialog/index.js +8 -7
- package/dist/Dialog/overlay.store.d.ts +24 -0
- package/dist/Dialog/overlay.store.js +59 -0
- package/dist/Dialog/requestConfirmation.js +20 -10
- package/dist/Display/Display.Accordion.js +185 -13
- package/dist/Display/Display.AmountSummary.js +206 -15
- package/dist/Display/Display.Avatar.js +93 -31
- package/dist/Display/Display.AvatarGroup.js +132 -17
- package/dist/Display/Display.Badge.d.ts +18 -2
- package/dist/Display/Display.Badge.js +117 -49
- package/dist/Display/Display.Card.js +163 -26
- package/dist/Display/Display.Carousel.js +459 -105
- package/dist/Display/Display.Chip.d.ts +4 -1
- package/dist/Display/Display.Chip.js +165 -31
- package/dist/Display/Display.CircleButton.d.ts +1 -0
- package/dist/Display/Display.CircleButton.js +86 -27
- package/dist/Display/Display.CopyableText.js +289 -66
- package/dist/Display/Display.CountRecords.js +60 -3
- package/dist/Display/Display.DataTable.js +123 -13
- package/dist/Display/Display.Date.js +243 -33
- package/dist/Display/Display.Divider.d.ts +10 -10
- package/dist/Display/Display.Divider.js +67 -20
- package/dist/Display/Display.ExpoImage.js +97 -8
- package/dist/Display/Display.GradientSurface.d.ts +9 -4
- package/dist/Display/Display.GradientSurface.js +196 -46
- package/dist/Display/Display.Icon.js +129 -15
- package/dist/Display/Display.IconBadge.js +95 -25
- package/dist/Display/Display.Image.d.ts +7 -1
- package/dist/Display/Display.Image.js +344 -39
- package/dist/Display/Display.KeyValue.js +90 -5
- package/dist/Display/Display.ListGroup.js +181 -9
- package/dist/Display/Display.ListItem.js +324 -28
- package/dist/Display/Display.Logo.js +84 -29
- package/dist/Display/Display.MediaCard.js +125 -4
- package/dist/Display/Display.MediaEmbed.d.ts +0 -5
- package/dist/Display/Display.MediaEmbed.js +170 -26
- package/dist/Display/Display.MenuButton.d.ts +2 -2
- package/dist/Display/Display.MenuButton.js +380 -94
- package/dist/Display/Display.MenuCard.js +122 -18
- package/dist/Display/Display.MenuGrid.js +43 -3
- package/dist/Display/Display.Monetary.js +90 -5
- package/dist/Display/Display.Pattern.js +306 -47
- package/dist/Display/Display.PriceTag.js +117 -14
- package/dist/Display/Display.ProductCard.js +154 -4
- package/dist/Display/Display.Rating.js +92 -11
- package/dist/Display/Display.SearchHistory.js +132 -6
- package/dist/Display/Display.SectionHeader.d.ts +5 -1
- package/dist/Display/Display.SectionHeader.js +125 -12
- package/dist/Display/Display.Stat.js +62 -3
- package/dist/Display/Display.StatCard.js +131 -7
- package/dist/Display/Display.StatusBadge.d.ts +29 -0
- package/dist/Display/Display.StatusBadge.js +68 -0
- package/dist/Display/Display.StatusDot.js +93 -18
- package/dist/Display/Display.Story.js +285 -35
- package/dist/Display/Display.StoryTray.js +354 -34
- package/dist/Display/Display.StoryViewer.js +571 -72
- package/dist/Display/Display.SwipeableRow.js +141 -20
- package/dist/Display/Display.Tag.d.ts +4 -1
- package/dist/Display/Display.Tag.js +66 -4
- package/dist/Display/Display.Timeline.js +102 -13
- package/dist/Display/Display.Tooltip.js +122 -26
- package/dist/Display/chevron.d.ts +6 -0
- package/dist/Display/chevron.js +32 -0
- package/dist/Display/count-badge.d.ts +21 -0
- package/dist/Display/count-badge.js +124 -0
- package/dist/Display/group-title.d.ts +10 -0
- package/dist/Display/group-title.js +53 -0
- package/dist/Display/icon-font.d.ts +3 -0
- package/dist/Display/icon-font.ios.d.ts +3 -0
- package/dist/Display/icon-font.ios.js +4 -0
- package/dist/Display/icon-font.js +7 -0
- package/dist/Display/icon-glyphs.d.ts +2 -0
- package/dist/Display/icon-glyphs.js +87 -0
- package/dist/Display/icon-map.d.ts +5 -1
- package/dist/Display/icon-map.js +340 -84
- package/dist/Display/icon-registry.d.ts +21 -0
- package/dist/Display/icon-registry.js +21 -0
- package/dist/Display/index.d.ts +6 -1
- package/dist/Display/index.js +53 -48
- package/dist/Display/pill.d.ts +16 -0
- package/dist/Display/pill.js +47 -0
- package/dist/Feedback/ErrorBoundary.js +35 -23
- package/dist/Feedback/Feedback.Banner.js +202 -24
- package/dist/Feedback/Feedback.DomainSplashScreen.js +246 -70
- package/dist/Feedback/Feedback.Empty.js +54 -3
- package/dist/Feedback/Feedback.EmptyState.js +114 -5
- package/dist/Feedback/Feedback.Error.d.ts +1 -1
- package/dist/Feedback/Feedback.Error.js +130 -5
- package/dist/Feedback/Feedback.Loading.d.ts +1 -1
- package/dist/Feedback/Feedback.Loading.js +70 -3
- package/dist/Feedback/Feedback.PermissionCard.js +161 -5
- package/dist/Feedback/Feedback.Progress.js +199 -41
- package/dist/Feedback/Feedback.ProgressCircle.js +184 -12
- package/dist/Feedback/Feedback.Skeleton.js +149 -36
- package/dist/Feedback/Feedback.Spinner.js +407 -79
- package/dist/Feedback/Feedback.Splash.js +240 -33
- package/dist/Feedback/Feedback.State.d.ts +17 -0
- package/dist/Feedback/Feedback.State.js +104 -0
- package/dist/Feedback/Toast.context.js +883 -167
- package/dist/Feedback/index.d.ts +3 -0
- package/dist/Feedback/index.js +15 -13
- package/dist/Form/Form.Checkbox.js +212 -22
- package/dist/Form/Form.ControlledCheckbox.d.ts +1 -1
- package/dist/Form/Form.ControlledCheckbox.js +46 -4
- package/dist/Form/Form.ControlledDropdown.d.ts +1 -1
- package/dist/Form/Form.ControlledDropdown.js +62 -4
- package/dist/Form/Form.ControlledInput.d.ts +4 -3
- package/dist/Form/Form.ControlledInput.js +72 -4
- package/dist/Form/Form.ControlledMonetaryInput.d.ts +6 -3
- package/dist/Form/Form.ControlledMonetaryInput.js +50 -4
- package/dist/Form/Form.ControlledRadioButton.d.ts +2 -2
- package/dist/Form/Form.ControlledRadioButton.js +45 -4
- package/dist/Form/Form.DatePicker.js +505 -107
- package/dist/Form/Form.Dropdown.js +303 -52
- package/dist/Form/Form.ErrorSummary.js +236 -44
- package/dist/Form/Form.Field.d.ts +24 -0
- package/dist/Form/Form.Field.js +55 -0
- package/dist/Form/Form.FractionalQuantityInput.js +508 -96
- package/dist/Form/Form.Input.d.ts +17 -3
- package/dist/Form/Form.Input.js +478 -29
- package/dist/Form/Form.KeyboardForm.d.ts +22 -8
- package/dist/Form/Form.KeyboardForm.js +83 -8
- package/dist/Form/Form.KeyboardToolbarHost.d.ts +14 -0
- package/dist/Form/Form.KeyboardToolbarHost.js +182 -0
- package/dist/Form/Form.MonetaryInput.js +164 -17
- package/dist/Form/Form.PickerField.d.ts +31 -0
- package/dist/Form/Form.PickerField.js +562 -0
- package/dist/Form/Form.PinInput.js +150 -15
- package/dist/Form/Form.QuantitySelector.js +229 -25
- package/dist/Form/Form.RadioButton.js +132 -24
- package/dist/Form/Form.Select.js +487 -56
- package/dist/Form/Form.Slider.js +133 -10
- package/dist/Form/Form.Switch.js +99 -4
- package/dist/Form/index.d.ts +11 -6
- package/dist/Form/index.js +26 -27
- package/dist/Form/input-text.d.ts +7 -0
- package/dist/Form/input-text.js +18 -0
- package/dist/Navigation/Navigation.AppBar.d.ts +3 -4
- package/dist/Navigation/Navigation.AppBar.js +535 -99
- package/dist/Navigation/Navigation.BottomNav.js +363 -98
- package/dist/Navigation/Navigation.CollapsingHeader.d.ts +28 -13
- package/dist/Navigation/Navigation.CollapsingHeader.js +369 -36
- package/dist/Navigation/Navigation.FloatingBar.js +71 -11
- package/dist/Navigation/Navigation.Menu.js +309 -95
- package/dist/Navigation/Navigation.MenuSection.js +80 -11
- package/dist/Navigation/Navigation.RowItem.d.ts +4 -2
- package/dist/Navigation/Navigation.RowItem.js +93 -8
- package/dist/Navigation/Navigation.Search.js +241 -27
- package/dist/Navigation/Navigation.SearchBar.d.ts +7 -1
- package/dist/Navigation/Navigation.SearchBar.js +218 -29
- package/dist/Navigation/Navigation.SearchSuggestions.js +77 -3
- package/dist/Navigation/Navigation.SegmentedControl.js +152 -14
- package/dist/Navigation/Navigation.Steps.js +105 -11
- package/dist/Navigation/Navigation.Tabs.js +449 -41
- package/dist/Navigation/index.d.ts +9 -4
- package/dist/Navigation/index.js +13 -13
- package/dist/Typography/Typography.Heading.js +33 -3
- package/dist/Typography/Typography.SelectableText.js +95 -7
- package/dist/Typography/Typography.Text.d.ts +4 -2
- package/dist/Typography/Typography.Text.js +217 -7
- package/dist/Typography/index.js +3 -3
- package/dist/branding.js +29 -13
- package/dist/icons/AddItemIcon.js +76 -2
- package/dist/icons/ArrangeCircle.js +82 -2
- package/dist/icons/ArrowDownIcon.js +63 -3
- package/dist/icons/ArrowUpIcon.js +63 -3
- package/dist/icons/BoxIcon.js +64 -2
- package/dist/icons/BoxTimeIcon.js +63 -2
- package/dist/icons/CalendarIcon.js +145 -2
- package/dist/icons/CardIcon.js +80 -2
- package/dist/icons/CashierIcon.js +39 -2
- package/dist/icons/CreditIcon.js +76 -3
- package/dist/icons/DuoIcon.js +75 -2
- package/dist/icons/HomeIcon.js +39 -2
- package/dist/icons/HomeIconOutlined.js +53 -2
- package/dist/icons/LogoIcon.js +87 -2
- package/dist/icons/MoneyReceiveIcon.js +86 -2
- package/dist/icons/PinIcon.js +39 -2
- package/dist/icons/ProfileIcon.js +47 -2
- package/dist/icons/SettingsIcon.js +114 -2
- package/dist/icons/SinpeIcon.js +60 -2
- package/dist/icons/ToggleOffIcon.js +53 -2
- package/dist/icons/WalletMoneyIcon.js +81 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +8 -2
- package/dist/layouts/AuthContainer.d.ts +4 -5
- package/dist/layouts/AuthContainer.js +231 -7
- package/dist/layouts/BottomInset.js +4 -1
- package/dist/layouts/Container.d.ts +2 -2
- package/dist/layouts/Container.js +45 -3
- package/dist/layouts/GradientContainer.js +37 -5
- package/dist/layouts/PlainLayout.js +19 -3
- package/dist/layouts/ScrollContainer.d.ts +14 -9
- package/dist/layouts/ScrollContainer.js +125 -4
- package/dist/layouts/edges.d.ts +2 -0
- package/dist/layouts/edges.js +1 -0
- package/dist/primitives/AspectRatio.js +75 -3
- package/dist/primitives/Box.js +45 -3
- package/dist/primitives/Pressable.js +95 -5
- package/dist/primitives/Row.js +84 -13
- package/dist/primitives/Spacer.js +42 -5
- package/dist/primitives/Stack.js +66 -7
- package/dist/primitives/index.js +1 -1
- package/dist/theme/active.js +20 -18
- package/dist/theme/build.js +118 -87
- package/dist/theme/color.js +87 -87
- package/dist/theme/components/ThemedActivityIndicator.d.ts +2 -15
- package/dist/theme/components/ThemedActivityIndicator.js +35 -3
- package/dist/theme/components/index.js +1 -0
- package/dist/theme/contrast.js +32 -33
- package/dist/theme/css-vars.js +71 -75
- package/dist/theme/dark.js +116 -97
- package/dist/theme/default.js +116 -97
- package/dist/theme/define.js +16 -12
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/index.js +7 -6
- package/dist/theme/on-dark-surface.d.ts +12 -0
- package/dist/theme/on-dark-surface.js +13 -0
- package/dist/theme/theme.js +1 -0
- package/dist/theme/tw.js +3 -1
- package/dist/theme/types.js +0 -18
- package/dist/theme/typography.d.ts +1 -1
- package/dist/theme/typography.js +337 -303
- package/dist/theme/useTheme.js +12 -3
- package/dist/theme/useThemeVars.d.ts +9 -0
- package/dist/theme/useThemeVars.js +23 -0
- package/dist/theme/validate.js +175 -166
- package/dist/tokens/index.js +1 -1
- package/dist/tokens/motion.js +30 -13
- package/dist/utils/async.d.ts +14 -0
- package/dist/utils/async.js +22 -0
- package/dist/utils/criteria.js +66 -85
- package/dist/utils/date.d.ts +8 -2
- package/dist/utils/date.js +63 -50
- package/dist/utils/image.js +8 -8
- package/dist/utils/intl.d.ts +1 -0
- package/dist/utils/intl.js +13 -0
- package/dist/utils/keys.js +3 -5
- package/dist/utils/monetary.d.ts +1 -0
- package/dist/utils/monetary.js +28 -24
- package/dist/utils/progress.js +2 -3
- package/dist/utils/quantity.js +25 -26
- package/dist/utils/reorder.js +11 -20
- package/dist/utils/search.d.ts +4 -0
- package/dist/utils/search.js +12 -0
- package/dist/utils/serializer.js +38 -38
- package/dist/utils/useReducedMotion.js +32 -30
- package/dist/views/AppSplashView.js +117 -3
- package/dist/views/AuthFormView.d.ts +4 -5
- package/dist/views/AuthFormView.js +119 -11
- package/dist/views/FormViewV2.context.js +75 -23
- package/dist/views/FormViewV2.d.ts +4 -5
- package/dist/views/FormViewV2.js +658 -92
- package/dist/views/ListViewV2.context.js +91 -47
- package/dist/views/ListViewV2.d.ts +84 -43
- package/dist/views/ListViewV2.js +1350 -200
- package/dist/views/Wizard/Wizard.context.js +248 -84
- package/dist/views/Wizard/Wizard.js +260 -67
- package/dist/views/types/IListView.js +34 -31
- package/dist/widgets/CollectionOptions.js +557 -138
- package/dist/widgets/FilterBar.js +159 -7
- package/dist/widgets/FilterBuilder.js +375 -102
- package/dist/widgets/JSONViewer.js +275 -129
- package/dist/widgets/PromoBanner.js +336 -42
- package/dist/widgets/PromoModal.d.ts +2 -2
- package/dist/widgets/PromoModal.js +389 -62
- package/dist/widgets/QueryChoice.js +150 -8
- package/dist/widgets/QuickActions.js +120 -31
- package/dist/widgets/ReorderableList.js +399 -128
- package/dist/widgets/TimeZoneSelectorModal.js +458 -51
- package/dist/widgets/index.js +3 -3
- package/package.json +7 -2
- package/tailwind.preset.js +7 -5
- package/dist/Form/Form.InputField.d.ts +0 -10
- package/dist/Form/Form.InputField.js +0 -38
- package/dist/Form/Form.KeyboardToolbar.d.ts +0 -22
- package/dist/Form/Form.KeyboardToolbar.js +0 -66
- package/dist/Form/Form.PasswordInput.d.ts +0 -9
- package/dist/Form/Form.PasswordInput.js +0 -17
- package/dist/Form/Form.TextInput.d.ts +0 -8
- package/dist/Form/Form.TextInput.js +0 -8
- package/dist/primitives/BaseButton.d.ts +0 -150
- package/dist/primitives/BaseButton.js +0 -229
- package/dist/utils/useSheetTranslation.d.ts +0 -5
- package/dist/utils/useSheetTranslation.js +0 -23
|
@@ -1,22 +1,238 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { OverlayPortal } from "./OverlayHost.js";
|
|
3
|
+
import { SheetSurface } from "./SheetSurface.js";
|
|
3
4
|
import Pressable from "../primitives/Pressable.js";
|
|
4
|
-
import { themeToVars, useTheme } from "../theme/index.js";
|
|
5
5
|
import { Typography } from "../Typography/index.js";
|
|
6
|
-
import {
|
|
6
|
+
import { useState } from "react";
|
|
7
7
|
import { ScrollView, View } from "react-native";
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
8
9
|
const SNAP_POINTS = ["60%", "90%"];
|
|
9
|
-
function Sheet(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
function Sheet(t0) {
|
|
11
|
+
const $ = _c(41);
|
|
12
|
+
const {
|
|
13
|
+
visible,
|
|
14
|
+
onClose,
|
|
15
|
+
onClosed,
|
|
16
|
+
title,
|
|
17
|
+
children,
|
|
18
|
+
footer,
|
|
19
|
+
snapPoints: t1,
|
|
20
|
+
scrollable: t2,
|
|
21
|
+
dismissible: t3,
|
|
22
|
+
testID
|
|
23
|
+
} = t0;
|
|
24
|
+
const snapPoints = t1 === undefined ? SNAP_POINTS : t1;
|
|
25
|
+
const scrollable = t2 === undefined ? true : t2;
|
|
26
|
+
const dismissible = t3 === undefined ? true : t3;
|
|
27
|
+
const [present, setPresent] = useState(visible);
|
|
28
|
+
if (visible && !present) {
|
|
29
|
+
setPresent(true);
|
|
30
|
+
}
|
|
31
|
+
if (!present) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
let t4;
|
|
35
|
+
if ($[0] !== dismissible || $[1] !== onClose || $[2] !== visible) {
|
|
36
|
+
t4 = () => {
|
|
37
|
+
if (visible && dismissible) {
|
|
38
|
+
onClose();
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
$[0] = dismissible;
|
|
42
|
+
$[1] = onClose;
|
|
43
|
+
$[2] = visible;
|
|
44
|
+
$[3] = t4;
|
|
45
|
+
} else {
|
|
46
|
+
t4 = $[3];
|
|
47
|
+
}
|
|
48
|
+
const close = t4;
|
|
49
|
+
let t5;
|
|
50
|
+
if ($[4] !== onClosed) {
|
|
51
|
+
t5 = () => {
|
|
52
|
+
setPresent(false);
|
|
53
|
+
onClosed?.();
|
|
54
|
+
};
|
|
55
|
+
$[4] = onClosed;
|
|
56
|
+
$[5] = t5;
|
|
57
|
+
} else {
|
|
58
|
+
t5 = $[5];
|
|
59
|
+
}
|
|
60
|
+
const exited = t5;
|
|
61
|
+
let t6;
|
|
62
|
+
if ($[6] !== close) {
|
|
63
|
+
t6 = () => {
|
|
64
|
+
close();
|
|
65
|
+
return true;
|
|
66
|
+
};
|
|
67
|
+
$[6] = close;
|
|
68
|
+
$[7] = t6;
|
|
69
|
+
} else {
|
|
70
|
+
t6 = $[7];
|
|
71
|
+
}
|
|
72
|
+
const back = t6;
|
|
73
|
+
let t7;
|
|
74
|
+
if ($[8] !== title) {
|
|
75
|
+
t7 = title ? _jsx(Typography.Text, {
|
|
76
|
+
accessibilityRole: "header",
|
|
77
|
+
className: "flex-1 text-text-primary",
|
|
78
|
+
semibold: true,
|
|
79
|
+
variant: "subtitle",
|
|
80
|
+
children: title
|
|
81
|
+
}) : _jsx(View, {
|
|
82
|
+
className: "flex-1"
|
|
83
|
+
});
|
|
84
|
+
$[8] = title;
|
|
85
|
+
$[9] = t7;
|
|
86
|
+
} else {
|
|
87
|
+
t7 = $[9];
|
|
88
|
+
}
|
|
89
|
+
const t8 = !dismissible;
|
|
90
|
+
let t9;
|
|
91
|
+
if ($[10] !== t8) {
|
|
92
|
+
t9 = {
|
|
93
|
+
disabled: t8
|
|
94
|
+
};
|
|
95
|
+
$[10] = t8;
|
|
96
|
+
$[11] = t9;
|
|
97
|
+
} else {
|
|
98
|
+
t9 = $[11];
|
|
99
|
+
}
|
|
100
|
+
const t10 = !dismissible;
|
|
101
|
+
let t11;
|
|
102
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
103
|
+
t11 = {
|
|
104
|
+
minHeight: 48,
|
|
105
|
+
minWidth: 48,
|
|
106
|
+
alignItems: "center",
|
|
107
|
+
justifyContent: "center"
|
|
14
108
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
109
|
+
$[12] = t11;
|
|
110
|
+
} else {
|
|
111
|
+
t11 = $[12];
|
|
112
|
+
}
|
|
113
|
+
const t12 = dismissible ? "text-text-accent" : "text-text-disabled";
|
|
114
|
+
let t13;
|
|
115
|
+
if ($[13] !== t12) {
|
|
116
|
+
t13 = _jsx(Typography.Text, {
|
|
117
|
+
className: t12,
|
|
118
|
+
variant: "bodySmall",
|
|
119
|
+
children: "Cerrar"
|
|
120
|
+
});
|
|
121
|
+
$[13] = t12;
|
|
122
|
+
$[14] = t13;
|
|
123
|
+
} else {
|
|
124
|
+
t13 = $[14];
|
|
125
|
+
}
|
|
126
|
+
let t14;
|
|
127
|
+
if ($[15] !== close || $[16] !== t10 || $[17] !== t13 || $[18] !== t9) {
|
|
128
|
+
t14 = _jsx(Pressable, {
|
|
129
|
+
accessibilityLabel: "Cerrar",
|
|
130
|
+
accessibilityRole: "button",
|
|
131
|
+
accessibilityState: t9,
|
|
132
|
+
disabled: t10,
|
|
133
|
+
onPress: close,
|
|
134
|
+
style: t11,
|
|
135
|
+
children: t13
|
|
136
|
+
});
|
|
137
|
+
$[15] = close;
|
|
138
|
+
$[16] = t10;
|
|
139
|
+
$[17] = t13;
|
|
140
|
+
$[18] = t9;
|
|
141
|
+
$[19] = t14;
|
|
142
|
+
} else {
|
|
143
|
+
t14 = $[19];
|
|
144
|
+
}
|
|
145
|
+
let t15;
|
|
146
|
+
if ($[20] !== t14 || $[21] !== t7) {
|
|
147
|
+
t15 = _jsxs(View, {
|
|
148
|
+
className: "flex-row items-center gap-3 px-4 pb-2",
|
|
149
|
+
children: [t7, t14]
|
|
150
|
+
});
|
|
151
|
+
$[20] = t14;
|
|
152
|
+
$[21] = t7;
|
|
153
|
+
$[22] = t15;
|
|
154
|
+
} else {
|
|
155
|
+
t15 = $[22];
|
|
156
|
+
}
|
|
157
|
+
const header = t15;
|
|
158
|
+
const t16 = visible ? back : undefined;
|
|
159
|
+
let t17;
|
|
160
|
+
if ($[23] !== footer) {
|
|
161
|
+
t17 = footer ? _jsx(View, {
|
|
162
|
+
className: "border-t border-border-light px-4 py-3",
|
|
163
|
+
children: footer
|
|
164
|
+
}) : undefined;
|
|
165
|
+
$[23] = footer;
|
|
166
|
+
$[24] = t17;
|
|
167
|
+
} else {
|
|
168
|
+
t17 = $[24];
|
|
169
|
+
}
|
|
170
|
+
let t18;
|
|
171
|
+
if ($[25] !== children || $[26] !== scrollable) {
|
|
172
|
+
t18 = scrollable ? _jsx(ScrollView, {
|
|
173
|
+
contentContainerStyle: {
|
|
174
|
+
paddingHorizontal: 16,
|
|
175
|
+
paddingBottom: 16
|
|
176
|
+
},
|
|
177
|
+
keyboardDismissMode: "on-drag",
|
|
178
|
+
keyboardShouldPersistTaps: "handled",
|
|
179
|
+
style: {
|
|
180
|
+
flex: 1,
|
|
181
|
+
minHeight: 0
|
|
182
|
+
},
|
|
183
|
+
children: children
|
|
184
|
+
}) : _jsx(View, {
|
|
185
|
+
style: {
|
|
186
|
+
flex: 1,
|
|
187
|
+
minHeight: 0,
|
|
188
|
+
paddingHorizontal: 16
|
|
189
|
+
},
|
|
190
|
+
children: children
|
|
191
|
+
});
|
|
192
|
+
$[25] = children;
|
|
193
|
+
$[26] = scrollable;
|
|
194
|
+
$[27] = t18;
|
|
195
|
+
} else {
|
|
196
|
+
t18 = $[27];
|
|
197
|
+
}
|
|
198
|
+
let t19;
|
|
199
|
+
if ($[28] !== close || $[29] !== dismissible || $[30] !== exited || $[31] !== header || $[32] !== snapPoints || $[33] !== t17 || $[34] !== t18 || $[35] !== testID || $[36] !== visible) {
|
|
200
|
+
t19 = _jsx(SheetSurface, {
|
|
201
|
+
dismissible: dismissible,
|
|
202
|
+
footer: t17,
|
|
203
|
+
header: header,
|
|
204
|
+
onExited: exited,
|
|
205
|
+
onRequestClose: close,
|
|
206
|
+
snapPoints: snapPoints,
|
|
207
|
+
testID: testID,
|
|
208
|
+
visible: visible,
|
|
209
|
+
children: t18
|
|
210
|
+
});
|
|
211
|
+
$[28] = close;
|
|
212
|
+
$[29] = dismissible;
|
|
213
|
+
$[30] = exited;
|
|
214
|
+
$[31] = header;
|
|
215
|
+
$[32] = snapPoints;
|
|
216
|
+
$[33] = t17;
|
|
217
|
+
$[34] = t18;
|
|
218
|
+
$[35] = testID;
|
|
219
|
+
$[36] = visible;
|
|
220
|
+
$[37] = t19;
|
|
221
|
+
} else {
|
|
222
|
+
t19 = $[37];
|
|
223
|
+
}
|
|
224
|
+
let t20;
|
|
225
|
+
if ($[38] !== t16 || $[39] !== t19) {
|
|
226
|
+
t20 = _jsx(OverlayPortal, {
|
|
227
|
+
onBack: t16,
|
|
228
|
+
children: t19
|
|
229
|
+
});
|
|
230
|
+
$[38] = t16;
|
|
231
|
+
$[39] = t19;
|
|
232
|
+
$[40] = t20;
|
|
233
|
+
} else {
|
|
234
|
+
t20 = $[40];
|
|
235
|
+
}
|
|
236
|
+
return t20;
|
|
21
237
|
}
|
|
22
238
|
export default Sheet;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type OverlayLayer } from "./overlay.store.js";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Mount once at the app root, inside the theme and gesture roots.
|
|
5
|
+
* Every Dialog.Sheet, Confirmation, ActionSheet, picker and toast renders
|
|
6
|
+
* here, in the same native window as the screen.
|
|
7
|
+
*/
|
|
8
|
+
export declare function OverlayHost({ children }: {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
export interface OverlayPortalProps {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
layer?: OverlayLayer;
|
|
14
|
+
onBack?: () => boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Sends its children to the OverlayHost. Without a host (tests, isolated
|
|
18
|
+
* stories) it renders in place so the content stays reachable.
|
|
19
|
+
*
|
|
20
|
+
* Content rendered in the host sees the providers above the host, not the
|
|
21
|
+
* screen-level providers around the portal. Pass what it needs as props.
|
|
22
|
+
*/
|
|
23
|
+
export declare function OverlayPortal({ children, layer, onBack }: OverlayPortalProps): ReactNode;
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { overlayStore } from "./overlay.store.js";
|
|
3
|
+
import { useEffect, useEffectEvent, useId, useLayoutEffect, useSyncExternalStore } from "react";
|
|
4
|
+
import { BackHandler, StyleSheet, View } from "react-native";
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
6
|
+
const styles = StyleSheet.create({
|
|
7
|
+
root: {
|
|
8
|
+
flex: 1
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Mount once at the app root, inside the theme and gesture roots.
|
|
14
|
+
* Every Dialog.Sheet, Confirmation, ActionSheet, picker and toast renders
|
|
15
|
+
* here, in the same native window as the screen.
|
|
16
|
+
*/
|
|
17
|
+
export function OverlayHost(t0) {
|
|
18
|
+
const $ = _c(17);
|
|
19
|
+
const {
|
|
20
|
+
children
|
|
21
|
+
} = t0;
|
|
22
|
+
const entries = useSyncExternalStore(overlayStore.subscribe, overlayStore.entries, overlayStore.entries);
|
|
23
|
+
let t1;
|
|
24
|
+
if ($[0] !== entries) {
|
|
25
|
+
t1 = entries.some(_temp);
|
|
26
|
+
$[0] = entries;
|
|
27
|
+
$[1] = t1;
|
|
28
|
+
} else {
|
|
29
|
+
t1 = $[1];
|
|
30
|
+
}
|
|
31
|
+
const blocking = t1;
|
|
32
|
+
let t2;
|
|
33
|
+
if ($[2] !== entries) {
|
|
34
|
+
t2 = entries.some(_temp2);
|
|
35
|
+
$[2] = entries;
|
|
36
|
+
$[3] = t2;
|
|
37
|
+
} else {
|
|
38
|
+
t2 = $[3];
|
|
39
|
+
}
|
|
40
|
+
const handlesBack = t2;
|
|
41
|
+
let t3;
|
|
42
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
43
|
+
t3 = [];
|
|
44
|
+
$[4] = t3;
|
|
45
|
+
} else {
|
|
46
|
+
t3 = $[4];
|
|
47
|
+
}
|
|
48
|
+
useLayoutEffect(_temp3, t3);
|
|
49
|
+
let t4;
|
|
50
|
+
let t5;
|
|
51
|
+
if ($[5] !== handlesBack) {
|
|
52
|
+
t4 = () => {
|
|
53
|
+
if (!handlesBack) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const subscription = BackHandler.addEventListener("hardwareBackPress", _temp4);
|
|
57
|
+
return () => subscription.remove();
|
|
58
|
+
};
|
|
59
|
+
t5 = [handlesBack];
|
|
60
|
+
$[5] = handlesBack;
|
|
61
|
+
$[6] = t4;
|
|
62
|
+
$[7] = t5;
|
|
63
|
+
} else {
|
|
64
|
+
t4 = $[6];
|
|
65
|
+
t5 = $[7];
|
|
66
|
+
}
|
|
67
|
+
useEffect(t4, t5);
|
|
68
|
+
const t6 = blocking ? "no-hide-descendants" : "auto";
|
|
69
|
+
let t7;
|
|
70
|
+
if ($[8] !== blocking || $[9] !== children || $[10] !== t6) {
|
|
71
|
+
t7 = _jsx(View, {
|
|
72
|
+
accessibilityElementsHidden: blocking,
|
|
73
|
+
importantForAccessibility: t6,
|
|
74
|
+
style: styles.root,
|
|
75
|
+
children: children
|
|
76
|
+
});
|
|
77
|
+
$[8] = blocking;
|
|
78
|
+
$[9] = children;
|
|
79
|
+
$[10] = t6;
|
|
80
|
+
$[11] = t7;
|
|
81
|
+
} else {
|
|
82
|
+
t7 = $[11];
|
|
83
|
+
}
|
|
84
|
+
let t8;
|
|
85
|
+
if ($[12] !== entries) {
|
|
86
|
+
t8 = entries.map(_temp5);
|
|
87
|
+
$[12] = entries;
|
|
88
|
+
$[13] = t8;
|
|
89
|
+
} else {
|
|
90
|
+
t8 = $[13];
|
|
91
|
+
}
|
|
92
|
+
let t9;
|
|
93
|
+
if ($[14] !== t7 || $[15] !== t8) {
|
|
94
|
+
t9 = _jsxs(View, {
|
|
95
|
+
style: styles.root,
|
|
96
|
+
children: [t7, t8]
|
|
97
|
+
});
|
|
98
|
+
$[14] = t7;
|
|
99
|
+
$[15] = t8;
|
|
100
|
+
$[16] = t9;
|
|
101
|
+
} else {
|
|
102
|
+
t9 = $[16];
|
|
103
|
+
}
|
|
104
|
+
return t9;
|
|
105
|
+
}
|
|
106
|
+
function _temp5(entry_1) {
|
|
107
|
+
return _jsx(View, {
|
|
108
|
+
pointerEvents: "box-none",
|
|
109
|
+
style: StyleSheet.absoluteFill,
|
|
110
|
+
children: entry_1.element
|
|
111
|
+
}, entry_1.key);
|
|
112
|
+
}
|
|
113
|
+
function _temp4() {
|
|
114
|
+
return overlayStore.handleBack();
|
|
115
|
+
}
|
|
116
|
+
function _temp3() {
|
|
117
|
+
return overlayStore.attachHost();
|
|
118
|
+
}
|
|
119
|
+
function _temp2(entry_0) {
|
|
120
|
+
return entry_0.onBack;
|
|
121
|
+
}
|
|
122
|
+
function _temp(entry) {
|
|
123
|
+
return entry.layer === "sheet";
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Sends its children to the OverlayHost. Without a host (tests, isolated
|
|
127
|
+
* stories) it renders in place so the content stays reachable.
|
|
128
|
+
*
|
|
129
|
+
* Content rendered in the host sees the providers above the host, not the
|
|
130
|
+
* screen-level providers around the portal. Pass what it needs as props.
|
|
131
|
+
*/
|
|
132
|
+
export function OverlayPortal(t0) {
|
|
133
|
+
const $ = _c(13);
|
|
134
|
+
const {
|
|
135
|
+
children,
|
|
136
|
+
layer: t1,
|
|
137
|
+
onBack
|
|
138
|
+
} = t0;
|
|
139
|
+
const layer = t1 === undefined ? "sheet" : t1;
|
|
140
|
+
const key = useId();
|
|
141
|
+
const hosted = useSyncExternalStore(overlayStore.subscribe, overlayStore.hasHost, overlayStore.hasHost);
|
|
142
|
+
let t2;
|
|
143
|
+
if ($[0] !== onBack) {
|
|
144
|
+
t2 = () => onBack?.() ?? false;
|
|
145
|
+
$[0] = onBack;
|
|
146
|
+
$[1] = t2;
|
|
147
|
+
} else {
|
|
148
|
+
t2 = $[1];
|
|
149
|
+
}
|
|
150
|
+
const back = useEffectEvent(t2);
|
|
151
|
+
const listensToBack = onBack !== undefined;
|
|
152
|
+
let t3;
|
|
153
|
+
if ($[2] !== back || $[3] !== children || $[4] !== hosted || $[5] !== key || $[6] !== layer || $[7] !== listensToBack) {
|
|
154
|
+
t3 = () => {
|
|
155
|
+
if (!hosted) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
overlayStore.upsert({
|
|
159
|
+
key,
|
|
160
|
+
layer,
|
|
161
|
+
element: children,
|
|
162
|
+
onBack: listensToBack ? () => back() : undefined
|
|
163
|
+
});
|
|
164
|
+
};
|
|
165
|
+
$[2] = back;
|
|
166
|
+
$[3] = children;
|
|
167
|
+
$[4] = hosted;
|
|
168
|
+
$[5] = key;
|
|
169
|
+
$[6] = layer;
|
|
170
|
+
$[7] = listensToBack;
|
|
171
|
+
$[8] = t3;
|
|
172
|
+
} else {
|
|
173
|
+
t3 = $[8];
|
|
174
|
+
}
|
|
175
|
+
useLayoutEffect(t3);
|
|
176
|
+
let t4;
|
|
177
|
+
let t5;
|
|
178
|
+
if ($[9] !== hosted || $[10] !== key) {
|
|
179
|
+
t4 = () => {
|
|
180
|
+
if (!hosted) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
return () => overlayStore.remove(key);
|
|
184
|
+
};
|
|
185
|
+
t5 = [hosted, key];
|
|
186
|
+
$[9] = hosted;
|
|
187
|
+
$[10] = key;
|
|
188
|
+
$[11] = t4;
|
|
189
|
+
$[12] = t5;
|
|
190
|
+
} else {
|
|
191
|
+
t4 = $[11];
|
|
192
|
+
t5 = $[12];
|
|
193
|
+
}
|
|
194
|
+
useLayoutEffect(t4, t5);
|
|
195
|
+
return hosted ? null : children;
|
|
196
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export type SnapPoint = string | number;
|
|
3
|
+
export declare function resolveSnapPoint(point: SnapPoint, windowHeight: number): number;
|
|
4
|
+
export interface SheetSurfaceProps {
|
|
5
|
+
/** `false` starts the exit animation. */
|
|
6
|
+
visible: boolean;
|
|
7
|
+
snapPoints: SnapPoint[];
|
|
8
|
+
dismissible: boolean;
|
|
9
|
+
/** The user asked to close: backdrop, drag or accessibility escape. */
|
|
10
|
+
onRequestClose: () => void;
|
|
11
|
+
/** The exit animation finished and the surface can unmount. */
|
|
12
|
+
onExited: () => void;
|
|
13
|
+
/** Drag area at the top of the panel. */
|
|
14
|
+
header: ReactNode;
|
|
15
|
+
/** Actions pinned to the visible bottom of the sheet at every snap point. */
|
|
16
|
+
footer?: ReactNode;
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
testID?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Bottom sheet drawn in the app window. While it exits it ignores touches,
|
|
22
|
+
* so a tap during the close animation never lands on a view that unmounts.
|
|
23
|
+
*/
|
|
24
|
+
export declare function SheetSurface({ visible, snapPoints, dismissible, onRequestClose, onExited, header, footer, children, testID, }: SheetSurfaceProps): import("react").JSX.Element;
|