@graphcommerce/next-ui 8.0.6-canary.4 → 8.0.7

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.
@@ -1,10 +1,5 @@
1
1
  /* eslint-disable import/no-extraneous-dependencies */
2
- import {
3
- Controller,
4
- ControllerProps,
5
- FieldValues,
6
- useController,
7
- } from '@graphcommerce/react-hook-form'
2
+ import { Controller, ControllerProps, FieldValues } from '@graphcommerce/react-hook-form'
8
3
  import React, { MouseEventHandler } from 'react'
9
4
  import { ActionCardProps } from './ActionCard'
10
5
  import { ActionCardList, ActionCardListProps } from './ActionCardList'
@@ -48,41 +43,38 @@ export function ActionCardListForm<
48
43
  : selectValues === itemValue
49
44
  }
50
45
 
51
- const {
52
- field: { onChange, value, ref },
53
- fieldState,
54
- formState,
55
- } = useController({
56
- ...props,
57
- control,
58
- name,
59
- defaultValue,
60
- rules: { required: errorMessage || required, ...rules },
61
- })
62
-
63
46
  return (
64
- <ActionCardList
65
- {...other}
66
- multiple={multiple}
67
- required={required}
68
- value={value}
69
- ref={ref}
70
- onChange={(_, incomming) => onChange(incomming)}
71
- error={formState.isSubmitted && !!fieldState.error}
72
- errorMessage={fieldState.error?.message}
73
- >
74
- {items.map((item) => (
75
- <RenderItem
76
- {...item}
77
- key={item.value ?? ''}
78
- value={item.value}
79
- selected={onSelect(item.value, value)}
80
- onReset={(e) => {
81
- e.preventDefault()
82
- onChange(null)
83
- }}
84
- />
85
- ))}
86
- </ActionCardList>
47
+ <Controller
48
+ {...props}
49
+ control={control}
50
+ name={name}
51
+ defaultValue={defaultValue}
52
+ rules={{ required: errorMessage || required, ...rules }}
53
+ render={({ field: { onChange, value, ref }, fieldState, formState }) => (
54
+ <ActionCardList
55
+ {...other}
56
+ multiple={multiple}
57
+ required={required}
58
+ value={value}
59
+ ref={ref}
60
+ onChange={(_, incomming) => onChange(incomming)}
61
+ error={formState.isSubmitted && !!fieldState.error}
62
+ errorMessage={fieldState.error?.message}
63
+ >
64
+ {items.map((item) => (
65
+ <RenderItem
66
+ {...item}
67
+ key={item.value ?? ''}
68
+ value={item.value}
69
+ selected={onSelect(item.value, value)}
70
+ onReset={(e) => {
71
+ e.preventDefault()
72
+ onChange(null)
73
+ }}
74
+ />
75
+ ))}
76
+ </ActionCardList>
77
+ )}
78
+ />
87
79
  )
88
80
  }
package/CHANGELOG.md CHANGED
@@ -1,50 +1,26 @@
1
1
  # Change Log
2
2
 
3
- ## 8.0.6-canary.4
3
+ ## 8.0.7
4
4
 
