@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,15 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
-
import { Display } from "../Display";
|
|
3
|
-
import GradientSurface from "../Display/Display.GradientSurface";
|
|
4
|
-
import { Pattern } from "../Display/Display.Pattern";
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
2
|
+
import { Display } from "../Display/index.js";
|
|
3
|
+
import GradientSurface from "../Display/Display.GradientSurface.js";
|
|
4
|
+
import { Pattern } from "../Display/Display.Pattern.js";
|
|
5
|
+
import KeyboardForm from "../Form/Form.KeyboardForm.js";
|
|
6
|
+
import { useTheme } from "../theme/index.js";
|
|
7
|
+
import { cn } from "../theme/tw.js";
|
|
7
8
|
import { Keyboard, TouchableOpacity, TouchableWithoutFeedback, useWindowDimensions, View, } from "react-native";
|
|
8
|
-
import { KeyboardAwareScrollView } from "react-native-keyboard-controller";
|
|
9
9
|
import { SafeAreaView } from "react-native-safe-area-context";
|
|
10
|
-
function AuthContainer({ header, children, onBackPress, background, className, }) {
|
|
10
|
+
function AuthContainer({ header, children, onBackPress, background, className, keyboardToolbar = false, keyboardFormProps, }) {
|
|
11
11
|
const { height: screenHeight } = useWindowDimensions();
|
|
12
12
|
const theme = useTheme();
|
|
13
|
-
return (_jsxs(GradientSurface, { className: cn("flex-1", className), colors: background?.colors, end: background?.end ?? (background?.colors ? { x: 0, y: 1 } : undefined), preset: background?.surface ?? "
|
|
13
|
+
return (_jsxs(GradientSurface, { className: cn("flex-1", className), colors: background?.colors, end: background?.end ?? (background?.colors ? { x: 0, y: 1 } : undefined), preset: background?.surface ?? "warm", radius: "none", start: background?.start ?? (background?.colors ? { x: 0, y: 0 } : undefined), style: { flex: 1 }, children: [background?.pattern ? (_jsx(Pattern, { color: background.patternColor ?? "#FFFFFF", kind: background.pattern, opacity: background.patternOpacity ?? 0.18 })) : null, _jsx(SafeAreaView, { className: "flex-1", edges: ["top"], children: _jsxs(View, { className: "flex-1", children: [_jsx(TouchableWithoutFeedback, { onPress: Keyboard.dismiss, children: _jsxs(View, { className: "justify-center items-center relative", style: { height: screenHeight * 0.3 }, children: [onBackPress && (_jsx(TouchableOpacity, { className: "absolute top-4 left-4 p-2 z-[1]", onPress: onBackPress, children: _jsx(Display.Icon, { color: background?.textColor ?? theme.text.inverse, name: "arrow-back", size: 24, type: "ionicons" }) })), header] }) }), _jsx(View, { className: "flex-1 bg-bg-card rounded-t-3xl shadow-lg", style: { minHeight: screenHeight * 0.7 }, children: _jsx(KeyboardForm, { bottomOffset: keyboardToolbar ? undefined : 50, bounces: false, className: "flex-1", contentContainerClassName: "flex-grow pb-10", keyboardShouldPersistTaps: "handled", showsVerticalScrollIndicator: false, ...keyboardFormProps, toolbar: keyboardToolbar, children: _jsx(View, { className: "p-4", children: children }) }) })] }) })] }));
|
|
14
14
|
}
|
|
15
15
|
export default AuthContainer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
-
import { cn } from "../theme/tw";
|
|
2
|
+
import { cn } from "../theme/tw.js";
|
|
3
3
|
import { StatusBar } from "react-native";
|
|
4
4
|
import { SafeAreaView } from "react-native-safe-area-context";
|
|
5
5
|
const Container = ({ children, style, barStyle = "light-content", statusBarHidden = false, edges = ["top", "bottom", "left", "right"], className, }) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
2
|
-
import { theme } from "../theme";
|
|
2
|
+
import { theme } from "../theme/index.js";
|
|
3
3
|
import { LinearGradient } from "expo-linear-gradient";
|
|
4
4
|
const GradientContainer = ({ children, style, className }) => {
|
|
5
5
|
const gradientColors = theme.gradient.primary;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
-
import { cn } from "../theme/tw";
|
|
2
|
+
import { cn } from "../theme/tw.js";
|
|
3
3
|
import { KeyboardAvoidingView, Platform, ScrollView, StatusBar, View } from "react-native";
|
|
4
4
|
import { SafeAreaView } from "react-native-safe-area-context";
|
|
5
5
|
function ScrollContainer({ children, contentContainerStyle = {}, className, }) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "nativewind/jsx-runtime";
|
|
2
|
-
import DisplayIcon from "../Display/Display.Icon";
|
|
3
|
-
import Container from "
|
|
4
|
-
import { Typography } from "../Typography";
|
|
2
|
+
import DisplayIcon from "../Display/Display.Icon.js";
|
|
3
|
+
import Container from "./Container.js";
|
|
4
|
+
import { Typography } from "../Typography/index.js";
|
|
5
5
|
import { Children, isValidElement } from "react";
|
|
6
6
|
import { TouchableOpacity, View } from "react-native";
|
|
7
7
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
@@ -21,7 +21,7 @@ function TabNavigator({ items, currentPath, onTabPress, }) {
|
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
23
|
onTabPress?.(path);
|
|
24
|
-
}, children: [_jsx(TabIcon, { focused: focused, Icon: Icon }), _jsx(Text, { className: `text-xs mt-1.5 font-medium ${focused ? "text-
|
|
24
|
+
}, children: [_jsx(TabIcon, { focused: focused, Icon: Icon }), _jsx(Text, { className: `text-xs mt-1.5 font-medium ${focused ? "text-text-accent" : "text-text-secondary"}`, children: label })] }, path));
|
|
25
25
|
}) }) }));
|
|
26
26
|
}
|
|
27
27
|
function Tabs({ children: tabsChildren }) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
2
|
-
import { cn } from "../theme/tw";
|
|
2
|
+
import { cn } from "../theme/tw.js";
|
|
3
3
|
import { View } from "react-native";
|
|
4
4
|
function AspectRatio({ ratio = 1, className, style, children, ...rest }) {
|
|
5
5
|
return (_jsx(View, { className: cn(className), style: [{ aspectRatio: ratio }, style], ...rest, children: children }));
|
|
@@ -1,143 +1,148 @@
|
|
|
1
|
-
import { type VariantProps } from "../theme/tw";
|
|
1
|
+
import { type VariantProps } from "../theme/tw.js";
|
|
2
2
|
import type React from "react";
|
|
3
3
|
import { FC } from "react";
|
|
4
|
+
import type { AccessibilityProps } from "react-native";
|
|
4
5
|
declare const button: import("tailwind-variants").TVReturnType<{
|
|
5
6
|
variant: {
|
|
6
|
-
primary:
|
|
7
|
-
accent:
|
|
8
|
-
secondary:
|
|
9
|
-
outline:
|
|
10
|
-
outlineDanger:
|
|
11
|
-
outlineBlack:
|
|
12
|
-
flat:
|
|
13
|
-
link:
|
|
14
|
-
transparent:
|
|
7
|
+
primary: "bg-accent";
|
|
8
|
+
accent: "bg-transparent";
|
|
9
|
+
secondary: "bg-bg-muted border border-border-strong";
|
|
10
|
+
outline: "bg-transparent border border-primary";
|
|
11
|
+
outlineDanger: "bg-transparent border border-danger";
|
|
12
|
+
outlineBlack: "bg-transparent border border-border-strong";
|
|
13
|
+
flat: "bg-text-primary/10";
|
|
14
|
+
link: "bg-transparent min-h-0";
|
|
15
|
+
transparent: "bg-transparent border border-border-light";
|
|
15
16
|
};
|
|
16
17
|
size: {
|
|
17
|
-
small:
|
|
18
|
-
medium:
|
|
19
|
-
large:
|
|
18
|
+
small: "py-1.5 px-3 min-h-[36px]";
|
|
19
|
+
medium: "py-2.5 px-4 min-h-[44px]";
|
|
20
|
+
large: "py-3 px-5 min-h-[48px]";
|
|
20
21
|
};
|
|
21
22
|
disabled: {
|
|
22
|
-
true:
|
|
23
|
+
true: "opacity-70";
|
|
23
24
|
};
|
|
24
|
-
}, undefined, "rounded-
|
|
25
|
+
}, undefined, "rounded-md items-center justify-center flex-row min-h-[44px]", {
|
|
25
26
|
variant: {
|
|
26
|
-
primary:
|
|
27
|
-
accent:
|
|
28
|
-
secondary:
|
|
29
|
-
outline:
|
|
30
|
-
outlineDanger:
|
|
31
|
-
outlineBlack:
|
|
32
|
-
flat:
|
|
33
|
-
link:
|
|
34
|
-
transparent:
|
|
27
|
+
primary: "bg-accent";
|
|
28
|
+
accent: "bg-transparent";
|
|
29
|
+
secondary: "bg-bg-muted border border-border-strong";
|
|
30
|
+
outline: "bg-transparent border border-primary";
|
|
31
|
+
outlineDanger: "bg-transparent border border-danger";
|
|
32
|
+
outlineBlack: "bg-transparent border border-border-strong";
|
|
33
|
+
flat: "bg-text-primary/10";
|
|
34
|
+
link: "bg-transparent min-h-0";
|
|
35
|
+
transparent: "bg-transparent border border-border-light";
|
|
35
36
|
};
|
|
36
37
|
size: {
|
|
37
|
-
small:
|
|
38
|
-
medium:
|
|
39
|
-
large:
|
|
38
|
+
small: "py-1.5 px-3 min-h-[36px]";
|
|
39
|
+
medium: "py-2.5 px-4 min-h-[44px]";
|
|
40
|
+
large: "py-3 px-5 min-h-[48px]";
|
|
40
41
|
};
|
|
41
42
|
disabled: {
|
|
42
|
-
true:
|
|
43
|
+
true: "opacity-70";
|
|
43
44
|
};
|
|
44
|
-
}, undefined, import("tailwind-variants").
|
|
45
|
+
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
45
46
|
variant: {
|
|
46
|
-
primary:
|
|
47
|
-
accent:
|
|
48
|
-
secondary:
|
|
49
|
-
outline:
|
|
50
|
-
outlineDanger:
|
|
51
|
-
outlineBlack:
|
|
52
|
-
flat:
|
|
53
|
-
link:
|
|
54
|
-
transparent:
|
|
47
|
+
primary: "bg-accent";
|
|
48
|
+
accent: "bg-transparent";
|
|
49
|
+
secondary: "bg-bg-muted border border-border-strong";
|
|
50
|
+
outline: "bg-transparent border border-primary";
|
|
51
|
+
outlineDanger: "bg-transparent border border-danger";
|
|
52
|
+
outlineBlack: "bg-transparent border border-border-strong";
|
|
53
|
+
flat: "bg-text-primary/10";
|
|
54
|
+
link: "bg-transparent min-h-0";
|
|
55
|
+
transparent: "bg-transparent border border-border-light";
|
|
55
56
|
};
|
|
56
57
|
size: {
|
|
57
|
-
small:
|
|
58
|
-
medium:
|
|
59
|
-
large:
|
|
58
|
+
small: "py-1.5 px-3 min-h-[36px]";
|
|
59
|
+
medium: "py-2.5 px-4 min-h-[44px]";
|
|
60
|
+
large: "py-3 px-5 min-h-[48px]";
|
|
60
61
|
};
|
|
61
62
|
disabled: {
|
|
62
|
-
true:
|
|
63
|
+
true: "opacity-70";
|
|
63
64
|
};
|
|
64
|
-
}, undefined
|
|
65
|
+
}, undefined>>;
|
|
65
66
|
declare const buttonIcon: import("tailwind-variants").TVReturnType<{
|
|
66
67
|
variant: {
|
|
67
|
-
primary:
|
|
68
|
-
accent:
|
|
69
|
-
secondary:
|
|
70
|
-
outline:
|
|
71
|
-
outlineDanger:
|
|
72
|
-
outlineBlack:
|
|
73
|
-
flat:
|
|
74
|
-
link:
|
|
75
|
-
transparent:
|
|
68
|
+
primary: "bg-accent";
|
|
69
|
+
accent: "bg-transparent";
|
|
70
|
+
secondary: "bg-bg-muted border border-border-strong";
|
|
71
|
+
outline: "bg-transparent border border-primary";
|
|
72
|
+
outlineDanger: "bg-transparent border border-danger";
|
|
73
|
+
outlineBlack: "bg-transparent border border-border-strong";
|
|
74
|
+
flat: "bg-text-primary/10";
|
|
75
|
+
link: "bg-transparent";
|
|
76
|
+
transparent: "bg-transparent border border-border-light";
|
|
76
77
|
};
|
|
77
78
|
size: {
|
|
78
|
-
small:
|
|
79
|
-
medium:
|
|
80
|
-
large:
|
|
79
|
+
small: "w-9 h-9";
|
|
80
|
+
medium: "w-11 h-11";
|
|
81
|
+
large: "w-[52px] h-[52px]";
|
|
81
82
|
};
|
|
82
83
|
disabled: {
|
|
83
|
-
true:
|
|
84
|
+
true: "opacity-70";
|
|
84
85
|
};
|
|
85
|
-
}, undefined, "rounded-
|
|
86
|
+
}, undefined, "rounded-md items-center justify-center aspect-square", {
|
|
86
87
|
variant: {
|
|
87
|
-
primary:
|
|
88
|
-
accent:
|
|
89
|
-
secondary:
|
|
90
|
-
outline:
|
|
91
|
-
outlineDanger:
|
|
92
|
-
outlineBlack:
|
|
93
|
-
flat:
|
|
94
|
-
link:
|
|
95
|
-
transparent:
|
|
88
|
+
primary: "bg-accent";
|
|
89
|
+
accent: "bg-transparent";
|
|
90
|
+
secondary: "bg-bg-muted border border-border-strong";
|
|
91
|
+
outline: "bg-transparent border border-primary";
|
|
92
|
+
outlineDanger: "bg-transparent border border-danger";
|
|
93
|
+
outlineBlack: "bg-transparent border border-border-strong";
|
|
94
|
+
flat: "bg-text-primary/10";
|
|
95
|
+
link: "bg-transparent";
|
|
96
|
+
transparent: "bg-transparent border border-border-light";
|
|
96
97
|
};
|
|
97
98
|
size: {
|
|
98
|
-
small:
|
|
99
|
-
medium:
|
|
100
|
-
large:
|
|
99
|
+
small: "w-9 h-9";
|
|
100
|
+
medium: "w-11 h-11";
|
|
101
|
+
large: "w-[52px] h-[52px]";
|
|
101
102
|
};
|
|
102
103
|
disabled: {
|
|
103
|
-
true:
|
|
104
|
+
true: "opacity-70";
|
|
104
105
|
};
|
|
105
|
-
}, undefined, import("tailwind-variants").
|
|
106
|
+
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
106
107
|
variant: {
|
|
107
|
-
primary:
|
|
108
|
-
accent:
|
|
109
|
-
secondary:
|
|
110
|
-
outline:
|
|
111
|
-
outlineDanger:
|
|
112
|
-
outlineBlack:
|
|
113
|
-
flat:
|
|
114
|
-
link:
|
|
115
|
-
transparent:
|
|
108
|
+
primary: "bg-accent";
|
|
109
|
+
accent: "bg-transparent";
|
|
110
|
+
secondary: "bg-bg-muted border border-border-strong";
|
|
111
|
+
outline: "bg-transparent border border-primary";
|
|
112
|
+
outlineDanger: "bg-transparent border border-danger";
|
|
113
|
+
outlineBlack: "bg-transparent border border-border-strong";
|
|
114
|
+
flat: "bg-text-primary/10";
|
|
115
|
+
link: "bg-transparent";
|
|
116
|
+
transparent: "bg-transparent border border-border-light";
|
|
116
117
|
};
|
|
117
118
|
size: {
|
|
118
|
-
small:
|
|
119
|
-
medium:
|
|
120
|
-
large:
|
|
119
|
+
small: "w-9 h-9";
|
|
120
|
+
medium: "w-11 h-11";
|
|
121
|
+
large: "w-[52px] h-[52px]";
|
|
121
122
|
};
|
|
122
123
|
disabled: {
|
|
123
|
-
true:
|
|
124
|
+
true: "opacity-70";
|
|
124
125
|
};
|
|
125
|
-
}, undefined
|
|
126
|
-
export interface BaseButtonProps extends VariantProps<typeof button
|
|
126
|
+
}, undefined>>;
|
|
127
|
+
export interface BaseButtonProps extends VariantProps<typeof button>, AccessibilityProps {
|
|
127
128
|
title: string;
|
|
128
129
|
onPress?: () => void;
|
|
129
130
|
loading?: boolean;
|
|
130
131
|
disabled?: boolean;
|
|
131
132
|
className?: string;
|
|
132
133
|
icon?: React.ReactNode;
|
|
134
|
+
accessibleSizing?: boolean;
|
|
135
|
+
testID?: string;
|
|
133
136
|
}
|
|
134
137
|
export declare const BaseButton: FC<BaseButtonProps>;
|
|
135
|
-
export interface BaseButtonIconProps extends VariantProps<typeof buttonIcon
|
|
138
|
+
export interface BaseButtonIconProps extends VariantProps<typeof buttonIcon>, AccessibilityProps {
|
|
136
139
|
icon: string;
|
|
137
140
|
onPress?: () => void;
|
|
138
141
|
loading?: boolean;
|
|
139
142
|
disabled?: boolean;
|
|
140
143
|
className?: string;
|
|
144
|
+
accessibleSizing?: boolean;
|
|
145
|
+
testID?: string;
|
|
141
146
|
}
|
|
142
147
|
export declare const BaseButtonIcon: FC<BaseButtonIconProps>;
|
|
143
148
|
declare const BaseButtonWithIcon: React.FC<BaseButtonProps> & {
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
-
import Icon from "../Display/Display.Icon";
|
|
3
|
-
import { theme } from "../theme";
|
|
4
|
-
import { tv } from "../theme/tw";
|
|
5
|
-
import { Typography } from "../Typography";
|
|
6
|
-
import { LinearGradient } from "expo-linear-gradient";
|
|
2
|
+
import Icon from "../Display/Display.Icon.js";
|
|
3
|
+
import { theme } from "../theme/index.js";
|
|
4
|
+
import { tv } from "../theme/tw.js";
|
|
5
|
+
import { Typography } from "../Typography/index.js";
|
|
7
6
|
import { ActivityIndicator, TouchableOpacity, View } from "react-native";
|
|
8
7
|
// ============================================================================
|
|
9
8
|
// STYLE VARIANTS
|
|
10
9
|
// ============================================================================
|
|
11
10
|
const button = tv({
|
|
12
|
-
base: "rounded-
|
|
11
|
+
base: "rounded-md items-center justify-center flex-row min-h-[44px]",
|
|
13
12
|
variants: {
|
|
14
13
|
variant: {
|
|
15
|
-
primary: "
|
|
16
|
-
accent: "
|
|
17
|
-
secondary: "bg-bg-
|
|
14
|
+
primary: "bg-accent",
|
|
15
|
+
accent: "bg-transparent",
|
|
16
|
+
secondary: "bg-bg-muted border border-border-strong",
|
|
18
17
|
outline: "bg-transparent border border-primary",
|
|
19
18
|
outlineDanger: "bg-transparent border border-danger",
|
|
20
19
|
outlineBlack: "bg-transparent border border-border-strong",
|
|
@@ -37,12 +36,12 @@ const button = tv({
|
|
|
37
36
|
},
|
|
38
37
|
});
|
|
39
38
|
const buttonIcon = tv({
|
|
40
|
-
base: "rounded-
|
|
39
|
+
base: "rounded-md items-center justify-center aspect-square",
|
|
41
40
|
variants: {
|
|
42
41
|
variant: {
|
|
43
|
-
primary: "
|
|
44
|
-
accent: "
|
|
45
|
-
secondary: "bg-bg-
|
|
42
|
+
primary: "bg-accent",
|
|
43
|
+
accent: "bg-transparent",
|
|
44
|
+
secondary: "bg-bg-muted border border-border-strong",
|
|
46
45
|
outline: "bg-transparent border border-primary",
|
|
47
46
|
outlineDanger: "bg-transparent border border-danger",
|
|
48
47
|
outlineBlack: "bg-transparent border border-border-strong",
|
|
@@ -67,15 +66,15 @@ const buttonIcon = tv({
|
|
|
67
66
|
const textColor = tv({
|
|
68
67
|
variants: {
|
|
69
68
|
variant: {
|
|
70
|
-
primary: "text-
|
|
71
|
-
accent: "text-
|
|
72
|
-
secondary: "text-primary",
|
|
73
|
-
outline: "text-
|
|
69
|
+
primary: "text-text-on-accent",
|
|
70
|
+
accent: "text-text-accent",
|
|
71
|
+
secondary: "text-text-primary",
|
|
72
|
+
outline: "text-text-accent",
|
|
74
73
|
outlineDanger: "text-danger",
|
|
75
74
|
outlineBlack: "text-text-primary",
|
|
76
75
|
flat: "text-text-primary",
|
|
77
|
-
link: "text-
|
|
78
|
-
transparent: "text-
|
|
76
|
+
link: "text-text-accent",
|
|
77
|
+
transparent: "text-text-inverse",
|
|
79
78
|
},
|
|
80
79
|
disabled: {
|
|
81
80
|
true: "opacity-50",
|
|
@@ -85,17 +84,17 @@ const textColor = tv({
|
|
|
85
84
|
{
|
|
86
85
|
variant: "primary",
|
|
87
86
|
disabled: true,
|
|
88
|
-
className: "text-
|
|
87
|
+
className: "text-text-on-accent",
|
|
89
88
|
},
|
|
90
89
|
{
|
|
91
90
|
variant: "accent",
|
|
92
91
|
disabled: true,
|
|
93
|
-
className: "text-
|
|
92
|
+
className: "text-text-accent",
|
|
94
93
|
},
|
|
95
94
|
{
|
|
96
95
|
variant: "transparent",
|
|
97
96
|
disabled: true,
|
|
98
|
-
className: "text-
|
|
97
|
+
className: "text-text-inverse/70",
|
|
99
98
|
},
|
|
100
99
|
{
|
|
101
100
|
variant: ["secondary", "outline", "link"],
|
|
@@ -128,14 +127,14 @@ const textColor = tv({
|
|
|
128
127
|
// ============================================================================
|
|
129
128
|
function getLoadingColorDynamic(variant) {
|
|
130
129
|
const map = {
|
|
131
|
-
primary: theme.text.
|
|
132
|
-
accent: theme.text.
|
|
133
|
-
secondary: theme.primary,
|
|
134
|
-
outline: theme.
|
|
130
|
+
primary: theme.text.onAccent,
|
|
131
|
+
accent: theme.text.accent,
|
|
132
|
+
secondary: theme.text.primary,
|
|
133
|
+
outline: theme.text.accent,
|
|
135
134
|
outlineDanger: theme.danger,
|
|
136
135
|
outlineBlack: theme.text.primary,
|
|
137
136
|
flat: theme.text.primary,
|
|
138
|
-
link: theme.
|
|
137
|
+
link: theme.text.accent,
|
|
139
138
|
transparent: theme.text.inverse,
|
|
140
139
|
};
|
|
141
140
|
return map[variant] ?? theme.text.inverse;
|
|
@@ -143,8 +142,8 @@ function getLoadingColorDynamic(variant) {
|
|
|
143
142
|
function getIconColorDynamic(variant, disabled) {
|
|
144
143
|
if (disabled) {
|
|
145
144
|
const disabledMap = {
|
|
146
|
-
primary: theme.
|
|
147
|
-
accent: theme.
|
|
145
|
+
primary: theme.text.onAccent + "70",
|
|
146
|
+
accent: theme.text.accent + "70",
|
|
148
147
|
secondary: theme.icon.disabled,
|
|
149
148
|
outline: theme.icon.disabled,
|
|
150
149
|
outlineDanger: theme.danger + "7f",
|
|
@@ -156,14 +155,14 @@ function getIconColorDynamic(variant, disabled) {
|
|
|
156
155
|
return disabledMap[variant] ?? theme.icon.disabled;
|
|
157
156
|
}
|
|
158
157
|
const enabledMap = {
|
|
159
|
-
primary: theme.
|
|
160
|
-
accent: theme.
|
|
161
|
-
secondary: theme.primary,
|
|
162
|
-
outline: theme.
|
|
158
|
+
primary: theme.text.onAccent,
|
|
159
|
+
accent: theme.text.accent,
|
|
160
|
+
secondary: theme.text.primary,
|
|
161
|
+
outline: theme.text.accent,
|
|
163
162
|
outlineDanger: theme.danger,
|
|
164
163
|
outlineBlack: theme.text.primary,
|
|
165
164
|
flat: theme.text.primary,
|
|
166
|
-
link: theme.
|
|
165
|
+
link: theme.text.accent,
|
|
167
166
|
transparent: theme.icon.inverse,
|
|
168
167
|
};
|
|
169
168
|
return enabledMap[variant] ?? theme.icon.inverse;
|
|
@@ -193,7 +192,7 @@ function getIconSize(size) {
|
|
|
193
192
|
function getTextVariant(size) {
|
|
194
193
|
return textVariantMap[size] ?? "button";
|
|
195
194
|
}
|
|
196
|
-
export const BaseButton = ({ title, onPress, variant = "primary", size = "medium", loading = false, disabled = false, className, icon, }) => {
|
|
195
|
+
export const BaseButton = ({ title, onPress, variant = "primary", size = "medium", loading = false, disabled = false, className, icon, accessibleSizing = false, testID, accessibilityLabel, accessibilityState, ...accessibilityProps }) => {
|
|
197
196
|
const textColorClass = textColor({
|
|
198
197
|
variant: variant ?? "primary",
|
|
199
198
|
disabled,
|
|
@@ -201,30 +200,29 @@ export const BaseButton = ({ title, onPress, variant = "primary", size = "medium
|
|
|
201
200
|
const loadingColorValue = getLoadingColor(variant ?? "primary");
|
|
202
201
|
const textVariantValue = getTextVariant(size ?? "medium");
|
|
203
202
|
if (variant === "link") {
|
|
204
|
-
return (_jsx(TouchableOpacity, { activeOpacity: 0.7, className: className, disabled: disabled || loading, onPress: onPress,
|
|
203
|
+
return (_jsx(TouchableOpacity, { activeOpacity: 0.7, className: className, disabled: disabled || loading, onPress: onPress, ...accessibilityProps, accessibilityLabel: accessibilityLabel ?? title, accessibilityRole: "button", accessibilityState: {
|
|
204
|
+
...accessibilityState,
|
|
205
|
+
disabled: disabled || loading,
|
|
206
|
+
busy: loading,
|
|
207
|
+
}, style: accessibleSizing
|
|
208
|
+
? { minHeight: 48, minWidth: 48, justifyContent: "center" }
|
|
209
|
+
: undefined, testID: testID, children: loading ? (_jsx(ActivityIndicator, { color: loadingColorValue, size: "small" })) : (_jsx(Typography.Text, { className: textColorClass, variant: textVariantValue, children: title })) }));
|
|
205
210
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
opacity: disabled ? 0.7 : 1,
|
|
212
|
-
}, children: _jsx(TouchableOpacity, { activeOpacity: 0.8, disabled: disabled || loading, onPress: onPress, children: _jsxs(View, { className: button({ size, disabled }), style: { backgroundColor: "transparent" }, children: [icon && !loading && _jsx(View, { className: "mr-2", children: icon }), loading ? (_jsx(ActivityIndicator, { color: loadingColorValue, size: "small" })) : (_jsx(Typography.Text, { className: textColorClass, variant: textVariantValue, children: title }))] }) }) }) }));
|
|
213
|
-
}
|
|
214
|
-
return (_jsxs(TouchableOpacity, { activeOpacity: 0.8, className: button({ variant, size, disabled, className }), disabled: disabled || loading, onPress: onPress, children: [icon && !loading && _jsx(View, { className: "mr-2", children: icon }), loading ? (_jsx(ActivityIndicator, { color: loadingColorValue, size: "small" })) : (_jsx(Typography.Text, { className: textColorClass, variant: textVariantValue, children: title }))] }));
|
|
211
|
+
return (_jsxs(TouchableOpacity, { activeOpacity: 0.8, className: button({ variant, size, disabled, className }), disabled: disabled || loading, onPress: onPress, ...accessibilityProps, accessibilityLabel: accessibilityLabel ?? title, accessibilityRole: "button", accessibilityState: {
|
|
212
|
+
...accessibilityState,
|
|
213
|
+
disabled: disabled || loading,
|
|
214
|
+
busy: loading,
|
|
215
|
+
}, style: accessibleSizing ? { minHeight: 48, minWidth: 48 } : undefined, testID: testID, children: [icon && !loading && _jsx(View, { className: "mr-2", children: icon }), loading ? (_jsx(ActivityIndicator, { color: loadingColorValue, size: "small" })) : (_jsx(Typography.Text, { className: textColorClass, semibold: variant === "primary", variant: textVariantValue, children: title }))] }));
|
|
215
216
|
};
|
|
216
|
-
export const BaseButtonIcon = ({ icon, onPress, variant = "primary", size = "medium", loading = false, disabled = false, className, }) => {
|
|
217
|
+
export const BaseButtonIcon = ({ icon, onPress, variant = "primary", size = "medium", loading = false, disabled = false, className, accessibleSizing = false, testID, accessibilityState, ...accessibilityProps }) => {
|
|
217
218
|
const iconColorValue = getIconColor(variant ?? "primary", disabled);
|
|
218
219
|
const loadingColorValue = getLoadingColor(variant ?? "primary");
|
|
219
220
|
const iconSizeValue = getIconSize(size ?? "medium");
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
}, children: _jsx(TouchableOpacity, { activeOpacity: 0.8, disabled: disabled || loading, onPress: onPress, children: _jsx(View, { className: buttonIcon({ size, disabled }), style: { backgroundColor: "transparent" }, children: loading ? (_jsx(ActivityIndicator, { color: loadingColorValue, size: "small" })) : (_jsx(Icon, { color: iconColorValue, name: icon, size: iconSizeValue })) }) }) }));
|
|
226
|
-
}
|
|
227
|
-
return (_jsx(TouchableOpacity, { activeOpacity: 0.8, className: buttonIcon({ variant, size, disabled, className }), disabled: disabled || loading, onPress: onPress, children: loading ? (_jsx(ActivityIndicator, { color: loadingColorValue, size: "small" })) : (_jsx(Icon, { color: iconColorValue, name: icon, size: iconSizeValue })) }));
|
|
221
|
+
return (_jsx(TouchableOpacity, { activeOpacity: 0.8, className: buttonIcon({ variant, size, disabled, className }), disabled: disabled || loading, onPress: onPress, ...accessibilityProps, accessibilityRole: "button", accessibilityState: {
|
|
222
|
+
...accessibilityState,
|
|
223
|
+
disabled: disabled || loading,
|
|
224
|
+
busy: loading,
|
|
225
|
+
}, style: accessibleSizing ? { minHeight: 48, minWidth: 48 } : undefined, testID: testID, children: loading ? (_jsx(ActivityIndicator, { color: loadingColorValue, size: "small" })) : (_jsx(Icon, { color: iconColorValue, name: icon, size: iconSizeValue })) }));
|
|
228
226
|
};
|
|
229
227
|
// ============================================================================
|
|
230
228
|
// COMPOUND COMPONENT
|
package/dist/primitives/Box.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
2
|
-
import { cn } from "../theme/tw";
|
|
2
|
+
import { cn } from "../theme/tw.js";
|
|
3
3
|
import { View } from "react-native";
|
|
4
4
|
function Box({ className, style, ...props }) {
|
|
5
5
|
return _jsx(View, { className: cn(className), style: style, ...props });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
2
|
-
import { cn } from "../theme/tw";
|
|
2
|
+
import { cn } from "../theme/tw.js";
|
|
3
3
|
import { TouchableOpacity, } from "react-native";
|
|
4
4
|
function Pressable({ className, disabled = false, hitSlop = 8, activeOpacity = 0.7, accessibilityRole = "button", style, children, ...rest }) {
|
|
5
5
|
const isDisabled = !!disabled;
|
package/dist/primitives/Row.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
2
|
-
import { cn } from "../theme/tw";
|
|
2
|
+
import { cn } from "../theme/tw.js";
|
|
3
3
|
import { View } from "react-native";
|
|
4
4
|
function Row({ spacing = 2, align = "center", justify = "start", wrap = false, className, style, ...props }) {
|
|
5
5
|
const alignMap = {
|
package/dist/primitives/Stack.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
2
|
-
import { cn } from "../theme/tw";
|
|
2
|
+
import { cn } from "../theme/tw.js";
|
|
3
3
|
import { View } from "react-native";
|
|
4
4
|
function Stack({ spacing = 4, align = "stretch", className, style, ...props }) {
|
|
5
5
|
const alignMap = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { AspectRatio, type AspectRatioProps, } from "
|
|
2
|
-
export { Box } from "
|
|
3
|
-
export { Pressable, type PressableProps } from "
|
|
4
|
-
export { Row } from "
|
|
5
|
-
export { Spacer, type SpacerProps } from "
|
|
6
|
-
export { Stack } from "
|
|
1
|
+
export { AspectRatio, type AspectRatioProps, } from "./AspectRatio.js";
|
|
2
|
+
export { Box } from "./Box.js";
|
|
3
|
+
export { Pressable, type PressableProps } from "./Pressable.js";
|
|
4
|
+
export { Row } from "./Row.js";
|
|
5
|
+
export { Spacer, type SpacerProps } from "./Spacer.js";
|
|
6
|
+
export { Stack } from "./Stack.js";
|
package/dist/primitives/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { AspectRatio, } from "
|
|
2
|
-
export { Box } from "
|
|
3
|
-
export { Pressable } from "
|
|
4
|
-
export { Row } from "
|
|
5
|
-
export { Spacer } from "
|
|
6
|
-
export { Stack } from "
|
|
1
|
+
export { AspectRatio, } from "./AspectRatio.js";
|
|
2
|
+
export { Box } from "./Box.js";
|
|
3
|
+
export { Pressable } from "./Pressable.js";
|
|
4
|
+
export { Row } from "./Row.js";
|
|
5
|
+
export { Spacer } from "./Spacer.js";
|
|
6
|
+
export { Stack } from "./Stack.js";
|
package/dist/theme/active.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ThemeTokens } from "
|
|
1
|
+
import type { ThemeTokens } from "./types.js";
|
|
2
2
|
export declare function setActiveTheme(tokens: ThemeTokens): void;
|
|
3
3
|
export declare function getActiveTheme(): ThemeTokens;
|
|
4
4
|
export declare function subscribeTheme(listener: () => void): () => void;
|
package/dist/theme/active.js
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
|
-
import { DEFAULT_THEME } from "
|
|
1
|
+
import { DEFAULT_THEME } from "./default.js";
|
|
2
|
+
import { validateTheme } from "./validate.js";
|
|
2
3
|
const activeTheme = { ...DEFAULT_THEME };
|
|
3
4
|
const listeners = new Set();
|
|
4
5
|
let version = 0;
|
|
6
|
+
// Detection helper: we don't want validation warnings to spam the console while running
|
|
7
|
+
// runtime tests under Node (they intentionally pass partial themes). The check is cheap
|
|
8
|
+
// and runs once at module load.
|
|
9
|
+
const isReactNative = typeof navigator !== "undefined" &&
|
|
10
|
+
navigator.product === "ReactNative";
|
|
5
11
|
export function setActiveTheme(tokens) {
|
|
12
|
+
if (__DEV__ && isReactNative) {
|
|
13
|
+
const issues = validateTheme(tokens);
|
|
14
|
+
if (issues.length > 0) {
|
|
15
|
+
const fmt = issues.map((i) => ` · ${i.path}: ${i.message}`).join("\n");
|
|
16
|
+
console.warn(`[@sincpro/mobile-ui] setActiveTheme received a theme with issues:\n${fmt}\nRendering will fall back to default styles for missing keys.`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
6
19
|
Object.assign(activeTheme, tokens);
|
|
7
20
|
version += 1;
|
|
8
21
|
listeners.forEach((listener) => listener());
|