@graphcommerce/next-ui 8.1.0-canary.8 → 9.0.0-canary.100

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 (83) hide show
  1. package/ActionCard/ActionCard.tsx +66 -39
  2. package/ActionCard/ActionCardAccordion.tsx +2 -1
  3. package/ActionCard/ActionCardLayout.tsx +1 -1
  4. package/ActionCard/ActionCardList.tsx +11 -10
  5. package/ActionCard/index.ts +0 -1
  6. package/Blog/BlogAuthor/BlogAuthor.tsx +2 -4
  7. package/Blog/BlogListItem/BlogListItem.tsx +2 -4
  8. package/Blog/BlogTags/BlogTag.tsx +4 -1
  9. package/Breadcrumbs/Breadcrumbs.tsx +195 -0
  10. package/Breadcrumbs/BreadcrumbsJsonLd.tsx +13 -0
  11. package/Breadcrumbs/BreadcrumbsList.tsx +101 -0
  12. package/Breadcrumbs/BreadcrumbsPopper.tsx +48 -0
  13. package/Breadcrumbs/index.ts +4 -0
  14. package/Breadcrumbs/jsonLdBreadcrumb.tsx +19 -0
  15. package/Breadcrumbs/types.ts +11 -0
  16. package/CHANGELOG.md +341 -98
  17. package/Config.graphqls +5 -0
  18. package/Document/DocumentBodyEnd.tsx +7 -0
  19. package/Document/DocumentBodyStart.tsx +7 -0
  20. package/Document/DocumentHeadEnd.tsx +7 -0
  21. package/Document/DocumentHeadStart.tsx +7 -0
  22. package/Document/index.ts +4 -0
  23. package/Footer/Footer.tsx +1 -1
  24. package/FramerScroller/SidebarGallery.tsx +54 -27
  25. package/FullPageMessage/FullPageMessage.tsx +1 -0
  26. package/Intl/DateTimeFormat/DateFormat.tsx +10 -0
  27. package/Intl/DateTimeFormat/DateTimeFormat.tsx +20 -0
  28. package/Intl/DateTimeFormat/TimeFormat.tsx +10 -0
  29. package/Intl/DateTimeFormat/index.ts +3 -0
  30. package/Intl/DateTimeFormat/toDate.ts +16 -0
  31. package/Intl/DisplayNames/DisplayNames.tsx +22 -0
  32. package/Intl/DisplayNames/index.ts +1 -0
  33. package/Intl/ListFormat.tsx +33 -0
  34. package/Intl/NumberFormat/CurrencyFormat.tsx +191 -0
  35. package/Intl/NumberFormat/NumberFormat.tsx +24 -0
  36. package/Intl/NumberFormat/PercentFormat.tsx +5 -0
  37. package/Intl/NumberFormat/UnitFormat.tsx +59 -0
  38. package/Intl/NumberFormat/index.ts +4 -0
  39. package/Intl/RelativeTimeFormat/RelativeTimeFormat.tsx +34 -0
  40. package/Intl/RelativeTimeFormat/RelativeToTimeFormat.tsx +35 -0
  41. package/Intl/RelativeTimeFormat/index.ts +2 -0
  42. package/Intl/RelativeTimeFormat/relativeTimeFormatAutoUnit.ts +23 -0
  43. package/Intl/index.ts +11 -0
  44. package/JsonLd/JsonLd.tsx +3 -2
  45. package/Layout/components/LayoutHeader.tsx +30 -10
  46. package/Layout/components/LayoutHeaderBack.tsx +20 -9
  47. package/Layout/components/LayoutHeaderClose.tsx +8 -2
  48. package/Layout/components/LayoutTitle.tsx +0 -5
  49. package/LayoutDefault/components/LayoutDefault.tsx +15 -13
  50. package/LazyHydrate/LazyHydrate.tsx +19 -3
  51. package/Overlay/components/OverlayBase.tsx +31 -6
  52. package/Overlay/components/OverlayHeader.tsx +27 -0
  53. package/Overlay/components/index.ts +1 -0
  54. package/PageLoadIndicator/PageLoadIndicator.tsx +25 -14
  55. package/PageMeta/PageMeta.tsx +1 -71
  56. package/PageMeta/canonicalize.ts +78 -0
  57. package/Pagination/PaginationExtended.tsx +103 -0
  58. package/Snackbar/MessageSnackbarImpl.tsx +60 -19
  59. package/Styles/responsiveVal.tsx +4 -5
  60. package/Styles/withEmotionCache.tsx +2 -2
  61. package/Theme/DarkLightModeThemeProvider.tsx +41 -19
  62. package/Theme/MuiButton.ts +11 -3
  63. package/TimeAgo/TimeAgo.tsx +3 -0
  64. package/hooks/index.ts +2 -1
  65. package/hooks/memoDeep.ts +38 -0
  66. package/hooks/useDateTimeFormat.ts +4 -4
  67. package/hooks/{useSsr.ts → useIsSsr.ts} +3 -0
  68. package/hooks/useLocale.ts +2 -2
  69. package/hooks/useNumberFormat.ts +4 -3
  70. package/hooks/useStorefrontConfig.ts +1 -9
  71. package/hooks/useUrlQuery.ts +6 -4
  72. package/icons.ts +55 -0
  73. package/index.ts +11 -2
  74. package/package.json +14 -14
  75. package/server.ts +9 -0
  76. package/utils/cssFlags.tsx +53 -0
  77. package/utils/getCssFlagInitScript.tsx +20 -0
  78. package/utils/normalizeLocale.ts +26 -0
  79. package/utils/robots.ts +41 -0
  80. package/utils/sitemap.ts +47 -0
  81. package/utils/storefrontConfig.ts +8 -0
  82. package/ActionCard/ActionCardListForm.tsx +0 -88
  83. package/icons/index.ts +0 -48
