@bootnodedev/canton-theme 0.3.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 BootNode
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # @bootnodedev/canton-theme
2
+
3
+ Plain-CSS theme (L3) for [`@bootnodedev/canton-dappbooster`](../canton-dappbooster) components. Zero
4
+ JavaScript, zero runtime. Two consumable artifacts:
5
+
6
+ | Export | What it is |
7
+ | --- | --- |
8
+ | `@bootnodedev/canton-theme/tokens.css` | `--cnc-*` custom properties — the theming + dark-mode contract |
9
+ | `@bootnodedev/canton-theme/default.css` | prestyled defaults selecting on component part classes; imports `tokens.css` |
10
+
11
+ ## Usage
12
+
13
+ Components ship no styling; import the theme once at your app entry:
14
+
15
+ ```ts
16
+ import '@bootnodedev/canton-theme/default.css'
17
+ ```
18
+
19
+ - `default.css` imports `tokens.css`, so that one line is the whole theme. Import `tokens.css` alone
20
+ to take the contract without the prestyled defaults. Defining the `--cnc-*` properties yourself
21
+ instead means setting `color-scheme` directly, one explicit value per mode: it is not a `--cnc-*`
22
+ property, so skipping it leaves the browser painting scrollbars, form controls, and the caret in
23
+ the wrong mode.
24
+ - Dark mode activates on `[data-theme="dark"]`. Set that attribute on `<html>`, as early as you can:
25
+ applied after first paint it flashes. It deliberately does not follow `prefers-color-scheme` by
26
+ itself, so that a mode toggle can override the OS preference in both directions.
27
+ [`canton-dappbooster`](../canton-dappbooster)'s `<ThemeProvider>` drives it from React; nothing
28
+ here depends on that, and setting the attribute yourself is equally valid.
29
+ - Overriding a token means overriding it in both modes. Your `:root` also beats our
30
+ `[data-theme="dark"]` block, so a light-only override stays applied in dark.
31
+ - The whole package lives under `@layer cnc`, so any unlayered CSS of yours wins without specificity
32
+ fights, whether you import us first or last.
33
+
34
+ With Tailwind, position the `cnc` layer explicitly. Tailwind otherwise owns the layer order it
35
+ emits, and its preflight resets `button { color: inherit }`, which beats the theme's copy-control
36
+ colours. Declare the order yourself, before the first `@import`:
37
+
38
+ ```css
39
+ @layer properties, theme, base, cnc, components, utilities;
40
+
41
+ @import "tailwindcss";
42
+ ```
43
+
44
+ Any layer Tailwind emits that the statement omits lands on top of the ones it names, so keep
45
+ `properties` (its `@property` polyfill) in the list.
46
+
47
+ ## Why a separate package
48
+
49
+ Components (L2) carry zero styling opinion; the theme (L3) is a separate concern styling the DOM
50
+ contract each component declares in its `anatomy.ts`. See
51
+ [`../canton-dappbooster/architecture.md`](../canton-dappbooster/architecture.md).
package/package.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "@bootnodedev/canton-theme",
3
+ "version": "0.3.0",
4
+ "description": "Plain-CSS theme for @bootnodedev/canton-dappbooster",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "private": false,
8
+ "publishConfig": {
9
+ "access": "public"
10
+ },
11
+ "sideEffects": [
12
+ "**/*.css"
13
+ ],
14
+ "files": [
15
+ "src"
16
+ ],
17
+ "exports": {
18
+ "./tokens.css": "./src/tokens.css",
19
+ "./default.css": "./src/default.css"
20
+ }
21
+ }
@@ -0,0 +1,609 @@
1
+ @import "./tokens.css";
2
+
3
+ @layer cnc {
4
+ /* Button-like parts */
5
+ .cnc-identifier__copy,
6
+ .cnc-explorer-link,
7
+ .cnc-token-input__max,
8
+ .cnc-token-select-dialog__close {
9
+ background: none;
10
+ border-radius: var(--cnc-radius);
11
+ border: 0;
12
+ cursor: pointer;
13
+ transition:
14
+ background-color var(--cnc-duration) ease,
15
+ color var(--cnc-duration) ease;
16
+ }
17
+
18
+ :is(
19
+ .cnc-disconnect-button,
20
+ .cnc-connect-button,
21
+ .cnc-cancel-button,
22
+ .cnc-identifier__copy,
23
+ .cnc-explorer-link,
24
+ .cnc-token-input__max,
25
+ .cnc-token-select-dialog__close
26
+ ):focus-visible,
27
+ .cnc-token-input__token[data-interactive]:focus-visible {
28
+ outline: 2px solid var(--cnc-accent);
29
+ outline-offset: 2px;
30
+ }
31
+
32
+ .cnc-party-id-input:focus-visible,
33
+ .cnc-token-select-dialog__favorite:focus-visible,
34
+ .cnc-token-select-dialog__search-field:focus-within {
35
+ outline: 2px solid var(--cnc-accent);
36
+ outline-offset: 1px;
37
+ }
38
+
39
+ :is(.cnc-party-id-input, .cnc-token-input__field)::placeholder {
40
+ color: var(--cnc-text-muted);
41
+ opacity: 0.7;
42
+ }
43
+
44
+ /* Token chips */
45
+ .cnc-token-input__token,
46
+ .cnc-token-select-dialog__favorite {
47
+ align-items: center;
48
+ background: var(--cnc-surface-muted);
49
+ border-radius: var(--cnc-radius);
50
+ color: inherit;
51
+ display: inline-flex;
52
+ flex-shrink: 0;
53
+ font: inherit;
54
+ }
55
+
56
+ /* Identifier */
57
+ .cnc-identifier {
58
+ align-items: center;
59
+ color: var(--cnc-text);
60
+ display: inline-flex;
61
+ gap: calc(var(--cnc-space-xs) * 1.5);
62
+ max-width: 100%;
63
+ min-width: 0;
64
+ }
65
+
66
+ .cnc-identifier__value {
67
+ font-family: var(--cnc-font-mono);
68
+ overflow: hidden;
69
+ text-overflow: ellipsis;
70
+ white-space: nowrap;
71
+ }
72
+
73
+ .cnc-identifier__copy {
74
+ color: var(--cnc-text-muted);
75
+ display: inline-grid;
76
+ padding: 0;
77
+ place-items: center;
78
+ }
79
+
80
+ .cnc-identifier__copy:hover {
81
+ color: var(--cnc-accent);
82
+ }
83
+
84
+ .cnc-identifier__copy[data-state="copied"] {
85
+ color: var(--cnc-success);
86
+ }
87
+
88
+ .cnc-identifier__copy[data-state="error"] {
89
+ color: var(--cnc-danger);
90
+ }
91
+
92
+ .cnc-identifier__copy,
93
+ .cnc-identifier__link {
94
+ flex-shrink: 0;
95
+ font-size: 0.875em;
96
+ }
97
+
98
+ /* Explorer link */
99
+ .cnc-explorer-link {
100
+ color: var(--cnc-text-muted);
101
+ display: inline-grid;
102
+ place-items: center;
103
+ }
104
+
105
+ .cnc-explorer-link:hover {
106
+ color: var(--cnc-accent);
107
+ }
108
+
109
+ /* Party id input */
110
+ .cnc-party-id-input {
111
+ background: var(--cnc-surface);
112
+ border-radius: var(--cnc-radius);
113
+ border: 1px solid var(--cnc-border);
114
+ color: var(--cnc-text);
115
+ font-family: var(--cnc-font-mono);
116
+ font-size: 0.875rem;
117
+ padding: var(--cnc-space-sm) calc(var(--cnc-space-xs) * 2.5);
118
+ width: 100%;
119
+ }
120
+
121
+ .cnc-party-id-input:hover {
122
+ border-color: var(--cnc-border-strong);
123
+ }
124
+
125
+ .cnc-party-id-input:focus-visible {
126
+ border-color: var(--cnc-accent);
127
+ }
128
+
129
+ .cnc-party-id-input[data-invalid] {
130
+ background: var(--cnc-danger-subtle);
131
+ border-color: var(--cnc-danger);
132
+ }
133
+
134
+ .cnc-party-id-input[data-invalid]:focus-visible {
135
+ outline-color: var(--cnc-danger);
136
+ }
137
+
138
+ /* Token input */
139
+ .cnc-token-input {
140
+ background: var(--cnc-surface);
141
+ border-radius: var(--cnc-radius);
142
+ border: 1px solid var(--cnc-border);
143
+ color: var(--cnc-text);
144
+ display: flex;
145
+ flex-direction: column;
146
+ gap: var(--cnc-space-sm);
147
+ padding: var(--cnc-space);
148
+ }
149
+
150
+ .cnc-token-input__label {
151
+ font-size: 0.875rem;
152
+ font-weight: 700;
153
+ }
154
+
155
+ .cnc-token-input__row {
156
+ align-items: center;
157
+ display: flex;
158
+ gap: var(--cnc-space-sm);
159
+ }
160
+
161
+ .cnc-token-input__field {
162
+ background: none;
163
+ border-radius: var(--cnc-radius);
164
+ border: 1px solid var(--cnc-border-strong);
165
+ color: inherit;
166
+ flex: 1;
167
+ font-family: var(--cnc-font-mono);
168
+ font-size: 1.5rem;
169
+ min-width: 0;
170
+ padding: var(--cnc-space-sm) calc(var(--cnc-space-xs) * 3);
171
+ }
172
+
173
+ .cnc-token-input__field:focus-visible {
174
+ border-color: var(--cnc-accent);
175
+ outline: 3px solid color-mix(in oklab, var(--cnc-accent) 28%, transparent);
176
+ }
177
+
178
+ .cnc-token-input__token {
179
+ align-self: stretch;
180
+ font-weight: 500;
181
+ gap: calc(var(--cnc-space-xs) * 1.5);
182
+ padding: calc(var(--cnc-space-xs) * 1.5) calc(var(--cnc-space-xs) * 2.5);
183
+ }
184
+
185
+ .cnc-token-input__token[data-interactive] {
186
+ border: 0;
187
+ cursor: pointer;
188
+ transition: color var(--cnc-duration) ease;
189
+ }
190
+
191
+ .cnc-token-input__token[data-interactive]:hover:not(:disabled) {
192
+ color: var(--cnc-accent);
193
+ }
194
+
195
+ .cnc-token-input__token[data-interactive]:disabled {
196
+ cursor: not-allowed;
197
+ }
198
+
199
+ .cnc-token-input__meta {
200
+ align-items: center;
201
+ display: flex;
202
+ font-size: 0.75rem;
203
+ gap: var(--cnc-space-sm);
204
+ }
205
+
206
+ .cnc-token-input__usd-value,
207
+ .cnc-token-input__balance {
208
+ color: var(--cnc-text-muted);
209
+ }
210
+
211
+ .cnc-token-input__balance {
212
+ margin-inline-start: auto;
213
+ }
214
+
215
+ .cnc-token-input__balance[data-state="loading"] {
216
+ opacity: 0.8;
217
+ }
218
+
219
+ .cnc-token-input__balance[data-state="error"] {
220
+ color: var(--cnc-danger);
221
+ }
222
+
223
+ .cnc-token-input__max {
224
+ color: var(--cnc-accent);
225
+ flex-shrink: 0;
226
+ font-size: 0.75rem;
227
+ padding: calc(var(--cnc-space-xs) / 2) var(--cnc-space-sm);
228
+ }
229
+
230
+ .cnc-token-input__max:hover:not(:disabled) {
231
+ color: var(--cnc-accent-hover);
232
+ }
233
+
234
+ .cnc-token-input__max:disabled {
235
+ cursor: not-allowed;
236
+ opacity: 0.5;
237
+ }
238
+
239
+ .cnc-token-input[data-disabled] {
240
+ opacity: 0.6;
241
+ }
242
+
243
+ .cnc-token-input[data-disabled] .cnc-token-input__field {
244
+ cursor: not-allowed;
245
+ }
246
+
247
+ .cnc-token-input[data-invalid] {
248
+ border-color: var(--cnc-danger);
249
+ }
250
+
251
+ .cnc-token-input[data-invalid] .cnc-token-input__field {
252
+ border-color: var(--cnc-danger);
253
+ color: var(--cnc-danger);
254
+ }
255
+
256
+ .cnc-token-input[data-invalid] .cnc-token-input__field:focus-visible {
257
+ border-color: var(--cnc-danger);
258
+ outline-color: color-mix(in oklab, var(--cnc-danger) 28%, transparent);
259
+ }
260
+
261
+ /* Token select dialog */
262
+ .cnc-token-select-dialog__backdrop,
263
+ .cnc-token-select-dialog__positioner {
264
+ inset: 0;
265
+ position: fixed;
266
+ z-index: 100;
267
+ }
268
+
269
+ .cnc-token-select-dialog__backdrop {
270
+ background: var(--cnc-overlay);
271
+ }
272
+
273
+ .cnc-token-select-dialog__positioner {
274
+ align-items: center;
275
+ display: flex;
276
+ justify-content: center;
277
+ padding: var(--cnc-space);
278
+ }
279
+
280
+ .cnc-token-select-dialog {
281
+ background: var(--cnc-surface);
282
+ border-radius: var(--cnc-radius);
283
+ border: 1px solid var(--cnc-border);
284
+ color: var(--cnc-text);
285
+ display: flex;
286
+ flex-direction: column;
287
+ gap: calc(var(--cnc-space-xs) * 3);
288
+ max-height: 100%;
289
+ max-width: 100%;
290
+ padding: var(--cnc-space);
291
+ width: 34.375rem;
292
+ }
293
+
294
+ .cnc-token-select-dialog__header {
295
+ align-items: center;
296
+ display: flex;
297
+ justify-content: space-between;
298
+ }
299
+
300
+ .cnc-token-select-dialog__title {
301
+ font-size: 1rem;
302
+ font-weight: 700;
303
+ }
304
+
305
+ .cnc-token-select-dialog__close,
306
+ .cnc-token-select-dialog__search-icon {
307
+ color: var(--cnc-text-muted);
308
+ display: inline-grid;
309
+ place-items: center;
310
+ }
311
+
312
+ .cnc-token-select-dialog__close {
313
+ font-size: 1.25rem;
314
+ padding: 0;
315
+ }
316
+
317
+ .cnc-token-select-dialog__close:hover {
318
+ color: var(--cnc-accent);
319
+ }
320
+
321
+ .cnc-token-select-dialog__search-field {
322
+ align-items: center;
323
+ background: var(--cnc-surface);
324
+ border-radius: var(--cnc-radius);
325
+ border: 1px solid var(--cnc-border-strong);
326
+ display: flex;
327
+ gap: var(--cnc-space-sm);
328
+ padding: var(--cnc-space-sm) calc(var(--cnc-space-xs) * 2.5);
329
+ }
330
+
331
+ .cnc-token-select-dialog__search-field:focus-within {
332
+ border-color: var(--cnc-accent);
333
+ }
334
+
335
+ .cnc-token-select-dialog__search-icon {
336
+ font-size: 1.125em;
337
+ }
338
+
339
+ .cnc-token-select-dialog__search {
340
+ background: none;
341
+ border: none;
342
+ color: inherit;
343
+ font: inherit;
344
+ min-width: 0;
345
+ outline: none;
346
+ padding: 0;
347
+ width: 100%;
348
+ }
349
+
350
+ .cnc-token-select-dialog__search::placeholder {
351
+ color: var(--cnc-text-muted);
352
+ opacity: 0.7;
353
+ }
354
+
355
+ .cnc-token-select-dialog__favorites {
356
+ border-bottom: 1px solid var(--cnc-border);
357
+ display: flex;
358
+ flex-wrap: wrap;
359
+ gap: calc(var(--cnc-space-xs) * 3);
360
+ margin-block-start: calc(var(--cnc-space-xs) * 3);
361
+ padding-block-end: calc(var(--cnc-space-xs) * 3);
362
+ }
363
+
364
+ .cnc-token-select-dialog__favorite {
365
+ border: 1px solid var(--cnc-border);
366
+ cursor: pointer;
367
+ gap: var(--cnc-space-sm);
368
+ line-height: 1.2;
369
+ padding: calc(var(--cnc-space-xs) * 1.5) var(--cnc-space-sm);
370
+ }
371
+
372
+ .cnc-token-logo.cnc-token-select-dialog__favorite-logo {
373
+ height: 1.5rem;
374
+ width: 1.5rem;
375
+ }
376
+
377
+ .cnc-token-select-dialog__favorite:hover {
378
+ background: var(--cnc-accent-subtle);
379
+ border-color: var(--cnc-accent);
380
+ }
381
+
382
+ .cnc-token-select-dialog__favorite-symbol {
383
+ font-size: 0.875em;
384
+ font-weight: 600;
385
+ }
386
+
387
+ .cnc-token-select-dialog__list {
388
+ background: var(--cnc-surface-muted);
389
+ border-radius: var(--cnc-radius);
390
+ flex: 0 1 20rem;
391
+ min-height: 0;
392
+ overscroll-behavior: contain;
393
+ overflow-y: auto;
394
+ }
395
+
396
+ .cnc-token-select-dialog__empty {
397
+ color: var(--cnc-text-muted);
398
+ display: grid;
399
+ min-height: 100%;
400
+ padding: var(--cnc-space);
401
+ place-items: center;
402
+ text-align: center;
403
+ }
404
+
405
+ .cnc-token-select-dialog__sizer {
406
+ position: relative;
407
+ }
408
+
409
+ .cnc-token-select-dialog__rows {
410
+ display: flex;
411
+ flex-direction: column;
412
+ inset-inline: 0;
413
+ position: absolute;
414
+ top: 0;
415
+ }
416
+
417
+ .cnc-token-select-dialog__row {
418
+ align-items: center;
419
+ background: none;
420
+ border: 0;
421
+ color: inherit;
422
+ cursor: pointer;
423
+ display: flex;
424
+ font: inherit;
425
+ font-size: 1rem;
426
+ gap: var(--cnc-space);
427
+ line-height: 1.2;
428
+ padding: 0 var(--cnc-space);
429
+ text-align: start;
430
+ width: 100%;
431
+ }
432
+
433
+ .cnc-token-select-dialog__row:hover {
434
+ background: var(--cnc-surface);
435
+ }
436
+
437
+ .cnc-token-select-dialog__row:focus-visible {
438
+ outline: 2px solid var(--cnc-accent);
439
+ outline-offset: -2px;
440
+ }
441
+
442
+ .cnc-token-select-dialog__row-text {
443
+ display: flex;
444
+ flex: 1;
445
+ flex-direction: column;
446
+ min-width: 0;
447
+ }
448
+
449
+ .cnc-token-select-dialog__row-name {
450
+ font-size: 0.9375em;
451
+ overflow: hidden;
452
+ text-overflow: ellipsis;
453
+ white-space: nowrap;
454
+ }
455
+
456
+ .cnc-token-select-dialog__row-symbol {
457
+ color: var(--cnc-text-muted);
458
+ font-size: 0.8125em;
459
+ }
460
+
461
+ .cnc-token-select-dialog__row-figures {
462
+ align-items: flex-end;
463
+ display: flex;
464
+ flex-direction: column;
465
+ flex-shrink: 0;
466
+ text-align: end;
467
+ }
468
+
469
+ .cnc-token-select-dialog__row-balance {
470
+ font-size: 0.9375em;
471
+ font-variant-numeric: tabular-nums;
472
+ }
473
+
474
+ .cnc-token-select-dialog__row-locked {
475
+ align-items: center;
476
+ color: var(--cnc-text-muted);
477
+ display: inline-flex;
478
+ font-size: 0.8125em;
479
+ font-variant-numeric: tabular-nums;
480
+ gap: var(--cnc-space-xs);
481
+ }
482
+
483
+ /* Token logo */
484
+ .cnc-token-logo {
485
+ align-items: center;
486
+ display: inline-flex;
487
+ flex-shrink: 0;
488
+ height: 2rem;
489
+ justify-content: center;
490
+ overflow: hidden;
491
+ width: 2rem;
492
+ }
493
+
494
+ .cnc-token-logo[data-fallback] {
495
+ border-radius: 50%;
496
+ font-size: 0.6875rem;
497
+ font-weight: 700;
498
+ letter-spacing: -0.02em;
499
+ }
500
+
501
+ .cnc-token-logo[data-swatch="1"] {
502
+ background: var(--cnc-swatch-1);
503
+ color: var(--cnc-swatch-1-fg);
504
+ }
505
+
506
+ .cnc-token-logo[data-swatch="2"] {
507
+ background: var(--cnc-swatch-2);
508
+ color: var(--cnc-swatch-2-fg);
509
+ }
510
+
511
+ .cnc-token-logo[data-swatch="3"] {
512
+ background: var(--cnc-swatch-3);
513
+ color: var(--cnc-swatch-3-fg);
514
+ }
515
+
516
+ .cnc-token-logo[data-swatch="4"] {
517
+ background: var(--cnc-swatch-4);
518
+ color: var(--cnc-swatch-4-fg);
519
+ }
520
+
521
+ .cnc-token-logo[data-swatch="5"] {
522
+ background: var(--cnc-swatch-5);
523
+ color: var(--cnc-swatch-5-fg);
524
+ }
525
+
526
+ .cnc-token-logo[data-swatch="6"] {
527
+ background: var(--cnc-swatch-6);
528
+ color: var(--cnc-swatch-6-fg);
529
+ }
530
+
531
+ .cnc-token-logo[data-swatch="7"] {
532
+ background: var(--cnc-swatch-7);
533
+ color: var(--cnc-swatch-7-fg);
534
+ }
535
+
536
+ .cnc-token-logo[data-swatch="8"] {
537
+ background: var(--cnc-swatch-8);
538
+ color: var(--cnc-swatch-8-fg);
539
+ }
540
+
541
+ /* Wallet buttons */
542
+ .cnc-disconnect-button,
543
+ .cnc-connect-button,
544
+ .cnc-cancel-button {
545
+ align-items: center;
546
+ background: var(--cnc-surface);
547
+ border-radius: var(--cnc-radius);
548
+ border: 1px solid var(--cnc-border);
549
+ color: var(--cnc-text);
550
+ cursor: pointer;
551
+ display: flex;
552
+ font-size: 0.875rem;
553
+ font-weight: 500;
554
+ gap: var(--cnc-space-sm);
555
+ height: 2.75rem;
556
+ padding-inline: calc(var(--cnc-space-xs) * 3);
557
+ transition:
558
+ background-color var(--cnc-duration) ease,
559
+ border-color var(--cnc-duration) ease;
560
+ }
561
+
562
+ :is(.cnc-disconnect-button, .cnc-connect-button, .cnc-cancel-button):hover:not(
563
+ :disabled,
564
+ [aria-disabled="true"]
565
+ ) {
566
+ background: var(--cnc-surface-muted);
567
+ border-color: var(--cnc-border-strong);
568
+ }
569
+
570
+ :is(.cnc-disconnect-button, .cnc-connect-button, .cnc-cancel-button):active:not(
571
+ :disabled,
572
+ [aria-disabled="true"]
573
+ ) {
574
+ background: var(--cnc-accent-subtle);
575
+ border-color: var(--cnc-accent);
576
+ }
577
+
578
+ :is(.cnc-disconnect-button, .cnc-connect-button, .cnc-cancel-button):is(
579
+ :disabled,
580
+ [aria-disabled="true"]
581
+ ) {
582
+ cursor: not-allowed;
583
+ opacity: 0.5;
584
+ }
585
+
586
+ .cnc-connect-button__spinner,
587
+ .cnc-cancel-button__spinner {
588
+ animation: cnc-spin calc(var(--cnc-duration-xl) * 1.5) linear infinite;
589
+ border-radius: 50%;
590
+ border: 2px solid color-mix(in oklab, currentColor 25%, transparent);
591
+ border-block-start-color: currentColor;
592
+ flex-shrink: 0;
593
+ height: 1em;
594
+ width: 1em;
595
+ }
596
+
597
+ @keyframes cnc-spin {
598
+ to {
599
+ transform: rotate(1turn);
600
+ }
601
+ }
602
+
603
+ @media (prefers-reduced-motion: reduce) {
604
+ .cnc-connect-button__spinner,
605
+ .cnc-cancel-button__spinner {
606
+ animation: none;
607
+ }
608
+ }
609
+ }
package/src/tokens.css ADDED
@@ -0,0 +1,125 @@
1
+ @layer cnc {
2
+ :root {
3
+ color-scheme: light;
4
+
5
+ /* surface */
6
+ --cnc-bg: #f7f7f7;
7
+ --cnc-surface: #ffffff;
8
+ --cnc-surface-muted: #ececf0;
9
+
10
+ /* text */
11
+ --cnc-text: #2c2d40;
12
+ --cnc-text-muted: #4b4d60;
13
+
14
+ /* border */
15
+ --cnc-border: #e2e2ea;
16
+ --cnc-border-strong: #ccccd6;
17
+
18
+ /* overlay */
19
+ --cnc-overlay: rgb(20 21 43 / 0.5);
20
+ --cnc-shadow: 0 0.5rem 1.5rem rgb(20 21 43 / 0.12);
21
+
22
+ /* accent */
23
+ --cnc-accent: #692581;
24
+ --cnc-accent-hover: #8b46a4;
25
+ --cnc-accent-subtle: #f3e8f8;
26
+ --cnc-accent-fg: #ffffff;
27
+
28
+ /* state */
29
+ --cnc-success: #137047;
30
+ --cnc-success-subtle: #e2f3ea;
31
+ --cnc-warning: #8a6400;
32
+ --cnc-warning-subtle: #f6ecd2;
33
+ --cnc-danger: #a32626;
34
+ --cnc-danger-subtle: #f6dede;
35
+
36
+ /* swatch */
37
+ --cnc-swatch-1: oklch(0.85 0.1 25);
38
+ --cnc-swatch-1-fg: oklch(0.36 0.1 25);
39
+ --cnc-swatch-2: oklch(0.85 0.1 70);
40
+ --cnc-swatch-2-fg: oklch(0.36 0.1 70);
41
+ --cnc-swatch-3: oklch(0.85 0.1 115);
42
+ --cnc-swatch-3-fg: oklch(0.36 0.1 115);
43
+ --cnc-swatch-4: oklch(0.85 0.1 160);
44
+ --cnc-swatch-4-fg: oklch(0.36 0.1 160);
45
+ --cnc-swatch-5: oklch(0.85 0.1 205);
46
+ --cnc-swatch-5-fg: oklch(0.36 0.1 205);
47
+ --cnc-swatch-6: oklch(0.85 0.1 250);
48
+ --cnc-swatch-6-fg: oklch(0.36 0.1 250);
49
+ --cnc-swatch-7: oklch(0.85 0.1 295);
50
+ --cnc-swatch-7-fg: oklch(0.36 0.1 295);
51
+ --cnc-swatch-8: oklch(0.85 0.1 340);
52
+ --cnc-swatch-8-fg: oklch(0.36 0.1 340);
53
+
54
+ /* shape */
55
+ --cnc-radius: 0.5rem;
56
+ --cnc-space-xs: 0.25rem;
57
+ --cnc-space-sm: 0.5rem;
58
+ --cnc-space: 1rem;
59
+ --cnc-space-lg: 1.5rem;
60
+ --cnc-space-xl: 2rem;
61
+
62
+ /* motion */
63
+ --cnc-duration-xs: 75ms;
64
+ --cnc-duration-sm: 100ms;
65
+ --cnc-duration: 150ms;
66
+ --cnc-duration-lg: 300ms;
67
+ --cnc-duration-xl: 500ms;
68
+
69
+ /* typography */
70
+ --cnc-font-mono: ui-monospace, SFMono-Regular, monospace;
71
+ }
72
+
73
+ [data-theme="dark"] {
74
+ color-scheme: dark;
75
+
76
+ /* surface */
77
+ --cnc-bg: #14152b;
78
+ --cnc-surface: #1c1d2e;
79
+ --cnc-surface-muted: #232539;
80
+
81
+ /* text */
82
+ --cnc-text: #fafbfc;
83
+ --cnc-text-muted: #c5c2cb;
84
+
85
+ /* border */
86
+ --cnc-border: #2c2e46;
87
+ --cnc-border-strong: #5f6178;
88
+
89
+ /* overlay */
90
+ --cnc-overlay: rgb(0 0 0 / 0.65);
91
+ --cnc-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.5);
92
+
93
+ /* accent */
94
+ --cnc-accent: #9d54b8;
95
+ --cnc-accent-hover: #b06cc9;
96
+ --cnc-accent-subtle: #2a1f3a;
97
+ --cnc-accent-fg: #ffffff;
98
+
99
+ /* state */
100
+ --cnc-success: #5fbf86;
101
+ --cnc-success-subtle: #16291f;
102
+ --cnc-warning: #d4a85a;
103
+ --cnc-warning-subtle: #332a16;
104
+ --cnc-danger: #e57373;
105
+ --cnc-danger-subtle: #331a1a;
106
+
107
+ /* swatch */
108
+ --cnc-swatch-1: oklch(0.42 0.09 25);
109
+ --cnc-swatch-1-fg: oklch(0.9 0.06 25);
110
+ --cnc-swatch-2: oklch(0.42 0.09 70);
111
+ --cnc-swatch-2-fg: oklch(0.9 0.06 70);
112
+ --cnc-swatch-3: oklch(0.42 0.09 115);
113
+ --cnc-swatch-3-fg: oklch(0.9 0.06 115);
114
+ --cnc-swatch-4: oklch(0.42 0.09 160);
115
+ --cnc-swatch-4-fg: oklch(0.9 0.06 160);
116
+ --cnc-swatch-5: oklch(0.42 0.09 205);
117
+ --cnc-swatch-5-fg: oklch(0.9 0.06 205);
118
+ --cnc-swatch-6: oklch(0.42 0.09 250);
119
+ --cnc-swatch-6-fg: oklch(0.9 0.06 250);
120
+ --cnc-swatch-7: oklch(0.42 0.09 295);
121
+ --cnc-swatch-7-fg: oklch(0.9 0.06 295);
122
+ --cnc-swatch-8: oklch(0.42 0.09 340);
123
+ --cnc-swatch-8-fg: oklch(0.9 0.06 340);
124
+ }
125
+ }