@graphcommerce/next-ui 10.0.0-canary.67 → 10.0.0-canary.68
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 +30 -21
- package/ActionCard/ActionCardAccordion.tsx +2 -2
- package/ActionCard/ActionCardLayout.tsx +4 -3
- package/ActionCard/ActionCardList.tsx +13 -6
- package/Blog/BlogAuthor/BlogAuthor.tsx +9 -7
- package/Blog/BlogContent/BlogContent.tsx +7 -4
- package/Blog/BlogHeader/BlogHeader.tsx +7 -4
- package/Blog/BlogList/BlogList.tsx +4 -3
- package/Blog/BlogListItem/BlogListItem.tsx +6 -5
- package/Blog/BlogTags/BlogTag.tsx +2 -4
- package/Blog/BlogTitle/BlogTitle.tsx +2 -6
- package/Breadcrumbs/Breadcrumbs.tsx +24 -38
- package/Breadcrumbs/BreadcrumbsList.tsx +9 -9
- package/Button/Button.tsx +4 -4
- package/Button/LinkOrButton.tsx +8 -7
- package/CHANGELOG.md +8 -0
- package/ChipMenu/ChipMenu.tsx +5 -5
- package/Container/Container.tsx +4 -4
- package/Fab/Fab.tsx +1 -1
- package/Footer/Footer.tsx +5 -5
- package/Form/Form.tsx +6 -6
- package/Form/FormDivider.tsx +1 -1
- package/Form/InputCheckmark.tsx +2 -1
- package/FramerScroller/SidebarGallery.tsx +43 -34
- package/FullPageMessage/FullPageMessage.tsx +13 -4
- package/IconHeader/IconHeader.tsx +22 -8
- package/IconSvg/IconSvg.tsx +1 -1
- package/Layout/components/LayoutHeader.tsx +7 -6
- package/Layout/components/LayoutHeaderBack.tsx +0 -2
- package/Layout/components/LayoutHeaderContent.tsx +22 -18
- package/Layout/components/LayoutTitle.tsx +4 -3
- package/LayoutDefault/components/LayoutDefault.tsx +5 -4
- package/LayoutOverlay/components/LayoutOverlayHeader.tsx +4 -3
- package/LayoutOverlay/components/LayoutOverlayHeader2.tsx +0 -6
- package/LayoutParts/DesktopHeaderBadge.tsx +4 -3
- package/LayoutParts/DesktopNavBar.tsx +10 -11
- package/LayoutParts/DesktopNavBarItem.tsx +22 -16
- package/LayoutParts/GlobalHead.tsx +1 -1
- package/LayoutParts/Logo.tsx +2 -1
- package/LayoutParts/MenuFab.tsx +36 -14
- package/LayoutParts/MenuFabItem.tsx +2 -1
- package/LayoutParts/MenuFabSecondaryItem.tsx +6 -3
- package/LayoutParts/PlaceholderFab.tsx +2 -1
- package/LayoutParts/StickyBelowHeader.tsx +4 -3
- package/MediaQuery/MediaQuery.tsx +2 -4
- package/Navigation/components/NavigationFab.tsx +31 -11
- package/Navigation/components/NavigationItem.tsx +14 -10
- package/Navigation/components/NavigationOverlay.tsx +39 -20
- package/Overlay/components/OverlayBase.tsx +21 -23
- package/Overlay/components/OverlayContainer.tsx +35 -12
- package/Overlay/components/OverlayHeader.tsx +2 -1
- package/Overlay/components/OverlayStickyBottom.tsx +2 -5
- package/OverlayOrPopperChip/OverlayOrPopperChip.tsx +35 -31
- package/OverlayOrPopperChip/OverlayPanel.tsx +4 -5
- package/OverlayOrPopperChip/OverlayPanelActions.tsx +2 -1
- package/OverlayOrPopperChip/PopperPanelActions.tsx +2 -1
- package/Pagination/Pagination.tsx +9 -6
- package/Pagination/PaginationExtended.tsx +4 -3
- package/Row/ButtonLinkList/ButtonLinkList.tsx +14 -15
- package/Row/ButtonLinkList/ButtonLinkListItem.tsx +1 -1
- package/Row/ColumnThree/ColumnThree.tsx +4 -3
- package/Row/ColumnTwo/ColumnTwo.tsx +16 -5
- package/Row/ColumnTwoSpread/ColumnTwoSpread.tsx +15 -4
- package/Row/ColumnTwoWithTop/ColumnTwoWithTop.tsx +22 -6
- package/Row/ContentLinks/ContentLinks.tsx +4 -3
- package/Row/HeroBanner/HeroBanner.tsx +3 -7
- package/Row/IconBlocks/IconBlock.tsx +4 -3
- package/Row/IconBlocks/IconBlocks.tsx +2 -1
- package/Row/ImageText/ImageText.tsx +5 -5
- package/Row/ImageTextBoxed/ImageTextBoxed.tsx +2 -2
- package/Row/ParagraphWithSidebarSlide/ParagraphWithSidebarSlide.tsx +1 -1
- package/Row/RowLinks/variant/VariantImageLabelSwiper.tsx +4 -3
- package/Row/RowLinks/variant/VariantInline.tsx +2 -4
- package/Row/RowLinks/variant/VariantLogoSwiper.tsx +4 -3
- package/Row/RowLinks/variant/VariantUsps.tsx +4 -3
- package/Row/SpecialBanner/SpecialBanner.tsx +2 -2
- package/SectionContainer/SectionContainer.tsx +6 -5
- package/SectionHeader/SectionHeader.tsx +4 -3
- package/Separator/Separator.tsx +4 -3
- package/SkipLink/SkipLink.tsx +2 -2
- package/Snackbar/MessageSnackbarImpl.tsx +22 -10
- package/StarRatingField/StarRatingField.tsx +1 -1
- package/Stepper/Stepper.tsx +6 -5
- package/Styles/withTheme.tsx +6 -5
- package/Tabs/TabItem.tsx +4 -5
- package/TextInputNumber/TextInputNumber.tsx +76 -50
- package/Theme/DarkLightModeThemeProvider.tsx +41 -88
- package/Theme/MuiButton.ts +23 -22
- package/Theme/MuiChip.ts +12 -13
- package/Theme/MuiFab.ts +5 -5
- package/Theme/MuiSlider.ts +5 -5
- package/Theme/createTheme.ts +1 -3
- package/Theme/themeDefaults.ts +1 -1
- package/ToggleButton/ToggleButton.tsx +10 -11
- package/ToggleButtonGroup/ToggleButtonGroup.tsx +4 -3
- package/UspList/UspList.tsx +4 -3
- package/UspList/UspListItem.tsx +4 -3
- package/package.json +10 -10
- package/types.ts +1 -0
- package/utils/sxx.ts +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { sxx } from '@graphcommerce/next-ui'
|
|
1
2
|
import { t } from '@lingui/core/macro'
|
|
2
3
|
import type { IconButtonProps, SxProps, TextFieldProps, Theme } from '@mui/material'
|
|
3
4
|
import {
|
|
@@ -95,7 +96,7 @@ export function TextInputNumber(props: TextInputNumberProps) {
|
|
|
95
96
|
variant={variant}
|
|
96
97
|
inputRef={forkRef}
|
|
97
98
|
className={`${textFieldProps.className ?? ''} ${classes.quantity}`}
|
|
98
|
-
sx={
|
|
99
|
+
sx={sxx(
|
|
99
100
|
{
|
|
100
101
|
width: responsiveVal(90, 120),
|
|
101
102
|
},
|
|
@@ -117,61 +118,86 @@ export function TextInputNumber(props: TextInputNumberProps) {
|
|
|
117
118
|
display: 'none',
|
|
118
119
|
},
|
|
119
120
|
},
|
|
120
|
-
|
|
121
|
-
|
|
121
|
+
sx,
|
|
122
|
+
)}
|
|
122
123
|
autoComplete='off'
|
|
123
|
-
InputProps={{
|
|
124
|
-
...textFieldProps.InputProps,
|
|
125
|
-
startAdornment: (
|
|
126
|
-
<Box>
|
|
127
|
-
<Fab
|
|
128
|
-
aria-label={t`Decrease`}
|
|
129
|
-
size='smaller'
|
|
130
|
-
sx={{ boxShadow: variant === 'standard' ? 4 : 0, minHeight: '30px' }}
|
|
131
|
-
onPointerDown={() => setDirection('down')}
|
|
132
|
-
onPointerUp={stop}
|
|
133
|
-
tabIndex={-1}
|
|
134
|
-
{...DownProps}
|
|
135
|
-
className={`${classes.button} ${DownProps.className ?? ''}`}
|
|
136
|
-
>
|
|
137
|
-
{DownProps.children ?? <IconSvg src={iconMin} size='small' />}
|
|
138
|
-
</Fab>
|
|
139
|
-
</Box>
|
|
140
|
-
),
|
|
141
|
-
endAdornment: (
|
|
142
|
-
<Box>
|
|
143
|
-
<Fab
|
|
144
|
-
aria-label={t`Increase`}
|
|
145
|
-
size='smaller'
|
|
146
|
-
sx={{ boxShadow: variant === 'standard' ? 4 : 0, minHeight: '30px' }}
|
|
147
|
-
onPointerDown={() => setDirection('up')}
|
|
148
|
-
onPointerUp={() => setDirection(null)}
|
|
149
|
-
tabIndex={-1}
|
|
150
|
-
{...UpProps}
|
|
151
|
-
className={`${classes.button} ${UpProps.className ?? ''}`}
|
|
152
|
-
>
|
|
153
|
-
{UpProps.children ?? <IconSvg src={iconPlus} size='small' />}
|
|
154
|
-
</Fab>
|
|
155
|
-
</Box>
|
|
156
|
-
),
|
|
157
|
-
}}
|
|
158
124
|
onChange={(e: ChangeEvent<HTMLInputElement>) => {
|
|
159
125
|
if (textFieldProps.onChange) textFieldProps.onChange(e)
|
|
160
126
|
updateDisabled(e.target)
|
|
161
127
|
}}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
128
|
+
slotProps={{
|
|
129
|
+
input: {
|
|
130
|
+
...textFieldProps.InputProps,
|
|
131
|
+
startAdornment: (
|
|
132
|
+
<Box>
|
|
133
|
+
<Fab
|
|
134
|
+
aria-label={t`Decrease`}
|
|
135
|
+
size='smaller'
|
|
136
|
+
sx={sxx(
|
|
137
|
+
{
|
|
138
|
+
minHeight: '30px',
|
|
139
|
+
},
|
|
140
|
+
variant === 'standard'
|
|
141
|
+
? {
|
|
142
|
+
boxShadow: 4,
|
|
143
|
+
}
|
|
144
|
+
: {
|
|
145
|
+
boxShadow: 0,
|
|
146
|
+
},
|
|
147
|
+
)}
|
|
148
|
+
onPointerDown={() => setDirection('down')}
|
|
149
|
+
onPointerUp={stop}
|
|
150
|
+
tabIndex={-1}
|
|
151
|
+
{...DownProps}
|
|
152
|
+
className={`${classes.button} ${DownProps.className ?? ''}`}
|
|
153
|
+
>
|
|
154
|
+
{DownProps.children ?? <IconSvg src={iconMin} size='small' />}
|
|
155
|
+
</Fab>
|
|
156
|
+
</Box>
|
|
157
|
+
),
|
|
158
|
+
endAdornment: (
|
|
159
|
+
<Box>
|
|
160
|
+
<Fab
|
|
161
|
+
aria-label={t`Increase`}
|
|
162
|
+
size='smaller'
|
|
163
|
+
sx={sxx(
|
|
164
|
+
{
|
|
165
|
+
minHeight: '30px',
|
|
166
|
+
},
|
|
167
|
+
variant === 'standard'
|
|
168
|
+
? {
|
|
169
|
+
boxShadow: 4,
|
|
170
|
+
}
|
|
171
|
+
: {
|
|
172
|
+
boxShadow: 0,
|
|
173
|
+
},
|
|
174
|
+
)}
|
|
175
|
+
onPointerDown={() => setDirection('up')}
|
|
176
|
+
onPointerUp={() => setDirection(null)}
|
|
177
|
+
tabIndex={-1}
|
|
178
|
+
{...UpProps}
|
|
179
|
+
className={`${classes.button} ${UpProps.className ?? ''}`}
|
|
180
|
+
>
|
|
181
|
+
{UpProps.children ?? <IconSvg src={iconPlus} size='small' />}
|
|
182
|
+
</Fab>
|
|
183
|
+
</Box>
|
|
184
|
+
),
|
|
185
|
+
},
|
|
186
|
+
|
|
187
|
+
htmlInput: {
|
|
188
|
+
'aria-label': t`Number`,
|
|
189
|
+
...inputProps,
|
|
190
|
+
sx: [
|
|
191
|
+
{
|
|
192
|
+
typography: 'body1',
|
|
193
|
+
textAlign: 'center',
|
|
194
|
+
'&::-webkit-inner-spin-button,&::-webkit-outer-spin-button': {
|
|
195
|
+
appearance: 'none',
|
|
196
|
+
},
|
|
171
197
|
},
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
198
|
+
],
|
|
199
|
+
className: `${inputProps?.className ?? ''} ${classes.quantityInput}`,
|
|
200
|
+
},
|
|
175
201
|
}}
|
|
176
202
|
/>
|
|
177
203
|
)
|
|
@@ -1,100 +1,41 @@
|
|
|
1
1
|
import { Trans } from '@lingui/react/macro'
|
|
2
|
-
import type { FabProps, ListItemButtonProps
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
ListItemButton,
|
|
6
|
-
ListItemIcon,
|
|
7
|
-
ListItemText,
|
|
8
|
-
ThemeProvider, // eslint-disable-next-line @typescript-eslint/no-restricted-imports
|
|
9
|
-
useMediaQuery,
|
|
10
|
-
} from '@mui/material'
|
|
11
|
-
import { useRouter } from 'next/router'
|
|
12
|
-
import { createContext, useContext, useEffect, useMemo, useState } from 'react'
|
|
2
|
+
import type { FabProps, ListItemButtonProps } from '@mui/material'
|
|
3
|
+
import { Fab, ListItemButton, ListItemIcon, ListItemText } from '@mui/material'
|
|
4
|
+
import { useColorScheme } from '@mui/material/styles'
|
|
13
5
|
import { iconMoon, iconSun } from '../icons'
|
|
14
6
|
import { IconSvg } from '../IconSvg'
|
|
15
|
-
import { getCssFlag, setCssFlag } from '../utils/cssFlags'
|
|
16
7
|
|
|
17
8
|
type Mode = 'dark' | 'light'
|
|
18
|
-
type UserMode = 'auto' | Mode
|
|
19
|
-
|
|
20
|
-
type ColorModeContext = {
|
|
21
|
-
userMode: UserMode
|
|
22
|
-
browserMode: Mode
|
|
23
|
-
currentMode: Mode
|
|
24
|
-
isSingleMode: boolean
|
|
25
|
-
toggle: () => void
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/** @public */
|
|
29
|
-
export const colorModeContext = createContext(undefined as unknown as ColorModeContext)
|
|
30
|
-
colorModeContext.displayName = 'ColorModeContext'
|
|
31
|
-
|
|
32
|
-
export type ThemeProviderProps = {
|
|
33
|
-
children: React.ReactNode
|
|
34
|
-
ssrMode?: Mode
|
|
35
|
-
listenToBrowser?: boolean
|
|
36
|
-
} & (
|
|
37
|
-
| { light: Theme; dark?: undefined }
|
|
38
|
-
| { light?: undefined; dark: Theme }
|
|
39
|
-
| { light: Theme; dark: Theme }
|
|
40
|
-
)
|
|
41
9
|
|
|
42
10
|
/**
|
|
43
|
-
*
|
|
11
|
+
* Hook to get and set the color mode. Uses MUI's useColorScheme() when CSS variables are enabled.
|
|
44
12
|
*
|
|
45
|
-
*
|
|
46
|
-
* and on user input.
|
|
13
|
+
* @public
|
|
47
14
|
*/
|
|
48
|
-
export function
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
15
|
+
export function useColorMode() {
|
|
16
|
+
const colorScheme = useColorScheme()
|
|
17
|
+
|
|
18
|
+
if (!colorScheme.mode) {
|
|
19
|
+
// CSS variables not enabled, return safe defaults
|
|
20
|
+
return {
|
|
21
|
+
userMode: 'light' as const,
|
|
22
|
+
browserMode: 'light' as Mode,
|
|
23
|
+
currentMode: 'light' as Mode,
|
|
24
|
+
isSingleMode: true,
|
|
25
|
+
toggle: () => {},
|
|
26
|
+
}
|
|
54
27
|
}
|
|
55
28
|
|
|
56
|
-
const
|
|
29
|
+
const { mode, setMode, systemMode } = colorScheme
|
|
30
|
+
const currentMode: Mode = mode === 'system' ? (systemMode ?? 'light') : mode
|
|
57
31
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
useEffect(() => {
|
|
66
|
-
const flag = getCssFlag('color-scheme') as Mode
|
|
67
|
-
if (flag) setConfiguredMode(flag)
|
|
68
|
-
}, [setConfiguredMode])
|
|
69
|
-
|
|
70
|
-
// If a URL parameter is present, switch from auto to light or dark mode
|
|
71
|
-
const { asPath } = useRouter()
|
|
72
|
-
useEffect(() => {
|
|
73
|
-
if (asPath.includes('darkmode')) setConfiguredMode('dark')
|
|
74
|
-
}, [asPath])
|
|
75
|
-
|
|
76
|
-
// Create the context
|
|
77
|
-
const colorContext: ColorModeContext = useMemo(
|
|
78
|
-
() => ({
|
|
79
|
-
browserMode,
|
|
80
|
-
userMode: configuredMode,
|
|
81
|
-
currentMode,
|
|
82
|
-
isSingleMode: !light || !dark,
|
|
83
|
-
toggle: () => setThemeMode(currentMode === 'light' ? 'dark' : 'light'),
|
|
84
|
-
}),
|
|
85
|
-
[browserMode, configuredMode, currentMode, light, dark],
|
|
86
|
-
)
|
|
87
|
-
|
|
88
|
-
return (
|
|
89
|
-
<colorModeContext.Provider value={colorContext}>
|
|
90
|
-
<ThemeProvider theme={theme}>{children}</ThemeProvider>
|
|
91
|
-
</colorModeContext.Provider>
|
|
92
|
-
)
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/** @public */
|
|
96
|
-
export function useColorMode() {
|
|
97
|
-
return useContext(colorModeContext)
|
|
32
|
+
return {
|
|
33
|
+
userMode: mode,
|
|
34
|
+
browserMode: (systemMode ?? 'light') as Mode,
|
|
35
|
+
currentMode,
|
|
36
|
+
isSingleMode: false,
|
|
37
|
+
toggle: () => setMode(currentMode === 'light' ? 'dark' : 'light'),
|
|
38
|
+
}
|
|
98
39
|
}
|
|
99
40
|
|
|
100
41
|
/** @public */
|
|
@@ -115,8 +56,6 @@ export function DarkLightModeToggleFab(props: Omit<FabProps, 'onClick'>) {
|
|
|
115
56
|
/**
|
|
116
57
|
* A button that switches between light and dark mode
|
|
117
58
|
*
|
|
118
|
-
* To disable this functionality
|
|
119
|
-
*
|
|
120
59
|
* @public
|
|
121
60
|
*/
|
|
122
61
|
export function DarkLightModeMenuSecondaryItem(props: ListItemButtonProps) {
|
|
@@ -128,7 +67,7 @@ export function DarkLightModeMenuSecondaryItem(props: ListItemButtonProps) {
|
|
|
128
67
|
}
|
|
129
68
|
|
|
130
69
|
return (
|
|
131
|
-
<ListItemButton {...props} sx={
|
|
70
|
+
<ListItemButton {...props} sx={sx} dense onClick={toggle}>
|
|
132
71
|
<ListItemIcon sx={{ minWidth: 'unset', paddingRight: '8px' }}>
|
|
133
72
|
<IconSvg src={currentMode === 'light' ? iconMoon : iconSun} size='medium' />
|
|
134
73
|
</ListItemIcon>
|
|
@@ -138,3 +77,17 @@ export function DarkLightModeMenuSecondaryItem(props: ListItemButtonProps) {
|
|
|
138
77
|
</ListItemButton>
|
|
139
78
|
)
|
|
140
79
|
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @deprecated Use ThemeProvider from @mui/material with cssVariables enabled instead. The
|
|
83
|
+
* dark/light mode toggle now uses MUI's built-in useColorScheme() hook.
|
|
84
|
+
*/
|
|
85
|
+
export function DarkLightModeThemeProvider({ children }: { children: React.ReactNode }) {
|
|
86
|
+
console.warn(
|
|
87
|
+
'DarkLightModeThemeProvider is deprecated. Use ThemeProvider from @mui/material with cssVariables enabled instead.',
|
|
88
|
+
)
|
|
89
|
+
return children
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** @deprecated No longer needed, context is provided by MUI's ThemeProvider with cssVariables */
|
|
93
|
+
export const colorModeContext = null
|
package/Theme/MuiButton.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { ComponentsVariants, Theme } from '@mui/material'
|
|
2
|
-
import { alpha, darken, lighten } from '@mui/material'
|
|
3
2
|
import { responsiveVal } from '../Styles/responsiveVal'
|
|
4
3
|
|
|
5
|
-
declare module '@mui/material/Button
|
|
4
|
+
declare module '@mui/material/Button' {
|
|
6
5
|
interface ButtonPropsVariantOverrides {
|
|
7
6
|
pill: true
|
|
8
7
|
inline: true
|
|
@@ -25,7 +24,7 @@ export const MuiButtonResponsive: ButtonVariants = [
|
|
|
25
24
|
...theme.typography.body2,
|
|
26
25
|
padding: `${responsiveVal(3, 5)} ${responsiveVal(8, 15)}`,
|
|
27
26
|
'&.MuiLoadingButton-loading:hover': {
|
|
28
|
-
backgroundColor: theme.palette.action.disabledBackground,
|
|
27
|
+
backgroundColor: theme.vars.palette.action.disabledBackground,
|
|
29
28
|
},
|
|
30
29
|
'& .MuiLoadingButton-loadingIndicatorEnd': { right: responsiveVal(9, 15) },
|
|
31
30
|
'& .MuiLoadingButton-loadingIndicatorStart': { left: responsiveVal(9, 15) },
|
|
@@ -37,7 +36,7 @@ export const MuiButtonResponsive: ButtonVariants = [
|
|
|
37
36
|
...theme.typography.body1,
|
|
38
37
|
padding: `${responsiveVal(7, 9)} ${responsiveVal(15, 22)}`,
|
|
39
38
|
'&.MuiLoadingButton-loading:hover': {
|
|
40
|
-
backgroundColor: theme.palette.action.disabledBackground,
|
|
39
|
+
backgroundColor: theme.vars.palette.action.disabledBackground,
|
|
41
40
|
},
|
|
42
41
|
'& .MuiLoadingButton-loadingIndicatorEnd': { right: responsiveVal(16, 24) },
|
|
43
42
|
'& .MuiLoadingButton-loadingIndicatorStart': { left: responsiveVal(16, 24) },
|
|
@@ -50,7 +49,7 @@ export const MuiButtonResponsive: ButtonVariants = [
|
|
|
50
49
|
fontWeight: theme.typography.fontWeightBold,
|
|
51
50
|
padding: `${responsiveVal(10, 15)} ${responsiveVal(28, 58)}`,
|
|
52
51
|
'&.MuiLoadingButton-loading:hover': {
|
|
53
|
-
backgroundColor: theme.palette.action.disabledBackground,
|
|
52
|
+
backgroundColor: theme.vars.palette.action.disabledBackground,
|
|
54
53
|
},
|
|
55
54
|
'& .MuiLoadingButton-loadingIndicatorEnd': { right: responsiveVal(30, 60) },
|
|
56
55
|
'& .MuiLoadingButton-loadingIndicatorStart': { left: responsiveVal(30, 60) },
|
|
@@ -112,36 +111,36 @@ export const MuiButtonPill: ButtonVariants = [
|
|
|
112
111
|
{
|
|
113
112
|
props: { variant: 'pill', color: 'primary' },
|
|
114
113
|
style: ({ theme }) => ({
|
|
115
|
-
backgroundColor: theme.palette.primary.main,
|
|
116
|
-
color: theme.palette.primary.contrastText,
|
|
117
|
-
'&:hover:not(.Mui-disabled)': { backgroundColor: theme.palette.primary.dark },
|
|
114
|
+
backgroundColor: theme.vars.palette.primary.main,
|
|
115
|
+
color: theme.vars.palette.primary.contrastText,
|
|
116
|
+
'&:hover:not(.Mui-disabled)': { backgroundColor: theme.vars.palette.primary.dark },
|
|
118
117
|
}),
|
|
119
118
|
},
|
|
120
119
|
{
|
|
121
120
|
props: { variant: 'pill', color: 'secondary' },
|
|
122
121
|
style: ({ theme }) => ({
|
|
123
|
-
backgroundColor: theme.palette.secondary.main,
|
|
124
|
-
color: theme.palette.secondary.contrastText,
|
|
125
|
-
'&:hover:not(.Mui-disabled)': { backgroundColor: theme.palette.secondary.dark },
|
|
122
|
+
backgroundColor: theme.vars.palette.secondary.main,
|
|
123
|
+
color: theme.vars.palette.secondary.contrastText,
|
|
124
|
+
'&:hover:not(.Mui-disabled)': { backgroundColor: theme.vars.palette.secondary.dark },
|
|
126
125
|
}),
|
|
127
126
|
},
|
|
128
127
|
{
|
|
129
128
|
props: { variant: 'pill', color: 'inherit' },
|
|
130
129
|
style: ({ theme }) => ({
|
|
131
|
-
backgroundColor: theme.palette.background.paper,
|
|
130
|
+
backgroundColor: theme.vars.palette.background.paper,
|
|
132
131
|
'&:hover:not(.Mui-disabled)': {
|
|
133
|
-
backgroundColor:
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
132
|
+
backgroundColor: theme.darken(theme.vars.palette.background.default, 0.05),
|
|
133
|
+
...theme.applyStyles('dark', {
|
|
134
|
+
backgroundColor: theme.lighten(theme.vars.palette.background.default, 0.2),
|
|
135
|
+
}),
|
|
137
136
|
},
|
|
138
137
|
}),
|
|
139
138
|
},
|
|
140
139
|
{
|
|
141
140
|
props: { variant: 'pill', disabled: true },
|
|
142
141
|
style: ({ theme }) => ({
|
|
143
|
-
backgroundColor: theme.palette.action.disabledBackground,
|
|
144
|
-
color: theme.palette.action.disabled,
|
|
142
|
+
backgroundColor: theme.vars.palette.action.disabledBackground,
|
|
143
|
+
color: theme.vars.palette.action.disabled,
|
|
145
144
|
}),
|
|
146
145
|
},
|
|
147
146
|
]
|
|
@@ -150,16 +149,18 @@ export const MuiButtonInline: ButtonVariants = [
|
|
|
150
149
|
{
|
|
151
150
|
props: { variant: 'inline', color: 'primary' },
|
|
152
151
|
style: ({ theme }) => ({
|
|
153
|
-
color: theme.palette.primary.main,
|
|
154
|
-
'&:hover:not(.Mui-disabled)': {
|
|
152
|
+
color: theme.vars.palette.primary.main,
|
|
153
|
+
'&:hover:not(.Mui-disabled)': {
|
|
154
|
+
backgroundColor: theme.alpha(theme.vars.palette.primary.main, 0.19),
|
|
155
|
+
},
|
|
155
156
|
}),
|
|
156
157
|
},
|
|
157
158
|
{
|
|
158
159
|
props: { variant: 'inline', color: 'secondary' },
|
|
159
160
|
style: ({ theme }) => ({
|
|
160
|
-
color: theme.palette.secondary.main,
|
|
161
|
+
color: theme.vars.palette.secondary.main,
|
|
161
162
|
'&:hover:not(.Mui-disabled)': {
|
|
162
|
-
backgroundColor: theme.palette.secondary.light,
|
|
163
|
+
backgroundColor: theme.vars.palette.secondary.light,
|
|
163
164
|
},
|
|
164
165
|
}),
|
|
165
166
|
},
|
package/Theme/MuiChip.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { ComponentsVariants, Theme } from '@mui/material'
|
|
2
|
-
import { darken } from '@mui/material'
|
|
3
2
|
import { responsiveVal } from '../Styles'
|
|
4
3
|
|
|
5
|
-
declare module '@mui/material/Chip
|
|
4
|
+
declare module '@mui/material/Chip' {
|
|
6
5
|
interface ChipPropsSizeOverrides {
|
|
7
6
|
responsive: true
|
|
8
7
|
}
|
|
@@ -54,36 +53,36 @@ export const MuiChip: ChipVariants = [
|
|
|
54
53
|
{
|
|
55
54
|
props: { variant: 'outlined' },
|
|
56
55
|
style: ({ theme }) => ({
|
|
57
|
-
borderColor: theme.palette.divider,
|
|
58
|
-
backgroundColor: theme.palette.background.default,
|
|
56
|
+
borderColor: theme.vars.palette.divider,
|
|
57
|
+
backgroundColor: theme.vars.palette.background.default,
|
|
59
58
|
'&:active': {
|
|
60
59
|
boxShadow: 'none',
|
|
61
60
|
},
|
|
62
61
|
'& .MuiChip-deleteIcon': {
|
|
63
|
-
color: theme.palette.text.primary,
|
|
62
|
+
color: theme.vars.palette.text.primary,
|
|
64
63
|
},
|
|
65
64
|
'&.MuiChip-clickable:hover': {
|
|
66
|
-
backgroundColor: darken(theme.palette.background.default, 0.05),
|
|
65
|
+
backgroundColor: theme.darken(theme.vars.palette.background.default, 0.05),
|
|
67
66
|
},
|
|
68
67
|
'& .MuiChip-deleteIcon:hover': {
|
|
69
|
-
color: theme.palette.text.primary,
|
|
68
|
+
color: theme.vars.palette.text.primary,
|
|
70
69
|
},
|
|
71
70
|
}),
|
|
72
71
|
},
|
|
73
72
|
{
|
|
74
73
|
props: { color: 'primary' },
|
|
75
74
|
style: ({ theme }) => ({
|
|
76
|
-
borderColor: theme.palette.text.primary,
|
|
77
|
-
color: theme.palette.text.primary,
|
|
75
|
+
borderColor: theme.vars.palette.text.primary,
|
|
76
|
+
color: theme.vars.palette.text.primary,
|
|
78
77
|
'&:hover': {
|
|
79
|
-
background: `${theme.palette.background.default} !important`,
|
|
80
|
-
borderColor: `${theme.palette.divider} !important`,
|
|
78
|
+
background: `${theme.vars.palette.background.default} !important`,
|
|
79
|
+
borderColor: `${theme.vars.palette.divider} !important`,
|
|
81
80
|
},
|
|
82
81
|
'&:focus': {
|
|
83
|
-
background: `${theme.palette.background.paper} !important`,
|
|
82
|
+
background: `${theme.vars.palette.background.paper} !important`,
|
|
84
83
|
},
|
|
85
84
|
'& .MuiChip-deleteIcon:hover': {
|
|
86
|
-
color: theme.palette.text.primary,
|
|
85
|
+
color: theme.vars.palette.text.primary,
|
|
87
86
|
},
|
|
88
87
|
}),
|
|
89
88
|
},
|
package/Theme/MuiFab.ts
CHANGED
|
@@ -9,7 +9,7 @@ type FabSizes = {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
/** Expose the component to be exendable in your theme.components */
|
|
12
|
-
declare module '@mui/material/styles
|
|
12
|
+
declare module '@mui/material/styles' {
|
|
13
13
|
interface Components {
|
|
14
14
|
/**
|
|
15
15
|
* @todo We would rather use MuiFab to override these fields, but I can't get it to work,
|
|
@@ -44,7 +44,7 @@ export const useFabSize = (size: FabSize) => {
|
|
|
44
44
|
return fabSize(size, theme)
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
declare module '@mui/material/Fab
|
|
47
|
+
declare module '@mui/material/Fab' {
|
|
48
48
|
interface FabPropsSizeOverrides {
|
|
49
49
|
responsive: true
|
|
50
50
|
responsiveSmall: true
|
|
@@ -96,10 +96,10 @@ export const MuiFabSizes: FabVariants = sizes.map((size) => ({
|
|
|
96
96
|
// style: ({ theme }) => ({
|
|
97
97
|
// boxShadow: 'none',
|
|
98
98
|
// '&:hover, &:focus': {
|
|
99
|
-
// background: theme.palette.text.primary,
|
|
99
|
+
// background: theme.vars.palette.text.primary,
|
|
100
100
|
// },
|
|
101
|
-
// background: theme.palette.text.primary,
|
|
102
|
-
// color: theme.palette.background.paper,
|
|
101
|
+
// background: theme.vars.palette.text.primary,
|
|
102
|
+
// color: theme.vars.palette.background.paper,
|
|
103
103
|
// }),
|
|
104
104
|
// },
|
|
105
105
|
// ]
|
package/Theme/MuiSlider.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComponentsVariants, Theme } from '@mui/material'
|
|
2
2
|
|
|
3
|
-
declare module '@mui/material/Slider
|
|
3
|
+
declare module '@mui/material/Slider' {
|
|
4
4
|
interface SliderPropsSizeOverrides {
|
|
5
5
|
large: true
|
|
6
6
|
}
|
|
@@ -13,22 +13,22 @@ export const MuiSlider: SliderVariants = [
|
|
|
13
13
|
props: {},
|
|
14
14
|
style: ({ theme }) => ({
|
|
15
15
|
'& .MuiSlider-rail': {
|
|
16
|
-
color: theme.palette.text.disabled,
|
|
16
|
+
color: theme.vars.palette.text.disabled,
|
|
17
17
|
},
|
|
18
18
|
'& .MuiSlider-thumb': {
|
|
19
|
-
background: theme.palette.background.default,
|
|
19
|
+
background: theme.vars.palette.background.default,
|
|
20
20
|
boxShadow: theme.shadows[6],
|
|
21
21
|
},
|
|
22
22
|
'& .MuiSlider-valueLabel': {
|
|
23
23
|
top: 0,
|
|
24
24
|
backgroundColor: 'unset',
|
|
25
|
-
color: theme.palette.text.primary,
|
|
25
|
+
color: theme.vars.palette.text.primary,
|
|
26
26
|
'&:before': {
|
|
27
27
|
display: 'none',
|
|
28
28
|
},
|
|
29
29
|
'& *': {
|
|
30
30
|
background: 'transparent',
|
|
31
|
-
color: theme.palette.text.primary,
|
|
31
|
+
color: theme.vars.palette.text.primary,
|
|
32
32
|
},
|
|
33
33
|
},
|
|
34
34
|
}),
|
package/Theme/createTheme.ts
CHANGED
|
@@ -2,13 +2,11 @@ import type { Breakpoint } from '@mui/material'
|
|
|
2
2
|
|
|
3
3
|
export {}
|
|
4
4
|
|
|
5
|
-
declare module '@mui/material/styles
|
|
5
|
+
declare module '@mui/material/styles' {
|
|
6
6
|
interface TypeBackground {
|
|
7
7
|
image: string
|
|
8
8
|
}
|
|
9
|
-
}
|
|
10
9
|
|
|
11
|
-
declare module '@mui/material/styles/createTheme' {
|
|
12
10
|
interface ThemeOptions {
|
|
13
11
|
spacings: {
|
|
14
12
|
xxs: string
|
package/Theme/themeDefaults.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Components, Theme, ThemeOptions } from '@mui/material'
|
|
2
2
|
import { createTheme as createMuiTheme } from '@mui/material'
|
|
3
|
-
import type { Shadows } from '@mui/material/styles
|
|
3
|
+
import type { Shadows } from '@mui/material/styles'
|
|
4
4
|
import { spreadVal } from '../Styles/spreadVal'
|
|
5
5
|
import { breakpoints } from './breakpoints'
|
|
6
6
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { sxx } from '@graphcommerce/next-ui'
|
|
2
3
|
import type { ButtonProps } from '@mui/material'
|
|
3
|
-
import {
|
|
4
|
+
import { Button } from '@mui/material'
|
|
4
5
|
import type { FormEvent } from 'react'
|
|
5
6
|
import React from 'react'
|
|
6
7
|
import { extendableComponent } from '../Styles'
|
|
@@ -60,23 +61,21 @@ export const ToggleButton = React.forwardRef<any, ToggleButtonProps>((props, ref
|
|
|
60
61
|
size={size}
|
|
61
62
|
{...other}
|
|
62
63
|
classes={classes}
|
|
63
|
-
sx={
|
|
64
|
+
sx={sxx(
|
|
64
65
|
(theme) => ({
|
|
65
66
|
border: 1,
|
|
66
67
|
borderColor: 'divider',
|
|
67
68
|
bgcolor: 'background.paper',
|
|
68
|
-
|
|
69
69
|
'&.disabled': {
|
|
70
70
|
borderWidth: 2,
|
|
71
71
|
},
|
|
72
|
-
|
|
73
72
|
'&.selected': {
|
|
74
|
-
border: `1px solid ${theme.palette[color]?.main ?? theme.palette.primary.main}`,
|
|
73
|
+
border: `1px solid ${theme.vars.palette[color]?.main ?? theme.vars.palette.primary.main}`,
|
|
75
74
|
boxShadow: `inset 0 0 0 1px ${
|
|
76
|
-
theme.palette[color]?.main ?? theme.palette.primary.main
|
|
77
|
-
},0 0 0 4px ${alpha(
|
|
78
|
-
theme.palette.primary.main,
|
|
79
|
-
theme.palette.action.hoverOpacity,
|
|
75
|
+
theme.vars.palette[color]?.main ?? theme.vars.palette.primary.main
|
|
76
|
+
},0 0 0 4px ${theme.alpha(
|
|
77
|
+
theme.vars.palette.primary.main,
|
|
78
|
+
theme.vars.palette.action.hoverOpacity,
|
|
80
79
|
)} !important`,
|
|
81
80
|
},
|
|
82
81
|
':not(&.sizeSmall)': {
|
|
@@ -98,8 +97,8 @@ export const ToggleButton = React.forwardRef<any, ToggleButtonProps>((props, ref
|
|
|
98
97
|
padding: '8px 12px',
|
|
99
98
|
},
|
|
100
99
|
}),
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
sx,
|
|
101
|
+
)}
|
|
103
102
|
>
|
|
104
103
|
{children}
|
|
105
104
|
</Button>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
|
+
import { sxx } from '@graphcommerce/next-ui'
|
|
2
3
|
import type { ToggleButtonGroupProps as ToggleButtonGroupPropsBase } from '@mui/material'
|
|
3
4
|
import { Box } from '@mui/material'
|
|
4
5
|
import React from 'react'
|
|
@@ -68,7 +69,7 @@ export const ToggleButtonGroup = React.forwardRef<HTMLDivElement, ToggleButtonGr
|
|
|
68
69
|
<Box
|
|
69
70
|
role='group'
|
|
70
71
|
className={`${classes.root} ${className ?? ''}`}
|
|
71
|
-
sx={
|
|
72
|
+
sx={sxx(
|
|
72
73
|
(theme) => ({
|
|
73
74
|
rowGap: theme.spacings.xxs,
|
|
74
75
|
columnGap: theme.spacings.xs,
|
|
@@ -90,8 +91,8 @@ export const ToggleButtonGroup = React.forwardRef<HTMLDivElement, ToggleButtonGr
|
|
|
90
91
|
gridTemplateColumns: 'repeat(2, 1fr)',
|
|
91
92
|
},
|
|
92
93
|
}),
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
sx,
|
|
95
|
+
)}
|
|
95
96
|
ref={ref}
|
|
96
97
|
{...other}
|
|
97
98
|
>
|
package/UspList/UspList.tsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { sxx } from '@graphcommerce/next-ui'
|
|
1
2
|
import type { SxProps, Theme } from '@mui/material'
|
|
2
3
|
import { Box } from '@mui/material'
|
|
3
4
|
import { extendableComponent } from '../Styles'
|
|
@@ -20,7 +21,7 @@ export function UspList(props: UspListProps) {
|
|
|
20
21
|
<Box
|
|
21
22
|
component='ul'
|
|
22
23
|
className={classes.root}
|
|
23
|
-
sx={
|
|
24
|
+
sx={sxx(
|
|
24
25
|
(theme) => ({
|
|
25
26
|
listStyleType: 'none',
|
|
26
27
|
padding: 0,
|
|
@@ -32,8 +33,8 @@ export function UspList(props: UspListProps) {
|
|
|
32
33
|
rowGap: '3px',
|
|
33
34
|
},
|
|
34
35
|
}),
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
sx,
|
|
37
|
+
)}
|
|
37
38
|
>
|
|
38
39
|
{children}
|
|
39
40
|
</Box>
|