@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,134 +1,135 @@
|
|
|
1
|
-
import { type VariantProps } from "../theme/tw";
|
|
1
|
+
import { type VariantProps } from "../theme/tw.js";
|
|
2
2
|
import type React from "react";
|
|
3
|
+
import type { AccessibilityProps } from "react-native";
|
|
3
4
|
declare const button: import("tailwind-variants").TVReturnType<{
|
|
4
5
|
variant: {
|
|
5
|
-
primary:
|
|
6
|
-
accent:
|
|
7
|
-
cta:
|
|
8
|
-
secondary:
|
|
9
|
-
outline:
|
|
10
|
-
outlineDanger:
|
|
11
|
-
outlineBlack:
|
|
12
|
-
flat:
|
|
13
|
-
link:
|
|
14
|
-
transparent:
|
|
6
|
+
primary: "bg-accent";
|
|
7
|
+
accent: "bg-transparent";
|
|
8
|
+
cta: "bg-accent";
|
|
9
|
+
secondary: "bg-bg-muted border border-border-strong";
|
|
10
|
+
outline: "bg-transparent border border-primary";
|
|
11
|
+
outlineDanger: "bg-transparent border border-danger";
|
|
12
|
+
outlineBlack: "bg-transparent border border-border-strong";
|
|
13
|
+
flat: "bg-text-primary/10";
|
|
14
|
+
link: "bg-transparent min-h-0";
|
|
15
|
+
transparent: "bg-transparent border border-border-light";
|
|
15
16
|
};
|
|
16
17
|
size: {
|
|
17
|
-
small:
|
|
18
|
-
medium:
|
|
19
|
-
large:
|
|
18
|
+
small: "py-1.5 px-3 min-h-[36px]";
|
|
19
|
+
medium: "py-2.5 px-4 min-h-[44px]";
|
|
20
|
+
large: "py-3 px-5 min-h-[48px]";
|
|
20
21
|
};
|
|
21
22
|
disabled: {
|
|
22
|
-
true:
|
|
23
|
+
true: "opacity-70";
|
|
23
24
|
};
|
|
24
|
-
}, undefined, "rounded-
|
|
25
|
+
}, undefined, "rounded-md items-center justify-center flex-row min-h-[44px]", {
|
|
25
26
|
variant: {
|
|
26
|
-
primary:
|
|
27
|
-
accent:
|
|
28
|
-
cta:
|
|
29
|
-
secondary:
|
|
30
|
-
outline:
|
|
31
|
-
outlineDanger:
|
|
32
|
-
outlineBlack:
|
|
33
|
-
flat:
|
|
34
|
-
link:
|
|
35
|
-
transparent:
|
|
27
|
+
primary: "bg-accent";
|
|
28
|
+
accent: "bg-transparent";
|
|
29
|
+
cta: "bg-accent";
|
|
30
|
+
secondary: "bg-bg-muted border border-border-strong";
|
|
31
|
+
outline: "bg-transparent border border-primary";
|
|
32
|
+
outlineDanger: "bg-transparent border border-danger";
|
|
33
|
+
outlineBlack: "bg-transparent border border-border-strong";
|
|
34
|
+
flat: "bg-text-primary/10";
|
|
35
|
+
link: "bg-transparent min-h-0";
|
|
36
|
+
transparent: "bg-transparent border border-border-light";
|
|
36
37
|
};
|
|
37
38
|
size: {
|
|
38
|
-
small:
|
|
39
|
-
medium:
|
|
40
|
-
large:
|
|
39
|
+
small: "py-1.5 px-3 min-h-[36px]";
|
|
40
|
+
medium: "py-2.5 px-4 min-h-[44px]";
|
|
41
|
+
large: "py-3 px-5 min-h-[48px]";
|
|
41
42
|
};
|
|
42
43
|
disabled: {
|
|
43
|
-
true:
|
|
44
|
+
true: "opacity-70";
|
|
44
45
|
};
|
|
45
|
-
}, undefined, import("tailwind-variants").
|
|
46
|
+
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
46
47
|
variant: {
|
|
47
|
-
primary:
|
|
48
|
-
accent:
|
|
49
|
-
cta:
|
|
50
|
-
secondary:
|
|
51
|
-
outline:
|
|
52
|
-
outlineDanger:
|
|
53
|
-
outlineBlack:
|
|
54
|
-
flat:
|
|
55
|
-
link:
|
|
56
|
-
transparent:
|
|
48
|
+
primary: "bg-accent";
|
|
49
|
+
accent: "bg-transparent";
|
|
50
|
+
cta: "bg-accent";
|
|
51
|
+
secondary: "bg-bg-muted border border-border-strong";
|
|
52
|
+
outline: "bg-transparent border border-primary";
|
|
53
|
+
outlineDanger: "bg-transparent border border-danger";
|
|
54
|
+
outlineBlack: "bg-transparent border border-border-strong";
|
|
55
|
+
flat: "bg-text-primary/10";
|
|
56
|
+
link: "bg-transparent min-h-0";
|
|
57
|
+
transparent: "bg-transparent border border-border-light";
|
|
57
58
|
};
|
|
58
59
|
size: {
|
|
59
|
-
small:
|
|
60
|
-
medium:
|
|
61
|
-
large:
|
|
60
|
+
small: "py-1.5 px-3 min-h-[36px]";
|
|
61
|
+
medium: "py-2.5 px-4 min-h-[44px]";
|
|
62
|
+
large: "py-3 px-5 min-h-[48px]";
|
|
62
63
|
};
|
|
63
64
|
disabled: {
|
|
64
|
-
true:
|
|
65
|
+
true: "opacity-70";
|
|
65
66
|
};
|
|
66
|
-
}, undefined
|
|
67
|
+
}, undefined>>;
|
|
67
68
|
declare const buttonIcon: import("tailwind-variants").TVReturnType<{
|
|
68
69
|
variant: {
|
|
69
|
-
primary:
|
|
70
|
-
accent:
|
|
71
|
-
cta:
|
|
72
|
-
secondary:
|
|
73
|
-
outline:
|
|
74
|
-
outlineDanger:
|
|
75
|
-
outlineBlack:
|
|
76
|
-
flat:
|
|
77
|
-
link:
|
|
78
|
-
transparent:
|
|
70
|
+
primary: "bg-accent";
|
|
71
|
+
accent: "bg-transparent";
|
|
72
|
+
cta: "bg-accent";
|
|
73
|
+
secondary: "bg-bg-muted border border-border-strong";
|
|
74
|
+
outline: "bg-transparent border border-primary";
|
|
75
|
+
outlineDanger: "bg-transparent border border-danger";
|
|
76
|
+
outlineBlack: "bg-transparent border border-border-strong";
|
|
77
|
+
flat: "bg-text-primary/10";
|
|
78
|
+
link: "bg-transparent";
|
|
79
|
+
transparent: "bg-transparent border border-border-light";
|
|
79
80
|
};
|
|
80
81
|
size: {
|
|
81
|
-
small:
|
|
82
|
-
medium:
|
|
83
|
-
large:
|
|
82
|
+
small: "w-9 h-9";
|
|
83
|
+
medium: "w-11 h-11";
|
|
84
|
+
large: "w-[52px] h-[52px]";
|
|
84
85
|
};
|
|
85
86
|
disabled: {
|
|
86
|
-
true:
|
|
87
|
+
true: "opacity-70";
|
|
87
88
|
};
|
|
88
|
-
}, undefined, "rounded-
|
|
89
|
+
}, undefined, "rounded-md items-center justify-center aspect-square", {
|
|
89
90
|
variant: {
|
|
90
|
-
primary:
|
|
91
|
-
accent:
|
|
92
|
-
cta:
|
|
93
|
-
secondary:
|
|
94
|
-
outline:
|
|
95
|
-
outlineDanger:
|
|
96
|
-
outlineBlack:
|
|
97
|
-
flat:
|
|
98
|
-
link:
|
|
99
|
-
transparent:
|
|
91
|
+
primary: "bg-accent";
|
|
92
|
+
accent: "bg-transparent";
|
|
93
|
+
cta: "bg-accent";
|
|
94
|
+
secondary: "bg-bg-muted border border-border-strong";
|
|
95
|
+
outline: "bg-transparent border border-primary";
|
|
96
|
+
outlineDanger: "bg-transparent border border-danger";
|
|
97
|
+
outlineBlack: "bg-transparent border border-border-strong";
|
|
98
|
+
flat: "bg-text-primary/10";
|
|
99
|
+
link: "bg-transparent";
|
|
100
|
+
transparent: "bg-transparent border border-border-light";
|
|
100
101
|
};
|
|
101
102
|
size: {
|
|
102
|
-
small:
|
|
103
|
-
medium:
|
|
104
|
-
large:
|
|
103
|
+
small: "w-9 h-9";
|
|
104
|
+
medium: "w-11 h-11";
|
|
105
|
+
large: "w-[52px] h-[52px]";
|
|
105
106
|
};
|
|
106
107
|
disabled: {
|
|
107
|
-
true:
|
|
108
|
+
true: "opacity-70";
|
|
108
109
|
};
|
|
109
|
-
}, undefined, import("tailwind-variants").
|
|
110
|
+
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
110
111
|
variant: {
|
|
111
|
-
primary:
|
|
112
|
-
accent:
|
|
113
|
-
cta:
|
|
114
|
-
secondary:
|
|
115
|
-
outline:
|
|
116
|
-
outlineDanger:
|
|
117
|
-
outlineBlack:
|
|
118
|
-
flat:
|
|
119
|
-
link:
|
|
120
|
-
transparent:
|
|
112
|
+
primary: "bg-accent";
|
|
113
|
+
accent: "bg-transparent";
|
|
114
|
+
cta: "bg-accent";
|
|
115
|
+
secondary: "bg-bg-muted border border-border-strong";
|
|
116
|
+
outline: "bg-transparent border border-primary";
|
|
117
|
+
outlineDanger: "bg-transparent border border-danger";
|
|
118
|
+
outlineBlack: "bg-transparent border border-border-strong";
|
|
119
|
+
flat: "bg-text-primary/10";
|
|
120
|
+
link: "bg-transparent";
|
|
121
|
+
transparent: "bg-transparent border border-border-light";
|
|
121
122
|
};
|
|
122
123
|
size: {
|
|
123
|
-
small:
|
|
124
|
-
medium:
|
|
125
|
-
large:
|
|
124
|
+
small: "w-9 h-9";
|
|
125
|
+
medium: "w-11 h-11";
|
|
126
|
+
large: "w-[52px] h-[52px]";
|
|
126
127
|
};
|
|
127
128
|
disabled: {
|
|
128
|
-
true:
|
|
129
|
+
true: "opacity-70";
|
|
129
130
|
};
|
|
130
|
-
}, undefined
|
|
131
|
-
export interface ButtonProps extends VariantProps<typeof button
|
|
131
|
+
}, undefined>>;
|
|
132
|
+
export interface ButtonProps extends VariantProps<typeof button>, AccessibilityProps {
|
|
132
133
|
title: string;
|
|
133
134
|
onPress?: () => void;
|
|
134
135
|
confirm?: string;
|
|
@@ -136,14 +137,18 @@ export interface ButtonProps extends VariantProps<typeof button> {
|
|
|
136
137
|
disabled?: boolean;
|
|
137
138
|
className?: string;
|
|
138
139
|
icon?: React.ReactNode;
|
|
140
|
+
testID?: string;
|
|
141
|
+
accessibleSizing?: boolean;
|
|
139
142
|
}
|
|
140
|
-
export interface ButtonIconProps extends VariantProps<typeof buttonIcon
|
|
143
|
+
export interface ButtonIconProps extends VariantProps<typeof buttonIcon>, AccessibilityProps {
|
|
141
144
|
icon: string;
|
|
142
145
|
onPress?: () => void;
|
|
143
146
|
confirm?: string;
|
|
144
147
|
loading?: boolean;
|
|
145
148
|
disabled?: boolean;
|
|
146
149
|
className?: string;
|
|
150
|
+
testID?: string;
|
|
151
|
+
accessibleSizing?: boolean;
|
|
147
152
|
}
|
|
148
153
|
declare const ButtonWithIcon: React.FC<ButtonProps> & {
|
|
149
154
|
Icon: React.FC<ButtonIconProps>;
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
-
import { useConfirmationContext } from "../Dialog/Confirmation.context";
|
|
3
|
-
import Icon from "../Display/Display.Icon";
|
|
4
|
-
import { theme } from "../theme";
|
|
5
|
-
import { tv } from "../theme/tw";
|
|
6
|
-
import { Typography } from "../Typography";
|
|
7
|
-
import { LinearGradient } from "expo-linear-gradient";
|
|
2
|
+
import { useConfirmationContext } from "../Dialog/Confirmation.context.js";
|
|
3
|
+
import Icon from "../Display/Display.Icon.js";
|
|
4
|
+
import { theme } from "../theme/index.js";
|
|
5
|
+
import { tv } from "../theme/tw.js";
|
|
6
|
+
import { Typography } from "../Typography/index.js";
|
|
8
7
|
import { useCallback } from "react";
|
|
9
8
|
import { ActivityIndicator, TouchableOpacity, View } from "react-native";
|
|
10
|
-
import { runOnJS } from "react-native-reanimated";
|
|
11
9
|
// ─── Style variants ───────────────────────────────────────────────────────────
|
|
12
10
|
const button = tv({
|
|
13
|
-
base: "rounded-
|
|
11
|
+
base: "rounded-md items-center justify-center flex-row min-h-[44px]",
|
|
14
12
|
variants: {
|
|
15
13
|
variant: {
|
|
16
|
-
primary: "
|
|
17
|
-
accent: "
|
|
18
|
-
cta: "
|
|
19
|
-
secondary: "bg-bg-muted",
|
|
14
|
+
primary: "bg-accent",
|
|
15
|
+
accent: "bg-transparent",
|
|
16
|
+
cta: "bg-accent",
|
|
17
|
+
secondary: "bg-bg-muted border border-border-strong",
|
|
20
18
|
outline: "bg-transparent border border-primary",
|
|
21
19
|
outlineDanger: "bg-transparent border border-danger",
|
|
22
20
|
outlineBlack: "bg-transparent border border-border-strong",
|
|
@@ -39,13 +37,13 @@ const button = tv({
|
|
|
39
37
|
},
|
|
40
38
|
});
|
|
41
39
|
const buttonIcon = tv({
|
|
42
|
-
base: "rounded-
|
|
40
|
+
base: "rounded-md items-center justify-center aspect-square",
|
|
43
41
|
variants: {
|
|
44
42
|
variant: {
|
|
45
|
-
primary: "
|
|
46
|
-
accent: "
|
|
47
|
-
cta: "
|
|
48
|
-
secondary: "bg-bg-muted",
|
|
43
|
+
primary: "bg-accent",
|
|
44
|
+
accent: "bg-transparent",
|
|
45
|
+
cta: "bg-accent",
|
|
46
|
+
secondary: "bg-bg-muted border border-border-strong",
|
|
49
47
|
outline: "bg-transparent border border-primary",
|
|
50
48
|
outlineDanger: "bg-transparent border border-danger",
|
|
51
49
|
outlineBlack: "bg-transparent border border-border-strong",
|
|
@@ -70,26 +68,26 @@ const buttonIcon = tv({
|
|
|
70
68
|
const textColor = tv({
|
|
71
69
|
variants: {
|
|
72
70
|
variant: {
|
|
73
|
-
primary: "text-
|
|
74
|
-
accent: "text-text-
|
|
71
|
+
primary: "text-text-on-accent",
|
|
72
|
+
accent: "text-text-accent",
|
|
75
73
|
cta: "text-text-on-accent",
|
|
76
74
|
secondary: "text-text-primary",
|
|
77
|
-
outline: "text-
|
|
75
|
+
outline: "text-text-accent",
|
|
78
76
|
outlineDanger: "text-danger",
|
|
79
77
|
outlineBlack: "text-text-primary",
|
|
80
78
|
flat: "text-text-primary",
|
|
81
|
-
link: "text-
|
|
82
|
-
transparent: "text-
|
|
79
|
+
link: "text-text-accent",
|
|
80
|
+
transparent: "text-text-inverse",
|
|
83
81
|
},
|
|
84
82
|
disabled: {
|
|
85
83
|
true: "opacity-50",
|
|
86
84
|
},
|
|
87
85
|
},
|
|
88
86
|
compoundVariants: [
|
|
89
|
-
{ variant: "primary", disabled: true, className: "text-
|
|
90
|
-
{ variant: "accent", disabled: true, className: "text-text-
|
|
87
|
+
{ variant: "primary", disabled: true, className: "text-text-on-accent" },
|
|
88
|
+
{ variant: "accent", disabled: true, className: "text-text-accent" },
|
|
91
89
|
{ variant: "cta", disabled: true, className: "text-text-on-accent" },
|
|
92
|
-
{ variant: "transparent", disabled: true, className: "text-
|
|
90
|
+
{ variant: "transparent", disabled: true, className: "text-text-inverse/70" },
|
|
93
91
|
{
|
|
94
92
|
variant: ["secondary", "outline", "link"],
|
|
95
93
|
disabled: true,
|
|
@@ -104,15 +102,15 @@ const textColor = tv({
|
|
|
104
102
|
// ─── Color / size helpers ─────────────────────────────────────────────────────
|
|
105
103
|
function getLoadingColor(variant) {
|
|
106
104
|
const map = {
|
|
107
|
-
primary: theme.text.
|
|
108
|
-
accent: theme.text.
|
|
109
|
-
cta: theme.text.
|
|
105
|
+
primary: theme.text.onAccent,
|
|
106
|
+
accent: theme.text.accent,
|
|
107
|
+
cta: theme.text.onAccent,
|
|
110
108
|
secondary: theme.text.primary,
|
|
111
|
-
outline: theme.
|
|
109
|
+
outline: theme.text.accent,
|
|
112
110
|
outlineDanger: theme.danger,
|
|
113
111
|
outlineBlack: theme.text.primary,
|
|
114
112
|
flat: theme.text.primary,
|
|
115
|
-
link: theme.
|
|
113
|
+
link: theme.text.accent,
|
|
116
114
|
transparent: theme.text.inverse,
|
|
117
115
|
};
|
|
118
116
|
return map[variant] ?? theme.text.inverse;
|
|
@@ -120,8 +118,8 @@ function getLoadingColor(variant) {
|
|
|
120
118
|
function getIconColor(variant, disabled) {
|
|
121
119
|
if (disabled) {
|
|
122
120
|
const map = {
|
|
123
|
-
primary: theme.
|
|
124
|
-
accent: theme.text.
|
|
121
|
+
primary: theme.text.onAccent + "70",
|
|
122
|
+
accent: theme.text.accent + "70",
|
|
125
123
|
cta: theme.text.onAccent + "70",
|
|
126
124
|
secondary: theme.text.disabled,
|
|
127
125
|
outline: theme.icon.disabled,
|
|
@@ -134,15 +132,15 @@ function getIconColor(variant, disabled) {
|
|
|
134
132
|
return map[variant] ?? theme.icon.disabled;
|
|
135
133
|
}
|
|
136
134
|
const map = {
|
|
137
|
-
primary: theme.
|
|
138
|
-
accent: theme.text.
|
|
135
|
+
primary: theme.text.onAccent,
|
|
136
|
+
accent: theme.text.accent,
|
|
139
137
|
cta: theme.text.onAccent,
|
|
140
138
|
secondary: theme.text.primary,
|
|
141
|
-
outline: theme.
|
|
139
|
+
outline: theme.text.accent,
|
|
142
140
|
outlineDanger: theme.danger,
|
|
143
141
|
outlineBlack: theme.text.primary,
|
|
144
142
|
flat: theme.text.primary,
|
|
145
|
-
link: theme.
|
|
143
|
+
link: theme.text.accent,
|
|
146
144
|
transparent: theme.icon.inverse,
|
|
147
145
|
};
|
|
148
146
|
return map[variant] ?? theme.icon.inverse;
|
|
@@ -153,7 +151,7 @@ const textVariantMap = {
|
|
|
153
151
|
medium: "button",
|
|
154
152
|
large: "buttonLarge",
|
|
155
153
|
};
|
|
156
|
-
const Button = ({ title, onPress, confirm, variant = "primary", size = "medium", loading = false, disabled = false, className, icon, }) => {
|
|
154
|
+
const Button = ({ title, onPress, confirm, variant = "primary", size = "medium", loading = false, disabled = false, className, icon, testID, accessibleSizing = false, accessibilityLabel, accessibilityState, ...accessibilityProps }) => {
|
|
157
155
|
const { show, hide } = useConfirmationContext();
|
|
158
156
|
const textColorClass = textColor({ variant: variant, disabled });
|
|
159
157
|
const loadingColorValue = getLoadingColor(variant);
|
|
@@ -167,25 +165,32 @@ const Button = ({ title, onPress, confirm, variant = "primary", size = "medium",
|
|
|
167
165
|
cancelText: "Cancelar",
|
|
168
166
|
onConfirm: () => {
|
|
169
167
|
hide();
|
|
170
|
-
|
|
168
|
+
onPress();
|
|
171
169
|
},
|
|
172
170
|
onCancel: () => hide(),
|
|
173
171
|
});
|
|
174
172
|
}
|
|
175
173
|
else if (onPress) {
|
|
176
|
-
|
|
174
|
+
onPress();
|
|
177
175
|
}
|
|
178
176
|
}, [onPress, confirm, show, hide]);
|
|
179
177
|
if (variant === "link") {
|
|
180
|
-
return (_jsx(TouchableOpacity, { activeOpacity: 0.7, className: className, disabled: disabled || loading, onPress: handlePress,
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
178
|
+
return (_jsx(TouchableOpacity, { activeOpacity: 0.7, className: className, disabled: disabled || loading, onPress: handlePress, ...accessibilityProps, accessibilityLabel: accessibilityLabel ?? title, accessibilityRole: "button", accessibilityState: {
|
|
179
|
+
...accessibilityState,
|
|
180
|
+
disabled: disabled || loading,
|
|
181
|
+
busy: loading,
|
|
182
|
+
}, style: accessibleSizing
|
|
183
|
+
? { minHeight: 48, minWidth: 48, justifyContent: "center" }
|
|
184
|
+
: undefined, testID: testID, children: loading ? (_jsx(ActivityIndicator, { color: loadingColorValue, size: "small" })) : (_jsx(Typography.Text, { className: textColorClass, variant: textVariantValue, children: title })) }));
|
|
185
185
|
}
|
|
186
|
-
|
|
186
|
+
const emphasize = variant === "primary" || variant === "cta";
|
|
187
|
+
return (_jsx(TouchableOpacity, { activeOpacity: 0.8, className: button({ variant, size, disabled, className }), disabled: disabled || loading, onPress: handlePress, ...accessibilityProps, accessibilityLabel: accessibilityLabel ?? title, accessibilityRole: "button", accessibilityState: {
|
|
188
|
+
...accessibilityState,
|
|
189
|
+
disabled: disabled || loading,
|
|
190
|
+
busy: loading,
|
|
191
|
+
}, style: accessibleSizing ? { minHeight: 48, minWidth: 48 } : undefined, testID: testID, children: loading ? (_jsx(ActivityIndicator, { color: loadingColorValue, size: "small" })) : (_jsxs(_Fragment, { children: [icon ? _jsx(View, { className: "mr-2", children: icon }) : null, _jsx(Typography.Text, { allowFontScaling: accessibleSizing, className: textColorClass, ellipsizeMode: "tail", numberOfLines: accessibleSizing ? undefined : 1, semibold: emphasize, variant: textVariantValue, children: title })] })) }));
|
|
187
192
|
};
|
|
188
|
-
const ButtonIcon = ({ icon, onPress, confirm, variant = "primary", size = "medium", loading = false, disabled = false, className, }) => {
|
|
193
|
+
const ButtonIcon = ({ icon, onPress, confirm, variant = "primary", size = "medium", loading = false, disabled = false, className, testID, accessibleSizing = false, accessibilityState, ...accessibilityProps }) => {
|
|
189
194
|
const { show, hide } = useConfirmationContext();
|
|
190
195
|
const iconColorValue = getIconColor(variant, disabled);
|
|
191
196
|
const iconSizeValue = iconSizeMap[size] ?? 20;
|
|
@@ -199,19 +204,20 @@ const ButtonIcon = ({ icon, onPress, confirm, variant = "primary", size = "mediu
|
|
|
199
204
|
cancelText: "Cancelar",
|
|
200
205
|
onConfirm: () => {
|
|
201
206
|
hide();
|
|
202
|
-
|
|
207
|
+
onPress();
|
|
203
208
|
},
|
|
204
209
|
onCancel: () => hide(),
|
|
205
210
|
});
|
|
206
211
|
}
|
|
207
212
|
else if (onPress) {
|
|
208
|
-
|
|
213
|
+
onPress();
|
|
209
214
|
}
|
|
210
215
|
}, [onPress, confirm, show, hide]);
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
216
|
+
return (_jsx(TouchableOpacity, { activeOpacity: 0.8, className: buttonIcon({ variant, size, disabled, className }), disabled: disabled || loading, onPress: handlePress, ...accessibilityProps, accessibilityRole: "button", accessibilityState: {
|
|
217
|
+
...accessibilityState,
|
|
218
|
+
disabled: disabled || loading,
|
|
219
|
+
busy: loading,
|
|
220
|
+
}, style: accessibleSizing ? { minHeight: 48, minWidth: 48 } : undefined, testID: testID, children: loading ? (_jsx(ActivityIndicator, { color: loadingColorValue, size: "small" })) : (_jsx(Icon, { color: iconColorValue, name: icon, size: iconSizeValue })) }));
|
|
215
221
|
};
|
|
216
222
|
const ButtonWithIcon = Object.assign(Button, { Icon: ButtonIcon });
|
|
217
223
|
export default ButtonWithIcon;
|
|
@@ -5,6 +5,8 @@ export interface FABProps {
|
|
|
5
5
|
position?: "bottom-right" | "bottom-left";
|
|
6
6
|
className?: string;
|
|
7
7
|
testID?: string;
|
|
8
|
+
accessibilityLabel?: string;
|
|
9
|
+
accessibleSizing?: boolean;
|
|
8
10
|
}
|
|
9
|
-
declare function FAB({ icon, onPress, label, position, className, testID, }: FABProps): import("react").JSX.Element;
|
|
11
|
+
declare function FAB({ icon, onPress, label, position, className, testID, accessibilityLabel, accessibleSizing, }: FABProps): import("react").JSX.Element;
|
|
10
12
|
export default FAB;
|
|
@@ -1,17 +1,21 @@
|
|
|
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 { theme } from "../theme";
|
|
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 { theme } from "../theme/index.js";
|
|
5
|
+
import { cn } from "../theme/tw.js";
|
|
6
|
+
import { Typography } from "../Typography/index.js";
|
|
7
7
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
8
|
-
function FAB({ icon, onPress, label, position = "bottom-right", className, testID, }) {
|
|
8
|
+
function FAB({ icon, onPress, label, position = "bottom-right", className, testID, accessibilityLabel, accessibleSizing = false, }) {
|
|
9
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
|
|
10
|
+
return (_jsxs(Pressable, { accessibilityLabel: accessibilityLabel ?? label ?? "Acción", accessibilityRole: "button", className: cn("absolute flex-row items-center justify-center rounded-full bg-primary", label
|
|
11
|
+
? accessibleSizing
|
|
12
|
+
? "min-h-14 px-5 py-3 gap-2"
|
|
13
|
+
: "h-14 px-5 gap-2"
|
|
14
|
+
: "w-14 h-14", className), onPress: onPress, style: {
|
|
11
15
|
bottom: insets.bottom + 16,
|
|
12
16
|
right: position === "bottom-right" ? 16 : undefined,
|
|
13
17
|
left: position === "bottom-left" ? 16 : undefined,
|
|
14
18
|
...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] }));
|
|
19
|
+
}, testID: testID, children: [_jsx(Icon, { color: theme.icon.inverse, name: icon, size: 24 }), label ? (_jsx(Typography.Text, { className: "text-text-on-primary font-semibold", style: accessibleSizing ? { flexShrink: 1 } : undefined, children: label })) : null] }));
|
|
16
20
|
}
|
|
17
21
|
export default FAB;
|
|
@@ -3,8 +3,16 @@ export interface FilterButtonProps {
|
|
|
3
3
|
title: string;
|
|
4
4
|
active: boolean;
|
|
5
5
|
onPress: () => void;
|
|
6
|
+
variant?: "default" | "mobile";
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
testID?: string;
|
|
6
10
|
}
|
|
7
11
|
export declare const FilterButton: FC<FilterButtonProps>;
|
|
8
|
-
export
|
|
12
|
+
export interface FilterButtonGroupProps {
|
|
9
13
|
children: ReactNode;
|
|
10
|
-
|
|
14
|
+
layout?: "row" | "scroll" | "wrap";
|
|
15
|
+
className?: string;
|
|
16
|
+
testID?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function FilterButtonGroup({ children, layout, className, testID, }: FilterButtonGroupProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
+
import Icon from "../Display/Display.Icon.js";
|
|
3
|
+
import Pressable from "../primitives/Pressable.js";
|
|
4
|
+
import { useTheme } from "../theme/index.js";
|
|
5
|
+
import { cn, tv } from "../theme/tw.js";
|
|
6
|
+
import { Typography } from "../Typography/index.js";
|
|
7
|
+
import { ScrollView, TouchableOpacity, View } from "react-native";
|
|
5
8
|
const filterButton = tv({
|
|
6
9
|
base: "rounded-lg items-center justify-center py-2 px-3 min-h-[36px]",
|
|
7
10
|
variants: {
|
|
@@ -17,12 +20,24 @@ const filterText = tv({
|
|
|
17
20
|
variants: {
|
|
18
21
|
active: {
|
|
19
22
|
true: "text-white",
|
|
20
|
-
false: "text-
|
|
23
|
+
false: "text-text-accent",
|
|
21
24
|
},
|
|
22
25
|
},
|
|
23
26
|
defaultVariants: { active: false },
|
|
24
27
|
});
|
|
25
|
-
export const FilterButton = ({ title, active, onPress
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
export const FilterButton = ({ title, active, onPress, variant = "default", disabled = false, className, testID, }) => {
|
|
29
|
+
const theme = useTheme();
|
|
30
|
+
if (variant === "mobile") {
|
|
31
|
+
return (_jsxs(Pressable, { accessibilityLabel: title, accessibilityRole: "button", accessibilityState: { selected: active, disabled }, activeOpacity: 1 - theme.state.press, className: cn("flex-row items-center self-start rounded-full px-3 py-2 gap-2 max-w-full", active ? "bg-container-primary" : "bg-bg-muted", className), disabled: disabled, onPress: onPress, style: {
|
|
32
|
+
minHeight: 48,
|
|
33
|
+
minWidth: 48,
|
|
34
|
+
}, testID: testID, children: [active ? (_jsx(View, { accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", children: _jsx(Icon, { color: theme.container.onPrimary, name: "checkmark", size: 18 }) })) : null, _jsx(Typography.Text, { className: cn("flex-shrink", active ? "text-container-on-primary" : "text-text-primary"), variant: "bodyLarge", children: title })] }));
|
|
35
|
+
}
|
|
36
|
+
return (_jsx(TouchableOpacity, { accessibilityLabel: title, accessibilityRole: "button", accessibilityState: { selected: active, disabled }, activeOpacity: 0.8, className: filterButton({ active, className }), disabled: disabled, onPress: onPress, testID: testID, children: _jsx(Typography.Text, { className: filterText({ active }), variant: "buttonSmall", children: title }) }));
|
|
37
|
+
};
|
|
38
|
+
export function FilterButtonGroup({ children, layout = "row", className, testID, }) {
|
|
39
|
+
if (layout === "scroll") {
|
|
40
|
+
return (_jsx(ScrollView, { className: cn("py-1", className), contentContainerStyle: { gap: 8 }, horizontal: true, keyboardShouldPersistTaps: "handled", showsHorizontalScrollIndicator: false, testID: testID, children: children }));
|
|
41
|
+
}
|
|
42
|
+
return (_jsx(View, { className: cn("flex-row gap-2 p-3", layout === "wrap" && "flex-wrap", className), testID: testID, children: children }));
|
|
28
43
|
}
|