@lundal/zed-solid 0.0.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/dist/style.css ADDED
@@ -0,0 +1,589 @@
1
+ *,
2
+ *::before,
3
+ *::after,
4
+ *::placeholder {
5
+ margin: 0;
6
+ padding: 0;
7
+ opacity: 1;
8
+ outline: none;
9
+ border: none;
10
+ box-sizing: border-box;
11
+ background: none;
12
+ font: inherit;
13
+ color: inherit;
14
+ line-height: 1.5;
15
+ text-decoration: none;
16
+ }
17
+
18
+ *::-moz-focus-outer,
19
+ *::-moz-focus-inner {
20
+ border: none;
21
+ }
22
+ .z-app {
23
+ width: 100vw;
24
+ height: 100vh;
25
+
26
+ background: var(--z-background);
27
+ color: var(--z-text-body);
28
+
29
+ font-family: "Inter", sans-serif;
30
+ font-size: 16px;
31
+ font-weight: 400;
32
+ }
33
+
34
+ .z-app > * {
35
+ overflow: auto;
36
+ }
37
+
38
+ .z-app--layout-3 {
39
+ display: grid;
40
+ grid-template-rows: auto 1fr;
41
+ grid-template-columns: auto 1fr;
42
+ grid-template-areas: "header header" "nav main";
43
+ }
44
+
45
+ .z-app--layout-3 > header {
46
+ grid-area: header;
47
+ border-bottom: 1px solid var(--z-border);
48
+ }
49
+
50
+ .z-app--layout-3 > nav {
51
+ grid-area: nav;
52
+ border-right: 1px solid var(--z-border);
53
+ }
54
+
55
+ .z-app--layout-3 > main {
56
+ grid-area: main;
57
+ }
58
+ .z-button {
59
+ height: 36px;
60
+ padding: 6px 24px;
61
+ border-radius: 6px;
62
+ cursor: pointer;
63
+ font-weight: 500;
64
+ outline: 2px solid transparent;
65
+ outline-offset: 3px;
66
+ transition: outline-color 0.1s;
67
+ color: var(--z-button-text);
68
+ background: var(--z-button-fill);
69
+ }
70
+
71
+ .z-button:hover:not(:active) {
72
+ filter: brightness(1.15);
73
+ }
74
+
75
+ .z-button:focus-visible {
76
+ outline-color: var(--z-focus);
77
+ }
78
+
79
+ .z-button[aria-busy="true"] {
80
+ color: transparent;
81
+ }
82
+
83
+ .z-button[aria-busy="true"]::before {
84
+ display: block;
85
+ content: "";
86
+ width: 24px;
87
+ height: 24px;
88
+ border-radius: 50%;
89
+ border: 3px solid transparent;
90
+ border-top-color: var(--z-button-text);
91
+ animation: 0.5s linear infinite z-spin;
92
+ margin: 0 auto;
93
+ }
94
+
95
+ .z-button--icon {
96
+ width: 36px;
97
+ height: 36px;
98
+ padding: 6px;
99
+ }
100
+
101
+ .z-button--primary {
102
+ --z-button-text: var(--z-button-primary-text);
103
+ --z-button-fill: var(--z-button-primary-fill);
104
+ }
105
+
106
+ .z-button--secondary {
107
+ --z-button-text: var(--z-button-secondary-text);
108
+ --z-button-fill: var(--z-button-secondary-fill);
109
+ }
110
+
111
+ .z-button--tertiary {
112
+ --z-button-text: var(--z-button-tertiary-text);
113
+ --z-button-fill: var(--z-button-tertiary-fill);
114
+ }
115
+ .z-card {
116
+ border-radius: 12px;
117
+ padding: 24px;
118
+ background: var(--z-foreground);
119
+ /*border: 1px solid var(--z-border);*/
120
+ }
121
+ .z-checkbox {
122
+ display: flex;
123
+ }
124
+
125
+ .z-checkbox input {
126
+ appearance: none;
127
+ width: 24px;
128
+ height: 24px;
129
+ border: 2px solid var(--z-input-border);
130
+ border-radius: 6px;
131
+ outline: 2px solid transparent;
132
+ outline-offset: 3px;
133
+ cursor: pointer;
134
+ transition: border-color 0.1s, outline-color 0.1s;
135
+ }
136
+
137
+ .z-checkbox input::after {
138
+ content: "";
139
+ display: block;
140
+ width: 9px;
141
+ height: 15px;
142
+ margin-top: 2px;
143
+ margin-left: -1px;
144
+ border-right: 3px solid transparent;
145
+ border-bottom: 3px solid transparent;
146
+ transform: rotate(45deg);
147
+ transform-origin: bottom right;
148
+ transition: border-color 0.1s;
149
+ }
150
+
151
+ .z-checkbox input:checked {
152
+ border-color: var(--z-input-active-border);
153
+ }
154
+
155
+ .z-checkbox input:checked::after {
156
+ border-color: var(--z-input-active-fill);
157
+ }
158
+
159
+ .z-checkbox input:focus-visible {
160
+ outline-color: var(--z-focus);
161
+ }
162
+
163
+ .z-checkbox label {
164
+ padding: 0 12px;
165
+ cursor: pointer;
166
+ }
167
+
168
+ .z-checkbox:hover:not(:active) input {
169
+ filter: brightness(1.15);
170
+ }
171
+
172
+ .z-checkbox input[aria-invalid="true"] {
173
+ border-color: var(--z-input-error-border);
174
+ }
175
+
176
+ .z-checkbox input[aria-invalid="true"]:checked::after {
177
+ border-color: var(--z-input-error-fill);
178
+ }
179
+ .z-column {
180
+ display: flex;
181
+ flex-direction: column;
182
+ align-items: flex-start;
183
+ gap: 16px;
184
+ }
185
+ .z-dialog {
186
+ margin: 24px auto;
187
+ max-height: calc(100% - 48px);
188
+
189
+ border-radius: 12px;
190
+ padding: 24px;
191
+ background: var(--z-foreground);
192
+ border: 1px solid var(--z-border);
193
+
194
+ transition: transform 0.1s;
195
+ transform: scale(0);
196
+ }
197
+
198
+ .z-dialog::backdrop {
199
+ transition: opacity 0.1s;
200
+ opacity: 0;
201
+ }
202
+
203
+ .z-dialog--open {
204
+ transform: scale(1);
205
+ }
206
+
207
+ .z-dialog--open::backdrop {
208
+ opacity: 1;
209
+ }
210
+ .z-error {
211
+ display: flex;
212
+ gap: 6px;
213
+ }
214
+
215
+ .z-error::before {
216
+ content: "";
217
+ width: 12px;
218
+ height: 12px;
219
+ margin: 6px 0;
220
+ border-radius: 50%;
221
+ background: var(--z-input-error-fill);
222
+ }
223
+
224
+ .z-error-placeholder {
225
+ height: 24px;
226
+ }
227
+ .z-field {
228
+ display: flex;
229
+ flex-direction: column;
230
+ gap: 6px;
231
+ }
232
+
233
+ .z-field label {
234
+ font-weight: 500;
235
+ }
236
+ .z-fieldset {
237
+ display: flex;
238
+ flex-direction: column;
239
+ gap: 6px;
240
+ }
241
+
242
+ .z-fieldset legend {
243
+ font-weight: 500;
244
+ padding-bottom: 6px;
245
+ }
246
+ nav,
247
+ main,
248
+ dialog {
249
+ outline: 2px solid transparent;
250
+ outline-offset: -2px;
251
+ transition: outline-color 0.1s;
252
+ }
253
+
254
+ nav:focus-visible,
255
+ main:focus-visible,
256
+ dialog:focus-visible {
257
+ outline-color: var(--z-focus);
258
+ }
259
+ .z-header {
260
+ background: var(--z-foreground);
261
+
262
+ display: flex;
263
+ align-items: center;
264
+ justify-content: space-between;
265
+ }
266
+
267
+ .z-header--app {
268
+ display: flex;
269
+ align-items: center;
270
+ gap: 12px;
271
+ padding: 12px;
272
+ border-radius: 6px;
273
+ outline: 2px solid transparent;
274
+ outline-offset: -2px;
275
+ transition: outline-color 0.1s;
276
+ }
277
+
278
+ .z-header--app > svg {
279
+ height: 36px;
280
+ width: 36px;
281
+ border-radius: 6px;
282
+ overflow: hidden;
283
+ }
284
+
285
+ .z-header--app > span {
286
+ font-size: 24px;
287
+ font-weight: 500;
288
+ }
289
+
290
+ .z-header--app:focus-visible {
291
+ outline-color: var(--z-focus);
292
+ }
293
+
294
+ .z-header--buttons {
295
+ display: flex;
296
+ gap: 12px;
297
+ padding: 12px;
298
+ }
299
+ .z-h1 {
300
+ font-size: 32px;
301
+ }
302
+
303
+ .z-h2 {
304
+ font-size: 24px;
305
+ }
306
+
307
+ .z-h3 {
308
+ font-size: 20px;
309
+ font-weight: 500;
310
+ }
311
+ .z-link {
312
+ color: var(--z-link);
313
+ font-weight: 500;
314
+
315
+ border-radius: 3px;
316
+ outline: 2px solid transparent;
317
+ outline-offset: 3px;
318
+ transition: outline-color 0.1s;
319
+ }
320
+
321
+ .z-link:hover {
322
+ text-decoration: underline;
323
+ text-decoration-thickness: 2px;
324
+ }
325
+
326
+ .z-link:focus-visible {
327
+ outline-color: var(--z-focus);
328
+ }
329
+ .z-nav {
330
+ min-width: 200px;
331
+ padding-bottom: 12px;
332
+
333
+ background: var(--z-foreground);
334
+ color: var(--z-text-fluent);
335
+ font-weight: 500;
336
+ }
337
+
338
+ .z-nav--header {
339
+ padding: 24px 24px 12px 24px;
340
+ }
341
+
342
+ .z-nav--link {
343
+ display: flex;
344
+ align-items: center;
345
+ gap: 12px;
346
+ padding: 12px 24px 12px 0;
347
+ border-radius: 6px;
348
+ outline: 2px solid transparent;
349
+ outline-offset: -2px;
350
+ transition: outline-color 0.1s;
351
+ }
352
+
353
+ .z-nav--link > svg {
354
+ width: 20px;
355
+ height: 20px;
356
+ border-radius: 3px;
357
+ overflow: hidden;
358
+ }
359
+
360
+ .z-nav--link::before {
361
+ content: "";
362
+ width: 3px;
363
+ height: 24px;
364
+ background: transparent;
365
+ border-top-right-radius: 3px;
366
+ border-bottom-right-radius: 3px;
367
+ margin-right: 9px;
368
+ }
369
+
370
+ .z-nav--link:hover,
371
+ .z-nav--link-active {
372
+ color: var(--z-text-body);
373
+ }
374
+
375
+ .z-nav--link-active.z-nav--link::before {
376
+ background: currentColor;
377
+ }
378
+
379
+ .z-nav--link:focus-visible {
380
+ outline-color: var(--z-focus);
381
+ }
382
+ .z-radiobutton {
383
+ display: flex;
384
+ }
385
+
386
+ .z-radiobutton input {
387
+ appearance: none;
388
+ width: 24px;
389
+ height: 24px;
390
+ border: 2px solid var(--z-input-border);
391
+ border-radius: 50%;
392
+ outline: 2px solid transparent;
393
+ outline-offset: 3px;
394
+ cursor: pointer;
395
+ transition: border-color 0.1s, outline-color 0.1s;
396
+ }
397
+
398
+ .z-radiobutton input::after {
399
+ content: "";
400
+ display: block;
401
+ width: 12px;
402
+ height: 12px;
403
+ margin: 4px;
404
+ border-radius: 50%;
405
+ transition: background-color 0.1s;
406
+ }
407
+
408
+ .z-radiobutton input:checked {
409
+ border-color: var(--z-input-active-border);
410
+ }
411
+
412
+ .z-radiobutton input:checked::after {
413
+ background: var(--z-input-active-fill);
414
+ }
415
+
416
+ .z-radiobutton input:focus-visible {
417
+ outline-color: var(--z-focus);
418
+ }
419
+
420
+ .z-radiobutton label {
421
+ padding: 0 12px;
422
+ cursor: pointer;
423
+ }
424
+
425
+ .z-radiobutton:hover:not(:active) input {
426
+ filter: brightness(1.15);
427
+ }
428
+
429
+ .z-radiobutton input[aria-invalid="true"] {
430
+ border-color: var(--z-input-error-border);
431
+ }
432
+
433
+ .z-radiobutton input[aria-invalid="true"]:checked::after {
434
+ background: var(--z-input-error-fill);
435
+ }
436
+ .z-row {
437
+ display: flex;
438
+ flex-direction: row;
439
+ align-items: flex-start;
440
+ gap: 16px;
441
+ }
442
+ * {
443
+ scrollbar-color: var(--z-border) transparent;
444
+ }
445
+
446
+ *::-webkit-scrollbar {
447
+ width: 6px;
448
+ height: 6px;
449
+ }
450
+
451
+ *::-webkit-scrollbar-thumb {
452
+ background: var(--z-border);
453
+ }
454
+
455
+ *::-webkit-scrollbar-track {
456
+ background-color: transparent;
457
+ }
458
+ .z-select {
459
+ display: block;
460
+ }
461
+
462
+ .z-select {
463
+ width: 100%;
464
+ height: 36px;
465
+ padding: 4px 10px;
466
+ border: 2px solid var(--z-input-border);
467
+ border-radius: 6px;
468
+ outline: 2px solid transparent;
469
+ outline-offset: 3px;
470
+ cursor: pointer;
471
+ transition: border-color 0.1s, outline-color 0.1s;
472
+ }
473
+
474
+ .z-select option {
475
+ background: var(--z-foreground);
476
+ }
477
+
478
+ .z-select:focus-visible {
479
+ border-color: var(--z-input-active-border);
480
+ }
481
+
482
+ .z-select:hover {
483
+ /* TODO: Only border */
484
+ filter: brightness(1.15);
485
+ }
486
+
487
+ .z-select[aria-invalid="true"] {
488
+ border-color: var(--z-input-error-border);
489
+ }
490
+
491
+ .z-select[aria-invalid="true"]:focus-visible {
492
+ outline-color: var(--z-focus);
493
+ }
494
+ .z-spinner {
495
+ width: 24px;
496
+ height: 24px;
497
+ border-radius: 50%;
498
+ border: 3px solid transparent;
499
+ border-top-color: var(--z-text-fluent);
500
+ animation: 0.5s linear infinite z-spin;
501
+ }
502
+
503
+ .z-spinner--large {
504
+ width: 36px;
505
+ height: 36px;
506
+ }
507
+
508
+ @keyframes z-spin {
509
+ from {
510
+ transform: rotate(0turn);
511
+ }
512
+ to {
513
+ transform: rotate(1turn);
514
+ }
515
+ }
516
+ .z-textbox {
517
+ display: block;
518
+ }
519
+
520
+ .z-textbox {
521
+ width: 100%;
522
+ height: 36px;
523
+ padding: 4px 10px;
524
+ border: 2px solid var(--z-input-border);
525
+ border-radius: 6px;
526
+ outline: 2px solid transparent;
527
+ outline-offset: 3px;
528
+ transition: border-color 0.1s, outline-color 0.1s;
529
+ }
530
+
531
+ .z-textbox:focus-visible {
532
+ border-color: var(--z-input-active-border);
533
+ }
534
+
535
+ .z-textbox:hover {
536
+ /* TODO: Only border */
537
+ filter: brightness(1.15);
538
+ }
539
+
540
+ .z-textbox[aria-invalid="true"] {
541
+ border-color: var(--z-input-error-border);
542
+ }
543
+
544
+ .z-textbox[aria-invalid="true"]:focus-visible {
545
+ outline-color: var(--z-focus);
546
+ }
547
+ .z-theme--light {
548
+ --z-background: #eee;
549
+ --z-foreground: #fff;
550
+ --z-border: #ddd;
551
+ --z-text-body: #2e2e2e; /* Lc 100 */
552
+ --z-text-fluent: #6e6e6e; /* Lc 75 */
553
+ --z-link: #5252ff;
554
+ --z-focus: #5252ff;
555
+ --z-button-primary-fill: #55f;
556
+ --z-button-primary-text: #fff;
557
+ --z-button-secondary-fill: #889;
558
+ --z-button-secondary-text: #fff;
559
+ --z-button-tertiary-fill: transparent;
560
+ --z-button-tertiary-text: #2e2e2e;
561
+ --z-input-border: #a1a1a1; /* Lc 50 */
562
+ --z-input-active-border: #7d7dff; /* Lc 60 */
563
+ --z-input-active-fill: #5252ff; /* Lc 75 */
564
+ --z-input-error-border: #ff5252; /* Lc 60 */
565
+ --z-input-error-fill: #cf1b1b; /* Lc 75 */
566
+ }
567
+
568
+ .z-theme--dark {
569
+ --z-background: #12131a;
570
+ --z-foreground: #1c1c25;
571
+ --z-border: #2c2c35;
572
+ --z-text-body: #e6e6e6; /* Lc 90 */
573
+ --z-text-fluent: #b4b4b4; /* Lc 60 */
574
+ --z-link: #7882ff;
575
+ --z-focus: #7882ff;
576
+ --z-button-primary-fill: #3040b0;
577
+ --z-button-primary-text: #e6e6e6;
578
+ --z-button-secondary-fill: #303448;
579
+ --z-button-secondary-text: #e6e6e6;
580
+ --z-button-tertiary-fill: transparent;
581
+ --z-button-tertiary-text: #e6e6e6;
582
+ --z-button-icon-fill: #2c2c35;
583
+ /* generic colors: blue, green, red, gray */
584
+ --z-input-border: #8f8f8f; /* Lc 40 */
585
+ --z-input-active-border: #6068ff; /* Lc 30 */
586
+ --z-input-active-fill: #7882ff; /* Lc 40 */
587
+ --z-input-error-border: #db3a32; /* Lc 30 */
588
+ --z-input-error-fill: #ff483f; /* Lc 40 */
589
+ }
@@ -0,0 +1 @@
1
+ export declare function mergeClasses(a?: string, b?: string): string | undefined;
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@lundal/zed-solid",
3
+ "version": "0.0.1",
4
+ "license": "LGPL-3.0-or-later",
5
+ "type": "module",
6
+ "module": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "scripts": {
12
+ "dev": "tsc && vite",
13
+ "build": "tsc && vite build",
14
+ "preview": "vite preview",
15
+ "format": "prettier --write src"
16
+ },
17
+ "devDependencies": {
18
+ "@fortawesome/free-regular-svg-icons": "6",
19
+ "@fortawesome/free-solid-svg-icons": "6",
20
+ "@lundal/zed-css": "file:../css",
21
+ "prettier": "2",
22
+ "typescript": "5",
23
+ "vite": "4",
24
+ "vite-plugin-dts": "2",
25
+ "vite-plugin-libcss": "1",
26
+ "vite-plugin-solid": "2"
27
+ },
28
+ "dependencies": {
29
+ "@fontsource/inter": "5",
30
+ "@solidjs/router": "0.8",
31
+ "solid-js": "1"
32
+ }
33
+ }