@graphcommerce/next-ui 9.0.0-canary.98 → 9.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 (189) hide show
  1. package/ActionCard/ActionCard.tsx +219 -203
  2. package/ActionCard/ActionCardAccordion.tsx +4 -2
  3. package/ActionCard/ActionCardLayout.tsx +3 -2
  4. package/ActionCard/ActionCardList.tsx +6 -5
  5. package/Blog/BlogAuthor/BlogAuthor.tsx +5 -4
  6. package/Blog/BlogContent/BlogContent.tsx +3 -2
  7. package/Blog/BlogHeader/BlogHeader.tsx +4 -3
  8. package/Blog/BlogList/BlogList.tsx +3 -3
  9. package/Blog/BlogListItem/BlogListItem.tsx +6 -5
  10. package/Blog/BlogTags/BlogTag.tsx +3 -2
  11. package/Blog/BlogTags/BlogTags.tsx +1 -1
  12. package/Breadcrumbs/Breadcrumbs.tsx +25 -19
  13. package/Breadcrumbs/BreadcrumbsList.tsx +3 -2
  14. package/Breadcrumbs/jsonLdBreadcrumb.tsx +1 -1
  15. package/Breadcrumbs/types.ts +1 -2
  16. package/Button/Button.tsx +2 -1
  17. package/Button/LinkOrButton.tsx +4 -2
  18. package/CHANGELOG.md +294 -1342
  19. package/ChipMenu/ChipMenu.tsx +3 -2
  20. package/Config.graphqls +28 -10
  21. package/Container/Container.tsx +90 -0
  22. package/ContainerWithHeader/ContainerWithHeader.tsx +2 -1
  23. package/Document/DocumentBodyEnd.tsx +1 -1
  24. package/Document/DocumentBodyStart.tsx +1 -1
  25. package/Document/DocumentHeadEnd.tsx +1 -1
  26. package/Document/DocumentHeadStart.tsx +1 -1
  27. package/Fab/Fab.tsx +15 -17
  28. package/FlagAvatar/FlagAvatar.tsx +2 -1
  29. package/Footer/Footer.tsx +14 -10
  30. package/Form/Form.tsx +2 -1
  31. package/Form/FormHeader.tsx +1 -1
  32. package/Form/FormRow.tsx +1 -1
  33. package/Form/InputCheckmark.tsx +2 -1
  34. package/FramerScroller/ItemScroller.tsx +5 -8
  35. package/FramerScroller/SidebarGallery.tsx +23 -30
  36. package/FramerScroller/SidebarSlider.tsx +8 -7
  37. package/FullPageMessage/FullPageMessage.tsx +2 -1
  38. package/IconHeader/IconHeader.tsx +5 -3
  39. package/IconSvg/IconSvg.tsx +8 -7
  40. package/Intl/DateTimeFormat/DateFormat.tsx +6 -4
  41. package/Intl/DateTimeFormat/DateTimeFormat.tsx +10 -14
  42. package/Intl/DateTimeFormat/TimeFormat.tsx +6 -4
  43. package/Intl/DateTimeFormat/index.ts +1 -0
  44. package/Intl/DateTimeFormat/useIntlDateTimeFormat.ts +13 -0
  45. package/Intl/DisplayNames/DisplayNames.tsx +5 -13
  46. package/Intl/DisplayNames/index.ts +1 -0
  47. package/Intl/DisplayNames/useIntlDisplayNames.ts +12 -0
  48. package/Intl/{ListFormat.tsx → ListFormat/ListFormat.tsx} +8 -13
  49. package/Intl/ListFormat/index.ts +2 -0
  50. package/Intl/ListFormat/useIntlListFormat.ts +15 -0
  51. package/Intl/NumberFormat/CurrencyFormat.tsx +4 -2
  52. package/Intl/NumberFormat/NumberFormat.tsx +15 -17
  53. package/Intl/NumberFormat/PercentFormat.tsx +6 -2
  54. package/Intl/NumberFormat/UnitFormat.tsx +5 -5
  55. package/Intl/NumberFormat/index.ts +1 -0
  56. package/Intl/NumberFormat/useIntlNumberFormat.ts +17 -0
  57. package/Intl/RelativeTimeFormat/RelativeTimeFormat.tsx +6 -13
  58. package/Intl/RelativeTimeFormat/RelativeToTimeFormat.tsx +4 -2
  59. package/Intl/RelativeTimeFormat/index.ts +1 -0
  60. package/Intl/RelativeTimeFormat/useIntlRelativeTimeFormat.ts +15 -0
  61. package/Intl/useIntlLocalesArgument.ts +16 -0
  62. package/Layout/components/LayoutHeader.tsx +7 -4
  63. package/Layout/components/LayoutHeaderBack.tsx +6 -4
  64. package/Layout/components/LayoutHeaderClose.tsx +1 -1
  65. package/Layout/components/LayoutHeaderContent.tsx +11 -12
  66. package/Layout/components/LayoutProvider.tsx +1 -1
  67. package/Layout/components/LayoutTitle.tsx +5 -3
  68. package/Layout/context/layoutContext.tsx +1 -1
  69. package/Layout/types.ts +1 -1
  70. package/LayoutDefault/components/LayoutDefault.tsx +12 -10
  71. package/LayoutOverlay/components/LayoutOverlay.tsx +3 -2
  72. package/LayoutOverlay/components/LayoutOverlayHeader.tsx +2 -1
  73. package/LayoutOverlay/test/LayoutOverlayDemo.tsx +4 -1
  74. package/LayoutParts/DesktopHeaderBadge.tsx +2 -1
  75. package/LayoutParts/DesktopNavBar.tsx +26 -22
  76. package/LayoutParts/DesktopNavBarItem.tsx +11 -7
  77. package/LayoutParts/Logo.tsx +5 -5
  78. package/LayoutParts/MenuFab.tsx +7 -13
  79. package/LayoutParts/MenuFabItem.tsx +6 -1
  80. package/LayoutParts/MenuFabSecondaryItem.tsx +11 -7
  81. package/LayoutParts/MobileTopRight.tsx +24 -0
  82. package/LayoutParts/PlaceholderFab.tsx +2 -1
  83. package/LayoutParts/StickyBelowHeader.tsx +2 -1
  84. package/LayoutParts/index.ts +1 -0
  85. package/LazyHydrate/LazyHydrate.tsx +18 -21
  86. package/MediaQuery/MediaQuery.tsx +111 -0
  87. package/MediaQuery/index.ts +1 -0
  88. package/Navigation/components/NavigationFab.tsx +3 -2
  89. package/Navigation/components/NavigationItem.tsx +3 -3
  90. package/Navigation/components/NavigationList.tsx +4 -3
  91. package/Navigation/components/NavigationOverlay.tsx +18 -11
  92. package/Navigation/components/NavigationProvider.tsx +9 -8
  93. package/Navigation/components/NavigationTitle.tsx +5 -5
  94. package/Navigation/hooks/useNavigation.ts +4 -2
  95. package/Overlay/components/Overlay.tsx +3 -2
  96. package/Overlay/components/OverlayBase.tsx +71 -30
  97. package/Overlay/components/OverlayContainer.tsx +2 -2
  98. package/Overlay/components/OverlayHeader.tsx +7 -4
  99. package/Overlay/components/OverlaySsr.tsx +2 -1
  100. package/Overlay/components/OverlayStickyBottom.tsx +2 -1
  101. package/Overlay/utils/variantsToScrollSnapType.ts +2 -2
  102. package/OverlayOrPopperChip/OverlayOrPopperChip.tsx +5 -12
  103. package/OverlayOrPopperChip/OverlayOrPopperPanel.tsx +3 -3
  104. package/OverlayOrPopperChip/OverlayPanel.tsx +13 -7
  105. package/OverlayOrPopperChip/OverlayPanelActions.tsx +2 -2
  106. package/OverlayOrPopperChip/PopperPanel.tsx +3 -2
  107. package/OverlayOrPopperChip/PopperPanelActions.tsx +2 -2
  108. package/OverlayOrPopperChip/types.ts +2 -2
  109. package/OverlayOrPopperChip/useHandleClickNotDrag.ts +3 -1
  110. package/Page/CssAndFramerMotionProvider.tsx +2 -1
  111. package/Page/types.ts +5 -5
  112. package/PageLoadIndicator/PageLoadIndicator.tsx +3 -2
  113. package/PageMeta/PageMeta.tsx +3 -2
  114. package/PageMeta/canonicalize.ts +7 -3
  115. package/Pagination/Pagination.tsx +4 -2
  116. package/Pagination/PaginationExtended.tsx +2 -9
  117. package/RenderType/RenderType.tsx +6 -0
  118. package/Row/ButtonLinkList/ButtonLinkList.tsx +4 -7
  119. package/Row/ButtonLinkList/ButtonLinkListItem.tsx +2 -1
  120. package/Row/ColumnOne/variant/VariantMessage.tsx +2 -4
  121. package/Row/ColumnOneBoxed/ColumnOneBoxed.tsx +4 -2
  122. package/Row/ColumnOneCentered/ColumnOneCentered.tsx +4 -2
  123. package/Row/ColumnThree/ColumnThree.tsx +6 -5
  124. package/Row/ColumnTwo/ColumnTwo.tsx +8 -7
  125. package/Row/ColumnTwoSpread/ColumnTwoSpread.tsx +7 -5
  126. package/Row/ColumnTwoWithTop/ColumnTwoWithTop.tsx +5 -4
  127. package/Row/ContentLinks/ContentLinks.tsx +4 -3
  128. package/Row/HeroBanner/HeroBanner.tsx +3 -2
  129. package/Row/IconBlocks/IconBlock.tsx +3 -2
  130. package/Row/IconBlocks/IconBlocks.tsx +3 -2
  131. package/Row/ImageText/ImageText.tsx +3 -2
  132. package/Row/ImageTextBoxed/ImageTextBoxed.tsx +4 -3
  133. package/Row/ParagraphWithSidebarSlide/ParagraphWithSidebarSlide.tsx +3 -2
  134. package/Row/Quote/Quote.tsx +1 -1
  135. package/Row/Row.tsx +2 -1
  136. package/Row/RowLinks/RowLinks.tsx +36 -34
  137. package/Row/RowLinks/variant/VariantImageLabelSwiper.tsx +6 -2
  138. package/Row/RowLinks/variant/VariantInline.tsx +6 -2
  139. package/Row/RowLinks/variant/VariantLogoSwiper.tsx +2 -1
  140. package/Row/RowLinks/variant/VariantUsps.tsx +2 -1
  141. package/Row/SpecialBanner/SpecialBanner.tsx +3 -2
  142. package/SectionContainer/SectionContainer.tsx +3 -2
  143. package/SectionHeader/SectionHeader.tsx +2 -1
  144. package/Separator/Separator.tsx +3 -2
  145. package/Snackbar/DismissibleSnackbar.tsx +1 -1
  146. package/Snackbar/ErrorSnackbar.tsx +1 -1
  147. package/Snackbar/MessageSnackbarImpl.tsx +7 -16
  148. package/StarRatingField/StarRatingField.tsx +3 -2
  149. package/Stepper/Stepper.tsx +3 -2
  150. package/Styles/__tests__/spreadVal.test.ts +4 -4
  151. package/Styles/extendableComponent.ts +4 -3
  152. package/Styles/withEmotionCache.tsx +2 -2
  153. package/Styles/withTheme.tsx +4 -1
  154. package/TextInputNumber/TextInputNumber.tsx +5 -8
  155. package/Theme/DarkLightModeThemeProvider.tsx +10 -7
  156. package/Theme/MuiButton.ts +2 -1
  157. package/Theme/MuiChip.ts +2 -1
  158. package/Theme/MuiFab.ts +2 -1
  159. package/Theme/MuiSlider.ts +3 -3
  160. package/Theme/MuiSnackbar.ts +1 -1
  161. package/Theme/NextLink.tsx +35 -15
  162. package/Theme/createTheme.ts +6 -0
  163. package/Theme/index.ts +1 -0
  164. package/Theme/themeDefaults.ts +10 -10
  165. package/Theme/useContainerSizing.ts +20 -0
  166. package/TimeAgo/TimeAgo.tsx +3 -3
  167. package/ToggleButton/ToggleButton.tsx +6 -4
  168. package/ToggleButtonGroup/ToggleButtonGroup.tsx +99 -94
  169. package/UspList/UspList.tsx +3 -2
  170. package/UspList/UspListItem.tsx +3 -2
  171. package/hooks/memoDeep.ts +3 -2
  172. package/hooks/useDateTimeFormat.ts +3 -1
  173. package/hooks/useMatchMedia.ts +2 -1
  174. package/hooks/useMemoDeep.ts +2 -1
  175. package/hooks/useNumberFormat.ts +3 -1
  176. package/index.ts +3 -1
  177. package/package.json +17 -18
  178. package/utils/cookie.ts +4 -3
  179. package/utils/robots.ts +1 -1
  180. package/utils/sitemap.ts +3 -2
  181. package/utils/sxx.ts +16 -0
  182. package/AnimatedRow/AnimatedRow.tsx +0 -23
  183. package/docs/building-components.mdx +0 -3
  184. package/docs/components/ComponentBasic.tsx +0 -26
  185. package/docs/components/ComponentChild.tsx +0 -49
  186. package/docs/components/ComponentChildVariant.tsx +0 -55
  187. package/docs/components/ComponentChildVariantExtendable.tsx +0 -63
  188. package/docs/components/ComponentStylable.tsx +0 -32
  189. package/docs/pages/building-components.tsx +0 -62
