@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,7 @@
1
- import { ContainerProps } from '@mui/material'
1
+ import type { ContainerProps } from '@mui/material'
2
2
  import { Row } from '../../Row/Row'
3
3
 
4
- type BlogItemGridProps = ContainerProps
4
+ export type BlogItemGridProps = ContainerProps
5
5
 
6
6
  export function BlogItemGrid(props: BlogItemGridProps) {
7
7
  const { sx = [], ...containerProps } = props
@@ -12,7 +12,7 @@ export function BlogItemGrid(props: BlogItemGridProps) {
12
12
  (theme) => ({
13
13
  display: 'grid',
14
14
  gap: theme.spacings.md,
15
- gridTemplateColumns: { xs: `repeat(2, 1fr)`, md: `repeat(3, 1fr)`, lg: `repeat(4, 1fr)` },
15
+ gridTemplateColumns: { xs: 'repeat(2, 1fr)', md: 'repeat(3, 1fr)', lg: 'repeat(4, 1fr)' },
16
16
  }),
17
17
  ...(Array.isArray(sx) ? sx : [sx]),
18
18
  ]}
@@ -1,8 +1,9 @@
1
- import { Box, Link, SxProps, Theme, Typography } from '@mui/material'
1
+ import type { SxProps, Theme } from '@mui/material'
2
+ import { Box, Link, Typography } from '@mui/material'
2
3
  import React from 'react'
4
+ import { DateFormat } from '../../Intl'
3
5
  import { extendableComponent } from '../../Styles'
4
6
  import { breakpointVal } from '../../Styles/breakpointVal'
5
- import { DateFormat } from '../../Intl'
6
7
 
