Common front-end components for Web using the Tesseract design system, written for React. https://make.modal.sh/tesseract/web/react/common
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

41 lines
866 B

  1. import * as React from 'react'
  2. import styled from 'styled-components'
  3. import pkg from '../../package.json'
  4. const Base = styled('div')({
  5. position: 'relative',
  6. })
  7. const Title = styled('strong')({
  8. fontSize: '2rem',
  9. fontFamily: 'var(--font-family-headings), sans-serif',
  10. fontWeight: 'var(--font-weight-headings, 400)',
  11. lineHeight: 'var(--line-height-headings, 1.5)',
  12. fontStretch: 'var(--font-stretch-headings, normal)',
  13. textTransform: 'lowercase',
  14. whiteSpace: 'nowrap',
  15. })
  16. const Subtitle = styled('small')({
  17. position: 'absolute',
  18. bottom: '-1em',
  19. right: 0,
  20. fontWeight: 'bolder',
  21. })
  22. const Brand = () => {
  23. const name = pkg.name.includes('@') ? pkg.name.split('/')[1] : pkg.name
  24. return (
  25. <Base>
  26. <Title>
  27. {name}
  28. </Title>
  29. <Subtitle>
  30. v.{pkg.version}
  31. </Subtitle>
  32. </Base>
  33. )
  34. }
  35. export default Brand