@happyvertical/smrt-users 0.34.6 → 0.34.8
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/manifest.json +2 -2
- package/dist/smrt-knowledge.json +4 -4
- package/dist/svelte/components/InviteUserModal.svelte +44 -66
- package/dist/svelte/components/InviteUserModal.svelte.d.ts.map +1 -1
- package/dist/svelte/components/UserForm.svelte +42 -69
- package/dist/svelte/components/UserForm.svelte.d.ts.map +1 -1
- package/package.json +9 -9
package/dist/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "1.0.0",
|
|
3
|
-
"timestamp":
|
|
3
|
+
"timestamp": 1782318272709,
|
|
4
4
|
"packageName": "@happyvertical/smrt-users",
|
|
5
|
-
"packageVersion": "0.34.
|
|
5
|
+
"packageVersion": "0.34.8",
|
|
6
6
|
"objects": {
|
|
7
7
|
"@happyvertical/smrt-users:UsersCliAuthRequestCollection": {
|
|
8
8
|
"name": "userscliauthrequestcollection",
|
package/dist/smrt-knowledge.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"generatedAt": "2026-06-
|
|
3
|
+
"generatedAt": "2026-06-24T16:24:33.632Z",
|
|
4
4
|
"packageName": "@happyvertical/smrt-users",
|
|
5
|
-
"packageVersion": "0.34.
|
|
5
|
+
"packageVersion": "0.34.8",
|
|
6
6
|
"sourceManifestPath": "dist/manifest.json",
|
|
7
7
|
"agentDocPath": "AGENTS.md",
|
|
8
8
|
"sourceHashes": {
|
|
9
|
-
"manifest": "
|
|
10
|
-
"packageJson": "
|
|
9
|
+
"manifest": "6c3d6c499f8b5c5c8ba076a417285903cd055c001362038d8094481db95cd687",
|
|
10
|
+
"packageJson": "f85967a6783f08ac7fd991fa7c748b1756b6b98ca7b46d959227c0bd67792f85",
|
|
11
11
|
"agents": "2684404a1735fd4993d4383f2dfed5f9c0f4de68f0cbfcd996f7e94eb50ac9c8"
|
|
12
12
|
},
|
|
13
13
|
"exports": [
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { RoleSelector } from '@happyvertical/smrt-ui';
|
|
3
3
|
import { Modal } from '@happyvertical/smrt-ui/feedback';
|
|
4
|
+
import { Form, Input } from '@happyvertical/smrt-ui/forms';
|
|
4
5
|
import { useI18n } from '@happyvertical/smrt-ui/i18n';
|
|
5
6
|
import { Button } from '@happyvertical/smrt-ui/ui';
|
|
6
7
|
import type { Role, Tenant } from '@happyvertical/smrt-users';
|
|
@@ -45,8 +46,7 @@ $effect(() => {
|
|
|
45
46
|
}
|
|
46
47
|
});
|
|
47
48
|
|
|
48
|
-
function handleSubmit(
|
|
49
|
-
e.preventDefault();
|
|
49
|
+
function handleSubmit() {
|
|
50
50
|
error = '';
|
|
51
51
|
|
|
52
52
|
if (!email) {
|
|
@@ -85,45 +85,48 @@ function handleClose() {
|
|
|
85
85
|
closeOnBackdrop={!loading}
|
|
86
86
|
closeOnEscape={!loading}
|
|
87
87
|
>
|
|
88
|
-
<
|
|
89
|
-
{
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
<
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
<div class="field">
|
|
106
|
-
<label for="invite-role">Role</label>
|
|
107
|
-
<RoleSelector
|
|
108
|
-
{roles}
|
|
109
|
-
value={roleId}
|
|
110
|
-
onchange={(id: string) => (roleId = id)}
|
|
111
|
-
disabled={loading}
|
|
112
|
-
showDescription
|
|
113
|
-
/>
|
|
114
|
-
</div>
|
|
115
|
-
|
|
116
|
-
<div class="checkbox-field">
|
|
117
|
-
<input id="send-email" type="checkbox" bind:checked={sendEmail} disabled={loading} />
|
|
118
|
-
<label for="send-email">{t(M['users.invite_user_modal.send_invitation_email'])}</label>
|
|
119
|
-
</div>
|
|
120
|
-
|
|
121
|
-
{#if !sendEmail}
|
|
122
|
-
<div class="hint">
|
|
123
|
-
{t(M['users.invite_user_modal.pending_hint'])}
|
|
88
|
+
<div class="invite-form-shell">
|
|
89
|
+
<Form id={formId} class="invite-form" onsubmit={handleSubmit}>
|
|
90
|
+
{#if error}
|
|
91
|
+
<div class="error">{error}</div>
|
|
92
|
+
{/if}
|
|
93
|
+
|
|
94
|
+
<div class="field">
|
|
95
|
+
<label for="invite-email">{t(M['users.invite_user_modal.email_address'])}</label>
|
|
96
|
+
<Input
|
|
97
|
+
id="invite-email"
|
|
98
|
+
type="email"
|
|
99
|
+
bind:value={email}
|
|
100
|
+
placeholder={t(M['users.invite_user_modal.email_placeholder'])}
|
|
101
|
+
disabled={loading}
|
|
102
|
+
required
|
|
103
|
+
/>
|
|
124
104
|
</div>
|
|
125
|
-
|
|
126
|
-
|
|
105
|
+
|
|
106
|
+
<div class="field">
|
|
107
|
+
<label for="invite-role">Role</label>
|
|
108
|
+
<RoleSelector
|
|
109
|
+
{roles}
|
|
110
|
+
value={roleId}
|
|
111
|
+
onchange={(id: string) => (roleId = id)}
|
|
112
|
+
disabled={loading}
|
|
113
|
+
showDescription
|
|
114
|
+
/>
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
<div class="checkbox-field">
|
|
118
|
+
<!-- raw-primitive-allow: native checkbox; no Provider-free checkbox primitive (Toggle is a switch with different semantics, CheckboxInput requires a Provider) -->
|
|
119
|
+
<input id="send-email" type="checkbox" bind:checked={sendEmail} disabled={loading} />
|
|
120
|
+
<label for="send-email">{t(M['users.invite_user_modal.send_invitation_email'])}</label>
|
|
121
|
+
</div>
|
|
122
|
+
|
|
123
|
+
{#if !sendEmail}
|
|
124
|
+
<div class="hint">
|
|
125
|
+
{t(M['users.invite_user_modal.pending_hint'])}
|
|
126
|
+
</div>
|
|
127
|
+
{/if}
|
|
128
|
+
</Form>
|
|
129
|
+
</div>
|
|
127
130
|
|
|
128
131
|
{#snippet footer()}
|
|
129
132
|
<Button variant="secondary" type="button" onclick={handleClose} disabled={loading}>
|
|
@@ -143,7 +146,7 @@ function handleClose() {
|
|
|
143
146
|
/* The dialog chrome (backdrop, surface, header, footer bar, close button) is
|
|
144
147
|
supplied by the smrt-ui Modal. Only the form-content + footer-button styles
|
|
145
148
|
live here. */
|
|
146
|
-
form {
|
|
149
|
+
.invite-form-shell :global(.invite-form) {
|
|
147
150
|
display: flex;
|
|
148
151
|
flex-direction: column;
|
|
149
152
|
gap: var(--smrt-spacing-md, 1rem);
|
|
@@ -169,25 +172,6 @@ function handleClose() {
|
|
|
169
172
|
color: var(--smrt-color-on-surface-variant, #43474e);
|
|
170
173
|
}
|
|
171
174
|
|
|
172
|
-
input[type='email'] {
|
|
173
|
-
padding: var(--smrt-spacing-sm, 0.5rem) var(--smrt-spacing-md, 0.75rem);
|
|
174
|
-
border: 1px solid var(--smrt-color-outline-variant, #c4c6cf);
|
|
175
|
-
border-radius: var(--smrt-radius-medium, 0.5rem);
|
|
176
|
-
font: var(--smrt-typography-body-medium-font, 0.875rem / 1.25 sans-serif);
|
|
177
|
-
transition: border-color var(--smrt-duration-short2, 150ms) var(--smrt-easing-standard, ease);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
input[type='email']:focus {
|
|
181
|
-
outline: none;
|
|
182
|
-
border-color: var(--smrt-color-primary, #005ac1);
|
|
183
|
-
box-shadow: 0 0 0 3px var(--smrt-color-primary-container, rgba(0, 90, 193, 0.1));
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
input[type='email']:disabled {
|
|
187
|
-
background: var(--smrt-color-surface-container, #f3f4f6);
|
|
188
|
-
cursor: not-allowed;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
175
|
.checkbox-field {
|
|
192
176
|
display: flex;
|
|
193
177
|
align-items: center;
|
|
@@ -211,10 +195,4 @@ function handleClose() {
|
|
|
211
195
|
background: var(--smrt-color-surface-container-low, #f9fafb);
|
|
212
196
|
border-radius: var(--smrt-radius-small, 0.25rem);
|
|
213
197
|
}
|
|
214
|
-
|
|
215
|
-
@media (prefers-reduced-motion: reduce) {
|
|
216
|
-
input[type='email'] {
|
|
217
|
-
transition: none;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
198
|
</style>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InviteUserModal.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/InviteUserModal.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InviteUserModal.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/InviteUserModal.svelte.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAI9D,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,QAAQ,EAAE,CAAC,IAAI,EAAE;QACf,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,OAAO,CAAC;KACpB,KAAK,IAAI,CAAC;IACX,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAgHD,QAAA,MAAM,eAAe,2CAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Profile } from '@happyvertical/smrt-profiles';
|
|
3
3
|
import { UserStatus } from '@happyvertical/smrt-types';
|
|
4
|
+
import { Form, Input, Select } from '@happyvertical/smrt-ui/forms';
|
|
4
5
|
import { useI18n } from '@happyvertical/smrt-ui/i18n';
|
|
5
6
|
import { Button } from '@happyvertical/smrt-ui/ui';
|
|
6
7
|
import type { User } from '@happyvertical/smrt-users';
|
|
@@ -61,53 +62,54 @@ $effect(() => {
|
|
|
61
62
|
status = user?.status ?? UserStatus.ACTIVE;
|
|
62
63
|
});
|
|
63
64
|
|
|
64
|
-
function handleSubmit(
|
|
65
|
-
e.preventDefault();
|
|
65
|
+
function handleSubmit() {
|
|
66
66
|
onsubmit({ name, email, status });
|
|
67
67
|
}
|
|
68
68
|
</script>
|
|
69
69
|
|
|
70
|
-
<
|
|
71
|
-
<
|
|
72
|
-
<
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
<
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
<
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
<Button variant="primary" type="submit" disabled={loading}>
|
|
100
|
-
{#if loading}
|
|
101
|
-
Saving...
|
|
102
|
-
{:else}
|
|
103
|
-
{user ? 'Update User' : 'Create User'}
|
|
70
|
+
<div class="user-form-shell">
|
|
71
|
+
<Form class="user-form" onsubmit={handleSubmit}>
|
|
72
|
+
<div class="field">
|
|
73
|
+
<label for="name">Name</label>
|
|
74
|
+
<Input id="name" type="text" bind:value={name} required disabled={loading} />
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<div class="field">
|
|
78
|
+
<label for="email">Email</label>
|
|
79
|
+
<Input id="email" type="email" bind:value={email} required disabled={loading || !!user} />
|
|
80
|
+
{#if user}
|
|
81
|
+
<span class="hint">{t(M['users.user_form.email_cannot_be_changed'])}</span>
|
|
82
|
+
{/if}
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
<div class="field">
|
|
86
|
+
<label for="status">Status</label>
|
|
87
|
+
<Select id="status" bind:value={status} disabled={loading}>
|
|
88
|
+
{#each statusOptions as option (option.value)}
|
|
89
|
+
<option value={option.value}>{option.label}</option>
|
|
90
|
+
{/each}
|
|
91
|
+
</Select>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<div class="actions">
|
|
95
|
+
{#if oncancel}
|
|
96
|
+
<Button variant="secondary" type="button" onclick={oncancel} disabled={loading}>
|
|
97
|
+
Cancel
|
|
98
|
+
</Button>
|
|
104
99
|
{/if}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
100
|
+
<Button variant="primary" type="submit" disabled={loading}>
|
|
101
|
+
{#if loading}
|
|
102
|
+
Saving...
|
|
103
|
+
{:else}
|
|
104
|
+
{user ? 'Update User' : 'Create User'}
|
|
105
|
+
{/if}
|
|
106
|
+
</Button>
|
|
107
|
+
</div>
|
|
108
|
+
</Form>
|
|
109
|
+
</div>
|
|
108
110
|
|
|
109
111
|
<style>
|
|
110
|
-
.user-form {
|
|
112
|
+
.user-form-shell :global(.user-form) {
|
|
111
113
|
display: flex;
|
|
112
114
|
flex-direction: column;
|
|
113
115
|
gap: var(--smrt-spacing-md, 1rem);
|
|
@@ -124,28 +126,6 @@ function handleSubmit(e: Event) {
|
|
|
124
126
|
color: var(--smrt-color-on-surface-variant, #43474e);
|
|
125
127
|
}
|
|
126
128
|
|
|
127
|
-
input,
|
|
128
|
-
select {
|
|
129
|
-
padding: var(--smrt-spacing-sm, 0.5rem) var(--smrt-spacing-md, 0.75rem);
|
|
130
|
-
border: 1px solid var(--smrt-color-outline-variant, #c4c6cf);
|
|
131
|
-
border-radius: var(--smrt-radius-medium, 0.5rem);
|
|
132
|
-
font: var(--smrt-typography-body-medium-font, 0.875rem / 1.25 sans-serif);
|
|
133
|
-
transition: border-color var(--smrt-duration-short2, 150ms) var(--smrt-easing-standard, ease);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
input:focus,
|
|
137
|
-
select:focus {
|
|
138
|
-
outline: none;
|
|
139
|
-
border-color: var(--smrt-color-primary, #005ac1);
|
|
140
|
-
box-shadow: 0 0 0 3px var(--smrt-color-primary-container, rgba(0, 90, 193, 0.1));
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
input:disabled,
|
|
144
|
-
select:disabled {
|
|
145
|
-
background: var(--smrt-color-surface-container, #f3f4f6);
|
|
146
|
-
cursor: not-allowed;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
129
|
.hint {
|
|
150
130
|
font: var(--smrt-typography-body-small-font, 0.75rem / 1.25 sans-serif);
|
|
151
131
|
color: var(--smrt-color-on-surface-variant, #43474e);
|
|
@@ -157,11 +137,4 @@ function handleSubmit(e: Event) {
|
|
|
157
137
|
gap: var(--smrt-spacing-sm, 0.5rem);
|
|
158
138
|
margin-top: var(--smrt-spacing-sm, 0.5rem);
|
|
159
139
|
}
|
|
160
|
-
|
|
161
|
-
@media (prefers-reduced-motion: reduce) {
|
|
162
|
-
input,
|
|
163
|
-
select {
|
|
164
|
-
transition: none;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
140
|
</style>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserForm.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/UserForm.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"UserForm.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/UserForm.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAIvD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAItD,MAAM,WAAW,KAAK;IACpB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,UAAU,CAAA;KAAE,KAAK,IAAI,CAAC;IAC9E,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AA0GD,QAAA,MAAM,QAAQ,2CAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-users",
|
|
3
|
-
"version": "0.34.
|
|
3
|
+
"version": "0.34.8",
|
|
4
4
|
"description": "Multi-tenant user management for the SMRT framework - users, tenants, roles, permissions, groups",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"smrtRawPrimitives": "strict
|
|
6
|
+
"smrtRawPrimitives": "strict",
|
|
7
7
|
"main": "./dist/index.js",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
9
|
"exports": {
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@happyvertical/logger": "^0.74.7",
|
|
45
45
|
"jose": "^6.1.3",
|
|
46
|
-
"@happyvertical/smrt-config": "0.34.
|
|
47
|
-
"@happyvertical/smrt-
|
|
48
|
-
"@happyvertical/smrt-tenancy": "0.34.
|
|
49
|
-
"@happyvertical/smrt-
|
|
50
|
-
"@happyvertical/smrt-types": "0.34.
|
|
51
|
-
"@happyvertical/smrt-ui": "0.34.
|
|
46
|
+
"@happyvertical/smrt-config": "0.34.8",
|
|
47
|
+
"@happyvertical/smrt-core": "0.34.8",
|
|
48
|
+
"@happyvertical/smrt-tenancy": "0.34.8",
|
|
49
|
+
"@happyvertical/smrt-profiles": "0.34.8",
|
|
50
|
+
"@happyvertical/smrt-types": "0.34.8",
|
|
51
|
+
"@happyvertical/smrt-ui": "0.34.8"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@happyvertical/sql": "^0.74.7",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"typescript": "^5.9.3",
|
|
62
62
|
"vite": "^7.3.1",
|
|
63
63
|
"vitest": "^4.0.17",
|
|
64
|
-
"@happyvertical/smrt-vitest": "0.34.
|
|
64
|
+
"@happyvertical/smrt-vitest": "0.34.8"
|
|
65
65
|
},
|
|
66
66
|
"keywords": [
|
|
67
67
|
"smrt",
|