@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
package/ChipMenu/ChipMenu.tsx
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
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
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 {
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
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
|
-
|
|
54
|
-
|
|
51
|
+
slotProps?.circularProgress?.sx,
|
|
52
|
+
)}
|
|
55
53
|
/>
|
|
56
54
|
)}
|
|
57
55
|
</FabBase>
|
package/Footer/Footer.tsx
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { ContainerProps
|
|
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
|
-
|
|
46
|
+
pt: theme.spacings.lg,
|
|
47
|
+
pb: theme.spacings.lg,
|
|
43
48
|
justifyItems: 'center',
|
|
44
49
|
gridTemplateAreas: `
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
|
|
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:
|
|
133
|
+
gap: '8px',
|
|
130
134
|
},
|
|
131
135
|
})}
|
|
132
136
|
className={classes.copyright}
|
package/Form/Form.tsx
CHANGED
package/Form/FormHeader.tsx
CHANGED
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:
|
|
7
|
+
gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))',
|
|
8
8
|
gap: `calc(${theme.spacings.xxs} * 2)`,
|
|
9
9
|
}))
|
package/Form/InputCheckmark.tsx
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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:
|
|
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
|
-
|
|
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'
|
|
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
|
|
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
|
-
|
|
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:
|
|
241
|
-
gridTemplateRows:
|
|
233
|
+
gridAutoColumns: '100%',
|
|
234
|
+
gridTemplateRows: '100%',
|
|
242
235
|
cursor: disableZoom ? 'auto' : 'zoom-in',
|
|
243
236
|
},
|
|
244
237
|
zoomed && {
|
|
245
|
-
height:
|
|
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:
|
|
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:
|
|
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 {
|
|
9
|
-
import {
|
|
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:
|
|
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:
|
|
101
|
+
top: 'calc(50% - 28px)',
|
|
101
102
|
})}
|
|
102
103
|
>
|
|
103
104
|
<ScrollerButton
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
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 {
|
|
2
|
-
import {
|
|
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
|
package/IconSvg/IconSvg.tsx
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { ImageProps,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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 {
|
|
1
|
+
import type { DateTimeFormatProps } from './DateTimeFormat'
|
|
2
|
+
import { DateTimeFormat } from './DateTimeFormat'
|
|
2
3
|
|
|
3
|
-
type
|
|
4
|
-
|
|
4
|
+
export type DateFormatProps = Omit<
|
|
5
|
+
DateTimeFormatProps,
|
|
5
6
|
'timeStyle' | 'hour' | 'minute' | 'second' | 'timeZoneName'
|
|
6
7
|
>
|
|
7
8
|
|
|
8
|
-
|
|
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 {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
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(
|
|
14
|
+
const dateValue = useMemo(() => toDate(date), [date])
|
|
19
15
|
return <span suppressHydrationWarning>{dateValue ? formatter.format(dateValue) : null}</span>
|
|
20
16
|
}
|