@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.
- package/ActionCard/ActionCard.tsx +219 -203
- package/ActionCard/ActionCardAccordion.tsx +4 -2
- package/ActionCard/ActionCardLayout.tsx +3 -2
- package/ActionCard/ActionCardList.tsx +6 -5
- package/Blog/BlogAuthor/BlogAuthor.tsx +5 -4
- package/Blog/BlogContent/BlogContent.tsx +3 -2
- package/Blog/BlogHeader/BlogHeader.tsx +4 -3
- package/Blog/BlogList/BlogList.tsx +3 -3
- package/Blog/BlogListItem/BlogListItem.tsx +6 -5
- package/Blog/BlogTags/BlogTag.tsx +3 -2
- package/Blog/BlogTags/BlogTags.tsx +1 -1
- package/Breadcrumbs/Breadcrumbs.tsx +25 -19
- package/Breadcrumbs/BreadcrumbsList.tsx +3 -2
- package/Breadcrumbs/jsonLdBreadcrumb.tsx +1 -1
- package/Breadcrumbs/types.ts +1 -2
- package/Button/Button.tsx +2 -1
- package/Button/LinkOrButton.tsx +4 -2
- package/CHANGELOG.md +294 -1342
- package/ChipMenu/ChipMenu.tsx +3 -2
- package/Config.graphqls +28 -10
- package/Container/Container.tsx +90 -0
- package/ContainerWithHeader/ContainerWithHeader.tsx +2 -1
- package/Document/DocumentBodyEnd.tsx +1 -1
- package/Document/DocumentBodyStart.tsx +1 -1
- package/Document/DocumentHeadEnd.tsx +1 -1
- package/Document/DocumentHeadStart.tsx +1 -1
- package/Fab/Fab.tsx +15 -17
- package/FlagAvatar/FlagAvatar.tsx +2 -1
- package/Footer/Footer.tsx +14 -10
- package/Form/Form.tsx +2 -1
- package/Form/FormHeader.tsx +1 -1
- package/Form/FormRow.tsx +1 -1
- package/Form/InputCheckmark.tsx +2 -1
- package/FramerScroller/ItemScroller.tsx +5 -8
- package/FramerScroller/SidebarGallery.tsx +23 -30
- package/FramerScroller/SidebarSlider.tsx +8 -7
- package/FullPageMessage/FullPageMessage.tsx +2 -1
- package/IconHeader/IconHeader.tsx +5 -3
- package/IconSvg/IconSvg.tsx +8 -7
- package/Intl/DateTimeFormat/DateFormat.tsx +6 -4
- package/Intl/DateTimeFormat/DateTimeFormat.tsx +10 -14
- package/Intl/DateTimeFormat/TimeFormat.tsx +6 -4
- package/Intl/DateTimeFormat/index.ts +1 -0
- package/Intl/DateTimeFormat/useIntlDateTimeFormat.ts +13 -0
- package/Intl/DisplayNames/DisplayNames.tsx +5 -13
- package/Intl/DisplayNames/index.ts +1 -0
- package/Intl/DisplayNames/useIntlDisplayNames.ts +12 -0
- package/Intl/{ListFormat.tsx → ListFormat/ListFormat.tsx} +8 -13
- package/Intl/ListFormat/index.ts +2 -0
- package/Intl/ListFormat/useIntlListFormat.ts +15 -0
- package/Intl/NumberFormat/CurrencyFormat.tsx +4 -2
- package/Intl/NumberFormat/NumberFormat.tsx +15 -17
- package/Intl/NumberFormat/PercentFormat.tsx +6 -2
- package/Intl/NumberFormat/UnitFormat.tsx +5 -5
- package/Intl/NumberFormat/index.ts +1 -0
- package/Intl/NumberFormat/useIntlNumberFormat.ts +17 -0
- package/Intl/RelativeTimeFormat/RelativeTimeFormat.tsx +6 -13
- package/Intl/RelativeTimeFormat/RelativeToTimeFormat.tsx +4 -2
- package/Intl/RelativeTimeFormat/index.ts +1 -0
- package/Intl/RelativeTimeFormat/useIntlRelativeTimeFormat.ts +15 -0
- package/Intl/useIntlLocalesArgument.ts +16 -0
- package/Layout/components/LayoutHeader.tsx +7 -4
- package/Layout/components/LayoutHeaderBack.tsx +6 -4
- package/Layout/components/LayoutHeaderClose.tsx +1 -1
- package/Layout/components/LayoutHeaderContent.tsx +11 -12
- package/Layout/components/LayoutProvider.tsx +1 -1
- package/Layout/components/LayoutTitle.tsx +5 -3
- package/Layout/context/layoutContext.tsx +1 -1
- package/Layout/types.ts +1 -1
- package/LayoutDefault/components/LayoutDefault.tsx +12 -10
- package/LayoutOverlay/components/LayoutOverlay.tsx +3 -2
- package/LayoutOverlay/components/LayoutOverlayHeader.tsx +2 -1
- package/LayoutOverlay/test/LayoutOverlayDemo.tsx +4 -1
- package/LayoutParts/DesktopHeaderBadge.tsx +2 -1
- package/LayoutParts/DesktopNavBar.tsx +26 -22
- package/LayoutParts/DesktopNavBarItem.tsx +11 -7
- package/LayoutParts/Logo.tsx +5 -5
- package/LayoutParts/MenuFab.tsx +7 -13
- package/LayoutParts/MenuFabItem.tsx +6 -1
- package/LayoutParts/MenuFabSecondaryItem.tsx +11 -7
- package/LayoutParts/MobileTopRight.tsx +24 -0
- package/LayoutParts/PlaceholderFab.tsx +2 -1
- package/LayoutParts/StickyBelowHeader.tsx +2 -1
- package/LayoutParts/index.ts +1 -0
- package/LazyHydrate/LazyHydrate.tsx +18 -21
- package/MediaQuery/MediaQuery.tsx +111 -0
- package/MediaQuery/index.ts +1 -0
- package/Navigation/components/NavigationFab.tsx +3 -2
- package/Navigation/components/NavigationItem.tsx +3 -3
- package/Navigation/components/NavigationList.tsx +4 -3
- package/Navigation/components/NavigationOverlay.tsx +18 -11
- package/Navigation/components/NavigationProvider.tsx +9 -8
- package/Navigation/components/NavigationTitle.tsx +5 -5
- package/Navigation/hooks/useNavigation.ts +4 -2
- package/Overlay/components/Overlay.tsx +3 -2
- package/Overlay/components/OverlayBase.tsx +71 -30
- package/Overlay/components/OverlayContainer.tsx +2 -2
- package/Overlay/components/OverlayHeader.tsx +7 -4
- package/Overlay/components/OverlaySsr.tsx +2 -1
- package/Overlay/components/OverlayStickyBottom.tsx +2 -1
- package/Overlay/utils/variantsToScrollSnapType.ts +2 -2
- package/OverlayOrPopperChip/OverlayOrPopperChip.tsx +5 -12
- package/OverlayOrPopperChip/OverlayOrPopperPanel.tsx +3 -3
- package/OverlayOrPopperChip/OverlayPanel.tsx +13 -7
- package/OverlayOrPopperChip/OverlayPanelActions.tsx +2 -2
- package/OverlayOrPopperChip/PopperPanel.tsx +3 -2
- package/OverlayOrPopperChip/PopperPanelActions.tsx +2 -2
- package/OverlayOrPopperChip/types.ts +2 -2
- package/OverlayOrPopperChip/useHandleClickNotDrag.ts +3 -1
- package/Page/CssAndFramerMotionProvider.tsx +2 -1
- package/Page/types.ts +5 -5
- package/PageLoadIndicator/PageLoadIndicator.tsx +3 -2
- package/PageMeta/PageMeta.tsx +3 -2
- package/PageMeta/canonicalize.ts +7 -3
- package/Pagination/Pagination.tsx +4 -2
- package/Pagination/PaginationExtended.tsx +2 -9
- package/RenderType/RenderType.tsx +6 -0
- package/Row/ButtonLinkList/ButtonLinkList.tsx +4 -7
- package/Row/ButtonLinkList/ButtonLinkListItem.tsx +2 -1
- package/Row/ColumnOne/variant/VariantMessage.tsx +2 -4
- package/Row/ColumnOneBoxed/ColumnOneBoxed.tsx +4 -2
- package/Row/ColumnOneCentered/ColumnOneCentered.tsx +4 -2
- package/Row/ColumnThree/ColumnThree.tsx +6 -5
- package/Row/ColumnTwo/ColumnTwo.tsx +8 -7
- package/Row/ColumnTwoSpread/ColumnTwoSpread.tsx +7 -5
- package/Row/ColumnTwoWithTop/ColumnTwoWithTop.tsx +5 -4
- package/Row/ContentLinks/ContentLinks.tsx +4 -3
- package/Row/HeroBanner/HeroBanner.tsx +3 -2
- package/Row/IconBlocks/IconBlock.tsx +3 -2
- package/Row/IconBlocks/IconBlocks.tsx +3 -2
- package/Row/ImageText/ImageText.tsx +3 -2
- package/Row/ImageTextBoxed/ImageTextBoxed.tsx +4 -3
- package/Row/ParagraphWithSidebarSlide/ParagraphWithSidebarSlide.tsx +3 -2
- package/Row/Quote/Quote.tsx +1 -1
- package/Row/Row.tsx +2 -1
- package/Row/RowLinks/RowLinks.tsx +36 -34
- package/Row/RowLinks/variant/VariantImageLabelSwiper.tsx +6 -2
- package/Row/RowLinks/variant/VariantInline.tsx +6 -2
- package/Row/RowLinks/variant/VariantLogoSwiper.tsx +2 -1
- package/Row/RowLinks/variant/VariantUsps.tsx +2 -1
- package/Row/SpecialBanner/SpecialBanner.tsx +3 -2
- package/SectionContainer/SectionContainer.tsx +3 -2
- package/SectionHeader/SectionHeader.tsx +2 -1
- package/Separator/Separator.tsx +3 -2
- package/Snackbar/DismissibleSnackbar.tsx +1 -1
- package/Snackbar/ErrorSnackbar.tsx +1 -1
- package/Snackbar/MessageSnackbarImpl.tsx +7 -16
- package/StarRatingField/StarRatingField.tsx +3 -2
- package/Stepper/Stepper.tsx +3 -2
- package/Styles/__tests__/spreadVal.test.ts +4 -4
- package/Styles/extendableComponent.ts +4 -3
- package/Styles/withEmotionCache.tsx +2 -2
- package/Styles/withTheme.tsx +4 -1
- package/TextInputNumber/TextInputNumber.tsx +5 -8
- package/Theme/DarkLightModeThemeProvider.tsx +10 -7
- package/Theme/MuiButton.ts +2 -1
- package/Theme/MuiChip.ts +2 -1
- package/Theme/MuiFab.ts +2 -1
- package/Theme/MuiSlider.ts +3 -3
- package/Theme/MuiSnackbar.ts +1 -1
- package/Theme/NextLink.tsx +35 -15
- package/Theme/createTheme.ts +6 -0
- package/Theme/index.ts +1 -0
- package/Theme/themeDefaults.ts +10 -10
- package/Theme/useContainerSizing.ts +20 -0
- package/TimeAgo/TimeAgo.tsx +3 -3
- package/ToggleButton/ToggleButton.tsx +6 -4
- package/ToggleButtonGroup/ToggleButtonGroup.tsx +99 -94
- package/UspList/UspList.tsx +3 -2
- package/UspList/UspListItem.tsx +3 -2
- package/hooks/memoDeep.ts +3 -2
- package/hooks/useDateTimeFormat.ts +3 -1
- package/hooks/useMatchMedia.ts +2 -1
- package/hooks/useMemoDeep.ts +2 -1
- package/hooks/useNumberFormat.ts +3 -1
- package/index.ts +3 -1
- package/package.json +17 -18
- package/utils/cookie.ts +4 -3
- package/utils/robots.ts +1 -1
- package/utils/sitemap.ts +3 -2
- package/utils/sxx.ts +16 -0
- package/AnimatedRow/AnimatedRow.tsx +0 -23
- package/docs/building-components.mdx +0 -3
- package/docs/components/ComponentBasic.tsx +0 -26
- package/docs/components/ComponentChild.tsx +0 -49
- package/docs/components/ComponentChildVariant.tsx +0 -55
- package/docs/components/ComponentChildVariantExtendable.tsx +0 -63
- package/docs/components/ComponentStylable.tsx +0 -32
- 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:
|
|
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 {
|
|
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'
|
|
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:
|
|
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'
|
|
69
|
+
<DateFormat dateStyle='long' date={date} />
|
|
69
70
|
</Box>
|
|
70
71
|
)}
|
|
71
72
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
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>
|
|
@@ -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 {
|
|
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*/
|
|
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
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
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 {
|
|
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
|
package/Breadcrumbs/types.ts
CHANGED
package/Button/Button.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* eslint-disable react/forbid-foreign-prop-types */
|
|
2
|
-
import {
|
|
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'],
|
package/Button/LinkOrButton.tsx
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { Breakpoint,
|
|
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 {
|
|
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]
|