@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
|
@@ -5,5 +5,5 @@ interface ControlledCheckboxProps<T extends FieldValues> {
|
|
|
5
5
|
label: string;
|
|
6
6
|
subText?: string;
|
|
7
7
|
}
|
|
8
|
-
declare function ControlledCheckbox<T extends FieldValues>({ control, name, label, subText, }: ControlledCheckboxProps<T>): import("react
|
|
8
|
+
declare function ControlledCheckbox<T extends FieldValues>({ control, name, label, subText, }: ControlledCheckboxProps<T>): import("react").JSX.Element;
|
|
9
9
|
export default ControlledCheckbox;
|
|
@@ -11,5 +11,5 @@ interface ControlledInputProps<T extends FieldValues> {
|
|
|
11
11
|
rules?: any;
|
|
12
12
|
error?: string;
|
|
13
13
|
}
|
|
14
|
-
declare function ControlledInput<T extends FieldValues>({ control, name, label, placeholder, keyboardType, autoCapitalize, multiline, numberOfLines, rules, error, }: ControlledInputProps<T>): import("react
|
|
14
|
+
declare function ControlledInput<T extends FieldValues>({ control, name, label, placeholder, keyboardType, autoCapitalize, multiline, numberOfLines, rules, error, }: ControlledInputProps<T>): import("react").JSX.Element;
|
|
15
15
|
export default ControlledInput;
|
|
@@ -8,5 +8,5 @@ interface ControlledMonetaryInputProps<T extends FieldValues> {
|
|
|
8
8
|
rules?: any;
|
|
9
9
|
error?: string;
|
|
10
10
|
}
|
|
11
|
-
declare function ControlledMonetaryInput<T extends FieldValues>({ control, name, label, placeholder, currency, rules, error, }: ControlledMonetaryInputProps<T>): import("react
|
|
11
|
+
declare function ControlledMonetaryInput<T extends FieldValues>({ control, name, label, placeholder, currency, rules, error, }: ControlledMonetaryInputProps<T>): import("react").JSX.Element;
|
|
12
12
|
export default ControlledMonetaryInput;
|
|
@@ -5,5 +5,5 @@ interface ControlledRadioButtonProps<T extends FieldValues> {
|
|
|
5
5
|
label: string;
|
|
6
6
|
value: any;
|
|
7
7
|
}
|
|
8
|
-
declare function ControlledRadioButton<T extends FieldValues>({ control, name, label, value, }: ControlledRadioButtonProps<T>): import("react
|
|
8
|
+
declare function ControlledRadioButton<T extends FieldValues>({ control, name, label, value, }: ControlledRadioButtonProps<T>): import("react").JSX.Element;
|
|
9
9
|
export default ControlledRadioButton;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface DatePickerProps {
|
|
2
|
+
value: Date | null;
|
|
3
|
+
onChange: (value: Date) => void;
|
|
4
|
+
mode?: "date" | "time" | "datetime";
|
|
5
|
+
label?: string;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
format?: (value: Date) => string;
|
|
8
|
+
minimumDate?: Date;
|
|
9
|
+
maximumDate?: Date;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
testID?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* **Hybrid** date/time field: tokenized trigger (NativeWind) + **native picker**
|
|
16
|
+
* (`@react-native-community/datetimepicker`) — a case where native wins (expected UX).
|
|
17
|
+
* Subpath `Form/DatePicker`; **optional** peer dep.
|
|
18
|
+
*/
|
|
19
|
+
declare function DatePicker({ value, onChange, mode, label, placeholder, format, minimumDate, maximumDate, disabled, className, testID, }: DatePickerProps): import("react").JSX.Element;
|
|
20
|
+
export default DatePicker;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
+
import DateTimePicker from "@react-native-community/datetimepicker";
|
|
3
|
+
import Icon from "../Display/Display.Icon";
|
|
4
|
+
import Pressable from "../primitives/Pressable";
|
|
5
|
+
import { theme } from "../theme";
|
|
6
|
+
import { cn } from "../theme/tw";
|
|
7
|
+
import { Typography } from "../Typography";
|
|
8
|
+
import { useState } from "react";
|
|
9
|
+
import { Platform, View } from "react-native";
|
|
10
|
+
function defaultFormat(value, mode) {
|
|
11
|
+
if (mode === "time")
|
|
12
|
+
return value.toLocaleTimeString("es-BO", { hour: "2-digit", minute: "2-digit" });
|
|
13
|
+
if (mode === "datetime")
|
|
14
|
+
return value.toLocaleString("es-BO");
|
|
15
|
+
return value.toLocaleDateString("es-BO");
|
|
16
|
+
}
|
|
17
|
+
const iconByMode = {
|
|
18
|
+
date: "calendar-outline",
|
|
19
|
+
time: "time-outline",
|
|
20
|
+
datetime: "calendar-outline",
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* **Hybrid** date/time field: tokenized trigger (NativeWind) + **native picker**
|
|
24
|
+
* (`@react-native-community/datetimepicker`) — a case where native wins (expected UX).
|
|
25
|
+
* Subpath `Form/DatePicker`; **optional** peer dep.
|
|
26
|
+
*/
|
|
27
|
+
function DatePicker({ value, onChange, mode = "date", label, placeholder = "Seleccionar…", format, minimumDate, maximumDate, disabled = false, className, testID, }) {
|
|
28
|
+
const [open, setOpen] = useState(false);
|
|
29
|
+
const fmt = format ?? ((d) => defaultFormat(d, mode));
|
|
30
|
+
const handleValueChange = (_event, date) => {
|
|
31
|
+
if (Platform.OS === "android")
|
|
32
|
+
setOpen(false);
|
|
33
|
+
if (date)
|
|
34
|
+
onChange(date);
|
|
35
|
+
};
|
|
36
|
+
return (_jsxs(View, { className: cn("gap-1", className), testID: testID, children: [label ? (_jsx(Typography.Text, { className: "font-medium text-text-primary", variant: "bodySmall", children: label })) : null, _jsxs(Pressable, { accessibilityHint: "Abre el selector de fecha", accessibilityLabel: label ?? placeholder, accessibilityRole: "button", accessibilityState: { disabled }, className: "flex-row items-center justify-between rounded-lg border border-input bg-bg-card px-3 min-h-[44px]", disabled: disabled, onPress: () => setOpen(true), children: [_jsx(Typography.Text, { className: cn("flex-1 text-sm", value ? "text-text-primary" : "text-text-tertiary"), children: value ? fmt(value) : placeholder }), _jsx(Icon, { color: theme.icon.secondary, name: iconByMode[mode], size: 18 })] }), open ? (_jsx(DateTimePicker, { maximumDate: maximumDate, minimumDate: minimumDate, mode: mode === "datetime" ? "date" : mode, onDismiss: () => setOpen(false), onValueChange: handleValueChange, value: value ?? new Date() })) : null] }));
|
|
37
|
+
}
|
|
38
|
+
export default DatePicker;
|
|
@@ -10,5 +10,5 @@ interface DropdownButtonProps {
|
|
|
10
10
|
variant?: "primary" | "secondary" | "outline";
|
|
11
11
|
size?: "xs" | "small" | "medium" | "large";
|
|
12
12
|
}
|
|
13
|
-
declare function DropdownButton({ title, options, variant, size, }: DropdownButtonProps): import("react
|
|
13
|
+
declare function DropdownButton({ title, options, variant, size, }: DropdownButtonProps): import("react").JSX.Element;
|
|
14
14
|
export default DropdownButton;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface FABProps {
|
|
2
|
+
icon: string;
|
|
3
|
+
onPress: () => void;
|
|
4
|
+
label?: string;
|
|
5
|
+
position?: "bottom-right" | "bottom-left";
|
|
6
|
+
className?: string;
|
|
7
|
+
testID?: string;
|
|
8
|
+
}
|
|
9
|
+
declare function FAB({ icon, onPress, label, position, className, testID, }: FABProps): import("react").JSX.Element;
|
|
10
|
+
export default FAB;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
+
import Icon from "../Display/Display.Icon";
|
|
3
|
+
import Pressable from "../primitives/Pressable";
|
|
4
|
+
import { theme } from "../theme";
|
|
5
|
+
import { cn } from "../theme/tw";
|
|
6
|
+
import { Typography } from "../Typography";
|
|
7
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
8
|
+
function FAB({ icon, onPress, label, position = "bottom-right", className, testID, }) {
|
|
9
|
+
const insets = useSafeAreaInsets();
|
|
10
|
+
return (_jsxs(Pressable, { accessibilityLabel: label ?? "Acción", accessibilityRole: "button", className: cn("absolute flex-row items-center justify-center rounded-full bg-primary", label ? "h-14 px-5 gap-2" : "w-14 h-14", className), onPress: onPress, style: {
|
|
11
|
+
bottom: insets.bottom + 16,
|
|
12
|
+
right: position === "bottom-right" ? 16 : undefined,
|
|
13
|
+
left: position === "bottom-left" ? 16 : undefined,
|
|
14
|
+
...theme.shadow.lg,
|
|
15
|
+
}, testID: testID, children: [_jsx(Icon, { color: theme.icon.inverse, name: icon, size: 24 }), label ? (_jsx(Typography.Text, { className: "text-text-on-primary font-semibold", children: label })) : null] }));
|
|
16
|
+
}
|
|
17
|
+
export default FAB;
|
|
@@ -8,5 +8,5 @@ export declare const FilterButton: FC<FilterButtonProps>;
|
|
|
8
8
|
interface FilterButtonGroupProps {
|
|
9
9
|
children: React.ReactNode;
|
|
10
10
|
}
|
|
11
|
-
export declare function FilterButtonGroup({ children }: FilterButtonGroupProps): import("react
|
|
11
|
+
export declare function FilterButtonGroup({ children }: FilterButtonGroupProps): import("react").JSX.Element;
|
|
12
12
|
export {};
|
|
@@ -9,5 +9,5 @@ interface FractionalQuantityInputProps {
|
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
quickAddIncrements?: number[];
|
|
11
11
|
}
|
|
12
|
-
declare function FractionalQuantityInput({ value, onChange, precision, minIncrement, maxValue, style, disabled, quickAddIncrements, }: FractionalQuantityInputProps): import("react
|
|
12
|
+
declare function FractionalQuantityInput({ value, onChange, precision, minIncrement, maxValue, style, disabled, quickAddIncrements, }: FractionalQuantityInputProps): import("react").JSX.Element;
|
|
13
13
|
export default FractionalQuantityInput;
|
|
@@ -63,5 +63,5 @@ interface IconButtonProps extends VariantProps<typeof iconButton> {
|
|
|
63
63
|
iconColor?: string;
|
|
64
64
|
className?: string;
|
|
65
65
|
}
|
|
66
|
-
declare function IconButton({ icon, type, onPress, variant, size, loading, disabled, rounded, iconColor, className, }: IconButtonProps): import("react
|
|
66
|
+
declare function IconButton({ icon, type, onPress, variant, size, loading, disabled, rounded, iconColor, className, }: IconButtonProps): import("react").JSX.Element;
|
|
67
67
|
export default IconButton;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type React from "react";
|
|
1
2
|
import { type TextInputProps } from "react-native";
|
|
2
3
|
interface FormInputProps extends TextInputProps {
|
|
3
4
|
label: string;
|
|
@@ -5,5 +6,5 @@ interface FormInputProps extends TextInputProps {
|
|
|
5
6
|
tooltip?: string;
|
|
6
7
|
className?: string;
|
|
7
8
|
}
|
|
8
|
-
declare function FormInput({ label, error, tooltip, style, multiline, numberOfLines, onFocus, onBlur, className, ...props }: FormInputProps):
|
|
9
|
+
declare function FormInput({ label, error, tooltip, style, multiline, numberOfLines, onFocus, onBlur, className, ...props }: FormInputProps): React.JSX.Element;
|
|
9
10
|
export default FormInput;
|
package/dist/Form/Form.Input.js
CHANGED
|
@@ -4,5 +4,5 @@ interface MonetaryInputProps {
|
|
|
4
4
|
currencySymbol?: string;
|
|
5
5
|
placeholder?: string;
|
|
6
6
|
}
|
|
7
|
-
declare function MonetaryInput({ amount, onChange, currencySymbol, placeholder, }: MonetaryInputProps): import("react
|
|
7
|
+
declare function MonetaryInput({ amount, onChange, currencySymbol, placeholder, }: MonetaryInputProps): import("react").JSX.Element;
|
|
8
8
|
export default MonetaryInput;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface PinInputProps {
|
|
2
|
+
value: string;
|
|
3
|
+
onChange: (value: string) => void;
|
|
4
|
+
length?: number;
|
|
5
|
+
secure?: boolean;
|
|
6
|
+
autoFocus?: boolean;
|
|
7
|
+
onComplete?: (value: string) => void;
|
|
8
|
+
className?: string;
|
|
9
|
+
testID?: string;
|
|
10
|
+
}
|
|
11
|
+
declare function PinInput({ value, onChange, length, secure, autoFocus, onComplete, className, testID, }: PinInputProps): import("react").JSX.Element;
|
|
12
|
+
export default PinInput;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
+
import Pressable from "../primitives/Pressable";
|
|
3
|
+
import { theme } from "../theme";
|
|
4
|
+
import { cn } from "../theme/tw";
|
|
5
|
+
import { Typography } from "../Typography";
|
|
6
|
+
import { useRef } from "react";
|
|
7
|
+
import { TextInput, View } from "react-native";
|
|
8
|
+
function PinInput({ value, onChange, length = 6, secure = false, autoFocus = false, onComplete, className, testID, }) {
|
|
9
|
+
const inputRef = useRef(null);
|
|
10
|
+
const chars = value.split("");
|
|
11
|
+
const handleChange = (text) => {
|
|
12
|
+
const next = text.replace(/[^0-9]/g, "").slice(0, length);
|
|
13
|
+
onChange(next);
|
|
14
|
+
if (next.length === length)
|
|
15
|
+
onComplete?.(next);
|
|
16
|
+
};
|
|
17
|
+
return (_jsxs(Pressable, { accessibilityLabel: "C\u00F3digo de verificaci\u00F3n", className: cn("flex-row gap-2", className), onPress: () => inputRef.current?.focus(), testID: testID, children: [Array.from({ length }).map((_, index) => {
|
|
18
|
+
const filled = index < value.length;
|
|
19
|
+
const active = index === value.length;
|
|
20
|
+
return (_jsx(View, { className: "flex-1 aspect-square max-w-[52px] rounded-lg border bg-bg-card items-center justify-center", style: { borderColor: active ? theme.border.focus : theme.border.default }, children: _jsx(Typography.Text, { className: "text-text-primary", variant: "h4", children: filled ? (secure ? "•" : chars[index]) : "" }) }, index));
|
|
21
|
+
}), _jsx(TextInput, { autoFocus: autoFocus, caretHidden: true, keyboardType: "number-pad", maxLength: length, onChangeText: handleChange, ref: inputRef, style: { position: "absolute", opacity: 0, width: 1, height: 1 }, textContentType: "oneTimeCode", value: value })] }));
|
|
22
|
+
}
|
|
23
|
+
export default PinInput;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type React from "react";
|
|
1
2
|
import { StyleProp, ViewStyle } from "react-native";
|
|
2
3
|
interface QuantitySelectorProps {
|
|
3
4
|
value: number;
|
|
@@ -6,5 +7,5 @@ interface QuantitySelectorProps {
|
|
|
6
7
|
max?: number;
|
|
7
8
|
style?: StyleProp<ViewStyle>;
|
|
8
9
|
}
|
|
9
|
-
declare function QuantitySelector({ value, onChange, min, max, style, }: QuantitySelectorProps):
|
|
10
|
+
declare function QuantitySelector({ value, onChange, min, max, style, }: QuantitySelectorProps): React.JSX.Element;
|
|
10
11
|
export default QuantitySelector;
|
|
@@ -5,7 +5,7 @@ import { TouchableOpacity, View } from "react-native";
|
|
|
5
5
|
import { tv } from "tailwind-variants";
|
|
6
6
|
const quantitySelector = tv({
|
|
7
7
|
slots: {
|
|
8
|
-
container: "flex-row items-center border border-
|
|
8
|
+
container: "flex-row items-center self-start border border-accent rounded-full px-1",
|
|
9
9
|
button: "w-9 h-9 rounded-full justify-center items-center",
|
|
10
10
|
valueContainer: "min-w-[40px] items-center px-3",
|
|
11
11
|
},
|
|
@@ -3,5 +3,5 @@ interface RadioButtonProps {
|
|
|
3
3
|
selected: boolean;
|
|
4
4
|
onPress: () => void;
|
|
5
5
|
}
|
|
6
|
-
declare function RadioButton({ label, selected, onPress }: RadioButtonProps): import("react
|
|
6
|
+
declare function RadioButton({ label, selected, onPress }: RadioButtonProps): import("react").JSX.Element;
|
|
7
7
|
export default RadioButton;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
import type React from "react";
|
|
1
2
|
interface SearchBarProps {
|
|
2
3
|
value: string;
|
|
3
4
|
onChangeText: (text: string) => void;
|
|
4
5
|
placeholder?: string;
|
|
5
6
|
className?: string;
|
|
6
7
|
}
|
|
7
|
-
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use `Navigation.SearchBar` (2026 pill). Kept for backwards compatibility
|
|
10
|
+
* (consumed by `ListViewV2`).
|
|
11
|
+
*/
|
|
12
|
+
declare function SearchBar({ value, onChangeText, placeholder, className, }: SearchBarProps): React.JSX.Element;
|
|
8
13
|
export default SearchBar;
|
|
@@ -15,6 +15,10 @@ const searchBarContainer = tv({
|
|
|
15
15
|
},
|
|
16
16
|
defaultVariants: { focused: false },
|
|
17
17
|
});
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Use `Navigation.SearchBar` (2026 pill). Kept for backwards compatibility
|
|
20
|
+
* (consumed by `ListViewV2`).
|
|
21
|
+
*/
|
|
18
22
|
function SearchBar({ value, onChangeText, placeholder = "Search", className, }) {
|
|
19
23
|
const [isFocused, setIsFocused] = useState(false);
|
|
20
24
|
return (_jsxs(View, { className: cn(searchBarContainer({ focused: isFocused }), className), children: [_jsx(View, { className: "mr-1 ml-0.5 items-center justify-center h-full", children: _jsx(Icon, { className: "text-text-tertiary", name: "search", size: 18, type: "ionicons" }) }), _jsx(TextInput, { className: "flex-1 h-full text-sm py-0 px-1.5 text-text-primary", onBlur: () => setIsFocused(false), onChangeText: onChangeText, onFocus: () => setIsFocused(true), placeholder: placeholder, placeholderTextColor: theme.text.tertiary, value: value }), value.length > 0 && (_jsx(TouchableOpacity, { activeOpacity: 0.7, className: "mr-0.5 ml-1 items-center justify-center h-full px-1", onPress: () => onChangeText(""), children: _jsx(Icon, { className: "text-text-tertiary", name: "x", size: 18, type: "feather" }) }))] }));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface SelectOption<T extends string | number> {
|
|
2
|
+
label: string;
|
|
3
|
+
value: T;
|
|
4
|
+
}
|
|
5
|
+
export interface SelectProps<T extends string | number> {
|
|
6
|
+
options: SelectOption<T>[];
|
|
7
|
+
value: T | null;
|
|
8
|
+
onChange: (value: T) => void;
|
|
9
|
+
label?: string;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
title?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
testID?: string;
|
|
15
|
+
}
|
|
16
|
+
declare function Select<T extends string | number>({ options, value, onChange, label, placeholder, title, disabled, className, testID, }: SelectProps<T>): import("react").JSX.Element;
|
|
17
|
+
export default Select;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
+
import Icon from "../Display/Display.Icon";
|
|
3
|
+
import Pressable from "../primitives/Pressable";
|
|
4
|
+
import { theme } from "../theme";
|
|
5
|
+
import { cn } from "../theme/tw";
|
|
6
|
+
import { Typography } from "../Typography";
|
|
7
|
+
import { useState } from "react";
|
|
8
|
+
import { Modal, Pressable as RNPressable, ScrollView, View } from "react-native";
|
|
9
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
10
|
+
function Select({ options, value, onChange, label, placeholder = "Seleccionar…", title, disabled = false, className, testID, }) {
|
|
11
|
+
const insets = useSafeAreaInsets();
|
|
12
|
+
const [open, setOpen] = useState(false);
|
|
13
|
+
const selected = options.find((o) => o.value === value) ?? null;
|
|
14
|
+
return (_jsxs(View, { className: cn("gap-1", className), testID: testID, children: [label ? (_jsx(Typography.Text, { className: "font-medium text-text-primary", variant: "bodySmall", children: label })) : null, _jsxs(Pressable, { accessibilityHint: "Abre la lista de opciones", accessibilityLabel: label ?? placeholder, accessibilityRole: "button", accessibilityState: { disabled }, className: "flex-row items-center justify-between rounded-lg border border-input bg-bg-card px-3 min-h-[44px]", disabled: disabled, onPress: () => setOpen(true), children: [_jsx(Typography.Text, { className: cn("flex-1 text-sm", selected ? "text-text-primary" : "text-text-tertiary"), numberOfLines: 1, children: selected ? selected.label : placeholder }), _jsx(Icon, { color: theme.icon.secondary, name: "chevron-down", size: 18 })] }), _jsx(Modal, { animationType: "slide", onRequestClose: () => setOpen(false), transparent: true, visible: open, children: _jsx(RNPressable, { className: "flex-1 justify-end bg-black/50", onPress: () => setOpen(false), children: _jsxs(RNPressable, { className: "rounded-t-3xl", style: {
|
|
15
|
+
backgroundColor: theme.bg.card,
|
|
16
|
+
paddingBottom: insets.bottom + 8,
|
|
17
|
+
maxHeight: "70%",
|
|
18
|
+
}, children: [_jsx(View, { className: "items-center pt-3 pb-1", children: _jsx(View, { className: "w-10 h-1 rounded-full bg-border-strong" }) }), title ? (_jsx(Typography.Text, { className: "text-text-primary px-4 py-2", semibold: true, variant: "body", children: title })) : null, _jsx(ScrollView, { children: options.map((option) => {
|
|
19
|
+
const isSelected = option.value === value;
|
|
20
|
+
return (_jsxs(Pressable, { accessibilityRole: "menuitem", accessibilityState: { selected: isSelected }, className: "flex-row items-center justify-between px-4 py-3 border-b border-border-light", onPress: () => {
|
|
21
|
+
onChange(option.value);
|
|
22
|
+
setOpen(false);
|
|
23
|
+
}, children: [_jsx(Typography.Text, { className: cn("flex-1 text-sm", isSelected ? "text-primary font-semibold" : "text-text-primary"), children: option.label }), isSelected ? (_jsx(Icon, { color: theme.primary, name: "checkmark", size: 18 })) : null] }, String(option.value)));
|
|
24
|
+
}) })] }) }) })] }));
|
|
25
|
+
}
|
|
26
|
+
export default Select;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface SliderProps {
|
|
2
|
+
value: number;
|
|
3
|
+
onChange: (value: number) => void;
|
|
4
|
+
min?: number;
|
|
5
|
+
max?: number;
|
|
6
|
+
step?: number;
|
|
7
|
+
label?: string;
|
|
8
|
+
formatValue?: (value: number) => string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
testID?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* **Tokenized** slider (track in `primary`) on `@react-native-community/slider` — clean,
|
|
15
|
+
* on-brand, consistent across iOS/Android. (The `@expo/ui` Slider was evaluated but its
|
|
16
|
+
* Material style with ticks ignores the tokens → not a case where native wins.)
|
|
17
|
+
* Subpath `Form/Slider`; **optional** peer dep.
|
|
18
|
+
*/
|
|
19
|
+
declare function Slider({ value, onChange, min, max, step, label, formatValue, disabled, className, testID, }: SliderProps): import("react").JSX.Element;
|
|
20
|
+
export default Slider;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
+
import RNSlider from "@react-native-community/slider";
|
|
3
|
+
import { theme } from "../theme";
|
|
4
|
+
import { cn } from "../theme/tw";
|
|
5
|
+
import { Typography } from "../Typography";
|
|
6
|
+
import { View } from "react-native";
|
|
7
|
+
/**
|
|
8
|
+
* **Tokenized** slider (track in `primary`) on `@react-native-community/slider` — clean,
|
|
9
|
+
* on-brand, consistent across iOS/Android. (The `@expo/ui` Slider was evaluated but its
|
|
10
|
+
* Material style with ticks ignores the tokens → not a case where native wins.)
|
|
11
|
+
* Subpath `Form/Slider`; **optional** peer dep.
|
|
12
|
+
*/
|
|
13
|
+
function Slider({ value, onChange, min = 0, max = 100, step = 1, label, formatValue, disabled = false, className, testID, }) {
|
|
14
|
+
return (_jsxs(View, { className: cn("gap-1", className), testID: testID, children: [label || formatValue ? (_jsxs(View, { className: "flex-row items-center justify-between", children: [label ? (_jsx(Typography.Text, { className: "font-medium text-text-primary", variant: "bodySmall", children: label })) : null, formatValue ? (_jsx(Typography.Text, { className: "text-text-secondary", variant: "bodySmall", children: formatValue(value) })) : null] })) : null, _jsx(RNSlider, { disabled: disabled, maximumTrackTintColor: theme.bg.muted, maximumValue: max, minimumTrackTintColor: theme.primary, minimumValue: min, onValueChange: onChange, step: step, thumbTintColor: theme.primary, value: value })] }));
|
|
15
|
+
}
|
|
16
|
+
export default Slider;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface SwitchProps {
|
|
2
|
+
value: boolean;
|
|
3
|
+
onValueChange: (value: boolean) => void;
|
|
4
|
+
label?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
className?: string;
|
|
7
|
+
testID?: string;
|
|
8
|
+
}
|
|
9
|
+
declare function Switch({ value, onValueChange, label, disabled, className, testID, }: SwitchProps): import("react").JSX.Element;
|
|
10
|
+
export default Switch;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
+
import { theme } from "../theme";
|
|
3
|
+
import { cn } from "../theme/tw";
|
|
4
|
+
import { Typography } from "../Typography";
|
|
5
|
+
import { Switch as RNSwitch, View } from "react-native";
|
|
6
|
+
function Switch({ value, onValueChange, label, disabled = false, className, testID, }) {
|
|
7
|
+
return (_jsxs(View, { className: cn("flex-row items-center justify-between gap-3", className), children: [label ? (_jsx(Typography.Text, { className: cn("flex-1 text-text-primary", disabled && "text-text-disabled"), children: label })) : null, _jsx(RNSwitch, { accessibilityLabel: label, accessibilityRole: "switch", accessibilityState: { checked: value, disabled }, disabled: disabled, ios_backgroundColor: theme.bg.muted, onValueChange: onValueChange, testID: testID, thumbColor: theme.bg.card, trackColor: { false: theme.bg.muted, true: theme.accent }, value: value })] }));
|
|
8
|
+
}
|
|
9
|
+
export default Switch;
|
package/dist/Form/index.d.ts
CHANGED
|
@@ -4,15 +4,21 @@ import ControlledDropdown, { type DropdownOption } from "../Form/Form.Controlled
|
|
|
4
4
|
import ControlledInput from "../Form/Form.ControlledInput";
|
|
5
5
|
import ControlledMonetaryInput from "../Form/Form.ControlledMonetaryInput";
|
|
6
6
|
import ControlledRadioButton from "../Form/Form.ControlledRadioButton";
|
|
7
|
+
import DatePicker from "../Form/Form.DatePicker";
|
|
7
8
|
import Dropdown from "../Form/Form.Dropdown";
|
|
9
|
+
import FAB from "../Form/Form.FAB";
|
|
8
10
|
import { FilterButtonGroup } from "../Form/Form.FilterButton";
|
|
9
11
|
import FractionalQuantityInput from "../Form/Form.FractionalQuantityInput";
|
|
10
12
|
import IconButton from "../Form/Form.IconButton";
|
|
11
13
|
import Input from "../Form/Form.Input";
|
|
12
14
|
import MonetaryInput from "../Form/Form.MonetaryInput";
|
|
15
|
+
import PinInput from "../Form/Form.PinInput";
|
|
13
16
|
import QuantitySelector from "../Form/Form.QuantitySelector";
|
|
14
17
|
import RadioButton from "../Form/Form.RadioButton";
|
|
15
18
|
import SearchBar from "../Form/Form.SearchBar";
|
|
19
|
+
import Select from "../Form/Form.Select";
|
|
20
|
+
import Slider from "../Form/Form.Slider";
|
|
21
|
+
import Switch from "../Form/Form.Switch";
|
|
16
22
|
export declare const Form: {
|
|
17
23
|
TextInput: import("react").FC<import("../Form/Form.TextInput").TextInputFProps>;
|
|
18
24
|
Input: typeof Input;
|
|
@@ -26,6 +32,12 @@ export declare const Form: {
|
|
|
26
32
|
FractionalQuantityInput: typeof FractionalQuantityInput;
|
|
27
33
|
RadioButton: typeof RadioButton;
|
|
28
34
|
Checkbox: typeof Checkbox;
|
|
35
|
+
Switch: typeof Switch;
|
|
36
|
+
Select: typeof Select;
|
|
37
|
+
PinInput: typeof PinInput;
|
|
38
|
+
Slider: typeof Slider;
|
|
39
|
+
DatePicker: typeof DatePicker;
|
|
40
|
+
FAB: typeof FAB;
|
|
29
41
|
SearchBar: typeof SearchBar;
|
|
30
42
|
Dropdown: typeof Dropdown;
|
|
31
43
|
MonetaryInput: typeof MonetaryInput;
|
package/dist/Form/index.js
CHANGED
|
@@ -5,7 +5,9 @@ import ControlledDropdown from "../Form/Form.ControlledDropdown";
|
|
|
5
5
|
import ControlledInput from "../Form/Form.ControlledInput";
|
|
6
6
|
import ControlledMonetaryInput from "../Form/Form.ControlledMonetaryInput";
|
|
7
7
|
import ControlledRadioButton from "../Form/Form.ControlledRadioButton";
|
|
8
|
+
import DatePicker from "../Form/Form.DatePicker";
|
|
8
9
|
import Dropdown from "../Form/Form.Dropdown";
|
|
10
|
+
import FAB from "../Form/Form.FAB";
|
|
9
11
|
import { FilterButton, FilterButtonGroup } from "../Form/Form.FilterButton";
|
|
10
12
|
import FractionalQuantityInput from "../Form/Form.FractionalQuantityInput";
|
|
11
13
|
import IconButton from "../Form/Form.IconButton";
|
|
@@ -13,9 +15,13 @@ import Input from "../Form/Form.Input";
|
|
|
13
15
|
import InputField from "../Form/Form.InputField";
|
|
14
16
|
import MonetaryInput from "../Form/Form.MonetaryInput";
|
|
15
17
|
import PasswordInput from "../Form/Form.PasswordInput";
|
|
18
|
+
import PinInput from "../Form/Form.PinInput";
|
|
16
19
|
import QuantitySelector from "../Form/Form.QuantitySelector";
|
|
17
20
|
import RadioButton from "../Form/Form.RadioButton";
|
|
18
21
|
import SearchBar from "../Form/Form.SearchBar";
|
|
22
|
+
import Select from "../Form/Form.Select";
|
|
23
|
+
import Slider from "../Form/Form.Slider";
|
|
24
|
+
import Switch from "../Form/Form.Switch";
|
|
19
25
|
import TextInput from "../Form/Form.TextInput";
|
|
20
26
|
export const Form = {
|
|
21
27
|
TextInput,
|
|
@@ -28,6 +34,12 @@ export const Form = {
|
|
|
28
34
|
FractionalQuantityInput,
|
|
29
35
|
RadioButton,
|
|
30
36
|
Checkbox,
|
|
37
|
+
Switch,
|
|
38
|
+
Select,
|
|
39
|
+
PinInput,
|
|
40
|
+
Slider,
|
|
41
|
+
DatePicker,
|
|
42
|
+
FAB,
|
|
31
43
|
SearchBar,
|
|
32
44
|
Dropdown,
|
|
33
45
|
MonetaryInput,
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface AppBarActionProps {
|
|
3
|
+
icon: string;
|
|
4
|
+
onPress: () => void;
|
|
5
|
+
badge?: string | number;
|
|
6
|
+
accessibilityLabel?: string;
|
|
7
|
+
/** `tinted` highlights (primary action); `plain` is the neutral contained default. */
|
|
8
|
+
tone?: "plain" | "tinted";
|
|
9
|
+
/** Render for a dark surface (translucent light button + light icon). */
|
|
10
|
+
onDark?: boolean;
|
|
11
|
+
/** Drop the contained surface → bare icon (iOS-style plain back/action). */
|
|
12
|
+
bare?: boolean;
|
|
13
|
+
testID?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* "Contained" icon-button for the AppBar: circular touch area with a subtle surface
|
|
17
|
+
* (merge of Material 3 state-layer + iOS 26 contained button). Optional badge.
|
|
18
|
+
*/
|
|
19
|
+
declare function AppBarAction({ icon, onPress, badge, accessibilityLabel, tone, onDark, bare, testID, }: AppBarActionProps): import("react").JSX.Element;
|
|
20
|
+
export interface AppBarProps {
|
|
21
|
+
title?: string;
|
|
22
|
+
subtitle?: string;
|
|
23
|
+
onBack?: () => void;
|
|
24
|
+
leading?: ReactNode;
|
|
25
|
+
actions?: ReactNode;
|
|
26
|
+
subheader?: ReactNode;
|
|
27
|
+
variant?: "default" | "large" | "center";
|
|
28
|
+
/**
|
|
29
|
+
* Surface tone:
|
|
30
|
+
* - `default` — tokenized light card.
|
|
31
|
+
* - `dark` — always-dark hero (light text + light contained actions).
|
|
32
|
+
* - `gradient` — brand-accent gradient hero for greeting headers ("Buenos días, …"),
|
|
33
|
+
* with dark text via `text.onAccent` (reads `theme.gradient.accent`).
|
|
34
|
+
*/
|
|
35
|
+
tone?: "default" | "dark" | "gradient";
|
|
36
|
+
/** [large variant] Show a left vertical accent bar beside the large title. */
|
|
37
|
+
accentBar?: boolean;
|
|
38
|
+
/** Back button style: `contained` (circular surface) or `plain` (bare iOS chevron). */
|
|
39
|
+
backVariant?: "contained" | "plain";
|
|
40
|
+
border?: boolean;
|
|
41
|
+
/** Reserves the status-bar space (insets.top). `false` to embed/demo. */
|
|
42
|
+
safeArea?: boolean;
|
|
43
|
+
className?: string;
|
|
44
|
+
testID?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Flat, modern top bar (merge of Material 3 + iOS 26): tokenized surface, left-aligned
|
|
48
|
+
* title + subtitle, **contained** icon-buttons (back and actions with a circular area),
|
|
49
|
+
* a `subheader` slot (for SearchBar/Segmented below the title), and a `large` variant.
|
|
50
|
+
* Replaces the gradient look of `Navigation.Header`/`ScreenHeader`.
|
|
51
|
+
*/
|
|
52
|
+
declare function AppBar({ title, subtitle, onBack, leading, actions, subheader, variant, tone, accentBar, backVariant, border, safeArea, className, testID, }: AppBarProps): import("react").JSX.Element;
|
|
53
|
+
declare const AppBarWithAction: typeof AppBar & {
|
|
54
|
+
Action: typeof AppBarAction;
|
|
55
|
+
};
|
|
56
|
+
export default AppBarWithAction;
|
|
57
|
+
export { AppBarWithAction as AppBar };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
+
import GradientSurface from "../Display/Display.GradientSurface";
|
|
3
|
+
import Icon from "../Display/Display.Icon";
|
|
4
|
+
import Pressable from "../primitives/Pressable";
|
|
5
|
+
import { theme } from "../theme";
|
|
6
|
+
import { cn } from "../theme/tw";
|
|
7
|
+
import { Typography } from "../Typography";
|
|
8
|
+
import { StyleSheet, View } from "react-native";
|
|
9
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
10
|
+
/** Fallback for the `tone="dark"` hero surface when the theme has no `bg.inverse` token. */
|
|
11
|
+
const HERO_DARK_FALLBACK = "#0E1714";
|
|
12
|
+
/**
|
|
13
|
+
* "Contained" icon-button for the AppBar: circular touch area with a subtle surface
|
|
14
|
+
* (merge of Material 3 state-layer + iOS 26 contained button). Optional badge.
|
|
15
|
+
*/
|
|
16
|
+
function AppBarAction({ icon, onPress, badge, accessibilityLabel, tone = "plain", onDark = false, bare = false, testID, }) {
|
|
17
|
+
const bg = bare
|
|
18
|
+
? "transparent"
|
|
19
|
+
: onDark
|
|
20
|
+
? "rgba(255,255,255,0.14)"
|
|
21
|
+
: tone === "tinted"
|
|
22
|
+
? theme.bg.accent
|
|
23
|
+
: theme.bg.card;
|
|
24
|
+
const iconColor = tone === "tinted" ? theme.primary : onDark ? theme.icon.inverse : theme.icon.primary;
|
|
25
|
+
// Plain (white) squircle gets a hairline so it reads as a contained button on a light bar.
|
|
26
|
+
const showBorder = !bare && !onDark && tone !== "tinted";
|
|
27
|
+
return (_jsxs(Pressable, { accessibilityLabel: accessibilityLabel, accessibilityRole: "button", className: "items-center justify-center", hitSlop: 6, onPress: onPress, style: {
|
|
28
|
+
width: 40,
|
|
29
|
+
height: 40,
|
|
30
|
+
borderRadius: 12,
|
|
31
|
+
backgroundColor: bg,
|
|
32
|
+
...(showBorder ? { borderWidth: 1, borderColor: theme.border.light } : null),
|
|
33
|
+
}, testID: testID, children: [_jsx(Icon, { color: iconColor, name: icon, size: bare ? 24 : 20 }), badge != null ? (_jsx(View, { className: "absolute bg-danger rounded-full min-w-[16px] h-4 px-1 items-center justify-center", style: { top: -2, right: -2, borderWidth: 2, borderColor: theme.bg.card }, children: _jsx(Typography.Text, { style: { color: theme.text.inverse, fontSize: 9, lineHeight: 11 }, children: badge }) })) : null] }));
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Flat, modern top bar (merge of Material 3 + iOS 26): tokenized surface, left-aligned
|
|
37
|
+
* title + subtitle, **contained** icon-buttons (back and actions with a circular area),
|
|
38
|
+
* a `subheader` slot (for SearchBar/Segmented below the title), and a `large` variant.
|
|
39
|
+
* Replaces the gradient look of `Navigation.Header`/`ScreenHeader`.
|
|
40
|
+
*/
|
|
41
|
+
function AppBar({ title, subtitle, onBack, leading, actions, subheader, variant = "default", tone = "default", accentBar = false, backVariant = "contained", border = true, safeArea = true, className, testID, }) {
|
|
42
|
+
const insets = useSafeAreaInsets();
|
|
43
|
+
const centered = variant === "center";
|
|
44
|
+
const large = variant === "large";
|
|
45
|
+
const dark = tone === "dark";
|
|
46
|
+
const gradient = tone === "gradient";
|
|
47
|
+
// Greeting/balance hero (large, no back/leading): drop the empty top toolbar row and put
|
|
48
|
+
// the action(s) inline beside the big title — avoids a tall dead zone above the title.
|
|
49
|
+
const largeInlineActions = large && !onBack && !leading;
|
|
50
|
+
// Both `dark` and `gradient` are colored surfaces: no card bg, no hairline, light/dark text.
|
|
51
|
+
const colored = dark || gradient;
|
|
52
|
+
const onColoredText = gradient ? theme.text.onAccent : theme.text.inverse;
|
|
53
|
+
const titleStyle = colored ? { color: onColoredText } : undefined;
|
|
54
|
+
const subtitleStyle = gradient
|
|
55
|
+
? { color: theme.text.onAccent, opacity: 0.72 }
|
|
56
|
+
: dark
|
|
57
|
+
? { color: "rgba(255,255,255,0.7)" }
|
|
58
|
+
: undefined;
|
|
59
|
+
return (_jsxs(View, { className: cn(colored ? "" : "bg-bg-card", !colored && border && "border-b border-border-light", className), style: {
|
|
60
|
+
paddingTop: safeArea ? insets.top : 0,
|
|
61
|
+
...(dark ? { backgroundColor: theme.bg.inverse ?? HERO_DARK_FALLBACK } : null),
|
|
62
|
+
}, testID: testID, children: [gradient ? (_jsx(GradientSurface, { colors: theme.gradient.accent, padding: "none", radius: "none", style: StyleSheet.absoluteFill })) : null, largeInlineActions ? null : (_jsxs(View, { className: "flex-row items-center px-3 gap-2 min-h-[56px]", children: [_jsxs(View, { className: "flex-row items-center gap-2", style: { minWidth: 38 }, children: [onBack ? (_jsx(AppBarAction, { accessibilityLabel: "Volver", bare: backVariant === "plain", icon: "chevron-back", onDark: dark, onPress: onBack })) : null, leading] }), !large ? (_jsxs(View, { className: cn("flex-1", centered && "items-center"), children: [title ? (_jsx(Typography.Text, { className: colored ? "" : "text-text-primary", numberOfLines: 1, semibold: true, style: titleStyle, variant: "subtitle", children: title })) : null, subtitle ? (_jsx(Typography.Text, { className: colored ? "" : "text-text-secondary", numberOfLines: 1, style: subtitleStyle, variant: "caption", children: subtitle })) : null] })) : (_jsx(View, { className: "flex-1" })), _jsx(View, { className: "flex-row items-center justify-end gap-2", style: { minWidth: 38 }, children: actions })] })), large && title ? (_jsxs(View, { className: cn("flex-row px-4 pb-3", largeInlineActions ? "pt-2" : "pt-0.5"), children: [accentBar ? (_jsx(View, { style: {
|
|
63
|
+
width: 4,
|
|
64
|
+
marginRight: 10,
|
|
65
|
+
marginVertical: 2,
|
|
66
|
+
borderRadius: 999,
|
|
67
|
+
backgroundColor: theme.accent,
|
|
68
|
+
} })) : null, _jsxs(View, { className: "flex-1", children: [_jsx(Typography.Text, { className: colored ? "" : "text-text-primary", style: titleStyle, variant: "h2", children: title }), subtitle ? (_jsx(Typography.Text, { className: colored ? "" : "text-text-secondary", style: subtitleStyle, variant: "bodySmall", children: subtitle })) : null] }), largeInlineActions && actions ? (_jsx(View, { className: "flex-row items-center justify-end gap-2 pl-2", children: actions })) : null] })) : null, subheader ? _jsx(View, { className: "px-3 pb-3 pt-0.5", children: subheader }) : null] }));
|
|
69
|
+
}
|
|
70
|
+
const AppBarWithAction = Object.assign(AppBar, { Action: AppBarAction });
|
|
71
|
+
export default AppBarWithAction;
|
|
72
|
+
export { AppBarWithAction as AppBar };
|