@workos-inc/widgets 1.1.1 → 1.1.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.
@@ -251,35 +251,75 @@ export interface VerifyTotpFactorRequest {
251
251
  authenticationChallengeId: string;
252
252
  }
253
253
 
254
- export interface MfaVerificationMethod {
254
+ export type AuthenticationInformationResponseDataVerificationMethodsMfaProvider =
255
+ (typeof AuthenticationInformationResponseDataVerificationMethodsMfaProvider)[keyof typeof AuthenticationInformationResponseDataVerificationMethodsMfaProvider];
256
+
257
+ export const AuthenticationInformationResponseDataVerificationMethodsMfaProvider =
258
+ {
259
+ MFA: "MFA",
260
+ } as const;
261
+
262
+ /**
263
+ * @nullable
264
+ */
265
+ export type AuthenticationInformationResponseDataVerificationMethodsMfa = {
266
+ provider: AuthenticationInformationResponseDataVerificationMethodsMfaProvider;
255
267
  isSetUp: boolean;
256
268
  /** @nullable */
257
269
  lastUsed?: string | null;
258
- }
270
+ } | null;
259
271
 
260
- export interface PasswordVerificationMethod {
272
+ export type AuthenticationInformationResponseDataVerificationMethodsPasswordProvider =
273
+ (typeof AuthenticationInformationResponseDataVerificationMethodsPasswordProvider)[keyof typeof AuthenticationInformationResponseDataVerificationMethodsPasswordProvider];
274
+
275
+ export const AuthenticationInformationResponseDataVerificationMethodsPasswordProvider =
276
+ {
277
+ Password: "Password",
278
+ } as const;
279
+
280
+ /**
281
+ * @nullable
282
+ */
283
+ export type AuthenticationInformationResponseDataVerificationMethodsPassword = {
284
+ provider: AuthenticationInformationResponseDataVerificationMethodsPasswordProvider;
261
285
  isSetUp: boolean;
262
286
  /** @nullable */
263
287
  lastUsed?: string | null;
264
288
  isCurrentSession: boolean;
265
- }
289
+ } | null;
266
290
 
267
- export type PasskeyVerificationMethodPassKeysItem = {
268
- id: string;
269
- };
291
+ export type AuthenticationInformationResponseDataVerificationMethodsPasskeyProvider =
292
+ (typeof AuthenticationInformationResponseDataVerificationMethodsPasskeyProvider)[keyof typeof AuthenticationInformationResponseDataVerificationMethodsPasskeyProvider];
270
293
 
271
- export interface PasskeyVerificationMethod {
294
+ export const AuthenticationInformationResponseDataVerificationMethodsPasskeyProvider =
295
+ {
296
+ Passkey: "Passkey",
297
+ } as const;
298
+
299
+ export type AuthenticationInformationResponseDataVerificationMethodsPasskeyPassKeysItem =
300
+ {
301
+ id: string;
302
+ };
303
+
304
+ /**
305
+ * @nullable
306
+ */
307
+ export type AuthenticationInformationResponseDataVerificationMethodsPasskey = {
308
+ provider: AuthenticationInformationResponseDataVerificationMethodsPasskeyProvider;
272
309
  isSetUp: boolean;
273
310
  /** @nullable */
274
311
  lastUsed?: string | null;
312
+ passKeys: AuthenticationInformationResponseDataVerificationMethodsPasskeyPassKeysItem[];
275
313
  isCurrentSession: boolean;
276
- passKeys: PasskeyVerificationMethodPassKeysItem[];
277
- }
314
+ } | null;
278
315
 
279
316
  export type AuthenticationInformationResponseDataVerificationMethods = {
280
- Mfa?: MfaVerificationMethod;
281
- Password?: PasswordVerificationMethod;
282
- Passkey?: PasskeyVerificationMethod;
317
+ /** @nullable */
318
+ Mfa?: AuthenticationInformationResponseDataVerificationMethodsMfa;
319
+ /** @nullable */
320
+ Password?: AuthenticationInformationResponseDataVerificationMethodsPassword;
321
+ /** @nullable */
322
+ Passkey?: AuthenticationInformationResponseDataVerificationMethodsPasskey;
283
323
  };
