@hero-design/rn 8.33.1 → 8.34.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/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/es/index.js +868 -655
- package/lib/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/lib/index.js +871 -656
- package/package.json +8 -7
- package/rollup.config.js +1 -0
- package/src/components/Accordion/AccordionItem.tsx +1 -3
- package/src/components/Accordion/__tests__/AccordionItem.spec.tsx +5 -5
- package/src/components/Accordion/__tests__/__snapshots__/AccordionItem.spec.tsx.snap +26 -34
- package/src/components/Accordion/__tests__/__snapshots__/index.spec.tsx.snap +36 -48
- package/src/components/Accordion/__tests__/index.spec.tsx +2 -2
- package/src/components/Alert/__tests__/__snapshots__/index.spec.tsx.snap +26 -39
- package/src/components/Alert/__tests__/index.spec.tsx +8 -2
- package/src/components/Alert/index.tsx +2 -2
- package/src/components/Attachment/__tests__/__snapshots__/index.spec.tsx.snap +2 -3
- package/src/components/Attachment/index.tsx +3 -1
- package/src/components/Badge/StyledBadge.tsx +1 -4
- package/src/components/Badge/__tests__/Status.spec.tsx +1 -1
- package/src/components/Badge/__tests__/__snapshots__/Badge.spec.tsx.snap +18 -48
- package/src/components/Badge/__tests__/__snapshots__/Status.spec.tsx.snap +2 -3
- package/src/components/BottomNavigation/StyledBottomNavigation.tsx +1 -1
- package/src/components/BottomNavigation/__tests__/__snapshots__/index.spec.tsx.snap +4 -12
- package/src/components/BottomNavigation/index.tsx +0 -1
- package/src/components/BottomSheet/Header.tsx +1 -3
- package/src/components/BottomSheet/__tests__/__snapshots__/index.spec.tsx.snap +2 -3
- package/src/components/Button/Button.tsx +34 -11
- package/src/components/Button/StyledButton.tsx +45 -38
- package/src/components/Button/UtilityButton/StyledUtilityButton.tsx +2 -4
- package/src/components/Button/UtilityButton/__tests__/__snapshots__/index.spec.tsx.snap +8 -14
- package/src/components/Button/__tests__/StyledButton.spec.tsx +12 -6
- package/src/components/Button/__tests__/__snapshots__/Button.spec.tsx.snap +66 -90
- package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +56 -86
- package/src/components/Calendar/CalendarRowItem.tsx +5 -2
- package/src/components/Calendar/__tests__/__snapshots__/CalendarRowItem.spec.tsx.snap +10 -15
- package/src/components/Calendar/index.tsx +1 -1
- package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +12 -18
- package/src/components/Card/__tests__/index.spec.tsx +1 -1
- package/src/components/Carousel/CardCarousel.tsx +2 -0
- package/src/components/Carousel/CarouselItem.tsx +4 -4
- package/src/components/Carousel/StyledCarousel.tsx +1 -4
- package/src/components/Carousel/__tests__/CardCarousel.spec.tsx +18 -18
- package/src/components/Carousel/__tests__/__snapshots__/CardCarousel.spec.tsx.snap +24 -20
- package/src/components/Carousel/__tests__/__snapshots__/index.spec.tsx.snap +99 -165
- package/src/components/Checkbox/StyledCheckbox.tsx +1 -1
- package/src/components/Checkbox/__tests__/__snapshots__/index.spec.tsx.snap +8 -12
- package/src/components/Checkbox/index.tsx +1 -1
- package/src/components/ContentNavigator/StyledContentNavigator.tsx +1 -6
- package/src/components/ContentNavigator/__tests__/StyledContentNavigator.spec.tsx +1 -9
- package/src/components/ContentNavigator/__tests__/__snapshots__/StyledContentNavigator.spec.tsx.snap +0 -29
- package/src/components/ContentNavigator/__tests__/__snapshots__/index.spec.tsx.snap +124 -17
- package/src/components/ContentNavigator/__tests__/index.spec.tsx +16 -0
- package/src/components/ContentNavigator/index.tsx +30 -9
- package/src/components/DatePicker/__tests__/__snapshots__/DatePicker.spec.tsx.snap +12 -18
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +4 -6
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerCalendar.spec.tsx.snap +4 -6
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +13 -18
- package/src/components/Empty/StyledEmpty.tsx +2 -6
- package/src/components/Empty/__tests__/__snapshots__/index.spec.tsx.snap +22 -36
- package/src/components/Empty/index.tsx +4 -2
- package/src/components/Error/StyledError.tsx +2 -8
- package/src/components/Error/__tests__/__snapshots__/index.spec.tsx.snap +44 -76
- package/src/components/Error/index.tsx +6 -2
- package/src/components/FAB/ActionGroup/StyledActionGroup.tsx +1 -4
- package/src/components/FAB/ActionGroup/StyledActionItem.tsx +1 -5
- package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +54 -116
- package/src/components/FAB/ActionGroup/index.tsx +1 -1
- package/src/components/FAB/StyledFAB.tsx +1 -4
- package/src/components/FAB/__tests__/StyledFAB.spec.tsx +1 -1
- package/src/components/FAB/__tests__/__snapshots__/StyledFAB.spec.tsx.snap +2 -3
- package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +4 -8
- package/src/components/Icon/HeroIcon/glyphMap.json +1 -1
- package/src/components/Icon/IconList.ts +2 -0
- package/src/components/List/BasicListItem.tsx +2 -6
- package/src/components/List/ListItem.tsx +3 -5
- package/src/components/List/__tests__/ListItem.spec.tsx +4 -4
- package/src/components/List/__tests__/StyledBasicListItem.spec.tsx +3 -1
- package/src/components/List/__tests__/StyledListItem.spec.tsx +3 -1
- package/src/components/List/__tests__/__snapshots__/BasicListItem.spec.tsx.snap +4 -10
- package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +23 -37
- package/src/components/List/__tests__/__snapshots__/StyledBasicListItem.spec.tsx.snap +8 -12
- package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +8 -12
- package/src/components/Modal/ModalContentWrapper.tsx +112 -0
- package/src/components/Modal/ModalPresenter/ModalPresenter.tsx +135 -0
- package/src/components/Modal/ModalPresenter/index.tsx +9 -0
- package/src/components/Modal/ModalProvider.tsx +8 -0
- package/src/components/Modal/__tests__/ModalContentWrapper.spec.tsx +25 -0
- package/src/components/Modal/__tests__/ModalPresenter.spec.tsx +57 -0
- package/src/components/Modal/__tests__/__snapshots__/ModalContentWrapper.spec.tsx.snap +35 -0
- package/src/components/Modal/__tests__/__snapshots__/ModalPresenter.spec.tsx.snap +55 -0
- package/src/components/Modal/__tests__/index.spec.tsx +50 -0
- package/src/components/Modal/index.tsx +121 -0
- package/src/components/PageControl/index.tsx +0 -1
- package/src/components/PinInput/PinCell.tsx +3 -1
- package/src/components/PinInput/StyledPinInput.tsx +2 -7
- package/src/components/PinInput/__tests__/__snapshots__/PinCell.spec.tsx.snap +25 -45
- package/src/components/PinInput/__tests__/__snapshots__/index.spec.tsx.snap +18 -34
- package/src/components/PinInput/index.tsx +2 -0
- package/src/components/Progress/ProgressCircle.tsx +1 -3
- package/src/components/Progress/__tests__/__snapshots__/index.spec.js.snap +3 -6
- package/src/components/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +2 -4
- package/src/components/Radio/__tests__/__snapshots__/RadioGroup.spec.tsx.snap +3 -6
- package/src/components/RichTextEditor/RichTextEditor.tsx +7 -11
- package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +16 -24
- package/src/components/SectionHeading/__tests__/__snapshots__/index.spec.tsx.snap +2 -3
- package/src/components/SectionHeading/__tests__/index.spec.tsx +3 -1
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/Option.spec.tsx.snap +1 -2
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +12 -24
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +86 -130
- package/src/components/Select/MultiSelect/__tests__/index.spec.tsx +6 -10
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/Option.spec.tsx.snap +1 -2
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +12 -24
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +49 -79
- package/src/components/Select/SingleSelect/__tests__/index.spec.tsx +5 -9
- package/src/components/Success/StyledSuccess.tsx +2 -6
- package/src/components/Success/__tests__/__snapshots__/index.spec.tsx.snap +40 -64
- package/src/components/Success/index.tsx +3 -1
- package/src/components/Swipeable/__tests__/SwipeableAction.spec.tsx +2 -2
- package/src/components/Swipeable/__tests__/__snapshots__/SwipeableAction.spec.tsx.snap +6 -9
- package/src/components/Swipeable/__tests__/__snapshots__/index.spec.tsx.snap +2 -3
- package/src/components/Swipeable/__tests__/index.spec.tsx +6 -4
- package/src/components/Switch/SelectorSwitch/Option.tsx +1 -1
- package/src/components/Switch/SelectorSwitch/__tests__/__snapshots__/Option.spec.tsx.snap +1 -2
- package/src/components/Switch/SelectorSwitch/__tests__/__snapshots__/index.spec.tsx.snap +1 -2
- package/src/components/Tabs/ScrollableTabsHeader.tsx +3 -3
- package/src/components/Tabs/__tests__/SceneView.spec.tsx +4 -4
- package/src/components/Tabs/__tests__/__snapshots__/SceneView.spec.tsx.snap +6 -9
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +33 -60
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabsHeader.spec.tsx.snap +7 -13
- package/src/components/Tabs/__tests__/__snapshots__/TabWithBadge.spec.tsx.snap +3 -8
- package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +45 -81
- package/src/components/Tabs/index.tsx +3 -3
- package/src/components/Tag/StyledTag.tsx +1 -4
- package/src/components/Tag/__tests__/Tag.spec.tsx +5 -1
- package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +47 -93
- package/src/components/Tag/index.tsx +5 -1
- package/src/components/TextInput/StyledTextInput.tsx +8 -16
- package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +72 -134
- package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +145 -257
- package/src/components/TextInput/index.tsx +2 -3
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +12 -23
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +21 -35
- package/src/components/Toast/Toast.tsx +6 -5
- package/src/components/Toast/ToastContainer.tsx +2 -0
- package/src/components/Toast/__tests__/Toast.spec.tsx +5 -1
- package/src/components/Toast/__tests__/__snapshots__/Toast.spec.tsx.snap +26 -39
- package/src/components/Toolbar/StyledToolbar.tsx +1 -1
- package/src/components/Toolbar/ToolbarItem.tsx +4 -6
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarGroup.spec.tsx.snap +12 -18
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.spec.tsx.snap +14 -21
- package/src/index.ts +2 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +4 -0
- package/src/theme/components/badge.ts +15 -0
- package/src/theme/components/button.ts +16 -0
- package/src/theme/components/carousel.ts +15 -0
- package/src/theme/components/empty.ts +12 -0
- package/src/theme/components/error.ts +16 -0
- package/src/theme/components/fab.ts +11 -0
- package/src/theme/components/pinInput.ts +15 -0
- package/src/theme/components/success.ts +12 -0
- package/src/theme/components/tag.ts +16 -0
- package/src/theme/components/textInput.ts +1 -0
- package/src/theme/getTheme.ts +18 -18
- package/testUtils/setup.tsx +24 -0
- package/types/components/Badge/StyledBadge.d.ts +1 -1
- package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +1 -1
- package/types/components/Button/StyledButton.d.ts +12 -5
- package/types/components/Button/UtilityButton/StyledUtilityButton.d.ts +1 -1
- package/types/components/Carousel/StyledCarousel.d.ts +1 -1
- package/types/components/Checkbox/StyledCheckbox.d.ts +1 -1
- package/types/components/ContentNavigator/StyledContentNavigator.d.ts +1 -5
- package/types/components/Empty/StyledEmpty.d.ts +2 -2
- package/types/components/Error/StyledError.d.ts +2 -2
- package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +2 -2
- package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +1 -1
- package/types/components/FAB/StyledFAB.d.ts +1 -1
- package/types/components/Icon/IconList.d.ts +1 -1
- package/types/components/Icon/index.d.ts +1 -1
- package/types/components/Icon/utils.d.ts +1 -1
- package/types/components/Modal/ModalContentWrapper.d.ts +16 -0
- package/types/components/Modal/ModalPresenter/ModalPresenter.d.ts +34 -0
- package/types/components/Modal/ModalPresenter/index.d.ts +3 -0
- package/types/components/Modal/ModalProvider.d.ts +5 -0
- package/types/components/Modal/index.d.ts +33 -0
- package/types/components/PinInput/StyledPinInput.d.ts +2 -2
- package/types/components/RichTextEditor/RichTextEditor.d.ts +2 -2
- package/types/components/Success/StyledSuccess.d.ts +2 -2
- package/types/components/Tag/StyledTag.d.ts +1 -1
- package/types/components/TextInput/StyledTextInput.d.ts +7 -10
- package/types/components/Toolbar/StyledToolbar.d.ts +1 -1
- package/types/index.d.ts +2 -1
- package/types/theme/components/badge.d.ts +15 -0
- package/types/theme/components/button.d.ts +14 -0
- package/types/theme/components/carousel.d.ts +15 -0
- package/types/theme/components/empty.d.ts +11 -0
- package/types/theme/components/error.d.ts +15 -0
- package/types/theme/components/fab.d.ts +11 -0
- package/types/theme/components/pinInput.d.ts +15 -0
- package/types/theme/components/success.d.ts +11 -0
- package/types/theme/components/tag.d.ts +15 -0
- package/types/theme/components/textInput.d.ts +1 -0
- package/types/theme/getTheme.d.ts +18 -18
|
@@ -161,7 +161,7 @@ exports[`Checkbox renders correctly when disabled is false, withBorder is false
|
|
|
161
161
|
"color": "#001f23",
|
|
162
162
|
"fontFamily": "BeVietnamPro-Regular",
|
|
163
163
|
"fontSize": 14,
|
|
164
|
-
"letterSpacing": 0.
|
|
164
|
+
"letterSpacing": 0.48,
|
|
165
165
|
"lineHeight": 22,
|
|
166
166
|
},
|
|
167
167
|
Array [
|
|
@@ -173,10 +173,9 @@ exports[`Checkbox renders correctly when disabled is false, withBorder is false
|
|
|
173
173
|
],
|
|
174
174
|
]
|
|
175
175
|
}
|
|
176
|
-
themeFontSize="medium"
|
|
177
|
-
themeFontWeight="regular"
|
|
178
176
|
themeIntent="body"
|
|
179
177
|
themeTypeface="neutral"
|
|
178
|
+
themeVariant="small"
|
|
180
179
|
>
|
|
181
180
|
Please agree to our privacy policy
|
|
182
181
|
</Text>
|
|
@@ -246,7 +245,7 @@ exports[`Checkbox renders correctly when disabled is false, withBorder is true 1
|
|
|
246
245
|
"color": "#001f23",
|
|
247
246
|
"fontFamily": "BeVietnamPro-Regular",
|
|
248
247
|
"fontSize": 14,
|
|
249
|
-
"letterSpacing": 0.
|
|
248
|
+
"letterSpacing": 0.48,
|
|
250
249
|
"lineHeight": 22,
|
|
251
250
|
},
|
|
252
251
|
Array [
|
|
@@ -258,10 +257,9 @@ exports[`Checkbox renders correctly when disabled is false, withBorder is true 1
|
|
|
258
257
|
],
|
|
259
258
|
]
|
|
260
259
|
}
|
|
261
|
-
themeFontSize="medium"
|
|
262
|
-
themeFontWeight="regular"
|
|
263
260
|
themeIntent="body"
|
|
264
261
|
themeTypeface="neutral"
|
|
262
|
+
themeVariant="small"
|
|
265
263
|
>
|
|
266
264
|
Please agree to our privacy policy
|
|
267
265
|
</Text>
|
|
@@ -327,7 +325,7 @@ exports[`Checkbox renders correctly when disabled is true, withBorder is false 1
|
|
|
327
325
|
"color": "#4d6265",
|
|
328
326
|
"fontFamily": "BeVietnamPro-Regular",
|
|
329
327
|
"fontSize": 14,
|
|
330
|
-
"letterSpacing": 0.
|
|
328
|
+
"letterSpacing": 0.48,
|
|
331
329
|
"lineHeight": 22,
|
|
332
330
|
},
|
|
333
331
|
Array [
|
|
@@ -339,10 +337,9 @@ exports[`Checkbox renders correctly when disabled is true, withBorder is false 1
|
|
|
339
337
|
],
|
|
340
338
|
]
|
|
341
339
|
}
|
|
342
|
-
themeFontSize="medium"
|
|
343
|
-
themeFontWeight="regular"
|
|
344
340
|
themeIntent="subdued"
|
|
345
341
|
themeTypeface="neutral"
|
|
342
|
+
themeVariant="small"
|
|
346
343
|
>
|
|
347
344
|
Please agree to our privacy policy
|
|
348
345
|
</Text>
|
|
@@ -412,7 +409,7 @@ exports[`Checkbox renders correctly when disabled is true, withBorder is true 1`
|
|
|
412
409
|
"color": "#4d6265",
|
|
413
410
|
"fontFamily": "BeVietnamPro-Regular",
|
|
414
411
|
"fontSize": 14,
|
|
415
|
-
"letterSpacing": 0.
|
|
412
|
+
"letterSpacing": 0.48,
|
|
416
413
|
"lineHeight": 22,
|
|
417
414
|
},
|
|
418
415
|
Array [
|
|
@@ -424,10 +421,9 @@ exports[`Checkbox renders correctly when disabled is true, withBorder is true 1`
|
|
|
424
421
|
],
|
|
425
422
|
]
|
|
426
423
|
}
|
|
427
|
-
themeFontSize="medium"
|
|
428
|
-
themeFontWeight="regular"
|
|
429
424
|
themeIntent="subdued"
|
|
430
425
|
themeTypeface="neutral"
|
|
426
|
+
themeVariant="small"
|
|
431
427
|
>
|
|
432
428
|
Please agree to our privacy policy
|
|
433
429
|
</Text>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { View } from 'react-native';
|
|
2
2
|
import styled from '@emotion/native';
|
|
3
|
-
import Typography from '../Typography';
|
|
4
3
|
|
|
5
4
|
const Wrapper = styled(View)(() => ({
|
|
6
5
|
flex: 1,
|
|
@@ -8,8 +7,4 @@ const Wrapper = styled(View)(() => ({
|
|
|
8
7
|
justifyContent: 'space-between',
|
|
9
8
|
}));
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
paddingHorizontal: theme.__hd__.contentNavigator.space.valueHorizontalPadding,
|
|
13
|
-
}));
|
|
14
|
-
|
|
15
|
-
export { Wrapper, Value };
|
|
10
|
+
export { Wrapper };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
3
|
-
import {
|
|
3
|
+
import { Wrapper } from '../StyledContentNavigator';
|
|
4
4
|
|
|
5
5
|
describe('Wrapper', () => {
|
|
6
6
|
it('has correct style', () => {
|
|
@@ -9,11 +9,3 @@ describe('Wrapper', () => {
|
|
|
9
9
|
expect(toJSON()).toMatchSnapshot();
|
|
10
10
|
});
|
|
11
11
|
});
|
|
12
|
-
|
|
13
|
-
describe('Value', () => {
|
|
14
|
-
it('has correct style', () => {
|
|
15
|
-
const { toJSON } = renderWithTheme(<Value>Text</Value>);
|
|
16
|
-
|
|
17
|
-
expect(toJSON()).toMatchSnapshot();
|
|
18
|
-
});
|
|
19
|
-
});
|
package/src/components/ContentNavigator/__tests__/__snapshots__/StyledContentNavigator.spec.tsx.snap
CHANGED
|
@@ -1,34 +1,5 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`Value has correct style 1`] = `
|
|
4
|
-
<Text
|
|
5
|
-
allowFontScaling={false}
|
|
6
|
-
style={
|
|
7
|
-
Array [
|
|
8
|
-
Object {
|
|
9
|
-
"color": "#001f23",
|
|
10
|
-
"fontFamily": "BeVietnamPro-Regular",
|
|
11
|
-
"fontSize": 14,
|
|
12
|
-
"letterSpacing": 0.42,
|
|
13
|
-
"lineHeight": 22,
|
|
14
|
-
},
|
|
15
|
-
Array [
|
|
16
|
-
Object {
|
|
17
|
-
"paddingHorizontal": 8,
|
|
18
|
-
},
|
|
19
|
-
undefined,
|
|
20
|
-
],
|
|
21
|
-
]
|
|
22
|
-
}
|
|
23
|
-
themeFontSize="medium"
|
|
24
|
-
themeFontWeight="regular"
|
|
25
|
-
themeIntent="body"
|
|
26
|
-
themeTypeface="neutral"
|
|
27
|
-
>
|
|
28
|
-
Text
|
|
29
|
-
</Text>
|
|
30
|
-
`;
|
|
31
|
-
|
|
32
3
|
exports[`Wrapper has correct style 1`] = `
|
|
33
4
|
<View
|
|
34
5
|
style={
|
|
@@ -59,22 +59,18 @@ exports[`rendering renders correctly 1`] = `
|
|
|
59
59
|
"color": "#001f23",
|
|
60
60
|
"fontFamily": "BeVietnamPro-SemiBold",
|
|
61
61
|
"fontSize": 14,
|
|
62
|
-
"letterSpacing": 0.
|
|
62
|
+
"letterSpacing": 0.24,
|
|
63
63
|
"lineHeight": 22,
|
|
64
64
|
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
},
|
|
69
|
-
undefined,
|
|
70
|
-
],
|
|
65
|
+
Object {
|
|
66
|
+
"paddingHorizontal": 8,
|
|
67
|
+
},
|
|
71
68
|
]
|
|
72
69
|
}
|
|
73
70
|
testID="content-navigator-value"
|
|
74
|
-
themeFontSize="medium"
|
|
75
|
-
themeFontWeight="semi-bold"
|
|
76
71
|
themeIntent="body"
|
|
77
72
|
themeTypeface="neutral"
|
|
73
|
+
themeVariant="small-bold"
|
|
78
74
|
>
|
|
79
75
|
20
|
|
80
76
|
</Text>
|
|
@@ -178,21 +174,132 @@ exports[`rendering renders correctly when icon buttons are disabled 1`] = `
|
|
|
178
174
|
"color": "#001f23",
|
|
179
175
|
"fontFamily": "BeVietnamPro-SemiBold",
|
|
180
176
|
"fontSize": 14,
|
|
181
|
-
"letterSpacing": 0.
|
|
177
|
+
"letterSpacing": 0.24,
|
|
182
178
|
"lineHeight": 22,
|
|
183
179
|
},
|
|
180
|
+
Object {
|
|
181
|
+
"paddingHorizontal": 8,
|
|
182
|
+
},
|
|
183
|
+
]
|
|
184
|
+
}
|
|
185
|
+
testID="content-navigator-value"
|
|
186
|
+
themeIntent="body"
|
|
187
|
+
themeTypeface="neutral"
|
|
188
|
+
themeVariant="small-bold"
|
|
189
|
+
>
|
|
190
|
+
20
|
|
191
|
+
</Text>
|
|
192
|
+
<View
|
|
193
|
+
accessibilityState={
|
|
194
|
+
Object {
|
|
195
|
+
"disabled": true,
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
accessible={true}
|
|
199
|
+
collapsable={false}
|
|
200
|
+
focusable={true}
|
|
201
|
+
onClick={[Function]}
|
|
202
|
+
onResponderGrant={[Function]}
|
|
203
|
+
onResponderMove={[Function]}
|
|
204
|
+
onResponderRelease={[Function]}
|
|
205
|
+
onResponderTerminate={[Function]}
|
|
206
|
+
onResponderTerminationRequest={[Function]}
|
|
207
|
+
onStartShouldSetResponder={[Function]}
|
|
208
|
+
style={
|
|
209
|
+
Object {
|
|
210
|
+
"opacity": 1,
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
testID="next-icon-button"
|
|
214
|
+
>
|
|
215
|
+
<HeroIcon
|
|
216
|
+
name="arrow-right"
|
|
217
|
+
style={
|
|
184
218
|
Array [
|
|
185
219
|
Object {
|
|
186
|
-
"
|
|
220
|
+
"color": "#bfc1c5",
|
|
221
|
+
"fontSize": 24,
|
|
187
222
|
},
|
|
188
223
|
undefined,
|
|
189
|
-
]
|
|
224
|
+
]
|
|
225
|
+
}
|
|
226
|
+
themeIntent="disabled-text"
|
|
227
|
+
themeSize="medium"
|
|
228
|
+
/>
|
|
229
|
+
</View>
|
|
230
|
+
</View>
|
|
231
|
+
`;
|
|
232
|
+
|
|
233
|
+
exports[`rendering renders correctly with large 1`] = `
|
|
234
|
+
<View
|
|
235
|
+
style={
|
|
236
|
+
Array [
|
|
237
|
+
Object {
|
|
238
|
+
"flex": 1,
|
|
239
|
+
"flexDirection": "row",
|
|
240
|
+
"justifyContent": "space-between",
|
|
241
|
+
},
|
|
242
|
+
undefined,
|
|
243
|
+
]
|
|
244
|
+
}
|
|
245
|
+
>
|
|
246
|
+
<View
|
|
247
|
+
accessibilityState={
|
|
248
|
+
Object {
|
|
249
|
+
"disabled": false,
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
accessible={true}
|
|
253
|
+
collapsable={false}
|
|
254
|
+
focusable={true}
|
|
255
|
+
onClick={[Function]}
|
|
256
|
+
onResponderGrant={[Function]}
|
|
257
|
+
onResponderMove={[Function]}
|
|
258
|
+
onResponderRelease={[Function]}
|
|
259
|
+
onResponderTerminate={[Function]}
|
|
260
|
+
onResponderTerminationRequest={[Function]}
|
|
261
|
+
onStartShouldSetResponder={[Function]}
|
|
262
|
+
style={
|
|
263
|
+
Object {
|
|
264
|
+
"opacity": 1,
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
testID="previous-icon-button"
|
|
268
|
+
>
|
|
269
|
+
<HeroIcon
|
|
270
|
+
name="arrow-left"
|
|
271
|
+
style={
|
|
272
|
+
Array [
|
|
273
|
+
Object {
|
|
274
|
+
"color": "#001f23",
|
|
275
|
+
"fontSize": 24,
|
|
276
|
+
},
|
|
277
|
+
undefined,
|
|
278
|
+
]
|
|
279
|
+
}
|
|
280
|
+
themeIntent="text"
|
|
281
|
+
themeSize="medium"
|
|
282
|
+
/>
|
|
283
|
+
</View>
|
|
284
|
+
<Text
|
|
285
|
+
allowFontScaling={false}
|
|
286
|
+
style={
|
|
287
|
+
Array [
|
|
288
|
+
Object {
|
|
289
|
+
"color": "#001f23",
|
|
290
|
+
"fontFamily": "BeVietnamPro-SemiBold",
|
|
291
|
+
"fontSize": 18,
|
|
292
|
+
"letterSpacing": 0.24,
|
|
293
|
+
"lineHeight": 28,
|
|
294
|
+
},
|
|
295
|
+
Object {
|
|
296
|
+
"paddingHorizontal": 8,
|
|
297
|
+
},
|
|
190
298
|
]
|
|
191
299
|
}
|
|
192
300
|
testID="content-navigator-value"
|
|
193
|
-
themeFontSize="medium"
|
|
194
|
-
themeFontWeight="semi-bold"
|
|
195
301
|
themeIntent="body"
|
|
302
|
+
themeLevel="h5"
|
|
196
303
|
themeTypeface="neutral"
|
|
197
304
|
>
|
|
198
305
|
20
|
|
@@ -200,7 +307,7 @@ exports[`rendering renders correctly when icon buttons are disabled 1`] = `
|
|
|
200
307
|
<View
|
|
201
308
|
accessibilityState={
|
|
202
309
|
Object {
|
|
203
|
-
"disabled":
|
|
310
|
+
"disabled": false,
|
|
204
311
|
}
|
|
205
312
|
}
|
|
206
313
|
accessible={true}
|
|
@@ -225,13 +332,13 @@ exports[`rendering renders correctly when icon buttons are disabled 1`] = `
|
|
|
225
332
|
style={
|
|
226
333
|
Array [
|
|
227
334
|
Object {
|
|
228
|
-
"color": "#
|
|
335
|
+
"color": "#001f23",
|
|
229
336
|
"fontSize": 24,
|
|
230
337
|
},
|
|
231
338
|
undefined,
|
|
232
339
|
]
|
|
233
340
|
}
|
|
234
|
-
themeIntent="
|
|
341
|
+
themeIntent="text"
|
|
235
342
|
themeSize="medium"
|
|
236
343
|
/>
|
|
237
344
|
</View>
|
|
@@ -33,6 +33,22 @@ describe('rendering', () => {
|
|
|
33
33
|
expect(getByText('20')).toBeDefined();
|
|
34
34
|
expect(toJSON()).toMatchSnapshot();
|
|
35
35
|
});
|
|
36
|
+
|
|
37
|
+
it('renders correctly with large', () => {
|
|
38
|
+
const { toJSON, getByText, queryAllByTestId } = renderWithTheme(
|
|
39
|
+
<ContentNavigator
|
|
40
|
+
value={20}
|
|
41
|
+
onPreviousPress={jest.fn()}
|
|
42
|
+
onNextPress={jest.fn()}
|
|
43
|
+
fontSize="large"
|
|
44
|
+
/>
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
expect(getByText('20')).toBeDefined();
|
|
48
|
+
expect(toJSON()).toMatchSnapshot();
|
|
49
|
+
expect(queryAllByTestId('previous-icon-button')).toHaveLength(1);
|
|
50
|
+
expect(queryAllByTestId('next-icon-button')).toHaveLength(1);
|
|
51
|
+
});
|
|
36
52
|
});
|
|
37
53
|
|
|
38
54
|
describe('behavior', () => {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ReactElement } from 'react';
|
|
3
3
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
4
|
-
import {
|
|
4
|
+
import { Wrapper } from './StyledContentNavigator';
|
|
5
5
|
import Button from '../Button';
|
|
6
|
+
import Typography from '../Typography';
|
|
7
|
+
import { useTheme } from '../../theme';
|
|
6
8
|
|
|
7
9
|
interface ContentNavigatorProps {
|
|
8
10
|
/**
|
|
@@ -54,6 +56,7 @@ function ContentNavigator({
|
|
|
54
56
|
testID,
|
|
55
57
|
style,
|
|
56
58
|
}: ContentNavigatorProps) {
|
|
59
|
+
const theme = useTheme();
|
|
57
60
|
return (
|
|
58
61
|
<Wrapper testID={testID} style={style}>
|
|
59
62
|
<Button.Icon
|
|
@@ -62,14 +65,32 @@ function ContentNavigator({
|
|
|
62
65
|
disabled={previousDisabled}
|
|
63
66
|
testID="previous-icon-button"
|
|
64
67
|
/>
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
{fontSize === 'medium' ? (
|
|
69
|
+
<Typography.Body
|
|
70
|
+
style={{
|
|
71
|
+
paddingHorizontal:
|
|
72
|
+
theme.__hd__.contentNavigator.space.valueHorizontalPadding,
|
|
73
|
+
}}
|
|
74
|
+
variant="small-bold"
|
|
75
|
+
onPress={onPress}
|
|
76
|
+
testID="content-navigator-value"
|
|
77
|
+
>
|
|
78
|
+
{value}
|
|
79
|
+
</Typography.Body>
|
|
80
|
+
) : (
|
|
81
|
+
<Typography.Title
|
|
82
|
+
style={{
|
|
83
|
+
paddingHorizontal:
|
|
84
|
+
theme.__hd__.contentNavigator.space.valueHorizontalPadding,
|
|
85
|
+
}}
|
|
86
|
+
level="h5"
|
|
87
|
+
onPress={onPress}
|
|
88
|
+
testID="content-navigator-value"
|
|
89
|
+
>
|
|
90
|
+
{value}
|
|
91
|
+
</Typography.Title>
|
|
92
|
+
)}
|
|
93
|
+
|
|
73
94
|
<Button.Icon
|
|
74
95
|
icon="arrow-right"
|
|
75
96
|
onPress={onNextPress}
|
|
@@ -105,14 +105,13 @@ exports[`DatePicker renders DatePickerAndroid when OS is android 1`] = `
|
|
|
105
105
|
Object {
|
|
106
106
|
"color": "#001f23",
|
|
107
107
|
"fontFamily": "BeVietnamPro-Regular",
|
|
108
|
-
"fontSize":
|
|
109
|
-
"letterSpacing": 0.
|
|
110
|
-
"lineHeight":
|
|
108
|
+
"fontSize": 12,
|
|
109
|
+
"letterSpacing": 0.48,
|
|
110
|
+
"lineHeight": 16,
|
|
111
111
|
},
|
|
112
112
|
Array [
|
|
113
113
|
Object {
|
|
114
114
|
"color": "#001f23",
|
|
115
|
-
"fontSize": 12,
|
|
116
115
|
"lineHeight": 12,
|
|
117
116
|
},
|
|
118
117
|
Object {
|
|
@@ -122,11 +121,9 @@ exports[`DatePicker renders DatePickerAndroid when OS is android 1`] = `
|
|
|
122
121
|
]
|
|
123
122
|
}
|
|
124
123
|
testID="input-label"
|
|
125
|
-
themeFontSize="medium"
|
|
126
124
|
themeFontWeight="regular"
|
|
127
125
|
themeIntent="body"
|
|
128
126
|
themeState="filled"
|
|
129
|
-
themeTypeface="neutral"
|
|
130
127
|
>
|
|
131
128
|
Start date
|
|
132
129
|
</Text>
|
|
@@ -203,6 +200,7 @@ exports[`DatePicker renders DatePickerAndroid when OS is android 1`] = `
|
|
|
203
200
|
Object {
|
|
204
201
|
"minHeight": 16,
|
|
205
202
|
"paddingLeft": 16,
|
|
203
|
+
"paddingTop": 2,
|
|
206
204
|
},
|
|
207
205
|
undefined,
|
|
208
206
|
]
|
|
@@ -330,14 +328,13 @@ exports[`DatePicker renders DatePickerIOS when OS is iOS 1`] = `
|
|
|
330
328
|
Object {
|
|
331
329
|
"color": "#001f23",
|
|
332
330
|
"fontFamily": "BeVietnamPro-Regular",
|
|
333
|
-
"fontSize":
|
|
334
|
-
"letterSpacing": 0.
|
|
335
|
-
"lineHeight":
|
|
331
|
+
"fontSize": 12,
|
|
332
|
+
"letterSpacing": 0.48,
|
|
333
|
+
"lineHeight": 16,
|
|
336
334
|
},
|
|
337
335
|
Array [
|
|
338
336
|
Object {
|
|
339
337
|
"color": "#001f23",
|
|
340
|
-
"fontSize": 12,
|
|
341
338
|
"lineHeight": 12,
|
|
342
339
|
},
|
|
343
340
|
Object {
|
|
@@ -347,11 +344,9 @@ exports[`DatePicker renders DatePickerIOS when OS is iOS 1`] = `
|
|
|
347
344
|
]
|
|
348
345
|
}
|
|
349
346
|
testID="input-label"
|
|
350
|
-
themeFontSize="medium"
|
|
351
347
|
themeFontWeight="regular"
|
|
352
348
|
themeIntent="body"
|
|
353
349
|
themeState="filled"
|
|
354
|
-
themeTypeface="neutral"
|
|
355
350
|
>
|
|
356
351
|
Start date
|
|
357
352
|
</Text>
|
|
@@ -428,6 +423,7 @@ exports[`DatePicker renders DatePickerIOS when OS is iOS 1`] = `
|
|
|
428
423
|
Object {
|
|
429
424
|
"minHeight": 16,
|
|
430
425
|
"paddingLeft": 16,
|
|
426
|
+
"paddingTop": 2,
|
|
431
427
|
},
|
|
432
428
|
undefined,
|
|
433
429
|
]
|
|
@@ -561,14 +557,13 @@ exports[`DatePicker renders variant Calendar 1`] = `
|
|
|
561
557
|
Object {
|
|
562
558
|
"color": "#001f23",
|
|
563
559
|
"fontFamily": "BeVietnamPro-Regular",
|
|
564
|
-
"fontSize":
|
|
565
|
-
"letterSpacing": 0.
|
|
566
|
-
"lineHeight":
|
|
560
|
+
"fontSize": 12,
|
|
561
|
+
"letterSpacing": 0.48,
|
|
562
|
+
"lineHeight": 16,
|
|
567
563
|
},
|
|
568
564
|
Array [
|
|
569
565
|
Object {
|
|
570
566
|
"color": "#001f23",
|
|
571
|
-
"fontSize": 12,
|
|
572
567
|
"lineHeight": 12,
|
|
573
568
|
},
|
|
574
569
|
Object {
|
|
@@ -578,11 +573,9 @@ exports[`DatePicker renders variant Calendar 1`] = `
|
|
|
578
573
|
]
|
|
579
574
|
}
|
|
580
575
|
testID="input-label"
|
|
581
|
-
themeFontSize="medium"
|
|
582
576
|
themeFontWeight="regular"
|
|
583
577
|
themeIntent="body"
|
|
584
578
|
themeState="filled"
|
|
585
|
-
themeTypeface="neutral"
|
|
586
579
|
>
|
|
587
580
|
Start date
|
|
588
581
|
</Text>
|
|
@@ -659,6 +652,7 @@ exports[`DatePicker renders variant Calendar 1`] = `
|
|
|
659
652
|
Object {
|
|
660
653
|
"minHeight": 16,
|
|
661
654
|
"paddingLeft": 16,
|
|
655
|
+
"paddingTop": 2,
|
|
662
656
|
},
|
|
663
657
|
undefined,
|
|
664
658
|
]
|
|
@@ -105,14 +105,13 @@ exports[`DatePickerAndroid renders correctly 1`] = `
|
|
|
105
105
|
Object {
|
|
106
106
|
"color": "#001f23",
|
|
107
107
|
"fontFamily": "BeVietnamPro-Regular",
|
|
108
|
-
"fontSize":
|
|
109
|
-
"letterSpacing": 0.
|
|
110
|
-
"lineHeight":
|
|
108
|
+
"fontSize": 12,
|
|
109
|
+
"letterSpacing": 0.48,
|
|
110
|
+
"lineHeight": 16,
|
|
111
111
|
},
|
|
112
112
|
Array [
|
|
113
113
|
Object {
|
|
114
114
|
"color": "#001f23",
|
|
115
|
-
"fontSize": 12,
|
|
116
115
|
"lineHeight": 12,
|
|
117
116
|
},
|
|
118
117
|
Object {
|
|
@@ -122,11 +121,9 @@ exports[`DatePickerAndroid renders correctly 1`] = `
|
|
|
122
121
|
]
|
|
123
122
|
}
|
|
124
123
|
testID="input-label"
|
|
125
|
-
themeFontSize="medium"
|
|
126
124
|
themeFontWeight="regular"
|
|
127
125
|
themeIntent="body"
|
|
128
126
|
themeState="filled"
|
|
129
|
-
themeTypeface="neutral"
|
|
130
127
|
>
|
|
131
128
|
Start date
|
|
132
129
|
</Text>
|
|
@@ -203,6 +200,7 @@ exports[`DatePickerAndroid renders correctly 1`] = `
|
|
|
203
200
|
Object {
|
|
204
201
|
"minHeight": 16,
|
|
205
202
|
"paddingLeft": 16,
|
|
203
|
+
"paddingTop": 2,
|
|
206
204
|
},
|
|
207
205
|
undefined,
|
|
208
206
|
]
|
|
@@ -105,14 +105,13 @@ exports[`DatePickerCalendar renders correctly 1`] = `
|
|
|
105
105
|
Object {
|
|
106
106
|
"color": "#001f23",
|
|
107
107
|
"fontFamily": "BeVietnamPro-Regular",
|
|
108
|
-
"fontSize":
|
|
109
|
-
"letterSpacing": 0.
|
|
110
|
-
"lineHeight":
|
|
108
|
+
"fontSize": 12,
|
|
109
|
+
"letterSpacing": 0.48,
|
|
110
|
+
"lineHeight": 16,
|
|
111
111
|
},
|
|
112
112
|
Array [
|
|
113
113
|
Object {
|
|
114
114
|
"color": "#001f23",
|
|
115
|
-
"fontSize": 12,
|
|
116
115
|
"lineHeight": 12,
|
|
117
116
|
},
|
|
118
117
|
Object {
|
|
@@ -122,11 +121,9 @@ exports[`DatePickerCalendar renders correctly 1`] = `
|
|
|
122
121
|
]
|
|
123
122
|
}
|
|
124
123
|
testID="input-label"
|
|
125
|
-
themeFontSize="medium"
|
|
126
124
|
themeFontWeight="regular"
|
|
127
125
|
themeIntent="body"
|
|
128
126
|
themeState="filled"
|
|
129
|
-
themeTypeface="neutral"
|
|
130
127
|
>
|
|
131
128
|
Start date
|
|
132
129
|
</Text>
|
|
@@ -203,6 +200,7 @@ exports[`DatePickerCalendar renders correctly 1`] = `
|
|
|
203
200
|
Object {
|
|
204
201
|
"minHeight": 16,
|
|
205
202
|
"paddingLeft": 16,
|
|
203
|
+
"paddingTop": 2,
|
|
206
204
|
},
|
|
207
205
|
undefined,
|
|
208
206
|
]
|