@leavepulse/ui 0.12.0 → 0.14.6
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/assets/LpCommandPalette-D315B47-.css +16 -0
- package/dist/chunks/LayoutCanvas-Dd20boUG.js +50 -0
- package/dist/chunks/LayoutNode-DGpZA9LX.js +225 -0
- package/dist/chunks/LpAlert-BAYHDSS1.js +69 -0
- package/dist/chunks/LpAppShell-DBTsNQaM.js +170 -0
- package/dist/chunks/LpAutocomplete-B9uoCs4t.js +196 -0
- package/dist/chunks/LpAvatar-B1Ez0ZAx.js +88 -0
- package/dist/chunks/LpBadge-CXzBPnwO.js +42 -0
- package/dist/chunks/LpBreadcrumbs-B7Aqatzw.js +42 -0
- package/dist/chunks/LpButton-5VXXCjwF.js +101 -0
- package/dist/chunks/LpCalendar-B7ZL0ty3.js +150 -0
- package/dist/chunks/LpCard-1yvWT9fx.js +66 -0
- package/dist/chunks/LpCheckbox-BO0zuuPh.js +55 -0
- package/dist/chunks/LpCodeBlock-CSiOSPs8.js +253 -0
- package/dist/chunks/LpConfirmDialog-KLtTtCiT.js +62 -0
- package/dist/chunks/LpContextMenu-D0mzXqA7.js +151 -0
- package/dist/chunks/LpDatePicker-dY2q4dr4.js +122 -0
- package/dist/chunks/LpDisclosure-DP6yfgfM.js +76 -0
- package/dist/chunks/LpDivider-CUX46KR0.js +43 -0
- package/dist/chunks/LpDrawer-Ce6g9ZMr.js +310 -0
- package/dist/chunks/LpDropdownMenu-DJpoqRCb.js +65 -0
- package/dist/chunks/LpEmptyState-CrfyRJUG.js +47 -0
- package/dist/chunks/LpFormField-Bn-ZwC6z.js +47 -0
- package/dist/chunks/LpIcon-CCnX5_2j.js +41 -0
- package/dist/chunks/LpInfraNode-C_PHcthC.js +99 -0
- package/dist/chunks/LpInput-BauZRyzm.js +136 -0
- package/dist/chunks/LpLaneNode-HtnQf2FF.js +33 -0
- package/dist/chunks/LpLink-DHwOEp4e.js +36 -0
- package/dist/chunks/LpLogViewer-hC0OKkeE.js +482 -0
- package/dist/chunks/LpModal-CWoOExzT.js +128 -0
- package/dist/chunks/LpNotificationBell-BDy0tQwr.js +232 -0
- package/dist/chunks/LpNumberField-C5ar-OwE.js +55 -0
- package/dist/chunks/LpOtpInput-DqaT0Z75.js +65 -0
- package/dist/chunks/LpPagination-CeGuNe_q.js +132 -0
- package/dist/chunks/LpPasswordInput-DIHFw4u0.js +64 -0
- package/dist/chunks/LpPhoneInput-LQvVFGMw.js +199 -0
- package/dist/chunks/LpPopover-8268UmlC.js +54 -0
- package/dist/chunks/LpProgress-BhI0IbjC.js +37 -0
- package/dist/chunks/LpRadio-CL-pI0_O.js +39 -0
- package/dist/chunks/LpRadioGroup-B4yDTmi6.js +52 -0
- package/dist/chunks/LpScrollArea-K1x-azgY.js +67 -0
- package/dist/chunks/LpSegmented-BmpanyAo.js +74 -0
- package/dist/chunks/LpSelect-DznhPEWX.js +222 -0
- package/dist/chunks/LpServiceNode-Dc-Ut5RS.js +51 -0
- package/dist/chunks/LpSidebar-BPQabjae.js +152 -0
- package/dist/chunks/LpSidebarNav-CpF7rZxx.js +126 -0
- package/dist/chunks/LpSkeleton-eSFIo4kD.js +22 -0
- package/dist/chunks/LpSlider-B1SF3pRV.js +53 -0
- package/dist/chunks/LpStat-CdbEFOvn.js +88 -0
- package/dist/chunks/LpStepper-5dFTrW21.js +53 -0
- package/dist/chunks/LpSwitch-v6fnccSM.js +28 -0
- package/dist/chunks/LpTable-CJ4Zt1UH.js +229 -0
- package/dist/chunks/LpTableOfContents-CjvxPMpU.js +155 -0
- package/dist/chunks/LpTabs-D7aTVPOb.js +115 -0
- package/dist/chunks/LpTextarea-CRAkhemZ.js +44 -0
- package/dist/chunks/LpThemeSwitcher-BgWwfkxs.js +601 -0
- package/dist/chunks/LpTilt-DuyKbpkA.js +49 -0
- package/dist/chunks/LpToaster-gDB1EaU3.js +196 -0
- package/dist/chunks/LpTooltip-CIwoRCag.js +49 -0
- package/dist/chunks/LpTopologyCanvas-DVwyQfKa.js +237 -0
- package/dist/chunks/LpUptimeBar-CB366k0O.js +127 -0
- package/dist/component-names.d.ts +1 -1
- package/dist/components/LayoutCanvas.vue.js +4 -0
- package/dist/components/LayoutNode.vue.js +4 -0
- package/dist/components/LpAlert.vue.js +4 -0
- package/dist/components/LpAppShell.vue.js +4 -0
- package/dist/components/LpAutocomplete.vue.js +4 -0
- package/dist/components/LpAvatar.vue.js +4 -0
- package/dist/components/LpBadge.vue.js +4 -0
- package/dist/components/LpBreadcrumbs.vue.js +4 -0
- package/dist/components/LpButton.vue.js +4 -0
- package/dist/components/LpCalendar.vue.js +4 -0
- package/dist/components/LpCard.vue.js +4 -0
- package/dist/components/LpCheckbox.vue.js +4 -0
- package/dist/components/LpCodeBlock.vue.js +4 -0
- package/dist/components/LpCommandPalette.vue.js +310 -0
- package/dist/components/LpConfirmDialog.vue.js +4 -0
- package/dist/components/LpContextMenu.vue.d.ts +7 -0
- package/dist/components/LpContextMenu.vue.js +4 -0
- package/dist/components/LpDatePicker.vue.js +4 -0
- package/dist/components/LpDisclosure.vue.js +4 -0
- package/dist/components/LpDivider.vue.js +4 -0
- package/dist/components/LpDrawer.vue.d.ts +8 -0
- package/dist/components/LpDrawer.vue.js +4 -0
- package/dist/components/LpDropdownMenu.vue.js +4 -0
- package/dist/components/LpEmptyState.vue.js +4 -0
- package/dist/components/LpFormField.vue.js +4 -0
- package/dist/components/LpIcon.vue.js +4 -0
- package/dist/components/LpInfraNode.vue.js +4 -0
- package/dist/components/LpInput.vue.js +4 -0
- package/dist/components/LpLaneNode.vue.js +4 -0
- package/dist/components/LpLink.vue.js +4 -0
- package/dist/components/LpLogViewer.vue.js +4 -0
- package/dist/components/LpModal.vue.js +4 -0
- package/dist/components/LpNotificationBell.vue.js +4 -0
- package/dist/components/LpNumberField.vue.js +4 -0
- package/dist/components/LpOtpInput.vue.js +4 -0
- package/dist/components/LpPagination.vue.js +4 -0
- package/dist/components/LpPasswordInput.vue.js +4 -0
- package/dist/components/LpPhoneInput.vue.js +4 -0
- package/dist/components/LpPopover.vue.js +4 -0
- package/dist/components/LpProgress.vue.js +4 -0
- package/dist/components/LpRadio.vue.js +4 -0
- package/dist/components/LpRadioGroup.vue.js +4 -0
- package/dist/components/LpScrollArea.vue.d.ts +2 -2
- package/dist/components/LpScrollArea.vue.js +4 -0
- package/dist/components/LpSegmented.vue.js +4 -0
- package/dist/components/LpSelect.vue.d.ts +2 -0
- package/dist/components/LpSelect.vue.js +4 -0
- package/dist/components/LpServiceNode.vue.js +4 -0
- package/dist/components/LpSidebar.vue.js +4 -0
- package/dist/components/LpSidebarNav.vue.js +4 -0
- package/dist/components/LpSkeleton.vue.js +4 -0
- package/dist/components/LpSlider.vue.js +4 -0
- package/dist/components/LpStat.vue.js +4 -0
- package/dist/components/LpStepper.vue.js +4 -0
- package/dist/components/LpSwitch.vue.js +4 -0
- package/dist/components/LpTable.vue.js +4 -0
- package/dist/components/LpTableOfContents.vue.js +4 -0
- package/dist/components/LpTabs.vue.d.ts +4 -2
- package/dist/components/LpTabs.vue.js +4 -0
- package/dist/components/LpTextarea.vue.js +4 -0
- package/dist/components/LpThemeSwitcher.vue.js +4 -0
- package/dist/components/LpTilt.vue.d.ts +31 -0
- package/dist/components/LpTilt.vue.js +4 -0
- package/dist/components/LpToaster.vue.js +4 -0
- package/dist/components/LpTooltip.vue.js +4 -0
- package/dist/components/LpTopologyCanvas.vue.js +4 -0
- package/dist/components/LpUptimeBar.vue.js +4 -0
- package/dist/components/codeHighlight.js +230 -0
- package/dist/{countries-data-9rgqJWHo.js → components/countries-data.js} +2 -2
- package/dist/components/countries.js +38 -0
- package/dist/components/dropdown.js +14 -0
- package/dist/components/sidebar.js +1 -0
- package/dist/composables/useInputFilter.js +44 -0
- package/dist/composables/usePillTransition.js +11 -0
- package/dist/composables/useTilt.d.ts +23 -0
- package/dist/composables/useTilt.js +57 -0
- package/dist/composables/useToast.d.ts +2 -0
- package/dist/composables/useToast.js +49 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +197 -17596
- package/dist/layout/registry.js +10 -0
- package/dist/layout/tree.js +192 -0
- package/dist/layout/useLayout.js +61 -0
- package/package.json +5 -3
- package/src/component-names.ts +1 -0
- package/src/components/LpContextMenu.vue +14 -4
- package/src/components/LpDrawer.vue +29 -1
- package/src/components/LpLogViewer.vue +180 -31
- package/src/components/LpScrollArea.vue +20 -15
- package/src/components/LpSelect.vue +0 -0
- package/src/components/LpSidebar.vue +5 -2
- package/src/components/LpTabs.vue +19 -6
- package/src/components/LpThemeSwitcher.vue +13 -2
- package/src/components/LpTilt.vue +61 -0
- package/src/components/LpToaster.vue +11 -4
- package/src/composables/useTilt.ts +103 -0
- package/src/composables/useToast.ts +2 -0
- package/src/index.ts +3 -0
- package/src/nuxt.ts +10 -1
- package/dist/index.css +0 -1
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, watch, nextTick, onMounted, onBeforeUnmount, openBlock, createBlock, unref, withCtx, createVNode, withModifiers, createTextVNode, createElementVNode, withDirectives, withKeys, vModelText, createElementBlock, toDisplayString, createCommentVNode, Fragment, renderList, normalizeClass } from "vue";
|
|
2
|
+
import { DialogRoot, DialogPortal, DialogOverlay, DialogContent, DialogTitle, DialogDescription } from "reka-ui";
|
|
3
|
+
import { _ as _sfc_main$1 } from "../chunks/LpIcon-CCnX5_2j.js";
|
|
4
|
+
import { _ as _sfc_main$2 } from "../chunks/LpScrollArea-K1x-azgY.js";
|
|
5
|
+
import '../assets/LpCommandPalette-D315B47-.css';const _hoisted_1 = { class: "flex shrink-0 items-center gap-2.5 border-b border-line px-4" };
|
|
6
|
+
const _hoisted_2 = ["placeholder", "onKeydown"];
|
|
7
|
+
const _hoisted_3 = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "px-2 py-10 text-center text-sm text-muted"
|
|
10
|
+
};
|
|
11
|
+
const _hoisted_4 = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "px-2 pb-1 pt-3 text-[11px] font-semibold uppercase tracking-[0.08em] text-muted"
|
|
14
|
+
};
|
|
15
|
+
const _hoisted_5 = ["data-cmd-index", "disabled", "onClick", "onPointerenter"];
|
|
16
|
+
const _hoisted_6 = { class: "min-w-0 flex-1" };
|
|
17
|
+
const _hoisted_7 = { class: "block truncate font-medium" };
|
|
18
|
+
const _hoisted_8 = {
|
|
19
|
+
key: 0,
|
|
20
|
+
class: "rounded-xs bg-brand/25 text-ink"
|
|
21
|
+
};
|
|
22
|
+
const _hoisted_9 = {
|
|
23
|
+
key: 0,
|
|
24
|
+
class: "mt-0.5 block truncate text-xs text-muted"
|
|
25
|
+
};
|
|
26
|
+
const _hoisted_10 = {
|
|
27
|
+
key: 0,
|
|
28
|
+
class: "rounded-xs bg-brand/20 text-ink"
|
|
29
|
+
};
|
|
30
|
+
const _hoisted_11 = {
|
|
31
|
+
key: 1,
|
|
32
|
+
class: "shrink-0 text-xs text-muted"
|
|
33
|
+
};
|
|
34
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
35
|
+
__name: "LpCommandPalette",
|
|
36
|
+
props: {
|
|
37
|
+
open: { type: Boolean },
|
|
38
|
+
commands: {},
|
|
39
|
+
placeholder: { default: "Type a command or search…" },
|
|
40
|
+
emptyText: { default: "No results" },
|
|
41
|
+
hotkey: { type: Boolean, default: true }
|
|
42
|
+
},
|
|
43
|
+
emits: ["update:open", "select"],
|
|
44
|
+
setup(__props, { emit: __emit }) {
|
|
45
|
+
const props = __props;
|
|
46
|
+
const emit = __emit;
|
|
47
|
+
const query = ref("");
|
|
48
|
+
const selectedIndex = ref(0);
|
|
49
|
+
const inputRef = ref(null);
|
|
50
|
+
const scrollRef = ref(null);
|
|
51
|
+
const ranked = computed(() => {
|
|
52
|
+
const q = query.value.trim().toLowerCase();
|
|
53
|
+
if (!q) return props.commands.filter((c) => !c.hidden);
|
|
54
|
+
return props.commands.map((c) => {
|
|
55
|
+
const label = c.label.toLowerCase().includes(q);
|
|
56
|
+
const kw = (c.keywords ?? []).some((k) => k.toLowerCase().includes(q));
|
|
57
|
+
const desc = c.description?.toLowerCase().includes(q) ?? false;
|
|
58
|
+
const score = (label ? 4 : 0) + (kw ? 3 : 0) + (desc ? 2 : 0);
|
|
59
|
+
return { c, score };
|
|
60
|
+
}).filter((e) => e.score > 0).sort((a, b) => b.score - a.score || a.c.label.localeCompare(b.c.label)).map((e) => e.c);
|
|
61
|
+
});
|
|
62
|
+
const grouped = computed(() => {
|
|
63
|
+
const order = [];
|
|
64
|
+
const map = /* @__PURE__ */ new Map();
|
|
65
|
+
for (const c of ranked.value) {
|
|
66
|
+
const g = c.group ?? "";
|
|
67
|
+
if (!map.has(g)) {
|
|
68
|
+
map.set(g, []);
|
|
69
|
+
order.push(g);
|
|
70
|
+
}
|
|
71
|
+
map.get(g).push(c);
|
|
72
|
+
}
|
|
73
|
+
return order.map((name) => ({ name, items: map.get(name) }));
|
|
74
|
+
});
|
|
75
|
+
const flat = computed(() => grouped.value.flatMap((g) => g.items));
|
|
76
|
+
function flatIndexOf(c) {
|
|
77
|
+
return flat.value.indexOf(c);
|
|
78
|
+
}
|
|
79
|
+
function highlight(value) {
|
|
80
|
+
const terms = [...new Set(query.value.toLowerCase().trim().split(/\s+/).filter((t) => t.length >= 2))].sort(
|
|
81
|
+
(a, b) => b.length - a.length
|
|
82
|
+
);
|
|
83
|
+
if (!value || terms.length === 0) return value ? [{ text: value, hit: false }] : [];
|
|
84
|
+
const lower = value.toLowerCase();
|
|
85
|
+
const parts = [];
|
|
86
|
+
let i = 0;
|
|
87
|
+
while (i < value.length) {
|
|
88
|
+
let at = -1;
|
|
89
|
+
let term = "";
|
|
90
|
+
for (const t of terms) {
|
|
91
|
+
const found = lower.indexOf(t, i);
|
|
92
|
+
if (found !== -1 && (at === -1 || found < at || found === at && t.length > term.length)) {
|
|
93
|
+
at = found;
|
|
94
|
+
term = t;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (at === -1) {
|
|
98
|
+
parts.push({ text: value.slice(i), hit: false });
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
if (at > i) parts.push({ text: value.slice(i, at), hit: false });
|
|
102
|
+
parts.push({ text: value.slice(at, at + term.length), hit: true });
|
|
103
|
+
i = at + term.length;
|
|
104
|
+
}
|
|
105
|
+
return parts;
|
|
106
|
+
}
|
|
107
|
+
watch(query, () => selectedIndex.value = 0);
|
|
108
|
+
watch(
|
|
109
|
+
() => flat.value.length,
|
|
110
|
+
(len) => {
|
|
111
|
+
if (selectedIndex.value >= len) selectedIndex.value = Math.max(0, len - 1);
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
watch([selectedIndex, () => flat.value.map((c) => c.id).join("|")], async () => {
|
|
115
|
+
await nextTick();
|
|
116
|
+
scrollSelectedIntoView();
|
|
117
|
+
});
|
|
118
|
+
function scrollSelectedIntoView() {
|
|
119
|
+
const el = scrollRef.value?.viewportEl?.querySelector(
|
|
120
|
+
`[data-cmd-index="${selectedIndex.value}"]`
|
|
121
|
+
);
|
|
122
|
+
el?.scrollIntoView({ block: "nearest" });
|
|
123
|
+
}
|
|
124
|
+
function moveDown() {
|
|
125
|
+
const len = flat.value.length;
|
|
126
|
+
if (len) selectedIndex.value = (selectedIndex.value + 1) % len;
|
|
127
|
+
}
|
|
128
|
+
function moveUp() {
|
|
129
|
+
const len = flat.value.length;
|
|
130
|
+
if (len) selectedIndex.value = (selectedIndex.value - 1 + len) % len;
|
|
131
|
+
}
|
|
132
|
+
function runSelected() {
|
|
133
|
+
run(flat.value[selectedIndex.value]);
|
|
134
|
+
}
|
|
135
|
+
function run(c) {
|
|
136
|
+
if (!c || c.disabled) return;
|
|
137
|
+
emit("select", c);
|
|
138
|
+
c.onSelect?.();
|
|
139
|
+
emit("update:open", false);
|
|
140
|
+
}
|
|
141
|
+
watch(
|
|
142
|
+
() => props.open,
|
|
143
|
+
async (o) => {
|
|
144
|
+
if (o) {
|
|
145
|
+
query.value = "";
|
|
146
|
+
selectedIndex.value = 0;
|
|
147
|
+
await nextTick();
|
|
148
|
+
inputRef.value?.focus();
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
function onHotkey(e) {
|
|
153
|
+
if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "k") {
|
|
154
|
+
e.preventDefault();
|
|
155
|
+
emit("update:open", !props.open);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
onMounted(() => {
|
|
159
|
+
if (props.hotkey) window.addEventListener("keydown", onHotkey);
|
|
160
|
+
});
|
|
161
|
+
onBeforeUnmount(() => window.removeEventListener("keydown", onHotkey));
|
|
162
|
+
return (_ctx, _cache) => {
|
|
163
|
+
return openBlock(), createBlock(unref(DialogRoot), {
|
|
164
|
+
open: __props.open,
|
|
165
|
+
"onUpdate:open": _cache[2] || (_cache[2] = (v) => emit("update:open", v))
|
|
166
|
+
}, {
|
|
167
|
+
default: withCtx(() => [
|
|
168
|
+
createVNode(unref(DialogPortal), null, {
|
|
169
|
+
default: withCtx(() => [
|
|
170
|
+
createVNode(unref(DialogOverlay), { class: "fixed inset-0 z-(--z-overlay) bg-black/50 backdrop-blur-sm data-[state=open]:animate-[fade-in_150ms_ease] data-[state=closed]:animate-[fade-out_130ms_ease]" }),
|
|
171
|
+
createVNode(unref(DialogContent), {
|
|
172
|
+
class: "fixed left-1/2 top-[12vh] z-(--z-modal) flex max-h-[76vh] w-[min(92vw,40rem)] -translate-x-1/2 flex-col overflow-hidden rounded-card border border-line bg-surface-raised shadow-panel outline-none data-[state=open]:animate-[pop-in_160ms_var(--ease-emphasized)] data-[state=closed]:animate-[pop-out_130ms_ease]",
|
|
173
|
+
onOpenAutoFocus: _cache[1] || (_cache[1] = withModifiers(() => {
|
|
174
|
+
}, ["prevent"]))
|
|
175
|
+
}, {
|
|
176
|
+
default: withCtx(() => [
|
|
177
|
+
createVNode(unref(DialogTitle), { class: "sr-only" }, {
|
|
178
|
+
default: withCtx(() => [..._cache[3] || (_cache[3] = [
|
|
179
|
+
createTextVNode("Command palette", -1)
|
|
180
|
+
])]),
|
|
181
|
+
_: 1
|
|
182
|
+
}),
|
|
183
|
+
createVNode(unref(DialogDescription), { class: "sr-only" }, {
|
|
184
|
+
default: withCtx(() => [..._cache[4] || (_cache[4] = [
|
|
185
|
+
createTextVNode("Search and run a command.", -1)
|
|
186
|
+
])]),
|
|
187
|
+
_: 1
|
|
188
|
+
}),
|
|
189
|
+
createElementVNode("div", _hoisted_1, [
|
|
190
|
+
createVNode(_sfc_main$1, {
|
|
191
|
+
name: "lucide:search",
|
|
192
|
+
size: 18,
|
|
193
|
+
class: "shrink-0 text-muted"
|
|
194
|
+
}),
|
|
195
|
+
withDirectives(createElementVNode("input", {
|
|
196
|
+
ref_key: "inputRef",
|
|
197
|
+
ref: inputRef,
|
|
198
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => query.value = $event),
|
|
199
|
+
type: "text",
|
|
200
|
+
placeholder: __props.placeholder,
|
|
201
|
+
class: "h-12 min-w-0 flex-1 bg-transparent text-sm text-ink outline-none placeholder:text-muted",
|
|
202
|
+
onKeydown: [
|
|
203
|
+
withKeys(withModifiers(moveDown, ["prevent"]), ["down"]),
|
|
204
|
+
withKeys(withModifiers(moveUp, ["prevent"]), ["up"]),
|
|
205
|
+
withKeys(withModifiers(runSelected, ["prevent"]), ["enter"])
|
|
206
|
+
]
|
|
207
|
+
}, null, 40, _hoisted_2), [
|
|
208
|
+
[vModelText, query.value]
|
|
209
|
+
]),
|
|
210
|
+
_cache[5] || (_cache[5] = createElementVNode("kbd", { class: "shrink-0 rounded border border-line px-1.5 py-0.5 text-[10px] text-muted" }, "esc", -1))
|
|
211
|
+
]),
|
|
212
|
+
createVNode(_sfc_main$2, {
|
|
213
|
+
ref_key: "scrollRef",
|
|
214
|
+
ref: scrollRef,
|
|
215
|
+
class: "min-h-0 flex-1",
|
|
216
|
+
"content-class": "p-2"
|
|
217
|
+
}, {
|
|
218
|
+
default: withCtx(() => [
|
|
219
|
+
flat.value.length === 0 ? (openBlock(), createElementBlock("p", _hoisted_3, toDisplayString(__props.emptyText), 1)) : createCommentVNode("", true),
|
|
220
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(grouped.value, (group) => {
|
|
221
|
+
return openBlock(), createElementBlock(Fragment, {
|
|
222
|
+
key: group.name
|
|
223
|
+
}, [
|
|
224
|
+
group.name ? (openBlock(), createElementBlock("div", _hoisted_4, toDisplayString(group.name), 1)) : createCommentVNode("", true),
|
|
225
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(group.items, (c) => {
|
|
226
|
+
return openBlock(), createElementBlock("button", {
|
|
227
|
+
key: c.id,
|
|
228
|
+
type: "button",
|
|
229
|
+
"data-cmd-index": flatIndexOf(c),
|
|
230
|
+
disabled: c.disabled,
|
|
231
|
+
class: normalizeClass(["lp-cmd-item flex w-full items-center gap-3 rounded-md px-2.5 py-2 text-left text-sm outline-none transition-colors duration-[var(--duration-fast)] disabled:pointer-events-none disabled:opacity-45", flatIndexOf(c) === selectedIndex.value ? "bg-brand-soft text-brand" : "text-ink hover:bg-surface-soft/60"]),
|
|
232
|
+
onClick: ($event) => run(c),
|
|
233
|
+
onPointerenter: ($event) => selectedIndex.value = flatIndexOf(c)
|
|
234
|
+
}, [
|
|
235
|
+
c.icon ? (openBlock(), createBlock(_sfc_main$1, {
|
|
236
|
+
key: 0,
|
|
237
|
+
name: c.icon,
|
|
238
|
+
size: 16,
|
|
239
|
+
class: "shrink-0"
|
|
240
|
+
}, null, 8, ["name"])) : createCommentVNode("", true),
|
|
241
|
+
createElementVNode("span", _hoisted_6, [
|
|
242
|
+
createElementVNode("span", _hoisted_7, [
|
|
243
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(highlight(c.label), (p, pi) => {
|
|
244
|
+
return openBlock(), createElementBlock(Fragment, {
|
|
245
|
+
key: `l${pi}`
|
|
246
|
+
}, [
|
|
247
|
+
p.hit ? (openBlock(), createElementBlock("mark", _hoisted_8, toDisplayString(p.text), 1)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
248
|
+
createTextVNode(toDisplayString(p.text), 1)
|
|
249
|
+
], 64))
|
|
250
|
+
], 64);
|
|
251
|
+
}), 128))
|
|
252
|
+
]),
|
|
253
|
+
c.description ? (openBlock(), createElementBlock("span", _hoisted_9, [
|
|
254
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(highlight(c.description), (p, pi) => {
|
|
255
|
+
return openBlock(), createElementBlock(Fragment, {
|
|
256
|
+
key: `d${pi}`
|
|
257
|
+
}, [
|
|
258
|
+
p.hit ? (openBlock(), createElementBlock("mark", _hoisted_10, toDisplayString(p.text), 1)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
259
|
+
createTextVNode(toDisplayString(p.text), 1)
|
|
260
|
+
], 64))
|
|
261
|
+
], 64);
|
|
262
|
+
}), 128))
|
|
263
|
+
])) : createCommentVNode("", true)
|
|
264
|
+
]),
|
|
265
|
+
c.shortcut ? (openBlock(), createElementBlock("kbd", _hoisted_11, toDisplayString(c.shortcut), 1)) : createCommentVNode("", true)
|
|
266
|
+
], 42, _hoisted_5);
|
|
267
|
+
}), 128))
|
|
268
|
+
], 64);
|
|
269
|
+
}), 128))
|
|
270
|
+
]),
|
|
271
|
+
_: 1
|
|
272
|
+
}, 512),
|
|
273
|
+
_cache[6] || (_cache[6] = createElementVNode("div", { class: "flex shrink-0 items-center gap-4 border-t border-line px-4 py-2.5 text-[11px] text-muted" }, [
|
|
274
|
+
createElementVNode("span", { class: "flex items-center gap-1" }, [
|
|
275
|
+
createElementVNode("kbd", { class: "rounded border border-line px-1 text-[10px]" }, "↑"),
|
|
276
|
+
createElementVNode("kbd", { class: "rounded border border-line px-1 text-[10px]" }, "↓"),
|
|
277
|
+
createTextVNode(" navigate ")
|
|
278
|
+
]),
|
|
279
|
+
createElementVNode("span", { class: "flex items-center gap-1" }, [
|
|
280
|
+
createElementVNode("kbd", { class: "rounded border border-line px-1 text-[10px]" }, "↵"),
|
|
281
|
+
createTextVNode(" select ")
|
|
282
|
+
]),
|
|
283
|
+
createElementVNode("span", { class: "ml-auto flex items-center gap-1" }, [
|
|
284
|
+
createElementVNode("kbd", { class: "rounded border border-line px-1 text-[10px]" }, "esc"),
|
|
285
|
+
createTextVNode(" close ")
|
|
286
|
+
])
|
|
287
|
+
], -1))
|
|
288
|
+
]),
|
|
289
|
+
_: 1
|
|
290
|
+
})
|
|
291
|
+
]),
|
|
292
|
+
_: 1
|
|
293
|
+
})
|
|
294
|
+
]),
|
|
295
|
+
_: 1
|
|
296
|
+
}, 8, ["open"]);
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
const _export_sfc = (sfc, props) => {
|
|
301
|
+
const target = sfc.__vccOpts || sfc;
|
|
302
|
+
for (const [key, val] of props) {
|
|
303
|
+
target[key] = val;
|
|
304
|
+
}
|
|
305
|
+
return target;
|
|
306
|
+
};
|
|
307
|
+
const LpCommandPalette = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d845063e"]]);
|
|
308
|
+
export {
|
|
309
|
+
LpCommandPalette as default
|
|
310
|
+
};
|
|
@@ -12,6 +12,13 @@ export interface ContextMenuItemDef {
|
|
|
12
12
|
}
|
|
13
13
|
type __VLS_Props = {
|
|
14
14
|
items: ContextMenuItemDef[];
|
|
15
|
+
/**
|
|
16
|
+
* Keep the reka menu mounted even while `items` is momentarily empty. Use when
|
|
17
|
+
* the items are resolved on the right-click itself (e.g. a list that figures
|
|
18
|
+
* out which row was clicked): without this the trigger would still be in
|
|
19
|
+
* native-menu mode on that first click and swallow it.
|
|
20
|
+
*/
|
|
21
|
+
always?: boolean;
|
|
15
22
|
};
|
|
16
23
|
declare var __VLS_1: {}, __VLS_16: {};
|
|
17
24
|
type __VLS_Slots = {} & {
|
|
@@ -41,6 +41,14 @@ type __VLS_Props = {
|
|
|
41
41
|
* meaningful for left/right drawers.
|
|
42
42
|
*/
|
|
43
43
|
edgeOpen?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Tailwind breakpoint above which the edge strip is disabled. Edge
|
|
46
|
+
* swipe-to-open only makes sense on mobile: the strip listens for
|
|
47
|
+
* touch/pen pointers only, so on a desktop it can never open the drawer
|
|
48
|
+
* but still overlays the screen edge and swallows clicks. Pass the same
|
|
49
|
+
* breakpoint at which the host switches to the drawer (LpSidebar does).
|
|
50
|
+
*/
|
|
51
|
+
edgeBreakpoint?: "sm" | "md" | "lg" | "xl";
|
|
44
52
|
/** Width (px) of the edge grab strip. */
|
|
45
53
|
edgeSize?: number;
|
|
46
54
|
/** Fraction (0–1) of the panel width the pull must reach to open on release. */
|
|
@@ -3,9 +3,9 @@ type __VLS_Props = {
|
|
|
3
3
|
contentClass?: string;
|
|
4
4
|
barInsetTop?: string;
|
|
5
5
|
};
|
|
6
|
-
declare var
|
|
6
|
+
declare var __VLS_40: {};
|
|
7
7
|
type __VLS_Slots = {} & {
|
|
8
|
-
default?: (props: typeof
|
|
8
|
+
default?: (props: typeof __VLS_40) => any;
|
|
9
9
|
};
|
|
10
10
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
|
|
11
11
|
viewportEl: import('vue').ComputedRef<HTMLElement | null>;
|
|
@@ -18,6 +18,8 @@ declare const __VLS_export: <V extends SelectValue = string>(__VLS_props: NonNul
|
|
|
18
18
|
searchTerm?: string;
|
|
19
19
|
loading?: boolean;
|
|
20
20
|
loadingText?: string;
|
|
21
|
+
/** Trigger height, keyed to --size-control-*. Default "md". */
|
|
22
|
+
size?: "sm" | "md" | "lg";
|
|
21
23
|
} & {
|
|
22
24
|
onChange?: ((value: V) => any) | undefined;
|
|
23
25
|
"onUpdate:modelValue"?: ((value: V | V[] | undefined) => any) | undefined;
|
|
@@ -11,8 +11,10 @@ type __VLS_Props = {
|
|
|
11
11
|
* "contained" (default) wraps the triggers in a bordered, filled bar.
|
|
12
12
|
* "plain" drops the container chrome — a flat row of tabs with only the
|
|
13
13
|
* sliding pill marking the active one (for nav bars over a custom surface).
|
|
14
|
+
* "underline" is a flat row over a hairline baseline, marking the active
|
|
15
|
+
* tab with a sliding bottom bar instead of a pill (page-section nav style).
|
|
14
16
|
*/
|
|
15
|
-
variant?: "contained" | "plain";
|
|
17
|
+
variant?: "contained" | "plain" | "underline";
|
|
16
18
|
/** Tint the active pill + label with the brand colour (nav-bar style). */
|
|
17
19
|
accent?: boolean;
|
|
18
20
|
/** Stretch the bar to full width with equal-share triggers. */
|
|
@@ -32,7 +34,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
32
34
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
33
35
|
}>, {
|
|
34
36
|
block: boolean;
|
|
35
|
-
variant: "contained" | "plain";
|
|
37
|
+
variant: "contained" | "plain" | "underline";
|
|
36
38
|
accent: boolean;
|
|
37
39
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
38
40
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|