@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,9 +1,10 @@
1
- import { Chip, ChipProps, Menu, MenuProps, menuClasses, SxProps, Theme } from '@mui/material'
1
+ import type { ChipProps, MenuProps, SxProps, Theme } from '@mui/material'
2
+ import { Chip, Menu, menuClasses } from '@mui/material'
2
3
  import React, { useState } from 'react'
3
4
  import { IconSvg } from '../IconSvg'
4
5
  import { SectionHeader } from '../SectionHeader/SectionHeader'
5
6
  import { responsiveVal } from '../Styles/responsiveVal'
6
- import { iconChevronDown, iconChevronUp, iconCancelAlt } from '../icons'
7
+ import { iconCancelAlt, iconChevronDown, iconChevronUp } from '../icons'
7
8
 
8
9
  export type ChipMenuProps = Omit<ChipProps<'button'>, 'children' | 'component'> & {
9
10
  selectedLabel?: React.ReactNode
package/Config.graphqls CHANGED
@@ -1,13 +1,9 @@
1
- extend input GraphCommerceConfig {
2
- """
3
- Configuration for the SidebarGallery component
4
- """
5
- sidebarGallery: SidebarGalleryConfig
6
-
7
- """
8
- Configuration for the SidebarGallery component
9
- """
10
- breadcrumbs: Boolean = false
1
+ """
2
+ Configure whether the layout should be full width or should be constrained by a max breakpoint. Configurable in theme.ts
3
+ """
4
+ enum ContainerSizing {
5
+ FULL_WIDTH
6
+ BREAKPOINT
11
7
  }
12
8
 
13
9
  """
@@ -27,3 +23,25 @@ input SidebarGalleryConfig {
27
23
  """
28
24
  paginationVariant: SidebarGalleryPaginationVariant
29
25
  }
26
+
27
+ extend input GraphCommerceConfig {
28
+ """
29
+ Configuration for the SidebarGallery component
30
+ """
31
+ sidebarGallery: SidebarGalleryConfig
32
+
33
+ """
34
+ Configuration for the SidebarGallery component
35
+ """
36
+ breadcrumbs: Boolean = false
37
+
38
+ """
39
+ Configures the max width of the shell (header, footer, overlays, etc.)
40
+ """
41
+ containerSizingShell: ContainerSizing = FULL_WIDTH
42
+
43
+ """
44
+ Configures the max width of the content (main content area)
45
+ """
46
+ containerSizingContent: ContainerSizing = FULL_WIDTH
47
+ }
@@ -0,0 +1,90 @@
1
+ import { Box, useTheme } from '@mui/material'
2
+ import type { ContainerProps } from '@mui/material'
3
+ import clsx from 'clsx'
4
+ import React from 'react'
5
+ import type { LiteralUnion } from 'type-fest'
6
+ import { extendableComponent } from '../Styles/extendableComponent'
7
+ import type { ContainerSizingVariant } from '../Theme/useContainerSizing'
8
+ import { useContainerSizing } from '../Theme/useContainerSizing'
9
+
10
+ type OwnerProps = {
11
+ /** Can be a breakpoint, 'full' or a actual value */
12
+ maxWidth?: LiteralUnion<ContainerProps['maxWidth'] | 'full', string>
13
+ sizing?: ContainerSizingVariant
14
+ breakoutRight?: boolean
15
+ breakoutLeft?: boolean
16
+ }
17
+
18
+ export type ContainerSizingProps = Omit<ContainerProps, 'maxWidth'> & OwnerProps
19
+
20
+ const name = 'MuiContainer'
21
+ const slots = ['root'] as const
22
+ const { withState } = extendableComponent<OwnerProps, typeof name, typeof slots>(
23
+ 'MuiContainer',
24
+ slots,
25
+ )
26
+
27
+ /**
28
+ * Calculate the padding and margin for a container.
29
+ *
30
+ * - The padding is a positive value to add to an element on the left and right.
31
+ * - The margin is a negative value to offset the padding of a container. Used to break out of a
32
+ * container.
33
+ */
34
+ export function useContainerSpacing(options?: ContainerSizingProps) {
35
+ const { disableGutters, maxWidth, sizing = 'content' } = options ?? {}
36
+
37
+ const theme = useTheme()
38
+ const { breakpoint, value } = useContainerSizing(sizing)
39
+
40
+ const gutter = disableGutters ? '0px' : `${theme.page.horizontal}`
41
+
42
+ let size = value
43
+ if (maxWidth && theme.breakpoints.values[maxWidth])
44
+ size = `${theme.breakpoints.values[maxWidth]}px`
45
+ else if (maxWidth) size = maxWidth
46
+
47
+ if (size === '100%' || maxWidth === 'full') return { breakpoint, size, padding: gutter }
48
+
49
+ return { breakpoint, size, padding: `max(${gutter}, ((100% - ${size}) / 2 + ${gutter}))` }
50
+ }
51
+
52
+ /**
53
+ * A better Container component that supports:
54
+ *
55
+ * - Setting the background color as it is using a calculated padding instead of a margin: '0 auto'
56
+ * - Breaking out of the container to the left or right
57
+ */
58
+ export const Container = React.forwardRef(
59
+ (props: ContainerSizingProps, ref: React.ForwardedRef<HTMLDivElement>) => {
60
+ const {
61
+ sx,
62
+ breakoutRight = false,
63
+ breakoutLeft = false,
64
+ maxWidth = 'lg',
65
+ disableGutters,
66
+ sizing = 'content',
67
+ className,
68
+ ...rest
69
+ } = props
70
+ const classes = withState({ breakoutLeft, breakoutRight, maxWidth, sizing })
71
+ const { padding } = useContainerSpacing(props)
72
+
73
+ return (
74
+ <Box
75
+ {...rest}
76
+ ref={ref}
77
+ className={clsx(className, classes.root)}
78
+ sx={[
79
+ {
80
+ pl: !breakoutLeft ? padding : undefined,
81
+ pr: !breakoutRight ? padding : undefined,
82
+ '&.breakoutLeft': { pl: 'unset' },
83
+ '&.breakoutRight': { pr: 'unset' },
84
+ },
85
+ ...(Array.isArray(sx) ? sx : [sx]),
86
+ ]}
87
+ />
88
+ )
89
+ },
90
+ )
@@ -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 { Row } from '../Row/Row'
4
5
  import { extendableComponent } from '../Styles'
@@ -1,5 +1,5 @@
1
1
  // eslint-disable-next-line @next/next/no-document-import-in-page
2
- import { DocumentProps } from 'next/document'
2
+ import type { DocumentProps } from 'next/document'
3
3
 
4
4
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
5
5
  export function DocumentBodyEnd(props: DocumentProps) {
@@ -1,5 +1,5 @@
1
1
  // eslint-disable-next-line @next/next/no-document-import-in-page
2
- import { DocumentProps } from 'next/document'
2
+ import type { DocumentProps } from 'next/document'
3
3
 
4
4
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
5
5
  export function DocumentBodyStart(props: DocumentProps) {
@@ -1,5 +1,5 @@
1
1
  // eslint-disable-next-line @next/next/no-document-import-in-page
2
- import { DocumentProps } from 'next/document'
2
+ import type { DocumentProps } from 'next/document'
3
3
 
4
4
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
5
5
  export function DocumentHeadEnd(props: DocumentProps) {
@@ -1,5 +1,5 @@
1
1
  // eslint-disable-next-line @next/next/no-document-import-in-page
2
- import { DocumentProps } from 'next/document'
2
+ import type { DocumentProps } from 'next/document'
3
3
 
4
4
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
5
5
  export function DocumentHeadStart(props: DocumentProps) {
package/Fab/Fab.tsx CHANGED
@@ -1,17 +1,17 @@
1
- import {
2
- Box,
3
- CircularProgress,
4
- CircularProgressProps,
5
- Fab as FabBase,
6
- FabProps as FabPropsBase,
7
- } from '@mui/material'
8
- import { IconSvg, IconSvgProps } from '../IconSvg'
1
+ import type { CircularProgressProps, FabProps as FabPropsBase } from '@mui/material'
2
+ import { Box, CircularProgress, Fab as FabBase } from '@mui/material'
3
+ import type { IconSvgProps } from '../IconSvg'
4
+ import { IconSvg } from '../IconSvg'
9
5
  import { useFabSize } from '../Theme/MuiFab'
6
+ import { sxx } from '../utils/sxx'
10
7
 
11
8
  export type FabProps = Omit<FabPropsBase<'button'>, 'variant' | 'children'> & {
12
9
  loading?: boolean
13
10
  icon: IconSvgProps['src']
14
- circularProgress?: Omit<CircularProgressProps, 'size'>
11
+ slotProps?: {
12
+ icon?: Omit<IconSvgProps, 'src'>
13
+ circularProgress?: Omit<CircularProgressProps, 'size'>
14
+ }
15
15
  }
16
16
 
17
17
  /** Adds loading functionality to the Fab component. */
@@ -22,15 +22,13 @@ export function Fab(props: FabProps) {
22
22
  loading,
23
23
  sx = [],
24
24
  icon,
25
- circularProgress,
26
25
  color = 'default',
26
+ slotProps,
27
27
  ...fabProps
28
28
  } = props
29
29
 
30
30
  const fabSize = useFabSize(size)
31
31
 
32
- const circSx = circularProgress?.sx ?? []
33
-
34
32
  return (
35
33
  <FabBase
36
34
  type='submit'
@@ -41,17 +39,17 @@ export function Fab(props: FabProps) {
41
39
  sx={[{ display: 'grid' }, ...(Array.isArray(sx) ? sx : [sx])]}
42
40
  >
43
41
  <Box sx={{ display: 'flex', placeContent: 'center', gridArea: '1/1' }}>
44
- <IconSvg src={icon} size='medium' />
42
+ <IconSvg src={icon} size='medium' {...slotProps?.icon} />
45
43
  </Box>
46
44
  {loading && (
47
45
  <CircularProgress
48
46
  size={fabSize}
49
47
  color={color !== 'primary' ? 'primary' : 'inherit'}
50
- {...circularProgress}
51
- sx={[
48
+ {...slotProps?.circularProgress}
49
+ sx={sxx(
52
50
  { display: 'flex', placeContent: 'center', gridArea: '1/1' },
53
- ...(Array.isArray(circSx) ? circSx : [circSx]),
54
- ]}
51
+ slotProps?.circularProgress?.sx,
52
+ )}
55
53
  />
56
54
  )}
57
55
  </FabBase>
@@ -1,4 +1,5 @@
1
- import { Avatar, AvatarProps } from '@mui/material'
1
+ import type { AvatarProps } from '@mui/material'
2
+ import { Avatar } from '@mui/material'
2
3
 
3
4
  export type FlagAvatarProps = { country: string } & Omit<AvatarProps, 'src'>
4
5
 
package/Footer/Footer.tsx CHANGED
@@ -1,5 +1,7 @@
1
- import { ContainerProps, Container, Box } from '@mui/material'
1
+ import type { ContainerProps } from '@mui/material'
2
+ import { Box } from '@mui/material'
2
3
  import React from 'react'
4
+ import { Container } from '../Container/Container'
3
5
  import { LazyHydrate } from '../LazyHydrate'
4
6
  import { extendableComponent } from '../Styles'
5
7
 
@@ -33,20 +35,23 @@ export function Footer(props: FooterProps) {
33
35
  return (
34
36
  <LazyHydrate height={300}>
35
37
  <Container
38
+ maxWidth={false}
39
+ sizing='shell'
36
40
  sx={[
37
41
  (theme) => ({
38
42
  gridTemplateColumns: '5fr 3fr',
39
43
  borderTop: `1px solid ${theme.palette.divider}`,
40
44
  display: 'grid',
41
45
  alignItems: 'center',
42
- padding: `${theme.spacings.lg} ${theme.page.horizontal} ${theme.page.vertical}`,
46
+ pt: theme.spacings.lg,
47
+ pb: theme.spacings.lg,
43
48
  justifyItems: 'center',
44
49
  gridTemplateAreas: `
45
- 'switcher switcher'
46
- 'support support'
47
- 'social social'
48
- 'links links'
49
- `,
50
+ 'switcher switcher'
51
+ 'support support'
52
+ 'social social'
53
+ 'links links'
54
+ `,
50
55
  gap: theme.spacings.md,
51
56
  '& > *': { maxWidth: 'max-content' },
52
57
 
@@ -57,7 +62,7 @@ export function Footer(props: FooterProps) {
57
62
  'links support'
58
63
  `,
59
64
  justifyItems: 'start',
60
- padding: `${theme.page.vertical} ${theme.page.horizontal}`,
65
+ py: theme.page.vertical,
61
66
  gridTemplateColumns: 'auto auto',
62
67
  gridTemplateRows: 'auto',
63
68
  justifyContent: 'space-between',
@@ -65,7 +70,6 @@ export function Footer(props: FooterProps) {
65
70
  }),
66
71
  ...(Array.isArray(sx) ? sx : [sx]),
67
72
  ]}
68
- maxWidth={false}
69
73
  className={classes.root}
70
74
  {...containerProps}
71
75
  >
@@ -126,7 +130,7 @@ export function Footer(props: FooterProps) {
126
130
  [theme.breakpoints.down('md')]: {
127
131
  gridAutoFlow: 'row',
128
132
  textAlign: 'center',
129
- gap: `8px`,
133
+ gap: '8px',
130
134
  },
131
135
  })}
132
136
  className={classes.copyright}
package/Form/Form.tsx CHANGED
@@ -1,4 +1,5 @@
1
- import { darken, lighten, styled, Theme } from '@mui/material'
1
+ import type { Theme } from '@mui/material'
2
+ import { darken, lighten, styled } from '@mui/material'
2
3
  import { breakpointVal } from '../Styles/breakpointVal'
3
4
 
4
5
  type FormStyleProps = {
@@ -1,4 +1,4 @@
1
- import { styled, Typography } from '@mui/material'
1
+ import { Typography, styled } from '@mui/material'
2
2
 
3
3
  export const FormHeader = styled(Typography, { name: 'FormHeader' })(({ theme }) => ({
4
4
  marginBottom: `calc(${theme.spacings.xxs} * -1)`,
package/Form/FormRow.tsx CHANGED
@@ -4,6 +4,6 @@ export const FormRow = styled('div', { name: 'FormRow' })(({ theme }) => ({
4
4
  paddingTop: theme.spacings.xxs,
5
5
  paddingBottom: theme.spacings.xxs,
6
6
  display: 'grid',
7
- gridTemplateColumns: `repeat(auto-fit, minmax(200px, 1fr))`,
7
+ gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))',
8
8
  gap: `calc(${theme.spacings.xxs} * 2)`,
9
9
  }))
@@ -1,4 +1,5 @@
1
- import { IconSvg, IconSvgProps } from '../IconSvg'
1
+ import type { IconSvgProps } from '../IconSvg'
2
+ import { IconSvg } from '../IconSvg'
2
3
  import { iconCheckmark } from '../icons'
3
4
 
4
5
  export type InputCheckmarkProps = {
@@ -1,10 +1,7 @@
1
- import {
2
- ScrollerProvider,
3
- Scroller,
4
- ScrollerButton,
5
- ScrollerButtonProps,
6
- } from '@graphcommerce/framer-scroller'
7
- import { Box, SxProps, Theme } from '@mui/material'
1
+ import type { ScrollerButtonProps } from '@graphcommerce/framer-scroller'
2
+ import { Scroller, ScrollerButton, ScrollerProvider } from '@graphcommerce/framer-scroller'
3
+ import type { SxProps, Theme } from '@mui/material'
4
+ import { Box } from '@mui/material'
8
5
  import { IconSvg } from '../IconSvg'
9
6
  import { extendableComponent, responsiveVal } from '../Styles'
10
7
  import { useFabSize } from '../Theme'
@@ -59,7 +56,7 @@ export function ItemScroller(props: ItemScrollerProps) {
59
56
  gap: theme.spacings.xxs,
60
57
  position: 'absolute',
61
58
  left: theme.spacings.sm,
62
- top: `calc(50% - 28px)`,
59
+ top: 'calc(50% - 28px)',
63
60
  })}
64
61
  >
65
62
  <ScrollerButton direction='left' showButtons={showButtons} size='responsive'>
@@ -1,33 +1,25 @@
1
1
  import { usePrevPageRouter } from '@graphcommerce/framer-next-pages/hooks/usePrevPageRouter'
2
+ import type { MotionImageAspectProps, ScrollerButtonProps } from '@graphcommerce/framer-scroller'
2
3
  import {
3
4
  MotionImageAspect,
4
- MotionImageAspectProps,
5
5
  Scroller,
6
- ScrollerDots,
7
6
  ScrollerButton,
7
+ ScrollerDots,
8
8
  ScrollerProvider,
9
- unstable_usePreventScroll as usePreventScroll,
10
- ScrollerButtonProps,
11
9
  ScrollerThumbnails,
10
+ unstable_usePreventScroll as usePreventScroll,
12
11
  } from '@graphcommerce/framer-scroller'
13
12
  import { dvh } from '@graphcommerce/framer-utils'
14
- import {
15
- Fab,
16
- useTheme,
17
- Box,
18
- styled,
19
- SxProps,
20
- Theme,
21
- Unstable_TrapFocus as TrapFocus,
22
- } from '@mui/material'
13
+ import type { SxProps, Theme } from '@mui/material'
14
+ import { Box, Fab, styled, Unstable_TrapFocus as TrapFocus, useTheme } from '@mui/material'
23
15
  import { m, useDomEvent, useMotionValue } from 'framer-motion'
24
16
  import { useRouter } from 'next/router'
25
17
  import React, { useEffect, useRef } from 'react'
18
+ import { iconChevronLeft, iconChevronRight, iconFullscreen, iconFullscreenExit } from '../icons'
26
19
  import { IconSvg } from '../IconSvg'
27
20
  import { Row } from '../Row/Row'
28
21
  import { extendableComponent } from '../Styles'
29
22
  import { responsiveVal } from '../Styles/responsiveVal'
30
- import { iconChevronLeft, iconChevronRight, iconFullscreen, iconFullscreenExit } from '../icons'
31
23
 
32
24
  const MotionBox = styled(m.div)({})
33
25
 
@@ -39,7 +31,7 @@ type OwnerState = {
39
31
  sticky: boolean
40
32
  variantMd: SidebarGalleryVariant
41
33
  }
42
- const name = 'SidebarGallery' as const
34
+ const name = 'SidebarGallery'
43
35
  const parts = [
44
36
  'row',
45
37
  'root',
@@ -148,7 +140,16 @@ export function SidebarGallery(props: SidebarGalleryProps) {
148
140
 
149
141
  return (
150
142
  <ScrollerProvider scrollSnapAlign='center'>
151
- <Row maxWidth={false} disableGutters className={classes.row} sx={sx}>
143
+ <Row
144
+ maxWidth={zoomed ? 'full' : 'lg'}
145
+ disableGutters
146
+ className={classes.row}
147
+ breakoutLeft={variantMd === 'default' && !theme.appShell.containerSizingContent}
148
+ sx={[
149
+ { bgcolor: theme.palette.mode === 'light' ? 'background.image' : 'background.paper' },
150
+ ...(Array.isArray(sx) ? sx : [sx]),
151
+ ]}
152
+ >
152
153
  <MotionBox
153
154
  layout
154
155
  layoutDependency={zoomed}
@@ -165,14 +166,6 @@ export function SidebarGallery(props: SidebarGalleryProps) {
165
166
  } * 2)`,
166
167
  },
167
168
  },
168
- background:
169
- theme.palette.mode === 'light'
170
- ? theme.palette.background.image
171
- : theme.palette.background.paper,
172
-
173
- '&:not(.variantMdOneColumn)': {
174
- paddingRight: `calc((100% - ${theme.breakpoints.values.lg}px) / 2)`,
175
- },
176
169
 
177
170
  '&.zoomed': {
178
171
  position: 'relative',
@@ -182,7 +175,7 @@ export function SidebarGallery(props: SidebarGalleryProps) {
182
175
  marginTop: `calc(${theme.appShell.headerHeightMd} * -1 - ${theme.spacings.lg})`,
183
176
  gridTemplateColumns: '1fr auto',
184
177
  },
185
- paddingRight: 0,
178
+ px: 0,
186
179
  },
187
180
  },
188
181
  ]}
@@ -237,12 +230,12 @@ export function SidebarGallery(props: SidebarGalleryProps) {
237
230
  top: 0,
238
231
  width: '100%',
239
232
  height: '100%',
240
- gridAutoColumns: `100%`,
241
- gridTemplateRows: `100%`,
233
+ gridAutoColumns: '100%',
234
+ gridTemplateRows: '100%',
242
235
  cursor: disableZoom ? 'auto' : 'zoom-in',
243
236
  },
244
237
  zoomed && {
245
- height: `var(--client-size-y)`,
238
+ height: 'var(--client-size-y)',
246
239
  cursor: 'inherit',
247
240
  },
248
241
  ]}
@@ -305,7 +298,7 @@ export function SidebarGallery(props: SidebarGalleryProps) {
305
298
  gap: theme.spacings.xxs,
306
299
  position: 'absolute',
307
300
  left: theme.spacings.sm,
308
- top: `calc(50% - 28px)`,
301
+ top: 'calc(50% - 28px)',
309
302
  }}
310
303
  >
311
304
  <ScrollerButton
@@ -326,7 +319,7 @@ export function SidebarGallery(props: SidebarGalleryProps) {
326
319
  gap: theme.spacings.xxs,
327
320
  position: 'absolute',
328
321
  right: theme.spacings.sm,
329
- top: `calc(50% - 28px)`,
322
+ top: 'calc(50% - 28px)',
330
323
  }}
331
324
  >
332
325
  <ScrollerButton
@@ -1,17 +1,18 @@
1
+ import type { ScrollerButtonProps } from '@graphcommerce/framer-scroller'
1
2
  import {
2
3
  Scroller,
3
4
  ScrollerButton,
4
- ScrollerButtonProps,
5
5
  ScrollerPageCounter,
6
6
  ScrollerProvider,
7
7
  } from '@graphcommerce/framer-scroller'
8
- import { Box, SxProps, Theme } from '@mui/material'
9
- import { ReactNode } from 'react'
8
+ import type { SxProps, Theme } from '@mui/material'
9
+ import { Box } from '@mui/material'
10
+ import type { ReactNode } from 'react'
11
+ import { iconChevronLeft, iconChevronRight } from '../icons'
10
12
  import { IconSvg } from '../IconSvg'
11
13
  import { Row } from '../Row/Row'
12
14
  import { extendableComponent } from '../Styles/extendableComponent'
13
15
  import { responsiveVal } from '../Styles/responsiveVal'
14
- import { iconChevronLeft, iconChevronRight } from '../icons'
15
16
 
16
17
  const { classes, selectors } = extendableComponent('SidebarSlider', [
17
18
  'root',
@@ -35,7 +36,7 @@ export function SidebarSlider(props: SidebarSliderProps) {
35
36
  const { children, sidebar, sx, buttonSize, showButtons } = props
36
37
 
37
38
  return (
38
- <Row maxWidth={false} disableGutters className={classes.root} sx={sx}>
39
+ <Row maxWidth={false} disableGutters className={classes.root} sx={sx} breakoutRight>
39
40
  <ScrollerProvider scrollSnapAlign='start'>
40
41
  <Box
41
42
  className={classes.grid}
@@ -78,7 +79,7 @@ export function SidebarSlider(props: SidebarSliderProps) {
78
79
  gap: theme.spacings.xxs,
79
80
  position: 'absolute',
80
81
  left: theme.spacings.sm,
81
- top: `calc(50% - 28px)`,
82
+ top: 'calc(50% - 28px)',
82
83
  })}
83
84
  >
84
85
  <ScrollerButton
@@ -97,7 +98,7 @@ export function SidebarSlider(props: SidebarSliderProps) {
97
98
  gap: theme.spacings.xxs,
98
99
  position: 'absolute',
99
100
  right: theme.spacings.sm,
100
- top: `calc(50% - 28px)`,
101
+ top: 'calc(50% - 28px)',
101
102
  })}
102
103
  >
103
104
  <ScrollerButton
@@ -1,4 +1,5 @@
1
- import { Box, Container, SxProps, Theme, Typography } from '@mui/material'
1
+ import type { SxProps, Theme } from '@mui/material'
2
+ import { Box, Container, Typography } from '@mui/material'
2
3
  import React from 'react'
3
4
  import { extendableComponent } from '../Styles'
4
5
  import { responsiveVal } from '../Styles/responsiveVal'
@@ -1,12 +1,14 @@
1
- import { Box, SxProps, Theme, Typography } from '@mui/material'
2
- import { IconSvg, IconSvgProps } from '../IconSvg'
1
+ import type { SxProps, Theme } from '@mui/material'
2
+ import { Box, Typography } from '@mui/material'
3
+ import type { IconSvgProps } from '../IconSvg'
4
+ import { IconSvg } from '../IconSvg'
3
5
  import { extendableComponent } from '../Styles'
4
6
 
5
7
  // TODO: remove all occurrences. deprecated component
6
8
 
7
9
  export type IconHeaderSize = 'small' | 'medium' | 'large'
8
10
 
9
- type IconHeaderProps = {
11
+ export type IconHeaderProps = {
10
12
  children: React.ReactNode
11
13
  size?: IconHeaderSize
12
14
  noMargin?: boolean
@@ -1,7 +1,11 @@
1
- import { ImageProps, srcToString, StaticImport } from '@graphcommerce/image'
2
- import { styled, SxProps, Theme, useTheme, useThemeProps } from '@mui/material'
3
- import { ComponentProps, forwardRef } from 'react'
4
- import { extendableComponent, ExtendableComponent } from '../Styles/extendableComponent'
1
+ import type { ImageProps, StaticImport } from '@graphcommerce/image'
2
+ import { srcToString } from '@graphcommerce/image'
3
+ import type { SxProps, Theme } from '@mui/material'
4
+ import { styled, useTheme, useThemeProps } from '@mui/material'
5
+ import type { ComponentProps } from 'react'
6
+ import { forwardRef } from 'react'
7
+ import type { ExtendableComponent } from '../Styles/extendableComponent'
8
+ import { extendableComponent } from '../Styles/extendableComponent'
5
9
  import { responsiveVal as rv } from '../Styles/responsiveVal'
6
10
  import { svgIconStrokeWidth } from './svgIconStrokeWidth'
7
11
 
@@ -110,6 +114,3 @@ export const IconSvg = forwardRef<SVGSVGElement, IconSvgProps>((props, ref) => {
110
114
  )
111
115
  })
112
116
  IconSvg.displayName = 'IconSvg'
113
-
114
- /** @deprecated SvgIcon is renamed to IconSvg, no API changes */
115
- export const SvgIcon = IconSvg
@@ -1,10 +1,12 @@
1
- import { DateTimeFormat, DateTimeFormatPropsType } from './DateTimeFormat'
1
+ import type { DateTimeFormatProps } from './DateTimeFormat'
2
+ import { DateTimeFormat } from './DateTimeFormat'
2
3
 
3
- type DateFormatOptions = Omit<
4
- DateTimeFormatPropsType,
4
+ export type DateFormatProps = Omit<
5
+ DateTimeFormatProps,
5
6
  'timeStyle' | 'hour' | 'minute' | 'second' | 'timeZoneName'
6
7
  >
7
8
 
8
- export function DateFormat(props: DateFormatOptions) {
9
+ /** @public */
10
+ export function DateFormat(props: DateFormatProps) {
9
11
  return <DateTimeFormat timeStyle={undefined} {...props} />
10
12
  }
@@ -1,20 +1,16 @@
1
1
  import { useMemo } from 'react'
2
- import { useLocale } from '../../hooks/useLocale'
3
- import { useMemoObject } from '../../hooks/useMemoObject'
4
- import { DateValue, toDate } from './toDate'
2
+ import type { DateValue } from './toDate'
3
+ import { toDate } from './toDate'
4
+ import type { UseIntlDateTimeFormatOptions } from './useIntlDateTimeFormat'
5
+ import { useIntlDateTimeFormat } from './useIntlDateTimeFormat'
5
6
 
6
- export function useDateTimeFormatter(props: Intl.DateTimeFormatOptions) {
7
- const locale = useLocale()
8
- const memoOptions = useMemoObject(props)
9
- return useMemo(() => new Intl.DateTimeFormat(locale, memoOptions), [locale, memoOptions])
10
- }
11
-
12
- export type DateTimeFormatPropsType = { children: DateValue } & Intl.DateTimeFormatOptions
7
+ export type DateTimeFormatProps = UseIntlDateTimeFormatOptions & { date: DateValue }
13
8
 
14
- export function DateTimeFormat(props: DateTimeFormatPropsType) {
15
- const { children } = props
16
- const formatter = useDateTimeFormatter({ dateStyle: 'medium', timeStyle: 'short', ...props })
9
+ /** @public */
10
+ export function DateTimeFormat(props: DateTimeFormatProps) {
11
+ const { date } = props
12
+ const formatter = useIntlDateTimeFormat({ dateStyle: 'medium', timeStyle: 'short', ...props })
17
13
 
18
- const dateValue = useMemo(() => toDate(children), [children])
14
+ const dateValue = useMemo(() => toDate(date), [date])
19
15
  return <span suppressHydrationWarning>{dateValue ? formatter.format(dateValue) : null}</span>
20
16
  }