@graphcommerce/next-ui 3.18.1 → 3.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/AppShell/AppShellSticky/index.tsx +3 -19
  2. package/AppShell/DesktopNavActions.tsx +3 -4
  3. package/AppShell/DesktopNavBar.tsx +4 -4
  4. package/AppShell/FixedFab.tsx +1 -6
  5. package/AppShell/GlobalHead.tsx +36 -0
  6. package/AppShell/Logo.tsx +11 -20
  7. package/AppShell/MenuFab.tsx +19 -8
  8. package/AppShell/MenuFabSecondaryItem.tsx +3 -3
  9. package/AppShell/PlaceholderFab/index.tsx +8 -27
  10. package/AppShell/index.tsx +19 -0
  11. package/AppShell/useFabAnimation.tsx +3 -2
  12. package/AppShell/useFixedFabAnimation.tsx +5 -5
  13. package/Blog/BlogAuthor/index.tsx +10 -6
  14. package/Blog/BlogHeader/index.tsx +7 -3
  15. package/Blog/BlogList/index.tsx +1 -1
  16. package/Blog/BlogListItem/index.tsx +2 -1
  17. package/Blog/BlogTitle/index.tsx +5 -5
  18. package/Button/index.tsx +27 -22
  19. package/ButtonLink/index.tsx +1 -1
  20. package/CHANGELOG.md +73 -0
  21. package/ChipMenu/index.tsx +2 -2
  22. package/FlagAvatar/index.tsx +3 -3
  23. package/{AppShell/Footer/index.tsx → Footer/Footer.tsx} +4 -4
  24. package/{AppShell/Footer → Footer}/SocialIcon.tsx +3 -3
  25. package/Footer/index.ts +2 -0
  26. package/Form/InputCheckmark.tsx +3 -3
  27. package/Form/index.tsx +8 -3
  28. package/FramerScroller/components/SidebarGallery.tsx +25 -21
  29. package/FramerScroller/components/SidebarSlider.tsx +2 -6
  30. package/FullPageMessage/index.tsx +1 -1
  31. package/IconHeader/index.tsx +2 -15
  32. package/Layout/components/LayoutHeader.tsx +151 -0
  33. package/Layout/components/LayoutHeaderBack.tsx +50 -0
  34. package/Layout/components/LayoutHeaderClose.tsx +27 -0
  35. package/Layout/components/LayoutHeaderContent.tsx +173 -0
  36. package/Layout/components/LayoutHeadertypes.ts +10 -0
  37. package/Layout/components/LayoutProvider.tsx +17 -0
  38. package/{Title/index.tsx → Layout/components/LayoutTitle.tsx} +24 -15
  39. package/Layout/context/layoutContext.tsx +7 -0
  40. package/Layout/hooks/useScrollY.tsx +6 -0
  41. package/Layout/index.ts +5 -0
  42. package/Layout/types.ts +5 -0
  43. package/LayoutDefault/components/LayoutDefault.tsx +90 -0
  44. package/LayoutDefault/index.ts +1 -0
  45. package/LayoutOverlay/components/LayoutOverlay.tsx +25 -0
  46. package/LayoutOverlay/components/LayoutOverlayBase.tsx +354 -0
  47. package/LayoutOverlay/components/LayoutOverlayHeader.tsx +5 -0
  48. package/LayoutOverlay/hooks/useOverlayPosition.ts +70 -0
  49. package/LayoutOverlay/index.ts +2 -0
  50. package/Page/App.tsx +2 -0
  51. package/PageMeta/index.tsx +3 -0
  52. package/Pagination/index.tsx +0 -1
  53. package/Row/ButtonLinkList/index.tsx +1 -1
  54. package/Row/ColumnOneBoxed/index.tsx +1 -1
  55. package/Row/ColumnTwoWithTop/index.tsx +3 -3
  56. package/Row/ContentLinks/index.tsx +3 -3
  57. package/Row/HeroBanner/index.tsx +28 -21
  58. package/Row/IconBlocks/index.tsx +1 -1
  59. package/Row/ImageText/index.tsx +12 -5
  60. package/Row/ImageTextBoxed/index.tsx +3 -1
  61. package/Row/ParagraphWithSidebarSlide/index.tsx +2 -0
  62. package/Row/SpecialBanner/index.tsx +11 -7
  63. package/Row/index.tsx +1 -1
  64. package/Snackbar/MessageSnackbarImpl.tsx +2 -1
  65. package/StarRatingField/index.tsx +3 -4
  66. package/Stepper/Stepper.tsx +1 -1
  67. package/Styles/breakpointVal.tsx +22 -0
  68. package/Styles/classesPicker.ts +41 -0
  69. package/Styles/responsiveVal.tsx +1 -1
  70. package/SvgImage/SvgImageSimple.tsx +14 -11
  71. package/SvgImage/index.tsx +9 -11
  72. package/TextInputNumber/index.tsx +3 -4
  73. package/Theme/types.ts +14 -12
  74. package/ToggleButton/index.tsx +6 -13
  75. package/UspList/UspListItem.tsx +4 -2
  76. package/icons/index.tsx +2 -0
  77. package/index.ts +9 -42
  78. package/package.json +8 -9
  79. package/AppShell/AppShellHeader/appShellHeaderContext.tsx +0 -11
  80. package/AppShell/AppShellHeader/index.tsx +0 -438
  81. package/AppShell/AppShellHeader/useAppShellHeaderContext.tsx +0 -6
  82. package/AppShell/AppShellProvider/index.tsx +0 -18
  83. package/AppShell/AppShellTitle/index.tsx +0 -45
  84. package/AppShell/ForwardButton.tsx +0 -53
  85. package/AppShell/FullPageShellBase.tsx +0 -82
  86. package/AppShell/MinimalPageShellBase.tsx +0 -22
  87. package/AppShell/PageShellHeader/index.tsx +0 -14
  88. package/AppShell/SheetShellBase/index.tsx +0 -114
  89. package/AppShell/SheetShellBase/useSheetStyles.ts +0 -18
  90. package/AppShell/SheetShellDragIndicator/index.tsx +0 -55
  91. package/AppShell/SheetShellHeader/index.tsx +0 -28
  92. package/AppShell/ShellBase.tsx +0 -45
  93. package/Debug/DebugSpacer.tsx +0 -51
  94. package/FramerNextPagesSlider/Slide.tsx +0 -71
  95. package/FramerNextPagesSlider/Slider.tsx +0 -39
  96. package/FramerNextPagesSlider/index.ts +0 -1
  97. package/FramerNextPagesSlider/types.ts +0 -3