7
8
  export type BlogListItemProps = {
8
9
  asset: React.ReactNode
@@ -12,7 +13,7 @@ export type BlogListItemProps = {
12
13
  sx?: SxProps<Theme>
13
14
  }
14
15
 
15
- const name = 'BlogListItem' as const
16
+ const name = 'BlogListItem'
16
17
  const parts = ['item', 'date', 'asset', 'title'] as const
17
18
  const { classes } = extendableComponent(name, parts)
18
19
 
@@ -25,7 +26,7 @@ export function BlogListItem(props: BlogListItemProps) {
25
26
  sx={[
26
27
  (theme) => ({
27
28
  display: 'grid',
28
- gridTemplateRows: `auto auto auto`,
29
+ gridTemplateRows: 'auto auto auto',
29
30
  alignContent: 'start',
30
31
  color: theme.palette.text.primary,
31
32
  gap: theme.spacings.xxs,
@@ -65,7 +66,7 @@ export function BlogListItem(props: BlogListItemProps) {
65
66
  color: theme.palette.text.secondary,
66
67
  })}
67
68
  >
68
- <DateFormat dateStyle='long'>{date}</DateFormat>
69
+ <DateFormat dateStyle='long' date={date} />
69
70
  </Box>
70
71
  )}
71
72
 
@@ -1,7 +1,8 @@
1
- import { Chip, SxProps, Theme } from '@mui/material'
1
+ import type { SxProps, Theme } from '@mui/material'
2
+ import { Chip } from '@mui/material'
2
3
  import { NextLink } from '../../Theme'
3
4
 
4
- type BlogTagsProps = {
5
+ export type BlogTagsProps = {
5
6
  url: string
6
7
  title: string
7
8
  sx?: SxProps<Theme>
@@ -2,7 +2,7 @@ import { styled } from '@mui/material'
2
2
 
3
3
  export const BlogTags = styled('div')(({ theme }) => ({
4
4
  maxWidth: theme.breakpoints.values.md,
5
- margin: `0 auto`,
5
+ margin: '0 auto',
6
6
  marginBottom: theme.spacings.sm,
7
7
  }))
8
8
 
@@ -1,25 +1,27 @@
1
+ import { i18n } from '@lingui/core'
1
2
  import { Trans } from '@lingui/react'
3
+ import type {
4
+ LinkProps,
5
+ BreadcrumbsProps as MuiBreadcrumbProps,
6
+ SxProps,
7
+ Theme,
8
+ } from '@mui/material'
2
9
  import {
3
10
  Box,
4
- Breadcrumbs as MuiBreadcrumbs,
5
- BreadcrumbsProps as MuiBreadcrumbProps,
6
11
  ClickAwayListener,
7
- IconButton,
8
12
  Link,
13
+ Breadcrumbs as MuiBreadcrumbs,
9
14
  Typography,
10
15
  useEventCallback,
11
16
  useTheme,
12
- SxProps,
13
- Theme,
14
- LinkProps,
15
17
  } from '@mui/material'
16
18
  import dynamic from 'next/dynamic'
17
- import { useState, MouseEvent } from 'react'
19
+ import type { MouseEvent } from 'react'
20
+ import { useState } from 'react'
21
+ import { Button } from '../Button'
18
22
  import { IconSvg } from '../IconSvg'
19
23
  import { iconClose, iconEllypsis } from '../icons'
20
24
  import type { BreadcrumbsType } from './types'
21
- import { i18n } from '@lingui/core'
22
- import { Button } from '../Button'
23
25
 
24
26
  const BreadcrumbsPopper = dynamic(
25
27
  async () => (await import('./BreadcrumbsPopper')).BreadcrumbsPopper,
@@ -33,6 +35,7 @@ export type BreadcrumbsProps = BreadcrumbsType &
33
35
  breadcrumbsAmountMobile?: number
34
36
  itemSx?: SxProps<Theme>
35
37
  linkProps?: Omit<LinkProps, 'href'>
38
+ disableHome?: boolean
36
39
  }
37
40
 
38
41
  export function Breadcrumbs(props: BreadcrumbsProps) {
@@ -45,6 +48,7 @@ export function Breadcrumbs(props: BreadcrumbsProps) {
45
48
  maxItems,
46
49
  itemSx = [],
47
50
  linkProps,
51
+ disableHome = false,
48
52
  ...rest
49
53
  } = props
50
54
  const [anchorElement, setAnchorElement] = useState<HTMLButtonElement | null>(null)
@@ -67,7 +71,7 @@ export function Breadcrumbs(props: BreadcrumbsProps) {
67
71
  return (
68
72
  <MuiBreadcrumbs
69
73
  {...rest}
70
- aria-label={i18n._(/* i18n*/ `Breadcrumbs`)}
74
+ aria-label={i18n._(/* i18n*/ 'Breadcrumbs')}
71
75
  maxItems={maxItems}
72
76
  color='inherit'
73
77
  sx={[
@@ -155,15 +159,17 @@ export function Breadcrumbs(props: BreadcrumbsProps) {
155
159
  </ClickAwayListener>
156
160
  )}
157
161
 
158
- <Link
159
- href='/'
160
- color='inherit'
161
- underline='hover'
162
- {...linkProps}
163
- sx={[...(Array.isArray(itemSx) ? itemSx : [itemSx])]}
164
- >
165
- <Trans id='Home' />
166
- </Link>
162
+ {disableHome ? null : (
163
+ <Link
164
+ href='/'
165
+ color='inherit'
166
+ underline='hover'
167
+ {...linkProps}
168
+ sx={[...(Array.isArray(itemSx) ? itemSx : [itemSx])]}
169
+ >
170
+ <Trans id='Home' />
171
+ </Link>
172
+ )}
167
173
  {breadcrumbLinks.map((breadcrumb) => (
168
174
  <Link
169
175
  key={breadcrumb.href}
@@ -1,9 +1,10 @@
1
1
  import { Trans } from '@lingui/react'
2
2
  import { Box, Link, alpha, useTheme } from '@mui/material'
3
- import { useEffect, useRef, KeyboardEvent } from 'react'
3
+ import type { KeyboardEvent } from 'react'
4
+ import { useEffect, useRef } from 'react'
4
5
  import type { BreadcrumbsType } from './types'
5
6
 
6
- type PopperBreadcrumbsListProps = {
7
+ export type PopperBreadcrumbsListProps = {
7
8
  autoFocus: boolean
8
9
  breadcrumbs: BreadcrumbsType['breadcrumbs']
9
10
  showDesktopAmount?: number
@@ -1,4 +1,4 @@
1
- import { NextRouter } from 'next/router'
1
+ import type { NextRouter } from 'next/router'
2
2
  import type { BreadcrumbList } from 'schema-dts'
3
3
  import { canonicalize } from '../PageMeta/canonicalize'
4
4
  import type { BreadcrumbsType } from './types'
@@ -1,5 +1,4 @@
1
- import { Theme } from '@emotion/react'
2
- import { SxProps } from '@mui/material'
1
+ import type { SxProps, Theme } from '@mui/material'
3
2
 
4
3
  export type BreadcrumbItem = {
5
4
  name: string
package/Button/Button.tsx CHANGED
@@ -1,5 +1,6 @@
1
1
  /* eslint-disable react/forbid-foreign-prop-types */
2
- import { LoadingButton as Button, LoadingButtonProps, LoadingButtonTypeMap } from '@mui/lab'
2
+ import type { LoadingButtonProps, LoadingButtonTypeMap } from '@mui/lab'
3
+ import { LoadingButton as Button } from '@mui/lab'
3
4
 
4
5
  export type ButtonProps<
5
6
  D extends React.ElementType = LoadingButtonTypeMap['defaultComponent'],
@@ -1,7 +1,9 @@
1
- import { Breakpoint, Link, LinkProps, useForkRef } from '@mui/material'
1
+ import type { Breakpoint, LinkProps } from '@mui/material'
2
+ import { Link, useForkRef } from '@mui/material'
2
3
  import React, { useRef } from 'react'
3
4
  import type { ConditionalExcept } from 'type-fest'
4
- import { Button, ButtonProps } from './Button'
5
+ import type { ButtonProps } from './Button'
6
+ import { Button } from './Button'
5
7
 
6
8
  type OmitNever<T extends Record<string, unknown>> = {
7
9
  [K in keyof T as T[K] extends never ? never : K]: T[K]