@hero-design/rn 7.7.0 → 7.9.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 +2 -2
- package/es/index.js +1775 -333
- package/lib/index.js +1780 -336
- package/package.json +4 -8
- package/src/components/Alert/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
- package/src/components/Avatar/index.tsx +1 -1
- package/src/components/Button/Button.tsx +4 -2
- package/src/components/Button/LoadingIndicator/StyledLoadingIndicator.tsx +7 -2
- package/src/components/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.tsx +2 -0
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/StyledLoadingIndicator.spec.tsx.snap +40 -0
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +242 -0
- package/src/components/Button/LoadingIndicator/__tests__/index.spec.tsx +2 -0
- package/src/components/Button/LoadingIndicator/index.tsx +3 -1
- package/src/components/Button/StyledButton.tsx +15 -2
- package/src/components/Button/__tests__/Button.spec.tsx +2 -0
- package/src/components/Button/__tests__/StyledButton.spec.tsx +12 -0
- package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +314 -0
- package/src/components/Card/DataCard/StyledDataCard.tsx +18 -0
- package/src/components/Card/DataCard/__tests__/StyledDataCard.spec.tsx +24 -0
- package/src/components/Card/DataCard/__tests__/__snapshots__/StyledDataCard.spec.tsx.snap +96 -0
- package/src/components/Card/DataCard/__tests__/__snapshots__/index.spec.tsx.snap +151 -0
- package/src/components/Card/DataCard/__tests__/index.spec.tsx +30 -0
- package/src/components/Card/DataCard/index.tsx +35 -0
- package/src/components/Card/StyledCard.tsx +1 -3
- package/src/components/Card/__tests__/__snapshots__/StyledCard.spec.tsx.snap +0 -1
- package/src/components/Card/index.tsx +7 -2
- package/src/components/Checkbox/index.tsx +1 -1
- package/src/components/Collapse/index.tsx +1 -1
- package/src/components/Icon/HeroIcon/index.tsx +3 -1
- package/src/components/Icon/index.tsx +3 -2
- package/src/components/List/BasicListItem.tsx +98 -0
- package/src/components/List/ListItem.tsx +142 -0
- package/src/components/List/StyledBasicListItem.tsx +34 -0
- package/src/components/List/StyledListItem.tsx +82 -0
- package/src/components/List/__tests__/BasicListItem.spec.tsx +37 -0
- package/src/components/List/__tests__/ListItem.spec.tsx +110 -0
- package/src/components/List/__tests__/StyledBasicListItem.spec.tsx +24 -0
- package/src/components/List/__tests__/StyledListItem.spec.tsx +48 -0
- package/src/components/List/__tests__/__snapshots__/BasicListItem.spec.tsx.snap +103 -0
- package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +760 -0
- package/src/components/List/__tests__/__snapshots__/StyledBasicListItem.spec.tsx.snap +105 -0
- package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +200 -0
- package/src/components/List/index.tsx +14 -0
- package/src/components/SectionHeading/index.tsx +1 -1
- package/src/components/Select/Footer.tsx +13 -0
- package/src/components/Select/MultiSelect/Option.tsx +25 -0
- package/src/components/Select/MultiSelect/OptionList.tsx +30 -63
- package/src/components/Select/MultiSelect/__tests__/Option.spec.tsx +16 -0
- package/src/components/Select/MultiSelect/__tests__/OptionList.spec.tsx +42 -0
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/Option.spec.tsx.snap +70 -0
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +627 -0
- package/src/components/Select/MultiSelect/__tests__/index.spec.tsx +6 -6
- package/src/components/Select/MultiSelect/index.tsx +8 -7
- package/src/components/Select/SingleSelect/Option.tsx +23 -0
- package/src/components/Select/SingleSelect/OptionList.tsx +43 -0
- package/src/components/Select/SingleSelect/__tests__/Option.spec.tsx +16 -0
- package/src/components/Select/SingleSelect/__tests__/OptionList.spec.tsx +42 -0
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/Option.spec.tsx.snap +56 -0
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +571 -0
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +1430 -0
- package/src/components/Select/SingleSelect/__tests__/index.spec.tsx +89 -0
- package/src/components/Select/SingleSelect/index.tsx +89 -0
- package/src/components/Select/{MultiSelect/StyledMultiSelect.tsx → StyledSelect.tsx} +1 -1
- package/src/components/Select/{MultiSelect/__tests__/StyledMultiSelect.spec.tsx → __tests__/StyledSelect.spec.tsx} +2 -2
- package/src/components/Select/{MultiSelect/__tests__/__snapshots__/StyledMultiSelect.spec.tsx.snap → __tests__/__snapshots__/StyledSelect.spec.tsx.snap} +0 -0
- package/src/components/Select/helpers.tsx +18 -0
- package/src/components/Select/index.tsx +4 -3
- package/src/components/Select/{MultiSelect/types.ts → types.ts} +0 -0
- package/src/components/Switch/index.tsx +1 -1
- package/src/components/Toast/__tests__/__snapshots__/Toast.spec.tsx.snap +2 -2
- package/src/components/Toolbar/StyledToolbar.tsx +42 -0
- package/src/components/Toolbar/ToolbarGroup.tsx +31 -0
- package/src/components/Toolbar/ToolbarItem.tsx +57 -0
- package/src/components/Toolbar/__tests__/ToolbarGroup.spec.tsx +32 -0
- package/src/components/Toolbar/__tests__/ToolbarItem.spec.tsx +57 -0
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarGroup.spec.tsx.snap +391 -0
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.spec.tsx.snap +355 -0
- package/src/components/Toolbar/index.tsx +18 -0
- package/src/components/Typography/Text/StyledText.tsx +8 -1
- package/src/components/Typography/Text/__tests__/StyledText.spec.tsx +5 -0
- package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +110 -0
- package/src/components/Typography/Text/index.tsx +9 -2
- package/src/index.ts +4 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +83 -3
- package/src/theme/components/button.ts +2 -0
- package/src/theme/components/card.ts +13 -2
- package/src/theme/components/icon.ts +1 -0
- package/src/theme/components/list.ts +46 -0
- package/src/theme/components/toolbar.ts +27 -0
- package/src/theme/components/typography.ts +4 -0
- package/src/theme/global/colors.ts +9 -2
- package/src/theme/global/space.ts +2 -0
- package/src/theme/index.ts +6 -0
- package/tsconfig.json +1 -2
- package/types/components/Avatar/index.d.ts +1 -1
- package/types/components/Button/Button.d.ts +2 -2
- package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +1 -1
- package/types/components/Button/LoadingIndicator/index.d.ts +1 -1
- package/types/components/Button/StyledButton.d.ts +2 -2
- package/types/components/Card/DataCard/StyledDataCard.d.ts +16 -0
- package/types/components/{Select/MultiSelect/__tests__/StyledMultiSelect.spec.d.ts → Card/DataCard/__tests__/StyledDataCard.spec.d.ts} +0 -0
- package/types/components/Card/DataCard/__tests__/index.spec.d.ts +1 -0
- package/types/components/Card/DataCard/index.d.ts +22 -0
- package/types/components/Card/index.d.ts +7 -3
- package/types/components/Checkbox/index.d.ts +1 -1
- package/types/components/Collapse/index.d.ts +1 -1
- package/types/components/Icon/HeroIcon/index.d.ts +1 -1
- package/types/components/Icon/index.d.ts +2 -2
- package/types/components/List/BasicListItem.d.ts +43 -0
- package/types/components/List/ListItem.d.ts +51 -0
- package/types/components/List/StyledBasicListItem.d.ts +29 -0
- package/types/components/List/StyledListItem.d.ts +51 -0
- package/types/components/List/__tests__/BasicListItem.spec.d.ts +1 -0
- package/types/components/List/__tests__/ListItem.spec.d.ts +1 -0
- package/types/components/List/__tests__/StyledBasicListItem.spec.d.ts +1 -0
- package/types/components/List/__tests__/StyledListItem.spec.d.ts +1 -0
- package/types/components/List/index.d.ts +8 -0
- package/types/components/SectionHeading/index.d.ts +1 -1
- package/types/components/Select/{MultiSelect/Footer.d.ts → Footer.d.ts} +2 -2
- package/types/components/Select/MultiSelect/Option.d.ts +6 -0
- package/types/components/Select/MultiSelect/OptionList.d.ts +7 -1
- package/types/components/Select/MultiSelect/__tests__/Option.spec.d.ts +1 -0
- package/types/components/Select/MultiSelect/__tests__/OptionList.spec.d.ts +1 -0
- package/types/components/Select/MultiSelect/index.d.ts +4 -4
- package/types/components/Select/SingleSelect/Option.d.ts +6 -0
- package/types/components/Select/SingleSelect/OptionList.d.ts +9 -0
- package/types/components/Select/SingleSelect/__tests__/Option.spec.d.ts +1 -0
- package/types/components/Select/SingleSelect/__tests__/OptionList.spec.d.ts +1 -0
- package/types/components/Select/SingleSelect/__tests__/index.spec.d.ts +1 -0
- package/types/components/Select/SingleSelect/index.d.ts +35 -0
- package/types/components/Select/{MultiSelect/StyledMultiSelect.d.ts → StyledSelect.d.ts} +1 -1
- package/types/components/Select/__tests__/StyledSelect.spec.d.ts +1 -0
- package/types/components/Select/helpers.d.ts +2 -0
- package/types/components/Select/index.d.ts +3 -3
- package/types/components/Select/{MultiSelect/types.d.ts → types.d.ts} +0 -0
- package/types/components/Switch/index.d.ts +1 -1
- package/types/components/Toolbar/StyledToolbar.d.ts +22 -0
- package/types/components/Toolbar/ToolbarGroup.d.ts +13 -0
- package/types/components/Toolbar/ToolbarItem.d.ts +25 -0
- package/types/components/Toolbar/__tests__/ToolbarGroup.spec.d.ts +1 -0
- package/types/components/Toolbar/__tests__/ToolbarItem.spec.d.ts +1 -0
- package/types/components/Toolbar/index.d.ts +11 -0
- package/types/components/Typography/Text/StyledText.d.ts +1 -1
- package/types/components/Typography/Text/index.d.ts +2 -2
- package/types/index.d.ts +3 -1
- package/types/theme/components/button.d.ts +2 -0
- package/types/theme/components/card.d.ts +10 -0
- package/types/theme/components/icon.d.ts +1 -0
- package/types/theme/components/list.d.ts +40 -0
- package/types/theme/components/toolbar.d.ts +21 -0
- package/types/theme/components/typography.d.ts +4 -0
- package/types/theme/global/colors.d.ts +5 -0
- package/types/theme/global/index.d.ts +5 -0
- package/types/theme/global/space.d.ts +1 -0
- package/types/theme/index.d.ts +4 -0
- package/playground/.detoxrc.json +0 -49
- package/playground/.prettierrc.json +0 -8
- package/playground/.turbo/turbo-type-check.log +0 -7
- package/playground/app.json +0 -9
- package/playground/babel.config.js +0 -63
- package/playground/e2e/config.json +0 -9
- package/playground/e2e/environment.js +0 -23
- package/playground/e2e/firstTest.e2e.js +0 -16
- package/playground/expoEntry.js +0 -5
- package/playground/fonts/be-vietnam-pro-light.ttf +0 -0
- package/playground/fonts/be-vietnam-pro-regular.ttf +0 -0
- package/playground/fonts/be-vietnam-pro-semibold.ttf +0 -0
- package/playground/fonts/hero-icons.ttf +0 -0
- package/playground/index.js +0 -7
- package/playground/ios/MobileHeroDesignPlayground/AppDelegate.h +0 -9
- package/playground/ios/MobileHeroDesignPlayground/AppDelegate.m +0 -75
- package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/AppIcon.appiconset/Contents.json +0 -38
- package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/Contents.json +0 -6
- package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/SplashScreenBackground.imageset/Contents.json +0 -21
- package/playground/ios/MobileHeroDesignPlayground/Images.xcassets/SplashScreenBackground.imageset/image.png +0 -0
- package/playground/ios/MobileHeroDesignPlayground/Info.plist +0 -85
- package/playground/ios/MobileHeroDesignPlayground/MobileHeroDesignPlayground-Bridging-Header.h +0 -3
- package/playground/ios/MobileHeroDesignPlayground/MobileHeroDesignPlayground.entitlements +0 -8
- package/playground/ios/MobileHeroDesignPlayground/SplashScreen.storyboard +0 -40
- package/playground/ios/MobileHeroDesignPlayground/Supporting/Expo.plist +0 -16
- package/playground/ios/MobileHeroDesignPlayground/main.m +0 -10
- package/playground/ios/MobileHeroDesignPlayground/noop-file.swift +0 -4
- package/playground/ios/MobileHeroDesignPlayground.xcodeproj/project.pbxproj +0 -515
- package/playground/ios/MobileHeroDesignPlayground.xcodeproj/xcshareddata/xcschemes/MobileHeroDesignPlayground.xcscheme +0 -88
- package/playground/ios/MobileHeroDesignPlayground.xcworkspace/contents.xcworkspacedata +0 -10
- package/playground/ios/MobileHeroDesignPlayground.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/playground/ios/Podfile +0 -49
- package/playground/ios/Podfile.lock +0 -478
- package/playground/ios/Podfile.properties.json +0 -3
- package/playground/metro.config.js +0 -24
- package/playground/package.json +0 -63
- package/playground/src/Alert.tsx +0 -80
- package/playground/src/App.tsx +0 -210
- package/playground/src/Avatar.tsx +0 -102
- package/playground/src/Badge.tsx +0 -187
- package/playground/src/BottomNavigation.tsx +0 -72
- package/playground/src/BottomSheet.tsx +0 -43
- package/playground/src/Button.tsx +0 -170
- package/playground/src/Card.tsx +0 -342
- package/playground/src/Checkbox.tsx +0 -55
- package/playground/src/Collapse.tsx +0 -99
- package/playground/src/ContentNavigator.tsx +0 -58
- package/playground/src/Divider.tsx +0 -13
- package/playground/src/Drawer.tsx +0 -32
- package/playground/src/FAB.tsx +0 -66
- package/playground/src/Icon.tsx +0 -144
- package/playground/src/IconButton.tsx +0 -78
- package/playground/src/MultipleThemes.tsx +0 -34
- package/playground/src/Progress.tsx +0 -95
- package/playground/src/Radio.tsx +0 -25
- package/playground/src/SectionHeading.tsx +0 -68
- package/playground/src/Select.tsx +0 -32
- package/playground/src/Spinner.tsx +0 -19
- package/playground/src/Switch.tsx +0 -80
- package/playground/src/Tabs.tsx +0 -136
- package/playground/src/Tag.tsx +0 -45
- package/playground/src/TextInput.tsx +0 -14
- package/playground/src/Toast.tsx +0 -114
- package/playground/src/Typography.tsx +0 -23
- package/playground/tsconfig.json +0 -21
- package/src/components/Select/MultiSelect/Footer.tsx +0 -15
|
@@ -23,6 +23,26 @@ exports[`StyledButtonContainer has basic-transparent style 1`] = `
|
|
|
23
23
|
/>
|
|
24
24
|
`;
|
|
25
25
|
|
|
26
|
+
exports[`StyledButtonContainer has filled-danger style 1`] = `
|
|
27
|
+
<View
|
|
28
|
+
style={
|
|
29
|
+
Array [
|
|
30
|
+
Object {
|
|
31
|
+
"alignItems": "center",
|
|
32
|
+
"backgroundColor": "#de350b",
|
|
33
|
+
"borderRadius": 32,
|
|
34
|
+
"flexDirection": "row",
|
|
35
|
+
"justifyContent": "center",
|
|
36
|
+
"padding": 16,
|
|
37
|
+
"width": "100%",
|
|
38
|
+
},
|
|
39
|
+
undefined,
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
themeVariant="filled-danger"
|
|
43
|
+
/>
|
|
44
|
+
`;
|
|
45
|
+
|
|
26
46
|
exports[`StyledButtonContainer has filled-primary style 1`] = `
|
|
27
47
|
<View
|
|
28
48
|
style={
|
|
@@ -63,6 +83,28 @@ exports[`StyledButtonContainer has filled-secondary style 1`] = `
|
|
|
63
83
|
/>
|
|
64
84
|
`;
|
|
65
85
|
|
|
86
|
+
exports[`StyledButtonContainer has outlined-danger style 1`] = `
|
|
87
|
+
<View
|
|
88
|
+
style={
|
|
89
|
+
Array [
|
|
90
|
+
Object {
|
|
91
|
+
"alignItems": "center",
|
|
92
|
+
"backgroundColor": "transparent",
|
|
93
|
+
"borderColor": "#de350b",
|
|
94
|
+
"borderRadius": 32,
|
|
95
|
+
"borderWidth": 2,
|
|
96
|
+
"flexDirection": "row",
|
|
97
|
+
"justifyContent": "center",
|
|
98
|
+
"padding": 14,
|
|
99
|
+
"width": "100%",
|
|
100
|
+
},
|
|
101
|
+
undefined,
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
themeVariant="outlined-danger"
|
|
105
|
+
/>
|
|
106
|
+
`;
|
|
107
|
+
|
|
66
108
|
exports[`StyledButtonContainer has outlined-primary style 1`] = `
|
|
67
109
|
<View
|
|
68
110
|
style={
|
|
@@ -131,6 +173,27 @@ exports[`StyledButtonContainer has pressed with the correct variant basic-transp
|
|
|
131
173
|
/>
|
|
132
174
|
`;
|
|
133
175
|
|
|
176
|
+
exports[`StyledButtonContainer has pressed with the correct variant filled-danger style 1`] = `
|
|
177
|
+
<View
|
|
178
|
+
pressed={true}
|
|
179
|
+
style={
|
|
180
|
+
Array [
|
|
181
|
+
Object {
|
|
182
|
+
"alignItems": "center",
|
|
183
|
+
"backgroundColor": "#f2ae9d",
|
|
184
|
+
"borderRadius": 32,
|
|
185
|
+
"flexDirection": "row",
|
|
186
|
+
"justifyContent": "center",
|
|
187
|
+
"padding": 16,
|
|
188
|
+
"width": "100%",
|
|
189
|
+
},
|
|
190
|
+
undefined,
|
|
191
|
+
]
|
|
192
|
+
}
|
|
193
|
+
themeVariant="filled-danger"
|
|
194
|
+
/>
|
|
195
|
+
`;
|
|
196
|
+
|
|
134
197
|
exports[`StyledButtonContainer has pressed with the correct variant filled-primary style 1`] = `
|
|
135
198
|
<View
|
|
136
199
|
pressed={true}
|
|
@@ -173,6 +236,29 @@ exports[`StyledButtonContainer has pressed with the correct variant filled-secon
|
|
|
173
236
|
/>
|
|
174
237
|
`;
|
|
175
238
|
|
|
239
|
+
exports[`StyledButtonContainer has pressed with the correct variant outlined-danger style 1`] = `
|
|
240
|
+
<View
|
|
241
|
+
pressed={true}
|
|
242
|
+
style={
|
|
243
|
+
Array [
|
|
244
|
+
Object {
|
|
245
|
+
"alignItems": "center",
|
|
246
|
+
"backgroundColor": "transparent",
|
|
247
|
+
"borderColor": "#f2ae9d",
|
|
248
|
+
"borderRadius": 32,
|
|
249
|
+
"borderWidth": 2,
|
|
250
|
+
"flexDirection": "row",
|
|
251
|
+
"justifyContent": "center",
|
|
252
|
+
"padding": 14,
|
|
253
|
+
"width": "100%",
|
|
254
|
+
},
|
|
255
|
+
undefined,
|
|
256
|
+
]
|
|
257
|
+
}
|
|
258
|
+
themeVariant="outlined-danger"
|
|
259
|
+
/>
|
|
260
|
+
`;
|
|
261
|
+
|
|
176
262
|
exports[`StyledButtonContainer has pressed with the correct variant outlined-primary style 1`] = `
|
|
177
263
|
<View
|
|
178
264
|
pressed={true}
|
|
@@ -263,6 +349,29 @@ exports[`StyledButtonIcon has basic-transparent style 1`] = `
|
|
|
263
349
|
/>
|
|
264
350
|
`;
|
|
265
351
|
|
|
352
|
+
exports[`StyledButtonIcon has filled-danger style 1`] = `
|
|
353
|
+
<HeroIcon
|
|
354
|
+
name="bell"
|
|
355
|
+
style={
|
|
356
|
+
Array [
|
|
357
|
+
Object {
|
|
358
|
+
"color": "#292a2b",
|
|
359
|
+
"fontSize": 24,
|
|
360
|
+
},
|
|
361
|
+
Array [
|
|
362
|
+
Object {
|
|
363
|
+
"color": "#ffffff",
|
|
364
|
+
"fontSize": 20,
|
|
365
|
+
},
|
|
366
|
+
undefined,
|
|
367
|
+
],
|
|
368
|
+
]
|
|
369
|
+
}
|
|
370
|
+
themeIntent="text"
|
|
371
|
+
themeSize="medium"
|
|
372
|
+
/>
|
|
373
|
+
`;
|
|
374
|
+
|
|
266
375
|
exports[`StyledButtonIcon has filled-primary style 1`] = `
|
|
267
376
|
<HeroIcon
|
|
268
377
|
name="bell"
|
|
@@ -309,6 +418,30 @@ exports[`StyledButtonIcon has filled-secondary style 1`] = `
|
|
|
309
418
|
/>
|
|
310
419
|
`;
|
|
311
420
|
|
|
421
|
+
exports[`StyledButtonIcon has outlined-danger style 1`] = `
|
|
422
|
+
<HeroIcon
|
|
423
|
+
name="bell"
|
|
424
|
+
style={
|
|
425
|
+
Array [
|
|
426
|
+
Object {
|
|
427
|
+
"color": "#292a2b",
|
|
428
|
+
"fontSize": 24,
|
|
429
|
+
},
|
|
430
|
+
Array [
|
|
431
|
+
Object {
|
|
432
|
+
"color": "#de350b",
|
|
433
|
+
"fontSize": 18,
|
|
434
|
+
"lineHeight": 24,
|
|
435
|
+
},
|
|
436
|
+
undefined,
|
|
437
|
+
],
|
|
438
|
+
]
|
|
439
|
+
}
|
|
440
|
+
themeIntent="text"
|
|
441
|
+
themeSize="medium"
|
|
442
|
+
/>
|
|
443
|
+
`;
|
|
444
|
+
|
|
312
445
|
exports[`StyledButtonIcon has outlined-primary style 1`] = `
|
|
313
446
|
<HeroIcon
|
|
314
447
|
name="bell"
|
|
@@ -380,6 +513,29 @@ exports[`StyledButtonIcon has pressed with the correct variant basic-transparent
|
|
|
380
513
|
/>
|
|
381
514
|
`;
|
|
382
515
|
|
|
516
|
+
exports[`StyledButtonIcon has pressed with the correct variant filled-danger style 1`] = `
|
|
517
|
+
<HeroIcon
|
|
518
|
+
name="bell"
|
|
519
|
+
style={
|
|
520
|
+
Array [
|
|
521
|
+
Object {
|
|
522
|
+
"color": "#292a2b",
|
|
523
|
+
"fontSize": 24,
|
|
524
|
+
},
|
|
525
|
+
Array [
|
|
526
|
+
Object {
|
|
527
|
+
"color": "#ffffff",
|
|
528
|
+
"fontSize": 20,
|
|
529
|
+
},
|
|
530
|
+
undefined,
|
|
531
|
+
],
|
|
532
|
+
]
|
|
533
|
+
}
|
|
534
|
+
themeIntent="text"
|
|
535
|
+
themeSize="medium"
|
|
536
|
+
/>
|
|
537
|
+
`;
|
|
538
|
+
|
|
383
539
|
exports[`StyledButtonIcon has pressed with the correct variant filled-primary style 1`] = `
|
|
384
540
|
<HeroIcon
|
|
385
541
|
name="bell"
|
|
@@ -426,6 +582,30 @@ exports[`StyledButtonIcon has pressed with the correct variant filled-secondary
|
|
|
426
582
|
/>
|
|
427
583
|
`;
|
|
428
584
|
|
|
585
|
+
exports[`StyledButtonIcon has pressed with the correct variant outlined-danger style 1`] = `
|
|
586
|
+
<HeroIcon
|
|
587
|
+
name="bell"
|
|
588
|
+
style={
|
|
589
|
+
Array [
|
|
590
|
+
Object {
|
|
591
|
+
"color": "#292a2b",
|
|
592
|
+
"fontSize": 24,
|
|
593
|
+
},
|
|
594
|
+
Array [
|
|
595
|
+
Object {
|
|
596
|
+
"color": "#f2ae9d",
|
|
597
|
+
"fontSize": 18,
|
|
598
|
+
"lineHeight": 24,
|
|
599
|
+
},
|
|
600
|
+
undefined,
|
|
601
|
+
],
|
|
602
|
+
]
|
|
603
|
+
}
|
|
604
|
+
themeIntent="text"
|
|
605
|
+
themeSize="medium"
|
|
606
|
+
/>
|
|
607
|
+
`;
|
|
608
|
+
|
|
429
609
|
exports[`StyledButtonIcon has pressed with the correct variant outlined-primary style 1`] = `
|
|
430
610
|
<HeroIcon
|
|
431
611
|
name="bell"
|
|
@@ -558,6 +738,39 @@ exports[`StyledButtonText has basic-transparent style 1`] = `
|
|
|
558
738
|
</Text>
|
|
559
739
|
`;
|
|
560
740
|
|
|
741
|
+
exports[`StyledButtonText has filled-danger style 1`] = `
|
|
742
|
+
<Text
|
|
743
|
+
style={
|
|
744
|
+
Array [
|
|
745
|
+
Object {
|
|
746
|
+
"color": "#292a2b",
|
|
747
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
748
|
+
"fontSize": 14,
|
|
749
|
+
"letterSpacing": 0.42,
|
|
750
|
+
"lineHeight": 22,
|
|
751
|
+
},
|
|
752
|
+
Array [
|
|
753
|
+
Object {
|
|
754
|
+
"color": "#ffffff",
|
|
755
|
+
"flexShrink": 1,
|
|
756
|
+
"fontFamily": "BeVietnamPro-SemiBold",
|
|
757
|
+
"fontSize": 18,
|
|
758
|
+
"lineHeight": 24,
|
|
759
|
+
"textAlign": "center",
|
|
760
|
+
},
|
|
761
|
+
undefined,
|
|
762
|
+
],
|
|
763
|
+
]
|
|
764
|
+
}
|
|
765
|
+
themeFontSize="medium"
|
|
766
|
+
themeFontWeight="regular"
|
|
767
|
+
themeIntent="body"
|
|
768
|
+
themeVariant="filled-danger"
|
|
769
|
+
>
|
|
770
|
+
Example
|
|
771
|
+
</Text>
|
|
772
|
+
`;
|
|
773
|
+
|
|
561
774
|
exports[`StyledButtonText has filled-primary style 1`] = `
|
|
562
775
|
<Text
|
|
563
776
|
style={
|
|
@@ -624,6 +837,39 @@ exports[`StyledButtonText has filled-secondary style 1`] = `
|
|
|
624
837
|
</Text>
|
|
625
838
|
`;
|
|
626
839
|
|
|
840
|
+
exports[`StyledButtonText has outlined-danger style 1`] = `
|
|
841
|
+
<Text
|
|
842
|
+
style={
|
|
843
|
+
Array [
|
|
844
|
+
Object {
|
|
845
|
+
"color": "#292a2b",
|
|
846
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
847
|
+
"fontSize": 14,
|
|
848
|
+
"letterSpacing": 0.42,
|
|
849
|
+
"lineHeight": 22,
|
|
850
|
+
},
|
|
851
|
+
Array [
|
|
852
|
+
Object {
|
|
853
|
+
"color": "#de350b",
|
|
854
|
+
"flexShrink": 1,
|
|
855
|
+
"fontFamily": "BeVietnamPro-SemiBold",
|
|
856
|
+
"fontSize": 18,
|
|
857
|
+
"lineHeight": 24,
|
|
858
|
+
"textAlign": "center",
|
|
859
|
+
},
|
|
860
|
+
undefined,
|
|
861
|
+
],
|
|
862
|
+
]
|
|
863
|
+
}
|
|
864
|
+
themeFontSize="medium"
|
|
865
|
+
themeFontWeight="regular"
|
|
866
|
+
themeIntent="body"
|
|
867
|
+
themeVariant="outlined-danger"
|
|
868
|
+
>
|
|
869
|
+
Example
|
|
870
|
+
</Text>
|
|
871
|
+
`;
|
|
872
|
+
|
|
627
873
|
exports[`StyledButtonText has outlined-primary style 1`] = `
|
|
628
874
|
<Text
|
|
629
875
|
style={
|
|
@@ -724,6 +970,40 @@ exports[`StyledButtonText has pressed with the correct variant basic-transparent
|
|
|
724
970
|
</Text>
|
|
725
971
|
`;
|
|
726
972
|
|
|
973
|
+
exports[`StyledButtonText has pressed with the correct variant filled-danger style 1`] = `
|
|
974
|
+
<Text
|
|
975
|
+
pressed={true}
|
|
976
|
+
style={
|
|
977
|
+
Array [
|
|
978
|
+
Object {
|
|
979
|
+
"color": "#292a2b",
|
|
980
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
981
|
+
"fontSize": 14,
|
|
982
|
+
"letterSpacing": 0.42,
|
|
983
|
+
"lineHeight": 22,
|
|
984
|
+
},
|
|
985
|
+
Array [
|
|
986
|
+
Object {
|
|
987
|
+
"color": "#ffffff",
|
|
988
|
+
"flexShrink": 1,
|
|
989
|
+
"fontFamily": "BeVietnamPro-SemiBold",
|
|
990
|
+
"fontSize": 18,
|
|
991
|
+
"lineHeight": 24,
|
|
992
|
+
"textAlign": "center",
|
|
993
|
+
},
|
|
994
|
+
undefined,
|
|
995
|
+
],
|
|
996
|
+
]
|
|
997
|
+
}
|
|
998
|
+
themeFontSize="medium"
|
|
999
|
+
themeFontWeight="regular"
|
|
1000
|
+
themeIntent="body"
|
|
1001
|
+
themeVariant="filled-danger"
|
|
1002
|
+
>
|
|
1003
|
+
Example
|
|
1004
|
+
</Text>
|
|
1005
|
+
`;
|
|
1006
|
+
|
|
727
1007
|
exports[`StyledButtonText has pressed with the correct variant filled-primary style 1`] = `
|
|
728
1008
|
<Text
|
|
729
1009
|
pressed={true}
|
|
@@ -792,6 +1072,40 @@ exports[`StyledButtonText has pressed with the correct variant filled-secondary
|
|
|
792
1072
|
</Text>
|
|
793
1073
|
`;
|
|
794
1074
|
|
|
1075
|
+
exports[`StyledButtonText has pressed with the correct variant outlined-danger style 1`] = `
|
|
1076
|
+
<Text
|
|
1077
|
+
pressed={true}
|
|
1078
|
+
style={
|
|
1079
|
+
Array [
|
|
1080
|
+
Object {
|
|
1081
|
+
"color": "#292a2b",
|
|
1082
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
1083
|
+
"fontSize": 14,
|
|
1084
|
+
"letterSpacing": 0.42,
|
|
1085
|
+
"lineHeight": 22,
|
|
1086
|
+
},
|
|
1087
|
+
Array [
|
|
1088
|
+
Object {
|
|
1089
|
+
"color": "#f2ae9d",
|
|
1090
|
+
"flexShrink": 1,
|
|
1091
|
+
"fontFamily": "BeVietnamPro-SemiBold",
|
|
1092
|
+
"fontSize": 18,
|
|
1093
|
+
"lineHeight": 24,
|
|
1094
|
+
"textAlign": "center",
|
|
1095
|
+
},
|
|
1096
|
+
undefined,
|
|
1097
|
+
],
|
|
1098
|
+
]
|
|
1099
|
+
}
|
|
1100
|
+
themeFontSize="medium"
|
|
1101
|
+
themeFontWeight="regular"
|
|
1102
|
+
themeIntent="body"
|
|
1103
|
+
themeVariant="outlined-danger"
|
|
1104
|
+
>
|
|
1105
|
+
Example
|
|
1106
|
+
</Text>
|
|
1107
|
+
`;
|
|
1108
|
+
|
|
795
1109
|
exports[`StyledButtonText has pressed with the correct variant outlined-primary style 1`] = `
|
|
796
1110
|
<Text
|
|
797
1111
|
pressed={true}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { View } from 'react-native';
|
|
2
|
+
import styled from '@emotion/native';
|
|
3
|
+
|
|
4
|
+
const StyledDataCard = styled(View)(({ theme }) => ({
|
|
5
|
+
borderRadius: theme.__hd__.card.radii.default,
|
|
6
|
+
overflow: 'hidden',
|
|
7
|
+
flexDirection: 'row',
|
|
8
|
+
}));
|
|
9
|
+
|
|
10
|
+
const Indicator = styled(View)<{
|
|
11
|
+
themeIntent: 'success' | 'info' | 'warning' | 'danger' | 'archived';
|
|
12
|
+
}>(({ theme, themeIntent }) => ({
|
|
13
|
+
backgroundColor: theme.__hd__.card.colors.indicator[themeIntent],
|
|
14
|
+
width: theme.__hd__.card.sizes.indicatorWidth,
|
|
15
|
+
height: '100%',
|
|
16
|
+
}));
|
|
17
|
+
|
|
18
|
+
export { StyledDataCard, Indicator };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import renderWithTheme from '../../../../testHelpers/renderWithTheme';
|
|
3
|
+
import { StyledDataCard, Indicator } from '../StyledDataCard';
|
|
4
|
+
|
|
5
|
+
describe('StyledDataCard', () => {
|
|
6
|
+
it('renders correctly', () => {
|
|
7
|
+
const { toJSON } = renderWithTheme(<StyledDataCard />);
|
|
8
|
+
expect(toJSON()).toMatchSnapshot();
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
describe('Indicator', () => {
|
|
13
|
+
it.each`
|
|
14
|
+
intent
|
|
15
|
+
${'success'}
|
|
16
|
+
${'info'}
|
|
17
|
+
${'warning'}
|
|
18
|
+
${'danger'}
|
|
19
|
+
${'archived'}
|
|
20
|
+
`('renders correctly when intent is $intent', ({ intent }) => {
|
|
21
|
+
const { toJSON } = renderWithTheme(<Indicator themeIntent={intent} />);
|
|
22
|
+
expect(toJSON()).toMatchSnapshot();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Indicator renders correctly when intent is archived 1`] = `
|
|
4
|
+
<View
|
|
5
|
+
style={
|
|
6
|
+
Array [
|
|
7
|
+
Object {
|
|
8
|
+
"backgroundColor": "#bfc1c5",
|
|
9
|
+
"height": "100%",
|
|
10
|
+
"width": 16,
|
|
11
|
+
},
|
|
12
|
+
undefined,
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
themeIntent="archived"
|
|
16
|
+
/>
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
exports[`Indicator renders correctly when intent is danger 1`] = `
|
|
20
|
+
<View
|
|
21
|
+
style={
|
|
22
|
+
Array [
|
|
23
|
+
Object {
|
|
24
|
+
"backgroundColor": "#e3602a",
|
|
25
|
+
"height": "100%",
|
|
26
|
+
"width": 16,
|
|
27
|
+
},
|
|
28
|
+
undefined,
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
themeIntent="danger"
|
|
32
|
+
/>
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
exports[`Indicator renders correctly when intent is info 1`] = `
|
|
36
|
+
<View
|
|
37
|
+
style={
|
|
38
|
+
Array [
|
|
39
|
+
Object {
|
|
40
|
+
"backgroundColor": "#b5c3fd",
|
|
41
|
+
"height": "100%",
|
|
42
|
+
"width": 16,
|
|
43
|
+
},
|
|
44
|
+
undefined,
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
themeIntent="info"
|
|
48
|
+
/>
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
exports[`Indicator renders correctly when intent is success 1`] = `
|
|
52
|
+
<View
|
|
53
|
+
style={
|
|
54
|
+
Array [
|
|
55
|
+
Object {
|
|
56
|
+
"backgroundColor": "#5ace7d",
|
|
57
|
+
"height": "100%",
|
|
58
|
+
"width": 16,
|
|
59
|
+
},
|
|
60
|
+
undefined,
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
themeIntent="success"
|
|
64
|
+
/>
|
|
65
|
+
`;
|
|
66
|
+
|
|
67
|
+
exports[`Indicator renders correctly when intent is warning 1`] = `
|
|
68
|
+
<View
|
|
69
|
+
style={
|
|
70
|
+
Array [
|
|
71
|
+
Object {
|
|
72
|
+
"backgroundColor": "#ffbe71",
|
|
73
|
+
"height": "100%",
|
|
74
|
+
"width": 16,
|
|
75
|
+
},
|
|
76
|
+
undefined,
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
themeIntent="warning"
|
|
80
|
+
/>
|
|
81
|
+
`;
|
|
82
|
+
|
|
83
|
+
exports[`StyledDataCard renders correctly 1`] = `
|
|
84
|
+
<View
|
|
85
|
+
style={
|
|
86
|
+
Array [
|
|
87
|
+
Object {
|
|
88
|
+
"borderRadius": 12,
|
|
89
|
+
"flexDirection": "row",
|
|
90
|
+
"overflow": "hidden",
|
|
91
|
+
},
|
|
92
|
+
undefined,
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
/>
|
|
96
|
+
`;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`DataCard renders correctly when intent is archived 1`] = `
|
|
4
|
+
<View
|
|
5
|
+
style={
|
|
6
|
+
Array [
|
|
7
|
+
Object {
|
|
8
|
+
"borderRadius": 12,
|
|
9
|
+
"flexDirection": "row",
|
|
10
|
+
"overflow": "hidden",
|
|
11
|
+
},
|
|
12
|
+
undefined,
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
>
|
|
16
|
+
<View
|
|
17
|
+
style={
|
|
18
|
+
Array [
|
|
19
|
+
Object {
|
|
20
|
+
"backgroundColor": "#bfc1c5",
|
|
21
|
+
"height": "100%",
|
|
22
|
+
"width": 16,
|
|
23
|
+
},
|
|
24
|
+
undefined,
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
testID="data-card-indicator"
|
|
28
|
+
themeIntent="archived"
|
|
29
|
+
/>
|
|
30
|
+
</View>
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
exports[`DataCard renders correctly when intent is danger 1`] = `
|
|
34
|
+
<View
|
|
35
|
+
style={
|
|
36
|
+
Array [
|
|
37
|
+
Object {
|
|
38
|
+
"borderRadius": 12,
|
|
39
|
+
"flexDirection": "row",
|
|
40
|
+
"overflow": "hidden",
|
|
41
|
+
},
|
|
42
|
+
undefined,
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
>
|
|
46
|
+
<View
|
|
47
|
+
style={
|
|
48
|
+
Array [
|
|
49
|
+
Object {
|
|
50
|
+
"backgroundColor": "#e3602a",
|
|
51
|
+
"height": "100%",
|
|
52
|
+
"width": 16,
|
|
53
|
+
},
|
|
54
|
+
undefined,
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
testID="data-card-indicator"
|
|
58
|
+
themeIntent="danger"
|
|
59
|
+
/>
|
|
60
|
+
</View>
|
|
61
|
+
`;
|
|
62
|
+
|
|
63
|
+
exports[`DataCard renders correctly when intent is info 1`] = `
|
|
64
|
+
<View
|
|
65
|
+
style={
|
|
66
|
+
Array [
|
|
67
|
+
Object {
|
|
68
|
+
"borderRadius": 12,
|
|
69
|
+
"flexDirection": "row",
|
|
70
|
+
"overflow": "hidden",
|
|
71
|
+
},
|
|
72
|
+
undefined,
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
>
|
|
76
|
+
<View
|
|
77
|
+
style={
|
|
78
|
+
Array [
|
|
79
|
+
Object {
|
|
80
|
+
"backgroundColor": "#b5c3fd",
|
|
81
|
+
"height": "100%",
|
|
82
|
+
"width": 16,
|
|
83
|
+
},
|
|
84
|
+
undefined,
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
testID="data-card-indicator"
|
|
88
|
+
themeIntent="info"
|
|
89
|
+
/>
|
|
90
|
+
</View>
|
|
91
|
+
`;
|
|
92
|
+
|
|
93
|
+
exports[`DataCard renders correctly when intent is success 1`] = `
|
|
94
|
+
<View
|
|
95
|
+
style={
|
|
96
|
+
Array [
|
|
97
|
+
Object {
|
|
98
|
+
"borderRadius": 12,
|
|
99
|
+
"flexDirection": "row",
|
|
100
|
+
"overflow": "hidden",
|
|
101
|
+
},
|
|
102
|
+
undefined,
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
>
|
|
106
|
+
<View
|
|
107
|
+
style={
|
|
108
|
+
Array [
|
|
109
|
+
Object {
|
|
110
|
+
"backgroundColor": "#5ace7d",
|
|
111
|
+
"height": "100%",
|
|
112
|
+
"width": 16,
|
|
113
|
+
},
|
|
114
|
+
undefined,
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
testID="data-card-indicator"
|
|
118
|
+
themeIntent="success"
|
|
119
|
+
/>
|
|
120
|
+
</View>
|
|
121
|
+
`;
|
|
122
|
+
|
|
123
|
+
exports[`DataCard renders correctly when intent is warning 1`] = `
|
|
124
|
+
<View
|
|
125
|
+
style={
|
|
126
|
+
Array [
|
|
127
|
+
Object {
|
|
128
|
+
"borderRadius": 12,
|
|
129
|
+
"flexDirection": "row",
|
|
130
|
+
"overflow": "hidden",
|
|
131
|
+
},
|
|
132
|
+
undefined,
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
>
|
|
136
|
+
<View
|
|
137
|
+
style={
|
|
138
|
+
Array [
|
|
139
|
+
Object {
|
|
140
|
+
"backgroundColor": "#ffbe71",
|
|
141
|
+
"height": "100%",
|
|
142
|
+
"width": 16,
|
|
143
|
+
},
|
|
144
|
+
undefined,
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
testID="data-card-indicator"
|
|
148
|
+
themeIntent="warning"
|
|
149
|
+
/>
|
|
150
|
+
</View>
|
|
151
|
+
`;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import renderWithTheme from '../../../../testHelpers/renderWithTheme';
|
|
4
|
+
import DataCard from '..';
|
|
5
|
+
|
|
6
|
+
describe('DataCard', () => {
|
|
7
|
+
it('renders correctly', () => {
|
|
8
|
+
const { queryAllByTestId } = renderWithTheme(
|
|
9
|
+
<DataCard testID="card">
|
|
10
|
+
<View testID="child-view" />
|
|
11
|
+
</DataCard>
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
expect(queryAllByTestId('card')).toHaveLength(1);
|
|
15
|
+
expect(queryAllByTestId('child-view')).toHaveLength(1);
|
|
16
|
+
expect(queryAllByTestId('data-card-indicator')).toHaveLength(1);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it.each`
|
|
20
|
+
intent
|
|
21
|
+
${'success'}
|
|
22
|
+
${'info'}
|
|
23
|
+
${'warning'}
|
|
24
|
+
${'danger'}
|
|
25
|
+
${'archived'}
|
|
26
|
+
`('renders correctly when intent is $intent', ({ intent }) => {
|
|
27
|
+
const { toJSON } = renderWithTheme(<DataCard intent={intent} />);
|
|
28
|
+
expect(toJSON()).toMatchSnapshot();
|
|
29
|
+
});
|
|
30
|
+
});
|