@graphcommerce/next-ui 9.0.4-canary.1 → 9.0.4-canary.11

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,39 @@
1
1
  # Change Log
2
2
 
3
+ ## 9.0.4-canary.11
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2485](https://github.com/graphcommerce-org/graphcommerce/pull/2485) [`b0ec078`](https://github.com/graphcommerce-org/graphcommerce/commit/b0ec0784a0b3ca977598ded3777d23bc929072b0) - Added a CurrencySymbol component that renders the current currency symbol ([@paales](https://github.com/paales))
8
+
9
+ ## 9.0.4-canary.10
10
+
11
+ ## 9.0.4-canary.9
12
+
13
+ ## 9.0.4-canary.8
14
+
15
+ ## 9.0.4-canary.7
16
+
17
+ ## 9.0.4-canary.6
18
+
19
+ ### Patch Changes
20
+
21
+ - [#2478](https://github.com/graphcommerce-org/graphcommerce/pull/2478) [`32bccbb`](https://github.com/graphcommerce-org/graphcommerce/commit/32bccbba4b000247d7e01e487f6d48b6dec07fb5) - Nesting multiple Containers will not increase the padding, will only be applied once. ([@paales](https://github.com/paales))
22
+
23
+ ## 9.0.4-canary.5
24
+
25
+ ## 9.0.4-canary.4
26
+
27
+ ## 9.0.4-canary.3
28
+
29
+ ## 9.0.4-canary.2
30
+
31
+ ### Patch Changes
32
+
33
+ - [#2473](https://github.com/graphcommerce-org/graphcommerce/pull/2473) [`8df172e`](https://github.com/graphcommerce-org/graphcommerce/commit/8df172e4fa1364892d53bc96a437d037d245de35) - Do not warn about `:first-child` since all css is hoisted out of the components. ([@paales](https://github.com/paales))
34
+
35
+ - [#2473](https://github.com/graphcommerce-org/graphcommerce/pull/2473) [`b076b2a`](https://github.com/graphcommerce-org/graphcommerce/commit/b076b2ae4881bebf1d2debd5333a83f220c26ca7) - Also accept false as value for sxx ([@paales](https://github.com/paales))
36
+
3
37
  ## 9.0.4-canary.1
4
38
 
5
39
  ### Patch Changes
@@ -76,10 +76,14 @@ export const Container = React.forwardRef(
76
76
  className={[className, classes.root].filter((v) => !!v).join(' ')}
77
77
  sx={[
78
78
  {
79
+ width: '100%',
79
80
  pl: !breakoutLeft ? padding : undefined,
80
81
  pr: !breakoutRight ? padding : undefined,
81
82
  '&.breakoutLeft': { pl: 'unset' },
82
83
  '&.breakoutRight': { pr: 'unset' },
84
+
85
+ // Nesting containers will not have padding applied.
86
+ '.MuiContainer-root &': { pl: 0, pr: 0 },
83
87
  },
84
88
  ...(Array.isArray(sx) ? sx : [sx]),
85
89
  ]}
@@ -0,0 +1,19 @@
1
+ import { Box } from '@mui/material'
2
+ import { forwardRef } from 'react'
3
+ import {
4
+ useIntlNumberFormat,
5
+ type UseIntlNumberFormatOptions,
6
+ } from '../NumberFormat/useIntlNumberFormat'
7
+
8
+ export type CurrencySymbolProps = Omit<UseIntlNumberFormatOptions, 'numberStyle'>
9
+
10
+ /** @public */
11
+ export const CurrencySymbol = forwardRef<HTMLSpanElement, CurrencySymbolProps>((props, ref) => {
12
+ const formatter = useIntlNumberFormat({ ...props, numberStyle: 'currency' })
13
+
14
+ return (
15
+ <Box component='span' suppressHydrationWarning ref={ref}>
16
+ {formatter.formatToParts(1).find((part) => part.type === 'currency')?.value}
17
+ </Box>
18
+ )
19
+ })
@@ -0,0 +1 @@
1
+ export * from './CurrencySymbol'
package/Intl/index.ts CHANGED
@@ -9,3 +9,4 @@ export * from './NumberFormat' // Intl.NumberFormat
9
9
  // export * from './PluralRules' // Intl.PluralRules
10
10
  export * from './RelativeTimeFormat' // Intl.RelativeTimeFormat
11
11
  // export * from './Segmenter' // Intl.Segmenter
12
+ export * from './CurrencySymbol'
@@ -10,5 +10,7 @@ export const createEmotionCache = () => {
10
10
  insertionPoint = emotionInsertionPoint ?? undefined
11
11
  }
12
12
 
13
- return createCache({ key: 'mui-style', insertionPoint, stylisPlugins: [] })
13
+ const cache = createCache({ key: 'mui-style', insertionPoint, stylisPlugins: [] })
14
+ cache.compat = true
15
+ return cache
14
16
  }
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.0.4-canary.1",
5
+ "version": "9.0.4-canary.11",
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.0.4-canary.1",
28
- "@graphcommerce/framer-next-pages": "^9.0.4-canary.1",
29
- "@graphcommerce/framer-scroller": "^9.0.4-canary.1",
30
- "@graphcommerce/framer-utils": "^9.0.4-canary.1",
31
- "@graphcommerce/image": "^9.0.4-canary.1",
32
- "@graphcommerce/prettier-config-pwa": "^9.0.4-canary.1",
33
- "@graphcommerce/typescript-config-pwa": "^9.0.4-canary.1",
27
+ "@graphcommerce/eslint-config-pwa": "^9.0.4-canary.11",
28
+ "@graphcommerce/framer-next-pages": "^9.0.4-canary.11",
29
+ "@graphcommerce/framer-scroller": "^9.0.4-canary.11",
30
+ "@graphcommerce/framer-utils": "^9.0.4-canary.11",
31
+ "@graphcommerce/image": "^9.0.4-canary.11",
32
+ "@graphcommerce/prettier-config-pwa": "^9.0.4-canary.11",
33
+ "@graphcommerce/typescript-config-pwa": "^9.0.4-canary.11",
34
34
  "@lingui/core": "^4.2.1",
35
35
  "@lingui/macro": "^4.2.1",
36
36
  "@lingui/react": "^4.2.1",
package/utils/sxx.ts CHANGED
@@ -9,8 +9,10 @@ import type { SxProps, Theme } from '@mui/material'
9
9
  * sxx({ position: 'absolute', right: 0, top: 0 }, props.sx)
10
10
  * ```
11
11
  */
12
- export const sxx = (...sxPropsArray: (SxProps<Theme> | undefined)[]): SxProps<Theme> =>
12
+ export const sxx = (
13
+ ...sxPropsArray: (SxProps<Theme> | undefined | null | false)[]
14
+ ): SxProps<Theme> =>
13
15
  sxPropsArray
14
- .filter((v) => v !== undefined)
16
+ .filter((v) => !!v)
15
17
  .map((sx) => (Array.isArray(sx) ? sx : [sx]))
16
18
  .flat(1)