The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
chore: Unify Label Styles Across App #6389 (#10728)
Aaryan Bajaje666506ea394
diff --git a/packages/twenty-front/src/modules/command-menu/components/CommandGroup.tsx b/packages/twenty-front/src/modules/command-menu/components/CommandGroup.tsxindex 320ebee6afb..47450003bf5 100644--- a/packages/twenty-front/src/modules/command-menu/components/CommandGroup.tsx+++ b/packages/twenty-front/src/modules/command-menu/components/CommandGroup.tsx@@ -1,11 +1,9 @@import styled from '@emotion/styled';import React from 'react';+import { Label } from 'twenty-ui';-const StyledGroupHeading = styled.div`+const StyledGroupHeading = styled(Label)`align-items: center;- color: ${({ theme }) => theme.font.color.light};- font-size: ${({ theme }) => theme.font.size.xs};- font-weight: ${({ theme }) => theme.font.weight.semiBold};padding-bottom: ${({ theme }) => theme.spacing(1)};padding-left: ${({ theme }) => theme.spacing(2)};padding-right: ${({ theme }) => theme.spacing(1)};diff --git a/packages/twenty-front/src/modules/ui/field/input/components/AddressInput.tsx b/packages/twenty-front/src/modules/ui/field/input/components/AddressInput.tsxindex aa63b01be6f..fa635a01d0e 100644--- a/packages/twenty-front/src/modules/ui/field/input/components/AddressInput.tsx+++ b/packages/twenty-front/src/modules/ui/field/input/components/AddressInput.tsx@@ -210,7 +210,7 @@ export const AddressInput = ({autoFocusvalue={internalValue.addressStreet1 ?? ''}ref={inputRefs['addressStreet1']}- label="ADDRESS 1"+ label="Address 1"fullWidthonChange={getChangeHandler('addressStreet1')}onFocus={getFocusHandler('addressStreet1')}@@ -218,7 +218,7 @@ export const AddressInput = ({<TextInputV2value={internalValue.addressStreet2 ?? ''}ref={inputRefs['addressStreet2']}- label="ADDRESS 2"+ label="Address 2"fullWidthonChange={getChangeHandler('addressStreet2')}onFocus={getFocusHandler('addressStreet2')}@@ -227,7 +227,7 @@ export const AddressInput = ({<TextInputV2value={internalValue.addressCity ?? ''}ref={inputRefs['addressCity']}- label="CITY"+ label="City"fullWidthonChange={getChangeHandler('addressCity')}onFocus={getFocusHandler('addressCity')}@@ -235,7 +235,7 @@ export const AddressInput = ({<TextInputV2value={internalValue.addressState ?? ''}ref={inputRefs['addressState']}- label="STATE"+ label="State"fullWidthonChange={getChangeHandler('addressState')}onFocus={getFocusHandler('addressState')}@@ -245,13 +245,13 @@ export const AddressInput = ({<TextInputV2value={internalValue.addressPostcode ?? ''}ref={inputRefs['addressPostcode']}- label="POST CODE"+ label="Post Code"fullWidthonChange={getChangeHandler('addressPostcode')}onFocus={getFocusHandler('addressPostcode')}/><CountrySelect- label="COUNTRY"+ label="Country"onChange={getChangeHandler('addressCountry')}selectedCountryName={internalValue.addressCountry ?? ''}/>diff --git a/packages/twenty-front/src/modules/ui/input/components/InputLabel.tsx b/packages/twenty-front/src/modules/ui/input/components/InputLabel.tsxindex f5fd8db5c91..f356547f649 100644--- a/packages/twenty-front/src/modules/ui/input/components/InputLabel.tsx+++ b/packages/twenty-front/src/modules/ui/input/components/InputLabel.tsx@@ -1,10 +1,14 @@import styled from '@emotion/styled';+import { HTMLAttributes } from 'react';+import { Label } from 'twenty-ui';-const StyledLabel = styled.label`- color: ${({ theme }) => theme.font.color.light};- font-size: ${({ theme }) => theme.font.size.xs};- font-weight: ${({ theme }) => theme.font.weight.semiBold};+type InputLabelProps = HTMLAttributes<HTMLLabelElement> & {+ htmlFor?: string;+};++const StyledInputLabel = styled(Label)<InputLabelProps>`+ display: block;margin-bottom: ${({ theme }) => theme.spacing(1)};`;-export const InputLabel = StyledLabel;+export const InputLabel = StyledInputLabel;diff --git a/packages/twenty-front/src/modules/ui/layout/dropdown/components/StyledDropdownMenuSubheader.tsx b/packages/twenty-front/src/modules/ui/layout/dropdown/components/StyledDropdownMenuSubheader.tsxindex c659e3dc65c..cae7e833c07 100644--- a/packages/twenty-front/src/modules/ui/layout/dropdown/components/StyledDropdownMenuSubheader.tsx+++ b/packages/twenty-front/src/modules/ui/layout/dropdown/components/StyledDropdownMenuSubheader.tsx@@ -1,11 +1,8 @@import styled from '@emotion/styled';+import { Label } from 'twenty-ui';-export const StyledDropdownMenuSubheader = styled.div`+export const StyledDropdownMenuSubheader = styled(Label)`background-color: ${({ theme }) => theme.background.transparent.lighter};- color: ${({ theme }) => theme.font.color.light};- font-size: ${({ theme }) => theme.font.size.xxs};- font-weight: ${({ theme }) => theme.font.weight.semiBold};padding: ${({ theme }) => `${theme.spacing(1)} ${theme.spacing(2)}`};- text-transform: uppercase;width: 100%;`;diff --git a/packages/twenty-front/src/modules/ui/layout/table/components/TableSection.tsx b/packages/twenty-front/src/modules/ui/layout/table/components/TableSection.tsxindex 84be28c93e6..54db42466f9 100644--- a/packages/twenty-front/src/modules/ui/layout/table/components/TableSection.tsx+++ b/packages/twenty-front/src/modules/ui/layout/table/components/TableSection.tsx@@ -1,7 +1,7 @@import { useTheme } from '@emotion/react';import styled from '@emotion/styled';import { ReactNode, useState } from 'react';-import { IconChevronDown, IconChevronUp } from 'twenty-ui';+import { IconChevronDown, IconChevronUp, Label } from 'twenty-ui';import { TableBody } from './TableBody';type TableSectionProps = {@@ -14,16 +14,12 @@ const StyledSectionHeader = styled.div<{ isExpanded: boolean }>`align-items: center;background-color: ${({ theme }) => theme.background.transparent.lighter};border-bottom: 1px solid ${({ theme }) => theme.border.color.light};- color: ${({ theme }) => theme.font.color.light};cursor: pointer;display: flex;- font-size: ${({ theme }) => theme.font.size.xs};- font-weight: ${({ theme }) => theme.font.weight.semiBold};height: ${({ theme }) => theme.spacing(6)};justify-content: space-between;padding: 0 ${({ theme }) => theme.spacing(2)};text-align: left;- text-transform: uppercase;`;const StyledSection = styled.div<{ isExpanded: boolean }>`@@ -44,8 +40,8 @@ export const TableSection = ({isInitiallyExpanded = true,title,}: TableSectionProps) => {- const theme = useTheme();const [isExpanded, setIsExpanded] = useState(isInitiallyExpanded);+ const theme = useTheme();const handleToggleSection = () =>setIsExpanded((previousIsExpanded) => !previousIsExpanded);@@ -56,11 +52,17 @@ export const TableSection = ({isExpanded={isExpanded}onClick={handleToggleSection}>- {title}+ <Label>{title}</Label>{isExpanded ? (- <IconChevronUp size={theme.icon.size.sm} />+ <IconChevronUp+ size={theme.icon.size.md}+ stroke={theme.icon.stroke.sm}+ />) : (- <IconChevronDown size={theme.icon.size.sm} />+ <IconChevronDown+ size={theme.icon.size.md}+ stroke={theme.icon.stroke.sm}+ />)}</StyledSectionHeader><StyledSection isExpanded={isExpanded}>diff --git a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawerSectionTitle.tsx b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawerSectionTitle.tsxindex 72c7215fcf9..c26dcc9c5c1 100644--- a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawerSectionTitle.tsx+++ b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawerSectionTitle.tsx@@ -8,14 +8,12 @@ import styled from '@emotion/styled';import React from 'react';import { useRecoilValue } from 'recoil';import { isDefined } from 'twenty-shared';+import { Label } from 'twenty-ui';const StyledTitle = styled.div`align-items: center;border-radius: ${({ theme }) => theme.border.radius.sm};- color: ${({ theme }) => theme.font.color.light};display: flex;- font-size: ${({ theme }) => theme.font.size.xs};- font-weight: ${({ theme }) => theme.font.weight.semiBold};height: ${({ theme }) => theme.spacing(5)};padding-left: ${({ theme }) => theme.spacing(1)};padding-right: ${({ theme }) => theme.spacing(0.5)};@@ -29,7 +27,7 @@ const StyledTitle = styled.div`}`;-const StyledLabel = styled.div`+const StyledLabelContainer = styled.div`flex-grow: 1;`;@@ -77,7 +75,9 @@ export const NavigationDrawerSectionTitle = ({return (<StyledTitle className="section-title-container">- <StyledLabel onClick={handleTitleClick}>{label}</StyledLabel>+ <StyledLabelContainer onClick={handleTitleClick}>+ <Label>{label}</Label>+ </StyledLabelContainer>{rightIcon && (<StyledRightIcon isMobile={isMobile}>{rightIcon}</StyledRightIcon>)}