diff --git a/libs/react-components/src/lib/components/Typography/Typography.stories.tsx b/libs/react-components/src/lib/components/Typography/Typography.stories.tsx index 4708ad7..aa1dfeb 100644 --- a/libs/react-components/src/lib/components/Typography/Typography.stories.tsx +++ b/libs/react-components/src/lib/components/Typography/Typography.stories.tsx @@ -22,14 +22,18 @@ const meta = { 'headline3', 'caption', 'eyebrow', - 'eyebrow2', ], control: { type: 'select' }, }, + alignment: { + options: ['center', 'left', 'right'], + control: { type: 'select' }, + if: { arg: 'scale', eq: 'eyebrow' }, + }, }, - args: { scale: 'headline1' }, + args: { scale: 'headline1', alignment: 'center' }, render: (args) => { - return Change the scale value.; + return Change the scale value.; }, } satisfies Meta; diff --git a/libs/react-components/src/lib/components/Typography/index.tsx b/libs/react-components/src/lib/components/Typography/index.tsx index 72edf5e..21d9e37 100644 --- a/libs/react-components/src/lib/components/Typography/index.tsx +++ b/libs/react-components/src/lib/components/Typography/index.tsx @@ -13,17 +13,18 @@ interface TypographyProps { | 'headline2' | 'headline3' | 'caption' - | 'eyebrow' - | 'eyebrow2'; + | 'eyebrow'; + alignment: 'center' | 'left' | 'right'; children?: ReactNode; } const Typography: React.FC = ({ scale = 'body1', + alignment = 'center', children, }) => { return ( - {children} + {children} ); }; diff --git a/libs/react-components/src/lib/components/Typography/styles.module.scss b/libs/react-components/src/lib/components/Typography/styles.module.scss index b0825e8..4f70570 100644 --- a/libs/react-components/src/lib/components/Typography/styles.module.scss +++ b/libs/react-components/src/lib/components/Typography/styles.module.scss @@ -70,7 +70,7 @@ } .caption, -.eyebrow, .eyebrow2 { +.eyebrow { @extend %headline-styles; /* Desktop/Caption/Bold */ font-family: var(--td-web-typography-caption-font-family); @@ -81,26 +81,21 @@ .eyebrow { - align-items: center; display: flex; flex-direction: column; gap: 8px; - &::after { - background-color: var(--cv-theme-tertiary); - border-radius: 2px; - content: ''; - height: 2px; - width: 20px; + &.center { + align-items: center; + } + + &.left { + align-items: flex-start; } -} - -.eyebrow2 { - align-items: left; - display: flex; - flex-direction: column; - gap: 8px; + &.right { + align-items: flex-end; + } &::after { background-color: var(--cv-theme-tertiary); border-radius: 2px; @@ -110,6 +105,7 @@ } } + /* Mobile styles */ @media only screen and (max-width: 768px) { .headline1 {