@hotosm/hanko-auth 0.3.5 → 0.4.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hotosm/hanko-auth",
3
- "version": "0.3.5",
3
+ "version": "0.4.1",
4
4
  "description": "Web component for HOTOSM SSO authentication with Hanko and OSM integration",
5
5
  "type": "module",
6
6
  "main": "dist/hanko-auth.umd.js",
@@ -46,11 +46,7 @@
46
46
  "@teamhanko/hanko-elements": "^1.0.0",
47
47
  "lit": "^3.3.1"
48
48
  },
49
- "peerDependencies": {
50
- "@awesome.me/webawesome": "^3.0.0-beta.1"
51
- },
52
49
  "devDependencies": {
53
- "@awesome.me/webawesome": "3.0.0-beta.1",
54
50
  "vite": "^5.0.0"
55
51
  }
56
52
  }
@@ -0,0 +1,406 @@
1
+ import { css } from "lit";
2
+
3
+ export const styles = css`
4
+ :host {
5
+ display: block;
6
+ font-family: var(--hot-font-sans);
7
+ }
8
+
9
+ .container {
10
+ max-width: 400px;
11
+ margin: 0 auto;
12
+ padding: var(--hot-spacing-large);
13
+ }
14
+
15
+ .loading {
16
+ text-align: center;
17
+ padding: var(--hot-spacing-3x-large);
18
+ color: var(--hot-color-gray-600);
19
+ }
20
+
21
+ .osm-connecting {
22
+ display: flex;
23
+ flex-direction: column;
24
+ align-items: center;
25
+ gap: var(--hot-spacing-small);
26
+ padding: var(--hot-spacing-large);
27
+ }
28
+
29
+ .spinner {
30
+ width: var(--hot-spacing-3x-large);
31
+ height: var(--hot-spacing-3x-large);
32
+ border: var(--hot-spacing-2x-small) solid var(--hot-color-gray-50);
33
+ border-top: var(--hot-spacing-2x-small) solid var(--hot-color-red-600);
34
+ border-radius: 50%;
35
+ animation: spin 1s linear infinite;
36
+ }
37
+ .spinner-small {
38
+ width: var(--hot-spacing-x-large);
39
+ height: var(--hot-spacing-x-large);
40
+ border: var(--hot-spacing-2x-small) solid var(--hot-color-gray-50);
41
+ border-top: var(--hot-spacing-2x-small) solid var(--hot-color-gray-600);
42
+ border-radius: 50%;
43
+ animation: spin 1s linear infinite;
44
+ }
45
+
46
+ @keyframes spin {
47
+ 0% {
48
+ transform: rotate(0deg);
49
+ }
50
+ 100% {
51
+ transform: rotate(360deg);
52
+ }
53
+ }
54
+
55
+ .connecting-text {
56
+ font-size: var(--hot-font-size-small);
57
+ color: var(--hot-color-gray-600);
58
+ font-weight: var(--hot-font-weight-semibold);
59
+ }
60
+
61
+ button {
62
+ width: 100%;
63
+ padding: 12px 20px;
64
+ border: none;
65
+ border-radius: 6px;
66
+ font-size: 14px;
67
+ font-weight: 500;
68
+ cursor: pointer;
69
+ transition: all 0.2s;
70
+ }
71
+
72
+ .btn-primary {
73
+ background: var(--hot-color-red-700);
74
+ color: white;
75
+ }
76
+
77
+ .btn-primary:hover {
78
+ background: var(--hot-color-gray-600);
79
+ }
80
+
81
+ .btn-secondary {
82
+ border: 1px solid var(--hot-color-gray-700);
83
+ border-radius: var(--hot-border-radius-medium);
84
+ background-color: white;
85
+ color: var(--hot-color-gray-700);
86
+ margin-top: 8px;
87
+ }
88
+
89
+ .btn-secondary:hover {
90
+ background: var(--hot-color-gray-50);
91
+ }
92
+
93
+ .error {
94
+ background: var(--hot-color-red-50);
95
+ border: var(--hot-border-width, 1px) solid var(--hot-color-red-200);
96
+ border-radius: var(--hot-border-radius-medium);
97
+ padding: var(--hot-spacing-small);
98
+ color: var(--hot-color-red-700);
99
+ margin-bottom: var(--hot-spacing-medium);
100
+ }
101
+
102
+ .profile {
103
+ background: var(--hot-color-gray-50);
104
+ border-radius: var(--hot-border-radius-large);
105
+ padding: var(--hot-spacing-large);
106
+ margin-bottom: var(--hot-spacing-medium);
107
+ }
108
+
109
+ .profile-header {
110
+ display: flex;
111
+ align-items: center;
112
+ gap: var(--hot-spacing-small);
113
+ margin-bottom: var(--hot-spacing-medium);
114
+ }
115
+
116
+ .profile-avatar {
117
+ width: var(--hot-spacing-3x-large);
118
+ height: var(--hot-spacing-3x-large);
119
+ border-radius: 50%;
120
+ background: var(--hot-color-gray-200);
121
+ display: flex;
122
+ align-items: center;
123
+ justify-content: center;
124
+ font-size: var(--hot-font-size-large);
125
+ font-weight: var(--hot-font-weight-bold);
126
+ color: var(--hot-color-gray-600);
127
+ }
128
+
129
+ .profile-info {
130
+ padding: var(--hot-spacing-x-small) var(--hot-spacing-medium);
131
+ }
132
+
133
+ .profile-email {
134
+ font-size: var(--hot-font-size-small);
135
+ font-weight: var(--hot-font-weight-bold);
136
+ }
137
+
138
+ .osm-section {
139
+ border-top: var(--hot-border-width, 1px) solid var(--hot-color-gray-100);
140
+ padding-top: var(--hot-spacing-medium);
141
+ padding-bottom: var(--hot-spacing-small);
142
+ margin-top: var(--hot-spacing-medium);
143
+ text-align: center;
144
+ }
145
+
146
+ .osm-connected {
147
+ display: flex;
148
+ align-items: center;
149
+ justify-content: center;
150
+ padding: var(--hot-spacing-small);
151
+ background: linear-gradient(
152
+ 135deg,
153
+ var(--hot-color-success-50) 0%,
154
+ var(--hot-color-success-50) 100%
155
+ );
156
+ border-radius: var(--hot-border-radius-large);
157
+ border: var(--hot-border-width, 1px) solid var(--hot-color-success-200);
158
+ }
159
+
160
+ .osm-badge {
161
+ display: flex;
162
+ align-items: center;
163
+ gap: var(--hot-spacing-x-small);
164
+ color: var(--hot-color-success-800);
165
+ font-weight: var(--hot-font-weight-semibold);
166
+ font-size: var(--hot-font-size-small);
167
+ text-align: left;
168
+ }
169
+
170
+ .osm-badge-icon {
171
+ font-size: var(--hot-font-size-medium);
172
+ }
173
+
174
+ .osm-username {
175
+ font-size: var(--hot-font-size-x-small);
176
+ color: var(--hot-color-success-700);
177
+ margin-top: var(--hot-spacing-2x-small);
178
+ }
179
+
180
+ .osm-prompt-title {
181
+ font-weight: var(--hot-font-weight-semibold);
182
+ font-size: var(--hot-font-size-medium);
183
+ margin-bottom: var(--hot-spacing-small);
184
+ color: var(--hot-color-gray-900);
185
+ text-align: center;
186
+ }
187
+
188
+ .osm-prompt-text {
189
+ font-size: var(--hot-font-size-small);
190
+ color: var(--hot-color-gray-600);
191
+ margin-bottom: var(--hot-spacing-medium);
192
+ line-height: var(--hot-line-height-normal);
193
+ text-align: center;
194
+ }
195
+
196
+ .osm-status-badge {
197
+ position: absolute;
198
+ top: 2px;
199
+ right: 2px;
200
+ width: var(--hot-font-size-small);
201
+ height: var(--hot-font-size-small);
202
+ border-radius: 50%;
203
+ border: var(--hot-spacing-3x-small) solid white;
204
+ display: flex;
205
+ align-items: center;
206
+ justify-content: center;
207
+ font-size: var(--hot-font-size-2x-small);
208
+ color: white;
209
+ font-weight: var(--hot-font-weight-bold);
210
+ }
211
+
212
+ .osm-status-badge.connected {
213
+ background-color: var(--hot-color-success-600);
214
+ }
215
+
216
+ .osm-status-badge.required {
217
+ background-color: var(--hot-color-warning-600);
218
+ }
219
+ .header-avatar {
220
+ width: var(--hot-spacing-2x-large);
221
+ height: var(--hot-spacing-2x-large);
222
+ border-radius: 50%;
223
+ background: var(--hot-color-gray-800);
224
+ display: inline-flex;
225
+ align-items: center;
226
+ justify-content: center;
227
+ font-size: var(--hot-font-size-small);
228
+ font-weight: var(--hot-font-weight-semibold);
229
+ color: white;
230
+ }
231
+
232
+ .login-link {
233
+ color: white;
234
+ font-size: var(--hot-font-size-medium);
235
+ border-radius: var(--hot-border-radius-medium);
236
+ text-decoration: none;
237
+ padding: var(--hot-spacing-x-small) var(--hot-spacing-medium);
238
+ display: inline-block;
239
+ cursor: pointer;
240
+ transition: all 0.2s;
241
+ font-weight: var(--hot-font-weight-medium);
242
+ }
243
+
244
+ /* Button variants - filled */
245
+ .login-link.filled {
246
+ border: none;
247
+ }
248
+ .login-link.filled.primary {
249
+ background: var(--hot-color-primary-1000);
250
+ color: white;
251
+ }
252
+ .login-link.filled.primary:hover {
253
+ background: var(--hot-color-primary-900);
254
+ }
255
+ .login-link.filled.neutral {
256
+ background: var(--hot-color-neutral-600);
257
+ color: white;
258
+ }
259
+ .login-link.filled.neutral:hover {
260
+ background: var(--hot-color-neutral-700);
261
+ }
262
+ .login-link.filled.danger {
263
+ background: var(--hot-color-red-600);
264
+ color: white;
265
+ }
266
+ .login-link.filled.danger:hover {
267
+ background: var(--hot-color-red-700);
268
+ }
269
+
270
+ /* Button variants - outline */
271
+ .login-link.outline {
272
+ background: transparent;
273
+ border: 1px solid;
274
+ }
275
+ .login-link.outline.primary {
276
+ border-color: var(--hot-color-primary-1000);
277
+ color: var(--hot-color-primary-1000);
278
+ }
279
+ .login-link.outline.primary:hover {
280
+ background: var(--hot-color-primary-50);
281
+ }
282
+ .login-link.outline.neutral {
283
+ border-color: var(--hot-color-neutral-700);
284
+ color: var(--hot-color-neutral-700);
285
+ }
286
+ .login-link.outline.neutral:hover {
287
+ background: var(--hot-color-neutral-50);
288
+ }
289
+ .login-link.outline.danger {
290
+ border-color: var(--hot-color-red-600);
291
+ color: var(--hot-color-red-600);
292
+ }
293
+ .login-link.outline.danger:hover {
294
+ background: var(--hot-color-red-50);
295
+ }
296
+
297
+ /* Button variants - plain */
298
+ .login-link.plain {
299
+ background: transparent;
300
+ border: none;
301
+ padding: var(--hot-spacing-x-small) var(--hot-spacing-medium);
302
+ }
303
+ .login-link.plain.primary {
304
+ color: var(--hot-color-primary-1000);
305
+ }
306
+ .login-link.plain.primary:hover {
307
+ background: var(--hot-color-primary-50);
308
+ }
309
+ .login-link.plain.neutral {
310
+ color: var(--hot-color-neutral-700);
311
+ }
312
+ .login-link.plain.neutral:hover {
313
+ background: var(--hot-color-neutral-50);
314
+ }
315
+ .login-link.plain.danger {
316
+ color: var(--hot-color-red-600);
317
+ }
318
+ .login-link.plain.danger:hover {
319
+ background: var(--hot-color-red-50);
320
+ }
321
+ /* Dropdown styles */
322
+ .dropdown {
323
+ position: relative;
324
+ display: inline-block;
325
+ }
326
+ .dropdown-trigger {
327
+ background: none;
328
+ border: none;
329
+ padding: var(--hot-spacing-x-small);
330
+ cursor: pointer;
331
+ position: relative;
332
+ }
333
+
334
+ .dropdown-trigger:hover,
335
+ .dropdown-trigger:active,
336
+ .dropdown-trigger:focus {
337
+ background: none;
338
+ outline: none;
339
+ }
340
+ .dropdown-content {
341
+ position: absolute;
342
+ right: 0;
343
+ background: white;
344
+ border: 1px solid var(--hot-color-gray-100);
345
+ border-radius: var(--hot-border-radius-medium);
346
+ z-index: 1000;
347
+ opacity: 0;
348
+ visibility: hidden;
349
+ transform: translateY(-10px);
350
+ transition:
351
+ opacity 0.2s ease,
352
+ visibility 0.2s ease,
353
+ transform 0.2s ease;
354
+ }
355
+ @media (max-width: 768px) {
356
+ .dropdown-content {
357
+ position: fixed;
358
+ width: 100%;
359
+ }
360
+ }
361
+
362
+ .dropdown-content.open {
363
+ opacity: 1;
364
+ visibility: visible;
365
+ transform: translateY(0);
366
+ }
367
+
368
+ .dropdown-content button {
369
+ display: flex;
370
+ align-items: center;
371
+ width: 100%;
372
+ padding: var(--hot-spacing-small) var(--hot-spacing-medium);
373
+ background: none;
374
+ border: none;
375
+ cursor: pointer;
376
+ text-align: left;
377
+ transition: background-color 0.2s ease;
378
+ gap: var(--hot-spacing-small);
379
+ font-size: var(--hot-font-size-small);
380
+ color: var(--hot-color-gray-900);
381
+ }
382
+
383
+ .dropdown-content button:hover {
384
+ background-color: var(--hot-color-gray-50);
385
+ }
386
+
387
+ .dropdown-content button:focus {
388
+ background-color: var(--hot-color-gray-50);
389
+ outline: 2px solid var(--hot-color-gray-500);
390
+ outline-offset: -2px;
391
+ }
392
+
393
+ .dropdown-content .profile-info {
394
+ padding: var(--hot-spacing-small) var(--hot-spacing-medium);
395
+ }
396
+
397
+ .dropdown-content .profile-email {
398
+ font-size: var(--hot-font-size-small);
399
+ font-weight: var(--hot-font-weight-bold);
400
+ }
401
+
402
+ .icon {
403
+ width: 20px;
404
+ height: 20px;
405
+ }
406
+ `;