Skip to content

Commit

Permalink
Chore: Update color tokens (#27704)
Browse files Browse the repository at this point in the history
Co-authored-by: Guilherme Gazzo <guilhermegazzo@gmail.com>
Co-authored-by: dougfabris <devfabris@gmail.com>
  • Loading branch information
3 people authored Jan 20, 2023
1 parent c1142a5 commit 64ad025
Show file tree
Hide file tree
Showing 72 changed files with 192 additions and 221 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default {
},
decorators: [
(fn): ReactElement => (
<Box size={24} backgroundColor='neutral-500' position='relative'>
<Box size={24} backgroundColor='neutral' position='relative'>
{fn()}
</Box>
),
Expand Down
11 changes: 2 additions & 9 deletions apps/meteor/client/components/Page/Page.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
import { Box } from '@rocket.chat/fuselage';
import Colors from '@rocket.chat/fuselage-tokens/colors';
import type { ReactElement, ComponentProps } from 'react';
import React, { useState } from 'react';

import PageContext from './PageContext';

type PageProps = Omit<ComponentProps<typeof Box>, 'backgroundColor'> & {
background?: 'light' | 'tint';
background?: 'light' | 'tint' | 'neutral';
};

const surfaceMap = {
light: Colors.white,
tint: Colors.n100,
neutral: Colors.n400,
}; // TODO: Remove this export after the migration is complete

const Page = ({ background = 'light', ...props }: PageProps): ReactElement => {
const [border, setBorder] = useState(false);
return (
Expand All @@ -28,8 +21,8 @@ const Page = ({ background = 'light', ...props }: PageProps): ReactElement => {
height='full'
overflow='hidden'
aria-labelledby='PageHeader-title'
bg={background}
{...props}
backgroundColor={`var(--rcx-color-surface-${background}, ${surfaceMap[background]})`}
/>
</PageContext.Provider>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import { AsyncStatePhase } from '../../../lib/asyncState/AsyncStatePhase';
import { useOmnichannelRoomIcon } from './context/OmnichannelRoomIconContext';

export const colors = {
busy: 'danger-500',
away: 'warning-600',
online: 'success-500',
offline: 'neutral-600',
busy: 'on-danger',
away: 'on-warning',
online: 'on-success',
offline: 'annotation',
};

const convertBoxSizeToNumber = (boxSize: ComponentProps<typeof Icon>['size']): number => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import type { ComponentProps, ReactElement } from 'react';
import React from 'react';

const colors = {
busy: 'danger-500',
away: 'warning-600',
online: 'success-500',
offline: 'neutral-600',
busy: 'on-danger',
away: 'on-warning',
online: 'on-success',
offline: 'annotation',
};

const iconMap = {
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/components/VerticalBar/VerticalBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const VerticalBar: FC<ComponentProps<typeof Box>> = ({ children, ...props }) =>
return (
<Box
rcx-vertical-bar
bg='light'
bg='room'
display='flex'
flexDirection='column'
flexShrink={0}
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/components/dataView/Growth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const Growth = ({ children, ...props }: GrowthProps): ReactElement | null => {
}

return (
<Box is='span' color={children < 0 ? 'danger' : 'success'} {...props}>
<Box is='span' color={children < 0 ? 'on-danger' : 'on-success'} {...props}>
{children < 0 ? <NegativeGrowthSymbol /> : <PositiveGrowthSymbol />}
{String(Math.abs(children))}
</Box>
Expand Down
14 changes: 11 additions & 3 deletions apps/meteor/client/components/message/MessageContentBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,9 @@ const MessageContentBody = ({ mentions, channels, md }: MessageContentBodyProps)
const messageBodyAdditionalStyles = css`
> blockquote {
padding-inline: 8px;
border: 1px solid ${Palette.stroke['stroke-extra-light']};
border-radius: 2px;
border-width: 1px;
border-style: solid;
background-color: ${Palette.surface['surface-tint']};
border-color: ${Palette.stroke['stroke-extra-light']};
border-inline-start-color: ${Palette.stroke['stroke-medium']};
&:hover,
Expand All @@ -126,6 +124,16 @@ const MessageContentBody = ({ mentions, channels, md }: MessageContentBodyProps)
margin-inline-start: 0;
padding-inline-start: 0;
}
a {
color: ${Palette.statusColor['status-font-on-info']};
&:hover {
text-decoration: underline;
}
&:focus {
border: 2px solid ${Palette.stroke['stroke-extra-light-highlight']};
border-radius: 2px;
}
}
`;

const convertAsciiToEmoji = useUserPreference<boolean>('convertAsciiEmoji', true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const Retry: FC<RetryProps> = ({ retry }) => {
return (
<ImageBox className={clickable} onClick={retry} size={160}>
<Icon name='refresh' color='hint' size='x64' />
<Box fontScale='h2' color='default'>
<Box fontScale='h3' color='default' textAlign='center'>
{t('Retry')}
</Box>
</ImageBox>
Expand Down
1 change: 0 additions & 1 deletion apps/meteor/client/components/modal/ModalBackdrop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ const ModalBackdrop = ({ children, onDismiss }: ModalBackdropProps): ReactElemen
inset={0}
display='flex'
flexDirection='column'
backgroundColor='neutral-900-65'
onMouseDown={onMouseDown}
onMouseUp={onMouseUp}
/>
Expand Down
8 changes: 4 additions & 4 deletions apps/meteor/client/hooks/useRoomIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import React from 'react';
import { ReactiveUserStatus } from '../components/UserStatus';

export const colors = {
busy: 'danger-500',
away: 'warning-600',
online: 'success-500',
offline: 'neutral-600',
busy: 'on-danger',
away: 'on-warning',
online: 'on-success',
offline: 'annotation',
};

export const useRoomIcon = (
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/sidebar/Item/Condensed.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default {
},
decorators: [
(fn) => (
<Box maxWidth='x300' bg='neutral-800' borderRadius='x4'>
<Box maxWidth='x300' bg='dark' borderRadius='x4'>
{fn()}
</Box>
),
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/sidebar/Item/Extended.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default {
},
decorators: [
(fn) => (
<Box maxWidth='x300' bg='neutral-800' borderRadius='x4'>
<Box maxWidth='x300' bg='dark' borderRadius='x4'>
{fn()}
</Box>
),
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/sidebar/Item/Medium.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default {
},
decorators: [
(fn) => (
<Box maxWidth='x300' bg='neutral-800' borderRadius='x4'>
<Box maxWidth='x300' bg='dark' borderRadius='x4'>
{fn()}
</Box>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const VoipFooterTemplate: ComponentStory<typeof VoipFooter> = (args) => {
};

return (
<Box maxWidth='x300' bg='neutral-800' borderRadius='x4'>
<Box maxWidth='x300' bg='dark' borderRadius='x4'>
<VoipFooter
{...args}
callActions={callActions}
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/client/sidebar/footer/voip/VoipFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const VoipFooter = ({
{callsInQueue}
</Box>
<Box display='flex' flexDirection='row' h='24px' mi='16px' mbs='12px' mbe='8px' justifyContent='space-between' alignItems='center'>
<Box color='neutral-500' fontScale='c2' withTruncatedText>
<Box color='disabled' fontScale='c2' withTruncatedText>
{title}
</Box>
{(callerState === 'IN_CALL' || callerState === 'ON_HOLD') && (
Expand All @@ -111,7 +111,7 @@ export const VoipFooter = ({
color={paused ? 'disabled' : 'hint'}
onClick={handleHold}
/>
{options && <Menu color='neutral-500' data-tooltip={t('More_options')} options={options} />}
{options && <Menu color='disabled' data-tooltip={t('More_options')} options={options} />}
</ButtonGroup>
)}
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,12 @@ const CreateChannelModal = ({ teamId = '', onClose }: CreateChannelModalProps):
<Modal.Title>{t('Create_channel')}</Modal.Title>
<Modal.Close title={t('Close')} onClick={onClose} />
</Modal.Header>
<Modal.Content>
<Modal.Content mbe='x2'>
<FieldGroup>
<Field>
<Field.Label>{t('Name')}</Field.Label>
<Field.Row>
<TextInput
autoFocus
data-qa-type='channel-name-input'
{...register('name', {
required: t('error-the-field-is-required', { field: t('Name') }),
Expand Down Expand Up @@ -305,6 +304,7 @@ const CreateChannelModal = ({ teamId = '', onClose }: CreateChannelModalProps):
</Field>
</FieldGroup>
</Modal.Content>

<Modal.Footer>
<Modal.FooterControllers>
<Button onClick={onClose}>{t('Cancel')}</Button>
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/sidebar/header/CreateDirectMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const CreateDirectMessage: FC<CreateDirectMessageProps> = ({ onClose }) => {
<Modal.Title>{t('Direct_Messages')}</Modal.Title>
<Modal.Close onClick={onClose} />
</Modal.Header>
<Modal.Content>
<Modal.Content mbe='x2'>
<Box>{t('Direct_message_creation_description')}</Box>
<Box mbs='x16' display='flex' flexDirection='column' width='full'>
<UserAutoCompleteMultipleFederated value={users} onChange={setUsers} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,12 @@ const CreateTeamModal = ({ onClose }: { onClose: () => void }): ReactElement =>
<Modal.Title>{t('Teams_New_Title')}</Modal.Title>
<Modal.Close title={t('Close')} onClick={onClose} />
</Modal.Header>
<Modal.Content>
<Modal.Content mbe='x2'>
<FieldGroup>
<Field>
<Field.Label>{t('Teams_New_Name_Label')}</Field.Label>
<Field.Row>
<TextInput
autoFocus
aria-invalid={errors.name ? 'true' : 'false'}
{...register('name', {
required: t('error-the-field-is-required', { field: t('Name') }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const OmnichannelLivechatToggle = (props: Omit<ComponentProps<typeof Side
{...props}
id={'omnichannel-status-toggle'}
data-tooltip={agentAvailable ? t('Turn_off_answer_chats') : t('Turn_on_answer_chats')}
color={agentAvailable ? 'success' : undefined}
color={agentAvailable ? 'on-success' : undefined}
icon={agentAvailable ? 'message' : 'message-disabled'}
onClick={handleAvailableStatusChange}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const MyDataModal: FC<MyDataModalProps> = ({ onCancel, title, text, ...props })
return (
<Modal {...props}>
<Modal.Header>
<Modal.Icon color='success' name='circle-check' />
<Modal.Icon color='on-success' name='circle-check' />
<Modal.Title>{title}</Modal.Title>
<Modal.Close onClick={onCancel} />
</Modal.Header>
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/client/views/admin/apps/AppMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ function AppMenu({ app, isAppDetailsPage, ...props }) {
isAppEnabled && {
disable: {
label: (
<Box color='warning'>
<Box color='on-warning'>
<Icon name='ban' size='x16' marginInlineEnd='x4' />
{t('Disable')}
</Box>
Expand Down Expand Up @@ -363,7 +363,7 @@ function AppMenu({ app, isAppDetailsPage, ...props }) {
...(app.installed && {
uninstall: {
label: (
<Box color='danger'>
<Box color='on-danger'>
<Icon name='trash' size='x16' marginInlineEnd='x4' />
{t('Uninstall')}
</Box>
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/views/admin/apps/AppUpdateModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const AppUpdateModal: FC<AppUpdateModalProps> = ({ confirm, cancel, ...props })
return (
<Modal {...props}>
<Modal.Header>
<Modal.Icon color='danger' name='info-circled' />
<Modal.Icon color='on-danger' name='info-circled' />
<Modal.Title>{t('Apps_Manual_Update_Modal_Title')}</Modal.Title>
<Modal.Close onClick={handleCloseButtonClick} />
</Modal.Header>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const AppPermissionsList = ({ appPermissions }: { appPermissions: AppPermission[
<Fragment key={permission.name}>
<li>{handleAppPermissions(permission.name)}</li>
{permission.required && (
<Box is='span' color='danger'>
<Box is='span' color='on-danger'>
({t('required')})
</Box>
)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { AppScreenshot } from '@rocket.chat/core-typings';
import { Box, Button, Icon } from '@rocket.chat/fuselage';
import colors from '@rocket.chat/fuselage-tokens/colors';
import { Box, IconButton } from '@rocket.chat/fuselage';
import type { ReactElement } from 'react';
import React from 'react';

Expand Down Expand Up @@ -48,46 +47,28 @@ const ScreenshotCarousel = ({

return (
<>
<Box position='fixed' w='100%' h='100vh' bg={colors.n800} opacity='0.7' zIndex='2' marginBlock='-0.75px' />
<Box position='fixed' w='100%' h='100vh' bg='font-pure-black' opacity='0.7' marginBlock='-0.75px' zIndex='2' />

{!isFirstSlide && (
<Button
<IconButton
secondary
icon='chevron-right'
onClick={handlePrevSlide}
display='flex'
alignItems='center'
justifyContent='center'
style={{ top: '50%', left: '10px', cursor: 'pointer', transform: 'translateY(-50%)' }}
position='absolute'
zIndex={3}
borderRadius='x2'
w='x28'
h='x28'
margin='0'
bg={colors.n600}
borderColor={colors.n600}
>
<Icon name='chevron-right' size='x24' color='alternative' />
</Button>
/>
)}

{!isLastSlide && (
<Button
<IconButton
secondary
icon='chevron-left'
onClick={handleNextSlide}
display='flex'
alignItems='center'
justifyContent='center'
style={{ top: '50%', right: '10px', cursor: 'pointer', transform: 'translateY(-50%)' }}
position='absolute'
zIndex={3}
borderRadius='x2'
w='x28'
h='x28'
margin='0'
bg={colors.n600}
borderColor={colors.n600}
>
<Icon name='chevron-left' size='x24' color='alternative' />
</Button>
/>
)}

<Box
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/client/views/admin/cloud/CopyStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ const CopyStep: FC<CopyStepProps> = ({ onNextButtonClick }) => {
<Box withRichContent>
<p>{t('Cloud_register_offline_helper')}</p>
</Box>
<Box display='flex' flexDirection='column' alignItems='stretch' padding='x16' flexGrow={1} backgroundColor='neutral-800'>
<Box display='flex' flexDirection='column' alignItems='stretch' padding='x16' flexGrow={1} backgroundColor='dark'>
<Scrollable vertical>
<Box height='x108' fontFamily='mono' fontScale='p2' color='alternative' style={{ wordBreak: 'break-all' }}>
<Box height='x108' fontFamily='mono' fontScale='p2' color='white' style={{ wordBreak: 'break-all' }}>
{clientKey}
</Box>
</Scrollable>
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/client/views/admin/cloud/PasteStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ const PasteStep: FC<PasteStepProps> = ({ onBackButtonClick, onFinish }) => {
<Box withRichContent>
<p>{t('Cloud_register_offline_finish_helper')}</p>
</Box>
<Box display='flex' flexDirection='column' alignItems='stretch' padding='x16' flexGrow={1} backgroundColor='neutral-800'>
<Box display='flex' flexDirection='column' alignItems='stretch' padding='x16' flexGrow={1} backgroundColor='dark'>
<Scrollable vertical>
<Box
is='textarea'
height='x108'
fontFamily='mono'
fontScale='p2'
color='alternative'
color='white'
style={{ wordBreak: 'break-all', resize: 'none' }}
placeholder={t('Paste_here')}
disabled={isLoading}
Expand Down
Loading

0 comments on commit 64ad025

Please sign in to comment.