@frontpanel/vue 0.0.0-stage → 0.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/dist/index.js ADDED
@@ -0,0 +1,1035 @@
1
+ import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, mergeModels as l, mergeProps as u, normalizeClass as d, normalizeStyle as f, openBlock as p, renderList as m, renderSlot as h, resolveDynamicComponent as g, shallowRef as _, toDisplayString as v, unref as y, useAttrs as b, useId as x, useModel as S, useTemplateRef as C, warn as w, watch as T, withCtx as E } from "vue";
2
+ import { Primitive as D, SliderRoot as O, SliderThumb as k, SliderTrack as A } from "reka-ui";
3
+ //#endregion
4
+ //#region src/FpButton.vue
5
+ var j = /* @__PURE__ */ c({
6
+ __name: "FpButton",
7
+ props: {
8
+ pressed: {
9
+ type: Boolean,
10
+ default: void 0
11
+ },
12
+ asChild: { type: Boolean },
13
+ as: { default: "button" }
14
+ },
15
+ setup(e) {
16
+ let t = e;
17
+ return (e, r) => (p(), n(y(D), {
18
+ as: t.as,
19
+ "as-child": t.asChild,
20
+ class: "fp-chrome-btn",
21
+ type: t.as === "button" && !t.asChild ? "button" : void 0,
22
+ "aria-pressed": t.pressed
23
+ }, {
24
+ default: E(() => [h(e.$slots, "default")]),
25
+ _: 3
26
+ }, 8, [
27
+ "as",
28
+ "as-child",
29
+ "type",
30
+ "aria-pressed"
31
+ ]));
32
+ }
33
+ }), M = /* @__PURE__ */ c({
34
+ __name: "FpCap",
35
+ props: {
36
+ color: { default: "white" },
37
+ pressed: {
38
+ type: Boolean,
39
+ default: void 0
40
+ },
41
+ asChild: { type: Boolean },
42
+ as: { default: "button" }
43
+ },
44
+ setup(e) {
45
+ let t = e, r = {
46
+ white: void 0,
47
+ blue: "fp-cap-blue",
48
+ amber: "fp-cap-amber",
49
+ graphite: "fp-cap-graphite",
50
+ berry: "fp-cap-berry"
51
+ };
52
+ return (e, i) => (p(), n(y(D), {
53
+ as: t.as,
54
+ "as-child": t.asChild,
55
+ class: d(["fp-cap", r[t.color]]),
56
+ type: t.as === "button" && !t.asChild ? "button" : void 0,
57
+ "aria-pressed": t.pressed
58
+ }, {
59
+ default: E(() => [h(e.$slots, "default")]),
60
+ _: 3
61
+ }, 8, [
62
+ "as",
63
+ "as-child",
64
+ "class",
65
+ "type",
66
+ "aria-pressed"
67
+ ]));
68
+ }
69
+ });
70
+ //#endregion
71
+ //#region src/fit.ts
72
+ function ee(e, t, n, r) {
73
+ if (t.width <= 0 || n.width <= 0) return null;
74
+ let i = t.width / n.width;
75
+ if (e === "contain") {
76
+ if (t.height <= 0 || n.height <= 0) return null;
77
+ i = Math.min(i, t.height / n.height);
78
+ }
79
+ return Math.min(i, r);
80
+ }
81
+ //#endregion
82
+ //#region src/FpDevice.vue?vue&type=script&setup=true&lang.ts
83
+ var te = { class: "fp-device-body" }, ne = /* @__PURE__ */ c({
84
+ __name: "FpDevice",
85
+ props: {
86
+ backdrop: {
87
+ type: Boolean,
88
+ default: !0
89
+ },
90
+ rim: {
91
+ type: Boolean,
92
+ default: !0
93
+ },
94
+ fit: { default: "none" },
95
+ width: {},
96
+ height: {},
97
+ maxScale: { default: 1 }
98
+ },
99
+ setup(e) {
100
+ let n = e, r = C("stage"), o = C("device"), s = _({
101
+ width: 0,
102
+ height: 0
103
+ }), c = _(0), l = t(() => n.fit === "none" ? !1 : n.width !== void 0 || (w(`FpDevice: fit="${n.fit}" needs a design width; the device is not scaled.`), !1)), u = t(() => n.height ?? c.value), m = t(() => !l.value || n.fit === "none" ? null : ee(n.fit, s.value, {
104
+ width: n.width,
105
+ height: u.value
106
+ }, n.maxScale));
107
+ function g() {
108
+ if (!r.value || !o.value) return;
109
+ let e = getComputedStyle(r.value), t = (e) => Number.parseFloat(e) || 0;
110
+ s.value = {
111
+ width: r.value.clientWidth - t(e.paddingLeft) - t(e.paddingRight),
112
+ height: r.value.clientHeight - t(e.paddingTop) - t(e.paddingBottom)
113
+ }, c.value = o.value.offsetHeight;
114
+ }
115
+ T([
116
+ l,
117
+ r,
118
+ o
119
+ ], ([e, t, n], r, i) => {
120
+ if (!e || !t || !n || typeof ResizeObserver > "u") return;
121
+ let a = new ResizeObserver(g);
122
+ a.observe(t), a.observe(n), i(() => a.disconnect());
123
+ }, {
124
+ flush: "post",
125
+ immediate: !0
126
+ });
127
+ let v = t(() => l.value ? { contain: "inline-size" } : void 0), y = t(() => {
128
+ if (!l.value) return { display: "contents" };
129
+ if (m.value !== null) return {
130
+ width: `${n.width * m.value}px`,
131
+ height: `${u.value * m.value}px`,
132
+ marginInline: "auto"
133
+ };
134
+ }), b = t(() => {
135
+ if (l.value) return {
136
+ boxSizing: "border-box",
137
+ width: `${n.width}px`,
138
+ height: n.height === void 0 ? void 0 : `${n.height}px`,
139
+ scale: m.value ?? void 0,
140
+ transformOrigin: "0 0",
141
+ visibility: m.value === null ? "hidden" : void 0
142
+ };
143
+ });
144
+ return (e, t) => (p(), i("div", {
145
+ ref_key: "stage",
146
+ ref: r,
147
+ class: d({ "fp-device-backdrop": n.backdrop }),
148
+ style: f(v.value)
149
+ }, [a("div", { style: f(y.value) }, [n.rim ? (p(), i("div", {
150
+ key: 0,
151
+ ref_key: "device",
152
+ ref: o,
153
+ class: "fp-device-rim",
154
+ style: f(b.value)
155
+ }, [a("div", te, [h(e.$slots, "default")])], 4)) : (p(), i("div", {
156
+ key: 1,
157
+ ref_key: "device",
158
+ ref: o,
159
+ class: "fp-device-body",
160
+ style: f(b.value)
161
+ }, [h(e.$slots, "default")], 4))], 4)], 6));
162
+ }
163
+ }), re = /* @__PURE__ */ c({
164
+ __name: "FpGelButton",
165
+ props: {
166
+ asChild: { type: Boolean },
167
+ as: { default: "button" }
168
+ },
169
+ setup(e) {
170
+ let t = e;
171
+ return (e, r) => (p(), n(y(D), {
172
+ as: t.as,
173
+ "as-child": t.asChild,
174
+ class: "fp-gel",
175
+ type: t.as === "button" && !t.asChild ? "button" : void 0
176
+ }, {
177
+ default: E(() => [h(e.$slots, "default")]),
178
+ _: 3
179
+ }, 8, [
180
+ "as",
181
+ "as-child",
182
+ "type"
183
+ ]));
184
+ }
185
+ }), N = /* @__PURE__ */ c({
186
+ __name: "FpHousing",
187
+ props: {
188
+ asChild: { type: Boolean },
189
+ as: { default: "span" }
190
+ },
191
+ setup(e) {
192
+ let t = e;
193
+ return (e, r) => (p(), n(y(D), {
194
+ as: t.as,
195
+ "as-child": t.asChild,
196
+ class: "fp-housing"
197
+ }, {
198
+ default: E(() => [h(e.$slots, "default")]),
199
+ _: 3
200
+ }, 8, ["as", "as-child"]));
201
+ }
202
+ }), P = [
203
+ "................",
204
+ "................",
205
+ ".....#..........",
206
+ "....##..........",
207
+ "...##########...",
208
+ "..###########...",
209
+ "...##.......##..",
210
+ "....#........##.",
211
+ ".............##.",
212
+ ".............##.",
213
+ "............##..",
214
+ "...#########....",
215
+ "...########.....",
216
+ "................",
217
+ "................",
218
+ "................"
219
+ ], F = [
220
+ "................",
221
+ "................",
222
+ ".........##.....",
223
+ "........###.....",
224
+ ".......###......",
225
+ "......###.......",
226
+ ".....###........",
227
+ "....###.........",
228
+ "....###.........",
229
+ ".....###........",
230
+ "......###.......",
231
+ ".......###......",
232
+ "........###.....",
233
+ ".........##.....",
234
+ "................",
235
+ "................"
236
+ ], I = (e) => e.map((e) => [...e].reverse().join("")), L = {
237
+ add: [
238
+ "................",
239
+ "................",
240
+ ".......##.......",
241
+ ".......##.......",
242
+ ".......##.......",
243
+ ".......##.......",
244
+ ".......##.......",
245
+ "..############..",
246
+ "..############..",
247
+ ".......##.......",
248
+ ".......##.......",
249
+ ".......##.......",
250
+ ".......##.......",
251
+ ".......##.......",
252
+ "................",
253
+ "................"
254
+ ],
255
+ close: [
256
+ "................",
257
+ "................",
258
+ "..##........##..",
259
+ "..###......###..",
260
+ "...###....###...",
261
+ "....###..###....",
262
+ ".....######.....",
263
+ "......####......",
264
+ "......####......",
265
+ ".....######.....",
266
+ "....###..###....",
267
+ "...###....###...",
268
+ "..###......###..",
269
+ "..##........##..",
270
+ "................",
271
+ "................"
272
+ ],
273
+ left: F,
274
+ right: I(F),
275
+ go: [
276
+ "................",
277
+ "................",
278
+ "................",
279
+ ".........##.....",
280
+ "..........##....",
281
+ "...........##...",
282
+ "............##..",
283
+ "..#############.",
284
+ "..#############.",
285
+ "............##..",
286
+ "...........##...",
287
+ "..........##....",
288
+ ".........##.....",
289
+ "................",
290
+ "................",
291
+ "................"
292
+ ],
293
+ undo: P,
294
+ redo: I(P),
295
+ home: [
296
+ "................",
297
+ ".......##.......",
298
+ "......####......",
299
+ ".....##..##.....",
300
+ "....##....##....",
301
+ "...##......##...",
302
+ "..##........##..",
303
+ ".##..........##.",
304
+ "...#........#...",
305
+ "...#........#...",
306
+ "...#..###...#...",
307
+ "...#..#.#...#...",
308
+ "...#..#.#...#...",
309
+ "...#..#.#...#...",
310
+ "...##########...",
311
+ "................"
312
+ ],
313
+ saved: [
314
+ "................",
315
+ "................",
316
+ "...##########...",
317
+ "...#........#...",
318
+ "...#........#...",
319
+ "...#........#...",
320
+ "...#........#...",
321
+ "...#........#...",
322
+ "...#........#...",
323
+ "...#........#...",
324
+ "...#...##...#...",
325
+ "...#..#..#..#...",
326
+ "...#.#....#.#...",
327
+ "...##......##...",
328
+ "................",
329
+ "................"
330
+ ],
331
+ settings: [
332
+ "................",
333
+ "................",
334
+ "....##..........",
335
+ ".##############.",
336
+ "....##..........",
337
+ "................",
338
+ "..........##....",
339
+ ".##############.",
340
+ "..........##....",
341
+ "................",
342
+ "......##........",
343
+ ".##############.",
344
+ "......##........",
345
+ "................",
346
+ "................",
347
+ "................"
348
+ ],
349
+ help: [
350
+ "................",
351
+ "................",
352
+ ".....######.....",
353
+ "....##....##....",
354
+ "....##....##....",
355
+ "..........##....",
356
+ ".........##.....",
357
+ "........##......",
358
+ ".......##.......",
359
+ ".......##.......",
360
+ "................",
361
+ ".......##.......",
362
+ ".......##.......",
363
+ "................",
364
+ "................",
365
+ "................"
366
+ ],
367
+ save: [
368
+ "................",
369
+ "................",
370
+ "..############..",
371
+ "..#..######..#..",
372
+ "..#..##..##..#..",
373
+ "..#..######..#..",
374
+ "..#..........#..",
375
+ "..#..........#..",
376
+ "..#.########.#..",
377
+ "..#.#......#.#..",
378
+ "..#.#......#.#..",
379
+ "..#.#......#.#..",
380
+ "..#.#......#.#..",
381
+ "..############..",
382
+ "................",
383
+ "................"
384
+ ],
385
+ copy: [
386
+ "................",
387
+ "................",
388
+ "..########......",
389
+ "..#......#......",
390
+ "..#..########...",
391
+ "..#..#......#...",
392
+ "..#..#......#...",
393
+ "..#..#......#...",
394
+ "..#..#......#...",
395
+ "..####......#...",
396
+ ".....#......#...",
397
+ ".....#......#...",
398
+ ".....#......#...",
399
+ ".....########...",
400
+ "................",
401
+ "................"
402
+ ],
403
+ trash: [
404
+ "................",
405
+ "................",
406
+ "......####......",
407
+ "..############..",
408
+ "..############..",
409
+ "................",
410
+ "...##########...",
411
+ "...#..#..#..#...",
412
+ "...#..#..#..#...",
413
+ "...#..#..#..#...",
414
+ "...#..#..#..#...",
415
+ "...#..#..#..#...",
416
+ "...#........#...",
417
+ "...##########...",
418
+ "................",
419
+ "................"
420
+ ],
421
+ grip: [
422
+ "................",
423
+ "................",
424
+ "................",
425
+ ".....##..##.....",
426
+ ".....##..##.....",
427
+ "................",
428
+ "................",
429
+ ".....##..##.....",
430
+ ".....##..##.....",
431
+ "................",
432
+ "................",
433
+ ".....##..##.....",
434
+ ".....##..##.....",
435
+ "................",
436
+ "................",
437
+ "................"
438
+ ],
439
+ quick: [
440
+ "................",
441
+ "..........###...",
442
+ ".........###....",
443
+ "........###.....",
444
+ ".......###......",
445
+ "......###.......",
446
+ ".....########...",
447
+ "..........###...",
448
+ ".........###....",
449
+ "........###.....",
450
+ ".......###......",
451
+ "......##........",
452
+ ".....#..........",
453
+ "................",
454
+ "................",
455
+ "................"
456
+ ],
457
+ grid: [
458
+ "................",
459
+ "................",
460
+ "..#####..#####..",
461
+ "..#...#..#...#..",
462
+ "..#...#..#...#..",
463
+ "..#...#..#...#..",
464
+ "..#####..#####..",
465
+ "................",
466
+ "................",
467
+ "..#####..#####..",
468
+ "..#...#..#...#..",
469
+ "..#...#..#...#..",
470
+ "..#...#..#...#..",
471
+ "..#####..#####..",
472
+ "................",
473
+ "................"
474
+ ],
475
+ menu: [
476
+ "................",
477
+ "................",
478
+ "................",
479
+ "................",
480
+ "................",
481
+ "................",
482
+ "................",
483
+ "..##...##...##..",
484
+ "..##...##...##..",
485
+ "................",
486
+ "................",
487
+ "................",
488
+ "................",
489
+ "................",
490
+ "................",
491
+ "................"
492
+ ]
493
+ };
494
+ function ie(e) {
495
+ let t = "";
496
+ return e.forEach((e, n) => {
497
+ let r = 0;
498
+ for (; r < e.length;) {
499
+ if (e[r] !== "#") {
500
+ r++;
501
+ continue;
502
+ }
503
+ let i = r;
504
+ for (; e[r] === "#";) r++;
505
+ let a = r - i;
506
+ t += `M${i} ${n}h${a}v1h-${a}z`;
507
+ }
508
+ }), t;
509
+ }
510
+ var R = Object.keys(L), z = Object.fromEntries(R.map((e) => [e, ie(L[e])])), B = [
511
+ "role",
512
+ "aria-label",
513
+ "aria-hidden"
514
+ ], V = ["d"], H = /* @__PURE__ */ c({
515
+ __name: "FpIcon",
516
+ props: {
517
+ name: {},
518
+ label: {}
519
+ },
520
+ setup(e) {
521
+ let n = e, r = t(() => z[n.name]);
522
+ return (e, t) => (p(), i("svg", {
523
+ viewBox: "0 0 16 16",
524
+ class: "fp-icon",
525
+ role: n.label ? "img" : void 0,
526
+ "aria-label": n.label || void 0,
527
+ "aria-hidden": n.label ? void 0 : "true"
528
+ }, [a("path", { d: r.value }, null, 8, V)], 8, B));
529
+ }
530
+ }), U = [
531
+ "tabindex",
532
+ "aria-valuemin",
533
+ "aria-valuemax",
534
+ "aria-valuenow",
535
+ "aria-valuetext",
536
+ "aria-labelledby",
537
+ "aria-disabled"
538
+ ], W = ["id"], G = 200, K = .1, q = 270, J = /* @__PURE__ */ c({
539
+ inheritAttrs: !1,
540
+ __name: "FpKnob",
541
+ props: /*@__PURE__*/ l({
542
+ min: { default: 0 },
543
+ max: { default: 100 },
544
+ step: { default: 1 },
545
+ label: {},
546
+ valueText: {},
547
+ disabled: { type: Boolean }
548
+ }, {
549
+ modelValue: { default: 0 },
550
+ modelModifiers: {}
551
+ }),
552
+ emits: /*@__PURE__*/ l(["valueCommit"], ["update:modelValue"]),
553
+ setup(e, { emit: n }) {
554
+ let o = e, s = n, c = S(e, "modelValue"), l = b(), d = t(() => ({
555
+ class: l.class,
556
+ style: l.style
557
+ })), m = t(() => {
558
+ let { class: e, style: t, ...n } = l;
559
+ return n;
560
+ }), h = x(), g = t(() => (String(o.step).split(".")[1] ?? "").length);
561
+ function _(e) {
562
+ let t = Math.round((e - o.min) / o.step) * o.step + o.min, n = Math.min(o.max, Math.max(o.min, t));
563
+ return Number(n.toFixed(g.value));
564
+ }
565
+ let C = t(() => _(c.value)), w = t(() => {
566
+ let e = o.max - o.min, t = e > 0 ? (C.value - o.min) / e : 0;
567
+ return Math.round(t * q - q / 2);
568
+ });
569
+ function T(e) {
570
+ let t = _(e);
571
+ return t !== C.value && (c.value = t, !0);
572
+ }
573
+ function E(e) {
574
+ if (o.disabled) return;
575
+ let t = o.step * 10, n = {
576
+ ArrowUp: C.value + o.step,
577
+ ArrowRight: C.value + o.step,
578
+ ArrowDown: C.value - o.step,
579
+ ArrowLeft: C.value - o.step,
580
+ PageUp: C.value + t,
581
+ PageDown: C.value - t,
582
+ Home: o.min,
583
+ End: o.max
584
+ }[e.key];
585
+ n !== void 0 && (e.preventDefault(), T(n) && s("valueCommit", _(n)));
586
+ }
587
+ let D;
588
+ function O(e) {
589
+ if (o.disabled || e.button !== 0) return;
590
+ let t = e.currentTarget;
591
+ t.setPointerCapture?.(e.pointerId), t.focus({
592
+ preventScroll: !0,
593
+ focusVisible: !1
594
+ }), D = {
595
+ pointerId: e.pointerId,
596
+ y: e.clientY,
597
+ raw: C.value,
598
+ start: C.value
599
+ };
600
+ }
601
+ function k(e) {
602
+ if (!D || e.pointerId !== D.pointerId) return;
603
+ let t = (o.max - o.min) / G * (e.shiftKey ? K : 1);
604
+ D.raw = Math.min(o.max, Math.max(o.min, D.raw + (D.y - e.clientY) * t)), D.y = e.clientY, T(D.raw);
605
+ }
606
+ function A(e) {
607
+ if (!D || e.pointerId !== D.pointerId) return;
608
+ let t = _(D.raw), n = t !== D.start;
609
+ D = void 0, n && s("valueCommit", t);
610
+ }
611
+ return (e, t) => (p(), i("div", u({ class: "fp-unit" }, d.value), [a("div", u(m.value, {
612
+ class: "fp-knob",
613
+ role: "slider",
614
+ tabindex: o.disabled ? void 0 : 0,
615
+ "aria-valuemin": o.min,
616
+ "aria-valuemax": o.max,
617
+ "aria-valuenow": C.value,
618
+ "aria-valuetext": o.valueText?.(C.value),
619
+ "aria-labelledby": o.label ? y(h) : void 0,
620
+ "aria-disabled": o.disabled || void 0,
621
+ onKeydown: E,
622
+ onPointerdown: O,
623
+ onPointermove: k,
624
+ onPointerup: A,
625
+ onPointercancel: A
626
+ }), [a("span", {
627
+ class: "fp-knob-mark",
628
+ style: f({ rotate: `${w.value}deg` })
629
+ }, null, 4)], 16, U), o.label ? (p(), i("span", {
630
+ key: 0,
631
+ id: y(h),
632
+ class: "fp-silk"
633
+ }, v(o.label), 9, W)) : r("", !0)], 16));
634
+ }
635
+ }), Y = /* @__PURE__ */ c({
636
+ __name: "FpLcd",
637
+ props: {
638
+ asChild: { type: Boolean },
639
+ as: { default: "div" }
640
+ },
641
+ setup(e) {
642
+ let t = e;
643
+ return (e, r) => (p(), n(y(D), {
644
+ as: t.as,
645
+ "as-child": t.asChild,
646
+ class: "fp-lcd"
647
+ }, {
648
+ default: E(() => [h(e.$slots, "default")]),
649
+ _: 3
650
+ }, 8, ["as", "as-child"]));
651
+ }
652
+ }), ae = {
653
+ key: 0,
654
+ class: "fp-lcd-ghost",
655
+ "aria-hidden": "true"
656
+ }, oe = { key: 2 }, se = /* @__PURE__ */ c({
657
+ __name: "FpLcdLine",
658
+ props: {
659
+ text: {},
660
+ ghost: { type: Boolean },
661
+ cells: {},
662
+ redraw: { type: Boolean },
663
+ asChild: { type: Boolean },
664
+ as: { default: "p" }
665
+ },
666
+ setup(e) {
667
+ let a = e, o = t(() => "8".repeat(a.cells ?? a.text.length));
668
+ return (e, t) => (p(), n(y(D), {
669
+ as: a.as,
670
+ "as-child": a.asChild,
671
+ class: "fp-lcd-line"
672
+ }, {
673
+ default: E(() => [a.ghost ? (p(), i("span", ae, v(o.value), 1)) : r("", !0), a.redraw ? (p(), i("span", {
674
+ key: a.text,
675
+ class: "fp-lcd-redraw"
676
+ }, v(a.text), 1)) : (p(), i("span", oe, v(a.text), 1))]),
677
+ _: 1
678
+ }, 8, ["as", "as-child"]));
679
+ }
680
+ }), X = {
681
+ flat: "fp-lens-flat",
682
+ diffused: "fp-lens-diffused",
683
+ clear: "fp-lens-clear"
684
+ }, ce = [
685
+ "role",
686
+ "aria-label",
687
+ "aria-hidden"
688
+ ], le = /* @__PURE__ */ c({
689
+ __name: "FpLed",
690
+ props: {
691
+ color: { default: "green" },
692
+ lit: { type: Boolean },
693
+ blink: { type: Boolean },
694
+ lens: {},
695
+ label: {}
696
+ },
697
+ setup(e) {
698
+ let t = e, n = {
699
+ green: "fp-led-green",
700
+ amber: "fp-led-amber",
701
+ red: "fp-led-red"
702
+ };
703
+ return (e, r) => (p(), i("span", {
704
+ class: d(["fp-led", [
705
+ n[t.color],
706
+ t.lens && y(X)[t.lens],
707
+ {
708
+ "fp-led-lit": t.lit,
709
+ "fp-blink-twice": t.lit && t.blink
710
+ }
711
+ ]]),
712
+ role: t.label ? "img" : void 0,
713
+ "aria-label": t.label || void 0,
714
+ "aria-hidden": t.label ? void 0 : "true"
715
+ }, null, 10, ce));
716
+ }
717
+ }), ue = [
718
+ "data-orientation",
719
+ "aria-valuemin",
720
+ "aria-valuemax",
721
+ "aria-valuenow",
722
+ "aria-valuetext",
723
+ "aria-labelledby"
724
+ ], de = ["id"], fe = /* @__PURE__ */ c({
725
+ inheritAttrs: !1,
726
+ __name: "FpMeter",
727
+ props: {
728
+ value: { default: 0 },
729
+ min: { default: 0 },
730
+ max: { default: 100 },
731
+ segments: { default: 12 },
732
+ amberAt: {},
733
+ redAt: {},
734
+ orientation: { default: "vertical" },
735
+ lens: {},
736
+ label: {},
737
+ valueText: {}
738
+ },
739
+ setup(e) {
740
+ let n = e, o = b(), s = t(() => ({
741
+ class: o.class,
742
+ style: o.style
743
+ })), c = t(() => {
744
+ let { class: e, style: t, ...n } = o;
745
+ return n;
746
+ }), l = x(), d = t(() => Math.min(n.max, Math.max(n.min, n.value)));
747
+ function f(e) {
748
+ let t = n.max - n.min;
749
+ return t > 0 ? Math.min(1, Math.max(0, (e - n.min) / t)) : 0;
750
+ }
751
+ function m(e, t) {
752
+ return t(f(e) * n.segments + 1e-9) / n.segments;
753
+ }
754
+ let h = t(() => {
755
+ let e = n.max - n.min;
756
+ return {
757
+ "--fp-meter-level": String(m(d.value, Math.floor)),
758
+ "--fp-meter-segments": String(n.segments),
759
+ "--fp-meter-amber": String(m(n.amberAt ?? n.min + e * .7, Math.round)),
760
+ "--fp-meter-red": String(m(n.redAt ?? n.min + e * .9, Math.round))
761
+ };
762
+ });
763
+ return (e, t) => (p(), i("div", u({ class: "fp-unit" }, s.value), [a("div", u(c.value, {
764
+ class: ["fp-meter", n.lens && y(X)[n.lens]],
765
+ role: "meter",
766
+ "data-orientation": n.orientation,
767
+ "aria-valuemin": n.min,
768
+ "aria-valuemax": n.max,
769
+ "aria-valuenow": d.value,
770
+ "aria-valuetext": n.valueText?.(d.value),
771
+ "aria-labelledby": n.label ? y(l) : void 0,
772
+ style: h.value
773
+ }), null, 16, ue), n.label ? (p(), i("span", {
774
+ key: 0,
775
+ id: y(l),
776
+ class: "fp-silk"
777
+ }, v(n.label), 9, de)) : r("", !0)], 16));
778
+ }
779
+ }), Z = {
780
+ 0: "abcdef",
781
+ 1: "bc",
782
+ 2: "abdeg",
783
+ 3: "abcdg",
784
+ 4: "bcfg",
785
+ 5: "acdfg",
786
+ 6: "acdefg",
787
+ 7: "abc",
788
+ 8: "abcdefg",
789
+ 9: "abcdfg",
790
+ "-": "g",
791
+ _: "d",
792
+ "°": "abfg",
793
+ " ": "",
794
+ A: "abcefg",
795
+ B: "cdefg",
796
+ C: "adef",
797
+ c: "deg",
798
+ D: "bcdeg",
799
+ E: "adefg",
800
+ F: "aefg",
801
+ G: "acdef",
802
+ H: "bcefg",
803
+ h: "cefg",
804
+ I: "ef",
805
+ J: "bcde",
806
+ L: "def",
807
+ N: "ceg",
808
+ O: "abcdef",
809
+ o: "cdeg",
810
+ P: "abefg",
811
+ R: "eg",
812
+ S: "acdfg",
813
+ T: "defg",
814
+ U: "bcdef",
815
+ u: "cde",
816
+ Y: "bcdfg"
817
+ };
818
+ function Q(e) {
819
+ return Z[e] ?? Z[e.toUpperCase()] ?? "";
820
+ }
821
+ //#endregion
822
+ //#region src/FpReadout.vue?vue&type=script&setup=true&lang.ts
823
+ var pe = { class: "fp-readout-text" }, me = ["data-colon"], he = { class: "fp-readout-lit" }, ge = ["data-segment"], _e = {
824
+ key: 0,
825
+ "data-segment": "dp"
826
+ }, ve = /* @__PURE__ */ c({
827
+ __name: "FpReadout",
828
+ props: {
829
+ value: {},
830
+ digits: {},
831
+ color: { default: "green" },
832
+ lens: {},
833
+ valueText: {}
834
+ },
835
+ setup(n) {
836
+ let o = n, s = {
837
+ green: "fp-led-green",
838
+ amber: "fp-led-amber",
839
+ red: "fp-led-red"
840
+ }, c = t(() => String(o.value)), l = t(() => {
841
+ let e = [];
842
+ for (let t of c.value) {
843
+ let n = e.at(-1);
844
+ t === ":" ? e.push({ colon: !0 }) : t === "." && n && !n.colon && !n.dot ? n.dot = !0 : t === "." ? e.push({
845
+ colon: !1,
846
+ lit: "",
847
+ dot: !0
848
+ }) : e.push({
849
+ colon: !1,
850
+ lit: Q(t),
851
+ dot: !1
852
+ });
853
+ }
854
+ let t = e.filter((e) => !e.colon).length;
855
+ return [...Array.from({ length: Math.max(0, (o.digits ?? 0) - t) }, () => ({
856
+ colon: !1,
857
+ lit: "",
858
+ dot: !1
859
+ })), ...e];
860
+ });
861
+ return (t, n) => (p(), i("span", { class: d(["fp-readout", [s[o.color], o.lens && y(X)[o.lens]]]) }, [a("span", pe, v(o.valueText ? o.valueText(c.value) : c.value), 1), (p(!0), i(e, null, m(l.value, (t, o) => (p(), i("span", {
862
+ key: o,
863
+ class: "fp-readout-cell",
864
+ "data-colon": t.colon ? "" : void 0,
865
+ "aria-hidden": "true"
866
+ }, [a("span", he, [t.colon ? (p(), i(e, { key: 0 }, [n[0] ||= a("span", { "data-segment": "colon-upper" }, null, -1), n[1] ||= a("span", { "data-segment": "colon-lower" }, null, -1)], 64)) : (p(), i(e, { key: 1 }, [(p(!0), i(e, null, m(t.lit, (e) => (p(), i("span", {
867
+ key: e,
868
+ "data-segment": e
869
+ }, null, 8, ge))), 128)), t.dot ? (p(), i("span", _e)) : r("", !0)], 64))])], 8, me))), 128))], 2));
870
+ }
871
+ }), $ = {
872
+ class: "fp-screw",
873
+ "aria-hidden": "true"
874
+ }, ye = /* @__PURE__ */ c({
875
+ __name: "FpScrew",
876
+ setup(e) {
877
+ return (e, t) => (p(), i("span", $));
878
+ }
879
+ }), be = /* @__PURE__ */ c({
880
+ __name: "FpSilk",
881
+ props: {
882
+ asChild: { type: Boolean },
883
+ as: { default: "span" }
884
+ },
885
+ setup(e) {
886
+ let t = e;
887
+ return (e, r) => (p(), n(y(D), {
888
+ as: t.as,
889
+ "as-child": t.asChild,
890
+ class: "fp-silk"
891
+ }, {
892
+ default: E(() => [h(e.$slots, "default")]),
893
+ _: 3
894
+ }, 8, ["as", "as-child"]));
895
+ }
896
+ }), xe = ["id"], Se = /* @__PURE__ */ c({
897
+ inheritAttrs: !1,
898
+ __name: "FpSlider",
899
+ props: /*@__PURE__*/ l({
900
+ min: { default: 0 },
901
+ max: { default: 100 },
902
+ step: { default: 1 },
903
+ orientation: { default: "vertical" },
904
+ label: {},
905
+ valueText: {},
906
+ disabled: { type: Boolean }
907
+ }, {
908
+ modelValue: { default: 0 },
909
+ modelModifiers: {}
910
+ }),
911
+ emits: /*@__PURE__*/ l(["valueCommit"], ["update:modelValue"]),
912
+ setup(e, { emit: n }) {
913
+ let a = e, o = n, c = S(e, "modelValue"), l = b(), d = t(() => ({
914
+ class: l.class,
915
+ style: l.style
916
+ })), f = t(() => {
917
+ let { class: e, style: t, ...n } = l;
918
+ return n;
919
+ }), m = x(), h = t(() => [c.value]);
920
+ function g(e) {
921
+ e?.[0] !== void 0 && (c.value = e[0]);
922
+ }
923
+ let _ = C("unit");
924
+ function w(e) {
925
+ a.disabled || e.button !== 0 || _.value?.querySelector("[role=\"slider\"]")?.focus({
926
+ preventScroll: !0,
927
+ focusVisible: !1
928
+ });
929
+ }
930
+ function T(e) {
931
+ e[0] !== void 0 && o("valueCommit", e[0]);
932
+ }
933
+ return (e, t) => (p(), i("div", u({
934
+ ref_key: "unit",
935
+ ref: _,
936
+ class: "fp-unit"
937
+ }, d.value, { onPointerdownCapture: w }), [s(y(O), {
938
+ class: "fp-fader",
939
+ "model-value": h.value,
940
+ min: a.min,
941
+ max: a.max,
942
+ step: a.step,
943
+ orientation: a.orientation,
944
+ disabled: a.disabled,
945
+ "onUpdate:modelValue": g,
946
+ onValueCommit: T
947
+ }, {
948
+ default: E(() => [s(y(A), { class: "fp-fader-slot" }), s(y(k), u(f.value, {
949
+ class: "fp-fader-cap",
950
+ "aria-valuetext": a.valueText?.(c.value),
951
+ "aria-labelledby": a.label ? y(m) : void 0,
952
+ "aria-disabled": a.disabled || void 0
953
+ }), null, 16, [
954
+ "aria-valuetext",
955
+ "aria-labelledby",
956
+ "aria-disabled"
957
+ ])]),
958
+ _: 1
959
+ }, 8, [
960
+ "model-value",
961
+ "min",
962
+ "max",
963
+ "step",
964
+ "orientation",
965
+ "disabled"
966
+ ]), a.label ? (p(), i("span", {
967
+ key: 0,
968
+ id: y(m),
969
+ class: "fp-silk"
970
+ }, v(a.label), 9, xe)) : r("", !0)], 16));
971
+ }
972
+ }), Ce = /* @__PURE__ */ c({
973
+ __name: "FpWell",
974
+ props: {
975
+ asChild: { type: Boolean },
976
+ as: { default: "div" }
977
+ },
978
+ setup(e) {
979
+ let t = e;
980
+ return (e, r) => (p(), n(y(D), {
981
+ as: t.as,
982
+ "as-child": t.asChild,
983
+ class: "fp-well"
984
+ }, {
985
+ default: E(() => [h(e.$slots, "default")]),
986
+ _: 3
987
+ }, 8, ["as", "as-child"]));
988
+ }
989
+ }), we = { class: "fp-module-title" }, Te = /* @__PURE__ */ c({
990
+ __name: "FpWindow",
991
+ props: {
992
+ as: { default: "section" },
993
+ title: {},
994
+ level: { default: 2 },
995
+ closable: { type: Boolean },
996
+ closeLabel: {},
997
+ sheet: { type: Boolean },
998
+ flush: { type: Boolean }
999
+ },
1000
+ emits: ["close"],
1001
+ setup(e, { emit: t }) {
1002
+ let i = e, c = t, l = x();
1003
+ return (e, t) => (p(), n(y(D), {
1004
+ as: i.as,
1005
+ class: d(["fp-window", [i.sheet ? "fp-sheet-panel" : "fp-module"]]),
1006
+ "aria-labelledby": y(l)
1007
+ }, {
1008
+ default: E(() => [a("div", we, [
1009
+ (p(), n(g(`h${i.level}`), {
1010
+ id: y(l),
1011
+ class: "fp-silk fp-window-title"
1012
+ }, {
1013
+ default: E(() => [o(v(i.title), 1)]),
1014
+ _: 1
1015
+ }, 8, ["id"])),
1016
+ h(e.$slots, "actions"),
1017
+ i.closable ? (p(), n(j, {
1018
+ key: 0,
1019
+ "aria-label": i.closeLabel ?? `Close ${i.title}`,
1020
+ onClick: t[0] ||= (e) => c("close")
1021
+ }, {
1022
+ default: E(() => [s(H, { name: "close" })]),
1023
+ _: 1
1024
+ }, 8, ["aria-label"])) : r("", !0)
1025
+ ]), a("div", { class: d(i.flush ? void 0 : "fp-window-body") }, [h(e.$slots, "default")], 2)]),
1026
+ _: 3
1027
+ }, 8, [
1028
+ "as",
1029
+ "class",
1030
+ "aria-labelledby"
1031
+ ]));
1032
+ }
1033
+ });
1034
+ //#endregion
1035
+ export { j as FpButton, M as FpCap, ne as FpDevice, re as FpGelButton, N as FpHousing, H as FpIcon, J as FpKnob, Y as FpLcd, se as FpLcdLine, le as FpLed, fe as FpMeter, ve as FpReadout, ye as FpScrew, be as FpSilk, Se as FpSlider, Ce as FpWell, Te as FpWindow, R as fpIconNames, Q as fpReadoutGlyph };