@sincpro/mobile-ui 3.0.1 → 3.2.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 +437 -62
- package/dist/Dialog/Dialog.Sheet.d.ts +7 -3
- package/dist/Dialog/Dialog.Sheet.js +267 -15
- package/dist/Dialog/OverlayHost.d.ts +24 -0
- package/dist/Dialog/OverlayHost.js +230 -0
- package/dist/Dialog/SheetSurface.d.ts +43 -0
- package/dist/Dialog/SheetSurface.js +495 -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 +148 -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 +15 -11
- package/dist/Display/icon-map.js +344 -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 +507 -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 +497 -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 +223 -0
- package/dist/Form/Form.MonetaryInput.js +164 -17
- package/dist/Form/Form.PickerField.d.ts +31 -0
- package/dist/Form/Form.PickerField.js +539 -0
- package/dist/Form/Form.PinInput.js +150 -15
- package/dist/Form/Form.QuantitySelector.js +229 -25
- package/dist/Form/Form.RadioButton.d.ts +1 -0
- package/dist/Form/Form.RadioButton.js +26 -29
- package/dist/Form/Form.Select.d.ts +2 -1
- package/dist/Form/Form.Select.js +388 -60
- package/dist/Form/Form.Slider.js +133 -10
- package/dist/Form/Form.Switch.js +99 -4
- package/dist/Form/choice-row.d.ts +15 -0
- package/dist/Form/choice-row.js +236 -0
- 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.d.ts +2 -0
- package/dist/theme/active.js +33 -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.d.ts +4 -0
- package/dist/theme/useTheme.js +7 -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 +6 -1
- 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
|
@@ -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;
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import Pressable from "../primitives/Pressable.js";
|
|
3
|
+
import { useTheme } from "../theme/index.js";
|
|
4
|
+
import { useLayoutEffect, useRef, useState, useSyncExternalStore } from "react";
|
|
5
|
+
import { Platform, StyleSheet, useWindowDimensions, View } from "react-native";
|
|
6
|
+
import { KeyboardToolbar } from "react-native-keyboard-controller";
|
|
7
|
+
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
8
|
+
/** keyboard-controller ships English labels; the app speaks Spanish. */
|
|
9
|
+
const LABELS = {
|
|
10
|
+
Previous: {
|
|
11
|
+
label: "Campo anterior",
|
|
12
|
+
hint: "Mueve el foco al campo anterior"
|
|
13
|
+
},
|
|
14
|
+
Next: {
|
|
15
|
+
label: "Campo siguiente",
|
|
16
|
+
hint: "Mueve el foco al campo siguiente"
|
|
17
|
+
},
|
|
18
|
+
Done: {
|
|
19
|
+
label: "Ocultar teclado",
|
|
20
|
+
hint: "Cierra el teclado"
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const ToolbarButton = t0 => {
|
|
24
|
+
const $ = _c(10);
|
|
25
|
+
const {
|
|
26
|
+
children,
|
|
27
|
+
onPress,
|
|
28
|
+
disabled: t1,
|
|
29
|
+
accessibilityLabel,
|
|
30
|
+
style,
|
|
31
|
+
testID
|
|
32
|
+
} = t0;
|
|
33
|
+
const disabled = t1 === undefined ? false : t1;
|
|
34
|
+
const copy = LABELS[accessibilityLabel];
|
|
35
|
+
const t2 = copy?.hint;
|
|
36
|
+
const t3 = copy?.label ?? accessibilityLabel;
|
|
37
|
+
let t4;
|
|
38
|
+
if ($[0] !== style) {
|
|
39
|
+
t4 = [styles.button, style];
|
|
40
|
+
$[0] = style;
|
|
41
|
+
$[1] = t4;
|
|
42
|
+
} else {
|
|
43
|
+
t4 = $[1];
|
|
44
|
+
}
|
|
45
|
+
let t5;
|
|
46
|
+
if ($[2] !== children || $[3] !== disabled || $[4] !== onPress || $[5] !== t2 || $[6] !== t3 || $[7] !== t4 || $[8] !== testID) {
|
|
47
|
+
t5 = _jsx(Pressable, {
|
|
48
|
+
accessibilityHint: t2,
|
|
49
|
+
accessibilityLabel: t3,
|
|
50
|
+
accessibilityRole: "button",
|
|
51
|
+
disabled: disabled,
|
|
52
|
+
onPress: onPress,
|
|
53
|
+
style: t4,
|
|
54
|
+
testID: testID,
|
|
55
|
+
children: children
|
|
56
|
+
});
|
|
57
|
+
$[2] = children;
|
|
58
|
+
$[3] = disabled;
|
|
59
|
+
$[4] = onPress;
|
|
60
|
+
$[5] = t2;
|
|
61
|
+
$[6] = t3;
|
|
62
|
+
$[7] = t4;
|
|
63
|
+
$[8] = testID;
|
|
64
|
+
$[9] = t5;
|
|
65
|
+
} else {
|
|
66
|
+
t5 = $[9];
|
|
67
|
+
}
|
|
68
|
+
return t5;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/** keyboard-controller draws its toolbar at this height (KEYBOARD_TOOLBAR_HEIGHT). */
|
|
72
|
+
const TOOLBAR_HEIGHT = 42;
|
|
73
|
+
let inset = 0;
|
|
74
|
+
const listeners = new Set();
|
|
75
|
+
function publish(next) {
|
|
76
|
+
if (inset === next) return;
|
|
77
|
+
inset = next;
|
|
78
|
+
for (const listener of [...listeners]) listener();
|
|
79
|
+
}
|
|
80
|
+
function subscribe(listener) {
|
|
81
|
+
listeners.add(listener);
|
|
82
|
+
return () => {
|
|
83
|
+
listeners.delete(listener);
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function readInset() {
|
|
87
|
+
return inset;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** Space the global toolbar takes above the keyboard; 0 when it is off. */
|
|
91
|
+
export function useKeyboardToolbarInset() {
|
|
92
|
+
return useSyncExternalStore(subscribe, readInset, readInset);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* The only keyboard toolbar of the app. Mount it once inside KeyboardProvider.
|
|
96
|
+
* Each KeyboardForm and each sheet is a group, so previous / next stay inside it.
|
|
97
|
+
*/
|
|
98
|
+
export default function KeyboardToolbarHost(t0) {
|
|
99
|
+
const $ = _c(21);
|
|
100
|
+
const {
|
|
101
|
+
doneLabel: t1,
|
|
102
|
+
ios: t2,
|
|
103
|
+
android: t3
|
|
104
|
+
} = t0;
|
|
105
|
+
const doneLabel = t1 === undefined ? "Listo" : t1;
|
|
106
|
+
const ios = t2 === undefined ? true : t2;
|
|
107
|
+
const android = t3 === undefined ? false : t3;
|
|
108
|
+
const theme = useTheme();
|
|
109
|
+
const enabled = Platform.OS === "ios" ? ios : Platform.OS === "android" ? android : false;
|
|
110
|
+
const {
|
|
111
|
+
height: windowHeight
|
|
112
|
+
} = useWindowDimensions();
|
|
113
|
+
const frame = useRef(null);
|
|
114
|
+
const [gap, setGap] = useState(0);
|
|
115
|
+
let t4;
|
|
116
|
+
if ($[0] !== windowHeight) {
|
|
117
|
+
t4 = () => frame.current?.measureInWindow((_x, top, _width, height) => setGap(Math.max(0, windowHeight - top - height)));
|
|
118
|
+
$[0] = windowHeight;
|
|
119
|
+
$[1] = t4;
|
|
120
|
+
} else {
|
|
121
|
+
t4 = $[1];
|
|
122
|
+
}
|
|
123
|
+
const measureGap = t4;
|
|
124
|
+
let t5;
|
|
125
|
+
let t6;
|
|
126
|
+
if ($[2] !== enabled) {
|
|
127
|
+
t5 = () => {
|
|
128
|
+
publish(enabled ? TOOLBAR_HEIGHT : 0);
|
|
129
|
+
return _temp;
|
|
130
|
+
};
|
|
131
|
+
t6 = [enabled];
|
|
132
|
+
$[2] = enabled;
|
|
133
|
+
$[3] = t5;
|
|
134
|
+
$[4] = t6;
|
|
135
|
+
} else {
|
|
136
|
+
t5 = $[3];
|
|
137
|
+
t6 = $[4];
|
|
138
|
+
}
|
|
139
|
+
useLayoutEffect(t5, t6);
|
|
140
|
+
if (!enabled) {
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
let t7;
|
|
144
|
+
if ($[5] !== theme.bg.card || $[6] !== theme.bg.muted || $[7] !== theme.text.accent || $[8] !== theme.text.disabled) {
|
|
145
|
+
t7 = {
|
|
146
|
+
primary: theme.text.accent,
|
|
147
|
+
disabled: theme.text.disabled,
|
|
148
|
+
background: theme.bg.card,
|
|
149
|
+
ripple: theme.bg.muted
|
|
150
|
+
};
|
|
151
|
+
$[5] = theme.bg.card;
|
|
152
|
+
$[6] = theme.bg.muted;
|
|
153
|
+
$[7] = theme.text.accent;
|
|
154
|
+
$[8] = theme.text.disabled;
|
|
155
|
+
$[9] = t7;
|
|
156
|
+
} else {
|
|
157
|
+
t7 = $[9];
|
|
158
|
+
}
|
|
159
|
+
const colors = t7;
|
|
160
|
+
let t8;
|
|
161
|
+
if ($[10] !== gap) {
|
|
162
|
+
t8 = {
|
|
163
|
+
opened: gap
|
|
164
|
+
};
|
|
165
|
+
$[10] = gap;
|
|
166
|
+
$[11] = t8;
|
|
167
|
+
} else {
|
|
168
|
+
t8 = $[11];
|
|
169
|
+
}
|
|
170
|
+
let t9;
|
|
171
|
+
if ($[12] !== colors) {
|
|
172
|
+
t9 = {
|
|
173
|
+
light: colors,
|
|
174
|
+
dark: colors
|
|
175
|
+
};
|
|
176
|
+
$[12] = colors;
|
|
177
|
+
$[13] = t9;
|
|
178
|
+
} else {
|
|
179
|
+
t9 = $[13];
|
|
180
|
+
}
|
|
181
|
+
let t10;
|
|
182
|
+
if ($[14] !== doneLabel || $[15] !== t8 || $[16] !== t9) {
|
|
183
|
+
t10 = _jsx(KeyboardToolbar, {
|
|
184
|
+
button: ToolbarButton,
|
|
185
|
+
doneText: doneLabel,
|
|
186
|
+
offset: t8,
|
|
187
|
+
theme: t9
|
|
188
|
+
});
|
|
189
|
+
$[14] = doneLabel;
|
|
190
|
+
$[15] = t8;
|
|
191
|
+
$[16] = t9;
|
|
192
|
+
$[17] = t10;
|
|
193
|
+
} else {
|
|
194
|
+
t10 = $[17];
|
|
195
|
+
}
|
|
196
|
+
let t11;
|
|
197
|
+
if ($[18] !== measureGap || $[19] !== t10) {
|
|
198
|
+
t11 = _jsx(View, {
|
|
199
|
+
onLayout: measureGap,
|
|
200
|
+
pointerEvents: "box-none",
|
|
201
|
+
ref: frame,
|
|
202
|
+
style: StyleSheet.absoluteFill,
|
|
203
|
+
children: t10
|
|
204
|
+
});
|
|
205
|
+
$[18] = measureGap;
|
|
206
|
+
$[19] = t10;
|
|
207
|
+
$[20] = t11;
|
|
208
|
+
} else {
|
|
209
|
+
t11 = $[20];
|
|
210
|
+
}
|
|
211
|
+
return t11;
|
|
212
|
+
}
|
|
213
|
+
function _temp() {
|
|
214
|
+
return publish(0);
|
|
215
|
+
}
|
|
216
|
+
const styles = StyleSheet.create({
|
|
217
|
+
button: {
|
|
218
|
+
minWidth: 44,
|
|
219
|
+
minHeight: 42,
|
|
220
|
+
alignItems: "center",
|
|
221
|
+
justifyContent: "center"
|
|
222
|
+
}
|
|
223
|
+
});
|
|
@@ -1,28 +1,175 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { inputTextStyle } from "./input-text.js";
|
|
3
|
+
import { useTheme } from "../theme/index.js";
|
|
3
4
|
import { tv } from "../theme/tw.js";
|
|
4
5
|
import { Typography } from "../Typography/index.js";
|
|
5
6
|
import { parseToMonetaryNumber } from "../utils/monetary.js";
|
|
6
7
|
import { useState } from "react";
|
|
7
8
|
import { View } from "react-native";
|
|
8
9
|
import CurrencyInput from "react-native-currency-input";
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
9
11
|
const monetaryBox = tv({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
base: "justify-center items-center bg-bg-card rounded-lg",
|
|
13
|
+
variants: {
|
|
14
|
+
focused: {
|
|
15
|
+
true: "border-2 border-border-focus",
|
|
16
|
+
false: "border border-input"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
focused: false
|
|
21
|
+
}
|
|
18
22
|
});
|
|
19
|
-
function MonetaryInput(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
function MonetaryInput(t0) {
|
|
24
|
+
const $ = _c(28);
|
|
25
|
+
const {
|
|
26
|
+
amount,
|
|
27
|
+
onChange,
|
|
28
|
+
currencySymbol: t1,
|
|
29
|
+
placeholder: t2
|
|
30
|
+
} = t0;
|
|
31
|
+
const currencySymbol = t1 === undefined ? "\u20A1" : t1;
|
|
32
|
+
const placeholder = t2 === undefined ? "Escriba el monto" : t2;
|
|
33
|
+
const theme = useTheme();
|
|
34
|
+
let t3;
|
|
35
|
+
if ($[0] !== amount) {
|
|
36
|
+
t3 = parseToMonetaryNumber(amount);
|
|
37
|
+
$[0] = amount;
|
|
38
|
+
$[1] = t3;
|
|
39
|
+
} else {
|
|
40
|
+
t3 = $[1];
|
|
41
|
+
}
|
|
42
|
+
const [raw, setRaw] = useState(t3);
|
|
43
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
44
|
+
let t4;
|
|
45
|
+
if ($[2] !== onChange) {
|
|
46
|
+
t4 = amount_0 => {
|
|
47
|
+
setRaw(amount_0);
|
|
48
|
+
onChange?.(parseToMonetaryNumber(amount_0));
|
|
25
49
|
};
|
|
26
|
-
|
|
50
|
+
$[2] = onChange;
|
|
51
|
+
$[3] = t4;
|
|
52
|
+
} else {
|
|
53
|
+
t4 = $[3];
|
|
54
|
+
}
|
|
55
|
+
const handleChange = t4;
|
|
56
|
+
let t5;
|
|
57
|
+
if ($[4] !== isFocused) {
|
|
58
|
+
t5 = monetaryBox({
|
|
59
|
+
focused: isFocused,
|
|
60
|
+
className: "w-12 h-12"
|
|
61
|
+
});
|
|
62
|
+
$[4] = isFocused;
|
|
63
|
+
$[5] = t5;
|
|
64
|
+
} else {
|
|
65
|
+
t5 = $[5];
|
|
66
|
+
}
|
|
67
|
+
let t6;
|
|
68
|
+
if ($[6] !== currencySymbol) {
|
|
69
|
+
t6 = _jsx(Typography.Text, {
|
|
70
|
+
variant: "body",
|
|
71
|
+
children: currencySymbol
|
|
72
|
+
});
|
|
73
|
+
$[6] = currencySymbol;
|
|
74
|
+
$[7] = t6;
|
|
75
|
+
} else {
|
|
76
|
+
t6 = $[7];
|
|
77
|
+
}
|
|
78
|
+
let t7;
|
|
79
|
+
if ($[8] !== t5 || $[9] !== t6) {
|
|
80
|
+
t7 = _jsx(View, {
|
|
81
|
+
className: t5,
|
|
82
|
+
children: t6
|
|
83
|
+
});
|
|
84
|
+
$[8] = t5;
|
|
85
|
+
$[9] = t6;
|
|
86
|
+
$[10] = t7;
|
|
87
|
+
} else {
|
|
88
|
+
t7 = $[10];
|
|
89
|
+
}
|
|
90
|
+
let t8;
|
|
91
|
+
if ($[11] !== isFocused) {
|
|
92
|
+
t8 = monetaryBox({
|
|
93
|
+
focused: isFocused,
|
|
94
|
+
className: "flex-1 h-12 ml-2 px-4"
|
|
95
|
+
});
|
|
96
|
+
$[11] = isFocused;
|
|
97
|
+
$[12] = t8;
|
|
98
|
+
} else {
|
|
99
|
+
t8 = $[12];
|
|
100
|
+
}
|
|
101
|
+
let t9;
|
|
102
|
+
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
103
|
+
t9 = () => setIsFocused(false);
|
|
104
|
+
$[13] = t9;
|
|
105
|
+
} else {
|
|
106
|
+
t9 = $[13];
|
|
107
|
+
}
|
|
108
|
+
let t10;
|
|
109
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
110
|
+
t10 = () => setIsFocused(true);
|
|
111
|
+
$[14] = t10;
|
|
112
|
+
} else {
|
|
113
|
+
t10 = $[14];
|
|
114
|
+
}
|
|
115
|
+
const t11 = theme.text.tertiary;
|
|
116
|
+
const t12 = theme.primary;
|
|
117
|
+
let t13;
|
|
118
|
+
if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
|
|
119
|
+
t13 = inputTextStyle();
|
|
120
|
+
$[15] = t13;
|
|
121
|
+
} else {
|
|
122
|
+
t13 = $[15];
|
|
123
|
+
}
|
|
124
|
+
let t14;
|
|
125
|
+
if ($[16] !== handleChange || $[17] !== placeholder || $[18] !== raw || $[19] !== theme.primary || $[20] !== theme.text.tertiary) {
|
|
126
|
+
t14 = _jsx(CurrencyInput, {
|
|
127
|
+
delimiter: ".",
|
|
128
|
+
keyboardType: "numeric",
|
|
129
|
+
onBlur: t9,
|
|
130
|
+
onChangeValue: handleChange,
|
|
131
|
+
onFocus: t10,
|
|
132
|
+
placeholder: placeholder,
|
|
133
|
+
placeholderTextColor: t11,
|
|
134
|
+
selectionColor: t12,
|
|
135
|
+
separator: ",",
|
|
136
|
+
style: t13,
|
|
137
|
+
underlineColorAndroid: "transparent",
|
|
138
|
+
value: raw
|
|
139
|
+
});
|
|
140
|
+
$[16] = handleChange;
|
|
141
|
+
$[17] = placeholder;
|
|
142
|
+
$[18] = raw;
|
|
143
|
+
$[19] = theme.primary;
|
|
144
|
+
$[20] = theme.text.tertiary;
|
|
145
|
+
$[21] = t14;
|
|
146
|
+
} else {
|
|
147
|
+
t14 = $[21];
|
|
148
|
+
}
|
|
149
|
+
let t15;
|
|
150
|
+
if ($[22] !== t14 || $[23] !== t8) {
|
|
151
|
+
t15 = _jsx(View, {
|
|
152
|
+
className: t8,
|
|
153
|
+
children: t14
|
|
154
|
+
});
|
|
155
|
+
$[22] = t14;
|
|
156
|
+
$[23] = t8;
|
|
157
|
+
$[24] = t15;
|
|
158
|
+
} else {
|
|
159
|
+
t15 = $[24];
|
|
160
|
+
}
|
|
161
|
+
let t16;
|
|
162
|
+
if ($[25] !== t15 || $[26] !== t7) {
|
|
163
|
+
t16 = _jsxs(View, {
|
|
164
|
+
className: "flex-row",
|
|
165
|
+
children: [t7, t15]
|
|
166
|
+
});
|
|
167
|
+
$[25] = t15;
|
|
168
|
+
$[26] = t7;
|
|
169
|
+
$[27] = t16;
|
|
170
|
+
} else {
|
|
171
|
+
t16 = $[27];
|
|
172
|
+
}
|
|
173
|
+
return t16;
|
|
27
174
|
}
|
|
28
175
|
export default MonetaryInput;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type PickerOption<T extends string | number> = {
|
|
2
|
+
value: T;
|
|
3
|
+
label: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
};
|
|
6
|
+
export type PickerFieldProps<T extends string | number> = {
|
|
7
|
+
label: string;
|
|
8
|
+
value: T | null;
|
|
9
|
+
onChange: (value: T, option: PickerOption<T>) => void;
|
|
10
|
+
/** Fixed options, filtered on the device by label and description. */
|
|
11
|
+
options?: readonly PickerOption<T>[];
|
|
12
|
+
/** Remote search (customers, products, Odoo name_search). Debounced; stale answers are dropped. */
|
|
13
|
+
search?: (query: string) => Promise<readonly PickerOption<T>[]>;
|
|
14
|
+
/** Shown for a value that is not in the current page of results. */
|
|
15
|
+
selectedLabel?: string;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
title?: string;
|
|
18
|
+
searchPlaceholder?: string;
|
|
19
|
+
emptyLabel?: string;
|
|
20
|
+
error?: string;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
className?: string;
|
|
23
|
+
testID?: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* A field that opens a searchable list: the "selector" pattern every business
|
|
27
|
+
* app repeats (customer, product, payment method). Local or remote options,
|
|
28
|
+
* one virtualized list, the shared overlay sheet.
|
|
29
|
+
*/
|
|
30
|
+
declare function PickerField<T extends string | number>({ label, value, onChange, options, search, selectedLabel, placeholder, title, searchPlaceholder, emptyLabel, error, disabled, className, testID, }: PickerFieldProps<T>): import("react").JSX.Element;
|
|
31
|
+
export default PickerField;
|