@hero-design/rn 8.12.0-rc.0 → 8.12.1
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 +57 -18
- package/lib/index.js +57 -18
- package/package.json +5 -5
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +17 -3
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +17 -3
- package/src/components/List/BasicListItem.tsx +6 -0
- package/src/components/List/ListItem.tsx +6 -0
- package/src/components/List/StyledBasicListItem.tsx +2 -2
- package/src/components/List/StyledListItem.tsx +2 -2
- package/src/components/List/__tests__/__snapshots__/BasicListItem.spec.tsx.snap +22 -18
- package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +32 -28
- package/src/components/List/__tests__/__snapshots__/StyledBasicListItem.spec.tsx.snap +44 -36
- package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +50 -46
- package/src/components/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +22 -18
- package/src/components/Radio/__tests__/__snapshots__/RadioGroup.spec.tsx.snap +33 -27
- package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +4 -0
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/Option.spec.tsx.snap +11 -9
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +132 -108
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +232 -139
- 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__/Option.spec.tsx.snap +11 -9
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +136 -112
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +235 -142
- package/src/components/Select/SingleSelect/__tests__/index.spec.tsx +15 -0
- package/src/components/Select/SingleSelect/index.tsx +1 -1
- package/src/components/TextInput/StyledTextInput.tsx +3 -0
- package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +466 -28
- package/src/components/TextInput/__tests__/index.spec.tsx +32 -0
- package/src/components/TextInput/index.tsx +32 -4
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +34 -6
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +34 -6
- 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/theme/ThemeSwitcher.tsx +6 -3
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +4 -3
- package/src/theme/components/textInput.ts +1 -0
- 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/swagDark.ts +3 -3
- 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 +3 -3
- package/types/components/List/StyledListItem.d.ts +3 -3
- 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 +0 -0
- package/types/testHelpers/renderWithTheme.d.ts +0 -0
- package/types/theme/ThemeProvider.d.ts +0 -0
- package/types/theme/ThemeSwitcher.d.ts +2 -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 +1 -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
|
@@ -380,6 +380,38 @@ describe('TextInput', () => {
|
|
|
380
380
|
});
|
|
381
381
|
});
|
|
382
382
|
|
|
383
|
+
describe('backgroundColor', () => {
|
|
384
|
+
it('renders correctly', () => {
|
|
385
|
+
const wrapper = renderWithTheme(
|
|
386
|
+
<TextInput
|
|
387
|
+
label="Amount (AUD)"
|
|
388
|
+
prefix="dollar-sign"
|
|
389
|
+
required
|
|
390
|
+
helpText="This is helper text"
|
|
391
|
+
placeholder="Enter Amount"
|
|
392
|
+
defaultValue="1000"
|
|
393
|
+
value="2000"
|
|
394
|
+
maxLength={255}
|
|
395
|
+
style={{ backgroundColor: theme.colors.neutralGlobalSurface }}
|
|
396
|
+
/>
|
|
397
|
+
);
|
|
398
|
+
|
|
399
|
+
expect(wrapper.toJSON()).toMatchSnapshot();
|
|
400
|
+
expect(wrapper.getByTestId('text-input')).toHaveStyle({
|
|
401
|
+
backgroundColor: theme.colors.neutralGlobalSurface,
|
|
402
|
+
});
|
|
403
|
+
expect(wrapper.getByTestId('text-input-border')).toHaveStyle({
|
|
404
|
+
backgroundColor: theme.colors.neutralGlobalSurface,
|
|
405
|
+
});
|
|
406
|
+
expect(wrapper.getByTestId('label-container')).toHaveStyle({
|
|
407
|
+
backgroundColor: theme.colors.neutralGlobalSurface,
|
|
408
|
+
});
|
|
409
|
+
expect(wrapper.getByText('Amount (AUD)')).toHaveStyle({
|
|
410
|
+
backgroundColor: theme.colors.neutralGlobalSurface,
|
|
411
|
+
});
|
|
412
|
+
});
|
|
413
|
+
});
|
|
414
|
+
|
|
383
415
|
describe('ref', () => {
|
|
384
416
|
it('ref methods work correctly', () => {
|
|
385
417
|
const mockChildMethod = jest.fn();
|
|
@@ -217,9 +217,31 @@ const TextInput = forwardRef<TextInputHandles, TextInputProps>(
|
|
|
217
217
|
};
|
|
218
218
|
}, [textStyle]);
|
|
219
219
|
|
|
220
|
+
const { backgroundColor, styleWithoutBackgroundColor } = useMemo(() => {
|
|
221
|
+
if (!style) {
|
|
222
|
+
return {
|
|
223
|
+
backgroundColor: theme.__hd__.textInput.colors.containerBackground,
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
const flattenTextStyle = StyleSheet.flatten(style);
|
|
228
|
+
return {
|
|
229
|
+
backgroundColor:
|
|
230
|
+
flattenTextStyle.backgroundColor ??
|
|
231
|
+
theme.__hd__.textInput.colors.containerBackground,
|
|
232
|
+
styleWithoutBackgroundColor: omit(
|
|
233
|
+
['backgroundColor'],
|
|
234
|
+
flattenTextStyle
|
|
235
|
+
),
|
|
236
|
+
};
|
|
237
|
+
}, [style, theme]);
|
|
238
|
+
|
|
220
239
|
const nativeInputProps: NativeTextInputProps = {
|
|
221
240
|
style: StyleSheet.flatten([
|
|
222
|
-
{
|
|
241
|
+
{
|
|
242
|
+
backgroundColor,
|
|
243
|
+
color: theme.__hd__.textInput.colors.text,
|
|
244
|
+
},
|
|
223
245
|
textStyleWithoutBorderStyle,
|
|
224
246
|
]),
|
|
225
247
|
testID: 'text-input',
|
|
@@ -253,7 +275,7 @@ const TextInput = forwardRef<TextInputHandles, TextInputProps>(
|
|
|
253
275
|
|
|
254
276
|
return (
|
|
255
277
|
<StyledContainer
|
|
256
|
-
style={
|
|
278
|
+
style={styleWithoutBackgroundColor}
|
|
257
279
|
pointerEvents={
|
|
258
280
|
variant === 'disabled' || variant === 'readonly' ? 'none' : 'auto'
|
|
259
281
|
}
|
|
@@ -263,10 +285,15 @@ const TextInput = forwardRef<TextInputHandles, TextInputProps>(
|
|
|
263
285
|
<StyledBorderBackDrop
|
|
264
286
|
themeFocused={isFocused}
|
|
265
287
|
themeVariant={variant}
|
|
266
|
-
|
|
288
|
+
testID="text-input-border"
|
|
289
|
+
style={[{ backgroundColor }, borderStyle]}
|
|
267
290
|
/>
|
|
268
291
|
{(isFocused || (label && !isEmptyValue)) && (
|
|
269
|
-
<StyledLabelContainer
|
|
292
|
+
<StyledLabelContainer
|
|
293
|
+
pointerEvents="none"
|
|
294
|
+
testID="label-container"
|
|
295
|
+
style={{ backgroundColor }}
|
|
296
|
+
>
|
|
270
297
|
{required && (
|
|
271
298
|
<StyledAsteriskLabel themeVariant={variant} fontSize="small">
|
|
272
299
|
*
|
|
@@ -278,6 +305,7 @@ const TextInput = forwardRef<TextInputHandles, TextInputProps>(
|
|
|
278
305
|
testID="input-label"
|
|
279
306
|
fontSize="small"
|
|
280
307
|
themeVariant={variant}
|
|
308
|
+
style={{ backgroundColor }}
|
|
281
309
|
>
|
|
282
310
|
{label}
|
|
283
311
|
</StyledLabel>
|
|
@@ -44,6 +44,8 @@ exports[`TimePickerAndroid renders correct with hide suffix 1`] = `
|
|
|
44
44
|
Array [
|
|
45
45
|
Object {
|
|
46
46
|
"alignItems": "center",
|
|
47
|
+
"backgroundColor": "#ffffff",
|
|
48
|
+
"borderRadius": 8,
|
|
47
49
|
"flexDirection": "row",
|
|
48
50
|
"padding": 16,
|
|
49
51
|
},
|
|
@@ -64,9 +66,15 @@ exports[`TimePickerAndroid renders correct with hide suffix 1`] = `
|
|
|
64
66
|
"right": 0,
|
|
65
67
|
"top": 0,
|
|
66
68
|
},
|
|
67
|
-
|
|
69
|
+
Array [
|
|
70
|
+
Object {
|
|
71
|
+
"backgroundColor": "#ffffff",
|
|
72
|
+
},
|
|
73
|
+
undefined,
|
|
74
|
+
],
|
|
68
75
|
]
|
|
69
76
|
}
|
|
77
|
+
testID="text-input-border"
|
|
70
78
|
themeFocused={false}
|
|
71
79
|
themeVariant="filled"
|
|
72
80
|
/>
|
|
@@ -83,9 +91,12 @@ exports[`TimePickerAndroid renders correct with hide suffix 1`] = `
|
|
|
83
91
|
"top": -10,
|
|
84
92
|
"zIndex": 1,
|
|
85
93
|
},
|
|
86
|
-
|
|
94
|
+
Object {
|
|
95
|
+
"backgroundColor": "#ffffff",
|
|
96
|
+
},
|
|
87
97
|
]
|
|
88
98
|
}
|
|
99
|
+
testID="label-container"
|
|
89
100
|
>
|
|
90
101
|
<Text
|
|
91
102
|
style={
|
|
@@ -101,7 +112,9 @@ exports[`TimePickerAndroid renders correct with hide suffix 1`] = `
|
|
|
101
112
|
Object {
|
|
102
113
|
"color": "#001f23",
|
|
103
114
|
},
|
|
104
|
-
|
|
115
|
+
Object {
|
|
116
|
+
"backgroundColor": "#ffffff",
|
|
117
|
+
},
|
|
105
118
|
],
|
|
106
119
|
]
|
|
107
120
|
}
|
|
@@ -151,6 +164,7 @@ exports[`TimePickerAndroid renders correct with hide suffix 1`] = `
|
|
|
151
164
|
"textAlignVertical": "center",
|
|
152
165
|
},
|
|
153
166
|
Object {
|
|
167
|
+
"backgroundColor": "#ffffff",
|
|
154
168
|
"color": "#001f23",
|
|
155
169
|
},
|
|
156
170
|
]
|
|
@@ -258,6 +272,8 @@ exports[`TimePickerAndroid renders correctly 1`] = `
|
|
|
258
272
|
Array [
|
|
259
273
|
Object {
|
|
260
274
|
"alignItems": "center",
|
|
275
|
+
"backgroundColor": "#ffffff",
|
|
276
|
+
"borderRadius": 8,
|
|
261
277
|
"flexDirection": "row",
|
|
262
278
|
"padding": 16,
|
|
263
279
|
},
|
|
@@ -278,9 +294,15 @@ exports[`TimePickerAndroid renders correctly 1`] = `
|
|
|
278
294
|
"right": 0,
|
|
279
295
|
"top": 0,
|
|
280
296
|
},
|
|
281
|
-
|
|
297
|
+
Array [
|
|
298
|
+
Object {
|
|
299
|
+
"backgroundColor": "#ffffff",
|
|
300
|
+
},
|
|
301
|
+
undefined,
|
|
302
|
+
],
|
|
282
303
|
]
|
|
283
304
|
}
|
|
305
|
+
testID="text-input-border"
|
|
284
306
|
themeFocused={false}
|
|
285
307
|
themeVariant="filled"
|
|
286
308
|
/>
|
|
@@ -297,9 +319,12 @@ exports[`TimePickerAndroid renders correctly 1`] = `
|
|
|
297
319
|
"top": -10,
|
|
298
320
|
"zIndex": 1,
|
|
299
321
|
},
|
|
300
|
-
|
|
322
|
+
Object {
|
|
323
|
+
"backgroundColor": "#ffffff",
|
|
324
|
+
},
|
|
301
325
|
]
|
|
302
326
|
}
|
|
327
|
+
testID="label-container"
|
|
303
328
|
>
|
|
304
329
|
<Text
|
|
305
330
|
style={
|
|
@@ -315,7 +340,9 @@ exports[`TimePickerAndroid renders correctly 1`] = `
|
|
|
315
340
|
Object {
|
|
316
341
|
"color": "#001f23",
|
|
317
342
|
},
|
|
318
|
-
|
|
343
|
+
Object {
|
|
344
|
+
"backgroundColor": "#ffffff",
|
|
345
|
+
},
|
|
319
346
|
],
|
|
320
347
|
]
|
|
321
348
|
}
|
|
@@ -365,6 +392,7 @@ exports[`TimePickerAndroid renders correctly 1`] = `
|
|
|
365
392
|
"textAlignVertical": "center",
|
|
366
393
|
},
|
|
367
394
|
Object {
|
|
395
|
+
"backgroundColor": "#ffffff",
|
|
368
396
|
"color": "#001f23",
|
|
369
397
|
},
|
|
370
398
|
]
|
|
@@ -44,6 +44,8 @@ exports[`TimePickerIOS renders correct with hide suffix 1`] = `
|
|
|
44
44
|
Array [
|
|
45
45
|
Object {
|
|
46
46
|
"alignItems": "center",
|
|
47
|
+
"backgroundColor": "#ffffff",
|
|
48
|
+
"borderRadius": 8,
|
|
47
49
|
"flexDirection": "row",
|
|
48
50
|
"padding": 16,
|
|
49
51
|
},
|
|
@@ -64,9 +66,15 @@ exports[`TimePickerIOS renders correct with hide suffix 1`] = `
|
|
|
64
66
|
"right": 0,
|
|
65
67
|
"top": 0,
|
|
66
68
|
},
|
|
67
|
-
|
|
69
|
+
Array [
|
|
70
|
+
Object {
|
|
71
|
+
"backgroundColor": "#ffffff",
|
|
72
|
+
},
|
|
73
|
+
undefined,
|
|
74
|
+
],
|
|
68
75
|
]
|
|
69
76
|
}
|
|
77
|
+
testID="text-input-border"
|
|
70
78
|
themeFocused={false}
|
|
71
79
|
themeVariant="filled"
|
|
72
80
|
/>
|
|
@@ -83,9 +91,12 @@ exports[`TimePickerIOS renders correct with hide suffix 1`] = `
|
|
|
83
91
|
"top": -10,
|
|
84
92
|
"zIndex": 1,
|
|
85
93
|
},
|
|
86
|
-
|
|
94
|
+
Object {
|
|
95
|
+
"backgroundColor": "#ffffff",
|
|
96
|
+
},
|
|
87
97
|
]
|
|
88
98
|
}
|
|
99
|
+
testID="label-container"
|
|
89
100
|
>
|
|
90
101
|
<Text
|
|
91
102
|
style={
|
|
@@ -101,7 +112,9 @@ exports[`TimePickerIOS renders correct with hide suffix 1`] = `
|
|
|
101
112
|
Object {
|
|
102
113
|
"color": "#001f23",
|
|
103
114
|
},
|
|
104
|
-
|
|
115
|
+
Object {
|
|
116
|
+
"backgroundColor": "#ffffff",
|
|
117
|
+
},
|
|
105
118
|
],
|
|
106
119
|
]
|
|
107
120
|
}
|
|
@@ -151,6 +164,7 @@ exports[`TimePickerIOS renders correct with hide suffix 1`] = `
|
|
|
151
164
|
"textAlignVertical": "center",
|
|
152
165
|
},
|
|
153
166
|
Object {
|
|
167
|
+
"backgroundColor": "#ffffff",
|
|
154
168
|
"color": "#001f23",
|
|
155
169
|
},
|
|
156
170
|
]
|
|
@@ -258,6 +272,8 @@ exports[`TimePickerIOS renders correctly 1`] = `
|
|
|
258
272
|
Array [
|
|
259
273
|
Object {
|
|
260
274
|
"alignItems": "center",
|
|
275
|
+
"backgroundColor": "#ffffff",
|
|
276
|
+
"borderRadius": 8,
|
|
261
277
|
"flexDirection": "row",
|
|
262
278
|
"padding": 16,
|
|
263
279
|
},
|
|
@@ -278,9 +294,15 @@ exports[`TimePickerIOS renders correctly 1`] = `
|
|
|
278
294
|
"right": 0,
|
|
279
295
|
"top": 0,
|
|
280
296
|
},
|
|
281
|
-
|
|
297
|
+
Array [
|
|
298
|
+
Object {
|
|
299
|
+
"backgroundColor": "#ffffff",
|
|
300
|
+
},
|
|
301
|
+
undefined,
|
|
302
|
+
],
|
|
282
303
|
]
|
|
283
304
|
}
|
|
305
|
+
testID="text-input-border"
|
|
284
306
|
themeFocused={false}
|
|
285
307
|
themeVariant="filled"
|
|
286
308
|
/>
|
|
@@ -297,9 +319,12 @@ exports[`TimePickerIOS renders correctly 1`] = `
|
|
|
297
319
|
"top": -10,
|
|
298
320
|
"zIndex": 1,
|
|
299
321
|
},
|
|
300
|
-
|
|
322
|
+
Object {
|
|
323
|
+
"backgroundColor": "#ffffff",
|
|
324
|
+
},
|
|
301
325
|
]
|
|
302
326
|
}
|
|
327
|
+
testID="label-container"
|
|
303
328
|
>
|
|
304
329
|
<Text
|
|
305
330
|
style={
|
|
@@ -315,7 +340,9 @@ exports[`TimePickerIOS renders correctly 1`] = `
|
|
|
315
340
|
Object {
|
|
316
341
|
"color": "#001f23",
|
|
317
342
|
},
|
|
318
|
-
|
|
343
|
+
Object {
|
|
344
|
+
"backgroundColor": "#ffffff",
|
|
345
|
+
},
|
|
319
346
|
],
|
|
320
347
|
]
|
|
321
348
|
}
|
|
@@ -365,6 +392,7 @@ exports[`TimePickerIOS renders correctly 1`] = `
|
|
|
365
392
|
"textAlignVertical": "center",
|
|
366
393
|
},
|
|
367
394
|
Object {
|
|
395
|
+
"backgroundColor": "#ffffff",
|
|
368
396
|
"color": "#001f23",
|
|
369
397
|
},
|
|
370
398
|
]
|
|
@@ -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,
|
|
@@ -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 {
|
|
@@ -41,8 +41,11 @@ const ThemeSwitcher = ({
|
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
export const withTheme =
|
|
44
|
-
<P extends
|
|
45
|
-
|
|
44
|
+
<P extends Record<string, unknown>>(
|
|
45
|
+
C: React.ComponentType<P>,
|
|
46
|
+
themeName: ThemeName
|
|
47
|
+
) =>
|
|
48
|
+
(props: PropsWithChildren<P>) => {
|
|
46
49
|
return (
|
|
47
50
|
<ThemeSwitcher name={themeName}>
|
|
48
51
|
<C {...props} />
|
|
@@ -829,6 +829,7 @@ Object {
|
|
|
829
829
|
"filled": "#001f23",
|
|
830
830
|
"readonly": "#808f91",
|
|
831
831
|
},
|
|
832
|
+
"containerBackground": "#ffffff",
|
|
832
833
|
"error": "#de350b",
|
|
833
834
|
"labelBackground": "#ffffff",
|
|
834
835
|
"labels": Object {
|
|
@@ -949,14 +950,14 @@ Object {
|
|
|
949
950
|
"colors": Object {
|
|
950
951
|
"archived": "#737479",
|
|
951
952
|
"body": "#001f23",
|
|
952
|
-
"danger": "#
|
|
953
|
+
"danger": "#f46363",
|
|
953
954
|
"info": "#4568fb",
|
|
954
955
|
"inverted": "#ffffff",
|
|
955
956
|
"primary": "#401960",
|
|
956
957
|
"secondary": "#795e90",
|
|
957
958
|
"subdued": "#4d6265",
|
|
958
|
-
"success": "#
|
|
959
|
-
"warning": "#
|
|
959
|
+
"success": "#5ace7d",
|
|
960
|
+
"warning": "#ffbe71",
|
|
960
961
|
},
|
|
961
962
|
"fontSizes": Object {
|
|
962
963
|
"6xlarge": 36,
|
|
@@ -3,6 +3,7 @@ import type { GlobalTheme } from '../global';
|
|
|
3
3
|
const getTextInputTheme = (theme: GlobalTheme) => {
|
|
4
4
|
const colors = {
|
|
5
5
|
labelBackground: theme.colors.defaultGlobalSurface,
|
|
6
|
+
containerBackground: theme.colors.defaultGlobalSurface,
|
|
6
7
|
asterisks: {
|
|
7
8
|
default: theme.colors.onErrorSurface,
|
|
8
9
|
error: theme.colors.onErrorSurface,
|
|
@@ -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",
|
|
@@ -5,11 +5,11 @@ import globalDarkPalette from './globalDark';
|
|
|
5
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,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|