5
- ## 8.0.6-canary.3
6
-
7
- ## 8.0.6-canary.2
8
-
9
- ### Patch Changes
10
-
11
- - [#2234](https://github.com/graphcommerce-org/graphcommerce/pull/2234) [`43bd04a`](https://github.com/graphcommerce-org/graphcommerce/commit/43bd04a777c5800cc7e01bee1e123a5aad82f194) - Added useIsSSR hook that will properly resolve when the page is rendered on the server and on first render, but will return false when a component is rendered on the client directly.
12
- ([@FrankHarland](https://github.com/FrankHarland))
13
-
14
- - [#2234](https://github.com/graphcommerce-org/graphcommerce/pull/2234) [`0767bc4`](https://github.com/graphcommerce-org/graphcommerce/commit/0767bc40f7b596209f24ca4e745ff0441f3275c9) - Upgrade input components to no longer use muiRegister, which improves INP scores
15
- ([@FrankHarland](https://github.com/FrankHarland))
16
-
17
- ## 8.0.6-canary.1
18
-
19
- ## 8.0.6-canary.0
20
-
21
- ### Patch Changes
22
-
23
- - [#2196](https://github.com/graphcommerce-org/graphcommerce/pull/2196) [`84c50e4`](https://github.com/graphcommerce-org/graphcommerce/commit/84c50e49a1a7f154d4a8f4045c37e773e20283ad) - Allow Lingui to use linguiLocale with country identifiers like `en-us`, it would always load `en` in this case. Introced a new `useLocale` hook to use the correct locale string to use in Intl methods.
24
- ([@paales](https://github.com/paales))
5
+ ## 8.0.6
25
6
 
26
7
  ## 8.0.5
27
8
 
28
9
  ### Patch Changes
29
10
 
30
- - [#2236](https://github.com/graphcommerce-org/graphcommerce/pull/2236) [`85fb916`](https://github.com/graphcommerce-org/graphcommerce/commit/85fb916e5ec2a1456a93a59bf92a5f414fee8595) - Solve issue where the inert prop wouldnt be properly forwarded
31
- ([@paales](https://github.com/paales))
11
+ - [#2236](https://github.com/graphcommerce-org/graphcommerce/pull/2236) [`85fb916`](https://github.com/graphcommerce-org/graphcommerce/commit/85fb916e5ec2a1456a93a59bf92a5f414fee8595) - Solve issue where the inert prop wouldnt be properly forwarded ([@paales](https://github.com/paales))
32
12
 
33
13
  - [#2235](https://github.com/graphcommerce-org/graphcommerce/pull/2235) [`de99691`](https://github.com/graphcommerce-org/graphcommerce/commit/de9969155e271cc2535147479b80b602a1b9c335) - The Lazyhydrate component to accepts any BoxProps. Replaced `<section>` with a `<Box>` so it doesn't hold symantic meaning.
34
14
 
35
15
  Please note: If you've used child selectors to style the section, please make sure you update your styles. ([@carlocarels90](https://github.com/carlocarels90))
36
16
 
37
- - [#2241](https://github.com/graphcommerce-org/graphcommerce/pull/2241) [`6f3fe60`](https://github.com/graphcommerce-org/graphcommerce/commit/6f3fe60441762d55cb46d587279121e8fe469cdd) - Decreased layout shift on product pages by reserving space for sidebar
38
- ([@bramvanderholst](https://github.com/bramvanderholst))
17
+ - [#2241](https://github.com/graphcommerce-org/graphcommerce/pull/2241) [`6f3fe60`](https://github.com/graphcommerce-org/graphcommerce/commit/6f3fe60441762d55cb46d587279121e8fe469cdd) - Decreased layout shift on product pages by reserving space for sidebar ([@bramvanderholst](https://github.com/bramvanderholst))
39
18
 
40
- - [#2241](https://github.com/graphcommerce-org/graphcommerce/pull/2241) [`cde3c31`](https://github.com/graphcommerce-org/graphcommerce/commit/cde3c310abf2ac3c82d1062d5fb0a4c00ba50cff) - Removed unnecessary vendor prefixes
41
- ([@bramvanderholst](https://github.com/bramvanderholst))
19
+ - [#2241](https://github.com/graphcommerce-org/graphcommerce/pull/2241) [`cde3c31`](https://github.com/graphcommerce-org/graphcommerce/commit/cde3c310abf2ac3c82d1062d5fb0a4c00ba50cff) - Removed unnecessary vendor prefixes ([@bramvanderholst](https://github.com/bramvanderholst))
42
20
 
43
- - [#2241](https://github.com/graphcommerce-org/graphcommerce/pull/2241) [`4c83636`](https://github.com/graphcommerce-org/graphcommerce/commit/4c836366c324881ee5121c645c5f94fc60e3ebb3) - Prevent horizontal scrollbar on small screens when using SidebarGallery
44
- ([@bramvanderholst](https://github.com/bramvanderholst))
21
+ - [#2241](https://github.com/graphcommerce-org/graphcommerce/pull/2241) [`4c83636`](https://github.com/graphcommerce-org/graphcommerce/commit/4c836366c324881ee5121c645c5f94fc60e3ebb3) - Prevent horizontal scrollbar on small screens when using SidebarGallery ([@bramvanderholst](https://github.com/bramvanderholst))
45
22
 
46
- - [#2230](https://github.com/graphcommerce-org/graphcommerce/pull/2230) [`1da6b82`](https://github.com/graphcommerce-org/graphcommerce/commit/1da6b82dbb7e1543542d809ea625a8867643ea68) - Fix menu item visibility in accessability tree
47
- ([@JoshuaS98](https://github.com/JoshuaS98))
23
+ - [#2230](https://github.com/graphcommerce-org/graphcommerce/pull/2230) [`1da6b82`](https://github.com/graphcommerce-org/graphcommerce/commit/1da6b82dbb7e1543542d809ea625a8867643ea68) - Fix menu item visibility in accessability tree ([@JoshuaS98](https://github.com/JoshuaS98))
48
24
 
49
25
  ## 8.0.5-canary.10
50
26
 
@@ -56,14 +32,11 @@
56
32
 
57
33
  ### Patch Changes
58
34
 
59
- - [#2241](https://github.com/graphcommerce-org/graphcommerce/pull/2241) [`6f3fe60`](https://github.com/graphcommerce-org/graphcommerce/commit/6f3fe60441762d55cb46d587279121e8fe469cdd) - Decreased layout shift on product pages by reserving space for sidebar
60
- ([@bramvanderholst](https://github.com/bramvanderholst))
35
+ - [#2241](https://github.com/graphcommerce-org/graphcommerce/pull/2241) [`6f3fe60`](https://github.com/graphcommerce-org/graphcommerce/commit/6f3fe60441762d55cb46d587279121e8fe469cdd) - Decreased layout shift on product pages by reserving space for sidebar ([@bramvanderholst](https://github.com/bramvanderholst))
61
36
 
62
- - [#2241](https://github.com/graphcommerce-org/graphcommerce/pull/2241) [`cde3c31`](https://github.com/graphcommerce-org/graphcommerce/commit/cde3c310abf2ac3c82d1062d5fb0a4c00ba50cff) - Removed unnecessary vendor prefixes
63
- ([@bramvanderholst](https://github.com/bramvanderholst))
37
+ - [#2241](https://github.com/graphcommerce-org/graphcommerce/pull/2241) [`cde3c31`](https://github.com/graphcommerce-org/graphcommerce/commit/cde3c310abf2ac3c82d1062d5fb0a4c00ba50cff) - Removed unnecessary vendor prefixes ([@bramvanderholst](https://github.com/bramvanderholst))
64
38
 
65
- - [#2241](https://github.com/graphcommerce-org/graphcommerce/pull/2241) [`4c83636`](https://github.com/graphcommerce-org/graphcommerce/commit/4c836366c324881ee5121c645c5f94fc60e3ebb3) - Prevent horizontal scrollbar on small screens when using SidebarGallery
66
- ([@bramvanderholst](https://github.com/bramvanderholst))
39
+ - [#2241](https://github.com/graphcommerce-org/graphcommerce/pull/2241) [`4c83636`](https://github.com/graphcommerce-org/graphcommerce/commit/4c836366c324881ee5121c645c5f94fc60e3ebb3) - Prevent horizontal scrollbar on small screens when using SidebarGallery ([@bramvanderholst](https://github.com/bramvanderholst))
67
40
 
68
41
  ## 8.0.5-canary.6
69
42
 
@@ -75,8 +48,7 @@
75
48
 
76
49
  ### Patch Changes
77
50
 
78
- - [#2236](https://github.com/graphcommerce-org/graphcommerce/pull/2236) [`85fb916`](https://github.com/graphcommerce-org/graphcommerce/commit/85fb916e5ec2a1456a93a59bf92a5f414fee8595) - Solve issue where the inert prop wouldnt be properly forwarded
79
- ([@paales](https://github.com/paales))
51
+ - [#2236](https://github.com/graphcommerce-org/graphcommerce/pull/2236) [`85fb916`](https://github.com/graphcommerce-org/graphcommerce/commit/85fb916e5ec2a1456a93a59bf92a5f414fee8595) - Solve issue where the inert prop wouldnt be properly forwarded ([@paales](https://github.com/paales))
80
52
 
81
53
  ## 8.0.5-canary.2
82
54
 
@@ -92,15 +64,13 @@
92
64
 
93
65
  ### Patch Changes
94
66
 
95
- - [#2230](https://github.com/graphcommerce-org/graphcommerce/pull/2230) [`1da6b82`](https://github.com/graphcommerce-org/graphcommerce/commit/1da6b82dbb7e1543542d809ea625a8867643ea68) - Fix menu item visibility in accessability tree
96
- ([@JoshuaS98](https://github.com/JoshuaS98))
67
+ - [#2230](https://github.com/graphcommerce-org/graphcommerce/pull/2230) [`1da6b82`](https://github.com/graphcommerce-org/graphcommerce/commit/1da6b82dbb7e1543542d809ea625a8867643ea68) - Fix menu item visibility in accessability tree ([@JoshuaS98](https://github.com/JoshuaS98))
97
68
 
98
69
  ## 8.0.4
99
70
 
100
71
  ### Patch Changes
101
72
 
102
- - [#2228](https://github.com/graphcommerce-org/graphcommerce/pull/2228) [`0c0cacb`](https://github.com/graphcommerce-org/graphcommerce/commit/0c0cacb8725f0a626ea5d3acf154d83c433c3eb7) - apply correct type for the inert property
103
- ([@carlocarels90](https://github.com/carlocarels90))
73
+ - [#2228](https://github.com/graphcommerce-org/graphcommerce/pull/2228) [`0c0cacb`](https://github.com/graphcommerce-org/graphcommerce/commit/0c0cacb8725f0a626ea5d3acf154d83c433c3eb7) - apply correct type for the inert property ([@carlocarels90](https://github.com/carlocarels90))
104
74
 
105
75
  ## 8.0.4-canary.1
106
76
 
@@ -108,8 +78,7 @@
108
78
 
109
79
  ### Patch Changes
110
80
 
111
- - [#2228](https://github.com/graphcommerce-org/graphcommerce/pull/2228) [`0c0cacb`](https://github.com/graphcommerce-org/graphcommerce/commit/0c0cacb8725f0a626ea5d3acf154d83c433c3eb7) - apply correct type for the inert property
112
- ([@carlocarels90](https://github.com/carlocarels90))
81
+ - [#2228](https://github.com/graphcommerce-org/graphcommerce/pull/2228) [`0c0cacb`](https://github.com/graphcommerce-org/graphcommerce/commit/0c0cacb8725f0a626ea5d3acf154d83c433c3eb7) - apply correct type for the inert property ([@carlocarels90](https://github.com/carlocarels90))
113
82
 
114
83
  ## 8.0.3
115
84
 
@@ -141,15 +110,13 @@
141
110
 
142
111
  ### Patch Changes
143
112
 
144
- - [#2191](https://github.com/graphcommerce-org/graphcommerce/pull/2191) [`13ffa6b`](https://github.com/graphcommerce-org/graphcommerce/commit/13ffa6b945f1c72bf1fdc9298e4ce5dd76b48d73) - When a user was logging in from the checkout react would be caught in an infinite loop and thus the page would hang
145
- ([@JoshuaS98](https://github.com/JoshuaS98))
113
+ - [#2191](https://github.com/graphcommerce-org/graphcommerce/pull/2191) [`13ffa6b`](https://github.com/graphcommerce-org/graphcommerce/commit/13ffa6b945f1c72bf1fdc9298e4ce5dd76b48d73) - When a user was logging in from the checkout react would be caught in an infinite loop and thus the page would hang ([@JoshuaS98](https://github.com/JoshuaS98))
146
114
 
147
115
  ## 8.0.1-canary.4
148
116
 
149
117
  ### Patch Changes
150
118
 
151
- - [#2191](https://github.com/graphcommerce-org/graphcommerce/pull/2191) [`13ffa6b`](https://github.com/graphcommerce-org/graphcommerce/commit/13ffa6b945f1c72bf1fdc9298e4ce5dd76b48d73) - When a user was logging in from the checkout react would be caught in an infinite loop and thus the page would hang
152
- ([@JoshuaS98](https://github.com/JoshuaS98))
119
+ - [#2191](https://github.com/graphcommerce-org/graphcommerce/pull/2191) [`13ffa6b`](https://github.com/graphcommerce-org/graphcommerce/commit/13ffa6b945f1c72bf1fdc9298e4ce5dd76b48d73) - When a user was logging in from the checkout react would be caught in an infinite loop and thus the page would hang ([@JoshuaS98](https://github.com/JoshuaS98))
153
120
 
154
121
  ## 8.0.1-canary.3
155
122
 
@@ -163,67 +130,47 @@
163
130
 
164
131
  ### Minor Changes
165
132
 
166
- - [#2133](https://github.com/graphcommerce-org/graphcommerce/pull/2133) [`133f908`](https://github.com/graphcommerce-org/graphcommerce/commit/133f908200a79589036420f2925835724522cab8) - Added new `<LazyHydrate/>` component to improve the Total Blocking Time and implemented them in, `<RowRenderer/>`, `<ProductListItemBase/>`, `<Footer/>` and for the `<NavigationProvider/>`. Reduced the TBT by 50% on the homepage and other pages.
167
- ([@Jessevdpoel](https://github.com/Jessevdpoel))
133
+ - [#2133](https://github.com/graphcommerce-org/graphcommerce/pull/2133) [`133f908`](https://github.com/graphcommerce-org/graphcommerce/commit/133f908200a79589036420f2925835724522cab8) - Added new `<LazyHydrate/>` component to improve the Total Blocking Time and implemented them in, `<RowRenderer/>`, `<ProductListItemBase/>`, `<Footer/>` and for the `<NavigationProvider/>`. Reduced the TBT by 50% on the homepage and other pages. ([@Jessevdpoel](https://github.com/Jessevdpoel))
168
134
 
169
- - [#2073](https://github.com/graphcommerce-org/graphcommerce/pull/2073) [`05ce566`](https://github.com/graphcommerce-org/graphcommerce/commit/05ce5665b3c63b0620266c8ac35e8b555e2029e8) - It is now allowed to use children inside the footer component
170
- ([@Jessevdpoel](https://github.com/Jessevdpoel))
135
+ - [#2073](https://github.com/graphcommerce-org/graphcommerce/pull/2073) [`05ce566`](https://github.com/graphcommerce-org/graphcommerce/commit/05ce5665b3c63b0620266c8ac35e8b555e2029e8) - It is now allowed to use children inside the footer component ([@Jessevdpoel](https://github.com/Jessevdpoel))
171
136
 
172
- - [#2018](https://github.com/graphcommerce-org/graphcommerce/pull/2018) [`750aa6a`](https://github.com/graphcommerce-org/graphcommerce/commit/750aa6a72710869d54244467253212e551d335e0) - Changed the layout of the succes page. We are using ActionCards right now to match the design of the cart.
173
- ([@Jessevdpoel](https://github.com/Jessevdpoel))
137
+ - [#2018](https://github.com/graphcommerce-org/graphcommerce/pull/2018) [`750aa6a`](https://github.com/graphcommerce-org/graphcommerce/commit/750aa6a72710869d54244467253212e551d335e0) - Changed the layout of the succes page. We are using ActionCards right now to match the design of the cart. ([@Jessevdpoel](https://github.com/Jessevdpoel))
174
138
 
175
139
  ### Patch Changes
176
140
 
177
- - [#2161](https://github.com/graphcommerce-org/graphcommerce/pull/2161) [`cc5c636`](https://github.com/graphcommerce-org/graphcommerce/commit/cc5c636f9f2b3d9fa33384b9a02d6ad3631aa414) - On certain breakpoints the Product page gallery had additional padding applied.
178
- ([@Jessevdpoel](https://github.com/Jessevdpoel))
141
+ - [#2161](https://github.com/graphcommerce-org/graphcommerce/pull/2161) [`cc5c636`](https://github.com/graphcommerce-org/graphcommerce/commit/cc5c636f9f2b3d9fa33384b9a02d6ad3631aa414) - On certain breakpoints the Product page gallery had additional padding applied. ([@Jessevdpoel](https://github.com/Jessevdpoel))
179
142
 
180
- - [#2138](https://github.com/graphcommerce-org/graphcommerce/pull/2138) [`a057d62`](https://github.com/graphcommerce-org/graphcommerce/commit/a057d6274e1d427e631ab3fad7a16078315103b8) - When viewing the homepage the logo will not have a `<a/>` tag wrapped anymore.
181
- ([@carlocarels90](https://github.com/carlocarels90))
143
+ - [#2138](https://github.com/graphcommerce-org/graphcommerce/pull/2138) [`a057d62`](https://github.com/graphcommerce-org/graphcommerce/commit/a057d6274e1d427e631ab3fad7a16078315103b8) - When viewing the homepage the logo will not have a `<a/>` tag wrapped anymore. ([@carlocarels90](https://github.com/carlocarels90))
182
144
 
183
- - [#2004](https://github.com/graphcommerce-org/graphcommerce/pull/2004) [`da21357`](https://github.com/graphcommerce-org/graphcommerce/commit/da2135744dddfa0d211c59589090ebb1977c38c9) - The `<Snackbar/>` component now accepts an icon when severity is set to info
184
- ([@bramvanderholst](https://github.com/bramvanderholst))
145
+ - [#2004](https://github.com/graphcommerce-org/graphcommerce/pull/2004) [`da21357`](https://github.com/graphcommerce-org/graphcommerce/commit/da2135744dddfa0d211c59589090ebb1977c38c9) - The `<Snackbar/>` component now accepts an icon when severity is set to info ([@bramvanderholst](https://github.com/bramvanderholst))
185
146
 
186
- - [#2135](https://github.com/graphcommerce-org/graphcommerce/pull/2135) [`7b017f5`](https://github.com/graphcommerce-org/graphcommerce/commit/7b017f58ba3be587d20a7f52c84b2907d52fe201) - Fix incorrect canonical URLs when i18n domain routing is used
187
- ([@hnsr](https://github.com/hnsr))
147
+ - [#2135](https://github.com/graphcommerce-org/graphcommerce/pull/2135) [`7b017f5`](https://github.com/graphcommerce-org/graphcommerce/commit/7b017f58ba3be587d20a7f52c84b2907d52fe201) - Fix incorrect canonical URLs when i18n domain routing is used ([@hnsr](https://github.com/hnsr))
188
148
 
189
- - [#2077](https://github.com/graphcommerce-org/graphcommerce/pull/2077) [`727d100`](https://github.com/graphcommerce-org/graphcommerce/commit/727d1004dfcb7dddf6e35b6b157a34491bb05cc6) - Fixed ItemScroller component className. Changed from SidebarSlider to ItemScroller
190
- ([@bramvanderholst](https://github.com/bramvanderholst))
149
+ - [#2077](https://github.com/graphcommerce-org/graphcommerce/pull/2077) [`727d100`](https://github.com/graphcommerce-org/graphcommerce/commit/727d1004dfcb7dddf6e35b6b157a34491bb05cc6) - Fixed ItemScroller component className. Changed from SidebarSlider to ItemScroller ([@bramvanderholst](https://github.com/bramvanderholst))
191
150
 
192
- - [`e33660f`](https://github.com/graphcommerce-org/graphcommerce/commit/e33660f172466dcfa0ab7262cee612d9a3e47776) - Accessibility improvements for the frontend: Added skip content link. Removed empty buttons from tab flow. Gave focus to elements (such as the menu) that appear when after clicking a button. Improved aria labels where needed
193
- ([@FrankHarland](https://github.com/FrankHarland))
151
+ - [`e33660f`](https://github.com/graphcommerce-org/graphcommerce/commit/e33660f172466dcfa0ab7262cee612d9a3e47776) - Accessibility improvements for the frontend: Added skip content link. Removed empty buttons from tab flow. Gave focus to elements (such as the menu) that appear when after clicking a button. Improved aria labels where needed ([@FrankHarland](https://github.com/FrankHarland))
194
152
 
195
- - [#2108](https://github.com/graphcommerce-org/graphcommerce/pull/2108) [`7fc4bb9`](https://github.com/graphcommerce-org/graphcommerce/commit/7fc4bb925c59da46961c9656a2a67b37a9c2d652) - Removed the 'NoSSR' functionality from `<WaitForQueries/>` component as it slows down rendering. The 'feature' was necessary for the following use case: When hydrating a component that was server rendered and was living inside a `<Suspense />` component. It would cause an hydration error and this was the workaround. With useSuspenseQuery and React 18, this problem will not occur.
196
- ([@StefanAngenent](https://github.com/StefanAngenent))
153
+ - [#2108](https://github.com/graphcommerce-org/graphcommerce/pull/2108) [`7fc4bb9`](https://github.com/graphcommerce-org/graphcommerce/commit/7fc4bb925c59da46961c9656a2a67b37a9c2d652) - Removed the 'NoSSR' functionality from `<WaitForQueries/>` component as it slows down rendering. The 'feature' was necessary for the following use case: When hydrating a component that was server rendered and was living inside a `<Suspense />` component. It would cause an hydration error and this was the workaround. With useSuspenseQuery and React 18, this problem will not occur. ([@StefanAngenent](https://github.com/StefanAngenent))
197
154
 
198
- - [#2004](https://github.com/graphcommerce-org/graphcommerce/pull/2004) [`d608830`](https://github.com/graphcommerce-org/graphcommerce/commit/d608830ce77f85ff725cc106b9fc55a22012c74c) - Added `disableBackdropClick` prop to MessageSnackbar to allow page interaction without closing the snackbar
199
- ([@bramvanderholst](https://github.com/bramvanderholst))
155
+ - [#2004](https://github.com/graphcommerce-org/graphcommerce/pull/2004) [`d608830`](https://github.com/graphcommerce-org/graphcommerce/commit/d608830ce77f85ff725cc106b9fc55a22012c74c) - Added `disableBackdropClick` prop to MessageSnackbar to allow page interaction without closing the snackbar ([@bramvanderholst](https://github.com/bramvanderholst))
200
156
 
201
- - [#2048](https://github.com/graphcommerce-org/graphcommerce/pull/2048) [`695f40c`](https://github.com/graphcommerce-org/graphcommerce/commit/695f40cf220636d17f04bc9b0ce86c549c740386) - The `filterNonNullable` method would collapse TypeScript unions because of the `Simplify<>` helper, this is now omitted retulting in working unions.
202
- ([@Jessevdpoel](https://github.com/Jessevdpoel))
157
+ - [#2048](https://github.com/graphcommerce-org/graphcommerce/pull/2048) [`695f40c`](https://github.com/graphcommerce-org/graphcommerce/commit/695f40cf220636d17f04bc9b0ce86c549c740386) - The `filterNonNullable` method would collapse TypeScript unions because of the `Simplify<>` helper, this is now omitted retulting in working unions. ([@Jessevdpoel](https://github.com/Jessevdpoel))
203
158
 
204
- - [#2066](https://github.com/graphcommerce-org/graphcommerce/pull/2066) [`3b1f585`](https://github.com/graphcommerce-org/graphcommerce/commit/3b1f585153672a644a613411134e5ad36aa4c266) - Add `showButtons` prop to `<ScrollerButton/>`
205
- ([@StefanAngenent](https://github.com/StefanAngenent))
159
+ - [#2066](https://github.com/graphcommerce-org/graphcommerce/pull/2066) [`3b1f585`](https://github.com/graphcommerce-org/graphcommerce/commit/3b1f585153672a644a613411134e5ad36aa4c266) - Add `showButtons` prop to `<ScrollerButton/>` ([@StefanAngenent](https://github.com/StefanAngenent))
206
160
 
207
- - [#2045](https://github.com/graphcommerce-org/graphcommerce/pull/2045) [`1ac1e09`](https://github.com/graphcommerce-org/graphcommerce/commit/1ac1e09897daadd646200cb3ddc2aa75a51e182e) - Make sure the product image gallery traps focus and scrollbar doesn't disappear suddenly
208
- ([@JoshuaS98](https://github.com/JoshuaS98))
161
+ - [#2045](https://github.com/graphcommerce-org/graphcommerce/pull/2045) [`1ac1e09`](https://github.com/graphcommerce-org/graphcommerce/commit/1ac1e09897daadd646200cb3ddc2aa75a51e182e) - Make sure the product image gallery traps focus and scrollbar doesn't disappear suddenly ([@JoshuaS98](https://github.com/JoshuaS98))
209
162
 
210
- - [#2105](https://github.com/graphcommerce-org/graphcommerce/pull/2105) [`185f9dd`](https://github.com/graphcommerce-org/graphcommerce/commit/185f9ddebff0eaf1f388faebe88a5d400294512a) - Fixed bug in Chrome where the mobile menu wouldn't open after the first selected level
211
- ([@mikekeehnen](https://github.com/mikekeehnen))
163
+ - [#2105](https://github.com/graphcommerce-org/graphcommerce/pull/2105) [`185f9dd`](https://github.com/graphcommerce-org/graphcommerce/commit/185f9ddebff0eaf1f388faebe88a5d400294512a) - Fixed bug in Chrome where the mobile menu wouldn't open after the first selected level ([@mikekeehnen](https://github.com/mikekeehnen))
212
164
 
213
- - [#2004](https://github.com/graphcommerce-org/graphcommerce/pull/2004) [`94e1ae8`](https://github.com/graphcommerce-org/graphcommerce/commit/94e1ae811fe9eb0051863e8be91c6399ddcdf22f) - Added `<DismissibleSnackbar/>` component to allow messages to be shown only once
214
- ([@bramvanderholst](https://github.com/bramvanderholst))
165
+ - [#2004](https://github.com/graphcommerce-org/graphcommerce/pull/2004) [`94e1ae8`](https://github.com/graphcommerce-org/graphcommerce/commit/94e1ae811fe9eb0051863e8be91c6399ddcdf22f) - Added `<DismissibleSnackbar/>` component to allow messages to be shown only once ([@bramvanderholst](https://github.com/bramvanderholst))
215
166
 
216
- - [#2137](https://github.com/graphcommerce-org/graphcommerce/pull/2137) [`df507b1`](https://github.com/graphcommerce-org/graphcommerce/commit/df507b194c67eef7b02df858c07938bb308b5397) - Don't render pseudo-locale in HTML lang attribute
217
- ([@hnsr](https://github.com/hnsr))
167
+ - [#2137](https://github.com/graphcommerce-org/graphcommerce/pull/2137) [`df507b1`](https://github.com/graphcommerce-org/graphcommerce/commit/df507b194c67eef7b02df858c07938bb308b5397) - Don't render pseudo-locale in HTML lang attribute ([@hnsr](https://github.com/hnsr))
218
168
 
219
- - [#2125](https://github.com/graphcommerce-org/graphcommerce/pull/2125) [`5224ee5`](https://github.com/graphcommerce-org/graphcommerce/commit/5224ee5001c94a19f226fa36106e76739319297c) - If there is an open menu in an overlay, pressing the escape button now closes the menu instead of the overlay.
220
- ([@Jessevdpoel](https://github.com/Jessevdpoel))
169
+ - [#2125](https://github.com/graphcommerce-org/graphcommerce/pull/2125) [`5224ee5`](https://github.com/graphcommerce-org/graphcommerce/commit/5224ee5001c94a19f226fa36106e76739319297c) - If there is an open menu in an overlay, pressing the escape button now closes the menu instead of the overlay. ([@Jessevdpoel](https://github.com/Jessevdpoel))
221
170
 
222
- - [#2004](https://github.com/graphcommerce-org/graphcommerce/pull/2004) [`53947d3`](https://github.com/graphcommerce-org/graphcommerce/commit/53947d39f2f3ee578c14903c96a2b356d99d9475) - Implemented 'Message' variant for `<RowColumnOne/>` to show an important message which, after dismissing, will not show again
223
- ([@bramvanderholst](https://github.com/bramvanderholst))
171
+ - [#2004](https://github.com/graphcommerce-org/graphcommerce/pull/2004) [`53947d3`](https://github.com/graphcommerce-org/graphcommerce/commit/53947d39f2f3ee578c14903c96a2b356d99d9475) - Implemented 'Message' variant for `<RowColumnOne/>` to show an important message which, after dismissing, will not show again ([@bramvanderholst](https://github.com/bramvanderholst))
224
172
 
225
- - [#2121](https://github.com/graphcommerce-org/graphcommerce/pull/2121) [`a5da6ff`](https://github.com/graphcommerce-org/graphcommerce/commit/a5da6ffc8be359e93c7bde986134f7162aae13b9) - Change the critical css injection location to be in the head instead of `<style>` tags in the body. It had a number of negative consequences, such as the famous "flash of unstyled content" (FOUC) and the re-paint and re-layout required.
226
- ([@paales](https://github.com/paales))
173
+ - [#2121](https://github.com/graphcommerce-org/graphcommerce/pull/2121) [`a5da6ff`](https://github.com/graphcommerce-org/graphcommerce/commit/a5da6ffc8be359e93c7bde986134f7162aae13b9) - Change the critical css injection location to be in the head instead of `<style>` tags in the body. It had a number of negative consequences, such as the famous "flash of unstyled content" (FOUC) and the re-paint and re-layout required. ([@paales](https://github.com/paales))
227
174
 
228
175
  ## 8.0.0-canary.100
229
176
 
@@ -261,8 +208,7 @@
261
208
 
262
209
  ### Patch Changes
263
210
 
264
- - [#2161](https://github.com/graphcommerce-org/graphcommerce/pull/2161) [`cc5c636`](https://github.com/graphcommerce-org/graphcommerce/commit/cc5c636f9f2b3d9fa33384b9a02d6ad3631aa414) - Removed whitespace on top of the zoomed in image on the PDP.
265
- ([@Jessevdpoel](https://github.com/Jessevdpoel))
211
+ - [#2161](https://github.com/graphcommerce-org/graphcommerce/pull/2161) [`cc5c636`](https://github.com/graphcommerce-org/graphcommerce/commit/cc5c636f9f2b3d9fa33384b9a02d6ad3631aa414) - Removed whitespace on top of the zoomed in image on the PDP. ([@Jessevdpoel](https://github.com/Jessevdpoel))
266
212
 
267
213
  ## 8.0.0-canary.83
268
214
 
@@ -274,29 +220,25 @@
274
220
 
275
221
  ### Patch Changes
276
222
 
277
- - [#2138](https://github.com/graphcommerce-org/graphcommerce/pull/2138) [`a057d62`](https://github.com/graphcommerce-org/graphcommerce/commit/a057d6274e1d427e631ab3fad7a16078315103b8) - Wrap the logo in a div on the homepage to prevent redirection.
278
- ([@carlocarels90](https://github.com/carlocarels90))
223
+ - [#2138](https://github.com/graphcommerce-org/graphcommerce/pull/2138) [`a057d62`](https://github.com/graphcommerce-org/graphcommerce/commit/a057d6274e1d427e631ab3fad7a16078315103b8) - Wrap the logo in a div on the homepage to prevent redirection. ([@carlocarels90](https://github.com/carlocarels90))
279
224
 
280
225
  ## 8.0.0-canary.79
281
226
 
282
227
  ### Patch Changes
283
228
 
284
- - [#2137](https://github.com/graphcommerce-org/graphcommerce/pull/2137) [`df507b1`](https://github.com/graphcommerce-org/graphcommerce/commit/df507b194c67eef7b02df858c07938bb308b5397) - Don't render pseudo-locale in HTML lang attribute
285
- ([@hnsr](https://github.com/hnsr))
229
+ - [#2137](https://github.com/graphcommerce-org/graphcommerce/pull/2137) [`df507b1`](https://github.com/graphcommerce-org/graphcommerce/commit/df507b194c67eef7b02df858c07938bb308b5397) - Don't render pseudo-locale in HTML lang attribute ([@hnsr](https://github.com/hnsr))
286
230
 
287
231
  ## 8.0.0-canary.78
288
232
 
289
233
  ### Patch Changes
290
234
 
291
- - [#2135](https://github.com/graphcommerce-org/graphcommerce/pull/2135) [`7b017f5`](https://github.com/graphcommerce-org/graphcommerce/commit/7b017f58ba3be587d20a7f52c84b2907d52fe201) - Fix incorrect canonical URLs when i18n domain routing is used
292
- ([@hnsr](https://github.com/hnsr))
235
+ - [#2135](https://github.com/graphcommerce-org/graphcommerce/pull/2135) [`7b017f5`](https://github.com/graphcommerce-org/graphcommerce/commit/7b017f58ba3be587d20a7f52c84b2907d52fe201) - Fix incorrect canonical URLs when i18n domain routing is used ([@hnsr](https://github.com/hnsr))
293
236
 
294
237
  ## 8.0.0-canary.77
295
238
 
296
239
  ### Patch Changes
297
240
 
298
- - [`e33660f`](https://github.com/graphcommerce-org/graphcommerce/commit/e33660f172466dcfa0ab7262cee612d9a3e47776) - a11y improvements (see https://github.com/graphcommerce-org/graphcommerce/issues/1995 for more info)
299
- ([@FrankHarland](https://github.com/FrankHarland))
241
+ - [`e33660f`](https://github.com/graphcommerce-org/graphcommerce/commit/e33660f172466dcfa0ab7262cee612d9a3e47776) - a11y improvements (see https://github.com/graphcommerce-org/graphcommerce/issues/1995 for more info) ([@FrankHarland](https://github.com/FrankHarland))
300
242
 
301
243
  ## 8.0.0-canary.76
302
244
 
@@ -306,8 +248,7 @@
306
248
 
307
249
  ### Minor Changes
308
250
 
309
- - [#2133](https://github.com/graphcommerce-org/graphcommerce/pull/2133) [`133f908`](https://github.com/graphcommerce-org/graphcommerce/commit/133f908200a79589036420f2925835724522cab8) - Added lazy hydration to improve total blocking time. Added LazyHydrate component which can be wrapped around other components you want to lazy hydrate.
310
- ([@Jessevdpoel](https://github.com/Jessevdpoel))
251
+ - [#2133](https://github.com/graphcommerce-org/graphcommerce/pull/2133) [`133f908`](https://github.com/graphcommerce-org/graphcommerce/commit/133f908200a79589036420f2925835724522cab8) - Added lazy hydration to improve total blocking time. Added LazyHydrate component which can be wrapped around other components you want to lazy hydrate. ([@Jessevdpoel](https://github.com/Jessevdpoel))
311
252
 
312
253
  ## 8.0.0-canary.73
313
254
 
@@ -325,8 +266,7 @@
325
266
 
326
267
  ### Patch Changes
327
268
 
328
- - [#2108](https://github.com/graphcommerce-org/graphcommerce/pull/2108) [`7fc4bb9`](https://github.com/graphcommerce-org/graphcommerce/commit/7fc4bb925c59da46961c9656a2a67b37a9c2d652) - Removed the 'NoSSR' functionality from `<WaitForQueries/>` component as it slows down rendering. The 'feature' was necessary for the following use case: When hydrating a component that was server rendered and was living inside a `<Suspense />` component. It would cause an hydration error and this was the workaround. With useSuspenseQuery and React 18, this problem will not occur.
329
- ([@StefanAngenent](https://github.com/StefanAngenent))
269
+ - [#2108](https://github.com/graphcommerce-org/graphcommerce/pull/2108) [`7fc4bb9`](https://github.com/graphcommerce-org/graphcommerce/commit/7fc4bb925c59da46961c9656a2a67b37a9c2d652) - Removed the 'NoSSR' functionality from `<WaitForQueries/>` component as it slows down rendering. The 'feature' was necessary for the following use case: When hydrating a component that was server rendered and was living inside a `<Suspense />` component. It would cause an hydration error and this was the workaround. With useSuspenseQuery and React 18, this problem will not occur. ([@StefanAngenent](https://github.com/StefanAngenent))
330
270
 
331
271
  ## 7.1.0-canary.66
332
272
 
@@ -1906,31 +1846,31 @@
1906
1846
  All occurences of `<Trans>` and `t` need to be replaced:
1907
1847
 
1908
1848
  ```tsx
1909
- import { Trans, t } from "@lingui/macro";
1849
+ import { Trans, t } from '@lingui/macro'
1910
1850
 
1911
1851
  function MyComponent() {
1912
- const foo = "bar";
1852
+ const foo = 'bar'
1913
1853
  return (
1914
1854
  <div aria-label={t`Account ${foo}`}>
1915
1855
  <Trans>My Translation {foo}</Trans>
1916
1856
  </div>
1917
- );
1857
+ )
1918
1858
  }
1919
1859
  ```
1920
1860
 
1921
1861
  Needs to be replaced with:
1922
1862
 
1923
1863
  ```tsx
1924
- import { Trans } from "@lingui/react";
1925
- import { i18n } from "@lingui/core";
1864
+ import { Trans } from '@lingui/react'
1865
+ import { i18n } from '@lingui/core'
1926
1866
 
1927
1867
  function MyComponent() {
1928
- const foo = "bar";
1868
+ const foo = 'bar'
1929
1869
  return (
1930
1870
  <div aria-label={i18n._(/* i18n */ `Account {foo}`, { foo })}>
1931
- <Trans key="My Translation {foo}" values={{ foo }}></Trans>
1871
+ <Trans key='My Translation {foo}' values={{ foo }}></Trans>
1932
1872
  </div>
1933
- );
1873
+ )
1934
1874
  }
1935
1875
  ```
1936
1876
 
@@ -1,23 +1,17 @@
1
- import { useLocale } from '../hooks/useLocale'
2
-
3
1
  export type TimeAgoProps = {
4
2
  date: Date
5
- /**
6
- * @deprecated No longer used
7
- */
8
3
  locale?: string
9
4
  }
10
5
 
11
6
  export function TimeAgo(props: TimeAgoProps) {
12
- const { date } = props
7
+ const { date, locale = 'en' } = props
13
8
  const msPerMinute = 60 * 1000
14
9
  const msPerHour = msPerMinute * 60
15
10
  const msPerDay = msPerHour * 24
16
11
 
17
12
  const timestamp = date.getTime()
18
13
  const elapsed = Date.now() - timestamp
19
-
20
- const rtf = new Intl.RelativeTimeFormat(useLocale(), { numeric: 'auto' })
14
+ const rtf = new Intl.RelativeTimeFormat(locale, { numeric: 'auto' })
21
15
 
22
16
  if (elapsed < msPerMinute) {
23
17
  return <span>{rtf.format(-Math.floor(elapsed / 1000), 'seconds')}</span>
package/hooks/index.ts CHANGED
@@ -5,5 +5,3 @@ export * from './useNumberFormat'
5
5
  export * from './useMemoObject'
6
6
  export * from './useStorefrontConfig'
7
7
  export * from './useUrlQuery'
8
- export * from './useSsr'
9
- export * from './useLocale'
@@ -1,13 +1,15 @@
1
1
  import { normalizeLocale } from '@graphcommerce/lingui-next'
2
+ import { useRouter } from 'next/router'
2
3
  import { useMemo } from 'react'
3
- import { useStorefrontConfig } from './useStorefrontConfig'
4
- import { useLocale } from '@graphcommerce/next-ui'
5
4
 
6
5
  export type DateTimeFormatProps = Intl.DateTimeFormatOptions
7
6
 
8
7
  export function useDateTimeFormat(props?: DateTimeFormatProps) {
9
- const locale = useLocale()
8
+ const { locale } = useRouter()
10
9
 
11
- const formatter = useMemo(() => new Intl.DateTimeFormat(locale, props), [locale, props])
10
+ const formatter = useMemo(
11
+ () => new Intl.DateTimeFormat(normalizeLocale(locale), props),
12
+ [locale, props],
13
+ )
12
14
  return formatter
13
15
  }
@@ -1,10 +1,15 @@
1
+ import { normalizeLocale } from '@graphcommerce/lingui-next'
2
+ import { useRouter } from 'next/router'
1
3
  import { useMemo } from 'react'
2
- import { useLocale } from './useLocale'
3
4
 
4
5
  export type NumberFormatProps = Intl.NumberFormatOptions
5
6
 
6
7
  export function useNumberFormat(props?: NumberFormatProps) {
7
- const locale = useLocale()
8
- const formatter = useMemo(() => new Intl.NumberFormat(locale, props), [locale, props])
8
+ const { locale } = useRouter()
9
+
10
+ const formatter = useMemo(
11
+ () => new Intl.NumberFormat(normalizeLocale(locale), props),
12
+ [locale, props],
13
+ )
9
14
  return formatter
10
15
  }
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": "8.0.6-canary.4",
5
+ "version": "8.0.7",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -25,14 +25,14 @@
25
25
  "typescript": "5.3.3"
26
26
  },
27
27
  "peerDependencies": {
28
- "@graphcommerce/eslint-config-pwa": "^8.0.6-canary.4",
29
- "@graphcommerce/framer-next-pages": "^8.0.6-canary.4",
30
- "@graphcommerce/framer-scroller": "^8.0.6-canary.4",
31
- "@graphcommerce/framer-utils": "^8.0.6-canary.4",
32
- "@graphcommerce/image": "^8.0.6-canary.4",
33
- "@graphcommerce/lingui-next": "^8.0.6-canary.4",
34
- "@graphcommerce/prettier-config-pwa": "^8.0.6-canary.4",
35
- "@graphcommerce/typescript-config-pwa": "^8.0.6-canary.4",
28
+ "@graphcommerce/eslint-config-pwa": "^8.0.7",
29
+ "@graphcommerce/framer-next-pages": "^8.0.7",
30
+ "@graphcommerce/framer-scroller": "^8.0.7",
31
+ "@graphcommerce/framer-utils": "^8.0.7",
32
+ "@graphcommerce/image": "^8.0.7",
33
+ "@graphcommerce/lingui-next": "^8.0.7",
34
+ "@graphcommerce/prettier-config-pwa": "^8.0.7",
35
+ "@graphcommerce/typescript-config-pwa": "^8.0.7",
36
36
  "@lingui/core": "^4.2.1",
37
37
  "@lingui/macro": "^4.2.1",
38
38
  "@lingui/react": "^4.2.1",
@@ -1,7 +0,0 @@
1
- import { normalizeLocale } from '@graphcommerce/lingui-next'
2
- import { useStorefrontConfig } from './useStorefrontConfig'
3
-
4
- export function useLocale() {
5
- const { locale } = useStorefrontConfig()
6
- return normalizeLocale(locale)
7
- }
package/hooks/useSsr.ts DELETED
@@ -1,11 +0,0 @@
1
- import { useSyncExternalStore } from 'react'
2
-
3
- const emptySubscribe = () => () => {}
4
-
5
- export function useIsSSR() {
6
- return useSyncExternalStore(
7
- emptySubscribe,
8
- () => false,
9
- () => true,
10
- )
11
- }