@leavepulse/ui 0.40.0 → 0.41.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.
Files changed (41) hide show
  1. package/dist/assets/LpCommandPalette-DyT6aGdW.css +85 -0
  2. package/dist/assets/{LpShortcutsDialog-Cap_ALQM.css → LpShortcutsDialog-C6YoQ8_M.css} +7 -7
  3. package/dist/chunks/{LpAddressInput-H5NdhK6c.js → LpAddressInput-CMjaPQVw.js} +1 -1
  4. package/dist/chunks/{LpAppShell-BfqSA1ba.js → LpAppShell-Bcv6EhqU.js} +1 -1
  5. package/dist/chunks/{LpConfirmDialog-BBRnMkV4.js → LpConfirmDialog-BNAvOR24.js} +2 -2
  6. package/dist/chunks/{LpDrawer-B8vBnCWF.js → LpDrawer-DgaS2s2i.js} +6 -4
  7. package/dist/chunks/{LpModal-EyEdRuqF.js → LpModal-8bja5bWS.js} +5 -3
  8. package/dist/chunks/{LpModalNav-BrDtP7b_.js → LpModalNav-w9kfwHqO.js} +3 -3
  9. package/dist/chunks/{LpSidebar-DZ20iBxY.js → LpSidebar-DlTn5nXc.js} +1 -1
  10. package/dist/components/LpAddressInput.vue.js +1 -1
  11. package/dist/components/LpAppShell.vue.js +1 -1
  12. package/dist/components/LpCommandPalette.vue.d.ts +2 -1
  13. package/dist/components/LpCommandPalette.vue.js +12 -13
  14. package/dist/components/LpConfirmDialog.vue.d.ts +2 -1
  15. package/dist/components/LpConfirmDialog.vue.js +1 -1
  16. package/dist/components/LpDrawer.vue.d.ts +4 -2
  17. package/dist/components/LpDrawer.vue.js +1 -1
  18. package/dist/components/LpModal.vue.d.ts +2 -1
  19. package/dist/components/LpModal.vue.js +1 -1
  20. package/dist/components/LpModalNav.vue.d.ts +2 -1
  21. package/dist/components/LpModalNav.vue.js +1 -1
  22. package/dist/components/LpShortcutsDialog.vue.d.ts +8 -11
  23. package/dist/components/LpShortcutsDialog.vue.js +14 -9
  24. package/dist/components/LpSidebar.vue.js +1 -1
  25. package/dist/composables/useGlass.d.ts +9 -0
  26. package/dist/composables/useGlass.js +13 -0
  27. package/dist/composables/useHotkeys.d.ts +41 -2
  28. package/dist/composables/useHotkeys.js +57 -4
  29. package/dist/index.d.ts +3 -3
  30. package/dist/index.js +13 -8
  31. package/package.json +1 -1
  32. package/src/components/LpCommandPalette.vue +48 -26
  33. package/src/components/LpConfirmDialog.vue +2 -2
  34. package/src/components/LpDrawer.vue +9 -5
  35. package/src/components/LpModal.vue +8 -4
  36. package/src/components/LpModalNav.vue +2 -1
  37. package/src/components/LpShortcutsDialog.vue +32 -23
  38. package/src/composables/useGlass.ts +25 -0
  39. package/src/composables/useHotkeys.ts +107 -6
  40. package/src/index.ts +9 -3
  41. package/dist/assets/LpCommandPalette-B5eZBHox.css +0 -64
