@hero-design/rn 7.27.1 → 8.0.0-rc.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/.expo/README.md +15 -0
- package/.expo/packager-info.json +10 -0
- package/.expo/prebuild/cached-packages.json +4 -0
- package/.expo/settings.json +10 -0
- package/.expo/xcodebuild-error.log +2 -0
- package/.expo/xcodebuild.log +11199 -0
- package/.turbo/turbo-build.log +9 -9
- package/.turbo/turbo-build:types.log +2 -0
- package/.turbo/turbo-build:watch.log +1 -0
- package/.turbo/turbo-lint.log +96 -0
- package/.turbo/turbo-test.log +909 -0
- package/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/es/index.js +139 -89
- package/lib/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/lib/index.js +138 -88
- package/package.json +4 -4
- package/src/components/Alert/index.tsx +43 -31
- package/src/components/BottomSheet/Header.tsx +1 -1
- package/src/components/BottomSheet/StyledBottomSheet.tsx +1 -1
- package/src/components/BottomSheet/__tests__/__snapshots__/index.spec.tsx.snap +14 -14
- package/src/components/Button/Button.tsx +7 -0
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +7 -7
- package/src/components/Empty/StyledEmpty.tsx +1 -1
- package/src/components/Empty/__tests__/__snapshots__/index.spec.tsx.snap +10 -10
- package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
- package/src/components/FAB/ActionGroup/index.tsx +1 -1
- package/src/components/FAB/__tests__/index.spec.tsx +4 -4
- package/src/components/Icon/HeroIcon/glyphMap.json +1 -1
- package/src/components/Icon/IconList.ts +1 -0
- package/src/components/Icon/index.tsx +12 -2
- package/src/components/List/ListItem.tsx +2 -2
- package/src/components/List/StyledListItem.tsx +1 -1
- package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +2 -2
- package/src/components/RichTextEditor/MentionList.tsx +1 -1
- package/src/components/RichTextEditor/StyledToolbar.ts +1 -1
- package/src/components/RichTextEditor/__tests__/EditorToolbar.spec.tsx +1 -1
- package/src/components/Select/{StyledOptionList.tsx → BaseOptionList.tsx} +6 -6
- package/src/components/Select/MultiSelect/Option.tsx +24 -11
- package/src/components/Select/MultiSelect/OptionList.tsx +3 -2
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/Option.spec.tsx.snap +3 -2
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +47 -21
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +99 -72
- package/src/components/Select/MultiSelect/index.tsx +16 -0
- package/src/components/Select/SingleSelect/Option.tsx +12 -12
- package/src/components/Select/SingleSelect/OptionList.tsx +3 -2
- package/src/components/Select/SingleSelect/StyledSingleSelect.tsx +6 -0
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/Option.spec.tsx.snap +0 -1
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +32 -16
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +65 -54
- package/src/components/Select/SingleSelect/index.tsx +16 -0
- package/src/components/Select/StyledSelect.tsx +12 -2
- package/src/components/Select/types.ts +1 -0
- package/src/components/Switch/index.tsx +9 -1
- package/src/components/Tabs/ScrollableTabs.tsx +1 -1
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +9 -3
- package/src/components/Tabs/index.tsx +6 -0
- package/src/components/Tag/index.tsx +25 -17
- package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
- package/src/components/TextInput/__tests__/index.spec.tsx +1 -1
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +7 -7
- package/src/components/Toast/ToastContainer.tsx +1 -1
- package/src/components/Toast/ToastProvider.tsx +10 -1
- package/src/components/Toast/__tests__/ToastContainer.spec.tsx +5 -5
- package/src/components/Toast/__tests__/__snapshots__/ToastContainer.spec.tsx.snap +4 -4
- package/src/components/Typography/Text/StyledText.tsx +2 -1
- package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +1 -1
- package/src/components/Typography/Text/index.tsx +2 -1
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +26 -18
- package/src/theme/components/avatar.ts +1 -1
- package/src/theme/components/bottomSheet.ts +5 -5
- package/src/theme/components/empty.ts +6 -5
- package/src/theme/components/fab.ts +1 -1
- package/src/theme/components/select.ts +3 -1
- package/src/theme/components/typography.ts +2 -0
- package/src/theme/global/colors/global.ts +1 -0
- package/src/theme/global/colors/types.ts +1 -0
- package/src/theme/global/scale.ts +1 -1
- package/src/theme/global/typography.ts +4 -1
- package/src/utils/hooks.ts +3 -1
- package/types/components/Accordion/AccordionItem.d.ts +0 -0
- package/types/components/Accordion/StyledAccordion.d.ts +0 -0
- package/types/components/Accordion/index.d.ts +0 -0
- package/types/components/Accordion/utils.d.ts +1 -0
- package/types/components/Alert/StyledAlert.d.ts +0 -0
- package/types/components/Alert/index.d.ts +2 -1
- package/types/components/Attachment/StyledAttachment.d.ts +0 -0
- package/types/components/Attachment/index.d.ts +0 -0
- package/types/components/Avatar/Avatar.d.ts +0 -0
- package/types/components/Avatar/AvatarStack/StyledAvatarStack.d.ts +0 -0
- package/types/components/Avatar/AvatarStack/index.d.ts +0 -0
- package/types/components/Avatar/AvatarStack/utils.d.ts +0 -0
- package/types/components/Avatar/StyledAvatar.d.ts +0 -0
- package/types/components/Avatar/index.d.ts +0 -0
- package/types/components/Badge/Status.d.ts +0 -0
- package/types/components/Badge/StyledBadge.d.ts +0 -0
- package/types/components/Badge/index.d.ts +0 -0
- package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +0 -0
- package/types/components/BottomNavigation/index.d.ts +0 -0
- package/types/components/BottomSheet/Footer.d.ts +0 -0
- package/types/components/BottomSheet/Header.d.ts +0 -0
- package/types/components/BottomSheet/StyledBottomSheet.d.ts +0 -0
- package/types/components/BottomSheet/index.d.ts +0 -0
- package/types/components/Box/StyledBox.d.ts +0 -0
- package/types/components/Box/config.d.ts +0 -0
- package/types/components/Box/index.d.ts +0 -0
- package/types/components/Box/types.d.ts +0 -0
- package/types/components/Button/Button.d.ts +0 -0
- package/types/components/Button/IconButton.d.ts +0 -0
- package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +0 -0
- package/types/components/Button/LoadingIndicator/index.d.ts +0 -0
- package/types/components/Button/StyledButton.d.ts +0 -0
- package/types/components/Button/UtilityButton/StyledUtilityButton.d.ts +0 -0
- package/types/components/Button/UtilityButton/index.d.ts +0 -0
- package/types/components/Button/index.d.ts +0 -0
- package/types/components/Calendar/CalendarRowItem.d.ts +0 -0
- package/types/components/Calendar/StyledCalendar.d.ts +0 -0
- package/types/components/Calendar/helpers.d.ts +0 -0
- package/types/components/Calendar/index.d.ts +0 -0
- package/types/components/Card/DataCard/StyledDataCard.d.ts +0 -0
- package/types/components/Card/DataCard/index.d.ts +0 -0
- package/types/components/Card/StyledCard.d.ts +0 -0
- package/types/components/Card/index.d.ts +0 -0
- package/types/components/Checkbox/StyledCheckbox.d.ts +0 -0
- package/types/components/Checkbox/index.d.ts +0 -0
- package/types/components/Collapse/StyledCollapse.d.ts +0 -0
- package/types/components/Collapse/index.d.ts +0 -0
- package/types/components/ContentNavigator/StyledContentNavigator.d.ts +0 -0
- package/types/components/ContentNavigator/index.d.ts +0 -0
- package/types/components/DatePicker/DatePickerAndroid.d.ts +0 -0
- package/types/components/DatePicker/DatePickerIOS.d.ts +0 -0
- package/types/components/DatePicker/StyledDatePicker.d.ts +0 -0
- package/types/components/DatePicker/index.d.ts +0 -0
- package/types/components/DatePicker/types.d.ts +0 -0
- package/types/components/Divider/StyledDivider.d.ts +0 -0
- package/types/components/Divider/index.d.ts +0 -0
- package/types/components/Drawer/DragableDrawer/helpers.d.ts +0 -0
- package/types/components/Drawer/DragableDrawer/index.d.ts +0 -0
- package/types/components/Drawer/StyledDrawer.d.ts +0 -0
- package/types/components/Drawer/index.d.ts +0 -0
- package/types/components/Empty/StyledEmpty.d.ts +0 -0
- package/types/components/Empty/index.d.ts +0 -0
- package/types/components/FAB/ActionGroup/ActionItem.d.ts +0 -0
- package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +0 -0
- package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +0 -0
- package/types/components/FAB/ActionGroup/index.d.ts +0 -0
- package/types/components/FAB/AnimatedFABIcon.d.ts +0 -0
- package/types/components/FAB/FAB.d.ts +0 -0
- package/types/components/FAB/StyledFAB.d.ts +0 -0
- package/types/components/FAB/index.d.ts +0 -0
- package/types/components/Icon/AnimatedIcon.d.ts +0 -0
- package/types/components/Icon/HeroIcon/index.d.ts +0 -0
- 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/Image/index.d.ts +0 -0
- package/types/components/List/BasicListItem.d.ts +0 -0
- package/types/components/List/ListItem.d.ts +2 -2
- package/types/components/List/StyledBasicListItem.d.ts +0 -0
- package/types/components/List/StyledListItem.d.ts +0 -0
- package/types/components/List/index.d.ts +0 -0
- package/types/components/PinInput/PinCell.d.ts +0 -0
- package/types/components/PinInput/StyledPinInput.d.ts +0 -0
- package/types/components/PinInput/index.d.ts +0 -0
- package/types/components/Progress/ProgressBar.d.ts +0 -0
- package/types/components/Progress/ProgressCircle.d.ts +0 -0
- package/types/components/Progress/StyledProgressBar.d.ts +0 -0
- package/types/components/Progress/StyledProgressCircle.d.ts +0 -0
- package/types/components/Progress/__tests__/index.spec.d.ts +0 -0
- package/types/components/Progress/constants.d.ts +0 -0
- package/types/components/Progress/index.d.ts +0 -0
- package/types/components/Progress/types.d.ts +0 -0
- package/types/components/Radio/Radio.d.ts +0 -0
- package/types/components/Radio/RadioGroup.d.ts +0 -0
- package/types/components/Radio/StyledRadio.d.ts +0 -0
- package/types/components/Radio/index.d.ts +0 -0
- package/types/components/Radio/types.d.ts +0 -0
- package/types/components/RefreshControl/index.d.ts +0 -0
- package/types/components/RichTextEditor/EditorEvent.d.ts +0 -0
- package/types/components/RichTextEditor/EditorToolbar.d.ts +0 -0
- package/types/components/RichTextEditor/MentionList.d.ts +0 -0
- package/types/components/RichTextEditor/RichTextEditor.d.ts +0 -0
- package/types/components/RichTextEditor/StyledRichTextEditor.d.ts +0 -0
- package/types/components/RichTextEditor/StyledToolbar.d.ts +0 -0
- package/types/components/RichTextEditor/__mocks__/heroEditorApp.d.ts +0 -0
- package/types/components/RichTextEditor/constants.d.ts +0 -0
- package/types/components/RichTextEditor/heroEditorApp.d.ts +0 -0
- package/types/components/RichTextEditor/index.d.ts +0 -0
- package/types/components/RichTextEditor/types.d.ts +0 -0
- package/types/components/RichTextEditor/utils/events.d.ts +0 -0
- package/types/components/RichTextEditor/utils/rnWebView.d.ts +0 -0
- package/types/components/SectionHeading/StyledHeading.d.ts +0 -0
- package/types/components/SectionHeading/index.d.ts +0 -0
- package/types/components/Select/BaseOptionList.d.ts +12 -0
- package/types/components/Select/Footer.d.ts +0 -0
- package/types/components/Select/MultiSelect/Option.d.ts +2 -1
- package/types/components/Select/MultiSelect/OptionList.d.ts +0 -0
- package/types/components/Select/MultiSelect/index.d.ts +0 -0
- package/types/components/Select/SingleSelect/Option.d.ts +2 -1
- package/types/components/Select/SingleSelect/OptionList.d.ts +0 -0
- package/types/components/Select/SingleSelect/StyledSingleSelect.d.ts +1 -0
- package/types/components/Select/SingleSelect/index.d.ts +0 -0
- package/types/components/Select/StyledOptionList.d.ts +0 -0
- package/types/components/Select/StyledSelect.d.ts +3 -2
- package/types/components/Select/helpers.d.ts +0 -0
- package/types/components/Select/index.d.ts +0 -0
- package/types/components/Select/types.d.ts +1 -0
- package/types/components/Slider/index.d.ts +0 -0
- package/types/components/Spinner/AnimatedSpinner.d.ts +0 -0
- package/types/components/Spinner/StyledSpinner.d.ts +0 -0
- package/types/components/Spinner/index.d.ts +0 -0
- package/types/components/Swipeable/StyledSwipeable.d.ts +0 -0
- package/types/components/Swipeable/SwipeableAction.d.ts +0 -0
- package/types/components/Swipeable/index.d.ts +0 -0
- package/types/components/Switch/SelectorSwitch/Option.d.ts +0 -0
- package/types/components/Switch/SelectorSwitch/StyledSelectorSwitch.d.ts +0 -0
- package/types/components/Switch/SelectorSwitch/index.d.ts +0 -0
- package/types/components/Switch/StyledSwitch.d.ts +0 -0
- package/types/components/Switch/index.d.ts +1 -1
- package/types/components/Tabs/ActiveTabIndicator.d.ts +0 -0
- package/types/components/Tabs/ScrollableTabs.d.ts +0 -0
- package/types/components/Tabs/StyledScrollableTabs.d.ts +0 -0
- package/types/components/Tabs/StyledTabs.d.ts +0 -0
- package/types/components/Tabs/TabWithBadge.d.ts +0 -0
- package/types/components/Tabs/index.d.ts +0 -0
- package/types/components/Tabs/utils.d.ts +0 -0
- package/types/components/Tag/StyledTag.d.ts +0 -0
- package/types/components/Tag/index.d.ts +0 -0
- package/types/components/TextInput/StyledTextInput.d.ts +0 -0
- package/types/components/TextInput/index.d.ts +0 -0
- package/types/components/TimePicker/StyledTimePicker.d.ts +0 -0
- package/types/components/TimePicker/TimePickerAndroid.d.ts +0 -0
- package/types/components/TimePicker/TimePickerIOS.d.ts +0 -0
- package/types/components/TimePicker/index.d.ts +0 -0
- package/types/components/TimePicker/types.d.ts +0 -0
- package/types/components/Toast/StyledToast.d.ts +0 -0
- package/types/components/Toast/Toast.d.ts +0 -0
- package/types/components/Toast/ToastContainer.d.ts +0 -0
- package/types/components/Toast/ToastContext.d.ts +0 -0
- package/types/components/Toast/ToastProvider.d.ts +1 -1
- package/types/components/Toast/index.d.ts +1 -1
- package/types/components/Toast/types.d.ts +0 -0
- package/types/components/Toolbar/StyledToolbar.d.ts +0 -0
- package/types/components/Toolbar/ToolbarGroup.d.ts +0 -0
- package/types/components/Toolbar/ToolbarItem.d.ts +0 -0
- package/types/components/Toolbar/index.d.ts +0 -0
- package/types/components/Typography/Text/StyledText.d.ts +1 -1
- package/types/components/Typography/Text/index.d.ts +1 -1
- package/types/components/Typography/index.d.ts +0 -0
- package/types/index.d.ts +0 -0
- package/types/testHelpers/renderWithTheme.d.ts +0 -0
- package/types/theme/ThemeProvider.d.ts +0 -0
- package/types/theme/ThemeSwitcher.d.ts +0 -0
- package/types/theme/components/accordion.d.ts +0 -0
- package/types/theme/components/alert.d.ts +0 -0
- package/types/theme/components/attachment.d.ts +0 -0
- package/types/theme/components/avatar.d.ts +0 -0
- package/types/theme/components/badge.d.ts +0 -0
- package/types/theme/components/bottomNavigation.d.ts +0 -0
- package/types/theme/components/bottomSheet.d.ts +0 -0
- package/types/theme/components/button.d.ts +0 -0
- package/types/theme/components/calendar.d.ts +0 -0
- package/types/theme/components/card.d.ts +0 -0
- package/types/theme/components/checkbox.d.ts +0 -0
- package/types/theme/components/contentNavigator.d.ts +0 -0
- package/types/theme/components/datePicker.d.ts +0 -0
- package/types/theme/components/divider.d.ts +0 -0
- package/types/theme/components/drawer.d.ts +0 -0
- package/types/theme/components/empty.d.ts +1 -0
- package/types/theme/components/fab.d.ts +0 -0
- package/types/theme/components/icon.d.ts +0 -0
- package/types/theme/components/image.d.ts +0 -0
- package/types/theme/components/list.d.ts +0 -0
- package/types/theme/components/pinInput.d.ts +0 -0
- package/types/theme/components/progress.d.ts +0 -0
- package/types/theme/components/radio.d.ts +0 -0
- package/types/theme/components/refreshControl.d.ts +0 -0
- package/types/theme/components/richTextEditor.d.ts +0 -0
- package/types/theme/components/sectionHeading.d.ts +0 -0
- package/types/theme/components/select.d.ts +3 -1
- package/types/theme/components/slider.d.ts +0 -0
- package/types/theme/components/spinner.d.ts +0 -0
- package/types/theme/components/swipeable.d.ts +0 -0
- package/types/theme/components/switch.d.ts +0 -0
- package/types/theme/components/tabs.d.ts +0 -0
- package/types/theme/components/tag.d.ts +0 -0
- package/types/theme/components/textInput.d.ts +0 -0
- package/types/theme/components/timePicker.d.ts +0 -0
- package/types/theme/components/toast.d.ts +0 -0
- package/types/theme/components/toolbar.d.ts +0 -0
- package/types/theme/components/typography.d.ts +2 -0
- package/types/theme/getTheme.d.ts +0 -0
- package/types/theme/global/borders.d.ts +0 -0
- package/types/theme/global/colors/eBens.d.ts +0 -0
- package/types/theme/global/colors/global.d.ts +0 -0
- package/types/theme/global/colors/jobs.d.ts +0 -0
- package/types/theme/global/colors/legacySystemPalette.d.ts +0 -0
- package/types/theme/global/colors/swag.d.ts +0 -0
- package/types/theme/global/colors/types.d.ts +1 -0
- package/types/theme/global/colors/wallet.d.ts +0 -0
- package/types/theme/global/colors/work.d.ts +0 -0
- package/types/theme/global/index.d.ts +1 -0
- package/types/theme/global/scale.d.ts +0 -0
- package/types/theme/global/sizes.d.ts +0 -0
- package/types/theme/global/space.d.ts +0 -0
- package/types/theme/global/typography.d.ts +1 -0
- package/types/theme/index.d.ts +0 -0
- package/types/theme/utils.d.ts +2 -0
- package/types/types.d.ts +0 -0
- package/types/utils/functions.d.ts +0 -0
- package/types/utils/helpers.d.ts +0 -0
- package/types/utils/hooks.d.ts +0 -0
- package/types/utils/scale.d.ts +0 -0
|
@@ -7,6 +7,7 @@ import type { ReactElement } from 'react';
|
|
|
7
7
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
8
8
|
import { StyledKnot, StyledWrapper, Variant } from './StyledSwitch';
|
|
9
9
|
import SelectorSwitch from './SelectorSwitch';
|
|
10
|
+
import { useDeprecation } from '../../utils/hooks';
|
|
10
11
|
|
|
11
12
|
export interface SwitchProps {
|
|
12
13
|
/**
|
|
@@ -50,16 +51,23 @@ const getVariant = ({
|
|
|
50
51
|
};
|
|
51
52
|
|
|
52
53
|
const Switch = ({
|
|
53
|
-
size
|
|
54
|
+
size: _size,
|
|
54
55
|
disabled = false,
|
|
55
56
|
checked = false,
|
|
56
57
|
onPress,
|
|
57
58
|
style,
|
|
58
59
|
testID,
|
|
59
60
|
}: SwitchProps): ReactElement => {
|
|
61
|
+
const size: SwitchProps['size'] = _size === undefined ? 'medium' : _size;
|
|
62
|
+
|
|
60
63
|
const theme = useTheme();
|
|
61
64
|
const variant = getVariant({ disabled, checked });
|
|
62
65
|
|
|
66
|
+
useDeprecation(
|
|
67
|
+
"Switch's size prop will be removed in the next major release.",
|
|
68
|
+
_size !== undefined
|
|
69
|
+
);
|
|
70
|
+
|
|
63
71
|
const offset = checked
|
|
64
72
|
? (theme.__hd__.switch.sizes.widths[size] -
|
|
65
73
|
theme.__hd__.switch.sizes.thumbs[size]) /
|
|
@@ -376,7 +376,9 @@ exports[`Tabs.Scroll renders correctly 1`] = `
|
|
|
376
376
|
"color": "#001f23",
|
|
377
377
|
"fontSize": 20,
|
|
378
378
|
},
|
|
379
|
-
|
|
379
|
+
Object {
|
|
380
|
+
"color": "#001f23",
|
|
381
|
+
},
|
|
380
382
|
]
|
|
381
383
|
}
|
|
382
384
|
testID="hero-icon-speaker-outlined"
|
|
@@ -478,7 +480,9 @@ exports[`Tabs.Scroll renders correctly 1`] = `
|
|
|
478
480
|
"color": "#001f23",
|
|
479
481
|
"fontSize": 20,
|
|
480
482
|
},
|
|
481
|
-
|
|
483
|
+
Object {
|
|
484
|
+
"color": "#001f23",
|
|
485
|
+
},
|
|
482
486
|
]
|
|
483
487
|
}
|
|
484
488
|
testID="hero-icon-home-outlined"
|
|
@@ -605,7 +609,9 @@ exports[`Tabs.Scroll renders correctly 1`] = `
|
|
|
605
609
|
"color": "#001f23",
|
|
606
610
|
"fontSize": 20,
|
|
607
611
|
},
|
|
608
|
-
|
|
612
|
+
Object {
|
|
613
|
+
"color": "#001f23",
|
|
614
|
+
},
|
|
609
615
|
]
|
|
610
616
|
}
|
|
611
617
|
testID="hero-icon-calendar-dates-outlined"
|
|
@@ -20,6 +20,7 @@ import ScrollableTabs from './ScrollableTabs';
|
|
|
20
20
|
import TabWithBadge from './TabWithBadge';
|
|
21
21
|
import type { BadgeConfigType } from './TabWithBadge';
|
|
22
22
|
import { IconName } from '../Icon';
|
|
23
|
+
import { useDeprecation } from '../../utils/hooks';
|
|
23
24
|
|
|
24
25
|
export type ItemType =
|
|
25
26
|
| string
|
|
@@ -113,6 +114,11 @@ const Tabs = ({
|
|
|
113
114
|
swipeEnabled = true,
|
|
114
115
|
testID: componentTestID,
|
|
115
116
|
}: TabsProps): JSX.Element => {
|
|
117
|
+
useDeprecation(
|
|
118
|
+
"Tabs' showBadge will be removed in the next major release. Please use badge prop instead.",
|
|
119
|
+
tabs.some((item) => item.showBadge !== undefined)
|
|
120
|
+
);
|
|
121
|
+
|
|
116
122
|
const theme = useTheme();
|
|
117
123
|
const insets = useSafeAreaInsets();
|
|
118
124
|
const pagerViewRef = React.useRef<PagerView>(null);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { ReactElement } from 'react';
|
|
2
2
|
import type { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
3
|
+
import { useDeprecation } from '../../utils/hooks';
|
|
3
4
|
import { StyledView, StyledText } from './StyledTag';
|
|
4
5
|
|
|
5
6
|
interface TagProps extends ViewProps {
|
|
@@ -39,22 +40,29 @@ const Tag = ({
|
|
|
39
40
|
style,
|
|
40
41
|
testID,
|
|
41
42
|
...nativeProps
|
|
42
|
-
}: TagProps): JSX.Element =>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
43
|
+
}: TagProps): JSX.Element => {
|
|
44
|
+
useDeprecation(
|
|
45
|
+
"Tag's default intent is deprecated and will be removed in the next major release.\nPlease use primary intent instead.",
|
|
46
|
+
intent !== 'default'
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<StyledView
|
|
51
|
+
{...nativeProps}
|
|
52
|
+
themeIntent={intent}
|
|
53
|
+
themeVariant={variant}
|
|
54
|
+
style={style}
|
|
55
|
+
testID={testID}
|
|
56
|
+
>
|
|
57
|
+
{typeof content === 'string' ? (
|
|
58
|
+
<StyledText themeIntent={intent} themeVariant={variant}>
|
|
59
|
+
{content}
|
|
60
|
+
</StyledText>
|
|
61
|
+
) : (
|
|
62
|
+
content
|
|
63
|
+
)}
|
|
64
|
+
</StyledView>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
59
67
|
|
|
60
68
|
export default Tag;
|
|
@@ -287,7 +287,7 @@ exports[`TimePickerIOS renders correctly 1`] = `
|
|
|
287
287
|
onStartShouldSetResponder={[Function]}
|
|
288
288
|
style={
|
|
289
289
|
Object {
|
|
290
|
-
"backgroundColor": "#
|
|
290
|
+
"backgroundColor": "#000000",
|
|
291
291
|
"bottom": 0,
|
|
292
292
|
"left": 0,
|
|
293
293
|
"opacity": 0.48,
|
|
@@ -313,8 +313,8 @@ exports[`TimePickerIOS renders correctly 1`] = `
|
|
|
313
313
|
"height": 3,
|
|
314
314
|
"width": 0,
|
|
315
315
|
},
|
|
316
|
-
"shadowOpacity": 0.
|
|
317
|
-
"shadowRadius":
|
|
316
|
+
"shadowOpacity": 0.4,
|
|
317
|
+
"shadowRadius": 16,
|
|
318
318
|
"transform": Array [
|
|
319
319
|
Object {
|
|
320
320
|
"scaleY": 1,
|
|
@@ -410,13 +410,13 @@ exports[`TimePickerIOS renders correctly 1`] = `
|
|
|
410
410
|
Array [
|
|
411
411
|
Object {
|
|
412
412
|
"color": "#001f23",
|
|
413
|
-
"fontSize":
|
|
413
|
+
"fontSize": 16,
|
|
414
414
|
},
|
|
415
415
|
undefined,
|
|
416
416
|
]
|
|
417
417
|
}
|
|
418
418
|
themeIntent="text"
|
|
419
|
-
themeSize="
|
|
419
|
+
themeSize="xsmall"
|
|
420
420
|
/>
|
|
421
421
|
</View>
|
|
422
422
|
</View>
|
|
@@ -477,8 +477,8 @@ exports[`TimePickerIOS renders correctly 1`] = `
|
|
|
477
477
|
"flexDirection": "row",
|
|
478
478
|
"justifyContent": "flex-end",
|
|
479
479
|
"minHeight": 64,
|
|
480
|
-
"paddingHorizontal":
|
|
481
|
-
"paddingVertical":
|
|
480
|
+
"paddingHorizontal": 24,
|
|
481
|
+
"paddingVertical": 16,
|
|
482
482
|
},
|
|
483
483
|
undefined,
|
|
484
484
|
]
|
|
@@ -38,7 +38,7 @@ const SingleToastDisplay = ({
|
|
|
38
38
|
const ToastContainer = React.forwardRef<
|
|
39
39
|
ToastControllerContextType,
|
|
40
40
|
ToastContainerProps
|
|
41
|
-
>(({ displayType = 'single', position = '
|
|
41
|
+
>(({ displayType = 'single', position = 'bottom', style }, ref) => {
|
|
42
42
|
const theme = useTheme();
|
|
43
43
|
const [toastList, setToastList] = useState<ToastItemProps[]>([]);
|
|
44
44
|
|
|
@@ -6,6 +6,7 @@ import ToastContainer from './ToastContainer';
|
|
|
6
6
|
import { ToastConfigContext, ToastContext } from './ToastContext';
|
|
7
7
|
import type { ToastControllerContextType } from './ToastContext';
|
|
8
8
|
import type { ToastContainerProps } from './types';
|
|
9
|
+
import { useDeprecation } from '../../utils/hooks';
|
|
9
10
|
|
|
10
11
|
type ToastProviderProps = {
|
|
11
12
|
/**
|
|
@@ -17,8 +18,16 @@ type ToastProviderProps = {
|
|
|
17
18
|
const ToastProvider = ({
|
|
18
19
|
children,
|
|
19
20
|
displayType = 'single',
|
|
20
|
-
position
|
|
21
|
+
position: _position,
|
|
21
22
|
}: ToastProviderProps) => {
|
|
23
|
+
const position: ToastContainerProps['position'] =
|
|
24
|
+
_position === undefined ? 'bottom' : _position;
|
|
25
|
+
|
|
26
|
+
useDeprecation(
|
|
27
|
+
"Toast's position prop is deprecated and will be removed in the next major release.\nPlease remove it.",
|
|
28
|
+
_position !== undefined
|
|
29
|
+
);
|
|
30
|
+
|
|
22
31
|
const toastRef = useRef<ToastControllerContextType>(null);
|
|
23
32
|
// @ts-expect-error: TODO: @tungv Fix this type error
|
|
24
33
|
const [refState, setRefState] = useState<ToastControllerContextType>(null);
|
|
@@ -10,11 +10,11 @@ describe('ToastContainer', () => {
|
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
it.each`
|
|
13
|
-
displayType
|
|
14
|
-
${'single'}
|
|
15
|
-
${'
|
|
16
|
-
${'single'}
|
|
17
|
-
${'
|
|
13
|
+
displayType | position
|
|
14
|
+
${'single'} | ${'top'}
|
|
15
|
+
${'stack'} | ${'top'}
|
|
16
|
+
${'single'} | ${'bottom'}
|
|
17
|
+
${'stack'} | ${'bottom'}
|
|
18
18
|
`(
|
|
19
19
|
'renders correctly with displayType: $displayType, position: $position',
|
|
20
20
|
({ displayType, position }) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`ToastContainer renders correctly with displayType:
|
|
3
|
+
exports[`ToastContainer renders correctly with displayType: single, position: bottom 1`] = `
|
|
4
4
|
<View
|
|
5
5
|
pointerEvents="box-none"
|
|
6
6
|
position="bottom"
|
|
@@ -23,7 +23,7 @@ exports[`ToastContainer renders correctly with displayType: displayType, positio
|
|
|
23
23
|
/>
|
|
24
24
|
`;
|
|
25
25
|
|
|
26
|
-
exports[`ToastContainer renders correctly with displayType:
|
|
26
|
+
exports[`ToastContainer renders correctly with displayType: single, position: top 1`] = `
|
|
27
27
|
<View
|
|
28
28
|
pointerEvents="box-none"
|
|
29
29
|
position="top"
|
|
@@ -46,7 +46,7 @@ exports[`ToastContainer renders correctly with displayType: displayType, positio
|
|
|
46
46
|
/>
|
|
47
47
|
`;
|
|
48
48
|
|
|
49
|
-
exports[`ToastContainer renders correctly with displayType:
|
|
49
|
+
exports[`ToastContainer renders correctly with displayType: stack, position: bottom 1`] = `
|
|
50
50
|
<View
|
|
51
51
|
pointerEvents="box-none"
|
|
52
52
|
position="bottom"
|
|
@@ -69,7 +69,7 @@ exports[`ToastContainer renders correctly with displayType: single, position: bo
|
|
|
69
69
|
/>
|
|
70
70
|
`;
|
|
71
71
|
|
|
72
|
-
exports[`ToastContainer renders correctly with displayType:
|
|
72
|
+
exports[`ToastContainer renders correctly with displayType: stack, position: top 1`] = `
|
|
73
73
|
<View
|
|
74
74
|
pointerEvents="box-none"
|
|
75
75
|
position="top"
|
|
@@ -190,7 +190,7 @@ exports[`StyledText has playful typeface style 1`] = `
|
|
|
190
190
|
Array [
|
|
191
191
|
Object {
|
|
192
192
|
"color": "#001f23",
|
|
193
|
-
"fontFamily": "
|
|
193
|
+
"fontFamily": "RebondGrotesque-Regular",
|
|
194
194
|
"fontSize": 14,
|
|
195
195
|
"letterSpacing": 0.42,
|
|
196
196
|
"lineHeight": 22,
|
|
@@ -145,7 +145,7 @@ Object {
|
|
|
145
145
|
},
|
|
146
146
|
"bottomSheet": Object {
|
|
147
147
|
"colors": Object {
|
|
148
|
-
"backdrop": "#
|
|
148
|
+
"backdrop": "#000000",
|
|
149
149
|
"background": "#ffffff",
|
|
150
150
|
"shadow": "#001f23",
|
|
151
151
|
},
|
|
@@ -158,8 +158,8 @@ Object {
|
|
|
158
158
|
"height": 3,
|
|
159
159
|
"width": 0,
|
|
160
160
|
},
|
|
161
|
-
"opacity": 0.
|
|
162
|
-
"radius":
|
|
161
|
+
"opacity": 0.4,
|
|
162
|
+
"radius": 16,
|
|
163
163
|
},
|
|
164
164
|
"sizes": Object {
|
|
165
165
|
"closeIcon": 48,
|
|
@@ -167,8 +167,8 @@ Object {
|
|
|
167
167
|
},
|
|
168
168
|
"space": Object {
|
|
169
169
|
"closeIconMargin": 12,
|
|
170
|
-
"footerHorizontalPadding":
|
|
171
|
-
"footerVerticalPadding":
|
|
170
|
+
"footerHorizontalPadding": 24,
|
|
171
|
+
"footerVerticalPadding": 16,
|
|
172
172
|
"headerWrapperHorizontalPadding": 16,
|
|
173
173
|
"headerWrapperVerticalPadding": 8,
|
|
174
174
|
},
|
|
@@ -331,17 +331,18 @@ Object {
|
|
|
331
331
|
},
|
|
332
332
|
"empty": Object {
|
|
333
333
|
"colors": Object {
|
|
334
|
+
"invertedSubduedText": "#ffffff",
|
|
334
335
|
"invertedText": "#ffffff",
|
|
335
|
-
"subduedText": "#
|
|
336
|
+
"subduedText": "#4d6265",
|
|
336
337
|
"text": "#001f23",
|
|
337
338
|
},
|
|
338
339
|
"fontSizes": Object {
|
|
339
|
-
"description":
|
|
340
|
-
"title":
|
|
340
|
+
"description": 18,
|
|
341
|
+
"title": 24,
|
|
341
342
|
},
|
|
342
343
|
"fonts": Object {
|
|
343
|
-
"description": "
|
|
344
|
-
"title": "
|
|
344
|
+
"description": "RebondGrotesque-Regular",
|
|
345
|
+
"title": "RebondGrotesque-SemiBold",
|
|
345
346
|
},
|
|
346
347
|
"sizes": Object {
|
|
347
348
|
"image": 168,
|
|
@@ -356,7 +357,7 @@ Object {
|
|
|
356
357
|
"colors": Object {
|
|
357
358
|
"actionItemBackground": "#401960",
|
|
358
359
|
"actionItemText": "#ffffff",
|
|
359
|
-
"backdropBackground": "#
|
|
360
|
+
"backdropBackground": "#000000",
|
|
360
361
|
"buttonBackground": "#401960",
|
|
361
362
|
"headerText": "#ffffff",
|
|
362
363
|
"icon": "#ffffff",
|
|
@@ -607,12 +608,14 @@ Object {
|
|
|
607
608
|
},
|
|
608
609
|
"space": Object {
|
|
609
610
|
"minimumOptionListHeight": 280,
|
|
610
|
-
"
|
|
611
|
+
"optionListHorizontalPadding": 12,
|
|
611
612
|
"optionSpacing": 4,
|
|
612
613
|
"searchBarBottomSpacing": 8,
|
|
613
614
|
"searchBarHorizontalSpacing": 16,
|
|
614
615
|
"searchBarMarginTopSpacing": 8,
|
|
615
616
|
"sectionSpacing": 12,
|
|
617
|
+
"singleSelectContentPaddingBottom": 16,
|
|
618
|
+
"suffixMarginRight": 12,
|
|
616
619
|
},
|
|
617
620
|
},
|
|
618
621
|
"slider": Object {
|
|
@@ -909,6 +912,7 @@ Object {
|
|
|
909
912
|
"warning": "#ffa234",
|
|
910
913
|
},
|
|
911
914
|
"fontSizes": Object {
|
|
915
|
+
"7xlarge": 42,
|
|
912
916
|
"large": 16,
|
|
913
917
|
"medium": 14,
|
|
914
918
|
"small": 12,
|
|
@@ -923,12 +927,13 @@ Object {
|
|
|
923
927
|
"semiBold": "BeVietnamPro-SemiBold",
|
|
924
928
|
},
|
|
925
929
|
"playful": Object {
|
|
926
|
-
"light": "
|
|
927
|
-
"regular": "
|
|
928
|
-
"semiBold": "
|
|
930
|
+
"light": "RebondGrotesque-Light",
|
|
931
|
+
"regular": "RebondGrotesque-Regular",
|
|
932
|
+
"semiBold": "RebondGrotesque-SemiBold",
|
|
929
933
|
},
|
|
930
934
|
},
|
|
931
935
|
"lineHeights": Object {
|
|
936
|
+
"7xlarge": 50,
|
|
932
937
|
"large": 24,
|
|
933
938
|
"medium": 22,
|
|
934
939
|
"small": 20,
|
|
@@ -1006,6 +1011,7 @@ Object {
|
|
|
1006
1011
|
"onSuccessSurface": "#017d6d",
|
|
1007
1012
|
"onWarningSurface": "#ffa234",
|
|
1008
1013
|
"outline": "#e8e9ea",
|
|
1014
|
+
"overlayGlobalSurface": "#000000",
|
|
1009
1015
|
"platformBackground": "#ffffff",
|
|
1010
1016
|
"pressedSurface": "#664780",
|
|
1011
1017
|
"primary": "#401960",
|
|
@@ -1033,6 +1039,7 @@ Object {
|
|
|
1033
1039
|
"warningSurface": "#fff6eb",
|
|
1034
1040
|
},
|
|
1035
1041
|
"fontSizes": Object {
|
|
1042
|
+
"7xlarge": 42,
|
|
1036
1043
|
"large": 16,
|
|
1037
1044
|
"medium": 14,
|
|
1038
1045
|
"small": 12,
|
|
@@ -1050,12 +1057,13 @@ Object {
|
|
|
1050
1057
|
"semiBold": "BeVietnamPro-SemiBold",
|
|
1051
1058
|
},
|
|
1052
1059
|
"playful": Object {
|
|
1053
|
-
"light": "
|
|
1054
|
-
"regular": "
|
|
1055
|
-
"semiBold": "
|
|
1060
|
+
"light": "RebondGrotesque-Light",
|
|
1061
|
+
"regular": "RebondGrotesque-Regular",
|
|
1062
|
+
"semiBold": "RebondGrotesque-SemiBold",
|
|
1056
1063
|
},
|
|
1057
1064
|
},
|
|
1058
1065
|
"lineHeights": Object {
|
|
1066
|
+
"7xlarge": 50,
|
|
1059
1067
|
"large": 24,
|
|
1060
1068
|
"medium": 22,
|
|
1061
1069
|
"small": 20,
|
|
@@ -4,7 +4,7 @@ const getBottomSheetTheme = (theme: GlobalTheme) => {
|
|
|
4
4
|
const colors = {
|
|
5
5
|
shadow: theme.colors.primaryOutline,
|
|
6
6
|
background: theme.colors.defaultGlobalSurface,
|
|
7
|
-
backdrop: theme.colors.
|
|
7
|
+
backdrop: theme.colors.overlayGlobalSurface,
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
const sizes = {
|
|
@@ -16,14 +16,14 @@ const getBottomSheetTheme = (theme: GlobalTheme) => {
|
|
|
16
16
|
headerWrapperVerticalPadding: theme.space.small,
|
|
17
17
|
headerWrapperHorizontalPadding: theme.space.medium,
|
|
18
18
|
closeIconMargin: theme.space.smallMedium,
|
|
19
|
-
footerVerticalPadding: theme.space.
|
|
20
|
-
footerHorizontalPadding: theme.space.
|
|
19
|
+
footerVerticalPadding: theme.space.medium,
|
|
20
|
+
footerHorizontalPadding: theme.space.large,
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
const shadows = {
|
|
24
24
|
offset: { width: 0, height: 3 },
|
|
25
|
-
opacity: 0.
|
|
26
|
-
radius:
|
|
25
|
+
opacity: 0.4,
|
|
26
|
+
radius: theme.radii.xlarge,
|
|
27
27
|
elevation: 10,
|
|
28
28
|
};
|
|
29
29
|
|
|
@@ -14,17 +14,18 @@ const getEmptyTheme = (theme: GlobalTheme) => {
|
|
|
14
14
|
const colors = {
|
|
15
15
|
text: theme.colors.onDefaultGlobalSurface,
|
|
16
16
|
invertedText: theme.colors.onDarkGlobalSurface,
|
|
17
|
-
subduedText: theme.colors.
|
|
17
|
+
subduedText: theme.colors.mutedOnDefaultGlobalSurface,
|
|
18
|
+
invertedSubduedText: theme.colors.onDarkGlobalSurface,
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
const fontSizes = {
|
|
21
|
-
title: theme.fontSizes.
|
|
22
|
-
description: theme.fontSizes.
|
|
22
|
+
title: theme.fontSizes.xxxlarge,
|
|
23
|
+
description: theme.fontSizes.xlarge,
|
|
23
24
|
};
|
|
24
25
|
|
|
25
26
|
const fonts = {
|
|
26
|
-
title: theme.fonts.
|
|
27
|
-
description: theme.fonts.
|
|
27
|
+
title: theme.fonts.playful.semiBold,
|
|
28
|
+
description: theme.fonts.playful.regular,
|
|
28
29
|
};
|
|
29
30
|
|
|
30
31
|
return { fontSizes, colors, sizes, space, fonts };
|
|
@@ -6,7 +6,7 @@ const getFABTheme = (theme: GlobalTheme) => {
|
|
|
6
6
|
icon: theme.colors.onPrimary,
|
|
7
7
|
headerText: theme.colors.onDarkGlobalSurface,
|
|
8
8
|
actionItemBackground: theme.colors.primary,
|
|
9
|
-
backdropBackground: theme.colors.
|
|
9
|
+
backdropBackground: theme.colors.overlayGlobalSurface,
|
|
10
10
|
titleText: theme.colors.onDarkGlobalSurface,
|
|
11
11
|
actionItemText: theme.colors.onPrimary,
|
|
12
12
|
};
|
|
@@ -9,10 +9,12 @@ const getSelectTheme = (theme: GlobalTheme) => {
|
|
|
9
9
|
minimumOptionListHeight: theme.space.xxxxlarge * 5,
|
|
10
10
|
sectionSpacing: theme.space.smallMedium,
|
|
11
11
|
optionSpacing: theme.space.xsmall,
|
|
12
|
-
|
|
12
|
+
optionListHorizontalPadding: theme.space.smallMedium,
|
|
13
13
|
searchBarMarginTopSpacing: theme.space.small,
|
|
14
14
|
searchBarHorizontalSpacing: theme.space.medium,
|
|
15
15
|
searchBarBottomSpacing: theme.space.small,
|
|
16
|
+
singleSelectContentPaddingBottom: theme.space.medium,
|
|
17
|
+
suffixMarginRight: theme.space.smallMedium,
|
|
16
18
|
};
|
|
17
19
|
|
|
18
20
|
const radii = {
|
|
@@ -20,6 +20,7 @@ const getTypographyTheme = (theme: GlobalTheme) => {
|
|
|
20
20
|
xlarge: theme.fontSizes.xlarge,
|
|
21
21
|
xxxlarge: theme.fontSizes.xxxlarge,
|
|
22
22
|
xxxxxlarge: theme.fontSizes.xxxxxlarge,
|
|
23
|
+
'7xlarge': theme.fontSizes['7xlarge'],
|
|
23
24
|
};
|
|
24
25
|
|
|
25
26
|
const lineHeights = {
|
|
@@ -29,6 +30,7 @@ const getTypographyTheme = (theme: GlobalTheme) => {
|
|
|
29
30
|
xlarge: theme.lineHeights.xlarge,
|
|
30
31
|
xxxlarge: theme.lineHeights.xxxlarge,
|
|
31
32
|
xxxxxlarge: theme.lineHeights.xxxxxlarge,
|
|
33
|
+
'7xlarge': theme.lineHeights['7xlarge'],
|
|
32
34
|
};
|
|
33
35
|
|
|
34
36
|
return { colors, fonts: theme.fonts, fontSizes, lineHeights };
|
|
@@ -12,6 +12,7 @@ const globalPalette: GlobalSystemPalette = {
|
|
|
12
12
|
disabledOnDefaultGlobalSurface: palette.greyLight30,
|
|
13
13
|
darkGlobalSurface: palette.maasstrichtBlue,
|
|
14
14
|
onDarkGlobalSurface: palette.white,
|
|
15
|
+
overlayGlobalSurface: palette.black,
|
|
15
16
|
|
|
16
17
|
// Outlines
|
|
17
18
|
primaryOutline: palette.maasstrichtBlue,
|
|
@@ -12,6 +12,7 @@ interface Fonts {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
interface FontSizes {
|
|
15
|
+
'7xlarge': number;
|
|
15
16
|
xxxxxlarge: number;
|
|
16
17
|
xxxxlarge: number;
|
|
17
18
|
xxxlarge: number;
|
|
@@ -50,7 +51,7 @@ const getFonts = ({
|
|
|
50
51
|
});
|
|
51
52
|
|
|
52
53
|
const getFontSizes = (baseFontSize: number): FontSizes => {
|
|
53
|
-
const fontSizes = Array.from(new Array(
|
|
54
|
+
const fontSizes = Array.from(new Array(11));
|
|
54
55
|
fontSizes.forEach((_, index) => {
|
|
55
56
|
if (index === 0) {
|
|
56
57
|
fontSizes[0] = baseFontSize;
|
|
@@ -60,6 +61,7 @@ const getFontSizes = (baseFontSize: number): FontSizes => {
|
|
|
60
61
|
return undefined;
|
|
61
62
|
});
|
|
62
63
|
return {
|
|
64
|
+
'7xlarge': scale(fontSizes[10]), // 42
|
|
63
65
|
xxxxxlarge: scale(fontSizes[8]), // 32
|
|
64
66
|
xxxxlarge: scale(fontSizes[7]), // 28
|
|
65
67
|
xxxlarge: scale(fontSizes[6]), // 24
|
|
@@ -75,6 +77,7 @@ const getFontSizes = (baseFontSize: number): FontSizes => {
|
|
|
75
77
|
const getLineHeights = (fontSizes: FontSizes): LineHeights => {
|
|
76
78
|
const additionalSpace = 8;
|
|
77
79
|
return {
|
|
80
|
+
'7xlarge': fontSizes['7xlarge'] + additionalSpace,
|
|
78
81
|
xxxxxlarge: fontSizes.xxxxxlarge + additionalSpace,
|
|
79
82
|
xxxxlarge: fontSizes.xxxxlarge + additionalSpace,
|
|
80
83
|
xxxlarge: fontSizes.xxxlarge + additionalSpace,
|
package/src/utils/hooks.ts
CHANGED
|
@@ -22,6 +22,8 @@ export function usePropsOrInternalState<T>(
|
|
|
22
22
|
export const useDeprecation = (message: string, cond = true) => {
|
|
23
23
|
useEffect(() => {
|
|
24
24
|
// eslint-disable-next-line no-console
|
|
25
|
-
|
|
25
|
+
if (cond) {
|
|
26
|
+
console.warn(message);
|
|
27
|
+
}
|
|
26
28
|
}, [message, cond]);
|
|
27
29
|
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|