From 1b9af5bf6dfe594667db25776e3674cd44723532 Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Fri, 6 Jun 2025 16:40:26 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8(frontend)=20replace=20hardcoded=20?= =?UTF-8?q?hex=20values=20with=20design=20tokens?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clean up fast-shipped features that broke design system by using proper primary/semantic tokens instead of hardcoded colors. Enables better theme customization for all implementations. --- src/frontend/panda.config.ts | 4 ++++ src/frontend/src/components/FeedbackBanner.tsx | 4 ++-- .../features/home/components/IntroSlider.tsx | 4 ++-- .../home/components/LaterMeetingDialog.tsx | 14 ++++++++++---- src/frontend/src/features/home/routes/Home.tsx | 2 +- .../notifications/components/Toast.tsx | 2 +- .../components/ToastLowerHand.tsx | 7 ++++--- .../notifications/components/ToastRaised.tsx | 7 ++++--- .../WaitingParticipantNotification.tsx | 18 +++++++++--------- .../rooms/components/ActiveSpeaker.tsx | 4 ++-- .../features/rooms/components/InviteDialog.tsx | 14 ++++++++++---- .../rooms/livekit/components/Admin.tsx | 2 +- .../livekit/components/MutedMicIndicator.tsx | 12 +++++++++--- .../rooms/livekit/components/chat/Input.tsx | 7 ++++--- .../livekit/components/controls/ChatToggle.tsx | 5 +++-- .../ParticipantsCollapsableList.tsx | 8 +++++--- .../controls/Participants/ParticipantsList.tsx | 2 +- .../effects/EffectsConfiguration.tsx | 2 +- .../features/rooms/livekit/prefabs/Chat.tsx | 7 ++++--- 19 files changed, 77 insertions(+), 48 deletions(-) diff --git a/src/frontend/panda.config.ts b/src/frontend/panda.config.ts index ccf0d98b..e083b055 100644 --- a/src/frontend/panda.config.ts +++ b/src/frontend/panda.config.ts @@ -315,6 +315,10 @@ const config: Config = { 'subtle-text': { value: '{colors.red.700}' }, ...pandaPreset.theme.tokens.colors.red, }, + alert: { + DEFAULT: { value: '{colors.blue.700}' }, + notification: { value: '{colors.red.600}' }, + }, success: { DEFAULT: { value: '{colors.green.700}' }, hover: { value: '{colors.green.800}' }, diff --git a/src/frontend/src/components/FeedbackBanner.tsx b/src/frontend/src/components/FeedbackBanner.tsx index 15b581f7..ea27685a 100644 --- a/src/frontend/src/components/FeedbackBanner.tsx +++ b/src/frontend/src/components/FeedbackBanner.tsx @@ -14,8 +14,8 @@ export const FeedbackBanner = () => {
- +
{t('laterMeetingDialog.permissions')} diff --git a/src/frontend/src/features/home/routes/Home.tsx b/src/frontend/src/features/home/routes/Home.tsx index 861310bf..e7a7404f 100644 --- a/src/frontend/src/features/home/routes/Home.tsx +++ b/src/frontend/src/features/home/routes/Home.tsx @@ -111,7 +111,7 @@ const RightColumn = ({ children }: { children?: ReactNode }) => { const Separator = styled('div', { base: { borderBottom: '1px solid', - borderColor: '#747775', + borderColor: 'greyscale.500', marginTop: '2.5rem', maxWidth: '30rem', width: '100%', diff --git a/src/frontend/src/features/notifications/components/Toast.tsx b/src/frontend/src/features/notifications/components/Toast.tsx index 0ead5d19..3f5876eb 100644 --- a/src/frontend/src/features/notifications/components/Toast.tsx +++ b/src/frontend/src/features/notifications/components/Toast.tsx @@ -12,7 +12,7 @@ export const StyledToastContainer = styled('div', { margin: 0.5, boxShadow: 'rgba(0, 0, 0, 0.5) 0px 4px 8px 0px, rgba(0, 0, 0, 0.3) 0px 6px 20px 4px', - backgroundColor: '#494c4f', + backgroundColor: 'greyscale.700', color: 'white', borderRadius: '8px', '&[data-entering]': { animation: 'fade 200ms' }, diff --git a/src/frontend/src/features/notifications/components/ToastLowerHand.tsx b/src/frontend/src/features/notifications/components/ToastLowerHand.tsx index 45505fbc..4a3687a7 100644 --- a/src/frontend/src/features/notifications/components/ToastLowerHand.tsx +++ b/src/frontend/src/features/notifications/components/ToastLowerHand.tsx @@ -5,6 +5,7 @@ import { StyledToastContainer, ToastProps } from './Toast' import { HStack } from '@/styled-system/jsx' import { useTranslation } from 'react-i18next' import { Button } from '@/primitives' +import { css } from '@/styled-system/css' export function ToastLowerHand({ state, ...props }: ToastProps) { const { t } = useTranslation('notifications', { keyPrefix: 'lowerHand' }) @@ -31,10 +32,10 @@ export function ToastLowerHand({ state, ...props }: ToastProps) {
- +
{t('shareDialog.permissions')} diff --git a/src/frontend/src/features/rooms/livekit/components/Admin.tsx b/src/frontend/src/features/rooms/livekit/components/Admin.tsx index c3d86dd9..744192e9 100644 --- a/src/frontend/src/features/rooms/livekit/components/Admin.tsx +++ b/src/frontend/src/features/rooms/livekit/components/Admin.tsx @@ -52,7 +52,7 @@ export const Admin = () => { border: 'none', height: '1px', width: '100%', - background: '#dadce0', + background: 'greyscale.250', })} /> +
-
+
) } diff --git a/src/frontend/src/features/rooms/livekit/components/chat/Input.tsx b/src/frontend/src/features/rooms/livekit/components/chat/Input.tsx index b04ca1c8..e6487bd6 100644 --- a/src/frontend/src/features/rooms/livekit/components/chat/Input.tsx +++ b/src/frontend/src/features/rooms/livekit/components/chat/Input.tsx @@ -4,6 +4,7 @@ import { RiSendPlane2Fill } from '@remixicon/react' import { useState, useEffect } from 'react' import { RefObject } from 'react' import { useTranslation } from 'react-i18next' +import { css } from '@/styled-system/css' const MAX_ROWS = 6 @@ -70,12 +71,12 @@ export const ChatInput = ({ return (