@graphcommerce/next-ui 3.25.3 → 4.0.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 (138) hide show
  1. package/AnimatedRow/index.tsx +6 -3
  2. package/ApolloError/ApolloErrorAlert.tsx +20 -21
  3. package/ApolloError/ApolloErrorFullPage.tsx +3 -4
  4. package/ApolloError/ApolloErrorSnackbar.tsx +3 -3
  5. package/Blog/BlogAuthor/index.tsx +42 -48
  6. package/Blog/BlogContent/index.tsx +6 -23
  7. package/Blog/BlogHeader/index.tsx +26 -23
  8. package/Blog/BlogList/index.tsx +7 -25
  9. package/Blog/BlogListItem/index.tsx +63 -52
  10. package/Blog/BlogTags/BlogTag.tsx +27 -0
  11. package/Blog/BlogTags/index.tsx +7 -32
  12. package/Blog/BlogTitle/index.tsx +7 -21
  13. package/Button/Button.tsx +5 -0
  14. package/Button/LinkOrButton.tsx +80 -0
  15. package/Button/index.tsx +2 -177
  16. package/CHANGELOG.md +490 -651
  17. package/ChipMenu/index.tsx +71 -77
  18. package/ContainerWithHeader/index.tsx +33 -30
  19. package/FlagAvatar/index.tsx +2 -12
  20. package/Footer/Footer.tsx +105 -88
  21. package/Footer/index.ts +0 -1
  22. package/Form/Form.tsx +35 -0
  23. package/Form/FormActions.tsx +9 -14
  24. package/Form/FormDivider.tsx +8 -13
  25. package/Form/FormHeader.tsx +5 -26
  26. package/Form/FormRow.tsx +8 -13
  27. package/Form/InputCheckmark.tsx +9 -22
  28. package/FramerScroller/SidebarGallery.tsx +340 -0
  29. package/FramerScroller/SidebarSlider.tsx +107 -0
  30. package/FramerScroller/index.ts +2 -0
  31. package/FullPageMessage/index.tsx +52 -48
  32. package/Highlight/index.tsx +1 -1
  33. package/IconHeader/index.tsx +63 -58
  34. package/JsonLd/index.tsx +3 -2
  35. package/Layout/components/LayoutHeader.tsx +75 -82
  36. package/Layout/components/LayoutHeaderBack.tsx +21 -12
  37. package/Layout/components/LayoutHeaderClose.tsx +9 -22
  38. package/Layout/components/LayoutHeaderContent.tsx +190 -154
  39. package/Layout/components/LayoutHeadertypes.ts +1 -1
  40. package/Layout/components/LayoutTitle.tsx +60 -55
  41. package/LayoutDefault/components/LayoutDefault.tsx +96 -85
  42. package/LayoutOverlay/components/LayoutOverlay.tsx +2 -8
  43. package/LayoutOverlay/components/LayoutOverlayBase.tsx +233 -239
  44. package/LayoutOverlay/test/LayoutOverlayDemo.tsx +1 -1
  45. package/LayoutParts/DesktopHeaderBadge.tsx +28 -0
  46. package/LayoutParts/DesktopNavActions.tsx +15 -0
  47. package/LayoutParts/DesktopNavBar.tsx +113 -0
  48. package/LayoutParts/DesktopNavBarItem.tsx +44 -0
  49. package/{AppShell → LayoutParts}/GlobalHead.tsx +1 -2
  50. package/LayoutParts/Logo.tsx +77 -0
  51. package/LayoutParts/MenuFab.tsx +131 -0
  52. package/LayoutParts/MenuFabItem.tsx +25 -0
  53. package/LayoutParts/MenuFabSecondaryItem.tsx +37 -0
  54. package/{AppShell/PlaceholderFab/index.tsx → LayoutParts/PlaceholderFab.tsx} +1 -1
  55. package/LayoutParts/StickyBelowHeader.tsx +25 -0
  56. package/LayoutParts/index.ts +12 -0
  57. package/{AppShell → LayoutParts}/useFabAnimation.ts +0 -0
  58. package/Page/CssAndFramerMotionProvider.tsx +21 -0
  59. package/Page/index.ts +2 -0
  60. package/Page/types.ts +2 -8
  61. package/PageLoadIndicator/index.tsx +25 -30
  62. package/PageMeta/index.tsx +1 -1
  63. package/Pagination/index.tsx +37 -54
  64. package/RenderType/index.tsx +1 -1
  65. package/Row/ButtonLinkList/ButtonLinkList.tsx +35 -37
  66. package/Row/ButtonLinkList/ButtonLinkListItem.tsx +16 -33
  67. package/Row/ColumnOne/index.tsx +5 -10
  68. package/Row/ColumnOneBoxed/index.tsx +18 -19
  69. package/Row/ColumnOneCentered/index.tsx +3 -4
  70. package/Row/ColumnThree/index.tsx +62 -57
  71. package/Row/ColumnTwo/index.tsx +37 -32
  72. package/Row/ColumnTwoSpread/index.tsx +28 -37
  73. package/Row/ColumnTwoWithTop/index.tsx +37 -43
  74. package/Row/ContentLinks/index.tsx +24 -25
  75. package/Row/HeroBanner/index.tsx +98 -82
  76. package/Row/IconBlocks/IconBlock/index.tsx +45 -37
  77. package/Row/IconBlocks/index.tsx +29 -44
  78. package/Row/ImageText/index.tsx +71 -67
  79. package/Row/ImageTextBoxed/index.tsx +66 -65
  80. package/Row/ParagraphWithSidebarSlide/index.tsx +80 -76
  81. package/Row/Quote/index.tsx +3 -3
  82. package/Row/SpecialBanner/index.tsx +97 -97
  83. package/Row/index.tsx +4 -9
  84. package/SectionContainer/index.tsx +32 -31
  85. package/SectionHeader/index.tsx +41 -43
  86. package/Separator/index.tsx +19 -18
  87. package/Snackbar/MessageSnackbar.tsx +1 -2
  88. package/Snackbar/MessageSnackbarImpl.tsx +68 -115
  89. package/StarRatingField/index.tsx +24 -25
  90. package/Stepper/Stepper.tsx +34 -32
  91. package/Styles/EmotionProvider.tsx +14 -0
  92. package/Styles/breakpointVal.tsx +16 -10
  93. package/Styles/extendableComponent.ts +70 -0
  94. package/Styles/index.tsx +9 -2
  95. package/Styles/withEmotionCache.tsx +36 -0
  96. package/Styles/withTheme.tsx +15 -24
  97. package/SvgIcon/SvgIcon.tsx +60 -0
  98. package/TextInputNumber/index.tsx +49 -50
  99. package/Theme/MuiButton.ts +128 -0
  100. package/Theme/MuiSlider.ts +28 -0
  101. package/Theme/MuiSnackbar.ts +31 -0
  102. package/Theme/{types.ts → createTheme.ts} +8 -2
  103. package/Theme/index.ts +4 -0
  104. package/Theme/themeDefaults.ts +51 -0
  105. package/TimeAgo/index.tsx +1 -1
  106. package/ToggleButton/index.tsx +43 -49
  107. package/ToggleButtonGroup/index.tsx +39 -39
  108. package/UspList/UspListItem.tsx +56 -46
  109. package/UspList/index.tsx +29 -26
  110. package/docs/building-components.mdx +3 -0
  111. package/docs/components/ComponentBasic.tsx +26 -0
  112. package/docs/components/ComponentChild.tsx +48 -0
  113. package/docs/components/ComponentChildVariant.tsx +54 -0
  114. package/docs/components/ComponentChildVariantExtendable.tsx +62 -0
  115. package/docs/components/ComponentStylable.tsx +32 -0
  116. package/docs/pages/building-components.tsx +62 -0
  117. package/index.ts +27 -81
  118. package/package.json +25 -27
  119. package/types.d.ts +1 -1
  120. package/AppShell/AppShellSticky/index.tsx +0 -38
  121. package/AppShell/DesktopNavActions.tsx +0 -32
  122. package/AppShell/DesktopNavBar.tsx +0 -158
  123. package/AppShell/Logo.tsx +0 -46
  124. package/AppShell/Menu.tsx +0 -7
  125. package/AppShell/MenuFab.tsx +0 -162
  126. package/AppShell/MenuFabSecondaryItem.tsx +0 -32
  127. package/AppShell/index.ts +0 -15
  128. package/AspectRatioContainer/index.tsx +0 -27
  129. package/Footer/SocialIcon.tsx +0 -23
  130. package/Form/index.tsx +0 -67
  131. package/FramerScroller/components/SidebarGallery.tsx +0 -317
  132. package/FramerScroller/components/SidebarSlider.tsx +0 -97
  133. package/Page/App.tsx +0 -17
  134. package/Page/Document.tsx +0 -24
  135. package/StyledBadge/index.tsx +0 -20
  136. package/Styles/classesPicker.ts +0 -41
  137. package/SvgImage/SvgImageSimple.tsx +0 -100
  138. package/SvgImage/index.tsx +0 -74
