dialkit 1.0.0 → 1.2.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/README.md +293 -2
- package/dist/index.cjs +905 -363
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +46 -9
- package/dist/index.d.ts +46 -9
- package/dist/index.js +910 -370
- package/dist/index.js.map +1 -1
- package/dist/solid/index.cjs +1042 -532
- package/dist/solid/index.cjs.map +1 -1
- package/dist/solid/index.d.cts +36 -3
- package/dist/solid/index.d.ts +36 -3
- package/dist/solid/index.js +911 -402
- package/dist/solid/index.js.map +1 -1
- package/dist/store/index.cjs +490 -0
- package/dist/store/index.cjs.map +1 -0
- package/dist/store/index.d.cts +146 -0
- package/dist/store/index.d.ts +146 -0
- package/dist/store/index.js +465 -0
- package/dist/store/index.js.map +1 -0
- package/dist/styles.css +287 -25
- package/dist/svelte/Portal.svelte +30 -0
- package/dist/svelte/Portal.svelte.d.ts +9 -0
- package/dist/svelte/Portal.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ButtonGroup.svelte +16 -0
- package/dist/svelte/components/ButtonGroup.svelte.d.ts +11 -0
- package/dist/svelte/components/ButtonGroup.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ColorControl.svelte +81 -0
- package/dist/svelte/components/ColorControl.svelte.d.ts +9 -0
- package/dist/svelte/components/ColorControl.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ControlRenderer.svelte +96 -0
- package/dist/svelte/components/ControlRenderer.svelte.d.ts +11 -0
- package/dist/svelte/components/ControlRenderer.svelte.d.ts.map +1 -0
- package/dist/svelte/components/DialRoot.svelte +79 -0
- package/dist/svelte/components/DialRoot.svelte.d.ts +14 -0
- package/dist/svelte/components/DialRoot.svelte.d.ts.map +1 -0
- package/dist/svelte/components/EasingVisualization.svelte +50 -0
- package/dist/svelte/components/EasingVisualization.svelte.d.ts +10 -0
- package/dist/svelte/components/EasingVisualization.svelte.d.ts.map +1 -0
- package/dist/svelte/components/Folder.svelte +213 -0
- package/dist/svelte/components/Folder.svelte.d.ts +14 -0
- package/dist/svelte/components/Folder.svelte.d.ts.map +1 -0
- package/dist/svelte/components/Panel.svelte +149 -0
- package/dist/svelte/components/Panel.svelte.d.ts +10 -0
- package/dist/svelte/components/Panel.svelte.d.ts.map +1 -0
- package/dist/svelte/components/PresetManager.svelte +157 -0
- package/dist/svelte/components/PresetManager.svelte.d.ts +10 -0
- package/dist/svelte/components/PresetManager.svelte.d.ts.map +1 -0
- package/dist/svelte/components/SegmentedControl.svelte +62 -0
- package/dist/svelte/components/SegmentedControl.svelte.d.ts +13 -0
- package/dist/svelte/components/SegmentedControl.svelte.d.ts.map +1 -0
- package/dist/svelte/components/SelectControl.svelte +152 -0
- package/dist/svelte/components/SelectControl.svelte.d.ts +14 -0
- package/dist/svelte/components/SelectControl.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ShortcutListener.svelte +265 -0
- package/dist/svelte/components/ShortcutListener.svelte.d.ts +13 -0
- package/dist/svelte/components/ShortcutListener.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ShortcutsMenu.svelte +128 -0
- package/dist/svelte/components/ShortcutsMenu.svelte.d.ts +7 -0
- package/dist/svelte/components/ShortcutsMenu.svelte.d.ts.map +1 -0
- package/dist/svelte/components/Slider.svelte +332 -0
- package/dist/svelte/components/Slider.svelte.d.ts +16 -0
- package/dist/svelte/components/Slider.svelte.d.ts.map +1 -0
- package/dist/svelte/components/SpringControl.svelte +126 -0
- package/dist/svelte/components/SpringControl.svelte.d.ts +12 -0
- package/dist/svelte/components/SpringControl.svelte.d.ts.map +1 -0
- package/dist/svelte/components/SpringVisualization.svelte +115 -0
- package/dist/svelte/components/SpringVisualization.svelte.d.ts +9 -0
- package/dist/svelte/components/SpringVisualization.svelte.d.ts.map +1 -0
- package/dist/svelte/components/TextControl.svelte +19 -0
- package/dist/svelte/components/TextControl.svelte.d.ts +10 -0
- package/dist/svelte/components/TextControl.svelte.d.ts.map +1 -0
- package/dist/svelte/components/Toggle.svelte +32 -0
- package/dist/svelte/components/Toggle.svelte.d.ts +12 -0
- package/dist/svelte/components/Toggle.svelte.d.ts.map +1 -0
- package/dist/svelte/components/TransitionControl.svelte +203 -0
- package/dist/svelte/components/TransitionControl.svelte.d.ts +12 -0
- package/dist/svelte/components/TransitionControl.svelte.d.ts.map +1 -0
- package/dist/svelte/components/transitions.d.ts +6 -0
- package/dist/svelte/components/transitions.d.ts.map +1 -0
- package/dist/svelte/components/transitions.js +14 -0
- package/dist/svelte/createDialKit.svelte.d.ts +8 -0
- package/dist/svelte/createDialKit.svelte.d.ts.map +1 -0
- package/dist/svelte/createDialKit.svelte.js +82 -0
- package/dist/svelte/index.d.ts +23 -0
- package/dist/svelte/index.d.ts.map +1 -0
- package/dist/svelte/index.js +23 -0
- package/dist/svelte/shims.d.ts +9 -0
- package/dist/svelte/theme-css.d.ts +2 -0
- package/dist/svelte/theme-css.d.ts.map +1 -0
- package/dist/svelte/theme-css.js +1328 -0
- package/dist/vue/index.cjs +3056 -0
- package/dist/vue/index.cjs.map +1 -0
- package/dist/vue/index.d.cts +675 -0
- package/dist/vue/index.d.ts +675 -0
- package/dist/vue/index.js +3014 -0
- package/dist/vue/index.js.map +1 -0
- package/package.json +50 -6
package/dist/styles.css
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
|
+
@import url('https://fonts.googleapis.com/css2?family=Geist+Mono:wght@100..900&display=swap');
|
|
2
|
+
|
|
1
3
|
/* Dialkit Theme - Dark glassmorphic design */
|
|
2
4
|
.dialkit-root {
|
|
3
5
|
/* Surfaces */
|
|
4
6
|
--dial-surface: rgba(255, 255, 255, 0.05);
|
|
5
7
|
--dial-surface-hover: rgba(255, 255, 255, 0.1);
|
|
6
8
|
--dial-surface-active: rgba(255, 255, 255, 0.11);
|
|
9
|
+
--dial-surface-subtle: rgba(255, 255, 255, 0.06);
|
|
7
10
|
|
|
8
11
|
/* Text hierarchy - 3 levels */
|
|
9
12
|
--dial-text-root: #FFFFFF; /* Root title */
|
|
10
13
|
--dial-text-section: rgba(255, 255, 255, 0.7); /* Section titles + carets */
|
|
11
14
|
--dial-text-label: rgba(255, 255, 255, 0.7); /* Input labels */
|
|
15
|
+
--dial-text-focus: #ffffff;
|
|
12
16
|
|
|
13
17
|
/* Legacy aliases */
|
|
14
18
|
--dial-text-primary: rgba(255, 255, 255, 0.95);
|
|
@@ -21,10 +25,13 @@
|
|
|
21
25
|
|
|
22
26
|
/* Glassmorphic panel */
|
|
23
27
|
--dial-glass-bg: #212121;
|
|
28
|
+
--dial-dropdown-bg: #2a2a2a;
|
|
24
29
|
--dial-backdrop-blur: 20px;
|
|
25
30
|
--dial-radius: 8px;
|
|
26
31
|
--dial-row-height: 36px;
|
|
27
32
|
--dial-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
|
|
33
|
+
--dial-shadow-collapsed: 0 4px 16px rgba(0, 0, 0, 0.25);
|
|
34
|
+
--dial-shadow-dropdown: 0 8px 24px rgba(0, 0, 0, 0.4);
|
|
28
35
|
|
|
29
36
|
/* Fonts */
|
|
30
37
|
font-family: system-ui, -apple-system, 'SF Pro Display', sans-serif;
|
|
@@ -39,15 +46,32 @@
|
|
|
39
46
|
overflow: visible;
|
|
40
47
|
}
|
|
41
48
|
|
|
49
|
+
/* Inline mode */
|
|
50
|
+
.dialkit-root[data-mode="inline"] {
|
|
51
|
+
height: 100%;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.dialkit-panel[data-mode="inline"] {
|
|
55
|
+
position: static;
|
|
56
|
+
z-index: auto;
|
|
57
|
+
max-height: 100%;
|
|
58
|
+
height: 100%;
|
|
59
|
+
overflow: hidden;
|
|
60
|
+
}
|
|
61
|
+
|
|
42
62
|
.dialkit-panel-inner {
|
|
43
63
|
background: var(--dial-glass-bg);
|
|
44
64
|
border: 1px solid var(--dial-border);
|
|
45
65
|
border-radius: 14px;
|
|
46
66
|
backdrop-filter: blur(var(--dial-backdrop-blur));
|
|
47
67
|
-webkit-backdrop-filter: blur(var(--dial-backdrop-blur));
|
|
48
|
-
padding: 10px 12px
|
|
68
|
+
padding: 10px 12px 0 12px;
|
|
49
69
|
transform: translateZ(0);
|
|
50
70
|
transform-origin: top right;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.dialkit-panel[data-position="top-left"] .dialkit-panel-inner {
|
|
74
|
+
transform-origin: top left;
|
|
51
75
|
max-height: calc(100vh - 80px);
|
|
52
76
|
overflow-y: auto;
|
|
53
77
|
}
|
|
@@ -56,6 +80,7 @@
|
|
|
56
80
|
.dialkit-panel-inner[data-collapsed="true"] {
|
|
57
81
|
border-radius: 50%;
|
|
58
82
|
padding: 12px;
|
|
83
|
+
box-sizing: border-box;
|
|
59
84
|
}
|
|
60
85
|
|
|
61
86
|
.dialkit-panel-inner[data-collapsed="true"] .dialkit-panel-header {
|
|
@@ -82,6 +107,24 @@
|
|
|
82
107
|
scrollbar-width: none;
|
|
83
108
|
}
|
|
84
109
|
|
|
110
|
+
.dialkit-panel-inline {
|
|
111
|
+
width: 100%;
|
|
112
|
+
height: 100%;
|
|
113
|
+
max-height: none;
|
|
114
|
+
overflow-y: auto;
|
|
115
|
+
box-shadow: none;
|
|
116
|
+
border-radius: 0;
|
|
117
|
+
border: none;
|
|
118
|
+
box-sizing: border-box;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.dialkit-panel[data-mode="inline"] .dialkit-panel-wrapper {
|
|
122
|
+
display: flex;
|
|
123
|
+
flex-direction: column;
|
|
124
|
+
width: 100%;
|
|
125
|
+
height: 100%;
|
|
126
|
+
}
|
|
127
|
+
|
|
85
128
|
/* Position variants */
|
|
86
129
|
.dialkit-panel[data-position="top-right"] {
|
|
87
130
|
top: 16px;
|
|
@@ -107,7 +150,7 @@
|
|
|
107
150
|
.dialkit-folder {
|
|
108
151
|
padding-bottom: 8px;
|
|
109
152
|
margin-bottom: 8px;
|
|
110
|
-
border-bottom: 1px solid
|
|
153
|
+
border-bottom: 1px solid var(--dial-surface-subtle);
|
|
111
154
|
}
|
|
112
155
|
|
|
113
156
|
.dialkit-folder:last-child:not(.dialkit-folder-root) {
|
|
@@ -124,7 +167,7 @@
|
|
|
124
167
|
.dialkit-panel-header {
|
|
125
168
|
padding-bottom: 6px;
|
|
126
169
|
margin-bottom: 12px;
|
|
127
|
-
border-bottom: 1px solid
|
|
170
|
+
border-bottom: 1px solid var(--dial-surface-subtle);
|
|
128
171
|
}
|
|
129
172
|
|
|
130
173
|
.dialkit-folder-header {
|
|
@@ -199,7 +242,7 @@
|
|
|
199
242
|
right: 12px;
|
|
200
243
|
width: 16px;
|
|
201
244
|
height: 16px;
|
|
202
|
-
color:
|
|
245
|
+
color: var(--dial-text-focus);
|
|
203
246
|
z-index: 1;
|
|
204
247
|
}
|
|
205
248
|
|
|
@@ -216,8 +259,8 @@
|
|
|
216
259
|
|
|
217
260
|
/* Non-root folders - top & bottom HR dividers */
|
|
218
261
|
.dialkit-folder:not(.dialkit-folder-root) {
|
|
219
|
-
border-top: 1px solid
|
|
220
|
-
border-bottom: 1px solid
|
|
262
|
+
border-top: 1px solid var(--dial-surface-subtle);
|
|
263
|
+
border-bottom: 1px solid var(--dial-surface-subtle);
|
|
221
264
|
margin-top: 4px;
|
|
222
265
|
margin-bottom: 4px;
|
|
223
266
|
padding-bottom: 0;
|
|
@@ -286,11 +329,11 @@
|
|
|
286
329
|
}
|
|
287
330
|
|
|
288
331
|
.dialkit-slider-active .dialkit-slider-hashmark {
|
|
289
|
-
background:
|
|
332
|
+
background: var(--dial-border-hover);
|
|
290
333
|
}
|
|
291
334
|
|
|
292
335
|
.dialkit-slider-active .dialkit-slider-value {
|
|
293
|
-
color:
|
|
336
|
+
color: var(--dial-text-focus);
|
|
294
337
|
}
|
|
295
338
|
|
|
296
339
|
.dialkit-slider-fill {
|
|
@@ -298,16 +341,22 @@
|
|
|
298
341
|
top: 0;
|
|
299
342
|
bottom: 0;
|
|
300
343
|
left: 0;
|
|
344
|
+
background: var(--dial-surface-active);
|
|
301
345
|
transition: background 0.15s;
|
|
302
346
|
pointer-events: none;
|
|
303
347
|
}
|
|
304
348
|
|
|
349
|
+
.dialkit-slider-active .dialkit-slider-fill {
|
|
350
|
+
background: var(--dial-border-hover);
|
|
351
|
+
}
|
|
352
|
+
|
|
305
353
|
.dialkit-slider-handle {
|
|
306
354
|
position: absolute;
|
|
307
355
|
top: 50%;
|
|
308
356
|
width: 3px;
|
|
309
357
|
height: 20px;
|
|
310
358
|
border-radius: 999px;
|
|
359
|
+
background: var(--dial-text-primary);
|
|
311
360
|
pointer-events: none;
|
|
312
361
|
}
|
|
313
362
|
|
|
@@ -321,6 +370,8 @@
|
|
|
321
370
|
color: var(--dial-text-label);
|
|
322
371
|
pointer-events: none;
|
|
323
372
|
transition: color 0.15s;
|
|
373
|
+
display: inline-flex;
|
|
374
|
+
align-items: center;
|
|
324
375
|
}
|
|
325
376
|
|
|
326
377
|
.dialkit-slider-value {
|
|
@@ -330,7 +381,7 @@
|
|
|
330
381
|
transform: translateY(calc(-50% + 0.5px));
|
|
331
382
|
font-size: 13px;
|
|
332
383
|
font-weight: 500;
|
|
333
|
-
font-family:
|
|
384
|
+
font-family: 'Geist Mono', monospace;
|
|
334
385
|
color: var(--dial-text-label);
|
|
335
386
|
pointer-events: auto;
|
|
336
387
|
transition: color 0.15s, border-color 0.15s;
|
|
@@ -352,7 +403,7 @@
|
|
|
352
403
|
max-width: 6ch;
|
|
353
404
|
font-size: 13px;
|
|
354
405
|
font-weight: 500;
|
|
355
|
-
font-family:
|
|
406
|
+
font-family: 'Geist Mono', monospace;
|
|
356
407
|
color: var(--dial-text-label);
|
|
357
408
|
background: transparent;
|
|
358
409
|
border: none;
|
|
@@ -363,7 +414,7 @@
|
|
|
363
414
|
}
|
|
364
415
|
|
|
365
416
|
.dialkit-slider-input:focus {
|
|
366
|
-
color:
|
|
417
|
+
color: var(--dial-text-focus);
|
|
367
418
|
}
|
|
368
419
|
|
|
369
420
|
/* Segmented Control */
|
|
@@ -388,8 +439,8 @@
|
|
|
388
439
|
.dialkit-segmented-button {
|
|
389
440
|
position: relative;
|
|
390
441
|
z-index: 1;
|
|
391
|
-
flex:
|
|
392
|
-
padding: 8px
|
|
442
|
+
flex: 0 0 auto;
|
|
443
|
+
padding: 6px 8px;
|
|
393
444
|
font-family: inherit;
|
|
394
445
|
font-size: 13px;
|
|
395
446
|
font-weight: 500;
|
|
@@ -400,7 +451,7 @@
|
|
|
400
451
|
}
|
|
401
452
|
|
|
402
453
|
.dialkit-segmented-button[data-active="true"] {
|
|
403
|
-
color:
|
|
454
|
+
color: var(--dial-text-primary);
|
|
404
455
|
}
|
|
405
456
|
|
|
406
457
|
.dialkit-segmented-button[data-active="false"] {
|
|
@@ -445,7 +496,7 @@
|
|
|
445
496
|
}
|
|
446
497
|
|
|
447
498
|
.dialkit-toggle[data-checked="true"] .dialkit-toggle-track {
|
|
448
|
-
background:
|
|
499
|
+
background: var(--dial-border-hover);
|
|
449
500
|
}
|
|
450
501
|
|
|
451
502
|
.dialkit-toggle-thumb {
|
|
@@ -454,7 +505,7 @@
|
|
|
454
505
|
width: 16px;
|
|
455
506
|
height: 16px;
|
|
456
507
|
border-radius: 8px;
|
|
457
|
-
background:
|
|
508
|
+
background: var(--dial-text-primary);
|
|
458
509
|
}
|
|
459
510
|
|
|
460
511
|
/* Button Group */
|
|
@@ -500,6 +551,8 @@
|
|
|
500
551
|
}
|
|
501
552
|
|
|
502
553
|
.dialkit-labeled-control-label {
|
|
554
|
+
display: flex;
|
|
555
|
+
align-items: center;
|
|
503
556
|
font-size: 13px;
|
|
504
557
|
font-weight: 500;
|
|
505
558
|
color: var(--dial-text-label);
|
|
@@ -509,6 +562,7 @@
|
|
|
509
562
|
|
|
510
563
|
.dialkit-labeled-control .dialkit-segmented {
|
|
511
564
|
flex-shrink: 0;
|
|
565
|
+
margin-right: -6px;
|
|
512
566
|
}
|
|
513
567
|
|
|
514
568
|
.dialkit-action-button {
|
|
@@ -572,6 +626,8 @@
|
|
|
572
626
|
gap: 6px;
|
|
573
627
|
height: var(--dial-row-height);
|
|
574
628
|
margin-bottom: 6px;
|
|
629
|
+
min-width: 0;
|
|
630
|
+
overflow: hidden;
|
|
575
631
|
}
|
|
576
632
|
|
|
577
633
|
.dialkit-toolbar-add {
|
|
@@ -671,7 +727,7 @@
|
|
|
671
727
|
}
|
|
672
728
|
|
|
673
729
|
.dialkit-text-input:focus {
|
|
674
|
-
color:
|
|
730
|
+
color: var(--dial-text-focus);
|
|
675
731
|
}
|
|
676
732
|
|
|
677
733
|
.dialkit-text-input::placeholder {
|
|
@@ -748,7 +804,7 @@
|
|
|
748
804
|
border-radius: var(--dial-radius);
|
|
749
805
|
padding: 4px;
|
|
750
806
|
z-index: 10000;
|
|
751
|
-
box-shadow:
|
|
807
|
+
box-shadow: var(--dial-shadow-dropdown);
|
|
752
808
|
}
|
|
753
809
|
|
|
754
810
|
.dialkit-select-option {
|
|
@@ -805,7 +861,7 @@
|
|
|
805
861
|
.dialkit-color-hex {
|
|
806
862
|
font-size: 13px;
|
|
807
863
|
font-weight: 500;
|
|
808
|
-
font-family:
|
|
864
|
+
font-family: 'Geist Mono', monospace;
|
|
809
865
|
color: var(--dial-text-label);
|
|
810
866
|
cursor: text;
|
|
811
867
|
transform: translateY(-0.5px);
|
|
@@ -815,7 +871,7 @@
|
|
|
815
871
|
width: 7ch;
|
|
816
872
|
font-size: 13px;
|
|
817
873
|
font-weight: 500;
|
|
818
|
-
font-family:
|
|
874
|
+
font-family: 'Geist Mono', monospace;
|
|
819
875
|
color: var(--dial-text-label);
|
|
820
876
|
background: transparent;
|
|
821
877
|
border: none;
|
|
@@ -826,14 +882,14 @@
|
|
|
826
882
|
}
|
|
827
883
|
|
|
828
884
|
.dialkit-color-hex-input:focus {
|
|
829
|
-
color:
|
|
885
|
+
color: var(--dial-text-focus);
|
|
830
886
|
}
|
|
831
887
|
|
|
832
888
|
.dialkit-color-swatch {
|
|
833
889
|
width: 20px;
|
|
834
890
|
height: 20px;
|
|
835
891
|
border-radius: 4px;
|
|
836
|
-
border: 1px solid
|
|
892
|
+
border: 1px solid var(--dial-border-hover);
|
|
837
893
|
cursor: pointer;
|
|
838
894
|
transition: transform 0.15s;
|
|
839
895
|
}
|
|
@@ -899,12 +955,12 @@
|
|
|
899
955
|
|
|
900
956
|
.dialkit-preset-dropdown {
|
|
901
957
|
width: max-content;
|
|
902
|
-
background:
|
|
958
|
+
background: var(--dial-dropdown-bg);
|
|
903
959
|
border: 1px solid var(--dial-border);
|
|
904
960
|
border-radius: 12px;
|
|
905
961
|
padding: 4px;
|
|
906
962
|
z-index: 10000;
|
|
907
|
-
box-shadow:
|
|
963
|
+
box-shadow: var(--dial-shadow-dropdown);
|
|
908
964
|
}
|
|
909
965
|
|
|
910
966
|
.dialkit-preset-list {
|
|
@@ -974,7 +1030,7 @@
|
|
|
974
1030
|
.dialkit-preset-delete svg {
|
|
975
1031
|
width: 14px;
|
|
976
1032
|
height: 14px;
|
|
977
|
-
color:
|
|
1033
|
+
color: var(--dial-text-focus);
|
|
978
1034
|
pointer-events: none;
|
|
979
1035
|
}
|
|
980
1036
|
|
|
@@ -1062,3 +1118,209 @@
|
|
|
1062
1118
|
height: 14px;
|
|
1063
1119
|
color: var(--dial-text-label);
|
|
1064
1120
|
}
|
|
1121
|
+
|
|
1122
|
+
/* Shortcut Pill */
|
|
1123
|
+
.dialkit-shortcut-pill {
|
|
1124
|
+
display: inline-block;
|
|
1125
|
+
font-size: 10px;
|
|
1126
|
+
font-weight: 600;
|
|
1127
|
+
font-family: system-ui, -apple-system, sans-serif;
|
|
1128
|
+
color: var(--dial-text-tertiary);
|
|
1129
|
+
background: var(--dial-surface-subtle);
|
|
1130
|
+
padding: 1px 5px;
|
|
1131
|
+
border-radius: 4px;
|
|
1132
|
+
margin-left: 6px;
|
|
1133
|
+
letter-spacing: 0.02em;
|
|
1134
|
+
line-height: 16px;
|
|
1135
|
+
white-space: nowrap;
|
|
1136
|
+
vertical-align: middle;
|
|
1137
|
+
transition: color 0.15s, background 0.15s;
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
.dialkit-shortcut-pill-active {
|
|
1141
|
+
color: var(--dial-text-primary);
|
|
1142
|
+
background: var(--dial-border-hover);
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
/* Shortcuts Menu Trigger */
|
|
1146
|
+
.dialkit-shortcuts-trigger {
|
|
1147
|
+
display: flex;
|
|
1148
|
+
align-items: center;
|
|
1149
|
+
justify-content: center;
|
|
1150
|
+
width: var(--dial-row-height);
|
|
1151
|
+
height: var(--dial-row-height);
|
|
1152
|
+
padding: 0;
|
|
1153
|
+
flex-shrink: 0;
|
|
1154
|
+
background: var(--dial-surface);
|
|
1155
|
+
border: none;
|
|
1156
|
+
border-radius: var(--dial-radius);
|
|
1157
|
+
cursor: pointer;
|
|
1158
|
+
transition: background 0.15s;
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
.dialkit-shortcuts-trigger:hover {
|
|
1162
|
+
background: var(--dial-surface-hover);
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
.dialkit-shortcuts-trigger svg {
|
|
1166
|
+
width: 16px;
|
|
1167
|
+
height: 16px;
|
|
1168
|
+
color: var(--dial-text-label);
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
/* Shortcuts Dropdown */
|
|
1172
|
+
.dialkit-shortcuts-dropdown {
|
|
1173
|
+
background: var(--dial-dropdown-bg);
|
|
1174
|
+
border: 1px solid var(--dial-border);
|
|
1175
|
+
border-radius: 12px;
|
|
1176
|
+
padding: 8px;
|
|
1177
|
+
z-index: 10000;
|
|
1178
|
+
box-shadow: var(--dial-shadow-dropdown);
|
|
1179
|
+
min-width: 200px;
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
.dialkit-shortcuts-title {
|
|
1183
|
+
font-size: 11px;
|
|
1184
|
+
font-weight: 600;
|
|
1185
|
+
color: var(--dial-text-tertiary);
|
|
1186
|
+
text-transform: uppercase;
|
|
1187
|
+
letter-spacing: 0.05em;
|
|
1188
|
+
padding: 4px 8px 8px;
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
.dialkit-shortcuts-list {
|
|
1192
|
+
display: flex;
|
|
1193
|
+
flex-direction: column;
|
|
1194
|
+
gap: 2px;
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
.dialkit-shortcuts-row {
|
|
1198
|
+
display: flex;
|
|
1199
|
+
align-items: center;
|
|
1200
|
+
gap: 10px;
|
|
1201
|
+
padding: 6px 8px;
|
|
1202
|
+
border-radius: 6px;
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
.dialkit-shortcuts-row-key {
|
|
1206
|
+
font-size: 11px;
|
|
1207
|
+
font-weight: 600;
|
|
1208
|
+
font-family: ui-monospace, 'SF Mono', 'Courier New', monospace;
|
|
1209
|
+
color: var(--dial-text-secondary);
|
|
1210
|
+
background: var(--dial-surface-subtle);
|
|
1211
|
+
padding: 2px 6px;
|
|
1212
|
+
border-radius: 4px;
|
|
1213
|
+
min-width: 28px;
|
|
1214
|
+
text-align: center;
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
.dialkit-shortcuts-row-label {
|
|
1218
|
+
flex: 1;
|
|
1219
|
+
font-size: 13px;
|
|
1220
|
+
font-weight: 500;
|
|
1221
|
+
color: var(--dial-text-label);
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
.dialkit-shortcuts-row-mode {
|
|
1225
|
+
font-size: 11px;
|
|
1226
|
+
font-weight: 500;
|
|
1227
|
+
color: var(--dial-text-tertiary);
|
|
1228
|
+
font-style: italic;
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
.dialkit-shortcuts-hint {
|
|
1232
|
+
font-size: 11px;
|
|
1233
|
+
color: var(--dial-text-tertiary);
|
|
1234
|
+
padding: 6px 8px 2px;
|
|
1235
|
+
border-top: 1px solid var(--dial-border);
|
|
1236
|
+
margin-top: 4px;
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
/* ── Light Theme ── */
|
|
1240
|
+
.dialkit-root[data-theme="light"] {
|
|
1241
|
+
--dial-surface: rgba(0, 0, 0, 0.04);
|
|
1242
|
+
--dial-surface-hover: rgba(0, 0, 0, 0.08);
|
|
1243
|
+
--dial-surface-active: rgba(0, 0, 0, 0.1);
|
|
1244
|
+
--dial-surface-subtle: rgba(0, 0, 0, 0.06);
|
|
1245
|
+
|
|
1246
|
+
--dial-text-root: #000000;
|
|
1247
|
+
--dial-text-section: rgba(0, 0, 0, 0.65);
|
|
1248
|
+
--dial-text-label: rgba(0, 0, 0, 0.6);
|
|
1249
|
+
--dial-text-focus: #000000;
|
|
1250
|
+
|
|
1251
|
+
--dial-text-primary: rgba(0, 0, 0, 0.9);
|
|
1252
|
+
--dial-text-secondary: rgba(0, 0, 0, 0.55);
|
|
1253
|
+
--dial-text-tertiary: rgba(0, 0, 0, 0.35);
|
|
1254
|
+
|
|
1255
|
+
--dial-border: rgba(0, 0, 0, 0.1);
|
|
1256
|
+
--dial-border-hover: rgba(0, 0, 0, 0.15);
|
|
1257
|
+
|
|
1258
|
+
--dial-glass-bg: #fafafa;
|
|
1259
|
+
--dial-dropdown-bg: #ffffff;
|
|
1260
|
+
--dial-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
|
|
1261
|
+
--dial-shadow-collapsed: 0 2px 10px rgba(0, 0, 0, 0.06);
|
|
1262
|
+
--dial-shadow-dropdown: 0 4px 16px rgba(0, 0, 0, 0.08);
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
/* Light mode: SVG visualization overrides */
|
|
1266
|
+
.dialkit-root[data-theme="light"] .dialkit-spring-viz line {
|
|
1267
|
+
stroke: rgba(0, 0, 0, 0.08);
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
.dialkit-root[data-theme="light"] .dialkit-spring-viz line[stroke-dasharray] {
|
|
1271
|
+
stroke: rgba(0, 0, 0, 0.15);
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
.dialkit-root[data-theme="light"] .dialkit-spring-viz path {
|
|
1275
|
+
stroke: rgba(0, 0, 0, 0.5);
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
/* Light mode: toggle thumb needs shadow for definition */
|
|
1279
|
+
.dialkit-root[data-theme="light"] .dialkit-toggle-thumb {
|
|
1280
|
+
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.08);
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
/* ── System preference: light ── */
|
|
1284
|
+
@media (prefers-color-scheme: light) {
|
|
1285
|
+
.dialkit-root[data-theme="system"] {
|
|
1286
|
+
--dial-surface: rgba(0, 0, 0, 0.04);
|
|
1287
|
+
--dial-surface-hover: rgba(0, 0, 0, 0.08);
|
|
1288
|
+
--dial-surface-active: rgba(0, 0, 0, 0.1);
|
|
1289
|
+
--dial-surface-subtle: rgba(0, 0, 0, 0.06);
|
|
1290
|
+
|
|
1291
|
+
--dial-text-root: #000000;
|
|
1292
|
+
--dial-text-section: rgba(0, 0, 0, 0.65);
|
|
1293
|
+
--dial-text-label: rgba(0, 0, 0, 0.6);
|
|
1294
|
+
--dial-text-focus: #000000;
|
|
1295
|
+
|
|
1296
|
+
--dial-text-primary: rgba(0, 0, 0, 0.9);
|
|
1297
|
+
--dial-text-secondary: rgba(0, 0, 0, 0.55);
|
|
1298
|
+
--dial-text-tertiary: rgba(0, 0, 0, 0.35);
|
|
1299
|
+
|
|
1300
|
+
--dial-border: rgba(0, 0, 0, 0.1);
|
|
1301
|
+
--dial-border-hover: rgba(0, 0, 0, 0.15);
|
|
1302
|
+
|
|
1303
|
+
--dial-glass-bg: #fafafa;
|
|
1304
|
+
--dial-dropdown-bg: #ffffff;
|
|
1305
|
+
--dial-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
|
|
1306
|
+
--dial-shadow-collapsed: 0 2px 10px rgba(0, 0, 0, 0.06);
|
|
1307
|
+
--dial-shadow-dropdown: 0 4px 16px rgba(0, 0, 0, 0.08);
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
.dialkit-root[data-theme="system"] .dialkit-spring-viz line {
|
|
1311
|
+
stroke: rgba(0, 0, 0, 0.08);
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
.dialkit-root[data-theme="system"] .dialkit-spring-viz line[stroke-dasharray] {
|
|
1315
|
+
stroke: rgba(0, 0, 0, 0.15);
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
.dialkit-root[data-theme="system"] .dialkit-spring-viz path {
|
|
1319
|
+
stroke: rgba(0, 0, 0, 0.5);
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
.dialkit-root[data-theme="system"] .dialkit-toggle-thumb {
|
|
1323
|
+
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.08);
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
let { target = 'body', children } = $props<{ target?: string | HTMLElement | null; children?: Snippet }>();
|
|
5
|
+
|
|
6
|
+
let portalEl: HTMLDivElement | undefined;
|
|
7
|
+
|
|
8
|
+
const resolveTarget = (): HTMLElement | null => {
|
|
9
|
+
if (typeof document === 'undefined') return null;
|
|
10
|
+
if (!target) return document.body;
|
|
11
|
+
if (typeof target === 'string') return document.querySelector(target);
|
|
12
|
+
return target;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
$effect(() => {
|
|
16
|
+
if (!portalEl) return;
|
|
17
|
+
const root = resolveTarget();
|
|
18
|
+
if (!root) return;
|
|
19
|
+
|
|
20
|
+
root.appendChild(portalEl);
|
|
21
|
+
|
|
22
|
+
return () => {
|
|
23
|
+
portalEl?.remove();
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<div bind:this={portalEl} style="display: contents;">
|
|
29
|
+
{#if children}{@render children()}{/if}
|
|
30
|
+
</div>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
target?: string | HTMLElement | null;
|
|
4
|
+
children?: Snippet;
|
|
5
|
+
};
|
|
6
|
+
declare const Portal: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type Portal = ReturnType<typeof Portal>;
|
|
8
|
+
export default Portal;
|
|
9
|
+
//# sourceMappingURL=Portal.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Portal.svelte.d.ts","sourceRoot":"","sources":["../../src/svelte/Portal.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAErC,KAAK,gBAAgB,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAkCtF,QAAA,MAAM,MAAM,sDAAwC,CAAC;AACrD,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AACxC,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
export type ButtonAction = {
|
|
3
|
+
label: string;
|
|
4
|
+
onClick: () => void;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
let { buttons } = $props<{ buttons: ButtonAction[] }>();
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<div class="dialkit-button-group">
|
|
11
|
+
{#each buttons as button (button.label)}
|
|
12
|
+
<button class="dialkit-button" onclick={button.onClick}>
|
|
13
|
+
{button.label}
|
|
14
|
+
</button>
|
|
15
|
+
{/each}
|
|
16
|
+
</div>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type ButtonAction = {
|
|
2
|
+
label: string;
|
|
3
|
+
onClick: () => void;
|
|
4
|
+
};
|
|
5
|
+
type $$ComponentProps = {
|
|
6
|
+
buttons: ButtonAction[];
|
|
7
|
+
};
|
|
8
|
+
declare const ButtonGroup: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
9
|
+
type ButtonGroup = ReturnType<typeof ButtonGroup>;
|
|
10
|
+
export default ButtonGroup;
|
|
11
|
+
//# sourceMappingURL=ButtonGroup.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonGroup.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/ButtonGroup.svelte.ts"],"names":[],"mappings":"AAGE,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AACH,KAAK,gBAAgB,GAAG;IAAE,OAAO,EAAE,YAAY,EAAE,CAAA;CAAE,CAAC;AAiBrD,QAAA,MAAM,WAAW,sDAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
const HEX_COLOR_REGEX = /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/;
|
|
3
|
+
|
|
4
|
+
let { label, value, onChange } = $props<{
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
onChange: (value: string) => void;
|
|
8
|
+
}>();
|
|
9
|
+
|
|
10
|
+
let isEditing = $state(false);
|
|
11
|
+
let editValue = $state(value);
|
|
12
|
+
let colorInputRef: HTMLInputElement | undefined;
|
|
13
|
+
|
|
14
|
+
const expandShorthandHex = (hex: string) => {
|
|
15
|
+
if (hex.length !== 4) return hex;
|
|
16
|
+
return `#${hex[1]}${hex[1]}${hex[2]}${hex[2]}${hex[3]}${hex[3]}`;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
$effect(() => {
|
|
20
|
+
value;
|
|
21
|
+
if (!isEditing) {
|
|
22
|
+
editValue = value;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const handleTextSubmit = () => {
|
|
27
|
+
isEditing = false;
|
|
28
|
+
if (HEX_COLOR_REGEX.test(editValue)) {
|
|
29
|
+
onChange(editValue);
|
|
30
|
+
} else {
|
|
31
|
+
editValue = value;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const handleKeyDown = (e: KeyboardEvent) => {
|
|
36
|
+
if (e.key === 'Enter') {
|
|
37
|
+
handleTextSubmit();
|
|
38
|
+
} else if (e.key === 'Escape') {
|
|
39
|
+
isEditing = false;
|
|
40
|
+
editValue = value;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<div class="dialkit-color-control">
|
|
46
|
+
<label class="dialkit-color-label">{label}</label>
|
|
47
|
+
<div class="dialkit-color-inputs">
|
|
48
|
+
{#if isEditing}
|
|
49
|
+
<input
|
|
50
|
+
type="text"
|
|
51
|
+
class="dialkit-color-hex-input"
|
|
52
|
+
value={editValue}
|
|
53
|
+
oninput={(e) => (editValue = (e.currentTarget as HTMLInputElement).value)}
|
|
54
|
+
onblur={handleTextSubmit}
|
|
55
|
+
onkeydown={handleKeyDown}
|
|
56
|
+
autofocus
|
|
57
|
+
/>
|
|
58
|
+
{:else}
|
|
59
|
+
<span class="dialkit-color-hex" onclick={() => (isEditing = true)}>
|
|
60
|
+
{(value ?? '').toUpperCase()}
|
|
61
|
+
</span>
|
|
62
|
+
{/if}
|
|
63
|
+
|
|
64
|
+
<button
|
|
65
|
+
class="dialkit-color-swatch"
|
|
66
|
+
style:background-color={value}
|
|
67
|
+
onclick={() => colorInputRef?.click()}
|
|
68
|
+
title="Pick color"
|
|
69
|
+
aria-label={`Pick color for ${label}`}
|
|
70
|
+
/>
|
|
71
|
+
|
|
72
|
+
<input
|
|
73
|
+
bind:this={colorInputRef}
|
|
74
|
+
type="color"
|
|
75
|
+
class="dialkit-color-picker-native"
|
|
76
|
+
aria-label={`${label} color picker`}
|
|
77
|
+
value={value.length === 4 ? expandShorthandHex(value) : value.slice(0, 7)}
|
|
78
|
+
oninput={(e) => onChange((e.currentTarget as HTMLInputElement).value)}
|
|
79
|
+
/>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|