@utilitywarehouse/hearth-react-native 0.2.0 → 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/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-lint.log +1 -1
- package/CHANGELOG.md +22 -0
- package/build/components/Badge/Badge.js +101 -14
- package/build/components/Badge/Badge.props.d.ts +2 -2
- package/build/components/Badge/BadgeIcon.js +5 -79
- package/build/components/Badge/BadgeText.js +7 -81
- 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/Card/Card.props.d.ts +2 -2
- 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/Modal/Modal.js +17 -1
- package/build/components/SectionHeader/SectionHeader.js +1 -0
- 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/index.d.ts +4 -0
- package/build/components/index.js +4 -0
- package/build/core/themes.d.ts +416 -148
- package/build/core/themes.js +57 -1
- package/build/tokens/color.d.ts +76 -68
- package/build/tokens/color.js +38 -34
- 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 +1 -1
- package/build/tokens/components/dark/checkbox.js +1 -1
- package/build/tokens/components/dark/icon-button.d.ts +3 -3
- package/build/tokens/components/dark/icon-button.js +3 -3
- 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/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 +3 -3
- package/build/tokens/components/light/checkbox.js +3 -3
- package/build/tokens/components/light/icon-button.d.ts +1 -1
- package/build/tokens/components/light/icon-button.js +1 -1
- 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/layout.d.ts +48 -30
- package/build/tokens/layout.js +24 -15
- package/build/tokens/semantic-dark.d.ts +21 -19
- package/build/tokens/semantic-dark.js +21 -19
- package/build/tokens/semantic-light.d.ts +17 -15
- package/build/tokens/semantic-light.js +17 -15
- 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/components/AllComponents.web.tsx +97 -8
- package/docs/components/NextPrevPage.tsx +11 -3
- package/docs/components/UsageWrap.tsx +2 -2
- package/docs/heplers/addReactNativePrefix.ts +8 -0
- package/docs/heplers/index.ts +1 -0
- package/docs/theme-tokens.mdx +42 -0
- package/package.json +2 -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 +5 -79
- package/src/components/Badge/BadgeText.tsx +7 -81
- package/src/components/Button/ButtonGroupRoot.tsx +12 -2
- package/src/components/Card/Card.docs.mdx +1 -1
- package/src/components/Card/Card.props.ts +2 -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/Modal/Modal.tsx +18 -0
- package/src/components/SectionHeader/SectionHeader.tsx +1 -0
- 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/index.ts +4 -0
- package/src/core/themes.ts +57 -1
- package/src/tokens/color.ts +38 -34
- package/src/tokens/components/dark/button.ts +1 -0
- package/src/tokens/components/dark/checkbox.ts +1 -1
- package/src/tokens/components/dark/icon-button.ts +3 -3
- package/src/tokens/components/dark/radio.ts +1 -1
- package/src/tokens/components/dark/tabs.ts +2 -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 +3 -3
- package/src/tokens/components/light/icon-button.ts +1 -1
- package/src/tokens/components/light/radio.ts +3 -3
- package/src/tokens/components/light/tabs.ts +2 -0
- package/src/tokens/layout.ts +24 -15
- package/src/tokens/semantic-dark.ts +21 -19
- package/src/tokens/semantic-light.ts +17 -15
- package/src/types/values.ts +3 -1
- package/src/utils/formatThousands.ts +14 -0
- package/src/utils/index.ts +1 -0
package/.turbo/turbo-build.log
CHANGED
package/.turbo/turbo-lint.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @utilitywarehouse/hearth-react-native@0.
|
|
2
|
+
> @utilitywarehouse/hearth-react-native@0.3.0 lint /home/runner/work/hearth/hearth/packages/react-native
|
|
3
3
|
> TIMING=1 eslint --max-warnings 0
|
|
4
4
|
|
|
5
5
|
Rule | Time (ms) | Relative
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @utilitywarehouse/hearth-react-native
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`ce2b445`](https://github.com/utilitywarehouse/hearth/commit/ce2b445dfdd11a2912b4328d8259a604a77b31cd) Thanks [@jordmccord](https://github.com/jordmccord)! - Adds `IconContainer` component
|
|
8
|
+
|
|
9
|
+
- [#423](https://github.com/utilitywarehouse/hearth/pull/423) [`af2deea`](https://github.com/utilitywarehouse/hearth/commit/af2deea62be55d6e40fe5bbb41700e054082b583) Thanks [@jordmccord](https://github.com/jordmccord)! - Adds `DescriptionList` component
|
|
10
|
+
|
|
11
|
+
- [#421](https://github.com/utilitywarehouse/hearth/pull/421) [`a7974df`](https://github.com/utilitywarehouse/hearth/commit/a7974df554cb0eb499923a140ebea523fa49761c) Thanks [@jordmccord](https://github.com/jordmccord)! - [BREAKING] Removes `date` and `currency` type from the `Input` component
|
|
12
|
+
|
|
13
|
+
- [#426](https://github.com/utilitywarehouse/hearth/pull/426) [`997e7cb`](https://github.com/utilitywarehouse/hearth/commit/997e7cb847e4f70de7b995c00aeeee18f1a0a1cd) Thanks [@jordmccord](https://github.com/jordmccord)! - [BREAKING] Adds updated `Badge` colour schemes and variants, replaces `solid` with `emphasis`
|
|
14
|
+
|
|
15
|
+
- [#429](https://github.com/utilitywarehouse/hearth/pull/429) [`1a818ff`](https://github.com/utilitywarehouse/hearth/commit/1a818ffc97a04f412deac4e892fc2400b8ad8735) Thanks [@jordmccord](https://github.com/jordmccord)! - Adds `Tabs` component
|
|
16
|
+
|
|
17
|
+
- [#421](https://github.com/utilitywarehouse/hearth/pull/421) [`a7974df`](https://github.com/utilitywarehouse/hearth/commit/a7974df554cb0eb499923a140ebea523fa49761c) Thanks [@jordmccord](https://github.com/jordmccord)! - Adds `CurrencyInput` component
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- [#430](https://github.com/utilitywarehouse/hearth/pull/430) [`a151f3a`](https://github.com/utilitywarehouse/hearth/commit/a151f3a116b97ce2756b89c07f2ac3f3105c3ff7) Thanks [@jordmccord](https://github.com/jordmccord)! - Added `autoFormatThousands` prop to `CurrencyInput` component
|
|
22
|
+
|
|
23
|
+
- [#426](https://github.com/utilitywarehouse/hearth/pull/426) [`997e7cb`](https://github.com/utilitywarehouse/hearth/commit/997e7cb847e4f70de7b995c00aeeee18f1a0a1cd) Thanks [@jordmccord](https://github.com/jordmccord)! - Adds 2 new layout spacing sizes, '2xs' and '2xl'
|
|
24
|
+
|
|
3
25
|
## 0.2.0
|
|
4
26
|
|
|
5
27
|
### Minor Changes
|
|
@@ -6,7 +6,7 @@ import { BadgeContext } from './Badge.context';
|
|
|
6
6
|
import BadgeIcon from './BadgeIcon';
|
|
7
7
|
import BadgeText from './BadgeText';
|
|
8
8
|
const Badge = ({ children, ...props }) => {
|
|
9
|
-
const { variant = '
|
|
9
|
+
const { variant = 'subtle', icon, colorScheme = 'info', flatBase = false, size = 'sm', style, ...rest } = props;
|
|
10
10
|
const value = useMemo(() => ({ colorScheme, flatBase, variant, size }), [colorScheme, flatBase, variant, size]);
|
|
11
11
|
const childIsText = typeof children === 'string' || typeof children === 'number';
|
|
12
12
|
styles.useVariants({ colorScheme, flatBase, variant, size });
|
|
@@ -34,9 +34,11 @@ const styles = StyleSheet.create(theme => ({
|
|
|
34
34
|
insurance: {},
|
|
35
35
|
cashback: {},
|
|
36
36
|
pig: {},
|
|
37
|
+
highlight: {},
|
|
37
38
|
},
|
|
38
39
|
variant: {
|
|
39
|
-
|
|
40
|
+
subtle: {},
|
|
41
|
+
emphasis: {},
|
|
40
42
|
outline: {
|
|
41
43
|
borderWidth: theme.components.badge.outline.borderWidth,
|
|
42
44
|
borderColor: theme.color.border.subtle,
|
|
@@ -61,84 +63,169 @@ const styles = StyleSheet.create(theme => ({
|
|
|
61
63
|
},
|
|
62
64
|
},
|
|
63
65
|
compoundVariants: [
|
|
64
|
-
//
|
|
66
|
+
// Emphasis
|
|
65
67
|
{
|
|
66
68
|
colorScheme: 'info',
|
|
67
|
-
variant: '
|
|
69
|
+
variant: 'emphasis',
|
|
68
70
|
styles: {
|
|
69
71
|
backgroundColor: theme.color.feedback.info.surface.default,
|
|
70
72
|
},
|
|
71
73
|
},
|
|
72
74
|
{
|
|
73
75
|
colorScheme: 'danger',
|
|
74
|
-
variant: '
|
|
76
|
+
variant: 'emphasis',
|
|
75
77
|
styles: {
|
|
76
78
|
backgroundColor: theme.color.feedback.danger.surface.default,
|
|
77
79
|
},
|
|
78
80
|
},
|
|
79
81
|
{
|
|
80
82
|
colorScheme: 'positive',
|
|
81
|
-
variant: '
|
|
83
|
+
variant: 'emphasis',
|
|
82
84
|
styles: {
|
|
83
85
|
backgroundColor: theme.color.feedback.positive.surface.default,
|
|
84
86
|
},
|
|
85
87
|
},
|
|
86
88
|
{
|
|
87
89
|
colorScheme: 'warning',
|
|
88
|
-
variant: '
|
|
90
|
+
variant: 'emphasis',
|
|
89
91
|
styles: {
|
|
90
92
|
backgroundColor: theme.color.feedback.warning.surface.default,
|
|
91
93
|
},
|
|
92
94
|
},
|
|
93
95
|
{
|
|
94
96
|
colorScheme: 'functional',
|
|
95
|
-
variant: '
|
|
97
|
+
variant: 'emphasis',
|
|
96
98
|
styles: {
|
|
97
99
|
backgroundColor: theme.color.feedback.functional.surface.default,
|
|
98
100
|
},
|
|
99
101
|
},
|
|
100
102
|
{
|
|
101
103
|
colorScheme: 'energy',
|
|
102
|
-
variant: '
|
|
104
|
+
variant: 'emphasis',
|
|
103
105
|
styles: {
|
|
104
106
|
backgroundColor: theme.color.surface.energy.default,
|
|
105
107
|
},
|
|
106
108
|
},
|
|
107
109
|
{
|
|
108
110
|
colorScheme: 'broadband',
|
|
109
|
-
variant: '
|
|
111
|
+
variant: 'emphasis',
|
|
110
112
|
styles: {
|
|
111
113
|
backgroundColor: theme.color.surface.broadband.default,
|
|
112
114
|
},
|
|
113
115
|
},
|
|
114
116
|
{
|
|
115
117
|
colorScheme: 'mobile',
|
|
116
|
-
variant: '
|
|
118
|
+
variant: 'emphasis',
|
|
117
119
|
styles: {
|
|
118
120
|
backgroundColor: theme.color.surface.mobile.default,
|
|
119
121
|
},
|
|
120
122
|
},
|
|
121
123
|
{
|
|
122
124
|
colorScheme: 'insurance',
|
|
123
|
-
variant: '
|
|
125
|
+
variant: 'emphasis',
|
|
124
126
|
styles: {
|
|
125
127
|
backgroundColor: theme.color.surface.insurance.default,
|
|
126
128
|
},
|
|
127
129
|
},
|
|
128
130
|
{
|
|
129
131
|
colorScheme: 'cashback',
|
|
130
|
-
variant: '
|
|
132
|
+
variant: 'emphasis',
|
|
131
133
|
styles: {
|
|
132
134
|
backgroundColor: theme.color.surface.cashback.default,
|
|
133
135
|
},
|
|
134
136
|
},
|
|
135
137
|
{
|
|
136
138
|
colorScheme: 'pig',
|
|
137
|
-
variant: '
|
|
139
|
+
variant: 'emphasis',
|
|
138
140
|
styles: {
|
|
139
141
|
backgroundColor: theme.color.surface.pig.default,
|
|
140
142
|
},
|
|
141
143
|
},
|
|
144
|
+
// Subtle
|
|
145
|
+
{
|
|
146
|
+
colorScheme: 'info',
|
|
147
|
+
variant: 'subtle',
|
|
148
|
+
styles: {
|
|
149
|
+
backgroundColor: theme.color.feedback.info.surface.subtle,
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
colorScheme: 'danger',
|
|
154
|
+
variant: 'subtle',
|
|
155
|
+
styles: {
|
|
156
|
+
backgroundColor: theme.color.feedback.danger.surface.subtle,
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
colorScheme: 'positive',
|
|
161
|
+
variant: 'subtle',
|
|
162
|
+
styles: {
|
|
163
|
+
backgroundColor: theme.color.feedback.positive.surface.subtle,
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
colorScheme: 'warning',
|
|
168
|
+
variant: 'subtle',
|
|
169
|
+
styles: {
|
|
170
|
+
backgroundColor: theme.color.feedback.warning.surface.subtle,
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
colorScheme: 'functional',
|
|
175
|
+
variant: 'subtle',
|
|
176
|
+
styles: {
|
|
177
|
+
backgroundColor: theme.color.feedback.functional.surface.subtle,
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
colorScheme: 'energy',
|
|
182
|
+
variant: 'subtle',
|
|
183
|
+
styles: {
|
|
184
|
+
backgroundColor: theme.color.surface.energy.subtle,
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
colorScheme: 'broadband',
|
|
189
|
+
variant: 'subtle',
|
|
190
|
+
styles: {
|
|
191
|
+
backgroundColor: theme.color.surface.broadband.subtle,
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
colorScheme: 'mobile',
|
|
196
|
+
variant: 'subtle',
|
|
197
|
+
styles: {
|
|
198
|
+
backgroundColor: theme.color.surface.mobile.subtle,
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
colorScheme: 'insurance',
|
|
203
|
+
variant: 'subtle',
|
|
204
|
+
styles: {
|
|
205
|
+
backgroundColor: theme.color.surface.insurance.subtle,
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
colorScheme: 'cashback',
|
|
210
|
+
variant: 'subtle',
|
|
211
|
+
styles: {
|
|
212
|
+
backgroundColor: theme.color.surface.cashback.subtle,
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
colorScheme: 'pig',
|
|
217
|
+
variant: 'subtle',
|
|
218
|
+
styles: {
|
|
219
|
+
backgroundColor: theme.color.surface.pig.subtle,
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
colorScheme: 'highlight',
|
|
224
|
+
variant: 'subtle',
|
|
225
|
+
styles: {
|
|
226
|
+
backgroundColor: theme.color.surface.highlight.subtle,
|
|
227
|
+
},
|
|
228
|
+
},
|
|
142
229
|
// Outline
|
|
143
230
|
{
|
|
144
231
|
colorScheme: 'info',
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
2
|
import type { ViewProps } from 'react-native';
|
|
3
3
|
interface BadgeProps extends ViewProps {
|
|
4
|
-
variant?: '
|
|
5
|
-
colorScheme?: 'info' | 'positive' | 'danger' | 'warning' | 'functional' | 'energy' | 'broadband' | 'mobile' | 'insurance' | 'cashback' | 'pig';
|
|
4
|
+
variant?: 'subtle' | 'emphasis' | 'outline';
|
|
5
|
+
colorScheme?: 'info' | 'positive' | 'danger' | 'warning' | 'functional' | 'energy' | 'broadband' | 'mobile' | 'insurance' | 'cashback' | 'pig' | 'highlight';
|
|
6
6
|
size?: 'sm' | 'md';
|
|
7
7
|
icon?: ComponentType;
|
|
8
8
|
flatBase?: boolean;
|
|
@@ -27,93 +27,19 @@ const styles = StyleSheet.create(theme => ({
|
|
|
27
27
|
insurance: {},
|
|
28
28
|
cashback: {},
|
|
29
29
|
pig: {},
|
|
30
|
+
highlight: {},
|
|
30
31
|
},
|
|
31
32
|
variant: {
|
|
32
|
-
|
|
33
|
+
emphasis: {
|
|
34
|
+
color: theme.color.text.primary,
|
|
35
|
+
},
|
|
36
|
+
subtle: {
|
|
33
37
|
color: theme.color.text.primary,
|
|
34
38
|
},
|
|
35
39
|
outline: {},
|
|
36
40
|
},
|
|
37
41
|
},
|
|
38
42
|
compoundVariants: [
|
|
39
|
-
// Solid
|
|
40
|
-
{
|
|
41
|
-
colorScheme: 'info',
|
|
42
|
-
variant: 'solid',
|
|
43
|
-
styles: {
|
|
44
|
-
color: theme.color.feedback.info.foreground.default,
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
colorScheme: 'danger',
|
|
49
|
-
variant: 'solid',
|
|
50
|
-
styles: {
|
|
51
|
-
color: theme.color.feedback.danger.foreground.default,
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
colorScheme: 'positive',
|
|
56
|
-
variant: 'solid',
|
|
57
|
-
styles: {
|
|
58
|
-
color: theme.color.feedback.positive.foreground.default,
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
colorScheme: 'warning',
|
|
63
|
-
variant: 'solid',
|
|
64
|
-
styles: {
|
|
65
|
-
color: theme.color.feedback.warning.foreground.default,
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
colorScheme: 'functional',
|
|
70
|
-
variant: 'solid',
|
|
71
|
-
styles: {
|
|
72
|
-
color: theme.color.feedback.functional.foreground.default,
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
colorScheme: 'energy',
|
|
77
|
-
variant: 'solid',
|
|
78
|
-
styles: {
|
|
79
|
-
color: theme.color.icon.primary,
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
colorScheme: 'broadband',
|
|
84
|
-
variant: 'solid',
|
|
85
|
-
styles: {
|
|
86
|
-
color: theme.color.icon.primary,
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
colorScheme: 'mobile',
|
|
91
|
-
variant: 'solid',
|
|
92
|
-
styles: {
|
|
93
|
-
color: theme.color.icon.primary,
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
colorScheme: 'insurance',
|
|
98
|
-
variant: 'solid',
|
|
99
|
-
styles: {
|
|
100
|
-
color: theme.color.icon.primary,
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
colorScheme: 'cashback',
|
|
105
|
-
variant: 'solid',
|
|
106
|
-
styles: {
|
|
107
|
-
color: theme.color.icon.primary,
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
colorScheme: 'pig',
|
|
112
|
-
variant: 'solid',
|
|
113
|
-
styles: {
|
|
114
|
-
color: theme.color.icon.primary,
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
43
|
// Outline
|
|
118
44
|
{
|
|
119
45
|
colorScheme: 'info',
|
|
@@ -3,9 +3,9 @@ import { StyleSheet } from 'react-native-unistyles';
|
|
|
3
3
|
import { BodyText } from '../BodyText';
|
|
4
4
|
import { useBadgeContext } from './Badge.context';
|
|
5
5
|
const BadgeText = ({ children, style, ...props }) => {
|
|
6
|
-
const { variant, colorScheme } = useBadgeContext();
|
|
6
|
+
const { variant, colorScheme, size } = useBadgeContext();
|
|
7
7
|
styles.useVariants({ variant, colorScheme });
|
|
8
|
-
return (_jsx(BodyText, { ...props, size:
|
|
8
|
+
return (_jsx(BodyText, { ...props, size: size, weight: "semibold", style: [styles.text, style], children: children }));
|
|
9
9
|
};
|
|
10
10
|
BadgeText.displayName = 'BadgeText';
|
|
11
11
|
const styles = StyleSheet.create(theme => ({
|
|
@@ -23,93 +23,19 @@ const styles = StyleSheet.create(theme => ({
|
|
|
23
23
|
insurance: {},
|
|
24
24
|
cashback: {},
|
|
25
25
|
pig: {},
|
|
26
|
+
highlight: {},
|
|
26
27
|
},
|
|
27
28
|
variant: {
|
|
28
|
-
|
|
29
|
+
emphasis: {
|
|
30
|
+
color: theme.color.text.primary,
|
|
31
|
+
},
|
|
32
|
+
subtle: {
|
|
29
33
|
color: theme.color.text.primary,
|
|
30
34
|
},
|
|
31
35
|
outline: {},
|
|
32
36
|
},
|
|
33
37
|
},
|
|
34
38
|
compoundVariants: [
|
|
35
|
-
// Solid
|
|
36
|
-
{
|
|
37
|
-
colorScheme: 'info',
|
|
38
|
-
variant: 'solid',
|
|
39
|
-
styles: {
|
|
40
|
-
color: theme.color.feedback.info.foreground.default,
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
colorScheme: 'danger',
|
|
45
|
-
variant: 'solid',
|
|
46
|
-
styles: {
|
|
47
|
-
color: theme.color.feedback.danger.foreground.default,
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
colorScheme: 'positive',
|
|
52
|
-
variant: 'solid',
|
|
53
|
-
styles: {
|
|
54
|
-
color: theme.color.feedback.positive.foreground.default,
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
colorScheme: 'warning',
|
|
59
|
-
variant: 'solid',
|
|
60
|
-
styles: {
|
|
61
|
-
color: theme.color.feedback.warning.foreground.default,
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
colorScheme: 'functional',
|
|
66
|
-
variant: 'solid',
|
|
67
|
-
styles: {
|
|
68
|
-
color: theme.color.feedback.functional.foreground.default,
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
colorScheme: 'energy',
|
|
73
|
-
variant: 'solid',
|
|
74
|
-
styles: {
|
|
75
|
-
color: theme.color.text.primary,
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
colorScheme: 'broadband',
|
|
80
|
-
variant: 'solid',
|
|
81
|
-
styles: {
|
|
82
|
-
color: theme.color.text.primary,
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
colorScheme: 'mobile',
|
|
87
|
-
variant: 'solid',
|
|
88
|
-
styles: {
|
|
89
|
-
color: theme.color.text.primary,
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
colorScheme: 'insurance',
|
|
94
|
-
variant: 'solid',
|
|
95
|
-
styles: {
|
|
96
|
-
color: theme.color.text.primary,
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
colorScheme: 'cashback',
|
|
101
|
-
variant: 'solid',
|
|
102
|
-
styles: {
|
|
103
|
-
color: theme.color.text.primary,
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
colorScheme: 'pig',
|
|
108
|
-
variant: 'solid',
|
|
109
|
-
styles: {
|
|
110
|
-
color: theme.color.text.primary,
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
39
|
// Outline
|
|
114
40
|
{
|
|
115
41
|
colorScheme: 'info',
|
|
@@ -6,12 +6,12 @@ export declare const ButtonGroupComponent: import("react").ForwardRefExoticCompo
|
|
|
6
6
|
flexDirection?: import("react-native").ViewStyle["flexDirection"];
|
|
7
7
|
reversed?: boolean;
|
|
8
8
|
attached?: boolean;
|
|
9
|
-
space?: "
|
|
9
|
+
space?: import("../../types").SpacingValues;
|
|
10
10
|
}> & import("react-native").ViewProps & {
|
|
11
11
|
flexDirection?: import("react-native").ViewStyle["flexDirection"];
|
|
12
12
|
reversed?: boolean;
|
|
13
13
|
attached?: boolean;
|
|
14
|
-
space?: "
|
|
14
|
+
space?: import("../../types").SpacingValues;
|
|
15
15
|
} & import("@gluestack-ui/button/lib/typescript/types").IButtonGroupProps>;
|
|
16
16
|
declare const Button: {
|
|
17
17
|
({ children, disabled, pressed, text, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ViewProps, type ViewStyle } from 'react-native';
|
|
2
|
+
import { SpacingValues } from '../../types';
|
|
2
3
|
declare const ButtonGroupRoot: {
|
|
3
4
|
({ children, attached, flexDirection, reversed, space, ...props }: ViewProps & {
|
|
4
5
|
flexDirection?: ViewStyle["flexDirection"];
|
|
5
6
|
reversed?: boolean;
|
|
6
7
|
attached?: boolean;
|
|
7
|
-
space?:
|
|
8
|
+
space?: SpacingValues;
|
|
8
9
|
}): import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
displayName: string;
|
|
10
11
|
};
|
|
@@ -24,6 +24,12 @@ const styles = StyleSheet.create(theme => ({
|
|
|
24
24
|
text: {
|
|
25
25
|
variants: {
|
|
26
26
|
space: {
|
|
27
|
+
none: {
|
|
28
|
+
gap: theme.layout.mobile.spacing.none,
|
|
29
|
+
},
|
|
30
|
+
'2xs': {
|
|
31
|
+
gap: theme.layout.mobile.spacing['2xs'],
|
|
32
|
+
},
|
|
27
33
|
xs: {
|
|
28
34
|
gap: theme.layout.mobile.spacing.xs,
|
|
29
35
|
},
|
|
@@ -39,6 +45,9 @@ const styles = StyleSheet.create(theme => ({
|
|
|
39
45
|
xl: {
|
|
40
46
|
gap: theme.layout.mobile.spacing.xl,
|
|
41
47
|
},
|
|
48
|
+
'2xl': {
|
|
49
|
+
gap: theme.layout.mobile.spacing['2xl'],
|
|
50
|
+
},
|
|
42
51
|
},
|
|
43
52
|
attached: {
|
|
44
53
|
true: {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { PressableProps, ViewStyle } from 'react-native';
|
|
2
|
-
import { SpaceValue } from '../../types';
|
|
2
|
+
import { SpaceValue, SpacingValues } from '../../types';
|
|
3
3
|
interface CardProps extends PressableProps {
|
|
4
4
|
variant?: 'emphasis' | 'subtle';
|
|
5
5
|
colorScheme?: 'neutralStrong' | 'neutralSubtle' | 'brand' | 'energy' | 'broadband' | 'mobile' | 'insurance' | 'cashback' | 'pig';
|
|
6
6
|
noPadding?: boolean;
|
|
7
7
|
disabled?: boolean;
|
|
8
|
-
space?:
|
|
8
|
+
space?: SpacingValues;
|
|
9
9
|
alignItems?: ViewStyle['alignItems'];
|
|
10
10
|
justifyContent?: ViewStyle['justifyContent'];
|
|
11
11
|
flexDirection?: ViewStyle['flexDirection'];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type CurrencyInputProps from './CurrencyInput.props';
|
|
2
|
+
declare const CurrencyInput: {
|
|
3
|
+
({ validationStatus, disabled, focused, readonly, placeholder, inBottomSheet, required, autoFormatThousands, value, onChangeText, ...rest }: CurrencyInputProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
displayName: string;
|
|
5
|
+
};
|
|
6
|
+
export default CurrencyInput;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Platform } from 'react-native';
|
|
3
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
4
|
+
import { formatThousands } from '../../utils';
|
|
5
|
+
import { DetailText } from '../DetailText';
|
|
6
|
+
import { useFormFieldContext } from '../FormField';
|
|
7
|
+
import { Input, InputField, InputSlot } from '../Input';
|
|
8
|
+
const CurrencyInput = ({ validationStatus = 'initial', disabled, focused, readonly, placeholder, inBottomSheet = false, required, autoFormatThousands = false, value, onChangeText, ...rest }) => {
|
|
9
|
+
const formFieldContext = useFormFieldContext();
|
|
10
|
+
const { disabled: formFieldDisabled } = formFieldContext;
|
|
11
|
+
const validationStatusFromContext = formFieldContext?.validationStatus ?? validationStatus;
|
|
12
|
+
const defaultFormat = '0.00';
|
|
13
|
+
const getPlaceholder = placeholder ?? defaultFormat;
|
|
14
|
+
const handleChangeText = (text) => {
|
|
15
|
+
if (autoFormatThousands) {
|
|
16
|
+
const formatted = formatThousands(text);
|
|
17
|
+
onChangeText?.(formatted);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
onChangeText?.(text);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const displayValue = autoFormatThousands && typeof value === 'string' ? formatThousands(value) : value;
|
|
24
|
+
return (_jsxs(Input, { validationStatus: validationStatusFromContext, disabled: formFieldDisabled ?? disabled, readonly: readonly, focused: focused, style: styles.wrap, children: [_jsx(InputSlot, { children: _jsx(DetailText, { size: "4xl", style: styles.text, children: "\u00A3" }) }), _jsx(InputField, { inputMode: "decimal", inBottomSheet: inBottomSheet, ...rest, placeholder: getPlaceholder, keyboardType: "decimal-pad", style: styles.input, value: displayValue, onChangeText: handleChangeText })] }));
|
|
25
|
+
};
|
|
26
|
+
CurrencyInput.displayName = 'CurrencyInput';
|
|
27
|
+
const styles = StyleSheet.create(theme => ({
|
|
28
|
+
wrap: {
|
|
29
|
+
height: theme.components.input.currency.height,
|
|
30
|
+
gap: theme.components.input.currency.gap,
|
|
31
|
+
},
|
|
32
|
+
text: {
|
|
33
|
+
...(Platform.OS === 'ios' && { lineHeight: 46 }),
|
|
34
|
+
_web: {
|
|
35
|
+
marginTop: 1,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
input: {
|
|
39
|
+
fontSize: theme.typography.mobile.detailText['4xl'].fontSize,
|
|
40
|
+
fontFamily: theme.typography.mobile.detailText.fontFamily,
|
|
41
|
+
fontWeight: theme.typography.mobile.detailText.fontWeight,
|
|
42
|
+
paddingTop: 0,
|
|
43
|
+
paddingBottom: 0,
|
|
44
|
+
paddingLeft: 0,
|
|
45
|
+
},
|
|
46
|
+
}));
|
|
47
|
+
export default CurrencyInput;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { TextInputProps, ViewProps } from 'react-native';
|
|
2
|
+
export interface CurrencyInputBaseProps {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
validationStatus?: 'initial' | 'valid' | 'invalid';
|
|
5
|
+
readonly?: boolean;
|
|
6
|
+
focused?: boolean;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
inBottomSheet?: boolean;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
/** When true, automatically formats the numeric value with thousand separators (e.g. 1234 -> 1,234). */
|
|
11
|
+
autoFormatThousands?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export type CurrencyInputProps = CurrencyInputBaseProps & Omit<TextInputProps, 'children'> & ViewProps;
|
|
14
|
+
export default CurrencyInputProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CurrencyInput } from './CurrencyInput';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CurrencyInput } from './CurrencyInput';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface DescriptionListContextValue {
|
|
2
|
+
direction: 'row' | 'column';
|
|
3
|
+
itemHeadingWidth?: number;
|
|
4
|
+
}
|
|
5
|
+
export declare const DescriptionListContext: import("react").Context<DescriptionListContextValue | undefined>;
|
|
6
|
+
export declare const useDescriptionListContext: () => DescriptionListContextValue;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
export const DescriptionListContext = createContext(undefined);
|
|
3
|
+
export const useDescriptionListContext = () => {
|
|
4
|
+
const ctx = useContext(DescriptionListContext);
|
|
5
|
+
if (!ctx) {
|
|
6
|
+
throw new Error('DescriptionListItem must be used within a DescriptionList');
|
|
7
|
+
}
|
|
8
|
+
return ctx;
|
|
9
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type DescriptionListProps from './DescriptionList.props';
|
|
2
|
+
declare const DescriptionList: {
|
|
3
|
+
({ direction, itemHeadingWidth, heading, helperText, linkText, linkHref, linkIcon, linkIconPosition, linkOnPress, linkTarget, linkShowIcon, children, style, ...props }: DescriptionListProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
displayName: string;
|
|
5
|
+
};
|
|
6
|
+
export default DescriptionList;
|