@@ -0,0 +1,62 @@
1
+ import { ExtendableComponent, extendableComponent } from '@graphcommerce/next-ui'
2
+ import { styled } from '@mui/material'
3
+ import { ComponentProps } from 'react'
4
+
5
+ // ---- Setup ----
6
+
7
+ // To be able to select children from the consuming side, we define the classes.
8
+ // Minimal utility to convert the classes to selectors. Hover over `selectors` to see what it means.
9
+ const componentName = 'MyComponent' as const
10
+ const { classes, selectors } = extendableComponent(componentName, ['root', 'child'] as const)
11
+
12
+ // Props that are used in our styled elements to render different CSS
13
+ type MyComponentStyleProps = { variant?: 'cool' | 'supercool' }
14
+
15
+ // Expose the component to be exendable in your theme.components
16
+ declare module '@mui/material/styles/components' {
17
+ interface Components {
18
+ MyComponent?: ExtendableComponent<MyComponentStyleProps>
19
+ }
20
+ }
21
+
22
+ // ---- Root component ----
23
+
24
+ // We're creating a new styled('div') component and apply our styles to it.
25
+ const Root = styled('div', {
26
+ name: componentName,
27
+ target: classes.root, // Adds a class name `MyComponent` to the div.
28
+ })<MyComponentStyleProps>(({ theme }) => ({
29
+ // Styles are added
30
+ display: 'flex',
31
+ color: theme.palette.text.primary,
32
+ }))
33
+
34
+ // ---- Child component ----
35
+
36
+ const Child = styled('div', {
37
+ name: componentName,
38
+ slot: 'child', // A slot is used as we do not want to receive style overrides from theme.components.MyComponent.variants.
39
+ target: classes.child, // Mandatory for children, adds a class name `MyComponent-child` so it can be styled from the outside.
40
+ })<MyComponentStyleProps>(({ theme, variant }) => ({
41
+ backgroundColor: theme.palette.primary.main,
42
+ width: 100,
43
+ height: 100,
44
+ fontSize: variant === 'supercool' ? 'large' : 'normal',
45
+ }))
46
+
47
+ // ---- MyComponent component ----
48
+
49
+ // Props of the component we are writing
50
+ export type MyComponentProps = Pick<ComponentProps<typeof Root>, 'sx' | 'children'> &
51
+ MyComponentStyleProps
52
+
53
+ export function MyComponent(props: MyComponentProps) {
54
+ const { sx, children, variant } = props
55
+ return (
56
+ <Root as='span' sx={sx} variant={variant}>
57
+ My Component <Child variant={variant}>{children}</Child>
58
+ </Root>
59
+ )
60
+ }
61
+
62
+ MyComponent.selectors = selectors
@@ -0,0 +1,32 @@
1
+ import { styled } from '@mui/material'
2
+ import React from 'react'
3
+
4
+ // ---- Setup ----
5
+
6
+ const name = 'MyComponent'
7
+
8
+ // ---- Root component ----
9
+
10
+ // We're creating a new styled('div') component and apply our styles to it.
11
+ const Root = styled('div', {
12
+ name, // Name of the component we are building, so 'MyComponent' in this example
13
+ })(({ theme }) => ({
14
+ padding: '3px',
15
+ display: 'flex',
16
+ color: theme.palette.text.primary,
17
+ }))
18
+
19
+ // ---- MyComponent component ----
20
+
21
+ // Props of the component we are writing
22
+ export type MyComponentProps = Pick<React.ComponentProps<typeof Root>, 'sx' | 'children'>
23
+
24
+ export function MyComponent(props: MyComponentProps) {
25
+ const { sx, children } = props
26
+ return (
27
+ <Root as='span' sx={sx}>
28
+ My Component
29
+ {children}
30
+ </Root>
31
+ )
32
+ }
@@ -0,0 +1,62 @@
1
+ import { ThemeProvider, Typography, useTheme } from '@mui/material'
2
+ import { MyComponent as ComponentChild } from '../components/ComponentChild'
3
+ import { MyComponent as ComponentChildVariant } from '../components/ComponentChildVariant'
4
+ import { MyComponent as ComponentChildVariantExtendable } from '../components/ComponentChildVariantExtendable'
5
+ import { MyComponent as ComponentStylable } from '../components/ComponentStylable'
6
+
7
+ export function UsingBasic() {
8
+ const theme = useTheme()
9
+
10
+ return (
11
+ <>
12
+ <Typography variant='h3'>Basic</Typography>
13
+
14
+ <ComponentStylable
15
+ sx={{
16
+ backgroundColor: 'primary.main',
17
+ }}
18
+ >
19
+ Component Stylable
20
+ </ComponentStylable>
21
+
22
+ <Typography variant='h3'>With a child</Typography>
23
+
24
+ <ComponentChild
25
+ sx={{
26
+ backgroundColor: 'secondary.main',
27
+ [ComponentChild.selectors.child]: {
28
+ backgroundColor: 'secondary.dark',
29
+ },
30
+ }}
31
+ >
32
+ Component with a child
33
+ </ComponentChild>
34
+
35
+ <Typography variant='h3'>With a variant</Typography>
36
+
37
+ <ComponentChildVariant variant='supercool'>Component Child Variant</ComponentChildVariant>
38
+
39
+ <Typography variant='h3'>With a variant and extendable</Typography>
40
+
41
+ <ThemeProvider
42
+ theme={{
43
+ ...theme,
44
+ components: {
45
+ ...theme.components,
46
+ MyComponent: {
47
+ styleOverrides: {
48
+ root: {
49
+ fontSize: '120%',
50
+ },
51
+ },
52
+ },
53
+ },
54
+ }}
55
+ >
56
+ <ComponentChildVariantExtendable>
57
+ Component Child Variant but extendable
58
+ </ComponentChildVariantExtendable>
59
+ </ThemeProvider>
60
+ </>
61
+ )
62
+ }
package/index.ts CHANGED
@@ -1,123 +1,69 @@
1
- export * from './AppShell'
2
- export * from './Layout'
3
- export * from './LayoutDefault'
4
- export * from './LayoutOverlay'
5
- export * from './Footer'
6
-
7
1
  export * from './AnimatedRow'
