@hina-ui/vue 1.7.9 → 1.7.10

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.
Files changed (36) hide show
  1. package/dist/index.js +197 -38
  2. package/dist/index.js.map +1 -1
  3. package/dist/shared/lib/command-palette/match.ts +17 -4
  4. package/dist/shared/lib/virtual/choices.ts +2 -1
  5. package/dist/shared/variants/command-palette.ts +12 -0
  6. package/dist/shared/variants/virtual-list.ts +8 -0
  7. package/dist/types/shared/src/lib/command-palette/match.d.ts +9 -0
  8. package/dist/types/shared/src/lib/command-palette/match.d.ts.map +1 -1
  9. package/dist/types/shared/src/lib/virtual/choices.d.ts +4 -0
  10. package/dist/types/shared/src/lib/virtual/choices.d.ts.map +1 -1
  11. package/dist/types/shared/src/variants/command-palette.d.ts +3 -0
  12. package/dist/types/shared/src/variants/command-palette.d.ts.map +1 -1
  13. package/dist/types/shared/src/variants/virtual-list.d.ts +2 -0
  14. package/dist/types/shared/src/variants/virtual-list.d.ts.map +1 -1
  15. package/dist/types/vue/src/components/command-palette/CommandPalette.vue.d.ts +2 -1
  16. package/dist/types/vue/src/components/command-palette/CommandPalette.vue.d.ts.map +1 -1
  17. package/dist/types/vue/src/components/command-palette/CommandPalettePanel.vue.d.ts +2 -1
  18. package/dist/types/vue/src/components/command-palette/CommandPalettePanel.vue.d.ts.map +1 -1
  19. package/dist/types/vue/src/components/command-palette/composables/useCommandItems.d.ts +6 -1
  20. package/dist/types/vue/src/components/command-palette/composables/useCommandItems.d.ts.map +1 -1
  21. package/dist/types/vue/src/components/command-palette/types.d.ts +3 -0
  22. package/dist/types/vue/src/components/command-palette/types.d.ts.map +1 -1
  23. package/dist/types/vue/src/components/command-palette/utils/match.d.ts +1 -1
  24. package/dist/types/vue/src/components/command-palette/utils/match.d.ts.map +1 -1
  25. package/dist/types/vue/src/components/virtual-list/VirtualChoices.vue.d.ts +4 -1
  26. package/dist/types/vue/src/components/virtual-list/VirtualChoices.vue.d.ts.map +1 -1
  27. package/dist/types/vue/src/index.d.ts +1 -1
  28. package/dist/types/vue/src/index.d.ts.map +1 -1
  29. package/package.json +1 -1
  30. package/src/components/command-palette/CommandPalette.vue +8 -0
  31. package/src/components/command-palette/CommandPalettePanel.vue +85 -3
  32. package/src/components/command-palette/composables/useCommandItems.ts +19 -13
  33. package/src/components/command-palette/types.ts +4 -0
  34. package/src/components/command-palette/utils/match.ts +1 -0
  35. package/src/components/virtual-list/VirtualChoices.vue +39 -6
  36. package/src/index.ts +1 -0
package/dist/index.js CHANGED
@@ -3540,7 +3540,7 @@ var _hoisted_1$122 = [
3540
3540
  "onLoad"
3541
3541
  ];
3542
3542
  var _hoisted_2$70 = ["src"];
3543
- var _hoisted_3$37 = [
3543
+ var _hoisted_3$38 = [
3544
3544
  "src",
3545
3545
  "alt",
3546
3546
  "onLoad"
@@ -3636,7 +3636,7 @@ var LightboxStrip_default = /* @__PURE__ */ defineComponent({
3636
3636
  draggable: "false",
3637
3637
  class: "block size-full object-contain",
3638
3638
  onLoad: ($event) => emit("learn", slide.item.id, $event.target)
3639
- }, null, 40, _hoisted_3$37)]),
3639
+ }, null, 40, _hoisted_3$38)]),
3640
3640
  _: 2
