@sincpro/mobile-ui 0.7.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +575 -230
- package/dist/Actions/Actions.Button.d.ts +98 -93
- package/dist/Actions/Actions.Button.js +58 -52
- package/dist/Actions/Actions.FAB.d.ts +3 -1
- package/dist/Actions/Actions.FAB.js +12 -8
- package/dist/Actions/Actions.FilterButton.d.ts +10 -2
- package/dist/Actions/Actions.FilterButton.js +23 -8
- package/dist/Actions/Actions.IconButton.d.ts +36 -33
- package/dist/Actions/Actions.IconButton.js +10 -6
- package/dist/Actions/index.d.ts +12 -12
- package/dist/Actions/index.js +6 -6
- package/dist/Dialog/BottomSheet/BottomSheet.Root.js +1 -1
- package/dist/Dialog/BottomSheet/index.d.ts +1 -1
- package/dist/Dialog/BottomSheet/index.js +1 -1
- package/dist/Dialog/Confirmation.context.js +3 -3
- package/dist/Dialog/Dialog.ActionSheet.d.ts +2 -1
- package/dist/Dialog/Dialog.ActionSheet.js +19 -9
- package/dist/Dialog/Dialog.Confirmation.js +7 -7
- package/dist/Dialog/Dialog.EditValue.js +4 -4
- package/dist/Dialog/Dialog.NativeSheet.d.ts +10 -0
- package/dist/Dialog/Dialog.NativeSheet.js +21 -0
- package/dist/Dialog/Dialog.Sheet.d.ts +5 -1
- package/dist/Dialog/Dialog.Sheet.js +19 -11
- package/dist/Dialog/index.d.ts +5 -5
- package/dist/Dialog/index.js +5 -5
- package/dist/Display/Display.Accordion.js +5 -5
- package/dist/Display/Display.Avatar.d.ts +30 -30
- package/dist/Display/Display.Avatar.js +2 -2
- package/dist/Display/Display.AvatarGroup.js +3 -3
- package/dist/Display/Display.Badge.d.ts +3 -3
- package/dist/Display/Display.Badge.js +1 -1
- package/dist/Display/Display.Card.d.ts +15 -15
- package/dist/Display/Display.Card.js +4 -4
- package/dist/Display/Display.Carousel.js +2 -2
- package/dist/Display/Display.Chip.d.ts +3 -3
- package/dist/Display/Display.Chip.js +12 -12
- package/dist/Display/Display.CircleButton.d.ts +1 -1
- package/dist/Display/Display.CircleButton.js +3 -3
- package/dist/Display/Display.CopyableText.d.ts +9 -2
- package/dist/Display/Display.CopyableText.js +76 -8
- package/dist/Display/Display.CountRecords.js +2 -2
- package/dist/Display/Display.DataTable.js +2 -2
- package/dist/Display/Display.Date.d.ts +1 -1
- package/dist/Display/Display.Date.js +5 -5
- package/dist/Display/Display.Divider.d.ts +24 -24
- package/dist/Display/Display.Divider.js +1 -1
- package/dist/Display/Display.GradientSurface.d.ts +58 -39
- package/dist/Display/Display.GradientSurface.js +31 -15
- package/dist/Display/Display.Icon.d.ts +1 -1
- package/dist/Display/Display.Icon.js +2 -1
- package/dist/Display/Display.IconBadge.js +3 -3
- package/dist/Display/Display.Image.js +4 -4
- package/dist/Display/Display.KeyValue.d.ts +11 -4
- package/dist/Display/Display.KeyValue.js +8 -6
- package/dist/Display/Display.ListGroup.d.ts +23 -0
- package/dist/Display/Display.ListGroup.js +17 -0
- package/dist/Display/Display.ListItem.d.ts +16 -2
- package/dist/Display/Display.ListItem.js +29 -12
- package/dist/Display/Display.Logo.d.ts +3 -3
- package/dist/Display/Display.Logo.js +2 -2
- package/dist/Display/Display.MediaCard.js +4 -4
- package/dist/Display/Display.MediaEmbed.js +7 -7
- package/dist/Display/Display.MenuButton.d.ts +4 -4
- package/dist/Display/Display.MenuButton.js +6 -6
- package/dist/Display/Display.MenuCard.d.ts +1 -1
- package/dist/Display/Display.MenuCard.js +3 -3
- package/dist/Display/Display.MenuGrid.d.ts +1 -1
- package/dist/Display/Display.MenuGrid.js +1 -1
- package/dist/Display/Display.Monetary.d.ts +1 -1
- package/dist/Display/Display.Monetary.js +2 -2
- package/dist/Display/Display.Pattern.d.ts +33 -12
- package/dist/Display/Display.Pattern.js +60 -14
- package/dist/Display/Display.PriceTag.js +2 -2
- package/dist/Display/Display.ProductCard.js +7 -7
- package/dist/Display/Display.Rating.js +3 -3
- package/dist/Display/Display.SearchHistory.js +6 -6
- package/dist/Display/Display.SectionHeader.d.ts +11 -1
- package/dist/Display/Display.SectionHeader.js +14 -5
- package/dist/Display/Display.Stat.js +2 -2
- package/dist/Display/Display.StatCard.js +4 -4
- package/dist/Display/Display.StatusDot.js +3 -3
- package/dist/Display/Display.Story.js +3 -3
- package/dist/Display/Display.StoryTray.js +5 -5
- package/dist/Display/Display.StoryViewer.js +4 -4
- package/dist/Display/Display.SwipeableRow.d.ts +3 -1
- package/dist/Display/Display.SwipeableRow.js +7 -7
- package/dist/Display/Display.Tag.js +2 -2
- package/dist/Display/Display.Timeline.js +4 -4
- package/dist/Display/Display.Tooltip.js +3 -3
- package/dist/Display/index.d.ts +49 -45
- package/dist/Display/index.js +44 -42
- package/dist/Feedback/ErrorBoundary.d.ts +1 -1
- package/dist/Feedback/ErrorBoundary.js +1 -1
- package/dist/Feedback/Feedback.Banner.d.ts +3 -3
- package/dist/Feedback/Feedback.Banner.js +6 -6
- package/dist/Feedback/Feedback.DomainSplashScreen.js +5 -4
- package/dist/Feedback/Feedback.Empty.js +3 -3
- package/dist/Feedback/Feedback.EmptyState.d.ts +2 -1
- package/dist/Feedback/Feedback.EmptyState.js +7 -7
- package/dist/Feedback/Feedback.Error.d.ts +3 -1
- package/dist/Feedback/Feedback.Error.js +7 -6
- package/dist/Feedback/Feedback.Loading.d.ts +1 -1
- package/dist/Feedback/Feedback.Loading.js +2 -2
- package/dist/Feedback/Feedback.PermissionCard.js +5 -5
- package/dist/Feedback/Feedback.Progress.js +2 -2
- package/dist/Feedback/Feedback.ProgressCircle.js +1 -1
- package/dist/Feedback/Feedback.Skeleton.js +2 -2
- package/dist/Feedback/Feedback.Spinner.js +3 -3
- package/dist/Feedback/Feedback.Splash.d.ts +1 -1
- package/dist/Feedback/Feedback.Splash.js +7 -6
- package/dist/Feedback/Toast.context.js +7 -7
- package/dist/Feedback/index.d.ts +13 -13
- package/dist/Feedback/index.js +13 -13
- package/dist/Form/Form.Button.d.ts +2 -2
- package/dist/Form/Form.Button.js +1 -1
- package/dist/Form/Form.Checkbox.d.ts +4 -1
- package/dist/Form/Form.Checkbox.js +5 -5
- package/dist/Form/Form.ControlledCheckbox.js +1 -1
- package/dist/Form/Form.ControlledInput.js +1 -1
- package/dist/Form/Form.ControlledMonetaryInput.js +1 -1
- package/dist/Form/Form.ControlledRadioButton.js +1 -1
- package/dist/Form/Form.DatePicker.d.ts +2 -1
- package/dist/Form/Form.DatePicker.js +8 -7
- package/dist/Form/Form.Dropdown.js +7 -7
- package/dist/Form/Form.FAB.d.ts +2 -2
- package/dist/Form/Form.FAB.js +1 -1
- package/dist/Form/Form.FilterButton.d.ts +2 -2
- package/dist/Form/Form.FilterButton.js +1 -1
- package/dist/Form/Form.FractionalQuantityInput.js +4 -4
- package/dist/Form/Form.IconButton.d.ts +2 -2
- package/dist/Form/Form.IconButton.js +1 -1
- package/dist/Form/Form.Input.d.ts +5 -3
- package/dist/Form/Form.Input.js +5 -5
- package/dist/Form/Form.InputField.d.ts +1 -1
- package/dist/Form/Form.InputField.js +3 -3
- package/dist/Form/Form.KeyboardForm.d.ts +11 -0
- package/dist/Form/Form.KeyboardForm.js +9 -0
- package/dist/Form/Form.KeyboardToolbar.d.ts +21 -0
- package/dist/Form/Form.KeyboardToolbar.js +70 -0
- package/dist/Form/Form.MonetaryInput.js +5 -4
- package/dist/Form/Form.PasswordInput.d.ts +1 -1
- package/dist/Form/Form.PasswordInput.js +3 -3
- package/dist/Form/Form.PinInput.js +5 -5
- package/dist/Form/Form.QuantitySelector.js +3 -3
- package/dist/Form/Form.RadioButton.js +4 -4
- package/dist/Form/Form.SearchBar.js +4 -4
- package/dist/Form/Form.Select.d.ts +3 -1
- package/dist/Form/Form.Select.js +27 -14
- package/dist/Form/Form.Slider.js +3 -3
- package/dist/Form/Form.Switch.js +4 -4
- package/dist/Form/Form.TextInput.js +3 -3
- package/dist/Form/index.d.ts +33 -27
- package/dist/Form/index.js +29 -25
- package/dist/Navigation/Navigation.AppBar.d.ts +11 -6
- package/dist/Navigation/Navigation.AppBar.js +16 -16
- package/dist/Navigation/Navigation.BottomNav.d.ts +4 -2
- package/dist/Navigation/Navigation.BottomNav.js +34 -21
- package/dist/Navigation/Navigation.CollapsingHeader.d.ts +1 -1
- package/dist/Navigation/Navigation.CollapsingHeader.js +3 -3
- package/dist/Navigation/Navigation.FloatingBar.js +2 -2
- package/dist/Navigation/Navigation.Header.js +6 -6
- package/dist/Navigation/Navigation.HeaderToolbar.js +5 -5
- package/dist/Navigation/Navigation.Menu.js +6 -6
- package/dist/Navigation/Navigation.MenuSection.js +2 -2
- package/dist/Navigation/Navigation.RowItem.d.ts +2 -2
- package/dist/Navigation/Navigation.RowItem.js +4 -4
- package/dist/Navigation/Navigation.SearchBar.d.ts +6 -1
- package/dist/Navigation/Navigation.SearchBar.js +33 -12
- package/dist/Navigation/Navigation.SearchSuggestions.d.ts +14 -0
- package/dist/Navigation/Navigation.SearchSuggestions.js +7 -0
- package/dist/Navigation/Navigation.SegmentedControl.d.ts +3 -1
- package/dist/Navigation/Navigation.SegmentedControl.js +6 -5
- package/dist/Navigation/Navigation.Steps.js +5 -5
- package/dist/Navigation/Navigation.TabIcon.js +2 -2
- package/dist/Navigation/Navigation.TabItem.js +2 -2
- package/dist/Navigation/Navigation.Tabs.js +5 -5
- package/dist/Navigation/index.d.ts +23 -19
- package/dist/Navigation/index.js +17 -15
- package/dist/Typography/Typography.Heading.d.ts +1 -1
- package/dist/Typography/Typography.Heading.js +2 -2
- package/dist/Typography/Typography.SelectableText.d.ts +10 -0
- package/dist/Typography/Typography.SelectableText.js +16 -0
- package/dist/Typography/Typography.Text.d.ts +2 -2
- package/dist/Typography/Typography.Text.js +5 -19
- package/dist/Typography/index.d.ts +5 -2
- package/dist/Typography/index.js +5 -2
- package/dist/branding.d.ts +22 -0
- package/dist/branding.js +20 -3
- package/dist/icons/AddItemIcon.d.ts +1 -1
- package/dist/icons/ArrangeCircle.d.ts +1 -1
- package/dist/icons/ArrowDownIcon.d.ts +1 -1
- package/dist/icons/ArrowUpIcon.d.ts +1 -1
- package/dist/icons/BoxIcon.d.ts +1 -1
- package/dist/icons/BoxTimeIcon.d.ts +1 -1
- package/dist/icons/CalendarIcon.d.ts +1 -1
- package/dist/icons/CardIcon.d.ts +1 -1
- package/dist/icons/CashierIcon.d.ts +1 -1
- package/dist/icons/DuoIcon.d.ts +1 -1
- package/dist/icons/HomeIcon.d.ts +1 -1
- package/dist/icons/HomeIconOutlined.d.ts +1 -1
- package/dist/icons/LogoIcon.d.ts +1 -1
- package/dist/icons/MoneyReceiveIcon.d.ts +1 -1
- package/dist/icons/PinIcon.d.ts +1 -1
- package/dist/icons/PrinterIcon.d.ts +1 -1
- package/dist/icons/ProfileIcon.d.ts +1 -1
- package/dist/icons/SettingsIcon.d.ts +1 -1
- package/dist/icons/SinpeIcon.d.ts +1 -1
- package/dist/icons/ToggleOffIcon.d.ts +1 -1
- package/dist/icons/WalletMoneyIcon.d.ts +1 -1
- package/dist/index.d.ts +24 -23
- package/dist/index.js +26 -24
- package/dist/layouts/AuthContainer.d.ts +9 -3
- package/dist/layouts/AuthContainer.js +8 -8
- package/dist/layouts/Container.js +1 -1
- package/dist/layouts/GradientContainer.js +1 -1
- package/dist/layouts/ScrollContainer.js +1 -1
- package/dist/layouts/TabNavigatorLayout.js +4 -4
- package/dist/primitives/AspectRatio.js +1 -1
- package/dist/primitives/BaseButton.d.ts +92 -87
- package/dist/primitives/BaseButton.js +52 -54
- package/dist/primitives/Box.js +1 -1
- package/dist/primitives/Pressable.js +1 -1
- package/dist/primitives/Row.js +1 -1
- package/dist/primitives/Stack.js +1 -1
- package/dist/primitives/index.d.ts +6 -6
- package/dist/primitives/index.js +6 -6
- package/dist/theme/active.d.ts +1 -1
- package/dist/theme/active.js +14 -1
- package/dist/theme/build.d.ts +33 -0
- package/dist/theme/build.js +118 -0
- package/dist/theme/color.d.ts +26 -0
- package/dist/theme/color.js +109 -0
- package/dist/theme/components/index.d.ts +1 -1
- package/dist/theme/components/index.js +1 -1
- package/dist/theme/contrast.d.ts +29 -0
- package/dist/theme/contrast.js +57 -0
- package/dist/theme/css-vars.d.ts +3 -1
- package/dist/theme/css-vars.js +29 -3
- package/dist/theme/dark.d.ts +3 -4
- package/dist/theme/dark.js +91 -48
- package/dist/theme/default.d.ts +5 -1
- package/dist/theme/default.js +89 -41
- package/dist/theme/define.d.ts +4 -1
- package/dist/theme/define.js +4 -1
- package/dist/theme/globals.css +61 -46
- package/dist/theme/index.d.ts +14 -10
- package/dist/theme/index.js +13 -9
- package/dist/theme/theme.d.ts +1 -1
- package/dist/theme/theme.js +2 -2
- package/dist/theme/types.d.ts +77 -16
- package/dist/theme/types.js +13 -3
- package/dist/theme/typography.d.ts +19 -4
- package/dist/theme/typography.js +45 -28
- package/dist/theme/useTheme.d.ts +1 -1
- package/dist/theme/useTheme.js +1 -1
- package/dist/theme/validate.d.ts +16 -0
- package/dist/theme/validate.js +200 -0
- package/dist/tokens/index.d.ts +2 -2
- package/dist/tokens/index.js +2 -2
- package/dist/utils/criteria.d.ts +56 -0
- package/dist/utils/criteria.js +99 -0
- package/dist/utils/reorder.d.ts +4 -0
- package/dist/utils/reorder.js +32 -0
- package/dist/views/AppSplashView.d.ts +2 -2
- package/dist/views/AppSplashView.js +3 -3
- package/dist/views/AuthFormView.d.ts +5 -2
- package/dist/views/AuthFormView.js +5 -5
- package/dist/views/FormViewV2.d.ts +9 -4
- package/dist/views/FormViewV2.js +44 -25
- package/dist/views/ListViewV2.d.ts +12 -9
- package/dist/views/ListViewV2.js +49 -36
- package/dist/views/Wizard/Wizard.context.js +1 -1
- package/dist/views/Wizard/Wizard.d.ts +1 -1
- package/dist/views/Wizard/Wizard.js +1 -1
- package/dist/views/Wizard/index.d.ts +4 -4
- package/dist/views/Wizard/index.js +2 -2
- package/dist/views/types/IFormView.d.ts +1 -1
- package/dist/views/types/IListView.d.ts +1 -1
- package/dist/widgets/CircleButton.d.ts +2 -2
- package/dist/widgets/CircleButton.js +1 -1
- package/dist/widgets/CollectionOptions.d.ts +15 -0
- package/dist/widgets/CollectionOptions.js +127 -0
- package/dist/widgets/FilterBar.d.ts +21 -0
- package/dist/widgets/FilterBar.js +14 -0
- package/dist/widgets/FilterBuilder.d.ts +10 -0
- package/dist/widgets/FilterBuilder.js +115 -0
- package/dist/widgets/GeoPermissionCard.js +3 -3
- package/dist/widgets/HomeHeader.js +3 -3
- package/dist/widgets/JSONViewer.js +2 -2
- package/dist/widgets/MenuCard.d.ts +2 -2
- package/dist/widgets/MenuCard.js +1 -1
- package/dist/widgets/MenuGrid.d.ts +3 -3
- package/dist/widgets/MenuGrid.js +1 -1
- package/dist/widgets/MenuSection.d.ts +2 -2
- package/dist/widgets/MenuSection.js +1 -1
- package/dist/widgets/PromoBanner.js +3 -3
- package/dist/widgets/PromoModal.js +3 -3
- package/dist/widgets/QueryChoice.d.ts +10 -0
- package/dist/widgets/QueryChoice.js +13 -0
- package/dist/widgets/QuickActions.js +3 -3
- package/dist/widgets/ReorderableList.d.ts +51 -0
- package/dist/widgets/ReorderableList.js +138 -0
- package/dist/widgets/ScreenHeader.js +2 -2
- package/dist/widgets/TimeZoneSelector.d.ts +1 -1
- package/dist/widgets/TimeZoneSelector.js +4 -4
- package/dist/widgets/TimeZoneSelectorModal.d.ts +1 -1
- package/dist/widgets/TimeZoneSelectorModal.js +5 -5
- package/dist/widgets/index.d.ts +20 -16
- package/dist/widgets/index.js +13 -10
- package/package.json +70 -50
- package/tailwind.preset.js +19 -0
- package/dist/icons/icon_getters.d.ts +0 -6
- package/dist/icons/icon_getters.js +0 -23
|
@@ -1,67 +1,70 @@
|
|
|
1
|
-
import { type VariantProps } from "../theme/tw";
|
|
2
|
-
import { IconType } from "../utils/icon";
|
|
1
|
+
import { type VariantProps } from "../theme/tw.js";
|
|
2
|
+
import { IconType } from "../utils/icon.js";
|
|
3
|
+
import type { AccessibilityProps } from "react-native";
|
|
3
4
|
declare const iconButton: import("tailwind-variants").TVReturnType<{
|
|
4
5
|
variant: {
|
|
5
|
-
primary:
|
|
6
|
-
secondary:
|
|
7
|
-
tertiary:
|
|
8
|
-
ghost:
|
|
6
|
+
primary: "bg-primary";
|
|
7
|
+
secondary: "bg-bg-card border border-primary";
|
|
8
|
+
tertiary: "bg-accent";
|
|
9
|
+
ghost: "bg-transparent";
|
|
9
10
|
};
|
|
10
11
|
size: {
|
|
11
|
-
small:
|
|
12
|
-
medium:
|
|
13
|
-
large:
|
|
12
|
+
small: "w-8 h-8";
|
|
13
|
+
medium: "w-10 h-10";
|
|
14
|
+
large: "w-12 h-12";
|
|
14
15
|
};
|
|
15
16
|
rounded: {
|
|
16
|
-
true:
|
|
17
|
+
true: "rounded-full";
|
|
17
18
|
};
|
|
18
19
|
disabled: {
|
|
19
|
-
true:
|
|
20
|
+
true: "opacity-50";
|
|
20
21
|
};
|
|
21
22
|
}, undefined, "rounded-lg items-center justify-center", {
|
|
22
23
|
variant: {
|
|
23
|
-
primary:
|
|
24
|
-
secondary:
|
|
25
|
-
tertiary:
|
|
26
|
-
ghost:
|
|
24
|
+
primary: "bg-primary";
|
|
25
|
+
secondary: "bg-bg-card border border-primary";
|
|
26
|
+
tertiary: "bg-accent";
|
|
27
|
+
ghost: "bg-transparent";
|
|
27
28
|
};
|
|
28
29
|
size: {
|
|
29
|
-
small:
|
|
30
|
-
medium:
|
|
31
|
-
large:
|
|
30
|
+
small: "w-8 h-8";
|
|
31
|
+
medium: "w-10 h-10";
|
|
32
|
+
large: "w-12 h-12";
|
|
32
33
|
};
|
|
33
34
|
rounded: {
|
|
34
|
-
true:
|
|
35
|
+
true: "rounded-full";
|
|
35
36
|
};
|
|
36
37
|
disabled: {
|
|
37
|
-
true:
|
|
38
|
+
true: "opacity-50";
|
|
38
39
|
};
|
|
39
|
-
}, undefined, import("tailwind-variants").
|
|
40
|
+
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
40
41
|
variant: {
|
|
41
|
-
primary:
|
|
42
|
-
secondary:
|
|
43
|
-
tertiary:
|
|
44
|
-
ghost:
|
|
42
|
+
primary: "bg-primary";
|
|
43
|
+
secondary: "bg-bg-card border border-primary";
|
|
44
|
+
tertiary: "bg-accent";
|
|
45
|
+
ghost: "bg-transparent";
|
|
45
46
|
};
|
|
46
47
|
size: {
|
|
47
|
-
small:
|
|
48
|
-
medium:
|
|
49
|
-
large:
|
|
48
|
+
small: "w-8 h-8";
|
|
49
|
+
medium: "w-10 h-10";
|
|
50
|
+
large: "w-12 h-12";
|
|
50
51
|
};
|
|
51
52
|
rounded: {
|
|
52
|
-
true:
|
|
53
|
+
true: "rounded-full";
|
|
53
54
|
};
|
|
54
55
|
disabled: {
|
|
55
|
-
true:
|
|
56
|
+
true: "opacity-50";
|
|
56
57
|
};
|
|
57
|
-
}, undefined
|
|
58
|
-
export interface IconButtonProps extends VariantProps<typeof iconButton
|
|
58
|
+
}, undefined>>;
|
|
59
|
+
export interface IconButtonProps extends VariantProps<typeof iconButton>, AccessibilityProps {
|
|
59
60
|
icon?: string;
|
|
60
61
|
type?: IconType;
|
|
61
62
|
onPress: () => void;
|
|
62
63
|
loading?: boolean;
|
|
63
64
|
iconColor?: string;
|
|
64
65
|
className?: string;
|
|
66
|
+
testID?: string;
|
|
67
|
+
accessibleSizing?: boolean;
|
|
65
68
|
}
|
|
66
|
-
declare function IconButton({ icon, type, onPress, variant, size, loading, disabled, rounded, iconColor, className, }: IconButtonProps): import("react").JSX.Element;
|
|
69
|
+
declare function IconButton({ icon, type, onPress, variant, size, loading, disabled, rounded, iconColor, className, testID, accessibleSizing, accessibilityState, ...accessibilityProps }: IconButtonProps): import("react").JSX.Element;
|
|
67
70
|
export default IconButton;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { theme } from "../theme";
|
|
4
|
-
import { tv } from "../theme/tw";
|
|
2
|
+
import Icon from "../Display/Display.Icon.js";
|
|
3
|
+
import { theme } from "../theme/index.js";
|
|
4
|
+
import { tv } from "../theme/tw.js";
|
|
5
5
|
import { ActivityIndicator, TouchableOpacity } from "react-native";
|
|
6
6
|
const iconButton = tv({
|
|
7
7
|
base: "rounded-lg items-center justify-center",
|
|
@@ -31,8 +31,12 @@ const iconButton = tv({
|
|
|
31
31
|
disabled: false,
|
|
32
32
|
},
|
|
33
33
|
});
|
|
34
|
-
function IconButton({ icon, type = "feather", onPress, variant = "ghost", size = "medium", loading = false, disabled = false, rounded = false, iconColor, className, }) {
|
|
35
|
-
const resolvedColor = iconColor ?? theme.
|
|
36
|
-
return (_jsx(TouchableOpacity, { activeOpacity: 0.7, className: iconButton({ variant, size, rounded, disabled, className }), disabled: disabled || loading, onPress: onPress,
|
|
34
|
+
function IconButton({ icon, type = "feather", onPress, variant = "ghost", size = "medium", loading = false, disabled = false, rounded = false, iconColor, className, testID, accessibleSizing = false, accessibilityState, ...accessibilityProps }) {
|
|
35
|
+
const resolvedColor = iconColor ?? theme.text.accent;
|
|
36
|
+
return (_jsx(TouchableOpacity, { activeOpacity: 0.7, className: iconButton({ variant, size, rounded, disabled, className }), disabled: disabled || loading, onPress: onPress, ...accessibilityProps, accessibilityRole: "button", accessibilityState: {
|
|
37
|
+
...accessibilityState,
|
|
38
|
+
disabled: disabled || loading,
|
|
39
|
+
busy: loading,
|
|
40
|
+
}, style: accessibleSizing ? { minHeight: 48, minWidth: 48 } : undefined, testID: testID, children: loading ? (_jsx(ActivityIndicator, { color: resolvedColor, size: "small" })) : (_jsx(Icon, { color: resolvedColor, name: icon, size: 24, type: type })) }));
|
|
37
41
|
}
|
|
38
42
|
export default IconButton;
|
package/dist/Actions/index.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import FAB from "
|
|
2
|
-
import { FilterButtonGroup } from "
|
|
3
|
-
import IconButton from "
|
|
1
|
+
import FAB from "./Actions.FAB.js";
|
|
2
|
+
import { FilterButtonGroup } from "./Actions.FilterButton.js";
|
|
3
|
+
import IconButton from "./Actions.IconButton.js";
|
|
4
4
|
export declare const Actions: {
|
|
5
|
-
/** Primary action button
|
|
6
|
-
Button: import("react").FC<import("
|
|
7
|
-
Icon: import("react").FC<import("
|
|
5
|
+
/** Primary action button. The filled one is gold; navy is text. Supports confirm dialog. */
|
|
6
|
+
Button: import("react").FC<import("./Actions.Button.js").ButtonProps> & {
|
|
7
|
+
Icon: import("react").FC<import("./Actions.Button.js").ButtonIconProps>;
|
|
8
8
|
};
|
|
9
9
|
/** Small icon-only tap target — ghost, primary, secondary, tertiary variants. */
|
|
10
10
|
IconButton: typeof IconButton;
|
|
11
11
|
/** Floating Action Button — fixed bottom-right/left, label-optional. */
|
|
12
12
|
FAB: typeof FAB;
|
|
13
13
|
/** Chip-style active/inactive toggle — use inside `Actions.FilterButtonGroup`. */
|
|
14
|
-
FilterButton: import("react").FC<import("
|
|
15
|
-
/**
|
|
14
|
+
FilterButton: import("react").FC<import("./Actions.FilterButton.js").FilterButtonProps>;
|
|
15
|
+
/** Filter chip layout; opt into horizontal scrolling or wrapping with `layout`. */
|
|
16
16
|
FilterButtonGroup: typeof FilterButtonGroup;
|
|
17
17
|
};
|
|
18
|
-
export type { ButtonIconProps, ButtonProps } from "
|
|
19
|
-
export type { FABProps } from "
|
|
20
|
-
export type { FilterButtonProps } from "
|
|
21
|
-
export type { IconButtonProps } from "
|
|
18
|
+
export type { ButtonIconProps, ButtonProps } from "./Actions.Button.js";
|
|
19
|
+
export type { FABProps } from "./Actions.FAB.js";
|
|
20
|
+
export type { FilterButtonGroupProps, FilterButtonProps, } from "./Actions.FilterButton.js";
|
|
21
|
+
export type { IconButtonProps } from "./Actions.IconButton.js";
|
|
22
22
|
export default Actions;
|
package/dist/Actions/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import ButtonWithIcon from "
|
|
2
|
-
import FAB from "
|
|
3
|
-
import { FilterButton, FilterButtonGroup, } from "
|
|
4
|
-
import IconButton from "
|
|
1
|
+
import ButtonWithIcon from "./Actions.Button.js";
|
|
2
|
+
import FAB from "./Actions.FAB.js";
|
|
3
|
+
import { FilterButton, FilterButtonGroup, } from "./Actions.FilterButton.js";
|
|
4
|
+
import IconButton from "./Actions.IconButton.js";
|
|
5
5
|
export const Actions = {
|
|
6
|
-
/** Primary action button
|
|
6
|
+
/** Primary action button. The filled one is gold; navy is text. Supports confirm dialog. */
|
|
7
7
|
Button: ButtonWithIcon,
|
|
8
8
|
/** Small icon-only tap target — ghost, primary, secondary, tertiary variants. */
|
|
9
9
|
IconButton,
|
|
@@ -11,7 +11,7 @@ export const Actions = {
|
|
|
11
11
|
FAB,
|
|
12
12
|
/** Chip-style active/inactive toggle — use inside `Actions.FilterButtonGroup`. */
|
|
13
13
|
FilterButton,
|
|
14
|
-
/**
|
|
14
|
+
/** Filter chip layout; opt into horizontal scrolling or wrapping with `layout`. */
|
|
15
15
|
FilterButtonGroup,
|
|
16
16
|
};
|
|
17
17
|
export default Actions;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
2
|
/* eslint-disable react-hooks/refs */
|
|
3
|
-
import { theme } from "../../theme";
|
|
3
|
+
import { theme } from "../../theme/index.js";
|
|
4
4
|
import { createContext, useContext, useEffect, useRef } from "react";
|
|
5
5
|
import { Animated, Dimensions, Modal, PanResponder, Pressable, ScrollView, Text, View, } from "react-native";
|
|
6
6
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { BottomSheet } from "
|
|
1
|
+
export { BottomSheet } from "./BottomSheet.Root.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { BottomSheet } from "
|
|
1
|
+
export { BottomSheet } from "./BottomSheet.Root.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "nativewind/jsx-runtime";
|
|
2
|
-
import { BottomSheet } from "
|
|
3
|
-
import ConfirmationDialog from "
|
|
4
|
-
import { BaseButton } from "../primitives/BaseButton";
|
|
2
|
+
import { BottomSheet } from "./BottomSheet/index.js";
|
|
3
|
+
import ConfirmationDialog from "./Dialog.Confirmation.js";
|
|
4
|
+
import { BaseButton } from "../primitives/BaseButton.js";
|
|
5
5
|
import { createContext, useCallback, useContext, useMemo, useState, } from "react";
|
|
6
6
|
const DEFAULT_STATE = {
|
|
7
7
|
isVisible: false,
|
|
@@ -12,6 +12,7 @@ export interface ActionSheetProps {
|
|
|
12
12
|
title?: string;
|
|
13
13
|
message?: string;
|
|
14
14
|
cancelLabel?: string;
|
|
15
|
+
testID?: string;
|
|
15
16
|
}
|
|
16
|
-
declare function ActionSheet({ visible, onClose, actions, title, message, cancelLabel, }: ActionSheetProps): import("react").JSX.Element;
|
|
17
|
+
declare function ActionSheet({ visible, onClose, actions, title, message, cancelLabel, testID, }: ActionSheetProps): import("react").JSX.Element;
|
|
17
18
|
export default ActionSheet;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
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 {
|
|
5
|
-
import { cn } from "../theme/tw";
|
|
6
|
-
import { Typography } from "../Typography";
|
|
2
|
+
import Icon from "../Display/Display.Icon.js";
|
|
3
|
+
import Pressable from "../primitives/Pressable.js";
|
|
4
|
+
import { themeToVars, useTheme } from "../theme/index.js";
|
|
5
|
+
import { cn } from "../theme/tw.js";
|
|
6
|
+
import { Typography } from "../Typography/index.js";
|
|
7
|
+
import { vars } from "nativewind";
|
|
7
8
|
import { useEffect, useRef } from "react";
|
|
8
|
-
import { Animated, Modal,
|
|
9
|
+
import { Animated, Modal, ScrollView, View } from "react-native";
|
|
9
10
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
10
|
-
function ActionSheet({ visible, onClose, actions, title, message, cancelLabel = "Cancelar", }) {
|
|
11
|
+
function ActionSheet({ visible, onClose, actions, title, message, cancelLabel = "Cancelar", testID, }) {
|
|
12
|
+
const theme = useTheme();
|
|
11
13
|
const insets = useSafeAreaInsets();
|
|
12
14
|
// eslint-disable-next-line react-hooks/refs
|
|
13
15
|
const translateY = useRef(new Animated.Value(800)).current;
|
|
@@ -24,9 +26,17 @@ function ActionSheet({ visible, onClose, actions, title, message, cancelLabel =
|
|
|
24
26
|
translateY.setValue(800);
|
|
25
27
|
}
|
|
26
28
|
}, [visible, translateY]);
|
|
27
|
-
return (_jsx(Modal, { animationType: "none", onRequestClose: onClose, presentationStyle: "overFullScreen", transparent: true, visible: visible, children:
|
|
29
|
+
return (_jsx(Modal, { animationType: "none", onRequestClose: onClose, presentationStyle: "overFullScreen", transparent: true, visible: visible, children: _jsxs(View, { className: "flex-1 justify-end", testID: testID, children: [_jsx(View, { accessibilityElementsHidden: true, className: "absolute inset-0 bg-black/50", importantForAccessibility: "no-hide-descendants", onResponderRelease: onClose, onStartShouldSetResponder: () => true }), _jsxs(Animated.View, { accessibilityViewIsModal: true, onAccessibilityEscape: onClose, style: [
|
|
30
|
+
vars(themeToVars(theme)),
|
|
31
|
+
{
|
|
32
|
+
transform: [{ translateY }],
|
|
33
|
+
maxHeight: "90%",
|
|
34
|
+
paddingHorizontal: 12,
|
|
35
|
+
paddingBottom: insets.bottom + 12,
|
|
36
|
+
},
|
|
37
|
+
], children: [title || message ? (_jsxs(View, { className: "rounded-xl mb-2 px-4 py-3 items-center", style: { backgroundColor: theme.bg.card }, children: [title ? (_jsx(Typography.Text, { accessibilityRole: "header", className: "text-text-primary", semibold: true, children: title })) : null, message ? (_jsx(Typography.Text, { className: "text-text-secondary text-sm", variant: "bodySmall", children: message })) : null] })) : null, _jsx(ScrollView, { bounces: false, className: "rounded-xl overflow-hidden mb-2", style: { backgroundColor: theme.bg.card }, children: actions.map((action, index) => (_jsxs(Pressable, { accessibilityLabel: action.label, accessibilityRole: "button", accessibilityState: { disabled: action.disabled }, className: cn("flex-row items-center justify-center gap-2 px-4 py-4", index < actions.length - 1 && "border-b border-border-light"), disabled: action.disabled, onPress: () => {
|
|
28
38
|
onClose();
|
|
29
39
|
action.onPress();
|
|
30
|
-
}, children: [action.icon ? (_jsx(Icon, { color: action.destructive ? theme.danger : theme.icon.primary, name: action.icon, size: 20 })) : null, _jsx(Typography.Text, { className: cn(action.destructive ? "text-danger" : "text-text-primary"), semibold: true, children: action.label })] }, action.label))) }), _jsx(Pressable, { accessibilityRole: "button", className: "rounded-xl px-4 py-4 items-center", onPress: onClose, style: { backgroundColor: theme.bg.card }, children: _jsx(Typography.Text, { className: "text-
|
|
40
|
+
}, style: { minHeight: 48 }, children: [action.icon ? (_jsx(Icon, { color: action.destructive ? theme.danger : theme.icon.primary, name: action.icon, size: 20 })) : null, _jsx(Typography.Text, { className: cn(action.destructive ? "text-danger" : "text-text-primary"), semibold: true, children: action.label })] }, action.label))) }), _jsx(Pressable, { accessibilityLabel: cancelLabel, accessibilityRole: "button", className: "rounded-xl px-4 py-4 items-center", onPress: onClose, style: { backgroundColor: theme.bg.card, minHeight: 48 }, children: _jsx(Typography.Text, { className: "text-text-accent", semibold: true, children: cancelLabel }) })] })] }) }));
|
|
31
41
|
}
|
|
32
42
|
export default ActionSheet;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
-
import { BaseButton } from "../primitives/BaseButton";
|
|
3
|
-
import { theme } from "../theme";
|
|
4
|
-
import Typography from "../Typography/Typography.Text";
|
|
2
|
+
import { BaseButton } from "../primitives/BaseButton.js";
|
|
3
|
+
import { theme } from "../theme/index.js";
|
|
4
|
+
import Typography from "../Typography/Typography.Text.js";
|
|
5
5
|
import { Modal, TouchableWithoutFeedback, View } from "react-native";
|
|
6
|
-
const ConfirmationDialog = ({ visible, onCancel, onConfirm, auxTitle = "cambios", subtitle = "¿
|
|
7
|
-
return (_jsx(Modal, { animationType: "fade", onRequestClose: onCancel, presentationStyle: "overFullScreen", transparent: true, visible: visible, children: _jsx(TouchableWithoutFeedback, { onPress: onCancel, children: _jsx(View, { className: "flex-1 justify-center items-center p-6 bg-black/50", children: _jsx(TouchableWithoutFeedback, { children: _jsxs(View, { className: "p-3 w-full max-w-xs mx-auto", style: {
|
|
8
|
-
borderRadius:
|
|
6
|
+
const ConfirmationDialog = ({ visible, onCancel, onConfirm, auxTitle = "Descartar cambios", subtitle = "¿Quieres descartar los cambios realizados?", confirmButtonText = "Descartar cambios", cancelButtonText = "Seguir editando", }) => {
|
|
7
|
+
return (_jsx(Modal, { animationType: "fade", onRequestClose: onCancel, presentationStyle: "overFullScreen", transparent: true, visible: visible, children: _jsx(TouchableWithoutFeedback, { onPress: onCancel, children: _jsx(View, { className: "flex-1 justify-center items-center p-6 bg-black/50", children: _jsx(TouchableWithoutFeedback, { children: _jsxs(View, { accessibilityViewIsModal: true, className: "p-3 w-full max-w-xs mx-auto", style: {
|
|
8
|
+
borderRadius: 16,
|
|
9
9
|
backgroundColor: theme.bg.popover,
|
|
10
10
|
...theme.shadow.md,
|
|
11
|
-
}, children: [_jsx(Typography, { className: "mb-1.5 text-sm", variant: "body", children: _jsx(Typography, { semibold: true, variant: "body", children: auxTitle }) }), _jsx(Typography, { className: "mb-3 text-xs leading-tight", variant: "body", children: subtitle }), _jsxs(View, { className: "flex-row gap-2", children: [_jsx(BaseButton, { className: "flex-1", onPress: onCancel, size: "small", title: cancelButtonText, variant: "outlineBlack" }), _jsx(BaseButton, { className: "flex-1", onPress: onConfirm, size: "small", title: confirmButtonText, variant: "primary" })] })] }) }) }) }) }));
|
|
11
|
+
}, children: [_jsx(Typography, { accessibilityRole: "header", className: "mb-1.5 text-sm", variant: "body", children: _jsx(Typography, { semibold: true, variant: "body", children: auxTitle }) }), _jsx(Typography, { className: "mb-3 text-xs leading-tight", variant: "body", children: subtitle }), _jsxs(View, { className: "flex-row gap-2", children: [_jsx(BaseButton, { className: "flex-1", onPress: onCancel, size: "small", title: cancelButtonText, variant: "outlineBlack" }), _jsx(BaseButton, { className: "flex-1", onPress: onConfirm, size: "small", title: confirmButtonText, variant: "primary" })] })] }) }) }) }) }));
|
|
12
12
|
};
|
|
13
13
|
export default ConfirmationDialog;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
-
import { theme } from "../theme";
|
|
3
|
-
import { Typography } from "../Typography";
|
|
2
|
+
import { theme } from "../theme/index.js";
|
|
3
|
+
import { Typography } from "../Typography/index.js";
|
|
4
4
|
import { useEffect, useRef } from "react";
|
|
5
|
-
import { FlatList, Modal, TextInput, TouchableOpacity, View } from "react-native";
|
|
5
|
+
import { FlatList, Modal, TextInput, TouchableOpacity, View, } from "react-native";
|
|
6
6
|
function EditableValueModal({ visible, title, value, onChangeValue, onConfirm, onCancel, placeholder, helperText, chips, keyboardType = "decimal-pad", rightAdornment, confirmLabel = "Aplicar", cancelLabel = "Cancelar", autoFocus = true, testID, }) {
|
|
7
7
|
const inputRef = useRef(null);
|
|
8
8
|
useEffect(() => {
|
|
@@ -11,6 +11,6 @@ function EditableValueModal({ visible, title, value, onChangeValue, onConfirm, o
|
|
|
11
11
|
return () => clearTimeout(t);
|
|
12
12
|
}
|
|
13
13
|
}, [visible, autoFocus]);
|
|
14
|
-
return (_jsx(Modal, { animationType: "fade", onRequestClose: onCancel, presentationStyle: "overFullScreen", transparent: true, visible: visible, children: _jsx(View, { className: "flex-1 justify-center p-6 bg-black/40", children: _jsxs(View, { className: "p-4", style: { borderRadius:
|
|
14
|
+
return (_jsx(Modal, { animationType: "fade", onRequestClose: onCancel, presentationStyle: "overFullScreen", transparent: true, visible: visible, children: _jsx(View, { className: "flex-1 justify-center p-6 bg-black/40", children: _jsxs(View, { className: "p-4", style: { borderRadius: 16, backgroundColor: theme.bg.popover, ...theme.shadow.md }, testID: testID, children: [_jsx(Typography.Text, { className: "mb-3", semibold: true, variant: "h6", children: title }), _jsxs(View, { className: "flex-row items-center", children: [_jsx(TextInput, { className: "flex-1 border border-input rounded-lg p-2.5 text-lg text-text-primary", keyboardType: keyboardType, onChangeText: onChangeValue, onSubmitEditing: onConfirm, placeholder: placeholder, placeholderTextColor: theme.text.tertiary, ref: inputRef, returnKeyType: "done", selectionColor: theme.primary, underlineColorAndroid: "transparent", value: value }), rightAdornment && _jsx(View, { className: "ml-2", children: rightAdornment })] }), helperText ? (_jsx(View, { className: "mt-2", children: typeof helperText === "string" ? (_jsx(Typography.Text, { className: "opacity-70", variant: "bodySmall", children: helperText })) : (helperText) })) : null, chips && chips.length > 0 && (_jsx(FlatList, { contentContainerClassName: "gap-2 py-3", data: chips, horizontal: true, keyExtractor: (c, i) => c.key || `${c.label}-${i}`, renderItem: ({ item }) => (_jsx(TouchableOpacity, { className: "px-3 py-1.5 bg-accent/10 rounded-2xl border border-accent/30", onPress: item.onPress, children: _jsx(Typography.Text, { semibold: true, variant: "bodySmall", children: item.label }) })) })), _jsxs(View, { className: "flex-row justify-end gap-3", children: [_jsx(TouchableOpacity, { className: "px-4 py-2.5 rounded-lg bg-bg-hover", onPress: onCancel, children: _jsx(Typography.Text, { semibold: true, variant: "body", children: cancelLabel }) }), _jsx(TouchableOpacity, { className: "px-4 py-2.5 rounded-lg bg-accent", onPress: onConfirm, children: _jsx(Typography.Text, { className: "text-text-inverse", semibold: true, variant: "body", children: confirmLabel }) })] })] }) }) }));
|
|
15
15
|
}
|
|
16
16
|
export default EditableValueModal;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface NativeSheetProps {
|
|
3
|
+
visible: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
title: string;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
testID?: string;
|
|
8
|
+
}
|
|
9
|
+
declare function NativeSheet({ visible, onClose, title, children, testID }: NativeSheetProps): import("react").JSX.Element;
|
|
10
|
+
export default NativeSheet;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
+
import BottomSheet, { BottomSheetView } from "@expo/ui/community/bottom-sheet";
|
|
3
|
+
import Pressable from "../primitives/Pressable.js";
|
|
4
|
+
import { themeToVars, useTheme } from "../theme/index.js";
|
|
5
|
+
import { Typography } from "../Typography/index.js";
|
|
6
|
+
import { vars } from "nativewind";
|
|
7
|
+
import { ScrollView, View } from "react-native";
|
|
8
|
+
const SNAP_POINTS = ["60%", "90%"];
|
|
9
|
+
function NativeSheet({ visible, onClose, title, children, testID }) {
|
|
10
|
+
const theme = useTheme();
|
|
11
|
+
return (_jsx(BottomSheet, { backgroundStyle: { backgroundColor: theme.bg.card }, enablePanDownToClose: true, index: visible ? 0 : -1, onClose: () => {
|
|
12
|
+
if (visible)
|
|
13
|
+
onClose();
|
|
14
|
+
}, snapPoints: SNAP_POINTS, children: _jsx(BottomSheetView, { style: { flex: 1 }, children: _jsxs(View, { accessibilityViewIsModal: true, onAccessibilityEscape: onClose, style: [vars(themeToVars(theme)), { flex: 1, padding: 16 }], testID: testID, children: [_jsxs(View, { className: "flex-row items-center gap-3", children: [_jsx(Typography.Heading, { className: "flex-1", variant: "h4", children: title }), _jsx(Pressable, { accessibilityLabel: "Cerrar", onPress: onClose, style: {
|
|
15
|
+
minHeight: 48,
|
|
16
|
+
minWidth: 48,
|
|
17
|
+
justifyContent: "center",
|
|
18
|
+
alignItems: "center",
|
|
19
|
+
}, children: _jsx(Typography.Text, { className: "text-text-accent", variant: "bodySmall", children: "Cerrar" }) })] }), _jsx(ScrollView, { contentContainerStyle: { paddingVertical: 12 }, keyboardShouldPersistTaps: "handled", children: children })] }) }) }));
|
|
20
|
+
}
|
|
21
|
+
export default NativeSheet;
|
|
@@ -15,6 +15,10 @@ export interface SheetProps {
|
|
|
15
15
|
maxHeightRatio?: number;
|
|
16
16
|
/** Allow closing by tapping the dim backdrop. Default `false` (handle/button only). */
|
|
17
17
|
dismissOnBackdrop?: boolean;
|
|
18
|
+
/** Show a visible close button in the sheet header. */
|
|
19
|
+
showCloseButton?: boolean;
|
|
20
|
+
/** Increase interactive targets to 48 points. */
|
|
21
|
+
accessibleSizing?: boolean;
|
|
18
22
|
testID?: string;
|
|
19
23
|
}
|
|
20
24
|
/**
|
|
@@ -22,5 +26,5 @@ export interface SheetProps {
|
|
|
22
26
|
* **swipe-down to close** (handle only). By default it does NOT close on backdrop tap
|
|
23
27
|
* (`dismissOnBackdrop`). No provider or native deps. Import via subpath `Dialog/Sheet`.
|
|
24
28
|
*/
|
|
25
|
-
declare function Sheet({ visible, onClose, children, title, maxHeightRatio, dismissOnBackdrop, testID, }: SheetProps): import("react").JSX.Element;
|
|
29
|
+
declare function Sheet({ visible, onClose, children, title, maxHeightRatio, dismissOnBackdrop, showCloseButton, accessibleSizing, testID, }: SheetProps): import("react").JSX.Element;
|
|
26
30
|
export default Sheet;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/* eslint-disable react-hooks/refs */
|
|
3
|
+
// This file uses the canonical RN patterns: useRef(new Animated.Value()).current and PanResponder
|
|
4
|
+
// created inside useState. Those hooks rules warn — they're not bugs here. Documented at the
|
|
5
|
+
// eslint config level (see eslint.config.js:30-33).
|
|
6
|
+
import Pressable from "../primitives/Pressable.js";
|
|
7
|
+
import { themeToVars, useTheme } from "../theme/index.js";
|
|
8
|
+
import { Typography } from "../Typography/index.js";
|
|
9
|
+
import { vars } from "nativewind";
|
|
4
10
|
import { useEffect, useRef, useState } from "react";
|
|
5
11
|
import { Animated, Modal, PanResponder, ScrollView, View } from "react-native";
|
|
6
12
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
@@ -16,11 +22,11 @@ export function SheetProvider({ children }) {
|
|
|
16
22
|
* **swipe-down to close** (handle only). By default it does NOT close on backdrop tap
|
|
17
23
|
* (`dismissOnBackdrop`). No provider or native deps. Import via subpath `Dialog/Sheet`.
|
|
18
24
|
*/
|
|
19
|
-
function Sheet({ visible, onClose, children, title, maxHeightRatio = 0.9, dismissOnBackdrop = false, testID, }) {
|
|
25
|
+
function Sheet({ visible, onClose, children, title, maxHeightRatio = 0.9, dismissOnBackdrop = false, showCloseButton = false, accessibleSizing = false, testID, }) {
|
|
26
|
+
const theme = useTheme();
|
|
20
27
|
const insets = useSafeAreaInsets();
|
|
21
28
|
const translateY = useRef(new Animated.Value(800)).current;
|
|
22
29
|
const onCloseRef = useRef(onClose);
|
|
23
|
-
// eslint-disable-next-line react-hooks/refs
|
|
24
30
|
onCloseRef.current = onClose;
|
|
25
31
|
useEffect(() => {
|
|
26
32
|
if (visible) {
|
|
@@ -35,7 +41,6 @@ function Sheet({ visible, onClose, children, title, maxHeightRatio = 0.9, dismis
|
|
|
35
41
|
translateY.setValue(800);
|
|
36
42
|
}
|
|
37
43
|
}, [visible, translateY]);
|
|
38
|
-
// eslint-disable-next-line react-hooks/refs
|
|
39
44
|
const [pan] = useState(() => PanResponder.create({
|
|
40
45
|
onStartShouldSetPanResponder: () => true,
|
|
41
46
|
onMoveShouldSetPanResponder: (_, g) => g.dy > 2,
|
|
@@ -56,11 +61,14 @@ function Sheet({ visible, onClose, children, title, maxHeightRatio = 0.9, dismis
|
|
|
56
61
|
}
|
|
57
62
|
},
|
|
58
63
|
}));
|
|
59
|
-
return (_jsx(Modal, { animationType: "none", onRequestClose: onClose, presentationStyle: "overFullScreen", transparent: true, visible: visible, children: _jsxs(View, { className: "flex-1 justify-end", testID: testID, children: [_jsx(View, { className: "absolute inset-0 bg-black/50", onResponderRelease: dismissOnBackdrop ? onClose : undefined, onStartShouldSetResponder: () => dismissOnBackdrop }), _jsxs(Animated.View, { className: "rounded-t-3xl", style:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
return (_jsx(Modal, { animationType: "none", onRequestClose: onClose, presentationStyle: "overFullScreen", transparent: true, visible: visible, children: _jsxs(View, { className: "flex-1 justify-end", testID: testID, children: [_jsx(View, { className: "absolute inset-0 bg-black/50", onResponderRelease: dismissOnBackdrop ? onClose : undefined, onStartShouldSetResponder: () => dismissOnBackdrop }), _jsxs(Animated.View, { accessibilityViewIsModal: true, className: "rounded-t-3xl", importantForAccessibility: "yes", onAccessibilityEscape: onClose, style: [
|
|
65
|
+
vars(themeToVars(theme)),
|
|
66
|
+
{
|
|
67
|
+
backgroundColor: theme.bg.card,
|
|
68
|
+
paddingBottom: insets.bottom + 12,
|
|
69
|
+
maxHeight: `${Math.round(maxHeightRatio * 100)}%`,
|
|
70
|
+
transform: [{ translateY }],
|
|
71
|
+
},
|
|
72
|
+
], children: [_jsx(View, { accessibilityElementsHidden: true, className: "items-center pt-3 pb-2", ...pan.panHandlers, children: _jsx(View, { className: "w-12 h-1.5 rounded-full bg-border-strong" }) }), title || showCloseButton ? (_jsxs(View, { className: "flex-row items-center px-4 pb-1", children: [title ? (_jsx(Typography.Text, { accessibilityRole: "header", className: "flex-1 text-text-primary", semibold: true, variant: "subtitle", children: title })) : null, showCloseButton ? (_jsx(Pressable, { accessibilityLabel: "Cerrar", accessibilityRole: "button", className: "items-center justify-center rounded-lg", hitSlop: 8, onPress: onClose, style: accessibleSizing ? { minWidth: 48, minHeight: 48 } : undefined, children: _jsx(Typography.Text, { className: "text-text-accent", variant: "bodySmall", children: "Cerrar" }) })) : null] })) : null, _jsx(ScrollView, { contentContainerStyle: { paddingHorizontal: 16, paddingTop: 4 }, children: children })] })] }) }));
|
|
65
73
|
}
|
|
66
74
|
export default Sheet;
|
package/dist/Dialog/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BottomSheet } from "
|
|
2
|
-
import { ConfirmationProvider, useConfirmationContext } from "
|
|
3
|
-
import ActionSheet from "
|
|
4
|
-
import EditValue, { type EditableValueModalChip, type EditableValueModalProps } from "
|
|
1
|
+
import { BottomSheet } from "./BottomSheet/index.js";
|
|
2
|
+
import { ConfirmationProvider, useConfirmationContext } from "./Confirmation.context.js";
|
|
3
|
+
import ActionSheet from "./Dialog.ActionSheet.js";
|
|
4
|
+
import EditValue, { type EditableValueModalChip, type EditableValueModalProps } from "./Dialog.EditValue.js";
|
|
5
5
|
export declare const Dialog: {
|
|
6
|
-
Confirmation: import("react").FC<import("
|
|
6
|
+
Confirmation: import("react").FC<import("./Dialog.Confirmation.js").Props>;
|
|
7
7
|
BottomSheet: {
|
|
8
8
|
Root: ({ visible, onClose, size, dismissible, children }: import("./BottomSheet/BottomSheet.Root").RootProps) => import("react").JSX.Element;
|
|
9
9
|
Handle: ({ children }: import("./BottomSheet/BottomSheet.Root").HandleProps) => import("react").JSX.Element;
|
package/dist/Dialog/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { BottomSheet } from "
|
|
2
|
-
import { ConfirmationProvider, useConfirmationContext, } from "
|
|
3
|
-
import ActionSheet from "
|
|
4
|
-
import Confirmation from "
|
|
5
|
-
import EditValue from "
|
|
1
|
+
import { BottomSheet } from "./BottomSheet/index.js";
|
|
2
|
+
import { ConfirmationProvider, useConfirmationContext, } from "./Confirmation.context.js";
|
|
3
|
+
import ActionSheet from "./Dialog.ActionSheet.js";
|
|
4
|
+
import Confirmation from "./Dialog.Confirmation.js";
|
|
5
|
+
import EditValue from "./Dialog.EditValue.js";
|
|
6
6
|
export const Dialog = {
|
|
7
7
|
Confirmation,
|
|
8
8
|
BottomSheet,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
-
import Icon from "
|
|
3
|
-
import Pressable from "../primitives/Pressable";
|
|
4
|
-
import { theme } from "../theme";
|
|
5
|
-
import { cn } from "../theme/tw";
|
|
6
|
-
import { Typography } from "../Typography";
|
|
2
|
+
import Icon from "./Display.Icon.js";
|
|
3
|
+
import Pressable from "../primitives/Pressable.js";
|
|
4
|
+
import { theme } from "../theme/index.js";
|
|
5
|
+
import { cn } from "../theme/tw.js";
|
|
6
|
+
import { Typography } from "../Typography/index.js";
|
|
7
7
|
import { useState } from "react";
|
|
8
8
|
import { LayoutAnimation, View } from "react-native";
|
|
9
9
|
function AccordionItem({ title, children, defaultOpen = false, className, testID, }) {
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import { type VariantProps } from "../theme/tw";
|
|
1
|
+
import { type VariantProps } from "../theme/tw.js";
|
|
2
2
|
import { FC } from "react";
|
|
3
3
|
declare const avatar: import("tailwind-variants").TVReturnType<{
|
|
4
4
|
size: {
|
|
5
|
-
small:
|
|
6
|
-
medium:
|
|
7
|
-
large:
|
|
8
|
-
xlarge:
|
|
5
|
+
small: "w-8 h-8";
|
|
6
|
+
medium: "w-10 h-10";
|
|
7
|
+
large: "w-12 h-12";
|
|
8
|
+
xlarge: "w-16 h-16";
|
|
9
9
|
};
|
|
10
10
|
colorScheme: {
|
|
11
|
-
default:
|
|
12
|
-
primary:
|
|
13
|
-
secondary:
|
|
14
|
-
success:
|
|
15
|
-
warning:
|
|
11
|
+
default: "bg-bg-hover";
|
|
12
|
+
primary: "bg-primary/20";
|
|
13
|
+
secondary: "bg-secondary/20";
|
|
14
|
+
success: "bg-success-light";
|
|
15
|
+
warning: "bg-warning-light";
|
|
16
16
|
};
|
|
17
17
|
}, undefined, "justify-center items-center rounded-full shadow-sm", {
|
|
18
18
|
size: {
|
|
19
|
-
small:
|
|
20
|
-
medium:
|
|
21
|
-
large:
|
|
22
|
-
xlarge:
|
|
19
|
+
small: "w-8 h-8";
|
|
20
|
+
medium: "w-10 h-10";
|
|
21
|
+
large: "w-12 h-12";
|
|
22
|
+
xlarge: "w-16 h-16";
|
|
23
23
|
};
|
|
24
24
|
colorScheme: {
|
|
25
|
-
default:
|
|
26
|
-
primary:
|
|
27
|
-
secondary:
|
|
28
|
-
success:
|
|
29
|
-
warning:
|
|
25
|
+
default: "bg-bg-hover";
|
|
26
|
+
primary: "bg-primary/20";
|
|
27
|
+
secondary: "bg-secondary/20";
|
|
28
|
+
success: "bg-success-light";
|
|
29
|
+
warning: "bg-warning-light";
|
|
30
30
|
};
|
|
31
|
-
}, undefined, import("tailwind-variants").
|
|
31
|
+
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
32
32
|
size: {
|
|
33
|
-
small:
|
|
34
|
-
medium:
|
|
35
|
-
large:
|
|
36
|
-
xlarge:
|
|
33
|
+
small: "w-8 h-8";
|
|
34
|
+
medium: "w-10 h-10";
|
|
35
|
+
large: "w-12 h-12";
|
|
36
|
+
xlarge: "w-16 h-16";
|
|
37
37
|
};
|
|
38
38
|
colorScheme: {
|
|
39
|
-
default:
|
|
40
|
-
primary:
|
|
41
|
-
secondary:
|
|
42
|
-
success:
|
|
43
|
-
warning:
|
|
39
|
+
default: "bg-bg-hover";
|
|
40
|
+
primary: "bg-primary/20";
|
|
41
|
+
secondary: "bg-secondary/20";
|
|
42
|
+
success: "bg-success-light";
|
|
43
|
+
warning: "bg-warning-light";
|
|
44
44
|
};
|
|
45
|
-
}, undefined
|
|
45
|
+
}, undefined>>;
|
|
46
46
|
export interface AvatarProps extends Omit<VariantProps<typeof avatar>, "size"> {
|
|
47
47
|
initials: string;
|
|
48
48
|
size?: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
2
|
-
import { cn, tv } from "../theme/tw";
|
|
3
|
-
import { Typography } from "../Typography";
|
|
2
|
+
import { cn, tv } from "../theme/tw.js";
|
|
3
|
+
import { Typography } from "../Typography/index.js";
|
|
4
4
|
import { View } from "react-native";
|
|
5
5
|
const avatar = tv({
|
|
6
6
|
base: "justify-center items-center rounded-full shadow-sm",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
-
import Avatar from "
|
|
3
|
-
import { theme } from "../theme";
|
|
4
|
-
import { Typography } from "../Typography";
|
|
2
|
+
import Avatar from "./Display.Avatar.js";
|
|
3
|
+
import { theme } from "../theme/index.js";
|
|
4
|
+
import { Typography } from "../Typography/index.js";
|
|
5
5
|
import { View } from "react-native";
|
|
6
6
|
function AvatarGroup({ items, max = 4, size = 36, className, testID }) {
|
|
7
7
|
const visible = items.slice(0, max);
|