@leavepulse/ui 0.34.0 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{LpTable-Ckoi05Am.css → LpTable-DfSwPCJ-.css} +21 -8
- package/dist/chunks/{LpAddressInput-FZXfljWV.js → LpAddressInput-D4t8WFD-.js} +1 -1
- package/dist/chunks/{LpConfirmDialog-CQBVaLpo.js → LpConfirmDialog-CxbizvSB.js} +1 -1
- package/dist/chunks/LpModal-7LvuAA7U.js +224 -0
- package/dist/chunks/LpModalNav-DBMGlq_x.js +166 -0
- package/dist/component-names.d.ts +1 -1
- package/dist/components/LpActionBar.vue.d.ts +1 -1
- package/dist/components/LpAddressInput.vue.d.ts +3 -3
- package/dist/components/LpAddressInput.vue.js +1 -1
- package/dist/components/LpAppShell.vue.d.ts +4 -1
- package/dist/components/LpAutocomplete.vue.d.ts +1 -1
- package/dist/components/LpBadge.vue.d.ts +2 -2
- package/dist/components/LpCodeBlock.vue.d.ts +1 -1
- package/dist/components/LpColorPicker.vue.d.ts +9 -4
- package/dist/components/LpConfirmDialog.vue.js +1 -1
- package/dist/components/LpDropzone.vue.d.ts +4 -4
- package/dist/components/LpFileTree.vue.d.ts +4 -4
- package/dist/components/LpFormField.vue.d.ts +1 -1
- package/dist/components/LpLaneNode.vue.d.ts +11 -0
- package/dist/components/LpLightbox.vue.d.ts +2 -2
- package/dist/components/LpLogViewer.vue.d.ts +1 -1
- package/dist/components/LpMapPicker.vue.d.ts +1 -1
- package/dist/components/LpMediaGallery.vue.d.ts +1 -1
- package/dist/components/LpModal.vue.d.ts +9 -5
- package/dist/components/LpModal.vue.js +1 -1
- package/dist/components/LpModalNav.vue.d.ts +63 -0
- package/dist/components/LpModalNav.vue.js +4 -0
- package/dist/components/LpPie.vue.d.ts +22 -4
- package/dist/components/LpPopover.vue.d.ts +1 -1
- package/dist/components/LpProgress.vue.d.ts +2 -2
- package/dist/components/LpRollingText.vue.d.ts +3 -3
- package/dist/components/LpSelect.vue.d.ts +6 -6
- package/dist/components/LpShift.vue.d.ts +1 -1
- package/dist/components/LpShortcutsDialog.vue.d.ts +1 -1
- package/dist/components/LpShortcutsDialog.vue.js +1 -1
- package/dist/components/LpSidebar.vue.d.ts +7 -1
- package/dist/components/LpSidebarNav.vue.d.ts +2 -2
- package/dist/components/LpSlider.vue.d.ts +2 -2
- package/dist/components/LpSparkline.vue.d.ts +2 -2
- package/dist/components/LpTable.vue.d.ts +9 -9
- package/dist/components/LpTable.vue.js +7 -4
- package/dist/components/LpTabs.vue.d.ts +1 -1
- package/dist/components/LpThemeSwitcher.vue.d.ts +1 -1
- package/dist/components/LpTilt.vue.d.ts +1 -1
- package/dist/components/LpTooltip.vue.d.ts +1 -1
- package/dist/components/LpTopologyCanvas.vue.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +75 -73
- package/package.json +1 -1
- package/src/component-names.ts +1 -0
- package/src/components/LpModal.vue +69 -1
- package/src/components/LpModalNav.vue +202 -0
- package/src/components/LpTable.vue +22 -2
- package/src/index.ts +1 -0
- package/dist/chunks/LpModal-DAqXzsm-.js +0 -192
|
@@ -1,192 +0,0 @@
|
|
|
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
|
-
import { DialogRoot, DialogPortal, DialogOverlay, DialogContent, DialogTitle, DialogDescription, DialogClose } from "reka-ui";
|
|
3
|
-
import { useShift } from "../composables/useShift.js";
|
|
4
|
-
import { useModalLayer } from "../components/modalDepth.js";
|
|
5
|
-
import { CLOSE_ICON } from "../components/dropdown.js";
|
|
6
|
-
import { _ as _sfc_main$1 } from "./LpIcon-CCnX5_2j.js";
|
|
7
|
-
import { _ as _sfc_main$2 } from "./LpScrollArea-D8xyKXcF.js";
|
|
8
|
-
const _hoisted_1 = {
|
|
9
|
-
key: 0,
|
|
10
|
-
class: "flex shrink-0 items-start justify-between gap-4 p-5 pb-3"
|
|
11
|
-
};
|
|
12
|
-
const _hoisted_2 = { class: "flex flex-col gap-1" };
|
|
13
|
-
const _hoisted_3 = {
|
|
14
|
-
key: 3,
|
|
15
|
-
class: "flex shrink-0 justify-end gap-2 p-5 pt-4"
|
|
16
|
-
};
|
|
17
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
18
|
-
__name: "LpModal",
|
|
19
|
-
props: {
|
|
20
|
-
open: { type: Boolean },
|
|
21
|
-
title: {},
|
|
22
|
-
description: {},
|
|
23
|
-
size: { default: "md" },
|
|
24
|
-
width: {},
|
|
25
|
-
fillBody: { type: Boolean },
|
|
26
|
-
autoFocus: { default: "auto" }
|
|
27
|
-
},
|
|
28
|
-
emits: ["update:open"],
|
|
29
|
-
setup(__props) {
|
|
30
|
-
const { claim, release, layer } = useModalLayer();
|
|
31
|
-
const props = __props;
|
|
32
|
-
const describedByAttrs = computed(
|
|
33
|
-
() => props.description ? {} : { "aria-describedby": void 0 }
|
|
34
|
-
);
|
|
35
|
-
const widthClass = computed(() => {
|
|
36
|
-
if (props.width) return "";
|
|
37
|
-
return {
|
|
38
|
-
sm: "w-[min(92vw,24rem)]",
|
|
39
|
-
md: "w-[min(92vw,28rem)]",
|
|
40
|
-
lg: "w-[min(92vw,34rem)]",
|
|
41
|
-
xl: "w-[min(92vw,42rem)]",
|
|
42
|
-
"2xl": "w-[min(94vw,56rem)]",
|
|
43
|
-
"3xl": "w-[min(95vw,72rem)]",
|
|
44
|
-
full: "w-[96vw]"
|
|
45
|
-
}[props.size];
|
|
46
|
-
});
|
|
47
|
-
const slots = useSlots();
|
|
48
|
-
watch(() => props.open, (open) => open ? claim() : release(), { immediate: true });
|
|
49
|
-
onBeforeUnmount(release);
|
|
50
|
-
const bodyPad = computed(
|
|
51
|
-
() => [
|
|
52
|
-
"px-5",
|
|
53
|
-
props.title || slots.title ? "pt-1" : "pt-5",
|
|
54
|
-
slots.footer ? "" : "pb-5"
|
|
55
|
-
].filter(Boolean).join(" ")
|
|
56
|
-
);
|
|
57
|
-
const panelRef = ref(null);
|
|
58
|
-
const AUTO_FOCUS_ORDER = [
|
|
59
|
-
"input:not([type=hidden]):not([disabled]):not([readonly])",
|
|
60
|
-
"textarea:not([disabled]):not([readonly])",
|
|
61
|
-
"select:not([disabled])",
|
|
62
|
-
"[data-lp-autofocus]",
|
|
63
|
-
"button:not([disabled]):not([data-lp-dialog-close])",
|
|
64
|
-
"[href]",
|
|
65
|
-
"[tabindex]:not([tabindex='-1'])"
|
|
66
|
-
];
|
|
67
|
-
function onOpenAutoFocus(event) {
|
|
68
|
-
if (props.autoFocus === "none") return;
|
|
69
|
-
const panel = panelRef.value?.$el;
|
|
70
|
-
if (!(panel instanceof HTMLElement)) return;
|
|
71
|
-
const selectors = props.autoFocus === "auto" ? AUTO_FOCUS_ORDER : [props.autoFocus];
|
|
72
|
-
for (const selector of selectors) {
|
|
73
|
-
const target = panel.querySelector(selector);
|
|
74
|
-
if (!target || target.hasAttribute("disabled")) continue;
|
|
75
|
-
event.preventDefault();
|
|
76
|
-
if (!target.closest("[data-lp-ring-owner]")) {
|
|
77
|
-
target.setAttribute("data-lp-focus-ring", "");
|
|
78
|
-
target.addEventListener(
|
|
79
|
-
"blur",
|
|
80
|
-
() => target.removeAttribute("data-lp-focus-ring"),
|
|
81
|
-
{ once: true }
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
target.focus();
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
const {
|
|
89
|
-
el: sizedEl,
|
|
90
|
-
tweening,
|
|
91
|
-
resizing
|
|
92
|
-
} = useShift({ axis: "height", enabled: () => props.open });
|
|
93
|
-
watch(
|
|
94
|
-
() => props.open ? panelRef.value : null,
|
|
95
|
-
(panel) => {
|
|
96
|
-
const el = panel?.$el;
|
|
97
|
-
sizedEl.value = el instanceof HTMLElement ? el : null;
|
|
98
|
-
},
|
|
99
|
-
{ flush: "post" }
|
|
100
|
-
);
|
|
101
|
-
return (_ctx, _cache) => {
|
|
102
|
-
return openBlock(), createBlock(unref(DialogRoot), {
|
|
103
|
-
open: __props.open,
|
|
104
|
-
"onUpdate:open": _cache[0] || (_cache[0] = (v) => _ctx.$emit("update:open", v))
|
|
105
|
-
}, {
|
|
106
|
-
default: withCtx(() => [
|
|
107
|
-
createVNode(unref(DialogPortal), null, {
|
|
108
|
-
default: withCtx(() => [
|
|
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
|
-
}, [
|
|
117
|
-
createVNode(unref(DialogContent), mergeProps({
|
|
118
|
-
ref_key: "panelRef",
|
|
119
|
-
ref: panelRef,
|
|
120
|
-
class: ["pointer-events-auto flex max-h-[min(90vh,calc(100dvh-2rem))] min-h-0 flex-col overflow-hidden rounded-card border border-line bg-surface-raised shadow-panel outline-none data-[state=open]:animate-[rise-in_var(--duration-medium)_var(--ease-emphasized)] data-[state=closed]:animate-[rise-out_120ms_cubic-bezier(0.4,0,1,1)]", [widthClass.value, unref(tweening) ? "transition-[height] duration-fast ease-[var(--ease-emphasized)] motion-reduce:transition-none" : ""]],
|
|
121
|
-
style: __props.width ? { width: __props.width } : void 0
|
|
122
|
-
}, describedByAttrs.value, { onOpenAutoFocus }), {
|
|
123
|
-
default: withCtx(() => [
|
|
124
|
-
__props.title || _ctx.$slots.title ? (openBlock(), createElementBlock("header", _hoisted_1, [
|
|
125
|
-
createElementVNode("div", _hoisted_2, [
|
|
126
|
-
createVNode(unref(DialogTitle), { class: "text-base font-semibold text-ink" }, {
|
|
127
|
-
default: withCtx(() => [
|
|
128
|
-
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
129
|
-
createTextVNode(toDisplayString(__props.title), 1)
|
|
130
|
-
])
|
|
131
|
-
]),
|
|
132
|
-
_: 3
|
|
133
|
-
}),
|
|
134
|
-
__props.description ? (openBlock(), createBlock(unref(DialogDescription), {
|
|
135
|
-
key: 0,
|
|
136
|
-
class: "text-sm text-muted"
|
|
137
|
-
}, {
|
|
138
|
-
default: withCtx(() => [
|
|
139
|
-
createTextVNode(toDisplayString(__props.description), 1)
|
|
140
|
-
]),
|
|
141
|
-
_: 1
|
|
142
|
-
})) : createCommentVNode("", true)
|
|
143
|
-
]),
|
|
144
|
-
createVNode(unref(DialogClose), {
|
|
145
|
-
"data-lp-dialog-close": "",
|
|
146
|
-
class: "group flex shrink-0 items-center rounded-md p-1 text-muted outline-none transition-colors duration-[var(--duration-fast)] hover:text-ink focus-visible:ring-2 focus-visible:ring-ring",
|
|
147
|
-
"aria-label": "Close"
|
|
148
|
-
}, {
|
|
149
|
-
default: withCtx(() => [
|
|
150
|
-
createVNode(_sfc_main$1, {
|
|
151
|
-
name: "lucide:x",
|
|
152
|
-
size: 18,
|
|
153
|
-
class: normalizeClass(unref(CLOSE_ICON))
|
|
154
|
-
}, null, 8, ["class"])
|
|
155
|
-
]),
|
|
156
|
-
_: 1
|
|
157
|
-
})
|
|
158
|
-
])) : createCommentVNode("", true),
|
|
159
|
-
__props.fillBody ? (openBlock(), createElementBlock("div", {
|
|
160
|
-
key: 1,
|
|
161
|
-
class: normalizeClass(["flex min-h-0 flex-1 flex-col overflow-hidden text-sm text-ink/90", bodyPad.value])
|
|
162
|
-
}, [
|
|
163
|
-
renderSlot(_ctx.$slots, "default")
|
|
164
|
-
], 2)) : (openBlock(), createBlock(_sfc_main$2, {
|
|
165
|
-
key: 2,
|
|
166
|
-
class: normalizeClass(["min-h-0 flex-1 text-sm text-ink/90", unref(resizing) ? "[&_[data-scrollbarimpl]]:invisible" : ""]),
|
|
167
|
-
"content-class": bodyPad.value
|
|
168
|
-
}, {
|
|
169
|
-
default: withCtx(() => [
|
|
170
|
-
renderSlot(_ctx.$slots, "default")
|
|
171
|
-
]),
|
|
172
|
-
_: 3
|
|
173
|
-
}, 8, ["class", "content-class"])),
|
|
174
|
-
_ctx.$slots.footer ? (openBlock(), createElementBlock("footer", _hoisted_3, [
|
|
175
|
-
renderSlot(_ctx.$slots, "footer")
|
|
176
|
-
])) : createCommentVNode("", true)
|
|
177
|
-
]),
|
|
178
|
-
_: 3
|
|
179
|
-
}, 16, ["class", "style"])
|
|
180
|
-
], 4)
|
|
181
|
-
]),
|
|
182
|
-
_: 3
|
|
183
|
-
})
|
|
184
|
-
]),
|
|
185
|
-
_: 3
|
|
186
|
-
}, 8, ["open"]);
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
});
|
|
190
|
-
export {
|
|
191
|
-
_sfc_main as _
|
|
192
|
-
};
|