8
- export { default as AnimatedRow } from './AnimatedRow'
9
2
  export * from './ApolloError'
10
- export * from './AspectRatioContainer'
11
- export { default as AspectRationContainer } from './AspectRatioContainer'
3
+ export * from './Blog/BlogAuthor'
12
4
  export * from './Blog/BlogContent'
13
- export { default as BlogContent } from './Blog/BlogContent'
14
5
  export * from './Blog/BlogHeader'
15
- export { default as BlogHeader } from './Blog/BlogHeader'
16
- export * from './Blog/BlogTitle'
17
- export { default as BlogTitle } from './Blog/BlogTitle'
18
- export { default as BlogTags } from './Blog/BlogTags'
19
- export * from './Blog/BlogAuthor'
20
- export { default as BlogAuthor } from './Blog/BlogAuthor'
21
6
  export * from './Blog/BlogList'
22
- export { default as BlogList } from './Blog/BlogList'
23
7
  export * from './Blog/BlogListItem'
24
- export { default as BlogListItem } from './Blog/BlogListItem'
8
+ export * from './Blog/BlogTags'
9
+ export * from './Blog/BlogTitle'
25
10
  export * from './Button'
26
- export { default as Button } from './Button'
27
-
28
11
  export * from './ChipMenu'
29
- export { default as ChipMenu } from './ChipMenu'
30
12
  export * from './ContainerWithHeader'
