@leavepulse/ui 0.33.0 → 0.34.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 (56) hide show
  1. package/dist/assets/{LpCommandPalette-CEY-pajO.css → LpCommandPalette-BERCHiev.css} +4 -4
  2. package/dist/chunks/{LpAddressInput-C35TsJXt.js → LpAddressInput-FZXfljWV.js} +1 -1
  3. package/dist/chunks/{LpConfirmDialog-CjOGcj1e.js → LpConfirmDialog-CQBVaLpo.js} +1 -1
  4. package/dist/chunks/{LpDisclosure-y7wDBgLa.js → LpDisclosure-ChQYmjlR.js} +1 -1
  5. package/dist/chunks/{LpModal-D_o-56To.js → LpModal-DAqXzsm-.js} +20 -11
  6. package/dist/components/LpActionBar.vue.d.ts +1 -1
  7. package/dist/components/LpAddressInput.vue.d.ts +3 -3
  8. package/dist/components/LpAddressInput.vue.js +1 -1
  9. package/dist/components/LpAppShell.vue.d.ts +1 -4
  10. package/dist/components/LpAutocomplete.vue.d.ts +1 -1
  11. package/dist/components/LpBadge.vue.d.ts +2 -2
  12. package/dist/components/LpCodeBlock.vue.d.ts +1 -1
  13. package/dist/components/LpColorPicker.vue.d.ts +4 -9
  14. package/dist/components/LpCommandPalette.vue.d.ts +62 -0
  15. package/dist/components/LpCommandPalette.vue.js +237 -56
  16. package/dist/components/LpConfirmDialog.vue.js +1 -1
  17. package/dist/components/LpDisclosure.vue.js +1 -1
  18. package/dist/components/LpDropzone.vue.d.ts +4 -4
  19. package/dist/components/LpFileTree.vue.d.ts +4 -4
  20. package/dist/components/LpFormField.vue.d.ts +1 -1
  21. package/dist/components/LpLaneNode.vue.d.ts +0 -11
  22. package/dist/components/LpLightbox.vue.d.ts +2 -2
  23. package/dist/components/LpLogViewer.vue.d.ts +1 -1
  24. package/dist/components/LpMapPicker.vue.d.ts +1 -1
  25. package/dist/components/LpMediaGallery.vue.d.ts +1 -1
  26. package/dist/components/LpModal.vue.js +1 -1
  27. package/dist/components/LpPie.vue.d.ts +4 -22
  28. package/dist/components/LpPopover.vue.d.ts +1 -1
  29. package/dist/components/LpProgress.vue.d.ts +2 -2
  30. package/dist/components/LpRollingText.vue.d.ts +3 -3
  31. package/dist/components/LpSelect.vue.d.ts +6 -6
  32. package/dist/components/LpShift.vue.d.ts +1 -1
  33. package/dist/components/LpShortcutsDialog.vue.d.ts +1 -1
  34. package/dist/components/LpShortcutsDialog.vue.js +1 -1
  35. package/dist/components/LpSidebar.vue.d.ts +1 -7
  36. package/dist/components/LpSidebarNav.vue.d.ts +2 -2
  37. package/dist/components/LpSlider.vue.d.ts +2 -2
  38. package/dist/components/LpSparkline.vue.d.ts +2 -2
  39. package/dist/components/LpTable.vue.d.ts +9 -9
  40. package/dist/components/LpTabs.vue.d.ts +1 -1
  41. package/dist/components/LpThemeSwitcher.vue.d.ts +1 -1
  42. package/dist/components/LpTilt.vue.d.ts +1 -1
  43. package/dist/components/LpTooltip.vue.d.ts +1 -1
  44. package/dist/components/LpTopologyCanvas.vue.d.ts +1 -1
  45. package/dist/components/modalDepth.d.ts +13 -0
  46. package/dist/components/modalDepth.js +29 -0
  47. package/dist/composables/useShift.js +9 -1
  48. package/dist/index.d.ts +1 -1
  49. package/dist/index.js +4 -4
  50. package/package.json +1 -1
  51. package/src/components/LpCommandPalette.vue +369 -21
  52. package/src/components/LpDisclosure.vue +16 -1
  53. package/src/components/LpModal.vue +38 -3
  54. package/src/components/modalDepth.ts +72 -0
  55. package/src/composables/useShift.ts +34 -3
  56. package/src/index.ts +1 -1
