@utilitywarehouse/hearth-react-native 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-lint.log +3 -1
- package/CHANGELOG.md +34 -0
- package/build/components/Alert/AlertCloseButton.js +25 -3
- package/build/components/Alert/AlertIcon.js +17 -1
- package/build/components/Alert/AlertIconButton.js +27 -1
- package/build/components/Alert/AlertLink.js +47 -1
- package/build/components/Alert/AlertText.d.ts +1 -1
- package/build/components/Alert/AlertText.js +26 -2
- package/build/components/Alert/AlertTitle.d.ts +1 -1
- package/build/components/Alert/AlertTitle.js +26 -2
- package/build/components/Badge/Badge.js +101 -14
- package/build/components/Badge/Badge.props.d.ts +2 -2
- package/build/components/Badge/BadgeIcon.js +27 -29
- package/build/components/Badge/BadgeText.js +29 -31
- package/build/components/Button/Button.d.ts +2 -2
- package/build/components/Button/ButtonGroupRoot.d.ts +3 -2
- package/build/components/Button/ButtonGroupRoot.js +9 -0
- package/build/components/Button/ButtonRoot.js +1 -0
- package/build/components/Card/Card.props.d.ts +2 -2
- package/build/components/Checkbox/Checkbox.d.ts +2 -2
- package/build/components/Checkbox/Checkbox.js +11 -10
- package/build/components/Checkbox/Checkbox.props.d.ts +3 -1
- package/build/components/Checkbox/CheckboxIcon.js +1 -1
- package/build/components/Checkbox/CheckboxImage.d.ts +6 -0
- package/build/components/Checkbox/CheckboxImage.js +5 -0
- package/build/components/Checkbox/CheckboxTileRoot.js +1 -1
- package/build/components/Checkbox/index.d.ts +3 -2
- package/build/components/Checkbox/index.js +2 -1
- package/build/components/CurrencyInput/CurrencyInput.d.ts +6 -0
- package/build/components/CurrencyInput/CurrencyInput.js +47 -0
- package/build/components/CurrencyInput/CurrencyInput.props.d.ts +14 -0
- package/build/components/CurrencyInput/CurrencyInput.props.js +1 -0
- package/build/components/CurrencyInput/index.d.ts +1 -0
- package/build/components/CurrencyInput/index.js +1 -0
- package/build/components/DescriptionList/DescriptionList.context.d.ts +6 -0
- package/build/components/DescriptionList/DescriptionList.context.js +9 -0
- package/build/components/DescriptionList/DescriptionList.d.ts +6 -0
- package/build/components/DescriptionList/DescriptionList.js +25 -0
- package/build/components/DescriptionList/DescriptionList.props.d.ts +18 -0
- package/build/components/DescriptionList/DescriptionList.props.js +1 -0
- package/build/components/DescriptionList/DescriptionListItem.d.ts +6 -0
- package/build/components/DescriptionList/DescriptionListItem.js +49 -0
- package/build/components/DescriptionList/DescriptionListItem.props.d.ts +17 -0
- package/build/components/DescriptionList/DescriptionListItem.props.js +1 -0
- package/build/components/DescriptionList/index.d.ts +4 -0
- package/build/components/DescriptionList/index.js +2 -0
- package/build/components/Divider/Divider.js +46 -0
- package/build/components/Divider/Divider.props.d.ts +2 -2
- package/build/components/Flex/Flex.props.d.ts +3 -2
- package/build/components/Grid/Grid.props.d.ts +2 -2
- package/build/components/IconContainer/IconContainer.d.ts +5 -0
- package/build/components/IconContainer/IconContainer.js +161 -0
- package/build/components/IconContainer/IconContainer.props.d.ts +15 -0
- package/build/components/IconContainer/IconContainer.props.js +1 -0
- package/build/components/IconContainer/index.d.ts +2 -0
- package/build/components/IconContainer/index.js +1 -0
- package/build/components/Icons/CircleIcon.js +3 -3
- package/build/components/Input/Input.js +2 -34
- package/build/components/Input/Input.props.d.ts +1 -17
- package/build/components/Input/InputField.js +0 -7
- package/build/components/Link/Link.d.ts +1 -1
- package/build/components/Link/Link.js +4 -4
- package/build/components/Link/Link.props.d.ts +3 -0
- package/build/components/Modal/Modal.js +17 -1
- package/build/components/Radio/Radio.d.ts +2 -2
- package/build/components/Radio/Radio.js +9 -8
- package/build/components/Radio/Radio.props.d.ts +3 -1
- package/build/components/Radio/RadioImage.d.ts +6 -0
- package/build/components/Radio/RadioImage.js +5 -0
- package/build/components/Radio/RadioTileRoot.js +1 -1
- package/build/components/Radio/index.d.ts +3 -2
- package/build/components/Radio/index.js +2 -1
- package/build/components/SectionHeader/SectionHeader.js +1 -0
- package/build/components/Select/SelectOption.js +1 -7
- package/build/components/Tabs/Tab.d.ts +18 -0
- package/build/components/Tabs/Tab.js +74 -0
- package/build/components/Tabs/Tab.props.d.ts +14 -0
- package/build/components/Tabs/Tab.props.js +1 -0
- package/build/components/Tabs/TabPanel.d.ts +3 -0
- package/build/components/Tabs/TabPanel.js +34 -0
- package/build/components/Tabs/TabPanel.props.d.ts +8 -0
- package/build/components/Tabs/TabPanel.props.js +1 -0
- package/build/components/Tabs/Tabs.context.d.ts +23 -0
- package/build/components/Tabs/Tabs.context.js +8 -0
- package/build/components/Tabs/Tabs.d.ts +6 -0
- package/build/components/Tabs/Tabs.js +114 -0
- package/build/components/Tabs/Tabs.props.d.ts +19 -0
- package/build/components/Tabs/Tabs.props.js +1 -0
- package/build/components/Tabs/TabsList.d.ts +6 -0
- package/build/components/Tabs/TabsList.js +112 -0
- package/build/components/Tabs/TabsList.props.d.ts +6 -0
- package/build/components/Tabs/TabsList.props.js +1 -0
- package/build/components/Tabs/index.d.ts +8 -0
- package/build/components/Tabs/index.js +4 -0
- package/build/components/UnstyledIconButton/UnstyledIconButton.d.ts +1 -1
- package/build/components/UnstyledIconButton/UnstyledIconButton.js +4 -4
- package/build/components/UnstyledIconButton/UnstyledIconButton.props.d.ts +2 -1
- package/build/components/index.d.ts +4 -0
- package/build/components/index.js +4 -0
- package/build/core/themes.d.ts +428 -160
- package/build/core/themes.js +57 -1
- package/build/tokens/color.d.ts +88 -80
- package/build/tokens/color.js +44 -40
- package/build/tokens/components/dark/alert.d.ts +13 -0
- package/build/tokens/components/dark/alert.js +13 -0
- package/build/tokens/components/dark/button.d.ts +1 -0
- package/build/tokens/components/dark/button.js +1 -0
- package/build/tokens/components/dark/checkbox.d.ts +4 -1
- package/build/tokens/components/dark/checkbox.js +4 -1
- package/build/tokens/components/dark/icon-button.d.ts +10 -3
- package/build/tokens/components/dark/icon-button.js +10 -3
- package/build/tokens/components/dark/index.d.ts +1 -0
- package/build/tokens/components/dark/index.js +1 -0
- package/build/tokens/components/dark/link.d.ts +5 -0
- package/build/tokens/components/dark/link.js +5 -0
- package/build/tokens/components/dark/progress-bar.d.ts +41 -0
- package/build/tokens/components/dark/progress-bar.js +40 -0
- package/build/tokens/components/dark/radio.d.ts +1 -1
- package/build/tokens/components/dark/radio.js +1 -1
- package/build/tokens/components/dark/tabs.d.ts +2 -0
- package/build/tokens/components/dark/tabs.js +2 -0
- package/build/tokens/components/light/alert.d.ts +13 -0
- package/build/tokens/components/light/alert.js +13 -0
- package/build/tokens/components/light/badge.d.ts +1 -1
- package/build/tokens/components/light/badge.js +1 -1
- package/build/tokens/components/light/button.d.ts +1 -0
- package/build/tokens/components/light/button.js +1 -0
- package/build/tokens/components/light/checkbox.d.ts +6 -3
- package/build/tokens/components/light/checkbox.js +6 -3
- package/build/tokens/components/light/icon-button.d.ts +8 -1
- package/build/tokens/components/light/icon-button.js +8 -1
- package/build/tokens/components/light/index.d.ts +1 -0
- package/build/tokens/components/light/index.js +1 -0
- package/build/tokens/components/light/link.d.ts +5 -0
- package/build/tokens/components/light/link.js +5 -0
- package/build/tokens/components/light/progress-bar.d.ts +41 -0
- package/build/tokens/components/light/progress-bar.js +40 -0
- package/build/tokens/components/light/radio.d.ts +3 -3
- package/build/tokens/components/light/radio.js +3 -3
- package/build/tokens/components/light/tabs.d.ts +2 -0
- package/build/tokens/components/light/tabs.js +2 -0
- package/build/tokens/index.d.ts +1 -0
- package/build/tokens/index.js +1 -0
- package/build/tokens/layout.d.ts +48 -30
- package/build/tokens/layout.js +24 -15
- package/build/tokens/motion.d.ts +23 -0
- package/build/tokens/motion.js +22 -0
- package/build/tokens/primitive.d.ts +19 -0
- package/build/tokens/primitive.js +19 -0
- package/build/tokens/semantic-dark.d.ts +26 -24
- package/build/tokens/semantic-dark.js +26 -24
- package/build/tokens/semantic-light.d.ts +18 -16
- package/build/tokens/semantic-light.js +18 -16
- package/build/types/values.d.ts +2 -1
- package/build/utils/formatThousands.d.ts +2 -0
- package/build/utils/formatThousands.js +16 -0
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.js +1 -0
- package/docs/assets/bank-logo.png +0 -0
- package/docs/assets/bank-logo1.png +0 -0
- package/docs/components/AllComponents.web.tsx +97 -8
- package/docs/components/NextPrevPage.tsx +11 -3
- package/docs/components/UsageWrap.tsx +2 -2
- package/docs/components/index.ts +6 -7
- package/docs/heplers/addReactNativePrefix.ts +8 -0
- package/docs/heplers/index.ts +1 -0
- package/docs/introduction.mdx +3 -3
- package/docs/theme-tokens.mdx +42 -0
- package/package.json +13 -13
- package/src/components/Alert/AlertCloseButton.tsx +33 -5
- package/src/components/Alert/AlertIcon.tsx +17 -1
- package/src/components/Alert/AlertIconButton.tsx +37 -4
- package/src/components/Alert/AlertLink.tsx +52 -1
- package/src/components/Alert/AlertText.tsx +28 -3
- package/src/components/Alert/AlertTitle.tsx +28 -3
- package/src/components/Badge/Badge.docs.mdx +7 -7
- package/src/components/Badge/Badge.props.ts +3 -2
- package/src/components/Badge/Badge.stories.tsx +81 -92
- package/src/components/Badge/Badge.tsx +101 -14
- package/src/components/Badge/BadgeIcon.tsx +27 -29
- package/src/components/Badge/BadgeText.tsx +29 -31
- package/src/components/Button/ButtonGroupRoot.tsx +12 -2
- package/src/components/Button/ButtonRoot.tsx +1 -0
- package/src/components/Card/Card.docs.mdx +1 -1
- package/src/components/Card/Card.props.ts +2 -2
- package/src/components/Checkbox/Checkbox.docs.mdx +45 -7
- package/src/components/Checkbox/Checkbox.props.ts +3 -1
- package/src/components/Checkbox/Checkbox.stories.tsx +37 -1
- package/src/components/Checkbox/Checkbox.tsx +12 -9
- package/src/components/Checkbox/CheckboxIcon.tsx +1 -1
- package/src/components/Checkbox/CheckboxImage.tsx +9 -0
- package/src/components/Checkbox/CheckboxTileRoot.tsx +1 -1
- package/src/components/Checkbox/index.ts +3 -2
- package/src/components/CurrencyInput/CurrencyInput.docs.mdx +120 -0
- package/src/components/CurrencyInput/CurrencyInput.props.ts +19 -0
- package/src/components/CurrencyInput/CurrencyInput.stories.tsx +116 -0
- package/src/components/CurrencyInput/CurrencyInput.tsx +91 -0
- package/src/components/CurrencyInput/index.ts +1 -0
- package/src/components/DescriptionList/DescriptionList.context.ts +18 -0
- package/src/components/DescriptionList/DescriptionList.docs.mdx +98 -0
- package/src/components/DescriptionList/DescriptionList.props.ts +20 -0
- package/src/components/DescriptionList/DescriptionList.stories.tsx +154 -0
- package/src/components/DescriptionList/DescriptionList.tsx +64 -0
- package/src/components/DescriptionList/DescriptionListItem.props.ts +19 -0
- package/src/components/DescriptionList/DescriptionListItem.tsx +101 -0
- package/src/components/DescriptionList/index.ts +4 -0
- package/src/components/Divider/Divider.props.ts +2 -2
- package/src/components/Divider/Divider.stories.tsx +3 -3
- package/src/components/Divider/Divider.tsx +46 -0
- package/src/components/Flex/Flex.docs.mdx +4 -4
- package/src/components/Flex/Flex.props.ts +3 -2
- package/src/components/Flex/Flex.stories.tsx +1 -1
- package/src/components/Grid/Grid.docs.mdx +12 -12
- package/src/components/Grid/Grid.props.ts +2 -2
- package/src/components/Grid/Grid.stories.tsx +2 -2
- package/src/components/IconContainer/IconContainer.docs.mdx +90 -0
- package/src/components/IconContainer/IconContainer.props.ts +17 -0
- package/src/components/IconContainer/IconContainer.stories.tsx +130 -0
- package/src/components/IconContainer/IconContainer.tsx +180 -0
- package/src/components/IconContainer/index.tsx +2 -0
- package/src/components/Icons/CircleIcon.tsx +9 -11
- package/src/components/Input/Input.docs.mdx +3 -3
- package/src/components/Input/Input.props.ts +0 -20
- package/src/components/Input/Input.stories.tsx +0 -6
- package/src/components/Input/Input.tsx +2 -49
- package/src/components/Input/InputField.tsx +0 -7
- package/src/components/Link/Link.props.ts +3 -0
- package/src/components/Link/Link.tsx +12 -6
- package/src/components/List/List.docs.mdx +24 -23
- package/src/components/Modal/Modal.tsx +18 -0
- package/src/components/Radio/Radio.docs.mdx +96 -124
- package/src/components/Radio/Radio.props.ts +3 -1
- package/src/components/Radio/Radio.stories.tsx +47 -0
- package/src/components/Radio/Radio.tsx +10 -7
- package/src/components/Radio/RadioImage.tsx +9 -0
- package/src/components/Radio/RadioTileRoot.tsx +1 -1
- package/src/components/Radio/index.ts +3 -2
- package/src/components/SectionHeader/SectionHeader.tsx +1 -0
- package/src/components/Select/Select.docs.mdx +6 -6
- package/src/components/Select/Select.stories.tsx +7 -7
- package/src/components/Select/SelectOption.tsx +4 -10
- package/src/components/Tabs/Tab.props.ts +16 -0
- package/src/components/Tabs/Tab.tsx +113 -0
- package/src/components/Tabs/TabPanel.props.ts +10 -0
- package/src/components/Tabs/TabPanel.tsx +46 -0
- package/src/components/Tabs/Tabs.context.ts +26 -0
- package/src/components/Tabs/Tabs.docs.mdx +214 -0
- package/src/components/Tabs/Tabs.props.ts +21 -0
- package/src/components/Tabs/Tabs.stories.tsx +270 -0
- package/src/components/Tabs/Tabs.tsx +139 -0
- package/src/components/Tabs/TabsList.props.ts +8 -0
- package/src/components/Tabs/TabsList.tsx +194 -0
- package/src/components/Tabs/index.ts +8 -0
- package/src/components/UnstyledIconButton/UnstyledIconButton.props.ts +2 -1
- package/src/components/UnstyledIconButton/UnstyledIconButton.tsx +9 -3
- package/src/components/index.ts +4 -0
- package/src/core/themes.ts +57 -1
- package/src/tokens/color.ts +44 -40
- package/src/tokens/components/dark/alert.ts +13 -0
- package/src/tokens/components/dark/button.ts +1 -0
- package/src/tokens/components/dark/checkbox.ts +4 -1
- package/src/tokens/components/dark/icon-button.ts +10 -3
- package/src/tokens/components/dark/index.ts +1 -0
- package/src/tokens/components/dark/link.ts +5 -0
- package/src/tokens/components/dark/progress-bar.ts +41 -0
- package/src/tokens/components/dark/radio.ts +1 -1
- package/src/tokens/components/dark/tabs.ts +2 -0
- package/src/tokens/components/light/alert.ts +13 -0
- package/src/tokens/components/light/badge.ts +1 -1
- package/src/tokens/components/light/button.ts +1 -0
- package/src/tokens/components/light/checkbox.ts +6 -3
- package/src/tokens/components/light/icon-button.ts +8 -1
- package/src/tokens/components/light/index.ts +1 -0
- package/src/tokens/components/light/link.ts +5 -0
- package/src/tokens/components/light/progress-bar.ts +41 -0
- package/src/tokens/components/light/radio.ts +3 -3
- package/src/tokens/components/light/tabs.ts +2 -0
- package/src/tokens/index.ts +1 -0
- package/src/tokens/layout.ts +24 -15
- package/src/tokens/motion.ts +23 -0
- package/src/tokens/primitive.ts +19 -0
- package/src/tokens/semantic-dark.ts +26 -24
- package/src/tokens/semantic-light.ts +18 -16
- package/src/types/values.ts +3 -1
- package/src/utils/formatThousands.ts +14 -0
- package/src/utils/index.ts +1 -0
- package/docs/assets/react-native-pig.png +0 -0
- package/docs/components/AdvancedRadioExample.tsx +0 -126
|
@@ -4,10 +4,10 @@ import { BodyText } from '../BodyText';
|
|
|
4
4
|
import { useBadgeContext } from './Badge.context';
|
|
5
5
|
|
|
6
6
|
const BadgeText = ({ children, style, ...props }: TextProps) => {
|
|
7
|
-
const { variant, colorScheme } = useBadgeContext();
|
|
7
|
+
const { variant, colorScheme, size } = useBadgeContext();
|
|
8
8
|
styles.useVariants({ variant, colorScheme });
|
|
9
9
|
return (
|
|
10
|
-
<BodyText {...props} size=
|
|
10
|
+
<BodyText {...props} size={size} weight="semibold" style={[styles.text, style]}>
|
|
11
11
|
{children}
|
|
12
12
|
</BodyText>
|
|
13
13
|
);
|
|
@@ -30,91 +30,89 @@ const styles = StyleSheet.create(theme => ({
|
|
|
30
30
|
insurance: {},
|
|
31
31
|
cashback: {},
|
|
32
32
|
pig: {},
|
|
33
|
+
highlight: {},
|
|
33
34
|
},
|
|
34
35
|
variant: {
|
|
35
|
-
|
|
36
|
+
emphasis: {
|
|
37
|
+
color: theme.color.text.primary,
|
|
38
|
+
},
|
|
39
|
+
subtle: {
|
|
36
40
|
color: theme.color.text.primary,
|
|
37
41
|
},
|
|
38
42
|
outline: {},
|
|
39
43
|
},
|
|
40
44
|
},
|
|
41
45
|
compoundVariants: [
|
|
42
|
-
//
|
|
46
|
+
// Emphasis
|
|
43
47
|
{
|
|
44
48
|
colorScheme: 'info',
|
|
45
|
-
variant: '
|
|
49
|
+
variant: 'emphasis',
|
|
46
50
|
styles: {
|
|
47
51
|
color: theme.color.feedback.info.foreground.default,
|
|
48
52
|
},
|
|
49
53
|
},
|
|
50
54
|
{
|
|
51
55
|
colorScheme: 'danger',
|
|
52
|
-
variant: '
|
|
56
|
+
variant: 'emphasis',
|
|
53
57
|
styles: {
|
|
54
58
|
color: theme.color.feedback.danger.foreground.default,
|
|
55
59
|
},
|
|
56
60
|
},
|
|
57
61
|
{
|
|
58
62
|
colorScheme: 'positive',
|
|
59
|
-
variant: '
|
|
63
|
+
variant: 'emphasis',
|
|
60
64
|
styles: {
|
|
61
65
|
color: theme.color.feedback.positive.foreground.default,
|
|
62
66
|
},
|
|
63
67
|
},
|
|
64
68
|
{
|
|
65
69
|
colorScheme: 'warning',
|
|
66
|
-
variant: '
|
|
70
|
+
variant: 'emphasis',
|
|
67
71
|
styles: {
|
|
68
72
|
color: theme.color.feedback.warning.foreground.default,
|
|
69
73
|
},
|
|
70
74
|
},
|
|
71
75
|
{
|
|
72
76
|
colorScheme: 'functional',
|
|
73
|
-
variant: '
|
|
77
|
+
variant: 'emphasis',
|
|
74
78
|
styles: {
|
|
75
79
|
color: theme.color.feedback.functional.foreground.default,
|
|
76
80
|
},
|
|
77
81
|
},
|
|
82
|
+
// Subtle
|
|
78
83
|
{
|
|
79
|
-
colorScheme: '
|
|
80
|
-
variant: '
|
|
81
|
-
styles: {
|
|
82
|
-
color: theme.color.text.primary,
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
colorScheme: 'broadband',
|
|
87
|
-
variant: 'solid',
|
|
84
|
+
colorScheme: 'info',
|
|
85
|
+
variant: 'subtle',
|
|
88
86
|
styles: {
|
|
89
|
-
color: theme.color.
|
|
87
|
+
color: theme.color.feedback.info.foreground.default,
|
|
90
88
|
},
|
|
91
89
|
},
|
|
92
90
|
{
|
|
93
|
-
colorScheme: '
|
|
94
|
-
variant: '
|
|
91
|
+
colorScheme: 'danger',
|
|
92
|
+
variant: 'subtle',
|
|
95
93
|
styles: {
|
|
96
|
-
color: theme.color.
|
|
94
|
+
color: theme.color.feedback.danger.foreground.default,
|
|
97
95
|
},
|
|
98
96
|
},
|
|
99
97
|
{
|
|
100
|
-
colorScheme: '
|
|
101
|
-
variant: '
|
|
98
|
+
colorScheme: 'positive',
|
|
99
|
+
variant: 'subtle',
|
|
102
100
|
styles: {
|
|
103
|
-
color: theme.color.
|
|
101
|
+
color: theme.color.feedback.positive.foreground.default,
|
|
104
102
|
},
|
|
105
103
|
},
|
|
106
104
|
{
|
|
107
|
-
colorScheme: '
|
|
108
|
-
variant: '
|
|
105
|
+
colorScheme: 'warning',
|
|
106
|
+
variant: 'subtle',
|
|
109
107
|
styles: {
|
|
110
|
-
color: theme.color.
|
|
108
|
+
color: theme.color.feedback.warning.foreground.default,
|
|
111
109
|
},
|
|
112
110
|
},
|
|
113
111
|
{
|
|
114
|
-
colorScheme: '
|
|
115
|
-
variant: '
|
|
112
|
+
colorScheme: 'functional',
|
|
113
|
+
variant: 'subtle',
|
|
116
114
|
styles: {
|
|
117
|
-
color: theme.color.
|
|
115
|
+
color: theme.color.feedback.functional.foreground.default,
|
|
118
116
|
},
|
|
119
117
|
},
|
|
120
118
|
// Outline
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { type StyleProp, type
|
|
1
|
+
import { type StyleProp, type ViewProps, type ViewStyle, View } from 'react-native';
|
|
2
2
|
import { StyleSheet } from 'react-native-unistyles';
|
|
3
|
+
import { SpacingValues } from '../../types';
|
|
3
4
|
|
|
4
5
|
const ButtonGroupRoot = ({
|
|
5
6
|
children,
|
|
@@ -12,7 +13,7 @@ const ButtonGroupRoot = ({
|
|
|
12
13
|
flexDirection?: ViewStyle['flexDirection'];
|
|
13
14
|
reversed?: boolean;
|
|
14
15
|
attached?: boolean;
|
|
15
|
-
space?:
|
|
16
|
+
space?: SpacingValues;
|
|
16
17
|
}) => {
|
|
17
18
|
let direction = flexDirection;
|
|
18
19
|
if (reversed) {
|
|
@@ -41,6 +42,12 @@ const styles = StyleSheet.create(theme => ({
|
|
|
41
42
|
text: {
|
|
42
43
|
variants: {
|
|
43
44
|
space: {
|
|
45
|
+
none: {
|
|
46
|
+
gap: theme.layout.mobile.spacing.none,
|
|
47
|
+
},
|
|
48
|
+
'2xs': {
|
|
49
|
+
gap: theme.layout.mobile.spacing['2xs'],
|
|
50
|
+
},
|
|
44
51
|
xs: {
|
|
45
52
|
gap: theme.layout.mobile.spacing.xs,
|
|
46
53
|
},
|
|
@@ -56,6 +63,9 @@ const styles = StyleSheet.create(theme => ({
|
|
|
56
63
|
xl: {
|
|
57
64
|
gap: theme.layout.mobile.spacing.xl,
|
|
58
65
|
},
|
|
66
|
+
'2xl': {
|
|
67
|
+
gap: theme.layout.mobile.spacing['2xl'],
|
|
68
|
+
},
|
|
59
69
|
},
|
|
60
70
|
attached: {
|
|
61
71
|
true: {
|
|
@@ -201,6 +201,7 @@ const styles = StyleSheet.create(theme => ({
|
|
|
201
201
|
colorScheme: 'affirmative',
|
|
202
202
|
styles: {
|
|
203
203
|
backgroundColor: theme.color.interactive.affirmative.surface.strong.default,
|
|
204
|
+
borderColor: theme.color.interactive.affirmative.border.strong,
|
|
204
205
|
_web: {
|
|
205
206
|
_hover: {
|
|
206
207
|
backgroundColor: theme.color.interactive.affirmative.surface.strong.hover,
|
|
@@ -57,7 +57,7 @@ const MyComponent = () => (
|
|
|
57
57
|
| selected | `boolean` | Whether the card is selected. | `false` |
|
|
58
58
|
| onPress | `() => void` | Callback function to be called. | - |
|
|
59
59
|
| disabled | `boolean` | Whether the card is disabled. | `false` |
|
|
60
|
-
| space | `'none' \| 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'`
|
|
60
|
+
| space | `'none' \| '2xs' \| 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| '2xl'` | The space between the content. | `none` |
|
|
61
61
|
| alignItems | `'flex-start' \| 'flex-end' \| `<br />`'center' \| 'stretch' \| 'baseline'` | The align items of the flex container. | `flex-start` |
|
|
62
62
|
| justifyContent | `'flex-start' \| 'flex-end' \| 'center' \| 'space-between' \| `<br />` 'space-around' \| 'space-evenly'` | The justify content of the flex container. | `flex-start` |
|
|
63
63
|
| flexWrap | `'wrap' \| 'nowrap' \| 'wrap-reverse'` | The wrap of the flex container. | `nowrap` |
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PressableProps, ViewStyle } from 'react-native';
|
|
2
|
-
import { SpaceValue } from '../../types';
|
|
2
|
+
import { SpaceValue, SpacingValues } from '../../types';
|
|
3
3
|
|
|
4
4
|
interface CardProps extends PressableProps {
|
|
5
5
|
variant?: 'emphasis' | 'subtle';
|
|
@@ -15,7 +15,7 @@ interface CardProps extends PressableProps {
|
|
|
15
15
|
| 'pig';
|
|
16
16
|
noPadding?: boolean;
|
|
17
17
|
disabled?: boolean;
|
|
18
|
-
space?:
|
|
18
|
+
space?: SpacingValues;
|
|
19
19
|
alignItems?: ViewStyle['alignItems'];
|
|
20
20
|
justifyContent?: ViewStyle['justifyContent'];
|
|
21
21
|
flexDirection?: ViewStyle['flexDirection'];
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { Canvas, Controls, Meta, Story } from '@storybook/addon-docs/blocks';
|
|
2
|
+
import { TickSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';
|
|
3
3
|
import {
|
|
4
|
+
Box,
|
|
5
|
+
Center,
|
|
4
6
|
Checkbox,
|
|
5
7
|
CheckboxGroup,
|
|
6
|
-
CheckboxTile,
|
|
7
8
|
CheckboxIndicator,
|
|
8
9
|
CheckboxLabel,
|
|
9
|
-
|
|
10
|
-
Box,
|
|
10
|
+
CheckboxTile,
|
|
11
11
|
FormField,
|
|
12
12
|
} from '../../';
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
13
|
+
import { BackToTopButton, UsageWrap, ViewFigmaButton } from '../../../docs/components';
|
|
14
|
+
import * as Stories from './Checkbox.stories';
|
|
15
15
|
|
|
16
16
|
<Meta title="Forms / Checkbox" />
|
|
17
17
|
|
|
@@ -33,10 +33,12 @@ Whether you're building a simple form or a complex data collection system, the C
|
|
|
33
33
|
- [`CheckboxIcon`](#checkboxicon)
|
|
34
34
|
- [`CheckboxLabel`](#checkboxlabel)
|
|
35
35
|
- [`CheckboxGroup`](#checkboxgroup)
|
|
36
|
+
- [`CheckboxImage`](#checkboximage)
|
|
36
37
|
- [Variants](#variants)
|
|
37
38
|
- [Advanced Usage](#advanced-usage)
|
|
38
39
|
- [Examples](#examples)
|
|
39
40
|
- [`CheckboxTile` component](#checkboxtile-component)
|
|
41
|
+
- [`CheckboxImage` component](#checkboximage-component)
|
|
40
42
|
- [`CheckboxGroup` component](#checkboxgroup-component)
|
|
41
43
|
|
|
42
44
|
## Playground
|
|
@@ -89,6 +91,7 @@ const MyComponent = () => {
|
|
|
89
91
|
| `validText` | `string` | - | The valid text to be displayed below the checkbox. |
|
|
90
92
|
| `showValidationIcon` | `boolean` | `true` | Whether to show the validation icon. |
|
|
91
93
|
| `type` | `'default' \| 'tile'` | `default` | The type of the checkbox. |
|
|
94
|
+
| `image` | `ImageProps` | - | The image to be displayed next to the label. |
|
|
92
95
|
|
|
93
96
|
## Components
|
|
94
97
|
|
|
@@ -205,6 +208,10 @@ const MyComponent = () => {
|
|
|
205
208
|
| `disabled` | `bool` | `false` | To manually set disable to the checkbox. |
|
|
206
209
|
| `validationStatus` | `'valid' \| 'invalid' \| 'initial'` | - | The validation status of the checkbox group. |
|
|
207
210
|
|
|
211
|
+
### `CheckboxImage`
|
|
212
|
+
|
|
213
|
+
The `CheckboxImage` component is used to display an image next to the checkbox label. It inherits all the properties of React Native's `Image` component.
|
|
214
|
+
|
|
208
215
|
## Variants
|
|
209
216
|
|
|
210
217
|
<Canvas of={Stories.Variants} />
|
|
@@ -322,6 +329,37 @@ const MyComponent = () => {
|
|
|
322
329
|
};
|
|
323
330
|
```
|
|
324
331
|
|
|
332
|
+
### `CheckboxImage` component
|
|
333
|
+
|
|
334
|
+
The `CheckboxImage` component is used to display an image next to the checkbox label. It inherits all the properties of React Native's `Image` component.
|
|
335
|
+
|
|
336
|
+
<Canvas of={Stories.WithImage} />
|
|
337
|
+
|
|
338
|
+
```tsx
|
|
339
|
+
import { Checkbox } from '@utilitywarehouse/native-ui';
|
|
340
|
+
import visaLogo from '../../../assets/visa.png';
|
|
341
|
+
import mastercardLogo from '../../../assets/mastercard.png';
|
|
342
|
+
|
|
343
|
+
const MyComponent = () => {
|
|
344
|
+
return (
|
|
345
|
+
<CheckboxGroup>
|
|
346
|
+
<Checkbox
|
|
347
|
+
value="visa"
|
|
348
|
+
aria-label="Visa"
|
|
349
|
+
label="Visa"
|
|
350
|
+
image={{ source: visaLogo, style: { width: 40, height: 24, resizeMode: 'contain' } }}
|
|
351
|
+
/>
|
|
352
|
+
<Checkbox
|
|
353
|
+
value="mastercard"
|
|
354
|
+
aria-label="Mastercard"
|
|
355
|
+
label="Mastercard"
|
|
356
|
+
image={{ source: mastercardLogo, style: { width: 40, height: 24, resizeMode: 'contain' } }}
|
|
357
|
+
/>
|
|
358
|
+
</CheckboxGroup>
|
|
359
|
+
);
|
|
360
|
+
};
|
|
361
|
+
```
|
|
362
|
+
|
|
325
363
|
### `CheckboxGroup` component
|
|
326
364
|
|
|
327
365
|
The `CheckboxGroup` component is used to group multiple `Checkbox` components together.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
|
-
import type { PressableProps, ViewProps } from 'react-native';
|
|
2
|
+
import type { ImageProps, PressableProps, ViewProps } from 'react-native';
|
|
3
3
|
|
|
4
4
|
type CheckboxBaseProps = {
|
|
5
5
|
onChange?: (isSelected: boolean) => void;
|
|
@@ -26,6 +26,7 @@ type CheckboxWithChildrenProps = {
|
|
|
26
26
|
invalidText?: never;
|
|
27
27
|
validText?: never;
|
|
28
28
|
showValidationIcon?: never;
|
|
29
|
+
image?: never;
|
|
29
30
|
} & CheckboxBaseProps;
|
|
30
31
|
|
|
31
32
|
type CheckboxWithoutChildrenProps = {
|
|
@@ -36,6 +37,7 @@ type CheckboxWithoutChildrenProps = {
|
|
|
36
37
|
invalidText?: string;
|
|
37
38
|
validText?: string;
|
|
38
39
|
showValidationIcon?: boolean;
|
|
40
|
+
image?: ImageProps;
|
|
39
41
|
} & CheckboxBaseProps;
|
|
40
42
|
|
|
41
43
|
type CheckboxProps = CheckboxWithChildrenProps | CheckboxWithoutChildrenProps;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
1
2
|
import React, { useEffect } from 'react';
|
|
3
|
+
import { ImageSourcePropType } from 'react-native';
|
|
2
4
|
import { Checkbox, CheckboxGroup } from '.';
|
|
3
|
-
import
|
|
5
|
+
import bankLogo from '../../../docs/assets/bank-logo.png';
|
|
6
|
+
import bankLogo1 from '../../../docs/assets/bank-logo1.png';
|
|
4
7
|
import { VariantTitle } from '../../../docs/components';
|
|
5
8
|
|
|
6
9
|
const meta = {
|
|
@@ -91,6 +94,39 @@ export const Playground: Story = {
|
|
|
91
94
|
},
|
|
92
95
|
};
|
|
93
96
|
|
|
97
|
+
export const WithImage: Story = {
|
|
98
|
+
render: ({ children, ...args }) => (
|
|
99
|
+
<CheckboxGroup aria-label="Checkbox Group" nativeID="checkbox-group">
|
|
100
|
+
<Checkbox
|
|
101
|
+
aria-label="Visa"
|
|
102
|
+
onChange={(checked: boolean) => {
|
|
103
|
+
console.log(checked, '###');
|
|
104
|
+
}}
|
|
105
|
+
nativeID="checkbox-1"
|
|
106
|
+
{...args}
|
|
107
|
+
value="visa"
|
|
108
|
+
label="Visa"
|
|
109
|
+
image={{ source: bankLogo1 as ImageSourcePropType, style: { width: 40, height: 24 } }}
|
|
110
|
+
/>
|
|
111
|
+
<Checkbox
|
|
112
|
+
aria-label="Mastercard"
|
|
113
|
+
onChange={(checked: boolean) => {
|
|
114
|
+
console.log(checked, '###');
|
|
115
|
+
}}
|
|
116
|
+
nativeID="checkbox-2"
|
|
117
|
+
{...args}
|
|
118
|
+
value="mastercard"
|
|
119
|
+
label="Mastercard"
|
|
120
|
+
image={{
|
|
121
|
+
source: bankLogo as ImageSourcePropType,
|
|
122
|
+
style: { width: 40, height: 24 },
|
|
123
|
+
resizeMode: 'contain',
|
|
124
|
+
}}
|
|
125
|
+
/>
|
|
126
|
+
</CheckboxGroup>
|
|
127
|
+
),
|
|
128
|
+
};
|
|
129
|
+
|
|
94
130
|
export const Variants: Story = {
|
|
95
131
|
render: () => {
|
|
96
132
|
const [values, setValues] = React.useState(['Label 1']);
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { createCheckbox } from '@gluestack-ui/checkbox';
|
|
2
|
-
import
|
|
3
|
-
import StyledCheckboxIndicator from './CheckboxIndicator';
|
|
4
|
-
import StyledCheckboxIcon from './CheckboxIcon';
|
|
5
|
-
import StyledCheckboxLabel from './CheckboxLabel';
|
|
6
|
-
import StyledCheckboxGroup from './CheckboxGroupRoot';
|
|
7
|
-
import CheckboxProps from './Checkbox.props';
|
|
2
|
+
import { useFormFieldContext } from '../FormField';
|
|
8
3
|
import { Helper } from '../Helper';
|
|
4
|
+
import CheckboxProps from './Checkbox.props';
|
|
9
5
|
import { useCheckboxGroupContext } from './CheckboxGroup.context';
|
|
10
|
-
import
|
|
11
|
-
import
|
|
6
|
+
import StyledCheckboxGroup from './CheckboxGroupRoot';
|
|
7
|
+
import StyledCheckboxIcon from './CheckboxIcon';
|
|
8
|
+
import CheckboxImage from './CheckboxImage';
|
|
9
|
+
import StyledCheckboxIndicator from './CheckboxIndicator';
|
|
10
|
+
import StyledCheckboxLabel from './CheckboxLabel';
|
|
11
|
+
import StyledCheckbox from './CheckboxRoot';
|
|
12
12
|
import CheckboxTextContent from './CheckboxTextContent';
|
|
13
|
+
import CheckboxTileRoot from './CheckboxTileRoot';
|
|
13
14
|
|
|
14
15
|
const CheckboxComponent = createCheckbox({
|
|
15
16
|
Root: StyledCheckbox,
|
|
@@ -41,6 +42,7 @@ const Checkbox = ({
|
|
|
41
42
|
validationStatus: validation,
|
|
42
43
|
showValidationIcon,
|
|
43
44
|
type = 'default',
|
|
45
|
+
image,
|
|
44
46
|
...props
|
|
45
47
|
}: CheckboxProps) => {
|
|
46
48
|
const { validationStatus: fieldValidationStatus } = useFormFieldContext();
|
|
@@ -55,6 +57,7 @@ const Checkbox = ({
|
|
|
55
57
|
<CheckboxIndicator>
|
|
56
58
|
<CheckboxIcon />
|
|
57
59
|
</CheckboxIndicator>
|
|
60
|
+
{image ? <CheckboxImage {...image} /> : null}
|
|
58
61
|
<CheckboxTextContent>
|
|
59
62
|
{!!label && <CheckboxLabel>{label}</CheckboxLabel>}
|
|
60
63
|
{!!helperText && <Helper disabled={disabled} icon={helperIcon} text={helperText} />}
|
|
@@ -96,6 +99,6 @@ CheckboxTile.displayName = 'CheckboxTile';
|
|
|
96
99
|
|
|
97
100
|
Checkbox.displayName = 'Checkbox';
|
|
98
101
|
|
|
99
|
-
export { Checkbox, CheckboxGroup,
|
|
102
|
+
export { Checkbox, CheckboxGroup, CheckboxIcon, CheckboxIndicator, CheckboxLabel, CheckboxTile };
|
|
100
103
|
|
|
101
104
|
export default Checkbox;
|
|
@@ -19,7 +19,7 @@ const styles = StyleSheet.create(theme => ({
|
|
|
19
19
|
gap: theme.components.checkbox.gap,
|
|
20
20
|
padding: theme.components.checkbox.tile.padding,
|
|
21
21
|
borderWidth: theme.components.checkbox.tile.borderWidth,
|
|
22
|
-
borderColor: theme.color.border.
|
|
22
|
+
borderColor: theme.color.border.strong,
|
|
23
23
|
borderRadius: theme.components.checkbox.tile.borderRadius,
|
|
24
24
|
backgroundColor: theme.color.surface.neutral.strong,
|
|
25
25
|
variants: {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export {
|
|
2
2
|
default as Checkbox,
|
|
3
|
+
CheckboxIcon,
|
|
3
4
|
CheckboxIndicator,
|
|
4
5
|
CheckboxLabel,
|
|
5
|
-
CheckboxIcon,
|
|
6
6
|
CheckboxTile,
|
|
7
7
|
} from './Checkbox';
|
|
8
|
+
export type { default as CheckboxProps } from './Checkbox.props';
|
|
8
9
|
export { default as CheckboxGroup } from './CheckboxGroup';
|
|
9
10
|
export { default as CheckboxGroupTextContent } from './CheckboxGroupTextContent';
|
|
11
|
+
export { default as CheckboxImage } from './CheckboxImage';
|
|
10
12
|
export { default as CheckboxTextContent } from './CheckboxTextContent';
|
|
11
|
-
export type { default as CheckboxProps } from './Checkbox.props';
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
|
|
2
|
+
import { Center, CurrencyInput, FormField } from '../../';
|
|
3
|
+
import { BackToTopButton, UsageWrap, ViewFigmaButton } from '../../../docs/components';
|
|
4
|
+
import * as Stories from './CurrencyInput.stories';
|
|
5
|
+
|
|
6
|
+
<Meta title="Forms / Currency Input" />
|
|
7
|
+
|
|
8
|
+
<BackToTopButton />
|
|
9
|
+
|
|
10
|
+
<ViewFigmaButton url="https://www.figma.com/design/pjuYVErQWaAvs8rCAVgPKX/Motion-Tokens?node-id=2161-1336" />
|
|
11
|
+
|
|
12
|
+
# Currency Input
|
|
13
|
+
|
|
14
|
+
An input specialised for monetary amounts. It shows a currency symbol prefix and uses a decimal keypad where supported.
|
|
15
|
+
|
|
16
|
+
- [Playground](#playground)
|
|
17
|
+
- [Usage](#usage)
|
|
18
|
+
- [Props](#props)
|
|
19
|
+
- [States](#states)
|
|
20
|
+
- [Formatting](#formatting)
|
|
21
|
+
- [Accessibility](#accessibility)
|
|
22
|
+
|
|
23
|
+
## Playground
|
|
24
|
+
|
|
25
|
+
<Canvas of={Stories.Playground} />
|
|
26
|
+
<Controls of={Stories.Playground} />
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
<UsageWrap>
|
|
31
|
+
<Center>
|
|
32
|
+
<CurrencyInput placeholder="0.00" />
|
|
33
|
+
</Center>
|
|
34
|
+
</UsageWrap>
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
import { CurrencyInput } from '@utilitywarehouse/hearth-react-native';
|
|
38
|
+
|
|
39
|
+
const MyComponent = () => {
|
|
40
|
+
const [value, setValue] = useState('');
|
|
41
|
+
return (
|
|
42
|
+
<CurrencyInput value={value} onChange={e => setValue(e.nativeEvent.text)} placeholder="0.00" />
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Props
|
|
48
|
+
|
|
49
|
+
When using `CurrencyInput`, the component inherits React Native TextInput props (except `children`). In addition, it supports:
|
|
50
|
+
|
|
51
|
+
| Prop | Type | Default | Description |
|
|
52
|
+
| ------------------- | ----------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- |
|
|
53
|
+
| validationStatus | `'initial' \| 'valid' \| 'invalid'` | `'initial'` | Validation styling state |
|
|
54
|
+
| disabled | boolean | `false` | Disables the input |
|
|
55
|
+
| readonly | boolean | `false` | Makes the input read-only |
|
|
56
|
+
| focused | boolean | `false` | Forces the focused visual state |
|
|
57
|
+
| inBottomSheet | boolean | `false` | Use BottomSheetTextInput when true |
|
|
58
|
+
| placeholder | string | `'0.00'` | Placeholder text |
|
|
59
|
+
| autoFormatThousands | boolean | `false` | Automatically inserts thousand separators while the user types _(Only works with controlled components via onTextChange)_ |
|
|
60
|
+
|
|
61
|
+
Note: When used inside `FormField`, `validationStatus` and `disabled` are read from the context unless explicitly overridden.
|
|
62
|
+
|
|
63
|
+
## Examples
|
|
64
|
+
|
|
65
|
+
### With `FormField`
|
|
66
|
+
|
|
67
|
+
The `CurrencyInput` component can be used with the `FormField` component to create a custom input field.
|
|
68
|
+
For more information on the `FormField` component view the [docs here](/docs/components-form-field--docs).
|
|
69
|
+
|
|
70
|
+
<UsageWrap>
|
|
71
|
+
<Center>
|
|
72
|
+
<FormField label="Label" helperText="Helper text" helperPosition="bottom">
|
|
73
|
+
<CurrencyInput onChange={() => console.log('###')} />
|
|
74
|
+
</FormField>
|
|
75
|
+
</Center>
|
|
76
|
+
</UsageWrap>
|
|
77
|
+
|
|
78
|
+
```tsx
|
|
79
|
+
import { FormField, CurrencyInput } from '@utilitywarehouse/hearth-react-native';
|
|
80
|
+
|
|
81
|
+
const MyComponent = () => {
|
|
82
|
+
const [value, setValue] = useState('');
|
|
83
|
+
const handleChange = e => {
|
|
84
|
+
setValue(e.target.value);
|
|
85
|
+
};
|
|
86
|
+
return (
|
|
87
|
+
<FormField label="Label" helperText="Helper text" helperPosition="bottom">
|
|
88
|
+
<CurrencyInput onChange={handleChange} value={value} />
|
|
89
|
+
</FormField>
|
|
90
|
+
);
|
|
91
|
+
};
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## States
|
|
95
|
+
|
|
96
|
+
<Canvas of={Stories.States} />
|
|
97
|
+
|
|
98
|
+
## Formatting
|
|
99
|
+
|
|
100
|
+
Enable automatic thousand separator formatting by setting `autoFormatThousands`.
|
|
101
|
+
|
|
102
|
+
<Canvas of={Stories.AutoFormatThousands} />
|
|
103
|
+
|
|
104
|
+
```tsx
|
|
105
|
+
<CurrencyInput autoFormatThousands value="1234567.89" /> // displays 1,234,567.89
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Notes:
|
|
109
|
+
|
|
110
|
+
- Only digits, an optional leading minus and a single decimal point are formatted.
|
|
111
|
+
- Formatting is applied as you type; caret will move to the end (standard RN behaviour when programmatically updating value).
|
|
112
|
+
- Provide a controlled `value` if you need to manipulate or strip commas before persisting.
|
|
113
|
+
|
|
114
|
+
## Accessibility
|
|
115
|
+
|
|
116
|
+
The component uses a standard TextInput field and supports:
|
|
117
|
+
|
|
118
|
+
- Screen readers (VoiceOver/TalkBack)
|
|
119
|
+
- `aria-disabled`, `aria-required`, `aria-invalid` via underlying Input
|
|
120
|
+
- Decimal keypad and selection/cursor colors aligned with theme
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { TextInputProps, ViewProps } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export interface CurrencyInputBaseProps {
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
validationStatus?: 'initial' | 'valid' | 'invalid';
|
|
6
|
+
readonly?: boolean;
|
|
7
|
+
focused?: boolean;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
inBottomSheet?: boolean;
|
|
10
|
+
required?: boolean;
|
|
11
|
+
/** When true, automatically formats the numeric value with thousand separators (e.g. 1234 -> 1,234). */
|
|
12
|
+
autoFormatThousands?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type CurrencyInputProps = CurrencyInputBaseProps &
|
|
16
|
+
Omit<TextInputProps, 'children'> &
|
|
17
|
+
ViewProps;
|
|
18
|
+
|
|
19
|
+
export default CurrencyInputProps;
|