diff --git a/src/alf/themes.ts b/src/alf/themes.ts index b36e782fd6..72e08e8941 100644 --- a/src/alf/themes.ts +++ b/src/alf/themes.ts @@ -73,19 +73,19 @@ export const darkPalette: Palette = { white: tokens.color.gray_0, black: tokens.color.trueBlack, - contrast_25: tokens.color.gray_975, - contrast_50: tokens.color.gray_950, - contrast_100: tokens.color.gray_900, - contrast_200: tokens.color.gray_800, - contrast_300: tokens.color.gray_700, - contrast_400: tokens.color.gray_600, - contrast_500: tokens.color.gray_500, - contrast_600: tokens.color.gray_400, - contrast_700: tokens.color.gray_300, - contrast_800: tokens.color.gray_200, - contrast_900: tokens.color.gray_100, - contrast_950: tokens.color.gray_50, - contrast_975: tokens.color.gray_25, + contrast_25: tokens.color.gray_1000, + contrast_50: tokens.color.gray_975, + contrast_100: tokens.color.gray_950, + contrast_200: tokens.color.gray_900, + contrast_300: tokens.color.gray_800, + contrast_400: tokens.color.gray_700, + contrast_500: tokens.color.gray_600, + contrast_600: tokens.color.gray_500, + contrast_700: tokens.color.gray_400, + contrast_800: tokens.color.gray_300, + contrast_900: tokens.color.gray_200, + contrast_950: tokens.color.gray_100, + contrast_975: tokens.color.gray_50, primary_25: tokens.color.blue_25, primary_50: tokens.color.blue_50, @@ -133,6 +133,20 @@ export const darkPalette: Palette = { export const dimPalette: Palette = { ...darkPalette, black: tokens.color.gray_1000, + + contrast_25: tokens.color.gray_975, + contrast_50: tokens.color.gray_950, + contrast_100: tokens.color.gray_900, + contrast_200: tokens.color.gray_800, + contrast_300: tokens.color.gray_700, + contrast_400: tokens.color.gray_600, + contrast_500: tokens.color.gray_500, + contrast_600: tokens.color.gray_400, + contrast_700: tokens.color.gray_300, + contrast_800: tokens.color.gray_200, + contrast_900: tokens.color.gray_100, + contrast_950: tokens.color.gray_50, + contrast_975: tokens.color.gray_25, } as const export const light = { @@ -142,17 +156,14 @@ export const light = { text: { color: lightPalette.black, }, - text_contrast_700: { + text_contrast_low: { + color: lightPalette.contrast_400, + }, + text_contrast_medium: { color: lightPalette.contrast_700, }, - text_contrast_600: { - color: lightPalette.contrast_600, - }, - text_contrast_500: { - color: lightPalette.contrast_500, - }, - text_contrast_400: { - color: lightPalette.contrast_400, + text_contrast_high: { + color: lightPalette.contrast_900, }, text_inverted: { color: lightPalette.white, @@ -175,11 +186,38 @@ export const light = { bg_contrast_300: { backgroundColor: lightPalette.contrast_300, }, - border: { + bg_contrast_400: { + backgroundColor: lightPalette.contrast_400, + }, + bg_contrast_500: { + backgroundColor: lightPalette.contrast_500, + }, + bg_contrast_600: { + backgroundColor: lightPalette.contrast_600, + }, + bg_contrast_700: { + backgroundColor: lightPalette.contrast_700, + }, + bg_contrast_800: { + backgroundColor: lightPalette.contrast_800, + }, + bg_contrast_900: { + backgroundColor: lightPalette.contrast_900, + }, + bg_contrast_950: { + backgroundColor: lightPalette.contrast_950, + }, + bg_contrast_975: { + backgroundColor: lightPalette.contrast_975, + }, + border_contrast_low: { borderColor: lightPalette.contrast_100, }, - border_contrast: { - borderColor: lightPalette.contrast_400, + border_contrast_medium: { + borderColor: lightPalette.contrast_200, + }, + border_contrast_high: { + borderColor: lightPalette.contrast_300, }, shadow_sm: { ...atoms.shadow_sm, @@ -203,17 +241,14 @@ export const dark: Theme = { text: { color: darkPalette.white, }, - text_contrast_700: { + text_contrast_low: { + color: darkPalette.contrast_400, + }, + text_contrast_medium: { color: darkPalette.contrast_700, }, - text_contrast_600: { - color: darkPalette.contrast_600, - }, - text_contrast_500: { - color: darkPalette.contrast_500, - }, - text_contrast_400: { - color: darkPalette.contrast_400, + text_contrast_high: { + color: darkPalette.contrast_900, }, text_inverted: { color: darkPalette.black, @@ -222,24 +257,51 @@ export const dark: Theme = { backgroundColor: darkPalette.black, }, bg_contrast_25: { - backgroundColor: darkPalette.contrast_50, + backgroundColor: darkPalette.contrast_25, }, bg_contrast_50: { - backgroundColor: darkPalette.contrast_100, + backgroundColor: darkPalette.contrast_50, }, bg_contrast_100: { - backgroundColor: darkPalette.contrast_200, + backgroundColor: darkPalette.contrast_100, }, bg_contrast_200: { - backgroundColor: darkPalette.contrast_300, + backgroundColor: darkPalette.contrast_200, }, bg_contrast_300: { + backgroundColor: darkPalette.contrast_300, + }, + bg_contrast_400: { backgroundColor: darkPalette.contrast_400, }, - border: { + bg_contrast_500: { + backgroundColor: darkPalette.contrast_500, + }, + bg_contrast_600: { + backgroundColor: darkPalette.contrast_600, + }, + bg_contrast_700: { + backgroundColor: darkPalette.contrast_700, + }, + bg_contrast_800: { + backgroundColor: darkPalette.contrast_800, + }, + bg_contrast_900: { + backgroundColor: darkPalette.contrast_900, + }, + bg_contrast_950: { + backgroundColor: darkPalette.contrast_950, + }, + bg_contrast_975: { + backgroundColor: darkPalette.contrast_975, + }, + border_contrast_low: { borderColor: darkPalette.contrast_100, }, - border_contrast: { + border_contrast_medium: { + borderColor: darkPalette.contrast_200, + }, + border_contrast_high: { borderColor: darkPalette.contrast_300, }, shadow_sm: { @@ -265,11 +327,71 @@ export const dim: Theme = { name: 'dim', atoms: { ...dark.atoms, + text: { + color: dimPalette.white, + }, + text_contrast_low: { + color: dimPalette.contrast_400, + }, + text_contrast_medium: { + color: dimPalette.contrast_700, + }, + text_contrast_high: { + color: dimPalette.contrast_900, + }, text_inverted: { color: dimPalette.black, }, bg: { backgroundColor: dimPalette.black, }, + bg_contrast_25: { + backgroundColor: dimPalette.contrast_25, + }, + bg_contrast_50: { + backgroundColor: dimPalette.contrast_50, + }, + bg_contrast_100: { + backgroundColor: dimPalette.contrast_100, + }, + bg_contrast_200: { + backgroundColor: dimPalette.contrast_200, + }, + bg_contrast_300: { + backgroundColor: dimPalette.contrast_300, + }, + bg_contrast_400: { + backgroundColor: dimPalette.contrast_400, + }, + bg_contrast_500: { + backgroundColor: dimPalette.contrast_500, + }, + bg_contrast_600: { + backgroundColor: dimPalette.contrast_600, + }, + bg_contrast_700: { + backgroundColor: dimPalette.contrast_700, + }, + bg_contrast_800: { + backgroundColor: dimPalette.contrast_800, + }, + bg_contrast_900: { + backgroundColor: dimPalette.contrast_900, + }, + bg_contrast_950: { + backgroundColor: dimPalette.contrast_950, + }, + bg_contrast_975: { + backgroundColor: dimPalette.contrast_975, + }, + border_contrast_low: { + borderColor: dimPalette.contrast_100, + }, + border_contrast_medium: { + borderColor: dimPalette.contrast_200, + }, + border_contrast_high: { + borderColor: dimPalette.contrast_300, + }, }, } diff --git a/src/alf/tokens.ts b/src/alf/tokens.ts index f3ae80275e..f0b8c7c692 100644 --- a/src/alf/tokens.ts +++ b/src/alf/tokens.ts @@ -13,13 +13,13 @@ export const color = { gray_300: `hsl(${BLUE_HUE}, 20%, 70%)`, gray_400: `hsl(${BLUE_HUE}, 20%, 60%)`, gray_500: `hsl(${BLUE_HUE}, 20%, 50%)`, - gray_600: `hsl(${BLUE_HUE}, 20%, 42%)`, - gray_700: `hsl(${BLUE_HUE}, 20%, 34%)`, - gray_800: `hsl(${BLUE_HUE}, 20%, 26%)`, - gray_900: `hsl(${BLUE_HUE}, 20%, 18%)`, - gray_950: `hsl(${BLUE_HUE}, 20%, 10%)`, - gray_975: `hsl(${BLUE_HUE}, 20%, 7%)`, - gray_1000: `hsl(${BLUE_HUE}, 20%, 4%)`, + gray_600: `hsl(${BLUE_HUE}, 24%, 42%)`, + gray_700: `hsl(${BLUE_HUE}, 24%, 34%)`, + gray_800: `hsl(${BLUE_HUE}, 28%, 26%)`, + gray_900: `hsl(${BLUE_HUE}, 28%, 18%)`, + gray_950: `hsl(${BLUE_HUE}, 28%, 10%)`, + gray_975: `hsl(${BLUE_HUE}, 28%, 7%)`, + gray_1000: `hsl(${BLUE_HUE}, 28%, 4%)`, blue_25: `hsl(${BLUE_HUE}, 99%, 97%)`, blue_50: `hsl(${BLUE_HUE}, 99%, 95%)`, diff --git a/src/components/Divider.tsx b/src/components/Divider.tsx index 9b8f79fd09..24e2789e50 100644 --- a/src/components/Divider.tsx +++ b/src/components/Divider.tsx @@ -1,10 +1,18 @@ import React from 'react' import {View} from 'react-native' -import {atoms as a, useTheme} from '#/alf' -import {ViewStyleProp} from '#/alf' +import {atoms as a, useTheme, ViewStyleProp, flatten} from '#/alf' export function Divider({style}: ViewStyleProp) { const t = useTheme() - return + return ( + + ) } diff --git a/src/components/Prompt.tsx b/src/components/Prompt.tsx index 7115f61901..2c79d27cf1 100644 --- a/src/components/Prompt.tsx +++ b/src/components/Prompt.tsx @@ -4,7 +4,7 @@ import {msg} from '@lingui/macro' import {useLingui} from '@lingui/react' import {useTheme, atoms as a} from '#/alf' -import {H4, P} from '#/components/Typography' +import {Text} from '#/components/Typography' import {Button} from '#/components/Button' import * as Dialog from '#/components/Dialog' @@ -50,14 +50,11 @@ export function Outer({ } export function Title({children}: React.PropsWithChildren<{}>) { - const t = useTheme() const {titleId} = React.useContext(Context) return ( -

+ {children} -

+ ) } @@ -65,9 +62,11 @@ export function Description({children}: React.PropsWithChildren<{}>) { const t = useTheme() const {descriptionId} = React.useContext(Context) return ( -

+ {children} -

+ ) } diff --git a/src/components/Typography.tsx b/src/components/Typography.tsx index 64aa6d1a4f..8136b5ef31 100644 --- a/src/components/Typography.tsx +++ b/src/components/Typography.tsx @@ -41,138 +41,42 @@ function normalizeTextStyles(styles: TextStyle[]) { return s } +/** + * Our main text component. Use this most of the time. + */ export function Text({style, ...rest}: TextProps) { const t = useTheme() const s = normalizeTextStyles([atoms.text_sm, t.atoms.text, flatten(style)]) return } -export function H1({style, ...rest}: TextProps) { - const t = useTheme() - const attr = - web({ - role: 'heading', - 'aria-level': 1, - }) || {} - return ( - - ) -} - -export function H2({style, ...rest}: TextProps) { - const t = useTheme() - const attr = - web({ - role: 'heading', - 'aria-level': 2, - }) || {} - return ( - - ) -} - -export function H3({style, ...rest}: TextProps) { - const t = useTheme() - const attr = - web({ - role: 'heading', - 'aria-level': 3, - }) || {} - return ( - - ) -} - -export function H4({style, ...rest}: TextProps) { - const t = useTheme() - const attr = - web({ - role: 'heading', - 'aria-level': 4, - }) || {} - return ( - - ) -} - -export function H5({style, ...rest}: TextProps) { - const t = useTheme() - const attr = - web({ - role: 'heading', - 'aria-level': 5, - }) || {} - return ( - - ) -} - -export function H6({style, ...rest}: TextProps) { - const t = useTheme() - const attr = - web({ - role: 'heading', - 'aria-level': 6, - }) || {} - return ( - - ) +export function createHeadingElement({level}: {level: number}) { + return function HeadingElement({style, ...rest}: TextProps) { + const t = useTheme() + const attr = + web({ + role: 'heading', + 'aria-level': level, + }) || {} + return ( + + ) + } } +/* + * Use semantic components when it's beneficial to the user or to a web scraper + */ +export const H1 = createHeadingElement({level: 1}) +export const H2 = createHeadingElement({level: 2}) +export const H3 = createHeadingElement({level: 3}) +export const H4 = createHeadingElement({level: 4}) +export const H5 = createHeadingElement({level: 5}) +export const H6 = createHeadingElement({level: 6}) export function P({style, ...rest}: TextProps) { const t = useTheme() const attr = diff --git a/src/components/forms/TextField.tsx b/src/components/forms/TextField.tsx index 67515049c9..70f900bb9b 100644 --- a/src/components/forms/TextField.tsx +++ b/src/components/forms/TextField.tsx @@ -241,7 +241,8 @@ export const Input = createInput(TextInput) export function Label({children}: React.PropsWithChildren<{}>) { const t = useTheme() return ( - + {children} ) @@ -315,7 +316,7 @@ export function Suffix({ a.z_20, a.pr_sm, a.text_md, - t.atoms.text_contrast_400, + t.atoms.text_contrast_medium, { pointerEvents: 'none', }, diff --git a/src/components/forms/Toggle.tsx b/src/components/forms/Toggle.tsx index d3c0342467..9369423f20 100644 --- a/src/components/forms/Toggle.tsx +++ b/src/components/forms/Toggle.tsx @@ -347,7 +347,7 @@ export function Checkbox() { a.align_center, a.border, a.rounded_xs, - t.atoms.border_contrast, + t.atoms.border_contrast_high, { height: 20, width: 20, @@ -393,7 +393,7 @@ export function Switch() { a.border, a.rounded_full, t.atoms.bg, - t.atoms.border_contrast, + t.atoms.border_contrast_high, { height: 20, width: 30, @@ -445,7 +445,7 @@ export function Radio() { a.align_center, a.border, a.rounded_full, - t.atoms.border_contrast, + t.atoms.border_contrast_high, { height: 20, width: 20, diff --git a/src/components/forms/ToggleButton.tsx b/src/components/forms/ToggleButton.tsx index 5cd51d794a..90790f9fc8 100644 --- a/src/components/forms/ToggleButton.tsx +++ b/src/components/forms/ToggleButton.tsx @@ -25,7 +25,7 @@ export function Group({children, multiple, ...props}: GroupProps) { a.border, a.rounded_sm, a.overflow_hidden, - t.atoms.border, + t.atoms.border_contrast_low, ]}> {children}
@@ -103,7 +103,7 @@ function ButtonInner({children}: React.PropsWithChildren<{}>) { }), a.px_sm, t.atoms.bg, - t.atoms.border, + t.atoms.border_contrast_low, baseStyles, activeStyles, (state.hovered || state.focused || state.pressed) && hoverStyles, @@ -113,7 +113,7 @@ function ButtonInner({children}: React.PropsWithChildren<{}>) { style={[ a.text_center, a.font_bold, - t.atoms.text_contrast_500, + t.atoms.text_contrast_medium, textStyles, ]}> {children} diff --git a/src/screens/Deactivated.tsx b/src/screens/Deactivated.tsx index 4a2ebf5899..f4c2014750 100644 --- a/src/screens/Deactivated.tsx +++ b/src/screens/Deactivated.tsx @@ -10,9 +10,8 @@ import {pluralize} from '#/lib/strings/helpers' import {atoms as a, useTheme, useBreakpoints} from '#/alf' import {Button, ButtonIcon, ButtonText} from '#/components/Button' -import {Text} from '#/components/Typography' +import {Text, P} from '#/components/Typography' import {isWeb} from '#/platform/detection' -import {H2, P} from '#/components/Typography' import {ScrollView} from '#/view/com/util/Views' import {Loader} from '#/components/Loader' import {Logo} from '#/view/icons/Logo' @@ -100,10 +99,10 @@ export function Deactivated() {
-

+ You're in line -

-

+ +

There's been a rush of new users to Bluesky! We'll activate your account as soon as we can. diff --git a/src/screens/Onboarding/Layout.tsx b/src/screens/Onboarding/Layout.tsx index b9683999f7..d887c08209 100644 --- a/src/screens/Onboarding/Layout.tsx +++ b/src/screens/Onboarding/Layout.tsx @@ -165,7 +165,7 @@ export function Layout({children}: React.PropsWithChildren<{}>) { isWeb ? a.fixed : a.absolute, {bottom: 0, left: 0, right: 0}, t.atoms.bg, - t.atoms.border, + t.atoms.border_contrast_low, a.border_t, a.align_center, gtMobile ? a.px_5xl : a.px_xl, @@ -227,5 +227,7 @@ export function Description({ style, }: React.PropsWithChildren) { const t = useTheme() - return

{children}

+ return ( +

{children}

+ ) } diff --git a/src/screens/Onboarding/StepAlgoFeeds/FeedCard.tsx b/src/screens/Onboarding/StepAlgoFeeds/FeedCard.tsx index c7f1e6e4d4..dec53d2edb 100644 --- a/src/screens/Onboarding/StepAlgoFeeds/FeedCard.tsx +++ b/src/screens/Onboarding/StepAlgoFeeds/FeedCard.tsx @@ -8,7 +8,7 @@ import {msg} from '@lingui/macro' import {useTheme, atoms as a} from '#/alf' import * as Toggle from '#/components/forms/Toggle' import {useFeedSourceInfoQuery, FeedSourceInfo} from '#/state/queries/feed' -import {Text, H3} from '#/components/Typography' +import {Text} from '#/components/Typography' import {RichText} from '#/components/RichText' import {Check_Stroke2_Corner0_Rounded as Check} from '#/components/icons/Check' @@ -94,14 +94,14 @@ function PrimaryFeedCardInner({ -

{feed.displayName} -

+ -

{feed.displayName} -

+
diff --git a/src/screens/Onboarding/StepAlgoFeeds/index.tsx b/src/screens/Onboarding/StepAlgoFeeds/index.tsx index 7a87318e82..33e519207b 100644 --- a/src/screens/Onboarding/StepAlgoFeeds/index.tsx +++ b/src/screens/Onboarding/StepAlgoFeeds/index.tsx @@ -115,12 +115,22 @@ export function StepAlgoFeeds() { onChange={setPrimaryFeedUris} label={_(msg`Select your primary algorithmic feeds`)}> + style={[ + a.text_md, + a.pt_4xl, + a.pb_md, + t.atoms.text_contrast_medium, + ]}> We recommend our "Discover" feed: + style={[ + a.text_md, + a.pt_4xl, + a.pb_lg, + t.atoms.text_contrast_medium, + ]}> We also think you'll like "For You" by Skygaze: @@ -131,7 +141,12 @@ export function StepAlgoFeeds() { onChange={setSeconaryFeedUris} label={_(msg`Select your secondary algorithmic feeds`)}> + style={[ + a.text_md, + a.pt_4xl, + a.pb_lg, + t.atoms.text_contrast_medium, + ]}> There are many feeds to try: diff --git a/src/screens/Onboarding/StepFinished.tsx b/src/screens/Onboarding/StepFinished.tsx index af73c6fc12..72d53658b7 100644 --- a/src/screens/Onboarding/StepFinished.tsx +++ b/src/screens/Onboarding/StepFinished.tsx @@ -101,7 +101,7 @@ export function StepFinished() { Public + style={[t.atoms.text_contrast_medium, a.text_md, a.leading_snug]}> Your posts, likes, and blocks are public. Mutes are private. @@ -115,7 +115,7 @@ export function StepFinished() { Open + style={[t.atoms.text_contrast_medium, a.text_md, a.leading_snug]}> Never lose access to your followers or data.
@@ -131,7 +131,7 @@ export function StepFinished() { Flexible + style={[t.atoms.text_contrast_medium, a.text_md, a.leading_snug]}> Choose the algorithms that power your custom feeds. diff --git a/src/screens/Onboarding/StepModeration/AdultContentEnabledPref.tsx b/src/screens/Onboarding/StepModeration/AdultContentEnabledPref.tsx index 6b456de80e..b38b3df1ed 100644 --- a/src/screens/Onboarding/StepModeration/AdultContentEnabledPref.tsx +++ b/src/screens/Onboarding/StepModeration/AdultContentEnabledPref.tsx @@ -96,7 +96,7 @@ export function AdultContentEnabledPref({ diff --git a/src/screens/Onboarding/StepModeration/ModerationOption.tsx b/src/screens/Onboarding/StepModeration/ModerationOption.tsx index d216692d07..c61b520bab 100644 --- a/src/screens/Onboarding/StepModeration/ModerationOption.tsx +++ b/src/screens/Onboarding/StepModeration/ModerationOption.tsx @@ -57,7 +57,7 @@ export function ModerationOption({ entering={isMounted.current ? FadeIn : undefined}> {groupInfo.title} - + {groupInfo.subtitle} diff --git a/src/screens/Onboarding/StepSuggestedAccounts/SuggestedAccountCard.tsx b/src/screens/Onboarding/StepSuggestedAccounts/SuggestedAccountCard.tsx index bc707ce8fb..0670058920 100644 --- a/src/screens/Onboarding/StepSuggestedAccounts/SuggestedAccountCard.tsx +++ b/src/screens/Onboarding/StepSuggestedAccounts/SuggestedAccountCard.tsx @@ -95,7 +95,7 @@ export function SuggestedAccountCard({ {profile.displayName} - {profile.handle} + {profile.handle} @@ -124,7 +124,7 @@ export function SuggestedAccountCard({ borderTopWidth: 1, }, a.w_full, - t.name === 'light' ? t.atoms.border : t.atoms.border_contrast, + t.atoms.border_contrast_low, ctx.selected && { borderTopColor: t.palette.primary_200, }, diff --git a/src/view/screens/Storybook/Theming.tsx b/src/view/screens/Storybook/Theming.tsx index a054434734..5b6763370d 100644 --- a/src/view/screens/Storybook/Theming.tsx +++ b/src/view/screens/Storybook/Theming.tsx @@ -14,22 +14,22 @@ export function Theming() { theme.atoms.text - - - theme.atoms.text_contrast_600 + + + theme.atoms.text_contrast_high - - - theme.atoms.text_contrast_500 + + + theme.atoms.text_contrast_medium - - - theme.atoms.text_contrast_400 + + + theme.atoms.text_contrast_low - + diff --git a/src/view/screens/Storybook/Typography.tsx b/src/view/screens/Storybook/Typography.tsx index ecd6ec888d..1aa334ac28 100644 --- a/src/view/screens/Storybook/Typography.tsx +++ b/src/view/screens/Storybook/Typography.tsx @@ -2,20 +2,12 @@ import React from 'react' import {View} from 'react-native' import {atoms as a} from '#/alf' -import {Text, H1, H2, H3, H4, H5, H6, P} from '#/components/Typography' +import {Text} from '#/components/Typography' import {RichText} from '#/components/RichText' export function Typography() { return ( -

H1 Heading

-

H2 Heading

-

H3 Heading

-

H4 Heading

-
H5 Heading
-
H6 Heading
-

P Paragraph

- atoms.text_5xl atoms.text_4xl atoms.text_3xl