@graphcommerce/next-ui 3.20.9 → 3.21.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/ApolloError/ApolloErrorSnackbar.tsx +35 -0
- package/ApolloError/index.ts +6 -0
- package/AppShell/GlobalHead.tsx +1 -3
- package/AppShell/MenuFab.tsx +1 -1
- package/AppShell/MenuFabSecondaryItem.tsx +1 -1
- package/AppShell/{index.tsx → index.ts} +2 -4
- package/AppShell/{useFabAnimation.tsx → useFabAnimation.ts} +1 -1
- package/AppShell/{useFixedFabAnimation.tsx → useFixedFabAnimation.ts} +1 -1
- package/CHANGELOG.md +17 -0
- package/Form/index.tsx +1 -1
- package/LayoutOverlay/components/LayoutOverlayBase.tsx +1 -0
- package/Snackbar/MessageSnackbarImpl.tsx +3 -1
- package/index.ts +1 -4
- package/package.json +5 -5
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ApolloError } from '@apollo/client'
|
|
2
|
+
import { Trans } from '@lingui/macro'
|
|
3
|
+
import Button from '../Button'
|
|
4
|
+
import MessageSnackbar from '../Snackbar/MessageSnackbar'
|
|
5
|
+
import { MessageSnackbarImplProps } from '../Snackbar/MessageSnackbarImpl'
|
|
6
|
+
|
|
7
|
+
export type ApolloErrorSnackbarProps = {
|
|
8
|
+
error?: ApolloError
|
|
9
|
+
} & Pick<MessageSnackbarImplProps, 'action' | 'onClose'>
|
|
10
|
+
|
|
11
|
+
export default function ApolloErrorSnackbar(props: ApolloErrorSnackbarProps) {
|
|
12
|
+
const { error, action, ...passedProps } = props
|
|
13
|
+
|
|
14
|
+
if (!error) return null
|
|
15
|
+
return (
|
|
16
|
+
<MessageSnackbar
|
|
17
|
+
variant='pill'
|
|
18
|
+
severity='error'
|
|
19
|
+
{...passedProps}
|
|
20
|
+
open={!!error}
|
|
21
|
+
action={
|
|
22
|
+
action ?? (
|
|
23
|
+
<Button size='medium' variant='pill' color='secondary'>
|
|
24
|
+
<Trans>Ok</Trans>
|
|
25
|
+
</Button>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
>
|
|
29
|
+
<>
|
|
30
|
+
{error.graphQLErrors.map((e) => e.message)}
|
|
31
|
+
{error.networkError && <>Network Error: {error.networkError.message}</>}
|
|
32
|
+
</>
|
|
33
|
+
</MessageSnackbar>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './ApolloErrorAlert'
|
|
2
|
+
export { default as ApolloErrorAlert } from './ApolloErrorAlert'
|
|
3
|
+
export * from './ApolloErrorFullPage'
|
|
4
|
+
export { default as ApolloErrorFullPage } from './ApolloErrorFullPage'
|
|
5
|
+
export * from './ApolloErrorSnackbar'
|
|
6
|
+
export { default as ApolloErrorSnackbar } from './ApolloErrorSnackbar'
|
package/AppShell/GlobalHead.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import React from 'react'
|
|
|
4
4
|
|
|
5
5
|
export type GlobalHeadProps = { name: string }
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
export function GlobalHead(props: GlobalHeadProps) {
|
|
8
8
|
const { name } = props
|
|
9
9
|
const theme = useTheme()
|
|
10
10
|
|
|
@@ -32,5 +32,3 @@ const GlobalHead = (props: { name: string }) => {
|
|
|
32
32
|
</Head>
|
|
33
33
|
)
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
export default GlobalHead
|
package/AppShell/MenuFab.tsx
CHANGED
|
@@ -17,7 +17,7 @@ import { responsiveVal } from '../Styles/responsiveVal'
|
|
|
17
17
|
import SvgImageSimple from '../SvgImage/SvgImageSimple'
|
|
18
18
|
import { iconMenu, iconClose } from '../icons'
|
|
19
19
|
import { MenuProps } from './Menu'
|
|
20
|
-
import useFabAnimation from './useFabAnimation'
|
|
20
|
+
import { useFabAnimation } from './useFabAnimation'
|
|
21
21
|
|
|
22
22
|
const useStyles = makeStyles(
|
|
23
23
|
(theme: Theme) => ({
|
|
@@ -17,7 +17,7 @@ export type FabMenuSecondaryItemProps = {
|
|
|
17
17
|
icon: React.ReactNode
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export
|
|
20
|
+
export function MenuFabSecondaryItem(props: FabMenuSecondaryItemProps) {
|
|
21
21
|
const { href, children, icon } = props
|
|
22
22
|
const classes = useStyles()
|
|
23
23
|
|
|
@@ -11,9 +11,7 @@ export * from './Menu'
|
|
|
11
11
|
export * from './MenuFab'
|
|
12
12
|
export { default as MenuFab } from './MenuFab'
|
|
13
13
|
export * from './MenuFabSecondaryItem'
|
|
14
|
-
export { default as MenuFabSecondaryItem } from './MenuFabSecondaryItem'
|
|
15
14
|
export * from './PlaceholderFab'
|
|
16
15
|
export * from './GlobalHead'
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export { default as useFixedFabAnimation } from './useFixedFabAnimation'
|
|
16
|
+
export * from './useFabAnimation'
|
|
17
|
+
export * from './useFixedFabAnimation'
|
|
@@ -2,7 +2,7 @@ import { useMediaQuery, useTheme } from '@material-ui/core'
|
|
|
2
2
|
import { useMotionTemplate, useTransform } from 'framer-motion'
|
|
3
3
|
import { useScrollY } from '../Layout/hooks/useScrollY'
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export function useFabAnimation() {
|
|
6
6
|
const theme = useTheme()
|
|
7
7
|
const isMobile = useMediaQuery(theme.breakpoints.down('sm'))
|
|
8
8
|
const scrollY = useScrollY()
|
|
@@ -2,7 +2,7 @@ import { alpha, useTheme } from '@material-ui/core'
|
|
|
2
2
|
import { useMotionTemplate, useTransform } from 'framer-motion'
|
|
3
3
|
import { useScrollY } from '../Layout/hooks/useScrollY'
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export function useFixedFabAnimation() {
|
|
6
6
|
const theme = useTheme()
|
|
7
7
|
const scrollY = useScrollY()
|
|
8
8
|
const opacity = useTransform(scrollY, [50, 60], [0, 1])
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.21.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.20.9...@graphcommerce/next-ui@3.21.0) (2021-12-17)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* Form contained should be less spacious ([7d9557e](https://github.com/ho-nl/m2-pwa/commit/7d9557e9a75622a3dc40a3c7aab86da152d2e399))
|
|
12
|
+
* make sure the snackbar message is formatted correctly ([b9e1e26](https://github.com/ho-nl/m2-pwa/commit/b9e1e2623ec2aff6b623603aa38fe8d71ff59e1c))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* added ApolloErrorSnackbar ([96bc92e](https://github.com/ho-nl/m2-pwa/commit/96bc92e24bac735b28f5f32e1154f715ddf8cd6c))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
6
23
|
## [3.20.9](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.20.8...@graphcommerce/next-ui@3.20.9) (2021-12-16)
|
|
7
24
|
|
|
8
25
|
|
package/Form/index.tsx
CHANGED
|
@@ -21,7 +21,7 @@ const useStyles = makeStyles(
|
|
|
21
21
|
: lighten(theme.palette.background.default, 0.2),
|
|
22
22
|
},
|
|
23
23
|
contained: {
|
|
24
|
-
padding: theme.spacings.sm
|
|
24
|
+
padding: `${theme.spacings.xxs} ${theme.spacings.sm}`,
|
|
25
25
|
// paddingTop: theme.spacings.md,
|
|
26
26
|
overflow: 'hidden',
|
|
27
27
|
borderRadius: responsiveVal(theme.shape.borderRadius * 3, theme.shape.borderRadius * 4),
|
|
@@ -291,6 +291,7 @@ export function LayoutOverlayBase(props: LayoutOverlayBaseProps) {
|
|
|
291
291
|
// The scroller context shouldn't be changing, but at the moment it is.
|
|
292
292
|
}, [positions, scrollerRef])
|
|
293
293
|
|
|
294
|
+
// When the overlay is closed by navigating away, we're closing the overlay.
|
|
294
295
|
useEffect(() => {
|
|
295
296
|
if (isPresent) return
|
|
296
297
|
|
|
@@ -51,10 +51,12 @@ const useStyles = makeStyles(
|
|
|
51
51
|
gap: theme.spacings.xs,
|
|
52
52
|
gridTemplate: `
|
|
53
53
|
"children close"
|
|
54
|
-
"action
|
|
54
|
+
"action action"
|
|
55
55
|
`,
|
|
56
|
+
gridTemplateColumns: '1fr auto',
|
|
56
57
|
[theme.breakpoints.up('md')]: {
|
|
57
58
|
gridTemplate: `"children action close"`,
|
|
59
|
+
gridTemplateColumns: 'auto auto auto',
|
|
58
60
|
},
|
|
59
61
|
},
|
|
60
62
|
children: {
|
package/index.ts
CHANGED
|
@@ -6,10 +6,7 @@ export * from './Footer'
|
|
|
6
6
|
|
|
7
7
|
export * from './AnimatedRow'
|
|
8
8
|
export { default as AnimatedRow } from './AnimatedRow'
|
|
9
|
-
export * from './ApolloError
|
|
10
|
-
export { default as ApolloErrorAlert } from './ApolloError/ApolloErrorAlert'
|
|
11
|
-
export * from './ApolloError/ApolloErrorFullPage'
|
|
12
|
-
export { default as ApolloErrorFullPage } from './ApolloError/ApolloErrorFullPage'
|
|
9
|
+
export * from './ApolloError'
|
|
13
10
|
export * from './AspectRatioContainer'
|
|
14
11
|
export { default as AspectRationContainer } from './AspectRatioContainer'
|
|
15
12
|
export * from './Blog/BlogContent'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphcommerce/next-ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.21.0",
|
|
4
4
|
"author": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@apollo/client": "^3.5.6",
|
|
13
|
-
"@graphcommerce/framer-next-pages": "^2.108.
|
|
14
|
-
"@graphcommerce/framer-scroller": "^1.1.
|
|
13
|
+
"@graphcommerce/framer-next-pages": "^2.108.4",
|
|
14
|
+
"@graphcommerce/framer-scroller": "^1.1.10",
|
|
15
15
|
"@graphcommerce/framer-utils": "^2.103.19",
|
|
16
|
-
"@graphcommerce/graphql": "^2.105.
|
|
16
|
+
"@graphcommerce/graphql": "^2.105.9",
|
|
17
17
|
"@graphcommerce/image": "^2.105.8",
|
|
18
18
|
"@lingui/macro": "^3.13.0",
|
|
19
19
|
"@material-ui/core": "^4.12.3",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"project": "./tsconfig.json"
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "f18eba6b141623d926f5ae3a6efc1409d3bd365c"
|
|
56
56
|
}
|