@@ -0,0 +1,48 @@
1
+ import { Box, Popper } from '@mui/material'
2
+ import { BreadcrumbsList } from './BreadcrumbsList'
3
+ import type { BreadcrumbsType } from './types'
4
+
5
+ export type BreadcrumbsPopperType = BreadcrumbsType & {
6
+ anchorElement: HTMLButtonElement | null
7
+ showDesktopAmount?: number
8
+ showMobileAmount?: number
9
+ onClose: () => void
10
+ }
11
+
12
+ export function BreadcrumbsPopper(props: BreadcrumbsPopperType) {
13
+ const { anchorElement, breadcrumbs, showDesktopAmount, showMobileAmount, onClose } = props
14
+
15
+ return (
16
+ <Popper
17
+ anchorEl={anchorElement}
18
+ open={Boolean(anchorElement)}
19
+ disablePortal
20
+ placement='bottom-start'
21
+ modifiers={[
22
+ { name: 'offset', options: { offset: [0, 10] } },
23
+ {
24
+ name: 'preventOverflow',
25
+ enabled: true,
26
+ options: { altBoundary: false, padding: 10 },
27
+ },
28
+ ]}
29
+ sx={(theme) => ({
30
+ maxWidth: {
31
+ md: `calc(100vw - ${theme.spacings.xxl} * 2)`,
32
+ xs: `calc(100vw - ${theme.page.horizontal} * 2)`,
33
+ },
34
+ zIndex: 100,
35
+ })}
36
+ >
37
+ <Box>
38
+ <BreadcrumbsList
39
+ autoFocus={Boolean(anchorElement)}
40
+ breadcrumbs={breadcrumbs}
41
+ showDesktopAmount={showDesktopAmount}
42
+ showMobileAmount={showMobileAmount}
43
+ onClose={onClose}
44
+ />
45
+ </Box>
46
+ </Popper>
47
+ )
48
+ }
@@ -0,0 +1,4 @@
1
+ export * from './Breadcrumbs'
2
+ export * from './types'
3
+ export * from './BreadcrumbsJsonLd'
4
+ export * from './jsonLdBreadcrumb'
@@ -0,0 +1,19 @@
1
+ import { NextRouter } from 'next/router'
2
+ import type { BreadcrumbList } from 'schema-dts'
3
+ import { canonicalize } from '../PageMeta/canonicalize'
4
+ import type { BreadcrumbsType } from './types'
5
+
6
+ export function jsonLdBreadcrumb(
7
+ breadcrumbs: BreadcrumbsType['breadcrumbs'],
8
+ router: NextRouter,
9
+ ): BreadcrumbList {
10
+ return {
11
+ '@type': 'BreadcrumbList',
12
+ itemListElement: breadcrumbs.map(({ name, href }, index) => ({
13
+ '@type': 'ListItem',
14
+ position: index + 1,
15
+ name,
16
+ item: canonicalize(router, href),
17
+ })),
18
+ }
19
+ }
@@ -0,0 +1,11 @@
1
+ import { Theme } from '@emotion/react'
2
+ import { SxProps } from '@mui/material'
3
+
4
+ export type BreadcrumbItem = {
5
+ name: string
6
+ href: string
7
+ }
8
+
9
+ export type BreadcrumbsType = {
10
+ breadcrumbs: ({ sx?: SxProps<Theme> } & BreadcrumbItem)[]
11
+ }