3641
3641
  }, 1032, [
3642
3642
  "style",
@@ -6340,9 +6340,9 @@ function useScrollFocus(host, viewport, options) {
6340
6340
  //#region src/components/scroll-area/ScrollArea.vue?vue&type=script&setup=true&lang.ts
6341
6341
  var _hoisted_1$121 = ["dir"];
6342
6342
  var _hoisted_2$69 = ["data-visible"];
6343
- var _hoisted_3$36 = ["data-visible"];
6344
- var _hoisted_4$30 = ["data-visible"];
6345
- var _hoisted_5$23 = ["data-visible"];
6343
+ var _hoisted_3$37 = ["data-visible"];
6344
+ var _hoisted_4$31 = ["data-visible"];
6345
+ var _hoisted_5$24 = ["data-visible"];
6346
6346
  //#endregion
6347
6347
  //#region src/components/scroll-area/ScrollArea.vue
6348
6348
  var ScrollArea_default = /* @__PURE__ */ defineComponent({
@@ -6437,21 +6437,21 @@ var ScrollArea_default = /* @__PURE__ */ defineComponent({
6437
6437
  "data-side": "x-end",
6438
6438
  "data-visible": unref(showXEnd) ? "" : void 0,
6439
6439
  "aria-hidden": "true"
6440
- }, null, 8, _hoisted_3$36)) : createCommentVNode("", true),
6440
+ }, null, 8, _hoisted_3$37)) : createCommentVNode("", true),
6441
6441
  props.direction !== "horizontal" ? (openBlock(), createElementBlock("div", {
6442
6442
  key: 2,
6443
6443
  class: "hn-scroll-shadow",
6444
6444
  "data-side": "y-start",
6445
6445
  "data-visible": unref(showYStart) ? "" : void 0,
6446
6446
  "aria-hidden": "true"
6447
- }, null, 8, _hoisted_4$30)) : createCommentVNode("", true),
6447
+ }, null, 8, _hoisted_4$31)) : createCommentVNode("", true),
6448
6448
  props.direction !== "horizontal" ? (openBlock(), createElementBlock("div", {
6449
6449
  key: 3,
6450
6450
  class: "hn-scroll-shadow",
6451
6451
  "data-side": "y-end",
6452
6452
  "data-visible": unref(showYEnd) ? "" : void 0,
6453
6453
  "aria-hidden": "true"
6454
- }, null, 8, _hoisted_5$23)) : createCommentVNode("", true)
6454
+ }, null, 8, _hoisted_5$24)) : createCommentVNode("", true)
6455
6455
  ], 64)) : createCommentVNode("", true)], 10, _hoisted_1$121);
6456
6456
  };
6457
6457
  }
@@ -6519,7 +6519,7 @@ var _hoisted_2$68 = [
6519
6519
  "aria-current",
6520
6520
  "onClick"
6521
6521
  ];
6522
- var _hoisted_3$35 = ["src"];
6522
+ var _hoisted_3$36 = ["src"];
6523
6523
  //#endregion
6524
6524
  //#region src/components/lightbox/LightboxThumbs.vue
