@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
|
@@ -61,13 +61,13 @@ const MyComponent = () => (
|
|
|
61
61
|
|
|
62
62
|
## Props
|
|
63
63
|
|
|
64
|
-
| Property | Type
|
|
65
|
-
| ------------- |
|
|
66
|
-
| `variant` | `'
|
|
67
|
-
| `colorScheme` | `'info' \| 'positive' \| 'danger' \| 'warning' \| 'functional' \|`<br />`'energy' \| 'broadband' \| 'mobile' \| 'insurance' \|`<br />`'cashback' \| 'pig'` | The color scheme to use for the badge. | `info`
|
|
68
|
-
| `size` | `'sm' \| 'md'`
|
|
69
|
-
| `flatBase` | `boolean`
|
|
70
|
-
| `icon` | `ReactNode`
|
|
64
|
+
| Property | Type | Description | Default |
|
|
65
|
+
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | -------- |
|
|
66
|
+
| `variant` | `'subtle' \| 'emphasis' \| 'outline'` | The variant of the badge. | `subtle` |
|
|
67
|
+
| `colorScheme` | `'info' \| 'positive' \| 'danger' \| 'warning' \| 'functional' \|`<br />`'energy' \| 'broadband' \| 'mobile' \| 'insurance' \|`<br />`'cashback' \| 'pig' \| 'highlight'` | The color scheme to use for the badge. | `info` |
|
|
68
|
+
| `size` | `'sm' \| 'md'` | The size of the badge. | `sm` |
|
|
69
|
+
| `flatBase` | `boolean` | Whether the badge has a flat base. | `false` |
|
|
70
|
+
| `icon` | `ReactNode` | The icon to display in the badge. | |
|
|
71
71
|
|
|
72
72
|
## Color Schemes
|
|
73
73
|
|
|
@@ -2,7 +2,7 @@ import type { ComponentType } from 'react';
|
|
|
2
2
|
import type { ViewProps } from 'react-native';
|
|
3
3
|
|
|
4
4
|
interface BadgeProps extends ViewProps {
|
|
5
|
-
variant?: '
|
|
5
|
+
variant?: 'subtle' | 'emphasis' | 'outline';
|
|
6
6
|
colorScheme?:
|
|
7
7
|
| 'info'
|
|
8
8
|
| 'positive'
|
|
@@ -14,7 +14,8 @@ interface BadgeProps extends ViewProps {
|
|
|
14
14
|
| 'mobile'
|
|
15
15
|
| 'insurance'
|
|
16
16
|
| 'cashback'
|
|
17
|
-
| 'pig'
|
|
17
|
+
| 'pig'
|
|
18
|
+
| 'highlight';
|
|
18
19
|
size?: 'sm' | 'md';
|
|
19
20
|
icon?: ComponentType;
|
|
20
21
|
flatBase?: boolean;
|
|
@@ -5,6 +5,7 @@ import { Badge } from '.';
|
|
|
5
5
|
import { VariantTitle } from '../../../docs/components';
|
|
6
6
|
import { Box } from '../Box';
|
|
7
7
|
import { Flex } from '../Flex';
|
|
8
|
+
import type BadgeProps from './Badge.props';
|
|
8
9
|
|
|
9
10
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
10
11
|
const meta = {
|
|
@@ -18,7 +19,7 @@ const meta = {
|
|
|
18
19
|
argTypes: {
|
|
19
20
|
children: { control: 'text' },
|
|
20
21
|
variant: {
|
|
21
|
-
options: ['
|
|
22
|
+
options: ['subtle', 'emphasis', 'outline'],
|
|
22
23
|
control: 'radio',
|
|
23
24
|
description: 'Variant of the badge.',
|
|
24
25
|
},
|
|
@@ -35,6 +36,7 @@ const meta = {
|
|
|
35
36
|
'insurance',
|
|
36
37
|
'cashback',
|
|
37
38
|
'pig',
|
|
39
|
+
'highlight',
|
|
38
40
|
],
|
|
39
41
|
control: 'select',
|
|
40
42
|
description: 'Color scheme of the badge.',
|
|
@@ -53,7 +55,7 @@ const meta = {
|
|
|
53
55
|
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
|
|
54
56
|
args: {
|
|
55
57
|
children: 'Badge',
|
|
56
|
-
variant: '
|
|
58
|
+
variant: 'subtle',
|
|
57
59
|
colorScheme: 'info',
|
|
58
60
|
flatBase: false,
|
|
59
61
|
size: 'sm',
|
|
@@ -71,12 +73,21 @@ export const Playground: Story = {
|
|
|
71
73
|
},
|
|
72
74
|
};
|
|
73
75
|
|
|
74
|
-
export const
|
|
76
|
+
export const Subtle: Story = {
|
|
75
77
|
parameters: {
|
|
76
78
|
controls: { exclude: ['variant'] },
|
|
77
79
|
},
|
|
78
80
|
args: {
|
|
79
|
-
variant: '
|
|
81
|
+
variant: 'subtle',
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const Emphasis: Story = {
|
|
86
|
+
parameters: {
|
|
87
|
+
controls: { exclude: ['variant'] },
|
|
88
|
+
},
|
|
89
|
+
args: {
|
|
90
|
+
variant: 'emphasis',
|
|
80
91
|
},
|
|
81
92
|
};
|
|
82
93
|
|
|
@@ -103,93 +114,71 @@ export const Icon: Story = {
|
|
|
103
114
|
};
|
|
104
115
|
|
|
105
116
|
export const KitchenSink: Story = {
|
|
106
|
-
render: () =>
|
|
107
|
-
<
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
</VariantTitle>
|
|
140
|
-
<VariantTitle title={`Broadband - Solid - ${size}`}>
|
|
141
|
-
<Badge colorScheme="broadband" size={size as 'sm' | 'md'}>
|
|
142
|
-
Broadband badge
|
|
143
|
-
</Badge>
|
|
144
|
-
</VariantTitle>
|
|
145
|
-
<VariantTitle title={`Mobile - Solid - ${size}`}>
|
|
146
|
-
<Badge colorScheme="mobile" size={size as 'sm' | 'md'}>
|
|
147
|
-
Mobile badge
|
|
148
|
-
</Badge>
|
|
149
|
-
</VariantTitle>
|
|
150
|
-
<VariantTitle title={`Insurance - Solid - ${size}`}>
|
|
151
|
-
<Badge colorScheme="insurance" size={size as 'sm' | 'md'}>
|
|
152
|
-
Insurance badge
|
|
153
|
-
</Badge>
|
|
154
|
-
</VariantTitle>
|
|
155
|
-
<VariantTitle title={`Cashback - Solid - ${size}`}>
|
|
156
|
-
<Badge colorScheme="cashback" size={size as 'sm' | 'md'}>
|
|
157
|
-
Cashback badge
|
|
158
|
-
</Badge>
|
|
159
|
-
</VariantTitle>
|
|
160
|
-
<VariantTitle title={`Pig - Solid - ${size}`}>
|
|
161
|
-
<Badge colorScheme="pig" size={size as 'sm' | 'md'}>
|
|
162
|
-
Pig badge
|
|
163
|
-
</Badge>
|
|
164
|
-
</VariantTitle>
|
|
117
|
+
render: () => {
|
|
118
|
+
const colorSchemes: NonNullable<BadgeProps['colorScheme']>[] = [
|
|
119
|
+
'info',
|
|
120
|
+
'positive',
|
|
121
|
+
'danger',
|
|
122
|
+
'warning',
|
|
123
|
+
'functional',
|
|
124
|
+
'energy',
|
|
125
|
+
'broadband',
|
|
126
|
+
'mobile',
|
|
127
|
+
'insurance',
|
|
128
|
+
'cashback',
|
|
129
|
+
'pig',
|
|
130
|
+
'highlight',
|
|
131
|
+
];
|
|
132
|
+
const sizes: Array<BadgeProps['size']> = ['sm', 'md'];
|
|
133
|
+
|
|
134
|
+
return (
|
|
135
|
+
<Flex direction="column" space="lg" style={{ width: '100%' }}>
|
|
136
|
+
{colorSchemes.map(cs => {
|
|
137
|
+
// Determine allowed variants per color scheme based on design constraints:
|
|
138
|
+
// - Remove 'outline' for energy, broadband, mobile, insurance, cashback, pig, highlight
|
|
139
|
+
// - For highlight only show 'subtle'
|
|
140
|
+
const noOutlineSchemes: Array<BadgeProps['colorScheme']> = [
|
|
141
|
+
'energy',
|
|
142
|
+
'broadband',
|
|
143
|
+
'mobile',
|
|
144
|
+
'insurance',
|
|
145
|
+
'cashback',
|
|
146
|
+
'pig',
|
|
147
|
+
'highlight',
|
|
148
|
+
];
|
|
149
|
+
let variantsForScheme: Array<BadgeProps['variant']> = ['subtle', 'emphasis', 'outline'];
|
|
165
150
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
151
|
+
if (noOutlineSchemes.includes(cs)) {
|
|
152
|
+
variantsForScheme = ['subtle', 'emphasis'];
|
|
153
|
+
}
|
|
154
|
+
if (cs === 'highlight') {
|
|
155
|
+
variantsForScheme = ['subtle'];
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return (
|
|
159
|
+
<Box key={cs} gap="200">
|
|
160
|
+
<VariantTitle title={cs.charAt(0).toUpperCase() + cs.slice(1)}>
|
|
161
|
+
<Flex direction="column" space="sm">
|
|
162
|
+
{sizes.map(sz => (
|
|
163
|
+
<Flex key={sz} direction="row" align="center" space="md">
|
|
164
|
+
{variantsForScheme.map(variant => (
|
|
165
|
+
<Badge
|
|
166
|
+
key={`${cs}-${sz}-${variant}`}
|
|
167
|
+
colorScheme={cs}
|
|
168
|
+
size={sz}
|
|
169
|
+
variant={variant}
|
|
170
|
+
>
|
|
171
|
+
{`${variant} ${sz}`}
|
|
172
|
+
</Badge>
|
|
173
|
+
))}
|
|
174
|
+
</Flex>
|
|
175
|
+
))}
|
|
176
|
+
</Flex>
|
|
177
|
+
</VariantTitle>
|
|
178
|
+
</Box>
|
|
179
|
+
);
|
|
180
|
+
})}
|
|
181
|
+
</Flex>
|
|
182
|
+
);
|
|
183
|
+
},
|
|
195
184
|
};
|
|
@@ -8,7 +8,7 @@ import BadgeText from './BadgeText';
|
|
|
8
8
|
|
|
9
9
|
const Badge = ({ children, ...props }: BadgeProps) => {
|
|
10
10
|
const {
|
|
11
|
-
variant = '
|
|
11
|
+
variant = 'subtle',
|
|
12
12
|
icon,
|
|
13
13
|
colorScheme = 'info',
|
|
14
14
|
flatBase = false,
|
|
@@ -59,9 +59,11 @@ const styles = StyleSheet.create(theme => ({
|
|
|
59
59
|
insurance: {},
|
|
60
60
|
cashback: {},
|
|
61
61
|
pig: {},
|
|
62
|
+
highlight: {},
|
|
62
63
|
},
|
|
63
64
|
variant: {
|
|
64
|
-
|
|
65
|
+
subtle: {},
|
|
66
|
+
emphasis: {},
|
|
65
67
|
outline: {
|
|
66
68
|
borderWidth: theme.components.badge.outline.borderWidth,
|
|
67
69
|
borderColor: theme.color.border.subtle,
|
|
@@ -86,84 +88,169 @@ const styles = StyleSheet.create(theme => ({
|
|
|
86
88
|
},
|
|
87
89
|
},
|
|
88
90
|
compoundVariants: [
|
|
89
|
-
//
|
|
91
|
+
// Emphasis
|
|
90
92
|
{
|
|
91
93
|
colorScheme: 'info',
|
|
92
|
-
variant: '
|
|
94
|
+
variant: 'emphasis',
|
|
93
95
|
styles: {
|
|
94
96
|
backgroundColor: theme.color.feedback.info.surface.default,
|
|
95
97
|
},
|
|
96
98
|
},
|
|
97
99
|
{
|
|
98
100
|
colorScheme: 'danger',
|
|
99
|
-
variant: '
|
|
101
|
+
variant: 'emphasis',
|
|
100
102
|
styles: {
|
|
101
103
|
backgroundColor: theme.color.feedback.danger.surface.default,
|
|
102
104
|
},
|
|
103
105
|
},
|
|
104
106
|
{
|
|
105
107
|
colorScheme: 'positive',
|
|
106
|
-
variant: '
|
|
108
|
+
variant: 'emphasis',
|
|
107
109
|
styles: {
|
|
108
110
|
backgroundColor: theme.color.feedback.positive.surface.default,
|
|
109
111
|
},
|
|
110
112
|
},
|
|
111
113
|
{
|
|
112
114
|
colorScheme: 'warning',
|
|
113
|
-
variant: '
|
|
115
|
+
variant: 'emphasis',
|
|
114
116
|
styles: {
|
|
115
117
|
backgroundColor: theme.color.feedback.warning.surface.default,
|
|
116
118
|
},
|
|
117
119
|
},
|
|
118
120
|
{
|
|
119
121
|
colorScheme: 'functional',
|
|
120
|
-
variant: '
|
|
122
|
+
variant: 'emphasis',
|
|
121
123
|
styles: {
|
|
122
124
|
backgroundColor: theme.color.feedback.functional.surface.default,
|
|
123
125
|
},
|
|
124
126
|
},
|
|
125
127
|
{
|
|
126
128
|
colorScheme: 'energy',
|
|
127
|
-
variant: '
|
|
129
|
+
variant: 'emphasis',
|
|
128
130
|
styles: {
|
|
129
131
|
backgroundColor: theme.color.surface.energy.default,
|
|
130
132
|
},
|
|
131
133
|
},
|
|
132
134
|
{
|
|
133
135
|
colorScheme: 'broadband',
|
|
134
|
-
variant: '
|
|
136
|
+
variant: 'emphasis',
|
|
135
137
|
styles: {
|
|
136
138
|
backgroundColor: theme.color.surface.broadband.default,
|
|
137
139
|
},
|
|
138
140
|
},
|
|
139
141
|
{
|
|
140
142
|
colorScheme: 'mobile',
|
|
141
|
-
variant: '
|
|
143
|
+
variant: 'emphasis',
|
|
142
144
|
styles: {
|
|
143
145
|
backgroundColor: theme.color.surface.mobile.default,
|
|
144
146
|
},
|
|
145
147
|
},
|
|
146
148
|
{
|
|
147
149
|
colorScheme: 'insurance',
|
|
148
|
-
variant: '
|
|
150
|
+
variant: 'emphasis',
|
|
149
151
|
styles: {
|
|
150
152
|
backgroundColor: theme.color.surface.insurance.default,
|
|
151
153
|
},
|
|
152
154
|
},
|
|
153
155
|
{
|
|
154
156
|
colorScheme: 'cashback',
|
|
155
|
-
variant: '
|
|
157
|
+
variant: 'emphasis',
|
|
156
158
|
styles: {
|
|
157
159
|
backgroundColor: theme.color.surface.cashback.default,
|
|
158
160
|
},
|
|
159
161
|
},
|
|
160
162
|
{
|
|
161
163
|
colorScheme: 'pig',
|
|
162
|
-
variant: '
|
|
164
|
+
variant: 'emphasis',
|
|
163
165
|
styles: {
|
|
164
166
|
backgroundColor: theme.color.surface.pig.default,
|
|
165
167
|
},
|
|
166
168
|
},
|
|
169
|
+
// Subtle
|
|
170
|
+
{
|
|
171
|
+
colorScheme: 'info',
|
|
172
|
+
variant: 'subtle',
|
|
173
|
+
styles: {
|
|
174
|
+
backgroundColor: theme.color.feedback.info.surface.subtle,
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
colorScheme: 'danger',
|
|
179
|
+
variant: 'subtle',
|
|
180
|
+
styles: {
|
|
181
|
+
backgroundColor: theme.color.feedback.danger.surface.subtle,
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
colorScheme: 'positive',
|
|
186
|
+
variant: 'subtle',
|
|
187
|
+
styles: {
|
|
188
|
+
backgroundColor: theme.color.feedback.positive.surface.subtle,
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
colorScheme: 'warning',
|
|
193
|
+
variant: 'subtle',
|
|
194
|
+
styles: {
|
|
195
|
+
backgroundColor: theme.color.feedback.warning.surface.subtle,
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
colorScheme: 'functional',
|
|
200
|
+
variant: 'subtle',
|
|
201
|
+
styles: {
|
|
202
|
+
backgroundColor: theme.color.feedback.functional.surface.subtle,
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
colorScheme: 'energy',
|
|
207
|
+
variant: 'subtle',
|
|
208
|
+
styles: {
|
|
209
|
+
backgroundColor: theme.color.surface.energy.subtle,
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
colorScheme: 'broadband',
|
|
214
|
+
variant: 'subtle',
|
|
215
|
+
styles: {
|
|
216
|
+
backgroundColor: theme.color.surface.broadband.subtle,
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
colorScheme: 'mobile',
|
|
221
|
+
variant: 'subtle',
|
|
222
|
+
styles: {
|
|
223
|
+
backgroundColor: theme.color.surface.mobile.subtle,
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
colorScheme: 'insurance',
|
|
228
|
+
variant: 'subtle',
|
|
229
|
+
styles: {
|
|
230
|
+
backgroundColor: theme.color.surface.insurance.subtle,
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
colorScheme: 'cashback',
|
|
235
|
+
variant: 'subtle',
|
|
236
|
+
styles: {
|
|
237
|
+
backgroundColor: theme.color.surface.cashback.subtle,
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
colorScheme: 'pig',
|
|
242
|
+
variant: 'subtle',
|
|
243
|
+
styles: {
|
|
244
|
+
backgroundColor: theme.color.surface.pig.subtle,
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
colorScheme: 'highlight',
|
|
249
|
+
variant: 'subtle',
|
|
250
|
+
styles: {
|
|
251
|
+
backgroundColor: theme.color.surface.highlight.subtle,
|
|
252
|
+
},
|
|
253
|
+
},
|
|
167
254
|
// Outline
|
|
168
255
|
{
|
|
169
256
|
colorScheme: 'info',
|
|
@@ -30,93 +30,19 @@ 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
|
-
// Solid
|
|
43
|
-
{
|
|
44
|
-
colorScheme: 'info',
|
|
45
|
-
variant: 'solid',
|
|
46
|
-
styles: {
|
|
47
|
-
color: theme.color.feedback.info.foreground.default,
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
colorScheme: 'danger',
|
|
52
|
-
variant: 'solid',
|
|
53
|
-
styles: {
|
|
54
|
-
color: theme.color.feedback.danger.foreground.default,
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
colorScheme: 'positive',
|
|
59
|
-
variant: 'solid',
|
|
60
|
-
styles: {
|
|
61
|
-
color: theme.color.feedback.positive.foreground.default,
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
colorScheme: 'warning',
|
|
66
|
-
variant: 'solid',
|
|
67
|
-
styles: {
|
|
68
|
-
color: theme.color.feedback.warning.foreground.default,
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
colorScheme: 'functional',
|
|
73
|
-
variant: 'solid',
|
|
74
|
-
styles: {
|
|
75
|
-
color: theme.color.feedback.functional.foreground.default,
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
colorScheme: 'energy',
|
|
80
|
-
variant: 'solid',
|
|
81
|
-
styles: {
|
|
82
|
-
color: theme.color.icon.primary,
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
colorScheme: 'broadband',
|
|
87
|
-
variant: 'solid',
|
|
88
|
-
styles: {
|
|
89
|
-
color: theme.color.icon.primary,
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
colorScheme: 'mobile',
|
|
94
|
-
variant: 'solid',
|
|
95
|
-
styles: {
|
|
96
|
-
color: theme.color.icon.primary,
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
colorScheme: 'insurance',
|
|
101
|
-
variant: 'solid',
|
|
102
|
-
styles: {
|
|
103
|
-
color: theme.color.icon.primary,
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
colorScheme: 'cashback',
|
|
108
|
-
variant: 'solid',
|
|
109
|
-
styles: {
|
|
110
|
-
color: theme.color.icon.primary,
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
colorScheme: 'pig',
|
|
115
|
-
variant: 'solid',
|
|
116
|
-
styles: {
|
|
117
|
-
color: theme.color.icon.primary,
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
46
|
// Outline
|
|
121
47
|
{
|
|
122
48
|
colorScheme: 'info',
|
|
@@ -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,93 +30,19 @@ 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
|
-
// Solid
|
|
43
|
-
{
|
|
44
|
-
colorScheme: 'info',
|
|
45
|
-
variant: 'solid',
|
|
46
|
-
styles: {
|
|
47
|
-
color: theme.color.feedback.info.foreground.default,
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
colorScheme: 'danger',
|
|
52
|
-
variant: 'solid',
|
|
53
|
-
styles: {
|
|
54
|
-
color: theme.color.feedback.danger.foreground.default,
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
colorScheme: 'positive',
|
|
59
|
-
variant: 'solid',
|
|
60
|
-
styles: {
|
|
61
|
-
color: theme.color.feedback.positive.foreground.default,
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
colorScheme: 'warning',
|
|
66
|
-
variant: 'solid',
|
|
67
|
-
styles: {
|
|
68
|
-
color: theme.color.feedback.warning.foreground.default,
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
colorScheme: 'functional',
|
|
73
|
-
variant: 'solid',
|
|
74
|
-
styles: {
|
|
75
|
-
color: theme.color.feedback.functional.foreground.default,
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
colorScheme: 'energy',
|
|
80
|
-
variant: 'solid',
|
|
81
|
-
styles: {
|
|
82
|
-
color: theme.color.text.primary,
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
colorScheme: 'broadband',
|
|
87
|
-
variant: 'solid',
|
|
88
|
-
styles: {
|
|
89
|
-
color: theme.color.text.primary,
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
colorScheme: 'mobile',
|
|
94
|
-
variant: 'solid',
|
|
95
|
-
styles: {
|
|
96
|
-
color: theme.color.text.primary,
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
colorScheme: 'insurance',
|
|
101
|
-
variant: 'solid',
|
|
102
|
-
styles: {
|
|
103
|
-
color: theme.color.text.primary,
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
colorScheme: 'cashback',
|
|
108
|
-
variant: 'solid',
|
|
109
|
-
styles: {
|
|
110
|
-
color: theme.color.text.primary,
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
colorScheme: 'pig',
|
|
115
|
-
variant: 'solid',
|
|
116
|
-
styles: {
|
|
117
|
-
color: theme.color.text.primary,
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
46
|
// Outline
|
|
121
47
|
{
|
|
122
48
|
colorScheme: 'info',
|