diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-05-02 18:57:29 +0200 | 
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-05-03 15:22:24 +0200 | 
| commit | 732d0943f8041d76262222a092b014f2557085ef (patch) | |
| tree | 16f6f76648b479a9591400ab15bb3e9c914f2226 /src/components/molecules | |
| parent | ca921d7536cfe950b5a7d442977bbf900b48faf4 (diff) | |
chore: add homepage
Diffstat (limited to 'src/components/molecules')
| -rw-r--r-- | src/components/molecules/layout/card.module.scss | 3 | ||||
| -rw-r--r-- | src/components/molecules/layout/card.tsx | 2 | ||||
| -rw-r--r-- | src/components/molecules/layout/page-header.tsx | 2 | ||||
| -rw-r--r-- | src/components/molecules/nav/nav.stories.tsx | 26 | ||||
| -rw-r--r-- | src/components/molecules/nav/nav.tsx | 7 | 
5 files changed, 36 insertions, 4 deletions
| diff --git a/src/components/molecules/layout/card.module.scss b/src/components/molecules/layout/card.module.scss index 85c319a..d5b9836 100644 --- a/src/components/molecules/layout/card.module.scss +++ b/src/components/molecules/layout/card.module.scss @@ -19,7 +19,8 @@    .cover {      align-self: flex-start; -    max-height: fun.convert-px(150); +    place-content: center; +    height: fun.convert-px(150);      margin: auto;      border-bottom: fun.convert-px(1) solid var(--color-border);    } diff --git a/src/components/molecules/layout/card.tsx b/src/components/molecules/layout/card.tsx index 15927e9..89f100e 100644 --- a/src/components/molecules/layout/card.tsx +++ b/src/components/molecules/layout/card.tsx @@ -93,7 +93,7 @@ const Card: FC<CardProps> = ({              {title}            </Heading>          </header> -        {tagline && <div className={styles.tagline}>{tagline}</div>} +        <div className={styles.tagline}>{tagline}</div>          {meta && (            <footer className={styles.footer}>              <DescriptionList diff --git a/src/components/molecules/layout/page-header.tsx b/src/components/molecules/layout/page-header.tsx index 174e246..1663085 100644 --- a/src/components/molecules/layout/page-header.tsx +++ b/src/components/molecules/layout/page-header.tsx @@ -11,7 +11,7 @@ export type PageHeaderProps = {    /**     * The page introduction.     */ -  intro?: string; +  intro?: string | JSX.Element;    /**     * The page metadata.     */ diff --git a/src/components/molecules/nav/nav.stories.tsx b/src/components/molecules/nav/nav.stories.tsx index 25455fd..5cef5f0 100644 --- a/src/components/molecules/nav/nav.stories.tsx +++ b/src/components/molecules/nav/nav.stories.tsx @@ -11,6 +11,19 @@ export default {    title: 'Molecules/Navigation/Nav',    component: NavComponent,    argTypes: { +    'aria-label': { +      control: { +        type: 'text', +      }, +      description: 'An accessible name for the navigation.', +      table: { +        category: 'Accessibility', +      }, +      type: { +        name: 'string', +        required: false, +      }, +    },      className: {        control: {          type: 'text', @@ -46,6 +59,19 @@ export default {          required: true,        },      }, +    listClassName: { +      control: { +        type: 'text', +      }, +      description: 'Set additional classnames to the navigation list.', +      table: { +        category: 'Styles', +      }, +      type: { +        name: 'string', +        required: false, +      }, +    },    },    decorators: [      (Story) => ( diff --git a/src/components/molecules/nav/nav.tsx b/src/components/molecules/nav/nav.tsx index 2666ea2..581f813 100644 --- a/src/components/molecules/nav/nav.tsx +++ b/src/components/molecules/nav/nav.tsx @@ -24,6 +24,10 @@ export type NavItem = {  export type NavProps = {    /** +   * An accessible name. +   */ +  'aria-label'?: string; +  /**     * Set additional classnames to the navigation wrapper.     */    className?: string; @@ -51,6 +55,7 @@ const Nav: FC<NavProps> = ({    items,    kind,    listClassName = '', +  ...props  }) => {    const kindClass = `nav--${kind}`; @@ -71,7 +76,7 @@ const Nav: FC<NavProps> = ({    };    return ( -    <nav className={`${styles[kindClass]} ${className}`}> +    <nav className={`${styles[kindClass]} ${className}`} {...props}>        <ul className={`${styles.nav__list} ${listClassName}`}>{getItems()}</ul>      </nav>    ); | 
