@hero-design/rn 8.110.0 → 8.111.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 +3 -3
- package/CHANGELOG.md +18 -0
- package/assets/fonts/BeVietnamPro-BoldItalic.ttf +0 -0
- package/assets/fonts/BeVietnamPro-LightItalic.ttf +0 -0
- package/assets/fonts/BeVietnamPro-RegularItalic.ttf +0 -0
- package/assets/fonts/BeVietnamPro-SemiBoldItalic.ttf +0 -0
- package/assets/fonts/Saiga-LightItalic.otf +0 -0
- package/assets/fonts/Saiga-MediumItalic.otf +0 -0
- package/assets/fonts/Saiga-RegularItalic.otf +0 -0
- package/es/index.js +86 -40
- package/lib/index.js +86 -40
- package/package.json +7 -7
- package/src/components/Accordion/__tests__/__snapshots__/AccordionItem.spec.tsx.snap +48 -24
- package/src/components/Accordion/__tests__/__snapshots__/index.spec.tsx.snap +72 -36
- package/src/components/Accordion/index.tsx +6 -1
- package/src/components/Alert/__tests__/__snapshots__/index.spec.tsx.snap +13 -0
- package/src/components/Alert/index.tsx +10 -2
- package/src/components/AnimatedScroller/__tests__/__snapshots__/ScrollablesWithFAB.spec.tsx.snap +70 -0
- package/src/components/AppCue/__tests__/__snapshots__/StyledAppCue.tsx.snap +121 -97
- package/src/components/Attachment/__tests__/__snapshots__/index.spec.tsx.snap +1 -0
- package/src/components/Avatar/AvatarStack/__tests__/__snapshots__/StyledAvatarStack.spec.tsx.snap +2 -0
- package/src/components/Avatar/AvatarStack/__tests__/__snapshots__/index.spec.tsx.snap +31 -0
- package/src/components/Avatar/__tests__/__snapshots__/StyledAvatar.spec.tsx.snap +1 -0
- package/src/components/Avatar/__tests__/__snapshots__/index.spec.tsx.snap +2 -0
- package/src/components/Badge/__tests__/__snapshots__/Badge.spec.tsx.snap +8 -0
- package/src/components/Badge/__tests__/__snapshots__/Status.spec.tsx.snap +1 -0
- package/src/components/BottomNavigation/__tests__/__snapshots__/index.spec.tsx.snap +4 -0
- package/src/components/BottomSheet/__tests__/__snapshots__/index.spec.tsx.snap +8 -3
- package/src/components/Button/Button.tsx +10 -4
- package/src/components/Button/UtilityButton/__tests__/__snapshots__/index.spec.tsx.snap +2 -0
- package/src/components/Button/__tests__/__snapshots__/Button.spec.tsx.snap +51 -18
- package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +13 -0
- package/src/components/Calendar/__tests__/__snapshots__/CalendarRangeConnector.spec.tsx.snap +5 -0
- package/src/components/Calendar/__tests__/__snapshots__/CalendarRowItem.spec.tsx.snap +5 -0
- package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +8 -0
- package/src/components/Carousel/__tests__/__snapshots__/CardCarousel.spec.tsx.snap +16 -0
- package/src/components/Carousel/__tests__/__snapshots__/index.spec.tsx.snap +20 -0
- package/src/components/Chart/ColumnChart/__tests__/__snapshots__/index.spec.tsx.snap +49 -0
- package/src/components/Chart/Line/__tests__/__snapshots__/index.spec.tsx.snap +60 -0
- package/src/components/Chart/shared/__tests__/__snapshots__/ChartFrame.spec.tsx.snap +62 -0
- package/src/components/Chart/shared/__tests__/__snapshots__/ChartHeader.spec.tsx.snap +2 -0
- package/src/components/Chart/shared/__tests__/__snapshots__/EmptyState.spec.tsx.snap +2 -0
- package/src/components/Chart/shared/__tests__/__snapshots__/XAxis.spec.tsx.snap +12 -0
- package/src/components/Chart/shared/__tests__/__snapshots__/YAxis.spec.tsx.snap +36 -0
- package/src/components/Checkbox/__tests__/__snapshots__/DefaultCheckBox.spec.tsx.snap +4 -0
- package/src/components/Checkbox/__tests__/__snapshots__/InlineCheckBox.spec.tsx.snap +6 -0
- package/src/components/Chip/__tests__/__snapshots__/index.spec.tsx.snap +19 -0
- package/src/components/Chip/index.tsx +15 -8
- package/src/components/Collapse/__tests__/__snapshots__/StyledCollapse.spec.tsx.snap +8 -5
- package/src/components/Collapse/__tests__/__snapshots__/index.spec.tsx.snap +20 -12
- package/src/components/ContentNavigator/__tests__/__snapshots__/index.spec.tsx.snap +3 -0
- package/src/components/DatePicker/__tests__/__snapshots__/DatePicker.spec.tsx.snap +3 -0
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +1 -0
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerCalendar.spec.tsx.snap +1 -0
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +6 -0
- package/src/components/Drawer/__tests__/__snapshots__/index.spec.tsx.snap +13 -9
- package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +6 -0
- package/src/components/FAB/Pair/__tests__/__snapshots__/index.spec.tsx.snap +1 -0
- package/src/components/FAB/__tests__/__snapshots__/StyledFAB.spec.tsx.snap +2 -0
- package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +1 -0
- package/src/components/FilterTrigger/__tests__/__snapshots__/index.spec.tsx.snap +6 -0
- package/src/components/FloatingIsland/__tests__/__snapshots__/index.spec.tsx.snap +6 -0
- package/src/components/HeroDesignProvider/__tests__/__snapshots__/index.spec.tsx.snap +1 -0
- package/src/components/List/__tests__/__snapshots__/BasicListItem.spec.tsx.snap +4 -0
- package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +13 -0
- package/src/components/List/__tests__/__snapshots__/StyledBasicListItem.spec.tsx.snap +4 -0
- package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +4 -0
- package/src/components/Modal/__tests__/__snapshots__/index.spec.tsx.snap +2 -0
- package/src/components/PinInput/__tests__/__snapshots__/PinCell.spec.tsx.snap +5 -0
- package/src/components/PinInput/__tests__/__snapshots__/index.spec.tsx.snap +4 -0
- package/src/components/PinInput/index.tsx +6 -1
- package/src/components/Portal/__tests__/__snapshots__/index.spec.tsx.snap +1 -0
- package/src/components/Progress/__tests__/__snapshots__/index.spec.js.snap +3 -0
- package/src/components/Radio/RadioGroup.tsx +6 -1
- package/src/components/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +4 -0
- package/src/components/Radio/__tests__/__snapshots__/RadioGroup.spec.tsx.snap +10 -0
- package/src/components/Rate/__tests__/__snapshots__/index.spec.tsx.snap +84 -48
- package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +4 -0
- package/src/components/Search/SearchOneLine.tsx +6 -0
- package/src/components/Search/SearchTwoLine.tsx +6 -1
- package/src/components/Search/__tests__/__snapshots__/SearchOneLine.spec.tsx.snap +2 -0
- package/src/components/Search/__tests__/__snapshots__/SearchSuffixIcon.spec.tsx.snap +1 -0
- package/src/components/Search/__tests__/__snapshots__/SearchTwoLine.spec.tsx.snap +4 -0
- package/src/components/SectionHeading/__tests__/__snapshots__/index.spec.tsx.snap +7 -0
- package/src/components/SegmentedControl/__tests__/__snapshots__/SegmentedItem.spec.tsx.snap +1 -0
- package/src/components/SegmentedControl/__tests__/__snapshots__/index.spec.tsx.snap +3 -0
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/Option.spec.tsx.snap +1 -0
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +20 -0
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +57 -3
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/Option.spec.tsx.snap +1 -0
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +24 -0
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +45 -3
- package/src/components/StatusScreens/Empty/__tests__/__snapshots__/index.spec.tsx.snap +8 -0
- package/src/components/StatusScreens/Error/__tests__/__snapshots__/index.spec.tsx.snap +13 -0
- package/src/components/StatusScreens/Success/__tests__/__snapshots__/index.spec.tsx.snap +16 -0
- package/src/components/Swipeable/__tests__/__snapshots__/SwipeableAction.spec.tsx.snap +3 -0
- package/src/components/Swipeable/__tests__/__snapshots__/index.spec.tsx.snap +2 -0
- package/src/components/Switch/SelectorSwitch/__tests__/__snapshots__/Option.spec.tsx.snap +1 -0
- package/src/components/Switch/SelectorSwitch/__tests__/__snapshots__/index.spec.tsx.snap +1 -0
- package/src/components/Switch/__tests__/__snapshots__/StyledSwitch.spec.tsx.snap +9 -6
- package/src/components/Tabs/__tests__/__snapshots__/SceneView.spec.tsx.snap +3 -0
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +219 -138
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabsHeader.spec.tsx.snap +102 -62
- package/src/components/Tabs/__tests__/__snapshots__/TabWithBadge.spec.tsx.snap +1 -0
- package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +18 -0
- package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +10 -0
- package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +7 -0
- package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +40 -0
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +3 -0
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +5 -0
- package/src/components/Toast/__tests__/__snapshots__/Toast.spec.tsx.snap +13 -0
- package/src/components/Toolbar/ToolbarGroup.tsx +18 -4
- package/src/components/Toolbar/__tests__/ToolbarGroup.spec.tsx +34 -1
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarGroup.spec.tsx.snap +9 -0
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.spec.tsx.snap +7 -0
- package/src/components/Typography/Body/StyledBody.tsx +24 -19
- package/src/components/Typography/Body/__tests__/__snapshots__/index.spec.tsx.snap +229 -0
- package/src/components/Typography/Body/__tests__/index.spec.tsx +19 -0
- package/src/components/Typography/Body/index.tsx +8 -2
- package/src/components/Typography/Caption/StyledCaption.tsx +15 -8
- package/src/components/Typography/Caption/__tests__/__snapshots__/index.spec.tsx.snap +219 -0
- package/src/components/Typography/Caption/__tests__/index.spec.tsx +19 -0
- package/src/components/Typography/Caption/index.tsx +18 -10
- package/src/components/Typography/Label/StyledLabel.tsx +16 -6
- package/src/components/Typography/Label/__tests__/__snapshots__/StyledLabel.tsx.snap +8 -0
- package/src/components/Typography/Label/__tests__/__snapshots__/index.spec.tsx.snap +126 -0
- package/src/components/Typography/Label/__tests__/index.spec.tsx +12 -0
- package/src/components/Typography/Label/index.tsx +17 -9
- package/src/components/Typography/Title/StyledTitle.tsx +22 -8
- package/src/components/Typography/Title/__tests__/__snapshots__/index.spec.tsx.snap +441 -0
- package/src/components/Typography/Title/__tests__/index.spec.tsx +23 -0
- package/src/components/Typography/Title/index.tsx +8 -2
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +24 -10
- package/src/theme/components/typography.ts +12 -10
- package/src/theme/global/typography.ts +9 -0
- package/stats/8.110.1/rn-stats.html +4844 -0
- package/stats/8.111.0/rn-stats.html +4844 -0
- package/types/components/Accordion/index.d.ts +5 -1
- package/types/components/Alert/index.d.ts +8 -2
- package/types/components/Button/Button.d.ts +8 -4
- package/types/components/Chip/index.d.ts +12 -3
- package/types/components/PinInput/index.d.ts +4 -0
- package/types/components/Radio/RadioGroup.d.ts +5 -1
- package/types/components/Radio/index.d.ts +1 -1
- package/types/components/Search/SearchOneLine.d.ts +4 -0
- package/types/components/Search/SearchTwoLine.d.ts +4 -0
- package/types/components/TextInput/StyledTextInput.d.ts +1 -1
- package/types/components/Toolbar/ToolbarGroup.d.ts +11 -3
- package/types/components/Toolbar/index.d.ts +1 -1
- package/types/components/Typography/Body/StyledBody.d.ts +1 -0
- package/types/components/Typography/Body/index.d.ts +6 -2
- package/types/components/Typography/Caption/StyledCaption.d.ts +1 -0
- package/types/components/Typography/Caption/index.d.ts +5 -1
- package/types/components/Typography/Label/StyledLabel.d.ts +1 -0
- package/types/components/Typography/Label/index.d.ts +5 -1
- package/types/components/Typography/Title/StyledTitle.d.ts +1 -0
- package/types/components/Typography/Title/index.d.ts +6 -2
- package/types/theme/components/typography.d.ts +12 -10
- package/types/theme/global/typography.d.ts +3 -0
|
@@ -24,6 +24,7 @@ exports[`Caption has archived intent style 1`] = `
|
|
|
24
24
|
}
|
|
25
25
|
themeFontWeight="regular"
|
|
26
26
|
themeIntent="archived"
|
|
27
|
+
themeIsItalic={false}
|
|
27
28
|
>
|
|
28
29
|
This is a test
|
|
29
30
|
</Text>
|
|
@@ -74,6 +75,7 @@ exports[`Caption has body intent style 1`] = `
|
|
|
74
75
|
}
|
|
75
76
|
themeFontWeight="regular"
|
|
76
77
|
themeIntent="body"
|
|
78
|
+
themeIsItalic={false}
|
|
77
79
|
>
|
|
78
80
|
This is a test
|
|
79
81
|
</Text>
|
|
@@ -124,6 +126,7 @@ exports[`Caption has danger intent style 1`] = `
|
|
|
124
126
|
}
|
|
125
127
|
themeFontWeight="regular"
|
|
126
128
|
themeIntent="danger"
|
|
129
|
+
themeIsItalic={false}
|
|
127
130
|
>
|
|
128
131
|
This is a test
|
|
129
132
|
</Text>
|
|
@@ -174,6 +177,7 @@ exports[`Caption has disabled intent style 1`] = `
|
|
|
174
177
|
}
|
|
175
178
|
themeFontWeight="regular"
|
|
176
179
|
themeIntent="disabled"
|
|
180
|
+
themeIsItalic={false}
|
|
177
181
|
>
|
|
178
182
|
This is a test
|
|
179
183
|
</Text>
|
|
@@ -224,6 +228,7 @@ exports[`Caption has inactive intent style 1`] = `
|
|
|
224
228
|
}
|
|
225
229
|
themeFontWeight="regular"
|
|
226
230
|
themeIntent="inactive"
|
|
231
|
+
themeIsItalic={false}
|
|
227
232
|
>
|
|
228
233
|
This is a test
|
|
229
234
|
</Text>
|
|
@@ -274,6 +279,7 @@ exports[`Caption has info intent style 1`] = `
|
|
|
274
279
|
}
|
|
275
280
|
themeFontWeight="regular"
|
|
276
281
|
themeIntent="info"
|
|
282
|
+
themeIsItalic={false}
|
|
277
283
|
>
|
|
278
284
|
This is a test
|
|
279
285
|
</Text>
|
|
@@ -324,6 +330,7 @@ exports[`Caption has inverted intent style 1`] = `
|
|
|
324
330
|
}
|
|
325
331
|
themeFontWeight="regular"
|
|
326
332
|
themeIntent="inverted"
|
|
333
|
+
themeIsItalic={false}
|
|
327
334
|
>
|
|
328
335
|
This is a test
|
|
329
336
|
</Text>
|
|
@@ -374,6 +381,7 @@ exports[`Caption has muted intent style 1`] = `
|
|
|
374
381
|
}
|
|
375
382
|
themeFontWeight="regular"
|
|
376
383
|
themeIntent="muted"
|
|
384
|
+
themeIsItalic={false}
|
|
377
385
|
>
|
|
378
386
|
This is a test
|
|
379
387
|
</Text>
|
|
@@ -424,6 +432,7 @@ exports[`Caption has primary intent style 1`] = `
|
|
|
424
432
|
}
|
|
425
433
|
themeFontWeight="regular"
|
|
426
434
|
themeIntent="primary"
|
|
435
|
+
themeIsItalic={false}
|
|
427
436
|
>
|
|
428
437
|
This is a test
|
|
429
438
|
</Text>
|
|
@@ -474,6 +483,7 @@ exports[`Caption has regular fontWeight style 1`] = `
|
|
|
474
483
|
}
|
|
475
484
|
themeFontWeight="regular"
|
|
476
485
|
themeIntent="body"
|
|
486
|
+
themeIsItalic={false}
|
|
477
487
|
>
|
|
478
488
|
This is a test
|
|
479
489
|
</Text>
|
|
@@ -524,6 +534,7 @@ exports[`Caption has secondary intent style 1`] = `
|
|
|
524
534
|
}
|
|
525
535
|
themeFontWeight="regular"
|
|
526
536
|
themeIntent="secondary"
|
|
537
|
+
themeIsItalic={false}
|
|
527
538
|
>
|
|
528
539
|
This is a test
|
|
529
540
|
</Text>
|
|
@@ -574,6 +585,7 @@ exports[`Caption has semi-bold fontWeight style 1`] = `
|
|
|
574
585
|
}
|
|
575
586
|
themeFontWeight="semi-bold"
|
|
576
587
|
themeIntent="body"
|
|
588
|
+
themeIsItalic={false}
|
|
577
589
|
>
|
|
578
590
|
This is a test
|
|
579
591
|
</Text>
|
|
@@ -624,6 +636,7 @@ exports[`Caption has subdued intent style 1`] = `
|
|
|
624
636
|
}
|
|
625
637
|
themeFontWeight="regular"
|
|
626
638
|
themeIntent="subdued"
|
|
639
|
+
themeIsItalic={false}
|
|
627
640
|
>
|
|
628
641
|
This is a test
|
|
629
642
|
</Text>
|
|
@@ -674,6 +687,7 @@ exports[`Caption has success intent style 1`] = `
|
|
|
674
687
|
}
|
|
675
688
|
themeFontWeight="regular"
|
|
676
689
|
themeIntent="success"
|
|
690
|
+
themeIsItalic={false}
|
|
677
691
|
>
|
|
678
692
|
This is a test
|
|
679
693
|
</Text>
|
|
@@ -724,6 +738,7 @@ exports[`Caption has warning intent style 1`] = `
|
|
|
724
738
|
}
|
|
725
739
|
themeFontWeight="regular"
|
|
726
740
|
themeIntent="warning"
|
|
741
|
+
themeIsItalic={false}
|
|
727
742
|
>
|
|
728
743
|
This is a test
|
|
729
744
|
</Text>
|
|
@@ -749,3 +764,207 @@ exports[`Caption has warning intent style 1`] = `
|
|
|
749
764
|
/>
|
|
750
765
|
</View>
|
|
751
766
|
`;
|
|
767
|
+
|
|
768
|
+
exports[`Caption renders fontStyle=italic with regular fontWeight 1`] = `
|
|
769
|
+
<View
|
|
770
|
+
style={
|
|
771
|
+
{
|
|
772
|
+
"flex": 1,
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
>
|
|
776
|
+
<Text
|
|
777
|
+
allowFontScaling={false}
|
|
778
|
+
style={
|
|
779
|
+
[
|
|
780
|
+
{
|
|
781
|
+
"color": "#001f23",
|
|
782
|
+
"fontFamily": "BeVietnamPro-RegularItalic",
|
|
783
|
+
"fontSize": 12,
|
|
784
|
+
"letterSpacing": 0.36,
|
|
785
|
+
"lineHeight": 16,
|
|
786
|
+
},
|
|
787
|
+
undefined,
|
|
788
|
+
]
|
|
789
|
+
}
|
|
790
|
+
themeFontWeight="regular"
|
|
791
|
+
themeIntent="body"
|
|
792
|
+
themeIsItalic={true}
|
|
793
|
+
>
|
|
794
|
+
This is text with fontStyle
|
|
795
|
+
</Text>
|
|
796
|
+
<View
|
|
797
|
+
pointerEvents="box-none"
|
|
798
|
+
position="bottom"
|
|
799
|
+
style={
|
|
800
|
+
[
|
|
801
|
+
{
|
|
802
|
+
"bottom": 0,
|
|
803
|
+
"elevation": 9999,
|
|
804
|
+
"flexDirection": "column-reverse",
|
|
805
|
+
"left": 0,
|
|
806
|
+
"paddingHorizontal": 24,
|
|
807
|
+
"paddingVertical": 16,
|
|
808
|
+
"position": "absolute",
|
|
809
|
+
"right": 0,
|
|
810
|
+
"top": 0,
|
|
811
|
+
},
|
|
812
|
+
undefined,
|
|
813
|
+
]
|
|
814
|
+
}
|
|
815
|
+
/>
|
|
816
|
+
</View>
|
|
817
|
+
`;
|
|
818
|
+
|
|
819
|
+
exports[`Caption renders fontStyle=italic with semi-bold fontWeight 1`] = `
|
|
820
|
+
<View
|
|
821
|
+
style={
|
|
822
|
+
{
|
|
823
|
+
"flex": 1,
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
>
|
|
827
|
+
<Text
|
|
828
|
+
allowFontScaling={false}
|
|
829
|
+
style={
|
|
830
|
+
[
|
|
831
|
+
{
|
|
832
|
+
"color": "#001f23",
|
|
833
|
+
"fontFamily": "BeVietnamPro-SemiBoldItalic",
|
|
834
|
+
"fontSize": 12,
|
|
835
|
+
"letterSpacing": 0.24,
|
|
836
|
+
"lineHeight": 16,
|
|
837
|
+
},
|
|
838
|
+
undefined,
|
|
839
|
+
]
|
|
840
|
+
}
|
|
841
|
+
themeFontWeight="semi-bold"
|
|
842
|
+
themeIntent="body"
|
|
843
|
+
themeIsItalic={true}
|
|
844
|
+
>
|
|
845
|
+
This is text with fontStyle
|
|
846
|
+
</Text>
|
|
847
|
+
<View
|
|
848
|
+
pointerEvents="box-none"
|
|
849
|
+
position="bottom"
|
|
850
|
+
style={
|
|
851
|
+
[
|
|
852
|
+
{
|
|
853
|
+
"bottom": 0,
|
|
854
|
+
"elevation": 9999,
|
|
855
|
+
"flexDirection": "column-reverse",
|
|
856
|
+
"left": 0,
|
|
857
|
+
"paddingHorizontal": 24,
|
|
858
|
+
"paddingVertical": 16,
|
|
859
|
+
"position": "absolute",
|
|
860
|
+
"right": 0,
|
|
861
|
+
"top": 0,
|
|
862
|
+
},
|
|
863
|
+
undefined,
|
|
864
|
+
]
|
|
865
|
+
}
|
|
866
|
+
/>
|
|
867
|
+
</View>
|
|
868
|
+
`;
|
|
869
|
+
|
|
870
|
+
exports[`Caption renders fontStyle=normal with regular fontWeight 1`] = `
|
|
871
|
+
<View
|
|
872
|
+
style={
|
|
873
|
+
{
|
|
874
|
+
"flex": 1,
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
>
|
|
878
|
+
<Text
|
|
879
|
+
allowFontScaling={false}
|
|
880
|
+
style={
|
|
881
|
+
[
|
|
882
|
+
{
|
|
883
|
+
"color": "#001f23",
|
|
884
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
885
|
+
"fontSize": 12,
|
|
886
|
+
"letterSpacing": 0.36,
|
|
887
|
+
"lineHeight": 16,
|
|
888
|
+
},
|
|
889
|
+
undefined,
|
|
890
|
+
]
|
|
891
|
+
}
|
|
892
|
+
themeFontWeight="regular"
|
|
893
|
+
themeIntent="body"
|
|
894
|
+
themeIsItalic={false}
|
|
895
|
+
>
|
|
896
|
+
This is text with fontStyle
|
|
897
|
+
</Text>
|
|
898
|
+
<View
|
|
899
|
+
pointerEvents="box-none"
|
|
900
|
+
position="bottom"
|
|
901
|
+
style={
|
|
902
|
+
[
|
|
903
|
+
{
|
|
904
|
+
"bottom": 0,
|
|
905
|
+
"elevation": 9999,
|
|
906
|
+
"flexDirection": "column-reverse",
|
|
907
|
+
"left": 0,
|
|
908
|
+
"paddingHorizontal": 24,
|
|
909
|
+
"paddingVertical": 16,
|
|
910
|
+
"position": "absolute",
|
|
911
|
+
"right": 0,
|
|
912
|
+
"top": 0,
|
|
913
|
+
},
|
|
914
|
+
undefined,
|
|
915
|
+
]
|
|
916
|
+
}
|
|
917
|
+
/>
|
|
918
|
+
</View>
|
|
919
|
+
`;
|
|
920
|
+
|
|
921
|
+
exports[`Caption renders fontStyle=normal with semi-bold fontWeight 1`] = `
|
|
922
|
+
<View
|
|
923
|
+
style={
|
|
924
|
+
{
|
|
925
|
+
"flex": 1,
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
>
|
|
929
|
+
<Text
|
|
930
|
+
allowFontScaling={false}
|
|
931
|
+
style={
|
|
932
|
+
[
|
|
933
|
+
{
|
|
934
|
+
"color": "#001f23",
|
|
935
|
+
"fontFamily": "BeVietnamPro-SemiBold",
|
|
936
|
+
"fontSize": 12,
|
|
937
|
+
"letterSpacing": 0.24,
|
|
938
|
+
"lineHeight": 16,
|
|
939
|
+
},
|
|
940
|
+
undefined,
|
|
941
|
+
]
|
|
942
|
+
}
|
|
943
|
+
themeFontWeight="semi-bold"
|
|
944
|
+
themeIntent="body"
|
|
945
|
+
themeIsItalic={false}
|
|
946
|
+
>
|
|
947
|
+
This is text with fontStyle
|
|
948
|
+
</Text>
|
|
949
|
+
<View
|
|
950
|
+
pointerEvents="box-none"
|
|
951
|
+
position="bottom"
|
|
952
|
+
style={
|
|
953
|
+
[
|
|
954
|
+
{
|
|
955
|
+
"bottom": 0,
|
|
956
|
+
"elevation": 9999,
|
|
957
|
+
"flexDirection": "column-reverse",
|
|
958
|
+
"left": 0,
|
|
959
|
+
"paddingHorizontal": 24,
|
|
960
|
+
"paddingVertical": 16,
|
|
961
|
+
"position": "absolute",
|
|
962
|
+
"right": 0,
|
|
963
|
+
"top": 0,
|
|
964
|
+
},
|
|
965
|
+
undefined,
|
|
966
|
+
]
|
|
967
|
+
}
|
|
968
|
+
/>
|
|
969
|
+
</View>
|
|
970
|
+
`;
|
|
@@ -45,4 +45,23 @@ describe('Caption', () => {
|
|
|
45
45
|
|
|
46
46
|
expect(toJSON()).toMatchSnapshot();
|
|
47
47
|
});
|
|
48
|
+
|
|
49
|
+
it.each`
|
|
50
|
+
fontStyle | fontWeight
|
|
51
|
+
${'normal'} | ${'regular'}
|
|
52
|
+
${'italic'} | ${'regular'}
|
|
53
|
+
${'normal'} | ${'semi-bold'}
|
|
54
|
+
${'italic'} | ${'semi-bold'}
|
|
55
|
+
`(
|
|
56
|
+
'renders fontStyle=$fontStyle with $fontWeight fontWeight',
|
|
57
|
+
({ fontStyle, fontWeight }) => {
|
|
58
|
+
const { toJSON } = renderWithTheme(
|
|
59
|
+
<Caption fontStyle={fontStyle} fontWeight={fontWeight}>
|
|
60
|
+
This is text with fontStyle
|
|
61
|
+
</Caption>
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
expect(toJSON()).toMatchSnapshot();
|
|
65
|
+
}
|
|
66
|
+
);
|
|
48
67
|
});
|
|
@@ -29,6 +29,10 @@ export interface CaptionProps extends NativeTextProps {
|
|
|
29
29
|
* Testing id of the component.
|
|
30
30
|
*/
|
|
31
31
|
testID?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Font style to apply to the text.
|
|
34
|
+
*/
|
|
35
|
+
fontStyle?: 'normal' | 'italic';
|
|
32
36
|
}
|
|
33
37
|
|
|
34
38
|
const Caption = ({
|
|
@@ -36,16 +40,20 @@ const Caption = ({
|
|
|
36
40
|
fontWeight = 'regular',
|
|
37
41
|
intent = 'body',
|
|
38
42
|
allowFontScaling = false,
|
|
43
|
+
fontStyle = 'normal',
|
|
39
44
|
...nativeProps
|
|
40
|
-
}: CaptionProps) =>
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
}: CaptionProps) => {
|
|
46
|
+
return (
|
|
47
|
+
<StyledCaption
|
|
48
|
+
{...nativeProps}
|
|
49
|
+
themeFontWeight={fontWeight}
|
|
50
|
+
themeIntent={intent}
|
|
51
|
+
themeIsItalic={fontStyle === 'italic'}
|
|
52
|
+
allowFontScaling={allowFontScaling}
|
|
53
|
+
>
|
|
54
|
+
{children}
|
|
55
|
+
</StyledCaption>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
50
58
|
|
|
51
59
|
export default Caption;
|
|
@@ -4,11 +4,21 @@ import type { TypographyIntent } from '../types';
|
|
|
4
4
|
|
|
5
5
|
const StyledLabel = styled(Text)<{
|
|
6
6
|
themeIntent: TypographyIntent;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
7
|
+
themeIsItalic?: boolean;
|
|
8
|
+
}>(({ themeIntent, theme, themeIsItalic }) => {
|
|
9
|
+
// For Label, we assume 'regular' weight for base font family
|
|
10
|
+
const baseFontWeight = 'regular';
|
|
11
|
+
const fontFamily = themeIsItalic
|
|
12
|
+
? theme.__hd__.typography.fonts.neutral[`${baseFontWeight}Italic`]
|
|
13
|
+
: theme.__hd__.typography.fonts.neutral[baseFontWeight];
|
|
14
|
+
|
|
15
|
+
return {
|
|
16
|
+
fontSize: theme.__hd__.typography.fontSizes.label,
|
|
17
|
+
lineHeight: theme.__hd__.typography.lineHeights.label,
|
|
18
|
+
letterSpacing: 0,
|
|
19
|
+
color: theme.__hd__.typography.colors[themeIntent],
|
|
20
|
+
fontFamily,
|
|
21
|
+
};
|
|
22
|
+
});
|
|
13
23
|
|
|
14
24
|
export { StyledLabel };
|
|
@@ -13,6 +13,7 @@ exports[`StyledLabel has body intent style 1`] = `
|
|
|
13
13
|
[
|
|
14
14
|
{
|
|
15
15
|
"color": "#001f23",
|
|
16
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
16
17
|
"fontSize": 10,
|
|
17
18
|
"letterSpacing": 0,
|
|
18
19
|
"lineHeight": 14,
|
|
@@ -60,6 +61,7 @@ exports[`StyledLabel has danger intent style 1`] = `
|
|
|
60
61
|
[
|
|
61
62
|
{
|
|
62
63
|
"color": "#cb300a",
|
|
64
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
63
65
|
"fontSize": 10,
|
|
64
66
|
"letterSpacing": 0,
|
|
65
67
|
"lineHeight": 14,
|
|
@@ -107,6 +109,7 @@ exports[`StyledLabel has info intent style 1`] = `
|
|
|
107
109
|
[
|
|
108
110
|
{
|
|
109
111
|
"color": "#355bfb",
|
|
112
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
110
113
|
"fontSize": 10,
|
|
111
114
|
"letterSpacing": 0,
|
|
112
115
|
"lineHeight": 14,
|
|
@@ -154,6 +157,7 @@ exports[`StyledLabel has inverted intent style 1`] = `
|
|
|
154
157
|
[
|
|
155
158
|
{
|
|
156
159
|
"color": "#ffffff",
|
|
160
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
157
161
|
"fontSize": 10,
|
|
158
162
|
"letterSpacing": 0,
|
|
159
163
|
"lineHeight": 14,
|
|
@@ -201,6 +205,7 @@ exports[`StyledLabel has primary intent style 1`] = `
|
|
|
201
205
|
[
|
|
202
206
|
{
|
|
203
207
|
"color": "#401960",
|
|
208
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
204
209
|
"fontSize": 10,
|
|
205
210
|
"letterSpacing": 0,
|
|
206
211
|
"lineHeight": 14,
|
|
@@ -248,6 +253,7 @@ exports[`StyledLabel has subdued intent style 1`] = `
|
|
|
248
253
|
[
|
|
249
254
|
{
|
|
250
255
|
"color": "#4d6265",
|
|
256
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
251
257
|
"fontSize": 10,
|
|
252
258
|
"letterSpacing": 0,
|
|
253
259
|
"lineHeight": 14,
|
|
@@ -295,6 +301,7 @@ exports[`StyledLabel has success intent style 1`] = `
|
|
|
295
301
|
[
|
|
296
302
|
{
|
|
297
303
|
"color": "#5ace7d",
|
|
304
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
298
305
|
"fontSize": 10,
|
|
299
306
|
"letterSpacing": 0,
|
|
300
307
|
"lineHeight": 14,
|
|
@@ -342,6 +349,7 @@ exports[`StyledLabel has warning intent style 1`] = `
|
|
|
342
349
|
[
|
|
343
350
|
{
|
|
344
351
|
"color": "#ffbe71",
|
|
352
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
345
353
|
"fontSize": 10,
|
|
346
354
|
"letterSpacing": 0,
|
|
347
355
|
"lineHeight": 14,
|