31
- export { default as ContainerWithHeader } from './ContainerWithHeader'
32
13
  export * from './FlagAvatar'
33
- export { default as FlagAvatar } from './FlagAvatar'
34
- export * from './Form'
35
- export { default as FormActions } from './Form/FormActions'
36
- export { default as FormDivider } from './Form/FormDivider'
14
+ export * from './Footer'
15
+ export * from './Form/Form'
16
+ export * from './Form/FormActions'
17
+ export * from './Form/FormDivider'
37
18
  export * from './Form/FormHeader'
38
- export { default as FormHeader } from './Form/FormHeader'
39
- export { default as FormRow } from './Form/FormRow'
19
+ export * from './Form/FormRow'
40
20
  export * from './Form/InputCheckmark'
41
- export { default as InputCheckmark } from './Form/InputCheckmark'
42
- export * from './FramerScroller/components/SidebarGallery'
43
- export { default as SidebarGallery } from './FramerScroller/components/SidebarGallery'
44
- export * from './FramerScroller/components/SidebarSlider'
45
- export { default as SidebarSlider } from './FramerScroller/components/SidebarSlider'
21
+ export * from './FramerScroller'
46
22
  export * from './FullPageMessage'
47
- export { default as FullPageMessage } from './FullPageMessage'
48
- export { default as Highlight } from './Highlight'
23
+ export * from './Highlight'
49
24
  export * from './IconHeader'
