@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,11 +1,25 @@
|
|
|
1
1
|
import type { Ref } from "react";
|
|
2
2
|
import { type TextInputInstance, type TextInputProps } from "react-native";
|
|
3
|
-
interface FormInputProps extends TextInputProps {
|
|
3
|
+
export interface FormInputProps extends Omit<TextInputProps, "secureTextEntry"> {
|
|
4
4
|
ref?: Ref<TextInputInstance>;
|
|
5
|
-
label
|
|
5
|
+
label?: string;
|
|
6
6
|
error?: string;
|
|
7
7
|
tooltip?: string;
|
|
8
|
+
/** `card` (default) or `outline`. Same behavior; see the class tables above. */
|
|
9
|
+
look?: "card" | "outline";
|
|
10
|
+
/** Hides the text and shows a toggle to reveal it (passwords, PINs typed as text). */
|
|
11
|
+
secure?: boolean;
|
|
12
|
+
/** Classes of the wrapper (spacing, width). */
|
|
8
13
|
className?: string;
|
|
9
14
|
}
|
|
10
|
-
|
|
15
|
+
/**
|
|
16
|
+
* The text field of the DS. One behavior (label, focus and error states, accessibility,
|
|
17
|
+
* secure toggle) with two looks:
|
|
18
|
+
*
|
|
19
|
+
* | look | label | field | bottom space |
|
|
20
|
+
* | --------- | ---------------------- | --------------------------------------- | ------------ |
|
|
21
|
+
* | `card` | bodySmall, semibold | card surface, rounded-lg, ≥48 | 8 |
|
|
22
|
+
* | `outline` | bodyLarge | border only, rounded, 44 high | 16 |
|
|
23
|
+
*/
|
|
24
|
+
declare function FormInput({ label, error, tooltip, look, secure, style, multiline, numberOfLines, onFocus, onBlur, className, ref, ...props }: FormInputProps): import("react").JSX.Element;
|
|
11
25
|
export default FormInput;
|
package/dist/Form/Form.Input.js
CHANGED
|
@@ -1,38 +1,487 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { Display } from "../Display/index.js";
|
|
3
|
+
import { inputTextStyle } from "./input-text.js";
|
|
4
|
+
import { useTheme } from "../theme/index.js";
|
|
3
5
|
import { cn, tv } from "../theme/tw.js";
|
|
4
6
|
import { Typography } from "../Typography/index.js";
|
|
5
7
|
import { useState } from "react";
|
|
6
|
-
import { TextInput, View } from "react-native";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
import { TextInput, TouchableOpacity, View } from "react-native";
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
10
|
+
// `card`: filled surface, the default of forms built with the DS. Same box as the
|
|
11
|
+
// Select, DatePicker, PickerField and Dropdown triggers.
|
|
12
|
+
const cardBox = tv({
|
|
13
|
+
base: "rounded-lg bg-bg-card",
|
|
14
|
+
variants: {
|
|
15
|
+
state: {
|
|
16
|
+
error: "border-2 border-danger",
|
|
17
|
+
focused: "border-2 border-border-focus",
|
|
18
|
+
default: "border border-input"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
state: "default"
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// `outline`: bordered input without surface, the look of the access forms
|
|
27
|
+
// (login, server, reset). The border lives on the TextInput, so the height is 44.
|
|
28
|
+
const outlineInput = tv({
|
|
29
|
+
base: "h-11 text-text-primary rounded p-2",
|
|
30
|
+
variants: {
|
|
31
|
+
state: {
|
|
32
|
+
error: "border-2 border-danger",
|
|
33
|
+
focused: "border-2 border-border-focus",
|
|
34
|
+
default: "border border-input"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
defaultVariants: {
|
|
38
|
+
state: "default"
|
|
39
|
+
}
|
|
17
40
|
});
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
41
|
+
function SecureToggle(t0) {
|
|
42
|
+
const $ = _c(8);
|
|
43
|
+
const {
|
|
44
|
+
visible,
|
|
45
|
+
onToggle,
|
|
46
|
+
className
|
|
47
|
+
} = t0;
|
|
48
|
+
const theme = useTheme();
|
|
49
|
+
const t1 = visible ? "Ocultar contrase\xF1a" : "Mostrar contrase\xF1a";
|
|
50
|
+
const t2 = visible ? "hidden" : "visibility";
|
|
51
|
+
let t3;
|
|
52
|
+
if ($[0] !== t2 || $[1] !== theme.text.primary) {
|
|
53
|
+
t3 = _jsx(Display.Icon, {
|
|
54
|
+
color: theme.text.primary,
|
|
55
|
+
name: t2,
|
|
56
|
+
size: 22
|
|
57
|
+
});
|
|
58
|
+
$[0] = t2;
|
|
59
|
+
$[1] = theme.text.primary;
|
|
60
|
+
$[2] = t3;
|
|
61
|
+
} else {
|
|
62
|
+
t3 = $[2];
|
|
63
|
+
}
|
|
64
|
+
let t4;
|
|
65
|
+
if ($[3] !== className || $[4] !== onToggle || $[5] !== t1 || $[6] !== t3) {
|
|
66
|
+
t4 = _jsx(TouchableOpacity, {
|
|
67
|
+
accessibilityLabel: t1,
|
|
68
|
+
accessibilityRole: "button",
|
|
69
|
+
className: className,
|
|
70
|
+
hitSlop: 8,
|
|
71
|
+
onPress: onToggle,
|
|
72
|
+
children: t3
|
|
73
|
+
});
|
|
74
|
+
$[3] = className;
|
|
75
|
+
$[4] = onToggle;
|
|
76
|
+
$[5] = t1;
|
|
77
|
+
$[6] = t3;
|
|
78
|
+
$[7] = t4;
|
|
79
|
+
} else {
|
|
80
|
+
t4 = $[7];
|
|
81
|
+
}
|
|
82
|
+
return t4;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* The text field of the DS. One behavior (label, focus and error states, accessibility,
|
|
87
|
+
* secure toggle) with two looks:
|
|
88
|
+
*
|
|
89
|
+
* | look | label | field | bottom space |
|
|
90
|
+
* | --------- | ---------------------- | --------------------------------------- | ------------ |
|
|
91
|
+
* | `card` | bodySmall, semibold | card surface, rounded-lg, ≥48 | 8 |
|
|
92
|
+
* | `outline` | bodyLarge | border only, rounded, 44 high | 16 |
|
|
93
|
+
*/
|
|
94
|
+
function FormInput(t0) {
|
|
95
|
+
const $ = _c(94);
|
|
96
|
+
let className;
|
|
97
|
+
let error;
|
|
98
|
+
let label;
|
|
99
|
+
let onBlur;
|
|
100
|
+
let onFocus;
|
|
101
|
+
let props;
|
|
102
|
+
let ref;
|
|
103
|
+
let style;
|
|
104
|
+
let t1;
|
|
105
|
+
let t2;
|
|
106
|
+
let t3;
|
|
107
|
+
let t4;
|
|
108
|
+
let tooltip;
|
|
109
|
+
if ($[0] !== t0) {
|
|
110
|
+
({
|
|
111
|
+
label,
|
|
112
|
+
error,
|
|
113
|
+
tooltip,
|
|
114
|
+
look: t1,
|
|
115
|
+
secure: t2,
|
|
116
|
+
style,
|
|
117
|
+
multiline: t3,
|
|
118
|
+
numberOfLines: t4,
|
|
119
|
+
onFocus,
|
|
120
|
+
onBlur,
|
|
121
|
+
className,
|
|
122
|
+
ref,
|
|
123
|
+
...props
|
|
124
|
+
} = t0);
|
|
125
|
+
$[0] = t0;
|
|
126
|
+
$[1] = className;
|
|
127
|
+
$[2] = error;
|
|
128
|
+
$[3] = label;
|
|
129
|
+
$[4] = onBlur;
|
|
130
|
+
$[5] = onFocus;
|
|
131
|
+
$[6] = props;
|
|
132
|
+
$[7] = ref;
|
|
133
|
+
$[8] = style;
|
|
134
|
+
$[9] = t1;
|
|
135
|
+
$[10] = t2;
|
|
136
|
+
$[11] = t3;
|
|
137
|
+
$[12] = t4;
|
|
138
|
+
$[13] = tooltip;
|
|
139
|
+
} else {
|
|
140
|
+
className = $[1];
|
|
141
|
+
error = $[2];
|
|
142
|
+
label = $[3];
|
|
143
|
+
onBlur = $[4];
|
|
144
|
+
onFocus = $[5];
|
|
145
|
+
props = $[6];
|
|
146
|
+
ref = $[7];
|
|
147
|
+
style = $[8];
|
|
148
|
+
t1 = $[9];
|
|
149
|
+
t2 = $[10];
|
|
150
|
+
t3 = $[11];
|
|
151
|
+
t4 = $[12];
|
|
152
|
+
tooltip = $[13];
|
|
153
|
+
}
|
|
154
|
+
const look = t1 === undefined ? "card" : t1;
|
|
155
|
+
const secure = t2 === undefined ? false : t2;
|
|
156
|
+
const multiline = t3 === undefined ? false : t3;
|
|
157
|
+
const numberOfLines = t4 === undefined ? 1 : t4;
|
|
158
|
+
const theme = useTheme();
|
|
159
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
160
|
+
const [revealed, setRevealed] = useState(false);
|
|
161
|
+
const hasError = Boolean(error);
|
|
162
|
+
const state = hasError ? "error" : isFocused ? "focused" : "default";
|
|
163
|
+
let t5;
|
|
164
|
+
if ($[14] !== onFocus) {
|
|
165
|
+
t5 = e => {
|
|
166
|
+
setIsFocused(true);
|
|
167
|
+
onFocus?.(e);
|
|
168
|
+
};
|
|
169
|
+
$[14] = onFocus;
|
|
170
|
+
$[15] = t5;
|
|
171
|
+
} else {
|
|
172
|
+
t5 = $[15];
|
|
173
|
+
}
|
|
174
|
+
const handleFocus = t5;
|
|
175
|
+
let t6;
|
|
176
|
+
if ($[16] !== onBlur) {
|
|
177
|
+
t6 = e_0 => {
|
|
178
|
+
setIsFocused(false);
|
|
179
|
+
onBlur?.(e_0);
|
|
24
180
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
181
|
+
$[16] = onBlur;
|
|
182
|
+
$[17] = t6;
|
|
183
|
+
} else {
|
|
184
|
+
t6 = $[17];
|
|
185
|
+
}
|
|
186
|
+
const handleBlur = t6;
|
|
187
|
+
let t7;
|
|
188
|
+
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
189
|
+
t7 = () => setRevealed(_temp);
|
|
190
|
+
$[18] = t7;
|
|
191
|
+
} else {
|
|
192
|
+
t7 = $[18];
|
|
193
|
+
}
|
|
194
|
+
const toggle = t7;
|
|
195
|
+
const t8 = error || tooltip;
|
|
196
|
+
const t9 = secure && !revealed;
|
|
197
|
+
let t10;
|
|
198
|
+
if ($[19] !== handleBlur || $[20] !== handleFocus || $[21] !== label || $[22] !== ref || $[23] !== t8 || $[24] !== t9 || $[25] !== theme.primary || $[26] !== theme.text.tertiary) {
|
|
199
|
+
t10 = {
|
|
200
|
+
accessibilityHint: t8,
|
|
201
|
+
accessibilityLabel: label,
|
|
202
|
+
onBlur: handleBlur,
|
|
203
|
+
onFocus: handleFocus,
|
|
204
|
+
placeholderTextColor: theme.text.tertiary,
|
|
205
|
+
ref,
|
|
206
|
+
secureTextEntry: t9,
|
|
207
|
+
selectionColor: theme.primary,
|
|
208
|
+
underlineColorAndroid: "transparent"
|
|
28
209
|
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
210
|
+
$[19] = handleBlur;
|
|
211
|
+
$[20] = handleFocus;
|
|
212
|
+
$[21] = label;
|
|
213
|
+
$[22] = ref;
|
|
214
|
+
$[23] = t8;
|
|
215
|
+
$[24] = t9;
|
|
216
|
+
$[25] = theme.primary;
|
|
217
|
+
$[26] = theme.text.tertiary;
|
|
218
|
+
$[27] = t10;
|
|
219
|
+
} else {
|
|
220
|
+
t10 = $[27];
|
|
221
|
+
}
|
|
222
|
+
const shared = t10;
|
|
223
|
+
let t11;
|
|
224
|
+
if ($[28] !== error || $[29] !== hasError || $[30] !== look) {
|
|
225
|
+
t11 = hasError ? _jsx(Typography.Text, {
|
|
226
|
+
accessibilityLiveRegion: "polite",
|
|
227
|
+
className: look === "card" ? "mt-0.5 text-danger" : "mt-1 text-danger",
|
|
228
|
+
variant: "bodySmall",
|
|
229
|
+
children: error
|
|
230
|
+
}) : null;
|
|
231
|
+
$[28] = error;
|
|
232
|
+
$[29] = hasError;
|
|
233
|
+
$[30] = look;
|
|
234
|
+
$[31] = t11;
|
|
235
|
+
} else {
|
|
236
|
+
t11 = $[31];
|
|
237
|
+
}
|
|
238
|
+
const errorText = t11;
|
|
239
|
+
if (look === "outline") {
|
|
240
|
+
let t12;
|
|
241
|
+
if ($[32] !== className) {
|
|
242
|
+
t12 = cn("mb-4", className);
|
|
243
|
+
$[32] = className;
|
|
244
|
+
$[33] = t12;
|
|
245
|
+
} else {
|
|
246
|
+
t12 = $[33];
|
|
247
|
+
}
|
|
248
|
+
let t13;
|
|
249
|
+
if ($[34] !== label) {
|
|
250
|
+
t13 = label ? _jsx(Typography.Text, {
|
|
251
|
+
className: "mb-1",
|
|
252
|
+
variant: "bodyLarge",
|
|
253
|
+
children: label
|
|
254
|
+
}) : null;
|
|
255
|
+
$[34] = label;
|
|
256
|
+
$[35] = t13;
|
|
257
|
+
} else {
|
|
258
|
+
t13 = $[35];
|
|
259
|
+
}
|
|
260
|
+
let t14;
|
|
261
|
+
if ($[36] !== state) {
|
|
262
|
+
t14 = outlineInput({
|
|
263
|
+
state
|
|
264
|
+
});
|
|
265
|
+
$[36] = state;
|
|
266
|
+
$[37] = t14;
|
|
267
|
+
} else {
|
|
268
|
+
t14 = $[37];
|
|
269
|
+
}
|
|
270
|
+
let t15;
|
|
271
|
+
if ($[38] === Symbol.for("react.memo_cache_sentinel")) {
|
|
272
|
+
t15 = inputTextStyle();
|
|
273
|
+
$[38] = t15;
|
|
274
|
+
} else {
|
|
275
|
+
t15 = $[38];
|
|
276
|
+
}
|
|
277
|
+
let t16;
|
|
278
|
+
if ($[39] !== style) {
|
|
279
|
+
t16 = [t15, style];
|
|
280
|
+
$[39] = style;
|
|
281
|
+
$[40] = t16;
|
|
282
|
+
} else {
|
|
283
|
+
t16 = $[40];
|
|
284
|
+
}
|
|
285
|
+
let t17;
|
|
286
|
+
if ($[41] !== multiline || $[42] !== numberOfLines || $[43] !== props || $[44] !== shared || $[45] !== t14 || $[46] !== t16) {
|
|
287
|
+
t17 = _jsx(TextInput, {
|
|
288
|
+
className: t14,
|
|
289
|
+
multiline: multiline,
|
|
290
|
+
numberOfLines: numberOfLines,
|
|
291
|
+
style: t16,
|
|
292
|
+
...shared,
|
|
293
|
+
...props
|
|
294
|
+
});
|
|
295
|
+
$[41] = multiline;
|
|
296
|
+
$[42] = numberOfLines;
|
|
297
|
+
$[43] = props;
|
|
298
|
+
$[44] = shared;
|
|
299
|
+
$[45] = t14;
|
|
300
|
+
$[46] = t16;
|
|
301
|
+
$[47] = t17;
|
|
302
|
+
} else {
|
|
303
|
+
t17 = $[47];
|
|
304
|
+
}
|
|
305
|
+
let t18;
|
|
306
|
+
if ($[48] !== errorText || $[49] !== t12 || $[50] !== t13 || $[51] !== t17) {
|
|
307
|
+
t18 = _jsxs(View, {
|
|
308
|
+
className: t12,
|
|
309
|
+
children: [t13, t17, errorText]
|
|
310
|
+
});
|
|
311
|
+
$[48] = errorText;
|
|
312
|
+
$[49] = t12;
|
|
313
|
+
$[50] = t13;
|
|
314
|
+
$[51] = t17;
|
|
315
|
+
$[52] = t18;
|
|
316
|
+
} else {
|
|
317
|
+
t18 = $[52];
|
|
318
|
+
}
|
|
319
|
+
const field = t18;
|
|
320
|
+
if (!secure) {
|
|
321
|
+
return field;
|
|
322
|
+
}
|
|
323
|
+
let t19;
|
|
324
|
+
if ($[53] !== revealed) {
|
|
325
|
+
t19 = _jsx(SecureToggle, {
|
|
326
|
+
className: "absolute right-3 bottom-[25px]",
|
|
327
|
+
onToggle: toggle,
|
|
328
|
+
visible: revealed
|
|
329
|
+
});
|
|
330
|
+
$[53] = revealed;
|
|
331
|
+
$[54] = t19;
|
|
332
|
+
} else {
|
|
333
|
+
t19 = $[54];
|
|
334
|
+
}
|
|
335
|
+
let t20;
|
|
336
|
+
if ($[55] !== field || $[56] !== t19) {
|
|
337
|
+
t20 = _jsxs(View, {
|
|
338
|
+
className: "mb-4 relative",
|
|
339
|
+
children: [field, t19]
|
|
340
|
+
});
|
|
341
|
+
$[55] = field;
|
|
342
|
+
$[56] = t19;
|
|
343
|
+
$[57] = t20;
|
|
344
|
+
} else {
|
|
345
|
+
t20 = $[57];
|
|
346
|
+
}
|
|
347
|
+
return t20;
|
|
348
|
+
}
|
|
349
|
+
let t12;
|
|
350
|
+
if ($[58] !== className) {
|
|
351
|
+
t12 = cn("mb-2", className);
|
|
352
|
+
$[58] = className;
|
|
353
|
+
$[59] = t12;
|
|
354
|
+
} else {
|
|
355
|
+
t12 = $[59];
|
|
356
|
+
}
|
|
357
|
+
let t13;
|
|
358
|
+
if ($[60] !== label) {
|
|
359
|
+
t13 = label ? _jsx(Typography.Text, {
|
|
360
|
+
className: "mb-1 text-text-primary",
|
|
361
|
+
semibold: true,
|
|
362
|
+
variant: "bodySmall",
|
|
363
|
+
children: label
|
|
364
|
+
}) : null;
|
|
365
|
+
$[60] = label;
|
|
366
|
+
$[61] = t13;
|
|
367
|
+
} else {
|
|
368
|
+
t13 = $[61];
|
|
369
|
+
}
|
|
370
|
+
let t14;
|
|
371
|
+
if ($[62] !== secure || $[63] !== state) {
|
|
372
|
+
t14 = cn(cardBox({
|
|
373
|
+
state
|
|
374
|
+
}), secure && "flex-row items-center");
|
|
375
|
+
$[62] = secure;
|
|
376
|
+
$[63] = state;
|
|
377
|
+
$[64] = t14;
|
|
378
|
+
} else {
|
|
379
|
+
t14 = $[64];
|
|
380
|
+
}
|
|
381
|
+
const t15 = multiline && "min-h-[64px] pt-2.5";
|
|
382
|
+
const t16 = secure && "flex-1";
|
|
383
|
+
let t17;
|
|
384
|
+
if ($[65] !== t15 || $[66] !== t16) {
|
|
385
|
+
t17 = cn("px-3 py-2.5 min-h-[48px] text-text-primary", t15, t16);
|
|
386
|
+
$[65] = t15;
|
|
387
|
+
$[66] = t16;
|
|
388
|
+
$[67] = t17;
|
|
389
|
+
} else {
|
|
390
|
+
t17 = $[67];
|
|
391
|
+
}
|
|
392
|
+
let t18;
|
|
393
|
+
if ($[68] === Symbol.for("react.memo_cache_sentinel")) {
|
|
394
|
+
t18 = inputTextStyle();
|
|
395
|
+
$[68] = t18;
|
|
396
|
+
} else {
|
|
397
|
+
t18 = $[68];
|
|
398
|
+
}
|
|
399
|
+
const t19 = multiline ? 64 : 48;
|
|
400
|
+
let t20;
|
|
401
|
+
if ($[69] !== t19) {
|
|
402
|
+
t20 = {
|
|
403
|
+
minHeight: t19
|
|
35
404
|
};
|
|
36
|
-
|
|
405
|
+
$[69] = t19;
|
|
406
|
+
$[70] = t20;
|
|
407
|
+
} else {
|
|
408
|
+
t20 = $[70];
|
|
409
|
+
}
|
|
410
|
+
let t21;
|
|
411
|
+
if ($[71] !== style || $[72] !== t20) {
|
|
412
|
+
t21 = [t18, t20, style];
|
|
413
|
+
$[71] = style;
|
|
414
|
+
$[72] = t20;
|
|
415
|
+
$[73] = t21;
|
|
416
|
+
} else {
|
|
417
|
+
t21 = $[73];
|
|
418
|
+
}
|
|
419
|
+
const t22 = multiline ? "top" : "center";
|
|
420
|
+
let t23;
|
|
421
|
+
if ($[74] !== multiline || $[75] !== numberOfLines || $[76] !== props || $[77] !== shared || $[78] !== t17 || $[79] !== t21 || $[80] !== t22) {
|
|
422
|
+
t23 = _jsx(TextInput, {
|
|
423
|
+
className: t17,
|
|
424
|
+
multiline: multiline,
|
|
425
|
+
numberOfLines: numberOfLines,
|
|
426
|
+
style: t21,
|
|
427
|
+
textAlignVertical: t22,
|
|
428
|
+
...shared,
|
|
429
|
+
...props
|
|
430
|
+
});
|
|
431
|
+
$[74] = multiline;
|
|
432
|
+
$[75] = numberOfLines;
|
|
433
|
+
$[76] = props;
|
|
434
|
+
$[77] = shared;
|
|
435
|
+
$[78] = t17;
|
|
436
|
+
$[79] = t21;
|
|
437
|
+
$[80] = t22;
|
|
438
|
+
$[81] = t23;
|
|
439
|
+
} else {
|
|
440
|
+
t23 = $[81];
|
|
441
|
+
}
|
|
442
|
+
let t24;
|
|
443
|
+
if ($[82] !== revealed || $[83] !== secure) {
|
|
444
|
+
t24 = secure ? _jsx(SecureToggle, {
|
|
445
|
+
className: "px-3",
|
|
446
|
+
onToggle: toggle,
|
|
447
|
+
visible: revealed
|
|
448
|
+
}) : null;
|
|
449
|
+
$[82] = revealed;
|
|
450
|
+
$[83] = secure;
|
|
451
|
+
$[84] = t24;
|
|
452
|
+
} else {
|
|
453
|
+
t24 = $[84];
|
|
454
|
+
}
|
|
455
|
+
let t25;
|
|
456
|
+
if ($[85] !== t14 || $[86] !== t23 || $[87] !== t24) {
|
|
457
|
+
t25 = _jsxs(View, {
|
|
458
|
+
className: t14,
|
|
459
|
+
children: [t23, t24]
|
|
460
|
+
});
|
|
461
|
+
$[85] = t14;
|
|
462
|
+
$[86] = t23;
|
|
463
|
+
$[87] = t24;
|
|
464
|
+
$[88] = t25;
|
|
465
|
+
} else {
|
|
466
|
+
t25 = $[88];
|
|
467
|
+
}
|
|
468
|
+
let t26;
|
|
469
|
+
if ($[89] !== errorText || $[90] !== t12 || $[91] !== t13 || $[92] !== t25) {
|
|
470
|
+
t26 = _jsxs(View, {
|
|
471
|
+
className: t12,
|
|
472
|
+
children: [t13, t25, errorText]
|
|
473
|
+
});
|
|
474
|
+
$[89] = errorText;
|
|
475
|
+
$[90] = t12;
|
|
476
|
+
$[91] = t13;
|
|
477
|
+
$[92] = t25;
|
|
478
|
+
$[93] = t26;
|
|
479
|
+
} else {
|
|
480
|
+
t26 = $[93];
|
|
481
|
+
}
|
|
482
|
+
return t26;
|
|
483
|
+
}
|
|
484
|
+
function _temp(value) {
|
|
485
|
+
return !value;
|
|
37
486
|
}
|
|
38
487
|
export default FormInput;
|
|
@@ -1,11 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type
|
|
3
|
-
|
|
4
|
-
export interface KeyboardFormProps extends KeyboardAwareScrollViewProps {
|
|
1
|
+
import type { ReactElement, ReactNode } from "react";
|
|
2
|
+
import { type RefreshControlProps, type StyleProp, type ViewStyle } from "react-native";
|
|
3
|
+
export interface KeyboardFormProps {
|
|
5
4
|
children: ReactNode;
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
/** Overrides the computed space below the focused input. */
|
|
6
|
+
bottomOffset?: number;
|
|
7
|
+
/** Height of a footer that stays above the keyboard, such as a sticky action bar. */
|
|
8
8
|
stickyFooterHeight?: number;
|
|
9
|
-
|
|
9
|
+
style?: StyleProp<ViewStyle>;
|
|
10
|
+
contentContainerStyle?: StyleProp<ViewStyle>;
|
|
11
|
+
className?: string;
|
|
12
|
+
contentContainerClassName?: string;
|
|
13
|
+
keyboardShouldPersistTaps?: "always" | "handled" | "never";
|
|
14
|
+
showsVerticalScrollIndicator?: boolean;
|
|
15
|
+
bounces?: boolean;
|
|
16
|
+
refreshControl?: ReactElement<RefreshControlProps>;
|
|
17
|
+
/** iOS: let the system inset the content under large titles and NativeTabs. */
|
|
18
|
+
contentInsetAdjustmentBehavior?: "automatic" | "never";
|
|
19
|
+
testID?: string;
|
|
10
20
|
}
|
|
11
|
-
|
|
21
|
+
/**
|
|
22
|
+
* The one keyboard-aware scroll of a form. Its inputs form a toolbar group, so
|
|
23
|
+
* the global KeyboardToolbarHost moves focus only among them.
|
|
24
|
+
*/
|
|
25
|
+
export default function KeyboardForm({ children, bottomOffset, stickyFooterHeight, style, keyboardShouldPersistTaps, ...scroll }: KeyboardFormProps): import("react").JSX.Element;
|
|
@@ -1,9 +1,84 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { useKeyboardToolbarInset } from "./Form.KeyboardToolbarHost.js";
|
|
3
|
+
import { StyleSheet } from "react-native";
|
|
4
|
+
import { KeyboardAwareScrollView, KeyboardToolbar } from "react-native-keyboard-controller";
|
|
5
|
+
|
|
6
|
+
/** Space kept between the focused input and whatever sits above the keyboard. */
|
|
7
|
+
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
8
|
+
const FOCUS_GAP = 24;
|
|
9
|
+
/**
|
|
10
|
+
* The one keyboard-aware scroll of a form. Its inputs form a toolbar group, so
|
|
11
|
+
* the global KeyboardToolbarHost moves focus only among them.
|
|
12
|
+
*/
|
|
13
|
+
export default function KeyboardForm(t0) {
|
|
14
|
+
const $ = _c(15);
|
|
15
|
+
let bottomOffset;
|
|
16
|
+
let children;
|
|
17
|
+
let scroll;
|
|
18
|
+
let style;
|
|
19
|
+
let t1;
|
|
20
|
+
let t2;
|
|
21
|
+
if ($[0] !== t0) {
|
|
22
|
+
({
|
|
23
|
+
children,
|
|
24
|
+
bottomOffset,
|
|
25
|
+
stickyFooterHeight: t1,
|
|
26
|
+
style,
|
|
27
|
+
keyboardShouldPersistTaps: t2,
|
|
28
|
+
...scroll
|
|
29
|
+
} = t0);
|
|
30
|
+
$[0] = t0;
|
|
31
|
+
$[1] = bottomOffset;
|
|
32
|
+
$[2] = children;
|
|
33
|
+
$[3] = scroll;
|
|
34
|
+
$[4] = style;
|
|
35
|
+
$[5] = t1;
|
|
36
|
+
$[6] = t2;
|
|
37
|
+
} else {
|
|
38
|
+
bottomOffset = $[1];
|
|
39
|
+
children = $[2];
|
|
40
|
+
scroll = $[3];
|
|
41
|
+
style = $[4];
|
|
42
|
+
t1 = $[5];
|
|
43
|
+
t2 = $[6];
|
|
44
|
+
}
|
|
45
|
+
const stickyFooterHeight = t1 === undefined ? 0 : t1;
|
|
46
|
+
const keyboardShouldPersistTaps = t2 === undefined ? "handled" : t2;
|
|
47
|
+
const toolbarInset = useKeyboardToolbarInset();
|
|
48
|
+
const t3 = bottomOffset ?? stickyFooterHeight + toolbarInset + FOCUS_GAP;
|
|
49
|
+
let t4;
|
|
50
|
+
if ($[7] !== style) {
|
|
51
|
+
t4 = [styles.fill, style];
|
|
52
|
+
$[7] = style;
|
|
53
|
+
$[8] = t4;
|
|
54
|
+
} else {
|
|
55
|
+
t4 = $[8];
|
|
56
|
+
}
|
|
57
|
+
let t5;
|
|
58
|
+
if ($[9] !== children || $[10] !== keyboardShouldPersistTaps || $[11] !== scroll || $[12] !== t3 || $[13] !== t4) {
|
|
59
|
+
t5 = _jsx(KeyboardToolbar.Group, {
|
|
60
|
+
style: styles.fill,
|
|
61
|
+
children: _jsx(KeyboardAwareScrollView, {
|
|
62
|
+
bottomOffset: t3,
|
|
63
|
+
keyboardShouldPersistTaps: keyboardShouldPersistTaps,
|
|
64
|
+
style: t4,
|
|
65
|
+
...scroll,
|
|
66
|
+
children: children
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
$[9] = children;
|
|
70
|
+
$[10] = keyboardShouldPersistTaps;
|
|
71
|
+
$[11] = scroll;
|
|
72
|
+
$[12] = t3;
|
|
73
|
+
$[13] = t4;
|
|
74
|
+
$[14] = t5;
|
|
75
|
+
} else {
|
|
76
|
+
t5 = $[14];
|
|
77
|
+
}
|
|
78
|
+
return t5;
|
|
9
79
|
}
|
|
80
|
+
const styles = StyleSheet.create({
|
|
81
|
+
fill: {
|
|
82
|
+
flex: 1
|
|
83
|
+
}
|
|
84
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Space the global toolbar takes above the keyboard; 0 when it is off. */
|
|
2
|
+
export declare function useKeyboardToolbarInset(): number;
|
|
3
|
+
export interface KeyboardToolbarHostProps {
|
|
4
|
+
doneLabel?: string;
|
|
5
|
+
/** iOS convention: an accessory bar with previous / next / done. */
|
|
6
|
+
ios?: boolean;
|
|
7
|
+
/** Android convention is the IME action key; the bar is opt-in. */
|
|
8
|
+
android?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The only keyboard toolbar of the app. Mount it once inside KeyboardProvider.
|
|
12
|
+
* Each KeyboardForm and each sheet is a group, so previous / next stay inside it.
|
|
13
|
+
*/
|
|
14
|
+
export default function KeyboardToolbarHost({ doneLabel, ios, android, }: KeyboardToolbarHostProps): import("react").JSX.Element | null;
|