@@ -0,0 +1,85 @@
1
+
2
+ /*
3
+ * Sizes for the split layout. Only the dialog's width animates: the list and
4
+ * the pane keep fixed widths, and the dialog — overflow hidden — uncovers the
5
+ * pane from its right edge as it grows. Animating the columns themselves made
6
+ * every line of the list and the pane re-wrap on every frame.
7
+ */
8
+ .lp-cmd-dialog[data-v-19283172] {
9
+ --lp-cmd-list: min(92vw, 40rem);
10
+ --lp-cmd-pane: max(0px, min(26rem, 96vw - var(--lp-cmd-list)));
11
+ width: var(--lp-cmd-list);
12
+ }
13
+ .lp-cmd-split[data-v-19283172] {
14
+ transition:
15
+ width 300ms var(--ease-emphasized, ease),
16
+ min-height 300ms var(--ease-emphasized, ease);
17
+ }
18
+ @media (min-width: 768px) {
19
+ .lp-cmd-split .lp-cmd-list[data-v-19283172] {
20
+ flex: 0 0 auto;
21
+ /* the dialog's 1px border on each side */
22
+ width: calc(var(--lp-cmd-list) - 2px);
23
+ }
24
+ .lp-cmd-dialog[data-pane="open"][data-v-19283172] {
25
+ width: calc(var(--lp-cmd-list) + var(--lp-cmd-pane));
26
+ min-height: min(76vh, 36rem);
27
+ }
28
+ }
29
+ .lp-cmd-pane[data-v-19283172] {
30
+ width: var(--lp-cmd-pane);
31
+ }
32
+ /*
33
+ * The pane rides in from the right edge while the dialog opens up to it, and
34
+ * leaves the same way, for as long as the dialog takes to close over it.
35
+ */
36
+ .lp-cmd-pane-enter-active[data-v-19283172],
37
+ .lp-cmd-pane-leave-active[data-v-19283172] {
38
+ transition:
39
+ transform 300ms var(--ease-emphasized, ease),
40
+ opacity 300ms ease;
41
+ }
42
+ .lp-cmd-pane-enter-from[data-v-19283172],
43
+ .lp-cmd-pane-leave-to[data-v-19283172] {
44
+ opacity: 0;
45
+ transform: translateX(40%);
46
+ }
47
+ .lp-cmd-para[data-v-19283172] {
48
+ animation: lp-cmd-para-in-19283172 260ms ease-out both;
49
+ }
50
+ @keyframes lp-cmd-para-in-19283172 {
51
+ from {
52
+ opacity: 0;
53
+ transform: translateY(4px);
54
+ }
55
+ }
56
+ @media (prefers-reduced-motion: reduce) {
57
+ .lp-cmd-split[data-v-19283172],
58
+ .lp-cmd-pane-enter-active[data-v-19283172],
59
+ .lp-cmd-pane-leave-active[data-v-19283172] {
60
+ transition: none;
61
+ }
62
+ .lp-cmd-para[data-v-19283172] {
63
+ animation: none;
64
+ }
65
+ }
66
+ .lp-cmd-excerpt[data-v-19283172] {
67
+ display: -webkit-box;
68
+ -webkit-box-orient: vertical;
69
+ overflow: hidden;
70
+ }
71
+ /* Each result eases in; honours reduced motion. */
72
+ .lp-cmd-item[data-v-19283172] {
73
+ animation: lp-cmd-in-19283172 140ms ease-out both;
74
+ }
75
+ @keyframes lp-cmd-in-19283172 {
76
+ from {
77
+ opacity: 0;
78
+ transform: translateY(3px);
79
+ }
80
+ }
81
+ @media (prefers-reduced-motion: reduce) {
82
+ .lp-cmd-item[data-v-19283172] {
83
+ animation: none;
84
+ }
85
+ }
@@ -1,12 +1,12 @@
1
1
 
2
2
  /* Two columns where there is room: the list is long enough that one column
3
3
  pushes the last group off a laptop screen. */
