@hero-design/rn 7.22.2 → 7.23.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/es/index.js +2395 -1880
- package/lib/index.js +2395 -1878
- package/package.json +6 -6
- package/src/components/Accordion/AccordionItem.tsx +1 -1
- package/src/components/Accordion/__tests__/__snapshots__/AccordionItem.spec.tsx.snap +8 -8
- package/src/components/Accordion/__tests__/__snapshots__/index.spec.tsx.snap +12 -12
- package/src/components/Avatar/__tests__/__snapshots__/StyledAvatar.spec.tsx.snap +3 -3
- package/src/components/Avatar/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
- package/src/components/BottomNavigation/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
- package/src/components/Box/StyledBox.tsx +1 -2
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/StyledLoadingIndicator.spec.tsx.snap +2 -2
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +6 -6
- package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +24 -24
- package/src/components/Calendar/__tests__/__snapshots__/CalendarRowItem.spec.tsx.snap +6 -6
- package/src/components/Card/DataCard/__tests__/__snapshots__/StyledDataCard.spec.tsx.snap +3 -3
- package/src/components/Card/DataCard/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
- package/src/components/Card/__tests__/__snapshots__/StyledCard.spec.tsx.snap +1 -1
- package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
- package/src/components/Checkbox/__tests__/__snapshots__/StyledCheckbox.spec.tsx.snap +2 -2
- package/src/components/Checkbox/__tests__/__snapshots__/index.spec.tsx.snap +5 -5
- package/src/components/ContentNavigator/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +18 -4
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +19 -5
- package/src/components/Drawer/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
- package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +10 -10
- package/src/components/Icon/HeroIcon/index.tsx +2 -0
- package/src/components/Icon/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
- package/src/components/Icon/index.tsx +1 -0
- package/src/components/List/__tests__/__snapshots__/BasicListItem.spec.tsx.snap +2 -2
- package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +12 -12
- package/src/components/List/__tests__/__snapshots__/StyledBasicListItem.spec.tsx.snap +2 -2
- package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +4 -4
- package/src/components/PinInput/__tests__/__snapshots__/PinCell.spec.tsx.snap +6 -6
- package/src/components/PinInput/__tests__/__snapshots__/index.spec.tsx.snap +21 -21
- package/src/components/Progress/__tests__/__snapshots__/index.spec.js.snap +5 -5
- package/src/components/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +1 -1
- package/src/components/Radio/__tests__/__snapshots__/RadioGroup.spec.tsx.snap +1 -1
- package/src/components/RefreshControl/__tests__/__snapshots__/index.spec.tsx.snap +69 -0
- package/src/components/RefreshControl/__tests__/index.spec.tsx +55 -0
- package/src/components/RefreshControl/index.tsx +23 -0
- package/src/components/RichTextEditor/MentionList.tsx +25 -4
- package/src/components/RichTextEditor/RichTextEditor.tsx +3 -1
- package/src/components/RichTextEditor/__tests__/EditorToolbar.spec.tsx +1 -1
- package/src/components/RichTextEditor/__tests__/MentionList.spec.tsx +6 -6
- package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +38 -10
- package/src/components/SectionHeading/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/Option.spec.tsx.snap +1 -1
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +13 -9
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +108 -38
- package/src/components/Select/MultiSelect/index.tsx +1 -1
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/Option.spec.tsx.snap +1 -1
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +12 -8
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +99 -29
- package/src/components/Select/SingleSelect/index.tsx +1 -1
- package/src/components/Select/__tests__/__snapshots__/StyledSelect.spec.tsx.snap +1 -1
- package/src/components/Select/types.ts +1 -3
- package/src/components/Slider/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
- package/src/components/Spinner/StyledSpinner.tsx +8 -4
- package/src/components/Spinner/__tests__/__snapshots__/AnimatedSpinner.spec.tsx.snap +8 -4
- package/src/components/Spinner/__tests__/__snapshots__/StyledSpinner.spec.tsx.snap +32 -16
- package/src/components/Spinner/__tests__/__snapshots__/index.spec.tsx.snap +8 -4
- package/src/components/Switch/__tests__/__snapshots__/StyledSwitch.spec.tsx.snap +3 -3
- package/src/components/Tabs/ScrollableTabs.tsx +2 -5
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +1 -1
- package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +1 -1
- package/src/components/TextInput/StyledTextInput.tsx +16 -11
- package/src/components/TextInput/__tests__/StyledTextInput.spec.tsx +3 -3
- package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +46 -28
- package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +246 -64
- package/src/components/TextInput/index.tsx +21 -4
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +18 -4
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +19 -5
- package/src/components/Toast/ToastProvider.tsx +2 -4
- package/src/components/Toast/__tests__/index.spec.tsx +138 -0
- package/src/components/Toolbar/ToolbarItem.tsx +1 -1
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarGroup.spec.tsx.snap +12 -12
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.spec.tsx.snap +6 -6
- package/src/components/Typography/Text/StyledText.tsx +1 -0
- package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +3 -3
- package/src/components/Typography/Text/index.tsx +1 -0
- package/src/index.ts +4 -0
- package/src/theme/ThemeSwitcher.tsx +9 -2
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +101 -88
- package/src/theme/components/accordion.ts +1 -1
- package/src/theme/components/alert.ts +4 -4
- package/src/theme/components/avatar.ts +2 -2
- package/src/theme/components/badge.ts +6 -6
- package/src/theme/components/bottomNavigation.ts +2 -2
- package/src/theme/components/bottomSheet.ts +3 -3
- package/src/theme/components/button.ts +20 -20
- package/src/theme/components/calendar.ts +4 -4
- package/src/theme/components/card.ts +5 -5
- package/src/theme/components/checkbox.ts +1 -1
- package/src/theme/components/divider.ts +1 -1
- package/src/theme/components/drawer.ts +4 -4
- package/src/theme/components/empty.ts +3 -4
- package/src/theme/components/fab.ts +7 -7
- package/src/theme/components/icon.ts +4 -3
- package/src/theme/components/list.ts +6 -7
- package/src/theme/components/pinInput.ts +4 -4
- package/src/theme/components/progress.ts +3 -3
- package/src/theme/components/refreshControl.ts +11 -0
- package/src/theme/components/richTextEditor.ts +9 -8
- package/src/theme/components/sectionHeading.ts +1 -1
- package/src/theme/components/select.ts +1 -1
- package/src/theme/components/slider.ts +3 -3
- package/src/theme/components/spinner.ts +1 -4
- package/src/theme/components/switch.ts +7 -7
- package/src/theme/components/tabs.ts +5 -5
- package/src/theme/components/tag.ts +12 -12
- package/src/theme/components/textInput.ts +38 -38
- package/src/theme/components/toast.ts +6 -6
- package/src/theme/components/toolbar.ts +3 -2
- package/src/theme/components/typography.ts +4 -3
- package/src/theme/getTheme.ts +3 -0
- package/src/theme/global/colors/global.ts +32 -0
- package/src/theme/global/colors/jobs.ts +18 -0
- package/src/theme/global/colors/legacySystemPalette.ts +53 -0
- package/src/theme/global/colors/swag.ts +21 -35
- package/src/theme/global/colors/types.ts +46 -27
- package/src/theme/global/colors/work.ts +10 -9
- package/src/theme/global/index.ts +8 -1
- package/src/theme/index.ts +6 -1
- package/src/utils/__tests__/helpers.spec.ts +27 -0
- package/src/utils/helpers.ts +21 -0
- package/tsconfig.prod.json +4 -0
- package/types/components/Icon/HeroIcon/index.d.ts +1 -1
- package/types/components/Icon/index.d.ts +1 -1
- package/types/components/RefreshControl/index.d.ts +5 -0
- package/types/components/RichTextEditor/MentionList.d.ts +7 -3
- package/types/components/RichTextEditor/index.d.ts +1 -1
- package/types/components/Select/types.d.ts +1 -3
- package/types/components/TextInput/StyledTextInput.d.ts +9 -3
- package/types/components/Toolbar/ToolbarItem.d.ts +1 -1
- package/types/components/Typography/Text/StyledText.d.ts +1 -1
- package/types/components/Typography/Text/index.d.ts +1 -1
- package/types/index.d.ts +3 -2
- package/types/theme/ThemeSwitcher.d.ts +1 -1
- package/types/theme/components/empty.d.ts +0 -1
- package/types/theme/components/icon.d.ts +1 -0
- package/types/theme/components/refreshControl.d.ts +7 -0
- package/types/theme/components/richTextEditor.d.ts +4 -3
- package/types/theme/components/spinner.d.ts +1 -4
- package/types/theme/components/toolbar.d.ts +1 -0
- package/types/theme/components/typography.d.ts +1 -0
- package/types/theme/getTheme.d.ts +2 -0
- package/types/theme/global/colors/global.d.ts +3 -0
- package/types/theme/global/colors/jobs.d.ts +3 -0
- package/types/theme/global/colors/legacySystemPalette.d.ts +3 -0
- package/types/theme/global/colors/types.d.ts +41 -21
- package/types/theme/global/index.d.ts +30 -21
- package/types/theme/index.d.ts +2 -2
- package/types/utils/helpers.d.ts +2 -0
- package/src/components/Box/__tests__/helpers.spec.ts +0 -14
- package/src/components/Box/helpers.ts +0 -10
- package/types/components/Accordion/__tests__/AccordionItem.spec.d.ts +0 -1
- package/types/components/Accordion/__tests__/StyledAccordion.spec.d.ts +0 -1
- package/types/components/Accordion/__tests__/index.spec.d.ts +0 -1
- package/types/components/Alert/__tests__/index.spec.d.ts +0 -1
- package/types/components/Avatar/__tests__/StyledAvatar.spec.d.ts +0 -1
- package/types/components/Avatar/__tests__/index.spec.d.ts +0 -1
- package/types/components/Badge/__tests__/Badge.spec.d.ts +0 -1
- package/types/components/Badge/__tests__/Status.spec.d.ts +0 -1
- package/types/components/BottomNavigation/__tests__/index.spec.d.ts +0 -1
- package/types/components/BottomSheet/__tests__/index.spec.d.ts +0 -1
- package/types/components/Box/__tests__/helpers.spec.d.ts +0 -1
- package/types/components/Box/__tests__/index.spec.d.ts +0 -1
- package/types/components/Box/helpers.d.ts +0 -1
- package/types/components/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.d.ts +0 -1
- package/types/components/Button/LoadingIndicator/__tests__/index.spec.d.ts +0 -1
- package/types/components/Button/UtilityButton/__tests__/index.spec.d.ts +0 -1
- package/types/components/Button/__tests__/Button.spec.d.ts +0 -1
- package/types/components/Button/__tests__/IconButton.spec.d.ts +0 -1
- package/types/components/Button/__tests__/StyledButton.spec.d.ts +0 -1
- package/types/components/Calendar/__tests__/CalendarRowItem.spec.d.ts +0 -1
- package/types/components/Calendar/__tests__/helper.spec.d.ts +0 -1
- package/types/components/Calendar/__tests__/index.spec.d.ts +0 -1
- package/types/components/Card/DataCard/__tests__/StyledDataCard.spec.d.ts +0 -1
- package/types/components/Card/DataCard/__tests__/index.spec.d.ts +0 -1
- package/types/components/Card/__tests__/StyledCard.spec.d.ts +0 -1
- package/types/components/Card/__tests__/index.spec.d.ts +0 -1
- package/types/components/Checkbox/__tests__/StyledCheckbox.spec.d.ts +0 -1
- package/types/components/Checkbox/__tests__/index.spec.d.ts +0 -1
- package/types/components/Collapse/__tests__/StyledCollapse.spec.d.ts +0 -1
- package/types/components/Collapse/__tests__/index.spec.d.ts +0 -1
- package/types/components/ContentNavigator/__tests__/StyledContentNavigator.spec.d.ts +0 -1
- package/types/components/ContentNavigator/__tests__/index.spec.d.ts +0 -1
- package/types/components/DatePicker/__tests__/DatePicker.spec.d.ts +0 -1
- package/types/components/DatePicker/__tests__/DatePickerAndroid.spec.d.ts +0 -1
- package/types/components/DatePicker/__tests__/DatePickerIOS.spec.d.ts +0 -1
- package/types/components/Divider/__tests__/StyledDivider.spec.d.ts +0 -1
- package/types/components/Drawer/DragableDrawer/__tests__/helpers.spec.d.ts +0 -1
- package/types/components/Drawer/DragableDrawer/__tests__/index.spec.d.ts +0 -1
- package/types/components/Drawer/__tests__/index.spec.d.ts +0 -1
- package/types/components/Empty/__tests__/index.spec.d.ts +0 -1
- package/types/components/FAB/ActionGroup/__tests__/index.spec.d.ts +0 -1
- package/types/components/FAB/__tests__/AnimatedFABIcon.spec.d.ts +0 -1
- package/types/components/FAB/__tests__/StyledFAB.spec.d.ts +0 -1
- package/types/components/FAB/__tests__/index.spec.d.ts +0 -1
- package/types/components/Icon/__tests__/index.spec.d.ts +0 -1
- package/types/components/Image/__tests__/index.spec.d.ts +0 -1
- package/types/components/List/__tests__/BasicListItem.spec.d.ts +0 -1
- package/types/components/List/__tests__/ListItem.spec.d.ts +0 -1
- package/types/components/List/__tests__/StyledBasicListItem.spec.d.ts +0 -1
- package/types/components/List/__tests__/StyledListItem.spec.d.ts +0 -1
- package/types/components/PinInput/__tests__/PinCell.spec.d.ts +0 -1
- package/types/components/PinInput/__tests__/StyledPinInput.spec.d.ts +0 -1
- package/types/components/PinInput/__tests__/index.spec.d.ts +0 -1
- package/types/components/Radio/__tests__/Radio.spec.d.ts +0 -1
- package/types/components/Radio/__tests__/RadioGroup.spec.d.ts +0 -1
- package/types/components/RichTextEditor/__tests__/EditorToolbar.spec.d.ts +0 -1
- package/types/components/RichTextEditor/__tests__/MentionList.spec.d.ts +0 -1
- package/types/components/RichTextEditor/__tests__/RichTextEditor.spec.d.ts +0 -1
- package/types/components/SectionHeading/__tests__/StyledHeading.spec.d.ts +0 -1
- package/types/components/SectionHeading/__tests__/index.spec.d.ts +0 -1
- package/types/components/Select/MultiSelect/__tests__/Option.spec.d.ts +0 -1
- package/types/components/Select/MultiSelect/__tests__/OptionList.spec.d.ts +0 -1
- package/types/components/Select/MultiSelect/__tests__/index.spec.d.ts +0 -1
- package/types/components/Select/SingleSelect/__tests__/Option.spec.d.ts +0 -1
- package/types/components/Select/SingleSelect/__tests__/OptionList.spec.d.ts +0 -1
- package/types/components/Select/SingleSelect/__tests__/index.spec.d.ts +0 -1
- package/types/components/Select/__tests__/StyledSelect.spec.d.ts +0 -1
- package/types/components/Select/__tests__/helpers.spec.d.ts +0 -1
- package/types/components/Slider/__tests__/index.spec.d.ts +0 -1
- package/types/components/Spinner/__tests__/AnimatedSpinner.spec.d.ts +0 -1
- package/types/components/Spinner/__tests__/StyledSpinner.spec.d.ts +0 -1
- package/types/components/Spinner/__tests__/index.spec.d.ts +0 -1
- package/types/components/Switch/SelectorSwitch/__tests__/Option.spec.d.ts +0 -1
- package/types/components/Switch/SelectorSwitch/__tests__/index.spec.d.ts +0 -1
- package/types/components/Switch/__tests__/StyledSwitch.spec.d.ts +0 -1
- package/types/components/Switch/__tests__/index.spec.d.ts +0 -1
- package/types/components/Tabs/__tests__/ScrollableTabs.spec.d.ts +0 -1
- package/types/components/Tabs/__tests__/TabWithBadge.spec.d.ts +0 -1
- package/types/components/Tabs/__tests__/index.spec.d.ts +0 -1
- package/types/components/Tag/__tests__/Tag.spec.d.ts +0 -1
- package/types/components/TextInput/__tests__/StyledTextInput.spec.d.ts +0 -1
- package/types/components/TextInput/__tests__/index.spec.d.ts +0 -1
- package/types/components/TimePicker/__tests__/TimePicker.spec.d.ts +0 -1
- package/types/components/TimePicker/__tests__/TimePickerAndroid.spec.d.ts +0 -1
- package/types/components/TimePicker/__tests__/TimePickerIOS.spec.d.ts +0 -1
- package/types/components/Toast/__tests__/Toast.spec.d.ts +0 -1
- package/types/components/Toast/__tests__/ToastContainer.spec.d.ts +0 -1
- package/types/components/Toolbar/__tests__/ToolbarGroup.spec.d.ts +0 -1
- package/types/components/Toolbar/__tests__/ToolbarItem.spec.d.ts +0 -1
- package/types/components/Typography/Text/__tests__/StyledText.spec.d.ts +0 -1
- package/types/components/Typography/Text/__tests__/index.spec.d.ts +0 -1
- package/types/theme/__tests__/index.spec.d.ts +0 -1
- package/types/utils/__tests__/scale.spec.d.ts +0 -1
|
@@ -251,7 +251,7 @@ exports[`rendering renders correctly when disabled 1`] = `
|
|
|
251
251
|
Array [
|
|
252
252
|
Object {
|
|
253
253
|
"alignItems": "center",
|
|
254
|
-
"borderColor": "#
|
|
254
|
+
"borderColor": "#4d6265",
|
|
255
255
|
"borderRadius": 8,
|
|
256
256
|
"borderWidth": 1,
|
|
257
257
|
"height": 48,
|
|
@@ -268,8 +268,8 @@ exports[`rendering renders correctly when disabled 1`] = `
|
|
|
268
268
|
style={
|
|
269
269
|
Array [
|
|
270
270
|
Object {
|
|
271
|
-
"backgroundColor": "#
|
|
272
|
-
"borderColor": "#
|
|
271
|
+
"backgroundColor": "#4d6265",
|
|
272
|
+
"borderColor": "#4d6265",
|
|
273
273
|
"borderRadius": 999,
|
|
274
274
|
"borderWidth": 1,
|
|
275
275
|
"height": 16,
|
|
@@ -297,7 +297,7 @@ exports[`rendering renders correctly when disabled 1`] = `
|
|
|
297
297
|
Array [
|
|
298
298
|
Object {
|
|
299
299
|
"alignItems": "center",
|
|
300
|
-
"borderColor": "#
|
|
300
|
+
"borderColor": "#4d6265",
|
|
301
301
|
"borderRadius": 8,
|
|
302
302
|
"borderWidth": 1,
|
|
303
303
|
"height": 48,
|
|
@@ -314,8 +314,8 @@ exports[`rendering renders correctly when disabled 1`] = `
|
|
|
314
314
|
style={
|
|
315
315
|
Array [
|
|
316
316
|
Object {
|
|
317
|
-
"backgroundColor": "#
|
|
318
|
-
"borderColor": "#
|
|
317
|
+
"backgroundColor": "#4d6265",
|
|
318
|
+
"borderColor": "#4d6265",
|
|
319
319
|
"borderRadius": 999,
|
|
320
320
|
"borderWidth": 1,
|
|
321
321
|
"height": 16,
|
|
@@ -343,7 +343,7 @@ exports[`rendering renders correctly when disabled 1`] = `
|
|
|
343
343
|
Array [
|
|
344
344
|
Object {
|
|
345
345
|
"alignItems": "center",
|
|
346
|
-
"borderColor": "#
|
|
346
|
+
"borderColor": "#4d6265",
|
|
347
347
|
"borderRadius": 8,
|
|
348
348
|
"borderWidth": 1,
|
|
349
349
|
"height": 48,
|
|
@@ -360,7 +360,7 @@ exports[`rendering renders correctly when disabled 1`] = `
|
|
|
360
360
|
style={
|
|
361
361
|
Array [
|
|
362
362
|
Object {
|
|
363
|
-
"borderColor": "#
|
|
363
|
+
"borderColor": "#4d6265",
|
|
364
364
|
"borderRadius": 999,
|
|
365
365
|
"borderWidth": 1,
|
|
366
366
|
"height": 16,
|
|
@@ -388,7 +388,7 @@ exports[`rendering renders correctly when disabled 1`] = `
|
|
|
388
388
|
Array [
|
|
389
389
|
Object {
|
|
390
390
|
"alignItems": "center",
|
|
391
|
-
"borderColor": "#
|
|
391
|
+
"borderColor": "#4d6265",
|
|
392
392
|
"borderRadius": 8,
|
|
393
393
|
"borderWidth": 1,
|
|
394
394
|
"height": 48,
|
|
@@ -405,7 +405,7 @@ exports[`rendering renders correctly when disabled 1`] = `
|
|
|
405
405
|
style={
|
|
406
406
|
Array [
|
|
407
407
|
Object {
|
|
408
|
-
"borderColor": "#
|
|
408
|
+
"borderColor": "#4d6265",
|
|
409
409
|
"borderRadius": 999,
|
|
410
410
|
"borderWidth": 1,
|
|
411
411
|
"height": 16,
|
|
@@ -786,7 +786,7 @@ exports[`rendering renders correctly when there is error 1`] = `
|
|
|
786
786
|
Array [
|
|
787
787
|
Object {
|
|
788
788
|
"alignItems": "center",
|
|
789
|
-
"borderColor": "#
|
|
789
|
+
"borderColor": "#f46363",
|
|
790
790
|
"borderRadius": 8,
|
|
791
791
|
"borderWidth": 1,
|
|
792
792
|
"height": 48,
|
|
@@ -803,8 +803,8 @@ exports[`rendering renders correctly when there is error 1`] = `
|
|
|
803
803
|
style={
|
|
804
804
|
Array [
|
|
805
805
|
Object {
|
|
806
|
-
"backgroundColor": "#
|
|
807
|
-
"borderColor": "#
|
|
806
|
+
"backgroundColor": "#f46363",
|
|
807
|
+
"borderColor": "#f46363",
|
|
808
808
|
"borderRadius": 999,
|
|
809
809
|
"borderWidth": 1,
|
|
810
810
|
"height": 16,
|
|
@@ -832,7 +832,7 @@ exports[`rendering renders correctly when there is error 1`] = `
|
|
|
832
832
|
Array [
|
|
833
833
|
Object {
|
|
834
834
|
"alignItems": "center",
|
|
835
|
-
"borderColor": "#
|
|
835
|
+
"borderColor": "#f46363",
|
|
836
836
|
"borderRadius": 8,
|
|
837
837
|
"borderWidth": 1,
|
|
838
838
|
"height": 48,
|
|
@@ -849,8 +849,8 @@ exports[`rendering renders correctly when there is error 1`] = `
|
|
|
849
849
|
style={
|
|
850
850
|
Array [
|
|
851
851
|
Object {
|
|
852
|
-
"backgroundColor": "#
|
|
853
|
-
"borderColor": "#
|
|
852
|
+
"backgroundColor": "#f46363",
|
|
853
|
+
"borderColor": "#f46363",
|
|
854
854
|
"borderRadius": 999,
|
|
855
855
|
"borderWidth": 1,
|
|
856
856
|
"height": 16,
|
|
@@ -878,7 +878,7 @@ exports[`rendering renders correctly when there is error 1`] = `
|
|
|
878
878
|
Array [
|
|
879
879
|
Object {
|
|
880
880
|
"alignItems": "center",
|
|
881
|
-
"borderColor": "#
|
|
881
|
+
"borderColor": "#f46363",
|
|
882
882
|
"borderRadius": 8,
|
|
883
883
|
"borderWidth": 1,
|
|
884
884
|
"height": 48,
|
|
@@ -895,7 +895,7 @@ exports[`rendering renders correctly when there is error 1`] = `
|
|
|
895
895
|
style={
|
|
896
896
|
Array [
|
|
897
897
|
Object {
|
|
898
|
-
"borderColor": "#
|
|
898
|
+
"borderColor": "#f46363",
|
|
899
899
|
"borderRadius": 999,
|
|
900
900
|
"borderWidth": 1,
|
|
901
901
|
"height": 16,
|
|
@@ -923,7 +923,7 @@ exports[`rendering renders correctly when there is error 1`] = `
|
|
|
923
923
|
Array [
|
|
924
924
|
Object {
|
|
925
925
|
"alignItems": "center",
|
|
926
|
-
"borderColor": "#
|
|
926
|
+
"borderColor": "#f46363",
|
|
927
927
|
"borderRadius": 8,
|
|
928
928
|
"borderWidth": 1,
|
|
929
929
|
"height": 48,
|
|
@@ -940,7 +940,7 @@ exports[`rendering renders correctly when there is error 1`] = `
|
|
|
940
940
|
style={
|
|
941
941
|
Array [
|
|
942
942
|
Object {
|
|
943
|
-
"borderColor": "#
|
|
943
|
+
"borderColor": "#f46363",
|
|
944
944
|
"borderRadius": 999,
|
|
945
945
|
"borderWidth": 1,
|
|
946
946
|
"height": 16,
|
|
@@ -984,7 +984,7 @@ exports[`rendering renders correctly when there is error 1`] = `
|
|
|
984
984
|
style={
|
|
985
985
|
Array [
|
|
986
986
|
Object {
|
|
987
|
-
"color": "#
|
|
987
|
+
"color": "#f46363",
|
|
988
988
|
"fontFamily": "BeVietnamPro-Regular",
|
|
989
989
|
"fontSize": 12,
|
|
990
990
|
"paddingLeft": 4,
|
|
@@ -22,7 +22,7 @@ exports[`Progress.Bar renders correctly 1`] = `
|
|
|
22
22
|
style={
|
|
23
23
|
Object {
|
|
24
24
|
"alignSelf": "stretch",
|
|
25
|
-
"backgroundColor": "#
|
|
25
|
+
"backgroundColor": "#001f23",
|
|
26
26
|
"borderBottomRightRadius": 999,
|
|
27
27
|
"borderTopRightRadius": 999,
|
|
28
28
|
"flex": 1,
|
|
@@ -108,7 +108,7 @@ exports[`Progress.Circle renders correctly 1`] = `
|
|
|
108
108
|
style={
|
|
109
109
|
Array [
|
|
110
110
|
Object {
|
|
111
|
-
"backgroundColor": "#
|
|
111
|
+
"backgroundColor": "#001f23",
|
|
112
112
|
"borderRadius": 999,
|
|
113
113
|
"height": 72,
|
|
114
114
|
"width": 72,
|
|
@@ -200,7 +200,7 @@ exports[`Progress.Circle renders correctly 1`] = `
|
|
|
200
200
|
style={
|
|
201
201
|
Array [
|
|
202
202
|
Object {
|
|
203
|
-
"backgroundColor": "#
|
|
203
|
+
"backgroundColor": "#001f23",
|
|
204
204
|
"borderRadius": 999,
|
|
205
205
|
"height": 72,
|
|
206
206
|
"width": 72,
|
|
@@ -268,7 +268,7 @@ exports[`Progress.Circle renders correctly 1`] = `
|
|
|
268
268
|
style={
|
|
269
269
|
Array [
|
|
270
270
|
Object {
|
|
271
|
-
"backgroundColor": "#
|
|
271
|
+
"backgroundColor": "#001f23",
|
|
272
272
|
"borderRadius": 999,
|
|
273
273
|
"height": 5.3999999999999995,
|
|
274
274
|
"left": 33.3,
|
|
@@ -305,7 +305,7 @@ exports[`Progress.Circle renders correctly 1`] = `
|
|
|
305
305
|
style={
|
|
306
306
|
Array [
|
|
307
307
|
Object {
|
|
308
|
-
"backgroundColor": "#
|
|
308
|
+
"backgroundColor": "#001f23",
|
|
309
309
|
"borderRadius": 999,
|
|
310
310
|
"height": 5.3999999999999995,
|
|
311
311
|
"left": 33.3,
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`RefreshControl render correctly with props 1`] = `
|
|
4
|
+
<RCTScrollView
|
|
5
|
+
contentContainerStyle={
|
|
6
|
+
Object {
|
|
7
|
+
"flex": 1,
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
refreshControl={
|
|
11
|
+
<RefreshControl
|
|
12
|
+
onRefresh={[MockFunction]}
|
|
13
|
+
progressViewOffset={100}
|
|
14
|
+
refreshing={true}
|
|
15
|
+
/>
|
|
16
|
+
}
|
|
17
|
+
>
|
|
18
|
+
<RCTRefreshControl />
|
|
19
|
+
<View>
|
|
20
|
+
<Text>
|
|
21
|
+
Pull down to see RefreshControl indicator
|
|
22
|
+
</Text>
|
|
23
|
+
</View>
|
|
24
|
+
</RCTScrollView>
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
exports[`RefreshControl renders correctly when refreshing is false 1`] = `
|
|
28
|
+
<RCTScrollView
|
|
29
|
+
contentContainerStyle={
|
|
30
|
+
Object {
|
|
31
|
+
"flex": 1,
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
refreshControl={
|
|
35
|
+
<RefreshControl
|
|
36
|
+
refreshing={false}
|
|
37
|
+
/>
|
|
38
|
+
}
|
|
39
|
+
>
|
|
40
|
+
<RCTRefreshControl />
|
|
41
|
+
<View>
|
|
42
|
+
<Text>
|
|
43
|
+
Pull down to see RefreshControl indicator
|
|
44
|
+
</Text>
|
|
45
|
+
</View>
|
|
46
|
+
</RCTScrollView>
|
|
47
|
+
`;
|
|
48
|
+
|
|
49
|
+
exports[`RefreshControl renders correctly when refreshing is true 1`] = `
|
|
50
|
+
<RCTScrollView
|
|
51
|
+
contentContainerStyle={
|
|
52
|
+
Object {
|
|
53
|
+
"flex": 1,
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
refreshControl={
|
|
57
|
+
<RefreshControl
|
|
58
|
+
refreshing={true}
|
|
59
|
+
/>
|
|
60
|
+
}
|
|
61
|
+
>
|
|
62
|
+
<RCTRefreshControl />
|
|
63
|
+
<View>
|
|
64
|
+
<Text>
|
|
65
|
+
Pull down to see RefreshControl indicator
|
|
66
|
+
</Text>
|
|
67
|
+
</View>
|
|
68
|
+
</RCTScrollView>
|
|
69
|
+
`;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React, { ReactElement } from 'react';
|
|
2
|
+
import { ScrollView, Text } from 'react-native';
|
|
3
|
+
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
4
|
+
import RefreshControl from '..';
|
|
5
|
+
|
|
6
|
+
const ExampleList = ({
|
|
7
|
+
refreshControl,
|
|
8
|
+
}: {
|
|
9
|
+
refreshControl: ReactElement;
|
|
10
|
+
}): ReactElement => {
|
|
11
|
+
return (
|
|
12
|
+
<ScrollView
|
|
13
|
+
contentContainerStyle={{
|
|
14
|
+
flex: 1,
|
|
15
|
+
}}
|
|
16
|
+
refreshControl={refreshControl}
|
|
17
|
+
>
|
|
18
|
+
<Text>
|
|
19
|
+
Pull down to see RefreshControl indicator
|
|
20
|
+
</Text>
|
|
21
|
+
</ScrollView>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
describe('RefreshControl', () => {
|
|
26
|
+
it.each`
|
|
27
|
+
refreshing
|
|
28
|
+
${true}
|
|
29
|
+
${false}
|
|
30
|
+
`('renders correctly when refreshing is $refreshing', ({ refreshing }) => {
|
|
31
|
+
const { toJSON } = renderWithTheme(
|
|
32
|
+
<ExampleList
|
|
33
|
+
refreshControl={<RefreshControl refreshing={refreshing} />}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
expect(toJSON()).toMatchSnapshot();
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('render correctly with props', () => {
|
|
41
|
+
const { toJSON } = renderWithTheme(
|
|
42
|
+
<ExampleList
|
|
43
|
+
refreshControl={
|
|
44
|
+
<RefreshControl
|
|
45
|
+
refreshing
|
|
46
|
+
progressViewOffset={100}
|
|
47
|
+
onRefresh={jest.fn()}
|
|
48
|
+
/>
|
|
49
|
+
}
|
|
50
|
+
/>
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
expect(toJSON()).toMatchSnapshot();
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
RefreshControl as NativeRefreshControl,
|
|
4
|
+
RefreshControlProps as NativeRefreshControlProps,
|
|
5
|
+
} from 'react-native';
|
|
6
|
+
import { useTheme } from '../../theme';
|
|
7
|
+
|
|
8
|
+
export interface RefreshControlProps
|
|
9
|
+
extends Omit<NativeRefreshControlProps, 'colors' | 'tintColor'> {}
|
|
10
|
+
|
|
11
|
+
const RefreshControl = ({ ...props }: RefreshControlProps) => {
|
|
12
|
+
const theme = useTheme();
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<NativeRefreshControl
|
|
16
|
+
{...props}
|
|
17
|
+
colors={[theme.__hd__.refreshControl.colors.indicator]}
|
|
18
|
+
tintColor={theme.__hd__.refreshControl.colors.indicator}
|
|
19
|
+
/>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default RefreshControl;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useTheme } from '@emotion/react';
|
|
1
2
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
2
3
|
import { View } from 'react-native';
|
|
3
4
|
import { emitter } from './EditorEvent';
|
|
@@ -5,7 +6,12 @@ import * as Events from './utils/events';
|
|
|
5
6
|
|
|
6
7
|
const isEmptyString = (s: string | null): boolean => !s || s.length === 0;
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
interface OnSelectOptionsType<TMetaData> {
|
|
10
|
+
highlighted: boolean;
|
|
11
|
+
meta?: TMetaData;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface MentionListProps<TMetaData = unknown> {
|
|
9
15
|
/**
|
|
10
16
|
* Unique name used to communicate with webview, should be the same with the RichTextEditor component it used with
|
|
11
17
|
*/
|
|
@@ -15,17 +21,19 @@ export interface MentionListProps {
|
|
|
15
21
|
*/
|
|
16
22
|
render: (
|
|
17
23
|
searchText: string,
|
|
18
|
-
onSelect: (id: string, name: string) => void
|
|
24
|
+
onSelect: (id: string, name: string, options?: OnSelectOptionsType<TMetaData>) => void
|
|
19
25
|
) => JSX.Element;
|
|
20
26
|
}
|
|
21
27
|
|
|
22
|
-
const MentionList = ({ name: eventPrefix, render }: MentionListProps) => {
|
|
28
|
+
const MentionList = <TMetaData, >({ name: eventPrefix, render }: MentionListProps<TMetaData>) => {
|
|
29
|
+
const theme = useTheme();
|
|
23
30
|
const [search, setSearch] = useState<string>('');
|
|
24
31
|
const [target, setTarget] = useState<string | null>(null);
|
|
25
32
|
const normalizeEventName = useCallback(
|
|
26
33
|
(event: string) => `${eventPrefix}/${event}`,
|
|
27
34
|
[eventPrefix]
|
|
28
35
|
);
|
|
36
|
+
|
|
29
37
|
useEffect(() => {
|
|
30
38
|
const removeMentionSearchListener = Events.on(
|
|
31
39
|
emitter,
|
|
@@ -53,11 +61,24 @@ const MentionList = ({ name: eventPrefix, render }: MentionListProps) => {
|
|
|
53
61
|
|
|
54
62
|
return (
|
|
55
63
|
<View>
|
|
56
|
-
{render(search, (id, name) => {
|
|
64
|
+
{render(search, (id, name, options = { highlighted: false }) => {
|
|
65
|
+
const { highlighted, meta } = options;
|
|
66
|
+
|
|
67
|
+
const highlightStyle = {
|
|
68
|
+
color: theme.colors.secondary,
|
|
69
|
+
borderRadius: theme.__hd__.richTextEditor.radii.mention,
|
|
70
|
+
padding: highlighted ? theme.__hd__.richTextEditor.space.mention : 0,
|
|
71
|
+
background: highlighted ? theme.colors.lightHighlightedSurface : 'transparent',
|
|
72
|
+
marginTop: theme.space.xxsmall,
|
|
73
|
+
marginBottom: theme.space.xxsmall,
|
|
74
|
+
display: 'inline-flex',
|
|
75
|
+
};
|
|
57
76
|
const data = {
|
|
58
77
|
id,
|
|
59
78
|
name,
|
|
60
79
|
target,
|
|
80
|
+
meta,
|
|
81
|
+
style: highlightStyle,
|
|
61
82
|
};
|
|
62
83
|
|
|
63
84
|
Events.emit(emitter, normalizeEventName('mention-apply'), data);
|
|
@@ -20,6 +20,7 @@ import Icon from '../Icon';
|
|
|
20
20
|
import {
|
|
21
21
|
StyledAsteriskLabel,
|
|
22
22
|
StyledAsteriskLabelInsideTextInput,
|
|
23
|
+
StyledBorderBackDrop,
|
|
23
24
|
StyledContainer,
|
|
24
25
|
StyledError,
|
|
25
26
|
StyledErrorAndHelpTextContainer,
|
|
@@ -309,8 +310,9 @@ const RichTextEditor: ComponentType<RichTextEditorProps> = ({
|
|
|
309
310
|
);
|
|
310
311
|
|
|
311
312
|
return (
|
|
312
|
-
<StyledContainer testID={testID}
|
|
313
|
+
<StyledContainer testID={testID}>
|
|
313
314
|
<StyledTextInputContainer>
|
|
315
|
+
<StyledBorderBackDrop themeVariant={variant} />
|
|
314
316
|
{(isFocused || (label && !isEmptyValue)) && (
|
|
315
317
|
<StyledLabelContainer pointerEvents="none">
|
|
316
318
|
{required && (
|
|
@@ -96,7 +96,7 @@ describe('EditorToolbar', () => {
|
|
|
96
96
|
|
|
97
97
|
fireEvent(wrapper.getByTestId(testID), 'press');
|
|
98
98
|
expect(wrapper.getByTestId(testID)).toHaveStyle({
|
|
99
|
-
backgroundColor: theme.colors.
|
|
99
|
+
backgroundColor: theme.colors.lightHighlightedSurface,
|
|
100
100
|
});
|
|
101
101
|
});
|
|
102
102
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { FlatList, Text } from 'react-native';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
|
|
4
|
-
import { act, fireEvent, render } from '@testing-library/react-native';
|
|
5
1
|
import type { RenderAPI } from '@testing-library/react-native';
|
|
6
|
-
import
|
|
2
|
+
import { act, fireEvent, render } from '@testing-library/react-native';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { FlatList, Text } from 'react-native';
|
|
5
|
+
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
7
6
|
import { emitter as editorEventEmitter } from '../EditorEvent';
|
|
7
|
+
import MentionList from '../MentionList';
|
|
8
8
|
import * as Events from '../utils/events';
|
|
9
9
|
|
|
10
10
|
const SuggestionListData: Array<{ id: string; name: string }> = [
|
|
@@ -56,7 +56,7 @@ describe('MentionList', () => {
|
|
|
56
56
|
let wrapper: RenderAPI;
|
|
57
57
|
|
|
58
58
|
beforeEach(() => {
|
|
59
|
-
wrapper =
|
|
59
|
+
wrapper = renderWithTheme(
|
|
60
60
|
<MentionList
|
|
61
61
|
name="give-shout-out"
|
|
62
62
|
render={(
|
|
@@ -5,16 +5,12 @@ exports[`RichTextEditor onMessage recevied event editor-layout should update hei
|
|
|
5
5
|
style={
|
|
6
6
|
Array [
|
|
7
7
|
Object {
|
|
8
|
-
"borderColor": "#de350b",
|
|
9
|
-
"borderRadius": 8,
|
|
10
|
-
"borderWidth": 1,
|
|
11
8
|
"marginVertical": 8,
|
|
12
9
|
"width": "100%",
|
|
13
10
|
},
|
|
14
11
|
undefined,
|
|
15
12
|
]
|
|
16
13
|
}
|
|
17
|
-
themeVariant="error"
|
|
18
14
|
>
|
|
19
15
|
<View
|
|
20
16
|
style={
|
|
@@ -28,6 +24,24 @@ exports[`RichTextEditor onMessage recevied event editor-layout should update hei
|
|
|
28
24
|
]
|
|
29
25
|
}
|
|
30
26
|
>
|
|
27
|
+
<View
|
|
28
|
+
style={
|
|
29
|
+
Array [
|
|
30
|
+
Object {
|
|
31
|
+
"borderColor": "#f46363",
|
|
32
|
+
"borderRadius": 8,
|
|
33
|
+
"borderWidth": 1,
|
|
34
|
+
"bottom": 0,
|
|
35
|
+
"left": 0,
|
|
36
|
+
"position": "absolute",
|
|
37
|
+
"right": 0,
|
|
38
|
+
"top": 0,
|
|
39
|
+
},
|
|
40
|
+
undefined,
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
themeVariant="error"
|
|
44
|
+
/>
|
|
31
45
|
<View
|
|
32
46
|
style={
|
|
33
47
|
Array [
|
|
@@ -225,7 +239,7 @@ exports[`RichTextEditor onMessage recevied event editor-layout should update hei
|
|
|
225
239
|
},
|
|
226
240
|
Array [
|
|
227
241
|
Object {
|
|
228
|
-
"color": "#
|
|
242
|
+
"color": "#f46363",
|
|
229
243
|
"fontSize": 12,
|
|
230
244
|
"marginLeft": 4,
|
|
231
245
|
},
|
|
@@ -251,16 +265,12 @@ exports[`RichTextEditor should render correctly 1`] = `
|
|
|
251
265
|
style={
|
|
252
266
|
Array [
|
|
253
267
|
Object {
|
|
254
|
-
"borderColor": "#de350b",
|
|
255
|
-
"borderRadius": 8,
|
|
256
|
-
"borderWidth": 1,
|
|
257
268
|
"marginVertical": 8,
|
|
258
269
|
"width": "100%",
|
|
259
270
|
},
|
|
260
271
|
undefined,
|
|
261
272
|
]
|
|
262
273
|
}
|
|
263
|
-
themeVariant="error"
|
|
264
274
|
>
|
|
265
275
|
<View
|
|
266
276
|
style={
|
|
@@ -274,6 +284,24 @@ exports[`RichTextEditor should render correctly 1`] = `
|
|
|
274
284
|
]
|
|
275
285
|
}
|
|
276
286
|
>
|
|
287
|
+
<View
|
|
288
|
+
style={
|
|
289
|
+
Array [
|
|
290
|
+
Object {
|
|
291
|
+
"borderColor": "#f46363",
|
|
292
|
+
"borderRadius": 8,
|
|
293
|
+
"borderWidth": 1,
|
|
294
|
+
"bottom": 0,
|
|
295
|
+
"left": 0,
|
|
296
|
+
"position": "absolute",
|
|
297
|
+
"right": 0,
|
|
298
|
+
"top": 0,
|
|
299
|
+
},
|
|
300
|
+
undefined,
|
|
301
|
+
]
|
|
302
|
+
}
|
|
303
|
+
themeVariant="error"
|
|
304
|
+
/>
|
|
277
305
|
<View
|
|
278
306
|
style={
|
|
279
307
|
Array [
|
|
@@ -470,7 +498,7 @@ exports[`RichTextEditor should render correctly 1`] = `
|
|
|
470
498
|
},
|
|
471
499
|
Array [
|
|
472
500
|
Object {
|
|
473
|
-
"color": "#
|
|
501
|
+
"color": "#f46363",
|
|
474
502
|
"fontSize": 12,
|
|
475
503
|
"marginLeft": 4,
|
|
476
504
|
},
|