6525
6525
  var LightboxThumbs_default = /* @__PURE__ */ defineComponent({
@@ -6572,7 +6572,7 @@ var LightboxThumbs_default = /* @__PURE__ */ defineComponent({
6572
6572
  alt: "",
6573
6573
  draggable: "false",
6574
6574
  class: "relative -z-10 size-full object-cover"
6575
- }, null, 8, _hoisted_3$35),
6575
+ }, null, 8, _hoisted_3$36),
6576
6576
  at === props.index ? (openBlock(), createBlock(Highlight_default, {
6577
6577
  key: 0,
6578
6578
  id: unref(highlightId),
@@ -9199,9 +9199,9 @@ var _hoisted_1$114 = {
9199
9199
  class: "hn-collapse"
9200
9200
  };
9201
9201
  var _hoisted_2$64 = { class: "hn-collapse-body" };
9202
- var _hoisted_3$34 = ["role"];
9203
- var _hoisted_4$29 = { class: "flex min-w-0 flex-1 flex-col gap-1" };
9204
- var _hoisted_5$22 = {
9202
+ var _hoisted_3$35 = ["role"];
9203
+ var _hoisted_4$30 = { class: "flex min-w-0 flex-1 flex-col gap-1" };
9204
+ var _hoisted_5$23 = {
9205
9205
  key: 0,
9206
9206
  class: "text-fg font-medium"
9207
9207
  };
@@ -9258,7 +9258,7 @@ var Alert_default = /* @__PURE__ */ defineComponent({
9258
9258
  class: normalizeClass(unref(calloutIcon)({ tone: props.tone })),
9259
9259
  "aria-hidden": "true"
9260
9260
  }, null, 8, ["class"])) : createCommentVNode("", true)]),
9261
- createElementVNode("div", _hoisted_4$29, [props.title ? (openBlock(), createElementBlock("p", _hoisted_5$22, toDisplayString(props.title), 1)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default")]),
9261
+ createElementVNode("div", _hoisted_4$30, [props.title ? (openBlock(), createElementBlock("p", _hoisted_5$23, toDisplayString(props.title), 1)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default")]),
9262
9262
  unref(slots).actions ? (openBlock(), createElementBlock("div", _hoisted_6$15, [renderSlot(_ctx.$slots, "actions")])) : createCommentVNode("", true),
9263
9263
  props.closable ? (openBlock(), createBlock(CloseButton_default, {
9264
9264
  key: 1,
@@ -9266,7 +9266,7 @@ var Alert_default = /* @__PURE__ */ defineComponent({
9266
9266
  class: "-my-0.5 -me-1",
9267
9267
  onClick: close
9268
9268
  })) : createCommentVNode("", true)
9269
- ], 10, _hoisted_3$34)])])) : createCommentVNode("", true)]),
9269
+ ], 10, _hoisted_3$35)])])) : createCommentVNode("", true)]),
9270
9270
  _: 3
9271
9271
  }, 16);
9272
9272
  };
