@sincpro/mobile-ui 0.7.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +575 -230
- package/dist/Actions/Actions.Button.d.ts +98 -93
- package/dist/Actions/Actions.Button.js +58 -52
- package/dist/Actions/Actions.FAB.d.ts +3 -1
- package/dist/Actions/Actions.FAB.js +12 -8
- package/dist/Actions/Actions.FilterButton.d.ts +10 -2
- package/dist/Actions/Actions.FilterButton.js +23 -8
- package/dist/Actions/Actions.IconButton.d.ts +36 -33
- package/dist/Actions/Actions.IconButton.js +10 -6
- package/dist/Actions/index.d.ts +12 -12
- package/dist/Actions/index.js +6 -6
- package/dist/Dialog/BottomSheet/BottomSheet.Root.js +1 -1
- package/dist/Dialog/BottomSheet/index.d.ts +1 -1
- package/dist/Dialog/BottomSheet/index.js +1 -1
- package/dist/Dialog/Confirmation.context.js +3 -3
- package/dist/Dialog/Dialog.ActionSheet.d.ts +2 -1
- package/dist/Dialog/Dialog.ActionSheet.js +19 -9
- package/dist/Dialog/Dialog.Confirmation.js +7 -7
- package/dist/Dialog/Dialog.EditValue.js +4 -4
- package/dist/Dialog/Dialog.NativeSheet.d.ts +10 -0
- package/dist/Dialog/Dialog.NativeSheet.js +21 -0
- package/dist/Dialog/Dialog.Sheet.d.ts +5 -1
- package/dist/Dialog/Dialog.Sheet.js +19 -11
- package/dist/Dialog/index.d.ts +5 -5
- package/dist/Dialog/index.js +5 -5
- package/dist/Display/Display.Accordion.js +5 -5
- package/dist/Display/Display.Avatar.d.ts +30 -30
- package/dist/Display/Display.Avatar.js +2 -2
- package/dist/Display/Display.AvatarGroup.js +3 -3
- package/dist/Display/Display.Badge.d.ts +3 -3
- package/dist/Display/Display.Badge.js +1 -1
- package/dist/Display/Display.Card.d.ts +15 -15
- package/dist/Display/Display.Card.js +4 -4
- package/dist/Display/Display.Carousel.js +2 -2
- package/dist/Display/Display.Chip.d.ts +3 -3
- package/dist/Display/Display.Chip.js +12 -12
- package/dist/Display/Display.CircleButton.d.ts +1 -1
- package/dist/Display/Display.CircleButton.js +3 -3
- package/dist/Display/Display.CopyableText.d.ts +9 -2
- package/dist/Display/Display.CopyableText.js +76 -8
- package/dist/Display/Display.CountRecords.js +2 -2
- package/dist/Display/Display.DataTable.js +2 -2
- package/dist/Display/Display.Date.d.ts +1 -1
- package/dist/Display/Display.Date.js +5 -5
- package/dist/Display/Display.Divider.d.ts +24 -24
- package/dist/Display/Display.Divider.js +1 -1
- package/dist/Display/Display.GradientSurface.d.ts +58 -39
- package/dist/Display/Display.GradientSurface.js +31 -15
- package/dist/Display/Display.Icon.d.ts +1 -1
- package/dist/Display/Display.Icon.js +2 -1
- package/dist/Display/Display.IconBadge.js +3 -3
- package/dist/Display/Display.Image.js +4 -4
- package/dist/Display/Display.KeyValue.d.ts +11 -4
- package/dist/Display/Display.KeyValue.js +8 -6
- package/dist/Display/Display.ListGroup.d.ts +23 -0
- package/dist/Display/Display.ListGroup.js +17 -0
- package/dist/Display/Display.ListItem.d.ts +16 -2
- package/dist/Display/Display.ListItem.js +29 -12
- package/dist/Display/Display.Logo.d.ts +3 -3
- package/dist/Display/Display.Logo.js +2 -2
- package/dist/Display/Display.MediaCard.js +4 -4
- package/dist/Display/Display.MediaEmbed.js +7 -7
- package/dist/Display/Display.MenuButton.d.ts +4 -4
- package/dist/Display/Display.MenuButton.js +6 -6
- package/dist/Display/Display.MenuCard.d.ts +1 -1
- package/dist/Display/Display.MenuCard.js +3 -3
- package/dist/Display/Display.MenuGrid.d.ts +1 -1
- package/dist/Display/Display.MenuGrid.js +1 -1
- package/dist/Display/Display.Monetary.d.ts +1 -1
- package/dist/Display/Display.Monetary.js +2 -2
- package/dist/Display/Display.Pattern.d.ts +33 -12
- package/dist/Display/Display.Pattern.js +60 -14
- package/dist/Display/Display.PriceTag.js +2 -2
- package/dist/Display/Display.ProductCard.js +7 -7
- package/dist/Display/Display.Rating.js +3 -3
- package/dist/Display/Display.SearchHistory.js +6 -6
- package/dist/Display/Display.SectionHeader.d.ts +11 -1
- package/dist/Display/Display.SectionHeader.js +14 -5
- package/dist/Display/Display.Stat.js +2 -2
- package/dist/Display/Display.StatCard.js +4 -4
- package/dist/Display/Display.StatusDot.js +3 -3
- package/dist/Display/Display.Story.js +3 -3
- package/dist/Display/Display.StoryTray.js +5 -5
- package/dist/Display/Display.StoryViewer.js +4 -4
- package/dist/Display/Display.SwipeableRow.d.ts +3 -1
- package/dist/Display/Display.SwipeableRow.js +7 -7
- package/dist/Display/Display.Tag.js +2 -2
- package/dist/Display/Display.Timeline.js +4 -4
- package/dist/Display/Display.Tooltip.js +3 -3
- package/dist/Display/index.d.ts +49 -45
- package/dist/Display/index.js +44 -42
- package/dist/Feedback/ErrorBoundary.d.ts +1 -1
- package/dist/Feedback/ErrorBoundary.js +1 -1
- package/dist/Feedback/Feedback.Banner.d.ts +3 -3
- package/dist/Feedback/Feedback.Banner.js +6 -6
- package/dist/Feedback/Feedback.DomainSplashScreen.js +5 -4
- package/dist/Feedback/Feedback.Empty.js +3 -3
- package/dist/Feedback/Feedback.EmptyState.d.ts +2 -1
- package/dist/Feedback/Feedback.EmptyState.js +7 -7
- package/dist/Feedback/Feedback.Error.d.ts +3 -1
- package/dist/Feedback/Feedback.Error.js +7 -6
- package/dist/Feedback/Feedback.Loading.d.ts +1 -1
- package/dist/Feedback/Feedback.Loading.js +2 -2
- package/dist/Feedback/Feedback.PermissionCard.js +5 -5
- package/dist/Feedback/Feedback.Progress.js +2 -2
- package/dist/Feedback/Feedback.ProgressCircle.js +1 -1
- package/dist/Feedback/Feedback.Skeleton.js +2 -2
- package/dist/Feedback/Feedback.Spinner.js +3 -3
- package/dist/Feedback/Feedback.Splash.d.ts +1 -1
- package/dist/Feedback/Feedback.Splash.js +7 -6
- package/dist/Feedback/Toast.context.js +7 -7
- package/dist/Feedback/index.d.ts +13 -13
- package/dist/Feedback/index.js +13 -13
- package/dist/Form/Form.Button.d.ts +2 -2
- package/dist/Form/Form.Button.js +1 -1
- package/dist/Form/Form.Checkbox.d.ts +4 -1
- package/dist/Form/Form.Checkbox.js +5 -5
- package/dist/Form/Form.ControlledCheckbox.js +1 -1
- package/dist/Form/Form.ControlledInput.js +1 -1
- package/dist/Form/Form.ControlledMonetaryInput.js +1 -1
- package/dist/Form/Form.ControlledRadioButton.js +1 -1
- package/dist/Form/Form.DatePicker.d.ts +2 -1
- package/dist/Form/Form.DatePicker.js +8 -7
- package/dist/Form/Form.Dropdown.js +7 -7
- package/dist/Form/Form.FAB.d.ts +2 -2
- package/dist/Form/Form.FAB.js +1 -1
- package/dist/Form/Form.FilterButton.d.ts +2 -2
- package/dist/Form/Form.FilterButton.js +1 -1
- package/dist/Form/Form.FractionalQuantityInput.js +4 -4
- package/dist/Form/Form.IconButton.d.ts +2 -2
- package/dist/Form/Form.IconButton.js +1 -1
- package/dist/Form/Form.Input.d.ts +5 -3
- package/dist/Form/Form.Input.js +5 -5
- package/dist/Form/Form.InputField.d.ts +1 -1
- package/dist/Form/Form.InputField.js +3 -3
- package/dist/Form/Form.KeyboardForm.d.ts +11 -0
- package/dist/Form/Form.KeyboardForm.js +9 -0
- package/dist/Form/Form.KeyboardToolbar.d.ts +21 -0
- package/dist/Form/Form.KeyboardToolbar.js +70 -0
- package/dist/Form/Form.MonetaryInput.js +5 -4
- package/dist/Form/Form.PasswordInput.d.ts +1 -1
- package/dist/Form/Form.PasswordInput.js +3 -3
- package/dist/Form/Form.PinInput.js +5 -5
- package/dist/Form/Form.QuantitySelector.js +3 -3
- package/dist/Form/Form.RadioButton.js +4 -4
- package/dist/Form/Form.SearchBar.js +4 -4
- package/dist/Form/Form.Select.d.ts +3 -1
- package/dist/Form/Form.Select.js +27 -14
- package/dist/Form/Form.Slider.js +3 -3
- package/dist/Form/Form.Switch.js +4 -4
- package/dist/Form/Form.TextInput.js +3 -3
- package/dist/Form/index.d.ts +33 -27
- package/dist/Form/index.js +29 -25
- package/dist/Navigation/Navigation.AppBar.d.ts +11 -6
- package/dist/Navigation/Navigation.AppBar.js +16 -16
- package/dist/Navigation/Navigation.BottomNav.d.ts +4 -2
- package/dist/Navigation/Navigation.BottomNav.js +34 -21
- package/dist/Navigation/Navigation.CollapsingHeader.d.ts +1 -1
- package/dist/Navigation/Navigation.CollapsingHeader.js +3 -3
- package/dist/Navigation/Navigation.FloatingBar.js +2 -2
- package/dist/Navigation/Navigation.Header.js +6 -6
- package/dist/Navigation/Navigation.HeaderToolbar.js +5 -5
- package/dist/Navigation/Navigation.Menu.js +6 -6
- package/dist/Navigation/Navigation.MenuSection.js +2 -2
- package/dist/Navigation/Navigation.RowItem.d.ts +2 -2
- package/dist/Navigation/Navigation.RowItem.js +4 -4
- package/dist/Navigation/Navigation.SearchBar.d.ts +6 -1
- package/dist/Navigation/Navigation.SearchBar.js +33 -12
- package/dist/Navigation/Navigation.SearchSuggestions.d.ts +14 -0
- package/dist/Navigation/Navigation.SearchSuggestions.js +7 -0
- package/dist/Navigation/Navigation.SegmentedControl.d.ts +3 -1
- package/dist/Navigation/Navigation.SegmentedControl.js +6 -5
- package/dist/Navigation/Navigation.Steps.js +5 -5
- package/dist/Navigation/Navigation.TabIcon.js +2 -2
- package/dist/Navigation/Navigation.TabItem.js +2 -2
- package/dist/Navigation/Navigation.Tabs.js +5 -5
- package/dist/Navigation/index.d.ts +23 -19
- package/dist/Navigation/index.js +17 -15
- package/dist/Typography/Typography.Heading.d.ts +1 -1
- package/dist/Typography/Typography.Heading.js +2 -2
- package/dist/Typography/Typography.SelectableText.d.ts +10 -0
- package/dist/Typography/Typography.SelectableText.js +16 -0
- package/dist/Typography/Typography.Text.d.ts +2 -2
- package/dist/Typography/Typography.Text.js +5 -19
- package/dist/Typography/index.d.ts +5 -2
- package/dist/Typography/index.js +5 -2
- package/dist/branding.d.ts +22 -0
- package/dist/branding.js +20 -3
- package/dist/icons/AddItemIcon.d.ts +1 -1
- package/dist/icons/ArrangeCircle.d.ts +1 -1
- package/dist/icons/ArrowDownIcon.d.ts +1 -1
- package/dist/icons/ArrowUpIcon.d.ts +1 -1
- package/dist/icons/BoxIcon.d.ts +1 -1
- package/dist/icons/BoxTimeIcon.d.ts +1 -1
- package/dist/icons/CalendarIcon.d.ts +1 -1
- package/dist/icons/CardIcon.d.ts +1 -1
- package/dist/icons/CashierIcon.d.ts +1 -1
- package/dist/icons/DuoIcon.d.ts +1 -1
- package/dist/icons/HomeIcon.d.ts +1 -1
- package/dist/icons/HomeIconOutlined.d.ts +1 -1
- package/dist/icons/LogoIcon.d.ts +1 -1
- package/dist/icons/MoneyReceiveIcon.d.ts +1 -1
- package/dist/icons/PinIcon.d.ts +1 -1
- package/dist/icons/PrinterIcon.d.ts +1 -1
- package/dist/icons/ProfileIcon.d.ts +1 -1
- package/dist/icons/SettingsIcon.d.ts +1 -1
- package/dist/icons/SinpeIcon.d.ts +1 -1
- package/dist/icons/ToggleOffIcon.d.ts +1 -1
- package/dist/icons/WalletMoneyIcon.d.ts +1 -1
- package/dist/index.d.ts +24 -23
- package/dist/index.js +26 -24
- package/dist/layouts/AuthContainer.d.ts +9 -3
- package/dist/layouts/AuthContainer.js +8 -8
- package/dist/layouts/Container.js +1 -1
- package/dist/layouts/GradientContainer.js +1 -1
- package/dist/layouts/ScrollContainer.js +1 -1
- package/dist/layouts/TabNavigatorLayout.js +4 -4
- package/dist/primitives/AspectRatio.js +1 -1
- package/dist/primitives/BaseButton.d.ts +92 -87
- package/dist/primitives/BaseButton.js +52 -54
- package/dist/primitives/Box.js +1 -1
- package/dist/primitives/Pressable.js +1 -1
- package/dist/primitives/Row.js +1 -1
- package/dist/primitives/Stack.js +1 -1
- package/dist/primitives/index.d.ts +6 -6
- package/dist/primitives/index.js +6 -6
- package/dist/theme/active.d.ts +1 -1
- package/dist/theme/active.js +14 -1
- package/dist/theme/build.d.ts +33 -0
- package/dist/theme/build.js +118 -0
- package/dist/theme/color.d.ts +26 -0
- package/dist/theme/color.js +109 -0
- package/dist/theme/components/index.d.ts +1 -1
- package/dist/theme/components/index.js +1 -1
- package/dist/theme/contrast.d.ts +29 -0
- package/dist/theme/contrast.js +57 -0
- package/dist/theme/css-vars.d.ts +3 -1
- package/dist/theme/css-vars.js +29 -3
- package/dist/theme/dark.d.ts +3 -4
- package/dist/theme/dark.js +91 -48
- package/dist/theme/default.d.ts +5 -1
- package/dist/theme/default.js +89 -41
- package/dist/theme/define.d.ts +4 -1
- package/dist/theme/define.js +4 -1
- package/dist/theme/globals.css +61 -46
- package/dist/theme/index.d.ts +14 -10
- package/dist/theme/index.js +13 -9
- package/dist/theme/theme.d.ts +1 -1
- package/dist/theme/theme.js +2 -2
- package/dist/theme/types.d.ts +77 -16
- package/dist/theme/types.js +13 -3
- package/dist/theme/typography.d.ts +19 -4
- package/dist/theme/typography.js +45 -28
- package/dist/theme/useTheme.d.ts +1 -1
- package/dist/theme/useTheme.js +1 -1
- package/dist/theme/validate.d.ts +16 -0
- package/dist/theme/validate.js +200 -0
- package/dist/tokens/index.d.ts +2 -2
- package/dist/tokens/index.js +2 -2
- package/dist/utils/criteria.d.ts +56 -0
- package/dist/utils/criteria.js +99 -0
- package/dist/utils/reorder.d.ts +4 -0
- package/dist/utils/reorder.js +32 -0
- package/dist/views/AppSplashView.d.ts +2 -2
- package/dist/views/AppSplashView.js +3 -3
- package/dist/views/AuthFormView.d.ts +5 -2
- package/dist/views/AuthFormView.js +5 -5
- package/dist/views/FormViewV2.d.ts +9 -4
- package/dist/views/FormViewV2.js +44 -25
- package/dist/views/ListViewV2.d.ts +12 -9
- package/dist/views/ListViewV2.js +49 -36
- package/dist/views/Wizard/Wizard.context.js +1 -1
- package/dist/views/Wizard/Wizard.d.ts +1 -1
- package/dist/views/Wizard/Wizard.js +1 -1
- package/dist/views/Wizard/index.d.ts +4 -4
- package/dist/views/Wizard/index.js +2 -2
- package/dist/views/types/IFormView.d.ts +1 -1
- package/dist/views/types/IListView.d.ts +1 -1
- package/dist/widgets/CircleButton.d.ts +2 -2
- package/dist/widgets/CircleButton.js +1 -1
- package/dist/widgets/CollectionOptions.d.ts +15 -0
- package/dist/widgets/CollectionOptions.js +127 -0
- package/dist/widgets/FilterBar.d.ts +21 -0
- package/dist/widgets/FilterBar.js +14 -0
- package/dist/widgets/FilterBuilder.d.ts +10 -0
- package/dist/widgets/FilterBuilder.js +115 -0
- package/dist/widgets/GeoPermissionCard.js +3 -3
- package/dist/widgets/HomeHeader.js +3 -3
- package/dist/widgets/JSONViewer.js +2 -2
- package/dist/widgets/MenuCard.d.ts +2 -2
- package/dist/widgets/MenuCard.js +1 -1
- package/dist/widgets/MenuGrid.d.ts +3 -3
- package/dist/widgets/MenuGrid.js +1 -1
- package/dist/widgets/MenuSection.d.ts +2 -2
- package/dist/widgets/MenuSection.js +1 -1
- package/dist/widgets/PromoBanner.js +3 -3
- package/dist/widgets/PromoModal.js +3 -3
- package/dist/widgets/QueryChoice.d.ts +10 -0
- package/dist/widgets/QueryChoice.js +13 -0
- package/dist/widgets/QuickActions.js +3 -3
- package/dist/widgets/ReorderableList.d.ts +51 -0
- package/dist/widgets/ReorderableList.js +138 -0
- package/dist/widgets/ScreenHeader.js +2 -2
- package/dist/widgets/TimeZoneSelector.d.ts +1 -1
- package/dist/widgets/TimeZoneSelector.js +4 -4
- package/dist/widgets/TimeZoneSelectorModal.d.ts +1 -1
- package/dist/widgets/TimeZoneSelectorModal.js +5 -5
- package/dist/widgets/index.d.ts +20 -16
- package/dist/widgets/index.js +13 -10
- package/package.json +70 -50
- package/tailwind.preset.js +19 -0
- package/dist/icons/icon_getters.d.ts +0 -6
- package/dist/icons/icon_getters.js +0 -23
|
@@ -1,35 +1,48 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
-
import { theme } from "../theme";
|
|
3
|
-
import { cn, tv } from "../theme/tw";
|
|
2
|
+
import { theme } from "../theme/index.js";
|
|
3
|
+
import { cn, tv } from "../theme/tw.js";
|
|
4
4
|
import { LinearGradient } from "expo-linear-gradient";
|
|
5
5
|
import { View } from "react-native";
|
|
6
6
|
/**
|
|
7
|
-
* Decorative gradient presets
|
|
8
|
-
*
|
|
9
|
-
* Each is [from, …, to].
|
|
7
|
+
* Decorative gradient presets. `brand` is themeable (reads `theme.gradient.primary`) —
|
|
8
|
+
* use it when you want the surface to follow whatever the app's active theme defines.
|
|
9
|
+
* Other presets are static constants for one-off uses. Each is [from, …, to].
|
|
10
10
|
*/
|
|
11
11
|
const GRADIENT_PRESETS = {
|
|
12
|
+
warm: {
|
|
13
|
+
colors: ["#1A1714", "#C89B3C", "#B88A2E"],
|
|
14
|
+
start: { x: 0, y: 0 },
|
|
15
|
+
end: { x: 1, y: 1 },
|
|
16
|
+
},
|
|
12
17
|
"neon-teal": {
|
|
13
|
-
colors: ["#
|
|
18
|
+
colors: ["#0F5C6E", "#5CC4D8"],
|
|
14
19
|
start: { x: 0, y: 0 },
|
|
15
20
|
end: { x: 1, y: 1 },
|
|
16
21
|
},
|
|
17
22
|
"night-green": {
|
|
18
|
-
colors: ["#
|
|
23
|
+
colors: ["#0B101E", "#18223A"],
|
|
19
24
|
start: { x: 0, y: 0 },
|
|
20
25
|
end: { x: 1, y: 1 },
|
|
21
26
|
},
|
|
22
27
|
mesh: {
|
|
23
|
-
colors: ["#
|
|
28
|
+
colors: ["#1C3765", "#2A4A85", "#8FA9E8"],
|
|
24
29
|
start: { x: 0, y: 0 },
|
|
25
30
|
end: { x: 1, y: 1 },
|
|
26
31
|
},
|
|
27
32
|
emerald: {
|
|
28
|
-
colors: ["#
|
|
33
|
+
colors: ["#2F6B3C", "#6FCF8B"],
|
|
29
34
|
start: { x: 0, y: 0 },
|
|
30
35
|
end: { x: 1, y: 1 },
|
|
31
36
|
},
|
|
32
37
|
};
|
|
38
|
+
/**
|
|
39
|
+
* Aliases kept for backwards compatibility. These were the original names; the
|
|
40
|
+
* canonical ones are above. Use the canonical names in new code.
|
|
41
|
+
* @deprecated use `warm` instead of `gold-mesh`.
|
|
42
|
+
*/
|
|
43
|
+
const DEPRECATED_PRESETS = {
|
|
44
|
+
"gold-mesh": "warm",
|
|
45
|
+
};
|
|
33
46
|
const surface = tv({
|
|
34
47
|
variants: {
|
|
35
48
|
radius: {
|
|
@@ -48,13 +61,16 @@ const surface = tv({
|
|
|
48
61
|
defaultVariants: { radius: "lg", padding: "none" },
|
|
49
62
|
});
|
|
50
63
|
/**
|
|
51
|
-
* Modern gradient surface
|
|
52
|
-
*
|
|
53
|
-
*
|
|
64
|
+
* Modern gradient surface. Wraps `expo-linear-gradient` with named presets +
|
|
65
|
+
* tokenized radius/padding. iOS + Android (no native dep beyond the already-peer
|
|
66
|
+
* `expo-linear-gradient`). Replaces the legacy `GradientContainer`.
|
|
54
67
|
*/
|
|
55
|
-
function GradientSurface({ preset = "
|
|
56
|
-
const
|
|
57
|
-
|
|
68
|
+
function GradientSurface({ preset = "warm", colors, start, end, radius, padding, children, className, style, testID, }) {
|
|
69
|
+
const resolvedPreset = (preset in DEPRECATED_PRESETS
|
|
70
|
+
? DEPRECATED_PRESETS[preset]
|
|
71
|
+
: preset);
|
|
72
|
+
const p = resolvedPreset === "brand" ? GRADIENT_PRESETS.warm : GRADIENT_PRESETS[resolvedPreset];
|
|
73
|
+
const presetColors = resolvedPreset === "brand" ? theme.gradient.primary : p.colors;
|
|
58
74
|
const resolvedColors = (colors ?? presetColors);
|
|
59
75
|
return (_jsxs(View, { className: cn("overflow-hidden", surface({ radius })), style: style, testID: testID, children: [_jsx(LinearGradient, { colors: [...resolvedColors], end: end ?? p.end, start: start ?? p.start, style: { position: "absolute", top: 0, left: 0, right: 0, bottom: 0 } }), _jsx(View, { className: cn(surface({ padding }), className), children: children })] }));
|
|
60
76
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
2
2
|
import { AntDesign, Feather, FontAwesome, FontAwesome5, Ionicons, MaterialCommunityIcons, MaterialIcons, SimpleLineIcons, } from "@expo/vector-icons";
|
|
3
|
-
import {
|
|
3
|
+
import { useTheme } from "../theme/index.js";
|
|
4
4
|
import { View } from "react-native";
|
|
5
5
|
const Icon = ({ name, size = 24, color, type = "ionicons", customIcon, className, }) => {
|
|
6
|
+
const theme = useTheme();
|
|
6
7
|
const iconColor = color || theme.text.primary;
|
|
7
8
|
const renderIcon = () => {
|
|
8
9
|
if (type === "custom" && customIcon) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
-
import Pressable from "../primitives/Pressable";
|
|
3
|
-
import { theme } from "../theme";
|
|
4
|
-
import { Typography } from "../Typography";
|
|
2
|
+
import Pressable from "../primitives/Pressable.js";
|
|
3
|
+
import { theme } from "../theme/index.js";
|
|
4
|
+
import { Typography } from "../Typography/index.js";
|
|
5
5
|
import { View } from "react-native";
|
|
6
6
|
function IconBadge({ children, count, max = 99, dot = false, color, onPress, accessibilityLabel, testID, }) {
|
|
7
7
|
const showCount = typeof count === "number" && count > 0;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
-
import Icon from "
|
|
3
|
-
import Skeleton from "../Feedback/Feedback.Skeleton";
|
|
4
|
-
import { theme } from "../theme";
|
|
5
|
-
import { cn } from "../theme/tw";
|
|
2
|
+
import Icon from "./Display.Icon.js";
|
|
3
|
+
import Skeleton from "../Feedback/Feedback.Skeleton.js";
|
|
4
|
+
import { theme } from "../theme/index.js";
|
|
5
|
+
import { cn } from "../theme/tw.js";
|
|
6
6
|
import { useState } from "react";
|
|
7
7
|
import { Image, View, } from "react-native";
|
|
8
8
|
function DisplayImage({ source, width = "100%", height, aspectRatio, radius = 12, resizeMode = "cover", fallbackIcon = "image-outline", className, style, testID, }) {
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
|
|
2
|
+
interface KeyValueLayoutProps {
|
|
3
3
|
label: string;
|
|
4
|
-
|
|
5
|
-
align?: "row" | "stacked";
|
|
4
|
+
align?: "row" | "stacked" | "auto";
|
|
6
5
|
className?: string;
|
|
7
6
|
testID?: string;
|
|
7
|
+
selectable?: boolean;
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
export type KeyValueProps = KeyValueLayoutProps & ({
|
|
10
|
+
copyable: true;
|
|
11
|
+
value: string | number;
|
|
12
|
+
} | {
|
|
13
|
+
copyable?: false;
|
|
14
|
+
value?: ReactNode;
|
|
15
|
+
});
|
|
16
|
+
declare function KeyValue({ label, value, align, className, testID, copyable, selectable, }: KeyValueProps): import("react").JSX.Element;
|
|
10
17
|
export default KeyValue;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
-
import { cn } from "../theme/tw";
|
|
3
|
-
import { Typography } from "../Typography";
|
|
4
|
-
import { View } from "react-native";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { cn } from "../theme/tw.js";
|
|
3
|
+
import { Typography } from "../Typography/index.js";
|
|
4
|
+
import { useWindowDimensions, View } from "react-native";
|
|
5
|
+
import CopyableText from "./Display.CopyableText";
|
|
6
|
+
function KeyValue({ label, value, align = "row", className, testID, copyable = false, selectable = false, }) {
|
|
7
|
+
const { width, fontScale } = useWindowDimensions();
|
|
8
|
+
const isRow = align === "row" || (align === "auto" && width >= 360 && fontScale <= 1.3);
|
|
9
|
+
return (_jsxs(View, { className: cn(isRow ? "flex-row items-center justify-between gap-3" : "gap-0.5", "py-2", className), testID: testID, children: [_jsx(Typography.Text, { className: "text-text-secondary", variant: "caption", children: label }), typeof value === "string" || typeof value === "number" ? (_jsx(View, { className: cn("flex-shrink min-w-0", isRow && "flex-1 items-end"), children: copyable ? (_jsx(CopyableText, { accessibilityLabel: `Copiar ${label}`, selectable: selectable, value: String(value) })) : selectable ? (_jsx(Typography.SelectableText, { className: cn("text-text-primary", isRow && "text-right"), semibold: isRow, style: { alignSelf: "stretch" }, value: String(value) })) : (_jsx(Typography.Text, { className: cn("text-text-primary", isRow && "text-right"), selectable: selectable, semibold: isRow, children: value })) })) : (value)] }));
|
|
8
10
|
}
|
|
9
11
|
export default KeyValue;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type SectionHeaderAction, type SectionHeaderProps } from "./Display.SectionHeader.js";
|
|
2
|
+
import { Typography } from "../Typography/index.js";
|
|
3
|
+
import { type ComponentProps, type ReactNode } from "react";
|
|
4
|
+
import { type StyleProp, type ViewStyle } from "react-native";
|
|
5
|
+
export interface ListGroupProps {
|
|
6
|
+
title: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
footer?: ReactNode;
|
|
9
|
+
action?: SectionHeaderAction;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
surface?: "inset" | "plain";
|
|
12
|
+
separators?: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
contentClassName?: string;
|
|
15
|
+
testID?: string;
|
|
16
|
+
headerProps?: Omit<SectionHeaderProps, "title" | "subtitle" | "action">;
|
|
17
|
+
footerTextProps?: Omit<ComponentProps<typeof Typography.Text>, "children">;
|
|
18
|
+
style?: StyleProp<ViewStyle>;
|
|
19
|
+
contentStyle?: StyleProp<ViewStyle>;
|
|
20
|
+
separatorStyle?: StyleProp<ViewStyle>;
|
|
21
|
+
}
|
|
22
|
+
declare function ListGroup({ title, description, footer, action, children, surface, separators, className, contentClassName, testID, headerProps, footerTextProps, style, contentStyle, separatorStyle, }: ListGroupProps): import("react").JSX.Element;
|
|
23
|
+
export default ListGroup;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
+
import SectionHeader from "./Display.SectionHeader.js";
|
|
3
|
+
import { cn } from "../theme/tw.js";
|
|
4
|
+
import { Typography } from "../Typography/index.js";
|
|
5
|
+
import { Children } from "react";
|
|
6
|
+
import { StyleSheet, View } from "react-native";
|
|
7
|
+
function ListGroup({ title, description, footer, action, children, surface = "inset", separators = true, className, contentClassName, testID, headerProps, footerTextProps, style, contentStyle, separatorStyle, }) {
|
|
8
|
+
const rows = Children.toArray(children);
|
|
9
|
+
return (_jsxs(View, { className: cn("gap-2", className), style: style, testID: testID, children: [_jsx(SectionHeader, { ...headerProps, action: action, subtitle: description, title: title }), _jsx(View, { className: cn(surface === "inset" && "rounded-2xl bg-bg-card overflow-hidden", contentClassName), style: contentStyle, testID: testID ? `${testID}-content` : undefined, children: rows.map((row, index) => (_jsxs(View, { children: [row, separators && index < rows.length - 1 ? (_jsx(View, { accessibilityElementsHidden: true, className: "bg-border-default", importantForAccessibility: "no-hide-descendants", style: [
|
|
10
|
+
{
|
|
11
|
+
height: StyleSheet.hairlineWidth,
|
|
12
|
+
marginHorizontal: 16,
|
|
13
|
+
},
|
|
14
|
+
separatorStyle,
|
|
15
|
+
], testID: testID ? `${testID}-separator-${index}` : undefined })) : null] }, typeof row === "object" && "key" in row ? row.key : index))) }), typeof footer === "string" ? (_jsx(Typography.Text, { className: "text-text-secondary px-4", variant: "bodySmall", ...footerTextProps, children: footer })) : (footer)] }));
|
|
16
|
+
}
|
|
17
|
+
export default ListGroup;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Typography } from "../Typography/index.js";
|
|
2
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
3
|
+
import { type StyleProp, type ViewStyle } from "react-native";
|
|
2
4
|
export interface ListItemProps {
|
|
3
5
|
title: string;
|
|
4
6
|
subtitle?: string;
|
|
@@ -12,6 +14,18 @@ export interface ListItemProps {
|
|
|
12
14
|
showDivider?: boolean;
|
|
13
15
|
className?: string;
|
|
14
16
|
testID?: string;
|
|
17
|
+
accessibleSizing?: boolean;
|
|
18
|
+
accessibilityLabel?: string;
|
|
19
|
+
accessibilityHint?: string;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
variant?: "default" | "mobile";
|
|
22
|
+
value?: string;
|
|
23
|
+
layout?: "auto" | "row" | "stacked";
|
|
24
|
+
density?: "compact" | "comfortable";
|
|
25
|
+
style?: StyleProp<ViewStyle>;
|
|
26
|
+
titleTextProps?: Omit<ComponentProps<typeof Typography.Text>, "children">;
|
|
27
|
+
subtitleTextProps?: Omit<ComponentProps<typeof Typography.Text>, "children">;
|
|
28
|
+
valueTextProps?: Omit<ComponentProps<typeof Typography.Text>, "children">;
|
|
15
29
|
}
|
|
16
|
-
declare function ListItem({ title, subtitle, leading, trailing, chevron, onPress, showDivider, className, testID, }: ListItemProps): import("react").JSX.Element;
|
|
30
|
+
declare function ListItem({ title, subtitle, leading, trailing, chevron, onPress, showDivider, className, testID, accessibleSizing, accessibilityLabel, accessibilityHint, disabled, variant, value, layout, density, style, titleTextProps, subtitleTextProps, valueTextProps, }: ListItemProps): import("react").JSX.Element;
|
|
17
31
|
export default ListItem;
|
|
@@ -1,18 +1,35 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "nativewind/jsx-runtime";
|
|
2
|
-
import Icon from "
|
|
3
|
-
import Pressable from "../primitives/Pressable";
|
|
4
|
-
import {
|
|
5
|
-
import { cn } from "../theme/tw";
|
|
6
|
-
import { Typography } from "../Typography";
|
|
7
|
-
import { View } from "react-native";
|
|
8
|
-
function ListItem({ title, subtitle, leading, trailing, chevron = false, onPress, showDivider =
|
|
2
|
+
import Icon from "./Display.Icon.js";
|
|
3
|
+
import Pressable from "../primitives/Pressable.js";
|
|
4
|
+
import { useTheme } from "../theme/index.js";
|
|
5
|
+
import { cn } from "../theme/tw.js";
|
|
6
|
+
import { Typography } from "../Typography/index.js";
|
|
7
|
+
import { Pressable as NativePressable, useWindowDimensions, View, } from "react-native";
|
|
8
|
+
function ListItem({ title, subtitle, leading, trailing, chevron = false, onPress, showDivider, className, testID, accessibleSizing = false, accessibilityLabel, accessibilityHint, disabled = false, variant = "default", value, layout = "auto", density = "compact", style, titleTextProps, subtitleTextProps, valueTextProps, }) {
|
|
9
|
+
const theme = useTheme();
|
|
10
|
+
const { width, fontScale } = useWindowDimensions();
|
|
11
|
+
const mobile = variant === "mobile";
|
|
12
|
+
const comfortable = mobile && density === "comfortable";
|
|
13
|
+
const stacked = mobile &&
|
|
14
|
+
(value !== undefined || trailing != null) &&
|
|
15
|
+
(layout === "stacked" || (layout === "auto" && (fontScale > 1.3 || width < 360)));
|
|
9
16
|
const right = trailing ??
|
|
10
|
-
(chevron ? _jsx(Icon, { color: theme.icon.tertiary, name: "chevron-forward", size: 18 }) : null);
|
|
11
|
-
const content = (_jsxs(_Fragment, { children: [leading ? _jsx(View, { className: "mr-3 justify-center", children: leading }) : null, _jsxs(View, { className: "flex-1 gap-0.5", children: [_jsx(Typography.Text, { className: "text-text-primary", numberOfLines: 1, semibold:
|
|
12
|
-
const base = cn("flex-row items-center py-
|
|
17
|
+
(value || chevron ? (_jsxs(View, { className: "flex-row items-center gap-2", children: [value ? (_jsx(Typography.Text, { className: "text-text-secondary flex-shrink", variant: comfortable ? "bodyReadable" : "body", ...valueTextProps, children: value })) : null, chevron ? (_jsx(View, { accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", children: _jsx(Icon, { color: theme.icon.tertiary, name: "chevron-forward", size: 18 }) })) : null] })) : null);
|
|
18
|
+
const content = (_jsxs(_Fragment, { children: [leading ? _jsx(View, { className: "mr-3 justify-center", children: leading }) : null, _jsxs(View, { className: cn("flex-1", mobile ? "min-w-0 gap-1" : "gap-0.5"), children: [_jsx(Typography.Text, { className: mobile && disabled ? "text-text-disabled" : "text-text-primary", numberOfLines: mobile || accessibleSizing ? undefined : 1, semibold: !mobile || comfortable, variant: comfortable ? "bodyReadable" : "body", ...titleTextProps, children: title }), subtitle ? (_jsx(Typography.Text, { className: "text-text-secondary", numberOfLines: mobile || accessibleSizing ? undefined : 1, variant: comfortable ? "bodyLarge" : "bodySmall", ...subtitleTextProps, children: subtitle })) : null, stacked && right ? _jsx(View, { className: "self-start mt-1", children: right }) : null] }), !stacked && right ? (_jsx(View, { className: cn("ml-3 justify-center", mobile && "flex-shrink"), style: mobile ? { maxWidth: "45%" } : undefined, children: right })) : null] }));
|
|
19
|
+
const base = cn("flex-row items-center px-4", mobile && !comfortable ? "py-2" : "py-3", !mobile && "bg-bg-card", (showDivider ?? !mobile) && "border-b border-border-default", disabled && !mobile && "opacity-50", className);
|
|
13
20
|
if (onPress) {
|
|
14
|
-
|
|
21
|
+
if (mobile) {
|
|
22
|
+
return (_jsx(NativePressable, { accessibilityHint: accessibilityHint ?? subtitle, accessibilityLabel: accessibilityLabel ?? title, accessibilityRole: "button", accessibilityState: { disabled }, accessibilityValue: value !== undefined ? { text: value } : undefined, className: base, disabled: disabled, onPress: onPress, style: ({ pressed }) => [
|
|
23
|
+
{
|
|
24
|
+
minHeight: 48,
|
|
25
|
+
minWidth: 48,
|
|
26
|
+
backgroundColor: pressed ? theme.bg.hover : undefined,
|
|
27
|
+
},
|
|
28
|
+
style,
|
|
29
|
+
], testID: testID, children: content }));
|
|
30
|
+
}
|
|
31
|
+
return (_jsx(Pressable, { accessibilityHint: accessibilityHint, accessibilityLabel: accessibilityLabel, className: base, disabled: disabled, onPress: onPress, style: [accessibleSizing ? { minHeight: 48 } : undefined, style], testID: testID, children: content }));
|
|
15
32
|
}
|
|
16
|
-
return (_jsx(View, { className: base, testID: testID, children: content }));
|
|
33
|
+
return (_jsx(View, { className: base, style: style, testID: testID, children: content }));
|
|
17
34
|
}
|
|
18
35
|
export default ListItem;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type VariantProps } from "../theme/tw";
|
|
1
|
+
import { type VariantProps } from "../theme/tw.js";
|
|
2
2
|
import { FC } from "react";
|
|
3
3
|
import { type ImageSourcePropType } from "react-native";
|
|
4
4
|
declare const logo: import("tailwind-variants").TVReturnType<{
|
|
@@ -31,7 +31,7 @@ declare const logo: import("tailwind-variants").TVReturnType<{
|
|
|
31
31
|
}, {
|
|
32
32
|
container: string;
|
|
33
33
|
image: string;
|
|
34
|
-
}, import("tailwind-variants").
|
|
34
|
+
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
35
35
|
size: {
|
|
36
36
|
small: {
|
|
37
37
|
image: string;
|
|
@@ -46,7 +46,7 @@ declare const logo: import("tailwind-variants").TVReturnType<{
|
|
|
46
46
|
}, {
|
|
47
47
|
container: string;
|
|
48
48
|
image: string;
|
|
49
|
-
}
|
|
49
|
+
}>>;
|
|
50
50
|
export interface LogoProps extends VariantProps<typeof logo> {
|
|
51
51
|
source?: ImageSourcePropType;
|
|
52
52
|
className?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
2
|
-
import { getBrandingLogo } from "../branding";
|
|
3
|
-
import { tv } from "../theme/tw";
|
|
2
|
+
import { getBrandingLogo } from "../branding.js";
|
|
3
|
+
import { tv } from "../theme/tw.js";
|
|
4
4
|
import { Image, View } from "react-native";
|
|
5
5
|
const logo = tv({
|
|
6
6
|
slots: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
-
import DisplayImage from "
|
|
3
|
-
import Pressable from "../primitives/Pressable";
|
|
4
|
-
import { cn } from "../theme/tw";
|
|
5
|
-
import { Typography } from "../Typography";
|
|
2
|
+
import DisplayImage from "./Display.Image.js";
|
|
3
|
+
import Pressable from "../primitives/Pressable.js";
|
|
4
|
+
import { cn } from "../theme/tw.js";
|
|
5
|
+
import { Typography } from "../Typography/index.js";
|
|
6
6
|
import { LinearGradient } from "expo-linear-gradient";
|
|
7
7
|
import { View } from "react-native";
|
|
8
8
|
function MediaCard({ image, title, subtitle, badge, overlay, aspectRatio = 16 / 9, height, radius = 16, onPress, className, testID, }) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
-
import Icon from "
|
|
3
|
-
import DisplayImage from "
|
|
4
|
-
import Pressable from "../primitives/Pressable";
|
|
5
|
-
import { theme } from "../theme";
|
|
6
|
-
import { cn } from "../theme/tw";
|
|
7
|
-
import { Typography } from "../Typography";
|
|
2
|
+
import Icon from "./Display.Icon.js";
|
|
3
|
+
import DisplayImage from "./Display.Image.js";
|
|
4
|
+
import Pressable from "../primitives/Pressable.js";
|
|
5
|
+
import { theme } from "../theme/index.js";
|
|
6
|
+
import { cn } from "../theme/tw.js";
|
|
7
|
+
import { Typography } from "../Typography/index.js";
|
|
8
8
|
import { View } from "react-native";
|
|
9
9
|
/**
|
|
10
10
|
* Linkable short-video card (Short/TikTok/Reel): thumbnail + play + duration.
|
|
@@ -23,7 +23,7 @@ function MediaEmbed({ thumbnail, onPress, duration, title, source, aspectRatio =
|
|
|
23
23
|
}, children: _jsx(View, { style: {
|
|
24
24
|
width: 44,
|
|
25
25
|
height: 44,
|
|
26
|
-
borderRadius:
|
|
26
|
+
borderRadius: 16,
|
|
27
27
|
backgroundColor: "rgba(0,0,0,0.55)",
|
|
28
28
|
alignItems: "center",
|
|
29
29
|
justifyContent: "center",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type SwipeRowAction } from "
|
|
2
|
-
import { type VariantProps } from "../theme/tw";
|
|
1
|
+
import { type SwipeRowAction } from "./Display.SwipeableRow.js";
|
|
2
|
+
import { type VariantProps } from "../theme/tw.js";
|
|
3
3
|
import { ComponentType, ReactNode } from "react";
|
|
4
4
|
export type MenuButtonSwipeAction = SwipeRowAction;
|
|
5
5
|
/**
|
|
@@ -70,7 +70,7 @@ declare const menuButton: import("tailwind-variants").TVReturnType<{
|
|
|
70
70
|
content: string;
|
|
71
71
|
label: string;
|
|
72
72
|
rightContainer: string;
|
|
73
|
-
}, import("tailwind-variants").
|
|
73
|
+
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
74
74
|
variant: {
|
|
75
75
|
default: {
|
|
76
76
|
iconContainer: string;
|
|
@@ -101,7 +101,7 @@ declare const menuButton: import("tailwind-variants").TVReturnType<{
|
|
|
101
101
|
content: string;
|
|
102
102
|
label: string;
|
|
103
103
|
rightContainer: string;
|
|
104
|
-
}
|
|
104
|
+
}>>;
|
|
105
105
|
export interface MenuButtonProps extends VariantProps<typeof menuButton> {
|
|
106
106
|
icon?: ComponentType<{
|
|
107
107
|
size?: number;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
-
import SwipeableRow from "
|
|
3
|
-
import Spinner from "../Feedback/Feedback.Spinner";
|
|
4
|
-
import { useTheme } from "../theme";
|
|
5
|
-
import { tv } from "../theme/tw";
|
|
6
|
-
import { Typography } from "../Typography";
|
|
2
|
+
import SwipeableRow from "./Display.SwipeableRow.js";
|
|
3
|
+
import Spinner from "../Feedback/Feedback.Spinner.js";
|
|
4
|
+
import { useTheme } from "../theme/index.js";
|
|
5
|
+
import { tv } from "../theme/tw.js";
|
|
6
|
+
import { Typography } from "../Typography/index.js";
|
|
7
7
|
import { Switch, TouchableOpacity, View } from "react-native";
|
|
8
8
|
function BadgeChip({ badge }) {
|
|
9
9
|
const theme = useTheme();
|
|
@@ -98,7 +98,7 @@ function MenuButton({ icon: IconComp, label, description, onPress, rightComponen
|
|
|
98
98
|
if (rightComponent)
|
|
99
99
|
return rightComponent;
|
|
100
100
|
if (toggle) {
|
|
101
|
-
return (_jsx(Switch, { onValueChange: toggle.onToggle, thumbColor: theme.bg.card, trackColor: { false: theme.border.strong, true: theme.
|
|
101
|
+
return (_jsx(Switch, { onValueChange: toggle.onToggle, thumbColor: theme.bg.card, trackColor: { false: theme.border.strong, true: theme.primary }, value: toggle.value }));
|
|
102
102
|
}
|
|
103
103
|
const hasBadge = badge != null;
|
|
104
104
|
const hasValue = !!value;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
-
import CircleButton from "
|
|
3
|
-
import { useTheme } from "../theme";
|
|
4
|
-
import { Typography } from "../Typography";
|
|
2
|
+
import CircleButton from "./Display.CircleButton.js";
|
|
3
|
+
import { useTheme } from "../theme/index.js";
|
|
4
|
+
import { Typography } from "../Typography/index.js";
|
|
5
5
|
import { TouchableOpacity, View } from "react-native";
|
|
6
6
|
export function MenuCard({ title, iconType = "ionicons", onPress, customIcon, size = "md", }) {
|
|
7
7
|
const theme = useTheme();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
2
|
-
import MenuCard from "
|
|
2
|
+
import MenuCard from "./Display.MenuCard.js";
|
|
3
3
|
import { View } from "react-native";
|
|
4
4
|
export function MenuGrid({ items, size = "md" }) {
|
|
5
5
|
return (_jsx(View, { className: "flex-row flex-wrap justify-start p-2 bg-bg-page", children: items.map((item) => (_jsx(MenuCard, { customIcon: item.customIcon, iconType: item.iconType, onPress: item.onPress, size: size, title: item.title }, item.id))) }));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
-
import { Typography } from "../Typography";
|
|
3
|
-
import { formatTwoDecimals } from "../utils/monetary";
|
|
2
|
+
import { Typography } from "../Typography/index.js";
|
|
3
|
+
import { formatTwoDecimals } from "../utils/monetary.js";
|
|
4
4
|
function MonetaryField({ value, currencySymbol = "₡", prefix = "", color, textVariant = "data", style = {}, symbolColor, semibold = true, bold = false, className, }) {
|
|
5
5
|
const isEmptyValue = value === null || value === undefined || value === "";
|
|
6
6
|
const formatted = isEmptyValue ? "0.00" : formatTwoDecimals(value);
|
|
@@ -1,14 +1,33 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
|
|
1
|
+
import { type PatternMode } from "../theme/index.js";
|
|
2
|
+
import { type ImageSourcePropType, type ViewStyle } from "react-native";
|
|
3
|
+
export type PatternKind = "dots" | "grid" | "diagonals" | "mesh";
|
|
4
|
+
/**
|
|
5
|
+
* Resolved mesh params per mode. The bundled asset (`assets/brand-mesh.png`) is a
|
|
6
|
+
* black symbol on transparent bg, so the two dark modes flip it via SVG ColorMatrix
|
|
7
|
+
* to produce a light symbol on the dark surface. To swap the asset, pass `meshSrc` on
|
|
8
|
+
* the `<Display.Pattern />` consumer or override `theme.pattern.source`.
|
|
9
|
+
*/
|
|
10
|
+
declare const MESH_PRESETS: Record<PatternMode, {
|
|
11
|
+
opacity: number;
|
|
12
|
+
invert: boolean;
|
|
13
|
+
size: number;
|
|
14
|
+
}>;
|
|
3
15
|
export interface PatternProps {
|
|
4
|
-
/** Texture kind (
|
|
16
|
+
/** Texture kind (dots / grid / diagonals / mesh). mesh = symbol asset tiled via SVG <Image>. */
|
|
5
17
|
kind?: PatternKind;
|
|
6
|
-
/** Line/dot color (any color string; use a token value for theming). */
|
|
18
|
+
/** Line/dot color (any color string; use a token value for theming). Ignored for `mesh`. */
|
|
7
19
|
color?: string;
|
|
8
|
-
/**
|
|
20
|
+
/** Override the `mode` for `mesh`. Defaults to `theme.pattern.mode`. */
|
|
21
|
+
mode?: PatternMode;
|
|
22
|
+
/** Override tile opacity 0–1. Defaults per `mode`. */
|
|
9
23
|
opacity?: number;
|
|
10
|
-
/**
|
|
24
|
+
/** Override tile size in px. Defaults per `mode`. */
|
|
11
25
|
size?: number;
|
|
26
|
+
/** Override invert (mesh only). Defaults per `mode`. */
|
|
27
|
+
invert?: boolean;
|
|
28
|
+
/** Override the mesh asset. Resolution order: this prop → `theme.pattern.source` →
|
|
29
|
+
* `setBranding({ mesh })` → bundled default `assets/brand-mesh.png`. */
|
|
30
|
+
meshSrc?: ImageSourcePropType;
|
|
12
31
|
/** Absolute-fill the parent as a background layer. Default true. */
|
|
13
32
|
absoluteFill?: boolean;
|
|
14
33
|
className?: string;
|
|
@@ -16,11 +35,13 @@ export interface PatternProps {
|
|
|
16
35
|
testID?: string;
|
|
17
36
|
}
|
|
18
37
|
/**
|
|
19
|
-
* Decorative SVG texture
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
38
|
+
* Decorative SVG texture used as a background layer. Geometric kinds (dots / grid /
|
|
39
|
+
* diagonals) render inline SVG primitives; `mesh` tiles the symbol asset via
|
|
40
|
+
* `<Pattern>` + `<Image>`, flipping it via SVG `<feColorMatrix>` on dark variants. The
|
|
41
|
+
* three modes — `light-pattern` / `dark-pattern` / `dark-full` — are picked per screen
|
|
42
|
+
* (or via `theme.pattern.mode`); see `MESH_PRESETS` for the resolved opacity/invert.
|
|
43
|
+
* Pure SVG — iOS + Android, no native dep beyond `react-native-svg`.
|
|
23
44
|
*/
|
|
24
|
-
declare function Pattern({ kind, color, opacity, size, absoluteFill, className, style, testID, }: PatternProps): import("react").JSX.Element;
|
|
45
|
+
declare function Pattern({ kind, color, mode, opacity, size, invert, meshSrc, absoluteFill, className, style, testID, }: PatternProps): import("react").JSX.Element;
|
|
25
46
|
export default Pattern;
|
|
26
|
-
export { Pattern };
|
|
47
|
+
export { MESH_PRESETS, Pattern };
|