@graphcommerce/next-ui 9.0.4-canary.10 → 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,11 @@
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
+
3
9
  ## 9.0.4-canary.10
4
10
 
5
11
  ## 9.0.4-canary.9
@@ -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'
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.10",
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.10",
28
- "@graphcommerce/framer-next-pages": "^9.0.4-canary.10",
29
- "@graphcommerce/framer-scroller": "^9.0.4-canary.10",
30
- "@graphcommerce/framer-utils": "^9.0.4-canary.10",
31
- "@graphcommerce/image": "^9.0.4-canary.10",
32
- "@graphcommerce/prettier-config-pwa": "^9.0.4-canary.10",
33
- "@graphcommerce/typescript-config-pwa": "^9.0.4-canary.10",
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",