diff --git a/packages/react-ui/components/Autocomplete/Autocomplete.styles.ts b/packages/react-ui/components/Autocomplete/Autocomplete.styles.ts index 3864229ce47..3554cdddf92 100644 --- a/packages/react-ui/components/Autocomplete/Autocomplete.styles.ts +++ b/packages/react-ui/components/Autocomplete/Autocomplete.styles.ts @@ -11,9 +11,10 @@ export const getStyles = (emotion: Emotion) => width: ${t.inputWidth}; `; }, - noPortal() { - return css` + + noPortal() { + return emotion.css` position: relative; `; - }, + }, }); diff --git a/packages/react-ui/components/Calendar/CalendarDay.tsx b/packages/react-ui/components/Calendar/CalendarDay.tsx index 347c10368c7..65a25e18fdd 100644 --- a/packages/react-ui/components/Calendar/CalendarDay.tsx +++ b/packages/react-ui/components/Calendar/CalendarDay.tsx @@ -2,7 +2,7 @@ import React, { PropsWithChildren, useContext, memo } from 'react'; import { useLocaleForControl } from '../../lib/locale/useLocaleForControl'; import { ThemeContext } from '../../lib/theming/ThemeContext'; -import { cx } from '../../lib/theming/Emotion'; +import { cx, useEmotion } from '../../lib/theming/Emotion'; import { isTheme2022 } from '../../lib/theming/ThemeHelpers'; import { DatePickerLocaleHelper } from '../DatePicker/locale'; import { InternalDate } from '../../lib/date/InternalDate'; @@ -10,7 +10,7 @@ import { LocaleContext } from '../../lib/locale'; import { getVisualStateDataAttributes } from '../../internal/CommonWrapper/utils/getVisualStateDataAttributes'; import { forwardRefAndName } from '../../lib/forwardRefAndName'; -import { styles } from './DayCellView.styles'; +import { getStyles } from './DayCellView.styles'; import { CalendarDataTids } from './Calendar'; export interface CalendarDayProps extends React.HTMLAttributes { @@ -41,6 +41,7 @@ export const CalendarDay = memo( ref: React.Ref, ) { const theme = useContext(ThemeContext); + const emotion = useEmotion(); const _isTheme2022 = isTheme2022(theme); const { langCode } = useContext(LocaleContext); @@ -51,6 +52,7 @@ export const CalendarDay = memo( const { date: day } = internalDate.getComponentsLikeNumber(); const caption = children ?? day; + const styles = getStyles(emotion); return (