@utilitywarehouse/hearth-react-native 0.7.0 → 0.8.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 +1 -1
- package/CHANGELOG.md +18 -0
- package/build/components/Banner/Banner.d.ts +6 -0
- package/build/components/Banner/Banner.js +161 -0
- package/build/components/Banner/Banner.props.d.ts +82 -0
- package/build/components/Banner/Banner.props.js +1 -0
- package/build/components/Banner/index.d.ts +2 -0
- package/build/components/Banner/index.js +1 -0
- package/build/components/BottomSheet/BottomSheetBackdrop.js +1 -5
- package/build/components/BottomSheet/BottomSheetFlatList.js +1 -5
- package/build/components/BottomSheet/BottomSheetHandle.js +1 -5
- package/build/components/BottomSheet/useBottomSheetLogic.d.ts +1 -1
- package/build/components/Expandable/Expandable.d.ts +6 -0
- package/build/components/Expandable/Expandable.js +44 -0
- package/build/components/Expandable/Expandable.props.d.ts +38 -0
- package/build/components/Expandable/Expandable.props.js +1 -0
- package/build/components/Expandable/index.d.ts +2 -0
- package/build/components/Expandable/index.js +1 -0
- package/build/components/ExpandableCard/ExpandableCard.d.ts +6 -0
- package/build/components/ExpandableCard/ExpandableCard.js +23 -0
- package/build/components/ExpandableCard/ExpandableCard.props.d.ts +69 -0
- package/build/components/ExpandableCard/ExpandableCard.props.js +1 -0
- package/build/components/ExpandableCard/ExpandableCardContent.d.ts +6 -0
- package/build/components/ExpandableCard/ExpandableCardContent.js +14 -0
- package/build/components/ExpandableCard/ExpandableCardExpandedContent.d.ts +11 -0
- package/build/components/ExpandableCard/ExpandableCardExpandedContent.js +18 -0
- package/build/components/ExpandableCard/ExpandableCardGroup.d.ts +6 -0
- package/build/components/ExpandableCard/ExpandableCardGroup.js +17 -0
- package/build/components/ExpandableCard/ExpandableCardGroup.props.d.ts +25 -0
- package/build/components/ExpandableCard/ExpandableCardGroup.props.js +1 -0
- package/build/components/ExpandableCard/ExpandableCardHelperText.d.ts +6 -0
- package/build/components/ExpandableCard/ExpandableCardHelperText.js +13 -0
- package/build/components/ExpandableCard/ExpandableCardIcon.d.ts +9 -0
- package/build/components/ExpandableCard/ExpandableCardIcon.js +19 -0
- package/build/components/ExpandableCard/ExpandableCardLeadingContent.d.ts +6 -0
- package/build/components/ExpandableCard/ExpandableCardLeadingContent.js +5 -0
- package/build/components/ExpandableCard/ExpandableCardText.d.ts +6 -0
- package/build/components/ExpandableCard/ExpandableCardText.js +7 -0
- package/build/components/ExpandableCard/ExpandableCardTrailingContent.d.ts +6 -0
- package/build/components/ExpandableCard/ExpandableCardTrailingContent.js +5 -0
- package/build/components/ExpandableCard/ExpandableCardTrailingIcon.d.ts +9 -0
- package/build/components/ExpandableCard/ExpandableCardTrailingIcon.js +17 -0
- package/build/components/ExpandableCard/ExpandableCardTrigger.d.ts +17 -0
- package/build/components/ExpandableCard/ExpandableCardTrigger.js +7 -0
- package/build/components/ExpandableCard/ExpandableCardTrigger.props.d.ts +44 -0
- package/build/components/ExpandableCard/ExpandableCardTrigger.props.js +1 -0
- package/build/components/ExpandableCard/ExpandableCardTriggerRoot.d.ts +11 -0
- package/build/components/ExpandableCard/ExpandableCardTriggerRoot.js +91 -0
- package/build/components/ExpandableCard/index.d.ts +14 -0
- package/build/components/ExpandableCard/index.js +11 -0
- package/build/components/HighlightBanner/HighlightBanner.d.ts +6 -0
- package/build/components/HighlightBanner/HighlightBanner.js +96 -0
- package/build/components/HighlightBanner/HighlightBanner.props.d.ts +14 -0
- package/build/components/HighlightBanner/HighlightBanner.props.js +1 -0
- package/build/components/HighlightBanner/index.d.ts +2 -0
- package/build/components/HighlightBanner/index.js +1 -0
- package/build/components/Spinner/Spinner.js +0 -2
- package/build/components/Spinner/Spinner.web.d.ts +2 -1
- package/build/components/Spinner/Spinner.web.js +0 -2
- package/build/components/Switch/Switch.web.js +0 -1
- package/build/components/Tabs/TabsList.js +1 -6
- package/build/components/index.d.ts +4 -0
- package/build/components/index.js +4 -0
- package/docs/components/AllComponents.web.tsx +75 -4
- package/docs/components/VariantTitle.tsx +1 -1
- package/package.json +4 -4
- package/src/components/Banner/Banner.docs.mdx +402 -0
- package/src/components/Banner/Banner.props.ts +106 -0
- package/src/components/Banner/Banner.stories.tsx +494 -0
- package/src/components/Banner/Banner.tsx +264 -0
- package/src/components/Banner/index.ts +2 -0
- package/src/components/BottomSheet/BottomSheetBackdrop.tsx +0 -1
- package/src/components/BottomSheet/BottomSheetFlatList.tsx +0 -1
- package/src/components/BottomSheet/BottomSheetHandle.tsx +0 -1
- package/src/components/Card/Card.docs.mdx +10 -2
- package/src/components/Expandable/Expandable.docs.mdx +201 -0
- package/src/components/Expandable/Expandable.props.ts +46 -0
- package/src/components/Expandable/Expandable.stories.tsx +284 -0
- package/src/components/Expandable/Expandable.tsx +92 -0
- package/src/components/Expandable/index.ts +2 -0
- package/src/components/ExpandableCard/ExpandableCard.docs.mdx +312 -0
- package/src/components/ExpandableCard/ExpandableCard.props.ts +85 -0
- package/src/components/ExpandableCard/ExpandableCard.stories.tsx +326 -0
- package/src/components/ExpandableCard/ExpandableCard.tsx +76 -0
- package/src/components/ExpandableCard/ExpandableCardContent.tsx +21 -0
- package/src/components/ExpandableCard/ExpandableCardExpandedContent.tsx +42 -0
- package/src/components/ExpandableCard/ExpandableCardGroup.props.ts +31 -0
- package/src/components/ExpandableCard/ExpandableCardGroup.tsx +40 -0
- package/src/components/ExpandableCard/ExpandableCardHelperText.tsx +21 -0
- package/src/components/ExpandableCard/ExpandableCardIcon.tsx +32 -0
- package/src/components/ExpandableCard/ExpandableCardLeadingContent.tsx +9 -0
- package/src/components/ExpandableCard/ExpandableCardText.tsx +14 -0
- package/src/components/ExpandableCard/ExpandableCardTrailingContent.tsx +9 -0
- package/src/components/ExpandableCard/ExpandableCardTrailingIcon.tsx +30 -0
- package/src/components/ExpandableCard/ExpandableCardTrigger.props.ts +47 -0
- package/src/components/ExpandableCard/ExpandableCardTrigger.tsx +10 -0
- package/src/components/ExpandableCard/ExpandableCardTriggerRoot.tsx +154 -0
- package/src/components/ExpandableCard/index.ts +14 -0
- package/src/components/HighlightBanner/HighlightBanner.docs.mdx +296 -0
- package/src/components/HighlightBanner/HighlightBanner.props.ts +29 -0
- package/src/components/HighlightBanner/HighlightBanner.stories.tsx +275 -0
- package/src/components/HighlightBanner/HighlightBanner.tsx +134 -0
- package/src/components/HighlightBanner/index.ts +2 -0
- package/src/components/Spinner/Spinner.tsx +0 -2
- package/src/components/Spinner/Spinner.web.tsx +0 -2
- package/src/components/Switch/Switch.web.tsx +1 -5
- package/src/components/Tabs/TabsList.tsx +0 -2
- package/src/components/index.ts +4 -0
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { Button } from '../Button';
|
|
4
|
+
import { Flex } from '../Flex';
|
|
5
|
+
import { Link } from '../Link';
|
|
6
|
+
import HighlightBanner from './HighlightBanner';
|
|
7
|
+
|
|
8
|
+
const meta = {
|
|
9
|
+
title: 'Stories / HighlightBanner',
|
|
10
|
+
component: HighlightBanner,
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: 'centered',
|
|
13
|
+
},
|
|
14
|
+
argTypes: {
|
|
15
|
+
heading: {
|
|
16
|
+
control: 'text',
|
|
17
|
+
description: 'The heading text displayed at the top of the card',
|
|
18
|
+
},
|
|
19
|
+
headingColor: {
|
|
20
|
+
control: 'select',
|
|
21
|
+
description: 'The background color for the heading section',
|
|
22
|
+
options: ['pig', 'energy', 'broadband', 'mobile', 'insurance', 'cashback', 'highlight'],
|
|
23
|
+
},
|
|
24
|
+
description: {
|
|
25
|
+
control: 'text',
|
|
26
|
+
description: 'The description text displayed in the footer',
|
|
27
|
+
},
|
|
28
|
+
variant: {
|
|
29
|
+
control: 'select',
|
|
30
|
+
description: 'The variant style of the HighlightBanner',
|
|
31
|
+
options: ['emphasis', 'subtle'],
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
args: {
|
|
35
|
+
heading: 'Featured Content',
|
|
36
|
+
headingColor: 'highlight',
|
|
37
|
+
description: 'This is a description of the featured content that appears below the image.',
|
|
38
|
+
image: {
|
|
39
|
+
source: {
|
|
40
|
+
uri: 'https://images.unsplash.com/photo-1506126613408-eca07ce68773?w=800&q=80',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
} satisfies Meta<typeof HighlightBanner>;
|
|
45
|
+
|
|
46
|
+
export default meta;
|
|
47
|
+
type Story = StoryObj<typeof meta>;
|
|
48
|
+
|
|
49
|
+
export const Playground: Story = {
|
|
50
|
+
render: args => {
|
|
51
|
+
return (
|
|
52
|
+
<View style={{ width: 400 }}>
|
|
53
|
+
<HighlightBanner {...args} />
|
|
54
|
+
</View>
|
|
55
|
+
);
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const WithButton: Story = {
|
|
60
|
+
render: args => {
|
|
61
|
+
return (
|
|
62
|
+
<View style={{ width: 400 }}>
|
|
63
|
+
<HighlightBanner
|
|
64
|
+
{...args}
|
|
65
|
+
button={<Button onPress={() => console.log('Button pressed')}>Learn More</Button>}
|
|
66
|
+
/>
|
|
67
|
+
</View>
|
|
68
|
+
);
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const WithLink: Story = {
|
|
73
|
+
render: args => {
|
|
74
|
+
return (
|
|
75
|
+
<View style={{ width: 400 }}>
|
|
76
|
+
<HighlightBanner
|
|
77
|
+
{...args}
|
|
78
|
+
link={<Link onPress={() => console.log('Link pressed')}>View details</Link>}
|
|
79
|
+
/>
|
|
80
|
+
</View>
|
|
81
|
+
);
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const ColorVariants: Story = {
|
|
86
|
+
render: args => {
|
|
87
|
+
return (
|
|
88
|
+
<View style={{ width: 400 }}>
|
|
89
|
+
<Flex space="lg" direction="column" align="stretch">
|
|
90
|
+
<HighlightBanner
|
|
91
|
+
{...args}
|
|
92
|
+
heading="Energy Blue"
|
|
93
|
+
headingColor="energy"
|
|
94
|
+
image={{
|
|
95
|
+
source: {
|
|
96
|
+
uri: 'https://images.unsplash.com/photo-1473186578172-c141e6798cf4?w=800&q=80',
|
|
97
|
+
},
|
|
98
|
+
}}
|
|
99
|
+
description="Featured content with energy blue heading"
|
|
100
|
+
link={<Link onPress={() => console.log('pressed')}>Learn more</Link>}
|
|
101
|
+
/>
|
|
102
|
+
<HighlightBanner
|
|
103
|
+
{...args}
|
|
104
|
+
heading="Broadband Green"
|
|
105
|
+
headingColor="broadband"
|
|
106
|
+
image={{
|
|
107
|
+
source: {
|
|
108
|
+
uri: 'https://images.unsplash.com/photo-1501594907352-04cda38ebc29?w=800&q=80',
|
|
109
|
+
},
|
|
110
|
+
}}
|
|
111
|
+
description="Featured content with broadband green heading"
|
|
112
|
+
/>
|
|
113
|
+
<HighlightBanner
|
|
114
|
+
{...args}
|
|
115
|
+
heading="Insurance Orange"
|
|
116
|
+
headingColor="insurance"
|
|
117
|
+
image={{
|
|
118
|
+
source: {
|
|
119
|
+
uri: 'https://images.unsplash.com/photo-1470071459604-3b5ec3a7fe05?w=800&q=80',
|
|
120
|
+
},
|
|
121
|
+
}}
|
|
122
|
+
description="Featured content with insurance orange heading"
|
|
123
|
+
button={<Button onPress={() => console.log('pressed')}>Get Started</Button>}
|
|
124
|
+
/>
|
|
125
|
+
<HighlightBanner
|
|
126
|
+
{...args}
|
|
127
|
+
heading="Cashback Lilac"
|
|
128
|
+
headingColor="cashback"
|
|
129
|
+
image={{
|
|
130
|
+
source: {
|
|
131
|
+
uri: 'https://images.unsplash.com/photo-1506748686214-e9df14d4d9d0?w=800&q=80',
|
|
132
|
+
},
|
|
133
|
+
}}
|
|
134
|
+
description="Featured content with cashback lilac heading"
|
|
135
|
+
button={<Button onPress={() => console.log('pressed')}>Get Started</Button>}
|
|
136
|
+
/>
|
|
137
|
+
<HighlightBanner
|
|
138
|
+
{...args}
|
|
139
|
+
heading="Pig Pink"
|
|
140
|
+
headingColor="pig"
|
|
141
|
+
image={{
|
|
142
|
+
source: {
|
|
143
|
+
uri: 'https://images.unsplash.com/photo-1494526585095-c41746248156?w=800&q=80',
|
|
144
|
+
},
|
|
145
|
+
}}
|
|
146
|
+
description="Featured content with pig pink heading"
|
|
147
|
+
link={<Link onPress={() => console.log('pressed')}>Learn more</Link>}
|
|
148
|
+
/>
|
|
149
|
+
<HighlightBanner
|
|
150
|
+
{...args}
|
|
151
|
+
heading="Mobile Rose"
|
|
152
|
+
headingColor="mobile"
|
|
153
|
+
image={{
|
|
154
|
+
source: {
|
|
155
|
+
uri: 'https://images.unsplash.com/photo-1511707171634-5f897ff02aa9?w=800&q=80',
|
|
156
|
+
},
|
|
157
|
+
}}
|
|
158
|
+
description="Featured content with mobile rose heading"
|
|
159
|
+
/>
|
|
160
|
+
<HighlightBanner
|
|
161
|
+
{...args}
|
|
162
|
+
heading="Highlight Yellow"
|
|
163
|
+
headingColor="highlight"
|
|
164
|
+
image={{
|
|
165
|
+
source: {
|
|
166
|
+
uri: 'https://images.unsplash.com/photo-1504384308090-c894fdcc538d?w=800&q=80',
|
|
167
|
+
},
|
|
168
|
+
}}
|
|
169
|
+
description="Featured content with highlight yellow heading"
|
|
170
|
+
/>
|
|
171
|
+
</Flex>
|
|
172
|
+
</View>
|
|
173
|
+
);
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export const WithoutImage: Story = {
|
|
178
|
+
render: args => {
|
|
179
|
+
return (
|
|
180
|
+
<View style={{ width: 400 }}>
|
|
181
|
+
<HighlightBanner
|
|
182
|
+
{...args}
|
|
183
|
+
image={undefined}
|
|
184
|
+
heading="Content Without Image"
|
|
185
|
+
description="This HighlightBanner does not have an image, focusing solely on the text content."
|
|
186
|
+
button={<Button onPress={() => console.log('pressed')}>Discover More</Button>}
|
|
187
|
+
/>
|
|
188
|
+
</View>
|
|
189
|
+
);
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
export const SubtleCard: Story = {
|
|
194
|
+
args: {
|
|
195
|
+
variant: 'subtle',
|
|
196
|
+
},
|
|
197
|
+
render: args => {
|
|
198
|
+
return (
|
|
199
|
+
<View style={{ width: 400 }}>
|
|
200
|
+
<HighlightBanner {...args} />
|
|
201
|
+
</View>
|
|
202
|
+
);
|
|
203
|
+
},
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
export const DifferentImages: Story = {
|
|
207
|
+
render: args => {
|
|
208
|
+
return (
|
|
209
|
+
<Flex space="lg" direction="column">
|
|
210
|
+
<View style={{ width: 400 }}>
|
|
211
|
+
<HighlightBanner
|
|
212
|
+
{...args}
|
|
213
|
+
heading="Nature Landscape"
|
|
214
|
+
headingColor="broadband"
|
|
215
|
+
image={{
|
|
216
|
+
source: {
|
|
217
|
+
uri: 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=800&q=80',
|
|
218
|
+
},
|
|
219
|
+
}}
|
|
220
|
+
description="Beautiful mountain landscape with clear blue sky"
|
|
221
|
+
link={<Link onPress={() => console.log('pressed')}>View gallery</Link>}
|
|
222
|
+
/>
|
|
223
|
+
</View>
|
|
224
|
+
<View style={{ width: 400 }}>
|
|
225
|
+
<HighlightBanner
|
|
226
|
+
{...args}
|
|
227
|
+
heading="Urban Architecture"
|
|
228
|
+
headingColor="highlight"
|
|
229
|
+
image={{
|
|
230
|
+
source: {
|
|
231
|
+
uri: 'https://images.unsplash.com/photo-1480714378408-67cf0d13bc1b?w=800&q=80',
|
|
232
|
+
},
|
|
233
|
+
}}
|
|
234
|
+
description="Modern city buildings and urban design"
|
|
235
|
+
button={<Button onPress={() => console.log('pressed')}>Explore Cities</Button>}
|
|
236
|
+
/>
|
|
237
|
+
</View>
|
|
238
|
+
<View style={{ width: 400 }}>
|
|
239
|
+
<HighlightBanner
|
|
240
|
+
{...args}
|
|
241
|
+
heading="Ocean Waves"
|
|
242
|
+
headingColor="energy"
|
|
243
|
+
image={{
|
|
244
|
+
source: {
|
|
245
|
+
uri: 'https://images.unsplash.com/photo-1505142468610-359e7d316be0?w=800&q=80',
|
|
246
|
+
},
|
|
247
|
+
}}
|
|
248
|
+
description="Stunning ocean views and coastal beauty"
|
|
249
|
+
/>
|
|
250
|
+
</View>
|
|
251
|
+
</Flex>
|
|
252
|
+
);
|
|
253
|
+
},
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
export const LongContent: Story = {
|
|
257
|
+
render: args => {
|
|
258
|
+
return (
|
|
259
|
+
<View style={{ width: 400 }}>
|
|
260
|
+
<HighlightBanner
|
|
261
|
+
{...args}
|
|
262
|
+
heading="Extended Information Card"
|
|
263
|
+
headingColor="energy"
|
|
264
|
+
image={{
|
|
265
|
+
source: {
|
|
266
|
+
uri: 'https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=800&q=80',
|
|
267
|
+
},
|
|
268
|
+
}}
|
|
269
|
+
description="This is a much longer description that demonstrates how the component handles extended text content. It includes multiple sentences and provides more detailed information about the featured content, ensuring the layout remains clean and readable even with more text."
|
|
270
|
+
button={<Button onPress={() => console.log('pressed')}>Read Full Article</Button>}
|
|
271
|
+
/>
|
|
272
|
+
</View>
|
|
273
|
+
);
|
|
274
|
+
},
|
|
275
|
+
};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { Image, View } from 'react-native';
|
|
2
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
3
|
+
import { BodyText } from '../BodyText';
|
|
4
|
+
import { Card } from '../Card';
|
|
5
|
+
import type HighlightBannerProps from './HighlightBanner.props';
|
|
6
|
+
|
|
7
|
+
const HighlightBanner = ({
|
|
8
|
+
heading,
|
|
9
|
+
headingColor,
|
|
10
|
+
image,
|
|
11
|
+
imageContainerHeight,
|
|
12
|
+
description,
|
|
13
|
+
link,
|
|
14
|
+
button,
|
|
15
|
+
variant = 'emphasis',
|
|
16
|
+
style,
|
|
17
|
+
...props
|
|
18
|
+
}: HighlightBannerProps) => {
|
|
19
|
+
styles.useVariants({ headingColor, variant, hasImage: Boolean(image) });
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<Card variant={variant} noPadding style={style} {...props}>
|
|
23
|
+
<View style={[styles.container]}>
|
|
24
|
+
<View style={[styles.header]}>
|
|
25
|
+
<BodyText size="md" textAlign="center" weight="semibold">
|
|
26
|
+
{heading}
|
|
27
|
+
</BodyText>
|
|
28
|
+
</View>
|
|
29
|
+
{!!image && (
|
|
30
|
+
<View style={styles.imageContainer(imageContainerHeight)}>
|
|
31
|
+
<Image resizeMode="cover" {...image} style={[styles.image, image?.style]} />
|
|
32
|
+
</View>
|
|
33
|
+
)}
|
|
34
|
+
<View style={styles.footer}>
|
|
35
|
+
<BodyText size="md" textAlign="center">
|
|
36
|
+
{description}
|
|
37
|
+
</BodyText>
|
|
38
|
+
{link && <View style={styles.linkContainer}>{link}</View>}
|
|
39
|
+
{button && <View style={styles.buttonContainer}>{button}</View>}
|
|
40
|
+
</View>
|
|
41
|
+
</View>
|
|
42
|
+
</Card>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
HighlightBanner.displayName = 'HighlightBanner';
|
|
47
|
+
|
|
48
|
+
const styles = StyleSheet.create(theme => ({
|
|
49
|
+
container: {
|
|
50
|
+
overflow: 'hidden',
|
|
51
|
+
flex: 1,
|
|
52
|
+
width: '100%',
|
|
53
|
+
},
|
|
54
|
+
header: {
|
|
55
|
+
padding: theme.components.banner.highlight.padding,
|
|
56
|
+
alignItems: 'center',
|
|
57
|
+
justifyContent: 'center',
|
|
58
|
+
variants: {
|
|
59
|
+
headingColor: {
|
|
60
|
+
highlight: {
|
|
61
|
+
backgroundColor: theme.color.surface.highlight.subtle,
|
|
62
|
+
},
|
|
63
|
+
pig: {
|
|
64
|
+
backgroundColor: theme.color.surface.pig.subtle,
|
|
65
|
+
},
|
|
66
|
+
energy: {
|
|
67
|
+
backgroundColor: theme.color.surface.energy.subtle,
|
|
68
|
+
},
|
|
69
|
+
broadband: {
|
|
70
|
+
backgroundColor: theme.color.surface.broadband.subtle,
|
|
71
|
+
},
|
|
72
|
+
mobile: {
|
|
73
|
+
backgroundColor: theme.color.surface.mobile.subtle,
|
|
74
|
+
},
|
|
75
|
+
insurance: {
|
|
76
|
+
backgroundColor: theme.color.surface.insurance.subtle,
|
|
77
|
+
},
|
|
78
|
+
cashback: {
|
|
79
|
+
backgroundColor: theme.color.surface.cashback.subtle,
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
variant: {
|
|
83
|
+
emphasis: {
|
|
84
|
+
borderColor: theme.color.border.strong,
|
|
85
|
+
borderBottomWidth: theme.borderWidth[2],
|
|
86
|
+
},
|
|
87
|
+
subtle: {
|
|
88
|
+
borderColor: theme.color.border.subtle,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
hasImage: {
|
|
92
|
+
false: {
|
|
93
|
+
borderBottomWidth: 0,
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
imageContainer: (height: number = 200) => ({
|
|
99
|
+
width: '100%',
|
|
100
|
+
height,
|
|
101
|
+
}),
|
|
102
|
+
image: {
|
|
103
|
+
width: '100%',
|
|
104
|
+
height: '100%',
|
|
105
|
+
},
|
|
106
|
+
footer: {
|
|
107
|
+
padding: theme.components.banner.highlight.padding,
|
|
108
|
+
gap: theme.components.banner.highlight.content.gap,
|
|
109
|
+
variants: {
|
|
110
|
+
variant: {
|
|
111
|
+
emphasis: {
|
|
112
|
+
borderColor: theme.color.border.strong,
|
|
113
|
+
borderTopWidth: theme.borderWidth[2],
|
|
114
|
+
},
|
|
115
|
+
subtle: {
|
|
116
|
+
borderColor: theme.color.border.subtle,
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
hasImage: {
|
|
120
|
+
true: {
|
|
121
|
+
flex: 1,
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
linkContainer: {
|
|
127
|
+
alignItems: 'center',
|
|
128
|
+
},
|
|
129
|
+
buttonContainer: {
|
|
130
|
+
alignItems: 'stretch',
|
|
131
|
+
},
|
|
132
|
+
}));
|
|
133
|
+
|
|
134
|
+
export default HighlightBanner;
|
|
@@ -18,9 +18,7 @@ import { ColorValue } from '../../types';
|
|
|
18
18
|
import { getFlattenedColorValue } from '../../utils';
|
|
19
19
|
import type SpinnerProps from './Spinner.props';
|
|
20
20
|
|
|
21
|
-
// @ts-expect-error - Animated.View type issue
|
|
22
21
|
const AnimatedSvg = Animated.createAnimatedComponent(Svg as React.ComponentType<any>);
|
|
23
|
-
// @ts-expect-error - Animated.View type issue
|
|
24
22
|
const AnimatedCircle = Animated.createAnimatedComponent(Circle as React.ComponentType<any>);
|
|
25
23
|
|
|
26
24
|
const SpinnerRoot = ({ size = 'md', color, ...props }: SpinnerProps) => {
|
|
@@ -18,9 +18,7 @@ import { ColorValue } from '../../types';
|
|
|
18
18
|
import { getFlattenedColorValue } from '../../utils';
|
|
19
19
|
import type SpinnerProps from './Spinner.props';
|
|
20
20
|
|
|
21
|
-
// @ts-expect-error - Animated.View type issue
|
|
22
21
|
const AnimatedSvg = Animated.createAnimatedComponent(Svg as React.ComponentType<any>);
|
|
23
|
-
// @ts-expect-error - Animated.View type issue
|
|
24
22
|
const AnimatedCircle = Animated.createAnimatedComponent(Circle as React.ComponentType<any>);
|
|
25
23
|
|
|
26
24
|
const SpinnerRoot = ({ size = 'md', color, ...props }: SpinnerProps) => {
|
|
@@ -15,7 +15,6 @@ import { useTheme } from '../../hooks';
|
|
|
15
15
|
import { Icon } from '../Icon';
|
|
16
16
|
import SwitchProps from './Switch.props';
|
|
17
17
|
|
|
18
|
-
// @ts-expect-error - Animated.View type issue
|
|
19
18
|
const AnimatedView = Animated.createAnimatedComponent(View);
|
|
20
19
|
|
|
21
20
|
const CustomSwitch = ({
|
|
@@ -115,18 +114,15 @@ const CustomSwitch = ({
|
|
|
115
114
|
accessibilityHint={accessibilityProps.accessibilityHint}
|
|
116
115
|
{...accessibilityProps}
|
|
117
116
|
>
|
|
118
|
-
{/* @ts-expect-error - Animated.View type issue */}
|
|
119
117
|
<AnimatedView style={[styles.switch, animatedSwitchBackgroundStyle, animatedSwitchStyle]}>
|
|
120
|
-
{/* @ts-expect-error - Animated.View type issue */}
|
|
121
118
|
<AnimatedView style={[styles.thumb, animatedThumbStyle]}>
|
|
122
|
-
{/* @ts-expect-error - Animated.View type issue */}
|
|
123
119
|
<AnimatedView style={[styles.iconWrap, animatedTickStyle]}>
|
|
124
120
|
{(() => {
|
|
125
121
|
const IconAny = Icon as any;
|
|
126
122
|
return <IconAny as={TickSmallIcon} style={styles.icon as any} />;
|
|
127
123
|
})()}
|
|
128
124
|
</AnimatedView>
|
|
129
|
-
|
|
125
|
+
|
|
130
126
|
<AnimatedView style={[styles.iconWrap, animatedCrossStyle]}>
|
|
131
127
|
{(() => {
|
|
132
128
|
const IconAny = Icon as any;
|
|
@@ -15,7 +15,6 @@ import { UnstyledIconButton } from '../UnstyledIconButton';
|
|
|
15
15
|
import { useTabsContext } from './Tabs.context';
|
|
16
16
|
import type TabsListProps from './TabsList.props';
|
|
17
17
|
|
|
18
|
-
// @ts-expect-error - Animated.View type issue
|
|
19
18
|
const Indicator = Animated.createAnimatedComponent(View);
|
|
20
19
|
|
|
21
20
|
const SCROLL_STEP_RATIO = 0.6;
|
|
@@ -113,7 +112,6 @@ const TabsList = ({ children, style, ...rest }: TabsListProps) => {
|
|
|
113
112
|
<View style={styles.container}>
|
|
114
113
|
{children}
|
|
115
114
|
<Indicator
|
|
116
|
-
// @ts-expect-error - Animated.View type issue
|
|
117
115
|
accessibilityElementsHidden
|
|
118
116
|
importantForAccessibility="no-hide-descendants"
|
|
119
117
|
style={[styles.indicator, indicatorStyle]}
|
package/src/components/index.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export * from './Accordion';
|
|
3
3
|
export * from './Alert';
|
|
4
4
|
export * from './Badge';
|
|
5
|
+
export * from './Banner';
|
|
5
6
|
export * from './BodyText';
|
|
6
7
|
export * from './BottomSheet';
|
|
7
8
|
export * from './Box';
|
|
@@ -17,11 +18,14 @@ export * from './DatePickerInput';
|
|
|
17
18
|
export * from './DescriptionList';
|
|
18
19
|
export * from './DetailText';
|
|
19
20
|
export * from './Divider';
|
|
21
|
+
export * from './Expandable';
|
|
22
|
+
export * from './ExpandableCard';
|
|
20
23
|
export * from './Flex';
|
|
21
24
|
export * from './FormField';
|
|
22
25
|
export * from './Grid';
|
|
23
26
|
export * from './Heading';
|
|
24
27
|
export * from './Helper';
|
|
28
|
+
export * from './HighlightBanner';
|
|
25
29
|
export * from './HTMLElements';
|
|
26
30
|
export * from './Icon';
|
|
27
31
|
export * from './IconButton';
|