@@ -1,16 +1,16 @@
1
1
 
2
2
  /* Each result eases in; honours reduced motion. */
3
- .lp-cmd-item[data-v-a23a2f5f] {
4
- animation: lp-cmd-in-a23a2f5f 140ms ease-out both;
3
+ .lp-cmd-item[data-v-d0e03a58] {
4
+ animation: lp-cmd-in-d0e03a58 140ms ease-out both;
5
5
  }
6
- @keyframes lp-cmd-in-a23a2f5f {
6
+ @keyframes lp-cmd-in-d0e03a58 {
7
7
  from {
8
8
  opacity: 0;
9
9
  transform: translateY(3px);
10
10
  }
11
11
  }
12
12
  @media (prefers-reduced-motion: reduce) {
13
- .lp-cmd-item[data-v-a23a2f5f] {
13
+ .lp-cmd-item[data-v-d0e03a58] {
14
14
  animation: none;
15
15
  }
16
16
  }
@@ -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-D_o-56To.js";
9
+ import { _ as _sfc_main$7 } from "./LpModal-DAqXzsm-.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" };
@@ -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-D_o-56To.js";
4
+ import { _ as _sfc_main$1 } from "./LpModal-DAqXzsm-.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",
@@ -36,7 +36,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
36
36
  }
37
37
  }
38
38
  const { class: rootClass, attrs: rest } = useMergedAttrs(
39
- "overflow-hidden rounded-control border border-line bg-surface-soft"
39
+ "shrink-0 overflow-hidden rounded-control border border-line bg-surface-soft"
40
40
  );
