From 33c2ca637025a58a8a5bbdf510185a1e9615cbd4 Mon Sep 17 00:00:00 2001 From: Mike Decker Date: Mon, 15 Jul 2024 14:15:44 -0700 Subject: [PATCH] Replace text-m# with type-# --- .eslintrc.json | 6 +++++- src/components/algolia/algolia-search.tsx | 2 +- src/components/algolia/hits/default.tsx | 2 +- src/components/config-pages/local-footer.tsx | 8 +++----- src/components/config-pages/super-footer.tsx | 2 +- src/components/elements/headers.tsx | 8 ++++---- src/components/elements/lockup/lockup-a.tsx | 2 +- src/components/elements/lockup/lockup-b.tsx | 4 ++-- src/components/elements/lockup/lockup-d.tsx | 4 ++-- src/components/elements/lockup/lockup-e.tsx | 6 +++--- src/components/elements/lockup/lockup-h.tsx | 4 ++-- src/components/elements/lockup/lockup-i.tsx | 6 +++--- src/components/elements/lockup/lockup-m.tsx | 2 +- src/components/elements/lockup/lockup-o.tsx | 2 +- src/components/elements/lockup/lockup-p.tsx | 4 ++-- src/components/elements/lockup/lockup-s.tsx | 6 +++--- src/components/elements/lockup/lockup-t.tsx | 8 ++++---- src/components/elements/lockup/lockup.tsx | 2 +- src/components/elements/paged-list.tsx | 2 +- src/components/elements/select-list.tsx | 2 +- src/components/elements/wysiwyg.tsx | 8 ++++---- .../cards/stanford-course/stanford-course-card.tsx | 2 +- .../stanford-event-series-card.tsx | 2 +- .../cards/stanford-event/stanford-event-card.tsx | 8 ++++---- .../cards/stanford-news/stanford-news-card.tsx | 2 +- .../cards/stanford-page/stanford-page-card.tsx | 2 +- .../cards/stanford-person/stanford-person-card.tsx | 2 +- .../cards/stanford-policy/stanford-policy-card.tsx | 2 +- .../stanford-publication-card.tsx | 2 +- .../stanford-course/stanford-course-list-item.tsx | 2 +- .../stanford-event-series-list-item.tsx | 2 +- .../stanford-event/stanford-event-list-item.tsx | 8 ++++---- .../stanford-news/stanford-news-list-item.tsx | 2 +- .../stanford-page/stanford-page-list-item.tsx | 2 +- .../stanford-person/stanford-person-list-item.tsx | 2 +- .../stanford-policy/stanford-policy-list-item.tsx | 2 +- .../stanford-publication-list-item.tsx | 2 +- .../stanford-event-series-page.tsx | 2 +- .../pages/stanford-event/stanford-event-page.tsx | 10 +++++----- .../pages/stanford-person/stanford-person-page.tsx | 14 +++++++------- .../pages/stanford-policy/stanford-policy-page.tsx | 4 ++-- .../stanford-banner/banner-paragraph.tsx | 4 ++-- .../paragraphs/stanford-card/card-paragraph.tsx | 2 +- .../media-caption-paragraph.tsx | 2 +- .../page-title-banner-paragraph.tsx | 2 +- 45 files changed, 88 insertions(+), 86 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 9a846f8..2b1d85e 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -18,7 +18,11 @@ "error", { "vars": "all", "varsIgnorePattern": "^_", "args": "after-used", "argsIgnorePattern": "^_" } ], - "no-console": ["error", { "allow": ["warn", "error"] }] + "no-console": ["error", { "allow": ["warn", "error"] }], + "no-restricted-syntax": [ + "error", + "Literal[value=/text-m[\\d]/i]" + ] }, "plugins": ["prettier", "unused-imports"], "ignorePatterns": ["**/__generated__/**/*"] diff --git a/src/components/algolia/algolia-search.tsx b/src/components/algolia/algolia-search.tsx index 30c55c2..4939332 100644 --- a/src/components/algolia/algolia-search.tsx +++ b/src/components/algolia/algolia-search.tsx @@ -93,7 +93,7 @@ const SearchBox = (props?: UseSearchBoxProps) => { }) => { return (
-