@@ -10979,6 +10979,7 @@ function choiceRows(items, query, contains) {
10979
10979
  result.push({
10980
10980
  key: `group:${groupIndex}`,
10981
10981
  label: item.label,
10982
+ source: item,
10982
10983
  position: 0
10983
10984
  });
10984
10985
  for (const option of options) result.push({
@@ -11255,6 +11256,8 @@ var virtualListContent = tv({
11255
11256
  horizontal: "flex-row"
11256
11257
  } }
11257
11258
  });
11259
+ var virtualChoiceHeadings = tv({ base: "pointer-events-none absolute inset-0 z-1 p-[inherit]" });
11260
+ var virtualChoiceHeading = tv({ base: "pointer-events-auto absolute inset-x-0" });
11258
11261
  var virtualListItem = tv({
11259
11262
  base: "flow-root min-w-0 shrink-0",
11260
11263
  variants: { orientation: {
@@ -11267,6 +11270,9 @@ var virtualListStatus = tv({ base: "text-muted flex shrink-0 items-center justif
11267
11270
  //#region src/components/virtual-list/VirtualChoices.vue?vue&type=script&setup=true&lang.ts
11268
11271
  var _hoisted_1$111 = ["data-index"];
11269
11272
  var _hoisted_2$62 = ["id"];
11273
+ var _hoisted_3$34 = ["id"];
11274
+ var _hoisted_4$29 = { class: "relative" };
11275
+ var _hoisted_5$22 = ["data-index"];
11270
11276
  //#endregion
11271
11277
  //#region src/components/virtual-list/VirtualChoices.vue
11272
11278
  var VirtualChoices_default = /* @__PURE__ */ defineComponent({
@@ -11286,6 +11292,9 @@ var VirtualChoices_default = /* @__PURE__ */ defineComponent({
11286
11292
  const props = __props;
11287
11293
  const t = useUiLocale();
11288
11294
  const { area, body, rows, entries, bodyStyle, measure, itemAttrs, labelId } = useVirtualChoices(props);
11295
+ const slots = useSlots();
11296
+ const held = (index) => !!slots.group && !rows.value[index].option;
11297
+ const origin = computed(() => entries.value[0] ? entries.value[0].start - parseFloat(bodyStyle.value.paddingBlockStart) : 0);
11289
11298
  return (_ctx, _cache) => {
11290
11299
  return openBlock(), createBlock(ScrollArea_default, {
11291
11300
  ref_key: "area",
@@ -11293,7 +11302,7 @@ var VirtualChoices_default = /* @__PURE__ */ defineComponent({
11293
11302
  class: normalizeClass(props.class),
11294
11303
  style: normalizeStyle({ maxHeight: typeof props.maxHeight === "number" ? `${props.maxHeight}px` : props.maxHeight })
11295
11304
  }, {
11296
- default: withCtx(() => [createElementVNode("div", { class: normalizeClass(props.padded === false ? void 0 : "p-1") }, [createElementVNode("div", mergeProps({
11305
+ default: withCtx(() => [createElementVNode("div", { class: normalizeClass(unref(cn)(slots.group && "relative", props.padded !== false && "p-1") || void 0) }, [createElementVNode("div", mergeProps({
11297
11306
  ref_key: "body",
11298
11307
  ref: body
11299
11308
  }, _ctx.$attrs, {
@@ -11304,23 +11313,42 @@ var VirtualChoices_default = /* @__PURE__ */ defineComponent({
11304
11313
  return openBlock(), createElementBlock("div", {
11305
11314
  key: entry.key,
11306
11315
  ref_for: true,
11307
- ref: unref(measure),
11316
+ ref: held(entry.index) ? void 0 : unref(measure),
11308
11317
  "data-index": entry.index,
11309
11318
  role: "presentation",
11310
11319
  class: normalizeClass(unref(virtualListItem)({ orientation: "vertical" })),
11311
- style: normalizeStyle({ marginBlockStart: `${entry.gapBefore}px` })
11320
+ style: normalizeStyle({
11321
+ marginBlockStart: `${entry.gapBefore}px`,
11322
+ height: held(entry.index) ? `${entry.size}px` : void 0
11323
+ })
11312
11324
  }, [unref(rows)[entry.index].option ? renderSlot(_ctx.$slots, "default", {
11313
11325
  option: unref(rows)[entry.index].option,
11314
11326
  attrs: unref(itemAttrs)(entry.index)
11315
- }, void 0, void 0, 0) : (openBlock(), createElementBlock("div", {
11327
+ }, void 0, void 0, 0) : slots.group ? (openBlock(), createElementBlock("span", {
11316
11328
  key: 1,
11317
11329
  id: unref(labelId)(entry.index),
11330
+ hidden: ""
11331
+ }, toDisplayString(unref(rows)[entry.index].label), 9, _hoisted_2$62)) : (openBlock(), createElementBlock("div", {
11332
+ key: 2,
11333
+ id: unref(labelId)(entry.index),
11318
11334
  class: normalizeClass(unref(selectLabel)())
11319
- }, toDisplayString(unref(rows)[entry.index].label), 11, _hoisted_2$62))], 14, _hoisted_1$111);
11335
+ }, toDisplayString(unref(rows)[entry.index].label), 11, _hoisted_3$34))], 14, _hoisted_1$111);
11320
11336
  }), 128))], 16), !unref(rows).length ? (openBlock(), createElementBlock("div", {
11321
11337
  key: 0,
11322
11338
  class: normalizeClass(unref(selectEmpty)())
11323
- }, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(unref(t).select.empty), 1)])], 2)) : createCommentVNode("", true)], 2)]),
11339
+ }, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(unref(t).select.empty), 1)])], 2)) : slots.group ? (openBlock(), createElementBlock("div", {
11340
+ key: 1,
11341
+ class: normalizeClass(unref(virtualChoiceHeadings)())
11342
+ }, [createElementVNode("div", _hoisted_4$29, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(entries), (entry) => {
11343
+ return openBlock(), createElementBlock(Fragment, { key: entry.key }, [unref(rows)[entry.index].source ? (openBlock(), createElementBlock("div", {
11344
+ key: 0,
11345
+ ref_for: true,
11346
+ ref: unref(measure),
11347
+ "data-index": entry.index,
11348
+ class: normalizeClass(unref(virtualChoiceHeading)()),
11349
+ style: normalizeStyle({ top: `${entry.start - origin.value}px` })
11350
+ }, [renderSlot(_ctx.$slots, "group", { group: unref(rows)[entry.index].source })], 14, _hoisted_5$22)) : createCommentVNode("", true)], 64);
11351
+ }), 128))])], 2)) : createCommentVNode("", true)], 2)]),
11324
11352
  _: 3
