diff --git a/CHANGELOG.mdx b/CHANGELOG.mdx index b0fe45c7e..cbc0348b0 100644 --- a/CHANGELOG.mdx +++ b/CHANGELOG.mdx @@ -41,8 +41,12 @@ Prefix the change with one of these keywords: - Icon: restricted to only black, red, white and light grey - Icon Cards: restricted to red icons, removed shadow and bg colors - Icon Cards: fixed width and height for icons inside container -- Pagination: active text changed to red +- Listings: removed button color options in footer subcomponent, restricted to red +- Listings: updated card styles - Nav: space between logo and site title +- Pagination: active text changed to red +- Stacked List: removed border option +- Stacked List: updated max width query sizes when offset used - Text and Image: header always has underline - Wide Image: opacity range set at 60-80 @@ -53,6 +57,7 @@ Prefix the change with one of these keywords: ### Fixed +- Stacked List: bottom border on odd / even items - Pagination: accessibility error relating to role="presentation" ## [0.9.6] diff --git a/lib/components/Card/CardPeopleMeta.tsx b/lib/components/Card/CardPeopleMeta.tsx index d8ec5785f..3696cace2 100644 --- a/lib/components/Card/CardPeopleMeta.tsx +++ b/lib/components/Card/CardPeopleMeta.tsx @@ -10,7 +10,7 @@ export const CardPeopleMeta = ({ jobTitle, children, phone }: CardPeopleMetaProp {jobTitle &&
  • {jobTitle}
  • } {children && (
  • - {children} + {children}
  • )} {phone &&
  • {phone}
  • } diff --git a/lib/components/Listing/Listing.tsx b/lib/components/Listing/Listing.tsx index b5d4f1d1e..5e53ebacd 100644 --- a/lib/components/Listing/Listing.tsx +++ b/lib/components/Listing/Listing.tsx @@ -1,6 +1,4 @@ import React from 'react' -import { ChevronRightIcon } from '@heroicons/react/24/outline' - import { ListingFigure } from './ListingFigure' import { ListingBody } from './ListingBody' import { ListingHeader } from './ListingHeader' @@ -14,26 +12,12 @@ import { ListingFooter } from './ListingFooter' export interface ListingProps { children: React.ReactNode - useArrow?: boolean } -export const ListingWrapper = ({ children, useArrow }: ListingProps) => { - const arrowStyles = useArrow ? 'pr-14' : '' - +export const ListingWrapper = ({ children }: ListingProps) => { return ( -
  • -
    - {children} - - {useArrow && ( -
    -
    - )} -
    +
  • +
    {children}
  • ) } diff --git a/lib/components/Listing/ListingEventMeta.tsx b/lib/components/Listing/ListingEventMeta.tsx index 76508faee..a02058ccb 100644 --- a/lib/components/Listing/ListingEventMeta.tsx +++ b/lib/components/Listing/ListingEventMeta.tsx @@ -10,7 +10,7 @@ export interface ListingEventMetaProps { eventAddress?: string } -export const styles = { +const styles = { redIcon: `mr-2 h-6 w-6 flex-shrink-0 text-cu-red-300`, } diff --git a/lib/components/Listing/ListingExcerpt.tsx b/lib/components/Listing/ListingExcerpt.tsx index f193915c8..fff55b7a6 100644 --- a/lib/components/Listing/ListingExcerpt.tsx +++ b/lib/components/Listing/ListingExcerpt.tsx @@ -6,7 +6,7 @@ export interface ListingExcerptProps { export const ListingExcerpt = ({ text, hasMore }: ListingExcerptProps) => { return (

    - {text.length > 170 ? `${text.substring(0, 170)}...` : text} + {text.length > 200 ? `${text.substring(0, 200)}...` : text} {hasMore && More}

    ) diff --git a/lib/components/Listing/ListingFooter.tsx b/lib/components/Listing/ListingFooter.tsx index d2d2d2f22..0417da39a 100644 --- a/lib/components/Listing/ListingFooter.tsx +++ b/lib/components/Listing/ListingFooter.tsx @@ -1,20 +1,9 @@ export interface ListingFooterProps { children: React.ReactNode - isType?: 'button' | 'badge' - buttonType?: 'solid' | 'outline' - buttonStyle?: 'red' | 'white' | 'dark-grey' | 'grey' } -export const ListingFooter = ({ children, isType, buttonType = 'solid', buttonStyle = 'red' }: ListingFooterProps) => { - const buttonClass = isType === 'button' ? `cu-card-button` : '' - const buttonTypeClass = isType === 'button' && buttonType ? `cu-card-button-${buttonType}` : 'cu-card-button-solid' - const buttonStyleClass = isType === 'button' && buttonStyle ? `cu-card-button-${buttonStyle}` : 'cu-card-button-red' - - return ( - - ) +export const ListingFooter = ({ children }: ListingFooterProps) => { + return } ListingFooter.displayName = 'Listing.Footer' diff --git a/lib/components/Listing/ListingIconThumb.tsx b/lib/components/Listing/ListingIconThumb.tsx index e0c2d20b0..9a3c71359 100644 --- a/lib/components/Listing/ListingIconThumb.tsx +++ b/lib/components/Listing/ListingIconThumb.tsx @@ -1,52 +1,23 @@ export interface ListingIconThumbProps { icon?: string - bgType?: 'none' | 'red' | 'white' - hasShadow?: boolean } -export const ListingIconThumb = ({ icon, bgType = 'red', hasShadow }: ListingIconThumbProps) => { +export const ListingIconThumb = ({ icon }: ListingIconThumbProps) => { const cdnPath = 'https://cdn.carleton.ca/rds/assets/font-awesome/' const iconPath = `${cdnPath}${icon}.svg` - const iconShadow = hasShadow ? 'shadow-md' : '' - - // Set classes on icon and wrapping div - let iconDiv - - switch (bgType) { - case 'none': - iconDiv = 'w-10 h-10' - break - case 'red': - iconDiv = 'w-16 h-16 bg-cu-red rounded-md' - break - case 'white': - iconDiv = 'w-16 h-16 bg-white rounded-md' - break - default: - iconDiv = '' - break - } - - // Use filter to change svg as image to white - const whiteIcon = { - filter: 'invert(100%) sepia(5%) saturate(0%) hue-rotate(29deg) brightness(106%) contrast(107%)', - } + const iconAlt = icon ? icon.replace(/-/g, ' ') : '' - // Use filter to change svg as image to red const redIcon = { filter: 'invert(20%) sepia(50%) saturate(7177%) hue-rotate(348deg) brightness(91%) contrast(100%)', } - // Remove dashes from icon name - const iconAlt = icon ? icon.replace(/-/g, ' ') : '' - return ( -
    +
    {`An
    ) diff --git a/lib/components/Listing/ListingPeopleMeta.tsx b/lib/components/Listing/ListingPeopleMeta.tsx index bb87b194e..1859af956 100644 --- a/lib/components/Listing/ListingPeopleMeta.tsx +++ b/lib/components/Listing/ListingPeopleMeta.tsx @@ -10,7 +10,7 @@ export const ListingPeopleMeta = ({ jobTitle, children, phone }: ListingPeopleMe {jobTitle &&
  • {jobTitle}
  • } {children && (
  • - + {children}
  • diff --git a/lib/examples/blocks/EventListing.stories.tsx b/lib/examples/blocks/EventListing.stories.tsx deleted file mode 100644 index 8a86db452..000000000 --- a/lib/examples/blocks/EventListing.stories.tsx +++ /dev/null @@ -1,285 +0,0 @@ -import React from 'react' -import type { Meta, StoryObj } from '@storybook/react' -import { Section } from '../../layouts/Section/Section' -import { Container } from '../../layouts/Container/Container' -import { Main } from '../../layouts/Main/Main' -import { FooterStandard } from '../../components/Footer/FooterStandard/FooterStandard' -import { StackedList } from '../../layouts/StackedList/StackedList' -import { Nav } from '../../components/Nav/Nav' -import { PageHeaders } from '../../components/PageHeaders/PageHeaders' -import { Listing } from '../../components/Listing/Listing' -import { TextImage } from '../../components/TextImage/TextImage' -import { EventData } from '../../data/EventData' -import { NavDataSingle, NavAsideData } from '../../data/NavData' - -const meta: Meta = { - title: 'Examples/Blocks', -} - -export default meta -type Story = StoryObj - -export const EventListing: Story = { - render: () => ( - <> - - -
    -
    - - -

    - Nobis voluptatem dolorum et eum doloremque cupiditate velit. Praesentium architecto a distinctio aut - reprehenderit ducimus. Perferendis excepturi delectus nihil voluptatem non. Molestiae quas dolores - accusamus in. Praesent quis ligula quis nulla malesuada tempor. -

    -
    -
    - - - - - {EventData.slice(0, 4).map( - ({ - id, - title, - link, - startDate, - endDate, - on_campus, - on_campus_building, - on_campus_room_number, - event_address, - }) => ( - - - - {title} - - - Event details - - - - ), - )} - - - - - - - {EventData.slice(0, 4).map( - ({ - id, - title, - link, - startDate, - endDate, - on_campus, - on_campus_building, - on_campus_room_number, - event_address, - }) => ( - - - - {title} - - - Event details - - - - ), - )} - - - - - - - {EventData.slice(0, 4).map( - ({ - id, - title, - link, - startDate, - endDate, - on_campus, - on_campus_building, - on_campus_room_number, - event_address, - }) => ( - - - - {title} - - - Event details - - - - ), - )} - - - - - - - {EventData.slice(0, 4).map( - ({ - id, - title, - link, - startDate, - endDate, - on_campus, - on_campus_building, - on_campus_room_number, - event_address, - }) => ( - - - - {title} - - - Event details - - - - ), - )} - - - - - -

    - Aliquam luctus, velit eget suscipit tincidunt, sem ex tempus turpis, quis pulvinar metus sapien in urna. - Nobis voluptatem dolorum et eum doloremque cupiditate velit. Praesentium architecto a distinctio aut - reprehenderit ducimus. Perferendis excepturi delectus nihil voluptatem non. Molestiae quas dolores accusamus - in. Praesent quis ligula quis nulla malesuada tempor. Etiam quis interdum nisi, et malesuada lectus. Aliquam - luctus, velit eget suscipit tincidunt, sem ex tempus turpis, quis pulvinar metus sapien in urna. -

    - - - {EventData.slice(0, 3).map( - ({ - id, - title, - link, - startDate, - endDate, - on_campus, - on_campus_building, - on_campus_room_number, - event_address, - }) => ( - - - - {title} - - - Event details - - - - ), - )} - - -

    - Nobis voluptatem dolorum et eum doloremque cupiditate velit. Praesentium architecto a distinctio aut - reprehenderit ducimus. Perferendis excepturi delectus nihil voluptatem non. Molestiae quas dolores accusamus - in. Praesent quis ligula quis nulla malesuada tempor. -

    -

    - Aliquam luctus, velit eget suscipit tincidunt, sem ex tempus turpis, quis pulvinar metus sapien in urna. - Nobis voluptatem dolorum et eum doloremque cupiditate velit. Praesentium architecto a distinctio aut - reprehenderit ducimus. Perferendis excepturi delectus nihil voluptatem non. Molestiae quas dolores accusamus - in. Praesent quis ligula quis nulla malesuada tempor. Etiam quis interdum nisi, et malesuada lectus. Aliquam - luctus, velit eget suscipit tincidunt, sem ex tempus turpis, quis pulvinar metus sapien in urna. -

    -

    - Nobis voluptatem dolorum et eum doloremque cupiditate velit. Praesentium architecto a distinctio aut - reprehenderit ducimus. Perferendis excepturi delectus nihil voluptatem non. Molestiae quas dolores accusamus - in. Praesent quis ligula quis nulla malesuada tempor. -

    -

    - Aliquam luctus, velit eget suscipit tincidunt, sem ex tempus turpis, quis pulvinar metus sapien in urna. - Nobis voluptatem dolorum et eum doloremque cupiditate velit. Praesentium architecto a distinctio aut - reprehenderit ducimus. Perferendis excepturi delectus nihil voluptatem non. Molestiae quas dolores accusamus - in. Praesent quis ligula quis nulla malesuada tempor. Etiam quis interdum nisi, et malesuada lectus. Aliquam - luctus, velit eget suscipit tincidunt, sem ex tempus turpis, quis pulvinar metus sapien in urna. -

    -

    - Nobis voluptatem dolorum et eum doloremque cupiditate velit. Praesentium architecto a distinctio aut - reprehenderit ducimus. Perferendis excepturi delectus nihil voluptatem non. Molestiae quas dolores accusamus - in. Praesent quis ligula quis nulla malesuada tempor. -

    -

    - Aliquam luctus, velit eget suscipit tincidunt, sem ex tempus turpis, quis pulvinar metus sapien in urna. - Nobis voluptatem dolorum et eum doloremque cupiditate velit. Praesentium architecto a distinctio aut - reprehenderit ducimus. Perferendis excepturi delectus nihil voluptatem non. Molestiae quas dolores accusamus - in. Praesent quis ligula quis nulla malesuada tempor. Etiam quis interdum nisi, et malesuada lectus. Aliquam - luctus, velit eget suscipit tincidunt, sem ex tempus turpis, quis pulvinar metus sapien in urna. -

    -

    - Nobis voluptatem dolorum et eum doloremque cupiditate velit. Praesentium architecto a distinctio aut - reprehenderit ducimus. Perferendis excepturi delectus nihil voluptatem non. Molestiae quas dolores accusamus - in. Praesent quis ligula quis nulla malesuada tempor. Nobis voluptatem dolorum et eum doloremque cupiditate - velit. Praesentium architecto a distinctio aut reprehenderit ducimus. -

    -
    -
    - - - - ), -} diff --git a/lib/examples/blocks/Listing.stories.tsx b/lib/examples/blocks/Listing.stories.tsx new file mode 100644 index 000000000..39d5ce79c --- /dev/null +++ b/lib/examples/blocks/Listing.stories.tsx @@ -0,0 +1,477 @@ +import React from 'react' +import type { Meta, StoryObj } from '@storybook/react' +import { Section } from '../../layouts/Section/Section' +import { Container } from '../../layouts/Container/Container' +import { Main } from '../../layouts/Main/Main' +import { FooterStandard } from '../../components/Footer/FooterStandard/FooterStandard' +import { StackedList } from '../../layouts/StackedList/StackedList' +import { Nav } from '../../components/Nav/Nav' +import { PageHeaders } from '../../components/PageHeaders/PageHeaders' +import { Listing } from '../../components/Listing/Listing' +import { TextImage } from '../../components/TextImage/TextImage' +import { EventData } from '../../data/EventData' +import { IconData } from '../../data/IconData' +import { NewsData } from '../../data/NewsData' +import { PeopleData } from '../../data/PeopleData' +import { NavDataSingle, NavAsideData } from '../../data/NavData' + +const meta: Meta = { + title: 'Examples/Blocks', +} + +export default meta +type Story = StoryObj + +export const Listings: Story = { + render: () => ( + <> + + +
    +
    + + +

    + Nobis voluptatem dolorum et eum doloremque cupiditate velit. Praesentium architecto a distinctio aut + reprehenderit ducimus. Perferendis excepturi delectus nihil voluptatem non. Molestiae quas dolores + accusamus in. Praesent quis ligula quis nulla malesuada tempor. +

    +
    +
    + + + + + {EventData.slice(0, 4).map( + ({ + id, + title, + link, + startDate, + endDate, + on_campus, + on_campus_building, + on_campus_room_number, + event_address, + }) => ( + + + + {title} + + + + Event details + + + + + ), + )} + + + + + + + {EventData.slice(0, 4).map( + ({ + id, + title, + link, + startDate, + endDate, + on_campus, + on_campus_building, + on_campus_room_number, + event_address, + }) => ( + + + + {title} + + + + Event details + + + + + ), + )} + + + + + + + {EventData.slice(0, 3).map( + ({ + id, + title, + link, + startDate, + endDate, + on_campus, + on_campus_building, + on_campus_room_number, + event_address, + }) => ( + + + + {title} + + + + Event details + + + + + ), + )} + + + + + + + {EventData.slice(0, 3).map( + ({ + id, + title, + link, + startDate, + endDate, + on_campus, + on_campus_building, + on_campus_room_number, + event_address, + }) => ( + + + + {title} + + + + Event details + + + + + ), + )} + + + + + + + {IconData.slice(0, 3).map(({ id, link, title, icon }) => ( + + + + {title} + + + + + Get Informed + + + + + ))} + + + + + + + {IconData.slice(0, 3).map(({ id, link, title, icon }) => ( + + + + {title} + + + + + Get Informed + + + + + ))} + + + + + + + {IconData.slice(0, 3).map(({ id, link, title, icon }) => ( + + + + {title} + + + + + Get Informed + + + + + ))} + + + + + + + {IconData.slice(0, 3).map(({ id, link, title, icon }) => ( + + + + {title} + + + + + Get Informed + + + + + ))} + + + + + + + {NewsData.slice(0, 4).map(({ id, title, link, excerpt, date, image, alt }) => ( + + + {alt} + + + {title} + + + + Read more + + + + + ))} + + + + + + + {NewsData.slice(0, 4).map(({ id, title, link, excerpt, date, image, alt }) => ( + + + {alt} + + + {title} + + + + Read more + + + + + ))} + + + + + + + {NewsData.slice(0, 4).map(({ id, title, link, excerpt, date, image, alt }) => ( + + + {alt} + + + {title} + + + + Read more + + + + + ))} + + + + + + + {NewsData.slice(0, 4).map(({ id, title, link, excerpt, date, image, alt }) => ( + + + {alt} + + + {title} + + + + Read more + + + + + ))} + + + + + + + {PeopleData.slice(0, 4).map(({ id, link, image, alt, firstName, lastName, jobTitle, email, phone }) => ( + + + {alt} + + + {`${firstName} ${lastName}`} + + {email} + + + + View profile + + + + + ))} + + + + + + + {PeopleData.slice(0, 4).map(({ id, link, image, alt, firstName, lastName, jobTitle, email, phone }) => ( + + + {alt} + + + {`${firstName} ${lastName}`} + + {email} + + + + View profile + + + + + ))} + + + + + + + {PeopleData.slice(0, 4).map(({ id, link, image, alt, firstName, lastName, jobTitle, email, phone }) => ( + + + {alt} + + + {`${firstName} ${lastName}`} + + {email} + + + + View profile + + + + + ))} + + + + + + + {PeopleData.slice(0, 4).map(({ id, link, image, alt, firstName, lastName, jobTitle, email, phone }) => ( + + + {alt} + + + {`${firstName} ${lastName}`} + + {email} + + + + View profile + + + + + ))} + + +
    +
    + + + + ), +} diff --git a/lib/examples/blocks/NewsListing.stories.tsx b/lib/examples/blocks/ListingSidebars.stories.tsx similarity index 63% rename from lib/examples/blocks/NewsListing.stories.tsx rename to lib/examples/blocks/ListingSidebars.stories.tsx index b9e10820f..4be2002d9 100644 --- a/lib/examples/blocks/NewsListing.stories.tsx +++ b/lib/examples/blocks/ListingSidebars.stories.tsx @@ -1,12 +1,10 @@ import React from 'react' import type { Meta, StoryObj } from '@storybook/react' import { Section } from '../../layouts/Section/Section' -import { Container } from '../../layouts/Container/Container' import { Main } from '../../layouts/Main/Main' import { FooterStandard } from '../../components/Footer/FooterStandard/FooterStandard' import { StackedList } from '../../layouts/StackedList/StackedList' import { Nav } from '../../components/Nav/Nav' -import { PageHeaders } from '../../components/PageHeaders/PageHeaders' import { Listing } from '../../components/Listing/Listing' import { NewsData } from '../../data/NewsData' import { TextImage } from '../../components/TextImage/TextImage' @@ -19,7 +17,7 @@ const meta: Meta = { export default meta type Story = StoryObj -export const NewsListing: Story = { +export const ListingSidebars: Story = { render: () => ( <>