@graphcommerce/next-ui 4.29.1 → 4.29.2

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.
@@ -2,6 +2,7 @@ import { alpha, Box, BoxProps, ButtonBase, ButtonProps, SxProps, Theme } from '@
2
2
  import React from 'react'
3
3
  import { extendableComponent } from '../Styles'
4
4
  import { breakpointVal } from '../Styles/breakpointVal'
5
+ import { responsiveVal } from '../Styles/responsiveVal'
5
6
 
6
7
  type Variants = 'outlined' | 'default'
7
8
  type Size = 'large' | 'medium' | 'small'
@@ -107,24 +108,34 @@ export function ActionCard(props: ActionCardProps) {
107
108
  disabled={disabled}
108
109
  sx={[
109
110
  (theme) => ({
111
+ ...breakpointVal(
112
+ 'borderRadius',
113
+ theme.shape.borderRadius * 3,
114
+ theme.shape.borderRadius * 4,
115
+ theme.breakpoints.values,
116
+ ),
117
+
110
118
  '&.sizeSmall': {
111
- py: `5px`,
119
+ px: responsiveVal(8, 12),
120
+ py: responsiveVal(6, 8),
112
121
  display: 'flex',
113
122
  typography: 'body2',
114
123
  },
115
-
116
124
  '&.sizeMedium': {
117
- py: `10px`,
125
+ px: responsiveVal(10, 16),
126
+ py: responsiveVal(8, 14),
118
127
  typography: 'body2',
119
128
  display: 'block',
120
129
  },
121
-
122
130
  '&.sizeLarge': {
131
+ px: theme.spacings.xs,
123
132
  py: theme.spacings.xxs,
124
133
  display: 'block',
125
134
  },
126
135
 
127
136
  '&.variantDefault': {
137
+ borderRadius: 0,
138
+ px: 0,
128
139
  borderBottom: `1px solid ${theme.palette.divider}`,
129
140
  '&.selected': {
130
141
  borderBottom: `2px solid ${theme.palette[color].main}`,
@@ -140,13 +151,14 @@ export function ActionCard(props: ActionCardProps) {
140
151
 
141
152
  '&.variantOutlined': {
142
153
  backgroundColor: theme.palette.background.paper,
143
- border: `1px solid ${theme.palette.divider}`,
154
+ boxShadow: `inset 0 0 0 1px ${theme.palette.divider}`,
144
155
  '&:not(:last-of-type)': {
145
156
  marginBottom: '-1px',
146
157
  },
147
158
 
148
159
  '&.layoutList': {
149
- '&:first-of-type, &.selected': {
160
+ borderRadius: 0,
161
+ '&:first-of-type': {
150
162
  ...breakpointVal(
151
163
  'borderTopLeftRadius',
152
164
  theme.shape.borderRadius * 3,
@@ -160,7 +172,7 @@ export function ActionCard(props: ActionCardProps) {
160
172
  theme.breakpoints.values,
161
173
  ),
162
174
  },
163
- '&:last-of-type, &.selected': {
175
+ '&:last-of-type': {
164
176
  ...breakpointVal(
165
177
  'borderBottomLeftRadius',
166
178
  theme.shape.borderRadius * 3,
@@ -175,34 +187,27 @@ export function ActionCard(props: ActionCardProps) {
175
187
  ),
176
188
  },
177
189
  },
178
- '&:not(.layoutList)': {
179
- ...breakpointVal(
180
- 'borderRadius',
181
- theme.shape.borderRadius * 3,
182
- theme.shape.borderRadius * 4,
183
- theme.breakpoints.values,
184
- ),
185
- },
186
-
187
- '&.sizeSmall': { px: `10px` },
188
- '&.sizeMedium': { px: `12px` },
189
- '&.sizeLarge': { px: theme.spacings.xs },
190
190
 
191
191
  '&.selected': {
192
- border: `2px solid ${theme.palette[color].main}`,
193
- boxShadow: `0 0 0 4px ${alpha(
192
+ borderColor: 'transparent',
193
+ boxShadow: `inset 0 0 0 2px ${theme.palette[color].main}`,
194
+ },
195
+ '&.selected:focus': {
196
+ borderColor: 'transparent',
197
+ boxShadow: `inset 0 0 0 2px ${theme.palette[color].main}, 0 0 0 4px ${alpha(
194
198
  theme.palette[color].main,
195
199
  theme.palette.action.hoverOpacity,
196
200
  )}`,
197
-
198
- '&.sizeSmall': { padding: `4px 9px` },
199
- '&.sizeMedium': { padding: `9px 11px` },
200
- '&.sizeLarge': {
201
- padding: `calc(${theme.spacings.xxs} - 1px) calc(${theme.spacings.xs} - 1px)`,
202
- },
203
201
  },
202
+ '&:focus': {
203
+ boxShadow: `inset 0 0 0 1px ${theme.palette.divider},0 0 0 4px ${alpha(
204
+ theme.palette[color].main,
205
+ theme.palette.action.hoverOpacity,
206
+ )}`,
207
+ },
208
+
204
209
  '&.error': {
205
- border: `2px solid ${theme.palette.error.main}`,
210
+ boxShadow: `0 0 0 2px ${theme.palette.error.main}`,
206
211
  },
207
212
  },
208
213
  '&.selected': {
@@ -228,6 +233,7 @@ export function ActionCard(props: ActionCardProps) {
228
233
  width: '100%',
229
234
  justifyContent: 'space-between',
230
235
  alignContent: 'stretch',
236
+ alignItems: 'flex-start',
231
237
  }}
232
238
  >
233
239
  <Box
@@ -287,7 +293,10 @@ export function ActionCard(props: ActionCardProps) {
287
293
  }}
288
294
  >
289
295
  {action && (
290
- <Box className={classes.action} sx={{ marginBottom: '5px' }}>
296
+ <Box
297
+ className={classes.action}
298
+ sx={(theme) => ({ marginBottom: '5px', color: theme.palette[color].main })}
299
+ >
291
300
  {!selected ? action : reset}
292
301
  </Box>
293
302
  )}
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.29.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1686](https://github.com/graphcommerce-org/graphcommerce/pull/1686) [`1953c7e27`](https://github.com/graphcommerce-org/graphcommerce/commit/1953c7e27eb606a825fce1ad361393b3c781c6da) Thanks [@paales](https://github.com/paales)! - Product page markup and sticky product image when the sidebar is fairly large
8
+
9
+ - Updated dependencies []:
10
+ - @graphcommerce/framer-scroller@2.1.44
11
+
3
12
  ## 4.29.1
4
13
 
5
14
  ### Patch Changes
@@ -113,6 +113,21 @@ export function SidebarGallery(props: SidebarGalleryProps) {
113
113
 
114
114
  const hasImages = images.length > 0
115
115
 
116
+ // sx={(theme) => ({
117
+ // [SidebarGallery.selectors.scrollerContainer]: {
118
+ // minHeight: 0,
119
+ // [theme.breakpoints.up('md')]: {
120
+ // position: 'sticky',
121
+ // top: 0,
122
+ // },
123
+ // '&.zoomed': {
124
+ // position: 'relative',
125
+ // top: 0,
126
+ // marginTop: 0,
127
+ // },
128
+ // },
129
+ // })}
130
+
116
131
  return (
117
132
  <ScrollerProvider scrollSnapAlign='center'>
118
133
  <Row maxWidth={false} disableGutters className={classes.row} sx={sx}>
@@ -154,13 +169,20 @@ export function SidebarGallery(props: SidebarGalleryProps) {
154
169
  height: 0, // https://stackoverflow.com/questions/44770074/css-grid-row-height-safari-bug
155
170
  backgroundColor: theme.palette.background.image,
156
171
  position: 'relative',
157
- minHeight: '100%',
158
172
  paddingTop: `min(${ratio}, ${maxHeight})`,
159
173
  [theme.breakpoints.down('md')]: {
160
174
  width: '100vw',
161
175
  },
176
+ minHeight: 0,
177
+ [theme.breakpoints.up('md')]: {
178
+ position: 'sticky',
179
+ top: 0,
180
+ },
162
181
  },
163
182
  zoomed && {
183
+ position: 'relative',
184
+ top: 0,
185
+ marginTop: 0,
164
186
  paddingTop: `var(--client-size-y)`,
165
187
  },
166
188
  ]}
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.29.1",
5
+ "version": "4.29.2",
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.43",
23
+ "@graphcommerce/framer-scroller": "2.1.44",
24
24
  "@graphcommerce/framer-utils": "3.2.1",
25
25
  "@graphcommerce/image": "3.1.10",
26
26
  "cookie": "^0.5.0",