50
- export { default as IconHeader } from './IconHeader'
51
25
  export * from './icons'
52
26
  export * from './JsonLd'
53
- export { default as JsonLd } from './JsonLd'
54
- export { default as App } from './Page/App'
55
- export * from './Page/types'
56
- export { default as PageLoadIndicator } from './PageLoadIndicator'
27
+ export * from './Layout'
28
+ export * from './LayoutDefault'
29
+ export * from './LayoutOverlay'
30
+ export * from './LayoutParts'
31
+ export * from './Page'
32
+ export * from './PageLoadIndicator'
57
33
  export * from './PageMeta'
58
- export { default as PageMeta } from './PageMeta'
59
34
  export * from './Pagination'
60
- export { default as Pagination } from './Pagination'
61
35
  export * from './RenderType'
62
- export { default as RenderType } from './RenderType'
63
- export { default as Row } from './Row'
36
+ export * from './Row'
64
37
  export * from './Row/ButtonLinkList'
65
- export { default as ColumnOne } from './Row/ColumnOne'
66
- export { default as ColumnOneBoxed } from './Row/ColumnOneBoxed'
67
- export { default as ColumnOneCentered } from './Row/ColumnOneCentered'
38
+ export * from './Row/ColumnOne'
39
+ export * from './Row/ColumnOneBoxed'
40
+ export * from './Row/ColumnOneCentered'
68
41
  export * from './Row/ColumnThree'
69
- export { default as ColumnThree } from './Row/ColumnThree'
70
42
  export * from './Row/ColumnTwo'
71
- export { default as ColumnTwo } from './Row/ColumnTwo'
72
43
  export * from './Row/ColumnTwoSpread'
73
- export { default as ColumnTwoSpread } from './Row/ColumnTwoSpread'
74
44
  export * from './Row/ColumnTwoWithTop'
75
- export { default as ColumnTwoWithTop } from './Row/ColumnTwoWithTop'
76
45
  export * from './Row/ContentLinks'
77
- export { default as ContentLinks } from './Row/ContentLinks'
78
46
  export * from './Row/HeroBanner'
79
- export { default as HeroBanner } from './Row/HeroBanner'
80
47
  export * from './Row/IconBlocks'
81
- export { default as IconBlocks } from './Row/IconBlocks'
82
48
  export * from './Row/IconBlocks/IconBlock'
83
- export { default as IconBlock } from './Row/IconBlocks/IconBlock'
84
- export * from './Row/ParagraphWithSidebarSlide'
85
- export { default as ParagraphWithSidebarSlide } from './Row/ParagraphWithSidebarSlide'
86
- export * from './Row/Quote'
87
- export { default as Quote } from './Row/Quote'
88
49
  export * from './Row/ImageText'
89
- export { default as ImageText } from './Row/ImageText'
90
50
  export * from './Row/ImageTextBoxed'
91
- export { default as ImageTextBoxed } from './Row/ImageTextBoxed'
51
+ export * from './Row/ParagraphWithSidebarSlide'
52
+ export * from './Row/Quote'
92
53
  export * from './Row/SpecialBanner'
93
- export { default as SpecialBanner } from './Row/SpecialBanner'
94
54
  export * from './SectionContainer'
95
- export { default as SectionContainer } from './SectionContainer'
96
55
  export * from './SectionHeader'
97
- export { default as SectionHeader } from './SectionHeader'
98
56
  export * from './Separator'
99
- export { default as Separator } from './Separator'
100
- export { default as MessageSnackbar } from './Snackbar/MessageSnackbar'
57
+ export * from './Snackbar/MessageSnackbar'
101
58
  export * from './Snackbar/MessageSnackbarImpl'
102
- export { default as MessageSnackbarImpl } from './Snackbar/MessageSnackbarImpl'
103
59
  export * from './StarRatingField'
