@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
|
@@ -1,73 +1,223 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { getActiveTheme, useTheme } from "../theme/index.js";
|
|
3
3
|
import { cn, tv } from "../theme/tw.js";
|
|
4
4
|
import { LinearGradient } from "expo-linear-gradient";
|
|
5
5
|
import { View } from "react-native";
|
|
6
|
+
|
|
7
|
+
/** Gradient anchor, 0 to 1 on each axis: `{ x, y }` or `[x, y]`. */
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
6
9
|
/**
|
|
7
10
|
* Decorative gradient presets. `brand` is themeable (reads `theme.gradient.primary`) —
|
|
8
11
|
* use it when you want the surface to follow whatever the app's active theme defines.
|
|
9
12
|
* Other presets are static constants for one-off uses. Each is [from, …, to].
|
|
10
13
|
*/
|
|
11
14
|
const GRADIENT_PRESETS = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
warm: {
|
|
16
|
+
colors: ["#1A1714", "#C89B3C", "#B88A2E"],
|
|
17
|
+
start: {
|
|
18
|
+
x: 0,
|
|
19
|
+
y: 0
|
|
16
20
|
},
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
end: {
|
|
22
|
+
x: 1,
|
|
23
|
+
y: 1
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"neon-teal": {
|
|
27
|
+
colors: ["#0F5C6E", "#5CC4D8"],
|
|
28
|
+
start: {
|
|
29
|
+
x: 0,
|
|
30
|
+
y: 0
|
|
21
31
|
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
32
|
+
end: {
|
|
33
|
+
x: 1,
|
|
34
|
+
y: 1
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"night-green": {
|
|
38
|
+
colors: ["#0B101E", "#18223A"],
|
|
39
|
+
start: {
|
|
40
|
+
x: 0,
|
|
41
|
+
y: 0
|
|
26
42
|
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
43
|
+
end: {
|
|
44
|
+
x: 1,
|
|
45
|
+
y: 1
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
mesh: {
|
|
49
|
+
colors: ["#1C3765", "#2A4A85", "#8FA9E8"],
|
|
50
|
+
start: {
|
|
51
|
+
x: 0,
|
|
52
|
+
y: 0
|
|
31
53
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
54
|
+
end: {
|
|
55
|
+
x: 1,
|
|
56
|
+
y: 1
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
emerald: {
|
|
60
|
+
colors: ["#2F6B3C", "#6FCF8B"],
|
|
61
|
+
start: {
|
|
62
|
+
x: 0,
|
|
63
|
+
y: 0
|
|
36
64
|
},
|
|
65
|
+
end: {
|
|
66
|
+
x: 1,
|
|
67
|
+
y: 1
|
|
68
|
+
}
|
|
69
|
+
}
|
|
37
70
|
};
|
|
38
71
|
const surface = tv({
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
padding: {
|
|
47
|
-
none: "p-0",
|
|
48
|
-
sm: "p-3",
|
|
49
|
-
md: "p-4",
|
|
50
|
-
lg: "p-6",
|
|
51
|
-
},
|
|
72
|
+
variants: {
|
|
73
|
+
radius: {
|
|
74
|
+
none: "rounded-none",
|
|
75
|
+
md: "rounded-xl",
|
|
76
|
+
lg: "rounded-2xl",
|
|
77
|
+
full: "rounded-full"
|
|
52
78
|
},
|
|
53
|
-
|
|
79
|
+
padding: {
|
|
80
|
+
none: "p-0",
|
|
81
|
+
sm: "p-3",
|
|
82
|
+
md: "p-4",
|
|
83
|
+
lg: "p-6"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
defaultVariants: {
|
|
87
|
+
radius: "lg",
|
|
88
|
+
padding: "none"
|
|
89
|
+
}
|
|
54
90
|
});
|
|
55
|
-
export function resolveGradientPreset(preset = "warm") {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
91
|
+
export function resolveGradientPreset(preset = "warm", theme = getActiveTheme()) {
|
|
92
|
+
const surface = preset === "brand" ? GRADIENT_PRESETS.warm : GRADIENT_PRESETS[preset];
|
|
93
|
+
return {
|
|
94
|
+
...surface,
|
|
95
|
+
colors: preset === "brand" ? theme.gradient.primary : surface.colors
|
|
96
|
+
};
|
|
61
97
|
}
|
|
98
|
+
|
|
62
99
|
/**
|
|
63
100
|
* Modern gradient surface. Wraps `expo-linear-gradient` with named presets +
|
|
64
101
|
* tokenized radius/padding. iOS + Android (no native dep beyond the already-peer
|
|
65
102
|
* `expo-linear-gradient`). Replaces the legacy `GradientContainer`.
|
|
66
103
|
*/
|
|
67
|
-
function GradientSurface(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
104
|
+
function GradientSurface(t0) {
|
|
105
|
+
const $ = _c(24);
|
|
106
|
+
const {
|
|
107
|
+
preset: t1,
|
|
108
|
+
colors,
|
|
109
|
+
start,
|
|
110
|
+
end,
|
|
111
|
+
radius,
|
|
112
|
+
padding,
|
|
113
|
+
children,
|
|
114
|
+
className,
|
|
115
|
+
style,
|
|
116
|
+
testID
|
|
117
|
+
} = t0;
|
|
118
|
+
const preset = t1 === undefined ? "warm" : t1;
|
|
119
|
+
const theme = useTheme();
|
|
120
|
+
let t2;
|
|
121
|
+
if ($[0] !== preset || $[1] !== theme) {
|
|
122
|
+
t2 = resolveGradientPreset(preset, theme);
|
|
123
|
+
$[0] = preset;
|
|
124
|
+
$[1] = theme;
|
|
125
|
+
$[2] = t2;
|
|
126
|
+
} else {
|
|
127
|
+
t2 = $[2];
|
|
128
|
+
}
|
|
129
|
+
const p = t2;
|
|
130
|
+
const resolvedColors = colors ?? p.colors;
|
|
131
|
+
let t3;
|
|
132
|
+
if ($[3] !== radius) {
|
|
133
|
+
t3 = cn("overflow-hidden", surface({
|
|
134
|
+
radius
|
|
135
|
+
}));
|
|
136
|
+
$[3] = radius;
|
|
137
|
+
$[4] = t3;
|
|
138
|
+
} else {
|
|
139
|
+
t3 = $[4];
|
|
140
|
+
}
|
|
141
|
+
let t4;
|
|
142
|
+
if ($[5] !== resolvedColors) {
|
|
143
|
+
t4 = [...resolvedColors];
|
|
144
|
+
$[5] = resolvedColors;
|
|
145
|
+
$[6] = t4;
|
|
146
|
+
} else {
|
|
147
|
+
t4 = $[6];
|
|
148
|
+
}
|
|
149
|
+
const t5 = t4;
|
|
150
|
+
const t6 = end ?? p.end;
|
|
151
|
+
const t7 = start ?? p.start;
|
|
152
|
+
let t8;
|
|
153
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
154
|
+
t8 = {
|
|
155
|
+
position: "absolute",
|
|
156
|
+
top: 0,
|
|
157
|
+
left: 0,
|
|
158
|
+
right: 0,
|
|
159
|
+
bottom: 0
|
|
160
|
+
};
|
|
161
|
+
$[7] = t8;
|
|
162
|
+
} else {
|
|
163
|
+
t8 = $[7];
|
|
164
|
+
}
|
|
165
|
+
let t9;
|
|
166
|
+
if ($[8] !== t5 || $[9] !== t6 || $[10] !== t7) {
|
|
167
|
+
t9 = _jsx(LinearGradient, {
|
|
168
|
+
colors: t5,
|
|
169
|
+
end: t6,
|
|
170
|
+
start: t7,
|
|
171
|
+
style: t8
|
|
172
|
+
});
|
|
173
|
+
$[8] = t5;
|
|
174
|
+
$[9] = t6;
|
|
175
|
+
$[10] = t7;
|
|
176
|
+
$[11] = t9;
|
|
177
|
+
} else {
|
|
178
|
+
t9 = $[11];
|
|
179
|
+
}
|
|
180
|
+
let t10;
|
|
181
|
+
if ($[12] !== className || $[13] !== padding) {
|
|
182
|
+
t10 = cn(surface({
|
|
183
|
+
padding
|
|
184
|
+
}), className);
|
|
185
|
+
$[12] = className;
|
|
186
|
+
$[13] = padding;
|
|
187
|
+
$[14] = t10;
|
|
188
|
+
} else {
|
|
189
|
+
t10 = $[14];
|
|
190
|
+
}
|
|
191
|
+
let t11;
|
|
192
|
+
if ($[15] !== children || $[16] !== t10) {
|
|
193
|
+
t11 = _jsx(View, {
|
|
194
|
+
className: t10,
|
|
195
|
+
children: children
|
|
196
|
+
});
|
|
197
|
+
$[15] = children;
|
|
198
|
+
$[16] = t10;
|
|
199
|
+
$[17] = t11;
|
|
200
|
+
} else {
|
|
201
|
+
t11 = $[17];
|
|
202
|
+
}
|
|
203
|
+
let t12;
|
|
204
|
+
if ($[18] !== style || $[19] !== t11 || $[20] !== t3 || $[21] !== t9 || $[22] !== testID) {
|
|
205
|
+
t12 = _jsxs(View, {
|
|
206
|
+
className: t3,
|
|
207
|
+
style: style,
|
|
208
|
+
testID: testID,
|
|
209
|
+
children: [t9, t11]
|
|
210
|
+
});
|
|
211
|
+
$[18] = style;
|
|
212
|
+
$[19] = t11;
|
|
213
|
+
$[20] = t3;
|
|
214
|
+
$[21] = t9;
|
|
215
|
+
$[22] = testID;
|
|
216
|
+
$[23] = t12;
|
|
217
|
+
} else {
|
|
218
|
+
t12 = $[23];
|
|
219
|
+
}
|
|
220
|
+
return t12;
|
|
71
221
|
}
|
|
72
222
|
export default GradientSurface;
|
|
73
223
|
export { GRADIENT_PRESETS, GradientSurface };
|
|
@@ -1,21 +1,135 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { ICON_FONT_FAMILY } from "./icon-font.js";
|
|
3
|
+
import { MATERIAL_CODEPOINTS } from "./icon-glyphs.js";
|
|
2
4
|
import { ICON_MAP } from "./icon-map.js";
|
|
5
|
+
import { customIconRenderer } from "./icon-registry.js";
|
|
3
6
|
import { useTheme } from "../theme/index.js";
|
|
4
|
-
import { cn } from "../theme/tw.js";
|
|
5
7
|
import { SymbolView } from "expo-symbols";
|
|
6
|
-
import { View } from "react-native";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
import { Platform, StyleSheet, Text, View } from "react-native";
|
|
9
|
+
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
10
|
+
const FALLBACK = "info";
|
|
11
|
+
const DEFAULT_SIZE = 24;
|
|
12
|
+
const LEGACY_PROPS = ["type", "customIcon", "fallback", "children"];
|
|
13
|
+
const reported = new Set();
|
|
14
|
+
function reportOnce(message) {
|
|
15
|
+
if (!__DEV__ || reported.has(message)) return;
|
|
16
|
+
reported.add(message);
|
|
17
|
+
console.error(`[Display.Icon] ${message}`);
|
|
18
|
+
}
|
|
19
|
+
function isBuiltIn(name) {
|
|
20
|
+
return typeof name === "string" && Object.hasOwn(ICON_MAP, name);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Rendered inline (not a component): one fiber per icon instead of two.
|
|
25
|
+
* iOS: SF Symbols, native and stateless.
|
|
26
|
+
* Android and web: one Material Symbols glyph in a Text — no effect, no
|
|
27
|
+
* per-instance font load, a single render. Icons keep their size when the
|
|
28
|
+
* system font scale grows, like @expo/vector-icons did.
|
|
29
|
+
*/
|
|
30
|
+
function glyph(name, size, color) {
|
|
31
|
+
if (Platform.OS === "ios") {
|
|
32
|
+
return _jsx(SymbolView, {
|
|
33
|
+
accessibilityElementsHidden: true,
|
|
34
|
+
accessible: false,
|
|
35
|
+
importantForAccessibility: "no-hide-descendants",
|
|
36
|
+
name: ICON_MAP[name].sf,
|
|
37
|
+
size: size,
|
|
38
|
+
tintColor: color
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return _jsx(Text, {
|
|
42
|
+
accessibilityElementsHidden: true,
|
|
43
|
+
accessible: false,
|
|
44
|
+
allowFontScaling: false,
|
|
45
|
+
importantForAccessibility: "no-hide-descendants",
|
|
46
|
+
style: [styles.glyph, {
|
|
47
|
+
color,
|
|
48
|
+
fontSize: size,
|
|
49
|
+
lineHeight: size,
|
|
50
|
+
width: size,
|
|
51
|
+
height: size
|
|
52
|
+
}],
|
|
53
|
+
children: String.fromCharCode(MATERIAL_CODEPOINTS[name])
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
const Icon = t0 => {
|
|
57
|
+
const $ = _c(4);
|
|
58
|
+
const {
|
|
59
|
+
name,
|
|
60
|
+
size: t1,
|
|
61
|
+
color,
|
|
62
|
+
className,
|
|
63
|
+
style,
|
|
64
|
+
accessible,
|
|
65
|
+
accessibilityLabel,
|
|
66
|
+
accessibilityRole,
|
|
67
|
+
...rest
|
|
68
|
+
} = t0;
|
|
69
|
+
const size = t1 === undefined ? DEFAULT_SIZE : t1;
|
|
70
|
+
const theme = useTheme();
|
|
71
|
+
const tint = color ?? theme.text.primary;
|
|
72
|
+
const validSize = Number.isFinite(size) && size > 0;
|
|
73
|
+
if (!validSize) {
|
|
74
|
+
reportOnce(`Invalid size ${String(size)}. Using ${DEFAULT_SIZE}.`);
|
|
75
|
+
}
|
|
76
|
+
const glyphSize = validSize ? size : DEFAULT_SIZE;
|
|
77
|
+
const viewProps = {
|
|
78
|
+
...rest
|
|
79
|
+
};
|
|
80
|
+
for (const key of LEGACY_PROPS) {
|
|
81
|
+
if (!Object.hasOwn(viewProps, key)) {
|
|
82
|
+
continue;
|
|
17
83
|
}
|
|
18
|
-
|
|
19
|
-
|
|
84
|
+
reportOnce(`"${key}" is not supported. Register custom icons with registerIcons().`);
|
|
85
|
+
delete viewProps[key];
|
|
86
|
+
}
|
|
87
|
+
const custom = typeof name === "string" ? customIconRenderer(name) : undefined;
|
|
88
|
+
const builtIn = isBuiltIn(name) ? name : undefined;
|
|
89
|
+
if (!custom && !builtIn) {
|
|
90
|
+
reportOnce(`Unknown icon "${String(name)}". Showing "${FALLBACK}".`);
|
|
91
|
+
}
|
|
92
|
+
let t2;
|
|
93
|
+
if ($[0] !== className) {
|
|
94
|
+
t2 = className ? {
|
|
95
|
+
className
|
|
96
|
+
} : null;
|
|
97
|
+
$[0] = className;
|
|
98
|
+
$[1] = t2;
|
|
99
|
+
} else {
|
|
100
|
+
t2 = $[1];
|
|
101
|
+
}
|
|
102
|
+
let t3;
|
|
103
|
+
if ($[2] !== style) {
|
|
104
|
+
t3 = [styles.box, style];
|
|
105
|
+
$[2] = style;
|
|
106
|
+
$[3] = t3;
|
|
107
|
+
} else {
|
|
108
|
+
t3 = $[3];
|
|
109
|
+
}
|
|
110
|
+
return _jsx(View, {
|
|
111
|
+
...viewProps,
|
|
112
|
+
...t2,
|
|
113
|
+
accessibilityLabel: accessibilityLabel,
|
|
114
|
+
accessibilityRole: accessibilityRole ?? (accessibilityLabel ? "image" : undefined),
|
|
115
|
+
accessible: accessible ?? Boolean(accessibilityLabel),
|
|
116
|
+
style: t3,
|
|
117
|
+
children: custom ? custom({
|
|
118
|
+
size: glyphSize,
|
|
119
|
+
color: tint
|
|
120
|
+
}) : glyph(builtIn ?? FALLBACK, glyphSize, tint)
|
|
121
|
+
});
|
|
20
122
|
};
|
|
123
|
+
const styles = StyleSheet.create({
|
|
124
|
+
box: {
|
|
125
|
+
alignItems: "center",
|
|
126
|
+
justifyContent: "center"
|
|
127
|
+
},
|
|
128
|
+
glyph: {
|
|
129
|
+
fontFamily: ICON_FONT_FAMILY,
|
|
130
|
+
includeFontPadding: false,
|
|
131
|
+
textAlign: "center",
|
|
132
|
+
textAlignVertical: "center"
|
|
133
|
+
}
|
|
134
|
+
});
|
|
21
135
|
export default Icon;
|
|
@@ -1,30 +1,100 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { CountBadge } from "./count-badge.js";
|
|
2
3
|
import Pressable from "../primitives/Pressable.js";
|
|
3
|
-
import { theme } from "../theme/index.js";
|
|
4
|
-
import { Typography } from "../Typography/index.js";
|
|
5
4
|
import { View } from "react-native";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
6
|
+
function IconBadge(t0) {
|
|
7
|
+
const $ = _c(19);
|
|
8
|
+
const {
|
|
9
|
+
children,
|
|
10
|
+
count,
|
|
11
|
+
max: t1,
|
|
12
|
+
dot: t2,
|
|
13
|
+
color,
|
|
14
|
+
onPress,
|
|
15
|
+
accessibilityLabel,
|
|
16
|
+
testID
|
|
17
|
+
} = t0;
|
|
18
|
+
const max = t1 === undefined ? 99 : t1;
|
|
19
|
+
const dot = t2 === undefined ? false : t2;
|
|
20
|
+
const showCount = typeof count === "number" && count > 0;
|
|
21
|
+
let t3;
|
|
22
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
23
|
+
t3 = {
|
|
24
|
+
position: "relative"
|
|
25
|
+
};
|
|
26
|
+
$[0] = t3;
|
|
27
|
+
} else {
|
|
28
|
+
t3 = $[0];
|
|
29
|
+
}
|
|
30
|
+
let t4;
|
|
31
|
+
if ($[1] !== color || $[2] !== count || $[3] !== dot || $[4] !== max || $[5] !== showCount) {
|
|
32
|
+
t4 = dot || showCount ? _jsx(CountBadge, {
|
|
33
|
+
anchor: {
|
|
34
|
+
top: -4,
|
|
35
|
+
right: -6
|
|
36
|
+
},
|
|
37
|
+
color: color,
|
|
38
|
+
count: count,
|
|
39
|
+
dot: dot,
|
|
40
|
+
max: max
|
|
41
|
+
}) : null;
|
|
42
|
+
$[1] = color;
|
|
43
|
+
$[2] = count;
|
|
44
|
+
$[3] = dot;
|
|
45
|
+
$[4] = max;
|
|
46
|
+
$[5] = showCount;
|
|
47
|
+
$[6] = t4;
|
|
48
|
+
} else {
|
|
49
|
+
t4 = $[6];
|
|
50
|
+
}
|
|
51
|
+
let t5;
|
|
52
|
+
if ($[7] !== children || $[8] !== t4) {
|
|
53
|
+
t5 = _jsxs(View, {
|
|
54
|
+
style: t3,
|
|
55
|
+
children: [children, t4]
|
|
56
|
+
});
|
|
57
|
+
$[7] = children;
|
|
58
|
+
$[8] = t4;
|
|
59
|
+
$[9] = t5;
|
|
60
|
+
} else {
|
|
61
|
+
t5 = $[9];
|
|
62
|
+
}
|
|
63
|
+
const content = t5;
|
|
64
|
+
if (onPress) {
|
|
65
|
+
let t6;
|
|
66
|
+
if ($[10] !== accessibilityLabel || $[11] !== content || $[12] !== onPress || $[13] !== testID) {
|
|
67
|
+
t6 = _jsx(Pressable, {
|
|
68
|
+
accessibilityLabel: accessibilityLabel,
|
|
69
|
+
hitSlop: 10,
|
|
70
|
+
onPress: onPress,
|
|
71
|
+
testID: testID,
|
|
72
|
+
children: content
|
|
73
|
+
});
|
|
74
|
+
$[10] = accessibilityLabel;
|
|
75
|
+
$[11] = content;
|
|
76
|
+
$[12] = onPress;
|
|
77
|
+
$[13] = testID;
|
|
78
|
+
$[14] = t6;
|
|
79
|
+
} else {
|
|
80
|
+
t6 = $[14];
|
|
27
81
|
}
|
|
28
|
-
return
|
|
82
|
+
return t6;
|
|
83
|
+
}
|
|
84
|
+
let t6;
|
|
85
|
+
if ($[15] !== accessibilityLabel || $[16] !== content || $[17] !== testID) {
|
|
86
|
+
t6 = _jsx(View, {
|
|
87
|
+
accessibilityLabel: accessibilityLabel,
|
|
88
|
+
testID: testID,
|
|
89
|
+
children: content
|
|
90
|
+
});
|
|
91
|
+
$[15] = accessibilityLabel;
|
|
92
|
+
$[16] = content;
|
|
93
|
+
$[17] = testID;
|
|
94
|
+
$[18] = t6;
|
|
95
|
+
} else {
|
|
96
|
+
t6 = $[18];
|
|
97
|
+
}
|
|
98
|
+
return t6;
|
|
29
99
|
}
|
|
30
100
|
export default IconBadge;
|
|
@@ -16,5 +16,11 @@ export interface DisplayImageProps extends Omit<ExpoImageProps, "source" | "styl
|
|
|
16
16
|
renderError?: (retry: () => void) => ReactNode;
|
|
17
17
|
testID?: string;
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
/**
|
|
20
|
+
* One native image view for the life of the component. A new `source` resets the load
|
|
21
|
+
* state in place instead of remounting, so a recycled FlashList cell keeps its view and
|
|
22
|
+
* `recyclingKey` clears the previous picture natively. Each load has a token; events
|
|
23
|
+
* from an older source or attempt cannot settle the current one.
|
|
24
|
+
*/
|
|
25
|
+
declare function DisplayImage({ source, width, height, aspectRatio, radius, contentFit, placeholder, fallbackIcon, className, style, containerStyle, renderError, testID, onError, onLoadStart, onLoadEnd, onLoad, accessibilityLabel, accessible, ...imageProps }: DisplayImageProps): import("react").JSX.Element;
|
|
20
26
|
export default DisplayImage;
|