@hero-design/rn 8.1.0 → 8.2.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 +9 -9
- package/es/index.js +6 -1
- package/jest.config.js +1 -1
- package/lib/index.js +6 -1
- package/package.json +10 -11
- package/src/components/Accordion/__tests__/__snapshots__/AccordionItem.spec.tsx.snap +0 -8
- package/src/components/Accordion/__tests__/__snapshots__/index.spec.tsx.snap +0 -12
- package/src/components/Alert/StyledAlert.tsx +4 -2
- package/src/components/Alert/__tests__/__snapshots__/index.spec.tsx.snap +120 -5
- package/src/components/Alert/__tests__/index.spec.tsx +14 -0
- package/src/components/Alert/index.tsx +13 -3
- package/src/components/Attachment/__tests__/__snapshots__/index.spec.tsx.snap +0 -2
- package/src/components/Avatar/AvatarStack/__tests__/__snapshots__/StyledAvatarStack.spec.tsx.snap +5 -1
- package/src/components/Avatar/AvatarStack/__tests__/__snapshots__/index.spec.tsx.snap +45 -9
- package/src/components/Avatar/__tests__/__snapshots__/StyledAvatar.spec.tsx.snap +0 -1
- package/src/components/Avatar/__tests__/__snapshots__/index.spec.tsx.snap +16 -2
- package/src/components/Badge/__tests__/__snapshots__/Badge.spec.tsx.snap +0 -6
- package/src/components/Badge/__tests__/__snapshots__/Status.spec.tsx.snap +0 -2
- package/src/components/BottomSheet/__tests__/__snapshots__/index.spec.tsx.snap +1 -278
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +0 -70
- package/src/components/Button/UtilityButton/__tests__/__snapshots__/index.spec.tsx.snap +0 -2
- package/src/components/Button/__tests__/__snapshots__/IconButton.spec.tsx.snap +0 -1
- package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +5 -10
- package/src/components/Calendar/__tests__/__snapshots__/CalendarRowItem.spec.tsx.snap +0 -5
- package/src/components/Checkbox/__tests__/__snapshots__/StyledCheckbox.spec.tsx.snap +0 -3
- package/src/components/Checkbox/__tests__/__snapshots__/index.spec.tsx.snap +30 -6
- package/src/components/Collapse/__tests__/__snapshots__/StyledCollapse.spec.tsx.snap +0 -1
- package/src/components/Collapse/__tests__/__snapshots__/index.spec.tsx.snap +0 -2
- package/src/components/ContentNavigator/__tests__/__snapshots__/index.spec.tsx.snap +20 -4
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +6 -0
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +13 -4
- package/src/components/Drawer/DragableDrawer/__tests__/__snapshots__/index.spec.tsx.snap +0 -1
- package/src/components/Drawer/__tests__/__snapshots__/index.spec.tsx.snap +0 -6
- package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +0 -14
- package/src/components/FAB/__tests__/__snapshots__/AnimatedFABIcon.spec.tsx.snap +0 -2
- package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +0 -1
- package/src/components/Icon/__tests__/__snapshots__/index.spec.tsx.snap +0 -1
- package/src/components/List/__tests__/__snapshots__/BasicListItem.spec.tsx.snap +10 -2
- package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +30 -7
- package/src/components/List/__tests__/__snapshots__/StyledBasicListItem.spec.tsx.snap +0 -4
- package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +0 -4
- package/src/components/Progress/__tests__/__snapshots__/index.spec.js.snap +0 -11
- package/src/components/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +10 -2
- package/src/components/Radio/__tests__/__snapshots__/RadioGroup.spec.tsx.snap +15 -3
- package/src/components/RichTextEditor/__tests__/__snapshots__/EditorToolbar.spec.tsx.snap +0 -7
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/Option.spec.tsx.snap +5 -1
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +60 -19
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +533 -3057
- package/src/components/Select/MultiSelect/__tests__/index.spec.tsx +7 -2
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/Option.spec.tsx.snap +5 -1
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +60 -19
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +485 -2745
- package/src/components/Select/SingleSelect/__tests__/index.spec.tsx +1 -1
- package/src/components/Spinner/__tests__/__snapshots__/AnimatedSpinner.spec.tsx.snap +0 -7
- package/src/components/Spinner/__tests__/__snapshots__/StyledSpinner.spec.tsx.snap +0 -28
- package/src/components/Spinner/__tests__/__snapshots__/index.spec.tsx.snap +0 -7
- package/src/components/Swipeable/__tests__/__snapshots__/SwipeableAction.spec.tsx.snap +0 -3
- package/src/components/Switch/SelectorSwitch/__tests__/__snapshots__/Option.spec.tsx.snap +0 -3
- package/src/components/Switch/SelectorSwitch/__tests__/__snapshots__/index.spec.tsx.snap +0 -1
- package/src/components/Switch/__tests__/__snapshots__/StyledSwitch.spec.tsx.snap +0 -1
- package/src/components/Switch/__tests__/__snapshots__/index.spec.tsx.snap +0 -2
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +0 -11
- package/src/components/Tabs/__tests__/__snapshots__/TabWithBadge.spec.tsx.snap +0 -2
- package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +0 -4
- package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +0 -1
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +11 -1
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +18 -5
- package/src/components/Toast/__tests__/__snapshots__/Toast.spec.tsx.snap +0 -13
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarGroup.spec.tsx.snap +30 -6
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.spec.tsx.snap +30 -6
- package/types/components/Alert/StyledAlert.d.ts +1 -0
- package/types/components/Alert/index.d.ts +5 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
[
|
|
2
|
-
[
|
|
3
|
-
[
|
|
4
|
-
[
|
|
5
|
-
[
|
|
6
|
-
[
|
|
7
|
-
[
|
|
8
|
-
[
|
|
9
|
-
[
|
|
1
|
+
[35m@hero-design/rn:build[0m: cache hit, replaying output [2m72983ebd2349f24e[0m
|
|
2
|
+
[35m@hero-design/rn:build: [0m$ yarn build:js && yarn build:types
|
|
3
|
+
[35m@hero-design/rn:build: [0m$ rollup -c
|
|
4
|
+
[35m@hero-design/rn:build: [0m[36m
|
|
5
|
+
[35m@hero-design/rn:build: [0m[1msrc/index.ts[22m → [1mlib/index.js, es/index.js[22m...[39m
|
|
6
|
+
[35m@hero-design/rn:build: [0m[1m[33m(!) Plugin replace: @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.[39m[22m
|
|
7
|
+
[35m@hero-design/rn:build: [0m[1m[33m(!) Plugin node-resolve: preferring built-in module 'events' over local alternative at '/root/hero-design/node_modules/events/events.js', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning[39m[22m
|
|
8
|
+
[35m@hero-design/rn:build: [0m[32mcreated [1mlib/index.js, es/index.js[22m in [1m26.8s[22m[39m
|
|
9
|
+
[35m@hero-design/rn:build: [0m$ tsc --noEmit false --emitDeclarationOnly --project tsconfig.prod.json
|
package/es/index.js
CHANGED
|
@@ -6310,9 +6310,11 @@ var Accordion = function Accordion(_ref) {
|
|
|
6310
6310
|
|
|
6311
6311
|
var Container$1 = index$a(View)(function (_ref) {
|
|
6312
6312
|
var theme = _ref.theme,
|
|
6313
|
+
_ref$themeVariant = _ref.themeVariant,
|
|
6314
|
+
themeVariant = _ref$themeVariant === void 0 ? 'rounded' : _ref$themeVariant,
|
|
6313
6315
|
themeIntent = _ref.themeIntent;
|
|
6314
6316
|
return {
|
|
6315
|
-
borderRadius: theme.__hd__.alert.radii["default"],
|
|
6317
|
+
borderRadius: themeVariant === 'rounded' ? theme.__hd__.alert.radii["default"] : 0,
|
|
6316
6318
|
backgroundColor: theme.__hd__.alert.colors[themeIntent],
|
|
6317
6319
|
minHeight: theme.__hd__.alert.sizes.height,
|
|
6318
6320
|
flexDirection: 'row'
|
|
@@ -6381,9 +6383,12 @@ var Alert = function Alert(_ref2) {
|
|
|
6381
6383
|
_ref2$intent = _ref2.intent,
|
|
6382
6384
|
intent = _ref2$intent === void 0 ? 'info' : _ref2$intent,
|
|
6383
6385
|
onClose = _ref2.onClose,
|
|
6386
|
+
_ref2$variant = _ref2.variant,
|
|
6387
|
+
variant = _ref2$variant === void 0 ? 'rounded' : _ref2$variant,
|
|
6384
6388
|
style = _ref2.style,
|
|
6385
6389
|
testID = _ref2.testID;
|
|
6386
6390
|
return /*#__PURE__*/React.createElement(Container$1, {
|
|
6391
|
+
themeVariant: variant,
|
|
6387
6392
|
themeIntent: intent,
|
|
6388
6393
|
style: style,
|
|
6389
6394
|
testID: testID
|
package/jest.config.js
CHANGED
|
@@ -21,6 +21,6 @@ module.exports = {
|
|
|
21
21
|
roots: ['<rootDir>/src'],
|
|
22
22
|
snapshotSerializers: ['@emotion/jest/serializer'],
|
|
23
23
|
transformIgnorePatterns: [
|
|
24
|
-
'node_modules/(?!(jest-)?@react-native
|
|
24
|
+
'node_modules/(?!(jest-)?@react-native|@emotion/.*|react-native|@react-native-community)',
|
|
25
25
|
],
|
|
26
26
|
};
|
package/lib/index.js
CHANGED
|
@@ -6339,9 +6339,11 @@ var Accordion = function Accordion(_ref) {
|
|
|
6339
6339
|
|
|
6340
6340
|
var Container$1 = index$a(reactNative.View)(function (_ref) {
|
|
6341
6341
|
var theme = _ref.theme,
|
|
6342
|
+
_ref$themeVariant = _ref.themeVariant,
|
|
6343
|
+
themeVariant = _ref$themeVariant === void 0 ? 'rounded' : _ref$themeVariant,
|
|
6342
6344
|
themeIntent = _ref.themeIntent;
|
|
6343
6345
|
return {
|
|
6344
|
-
borderRadius: theme.__hd__.alert.radii["default"],
|
|
6346
|
+
borderRadius: themeVariant === 'rounded' ? theme.__hd__.alert.radii["default"] : 0,
|
|
6345
6347
|
backgroundColor: theme.__hd__.alert.colors[themeIntent],
|
|
6346
6348
|
minHeight: theme.__hd__.alert.sizes.height,
|
|
6347
6349
|
flexDirection: 'row'
|
|
@@ -6410,9 +6412,12 @@ var Alert = function Alert(_ref2) {
|
|
|
6410
6412
|
_ref2$intent = _ref2.intent,
|
|
6411
6413
|
intent = _ref2$intent === void 0 ? 'info' : _ref2$intent,
|
|
6412
6414
|
onClose = _ref2.onClose,
|
|
6415
|
+
_ref2$variant = _ref2.variant,
|
|
6416
|
+
variant = _ref2$variant === void 0 ? 'rounded' : _ref2$variant,
|
|
6413
6417
|
style = _ref2.style,
|
|
6414
6418
|
testID = _ref2.testID;
|
|
6415
6419
|
return /*#__PURE__*/React__default["default"].createElement(Container$1, {
|
|
6420
|
+
themeVariant: variant,
|
|
6416
6421
|
themeIntent: intent,
|
|
6417
6422
|
style: style,
|
|
6418
6423
|
testID: testID
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hero-design/rn",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.2.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@emotion/native": "^11.9.3",
|
|
23
23
|
"@emotion/react": "^11.9.3",
|
|
24
|
-
"@hero-design/colors": "8.
|
|
24
|
+
"@hero-design/colors": "8.2.0",
|
|
25
25
|
"date-fns": "^2.16.1",
|
|
26
26
|
"events": "^3.2.0",
|
|
27
27
|
"hero-editor": "^1.9.12"
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@react-native-community/datetimepicker": "^3.5.2",
|
|
31
31
|
"@react-native-community/slider": "4.1.12",
|
|
32
|
-
"react": "
|
|
33
|
-
"react-native": "0.
|
|
32
|
+
"react": "18.0.0",
|
|
33
|
+
"react-native": "0.69.7",
|
|
34
34
|
"react-native-gesture-handler": "^1.10.3 | ~2.1.0",
|
|
35
35
|
"react-native-pager-view": "^5.4.25",
|
|
36
36
|
"react-native-safe-area-context": "^4.2.5",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@babel/preset-typescript": "^7.17.12",
|
|
45
45
|
"@babel/runtime": "^7.18.9",
|
|
46
46
|
"@emotion/jest": "^11.9.3",
|
|
47
|
-
"@hero-design/eslint-plugin": "8.
|
|
47
|
+
"@hero-design/eslint-plugin": "8.2.0",
|
|
48
48
|
"@react-native-community/datetimepicker": "^3.5.2",
|
|
49
49
|
"@react-native-community/slider": "4.1.12",
|
|
50
50
|
"@rollup/plugin-babel": "^5.3.1",
|
|
@@ -60,18 +60,17 @@
|
|
|
60
60
|
"@types/react-native": "^0.67.7",
|
|
61
61
|
"@types/react-native-vector-icons": "^6.4.10",
|
|
62
62
|
"babel-plugin-inline-import": "^3.0.0",
|
|
63
|
-
"eslint-config-hd": "8.
|
|
63
|
+
"eslint-config-hd": "8.2.0",
|
|
64
64
|
"jest": "^27.3.1",
|
|
65
|
-
"prettier-config-hd": "8.
|
|
66
|
-
"react": "
|
|
67
|
-
"react-native": "0.
|
|
65
|
+
"prettier-config-hd": "8.2.0",
|
|
66
|
+
"react": "18.0.0",
|
|
67
|
+
"react-native": "0.69.7",
|
|
68
68
|
"react-native-gesture-handler": "~2.1.0",
|
|
69
69
|
"react-native-pager-view": "^5.4.25",
|
|
70
70
|
"react-native-safe-area-context": "^4.2.5",
|
|
71
71
|
"react-native-vector-icons": "^9.1.0",
|
|
72
72
|
"react-native-webview": "^11.15.0",
|
|
73
|
-
"react-test-renderer": "
|
|
74
|
-
"rn-7-23-0": "npm:@hero-design/rn@7.23.0",
|
|
73
|
+
"react-test-renderer": "18.0.0",
|
|
75
74
|
"rollup": "^2.68.0",
|
|
76
75
|
"rollup-plugin-copy": "^3.4.0",
|
|
77
76
|
"rollup-plugin-flow": "^1.1.1",
|
|
@@ -18,7 +18,6 @@ exports[`AccordionItem renders correctly when header is an element 1`] = `
|
|
|
18
18
|
accessible={true}
|
|
19
19
|
collapsable={false}
|
|
20
20
|
focusable={false}
|
|
21
|
-
nativeID="animatedComponent"
|
|
22
21
|
onClick={[Function]}
|
|
23
22
|
onResponderGrant={[Function]}
|
|
24
23
|
onResponderMove={[Function]}
|
|
@@ -71,7 +70,6 @@ exports[`AccordionItem renders correctly when header is an element 1`] = `
|
|
|
71
70
|
</View>
|
|
72
71
|
<View
|
|
73
72
|
collapsable={false}
|
|
74
|
-
nativeID="animatedComponent"
|
|
75
73
|
style={
|
|
76
74
|
Object {
|
|
77
75
|
"height": 0,
|
|
@@ -152,7 +150,6 @@ exports[`AccordionItem renders correctly when header is string 1`] = `
|
|
|
152
150
|
accessible={true}
|
|
153
151
|
collapsable={false}
|
|
154
152
|
focusable={false}
|
|
155
|
-
nativeID="animatedComponent"
|
|
156
153
|
onClick={[Function]}
|
|
157
154
|
onResponderGrant={[Function]}
|
|
158
155
|
onResponderMove={[Function]}
|
|
@@ -205,7 +202,6 @@ exports[`AccordionItem renders correctly when header is string 1`] = `
|
|
|
205
202
|
</View>
|
|
206
203
|
<View
|
|
207
204
|
collapsable={false}
|
|
208
|
-
nativeID="animatedComponent"
|
|
209
205
|
style={
|
|
210
206
|
Object {
|
|
211
207
|
"height": 0,
|
|
@@ -286,7 +282,6 @@ exports[`AccordionItem renders correctly when open 1`] = `
|
|
|
286
282
|
accessible={true}
|
|
287
283
|
collapsable={false}
|
|
288
284
|
focusable={false}
|
|
289
|
-
nativeID="animatedComponent"
|
|
290
285
|
onClick={[Function]}
|
|
291
286
|
onResponderGrant={[Function]}
|
|
292
287
|
onResponderMove={[Function]}
|
|
@@ -339,7 +334,6 @@ exports[`AccordionItem renders correctly when open 1`] = `
|
|
|
339
334
|
</View>
|
|
340
335
|
<View
|
|
341
336
|
collapsable={false}
|
|
342
|
-
nativeID="animatedComponent"
|
|
343
337
|
style={
|
|
344
338
|
Object {
|
|
345
339
|
"height": 0,
|
|
@@ -420,7 +414,6 @@ exports[`AccordionItem renders correctly when variant is card 1`] = `
|
|
|
420
414
|
accessible={true}
|
|
421
415
|
collapsable={false}
|
|
422
416
|
focusable={false}
|
|
423
|
-
nativeID="animatedComponent"
|
|
424
417
|
onClick={[Function]}
|
|
425
418
|
onResponderGrant={[Function]}
|
|
426
419
|
onResponderMove={[Function]}
|
|
@@ -473,7 +466,6 @@ exports[`AccordionItem renders correctly when variant is card 1`] = `
|
|
|
473
466
|
</View>
|
|
474
467
|
<View
|
|
475
468
|
collapsable={false}
|
|
476
|
-
nativeID="animatedComponent"
|
|
477
469
|
style={
|
|
478
470
|
Object {
|
|
479
471
|
"height": 0,
|
|
@@ -26,7 +26,6 @@ exports[`Accordion allows fully controlled 1`] = `
|
|
|
26
26
|
accessible={true}
|
|
27
27
|
collapsable={false}
|
|
28
28
|
focusable={true}
|
|
29
|
-
nativeID="animatedComponent"
|
|
30
29
|
onClick={[Function]}
|
|
31
30
|
onResponderGrant={[Function]}
|
|
32
31
|
onResponderMove={[Function]}
|
|
@@ -79,7 +78,6 @@ exports[`Accordion allows fully controlled 1`] = `
|
|
|
79
78
|
</View>
|
|
80
79
|
<View
|
|
81
80
|
collapsable={false}
|
|
82
|
-
nativeID="animatedComponent"
|
|
83
81
|
style={
|
|
84
82
|
Object {
|
|
85
83
|
"height": 0,
|
|
@@ -157,7 +155,6 @@ exports[`Accordion allows fully controlled 1`] = `
|
|
|
157
155
|
accessible={true}
|
|
158
156
|
collapsable={false}
|
|
159
157
|
focusable={true}
|
|
160
|
-
nativeID="animatedComponent"
|
|
161
158
|
onClick={[Function]}
|
|
162
159
|
onResponderGrant={[Function]}
|
|
163
160
|
onResponderMove={[Function]}
|
|
@@ -210,7 +207,6 @@ exports[`Accordion allows fully controlled 1`] = `
|
|
|
210
207
|
</View>
|
|
211
208
|
<View
|
|
212
209
|
collapsable={false}
|
|
213
|
-
nativeID="animatedComponent"
|
|
214
210
|
style={
|
|
215
211
|
Object {
|
|
216
212
|
"height": 0,
|
|
@@ -300,7 +296,6 @@ exports[`Accordion renders correctly 1`] = `
|
|
|
300
296
|
accessible={true}
|
|
301
297
|
collapsable={false}
|
|
302
298
|
focusable={true}
|
|
303
|
-
nativeID="animatedComponent"
|
|
304
299
|
onClick={[Function]}
|
|
305
300
|
onResponderGrant={[Function]}
|
|
306
301
|
onResponderMove={[Function]}
|
|
@@ -353,7 +348,6 @@ exports[`Accordion renders correctly 1`] = `
|
|
|
353
348
|
</View>
|
|
354
349
|
<View
|
|
355
350
|
collapsable={false}
|
|
356
|
-
nativeID="animatedComponent"
|
|
357
351
|
style={
|
|
358
352
|
Object {
|
|
359
353
|
"height": 0,
|
|
@@ -431,7 +425,6 @@ exports[`Accordion renders correctly 1`] = `
|
|
|
431
425
|
accessible={true}
|
|
432
426
|
collapsable={false}
|
|
433
427
|
focusable={true}
|
|
434
|
-
nativeID="animatedComponent"
|
|
435
428
|
onClick={[Function]}
|
|
436
429
|
onResponderGrant={[Function]}
|
|
437
430
|
onResponderMove={[Function]}
|
|
@@ -484,7 +477,6 @@ exports[`Accordion renders correctly 1`] = `
|
|
|
484
477
|
</View>
|
|
485
478
|
<View
|
|
486
479
|
collapsable={false}
|
|
487
|
-
nativeID="animatedComponent"
|
|
488
480
|
style={
|
|
489
481
|
Object {
|
|
490
482
|
"height": 0,
|
|
@@ -574,7 +566,6 @@ exports[`Accordion renders correctly when variant is card 1`] = `
|
|
|
574
566
|
accessible={true}
|
|
575
567
|
collapsable={false}
|
|
576
568
|
focusable={true}
|
|
577
|
-
nativeID="animatedComponent"
|
|
578
569
|
onClick={[Function]}
|
|
579
570
|
onResponderGrant={[Function]}
|
|
580
571
|
onResponderMove={[Function]}
|
|
@@ -627,7 +618,6 @@ exports[`Accordion renders correctly when variant is card 1`] = `
|
|
|
627
618
|
</View>
|
|
628
619
|
<View
|
|
629
620
|
collapsable={false}
|
|
630
|
-
nativeID="animatedComponent"
|
|
631
621
|
style={
|
|
632
622
|
Object {
|
|
633
623
|
"height": 0,
|
|
@@ -716,7 +706,6 @@ exports[`Accordion renders correctly when variant is card 1`] = `
|
|
|
716
706
|
accessible={true}
|
|
717
707
|
collapsable={false}
|
|
718
708
|
focusable={true}
|
|
719
|
-
nativeID="animatedComponent"
|
|
720
709
|
onClick={[Function]}
|
|
721
710
|
onResponderGrant={[Function]}
|
|
722
711
|
onResponderMove={[Function]}
|
|
@@ -769,7 +758,6 @@ exports[`Accordion renders correctly when variant is card 1`] = `
|
|
|
769
758
|
</View>
|
|
770
759
|
<View
|
|
771
760
|
collapsable={false}
|
|
772
|
-
nativeID="animatedComponent"
|
|
773
761
|
style={
|
|
774
762
|
Object {
|
|
775
763
|
"height": 0,
|
|
@@ -4,9 +4,11 @@ import type { ComponentProps } from 'react';
|
|
|
4
4
|
import type { ViewProps } from 'react-native';
|
|
5
5
|
|
|
6
6
|
const Container = styled(View)<{
|
|
7
|
+
themeVariant: 'rounded' | 'unrounded';
|
|
7
8
|
themeIntent: 'success' | 'info' | 'warning' | 'error' | 'notification';
|
|
8
|
-
}>(({ theme, themeIntent }) => ({
|
|
9
|
-
borderRadius:
|
|
9
|
+
}>(({ theme, themeVariant = 'rounded', themeIntent }) => ({
|
|
10
|
+
borderRadius:
|
|
11
|
+
themeVariant === 'rounded' ? theme.__hd__.alert.radii.default : 0,
|
|
10
12
|
backgroundColor: theme.__hd__.alert.colors[themeIntent],
|
|
11
13
|
minHeight: theme.__hd__.alert.sizes.height,
|
|
12
14
|
flexDirection: 'row',
|
|
@@ -14,6 +14,7 @@ exports[`Alert Icon render custom icon correctly 1`] = `
|
|
|
14
14
|
]
|
|
15
15
|
}
|
|
16
16
|
themeIntent="info"
|
|
17
|
+
themeVariant="rounded"
|
|
17
18
|
>
|
|
18
19
|
<View
|
|
19
20
|
showDivider={false}
|
|
@@ -107,6 +108,7 @@ exports[`Alert renders correctly when intent is error 1`] = `
|
|
|
107
108
|
]
|
|
108
109
|
}
|
|
109
110
|
themeIntent="error"
|
|
111
|
+
themeVariant="rounded"
|
|
110
112
|
>
|
|
111
113
|
<View
|
|
112
114
|
showDivider={true}
|
|
@@ -207,7 +209,6 @@ exports[`Alert renders correctly when intent is error 1`] = `
|
|
|
207
209
|
accessible={true}
|
|
208
210
|
collapsable={false}
|
|
209
211
|
focusable={true}
|
|
210
|
-
nativeID="animatedComponent"
|
|
211
212
|
onClick={[Function]}
|
|
212
213
|
onResponderGrant={[Function]}
|
|
213
214
|
onResponderMove={[Function]}
|
|
@@ -256,6 +257,7 @@ exports[`Alert renders correctly when intent is info 1`] = `
|
|
|
256
257
|
]
|
|
257
258
|
}
|
|
258
259
|
themeIntent="info"
|
|
260
|
+
themeVariant="rounded"
|
|
259
261
|
>
|
|
260
262
|
<View
|
|
261
263
|
showDivider={true}
|
|
@@ -356,7 +358,6 @@ exports[`Alert renders correctly when intent is info 1`] = `
|
|
|
356
358
|
accessible={true}
|
|
357
359
|
collapsable={false}
|
|
358
360
|
focusable={true}
|
|
359
|
-
nativeID="animatedComponent"
|
|
360
361
|
onClick={[Function]}
|
|
361
362
|
onResponderGrant={[Function]}
|
|
362
363
|
onResponderMove={[Function]}
|
|
@@ -405,6 +406,7 @@ exports[`Alert renders correctly when intent is notification 1`] = `
|
|
|
405
406
|
]
|
|
406
407
|
}
|
|
407
408
|
themeIntent="notification"
|
|
409
|
+
themeVariant="rounded"
|
|
408
410
|
>
|
|
409
411
|
<View
|
|
410
412
|
showDivider={true}
|
|
@@ -478,7 +480,6 @@ exports[`Alert renders correctly when intent is notification 1`] = `
|
|
|
478
480
|
accessible={true}
|
|
479
481
|
collapsable={false}
|
|
480
482
|
focusable={true}
|
|
481
|
-
nativeID="animatedComponent"
|
|
482
483
|
onClick={[Function]}
|
|
483
484
|
onResponderGrant={[Function]}
|
|
484
485
|
onResponderMove={[Function]}
|
|
@@ -527,6 +528,7 @@ exports[`Alert renders correctly when intent is success 1`] = `
|
|
|
527
528
|
]
|
|
528
529
|
}
|
|
529
530
|
themeIntent="success"
|
|
531
|
+
themeVariant="rounded"
|
|
530
532
|
>
|
|
531
533
|
<View
|
|
532
534
|
showDivider={true}
|
|
@@ -627,7 +629,6 @@ exports[`Alert renders correctly when intent is success 1`] = `
|
|
|
627
629
|
accessible={true}
|
|
628
630
|
collapsable={false}
|
|
629
631
|
focusable={true}
|
|
630
|
-
nativeID="animatedComponent"
|
|
631
632
|
onClick={[Function]}
|
|
632
633
|
onResponderGrant={[Function]}
|
|
633
634
|
onResponderMove={[Function]}
|
|
@@ -676,6 +677,7 @@ exports[`Alert renders correctly when intent is warning 1`] = `
|
|
|
676
677
|
]
|
|
677
678
|
}
|
|
678
679
|
themeIntent="warning"
|
|
680
|
+
themeVariant="rounded"
|
|
679
681
|
>
|
|
680
682
|
<View
|
|
681
683
|
showDivider={true}
|
|
@@ -776,7 +778,6 @@ exports[`Alert renders correctly when intent is warning 1`] = `
|
|
|
776
778
|
accessible={true}
|
|
777
779
|
collapsable={false}
|
|
778
780
|
focusable={true}
|
|
779
|
-
nativeID="animatedComponent"
|
|
780
781
|
onClick={[Function]}
|
|
781
782
|
onResponderGrant={[Function]}
|
|
782
783
|
onResponderMove={[Function]}
|
|
@@ -810,3 +811,117 @@ exports[`Alert renders correctly when intent is warning 1`] = `
|
|
|
810
811
|
</View>
|
|
811
812
|
</View>
|
|
812
813
|
`;
|
|
814
|
+
|
|
815
|
+
exports[`Alert renders correctly without rounded 1`] = `
|
|
816
|
+
<View
|
|
817
|
+
style={
|
|
818
|
+
Array [
|
|
819
|
+
Object {
|
|
820
|
+
"backgroundColor": "#b5c3fd",
|
|
821
|
+
"borderRadius": 0,
|
|
822
|
+
"flexDirection": "row",
|
|
823
|
+
"minHeight": 48,
|
|
824
|
+
},
|
|
825
|
+
undefined,
|
|
826
|
+
]
|
|
827
|
+
}
|
|
828
|
+
themeIntent="info"
|
|
829
|
+
themeVariant="unrounded"
|
|
830
|
+
>
|
|
831
|
+
<View
|
|
832
|
+
showDivider={false}
|
|
833
|
+
style={
|
|
834
|
+
Array [
|
|
835
|
+
Object {
|
|
836
|
+
"borderColor": "#e8e9ea",
|
|
837
|
+
"borderRightWidth": 0,
|
|
838
|
+
"flex": 1,
|
|
839
|
+
"flexDirection": "row",
|
|
840
|
+
"paddingVertical": 12,
|
|
841
|
+
},
|
|
842
|
+
undefined,
|
|
843
|
+
]
|
|
844
|
+
}
|
|
845
|
+
>
|
|
846
|
+
<View
|
|
847
|
+
style={
|
|
848
|
+
Array [
|
|
849
|
+
Object {
|
|
850
|
+
"alignItems": "center",
|
|
851
|
+
"paddingLeft": 12,
|
|
852
|
+
},
|
|
853
|
+
undefined,
|
|
854
|
+
]
|
|
855
|
+
}
|
|
856
|
+
testID="alert-left-icon"
|
|
857
|
+
>
|
|
858
|
+
<HeroIcon
|
|
859
|
+
name="circle-info"
|
|
860
|
+
style={
|
|
861
|
+
Array [
|
|
862
|
+
Object {
|
|
863
|
+
"color": "#001f23",
|
|
864
|
+
"fontSize": 20,
|
|
865
|
+
},
|
|
866
|
+
undefined,
|
|
867
|
+
]
|
|
868
|
+
}
|
|
869
|
+
themeIntent="text"
|
|
870
|
+
themeSize="small"
|
|
871
|
+
/>
|
|
872
|
+
</View>
|
|
873
|
+
<View
|
|
874
|
+
style={
|
|
875
|
+
Array [
|
|
876
|
+
Object {
|
|
877
|
+
"flex": 1,
|
|
878
|
+
"paddingHorizontal": 12,
|
|
879
|
+
},
|
|
880
|
+
undefined,
|
|
881
|
+
]
|
|
882
|
+
}
|
|
883
|
+
>
|
|
884
|
+
<Text
|
|
885
|
+
style={
|
|
886
|
+
Array [
|
|
887
|
+
Object {
|
|
888
|
+
"color": "#001f23",
|
|
889
|
+
"fontFamily": "BeVietnamPro-SemiBold",
|
|
890
|
+
"fontSize": 14,
|
|
891
|
+
"letterSpacing": 0.42,
|
|
892
|
+
"lineHeight": 22,
|
|
893
|
+
},
|
|
894
|
+
undefined,
|
|
895
|
+
]
|
|
896
|
+
}
|
|
897
|
+
themeFontSize="medium"
|
|
898
|
+
themeFontWeight="semi-bold"
|
|
899
|
+
themeIntent="body"
|
|
900
|
+
themeTypeface="neutral"
|
|
901
|
+
>
|
|
902
|
+
Title
|
|
903
|
+
</Text>
|
|
904
|
+
<Text
|
|
905
|
+
style={
|
|
906
|
+
Array [
|
|
907
|
+
Object {
|
|
908
|
+
"color": "#001f23",
|
|
909
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
910
|
+
"fontSize": 14,
|
|
911
|
+
"letterSpacing": 0.42,
|
|
912
|
+
"lineHeight": 22,
|
|
913
|
+
},
|
|
914
|
+
undefined,
|
|
915
|
+
]
|
|
916
|
+
}
|
|
917
|
+
themeFontSize="medium"
|
|
918
|
+
themeFontWeight="regular"
|
|
919
|
+
themeIntent="body"
|
|
920
|
+
themeTypeface="neutral"
|
|
921
|
+
>
|
|
922
|
+
Content
|
|
923
|
+
</Text>
|
|
924
|
+
</View>
|
|
925
|
+
</View>
|
|
926
|
+
</View>
|
|
927
|
+
`;
|
|
@@ -29,6 +29,20 @@ describe('Alert', () => {
|
|
|
29
29
|
expect(getByTestId('alert-close-icon')).toBeDefined();
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
+
it('renders correctly without rounded ', () => {
|
|
33
|
+
const { toJSON, getByTestId, getByText, queryByTestId } = renderWithTheme(
|
|
34
|
+
<Alert title="Title" content="Content" variant="unrounded" />
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
expect(toJSON()).toMatchSnapshot();
|
|
38
|
+
// Has default icon
|
|
39
|
+
expect(getByTestId('alert-left-icon')).toBeDefined();
|
|
40
|
+
|
|
41
|
+
expect(getByText('Title')).toBeDefined();
|
|
42
|
+
expect(getByText('Content')).toBeDefined();
|
|
43
|
+
expect(queryByTestId('alert-close-icon')).toBeNull();
|
|
44
|
+
});
|
|
45
|
+
|
|
32
46
|
it('renders correctly when intent is notification', () => {
|
|
33
47
|
const { toJSON, getByText, queryByTestId } = renderWithTheme(
|
|
34
48
|
<Alert
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { ReactElement } from 'react';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
3
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
4
|
-
import type { IconName } from '../Icon';
|
|
5
4
|
import Icon from '../Icon';
|
|
6
5
|
import Typography from '../Typography';
|
|
7
6
|
import {
|
|
@@ -11,6 +10,7 @@ import {
|
|
|
11
10
|
IconContainer,
|
|
12
11
|
TextContainer,
|
|
13
12
|
} from './StyledAlert';
|
|
13
|
+
import type { IconName } from '../Icon';
|
|
14
14
|
|
|
15
15
|
const getIntentIcon = (
|
|
16
16
|
intent: 'success' | 'info' | 'warning' | 'error' | 'notification'
|
|
@@ -60,6 +60,10 @@ interface AlertProps {
|
|
|
60
60
|
* Closing callback. When onClose is available, an X button will be rendered on the right side of alert. The callback will be called when user clicks on X button.
|
|
61
61
|
*/
|
|
62
62
|
onClose?: () => void;
|
|
63
|
+
/**
|
|
64
|
+
* Alert variant.
|
|
65
|
+
*/
|
|
66
|
+
variant?: 'unrounded' | 'rounded';
|
|
63
67
|
/**
|
|
64
68
|
* Addtional style.
|
|
65
69
|
*/
|
|
@@ -76,11 +80,17 @@ const Alert = ({
|
|
|
76
80
|
title,
|
|
77
81
|
intent = 'info',
|
|
78
82
|
onClose,
|
|
83
|
+
variant = 'rounded',
|
|
79
84
|
style,
|
|
80
85
|
testID,
|
|
81
86
|
}: AlertProps): JSX.Element => {
|
|
82
87
|
return (
|
|
83
|
-
<Container
|
|
88
|
+
<Container
|
|
89
|
+
themeVariant={variant}
|
|
90
|
+
themeIntent={intent}
|
|
91
|
+
style={style}
|
|
92
|
+
testID={testID}
|
|
93
|
+
>
|
|
84
94
|
<ContentContainer showDivider={!!onClose}>
|
|
85
95
|
{icon !== null ? (
|
|
86
96
|
<AlertIcon icon={icon || getIntentIcon(intent)} />
|
|
@@ -87,7 +87,6 @@ exports[`Attachment renders correctly 1`] = `
|
|
|
87
87
|
accessible={true}
|
|
88
88
|
collapsable={false}
|
|
89
89
|
focusable={true}
|
|
90
|
-
nativeID="animatedComponent"
|
|
91
90
|
onClick={[Function]}
|
|
92
91
|
onResponderGrant={[Function]}
|
|
93
92
|
onResponderMove={[Function]}
|
|
@@ -123,7 +122,6 @@ exports[`Attachment renders correctly 1`] = `
|
|
|
123
122
|
accessible={true}
|
|
124
123
|
collapsable={false}
|
|
125
124
|
focusable={true}
|
|
126
|
-
nativeID="animatedComponent"
|
|
127
125
|
onClick={[Function]}
|
|
128
126
|
onResponderGrant={[Function]}
|
|
129
127
|
onResponderMove={[Function]}
|
package/src/components/Avatar/AvatarStack/__tests__/__snapshots__/StyledAvatarStack.spec.tsx.snap
CHANGED
|
@@ -2,10 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`StyledAvatar renders correctly 1`] = `
|
|
4
4
|
<View
|
|
5
|
+
accessibilityState={
|
|
6
|
+
Object {
|
|
7
|
+
"disabled": true,
|
|
8
|
+
}
|
|
9
|
+
}
|
|
5
10
|
accessible={true}
|
|
6
11
|
collapsable={false}
|
|
7
12
|
focusable={false}
|
|
8
|
-
nativeID="animatedComponent"
|
|
9
13
|
onClick={[Function]}
|
|
10
14
|
onResponderGrant={[Function]}
|
|
11
15
|
onResponderMove={[Function]}
|