diff --git a/.changeset/olive-shrimps-fetch.md b/.changeset/olive-shrimps-fetch.md new file mode 100644 index 0000000000..ae8d7ce06b --- /dev/null +++ b/.changeset/olive-shrimps-fetch.md @@ -0,0 +1,7 @@ +--- +'@commercetools-frontend/application-components': patch +'@commercetools-frontend/react-notifications': patch +'@commercetools-frontend/application-shell': patch +--- + +Remove supporting code for look and feel migration. diff --git a/packages/application-components/src/components/dialogs/internals/dialog-header.tsx b/packages/application-components/src/components/dialogs/internals/dialog-header.tsx index 5a89b03754..190756fdb1 100644 --- a/packages/application-components/src/components/dialogs/internals/dialog-header.tsx +++ b/packages/application-components/src/components/dialogs/internals/dialog-header.tsx @@ -1,9 +1,6 @@ import type { SyntheticEvent } from 'react'; import { css } from '@emotion/react'; -import { - designTokens as uiKitDesignTokens, - useTheme, -} from '@commercetools-uikit/design-system'; +import { designTokens as uiKitDesignTokens } from '@commercetools-uikit/design-system'; import { CloseIcon } from '@commercetools-uikit/icons'; import SecondaryIconButton from '@commercetools-uikit/secondary-icon-button'; import Spacings from '@commercetools-uikit/spacings'; @@ -17,15 +14,6 @@ type Props = { type TitleProps = Pick; const Title = (props: TitleProps) => { - const { theme } = useTheme(); - if (theme === 'default') { - return ( - - {props.title} - - ); - } - return ( {props.title} diff --git a/packages/application-components/src/components/internals/page-header-title.tsx b/packages/application-components/src/components/internals/page-header-title.tsx index 3b1141d069..b347f61d25 100644 --- a/packages/application-components/src/components/internals/page-header-title.tsx +++ b/packages/application-components/src/components/internals/page-header-title.tsx @@ -1,7 +1,6 @@ import { isValidElement, type ReactElement } from 'react'; import { css } from '@emotion/react'; import styled from '@emotion/styled'; -import { useTheme } from '@commercetools-uikit/design-system'; import Text from '@commercetools-uikit/text'; import { designTokens as appKitDesignTokens } from '../../theming'; @@ -24,15 +23,10 @@ const SubtitleWrapper = styled.div` type TitleProps = Pick; const Title = (props: TitleProps) => { - const { themedValue } = useTheme(); switch (props.titleSize) { case 'big': return ( - + {props.title} ); @@ -52,7 +46,6 @@ type SubtitleProps = { }; const Subtitle = (props: SubtitleProps) => { - const { themedValue } = useTheme(); if (!props.subtitle) { return null; } @@ -64,7 +57,7 @@ const Subtitle = (props: SubtitleProps) => { {props.subtitle} diff --git a/packages/application-components/src/components/internals/page-header.tsx b/packages/application-components/src/components/internals/page-header.tsx index c0534bbfc4..6d150e0b77 100644 --- a/packages/application-components/src/components/internals/page-header.tsx +++ b/packages/application-components/src/components/internals/page-header.tsx @@ -1,6 +1,5 @@ import type { ReactElement, ReactNode } from 'react'; import { css } from '@emotion/react'; -import { useTheme } from '@commercetools-uikit/design-system'; import { designTokens as appKitDesignTokens } from '../../theming'; import PageHeaderTitle from './page-header-title'; @@ -11,8 +10,6 @@ type Props = { }; const PageHeader = (props: Props) => { - const { themedValue } = useTheme(); - return (
{ > diff --git a/packages/application-components/src/components/main-pages/info-main-page/info-main-page.tsx b/packages/application-components/src/components/main-pages/info-main-page/info-main-page.tsx index 1aeef14ade..94f6b8a9f3 100644 --- a/packages/application-components/src/components/main-pages/info-main-page/info-main-page.tsx +++ b/packages/application-components/src/components/main-pages/info-main-page/info-main-page.tsx @@ -1,5 +1,4 @@ import type { ReactElement, ReactNode } from 'react'; -import { useTheme } from '@commercetools-uikit/design-system'; import PageHeaderTitle from '../../internals/page-header-title'; import CustomFormMainPage from '../custom-form-main-page'; @@ -23,13 +22,12 @@ type InfoMainPageProps = { }; const InfoMainPage = (props: InfoMainPageProps) => { - const { themedValue } = useTheme(); return ( {props.children} diff --git a/packages/application-components/src/components/modal-pages/internals/modal-page-top-bar.tsx b/packages/application-components/src/components/modal-pages/internals/modal-page-top-bar.tsx index f8ab55ca17..9c871b471e 100644 --- a/packages/application-components/src/components/modal-pages/internals/modal-page-top-bar.tsx +++ b/packages/application-components/src/components/modal-pages/internals/modal-page-top-bar.tsx @@ -1,10 +1,7 @@ import { cloneElement, type SyntheticEvent, type ReactElement } from 'react'; import { css } from '@emotion/react'; import { useIntl } from 'react-intl'; -import { - designTokens as uiKitDesignTokens, - useTheme, -} from '@commercetools-uikit/design-system'; +import { designTokens as uiKitDesignTokens } from '@commercetools-uikit/design-system'; import FlatButton from '@commercetools-uikit/flat-button'; import { CloseIcon, AngleLeftIcon } from '@commercetools-uikit/icons'; import SecondaryIconButton, { @@ -63,7 +60,6 @@ const defaultProps: Pick = { const ModalPageTopBar = (props: Props) => { const intl = useIntl(); - const { themedValue } = useTheme(); return (
{ } - size={themedValue('medium', 'big')} + size="big" /> )}
diff --git a/packages/application-components/src/components/modal-pages/tabular-modal-page/tabular-modal-page.tsx b/packages/application-components/src/components/modal-pages/tabular-modal-page/tabular-modal-page.tsx index 42d14a1ec6..75d16e33dc 100644 --- a/packages/application-components/src/components/modal-pages/tabular-modal-page/tabular-modal-page.tsx +++ b/packages/application-components/src/components/modal-pages/tabular-modal-page/tabular-modal-page.tsx @@ -2,7 +2,6 @@ import { ReactElement, ReactNode, SyntheticEvent } from 'react'; import type { CSSObject } from '@emotion/react'; import { sharedMessages } from '@commercetools-frontend/i18n'; -import { useTheme } from '@commercetools-uikit/design-system'; import Spacings from '@commercetools-uikit/spacings'; import { FormPrimaryButton, @@ -63,7 +62,6 @@ const defaultProps: Pick = { }; const TabularModalPage = (props: Props) => { - const { themedValue } = useTheme(); return ( { {props.customTitleRow || ( diff --git a/packages/application-components/src/components/page-content-containers/page-content-narrow/page-content-narrow.tsx b/packages/application-components/src/components/page-content-containers/page-content-narrow/page-content-narrow.tsx index 93943159d6..acf62f62d5 100644 --- a/packages/application-components/src/components/page-content-containers/page-content-narrow/page-content-narrow.tsx +++ b/packages/application-components/src/components/page-content-containers/page-content-narrow/page-content-narrow.tsx @@ -1,7 +1,5 @@ -// TODO: @redesign cleanup import type { ReactNode } from 'react'; import styled from '@emotion/styled'; -import { useTheme } from '@commercetools-uikit/design-system'; export type TPageContentNarrow = { children: ReactNode; @@ -19,9 +17,6 @@ const Container = styled.div` `; function PageContentNarrow(props: TPageContentNarrow) { - const { isNewTheme } = useTheme(); - if (!isNewTheme) return <>{props.children}; - return ( {props.children} diff --git a/packages/application-components/src/components/page-content-containers/page-content-wide/page-content-wide.tsx b/packages/application-components/src/components/page-content-containers/page-content-wide/page-content-wide.tsx index d457775673..b107fa585b 100644 --- a/packages/application-components/src/components/page-content-containers/page-content-wide/page-content-wide.tsx +++ b/packages/application-components/src/components/page-content-containers/page-content-wide/page-content-wide.tsx @@ -1,13 +1,13 @@ -// TODO: @redesign cleanup import { Children, type ReactNode } from 'react'; import styled from '@emotion/styled'; -import { designTokens, useTheme } from '@commercetools-uikit/design-system'; +import { designTokens } from '@commercetools-uikit/design-system'; import { useWarning } from '@commercetools-uikit/utils'; export type TPageContentWide = { columns: '1' | '1/1' | '2/1'; gapSize: '10' | '20'; children: ReactNode; + // @deprecated themeParentSelector?: () => HTMLElement | null; }; @@ -54,7 +54,6 @@ const Container = styled.div` `; function PageContentWide(props: TPageContentWide) { - const { isNewTheme } = useTheme(props.themeParentSelector); const [leftChild, rightChild] = Children.toArray(props.children); useWarning( @@ -62,8 +61,6 @@ function PageContentWide(props: TPageContentWide) { 'PageContentWide: This component only renders its first children when using a single column but you provided more that one.' ); - if (!isNewTheme) return <>{props.children}; - return ( diff --git a/packages/application-components/src/components/public-page-layout/public-page-layout.tsx b/packages/application-components/src/components/public-page-layout/public-page-layout.tsx index 9f0b6ee8a6..0183626420 100644 --- a/packages/application-components/src/components/public-page-layout/public-page-layout.tsx +++ b/packages/application-components/src/components/public-page-layout/public-page-layout.tsx @@ -1,11 +1,8 @@ -// TODO: @redesign cleanup import { FC, ReactNode } from 'react'; import { css } from '@emotion/react'; import styled from '@emotion/styled'; -import publicBackgroundUrl from '@commercetools-frontend/assets/images/public-background.png'; import CommercetoolsLogoOnWhiteSvg from '@commercetools-frontend/assets/logos/color-on-white-horizontal.svg'; -import CommercetoolsLogoSvg from '@commercetools-frontend/assets/logos/commercetools_primary-logo_horizontal_white-text_RGB.svg'; -import { customProperties, useTheme } from '@commercetools-uikit/design-system'; +import { customProperties } from '@commercetools-uikit/design-system'; import Spacings from '@commercetools-uikit/spacings'; import Text from '@commercetools-uikit/text'; import { designTokens as appKitDesingTokens } from '../../theming'; @@ -36,18 +33,13 @@ type TProps = { children: ReactNode; }; -// TODO: @redesign cleanup -type TContainerProps = { showBackground: boolean }; - -const Container = styled.div` +const Container = styled.div` width: 100%; min-height: 100vh; display: flex; padding: ${customProperties.spacingXl} 0; justify-content: center; background-size: cover; - background-image: ${(props: TContainerProps) => - props.showBackground ? `url(${publicBackgroundUrl})` : 'none'}; background-position: center; `; const ContainerColumn = styled.div` @@ -65,21 +57,12 @@ const PublicPageLayoutContent: FC = (props) => { }; const PublicPageLayout: FC = (props) => { - const { themedValue } = useTheme(); - return ( - +
- commercetools logo + commercetools logo
{props.welcomeMessage && ( @@ -87,8 +70,8 @@ const PublicPageLayout: FC = (props) => {
{props.welcomeMessage} @@ -96,24 +79,19 @@ const PublicPageLayout: FC = (props) => { )} - + - {props.legalMessage && - themedValue( - {props.legalMessage}, - - {props.legalMessage} - - )} - {themedValue( - {`${year} © commercetools`}, - {`${year} © commercetools`} + {props.legalMessage && ( + {props.legalMessage} )} + { + {`${year} © commercetools`} + } diff --git a/packages/application-components/src/components/tab-header/tab-header.tsx b/packages/application-components/src/components/tab-header/tab-header.tsx index 31192c6e90..ecb12117e1 100644 --- a/packages/application-components/src/components/tab-header/tab-header.tsx +++ b/packages/application-components/src/components/tab-header/tab-header.tsx @@ -2,7 +2,6 @@ import type { ReactNode } from 'react'; import type { LocationDescriptor } from 'history'; import { useIntl, type MessageDescriptor } from 'react-intl'; import { Link, matchPath, useLocation } from 'react-router-dom'; -import { useTheme } from '@commercetools-uikit/design-system'; import Text from '@commercetools-uikit/text'; import { warning } from '@commercetools-uikit/utils'; import { getLinkStyles } from './tab.styles'; @@ -52,16 +51,6 @@ export type TTabHeaderProps = { }; const TabLabel = ({ children }: { children?: string }) => { - const { theme } = useTheme(); - - if (theme === 'default') { - return ( - - {children} - - ); - } - return ( {children} diff --git a/packages/application-components/src/theming.ts b/packages/application-components/src/theming.ts index b9fcb6f2ed..4acb8f27ca 100644 --- a/packages/application-components/src/theming.ts +++ b/packages/application-components/src/theming.ts @@ -12,54 +12,6 @@ const newShadow1 = '0px 2px 5px 0px rgba(0, 0, 0, 0.15)'; export const themesOverrides = { default: { - colorForPageHeaderBottomBorder: uiKitDesignTokens.colorNeutral, - colorForNavbarIcon: uiKitDesignTokens.colorSurface, - colorForNavbarIconWhenActive: uiKitDesignTokens.colorPrimary, - colorForNavbarLink: uiKitDesignTokens.colorSurface, - colorForNavbarLinkWhenActive: uiKitDesignTokens.colorPrimary, - colorForNavbarLinkWhenHovered: uiKitDesignTokens.colorPrimary, - backgroundColorForMainPageDivider: uiKitDesignTokens.colorNeutral60, - backgroundColorForNavbar: uiKitDesignTokens.colorAccent, - backgroundColorForNavbarWhenActive: uiKitDesignTokens.colorAccent30, - backgroundColorForNavbarWhenHovered: uiKitDesignTokens.colorAccent30, - backgroundColorForPageHeader: uiKitDesignTokens.colorNeutral95, - backgroundColorForTabularMainPageContent: uiKitDesignTokens.colorNeutral95, - backgroundColorForUserMenuItemWhenHovered: uiKitDesignTokens.colorNeutral90, - borderBottomForTabularPageHeader: `1px solid ${uiKitDesignTokens.colorNeutral}`, - borderColorForDialogDivider: uiKitDesignTokens.colorNeutral, - borderColorForModalPageHeaderDivider: uiKitDesignTokens.colorNeutral60, - borderColorForModalTopBarWhenSurface: uiKitDesignTokens.colorNeutral, - fontSizeForNavbarLink: uiKitDesignTokens.fontSize40, - fontWeightForNavbarLink: uiKitDesignTokens.fontWeight500, - fontWeightForNavbarLinkWhenActive: uiKitDesignTokens.fontWeight500, - fontWeightForNavbarLinkWhenHovered: uiKitDesignTokens.fontWeight500, - heightForTab: '4px', - lineHeightForNavbarLink: uiKitDesignTokens.lineHeight50, - marginBottomForPageTopBar: uiKitDesignTokens.spacing20, - marginForDialogContainerContents: `${uiKitDesignTokens.spacing30} 0`, - marginForModalPageHeader: `0 ${uiKitDesignTokens.spacing30}`, - marginForUserMenuItem: '0', - marginLeftForModalPageHeaderControls: uiKitDesignTokens.spacing30, - marginRightForAppbar: uiKitDesignTokens.spacing30, - marginTopForDialogFooter: uiKitDesignTokens.spacing30, - marginTopForPageSubtitle: uiKitDesignTokens.spacing30, - marginTopForTabControls: uiKitDesignTokens.spacing20, - paddingForDetailPageHeader: uiKitDesignTokens.spacing30, - paddingForDialogContainer: `0`, - paddingForDialogContent: `${uiKitDesignTokens.spacing30} 0 ${uiKitDesignTokens.spacing20}`, - paddingForMainPageHeader: uiKitDesignTokens.spacing30, - paddingForModalPageHeader: `${uiKitDesignTokens.spacing30} 0`, - paddingForModalTopBar: `${uiKitDesignTokens.spacing20} ${uiKitDesignTokens.spacing30}`, - paddingForPageContent: uiKitDesignTokens.spacing30, - paddingForTabularPageHeader: `${uiKitDesignTokens.spacing30} ${uiKitDesignTokens.spacing30} 0`, - paddingLeftForTabAsFirst: '0', - shadowForAppbar: uiKitDesignTokens.shadow1, - shadowForNavbar: '6px 0 10px rgba(0, 0, 0, 0.16)', - widthForDialogAsMedium: uiKitDesignTokens.constraint7, - widthForDialogAsLarge: uiKitDesignTokens.constraint10, - widthForPageLayoutContentColumn: `calc(${uiKitDesignTokens.constraint15} / 2)`, - }, - test: { colorForPageHeaderBottomBorder: uiKitDesignTokens.colorNeutral90, colorForNavbarIcon: colorAccent90, colorForNavbarIconWhenActive: uiKitDesignTokens.colorSurface, diff --git a/packages/application-shell/src/components/app-bar/app-bar.tsx b/packages/application-shell/src/components/app-bar/app-bar.tsx index 1ca6c37d41..8a9c19a77d 100644 --- a/packages/application-shell/src/components/app-bar/app-bar.tsx +++ b/packages/application-shell/src/components/app-bar/app-bar.tsx @@ -1,4 +1,3 @@ -// TODO: @redesign cleanup import { css } from '@emotion/react'; import { designTokens as appKitDesignTokens } from '@commercetools-frontend/application-components'; import LogoSVG from '@commercetools-frontend/assets/images/logo.svg'; diff --git a/packages/application-shell/src/components/locale-switcher/locale-switcher.tsx b/packages/application-shell/src/components/locale-switcher/locale-switcher.tsx index 5a286a4921..fb337302d3 100644 --- a/packages/application-shell/src/components/locale-switcher/locale-switcher.tsx +++ b/packages/application-shell/src/components/locale-switcher/locale-switcher.tsx @@ -1,10 +1,9 @@ -// TODO: @redesign cleanup import { useCallback } from 'react'; import { css } from '@emotion/react'; import { FormattedMessage } from 'react-intl'; import type { SingleValueProps, ValueContainerProps } from 'react-select'; import AccessibleHidden from '@commercetools-uikit/accessible-hidden'; -import { designTokens, useTheme } from '@commercetools-uikit/design-system'; +import { designTokens } from '@commercetools-uikit/design-system'; import { WorldIcon } from '@commercetools-uikit/icons'; import SelectInput from '@commercetools-uikit/select-input'; import messages from './messages'; @@ -21,7 +20,6 @@ type Props = { const LOCALE_SWITCHER_LABEL_ID = 'locale-switcher-label'; export const SingleValue = (props: CustomSingleValueProps) => { - const { themedValue } = useTheme(); return (
{ ( PatchedValueContainer.displayName = 'PatchedValueContainer'; const LocaleSwitcher = (props: Props) => { - const { themedValue } = useTheme(); const { setProjectDataLocale } = props; const handleSelection = useCallback( (event) => { @@ -87,10 +78,7 @@ const LocaleSwitcher = (props: Props) => {
diff --git a/packages/application-shell/src/components/project-switcher/project-switcher.tsx b/packages/application-shell/src/components/project-switcher/project-switcher.tsx index 1b8c9d9800..3453868d6d 100644 --- a/packages/application-shell/src/components/project-switcher/project-switcher.tsx +++ b/packages/application-shell/src/components/project-switcher/project-switcher.tsx @@ -1,4 +1,3 @@ -// TODO: @redesign cleanup import { css } from '@emotion/react'; import memoize from 'memoize-one'; import { FormattedMessage, useIntl } from 'react-intl'; @@ -7,7 +6,7 @@ import type { ApplicationWindow } from '@commercetools-frontend/constants'; import { GRAPHQL_TARGETS } from '@commercetools-frontend/constants'; import { reportErrorToSentry } from '@commercetools-frontend/sentry'; import AccessibleHidden from '@commercetools-uikit/accessible-hidden'; -import { designTokens, useTheme } from '@commercetools-uikit/design-system'; +import { designTokens } from '@commercetools-uikit/design-system'; import { ErrorIcon } from '@commercetools-uikit/icons'; import SelectInput from '@commercetools-uikit/select-input'; import { useMcQuery } from '../../hooks/apollo-hooks'; @@ -39,7 +38,6 @@ export const ProjectSwitcherValueContainer = ({ projectCount, ...restProps }: CustomValueContainerProps) => { - const { themedValue } = useTheme(); return (
import('./new-design-release-info-dialog') @@ -22,9 +20,11 @@ function useDisableRedesignAnnouncement() { } const ThemeSwitcher = () => { - const isNewThemeEnabled = useFeatureToggle(UI_REDESIGN); + // This helps decoupling app-kit update from ui-kit update + // TODO: Remove after ui-kit redesign cleanup has been done + const theme = 'test'; const isRedesignAnnouncementDisabled = useDisableRedesignAnnouncement(); - const theme = isNewThemeEnabled ? 'test' : 'default'; + const [ hasUserSeenNewDesignReleaseNotificationDialog, setHasUserSeenNewDesignReleaseNotificationDialog, @@ -44,10 +44,9 @@ const ThemeSwitcher = () => { return ( <> - + {!isRedesignAnnouncementDisabled && - !hasUserSeenNewDesignReleaseNotificationDialog && - isNewThemeEnabled ? ( + !hasUserSeenNewDesignReleaseNotificationDialog ? ( ) : null} diff --git a/packages/application-shell/src/components/user-settings-menu/user-settings-menu.tsx b/packages/application-shell/src/components/user-settings-menu/user-settings-menu.tsx index 6791af227b..1974d722db 100644 --- a/packages/application-shell/src/components/user-settings-menu/user-settings-menu.tsx +++ b/packages/application-shell/src/components/user-settings-menu/user-settings-menu.tsx @@ -1,4 +1,3 @@ -// TODO: @redesign cleanup import { ReactNode, useCallback, useEffect, useRef, useState } from 'react'; import { css } from '@emotion/react'; import styled from '@emotion/styled'; @@ -19,11 +18,7 @@ import { import { reportErrorToSentry } from '@commercetools-frontend/sentry'; import AccessibleHidden from '@commercetools-uikit/accessible-hidden'; import Avatar from '@commercetools-uikit/avatar'; -import { - designTokens as uikitDesignTokens, - useTheme, -} from '@commercetools-uikit/design-system'; -import { CaretDownIcon } from '@commercetools-uikit/icons'; +import { designTokens as uikitDesignTokens } from '@commercetools-uikit/design-system'; import Spacings from '@commercetools-uikit/spacings'; import Text from '@commercetools-uikit/text'; import { DIMENSIONS } from '../../constants'; @@ -45,14 +40,11 @@ type OptionalFeatureToggleProps = { }; type MenuItemProps = { hasDivider?: boolean; - isNewTheme: boolean; }; type MenuItemLabelProps = { - isNewTheme: boolean; children: ReactNode; }; type UserSettingsAvatarContainerProps = { - isNewTheme: boolean; children: ReactNode; }; type MenuConfig = TFetchApplicationsMenuQuery['applicationsMenu']['appBar'][0]; @@ -69,23 +61,16 @@ const UserAvatar = ( const handleMouseOut = useCallback(() => { setIsMouseOver(false); }, []); - const { isNewTheme, themedValue } = useTheme(); return (
- {isNewTheme ? null : ( - - )}
); @@ -150,63 +135,38 @@ const MenuItem = styled.div` : ''}; `; -const MenuItemLabel = (props: MenuItemLabelProps) => { - if (props.isNewTheme) { - return ( -
- {props.children} -
- ); - } - return {props.children}; -}; +const MenuItemLabel = (props: MenuItemLabelProps) => ( +
+ {props.children} +
+); const UserSettingsAvatarContainer = ( props: UserSettingsAvatarContainerProps -) => { - if (props.isNewTheme) { - return ( -
- {props.children} -
- ); - } - return {props.children}; -}; - -const getUserSettingsMenuStyles = (isNewTheme: boolean) => { - if (isNewTheme) { - return css` - position: absolute; - background: ${uikitDesignTokens.colorSurface}; - border-radius: ${uikitDesignTokens.borderRadius2}; - box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.15); - width: ${uikitDesignTokens.constraint9}; - right: 40px; - top: calc(${DIMENSIONS.header} + ${uikitDesignTokens.spacing20}); - padding: 0 0 ${uikitDesignTokens.spacing10} 0; - overflow: hidden; - `; - } +) => ( +
+ {props.children} +
+); +const getUserSettingsMenuStyles = () => { return css` position: absolute; background: ${uikitDesignTokens.colorSurface}; - border: 1px ${uikitDesignTokens.colorPrimary40} solid; - border-radius: ${uikitDesignTokens.borderRadius6}; - box-shadow: ${uikitDesignTokens.shadow7}; - width: ${uikitDesignTokens.constraint7}; - right: 14px; + border-radius: ${uikitDesignTokens.borderRadius2}; + box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.15); + width: ${uikitDesignTokens.constraint9}; + right: 40px; top: calc(${DIMENSIONS.header} + ${uikitDesignTokens.spacing20}); - padding: ${uikitDesignTokens.spacingXs}; + padding: 0 0 ${uikitDesignTokens.spacing10} 0; overflow: hidden; `; }; @@ -216,7 +176,6 @@ const getUserSettingsMenuItemLinkStyles = () => css` `; const UserSettingsMenuBody = (props: MenuBodyProps) => { - const { isNewTheme, themedValue } = useTheme(); // Focus on a menu item when it's opened through keyboard const menuElementRef = useRef(null); useEffect(() => { @@ -243,39 +202,28 @@ const UserSettingsMenuBody = (props: MenuBodyProps) => { props.downshiftProps.closeMenu(); } }} - css={getUserSettingsMenuStyles(isNewTheme)} + css={getUserSettingsMenuStyles()} >
- - + + - {isNewTheme ? ( -
- - {[props.firstName, props.lastName].join(' ').trim()} - - - {props.email} - -
- ) : ( -
- - {[props.firstName, props.lastName].join(' ').trim()} - - {props.email} -
- )} +
+ + {[props.firstName, props.lastName].join(' ').trim()} + + + {props.email} + +
- {isNewTheme && accountMenuItems.length > 0 ? ( - - ) : null} + {accountMenuItems.length > 0 ? : null} {accountMenuItems.map((menu) => ( { data-user-settings-menu ref={menuElementRef} > - - + + {renderLabel(menu, props.language)} ))} - + { data-user-settings-menu ref={!applicationsAppBarMenu ? menuElementRef : undefined} > - - + + @@ -320,13 +268,13 @@ const UserSettingsMenuBody = (props: MenuBodyProps) => { onClick={() => props.downshiftProps.toggleMenu()} data-user-settings-menu > - - + + - + { data-test="logout-button" data-user-settings-menu > - - + + diff --git a/packages/application-shell/src/feature-toggles.ts b/packages/application-shell/src/feature-toggles.ts index 2816db2498..1d921ddda4 100644 --- a/packages/application-shell/src/feature-toggles.ts +++ b/packages/application-shell/src/feature-toggles.ts @@ -17,8 +17,4 @@ * them to off until fetched). */ -export const UI_REDESIGN = 'uiRedesign'; - -export const FLAGS = { - [UI_REDESIGN]: true, -}; +export const FLAGS = {}; diff --git a/packages/assets/images/public-background.png b/packages/assets/images/public-background.png deleted file mode 100644 index ff7fd71fb0..0000000000 Binary files a/packages/assets/images/public-background.png and /dev/null differ diff --git a/packages/react-notifications/src/components/notification/notification.styles.ts b/packages/react-notifications/src/components/notification/notification.styles.ts index 63a6af370b..84827b7b68 100644 --- a/packages/react-notifications/src/components/notification/notification.styles.ts +++ b/packages/react-notifications/src/components/notification/notification.styles.ts @@ -14,7 +14,6 @@ type StyleProps = { type: TAppNotificationKind; domain: TAppNotificationDomain; fixed: boolean; - isNewTheme?: boolean; }; const getColorByType = (value: TAppNotificationKind) => { @@ -86,8 +85,11 @@ const getStylesForNotificationIcon = ( const getStylesForCloseIcon = (props: StyleProps): SerializedStyles => css` display: flex; justify-content: center; - ${props.isNewTheme ? '& svg { width: 16px; height: 16px; }' : ''} - ${props.isNewTheme && props.domain !== NOTIFICATION_DOMAINS.SIDE + & svg { + width: 16px; + height: 16px; + } + ${props.domain !== NOTIFICATION_DOMAINS.SIDE ? '& svg { fill: ' + designTokens.colorSurface + '; }' : ''} `; @@ -100,13 +102,10 @@ const getStylesForContent = (props: StyleProps): SerializedStyles => { return css` flex-basis: 100%; flex-grow: 1; - padding: 0 - ${props.isNewTheme ? designTokens.spacingM : designTokens.spacingS}; + padding: ${`0 ${designTokens.spacingM}`}; margin: 0; font-size: ${props.domain === NOTIFICATION_DOMAINS.SIDE - ? props.isNewTheme - ? '1rem' - : '0.929rem' + ? '1rem' : 'inherit'}; color: ${fontColor}; @@ -158,13 +157,8 @@ const getStylesForNotification = (props: StyleProps): SerializedStyles => { ${designTokens.spacingM} 50px !important; text-align: left; background: ${designTokens.colorSurface}; - border: 1px solid - ${props.isNewTheme - ? getBorderColor(props.type) - : getColorByType(props.type)}; - box-shadow: ${props.isNewTheme - ? '0px 2px 5px 0px rgba(0, 0, 0, 0.15)' - : '0 1px 2px rgba(0, 0, 0, 0.24)'}; + border: 1px solid ${getBorderColor(props.type)}; + box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.15); border-radius: ${designTokens.borderRadius6}; word-break: break-word; hyphens: auto; /* still not supported on Chrome */ diff --git a/packages/react-notifications/src/components/notification/notification.tsx b/packages/react-notifications/src/components/notification/notification.tsx index 3f660832f3..204e7da2bd 100644 --- a/packages/react-notifications/src/components/notification/notification.tsx +++ b/packages/react-notifications/src/components/notification/notification.tsx @@ -1,4 +1,3 @@ -// TODO: @redesign cleanup import { ReactNode, SyntheticEvent } from 'react'; import { useIntl } from 'react-intl'; import type { @@ -10,14 +9,11 @@ import { NOTIFICATION_DOMAINS, NOTIFICATION_KINDS_SIDE, } from '@commercetools-frontend/constants'; -import { useTheme } from '@commercetools-uikit/design-system'; import { useFieldId } from '@commercetools-uikit/hooks'; -import IconButton from '@commercetools-uikit/icon-button'; import { CloseBoldIcon, ErrorIcon, WarningIcon, - InfoIcon, InformationIcon, CheckBoldIcon, } from '@commercetools-uikit/icons'; @@ -46,7 +42,6 @@ type PropsIcon = { | 'surface' | 'primary' | 'primary40'; - isNewTheme: boolean; }; const NotificationIcon = (props: PropsIcon) => { @@ -54,11 +49,7 @@ const NotificationIcon = (props: PropsIcon) => { return ; } if (props.type === NOTIFICATION_KINDS_SIDE.info) { - return props.isNewTheme ? ( - - ) : ( - - ); + return ; } if (props.type === NOTIFICATION_KINDS_SIDE.warning) { return ; @@ -82,22 +73,20 @@ const defaultProps: Pick = { const Notification = (props: Props) => { const intl = useIntl(); const id = useFieldId(undefined, sequentialId); - const { isNewTheme, themedValue } = useTheme(); - const Button = themedValue(IconButton, SecondaryIconButton); return (
-
+
{props.children}
{props.onCloseClick ? ( -
-
diff --git a/visual-testing-app/src/components/theme-switcher/theme-switcher.tsx b/visual-testing-app/src/components/theme-switcher/theme-switcher.tsx deleted file mode 100644 index ab0a9ccbd6..0000000000 --- a/visual-testing-app/src/components/theme-switcher/theme-switcher.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import { themes, designTokens } from '@commercetools-uikit/design-system'; - -export type ThemeName = keyof typeof themes; - -type ThemeSwitcherProps = { - selectedTheme: string; - onThemeChange(theme: ThemeName): void; -}; - -const ThemeSwitcher = ({ - selectedTheme, - onThemeChange, -}: ThemeSwitcherProps) => { - return ( -
- - -
- ); -}; - -export default ThemeSwitcher; diff --git a/visual-testing-app/src/index.tsx b/visual-testing-app/src/index.tsx index b9933dbcf9..f346c43067 100644 --- a/visual-testing-app/src/index.tsx +++ b/visual-testing-app/src/index.tsx @@ -1,4 +1,3 @@ -import { useState } from 'react'; import ReactDOM from 'react-dom'; import { PortalsContainer, @@ -6,26 +5,11 @@ import { } from '@commercetools-frontend/application-components'; import { ThemeProvider } from '@commercetools-uikit/design-system'; import Application from './application'; -import ThemeSwitcher, { - ThemeName, -} from './components/theme-switcher/theme-switcher'; const Main = () => { - const [selectedTheme, updateTheme] = useState('default'); - const isLocalEnvironment = process.env.NODE_ENV === 'development'; - return ( <> - - {isLocalEnvironment ? ( - updateTheme(newTheme)} - /> - ) : null} + diff --git a/website-components-playground/src/index.tsx b/website-components-playground/src/index.tsx index 62c74350f2..a15b68cca9 100644 --- a/website-components-playground/src/index.tsx +++ b/website-components-playground/src/index.tsx @@ -4,12 +4,10 @@ import { themesOverrides } from '@commercetools-frontend/application-components' import { ThemeProvider } from '@commercetools-uikit/design-system'; import Application from './application'; -const theme = process.env.NODE_ENV === 'production' ? 'default' : 'test'; - ReactDOM.render( <> - + ,