284
324
 
285
325
  export type AuthenticationInformationResponseDataPasswordSettings = {
package/src/index.ts CHANGED
@@ -2,6 +2,7 @@ export {
2
2
  WorkOsWidgets,
3
3
  type WorkOsWidgetsProps,
4
4
  } from "./workos-widgets.client";
5
+ export { OrganizationSwitcher } from "./organization-switcher.client";
5
6
  export { UserProfile } from "./user-profile.client";
6
7
  export { UserSecurity } from "./user-security.client";
7
8
  export { UserSessions } from "./user-sessions.client";
@@ -126,20 +126,9 @@ export function UserProfileLoading() {
126
126
  <DataList.Root>
127
127
  <DataList.Item align="center">
128
128
  <DataList.Label minWidth="220px" highContrast>
129
- <Strong>Profile picture</Strong>
130
- </DataList.Label>
131
- <DataList.Value>
132
- <Skeleton>
133
- <Avatar size="2" fallback={<FallbackUserIcon />} />
134
- </Skeleton>
135
- </DataList.Value>
136
- </DataList.Item>
137
-
138
- <ListSeparator />
139
-
140
- <DataList.Item align="center">
141
- <DataList.Label highContrast>
142
- <Strong>Full name</Strong>
129
+ <Strong>
130
+ <Skeleton>Full name</Skeleton>
131
+ </Strong>
143
132
  </DataList.Label>
144
133
  <DataList.Value>
145
134
  <Flex
@@ -159,7 +148,9 @@ export function UserProfileLoading() {
159
148
 
160
149
  <DataList.Item align="center">
161
150
  <DataList.Label highContrast>
162
- <Strong>Email address</Strong>
151
+ <Strong>
152
+ <Skeleton>Email address</Skeleton>
153
+ </Strong>
163
154
  </DataList.Label>
164
155
  <DataList.Value>
165
156
  <Flex align="center" minHeight="var(--space-6)">
@@ -169,17 +160,6 @@ export function UserProfileLoading() {
169
160
  </Flex>
170
161
  </DataList.Value>
171
162
  </DataList.Item>
172
-
173
- <ListSeparator />
174
-
175
- <DataList.Item>
176
- <DataList.Label highContrast>
177
- <Strong>Connected accounts</Strong>
178
- </DataList.Label>
179
- <DataList.Value>
180
- <Skeleton>Connected accounts</Skeleton>
181
- </DataList.Value>
182
- </DataList.Item>
183
163
  </DataList.Root>
184
164
  </Card>
185
165
  );
@@ -10,8 +10,8 @@ import { ChangePasswordDialog } from "./change-password-dialog";
10
10
  import { AddMfaDialog } from "./add-mfa-dialog";
11
11
  import type {
12
12
  AuthenticationInformationResponseData as AuthenticationSettings,
13
- PasswordVerificationMethod,
14
- MfaVerificationMethod,
13
+ AuthenticationInformationResponseDataVerificationMethodsPassword as PasswordVerificationMethod,
14
+ AuthenticationInformationResponseDataVerificationMethodsMfa as MfaVerificationMethod,
15
15
  } from "../api";
16
16
  import { ResetMfaDialog } from "./reset-mfa-dialog";
17
17
  import * as CardList from "../card-list";
@@ -87,7 +87,7 @@ export function UserSecurityLoading() {
87
87
  function PasswordSettings({
88
88
  settings,
89
89
  }: {
90
- settings: PasswordVerificationMethod;
90
+ settings: NonNullable<PasswordVerificationMethod>;
91
91
  }) {
92
92
  return (
93
93
  <Grid columns="auto 1fr auto" align="center" gap="4">
@@ -134,7 +134,7 @@ function MfaSettings({
134
134
  settings,
135
135
  isPasswordSet,
136
136
  }: {
137
- settings: MfaVerificationMethod;
137
+ settings: NonNullable<MfaVerificationMethod>;
138
138
  isPasswordSet: boolean;
139
139
  }) {
140
140
  return (
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 WorkOS
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.