@@ -1,7 +1,8 @@
1
1
  import { usePageContext } from '@graphcommerce/framer-next-pages'
2
- import Head from 'next/head'
3
2
  import type {} from '@graphcommerce/next-config'
4
- import { Canonical, useCanonical } from './canonicalize'
3
+ import Head from 'next/head'
4
+ import type { Canonical } from './canonicalize'
5
+ import { useCanonical } from './canonicalize'
5
6
 
6
7
  // https://developers.google.com/search/docs/advanced/robots/robots_meta_tag#directives
7
8
  export type MetaRobots =
@@ -1,10 +1,11 @@
1
+ import type {} from '@graphcommerce/next-config'
1
2
  import { addBasePath } from 'next/dist/client/add-base-path'
2
3
  import { addLocale } from 'next/dist/client/add-locale'
3
4
  import { getDomainLocale } from 'next/dist/client/get-domain-locale'
4
5
  import { resolveHref } from 'next/dist/client/resolve-href'
5
- import { NextRouter } from 'next/dist/shared/lib/router/router'
6
- import type {} from '@graphcommerce/next-config'
6
+ import type { NextRouter } from 'next/dist/shared/lib/router/router'
7
7
  import { useRouter } from 'next/router'
8
+ import type { LiteralUnion } from 'type-fest'
8
9
  import { storefrontConfig } from '../utils/storefrontConfig'
