@kungal/ui-vue 1.4.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Tab.vue.d.ts.map +1 -1
- package/dist/index.js +57 -47
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tab.vue.d.ts","sourceRoot":"","sources":["../../src/components/Tab.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tab.vue.d.ts","sourceRoot":"","sources":["../../src/components/Tab.vue"],"names":[],"mappings":"AAieA,OAAO,KAAK,EAAc,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAS/E,KAAK,WAAW,GAAG,WAAW,CAAC;AAwY/B,KAAK,gBAAgB,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC;CAClB,CAAC;AAmBF,KAAK,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,CAAC;AAmIxD,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;6EAIhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
package/dist/index.js
CHANGED
|
@@ -5331,17 +5331,17 @@ var Ze = D({
|
|
|
5331
5331
|
sm: "gap-1",
|
|
5332
5332
|
md: "gap-1.5",
|
|
5333
5333
|
lg: "gap-2"
|
|
5334
|
-
}, g = D([]),
|
|
5334
|
+
}, g = D([]), C = (e, t) => {
|
|
5335
5335
|
let n = e && typeof e == "object" && "$el" in e ? e.$el ?? null : e;
|
|
5336
5336
|
n instanceof HTMLElement && (g.value[t] = n);
|
|
5337
|
-
},
|
|
5338
|
-
let e =
|
|
5337
|
+
}, T = o(() => r.items.findIndex((e) => e.value === i.value)), E = D({}), k = () => {
|
|
5338
|
+
let e = T.value, t = g.value[e];
|
|
5339
5339
|
if (!t) {
|
|
5340
|
-
|
|
5340
|
+
E.value = {};
|
|
5341
5341
|
return;
|
|
5342
5342
|
}
|
|
5343
5343
|
let n = r.variant === "underlined";
|
|
5344
|
-
p.value ?
|
|
5344
|
+
p.value ? E.value = n ? {
|
|
5345
5345
|
transform: `translateY(${t.offsetTop}px)`,
|
|
5346
5346
|
height: `${t.offsetHeight}px`,
|
|
5347
5347
|
width: "2px"
|
|
@@ -5349,7 +5349,7 @@ var Ze = D({
|
|
|
5349
5349
|
transform: `translate(${t.offsetLeft}px, ${t.offsetTop}px)`,
|
|
5350
5350
|
width: `${t.offsetWidth}px`,
|
|
5351
5351
|
height: `${t.offsetHeight}px`
|
|
5352
|
-
} :
|
|
5352
|
+
} : E.value = n ? {
|
|
5353
5353
|
transform: `translateX(${t.offsetLeft}px)`,
|
|
5354
5354
|
width: `${t.offsetWidth}px`,
|
|
5355
5355
|
height: "2px"
|
|
@@ -5363,33 +5363,39 @@ var Ze = D({
|
|
|
5363
5363
|
i,
|
|
5364
5364
|
() => r.items.length,
|
|
5365
5365
|
() => r.orientation
|
|
5366
|
-
], () => v(
|
|
5367
|
-
let
|
|
5366
|
+
], () => v(k), { immediate: !0 });
|
|
5367
|
+
let M = D(null), N = null;
|
|
5368
|
+
S(() => {
|
|
5369
|
+
v(k), typeof ResizeObserver < "u" && M.value && (N = new ResizeObserver(() => k()), N.observe(M.value));
|
|
5370
|
+
}), x(() => {
|
|
5371
|
+
N?.disconnect(), N = null;
|
|
5372
|
+
});
|
|
5373
|
+
let P = (e) => {
|
|
5368
5374
|
let t = g.value[e];
|
|
5369
5375
|
t && t.focus();
|
|
5370
|
-
},
|
|
5376
|
+
}, F = (e, t) => {
|
|
5371
5377
|
t?.preventDefault();
|
|
5372
5378
|
let n = r.items.map((e, t) => e.disabled || r.disabled ? -1 : t).filter((e) => e >= 0);
|
|
5373
5379
|
if (!n.length) return;
|
|
5374
|
-
let i = n.indexOf(
|
|
5380
|
+
let i = n.indexOf(T.value), a;
|
|
5375
5381
|
if (a = i < 0 ? n[e > 0 ? 0 : n.length - 1] : n[(i + e + n.length) % n.length], a === void 0) return;
|
|
5376
5382
|
let o = r.items[a];
|
|
5377
|
-
o && (
|
|
5378
|
-
},
|
|
5383
|
+
o && (R(o, a), P(a));
|
|
5384
|
+
}, I = (e, t) => {
|
|
5379
5385
|
if (r.disabled) return;
|
|
5380
5386
|
let n = p.value ? "ArrowDown" : "ArrowRight", i = p.value ? "ArrowUp" : "ArrowLeft";
|
|
5381
5387
|
switch (e.key) {
|
|
5382
5388
|
case n:
|
|
5383
|
-
|
|
5389
|
+
F(1, e);
|
|
5384
5390
|
break;
|
|
5385
5391
|
case i:
|
|
5386
|
-
|
|
5392
|
+
F(-1, e);
|
|
5387
5393
|
break;
|
|
5388
5394
|
case "Home":
|
|
5389
5395
|
e.preventDefault();
|
|
5390
5396
|
{
|
|
5391
5397
|
let e = r.items.findIndex((e) => !(e.disabled || r.disabled));
|
|
5392
|
-
e >= 0 && r.items[e] && (
|
|
5398
|
+
e >= 0 && r.items[e] && (R(r.items[e], e), P(e));
|
|
5393
5399
|
}
|
|
5394
5400
|
break;
|
|
5395
5401
|
case "End":
|
|
@@ -5397,7 +5403,7 @@ var Ze = D({
|
|
|
5397
5403
|
for (let e = r.items.length - 1; e >= 0; e--) {
|
|
5398
5404
|
let t = r.items[e];
|
|
5399
5405
|
if (t && !(t.disabled || r.disabled)) {
|
|
5400
|
-
|
|
5406
|
+
R(t, e), P(e);
|
|
5401
5407
|
break;
|
|
5402
5408
|
}
|
|
5403
5409
|
}
|
|
@@ -5406,18 +5412,18 @@ var Ze = D({
|
|
|
5406
5412
|
case " ": {
|
|
5407
5413
|
e.preventDefault();
|
|
5408
5414
|
let n = r.items[t];
|
|
5409
|
-
n &&
|
|
5415
|
+
n && R(n, t);
|
|
5410
5416
|
break;
|
|
5411
5417
|
}
|
|
5412
5418
|
}
|
|
5413
|
-
},
|
|
5419
|
+
}, R = async (e, t) => {
|
|
5414
5420
|
r.disabled || e.disabled || (i.value !== e.value && (i.value = e.value, a("change", e.value)), e.href && await d.navigate(e.href));
|
|
5415
|
-
},
|
|
5421
|
+
}, z = (e) => e.href ? d.linkComponent : "button", B = (e) => e.href ? typeof d.linkComponent == "string" ? { href: e.href } : { to: e.href } : {
|
|
5416
5422
|
type: "button",
|
|
5417
5423
|
disabled: e.disabled || r.disabled
|
|
5418
|
-
},
|
|
5419
|
-
t.href && e.preventDefault(),
|
|
5420
|
-
},
|
|
5424
|
+
}, H = (e, t, n) => {
|
|
5425
|
+
t.href && e.preventDefault(), R(t, n);
|
|
5426
|
+
}, W = (e) => hs(r.name, e), G = (e) => gs(r.name, e), K = (e) => i.value === e.value, ee = o(() => q("relative", p.value ? "inline-flex flex-col" : "inline-flex", r.fullWidth && "w-full", r.disabled && "opacity-50 cursor-not-allowed", r.scrollable && (p.value ? "max-h-full overflow-y-auto scrollbar-hide" : "max-w-full overflow-x-auto scrollbar-hide"), r.className)), J = o(() => {
|
|
5421
5427
|
let e = p.value ? q("relative flex flex-col items-stretch", h[r.size]) : q("relative flex items-center", h[r.size]);
|
|
5422
5428
|
switch (r.variant) {
|
|
5423
5429
|
case "underlined": return q(e, r.innerClassName);
|
|
@@ -5427,21 +5433,21 @@ var Ze = D({
|
|
|
5427
5433
|
case "pills": return q(e, r.innerClassName);
|
|
5428
5434
|
default: return q(e, r.innerClassName);
|
|
5429
5435
|
}
|
|
5430
|
-
}),
|
|
5436
|
+
}), te = {
|
|
5431
5437
|
start: "justify-start",
|
|
5432
5438
|
center: "justify-center",
|
|
5433
5439
|
end: "justify-end"
|
|
5434
|
-
},
|
|
5435
|
-
let t =
|
|
5440
|
+
}, ne = (e) => {
|
|
5441
|
+
let t = K(e), n = q("relative z-10 inline-flex items-center cursor-pointer select-none whitespace-nowrap transition-colors", te[r.align], m[r.size], h[r.size], e.disabled && "opacity-50 cursor-not-allowed", p.value && r.fullWidth && "w-full"), i = !ce.value;
|
|
5436
5442
|
switch (r.variant) {
|
|
5437
5443
|
case "underlined": return q(n, t ? fe[r.color] : "text-default-500 hover:text-foreground");
|
|
5438
|
-
case "solid": return q(n, "rounded-kun-md", t ? "text-white" : "text-default-500 hover:text-foreground");
|
|
5439
|
-
case "light": return q(n, "rounded-kun-md", t ? fe[r.color] : "text-default-500 hover:text-foreground");
|
|
5444
|
+
case "solid": return q(n, "rounded-kun-md", t ? q("text-white", i && ae[r.color]) : "text-default-500 hover:text-foreground");
|
|
5445
|
+
case "light": return q(n, "rounded-kun-md", t ? q(fe[r.color], i && ie[r.color]) : "text-default-500 hover:text-foreground");
|
|
5440
5446
|
case "bordered": return q(n, "rounded-kun-md border", t ? q(oe[r.color], fe[r.color]) : "border-transparent text-default-500 hover:text-foreground");
|
|
5441
5447
|
case "pills": return q(n, "rounded-full", t ? q(ae[r.color], "text-white") : "text-default-500 hover:text-foreground");
|
|
5442
5448
|
default: return n;
|
|
5443
5449
|
}
|
|
5444
|
-
},
|
|
5450
|
+
}, re = (e) => r.variant === "underlined" && K(e) && !ce.value ? { boxShadow: "inset 0 -2px 0 0 currentColor" } : void 0, ie = {
|
|
5445
5451
|
default: "bg-default/15",
|
|
5446
5452
|
primary: "bg-primary/15",
|
|
5447
5453
|
secondary: "bg-secondary/15",
|
|
@@ -5449,40 +5455,43 @@ var Ze = D({
|
|
|
5449
5455
|
warning: "bg-warning/15",
|
|
5450
5456
|
danger: "bg-danger/15",
|
|
5451
5457
|
info: "bg-info/15"
|
|
5452
|
-
},
|
|
5458
|
+
}, se = o(() => {
|
|
5453
5459
|
switch (r.variant) {
|
|
5454
5460
|
case "underlined": return q("absolute rounded-full", ae[r.color], p.value ? "left-0 top-0" : "bottom-0 left-0");
|
|
5455
5461
|
case "solid": return q("absolute top-0 left-0 rounded-kun-md", ae[r.color]);
|
|
5456
|
-
case "light": return q("absolute top-0 left-0 rounded-kun-md",
|
|
5462
|
+
case "light": return q("absolute top-0 left-0 rounded-kun-md", ie[r.color]);
|
|
5457
5463
|
default: return null;
|
|
5458
5464
|
}
|
|
5459
|
-
}),
|
|
5460
|
-
let e = { ...
|
|
5465
|
+
}), ce = o(() => !!se.value && T.value >= 0 && Object.keys(E.value).length > 0), Y = o(() => {
|
|
5466
|
+
let e = { ...E.value };
|
|
5461
5467
|
return r.disableAnimation || (e.transition = "transform var(--kun-dur-base) var(--ease-kun-standard), width var(--kun-dur-base) var(--ease-kun-standard)"), e;
|
|
5462
5468
|
});
|
|
5463
|
-
return (n, r) => (w(), l("div", { class: y(
|
|
5464
|
-
|
|
5469
|
+
return (n, r) => (w(), l("div", { class: y(ee.value) }, [u("div", {
|
|
5470
|
+
ref_key: "listRef",
|
|
5471
|
+
ref: M,
|
|
5472
|
+
class: y(J.value),
|
|
5465
5473
|
role: "tablist",
|
|
5466
5474
|
"aria-orientation": e.orientation
|
|
5467
|
-
}, [
|
|
5475
|
+
}, [ce.value ? (w(), l("div", {
|
|
5468
5476
|
key: 0,
|
|
5469
5477
|
"aria-hidden": "true",
|
|
5470
|
-
class: y(
|
|
5471
|
-
style: b(
|
|
5472
|
-
}, null, 6)) : c("", !0), (w(!0), l(t, null, O(e.items, (t, n) => (w(), s(A(
|
|
5478
|
+
class: y(se.value),
|
|
5479
|
+
style: b(Y.value)
|
|
5480
|
+
}, null, 6)) : c("", !0), (w(!0), l(t, null, O(e.items, (t, n) => (w(), s(A(z(t)), _({
|
|
5473
5481
|
key: t.value,
|
|
5474
5482
|
ref_for: !0,
|
|
5475
|
-
ref: (e) =>
|
|
5476
|
-
}, { ref_for: !0 },
|
|
5477
|
-
id:
|
|
5483
|
+
ref: (e) => C(e, n)
|
|
5484
|
+
}, { ref_for: !0 }, B(t), {
|
|
5485
|
+
id: W(t.value),
|
|
5478
5486
|
role: "tab",
|
|
5479
|
-
"aria-controls":
|
|
5480
|
-
"aria-selected":
|
|
5487
|
+
"aria-controls": G(t.value),
|
|
5488
|
+
"aria-selected": K(t),
|
|
5481
5489
|
"aria-disabled": t.disabled || e.disabled,
|
|
5482
|
-
tabindex:
|
|
5483
|
-
class:
|
|
5484
|
-
|
|
5485
|
-
|
|
5490
|
+
tabindex: K(t) && !t.disabled && !e.disabled ? 0 : -1,
|
|
5491
|
+
class: ne(t),
|
|
5492
|
+
style: re(t),
|
|
5493
|
+
onClick: (e) => H(e, t, n),
|
|
5494
|
+
onKeydown: (e) => I(e, n)
|
|
5486
5495
|
}), {
|
|
5487
5496
|
default: U(() => [t.icon ? (w(), l("span", {
|
|
5488
5497
|
key: 0,
|
|
@@ -5497,6 +5506,7 @@ var Ze = D({
|
|
|
5497
5506
|
"aria-disabled",
|
|
5498
5507
|
"tabindex",
|
|
5499
5508
|
"class",
|
|
5509
|
+
"style",
|
|
5500
5510
|
"onClick",
|
|
5501
5511
|
"onKeydown"
|
|
5502
5512
|
]))), 128))], 10, _s)], 2));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kungal/ui-vue",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "KunUI Vue 3 component layer — Nuxt-decoupled. Works in any Vue app; pairs with @kungal/ui-nuxt for Nuxt sugar.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"date-fns": "^4.1.0",
|
|
50
50
|
"focus-trap": "^8.2.1",
|
|
51
51
|
"vue-advanced-cropper": "^2.8.9",
|
|
52
|
-
"@kungal/ui-core": "1.4.
|
|
52
|
+
"@kungal/ui-core": "1.4.1"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"vue": "^3.5.0"
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"vite": "^8.0.16",
|
|
62
62
|
"vue": "^3.5.35",
|
|
63
63
|
"vue-tsc": "^3.3.3",
|
|
64
|
-
"@kungal/ui-tokens": "1.4.
|
|
64
|
+
"@kungal/ui-tokens": "1.4.1"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
67
|
"build": "vite build && cp src/prose.css dist/prose.css && vue-tsc -p tsconfig.build.json",
|