104
- export { default as StarRatingField } from './StarRatingField'
105
60
  export * from './Stepper/Stepper'
106
- export { default as Stepper } from './Stepper/Stepper'
107
- export { default as StyledBadge } from './StyledBadge'
108
61
  export * from './Styles'
109
- export * from './SvgImage'
110
- export { default as SvgImage } from './SvgImage'
111
- export { default as SvgImageSimple } from './SvgImage/SvgImageSimple'
62
+ export * from './SvgIcon/SvgIcon'
112
63
  export * from './TextInputNumber'
113
- export { default as TextInputNumber } from './TextInputNumber'
64
+ export * from './Theme'
114
65
  export * from './TimeAgo'
115
- export { default as TimeAgo } from './TimeAgo'
116
- export { default as ToggleButton } from './ToggleButton'
117
- export type { ToggleButtonProps } from './ToggleButton'
118
- export { default as ToggleButtonGroup } from './ToggleButtonGroup'
119
- export type { ToggleButtonPropsBase } from './ToggleButtonGroup'
66
+ export * from './ToggleButton'
67
+ export * from './ToggleButtonGroup'
120
68
  export * from './UspList'
121
- export { default as UspList } from './UspList'
122
69
  export * from './UspList/UspListItem'
123
- export { default as UspListItem } from './UspList/UspListItem'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphcommerce/next-ui",
3
- "version": "3.25.3",
3
+ "version": "4.0.0",
4
4
  "author": "",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -9,47 +9,45 @@
9
9
  "start": "next start"
10
10
  },
11
11
  "dependencies": {
12
- "@apollo/client": "^3.5.6",
13
- "@graphcommerce/framer-next-pages": "^2.109.2",
14
- "@graphcommerce/framer-scroller": "^1.2.12",
15
- "@graphcommerce/framer-utils": "^2.103.21",
16
- "@graphcommerce/graphql": "^2.105.13",
17
- "@graphcommerce/image": "^2.105.13",
18
- "@lingui/macro": "^3.13.0",
19
- "@material-ui/core": "^4.12.3",
20
- "@material-ui/lab": "^4.0.0-alpha.60",
21
- "@material-ui/styles": "^4.11.4",
22
- "clsx": "^1.1.1",
23
- "framer-motion": "^5.5.5",
24
- "graphql": "^16.2.0",
25
- "next": "^12.0.7",
12
+ "@emotion/babel-preset-css-prop": "^11.2.0",
13
+ "@emotion/cache": "^11.7.1",
14
+ "@emotion/react": "^11.7.1",
15
+ "@emotion/server": "^11.4.0",
16
+ "@emotion/styled": "^11.6.0",
17
+ "@graphcommerce/framer-next-pages": "^3.0.0",
18
+ "@graphcommerce/framer-scroller": "^2.0.0",
19
+ "@graphcommerce/framer-utils": "^3.0.0",
20
+ "@graphcommerce/graphql": "^3.0.0",
21
+ "@graphcommerce/image": "^3.0.0",
22
+ "@lingui/macro": "^3.13.2",
23
+ "@mui/base": "^5.0.0-alpha.68",
24
+ "@mui/lab": "^5.0.0-alpha.68",
25
+ "@mui/material": "^5.4.1",
26
+ "framer-motion": "^6.2.4",
27
+ "graphql": "^16.3.0",
28
+ "next": "^12.0.10",
26
29
  "react": "^17.0.2",
27
30
  "react-dom": "^17.0.2",
28
31
  "react-is": "^17.0.2",
29
32
  "react-schemaorg": "^2.0.0",
30
33
  "schema-dts": "^1.0.0",
31
- "type-fest": "^2.8.0"
34
+ "type-fest": "^2.11.2"
32
35
  },
33
36
  "devDependencies": {
34
- "@graphcommerce/browserslist-config-pwa": "^3.0.3",
35
- "@graphcommerce/eslint-config-pwa": "^3.1.10",
36
- "@graphcommerce/prettier-config-pwa": "^3.0.5",
37
- "@graphcommerce/typescript-config-pwa": "^3.1.2",
38
- "@playwright/test": "^1.17.1",
37
+ "@graphcommerce/eslint-config-pwa": "^4.0.0",
38
+ "@graphcommerce/prettier-config-pwa": "^4.0.0",
39
+ "@graphcommerce/typescript-config-pwa": "^4.0.0",
40
+ "@playwright/test": "^1.18.1",
39
41
  "@types/react-is": "^17.0.3",
40
42
  "graphql-tag": "2.12.6",
41
- "typescript": "^4.5.4"
43
+ "typescript": "^4.5.5"
42
44
  },