9
10
 
10
11
  type PartialNextRouter = Pick<
@@ -70,7 +71,10 @@ export function canonicalize(router: PartialNextRouter, incoming?: Canonical) {
70
71
  return canonical
71
72
  }
72
73
 
73
- export type Canonical = `http://${string}` | `https://${string}` | `/${string}` | string
74
+ export type Canonical = LiteralUnion<
75
+ `http://${string}` | `https://${string}` | `/${string}`,
76
+ string
77
+ >
74
78
 
75
79
  export function useCanonical(incoming?: Canonical) {
76
80
  const router = useRouter()
@@ -1,6 +1,8 @@
1
1
  import { Trans } from '@lingui/react'
2
- import { PaginationProps, Box, SxProps, Theme, IconButton } from '@mui/material'
3
- import usePagination, { UsePaginationItem } from '@mui/material/usePagination'
2
+ import type { PaginationProps, SxProps, Theme } from '@mui/material'
3
+ import { Box, IconButton } from '@mui/material'
4
+ import type { UsePaginationItem } from '@mui/material/usePagination'
5
+ import usePagination from '@mui/material/usePagination'
4
6
  import React from 'react'
5
7
  import { IconSvg } from '../IconSvg'
6
8
  import { extendableComponent } from '../Styles'
@@ -1,12 +1,5 @@
1
- import {
2
- PaginationProps,
3
- Box,
4
- SxProps,
5
- Theme,
6
- Pagination,
7
- PaginationItem,
8
- PaginationRenderItemParams,
9
- } from '@mui/material'
1
+ import type { PaginationProps, PaginationRenderItemParams, SxProps, Theme } from '@mui/material'
2
+ import { Box, Pagination, PaginationItem } from '@mui/material'
10
3
  import { IconSvg } from '../IconSvg'
11
4
  import { extendableComponent } from '../Styles'
12
5
  import { NextLink } from '../Theme'
@@ -1,4 +1,5 @@
1
1
  import React from 'react'
2
+
2
3
  /** To make renderers customizable we need to be able to provide renders for all types */
3
4
  type TypeObject = { __typename: string; [index: string]: unknown }
4
5
 
@@ -26,6 +27,8 @@ export type TypeRenderer<
26
27
  /**
27
28
  * A simple array with renderers but with strict typing that validates of the provided Renderer is
28
29
  * actually able to render the Type
30
+ *
31
+ * @public
29
32
  */
30
33
  export function RenderType<
31
34
  T extends TypeObject,
@@ -39,6 +42,7 @@ export function RenderType<
39
42
  return <TypeItem {...typeItemProps} __typename={__typename} />
40
43
  }
