@graphcommerce/next-ui 9.0.4-canary.10 → 9.0.4-canary.12

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,13 @@
1
1
  # Change Log
2
2
 
3
+ ## 9.0.4-canary.12
4
+
5
+ ## 9.0.4-canary.11
6
+
7
+ ### Patch Changes
8
+
9
+ - [#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))
10
+
3
11
  ## 9.0.4-canary.10
4
12
 
5
13
  ## 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/hooks/memoDeep.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  // eslint-disable-next-line import/no-extraneous-dependencies
2
+ import diff from '@graphcommerce/react-hook-form/src/diff'
3
+ // eslint-disable-next-line import/no-extraneous-dependencies
2
4
  import { equal } from '@wry/equality'
3
5
  import type { FunctionComponent, NamedExoticComponent } from 'react'
4
6
  import { memo } from 'react'
@@ -23,11 +25,10 @@ export function memoDeep<P extends object>(
23
25
  const result = equal(prevProps, nextProps)
24
26
  const ms = performance.now() - start
25
27
 
26
- if (ms < 0.2) return result
28
+ if (!result && ms < 0.2) return result
27
29
 
28
- console.warn('memoDeep took more than 0.2ms', {
30
+ console.warn(`memoDeep took ${ms.toFixed(2)}ms`, {
29
31
  result,
30
- ms,
31
32
  Component,
32
33
  prevProps,
33
34
  nextProps,
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.12",
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.12",
28
+ "@graphcommerce/framer-next-pages": "^9.0.4-canary.12",
29
+ "@graphcommerce/framer-scroller": "^9.0.4-canary.12",
30
+ "@graphcommerce/framer-utils": "^9.0.4-canary.12",
31
+ "@graphcommerce/image": "^9.0.4-canary.12",
32
+ "@graphcommerce/prettier-config-pwa": "^9.0.4-canary.12",
33
+ "@graphcommerce/typescript-config-pwa": "^9.0.4-canary.12",
34
34
  "@lingui/core": "^4.2.1",
35
35
  "@lingui/macro": "^4.2.1",
36
36
  "@lingui/react": "^4.2.1",