@sincpro/mobile-ui 0.2.1 → 0.3.1
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 +75 -20
- package/dist/Dialog/BottomSheet/BottomSheet.Root.d.ts +13 -9
- package/dist/Dialog/BottomSheet/BottomSheet.Root.js +6 -2
- package/dist/Dialog/Confirmation.context.d.ts +1 -1
- package/dist/Dialog/Dialog.ActionSheet.d.ts +17 -0
- package/dist/Dialog/Dialog.ActionSheet.js +16 -0
- package/dist/Dialog/Dialog.Confirmation.js +5 -1
- package/dist/Dialog/Dialog.EditValue.d.ts +1 -1
- package/dist/Dialog/Dialog.EditValue.js +1 -1
- package/dist/Dialog/Dialog.Sheet.d.ts +26 -0
- package/dist/Dialog/Dialog.Sheet.js +55 -0
- package/dist/Dialog/index.d.ts +9 -7
- package/dist/Dialog/index.js +2 -0
- package/dist/Display/Display.Accordion.d.ts +18 -0
- package/dist/Display/Display.Accordion.js +22 -0
- package/dist/Display/Display.AvatarGroup.d.ts +12 -0
- package/dist/Display/Display.AvatarGroup.js +23 -0
- package/dist/Display/Display.Badge.d.ts +1 -1
- package/dist/Display/Display.Card.d.ts +46 -0
- package/dist/Display/Display.Card.js +36 -0
- package/dist/Display/Display.Carousel.d.ts +13 -0
- package/dist/Display/Display.Carousel.js +19 -0
- package/dist/Display/Display.Chip.d.ts +105 -0
- package/dist/Display/Display.Chip.js +45 -0
- package/dist/Display/Display.CopyableText.d.ts +1 -1
- package/dist/Display/Display.CountRecords.d.ts +1 -1
- package/dist/Display/Display.DataTable.d.ts +19 -0
- package/dist/Display/Display.DataTable.js +22 -0
- package/dist/Display/Display.Date.d.ts +15 -2
- package/dist/Display/Display.Date.js +34 -4
- package/dist/Display/Display.Divider.d.ts +1 -1
- package/dist/Display/Display.GradientSurface.d.ts +116 -0
- package/dist/Display/Display.GradientSurface.js +62 -0
- package/dist/Display/Display.IconBadge.d.ts +13 -0
- package/dist/Display/Display.IconBadge.js +30 -0
- package/dist/Display/Display.Image.d.ts +15 -0
- package/dist/Display/Display.Image.js +17 -0
- package/dist/Display/Display.KeyValue.d.ts +10 -0
- package/dist/Display/Display.KeyValue.js +9 -0
- package/dist/Display/Display.ListItem.d.ts +17 -0
- package/dist/Display/Display.ListItem.js +18 -0
- package/dist/Display/Display.Logo.js +3 -1
- package/dist/Display/Display.MediaCard.d.ts +17 -0
- package/dist/Display/Display.MediaCard.js +12 -0
- package/dist/Display/Display.MediaEmbed.d.ts +19 -0
- package/dist/Display/Display.MediaEmbed.js +39 -0
- package/dist/Display/Display.MenuButton.d.ts +1 -1
- package/dist/Display/Display.Monetary.d.ts +1 -1
- package/dist/Display/Display.Monetary.js +1 -1
- package/dist/Display/Display.Pattern.d.ts +26 -0
- package/dist/Display/Display.Pattern.js +27 -0
- package/dist/Display/Display.PriceTag.d.ts +10 -0
- package/dist/Display/Display.PriceTag.js +23 -0
- package/dist/Display/Display.ProductCard.d.ts +17 -0
- package/dist/Display/Display.ProductCard.js +13 -0
- package/dist/Display/Display.Rating.d.ts +11 -0
- package/dist/Display/Display.Rating.js +16 -0
- package/dist/Display/Display.SearchHistory.d.ts +12 -0
- package/dist/Display/Display.SearchHistory.js +13 -0
- package/dist/Display/Display.SectionHeader.d.ts +13 -0
- package/dist/Display/Display.SectionHeader.js +9 -0
- package/dist/Display/Display.Stat.d.ts +10 -0
- package/dist/Display/Display.Stat.js +9 -0
- package/dist/Display/Display.StatCard.d.ts +14 -0
- package/dist/Display/Display.StatCard.js +13 -0
- package/dist/Display/Display.StatusDot.d.ts +11 -0
- package/dist/Display/Display.StatusDot.js +28 -0
- package/dist/Display/Display.Story.d.ts +15 -0
- package/dist/Display/Display.Story.js +43 -0
- package/dist/Display/Display.StoryTray.d.ts +26 -0
- package/dist/Display/Display.StoryTray.js +43 -0
- package/dist/Display/Display.StoryViewer.d.ts +26 -0
- package/dist/Display/Display.StoryViewer.js +79 -0
- package/dist/Display/Display.SwipeableRow.d.ts +15 -0
- package/dist/Display/Display.SwipeableRow.js +28 -0
- package/dist/Display/Display.Tag.d.ts +11 -0
- package/dist/Display/Display.Tag.js +9 -0
- package/dist/Display/Display.Timeline.d.ts +13 -0
- package/dist/Display/Display.Timeline.js +19 -0
- package/dist/Display/Display.Tooltip.d.ts +10 -0
- package/dist/Display/Display.Tooltip.js +24 -0
- package/dist/Display/index.d.ts +70 -0
- package/dist/Display/index.js +58 -0
- package/dist/Feedback/ErrorBoundary.d.ts +1 -1
- package/dist/Feedback/Feedback.Banner.d.ts +82 -0
- package/dist/Feedback/Feedback.Banner.js +35 -0
- package/dist/Feedback/Feedback.DomainSplashScreen.d.ts +2 -1
- package/dist/Feedback/Feedback.DomainSplashScreen.js +3 -2
- package/dist/Feedback/Feedback.Empty.d.ts +1 -1
- package/dist/Feedback/Feedback.EmptyState.d.ts +15 -0
- package/dist/Feedback/Feedback.EmptyState.js +11 -0
- package/dist/Feedback/Feedback.Error.d.ts +1 -1
- package/dist/Feedback/Feedback.Loading.d.ts +8 -1
- package/dist/Feedback/Feedback.Loading.js +7 -1
- package/dist/Feedback/Feedback.PermissionCard.d.ts +15 -0
- package/dist/Feedback/Feedback.PermissionCard.js +11 -0
- package/dist/Feedback/Feedback.Progress.d.ts +9 -0
- package/dist/Feedback/Feedback.Progress.js +35 -0
- package/dist/Feedback/Feedback.ProgressCircle.d.ts +12 -0
- package/dist/Feedback/Feedback.ProgressCircle.js +15 -0
- package/dist/Feedback/Feedback.Skeleton.d.ts +11 -0
- package/dist/Feedback/Feedback.Skeleton.js +29 -0
- package/dist/Feedback/Feedback.Spinner.js +2 -1
- package/dist/Feedback/Feedback.Splash.d.ts +7 -1
- package/dist/Feedback/Feedback.Splash.js +11 -2
- package/dist/Feedback/Toast.context.d.ts +42 -0
- package/dist/Feedback/Toast.context.js +121 -0
- package/dist/Feedback/index.d.ts +15 -0
- package/dist/Feedback/index.js +15 -0
- package/dist/Form/Form.Button.d.ts +10 -4
- package/dist/Form/Form.Button.js +27 -16
- package/dist/Form/Form.Checkbox.d.ts +1 -1
- package/dist/Form/Form.Checkbox.js +1 -1
- package/dist/Form/Form.ControlledCheckbox.d.ts +1 -1
- package/dist/Form/Form.ControlledInput.d.ts +1 -1
- package/dist/Form/Form.ControlledMonetaryInput.d.ts +1 -1
- package/dist/Form/Form.ControlledRadioButton.d.ts +1 -1
- package/dist/Form/Form.DatePicker.d.ts +20 -0
- package/dist/Form/Form.DatePicker.js +38 -0
- package/dist/Form/Form.Dropdown.d.ts +1 -1
- package/dist/Form/Form.FAB.d.ts +10 -0
- package/dist/Form/Form.FAB.js +17 -0
- package/dist/Form/Form.FilterButton.d.ts +1 -1
- package/dist/Form/Form.FractionalQuantityInput.d.ts +1 -1
- package/dist/Form/Form.IconButton.d.ts +1 -1
- package/dist/Form/Form.Input.d.ts +2 -1
- package/dist/Form/Form.Input.js +1 -1
- package/dist/Form/Form.InputField.js +1 -1
- package/dist/Form/Form.MonetaryInput.d.ts +1 -1
- package/dist/Form/Form.PinInput.d.ts +12 -0
- package/dist/Form/Form.PinInput.js +23 -0
- package/dist/Form/Form.QuantitySelector.d.ts +2 -1
- package/dist/Form/Form.QuantitySelector.js +1 -1
- package/dist/Form/Form.RadioButton.d.ts +1 -1
- package/dist/Form/Form.SearchBar.d.ts +6 -1
- package/dist/Form/Form.SearchBar.js +4 -0
- package/dist/Form/Form.Select.d.ts +17 -0
- package/dist/Form/Form.Select.js +26 -0
- package/dist/Form/Form.Slider.d.ts +20 -0
- package/dist/Form/Form.Slider.js +16 -0
- package/dist/Form/Form.Switch.d.ts +10 -0
- package/dist/Form/Form.Switch.js +9 -0
- package/dist/Form/index.d.ts +12 -0
- package/dist/Form/index.js +12 -0
- package/dist/Navigation/Navigation.AppBar.d.ts +57 -0
- package/dist/Navigation/Navigation.AppBar.js +72 -0
- package/dist/Navigation/Navigation.BottomNav.d.ts +57 -0
- package/dist/Navigation/Navigation.BottomNav.js +108 -0
- package/dist/Navigation/Navigation.CollapsingHeader.d.ts +34 -0
- package/dist/Navigation/Navigation.CollapsingHeader.js +47 -0
- package/dist/Navigation/Navigation.FloatingBar.d.ts +15 -0
- package/dist/Navigation/Navigation.FloatingBar.js +21 -0
- package/dist/Navigation/Navigation.Header.d.ts +6 -2
- package/dist/Navigation/Navigation.Header.js +4 -0
- package/dist/Navigation/Navigation.HeaderToolbar.d.ts +1 -1
- package/dist/Navigation/Navigation.Menu.d.ts +21 -0
- package/dist/Navigation/Navigation.Menu.js +42 -0
- package/dist/Navigation/Navigation.RowItem.d.ts +1 -1
- package/dist/Navigation/Navigation.SearchBar.d.ts +18 -0
- package/dist/Navigation/Navigation.SearchBar.js +28 -0
- package/dist/Navigation/Navigation.SegmentedControl.d.ts +14 -0
- package/dist/Navigation/Navigation.SegmentedControl.js +13 -0
- package/dist/Navigation/Navigation.Steps.d.ts +8 -0
- package/dist/Navigation/Navigation.Steps.js +17 -0
- package/dist/Navigation/Navigation.TabIcon.d.ts +5 -1
- package/dist/Navigation/Navigation.TabIcon.js +4 -0
- package/dist/Navigation/Navigation.TabItem.d.ts +5 -0
- package/dist/Navigation/Navigation.TabItem.js +5 -0
- package/dist/Navigation/Navigation.Tabs.d.ts +28 -0
- package/dist/Navigation/Navigation.Tabs.js +45 -0
- package/dist/Navigation/index.d.ts +32 -1
- package/dist/Navigation/index.js +18 -0
- package/dist/Typography/Typography.Text.d.ts +3 -2
- package/dist/Typography/Typography.Text.js +16 -6
- package/dist/branding.d.ts +6 -0
- package/dist/branding.js +7 -0
- package/dist/icons/ArrowDownIcon.d.ts +2 -1
- package/dist/icons/ArrowUpIcon.d.ts +2 -1
- package/dist/icons/CreditIcon.d.ts +1 -1
- package/dist/icons/OdooIcon.d.ts +6 -1
- package/dist/icons/OdooIcon.js +5 -0
- package/dist/icons/PrinterIcon.d.ts +5 -0
- package/dist/icons/PrinterIcon.js +5 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/layouts/AuthContainer.d.ts +1 -1
- package/dist/layouts/AuthContainer.js +2 -2
- package/dist/layouts/Container.d.ts +1 -0
- package/dist/layouts/Container.js +2 -3
- package/dist/layouts/GradientContainer.d.ts +1 -1
- package/dist/layouts/PlainLayout.d.ts +1 -1
- package/dist/layouts/ScrollContainer.d.ts +2 -2
- package/dist/layouts/ScrollContainer.js +1 -1
- package/dist/layouts/TabNavigatorLayout.d.ts +2 -2
- package/dist/layouts/TabNavigatorLayout.js +4 -0
- package/dist/primitives/AspectRatio.d.ts +10 -0
- package/dist/primitives/AspectRatio.js +8 -0
- package/dist/primitives/Box.d.ts +1 -1
- package/dist/primitives/Pressable.d.ts +10 -0
- package/dist/primitives/Pressable.js +9 -0
- package/dist/primitives/Row.d.ts +1 -1
- package/dist/primitives/Spacer.d.ts +8 -0
- package/dist/primitives/Spacer.js +9 -0
- package/dist/primitives/Stack.d.ts +1 -1
- package/dist/primitives/index.d.ts +3 -0
- package/dist/primitives/index.js +3 -0
- package/dist/theme/active.d.ts +2 -0
- package/dist/theme/active.js +13 -0
- package/dist/theme/components/ThemedActivityIndicator.d.ts +1 -1
- package/dist/theme/components/index.d.ts +1 -1
- package/dist/theme/components/index.js +1 -1
- package/dist/theme/dark.d.ts +7 -0
- package/dist/theme/dark.js +85 -0
- package/dist/theme/default.js +1 -0
- package/dist/theme/define.d.ts +5 -5
- package/dist/theme/define.js +5 -5
- package/dist/theme/index.d.ts +4 -1
- package/dist/theme/index.js +4 -1
- package/dist/theme/theme.d.ts +1 -1
- package/dist/theme/theme.js +1 -1
- package/dist/theme/types.d.ts +15 -14
- package/dist/theme/types.js +2 -2
- package/dist/theme/typography.d.ts +117 -60
- package/dist/theme/typography.js +115 -29
- package/dist/theme/useTheme.d.ts +3 -1
- package/dist/theme/useTheme.js +6 -1
- package/dist/tokens/index.d.ts +2 -0
- package/dist/tokens/index.js +2 -0
- package/dist/tokens/motion.d.ts +71 -0
- package/dist/tokens/motion.js +25 -0
- package/dist/utils/date.d.ts +33 -33
- package/dist/utils/date.js +39 -39
- package/dist/utils/timezone.d.ts +5 -0
- package/dist/views/AuthFormView.d.ts +1 -1
- package/dist/views/FormViewV2.context.d.ts +1 -1
- package/dist/views/FormViewV2.d.ts +12 -11
- package/dist/views/FormViewV2.js +8 -4
- package/dist/views/ListViewV2.context.d.ts +6 -2
- package/dist/views/ListViewV2.context.js +3 -1
- package/dist/views/ListViewV2.d.ts +26 -21
- package/dist/views/ListViewV2.js +18 -20
- package/dist/views/Wizard/Wizard.context.d.ts +1 -1
- package/dist/widgets/CircleButton.d.ts +6 -2
- package/dist/widgets/CircleButton.js +4 -0
- package/dist/widgets/GeoPermissionCard.d.ts +6 -1
- package/dist/widgets/GeoPermissionCard.js +8 -3
- package/dist/widgets/HomeHeader.d.ts +4 -0
- package/dist/widgets/HomeHeader.js +4 -0
- package/dist/widgets/JSONViewer.d.ts +2 -1
- package/dist/widgets/JSONViewer.js +9 -12
- package/dist/widgets/MenuCard.d.ts +1 -1
- package/dist/widgets/ScreenHeader.d.ts +5 -1
- package/dist/widgets/ScreenHeader.js +4 -0
- package/dist/widgets/TimeZoneSelector.d.ts +6 -1
- package/dist/widgets/TimeZoneSelector.js +6 -1
- package/dist/widgets/TimeZoneSelectorModal.d.ts +6 -1
- package/dist/widgets/TimeZoneSelectorModal.js +8 -3
- package/package.json +41 -23
- package/tailwind.preset.js +14 -0
- package/dist/notifications/index.d.ts +0 -1
- package/dist/notifications/index.js +0 -1
- package/dist/providers/index.d.ts +0 -1
- package/dist/providers/index.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EVariantScreenHeader } from "../widgets/ScreenHeader";
|
|
2
|
-
import { ReactNode } from "react";
|
|
2
|
+
import React, { ReactNode } from "react";
|
|
3
3
|
import { type ImageSourcePropType } from "react-native";
|
|
4
4
|
interface FormViewProps<T> {
|
|
5
5
|
name: string;
|
|
@@ -16,36 +16,37 @@ interface FormViewProps<T> {
|
|
|
16
16
|
withContainer?: boolean;
|
|
17
17
|
children: ReactNode;
|
|
18
18
|
}
|
|
19
|
-
declare function FormViewRoot<T>({ name, description, item, isLoading, isEmpty, hasError, errorMessage, readonly, onRefresh, onRetry, onBack, withContainer, children, }: FormViewProps<T>):
|
|
20
|
-
declare function Header({
|
|
19
|
+
declare function FormViewRoot<T>({ name, description, item, isLoading, isEmpty, hasError, errorMessage, readonly, onRefresh, onRetry, onBack, withContainer, children, }: FormViewProps<T>): React.JSX.Element;
|
|
20
|
+
declare function Header({ children, }: {
|
|
21
|
+
/** @deprecated The header is now flat (Navigation.AppBar); `variant`/`logoSource` are ignored. */
|
|
21
22
|
variant?: EVariantScreenHeader;
|
|
22
23
|
logoSource?: ImageSourcePropType;
|
|
23
24
|
children?: ReactNode;
|
|
24
|
-
}):
|
|
25
|
+
}): React.JSX.Element;
|
|
25
26
|
declare function HeaderActions({ children }: {
|
|
26
27
|
children: ReactNode;
|
|
27
|
-
}):
|
|
28
|
+
}): React.JSX.Element;
|
|
28
29
|
declare function HeaderActionsBar({ children }: {
|
|
29
30
|
children: ReactNode;
|
|
30
|
-
}):
|
|
31
|
+
}): React.JSX.Element;
|
|
31
32
|
declare function Content({ withMargin, children, }: {
|
|
32
33
|
withMargin?: boolean;
|
|
33
34
|
children: ReactNode;
|
|
34
|
-
}):
|
|
35
|
+
}): React.JSX.Element;
|
|
35
36
|
declare function Form({ children }: {
|
|
36
37
|
children: ReactNode;
|
|
37
|
-
}):
|
|
38
|
+
}): React.JSX.Element;
|
|
38
39
|
declare function Groups({ children }: {
|
|
39
40
|
children: ReactNode;
|
|
40
|
-
}):
|
|
41
|
+
}): React.JSX.Element | null;
|
|
41
42
|
declare function Group({ children, withMargin, elevation, }: {
|
|
42
43
|
children: ReactNode;
|
|
43
44
|
withMargin?: boolean;
|
|
44
45
|
elevation?: "sm" | "md" | "lg";
|
|
45
|
-
}):
|
|
46
|
+
}): React.JSX.Element;
|
|
46
47
|
declare function Footer({ children }: {
|
|
47
48
|
children: ReactNode;
|
|
48
|
-
}):
|
|
49
|
+
}): React.JSX.Element | null;
|
|
49
50
|
export declare const FormViewV2: {
|
|
50
51
|
Root: typeof FormViewRoot;
|
|
51
52
|
Header: typeof Header & {
|
package/dist/views/FormViewV2.js
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment } from "nativewind/jsx-runtime";
|
|
2
2
|
import { ErrorBoundary, Feedback } from "../Feedback";
|
|
3
3
|
import Container from "../layouts/Container";
|
|
4
|
+
import { AppBar } from "../Navigation/Navigation.AppBar";
|
|
4
5
|
import { theme } from "../theme";
|
|
5
6
|
import { FormViewProvider, useFormView } from "../views/FormViewV2.context";
|
|
6
|
-
import ScreenHeader, { EVariantScreenHeader } from "../widgets/ScreenHeader";
|
|
7
7
|
import React from "react";
|
|
8
8
|
import { RefreshControl, View } from "react-native";
|
|
9
9
|
import { KeyboardAwareScrollView } from "react-native-keyboard-controller";
|
|
10
10
|
function FormViewRoot({ name, description, item, isLoading = false, isEmpty = false, hasError = false, errorMessage, readonly = false, onRefresh, onRetry, onBack, withContainer = true, children, }) {
|
|
11
11
|
const Wrapper = withContainer ? Container : View;
|
|
12
|
-
|
|
12
|
+
// The header (AppBar) / parent layout owns the TOP safe-area; the inner Container only
|
|
13
|
+
// reserves the remaining edges to avoid stacking the top inset (double padding).
|
|
14
|
+
const wrapperProps = withContainer
|
|
15
|
+
? { edges: ["bottom", "left", "right"] }
|
|
16
|
+
: { style: { flex: 1 } };
|
|
13
17
|
return (_jsx(FormViewProvider, { description: description, errorMessage: errorMessage, hasError: hasError, isEmpty: isEmpty, isLoading: isLoading, item: item, name: name, onBack: onBack, onRefresh: onRefresh, onRetry: onRetry, readonly: readonly, children: _jsx(ErrorBoundary, { children: _jsx(Wrapper, { ...wrapperProps, children: children }) }) }));
|
|
14
18
|
}
|
|
15
|
-
function Header({
|
|
19
|
+
function Header({ children, }) {
|
|
16
20
|
const { name, description, onBack } = useFormView();
|
|
17
|
-
return (_jsx(
|
|
21
|
+
return (_jsx(AppBar, { onBack: onBack, safeArea: false, subheader: children, subtitle: description ? description : `Seleccionar ${name}`, title: name }));
|
|
18
22
|
}
|
|
19
23
|
function HeaderActions({ children }) {
|
|
20
24
|
return (_jsx(View, { className: "flex-row px-4 my-4 items-center justify-between flex-1 gap-2", children: children }));
|
|
@@ -15,8 +15,10 @@ interface ListViewContextValue<T> {
|
|
|
15
15
|
onDeleteItem?: (item: T) => void;
|
|
16
16
|
onSearch?: (query: string) => void;
|
|
17
17
|
onBack?: () => void;
|
|
18
|
+
onLoadMore?: () => void;
|
|
19
|
+
loadingMore?: boolean;
|
|
18
20
|
}
|
|
19
|
-
export declare function ListViewProvider<T>({ name, description, items, isLoading, hasError, errorMessage, readonly, onRefresh, onRetry, onPressItem, onDeleteItem, onSearch, onBack, children, }: {
|
|
21
|
+
export declare function ListViewProvider<T>({ name, description, items, isLoading, hasError, errorMessage, readonly, onRefresh, onRetry, onPressItem, onDeleteItem, onSearch, onBack, onLoadMore, loadingMore, children, }: {
|
|
20
22
|
name: string;
|
|
21
23
|
description?: string;
|
|
22
24
|
items: T[];
|
|
@@ -30,7 +32,9 @@ export declare function ListViewProvider<T>({ name, description, items, isLoadin
|
|
|
30
32
|
onDeleteItem?: (item: T) => void;
|
|
31
33
|
onSearch?: (query: string) => void;
|
|
32
34
|
onBack?: () => void;
|
|
35
|
+
onLoadMore?: () => void;
|
|
36
|
+
loadingMore?: boolean;
|
|
33
37
|
children: ReactNode;
|
|
34
|
-
}): import("react
|
|
38
|
+
}): import("react").JSX.Element;
|
|
35
39
|
export declare function useListView<T>(): ListViewContextValue<T>;
|
|
36
40
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
2
2
|
import { createContext, useContext, useState } from "react";
|
|
3
3
|
const Context = createContext(null);
|
|
4
|
-
export function ListViewProvider({ name, description, items, isLoading = false, hasError = false, errorMessage, readonly = false, onRefresh, onRetry, onPressItem, onDeleteItem, onSearch, onBack, children, }) {
|
|
4
|
+
export function ListViewProvider({ name, description, items, isLoading = false, hasError = false, errorMessage, readonly = false, onRefresh, onRetry, onPressItem, onDeleteItem, onSearch, onBack, onLoadMore, loadingMore = false, children, }) {
|
|
5
5
|
const [showRefreshing, setShowRefreshing] = useState(false);
|
|
6
6
|
return (_jsx(Context.Provider, { value: {
|
|
7
7
|
name,
|
|
@@ -19,6 +19,8 @@ export function ListViewProvider({ name, description, items, isLoading = false,
|
|
|
19
19
|
onDeleteItem,
|
|
20
20
|
onSearch,
|
|
21
21
|
onBack,
|
|
22
|
+
onLoadMore,
|
|
23
|
+
loadingMore,
|
|
22
24
|
}, children: children }));
|
|
23
25
|
}
|
|
24
26
|
export function useListView() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EVariantScreenHeader } from "../widgets/ScreenHeader";
|
|
2
|
-
import { ReactNode } from "react";
|
|
2
|
+
import React, { ReactNode } from "react";
|
|
3
3
|
import { StyleProp, ViewStyle } from "react-native";
|
|
4
4
|
interface ListViewProps<T> {
|
|
5
5
|
name: string;
|
|
@@ -15,47 +15,52 @@ interface ListViewProps<T> {
|
|
|
15
15
|
onDeleteItem?: (item: T) => void;
|
|
16
16
|
onSearch?: (query: string) => void;
|
|
17
17
|
onBack?: () => void;
|
|
18
|
+
/** Called when the list nears the end — wire to fetch the next page. */
|
|
19
|
+
onLoadMore?: () => void;
|
|
20
|
+
/** Show a footer spinner while the next page loads. */
|
|
21
|
+
loadingMore?: boolean;
|
|
18
22
|
backgroundColor?: string;
|
|
19
23
|
withContainer?: boolean;
|
|
20
24
|
children: ReactNode;
|
|
21
25
|
}
|
|
22
|
-
declare function ListViewRoot<T>({ name, description, items, isLoading, hasError, errorMessage, readonly, onRefresh, onRetry, onPressItem, onDeleteItem, onSearch, onBack, backgroundColor, withContainer, children, }: ListViewProps<T>):
|
|
23
|
-
declare function Header({
|
|
26
|
+
declare function ListViewRoot<T>({ name, description, items, isLoading, hasError, errorMessage, readonly, onRefresh, onRetry, onPressItem, onDeleteItem, onSearch, onBack, onLoadMore, loadingMore, backgroundColor, withContainer, children, }: ListViewProps<T>): React.JSX.Element;
|
|
27
|
+
declare function Header({ children, }: {
|
|
28
|
+
/** @deprecated The header is now flat (Navigation.AppBar); `variant` is ignored. */
|
|
24
29
|
variant?: EVariantScreenHeader;
|
|
25
30
|
children?: ReactNode;
|
|
26
|
-
}):
|
|
31
|
+
}): React.JSX.Element;
|
|
27
32
|
declare function HeaderSearch({ searchQuery }: {
|
|
28
33
|
searchQuery?: string;
|
|
29
|
-
}):
|
|
34
|
+
}): React.JSX.Element | null;
|
|
30
35
|
declare function HeaderActions({ children }: {
|
|
31
36
|
children: ReactNode;
|
|
32
|
-
}):
|
|
37
|
+
}): React.JSX.Element;
|
|
33
38
|
declare function HeaderFilters({ children }: {
|
|
34
39
|
children: ReactNode;
|
|
35
|
-
}):
|
|
40
|
+
}): React.JSX.Element;
|
|
36
41
|
interface FilterChipProps {
|
|
37
42
|
label: string;
|
|
38
43
|
active?: boolean;
|
|
39
44
|
onPress: () => void;
|
|
40
45
|
}
|
|
41
|
-
declare function FilterChip({ label, active, onPress }: FilterChipProps):
|
|
46
|
+
declare function FilterChip({ label, active, onPress }: FilterChipProps): React.JSX.Element;
|
|
42
47
|
declare function FilterChips({ children }: {
|
|
43
48
|
children: ReactNode;
|
|
44
|
-
}):
|
|
49
|
+
}): React.JSX.Element;
|
|
45
50
|
declare function Content({ children, withMargin, }: {
|
|
46
51
|
children?: (item: any) => ReactNode;
|
|
47
52
|
withMargin?: boolean;
|
|
48
|
-
}):
|
|
53
|
+
}): React.JSX.Element;
|
|
49
54
|
declare function ContentList({ children, contentWithMargin, }: {
|
|
50
55
|
children?: (item: any) => ReactNode;
|
|
51
56
|
contentWithMargin: boolean;
|
|
52
|
-
}):
|
|
57
|
+
}): React.JSX.Element;
|
|
53
58
|
declare function Footer({ children }: {
|
|
54
59
|
children: ReactNode;
|
|
55
|
-
}):
|
|
60
|
+
}): React.JSX.Element | null;
|
|
56
61
|
declare function FloatingButton({ children }: {
|
|
57
62
|
children: ReactNode;
|
|
58
|
-
}):
|
|
63
|
+
}): React.JSX.Element;
|
|
59
64
|
interface RowRootProps {
|
|
60
65
|
children: ReactNode;
|
|
61
66
|
onPress?: () => void;
|
|
@@ -64,45 +69,45 @@ interface RowRootProps {
|
|
|
64
69
|
style?: StyleProp<ViewStyle>;
|
|
65
70
|
backgroundColor?: string;
|
|
66
71
|
}
|
|
67
|
-
declare function RowRoot({ children, onPress, onLongPress, showDivider, style, backgroundColor, }: RowRootProps):
|
|
72
|
+
declare function RowRoot({ children, onPress, onLongPress, showDivider, style, backgroundColor, }: RowRootProps): React.JSX.Element;
|
|
68
73
|
interface RowAvatarProps {
|
|
69
74
|
children: ReactNode;
|
|
70
75
|
style?: StyleProp<ViewStyle>;
|
|
71
76
|
}
|
|
72
|
-
declare function RowAvatar({ children, style }: RowAvatarProps):
|
|
77
|
+
declare function RowAvatar({ children, style }: RowAvatarProps): React.JSX.Element;
|
|
73
78
|
interface RowContentProps {
|
|
74
79
|
children: ReactNode;
|
|
75
80
|
style?: StyleProp<ViewStyle>;
|
|
76
81
|
}
|
|
77
|
-
declare function RowContent({ children, style }: RowContentProps):
|
|
82
|
+
declare function RowContent({ children, style }: RowContentProps): React.JSX.Element;
|
|
78
83
|
interface RowTitleProps {
|
|
79
84
|
children: ReactNode;
|
|
80
85
|
badge?: ReactNode;
|
|
81
86
|
rightComponent?: ReactNode;
|
|
82
87
|
numberOfLines?: number;
|
|
83
88
|
}
|
|
84
|
-
declare function RowTitle({ children, badge, rightComponent, numberOfLines }: RowTitleProps):
|
|
89
|
+
declare function RowTitle({ children, badge, rightComponent, numberOfLines }: RowTitleProps): React.JSX.Element;
|
|
85
90
|
interface RowSubtitleProps {
|
|
86
91
|
children: ReactNode;
|
|
87
92
|
className?: string;
|
|
88
93
|
}
|
|
89
|
-
declare function RowSubtitle({ children, className }: RowSubtitleProps):
|
|
94
|
+
declare function RowSubtitle({ children, className }: RowSubtitleProps): React.JSX.Element;
|
|
90
95
|
interface RowFooterProps {
|
|
91
96
|
left?: ReactNode;
|
|
92
97
|
right?: ReactNode;
|
|
93
98
|
children?: ReactNode;
|
|
94
99
|
}
|
|
95
|
-
declare function RowFooter({ left, right, children }: RowFooterProps):
|
|
100
|
+
declare function RowFooter({ left, right, children }: RowFooterProps): React.JSX.Element;
|
|
96
101
|
interface RowActionsProps {
|
|
97
102
|
children: ReactNode;
|
|
98
103
|
style?: StyleProp<ViewStyle>;
|
|
99
104
|
}
|
|
100
|
-
declare function RowActions({ children, style }: RowActionsProps):
|
|
105
|
+
declare function RowActions({ children, style }: RowActionsProps): React.JSX.Element;
|
|
101
106
|
interface RowActionButtonProps {
|
|
102
107
|
icon: ReactNode;
|
|
103
108
|
onPress?: () => void;
|
|
104
109
|
}
|
|
105
|
-
declare function RowActionButton({ icon, onPress }: RowActionButtonProps):
|
|
110
|
+
declare function RowActionButton({ icon, onPress }: RowActionButtonProps): React.JSX.Element;
|
|
106
111
|
export declare const ListViewV2: {
|
|
107
112
|
Root: typeof ListViewRoot;
|
|
108
113
|
Header: typeof Header & {
|
package/dist/views/ListViewV2.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "nativewind/jsx-runtime";
|
|
2
2
|
import { Display } from "../Display";
|
|
3
3
|
import { ErrorBoundary, Feedback } from "../Feedback";
|
|
4
|
-
import { Form } from "../Form";
|
|
5
4
|
import Container from "../layouts/Container";
|
|
6
5
|
import { Navigation } from "../Navigation";
|
|
7
6
|
import { theme } from "../theme";
|
|
@@ -9,20 +8,21 @@ import { cn, tv } from "../theme/tw";
|
|
|
9
8
|
import { Typography } from "../Typography";
|
|
10
9
|
import { ListViewProvider, useListView } from "../views/ListViewV2.context";
|
|
11
10
|
import { toRowItems } from "../views/types/IListView";
|
|
12
|
-
import
|
|
13
|
-
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
11
|
+
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
14
12
|
import { FlatList, RefreshControl, ScrollView, TouchableOpacity, View, } from "react-native";
|
|
15
|
-
function ListViewRoot({ name, description, items, isLoading = false, hasError = false, errorMessage, readonly = false, onRefresh, onRetry, onPressItem, onDeleteItem, onSearch, onBack, backgroundColor, withContainer = true, children, }) {
|
|
13
|
+
function ListViewRoot({ name, description, items, isLoading = false, hasError = false, errorMessage, readonly = false, onRefresh, onRetry, onPressItem, onDeleteItem, onSearch, onBack, onLoadMore, loadingMore = false, backgroundColor, withContainer = true, children, }) {
|
|
16
14
|
const Wrapper = withContainer ? Container : View;
|
|
15
|
+
// The header (AppBar) / parent layout owns the TOP safe-area; the Container only reserves
|
|
16
|
+
// the remaining edges to avoid stacking the top inset (double padding).
|
|
17
17
|
const wrapperProps = withContainer
|
|
18
|
-
? {
|
|
18
|
+
? { edges: ["bottom", "left", "right"] }
|
|
19
19
|
: { className: "flex-1 bg-bg-page" };
|
|
20
20
|
// Propagate contentWithMargin to ContentList via context
|
|
21
|
-
return (_jsx(ListViewProvider, { description: description, errorMessage: errorMessage, hasError: hasError, isLoading: isLoading, items: items, name: name, onBack: onBack, onDeleteItem: onDeleteItem, onPressItem: onPressItem, onRefresh: onRefresh, onRetry: onRetry, onSearch: onSearch, readonly: readonly, children: _jsx(ErrorBoundary, { children: _jsx(Wrapper, { ...wrapperProps, children: children }) }) }));
|
|
21
|
+
return (_jsx(ListViewProvider, { description: description, errorMessage: errorMessage, hasError: hasError, isLoading: isLoading, items: items, loadingMore: loadingMore, name: name, onBack: onBack, onDeleteItem: onDeleteItem, onLoadMore: onLoadMore, onPressItem: onPressItem, onRefresh: onRefresh, onRetry: onRetry, onSearch: onSearch, readonly: readonly, children: _jsx(ErrorBoundary, { children: _jsx(Wrapper, { ...wrapperProps, children: children }) }) }));
|
|
22
22
|
}
|
|
23
|
-
function Header({
|
|
23
|
+
function Header({ children, }) {
|
|
24
24
|
const { name, description, onBack } = useListView();
|
|
25
|
-
return (_jsx(
|
|
25
|
+
return (_jsx(Navigation.AppBar, { onBack: onBack, safeArea: false, subheader: children, subtitle: description ? description : `Seleccionar ${name}`, title: name }));
|
|
26
26
|
}
|
|
27
27
|
function HeaderSearch({ searchQuery = "" }) {
|
|
28
28
|
const { name, onSearch } = useListView();
|
|
@@ -42,7 +42,7 @@ function HeaderSearch({ searchQuery = "" }) {
|
|
|
42
42
|
if (!onSearch) {
|
|
43
43
|
return null;
|
|
44
44
|
}
|
|
45
|
-
return (_jsx(View, { className: "
|
|
45
|
+
return (_jsx(View, { className: "pb-2", children: _jsx(Navigation.SearchBar, { onChangeText: setQuery, placeholder: `Buscar ${name}`, value: query }) }));
|
|
46
46
|
}
|
|
47
47
|
function HeaderActions({ children }) {
|
|
48
48
|
return (_jsx(View, { className: "flex-row px-4 my-3 items-center justify-between flex-1 gap-2", children: children }));
|
|
@@ -50,12 +50,13 @@ function HeaderActions({ children }) {
|
|
|
50
50
|
function HeaderFilters({ children }) {
|
|
51
51
|
return _jsx(View, { className: "px-4 py-2 items-center", children: children });
|
|
52
52
|
}
|
|
53
|
+
// Modern filter pills (2026): rounded-full, active = accent (green), inactive = muted track.
|
|
53
54
|
const filterChip = tv({
|
|
54
|
-
base: "py-
|
|
55
|
+
base: "py-1.5 px-3.5 items-center justify-center rounded-full",
|
|
55
56
|
variants: {
|
|
56
57
|
active: {
|
|
57
|
-
true: "bg-
|
|
58
|
-
false: "bg-
|
|
58
|
+
true: "bg-accent",
|
|
59
|
+
false: "bg-bg-muted",
|
|
59
60
|
},
|
|
60
61
|
},
|
|
61
62
|
defaultVariants: { active: false },
|
|
@@ -63,20 +64,17 @@ const filterChip = tv({
|
|
|
63
64
|
const filterChipText = tv({
|
|
64
65
|
variants: {
|
|
65
66
|
active: {
|
|
66
|
-
true: "text-text-
|
|
67
|
+
true: "text-text-inverse font-semibold",
|
|
67
68
|
false: "text-text-secondary",
|
|
68
69
|
},
|
|
69
70
|
},
|
|
70
71
|
defaultVariants: { active: false },
|
|
71
72
|
});
|
|
72
73
|
function FilterChip({ label, active = false, onPress }) {
|
|
73
|
-
return (_jsx(TouchableOpacity, { activeOpacity: 0.
|
|
74
|
+
return (_jsx(TouchableOpacity, { activeOpacity: 0.8, className: filterChip({ active }), onPress: onPress, children: _jsx(Typography.Text, { className: filterChipText({ active }), variant: "bodySmall", children: label }) }));
|
|
74
75
|
}
|
|
75
76
|
function FilterChips({ children }) {
|
|
76
|
-
|
|
77
|
-
return (_jsx(ScrollView, { contentContainerStyle: {
|
|
78
|
-
paddingHorizontal: 16,
|
|
79
|
-
}, horizontal: true, showsHorizontalScrollIndicator: false, style: { flexGrow: 0 }, children: _jsx(View, { className: "flex-row bg-bg-card rounded-[10px] border-[1.5px] border-border-default self-center shadow-sm overflow-hidden", children: childArray.map((child, index) => (_jsxs(View, { className: "flex-row items-center", children: [child, index < childArray.length - 1 && (_jsx(View, { className: "w-[1.5px] h-[22px] bg-border-divider opacity-50 my-0.5" }))] }, index))) }) }));
|
|
77
|
+
return (_jsx(ScrollView, { contentContainerStyle: { paddingHorizontal: 16, gap: 8 }, horizontal: true, showsHorizontalScrollIndicator: false, style: { flexGrow: 0 }, children: children }));
|
|
80
78
|
}
|
|
81
79
|
function Content({ children, withMargin = true, }) {
|
|
82
80
|
const { name, items, isLoading, hasError, errorMessage, onRefresh, onRetry, onBack, showRefreshing, setShowRefreshing, } = useListView();
|
|
@@ -107,7 +105,7 @@ function Content({ children, withMargin = true, }) {
|
|
|
107
105
|
return (_jsxs(View, { style: { flex: 1 }, children: [_jsx(Display.CountRecords, { count: items.length || 0, name: name }), _jsx(ContentList, { contentWithMargin: withMargin, children: children })] }));
|
|
108
106
|
}
|
|
109
107
|
function ContentList({ children, contentWithMargin, }) {
|
|
110
|
-
const { items, onRefresh, showRefreshing, setShowRefreshing, onPressItem, onDeleteItem, readonly, } = useListView();
|
|
108
|
+
const { items, onRefresh, showRefreshing, setShowRefreshing, onPressItem, onDeleteItem, readonly, onLoadMore, loadingMore, } = useListView();
|
|
111
109
|
const rowItems = useMemo(() => toRowItems(items), [items]);
|
|
112
110
|
const handleRefresh = useCallback(async () => {
|
|
113
111
|
setShowRefreshing(true);
|
|
@@ -129,7 +127,7 @@ function ContentList({ children, contentWithMargin, }) {
|
|
|
129
127
|
flex: 1,
|
|
130
128
|
marginTop: 2,
|
|
131
129
|
paddingHorizontal: contentWithMargin ? 4 : 0,
|
|
132
|
-
}, children: _jsx(FlatList, { data: rowItems, keyExtractor: (item) => String(item.index), refreshControl: _jsx(RefreshControl, { colors: [theme.primary], onRefresh: handleRefresh, refreshing: showRefreshing }), renderItem: renderItem, scrollEnabled: true, showsVerticalScrollIndicator: false }) }));
|
|
130
|
+
}, children: _jsx(FlatList, { data: rowItems, keyExtractor: (item) => String(item.index), ListFooterComponent: loadingMore ? (_jsx(View, { className: "py-4", children: _jsx(Feedback.Spinner, { size: "small" }) })) : null, onEndReached: onLoadMore ? () => onLoadMore() : undefined, onEndReachedThreshold: 0.5, refreshControl: _jsx(RefreshControl, { colors: [theme.primary], onRefresh: handleRefresh, refreshing: showRefreshing }), renderItem: renderItem, scrollEnabled: true, showsVerticalScrollIndicator: false }) }));
|
|
133
131
|
}
|
|
134
132
|
function Footer({ children }) {
|
|
135
133
|
const { items } = useListView();
|
|
@@ -22,5 +22,5 @@ export interface WizardProviderProps {
|
|
|
22
22
|
isLoading?: boolean;
|
|
23
23
|
loadingMessage?: string;
|
|
24
24
|
}
|
|
25
|
-
export declare function WizardProvider({ children, initialStep, steps, onComplete, onCancel, isLoading, loadingMessage, }: WizardProviderProps): import("react
|
|
25
|
+
export declare function WizardProvider({ children, initialStep, steps, onComplete, onCancel, isLoading, loadingMessage, }: WizardProviderProps): import("react").JSX.Element;
|
|
26
26
|
export declare function useWizard(): WizardContextValue;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IconType } from "../utils/icon";
|
|
2
|
-
import { ComponentType } from "react";
|
|
2
|
+
import React, { ComponentType } from "react";
|
|
3
3
|
interface CircleButtonProps {
|
|
4
4
|
iconType?: IconType;
|
|
5
5
|
size?: "sm" | "md" | "lg";
|
|
@@ -11,5 +11,9 @@ interface CircleButtonProps {
|
|
|
11
11
|
color?: string;
|
|
12
12
|
}>;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Duplicates the icon-button. Use `Form.IconButton` (general) or
|
|
16
|
+
* `Navigation.AppBar.Action` (headers). Kept for backwards compatibility.
|
|
17
|
+
*/
|
|
18
|
+
export declare function CircleButton({ iconType, size, color, variant, className, customIcon, }: CircleButtonProps): React.JSX.Element;
|
|
15
19
|
export {};
|
|
@@ -31,6 +31,10 @@ const SIZE_MAP = {
|
|
|
31
31
|
md: { container: 60, icon: 30 },
|
|
32
32
|
lg: { container: 80, icon: 40 },
|
|
33
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated Duplicates the icon-button. Use `Form.IconButton` (general) or
|
|
36
|
+
* `Navigation.AppBar.Action` (headers). Kept for backwards compatibility.
|
|
37
|
+
*/
|
|
34
38
|
export function CircleButton({ iconType = "ionicons", size = "md", color = theme.text.inverse, variant = "accent", className, customIcon, }) {
|
|
35
39
|
const iconSize = SIZE_MAP[size].icon;
|
|
36
40
|
return (_jsx(View, { className: cn(circleButtonVariants({ size, variant }), className), children: _jsx(Display.Icon, { color: color, customIcon: customIcon, size: iconSize, type: iconType }) }));
|
|
@@ -4,5 +4,10 @@ interface GeoPermissionCardProps {
|
|
|
4
4
|
loading?: boolean;
|
|
5
5
|
handleRequestPermission?: () => void;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Domain-coupled (geo permission + Spanish copy); relocated to the core.
|
|
9
|
+
* Import from `@sincpro/mobile/ui/components/molecules` instead. Kept here for
|
|
10
|
+
* backwards compatibility and removed in the next major.
|
|
11
|
+
*/
|
|
12
|
+
declare function GeoPermissionCard({ title, loading, handleRequestPermission, hasPermission, }: GeoPermissionCardProps): import("react").JSX.Element;
|
|
8
13
|
export default GeoPermissionCard;
|
|
@@ -7,13 +7,18 @@ import { tv } from "tailwind-variants";
|
|
|
7
7
|
const statusTextVariants = tv({
|
|
8
8
|
variants: {
|
|
9
9
|
granted: {
|
|
10
|
-
true: "text-
|
|
11
|
-
false: "text-
|
|
10
|
+
true: "text-success",
|
|
11
|
+
false: "text-danger",
|
|
12
12
|
},
|
|
13
13
|
},
|
|
14
14
|
});
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Domain-coupled (geo permission + Spanish copy); relocated to the core.
|
|
17
|
+
* Import from `@sincpro/mobile/ui/components/molecules` instead. Kept here for
|
|
18
|
+
* backwards compatibility and removed in the next major.
|
|
19
|
+
*/
|
|
15
20
|
function GeoPermissionCard({ title, loading, handleRequestPermission, hasPermission, }) {
|
|
16
21
|
const granted = hasPermission !== undefined ? hasPermission : false;
|
|
17
|
-
return (_jsx(View, { className: "bg-
|
|
22
|
+
return (_jsx(View, { className: "bg-bg-muted rounded-xl p-5 my-2.5 shadow-sm", children: _jsxs(View, { className: "flex-row items-start", children: [_jsx(Display.Icon, { color: granted ? theme.success : theme.danger, name: granted ? "check-circle" : "location-off", size: 35, type: "material" }), _jsxs(View, { className: "ml-2.5 flex-1", children: [_jsx(Typography.Text, { className: "text-base mb-1", semibold: true, children: title }), _jsx(Typography.Text, { className: statusTextVariants({ granted }), children: granted ? "Permiso activo." : "Permiso inactivo." }), !granted && (_jsx(Form.Button, { loading: loading, onPress: handleRequestPermission, size: "small", title: "Abrir Configuración" }))] })] }) }));
|
|
18
23
|
}
|
|
19
24
|
export default GeoPermissionCard;
|
|
@@ -7,5 +7,9 @@ interface HomeHeaderProps {
|
|
|
7
7
|
readonly backButton?: boolean;
|
|
8
8
|
readonly onBack?: () => void;
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Legacy style (gradient). For new top bars use `Navigation.AppBar`.
|
|
12
|
+
* Kept for backwards compatibility.
|
|
13
|
+
*/
|
|
10
14
|
export declare const HomeHeader: React.FC<HomeHeaderProps>;
|
|
11
15
|
export {};
|
|
@@ -3,6 +3,10 @@ import { Display, Typography } from "../index";
|
|
|
3
3
|
import GradientContainer from "../layouts/GradientContainer";
|
|
4
4
|
import { theme } from "../theme";
|
|
5
5
|
import { TouchableOpacity, View } from "react-native";
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Legacy style (gradient). For new top bars use `Navigation.AppBar`.
|
|
8
|
+
* Kept for backwards compatibility.
|
|
9
|
+
*/
|
|
6
10
|
export const HomeHeader = ({ title = "Distribución", logo, logoSource, backButton = false, onBack, }) => {
|
|
7
11
|
const handleBackPress = onBack ?? (() => { });
|
|
8
12
|
return (_jsx(GradientContainer, { className: "pt-10 pb-4 px-4", children: _jsxs(View, { className: "relative items-center justify-center", children: [backButton && (_jsx(TouchableOpacity, { className: "absolute top-0 left-0 z-10 border border-text-inverse p-1.5 rounded", onPress: handleBackPress, children: _jsx(Display.Icon, { color: theme.text.inverse, name: "chevron-back", size: 25, type: "ionicons" }) })), _jsxs(View, { className: "items-center justify-center", children: [logo || _jsx(Display.Logo, { size: "medium", source: logoSource }), !!title && (_jsx(Typography.Text, { className: "text-text-inverse", variant: "h4", children: title }))] })] }) }));
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
2
|
import { ThemedActivityIndicator } from "../theme";
|
|
3
|
+
import { fontFamilies } from "../theme/typography";
|
|
3
4
|
import { useMemo, useState } from "react";
|
|
4
|
-
import {
|
|
5
|
+
import { Text, View } from "react-native";
|
|
5
6
|
const parseDeepJson = (value) => {
|
|
6
7
|
if (typeof value === "string") {
|
|
7
8
|
try {
|
|
@@ -35,7 +36,7 @@ const JSON_COLORS = {
|
|
|
35
36
|
const MAX_JSON_SIZE = 500_000; // 500KB límite
|
|
36
37
|
const MAX_LINES = 500; // Máximo 500 líneas con colores
|
|
37
38
|
function parseJsonToColoredLines(jsonString) {
|
|
38
|
-
//
|
|
39
|
+
// Guard 1: check size
|
|
39
40
|
if (jsonString.length > MAX_JSON_SIZE) {
|
|
40
41
|
return [
|
|
41
42
|
{
|
|
@@ -47,7 +48,7 @@ function parseJsonToColoredLines(jsonString) {
|
|
|
47
48
|
];
|
|
48
49
|
}
|
|
49
50
|
const lines = jsonString.split("\n");
|
|
50
|
-
//
|
|
51
|
+
// Guard 2: check line count
|
|
51
52
|
if (lines.length > MAX_LINES) {
|
|
52
53
|
return [
|
|
53
54
|
{
|
|
@@ -98,7 +99,7 @@ function parseJsonToColoredLines(jsonString) {
|
|
|
98
99
|
}
|
|
99
100
|
const JsonPreview = ({ selectedJson }) => {
|
|
100
101
|
const [isProcessing, setIsProcessing] = useState(false);
|
|
101
|
-
//
|
|
102
|
+
// Guard 3: format with a robust try-catch
|
|
102
103
|
const formattedJson = useMemo(() => {
|
|
103
104
|
if (!selectedJson || selectedJson.trim() === "") {
|
|
104
105
|
return "{}";
|
|
@@ -113,7 +114,7 @@ const JsonPreview = ({ selectedJson }) => {
|
|
|
113
114
|
return selectedJson; // Mostrar original si falla
|
|
114
115
|
}
|
|
115
116
|
}, [selectedJson]);
|
|
116
|
-
//
|
|
117
|
+
// Guard 4: colorize with processing control
|
|
117
118
|
const coloredLines = useMemo(() => {
|
|
118
119
|
setIsProcessing(true);
|
|
119
120
|
try {
|
|
@@ -125,20 +126,16 @@ const JsonPreview = ({ selectedJson }) => {
|
|
|
125
126
|
return [{ text: formattedJson, color: "#333333" }];
|
|
126
127
|
}
|
|
127
128
|
finally {
|
|
128
|
-
//
|
|
129
|
+
// Small delay so the loading state is visible if needed
|
|
129
130
|
setTimeout(() => setIsProcessing(false), 50);
|
|
130
131
|
}
|
|
131
132
|
}, [formattedJson]);
|
|
132
|
-
//
|
|
133
|
+
// Guard 5: show loading while processing large JSON
|
|
133
134
|
if (isProcessing && formattedJson.length > 50_000) {
|
|
134
135
|
return (_jsxs(View, { className: "p-4 items-center justify-center min-h-[200px]", children: [_jsx(ThemedActivityIndicator, { size: "large" }), _jsx(Text, { className: "mt-2 text-text-secondary text-sm", children: "Procesando JSON..." })] }));
|
|
135
136
|
}
|
|
136
137
|
return (_jsx(View, { className: "p-4", children: _jsx(Text, { selectable: true, style: {
|
|
137
|
-
fontFamily:
|
|
138
|
-
ios: "Courier",
|
|
139
|
-
android: "monospace",
|
|
140
|
-
default: "Courier",
|
|
141
|
-
}),
|
|
138
|
+
fontFamily: fontFamilies.mono,
|
|
142
139
|
fontSize: 13,
|
|
143
140
|
lineHeight: 18,
|
|
144
141
|
}, children: coloredLines.map((line, index) => (_jsx(Text, { style: { color: line.color }, children: line.text }, index))) }) }));
|
|
@@ -9,5 +9,5 @@ interface MenuCardProps {
|
|
|
9
9
|
color?: string;
|
|
10
10
|
}>;
|
|
11
11
|
}
|
|
12
|
-
export declare function MenuCard({ title, iconType, onPress, customIcon, }: MenuCardProps): import("react
|
|
12
|
+
export declare function MenuCard({ title, iconType, onPress, customIcon, }: MenuCardProps): import("react").JSX.Element;
|
|
13
13
|
export {};
|
|
@@ -17,5 +17,9 @@ interface ScreenHeaderProps {
|
|
|
17
17
|
withGradientContainer?: boolean;
|
|
18
18
|
onBack?: () => void;
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated Legacy style (gradient variants). For new top bars use
|
|
22
|
+
* `Navigation.AppBar` (flat). Kept for backwards compatibility (used by FormViewV2/ListViewV2).
|
|
23
|
+
*/
|
|
24
|
+
declare function ScreenHeader({ variant, title, subtitle, logoSource, onBack, children, }: ScreenHeaderProps): import("react").JSX.Element | null;
|
|
21
25
|
export default ScreenHeader;
|
|
@@ -11,6 +11,10 @@ export var EVariantScreenHeader;
|
|
|
11
11
|
EVariantScreenHeader["LOGO_WITH_BACK_BUTTON"] = "LOGO_WITH_BACK_BUTTON";
|
|
12
12
|
EVariantScreenHeader["ONLY_LOGO"] = "ONLY_LOGO";
|
|
13
13
|
})(EVariantScreenHeader || (EVariantScreenHeader = {}));
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Legacy style (gradient variants). For new top bars use
|
|
16
|
+
* `Navigation.AppBar` (flat). Kept for backwards compatibility (used by FormViewV2/ListViewV2).
|
|
17
|
+
*/
|
|
14
18
|
function ScreenHeader({ variant, title = "Distribución", subtitle, logoSource, onBack, children, }) {
|
|
15
19
|
switch (variant) {
|
|
16
20
|
case EVariantScreenHeader.FLAT_HEADER:
|
|
@@ -3,5 +3,10 @@ interface TimeZoneSelectorProps {
|
|
|
3
3
|
onSelect?: (tz: TimezoneLocale) => void;
|
|
4
4
|
timezone?: string | null;
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Domain/region-coupled (hardcoded LatAm timezones + Spanish copy); relocated
|
|
8
|
+
* to the core. Import from `@sincpro/mobile/ui/components/molecules` instead. Kept here for
|
|
9
|
+
* backwards compatibility and removed in the next major.
|
|
10
|
+
*/
|
|
11
|
+
export declare function TimeZoneSelector({ onSelect, timezone }: TimeZoneSelectorProps): import("react").JSX.Element;
|
|
7
12
|
export {};
|
|
@@ -5,6 +5,11 @@ import { Typography } from "../Typography";
|
|
|
5
5
|
import { TimeZoneSelectorModal } from "../widgets/TimeZoneSelectorModal";
|
|
6
6
|
import { useState } from "react";
|
|
7
7
|
import { View } from "react-native";
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Domain/region-coupled (hardcoded LatAm timezones + Spanish copy); relocated
|
|
10
|
+
* to the core. Import from `@sincpro/mobile/ui/components/molecules` instead. Kept here for
|
|
11
|
+
* backwards compatibility and removed in the next major.
|
|
12
|
+
*/
|
|
8
13
|
export function TimeZoneSelector({ onSelect, timezone }) {
|
|
9
14
|
const [currentTimezone, setCurrentTimezone] = useState(timezone);
|
|
10
15
|
const [selectorVisible, setSelectorVisible] = useState(false);
|
|
@@ -15,5 +20,5 @@ export function TimeZoneSelector({ onSelect, timezone }) {
|
|
|
15
20
|
const displayTimezone = currentTimezone
|
|
16
21
|
? currentTimezone.replace(/_/g, " ").replace("America/", "")
|
|
17
22
|
: "No configurada";
|
|
18
|
-
return (_jsxs(View, { className: "bg-
|
|
23
|
+
return (_jsxs(View, { className: "bg-bg-muted rounded-xl p-5 my-2.5 shadow-sm", children: [_jsxs(View, { className: "flex-row items-start", children: [_jsx(Display.Icon, { color: currentTimezone ? theme.info : theme.text.tertiary, name: "schedule", size: 35, type: "material" }), _jsxs(View, { className: "ml-2.5 flex-1", children: [_jsx(Typography.Text, { className: "text-base mb-1", semibold: true, children: "Zona Horaria" }), currentTimezone ? (_jsxs(View, { className: "mt-2 bg-white rounded-lg p-3", children: [_jsx(Typography.Text, { className: "text-text-primary", semibold: true, children: displayTimezone }), _jsx(Typography.Text, { className: "text-text-tertiary text-xs", children: currentTimezone }), _jsx(View, { className: "flex-row gap-2 mt-2", children: _jsx(Form.Button, { onPress: () => setSelectorVisible(true), size: "small", title: "Cambiar", variant: "outline" }) })] })) : (_jsxs(_Fragment, { children: [_jsx(Typography.Text, { className: "text-text-secondary mb-2", children: "Selecciona una zona horaria" }), _jsx(Form.Button, { onPress: () => setSelectorVisible(true), size: "small", title: "Seleccionar Zona Horaria" })] }))] })] }), _jsx(TimeZoneSelectorModal, { currentTimezone: currentTimezone, onClose: () => setSelectorVisible(false), onSelect: handleTimezoneSelected, visible: selectorVisible })] }));
|
|
19
24
|
}
|
|
@@ -5,5 +5,10 @@ interface TimeZoneSelectorModalProps {
|
|
|
5
5
|
onSelect: (tz: TimezoneLocale) => void;
|
|
6
6
|
currentTimezone?: string | null;
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Domain/region-coupled (hardcoded LatAm timezones + Spanish copy); relocated
|
|
10
|
+
* to the core. Import from `@sincpro/mobile/ui/components/molecules` instead. Kept here for
|
|
11
|
+
* backwards compatibility and removed in the next major.
|
|
12
|
+
*/
|
|
13
|
+
declare function TimeZoneSelectorModal({ visible, onClose, onSelect, currentTimezone, }: TimeZoneSelectorModalProps): import("react").JSX.Element;
|
|
9
14
|
export { TimeZoneSelectorModal };
|