41
44
 
45
+ /** @public */
42
46
  export function findByTypename<T extends TypeObject, Typename extends T['__typename']>(
43
47
  type: (T | undefined | null)[] | undefined | null,
44
48
  typename: Typename,
@@ -46,6 +50,7 @@ export function findByTypename<T extends TypeObject, Typename extends T['__typen
46
50
  return type?.find((item) => item?.__typename === typename) as FilterTypeByTypename<T, Typename>
47
51
  }
48
52
 
53
+ /** @public */
49
54
  export function isTypename<T extends TypeObject, Typenames extends T['__typename'][]>(
50
55
  type: FilterTypeByTypename<T, T['__typename']>,
51
56
  typename: Typenames,
@@ -53,6 +58,7 @@ export function isTypename<T extends TypeObject, Typenames extends T['__typename
53
58
  return typename.includes(type.__typename)
54
59
  }
55
60
 
61
+ /** @public */
56
62
  export function filterByTypename<T extends TypeObject, Typename extends T['__typename']>(
57
63
  type: (T | undefined | null)[] | undefined | null,
58
64
  typename: Typename,
@@ -1,4 +1,5 @@
1
- import { Box, SxProps, Theme, Typography } from '@mui/material'
1
+ import type { SxProps, Theme } from '@mui/material'
2
+ import { Box, Typography } from '@mui/material'
2
3
  import React from 'react'
3
4
  import { extendableComponent } from '../../Styles'
4
5
  import { responsiveVal } from '../../Styles/responsiveVal'
@@ -13,7 +14,7 @@ export type ButtonLinkListProps = {
13
14
 
14
15
  type OwnerState = { containsBigLinks: boolean }
15
16
 
16
- const compName = 'ButtonLinkList' as const
17
+ const compName = 'ButtonLinkList'
17
18
  const parts = ['root', 'links'] as const
18
19
  const { withState } = extendableComponent<OwnerState, typeof compName, typeof parts>(
19
20
  compName,
@@ -26,11 +27,7 @@ export function ButtonLinkList(props: ButtonLinkListProps) {
26
27
  const classes = withState({ containsBigLinks })
27
28
 
28
29
  return (
29
- <Row
30
- maxWidth='md'
31
- className={classes.root}
32
- sx={[{ maxWidth: 820 }, ...(Array.isArray(sx) ? sx : [sx])]}
33
- >
30
+ <Row maxWidth='820px' className={classes.root} sx={sx}>
34
31
  <Box
35
32
  sx={[
36
33
  (theme) => ({
@@ -1,4 +1,5 @@
1
- import { ListItemButtonProps, ListItemButton, ListItemIcon, ListItemText } from '@mui/material'
1
+ import type { ListItemButtonProps } from '@mui/material'
2
+ import { ListItemButton, ListItemIcon, ListItemText } from '@mui/material'
2
3
  import React from 'react'
3
4
  import { IconSvg } from '../../IconSvg'
4
5
  import { NextLink } from '../../Theme'
@@ -1,7 +1,5 @@
1
- import {
2
- DismissibleSnackbar,
3
- DismissibleSnackbarProps,
4
- } from '../../../Snackbar/DismissibleSnackbar'
1
+ import type { DismissibleSnackbarProps } from '../../../Snackbar/DismissibleSnackbar'
2
+ import { DismissibleSnackbar } from '../../../Snackbar/DismissibleSnackbar'
5
3
 
6
4
  export type VariantMessageProps = DismissibleSnackbarProps
7
5
 
@@ -1,11 +1,13 @@
1
- import { Box, ContainerProps } from '@mui/material'
1
+ import type { ContainerProps } from '@mui/material'
2
+ import { Box } from '@mui/material'
2
3
  import { extendableComponent } from '../../Styles'
3
4
  import { Row } from '../Row'
4
5
 
5
- const compName = 'ColumnOneBoxed' as const
6
+ const compName = 'ColumnOneBoxed'
6
7
  const parts = ['root', 'boxed'] as const
7
8
  const { classes } = extendableComponent(compName, parts)
8
9
 
10
+ /** @public */
9
11
  export function ColumnOneBoxed(props: ContainerProps) {
10
12
  const { children } = props
11
13
 
@@ -1,4 +1,5 @@
1
- import { ContainerProps, styled } from '@mui/material'
1
+ import type { ContainerProps } from '@mui/material'
2
+ import { styled } from '@mui/material'
2
3
  import { ColumnOne } from '../ColumnOne/ColumnOne'
3
4
 
4
5
  const Wrapper = styled('div')(({ theme }) => ({
@@ -6,10 +7,11 @@ const Wrapper = styled('div')(({ theme }) => ({
6
7
  marginTop: theme.spacings.lg,
7
8
  textAlign: 'center',
8
9
  maxWidth: `calc(1050px + calc(${theme.spacings.md} * 2))`,
9
- margin: `0 auto`,
10
+ margin: '0 auto',
10
11
  position: 'relative',
11
12
  }))
12
13
 
14
+ /** @public */
13
15
  export function ColumnOneCentered(props: ContainerProps) {
14
16
  const { children } = props
15
17
 
@@ -1,9 +1,10 @@
1
- import { Box, ContainerProps } from '@mui/material'
1
+ import type { ContainerProps } from '@mui/material'
2
+ import { Box } from '@mui/material'
2
3
  import React from 'react'
3
4
  import { extendableComponent } from '../../Styles'
4
5
  import { Row } from '../Row'
5
6
 
6
- const compName = 'ColumnThree' as const
7
+ const compName = 'ColumnThree'
7
8
  const parts = ['root', 'colOne', 'colTwo', 'colThree'] as const
8
9
  const { classes } = extendableComponent(compName, parts)
9
10
 
@@ -25,7 +26,7 @@ export function ColumnThree(props: ColumnThreeProps) {
25
26
  display: 'grid',
26
27
  gridColumnGap: theme.spacings.md,
27
28
  gridRowGap: theme.spacings.lg,
28
- gridTemplateColumns: `1fr`,
29
+ gridTemplateColumns: '1fr',
29
30
  gridTemplateAreas: `
30
31
  "one"
31
32
  "two"
@@ -43,14 +44,14 @@ export function ColumnThree(props: ColumnThreeProps) {
43
44
  },
44
45
  },
45
46
  [theme.breakpoints.up('sm')]: {
46
- gridTemplateColumns: `1fr 1fr`,
47
+ gridTemplateColumns: '1fr 1fr',
47
48
  gridTemplateAreas: `
48
49
  "one two"
49
50
  "three three"
50
51
  `,
51
52
  },
52
53
  [theme.breakpoints.up('md')]: {
53
- gridTemplateColumns: `1fr 1fr 1fr`,
54
+ gridTemplateColumns: '1fr 1fr 1fr',
54
55
  gridTemplateAreas: '"one two three"',
55
56
  },
56
57
  }),
@@ -1,4 +1,5 @@
1
- import { Box, ContainerProps } from '@mui/material'
1
+ import type { ContainerProps } from '@mui/material'
2
+ import { Box } from '@mui/material'
2
3
  import React from 'react'
3
4
  import { extendableComponent } from '../../Styles'
4
5
  import { Row } from '../Row'
@@ -8,7 +9,7 @@ export type ColumnTwoProps = Omit<ContainerProps, 'children'> & {
8
9
  colTwoContent: React.ReactNode
9
10
  }
10
11
 
11
- const compName = 'ColumnTwo' as const
12
+ const compName = 'ColumnTwo'
12
13
  const parts = ['root', 'colOne', 'colTwo'] as const
13
14
  const { classes } = extendableComponent(compName, parts)
14
15
 
@@ -24,12 +25,12 @@ export function ColumnTwo(props: ColumnTwoProps) {
24
25
  (theme) => ({
25
26
  gridColumnGap: theme.spacings.md,
26
27
  gridRowGap: theme.spacings.lg,
27
- display: `grid`,
28
- gridTemplateColumns: `1fr`,
29
- gridTemplateAreas: `"one" "two"`,
28
+ display: 'grid',
29
+ gridTemplateColumns: '1fr',
30
+ gridTemplateAreas: '"one" "two"',
30
31
  [theme.breakpoints.up('sm')]: {
31
- gridTemplateColumns: `1fr 1fr`,
32
- gridTemplateAreas: `"one two"`,
32
+ gridTemplateColumns: '1fr 1fr',
33
+ gridTemplateAreas: '"one two"',
33
34
  },
34
35
  }),
35
36
  ...(Array.isArray(sx) ? sx : [sx]),
@@ -1,9 +1,11 @@
1
- import { ColumnTwo, ColumnTwoProps } from '../ColumnTwo/ColumnTwo'
1
+ import type { ColumnTwoProps } from '../ColumnTwo/ColumnTwo'
2
+ import { ColumnTwo } from '../ColumnTwo/ColumnTwo'
2
3
 
3
4
  type StyleProps = { nodeLength: boolean }
4
5
 
5
6
  export type ColumnTwoSpreadProps = StyleProps & ColumnTwoProps
6
7
 
8
+ /** @public */
7
9
  export function ColumnTwoSpread(props: ColumnTwoSpreadProps) {
8
10
  const { nodeLength, sx = [], ...colProps } = props
9
11
  return (
@@ -13,8 +15,8 @@ export function ColumnTwoSpread(props: ColumnTwoSpreadProps) {
13
15
  sx={[
14
16
  (theme) => ({
15
17
  [theme.breakpoints.up('md')]: {
16
- gridTemplateColumns: `1fr 1fr 1fr`,
17
- gridTemplateAreas: nodeLength ? `"one one two"` : `"one two two"`,
18
+ gridTemplateColumns: '1fr 1fr 1fr',
19
+ gridTemplateAreas: nodeLength ? '"one one two"' : '"one two two"',
18
20
  '& h2, & h3': {
19
21
  '&:empty': {
20
22
  display: 'block',
@@ -22,8 +24,8 @@ export function ColumnTwoSpread(props: ColumnTwoSpreadProps) {
22
24
  },
23
25
  },
24
26
  },
25
- gridTemplateColumns: `1fr`,
26
- gridTemplateAreas: `"one" "two"`,
27
+ gridTemplateColumns: '1fr',
28
+ gridTemplateAreas: '"one" "two"',
27
29
  }),
28
30
  ...(Array.isArray(sx) ? sx : [sx]),
29
31
  ]}
@@ -1,4 +1,5 @@
1
- import { Box, ContainerProps } from '@mui/material'
1
+ import type { ContainerProps } from '@mui/material'
2
+ import { Box } from '@mui/material'
2
3
  import React from 'react'
3
4
  import { extendableComponent } from '../../Styles'
4
5
  import { Row } from '../Row'
@@ -9,7 +10,7 @@ export type ColumnTwoWithTopProps = ContainerProps & {
9
10
  right: React.ReactNode
10
11
  }
11
12
 
12
- const compName = 'ColumnTwoWithTop' as const
13
+ const compName = 'ColumnTwoWithTop'
13
14
  const parts = ['root', 'colOne', 'colTwo'] as const
14
15
  const { classes } = extendableComponent(compName, parts)
15
16
 
@@ -24,9 +25,9 @@ export function ColumnTwoWithTop(props: ColumnTwoWithTopProps) {
24
25
  (theme) => ({
25
26
  display: 'grid',
26
27
  gap: `${theme.spacings.lg} 0`,
27
- gridTemplateAreas: `"top" "left" "right"`,
28
+ gridTemplateAreas: '"top" "left" "right"',
28
29
  [theme.breakpoints.up('md')]: {
29
- gridTemplateAreas: `"top ." "left right"`,
30
+ gridTemplateAreas: '"top ." "left right"',
30
31
  gridTemplateColumns: '1fr auto',
31
32
  gap: `${theme.spacings.sm} ${theme.spacings.xxl}`,
32
33
  },
@@ -1,5 +1,6 @@
1
1
  import { Scroller, ScrollerProvider } from '@graphcommerce/framer-scroller'
2
- import { Container, SxProps, Theme, Typography } from '@mui/material'
2
+ import type { SxProps, Theme } from '@mui/material'
3
+ import { Container, Typography } from '@mui/material'
3
4
  import React from 'react'
4
5
  import { extendableComponent } from '../../Styles'
5
6
 
@@ -9,7 +10,7 @@ export type ContentLinksProps = {
9
10
  sx?: SxProps<Theme>
10
11
  }
11
12
 
12
- const compName = 'ContentLinks' as const
13
+ const compName = 'ContentLinks'
13
14
  const parts = ['root', 'scroller', 'title'] as const
14
15
  const { classes } = extendableComponent(compName, parts)
15
16
 
@@ -34,7 +35,7 @@ export function ContentLinks(props: ContentLinksProps) {
34
35
  sx={(theme) => ({
35
36
  justifyContent: 'start',
36
37
  gap: `${theme.spacings.md}`,
37
- gridAutoColumns: `max-content`,
38
+ gridAutoColumns: 'max-content',
38
39
  })}
39
40
  >
40
41
  <Typography variant='subtitle1' component='h2' className={classes.title}>
@@ -1,5 +1,6 @@
1
1
  import { clientSize } from '@graphcommerce/framer-utils'
2
- import { ContainerProps, Box, styled, Theme, SxProps } from '@mui/material'
2
+ import type { ContainerProps, SxProps, Theme } from '@mui/material'
3
+ import { Box, styled } from '@mui/material'
3
4
  import { m, useTransform } from 'framer-motion'
4
5
  import React from 'react'
5
6
  import { useScrollY } from '../../Layout/hooks/useScrollY'
@@ -13,7 +14,7 @@ export type HeroBannerProps = ContainerProps & {
13
14
  sx?: SxProps<Theme>
14
15
  }
15
16
 
16
- const compName = 'HeroBanner' as const
17
+ const compName = 'HeroBanner'
17
18
  const parts = ['root', 'wrapper', 'copy', 'asset', 'animated', 'video'] as const
18
19
  const { classes } = extendableComponent(compName, parts)
19
20
 
@@ -1,4 +1,5 @@
1
- import { Typography, Button, SxProps, Theme, Box, ButtonProps } from '@mui/material'
1
+ import type { ButtonProps, SxProps, Theme } from '@mui/material'
2
+ import { Box, Button, Typography } from '@mui/material'
2
3
  import React from 'react'
3
4
  import { extendableComponent } from '../../Styles'
4
5
 
@@ -10,7 +11,7 @@ export type IconBlockProps = {
10
11
  sx?: SxProps<Theme>
11
12
  } & ButtonProps
12
13
 
13
- const name = 'IconBlock' as const
14
+ const name = 'IconBlock'
14
15
  const parts = ['block', 'link', 'title'] as const
15
16
  const { classes } = extendableComponent(name, parts)
16
17
 
@@ -1,4 +1,5 @@
1
- import { Box, SxProps, Theme } from '@mui/material'
1
+ import type { SxProps, Theme } from '@mui/material'
2
+ import { Box } from '@mui/material'
2
3
  import React from 'react'
3
4
  import { extendableComponent } from '../../Styles'
4
5
  import { responsiveVal } from '../../Styles/responsiveVal'
@@ -10,7 +11,7 @@ export type IconBlocksProps = {
10
11
  sx?: SxProps<Theme>
11
12
  }
12
13
 
13
- const compName = 'IconBlocks' as const
14
+ const compName = 'IconBlocks'
14
15
  const parts = ['container', 'title', 'optionsWrapper', 'block', 'wrapper'] as const
15
16
  const { classes } = extendableComponent(compName, parts)
16
17
 
@@ -1,4 +1,5 @@
1
- import { Box, SxProps, Theme } from '@mui/material'
1
+ import type { SxProps, Theme } from '@mui/material'
2
+ import { Box } from '@mui/material'
2
3
  import React from 'react'
3
4
  import { extendableComponent } from '../../Styles'
4
5
  import { breakpointVal } from '../../Styles/breakpointVal'
@@ -10,7 +11,7 @@ export type ImageTextProps = {
10
11
  sx?: SxProps<Theme>
11
12
  }
12
13
 
13
- const name = 'ImageText' as const
14
+ const name = 'ImageText'
14
15
  const parts = ['root', 'wrapper', 'asset', 'copy'] as const
15
16
  const { classes } = extendableComponent(name, parts)
16
17
 
@@ -1,4 +1,5 @@
1
- import { Box, SxProps, Theme } from '@mui/material'
1
+ import type { SxProps, Theme } from '@mui/material'
2
+ import { Box } from '@mui/material'
2
3
  import React from 'react'
3
4
  import { extendableComponent } from '../../Styles'
4
5
  import { breakpointVal } from '../../Styles/breakpointVal'
@@ -11,7 +12,7 @@ export type ImageTextBoxedProps = {
11
12
  sx?: SxProps<Theme>
12
13
  }
13
14
 
14
- const name = 'ImageTextBoxed' as const
15
+ const name = 'ImageTextBoxed'
15
16
  const parts = ['root', 'wrapper', 'asset', 'copy'] as const
16
17
  const { classes } = extendableComponent(name, parts)
17
18
 
@@ -72,7 +73,7 @@ export function ImageTextBoxed(props: ImageTextBoxedProps) {
72
73
  '& img': {
73
74
  height: '100% !important',
74
75
  width: '100% !important',
75
- objectFit: `cover`,
76
+ objectFit: 'cover',
76
77
  },
77
78
  })}
78
79
  >
@@ -1,4 +1,5 @@
1
- import { Box, ContainerProps } from '@mui/material'
1
+ import type { ContainerProps } from '@mui/material'
2
+ import { Box } from '@mui/material'
2
3
  import { extendableComponent } from '../../Styles'
3
4
  import { breakpointVal } from '../../Styles/breakpointVal'
4
5
  import { Row } from '../Row'
@@ -9,7 +10,7 @@ export type ParagraphWithSidebarSlideProps = ContainerProps & {
9
10
  children: React.ReactNode
10
11
  }
11
12
 
12
- const name = 'ParagraphWithSidebarSlide' as const
13
+ const name = 'ParagraphWithSidebarSlide'
13
14
  const parts = ['root', 'wrapper', 'backstory', 'copy', 'slidingItems'] as const
14
15
  const { classes } = extendableComponent(name, parts)
15
16
 
@@ -1,4 +1,4 @@
1
- import { ContainerProps } from '@mui/material'
1
+ import type { ContainerProps } from '@mui/material'
2
2
  import React from 'react'
3
3
  import { Row } from '../Row'
4
4
 
package/Row/Row.tsx CHANGED
@@ -1,4 +1,5 @@
1
- import { Container, styled } from '@mui/material'
1
+ import { styled } from '@mui/material'
2
+ import { Container } from '../Container/Container'
2
3
 
3
4
  export const Row = styled(Container, { name: 'Row' })(({ theme }) => ({
4
5
  marginBottom: theme.spacings.xxl,
@@ -1,15 +1,13 @@
1
- import {
2
- Scroller,
3
- ScrollerButton,
4
- ScrollerButtonProps,
5
- ScrollerProvider,
6
- } from '@graphcommerce/framer-scroller'
7
- import { Box, ContainerProps, SxProps, Theme, Typography } from '@mui/material'
1
+ import type { ScrollerButtonProps } from '@graphcommerce/framer-scroller'
2
+ import { Scroller, ScrollerButton, ScrollerProvider } from '@graphcommerce/framer-scroller'
3
+ import type { ContainerProps, SxProps, Theme } from '@mui/material'
4
+ import { Box, Typography } from '@mui/material'
8
5
  import React from 'react'
6
+ import { Container, useContainerSpacing } from '../../Container/Container'
7
+ import { iconChevronLeft, iconChevronRight } from '../../icons'
9
8
  import { IconSvg } from '../../IconSvg'
10
9
  import { extendableComponent } from '../../Styles'
11
10
  import { useFabSize } from '../../Theme'
12
- import { iconChevronLeft, iconChevronRight } from '../../icons'
13
11
  import { Row } from '../Row'
14
12
 
15
13
  export type RowLinksProps = {
@@ -21,7 +19,7 @@ export type RowLinksProps = {
21
19
  } & Pick<ContainerProps, 'maxWidth'> &
22
20
  Pick<ScrollerButtonProps, 'showButtons'>
23
21
 
24
- const compName = 'RowLinks' as const
22
+ const compName = 'RowLinks'
25
23
  const parts = [
26
24
  'root',
27
25
  'scroller',
@@ -38,37 +36,41 @@ export function RowLinks(props: RowLinksProps) {
38
36
  const { title, copy, children, sx = [], inlineTitle, showButtons, maxWidth } = props
39
37
 
40
38
  const fabSize = useFabSize('responsive')
39
+ const spacing = useContainerSpacing({ maxWidth })
41
40
 
42
41
  return (
43
- <Row
44
- className={classes.root}
45
- sx={[{ position: 'relative' }, ...(Array.isArray(sx) ? sx : [sx])]}
46
- maxWidth={maxWidth}
47
- >
48
- {!inlineTitle && (
49
- <Typography
50
- variant='subtitle1'
51
- component='h2'
52
- className={classes.title}
53
- sx={(theme) => ({ mb: theme.spacings.md })}
54
- >
55
- {title}
56
- </Typography>
57
- )}
58
- {copy && (
59
- <Box className={classes.copy} sx={(theme) => ({ my: theme.spacings.md })}>
60
- {copy}
61
- </Box>
62
- )}
63
- <Box className={classes.scrollerWrapper} sx={{ position: 'relative' }}>
42
+ <Box className={classes.root} sx={sx}>
43
+ <Container maxWidth={maxWidth}>
44
+ {!inlineTitle && (
45
+ <Typography
46
+ variant='subtitle1'
47
+ component='h2'
48
+ className={classes.title}
49
+ sx={(theme) => ({ mb: theme.spacings.md })}
50
+ >
51
+ {title}
52
+ </Typography>
53
+ )}
54
+ {copy && (
55
+ <Box className={classes.copy} sx={(theme) => ({ my: theme.spacings.md })}>
56
+ {copy}
57
+ </Box>
58
+ )}
59
+ </Container>
60
+ <Box
61
+ className={classes.scrollerWrapper}
62
+ sx={(theme) => ({ position: 'relative', mb: theme.spacings.xxl })}
63
+ >
64
64
  <ScrollerProvider scrollSnapAlign='end'>
65
65
  <Scroller
66
66
  className={classes.scroller}
67
67
  hideScrollbar
68
68
  sx={(theme) => ({
69
+ px: spacing.padding,
70
+ scrollPaddingInline: spacing.padding,
69
71
  justifyContent: 'start',
70
72
  gap: `${theme.spacings.md}`,
71
- gridAutoColumns: `max-content`,
73
+ gridAutoColumns: 'max-content',
72
74
  alignItems: 'center',
73
75
  '&.smGridDirInline > *': {
74
76
  scrollSnapAlign: {
@@ -92,7 +94,7 @@ export function RowLinks(props: RowLinksProps) {
92
94
  gridAutoFlow: 'row',
93
95
  gap: theme.spacings.xxs,
94
96
  position: 'absolute',
95
- left: theme.spacings.xs,
97
+ left: spacing.padding,
96
98
  top: `calc(50% - calc(${fabSize} / 2))`,
97
99
  })}
98
100
  >
@@ -111,7 +113,7 @@ export function RowLinks(props: RowLinksProps) {
111
113
  display: 'grid',
112
114
  gap: theme.spacings.xxs,
113
115
  position: 'absolute',
114
- right: theme.spacings.xs,
116
+ right: spacing.padding,
115
117
  top: `calc(50% - calc(${fabSize} / 2))`,
116
118
  })}
117
119
  >
@@ -126,6 +128,6 @@ export function RowLinks(props: RowLinksProps) {
126
128
  </Box>
127
129
  </ScrollerProvider>
128
130
  </Box>
129
- </Row>
131
+ </Box>
130
132
  )
131
133
  }
@@ -1,4 +1,5 @@
1
- import { RowLinks, RowLinksProps } from '../RowLinks'
1
+ import type { RowLinksProps } from '../RowLinks'
2
+ import { RowLinks } from '../RowLinks'
2
3
 
3
4
  export function VariantImageLabelSwiper(props: RowLinksProps) {
4
5
  const { sx = [], ...rowLinksProps } = props
@@ -8,7 +9,10 @@ export function VariantImageLabelSwiper(props: RowLinksProps) {
8
9
  {...rowLinksProps}
9
10
  sx={[
10
11
  {
11
- '& .Scroller-root': {
12
+ // '& .Scroller-root': {
13
+ // alignItems: 'start',
14
+ // },
15
+ '& .Scroller-scroller': {
12
16
  alignItems: 'start',
13
17
  },
14
18
  '& .RowLinks-title': {
@@ -1,4 +1,5 @@
1
- import { RowLinks, RowLinksProps } from '../RowLinks'
1
+ import type { RowLinksProps } from '../RowLinks'
2
+ import { RowLinks } from '../RowLinks'
2
3
 
3
4
  export function VariantInline(props: RowLinksProps) {
4
5
  const { sx = [], inlineTitle = true, ...rowLinksProps } = props
@@ -7,7 +8,10 @@ export function VariantInline(props: RowLinksProps) {
7
8
  <RowLinks
8
9
  inlineTitle={inlineTitle}
9
10
  {...rowLinksProps}
10
- sx={[{}, ...(Array.isArray(sx) ? sx : [sx])]}
11
+ sx={[
12
+ (theme) => ({ '& .RowLinks-scrollerWrapper': { my: theme.spacings.md } }),
13
+ ...(Array.isArray(sx) ? sx : [sx]),
14
+ ]}
11
15
  />
12
16
  )
13
17
  }
@@ -1,4 +1,5 @@
1
- import { RowLinks, RowLinksProps } from '../RowLinks'
1
+ import type { RowLinksProps } from '../RowLinks'
2
+ import { RowLinks } from '../RowLinks'
2
3
 
3
4
  export function VariantLogoSwiper(props: RowLinksProps) {
4
5
  const { sx = [], ...rowLinksProps } = props