@sincpro/mobile-ui 0.2.0 → 0.2.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
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @sincpro/mobile-ui
|
|
2
2
|
|
|
3
|
+
> 🤖 **Agentes de IA:** leé [`AGENTS.md`](AGENTS.md) (orientación del ecosistema, patrones) y [`docs/GOTCHAS.md`](docs/GOTCHAS.md) (trampas conocidas).
|
|
4
|
+
|
|
3
5
|
Sincpro Mobile design system: generic, presentational React Native components.
|
|
4
6
|
|
|
5
7
|
- **Presentational only** — receives data via props/callbacks. No domain logic, no services, no state stores.
|
package/dist/views/FormViewV2.js
CHANGED
|
@@ -3,7 +3,7 @@ import { ErrorBoundary, Feedback } from "../Feedback";
|
|
|
3
3
|
import Container from "../layouts/Container";
|
|
4
4
|
import { theme } from "../theme";
|
|
5
5
|
import { FormViewProvider, useFormView } from "../views/FormViewV2.context";
|
|
6
|
-
import ScreenHeader from "../widgets/ScreenHeader";
|
|
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";
|
|
@@ -12,7 +12,7 @@ function FormViewRoot({ name, description, item, isLoading = false, isEmpty = fa
|
|
|
12
12
|
const wrapperProps = withContainer ? {} : { style: { flex: 1 } };
|
|
13
13
|
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
14
|
}
|
|
15
|
-
function Header({ variant =
|
|
15
|
+
function Header({ variant = EVariantScreenHeader.FLAT_HEADER, logoSource, children, }) {
|
|
16
16
|
const { name, description, onBack } = useFormView();
|
|
17
17
|
return (_jsx(_Fragment, { children: _jsx(ScreenHeader, { logoSource: logoSource, onBack: onBack, subtitle: description ? description : `Seleccionar ${name}`, title: name, variant: variant, children: children }) }));
|
|
18
18
|
}
|
package/dist/views/ListViewV2.js
CHANGED
|
@@ -9,7 +9,7 @@ import { cn, tv } from "../theme/tw";
|
|
|
9
9
|
import { Typography } from "../Typography";
|
|
10
10
|
import { ListViewProvider, useListView } from "../views/ListViewV2.context";
|
|
11
11
|
import { toRowItems } from "../views/types/IListView";
|
|
12
|
-
import ScreenHeader from "../widgets/ScreenHeader";
|
|
12
|
+
import ScreenHeader, { EVariantScreenHeader } from "../widgets/ScreenHeader";
|
|
13
13
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
14
14
|
import { FlatList, RefreshControl, ScrollView, TouchableOpacity, View, } from "react-native";
|
|
15
15
|
function ListViewRoot({ name, description, items, isLoading = false, hasError = false, errorMessage, readonly = false, onRefresh, onRetry, onPressItem, onDeleteItem, onSearch, onBack, backgroundColor, withContainer = true, children, }) {
|
|
@@ -20,7 +20,7 @@ function ListViewRoot({ name, description, items, isLoading = false, hasError =
|
|
|
20
20
|
// Propagate contentWithMargin to ContentList via context
|
|
21
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 }) }) }));
|
|
22
22
|
}
|
|
23
|
-
function Header({ variant =
|
|
23
|
+
function Header({ variant = EVariantScreenHeader.ROUNDED_HEADER, children, }) {
|
|
24
24
|
const { name, description, onBack } = useListView();
|
|
25
25
|
return (_jsx(ScreenHeader, { onBack: onBack, subtitle: description ? description : `Seleccionar ${name}`, title: name, variant: variant, children: children }));
|
|
26
26
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ImageSourcePropType } from "react-native";
|
|
2
|
-
export declare
|
|
2
|
+
export declare enum EVariantScreenHeader {
|
|
3
3
|
FLAT_HEADER = "FLAT_HEADER",
|
|
4
4
|
ROUNDED_HEADER = "ROUNDED_HEADER",
|
|
5
5
|
LOGO_WITH_BACK_BUTTON = "LOGO_WITH_BACK_BUTTON",
|
|
@@ -4,15 +4,22 @@ import { Navigation } from "../Navigation";
|
|
|
4
4
|
import { View } from "react-native";
|
|
5
5
|
const Header = Navigation.Header;
|
|
6
6
|
const HeaderToolbar = Navigation.HeaderToolbar;
|
|
7
|
+
export var EVariantScreenHeader;
|
|
8
|
+
(function (EVariantScreenHeader) {
|
|
9
|
+
EVariantScreenHeader["FLAT_HEADER"] = "FLAT_HEADER";
|
|
10
|
+
EVariantScreenHeader["ROUNDED_HEADER"] = "ROUNDED_HEADER";
|
|
11
|
+
EVariantScreenHeader["LOGO_WITH_BACK_BUTTON"] = "LOGO_WITH_BACK_BUTTON";
|
|
12
|
+
EVariantScreenHeader["ONLY_LOGO"] = "ONLY_LOGO";
|
|
13
|
+
})(EVariantScreenHeader || (EVariantScreenHeader = {}));
|
|
7
14
|
function ScreenHeader({ variant, title = "Distribución", subtitle, logoSource, onBack, children, }) {
|
|
8
15
|
switch (variant) {
|
|
9
|
-
case
|
|
16
|
+
case EVariantScreenHeader.FLAT_HEADER:
|
|
10
17
|
return (_jsxs(_Fragment, { children: [_jsx(HeaderToolbar, { flat: true, onBack: onBack, subtitle: subtitle, title: title, withBackground: true }), _jsx(View, { children: children })] }));
|
|
11
|
-
case
|
|
18
|
+
case EVariantScreenHeader.ROUNDED_HEADER:
|
|
12
19
|
return (_jsx(GradientContainer, { className: "pt-0.5 shadow-lg shadow-black/70 rounded-b-[18px] pb-6", children: _jsx(HeaderToolbar, { flat: true, onBack: onBack, subtitle: subtitle, title: title, withBackground: false, children: children }) }));
|
|
13
|
-
case
|
|
20
|
+
case EVariantScreenHeader.LOGO_WITH_BACK_BUTTON:
|
|
14
21
|
return (_jsx(Header, { backButton: true, handleBackButton: onBack, logoSource: logoSource, title: "" }));
|
|
15
|
-
case
|
|
22
|
+
case EVariantScreenHeader.ONLY_LOGO:
|
|
16
23
|
return _jsx(Header, { logoSource: logoSource, title: title });
|
|
17
24
|
default:
|
|
18
25
|
return null;
|
package/package.json
CHANGED