@sincpro/mobile-ui 0.2.1 → 0.3.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 +75 -20
- package/dist/Dialog/BottomSheet/BottomSheet.Root.d.ts +11 -7
- package/dist/Dialog/BottomSheet/BottomSheet.Root.js +4 -0
- package/dist/Dialog/Confirmation.context.d.ts +1 -1
- package/dist/Dialog/Dialog.ActionSheet.d.ts +17 -0
- package/dist/Dialog/Dialog.ActionSheet.js +16 -0
- package/dist/Dialog/Dialog.EditValue.d.ts +1 -1
- package/dist/Dialog/Dialog.Sheet.d.ts +26 -0
- package/dist/Dialog/Dialog.Sheet.js +55 -0
- package/dist/Dialog/index.d.ts +9 -7
- package/dist/Dialog/index.js +2 -0
- package/dist/Display/Display.Accordion.d.ts +18 -0
- package/dist/Display/Display.Accordion.js +22 -0
- package/dist/Display/Display.AvatarGroup.d.ts +12 -0
- package/dist/Display/Display.AvatarGroup.js +23 -0
- package/dist/Display/Display.Badge.d.ts +1 -1
- package/dist/Display/Display.Card.d.ts +46 -0
- package/dist/Display/Display.Card.js +36 -0
- package/dist/Display/Display.Carousel.d.ts +13 -0
- package/dist/Display/Display.Carousel.js +19 -0
- package/dist/Display/Display.Chip.d.ts +105 -0
- package/dist/Display/Display.Chip.js +45 -0
- package/dist/Display/Display.CopyableText.d.ts +1 -1
- package/dist/Display/Display.CountRecords.d.ts +1 -1
- package/dist/Display/Display.DataTable.d.ts +19 -0
- package/dist/Display/Display.DataTable.js +22 -0
- package/dist/Display/Display.Date.d.ts +15 -2
- package/dist/Display/Display.Date.js +34 -4
- package/dist/Display/Display.Divider.d.ts +1 -1
- package/dist/Display/Display.IconBadge.d.ts +13 -0
- package/dist/Display/Display.IconBadge.js +30 -0
- package/dist/Display/Display.Image.d.ts +15 -0
- package/dist/Display/Display.Image.js +17 -0
- package/dist/Display/Display.KeyValue.d.ts +10 -0
- package/dist/Display/Display.KeyValue.js +9 -0
- package/dist/Display/Display.ListItem.d.ts +13 -0
- package/dist/Display/Display.ListItem.js +14 -0
- package/dist/Display/Display.Logo.js +3 -1
- package/dist/Display/Display.MediaCard.d.ts +17 -0
- package/dist/Display/Display.MediaCard.js +12 -0
- package/dist/Display/Display.MediaEmbed.d.ts +19 -0
- package/dist/Display/Display.MediaEmbed.js +39 -0
- package/dist/Display/Display.MenuButton.d.ts +1 -1
- package/dist/Display/Display.Monetary.d.ts +1 -1
- package/dist/Display/Display.PriceTag.d.ts +10 -0
- package/dist/Display/Display.PriceTag.js +23 -0
- package/dist/Display/Display.ProductCard.d.ts +17 -0
- package/dist/Display/Display.ProductCard.js +13 -0
- package/dist/Display/Display.Rating.d.ts +11 -0
- package/dist/Display/Display.Rating.js +16 -0
- package/dist/Display/Display.SearchHistory.d.ts +12 -0
- package/dist/Display/Display.SearchHistory.js +13 -0
- package/dist/Display/Display.SectionHeader.d.ts +13 -0
- package/dist/Display/Display.SectionHeader.js +9 -0
- package/dist/Display/Display.Stat.d.ts +10 -0
- package/dist/Display/Display.Stat.js +9 -0
- package/dist/Display/Display.StatCard.d.ts +14 -0
- package/dist/Display/Display.StatCard.js +13 -0
- package/dist/Display/Display.StatusDot.d.ts +11 -0
- package/dist/Display/Display.StatusDot.js +28 -0
- package/dist/Display/Display.Story.d.ts +15 -0
- package/dist/Display/Display.Story.js +43 -0
- package/dist/Display/Display.StoryTray.d.ts +26 -0
- package/dist/Display/Display.StoryTray.js +43 -0
- package/dist/Display/Display.StoryViewer.d.ts +26 -0
- package/dist/Display/Display.StoryViewer.js +79 -0
- package/dist/Display/Display.SwipeableRow.d.ts +15 -0
- package/dist/Display/Display.SwipeableRow.js +28 -0
- package/dist/Display/Display.Tag.d.ts +11 -0
- package/dist/Display/Display.Tag.js +9 -0
- package/dist/Display/Display.Timeline.d.ts +13 -0
- package/dist/Display/Display.Timeline.js +19 -0
- package/dist/Display/Display.Tooltip.d.ts +10 -0
- package/dist/Display/Display.Tooltip.js +24 -0
- package/dist/Display/index.d.ts +66 -0
- package/dist/Display/index.js +54 -0
- package/dist/Feedback/ErrorBoundary.d.ts +1 -1
- package/dist/Feedback/Feedback.Banner.d.ts +82 -0
- package/dist/Feedback/Feedback.Banner.js +35 -0
- package/dist/Feedback/Feedback.DomainSplashScreen.d.ts +2 -1
- package/dist/Feedback/Feedback.DomainSplashScreen.js +1 -1
- package/dist/Feedback/Feedback.Empty.d.ts +1 -1
- package/dist/Feedback/Feedback.EmptyState.d.ts +15 -0
- package/dist/Feedback/Feedback.EmptyState.js +11 -0
- package/dist/Feedback/Feedback.Error.d.ts +1 -1
- package/dist/Feedback/Feedback.Loading.d.ts +2 -1
- package/dist/Feedback/Feedback.PermissionCard.d.ts +15 -0
- package/dist/Feedback/Feedback.PermissionCard.js +11 -0
- package/dist/Feedback/Feedback.Progress.d.ts +9 -0
- package/dist/Feedback/Feedback.Progress.js +35 -0
- package/dist/Feedback/Feedback.ProgressCircle.d.ts +12 -0
- package/dist/Feedback/Feedback.ProgressCircle.js +15 -0
- package/dist/Feedback/Feedback.Skeleton.d.ts +11 -0
- package/dist/Feedback/Feedback.Skeleton.js +29 -0
- package/dist/Feedback/Feedback.Splash.d.ts +1 -1
- package/dist/Feedback/Toast.context.d.ts +35 -0
- package/dist/Feedback/Toast.context.js +119 -0
- package/dist/Feedback/index.d.ts +15 -0
- package/dist/Feedback/index.js +15 -0
- package/dist/Form/Form.Button.d.ts +6 -0
- package/dist/Form/Form.Button.js +12 -1
- package/dist/Form/Form.Checkbox.d.ts +1 -1
- package/dist/Form/Form.ControlledCheckbox.d.ts +1 -1
- package/dist/Form/Form.ControlledInput.d.ts +1 -1
- package/dist/Form/Form.ControlledMonetaryInput.d.ts +1 -1
- package/dist/Form/Form.ControlledRadioButton.d.ts +1 -1
- package/dist/Form/Form.DatePicker.d.ts +20 -0
- package/dist/Form/Form.DatePicker.js +38 -0
- package/dist/Form/Form.Dropdown.d.ts +1 -1
- package/dist/Form/Form.FAB.d.ts +10 -0
- package/dist/Form/Form.FAB.js +17 -0
- package/dist/Form/Form.FilterButton.d.ts +1 -1
- package/dist/Form/Form.FractionalQuantityInput.d.ts +1 -1
- package/dist/Form/Form.IconButton.d.ts +1 -1
- package/dist/Form/Form.Input.d.ts +2 -1
- package/dist/Form/Form.MonetaryInput.d.ts +1 -1
- package/dist/Form/Form.PinInput.d.ts +12 -0
- package/dist/Form/Form.PinInput.js +23 -0
- package/dist/Form/Form.QuantitySelector.d.ts +2 -1
- package/dist/Form/Form.QuantitySelector.js +1 -1
- package/dist/Form/Form.RadioButton.d.ts +1 -1
- package/dist/Form/Form.SearchBar.d.ts +6 -1
- package/dist/Form/Form.SearchBar.js +4 -0
- package/dist/Form/Form.Select.d.ts +17 -0
- package/dist/Form/Form.Select.js +26 -0
- package/dist/Form/Form.Slider.d.ts +20 -0
- package/dist/Form/Form.Slider.js +16 -0
- package/dist/Form/Form.Switch.d.ts +10 -0
- package/dist/Form/Form.Switch.js +9 -0
- package/dist/Form/index.d.ts +12 -0
- package/dist/Form/index.js +12 -0
- package/dist/Navigation/Navigation.AppBar.d.ts +41 -0
- package/dist/Navigation/Navigation.AppBar.js +33 -0
- package/dist/Navigation/Navigation.BottomNav.d.ts +29 -0
- package/dist/Navigation/Navigation.BottomNav.js +35 -0
- package/dist/Navigation/Navigation.CollapsingHeader.d.ts +34 -0
- package/dist/Navigation/Navigation.CollapsingHeader.js +47 -0
- package/dist/Navigation/Navigation.FloatingBar.d.ts +15 -0
- package/dist/Navigation/Navigation.FloatingBar.js +21 -0
- package/dist/Navigation/Navigation.Header.d.ts +6 -2
- package/dist/Navigation/Navigation.Header.js +4 -0
- package/dist/Navigation/Navigation.HeaderToolbar.d.ts +1 -1
- package/dist/Navigation/Navigation.Menu.d.ts +21 -0
- package/dist/Navigation/Navigation.Menu.js +42 -0
- package/dist/Navigation/Navigation.RowItem.d.ts +1 -1
- package/dist/Navigation/Navigation.SearchBar.d.ts +18 -0
- package/dist/Navigation/Navigation.SearchBar.js +22 -0
- package/dist/Navigation/Navigation.SegmentedControl.d.ts +14 -0
- package/dist/Navigation/Navigation.SegmentedControl.js +13 -0
- package/dist/Navigation/Navigation.Steps.d.ts +8 -0
- package/dist/Navigation/Navigation.Steps.js +17 -0
- package/dist/Navigation/Navigation.TabIcon.d.ts +1 -1
- package/dist/Navigation/Navigation.Tabs.d.ts +28 -0
- package/dist/Navigation/Navigation.Tabs.js +45 -0
- package/dist/Navigation/index.d.ts +32 -1
- package/dist/Navigation/index.js +18 -0
- package/dist/Typography/Typography.Text.d.ts +2 -1
- package/dist/branding.d.ts +6 -0
- package/dist/branding.js +7 -0
- package/dist/icons/ArrowDownIcon.d.ts +2 -1
- package/dist/icons/ArrowUpIcon.d.ts +2 -1
- package/dist/icons/CreditIcon.d.ts +1 -1
- package/dist/icons/OdooIcon.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/layouts/AuthContainer.d.ts +1 -1
- package/dist/layouts/Container.d.ts +1 -0
- package/dist/layouts/Container.js +2 -3
- package/dist/layouts/GradientContainer.d.ts +1 -1
- package/dist/layouts/PlainLayout.d.ts +1 -1
- package/dist/layouts/ScrollContainer.d.ts +2 -2
- package/dist/layouts/ScrollContainer.js +1 -1
- package/dist/layouts/TabNavigatorLayout.d.ts +2 -2
- package/dist/layouts/TabNavigatorLayout.js +4 -0
- package/dist/primitives/AspectRatio.d.ts +10 -0
- package/dist/primitives/AspectRatio.js +8 -0
- package/dist/primitives/Box.d.ts +1 -1
- package/dist/primitives/Pressable.d.ts +10 -0
- package/dist/primitives/Pressable.js +9 -0
- package/dist/primitives/Row.d.ts +1 -1
- package/dist/primitives/Spacer.d.ts +8 -0
- package/dist/primitives/Spacer.js +9 -0
- package/dist/primitives/Stack.d.ts +1 -1
- package/dist/primitives/index.d.ts +3 -0
- package/dist/primitives/index.js +3 -0
- package/dist/theme/active.d.ts +2 -0
- package/dist/theme/active.js +13 -0
- package/dist/theme/components/ThemedActivityIndicator.d.ts +1 -1
- package/dist/theme/components/index.d.ts +1 -1
- package/dist/theme/components/index.js +1 -1
- package/dist/theme/dark.d.ts +7 -0
- package/dist/theme/dark.js +84 -0
- package/dist/theme/define.d.ts +5 -5
- package/dist/theme/define.js +5 -5
- package/dist/theme/index.d.ts +3 -1
- package/dist/theme/index.js +3 -1
- package/dist/theme/theme.d.ts +1 -1
- package/dist/theme/theme.js +1 -1
- package/dist/theme/types.d.ts +14 -14
- package/dist/theme/types.js +2 -2
- package/dist/theme/useTheme.d.ts +3 -1
- package/dist/theme/useTheme.js +6 -1
- package/dist/tokens/index.d.ts +2 -0
- package/dist/tokens/index.js +2 -0
- package/dist/tokens/motion.d.ts +71 -0
- package/dist/tokens/motion.js +25 -0
- package/dist/utils/date.d.ts +33 -33
- package/dist/utils/date.js +39 -39
- package/dist/views/AuthFormView.d.ts +1 -1
- package/dist/views/FormViewV2.context.d.ts +1 -1
- package/dist/views/FormViewV2.d.ts +10 -10
- package/dist/views/ListViewV2.context.d.ts +1 -1
- package/dist/views/ListViewV2.d.ts +20 -20
- package/dist/views/Wizard/Wizard.context.d.ts +1 -1
- package/dist/widgets/CircleButton.d.ts +6 -2
- package/dist/widgets/CircleButton.js +4 -0
- package/dist/widgets/GeoPermissionCard.d.ts +1 -1
- package/dist/widgets/HomeHeader.d.ts +4 -0
- package/dist/widgets/HomeHeader.js +4 -0
- package/dist/widgets/JSONViewer.d.ts +2 -1
- package/dist/widgets/JSONViewer.js +6 -6
- package/dist/widgets/MenuCard.d.ts +1 -1
- package/dist/widgets/ScreenHeader.d.ts +5 -1
- package/dist/widgets/ScreenHeader.js +4 -0
- package/dist/widgets/TimeZoneSelector.d.ts +1 -1
- package/dist/widgets/TimeZoneSelectorModal.d.ts +1 -1
- package/package.json +38 -25
- package/tailwind.preset.js +14 -0
- package/dist/notifications/index.d.ts +0 -1
- package/dist/notifications/index.js +0 -1
- package/dist/providers/index.d.ts +0 -1
- package/dist/providers/index.js +0 -2
package/dist/Feedback/index.js
CHANGED
|
@@ -1,14 +1,29 @@
|
|
|
1
|
+
import Banner from "../Feedback/Feedback.Banner";
|
|
1
2
|
import DomainSplashScreen from "../Feedback/Feedback.DomainSplashScreen";
|
|
2
3
|
import Empty from "../Feedback/Feedback.Empty";
|
|
4
|
+
import EmptyState from "../Feedback/Feedback.EmptyState";
|
|
3
5
|
import Error from "../Feedback/Feedback.Error";
|
|
4
6
|
import Loading from "../Feedback/Feedback.Loading";
|
|
7
|
+
import PermissionCard from "../Feedback/Feedback.PermissionCard";
|
|
8
|
+
import Progress from "../Feedback/Feedback.Progress";
|
|
9
|
+
import ProgressCircle from "../Feedback/Feedback.ProgressCircle";
|
|
10
|
+
import Skeleton from "../Feedback/Feedback.Skeleton";
|
|
5
11
|
import Spinner from "../Feedback/Feedback.Spinner";
|
|
12
|
+
import SplashScreen from "../Feedback/Feedback.Splash";
|
|
6
13
|
export { ErrorBoundary } from "../Feedback/ErrorBoundary";
|
|
14
|
+
export { ToastProvider, useToast, } from "../Feedback/Toast.context";
|
|
7
15
|
export const Feedback = {
|
|
8
16
|
Loading,
|
|
9
17
|
Spinner,
|
|
18
|
+
Skeleton,
|
|
19
|
+
Progress,
|
|
20
|
+
ProgressCircle,
|
|
21
|
+
Banner,
|
|
22
|
+
PermissionCard,
|
|
10
23
|
Empty,
|
|
24
|
+
EmptyState,
|
|
11
25
|
Error,
|
|
26
|
+
SplashScreen,
|
|
12
27
|
DomainSplashScreen,
|
|
13
28
|
};
|
|
14
29
|
export default Feedback;
|
|
@@ -4,6 +4,7 @@ declare const button: import("tailwind-variants").TVReturnType<{
|
|
|
4
4
|
variant: {
|
|
5
5
|
primary: string;
|
|
6
6
|
accent: string;
|
|
7
|
+
cta: string;
|
|
7
8
|
secondary: string;
|
|
8
9
|
outline: string;
|
|
9
10
|
outlineDanger: string;
|
|
@@ -24,6 +25,7 @@ declare const button: import("tailwind-variants").TVReturnType<{
|
|
|
24
25
|
variant: {
|
|
25
26
|
primary: string;
|
|
26
27
|
accent: string;
|
|
28
|
+
cta: string;
|
|
27
29
|
secondary: string;
|
|
28
30
|
outline: string;
|
|
29
31
|
outlineDanger: string;
|
|
@@ -44,6 +46,7 @@ declare const button: import("tailwind-variants").TVReturnType<{
|
|
|
44
46
|
variant: {
|
|
45
47
|
primary: string;
|
|
46
48
|
accent: string;
|
|
49
|
+
cta: string;
|
|
47
50
|
secondary: string;
|
|
48
51
|
outline: string;
|
|
49
52
|
outlineDanger: string;
|
|
@@ -65,6 +68,7 @@ declare const buttonIcon: import("tailwind-variants").TVReturnType<{
|
|
|
65
68
|
variant: {
|
|
66
69
|
primary: string;
|
|
67
70
|
accent: string;
|
|
71
|
+
cta: string;
|
|
68
72
|
secondary: string;
|
|
69
73
|
outline: string;
|
|
70
74
|
outlineDanger: string;
|
|
@@ -85,6 +89,7 @@ declare const buttonIcon: import("tailwind-variants").TVReturnType<{
|
|
|
85
89
|
variant: {
|
|
86
90
|
primary: string;
|
|
87
91
|
accent: string;
|
|
92
|
+
cta: string;
|
|
88
93
|
secondary: string;
|
|
89
94
|
outline: string;
|
|
90
95
|
outlineDanger: string;
|
|
@@ -105,6 +110,7 @@ declare const buttonIcon: import("tailwind-variants").TVReturnType<{
|
|
|
105
110
|
variant: {
|
|
106
111
|
primary: string;
|
|
107
112
|
accent: string;
|
|
113
|
+
cta: string;
|
|
108
114
|
secondary: string;
|
|
109
115
|
outline: string;
|
|
110
116
|
outlineDanger: string;
|
package/dist/Form/Form.Button.js
CHANGED
|
@@ -17,6 +17,7 @@ const button = tv({
|
|
|
17
17
|
variant: {
|
|
18
18
|
primary: "shadow-sm",
|
|
19
19
|
accent: "shadow-sm",
|
|
20
|
+
cta: "shadow-sm",
|
|
20
21
|
secondary: "bg-bg-card border border-primary shadow-sm",
|
|
21
22
|
outline: "bg-transparent border border-primary",
|
|
22
23
|
outlineDanger: "bg-transparent border border-danger",
|
|
@@ -45,6 +46,7 @@ const buttonIcon = tv({
|
|
|
45
46
|
variant: {
|
|
46
47
|
primary: "shadow-sm",
|
|
47
48
|
accent: "shadow-sm",
|
|
49
|
+
cta: "shadow-sm",
|
|
48
50
|
secondary: "bg-bg-card border border-primary shadow-sm",
|
|
49
51
|
outline: "bg-transparent border border-primary",
|
|
50
52
|
outlineDanger: "bg-transparent border border-danger",
|
|
@@ -72,6 +74,7 @@ const textColor = tv({
|
|
|
72
74
|
variant: {
|
|
73
75
|
primary: "text-white",
|
|
74
76
|
accent: "text-white",
|
|
77
|
+
cta: "text-white",
|
|
75
78
|
secondary: "text-primary",
|
|
76
79
|
outline: "text-primary",
|
|
77
80
|
outlineDanger: "text-danger",
|
|
@@ -95,6 +98,11 @@ const textColor = tv({
|
|
|
95
98
|
disabled: true,
|
|
96
99
|
className: "text-white/70",
|
|
97
100
|
},
|
|
101
|
+
{
|
|
102
|
+
variant: "cta",
|
|
103
|
+
disabled: true,
|
|
104
|
+
className: "text-white/70",
|
|
105
|
+
},
|
|
98
106
|
{
|
|
99
107
|
variant: "transparent",
|
|
100
108
|
disabled: true,
|
|
@@ -133,6 +141,7 @@ function getLoadingColorDynamic(variant) {
|
|
|
133
141
|
const map = {
|
|
134
142
|
primary: theme.text.inverse,
|
|
135
143
|
accent: theme.text.inverse,
|
|
144
|
+
cta: theme.text.inverse,
|
|
136
145
|
secondary: theme.primary,
|
|
137
146
|
outline: theme.primary,
|
|
138
147
|
outlineDanger: theme.danger,
|
|
@@ -148,6 +157,7 @@ function getIconColorDynamic(variant, disabled) {
|
|
|
148
157
|
const disabledMap = {
|
|
149
158
|
primary: theme.icon.inverse + "70",
|
|
150
159
|
accent: theme.icon.inverse + "70",
|
|
160
|
+
cta: theme.icon.inverse + "70",
|
|
151
161
|
secondary: theme.icon.disabled,
|
|
152
162
|
outline: theme.icon.disabled,
|
|
153
163
|
outlineDanger: theme.danger + "7f",
|
|
@@ -161,6 +171,7 @@ function getIconColorDynamic(variant, disabled) {
|
|
|
161
171
|
const enabledMap = {
|
|
162
172
|
primary: theme.icon.inverse,
|
|
163
173
|
accent: theme.icon.inverse,
|
|
174
|
+
cta: theme.icon.inverse,
|
|
164
175
|
secondary: theme.primary,
|
|
165
176
|
outline: theme.primary,
|
|
166
177
|
outlineDanger: theme.danger,
|
|
@@ -225,7 +236,7 @@ const Button = ({ title, onPress, confirm, variant = "primary", size = "medium",
|
|
|
225
236
|
if (variant === "link") {
|
|
226
237
|
return (_jsx(TouchableOpacity, { activeOpacity: 0.7, className: className, disabled: disabled || loading, onPress: handlePress, children: loading ? (_jsx(ActivityIndicator, { color: loadingColorValue, size: "small" })) : (_jsx(Typography.Text, { className: textColorClass, variant: textVariantValue, children: title })) }));
|
|
227
238
|
}
|
|
228
|
-
if (variant === "primary" || variant === "accent") {
|
|
239
|
+
if (variant === "primary" || variant === "accent" || variant === "cta") {
|
|
229
240
|
const gradientColors = variant === "primary" ? theme.gradient.primary : theme.gradient.accent;
|
|
230
241
|
return (_jsx(LinearGradient, { colors: gradientColors, end: { x: 1, y: 1 }, start: { x: 0, y: 0 }, style: {
|
|
231
242
|
borderRadius: 8,
|
|
@@ -9,5 +9,5 @@ interface RowCheckBoxProps {
|
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
className?: string;
|
|
11
11
|
}
|
|
12
|
-
declare function RowCheckBox({ mainText, subText, rightText, rightComponent, leftComponent, isChecked, onCheck, disabled, className, }: RowCheckBoxProps): import("react
|
|
12
|
+
declare function RowCheckBox({ mainText, subText, rightText, rightComponent, leftComponent, isChecked, onCheck, disabled, className, }: RowCheckBoxProps): import("react").JSX.Element;
|
|
13
13
|
export default RowCheckBox;
|
|
@@ -5,5 +5,5 @@ interface ControlledCheckboxProps<T extends FieldValues> {
|
|
|
5
5
|
label: string;
|
|
6
6
|
subText?: string;
|
|
7
7
|
}
|
|
8
|
-
declare function ControlledCheckbox<T extends FieldValues>({ control, name, label, subText, }: ControlledCheckboxProps<T>): import("react
|
|
8
|
+
declare function ControlledCheckbox<T extends FieldValues>({ control, name, label, subText, }: ControlledCheckboxProps<T>): import("react").JSX.Element;
|
|
9
9
|
export default ControlledCheckbox;
|
|
@@ -11,5 +11,5 @@ interface ControlledInputProps<T extends FieldValues> {
|
|
|
11
11
|
rules?: any;
|
|
12
12
|
error?: string;
|
|
13
13
|
}
|
|
14
|
-
declare function ControlledInput<T extends FieldValues>({ control, name, label, placeholder, keyboardType, autoCapitalize, multiline, numberOfLines, rules, error, }: ControlledInputProps<T>): import("react
|
|
14
|
+
declare function ControlledInput<T extends FieldValues>({ control, name, label, placeholder, keyboardType, autoCapitalize, multiline, numberOfLines, rules, error, }: ControlledInputProps<T>): import("react").JSX.Element;
|
|
15
15
|
export default ControlledInput;
|
|
@@ -8,5 +8,5 @@ interface ControlledMonetaryInputProps<T extends FieldValues> {
|
|
|
8
8
|
rules?: any;
|
|
9
9
|
error?: string;
|
|
10
10
|
}
|
|
11
|
-
declare function ControlledMonetaryInput<T extends FieldValues>({ control, name, label, placeholder, currency, rules, error, }: ControlledMonetaryInputProps<T>): import("react
|
|
11
|
+
declare function ControlledMonetaryInput<T extends FieldValues>({ control, name, label, placeholder, currency, rules, error, }: ControlledMonetaryInputProps<T>): import("react").JSX.Element;
|
|
12
12
|
export default ControlledMonetaryInput;
|
|
@@ -5,5 +5,5 @@ interface ControlledRadioButtonProps<T extends FieldValues> {
|
|
|
5
5
|
label: string;
|
|
6
6
|
value: any;
|
|
7
7
|
}
|
|
8
|
-
declare function ControlledRadioButton<T extends FieldValues>({ control, name, label, value, }: ControlledRadioButtonProps<T>): import("react
|
|
8
|
+
declare function ControlledRadioButton<T extends FieldValues>({ control, name, label, value, }: ControlledRadioButtonProps<T>): import("react").JSX.Element;
|
|
9
9
|
export default ControlledRadioButton;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface DatePickerProps {
|
|
2
|
+
value: Date | null;
|
|
3
|
+
onChange: (value: Date) => void;
|
|
4
|
+
mode?: "date" | "time" | "datetime";
|
|
5
|
+
label?: string;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
format?: (value: Date) => string;
|
|
8
|
+
minimumDate?: Date;
|
|
9
|
+
maximumDate?: Date;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
testID?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* **Hybrid** date/time field: tokenized trigger (NativeWind) + **native picker**
|
|
16
|
+
* (`@react-native-community/datetimepicker`) — a case where native wins (expected UX).
|
|
17
|
+
* Subpath `Form/DatePicker`; **optional** peer dep.
|
|
18
|
+
*/
|
|
19
|
+
declare function DatePicker({ value, onChange, mode, label, placeholder, format, minimumDate, maximumDate, disabled, className, testID, }: DatePickerProps): import("react").JSX.Element;
|
|
20
|
+
export default DatePicker;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
+
import DateTimePicker from "@react-native-community/datetimepicker";
|
|
3
|
+
import Icon from "../Display/Display.Icon";
|
|
4
|
+
import Pressable from "../primitives/Pressable";
|
|
5
|
+
import { theme } from "../theme";
|
|
6
|
+
import { cn } from "../theme/tw";
|
|
7
|
+
import { Typography } from "../Typography";
|
|
8
|
+
import { useState } from "react";
|
|
9
|
+
import { Platform, View } from "react-native";
|
|
10
|
+
function defaultFormat(value, mode) {
|
|
11
|
+
if (mode === "time")
|
|
12
|
+
return value.toLocaleTimeString("es-BO", { hour: "2-digit", minute: "2-digit" });
|
|
13
|
+
if (mode === "datetime")
|
|
14
|
+
return value.toLocaleString("es-BO");
|
|
15
|
+
return value.toLocaleDateString("es-BO");
|
|
16
|
+
}
|
|
17
|
+
const iconByMode = {
|
|
18
|
+
date: "calendar-outline",
|
|
19
|
+
time: "time-outline",
|
|
20
|
+
datetime: "calendar-outline",
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* **Hybrid** date/time field: tokenized trigger (NativeWind) + **native picker**
|
|
24
|
+
* (`@react-native-community/datetimepicker`) — a case where native wins (expected UX).
|
|
25
|
+
* Subpath `Form/DatePicker`; **optional** peer dep.
|
|
26
|
+
*/
|
|
27
|
+
function DatePicker({ value, onChange, mode = "date", label, placeholder = "Seleccionar…", format, minimumDate, maximumDate, disabled = false, className, testID, }) {
|
|
28
|
+
const [open, setOpen] = useState(false);
|
|
29
|
+
const fmt = format ?? ((d) => defaultFormat(d, mode));
|
|
30
|
+
const handleValueChange = (_event, date) => {
|
|
31
|
+
if (Platform.OS === "android")
|
|
32
|
+
setOpen(false);
|
|
33
|
+
if (date)
|
|
34
|
+
onChange(date);
|
|
35
|
+
};
|
|
36
|
+
return (_jsxs(View, { className: cn("gap-1", className), testID: testID, children: [label ? (_jsx(Typography.Text, { className: "font-medium text-text-primary", variant: "bodySmall", children: label })) : null, _jsxs(Pressable, { accessibilityHint: "Abre el selector de fecha", accessibilityLabel: label ?? placeholder, accessibilityRole: "button", accessibilityState: { disabled }, className: "flex-row items-center justify-between rounded-lg border border-input bg-bg-card px-3 min-h-[44px]", disabled: disabled, onPress: () => setOpen(true), children: [_jsx(Typography.Text, { className: cn("flex-1 text-sm", value ? "text-text-primary" : "text-text-tertiary"), children: value ? fmt(value) : placeholder }), _jsx(Icon, { color: theme.icon.secondary, name: iconByMode[mode], size: 18 })] }), open ? (_jsx(DateTimePicker, { maximumDate: maximumDate, minimumDate: minimumDate, mode: mode === "datetime" ? "date" : mode, onDismiss: () => setOpen(false), onValueChange: handleValueChange, value: value ?? new Date() })) : null] }));
|
|
37
|
+
}
|
|
38
|
+
export default DatePicker;
|
|
@@ -10,5 +10,5 @@ interface DropdownButtonProps {
|
|
|
10
10
|
variant?: "primary" | "secondary" | "outline";
|
|
11
11
|
size?: "xs" | "small" | "medium" | "large";
|
|
12
12
|
}
|
|
13
|
-
declare function DropdownButton({ title, options, variant, size, }: DropdownButtonProps): import("react
|
|
13
|
+
declare function DropdownButton({ title, options, variant, size, }: DropdownButtonProps): import("react").JSX.Element;
|
|
14
14
|
export default DropdownButton;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface FABProps {
|
|
2
|
+
icon: string;
|
|
3
|
+
onPress: () => void;
|
|
4
|
+
label?: string;
|
|
5
|
+
position?: "bottom-right" | "bottom-left";
|
|
6
|
+
className?: string;
|
|
7
|
+
testID?: string;
|
|
8
|
+
}
|
|
9
|
+
declare function FAB({ icon, onPress, label, position, className, testID, }: FABProps): import("react").JSX.Element;
|
|
10
|
+
export default FAB;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
+
import Icon from "../Display/Display.Icon";
|
|
3
|
+
import Pressable from "../primitives/Pressable";
|
|
4
|
+
import { theme } from "../theme";
|
|
5
|
+
import { cn } from "../theme/tw";
|
|
6
|
+
import { Typography } from "../Typography";
|
|
7
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
8
|
+
function FAB({ icon, onPress, label, position = "bottom-right", className, testID, }) {
|
|
9
|
+
const insets = useSafeAreaInsets();
|
|
10
|
+
return (_jsxs(Pressable, { accessibilityLabel: label ?? "Acción", accessibilityRole: "button", className: cn("absolute flex-row items-center justify-center rounded-full bg-primary", label ? "h-14 px-5 gap-2" : "w-14 h-14", className), onPress: onPress, style: {
|
|
11
|
+
bottom: insets.bottom + 16,
|
|
12
|
+
right: position === "bottom-right" ? 16 : undefined,
|
|
13
|
+
left: position === "bottom-left" ? 16 : undefined,
|
|
14
|
+
...theme.shadow.lg,
|
|
15
|
+
}, testID: testID, children: [_jsx(Icon, { color: theme.icon.inverse, name: icon, size: 24 }), label ? (_jsx(Typography.Text, { className: "text-text-on-primary font-semibold", children: label })) : null] }));
|
|
16
|
+
}
|
|
17
|
+
export default FAB;
|
|
@@ -8,5 +8,5 @@ export declare const FilterButton: FC<FilterButtonProps>;
|
|
|
8
8
|
interface FilterButtonGroupProps {
|
|
9
9
|
children: React.ReactNode;
|
|
10
10
|
}
|
|
11
|
-
export declare function FilterButtonGroup({ children }: FilterButtonGroupProps): import("react
|
|
11
|
+
export declare function FilterButtonGroup({ children }: FilterButtonGroupProps): import("react").JSX.Element;
|
|
12
12
|
export {};
|
|
@@ -9,5 +9,5 @@ interface FractionalQuantityInputProps {
|
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
quickAddIncrements?: number[];
|
|
11
11
|
}
|
|
12
|
-
declare function FractionalQuantityInput({ value, onChange, precision, minIncrement, maxValue, style, disabled, quickAddIncrements, }: FractionalQuantityInputProps): import("react
|
|
12
|
+
declare function FractionalQuantityInput({ value, onChange, precision, minIncrement, maxValue, style, disabled, quickAddIncrements, }: FractionalQuantityInputProps): import("react").JSX.Element;
|
|
13
13
|
export default FractionalQuantityInput;
|
|
@@ -63,5 +63,5 @@ interface IconButtonProps extends VariantProps<typeof iconButton> {
|
|
|
63
63
|
iconColor?: string;
|
|
64
64
|
className?: string;
|
|
65
65
|
}
|
|
66
|
-
declare function IconButton({ icon, type, onPress, variant, size, loading, disabled, rounded, iconColor, className, }: IconButtonProps): import("react
|
|
66
|
+
declare function IconButton({ icon, type, onPress, variant, size, loading, disabled, rounded, iconColor, className, }: IconButtonProps): import("react").JSX.Element;
|
|
67
67
|
export default IconButton;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type React from "react";
|
|
1
2
|
import { type TextInputProps } from "react-native";
|
|
2
3
|
interface FormInputProps extends TextInputProps {
|
|
3
4
|
label: string;
|
|
@@ -5,5 +6,5 @@ interface FormInputProps extends TextInputProps {
|
|
|
5
6
|
tooltip?: string;
|
|
6
7
|
className?: string;
|
|
7
8
|
}
|
|
8
|
-
declare function FormInput({ label, error, tooltip, style, multiline, numberOfLines, onFocus, onBlur, className, ...props }: FormInputProps):
|
|
9
|
+
declare function FormInput({ label, error, tooltip, style, multiline, numberOfLines, onFocus, onBlur, className, ...props }: FormInputProps): React.JSX.Element;
|
|
9
10
|
export default FormInput;
|
|
@@ -4,5 +4,5 @@ interface MonetaryInputProps {
|
|
|
4
4
|
currencySymbol?: string;
|
|
5
5
|
placeholder?: string;
|
|
6
6
|
}
|
|
7
|
-
declare function MonetaryInput({ amount, onChange, currencySymbol, placeholder, }: MonetaryInputProps): import("react
|
|
7
|
+
declare function MonetaryInput({ amount, onChange, currencySymbol, placeholder, }: MonetaryInputProps): import("react").JSX.Element;
|
|
8
8
|
export default MonetaryInput;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface PinInputProps {
|
|
2
|
+
value: string;
|
|
3
|
+
onChange: (value: string) => void;
|
|
4
|
+
length?: number;
|
|
5
|
+
secure?: boolean;
|
|
6
|
+
autoFocus?: boolean;
|
|
7
|
+
onComplete?: (value: string) => void;
|
|
8
|
+
className?: string;
|
|
9
|
+
testID?: string;
|
|
10
|
+
}
|
|
11
|
+
declare function PinInput({ value, onChange, length, secure, autoFocus, onComplete, className, testID, }: PinInputProps): import("react").JSX.Element;
|
|
12
|
+
export default PinInput;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
+
import Pressable from "../primitives/Pressable";
|
|
3
|
+
import { theme } from "../theme";
|
|
4
|
+
import { cn } from "../theme/tw";
|
|
5
|
+
import { Typography } from "../Typography";
|
|
6
|
+
import { useRef } from "react";
|
|
7
|
+
import { TextInput, View } from "react-native";
|
|
8
|
+
function PinInput({ value, onChange, length = 6, secure = false, autoFocus = false, onComplete, className, testID, }) {
|
|
9
|
+
const inputRef = useRef(null);
|
|
10
|
+
const chars = value.split("");
|
|
11
|
+
const handleChange = (text) => {
|
|
12
|
+
const next = text.replace(/[^0-9]/g, "").slice(0, length);
|
|
13
|
+
onChange(next);
|
|
14
|
+
if (next.length === length)
|
|
15
|
+
onComplete?.(next);
|
|
16
|
+
};
|
|
17
|
+
return (_jsxs(Pressable, { accessibilityLabel: "C\u00F3digo de verificaci\u00F3n", className: cn("flex-row gap-2", className), onPress: () => inputRef.current?.focus(), testID: testID, children: [Array.from({ length }).map((_, index) => {
|
|
18
|
+
const filled = index < value.length;
|
|
19
|
+
const active = index === value.length;
|
|
20
|
+
return (_jsx(View, { className: "flex-1 aspect-square max-w-[52px] rounded-lg border bg-bg-card items-center justify-center", style: { borderColor: active ? theme.border.focus : theme.border.default }, children: _jsx(Typography.Text, { className: "text-text-primary", variant: "h4", children: filled ? (secure ? "•" : chars[index]) : "" }) }, index));
|
|
21
|
+
}), _jsx(TextInput, { autoFocus: autoFocus, caretHidden: true, keyboardType: "number-pad", maxLength: length, onChangeText: handleChange, ref: inputRef, style: { position: "absolute", opacity: 0, width: 1, height: 1 }, textContentType: "oneTimeCode", value: value })] }));
|
|
22
|
+
}
|
|
23
|
+
export default PinInput;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type React from "react";
|
|
1
2
|
import { StyleProp, ViewStyle } from "react-native";
|
|
2
3
|
interface QuantitySelectorProps {
|
|
3
4
|
value: number;
|
|
@@ -6,5 +7,5 @@ interface QuantitySelectorProps {
|
|
|
6
7
|
max?: number;
|
|
7
8
|
style?: StyleProp<ViewStyle>;
|
|
8
9
|
}
|
|
9
|
-
declare function QuantitySelector({ value, onChange, min, max, style, }: QuantitySelectorProps):
|
|
10
|
+
declare function QuantitySelector({ value, onChange, min, max, style, }: QuantitySelectorProps): React.JSX.Element;
|
|
10
11
|
export default QuantitySelector;
|
|
@@ -5,7 +5,7 @@ import { TouchableOpacity, View } from "react-native";
|
|
|
5
5
|
import { tv } from "tailwind-variants";
|
|
6
6
|
const quantitySelector = tv({
|
|
7
7
|
slots: {
|
|
8
|
-
container: "flex-row items-center border border-
|
|
8
|
+
container: "flex-row items-center self-start border border-accent rounded-full px-1",
|
|
9
9
|
button: "w-9 h-9 rounded-full justify-center items-center",
|
|
10
10
|
valueContainer: "min-w-[40px] items-center px-3",
|
|
11
11
|
},
|
|
@@ -3,5 +3,5 @@ interface RadioButtonProps {
|
|
|
3
3
|
selected: boolean;
|
|
4
4
|
onPress: () => void;
|
|
5
5
|
}
|
|
6
|
-
declare function RadioButton({ label, selected, onPress }: RadioButtonProps): import("react
|
|
6
|
+
declare function RadioButton({ label, selected, onPress }: RadioButtonProps): import("react").JSX.Element;
|
|
7
7
|
export default RadioButton;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
import type React from "react";
|
|
1
2
|
interface SearchBarProps {
|
|
2
3
|
value: string;
|
|
3
4
|
onChangeText: (text: string) => void;
|
|
4
5
|
placeholder?: string;
|
|
5
6
|
className?: string;
|
|
6
7
|
}
|
|
7
|
-
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use `Navigation.SearchBar` (2026 pill). Kept for backwards compatibility
|
|
10
|
+
* (consumed by `ListViewV2`).
|
|
11
|
+
*/
|
|
12
|
+
declare function SearchBar({ value, onChangeText, placeholder, className, }: SearchBarProps): React.JSX.Element;
|
|
8
13
|
export default SearchBar;
|
|
@@ -15,6 +15,10 @@ const searchBarContainer = tv({
|
|
|
15
15
|
},
|
|
16
16
|
defaultVariants: { focused: false },
|
|
17
17
|
});
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Use `Navigation.SearchBar` (2026 pill). Kept for backwards compatibility
|
|
20
|
+
* (consumed by `ListViewV2`).
|
|
21
|
+
*/
|
|
18
22
|
function SearchBar({ value, onChangeText, placeholder = "Search", className, }) {
|
|
19
23
|
const [isFocused, setIsFocused] = useState(false);
|
|
20
24
|
return (_jsxs(View, { className: cn(searchBarContainer({ focused: isFocused }), className), children: [_jsx(View, { className: "mr-1 ml-0.5 items-center justify-center h-full", children: _jsx(Icon, { className: "text-text-tertiary", name: "search", size: 18, type: "ionicons" }) }), _jsx(TextInput, { className: "flex-1 h-full text-sm py-0 px-1.5 text-text-primary", onBlur: () => setIsFocused(false), onChangeText: onChangeText, onFocus: () => setIsFocused(true), placeholder: placeholder, placeholderTextColor: theme.text.tertiary, value: value }), value.length > 0 && (_jsx(TouchableOpacity, { activeOpacity: 0.7, className: "mr-0.5 ml-1 items-center justify-center h-full px-1", onPress: () => onChangeText(""), children: _jsx(Icon, { className: "text-text-tertiary", name: "x", size: 18, type: "feather" }) }))] }));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface SelectOption<T extends string | number> {
|
|
2
|
+
label: string;
|
|
3
|
+
value: T;
|
|
4
|
+
}
|
|
5
|
+
export interface SelectProps<T extends string | number> {
|
|
6
|
+
options: SelectOption<T>[];
|
|
7
|
+
value: T | null;
|
|
8
|
+
onChange: (value: T) => void;
|
|
9
|
+
label?: string;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
title?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
testID?: string;
|
|
15
|
+
}
|
|
16
|
+
declare function Select<T extends string | number>({ options, value, onChange, label, placeholder, title, disabled, className, testID, }: SelectProps<T>): import("react").JSX.Element;
|
|
17
|
+
export default Select;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
+
import Icon from "../Display/Display.Icon";
|
|
3
|
+
import Pressable from "../primitives/Pressable";
|
|
4
|
+
import { theme } from "../theme";
|
|
5
|
+
import { cn } from "../theme/tw";
|
|
6
|
+
import { Typography } from "../Typography";
|
|
7
|
+
import { useState } from "react";
|
|
8
|
+
import { Modal, Pressable as RNPressable, ScrollView, View } from "react-native";
|
|
9
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
10
|
+
function Select({ options, value, onChange, label, placeholder = "Seleccionar…", title, disabled = false, className, testID, }) {
|
|
11
|
+
const insets = useSafeAreaInsets();
|
|
12
|
+
const [open, setOpen] = useState(false);
|
|
13
|
+
const selected = options.find((o) => o.value === value) ?? null;
|
|
14
|
+
return (_jsxs(View, { className: cn("gap-1", className), testID: testID, children: [label ? (_jsx(Typography.Text, { className: "font-medium text-text-primary", variant: "bodySmall", children: label })) : null, _jsxs(Pressable, { accessibilityHint: "Abre la lista de opciones", accessibilityLabel: label ?? placeholder, accessibilityRole: "button", accessibilityState: { disabled }, className: "flex-row items-center justify-between rounded-lg border border-input bg-bg-card px-3 min-h-[44px]", disabled: disabled, onPress: () => setOpen(true), children: [_jsx(Typography.Text, { className: cn("flex-1 text-sm", selected ? "text-text-primary" : "text-text-tertiary"), numberOfLines: 1, children: selected ? selected.label : placeholder }), _jsx(Icon, { color: theme.icon.secondary, name: "chevron-down", size: 18 })] }), _jsx(Modal, { animationType: "slide", onRequestClose: () => setOpen(false), transparent: true, visible: open, children: _jsx(RNPressable, { className: "flex-1 justify-end bg-black/50", onPress: () => setOpen(false), children: _jsxs(RNPressable, { className: "rounded-t-3xl", style: {
|
|
15
|
+
backgroundColor: theme.bg.card,
|
|
16
|
+
paddingBottom: insets.bottom + 8,
|
|
17
|
+
maxHeight: "70%",
|
|
18
|
+
}, children: [_jsx(View, { className: "items-center pt-3 pb-1", children: _jsx(View, { className: "w-10 h-1 rounded-full bg-border-strong" }) }), title ? (_jsx(Typography.Text, { className: "text-text-primary px-4 py-2", semibold: true, variant: "body", children: title })) : null, _jsx(ScrollView, { children: options.map((option) => {
|
|
19
|
+
const isSelected = option.value === value;
|
|
20
|
+
return (_jsxs(Pressable, { accessibilityRole: "menuitem", accessibilityState: { selected: isSelected }, className: "flex-row items-center justify-between px-4 py-3 border-b border-border-light", onPress: () => {
|
|
21
|
+
onChange(option.value);
|
|
22
|
+
setOpen(false);
|
|
23
|
+
}, children: [_jsx(Typography.Text, { className: cn("flex-1 text-sm", isSelected ? "text-primary font-semibold" : "text-text-primary"), children: option.label }), isSelected ? (_jsx(Icon, { color: theme.primary, name: "checkmark", size: 18 })) : null] }, String(option.value)));
|
|
24
|
+
}) })] }) }) })] }));
|
|
25
|
+
}
|
|
26
|
+
export default Select;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface SliderProps {
|
|
2
|
+
value: number;
|
|
3
|
+
onChange: (value: number) => void;
|
|
4
|
+
min?: number;
|
|
5
|
+
max?: number;
|
|
6
|
+
step?: number;
|
|
7
|
+
label?: string;
|
|
8
|
+
formatValue?: (value: number) => string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
testID?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* **Tokenized** slider (track in `primary`) on `@react-native-community/slider` — clean,
|
|
15
|
+
* on-brand, consistent across iOS/Android. (The `@expo/ui` Slider was evaluated but its
|
|
16
|
+
* Material style with ticks ignores the tokens → not a case where native wins.)
|
|
17
|
+
* Subpath `Form/Slider`; **optional** peer dep.
|
|
18
|
+
*/
|
|
19
|
+
declare function Slider({ value, onChange, min, max, step, label, formatValue, disabled, className, testID, }: SliderProps): import("react").JSX.Element;
|
|
20
|
+
export default Slider;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
+
import RNSlider from "@react-native-community/slider";
|
|
3
|
+
import { theme } from "../theme";
|
|
4
|
+
import { cn } from "../theme/tw";
|
|
5
|
+
import { Typography } from "../Typography";
|
|
6
|
+
import { View } from "react-native";
|
|
7
|
+
/**
|
|
8
|
+
* **Tokenized** slider (track in `primary`) on `@react-native-community/slider` — clean,
|
|
9
|
+
* on-brand, consistent across iOS/Android. (The `@expo/ui` Slider was evaluated but its
|
|
10
|
+
* Material style with ticks ignores the tokens → not a case where native wins.)
|
|
11
|
+
* Subpath `Form/Slider`; **optional** peer dep.
|
|
12
|
+
*/
|
|
13
|
+
function Slider({ value, onChange, min = 0, max = 100, step = 1, label, formatValue, disabled = false, className, testID, }) {
|
|
14
|
+
return (_jsxs(View, { className: cn("gap-1", className), testID: testID, children: [label || formatValue ? (_jsxs(View, { className: "flex-row items-center justify-between", children: [label ? (_jsx(Typography.Text, { className: "font-medium text-text-primary", variant: "bodySmall", children: label })) : null, formatValue ? (_jsx(Typography.Text, { className: "text-text-secondary", variant: "bodySmall", children: formatValue(value) })) : null] })) : null, _jsx(RNSlider, { disabled: disabled, maximumTrackTintColor: theme.bg.muted, maximumValue: max, minimumTrackTintColor: theme.primary, minimumValue: min, onValueChange: onChange, step: step, thumbTintColor: theme.primary, value: value })] }));
|
|
15
|
+
}
|
|
16
|
+
export default Slider;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface SwitchProps {
|
|
2
|
+
value: boolean;
|
|
3
|
+
onValueChange: (value: boolean) => void;
|
|
4
|
+
label?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
className?: string;
|
|
7
|
+
testID?: string;
|
|
8
|
+
}
|
|
9
|
+
declare function Switch({ value, onValueChange, label, disabled, className, testID, }: SwitchProps): import("react").JSX.Element;
|
|
10
|
+
export default Switch;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
|
|
2
|
+
import { theme } from "../theme";
|
|
3
|
+
import { cn } from "../theme/tw";
|
|
4
|
+
import { Typography } from "../Typography";
|
|
5
|
+
import { Switch as RNSwitch, View } from "react-native";
|
|
6
|
+
function Switch({ value, onValueChange, label, disabled = false, className, testID, }) {
|
|
7
|
+
return (_jsxs(View, { className: cn("flex-row items-center justify-between gap-3", className), children: [label ? (_jsx(Typography.Text, { className: cn("flex-1 text-text-primary", disabled && "text-text-disabled"), children: label })) : null, _jsx(RNSwitch, { accessibilityLabel: label, accessibilityRole: "switch", accessibilityState: { checked: value, disabled }, disabled: disabled, ios_backgroundColor: theme.bg.muted, onValueChange: onValueChange, testID: testID, thumbColor: theme.bg.card, trackColor: { false: theme.bg.muted, true: theme.primary }, value: value })] }));
|
|
8
|
+
}
|
|
9
|
+
export default Switch;
|
package/dist/Form/index.d.ts
CHANGED
|
@@ -4,15 +4,21 @@ import ControlledDropdown, { type DropdownOption } from "../Form/Form.Controlled
|
|
|
4
4
|
import ControlledInput from "../Form/Form.ControlledInput";
|
|
5
5
|
import ControlledMonetaryInput from "../Form/Form.ControlledMonetaryInput";
|
|
6
6
|
import ControlledRadioButton from "../Form/Form.ControlledRadioButton";
|
|
7
|
+
import DatePicker from "../Form/Form.DatePicker";
|
|
7
8
|
import Dropdown from "../Form/Form.Dropdown";
|
|
9
|
+
import FAB from "../Form/Form.FAB";
|
|
8
10
|
import { FilterButtonGroup } from "../Form/Form.FilterButton";
|
|
9
11
|
import FractionalQuantityInput from "../Form/Form.FractionalQuantityInput";
|
|
10
12
|
import IconButton from "../Form/Form.IconButton";
|
|
11
13
|
import Input from "../Form/Form.Input";
|
|
12
14
|
import MonetaryInput from "../Form/Form.MonetaryInput";
|
|
15
|
+
import PinInput from "../Form/Form.PinInput";
|
|
13
16
|
import QuantitySelector from "../Form/Form.QuantitySelector";
|
|
14
17
|
import RadioButton from "../Form/Form.RadioButton";
|
|
15
18
|
import SearchBar from "../Form/Form.SearchBar";
|
|
19
|
+
import Select from "../Form/Form.Select";
|
|
20
|
+
import Slider from "../Form/Form.Slider";
|
|
21
|
+
import Switch from "../Form/Form.Switch";
|
|
16
22
|
export declare const Form: {
|
|
17
23
|
TextInput: import("react").FC<import("../Form/Form.TextInput").TextInputFProps>;
|
|
18
24
|
Input: typeof Input;
|
|
@@ -26,6 +32,12 @@ export declare const Form: {
|
|
|
26
32
|
FractionalQuantityInput: typeof FractionalQuantityInput;
|
|
27
33
|
RadioButton: typeof RadioButton;
|
|
28
34
|
Checkbox: typeof Checkbox;
|
|
35
|
+
Switch: typeof Switch;
|
|
36
|
+
Select: typeof Select;
|
|
37
|
+
PinInput: typeof PinInput;
|
|
38
|
+
Slider: typeof Slider;
|
|
39
|
+
DatePicker: typeof DatePicker;
|
|
40
|
+
FAB: typeof FAB;
|
|
29
41
|
SearchBar: typeof SearchBar;
|
|
30
42
|
Dropdown: typeof Dropdown;
|
|
31
43
|
MonetaryInput: typeof MonetaryInput;
|
package/dist/Form/index.js
CHANGED
|
@@ -5,7 +5,9 @@ import ControlledDropdown from "../Form/Form.ControlledDropdown";
|
|
|
5
5
|
import ControlledInput from "../Form/Form.ControlledInput";
|
|
6
6
|
import ControlledMonetaryInput from "../Form/Form.ControlledMonetaryInput";
|
|
7
7
|
import ControlledRadioButton from "../Form/Form.ControlledRadioButton";
|
|
8
|
+
import DatePicker from "../Form/Form.DatePicker";
|
|
8
9
|
import Dropdown from "../Form/Form.Dropdown";
|
|
10
|
+
import FAB from "../Form/Form.FAB";
|
|
9
11
|
import { FilterButton, FilterButtonGroup } from "../Form/Form.FilterButton";
|
|
10
12
|
import FractionalQuantityInput from "../Form/Form.FractionalQuantityInput";
|
|
11
13
|
import IconButton from "../Form/Form.IconButton";
|
|
@@ -13,9 +15,13 @@ import Input from "../Form/Form.Input";
|
|
|
13
15
|
import InputField from "../Form/Form.InputField";
|
|
14
16
|
import MonetaryInput from "../Form/Form.MonetaryInput";
|
|
15
17
|
import PasswordInput from "../Form/Form.PasswordInput";
|
|
18
|
+
import PinInput from "../Form/Form.PinInput";
|
|
16
19
|
import QuantitySelector from "../Form/Form.QuantitySelector";
|
|
17
20
|
import RadioButton from "../Form/Form.RadioButton";
|
|
18
21
|
import SearchBar from "../Form/Form.SearchBar";
|
|
22
|
+
import Select from "../Form/Form.Select";
|
|
23
|
+
import Slider from "../Form/Form.Slider";
|
|
24
|
+
import Switch from "../Form/Form.Switch";
|
|
19
25
|
import TextInput from "../Form/Form.TextInput";
|
|
20
26
|
export const Form = {
|
|
21
27
|
TextInput,
|
|
@@ -28,6 +34,12 @@ export const Form = {
|
|
|
28
34
|
FractionalQuantityInput,
|
|
29
35
|
RadioButton,
|
|
30
36
|
Checkbox,
|
|
37
|
+
Switch,
|
|
38
|
+
Select,
|
|
39
|
+
PinInput,
|
|
40
|
+
Slider,
|
|
41
|
+
DatePicker,
|
|
42
|
+
FAB,
|
|
31
43
|
SearchBar,
|
|
32
44
|
Dropdown,
|
|
33
45
|
MonetaryInput,
|