@graphcommerce/next-ui 9.1.0-canary.16 → 9.1.0-canary.17

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.
@@ -186,9 +186,9 @@ export function ActionCard<C extends React.ElementType = typeof Box>(props: Acti
186
186
  '&.variantOutlined': {
187
187
  backgroundColor: theme.palette.background.paper,
188
188
  boxShadow: `inset 0 0 0 1px ${theme.palette.divider}`,
189
- '&:not(:last-of-type)': {
190
- marginBottom: '-2px',
191
- },
189
+ // '&:not(:last-of-type)': {
190
+ // marginBottom: '-2px',
191
+ // },
192
192
  '&.layoutList': {
193
193
  borderRadius: 0,
194
194
  '&:first-of-type': {
@@ -296,6 +296,7 @@ export function ActionCard<C extends React.ElementType = typeof Box>(props: Acti
296
296
  display: 'flex',
297
297
  flexDirection: 'column',
298
298
  alignItems: 'flex-start',
299
+ justifyContent: 'center',
299
300
  }}
300
301
  >
301
302
  {title && (
@@ -348,7 +349,7 @@ export function ActionCard<C extends React.ElementType = typeof Box>(props: Acti
348
349
  )}
349
350
  {...slotProps.end}
350
351
  >
351
- {action && (
352
+ {(action || reset) && (
352
353
  <Box
353
354
  className={classes.action}
354
355
  sx={sxx(
package/CHANGELOG.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Change Log
2
2
 
3
+ ## 9.1.0-canary.17
4
+
3
5
  ## 9.1.0-canary.16
4
6
 
5
7
  ## 9.1.0-canary.15
@@ -1,19 +1,29 @@
1
- import type { AvatarProps } from '@mui/material'
2
- import { Avatar } from '@mui/material'
1
+ import type { BoxProps } from '@mui/material'
2
+ import { Box } from '@mui/material'
3
+ import { useIntlDisplayNames } from '../Intl'
4
+ import { sxx } from '../utils/sxx'
3
5
 
4
- export type FlagAvatarProps = { country: string } & Omit<AvatarProps, 'src'>
6
+ export type FlagAvatarProps = { country: string; size: string } & Omit<BoxProps<'img'>, 'src'>
5
7
 
6
8
  export function FlagAvatar(props: FlagAvatarProps) {
7
- const { country, ...avatarProps } = props
9
+ const { country, size, sx, ...avatarProps } = props
10
+
11
+ const displayName = useIntlDisplayNames({ type: 'region' })
8
12
 
9
13
  return (
10
- <Avatar
14
+ <Box
15
+ component='img'
11
16
  {...avatarProps}
12
- imgProps={{ loading: 'lazy' }}
13
- alt={country}
14
- src={`https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.4.3/flags/1x1/${country}.svg`}
15
- >
16
- {country.toLocaleUpperCase()}
17
- </Avatar>
17
+ src={`https://flagcdn.com/${country}.svg`}
18
+ alt={displayName.of(country)}
19
+ sx={sxx(
20
+ {
21
+ width: size,
22
+ borderRadius: '2px',
23
+ height: size,
24
+ },
25
+ sx,
26
+ )}
27
+ />
18
28
  )
19
29
  }
@@ -1,5 +1,6 @@
1
1
  import { Box, type SxProps, type Theme } from '@mui/material'
2
2
  import { forwardRef } from 'react'
3
+ import { DisplayNames } from '../DisplayNames'
3
4
  import {
4
5
  useIntlNumberFormat,
5
6
  type UseIntlNumberFormatOptions,
@@ -7,16 +8,23 @@ import {
7
8
 
8
9
  export type CurrencySymbolProps = Omit<UseIntlNumberFormatOptions, 'numberStyle'> & {
9
10
  sx?: SxProps<Theme>
11
+ variant?: 'symbol' | 'full'
10
12
  }
11
13
 
12
14
  /** @public */
13
15
  export const CurrencySymbol = forwardRef<HTMLSpanElement, CurrencySymbolProps>((props, ref) => {
14
- const { sx, ...options } = props
16
+ const { sx, variant = 'symbol', ...options } = props
15
17
  const formatter = useIntlNumberFormat({ ...options, numberStyle: 'currency' })
16
18
 
17
19
  return (
18
20
  <Box component='span' suppressHydrationWarning ref={ref} sx={sx}>
19
21
  {formatter.formatToParts(1).find((part) => part.type === 'currency')?.value}
22
+ {options.currency && variant === 'full' && (
23
+ <>
24
+ {' – '}
25
+ {options.currency} – <DisplayNames type='currency' code={options.currency} />
26
+ </>
27
+ )}
20
28
  </Box>
21
29
  )
22
30
  })
@@ -9,7 +9,7 @@ export type UseIntlListFormatOptions = {
9
9
  UseIntlLocalesArgumentOptions
10
10
 
11
11
  export function useIntlListFormat(props: UseIntlListFormatOptions) {
12
- const [locales, options] = useIntlLocalesArgument(props)
13
- const memoOptions = useMemoObject({ ...options })
12
+ const [locales, { listStyle: style, ...options }] = useIntlLocalesArgument(props)
13
+ const memoOptions = useMemoObject({ style, ...options })
14
14
  return useMemo(() => new Intl.ListFormat(locales, memoOptions), [locales, memoOptions])
15
15
  }
@@ -5,6 +5,6 @@ import { storefrontConfig } from '../utils/storefrontConfig'
5
5
  export function useStorefrontConfig(locale?: string | undefined) {
6
6
  const routerLocale = useRouter().locale
7
7
  const config = storefrontConfig(locale ?? routerLocale)
8
- if (!config) throw Error(`No storefront config found for locale ${locale}`)
8
+ if (!config) throw Error(`No storefront config found for locale '${locale}'`)
9
9
  return config
10
10
  }
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": "9.1.0-canary.16",
5
+ "version": "9.1.0-canary.17",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -24,13 +24,13 @@
24
24
  "@emotion/react": "^11",
25
25
  "@emotion/server": "^11",
26
26
  "@emotion/styled": "^11",
27
- "@graphcommerce/eslint-config-pwa": "^9.1.0-canary.16",
28
- "@graphcommerce/framer-next-pages": "^9.1.0-canary.16",
29
- "@graphcommerce/framer-scroller": "^9.1.0-canary.16",
30
- "@graphcommerce/framer-utils": "^9.1.0-canary.16",
31
- "@graphcommerce/image": "^9.1.0-canary.16",
32
- "@graphcommerce/prettier-config-pwa": "^9.1.0-canary.16",
33
- "@graphcommerce/typescript-config-pwa": "^9.1.0-canary.16",
27
+ "@graphcommerce/eslint-config-pwa": "^9.1.0-canary.17",
28
+ "@graphcommerce/framer-next-pages": "^9.1.0-canary.17",
29
+ "@graphcommerce/framer-scroller": "^9.1.0-canary.17",
30
+ "@graphcommerce/framer-utils": "^9.1.0-canary.17",
31
+ "@graphcommerce/image": "^9.1.0-canary.17",
32
+ "@graphcommerce/prettier-config-pwa": "^9.1.0-canary.17",
33
+ "@graphcommerce/typescript-config-pwa": "^9.1.0-canary.17",
34
34
  "@lingui/core": "^4.2.1",
35
35
  "@lingui/macro": "^4.2.1",
36
36
  "@lingui/react": "^4.2.1",