@hero-design/rn 8.36.0-alpha.0 → 8.36.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 +2 -2
- package/.turbo/turbo-publish:npm.log +0 -9
- package/es/index.js +65 -54
- package/lib/index.js +65 -54
- package/package.json +7 -7
- package/src/components/Checkbox/StyledCheckbox.tsx +18 -17
- package/src/components/Checkbox/__tests__/StyledCheckbox.spec.tsx +28 -15
- package/src/components/Checkbox/__tests__/__snapshots__/StyledCheckbox.spec.tsx.snap +151 -4
- package/src/components/Checkbox/__tests__/__snapshots__/index.spec.tsx.snap +339 -10
- package/src/components/Checkbox/__tests__/index.spec.tsx +28 -8
- package/src/components/Checkbox/index.tsx +54 -25
- package/src/components/FAB/ActionGroup/index.tsx +1 -1
- package/src/components/Portal/PortalHost.tsx +3 -0
- package/src/components/Portal/PortalProvider.tsx +6 -0
- package/src/components/Portal/index.tsx +11 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +5 -2
- package/src/theme/components/checkbox.ts +5 -2
- 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/Alert/StyledAlert.d.ts +0 -0
- package/types/components/Alert/index.d.ts +0 -0
- 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/BottomSheetContext.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/ScrollView.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/Carousel/CardCarousel.d.ts +0 -0
- package/types/components/Carousel/CarouselItem.d.ts +0 -0
- package/types/components/Carousel/StyledCardCarousel.d.ts +0 -0
- package/types/components/Carousel/StyledCarousel.d.ts +0 -0
- package/types/components/Carousel/contants.d.ts +0 -0
- package/types/components/Carousel/index.d.ts +0 -0
- package/types/components/Carousel/types.d.ts +0 -0
- package/types/components/Checkbox/StyledCheckbox.d.ts +6 -2
- package/types/components/Checkbox/index.d.ts +10 -1
- 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/DatePickerCalendar.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/Error/StyledError.d.ts +0 -0
- package/types/components/Error/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 +0 -0
- package/types/components/Icon/index.d.ts +0 -0
- package/types/components/Icon/utils.d.ts +0 -0
- 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 +0 -0
- 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/PageControl/StyledPageControl.d.ts +0 -0
- package/types/components/PageControl/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 +0 -0
- package/types/components/Select/Footer.d.ts +0 -0
- package/types/components/Select/MultiSelect/Option.d.ts +0 -0
- 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 +0 -0
- package/types/components/Select/SingleSelect/OptionList.d.ts +0 -0
- package/types/components/Select/SingleSelect/StyledSingleSelect.d.ts +0 -0
- package/types/components/Select/SingleSelect/index.d.ts +0 -0
- package/types/components/Select/StyledSelect.d.ts +0 -0
- 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 +0 -0
- package/types/components/Skeleton/StyledSkeleton.d.ts +0 -0
- package/types/components/Skeleton/index.d.ts +0 -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/Success/StyledSuccess.d.ts +0 -0
- package/types/components/Success/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 +0 -0
- package/types/components/Tabs/ActiveTabIndicator.d.ts +0 -0
- package/types/components/Tabs/SceneView.d.ts +0 -0
- package/types/components/Tabs/ScrollableTabs.d.ts +0 -0
- package/types/components/Tabs/ScrollableTabsHeader.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/useIsFocused.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 +0 -0
- package/types/components/Toast/index.d.ts +0 -0
- 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 +0 -0
- package/types/components/Typography/Text/index.d.ts +0 -0
- 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/cardCarousel.d.ts +0 -0
- package/types/theme/components/carousel.d.ts +0 -0
- package/types/theme/components/checkbox.d.ts +5 -2
- 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 +0 -0
- package/types/theme/components/error.d.ts +0 -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/pageControl.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 +0 -0
- package/types/theme/components/skeleton.d.ts +0 -0
- package/types/theme/components/slider.d.ts +0 -0
- package/types/theme/components/spinner.d.ts +0 -0
- package/types/theme/components/success.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 +0 -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/globalDark.d.ts +0 -0
- package/types/theme/global/colors/jobs.d.ts +0 -0
- package/types/theme/global/colors/swag.d.ts +0 -0
- package/types/theme/global/colors/swagDark.d.ts +0 -0
- package/types/theme/global/colors/types.d.ts +0 -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 +0 -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 +0 -0
- package/types/theme/index.d.ts +0 -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
- package/.tool-versions +0 -1
- package/.turbo/turbo-build:types.log +0 -1
- package/.turbo/turbo-lint.log +0 -172
- package/.turbo/turbo-test.log +0 -1
- package/.turbo/turbo-type-check.log +0 -1
- package/types/components/FAB/ActionGroup/FABModal.d.ts +0 -21
- package/types/components/FAB/ActionGroup/FABModalContentWrapper.d.ts +0 -18
- package/types/components/FAB/ActionGroup/FABProvider.d.ts +0 -5
- package/types/components/FAB/ActionGroup/ModalPresenter/ModalPresenter.d.ts +0 -34
- package/types/components/FAB/ActionGroup/ModalPresenter/index.d.ts +0 -3
- package/types/components/Tabs/ScrollableTabsV2/SceneView.d.ts +0 -10
- package/types/components/Tabs/ScrollableTabsV2/ScrollableTabsV2.d.ts +0 -9
- package/types/components/Tabs/ScrollableTabsV2/index.d.ts +0 -4
package/.turbo/turbo-build.log
CHANGED
|
@@ -3,6 +3,6 @@ $ rollup -c
|
|
|
3
3
|
[36m
|
|
4
4
|
[1msrc/index.ts[22m → [1mlib/index.js, es/index.js[22m...[39m
|
|
5
5
|
[1m[33m(!) Plugin replace: @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.[39m[22m
|
|
6
|
-
[1m[33m(!) Plugin node-resolve: preferring built-in module 'events' over local alternative at '/
|
|
7
|
-
[32mcreated [1mlib/index.js, es/index.js[22m in [
|
|
6
|
+
[1m[33m(!) Plugin node-resolve: preferring built-in module 'events' over local alternative at '/root/hero-design/node_modules/events/events.js', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning[39m[22m
|
|
7
|
+
[32mcreated [1mlib/index.js, es/index.js[22m in [1m32.5s[22m[39m
|
|
8
8
|
$ tsc --noEmit false --emitDeclarationOnly --project tsconfig.prod.json
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
[36m@hero-design/rn:publish:npm[0m: cache hit, replaying output [2m507c34f3e0a508f6[0m
|
|
2
|
-
[36m@hero-design/rn:publish:npm: [0m$ yarn publish --access public
|
|
3
|
-
[36m@hero-design/rn:publish:npm: [0m[1/4] Bumping version...
|
|
4
|
-
[36m@hero-design/rn:publish:npm: [0minfo Current version: 8.12.0-rc.0
|
|
5
|
-
[36m@hero-design/rn:publish:npm: [0m[2/4] Logging in...
|
|
6
|
-
[36m@hero-design/rn:publish:npm: [0m[3/4] Publishing...
|
|
7
|
-
[36m@hero-design/rn:publish:npm: [0msuccess Published.
|
|
8
|
-
[36m@hero-design/rn:publish:npm: [0m[4/4] Revoking token...
|
|
9
|
-
[36m@hero-design/rn:publish:npm: [0minfo Not revoking login token, specified via config file.
|
package/es/index.js
CHANGED
|
@@ -2103,8 +2103,11 @@ var getCardCarouselTheme = function getCardCarouselTheme(theme) {
|
|
|
2103
2103
|
|
|
2104
2104
|
var getCheckboxTheme = function getCheckboxTheme(theme) {
|
|
2105
2105
|
var colors = {
|
|
2106
|
-
|
|
2107
|
-
|
|
2106
|
+
borders: {
|
|
2107
|
+
"default": theme.colors.primaryOutline,
|
|
2108
|
+
disabled: theme.colors.disabledOutline,
|
|
2109
|
+
readonly: theme.colors.inactiveOutline
|
|
2110
|
+
}
|
|
2108
2111
|
};
|
|
2109
2112
|
var space = {
|
|
2110
2113
|
iconTop: 0,
|
|
@@ -11990,12 +11993,12 @@ var index$a = Object.assign(Carousel, {
|
|
|
11990
11993
|
var StyledWrapper$7 = index$c(TouchableOpacity)(function (_ref) {
|
|
11991
11994
|
var theme = _ref.theme,
|
|
11992
11995
|
themeWithBorder = _ref.themeWithBorder,
|
|
11993
|
-
|
|
11996
|
+
themeState = _ref.themeState;
|
|
11994
11997
|
var borderStyle = {
|
|
11995
11998
|
borderRadius: theme.__hd__.checkbox.radii.wrapper,
|
|
11996
11999
|
borderWidth: theme.__hd__.checkbox.borderWidths.wrapper,
|
|
11997
12000
|
padding: theme.__hd__.checkbox.space.wrapperPadding,
|
|
11998
|
-
borderColor:
|
|
12001
|
+
borderColor: theme.__hd__.checkbox.colors.borders[themeState]
|
|
11999
12002
|
};
|
|
12000
12003
|
return _objectSpread2({
|
|
12001
12004
|
flexDirection: 'row'
|
|
@@ -12018,37 +12021,56 @@ var StyledCheckboxContainer = index$c(View)(function (_ref3) {
|
|
|
12018
12021
|
});
|
|
12019
12022
|
var StyledCheckbox = index$c(View)(function (_ref4) {
|
|
12020
12023
|
var theme = _ref4.theme,
|
|
12021
|
-
|
|
12024
|
+
themeState = _ref4.themeState;
|
|
12022
12025
|
return {
|
|
12023
12026
|
flex: 1,
|
|
12024
12027
|
borderRadius: theme.__hd__.checkbox.radii.icon,
|
|
12025
12028
|
borderWidth: theme.__hd__.checkbox.borderWidths.icon,
|
|
12026
|
-
borderColor:
|
|
12029
|
+
borderColor: theme.__hd__.checkbox.colors.borders[themeState]
|
|
12027
12030
|
};
|
|
12028
12031
|
});
|
|
12029
12032
|
var StyledCheckMark = index$c(Icon)(function (_ref5) {
|
|
12030
|
-
var theme = _ref5.theme
|
|
12033
|
+
var theme = _ref5.theme,
|
|
12034
|
+
themeState = _ref5.themeState;
|
|
12031
12035
|
return {
|
|
12032
12036
|
position: 'absolute',
|
|
12033
|
-
top: theme.__hd__.checkbox.space.iconTop
|
|
12037
|
+
top: theme.__hd__.checkbox.space.iconTop,
|
|
12038
|
+
color: theme.__hd__.checkbox.colors.borders[themeState]
|
|
12034
12039
|
};
|
|
12035
12040
|
});
|
|
12036
12041
|
|
|
12037
|
-
var
|
|
12038
|
-
var
|
|
12039
|
-
|
|
12040
|
-
|
|
12041
|
-
|
|
12042
|
-
|
|
12043
|
-
|
|
12044
|
-
|
|
12045
|
-
|
|
12046
|
-
|
|
12042
|
+
var getThemeState = function getThemeState(_ref) {
|
|
12043
|
+
var disabled = _ref.disabled,
|
|
12044
|
+
readonly = _ref.readonly;
|
|
12045
|
+
if (disabled) {
|
|
12046
|
+
return 'disabled';
|
|
12047
|
+
}
|
|
12048
|
+
if (readonly) {
|
|
12049
|
+
return 'readonly';
|
|
12050
|
+
}
|
|
12051
|
+
return 'default';
|
|
12052
|
+
};
|
|
12053
|
+
var Checkbox = function Checkbox(_ref2) {
|
|
12054
|
+
var checked = _ref2.checked,
|
|
12055
|
+
description = _ref2.description,
|
|
12056
|
+
_ref2$withBorder = _ref2.withBorder,
|
|
12057
|
+
withBorder = _ref2$withBorder === void 0 ? false : _ref2$withBorder,
|
|
12058
|
+
_ref2$disabled = _ref2.disabled,
|
|
12059
|
+
disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,
|
|
12060
|
+
onPress = _ref2.onPress,
|
|
12061
|
+
style = _ref2.style,
|
|
12062
|
+
testID = _ref2.testID,
|
|
12063
|
+
_ref2$readonly = _ref2.readonly,
|
|
12064
|
+
readonly = _ref2$readonly === void 0 ? false : _ref2$readonly;
|
|
12065
|
+
var themeState = getThemeState({
|
|
12066
|
+
disabled: disabled,
|
|
12067
|
+
readonly: readonly
|
|
12068
|
+
});
|
|
12047
12069
|
return /*#__PURE__*/React.createElement(StyledWrapper$7, {
|
|
12048
12070
|
onPress: onPress,
|
|
12049
|
-
disabled: disabled,
|
|
12050
|
-
themeDisabled: disabled,
|
|
12071
|
+
disabled: disabled || readonly,
|
|
12051
12072
|
themeWithBorder: withBorder,
|
|
12073
|
+
themeState: themeState,
|
|
12052
12074
|
style: style,
|
|
12053
12075
|
testID: testID
|
|
12054
12076
|
}, !!description && /*#__PURE__*/React.createElement(StyledDescription$1, {
|
|
@@ -12056,10 +12078,10 @@ var Checkbox = function Checkbox(_ref) {
|
|
|
12056
12078
|
variant: "small"
|
|
12057
12079
|
}, description), /*#__PURE__*/React.createElement(StyledCheckboxContainer, null, checked && /*#__PURE__*/React.createElement(StyledCheckMark, {
|
|
12058
12080
|
icon: "box-check",
|
|
12059
|
-
|
|
12060
|
-
|
|
12081
|
+
testID: "check-mark",
|
|
12082
|
+
themeState: themeState
|
|
12061
12083
|
}), /*#__PURE__*/React.createElement(StyledCheckbox, {
|
|
12062
|
-
|
|
12084
|
+
themeState: themeState
|
|
12063
12085
|
})));
|
|
12064
12086
|
};
|
|
12065
12087
|
|
|
@@ -13596,6 +13618,7 @@ var StyledBackdrop = index$c(Animated.View)(function (_ref2) {
|
|
|
13596
13618
|
right: 0,
|
|
13597
13619
|
top: 0,
|
|
13598
13620
|
bottom: 0,
|
|
13621
|
+
opacity: 0.25,
|
|
13599
13622
|
backgroundColor: theme.__hd__.fab.colors.backdropBackground
|
|
13600
13623
|
};
|
|
13601
13624
|
});
|
|
@@ -13651,10 +13674,6 @@ var ActionGroup = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
13651
13674
|
useNativeDriver: Platform.OS !== 'web'
|
|
13652
13675
|
})]).start();
|
|
13653
13676
|
}, [active]);
|
|
13654
|
-
var interpolatedBackdropOpacityAnimation = tranlateXAnimation.current.interpolate({
|
|
13655
|
-
inputRange: [0, 1],
|
|
13656
|
-
outputRange: [0, 0.25]
|
|
13657
|
-
});
|
|
13658
13677
|
var interpolatedActionGroupOpacityAnimation = tranlateXAnimation.current.interpolate({
|
|
13659
13678
|
inputRange: [0, 1],
|
|
13660
13679
|
outputRange: [0, 1]
|
|
@@ -13667,21 +13686,30 @@ var ActionGroup = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
13667
13686
|
testID: testID,
|
|
13668
13687
|
pointerEvents: "box-none",
|
|
13669
13688
|
style: style
|
|
13670
|
-
}, /*#__PURE__*/React.createElement(
|
|
13689
|
+
}, /*#__PURE__*/React.createElement(Animated.View, {
|
|
13690
|
+
style: {
|
|
13691
|
+
opacity: interpolatedFABOpacityAnimation
|
|
13692
|
+
}
|
|
13693
|
+
}, /*#__PURE__*/React.createElement(StyledFAB, {
|
|
13694
|
+
key: "fab",
|
|
13695
|
+
testID: "fab",
|
|
13696
|
+
icon: fabIcon,
|
|
13697
|
+
onPress: onPress,
|
|
13698
|
+
animated: true,
|
|
13699
|
+
active: active,
|
|
13700
|
+
title: fabTitle,
|
|
13701
|
+
ref: fabRef
|
|
13702
|
+
})), /*#__PURE__*/React.createElement(Modal$1, {
|
|
13671
13703
|
visible: active,
|
|
13672
13704
|
animationType: "fade",
|
|
13673
|
-
transparent: true
|
|
13705
|
+
transparent: true,
|
|
13706
|
+
statusBarTranslucent: true
|
|
13674
13707
|
}, /*#__PURE__*/React.createElement(StyledContainerInModal, {
|
|
13675
13708
|
testID: testID,
|
|
13676
13709
|
style: [style]
|
|
13677
13710
|
}, /*#__PURE__*/React.createElement(StyledBackdrop, {
|
|
13678
|
-
|
|
13679
|
-
testID: "back-drop",
|
|
13680
|
-
style: {
|
|
13681
|
-
opacity: interpolatedBackdropOpacityAnimation
|
|
13682
|
-
}
|
|
13711
|
+
testID: "back-drop"
|
|
13683
13712
|
}), /*#__PURE__*/React.createElement(StyledActionGroupContainer, {
|
|
13684
|
-
pointerEvents: active ? 'auto' : 'none',
|
|
13685
13713
|
testID: "action-group",
|
|
13686
13714
|
style: {
|
|
13687
13715
|
opacity: interpolatedActionGroupOpacityAnimation
|
|
@@ -13706,11 +13734,7 @@ var ActionGroup = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
13706
13734
|
index: active ? index : items.length - index,
|
|
13707
13735
|
active: active
|
|
13708
13736
|
}));
|
|
13709
|
-
}))), /*#__PURE__*/React.createElement(
|
|
13710
|
-
style: {
|
|
13711
|
-
opacity: interpolatedActionGroupOpacityAnimation
|
|
13712
|
-
}
|
|
13713
|
-
}, /*#__PURE__*/React.createElement(StyledFAB, {
|
|
13737
|
+
}))), /*#__PURE__*/React.createElement(StyledFAB, {
|
|
13714
13738
|
key: "fab-in-portal",
|
|
13715
13739
|
testID: "fab-in-portal",
|
|
13716
13740
|
icon: fabIcon,
|
|
@@ -13718,20 +13742,7 @@ var ActionGroup = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
13718
13742
|
animated: true,
|
|
13719
13743
|
active: active,
|
|
13720
13744
|
title: fabTitle
|
|
13721
|
-
}))))
|
|
13722
|
-
style: {
|
|
13723
|
-
opacity: interpolatedFABOpacityAnimation
|
|
13724
|
-
}
|
|
13725
|
-
}, /*#__PURE__*/React.createElement(StyledFAB, {
|
|
13726
|
-
key: "fab",
|
|
13727
|
-
testID: "fab",
|
|
13728
|
-
icon: fabIcon,
|
|
13729
|
-
onPress: onPress,
|
|
13730
|
-
animated: true,
|
|
13731
|
-
active: active,
|
|
13732
|
-
title: fabTitle,
|
|
13733
|
-
ref: fabRef
|
|
13734
|
-
})));
|
|
13745
|
+
}))));
|
|
13735
13746
|
});
|
|
13736
13747
|
ActionGroup.displayName = 'FAB.ActionGroup';
|
|
13737
13748
|
|
package/lib/index.js
CHANGED
|
@@ -2134,8 +2134,11 @@ var getCardCarouselTheme = function getCardCarouselTheme(theme) {
|
|
|
2134
2134
|
|
|
2135
2135
|
var getCheckboxTheme = function getCheckboxTheme(theme) {
|
|
2136
2136
|
var colors = {
|
|
2137
|
-
|
|
2138
|
-
|
|
2137
|
+
borders: {
|
|
2138
|
+
"default": theme.colors.primaryOutline,
|
|
2139
|
+
disabled: theme.colors.disabledOutline,
|
|
2140
|
+
readonly: theme.colors.inactiveOutline
|
|
2141
|
+
}
|
|
2139
2142
|
};
|
|
2140
2143
|
var space = {
|
|
2141
2144
|
iconTop: 0,
|
|
@@ -12021,12 +12024,12 @@ var index$a = Object.assign(Carousel, {
|
|
|
12021
12024
|
var StyledWrapper$7 = index$c(reactNative.TouchableOpacity)(function (_ref) {
|
|
12022
12025
|
var theme = _ref.theme,
|
|
12023
12026
|
themeWithBorder = _ref.themeWithBorder,
|
|
12024
|
-
|
|
12027
|
+
themeState = _ref.themeState;
|
|
12025
12028
|
var borderStyle = {
|
|
12026
12029
|
borderRadius: theme.__hd__.checkbox.radii.wrapper,
|
|
12027
12030
|
borderWidth: theme.__hd__.checkbox.borderWidths.wrapper,
|
|
12028
12031
|
padding: theme.__hd__.checkbox.space.wrapperPadding,
|
|
12029
|
-
borderColor:
|
|
12032
|
+
borderColor: theme.__hd__.checkbox.colors.borders[themeState]
|
|
12030
12033
|
};
|
|
12031
12034
|
return _objectSpread2({
|
|
12032
12035
|
flexDirection: 'row'
|
|
@@ -12049,37 +12052,56 @@ var StyledCheckboxContainer = index$c(reactNative.View)(function (_ref3) {
|
|
|
12049
12052
|
});
|
|
12050
12053
|
var StyledCheckbox = index$c(reactNative.View)(function (_ref4) {
|
|
12051
12054
|
var theme = _ref4.theme,
|
|
12052
|
-
|
|
12055
|
+
themeState = _ref4.themeState;
|
|
12053
12056
|
return {
|
|
12054
12057
|
flex: 1,
|
|
12055
12058
|
borderRadius: theme.__hd__.checkbox.radii.icon,
|
|
12056
12059
|
borderWidth: theme.__hd__.checkbox.borderWidths.icon,
|
|
12057
|
-
borderColor:
|
|
12060
|
+
borderColor: theme.__hd__.checkbox.colors.borders[themeState]
|
|
12058
12061
|
};
|
|
12059
12062
|
});
|
|
12060
12063
|
var StyledCheckMark = index$c(Icon)(function (_ref5) {
|
|
12061
|
-
var theme = _ref5.theme
|
|
12064
|
+
var theme = _ref5.theme,
|
|
12065
|
+
themeState = _ref5.themeState;
|
|
12062
12066
|
return {
|
|
12063
12067
|
position: 'absolute',
|
|
12064
|
-
top: theme.__hd__.checkbox.space.iconTop
|
|
12068
|
+
top: theme.__hd__.checkbox.space.iconTop,
|
|
12069
|
+
color: theme.__hd__.checkbox.colors.borders[themeState]
|
|
12065
12070
|
};
|
|
12066
12071
|
});
|
|
12067
12072
|
|
|
12068
|
-
var
|
|
12069
|
-
var
|
|
12070
|
-
|
|
12071
|
-
|
|
12072
|
-
|
|
12073
|
-
|
|
12074
|
-
|
|
12075
|
-
|
|
12076
|
-
|
|
12077
|
-
|
|
12073
|
+
var getThemeState = function getThemeState(_ref) {
|
|
12074
|
+
var disabled = _ref.disabled,
|
|
12075
|
+
readonly = _ref.readonly;
|
|
12076
|
+
if (disabled) {
|
|
12077
|
+
return 'disabled';
|
|
12078
|
+
}
|
|
12079
|
+
if (readonly) {
|
|
12080
|
+
return 'readonly';
|
|
12081
|
+
}
|
|
12082
|
+
return 'default';
|
|
12083
|
+
};
|
|
12084
|
+
var Checkbox = function Checkbox(_ref2) {
|
|
12085
|
+
var checked = _ref2.checked,
|
|
12086
|
+
description = _ref2.description,
|
|
12087
|
+
_ref2$withBorder = _ref2.withBorder,
|
|
12088
|
+
withBorder = _ref2$withBorder === void 0 ? false : _ref2$withBorder,
|
|
12089
|
+
_ref2$disabled = _ref2.disabled,
|
|
12090
|
+
disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,
|
|
12091
|
+
onPress = _ref2.onPress,
|
|
12092
|
+
style = _ref2.style,
|
|
12093
|
+
testID = _ref2.testID,
|
|
12094
|
+
_ref2$readonly = _ref2.readonly,
|
|
12095
|
+
readonly = _ref2$readonly === void 0 ? false : _ref2$readonly;
|
|
12096
|
+
var themeState = getThemeState({
|
|
12097
|
+
disabled: disabled,
|
|
12098
|
+
readonly: readonly
|
|
12099
|
+
});
|
|
12078
12100
|
return /*#__PURE__*/React__default["default"].createElement(StyledWrapper$7, {
|
|
12079
12101
|
onPress: onPress,
|
|
12080
|
-
disabled: disabled,
|
|
12081
|
-
themeDisabled: disabled,
|
|
12102
|
+
disabled: disabled || readonly,
|
|
12082
12103
|
themeWithBorder: withBorder,
|
|
12104
|
+
themeState: themeState,
|
|
12083
12105
|
style: style,
|
|
12084
12106
|
testID: testID
|
|
12085
12107
|
}, !!description && /*#__PURE__*/React__default["default"].createElement(StyledDescription$1, {
|
|
@@ -12087,10 +12109,10 @@ var Checkbox = function Checkbox(_ref) {
|
|
|
12087
12109
|
variant: "small"
|
|
12088
12110
|
}, description), /*#__PURE__*/React__default["default"].createElement(StyledCheckboxContainer, null, checked && /*#__PURE__*/React__default["default"].createElement(StyledCheckMark, {
|
|
12089
12111
|
icon: "box-check",
|
|
12090
|
-
|
|
12091
|
-
|
|
12112
|
+
testID: "check-mark",
|
|
12113
|
+
themeState: themeState
|
|
12092
12114
|
}), /*#__PURE__*/React__default["default"].createElement(StyledCheckbox, {
|
|
12093
|
-
|
|
12115
|
+
themeState: themeState
|
|
12094
12116
|
})));
|
|
12095
12117
|
};
|
|
12096
12118
|
|
|
@@ -13627,6 +13649,7 @@ var StyledBackdrop = index$c(reactNative.Animated.View)(function (_ref2) {
|
|
|
13627
13649
|
right: 0,
|
|
13628
13650
|
top: 0,
|
|
13629
13651
|
bottom: 0,
|
|
13652
|
+
opacity: 0.25,
|
|
13630
13653
|
backgroundColor: theme.__hd__.fab.colors.backdropBackground
|
|
13631
13654
|
};
|
|
13632
13655
|
});
|
|
@@ -13682,10 +13705,6 @@ var ActionGroup = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
13682
13705
|
useNativeDriver: reactNative.Platform.OS !== 'web'
|
|
13683
13706
|
})]).start();
|
|
13684
13707
|
}, [active]);
|
|
13685
|
-
var interpolatedBackdropOpacityAnimation = tranlateXAnimation.current.interpolate({
|
|
13686
|
-
inputRange: [0, 1],
|
|
13687
|
-
outputRange: [0, 0.25]
|
|
13688
|
-
});
|
|
13689
13708
|
var interpolatedActionGroupOpacityAnimation = tranlateXAnimation.current.interpolate({
|
|
13690
13709
|
inputRange: [0, 1],
|
|
13691
13710
|
outputRange: [0, 1]
|
|
@@ -13698,21 +13717,30 @@ var ActionGroup = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
13698
13717
|
testID: testID,
|
|
13699
13718
|
pointerEvents: "box-none",
|
|
13700
13719
|
style: style
|
|
13701
|
-
}, /*#__PURE__*/React__default["default"].createElement(reactNative.
|
|
13720
|
+
}, /*#__PURE__*/React__default["default"].createElement(reactNative.Animated.View, {
|
|
13721
|
+
style: {
|
|
13722
|
+
opacity: interpolatedFABOpacityAnimation
|
|
13723
|
+
}
|
|
13724
|
+
}, /*#__PURE__*/React__default["default"].createElement(StyledFAB, {
|
|
13725
|
+
key: "fab",
|
|
13726
|
+
testID: "fab",
|
|
13727
|
+
icon: fabIcon,
|
|
13728
|
+
onPress: onPress,
|
|
13729
|
+
animated: true,
|
|
13730
|
+
active: active,
|
|
13731
|
+
title: fabTitle,
|
|
13732
|
+
ref: fabRef
|
|
13733
|
+
})), /*#__PURE__*/React__default["default"].createElement(reactNative.Modal, {
|
|
13702
13734
|
visible: active,
|
|
13703
13735
|
animationType: "fade",
|
|
13704
|
-
transparent: true
|
|
13736
|
+
transparent: true,
|
|
13737
|
+
statusBarTranslucent: true
|
|
13705
13738
|
}, /*#__PURE__*/React__default["default"].createElement(StyledContainerInModal, {
|
|
13706
13739
|
testID: testID,
|
|
13707
13740
|
style: [style]
|
|
13708
13741
|
}, /*#__PURE__*/React__default["default"].createElement(StyledBackdrop, {
|
|
13709
|
-
|
|
13710
|
-
testID: "back-drop",
|
|
13711
|
-
style: {
|
|
13712
|
-
opacity: interpolatedBackdropOpacityAnimation
|
|
13713
|
-
}
|
|
13742
|
+
testID: "back-drop"
|
|
13714
13743
|
}), /*#__PURE__*/React__default["default"].createElement(StyledActionGroupContainer, {
|
|
13715
|
-
pointerEvents: active ? 'auto' : 'none',
|
|
13716
13744
|
testID: "action-group",
|
|
13717
13745
|
style: {
|
|
13718
13746
|
opacity: interpolatedActionGroupOpacityAnimation
|
|
@@ -13737,11 +13765,7 @@ var ActionGroup = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
13737
13765
|
index: active ? index : items.length - index,
|
|
13738
13766
|
active: active
|
|
13739
13767
|
}));
|
|
13740
|
-
}))), /*#__PURE__*/React__default["default"].createElement(
|
|
13741
|
-
style: {
|
|
13742
|
-
opacity: interpolatedActionGroupOpacityAnimation
|
|
13743
|
-
}
|
|
13744
|
-
}, /*#__PURE__*/React__default["default"].createElement(StyledFAB, {
|
|
13768
|
+
}))), /*#__PURE__*/React__default["default"].createElement(StyledFAB, {
|
|
13745
13769
|
key: "fab-in-portal",
|
|
13746
13770
|
testID: "fab-in-portal",
|
|
13747
13771
|
icon: fabIcon,
|
|
@@ -13749,20 +13773,7 @@ var ActionGroup = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
13749
13773
|
animated: true,
|
|
13750
13774
|
active: active,
|
|
13751
13775
|
title: fabTitle
|
|
13752
|
-
}))))
|
|
13753
|
-
style: {
|
|
13754
|
-
opacity: interpolatedFABOpacityAnimation
|
|
13755
|
-
}
|
|
13756
|
-
}, /*#__PURE__*/React__default["default"].createElement(StyledFAB, {
|
|
13757
|
-
key: "fab",
|
|
13758
|
-
testID: "fab",
|
|
13759
|
-
icon: fabIcon,
|
|
13760
|
-
onPress: onPress,
|
|
13761
|
-
animated: true,
|
|
13762
|
-
active: active,
|
|
13763
|
-
title: fabTitle,
|
|
13764
|
-
ref: fabRef
|
|
13765
|
-
})));
|
|
13776
|
+
}))));
|
|
13766
13777
|
});
|
|
13767
13778
|
ActionGroup.displayName = 'FAB.ActionGroup';
|
|
13768
13779
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hero-design/rn",
|
|
3
|
-
"version": "8.36.0
|
|
3
|
+
"version": "8.36.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@emotion/native": "^11.9.3",
|
|
23
23
|
"@emotion/react": "^11.9.3",
|
|
24
|
-
"@hero-design/colors": "8.
|
|
24
|
+
"@hero-design/colors": "8.36.0",
|
|
25
25
|
"date-fns": "^2.16.1",
|
|
26
26
|
"events": "^3.2.0",
|
|
27
27
|
"hero-editor": "^1.9.21",
|
|
28
28
|
"nanoid": "^4.0.2"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@hero-design/react-native-month-year-picker": "^8.
|
|
31
|
+
"@hero-design/react-native-month-year-picker": "^8.36.0",
|
|
32
32
|
"@react-native-community/datetimepicker": "^3.5.2",
|
|
33
33
|
"@react-native-community/slider": "4.1.12",
|
|
34
34
|
"react": "18.0.0",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"@babel/preset-typescript": "^7.17.12",
|
|
49
49
|
"@babel/runtime": "^7.18.9",
|
|
50
50
|
"@emotion/jest": "^11.9.3",
|
|
51
|
-
"@hero-design/eslint-plugin": "8.
|
|
52
|
-
"@hero-design/react-native-month-year-picker": "^8.
|
|
51
|
+
"@hero-design/eslint-plugin": "8.36.0",
|
|
52
|
+
"@hero-design/react-native-month-year-picker": "^8.36.0",
|
|
53
53
|
"@react-native-community/datetimepicker": "^3.5.2",
|
|
54
54
|
"@react-native-community/slider": "4.1.12",
|
|
55
55
|
"@rollup/plugin-babel": "^5.3.1",
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
"@types/react-native": "^0.67.7",
|
|
66
66
|
"@types/react-native-vector-icons": "^6.4.10",
|
|
67
67
|
"babel-plugin-inline-import": "^3.0.0",
|
|
68
|
-
"eslint-config-hd": "8.
|
|
68
|
+
"eslint-config-hd": "8.36.0",
|
|
69
69
|
"eslint-plugin-import": "^2.27.5",
|
|
70
70
|
"jest": "^27.3.1",
|
|
71
|
-
"prettier-config-hd": "8.
|
|
71
|
+
"prettier-config-hd": "8.36.0",
|
|
72
72
|
"react": "18.0.0",
|
|
73
73
|
"react-native": "0.69.7",
|
|
74
74
|
"react-native-gesture-handler": "~2.5.0",
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import styled from '@emotion/native';
|
|
2
2
|
import { TouchableOpacity, View } from 'react-native';
|
|
3
|
-
import
|
|
3
|
+
import HeroIcon from '../Icon';
|
|
4
4
|
import Typography from '../Typography';
|
|
5
5
|
|
|
6
|
+
type CheckboxThemeState = 'default' | 'disabled' | 'readonly';
|
|
7
|
+
|
|
6
8
|
export const StyledWrapper = styled(TouchableOpacity)<{
|
|
7
9
|
themeWithBorder: boolean;
|
|
8
|
-
|
|
9
|
-
}>(({ theme, themeWithBorder,
|
|
10
|
+
themeState: CheckboxThemeState;
|
|
11
|
+
}>(({ theme, themeWithBorder, themeState }) => {
|
|
10
12
|
const borderStyle = {
|
|
11
13
|
borderRadius: theme.__hd__.checkbox.radii.wrapper,
|
|
12
14
|
borderWidth: theme.__hd__.checkbox.borderWidths.wrapper,
|
|
13
15
|
padding: theme.__hd__.checkbox.space.wrapperPadding,
|
|
14
|
-
borderColor:
|
|
15
|
-
? theme.__hd__.checkbox.colors.disabledBorder
|
|
16
|
-
: theme.__hd__.checkbox.colors.default,
|
|
16
|
+
borderColor: theme.__hd__.checkbox.colors.borders[themeState],
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
return {
|
|
@@ -33,18 +33,19 @@ export const StyledCheckboxContainer = styled(View)(({ theme }) => ({
|
|
|
33
33
|
overflow: 'hidden',
|
|
34
34
|
}));
|
|
35
35
|
|
|
36
|
-
export const StyledCheckbox = styled(View)<{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
})
|
|
45
|
-
);
|
|
36
|
+
export const StyledCheckbox = styled(View)<{
|
|
37
|
+
themeState: CheckboxThemeState;
|
|
38
|
+
}>(({ theme, themeState }) => ({
|
|
39
|
+
flex: 1,
|
|
40
|
+
borderRadius: theme.__hd__.checkbox.radii.icon,
|
|
41
|
+
borderWidth: theme.__hd__.checkbox.borderWidths.icon,
|
|
42
|
+
borderColor: theme.__hd__.checkbox.colors.borders[themeState],
|
|
43
|
+
}));
|
|
46
44
|
|
|
47
|
-
export const StyledCheckMark = styled(
|
|
45
|
+
export const StyledCheckMark = styled(HeroIcon)<{
|
|
46
|
+
themeState: CheckboxThemeState;
|
|
47
|
+
}>(({ theme, themeState }) => ({
|
|
48
48
|
position: 'absolute',
|
|
49
49
|
top: theme.__hd__.checkbox.space.iconTop,
|
|
50
|
+
color: theme.__hd__.checkbox.colors.borders[themeState],
|
|
50
51
|
}));
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
3
3
|
import { StyledWrapper, StyledCheckbox } from '../StyledCheckbox';
|
|
4
|
+
import { getThemeState } from '..';
|
|
4
5
|
|
|
5
6
|
describe('StyledWrapper', () => {
|
|
6
7
|
it.each`
|
|
7
|
-
withBorder | disabled
|
|
8
|
-
${false} | ${false}
|
|
9
|
-
${true} | ${false}
|
|
10
|
-
${
|
|
8
|
+
withBorder | disabled | readonly
|
|
9
|
+
${false} | ${false} | ${false}
|
|
10
|
+
${true} | ${false} | ${false}
|
|
11
|
+
${false} | ${true} | ${false}
|
|
12
|
+
${true} | ${true} | ${false}
|
|
13
|
+
${false} | ${false} | ${true}
|
|
14
|
+
${true} | ${false} | ${true}
|
|
15
|
+
${false} | ${true} | ${true}
|
|
16
|
+
${true} | ${true} | ${true}
|
|
11
17
|
`(
|
|
12
18
|
'renders correctly when disabled is $disabled, withBorder is $withBorder',
|
|
13
|
-
({ disabled, withBorder }) => {
|
|
19
|
+
({ disabled, withBorder, readonly }) => {
|
|
20
|
+
const themeState = getThemeState({ disabled, readonly });
|
|
14
21
|
const { toJSON } = renderWithTheme(
|
|
15
|
-
<StyledWrapper
|
|
22
|
+
<StyledWrapper themeState={themeState} themeWithBorder={withBorder} />
|
|
16
23
|
);
|
|
17
24
|
|
|
18
25
|
expect(toJSON()).toMatchSnapshot();
|
|
@@ -22,14 +29,20 @@ describe('StyledWrapper', () => {
|
|
|
22
29
|
|
|
23
30
|
describe('StyledCheckbox', () => {
|
|
24
31
|
it.each`
|
|
25
|
-
disabled
|
|
26
|
-
${true}
|
|
27
|
-
${
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
disabled | readonly
|
|
33
|
+
${true} | ${false}
|
|
34
|
+
${true} | ${true}
|
|
35
|
+
${false} | ${false}
|
|
36
|
+
${false} | ${true}
|
|
37
|
+
`(
|
|
38
|
+
'renders correctly when disabled is $disabled and readonly is $readonly',
|
|
39
|
+
({ disabled, readonly }) => {
|
|
40
|
+
const themeState = getThemeState({ disabled, readonly });
|
|
41
|
+
const { toJSON } = renderWithTheme(
|
|
42
|
+
<StyledCheckbox themeState={themeState} />
|
|
43
|
+
);
|
|
32
44
|
|
|
33
|
-
|
|
34
|
-
|
|
45
|
+
expect(toJSON()).toMatchSnapshot();
|
|
46
|
+
}
|
|
47
|
+
);
|
|
35
48
|
});
|