diff --git a/src/atoms/typography/Heading/Heading.js b/src/atoms/typography/Heading/Heading.js index b3136899..ac34fd3f 100644 --- a/src/atoms/typography/Heading/Heading.js +++ b/src/atoms/typography/Heading/Heading.js @@ -4,7 +4,7 @@ import { createStyledTag, createTheme } from '../../../utils'; type HeadingProps = {| children?: React$Node, - kind?: 'primary' | 'secondary' | 'disabled', + kind?: 'primary' | 'secondary' | 'disabled' | 'white', text?: string, type: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6', weight?: 'light' | 'normal' | 'semibold' | 'bold', @@ -44,6 +44,9 @@ const theme = createTheme(name, (colors) => ({ disabled: { color: colors.DARK_DISABLED_TEXT_COLOR, }, + white: { + color: colors.WHITE, + }, }, weight: { light: { @@ -68,7 +71,7 @@ const theme = createTheme(name, (colors) => ({ const StyledTag = createStyledTag(name, { lineHeight: 1.1, - fontFamily: 'Sofia Pro, sans-serif', + fontFamily: 'Poppins', fontWeight: 400, margin: 0, }); diff --git a/src/atoms/typography/Icon/Icon.js b/src/atoms/typography/Icon/Icon.js index f0c23bbc..2a65c5f2 100644 --- a/src/atoms/typography/Icon/Icon.js +++ b/src/atoms/typography/Icon/Icon.js @@ -9,7 +9,7 @@ type IconProps = { /** icon name */ name: string, /** icon color */ - color?: 'red' | 'green' | 'blue' | 'primary' | 'secondary', + color?: 'red' | 'green' | 'blue' | 'primary' | 'secondary' | 'white', /** icon size */ size?: 'xs' | 'sm' | 'md' | 'lg' | 'stretch', }; @@ -24,6 +24,7 @@ const theme : Theme = createTheme(name, (colors: *): * => ({ red: { color: colors.RED }, green: { color: colors.GREEN }, blue: { color: colors.BLUE }, + white: { color: colors.WHITE }, }, size: { xs: { diff --git a/src/atoms/typography/Icon/glyphs/Mail.svg b/src/atoms/typography/Icon/glyphs/Mail.svg new file mode 100644 index 00000000..65c400d3 --- /dev/null +++ b/src/atoms/typography/Icon/glyphs/Mail.svg @@ -0,0 +1,12 @@ + + + + + + diff --git a/src/atoms/typography/Icon/glyphs/index.js b/src/atoms/typography/Icon/glyphs/index.js index 2983cff7..b0db4995 100644 --- a/src/atoms/typography/Icon/glyphs/index.js +++ b/src/atoms/typography/Icon/glyphs/index.js @@ -2,12 +2,14 @@ // eslint-disable-next-line no-unused-vars import React from 'react'; +import Mail from './Mail.svg'; import Check from './Check.svg'; import ChevronDown from './ChevronDown.svg'; import Search from './Search.svg'; import Trashcan from './Trashcan.svg'; export { + Mail, Check, ChevronDown, Search, diff --git a/src/atoms/typography/Link/Link.js b/src/atoms/typography/Link/Link.js index d857ab4d..13af0512 100644 --- a/src/atoms/typography/Link/Link.js +++ b/src/atoms/typography/Link/Link.js @@ -5,26 +5,53 @@ import React from 'react'; import { createStyledTag, createTheme } from '../../../utils'; type LinkProps = {| - to: string, + to?: string, text?: string, + tagName: string | React$Component<*>, children?: React$Node, component?: React$Node, |}; const name = 'link'; -const theme = createTheme(name, { +const theme = createTheme(name, (colors: *) => ({ modifiers: { + size: { + lg: { + fontSize: '1.8rem', + }, + md: { + fontSize: '1.4rem', + }, + sm: { + fontSize: '1.2rem', + }, + }, + color: { + primary: { + color: colors.PRIMARY_LINK_COLOR, + }, + white: { + color: colors.WHITE, + }, + brand: { + color: colors.BRAND, + }, + }, + underline: { + textDecoration: 'underline', + }, }, defaults: { + size: 'md', + color: 'primary', + underline: false, }, -}); +})); -const StyledTag = createStyledTag(name, (props) => ({ +const StyledTag = createStyledTag(name, () => ({ cursor: 'pointer', - color: props.theme.COLORS.PRIMARY_LINK_COLOR, fontFamily: 'Poppins', - fontSize: '1.4rem', fontWeight: 400, lineHeight: '1', textDecoration: 'none', @@ -37,15 +64,15 @@ const StyledTag = createStyledTag(name, (props) => ({ function Link({ text, children, - component, + tagName, ...rest }: LinkProps) { - return { text || children }; + return { text || children }; } Link.defaultProps = { ...theme[name].defaults, - component: 'a', + tagName: 'a', }; export { Link, theme }; diff --git a/src/atoms/typography/Paragraph/Paragraph.js b/src/atoms/typography/Paragraph/Paragraph.js index ac03a121..4037c3e4 100644 --- a/src/atoms/typography/Paragraph/Paragraph.js +++ b/src/atoms/typography/Paragraph/Paragraph.js @@ -4,7 +4,8 @@ import { createStyledTag, createTheme } from '../../../utils'; type ParagraphProps = {| children?: React$Node, - kind?: 'primary' | 'secondary' | 'disabled', + kind?: 'primary' | 'secondary' | 'disabled' | 'white', + size: 'md' | 'lg', text?: string, |}; @@ -22,10 +23,22 @@ const theme = createTheme(name, (colors) => ({ disabled: { color: colors.DARK_DISABLED_TEXT_COLOR, }, + white: { + color: colors.WHITE, + }, + }, + size: { + lg: { + fontSize: '1.8rem', + }, + md: { + fontSize: '1.4rem', + }, }, }, defaults: { kind: 'primary', + size: 'md', }, })); diff --git a/src/atoms/typography/Text/Text.js b/src/atoms/typography/Text/Text.js index 92f162d0..648cf6ff 100644 --- a/src/atoms/typography/Text/Text.js +++ b/src/atoms/typography/Text/Text.js @@ -6,15 +6,15 @@ import { createStyledTag, createTheme } from '../../../utils'; type TextProps = {| /** text to display in the component */ - children?: string | number, + children?: React$Node | string | number, /** another way to set displayed text */ text?: string | number, /** possible text colors */ - color?: 'primary' | 'secondary' | 'red' | 'green' | 'blue', + color?: 'primary' | 'secondary' | 'red' | 'green' | 'blue' | 'white', /** disabled text state*/ disabled?: boolean, - /** set style to bold */ - bold?: boolean, + /** set style to bold or other weights */ + weight?: 'light' | 'normal' | 'semibold' | 'bold', /** possible sizes */ size?: PropSizes, /** text align */ @@ -41,6 +41,9 @@ const theme = createTheme(name, (colors: *): * => ({ blue: { color: colors.BLUE, }, + white: { + color: colors.WHITE, + }, }, align: { @@ -53,8 +56,19 @@ const theme = createTheme(name, (colors: *): * => ({ color: colors.DISABLED_TEXT_COLOR, }, - bold: { - fontWeight: 600, + weight: { + light: { + fontWeight: 300, + }, + normal: { + fontWeight: 400, + }, + semibold: { + fontWeight: 600, + }, + bold: { + fontWeight: 700, + }, }, size: { @@ -78,13 +92,12 @@ const theme = createTheme(name, (colors: *): * => ({ defaults: { color: 'primary', size: 'md', - bold: false, + weight: 'normal', }, })); const StyledTag = createStyledTag(name, { fontFamily: 'Poppins', - fontWeight: 400, fontSize: '1.4rem', lineHeight: 1.4, margin: 0, diff --git a/src/atoms/typography/Text/Text.stories.js b/src/atoms/typography/Text/Text.stories.js index 6a394d26..4968f799 100644 --- a/src/atoms/typography/Text/Text.stories.js +++ b/src/atoms/typography/Text/Text.stories.js @@ -34,7 +34,7 @@ export default (asStory: *) => { Disabled Text )) .add('with bold modifier', () => ( - Disabled Text + Disabled Text )) .add('with custom size', () => ( Disabled Text diff --git a/storybook/__tests__/__snapshots__/storyshots.test.js.snap b/storybook/__tests__/__snapshots__/storyshots.test.js.snap index e24ad9fc..802422a0 100644 --- a/storybook/__tests__/__snapshots__/storyshots.test.js.snap +++ b/storybook/__tests__/__snapshots__/storyshots.test.js.snap @@ -11067,7 +11067,7 @@ exports[`Storyshots ATOMS/TYPOGRAPHY/Heading with kind modifiers 1`] = ` .emotion-0 { line-height: 1.1; - font-family: Sofia Pro,sans-serif; + font-family: Poppins; font-weight: 400; margin: 0; font-size: 3.2rem; @@ -11075,7 +11075,7 @@ exports[`Storyshots ATOMS/TYPOGRAPHY/Heading with kind modifiers 1`] = ` .emotion-1 { line-height: 1.1; - font-family: Sofia Pro,sans-serif; + font-family: Poppins; font-weight: 400; margin: 0; font-size: 2.4rem; @@ -11083,7 +11083,7 @@ exports[`Storyshots ATOMS/TYPOGRAPHY/Heading with kind modifiers 1`] = ` .emotion-2 { line-height: 1.1; - font-family: Sofia Pro,sans-serif; + font-family: Poppins; font-weight: 400; margin: 0; font-size: 2rem; @@ -11120,7 +11120,7 @@ exports[`Storyshots ATOMS/TYPOGRAPHY/Heading with type modifiers 1`] = ` .emotion-0 { line-height: 1.1; - font-family: Sofia Pro,sans-serif; + font-family: Poppins; font-weight: 400; margin: 0; font-size: 3.2rem; @@ -11128,7 +11128,7 @@ exports[`Storyshots ATOMS/TYPOGRAPHY/Heading with type modifiers 1`] = ` .emotion-1 { line-height: 1.1; - font-family: Sofia Pro,sans-serif; + font-family: Poppins; font-weight: 400; margin: 0; font-size: 2.4rem; @@ -11136,7 +11136,7 @@ exports[`Storyshots ATOMS/TYPOGRAPHY/Heading with type modifiers 1`] = ` .emotion-2 { line-height: 1.1; - font-family: Sofia Pro,sans-serif; + font-family: Poppins; font-weight: 400; margin: 0; font-size: 2rem; @@ -11144,7 +11144,7 @@ exports[`Storyshots ATOMS/TYPOGRAPHY/Heading with type modifiers 1`] = ` .emotion-3 { line-height: 1.1; - font-family: Sofia Pro,sans-serif; + font-family: Poppins; font-weight: 400; margin: 0; font-size: 1.4rem; @@ -11152,7 +11152,7 @@ exports[`Storyshots ATOMS/TYPOGRAPHY/Heading with type modifiers 1`] = ` .emotion-4 { line-height: 1.1; - font-family: Sofia Pro,sans-serif; + font-family: Poppins; font-weight: 400; margin: 0; font-size: 1.2rem; @@ -11160,7 +11160,7 @@ exports[`Storyshots ATOMS/TYPOGRAPHY/Heading with type modifiers 1`] = ` .emotion-5 { line-height: 1.1; - font-family: Sofia Pro,sans-serif; + font-family: Poppins; font-weight: 400; margin: 0; font-size: 1rem; @@ -11540,13 +11540,13 @@ exports[`Storyshots ATOMS/TYPOGRAPHY/Link with children 1`] = ` .emotion-1 { cursor: pointer; - color: #4DA1FF; font-family: Poppins; - font-size: 1.4rem; font-weight: 400; line-height: 1; - -webkit-text-decoration: none; - text-decoration: none; + -webkit-text-decoration: underline; + text-decoration: underline; + font-size: 1.4rem; + color: #4DA1FF; } .emotion-1:hover { @@ -11576,13 +11576,13 @@ exports[`Storyshots ATOMS/TYPOGRAPHY/Link with text 1`] = ` .emotion-0 { cursor: pointer; - color: #4DA1FF; font-family: Poppins; - font-size: 1.4rem; font-weight: 400; line-height: 1; - -webkit-text-decoration: none; - text-decoration: none; + -webkit-text-decoration: underline; + text-decoration: underline; + font-size: 1.4rem; + color: #4DA1FF; } .emotion-0:hover { @@ -11610,7 +11610,7 @@ exports[`Storyshots ATOMS/TYPOGRAPHY/Paragraph with children 1`] = ` .emotion-0 { font-family: Poppins; font-weight: 400; - font-size: 14px; + font-size: 1.4rem; line-height: 28px; margin: 0; } @@ -11634,7 +11634,7 @@ exports[`Storyshots ATOMS/TYPOGRAPHY/Paragraph with kind modifiers 1`] = ` .emotion-0 { font-family: Poppins; font-weight: 400; - font-size: 14px; + font-size: 1.4rem; line-height: 28px; margin: 0; } @@ -11668,7 +11668,7 @@ exports[`Storyshots ATOMS/TYPOGRAPHY/Paragraph with text 1`] = ` .emotion-0 { font-family: Poppins; font-weight: 400; - font-size: 14px; + font-size: 1.4rem; line-height: 28px; margin: 0; } @@ -11691,32 +11691,32 @@ exports[`Storyshots ATOMS/TYPOGRAPHY/Text with align modifiers 1`] = ` .emotion-0 { font-family: Poppins; - font-weight: 600; font-size: 1.4rem; line-height: 1.4; margin: 0; color: #323c47; text-align: left; + font-weight: 400; } .emotion-1 { font-family: Poppins; - font-weight: 600; font-size: 1.4rem; line-height: 1.4; margin: 0; color: #323c47; text-align: right; + font-weight: 400; } .emotion-2 { font-family: Poppins; - font-weight: 600; font-size: 1.4rem; line-height: 1.4; margin: 0; color: #323c47; text-align: center; + font-weight: 400; }