11325
11353
  }, 8, ["class", "style"]);
11326
11354
  };
@@ -16029,6 +16057,9 @@ var commandItemBody = tv({ base: "flex min-w-0 flex-1 flex-col" });
16029
16057
  var commandItemMatch = tv({ base: "text-accent-text font-medium" });
16030
16058
  var commandItemHint = tv({ base: "ms-auto flex shrink-0 items-center gap-1" });
16031
16059
  var commandEmpty = tv({ base: "text-muted px-4 py-8 text-center text-sm" });
16060
+ var commandHeading = tv({ base: "text-muted flex min-h-7 items-center justify-between gap-2 px-2.5 text-xs font-medium" });
16061
+ var commandGrid = tv({ base: "grid grid-cols-[minmax(0,1fr)] p-1" });
16062
+ var commandGridRows = tv({ base: "col-start-1 grid grid-rows-subgrid" });
16032
16063
  var commandStatus = tv({ base: "border-line text-muted shrink-0 border-t px-4 py-2 text-center text-sm" });
16033
16064
  //#endregion
16034
16065
  //#region src/components/command-palette/context.ts
@@ -16221,16 +16252,34 @@ function score(item, query) {
16221
16252
  function rank(items, query) {
16222
16253
  return items.map((item) => score(item, query)).filter((match) => match !== null).sort((a, b) => b.score - a.score);
16223
16254
  }
16255
+ function layoutCommandSections(sections) {
16256
+ let row = 1;
16257
+ const placed = sections.map((section) => {
16258
+ const span = section.matches.length + (section.group ? 1 : 0);
16259
+ const entry = {
16260
+ section,
16261
+ row,
16262
+ span
16263
+ };
16264
+ row += span;
16265
+ return entry;
16266
+ });
16267
+ return {
16268
+ rows: Math.max(row - 1, 1),
16269
+ sections: placed
16270
+ };
16271
+ }
16224
16272
  function filterCommands(items, query) {
16225
16273
  const q = query.trim().toLowerCase();
16226
16274
  const sections = [];
16227
16275
  let loose = [];
16228
- const push = (label, entries) => {
16276
+ const push = (group, entries) => {
16229
16277
  const ranked = rank(entries, q);
16230
16278
  if (ranked.length === 0) return;
16231
16279
  sections.push({
16232
16280
  key: String(sections.length),
16233
- label,
16281
+ label: group?.label,
16282
+ group,
16234
16283
  best: ranked[0].score,
16235
16284
  matches: ranked.map(({ item, start, end }) => ({
16236
16285
  item,
@@ -16250,13 +16299,14 @@ function filterCommands(items, query) {
16250
16299
  continue;
16251
16300
  }
16252
16301
  flush();
16253
- push(entry.label, entry.items);
16302
+ push(entry, entry.items);
16254
16303
  }
16255
16304
  flush();
16256
16305
  if (q) sections.sort((a, b) => b.best - a.best);
16257
- return sections.map(({ key, label, matches }) => ({
16306
+ return sections.map(({ key, label, group, matches }) => ({
16258
16307
  key,
16259
16308
  label,
16309
+ group,
16260
16310
  matches
16261
16311
  }));
16262
16312
  }
@@ -16280,9 +16330,10 @@ function useCommandItems(props, search) {
16280
16330
  description: match.item.description,
16281
16331
  match
16282
16332
  }));
16283
- return section.label ? [{
16284
- label: section.label,
16285
- options
16333
+ return section.group ? [{
16334
+ label: section.group.label,
16335
+ options,
16336
+ group: section.group
16286
16337
  }] : options;
16287
16338
  }))
16288
16339
  };
@@ -16311,10 +16362,19 @@ var CommandPalettePanel_default = /* @__PURE__ */ defineComponent({
16311
16362
  setup(__props, { emit: __emit }) {
16312
16363
  const props = __props;
16313
16364
  const emit = __emit;
16365
+ const slots = useSlots();
16314
16366
  const search = useModel(__props, "search");
16315
16367
  const t = useUiLocale();
16316
16368
  const input = shallowRef();
16317
16369
  const { sections, options } = useCommandItems(props, () => search.value);
16370
+ const layout = computed(() => slots.heading ? layoutCommandSections(sections.value) : void 0);
16371
+ function returnFocus() {
16372
+ nextTick(() => {
16373
+ const field = input.value;
16374
+ const active = document.activeElement;
16375
+ if (field?.isConnected && (!active || active === document.body || active.contains(field))) field.focus({ preventScroll: true });
16376
+ });
16377
+ }
16318
16378
  function select(item) {
16319
16379
  const field = input.value;
16320
16380
  const panel = field?.closest("[data-hn-command-palette]");
@@ -16362,7 +16422,7 @@ var CommandPalettePanel_default = /* @__PURE__ */ defineComponent({
16362
16422
  input: input.value,
16363
16423
  kind: "listbox",
16364
16424
  class: normalizeClass(unref(commandList)())
16365
- }, {
16425
+ }, createSlots({
16366
16426
  default: withCtx(({ option, attrs }) => [createVNode(CommandPaletteItem_default, mergeProps(attrs, {
16367
16427
  match: option.match,
16368
16428
  onSelect: ($event) => select(option.match.item)
@@ -16375,8 +16435,17 @@ var CommandPalettePanel_default = /* @__PURE__ */ defineComponent({
16375
16435
  key: "0"
16376
16436
  } : void 0]), 1040, ["match", "onSelect"])]),
16377
16437
  empty: withCtx(() => [props.loading ? renderSlot(_ctx.$slots, "loading", {}, () => [createTextVNode(toDisplayString(unref(t).common.loading), 1)], void 0, 0) : renderSlot(_ctx.$slots, "empty", { search: search.value }, () => [createTextVNode(toDisplayString(unref(t).command.empty), 1)], void 0, 1)]),
16378
- _: 3
16379
- }, 8, [
16438
+ _: 2
16439
+ }, [_ctx.$slots.heading ? {
16440
+ name: "group",
16441
+ fn: withCtx(({ group }) => [createElementVNode("div", {
16442
+ "data-hn-command-heading": "",
16443
+ class: normalizeClass(unref(commandHeading)()),
16444
+ onMousedown: _cache[0] || (_cache[0] = withModifiers(() => {}, ["prevent"])),
16445
+ onClick: returnFocus
16446
+ }, [renderSlot(_ctx.$slots, "heading", { group: group.group })], 34)]),
16447
+ key: "0"
16448
+ } : void 0]), 1032, [
16380
16449
  "options",
16381
16450
  "virtualize",
16382
16451
  "input",
@@ -16387,7 +16456,87 @@ var CommandPalettePanel_default = /* @__PURE__ */ defineComponent({
16387
16456
  key: 3,
16388
16457
  class: normalizeClass(unref(commandList)())
16389
16458
  }, {
16390
- default: withCtx(() => [createVNode(unref(ListboxContent), {
16459
+ default: withCtx(() => [layout.value ? (openBlock(), createElementBlock("div", {
16460
+ key: 0,
16461
+ class: normalizeClass(unref(commandGrid)())
16462
+ }, [createVNode(unref(ListboxContent), {
16463
+ "aria-label": props.label,
16464
+ "aria-busy": props.loading || void 0,
16465
+ class: normalizeClass(unref(commandGridRows)()),
16466
+ style: normalizeStyle({ gridRow: `1 / span ${layout.value.rows}` })
16467
+ }, {
16468
+ default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(layout.value.sections, ({ section, row, span }) => {
16469
+ return openBlock(), createElementBlock(Fragment, { key: section.key }, [section.group ? (openBlock(), createBlock(unref(ListboxGroup), {
16470
+ key: 0,
16471
+ "aria-label": section.group.label,
16472
+ "aria-labelledby": void 0,
16473
+ class: normalizeClass(unref(commandGridRows)()),
16474
+ style: normalizeStyle({ gridRow: `${row} / span ${span}` })
16475
+ }, {
16476
+ default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(section.matches, (match, index) => {
16477
+ return openBlock(), createBlock(CommandPaletteItem_default, {
16478
+ key: match.item.id,
16479
+ match,
16480
+ style: normalizeStyle({ gridRow: index + 2 }),
16481
+ onSelect: ($event) => select(match.item)
16482
+ }, createSlots({ _: 2 }, [_ctx.$slots.item ? {
16483
+ name: "default",
16484
+ fn: withCtx(() => [renderSlot(_ctx.$slots, "item", {
16485
+ item: match.item,
16486
+ match: unref(commandMatchRange)(match)
16487
+ })]),
16488
+ key: "0"
16489
+ } : void 0]), 1032, [
16490
+ "match",
16491
+ "style",
16492
+ "onSelect"
16493
+ ]);
16494
+ }), 128))]),
16495
+ _: 2
16496
+ }, 1032, [
16497
+ "aria-label",
16498
+ "class",
16499
+ "style"
16500
+ ])) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(section.matches, (match, index) => {
16501
+ return openBlock(), createBlock(CommandPaletteItem_default, {
16502
+ key: match.item.id,
16503
+ match,
16504
+ style: normalizeStyle({ gridRow: row + index }),
16505
+ onSelect: ($event) => select(match.item)
16506
+ }, createSlots({ _: 2 }, [_ctx.$slots.item ? {
16507
+ name: "default",
16508
+ fn: withCtx(() => [renderSlot(_ctx.$slots, "item", {
16509
+ item: match.item,
16510
+ match: unref(commandMatchRange)(match)
16511
+ })]),
16512
+ key: "0"
16513
+ } : void 0]), 1032, [
16514
+ "match",
16515
+ "style",
16516
+ "onSelect"
16517
+ ]);
16518
+ }), 128))], 64);
16519
+ }), 128))]),
16520
+ _: 3
16521
+ }, 8, [
16522
+ "aria-label",
16523
+ "aria-busy",
16524
+ "class",
16525
+ "style"
16526
+ ]), (openBlock(true), createElementBlock(Fragment, null, renderList(layout.value.sections, ({ section, row }) => {
16527
+ return openBlock(), createElementBlock(Fragment, { key: section.key }, [section.group ? (openBlock(), createElementBlock("div", {
16528
+ key: 0,
16529
+ "data-hn-command-heading": "",
16530
+ class: normalizeClass(unref(commandHeading)()),
16531
+ style: normalizeStyle({
16532
+ gridRow: row,
16533
+ gridColumn: 1
16534
+ }),
16535
+ onMousedown: _cache[1] || (_cache[1] = withModifiers(() => {}, ["prevent"])),
16536
+ onClick: returnFocus
16537
+ }, [renderSlot(_ctx.$slots, "heading", { group: section.group })], 38)) : createCommentVNode("", true)], 64);
16538
+ }), 128))], 2)) : (openBlock(), createBlock(unref(ListboxContent), {
16539
+ key: 1,
16391
16540
  "aria-label": props.label,
16392
16541
  "aria-busy": props.loading || void 0,
16393
16542
  class: normalizeClass(unref(selectListBody)())
@@ -16432,8 +16581,8 @@ var CommandPalettePanel_default = /* @__PURE__ */ defineComponent({
16432
16581
  "aria-label",
16433
16582
  "aria-busy",
16434
16583
  "class"
16435
- ]), unref(sections).length === 0 ? (openBlock(), createElementBlock("div", {
16436
- key: 0,
16584
+ ])), unref(sections).length === 0 ? (openBlock(), createElementBlock("div", {
16585
+ key: 2,
16437
16586
  role: "status",
16438
16587
  class: normalizeClass(unref(commandEmpty)())
16439
16588
  }, [props.loading ? renderSlot(_ctx.$slots, "loading", {}, () => [createTextVNode(toDisplayString(unref(t).common.loading), 1)], void 0, 0) : renderSlot(_ctx.$slots, "empty", { search: search.value }, () => [createTextVNode(toDisplayString(unref(t).command.empty), 1)], void 0, 1)], 2)) : createCommentVNode("", true)]),
@@ -16554,15 +16703,20 @@ var CommandPalette_default = /* @__PURE__ */ defineComponent({
16554
16703
  fn: withCtx((slotProps) => [renderSlot(_ctx.$slots, "item", normalizeProps(guardReactiveProps(slotProps)))]),
16555
16704
  key: "1"
16556
16705
  } : void 0,
16706
+ _ctx.$slots.heading ? {
16707
+ name: "heading",
16708
+ fn: withCtx((slotProps) => [renderSlot(_ctx.$slots, "heading", normalizeProps(guardReactiveProps(slotProps)))]),
16709
+ key: "2"
16710
+ } : void 0,
16557
16711
  _ctx.$slots.loading ? {
16558
16712
  name: "loading",
16559
16713
  fn: withCtx(() => [renderSlot(_ctx.$slots, "loading")]),
16560
- key: "2"
16714
+ key: "3"
16561
16715
  } : void 0,
16562
16716
  _ctx.$slots.empty ? {
16563
16717
  name: "empty",
16564
16718
  fn: withCtx((slotProps) => [renderSlot(_ctx.$slots, "empty", normalizeProps(guardReactiveProps(slotProps)))]),
16565
- key: "3"
16719
+ key: "4"
16566
16720
  } : void 0
16567
16721
  ]), 1040, [
16568
16722
  "search",
@@ -16618,15 +16772,20 @@ var CommandPalette_default = /* @__PURE__ */ defineComponent({
16618
16772
  fn: withCtx((slotProps) => [renderSlot(_ctx.$slots, "item", normalizeProps(guardReactiveProps(slotProps)))]),
16619
16773
  key: "1"
16620
16774
  } : void 0,
16775
+ _ctx.$slots.heading ? {
16776
+ name: "heading",
16777
+ fn: withCtx((slotProps) => [renderSlot(_ctx.$slots, "heading", normalizeProps(guardReactiveProps(slotProps)))]),
16778
+ key: "2"
16779
+ } : void 0,
16621
16780
  _ctx.$slots.loading ? {
16622
16781
  name: "loading",
16623
16782
  fn: withCtx(() => [renderSlot(_ctx.$slots, "loading")]),
16624
- key: "2"
16783
+ key: "3"
16625
16784
  } : void 0,
16626
16785
  _ctx.$slots.empty ? {
16627
16786
  name: "empty",
16628
16787
  fn: withCtx((slotProps) => [renderSlot(_ctx.$slots, "empty", normalizeProps(guardReactiveProps(slotProps)))]),
16629
- key: "3"
16788
+ key: "4"
16630
16789
  } : void 0
16631
16790
  ]), 1040, [
16632
16791
  "search",