@hero-design/rn 8.11.4-rc.1 → 8.12.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 +9 -9
- package/es/index.js +27 -12
- package/lib/index.js +27 -11
- package/package.json +5 -5
- package/src/components/Select/MultiSelect/__tests__/index.spec.tsx +20 -0
- package/src/components/Select/MultiSelect/index.tsx +1 -1
- package/src/components/Select/SingleSelect/OptionList.tsx +8 -1
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +4 -4
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
- package/src/components/Select/SingleSelect/__tests__/index.spec.tsx +15 -0
- package/src/components/Select/SingleSelect/index.tsx +1 -1
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.spec.tsx.snap +3 -3
- package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +3 -3
- package/src/index.ts +2 -0
- package/src/theme/ThemeSwitcher.tsx +18 -2
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +3 -3
- package/src/theme/components/typography.ts +3 -3
- package/src/theme/global/colors/__tests__/__snapshots__/swagDark.spec.ts.snap +3 -3
- package/src/theme/global/colors/globalDark.ts +1 -1
- package/src/theme/global/colors/swagDark.ts +5 -5
- package/src/theme/index.ts +2 -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/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 +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 +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 +1 -1
- 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/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 +0 -0
- 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 +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 +2 -2
- package/types/testHelpers/renderWithTheme.d.ts +0 -0
- package/types/theme/ThemeProvider.d.ts +0 -0
- package/types/theme/ThemeSwitcher.d.ts +3 -2
- 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 +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 +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/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 +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 +2 -2
- 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/.turbo/turbo-build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
[
|
|
2
|
-
[
|
|
3
|
-
[
|
|
4
|
-
[
|
|
5
|
-
[
|
|
6
|
-
[
|
|
7
|
-
[
|
|
8
|
-
[
|
|
9
|
-
[
|
|
1
|
+
[35m@hero-design/rn:build[0m: cache hit, replaying output [2mbe75cdb303db3812[0m
|
|
2
|
+
[35m@hero-design/rn:build: [0m$ yarn build:js && yarn build:types
|
|
3
|
+
[35m@hero-design/rn:build: [0m$ rollup -c
|
|
4
|
+
[35m@hero-design/rn:build: [0m[36m
|
|
5
|
+
[35m@hero-design/rn:build: [0m[1msrc/index.ts[22m → [1mlib/index.js, es/index.js[22m...[39m
|
|
6
|
+
[35m@hero-design/rn:build: [0m[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
|
|
7
|
+
[35m@hero-design/rn:build: [0m[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
|
|
8
|
+
[35m@hero-design/rn:build: [0m[32mcreated [1mlib/index.js, es/index.js[22m in [1m23.2s[22m[39m
|
|
9
|
+
[35m@hero-design/rn:build: [0m$ tsc --noEmit false --emitDeclarationOnly --project tsconfig.prod.json
|
package/es/index.js
CHANGED
|
@@ -1274,7 +1274,10 @@ var palette$2 = Object.assign(Object.assign({}, palette$8), {
|
|
|
1274
1274
|
violetLight90: violet1.lighten90,
|
|
1275
1275
|
violet: violet1.base,
|
|
1276
1276
|
mauve: mauve.base,
|
|
1277
|
+
mauveLight15: mauve.lighten15,
|
|
1277
1278
|
mauveLight30: mauve.lighten30,
|
|
1279
|
+
mauveLight40: mauve.lighten40,
|
|
1280
|
+
mauveDark65: mauve.darken65,
|
|
1278
1281
|
maasstrichtBlueLight10: maasstrichtBlue.lighten10,
|
|
1279
1282
|
maasstrichtBlueDark20: maasstrichtBlue.darken20
|
|
1280
1283
|
});
|
|
@@ -1400,18 +1403,18 @@ var globalPalette = {
|
|
|
1400
1403
|
// End of Updated 21 / Nov / 22
|
|
1401
1404
|
};
|
|
1402
1405
|
|
|
1403
|
-
var
|
|
1406
|
+
var swagDarkBrandSystemPalette = {
|
|
1404
1407
|
primary: palette$2.mauve,
|
|
1405
1408
|
onPrimary: palette$2.maasstrichtBlue,
|
|
1406
|
-
secondary: palette$2.
|
|
1409
|
+
secondary: palette$2.mauveLight40,
|
|
1407
1410
|
onSecondary: palette$2.maasstrichtBlue,
|
|
1408
1411
|
defaultSurface: palette$2.maasstrichtBlue,
|
|
1409
|
-
highlightedSurface: palette$2.
|
|
1410
|
-
pressedSurface: palette$2.
|
|
1412
|
+
highlightedSurface: palette$2.mauveDark65,
|
|
1413
|
+
pressedSurface: palette$2.mauveLight15,
|
|
1411
1414
|
decorativePrimary: palette$2.maasstrichtBlue,
|
|
1412
1415
|
decorativePrimarySurface: palette$2.maasstrichtBlueLight10
|
|
1413
1416
|
};
|
|
1414
|
-
var swagDarkSystemPalette = _objectSpread2(_objectSpread2({}, globalPalette),
|
|
1417
|
+
var swagDarkSystemPalette = _objectSpread2(_objectSpread2({}, globalPalette), swagDarkBrandSystemPalette);
|
|
1415
1418
|
|
|
1416
1419
|
var workBrandSystemPallete = {
|
|
1417
1420
|
primary: palette.policeBlue,
|
|
@@ -2841,9 +2844,9 @@ var getTypographyTheme = function getTypographyTheme(theme) {
|
|
|
2841
2844
|
primary: theme.colors.primary,
|
|
2842
2845
|
secondary: theme.colors.secondary,
|
|
2843
2846
|
info: theme.colors.onInfoSurface,
|
|
2844
|
-
danger: theme.colors.
|
|
2845
|
-
warning: theme.colors.
|
|
2846
|
-
success: theme.colors.
|
|
2847
|
+
danger: theme.colors.error,
|
|
2848
|
+
warning: theme.colors.warning,
|
|
2849
|
+
success: theme.colors.success,
|
|
2847
2850
|
inverted: theme.colors.onDarkGlobalSurface,
|
|
2848
2851
|
archived: theme.colors.onArchivedSurface
|
|
2849
2852
|
};
|
|
@@ -4105,12 +4108,21 @@ var ThemeSwitcher = function ThemeSwitcher(_ref) {
|
|
|
4105
4108
|
return getTheme$1(scale$1, walletSystemPalette);
|
|
4106
4109
|
case 'eBens':
|
|
4107
4110
|
return getTheme$1(scale$1, eBensSystemPalette);
|
|
4111
|
+
case 'swagDark':
|
|
4112
|
+
return getTheme$1(scale$1, swagDarkSystemPalette);
|
|
4108
4113
|
}
|
|
4109
4114
|
}, [name]);
|
|
4110
4115
|
return /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
4111
4116
|
theme: theme
|
|
4112
4117
|
}, children);
|
|
4113
4118
|
};
|
|
4119
|
+
var withTheme = function withTheme(C, themeName) {
|
|
4120
|
+
return function (props) {
|
|
4121
|
+
return /*#__PURE__*/React.createElement(ThemeSwitcher, {
|
|
4122
|
+
name: themeName
|
|
4123
|
+
}, /*#__PURE__*/React.createElement(C, props));
|
|
4124
|
+
};
|
|
4125
|
+
};
|
|
4114
4126
|
|
|
4115
4127
|
var defaultTheme = getTheme$1();
|
|
4116
4128
|
|
|
@@ -13803,7 +13815,7 @@ function MultiSelect(_ref) {
|
|
|
13803
13815
|
pointerEvents: "none",
|
|
13804
13816
|
style: style,
|
|
13805
13817
|
testID: testID,
|
|
13806
|
-
renderInputValue: renderSelectedValue !== undefined ? function (props) {
|
|
13818
|
+
renderInputValue: renderSelectedValue !== undefined && (displayedValue === null || displayedValue === void 0 ? void 0 : displayedValue.length) > 0 ? function (props) {
|
|
13807
13819
|
return renderSelectedValue(value, props);
|
|
13808
13820
|
} : undefined
|
|
13809
13821
|
}))))), /*#__PURE__*/React.createElement(BottomSheet$1, {
|
|
@@ -13930,7 +13942,10 @@ var OptionList = function OptionList(_ref) {
|
|
|
13930
13942
|
onQueryChange: onQueryChange,
|
|
13931
13943
|
sections: sections,
|
|
13932
13944
|
renderItem: renderItem,
|
|
13933
|
-
sectionListRef: sectionListRef
|
|
13945
|
+
sectionListRef: sectionListRef,
|
|
13946
|
+
style: _objectSpread2({}, onQueryChange ? {
|
|
13947
|
+
height: Dimensions.get('screen').height
|
|
13948
|
+
} : {})
|
|
13934
13949
|
}, rest));
|
|
13935
13950
|
};
|
|
13936
13951
|
|
|
@@ -13990,7 +14005,7 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
13990
14005
|
pointerEvents: "none",
|
|
13991
14006
|
style: style,
|
|
13992
14007
|
testID: testID,
|
|
13993
|
-
renderInputValue: renderSelectedValue !== undefined ? function (props) {
|
|
14008
|
+
renderInputValue: renderSelectedValue !== undefined && !!displayedValue ? function (props) {
|
|
13994
14009
|
return renderSelectedValue(value, props);
|
|
13995
14010
|
} : undefined
|
|
13996
14011
|
}))))), /*#__PURE__*/React.createElement(BottomSheet$1, {
|
|
@@ -31686,4 +31701,4 @@ var index = Object.assign(RichTextEditor$1, {
|
|
|
31686
31701
|
Toolbar: EditorToolbar
|
|
31687
31702
|
});
|
|
31688
31703
|
|
|
31689
|
-
export { Accordion, Alert, Attachment, index$9 as Avatar, Badge$1 as Badge, BottomNavigation, BottomSheet$1 as BottomSheet, Box, CompoundButton as Button, Calendar, Card$1 as Card, index$8 as Carousel, Checkbox, Collapse, ContentNavigator, DatePicker, Divider, index$7 as Drawer, Empty, index$6 as FAB, Icon, Image, List, PageControl, PinInput, Progress, CompoundRadio as Radio, RefreshControl, index as RichTextEditor, SectionHeading, index$4 as Select, Slider, Spinner, index$5 as Swipeable, index$3 as Switch, index$2 as Tabs, Tag, TextInput, ThemeProvider, ThemeSwitcher, TimePicker, Toast, index$1 as Toolbar, Typography, eBensSystemPalette, getTheme$1 as getTheme, jobsSystemPalette, scale, swagDarkSystemPalette, swagSystemPalette, defaultTheme as theme, useAvatarColors, useTheme, walletSystemPalette, workSystemPalette };
|
|
31704
|
+
export { Accordion, Alert, Attachment, index$9 as Avatar, Badge$1 as Badge, BottomNavigation, BottomSheet$1 as BottomSheet, Box, CompoundButton as Button, Calendar, Card$1 as Card, index$8 as Carousel, Checkbox, Collapse, ContentNavigator, DatePicker, Divider, index$7 as Drawer, Empty, index$6 as FAB, Icon, Image, List, PageControl, PinInput, Progress, CompoundRadio as Radio, RefreshControl, index as RichTextEditor, SectionHeading, index$4 as Select, Slider, Spinner, index$5 as Swipeable, index$3 as Switch, index$2 as Tabs, Tag, TextInput, ThemeProvider, ThemeSwitcher, TimePicker, Toast, index$1 as Toolbar, Typography, eBensSystemPalette, getTheme$1 as getTheme, jobsSystemPalette, scale, swagDarkSystemPalette, swagSystemPalette, defaultTheme as theme, useAvatarColors, useTheme, walletSystemPalette, withTheme, workSystemPalette };
|
package/lib/index.js
CHANGED
|
@@ -1303,7 +1303,10 @@ var palette$2 = Object.assign(Object.assign({}, palette$8), {
|
|
|
1303
1303
|
violetLight90: violet1.lighten90,
|
|
1304
1304
|
violet: violet1.base,
|
|
1305
1305
|
mauve: mauve.base,
|
|
1306
|
+
mauveLight15: mauve.lighten15,
|
|
1306
1307
|
mauveLight30: mauve.lighten30,
|
|
1308
|
+
mauveLight40: mauve.lighten40,
|
|
1309
|
+
mauveDark65: mauve.darken65,
|
|
1307
1310
|
maasstrichtBlueLight10: maasstrichtBlue.lighten10,
|
|
1308
1311
|
maasstrichtBlueDark20: maasstrichtBlue.darken20
|
|
1309
1312
|
});
|
|
@@ -1429,18 +1432,18 @@ var globalPalette = {
|
|
|
1429
1432
|
// End of Updated 21 / Nov / 22
|
|
1430
1433
|
};
|
|
1431
1434
|
|
|
1432
|
-
var
|
|
1435
|
+
var swagDarkBrandSystemPalette = {
|
|
1433
1436
|
primary: palette$2.mauve,
|
|
1434
1437
|
onPrimary: palette$2.maasstrichtBlue,
|
|
1435
|
-
secondary: palette$2.
|
|
1438
|
+
secondary: palette$2.mauveLight40,
|
|
1436
1439
|
onSecondary: palette$2.maasstrichtBlue,
|
|
1437
1440
|
defaultSurface: palette$2.maasstrichtBlue,
|
|
1438
|
-
highlightedSurface: palette$2.
|
|
1439
|
-
pressedSurface: palette$2.
|
|
1441
|
+
highlightedSurface: palette$2.mauveDark65,
|
|
1442
|
+
pressedSurface: palette$2.mauveLight15,
|
|
1440
1443
|
decorativePrimary: palette$2.maasstrichtBlue,
|
|
1441
1444
|
decorativePrimarySurface: palette$2.maasstrichtBlueLight10
|
|
1442
1445
|
};
|
|
1443
|
-
var swagDarkSystemPalette = _objectSpread2(_objectSpread2({}, globalPalette),
|
|
1446
|
+
var swagDarkSystemPalette = _objectSpread2(_objectSpread2({}, globalPalette), swagDarkBrandSystemPalette);
|
|
1444
1447
|
|
|
1445
1448
|
var workBrandSystemPallete = {
|
|
1446
1449
|
primary: palette.policeBlue,
|
|
@@ -2870,9 +2873,9 @@ var getTypographyTheme = function getTypographyTheme(theme) {
|
|
|
2870
2873
|
primary: theme.colors.primary,
|
|
2871
2874
|
secondary: theme.colors.secondary,
|
|
2872
2875
|
info: theme.colors.onInfoSurface,
|
|
2873
|
-
danger: theme.colors.
|
|
2874
|
-
warning: theme.colors.
|
|
2875
|
-
success: theme.colors.
|
|
2876
|
+
danger: theme.colors.error,
|
|
2877
|
+
warning: theme.colors.warning,
|
|
2878
|
+
success: theme.colors.success,
|
|
2876
2879
|
inverted: theme.colors.onDarkGlobalSurface,
|
|
2877
2880
|
archived: theme.colors.onArchivedSurface
|
|
2878
2881
|
};
|
|
@@ -4134,12 +4137,21 @@ var ThemeSwitcher = function ThemeSwitcher(_ref) {
|
|
|
4134
4137
|
return getTheme$1(scale$1, walletSystemPalette);
|
|
4135
4138
|
case 'eBens':
|
|
4136
4139
|
return getTheme$1(scale$1, eBensSystemPalette);
|
|
4140
|
+
case 'swagDark':
|
|
4141
|
+
return getTheme$1(scale$1, swagDarkSystemPalette);
|
|
4137
4142
|
}
|
|
4138
4143
|
}, [name]);
|
|
4139
4144
|
return /*#__PURE__*/React__default["default"].createElement(ThemeProvider, {
|
|
4140
4145
|
theme: theme
|
|
4141
4146
|
}, children);
|
|
4142
4147
|
};
|
|
4148
|
+
var withTheme = function withTheme(C, themeName) {
|
|
4149
|
+
return function (props) {
|
|
4150
|
+
return /*#__PURE__*/React__default["default"].createElement(ThemeSwitcher, {
|
|
4151
|
+
name: themeName
|
|
4152
|
+
}, /*#__PURE__*/React__default["default"].createElement(C, props));
|
|
4153
|
+
};
|
|
4154
|
+
};
|
|
4143
4155
|
|
|
4144
4156
|
var defaultTheme = getTheme$1();
|
|
4145
4157
|
|
|
@@ -13832,7 +13844,7 @@ function MultiSelect(_ref) {
|
|
|
13832
13844
|
pointerEvents: "none",
|
|
13833
13845
|
style: style,
|
|
13834
13846
|
testID: testID,
|
|
13835
|
-
renderInputValue: renderSelectedValue !== undefined ? function (props) {
|
|
13847
|
+
renderInputValue: renderSelectedValue !== undefined && (displayedValue === null || displayedValue === void 0 ? void 0 : displayedValue.length) > 0 ? function (props) {
|
|
13836
13848
|
return renderSelectedValue(value, props);
|
|
13837
13849
|
} : undefined
|
|
13838
13850
|
}))))), /*#__PURE__*/React__default["default"].createElement(BottomSheet$1, {
|
|
@@ -13959,7 +13971,10 @@ var OptionList = function OptionList(_ref) {
|
|
|
13959
13971
|
onQueryChange: onQueryChange,
|
|
13960
13972
|
sections: sections,
|
|
13961
13973
|
renderItem: renderItem,
|
|
13962
|
-
sectionListRef: sectionListRef
|
|
13974
|
+
sectionListRef: sectionListRef,
|
|
13975
|
+
style: _objectSpread2({}, onQueryChange ? {
|
|
13976
|
+
height: reactNative.Dimensions.get('screen').height
|
|
13977
|
+
} : {})
|
|
13963
13978
|
}, rest));
|
|
13964
13979
|
};
|
|
13965
13980
|
|
|
@@ -14019,7 +14034,7 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
14019
14034
|
pointerEvents: "none",
|
|
14020
14035
|
style: style,
|
|
14021
14036
|
testID: testID,
|
|
14022
|
-
renderInputValue: renderSelectedValue !== undefined ? function (props) {
|
|
14037
|
+
renderInputValue: renderSelectedValue !== undefined && !!displayedValue ? function (props) {
|
|
14023
14038
|
return renderSelectedValue(value, props);
|
|
14024
14039
|
} : undefined
|
|
14025
14040
|
}))))), /*#__PURE__*/React__default["default"].createElement(BottomSheet$1, {
|
|
@@ -31769,4 +31784,5 @@ exports.theme = defaultTheme;
|
|
|
31769
31784
|
exports.useAvatarColors = useAvatarColors;
|
|
31770
31785
|
exports.useTheme = useTheme;
|
|
31771
31786
|
exports.walletSystemPalette = walletSystemPalette;
|
|
31787
|
+
exports.withTheme = withTheme;
|
|
31772
31788
|
exports.workSystemPalette = workSystemPalette;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hero-design/rn",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.12.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
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.12.0",
|
|
25
25
|
"date-fns": "^2.16.1",
|
|
26
26
|
"events": "^3.2.0",
|
|
27
27
|
"hero-editor": "^1.9.21"
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@babel/preset-typescript": "^7.17.12",
|
|
45
45
|
"@babel/runtime": "^7.18.9",
|
|
46
46
|
"@emotion/jest": "^11.9.3",
|
|
47
|
-
"@hero-design/eslint-plugin": "8.
|
|
47
|
+
"@hero-design/eslint-plugin": "8.12.0",
|
|
48
48
|
"@react-native-community/datetimepicker": "^3.5.2",
|
|
49
49
|
"@react-native-community/slider": "4.1.12",
|
|
50
50
|
"@rollup/plugin-babel": "^5.3.1",
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"@types/react-native": "^0.67.7",
|
|
61
61
|
"@types/react-native-vector-icons": "^6.4.10",
|
|
62
62
|
"babel-plugin-inline-import": "^3.0.0",
|
|
63
|
-
"eslint-config-hd": "8.
|
|
63
|
+
"eslint-config-hd": "8.12.0",
|
|
64
64
|
"jest": "^27.3.1",
|
|
65
|
-
"prettier-config-hd": "8.
|
|
65
|
+
"prettier-config-hd": "8.12.0",
|
|
66
66
|
"react": "18.0.0",
|
|
67
67
|
"react-native": "0.69.7",
|
|
68
68
|
"react-native-gesture-handler": "~2.1.0",
|
|
@@ -198,6 +198,26 @@ describe('rendering', () => {
|
|
|
198
198
|
expect(getByText('Custom daemon')).toBeTruthy();
|
|
199
199
|
});
|
|
200
200
|
|
|
201
|
+
it('does not render custom value when value is empty', () => {
|
|
202
|
+
const { queryByText } = renderWithTheme(
|
|
203
|
+
<MultiSelect<string, CustomOptionType>
|
|
204
|
+
label="Choose collaborators"
|
|
205
|
+
footerLabel="Confirm"
|
|
206
|
+
options={collaboratorSections}
|
|
207
|
+
value={[]}
|
|
208
|
+
onConfirm={jest.fn()}
|
|
209
|
+
renderSelectedValue={(selectedValue, _inputProps) => (
|
|
210
|
+
<>
|
|
211
|
+
{selectedValue.map(() => (
|
|
212
|
+
<Typography.Text>Custom value</Typography.Text>
|
|
213
|
+
))}
|
|
214
|
+
</>
|
|
215
|
+
)}
|
|
216
|
+
/>
|
|
217
|
+
);
|
|
218
|
+
expect(queryByText('Custom value')).toBeNull();
|
|
219
|
+
});
|
|
220
|
+
|
|
201
221
|
it('allows custom footer', () => {
|
|
202
222
|
const { getByText, queryByText } = renderWithTheme(
|
|
203
223
|
<MultiSelect<string, CustomOptionType>
|
|
@@ -111,7 +111,7 @@ function MultiSelect<V, T extends OptionType<V>>({
|
|
|
111
111
|
style={style}
|
|
112
112
|
testID={testID}
|
|
113
113
|
renderInputValue={
|
|
114
|
-
renderSelectedValue !== undefined
|
|
114
|
+
renderSelectedValue !== undefined && displayedValue?.length > 0
|
|
115
115
|
? (props) => renderSelectedValue(value, props)
|
|
116
116
|
: undefined
|
|
117
117
|
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import {
|
|
3
|
+
SectionListRenderItemInfo,
|
|
4
|
+
SectionList,
|
|
5
|
+
Dimensions,
|
|
6
|
+
} from 'react-native';
|
|
3
7
|
import Option from './Option';
|
|
4
8
|
import type { SingleSelectProps } from '.';
|
|
5
9
|
import type { OptionType, SectionType } from '../types';
|
|
@@ -64,6 +68,9 @@ const OptionList = <V, T extends OptionType<V>>({
|
|
|
64
68
|
sections={sections}
|
|
65
69
|
renderItem={renderItem}
|
|
66
70
|
sectionListRef={sectionListRef}
|
|
71
|
+
style={{
|
|
72
|
+
...(onQueryChange ? { height: Dimensions.get('screen').height } : {}),
|
|
73
|
+
}}
|
|
67
74
|
{...rest}
|
|
68
75
|
/>
|
|
69
76
|
);
|
|
@@ -70,7 +70,7 @@ exports[`OptionList render isLoading correctly 1`] = `
|
|
|
70
70
|
Object {
|
|
71
71
|
"paddingBottom": 16,
|
|
72
72
|
},
|
|
73
|
-
|
|
73
|
+
Object {},
|
|
74
74
|
],
|
|
75
75
|
]
|
|
76
76
|
}
|
|
@@ -852,7 +852,7 @@ exports[`OptionList renders correctly 1`] = `
|
|
|
852
852
|
Object {
|
|
853
853
|
"paddingBottom": 16,
|
|
854
854
|
},
|
|
855
|
-
|
|
855
|
+
Object {},
|
|
856
856
|
],
|
|
857
857
|
]
|
|
858
858
|
}
|
|
@@ -1481,7 +1481,7 @@ exports[`OptionList trigger onPress correctly on select new value 1`] = `
|
|
|
1481
1481
|
Object {
|
|
1482
1482
|
"paddingBottom": 16,
|
|
1483
1483
|
},
|
|
1484
|
-
|
|
1484
|
+
Object {},
|
|
1485
1485
|
],
|
|
1486
1486
|
]
|
|
1487
1487
|
}
|
|
@@ -2110,7 +2110,7 @@ exports[`OptionList trigger onPress correctly on unselect current value 1`] = `
|
|
|
2110
2110
|
Object {
|
|
2111
2111
|
"paddingBottom": 16,
|
|
2112
2112
|
},
|
|
2113
|
-
|
|
2113
|
+
Object {},
|
|
2114
2114
|
],
|
|
2115
2115
|
]
|
|
2116
2116
|
}
|
|
@@ -460,7 +460,7 @@ Array [
|
|
|
460
460
|
Object {
|
|
461
461
|
"paddingBottom": 16,
|
|
462
462
|
},
|
|
463
|
-
|
|
463
|
+
Object {},
|
|
464
464
|
],
|
|
465
465
|
]
|
|
466
466
|
}
|
|
@@ -1956,7 +1956,7 @@ Array [
|
|
|
1956
1956
|
Object {
|
|
1957
1957
|
"paddingBottom": 16,
|
|
1958
1958
|
},
|
|
1959
|
-
|
|
1959
|
+
Object {},
|
|
1960
1960
|
],
|
|
1961
1961
|
]
|
|
1962
1962
|
}
|
|
@@ -3574,7 +3574,7 @@ Array [
|
|
|
3574
3574
|
Object {
|
|
3575
3575
|
"paddingBottom": 16,
|
|
3576
3576
|
},
|
|
3577
|
-
|
|
3577
|
+
Object {},
|
|
3578
3578
|
],
|
|
3579
3579
|
]
|
|
3580
3580
|
}
|
|
@@ -182,6 +182,21 @@ describe('rendering', () => {
|
|
|
182
182
|
);
|
|
183
183
|
expect(getByText('Custom daniel')).toBeTruthy();
|
|
184
184
|
});
|
|
185
|
+
|
|
186
|
+
it('does not render custom value when value is empty', () => {
|
|
187
|
+
const { queryByText } = renderWithTheme(
|
|
188
|
+
<SingleSelect<string, CustomOptionType>
|
|
189
|
+
label="Choose collaborators"
|
|
190
|
+
options={collaboratorSections}
|
|
191
|
+
value=""
|
|
192
|
+
onConfirm={jest.fn()}
|
|
193
|
+
renderSelectedValue={() => (
|
|
194
|
+
<Typography.Text>Custom value</Typography.Text>
|
|
195
|
+
)}
|
|
196
|
+
/>
|
|
197
|
+
);
|
|
198
|
+
expect(queryByText('Custom value')).toBeNull();
|
|
199
|
+
});
|
|
185
200
|
});
|
|
186
201
|
|
|
187
202
|
describe('behavior', () => {
|
|
@@ -88,7 +88,7 @@ const SingleSelect = <V, T extends OptionType<V>>({
|
|
|
88
88
|
style={style}
|
|
89
89
|
testID={testID}
|
|
90
90
|
renderInputValue={
|
|
91
|
-
renderSelectedValue !== undefined
|
|
91
|
+
renderSelectedValue !== undefined && !!displayedValue
|
|
92
92
|
? (props) => renderSelectedValue(value, props)
|
|
93
93
|
: undefined
|
|
94
94
|
}
|
|
@@ -113,7 +113,7 @@ exports[`ToolbarItems renders correctly when intent is danger 1`] = `
|
|
|
113
113
|
style={
|
|
114
114
|
Array [
|
|
115
115
|
Object {
|
|
116
|
-
"color": "#
|
|
116
|
+
"color": "#f46363",
|
|
117
117
|
"fontFamily": "BeVietnamPro-SemiBold",
|
|
118
118
|
"fontSize": 12,
|
|
119
119
|
"letterSpacing": 0.36,
|
|
@@ -311,7 +311,7 @@ exports[`ToolbarItems renders correctly when intent is success 1`] = `
|
|
|
311
311
|
style={
|
|
312
312
|
Array [
|
|
313
313
|
Object {
|
|
314
|
-
"color": "#
|
|
314
|
+
"color": "#5ace7d",
|
|
315
315
|
"fontFamily": "BeVietnamPro-SemiBold",
|
|
316
316
|
"fontSize": 12,
|
|
317
317
|
"letterSpacing": 0.36,
|
|
@@ -377,7 +377,7 @@ exports[`ToolbarItems renders correctly when intent is warning 1`] = `
|
|
|
377
377
|
style={
|
|
378
378
|
Array [
|
|
379
379
|
Object {
|
|
380
|
-
"color": "#
|
|
380
|
+
"color": "#ffbe71",
|
|
381
381
|
"fontFamily": "BeVietnamPro-SemiBold",
|
|
382
382
|
"fontSize": 12,
|
|
383
383
|
"letterSpacing": 0.36,
|
|
@@ -28,7 +28,7 @@ exports[`StyledText has danger intent style 1`] = `
|
|
|
28
28
|
style={
|
|
29
29
|
Array [
|
|
30
30
|
Object {
|
|
31
|
-
"color": "#
|
|
31
|
+
"color": "#f46363",
|
|
32
32
|
"fontFamily": "BeVietnamPro-Regular",
|
|
33
33
|
"fontSize": 14,
|
|
34
34
|
"letterSpacing": 0.42,
|
|
@@ -327,7 +327,7 @@ exports[`StyledText has success intent style 1`] = `
|
|
|
327
327
|
style={
|
|
328
328
|
Array [
|
|
329
329
|
Object {
|
|
330
|
-
"color": "#
|
|
330
|
+
"color": "#5ace7d",
|
|
331
331
|
"fontFamily": "BeVietnamPro-Regular",
|
|
332
332
|
"fontSize": 14,
|
|
333
333
|
"letterSpacing": 0.42,
|
|
@@ -350,7 +350,7 @@ exports[`StyledText has warning intent style 1`] = `
|
|
|
350
350
|
style={
|
|
351
351
|
Array [
|
|
352
352
|
Object {
|
|
353
|
-
"color": "#
|
|
353
|
+
"color": "#ffbe71",
|
|
354
354
|
"fontFamily": "BeVietnamPro-Regular",
|
|
355
355
|
"fontSize": 14,
|
|
356
356
|
"letterSpacing": 0.42,
|
package/src/index.ts
CHANGED
|
@@ -9,6 +9,7 @@ import theme, {
|
|
|
9
9
|
walletSystemPalette,
|
|
10
10
|
eBensSystemPalette,
|
|
11
11
|
ThemeSwitcher,
|
|
12
|
+
withTheme,
|
|
12
13
|
} from './theme';
|
|
13
14
|
import { scale } from './utils/scale';
|
|
14
15
|
|
|
@@ -62,6 +63,7 @@ export {
|
|
|
62
63
|
scale,
|
|
63
64
|
ThemeProvider,
|
|
64
65
|
ThemeSwitcher,
|
|
66
|
+
withTheme,
|
|
65
67
|
swagSystemPalette,
|
|
66
68
|
swagDarkSystemPalette,
|
|
67
69
|
workSystemPalette,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
1
|
+
import React, { PropsWithChildren, useMemo } from 'react';
|
|
2
2
|
|
|
3
3
|
import getTheme from './getTheme';
|
|
4
4
|
import {
|
|
@@ -8,10 +8,11 @@ import {
|
|
|
8
8
|
jobsSystemPalette,
|
|
9
9
|
walletSystemPalette,
|
|
10
10
|
eBensSystemPalette,
|
|
11
|
+
swagDarkSystemPalette,
|
|
11
12
|
} from './global';
|
|
12
13
|
import ThemeProvider from './ThemeProvider';
|
|
13
14
|
|
|
14
|
-
type ThemeName = 'swag' | 'work' | 'jobs' | 'wallet' | 'eBens';
|
|
15
|
+
type ThemeName = 'swag' | 'swagDark' | 'work' | 'jobs' | 'wallet' | 'eBens';
|
|
15
16
|
|
|
16
17
|
const ThemeSwitcher = ({
|
|
17
18
|
name = 'swag',
|
|
@@ -32,9 +33,24 @@ const ThemeSwitcher = ({
|
|
|
32
33
|
return getTheme(defaultScale, walletSystemPalette);
|
|
33
34
|
case 'eBens':
|
|
34
35
|
return getTheme(defaultScale, eBensSystemPalette);
|
|
36
|
+
case 'swagDark':
|
|
37
|
+
return getTheme(defaultScale, swagDarkSystemPalette);
|
|
35
38
|
}
|
|
36
39
|
}, [name]);
|
|
37
40
|
return <ThemeProvider theme={theme}>{children}</ThemeProvider>;
|
|
38
41
|
};
|
|
39
42
|
|
|
43
|
+
export const withTheme =
|
|
44
|
+
<P extends Record<string, unknown>>(
|
|
45
|
+
C: React.ComponentType<P>,
|
|
46
|
+
themeName: ThemeName
|
|
47
|
+
) =>
|
|
48
|
+
(props: PropsWithChildren<P>) => {
|
|
49
|
+
return (
|
|
50
|
+
<ThemeSwitcher name={themeName}>
|
|
51
|
+
<C {...props} />
|
|
52
|
+
</ThemeSwitcher>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
|
|
40
56
|
export default ThemeSwitcher;
|
|
@@ -949,14 +949,14 @@ Object {
|
|
|
949
949
|
"colors": Object {
|
|
950
950
|
"archived": "#737479",
|
|
951
951
|
"body": "#001f23",
|
|
952
|
-
"danger": "#
|
|
952
|
+
"danger": "#f46363",
|
|
953
953
|
"info": "#4568fb",
|
|
954
954
|
"inverted": "#ffffff",
|
|
955
955
|
"primary": "#401960",
|
|
956
956
|
"secondary": "#795e90",
|
|
957
957
|
"subdued": "#4d6265",
|
|
958
|
-
"success": "#
|
|
959
|
-
"warning": "#
|
|
958
|
+
"success": "#5ace7d",
|
|
959
|
+
"warning": "#ffbe71",
|
|
960
960
|
},
|
|
961
961
|
"fontSizes": Object {
|
|
962
962
|
"6xlarge": 36,
|
|
@@ -7,9 +7,9 @@ const getTypographyTheme = (theme: GlobalTheme) => {
|
|
|
7
7
|
primary: theme.colors.primary,
|
|
8
8
|
secondary: theme.colors.secondary,
|
|
9
9
|
info: theme.colors.onInfoSurface,
|
|
10
|
-
danger: theme.colors.
|
|
11
|
-
warning: theme.colors.
|
|
12
|
-
success: theme.colors.
|
|
10
|
+
danger: theme.colors.error,
|
|
11
|
+
warning: theme.colors.warning,
|
|
12
|
+
success: theme.colors.success,
|
|
13
13
|
inverted: theme.colors.onDarkGlobalSurface,
|
|
14
14
|
archived: theme.colors.onArchivedSurface,
|
|
15
15
|
};
|
|
@@ -13,7 +13,7 @@ Object {
|
|
|
13
13
|
"disabledOutline": "#82858a",
|
|
14
14
|
"error": "#f46363",
|
|
15
15
|
"errorSurface": "#fcebe7",
|
|
16
|
-
"highlightedSurface": "#
|
|
16
|
+
"highlightedSurface": "#443153",
|
|
17
17
|
"inactiveOnDefaultGlobalSurface": "#99a5a7",
|
|
18
18
|
"inactiveOutline": "#99a5a7",
|
|
19
19
|
"info": "#b5c3fd",
|
|
@@ -35,10 +35,10 @@ Object {
|
|
|
35
35
|
"onSuccessSurface": "#017d6d",
|
|
36
36
|
"onWarningSurface": "#ffa234",
|
|
37
37
|
"overlayGlobalSurface": "#727478",
|
|
38
|
-
"pressedSurface": "#
|
|
38
|
+
"pressedSurface": "#cc9df1",
|
|
39
39
|
"primary": "#c38cee",
|
|
40
40
|
"primaryOutline": "#ffffff",
|
|
41
|
-
"secondary": "#
|
|
41
|
+
"secondary": "#dbbaf5",
|
|
42
42
|
"secondaryOutline": "#193539",
|
|
43
43
|
"success": "#5ace7d",
|
|
44
44
|
"successSurface": "#f0fef4",
|
|
@@ -2,14 +2,14 @@ import { swagDarkPalette as palette } from '@hero-design/colors';
|
|
|
2
2
|
import type { SystemPalette, BrandSystemPalette } from './types';
|
|
3
3
|
import globalDarkPalette from './globalDark';
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const swagDarkBrandSystemPalette: BrandSystemPalette = {
|
|
6
6
|
primary: palette.mauve,
|
|
7
7
|
onPrimary: palette.maasstrichtBlue,
|
|
8
|
-
secondary: palette.
|
|
8
|
+
secondary: palette.mauveLight40,
|
|
9
9
|
onSecondary: palette.maasstrichtBlue,
|
|
10
10
|
defaultSurface: palette.maasstrichtBlue,
|
|
11
|
-
highlightedSurface: palette.
|
|
12
|
-
pressedSurface: palette.
|
|
11
|
+
highlightedSurface: palette.mauveDark65,
|
|
12
|
+
pressedSurface: palette.mauveLight15,
|
|
13
13
|
|
|
14
14
|
decorativePrimary: palette.maasstrichtBlue,
|
|
15
15
|
decorativePrimarySurface: palette.maasstrichtBlueLight10,
|
|
@@ -19,7 +19,7 @@ const swagDarkSystemPalette: SystemPalette = {
|
|
|
19
19
|
// Global
|
|
20
20
|
...globalDarkPalette,
|
|
21
21
|
// Brand
|
|
22
|
-
...
|
|
22
|
+
...swagDarkBrandSystemPalette,
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
export default swagDarkSystemPalette;
|
package/src/theme/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import getTheme from './getTheme';
|
|
2
2
|
import ThemeProvider, { useTheme } from './ThemeProvider';
|
|
3
|
-
import ThemeSwitcher from './ThemeSwitcher';
|
|
3
|
+
import ThemeSwitcher, { withTheme } from './ThemeSwitcher';
|
|
4
4
|
import {
|
|
5
5
|
swagSystemPalette,
|
|
6
6
|
swagDarkSystemPalette,
|
|
@@ -17,6 +17,7 @@ const defaultTheme = getTheme();
|
|
|
17
17
|
export type { Theme };
|
|
18
18
|
|
|
19
19
|
export {
|
|
20
|
+
withTheme,
|
|
20
21
|
getTheme,
|
|
21
22
|
ThemeProvider,
|
|
22
23
|
ThemeSwitcher,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|