@singlebase/elements 0.1.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/LICENSE +21 -0
- package/README.md +29 -0
- package/dist/authui.cjs +2 -0
- package/dist/authui.cjs.map +1 -0
- package/dist/authui.d.ts +22 -0
- package/dist/authui.js +24 -0
- package/dist/authui.js.map +1 -0
- package/dist/controllers/auth-controller.d.ts +17 -0
- package/dist/controllers/event-bridge.d.ts +27 -0
- package/dist/controllers/settings-controller.d.ts +18 -0
- package/dist/display-8HEcKYR4.js +3444 -0
- package/dist/display-8HEcKYR4.js.map +1 -0
- package/dist/display-CLDNNZQy.cjs +976 -0
- package/dist/display-CLDNNZQy.cjs.map +1 -0
- package/dist/elements/account-screen.d.ts +99 -0
- package/dist/elements/auth-screen.d.ts +215 -0
- package/dist/elements/base.d.ts +69 -0
- package/dist/elements/buttons.d.ts +45 -0
- package/dist/elements/display.d.ts +51 -0
- package/dist/elements/form-base.d.ts +23 -0
- package/dist/elements/guard.d.ts +65 -0
- package/dist/elements/uploader.d.ts +225 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/dist/messages.d.ts +147 -0
- package/dist/singlebase-elements.min.js +7616 -0
- package/dist/singlebase-elements.min.js.map +1 -0
- package/dist/standalone.d.ts +2 -0
- package/dist/styles/shared.d.ts +8 -0
- package/dist/styles/tokens.d.ts +44 -0
- package/dist/upload-messages.d.ts +45 -0
- package/dist/uploader-D-Da1trc.js +2290 -0
- package/dist/uploader-D-Da1trc.js.map +1 -0
- package/dist/uploader-eFYKpk8b.cjs +1390 -0
- package/dist/uploader-eFYKpk8b.cjs.map +1 -0
- package/dist/uploader.cjs +2 -0
- package/dist/uploader.cjs.map +1 -0
- package/dist/uploader.d.ts +10 -0
- package/dist/uploader.js +9 -0
- package/dist/uploader.js.map +1 -0
- package/dist/utils/files.d.ts +38 -0
- package/dist/utils/inspect.d.ts +23 -0
- package/dist/utils/profile.d.ts +9 -0
- package/dist/utils/redirect.d.ts +15 -0
- package/package.json +76 -0
|
@@ -0,0 +1,1390 @@
|
|
|
1
|
+
"use strict";var ue=t=>{throw TypeError(t)};var fe=(t,a,e)=>a.has(t)||ue("Cannot "+e);var d=(t,a,e)=>(fe(t,a,"read from private field"),e?e.call(t):a.get(t)),c=(t,a,e)=>a.has(t)?ue("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,e),p=(t,a,e,r)=>(fe(t,a,"write to private field"),r?r.call(t,e):a.set(t,e),e);const n=require("lit"),u=require("lit/decorators.js"),Me=require("@singlebase/core"),ne={font:'"Geist", -apple-system, "Segoe UI", Helvetica, sans-serif',mono:'"Geist Mono", ui-monospace, monospace',accent:"#111111",onAccent:"#ffffff",radius:"4px",surface:"#ffffff",surfaceAlt:"#fafafa",ink:"#16181a",mutedInk:"#61666c",border:"#e4e6e9",borderStrong:"#cdd1d6",danger:"#b4231a",dangerBg:"#fdf1f0",dangerBorder:"#f3d6d3",dangerOutline:"#e8c4c0",dangerPanelBorder:"#efd9d6",dangerPanelBg:"#fdf7f6",ok:"#0f6b4a",okBg:"#f0f7f3",okBorder:"#cfe5da",gap:"16px",pad:"20px",fieldPad:"11px 13px"},me=n.css`
|
|
2
|
+
:host {
|
|
3
|
+
display: block;
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
font-family: var(--sb-font, ${n.unsafeCSS(ne.font)});
|
|
6
|
+
color: var(--sb-ink, ${n.unsafeCSS(ne.ink)});
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
:host([theme="dark"]) {
|
|
10
|
+
/* The light default accent is near-black, which disappears on a dark
|
|
11
|
+
surface — primary buttons and links both use it. A host that sets its
|
|
12
|
+
own --sb-accent still wins: outer-page declarations beat :host rules. */
|
|
13
|
+
--sb-accent: #f3f4f5;
|
|
14
|
+
--sb-on-accent: #17181b;
|
|
15
|
+
--sb-surface: #17181b;
|
|
16
|
+
--sb-surface-alt: #202226;
|
|
17
|
+
--sb-ink: #f3f4f5;
|
|
18
|
+
--sb-muted-ink: #a2a8ae;
|
|
19
|
+
--sb-border: #2c2f34;
|
|
20
|
+
--sb-border-strong: #3a3e44;
|
|
21
|
+
--sb-danger: #f08379;
|
|
22
|
+
--sb-danger-bg: rgba(240, 131, 121, 0.1);
|
|
23
|
+
--sb-danger-border: rgba(240, 131, 121, 0.3);
|
|
24
|
+
--sb-danger-outline: rgba(240, 131, 121, 0.4);
|
|
25
|
+
--sb-danger-panel-border: rgba(240, 131, 121, 0.3);
|
|
26
|
+
--sb-danger-panel-bg: rgba(240, 131, 121, 0.06);
|
|
27
|
+
--sb-ok: #6fd1a6;
|
|
28
|
+
--sb-ok-bg: rgba(111, 209, 166, 0.1);
|
|
29
|
+
--sb-ok-border: rgba(111, 209, 166, 0.28);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:host([density="compact"]) {
|
|
33
|
+
--sb-gap: 12px;
|
|
34
|
+
--sb-pad: 16px;
|
|
35
|
+
--sb-field-pad: 9px 11px;
|
|
36
|
+
}
|
|
37
|
+
`,xe=n.css`
|
|
38
|
+
/* ── layout primitives ───────────────────────────────────── */
|
|
39
|
+
.stack {
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
gap: var(--sb-gap, 16px);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.fields {
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
gap: var(--sb-gap, 16px);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.head {
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
gap: 6px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.two-up {
|
|
58
|
+
display: grid;
|
|
59
|
+
grid-template-columns: 1fr 1fr;
|
|
60
|
+
gap: var(--sb-gap, 16px);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.actions {
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
gap: 8px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.rule {
|
|
70
|
+
height: 1px;
|
|
71
|
+
background: var(--sb-border, #e4e6e9);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.between {
|
|
75
|
+
display: flex;
|
|
76
|
+
align-items: flex-start;
|
|
77
|
+
justify-content: space-between;
|
|
78
|
+
gap: 16px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* ── type ────────────────────────────────────────────────── */
|
|
82
|
+
.logo-dot {
|
|
83
|
+
font-family: var(--sb-mono, "Geist Mono", ui-monospace, monospace);
|
|
84
|
+
font-size: 12px;
|
|
85
|
+
letter-spacing: 0.08em;
|
|
86
|
+
text-transform: uppercase;
|
|
87
|
+
color: var(--sb-muted-ink, #61666c);
|
|
88
|
+
margin-bottom: 6px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.title {
|
|
92
|
+
margin: 0;
|
|
93
|
+
font-size: 20px;
|
|
94
|
+
font-weight: 600;
|
|
95
|
+
letter-spacing: -0.015em;
|
|
96
|
+
color: var(--sb-ink, #16181a);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.sub {
|
|
100
|
+
margin: 0;
|
|
101
|
+
font-size: 13.5px;
|
|
102
|
+
line-height: 1.5;
|
|
103
|
+
color: var(--sb-muted-ink, #61666c);
|
|
104
|
+
text-wrap: pretty;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.sec-title {
|
|
108
|
+
margin: 0;
|
|
109
|
+
font-size: 14px;
|
|
110
|
+
font-weight: 600;
|
|
111
|
+
letter-spacing: -0.01em;
|
|
112
|
+
color: var(--sb-ink, #16181a);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.hint {
|
|
116
|
+
margin: 0;
|
|
117
|
+
font-size: 12.5px;
|
|
118
|
+
line-height: 1.5;
|
|
119
|
+
color: var(--sb-muted-ink, #61666c);
|
|
120
|
+
text-wrap: pretty;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.sub-label {
|
|
124
|
+
font-family: var(--sb-mono, "Geist Mono", ui-monospace, monospace);
|
|
125
|
+
font-size: 11px;
|
|
126
|
+
letter-spacing: 0.07em;
|
|
127
|
+
text-transform: uppercase;
|
|
128
|
+
color: var(--sb-muted-ink, #61666c);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* ── fields ──────────────────────────────────────────────── */
|
|
132
|
+
.field {
|
|
133
|
+
display: flex;
|
|
134
|
+
flex-direction: column;
|
|
135
|
+
gap: 6px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.label-row {
|
|
139
|
+
display: flex;
|
|
140
|
+
align-items: baseline;
|
|
141
|
+
justify-content: space-between;
|
|
142
|
+
gap: 8px;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
label,
|
|
146
|
+
.label {
|
|
147
|
+
font-size: 12.5px;
|
|
148
|
+
font-weight: 500;
|
|
149
|
+
color: var(--sb-muted-ink, #61666c);
|
|
150
|
+
letter-spacing: 0.01em;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
input {
|
|
154
|
+
width: 100%;
|
|
155
|
+
box-sizing: border-box;
|
|
156
|
+
font: inherit;
|
|
157
|
+
font-size: 14px;
|
|
158
|
+
color: var(--sb-ink, #16181a);
|
|
159
|
+
background: var(--sb-surface-alt, #fafafa);
|
|
160
|
+
border: 1px solid var(--sb-border, #e4e6e9);
|
|
161
|
+
border-radius: var(--sb-radius, 4px);
|
|
162
|
+
padding: var(--sb-field-pad, 11px 13px);
|
|
163
|
+
outline: none;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
input:focus {
|
|
167
|
+
border-color: var(--sb-accent, #111111);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
input[aria-invalid="true"] {
|
|
171
|
+
border-color: var(--sb-danger, #b4231a);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/* field-style="underline" — code boxes keep their box, they read as cells */
|
|
175
|
+
:host([field-style="underline"]) *:not(.code-row):not(.code-row-sm) > input {
|
|
176
|
+
background: transparent;
|
|
177
|
+
border: none;
|
|
178
|
+
border-bottom: 1px solid var(--sb-border-strong, #cdd1d6);
|
|
179
|
+
border-radius: 0;
|
|
180
|
+
padding: 9px 2px;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
p.err {
|
|
184
|
+
margin: 0;
|
|
185
|
+
font-size: 12.5px;
|
|
186
|
+
color: var(--sb-danger, #b4231a);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/* ── code entry ──────────────────────────────────────────── */
|
|
190
|
+
.code-row {
|
|
191
|
+
display: grid;
|
|
192
|
+
grid-template-columns: repeat(6, 1fr);
|
|
193
|
+
gap: 8px;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.code-row input {
|
|
197
|
+
text-align: center;
|
|
198
|
+
font-family: var(--sb-mono, "Geist Mono", ui-monospace, monospace);
|
|
199
|
+
font-size: 18px;
|
|
200
|
+
padding: 12px 0;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.code-row-sm {
|
|
204
|
+
display: grid;
|
|
205
|
+
grid-template-columns: repeat(6, 1fr);
|
|
206
|
+
gap: 6px;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.code-row-sm input {
|
|
210
|
+
text-align: center;
|
|
211
|
+
font-family: var(--sb-mono, "Geist Mono", ui-monospace, monospace);
|
|
212
|
+
font-size: 14px;
|
|
213
|
+
padding: 8px 0;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.resend-row {
|
|
217
|
+
display: flex;
|
|
218
|
+
align-items: baseline;
|
|
219
|
+
gap: 8px;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/* ── buttons ─────────────────────────────────────────────── */
|
|
223
|
+
button {
|
|
224
|
+
display: inline-flex;
|
|
225
|
+
align-items: center;
|
|
226
|
+
justify-content: center;
|
|
227
|
+
gap: 8px;
|
|
228
|
+
font: inherit;
|
|
229
|
+
font-size: 13.5px;
|
|
230
|
+
font-weight: 500;
|
|
231
|
+
border-radius: var(--sb-radius, 4px);
|
|
232
|
+
cursor: pointer;
|
|
233
|
+
padding: 9px 14px;
|
|
234
|
+
border: 1px solid transparent;
|
|
235
|
+
transition:
|
|
236
|
+
background 0.15s,
|
|
237
|
+
border-color 0.15s,
|
|
238
|
+
filter 0.15s,
|
|
239
|
+
color 0.15s;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
button:disabled {
|
|
243
|
+
cursor: not-allowed;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
button.primary {
|
|
247
|
+
background: var(--sb-accent, #111111);
|
|
248
|
+
color: var(--sb-on-accent, #ffffff);
|
|
249
|
+
width: 100%;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
button.primary:hover:not(:disabled) {
|
|
253
|
+
filter: brightness(0.92);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
button.primary-sm {
|
|
257
|
+
background: var(--sb-accent, #111111);
|
|
258
|
+
color: var(--sb-on-accent, #ffffff);
|
|
259
|
+
padding: 7px 12px;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
button.primary-sm:hover:not(:disabled) {
|
|
263
|
+
filter: brightness(0.92);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
button.ghost {
|
|
267
|
+
background: transparent;
|
|
268
|
+
color: var(--sb-muted-ink, #61666c);
|
|
269
|
+
border: 1px solid var(--sb-border, #e4e6e9);
|
|
270
|
+
width: 100%;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
button.ghost-sm {
|
|
274
|
+
background: transparent;
|
|
275
|
+
color: var(--sb-muted-ink, #61666c);
|
|
276
|
+
border: 1px solid var(--sb-border, #e4e6e9);
|
|
277
|
+
padding: 7px 12px;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
button.ghost:hover:not(:disabled),
|
|
281
|
+
button.ghost-sm:hover:not(:disabled) {
|
|
282
|
+
background: var(--sb-surface-alt, #fafafa);
|
|
283
|
+
color: var(--sb-ink, #16181a);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
button.secondary {
|
|
287
|
+
background: var(--sb-surface, #ffffff);
|
|
288
|
+
color: var(--sb-ink, #16181a);
|
|
289
|
+
border: 1px solid var(--sb-border-strong, #cdd1d6);
|
|
290
|
+
padding: 7px 12px;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
button.secondary:hover:not(:disabled) {
|
|
294
|
+
background: var(--sb-surface-alt, #fafafa);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
button.link {
|
|
298
|
+
font: inherit;
|
|
299
|
+
font-size: 13px;
|
|
300
|
+
font-weight: 500;
|
|
301
|
+
color: var(--sb-accent, #111111);
|
|
302
|
+
background: none;
|
|
303
|
+
border: none;
|
|
304
|
+
padding: 0;
|
|
305
|
+
cursor: pointer;
|
|
306
|
+
text-decoration: underline;
|
|
307
|
+
text-underline-offset: 3px;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
button.link-sm {
|
|
311
|
+
font: inherit;
|
|
312
|
+
font-size: 12.5px;
|
|
313
|
+
font-weight: 400;
|
|
314
|
+
color: var(--sb-muted-ink, #61666c);
|
|
315
|
+
background: none;
|
|
316
|
+
border: none;
|
|
317
|
+
padding: 0;
|
|
318
|
+
cursor: pointer;
|
|
319
|
+
text-decoration: underline;
|
|
320
|
+
text-underline-offset: 3px;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/* the mock's editLink: a muted underlined affordance that inks on hover */
|
|
324
|
+
button.edit-link {
|
|
325
|
+
align-self: flex-start;
|
|
326
|
+
font: inherit;
|
|
327
|
+
font-size: 12.5px;
|
|
328
|
+
font-weight: 400;
|
|
329
|
+
color: var(--sb-muted-ink, #61666c);
|
|
330
|
+
background: none;
|
|
331
|
+
border: none;
|
|
332
|
+
padding: 0;
|
|
333
|
+
cursor: pointer;
|
|
334
|
+
text-decoration: underline;
|
|
335
|
+
text-underline-offset: 3px;
|
|
336
|
+
transition: color 0.15s;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
button.edit-link:hover:not(:disabled) {
|
|
340
|
+
color: var(--sb-ink, #16181a);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
button.edit-link:disabled {
|
|
344
|
+
opacity: 0.4;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
button.danger-link {
|
|
348
|
+
align-self: flex-start;
|
|
349
|
+
font: inherit;
|
|
350
|
+
font-size: 12.5px;
|
|
351
|
+
font-weight: 400;
|
|
352
|
+
color: var(--sb-muted-ink, #61666c);
|
|
353
|
+
background: none;
|
|
354
|
+
border: none;
|
|
355
|
+
padding: 0;
|
|
356
|
+
cursor: pointer;
|
|
357
|
+
text-decoration: underline;
|
|
358
|
+
text-underline-offset: 3px;
|
|
359
|
+
transition: color 0.15s;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
button.danger-link:hover:not(:disabled) {
|
|
363
|
+
color: var(--sb-danger, #b4231a);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
button.danger {
|
|
367
|
+
padding: 7px 12px;
|
|
368
|
+
background: transparent;
|
|
369
|
+
color: var(--sb-danger, #b4231a);
|
|
370
|
+
border: 1px solid var(--sb-danger-outline, #e8c4c0);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
button.danger:hover:not(:disabled) {
|
|
374
|
+
background: var(--sb-danger-bg, #fdf1f0);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
button.danger:disabled {
|
|
378
|
+
opacity: 0.45;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.btn-row {
|
|
382
|
+
display: flex;
|
|
383
|
+
align-items: center;
|
|
384
|
+
gap: 8px;
|
|
385
|
+
flex-wrap: wrap;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.btn-row-end {
|
|
389
|
+
display: flex;
|
|
390
|
+
align-items: center;
|
|
391
|
+
justify-content: flex-end;
|
|
392
|
+
gap: 12px;
|
|
393
|
+
flex-wrap: wrap;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.edit-actions {
|
|
397
|
+
display: flex;
|
|
398
|
+
gap: 8px;
|
|
399
|
+
padding-top: 2px;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/* ── feedback ────────────────────────────────────────────── */
|
|
403
|
+
.banner,
|
|
404
|
+
.notice {
|
|
405
|
+
font-size: 13px;
|
|
406
|
+
line-height: 1.45;
|
|
407
|
+
border-radius: var(--sb-radius, 4px);
|
|
408
|
+
padding: 10px 12px;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
.banner {
|
|
412
|
+
color: var(--sb-danger, #b4231a);
|
|
413
|
+
background: var(--sb-danger-bg, #fdf1f0);
|
|
414
|
+
border: 1px solid var(--sb-danger-border, #f3d6d3);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
.notice {
|
|
418
|
+
color: var(--sb-ok, #0f6b4a);
|
|
419
|
+
background: var(--sb-ok-bg, #f0f7f3);
|
|
420
|
+
border: 1px solid var(--sb-ok-border, #cfe5da);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
.saved-note {
|
|
424
|
+
font-size: 12.5px;
|
|
425
|
+
font-weight: 500;
|
|
426
|
+
color: var(--sb-ok, #0f6b4a);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.spinner {
|
|
430
|
+
width: 13px;
|
|
431
|
+
height: 13px;
|
|
432
|
+
border: 2px solid rgba(255, 255, 255, 0.4);
|
|
433
|
+
border-top-color: var(--sb-on-accent, #ffffff);
|
|
434
|
+
border-radius: 50%;
|
|
435
|
+
animation: sb-spin 0.7s linear infinite;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
@keyframes sb-spin {
|
|
439
|
+
to {
|
|
440
|
+
transform: rotate(360deg);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.sr-only {
|
|
445
|
+
position: absolute;
|
|
446
|
+
width: 1px;
|
|
447
|
+
height: 1px;
|
|
448
|
+
overflow: hidden;
|
|
449
|
+
clip: rect(0 0 0 0);
|
|
450
|
+
white-space: nowrap;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/* ── step bar ────────────────────────────────────────────── */
|
|
454
|
+
.step-bar {
|
|
455
|
+
height: 3px;
|
|
456
|
+
background: var(--sb-border, #e4e6e9);
|
|
457
|
+
border-radius: 99px;
|
|
458
|
+
overflow: hidden;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
.step-fill {
|
|
462
|
+
height: 100%;
|
|
463
|
+
background: var(--sb-accent, #111111);
|
|
464
|
+
transition: width 0.3s;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/* ── footer link row ─────────────────────────────────────── */
|
|
468
|
+
.foot {
|
|
469
|
+
margin: 0;
|
|
470
|
+
display: flex;
|
|
471
|
+
gap: 6px;
|
|
472
|
+
justify-content: center;
|
|
473
|
+
font-size: 13px;
|
|
474
|
+
color: var(--sb-muted-ink, #61666c);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
/* ── oauth ───────────────────────────────────────────────── */
|
|
478
|
+
.oauth-primary {
|
|
479
|
+
background: var(--sb-surface, #ffffff);
|
|
480
|
+
color: var(--sb-ink, #16181a);
|
|
481
|
+
border: 1px solid var(--sb-border-strong, #cdd1d6);
|
|
482
|
+
width: 100%;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
.oauth-primary:hover:not(:disabled) {
|
|
486
|
+
background: var(--sb-surface-alt, #fafafa);
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
.g-mark {
|
|
490
|
+
font-family: var(--sb-mono, "Geist Mono", ui-monospace, monospace);
|
|
491
|
+
font-weight: 500;
|
|
492
|
+
font-size: 13px;
|
|
493
|
+
color: var(--sb-muted-ink, #61666c);
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
.icon-row {
|
|
497
|
+
display: grid;
|
|
498
|
+
grid-template-columns: repeat(3, 1fr);
|
|
499
|
+
gap: 8px;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
.icon-btn {
|
|
503
|
+
padding: 7px 0;
|
|
504
|
+
background: var(--sb-surface, #ffffff);
|
|
505
|
+
color: var(--sb-muted-ink, #61666c);
|
|
506
|
+
border: 1px solid var(--sb-border, #e4e6e9);
|
|
507
|
+
font-family: var(--sb-mono, "Geist Mono", ui-monospace, monospace);
|
|
508
|
+
font-size: 13px;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
.icon-btn:hover:not(:disabled) {
|
|
512
|
+
background: var(--sb-surface-alt, #fafafa);
|
|
513
|
+
color: var(--sb-ink, #16181a);
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
/* ── accordion (method picker) ───────────────────────────── */
|
|
517
|
+
.acc-wrap {
|
|
518
|
+
display: flex;
|
|
519
|
+
flex-direction: column;
|
|
520
|
+
gap: 8px;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
.acc-item {
|
|
524
|
+
border: 1px solid var(--sb-border, #e4e6e9);
|
|
525
|
+
border-radius: var(--sb-radius, 4px);
|
|
526
|
+
overflow: hidden;
|
|
527
|
+
background: transparent;
|
|
528
|
+
transition:
|
|
529
|
+
border-color 0.2s,
|
|
530
|
+
background 0.2s;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
.acc-item.open {
|
|
534
|
+
border-color: var(--sb-border-strong, #cdd1d6);
|
|
535
|
+
background: var(--sb-surface, #ffffff);
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
.acc-item.bare {
|
|
539
|
+
border: none;
|
|
540
|
+
background: transparent;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
.acc-head {
|
|
544
|
+
display: flex;
|
|
545
|
+
align-items: center;
|
|
546
|
+
gap: 10px;
|
|
547
|
+
width: 100%;
|
|
548
|
+
box-sizing: border-box;
|
|
549
|
+
font: inherit;
|
|
550
|
+
text-align: left;
|
|
551
|
+
background: transparent;
|
|
552
|
+
border: none;
|
|
553
|
+
border-radius: 0;
|
|
554
|
+
padding: 11px 12px;
|
|
555
|
+
cursor: pointer;
|
|
556
|
+
color: var(--sb-ink, #16181a);
|
|
557
|
+
transition: background 0.15s;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
.acc-head:hover {
|
|
561
|
+
background: var(--sb-surface-alt, #fafafa);
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
.chev {
|
|
565
|
+
font-family: var(--sb-mono, "Geist Mono", ui-monospace, monospace);
|
|
566
|
+
font-size: 13px;
|
|
567
|
+
color: var(--sb-muted-ink, #61666c);
|
|
568
|
+
line-height: 1;
|
|
569
|
+
transform: rotate(0deg);
|
|
570
|
+
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
.acc-item.open .chev {
|
|
574
|
+
transform: rotate(90deg);
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
.acc-title {
|
|
578
|
+
font-size: 13.5px;
|
|
579
|
+
font-weight: 500;
|
|
580
|
+
color: var(--sb-ink, #16181a);
|
|
581
|
+
letter-spacing: -0.005em;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
.acc-meta {
|
|
585
|
+
font-size: 12px;
|
|
586
|
+
color: var(--sb-muted-ink, #61666c);
|
|
587
|
+
margin-left: auto;
|
|
588
|
+
overflow: hidden;
|
|
589
|
+
text-overflow: ellipsis;
|
|
590
|
+
white-space: nowrap;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
.acc-body {
|
|
594
|
+
display: grid;
|
|
595
|
+
grid-template-rows: 0fr;
|
|
596
|
+
opacity: 0;
|
|
597
|
+
transition:
|
|
598
|
+
grid-template-rows 0.28s cubic-bezier(0.32, 0.72, 0, 1),
|
|
599
|
+
opacity 0.16s ease;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
.acc-item.open .acc-body {
|
|
603
|
+
grid-template-rows: 1fr;
|
|
604
|
+
opacity: 1;
|
|
605
|
+
transition:
|
|
606
|
+
grid-template-rows 0.34s cubic-bezier(0.32, 0.72, 0, 1),
|
|
607
|
+
opacity 0.26s ease 0.06s;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
.acc-clip {
|
|
611
|
+
overflow: hidden;
|
|
612
|
+
min-height: 0;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
.acc-inner {
|
|
616
|
+
display: flex;
|
|
617
|
+
flex-direction: column;
|
|
618
|
+
gap: var(--sb-gap, 16px);
|
|
619
|
+
padding: 2px 12px 14px;
|
|
620
|
+
transform: translateY(-4px);
|
|
621
|
+
transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
.acc-item.open .acc-inner {
|
|
625
|
+
transform: translateY(0);
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
.acc-item.bare .acc-inner {
|
|
629
|
+
padding: 0;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
/* ── invite ──────────────────────────────────────────────── */
|
|
633
|
+
.invite-box {
|
|
634
|
+
display: flex;
|
|
635
|
+
flex-direction: column;
|
|
636
|
+
gap: 2px;
|
|
637
|
+
padding: 10px 12px;
|
|
638
|
+
background: var(--sb-surface-alt, #fafafa);
|
|
639
|
+
border: 1px solid var(--sb-border, #e4e6e9);
|
|
640
|
+
border-radius: var(--sb-radius, 4px);
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
.invite-label {
|
|
644
|
+
font-size: 11.5px;
|
|
645
|
+
letter-spacing: 0.04em;
|
|
646
|
+
text-transform: uppercase;
|
|
647
|
+
font-family: var(--sb-mono, "Geist Mono", ui-monospace, monospace);
|
|
648
|
+
color: var(--sb-muted-ink, #61666c);
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
.invite-email {
|
|
652
|
+
font-size: 14px;
|
|
653
|
+
color: var(--sb-ink, #16181a);
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
/* ── account ─────────────────────────────────────────────── */
|
|
657
|
+
.acct-root {
|
|
658
|
+
display: flex;
|
|
659
|
+
flex-direction: column;
|
|
660
|
+
gap: 22px;
|
|
661
|
+
width: 100%;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
.acct-nav {
|
|
665
|
+
display: flex;
|
|
666
|
+
align-items: flex-start;
|
|
667
|
+
justify-content: space-between;
|
|
668
|
+
gap: 16px;
|
|
669
|
+
padding-bottom: 18px;
|
|
670
|
+
border-bottom: 1px solid var(--sb-border, #e4e6e9);
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
.acct-who {
|
|
674
|
+
display: flex;
|
|
675
|
+
align-items: center;
|
|
676
|
+
gap: 10px;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
.avatar-col {
|
|
680
|
+
flex: 0 0 auto;
|
|
681
|
+
display: flex;
|
|
682
|
+
flex-direction: column;
|
|
683
|
+
align-items: center;
|
|
684
|
+
gap: 6px;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
.avatar {
|
|
688
|
+
flex: 0 0 auto;
|
|
689
|
+
width: 42px;
|
|
690
|
+
height: 42px;
|
|
691
|
+
border-radius: 50%;
|
|
692
|
+
background: var(--sb-surface-alt, #fafafa);
|
|
693
|
+
border: 1px dashed var(--sb-border, #e4e6e9);
|
|
694
|
+
display: flex;
|
|
695
|
+
align-items: center;
|
|
696
|
+
justify-content: center;
|
|
697
|
+
font-family: var(--sb-mono, "Geist Mono", ui-monospace, monospace);
|
|
698
|
+
font-size: 13px;
|
|
699
|
+
color: var(--sb-muted-ink, #61666c);
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
.avatar.has-photo {
|
|
703
|
+
border-style: solid;
|
|
704
|
+
overflow: hidden;
|
|
705
|
+
}
|
|
706
|
+
.avatar img {
|
|
707
|
+
width: 100%;
|
|
708
|
+
height: 100%;
|
|
709
|
+
object-fit: cover;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
.avatar-lg {
|
|
713
|
+
width: 56px;
|
|
714
|
+
height: 56px;
|
|
715
|
+
border-radius: 50%;
|
|
716
|
+
background: var(--sb-surface-alt, #fafafa);
|
|
717
|
+
border: 1px dashed var(--sb-border-strong, #cdd1d6);
|
|
718
|
+
display: flex;
|
|
719
|
+
align-items: center;
|
|
720
|
+
justify-content: center;
|
|
721
|
+
font-family: var(--sb-mono, "Geist Mono", ui-monospace, monospace);
|
|
722
|
+
font-size: 13px;
|
|
723
|
+
color: var(--sb-muted-ink, #61666c);
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
.avatar-row {
|
|
727
|
+
display: flex;
|
|
728
|
+
align-items: center;
|
|
729
|
+
gap: 14px;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
.avatar-actions {
|
|
733
|
+
display: flex;
|
|
734
|
+
flex-direction: column;
|
|
735
|
+
gap: 6px;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
.acct-who-text {
|
|
739
|
+
min-width: 0;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
.acct-name {
|
|
743
|
+
font-size: 14px;
|
|
744
|
+
font-weight: 600;
|
|
745
|
+
color: var(--sb-ink, #16181a);
|
|
746
|
+
letter-spacing: -0.01em;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
.acct-email {
|
|
750
|
+
font-size: 12.5px;
|
|
751
|
+
color: var(--sb-muted-ink, #61666c);
|
|
752
|
+
overflow: hidden;
|
|
753
|
+
text-overflow: ellipsis;
|
|
754
|
+
white-space: nowrap;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
.acct-body {
|
|
758
|
+
flex: 1;
|
|
759
|
+
min-width: 0;
|
|
760
|
+
display: flex;
|
|
761
|
+
flex-direction: column;
|
|
762
|
+
gap: 22px;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
.section {
|
|
766
|
+
display: flex;
|
|
767
|
+
flex-direction: column;
|
|
768
|
+
gap: 14px;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
.sum-list {
|
|
772
|
+
display: flex;
|
|
773
|
+
flex-direction: column;
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
.sum-row {
|
|
777
|
+
display: flex;
|
|
778
|
+
align-items: baseline;
|
|
779
|
+
justify-content: space-between;
|
|
780
|
+
gap: 16px;
|
|
781
|
+
padding: 15px 0;
|
|
782
|
+
border-bottom: 1px solid var(--sb-border, #e4e6e9);
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
.sum-label {
|
|
786
|
+
flex: 0 0 auto;
|
|
787
|
+
font-size: 12.5px;
|
|
788
|
+
color: var(--sb-muted-ink, #61666c);
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
.sum-value {
|
|
792
|
+
min-width: 0;
|
|
793
|
+
font-size: 13.5px;
|
|
794
|
+
color: var(--sb-ink, #16181a);
|
|
795
|
+
overflow: hidden;
|
|
796
|
+
text-overflow: ellipsis;
|
|
797
|
+
white-space: nowrap;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
.edit-card {
|
|
801
|
+
display: flex;
|
|
802
|
+
flex-direction: column;
|
|
803
|
+
gap: var(--sb-gap, 16px);
|
|
804
|
+
padding: 14px;
|
|
805
|
+
background: var(--sb-surface-alt, #fafafa);
|
|
806
|
+
border: 1px solid var(--sb-border, #e4e6e9);
|
|
807
|
+
border-radius: var(--sb-radius, 4px);
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
/* 2FA switch */
|
|
811
|
+
.switch {
|
|
812
|
+
flex: 0 0 auto;
|
|
813
|
+
width: 42px;
|
|
814
|
+
height: 24px;
|
|
815
|
+
border-radius: 99px;
|
|
816
|
+
border: 1px solid var(--sb-border-strong, #cdd1d6);
|
|
817
|
+
background: var(--sb-surface-alt, #fafafa);
|
|
818
|
+
cursor: pointer;
|
|
819
|
+
padding: 2px;
|
|
820
|
+
display: flex;
|
|
821
|
+
justify-content: flex-start;
|
|
822
|
+
align-items: center;
|
|
823
|
+
transition:
|
|
824
|
+
background 0.15s,
|
|
825
|
+
border-color 0.15s;
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
.switch[aria-pressed="true"] {
|
|
829
|
+
border-color: var(--sb-accent, #111111);
|
|
830
|
+
background: var(--sb-accent, #111111);
|
|
831
|
+
justify-content: flex-end;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
.knob {
|
|
835
|
+
width: 18px;
|
|
836
|
+
height: 18px;
|
|
837
|
+
border-radius: 50%;
|
|
838
|
+
background: var(--sb-muted-ink, #61666c);
|
|
839
|
+
display: block;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
.switch[aria-pressed="true"] .knob {
|
|
843
|
+
background: var(--sb-on-accent, #ffffff);
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
.qr-row {
|
|
847
|
+
display: flex;
|
|
848
|
+
gap: 14px;
|
|
849
|
+
align-items: flex-start;
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
.qr-box {
|
|
853
|
+
flex: 0 0 auto;
|
|
854
|
+
width: 74px;
|
|
855
|
+
height: 74px;
|
|
856
|
+
border-radius: var(--sb-radius, 4px);
|
|
857
|
+
background: var(--sb-surface-alt, #fafafa);
|
|
858
|
+
border: 1px dashed var(--sb-border-strong, #cdd1d6);
|
|
859
|
+
display: flex;
|
|
860
|
+
align-items: center;
|
|
861
|
+
justify-content: center;
|
|
862
|
+
font-family: var(--sb-mono, "Geist Mono", ui-monospace, monospace);
|
|
863
|
+
font-size: 12px;
|
|
864
|
+
color: var(--sb-muted-ink, #61666c);
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
.qr-text {
|
|
868
|
+
display: flex;
|
|
869
|
+
flex-direction: column;
|
|
870
|
+
gap: 10px;
|
|
871
|
+
min-width: 0;
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
/* connected accounts */
|
|
875
|
+
.list {
|
|
876
|
+
display: flex;
|
|
877
|
+
flex-direction: column;
|
|
878
|
+
gap: 8px;
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
.conn-row {
|
|
882
|
+
display: flex;
|
|
883
|
+
align-items: center;
|
|
884
|
+
justify-content: space-between;
|
|
885
|
+
gap: 12px;
|
|
886
|
+
padding: 10px 12px;
|
|
887
|
+
border: 1px solid var(--sb-border, #e4e6e9);
|
|
888
|
+
border-radius: var(--sb-radius, 4px);
|
|
889
|
+
background: var(--sb-surface-alt, #fafafa);
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
.conn-left {
|
|
893
|
+
display: flex;
|
|
894
|
+
align-items: center;
|
|
895
|
+
gap: 10px;
|
|
896
|
+
min-width: 0;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
.conn-mark {
|
|
900
|
+
flex: 0 0 auto;
|
|
901
|
+
width: 28px;
|
|
902
|
+
height: 28px;
|
|
903
|
+
border-radius: 50%;
|
|
904
|
+
background: var(--sb-surface, #ffffff);
|
|
905
|
+
border: 1px solid var(--sb-border, #e4e6e9);
|
|
906
|
+
display: flex;
|
|
907
|
+
align-items: center;
|
|
908
|
+
justify-content: center;
|
|
909
|
+
font-family: var(--sb-mono, "Geist Mono", ui-monospace, monospace);
|
|
910
|
+
font-size: 11px;
|
|
911
|
+
color: var(--sb-muted-ink, #61666c);
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
.conn-name {
|
|
915
|
+
font-size: 13.5px;
|
|
916
|
+
font-weight: 500;
|
|
917
|
+
color: var(--sb-ink, #16181a);
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
.meta-row {
|
|
921
|
+
display: flex;
|
|
922
|
+
align-items: center;
|
|
923
|
+
gap: 6px;
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
.dot {
|
|
927
|
+
flex: 0 0 auto;
|
|
928
|
+
width: 5px;
|
|
929
|
+
height: 5px;
|
|
930
|
+
border-radius: 50%;
|
|
931
|
+
background: var(--sb-ok, #0f6b4a);
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
.conn-meta {
|
|
935
|
+
font-size: 12px;
|
|
936
|
+
color: var(--sb-muted-ink, #61666c);
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
.tile-grid {
|
|
940
|
+
display: grid;
|
|
941
|
+
grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
|
|
942
|
+
gap: 8px;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
.tile {
|
|
946
|
+
display: flex;
|
|
947
|
+
align-items: center;
|
|
948
|
+
gap: 8px;
|
|
949
|
+
font: inherit;
|
|
950
|
+
text-align: left;
|
|
951
|
+
padding: 10px 11px;
|
|
952
|
+
border-radius: var(--sb-radius, 4px);
|
|
953
|
+
border: 1px dashed var(--sb-border-strong, #cdd1d6);
|
|
954
|
+
background: transparent;
|
|
955
|
+
cursor: pointer;
|
|
956
|
+
transition:
|
|
957
|
+
background 0.15s,
|
|
958
|
+
border-color 0.15s,
|
|
959
|
+
color 0.15s;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
.tile:hover:not(:disabled) {
|
|
963
|
+
background: var(--sb-surface-alt, #fafafa);
|
|
964
|
+
border-color: var(--sb-accent, #111111);
|
|
965
|
+
border-style: solid;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
.tile-mark {
|
|
969
|
+
flex: 0 0 auto;
|
|
970
|
+
width: 22px;
|
|
971
|
+
height: 22px;
|
|
972
|
+
border-radius: 50%;
|
|
973
|
+
background: var(--sb-surface-alt, #fafafa);
|
|
974
|
+
display: flex;
|
|
975
|
+
align-items: center;
|
|
976
|
+
justify-content: center;
|
|
977
|
+
font-family: var(--sb-mono, "Geist Mono", ui-monospace, monospace);
|
|
978
|
+
font-size: 10.5px;
|
|
979
|
+
color: var(--sb-muted-ink, #61666c);
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
.tile-name {
|
|
983
|
+
font-size: 13px;
|
|
984
|
+
color: var(--sb-ink, #16181a);
|
|
985
|
+
overflow: hidden;
|
|
986
|
+
text-overflow: ellipsis;
|
|
987
|
+
white-space: nowrap;
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
.tile-plus {
|
|
991
|
+
margin-left: auto;
|
|
992
|
+
font-family: var(--sb-mono, "Geist Mono", ui-monospace, monospace);
|
|
993
|
+
font-size: 14px;
|
|
994
|
+
line-height: 1;
|
|
995
|
+
color: var(--sb-muted-ink, #61666c);
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
.delete-panel {
|
|
999
|
+
display: flex;
|
|
1000
|
+
flex-direction: column;
|
|
1001
|
+
gap: 12px;
|
|
1002
|
+
padding: 14px;
|
|
1003
|
+
border: 1px solid var(--sb-danger-panel-border, #efd9d6);
|
|
1004
|
+
border-radius: var(--sb-radius, 4px);
|
|
1005
|
+
background: var(--sb-danger-panel-bg, #fdf7f6);
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
.disabled-note {
|
|
1009
|
+
font-size: 12px;
|
|
1010
|
+
color: var(--sb-muted-ink, #61666c);
|
|
1011
|
+
font-style: italic;
|
|
1012
|
+
}
|
|
1013
|
+
`;function ve(t,a,e){if(!t||!a)return null;let r;try{r=new URL(a)}catch{return null}let o;try{o=new URL(t,r.href)}catch{return e==null||e(`"${t}" is not a valid URL`),null}return o.protocol!=="http:"&&o.protocol!=="https:"?(e==null||e(`refusing redirect to unsupported scheme "${o.protocol}"`),null):o.origin!==r.origin?(e==null||e(`refusing cross-origin redirect to ${o.origin}; same-origin only`),null):o.href===r.href?null:o.href}const ie={heading:"Upload files",description:"Add one or more files. You can review the list before uploading.",dropTitle:"Drag and drop files here",dropSub:"or browse from your device",hintUpTo:"up to {size} each",chooseFiles:"Choose files",chooseFile:"Choose file",addMore:"+ Add more files",remove:"Remove",rename:"Rename",retry:"Retry",uploadCtaOne:"Upload {n} file",uploadCtaMany:"Upload {n} files",attachments:"Attachments",dropOrChoose:"Drop files or choose",checking:"Checking…",pagesLabel:"{n} pages",countOne:"{n} file of {max}",countMany:"{n} files of {max}",uploading:"Uploading…",uploaded:"Uploaded",failedLabel:"Failed",errTooMany:"You can upload up to {max} files.",errTooLarge:"{name} is larger than {size}.",errTooSmall:"{name} is smaller than {size}.",errDuplicate:"{name} is already in the list.",errType:"{name} isn't an accepted file type.",errNoClient:"No Singlebase client found on this page.",errUpload:"Upload failed.",errProtected:"{name} is password protected.",errTooManyPages:"{name} has {pages} pages; the limit is {max}.",brandingLabel:"Files by Singlebase"};function ye(t){return t?{...ie,...t}:ie}function x(t,a){return t.replace(/\{(\w+)\}/g,(e,r)=>r in a?String(a[r]):e)}const Te={b:1,kb:1024,mb:1024*1024,gb:1024*1024*1024};function ae(t){if(typeof t=="number")return t>0?t:0;if(!t)return 0;const a=String(t).trim().toLowerCase().match(/^([\d.]+)\s*(b|kb|mb|gb)?$/);if(!a)return 0;const e=Number.parseFloat(a[1]);return!Number.isFinite(e)||e<=0?0:Math.round(e*(Te[a[2]??"b"]??1))}function Z(t){return t<1024?`${t} B`:t<1024*1024?`${Math.round(t/1024)} KB`:t<1024*1024*1024?`${(t/(1024*1024)).toFixed(1)} MB`:`${(t/(1024*1024*1024)).toFixed(1)} GB`}function Q(t){const a=t.lastIndexOf(".");return a<=0||a===t.length-1?"":t.slice(a+1).toLowerCase()}function Le(t){return Q(t).toUpperCase().slice(0,4)}function Fe(t,a,e){const r=t.split(",").map(g=>g.trim().toLowerCase()).filter(Boolean);if(!r.length)return!0;const o=a.toLowerCase(),l=(e||"").toLowerCase();return r.some(g=>g.startsWith(".")?o.endsWith(g):g.endsWith("/*")?l.startsWith(g.slice(0,-1)):l===g)}function Oe(t){const a=t.split(",").map(e=>e.trim()).filter(Boolean).map(e=>{if(e.startsWith("."))return e.slice(1).toUpperCase();if(e.endsWith("/*"))return e.slice(0,-2).toUpperCase();const r=e.indexOf("/");return(r>=0?e.slice(r+1):e).toUpperCase()});return[...new Set(a)].join(", ")}function De(t){return`${t.name}:${t.size}:${t.lastModified??0}`}function je(t,a){const e=a.trim().replace(/[/\\]/g,"");if(!e)return t;const r=t.lastIndexOf("."),o=r>0?t.slice(r):"";return o?e.toLowerCase().endsWith(o.toLowerCase())?e:e+o:e}const we={pages:null,encrypted:null},ge=16*1024*1024,Ae=2*1024*1024,Ee=40,Ne=4*1024*1024,ke=new Set(["docx","pptx","xlsx"]);async function ze(t,a){try{if(a==="pdf")return await Be(t);if(ke.has(a))return await Re(t,a)}catch{}return we}function Ue(t){return t==="pdf"||ke.has(t)}async function Be(t){const a=await ee(t.slice(0,ge)),e=t.size>ge?await ee(t.slice(Math.max(0,t.size-Ae))):null,r=te(a)+(e?te(e):""),o=/\/Encrypt[\s/<>\]]/.test(r);let l=$e(r);return l===null&&(l=await Pe(a)),{pages:l,encrypted:o}}function $e(t){if(/\/Type\s*\/Pages/.test(t)){let e=0;for(const r of t.matchAll(/\/Count\s+(\d+)/g))e=Math.max(e,Number(r[1]));if(e>0)return e}const a=t.match(/\/Type\s*\/Page[^s]/g);return a!=null&&a.length?a.length:null}async function Pe(t){if(typeof DecompressionStream>"u")return null;const a=te(t);let e="",r=0;for(const o of a.matchAll(/stream\r?\n/g)){if(r>=Ee||e.length>=Ne)break;const l=o.index+o[0].length;let g=a.indexOf("endstream",l);if(g<0)break;for(;g>l&&(a[g-1]===`
|
|
1014
|
+
`||a[g-1]==="\r");)g-=1;r+=1;try{const i=await Se(t.subarray(l,g),"deflate");e+=te(i)}catch{}}return e?$e(e):null}async function Re(t,a){const e=await ee(t.slice(0,8));if(Ie(e))return{pages:null,encrypted:!0};if(e[0]!==80||e[1]!==75)return we;const r=await Ge(t,"docProps/app.xml");if(!r)return{pages:null,encrypted:!1};const o=a==="pptx"?"Slides":"Pages",l=new TextDecoder().decode(r).match(new RegExp(`<${o}>(\\d+)</${o}>`));return{pages:l?Number(l[1]):null,encrypted:!1}}function Ie(t){return[208,207,17,224,161,177,26,225].every((e,r)=>t[r]===e)}async function Ge(t,a){const e=Math.min(t.size,66e3),r=new DataView(await t.slice(t.size-e).arrayBuffer());let o=-1;for(let h=r.byteLength-22;h>=0;h--)if(r.getUint32(h,!0)===101010256){o=h;break}if(o<0)return null;const l=r.getUint32(o+12,!0),g=r.getUint32(o+16,!0);if(!l||g===4294967295)return null;const i=new DataView(await t.slice(g,g+l).arrayBuffer()),s=new TextDecoder;let b=0;for(;b+46<=i.byteLength&&i.getUint32(b,!0)===33639248;){const h=i.getUint16(b+10,!0),m=i.getUint32(b+20,!0),v=i.getUint16(b+28,!0),X=i.getUint16(b+30,!0),re=i.getUint16(b+32,!0),oe=i.getUint32(b+42,!0);if(s.decode(new Uint8Array(i.buffer,i.byteOffset+b+46,v))===a){const de=new DataView(await t.slice(oe,oe+30).arrayBuffer()),ce=oe+30+de.getUint16(26,!0)+de.getUint16(28,!0),pe=await ee(t.slice(ce,ce+m));return h===0?pe:h===8&&typeof DecompressionStream<"u"?await Se(pe,"deflate-raw"):null}b+=46+v+X+re}return null}async function ee(t){return new Uint8Array(await t.arrayBuffer())}async function Se(t,a){const e=new Blob([t]).stream().pipeThrough(new DecompressionStream(a));return new Uint8Array(await new Response(e).arrayBuffer())}function te(t){let a="";for(let r=0;r<t.length;r+=32768)a+=String.fromCharCode(...t.subarray(r,r+32768));return a}var Ce=Object.defineProperty,_e=Object.getOwnPropertyDescriptor,Ke=(t,a,e)=>a in t?Ce(t,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[a]=e,f=(t,a,e,r)=>{for(var o=r>1?void 0:r?_e(a,e):a,l=t.length-1,g;l>=0;l--)(g=t[l])&&(o=(r?g(a,e,o):g(o))||o);return r&&o&&Ce(a,e,o),o},We=(t,a,e)=>Ke(t,a+"",e);const se={fromAttribute:t=>{if(!t)return{};try{const a=JSON.parse(t);return a&&typeof a=="object"?a:{}}catch{return console.warn("[singlebase-uploader] an attribute holds invalid JSON; ignoring it"),{}}},toAttribute:t=>JSON.stringify(t??{})},le={fromAttribute:t=>t===null?!0:t!=="false",toAttribute:t=>t?null:"false"},be=["view","dropzone","allowRename","autoUpload","branding","logoUrl","logoText","heading","description","maxFiles","maxSize","minSize","accept","rules","bucket","publicRead","redirectUrl","metadata","options","messages","theme","density","onComplete","onError"];var w,k,z,U,$,S,C,M,T,L,F,O,D,j,A,E,N,B,P,R,I,G,_,K,W,q,Y,H,V,J,he;exports.SinglebaseUploader=(he=class extends n.LitElement{constructor(){super(...arguments);c(this,w,null);c(this,k,{});c(this,z);c(this,U);c(this,$,"full");c(this,S,!0);c(this,C,!0);c(this,M,!1);c(this,T,!0);c(this,L,"");c(this,F,"");c(this,O,"");c(this,D,"");c(this,j,10);c(this,A,"25MB");c(this,E,0);c(this,N,"");c(this,B,{});c(this,P,"default");c(this,R,{});c(this,I,{});c(this,G,!1);c(this,_,"");c(this,K,null);c(this,W,null);c(this,q,[]);c(this,Y,"");c(this,H,!1);c(this,V,!1);c(this,J,"")}get client(){return d(this,w)}set client(e){p(this,w,e)}get messages(){return d(this,k)}set messages(e){p(this,k,e)}get theme(){return d(this,z)}set theme(e){p(this,z,e)}get density(){return d(this,U)}set density(e){p(this,U,e)}get view(){return d(this,$)}set view(e){p(this,$,e)}get dropzone(){return d(this,S)}set dropzone(e){p(this,S,e)}get allowRename(){return d(this,C)}set allowRename(e){p(this,C,e)}get autoUpload(){return d(this,M)}set autoUpload(e){p(this,M,e)}get branding(){return d(this,T)}set branding(e){p(this,T,e)}get logoUrl(){return d(this,L)}set logoUrl(e){p(this,L,e)}get logoText(){return d(this,F)}set logoText(e){p(this,F,e)}get heading(){return d(this,O)}set heading(e){p(this,O,e)}get description(){return d(this,D)}set description(e){p(this,D,e)}get maxFiles(){return d(this,j)}set maxFiles(e){p(this,j,e)}get maxSize(){return d(this,A)}set maxSize(e){p(this,A,e)}get minSize(){return d(this,E)}set minSize(e){p(this,E,e)}get accept(){return d(this,N)}set accept(e){p(this,N,e)}get rules(){return d(this,B)}set rules(e){p(this,B,e)}get bucket(){return d(this,P)}set bucket(e){p(this,P,e)}get metadata(){return d(this,R)}set metadata(e){p(this,R,e)}get options(){return d(this,I)}set options(e){p(this,I,e)}get publicRead(){return d(this,G)}set publicRead(e){p(this,G,e)}get redirectUrl(){return d(this,_)}set redirectUrl(e){p(this,_,e)}get onComplete(){return d(this,K)}set onComplete(e){p(this,K,e)}get onError(){return d(this,W)}set onError(e){p(this,W,e)}get items(){return d(this,q)}set items(e){p(this,q,e)}get notice(){return d(this,Y)}set notice(e){p(this,Y,e)}get busy(){return d(this,H)}set busy(e){p(this,H,e)}get dragging(){return d(this,V)}set dragging(e){p(this,V,e)}get editing(){return d(this,J)}set editing(e){p(this,J,e)}get msg(){return ye(this.messages)}get resolvedClient(){return this.client??Me.getDefaultClient()??null}get files(){return this.items}get percent(){const e=this.items.filter(r=>r.status!=="ready");return e.length?Math.round(e.reduce((r,o)=>r+o.percent,0)/e.length):0}open(){var e;(e=this.renderRoot.querySelector("input[type=file]"))==null||e.click()}set config(e){const r=this;for(const o of be)e&&o in e&&(r[o]=e[o])}get config(){const e=this;return Object.fromEntries(be.map(r=>[r,e[r]]))}clear(){this.items.forEach(y),this.items=[],this.notice=""}disconnectedCallback(){super.disconnectedCallback(),this.items.forEach(y)}async upload(){var g;if(this.busy)return;const e=this.items.filter(i=>i.status==="ready"||i.status==="error");if(!e.length)return;const r=this.resolvedClient;if(!r){this.fail(this.msg.errNoClient);return}this.busy=!0,this.notice="";for(const i of e)i.status="uploading",i.percent=0,i.error="";this.items=[...this.items];const o=new Map,l=e.map(i=>{const s={file:i.file,filename:i.file.name};return this.bucket&&(s.bucket=this.bucket),this.publicRead&&(s.publicRead=!0),i.name!==i.file.name&&(s.newName=i.name),Object.keys(this.metadata??{}).length&&(s.metadata={...this.metadata}),Object.keys(this.options??{}).length&&(s.options={...this.options}),o.set(s,i),s});try{const i=await r.files.upload(l,{onProgress:h=>{const m=o.get(h.input);m&&(m.percent=h.percent,this.items=[...this.items],this.emit("singlebase-upload-progress",{file:m,percent:this.percent}))}});for(const h of i.completed){const m=o.get(h.input);m&&(m.status="done",m.percent=100,m.record=h.file)}for(const h of i.failed){const m=o.get(h.input);m&&(m.status="error",m.error=h.error.message||h.error.code)}this.items=[...this.items];const s=i.completed.map(h=>o.get(h.input)).filter(Boolean),b=i.failed.map(h=>o.get(h.input)).filter(Boolean);this.emit("singlebase-upload-complete",{completed:s,failed:b}),(g=this.onComplete)==null||g.call(this,{completed:s,failed:b}),b.length?this.notice=this.msg.errUpload:this.redirect()}catch(i){for(const s of e)s.status="error",s.error="";this.items=[...this.items],this.fail(Ye(i)||this.msg.errUpload)}finally{this.busy=!1}}ruleFor(e){const r=Q(e);if(!r)return null;for(const[o,l]of Object.entries(this.rules??{}))if(o.toLowerCase().replace(/^\./,"")===r)return l;return null}async add(e){if(this.view==="button"){const s=this.items.filter(b=>b.status==="done"||b.status==="error");s.forEach(y),this.items=this.items.filter(b=>!s.includes(b))}const r=this.maxFiles>0?this.maxFiles:Number.POSITIVE_INFINITY,o=[...this.items],l=o.length,g=[];let i="";for(const s of Array.from(e)){if(o.length>=r){i=x(this.msg.errTooMany,{max:r});break}if(this.accept&&!Fe(this.accept,s.name,s.type)){i=x(this.msg.errType,{name:s.name});continue}const b=this.ruleFor(s.name),h=ae((b==null?void 0:b.maxSize)??this.maxSize),m=ae((b==null?void 0:b.minSize)??this.minSize);if(h&&s.size>h){i=x(this.msg.errTooLarge,{name:s.name,size:Z(h)});continue}if(m&&s.size<m){i=x(this.msg.errTooSmall,{name:s.name,size:Z(m)});continue}const v=De(s);if(o.some(re=>re.key===v)){i=x(this.msg.errDuplicate,{name:s.name});continue}const X={key:v,file:s,name:s.name,status:this.needsInspection(b,s.name)?"checking":"ready",percent:0,error:"",record:null,pages:null,encrypted:null,preview:qe(s)};o.push(X),g.push(X)}this.notice=i,i&&this.emit("singlebase-upload-rejected",{message:i}),o.length!==l&&(this.items=o,this.emit("singlebase-upload-selected",{files:this.items}),await Promise.all(g.filter(s=>s.status==="checking").map(s=>this.inspect(s,this.ruleFor(s.file.name)))),(this.autoUpload||this.view==="button")&&this.upload())}needsInspection(e,r){return!e||!Ue(Q(r))?!1:e.maxPages!==void 0||e.allowProtected===!1}async inspect(e,r){const o=await ze(e.file,Q(e.file.name));e.pages=o.pages,e.encrypted=o.encrypted;let l="";r.allowProtected===!1&&o.encrypted===!0?l=x(this.msg.errProtected,{name:e.name}):r.maxPages&&o.pages!==null&&o.pages>r.maxPages&&(l=x(this.msg.errTooManyPages,{name:e.name,pages:o.pages,max:r.maxPages})),l?(y(e),this.items=this.items.filter(g=>g!==e),this.notice=l,this.emit("singlebase-upload-rejected",{message:l})):(e.status="ready",this.items=[...this.items])}removeItem(e){this.items.filter(r=>r.key===e).forEach(y),this.items=this.items.filter(r=>r.key!==e),this.notice=""}commitRename(e,r){e.name=je(e.file.name,r),this.editing="",this.items=[...this.items]}fail(e){var r;this.notice=e,this.emit("singlebase-upload-error",{message:e}),(r=this.onError)==null||r.call(this,{message:e})}emit(e,r){this.dispatchEvent(new CustomEvent(e,{detail:r,bubbles:!0,composed:!0}))}redirect(){if(!this.redirectUrl||typeof location>"u")return;const e=ve(this.redirectUrl,location.href,r=>console.warn(`[singlebase-uploader] ${r}`));e&&location.assign(e)}onPick(e){var o;const r=e.target;(o=r.files)!=null&&o.length&&this.add(r.files),r.value=""}onDrop(e){var o;e.preventDefault(),this.dragging=!1;const r=(o=e.dataTransfer)==null?void 0:o.files;r!=null&&r.length&&this.add(r)}onDragOver(e){e.preventDefault(),this.dragging=!0}onDragLeave(){this.dragging=!1}get canAddMore(){return this.maxFiles<=0||this.items.length<this.maxFiles}get checking(){return this.items.some(e=>e.status==="checking")}get pendingCount(){return this.items.filter(e=>e.status==="ready"||e.status==="error").length}get hint(){const e=Oe(this.accept),r=ae(this.maxSize),o=r?x(this.msg.hintUpTo,{size:Z(r)}):"";return[e,o].filter(Boolean).join(" · ")}renderInput(){return n.html`<input
|
|
1015
|
+
class="sr-only"
|
|
1016
|
+
type="file"
|
|
1017
|
+
?multiple=${this.maxFiles!==1}
|
|
1018
|
+
accept=${this.accept||n.nothing}
|
|
1019
|
+
@change=${this.onPick}
|
|
1020
|
+
/>`}renderLogo(){return this.logoUrl?n.html`<img
|
|
1021
|
+
class="logo-img"
|
|
1022
|
+
src=${this.logoUrl}
|
|
1023
|
+
alt=${this.logoText||"Logo"}
|
|
1024
|
+
part="logo"
|
|
1025
|
+
/>`:this.logoText?n.html`<div class="brand-mark" part="logo">${this.logoText}</div>`:n.nothing}renderBranding(){return this.branding?n.html`<div class="branding" part="branding">
|
|
1026
|
+
<a href="https://singlebase.cloud" target="_blank" rel="noopener noreferrer"
|
|
1027
|
+
>${this.msg.brandingLabel}</a
|
|
1028
|
+
>
|
|
1029
|
+
</div>`:n.nothing}renderNotice(){return this.notice?n.html`<div class="banner" role="alert" part="error">${this.notice}</div>`:n.nothing}renderCount(){if(!this.items.length)return n.nothing;const e=this.items.length===1?this.msg.countOne:this.msg.countMany;return n.html`<div class="count" part="count">
|
|
1030
|
+
${x(e,{n:this.items.length,max:this.maxFiles})}
|
|
1031
|
+
</div>`}renderStatus(e){const r=Z(e.file.size);if(e.status==="checking")return`${r} · ${this.msg.checking}`;if(e.status==="uploading")return`${r} · ${this.msg.uploading}`;if(e.status==="done")return`${r} · ${this.msg.uploaded}`;if(e.status==="error")return`${r} · ${e.error||this.msg.failedLabel}`;const o=e.pages?` · ${x(this.msg.pagesLabel,{n:e.pages})}`:"";return r+o}renderRow(e){const r=this.allowRename&&e.status==="ready";return e.status==="uploading"||e.status,n.html`<div class="row" part="file">
|
|
1032
|
+
<div class="chip" part="file-type">
|
|
1033
|
+
${e.preview?n.html`<img class="thumb" src=${e.preview} alt="" part="preview" />`:Le(e.name)||"FILE"}
|
|
1034
|
+
</div>
|
|
1035
|
+
<div class="meta">
|
|
1036
|
+
${this.editing===e.key?n.html`<input
|
|
1037
|
+
class="name-input"
|
|
1038
|
+
.value=${e.name}
|
|
1039
|
+
autofocus
|
|
1040
|
+
@keydown=${o=>{o.key==="Enter"?this.commitRename(e,o.target.value):o.key==="Escape"&&(this.editing="")}}
|
|
1041
|
+
@blur=${o=>this.commitRename(e,o.target.value)}
|
|
1042
|
+
/>`:r?n.html`<button
|
|
1043
|
+
class="name"
|
|
1044
|
+
title=${this.msg.rename}
|
|
1045
|
+
@click=${()=>{this.editing=e.key}}
|
|
1046
|
+
>
|
|
1047
|
+
${e.name}
|
|
1048
|
+
</button>`:n.html`<div class="name">${e.name}</div>`}
|
|
1049
|
+
<div class="sz" data-state=${e.status}>${this.renderStatus(e)}</div>
|
|
1050
|
+
${e.status==="uploading"?n.html`<div class="bar" part="progress">
|
|
1051
|
+
<div class="bar-fill" style="width:${e.percent}%"></div>
|
|
1052
|
+
</div>`:n.nothing}
|
|
1053
|
+
</div>
|
|
1054
|
+
<div class="row-act">
|
|
1055
|
+
${e.status==="error"?n.html`<button class="link-sm" @click=${()=>void this.upload()}>
|
|
1056
|
+
${this.msg.retry}
|
|
1057
|
+
</button>`:n.nothing}
|
|
1058
|
+
${e.status==="uploading"||e.status==="done"?n.nothing:n.html`<button class="link-sm" @click=${()=>this.removeItem(e.key)}>
|
|
1059
|
+
${this.msg.remove}
|
|
1060
|
+
</button>`}
|
|
1061
|
+
</div>
|
|
1062
|
+
</div>`}renderRows(){return this.items.length?n.html`<div class="rows" part="files">
|
|
1063
|
+
${this.items.map(e=>this.renderRow(e))}
|
|
1064
|
+
</div>`:n.nothing}renderDropzone(){return n.html`<div class="drop" part="dropzone" data-drag=${String(this.dragging)}>
|
|
1065
|
+
<div class="arrow" aria-hidden="true">↑</div>
|
|
1066
|
+
<div class="drop-title">${this.msg.dropTitle}</div>
|
|
1067
|
+
<button class="link" @click=${this.open}>${this.msg.dropSub}</button>
|
|
1068
|
+
${this.hint?n.html`<div class="hint">${this.hint}</div>`:n.nothing}
|
|
1069
|
+
</div>`}renderUploadCta(){const e=this.pendingCount;if(this.autoUpload||!e&&!this.busy)return n.nothing;const r=e===1?this.msg.uploadCtaOne:this.msg.uploadCtaMany;return n.html`<button
|
|
1070
|
+
class="primary wide"
|
|
1071
|
+
part="submit"
|
|
1072
|
+
?disabled=${this.busy||this.checking}
|
|
1073
|
+
@click=${()=>void this.upload()}
|
|
1074
|
+
>
|
|
1075
|
+
${this.busy?this.msg.uploading:x(r,{n:e})}
|
|
1076
|
+
</button>`}renderFull(){const e=this.dropzone&&!this.items.length&&this.canAddMore;return n.html`<div
|
|
1077
|
+
class="card"
|
|
1078
|
+
part="card"
|
|
1079
|
+
@dragover=${this.onDragOver}
|
|
1080
|
+
@dragleave=${this.onDragLeave}
|
|
1081
|
+
@drop=${this.onDrop}
|
|
1082
|
+
>
|
|
1083
|
+
${this.logoUrl||this.logoText||this.heading||this.description?n.html`<div class="head-block">
|
|
1084
|
+
${this.renderLogo()}
|
|
1085
|
+
${this.heading?n.html`<div class="title">${this.heading}</div>`:n.nothing}
|
|
1086
|
+
${this.description?n.html`<div class="sub">${this.description}</div>`:n.nothing}
|
|
1087
|
+
</div>`:n.nothing}
|
|
1088
|
+
${this.renderCount()} ${this.renderNotice()} ${this.renderRows()}
|
|
1089
|
+
${e?this.renderDropzone():n.nothing}
|
|
1090
|
+
${!e&&this.canAddMore?n.html`<button class="add-more" @click=${this.open}>${this.msg.addMore}</button>`:n.nothing}
|
|
1091
|
+
${this.renderUploadCta()} ${this.renderBranding()}
|
|
1092
|
+
</div>`}renderCompact(){return n.html`<div
|
|
1093
|
+
class="card"
|
|
1094
|
+
part="card"
|
|
1095
|
+
@dragover=${this.onDragOver}
|
|
1096
|
+
@dragleave=${this.onDragLeave}
|
|
1097
|
+
@drop=${this.onDrop}
|
|
1098
|
+
>
|
|
1099
|
+
<div class="between">
|
|
1100
|
+
<span class="sec-title">${this.heading||this.msg.attachments}</span>
|
|
1101
|
+
<span class="count">${this.items.length} / ${this.maxFiles}</span>
|
|
1102
|
+
</div>
|
|
1103
|
+
${this.dropzone?n.html`<div class="strip" part="dropzone" data-drag=${String(this.dragging)}>
|
|
1104
|
+
<span class="strip-label">${this.msg.dropOrChoose}</span>
|
|
1105
|
+
<button class="secondary" ?disabled=${!this.canAddMore} @click=${this.open}>
|
|
1106
|
+
${this.msg.chooseFiles}
|
|
1107
|
+
</button>
|
|
1108
|
+
</div>`:n.html`<button class="secondary" ?disabled=${!this.canAddMore} @click=${this.open}>
|
|
1109
|
+
${this.msg.chooseFiles}
|
|
1110
|
+
</button>`}
|
|
1111
|
+
${this.hint?n.html`<div class="hint">${this.hint}</div>`:n.nothing} ${this.renderNotice()}
|
|
1112
|
+
${this.renderRows()} ${this.renderUploadCta()} ${this.renderBranding()}
|
|
1113
|
+
</div>`}renderButton(){const e=this.items[this.items.length-1];return n.html`<div class="button-view">
|
|
1114
|
+
<button class="primary" ?disabled=${this.busy||!this.canAddMore} @click=${this.open}>
|
|
1115
|
+
${this.busy?this.msg.uploading:this.msg.chooseFile}
|
|
1116
|
+
</button>
|
|
1117
|
+
${e&&e.status!=="ready"?n.html`<div class="sz" data-state=${e.status}>${this.renderStatus(e)}</div>`:n.nothing}
|
|
1118
|
+
${this.renderNotice()}
|
|
1119
|
+
</div>`}render(){return n.html`${this.renderInput()}${this.view==="button"?this.renderButton():this.view==="compact"?this.renderCompact():this.renderFull()}`}},w=new WeakMap,k=new WeakMap,z=new WeakMap,U=new WeakMap,$=new WeakMap,S=new WeakMap,C=new WeakMap,M=new WeakMap,T=new WeakMap,L=new WeakMap,F=new WeakMap,O=new WeakMap,D=new WeakMap,j=new WeakMap,A=new WeakMap,E=new WeakMap,N=new WeakMap,B=new WeakMap,P=new WeakMap,R=new WeakMap,I=new WeakMap,G=new WeakMap,_=new WeakMap,K=new WeakMap,W=new WeakMap,q=new WeakMap,Y=new WeakMap,H=new WeakMap,V=new WeakMap,J=new WeakMap,he);We(exports.SinglebaseUploader,"styles",[me,xe,n.css`
|
|
1120
|
+
.card {
|
|
1121
|
+
display: flex;
|
|
1122
|
+
flex-direction: column;
|
|
1123
|
+
gap: 14px;
|
|
1124
|
+
box-sizing: border-box;
|
|
1125
|
+
padding: var(--sb-pad, 20px);
|
|
1126
|
+
background: var(--sb-surface, #ffffff);
|
|
1127
|
+
color: var(--sb-ink, #16181a);
|
|
1128
|
+
border: 1px solid var(--sb-border, #e4e6e9);
|
|
1129
|
+
border-radius: calc(var(--sb-radius, 4px) + 4px);
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
.logo-img {
|
|
1133
|
+
display: block;
|
|
1134
|
+
align-self: flex-start;
|
|
1135
|
+
height: var(--sb-logo-height, 20px);
|
|
1136
|
+
width: auto;
|
|
1137
|
+
max-width: 100%;
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
.brand-mark {
|
|
1141
|
+
font-family: var(--sb-mono, "Geist Mono", ui-monospace, monospace);
|
|
1142
|
+
font-size: 13px;
|
|
1143
|
+
letter-spacing: 0.08em;
|
|
1144
|
+
text-transform: uppercase;
|
|
1145
|
+
color: var(--sb-ink, #16181a);
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
.head-block {
|
|
1149
|
+
display: flex;
|
|
1150
|
+
flex-direction: column;
|
|
1151
|
+
gap: 6px;
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
.count {
|
|
1155
|
+
font-family: var(--sb-mono, "Geist Mono", ui-monospace, monospace);
|
|
1156
|
+
font-size: 11.5px;
|
|
1157
|
+
letter-spacing: 0.06em;
|
|
1158
|
+
text-transform: uppercase;
|
|
1159
|
+
color: var(--sb-muted-ink, #61666c);
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
/* ── dropzone ─────────────────────────────────────── */
|
|
1163
|
+
.drop {
|
|
1164
|
+
display: flex;
|
|
1165
|
+
flex-direction: column;
|
|
1166
|
+
align-items: center;
|
|
1167
|
+
gap: 6px;
|
|
1168
|
+
padding: 30px 20px;
|
|
1169
|
+
text-align: center;
|
|
1170
|
+
border: 1px dashed var(--sb-border-strong, #cdd1d6);
|
|
1171
|
+
border-radius: calc(var(--sb-radius, 4px) + 2px);
|
|
1172
|
+
background: var(--sb-surface, #ffffff);
|
|
1173
|
+
transition:
|
|
1174
|
+
border-color 0.15s,
|
|
1175
|
+
background 0.15s;
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
.drop[data-drag="true"] {
|
|
1179
|
+
border-color: var(--sb-accent, #111111);
|
|
1180
|
+
background: var(--sb-surface-alt, #fafafa);
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
.arrow {
|
|
1184
|
+
display: flex;
|
|
1185
|
+
align-items: center;
|
|
1186
|
+
justify-content: center;
|
|
1187
|
+
width: 42px;
|
|
1188
|
+
height: 42px;
|
|
1189
|
+
margin-bottom: 4px;
|
|
1190
|
+
font-size: 18px;
|
|
1191
|
+
line-height: 1;
|
|
1192
|
+
border: 1px solid var(--sb-border, #e4e6e9);
|
|
1193
|
+
border-radius: 50%;
|
|
1194
|
+
color: var(--sb-ink, #16181a);
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
.drop-title {
|
|
1198
|
+
font-size: 14px;
|
|
1199
|
+
font-weight: 600;
|
|
1200
|
+
color: var(--sb-ink, #16181a);
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
/* the compact single-line dropzone */
|
|
1204
|
+
.strip {
|
|
1205
|
+
display: flex;
|
|
1206
|
+
align-items: center;
|
|
1207
|
+
justify-content: space-between;
|
|
1208
|
+
gap: 12px;
|
|
1209
|
+
padding: 10px 12px;
|
|
1210
|
+
border: 1px solid var(--sb-border, #e4e6e9);
|
|
1211
|
+
border-radius: calc(var(--sb-radius, 4px) + 2px);
|
|
1212
|
+
background: var(--sb-surface-alt, #fafafa);
|
|
1213
|
+
transition:
|
|
1214
|
+
border-color 0.15s,
|
|
1215
|
+
background 0.15s;
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
.strip[data-drag="true"] {
|
|
1219
|
+
border-color: var(--sb-accent, #111111);
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
.strip-label {
|
|
1223
|
+
font-size: 14px;
|
|
1224
|
+
color: var(--sb-muted-ink, #61666c);
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
/* ── file rows ────────────────────────────────────── */
|
|
1228
|
+
.rows {
|
|
1229
|
+
display: flex;
|
|
1230
|
+
flex-direction: column;
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
.row {
|
|
1234
|
+
display: flex;
|
|
1235
|
+
align-items: center;
|
|
1236
|
+
gap: 12px;
|
|
1237
|
+
padding: 12px 0;
|
|
1238
|
+
border-top: 1px solid var(--sb-border, #e4e6e9);
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
.rows .row:first-child {
|
|
1242
|
+
border-top: none;
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
.chip {
|
|
1246
|
+
display: flex;
|
|
1247
|
+
align-items: center;
|
|
1248
|
+
justify-content: center;
|
|
1249
|
+
flex: 0 0 auto;
|
|
1250
|
+
width: 46px;
|
|
1251
|
+
height: 46px;
|
|
1252
|
+
font-family: var(--sb-mono, "Geist Mono", ui-monospace, monospace);
|
|
1253
|
+
font-size: 10.5px;
|
|
1254
|
+
letter-spacing: 0.04em;
|
|
1255
|
+
color: var(--sb-muted-ink, #61666c);
|
|
1256
|
+
background: var(--sb-surface-alt, #fafafa);
|
|
1257
|
+
border: 1px solid var(--sb-border, #e4e6e9);
|
|
1258
|
+
border-radius: var(--sb-radius, 4px);
|
|
1259
|
+
overflow: hidden;
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
.thumb {
|
|
1263
|
+
display: block;
|
|
1264
|
+
width: 100%;
|
|
1265
|
+
height: 100%;
|
|
1266
|
+
object-fit: cover;
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
.meta {
|
|
1270
|
+
flex: 1;
|
|
1271
|
+
min-width: 0;
|
|
1272
|
+
display: flex;
|
|
1273
|
+
flex-direction: column;
|
|
1274
|
+
gap: 4px;
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
.name {
|
|
1278
|
+
font-size: 14px;
|
|
1279
|
+
font-weight: 500;
|
|
1280
|
+
color: var(--sb-ink, #16181a);
|
|
1281
|
+
overflow: hidden;
|
|
1282
|
+
text-overflow: ellipsis;
|
|
1283
|
+
white-space: nowrap;
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
button.name {
|
|
1287
|
+
align-self: flex-start;
|
|
1288
|
+
max-width: 100%;
|
|
1289
|
+
padding: 0;
|
|
1290
|
+
border: none;
|
|
1291
|
+
background: none;
|
|
1292
|
+
text-align: left;
|
|
1293
|
+
border-radius: 0;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
button.name:hover {
|
|
1297
|
+
text-decoration: underline;
|
|
1298
|
+
text-underline-offset: 3px;
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
.name-input {
|
|
1302
|
+
font-size: 14px;
|
|
1303
|
+
padding: 6px 8px;
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
.sz {
|
|
1307
|
+
font-size: 12px;
|
|
1308
|
+
color: var(--sb-muted-ink, #61666c);
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
.sz[data-state="error"] {
|
|
1312
|
+
color: var(--sb-danger, #b4231a);
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
.sz[data-state="done"] {
|
|
1316
|
+
color: var(--sb-ok, #0f6b4a);
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
.bar {
|
|
1320
|
+
height: 3px;
|
|
1321
|
+
margin-top: 2px;
|
|
1322
|
+
border-radius: 999px;
|
|
1323
|
+
background: var(--sb-border, #e4e6e9);
|
|
1324
|
+
overflow: hidden;
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
.bar-fill {
|
|
1328
|
+
height: 100%;
|
|
1329
|
+
background: var(--sb-accent, #111111);
|
|
1330
|
+
transition: width 0.2s linear;
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
.row-act {
|
|
1334
|
+
flex: 0 0 auto;
|
|
1335
|
+
display: flex;
|
|
1336
|
+
align-items: center;
|
|
1337
|
+
gap: 10px;
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
/* ── the dashed "add more" affordance ─────────────── */
|
|
1341
|
+
button.add-more {
|
|
1342
|
+
width: 100%;
|
|
1343
|
+
padding: 14px;
|
|
1344
|
+
color: var(--sb-ink, #16181a);
|
|
1345
|
+
background: none;
|
|
1346
|
+
border: 1px dashed var(--sb-border-strong, #cdd1d6);
|
|
1347
|
+
border-radius: calc(var(--sb-radius, 4px) + 2px);
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
button.add-more:hover:not(:disabled) {
|
|
1351
|
+
background: var(--sb-surface-alt, #fafafa);
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
button.wide {
|
|
1355
|
+
width: 100%;
|
|
1356
|
+
padding: 13px;
|
|
1357
|
+
font-size: 14px;
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
.branding {
|
|
1361
|
+
text-align: center;
|
|
1362
|
+
font-family: var(--sb-mono, "Geist Mono", ui-monospace, monospace);
|
|
1363
|
+
font-size: 10.5px;
|
|
1364
|
+
letter-spacing: 0.06em;
|
|
1365
|
+
color: var(--sb-muted-ink, #61666c);
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
.branding a {
|
|
1369
|
+
color: inherit;
|
|
1370
|
+
text-decoration: none;
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1373
|
+
.branding a:hover {
|
|
1374
|
+
color: var(--sb-ink, #16181a);
|
|
1375
|
+
text-decoration: underline;
|
|
1376
|
+
text-underline-offset: 3px;
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
/* the button view is just a control, not a card */
|
|
1380
|
+
:host([view="button"]) {
|
|
1381
|
+
display: inline-block;
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
.button-view {
|
|
1385
|
+
display: flex;
|
|
1386
|
+
flex-direction: column;
|
|
1387
|
+
gap: 8px;
|
|
1388
|
+
}
|
|
1389
|
+
`]);f([u.property({attribute:!1})],exports.SinglebaseUploader.prototype,"client",1);f([u.property({attribute:!1})],exports.SinglebaseUploader.prototype,"messages",1);f([u.property({reflect:!0})],exports.SinglebaseUploader.prototype,"theme",1);f([u.property({reflect:!0})],exports.SinglebaseUploader.prototype,"density",1);f([u.property({reflect:!0})],exports.SinglebaseUploader.prototype,"view",1);f([u.property({converter:le})],exports.SinglebaseUploader.prototype,"dropzone",1);f([u.property({converter:le,attribute:"allow-rename"})],exports.SinglebaseUploader.prototype,"allowRename",1);f([u.property({type:Boolean,attribute:"auto-upload"})],exports.SinglebaseUploader.prototype,"autoUpload",1);f([u.property({converter:le})],exports.SinglebaseUploader.prototype,"branding",1);f([u.property({attribute:"logo-url"})],exports.SinglebaseUploader.prototype,"logoUrl",1);f([u.property({attribute:"logo-text"})],exports.SinglebaseUploader.prototype,"logoText",1);f([u.property()],exports.SinglebaseUploader.prototype,"heading",1);f([u.property()],exports.SinglebaseUploader.prototype,"description",1);f([u.property({type:Number,attribute:"max-files"})],exports.SinglebaseUploader.prototype,"maxFiles",1);f([u.property({attribute:"max-size"})],exports.SinglebaseUploader.prototype,"maxSize",1);f([u.property({attribute:"min-size"})],exports.SinglebaseUploader.prototype,"minSize",1);f([u.property()],exports.SinglebaseUploader.prototype,"accept",1);f([u.property({converter:se})],exports.SinglebaseUploader.prototype,"rules",1);f([u.property()],exports.SinglebaseUploader.prototype,"bucket",1);f([u.property({converter:se})],exports.SinglebaseUploader.prototype,"metadata",1);f([u.property({converter:se})],exports.SinglebaseUploader.prototype,"options",1);f([u.property({type:Boolean,attribute:"public-read"})],exports.SinglebaseUploader.prototype,"publicRead",1);f([u.property({attribute:"redirect-url"})],exports.SinglebaseUploader.prototype,"redirectUrl",1);f([u.property({attribute:!1})],exports.SinglebaseUploader.prototype,"onComplete",1);f([u.property({attribute:!1})],exports.SinglebaseUploader.prototype,"onError",1);f([u.state()],exports.SinglebaseUploader.prototype,"items",1);f([u.state()],exports.SinglebaseUploader.prototype,"notice",1);f([u.state()],exports.SinglebaseUploader.prototype,"busy",1);f([u.state()],exports.SinglebaseUploader.prototype,"dragging",1);f([u.state()],exports.SinglebaseUploader.prototype,"editing",1);exports.SinglebaseUploader=f([u.customElement("singlebase-uploader")],exports.SinglebaseUploader);function qe(t){return!t.type.startsWith("image/")||typeof URL.createObjectURL!="function"?"":URL.createObjectURL(t)}function y(t){t.preview&&URL.revokeObjectURL(t.preview)}function Ye(t){return t instanceof Error?t.message:""}exports.TOKEN_DEFAULTS=ne;exports.defaultUploadMessages=ie;exports.inspectFile=ze;exports.isInspectable=Ue;exports.resolveRedirectTarget=ve;exports.resolveUploadMessages=ye;exports.sharedStyles=xe;exports.tokenDefaults=me;
|
|
1390
|
+
//# sourceMappingURL=uploader-eFYKpk8b.cjs.map
|