@dicehub/kappa 0.6.2 → 1.0.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 +98 -0
- package/THIRD_PARTY_NOTICES.md +103 -1
- package/dist/{DropdownSubTrigger-DrZmNIcU.js → DropdownSubTrigger-DVOFK5Y1.js} +202 -146
- package/dist/DropdownSubTrigger-DVOFK5Y1.js.map +1 -0
- package/dist/PoweredByDicehub-DPceYF8f.js +143 -0
- package/dist/PoweredByDicehub-DPceYF8f.js.map +1 -0
- package/dist/{WorkspaceSwitcher-DBWdKZbM.js → WorkspaceSwitcher-DDAIMxeE.js} +5 -9
- package/dist/WorkspaceSwitcher-DDAIMxeE.js.map +1 -0
- package/dist/app-shell-PGvfb1aZ.js +570 -0
- package/dist/app-shell-PGvfb1aZ.js.map +1 -0
- package/dist/blocks/app-shell/AppShell.vue.d.ts +41 -0
- package/dist/blocks/app-shell/AppShellActions.vue.d.ts +3 -0
- package/dist/blocks/app-shell/AppShellAsideResizeHandle.vue.d.ts +20 -0
- package/dist/blocks/app-shell/AppShellPage.vue.d.ts +6 -0
- package/dist/blocks/app-shell/AppShellPanels.vue.d.ts +33 -0
- package/dist/blocks/app-shell/AppShellSearchDialog.vue.d.ts +10 -0
- package/dist/blocks/app-shell/AppShellSearchTrigger.vue.d.ts +7 -0
- package/dist/blocks/app-shell/AppShellToolbar.vue.d.ts +3 -0
- package/dist/blocks/app-shell/app-shell.d.ts +67 -0
- package/dist/blocks/app-shell/index.d.ts +19 -0
- package/dist/blocks/app-shell.js +2 -0
- package/dist/blocks/file-browser.js +1 -1
- package/dist/blocks/index.d.ts +1 -0
- package/dist/blocks/sidebar-layout/SidebarLayout.vue.d.ts +2 -0
- package/dist/blocks/sidebar-layout/sidebar-layout.d.ts +14 -2
- package/dist/blocks/sidebar-layout.js +1 -1
- package/dist/blocks/workspace-switcher/workspace-switcher.d.ts +2 -0
- package/dist/blocks/workspace-switcher.js +1 -1
- package/dist/{breadcrumbs-CIxUxZVD.js → breadcrumbs-CPfb83sY.js} +36 -41
- package/dist/{breadcrumbs-CIxUxZVD.js.map → breadcrumbs-CPfb83sY.js.map} +1 -1
- package/dist/button-Cst2B-9X.js +208 -0
- package/dist/button-Cst2B-9X.js.map +1 -0
- package/dist/code-highlighted-BDnrVMMM.js +541 -0
- package/dist/code-highlighted-BDnrVMMM.js.map +1 -0
- package/dist/{command-palette-BHFB86Gc.js → command-palette-BjXvHrd6.js} +178 -165
- package/dist/command-palette-BjXvHrd6.js.map +1 -0
- package/dist/components/breadcrumbs.js +1 -1
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/toolbar-button.d.ts +23 -0
- package/dist/components/button.js +2 -2
- package/dist/components/code-block/index.d.ts +8 -0
- package/dist/components/code-block.js +10 -0
- package/dist/components/code-block.js.map +1 -0
- package/dist/components/code-highlighted/CodeBlockDisclosure.vue.d.ts +36 -0
- package/dist/components/code-highlighted/CodeHighlighted.vue.d.ts +28 -1
- package/dist/components/code-highlighted/code-highlighted.d.ts +12 -1
- package/dist/components/code-highlighted/use-shiki-highlighter.d.ts +1 -0
- package/dist/components/code-highlighted.js +2 -376
- package/dist/components/command-palette/CommandPaletteResultItem.vue.d.ts +1 -1
- package/dist/components/command-palette.js +1 -1
- package/dist/components/context-menu/ContextMenu.vue.d.ts +5 -5
- package/dist/components/context-menu.js +2 -2
- package/dist/components/data-grid.js +1 -1
- package/dist/components/date-picker/DatePicker.vue.d.ts +1 -1
- package/dist/components/dialog/Dialog.vue.d.ts +7 -7
- package/dist/components/dialog-layout/DialogLayoutAlert.vue.d.ts +3 -3
- package/dist/components/dicehub-logo/dicehub-logo.d.ts +17 -4
- package/dist/components/dicehub-logo/index.d.ts +1 -1
- package/dist/components/dicehub-logo.js +2 -2
- package/dist/components/drawer/Drawer.vue.d.ts +3 -3
- package/dist/components/dropdown/Dropdown.vue.d.ts +5 -5
- package/dist/components/dropdown/DropdownContent.vue.d.ts +1 -0
- package/dist/components/dropdown/DropdownSub.vue.d.ts +5 -5
- package/dist/components/dropdown/DropdownSubContent.vue.d.ts +1 -0
- package/dist/components/dropdown/dropdown.d.ts +2 -0
- package/dist/components/dropdown/use-dropdown-focus.d.ts +6 -0
- package/dist/components/dropdown.js +2 -2
- package/dist/components/filter-bar.js +1 -1
- package/dist/components/hover-card/HoverCard.vue.d.ts +2 -2
- package/dist/components/kbd.js +1 -1
- package/dist/components/loader/Loader.vue.d.ts +1 -1
- package/dist/components/matrix-loader/MatrixLoader.vue.d.ts +1 -1
- package/dist/components/menu-bar.js +1 -1
- package/dist/components/popover/Popover.vue.d.ts +7 -7
- package/dist/components/sidebar/SidebarProvider.vue.d.ts +1 -0
- package/dist/components/sidebar/index.d.ts +1 -1
- package/dist/components/sidebar/sidebar-resize.d.ts +1 -0
- package/dist/components/sidebar/sidebar.d.ts +5 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/table/TableCheckCell.vue.d.ts +1 -1
- package/dist/components/table/TableCheckHead.vue.d.ts +1 -1
- package/dist/components/toolbar/ToolbarButton.vue.d.ts +5 -1
- package/dist/components/toolbar/index.d.ts +3 -2
- package/dist/components/toolbar/toolbar.d.ts +2 -3
- package/dist/components/toolbar.js +3 -2
- package/dist/components/tooltip/Tooltip.vue.d.ts +5 -5
- package/dist/{context-menu-B_noSd5p.js → context-menu-WmJWrUGu.js} +2 -2
- package/dist/{context-menu-B_noSd5p.js.map → context-menu-WmJWrUGu.js.map} +1 -1
- package/dist/{data-grid-CobgDr8q.js → data-grid-BQkLsfk0.js} +2 -2
- package/dist/{data-grid-CobgDr8q.js.map → data-grid-BQkLsfk0.js.map} +1 -1
- package/dist/{dropdown-Dedb1tk8.js → dropdown-BABKXjuz.js} +2 -2
- package/dist/{dropdown-Dedb1tk8.js.map → dropdown-BABKXjuz.js.map} +1 -1
- package/dist/{file-browser-CGqaz2eI.js → file-browser-BxOJWvrF.js} +5 -5
- package/dist/{file-browser-CGqaz2eI.js.map → file-browser-BxOJWvrF.js.map} +1 -1
- package/dist/{filter-bar-COAlDQE4.js → filter-bar-CAyW-YoF.js} +2 -2
- package/dist/{filter-bar-COAlDQE4.js.map → filter-bar-CAyW-YoF.js.map} +1 -1
- package/dist/index.js +104 -103
- package/dist/{KbdGroup-CNwqr4vX.js → kbd-CNwqr4vX.js} +1 -1
- package/dist/kbd-CNwqr4vX.js.map +1 -0
- package/dist/{menu-bar-C-qQn2L1.js → menu-bar-DPJllpvf.js} +2 -2
- package/dist/{menu-bar-C-qQn2L1.js.map → menu-bar-DPJllpvf.js.map} +1 -1
- package/dist/paneled-bottom.png +0 -0
- package/dist/paneled-side.png +0 -0
- package/dist/registry/component-registry.json +18 -6
- package/dist/registry/generated.d.ts +94 -10
- package/dist/{registry-DLklQtS0.js → registry-Bgb2nbb2.js} +121 -9
- package/dist/registry-Bgb2nbb2.js.map +1 -0
- package/dist/registry.js +1 -1
- package/dist/{sidebar-tcrbUrk_.js → sidebar-9TqPqgDD.js} +178 -157
- package/dist/sidebar-9TqPqgDD.js.map +1 -0
- package/dist/{SidebarLayout-D9RT-MdT.js → sidebar-layout-DRe1HpSt.js} +65 -46
- package/dist/sidebar-layout-DRe1HpSt.js.map +1 -0
- package/dist/styles/kappa.css +1 -1
- package/dist/styles/theme-kappa.css +296 -1
- package/dist/styles/tokens.json +767 -0
- package/dist/{toolbar-DC-4XdHD.js → toolbar-DJsnox8t.js} +90 -146
- package/dist/toolbar-DJsnox8t.js.map +1 -0
- package/licenses/nunito.LICENSE +93 -0
- package/package.json +1 -1
- package/dist/DropdownSubTrigger-DrZmNIcU.js.map +0 -1
- package/dist/KbdGroup-CNwqr4vX.js.map +0 -1
- package/dist/PoweredByDicehub-BD-y1NZA.js +0 -92
- package/dist/PoweredByDicehub-BD-y1NZA.js.map +0 -1
- package/dist/SidebarLayout-D9RT-MdT.js.map +0 -1
- package/dist/WorkspaceSwitcher-DBWdKZbM.js.map +0 -1
- package/dist/button-DSgFcDoO.js +0 -128
- package/dist/button-DSgFcDoO.js.map +0 -1
- package/dist/command-palette-BHFB86Gc.js.map +0 -1
- package/dist/components/code-highlighted.js.map +0 -1
- package/dist/registry-DLklQtS0.js.map +0 -1
- package/dist/sidebar-tcrbUrk_.js.map +0 -1
- package/dist/toolbar-DC-4XdHD.js.map +0 -1
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "./
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var C = Symbol("kappa-toolbar"), w = (e) => {
|
|
9
|
-
g(C, e);
|
|
10
|
-
}, T = () => l(C, void 0), E = ["horizontal", "vertical"], D = [
|
|
1
|
+
import { d as e, f as t, t as n, u as r } from "./button-Cst2B-9X.js";
|
|
2
|
+
import { t as i } from "./input-C2XpksEe.js";
|
|
3
|
+
import { t as a } from "./input-group-CxVV-Ae0.js";
|
|
4
|
+
import { t as o } from "./separator-DhUckB82.js";
|
|
5
|
+
import { computed as s, createBlock as c, createElementBlock as l, defineComponent as u, mergeProps as d, nextTick as f, onMounted as p, onUnmounted as m, onUpdated as h, openBlock as g, ref as _, renderSlot as v, unref as y, useAttrs as b, useSlots as x, withCtx as S } from "vue";
|
|
6
|
+
//#region src/components/toolbar/toolbar.ts
|
|
7
|
+
var C = ["horizontal", "vertical"], w = [
|
|
11
8
|
"xs",
|
|
12
9
|
"sm",
|
|
13
10
|
"base",
|
|
14
11
|
"lg"
|
|
15
|
-
],
|
|
12
|
+
], T = "horizontal", E = "base", D = !0, O = (e, t) => typeof t == "string" && e.includes(t), k = (e) => O(C, e), A = (e) => O(w, e), j = (e) => k(e) ? e : T, M = (e) => A(e) ? e : E, N = [
|
|
16
13
|
"data-disabled",
|
|
17
14
|
"data-orientation",
|
|
18
15
|
"data-size",
|
|
19
16
|
"aria-disabled",
|
|
20
17
|
"aria-orientation"
|
|
21
|
-
],
|
|
18
|
+
], P = "button, input, select, textarea, a[href], [tabindex]", F = "[data-kappa-toolbar-item]", I = "[data-kappa-toolbar-input-group]", L = /* @__PURE__ */ u({
|
|
22
19
|
inheritAttrs: !1,
|
|
23
20
|
__name: "Toolbar",
|
|
24
21
|
props: {
|
|
25
|
-
orientation: { default:
|
|
26
|
-
size: { default:
|
|
22
|
+
orientation: { default: T },
|
|
23
|
+
size: { default: E },
|
|
27
24
|
disabled: {
|
|
28
25
|
type: Boolean,
|
|
29
26
|
default: !1
|
|
@@ -34,39 +31,39 @@ var C = Symbol("kappa-toolbar"), w = (e) => {
|
|
|
34
31
|
}
|
|
35
32
|
},
|
|
36
33
|
setup(e) {
|
|
37
|
-
let t = e, n = b(),
|
|
38
|
-
|
|
39
|
-
disabled:
|
|
34
|
+
let t = e, n = b(), i = _(null), a = _(null), o, c = s(() => j(t.orientation)), u = s(() => M(t.size)), y = s(() => t.disabled || n["aria-disabled"] === !0 || n["aria-disabled"] === "true"), x = s(() => y.value ? "true" : n["aria-disabled"] === !1 || n["aria-disabled"] === "false" ? "false" : void 0);
|
|
35
|
+
r({
|
|
36
|
+
disabled: y,
|
|
40
37
|
orientation: c,
|
|
41
|
-
size:
|
|
38
|
+
size: u
|
|
42
39
|
});
|
|
43
|
-
let
|
|
40
|
+
let S = (e) => {
|
|
44
41
|
if (e.hidden || e.closest("[hidden], [aria-hidden='true'], [inert]") || e.matches("[inert]")) return !0;
|
|
45
42
|
let t = e.ownerDocument.defaultView?.getComputedStyle(e);
|
|
46
43
|
return t?.display === "none" || t?.visibility === "hidden" || t?.visibility === "collapse";
|
|
47
|
-
},
|
|
48
|
-
let t = Array.from(e.querySelectorAll(
|
|
49
|
-
let t =
|
|
44
|
+
}, C = (e, t) => e.matches(":disabled, [aria-disabled='true']") || t.matches(":disabled, [aria-disabled='true']") || !!e.closest("[aria-disabled='true']"), w = (e) => e.matches(P) ? e : e.querySelector(P), T = (e) => {
|
|
45
|
+
let t = Array.from(e.querySelectorAll(F)).flatMap((e) => S(e) ? [] : (e.matches(I) ? Array.from(e.querySelectorAll(P)).filter((t) => t.closest(F) === e) : (() => {
|
|
46
|
+
let t = w(e);
|
|
50
47
|
return t ? [t] : [];
|
|
51
|
-
})()).filter((e) => !
|
|
48
|
+
})()).filter((e) => !S(e)).map((t) => ({
|
|
52
49
|
container: e,
|
|
53
|
-
enabled: !
|
|
50
|
+
enabled: !C(t, e),
|
|
54
51
|
target: t
|
|
55
|
-
}))), n = Array.from(e.querySelectorAll(
|
|
52
|
+
}))), n = Array.from(e.querySelectorAll(P)).filter((e) => !e.closest(F)).filter((e) => !S(e)).map((e) => ({
|
|
56
53
|
container: e,
|
|
57
|
-
enabled: !
|
|
54
|
+
enabled: !C(e, e),
|
|
58
55
|
target: e
|
|
59
56
|
}));
|
|
60
57
|
return [...t, ...n].sort((e, t) => e.target === t.target ? 0 : e.target.compareDocumentPosition(t.target) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1);
|
|
61
58
|
}, E = () => {
|
|
62
|
-
let e =
|
|
59
|
+
let e = i.value;
|
|
63
60
|
if (!e) return;
|
|
64
|
-
let t = T(e), n =
|
|
61
|
+
let t = T(e), n = y.value ? [] : t.filter((e) => e.enabled), r = e.ownerDocument.activeElement, o = n.findIndex((e) => e.target === r || e.target.contains(r)), s = n.findIndex((e) => e.target === a.value), c = n[o >= 0 ? o : s >= 0 ? s : 0];
|
|
65
62
|
for (let e of t) {
|
|
66
63
|
let t = c && e.target === c.target ? "0" : "-1";
|
|
67
64
|
e.target.getAttribute("tabindex") !== t && e.target.setAttribute("tabindex", t);
|
|
68
65
|
}
|
|
69
|
-
|
|
66
|
+
a.value = c?.target ?? null;
|
|
70
67
|
}, D = (e) => {
|
|
71
68
|
let t = e.ownerDocument.defaultView?.getComputedStyle(e).direction;
|
|
72
69
|
return t === "rtl" || t === "ltr" ? t : e.closest("[dir]")?.getAttribute("dir") === "rtl" ? "rtl" : "ltr";
|
|
@@ -102,8 +99,8 @@ var C = Symbol("kappa-toolbar"), w = (e) => {
|
|
|
102
99
|
let i = t.min === "" ? 0 : Number(t.min), a = t.max === "" ? 100 : Number(t.max), o = D(t) === "rtl";
|
|
103
100
|
return e.key === "ArrowUp" || e.key === "ArrowRight" && !o || e.key === "ArrowLeft" && o ? r < a : r > i;
|
|
104
101
|
}, A = (e) => {
|
|
105
|
-
if (
|
|
106
|
-
let n = c.value === "horizontal", r = D(e.currentTarget) === "rtl",
|
|
102
|
+
if (y.value || e.altKey || e.ctrlKey || e.metaKey || !(e.currentTarget instanceof HTMLElement) || e.defaultPrevented) return;
|
|
103
|
+
let n = c.value === "horizontal", r = D(e.currentTarget) === "rtl", i = n ? r ? "ArrowLeft" : "ArrowRight" : "ArrowDown", o = n ? r ? "ArrowRight" : "ArrowLeft" : "ArrowUp", s = e.key === i, l = e.key === o, u = e.key === "Home", d = e.key === "End";
|
|
107
104
|
if (!s && !l && !u && !d || O(e, e.target) || k(e, e.target)) return;
|
|
108
105
|
let f = T(e.currentTarget).filter((e) => e.enabled);
|
|
109
106
|
if (f.length === 0 || !(e.target instanceof Node)) return;
|
|
@@ -111,17 +108,17 @@ var C = Symbol("kappa-toolbar"), w = (e) => {
|
|
|
111
108
|
if (p < 0) return;
|
|
112
109
|
let m = f.length - 1, h = p;
|
|
113
110
|
u ? h = 0 : d ? h = m : l ? h = t.loopFocus ? (p - 1 + f.length) % f.length : Math.max(0, p - 1) : s && (h = t.loopFocus ? (p + 1) % f.length : Math.min(m, p + 1)), e.preventDefault();
|
|
114
|
-
let
|
|
115
|
-
|
|
116
|
-
},
|
|
117
|
-
if (
|
|
118
|
-
let t =
|
|
111
|
+
let g = f[h]?.target;
|
|
112
|
+
g && (a.value = g, g.focus(), E());
|
|
113
|
+
}, L = (e) => {
|
|
114
|
+
if (y.value || !(e.target instanceof Node)) return;
|
|
115
|
+
let t = i.value;
|
|
119
116
|
if (!t) return;
|
|
120
117
|
let n = T(t).find((t) => t.target === e.target || t.target.contains(e.target));
|
|
121
|
-
n?.enabled && (
|
|
118
|
+
n?.enabled && (a.value = n.target, E());
|
|
122
119
|
};
|
|
123
|
-
return
|
|
124
|
-
E(), o = new MutationObserver(() => E()), o.observe(
|
|
120
|
+
return p(() => {
|
|
121
|
+
E(), o = new MutationObserver(() => E()), o.observe(i.value, {
|
|
125
122
|
attributes: !0,
|
|
126
123
|
attributeFilter: [
|
|
127
124
|
"aria-disabled",
|
|
@@ -135,79 +132,26 @@ var C = Symbol("kappa-toolbar"), w = (e) => {
|
|
|
135
132
|
],
|
|
136
133
|
childList: !0,
|
|
137
134
|
subtree: !0
|
|
138
|
-
}),
|
|
139
|
-
}),
|
|
135
|
+
}), f(E);
|
|
136
|
+
}), h(E), m(() => {
|
|
140
137
|
o?.disconnect();
|
|
141
|
-
}), (e, t) => (
|
|
138
|
+
}), (e, t) => (g(), l("div", d({
|
|
142
139
|
ref_key: "rootRef",
|
|
143
|
-
ref:
|
|
140
|
+
ref: i
|
|
144
141
|
}, e.$attrs, {
|
|
145
142
|
class: "kappa-toolbar",
|
|
146
143
|
"data-slot": "toolbar",
|
|
147
|
-
"data-disabled":
|
|
144
|
+
"data-disabled": y.value ? "" : void 0,
|
|
148
145
|
"data-orientation": c.value,
|
|
149
|
-
"data-size":
|
|
146
|
+
"data-size": u.value,
|
|
150
147
|
role: "toolbar",
|
|
151
|
-
"aria-disabled":
|
|
148
|
+
"aria-disabled": x.value,
|
|
152
149
|
"aria-orientation": c.value,
|
|
153
|
-
onFocusin:
|
|
150
|
+
onFocusin: L,
|
|
154
151
|
onKeydown: A
|
|
155
|
-
}), [v(e.$slots, "default")], 16,
|
|
152
|
+
}), [v(e.$slots, "default")], 16, N));
|
|
156
153
|
}
|
|
157
|
-
}),
|
|
158
|
-
inheritAttrs: !1,
|
|
159
|
-
__name: "ToolbarButton",
|
|
160
|
-
props: {
|
|
161
|
-
disabled: {
|
|
162
|
-
type: Boolean,
|
|
163
|
-
default: !1
|
|
164
|
-
},
|
|
165
|
-
loading: {
|
|
166
|
-
type: Boolean,
|
|
167
|
-
default: !1
|
|
168
|
-
},
|
|
169
|
-
type: { default: "button" },
|
|
170
|
-
shape: { default: void 0 },
|
|
171
|
-
icon: { default: void 0 },
|
|
172
|
-
iconProps: { default: void 0 },
|
|
173
|
-
iconPosition: {},
|
|
174
|
-
fullWidth: { type: Boolean },
|
|
175
|
-
title: {}
|
|
176
|
-
},
|
|
177
|
-
setup(t) {
|
|
178
|
-
let n = t, r = b(), i = x(), s = T(), c = a(() => s?.size.value ?? "base"), l = a(() => n.shape ?? (!i.default && n.icon ? "square" : "base")), d = a(() => n.loading || n.disabled || !!s?.disabled.value), f = a(() => Object.fromEntries(Object.entries(r).filter(([e]) => !["size", "variant"].includes(e))));
|
|
179
|
-
return (t, r) => (h(), o(y(e), u(f.value, {
|
|
180
|
-
class: "kappa-toolbar__item kappa-toolbar__button",
|
|
181
|
-
"data-kappa-component": "Toolbar.Button",
|
|
182
|
-
"data-kappa-toolbar-item": "",
|
|
183
|
-
disabled: d.value,
|
|
184
|
-
"full-width": n.fullWidth,
|
|
185
|
-
icon: n.icon,
|
|
186
|
-
"icon-position": n.iconPosition,
|
|
187
|
-
"icon-props": n.iconProps,
|
|
188
|
-
loading: n.loading,
|
|
189
|
-
shape: l.value,
|
|
190
|
-
size: c.value,
|
|
191
|
-
title: n.title,
|
|
192
|
-
type: n.type,
|
|
193
|
-
variant: "ghost"
|
|
194
|
-
}), {
|
|
195
|
-
default: S(() => [v(t.$slots, "default")]),
|
|
196
|
-
_: 3
|
|
197
|
-
}, 16, [
|
|
198
|
-
"disabled",
|
|
199
|
-
"full-width",
|
|
200
|
-
"icon",
|
|
201
|
-
"icon-position",
|
|
202
|
-
"icon-props",
|
|
203
|
-
"loading",
|
|
204
|
-
"shape",
|
|
205
|
-
"size",
|
|
206
|
-
"title",
|
|
207
|
-
"type"
|
|
208
|
-
]));
|
|
209
|
-
}
|
|
210
|
-
}), H = /* @__PURE__ */ c({
|
|
154
|
+
}), R = /* @__PURE__ */ u({
|
|
211
155
|
inheritAttrs: !1,
|
|
212
156
|
__name: "ToolbarInput",
|
|
213
157
|
props: {
|
|
@@ -226,20 +170,20 @@ var C = Symbol("kappa-toolbar"), w = (e) => {
|
|
|
226
170
|
}
|
|
227
171
|
},
|
|
228
172
|
emits: ["update:modelValue", "valueChange"],
|
|
229
|
-
setup(
|
|
230
|
-
let r =
|
|
231
|
-
|
|
173
|
+
setup(t, { emit: n }) {
|
|
174
|
+
let r = t, a = n, o = b(), l = e(), u = s(() => l?.size.value ?? "base"), f = s(() => r.disabled || !!l?.disabled.value), p = s(() => Object.fromEntries(Object.entries(o).filter(([e]) => e !== "size"))), m = (e) => {
|
|
175
|
+
a("update:modelValue", e), a("valueChange", e);
|
|
232
176
|
};
|
|
233
|
-
return (e, t) => (
|
|
177
|
+
return (e, t) => (g(), c(y(i), d(p.value, {
|
|
234
178
|
class: "kappa-toolbar__item kappa-toolbar__input",
|
|
235
179
|
"data-kappa-component": "Toolbar.Input",
|
|
236
180
|
"data-kappa-toolbar-item": "",
|
|
237
|
-
disabled:
|
|
181
|
+
disabled: f.value,
|
|
238
182
|
invalid: r.invalid,
|
|
239
183
|
"model-value": r.modelValue,
|
|
240
184
|
"password-manager-ignore": r.passwordManagerIgnore,
|
|
241
|
-
size:
|
|
242
|
-
"onUpdate:modelValue":
|
|
185
|
+
size: u.value,
|
|
186
|
+
"onUpdate:modelValue": m
|
|
243
187
|
}), null, 16, [
|
|
244
188
|
"disabled",
|
|
245
189
|
"invalid",
|
|
@@ -248,7 +192,7 @@ var C = Symbol("kappa-toolbar"), w = (e) => {
|
|
|
248
192
|
"size"
|
|
249
193
|
]));
|
|
250
194
|
}
|
|
251
|
-
}),
|
|
195
|
+
}), z = /* @__PURE__ */ u({
|
|
252
196
|
inheritAttrs: !1,
|
|
253
197
|
__name: "ToolbarInputGroup",
|
|
254
198
|
props: {
|
|
@@ -261,16 +205,16 @@ var C = Symbol("kappa-toolbar"), w = (e) => {
|
|
|
261
205
|
default: !1
|
|
262
206
|
}
|
|
263
207
|
},
|
|
264
|
-
setup(
|
|
265
|
-
let
|
|
266
|
-
return (e,
|
|
208
|
+
setup(t) {
|
|
209
|
+
let n = t, r = b(), i = e(), o = s(() => i?.size.value ?? "base"), l = s(() => n.disabled || !!i?.disabled.value), u = s(() => Object.fromEntries(Object.entries(r).filter(([e]) => e !== "size")));
|
|
210
|
+
return (e, t) => (g(), c(y(a), d(u.value, {
|
|
267
211
|
class: "kappa-toolbar__item kappa-toolbar__input-group",
|
|
268
212
|
"data-kappa-component": "Toolbar.InputGroup",
|
|
269
213
|
"data-kappa-toolbar-item": "",
|
|
270
214
|
"data-kappa-toolbar-input-group": "",
|
|
271
|
-
disabled:
|
|
272
|
-
invalid:
|
|
273
|
-
size:
|
|
215
|
+
disabled: l.value,
|
|
216
|
+
invalid: n.invalid,
|
|
217
|
+
size: o.value
|
|
274
218
|
}), {
|
|
275
219
|
default: S(() => [v(e.$slots, "default")]),
|
|
276
220
|
_: 3
|
|
@@ -280,7 +224,7 @@ var C = Symbol("kappa-toolbar"), w = (e) => {
|
|
|
280
224
|
"size"
|
|
281
225
|
]));
|
|
282
226
|
}
|
|
283
|
-
}),
|
|
227
|
+
}), B = /* @__PURE__ */ u({
|
|
284
228
|
inheritAttrs: !1,
|
|
285
229
|
__name: "ToolbarLink",
|
|
286
230
|
props: {
|
|
@@ -304,23 +248,23 @@ var C = Symbol("kappa-toolbar"), w = (e) => {
|
|
|
304
248
|
fullWidth: { type: Boolean },
|
|
305
249
|
title: { default: void 0 }
|
|
306
250
|
},
|
|
307
|
-
setup(
|
|
308
|
-
let
|
|
309
|
-
return (e,
|
|
251
|
+
setup(n) {
|
|
252
|
+
let r = n, i = b(), a = x(), o = e(), l = s(() => o?.size.value ?? "base"), u = s(() => r.shape ?? (!a.default && r.icon ? "square" : "base")), f = s(() => Object.fromEntries(Object.entries(i).filter(([e]) => !["size", "variant"].includes(e)))), p = s(() => r.disabled || !!o?.disabled.value);
|
|
253
|
+
return (e, n) => (g(), c(y(t), d(f.value, {
|
|
310
254
|
class: "kappa-toolbar__item kappa-toolbar__button kappa-toolbar__link",
|
|
311
255
|
"data-kappa-component": "Toolbar.Link",
|
|
312
256
|
"data-kappa-toolbar-item": "",
|
|
313
|
-
"as-child":
|
|
314
|
-
disabled:
|
|
315
|
-
external:
|
|
316
|
-
"full-width":
|
|
317
|
-
href:
|
|
318
|
-
icon:
|
|
319
|
-
"icon-position":
|
|
320
|
-
"icon-props":
|
|
321
|
-
shape:
|
|
322
|
-
size:
|
|
323
|
-
title:
|
|
257
|
+
"as-child": r.asChild,
|
|
258
|
+
disabled: p.value,
|
|
259
|
+
external: r.external,
|
|
260
|
+
"full-width": r.fullWidth,
|
|
261
|
+
href: r.href,
|
|
262
|
+
icon: r.icon,
|
|
263
|
+
"icon-position": r.iconPosition,
|
|
264
|
+
"icon-props": r.iconProps,
|
|
265
|
+
shape: u.value,
|
|
266
|
+
size: l.value,
|
|
267
|
+
title: r.title,
|
|
324
268
|
variant: "ghost"
|
|
325
269
|
}), {
|
|
326
270
|
default: S(() => [v(e.$slots, "default")]),
|
|
@@ -339,7 +283,7 @@ var C = Symbol("kappa-toolbar"), w = (e) => {
|
|
|
339
283
|
"title"
|
|
340
284
|
]));
|
|
341
285
|
}
|
|
342
|
-
}),
|
|
286
|
+
}), V = /* @__PURE__ */ u({
|
|
343
287
|
inheritAttrs: !1,
|
|
344
288
|
__name: "ToolbarSeparator",
|
|
345
289
|
props: {
|
|
@@ -349,24 +293,24 @@ var C = Symbol("kappa-toolbar"), w = (e) => {
|
|
|
349
293
|
default: !0
|
|
350
294
|
}
|
|
351
295
|
},
|
|
352
|
-
setup(
|
|
353
|
-
let
|
|
354
|
-
return (e,
|
|
296
|
+
setup(t) {
|
|
297
|
+
let n = t, r = e(), i = s(() => n.orientation ?? (r?.orientation.value === "vertical" ? "horizontal" : "vertical"));
|
|
298
|
+
return (e, t) => (g(), c(y(o), d(e.$attrs, {
|
|
355
299
|
class: "kappa-toolbar__separator",
|
|
356
300
|
"data-kappa-component": "Toolbar.Separator",
|
|
357
|
-
decorative:
|
|
358
|
-
orientation:
|
|
301
|
+
decorative: n.decorative,
|
|
302
|
+
orientation: i.value
|
|
359
303
|
}), null, 16, ["decorative", "orientation"]));
|
|
360
304
|
}
|
|
361
|
-
}),
|
|
362
|
-
Root:
|
|
363
|
-
Button:
|
|
364
|
-
Link:
|
|
365
|
-
Input:
|
|
366
|
-
InputGroup:
|
|
367
|
-
Separator:
|
|
305
|
+
}), H = Object.assign(L, {
|
|
306
|
+
Root: L,
|
|
307
|
+
Button: n,
|
|
308
|
+
Link: B,
|
|
309
|
+
Input: R,
|
|
310
|
+
InputGroup: z,
|
|
311
|
+
Separator: V
|
|
368
312
|
});
|
|
369
313
|
//#endregion
|
|
370
|
-
export {
|
|
314
|
+
export { R as a, T as c, w as d, k as f, M as h, z as i, E as l, j as m, V as n, L as o, A as p, B as r, D as s, H as t, C as u };
|
|
371
315
|
|
|
372
|
-
//# sourceMappingURL=toolbar-
|
|
316
|
+
//# sourceMappingURL=toolbar-DJsnox8t.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar-DJsnox8t.js","names":["$attrs","$attrs"],"sources":["../src/components/toolbar/toolbar.ts","../src/components/toolbar/Toolbar.vue","../src/components/toolbar/Toolbar.vue","../src/components/toolbar/ToolbarInput.vue","../src/components/toolbar/ToolbarInput.vue","../src/components/toolbar/ToolbarInputGroup.vue","../src/components/toolbar/ToolbarInputGroup.vue","../src/components/toolbar/ToolbarLink.vue","../src/components/toolbar/ToolbarLink.vue","../src/components/toolbar/ToolbarSeparator.vue","../src/components/toolbar/ToolbarSeparator.vue","../src/components/toolbar/index.ts"],"sourcesContent":["import type { ButtonSlots, LinkButtonProps } from \"../button/button\";\nexport type { ToolbarButtonProps, ToolbarButtonSlots } from \"../button/toolbar-button\";\nimport type {\n InputGroupRootProps,\n InputGroupSlots,\n} from \"../input-group/input-group\";\nimport type { InputProps } from \"../input/input\";\nimport type { SeparatorProps } from \"../separator/separator\";\nimport type { HTMLAttributes, VNodeChild } from \"vue\";\n\nexport const TOOLBAR_ORIENTATIONS = [\"horizontal\", \"vertical\"] as const;\nexport const TOOLBAR_SIZES = [\"xs\", \"sm\", \"base\", \"lg\"] as const;\n\nexport type ToolbarOrientation = (typeof TOOLBAR_ORIENTATIONS)[number];\nexport type ToolbarSize = (typeof TOOLBAR_SIZES)[number];\n\nexport const TOOLBAR_DEFAULT_ORIENTATION =\n \"horizontal\" satisfies ToolbarOrientation;\nexport const TOOLBAR_DEFAULT_SIZE = \"base\" satisfies ToolbarSize;\nexport const TOOLBAR_DEFAULT_LOOP_FOCUS = true;\n\nconst includesOwn = <T extends string>(\n values: readonly T[],\n value: unknown,\n): value is T => typeof value === \"string\" && values.includes(value as T);\n\nexport const isToolbarOrientation = (\n value: unknown,\n): value is ToolbarOrientation => includesOwn(TOOLBAR_ORIENTATIONS, value);\n\nexport const isToolbarSize = (value: unknown): value is ToolbarSize =>\n includesOwn(TOOLBAR_SIZES, value);\n\nexport const resolveToolbarOrientation = (\n value: unknown,\n): ToolbarOrientation =>\n isToolbarOrientation(value) ? value : TOOLBAR_DEFAULT_ORIENTATION;\n\nexport const resolveToolbarSize = (value: unknown): ToolbarSize =>\n isToolbarSize(value) ? value : TOOLBAR_DEFAULT_SIZE;\n\nexport interface ToolbarRootProps\n extends /* @vue-ignore */ Omit<HTMLAttributes, \"role\"> {\n /** Layout axis used by arrow-key navigation. */\n orientation?: ToolbarOrientation;\n /** Shared density for supported toolbar controls. */\n size?: ToolbarSize;\n /** Disable navigation and mark the toolbar unavailable. */\n disabled?: boolean;\n /** Whether arrow navigation wraps from the last item to the first. */\n loopFocus?: boolean;\n}\n\nexport type ToolbarProps = ToolbarRootProps;\n\nexport interface ToolbarSlots {\n default?: () => VNodeChild;\n}\n\nexport interface ToolbarLinkProps\n extends Omit<LinkButtonProps, \"size\" | \"variant\"> {}\n\nexport type ToolbarLinkSlots = ButtonSlots;\n\nexport type ToolbarInputProps = Omit<InputProps, \"size\">;\n\n/** Props consumed by Toolbar.Input; other input attributes remain in `$attrs`. */\nexport interface ToolbarInputComponentProps {\n disabled?: boolean;\n invalid?: boolean;\n modelValue?: string | number;\n passwordManagerIgnore?: boolean;\n}\n\nexport type ToolbarInputEmits = {\n \"update:modelValue\": [value: string];\n valueChange: [value: string];\n};\n\nexport interface ToolbarInputSlots {}\n\nexport type ToolbarInputGroupProps = Omit<InputGroupRootProps, \"size\">;\n\nexport type ToolbarInputGroupSlots = InputGroupSlots;\nexport type ToolbarSeparatorProps = SeparatorProps;\n\nexport interface ToolbarSeparatorSlots {}\n","<script setup lang=\"ts\">\nimport {\n computed,\n nextTick,\n onMounted,\n onUnmounted,\n onUpdated,\n ref,\n useAttrs,\n} from \"vue\";\nimport { provideToolbarContext } from \"./context\";\nimport {\n TOOLBAR_DEFAULT_LOOP_FOCUS,\n TOOLBAR_DEFAULT_ORIENTATION,\n TOOLBAR_DEFAULT_SIZE,\n resolveToolbarOrientation,\n resolveToolbarSize,\n type ToolbarProps,\n type ToolbarSlots,\n} from \"./toolbar\";\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = withDefaults(defineProps<ToolbarProps>(), {\n disabled: false,\n loopFocus: TOOLBAR_DEFAULT_LOOP_FOCUS,\n orientation: TOOLBAR_DEFAULT_ORIENTATION,\n size: TOOLBAR_DEFAULT_SIZE,\n});\n\ndefineSlots<ToolbarSlots>();\n\nconst attrs = useAttrs();\nconst rootRef = ref<HTMLElement | null>(null);\nconst rovingTarget = ref<HTMLElement | null>(null);\nlet childObserver: MutationObserver | undefined;\n\nconst resolvedOrientation = computed(() =>\n resolveToolbarOrientation(props.orientation),\n);\nconst resolvedSize = computed(() => resolveToolbarSize(props.size));\nconst resolvedDisabled = computed(\n () =>\n props.disabled ||\n attrs[\"aria-disabled\"] === true ||\n attrs[\"aria-disabled\"] === \"true\",\n);\nconst resolvedAriaDisabled = computed(() =>\n resolvedDisabled.value\n ? \"true\"\n : attrs[\"aria-disabled\"] === false || attrs[\"aria-disabled\"] === \"false\"\n ? \"false\"\n : undefined,\n);\n\nprovideToolbarContext({\n disabled: resolvedDisabled,\n orientation: resolvedOrientation,\n size: resolvedSize,\n});\n\nconst focusableSelector = 'button, input, select, textarea, a[href], [tabindex]';\nconst toolbarItemSelector = \"[data-kappa-toolbar-item]\";\nconst toolbarInputGroupSelector = \"[data-kappa-toolbar-input-group]\";\n\ntype ToolbarEntry = {\n container: HTMLElement;\n enabled: boolean;\n target: HTMLElement;\n};\n\nconst isHidden = (element: HTMLElement) => {\n if (\n element.hidden ||\n Boolean(\n element.closest(\"[hidden], [aria-hidden='true'], [inert]\") ||\n element.matches(\"[inert]\"),\n )\n ) {\n return true;\n }\n\n const style = element.ownerDocument.defaultView?.getComputedStyle(element);\n return style?.display === \"none\" ||\n style?.visibility === \"hidden\" ||\n style?.visibility === \"collapse\";\n};\n\nconst isDisabled = (element: HTMLElement, container: HTMLElement) =>\n element.matches(\":disabled, [aria-disabled='true']\") ||\n container.matches(\":disabled, [aria-disabled='true']\") ||\n Boolean(element.closest(\"[aria-disabled='true']\"));\n\nconst targetFor = (container: HTMLElement) => {\n if (container.matches(focusableSelector)) return container;\n return container.querySelector<HTMLElement>(focusableSelector);\n};\n\nconst getEntries = (root: HTMLElement): ToolbarEntry[] => {\n const marked = Array.from(\n root.querySelectorAll<HTMLElement>(toolbarItemSelector),\n );\n const entries = marked.flatMap((container) => {\n if (isHidden(container)) return [];\n const targets = container.matches(toolbarInputGroupSelector)\n ? Array.from(container.querySelectorAll<HTMLElement>(focusableSelector)).filter(\n (target) => target.closest(toolbarItemSelector) === container,\n )\n : (() => {\n const target = targetFor(container);\n return target ? [target] : [];\n })();\n\n return targets\n .filter((target) => !isHidden(target))\n .map((target) => ({\n container,\n enabled: !isDisabled(target, container),\n target,\n }));\n });\n\n // A native control can still participate when a consumer composes one\n // directly inside Root. Marked non-group parts remain one toolbar item.\n const unmarked = Array.from(\n root.querySelectorAll<HTMLElement>(focusableSelector),\n )\n .filter((target) => !target.closest(toolbarItemSelector))\n .filter((target) => !isHidden(target))\n .map((target) => ({\n container: target,\n enabled: !isDisabled(target, target),\n target,\n }));\n\n return [...entries, ...unmarked].sort((left, right) => {\n if (left.target === right.target) return 0;\n return left.target.compareDocumentPosition(right.target) &\n Node.DOCUMENT_POSITION_FOLLOWING\n ? -1\n : 1;\n });\n};\n\nconst syncTabStops = () => {\n const root = rootRef.value;\n if (!root) return;\n\n const entries = getEntries(root);\n const enabled = resolvedDisabled.value ? [] : entries.filter((entry) => entry.enabled);\n const activeElement = root.ownerDocument.activeElement;\n const focusedIndex = enabled.findIndex(\n (entry) =>\n entry.target === activeElement || entry.target.contains(activeElement),\n );\n const rovingIndex = enabled.findIndex(\n (entry) => entry.target === rovingTarget.value,\n );\n const selected = enabled[focusedIndex >= 0 ? focusedIndex : rovingIndex >= 0 ? rovingIndex : 0];\n\n for (const entry of entries) {\n const tabindex = selected && entry.target === selected.target ? \"0\" : \"-1\";\n if (entry.target.getAttribute(\"tabindex\") !== tabindex) {\n entry.target.setAttribute(\"tabindex\", tabindex);\n }\n }\n rovingTarget.value = selected?.target ?? null;\n};\n\nconst getDirection = (element: HTMLElement) => {\n const computedDirection = element.ownerDocument.defaultView?.getComputedStyle(\n element,\n ).direction;\n if (computedDirection === \"rtl\" || computedDirection === \"ltr\") {\n return computedDirection;\n }\n return element.closest<HTMLElement>(\"[dir]\")?.getAttribute(\"dir\") === \"rtl\"\n ? \"rtl\"\n : \"ltr\";\n};\n\nconst shouldKeepTextCursor = (event: KeyboardEvent, target: EventTarget | null) => {\n if (!(target instanceof HTMLTextAreaElement || target instanceof HTMLInputElement)) {\n return false;\n }\n\n const selectionStart = target.selectionStart;\n const selectionEnd = target.selectionEnd;\n if (selectionStart === null || selectionEnd === null) return false;\n const hasSelection = selectionStart !== selectionEnd;\n if (hasSelection) return true;\n\n const direction = getDirection(target);\n const value = target.value;\n const lineStart = target instanceof HTMLTextAreaElement\n ? value.lastIndexOf(\"\\n\", selectionStart - 1) + 1\n : 0;\n const lineBreak = target instanceof HTMLTextAreaElement\n ? value.indexOf(\"\\n\", selectionStart)\n : -1;\n const lineEnd = lineBreak === -1 ? value.length : lineBreak;\n\n if (event.key === \"ArrowLeft\") {\n return direction === \"rtl\" ? selectionEnd < lineEnd : selectionStart > lineStart;\n }\n if (event.key === \"ArrowRight\") {\n return direction === \"rtl\" ? selectionStart > lineStart : selectionEnd < lineEnd;\n }\n if (event.key === \"ArrowUp\") {\n return target instanceof HTMLTextAreaElement && lineStart > 0;\n }\n if (event.key === \"ArrowDown\") {\n return target instanceof HTMLTextAreaElement && lineEnd < value.length;\n }\n if (event.key === \"Home\") return selectionStart > lineStart;\n if (event.key === \"End\") return selectionEnd < lineEnd;\n return false;\n};\n\nconst shouldKeepNativeArrowKey = (\n event: KeyboardEvent,\n target: EventTarget | null,\n) => {\n if (target instanceof HTMLSelectElement) {\n if (![\"ArrowUp\", \"ArrowDown\"].includes(event.key)) return false;\n const selectedIndex = target.selectedIndex;\n if (selectedIndex < 0) return true;\n return event.key === \"ArrowUp\"\n ? selectedIndex > 0\n : selectedIndex < target.options.length - 1;\n }\n\n if (!(target instanceof HTMLInputElement)) return false;\n const inputType = target.type.toLowerCase();\n if (![\"number\", \"range\"].includes(inputType)) return false;\n\n const value = target.valueAsNumber;\n if (Number.isNaN(value)) return true;\n\n if (inputType === \"number\") {\n if (![\"ArrowUp\", \"ArrowDown\"].includes(event.key)) return false;\n const step = target.step === \"any\" ? 1 : Number(target.step) || 1;\n const nextValue = event.key === \"ArrowUp\" ? value + step : value - step;\n const min = target.min === \"\" ? undefined : Number(target.min);\n const max = target.max === \"\" ? undefined : Number(target.max);\n return (min === undefined || nextValue >= min) &&\n (max === undefined || nextValue <= max);\n }\n\n if (![\"ArrowLeft\", \"ArrowRight\", \"ArrowUp\", \"ArrowDown\"].includes(event.key)) {\n return false;\n }\n const min = target.min === \"\" ? 0 : Number(target.min);\n const max = target.max === \"\" ? 100 : Number(target.max);\n const isRtl = getDirection(target) === \"rtl\";\n const increases = event.key === \"ArrowUp\" ||\n (event.key === \"ArrowRight\" && !isRtl) ||\n (event.key === \"ArrowLeft\" && isRtl);\n return increases ? value < max : value > min;\n};\n\nconst handleKeydown = (event: KeyboardEvent) => {\n if (resolvedDisabled.value || event.altKey || event.ctrlKey || event.metaKey) return;\n if (!(event.currentTarget instanceof HTMLElement)) return;\n if (event.defaultPrevented) return;\n\n const isHorizontal = resolvedOrientation.value === \"horizontal\";\n const isRtl = getDirection(event.currentTarget) === \"rtl\";\n const forwardKey = isHorizontal\n ? isRtl\n ? \"ArrowLeft\"\n : \"ArrowRight\"\n : \"ArrowDown\";\n const backwardKey = isHorizontal\n ? isRtl\n ? \"ArrowRight\"\n : \"ArrowLeft\"\n : \"ArrowUp\";\n const isForward = event.key === forwardKey;\n const isBackward = event.key === backwardKey;\n const isHome = event.key === \"Home\";\n const isEnd = event.key === \"End\";\n\n if (!isForward && !isBackward && !isHome && !isEnd) return;\n if (\n shouldKeepTextCursor(event, event.target) ||\n shouldKeepNativeArrowKey(event, event.target)\n ) {\n return;\n }\n\n const enabled = getEntries(event.currentTarget).filter(\n (entry) => entry.enabled,\n );\n if (enabled.length === 0 || !(event.target instanceof Node)) return;\n\n const currentIndex = enabled.findIndex(\n (entry) =>\n entry.target === event.target || entry.target.contains(event.target as Node),\n );\n if (currentIndex < 0) return;\n\n const lastIndex = enabled.length - 1;\n let nextIndex = currentIndex;\n if (isHome) nextIndex = 0;\n else if (isEnd) nextIndex = lastIndex;\n else if (isBackward) {\n nextIndex = props.loopFocus\n ? (currentIndex - 1 + enabled.length) % enabled.length\n : Math.max(0, currentIndex - 1);\n } else if (isForward) {\n nextIndex = props.loopFocus\n ? (currentIndex + 1) % enabled.length\n : Math.min(lastIndex, currentIndex + 1);\n }\n\n event.preventDefault();\n const nextTarget = enabled[nextIndex]?.target;\n if (!nextTarget) return;\n rovingTarget.value = nextTarget;\n nextTarget.focus();\n syncTabStops();\n};\n\nconst handleFocusin = (event: FocusEvent) => {\n if (resolvedDisabled.value || !(event.target instanceof Node)) return;\n const root = rootRef.value;\n if (!root) return;\n const entry = getEntries(root).find((candidate) =>\n candidate.target === event.target || candidate.target.contains(event.target as Node),\n );\n if (!entry?.enabled) return;\n rovingTarget.value = entry.target;\n syncTabStops();\n};\n\nonMounted(() => {\n syncTabStops();\n childObserver = new MutationObserver(() => syncTabStops());\n childObserver.observe(rootRef.value as Node, {\n attributes: true,\n attributeFilter: [\n \"aria-disabled\",\n \"aria-hidden\",\n \"class\",\n \"disabled\",\n \"hidden\",\n \"inert\",\n \"style\",\n \"tabindex\",\n ],\n childList: true,\n subtree: true,\n });\n void nextTick(syncTabStops);\n});\n\nonUpdated(syncTabStops);\n\nonUnmounted(() => {\n childObserver?.disconnect();\n});\n</script>\n\n<template>\n <div\n ref=\"rootRef\"\n v-bind=\"$attrs\"\n class=\"kappa-toolbar\"\n data-slot=\"toolbar\"\n :data-disabled=\"resolvedDisabled ? '' : undefined\"\n :data-orientation=\"resolvedOrientation\"\n :data-size=\"resolvedSize\"\n role=\"toolbar\"\n :aria-disabled=\"resolvedAriaDisabled\"\n :aria-orientation=\"resolvedOrientation\"\n @focusin=\"handleFocusin\"\n @keydown=\"handleKeydown\"\n >\n <slot />\n </div>\n</template>\n\n<style src=\"./toolbar.css\"></style>\n","<script setup lang=\"ts\">\nimport {\n computed,\n nextTick,\n onMounted,\n onUnmounted,\n onUpdated,\n ref,\n useAttrs,\n} from \"vue\";\nimport { provideToolbarContext } from \"./context\";\nimport {\n TOOLBAR_DEFAULT_LOOP_FOCUS,\n TOOLBAR_DEFAULT_ORIENTATION,\n TOOLBAR_DEFAULT_SIZE,\n resolveToolbarOrientation,\n resolveToolbarSize,\n type ToolbarProps,\n type ToolbarSlots,\n} from \"./toolbar\";\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = withDefaults(defineProps<ToolbarProps>(), {\n disabled: false,\n loopFocus: TOOLBAR_DEFAULT_LOOP_FOCUS,\n orientation: TOOLBAR_DEFAULT_ORIENTATION,\n size: TOOLBAR_DEFAULT_SIZE,\n});\n\ndefineSlots<ToolbarSlots>();\n\nconst attrs = useAttrs();\nconst rootRef = ref<HTMLElement | null>(null);\nconst rovingTarget = ref<HTMLElement | null>(null);\nlet childObserver: MutationObserver | undefined;\n\nconst resolvedOrientation = computed(() =>\n resolveToolbarOrientation(props.orientation),\n);\nconst resolvedSize = computed(() => resolveToolbarSize(props.size));\nconst resolvedDisabled = computed(\n () =>\n props.disabled ||\n attrs[\"aria-disabled\"] === true ||\n attrs[\"aria-disabled\"] === \"true\",\n);\nconst resolvedAriaDisabled = computed(() =>\n resolvedDisabled.value\n ? \"true\"\n : attrs[\"aria-disabled\"] === false || attrs[\"aria-disabled\"] === \"false\"\n ? \"false\"\n : undefined,\n);\n\nprovideToolbarContext({\n disabled: resolvedDisabled,\n orientation: resolvedOrientation,\n size: resolvedSize,\n});\n\nconst focusableSelector = 'button, input, select, textarea, a[href], [tabindex]';\nconst toolbarItemSelector = \"[data-kappa-toolbar-item]\";\nconst toolbarInputGroupSelector = \"[data-kappa-toolbar-input-group]\";\n\ntype ToolbarEntry = {\n container: HTMLElement;\n enabled: boolean;\n target: HTMLElement;\n};\n\nconst isHidden = (element: HTMLElement) => {\n if (\n element.hidden ||\n Boolean(\n element.closest(\"[hidden], [aria-hidden='true'], [inert]\") ||\n element.matches(\"[inert]\"),\n )\n ) {\n return true;\n }\n\n const style = element.ownerDocument.defaultView?.getComputedStyle(element);\n return style?.display === \"none\" ||\n style?.visibility === \"hidden\" ||\n style?.visibility === \"collapse\";\n};\n\nconst isDisabled = (element: HTMLElement, container: HTMLElement) =>\n element.matches(\":disabled, [aria-disabled='true']\") ||\n container.matches(\":disabled, [aria-disabled='true']\") ||\n Boolean(element.closest(\"[aria-disabled='true']\"));\n\nconst targetFor = (container: HTMLElement) => {\n if (container.matches(focusableSelector)) return container;\n return container.querySelector<HTMLElement>(focusableSelector);\n};\n\nconst getEntries = (root: HTMLElement): ToolbarEntry[] => {\n const marked = Array.from(\n root.querySelectorAll<HTMLElement>(toolbarItemSelector),\n );\n const entries = marked.flatMap((container) => {\n if (isHidden(container)) return [];\n const targets = container.matches(toolbarInputGroupSelector)\n ? Array.from(container.querySelectorAll<HTMLElement>(focusableSelector)).filter(\n (target) => target.closest(toolbarItemSelector) === container,\n )\n : (() => {\n const target = targetFor(container);\n return target ? [target] : [];\n })();\n\n return targets\n .filter((target) => !isHidden(target))\n .map((target) => ({\n container,\n enabled: !isDisabled(target, container),\n target,\n }));\n });\n\n // A native control can still participate when a consumer composes one\n // directly inside Root. Marked non-group parts remain one toolbar item.\n const unmarked = Array.from(\n root.querySelectorAll<HTMLElement>(focusableSelector),\n )\n .filter((target) => !target.closest(toolbarItemSelector))\n .filter((target) => !isHidden(target))\n .map((target) => ({\n container: target,\n enabled: !isDisabled(target, target),\n target,\n }));\n\n return [...entries, ...unmarked].sort((left, right) => {\n if (left.target === right.target) return 0;\n return left.target.compareDocumentPosition(right.target) &\n Node.DOCUMENT_POSITION_FOLLOWING\n ? -1\n : 1;\n });\n};\n\nconst syncTabStops = () => {\n const root = rootRef.value;\n if (!root) return;\n\n const entries = getEntries(root);\n const enabled = resolvedDisabled.value ? [] : entries.filter((entry) => entry.enabled);\n const activeElement = root.ownerDocument.activeElement;\n const focusedIndex = enabled.findIndex(\n (entry) =>\n entry.target === activeElement || entry.target.contains(activeElement),\n );\n const rovingIndex = enabled.findIndex(\n (entry) => entry.target === rovingTarget.value,\n );\n const selected = enabled[focusedIndex >= 0 ? focusedIndex : rovingIndex >= 0 ? rovingIndex : 0];\n\n for (const entry of entries) {\n const tabindex = selected && entry.target === selected.target ? \"0\" : \"-1\";\n if (entry.target.getAttribute(\"tabindex\") !== tabindex) {\n entry.target.setAttribute(\"tabindex\", tabindex);\n }\n }\n rovingTarget.value = selected?.target ?? null;\n};\n\nconst getDirection = (element: HTMLElement) => {\n const computedDirection = element.ownerDocument.defaultView?.getComputedStyle(\n element,\n ).direction;\n if (computedDirection === \"rtl\" || computedDirection === \"ltr\") {\n return computedDirection;\n }\n return element.closest<HTMLElement>(\"[dir]\")?.getAttribute(\"dir\") === \"rtl\"\n ? \"rtl\"\n : \"ltr\";\n};\n\nconst shouldKeepTextCursor = (event: KeyboardEvent, target: EventTarget | null) => {\n if (!(target instanceof HTMLTextAreaElement || target instanceof HTMLInputElement)) {\n return false;\n }\n\n const selectionStart = target.selectionStart;\n const selectionEnd = target.selectionEnd;\n if (selectionStart === null || selectionEnd === null) return false;\n const hasSelection = selectionStart !== selectionEnd;\n if (hasSelection) return true;\n\n const direction = getDirection(target);\n const value = target.value;\n const lineStart = target instanceof HTMLTextAreaElement\n ? value.lastIndexOf(\"\\n\", selectionStart - 1) + 1\n : 0;\n const lineBreak = target instanceof HTMLTextAreaElement\n ? value.indexOf(\"\\n\", selectionStart)\n : -1;\n const lineEnd = lineBreak === -1 ? value.length : lineBreak;\n\n if (event.key === \"ArrowLeft\") {\n return direction === \"rtl\" ? selectionEnd < lineEnd : selectionStart > lineStart;\n }\n if (event.key === \"ArrowRight\") {\n return direction === \"rtl\" ? selectionStart > lineStart : selectionEnd < lineEnd;\n }\n if (event.key === \"ArrowUp\") {\n return target instanceof HTMLTextAreaElement && lineStart > 0;\n }\n if (event.key === \"ArrowDown\") {\n return target instanceof HTMLTextAreaElement && lineEnd < value.length;\n }\n if (event.key === \"Home\") return selectionStart > lineStart;\n if (event.key === \"End\") return selectionEnd < lineEnd;\n return false;\n};\n\nconst shouldKeepNativeArrowKey = (\n event: KeyboardEvent,\n target: EventTarget | null,\n) => {\n if (target instanceof HTMLSelectElement) {\n if (![\"ArrowUp\", \"ArrowDown\"].includes(event.key)) return false;\n const selectedIndex = target.selectedIndex;\n if (selectedIndex < 0) return true;\n return event.key === \"ArrowUp\"\n ? selectedIndex > 0\n : selectedIndex < target.options.length - 1;\n }\n\n if (!(target instanceof HTMLInputElement)) return false;\n const inputType = target.type.toLowerCase();\n if (![\"number\", \"range\"].includes(inputType)) return false;\n\n const value = target.valueAsNumber;\n if (Number.isNaN(value)) return true;\n\n if (inputType === \"number\") {\n if (![\"ArrowUp\", \"ArrowDown\"].includes(event.key)) return false;\n const step = target.step === \"any\" ? 1 : Number(target.step) || 1;\n const nextValue = event.key === \"ArrowUp\" ? value + step : value - step;\n const min = target.min === \"\" ? undefined : Number(target.min);\n const max = target.max === \"\" ? undefined : Number(target.max);\n return (min === undefined || nextValue >= min) &&\n (max === undefined || nextValue <= max);\n }\n\n if (![\"ArrowLeft\", \"ArrowRight\", \"ArrowUp\", \"ArrowDown\"].includes(event.key)) {\n return false;\n }\n const min = target.min === \"\" ? 0 : Number(target.min);\n const max = target.max === \"\" ? 100 : Number(target.max);\n const isRtl = getDirection(target) === \"rtl\";\n const increases = event.key === \"ArrowUp\" ||\n (event.key === \"ArrowRight\" && !isRtl) ||\n (event.key === \"ArrowLeft\" && isRtl);\n return increases ? value < max : value > min;\n};\n\nconst handleKeydown = (event: KeyboardEvent) => {\n if (resolvedDisabled.value || event.altKey || event.ctrlKey || event.metaKey) return;\n if (!(event.currentTarget instanceof HTMLElement)) return;\n if (event.defaultPrevented) return;\n\n const isHorizontal = resolvedOrientation.value === \"horizontal\";\n const isRtl = getDirection(event.currentTarget) === \"rtl\";\n const forwardKey = isHorizontal\n ? isRtl\n ? \"ArrowLeft\"\n : \"ArrowRight\"\n : \"ArrowDown\";\n const backwardKey = isHorizontal\n ? isRtl\n ? \"ArrowRight\"\n : \"ArrowLeft\"\n : \"ArrowUp\";\n const isForward = event.key === forwardKey;\n const isBackward = event.key === backwardKey;\n const isHome = event.key === \"Home\";\n const isEnd = event.key === \"End\";\n\n if (!isForward && !isBackward && !isHome && !isEnd) return;\n if (\n shouldKeepTextCursor(event, event.target) ||\n shouldKeepNativeArrowKey(event, event.target)\n ) {\n return;\n }\n\n const enabled = getEntries(event.currentTarget).filter(\n (entry) => entry.enabled,\n );\n if (enabled.length === 0 || !(event.target instanceof Node)) return;\n\n const currentIndex = enabled.findIndex(\n (entry) =>\n entry.target === event.target || entry.target.contains(event.target as Node),\n );\n if (currentIndex < 0) return;\n\n const lastIndex = enabled.length - 1;\n let nextIndex = currentIndex;\n if (isHome) nextIndex = 0;\n else if (isEnd) nextIndex = lastIndex;\n else if (isBackward) {\n nextIndex = props.loopFocus\n ? (currentIndex - 1 + enabled.length) % enabled.length\n : Math.max(0, currentIndex - 1);\n } else if (isForward) {\n nextIndex = props.loopFocus\n ? (currentIndex + 1) % enabled.length\n : Math.min(lastIndex, currentIndex + 1);\n }\n\n event.preventDefault();\n const nextTarget = enabled[nextIndex]?.target;\n if (!nextTarget) return;\n rovingTarget.value = nextTarget;\n nextTarget.focus();\n syncTabStops();\n};\n\nconst handleFocusin = (event: FocusEvent) => {\n if (resolvedDisabled.value || !(event.target instanceof Node)) return;\n const root = rootRef.value;\n if (!root) return;\n const entry = getEntries(root).find((candidate) =>\n candidate.target === event.target || candidate.target.contains(event.target as Node),\n );\n if (!entry?.enabled) return;\n rovingTarget.value = entry.target;\n syncTabStops();\n};\n\nonMounted(() => {\n syncTabStops();\n childObserver = new MutationObserver(() => syncTabStops());\n childObserver.observe(rootRef.value as Node, {\n attributes: true,\n attributeFilter: [\n \"aria-disabled\",\n \"aria-hidden\",\n \"class\",\n \"disabled\",\n \"hidden\",\n \"inert\",\n \"style\",\n \"tabindex\",\n ],\n childList: true,\n subtree: true,\n });\n void nextTick(syncTabStops);\n});\n\nonUpdated(syncTabStops);\n\nonUnmounted(() => {\n childObserver?.disconnect();\n});\n</script>\n\n<template>\n <div\n ref=\"rootRef\"\n v-bind=\"$attrs\"\n class=\"kappa-toolbar\"\n data-slot=\"toolbar\"\n :data-disabled=\"resolvedDisabled ? '' : undefined\"\n :data-orientation=\"resolvedOrientation\"\n :data-size=\"resolvedSize\"\n role=\"toolbar\"\n :aria-disabled=\"resolvedAriaDisabled\"\n :aria-orientation=\"resolvedOrientation\"\n @focusin=\"handleFocusin\"\n @keydown=\"handleKeydown\"\n >\n <slot />\n </div>\n</template>\n\n<style src=\"./toolbar.css\"></style>\n","<script setup lang=\"ts\">\nimport { computed, useAttrs } from \"vue\";\nimport { Input } from \"../input\";\nimport { useToolbarContext } from \"./context\";\nimport {\n TOOLBAR_DEFAULT_SIZE,\n type ToolbarInputComponentProps,\n type ToolbarInputEmits,\n type ToolbarInputSlots,\n} from \"./toolbar\";\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = withDefaults(defineProps<ToolbarInputComponentProps>(), {\n disabled: false,\n invalid: false,\n modelValue: undefined,\n passwordManagerIgnore: false,\n});\n\nconst emit = defineEmits<ToolbarInputEmits>();\ndefineSlots<ToolbarInputSlots>();\n\nconst attrs = useAttrs();\nconst toolbar = useToolbarContext();\nconst resolvedSize = computed(() => toolbar?.size.value ?? TOOLBAR_DEFAULT_SIZE);\nconst nativeDisabled = computed(\n () => props.disabled || Boolean(toolbar?.disabled.value),\n);\nconst inputAttrs = computed(() =>\n Object.fromEntries(\n Object.entries(attrs).filter(\n ([key]) => key !== \"size\",\n ),\n ),\n);\n\nconst handleUpdate = (value: string) => {\n emit(\"update:modelValue\", value);\n emit(\"valueChange\", value);\n};\n</script>\n\n<template>\n <Input\n v-bind=\"inputAttrs\"\n class=\"kappa-toolbar__item kappa-toolbar__input\"\n data-kappa-component=\"Toolbar.Input\"\n data-kappa-toolbar-item=\"\"\n :disabled=\"nativeDisabled\"\n :invalid=\"props.invalid\"\n :model-value=\"props.modelValue\"\n :password-manager-ignore=\"props.passwordManagerIgnore\"\n :size=\"resolvedSize\"\n @update:model-value=\"handleUpdate\"\n />\n</template>\n","<script setup lang=\"ts\">\nimport { computed, useAttrs } from \"vue\";\nimport { Input } from \"../input\";\nimport { useToolbarContext } from \"./context\";\nimport {\n TOOLBAR_DEFAULT_SIZE,\n type ToolbarInputComponentProps,\n type ToolbarInputEmits,\n type ToolbarInputSlots,\n} from \"./toolbar\";\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = withDefaults(defineProps<ToolbarInputComponentProps>(), {\n disabled: false,\n invalid: false,\n modelValue: undefined,\n passwordManagerIgnore: false,\n});\n\nconst emit = defineEmits<ToolbarInputEmits>();\ndefineSlots<ToolbarInputSlots>();\n\nconst attrs = useAttrs();\nconst toolbar = useToolbarContext();\nconst resolvedSize = computed(() => toolbar?.size.value ?? TOOLBAR_DEFAULT_SIZE);\nconst nativeDisabled = computed(\n () => props.disabled || Boolean(toolbar?.disabled.value),\n);\nconst inputAttrs = computed(() =>\n Object.fromEntries(\n Object.entries(attrs).filter(\n ([key]) => key !== \"size\",\n ),\n ),\n);\n\nconst handleUpdate = (value: string) => {\n emit(\"update:modelValue\", value);\n emit(\"valueChange\", value);\n};\n</script>\n\n<template>\n <Input\n v-bind=\"inputAttrs\"\n class=\"kappa-toolbar__item kappa-toolbar__input\"\n data-kappa-component=\"Toolbar.Input\"\n data-kappa-toolbar-item=\"\"\n :disabled=\"nativeDisabled\"\n :invalid=\"props.invalid\"\n :model-value=\"props.modelValue\"\n :password-manager-ignore=\"props.passwordManagerIgnore\"\n :size=\"resolvedSize\"\n @update:model-value=\"handleUpdate\"\n />\n</template>\n","<script setup lang=\"ts\">\nimport { computed, useAttrs } from \"vue\";\nimport { InputGroup } from \"../input-group\";\nimport { useToolbarContext } from \"./context\";\nimport {\n TOOLBAR_DEFAULT_SIZE,\n type ToolbarInputGroupProps,\n type ToolbarInputGroupSlots,\n} from \"./toolbar\";\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = withDefaults(defineProps<ToolbarInputGroupProps>(), {\n disabled: false,\n invalid: false,\n});\n\ndefineSlots<ToolbarInputGroupSlots>();\n\nconst attrs = useAttrs();\nconst toolbar = useToolbarContext();\nconst resolvedSize = computed(() => toolbar?.size.value ?? TOOLBAR_DEFAULT_SIZE);\nconst nativeDisabled = computed(\n () => props.disabled || Boolean(toolbar?.disabled.value),\n);\nconst groupAttrs = computed(() =>\n Object.fromEntries(\n Object.entries(attrs).filter(([key]) => key !== \"size\"),\n ),\n);\n</script>\n\n<template>\n <InputGroup\n v-bind=\"groupAttrs\"\n class=\"kappa-toolbar__item kappa-toolbar__input-group\"\n data-kappa-component=\"Toolbar.InputGroup\"\n data-kappa-toolbar-item=\"\"\n data-kappa-toolbar-input-group=\"\"\n :disabled=\"nativeDisabled\"\n :invalid=\"props.invalid\"\n :size=\"resolvedSize\"\n >\n <slot />\n </InputGroup>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, useAttrs } from \"vue\";\nimport { InputGroup } from \"../input-group\";\nimport { useToolbarContext } from \"./context\";\nimport {\n TOOLBAR_DEFAULT_SIZE,\n type ToolbarInputGroupProps,\n type ToolbarInputGroupSlots,\n} from \"./toolbar\";\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = withDefaults(defineProps<ToolbarInputGroupProps>(), {\n disabled: false,\n invalid: false,\n});\n\ndefineSlots<ToolbarInputGroupSlots>();\n\nconst attrs = useAttrs();\nconst toolbar = useToolbarContext();\nconst resolvedSize = computed(() => toolbar?.size.value ?? TOOLBAR_DEFAULT_SIZE);\nconst nativeDisabled = computed(\n () => props.disabled || Boolean(toolbar?.disabled.value),\n);\nconst groupAttrs = computed(() =>\n Object.fromEntries(\n Object.entries(attrs).filter(([key]) => key !== \"size\"),\n ),\n);\n</script>\n\n<template>\n <InputGroup\n v-bind=\"groupAttrs\"\n class=\"kappa-toolbar__item kappa-toolbar__input-group\"\n data-kappa-component=\"Toolbar.InputGroup\"\n data-kappa-toolbar-item=\"\"\n data-kappa-toolbar-input-group=\"\"\n :disabled=\"nativeDisabled\"\n :invalid=\"props.invalid\"\n :size=\"resolvedSize\"\n >\n <slot />\n </InputGroup>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, useAttrs, useSlots } from \"vue\";\nimport { LinkButton } from \"../button\";\nimport { useToolbarContext } from \"./context\";\nimport {\n TOOLBAR_DEFAULT_SIZE,\n type ToolbarLinkProps,\n type ToolbarLinkSlots,\n} from \"./toolbar\";\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = withDefaults(defineProps<ToolbarLinkProps>(), {\n asChild: false,\n disabled: false,\n external: false,\n href: undefined,\n icon: undefined,\n iconProps: undefined,\n shape: undefined,\n title: undefined,\n});\n\ndefineSlots<ToolbarLinkSlots>();\n\nconst attrs = useAttrs();\nconst slots = useSlots();\nconst toolbar = useToolbarContext();\n\nconst resolvedSize = computed(() => toolbar?.size.value ?? TOOLBAR_DEFAULT_SIZE);\nconst resolvedShape = computed(() =>\n props.shape ?? (!slots.default && props.icon ? \"square\" : \"base\"),\n);\nconst linkAttrs = computed(() =>\n Object.fromEntries(\n Object.entries(attrs).filter(([key]) => ![\"size\", \"variant\"].includes(key)),\n ),\n);\nconst resolvedDisabled = computed(\n () => props.disabled || Boolean(toolbar?.disabled.value),\n);\n</script>\n\n<template>\n <LinkButton\n v-bind=\"linkAttrs\"\n class=\"kappa-toolbar__item kappa-toolbar__button kappa-toolbar__link\"\n data-kappa-component=\"Toolbar.Link\"\n data-kappa-toolbar-item=\"\"\n :as-child=\"props.asChild\"\n :disabled=\"resolvedDisabled\"\n :external=\"props.external\"\n :full-width=\"props.fullWidth\"\n :href=\"props.href\"\n :icon=\"props.icon\"\n :icon-position=\"props.iconPosition\"\n :icon-props=\"props.iconProps\"\n :shape=\"resolvedShape\"\n :size=\"resolvedSize\"\n :title=\"props.title\"\n variant=\"ghost\"\n >\n <slot />\n </LinkButton>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, useAttrs, useSlots } from \"vue\";\nimport { LinkButton } from \"../button\";\nimport { useToolbarContext } from \"./context\";\nimport {\n TOOLBAR_DEFAULT_SIZE,\n type ToolbarLinkProps,\n type ToolbarLinkSlots,\n} from \"./toolbar\";\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = withDefaults(defineProps<ToolbarLinkProps>(), {\n asChild: false,\n disabled: false,\n external: false,\n href: undefined,\n icon: undefined,\n iconProps: undefined,\n shape: undefined,\n title: undefined,\n});\n\ndefineSlots<ToolbarLinkSlots>();\n\nconst attrs = useAttrs();\nconst slots = useSlots();\nconst toolbar = useToolbarContext();\n\nconst resolvedSize = computed(() => toolbar?.size.value ?? TOOLBAR_DEFAULT_SIZE);\nconst resolvedShape = computed(() =>\n props.shape ?? (!slots.default && props.icon ? \"square\" : \"base\"),\n);\nconst linkAttrs = computed(() =>\n Object.fromEntries(\n Object.entries(attrs).filter(([key]) => ![\"size\", \"variant\"].includes(key)),\n ),\n);\nconst resolvedDisabled = computed(\n () => props.disabled || Boolean(toolbar?.disabled.value),\n);\n</script>\n\n<template>\n <LinkButton\n v-bind=\"linkAttrs\"\n class=\"kappa-toolbar__item kappa-toolbar__button kappa-toolbar__link\"\n data-kappa-component=\"Toolbar.Link\"\n data-kappa-toolbar-item=\"\"\n :as-child=\"props.asChild\"\n :disabled=\"resolvedDisabled\"\n :external=\"props.external\"\n :full-width=\"props.fullWidth\"\n :href=\"props.href\"\n :icon=\"props.icon\"\n :icon-position=\"props.iconPosition\"\n :icon-props=\"props.iconProps\"\n :shape=\"resolvedShape\"\n :size=\"resolvedSize\"\n :title=\"props.title\"\n variant=\"ghost\"\n >\n <slot />\n </LinkButton>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\nimport { Separator } from \"../separator\";\nimport { useToolbarContext } from \"./context\";\nimport type { ToolbarSeparatorProps, ToolbarSeparatorSlots } from \"./toolbar\";\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = withDefaults(defineProps<ToolbarSeparatorProps>(), {\n decorative: true,\n orientation: undefined,\n});\n\ndefineSlots<ToolbarSeparatorSlots>();\n\nconst toolbar = useToolbarContext();\nconst resolvedOrientation = computed(\n () =>\n props.orientation ??\n (toolbar?.orientation.value === \"vertical\" ? \"horizontal\" : \"vertical\"),\n);\n</script>\n\n<template>\n <Separator\n v-bind=\"$attrs\"\n class=\"kappa-toolbar__separator\"\n data-kappa-component=\"Toolbar.Separator\"\n :decorative=\"props.decorative\"\n :orientation=\"resolvedOrientation\"\n />\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\nimport { Separator } from \"../separator\";\nimport { useToolbarContext } from \"./context\";\nimport type { ToolbarSeparatorProps, ToolbarSeparatorSlots } from \"./toolbar\";\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = withDefaults(defineProps<ToolbarSeparatorProps>(), {\n decorative: true,\n orientation: undefined,\n});\n\ndefineSlots<ToolbarSeparatorSlots>();\n\nconst toolbar = useToolbarContext();\nconst resolvedOrientation = computed(\n () =>\n props.orientation ??\n (toolbar?.orientation.value === \"vertical\" ? \"horizontal\" : \"vertical\"),\n);\n</script>\n\n<template>\n <Separator\n v-bind=\"$attrs\"\n class=\"kappa-toolbar__separator\"\n data-kappa-component=\"Toolbar.Separator\"\n :decorative=\"props.decorative\"\n :orientation=\"resolvedOrientation\"\n />\n</template>\n","import ToolbarRoot from \"./Toolbar.vue\";\nimport ToolbarButton from \"./ToolbarButton.vue\";\nimport ToolbarInput from \"./ToolbarInput.vue\";\nimport ToolbarInputGroup from \"./ToolbarInputGroup.vue\";\nimport ToolbarLink from \"./ToolbarLink.vue\";\nimport ToolbarSeparator from \"./ToolbarSeparator.vue\";\n\nexport const Toolbar = Object.assign(ToolbarRoot, {\n Root: ToolbarRoot,\n Button: ToolbarButton,\n Link: ToolbarLink,\n Input: ToolbarInput,\n InputGroup: ToolbarInputGroup,\n Separator: ToolbarSeparator,\n});\n\nexport {\n ToolbarInput,\n ToolbarInputGroup,\n ToolbarLink,\n ToolbarRoot,\n ToolbarSeparator,\n};\n\n// Keep the original import path; the Button module owns the named control.\nexport { ToolbarButton } from \"../button\";\n\nexport type {\n ToolbarButtonProps,\n ToolbarButtonSlots,\n ToolbarInputGroupProps,\n ToolbarInputGroupSlots,\n ToolbarInputEmits,\n ToolbarInputProps,\n ToolbarInputSlots,\n ToolbarLinkProps,\n ToolbarLinkSlots,\n ToolbarOrientation,\n ToolbarProps,\n ToolbarRootProps,\n ToolbarSeparatorProps,\n ToolbarSeparatorSlots,\n ToolbarSize,\n ToolbarSlots,\n} from \"./toolbar\";\n\nexport {\n TOOLBAR_DEFAULT_LOOP_FOCUS,\n TOOLBAR_DEFAULT_ORIENTATION,\n TOOLBAR_DEFAULT_SIZE,\n TOOLBAR_ORIENTATIONS,\n TOOLBAR_SIZES,\n isToolbarOrientation,\n isToolbarSize,\n resolveToolbarOrientation,\n resolveToolbarSize,\n} from \"./toolbar\";\n"],"mappings":";;;;;;AAUA,IAAa,IAAuB,CAAC,cAAc,UAAU,GAChD,IAAgB;CAAC;CAAM;CAAM;CAAQ;AAAI,GAKzC,IACX,cACW,IAAuB,QACvB,IAA6B,IAEpC,KACJ,GACA,MACe,OAAO,KAAU,YAAY,EAAO,SAAS,CAAU,GAE3D,KACX,MACgC,EAAY,GAAsB,CAAK,GAE5D,KAAiB,MAC5B,EAAY,GAAe,CAAK,GAErB,KACX,MAEA,EAAqB,CAAK,IAAI,IAAQ,GAE3B,KAAsB,MACjC,EAAc,CAAK,IAAI,IAAQ;;;;;;GCsB3B,IAAoB,wDACpB,IAAsB,6BACtB,IAA4B;;;;;;;;;;;;;;;;EAxClC,IAAM,IAAQ,GASR,IAAQ,EAAS,GACjB,IAAU,EAAwB,IAAI,GACtC,IAAe,EAAwB,IAAI,GAC7C,GAEE,IAAsB,QAC1B,EAA0B,EAAM,WAAW,CAC7C,GACM,IAAe,QAAe,EAAmB,EAAM,IAAI,CAAC,GAC5D,IAAmB,QAErB,EAAM,YACN,EAAM,qBAAqB,MAC3B,EAAM,qBAAqB,MAC/B,GACM,IAAuB,QAC3B,EAAiB,QACb,SACA,EAAM,qBAAqB,MAAS,EAAM,qBAAqB,UAC7D,UACA,KAAA,CACR;EAEA,EAAsB;GACpB,UAAU;GACV,aAAa;GACb,MAAM;EACR,CAAC;EAYD,IAAM,KAAY,MAAyB;GACzC,IACE,EAAQ,UAEN,EAAQ,QAAQ,yCAAyC,KACvD,EAAQ,QAAQ,SAAS,GAG7B,OAAO;GAGT,IAAM,IAAQ,EAAQ,cAAc,aAAa,iBAAiB,CAAO;GACz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,CAAC,QAAQ,SAAS,CAAC,CAAC,SAAS,CAAG,CAAC,CAC5E,CACF,GACM,IAAmB,QACjB,EAAM,YAAY,EAAQ,GAAS,SAAS,KACpD;oBAIE,EAAA,GAAA,EAmBa,EAAA,CAAA,GAnBb,EACU,EAkBG,OAlBM;GACjB,OAAM;GACN,wBAAqB;GACrB,2BAAwB;GACvB,YAAU,EAAM;GAChB,UAAU,EAAA;GACV,UAAU,EAAM;GAChB,cAAY,EAAM;GAClB,MAAM,EAAM;GACZ,MAAM,EAAM;GACZ,iBAAe,EAAM;GACrB,cAAY,EAAM;GAClB,OAAO,EAAA;GACP,MAAM,EAAA;GACN,OAAO,EAAM;GACd,SAAQ;;GAER,SAAA,QAAQ,CAAR,EAAQ,EAAA,QAAA,SAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;EEtDZ,IAAM,IAAQ,GAOR,IAAU,EAAkB,GAC5B,IAAsB,QAExB,EAAM,gBACL,GAAS,YAAY,UAAU,aAAa,eAAe,WAChE;oBAIE,EAAA,GAAA,EAME,EAAA,CAAA,GANF,EACUC,EAKR,QALc;GACd,OAAM;GACN,wBAAqB;GACpB,YAAY,EAAM;GAClB,aAAa,EAAA;;;IEtBL,IAAU,OAAO,OAAO,GAAa;CAChD,MAAM;CACN,QAAQ;CACR,MAAM;CACN,OAAO;CACP,YAAY;CACZ,WAAW;AACb,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2014 The Nunito Project Authors (https://github.com/googlefonts/nunito)
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
http://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|