@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,63 +0,0 @@
|
|
|
1
|
-
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
-
import { ExtendableComponent, extendableComponent } from '@graphcommerce/next-ui'
|
|
3
|
-
import { styled } from '@mui/material'
|
|
4
|
-
import { ComponentProps } from 'react'
|
|
5
|
-
|
|
6
|
-
// ---- Setup ----
|
|
7
|
-
|
|
8
|
-
// To be able to select children from the consuming side, we define the classes.
|
|
9
|
-
// Minimal utility to convert the classes to selectors. Hover over `selectors` to see what it means.
|
|
10
|
-
const componentName = 'MyComponent' as const
|
|
11
|
-
const { classes, selectors } = extendableComponent(componentName, ['root', 'child'] as const)
|
|
12
|
-
|
|
13
|
-
// Props that are used in our styled elements to render different CSS
|
|
14
|
-
type MyComponentStyleProps = { variant?: 'cool' | 'supercool' }
|
|
15
|
-
|
|
16
|
-
// Expose the component to be exendable in your theme.components
|
|
17
|
-
declare module '@mui/material/styles/components' {
|
|
18
|
-
interface Components {
|
|
19
|
-
MyComponent?: ExtendableComponent<MyComponentStyleProps>
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// ---- Root component ----
|
|
24
|
-
|
|
25
|
-
// We're creating a new styled('div') component and apply our styles to it.
|
|
26
|
-
const Root = styled('div', {
|
|
27
|
-
name: componentName,
|
|
28
|
-
target: classes.root, // Adds a class name `MyComponent` to the div.
|
|
29
|
-
})<MyComponentStyleProps>(({ theme }) => ({
|
|
30
|
-
// Styles are added
|
|
31
|
-
display: 'flex',
|
|
32
|
-
color: theme.palette.text.primary,
|
|
33
|
-
}))
|
|
34
|
-
|
|
35
|
-
// ---- Child component ----
|
|
36
|
-
|
|
37
|
-
const Child = styled('div', {
|
|
38
|
-
name: componentName,
|
|
39
|
-
slot: 'child', // A slot is used as we do not want to receive style overrides from theme.components.MyComponent.variants.
|
|
40
|
-
target: classes.child, // Mandatory for children, adds a class name `MyComponent-child` so it can be styled from the outside.
|
|
41
|
-
})<MyComponentStyleProps>(({ theme, variant }) => ({
|
|
42
|
-
backgroundColor: theme.palette.primary.main,
|
|
43
|
-
width: 100,
|
|
44
|
-
height: 100,
|
|
45
|
-
fontSize: variant === 'supercool' ? 'large' : 'normal',
|
|
46
|
-
}))
|
|
47
|
-
|
|
48
|
-
// ---- MyComponent component ----
|
|
49
|
-
|
|
50
|
-
// Props of the component we are writing
|
|
51
|
-
export type MyComponentProps = Pick<ComponentProps<typeof Root>, 'sx' | 'children'> &
|
|
52
|
-
MyComponentStyleProps
|
|
53
|
-
|
|
54
|
-
export function MyComponent(props: MyComponentProps) {
|
|
55
|
-
const { sx, children, variant } = props
|
|
56
|
-
return (
|
|
57
|
-
<Root as='span' sx={sx} variant={variant}>
|
|
58
|
-
My Component <Child variant={variant}>{children}</Child>
|
|
59
|
-
</Root>
|
|
60
|
-
)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
MyComponent.selectors = selectors
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { styled } from '@mui/material'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
|
|
4
|
-
// ---- Setup ----
|
|
5
|
-
|
|
6
|
-
const name = 'MyComponent'
|
|
7
|
-
|
|
8
|
-
// ---- Root component ----
|
|
9
|
-
|
|
10
|
-
// We're creating a new styled('div') component and apply our styles to it.
|
|
11
|
-
const Root = styled('div', {
|
|
12
|
-
name, // Name of the component we are building, so 'MyComponent' in this example
|
|
13
|
-
})(({ theme }) => ({
|
|
14
|
-
padding: '3px',
|
|
15
|
-
display: 'flex',
|
|
16
|
-
color: theme.palette.text.primary,
|
|
17
|
-
}))
|
|
18
|
-
|
|
19
|
-
// ---- MyComponent component ----
|
|
20
|
-
|
|
21
|
-
// Props of the component we are writing
|
|
22
|
-
export type MyComponentProps = Pick<React.ComponentProps<typeof Root>, 'sx' | 'children'>
|
|
23
|
-
|
|
24
|
-
export function MyComponent(props: MyComponentProps) {
|
|
25
|
-
const { sx, children } = props
|
|
26
|
-
return (
|
|
27
|
-
<Root as='span' sx={sx}>
|
|
28
|
-
My Component
|
|
29
|
-
{children}
|
|
30
|
-
</Root>
|
|
31
|
-
)
|
|
32
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { ThemeProvider, Typography, useTheme } from '@mui/material'
|
|
2
|
-
import { MyComponent as ComponentChild } from '../components/ComponentChild'
|
|
3
|
-
import { MyComponent as ComponentChildVariant } from '../components/ComponentChildVariant'
|
|
4
|
-
import { MyComponent as ComponentChildVariantExtendable } from '../components/ComponentChildVariantExtendable'
|
|
5
|
-
import { MyComponent as ComponentStylable } from '../components/ComponentStylable'
|
|
6
|
-
|
|
7
|
-
export function UsingBasic() {
|
|
8
|
-
const theme = useTheme()
|
|
9
|
-
|
|
10
|
-
return (
|
|
11
|
-
<>
|
|
12
|
-
<Typography variant='h3'>Basic</Typography>
|
|
13
|
-
|
|
14
|
-
<ComponentStylable
|
|
15
|
-
sx={{
|
|
16
|
-
backgroundColor: 'primary.main',
|
|
17
|
-
}}
|
|
18
|
-
>
|
|
19
|
-
Component Stylable
|
|
20
|
-
</ComponentStylable>
|
|
21
|
-
|
|
22
|
-
<Typography variant='h3'>With a child</Typography>
|
|
23
|
-
|
|
24
|
-
<ComponentChild
|
|
25
|
-
sx={{
|
|
26
|
-
backgroundColor: 'secondary.main',
|
|
27
|
-
[ComponentChild.selectors.child]: {
|
|
28
|
-
backgroundColor: 'secondary.dark',
|
|
29
|
-
},
|
|
30
|
-
}}
|
|
31
|
-
>
|
|
32
|
-
Component with a child
|
|
33
|
-
</ComponentChild>
|
|
34
|
-
|
|
35
|
-
<Typography variant='h3'>With a variant</Typography>
|
|
36
|
-
|
|
37
|
-
<ComponentChildVariant variant='supercool'>Component Child Variant</ComponentChildVariant>
|
|
38
|
-
|
|
39
|
-
<Typography variant='h3'>With a variant and extendable</Typography>
|
|
40
|
-
|
|
41
|
-
<ThemeProvider
|
|
42
|
-
theme={{
|
|
43
|
-
...theme,
|
|
44
|
-
components: {
|
|
45
|
-
...theme.components,
|
|
46
|
-
MyComponent: {
|
|
47
|
-
styleOverrides: {
|
|
48
|
-
root: {
|
|
49
|
-
fontSize: '120%',
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
}}
|
|
55
|
-
>
|
|
56
|
-
<ComponentChildVariantExtendable>
|
|
57
|
-
Component Child Variant but extendable
|
|
58
|
-
</ComponentChildVariantExtendable>
|
|
59
|
-
</ThemeProvider>
|
|
60
|
-
</>
|
|
61
|
-
)
|
|
62
|
-
}
|