dauth-context-react 6.4.0 → 6.5.0
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.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/index.tsx +6 -0
- package/src/initialDauthState.ts +1 -0
- package/src/interfaces.ts +3 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React$1 from 'react';
|
|
2
2
|
|
|
3
|
+
type ThemeMode = 'dark' | 'light' | 'system';
|
|
3
4
|
interface IDauthUser {
|
|
4
5
|
_id: string;
|
|
5
6
|
name: string;
|
|
@@ -8,6 +9,7 @@ interface IDauthUser {
|
|
|
8
9
|
email: string;
|
|
9
10
|
isVerified: boolean;
|
|
10
11
|
language: string;
|
|
12
|
+
theme: ThemeMode;
|
|
11
13
|
avatar: {
|
|
12
14
|
id: string;
|
|
13
15
|
url: string;
|
|
@@ -105,4 +107,4 @@ declare function DauthProfileModal({ open, onClose, onAvatarUpload, }: DauthProf
|
|
|
105
107
|
declare const DauthProvider: React$1.FC<IDauthProviderProps>;
|
|
106
108
|
declare const useDauth: () => IDauthState;
|
|
107
109
|
|
|
108
|
-
export { DauthProfileModal, type DauthProfileModalProps, DauthProvider, type ICustomField, type IDauthAuthMethods, type IDauthProviderProps, type IFormField, type IModalTheme, type IPasskeyCredential, useDauth };
|
|
110
|
+
export { DauthProfileModal, type DauthProfileModalProps, DauthProvider, type ICustomField, type IDauthAuthMethods, type IDauthProviderProps, type IFormField, type IModalTheme, type IPasskeyCredential, type ThemeMode, useDauth };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React$1 from 'react';
|
|
2
2
|
|
|
3
|
+
type ThemeMode = 'dark' | 'light' | 'system';
|
|
3
4
|
interface IDauthUser {
|
|
4
5
|
_id: string;
|
|
5
6
|
name: string;
|
|
@@ -8,6 +9,7 @@ interface IDauthUser {
|
|
|
8
9
|
email: string;
|
|
9
10
|
isVerified: boolean;
|
|
10
11
|
language: string;
|
|
12
|
+
theme: ThemeMode;
|
|
11
13
|
avatar: {
|
|
12
14
|
id: string;
|
|
13
15
|
url: string;
|
|
@@ -105,4 +107,4 @@ declare function DauthProfileModal({ open, onClose, onAvatarUpload, }: DauthProf
|
|
|
105
107
|
declare const DauthProvider: React$1.FC<IDauthProviderProps>;
|
|
106
108
|
declare const useDauth: () => IDauthState;
|
|
107
109
|
|
|
108
|
-
export { DauthProfileModal, type DauthProfileModalProps, DauthProvider, type ICustomField, type IDauthAuthMethods, type IDauthProviderProps, type IFormField, type IModalTheme, type IPasskeyCredential, useDauth };
|
|
110
|
+
export { DauthProfileModal, type DauthProfileModalProps, DauthProvider, type ICustomField, type IDauthAuthMethods, type IDauthProviderProps, type IFormField, type IModalTheme, type IPasskeyCredential, type ThemeMode, useDauth };
|
package/dist/index.js
CHANGED
|
@@ -30,7 +30,8 @@ var import_react2 = require("react");
|
|
|
30
30
|
// src/initialDauthState.ts
|
|
31
31
|
var initialDauthState = {
|
|
32
32
|
user: {
|
|
33
|
-
language: (typeof window !== "undefined" ? window.document.documentElement.getAttribute("lang") : null) || "es"
|
|
33
|
+
language: (typeof window !== "undefined" ? window.document.documentElement.getAttribute("lang") : null) || "es",
|
|
34
|
+
theme: "system"
|
|
34
35
|
},
|
|
35
36
|
domain: {},
|
|
36
37
|
isLoading: true,
|
|
@@ -2229,10 +2230,12 @@ var DauthProvider = (props) => {
|
|
|
2229
2230
|
telPrefix,
|
|
2230
2231
|
telSuffix,
|
|
2231
2232
|
language,
|
|
2233
|
+
theme,
|
|
2232
2234
|
avatar,
|
|
2233
2235
|
birthDate,
|
|
2234
2236
|
country,
|
|
2235
|
-
metadata
|
|
2237
|
+
metadata,
|
|
2238
|
+
customFields
|
|
2236
2239
|
} = fields;
|
|
2237
2240
|
const user = {
|
|
2238
2241
|
name,
|
|
@@ -2241,10 +2244,12 @@ var DauthProvider = (props) => {
|
|
|
2241
2244
|
telPrefix,
|
|
2242
2245
|
telSuffix,
|
|
2243
2246
|
language,
|
|
2247
|
+
theme,
|
|
2244
2248
|
avatar,
|
|
2245
2249
|
birthDate,
|
|
2246
2250
|
country,
|
|
2247
|
-
metadata
|
|
2251
|
+
metadata,
|
|
2252
|
+
customFields
|
|
2248
2253
|
};
|
|
2249
2254
|
return updateUserAction(ctx, user);
|
|
2250
2255
|
},
|