From fc6ad28b242cb7f4e4a674b5fdccd1075543d602 Mon Sep 17 00:00:00 2001 From: lynx <141365347+iLynxcat@users.noreply.github.com> Date: Fri, 27 Sep 2024 19:58:08 -0700 Subject: [PATCH] add new brand font font to some screens in the app IBM Plex Sans --- .../src/screens/settings/info/About.tsx | 4 ++-- .../Layout/Sidebar/DebugPopover.tsx | 2 +- .../Sidebar/JobManager/JobContainer.tsx | 4 +++- .../Layout/Sidebar/JobManager/index.tsx | 6 +++-- .../Sidebar/SidebarLayout/FeedbackPopover.tsx | 4 +++- .../Layout/Sidebar/SidebarLayout/Link.tsx | 2 +- .../app/$libraryId/overview/FileKindStats.tsx | 8 +++---- .../$libraryId/overview/Layout/Section.tsx | 2 +- .../app/$libraryId/overview/LibraryStats.tsx | 2 +- .../app/$libraryId/overview/StatCard.tsx | 22 ++++++++---------- .../app/$libraryId/overview/StorageBar.tsx | 2 +- interface/app/$libraryId/settings/Layout.tsx | 2 +- interface/app/$libraryId/settings/Setting.tsx | 2 +- interface/app/$libraryId/settings/Sidebar.tsx | 2 +- .../app/$libraryId/settings/client/usage.tsx | 2 +- .../$libraryId/settings/resources/about.tsx | 6 +++-- .../settings/resources/changelog.tsx | 5 +++- interface/app/onboarding/alpha.tsx | 2 +- packages/assets/util/index.ts | 2 ++ packages/ui/package.json | 1 + packages/ui/src/Button.tsx | 2 +- packages/ui/src/Input.tsx | 2 +- packages/ui/src/forms/FormField.tsx | 2 +- packages/ui/style/index.js | 7 ++++++ packages/ui/style/tailwind.js | 4 ++++ pnpm-lock.yaml | Bin 1050063 -> 1051000 bytes 26 files changed, 61 insertions(+), 38 deletions(-) diff --git a/apps/mobile/src/screens/settings/info/About.tsx b/apps/mobile/src/screens/settings/info/About.tsx index 80e0100e2..d37c78f47 100644 --- a/apps/mobile/src/screens/settings/info/About.tsx +++ b/apps/mobile/src/screens/settings/info/About.tsx @@ -77,7 +77,7 @@ const AboutScreen = () => { - Vision + Vision Many of us have multiple cloud accounts, drives that aren’t backed up and data at risk of loss. We depend on cloud services like Google Photos and iCloud, but @@ -91,7 +91,7 @@ const AboutScreen = () => { - + Meet the contributors behind Spacedrive {/* TODO: Temporary image url approach until a solution is reached */} diff --git a/interface/app/$libraryId/Layout/Sidebar/DebugPopover.tsx b/interface/app/$libraryId/Layout/Sidebar/DebugPopover.tsx index 7af5e0ac7..a84cb489b 100644 --- a/interface/app/$libraryId/Layout/Sidebar/DebugPopover.tsx +++ b/interface/app/$libraryId/Layout/Sidebar/DebugPopover.tsx @@ -56,7 +56,7 @@ export default () => { popover={{ ...popover, setOpen: handleOpenChange }} className="z-[100] p-4 focus:outline-none" trigger={ -

+

v{buildInfo.data?.version || '-.-.-'} - {buildInfo.data?.commit || 'dev'}

} diff --git a/interface/app/$libraryId/Layout/Sidebar/JobManager/JobContainer.tsx b/interface/app/$libraryId/Layout/Sidebar/JobManager/JobContainer.tsx index 358482170..b151c6bcd 100644 --- a/interface/app/$libraryId/Layout/Sidebar/JobManager/JobContainer.tsx +++ b/interface/app/$libraryId/Layout/Sidebar/JobManager/JobContainer.tsx @@ -106,7 +106,9 @@ const JobContainer = forwardRef((props, ref) = position="top" label={name} > -

{name}

+

+ {name} +

{textItems?.map((item, index) => { const filteredItems = item.filter((i) => i?.text); diff --git a/interface/app/$libraryId/Layout/Sidebar/JobManager/index.tsx b/interface/app/$libraryId/Layout/Sidebar/JobManager/index.tsx index 837dd0228..84f3deb39 100644 --- a/interface/app/$libraryId/Layout/Sidebar/JobManager/index.tsx +++ b/interface/app/$libraryId/Layout/Sidebar/JobManager/index.tsx @@ -121,7 +121,9 @@ export function JobManager() { )} - {t('recent_jobs')} + + {t('recent_jobs')} +
{toggleConfirmation ? (
@@ -165,7 +167,7 @@ export function JobManager() {
{jobGroups.data && (jobGroups.data.length === 0 ? ( -
+
{t('no_jobs')}
) : ( diff --git a/interface/app/$libraryId/Layout/Sidebar/SidebarLayout/FeedbackPopover.tsx b/interface/app/$libraryId/Layout/Sidebar/SidebarLayout/FeedbackPopover.tsx index 7efa13eef..04da335ce 100644 --- a/interface/app/$libraryId/Layout/Sidebar/SidebarLayout/FeedbackPopover.tsx +++ b/interface/app/$libraryId/Layout/Sidebar/SidebarLayout/FeedbackPopover.tsx @@ -53,7 +53,9 @@ export function FeedbackPopover() { popover={{ ...popover, setOpen: handleOpenChange }} trigger={ } className="z-[100]" diff --git a/interface/app/$libraryId/Layout/Sidebar/SidebarLayout/Link.tsx b/interface/app/$libraryId/Layout/Sidebar/SidebarLayout/Link.tsx index b70a765b2..198d27a3f 100644 --- a/interface/app/$libraryId/Layout/Sidebar/SidebarLayout/Link.tsx +++ b/interface/app/$libraryId/Layout/Sidebar/SidebarLayout/Link.tsx @@ -7,7 +7,7 @@ import { usePlatform } from '~/util/Platform'; const styles = cva( [ - 'max-w flex grow flex-row items-center gap-0.5 truncate rounded px-2 py-1 text-sm font-medium outline-none', + 'max-w flex grow flex-row items-center gap-0.5 truncate rounded px-2 py-1 text-sm font-medium outline-none font-plex tracking-wide', 'ring-inset ring-transparent ring-offset-0 focus:ring-1 focus:ring-accent focus:ring-offset-0' ], { diff --git a/interface/app/$libraryId/overview/FileKindStats.tsx b/interface/app/$libraryId/overview/FileKindStats.tsx index 6f7b7a1e8..eaca7fed3 100644 --- a/interface/app/$libraryId/overview/FileKindStats.tsx +++ b/interface/app/$libraryId/overview/FileKindStats.tsx @@ -18,10 +18,10 @@ import { FileKind } from '.'; const INFO_ICON_CLASSLIST = 'inline size-3 text-ink-faint opacity-0 ml-1 transition-opacity duration-300 group-hover:opacity-70'; const TOTAL_FILES_CLASSLIST = - 'flex items-center justify-between whitespace-nowrap text-sm font-medium text-ink-dull mt-2 px-1'; -const UNIDENTIFIED_FILES_CLASSLIST = 'relative flex items-center text-xs text-ink-faint'; + 'flex items-center justify-between whitespace-nowrap text-sm font-medium text-ink-dull mt-2 px-1 font-plex'; +const UNIDENTIFIED_FILES_CLASSLIST = 'relative flex items-center text-xs font-plex text-ink-faint'; const BARS_CONTAINER_CLASSLIST = - 'relative mx-2.5 grid grow grid-cols-[repeat(auto-fit,_minmax(0,_1fr))] grid-rows-[136px_12px] items-end justify-items-center gap-x-1.5 gap-y-1 self-stretch'; + 'relative mx-2.5 grid grow grid-cols-[repeat(auto-fit,_minmax(0,_1fr))] grid-rows-[136px_12px] font-plex tracking-wide items-end justify-items-center gap-x-1.5 gap-y-1 self-stretch'; const mapFractionalValue = (numerator: bigint, denominator: bigint, maxValue: bigint): string => { if (denominator === 0n) return '0'; @@ -206,7 +206,7 @@ const FileKindStats: React.FC = () => { }; return ( -
+
{title && (
-
{title}
+
{title}
{typeof count === 'number' &&
{count}
}
diff --git a/interface/app/$libraryId/overview/LibraryStats.tsx b/interface/app/$libraryId/overview/LibraryStats.tsx index 02cfbec8b..780f2fe88 100644 --- a/interface/app/$libraryId/overview/LibraryStats.tsx +++ b/interface/app/$libraryId/overview/LibraryStats.tsx @@ -65,7 +65,7 @@ const StatItem = ({ title, bytes, isLoading, info }: StatItemProps) => { return (
diff --git a/interface/app/$libraryId/overview/StatCard.tsx b/interface/app/$libraryId/overview/StatCard.tsx index 2ed804238..5a424ab50 100644 --- a/interface/app/$libraryId/overview/StatCard.tsx +++ b/interface/app/$libraryId/overview/StatCard.tsx @@ -1,3 +1,4 @@ +import { IconName } from '@sd/assets/util'; import { useEffect, useMemo, useState } from 'react'; import { humanizeSize } from '@sd/client'; import { Card, CircularProgress, tw } from '@sd/ui'; @@ -6,14 +7,16 @@ import { useIsDark, useLocale } from '~/hooks'; type StatCardProps = { name: string; - icon: string; + icon: IconName; totalSpace: string | number[]; freeSpace?: string | number[]; color: string; connectionType: 'lan' | 'p2p' | 'cloud' | null; }; -const Pill = tw.div`px-1.5 py-[1px] rounded text-tiny font-medium text-ink-dull bg-app-box border border-app-line`; +const NBSP = '\xa0'; + +const Pill = tw.div`px-1.5 py-[1px] rounded text-tiny font-medium text-ink-dull bg-app-box border border-app-line font-plex font-medium tracking-wide`; const StatCard = ({ icon, name, connectionType, ...stats }: StatCardProps) => { const [mounted, setMounted] = useState(false); @@ -48,7 +51,7 @@ const StatCard = ({ icon, name, connectionType, ...stats }: StatCardProps) => { return ( -
+
{stats.freeSpace && ( { )}
- - {name} - + + {name} + {freeSpace.value !== totalSpace.value && ( <> {freeSpace.value} {t(`size_${freeSpace.unit.toLowerCase()}`)}{' '} @@ -99,8 +98,7 @@ const StatCard = ({ icon, name, connectionType, ...stats }: StatCardProps) => {
{freeSpace.value === totalSpace.value && ( - {totalSpace.value} - {t(`size_${totalSpace.unit.toLowerCase()}`)} + {totalSpace.value} {t(`size_${totalSpace.unit.toLowerCase()}`)} )} {connectionType || t('local')} diff --git a/interface/app/$libraryId/overview/StorageBar.tsx b/interface/app/$libraryId/overview/StorageBar.tsx index 62e174612..d0684f899 100644 --- a/interface/app/$libraryId/overview/StorageBar.tsx +++ b/interface/app/$libraryId/overview/StorageBar.tsx @@ -30,7 +30,7 @@ const StorageBar: React.FC = ({ sections }) => { }; return ( -
+
{sections.map((section, index) => { const isHovered = hoveredSectionIndex === index; diff --git a/interface/app/$libraryId/settings/Layout.tsx b/interface/app/$libraryId/settings/Layout.tsx index d2efdeb9e..8e0d8a8ef 100644 --- a/interface/app/$libraryId/settings/Layout.tsx +++ b/interface/app/$libraryId/settings/Layout.tsx @@ -46,7 +46,7 @@ export const Heading = (props: HeaderProps) => {
{props.children}
-

{props.title}

+

{props.title}

{props.description}

{props.rightArea} diff --git a/interface/app/$libraryId/settings/Setting.tsx b/interface/app/$libraryId/settings/Setting.tsx index 9bdf57c70..d13d70254 100644 --- a/interface/app/$libraryId/settings/Setting.tsx +++ b/interface/app/$libraryId/settings/Setting.tsx @@ -26,7 +26,7 @@ export default ({ mini, registerName, ...props }: PropsWithChildren) => {
-

{props.title}

+

{props.title}

{props.toolTipLabel && ( { diff --git a/interface/app/$libraryId/settings/client/usage.tsx b/interface/app/$libraryId/settings/client/usage.tsx index b59790b4f..9e39fef8d 100644 --- a/interface/app/$libraryId/settings/client/usage.tsx +++ b/interface/app/$libraryId/settings/client/usage.tsx @@ -128,7 +128,7 @@ const UsageCard = memo(
-

+

{typeof titleCount === 'number' && ( {sizeCount} )} diff --git a/interface/app/$libraryId/settings/resources/about.tsx b/interface/app/$libraryId/settings/resources/about.tsx index 0a68a1e62..6b1c2bd91 100644 --- a/interface/app/$libraryId/settings/resources/about.tsx +++ b/interface/app/$libraryId/settings/resources/about.tsx @@ -71,12 +71,14 @@ export const Component = () => {

-

{t('about_vision_title')}

+

+ {t('about_vision_title')} +

{t('about_vision_text')}

-

+

{t('meet_contributors_behind_spacedrive')}

{ {changelog.data?.map((release: any) => (
Spacedrive -

Spacedrive

+

Spacedrive

{t('alpha_release_title')}

diff --git a/packages/assets/util/index.ts b/packages/assets/util/index.ts index 492d61049..399d80a56 100644 --- a/packages/assets/util/index.ts +++ b/packages/assets/util/index.ts @@ -12,6 +12,8 @@ export const iconNames = Object.fromEntries( .map((key) => [key, key]) // Map key to [key, key] format ) as Record; +export type IconName = keyof typeof iconNames; + export const getIconByName = (name: IconTypes, isDark?: boolean) => { if (!isDark) name = (name + '_Light') as IconTypes; return icons[name]; diff --git a/packages/ui/package.json b/packages/ui/package.json index c858d4107..d0ebb1386 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -19,6 +19,7 @@ "typecheck": "tsc -b" }, "dependencies": { + "@fontsource/ibm-plex-sans": "^5.1.0", "@headlessui/react": "^1.7.17", "@phosphor-icons/react": "^2.0.13", "@radix-ui/react-checkbox": "^1.0.4", diff --git a/packages/ui/src/Button.tsx b/packages/ui/src/Button.tsx index 7f83f3b66..c9815e562 100644 --- a/packages/ui/src/Button.tsx +++ b/packages/ui/src/Button.tsx @@ -26,7 +26,7 @@ const hasHref = (props: ButtonProps | LinkButtonProps): props is LinkButtonProps export const buttonStyles = cva( [ - 'cursor-default items-center rounded-md border outline-none transition-colors duration-100', + 'cursor-default items-center rounded-md border outline-none transition-colors duration-100 font-plex font-semibold tracking-wide', 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-70', 'focus:ring-none focus:ring-offset-none cursor-pointer ring-offset-app-box' ], diff --git a/packages/ui/src/Input.tsx b/packages/ui/src/Input.tsx index a2b69ee6d..b9dac28fe 100644 --- a/packages/ui/src/Input.tsx +++ b/packages/ui/src/Input.tsx @@ -145,7 +145,7 @@ export interface LabelProps extends Omit, 'htmlFor export function Label({ slug, children, className, ...props }: LabelProps) { return ( -

{props.label && ( -