@sincpro/mobile-ui 2.0.1 → 3.0.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 +7 -2
- package/dist/Actions/Actions.Button.d.ts +2 -1
- package/dist/Actions/Actions.Button.js +31 -37
- package/dist/Actions/Actions.Dock.d.ts +6 -6
- package/dist/Actions/Actions.Dock.js +14 -72
- package/dist/Actions/Actions.FAB.d.ts +2 -1
- package/dist/Actions/Actions.FilterButton.js +1 -1
- package/dist/Actions/Actions.IconButton.d.ts +3 -4
- package/dist/Actions/Actions.IconButton.js +2 -2
- package/dist/Dialog/Confirmation.context.d.ts +5 -14
- package/dist/Dialog/Confirmation.context.js +11 -51
- package/dist/Dialog/Dialog.ActionSheet.d.ts +8 -7
- package/dist/Dialog/Dialog.ActionSheet.js +45 -19
- package/dist/Dialog/Dialog.Confirmation.d.ts +14 -11
- package/dist/Dialog/Dialog.Confirmation.js +38 -14
- package/dist/Dialog/Dialog.EditValue.d.ts +21 -16
- package/dist/Dialog/Dialog.EditValue.js +73 -14
- package/dist/Dialog/Dialog.Sheet.d.ts +8 -24
- package/dist/Dialog/Dialog.Sheet.js +15 -60
- package/dist/Dialog/index.d.ts +14 -14
- package/dist/Dialog/index.js +5 -3
- package/dist/Dialog/requestConfirmation.d.ts +3 -0
- package/dist/Dialog/requestConfirmation.js +13 -0
- package/dist/Display/Display.Accordion.js +1 -1
- package/dist/Display/Display.Avatar.d.ts +6 -6
- package/dist/Display/Display.Avatar.js +2 -2
- package/dist/Display/Display.Badge.js +4 -4
- package/dist/Display/Display.Card.js +5 -2
- package/dist/Display/Display.Carousel.js +1 -1
- package/dist/Display/Display.CircleButton.d.ts +3 -8
- package/dist/Display/Display.CircleButton.js +2 -2
- package/dist/Display/Display.CopyableText.js +1 -5
- package/dist/Display/Display.Date.d.ts +3 -2
- package/dist/Display/Display.Date.js +3 -3
- package/dist/Display/Display.GradientSurface.d.ts +52 -9
- package/dist/Display/Display.GradientSurface.js +9 -14
- package/dist/Display/Display.Icon.d.ts +7 -11
- package/dist/Display/Display.Icon.js +15 -30
- package/dist/Display/Display.Image.d.ts +2 -1
- package/dist/Display/Display.Image.js +1 -1
- package/dist/Display/Display.KeyValue.js +1 -1
- package/dist/Display/Display.ListItem.js +1 -1
- package/dist/Display/Display.MenuButton.js +4 -4
- package/dist/Display/Display.MenuCard.d.ts +3 -8
- package/dist/Display/Display.MenuCard.js +2 -2
- package/dist/Display/Display.MenuGrid.d.ts +2 -7
- package/dist/Display/Display.MenuGrid.js +1 -1
- package/dist/Display/Display.Monetary.d.ts +2 -6
- package/dist/Display/Display.Monetary.js +2 -2
- package/dist/Display/Display.PriceTag.js +1 -1
- package/dist/Display/Display.Rating.js +1 -1
- package/dist/Display/Display.SearchHistory.d.ts +2 -1
- package/dist/Display/Display.SearchHistory.js +1 -1
- package/dist/Display/Display.StatCard.d.ts +2 -1
- package/dist/Display/Display.StatCard.js +1 -1
- package/dist/Display/Display.StoryViewer.js +10 -6
- package/dist/Display/Display.SwipeableRow.d.ts +2 -1
- package/dist/Display/Display.Timeline.js +1 -1
- package/dist/Display/icon-map.d.ts +344 -0
- package/dist/Display/icon-map.js +86 -0
- package/dist/Display/index.d.ts +2 -0
- package/dist/Display/index.js +1 -0
- package/dist/Feedback/Feedback.Banner.js +13 -12
- package/dist/Feedback/Feedback.Empty.js +1 -1
- package/dist/Feedback/Feedback.EmptyState.d.ts +2 -1
- package/dist/Feedback/Feedback.EmptyState.js +1 -1
- package/dist/Feedback/Feedback.Error.js +1 -1
- package/dist/Feedback/Feedback.PermissionCard.d.ts +2 -1
- package/dist/Feedback/Feedback.PermissionCard.js +2 -2
- package/dist/Feedback/Toast.context.js +3 -3
- package/dist/Form/Form.ControlledDropdown.d.ts +5 -11
- package/dist/Form/Form.ControlledDropdown.js +5 -2
- package/dist/Form/Form.DatePicker.d.ts +5 -9
- package/dist/Form/Form.DatePicker.js +116 -21
- package/dist/Form/Form.Dropdown.d.ts +11 -16
- package/dist/Form/Form.Dropdown.js +54 -90
- package/dist/Form/Form.FractionalQuantityInput.js +4 -11
- package/dist/Form/Form.Input.d.ts +3 -3
- package/dist/Form/Form.KeyboardForm.d.ts +2 -2
- package/dist/Form/Form.KeyboardForm.js +2 -2
- package/dist/Form/Form.KeyboardToolbar.d.ts +2 -1
- package/dist/Form/Form.KeyboardToolbar.js +3 -7
- package/dist/Form/Form.PasswordInput.js +1 -1
- package/dist/Form/Form.QuantitySelector.js +1 -1
- package/dist/Form/Form.Select.d.ts +12 -8
- package/dist/Form/Form.Select.js +64 -31
- package/dist/Form/Form.Slider.d.ts +4 -7
- package/dist/Form/Form.Slider.js +11 -10
- package/dist/Form/Form.Switch.js +2 -1
- package/dist/Form/index.d.ts +6 -14
- package/dist/Form/index.js +0 -11
- package/dist/Navigation/Navigation.AppBar.d.ts +2 -1
- package/dist/Navigation/Navigation.AppBar.js +2 -2
- package/dist/Navigation/Navigation.BottomNav.d.ts +4 -8
- package/dist/Navigation/Navigation.BottomNav.js +2 -2
- package/dist/Navigation/Navigation.CollapsingHeader.js +3 -2
- package/dist/Navigation/Navigation.Menu.d.ts +16 -11
- package/dist/Navigation/Navigation.Menu.js +97 -42
- package/dist/Navigation/Navigation.Search.js +2 -2
- package/dist/Navigation/Navigation.SearchBar.js +3 -4
- package/dist/Navigation/Navigation.SegmentedControl.d.ts +7 -25
- package/dist/Navigation/Navigation.SegmentedControl.js +18 -39
- package/dist/Navigation/Navigation.Steps.js +1 -1
- package/dist/Navigation/Navigation.Tabs.d.ts +2 -1
- package/dist/Navigation/index.d.ts +0 -6
- package/dist/Navigation/index.js +0 -8
- package/dist/Typography/Typography.SelectableText.js +3 -7
- package/dist/Typography/Typography.Text.d.ts +1 -6
- package/dist/Typography/Typography.Text.js +3 -6
- package/dist/index.d.ts +1 -4
- package/dist/index.js +1 -4
- package/dist/layouts/AuthContainer.d.ts +4 -2
- package/dist/layouts/AuthContainer.js +3 -4
- package/dist/layouts/Container.d.ts +0 -4
- package/dist/layouts/Container.js +3 -4
- package/dist/layouts/ScrollContainer.d.ts +7 -3
- package/dist/layouts/ScrollContainer.js +5 -4
- package/dist/primitives/BaseButton.d.ts +2 -1
- package/dist/theme/build.js +0 -4
- package/dist/theme/css-vars.js +0 -4
- package/dist/theme/dark.js +2 -6
- package/dist/theme/default.js +1 -5
- package/dist/theme/index.d.ts +1 -1
- package/dist/theme/index.js +1 -1
- package/dist/theme/types.d.ts +0 -11
- package/dist/theme/typography.d.ts +8 -7
- package/dist/theme/typography.js +25 -4
- package/dist/utils/timezone.d.ts +0 -5
- package/dist/views/AuthFormView.d.ts +3 -1
- package/dist/views/AuthFormView.js +2 -2
- package/dist/views/FormViewV2.d.ts +6 -13
- package/dist/views/FormViewV2.js +29 -25
- package/dist/views/ListViewV2.context.d.ts +5 -5
- package/dist/views/ListViewV2.d.ts +23 -18
- package/dist/views/ListViewV2.js +45 -48
- package/dist/views/types/IListView.d.ts +5 -4
- package/dist/views/types/IListView.js +18 -15
- package/dist/widgets/CollectionOptions.d.ts +2 -2
- package/dist/widgets/CollectionOptions.js +92 -65
- package/dist/widgets/FilterBar.js +1 -1
- package/dist/widgets/PromoModal.js +10 -4
- package/dist/widgets/QuickActions.d.ts +2 -7
- package/dist/widgets/QuickActions.js +1 -1
- package/dist/widgets/ReorderableList.js +3 -3
- package/dist/widgets/TimeZoneSelectorModal.d.ts +1 -6
- package/dist/widgets/TimeZoneSelectorModal.js +17 -12
- package/dist/widgets/index.d.ts +0 -11
- package/dist/widgets/index.js +0 -7
- package/package.json +35 -38
- package/tailwind.preset.js +0 -4
- package/dist/Dialog/BottomSheet/BottomSheet.Root.d.ts +0 -324
- package/dist/Dialog/BottomSheet/BottomSheet.Root.js +0 -373
- package/dist/Dialog/BottomSheet/index.d.ts +0 -1
- package/dist/Dialog/BottomSheet/index.js +0 -1
- package/dist/Dialog/Dialog.NativeSheet.d.ts +0 -10
- package/dist/Dialog/Dialog.NativeSheet.js +0 -21
- package/dist/Form/Form.Button.d.ts +0 -3
- package/dist/Form/Form.Button.js +0 -1
- package/dist/Form/Form.FAB.d.ts +0 -3
- package/dist/Form/Form.FAB.js +0 -1
- package/dist/Form/Form.FilterButton.d.ts +0 -3
- package/dist/Form/Form.FilterButton.js +0 -1
- package/dist/Form/Form.IconButton.d.ts +0 -3
- package/dist/Form/Form.IconButton.js +0 -1
- package/dist/Form/Form.SearchBar.d.ts +0 -13
- package/dist/Form/Form.SearchBar.js +0 -26
- package/dist/Navigation/Navigation.Header.d.ts +0 -16
- package/dist/Navigation/Navigation.Header.js +0 -17
- package/dist/Navigation/Navigation.HeaderToolbar.d.ts +0 -15
- package/dist/Navigation/Navigation.HeaderToolbar.js +0 -18
- package/dist/Navigation/Navigation.TabIcon.d.ts +0 -18
- package/dist/Navigation/Navigation.TabIcon.js +0 -12
- package/dist/Navigation/Navigation.TabItem.d.ts +0 -19
- package/dist/Navigation/Navigation.TabItem.js +0 -13
- package/dist/icons/OdooIcon.d.ts +0 -11
- package/dist/icons/OdooIcon.js +0 -11
- package/dist/icons/PrinterIcon.d.ts +0 -9
- package/dist/icons/PrinterIcon.js +0 -9
- package/dist/layouts/TabNavigatorLayout.d.ts +0 -26
- package/dist/layouts/TabNavigatorLayout.js +0 -60
- package/dist/utils/icon.d.ts +0 -1
- package/dist/utils/icon.js +0 -1
- package/dist/widgets/CircleButton.d.ts +0 -3
- package/dist/widgets/CircleButton.js +0 -1
- package/dist/widgets/GeoPermissionCard.d.ts +0 -13
- package/dist/widgets/GeoPermissionCard.js +0 -24
- package/dist/widgets/HomeHeader.d.ts +0 -15
- package/dist/widgets/HomeHeader.js +0 -13
- package/dist/widgets/MenuCard.d.ts +0 -3
- package/dist/widgets/MenuCard.js +0 -1
- package/dist/widgets/MenuGrid.d.ts +0 -5
- package/dist/widgets/MenuGrid.js +0 -1
- package/dist/widgets/MenuSection.d.ts +0 -3
- package/dist/widgets/MenuSection.js +0 -1
- package/dist/widgets/ScreenHeader.d.ts +0 -25
- package/dist/widgets/ScreenHeader.js +0 -32
- package/dist/widgets/TimeZoneSelector.d.ts +0 -12
- package/dist/widgets/TimeZoneSelector.js +0 -24
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { CustomIconProps } from "./props.js";
|
|
2
|
-
import React from "react";
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated Device-coupled (printer hardware); relocated to the core. Import from
|
|
5
|
-
* `@sincpro/mobile/ui/components/atoms` instead. Kept here for backwards compatibility
|
|
6
|
-
* and removed in the next major.
|
|
7
|
-
*/
|
|
8
|
-
declare const PrinterIcon: React.FC<CustomIconProps>;
|
|
9
|
-
export default PrinterIcon;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
-
import Svg, { Path, Rect } from "react-native-svg";
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated Device-coupled (printer hardware); relocated to the core. Import from
|
|
5
|
-
* `@sincpro/mobile/ui/components/atoms` instead. Kept here for backwards compatibility
|
|
6
|
-
* and removed in the next major.
|
|
7
|
-
*/
|
|
8
|
-
const PrinterIcon = ({ size = 24, color = "#000000" }) => (_jsxs(Svg, { fill: "none", height: size, viewBox: "0 0 24 24", width: size, children: [_jsx(Path, { d: "M6 9V2H18V9", stroke: color, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2" }), _jsx(Rect, { height: "8", rx: "1", stroke: color, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", width: "16", x: "4", y: "9" }), _jsx(Path, { d: "M6 18H4C3.44772 18 3 17.5523 3 17V10C3 9.44772 3.44772 9 4 9H20C20.5523 9 21 9.44772 21 10V17C21 17.5523 20.5523 18 20 18H18", stroke: color, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2" }), _jsx(Rect, { height: "6", stroke: color, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", width: "12", x: "6", y: "14" })] }));
|
|
9
|
-
export default PrinterIcon;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React, { ReactElement, ReactNode } from "react";
|
|
2
|
-
interface TabNavigatorLayoutProps {
|
|
3
|
-
className?: string;
|
|
4
|
-
children?: ReactNode;
|
|
5
|
-
content?: ReactNode;
|
|
6
|
-
currentPath?: string;
|
|
7
|
-
onTabPress?: (path: string) => void;
|
|
8
|
-
persistentComponent?: ReactNode;
|
|
9
|
-
persistentRoutePath?: string;
|
|
10
|
-
}
|
|
11
|
-
export interface TabProps {
|
|
12
|
-
path: string;
|
|
13
|
-
label: string;
|
|
14
|
-
Icon: any;
|
|
15
|
-
onReselect?: () => void;
|
|
16
|
-
}
|
|
17
|
-
declare function Tabs({ children: tabsChildren }: {
|
|
18
|
-
children?: ReactNode;
|
|
19
|
-
}): React.JSX.Element;
|
|
20
|
-
declare function Tab(_props: TabProps): null;
|
|
21
|
-
type TabLayoutComponent = ((props: TabNavigatorLayoutProps) => ReactElement) & {
|
|
22
|
-
Tabs: typeof Tabs;
|
|
23
|
-
Tab: typeof Tab;
|
|
24
|
-
};
|
|
25
|
-
declare const TabNavigatorLayout: TabLayoutComponent;
|
|
26
|
-
export default TabNavigatorLayout;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "nativewind/jsx-runtime";
|
|
2
|
-
import DisplayIcon from "../Display/Display.Icon.js";
|
|
3
|
-
import Container from "./Container.js";
|
|
4
|
-
import { Typography } from "../Typography/index.js";
|
|
5
|
-
import { Children, isValidElement } from "react";
|
|
6
|
-
import { TouchableOpacity, View } from "react-native";
|
|
7
|
-
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
8
|
-
function TabIcon({ focused, Icon }) {
|
|
9
|
-
return (_jsxs(View, { className: "justify-center items-center w-10 h-10", children: [focused && _jsx(View, { className: "absolute w-10 h-10 rounded-full bg-primary" }), _jsx(DisplayIcon, { color: focused ? "#FFFFFF" : "#6B7280", customIcon: Icon, size: 24, type: "custom" })] }));
|
|
10
|
-
}
|
|
11
|
-
function TabNavigator({ items, currentPath, onTabPress, }) {
|
|
12
|
-
const insets = useSafeAreaInsets();
|
|
13
|
-
const Text = Typography.Text;
|
|
14
|
-
if (!items.length)
|
|
15
|
-
return null;
|
|
16
|
-
return (_jsx(View, { className: "border-t border-border-default bg-bg-card", style: { paddingBottom: Math.max(insets.bottom, 8) }, children: _jsx(View, { className: "mt-2 h-16 flex-row justify-around items-center px-2", children: items.map(({ path, label, Icon, onReselect }) => {
|
|
17
|
-
const focused = currentPath === path;
|
|
18
|
-
return (_jsxs(TouchableOpacity, { className: "items-center justify-center flex-1", onPress: () => {
|
|
19
|
-
if (focused && onReselect) {
|
|
20
|
-
onReselect();
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
onTabPress?.(path);
|
|
24
|
-
}, children: [_jsx(TabIcon, { focused: focused, Icon: Icon }), _jsx(Text, { className: `text-xs mt-1.5 font-medium ${focused ? "text-text-accent" : "text-text-secondary"}`, children: label })] }, path));
|
|
25
|
-
}) }) }));
|
|
26
|
-
}
|
|
27
|
-
function Tabs({ children: tabsChildren }) {
|
|
28
|
-
return _jsx(_Fragment, { children: tabsChildren });
|
|
29
|
-
}
|
|
30
|
-
function Tab(_props) {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* @deprecated Use `Navigation.BottomNav` (flat, modern) for the bar, and the core's
|
|
35
|
-
* router-aware layouts. Kept for backwards compatibility.
|
|
36
|
-
*/
|
|
37
|
-
function TabNavigatorLayoutComponent({ className, children, content, currentPath, onTabPress, persistentComponent, persistentRoutePath, }) {
|
|
38
|
-
const tabs = [];
|
|
39
|
-
Children.forEach(children, (child) => {
|
|
40
|
-
if (!isValidElement(child))
|
|
41
|
-
return;
|
|
42
|
-
if (child.type === Tabs) {
|
|
43
|
-
const tabsChildren = child.props.children;
|
|
44
|
-
Children.forEach(tabsChildren, (tabChild) => {
|
|
45
|
-
if (!isValidElement(tabChild))
|
|
46
|
-
return;
|
|
47
|
-
if (tabChild.type === Tab) {
|
|
48
|
-
tabs.push(tabChild.props);
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
const isPersistentRouteActive = persistentRoutePath && currentPath ? currentPath.includes(persistentRoutePath) : false;
|
|
54
|
-
return (_jsxs(Container, { className: className, edges: ["top", "left", "right"], children: [_jsxs(View, { className: "flex-1 bg-bg-page", children: [persistentComponent && (_jsx(View, { style: { flex: 1, display: isPersistentRouteActive ? "flex" : "none" }, children: persistentComponent })), _jsx(View, { style: { flex: 1, display: isPersistentRouteActive ? "none" : "flex" }, children: content })] }), _jsx(TabNavigator, { currentPath: currentPath, items: tabs, onTabPress: onTabPress })] }));
|
|
55
|
-
}
|
|
56
|
-
const TabNavigatorLayout = Object.assign(TabNavigatorLayoutComponent, {
|
|
57
|
-
Tabs,
|
|
58
|
-
Tab,
|
|
59
|
-
});
|
|
60
|
-
export default TabNavigatorLayout;
|
package/dist/utils/icon.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type IconType = "ionicons" | "fontawesome" | "material" | "fontawesome5" | "simplelineicons" | "antdesign" | "custom" | "feather" | "MaterialCommunityIcons";
|
package/dist/utils/icon.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { CircleButton } from "../Display/Display.CircleButton.js";
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
interface GeoPermissionCardProps {
|
|
2
|
-
title: string;
|
|
3
|
-
hasPermission?: boolean;
|
|
4
|
-
loading?: boolean;
|
|
5
|
-
handleRequestPermission?: () => void;
|
|
6
|
-
}
|
|
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;
|
|
13
|
-
export default GeoPermissionCard;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
-
import { Display, Form } from "../index.js";
|
|
3
|
-
import { theme } from "../theme/index.js";
|
|
4
|
-
import { Typography } from "../Typography/index.js";
|
|
5
|
-
import { View } from "react-native";
|
|
6
|
-
import { tv } from "tailwind-variants";
|
|
7
|
-
const statusTextVariants = tv({
|
|
8
|
-
variants: {
|
|
9
|
-
granted: {
|
|
10
|
-
true: "text-success",
|
|
11
|
-
false: "text-danger",
|
|
12
|
-
},
|
|
13
|
-
},
|
|
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
|
-
*/
|
|
20
|
-
function GeoPermissionCard({ title, loading, handleRequestPermission, hasPermission, }) {
|
|
21
|
-
const granted = hasPermission !== undefined ? hasPermission : false;
|
|
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" }))] })] }) }));
|
|
23
|
-
}
|
|
24
|
-
export default GeoPermissionCard;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { ImageSource } from "../utils/image.js";
|
|
2
|
-
import React, { ReactNode } from "react";
|
|
3
|
-
interface HomeHeaderProps {
|
|
4
|
-
readonly title?: string;
|
|
5
|
-
readonly logo?: ReactNode;
|
|
6
|
-
readonly logoSource?: ImageSource;
|
|
7
|
-
readonly backButton?: boolean;
|
|
8
|
-
readonly onBack?: () => void;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated Legacy style (gradient). For new top bars use `Navigation.AppBar`.
|
|
12
|
-
* Kept for backwards compatibility.
|
|
13
|
-
*/
|
|
14
|
-
export declare const HomeHeader: React.FC<HomeHeaderProps>;
|
|
15
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
-
import { Display, Typography } from "../index.js";
|
|
3
|
-
import GradientContainer from "../layouts/GradientContainer.js";
|
|
4
|
-
import { theme } from "../theme/index.js";
|
|
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
|
-
*/
|
|
10
|
-
export const HomeHeader = ({ title = "Distribución", logo, logoSource, backButton = false, onBack, }) => {
|
|
11
|
-
const handleBackPress = onBack ?? (() => { });
|
|
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 }))] })] }) }));
|
|
13
|
-
};
|
package/dist/widgets/MenuCard.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { MenuCard } from "../Display/Display.MenuCard.js";
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/** @deprecated Import from `@sincpro/mobile-ui/Display` → `Display.MenuGrid` instead. */
|
|
2
|
-
export type { MenuGridItem, MenuGridProps, } from "../Display/Display.MenuGrid.js";
|
|
3
|
-
export { MenuGrid } from "../Display/Display.MenuGrid.js";
|
|
4
|
-
/** @deprecated Renamed to `MenuGridItem`. */
|
|
5
|
-
export type { MenuGridItem as MenuItem } from "../Display/Display.MenuGrid.js";
|
package/dist/widgets/MenuGrid.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { MenuGrid } from "../Display/Display.MenuGrid.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { MenuSection } from "../Navigation/Navigation.MenuSection.js";
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { ImageSource } from "../utils/image.js";
|
|
2
|
-
export declare enum EVariantScreenHeader {
|
|
3
|
-
FLAT_HEADER = "FLAT_HEADER",
|
|
4
|
-
ROUNDED_HEADER = "ROUNDED_HEADER",
|
|
5
|
-
LOGO_WITH_BACK_BUTTON = "LOGO_WITH_BACK_BUTTON",
|
|
6
|
-
ONLY_LOGO = "ONLY_LOGO"
|
|
7
|
-
}
|
|
8
|
-
interface ScreenHeaderProps {
|
|
9
|
-
variant?: EVariantScreenHeader;
|
|
10
|
-
title?: string;
|
|
11
|
-
centerTitle?: boolean;
|
|
12
|
-
subtitle?: string;
|
|
13
|
-
logo?: boolean;
|
|
14
|
-
logoSource?: ImageSource;
|
|
15
|
-
rightComponent?: React.ReactNode;
|
|
16
|
-
children?: React.ReactNode;
|
|
17
|
-
withGradientContainer?: boolean;
|
|
18
|
-
onBack?: () => void;
|
|
19
|
-
}
|
|
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;
|
|
25
|
-
export default ScreenHeader;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
-
import GradientContainer from "../layouts/GradientContainer.js";
|
|
3
|
-
import { Navigation } from "../Navigation/index.js";
|
|
4
|
-
import { View } from "react-native";
|
|
5
|
-
const Header = Navigation.Header;
|
|
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 = {}));
|
|
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
|
-
*/
|
|
18
|
-
function ScreenHeader({ variant, title = "Distribución", subtitle, logoSource, onBack, children, }) {
|
|
19
|
-
switch (variant) {
|
|
20
|
-
case EVariantScreenHeader.FLAT_HEADER:
|
|
21
|
-
return (_jsxs(_Fragment, { children: [_jsx(HeaderToolbar, { flat: true, onBack: onBack, subtitle: subtitle, title: title, withBackground: true }), _jsx(View, { children: children })] }));
|
|
22
|
-
case EVariantScreenHeader.ROUNDED_HEADER:
|
|
23
|
-
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 }) }));
|
|
24
|
-
case EVariantScreenHeader.LOGO_WITH_BACK_BUTTON:
|
|
25
|
-
return (_jsx(Header, { backButton: true, handleBackButton: onBack, logoSource: logoSource, title: "" }));
|
|
26
|
-
case EVariantScreenHeader.ONLY_LOGO:
|
|
27
|
-
return _jsx(Header, { logoSource: logoSource, title: title });
|
|
28
|
-
default:
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
export default ScreenHeader;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { TimezoneLocale } from "../utils/timezone.js";
|
|
2
|
-
interface TimeZoneSelectorProps {
|
|
3
|
-
onSelect?: (tz: TimezoneLocale) => void;
|
|
4
|
-
timezone?: string | null;
|
|
5
|
-
}
|
|
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;
|
|
12
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "nativewind/jsx-runtime";
|
|
2
|
-
import { Display, Form } from "../index.js";
|
|
3
|
-
import { theme } from "../theme/useTheme.js";
|
|
4
|
-
import { Typography } from "../Typography/index.js";
|
|
5
|
-
import { TimeZoneSelectorModal } from "./TimeZoneSelectorModal.js";
|
|
6
|
-
import { useState } from "react";
|
|
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
|
-
*/
|
|
13
|
-
export function TimeZoneSelector({ onSelect, timezone }) {
|
|
14
|
-
const [currentTimezone, setCurrentTimezone] = useState(timezone);
|
|
15
|
-
const [selectorVisible, setSelectorVisible] = useState(false);
|
|
16
|
-
function handleTimezoneSelected(tz) {
|
|
17
|
-
setCurrentTimezone(tz.timezone);
|
|
18
|
-
onSelect?.(tz);
|
|
19
|
-
}
|
|
20
|
-
const displayTimezone = currentTimezone
|
|
21
|
-
? currentTimezone.replace(/_/g, " ").replace("America/", "")
|
|
22
|
-
: "No configurada";
|
|
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 })] }));
|
|
24
|
-
}
|