@graphcommerce/next-ui 4.28.1 → 4.29.1
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/CHANGELOG.md +22 -0
- package/Fab/Fab.tsx +57 -0
- package/Fab/index.ts +1 -0
- package/Overlay/components/OverlayBase.tsx +1 -4
- package/Snackbar/ErrorSnackbar.tsx +2 -2
- package/Snackbar/MessageSnackbarImpl.tsx +2 -2
- package/icons/index.ts +30 -31
- package/index.ts +1 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 4.29.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1684](https://github.com/graphcommerce-org/graphcommerce/pull/1684) [`98d6a9cce`](https://github.com/graphcommerce-org/graphcommerce/commit/98d6a9cce1bb9514088be0af2736721b3edda467) Thanks [@paales](https://github.com/paales)! - When dragging the overlay down it doesn't close
|
|
8
|
+
|
|
9
|
+
- Updated dependencies []:
|
|
10
|
+
- @graphcommerce/framer-scroller@2.1.43
|
|
11
|
+
|
|
12
|
+
## 4.29.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- [#1679](https://github.com/graphcommerce-org/graphcommerce/pull/1679) [`0bd9ea582`](https://github.com/graphcommerce-org/graphcommerce/commit/0bd9ea58230dde79c5fe2cdb07e9860151460270) Thanks [@paales](https://github.com/paales)! - Added a new Fab component which adds a loading state
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [#1679](https://github.com/graphcommerce-org/graphcommerce/pull/1679) [`e76df6dc3`](https://github.com/graphcommerce-org/graphcommerce/commit/e76df6dc37c11c793a5d008ba36932d17dc23855) Thanks [@paales](https://github.com/paales)! - Added AddProductsToCartFab for a smaller add to cart button
|
|
21
|
+
|
|
22
|
+
- Updated dependencies []:
|
|
23
|
+
- @graphcommerce/framer-scroller@2.1.42
|
|
24
|
+
|
|
3
25
|
## 4.28.1
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/Fab/Fab.tsx
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Box,
|
|
3
|
+
CircularProgress,
|
|
4
|
+
CircularProgressProps,
|
|
5
|
+
Fab as FabBase,
|
|
6
|
+
FabProps as FabPropsBase,
|
|
7
|
+
} from '@mui/material'
|
|
8
|
+
import { IconSvg, IconSvgProps } from '../IconSvg'
|
|
9
|
+
import { useFabSize } from '../Theme/MuiFab'
|
|
10
|
+
|
|
11
|
+
export type FabProps = Omit<FabPropsBase<'button'>, 'variant' | 'children'> & {
|
|
12
|
+
loading?: boolean
|
|
13
|
+
icon: IconSvgProps['src']
|
|
14
|
+
circularProgress?: Omit<CircularProgressProps, 'size'>
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Adds loading functionality to the Fab component. */
|
|
18
|
+
export function Fab(props: FabProps) {
|
|
19
|
+
const {
|
|
20
|
+
size = 'responsive',
|
|
21
|
+
disabled,
|
|
22
|
+
loading,
|
|
23
|
+
sx = [],
|
|
24
|
+
icon,
|
|
25
|
+
circularProgress,
|
|
26
|
+
...fabProps
|
|
27
|
+
} = props
|
|
28
|
+
|
|
29
|
+
const fabSize = useFabSize(size)
|
|
30
|
+
|
|
31
|
+
const circSx = circularProgress?.sx ?? []
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<FabBase
|
|
35
|
+
type='submit'
|
|
36
|
+
color='primary'
|
|
37
|
+
size={size}
|
|
38
|
+
{...fabProps}
|
|
39
|
+
disabled={disabled}
|
|
40
|
+
sx={[{ display: 'grid' }, ...(Array.isArray(sx) ? sx : [sx])]}
|
|
41
|
+
>
|
|
42
|
+
<Box sx={{ display: 'flex', placeContent: 'center', gridArea: '1/1' }}>
|
|
43
|
+
<IconSvg src={icon} size='medium' />
|
|
44
|
+
</Box>
|
|
45
|
+
{loading && (
|
|
46
|
+
<CircularProgress
|
|
47
|
+
size={fabSize}
|
|
48
|
+
{...circularProgress}
|
|
49
|
+
sx={[
|
|
50
|
+
{ display: 'flex', placeContent: 'center', gridArea: '1/1' },
|
|
51
|
+
...(Array.isArray(circSx) ? circSx : [circSx]),
|
|
52
|
+
]}
|
|
53
|
+
/>
|
|
54
|
+
)}
|
|
55
|
+
</FabBase>
|
|
56
|
+
)
|
|
57
|
+
}
|
package/Fab/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Fab'
|
|
@@ -195,10 +195,7 @@ export function OverlayBase(incommingProps: LayoutOverlayBaseProps) {
|
|
|
195
195
|
|
|
196
196
|
// When the overlay isn't visible anymore, we navigate back.
|
|
197
197
|
useEffect(
|
|
198
|
-
() =>
|
|
199
|
-
positions.open.visible.onChange(
|
|
200
|
-
(o) => position.get() !== OverlayPosition.OPENED && o === 0 && closeOverlay(),
|
|
201
|
-
),
|
|
198
|
+
() => positions.open.visible.onChange((o) => o === 0 && closeOverlay()),
|
|
202
199
|
[closeOverlay, position, positions.open.visible],
|
|
203
200
|
)
|
|
204
201
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Trans } from '@lingui/react'
|
|
2
2
|
import { Button } from '@mui/material'
|
|
3
3
|
import { MessageSnackbar } from './MessageSnackbar'
|
|
4
|
-
import {
|
|
4
|
+
import { MessageSnackbarProps } from './MessageSnackbarImpl'
|
|
5
5
|
|
|
6
|
-
export type ErrorSnackbarProps =
|
|
6
|
+
export type ErrorSnackbarProps = MessageSnackbarProps
|
|
7
7
|
|
|
8
8
|
export function ErrorSnackbar(props: ErrorSnackbarProps) {
|
|
9
9
|
const { action, ...passedProps } = props
|
|
@@ -18,7 +18,7 @@ import { iconClose, iconCheckmark, iconSadFace } from '../icons'
|
|
|
18
18
|
type Size = 'normal' | 'wide'
|
|
19
19
|
type Variant = 'contained' | 'pill'
|
|
20
20
|
|
|
21
|
-
export type
|
|
21
|
+
export type MessageSnackbarProps = Omit<
|
|
22
22
|
SnackbarProps,
|
|
23
23
|
'autoHideDuration' | 'anchorOrigin' | 'color'
|
|
24
24
|
> & {
|
|
@@ -41,7 +41,7 @@ const parts = ['root', 'content', 'children', 'actionButton', 'close'] as const
|
|
|
41
41
|
const { withState } = extendableComponent<OwnerState, typeof name, typeof parts>(name, parts)
|
|
42
42
|
|
|
43
43
|
// eslint-disable-next-line import/no-default-export
|
|
44
|
-
export default function MessageSnackbarImpl(props:
|
|
44
|
+
export default function MessageSnackbarImpl(props: MessageSnackbarProps) {
|
|
45
45
|
const [showSnackbar, setShowSnackbar] = useState<boolean>(false)
|
|
46
46
|
|
|
47
47
|
const {
|
package/icons/index.ts
CHANGED
|
@@ -1,42 +1,41 @@
|
|
|
1
|
-
export { default as
|
|
2
|
-
export { default as
|
|
1
|
+
export { default as iconArrowBack } from './arrow-left.svg'
|
|
2
|
+
export { default as iconArrowForward } from './arrow-right.svg'
|
|
3
|
+
export { default as iconShoppingBag } from './bag.svg'
|
|
4
|
+
export { default as iconInvoice } from './box-alt.svg'
|
|
5
|
+
export { default as iconBox } from './box.svg'
|
|
6
|
+
export { default as iconOrderBefore } from './calendar.svg'
|
|
7
|
+
export { default as iconCancelAlt } from './cancel-alt.svg'
|
|
8
|
+
export { default as iconCartAdd } from './cart-add.svg'
|
|
9
|
+
export { default as iconCart } from './cart.svg'
|
|
10
|
+
export { default as iconChat } from './chat-alt.svg'
|
|
11
|
+
export { default as iconCustomerService } from './chat.svg'
|
|
3
12
|
export { default as iconChevronDown } from './chevron-down.svg'
|
|
4
|
-
export { default as iconChevronLeft } from './chevron-left.svg'
|
|
13
|
+
export { default as iconChevronBack, default as iconChevronLeft } from './chevron-left.svg'
|
|
5
14
|
export { default as iconChevronRight } from './chevron-right.svg'
|
|
6
15
|
export { default as iconChevronUp } from './chevron-up.svg'
|
|
7
|
-
export { default as
|
|
16
|
+
export { default as iconClose } from './close.svg'
|
|
17
|
+
export { default as iconId } from './credit-card.svg'
|
|
18
|
+
export { default as iconEllypsis } from './ellypsis.svg'
|
|
19
|
+
export { default as iconEmail, default as iconEmailOutline } from './envelope-alt.svg'
|
|
20
|
+
export { default as icon404 } from './explore.svg'
|
|
8
21
|
export { default as iconHeart } from './favourite.svg'
|
|
22
|
+
export { default as iconMenu } from './hamburger.svg'
|
|
23
|
+
export { default as iconParty } from './happy-face.svg'
|
|
24
|
+
export { default as iconAddresses, default as iconHome } from './home-alt.svg'
|
|
9
25
|
export { default as iconLocation } from './location.svg'
|
|
10
|
-
export { default as
|
|
11
|
-
export { default as
|
|
12
|
-
export { default as iconShoppingBag } from './bag.svg'
|
|
26
|
+
export { default as iconLock } from './lock.svg'
|
|
27
|
+
export { default as iconFullscreen } from './maximise.svg'
|
|
13
28
|
export { default as iconFullscreenExit } from './minimise.svg'
|
|
14
|
-
export { default as iconChat } from './chat-alt.svg'
|
|
15
|
-
export { default as iconChevronBack } from './chevron-left.svg'
|
|
16
|
-
export { default as iconCancelAlt } from './cancel-alt.svg'
|
|
17
|
-
export { default as iconEmail } from './envelope-alt.svg'
|
|
18
|
-
export { default as iconCheckmark } from './ok.svg'
|
|
19
|
-
export { default as iconArrowBack } from './arrow-left.svg'
|
|
20
|
-
export { default as iconArrowForward } from './arrow-right.svg'
|
|
21
|
-
export { default as iconMenu } from './hamburger.svg'
|
|
22
29
|
export { default as iconMin } from './minus.svg'
|
|
23
|
-
export { default as
|
|
24
|
-
export { default as iconPlus } from './plus.svg'
|
|
25
|
-
export { default as iconClose } from './close.svg'
|
|
26
|
-
export { default as iconFullscreen } from './maximise.svg'
|
|
27
|
-
export { default as iconOrderBefore } from './calendar.svg'
|
|
28
|
-
export { default as iconBox } from './box.svg'
|
|
29
|
-
export { default as iconHome } from './home-alt.svg'
|
|
30
|
-
export { default as iconId } from './credit-card.svg'
|
|
31
|
-
export { default as iconLock } from './lock.svg'
|
|
30
|
+
export { default as iconMoon } from './moon.svg'
|
|
32
31
|
export { default as iconNewspaper } from './news.svg'
|
|
33
|
-
export { default as
|
|
32
|
+
export { default as iconCheckmark } from './ok.svg'
|
|
33
|
+
export { default as iconPerson } from './person-alt.svg'
|
|
34
|
+
export { default as iconPlay } from './play.svg'
|
|
35
|
+
export { default as iconPlus } from './plus.svg'
|
|
34
36
|
export { default as iconShutdown } from './power.svg'
|
|
35
|
-
export { default as
|
|
37
|
+
export { default as iconSadFace } from './sad-face.svg'
|
|
38
|
+
export { default as iconSearch } from './search.svg'
|
|
39
|
+
export { default as iconPhone } from './smartphone.svg'
|
|
36
40
|
export { default as iconStar } from './star.svg'
|
|
37
|
-
export { default as iconEmailOutline } from './envelope-alt.svg'
|
|
38
|
-
export { default as icon404 } from './explore.svg'
|
|
39
41
|
export { default as iconSun } from './sun.svg'
|
|
40
|
-
export { default as iconMoon } from './moon.svg'
|
|
41
|
-
export { default as iconPlay } from './play.svg'
|
|
42
|
-
export { default as iconEllypsis } from './ellypsis.svg'
|
package/index.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from './Blog/BlogTitle/BlogTitle'
|
|
|
10
10
|
export * from './Button'
|
|
11
11
|
export * from './ChipMenu/ChipMenu'
|
|
12
12
|
export * from './ContainerWithHeader/ContainerWithHeader'
|
|
13
|
+
export * from './Fab'
|
|
13
14
|
export * from './FlagAvatar/FlagAvatar'
|
|
14
15
|
export * from './Footer'
|
|
15
16
|
export * from './Form/Form'
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/next-ui",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "4.
|
|
5
|
+
"version": "4.29.1",
|
|
6
6
|
"author": "",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"sideEffects": false,
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@emotion/server": "^11.4.0",
|
|
21
21
|
"@emotion/styled": "^11.9.3",
|
|
22
22
|
"@graphcommerce/framer-next-pages": "3.3.2",
|
|
23
|
-
"@graphcommerce/framer-scroller": "2.1.
|
|
23
|
+
"@graphcommerce/framer-scroller": "2.1.43",
|
|
24
24
|
"@graphcommerce/framer-utils": "3.2.1",
|
|
25
25
|
"@graphcommerce/image": "3.1.10",
|
|
26
26
|
"cookie": "^0.5.0",
|