43
45
  "sideEffects": false,
44
46
  "prettier": "@graphcommerce/prettier-config-pwa",
45
- "browserslist": [
46
- "extends @graphcommerce/browserslist-config-pwa"
47
- ],
48
47
  "eslintConfig": {
49
48
  "extends": "@graphcommerce/eslint-config-pwa",
50
49
  "parserOptions": {
51
50
  "project": "./tsconfig.json"
52
51
  }
53
- },
54
- "gitHead": "41e42c8cd6f565ab0cbba81a1954a0041dc46768"
52
+ }
55
53
  }
package/types.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  /// <reference types="next/types/global" />
3
3
  /// <reference types="next/image-types/global" />
4
4
 
5
- import './Theme/types'
5
+ import './Theme/createTheme'
6
6
  // eslint-disable-next-line react/no-typos
7
7
  import 'react'
8
8
 
@@ -1,38 +0,0 @@
1
- import { Container, makeStyles, Theme } from '@material-ui/core'
2
- import React from 'react'
3
- import { UseStyles } from '../../Styles'
4
-
5
- const useStyles = makeStyles(
6
- (theme: Theme) => ({
7
- root: {
8
- position: 'sticky',
9
- top: theme.appShell.headerHeightSm,
10
- zIndex: 96,
11
- [theme.breakpoints.up('md')]: {
12
- top: `${theme.page.vertical} !important`,
13
- },
14
- },
15
- }),
16
- { name: 'AppShellSticky' },
17
- )
18
-
19
- type AppShellStickyBaseProps = {
20
- children: React.ReactNode
21
- }
22
-
23
- type AppShellStickyProps = AppShellStickyBaseProps & UseStyles<typeof useStyles>
24
-
25
- /*
26
- - makes the children sticky to the parent container
27
- - determines top offset based on header height dynamically
28
- */
29
- export default function AppShellSticky(props: AppShellStickyProps) {
30
- const { children } = props
31
- const classes = useStyles(props)
32
-
33
- return (
34
- <Container maxWidth={false} className={classes.root}>
35
- <>{children}</>
36
- </Container>
37
- )
38
- }
@@ -1,32 +0,0 @@
1
- import { makeStyles, Theme } from '@material-ui/core'
2
- import React from 'react'
3
- import { UseStyles } from '../Styles'
4
-
5
- const useStyles = makeStyles(
6
- (theme: Theme) => ({
7
- actions: {
8
- display: 'none',
9
- [theme.breakpoints.up('md')]: {
10
- display: 'grid',
11
- pointerEvents: 'none !important',
12
- '& > *': {
13
- pointerEvents: 'all',
14
- },
15
- alignItems: 'center',
16
- gridAutoFlow: 'column',
17
- columnGap: 6,
18
- },
19
- },
20
- }),
21
- { name: 'DesktopNavActions' },
22
- )
23
-
24
- export default function DesktopNavActions(
25
- props: {
26
- children?: React.ReactNode
27
- } & UseStyles<typeof useStyles>,
28
- ) {
29
- const { children } = props
30
- const classes = useStyles(props)
31
- return <div className={classes.actions}>{children}</div>
32
- }
@@ -1,158 +0,0 @@
1
- import { Scroller, ScrollerButton, ScrollerProvider } from '@graphcommerce/framer-scroller'
2
- import { Link, LinkProps as MuiLinkProps, makeStyles, Theme } from '@material-ui/core'
3
- import clsx from 'clsx'
4
- import { m } from 'framer-motion'
5
- import PageLink from 'next/link'
6
- import { useRouter } from 'next/router'
7
- import React from 'react'
8
- import { UseStyles } from '../Styles'
9
- import SvgImageSimple from '../SvgImage/SvgImageSimple'
10
- import { iconChevronLeft, iconChevronRight } from '../icons'
11
- import { MenuProps } from './Menu'
12
-
13
- const useStyles = makeStyles(
14
- (theme: Theme) => ({
15
- container: {
16
- minWidth: 200,
17
- flex: 1,
18
- position: 'relative',
19
- pointerEvents: 'all',
20
- [theme.breakpoints.down('sm')]: {
21
- display: 'none',
22
- },
23
- },
24
- scroller: {
25
- display: 'grid',
26
- columnGap: 40,
27
- padding: '0 40px',
28
- minHeight: 40,
29
- gridAutoColumns: 'min-content',
30
- },
31
- prevNextBtnWrapper: {
32
- position: 'absolute',
33
- top: 0,
34
- },
35
- left: {
36
- left: 0,
37
- },
38
- right: {
39
- right: 0,
40
- },
41
- prevNextBtn: {
42
- pointerEvents: 'all',
43
- background: theme.palette.background.default,
44
- boxShadow: 'none',
45
- height: 48,
46
- [theme.breakpoints.down('sm')]: {
47
- display: 'none',
48
- },
49
- },
50
- prevBtn: {
51
- borderTopLeftRadius: 0,
52
- borderBottomLeftRadius: 0,
53
- },
54
- nextBtn: {
55
- borderTopRightRadius: 0,
56
- borderBottomRightRadius: 0,
57
- },
58
- link: {
59
- whiteSpace: 'nowrap',
60
- color: theme.palette.text.primary,
61
- '&:hover': {
62
- textDecoration: 'none',
63
- },
64
- fontWeight: theme.typography.fontWeightBold,
65
- paddingTop: 6,
66
- },
67
- line: {
68
- maxWidth: 40,
69
- width: '100%',
70
- display: 'flex',
71
- justifyContent: 'center',
72
- height: 2,
73
- background: theme.palette.primary.main,
74
- margin: '0 auto',
75
- marginTop: 6,
76
- opacity: 0,
77
- },
78
- lineShow: {
79
- opacity: 1,
80
- },
81
- }),
82
- { name: 'DesktopNavBar' },
83
- )
84
-
85
- export type MenuTabsProps = MenuProps &
86
- UseStyles<typeof useStyles> & {
87
- LinkProps?: MuiLinkProps
88
- iconScrollerBtnLeft?: React.ReactNode
89
- iconScrollerBtnRight?: React.ReactNode
90
- }
91
-
92
- export default function DesktopNavBar(props: MenuTabsProps) {
93
- const { menu, LinkProps, iconScrollerBtnLeft, iconScrollerBtnRight } = props
94
- const classes = useStyles(props)
95
- const router = useRouter()
96
-
97
- return (
98
- <ScrollerProvider scrollSnapAlign='none'>
99
- <div className={classes.container}>
100
- <Scroller className={classes.scroller} hideScrollbar>
101
- {menu.map(({ href, children, ...linkProps }) => (
102
- <PageLink key={href.toString()} href={href} {...linkProps} passHref>
103
- <Link
104
- variant='subtitle1'
105
- {...LinkProps}
106
- className={clsx(classes.link, LinkProps?.className)}
107
- >
108
- {children}
109
- <div
110
- className={clsx(
111
- classes.line,
112
- router.asPath.startsWith(href.toString()) && classes.lineShow,
113
- )}
114
- />
115
- </Link>
116
- </PageLink>
117
- ))}
118
- </Scroller>
119
-
120
- <m.div className={clsx(classes.prevNextBtnWrapper, classes.left)}>
121
- <ScrollerButton
122
- direction='left'
123
- size='small'
124
- classes={{ root: clsx(classes.prevNextBtn, classes.prevBtn) }}
125
- >
126
- {iconScrollerBtnLeft ?? <SvgImageSimple src={iconChevronLeft} />}
127
- </ScrollerButton>
128
- </m.div>
129
-
130
- <m.div className={clsx(classes.prevNextBtnWrapper, classes.right)}>
131
- <ScrollerButton
132
- direction='right'
133
- size='small'
134
- classes={{ root: clsx(classes.prevNextBtn, classes.nextBtn) }}
135
- >
136
- {iconScrollerBtnRight ?? <SvgImageSimple src={iconChevronRight} />}
137
- </ScrollerButton>
138
- </m.div>
139
- </div>
140
-
141
- {/* <ScrollerButton
142
- direction='left'
143
- size='small'
144
- className={clsx(classes.prevNext, classes.prev)}
145
- >
146
- <SvgImageSimple src={iconChevronLeft} />
147
- </ScrollerButton>
148
-
149
- <ScrollerButton
150
- direction='right'
151
- size='small'
152
- className={clsx(classes.prevNext, classes.next)}
153
- >
154
- <SvgImageSimple src={iconChevronRight} />
155
- </ScrollerButton> */}
156
- </ScrollerProvider>
157
- )
158
- }