@nexxtmove/ui 1.0.13 → 1.0.15
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/components/ToggleGroup/ToggleGroup.vue.d.ts +21 -0
- package/dist/components/Tooltip/Tooltip.vue.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +155 -35
- package/dist/nuxt.js +1 -0
- package/package.json +1 -1
- package/src/components/ToggleGroup/ToggleGroup.vue +128 -0
- package/src/components/Tooltip/Tooltip.vue +7 -1
- package/src/components.json +1 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IconName } from '@awesome.me/kit-37b149f3ef/icons';
|
|
2
|
+
export interface NexxtToggleGroupOption {
|
|
3
|
+
value: string;
|
|
4
|
+
icon?: IconName;
|
|
5
|
+
label?: string;
|
|
6
|
+
tooltip?: string;
|
|
7
|
+
}
|
|
8
|
+
interface NexxtToggleGroupProps {
|
|
9
|
+
options: NexxtToggleGroupOption[];
|
|
10
|
+
label?: string;
|
|
11
|
+
}
|
|
12
|
+
type __VLS_Props = NexxtToggleGroupProps;
|
|
13
|
+
type __VLS_PublicProps = __VLS_Props & {
|
|
14
|
+
modelValue: string;
|
|
15
|
+
};
|
|
16
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
17
|
+
"update:modelValue": (value: string) => any;
|
|
18
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
19
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
20
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
export default _default;
|
package/dist/index.d.ts
CHANGED
|
@@ -46,5 +46,6 @@ export { default as NexxtTimelineEvent } from './components/TimelineEvent/Timeli
|
|
|
46
46
|
export { default as NexxtTimelinePhaseblock } from './components/TimelinePhaseblock/TimelinePhaseblock.vue';
|
|
47
47
|
export { default as NexxtToast } from './components/Toast/Toast.vue';
|
|
48
48
|
export { default as NexxtToaster } from './components/Toaster/Toaster.vue';
|
|
49
|
+
export { default as NexxtToggleGroup } from './components/ToggleGroup/ToggleGroup.vue';
|
|
49
50
|
export { default as NexxtTooltip } from './components/Tooltip/Tooltip.vue';
|
|
50
51
|
export { default as NexxtVideoPlayer } from './components/VideoPlayer/VideoPlayer.vue';
|
package/dist/index.js
CHANGED
|
@@ -7921,13 +7921,18 @@ var Bl = { render: zl }, Vl = { class: "flex items-center justify-end self-stret
|
|
|
7921
7921
|
disableHoverableContent: {
|
|
7922
7922
|
type: Boolean,
|
|
7923
7923
|
default: !1
|
|
7924
|
+
},
|
|
7925
|
+
disableClosingTrigger: {
|
|
7926
|
+
type: Boolean,
|
|
7927
|
+
default: !1
|
|
7924
7928
|
}
|
|
7925
7929
|
},
|
|
7926
7930
|
setup(e) {
|
|
7927
7931
|
return (t, n) => (A(), c(z(Ne), null, {
|
|
7928
7932
|
default: H(() => [h(z(Pe), {
|
|
7929
7933
|
"delay-duration": e.delay,
|
|
7930
|
-
"disable-hoverable-content": e.disableHoverableContent
|
|
7934
|
+
"disable-hoverable-content": e.disableHoverableContent,
|
|
7935
|
+
"disable-closing-trigger": e.disableClosingTrigger
|
|
7931
7936
|
}, {
|
|
7932
7937
|
default: H(() => [h(z(Fe), { "as-child": "" }, {
|
|
7933
7938
|
default: H(() => [P(t.$slots, "default")]),
|
|
@@ -7949,7 +7954,11 @@ var Bl = { render: zl }, Vl = { class: "flex items-center justify-end self-stret
|
|
|
7949
7954
|
_: 3
|
|
7950
7955
|
})]),
|
|
7951
7956
|
_: 3
|
|
7952
|
-
}, 8, [
|
|
7957
|
+
}, 8, [
|
|
7958
|
+
"delay-duration",
|
|
7959
|
+
"disable-hoverable-content",
|
|
7960
|
+
"disable-closing-trigger"
|
|
7961
|
+
])]),
|
|
7953
7962
|
_: 3
|
|
7954
7963
|
}));
|
|
7955
7964
|
}
|
|
@@ -8324,14 +8333,36 @@ function _d(e) {
|
|
|
8324
8333
|
let t = gd();
|
|
8325
8334
|
return s(() => (t.value, !!e()));
|
|
8326
8335
|
}
|
|
8327
|
-
|
|
8336
|
+
function vd(e, t, n = {}) {
|
|
8337
|
+
let { window: r = pd, ...i } = n, a, o = /* @__PURE__ */ _d(() => r && "ResizeObserver" in r), c = () => {
|
|
8338
|
+
a &&= (a.disconnect(), void 0);
|
|
8339
|
+
}, l = V(s(() => {
|
|
8340
|
+
let t = R(e);
|
|
8341
|
+
return Array.isArray(t) ? t.map((e) => hd(e)) : [hd(t)];
|
|
8342
|
+
}), (e) => {
|
|
8343
|
+
if (c(), o.value && r) {
|
|
8344
|
+
a = new ResizeObserver(t);
|
|
8345
|
+
for (let t of e) t && a.observe(t, i);
|
|
8346
|
+
}
|
|
8347
|
+
}, {
|
|
8348
|
+
immediate: !0,
|
|
8349
|
+
flush: "post"
|
|
8350
|
+
}), u = () => {
|
|
8351
|
+
c(), l();
|
|
8352
|
+
};
|
|
8353
|
+
return $u(u), {
|
|
8354
|
+
isSupported: o,
|
|
8355
|
+
stop: u
|
|
8356
|
+
};
|
|
8357
|
+
}
|
|
8358
|
+
var yd = [
|
|
8328
8359
|
"fullscreenchange",
|
|
8329
8360
|
"webkitfullscreenchange",
|
|
8330
8361
|
"webkitendfullscreen",
|
|
8331
8362
|
"mozfullscreenchange",
|
|
8332
8363
|
"MSFullscreenChange"
|
|
8333
8364
|
];
|
|
8334
|
-
function
|
|
8365
|
+
function bd(e, t = {}) {
|
|
8335
8366
|
let { document: n = md, autoExit: r = !1 } = t, i = s(() => hd(e) ?? n?.documentElement), a = I(!1), o = s(() => [
|
|
8336
8367
|
"requestFullscreen",
|
|
8337
8368
|
"webkitRequestFullscreen",
|
|
@@ -8394,7 +8425,7 @@ function yd(e, t = {}) {
|
|
|
8394
8425
|
capture: !1,
|
|
8395
8426
|
passive: !0
|
|
8396
8427
|
};
|
|
8397
|
-
return $(n,
|
|
8428
|
+
return $(n, yd, _, v), $(() => hd(i), yd, _, v), ud(_, !1), r && $u(m), {
|
|
8398
8429
|
isSupported: d,
|
|
8399
8430
|
isFullscreen: a,
|
|
8400
8431
|
enter: h,
|
|
@@ -8402,15 +8433,15 @@ function yd(e, t = {}) {
|
|
|
8402
8433
|
toggle: g
|
|
8403
8434
|
};
|
|
8404
8435
|
}
|
|
8405
|
-
function
|
|
8436
|
+
function xd(e, t) {
|
|
8406
8437
|
R(e) && t(R(e));
|
|
8407
8438
|
}
|
|
8408
|
-
function
|
|
8439
|
+
function Sd(e) {
|
|
8409
8440
|
let t = [];
|
|
8410
8441
|
for (let n = 0; n < e.length; ++n) t = [...t, [e.start(n), e.end(n)]];
|
|
8411
8442
|
return t;
|
|
8412
8443
|
}
|
|
8413
|
-
function
|
|
8444
|
+
function Cd(e) {
|
|
8414
8445
|
return Array.from(e).map(({ label: e, kind: t, language: n, mode: r, activeCues: i, cues: a, inBandMetadataTrackDispatchType: o }, s) => ({
|
|
8415
8446
|
id: s,
|
|
8416
8447
|
label: e,
|
|
@@ -8422,17 +8453,17 @@ function Sd(e) {
|
|
|
8422
8453
|
inBandMetadataTrackDispatchType: o
|
|
8423
8454
|
}));
|
|
8424
8455
|
}
|
|
8425
|
-
var
|
|
8456
|
+
var wd = {
|
|
8426
8457
|
src: "",
|
|
8427
8458
|
tracks: []
|
|
8428
8459
|
};
|
|
8429
|
-
function
|
|
8460
|
+
function Td(e, t = {}) {
|
|
8430
8461
|
e = ad(e), t = {
|
|
8431
|
-
...
|
|
8462
|
+
...wd,
|
|
8432
8463
|
...t
|
|
8433
8464
|
};
|
|
8434
8465
|
let { document: n = md } = t, r = { passive: !0 }, i = I(0), a = I(0), o = I(!1), s = I(1), c = I(!1), l = I(!1), u = I(!1), d = I(1), f = I(!1), p = I([]), m = I([]), h = I(-1), g = I(!1), _ = I(!1), v = !!(n && "pictureInPictureEnabled" in n), y = ed(), b = ed(), x = (t) => {
|
|
8435
|
-
|
|
8466
|
+
xd(e, (e) => {
|
|
8436
8467
|
if (t) {
|
|
8437
8468
|
let n = typeof t == "number" ? t : t.id;
|
|
8438
8469
|
e.textTracks[n].mode = "disabled";
|
|
@@ -8440,12 +8471,12 @@ function wd(e, t = {}) {
|
|
|
8440
8471
|
h.value = -1;
|
|
8441
8472
|
});
|
|
8442
8473
|
}, S = (t, n = !0) => {
|
|
8443
|
-
|
|
8474
|
+
xd(e, (e) => {
|
|
8444
8475
|
let r = typeof t == "number" ? t : t.id;
|
|
8445
8476
|
n && x(), e.textTracks[r].mode = "showing", h.value = r;
|
|
8446
8477
|
});
|
|
8447
8478
|
}, C = () => new Promise((t, r) => {
|
|
8448
|
-
|
|
8479
|
+
xd(e, async (e) => {
|
|
8449
8480
|
v && (g.value ? n.exitPictureInPicture().then(t).catch(r) : e.requestPictureInPicture().then(t).catch(r));
|
|
8450
8481
|
});
|
|
8451
8482
|
});
|
|
@@ -8486,7 +8517,7 @@ function wd(e, t = {}) {
|
|
|
8486
8517
|
throw b.trigger(e), e;
|
|
8487
8518
|
}) : n.pause());
|
|
8488
8519
|
});
|
|
8489
|
-
$(e, "timeupdate", () => w(() => i.value = R(e).currentTime), r), $(e, "durationchange", () => a.value = R(e).duration, r), $(e, "progress", () => p.value =
|
|
8520
|
+
$(e, "timeupdate", () => w(() => i.value = R(e).currentTime), r), $(e, "durationchange", () => a.value = R(e).duration, r), $(e, "progress", () => p.value = Sd(R(e).buffered), r), $(e, "seeking", () => o.value = !0, r), $(e, "seeked", () => o.value = !1, r), $(e, ["waiting", "loadstart"], () => {
|
|
8490
8521
|
c.value = !0, T(() => u.value = !1);
|
|
8491
8522
|
}, r), $(e, "loadeddata", () => c.value = !1, r), $(e, "playing", () => {
|
|
8492
8523
|
c.value = !1, l.value = !1, T(() => u.value = !0);
|
|
@@ -8496,7 +8527,7 @@ function wd(e, t = {}) {
|
|
|
8496
8527
|
}, r);
|
|
8497
8528
|
let E = [], D = V([e], () => {
|
|
8498
8529
|
let t = R(e);
|
|
8499
|
-
t && (D(), E[0] = $(t.textTracks, "addtrack", () => m.value =
|
|
8530
|
+
t && (D(), E[0] = $(t.textTracks, "addtrack", () => m.value = Cd(t.textTracks), r), E[1] = $(t.textTracks, "removetrack", () => m.value = Cd(t.textTracks), r), E[2] = $(t.textTracks, "change", () => m.value = Cd(t.textTracks), r));
|
|
8500
8531
|
});
|
|
8501
8532
|
return $u(() => E.forEach((e) => e())), {
|
|
8502
8533
|
currentTime: i,
|
|
@@ -8522,27 +8553,116 @@ function wd(e, t = {}) {
|
|
|
8522
8553
|
};
|
|
8523
8554
|
}
|
|
8524
8555
|
//#endregion
|
|
8525
|
-
//#region src/components/
|
|
8526
|
-
var
|
|
8556
|
+
//#region src/components/ToggleGroup/ToggleGroup.vue?vue&type=script&setup=true&lang.ts
|
|
8557
|
+
var Ed = { class: "flex flex-col gap-1" }, Dd = {
|
|
8558
|
+
key: 0,
|
|
8559
|
+
class: "text-color-gray-700 justify-start body-normal text-sm"
|
|
8560
|
+
}, Od = ["onClick"], kd = {
|
|
8561
|
+
key: 1,
|
|
8562
|
+
class: "extra-small-semibold"
|
|
8563
|
+
}, Ad = ["onClick"], jd = {
|
|
8564
|
+
key: 1,
|
|
8565
|
+
class: "extra-small-semibold"
|
|
8566
|
+
}, Md = {
|
|
8567
|
+
key: 1,
|
|
8568
|
+
class: "extra-small-semibold"
|
|
8569
|
+
}, Nd = /* @__PURE__ */ _({
|
|
8570
|
+
name: "NexxtToggleGroup",
|
|
8571
|
+
__name: "ToggleGroup",
|
|
8572
|
+
props: /*@__PURE__*/ S({
|
|
8573
|
+
options: {},
|
|
8574
|
+
label: {}
|
|
8575
|
+
}, {
|
|
8576
|
+
modelValue: { required: !0 },
|
|
8577
|
+
modelModifiers: {}
|
|
8578
|
+
}),
|
|
8579
|
+
emits: ["update:modelValue"],
|
|
8580
|
+
setup(e) {
|
|
8581
|
+
let t = e, n = B(e, "modelValue"), i = M(null), a = M([]), o = M({
|
|
8582
|
+
width: "0px",
|
|
8583
|
+
transform: "translateX(0px)"
|
|
8584
|
+
}), s = M("inset(0 100% 0 0 round 8px)"), f = M(!1), p = async () => {
|
|
8585
|
+
await w();
|
|
8586
|
+
let e = t.options.findIndex((e) => e.value === n.value), r = a.value[e];
|
|
8587
|
+
if (!r || !i.value) return;
|
|
8588
|
+
let c = i.value.getBoundingClientRect(), l = r.getBoundingClientRect(), u = l.left - c.left, d = l.width, f = c.width - u - d;
|
|
8589
|
+
o.value = {
|
|
8590
|
+
width: `${d}px`,
|
|
8591
|
+
transform: `translateX(${u}px)`
|
|
8592
|
+
}, s.value = `inset(0 ${f}px 0 ${u}px round 8px)`;
|
|
8593
|
+
};
|
|
8594
|
+
return V(n, async () => await p()), vd(i, () => p()), O(async () => {
|
|
8595
|
+
await document.fonts.ready, await p(), await w(), f.value = !0;
|
|
8596
|
+
}), (t, p) => (A(), u("div", Ed, [e.label ? (A(), u("label", Dd, L(e.label), 1)) : l("", !0), d("div", {
|
|
8597
|
+
ref_key: "containerRef",
|
|
8598
|
+
ref: i,
|
|
8599
|
+
class: "relative isolate flex h-10 gap-1 rounded-xl bg-gray-100 p-1"
|
|
8600
|
+
}, [
|
|
8601
|
+
d("div", {
|
|
8602
|
+
"aria-hidden": "true",
|
|
8603
|
+
class: T(["absolute inset-y-1 left-0 rounded-lg bg-white", f.value ? "transition-transform duration-500 ease-[cubic-bezier(0.34,1.2,0.64,1)]" : ""]),
|
|
8604
|
+
style: D(o.value)
|
|
8605
|
+
}, null, 6),
|
|
8606
|
+
(A(!0), u(r, null, N(e.options, (e, t) => (A(), u(r, { key: e.value }, [e.tooltip ? (A(), c(Fu, {
|
|
8607
|
+
key: 0,
|
|
8608
|
+
"disable-closing-trigger": ""
|
|
8609
|
+
}, {
|
|
8610
|
+
tooltip: H(() => [m(L(e.tooltip), 1)]),
|
|
8611
|
+
default: H(() => [d("button", {
|
|
8612
|
+
ref_for: !0,
|
|
8613
|
+
ref: (e) => a.value[t] = e,
|
|
8614
|
+
type: "button",
|
|
8615
|
+
class: "relative z-10 flex flex-1 cursor-pointer items-center justify-center gap-1.5 rounded-lg px-4 py-1.5 text-gray-500 hover:text-gray-700",
|
|
8616
|
+
onClick: (t) => n.value = e.value
|
|
8617
|
+
}, [e.icon ? (A(), c(G, {
|
|
8618
|
+
key: 0,
|
|
8619
|
+
name: e.icon
|
|
8620
|
+
}, null, 8, ["name"])) : l("", !0), e.label ? (A(), u("span", kd, L(e.label), 1)) : l("", !0)], 8, Od)]),
|
|
8621
|
+
_: 2
|
|
8622
|
+
}, 1024)) : (A(), u("button", {
|
|
8623
|
+
key: 1,
|
|
8624
|
+
ref_for: !0,
|
|
8625
|
+
ref: (e) => a.value[t] = e,
|
|
8626
|
+
type: "button",
|
|
8627
|
+
class: "relative z-10 flex flex-1 cursor-pointer items-center justify-center gap-1.5 rounded-lg px-4 py-1.5 text-gray-500 hover:text-gray-700",
|
|
8628
|
+
onClick: (t) => n.value = e.value
|
|
8629
|
+
}, [e.icon ? (A(), c(G, {
|
|
8630
|
+
key: 0,
|
|
8631
|
+
name: e.icon
|
|
8632
|
+
}, null, 8, ["name"])) : l("", !0), e.label ? (A(), u("span", jd, L(e.label), 1)) : l("", !0)], 8, Ad))], 64))), 128)),
|
|
8633
|
+
d("div", {
|
|
8634
|
+
"aria-hidden": "true",
|
|
8635
|
+
class: T(["pointer-events-none absolute inset-0 z-20 flex gap-1 p-1", f.value ? "transition-[clip-path] duration-500 ease-[cubic-bezier(0.34,1.2,0.64,1)]" : ""]),
|
|
8636
|
+
style: D({ clipPath: s.value })
|
|
8637
|
+
}, [(A(!0), u(r, null, N(e.options, (e) => (A(), u("span", {
|
|
8638
|
+
key: e.value,
|
|
8639
|
+
class: "flex flex-1 items-center justify-center gap-1.5 rounded-lg px-4 py-1.5 text-cornflower-blue-600"
|
|
8640
|
+
}, [e.icon ? (A(), c(G, {
|
|
8641
|
+
key: 0,
|
|
8642
|
+
name: e.icon
|
|
8643
|
+
}, null, 8, ["name"])) : l("", !0), e.label ? (A(), u("span", Md, L(e.label), 1)) : l("", !0)]))), 128))], 6)
|
|
8644
|
+
], 512)]));
|
|
8645
|
+
}
|
|
8646
|
+
}), Pd = [
|
|
8527
8647
|
"src",
|
|
8528
8648
|
"loop",
|
|
8529
8649
|
"aria-label"
|
|
8530
|
-
],
|
|
8650
|
+
], Fd = {
|
|
8531
8651
|
key: 0,
|
|
8532
8652
|
role: "alert",
|
|
8533
8653
|
class: "absolute inset-0 flex flex-col items-center justify-center gap-3 rounded-lg bg-gray-900 text-white"
|
|
8534
|
-
},
|
|
8654
|
+
}, Id = { class: "heading-4" }, Ld = { class: "max-w-xs truncate extra-small-normal text-white/50" }, Rd = {
|
|
8535
8655
|
key: 0,
|
|
8536
8656
|
class: "pointer-events-none absolute inset-0 flex items-center justify-center"
|
|
8537
|
-
},
|
|
8657
|
+
}, zd = {
|
|
8538
8658
|
class: "flex h-16 w-16 items-center justify-center rounded-full bg-black/50 text-white",
|
|
8539
8659
|
"aria-hidden": "true"
|
|
8540
|
-
},
|
|
8660
|
+
}, Bd = [
|
|
8541
8661
|
"aria-label",
|
|
8542
8662
|
"aria-valuemax",
|
|
8543
8663
|
"aria-valuenow",
|
|
8544
8664
|
"aria-valuetext"
|
|
8545
|
-
],
|
|
8665
|
+
], Vd = { class: "flex items-center gap-2" }, Hd = ["aria-label"], Ud = { class: "extra-small-normal text-white/70 tabular-nums" }, Wd = ["aria-label"], Gd = ["aria-label"], Kd = /* @__PURE__ */ _({
|
|
8546
8666
|
__name: "VideoPlayer",
|
|
8547
8667
|
props: {
|
|
8548
8668
|
src: {},
|
|
@@ -8564,7 +8684,7 @@ var Td = [
|
|
|
8564
8684
|
seek: "Seek",
|
|
8565
8685
|
video: "Video player",
|
|
8566
8686
|
...n.labels
|
|
8567
|
-
})), i = I(null), { playing: o, buffered: c, currentTime: f, duration: p, muted: m, seeking: g } =
|
|
8687
|
+
})), i = I(null), { playing: o, buffered: c, currentTime: f, duration: p, muted: m, seeking: g } = Td(i, { src: s(() => n.src) }), { isFullscreen: _, toggle: v } = bd(i), y = M(!1), b = s(() => !o.value || y.value), x = M(!1);
|
|
8568
8688
|
V(() => n.src, () => {
|
|
8569
8689
|
x.value = !1;
|
|
8570
8690
|
});
|
|
@@ -8623,15 +8743,15 @@ var Td = [
|
|
|
8623
8743
|
"aria-label": r.value.video,
|
|
8624
8744
|
onError: n[0] ||= (e) => x.value = !0,
|
|
8625
8745
|
onClick: n[1] ||= (t) => e.showControls === !1 ? void 0 : j()
|
|
8626
|
-
}, null, 42,
|
|
8627
|
-
x.value ? (A(), u("div",
|
|
8746
|
+
}, null, 42, Pd),
|
|
8747
|
+
x.value ? (A(), u("div", Fd, [
|
|
8628
8748
|
h(G, {
|
|
8629
8749
|
name: "circle-exclamation",
|
|
8630
8750
|
class: "text-3xl text-red-400",
|
|
8631
8751
|
"aria-hidden": "true"
|
|
8632
8752
|
}),
|
|
8633
|
-
d("p",
|
|
8634
|
-
d("p",
|
|
8753
|
+
d("p", Id, L(r.value.error), 1),
|
|
8754
|
+
d("p", Ld, L(e.src), 1)
|
|
8635
8755
|
])) : l("", !0),
|
|
8636
8756
|
h(a, {
|
|
8637
8757
|
"enter-active-class": "transition-opacity duration-100 ease-out",
|
|
@@ -8639,7 +8759,7 @@ var Td = [
|
|
|
8639
8759
|
"enter-from-class": "opacity-0",
|
|
8640
8760
|
"leave-to-class": "opacity-0"
|
|
8641
8761
|
}, {
|
|
8642
|
-
default: H(() => [e.showControls !== !1 && S.value && !x.value ? (A(), u("div",
|
|
8762
|
+
default: H(() => [e.showControls !== !1 && S.value && !x.value ? (A(), u("div", Rd, [d("div", zd, [h(G, {
|
|
8643
8763
|
name: S.value,
|
|
8644
8764
|
class: "text-2xl"
|
|
8645
8765
|
}, null, 8, ["name"])])])) : l("", !0)]),
|
|
@@ -8682,7 +8802,7 @@ var Td = [
|
|
|
8682
8802
|
class: "absolute top-1/2 h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full bg-sapphire-100 opacity-0 shadow transition-opacity group-hover/player:opacity-100",
|
|
8683
8803
|
style: D({ left: `${R.value}%` })
|
|
8684
8804
|
}, null, 4)
|
|
8685
|
-
], 40,
|
|
8805
|
+
], 40, Bd), d("div", Vd, [
|
|
8686
8806
|
d("button", {
|
|
8687
8807
|
type: "button",
|
|
8688
8808
|
"aria-label": z(o) ? r.value.pause : r.value.play,
|
|
@@ -8692,8 +8812,8 @@ var Td = [
|
|
|
8692
8812
|
name: z(o) ? "pause" : "play",
|
|
8693
8813
|
class: "text-sm",
|
|
8694
8814
|
"aria-hidden": "true"
|
|
8695
|
-
}, null, 8, ["name"])], 8,
|
|
8696
|
-
d("span",
|
|
8815
|
+
}, null, 8, ["name"])], 8, Hd),
|
|
8816
|
+
d("span", Ud, L(ee(ne.value)) + " / " + L(ee(z(p))), 1),
|
|
8697
8817
|
n[7] ||= d("div", { class: "flex-1" }, null, -1),
|
|
8698
8818
|
d("button", {
|
|
8699
8819
|
type: "button",
|
|
@@ -8704,7 +8824,7 @@ var Td = [
|
|
|
8704
8824
|
name: z(m) ? "volume-xmark" : "volume-high",
|
|
8705
8825
|
class: "text-sm",
|
|
8706
8826
|
"aria-hidden": "true"
|
|
8707
|
-
}, null, 8, ["name"])], 8,
|
|
8827
|
+
}, null, 8, ["name"])], 8, Wd),
|
|
8708
8828
|
d("button", {
|
|
8709
8829
|
type: "button",
|
|
8710
8830
|
"aria-label": z(_) ? r.value.exitFullscreen : r.value.enterFullscreen,
|
|
@@ -8714,10 +8834,10 @@ var Td = [
|
|
|
8714
8834
|
name: z(_) ? "compress" : "expand",
|
|
8715
8835
|
class: "text-sm",
|
|
8716
8836
|
"aria-hidden": "true"
|
|
8717
|
-
}, null, 8, ["name"])], 8,
|
|
8837
|
+
}, null, 8, ["name"])], 8, Gd)
|
|
8718
8838
|
])], 4)) : l("", !0)
|
|
8719
8839
|
], 32));
|
|
8720
8840
|
}
|
|
8721
8841
|
});
|
|
8722
8842
|
//#endregion
|
|
8723
|
-
export { Pt as NexxtAnimatedNumber, It as NexxtAnnouncement, Vt as NexxtAvatar, Ut as NexxtButton, Ni as NexxtCalendar, Ii as NexxtCard, Ri as NexxtCheckbox, zi as NexxtChip, Qo as NexxtColorPicker, bs as NexxtCombobox, ys as NexxtComboboxPanel, Ds as NexxtContactInfoCard, Bs as NexxtCountrySelect, Ks as NexxtCustomerJourneyTile, qs as NexxtDatePicker, tc as NexxtDoughnutChart, ac as NexxtDropdownButton, zo as NexxtFloatingPanel, cc as NexxtHeader, G as NexxtIcon, uc as NexxtInfoBlock, os as NexxtInputField, yc as NexxtInputSelect, Cc as NexxtModal, wc as NexxtPagination, Oc as NexxtPresenceIndicator, Lc as NexxtProgressBar, Jc as NexxtPropertyCard, Uc as NexxtPropertyListing, rl as NexxtSelect, ll as NexxtSidebarMenuItem, dl as NexxtSkeleton, hl as NexxtSkeletonPropertyCard, vl as NexxtSocialIcons, Sl as NexxtSocialMediaCustomTemplate, jl as NexxtSocialMediaTemplate, Gl as NexxtSocialMediaType, iu as NexxtSource, Bt as NexxtSquircle, au as NexxtStepperHeader, cu as NexxtSwitch, hu as NexxtTabbedContent, Ou as NexxtTable, du as NexxtTabs, Pu as NexxtTimelineEvent, Wu as NexxtTimelinePhaseblock, Zu as NexxtToast, Qu as NexxtToaster, Fu as NexxtTooltip,
|
|
8843
|
+
export { Pt as NexxtAnimatedNumber, It as NexxtAnnouncement, Vt as NexxtAvatar, Ut as NexxtButton, Ni as NexxtCalendar, Ii as NexxtCard, Ri as NexxtCheckbox, zi as NexxtChip, Qo as NexxtColorPicker, bs as NexxtCombobox, ys as NexxtComboboxPanel, Ds as NexxtContactInfoCard, Bs as NexxtCountrySelect, Ks as NexxtCustomerJourneyTile, qs as NexxtDatePicker, tc as NexxtDoughnutChart, ac as NexxtDropdownButton, zo as NexxtFloatingPanel, cc as NexxtHeader, G as NexxtIcon, uc as NexxtInfoBlock, os as NexxtInputField, yc as NexxtInputSelect, Cc as NexxtModal, wc as NexxtPagination, Oc as NexxtPresenceIndicator, Lc as NexxtProgressBar, Jc as NexxtPropertyCard, Uc as NexxtPropertyListing, rl as NexxtSelect, ll as NexxtSidebarMenuItem, dl as NexxtSkeleton, hl as NexxtSkeletonPropertyCard, vl as NexxtSocialIcons, Sl as NexxtSocialMediaCustomTemplate, jl as NexxtSocialMediaTemplate, Gl as NexxtSocialMediaType, iu as NexxtSource, Bt as NexxtSquircle, au as NexxtStepperHeader, cu as NexxtSwitch, hu as NexxtTabbedContent, Ou as NexxtTable, du as NexxtTabs, Pu as NexxtTimelineEvent, Wu as NexxtTimelinePhaseblock, Zu as NexxtToast, Qu as NexxtToaster, Nd as NexxtToggleGroup, Fu as NexxtTooltip, Kd as NexxtVideoPlayer, tu as SOURCE_MAP };
|
package/dist/nuxt.js
CHANGED
|
@@ -47515,6 +47515,7 @@ var Hw, Uw, Ww, Gw, Kw, qw = t((() => {
|
|
|
47515
47515
|
NexxtTimelinePhaseblock: "components/TimelinePhaseblock/TimelinePhaseblock.vue",
|
|
47516
47516
|
NexxtToast: "components/Toast/Toast.vue",
|
|
47517
47517
|
NexxtToaster: "components/Toaster/Toaster.vue",
|
|
47518
|
+
NexxtToggleGroup: "components/ToggleGroup/ToggleGroup.vue",
|
|
47518
47519
|
NexxtTooltip: "components/Tooltip/Tooltip.vue",
|
|
47519
47520
|
NexxtVideoPlayer: "components/VideoPlayer/VideoPlayer.vue"
|
|
47520
47521
|
}, hj = u({
|
package/package.json
CHANGED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { ref, watch, onMounted, nextTick } from 'vue'
|
|
3
|
+
import { useResizeObserver } from '@vueuse/core'
|
|
4
|
+
import type { IconName } from '@awesome.me/kit-37b149f3ef/icons'
|
|
5
|
+
import NexxtIcon from '../Icon/Icon.vue'
|
|
6
|
+
import NexxtTooltip from '../Tooltip/Tooltip.vue'
|
|
7
|
+
|
|
8
|
+
export interface NexxtToggleGroupOption {
|
|
9
|
+
value: string
|
|
10
|
+
icon?: IconName
|
|
11
|
+
label?: string
|
|
12
|
+
tooltip?: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface NexxtToggleGroupProps {
|
|
16
|
+
options: NexxtToggleGroupOption[]
|
|
17
|
+
label?: string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
defineOptions({
|
|
21
|
+
name: 'NexxtToggleGroup',
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
const props = defineProps<NexxtToggleGroupProps>()
|
|
25
|
+
|
|
26
|
+
const model = defineModel<string>({ required: true })
|
|
27
|
+
|
|
28
|
+
const containerRef = ref<HTMLElement | null>(null)
|
|
29
|
+
const buttonRefs = ref<HTMLButtonElement[]>([])
|
|
30
|
+
const sliderStyle = ref({ width: '0px', transform: 'translateX(0px)' })
|
|
31
|
+
const clipPath = ref('inset(0 100% 0 0 round 8px)')
|
|
32
|
+
const ready = ref(false)
|
|
33
|
+
|
|
34
|
+
const updateSlider = async () => {
|
|
35
|
+
await nextTick()
|
|
36
|
+
const index = props.options.findIndex((o) => o.value === model.value)
|
|
37
|
+
const button = buttonRefs.value[index]
|
|
38
|
+
if (!button || !containerRef.value) return
|
|
39
|
+
|
|
40
|
+
const containerRect = containerRef.value.getBoundingClientRect()
|
|
41
|
+
const buttonRect = button.getBoundingClientRect()
|
|
42
|
+
|
|
43
|
+
const left = buttonRect.left - containerRect.left
|
|
44
|
+
const width = buttonRect.width
|
|
45
|
+
const right = containerRect.width - left - width
|
|
46
|
+
|
|
47
|
+
sliderStyle.value = {
|
|
48
|
+
width: `${width}px`,
|
|
49
|
+
transform: `translateX(${left}px)`,
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
clipPath.value = `inset(0 ${right}px 0 ${left}px round 8px)`
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
watch(model, async () => await updateSlider())
|
|
56
|
+
|
|
57
|
+
useResizeObserver(containerRef, () => updateSlider())
|
|
58
|
+
|
|
59
|
+
onMounted(async () => {
|
|
60
|
+
await document.fonts.ready
|
|
61
|
+
await updateSlider()
|
|
62
|
+
await nextTick()
|
|
63
|
+
ready.value = true
|
|
64
|
+
})
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<template>
|
|
68
|
+
<div class="flex flex-col gap-1">
|
|
69
|
+
<label v-if="label" class="text-color-gray-700 justify-start body-normal text-sm">
|
|
70
|
+
{{ label }}
|
|
71
|
+
</label>
|
|
72
|
+
<div ref="containerRef" class="relative isolate flex h-10 gap-1 rounded-xl bg-gray-100 p-1">
|
|
73
|
+
<!-- slider pill -->
|
|
74
|
+
<div
|
|
75
|
+
aria-hidden="true"
|
|
76
|
+
class="absolute inset-y-1 left-0 rounded-lg bg-white"
|
|
77
|
+
:class="
|
|
78
|
+
ready ? 'transition-transform duration-500 ease-[cubic-bezier(0.34,1.2,0.64,1)]' : ''
|
|
79
|
+
"
|
|
80
|
+
:style="sliderStyle"
|
|
81
|
+
/>
|
|
82
|
+
|
|
83
|
+
<!-- buttons with gray text underneath -->
|
|
84
|
+
<template v-for="(option, index) in options" :key="option.value">
|
|
85
|
+
<NexxtTooltip v-if="option.tooltip" disable-closing-trigger>
|
|
86
|
+
<button
|
|
87
|
+
:ref="(el) => (buttonRefs[index] = el as HTMLButtonElement)"
|
|
88
|
+
type="button"
|
|
89
|
+
class="relative z-10 flex flex-1 cursor-pointer items-center justify-center gap-1.5 rounded-lg px-4 py-1.5 text-gray-500 hover:text-gray-700"
|
|
90
|
+
@click="model = option.value"
|
|
91
|
+
>
|
|
92
|
+
<NexxtIcon v-if="option.icon" :name="option.icon" />
|
|
93
|
+
<span v-if="option.label" class="extra-small-semibold">{{ option.label }}</span>
|
|
94
|
+
</button>
|
|
95
|
+
<template #tooltip>{{ option.tooltip }}</template>
|
|
96
|
+
</NexxtTooltip>
|
|
97
|
+
<button
|
|
98
|
+
v-else
|
|
99
|
+
:ref="(el) => (buttonRefs[index] = el as HTMLButtonElement)"
|
|
100
|
+
type="button"
|
|
101
|
+
class="relative z-10 flex flex-1 cursor-pointer items-center justify-center gap-1.5 rounded-lg px-4 py-1.5 text-gray-500 hover:text-gray-700"
|
|
102
|
+
@click="model = option.value"
|
|
103
|
+
>
|
|
104
|
+
<NexxtIcon v-if="option.icon" :name="option.icon" />
|
|
105
|
+
<span v-if="option.label" class="extra-small-semibold">{{ option.label }}</span>
|
|
106
|
+
</button>
|
|
107
|
+
</template>
|
|
108
|
+
|
|
109
|
+
<div
|
|
110
|
+
aria-hidden="true"
|
|
111
|
+
class="pointer-events-none absolute inset-0 z-20 flex gap-1 p-1"
|
|
112
|
+
:class="
|
|
113
|
+
ready ? 'transition-[clip-path] duration-500 ease-[cubic-bezier(0.34,1.2,0.64,1)]' : ''
|
|
114
|
+
"
|
|
115
|
+
:style="{ clipPath }"
|
|
116
|
+
>
|
|
117
|
+
<span
|
|
118
|
+
v-for="option in options"
|
|
119
|
+
:key="option.value"
|
|
120
|
+
class="flex flex-1 items-center justify-center gap-1.5 rounded-lg px-4 py-1.5 text-cornflower-blue-600"
|
|
121
|
+
>
|
|
122
|
+
<NexxtIcon v-if="option.icon" :name="option.icon" />
|
|
123
|
+
<span v-if="option.label" class="extra-small-semibold">{{ option.label }}</span>
|
|
124
|
+
</span>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
</template>
|
|
@@ -17,6 +17,7 @@ interface NexxtTooltip {
|
|
|
17
17
|
sideOffset?: number
|
|
18
18
|
align?: 'start' | 'center' | 'end'
|
|
19
19
|
disableHoverableContent?: boolean
|
|
20
|
+
disableClosingTrigger?: boolean
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
const {
|
|
@@ -25,12 +26,17 @@ const {
|
|
|
25
26
|
sideOffset = 8,
|
|
26
27
|
align = 'center',
|
|
27
28
|
disableHoverableContent = false,
|
|
29
|
+
disableClosingTrigger = false,
|
|
28
30
|
} = defineProps<NexxtTooltip>()
|
|
29
31
|
</script>
|
|
30
32
|
|
|
31
33
|
<template>
|
|
32
34
|
<TooltipProvider>
|
|
33
|
-
<TooltipRoot
|
|
35
|
+
<TooltipRoot
|
|
36
|
+
:delay-duration="delay"
|
|
37
|
+
:disable-hoverable-content="disableHoverableContent"
|
|
38
|
+
:disable-closing-trigger="disableClosingTrigger"
|
|
39
|
+
>
|
|
34
40
|
<TooltipTrigger as-child>
|
|
35
41
|
<slot />
|
|
36
42
|
</TooltipTrigger>
|
package/src/components.json
CHANGED
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"NexxtTimelinePhaseblock": "components/TimelinePhaseblock/TimelinePhaseblock.vue",
|
|
48
48
|
"NexxtToast": "components/Toast/Toast.vue",
|
|
49
49
|
"NexxtToaster": "components/Toaster/Toaster.vue",
|
|
50
|
+
"NexxtToggleGroup": "components/ToggleGroup/ToggleGroup.vue",
|
|
50
51
|
"NexxtTooltip": "components/Tooltip/Tooltip.vue",
|
|
51
52
|
"NexxtVideoPlayer": "components/VideoPlayer/VideoPlayer.vue"
|
|
52
53
|
}
|
package/src/index.ts
CHANGED
|
@@ -47,5 +47,6 @@ export { default as NexxtTimelineEvent } from './components/TimelineEvent/Timeli
|
|
|
47
47
|
export { default as NexxtTimelinePhaseblock } from './components/TimelinePhaseblock/TimelinePhaseblock.vue'
|
|
48
48
|
export { default as NexxtToast } from './components/Toast/Toast.vue'
|
|
49
49
|
export { default as NexxtToaster } from './components/Toaster/Toaster.vue'
|
|
50
|
+
export { default as NexxtToggleGroup } from './components/ToggleGroup/ToggleGroup.vue'
|
|
50
51
|
export { default as NexxtTooltip } from './components/Tooltip/Tooltip.vue'
|
|
51
52
|
export { default as NexxtVideoPlayer } from './components/VideoPlayer/VideoPlayer.vue'
|