@graphcommerce/next-ui 6.1.1-canary.5 → 6.2.0-canary.10

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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # Change Log
2
2
 
3
+ ## 6.2.0-canary.10
4
+
5
+ ## 6.2.0-canary.9
6
+
7
+ ### Patch Changes
8
+
9
+ - [#1897](https://github.com/graphcommerce-org/graphcommerce/pull/1897) [`f44d7cec6`](https://github.com/graphcommerce-org/graphcommerce/commit/f44d7cec61766f4768c30d29b211a12f2846e9f6) - Overlays can now be configured to get a bgColor ([@FrankHarland](https://github.com/FrankHarland))
10
+
11
+ ## 6.2.0-canary.8
12
+
13
+ ## 6.2.0-canary.7
14
+
15
+ ## 6.2.0-canary.6
16
+
3
17
  ## 6.1.1-canary.5
4
18
 
5
19
  ### Patch Changes
package/Fab/Fab.tsx CHANGED
@@ -23,6 +23,7 @@ export function Fab(props: FabProps) {
23
23
  sx = [],
24
24
  icon,
25
25
  circularProgress,
26
+ color = 'default',
26
27
  ...fabProps
27
28
  } = props
28
29
 
@@ -33,7 +34,7 @@ export function Fab(props: FabProps) {
33
34
  return (
34
35
  <FabBase
35
36
  type='submit'
36
- color='primary'
37
+ color={color}
37
38
  size={size}
38
39
  {...fabProps}
39
40
  disabled={disabled}
@@ -45,6 +46,7 @@ export function Fab(props: FabProps) {
45
46
  {loading && (
46
47
  <CircularProgress
47
48
  size={fabSize}
49
+ color={color !== 'primary' ? 'primary' : 'inherit'}
48
50
  {...circularProgress}
49
51
  sx={[
50
52
  { display: 'flex', placeContent: 'center', gridArea: '1/1' },
@@ -88,7 +88,7 @@ const Svg = styled('svg', { name, target: name })(() => [
88
88
  /**
89
89
  * IconSvg component is supposed to be used in combination with `icons`
90
90
  *
91
- * @see https://graphcommerce-docs.vercel.app/framework/icons
91
+ * @see https://www.graphcommerce.org/docs/framework/icons
92
92
  */
93
93
  export const IconSvg = forwardRef<SVGSVGElement, IconSvgProps>((props, ref) => {
94
94
  const { src, size, fillIcon, className, ...svgProps } = useThemeProps({ props, name })
@@ -52,6 +52,7 @@ export function LayoutHeader(props: LayoutHeaderProps) {
52
52
  switchPoint,
53
53
  size = 'responsive',
54
54
  sx = [],
55
+ bgColor,
55
56
  } = props
56
57
  const showBack = useShowBack()
57
58
  const showClose = useShowClose()
@@ -149,6 +150,7 @@ export function LayoutHeader(props: LayoutHeaderProps) {
149
150
  floatingMd={floatingMd}
150
151
  floatingSm={floatingSm}
151
152
  switchPoint={switchPoint}
153
+ bgColor={bgColor}
152
154
  >
153
155
  {children}
154
156
  </LayoutHeaderContent>
@@ -18,6 +18,7 @@ export type LayoutHeaderContentProps = FloatingProps & {
18
18
  sxBg?: SxProps<Theme>
19
19
  layout?: LayoutProps['layout']
20
20
  size?: 'small' | 'responsive'
21
+ bgColor?: 'paper' | 'default'
21
22
  } & Pick<LayoutProps, 'layout' | 'layoutDependency'>
22
23
 
23
24
  type OwnerState = {
@@ -26,7 +27,9 @@ type OwnerState = {
26
27
  scrolled: boolean
27
28
  divider: boolean
28
29
  size: 'small' | 'responsive'
30
+ bgColor?: 'paper' | 'default'
29
31
  }
32
+
30
33
  const name = 'LayoutHeaderContent' as const
31
34
  const parts = ['bg', 'content', 'left', 'center', 'right', 'divider'] as const
32
35
  const { withState } = extendableComponent<OwnerState, typeof name, typeof parts>(name, parts)
@@ -47,12 +50,13 @@ export function LayoutHeaderContent(props: LayoutHeaderContentProps) {
47
50
  layout,
48
51
  layoutDependency,
49
52
  size = 'responsive',
53
+ bgColor = 'paper',
50
54
  } = props
51
55
 
52
56
  const scroll = useScrollY()
53
57
  const scrolled = useMotionValueValue(scroll, (y) => y >= switchPoint)
54
58
 
55
- const classes = withState({ floatingSm, floatingMd, scrolled, divider: !!divider, size })
59
+ const classes = withState({ floatingSm, floatingMd, scrolled, divider: !!divider, size, bgColor })
56
60
 
57
61
  return (
58
62
  <>
@@ -63,7 +67,7 @@ export function LayoutHeaderContent(props: LayoutHeaderContentProps) {
63
67
  position: 'absolute',
64
68
  left: 0,
65
69
  width: '100%',
66
- backgroundColor: theme.palette.background.paper,
70
+ backgroundColor: theme.palette.background[bgColor],
67
71
  boxShadow: theme.shadows[1],
68
72
 
69
73
  height: theme.appShell.headerHeightSm,
@@ -127,7 +127,19 @@ export function LayoutDefault(props: LayoutDefaultProps) {
127
127
  })}
128
128
  >
129
129
  {menuFab}
130
- {cartFab}
130
+ <Box
131
+ sx={(theme) => ({
132
+ display: 'flex',
133
+ flexDirection: 'row-reverse',
134
+ gap: theme.spacings.sm,
135
+ [theme.breakpoints.up('md')]: {
136
+ flexDirection: 'column',
137
+ alignItems: 'flex-end',
138
+ },
139
+ })}
140
+ >
141
+ {cartFab}
142
+ </Box>
131
143
  </Box>
132
144
  ) : (
133
145
  <div />
@@ -32,6 +32,7 @@ type StyleProps = {
32
32
  sizeMd?: LayoutOverlaySize
33
33
  justifySm?: LayoutOverlayAlign
34
34
  justifyMd?: LayoutOverlayAlign
35
+ bgColor?: 'paper' | 'default'
35
36
  }
36
37
 
37
38
  type OverridableProps = {
@@ -102,6 +103,7 @@ export function OverlayBase(incomingProps: LayoutOverlayBaseProps) {
102
103
  sxBackdrop = [],
103
104
  active,
104
105
  onClosed,
106
+ bgColor = 'paper',
105
107
  direction = 1,
106
108
  offsetPageY = 0,
107
109
  isPresent,
@@ -405,7 +407,7 @@ export function OverlayBase(incomingProps: LayoutOverlayBaseProps) {
405
407
  height: '1px',
406
408
  top: 'calc(100% - 1px)',
407
409
  left: '0',
408
- background: theme.palette.background.paper,
410
+ background: theme.palette.background[bgColor],
409
411
  },
410
412
  },
411
413
  },
@@ -592,7 +594,7 @@ export function OverlayBase(incomingProps: LayoutOverlayBaseProps) {
592
594
  <Box
593
595
  className={classes.background}
594
596
  sx={(theme) => ({
595
- backgroundColor: theme.palette.background.paper,
597
+ backgroundColor: theme.palette.background[bgColor],
596
598
  paddingBottom: '0.1px',
597
599
  [theme.breakpoints.down('md')]: {
598
600
  minHeight: '100%',
@@ -70,9 +70,13 @@ export default function MessageSnackbarImpl(props: MessageSnackbarProps) {
70
70
  onClose?.()
71
71
  }
72
72
 
73
- const preventAnimationBubble: React.MouseEventHandler<HTMLButtonElement> = (e) => {
74
- e.preventDefault()
73
+ const preventAnimationBubble = (
74
+ e: React.TouchEvent<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement>,
75
+ ) => {
75
76
  e.stopPropagation()
77
+ if (e.type === 'mousedown') {
78
+ e.preventDefault()
79
+ }
76
80
  }
77
81
 
78
82
  let icon = iconCheckmark
@@ -144,6 +148,7 @@ export default function MessageSnackbarImpl(props: MessageSnackbarProps) {
144
148
  size='small'
145
149
  onClick={hideSnackbar}
146
150
  onMouseDown={preventAnimationBubble}
151
+ onTouchStart={preventAnimationBubble}
147
152
  sx={(theme) => ({
148
153
  backgroundColor: lighten(theme.palette.background.paper, 0.1),
149
154
  })}
@@ -0,0 +1,9 @@
1
+ <svg role="img" xmlns="http://www.w3.org/2000/svg" width="48px" height="48px" aria-labelledby="compareIconTitle" stroke="#2329D6" stroke-width="1" stroke-linecap="square" stroke-linejoin="miter" fill="none" color="#2329D6">
2
+ <title id="compareIconTitle">Compare</title>
3
+ <symbol id="icon" viewBox="0 0 24 24">
4
+ <path d="M12 9L22 9" />
5
+ <path d="M16.5 4.5L12 9L16.5 13.5"/>
6
+ <path d="M12 15L2 15" />
7
+ <path d="M7.5 19.5L12 15L7.5 10.5" />
8
+ </symbol>
9
+ </svg>
package/icons/index.ts CHANGED
@@ -45,3 +45,4 @@ export { default as iconSearch } from './search.svg'
45
45
  export { default as iconPhone } from './smartphone.svg'
46
46
  export { default as iconStar } from './star.svg'
47
47
  export { default as iconSun } from './sun.svg'
48
+ export { default as iconCompare } from './compare-arrows.svg'
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": "6.1.1-canary.5",
5
+ "version": "6.2.0-canary.10",
6
6
  "author": "",
7
7
  "license": "MIT",
8
8
  "sideEffects": false,
@@ -18,18 +18,18 @@
18
18
  "@emotion/react": "^11.10.6",
19
19
  "@emotion/server": "^11.4.0",
20
20
  "@emotion/styled": "^11.10.6",
21
- "@graphcommerce/framer-next-pages": "6.1.1-canary.5",
22
- "@graphcommerce/framer-scroller": "6.1.1-canary.5",
23
- "@graphcommerce/framer-utils": "6.1.1-canary.5",
24
- "@graphcommerce/image": "6.1.1-canary.5",
21
+ "@graphcommerce/framer-next-pages": "6.2.0-canary.10",
22
+ "@graphcommerce/framer-scroller": "6.2.0-canary.10",
23
+ "@graphcommerce/framer-utils": "6.2.0-canary.10",
24
+ "@graphcommerce/image": "6.2.0-canary.10",
25
25
  "cookie": "^0.5.0",
26
26
  "react-is": "^18.2.0",
27
27
  "schema-dts": "^1.1.0"
28
28
  },
29
29
  "devDependencies": {
30
- "@graphcommerce/eslint-config-pwa": "6.1.1-canary.5",
31
- "@graphcommerce/prettier-config-pwa": "6.1.1-canary.5",
32
- "@graphcommerce/typescript-config-pwa": "6.1.1-canary.5",
30
+ "@graphcommerce/eslint-config-pwa": "6.2.0-canary.10",
31
+ "@graphcommerce/prettier-config-pwa": "6.2.0-canary.10",
32
+ "@graphcommerce/typescript-config-pwa": "6.2.0-canary.10",
33
33
  "@types/cookie": "^0.5.1",
34
34
  "@types/react-is": "^17.0.3",
35
35
  "typescript": "4.9.5"