@slyxup/ui 0.2.15 → 0.3.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/src/styles.ts DELETED
@@ -1,619 +0,0 @@
1
- /**
2
- * SlyxUp UI — design tokens + stylesheet.
3
- * Injected automatically by every SlyxUp component. Theme by overriding
4
- * CSS variables on :root or .slyxup-scope.
5
- */
6
-
7
- export const FONT_LINK = '';
8
-
9
- export const CSS = `
10
- .slyxup-root {
11
- /* ── Tokens ── */
12
- --slx-accent: #5b5bd6;
13
- --slx-accent-hover: #4c4cc4;
14
- --slx-accent-soft: rgba(91, 91, 214, 0.12);
15
- --slx-bg: #ffffff;
16
- --slx-bg-subtle: #f7f7fb;
17
- --slx-bg-page: #e9eaf6;
18
- --slx-ink: #16161d;
19
- --slx-ink-strong: #0c0c12;
20
- --slx-muted: #6f6f7b;
21
- --slx-border: #e3e3ee;
22
- --slx-border-strong: #d3d3e2;
23
- --slx-danger: #d64550;
24
- --slx-success: #1f9d55;
25
- --slx-radius-sm: 8px;
26
- --slx-radius: 10px;
27
- --slx-radius-lg: 14px;
28
- --slx-font: inherit;
29
- --slx-display: inherit;
30
- --slx-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
31
- --slx-shadow-card:
32
- 0 1px 2px rgba(18,18,28,.05),
33
- 0 8px 24px -6px rgba(18,18,28,.09),
34
- 0 24px 64px -16px rgba(18,18,28,.13);
35
- --slx-shadow-pop:
36
- 0 2px 6px rgba(18,18,28,.08),
37
- 0 16px 48px -12px rgba(18,18,28,.18);
38
-
39
- font-family: var(--slx-font);
40
- color: var(--slx-ink);
41
- -webkit-font-smoothing: antialiased;
42
- text-rendering: optimizeLegibility;
43
- font-feature-settings: "cv11", "ss01";
44
- }
45
- @media (prefers-color-scheme: dark) {
46
- .slyxup-root:not(.slyxup-light) {
47
- --slx-accent: #8484f2;
48
- --slx-accent-hover: #9696f5;
49
- --slx-accent-soft: rgba(132, 132, 242, 0.16);
50
- --slx-bg: #17171f;
51
- --slx-bg-subtle: #1e1e28;
52
- --slx-bg-page: #101016;
53
- --slx-ink: #f0f0f4;
54
- --slx-ink-strong: #ffffff;
55
- --slx-muted: #9a9aa6;
56
- --slx-border: #292935;
57
- --slx-border-strong: #343442;
58
- --slx-danger: #f0737d;
59
- --slx-success: #4ade80;
60
- --slx-shadow-card:
61
- 0 1px 2px rgba(0,0,0,.25),
62
- 0 12px 32px -8px rgba(0,0,0,.5),
63
- 0 32px 72px -20px rgba(0,0,0,.55);
64
- --slx-shadow-pop:
65
- 0 4px 12px rgba(0,0,0,.4),
66
- 0 24px 56px -12px rgba(0,0,0,.6);
67
- }
68
- }
69
-
70
- @keyframes slx-shake {
71
- 10%, 90% { transform: translateX(-1px); }
72
- 20%, 80% { transform: translateX(2px); }
73
- 30%, 50%, 70% { transform: translateX(-4px); }
74
- 40%, 60% { transform: translateX(4px); }
75
- }
76
- @keyframes slx-spin { to { transform: rotate(360deg); } }
77
- @keyframes slx-rise {
78
- from { opacity: 0; transform: translateY(8px) scale(.985); }
79
- to { opacity: 1; transform: translateY(0) scale(1); }
80
- }
81
- @keyframes slx-pop {
82
- 0% { transform: scale(.5); opacity: 0; }
83
- 60% { transform: scale(1.08); opacity: 1; }
84
- 100% { transform: scale(1); }
85
- }
86
- @media (prefers-reduced-motion: reduce) {
87
- .slyxup-root * { animation: none !important; transition: none !important; }
88
- }
89
-
90
- /* ── Card ── */
91
- .slx-card {
92
- width: 100%;
93
- max-width: 400px;
94
- background: var(--slx-bg);
95
- border: 1px solid var(--slx-border);
96
- border-radius: var(--slx-radius-lg);
97
- padding: 34px 34px 30px;
98
- box-shadow: var(--slx-shadow-card);
99
- box-sizing: border-box;
100
- animation: slx-rise .38s cubic-bezier(.22,.9,.32,1) both;
101
- }
102
- .slyxup-root:not(.slyxup-light) .slx-card,
103
- .slx-card { color: var(--slx-ink); }
104
- .slx-card-error { animation: slx-shake .45s cubic-bezier(.36,.07,.19,.97) both; }
105
-
106
- /* ── Header / keyhole mark ── */
107
- .slx-mark {
108
- width: 46px; height: 46px; border-radius: 13px;
109
- display: flex; align-items: center; justify-content: center;
110
- background: linear-gradient(140deg, var(--slx-accent) 0%, #8b5cf6 100%);
111
- box-shadow:
112
- inset 0 1px 0 rgba(255,255,255,.28),
113
- 0 6px 16px -6px rgba(91,91,214,.55);
114
- margin-bottom: 20px;
115
- }
116
- .slx-mark svg { display: block; filter: drop-shadow(0 1px 1px rgba(0,0,0,.18)); }
117
- .slx-title {
118
- font-family: var(--slx-display);
119
- font-size: 21px; font-weight: 650; letter-spacing: -0.022em;
120
- color: var(--slx-ink-strong);
121
- margin: 0 0 6px;
122
- }
123
- .slx-subtitle { font-size: 13.5px; color: var(--slx-muted); margin: 0 0 24px; line-height: 1.55; }
124
-
125
- /* ── Fields ── */
126
- .slx-field { margin-bottom: 15px; }
127
- .slx-row {
128
- display: flex; align-items: baseline; justify-content: space-between;
129
- margin-bottom: 6px;
130
- }
131
- .slx-label {
132
- display: inline-block;
133
- font-size: 12.5px; font-weight: 550; letter-spacing: 0.01em;
134
- color: var(--slx-ink);
135
- }
136
- .slx-input {
137
- width: 100%; box-sizing: border-box;
138
- font: inherit; font-size: 14px; line-height: 1.4; color: var(--slx-ink);
139
- background: var(--slx-bg-subtle);
140
- border: 1px solid var(--slx-border);
141
- border-radius: var(--slx-radius);
142
- padding: 10px 13px;
143
- outline: none;
144
- transition: border-color .15s, box-shadow .15s, background .15s;
145
- }
146
- .slx-input::placeholder { color: var(--slx-muted); opacity: .7; }
147
- .slx-input:hover { border-color: var(--slx-border-strong); }
148
- .slx-input:focus-visible {
149
- background: var(--slx-bg);
150
- border-color: var(--slx-accent);
151
- box-shadow: 0 0 0 3.5px var(--slx-accent-soft);
152
- }
153
- .slx-hint { font-size: 12px; color: var(--slx-muted); margin-top: 5px; }
154
- .slx-error-text {
155
- font-size: 13px; color: var(--slx-danger);
156
- background: color-mix(in srgb, var(--slx-danger) 8%, transparent);
157
- border: 1px solid color-mix(in srgb, var(--slx-danger) 26%, transparent);
158
- border-left: 3px solid var(--slx-danger);
159
- border-radius: var(--slx-radius-sm);
160
- padding: 10px 12px; margin: 0 0 16px; line-height: 1.45;
161
- }
162
- .slx-setup-note {
163
- font-size: 12px; line-height: 1.45;
164
- color: #7a5c00;
165
- background: #fff7dc;
166
- border: 1px solid #f3e3a0;
167
- border-radius: var(--slx-radius-sm);
168
- padding: 9px 11px; margin: 0 0 16px;
169
- }
170
- .slyxup-root:not(.slyxup-light) .slx-setup-note {
171
- color: #f5d878; background: rgba(250,204,21,.07); border-color: rgba(250,204,21,.25);
172
- }
173
- .slx-setup-note code {
174
- font-family: var(--slx-mono); font-size: 11px;
175
- background: rgba(0,0,0,.05); border-radius: 4px; padding: 1px 4px;
176
- }
177
- .slyxup-root:not(.slyxup-light) .slx-setup-note code { background: rgba(255,255,255,.08); }
178
-
179
- /* ── Primary button ── */
180
- .slx-btn {
181
- width: 100%; box-sizing: border-box;
182
- font-family: var(--slx-font); font-size: 14px; font-weight: 600; letter-spacing: 0.01em;
183
- color: #fff; background: linear-gradient(180deg, #23232e 0%, #0a0a0f 100%);
184
- border: 1px solid #0a0a0f; border-radius: var(--slx-radius);
185
- padding: 11px 14px; cursor: pointer;
186
- box-shadow: 0 1px 2px rgba(10,10,15,.35), inset 0 1px 0 rgba(255,255,255,.08);
187
- display: inline-flex; align-items: center; justify-content: center; gap: 8px;
188
- transition: filter .15s, transform .06s, box-shadow .15s;
189
- }
190
- .slx-btn:hover { filter: brightness(1.22); }
191
- .slx-btn:active { transform: scale(.985); filter: brightness(.92); }
192
- .slx-btn:focus-visible { outline: none; box-shadow: 0 0 0 3.5px rgba(10,10,15,.16), 0 0 0 1.5px #0a0a0f; }
193
- .slx-btn[disabled] { opacity: .55; cursor: not-allowed; }
194
- @media (prefers-color-scheme: dark) {
195
- .slyxup-root:not(.slyxup-light) .slx-btn {
196
- background: linear-gradient(180deg, #ffffff 0%, #ececf1 100%);
197
- color: #0a0a0f; border-color: #ececf1;
198
- box-shadow: 0 1px 2px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.9);
199
- }
200
- .slyxup-root:not(.slyxup-light) .slx-btn:hover { filter: brightness(.94); }
201
- }
202
- .slx-spinner {
203
- width: 15px; height: 15px; flex: none;
204
- border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
205
- border-radius: 50%; animation: slx-spin .7s linear infinite;
206
- }
207
- .slyxup-root:not(.slyxup-light) .slx-spinner { border-color: rgba(10,10,15,.25); border-top-color: #0a0a0f; }
208
-
209
- /* ── Social ── */
210
- .slx-social { display: grid; gap: 9px; margin-bottom: 4px; }
211
- .slx-social-btn {
212
- width: 100%; box-sizing: border-box;
213
- font: inherit; font-size: 13.5px; font-weight: 550;
214
- color: var(--slx-ink); background: var(--slx-bg);
215
- border: 1px solid var(--slx-border-strong); border-radius: var(--slx-radius);
216
- padding: 10px 14px; cursor: pointer;
217
- display: inline-flex; align-items: center; justify-content: center; gap: 10px;
218
- transition: background .15s, border-color .15s, transform .06s, box-shadow .15s;
219
- }
220
- .slx-social-btn:hover {
221
- background: var(--slx-bg-subtle);
222
- border-color: var(--slx-border-strong);
223
- box-shadow: 0 2px 8px -2px rgba(18,18,28,.12);
224
- }
225
- .slx-social-btn:active { transform: scale(.985); }
226
- .slx-social-btn:focus-visible { outline: none; box-shadow: 0 0 0 3.5px var(--slx-accent-soft); }
227
- .slx-social-btn svg { flex: none; }
228
-
229
- /* ── Divider & footer ── */
230
- .slx-divider {
231
- display: flex; align-items: center; gap: 14px;
232
- color: var(--slx-muted); font-size: 11.5px;
233
- letter-spacing: .04em; text-transform: uppercase;
234
- margin: 18px 0;
235
- }
236
- .slx-divider::before, .slx-divider::after {
237
- content: ""; height: 1px; flex: 1;
238
- background: linear-gradient(90deg, transparent, var(--slx-border-strong));
239
- }
240
- .slx-divider::after { background: linear-gradient(90deg, var(--slx-border-strong), transparent); }
241
- .slx-footer { font-size: 13px; color: var(--slx-muted); margin-top: 22px; text-align: center; }
242
- .slx-link {
243
- color: var(--slx-accent); font-weight: 600; text-decoration: none; cursor: pointer;
244
- background: none; border: none; font: inherit; font-size: inherit;
245
- padding: 0; margin: 0;
246
- }
247
- .slx-link:hover { text-decoration: underline; color: var(--slx-accent-hover); }
248
- .slx-link:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--slx-accent-soft); border-radius: 4px; }
249
- .slx-forgot { font-size: 12px; }
250
-
251
- /* ── Success state ── */
252
- .slx-success-icon {
253
- width: 48px; height: 48px; border-radius: 50%;
254
- display: flex; align-items: center; justify-content: center;
255
- background: color-mix(in srgb, var(--slx-success) 12%, transparent);
256
- color: var(--slx-success); margin: 4px auto 18px;
257
- animation: slx-pop .45s cubic-bezier(.22,.9,.32,1) both;
258
- box-shadow: 0 0 0 6px color-mix(in srgb, var(--slx-success) 6%, transparent);
259
- }
260
-
261
- /* ── User button ── */
262
- .slx-userbtn-wrap { position: relative; display: inline-block; }
263
- .slx-userbtn-avatar {
264
- width: 36px; height: 36px; border-radius: 50%;
265
- border: 1px solid var(--slx-border); cursor: pointer;
266
- display: flex; align-items: center; justify-content: center;
267
- font-size: 14px; font-weight: 650; color: #fff;
268
- background: linear-gradient(135deg, var(--slx-accent), #8b5cf6);
269
- padding: 0; overflow: hidden;
270
- transition: box-shadow .15s, transform .06s;
271
- }
272
- .slx-userbtn-avatar:hover { box-shadow: 0 0 0 3px var(--slx-accent-soft); }
273
- .slx-userbtn-avatar:active { transform: scale(.96); }
274
- .slx-userbtn-avatar img { width: 100%; height: 100%; object-fit: cover; }
275
- .slx-userbtn-avatar:focus-visible { outline: none; box-shadow: 0 0 0 3.5px var(--slx-accent-soft); }
276
- .slx-menu {
277
- position: absolute; right: 0; top: calc(100% + 8px);
278
- min-width: 240px;
279
- background: var(--slx-bg);
280
- border: 1px solid var(--slx-border);
281
- border-radius: var(--slx-radius-lg);
282
- box-shadow: var(--slx-shadow-pop);
283
- overflow: hidden; z-index: 1000;
284
- animation: slx-rise .22s cubic-bezier(.22,.9,.32,1) both;
285
- }
286
- .slx-menu-header { padding: 14px 16px; border-bottom: 1px solid var(--slx-border); background: var(--slx-bg-subtle); }
287
- .slx-menu-name { font-size: 14px; font-weight: 600; margin: 0 0 2px; color: var(--slx-ink-strong); }
288
- .slx-menu-email { font-size: 12.5px; color: var(--slx-muted); margin: 0; word-break: break-all; }
289
- .slx-menu-item {
290
- display: block; width: 100%; text-align: left; box-sizing: border-box;
291
- font: inherit; font-size: 13.5px; color: var(--slx-ink);
292
- background: none; border: none; padding: 10px 16px; cursor: pointer;
293
- transition: background .12s;
294
- }
295
- .slx-menu-item:hover { background: color-mix(in srgb, var(--slx-ink) 4%, transparent); }
296
- .slx-menu-item:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--slx-accent-soft); }
297
- .slx-menu-item-danger { color: var(--slx-danger); }
298
- .slx-menu-item-danger:hover { background: color-mix(in srgb, var(--slx-danger) 7%, transparent); }
299
-
300
- /* ── Badge (verified etc.) ── */
301
- .slx-badge {
302
- display: inline-flex; align-items: center; gap: 5px;
303
- font-size: 11px; font-weight: 600; letter-spacing: .02em;
304
- padding: 2.5px 9px; border-radius: 999px;
305
- color: var(--slx-success);
306
- background: color-mix(in srgb, var(--slx-success) 9%, transparent);
307
- border: 1px solid color-mix(in srgb, var(--slx-success) 30%, transparent);
308
- }
309
- .slx-badge-ok { color: var(--slx-success); background: color-mix(in srgb, var(--slx-success) 9%, transparent); border-color: color-mix(in srgb, var(--slx-success) 30%, transparent); }
310
- .slx-badge-warn { color: #b45309; background: color-mix(in srgb, #f59e0b 10%, transparent); border-color: color-mix(in srgb, #f59e0b 30%, transparent); }
311
- .slx-badge-accent { color: var(--slx-accent); background: var(--slx-accent-soft); border-color: color-mix(in srgb, var(--slx-accent) 30%, transparent); }
312
- .slyxup-root:not(.slyxup-light) .slx-badge-warn { color: #fbbf24; }
313
-
314
- /* ── Modal overlay ── */
315
- .slx-overlay {
316
- position: fixed; inset: 0; z-index: 9999;
317
- display: flex; align-items: center; justify-content: center;
318
- background: rgba(12, 12, 18, 0.55);
319
- backdrop-filter: blur(6px);
320
- animation: slx-rise .2s cubic-bezier(.22,.9,.32,1) both;
321
- padding: 16px;
322
- overflow-y: auto;
323
- box-sizing: border-box;
324
- }
325
-
326
- /* ── UserProfile ── */
327
- .slx-profile-modal {
328
- display: flex; flex-direction: column;
329
- width: 720px; max-width: calc(100vw - 32px);
330
- max-height: min(85vh, 720px);
331
- background: var(--slx-bg);
332
- border-radius: var(--slx-radius-lg);
333
- box-shadow: var(--slx-shadow-pop);
334
- overflow: hidden;
335
- animation: slx-rise .28s cubic-bezier(.22,.9,.32,1) both;
336
- box-sizing: border-box;
337
- }
338
- .slx-profile-head {
339
- display: flex; align-items: center; justify-content: space-between;
340
- padding: 22px 28px 18px;
341
- border-bottom: 1px solid var(--slx-border);
342
- flex-shrink: 0;
343
- background: var(--slx-bg);
344
- position: relative;
345
- z-index: 1;
346
- }
347
- .slx-profile-title {
348
- font-family: var(--slx-display);
349
- font-size: 18px; font-weight: 650; letter-spacing: -0.02em;
350
- color: var(--slx-ink-strong);
351
- margin: 0;
352
- }
353
- .slx-profile-close {
354
- width: 32px; height: 32px; border-radius: 8px;
355
- display: flex; align-items: center; justify-content: center;
356
- background: none; border: 1px solid var(--slx-border);
357
- color: var(--slx-muted); cursor: pointer; font-size: 16px;
358
- transition: background .12s, color .12s, border-color .12s;
359
- position: relative;
360
- z-index: 2;
361
- pointer-events: auto;
362
- flex-shrink: 0;
363
- -webkit-tap-highlight-color: transparent;
364
- touch-action: manipulation;
365
- }
366
- .slx-profile-close:hover { background: var(--slx-bg-subtle); color: var(--slx-ink); border-color: var(--slx-border-strong); }
367
- .slx-profile-close:active { transform: scale(.95); }
368
- .slx-profile-close:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--slx-accent-soft); }
369
-
370
- .slx-profile-body {
371
- display: flex; flex: 1; min-height: 380px;
372
- overflow: hidden;
373
- min-width: 0;
374
- }
375
-
376
- /* ── Left nav ── */
377
- .slx-profile-nav {
378
- width: 200px; flex-shrink: 0;
379
- display: flex; flex-direction: column; gap: 2px;
380
- padding: 12px 8px;
381
- border-right: 1px solid var(--slx-border);
382
- background: var(--slx-bg-subtle);
383
- }
384
- .slx-profile-nav-btn {
385
- display: flex; align-items: center; gap: 9px;
386
- font: inherit; font-size: 13.5px; font-weight: 500;
387
- color: var(--slx-muted); background: none; border: none;
388
- border-radius: var(--slx-radius-sm);
389
- padding: 9px 12px; cursor: pointer; text-align: left;
390
- transition: background .12s, color .12s;
391
- }
392
- .slx-profile-nav-btn:hover { background: color-mix(in srgb, var(--slx-ink) 5%, transparent); color: var(--slx-ink); }
393
- .slx-profile-nav-btn.on { background: var(--slx-bg); color: var(--slx-ink-strong); font-weight: 600; box-shadow: 0 1px 3px rgba(18,18,28,.06); }
394
- .slx-profile-nav-btn:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--slx-accent-soft); }
395
-
396
- /* ── Content area ── */
397
- .slx-profile-content {
398
- flex: 1; overflow-y: auto; padding: 24px 28px 28px;
399
- }
400
- .slx-profile-sec { margin-bottom: 28px; }
401
- .slx-profile-sec:last-child { margin-bottom: 0; }
402
- .slx-sec-title {
403
- font-family: var(--slx-display);
404
- font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
405
- color: var(--slx-ink-strong);
406
- margin: 0 0 14px; padding-bottom: 10px;
407
- border-bottom: 1px solid var(--slx-border);
408
- }
409
-
410
- /* ── Avatar ── */
411
- .slx-avatar-row {
412
- display: flex; align-items: center; gap: 16px;
413
- margin-bottom: 20px;
414
- }
415
- .slx-avatar-lg {
416
- width: 64px; height: 64px; border-radius: 50%;
417
- flex-shrink: 0;
418
- display: flex; align-items: center; justify-content: center;
419
- font-size: 24px; font-weight: 700; color: #fff;
420
- background: linear-gradient(135deg, var(--slx-accent), #8b5cf6);
421
- overflow: hidden;
422
- box-shadow: 0 2px 8px rgba(91,91,214,.3);
423
- }
424
- .slx-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
425
-
426
- /* ── Row (email etc.) ── */
427
- .slx-row-value { font-size: 14px; font-weight: 500; color: var(--slx-ink-strong); margin: 0; }
428
- .slx-row-label { font-size: 12px; color: var(--slx-muted); margin: 2px 0 0; }
429
-
430
- /* ── Sessions ── */
431
- .slx-session {
432
- display: flex; align-items: center; justify-content: space-between;
433
- padding: 12px 14px; border-radius: var(--slx-radius-sm);
434
- border: 1px solid var(--slx-border);
435
- background: var(--slx-bg-subtle);
436
- margin-bottom: 8px;
437
- transition: border-color .12s;
438
- }
439
- .slx-session:hover { border-color: var(--slx-border-strong); }
440
- .slx-session-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
441
- .slx-session-device { font-size: 13.5px; font-weight: 550; color: var(--slx-ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
442
- .slx-session-sub { font-size: 12px; color: var(--slx-muted); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
443
-
444
- /* ── Pagination ── */
445
- .slx-pagination {
446
- display: flex; align-items: center; justify-content: center; gap: 10px;
447
- margin-top: 14px; padding-top: 14px;
448
- border-top: 1px solid var(--slx-border);
449
- }
450
- .slx-pagination-info { font-size: 12.5px; color: var(--slx-muted); white-space: nowrap; }
451
-
452
- /* ── Danger zone ── */
453
- .slx-danger-zone {
454
- border: 1px solid color-mix(in srgb, var(--slx-danger) 30%, transparent);
455
- border-radius: var(--slx-radius);
456
- padding: 18px 20px;
457
- background: color-mix(in srgb, var(--slx-danger) 4%, transparent);
458
- }
459
- .slx-danger-title {
460
- font-size: 14px; font-weight: 650; color: var(--slx-danger);
461
- margin: 0 0 6px;
462
- }
463
- .slx-danger-desc {
464
- font-size: 13px; color: var(--slx-muted); line-height: 1.5;
465
- margin: 0 0 16px;
466
- }
467
- .slx-btn-danger-outline {
468
- font: inherit; font-size: 13px; font-weight: 550;
469
- color: var(--slx-danger); background: none;
470
- border: 1px solid color-mix(in srgb, var(--slx-danger) 35%, transparent);
471
- border-radius: var(--slx-radius-sm);
472
- padding: 7px 14px; cursor: pointer;
473
- transition: background .12s, border-color .12s;
474
- }
475
- .slx-btn-danger-outline:hover { background: color-mix(in srgb, var(--slx-danger) 8%, transparent); border-color: var(--slx-danger); }
476
- .slx-btn-danger-outline:active { transform: scale(.98); }
477
- .slx-btn-danger-outline:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--slx-danger) 20%, transparent); }
478
- .slx-btn-danger-outline[disabled] { opacity: .5; cursor: not-allowed; }
479
-
480
- /* ── Billing (inside UserProfile) ── */
481
- .slx-billing-card {
482
- border: 1px solid var(--slx-border);
483
- border-radius: var(--slx-radius);
484
- padding: 18px 20px;
485
- background: var(--slx-bg-subtle);
486
- margin-bottom: 16px;
487
- }
488
- .slx-billing-plan { font-size: 15px; font-weight: 650; color: var(--slx-ink-strong); margin: 0 0 4px; }
489
- .slx-billing-detail { font-size: 13px; color: var(--slx-muted); margin: 2px 0; }
490
- .slx-billing-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
491
- .slx-billing-status-active { color: var(--slx-success); }
492
- .slx-billing-status-trialing { color: var(--slx-accent); }
493
- .slx-billing-status-canceled { color: var(--slx-danger); }
494
- .slx-invoice-row {
495
- display: flex; align-items: center; justify-content: space-between;
496
- padding: 10px 0; border-bottom: 1px solid var(--slx-border);
497
- font-size: 13px;
498
- gap: 8px;
499
- flex-wrap: wrap;
500
- }
501
- .slx-invoice-row:last-child { border-bottom: none; }
502
- .slx-invoice-date { color: var(--slx-muted); }
503
- .slx-invoice-amount { font-weight: 600; color: var(--slx-ink-strong); }
504
-
505
- /* ── Billing plans grid (responsive) ── */
506
- .slx-billing-plans {
507
- display: grid;
508
- grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
509
- gap: 12px;
510
- margin-top: 12px;
511
- }
512
- .slx-plan-card {
513
- border: 1px solid var(--slx-border);
514
- border-radius: var(--slx-radius);
515
- padding: 16px;
516
- background: var(--slx-bg);
517
- display: flex;
518
- flex-direction: column;
519
- position: relative;
520
- transition: border-color .15s, box-shadow .15s;
521
- }
522
- .slx-plan-card:hover { border-color: var(--slx-border-strong); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
523
- .slx-plan-card.popular { border-color: var(--slx-accent); box-shadow: 0 0 0 1px var(--slx-accent-soft); }
524
- .slx-plan-badge {
525
- position: absolute; top: -10px; right: 12px;
526
- font-size: 10px; font-weight: 700; letter-spacing: .05em;
527
- color: #fff; background: linear-gradient(135deg, var(--slx-accent), #8b5cf6);
528
- padding: 3px 8px; border-radius: 999px;
529
- }
530
- .slx-plan-name { font-size: 14px; font-weight: 600; color: var(--slx-ink-strong); margin: 0 0 6px; }
531
- .slx-plan-price { font-size: 22px; font-weight: 750; letter-spacing: -0.02em; color: var(--slx-ink-strong); }
532
- .slx-plan-interval { font-size: 13px; color: var(--slx-muted); font-weight: 400; }
533
- .slx-plan-features { list-style: none; margin: 12px 0 16px; padding: 0; flex: 1; }
534
- .slx-plan-features li { font-size: 13px; color: var(--slx-ink); padding: 4px 0 4px 20px; position: relative; line-height: 1.45; }
535
- .slx-plan-features li::before { content: "✓"; position: absolute; left: 0; color: var(--slx-success); font-weight: 700; font-size: 12px; }
536
- .slx-plan-cta { width: 100%; margin-top: auto; }
537
- .slx-billing-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
538
- .slx-btn-secondary {
539
- font: inherit; font-size: 13px; font-weight: 550;
540
- color: var(--slx-ink); background: var(--slx-bg);
541
- border: 1px solid var(--slx-border-strong); border-radius: var(--slx-radius-sm);
542
- padding: 8px 14px; cursor: pointer;
543
- transition: background .12s, border-color .12s;
544
- display: inline-flex; align-items: center; justify-content: center; gap: 6px;
545
- }
546
- .slx-btn-secondary:hover { background: var(--slx-bg-subtle); }
547
- .slx-btn-secondary:active { transform: scale(.98); }
548
- .slx-btn-secondary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--slx-accent-soft); }
549
- .slx-btn-secondary[disabled] { opacity: .55; cursor: not-allowed; }
550
- .slx-billing-empty { text-align: center; padding: 24px 16px; color: var(--slx-muted); font-size: 13px; line-height: 1.5; }
551
-
552
- /* ── Mobile friendliness for UserProfile ── */
553
- @media (max-width: 680px) {
554
- .slx-overlay { align-items: flex-start; padding: 12px; }
555
- .slx-profile-modal {
556
- width: 100%; max-width: 100%;
557
- max-height: calc(100vh - 24px);
558
- max-height: calc(100dvh - 24px);
559
- margin: auto;
560
- border-radius: var(--slx-radius-lg);
561
- }
562
- .slx-profile-body { flex-direction: column; min-height: 0; overflow-y: auto; overflow-x: hidden; }
563
- .slx-profile-nav {
564
- width: auto; flex-direction: row; overflow-x: auto; overflow-y: hidden;
565
- border-right: none; border-bottom: 1px solid var(--slx-border);
566
- padding: 8px; gap: 6px; scrollbar-width: none; -ms-overflow-style: none;
567
- -webkit-overflow-scrolling: touch;
568
- flex-shrink: 0;
569
- }
570
- .slx-profile-nav::-webkit-scrollbar { display: none; }
571
- .slx-profile-nav-btn { white-space: nowrap; flex-shrink: 0; font-size: 13px; padding: 8px 12px; }
572
- .slx-profile-content { padding: 16px; overflow: visible; }
573
- .slx-profile-head { padding: 16px 16px 12px; }
574
- .slx-profile-close { width: 40px; height: 40px; min-width: 40px; min-height: 40px; font-size: 18px; border-radius: 10px; }
575
- .slx-avatar-row { gap: 12px; flex-wrap: wrap; }
576
- .slx-billing-plans { grid-template-columns: 1fr; }
577
- .slx-session { flex-direction: column; align-items: flex-start; gap: 10px; }
578
- .slx-session .slx-btn-danger-outline { align-self: stretch; text-align: center; justify-content: center; }
579
- .slx-pagination { flex-wrap: wrap; gap: 6px; }
580
- .slx-pagination .slx-btn-secondary { font-size: 12px; padding: 4px 10px; }
581
- .slx-invoice-row { flex-wrap: wrap; gap: 6px; }
582
- }
583
- @media (max-width: 380px) {
584
- .slx-profile-content { padding: 12px; }
585
- .slx-profile-head { padding: 12px 12px 10px; }
586
- .slx-profile-title { font-size: 16px; }
587
- }
588
- `;
589
-
590
- let injected = false;
591
-
592
- /** Inject the SlyxUp stylesheet + fonts once per document. Idempotent + SSR-safe. */
593
- export function injectStyles(): void {
594
- if (typeof document === 'undefined') return;
595
- // Design tokens are scoped to .slyxup-root — apply to <html> so the
596
- // components work in ANY host app without a wrapper element.
597
- document.documentElement.classList.add('slyxup-root');
598
- if (!document.querySelector('style[data-slyxup="styles"]')) {
599
- if (!document.querySelector('link[href*="DM+Sans"]')) {
600
- const fontLink = document.createElement('link');
601
- fontLink.rel = 'stylesheet';
602
- fontLink.href =
603
- 'https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700;9..40,800&family=Space+Grotesk:wght@400;500;600;700&display=swap';
604
- document.head.appendChild(fontLink);
605
- }
606
- const style = document.createElement('style');
607
- style.setAttribute('data-slyxup', 'styles');
608
- style.textContent = CSS;
609
- document.head.appendChild(style);
610
- injected = true;
611
- } else {
612
- injected = true;
613
- }
614
- }
615
-
616
- /** Test hook — whether styles are present. */
617
- export function stylesInjected(): boolean {
618
- return injected;
619
- }