41
41
  return (_ctx, _cache) => {
42
42
  return openBlock(), createBlock(unref(CollapsibleRoot), mergeProps({
@@ -1,16 +1,16 @@
1
- import { defineComponent, computed, useSlots, ref, watch, openBlock, createBlock, unref, withCtx, createVNode, createElementVNode, mergeProps, createElementBlock, renderSlot, createTextVNode, toDisplayString, createCommentVNode, normalizeClass } from "vue";
1
+ import { defineComponent, computed, useSlots, watch, onBeforeUnmount, ref, openBlock, createBlock, unref, withCtx, createVNode, normalizeStyle, createElementVNode, mergeProps, createElementBlock, renderSlot, createTextVNode, toDisplayString, createCommentVNode, normalizeClass } from "vue";
2
2
  import { DialogRoot, DialogPortal, DialogOverlay, DialogContent, DialogTitle, DialogDescription, DialogClose } from "reka-ui";
3
3
  import { useShift } from "../composables/useShift.js";
4
+ import { useModalLayer } from "../components/modalDepth.js";
4
5
  import { CLOSE_ICON } from "../components/dropdown.js";
5
6
  import { _ as _sfc_main$1 } from "./LpIcon-CCnX5_2j.js";
6
7
  import { _ as _sfc_main$2 } from "./LpScrollArea-D8xyKXcF.js";
7
- const _hoisted_1 = { class: "fixed inset-0 z-(--z-modal) flex items-center justify-center pointer-events-none" };
8
- const _hoisted_2 = {
8
+ const _hoisted_1 = {
9
9
  key: 0,
10
10
  class: "flex shrink-0 items-start justify-between gap-4 p-5 pb-3"
11
11
  };
12
- const _hoisted_3 = { class: "flex flex-col gap-1" };
13
- const _hoisted_4 = {
12
+ const _hoisted_2 = { class: "flex flex-col gap-1" };
13
+ const _hoisted_3 = {
14
14
  key: 3,
15
15
  class: "flex shrink-0 justify-end gap-2 p-5 pt-4"
16
16
  };
@@ -27,6 +27,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
27
27
  },
28
28
  emits: ["update:open"],
29
29
  setup(__props) {
30
+ const { claim, release, layer } = useModalLayer();
30
31
  const props = __props;
31
32
  const describedByAttrs = computed(
32
33
  () => props.description ? {} : { "aria-describedby": void 0 }
@@ -44,6 +45,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
44
45
  }[props.size];
45
46
  });
46
47
  const slots = useSlots();
48
+ watch(() => props.open, (open) => open ? claim() : release(), { immediate: true });
49
+ onBeforeUnmount(release);
47
50
  const bodyPad = computed(
48
51
  () => [
49
52
  "px-5",
@@ -103,8 +106,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
103
106
  default: withCtx(() => [
104
107
  createVNode(unref(DialogPortal), null, {
105
108
  default: withCtx(() => [
106
- createVNode(unref(DialogOverlay), { class: "lp-scrim fixed inset-0 z-(--z-overlay) data-[state=open]:animate-[fade-in_var(--duration-medium)_var(--ease-emphasized)] data-[state=closed]:animate-[fade-out_120ms_ease]" }),
107
- createElementVNode("div", _hoisted_1, [
109
+ createVNode(unref(DialogOverlay), {
110
+ class: "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]",
111
+ style: normalizeStyle({ zIndex: unref(layer).scrim })
112
+ }, null, 8, ["style"]),
113
+ createElementVNode("div", {
114
+ class: "fixed inset-0 flex items-center justify-center pointer-events-none",
115
+ style: normalizeStyle({ zIndex: unref(layer).panel })
116
+ }, [
108
117
  createVNode(unref(DialogContent), mergeProps({
109
118
  ref_key: "panelRef",
110
119
  ref: panelRef,
@@ -112,8 +121,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
112
121
  style: __props.width ? { width: __props.width } : void 0
113
122
  }, describedByAttrs.value, { onOpenAutoFocus }), {
114
123
  default: withCtx(() => [
115
- __props.title || _ctx.$slots.title ? (openBlock(), createElementBlock("header", _hoisted_2, [
116
- createElementVNode("div", _hoisted_3, [
124
+ __props.title || _ctx.$slots.title ? (openBlock(), createElementBlock("header", _hoisted_1, [
125
+ createElementVNode("div", _hoisted_2, [
117
126
  createVNode(unref(DialogTitle), { class: "text-base font-semibold text-ink" }, {
118
127
  default: withCtx(() => [
119
128
  renderSlot(_ctx.$slots, "title", {}, () => [
@@ -162,13 +171,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
162
171
  ]),
163
172
  _: 3
164
173
  }, 8, ["class", "content-class"])),
165
- _ctx.$slots.footer ? (openBlock(), createElementBlock("footer", _hoisted_4, [
174
+ _ctx.$slots.footer ? (openBlock(), createElementBlock("footer", _hoisted_3, [
166
175
  renderSlot(_ctx.$slots, "footer")
167
176
  ])) : createCommentVNode("", true)
168
177
  ]),
169
178
  _: 3
170
179
  }, 16, ["class", "style"])
171
- ])
180
+ ], 4)
172
181
  ]),
173
182
  _: 3
174
183
  })
@@ -70,8 +70,8 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {},
70
70
  onDismiss?: (() => any) | undefined;
71
71
  }>, {
72
72
  width: "contained" | "full";
73
- open: boolean;
74
73
  variant: "default" | "danger";
74
+ open: boolean;
75
75
  actions: ActionBarAction[];
76
76
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
77
77
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -58,9 +58,9 @@ declare const __VLS_export: __VLS_WithSlots<import('vue').DefineComponent<{
58
58
  debounce: number;
59
59
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, {
60
60
  map?: (props: {
61
- point: LatLon | undefined;
62
- setPoint: (next: LatLon) => Promise<void>;
63
- tiles: TileSource;
61
+ point: any;
62
+ setPoint: any;
63
+ tiles: any;
64
64
  }) => any;
65
65
  }>;
66
66
  type __VLS_WithSlots<T, S> = T & {
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "../chunks/LpAddressInput-C35TsJXt.js";
1
+ import { _ as _sfc_main } from "../chunks/LpAddressInput-FZXfljWV.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -101,10 +101,7 @@ declare const __VLS_export: __VLS_WithSlots<import('vue').DefineComponent<{
101
101
  } & {
102
102
  'sidebar-footer'?: (props: {}) => any;
103
103
  } & {
104
- 'sidebar-item'?: (props: {
105
- item: SidebarItem;
106
- active: boolean;
107
- }) => any;
104
+ 'sidebar-item'?: (props: any) => any;
108
105
  } & {
109
106
  'header-title'?: (props: {}) => any;
110
107
  } & {
@@ -40,9 +40,9 @@ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {
40
40
  size: "sm" | "md" | "lg";
41
41
  filter: boolean;
42
42
  placeholder: string;
43
- loading: boolean;
44
43
  clearable: boolean;
45
44
  emptyText: string;
45
+ loading: boolean;
46
46
  loadingText: string;
47
47
  minChars: number;
48
48
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -1,12 +1,12 @@
1
1
  declare const _default: typeof __VLS_export;
2
2
  export default _default;
3
3
  declare const __VLS_export: __VLS_WithSlots<import('vue').DefineComponent<{
4
- tone?: "action" | "outline" | "danger" | "success" | "warning" | "neutral" | "brand" | undefined;
4
+ tone?: "danger" | "action" | "outline" | "success" | "warning" | "neutral" | "brand" | undefined;
5
5
  /** `sm` is the one that does not disturb a text-sm line it sits on. */
6
6
  size?: "sm" | "md" | "lg" | undefined;
7
7
  dot?: boolean;
8
8
  }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
9
- tone?: "action" | "outline" | "danger" | "success" | "warning" | "neutral" | "brand" | undefined;
9
+ tone?: "danger" | "action" | "outline" | "success" | "warning" | "neutral" | "brand" | undefined;
10
10
  /** `sm` is the one that does not disturb a text-sm line it sits on. */
11
11
  size?: "sm" | "md" | "lg" | undefined;
12
12
  dot?: boolean;
@@ -49,8 +49,8 @@ declare const __VLS_export: import('vue').DefineComponent<{
49
49
  "onUpdate:locked"?: ((value: boolean) => any) | undefined;
50
50
  }>, {
51
51
  lang: CodeLang;
52
- wrap: boolean;
53
52
  lineNumbers: boolean;
53
+ wrap: boolean;
54
54
  locked: boolean;
55
55
  lockToggle: boolean;
56
56
  copyable: boolean;
@@ -82,13 +82,8 @@ type __VLS_Props = {
82
82
  copyToast?: string | false;
83
83
  };
84
84
  declare var __VLS_56: {
85
- color: string;
86
- hsv: {
87
- h: number;
88
- s: number;
89
- v: number;
90
- a: number;
91
- };
85
+ color: any;
86
+ hsv: any;
92
87
  };
93
88
  type __VLS_Slots = {} & {
94
89
  default?: (props: typeof __VLS_56) => any;
@@ -103,10 +98,10 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
103
98
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
104
99
  }>, {
105
100
  size: "sm" | "md" | "lg";
106
- format: ColorFormat;
107
- align: "start" | "center" | "end";
108
101
  modelValue: string;
102
+ format: ColorFormat;
109
103
  side: "top" | "right" | "bottom" | "left";
104
+ align: "start" | "center" | "end";
110
105
  alpha: boolean;
111
106
  swatches: readonly string[];
112
107
  recent: boolean;
@@ -17,8 +17,35 @@ export interface Command {
17
17
  * decommission, …) that shouldn't clutter the palette but stay reachable.
18
18
  */
19
19
  hidden?: boolean;
20
+ /**
21
+ * Picking this opens a mode instead of closing: a nested list, either given
22
+ * outright or fetched from the query typed inside it. This is what keeps a
23
+ * palette from flattening "restart <service>" into one row per service —
24
+ * and what lets the second step search a list too big to enumerate.
25
+ *
26
+ * `onSelect` still runs when the mode opens, so a command can both act and
27
+ * drill in.
28
+ */
29
+ children?: Command[] | ((query: string) => Command[] | Promise<Command[]>);
30
+ /** Placeholder while inside this command's mode. */
31
+ childPlaceholder?: string;
32
+ /**
33
+ * Keep the palette open after this runs. For a command that toggles
34
+ * something the user may want to toggle again (a theme, a filter) without
35
+ * reopening and retyping.
36
+ */
37
+ keepOpen?: boolean;
20
38
  onSelect?: () => void;
21
39
  }
40
+ /** Footer hints and the mode chip, spelled out so an app can translate them. */
41
+ export interface PaletteLabels {
42
+ navigate: string;
43
+ select: string;
44
+ close: string;
45
+ /** Hint for leaving a mode, shown only while inside one. */
46
+ back: string;
47
+ searching: string;
48
+ }
22
49
  type __VLS_Props = {
23
50
  open?: boolean;
24
51
  commands: Command[];
@@ -26,17 +53,52 @@ type __VLS_Props = {
26
53
  emptyText?: string;
27
54
  /** Bind a global ⌘K / Ctrl-K toggle. */
28
55
  hotkey?: boolean;
56
+ /**
57
+ * Commands fetched from the typed query — what reaches the things too many
58
+ * (or too remote) to hand over as a list: people, files, tickets. Called
59
+ * debounced, never for a query shorter than `minChars`, and only its
60
+ * newest call counts: an earlier one that lands late is dropped, so a slow
61
+ * response can't overwrite a fresher list.
62
+ *
63
+ * Results join the static commands, so a palette can do both.
64
+ */
65
+ search?: (query: string, signal: AbortSignal) => Command[] | Promise<Command[]>;
66
+ /** Wait after the last keystroke before `search` runs. */
67
+ debounce?: number;
68
+ /** Shortest query `search` runs for. */
69
+ minChars?: number;
70
+ /**
71
+ * Ids of recently picked commands, newest first — bind it to storage and
72
+ * the palette opens on what this person actually uses. It only reorders
73
+ * commands already in the list; an id that no longer resolves is skipped,
74
+ * so a stored history never resurrects a command that has gone away.
75
+ */
76
+ recent?: string[];
77
+ /** How many recent commands to surface. */
78
+ recentLimit?: number;
79
+ /** Headings the palette adds itself. */
80
+ recentLabel?: string;
81
+ resultsLabel?: string;
82
+ /** Footer hints and the mode chip, spelled out for translation. */
83
+ labels?: Partial<PaletteLabels>;
29
84
  };
30
85
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
31
86
  select: (command: Command) => any;
32
87
  "update:open": (value: boolean) => any;
88
+ run: (id: string, command: Command) => any;
33
89
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
34
90
  onSelect?: ((command: Command) => any) | undefined;
35
91
  "onUpdate:open"?: ((value: boolean) => any) | undefined;
92
+ onRun?: ((id: string, command: Command) => any) | undefined;
36
93
  }>, {
37
94
  placeholder: string;
38
95
  emptyText: string;
96
+ minChars: number;
97
+ debounce: number;
98
+ recentLimit: number;
39
99
  hotkey: boolean;
100
+ recentLabel: string;
101
+ resultsLabel: string;
40
102
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
41
103
  declare const _default: typeof __VLS_export;
42
104
  export default _default;