@better-auth-ui/heroui 1.6.11 → 1.6.13
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/dist/index.js +329 -2038
- package/package.json +9 -8
- package/src/components/auth/additional-field.tsx +2 -1
- package/src/components/auth/error-toaster.tsx +35 -18
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-auth-ui/heroui",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "vite build",
|
|
@@ -12,22 +12,22 @@
|
|
|
12
12
|
],
|
|
13
13
|
"exports": {
|
|
14
14
|
".": {
|
|
15
|
-
"
|
|
15
|
+
"src": "./src/index.tsx",
|
|
16
16
|
"types": "./dist/index.d.ts",
|
|
17
17
|
"import": "./dist/index.js"
|
|
18
18
|
},
|
|
19
19
|
"./email": {
|
|
20
|
-
"
|
|
20
|
+
"src": "./src/email.ts",
|
|
21
21
|
"types": "./dist/email.d.ts",
|
|
22
22
|
"import": "./dist/email.js"
|
|
23
23
|
},
|
|
24
24
|
"./plugins": {
|
|
25
|
-
"
|
|
25
|
+
"src": "./src/plugins.ts",
|
|
26
26
|
"types": "./dist/plugins.d.ts",
|
|
27
27
|
"import": "./dist/plugins.js"
|
|
28
28
|
},
|
|
29
29
|
"./styles": {
|
|
30
|
-
"
|
|
30
|
+
"src": "./src/styles.css",
|
|
31
31
|
"default": "./dist/styles.css"
|
|
32
32
|
}
|
|
33
33
|
},
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@gravity-ui/icons": "^2.18.0",
|
|
36
36
|
"@heroui/react": "^3.1.0",
|
|
37
37
|
"@heroui/styles": "^3.1.0",
|
|
38
|
-
"@internationalized/date": "^3.12.
|
|
38
|
+
"@internationalized/date": "^3.12.2",
|
|
39
39
|
"@tanstack/react-pacer": "^0.22.1",
|
|
40
40
|
"@tanstack/react-query": "^5.100.14",
|
|
41
41
|
"@testing-library/react": "^16.3.2",
|
|
@@ -56,12 +56,13 @@
|
|
|
56
56
|
"@gravity-ui/icons": ">=2.18.0",
|
|
57
57
|
"@heroui/react": ">=3.1.0",
|
|
58
58
|
"@heroui/styles": ">=3.1.0",
|
|
59
|
-
"@internationalized/date": ">=3.12.
|
|
59
|
+
"@internationalized/date": ">=3.12.2",
|
|
60
60
|
"@tanstack/react-pacer": ">=0.22.1",
|
|
61
61
|
"@tanstack/react-query": ">=5.100.14",
|
|
62
62
|
"better-auth": ">=1.6.11",
|
|
63
63
|
"react": ">=19.2.6",
|
|
64
|
-
"react-dom": ">=19.2.6"
|
|
64
|
+
"react-dom": ">=19.2.6",
|
|
65
|
+
"bowser": ">=2.11.0"
|
|
65
66
|
},
|
|
66
67
|
"repository": {
|
|
67
68
|
"type": "git",
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
ComboBox,
|
|
9
9
|
DateField,
|
|
10
10
|
DatePicker,
|
|
11
|
+
type DateValue,
|
|
11
12
|
FieldError,
|
|
12
13
|
Input,
|
|
13
14
|
InputGroup,
|
|
@@ -387,7 +388,7 @@ export function AdditionalField({
|
|
|
387
388
|
<DatePicker
|
|
388
389
|
className="w-full [&[data-required=true]>.label]:after:content-none"
|
|
389
390
|
name={name}
|
|
390
|
-
defaultValue={defaultValue}
|
|
391
|
+
defaultValue={defaultValue as unknown as DateValue}
|
|
391
392
|
granularity={isDateTime ? "minute" : "day"}
|
|
392
393
|
isDisabled={isPending}
|
|
393
394
|
isReadOnly={field.readOnly}
|
|
@@ -12,30 +12,47 @@ export function ErrorToaster() {
|
|
|
12
12
|
const queryClient = useQueryClient()
|
|
13
13
|
|
|
14
14
|
useEffect(() => {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
if (!matchQuery({ queryKey: authQueryKeys.all }, event.query)) return
|
|
15
|
+
const queryCache = queryClient.getQueryCache()
|
|
16
|
+
const previousQueryOnError = queryCache.config.onError
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
queryCache.config.onError = (error, query) => {
|
|
19
|
+
previousQueryOnError?.(error, query)
|
|
20
|
+
|
|
21
|
+
if (!matchQuery({ queryKey: authQueryKeys.all }, query)) return
|
|
22
|
+
|
|
23
|
+
const err = error as BetterFetchError
|
|
20
24
|
if (err?.error) toast.danger(err.error.message)
|
|
21
|
-
}
|
|
25
|
+
}
|
|
22
26
|
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
.subscribe((event) => {
|
|
26
|
-
if (event.type !== "updated" || event.action.type !== "error") return
|
|
27
|
-
if (
|
|
28
|
-
!matchMutation({ mutationKey: authMutationKeys.all }, event.mutation)
|
|
29
|
-
)
|
|
30
|
-
return
|
|
27
|
+
const mutationCache = queryClient.getMutationCache()
|
|
28
|
+
const previousMutationOnError = mutationCache.config.onError
|
|
31
29
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
mutationCache.config.onError = (
|
|
31
|
+
error,
|
|
32
|
+
variables,
|
|
33
|
+
onMutateResult,
|
|
34
|
+
mutation,
|
|
35
|
+
context
|
|
36
|
+
) => {
|
|
37
|
+
previousMutationOnError?.(
|
|
38
|
+
error,
|
|
39
|
+
variables,
|
|
40
|
+
onMutateResult,
|
|
41
|
+
mutation,
|
|
42
|
+
context
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
if (!matchMutation({ mutationKey: authMutationKeys.all }, mutation)) {
|
|
46
|
+
return
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const err = error as BetterFetchError
|
|
50
|
+
toast.danger(err.error?.message || err.message)
|
|
51
|
+
}
|
|
35
52
|
|
|
36
53
|
return () => {
|
|
37
|
-
|
|
38
|
-
|
|
54
|
+
queryCache.config.onError = previousQueryOnError
|
|
55
|
+
mutationCache.config.onError = previousMutationOnError
|
|
39
56
|
}
|
|
40
57
|
}, [queryClient])
|
|
41
58
|
|