@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,47 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { Typography } from "../Typography/index.js";
|
|
3
|
+
import { StyleSheet } from "react-native";
|
|
4
|
+
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
5
|
+
const metrics = StyleSheet.create({
|
|
6
|
+
// 12 reads at a glance and keeps the pill 28 points tall (16 line height + padding).
|
|
7
|
+
label: {
|
|
8
|
+
fontSize: 12,
|
|
9
|
+
lineHeight: 16
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
/**
|
|
13
|
+
* The label every pill of the DS shares (badges, chips, tags): one size, one line,
|
|
14
|
+
* and the configured DS font instead of a className font that the app never loads.
|
|
15
|
+
*/
|
|
16
|
+
export function PillLabel(t0) {
|
|
17
|
+
const $ = _c(6);
|
|
18
|
+
const {
|
|
19
|
+
children,
|
|
20
|
+
className,
|
|
21
|
+
semibold: t1,
|
|
22
|
+
variant
|
|
23
|
+
} = t0;
|
|
24
|
+
const semibold = t1 === undefined ? false : t1;
|
|
25
|
+
const t2 = variant ? undefined : metrics.label;
|
|
26
|
+
const t3 = variant ?? "labelSmall";
|
|
27
|
+
let t4;
|
|
28
|
+
if ($[0] !== children || $[1] !== className || $[2] !== semibold || $[3] !== t2 || $[4] !== t3) {
|
|
29
|
+
t4 = _jsx(Typography.Text, {
|
|
30
|
+
className: className,
|
|
31
|
+
numberOfLines: 1,
|
|
32
|
+
semibold: semibold,
|
|
33
|
+
style: t2,
|
|
34
|
+
variant: t3,
|
|
35
|
+
children: children
|
|
36
|
+
});
|
|
37
|
+
$[0] = children;
|
|
38
|
+
$[1] = className;
|
|
39
|
+
$[2] = semibold;
|
|
40
|
+
$[3] = t2;
|
|
41
|
+
$[4] = t3;
|
|
42
|
+
$[5] = t4;
|
|
43
|
+
} else {
|
|
44
|
+
t4 = $[5];
|
|
45
|
+
}
|
|
46
|
+
return t4;
|
|
47
|
+
}
|
|
@@ -1,28 +1,40 @@
|
|
|
1
|
-
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
2
1
|
import FeedbackError from "./Feedback.Error.js";
|
|
3
|
-
import { Component } from "react";
|
|
2
|
+
import React, { Component } from "react";
|
|
3
|
+
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
4
4
|
export class ErrorBoundary extends Component {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
handleRetry = () => {
|
|
17
|
-
this.setState({ hasError: false, error: null });
|
|
5
|
+
constructor(props) {
|
|
6
|
+
super(props);
|
|
7
|
+
this.state = {
|
|
8
|
+
hasError: false,
|
|
9
|
+
error: null
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
static getDerivedStateFromError(error) {
|
|
13
|
+
return {
|
|
14
|
+
hasError: true,
|
|
15
|
+
error
|
|
18
16
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
}
|
|
18
|
+
componentDidCatch(error, errorInfo) {
|
|
19
|
+
console.error("ErrorBoundary caught an error:", error, errorInfo);
|
|
20
|
+
this.props.onError?.(error, errorInfo);
|
|
21
|
+
}
|
|
22
|
+
handleRetry = () => {
|
|
23
|
+
this.setState({
|
|
24
|
+
hasError: false,
|
|
25
|
+
error: null
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
render() {
|
|
29
|
+
if (this.state.hasError && this.state.error) {
|
|
30
|
+
if (this.props.fallback) {
|
|
31
|
+
return this.props.fallback(this.state.error, this.handleRetry);
|
|
32
|
+
}
|
|
33
|
+
return _jsx(FeedbackError, {
|
|
34
|
+
message: this.state.error.message || "Ocurrió un error inesperado",
|
|
35
|
+
onRetry: this.handleRetry
|
|
36
|
+
});
|
|
27
37
|
}
|
|
38
|
+
return this.props.children;
|
|
39
|
+
}
|
|
28
40
|
}
|
|
@@ -1,36 +1,214 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import Icon from "../Display/Display.Icon.js";
|
|
3
3
|
import Pressable from "../primitives/Pressable.js";
|
|
4
4
|
import { useTheme } from "../theme/index.js";
|
|
5
5
|
import { tv } from "../theme/tw.js";
|
|
6
6
|
import { Typography } from "../Typography/index.js";
|
|
7
7
|
import { View } from "react-native";
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
8
9
|
const banner = tv({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
10
|
+
slots: {
|
|
11
|
+
root: "flex-row items-start gap-3 rounded-lg p-3 border",
|
|
12
|
+
title: "text-sm font-semibold",
|
|
13
|
+
message: "text-sm text-text-secondary"
|
|
14
|
+
},
|
|
15
|
+
variants: {
|
|
16
|
+
tone: {
|
|
17
|
+
info: {
|
|
18
|
+
root: "bg-container-info border-info/30",
|
|
19
|
+
title: "text-info"
|
|
20
|
+
},
|
|
21
|
+
success: {
|
|
22
|
+
root: "bg-container-success border-success/30",
|
|
23
|
+
title: "text-success"
|
|
24
|
+
},
|
|
25
|
+
warning: {
|
|
26
|
+
root: "bg-container-warning border-warning/30",
|
|
27
|
+
title: "text-warning"
|
|
28
|
+
},
|
|
29
|
+
danger: {
|
|
30
|
+
root: "bg-container-danger border-danger/30",
|
|
31
|
+
title: "text-danger"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
defaultVariants: {
|
|
36
|
+
tone: "info"
|
|
37
|
+
}
|
|
23
38
|
});
|
|
24
39
|
const iconByTone = {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
40
|
+
info: "info",
|
|
41
|
+
success: "success",
|
|
42
|
+
warning: "warning",
|
|
43
|
+
danger: "error"
|
|
29
44
|
};
|
|
30
|
-
function Banner(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
45
|
+
function Banner(t0) {
|
|
46
|
+
const $ = _c(44);
|
|
47
|
+
const {
|
|
48
|
+
message,
|
|
49
|
+
title,
|
|
50
|
+
tone: t1,
|
|
51
|
+
onClose,
|
|
52
|
+
action,
|
|
53
|
+
className,
|
|
54
|
+
testID
|
|
55
|
+
} = t0;
|
|
56
|
+
const tone = t1 === undefined ? "info" : t1;
|
|
57
|
+
const theme = useTheme();
|
|
58
|
+
const resolvedTone = tone ?? "info";
|
|
59
|
+
let T0;
|
|
60
|
+
let T1;
|
|
61
|
+
let T2;
|
|
62
|
+
let t2;
|
|
63
|
+
let t3;
|
|
64
|
+
let t4;
|
|
65
|
+
let t5;
|
|
66
|
+
let t6;
|
|
67
|
+
let t7;
|
|
68
|
+
let t8;
|
|
69
|
+
let t9;
|
|
70
|
+
if ($[0] !== className || $[1] !== resolvedTone || $[2] !== testID || $[3] !== theme || $[4] !== title || $[5] !== tone) {
|
|
71
|
+
const styles = banner({
|
|
72
|
+
tone: resolvedTone
|
|
73
|
+
});
|
|
74
|
+
T2 = View;
|
|
75
|
+
t5 = tone === "danger" ? "assertive" : "polite";
|
|
76
|
+
t6 = tone === "danger" ? "alert" : undefined;
|
|
77
|
+
t7 = styles.root({
|
|
78
|
+
className
|
|
79
|
+
});
|
|
80
|
+
t8 = testID;
|
|
81
|
+
const t10 = theme[resolvedTone];
|
|
82
|
+
const t11 = iconByTone[resolvedTone];
|
|
83
|
+
if ($[17] !== t10 || $[18] !== t11) {
|
|
84
|
+
t9 = _jsx(Icon, {
|
|
85
|
+
color: t10,
|
|
86
|
+
name: t11,
|
|
87
|
+
size: 20
|
|
88
|
+
});
|
|
89
|
+
$[17] = t10;
|
|
90
|
+
$[18] = t11;
|
|
91
|
+
$[19] = t9;
|
|
92
|
+
} else {
|
|
93
|
+
t9 = $[19];
|
|
94
|
+
}
|
|
95
|
+
T1 = View;
|
|
96
|
+
t3 = "flex-1 gap-0.5";
|
|
97
|
+
t4 = title ? _jsx(Typography.Text, {
|
|
98
|
+
className: styles.title(),
|
|
99
|
+
children: title
|
|
100
|
+
}) : null;
|
|
101
|
+
T0 = Typography.Text;
|
|
102
|
+
t2 = styles.message();
|
|
103
|
+
$[0] = className;
|
|
104
|
+
$[1] = resolvedTone;
|
|
105
|
+
$[2] = testID;
|
|
106
|
+
$[3] = theme;
|
|
107
|
+
$[4] = title;
|
|
108
|
+
$[5] = tone;
|
|
109
|
+
$[6] = T0;
|
|
110
|
+
$[7] = T1;
|
|
111
|
+
$[8] = T2;
|
|
112
|
+
$[9] = t2;
|
|
113
|
+
$[10] = t3;
|
|
114
|
+
$[11] = t4;
|
|
115
|
+
$[12] = t5;
|
|
116
|
+
$[13] = t6;
|
|
117
|
+
$[14] = t7;
|
|
118
|
+
$[15] = t8;
|
|
119
|
+
$[16] = t9;
|
|
120
|
+
} else {
|
|
121
|
+
T0 = $[6];
|
|
122
|
+
T1 = $[7];
|
|
123
|
+
T2 = $[8];
|
|
124
|
+
t2 = $[9];
|
|
125
|
+
t3 = $[10];
|
|
126
|
+
t4 = $[11];
|
|
127
|
+
t5 = $[12];
|
|
128
|
+
t6 = $[13];
|
|
129
|
+
t7 = $[14];
|
|
130
|
+
t8 = $[15];
|
|
131
|
+
t9 = $[16];
|
|
132
|
+
}
|
|
133
|
+
let t10;
|
|
134
|
+
if ($[20] !== T0 || $[21] !== message || $[22] !== t2) {
|
|
135
|
+
t10 = _jsx(T0, {
|
|
136
|
+
className: t2,
|
|
137
|
+
children: message
|
|
138
|
+
});
|
|
139
|
+
$[20] = T0;
|
|
140
|
+
$[21] = message;
|
|
141
|
+
$[22] = t2;
|
|
142
|
+
$[23] = t10;
|
|
143
|
+
} else {
|
|
144
|
+
t10 = $[23];
|
|
145
|
+
}
|
|
146
|
+
let t11;
|
|
147
|
+
if ($[24] !== action) {
|
|
148
|
+
t11 = action ? _jsx(View, {
|
|
149
|
+
className: "mt-2",
|
|
150
|
+
children: action
|
|
151
|
+
}) : null;
|
|
152
|
+
$[24] = action;
|
|
153
|
+
$[25] = t11;
|
|
154
|
+
} else {
|
|
155
|
+
t11 = $[25];
|
|
156
|
+
}
|
|
157
|
+
let t12;
|
|
158
|
+
if ($[26] !== T1 || $[27] !== t10 || $[28] !== t11 || $[29] !== t3 || $[30] !== t4) {
|
|
159
|
+
t12 = _jsxs(T1, {
|
|
160
|
+
className: t3,
|
|
161
|
+
children: [t4, t10, t11]
|
|
162
|
+
});
|
|
163
|
+
$[26] = T1;
|
|
164
|
+
$[27] = t10;
|
|
165
|
+
$[28] = t11;
|
|
166
|
+
$[29] = t3;
|
|
167
|
+
$[30] = t4;
|
|
168
|
+
$[31] = t12;
|
|
169
|
+
} else {
|
|
170
|
+
t12 = $[31];
|
|
171
|
+
}
|
|
172
|
+
let t13;
|
|
173
|
+
if ($[32] !== onClose || $[33] !== theme.icon) {
|
|
174
|
+
t13 = onClose ? _jsx(Pressable, {
|
|
175
|
+
accessibilityLabel: "Cerrar",
|
|
176
|
+
accessibilityRole: "button",
|
|
177
|
+
hitSlop: 8,
|
|
178
|
+
onPress: onClose,
|
|
179
|
+
children: _jsx(Icon, {
|
|
180
|
+
color: theme.icon.secondary,
|
|
181
|
+
name: "close",
|
|
182
|
+
size: 18
|
|
183
|
+
})
|
|
184
|
+
}) : null;
|
|
185
|
+
$[32] = onClose;
|
|
186
|
+
$[33] = theme.icon;
|
|
187
|
+
$[34] = t13;
|
|
188
|
+
} else {
|
|
189
|
+
t13 = $[34];
|
|
190
|
+
}
|
|
191
|
+
let t14;
|
|
192
|
+
if ($[35] !== T2 || $[36] !== t12 || $[37] !== t13 || $[38] !== t5 || $[39] !== t6 || $[40] !== t7 || $[41] !== t8 || $[42] !== t9) {
|
|
193
|
+
t14 = _jsxs(T2, {
|
|
194
|
+
accessibilityLiveRegion: t5,
|
|
195
|
+
accessibilityRole: t6,
|
|
196
|
+
className: t7,
|
|
197
|
+
testID: t8,
|
|
198
|
+
children: [t9, t12, t13]
|
|
199
|
+
});
|
|
200
|
+
$[35] = T2;
|
|
201
|
+
$[36] = t12;
|
|
202
|
+
$[37] = t13;
|
|
203
|
+
$[38] = t5;
|
|
204
|
+
$[39] = t6;
|
|
205
|
+
$[40] = t7;
|
|
206
|
+
$[41] = t8;
|
|
207
|
+
$[42] = t9;
|
|
208
|
+
$[43] = t14;
|
|
209
|
+
} else {
|
|
210
|
+
t14 = $[43];
|
|
211
|
+
}
|
|
212
|
+
return t14;
|
|
35
213
|
}
|
|
36
214
|
export default Banner;
|
|
@@ -1,84 +1,260 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import GradientSurface from "../Display/Display.GradientSurface.js";
|
|
3
3
|
import Pattern from "../Display/Display.Pattern.js";
|
|
4
4
|
import Progress from "./Feedback.Progress.js";
|
|
5
5
|
import { useTheme } from "../theme/index.js";
|
|
6
|
+
import { ON_DARK_SURFACE } from "../theme/on-dark-surface.js";
|
|
6
7
|
import { Typography } from "../Typography/index.js";
|
|
7
8
|
import { useReducedMotion } from "../utils/useReducedMotion.js";
|
|
8
9
|
import { useEffect, useRef, useState } from "react";
|
|
9
10
|
import { Animated, StyleSheet, View } from "react-native";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
12
|
+
function DomainSplashScreen(t0) {
|
|
13
|
+
const $ = _c(37);
|
|
14
|
+
const {
|
|
15
|
+
domainName,
|
|
16
|
+
isLoading,
|
|
17
|
+
children,
|
|
18
|
+
onComplete,
|
|
19
|
+
minDuration: t1,
|
|
20
|
+
containerStyle,
|
|
21
|
+
overlayStyle,
|
|
22
|
+
renderLoading,
|
|
23
|
+
testID
|
|
24
|
+
} = t0;
|
|
25
|
+
const minDuration = t1 === undefined ? 300 : t1;
|
|
26
|
+
if (!Number.isFinite(minDuration) || minDuration < 0) {
|
|
27
|
+
throw new RangeError("DomainSplashScreen minDuration must be a finite, non-negative number.");
|
|
28
|
+
}
|
|
29
|
+
const theme = useTheme();
|
|
30
|
+
const reducedMotion = useReducedMotion();
|
|
31
|
+
let t2;
|
|
32
|
+
if ($[0] !== isLoading) {
|
|
33
|
+
t2 = () => new Animated.Value(isLoading ? 1 : 0);
|
|
34
|
+
$[0] = isLoading;
|
|
35
|
+
$[1] = t2;
|
|
36
|
+
} else {
|
|
37
|
+
t2 = $[1];
|
|
38
|
+
}
|
|
39
|
+
const [opacity] = useState(t2);
|
|
40
|
+
const [visible, setVisible] = useState(isLoading);
|
|
41
|
+
const startedAt = useRef(null);
|
|
42
|
+
const completed = useRef(false);
|
|
43
|
+
const onCompleteRef = useRef(onComplete);
|
|
44
|
+
const busy = isLoading || visible;
|
|
45
|
+
if (isLoading && !visible) {
|
|
46
|
+
setVisible(true);
|
|
47
|
+
}
|
|
48
|
+
let t3;
|
|
49
|
+
let t4;
|
|
50
|
+
if ($[2] !== onComplete) {
|
|
51
|
+
t3 = () => {
|
|
52
|
+
onCompleteRef.current = onComplete;
|
|
53
|
+
};
|
|
54
|
+
t4 = [onComplete];
|
|
55
|
+
$[2] = onComplete;
|
|
56
|
+
$[3] = t3;
|
|
57
|
+
$[4] = t4;
|
|
58
|
+
} else {
|
|
59
|
+
t3 = $[3];
|
|
60
|
+
t4 = $[4];
|
|
61
|
+
}
|
|
62
|
+
useEffect(t3, t4);
|
|
63
|
+
let t5;
|
|
64
|
+
let t6;
|
|
65
|
+
if ($[5] !== isLoading) {
|
|
66
|
+
t5 = () => {
|
|
67
|
+
if (isLoading) {
|
|
68
|
+
startedAt.current = Date.now();
|
|
69
|
+
completed.current = false;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
t6 = [isLoading];
|
|
73
|
+
$[5] = isLoading;
|
|
74
|
+
$[6] = t5;
|
|
75
|
+
$[7] = t6;
|
|
76
|
+
} else {
|
|
77
|
+
t5 = $[6];
|
|
78
|
+
t6 = $[7];
|
|
79
|
+
}
|
|
80
|
+
useEffect(t5, t6);
|
|
81
|
+
let t7;
|
|
82
|
+
let t8;
|
|
83
|
+
if ($[8] !== isLoading || $[9] !== minDuration || $[10] !== opacity || $[11] !== reducedMotion) {
|
|
84
|
+
t7 = () => {
|
|
85
|
+
if (isLoading) {
|
|
86
|
+
opacity.stopAnimation();
|
|
87
|
+
opacity.setValue(1);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (startedAt.current === null || completed.current) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
let active = true;
|
|
94
|
+
let animation;
|
|
95
|
+
const finish = () => {
|
|
96
|
+
if (!active || completed.current) {
|
|
97
|
+
return;
|
|
37
98
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
99
|
+
completed.current = true;
|
|
100
|
+
setVisible(false);
|
|
101
|
+
onCompleteRef.current?.();
|
|
102
|
+
};
|
|
103
|
+
const timeout = setTimeout(() => {
|
|
104
|
+
if (reducedMotion) {
|
|
105
|
+
opacity.setValue(0);
|
|
106
|
+
finish();
|
|
107
|
+
} else {
|
|
108
|
+
animation = Animated.timing(opacity, {
|
|
109
|
+
toValue: 0,
|
|
110
|
+
duration: 400,
|
|
111
|
+
useNativeDriver: true,
|
|
112
|
+
isInteraction: false
|
|
113
|
+
});
|
|
114
|
+
animation.start(t9 => {
|
|
115
|
+
const {
|
|
116
|
+
finished
|
|
117
|
+
} = t9;
|
|
118
|
+
if (finished) {
|
|
119
|
+
finish();
|
|
53
120
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}, Math.max(0, minDuration - (Date.now() - startedAt.current)));
|
|
124
|
+
return () => {
|
|
125
|
+
active = false;
|
|
126
|
+
clearTimeout(timeout);
|
|
127
|
+
animation?.stop();
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
t8 = [isLoading, minDuration, opacity, reducedMotion];
|
|
131
|
+
$[8] = isLoading;
|
|
132
|
+
$[9] = minDuration;
|
|
133
|
+
$[10] = opacity;
|
|
134
|
+
$[11] = reducedMotion;
|
|
135
|
+
$[12] = t7;
|
|
136
|
+
$[13] = t8;
|
|
137
|
+
} else {
|
|
138
|
+
t7 = $[12];
|
|
139
|
+
t8 = $[13];
|
|
140
|
+
}
|
|
141
|
+
useEffect(t7, t8);
|
|
142
|
+
let t9;
|
|
143
|
+
if ($[14] !== containerStyle) {
|
|
144
|
+
t9 = [styles.container, containerStyle];
|
|
145
|
+
$[14] = containerStyle;
|
|
146
|
+
$[15] = t9;
|
|
147
|
+
} else {
|
|
148
|
+
t9 = $[15];
|
|
149
|
+
}
|
|
150
|
+
const t10 = busy ? "no-hide-descendants" : "auto";
|
|
151
|
+
const t11 = busy ? "none" : "auto";
|
|
152
|
+
const t12 = testID ? `${testID}-content` : undefined;
|
|
153
|
+
let t13;
|
|
154
|
+
if ($[16] !== busy || $[17] !== children || $[18] !== t10 || $[19] !== t11 || $[20] !== t12) {
|
|
155
|
+
t13 = _jsx(View, {
|
|
156
|
+
accessibilityElementsHidden: busy,
|
|
157
|
+
importantForAccessibility: t10,
|
|
158
|
+
pointerEvents: t11,
|
|
159
|
+
style: styles.container,
|
|
160
|
+
testID: t12,
|
|
161
|
+
children: children
|
|
162
|
+
});
|
|
163
|
+
$[16] = busy;
|
|
164
|
+
$[17] = children;
|
|
165
|
+
$[18] = t10;
|
|
166
|
+
$[19] = t11;
|
|
167
|
+
$[20] = t12;
|
|
168
|
+
$[21] = t13;
|
|
169
|
+
} else {
|
|
170
|
+
t13 = $[21];
|
|
171
|
+
}
|
|
172
|
+
let t14;
|
|
173
|
+
if ($[22] !== busy || $[23] !== domainName || $[24] !== isLoading || $[25] !== opacity || $[26] !== overlayStyle || $[27] !== reducedMotion || $[28] !== renderLoading || $[29] !== testID || $[30] !== theme) {
|
|
174
|
+
t14 = busy ? _jsx(Animated.View, {
|
|
175
|
+
style: [StyleSheet.absoluteFill, {
|
|
176
|
+
opacity: isLoading ? 1 : opacity
|
|
177
|
+
}, overlayStyle],
|
|
178
|
+
testID: testID ? `${testID}-loading` : undefined,
|
|
179
|
+
children: renderLoading ? renderLoading({
|
|
180
|
+
domainName,
|
|
181
|
+
isLoading,
|
|
182
|
+
reducedMotion
|
|
183
|
+
}) : _jsxs(GradientSurface, {
|
|
184
|
+
className: "flex-1",
|
|
185
|
+
preset: "warm",
|
|
186
|
+
radius: "none",
|
|
187
|
+
style: {
|
|
188
|
+
position: "absolute",
|
|
189
|
+
top: 0,
|
|
190
|
+
left: 0,
|
|
191
|
+
right: 0,
|
|
192
|
+
bottom: 0
|
|
193
|
+
},
|
|
194
|
+
children: [_jsx(Pattern, {
|
|
195
|
+
color: theme.primary,
|
|
196
|
+
kind: "dots",
|
|
197
|
+
opacity: 0.14,
|
|
198
|
+
size: 26
|
|
199
|
+
}), _jsx(View, {
|
|
200
|
+
className: "flex-1 justify-center items-center px-8",
|
|
201
|
+
children: _jsxs(View, {
|
|
202
|
+
className: "w-full items-center gap-5",
|
|
203
|
+
children: [_jsx(Typography.Text, {
|
|
204
|
+
bold: true,
|
|
205
|
+
style: {
|
|
206
|
+
color: ON_DARK_SURFACE.ink,
|
|
207
|
+
letterSpacing: 0.5
|
|
208
|
+
},
|
|
209
|
+
variant: "h3",
|
|
210
|
+
children: `Cargando ${domainName}`
|
|
211
|
+
}), _jsx(Progress, {
|
|
212
|
+
accessibilityLabel: `Cargando ${domainName}`,
|
|
213
|
+
indeterminate: true,
|
|
214
|
+
indicatorStyle: {
|
|
215
|
+
backgroundColor: theme.primary
|
|
216
|
+
},
|
|
217
|
+
style: {
|
|
218
|
+
backgroundColor: ON_DARK_SURFACE.glass
|
|
219
|
+
}
|
|
220
|
+
})]
|
|
221
|
+
})
|
|
222
|
+
})]
|
|
223
|
+
})
|
|
224
|
+
}) : null;
|
|
225
|
+
$[22] = busy;
|
|
226
|
+
$[23] = domainName;
|
|
227
|
+
$[24] = isLoading;
|
|
228
|
+
$[25] = opacity;
|
|
229
|
+
$[26] = overlayStyle;
|
|
230
|
+
$[27] = reducedMotion;
|
|
231
|
+
$[28] = renderLoading;
|
|
232
|
+
$[29] = testID;
|
|
233
|
+
$[30] = theme;
|
|
234
|
+
$[31] = t14;
|
|
235
|
+
} else {
|
|
236
|
+
t14 = $[31];
|
|
237
|
+
}
|
|
238
|
+
let t15;
|
|
239
|
+
if ($[32] !== t13 || $[33] !== t14 || $[34] !== t9 || $[35] !== testID) {
|
|
240
|
+
t15 = _jsxs(View, {
|
|
241
|
+
style: t9,
|
|
242
|
+
testID: testID,
|
|
243
|
+
children: [t13, t14]
|
|
244
|
+
});
|
|
245
|
+
$[32] = t13;
|
|
246
|
+
$[33] = t14;
|
|
247
|
+
$[34] = t9;
|
|
248
|
+
$[35] = testID;
|
|
249
|
+
$[36] = t15;
|
|
250
|
+
} else {
|
|
251
|
+
t15 = $[36];
|
|
252
|
+
}
|
|
253
|
+
return t15;
|
|
78
254
|
}
|
|
79
255
|
const styles = StyleSheet.create({
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
256
|
+
container: {
|
|
257
|
+
flex: 1
|
|
258
|
+
}
|
|
83
259
|
});
|
|
84
260
|
export default DomainSplashScreen;
|