4
- .shortcut-groups[data-v-7b1cdfeb] {
4
+ .shortcut-groups[data-v-8af3bafc] {
5
5
  display: grid;
6
6
  gap: 18px;
7
7
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
8
8
  }
9
- .shortcut-group h3[data-v-7b1cdfeb] {
9
+ .shortcut-group h3[data-v-8af3bafc] {
10
10
  margin: 0 0 6px;
11
11
  color: var(--color-muted);
12
12
  font-size: 0.7rem;
@@ -14,31 +14,31 @@
14
14
  letter-spacing: 0.06em;
15
15
  text-transform: uppercase;
16
16
  }
17
- .shortcut-group dl[data-v-7b1cdfeb] {
17
+ .shortcut-group dl[data-v-8af3bafc] {
18
18
  display: flex;
19
19
  flex-direction: column;
20
20
  gap: 1px;
21
21
  margin: 0;
22
22
  }
23
- .shortcut-row[data-v-7b1cdfeb] {
23
+ .shortcut-row[data-v-8af3bafc] {
24
24
  display: flex;
25
25
  align-items: center;
26
26
  justify-content: space-between;
27
27
  gap: 12px;
28
28
  padding: 5px 0;
29
29
  }
30
- .shortcut-row dt[data-v-7b1cdfeb] {
30
+ .shortcut-row dt[data-v-8af3bafc] {
31
31
  color: var(--color-ink);
32
32
  font-size: 0.82rem;
33
33
  min-width: 0;
34
34
  }
35
- .shortcut-row dd[data-v-7b1cdfeb] {
35
+ .shortcut-row dd[data-v-8af3bafc] {
36
36
  display: flex;
37
37
  flex-shrink: 0;
38
38
  gap: 3px;
39
39
  margin: 0;
40
40
  }
41
- kbd[data-v-7b1cdfeb] {
41
+ kbd[data-v-8af3bafc] {
42
42
  display: inline-flex;
43
43
  min-width: 20px;
44
44
  align-items: center;
@@ -6,7 +6,7 @@ import { _ as _sfc_main$3 } from "./LpButton-5VXXCjwF.js";
6
6
  import { _ as _sfc_main$1 } from "./LpFormField-CazBc2-a.js";
7
7
  import { _ as _sfc_main$4 } from "./LpIcon-CCnX5_2j.js";
8
8
  import { _ as _sfc_main$5 } from "./LpInput-9EXWUM9B.js";
9
- import { _ as _sfc_main$7 } from "./LpModal-EyEdRuqF.js";
9
+ import { _ as _sfc_main$7 } from "./LpModal-8bja5bWS.js";
10
10
  import { _ as _sfc_main$6 } from "./LpSelect-ANIVtrpM.js";
11
11
  import { useMergedAttrs } from "../composables/useMergedClass.js";
12
12
  const _hoisted_1 = { class: "flex items-stretch gap-2" };
@@ -3,7 +3,7 @@ import { _ as _sfc_main$2 } from "./LpButton-5VXXCjwF.js";
3
3
  import { _ as _sfc_main$3 } from "./LpIcon-CCnX5_2j.js";
4
4
  import { _ as _sfc_main$5 } from "./LpScrollArea-D8xyKXcF.js";
5
5
  import { _ as _sfc_main$4 } from "./LpShift-DXNsauQZ.js";
6
- import { _ as _sfc_main$1 } from "./LpSidebar-DZ20iBxY.js";
6
+ import { _ as _sfc_main$1 } from "./LpSidebar-DlTn5nXc.js";
7
7
  import { useMergedAttrs } from "../composables/useMergedClass.js";
8
8
  const _hoisted_1 = { class: "flex min-w-0 flex-1 flex-col" };
9
9
  const _hoisted_2 = { class: "relative flex h-16 shrink-0 items-center gap-3 border-b border-line bg-surface px-4 md:px-6" };
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, computed, openBlock, createBlock, createSlots, withCtx, renderSlot, createVNode, createTextVNode, toDisplayString, createElementVNode, normalizeClass } from "vue";
2
2
  import { _ as _sfc_main$2 } from "./LpButton-5VXXCjwF.js";
3
3
  import { _ as _sfc_main$3 } from "./LpIcon-CCnX5_2j.js";
4
- import { _ as _sfc_main$1 } from "./LpModal-EyEdRuqF.js";
4
+ import { _ as _sfc_main$1 } from "./LpModal-8bja5bWS.js";
5
5
  const _hoisted_1 = { class: "inline-flex items-center gap-2.5" };
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  __name: "LpConfirmDialog",
@@ -15,7 +15,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
15
15
  icon: {},
16
16
  loading: { type: Boolean },
17
17
  loadingLabel: { default: "Working…" },
18
- glass: { type: Boolean }
18
+ glass: { type: Boolean, default: void 0 }
19
19
  },
20
20
  emits: ["update:open", "confirm", "cancel"],
21
21
  setup(__props, { emit: __emit }) {
@@ -1,6 +1,7 @@
1
1
  import { ref, defineComponent, computed, watch, onBeforeUnmount, useSlots, openBlock, createElementBlock, Fragment, withDirectives, createElementVNode, normalizeStyle, unref, normalizeClass, vShow, toDisplayString, createCommentVNode, renderSlot, createVNode, withCtx, createBlock, createTextVNode } from "vue";
2
2
  import { DrawerRoot, DrawerPortal, DrawerOverlay, DrawerContent, DrawerHandle, DrawerTitle, DrawerDescription, DrawerClose } from "vaul-vue";
3
3
  import { CLOSE_ICON } from "../components/dropdown.js";
4
+ import { useGlass } from "../composables/useGlass.js";
4
5
  import { _ as _sfc_main$1 } from "./LpIcon-CCnX5_2j.js";
5
6
  import { _ as _sfc_main$2 } from "./LpScrollArea-D8xyKXcF.js";
6
7
  import { useModalLayer, anyModalOpen } from "../components/modalDepth.js";
@@ -37,11 +38,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
37
38
  resizable: { type: Boolean },
38
39
  minSize: { default: "22rem" },
39
40
  maxSize: { default: "96vw" },
40
- glass: { type: Boolean, default: false }
41
+ glass: { type: Boolean, default: void 0 }
41
42
  },
42
43
  emits: ["update:open"],
43
44
  setup(__props, { emit: __emit }) {
44
45
  const props = __props;
46
+ const frosted = useGlass(() => props.glass);
45
47
  const emit = __emit;
46
48
  const dir = computed(() => props.direction ?? props.side ?? "right");
47
49
  const isHorizontal = computed(() => dir.value === "left" || dir.value === "right");
@@ -52,7 +54,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
52
54
  watch(() => props.open, (open) => open ? claim() : release(), { immediate: true });
53
55
  onBeforeUnmount(release);
54
56
  const contentClass = computed(() => {
55
- const surface = props.glass ? "lp-glass-overlay" : "bg-surface-raised";
57
+ const surface = frosted.value ? "lp-glass-overlay" : "bg-surface-raised";
56
58
  const base = `fixed z-(--z-modal) flex flex-col border-line ${surface} shadow-panel outline-none`;
57
59
  const map = {
58
60
  left: "inset-y-0 left-0 border-r rounded-r-card",
@@ -268,7 +270,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
268
270
  return openBlock(), createElementBlock(Fragment, null, [
269
271
  __props.edgeOpen && isHorizontal.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
270
272
  withDirectives(createElementVNode("div", {
271
- class: normalizeClass(["lp-scrim pointer-events-none fixed inset-0", { "lp-scrim--light": __props.glass }]),
273
+ class: normalizeClass(["lp-scrim pointer-events-none fixed inset-0", { "lp-scrim--light": unref(frosted) }]),
272
274
  style: normalizeStyle({ zIndex: unref(layer).scrim, opacity: peek.value, transition: peeking.value || reducedMotion() ? "none" : "opacity 0.18s ease-out" })
273
275
  }, null, 6), [
274
276
  [vShow, peeking.value || peek.value > 0]
@@ -309,7 +311,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
309
311
  default: withCtx(() => [
310
312
  createVNode(unref(DrawerOverlay), {
311
313
  style: normalizeStyle({ zIndex: unref(layer).scrim }),
312
- class: normalizeClass(["lp-scrim fixed inset-0 z-(--z-overlay) data-[state=open]:animate-[fade-in_150ms_ease] data-[state=closed]:animate-[fade-out_130ms_ease]", { "lp-scrim--light": __props.glass }])
314
+ class: normalizeClass(["lp-scrim fixed inset-0 z-(--z-overlay) data-[state=open]:animate-[fade-in_150ms_ease] data-[state=closed]:animate-[fade-out_130ms_ease]", { "lp-scrim--light": unref(frosted) }])
313
315
  }, null, 8, ["style", "class"]),
314
316
  createVNode(unref(DrawerContent), {
315
317
  class: normalizeClass(contentClass.value),
@@ -1,5 +1,6 @@
1
1
  import { defineComponent, computed, useSlots, watch, onBeforeUnmount, ref, openBlock, createBlock, unref, withCtx, createVNode, normalizeStyle, normalizeClass, createElementVNode, mergeProps, createElementBlock, renderSlot, createCommentVNode, createTextVNode, toDisplayString } from "vue";
2
2
  import { DialogRoot, DialogPortal, DialogOverlay, DialogContent, DialogTitle, DialogDescription, DialogClose } from "reka-ui";
3
+ import { useGlass } from "../composables/useGlass.js";
3
4
  import { useShift } from "../composables/useShift.js";
4
5
  import { useModalLayer } from "../components/modalDepth.js";
5
6
  import { CLOSE_ICON } from "../components/dropdown.js";
@@ -34,12 +35,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
34
35
  width: {},
35
36
  fillBody: { type: Boolean },
36
37
  autoFocus: { default: "auto" },
37
- glass: { type: Boolean, default: false }
38
+ glass: { type: Boolean, default: void 0 }
38
39
  },
39
40
  emits: ["update:open"],
40
41
  setup(__props) {
41
42
  const { claim, release, layer } = useModalLayer();
42
43
  const props = __props;
44
+ const frosted = useGlass(() => props.glass);
43
45
  const onInteractOutside = (event) => {
44
46
  const target = event.target;
45
47
  if (target instanceof Element && target.closest("[data-lp-modal-aside]")) {
@@ -124,7 +126,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
124
126
  createVNode(unref(DialogPortal), null, {
125
127
  default: withCtx(() => [
126
128
  createVNode(unref(DialogOverlay), {
127
- class: normalizeClass([{ "lp-scrim--light": __props.glass }, "lp-scrim fixed inset-0 data-[state=open]:animate-[fade-in_var(--duration-medium)_var(--ease-emphasized)] data-[state=closed]:animate-[fade-out_120ms_ease]"]),
129
+ class: normalizeClass([{ "lp-scrim--light": unref(frosted) }, "lp-scrim fixed inset-0 data-[state=open]:animate-[fade-in_var(--duration-medium)_var(--ease-emphasized)] data-[state=closed]:animate-[fade-out_120ms_ease]"]),
128
130
  style: normalizeStyle({ zIndex: unref(layer).scrim })
129
131
  }, null, 8, ["class", "style"]),
130
132
  createElementVNode("div", {
@@ -146,7 +148,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
146
148
  createElementVNode("div", {
147
149
  ref_key: "panelRef",
148
150
  ref: panelRef,
149
- class: normalizeClass(["flex max-h-[min(90vh,calc(100dvh-2rem))] min-h-0 flex-col overflow-hidden rounded-card border border-line shadow-panel", [__props.glass ? "lp-glass-overlay" : "bg-surface-raised", widthClass.value, unref(tweening) ? "transition-[height] duration-fast ease-[var(--ease-emphasized)] motion-reduce:transition-none" : ""]]),
151
+ class: normalizeClass(["flex max-h-[min(90vh,calc(100dvh-2rem))] min-h-0 flex-col overflow-hidden rounded-card border border-line shadow-panel", [unref(frosted) ? "lp-glass-overlay" : "bg-surface-raised", widthClass.value, unref(tweening) ? "transition-[height] duration-fast ease-[var(--ease-emphasized)] motion-reduce:transition-none" : ""]]),
150
152
  style: normalizeStyle({ ...__props.width ? { width: __props.width } : {}, ...hasAside.value ? { alignSelf: "stretch" } : {} })
151
153
  }, [
152
154
  __props.title || _ctx.$slots.title ? (openBlock(), createElementBlock("header", _hoisted_2, [
@@ -1,8 +1,8 @@
1
1
  import { defineComponent, ref, computed, openBlock, createBlock, createSlots, withCtx, renderSlot, createElementVNode, normalizeClass, createVNode, createCommentVNode, createTextVNode, toDisplayString } from "vue";
2
2
  import { _ as _sfc_main$2 } from "./LpButton-5VXXCjwF.js";
3
3
  import { _ as _sfc_main$3 } from "./LpIcon-CCnX5_2j.js";
4
- import { _ as _sfc_main$1 } from "./LpModal-EyEdRuqF.js";
5
- import { _ as _sfc_main$4 } from "./LpSidebar-DZ20iBxY.js";
4
+ import { _ as _sfc_main$1 } from "./LpModal-8bja5bWS.js";
5
+ import { _ as _sfc_main$4 } from "./LpSidebar-DlTn5nXc.js";
6
6
  const _hoisted_1 = { class: "flex items-center gap-2" };
7
7
  const _sfc_main = /* @__PURE__ */ defineComponent({
8
8
  __name: "LpModalNav",
@@ -23,7 +23,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
23
23
  navLabel: { default: "Sections" },
24
24
  navSide: { default: "start" },
25
25
  fillBody: { type: Boolean },
26
- glass: { type: Boolean }
26
+ glass: { type: Boolean, default: void 0 }
27
27
  },
28
28
  emits: ["update:open", "update:modelValue"],
29
29
  setup(__props, { emit: __emit }) {
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, computed, ref, useId, openBlock, createElementBlock, Fragment, createElementVNode, mergeProps, normalizeClass, renderSlot, createCommentVNode, createBlock, createVNode, createSlots, withCtx, normalizeProps, guardReactiveProps } from "vue";
2
- import { _ as _sfc_main$3 } from "./LpDrawer-B8vBnCWF.js";
2
+ import { _ as _sfc_main$3 } from "./LpDrawer-DgaS2s2i.js";
3
3
  import { _ as _sfc_main$1 } from "./LpInput-9EXWUM9B.js";
4
4
  import { _ as _sfc_main$2 } from "./LpSidebarNav-llOcs_Fn.js";
5
5
  const _hoisted_1 = {
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "../chunks/LpAddressInput-H5NdhK6c.js";
1
+ import { _ as _sfc_main } from "../chunks/LpAddressInput-CMjaPQVw.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "../chunks/LpAppShell-BfqSA1ba.js";
1
+ import { _ as _sfc_main } from "../chunks/LpAppShell-Bcv6EhqU.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -162,7 +162,8 @@ type __VLS_Props = {
162
162
  /**
163
163
  * Frosted glass instead of a solid panel: the page shows through,
164
164
  * blurred, under a lighter scrim (.lp-glass-overlay, .lp-scrim--light).
165
- * A look, not a behaviour, so it is the app's call and off by default.
165
+ * A look, not a behaviour, so it is the app's call: unset follows
166
+ * `provideGlass`, and without one it is off.
166
167
  */
167
168
  glass?: boolean;
168
169
  };
@@ -1,12 +1,13 @@
1
- import { defineComponent, computed, ref, useId, shallowRef, useSlots, watch, nextTick, openBlock, createBlock, unref, withCtx, createVNode, normalizeClass, withModifiers, normalizeStyle, createTextVNode, createElementVNode, createElementBlock, Fragment, renderList, createCommentVNode, toDisplayString, withDirectives, withKeys, vModelText, resolveDynamicComponent, Transition, renderSlot } from "vue";
1
+ import { defineComponent, computed, ref, useId, shallowRef, useSlots, watch, nextTick, openBlock, createBlock, unref, withCtx, createVNode, normalizeClass, withModifiers, createTextVNode, createElementVNode, createElementBlock, Fragment, renderList, createCommentVNode, toDisplayString, withDirectives, withKeys, vModelText, resolveDynamicComponent, normalizeStyle, Transition, renderSlot } from "vue";
2
2
  import { DialogRoot, DialogPortal, DialogOverlay, DialogContent, DialogTitle, DialogDescription } from "reka-ui";
3
3
  import { _ as _sfc_main$1 } from "../chunks/LpIcon-CCnX5_2j.js";
4
4
  import { _ as _sfc_main$2 } from "../chunks/LpScrollArea-D8xyKXcF.js";
5
5
  import { useAsyncTask } from "../composables/useAsyncTask.js";
6
+ import { useGlass } from "../composables/useGlass.js";
6
7
  import { useClipboard } from "../composables/useClipboard.js";
7
8
  import { useHotkeys } from "../composables/useHotkeys.js";
8
9
  import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper-1tPrXgE0.js";
9
- import '../assets/LpCommandPalette-B5eZBHox.css';const _hoisted_1 = { class: "flex shrink-0 items-center gap-2.5 border-b border-line px-4" };
10
+ import '../assets/LpCommandPalette-DyT6aGdW.css';const _hoisted_1 = { class: "flex shrink-0 items-center gap-2.5 border-b border-line px-4" };
10
11
  const _hoisted_2 = ["title", "onClick"];
11
12
  const _hoisted_3 = ["aria-activedescendant", "placeholder", "onKeydown"];
12
13
  const _hoisted_4 = { class: "flex min-h-0 flex-1" };
@@ -40,7 +41,7 @@ const _hoisted_14 = {
40
41
  };
41
42
  const _hoisted_15 = {
42
43
  key: 0,
43
- class: "hidden min-h-0 w-[56%] shrink-0 flex-col border-l border-line md:flex"
44
+ class: "lp-cmd-pane hidden min-h-0 shrink-0 flex-col border-l border-line md:flex"
44
45
  };
45
46
  const _hoisted_16 = { class: "lp-cmd-para flex items-center gap-2 text-ink" };
46
47
  const _hoisted_17 = { class: "min-w-0 text-base font-semibold" };
@@ -89,11 +90,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
89
90
  groupLimit: { default: 0 },
90
91
  layoutFallback: { type: Boolean, default: true },
91
92
  previewPane: { type: Boolean, default: false },
92
- glass: { type: Boolean, default: false }
93
+ glass: { type: Boolean, default: void 0 }
93
94
  },
94
95
  emits: ["update:open", "select", "run"],
95
96
  setup(__props, { emit: __emit }) {
96
97
  const props = __props;
98
+ const frosted = useGlass(() => props.glass);
97
99
  const DEFAULT_LABELS = {
98
100
  navigate: "navigate",
99
101
  select: "select",
@@ -482,14 +484,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
482
484
  createVNode(unref(DialogPortal), null, {
483
485
  default: withCtx(() => [
484
486
  createVNode(unref(DialogOverlay), {
485
- class: normalizeClass([{ "lp-scrim--light": __props.glass }, "lp-scrim fixed inset-0 z-(--z-overlay) data-[state=open]:animate-[fade-in_150ms_ease] data-[state=closed]:animate-[fade-out_130ms_ease]"])
487
+ class: normalizeClass([{ "lp-scrim--light": unref(frosted) }, "lp-scrim fixed inset-0 z-(--z-overlay) data-[state=open]:animate-[fade-in_150ms_ease] data-[state=closed]:animate-[fade-out_130ms_ease]"])
486
488
  }, null, 8, ["class"]),
487
489
  createVNode(unref(DialogContent), {
488
- class: normalizeClass(["fixed left-1/2 top-[12vh] z-(--z-modal) flex max-h-[76vh] -translate-x-1/2 flex-col overflow-hidden rounded-card border border-line shadow-panel outline-none data-[state=open]:animate-[pop-in_160ms_var(--ease-emphasized)] data-[state=closed]:animate-[pop-out_130ms_ease]", [__props.glass ? "lp-glass-overlay" : "bg-surface-raised", __props.previewPane && "lp-cmd-resizing"]]),
489
- style: normalizeStyle({
490
- width: paneOpen.value ? "min(92vw, 64rem)" : "min(92vw, 40rem)",
491
- minHeight: paneOpen.value ? "min(76vh, 36rem)" : "0px"
492
- }),
490
+ class: normalizeClass(["lp-cmd-dialog fixed left-1/2 top-[12vh] z-(--z-modal) flex max-h-[76vh] -translate-x-1/2 flex-col overflow-hidden rounded-card border border-line shadow-panel outline-none data-[state=open]:animate-[pop-in_160ms_var(--ease-emphasized)] data-[state=closed]:animate-[pop-out_130ms_ease]", [unref(frosted) ? "lp-glass-overlay" : "bg-surface-raised", __props.previewPane && "lp-cmd-split"]]),
491
+ "data-pane": paneOpen.value ? "open" : void 0,
493
492
  onOpenAutoFocus: _cache[2] || (_cache[2] = withModifiers(() => {
494
493
  }, ["prevent"]))
495
494
  }, {
@@ -568,7 +567,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
568
567
  createVNode(_sfc_main$2, {
569
568
  ref_key: "scrollRef",
570
569
  ref: scrollRef,
571
- class: "min-h-0 min-w-0 flex-1",
570
+ class: "lp-cmd-list min-h-0 min-w-0 flex-1",
572
571
  "content-class": "p-2"
573
572
  }, {
574
573
  default: withCtx(() => [
@@ -765,7 +764,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
765
764
  ])
766
765
  ]),
767
766
  _: 3
768
- }, 8, ["class", "style"])
767
+ }, 8, ["class", "data-pane"])
769
768
  ]),
770
769
  _: 3
771
770
  })
@@ -775,7 +774,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
775
774
  };
776
775
  }
777
776
  });
778
- const LpCommandPalette = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-79f73da4"]]);
777
+ const LpCommandPalette = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-19283172"]]);
779
778
  export {
780
779
  LpCommandPalette as default
781
780
  };
@@ -28,7 +28,7 @@ type __VLS_Props = {
28
28
  */
29
29
  loading?: boolean;
30
30
  loadingLabel?: string;
31
- /** Frosted glass panel, passed to LpModal. Off by default. */
31
+ /** Frosted glass panel, passed to LpModal. Follows `provideGlass` when unset. */
32
32
  glass?: boolean;
33
33
  };
34
34
  declare var __VLS_16: {};
@@ -44,6 +44,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {},
44
44
  "onUpdate:open"?: ((value: boolean) => any) | undefined;
45
45
  onConfirm?: (() => any) | undefined;
46
46
  }>, {
47
+ glass: boolean;
47
48
  confirmLabel: string;
48
49
  cancelLabel: string;
49
50
  loadingLabel: string;
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "../chunks/LpConfirmDialog-BBRnMkV4.js";
1
+ import { _ as _sfc_main } from "../chunks/LpConfirmDialog-BNAvOR24.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -66,7 +66,8 @@ declare const __VLS_export: __VLS_WithSlots<import('vue').DefineComponent<{
66
66
  /**
67
67
  * Frosted glass instead of a solid panel: the page shows through,
68
68
  * blurred, under a lighter scrim (.lp-glass-overlay, .lp-scrim--light).
69
- * A look, not a behaviour, so it is the app's call and off by default.
69
+ * A look, not a behaviour, so it is the app's call: unset follows
70
+ * `provideGlass`, and without one it is off.
70
71
  */
71
72
  glass?: boolean;
72
73
  }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
@@ -137,7 +138,8 @@ declare const __VLS_export: __VLS_WithSlots<import('vue').DefineComponent<{
137
138
  /**
138
139
  * Frosted glass instead of a solid panel: the page shows through,
139
140
  * blurred, under a lighter scrim (.lp-glass-overlay, .lp-scrim--light).
140
- * A look, not a behaviour, so it is the app's call and off by default.
141
+ * A look, not a behaviour, so it is the app's call: unset follows
142
+ * `provideGlass`, and without one it is off.
141
143
  */
142
144
  glass?: boolean;
143
145
  }> & Readonly<{
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "../chunks/LpDrawer-B8vBnCWF.js";
1
+ import { _ as _sfc_main } from "../chunks/LpDrawer-DgaS2s2i.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -28,7 +28,8 @@ type __VLS_Props = {
28
28
  /**
29
29
  * Frosted glass instead of a solid panel: the page shows through,
30
30
  * blurred, under a lighter scrim (.lp-glass-overlay, .lp-scrim--light).
31
- * A look, not a behaviour, so it is the app's call and off by default.
31
+ * A look, not a behaviour, so it is the app's call: unset follows
32
+ * `provideGlass`, and without one it is off.
32
33
  */
33
34
  glass?: boolean;
34
35
  };
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "../chunks/LpModal-EyEdRuqF.js";
1
+ import { _ as _sfc_main } from "../chunks/LpModal-8bja5bWS.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -31,7 +31,7 @@ type __VLS_Props = {
31
31
  * column inside the body, and the rail is no longer in the body.
32
32
  */
33
33
  fillBody?: boolean;
34
- /** Frosted glass panel, passed to LpModal. Off by default. */
34
+ /** Frosted glass panel, passed to LpModal. Follows `provideGlass` when unset. */
35
35
  glass?: boolean;
36
36
  };
37
37
  declare var __VLS_36: {}, __VLS_38: {}, __VLS_41: {};
@@ -50,6 +50,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {},
50
50
  "onUpdate:open"?: ((value: boolean) => any) | undefined;
51
51
  }>, {
52
52
  size: "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full";
53
+ glass: boolean;
53
54
  mobileBreakpoint: Breakpoint;
54
55
  navWidth: string;
55
56
  navLabel: string;
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "../chunks/LpModalNav-BrDtP7b_.js";
1
+ import { _ as _sfc_main } from "../chunks/LpModalNav-w9kfwHqO.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -1,18 +1,12 @@
1
- export interface ShortcutEntry {
2
- /** Rendered one <kbd> per "+"-separated key, so write it the way it reads. */
3
- combo: string;
4
- label: string;
5
- }
6
- export interface ShortcutGroup {
7
- title: string;
8
- entries: ShortcutEntry[];
9
- }
1
+ import { ShortcutGroup } from '../composables/useHotkeys';
10
2
  type __VLS_Props = {
11
3
  open?: boolean;
12
- groups: ShortcutGroup[];
4
+ groups?: ShortcutGroup[];
5
+ /** Also list the bindings mounted right now (`useHotkeys` with `help`). */
6
+ live?: boolean;
13
7
  title?: string;
14
8
  description?: string;
15
- /** Frosted glass panel, passed to LpModal. Off by default. */
9
+ /** Frosted glass panel, passed to LpModal. Follows `provideGlass` when unset. */
16
10
  glass?: boolean;
17
11
  };
18
12
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
@@ -22,6 +16,9 @@ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {
22
16
  }>, {
23
17
  title: string;
24
18
  open: boolean;
19
+ glass: boolean;
20
+ groups: ShortcutGroup[];
21
+ live: boolean;
25
22
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
26
23
  declare const _default: typeof __VLS_export;
27
24
  export default _default;
@@ -1,20 +1,25 @@
1
- import { defineComponent, openBlock, createBlock, withCtx, createElementVNode, createElementBlock, Fragment, renderList, toDisplayString, unref } from "vue";
2
- import { _ as _sfc_main$1 } from "../chunks/LpModal-EyEdRuqF.js";
3
- import { appleModifierLabel } from "../composables/useHotkeys.js";
1
+ import { defineComponent, computed, openBlock, createBlock, withCtx, createElementVNode, createElementBlock, Fragment, renderList, toDisplayString, unref } from "vue";
2
+ import { _ as _sfc_main$1 } from "../chunks/LpModal-8bja5bWS.js";
3
+ import { mergeShortcutGroups, activeShortcuts, appleModifierLabel } from "../composables/useHotkeys.js";
4
4
  import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper-1tPrXgE0.js";
5
- import '../assets/LpShortcutsDialog-Cap_ALQM.css';const _hoisted_1 = { class: "shortcut-groups" };
5
+ import '../assets/LpShortcutsDialog-C6YoQ8_M.css';const _hoisted_1 = { class: "shortcut-groups" };
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  __name: "LpShortcutsDialog",
8
8
  props: {
9
9
  open: { type: Boolean, default: false },
10
- groups: {},
10
+ groups: { default: () => [] },
11
+ live: { type: Boolean, default: false },
11
12
  title: { default: "Keyboard shortcuts" },
12
13
  description: {},
13
- glass: { type: Boolean }
14
+ glass: { type: Boolean, default: void 0 }
14
15
  },
15
16
  emits: ["update:open"],
16
17
  setup(__props, { emit: __emit }) {
17
18
  const props = __props;
19
+ function keysOf(combo) {
20
+ return combo.split(/\+(?!$)/);
21
+ }
22
+ const shown = computed(() => props.live ? mergeShortcutGroups(props.groups, activeShortcuts.value) : props.groups);
18
23
  const emit = __emit;
19
24
  return (_ctx, _cache) => {
20
25
  return openBlock(), createBlock(_sfc_main$1, {
@@ -27,7 +32,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
27
32
  }, {
28
33
  default: withCtx(() => [
29
34
  createElementVNode("div", _hoisted_1, [
30
- (openBlock(true), createElementBlock(Fragment, null, renderList(props.groups, (group) => {
35
+ (openBlock(true), createElementBlock(Fragment, null, renderList(shown.value, (group) => {
31
36
  return openBlock(), createElementBlock("section", {
32
37
  key: group.title,
33
38
  class: "shortcut-group"
@@ -41,7 +46,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
41
46
  }, [
42
47
  createElementVNode("dt", null, toDisplayString(entry.label), 1),
43
48
  createElementVNode("dd", null, [
44
- (openBlock(true), createElementBlock(Fragment, null, renderList(entry.combo.split("+"), (key, index) => {
49
+ (openBlock(true), createElementBlock(Fragment, null, renderList(keysOf(entry.combo), (key, index) => {
45
50
  return openBlock(), createElementBlock("kbd", {
46
51
  key: `${key}-${index}`
47
52
  }, toDisplayString(unref(appleModifierLabel)(key.trim())), 1);
@@ -59,7 +64,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
59
64
  };
60
65
  }
61
66
  });
62
- const LpShortcutsDialog = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-7b1cdfeb"]]);
67
+ const LpShortcutsDialog = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8af3bafc"]]);
63
68
  export {
64
69
  LpShortcutsDialog as default
65
70
  };
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "../chunks/LpSidebar-DZ20iBxY.js";
1
+ import { _ as _sfc_main } from "../chunks/LpSidebar-DlTn5nXc.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -0,0 +1,9 @@
1
+ import { ComputedRef, MaybeRefOrGetter } from 'vue';
2
+ /** Make `glass` the default for every overlay below the calling component. */
3
+ export declare function provideGlass(enabled?: MaybeRefOrGetter<boolean>): void;
4
+ /**
5
+ * The glass flag an overlay renders with: its own prop when set, otherwise the
6
+ * nearest `provideGlass`, otherwise off. The prop must default to `undefined`,
7
+ * not `false`, or an unset prop could not be told apart from an explicit off.
8
+ */
9
+ export declare function useGlass(own: () => boolean | undefined): ComputedRef<boolean>;
@@ -0,0 +1,13 @@
1
+ import { inject, computed, toValue, provide } from "vue";
2
+ const GLASS = /* @__PURE__ */ Symbol("lp-glass");
3
+ function provideGlass(enabled = true) {
4
+ provide(GLASS, enabled);
5
+ }
6
+ function useGlass(own) {
7
+ const inherited = inject(GLASS, false);
8
+ return computed(() => own() ?? toValue(inherited));
9
+ }
10
+ export {
11
+ provideGlass,
12
+ useGlass
13
+ };