+

{hit.title}

{hit.summary}

diff --git a/src/components/config-pages/local-footer.tsx b/src/components/config-pages/local-footer.tsx index cc82673..4075824 100644 --- a/src/components/config-pages/local-footer.tsx +++ b/src/components/config-pages/local-footer.tsx @@ -88,7 +88,7 @@ const LocalFooter = async ({...props}: Props) => {
- {localFooterConfig.suLocalFootPrimeH &&

{localFooterConfig.suLocalFootPrimeH}

} + {localFooterConfig.suLocalFootPrimeH &&

{localFooterConfig.suLocalFootPrimeH}

} {localFooterConfig.suLocalFootPrimary && (
    {localFooterConfig.suLocalFootPrimary.map((link, index) => { @@ -105,9 +105,7 @@ const LocalFooter = async ({...props}: Props) => {
- {localFooterConfig.suLocalFootSecondH && ( -

{localFooterConfig.suLocalFootSecondH}

- )} + {localFooterConfig.suLocalFootSecondH &&

{localFooterConfig.suLocalFootSecondH}

} {localFooterConfig.suLocalFootSecond && (
    @@ -211,7 +209,7 @@ const FooterLockup = ({useDefault = true, siteName, lockupOption, ...props}: Foo
    -
    {siteName || "University"}
    +
    {siteName || "University"}
    ) diff --git a/src/components/config-pages/super-footer.tsx b/src/components/config-pages/super-footer.tsx index c5bc1a4..3c65ec1 100644 --- a/src/components/config-pages/super-footer.tsx +++ b/src/components/config-pages/super-footer.tsx @@ -17,7 +17,7 @@ const SuperFooter = async ({...props}: Props) => {
    - {superFooterConfig.suSuperFootTitle &&

    {superFooterConfig.suSuperFootTitle}

    } + {superFooterConfig.suSuperFootTitle &&

    {superFooterConfig.suSuperFootTitle}

    }
    diff --git a/src/components/elements/headers.tsx b/src/components/elements/headers.tsx index 832d893..47d5fbb 100644 --- a/src/components/elements/headers.tsx +++ b/src/components/elements/headers.tsx @@ -7,7 +7,7 @@ const headingLinkClasses = "[&_a]:text-digital-red [&_a]:hocus:text-black [&_a]: export const H1 = ({children, className, ...props}: Props) => { return ( -

    +

    {children}

    ) @@ -15,7 +15,7 @@ export const H1 = ({children, className, ...props}: Props) => { export const H2 = ({children, className, ...props}: Props) => { return ( -

    +

    {children}

    ) @@ -23,7 +23,7 @@ export const H2 = ({children, className, ...props}: Props) => { export const H3 = ({children, className, ...props}: Props) => { return ( -

    +

    {children}

    ) @@ -31,7 +31,7 @@ export const H3 = ({children, className, ...props}: Props) => { export const H4 = ({children, className, ...props}: Props) => { return ( -

    +

    {children}

    ) diff --git a/src/components/elements/lockup/lockup-a.tsx b/src/components/elements/lockup/lockup-a.tsx index d4deb60..6e8796b 100644 --- a/src/components/elements/lockup/lockup-a.tsx +++ b/src/components/elements/lockup/lockup-a.tsx @@ -12,7 +12,7 @@ const LockupA = ({line1, line5, siteName, logoUrl}: FooterLockupProps) => {
    -
    {line1 || siteName}
    +
    {line1 || siteName}
    {line5 &&
    {line5}
    } diff --git a/src/components/elements/lockup/lockup-b.tsx b/src/components/elements/lockup/lockup-b.tsx index 45c7de2..c3763e7 100644 --- a/src/components/elements/lockup/lockup-b.tsx +++ b/src/components/elements/lockup/lockup-b.tsx @@ -13,8 +13,8 @@ const LockupB = ({line1, line2, siteName, logoUrl}: FooterLockupProps) => {
    -
    {line1 || siteName}
    -
    {line2}
    +
    {line1 || siteName}
    +
    {line2}
    diff --git a/src/components/elements/lockup/lockup-d.tsx b/src/components/elements/lockup/lockup-d.tsx index 243acde..2ffcefe 100644 --- a/src/components/elements/lockup/lockup-d.tsx +++ b/src/components/elements/lockup/lockup-d.tsx @@ -13,8 +13,8 @@ const LockupD = ({line1, line3, siteName, logoUrl}: FooterLockupProps) => {
    -
    {line1 || siteName}
    -
    {line3}
    +
    {line1 || siteName}
    +
    {line3}
    diff --git a/src/components/elements/lockup/lockup-e.tsx b/src/components/elements/lockup/lockup-e.tsx index 1a12099..d44a9c6 100644 --- a/src/components/elements/lockup/lockup-e.tsx +++ b/src/components/elements/lockup/lockup-e.tsx @@ -13,9 +13,9 @@ const LockupE = ({line1, line2, line3, siteName, logoUrl}: FooterLockupProps) =>
    -
    {line1 || siteName}
    -
    {line2 || siteName}
    -
    {line3}
    +
    {line1 || siteName}
    +
    {line2 || siteName}
    +
    {line3}
    diff --git a/src/components/elements/lockup/lockup-h.tsx b/src/components/elements/lockup/lockup-h.tsx index 4e4b0b1..3548494 100644 --- a/src/components/elements/lockup/lockup-h.tsx +++ b/src/components/elements/lockup/lockup-h.tsx @@ -9,11 +9,11 @@ const LockupH = ({line1, line3, line4, siteName, logoUrl}: FooterLockupProps) =>
    -
    {line4}
    +
    {line4}
    -
    +
    {line1 || siteName}
    {line3}
    diff --git a/src/components/elements/lockup/lockup-i.tsx b/src/components/elements/lockup/lockup-i.tsx index 695e173..3bbf534 100644 --- a/src/components/elements/lockup/lockup-i.tsx +++ b/src/components/elements/lockup/lockup-i.tsx @@ -9,13 +9,13 @@ const LockupI = ({line1, line3, line4, siteName, logoUrl}: FooterLockupProps) =>
    -
    {line4}
    +
    {line4}
    -
    {line1 || siteName}
    -
    {line3}
    +
    {line1 || siteName}
    +
    {line3}
    diff --git a/src/components/elements/lockup/lockup-m.tsx b/src/components/elements/lockup/lockup-m.tsx index 905b6c1..1425387 100644 --- a/src/components/elements/lockup/lockup-m.tsx +++ b/src/components/elements/lockup/lockup-m.tsx @@ -12,7 +12,7 @@ const LockupM = ({line1, line2, siteName, logoUrl}: FooterLockupProps) => {
    -
    +
    {line1 || siteName}
    {line2}
    diff --git a/src/components/elements/lockup/lockup-o.tsx b/src/components/elements/lockup/lockup-o.tsx index 5225612..7297fe3 100644 --- a/src/components/elements/lockup/lockup-o.tsx +++ b/src/components/elements/lockup/lockup-o.tsx @@ -7,7 +7,7 @@ const LockupO = ({line4, siteName, logoUrl}: FooterLockupProps) => {
    -
    {line4}
    +
    {line4}
    ) diff --git a/src/components/elements/lockup/lockup-p.tsx b/src/components/elements/lockup/lockup-p.tsx index a831c30..823d9b2 100644 --- a/src/components/elements/lockup/lockup-p.tsx +++ b/src/components/elements/lockup/lockup-p.tsx @@ -9,11 +9,11 @@ const LockupP = ({line1, line4, siteName, logoUrl}: FooterLockupProps) => {
    -
    {line4}
    +
    {line4}
    -
    {line1 || siteName}
    +
    {line1 || siteName}
    diff --git a/src/components/elements/lockup/lockup-s.tsx b/src/components/elements/lockup/lockup-s.tsx index 938aa97..71dfb90 100644 --- a/src/components/elements/lockup/lockup-s.tsx +++ b/src/components/elements/lockup/lockup-s.tsx @@ -7,10 +7,10 @@ const LockupS = ({line1, line2, line4, siteName, logoUrl}: FooterLockupProps) =>
    -
    {line4}
    +
    {line4}
    -
    {line1 || siteName}
    -
    {line2}
    +
    {line1 || siteName}
    +
    {line2}
    diff --git a/src/components/elements/lockup/lockup-t.tsx b/src/components/elements/lockup/lockup-t.tsx index a77e892..0b27355 100644 --- a/src/components/elements/lockup/lockup-t.tsx +++ b/src/components/elements/lockup/lockup-t.tsx @@ -7,11 +7,11 @@ const LockupT = ({line1, line2, line3, line4, siteName, logoUrl}: FooterLockupPr
    -
    {line4}
    +
    {line4}
    -
    {line1 || siteName}
    -
    {line2}
    -
    {line3}
    +
    {line1 || siteName}
    +
    {line2}
    +
    {line3}
    diff --git a/src/components/elements/lockup/lockup.tsx b/src/components/elements/lockup/lockup.tsx index 5d04c9b..a3db952 100644 --- a/src/components/elements/lockup/lockup.tsx +++ b/src/components/elements/lockup/lockup.tsx @@ -48,7 +48,7 @@ export const Lockup = ({
    -
    {suSiteName || "University"}
    +
    {suSiteName || "University"}
    diff --git a/src/components/elements/paged-list.tsx b/src/components/elements/paged-list.tsx index 97ebacf..37a715b 100644 --- a/src/components/elements/paged-list.tsx +++ b/src/components/elements/paged-list.tsx @@ -197,7 +197,7 @@ const PaginationButton = ({ return (
  • diff --git a/src/components/paragraphs/stanford-card/card-paragraph.tsx b/src/components/paragraphs/stanford-card/card-paragraph.tsx index f31e999..31ce96d 100644 --- a/src/components/paragraphs/stanford-card/card-paragraph.tsx +++ b/src/components/paragraphs/stanford-card/card-paragraph.tsx @@ -21,7 +21,7 @@ const CardParagraph = ({paragraph, ...props}: Props) => { const headerTagChoice = (behaviors.su_card_styles?.heading || "h2").split(".", 2) const headerTag = headerTagChoice[0] - let headerClasses = headerTagChoice[1]?.replace(".", " ").replace("su-font-splash", "text-m2 font-bold") || "" + let headerClasses = headerTagChoice[1]?.replace(".", " ").replace("su-font-splash", "type-3 font-bold") || "" if (behaviors.su_card_styles?.hide_heading) headerClasses += " sr-only" return ( diff --git a/src/components/paragraphs/stanford-media-caption/media-caption-paragraph.tsx b/src/components/paragraphs/stanford-media-caption/media-caption-paragraph.tsx index 79e81ab..233e2e3 100644 --- a/src/components/paragraphs/stanford-media-caption/media-caption-paragraph.tsx +++ b/src/components/paragraphs/stanford-media-caption/media-caption-paragraph.tsx @@ -31,7 +31,7 @@ const MediaCaptionParagraph = ({paragraph, ...props}: Props) => { )} {videoUrl && } -
    +
    {paragraph.suMediaCaptionLink?.url && ( {paragraph.suMediaCaptionLink.title} )} diff --git a/src/components/paragraphs/stanford-page-title-banner/page-title-banner-paragraph.tsx b/src/components/paragraphs/stanford-page-title-banner/page-title-banner-paragraph.tsx index 753b42f..a71415c 100644 --- a/src/components/paragraphs/stanford-page-title-banner/page-title-banner-paragraph.tsx +++ b/src/components/paragraphs/stanford-page-title-banner/page-title-banner-paragraph.tsx @@ -16,7 +16,7 @@ const PageTitleBannerParagraph = ({paragraph, pageTitle, ...props}: Props) => { imageAlt={paragraph.suTitleBannerImage?.mediaImage.alt} eagerLoadImage > -

    {pageTitle}

    +

    {pageTitle}

    ) }