[UI] Remove theme constants from twenty-front and use the ones exported from twenty-ui. (#5558)

Some parts of the Frontend used theme constants exported from
`modules/ui` while other parts used theme constants exported from
`twenty-ui`.

This PR centralizes theme constants by removing them from `modules/ui`
completely.
This commit is contained in:
Abdullah
2024-05-25 19:09:25 +05:00
committed by GitHub
parent 9c325eb0ef
commit cfd83d6b8e
81 changed files with 84 additions and 633 deletions

View File

@ -1,9 +1,8 @@
import styled from '@emotion/styled';
import { IconComponent, Tag } from 'twenty-ui';
import { IconComponent, Tag, ThemeColor } from 'twenty-ui';
import { Checkbox } from '@/ui/input/components/Checkbox';
import { MenuItemLeftContent } from '@/ui/navigation/menu-item/internals/components/MenuItemLeftContent';
import { ThemeColor } from '@/ui/theme/constants/MainColorNames';
import { StyledMenuItemBase } from '../internals/components/StyledMenuItemBase';

View File

@ -1,11 +1,10 @@
import { Tag } from 'twenty-ui';
import { Tag, ThemeColor } from 'twenty-ui';
import {
Checkbox,
CheckboxShape,
CheckboxSize,
} from '@/ui/input/components/Checkbox';
import { ThemeColor } from '@/ui/theme/constants/MainColorNames';
import {
StyledMenuItemBase,

View File

@ -1,7 +1,10 @@
import { useTheme } from '@emotion/react';
import { ColorSample, ColorSampleVariant, IconCheck } from 'twenty-ui';
import { ThemeColor } from '@/ui/theme/constants/MainColorNames';
import {
ColorSample,
ColorSampleVariant,
IconCheck,
ThemeColor,
} from 'twenty-ui';
import {
StyledMenuItemLabel,

View File

@ -1,7 +1,5 @@
import { useTheme } from '@emotion/react';
import { IconCheck, Tag } from 'twenty-ui';
import { ThemeColor } from '@/ui/theme/constants/MainColorNames';
import { IconCheck, Tag, ThemeColor } from 'twenty-ui';
import { StyledMenuItemLeftContent } from '../internals/components/StyledMenuItemBase';

View File

@ -1,8 +1,6 @@
import { MouseEvent } from 'react';
import styled from '@emotion/styled';
import { IconComponent } from 'twenty-ui';
import { HOVER_BACKGROUND } from '@/ui/theme/constants/HoverBackground';
import { HOVER_BACKGROUND, IconComponent } from 'twenty-ui';
import { MenuItemLeftContent } from '../internals/components/MenuItemLeftContent';
import { StyledMenuItemLeftContent } from '../internals/components/StyledMenuItemBase';

View File

@ -6,12 +6,9 @@ import {
CatalogStory,
ColorSampleVariant,
ComponentDecorator,
} from 'twenty-ui';
import {
MAIN_COLOR_NAMES,
ThemeColor,
} from '@/ui/theme/constants/MainColorNames';
} from 'twenty-ui';
import { MenuItemSelectColor } from '../MenuItemSelectColor';

View File

@ -1,7 +1,6 @@
import { css } from '@emotion/react';
import styled from '@emotion/styled';
import { HOVER_BACKGROUND } from '@/ui/theme/constants/HoverBackground';
import { HOVER_BACKGROUND } from 'twenty-ui';
import { MenuItemAccent } from '../../types/MenuItemAccent';

View File

@ -3,9 +3,9 @@ import { css, useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { motion } from 'framer-motion';
import { useRecoilValue } from 'recoil';
import { MOBILE_VIEWPORT } from 'twenty-ui';
import { isNavigationDrawerOpenState } from '@/ui/navigation/states/isNavigationDrawerOpenState';
import { MOBILE_VIEWPORT } from '@/ui/theme/constants/MobileViewport';
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
import { DESKTOP_NAV_DRAWER_WIDTHS } from '../constants/DesktopNavDrawerWidths';

View File

@ -4,10 +4,9 @@ import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { isNonEmptyString } from '@sniptt/guards';
import { useSetRecoilState } from 'recoil';
import { IconComponent, Pill } from 'twenty-ui';
import { IconComponent, MOBILE_VIEWPORT, Pill } from 'twenty-ui';
import { isNavigationDrawerOpenState } from '@/ui/navigation/states/isNavigationDrawerOpenState';
import { MOBILE_VIEWPORT } from '@/ui/theme/constants/MobileViewport';
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
import { isDefined } from '~/utils/isDefined';

View File

@ -1,6 +1,5 @@
import { atom } from 'recoil';
import { MOBILE_VIEWPORT } from '@/ui/theme/constants/MobileViewport';
import { MOBILE_VIEWPORT } from 'twenty-ui';
const isMobile = window.innerWidth <= MOBILE_VIEWPORT;

View File

@ -1,9 +1,8 @@
import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { motion } from 'framer-motion';
import { AnimatedCheckmark } from 'twenty-ui';
import { AnimatedCheckmark, MOBILE_VIEWPORT } from 'twenty-ui';
import { MOBILE_VIEWPORT } from '@/ui/theme/constants/MobileViewport';
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
const StyledContainer = styled.div<{ isLast: boolean }>`

View File

@ -1,7 +1,7 @@
import React from 'react';
import styled from '@emotion/styled';
import { MOBILE_VIEWPORT } from 'twenty-ui';
import { MOBILE_VIEWPORT } from '@/ui/theme/constants/MobileViewport';
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
import { Step, StepProps } from './Step';