@sincpro/mobile-ui 1.0.1 → 2.0.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 +701 -231
- package/dist/Actions/Actions.Button.d.ts +15 -12
- package/dist/Actions/Actions.Button.js +25 -14
- package/dist/Actions/Actions.Dock.d.ts +20 -0
- package/dist/Actions/Actions.Dock.js +89 -0
- package/dist/Actions/Actions.FAB.d.ts +2 -1
- package/dist/Actions/Actions.FAB.js +5 -3
- package/dist/Actions/Actions.FilterButton.d.ts +10 -2
- package/dist/Actions/Actions.FilterButton.js +21 -6
- package/dist/Actions/Actions.IconButton.d.ts +4 -2
- package/dist/Actions/Actions.IconButton.js +7 -3
- package/dist/Actions/index.d.ts +6 -2
- package/dist/Actions/index.js +4 -1
- package/dist/Dialog/BottomSheet/BottomSheet.Root.js +22 -34
- package/dist/Dialog/Dialog.ActionSheet.d.ts +2 -1
- package/dist/Dialog/Dialog.ActionSheet.js +17 -21
- package/dist/Dialog/Dialog.Confirmation.js +8 -6
- package/dist/Dialog/Dialog.EditValue.js +3 -1
- 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 +30 -31
- package/dist/Display/Display.Accordion.js +7 -3
- package/dist/Display/Display.AmountSummary.d.ts +28 -0
- package/dist/Display/Display.AmountSummary.js +25 -0
- package/dist/Display/Display.Carousel.d.ts +27 -4
- package/dist/Display/Display.Carousel.js +112 -12
- package/dist/Display/Display.CopyableText.d.ts +9 -2
- package/dist/Display/Display.CopyableText.js +75 -7
- package/dist/Display/Display.ExpoImage.d.ts +8 -0
- package/dist/Display/Display.ExpoImage.js +15 -0
- package/dist/Display/Display.Icon.js +2 -1
- package/dist/Display/Display.Image.d.ts +10 -6
- package/dist/Display/Display.Image.js +39 -6
- package/dist/Display/Display.KeyValue.d.ts +11 -4
- package/dist/Display/Display.KeyValue.js +6 -4
- package/dist/Display/Display.ListGroup.d.ts +23 -0
- package/dist/Display/Display.ListGroup.js +17 -0
- package/dist/Display/Display.ListItem.d.ts +15 -2
- package/dist/Display/Display.ListItem.js +25 -8
- package/dist/Display/Display.Logo.d.ts +2 -2
- package/dist/Display/Display.Logo.js +3 -2
- package/dist/Display/Display.MediaCard.d.ts +2 -2
- package/dist/Display/Display.MediaEmbed.d.ts +2 -2
- package/dist/Display/Display.ProductCard.d.ts +2 -2
- package/dist/Display/Display.SectionHeader.d.ts +11 -1
- package/dist/Display/Display.SectionHeader.js +11 -2
- package/dist/Display/Display.Story.d.ts +3 -3
- package/dist/Display/Display.Story.js +5 -4
- package/dist/Display/Display.StoryTray.d.ts +4 -4
- package/dist/Display/Display.StoryTray.js +3 -2
- package/dist/Display/Display.StoryViewer.d.ts +3 -3
- package/dist/Display/Display.StoryViewer.js +6 -3
- package/dist/Display/Display.SwipeableRow.d.ts +3 -1
- package/dist/Display/Display.SwipeableRow.js +3 -3
- package/dist/Display/index.d.ts +13 -0
- package/dist/Display/index.js +6 -0
- package/dist/Feedback/Feedback.Banner.js +1 -1
- package/dist/Feedback/Feedback.DomainSplashScreen.d.ts +13 -4
- package/dist/Feedback/Feedback.DomainSplashScreen.js +68 -53
- package/dist/Feedback/Feedback.EmptyState.d.ts +2 -2
- package/dist/Feedback/Feedback.EmptyState.js +3 -2
- package/dist/Feedback/Feedback.Error.d.ts +2 -1
- package/dist/Feedback/Feedback.Error.js +4 -3
- package/dist/Feedback/Feedback.Loading.d.ts +6 -2
- package/dist/Feedback/Feedback.Loading.js +2 -2
- package/dist/Feedback/Feedback.Progress.d.ts +6 -3
- package/dist/Feedback/Feedback.Progress.js +29 -19
- package/dist/Feedback/Feedback.ProgressCircle.d.ts +3 -2
- package/dist/Feedback/Feedback.ProgressCircle.js +10 -7
- package/dist/Feedback/Feedback.Skeleton.d.ts +4 -4
- package/dist/Feedback/Feedback.Skeleton.js +15 -3
- package/dist/Feedback/Feedback.Spinner.d.ts +3 -3
- package/dist/Feedback/Feedback.Spinner.js +40 -9
- package/dist/Feedback/Feedback.Splash.d.ts +2 -2
- package/dist/Feedback/Feedback.Splash.js +5 -3
- package/dist/Feedback/Toast.context.d.ts +64 -3
- package/dist/Feedback/Toast.context.js +112 -31
- package/dist/Feedback/index.d.ts +15 -1
- package/dist/Feedback/index.js +4 -1
- package/dist/Form/Form.Checkbox.d.ts +3 -1
- package/dist/Form/Form.Checkbox.js +2 -2
- package/dist/Form/Form.DatePicker.js +3 -2
- package/dist/Form/Form.Dropdown.d.ts +15 -3
- package/dist/Form/Form.Dropdown.js +21 -6
- package/dist/Form/Form.ErrorSummary.d.ts +23 -0
- package/dist/Form/Form.ErrorSummary.js +53 -0
- package/dist/Form/Form.FilterButton.d.ts +1 -1
- package/dist/Form/Form.Input.d.ts +4 -3
- package/dist/Form/Form.Input.js +2 -2
- 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.Select.d.ts +2 -1
- package/dist/Form/Form.Select.js +26 -26
- package/dist/Form/index.d.ts +9 -0
- package/dist/Form/index.js +6 -0
- package/dist/Navigation/Navigation.AppBar.js +8 -6
- package/dist/Navigation/Navigation.BottomNav.js +10 -5
- package/dist/Navigation/Navigation.Header.d.ts +2 -2
- package/dist/Navigation/Navigation.Menu.js +10 -3
- package/dist/Navigation/Navigation.RowItem.d.ts +1 -1
- package/dist/Navigation/Navigation.RowItem.js +2 -2
- package/dist/Navigation/Navigation.Search.d.ts +41 -0
- package/dist/Navigation/Navigation.Search.js +47 -0
- package/dist/Navigation/Navigation.SearchBar.d.ts +5 -1
- package/dist/Navigation/Navigation.SearchBar.js +25 -7
- package/dist/Navigation/Navigation.SearchSuggestions.d.ts +14 -0
- package/dist/Navigation/Navigation.SearchSuggestions.js +7 -0
- package/dist/Navigation/Navigation.SegmentedControl.d.ts +11 -1
- package/dist/Navigation/Navigation.SegmentedControl.js +29 -15
- package/dist/Navigation/index.d.ts +13 -0
- package/dist/Navigation/index.js +4 -0
- package/dist/Typography/Typography.Heading.js +1 -1
- package/dist/Typography/Typography.SelectableText.d.ts +10 -0
- package/dist/Typography/Typography.SelectableText.js +16 -0
- package/dist/Typography/Typography.Text.js +4 -20
- package/dist/Typography/index.d.ts +3 -0
- package/dist/Typography/index.js +3 -0
- package/dist/branding.d.ts +3 -2
- package/dist/layouts/AuthContainer.d.ts +4 -1
- package/dist/layouts/AuthContainer.js +3 -3
- package/dist/primitives/BaseButton.d.ts +15 -12
- package/dist/primitives/BaseButton.js +21 -9
- package/dist/theme/typography.d.ts +16 -1
- package/dist/theme/typography.js +19 -0
- package/dist/utils/criteria.d.ts +56 -0
- package/dist/utils/criteria.js +99 -0
- package/dist/utils/image.d.ts +3 -0
- package/dist/utils/image.js +13 -0
- package/dist/utils/keys.d.ts +1 -0
- package/dist/utils/keys.js +7 -0
- package/dist/utils/progress.d.ts +1 -0
- package/dist/utils/progress.js +5 -0
- package/dist/utils/reorder.d.ts +4 -0
- package/dist/utils/reorder.js +29 -0
- package/dist/utils/useReducedMotion.d.ts +1 -0
- package/dist/utils/useReducedMotion.js +43 -0
- package/dist/utils/useSheetTranslation.d.ts +5 -0
- package/dist/utils/useSheetTranslation.js +23 -0
- package/dist/views/AppSplashView.d.ts +3 -2
- package/dist/views/AppSplashView.js +3 -2
- package/dist/views/AuthFormView.d.ts +6 -3
- package/dist/views/AuthFormView.js +2 -2
- package/dist/views/FormViewV2.d.ts +9 -4
- package/dist/views/FormViewV2.js +35 -16
- package/dist/views/ListViewV2.context.d.ts +3 -1
- package/dist/views/ListViewV2.context.js +41 -21
- package/dist/views/ListViewV2.d.ts +18 -7
- package/dist/views/ListViewV2.js +69 -35
- package/dist/views/types/IListView.js +6 -5
- package/dist/widgets/CollectionOptions.d.ts +15 -0
- package/dist/widgets/CollectionOptions.js +129 -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/HomeHeader.d.ts +2 -2
- package/dist/widgets/PromoModal.js +3 -1
- package/dist/widgets/QueryChoice.d.ts +10 -0
- package/dist/widgets/QueryChoice.js +13 -0
- package/dist/widgets/ReorderableList.d.ts +51 -0
- package/dist/widgets/ReorderableList.js +138 -0
- package/dist/widgets/ScreenHeader.d.ts +2 -2
- package/dist/widgets/index.d.ts +4 -0
- package/dist/widgets/index.js +3 -0
- package/package.json +18 -1
|
@@ -2,10 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
|
2
2
|
import { cn } from "../theme/tw.js";
|
|
3
3
|
import { Typography } from "../Typography/index.js";
|
|
4
4
|
import { TouchableOpacity, View } from "react-native";
|
|
5
|
-
function RowItem({ item, className }) {
|
|
5
|
+
function RowItem({ item, className, onPress = item.onPress, readonly = item.readonly, }) {
|
|
6
6
|
function rowContent() {
|
|
7
7
|
return (_jsxs(View, { className: "flex-1", children: [_jsx(Typography.Text, { className: "flex-1", variant: "title", children: item.rowTitle }), _jsx(Typography.Text, { className: "mt-0.5 text-text-secondary", variant: "bodySmall", children: item.rowSubtitle })] }));
|
|
8
8
|
}
|
|
9
|
-
return
|
|
9
|
+
return readonly ? (_jsx(View, { className: cn("flex-row items-center py-2.5", className), children: rowContent() })) : (_jsx(TouchableOpacity, { className: cn("flex-row items-center py-2.5", className), onPress: onPress, children: rowContent() }));
|
|
10
10
|
}
|
|
11
11
|
export default RowItem;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type SearchHistoryProps } from "../Display/Display.SearchHistory.js";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
import { type SearchBarProps } from "./Navigation.SearchBar";
|
|
4
|
+
import { type SearchSuggestionsProps } from "./Navigation.SearchSuggestions";
|
|
5
|
+
export interface SearchRootProps {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
testID?: string;
|
|
9
|
+
}
|
|
10
|
+
declare function Root({ children, className, testID }: SearchRootProps): import("react").JSX.Element;
|
|
11
|
+
declare function Field(props: SearchBarProps): import("react").JSX.Element;
|
|
12
|
+
export interface SearchFiltersProps {
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
className?: string;
|
|
15
|
+
testID?: string;
|
|
16
|
+
}
|
|
17
|
+
declare function Filters({ children, className, testID }: SearchFiltersProps): import("react").JSX.Element;
|
|
18
|
+
export interface SearchFilterSheetProps {
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
activeCount?: number;
|
|
21
|
+
title?: string;
|
|
22
|
+
triggerLabel?: string;
|
|
23
|
+
applyLabel?: string;
|
|
24
|
+
clearLabel?: string;
|
|
25
|
+
onApply: () => void;
|
|
26
|
+
onClear?: () => void;
|
|
27
|
+
testID?: string;
|
|
28
|
+
}
|
|
29
|
+
declare function FilterSheet({ children, activeCount, title, triggerLabel, applyLabel, clearLabel, onApply, onClear, testID, }: SearchFilterSheetProps): import("react").JSX.Element;
|
|
30
|
+
declare function History(props: SearchHistoryProps): import("react").JSX.Element;
|
|
31
|
+
declare function Suggestions(props: SearchSuggestionsProps): import("react").JSX.Element;
|
|
32
|
+
declare const Search: {
|
|
33
|
+
Root: typeof Root;
|
|
34
|
+
Field: typeof Field;
|
|
35
|
+
Filters: typeof Filters;
|
|
36
|
+
FilterSheet: typeof FilterSheet;
|
|
37
|
+
History: typeof History;
|
|
38
|
+
Suggestions: typeof Suggestions;
|
|
39
|
+
};
|
|
40
|
+
export type { SearchBarProps, SearchHistoryProps, SearchSuggestionsProps };
|
|
41
|
+
export default Search;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "nativewind/jsx-runtime";
|
|
2
|
+
import Button from "../Actions/Actions.Button.js";
|
|
3
|
+
import { FilterButtonGroup } from "../Actions/Actions.FilterButton.js";
|
|
4
|
+
import Sheet from "../Dialog/Dialog.Sheet.js";
|
|
5
|
+
import Icon from "../Display/Display.Icon.js";
|
|
6
|
+
import SearchHistory from "../Display/Display.SearchHistory.js";
|
|
7
|
+
import Pressable from "../primitives/Pressable.js";
|
|
8
|
+
import { useTheme } from "../theme/index.js";
|
|
9
|
+
import { cn } from "../theme/tw.js";
|
|
10
|
+
import { Typography } from "../Typography/index.js";
|
|
11
|
+
import { useState } from "react";
|
|
12
|
+
import { View } from "react-native";
|
|
13
|
+
import SearchBar from "./Navigation.SearchBar";
|
|
14
|
+
import SearchSuggestions from "./Navigation.SearchSuggestions";
|
|
15
|
+
function Root({ children, className, testID }) {
|
|
16
|
+
return (_jsx(View, { className: cn("gap-3", className), testID: testID, children: children }));
|
|
17
|
+
}
|
|
18
|
+
function Field(props) {
|
|
19
|
+
return _jsx(SearchBar, { ...props });
|
|
20
|
+
}
|
|
21
|
+
function Filters({ children, className, testID }) {
|
|
22
|
+
return (_jsx(FilterButtonGroup, { className: className, layout: "scroll", testID: testID, children: children }));
|
|
23
|
+
}
|
|
24
|
+
function FilterSheet({ children, activeCount = 0, title = "Filtros", triggerLabel = "Filtros", applyLabel = "Aplicar", clearLabel = "Limpiar", onApply, onClear, testID, }) {
|
|
25
|
+
const [visible, setVisible] = useState(false);
|
|
26
|
+
const theme = useTheme();
|
|
27
|
+
const countLabel = activeCount > 0 ? `, ${activeCount} activos` : "";
|
|
28
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Pressable, { accessibilityLabel: `${triggerLabel}${countLabel}`, accessibilityRole: "button", className: "min-h-11 flex-row items-center justify-center gap-2 self-start rounded-full bg-bg-muted px-4", onPress: () => setVisible(true), style: { minHeight: 44 }, testID: testID ? `${testID}-trigger` : undefined, children: [_jsx(Icon, { color: theme.icon.secondary, name: "options-outline", size: 18 }), _jsx(Typography.Text, { className: "text-text-primary", variant: "buttonSmall", children: triggerLabel }), activeCount > 0 ? (_jsx(Typography.Text, { accessibilityLabel: `${activeCount} filtros activos`, className: "text-text-accent", variant: "caption", children: activeCount })) : null] }), _jsx(Sheet, { dismissOnBackdrop: true, footer: _jsxs(View, { className: "flex-row gap-3", children: [onClear ? (_jsx(View, { className: "flex-1", children: _jsx(Button, { onPress: onClear, title: clearLabel, variant: "secondary" }) })) : null, _jsx(View, { className: "flex-1", children: _jsx(Button, { onPress: () => {
|
|
29
|
+
onApply();
|
|
30
|
+
setVisible(false);
|
|
31
|
+
}, title: applyLabel }) })] }), onClose: () => setVisible(false), showCloseButton: true, testID: testID ? `${testID}-sheet` : undefined, title: title, visible: visible, children: children })] }));
|
|
32
|
+
}
|
|
33
|
+
function History(props) {
|
|
34
|
+
return _jsx(SearchHistory, { ...props });
|
|
35
|
+
}
|
|
36
|
+
function Suggestions(props) {
|
|
37
|
+
return _jsx(SearchSuggestions, { ...props });
|
|
38
|
+
}
|
|
39
|
+
const Search = {
|
|
40
|
+
Root,
|
|
41
|
+
Field,
|
|
42
|
+
Filters,
|
|
43
|
+
FilterSheet,
|
|
44
|
+
History,
|
|
45
|
+
Suggestions,
|
|
46
|
+
};
|
|
47
|
+
export default Search;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type SearchSuggestionsProps } from "./Navigation.SearchSuggestions.js";
|
|
1
2
|
export interface SearchBarProps {
|
|
2
3
|
value: string;
|
|
3
4
|
onChangeText: (value: string) => void;
|
|
@@ -9,10 +10,13 @@ export interface SearchBarProps {
|
|
|
9
10
|
onPress?: () => void;
|
|
10
11
|
className?: string;
|
|
11
12
|
testID?: string;
|
|
13
|
+
accessibilityLabel?: string;
|
|
14
|
+
clearAccessibilityLabel?: string;
|
|
15
|
+
suggestions?: SearchSuggestionsProps;
|
|
12
16
|
}
|
|
13
17
|
/**
|
|
14
18
|
* **Pill** search bar (rounded-full), 2026 style (merge of Material 3 + iOS 26).
|
|
15
19
|
* Use `editable={false}` + `onPress` for a trigger that navigates to the search screen.
|
|
16
20
|
*/
|
|
17
|
-
declare function SearchBar({ value, onChangeText, placeholder, onSubmit, onClear, autoFocus, editable, onPress, className, testID, }: SearchBarProps): import("react").JSX.Element;
|
|
21
|
+
declare function SearchBar({ value, onChangeText, placeholder, onSubmit, onClear, autoFocus, editable, onPress, className, testID, accessibilityLabel, clearAccessibilityLabel, suggestions, }: SearchBarProps): import("react").JSX.Element;
|
|
18
22
|
export default SearchBar;
|
|
@@ -1,28 +1,46 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
2
|
import Icon from "../Display/Display.Icon.js";
|
|
3
|
+
import SearchSuggestions from "./Navigation.SearchSuggestions.js";
|
|
3
4
|
import Pressable from "../primitives/Pressable.js";
|
|
4
|
-
import {
|
|
5
|
+
import { useTheme } from "../theme/index.js";
|
|
5
6
|
import { cn } from "../theme/tw.js";
|
|
7
|
+
import { resolveTextFontFamily, typographyVariants, } from "../theme/typography.js";
|
|
6
8
|
import { Typography } from "../Typography/index.js";
|
|
7
9
|
import { useState } from "react";
|
|
8
|
-
import { TextInput, View } from "react-native";
|
|
10
|
+
import { Keyboard, TextInput, View } from "react-native";
|
|
9
11
|
/**
|
|
10
12
|
* **Pill** search bar (rounded-full), 2026 style (merge of Material 3 + iOS 26).
|
|
11
13
|
* Use `editable={false}` + `onPress` for a trigger that navigates to the search screen.
|
|
12
14
|
*/
|
|
13
|
-
function SearchBar({ value, onChangeText, placeholder = "Buscar", onSubmit, onClear, autoFocus, editable = true, onPress, className, testID, }) {
|
|
15
|
+
function SearchBar({ value, onChangeText, placeholder = "Buscar", onSubmit, onClear, autoFocus, editable = true, onPress, className, testID, accessibilityLabel, clearAccessibilityLabel = "Limpiar", suggestions, }) {
|
|
16
|
+
const theme = useTheme();
|
|
14
17
|
const [focused, setFocused] = useState(false);
|
|
15
18
|
const body = (_jsxs(View, { className: cn("flex-row items-center gap-2 rounded-full px-4", focused ? "bg-bg-card" : "bg-bg-muted", className), style: {
|
|
16
|
-
|
|
19
|
+
minHeight: 48,
|
|
20
|
+
minWidth: 48,
|
|
17
21
|
borderWidth: 1,
|
|
18
22
|
borderColor: focused ? theme.border.focus : "transparent",
|
|
19
|
-
}, children: [_jsx(Icon, { color: focused ? theme.border.focus : theme.icon.tertiary, name: "search", size: 18 }), editable ? (_jsx(TextInput, { autoFocus: autoFocus, className: "flex-1 text-
|
|
23
|
+
}, children: [_jsx(View, { accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", children: _jsx(Icon, { color: focused ? theme.border.focus : theme.icon.tertiary, name: "search", size: 18 }) }), editable ? (_jsx(TextInput, { accessibilityLabel: accessibilityLabel ?? placeholder, autoFocus: autoFocus, className: "flex-1 text-text-primary", onBlur: () => setFocused(false), onChangeText: onChangeText, onFocus: () => setFocused(true), onSubmitEditing: (e) => onSubmit?.(e.nativeEvent.text), placeholder: placeholder, placeholderTextColor: theme.text.tertiary, returnKeyType: "search", selectionColor: theme.primary, style: {
|
|
24
|
+
...typographyVariants.bodyReadable,
|
|
25
|
+
fontFamily: resolveTextFontFamily("bodyReadable"),
|
|
26
|
+
minHeight: 48,
|
|
27
|
+
paddingVertical: 8,
|
|
28
|
+
}, testID: testID ? `${testID}-input` : undefined, underlineColorAndroid: "transparent", value: value })) : (_jsx(Typography.Text, { className: "flex-1 text-text-tertiary", variant: "bodyReadable", children: value || placeholder })), editable && value.length > 0 ? (_jsx(Pressable, { accessibilityLabel: clearAccessibilityLabel, hitSlop: 8, onPress: () => {
|
|
20
29
|
onChangeText("");
|
|
21
30
|
onClear?.();
|
|
31
|
+
}, style: {
|
|
32
|
+
minHeight: 48,
|
|
33
|
+
minWidth: 48,
|
|
34
|
+
alignItems: "center",
|
|
35
|
+
justifyContent: "center",
|
|
22
36
|
}, children: _jsx(Icon, { color: theme.icon.tertiary, name: "close-circle", size: 18 }) })) : null] }));
|
|
23
37
|
if (!editable && onPress) {
|
|
24
|
-
return (_jsx(Pressable, { accessibilityLabel: placeholder, accessibilityRole: "search", onPress: onPress, testID: testID, children: body }));
|
|
38
|
+
return (_jsx(Pressable, { accessibilityLabel: accessibilityLabel ?? placeholder, accessibilityRole: "search", onPress: onPress, style: { minHeight: 48, minWidth: 48 }, testID: testID, children: body }));
|
|
25
39
|
}
|
|
26
|
-
return
|
|
40
|
+
return (_jsxs(View, { testID: testID, children: [body, focused && suggestions ? (_jsx(SearchSuggestions, { ...suggestions, onSelect: (suggestion) => {
|
|
41
|
+
suggestions.onSelect(suggestion);
|
|
42
|
+
setFocused(false);
|
|
43
|
+
Keyboard.dismiss();
|
|
44
|
+
} })) : null] }));
|
|
27
45
|
}
|
|
28
46
|
export default SearchBar;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface SearchSuggestion {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface SearchSuggestionsProps {
|
|
7
|
+
items: readonly SearchSuggestion[];
|
|
8
|
+
onSelect: (suggestion: SearchSuggestion) => void;
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
error?: string;
|
|
11
|
+
onRetry?: () => void;
|
|
12
|
+
emptyLabel?: string;
|
|
13
|
+
}
|
|
14
|
+
export default function SearchSuggestions({ items, onSelect, loading, error, onRetry, emptyLabel, }: SearchSuggestionsProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
+
import Pressable from "../primitives/Pressable.js";
|
|
3
|
+
import { Typography } from "../Typography/index.js";
|
|
4
|
+
import { View } from "react-native";
|
|
5
|
+
export default function SearchSuggestions({ items, onSelect, loading, error, onRetry, emptyLabel = "Sin sugerencias", }) {
|
|
6
|
+
return (_jsx(View, { className: "gap-1 border-b border-border-light py-2", children: loading ? (_jsx(Typography.Text, { accessibilityLiveRegion: "polite", children: "Buscando sugerencias\u2026" })) : error ? (_jsxs(_Fragment, { children: [_jsx(Typography.Text, { accessibilityLiveRegion: "polite", className: "text-danger", children: error }), onRetry ? (_jsx(Pressable, { onPress: onRetry, style: { minHeight: 48, justifyContent: "center" }, children: _jsx(Typography.Text, { className: "text-text-accent", children: "Reintentar sugerencias" }) })) : null] })) : !items.length ? (_jsx(Typography.Text, { accessibilityLiveRegion: "polite", className: "text-text-secondary", children: emptyLabel })) : (items.map((item) => (_jsxs(Pressable, { accessibilityLabel: item.description ? `${item.label}. ${item.description}` : item.label, className: "px-3 py-2", onPress: () => onSelect(item), style: { minHeight: 48, justifyContent: "center" }, children: [_jsx(Typography.Text, { variant: "bodyReadable", children: item.label }), item.description ? (_jsx(Typography.Text, { className: "text-text-secondary", variant: "bodyLarge", children: item.description })) : null] }, item.id)))) }));
|
|
7
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { Typography } from "../Typography/index.js";
|
|
1
2
|
import { ComponentType } from "react";
|
|
3
|
+
import { type StyleProp, type ViewStyle } from "react-native";
|
|
2
4
|
export interface SegmentedOption<T extends string> {
|
|
3
5
|
label: string;
|
|
4
6
|
value: T;
|
|
@@ -9,6 +11,9 @@ export interface SegmentedOption<T extends string> {
|
|
|
9
11
|
size?: number;
|
|
10
12
|
color?: string;
|
|
11
13
|
}>;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
accessibilityLabel?: string;
|
|
16
|
+
accessibilityHint?: string;
|
|
12
17
|
}
|
|
13
18
|
export interface SegmentedControlProps<T extends string> {
|
|
14
19
|
options: SegmentedOption<T>[];
|
|
@@ -20,9 +25,14 @@ export interface SegmentedControlProps<T extends string> {
|
|
|
20
25
|
* - `"left"` — icon inline left of the label (compact, single-line).
|
|
21
26
|
*/
|
|
22
27
|
iconLayout?: "top" | "left";
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
accessibilityLabel?: string;
|
|
30
|
+
style?: StyleProp<ViewStyle>;
|
|
31
|
+
optionStyle?: StyleProp<ViewStyle>;
|
|
32
|
+
labelTextProps?: Partial<React.ComponentProps<typeof Typography.Text>>;
|
|
23
33
|
className?: string;
|
|
24
34
|
testID?: string;
|
|
25
35
|
}
|
|
26
|
-
declare function SegmentedControl<T extends string>({ options, value, onChange, iconLayout, className, testID, }: SegmentedControlProps<T>): import("react").JSX.Element;
|
|
36
|
+
declare function SegmentedControl<T extends string>({ options, value, onChange, iconLayout, disabled, accessibilityLabel, style, optionStyle, labelTextProps, className, testID, }: SegmentedControlProps<T>): import("react").JSX.Element;
|
|
27
37
|
export default SegmentedControl;
|
|
28
38
|
export { SegmentedControl };
|
|
@@ -4,27 +4,41 @@ import { useTheme } from "../theme/index.js";
|
|
|
4
4
|
import { cn } from "../theme/tw.js";
|
|
5
5
|
import { Typography } from "../Typography/index.js";
|
|
6
6
|
import { TouchableOpacity, View } from "react-native";
|
|
7
|
-
function SegmentedControl({ options, value, onChange, iconLayout = "top", className, testID, }) {
|
|
7
|
+
function SegmentedControl({ options, value, onChange, iconLayout = "top", disabled = false, accessibilityLabel, style, optionStyle, labelTextProps, className, testID, }) {
|
|
8
8
|
const theme = useTheme();
|
|
9
9
|
const hasIcons = options.some((o) => o.icon || o.customIcon);
|
|
10
|
-
return (_jsx(View, { accessibilityRole: "tablist", className: cn("flex-row bg-bg-muted rounded-lg p-1 gap-1", className), testID: testID, children: options.map((option) => {
|
|
10
|
+
return (_jsx(View, { accessibilityLabel: accessibilityLabel, accessibilityRole: "tablist", className: cn("flex-row bg-bg-muted rounded-lg p-1 gap-1", className), style: style, testID: testID, children: options.map((option) => {
|
|
11
11
|
const selected = option.value === value;
|
|
12
|
+
const isDisabled = disabled || !!option.disabled;
|
|
12
13
|
const iconColor = selected ? theme.text.primary : theme.text.secondary;
|
|
13
14
|
const hasIcon = !!(option.icon || option.customIcon);
|
|
14
15
|
const inline = hasIcons && iconLayout === "left";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
const baseStyle = {
|
|
17
|
+
flex: 1,
|
|
18
|
+
minHeight: 48,
|
|
19
|
+
minWidth: 48,
|
|
20
|
+
flexDirection: inline ? "row" : "column",
|
|
21
|
+
alignItems: "center",
|
|
22
|
+
justifyContent: "center",
|
|
23
|
+
gap: hasIcon ? 4 : 0,
|
|
24
|
+
paddingVertical: 8,
|
|
25
|
+
paddingHorizontal: 4,
|
|
26
|
+
borderRadius: 8,
|
|
27
|
+
...(selected ? { backgroundColor: theme.bg.card, ...theme.shadow.sm } : undefined),
|
|
28
|
+
opacity: isDisabled ? 0.5 : 1,
|
|
29
|
+
};
|
|
30
|
+
return (_jsxs(TouchableOpacity, { accessibilityHint: option.accessibilityHint, accessibilityLabel: option.accessibilityLabel ?? option.label, accessibilityRole: "tab", accessibilityState: isDisabled ? { selected, disabled: true } : { selected }, activeOpacity: 0.7, disabled: isDisabled || undefined, hitSlop: 0, onPress: () => {
|
|
31
|
+
if (!isDisabled)
|
|
32
|
+
onChange(option.value);
|
|
33
|
+
}, style: optionStyle ? [baseStyle, optionStyle] : baseStyle, children: [hasIcon ? (_jsx(Icon, { color: iconColor, customIcon: option.customIcon, name: option.icon, size: 16, type: option.customIcon ? "custom" : "ionicons" })) : null, _jsx(Typography.Text, { ...labelTextProps, semibold: labelTextProps?.semibold ?? selected, style: [
|
|
34
|
+
{
|
|
35
|
+
color: iconColor,
|
|
36
|
+
fontSize: 14,
|
|
37
|
+
textAlign: "center",
|
|
38
|
+
flexShrink: 1,
|
|
39
|
+
},
|
|
40
|
+
labelTextProps?.style,
|
|
41
|
+
], variant: labelTextProps?.variant ?? "caption", children: option.label })] }, option.value));
|
|
28
42
|
}) }));
|
|
29
43
|
}
|
|
30
44
|
export default SegmentedControl;
|
|
@@ -6,11 +6,15 @@ import Menu from "./Navigation.Menu.js";
|
|
|
6
6
|
import { MenuSection } from "./Navigation.MenuSection.js";
|
|
7
7
|
import RowItem from "./Navigation.RowItem.js";
|
|
8
8
|
import SearchBar from "./Navigation.SearchBar.js";
|
|
9
|
+
import SearchSuggestions from "./Navigation.SearchSuggestions.js";
|
|
9
10
|
import SegmentedControl from "./Navigation.SegmentedControl.js";
|
|
10
11
|
import Steps from "./Navigation.Steps.js";
|
|
11
12
|
import TabIcon from "./Navigation.TabIcon.js";
|
|
12
13
|
export type { AppBarBackground } from "./Navigation.AppBar.js";
|
|
13
14
|
export type { MenuSectionProps } from "./Navigation.MenuSection.js";
|
|
15
|
+
export type { SearchFilterSheetProps, SearchFiltersProps, SearchRootProps, } from "./Navigation.Search.js";
|
|
16
|
+
export type { SearchBarProps } from "./Navigation.SearchBar.js";
|
|
17
|
+
export type { SearchSuggestion, SearchSuggestionsProps, } from "./Navigation.SearchSuggestions.js";
|
|
14
18
|
export declare const Navigation: {
|
|
15
19
|
AppBar: (({ title, subtitle, onBack, leading, actions, subheader, variant, tone, accentBar, backVariant, border, safeArea, topSpacing, background, bottomDivider, className, testID, }: import("./Navigation.AppBar.js").AppBarProps) => import("react").JSX.Element) & {
|
|
16
20
|
Action: ({ icon, label, onPress, badge, accessibilityLabel, tone, onDark, bare, testID, }: import("./Navigation.AppBar.js").AppBarActionProps) => import("react").JSX.Element;
|
|
@@ -19,6 +23,15 @@ export declare const Navigation: {
|
|
|
19
23
|
CollapsingHeader: typeof CollapsingHeader;
|
|
20
24
|
FloatingBar: typeof FloatingBar;
|
|
21
25
|
SearchBar: typeof SearchBar;
|
|
26
|
+
Search: {
|
|
27
|
+
Root: ({ children, className, testID }: import("./Navigation.Search.js").SearchRootProps) => import("react").JSX.Element;
|
|
28
|
+
Field: (props: import("./Navigation.SearchBar.js").SearchBarProps) => import("react").JSX.Element;
|
|
29
|
+
Filters: ({ children, className, testID }: import("./Navigation.Search.js").SearchFiltersProps) => import("react").JSX.Element;
|
|
30
|
+
FilterSheet: ({ children, activeCount, title, triggerLabel, applyLabel, clearLabel, onApply, onClear, testID, }: import("./Navigation.Search.js").SearchFilterSheetProps) => import("react").JSX.Element;
|
|
31
|
+
History: (props: import("./Navigation.Search.js").SearchHistoryProps) => import("react").JSX.Element;
|
|
32
|
+
Suggestions: (props: import("./Navigation.SearchSuggestions.js").SearchSuggestionsProps) => import("react").JSX.Element;
|
|
33
|
+
};
|
|
34
|
+
SearchSuggestions: typeof SearchSuggestions;
|
|
22
35
|
Header: ({ title, logo, logoSource, backButton, handleBackButton, className, }: import("./Navigation.Header.js").HeaderProps) => import("react").JSX.Element;
|
|
23
36
|
HeaderToolbar: typeof HeaderToolbar;
|
|
24
37
|
TabItem: import("react").FC<import("./Navigation.TabItem.js").TabIconProps>;
|
package/dist/Navigation/index.js
CHANGED
|
@@ -7,7 +7,9 @@ import HeaderToolbar from "./Navigation.HeaderToolbar.js";
|
|
|
7
7
|
import Menu from "./Navigation.Menu.js";
|
|
8
8
|
import { MenuSection } from "./Navigation.MenuSection.js";
|
|
9
9
|
import RowItem from "./Navigation.RowItem.js";
|
|
10
|
+
import Search from "./Navigation.Search.js";
|
|
10
11
|
import SearchBar from "./Navigation.SearchBar.js";
|
|
12
|
+
import SearchSuggestions from "./Navigation.SearchSuggestions.js";
|
|
11
13
|
import SegmentedControl from "./Navigation.SegmentedControl.js";
|
|
12
14
|
import Steps from "./Navigation.Steps.js";
|
|
13
15
|
import TabIcon from "./Navigation.TabIcon.js";
|
|
@@ -19,6 +21,8 @@ export const Navigation = {
|
|
|
19
21
|
CollapsingHeader,
|
|
20
22
|
FloatingBar,
|
|
21
23
|
SearchBar,
|
|
24
|
+
Search,
|
|
25
|
+
SearchSuggestions,
|
|
22
26
|
Header,
|
|
23
27
|
HeaderToolbar,
|
|
24
28
|
TabItem,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
2
2
|
import { AppText } from "./Typography.Text.js";
|
|
3
3
|
const Heading = ({ variant = "h1", ...props }) => {
|
|
4
|
-
return _jsx(AppText, { variant: variant, ...props });
|
|
4
|
+
return _jsx(AppText, { accessibilityRole: "header", variant: variant, ...props });
|
|
5
5
|
};
|
|
6
6
|
export default Heading;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { typographyVariants } from "../theme/typography.js";
|
|
2
|
+
import { type TextInputProps } from "react-native";
|
|
3
|
+
export type SelectableTextProps = Pick<TextInputProps, "accessibilityLabel" | "testID" | "style" | "allowFontScaling" | "onSelectionChange"> & {
|
|
4
|
+
value: string;
|
|
5
|
+
variant?: keyof typeof typographyVariants;
|
|
6
|
+
semibold?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
declare function SelectableText({ value, variant, semibold, className, style, ...props }: SelectableTextProps): import("react").JSX.Element;
|
|
10
|
+
export default SelectableText;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
2
|
+
import { cn } from "../theme/tw.js";
|
|
3
|
+
import { resolveTextFontFamily, typographyVariants, } from "../theme/typography.js";
|
|
4
|
+
import { TextInput } from "react-native";
|
|
5
|
+
function SelectableText({ value, variant = "body", semibold = false, className, style, ...props }) {
|
|
6
|
+
return (_jsx(TextInput, { ...props, className: cn("text-text-primary", className), editable: false, multiline: true, readOnly: true, scrollEnabled: false, showSoftInputOnFocus: false, style: [
|
|
7
|
+
typographyVariants[variant],
|
|
8
|
+
{
|
|
9
|
+
fontFamily: resolveTextFontFamily(variant, false, semibold),
|
|
10
|
+
padding: 0,
|
|
11
|
+
textAlignVertical: "top",
|
|
12
|
+
},
|
|
13
|
+
style,
|
|
14
|
+
], underlineColorAndroid: "transparent", value: value }));
|
|
15
|
+
}
|
|
16
|
+
export default SelectableText;
|
|
@@ -1,31 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
2
2
|
import { cn } from "../theme/tw.js";
|
|
3
|
-
import {
|
|
4
|
-
import { Text } from "react-native";
|
|
3
|
+
import { resolveTextFontFamily, Typography, } from "../theme/typography.js";
|
|
4
|
+
import { StyleSheet, Text } from "react-native";
|
|
5
5
|
function AppText({ variant = "body", color, bold = false, italic = false, underline = false, align = "left", transform = "none", semibold = false, style, className, children, ...props }) {
|
|
6
6
|
const baseStyle = Typography.variants[variant];
|
|
7
7
|
const textClassName = cn("text-text-primary", align === "center" && "text-center", align === "right" && "text-right", align === "justify" && "text-justify", transform === "uppercase" && "uppercase", transform === "lowercase" && "lowercase", transform === "capitalize" && "capitalize", underline && "underline", italic && "italic", className);
|
|
8
|
-
// Resolve the family LIVE from the configurable registry by the variant's role, so
|
|
9
|
-
// `configureFonts(...)` (app/Storybook) takes effect. Falls back to the variant's baked
|
|
10
|
-
// family if a role is somehow missing.
|
|
11
|
-
const variantFamily = fontFamilies[variantFontRole[variant]] ?? baseStyle.fontFamily;
|
|
12
|
-
// `bold`/`semibold` map to the IBM Plex Sans weights — but NOT when the active family is a
|
|
13
|
-
// branded face (a configured title face, or IBM Plex Mono): those carry their own weight, so
|
|
14
|
-
// forcing Plex Sans would erase the typeface. Keep the variant's family for those.
|
|
15
|
-
const isBrandedFace = typeof variantFamily === "string" &&
|
|
16
|
-
!variantFamily.startsWith("Inter_") &&
|
|
17
|
-
!variantFamily.startsWith("IBMPlexSans_");
|
|
18
8
|
const textStyle = {
|
|
19
9
|
...baseStyle,
|
|
20
10
|
...(color ? { color } : {}),
|
|
21
|
-
fontFamily:
|
|
22
|
-
|
|
23
|
-
: bold
|
|
24
|
-
? fontFamilies.extraBold
|
|
25
|
-
: semibold
|
|
26
|
-
? fontFamilies.semiBold
|
|
27
|
-
: variantFamily,
|
|
28
|
-
...(Array.isArray(style) ? Object.assign({}, ...style) : style),
|
|
11
|
+
fontFamily: resolveTextFontFamily(variant, bold, semibold),
|
|
12
|
+
...StyleSheet.flatten(style),
|
|
29
13
|
};
|
|
30
14
|
return (_jsx(Text, { className: textClassName, style: textStyle, ...props, children: children }));
|
|
31
15
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import SelectableText from "./Typography.SelectableText.js";
|
|
1
2
|
import { AppText } from "./Typography.Text.js";
|
|
2
3
|
export declare const Typography: {
|
|
3
4
|
Text: typeof AppText;
|
|
4
5
|
Heading: import("react").FC<import("./Typography.Heading.js").TypographyProps>;
|
|
6
|
+
SelectableText: typeof SelectableText;
|
|
5
7
|
};
|
|
6
8
|
export { AppText };
|
|
9
|
+
export { SelectableText };
|
|
7
10
|
export default Typography;
|
package/dist/Typography/index.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import Heading from "./Typography.Heading.js";
|
|
2
|
+
import SelectableText from "./Typography.SelectableText.js";
|
|
2
3
|
import { AppText } from "./Typography.Text.js";
|
|
3
4
|
export const Typography = {
|
|
4
5
|
Text: AppText,
|
|
5
6
|
Heading,
|
|
7
|
+
SelectableText,
|
|
6
8
|
};
|
|
7
9
|
export { AppText };
|
|
10
|
+
export { SelectableText };
|
|
8
11
|
export default Typography;
|
package/dist/branding.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ImageSource } from "./utils/image.js";
|
|
1
2
|
import { type ImageSourcePropType } from "react-native";
|
|
2
3
|
/**
|
|
3
4
|
* Centralized brand assets. Set once at app boot via `setBranding({ ... })`. Components
|
|
@@ -14,14 +15,14 @@ import { type ImageSourcePropType } from "react-native";
|
|
|
14
15
|
*/
|
|
15
16
|
export interface BrandingConfig {
|
|
16
17
|
/** Brand logo (used by `Display.Logo`, `widgets.ScreenHeader`, etc.). */
|
|
17
|
-
logo?:
|
|
18
|
+
logo?: ImageSource;
|
|
18
19
|
/** Brand symbol / icon used by `Display.Pattern kind="mesh"` as the tiled texture. */
|
|
19
20
|
mesh?: ImageSourcePropType;
|
|
20
21
|
/** Tile size in px (overrides `theme.pattern.size` for the brand mesh). */
|
|
21
22
|
meshSize?: number;
|
|
22
23
|
}
|
|
23
24
|
export declare function setBranding(config: BrandingConfig): void;
|
|
24
|
-
export declare function getBrandingLogo():
|
|
25
|
+
export declare function getBrandingLogo(): ImageSource | undefined;
|
|
25
26
|
export declare function getBrandingMesh(): ImageSourcePropType | undefined;
|
|
26
27
|
export declare function getBrandingMeshSize(): number | undefined;
|
|
27
28
|
/** Test-only — reset to initial empty state. Not part of the public API. */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type KeyboardFormProps } from "../Form/Form.KeyboardForm.js";
|
|
1
2
|
import type { AppBarBackground } from "../Navigation/Navigation.AppBar.js";
|
|
2
3
|
import { ReactNode } from "react";
|
|
3
4
|
interface AuthContainerProps {
|
|
@@ -5,11 +6,13 @@ interface AuthContainerProps {
|
|
|
5
6
|
children: ReactNode;
|
|
6
7
|
onBackPress?: () => void;
|
|
7
8
|
className?: string;
|
|
9
|
+
keyboardToolbar?: boolean;
|
|
10
|
+
keyboardFormProps?: Omit<KeyboardFormProps, "children" | "toolbar">;
|
|
8
11
|
/** Gradient + optional texture surface for the header area. Defaults to the `warm`
|
|
9
12
|
* preset. Set `background.pattern` to opt-in a texture (`dots` / `grid` /
|
|
10
13
|
* `diagonals`); compose `<Display.Pattern kind="mesh" />` outside if you want the
|
|
11
14
|
* brand symbol. */
|
|
12
15
|
background?: AppBarBackground;
|
|
13
16
|
}
|
|
14
|
-
declare function AuthContainer({ header, children, onBackPress, background, className, }: AuthContainerProps): import("react").JSX.Element;
|
|
17
|
+
declare function AuthContainer({ header, children, onBackPress, background, className, keyboardToolbar, keyboardFormProps, }: AuthContainerProps): import("react").JSX.Element;
|
|
15
18
|
export default AuthContainer;
|
|
@@ -2,14 +2,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
|
2
2
|
import { Display } from "../Display/index.js";
|
|
3
3
|
import GradientSurface from "../Display/Display.GradientSurface.js";
|
|
4
4
|
import { Pattern } from "../Display/Display.Pattern.js";
|
|
5
|
+
import KeyboardForm from "../Form/Form.KeyboardForm.js";
|
|
5
6
|
import { useTheme } from "../theme/index.js";
|
|
6
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 ?? "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(
|
|
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,6 +1,7 @@
|
|
|
1
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
7
|
primary: "bg-accent";
|
|
@@ -10,18 +11,18 @@ declare const button: import("tailwind-variants").TVReturnType<{
|
|
|
10
11
|
outlineDanger: "bg-transparent border border-danger";
|
|
11
12
|
outlineBlack: "bg-transparent border border-border-strong";
|
|
12
13
|
flat: "bg-text-primary/10";
|
|
13
|
-
link: "bg-transparent
|
|
14
|
+
link: "bg-transparent";
|
|
14
15
|
transparent: "bg-transparent border border-border-light";
|
|
15
16
|
};
|
|
16
17
|
size: {
|
|
17
|
-
small: "py-1.5 px-3 min-h-[
|
|
18
|
-
medium: "py-2.5 px-4 min-h-[
|
|
18
|
+
small: "py-1.5 px-3 min-h-[48px]";
|
|
19
|
+
medium: "py-2.5 px-4 min-h-[48px]";
|
|
19
20
|
large: "py-3 px-5 min-h-[48px]";
|
|
20
21
|
};
|
|
21
22
|
disabled: {
|
|
22
23
|
true: "opacity-70";
|
|
23
24
|
};
|
|
24
|
-
}, undefined, "rounded-md items-center justify-center flex-row min-h-[
|
|
25
|
+
}, undefined, "rounded-md items-center justify-center flex-row min-h-[48px]", {
|
|
25
26
|
variant: {
|
|
26
27
|
primary: "bg-accent";
|
|
27
28
|
accent: "bg-transparent";
|
|
@@ -30,12 +31,12 @@ declare const button: import("tailwind-variants").TVReturnType<{
|
|
|
30
31
|
outlineDanger: "bg-transparent border border-danger";
|
|
31
32
|
outlineBlack: "bg-transparent border border-border-strong";
|
|
32
33
|
flat: "bg-text-primary/10";
|
|
33
|
-
link: "bg-transparent
|
|
34
|
+
link: "bg-transparent";
|
|
34
35
|
transparent: "bg-transparent border border-border-light";
|
|
35
36
|
};
|
|
36
37
|
size: {
|
|
37
|
-
small: "py-1.5 px-3 min-h-[
|
|
38
|
-
medium: "py-2.5 px-4 min-h-[
|
|
38
|
+
small: "py-1.5 px-3 min-h-[48px]";
|
|
39
|
+
medium: "py-2.5 px-4 min-h-[48px]";
|
|
39
40
|
large: "py-3 px-5 min-h-[48px]";
|
|
40
41
|
};
|
|
41
42
|
disabled: {
|
|
@@ -50,12 +51,12 @@ declare const button: import("tailwind-variants").TVReturnType<{
|
|
|
50
51
|
outlineDanger: "bg-transparent border border-danger";
|
|
51
52
|
outlineBlack: "bg-transparent border border-border-strong";
|
|
52
53
|
flat: "bg-text-primary/10";
|
|
53
|
-
link: "bg-transparent
|
|
54
|
+
link: "bg-transparent";
|
|
54
55
|
transparent: "bg-transparent border border-border-light";
|
|
55
56
|
};
|
|
56
57
|
size: {
|
|
57
|
-
small: "py-1.5 px-3 min-h-[
|
|
58
|
-
medium: "py-2.5 px-4 min-h-[
|
|
58
|
+
small: "py-1.5 px-3 min-h-[48px]";
|
|
59
|
+
medium: "py-2.5 px-4 min-h-[48px]";
|
|
59
60
|
large: "py-3 px-5 min-h-[48px]";
|
|
60
61
|
};
|
|
61
62
|
disabled: {
|
|
@@ -123,21 +124,23 @@ declare const buttonIcon: import("tailwind-variants").TVReturnType<{
|
|
|
123
124
|
true: "opacity-70";
|
|
124
125
|
};
|
|
125
126
|
}, undefined>>;
|
|
126
|
-
export interface BaseButtonProps extends VariantProps<typeof button
|
|
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
|
+
testID?: string;
|
|
133
135
|
}
|
|
134
136
|
export declare const BaseButton: FC<BaseButtonProps>;
|
|
135
|
-
export interface BaseButtonIconProps extends VariantProps<typeof buttonIcon
|
|
137
|
+
export interface BaseButtonIconProps extends VariantProps<typeof buttonIcon>, AccessibilityProps {
|
|
136
138
|
icon: string;
|
|
137
139
|
onPress?: () => void;
|
|
138
140
|
loading?: boolean;
|
|
139
141
|
disabled?: boolean;
|
|
140
142
|
className?: string;
|
|
143
|
+
testID?: string;
|
|
141
144
|
}
|
|
142
145
|
export declare const BaseButtonIcon: FC<BaseButtonIconProps>;
|
|
143
146
|
declare const BaseButtonWithIcon: React.FC<BaseButtonProps> & {
|