@@ -1,10 +1,7 @@
1
1
  import { Container, makeStyles, Theme } from '@material-ui/core'
2
2
  import clsx from 'clsx'
3
- import { useMotionValue } from 'framer-motion'
4
- import React, { useEffect } from 'react'
5
- import { useMotionValueValue } from '../../../framer-utils'
3
+ import React from 'react'
6
4
  import { UseStyles } from '../../Styles'
7
- import useAppShellHeaderContext from '../AppShellHeader/useAppShellHeaderContext'
8
5
 
9
6
  const useStyles = makeStyles(
10
7
  (theme: Theme) => ({
@@ -38,21 +35,8 @@ export default function AppShellSticky(props: AppShellStickyProps) {
38
35
  const { children, headerFill = 'both' } = props
39
36
  const classes = useStyles(props)
40
37
 
41
- const { contentHeaderRef } = useAppShellHeaderContext()
42
- const offsetTop = useMotionValue<number>(0)
43
-
44
- useEffect(() => {
45
- if (!contentHeaderRef?.current) return () => {}
46
-
47
- const ro = new ResizeObserver(([entry]) =>
48
- offsetTop.set(contentHeaderRef?.current?.clientHeight ?? 0),
49
- )
50
-
51
- ro.observe(contentHeaderRef.current)
52
- return () => ro.disconnect()
53
- }, [contentHeaderRef, offsetTop])
54
-
55
- const top = useMotionValueValue(offsetTop, (v) => v)
38
+ // todo
39
+ const top = 0
56
40
 
57
41
  return (
58
42
  <Container
@@ -1,5 +1,4 @@
1
1
  import { makeStyles, Theme } from '@material-ui/core'
2
- import { m } from 'framer-motion'
3
2
  import React from 'react'
4
3
 
5
4
  const useStyles = makeStyles(
@@ -7,11 +6,12 @@ const useStyles = makeStyles(
7
6
  actions: {
8
7
  display: 'none',
9
8
  [theme.breakpoints.up('md')]: {
9
+ display: 'grid',
10
+ pointerEvents: 'none !important',
10
11
  '& > *': {
11
12
  pointerEvents: 'all',
12
13
  },
13
14
  alignItems: 'center',
14
- display: 'grid',
15
15
  gridAutoFlow: 'column',
16
16
  columnGap: 6,
17
17
  },
@@ -23,6 +23,5 @@ const useStyles = makeStyles(
23
23
  export default function DesktopNavActions(props: { children?: React.ReactNode }) {
24
24
  const { children } = props
25
25
  const classes = useStyles()
26
-
27
- return <m.div className={classes.actions}>{children}</m.div>
26
+ return <div className={classes.actions}>{children}</div>
28
27
  }
@@ -1,10 +1,9 @@
1
+ import { usePageRouter } from '@graphcommerce/framer-next-pages'
1
2
  import { Scroller, ScrollerButton, ScrollerProvider } from '@graphcommerce/framer-scroller'
2
3
  import { Link, LinkProps as MuiLinkProps, makeStyles, Theme } from '@material-ui/core'
3
- import { Variant as ThemeVariant } from '@material-ui/core/styles/createTypography'
4
4
  import clsx from 'clsx'
5
5
  import { m } from 'framer-motion'
6
6
  import PageLink from 'next/link'
7
- import { useRouter } from 'next/router'
8
7
  import React from 'react'
9
8
  import { UseStyles } from '../Styles'
10
9
  import SvgImageSimple from '../SvgImage/SvgImageSimple'
@@ -62,6 +61,7 @@ const useStyles = makeStyles(
62
61
  '&:hover': {
63
62
  textDecoration: 'none',
64
63
  },
64
+ fontWeight: theme.typography.fontWeightBold,
65
65
  paddingTop: 6,
66
66
  },
67
67
  line: {
@@ -92,7 +92,7 @@ export type MenuTabsProps = MenuProps &
92
92
  export default function DesktopNavBar(props: MenuTabsProps) {
93
93
  const { menu, LinkProps, iconScrollerBtnLeft, iconScrollerBtnRight } = props
94
94
  const classes = useStyles(props)
95
- const router = useRouter()
95
+ const router = usePageRouter()
96
96
 
97
97
  return (
98
98
  <ScrollerProvider scrollSnapAlign='none'>
@@ -101,7 +101,7 @@ export default function DesktopNavBar(props: MenuTabsProps) {
101
101
  {menu.map(({ href, children, ...linkProps }) => (
102
102
  <PageLink key={href.toString()} href={href} {...linkProps} passHref>
103
103
  <Link
104
- variant='h6'
104
+ variant='subtitle1'
105
105
  {...LinkProps}
106
106
  className={clsx(classes.link, LinkProps?.className)}
107
107
  >
@@ -6,20 +6,15 @@ const useStyles = makeStyles(
6
6
  (theme: Theme) => ({
7
7
  root: {
8
8
  position: 'fixed',
9
- top: 'unset',
10
9
  bottom: 20,
11
10
  right: 20,
12
11
  zIndex: 100,
13
12
  boxShadow: theme.shadows[4],
14
13
  borderRadius: 99,
15
14
  maxWidth: 56,
16
- [theme.breakpoints.down('sm')]: {
17
- top: 'unset !important',
18
- },
19
15
  [theme.breakpoints.up('md')]: {
20
16
  pointerEvents: 'all',
21
- top: theme.spacings.xxs,
22
- // hacky way to measure page width without scrollbar width
17
+ top: `calc(${theme.appShell.headerHeightMd} / 2 - 28px)`,
23
18
  left: `calc((100vw - (100vw - 100%)) - ${theme.page.horizontal} - 56px)`,
24
19
  bottom: 'unset',
25
20
  boxShadow: 'unset',
@@ -0,0 +1,36 @@
1
+ import { useTheme } from '@material-ui/core'
2
+ import Head from 'next/head'
3
+ import React from 'react'
4
+
5
+ export type GlobalHeadProps = { name: string }
6
+
7
+ const GlobalHead = (props: { name: string }) => {
8
+ const { name } = props
9
+ const theme = useTheme()
10
+
11
+ return (
12
+ <Head>
13
+ <meta name='theme-color' content={theme.palette.background.default} key='theme-color' />
14
+ <meta
15
+ name='viewport'
16
+ content='minimum-scale=1, initial-scale=1, width=device-width'
17
+ key='viewport'
18
+ />
19
+ <meta name='application-name' content={name} key='application-name' />
20
+ <meta name='apple-mobile-web-app-capable' content='yes' key='apple-mobile-web-app-capable' />
21
+ <meta
22
+ name='apple-mobile-web-app-status-bar-style'
23
+ content='default'
24
+ key='apple-mobile-web-app-status-bar-style'
25
+ />
26
+ <meta name='apple-mobile-web-app-title' content={name} key='apple-mobile-web-app-title' />
27
+ <meta name='format-detection' content='telephone=no' key='format-detection' />
28
+ <meta name='mobile-web-app-capable' content='yes' key='mobile-web-app-capable' />
29
+ <link rel='apple-touch-icon' href='/manifest/icon-512-512.png' key='apple-touch-icon' />
30
+ <link rel='manifest' href='/manifest.webmanifest' key='manifest' />
31
+ <link rel='icon' href='/manifest/favicon.ico' key='icon' />
32
+ </Head>
33
+ )
34
+ }
35
+
36
+ export default GlobalHead
package/AppShell/Logo.tsx CHANGED
@@ -1,6 +1,6 @@
1
+ import { usePageRouter } from '@graphcommerce/framer-next-pages'
1
2
  import { Image, ImageProps } from '@graphcommerce/image'
2
- import { makeStyles, Theme, useTheme } from '@material-ui/core'
3
- import clsx from 'clsx'
3
+ import { makeStyles, Theme } from '@material-ui/core'
4
4
  import PageLink from 'next/link'
5
5
  import React from 'react'
6
6
  import { UseStyles } from '../Styles'
@@ -21,34 +21,25 @@ const useStyles = makeStyles(
21
21
  justifyContent: 'left',
22
22
  },
23
23
  },
24
- logoHideOnMobile: {
25
- display: 'none',
26
- [theme.breakpoints.up('md')]: {
27
- display: 'unset',
28
- },
29
- },
30
24
  }),
31
25
  { name: 'Logo' },
32
26
  )
33
27
 
34
- export type LogoProps = {
35
- href?: `/${string}`
36
- image: ImageProps
37
- alwaysShow?: boolean
38
- } & UseStyles<typeof useStyles>
28
+ export type LogoProps = { href?: `/${string}`; image: ImageProps } & UseStyles<typeof useStyles>
39
29
 
40
30
  export default function Logo(props: LogoProps) {
41
- const { href, alwaysShow, image } = props
31
+ const { href, image } = props
32
+ const router = usePageRouter()
42
33
  const classes = useStyles(props)
43
- const theme = useTheme()
44
34
 
45
- return (
35
+ return router.asPath === '/' ? (
36
+ <div className={classes.logo}>
37
+ <Image layout='fixed' loading='eager' {...image} className={classes.logo} />
38
+ </div>
39
+ ) : (
46
40
  <PageLink href={href ?? '/'} passHref>
47
41
  <a className={classes.link} aria-label='Logo'>
48
- <Image
49
- {...{ ...image }}
50
- className={clsx(classes.logo, !alwaysShow && classes.logoHideOnMobile)}
51
- />
42
+ <Image layout='fixed' loading='eager' {...image} className={classes.logo} />
52
43
  </a>
53
44
  </PageLink>
54
45
  )
@@ -10,12 +10,12 @@ import {
10
10
  } from '@material-ui/core'
11
11
  import { m } from 'framer-motion'
12
12
  import PageLink from 'next/link'
13
- import { Router, useRouter } from 'next/router'
13
+ import { useRouter } from 'next/router'
14
14
  import React, { useEffect } from 'react'
15
15
  import { UseStyles } from '../Styles'
16
- import responsiveVal from '../Styles/responsiveVal'
16
+ import { responsiveVal } from '../Styles/responsiveVal'
17
17
  import SvgImageSimple from '../SvgImage/SvgImageSimple'
18
- import { iconMenu } from '../icons'
18
+ import { iconMenu, iconClose } from '../icons'
19
19
  import { MenuProps } from './Menu'
20
20
  import useFabAnimation from './useFabAnimation'
21
21
 
@@ -25,7 +25,6 @@ const useStyles = makeStyles(
25
25
  position: 'fixed',
26
26
  zIndex: 99,
27
27
  left: theme.page.horizontal,
28
- top: `calc(${theme.spacings.xxs} - 5px)`,
29
28
  [theme.breakpoints.down('sm')]: {
30
29
  top: 'unset',
31
30
  left: 20,
@@ -33,10 +32,12 @@ const useStyles = makeStyles(
33
32
  transform: 'none !important',
34
33
  opacity: '1 !important',
35
34
  },
35
+ [theme.breakpoints.up('md')]: {
36
+ top: `calc(${theme.appShell.headerHeightMd} / 2 - 28px)`,
37
+ },
36
38
  },
37
39
  menuFab: {
38
40
  background: theme.palette.text.primary,
39
- boxShadow: theme.shadows[2],
40
41
  width: responsiveVal(42, 56),
41
42
  height: responsiveVal(42, 56),
42
43
  pointerEvents: 'all',
@@ -44,13 +45,17 @@ const useStyles = makeStyles(
44
45
  background: theme.palette.text.primary,
45
46
  },
46
47
  '& svg': {
47
- stroke: theme.palette.background.default,
48
+ color: theme.palette.background.paper,
48
49
  },
49
50
  },
50
51
  menu: {
51
52
  backgroundColor: theme.palette.background.paper,
52
53
  color: theme.palette.text.primary,
53
54
  minWidth: responsiveVal(200, 280),
55
+ marginTop: `calc(${responsiveVal(42, 56)} + 3px)`,
56
+ [theme.breakpoints.down('sm')]: {
57
+ marginTop: `calc((${responsiveVal(42, 56)} + 12px) * -1)`,
58
+ },
54
59
  },
55
60
  menuItemText: {
56
61
  ...theme.typography.h4,
@@ -66,10 +71,11 @@ export type MenuFabProps = MenuProps &
66
71
  children?: React.ReactNode
67
72
  search?: React.ReactNode
68
73
  menuIcon?: React.ReactNode
74
+ closeIcon?: React.ReactNode
69
75
  }
70
76
 
71
77
  export default function MenuFab(props: MenuFabProps) {
72
- const { menu, children, search, menuIcon } = props
78
+ const { menu, children, search, menuIcon, closeIcon } = props
73
79
  const classes = useStyles(props)
74
80
  const router = useRouter()
75
81
  const [openEl, setOpenEl] = React.useState<null | HTMLElement>(null)
@@ -91,7 +97,12 @@ export default function MenuFab(props: MenuFabProps) {
91
97
  onClick={(event) => setOpenEl(event.currentTarget)}
92
98
  className={classes.menuFab}
93
99
  >
94
- {menuIcon ?? <SvgImageSimple src={iconMenu} inverted />}
100
+ {closeIcon ?? (
101
+ <SvgImageSimple src={iconClose} inverted style={{ display: openEl ? 'block' : 'none' }} />
102
+ )}
103
+ {menuIcon ?? (
104
+ <SvgImageSimple src={iconMenu} inverted style={{ display: openEl ? 'none' : 'block' }} />
105
+ )}
95
106
  </Fab>
96
107
 
97
108
  <Menu
@@ -1,13 +1,13 @@
1
- import { ListItem, ListItemIcon, ListItemText, makeStyles, Theme } from '@material-ui/core'
1
+ import { ListItem, ListItemIcon, ListItemText, makeStyles } from '@material-ui/core'
2
2
  import PageLink from 'next/link'
3
3
  import router from 'next/router'
4
4
  import React from 'react'
5
5
 
6
6
  const useStyles = makeStyles(
7
- (theme: Theme) => ({
7
+ {
8
8
  listItemText: {},
9
9
  icon: { minWidth: 30 },
10
- }),
10
+ },
11
11
  { name: 'FabMenuSecondaryItem' },
12
12
  )
13
13
 
@@ -1,27 +1,8 @@
1
- import { Fab, FabProps, makeStyles } from '@material-ui/core'
2
- import React from 'react'
3
- import { UseStyles } from '../../Styles'
4
-
5
- const useStyles = makeStyles(
6
- () => ({
7
- placeholderCartFab: {
8
- boxShadow: 'none',
9
- background: 'none',
10
- pointerEvents: 'none',
11
- },
12
- }),
13
- { name: 'FullPageShell' },
14
- )
15
-
16
- type PlaceholderFabProps = Omit<FabProps, 'children'> & UseStyles<typeof useStyles>
17
-
18
- export default function PlaceholderFab(props: PlaceholderFabProps) {
19
- const { ...fabProps } = props
20
- const classes = useStyles(props)
21
-
22
- return (
23
- <Fab className={classes.placeholderCartFab} size='large' {...fabProps} aria-label='Placeholder'>
24
- <></>
25
- </Fab>
26
- )
27
- }
1
+ import { Fab, FabProps, styled } from '@material-ui/core'
2
+
3
+ export const PlaceholderFab = styled((props: Omit<FabProps, 'children'>) => (
4
+ <Fab {...props}>
5
+ {/* eslint-disable-next-line react/jsx-no-useless-fragment */}
6
+ <></>
7
+ </Fab>
8
+ ))({ visibility: 'hidden', pointerEvents: 'none' })
@@ -0,0 +1,19 @@
1
+ export { default as AppShellSticky } from './AppShellSticky'
2
+ export { default as DesktopNavActions } from './DesktopNavActions'
3
+
4
+ export * from './DesktopNavBar'
5
+ export { default as DesktopNavBar } from './DesktopNavBar'
6
+ export { default as FixedFab } from './FixedFab'
7
+
8
+ export { default as Logo } from './Logo'
9
+ export * from './Logo'
10
+ export * from './Menu'
11
+ export * from './MenuFab'
12
+ export { default as MenuFab } from './MenuFab'
13
+ export * from './MenuFabSecondaryItem'
14
+ export { default as MenuFabSecondaryItem } from './MenuFabSecondaryItem'
15
+ export * from './PlaceholderFab'
16
+ export * from './GlobalHead'
17
+ export { default as GlobalHead } from './GlobalHead'
18
+ export { default as useFabAnimation } from './useFabAnimation'
19
+ export { default as useFixedFabAnimation } from './useFixedFabAnimation'
@@ -1,10 +1,11 @@
1
1
  import { useMediaQuery, useTheme } from '@material-ui/core'
2
- import { useMotionTemplate, useTransform, useViewportScroll } from 'framer-motion'
2
+ import { useMotionTemplate, useTransform } from 'framer-motion'
3
+ import { useScrollY } from '../Layout/hooks/useScrollY'
3
4
 
4
5
  export default function useFabAnimation() {
5
6
  const theme = useTheme()
6
7
  const isMobile = useMediaQuery(theme.breakpoints.down('sm'))
7
- const { scrollY } = useViewportScroll()
8
+ const scrollY = useScrollY()
8
9
  const scrollTo = isMobile ? 0 : 130
9
10
 
10
11
  const scale = useTransform(scrollY, [50, scrollTo], [0.4, 1])
@@ -1,16 +1,16 @@
1
1
  import { alpha, useTheme } from '@material-ui/core'
2
- import { useMotionTemplate, useTransform, useViewportScroll } from 'framer-motion'
2
+ import { useMotionTemplate, useTransform } from 'framer-motion'
3
+ import { useScrollY } from '../Layout/hooks/useScrollY'
3
4
 
4
5
  export default function useFixedFabAnimation() {
5
6
  const theme = useTheme()
6
- const { scrollY } = useViewportScroll()
7
- const opacity = useTransform(scrollY, [50, 60], [0, 0.08])
7
+ const scrollY = useScrollY()
8
+ const opacity = useTransform(scrollY, [50, 60], [0, 1])
8
9
  const opacity1 = useTransform(
9
10
  scrollY,
10
11
  [0, 10],
11
12
  [alpha(theme.palette.background.paper, 0), alpha(theme.palette.background.paper, 1)],
12
13
  )
13
- const boxShadow = useMotionTemplate`0 2px 10px 0 rgba(0, 0, 0, ${opacity})`
14
14
  const backgroundColor = useMotionTemplate`${opacity1}`
15
- return { boxShadow, backgroundColor, opacity }
15
+ return { backgroundColor, opacity }
16
16
  }
@@ -1,6 +1,7 @@
1
1
  import { Avatar, Chip, makeStyles, Theme } from '@material-ui/core'
2
2
  import React from 'react'
3
3
  import { UseStyles } from '../../Styles'
4
+ import { responsiveVal } from '../../Styles/responsiveVal'
4
5
 
5
6
  const useStyles = makeStyles(
6
7
  (theme: Theme) => ({
@@ -12,20 +13,23 @@ const useStyles = makeStyles(
12
13
  marginBottom: theme.spacings.md,
13
14
  },
14
15
  authorChip: {
15
- height: 66,
16
+ height: responsiveVal(44, 66),
16
17
  '& .MuiChip-label': {
17
- paddingLeft: 14,
18
- paddingRight: 14,
18
+ paddingLeft: responsiveVal(10, 14),
19
+ paddingRight: responsiveVal(14, 18),
19
20
  },
20
21
  '& .MuiAvatar-root': {
21
- width: 44,
22
- height: 44,
22
+ width: responsiveVal(28, 44),
23
+ height: responsiveVal(28, 44),
23
24
  },
24
25
  },
25
26
  date: {
27
+ lineHeight: 1.4,
26
28
  color: theme.palette.text.disabled,
27
29
  },
28
- author: {},
30
+ author: {
31
+ lineHeight: 1.4,
32
+ },
29
33
  }),
30
34
  { name: 'BlogAuthor' },
31
35
  )
@@ -1,7 +1,7 @@
1
- import { makeStyles, Theme, Typography } from '@material-ui/core'
1
+ import { makeStyles, Theme } from '@material-ui/core'
2
2
  import React from 'react'
3
- import Row from '../../Row'
4
3
  import { UseStyles } from '../../Styles'
4
+ import { responsiveVal } from '../../Styles/responsiveVal'
5
5
 
6
6
  const useStyles = makeStyles(
7
7
  (theme: Theme) => ({
@@ -10,7 +10,11 @@ const useStyles = makeStyles(
10
10
  margin: `0 auto`,
11
11
  marginBottom: theme.spacings.md,
12
12
  },
13
- asset: {},
13
+ asset: {
14
+ '& img': {
15
+ borderRadius: responsiveVal(theme.shape.borderRadius * 2, theme.shape.borderRadius * 3),
16
+ },
17
+ },
14
18
  }),
15
19
  { name: 'BlogHeader' },
16
20
  )
@@ -2,7 +2,7 @@ import { makeStyles, Theme } from '@material-ui/core'
2
2
  import React from 'react'
3
3
  import Row from '../../Row'
4
4
  import { UseStyles } from '../../Styles'
5
- import responsiveVal from '../../Styles/responsiveVal'
5
+ import { responsiveVal } from '../../Styles/responsiveVal'
6
6
 
7
7
  const useStyles = makeStyles(
8
8
  (theme: Theme) => ({
@@ -2,7 +2,7 @@ import { Link, makeStyles, Theme, Typography } from '@material-ui/core'
2
2
  import PageLink from 'next/link'
3
3
  import React from 'react'
4
4
  import { UseStyles } from '../../Styles'
5
- import responsiveVal from '../../Styles/responsiveVal'
5
+ import { responsiveVal } from '../../Styles/responsiveVal'
6
6
 
7
7
  const useStyles = makeStyles(
8
8
  (theme: Theme) => ({
@@ -24,6 +24,7 @@ const useStyles = makeStyles(
24
24
  overflow: 'hidden',
25
25
  height: '100%',
26
26
  width: '100%',
27
+ borderRadius: responsiveVal(theme.shape.borderRadius * 2, theme.shape.borderRadius * 3),
27
28
  '& img': {
28
29
  height: '100% !important',
29
30
  objectFit: 'cover',
@@ -1,15 +1,15 @@
1
- import { makeStyles, Theme } from '@material-ui/core'
1
+ import { makeStyles } from '@material-ui/core'
2
2
  import React from 'react'
3
- import AppShellTitle from '../../AppShell/AppShellTitle'
3
+ import { LayoutTitle } from '../../Layout'
4
4
  import { UseStyles } from '../../Styles'
5
5
 
6
6
  const useStyles = makeStyles(
7
- (theme: Theme) => ({
7
+ {
8
8
  wrapper: {
9
9
  maxWidth: 800,
10
10
  margin: `0 auto`,
11
11
  },
12
- }),
12
+ },
13
13
  { name: 'BlogTitle' },
14
14
  )
15
15
 
@@ -23,7 +23,7 @@ export default function BlogTitle(props: BlogTitleProps) {
23
23
 
24
24
  return (
25
25
  <div className={classes.wrapper}>
26
- <AppShellTitle variant='h1'>{title}</AppShellTitle>
26
+ <LayoutTitle variant='h1'>{title}</LayoutTitle>
27
27
  </div>
28
28
  )
29
29
  }
package/Button/index.tsx CHANGED
@@ -3,11 +3,9 @@ import {
3
3
  ButtonClassKey as MuiButtonClassKey,
4
4
  Theme,
5
5
  makeStyles,
6
- lighten,
7
6
  } from '@material-ui/core'
8
7
  import clsx from 'clsx'
9
8
  import React from 'react'
10
- import { responsiveVal } from '..'
11
9
 
12
10
  type BaseButtonProps = Omit<Parameters<typeof MuiButton>['0'], 'variant' | 'classes'> & {
13
11
  variant?: 'text' | 'outlined' | 'contained' | 'pill' | 'pill-link'
@@ -58,33 +56,40 @@ const useStyles = makeStyles<
58
56
  borderRadius: '99em',
59
57
  },
60
58
  pillLink: {
61
- [theme.breakpoints.up('sm')]: {
59
+ [theme.breakpoints.up('md')]: {
62
60
  // manually match MuiButton and containedPrimary styles
63
61
  textTransform: 'none',
64
62
  ...theme.typography.body2,
65
63
  fontWeight: 400,
66
- padding: `${responsiveVal(8, 10)} ${responsiveVal(16, 20)}`,
67
- backgroundColor: theme.palette.secondary.main,
68
- color: theme.palette.primary.contrastText,
69
64
  borderRadius: '99em',
70
- boxShadow: theme.shadows[1],
65
+ boxShadow: theme.shadows[6],
66
+ backgroundColor: theme.palette.background.paper,
67
+ color: theme.palette.text.primary,
71
68
  '&:hover': {
72
- background: theme.palette.secondary.dark,
69
+ background: theme.palette.background.paper,
73
70
  },
74
71
  },
75
72
  },
76
73
  pillPrimary: {
77
- //
74
+ [theme.breakpoints.up('md')]: {
75
+ backgroundColor: theme.palette.primary.main,
76
+ color: theme.palette.primary.contrastText,
77
+ '&:hover': {
78
+ background: theme.palette.primary.dark,
79
+ },
80
+ },
78
81
  },
79
82
  pillSecondary: {
80
- //
81
- },
82
- pillSizeLarge: {
83
- //
84
- },
85
- pillSizeSmall: {
86
- //
83
+ [theme.breakpoints.up('md')]: {
84
+ backgroundColor: theme.palette.secondary.main,
85
+ color: theme.palette.secondary.contrastText,
86
+ '&:hover': {
87
+ background: theme.palette.secondary.dark,
88
+ },
89
+ },
87
90
  },
91
+ pillSizeLarge: {},
92
+ pillSizeSmall: {},
88
93
  pillNoElevation: {
89
94
  /* disableElevation does not stop adding box shadow on active... ?! */
90
95
  '&:active': {
@@ -152,13 +157,13 @@ export default React.forwardRef<any, ButtonProps>((props, ref) => {
152
157
  disabled={loading || disabled}
153
158
  className={clsx(
154
159
  {
155
- [pillClasses.pill]: variant === 'pill',
156
- [pillClasses.pillPrimary]: variant === 'pill' && color === 'primary',
157
- [pillClasses.pillSecondary]: variant === 'pill' && color === 'secondary',
158
- [pillClasses.pillSizeLarge]: variant === 'pill' && size === 'large',
159
- [pillClasses.pillSizeSmall]: variant === 'pill' && size === 'small',
160
- [pillClasses.pillNoElevation]: buttonProps.disableElevation,
160
+ [pillClasses.pill]: variant?.startsWith('pill'),
161
161
  [pillClasses.pillLink]: variant === 'pill-link',
162
+ [pillClasses.pillPrimary]: variant?.startsWith('pill') && color === 'primary',
163
+ [pillClasses.pillSecondary]: variant?.startsWith('pill') && color === 'secondary',
164
+ [pillClasses.pillSizeLarge]: variant?.startsWith('pill') && size === 'large',
165
+ [pillClasses.pillSizeSmall]: variant?.startsWith('pill') && size === 'small',
166
+ [pillClasses.pillNoElevation]: buttonProps.disableElevation,
162
167
  [pillClasses.loading]: loading,
163
168
  [pillClasses.withStartIcon]: withIcon,
164
169
  },
@@ -24,7 +24,7 @@ const useStyles = makeStyles((theme: Theme) => ({
24
24
  }))
25
25
 
26
26
  export type ButtonLinkProps = {
27
- title: string
27
+ title: string | React.ReactNode
28
28
  url: string
29
29
  endIcon?: React.ReactNode
30
30
  } & ButtonProps &