@happyvertical/smrt-users 0.60.16 → 0.60.17
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/chunks/{TerminalAuthService-CKw_Aoy1.js → TerminalAuthService-lE2aS7C_.js} +2 -2
- package/dist/chunks/{TerminalAuthService-CKw_Aoy1.js.map → TerminalAuthService-lE2aS7C_.js.map} +1 -1
- package/dist/index.js +3 -3
- package/dist/manifest.json +1 -1
- package/dist/smrt-knowledge.json +3 -3
- package/dist/svelte/components/AccountSecurityPanel.svelte +55 -2
- package/dist/svelte/components/InviteUserModal.svelte +36 -33
- package/dist/svelte/components/MagicLinkForm.svelte +36 -2
- package/dist/svelte/components/OidcProviderButtons.svelte +25 -2
- package/dist/svelte/components/PasskeySignInButton.svelte +15 -2
- package/dist/svelte/components/SignInForm.svelte +30 -2
- package/dist/svelte/components/SignUpForm.svelte +30 -2
- package/dist/svelte/components/UserAvatar.svelte +29 -23
- package/dist/svelte/components/UserCard.svelte +68 -68
- package/dist/svelte/components/UserForm.svelte +19 -19
- package/dist/svelte/components/UserList.svelte +22 -17
- package/dist/svelte/components/UserMenu.svelte +90 -89
- package/dist/sveltekit.js +1 -1
- package/package.json +12 -12
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $ as PermissionCatalogService, A as InvalidCredentialsError, At as STEP_UP_SIGN_IN_AUTH_METHODS, B as backfillUserEmailKeys, C as DEFAULT_LOGIN_ATTEMPT_WINDOW_SECONDS, Ct as SessionCollection, D as DEFAULT_LOGIN_MAX_ATTEMPTS, E as DEFAULT_LOGIN_LOCKOUT_MAX_SECONDS, Et as normalizeEmail, F as OidcProvisioningError, Ft as Membership, G as MAX_TENANT_HIERARCHY_DEPTH, H as TenantPermissionOverride, I as UserCollection, J as assertTenantTableName, K as TenantHierarchyError, L as requireExistingOwnedPerson, M as LoginRateLimitError, Mt as generateSessionId, Nt as Role, O as DEFAULT_SOURCE_LOCKOUT_AUDIT_SECONDS, Ot as DEFAULT_SESSION_TTL, Pt as Permission, Q as RolePermissionCollection, S as normalizeAncestorReadPolicy, St as UsersLoginAttempt, T as DEFAULT_LOGIN_LOCKOUT_FACTOR, Tt as isValidEmail, U as TenantCollection, V as TenantPermissionOverrideCollection, W as Tenant, X as recordTenantHierarchyChanges, Y as planTenantHierarchy, Z as DEFAULT_ROLE_PERMISSION_PATTERNS, _ as PermissionResolver, _t as GroupCollection, a as DEFAULT_PASSWORD_RECOVERY_MAX_AGE_SECONDS, at as RolePermission, b as getConfiguredAncestorReadPolicy, bt as UsersLoginAuditEvent, c as PASSWORD_PERMISSION_DEFINITIONS, ct as UsersPasswordCredentialCollection, d as PasswordCredentialForbiddenError, dt as MembershipOverride, et as deriveOperationPermissionCollectionName, f as PasswordCredentialService, ft as MembershipCollection, g as SessionService, gt as GroupMember, h as outOfBandProofSessionData, ht as GroupMemberCollection, i as DEFAULT_PASSWORD_MIN_LENGTH, it as withoutListBounds, j as LoginAttemptLimiter, jt as Session, k as DurableLoginAuditSink, kt as SESSION_DATA_KEYS, l as PASSWORD_RECOVERY_MAX_AGE_CEILING_SECONDS, lt as UsersPasswordCredential, m as ensurePasswordPermissionsRegistered, mt as GroupRole, n as DEFAULT_PASSWORD_MANAGE_PERMISSION, nt as normalizeOperationPermissionAction, o as PASSWORD_LOGIN_KIND, ot as RoleCollection, p as PasswordPolicyError, pt as GroupRoleCollection, q as applyTenantHierarchyUpdates, r as DEFAULT_PASSWORD_MAX_LENGTH, rt as syncPermissionCatalog, s as PASSWORD_MAX_LENGTH_CEILING, st as PermissionCollection, t as DEFAULT_PASSWORD_DENYLIST, tt as deriveOperationPermissionSlug, u as PasswordCredentialError, ut as MembershipOverrideCollection, v as ANCESTOR_READ_ACTION, vt as Group, w as DEFAULT_LOGIN_LOCKOUT_BASE_SECONDS, wt as User, x as isAncestorReadableSlug, xt as UsersLoginAttemptCollection, y as DEFAULT_ANCESTOR_READ_MAX_DEPTH, yt as UsersLoginAuditEventCollection, z as UserEmailKeyBackfillError } from "./chunks/PasswordCredentialService-D_evcc-I.js";
|
|
2
|
-
import { $ as PIN_PERMISSION_DEFINITIONS, A as hasOperationPermission, B as OidcLoginService, C as PasskeyCredentialService, D as OperationPermissionError, E as ensurePasskeyPermissionsRegistered, F as MobileAuthError, H as encodeOidcTransaction, I as MobileAuthService, J as DeviceCredentialError, K as DEFAULT_DEVICE_PERSON_IDLE_SECONDS, L as readMobileBearerToken, M as getRequestScopedDatabase, N as withPrincipalPermissionContext, O as assertOperationPermission, P as withSessionPermissionContext, Q as PIN_LOGIN_KIND, R as validateMobileRedirectUri, S as PasskeyCredentialForbiddenError, T as PasskeyRegistrationError, U as getUsersOidcConfig, V as decodeOidcTransaction, W as resolveOidcProviderConfig, X as DeviceCredentialPolicyError, Y as DeviceCredentialForbiddenError, Z as DeviceCredentialService, _ as PASSKEY_MAX_PER_USER_CEILING, a as TerminalAuthError, at as UsersPasskeyCredential, b as PASSKEY_SESSION_DATA_KEY, c as DEFAULT_MAX_PASSKEYS_PER_USER, ct as UsersPasskeyChallenge, d as DEFAULT_PASSKEY_FRESH_SESSION_SECONDS, et as PinVerifier, f as DEFAULT_PASSKEY_MANAGE_PERMISSION, g as PASSKEY_LOGIN_KIND, h as PASSKEY_FRESH_SESSION_FLOOR_SECONDS, i as TERMINAL_APPROVE_LOGIN_KIND, it as UsersPasskeyCredentialCollection, j as getCurrentSessionPermissionContext, k as checkOperationPermission, l as DEFAULT_PASSKEY_CHALLENGE_TTL_SECONDS, lt as UsersCliAuthRequestCollection, m as PASSKEY_FRESH_SESSION_CEILING_SECONDS, n as DEFAULT_CLI_AUTH_REQUEST_TTL_SECONDS, nt as UsersPinCredentialCollection, o as TerminalAuthRateLimitError, ot as UsersPasskeyChallengeCollection, p as DEFAULT_PASSKEY_NAME, q as DEFAULT_PIN_MANAGE_PERMISSION, r as DEFAULT_CLI_SESSION_TTL_SECONDS, rt as UsersPinCredential, s as TerminalAuthService, st as PASSKEY_CHALLENGE_TTL_CEILING_SECONDS, t as DEFAULT_CLI_AUTH_POLL_INTERVAL_SECONDS, tt as ensurePinPermissionsRegistered, u as DEFAULT_PASSKEY_FRESH_AUTH_METHODS, ut as UsersCliAuthRequest, v as PASSKEY_NAME_MAX_LENGTH, w as PasskeyReauthenticationRequiredError, x as PasskeyCredentialError, y as PASSKEY_PERMISSION_DEFINITIONS, z as OidcLoginError } from "./chunks/TerminalAuthService-
|
|
2
|
+
import { $ as PIN_PERMISSION_DEFINITIONS, A as hasOperationPermission, B as OidcLoginService, C as PasskeyCredentialService, D as OperationPermissionError, E as ensurePasskeyPermissionsRegistered, F as MobileAuthError, H as encodeOidcTransaction, I as MobileAuthService, J as DeviceCredentialError, K as DEFAULT_DEVICE_PERSON_IDLE_SECONDS, L as readMobileBearerToken, M as getRequestScopedDatabase, N as withPrincipalPermissionContext, O as assertOperationPermission, P as withSessionPermissionContext, Q as PIN_LOGIN_KIND, R as validateMobileRedirectUri, S as PasskeyCredentialForbiddenError, T as PasskeyRegistrationError, U as getUsersOidcConfig, V as decodeOidcTransaction, W as resolveOidcProviderConfig, X as DeviceCredentialPolicyError, Y as DeviceCredentialForbiddenError, Z as DeviceCredentialService, _ as PASSKEY_MAX_PER_USER_CEILING, a as TerminalAuthError, at as UsersPasskeyCredential, b as PASSKEY_SESSION_DATA_KEY, c as DEFAULT_MAX_PASSKEYS_PER_USER, ct as UsersPasskeyChallenge, d as DEFAULT_PASSKEY_FRESH_SESSION_SECONDS, et as PinVerifier, f as DEFAULT_PASSKEY_MANAGE_PERMISSION, g as PASSKEY_LOGIN_KIND, h as PASSKEY_FRESH_SESSION_FLOOR_SECONDS, i as TERMINAL_APPROVE_LOGIN_KIND, it as UsersPasskeyCredentialCollection, j as getCurrentSessionPermissionContext, k as checkOperationPermission, l as DEFAULT_PASSKEY_CHALLENGE_TTL_SECONDS, lt as UsersCliAuthRequestCollection, m as PASSKEY_FRESH_SESSION_CEILING_SECONDS, n as DEFAULT_CLI_AUTH_REQUEST_TTL_SECONDS, nt as UsersPinCredentialCollection, o as TerminalAuthRateLimitError, ot as UsersPasskeyChallengeCollection, p as DEFAULT_PASSKEY_NAME, q as DEFAULT_PIN_MANAGE_PERMISSION, r as DEFAULT_CLI_SESSION_TTL_SECONDS, rt as UsersPinCredential, s as TerminalAuthService, st as PASSKEY_CHALLENGE_TTL_CEILING_SECONDS, t as DEFAULT_CLI_AUTH_POLL_INTERVAL_SECONDS, tt as ensurePinPermissionsRegistered, u as DEFAULT_PASSKEY_FRESH_AUTH_METHODS, ut as UsersCliAuthRequest, v as PASSKEY_NAME_MAX_LENGTH, w as PasskeyReauthenticationRequiredError, x as PasskeyCredentialError, y as PASSKEY_PERMISSION_DEFINITIONS, z as OidcLoginError } from "./chunks/TerminalAuthService-lE2aS7C_.js";
|
|
3
3
|
import { a as MembershipStatus, c as TenantPermissionEffect, i as DEFAULT_TENANT_POLICY, l as TenantStatus, n as DEFAULT_ROLES, o as OverrideEffect, r as DEFAULT_ROLE_SLUGS, s as SessionStatus, t as AccessRequestStatus, u as UserStatus } from "./chunks/types-DqUZxluX.js";
|
|
4
4
|
import { t as registerPermissionDefinitions } from "./chunks/permission-registry-PhcdZvKe.js";
|
|
5
5
|
import { DEFAULT_STEP_UP_MAX_AGE_SECONDS, STEP_UP_MAX_AGE_CEILING_SECONDS, STEP_UP_REQUIRED_CODE, StepUpRequiredError, isTenantOwnerSession, requireRecentAuthentication } from "./step-up.js";
|
|
@@ -2728,7 +2728,7 @@ var MagicLinkService = class MagicLinkService {
|
|
|
2728
2728
|
return this.issue(email, this.tokenExpiry, { ...options.subject !== void 0 ? { sub: options.subject } : {} });
|
|
2729
2729
|
}
|
|
2730
2730
|
async issue(email, expirySeconds, claims) {
|
|
2731
|
-
const { SignJWT } = await import("./chunks/TerminalAuthService-
|
|
2731
|
+
const { SignJWT } = await import("./chunks/TerminalAuthService-lE2aS7C_.js").then((n) => n.G);
|
|
2732
2732
|
const key = await this.getSigningKey();
|
|
2733
2733
|
const nonce = crypto.randomUUID();
|
|
2734
2734
|
const normalizedEmail = normalizeEmail(email);
|
|
@@ -2845,7 +2845,7 @@ var MagicLinkService = class MagicLinkService {
|
|
|
2845
2845
|
};
|
|
2846
2846
|
}
|
|
2847
2847
|
async verifySignature(token) {
|
|
2848
|
-
const { jwtVerify, errors } = await import("./chunks/TerminalAuthService-
|
|
2848
|
+
const { jwtVerify, errors } = await import("./chunks/TerminalAuthService-lE2aS7C_.js").then((n) => n.G);
|
|
2849
2849
|
const key = await this.getSigningKey();
|
|
2850
2850
|
let payload;
|
|
2851
2851
|
try {
|
package/dist/manifest.json
CHANGED
package/dist/smrt-knowledge.json
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
"sensitiveFieldsExcluded": true,
|
|
4
4
|
"generatedAt": "1970-01-01T00:00:00.000Z",
|
|
5
5
|
"packageName": "@happyvertical/smrt-users",
|
|
6
|
-
"packageVersion": "0.60.
|
|
6
|
+
"packageVersion": "0.60.17",
|
|
7
7
|
"sourceManifestPath": "dist/manifest.json",
|
|
8
8
|
"agentDocPath": "AGENTS.md",
|
|
9
9
|
"sourceHashes": {
|
|
10
|
-
"manifest": "
|
|
11
|
-
"packageJson": "
|
|
10
|
+
"manifest": "bdd8c6f949a807218bf92072d48252cb612c1a14fa7c6c5d651e1f4ce763f312",
|
|
11
|
+
"packageJson": "d19643d4bee9f08676a4a4700198078cae0e0bd86c7c2a296bf90e4a7644e995",
|
|
12
12
|
"agents": "30b71cb25de701433b9b10de8968eaafb6f30e4dd933dc1328feac416c439d70",
|
|
13
13
|
"moduleDoc:agents/permissions.md": "08a83623a45ef11b2d8596fff2c88cbfbb10bb71188e12e796037b61278bbe56",
|
|
14
14
|
"moduleDoc:agents/oidc-provisioning.md": "b73f3fdaf61136720132a614c7e14237b7bd35f7bf5d43eabb29f565485803b9",
|
|
@@ -38,10 +38,63 @@ async function revoke(kind: 'session' | 'api-key', id: string) {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
</script>
|
|
41
|
-
<section class="security" aria-labelledby="account-security-title" data-smrt-component="AccountSecurityPanel"><h2 id="account-security-title">{t('users.auth.account_security')}</h2>{#if error}<p role="alert">{t(error)}</p>{/if}<h3>{t('users.auth.signed_in_sessions')}</h3>{#if sessions.length}<ul>{#each sessions as session (session.id)}<li><div><strong>{session.label}</strong>{#if session.current}<span>{t('users.auth.current_session')}</span>{/if}{#if session.lastActiveAt}<small>{t('users.auth.last_active',{value:session.lastActiveAt})}</small>{/if}</div><Button variant="secondary" size="sm" onclick={()=>revoke('session',session.id)} disabled={session.current||!adapter.revokeSession} loading={pending===`session:${session.id}`}>{t('users.auth.sign_out')}</Button></li>{/each}</ul>{:else}<p>{t('users.auth.no_active_sessions')}</p>{/if}<h3>{t('users.auth.api_keys')}</h3>{#if apiKeys.length}<ul>{#each apiKeys as key (key.id)}<li><div><strong>{key.label}</strong>{#if key.lastUsedAt}<small>{t('users.auth.last_used',{value:key.lastUsedAt})}</small>{/if}</div><Button variant="secondary" size="sm" onclick={()=>revoke('api-key',key.id)} disabled={!adapter.revokeApiKey} loading={pending===`api-key:${key.id}`}>{t('users.auth.revoke')}</Button></li>{/each}</ul>{:else}<p>{t('users.auth.no_api_keys')}</p>{/if}</section>
|
|
41
|
+
<section class="smrt-account-security-panel__root" aria-labelledby="account-security-title" data-smrt-component="AccountSecurityPanel"><h2 id="account-security-title">{t('users.auth.account_security')}</h2>{#if error}<p role="alert">{t(error)}</p>{/if}<h3>{t('users.auth.signed_in_sessions')}</h3>{#if sessions.length}<ul>{#each sessions as session (session.id)}<li><div><strong>{session.label}</strong>{#if session.current}<span>{t('users.auth.current_session')}</span>{/if}{#if session.lastActiveAt}<small>{t('users.auth.last_active',{value:session.lastActiveAt})}</small>{/if}</div><Button variant="secondary" size="sm" onclick={()=>revoke('session',session.id)} disabled={session.current||!adapter.revokeSession} loading={pending===`session:${session.id}`}>{t('users.auth.sign_out')}</Button></li>{/each}</ul>{:else}<p>{t('users.auth.no_active_sessions')}</p>{/if}<h3>{t('users.auth.api_keys')}</h3>{#if apiKeys.length}<ul>{#each apiKeys as key (key.id)}<li><div><strong>{key.label}</strong>{#if key.lastUsedAt}<small>{t('users.auth.last_used',{value:key.lastUsedAt})}</small>{/if}</div><Button variant="secondary" size="sm" onclick={()=>revoke('api-key',key.id)} disabled={!adapter.revokeApiKey} loading={pending===`api-key:${key.id}`}>{t('users.auth.revoke')}</Button></li>{/each}</ul>{:else}<p>{t('users.auth.no_api_keys')}</p>{/if}</section>
|
|
42
42
|
<style>
|
|
43
43
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
44
|
+
@layer smrt.structure {
|
|
45
|
+
.smrt-account-security-panel__root {
|
|
46
|
+
display:grid;
|
|
47
|
+
gap:var(--smrt-spacing-sm,.5rem);
|
|
48
|
+
}
|
|
49
|
+
h2,h3,p {
|
|
50
|
+
margin:0;
|
|
51
|
+
}
|
|
52
|
+
h3 {
|
|
53
|
+
margin-top:var(--smrt-spacing-sm,.5rem);
|
|
54
|
+
}
|
|
55
|
+
ul {
|
|
56
|
+
list-style:none;
|
|
57
|
+
padding:0;
|
|
58
|
+
margin:0;
|
|
59
|
+
display:grid;
|
|
60
|
+
gap:var(--smrt-spacing-sm,.5rem);
|
|
61
|
+
}
|
|
62
|
+
li {
|
|
63
|
+
display:flex;
|
|
64
|
+
justify-content:space-between;
|
|
65
|
+
align-items:center;
|
|
66
|
+
gap:var(--smrt-spacing-md,1rem);
|
|
67
|
+
padding:var(--smrt-spacing-sm,.5rem);
|
|
68
|
+
}
|
|
69
|
+
li div {
|
|
70
|
+
display:grid;
|
|
71
|
+
gap:var(--smrt-spacing-2,.25rem);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
44
75
|
@layer smrt.theme {
|
|
45
|
-
.
|
|
76
|
+
.smrt-account-security-panel__root {
|
|
77
|
+
color:var(--smrt-color-on-surface);
|
|
78
|
+
}
|
|
79
|
+
h2 {
|
|
80
|
+
font:var(--smrt-typography-title-large-font);
|
|
81
|
+
}
|
|
82
|
+
h3 {
|
|
83
|
+
font:var(--smrt-typography-title-small-font);
|
|
84
|
+
}
|
|
85
|
+
p[role=alert] {
|
|
86
|
+
color:var(--smrt-color-error);
|
|
87
|
+
}
|
|
88
|
+
li {
|
|
89
|
+
background:var(--smrt-color-surface-container-low);
|
|
90
|
+
border-radius:var(--smrt-radius-sm,.25rem);
|
|
91
|
+
}
|
|
92
|
+
small,span {
|
|
93
|
+
color:var(--smrt-color-on-surface-variant);
|
|
94
|
+
}
|
|
95
|
+
span {
|
|
96
|
+
font:var(--smrt-typography-label-small-font);
|
|
97
|
+
}
|
|
46
98
|
}
|
|
99
|
+
|
|
47
100
|
</style>
|
|
@@ -91,13 +91,13 @@ function handleClose() {
|
|
|
91
91
|
closeOnBackdrop={!loading}
|
|
92
92
|
closeOnEscape={!loading}
|
|
93
93
|
>
|
|
94
|
-
<div class="invite-
|
|
94
|
+
<div class="smrt-invite-user-modal__root" data-smrt-part="body">
|
|
95
95
|
<Form id={formId} class="invite-form" onsubmit={handleSubmit}>
|
|
96
96
|
{#if error}
|
|
97
|
-
<div class="error">{error}</div>
|
|
97
|
+
<div class="smrt-invite-user-modal__error" data-smrt-part="error">{error}</div>
|
|
98
98
|
{/if}
|
|
99
99
|
|
|
100
|
-
<div class="field">
|
|
100
|
+
<div class="smrt-invite-user-modal__field" data-smrt-part="field">
|
|
101
101
|
<label for="invite-email">{t(M['users.invite_user_modal.email_address'])}</label>
|
|
102
102
|
<Input
|
|
103
103
|
id="invite-email"
|
|
@@ -109,7 +109,7 @@ function handleClose() {
|
|
|
109
109
|
/>
|
|
110
110
|
</div>
|
|
111
111
|
|
|
112
|
-
<div class="field">
|
|
112
|
+
<div class="smrt-invite-user-modal__field" data-smrt-part="field">
|
|
113
113
|
<label for="invite-role">Role</label>
|
|
114
114
|
<RoleSelector
|
|
115
115
|
{roles}
|
|
@@ -120,14 +120,14 @@ function handleClose() {
|
|
|
120
120
|
/>
|
|
121
121
|
</div>
|
|
122
122
|
|
|
123
|
-
<div class="
|
|
123
|
+
<div class="smrt-invite-user-modal__checkbox-field" data-smrt-part="control">
|
|
124
124
|
<!-- raw-primitive-allow: native checkbox; no Provider-free checkbox primitive (Toggle is a switch with different semantics, CheckboxInput requires a Provider) -->
|
|
125
125
|
<input id="send-email" type="checkbox" bind:checked={sendEmail} disabled={loading} />
|
|
126
126
|
<label for="send-email">{t(M['users.invite_user_modal.send_invitation_email'])}</label>
|
|
127
127
|
</div>
|
|
128
128
|
|
|
129
129
|
{#if !sendEmail}
|
|
130
|
-
<div class="
|
|
130
|
+
<div class="smrt-invite-user-modal__hint" data-smrt-part="description">
|
|
131
131
|
{t(M['users.invite_user_modal.pending_hint'])}
|
|
132
132
|
</div>
|
|
133
133
|
{/if}
|
|
@@ -150,58 +150,61 @@ function handleClose() {
|
|
|
150
150
|
|
|
151
151
|
<style>
|
|
152
152
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
153
|
-
@layer smrt.
|
|
153
|
+
@layer smrt.structure {
|
|
154
154
|
/* The dialog chrome (backdrop, surface, header, footer bar, close button) is
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
.invite-
|
|
155
|
+
supplied by the smrt-ui Modal. Only the form-content + footer-button styles
|
|
156
|
+
live here. */
|
|
157
|
+
.smrt-invite-user-modal__root :global(.invite-form) {
|
|
158
158
|
display: flex;
|
|
159
159
|
flex-direction: column;
|
|
160
160
|
gap: var(--smrt-spacing-md, 1rem);
|
|
161
161
|
}
|
|
162
|
-
|
|
163
|
-
.error {
|
|
162
|
+
.smrt-invite-user-modal__error {
|
|
164
163
|
padding: var(--smrt-spacing-sm, 0.75rem);
|
|
165
|
-
background: var(--smrt-color-error-container);
|
|
166
|
-
border: 1px solid var(--smrt-color-error);
|
|
167
|
-
border-radius: var(--smrt-radius-medium, 0.5rem);
|
|
168
|
-
color: var(--smrt-color-on-error-container);
|
|
169
|
-
font: var(--smrt-typography-body-medium-font, 0.875rem / 1.25 sans-serif);
|
|
170
164
|
}
|
|
171
|
-
|
|
172
|
-
.field {
|
|
165
|
+
.smrt-invite-user-modal__field {
|
|
173
166
|
display: flex;
|
|
174
167
|
flex-direction: column;
|
|
175
168
|
gap: 0.375rem;
|
|
176
169
|
}
|
|
177
|
-
|
|
178
|
-
label {
|
|
179
|
-
font: var(--smrt-typography-body-medium-font, 500 0.875rem / 1.25 sans-serif);
|
|
180
|
-
color: var(--smrt-color-on-surface-variant);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
.checkbox-field {
|
|
170
|
+
.smrt-invite-user-modal__checkbox-field {
|
|
184
171
|
display: flex;
|
|
185
172
|
align-items: center;
|
|
186
173
|
gap: var(--smrt-spacing-sm, 0.5rem);
|
|
187
174
|
}
|
|
188
|
-
|
|
189
|
-
.checkbox-field input {
|
|
175
|
+
.smrt-invite-user-modal__checkbox-field input {
|
|
190
176
|
width: 1rem;
|
|
191
177
|
height: 1rem;
|
|
192
|
-
accent-color: var(--smrt-color-primary);
|
|
193
178
|
}
|
|
179
|
+
.smrt-invite-user-modal__hint {
|
|
180
|
+
padding: var(--smrt-spacing-sm, 0.5rem);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
194
183
|
|
|
195
|
-
|
|
184
|
+
@layer smrt.theme {
|
|
185
|
+
.smrt-invite-user-modal__error {
|
|
186
|
+
background: var(--smrt-color-error-container);
|
|
187
|
+
border: 1px solid var(--smrt-color-error);
|
|
188
|
+
border-radius: var(--smrt-radius-medium, 0.5rem);
|
|
189
|
+
color: var(--smrt-color-on-error-container);
|
|
190
|
+
font: var(--smrt-typography-body-medium-font, 0.875rem / 1.25 sans-serif);
|
|
191
|
+
}
|
|
192
|
+
label {
|
|
193
|
+
font: var(--smrt-typography-body-medium-font, 500 0.875rem / 1.25 sans-serif);
|
|
194
|
+
color: var(--smrt-color-on-surface-variant);
|
|
195
|
+
}
|
|
196
|
+
.smrt-invite-user-modal__checkbox-field input {
|
|
197
|
+
accent-color: var(--smrt-color-primary);
|
|
198
|
+
}
|
|
199
|
+
.smrt-invite-user-modal__checkbox-field label {
|
|
196
200
|
font-weight: var(--smrt-typography-weight-normal, 400);
|
|
197
201
|
}
|
|
198
|
-
|
|
199
|
-
.hint {
|
|
202
|
+
.smrt-invite-user-modal__hint {
|
|
200
203
|
font: var(--smrt-typography-body-small-font, 0.75rem / 1.25 sans-serif);
|
|
201
204
|
color: var(--smrt-color-on-surface-variant);
|
|
202
|
-
padding: var(--smrt-spacing-sm, 0.5rem);
|
|
203
205
|
background: var(--smrt-color-surface-container-low);
|
|
204
206
|
border-radius: var(--smrt-radius-small, 0.25rem);
|
|
205
207
|
}
|
|
206
208
|
}
|
|
209
|
+
|
|
207
210
|
</style>
|
|
@@ -39,10 +39,44 @@ async function submit() {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
</script>
|
|
42
|
-
<Form class="auth-form" onsubmit={submit} aria-busy={loading||pending}><h2>{token ? t('users.auth.confirm_sign_in_link') : t('users.auth.email_sign_in_link')}</h2>{#if error}<p class="error" role="alert">{t(error)}</p>{/if}{#if notice}<p class="
|
|
42
|
+
<Form class="auth-form" onsubmit={submit} aria-busy={loading||pending}><h2>{token ? t('users.auth.confirm_sign_in_link') : t('users.auth.email_sign_in_link')}</h2>{#if error}<p class="smrt-magic-link-form__error" data-smrt-part="error" role="alert">{t(error)}</p>{/if}{#if notice}<p class="smrt-magic-link-form__notice" data-smrt-part="status" role="status">{t(notice)}</p>{/if}{#if !token}<label for="magic-link-email">{t('users.auth.email_address')}</label><Input id="magic-link-email" type="email" bind:value={email} autocomplete="email" required disabled={loading||pending}/>{/if}<Button type="submit" fullWidth disabled={loading || (token ? !adapter.confirmMagicLink : !adapter.requestMagicLink)} loading={pending}>{token ? t('users.auth.confirm_sign_in') : t('users.auth.send_sign_in_link')}</Button></Form>
|
|
43
43
|
<style>
|
|
44
44
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
45
|
+
@layer smrt.structure {
|
|
46
|
+
:global(.auth-form) {
|
|
47
|
+
display:grid;
|
|
48
|
+
gap:var(--smrt-spacing-sm,.5rem);
|
|
49
|
+
}
|
|
50
|
+
h2 {
|
|
51
|
+
margin:0;
|
|
52
|
+
}
|
|
53
|
+
.smrt-magic-link-form__error,.smrt-magic-link-form__notice {
|
|
54
|
+
margin:0;
|
|
55
|
+
padding:var(--smrt-spacing-sm,.5rem);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
45
59
|
@layer smrt.theme {
|
|
46
|
-
:global(.auth-form){
|
|
60
|
+
:global(.auth-form) {
|
|
61
|
+
color:var(--smrt-color-on-surface);
|
|
62
|
+
}
|
|
63
|
+
h2 {
|
|
64
|
+
font:var(--smrt-typography-title-large-font);
|
|
65
|
+
}
|
|
66
|
+
label {
|
|
67
|
+
font:var(--smrt-typography-label-large-font);
|
|
68
|
+
}
|
|
69
|
+
.smrt-magic-link-form__error,.smrt-magic-link-form__notice {
|
|
70
|
+
border-radius:var(--smrt-radius-sm,.25rem);
|
|
71
|
+
}
|
|
72
|
+
.smrt-magic-link-form__error {
|
|
73
|
+
background:var(--smrt-color-error-container);
|
|
74
|
+
color:var(--smrt-color-on-error-container);
|
|
75
|
+
}
|
|
76
|
+
.smrt-magic-link-form__notice {
|
|
77
|
+
background:var(--smrt-color-primary-container);
|
|
78
|
+
color:var(--smrt-color-on-primary-container);
|
|
79
|
+
}
|
|
47
80
|
}
|
|
81
|
+
|
|
48
82
|
</style>
|
|
@@ -25,9 +25,32 @@ async function signIn(providerId: string) {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
</script>
|
|
28
|
-
<section aria-label={t('users.auth.single_sign_on')} data-smrt-component="OidcProviderButtons"><h2>{t('users.auth.or_continue_with')}</h2>{#if error}<p class="error" role="alert">{t(error)}</p>{/if}<div class="
|
|
28
|
+
<section aria-label={t('users.auth.single_sign_on')} data-smrt-component="OidcProviderButtons"><h2>{t('users.auth.or_continue_with')}</h2>{#if error}<p class="smrt-oidc-provider-buttons__error" data-smrt-part="error" role="alert">{t(error)}</p>{/if}<div class="smrt-oidc-provider-buttons__providers" data-smrt-part="list">{#each providers as provider (provider.id)}<Button variant="secondary" fullWidth onclick={()=>signIn(provider.id)} disabled={provider.disabled||!adapter.signInWithOidc} loading={pending===provider.id}>{provider.label}</Button>{/each}</div></section><style>
|
|
29
29
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
30
|
+
@layer smrt.structure {
|
|
31
|
+
section {
|
|
32
|
+
display:grid;
|
|
33
|
+
gap:var(--smrt-spacing-sm,.5rem);
|
|
34
|
+
}
|
|
35
|
+
h2 {
|
|
36
|
+
margin:0;
|
|
37
|
+
}
|
|
38
|
+
.smrt-oidc-provider-buttons__providers {
|
|
39
|
+
display:grid;
|
|
40
|
+
gap:var(--smrt-spacing-sm,.5rem);
|
|
41
|
+
}
|
|
42
|
+
.smrt-oidc-provider-buttons__error {
|
|
43
|
+
margin:0;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
30
47
|
@layer smrt.theme {
|
|
31
|
-
|
|
48
|
+
h2 {
|
|
49
|
+
font:var(--smrt-typography-title-small-font);
|
|
50
|
+
}
|
|
51
|
+
.smrt-oidc-provider-buttons__error {
|
|
52
|
+
color:var(--smrt-color-error);
|
|
53
|
+
}
|
|
32
54
|
}
|
|
55
|
+
|
|
33
56
|
</style>
|
|
@@ -25,9 +25,22 @@ async function signIn() {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
</script>
|
|
28
|
-
{#if adapter.signInWithPasskey}<div class="passkey" data-smrt-component="PasskeySignInButton"><Button variant="secondary" fullWidth onclick={signIn} loading={pending}>{label ?? t('users.auth.passkey_sign_in')}</Button>{#if error}<p role="alert">{t(error)}</p>{/if}</div>{/if}<style>
|
|
28
|
+
{#if adapter.signInWithPasskey}<div class="smrt-passkey-sign-in-button__root" data-smrt-component="PasskeySignInButton"><Button variant="secondary" fullWidth onclick={signIn} loading={pending}>{label ?? t('users.auth.passkey_sign_in')}</Button>{#if error}<p role="alert">{t(error)}</p>{/if}</div>{/if}<style>
|
|
29
29
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
30
|
+
@layer smrt.structure {
|
|
31
|
+
.smrt-passkey-sign-in-button__root {
|
|
32
|
+
display:grid;
|
|
33
|
+
gap:var(--smrt-spacing-sm,.5rem);
|
|
34
|
+
}
|
|
35
|
+
p {
|
|
36
|
+
margin:0;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
30
40
|
@layer smrt.theme {
|
|
31
|
-
|
|
41
|
+
p {
|
|
42
|
+
color:var(--smrt-color-error);
|
|
43
|
+
}
|
|
32
44
|
}
|
|
45
|
+
|
|
33
46
|
</style>
|
|
@@ -34,7 +34,7 @@ async function submit() {
|
|
|
34
34
|
</script>
|
|
35
35
|
<Form class="auth-form" onsubmit={submit} aria-busy={loading || pending}>
|
|
36
36
|
<h2>{t('users.auth.sign_in')}</h2>
|
|
37
|
-
{#if error}<p class="error" role="alert">{t(error)}</p>{/if}
|
|
37
|
+
{#if error}<p class="smrt-sign-in-form__error" data-smrt-part="error" role="alert">{t(error)}</p>{/if}
|
|
38
38
|
<label for="sign-in-email">{t('users.auth.email_address')}</label><Input id="sign-in-email" type="email" bind:value={email} autocomplete="email" required disabled={loading || pending} />
|
|
39
39
|
<label for="sign-in-password">{t('users.auth.password')}</label><Input id="sign-in-password" type="password" bind:value={password} autocomplete="current-password" required disabled={loading || pending} />
|
|
40
40
|
{#if forgotPasswordHref}<Button href={forgotPasswordHref} variant="ghost">{t('users.auth.forgot_password')}</Button>{/if}
|
|
@@ -42,7 +42,35 @@ async function submit() {
|
|
|
42
42
|
</Form>
|
|
43
43
|
<style>
|
|
44
44
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
45
|
+
@layer smrt.structure {
|
|
46
|
+
:global(.auth-form) {
|
|
47
|
+
display:grid;
|
|
48
|
+
gap:var(--smrt-spacing-sm,.5rem);
|
|
49
|
+
}
|
|
50
|
+
h2 {
|
|
51
|
+
margin:0;
|
|
52
|
+
}
|
|
53
|
+
.smrt-sign-in-form__error {
|
|
54
|
+
margin:0;
|
|
55
|
+
padding:var(--smrt-spacing-sm,.5rem);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
45
59
|
@layer smrt.theme {
|
|
46
|
-
:global(.auth-form){
|
|
60
|
+
:global(.auth-form) {
|
|
61
|
+
color:var(--smrt-color-on-surface);
|
|
62
|
+
}
|
|
63
|
+
h2 {
|
|
64
|
+
font:var(--smrt-typography-title-large-font);
|
|
65
|
+
}
|
|
66
|
+
label {
|
|
67
|
+
font:var(--smrt-typography-label-large-font);
|
|
68
|
+
}
|
|
69
|
+
.smrt-sign-in-form__error {
|
|
70
|
+
border-radius:var(--smrt-radius-sm,.25rem);
|
|
71
|
+
background:var(--smrt-color-error-container);
|
|
72
|
+
color:var(--smrt-color-on-error-container);
|
|
73
|
+
}
|
|
47
74
|
}
|
|
75
|
+
|
|
48
76
|
</style>
|
|
@@ -34,10 +34,38 @@ async function submit() {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
</script>
|
|
37
|
-
<Form class="auth-form" onsubmit={submit} aria-busy={loading||pending}><h2>{t('users.auth.create_account')}</h2>{#if error}<p class="error" role="alert">{t(error)}</p>{/if}<label for="sign-up-email">{t('users.auth.email_address')}</label><Input id="sign-up-email" type="email" bind:value={email} autocomplete="email" required disabled={loading||pending}/><label for="sign-up-password">{t('users.auth.password')}</label><Input id="sign-up-password" type="password" bind:value={password} autocomplete="new-password" required disabled={loading||pending}/><label for="sign-up-confirm">{t('users.auth.confirm_password')}</label><Input id="sign-up-confirm" type="password" bind:value={confirm} autocomplete="new-password" required disabled={loading||pending}/><Button type="submit" fullWidth disabled={!adapter.signUp||loading} loading={pending}>{t('users.auth.create_account')}</Button></Form>
|
|
37
|
+
<Form class="auth-form" onsubmit={submit} aria-busy={loading||pending}><h2>{t('users.auth.create_account')}</h2>{#if error}<p class="smrt-sign-up-form__error" data-smrt-part="error" role="alert">{t(error)}</p>{/if}<label for="sign-up-email">{t('users.auth.email_address')}</label><Input id="sign-up-email" type="email" bind:value={email} autocomplete="email" required disabled={loading||pending}/><label for="sign-up-password">{t('users.auth.password')}</label><Input id="sign-up-password" type="password" bind:value={password} autocomplete="new-password" required disabled={loading||pending}/><label for="sign-up-confirm">{t('users.auth.confirm_password')}</label><Input id="sign-up-confirm" type="password" bind:value={confirm} autocomplete="new-password" required disabled={loading||pending}/><Button type="submit" fullWidth disabled={!adapter.signUp||loading} loading={pending}>{t('users.auth.create_account')}</Button></Form>
|
|
38
38
|
<style>
|
|
39
39
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
40
|
+
@layer smrt.structure {
|
|
41
|
+
:global(.auth-form) {
|
|
42
|
+
display:grid;
|
|
43
|
+
gap:var(--smrt-spacing-sm,.5rem);
|
|
44
|
+
}
|
|
45
|
+
h2 {
|
|
46
|
+
margin:0;
|
|
47
|
+
}
|
|
48
|
+
.smrt-sign-up-form__error {
|
|
49
|
+
margin:0;
|
|
50
|
+
padding:var(--smrt-spacing-sm,.5rem);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
40
54
|
@layer smrt.theme {
|
|
41
|
-
:global(.auth-form){
|
|
55
|
+
:global(.auth-form) {
|
|
56
|
+
color:var(--smrt-color-on-surface);
|
|
57
|
+
}
|
|
58
|
+
h2 {
|
|
59
|
+
font:var(--smrt-typography-title-large-font);
|
|
60
|
+
}
|
|
61
|
+
label {
|
|
62
|
+
font:var(--smrt-typography-label-large-font);
|
|
63
|
+
}
|
|
64
|
+
.smrt-sign-up-form__error {
|
|
65
|
+
border-radius:var(--smrt-radius-sm,.25rem);
|
|
66
|
+
background:var(--smrt-color-error-container);
|
|
67
|
+
color:var(--smrt-color-on-error-container);
|
|
68
|
+
}
|
|
42
69
|
}
|
|
70
|
+
|
|
43
71
|
</style>
|
|
@@ -52,60 +52,66 @@ function getColor(name: string): string {
|
|
|
52
52
|
}
|
|
53
53
|
</script>
|
|
54
54
|
|
|
55
|
-
<div class="user-
|
|
56
|
-
<span class="
|
|
55
|
+
<div class="smrt-user-avatar__root" class:smrt-user-avatar__sm={size === 'sm'} class:smrt-user-avatar__lg={size === 'lg'} class:smrt-user-avatar__xl={size === 'xl'} data-smrt-component="UserAvatar">
|
|
56
|
+
<span class="smrt-user-avatar__avatar" data-smrt-part="icon" style:background-color={getColor(profile.name ?? '')}>
|
|
57
57
|
{getInitials(profile.name ?? 'U')}
|
|
58
58
|
</span>
|
|
59
59
|
{#if showName}
|
|
60
|
-
<span class="
|
|
60
|
+
<span class="smrt-user-avatar__name" data-smrt-part="title">{profile.name}</span>
|
|
61
61
|
{/if}
|
|
62
62
|
</div>
|
|
63
63
|
|
|
64
64
|
<style>
|
|
65
65
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
66
|
-
@layer smrt.
|
|
67
|
-
.user-
|
|
66
|
+
@layer smrt.structure {
|
|
67
|
+
.smrt-user-avatar__root {
|
|
68
68
|
display: inline-flex;
|
|
69
69
|
align-items: center;
|
|
70
70
|
gap: var(--smrt-spacing-sm, 0.5rem);
|
|
71
71
|
}
|
|
72
|
-
|
|
73
|
-
.avatar {
|
|
72
|
+
.smrt-user-avatar__avatar {
|
|
74
73
|
display: flex;
|
|
75
74
|
align-items: center;
|
|
76
75
|
justify-content: center;
|
|
77
76
|
width: 2.5rem;
|
|
78
77
|
height: 2.5rem;
|
|
79
|
-
border-radius: var(--smrt-radius-full);
|
|
80
|
-
color: var(--smrt-color-on-primary, white);
|
|
81
|
-
font: var(--smrt-typography-label-large-font, 600 0.875rem / 1.25 sans-serif);
|
|
82
78
|
}
|
|
83
|
-
|
|
84
|
-
.sm .avatar {
|
|
79
|
+
.smrt-user-avatar__sm .smrt-user-avatar__avatar {
|
|
85
80
|
width: 2rem;
|
|
86
81
|
height: 2rem;
|
|
87
|
-
font: var(--smrt-typography-label-medium-font, 0.75rem / 1 sans-serif);
|
|
88
82
|
}
|
|
89
|
-
|
|
90
|
-
.lg .avatar {
|
|
83
|
+
.smrt-user-avatar__lg .smrt-user-avatar__avatar {
|
|
91
84
|
width: 3rem;
|
|
92
85
|
height: 3rem;
|
|
93
|
-
font: var(--smrt-typography-title-medium-font, 1rem / 1.5 sans-serif);
|
|
94
86
|
}
|
|
95
|
-
|
|
96
|
-
.xl .avatar {
|
|
87
|
+
.smrt-user-avatar__xl .smrt-user-avatar__avatar {
|
|
97
88
|
width: 4rem;
|
|
98
89
|
height: 4rem;
|
|
99
|
-
font: var(--smrt-typography-title-large-font, 1.25rem / 1.25 sans-serif);
|
|
100
90
|
}
|
|
91
|
+
}
|
|
101
92
|
|
|
102
|
-
|
|
93
|
+
@layer smrt.theme {
|
|
94
|
+
.smrt-user-avatar__avatar {
|
|
95
|
+
border-radius: var(--smrt-radius-full);
|
|
96
|
+
color: var(--smrt-color-on-primary, white);
|
|
97
|
+
font: var(--smrt-typography-label-large-font, 600 0.875rem / 1.25 sans-serif);
|
|
98
|
+
}
|
|
99
|
+
.smrt-user-avatar__sm .smrt-user-avatar__avatar {
|
|
100
|
+
font: var(--smrt-typography-label-medium-font, 0.75rem / 1 sans-serif);
|
|
101
|
+
}
|
|
102
|
+
.smrt-user-avatar__lg .smrt-user-avatar__avatar {
|
|
103
|
+
font: var(--smrt-typography-title-medium-font, 1rem / 1.5 sans-serif);
|
|
104
|
+
}
|
|
105
|
+
.smrt-user-avatar__xl .smrt-user-avatar__avatar {
|
|
106
|
+
font: var(--smrt-typography-title-large-font, 1.25rem / 1.25 sans-serif);
|
|
107
|
+
}
|
|
108
|
+
.smrt-user-avatar__name {
|
|
103
109
|
font: var(--smrt-typography-body-medium-font, 500 0.875rem / 1.25 sans-serif);
|
|
104
110
|
}
|
|
105
|
-
|
|
106
|
-
.
|
|
107
|
-
.xl .name {
|
|
111
|
+
.smrt-user-avatar__lg .smrt-user-avatar__name,
|
|
112
|
+
.smrt-user-avatar__xl .smrt-user-avatar__name {
|
|
108
113
|
font: var(--smrt-typography-body-large-font, 1rem / 1.5 sans-serif);
|
|
109
114
|
}
|
|
110
115
|
}
|
|
116
|
+
|
|
111
117
|
</style>
|