@graphcommerce/next-ui 8.0.6-canary.0 → 8.0.6-canary.2
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/ActionCard/ActionCardListForm.tsx +41 -33
- package/CHANGELOG.md +12 -0
- package/hooks/index.ts +1 -0
- package/hooks/useSsr.ts +11 -0
- package/package.json +9 -9
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Controller,
|
|
4
|
+
ControllerProps,
|
|
5
|
+
FieldValues,
|
|
6
|
+
useController,
|
|
7
|
+
} from '@graphcommerce/react-hook-form'
|
|
3
8
|
import React, { MouseEventHandler } from 'react'
|
|
4
9
|
import { ActionCardProps } from './ActionCard'
|
|
5
10
|
import { ActionCardList, ActionCardListProps } from './ActionCardList'
|
|
@@ -43,38 +48,41 @@ export function ActionCardListForm<
|
|
|
43
48
|
: selectValues === itemValue
|
|
44
49
|
}
|
|
45
50
|
|
|
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
|
+
|
|
46
63
|
return (
|
|
47
|
-
<
|
|
48
|
-
{...
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
onReset={(e) => {
|
|
71
|
-
e.preventDefault()
|
|
72
|
-
onChange(null)
|
|
73
|
-
}}
|
|
74
|
-
/>
|
|
75
|
-
))}
|
|
76
|
-
</ActionCardList>
|
|
77
|
-
)}
|
|
78
|
-
/>
|
|
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>
|
|
79
87
|
)
|
|
80
88
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 8.0.6-canary.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#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.
|
|
8
|
+
([@FrankHarland](https://github.com/FrankHarland))
|
|
9
|
+
|
|
10
|
+
- [#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
|
|
11
|
+
([@FrankHarland](https://github.com/FrankHarland))
|
|
12
|
+
|
|
13
|
+
## 8.0.6-canary.1
|
|
14
|
+
|
|
3
15
|
## 8.0.6-canary.0
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/hooks/index.ts
CHANGED
package/hooks/useSsr.ts
ADDED
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.
|
|
5
|
+
"version": "8.0.6-canary.2",
|
|
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.
|
|
29
|
-
"@graphcommerce/framer-next-pages": "^8.0.6-canary.
|
|
30
|
-
"@graphcommerce/framer-scroller": "^8.0.6-canary.
|
|
31
|
-
"@graphcommerce/framer-utils": "^8.0.6-canary.
|
|
32
|
-
"@graphcommerce/image": "^8.0.6-canary.
|
|
33
|
-
"@graphcommerce/lingui-next": "^8.0.6-canary.
|
|
34
|
-
"@graphcommerce/prettier-config-pwa": "^8.0.6-canary.
|
|
35
|
-
"@graphcommerce/typescript-config-pwa": "^8.0.6-canary.
|
|
28
|
+
"@graphcommerce/eslint-config-pwa": "^8.0.6-canary.2",
|
|
29
|
+
"@graphcommerce/framer-next-pages": "^8.0.6-canary.2",
|
|
30
|
+
"@graphcommerce/framer-scroller": "^8.0.6-canary.2",
|
|
31
|
+
"@graphcommerce/framer-utils": "^8.0.6-canary.2",
|
|
32
|
+
"@graphcommerce/image": "^8.0.6-canary.2",
|
|
33
|
+
"@graphcommerce/lingui-next": "^8.0.6-canary.2",
|
|
34
|
+
"@graphcommerce/prettier-config-pwa": "^8.0.6-canary.2",
|
|
35
|
+
"@graphcommerce/typescript-config-pwa": "^8.0.6-canary.2",
|
|
36
36
|
"@lingui/core": "^4.2.1",
|
|
37
37
|
"@lingui/macro": "^4.2.1",
|
|
38
38
|
"@lingui/react": "^4.2.1",
|