@xsynaptic/sonic-ui 0.19.0 → 0.20.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/CHANGELOG.md +16 -0
- package/README.md +9 -8
- package/dist/default/elements/sonic-element.js +1 -1
- package/dist/default/lib/canvas-surface.js +5 -1
- package/dist/dev/elements/button.js +3 -10
- package/dist/dev/elements/button.js.map +1 -1
- package/dist/dev/elements/dial.js +2 -12
- package/dist/dev/elements/dial.js.map +1 -1
- package/dist/dev/elements/display-element.js +1 -5
- package/dist/dev/elements/display-element.js.map +1 -1
- package/dist/dev/elements/envelope.js +2 -15
- package/dist/dev/elements/envelope.js.map +1 -1
- package/dist/dev/elements/meter.js +1 -1
- package/dist/dev/elements/meter.js.map +1 -1
- package/dist/dev/elements/number.js +2 -11
- package/dist/dev/elements/number.js.map +1 -1
- package/dist/dev/elements/segmented.js +3 -10
- package/dist/dev/elements/segmented.js.map +1 -1
- package/dist/dev/elements/slider.js +2 -12
- package/dist/dev/elements/slider.js.map +1 -1
- package/dist/dev/elements/sonic-element.d.ts +1 -22
- package/dist/dev/elements/sonic-element.js +7 -34
- package/dist/dev/elements/sonic-element.js.map +1 -1
- package/dist/dev/elements/switch.js +2 -5
- package/dist/dev/elements/switch.js.map +1 -1
- package/dist/dev/elements/toggle.js +3 -10
- package/dist/dev/elements/toggle.js.map +1 -1
- package/dist/dev/elements/wave-element.js +2 -12
- package/dist/dev/elements/wave-element.js.map +1 -1
- package/dist/dev/elements/xy.js +2 -12
- package/dist/dev/elements/xy.js.map +1 -1
- package/dist/dev/lib/canvas-surface.js +5 -1
- package/dist/dev/lib/canvas-surface.js.map +1 -1
- package/dist/skins/amber.css +0 -1
- package/dist/skins/ivory.css +0 -1
- package/dist/skins/lime.css +0 -1
- package/dist/skins/slate.css +0 -1
- package/dist/styles/envelope.css +14 -13
- package/dist/styles/material/bracket.css +1 -1
- package/dist/styles/material/cap.css +5 -1
- package/dist/styles/material/glass.css +0 -5
- package/dist/styles/material/pane.css +2 -9
- package/dist/styles/material/well.css +1 -12
- package/dist/styles/screen.css +1 -3
- package/dist/styles/spectrum.css +8 -22
- package/dist/styles/waveform.css +12 -24
- package/dist/styles/wavestrip.css +12 -33
- package/dist/styles/xy.css +43 -26
- package/package.json +1 -1
|
@@ -110,9 +110,6 @@
|
|
|
110
110
|
--_sonic-wavestrip-groove-ratio: var(--sonic-wavestrip-groove-ratio, 0.15);
|
|
111
111
|
--_sonic-wavestrip-groove-size: var(--sonic-wavestrip-groove-size, 0px);
|
|
112
112
|
--_sonic-wavestrip-marker-ratio: var(--sonic-wavestrip-marker-ratio, 0.065);
|
|
113
|
-
--_sonic-wavestrip-inset: calc(
|
|
114
|
-
var(--_sonic-wavestrip-size) * var(--sonic-wavestrip-inset-ratio, 0)
|
|
115
|
-
);
|
|
116
113
|
--_sonic-unit: calc(var(--_sonic-wavestrip-size) / 32);
|
|
117
114
|
--_sonic-wavestrip-lit: var(--_sonic-lit);
|
|
118
115
|
--_sonic-marker-size: var(
|
|
@@ -136,25 +133,17 @@
|
|
|
136
133
|
--_sonic-wavestrip-played: var(--_sonic-wavestrip-lit);
|
|
137
134
|
--_sonic-wavestrip-scrub: var(--sonic-scrub, color-mix(in oklab, var(--_sonic-lit) 55%, #fff));
|
|
138
135
|
|
|
136
|
+
/* fallow-ignore-next-line code-duplication -- a plain box restated, since sheets never import each other */
|
|
137
|
+
position: relative;
|
|
138
|
+
display: grid;
|
|
139
|
+
flex-shrink: 0;
|
|
140
|
+
grid-template: minmax(0, 1fr) / minmax(0, 1fr);
|
|
139
141
|
inline-size: var(--_sonic-wavestrip-length);
|
|
140
142
|
block-size: var(--_sonic-wavestrip-size);
|
|
141
|
-
padding: var(--_sonic-wavestrip-inset);
|
|
142
143
|
container-type: size;
|
|
143
144
|
touch-action: var(--sonic-touch-action, pan-y);
|
|
144
145
|
cursor: ew-resize;
|
|
145
|
-
|
|
146
|
-
--_sonic-wavestrip-radius-own: calc(
|
|
147
|
-
var(--_sonic-wavestrip-size) * var(--sonic-wavestrip-radius-ratio)
|
|
148
|
-
);
|
|
149
|
-
--_sonic-glass-radius: var(
|
|
150
|
-
--_sonic-wavestrip-radius-own,
|
|
151
|
-
var(
|
|
152
|
-
--sonic-radius,
|
|
153
|
-
calc(var(--_sonic-wavestrip-size) * var(--sonic-wavestrip-radius-ratio, 0.15))
|
|
154
|
-
)
|
|
155
|
-
);
|
|
156
|
-
|
|
157
|
-
border-radius: var(--_sonic-glass-radius);
|
|
146
|
+
user-select: none;
|
|
158
147
|
box-shadow: var(--_sonic-focus-shadow);
|
|
159
148
|
}
|
|
160
149
|
|
|
@@ -177,12 +166,11 @@
|
|
|
177
166
|
display: block;
|
|
178
167
|
inline-size: 100%;
|
|
179
168
|
block-size: 100%;
|
|
180
|
-
border-radius: max(0px, var(--_sonic-glass-radius) - var(--_sonic-wavestrip-inset));
|
|
181
169
|
}
|
|
182
170
|
|
|
183
171
|
.sonic-wavestrip-markers {
|
|
184
172
|
position: absolute;
|
|
185
|
-
inset:
|
|
173
|
+
inset: 0;
|
|
186
174
|
pointer-events: none;
|
|
187
175
|
}
|
|
188
176
|
|
|
@@ -195,7 +183,7 @@
|
|
|
195
183
|
--_sonic-marker-colour: color-mix(
|
|
196
184
|
in oklab,
|
|
197
185
|
var(--_sonic-marker, var(--_sonic-marker-default)) 45%,
|
|
198
|
-
|
|
186
|
+
transparent
|
|
199
187
|
);
|
|
200
188
|
}
|
|
201
189
|
}
|
|
@@ -207,12 +195,11 @@
|
|
|
207
195
|
block-size: var(--_sonic-marker-size);
|
|
208
196
|
background: var(--_sonic-marker-colour);
|
|
209
197
|
border-radius: 50%;
|
|
210
|
-
box-shadow: 0 0 0 var(--_sonic-marker-edge) var(--
|
|
198
|
+
box-shadow: 0 0 0 var(--_sonic-marker-edge) var(--sonic-wavestrip-marker-edge, transparent);
|
|
211
199
|
}
|
|
212
200
|
|
|
213
201
|
.sonic-wavestrip-region {
|
|
214
|
-
inset: calc(
|
|
215
|
-
calc(var(--_sonic-marker-from, 0) * 100%);
|
|
202
|
+
inset: 0 auto 0 calc(var(--_sonic-marker-from, 0) * 100%);
|
|
216
203
|
box-sizing: border-box;
|
|
217
204
|
inline-size: calc((var(--_sonic-marker-to, 0) - var(--_sonic-marker-from, 0)) * 100%);
|
|
218
205
|
background: color-mix(in oklab, var(--_sonic-marker-colour) 16%, transparent);
|
|
@@ -222,23 +209,15 @@
|
|
|
222
209
|
|
|
223
210
|
/* Bare `block-start` spans the viewport; `translate` belongs to the open transition */
|
|
224
211
|
.sonic-wavestrip-readout {
|
|
225
|
-
--_sonic-wavestrip-readout-inset: calc(
|
|
226
|
-
var(--_sonic-wavestrip-inset) + var(--_sonic-wavestrip-readout-at, 0) * 100cqi
|
|
227
|
-
);
|
|
228
|
-
|
|
229
212
|
inset-inline: 0;
|
|
230
213
|
justify-self: start;
|
|
231
214
|
position-area: block-start center;
|
|
232
215
|
transform: translateX(
|
|
233
|
-
clamp(
|
|
234
|
-
0px,
|
|
235
|
-
var(--_sonic-wavestrip-readout-inset) - 50%,
|
|
236
|
-
100cqi + 2 * var(--_sonic-wavestrip-inset) - 100%
|
|
237
|
-
)
|
|
216
|
+
clamp(0px, var(--_sonic-wavestrip-readout-at, 0) * 100cqi - 50%, 100cqi - 100%)
|
|
238
217
|
);
|
|
239
218
|
}
|
|
240
219
|
|
|
241
|
-
/* Opaque, since a system highlight carries alpha that would blend the bars into
|
|
220
|
+
/* Opaque, since a system highlight carries alpha that would blend the bars into what is behind them */
|
|
242
221
|
@media (forced-colors: active) {
|
|
243
222
|
.sonic-wavestrip {
|
|
244
223
|
--_sonic-wavestrip-lit: Highlight;
|
package/dist/styles/xy.css
CHANGED
|
@@ -25,29 +25,24 @@
|
|
|
25
25
|
|
|
26
26
|
.sonic-xy {
|
|
27
27
|
--_sonic-xy-puck-ratio: var(--sonic-xy-puck-ratio, 0.2);
|
|
28
|
-
--_sonic-xy-radius-ratio: var(--sonic-xy-radius-ratio, 0.06);
|
|
29
|
-
--_sonic-xy-inset-ratio: var(--sonic-xy-inset-ratio, 0.04);
|
|
30
28
|
--_sonic-unit: calc(var(--_sonic-xy-size) / 96);
|
|
31
29
|
--_sonic-xy-lit: var(--_sonic-lit);
|
|
32
30
|
--_sonic-xy-cursor: grab;
|
|
33
31
|
--_sonic-xy-puck: calc(var(--_sonic-xy-size) * var(--_sonic-xy-puck-ratio));
|
|
34
|
-
--_sonic-xy-
|
|
35
|
-
--_sonic-xy-travel-
|
|
36
|
-
--_sonic-xy-travel-y: calc(100cqb - 2 * var(--_sonic-xy-inset) - var(--_sonic-xy-puck));
|
|
32
|
+
--_sonic-xy-travel-x: calc(100cqi - var(--_sonic-xy-puck));
|
|
33
|
+
--_sonic-xy-travel-y: calc(100cqb - var(--_sonic-xy-puck));
|
|
37
34
|
|
|
35
|
+
/* fallow-ignore-next-line code-duplication -- a plain box restated, since sheets never import each other */
|
|
36
|
+
position: relative;
|
|
37
|
+
display: grid;
|
|
38
|
+
flex-shrink: 0;
|
|
39
|
+
grid-template: minmax(0, 1fr) / minmax(0, 1fr);
|
|
38
40
|
inline-size: calc(var(--_sonic-xy-size) * var(--_sonic-xy-aspect-ratio));
|
|
39
41
|
block-size: var(--_sonic-xy-size);
|
|
40
42
|
container-type: size;
|
|
41
43
|
touch-action: none;
|
|
42
44
|
cursor: crosshair;
|
|
43
|
-
|
|
44
|
-
--_sonic-xy-radius-own: calc(var(--_sonic-xy-size) * var(--sonic-xy-radius-ratio));
|
|
45
|
-
--_sonic-glass-radius: var(
|
|
46
|
-
--_sonic-xy-radius-own,
|
|
47
|
-
var(--sonic-radius, calc(var(--_sonic-xy-size) * var(--_sonic-xy-radius-ratio)))
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
border-radius: var(--_sonic-glass-radius);
|
|
45
|
+
user-select: none;
|
|
51
46
|
}
|
|
52
47
|
|
|
53
48
|
:disabled > .sonic-xy {
|
|
@@ -63,9 +58,11 @@
|
|
|
63
58
|
--_sonic-xy-x-high: max(var(--_sonic-xy-x-origin, 0), var(--_sonic-xy-x, 0));
|
|
64
59
|
--_sonic-xy-y-low: min(var(--_sonic-xy-y-origin, 0), var(--_sonic-xy-y, 0));
|
|
65
60
|
--_sonic-xy-y-high: max(var(--_sonic-xy-y-origin, 0), var(--_sonic-xy-y, 0));
|
|
61
|
+
--_sonic-xy-cut-x: calc(var(--_sonic-xy-x, 0) * var(--_sonic-xy-travel-x));
|
|
62
|
+
--_sonic-xy-cut-y: calc(var(--_sonic-xy-y, 0) * var(--_sonic-xy-travel-y));
|
|
66
63
|
|
|
67
64
|
position: absolute;
|
|
68
|
-
inset:
|
|
65
|
+
inset: 0;
|
|
69
66
|
pointer-events: none;
|
|
70
67
|
|
|
71
68
|
&::before,
|
|
@@ -74,6 +71,8 @@
|
|
|
74
71
|
content: '';
|
|
75
72
|
}
|
|
76
73
|
|
|
74
|
+
/* Each line is cut under the puck, which is see-through while held; the cut ends inside its ring */
|
|
75
|
+
|
|
77
76
|
&::before {
|
|
78
77
|
inset: auto 0
|
|
79
78
|
calc(
|
|
@@ -97,6 +96,12 @@
|
|
|
97
96
|
transparent 0
|
|
98
97
|
),
|
|
99
98
|
var(--_sonic-unlit);
|
|
99
|
+
mask: linear-gradient(
|
|
100
|
+
to right,
|
|
101
|
+
#000 calc(var(--_sonic-xy-cut-x) + 0.29 * var(--_sonic-xy-puck)),
|
|
102
|
+
transparent 0 calc(var(--_sonic-xy-cut-x) + 0.71 * var(--_sonic-xy-puck)),
|
|
103
|
+
#000 0
|
|
104
|
+
);
|
|
100
105
|
}
|
|
101
106
|
|
|
102
107
|
&::after {
|
|
@@ -122,14 +127,19 @@
|
|
|
122
127
|
transparent 0
|
|
123
128
|
),
|
|
124
129
|
var(--_sonic-unlit);
|
|
130
|
+
mask: linear-gradient(
|
|
131
|
+
to top,
|
|
132
|
+
#000 calc(var(--_sonic-xy-cut-y) + 0.29 * var(--_sonic-xy-puck)),
|
|
133
|
+
transparent 0 calc(var(--_sonic-xy-cut-y) + 0.71 * var(--_sonic-xy-puck)),
|
|
134
|
+
#000 0
|
|
135
|
+
);
|
|
125
136
|
}
|
|
126
137
|
}
|
|
127
138
|
|
|
128
139
|
:is(.sonic-xy-bracket, .sonic-xy-puck) {
|
|
129
140
|
position: absolute;
|
|
130
|
-
inset: auto auto
|
|
131
|
-
calc(var(--_sonic-xy-
|
|
132
|
-
calc(var(--_sonic-xy-inset) + var(--_sonic-xy-x, 0) * var(--_sonic-xy-travel-x));
|
|
141
|
+
inset: auto auto calc(var(--_sonic-xy-y, 0) * var(--_sonic-xy-travel-y))
|
|
142
|
+
calc(var(--_sonic-xy-x, 0) * var(--_sonic-xy-travel-x));
|
|
133
143
|
inline-size: var(--_sonic-xy-puck);
|
|
134
144
|
block-size: var(--_sonic-xy-puck);
|
|
135
145
|
border-radius: 50%;
|
|
@@ -144,7 +154,8 @@
|
|
|
144
154
|
--_sonic-xy-puck-edge: var(--_sonic-xy-puck-fill);
|
|
145
155
|
--_sonic-xy-puck-lift: color-mix(in oklab, var(--_sonic-xy-lit) 85%, #fff);
|
|
146
156
|
--_sonic-xy-puck-glow: transparent;
|
|
147
|
-
--_sonic-xy-puck-ring:
|
|
157
|
+
--_sonic-xy-puck-ring: transparent;
|
|
158
|
+
--_sonic-xy-puck-ring-width: max(2px, round(0.08 * var(--_sonic-xy-puck), var(--_sonic-snap)));
|
|
148
159
|
|
|
149
160
|
cursor: var(--_sonic-xy-cursor);
|
|
150
161
|
filter: drop-shadow(0 0 calc(0.15 * var(--_sonic-xy-puck)) var(--_sonic-xy-puck-glow));
|
|
@@ -154,15 +165,16 @@
|
|
|
154
165
|
position: absolute;
|
|
155
166
|
inset: 25%;
|
|
156
167
|
pointer-events: none;
|
|
168
|
+
outline: var(--_sonic-xy-puck-ring-width) solid var(--_sonic-xy-puck-ring);
|
|
169
|
+
outline-offset: var(--_sonic-xy-puck-ring-width);
|
|
157
170
|
content: '';
|
|
158
171
|
background: var(--_sonic-xy-puck-fill);
|
|
159
172
|
border: max(1px, 0.08 * var(--_sonic-xy-puck)) solid var(--_sonic-xy-puck-edge);
|
|
160
173
|
border-radius: 50%;
|
|
161
|
-
box-shadow: var(--_sonic-xy-puck-ring);
|
|
162
174
|
transition:
|
|
163
175
|
background-color var(--_sonic-fade-duration) ease-out,
|
|
164
176
|
border-color var(--_sonic-fade-duration) ease-out,
|
|
165
|
-
|
|
177
|
+
outline-color var(--_sonic-fade-duration) ease-out;
|
|
166
178
|
}
|
|
167
179
|
}
|
|
168
180
|
|
|
@@ -174,13 +186,11 @@
|
|
|
174
186
|
|
|
175
187
|
.sonic-xy-puck:has(> :focus-visible:not([data-sonic-pointer-focus])) {
|
|
176
188
|
--_sonic-xy-puck-fill: var(--_sonic-xy-puck-lift);
|
|
177
|
-
--_sonic-xy-puck-ring:
|
|
178
|
-
0 0 0 max(2px, round(0.08 * var(--_sonic-xy-puck), var(--_sonic-snap))) var(--_sonic-glass),
|
|
179
|
-
0 0 0 max(4px, round(0.16 * var(--_sonic-xy-puck), var(--_sonic-snap))) var(--_sonic-focus);
|
|
189
|
+
--_sonic-xy-puck-ring: var(--_sonic-focus);
|
|
180
190
|
}
|
|
181
191
|
|
|
182
192
|
:state(dragging) > .sonic-xy > .sonic-xy-puck {
|
|
183
|
-
--_sonic-xy-puck-fill:
|
|
193
|
+
--_sonic-xy-puck-fill: transparent;
|
|
184
194
|
--_sonic-xy-puck-edge: var(--_sonic-xy-lit);
|
|
185
195
|
--_sonic-xy-puck-glow: color-mix(
|
|
186
196
|
in oklab,
|
|
@@ -200,7 +210,6 @@
|
|
|
200
210
|
.sonic-xy {
|
|
201
211
|
--_sonic-lit: Highlight;
|
|
202
212
|
--_sonic-unlit: GrayText;
|
|
203
|
-
--_sonic-glass: Canvas;
|
|
204
213
|
}
|
|
205
214
|
|
|
206
215
|
.sonic-xy-field {
|
|
@@ -211,9 +220,17 @@
|
|
|
211
220
|
--_sonic-xy-puck-fill: CanvasText;
|
|
212
221
|
--_sonic-xy-puck-lift: CanvasText;
|
|
213
222
|
--_sonic-xy-puck-glow: transparent;
|
|
214
|
-
--_sonic-xy-puck-ring: 0 0 transparent;
|
|
215
223
|
|
|
216
224
|
forced-color-adjust: none;
|
|
225
|
+
|
|
226
|
+
/* The axis's own outline is the focus here */
|
|
227
|
+
&::before {
|
|
228
|
+
outline-style: none;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
:state(dragging) > .sonic-xy > .sonic-xy-puck {
|
|
233
|
+
--_sonic-xy-puck-fill: Canvas;
|
|
217
234
|
}
|
|
218
235
|
|
|
219
236
|
.sonic-xy-axis {
|