@profitliga/ui 2.0.5 → 2.0.7
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/components/v2/AlertDialog/AlertDialog.css +1 -1
- package/dist/components/v2/AlertDialog/AlertDialog.vue.d.ts +2 -0
- package/dist/components/v2/AlertDialog/AlertDialog.vue.js +2 -2
- package/dist/components/v2/AlertDialog/AlertDialog.vue2.js +73 -70
- package/dist/components/v2/BottomSheet/BottomSheet.css +1 -1
- package/dist/components/v2/BottomSheet/BottomSheet.vue.d.ts +2 -0
- package/dist/components/v2/BottomSheet/BottomSheet.vue.js +1 -1
- package/dist/components/v2/BottomSheet/BottomSheet.vue2.js +75 -70
- package/dist/components/v2/Dialog/Dialog.css +1 -1
- package/dist/components/v2/Dialog/Dialog.vue.d.ts +2 -0
- package/dist/components/v2/Dialog/Dialog.vue.js +1 -1
- package/dist/components/v2/Dialog/Dialog.vue2.js +83 -78
- package/dist/components/v2/Drawer/Drawer.css +1 -1
- package/dist/components/v2/Drawer/Drawer.vue.d.ts +2 -0
- package/dist/components/v2/Drawer/Drawer.vue.js +2 -2
- package/dist/components/v2/Drawer/Drawer.vue2.js +94 -89
- package/dist/components/v2/shared/useLayerZIndex.util.d.ts +10 -0
- package/dist/components/v2/shared/useLayerZIndex.util.js +25 -13
- package/dist/utils/onClickOutside.util.js +27 -21
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.alert-dialog-trigger[data-v-
|
|
1
|
+
.alert-dialog-trigger[data-v-59984f26]{display:contents}.alert-dialog-layer[data-v-59984f26]{position:relative}.alert-dialog-icon[data-v-59984f26]{--icon-bg:var(--color-primary-600);--icon-shadow:#008925b2;box-sizing:border-box;width:44px;height:44px;color:var(--color-neutral-0);background-color:var(--icon-bg);box-shadow:-1px 1px 10px 0px var(--icon-shadow);filter:opacity(.7);border-radius:12px;flex-shrink:0;justify-content:center;align-items:center;padding:8px;display:flex}.alert-dialog-icon--success[data-v-59984f26]{--icon-bg:var(--color-primary-600);--icon-shadow:#008925b2}.alert-dialog-icon--warning[data-v-59984f26]{--icon-bg:var(--color-warn-600);--icon-shadow:#d47d16b2}.alert-dialog-icon--error[data-v-59984f26]{--icon-bg:var(--color-error-600);--icon-shadow:#bd2429b2}.alert-dialog-content[data-v-59984f26]{box-sizing:content-box;scrollbar-width:thin;scrollbar-color:var(--theme-neutral-icon-primary) var(--theme-neutral-surface-icon);width:90vw;max-height:85vh;overflow-y:auto}.alert-dialog-content[data-v-59984f26]::-webkit-scrollbar{width:8px;height:0}.alert-dialog-content[data-v-59984f26]::-webkit-scrollbar-thumb{background-color:var(--theme-neutral-icon-primary);background-clip:padding-box;border:1px solid #0000;border-radius:999px}.alert-dialog-content[data-v-59984f26]::-webkit-scrollbar-track{background:var(--theme-neutral-surface-icon);border-radius:4px}.alert-dialog-content[data-v-59984f26]::-webkit-scrollbar-corner{background:0 0}.alert-dialog-content[data-v-59984f26]{box-sizing:border-box;z-index:1001;background-color:#fff;border-radius:12px;flex-direction:column;justify-content:flex-start;align-items:flex-start;padding:24px;display:flex;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%)}.alert-dialog-content[data-state=open][data-v-59984f26]{animation:fadeIn var(--animation-duration) ease-in-out}.alert-dialog-content[data-state=closed][data-v-59984f26]{animation:fadeOut var(--animation-duration) ease-in-out}.alert-dialog-content__header[data-v-59984f26]{justify-content:flex-start;align-items:center;gap:12px;width:100%;margin-bottom:20px;display:flex}.alert-dialog-content__header--divided[data-v-59984f26]{border-bottom:1px solid var(--color-secondary-250);margin-bottom:12px;padding-bottom:12px}.alert-dialog-content__title[data-v-59984f26]{width:100%;color:var(--theme-neutral-text-title);margin:0;font-size:1.25rem;font-weight:500;line-height:120%}.alert-dialog-content__title--with-icon[data-v-59984f26]{font-weight:700}.alert-dialog-content__description[data-v-59984f26]{width:100%;color:var(--theme-neutral-text-body);margin:0 0 12px;font-size:1rem;font-weight:400;line-height:160%}.alert-dialog-content__actions[data-v-59984f26]{justify-content:flex-end;align-items:center;gap:12px;width:100%;margin-top:20px;display:flex}.alert-dialog-mobile[data-v-59984f26]{box-sizing:border-box;flex-direction:column;gap:16px;width:100%;padding:16px;display:flex}.alert-dialog-mobile__header[data-v-59984f26]{justify-content:flex-start;align-items:center;gap:12px;display:flex}.alert-dialog-mobile__header--divided[data-v-59984f26]{border-bottom:1px solid var(--color-secondary-250);padding-bottom:12px}.alert-dialog-mobile__title[data-v-59984f26]{color:var(--theme-neutral-text-title);margin:0;font-size:1.125rem;font-weight:500;line-height:1.5}.alert-dialog-mobile__title--with-icon[data-v-59984f26]{font-weight:700}.alert-dialog-mobile__description[data-v-59984f26]{color:var(--theme-neutral-text-body);font-size:1rem;font-weight:400;line-height:160%}.alert-dialog-mobile__actions[data-v-59984f26]{flex-direction:column-reverse;gap:8px;width:100%;display:flex}.alert-dialog-mobile__actions[data-v-59984f26] button{width:100%}
|
|
@@ -26,6 +26,7 @@ declare function __VLS_template(): {
|
|
|
26
26
|
};
|
|
27
27
|
refs: {
|
|
28
28
|
triggerRef: HTMLSpanElement;
|
|
29
|
+
layerRef: HTMLDivElement;
|
|
29
30
|
contentRef: HTMLDivElement;
|
|
30
31
|
};
|
|
31
32
|
rootEl: any;
|
|
@@ -45,6 +46,7 @@ declare const __VLS_component: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}
|
|
|
45
46
|
testId: string;
|
|
46
47
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
47
48
|
triggerRef: HTMLSpanElement;
|
|
49
|
+
layerRef: HTMLDivElement;
|
|
48
50
|
contentRef: HTMLDivElement;
|
|
49
51
|
}, any>;
|
|
50
52
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -2,7 +2,7 @@ import './AlertDialog.css';
|
|
|
2
2
|
import o from "./AlertDialog.vue2.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const
|
|
5
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-59984f26"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
m as default
|
|
8
8
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { CircleCheck as
|
|
3
|
-
import { useBodyScroll as
|
|
4
|
-
import { useFocusTrap as
|
|
5
|
-
import
|
|
6
|
-
import { ANIMATION_DURATION_MS as
|
|
7
|
-
import
|
|
8
|
-
import { useDelayedVisibility as
|
|
9
|
-
import { useIsMobile as
|
|
10
|
-
import { useLayerZIndex as
|
|
11
|
-
import { useTestId as
|
|
12
|
-
import { useTriggerAria as
|
|
13
|
-
const
|
|
1
|
+
import { defineComponent as Z, useModel as j, useId as G, computed as m, useTemplateRef as I, watch as H, onBeforeUnmount as J, openBlock as o, createElementBlock as n, Fragment as Q, mergeProps as i, unref as t, renderSlot as r, createCommentVNode as d, createBlock as y, withCtx as T, createElementVNode as c, normalizeClass as _, resolveDynamicComponent as z, normalizeStyle as X, mergeModels as O } from "vue";
|
|
2
|
+
import { CircleCheck as Y, CircleAlert as x } from "@lucide/vue";
|
|
3
|
+
import { useBodyScroll as ee } from "../../../utils/useBodyScroll.util.js";
|
|
4
|
+
import { useFocusTrap as te } from "../../../utils/useFocusTrap.util.js";
|
|
5
|
+
import oe from "../BottomSheet/BottomSheet.vue.js";
|
|
6
|
+
import { ANIMATION_DURATION_MS as N } from "../shared/animation.const.js";
|
|
7
|
+
import ae from "../shared/Portal.vue.js";
|
|
8
|
+
import { useDelayedVisibility as ie } from "../shared/useDelayedVisibility.util.js";
|
|
9
|
+
import { useIsMobile as le } from "../shared/useIsMobile.util.js";
|
|
10
|
+
import { useLayerZIndex as re } from "../shared/useLayerZIndex.util.js";
|
|
11
|
+
import { useTestId as se } from "../shared/useTestId.util.js";
|
|
12
|
+
import { useTriggerAria as ne } from "../shared/useTriggerAria.util.js";
|
|
13
|
+
const de = { class: "alert-dialog-mobile" }, ce = ["data-state"], ue = ["aria-describedby", "data-state"], Ce = /* @__PURE__ */ Z({
|
|
14
14
|
inheritAttrs: !1,
|
|
15
15
|
__name: "AlertDialog",
|
|
16
16
|
props: /* @__PURE__ */ O({
|
|
@@ -24,69 +24,70 @@ const re = { class: "alert-dialog-mobile" }, ne = ["data-state"], de = ["aria-de
|
|
|
24
24
|
openModifiers: {}
|
|
25
25
|
}),
|
|
26
26
|
emits: /* @__PURE__ */ O(["escapeKeyDown"], ["update:open"]),
|
|
27
|
-
setup(l, { emit:
|
|
28
|
-
const u = l,
|
|
27
|
+
setup(l, { emit: K }) {
|
|
28
|
+
const u = l, w = le(u.breakpointMobile), C = K, s = j(l, "open"), k = G(), f = `alert-dialog-title-${k}`, R = `alert-dialog-description-${k}`, b = `alert-dialog-content-${k}`, L = m(() => `${u.width}px`), a = se(() => u.testId), P = m(() => ({
|
|
29
29
|
"aria-haspopup": "dialog",
|
|
30
|
-
"aria-expanded":
|
|
31
|
-
"aria-controls":
|
|
30
|
+
"aria-expanded": s.value,
|
|
31
|
+
"aria-controls": s.value ? b : void 0
|
|
32
32
|
})), S = m(
|
|
33
|
-
() => u.variant === "success" ?
|
|
34
|
-
), B = m(() => u.divider ?? !!u.variant), D =
|
|
35
|
-
|
|
33
|
+
() => u.variant === "success" ? Y : x
|
|
34
|
+
), B = m(() => u.divider ?? !!u.variant), D = I("triggerRef"), E = I("contentRef"), M = I("layerRef");
|
|
35
|
+
ne({
|
|
36
36
|
host: () => D.value,
|
|
37
|
-
isOpen: () =>
|
|
37
|
+
isOpen: () => s.value,
|
|
38
38
|
contentId: () => b,
|
|
39
39
|
hasPopup: () => "dialog"
|
|
40
40
|
});
|
|
41
|
-
const { lockScroll:
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
const { lockScroll: U, unlockScroll: V } = ee(), $ = te(() => E.value), p = re();
|
|
42
|
+
H(M, (e) => p.registerElement(e));
|
|
43
|
+
function F() {
|
|
44
|
+
s.value = !1;
|
|
44
45
|
}
|
|
45
46
|
function h(e) {
|
|
46
|
-
e.key === "Escape" && (
|
|
47
|
+
e.key === "Escape" && (C("escapeKeyDown", e), e.defaultPrevented || F());
|
|
47
48
|
}
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
const q = m(() => s.value && !w.value), { visible: W, dataState: A } = ie(
|
|
50
|
+
q,
|
|
51
|
+
N,
|
|
51
52
|
{
|
|
52
53
|
onOpen: () => {
|
|
53
|
-
|
|
54
|
+
p.acquire(), U(), $.activate({ focusDelayMs: N }), document.addEventListener("keydown", h);
|
|
54
55
|
},
|
|
55
56
|
onCloseStart: () => {
|
|
56
|
-
|
|
57
|
+
$.deactivate(), document.removeEventListener("keydown", h);
|
|
57
58
|
},
|
|
58
59
|
onCloseEnd: () => {
|
|
59
|
-
|
|
60
|
+
V(), p.release();
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
);
|
|
63
|
-
return
|
|
64
|
-
document.removeEventListener("keydown", h),
|
|
65
|
-
}), (e, v) => (o(), n(
|
|
64
|
+
return J(() => {
|
|
65
|
+
document.removeEventListener("keydown", h), $.deactivate();
|
|
66
|
+
}), (e, v) => (o(), n(Q, null, [
|
|
66
67
|
e.$slots.trigger ? (o(), n("span", i({
|
|
67
68
|
key: 0,
|
|
68
69
|
ref_key: "triggerRef",
|
|
69
70
|
ref: D,
|
|
70
71
|
class: "alert-dialog-trigger"
|
|
71
72
|
}, t(a)("trigger"), {
|
|
72
|
-
onClick: v[0] || (v[0] = (
|
|
73
|
+
onClick: v[0] || (v[0] = (g) => s.value = !0)
|
|
73
74
|
}), [
|
|
74
|
-
|
|
75
|
+
r(e.$slots, "trigger", { props: P.value }, void 0, !0)
|
|
75
76
|
], 16)) : d("", !0),
|
|
76
|
-
t(
|
|
77
|
+
t(w) ? (o(), y(t(oe), {
|
|
77
78
|
key: 1,
|
|
78
|
-
open:
|
|
79
|
-
"onUpdate:open": v[1] || (v[1] = (
|
|
79
|
+
open: s.value,
|
|
80
|
+
"onUpdate:open": v[1] || (v[1] = (g) => s.value = g),
|
|
80
81
|
"disable-outside-pointer-events": "",
|
|
81
82
|
"disable-swipe-to-close": "",
|
|
82
|
-
"labelled-by":
|
|
83
|
+
"labelled-by": f,
|
|
83
84
|
"test-id": l.testId,
|
|
84
|
-
onEscapeKeyDown: v[2] || (v[2] = (
|
|
85
|
+
onEscapeKeyDown: v[2] || (v[2] = (g) => C("escapeKeyDown", g))
|
|
85
86
|
}, {
|
|
86
|
-
default:
|
|
87
|
-
c("div",
|
|
87
|
+
default: T(() => [
|
|
88
|
+
c("div", de, [
|
|
88
89
|
c("div", {
|
|
89
|
-
class:
|
|
90
|
+
class: _(["alert-dialog-mobile__header", {
|
|
90
91
|
"alert-dialog-mobile__header--divided": B.value
|
|
91
92
|
}])
|
|
92
93
|
}, [
|
|
@@ -94,58 +95,60 @@ const re = { class: "alert-dialog-mobile" }, ne = ["data-state"], de = ["aria-de
|
|
|
94
95
|
key: 0,
|
|
95
96
|
class: ["alert-dialog-icon", `alert-dialog-icon--${l.variant}`]
|
|
96
97
|
}, t(a)("icon")), [
|
|
97
|
-
|
|
98
|
-
(o(),
|
|
98
|
+
r(e.$slots, "icon", {}, () => [
|
|
99
|
+
(o(), y(z(S.value), { size: 28 }))
|
|
99
100
|
], !0)
|
|
100
101
|
], 16)) : d("", !0),
|
|
101
102
|
c("h2", i({
|
|
102
|
-
id:
|
|
103
|
+
id: f,
|
|
103
104
|
class: ["alert-dialog-mobile__title", {
|
|
104
105
|
"alert-dialog-mobile__title--with-icon": l.variant
|
|
105
106
|
}]
|
|
106
107
|
}, t(a)("title")), [
|
|
107
|
-
|
|
108
|
+
r(e.$slots, "title", {}, void 0, !0)
|
|
108
109
|
], 16)
|
|
109
110
|
], 2),
|
|
110
111
|
e.$slots.default ? (o(), n("div", i({
|
|
111
112
|
key: 0,
|
|
112
113
|
class: "alert-dialog-mobile__description"
|
|
113
114
|
}, t(a)("description")), [
|
|
114
|
-
|
|
115
|
+
r(e.$slots, "default", {}, void 0, !0)
|
|
115
116
|
], 16)) : d("", !0),
|
|
116
117
|
e.$slots.actions ? (o(), n("div", i({
|
|
117
118
|
key: 1,
|
|
118
119
|
class: "alert-dialog-mobile__actions"
|
|
119
120
|
}, t(a)("actions")), [
|
|
120
|
-
|
|
121
|
+
r(e.$slots, "actions", {}, void 0, !0)
|
|
121
122
|
], 16)) : d("", !0)
|
|
122
123
|
])
|
|
123
124
|
]),
|
|
124
125
|
_: 3
|
|
125
|
-
}, 8, ["open", "test-id"])) : t(
|
|
126
|
-
default:
|
|
126
|
+
}, 8, ["open", "test-id"])) : t(W) ? (o(), y(ae, { key: 2 }, {
|
|
127
|
+
default: T(() => [
|
|
127
128
|
c("div", {
|
|
129
|
+
ref_key: "layerRef",
|
|
130
|
+
ref: M,
|
|
128
131
|
class: "alert-dialog-layer",
|
|
129
|
-
style:
|
|
132
|
+
style: X({ zIndex: t(p).zIndex.value })
|
|
130
133
|
}, [
|
|
131
134
|
c("div", i({
|
|
132
135
|
class: "overlay alert-dialog-overlay",
|
|
133
|
-
"data-state": t(
|
|
134
|
-
}, t(a)("overlay")), null, 16,
|
|
136
|
+
"data-state": t(A)
|
|
137
|
+
}, t(a)("overlay")), null, 16, ce),
|
|
135
138
|
c("div", i({
|
|
136
139
|
id: b,
|
|
137
140
|
ref_key: "contentRef",
|
|
138
|
-
ref:
|
|
141
|
+
ref: E,
|
|
139
142
|
role: "alertdialog",
|
|
140
143
|
"aria-modal": "true",
|
|
141
|
-
"aria-labelledby":
|
|
142
|
-
"aria-describedby": e.$slots.default ?
|
|
143
|
-
"data-state": t(
|
|
144
|
+
"aria-labelledby": f,
|
|
145
|
+
"aria-describedby": e.$slots.default ? R : void 0,
|
|
146
|
+
"data-state": t(A),
|
|
144
147
|
class: "alert-dialog-content",
|
|
145
|
-
style: { maxWidth:
|
|
148
|
+
style: { maxWidth: L.value }
|
|
146
149
|
}, { ...e.$attrs, ...t(a)("content") }), [
|
|
147
150
|
c("div", {
|
|
148
|
-
class:
|
|
151
|
+
class: _(["alert-dialog-content__header", {
|
|
149
152
|
"alert-dialog-content__header--divided": B.value
|
|
150
153
|
}])
|
|
151
154
|
}, [
|
|
@@ -153,33 +156,33 @@ const re = { class: "alert-dialog-mobile" }, ne = ["data-state"], de = ["aria-de
|
|
|
153
156
|
key: 0,
|
|
154
157
|
class: ["alert-dialog-icon", `alert-dialog-icon--${l.variant}`]
|
|
155
158
|
}, t(a)("icon")), [
|
|
156
|
-
|
|
157
|
-
(o(),
|
|
159
|
+
r(e.$slots, "icon", {}, () => [
|
|
160
|
+
(o(), y(z(S.value), { size: 28 }))
|
|
158
161
|
], !0)
|
|
159
162
|
], 16)) : d("", !0),
|
|
160
163
|
c("h2", i({
|
|
161
|
-
id:
|
|
164
|
+
id: f,
|
|
162
165
|
class: ["alert-dialog-content__title", {
|
|
163
166
|
"alert-dialog-content__title--with-icon": l.variant
|
|
164
167
|
}]
|
|
165
168
|
}, t(a)("title")), [
|
|
166
|
-
|
|
169
|
+
r(e.$slots, "title", {}, void 0, !0)
|
|
167
170
|
], 16)
|
|
168
171
|
], 2),
|
|
169
172
|
e.$slots.default ? (o(), n("div", i({
|
|
170
173
|
key: 0,
|
|
171
|
-
id:
|
|
174
|
+
id: R,
|
|
172
175
|
class: "alert-dialog-content__description"
|
|
173
176
|
}, t(a)("description")), [
|
|
174
|
-
|
|
177
|
+
r(e.$slots, "default", {}, void 0, !0)
|
|
175
178
|
], 16)) : d("", !0),
|
|
176
179
|
e.$slots.actions ? (o(), n("div", i({
|
|
177
180
|
key: 1,
|
|
178
181
|
class: "alert-dialog-content__actions"
|
|
179
182
|
}, t(a)("actions")), [
|
|
180
|
-
|
|
183
|
+
r(e.$slots, "actions", {}, void 0, !0)
|
|
181
184
|
], 16)) : d("", !0)
|
|
182
|
-
], 16,
|
|
185
|
+
], 16, ue)
|
|
183
186
|
], 4)
|
|
184
187
|
]),
|
|
185
188
|
_: 3
|
|
@@ -188,5 +191,5 @@ const re = { class: "alert-dialog-mobile" }, ne = ["data-state"], de = ["aria-de
|
|
|
188
191
|
}
|
|
189
192
|
});
|
|
190
193
|
export {
|
|
191
|
-
|
|
194
|
+
Ce as default
|
|
192
195
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.sheet-trigger[data-v-
|
|
1
|
+
.sheet-trigger[data-v-8862ce15]{display:contents}.sheet-layer[data-v-8862ce15]{position:relative}.sheet-content[data-v-8862ce15]{background-color:var(--theme-neutral-0);z-index:1002;border-radius:12px 12px 0 0;flex-direction:column;width:100%;max-height:calc(100vh - 40px);display:flex;position:fixed;bottom:0;left:0;right:0;overflow:visible;box-shadow:0 2px 5px #3a3a3a40}.sheet-content[data-state=open][data-v-8862ce15]{animation:slideBottomIn var(--animation-duration) ease-in-out}.sheet-content[data-state=closed][data-v-8862ce15]{animation:slideBottomOut var(--animation-duration) ease-in-out}.sheet-content__handle[data-v-8862ce15]{cursor:grab;touch-action:none;flex-shrink:0;justify-content:center;align-items:flex-end;width:100%;height:24px;padding-bottom:12px;display:flex}.sheet-content__handle[data-v-8862ce15]:active{cursor:grabbing}.sheet-content__handle-dot[data-v-8862ce15]{background-color:var(--theme-neutral-icon-primary);border-radius:2px;width:48px;height:4px}.sheet-content__body[data-v-8862ce15]{box-sizing:content-box;scrollbar-width:thin;scrollbar-color:var(--theme-neutral-icon-primary) var(--theme-neutral-surface-icon);flex:auto;width:100%;min-height:0;overflow-y:auto}.sheet-content__body[data-v-8862ce15]::-webkit-scrollbar{width:8px;height:0}.sheet-content__body[data-v-8862ce15]::-webkit-scrollbar-thumb{background-color:var(--theme-neutral-icon-primary);background-clip:padding-box;border:1px solid #0000;border-radius:999px}.sheet-content__body[data-v-8862ce15]::-webkit-scrollbar-track{background:var(--theme-neutral-surface-icon);border-radius:4px}.sheet-content__body[data-v-8862ce15]::-webkit-scrollbar-corner{background:0 0}.sheet-overlay--drag-closing[data-v-8862ce15]{visibility:hidden}
|
|
@@ -18,6 +18,7 @@ declare function __VLS_template(): {
|
|
|
18
18
|
};
|
|
19
19
|
refs: {
|
|
20
20
|
triggerRef: HTMLSpanElement;
|
|
21
|
+
layerRef: HTMLDivElement;
|
|
21
22
|
contentRef: HTMLDivElement;
|
|
22
23
|
};
|
|
23
24
|
rootEl: any;
|
|
@@ -40,6 +41,7 @@ declare const __VLS_component: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}
|
|
|
40
41
|
labelledBy: string;
|
|
41
42
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
42
43
|
triggerRef: HTMLSpanElement;
|
|
44
|
+
layerRef: HTMLDivElement;
|
|
43
45
|
contentRef: HTMLDivElement;
|
|
44
46
|
}, any>;
|
|
45
47
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -2,7 +2,7 @@ import './BottomSheet.css';
|
|
|
2
2
|
import o from "./BottomSheet.vue2.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
5
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-8862ce15"]]);
|
|
6
6
|
export {
|
|
7
7
|
p as default
|
|
8
8
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { onClickOutside as
|
|
3
|
-
import { useBodyScroll as
|
|
4
|
-
import { useFocusTrap as
|
|
5
|
-
import { useSwipeToClose as
|
|
6
|
-
import { ANIMATION_DURATION_MS as
|
|
7
|
-
import
|
|
8
|
-
import { useDelayedVisibility as
|
|
9
|
-
import { useLayerZIndex as
|
|
10
|
-
import { useTestId as
|
|
11
|
-
import { useTriggerAria as
|
|
12
|
-
const
|
|
1
|
+
import { defineComponent as F, useModel as K, useId as U, computed as k, ref as Z, useTemplateRef as w, watch as E, onBeforeUnmount as q, openBlock as m, createElementBlock as D, Fragment as H, mergeProps as u, unref as t, renderSlot as B, createCommentVNode as I, createBlock as Y, withCtx as j, createElementVNode as f, normalizeStyle as G, withModifiers as J, mergeModels as M, nextTick as Q } from "vue";
|
|
2
|
+
import { onClickOutside as W } from "../../../utils/onClickOutside.util.js";
|
|
3
|
+
import { useBodyScroll as X } from "../../../utils/useBodyScroll.util.js";
|
|
4
|
+
import { useFocusTrap as _ } from "../../../utils/useFocusTrap.util.js";
|
|
5
|
+
import { useSwipeToClose as ee } from "../../../utils/useSwipeToClose.util.js";
|
|
6
|
+
import { ANIMATION_DURATION_MS as R } from "../shared/animation.const.js";
|
|
7
|
+
import te from "../shared/Portal.vue.js";
|
|
8
|
+
import { useDelayedVisibility as oe } from "../shared/useDelayedVisibility.util.js";
|
|
9
|
+
import { useLayerZIndex as ae } from "../shared/useLayerZIndex.util.js";
|
|
10
|
+
import { useTestId as ne } from "../shared/useTestId.util.js";
|
|
11
|
+
import { useTriggerAria as le } from "../shared/useTriggerAria.util.js";
|
|
12
|
+
const se = ["data-state"], re = ["aria-label", "aria-labelledby", "data-state"], ke = /* @__PURE__ */ F({
|
|
13
13
|
inheritAttrs: !1,
|
|
14
14
|
__name: "BottomSheet",
|
|
15
|
-
props: /* @__PURE__ */
|
|
15
|
+
props: /* @__PURE__ */ M({
|
|
16
16
|
zIndex: { default: "auto" },
|
|
17
17
|
disableOutsidePointerEvents: { type: Boolean, default: !1 },
|
|
18
18
|
disableSwipeToClose: { type: Boolean, default: !1 },
|
|
@@ -23,126 +23,131 @@ const le = ["data-state"], se = ["aria-label", "aria-labelledby", "data-state"],
|
|
|
23
23
|
open: { type: Boolean, default: !1 },
|
|
24
24
|
openModifiers: {}
|
|
25
25
|
}),
|
|
26
|
-
emits: /* @__PURE__ */
|
|
27
|
-
setup(l, { emit:
|
|
28
|
-
const
|
|
26
|
+
emits: /* @__PURE__ */ M(["escapeKeyDown", "pointerDownOutside"], ["update:open"]),
|
|
27
|
+
setup(l, { emit: x }) {
|
|
28
|
+
const c = l, S = x, s = K(l, "open"), p = `sheet-content-${U()}`, r = ne(() => c.testId), $ = k(() => ({
|
|
29
29
|
"aria-haspopup": "dialog",
|
|
30
30
|
"aria-expanded": s.value,
|
|
31
|
-
"aria-controls": s.value ?
|
|
32
|
-
})), i =
|
|
33
|
-
|
|
34
|
-
host: () =>
|
|
31
|
+
"aria-controls": s.value ? p : void 0
|
|
32
|
+
})), i = Z(!1), C = w("triggerRef"), v = w("contentRef"), O = w("layerRef");
|
|
33
|
+
le({
|
|
34
|
+
host: () => C.value,
|
|
35
35
|
isOpen: () => s.value,
|
|
36
|
-
contentId: () =>
|
|
36
|
+
contentId: () => p,
|
|
37
37
|
hasPopup: () => "dialog"
|
|
38
38
|
});
|
|
39
|
-
const { lockScroll:
|
|
40
|
-
() =>
|
|
39
|
+
const { lockScroll: P, unlockScroll: z } = X(), g = _(() => v.value), d = ae(), A = k(
|
|
40
|
+
() => c.zIndex === "auto" ? d.zIndex.value : c.zIndex
|
|
41
41
|
);
|
|
42
42
|
function y() {
|
|
43
43
|
s.value = !1;
|
|
44
44
|
}
|
|
45
|
-
const o =
|
|
45
|
+
const o = ee({
|
|
46
46
|
onClose: () => {
|
|
47
47
|
i.value = !0, y();
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
|
-
function h(
|
|
51
|
-
|
|
50
|
+
function h(e) {
|
|
51
|
+
e.key === "Escape" && (S("escapeKeyDown", e), e.defaultPrevented || y());
|
|
52
52
|
}
|
|
53
|
-
function
|
|
54
|
-
|
|
53
|
+
function N(e) {
|
|
54
|
+
S("pointerDownOutside", e), !c.disableOutsidePointerEvents && !e.defaultPrevented && y();
|
|
55
55
|
}
|
|
56
|
-
const { visible:
|
|
56
|
+
const { visible: L, dataState: T } = oe(
|
|
57
57
|
s,
|
|
58
|
-
() => i.value ? 0 :
|
|
58
|
+
() => i.value ? 0 : R,
|
|
59
59
|
{
|
|
60
60
|
onOpen: () => {
|
|
61
|
-
i.value = !1, o.reset(),
|
|
61
|
+
i.value = !1, o.reset(), d.acquire(), P(), g.activate({ focusDelayMs: R }), document.addEventListener("keydown", h), Q(() => o.measureContentHeight(v.value));
|
|
62
62
|
},
|
|
63
63
|
onCloseStart: () => {
|
|
64
|
-
|
|
64
|
+
g.deactivate(), document.removeEventListener("keydown", h);
|
|
65
65
|
},
|
|
66
66
|
onCloseEnd: () => {
|
|
67
|
-
|
|
67
|
+
z(), d.release();
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
);
|
|
71
|
+
E(O, (e) => d.registerElement(e));
|
|
71
72
|
let b;
|
|
72
|
-
|
|
73
|
-
b?.(), b =
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
E(v, (e) => {
|
|
74
|
+
b?.(), b = e ? W(e, N, {
|
|
75
|
+
ignore: () => d.elementsAbove()
|
|
76
|
+
}) : void 0;
|
|
77
|
+
}), q(() => {
|
|
78
|
+
b?.(), document.removeEventListener("keydown", h), g.deactivate();
|
|
76
79
|
});
|
|
77
|
-
const
|
|
80
|
+
const V = k(() => ({
|
|
78
81
|
transform: o.dragOffset.value > 0 ? `translateY(${o.dragOffset.value}px)` : void 0,
|
|
79
82
|
transition: o.isDragging.value ? "none" : "transform 0.2s ease-out",
|
|
80
83
|
animation: i.value ? "none" : void 0
|
|
81
84
|
}));
|
|
82
|
-
return (
|
|
83
|
-
|
|
85
|
+
return (e, a) => (m(), D(H, null, [
|
|
86
|
+
e.$slots.trigger ? (m(), D("span", u({
|
|
84
87
|
key: 0,
|
|
85
88
|
ref_key: "triggerRef",
|
|
86
|
-
ref:
|
|
89
|
+
ref: C,
|
|
87
90
|
class: "sheet-trigger"
|
|
88
|
-
},
|
|
91
|
+
}, t(r)("trigger"), {
|
|
89
92
|
onClick: a[0] || (a[0] = (n) => s.value = !0)
|
|
90
93
|
}), [
|
|
91
|
-
|
|
92
|
-
], 16)) :
|
|
93
|
-
|
|
94
|
-
default:
|
|
95
|
-
|
|
94
|
+
B(e.$slots, "trigger", { props: $.value }, void 0, !0)
|
|
95
|
+
], 16)) : I("", !0),
|
|
96
|
+
t(L) ? (m(), Y(te, { key: 1 }, {
|
|
97
|
+
default: j(() => [
|
|
98
|
+
f("div", {
|
|
99
|
+
ref_key: "layerRef",
|
|
100
|
+
ref: O,
|
|
96
101
|
class: "sheet-layer",
|
|
97
|
-
style:
|
|
102
|
+
style: G({ zIndex: A.value })
|
|
98
103
|
}, [
|
|
99
|
-
|
|
104
|
+
f("div", u({
|
|
100
105
|
class: ["overlay dialog-overlay", { "sheet-overlay--drag-closing": i.value }],
|
|
101
|
-
"data-state":
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
id:
|
|
106
|
+
"data-state": t(T)
|
|
107
|
+
}, t(r)("overlay")), null, 16, se),
|
|
108
|
+
f("div", u({
|
|
109
|
+
id: p,
|
|
105
110
|
ref_key: "contentRef",
|
|
106
|
-
ref:
|
|
111
|
+
ref: v,
|
|
107
112
|
role: "dialog",
|
|
108
113
|
"aria-modal": "true",
|
|
109
114
|
"aria-label": l.labelledBy ? void 0 : l.label,
|
|
110
115
|
"aria-labelledby": l.labelledBy,
|
|
111
116
|
class: "sheet-content",
|
|
112
|
-
"data-state":
|
|
113
|
-
style:
|
|
114
|
-
}, { ...
|
|
115
|
-
l.disableSwipeToClose ?
|
|
117
|
+
"data-state": t(T),
|
|
118
|
+
style: V.value
|
|
119
|
+
}, { ...e.$attrs, ...t(r)("content") }), [
|
|
120
|
+
l.disableSwipeToClose ? I("", !0) : (m(), D("div", u({
|
|
116
121
|
key: 0,
|
|
117
122
|
class: "sheet-content__handle",
|
|
118
123
|
"aria-hidden": "true",
|
|
119
124
|
tabindex: "-1"
|
|
120
|
-
},
|
|
125
|
+
}, t(r)("handle"), {
|
|
121
126
|
onTouchstart: a[1] || (a[1] = //@ts-ignore
|
|
122
|
-
(...n) =>
|
|
123
|
-
onTouchmove: a[2] || (a[2] =
|
|
127
|
+
(...n) => t(o).handleDragStart && t(o).handleDragStart(...n)),
|
|
128
|
+
onTouchmove: a[2] || (a[2] = J(
|
|
124
129
|
//@ts-ignore
|
|
125
|
-
(...n) =>
|
|
130
|
+
(...n) => t(o).handleDragMove && t(o).handleDragMove(...n),
|
|
126
131
|
["prevent"]
|
|
127
132
|
)),
|
|
128
133
|
onTouchend: a[3] || (a[3] = //@ts-ignore
|
|
129
|
-
(...n) =>
|
|
134
|
+
(...n) => t(o).handleDragEnd && t(o).handleDragEnd(...n)),
|
|
130
135
|
onMousedown: a[4] || (a[4] = //@ts-ignore
|
|
131
|
-
(...n) =>
|
|
136
|
+
(...n) => t(o).handleMouseDown && t(o).handleMouseDown(...n))
|
|
132
137
|
}), [...a[5] || (a[5] = [
|
|
133
|
-
|
|
138
|
+
f("div", { class: "sheet-content__handle-dot" }, null, -1)
|
|
134
139
|
])], 16)),
|
|
135
|
-
|
|
136
|
-
|
|
140
|
+
f("div", u({ class: "sheet-content__body" }, t(r)("body")), [
|
|
141
|
+
B(e.$slots, "default", {}, void 0, !0)
|
|
137
142
|
], 16)
|
|
138
|
-
], 16,
|
|
143
|
+
], 16, re)
|
|
139
144
|
], 4)
|
|
140
145
|
]),
|
|
141
146
|
_: 3
|
|
142
|
-
})) :
|
|
147
|
+
})) : I("", !0)
|
|
143
148
|
], 64));
|
|
144
149
|
}
|
|
145
150
|
});
|
|
146
151
|
export {
|
|
147
|
-
|
|
152
|
+
ke as default
|
|
148
153
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.dialog-trigger[data-v-
|
|
1
|
+
.dialog-trigger[data-v-57a203bb]{display:contents}.dialog-layer[data-v-57a203bb]{position:relative}.dialog-content[data-v-57a203bb]{background-color:var(--theme-neutral-0);z-index:1002;border-radius:12px;max-width:90vw;padding:24px;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);box-shadow:0 2px 5px #3a3a3a40}.dialog-content[data-state=open][data-v-57a203bb]{animation:fadeIn var(--animation-duration) ease-in-out}.dialog-content[data-state=closed][data-v-57a203bb]{animation:fadeOut var(--animation-duration) ease-in-out}.dialog-content__header[data-v-57a203bb]{justify-content:space-between;align-items:flex-start;gap:12px;width:100%;height:auto;margin-bottom:16px;display:flex}.dialog-content__header--divided[data-v-57a203bb]{margin-bottom:12px}.dialog-content__heading[data-v-57a203bb]{flex:1 1 0;align-items:center;gap:12px;min-width:0;display:flex}.dialog-content__icon[data-v-57a203bb]{flex-shrink:0;justify-content:center;align-items:center;display:flex}.dialog-content__divider[data-v-57a203bb]{background-color:var(--theme-secondary-250);flex:none;width:100%;height:1px;margin-bottom:12px}.dialog-content__close[data-v-57a203bb]{background:0 0;border:none;justify-content:center;align-items:center;width:20px;min-width:20px;height:20px;margin-left:auto;padding:0;display:flex}.dialog-content__close[data-v-57a203bb]:focus-visible{outline:2px solid var(--theme-primary-500);outline-offset:2px}.dialog-content__close svg[data-v-57a203bb]{width:20px;height:20px;color:var(--color-secondary-400);transition:color .3s ease-in-out}.dialog-content__close[data-v-57a203bb]:hover{cursor:pointer}.dialog-content__close:hover svg[data-v-57a203bb]{color:var(--color-secondary-500);transition:color .3s ease-in-out}.dialog-content__wrapper[data-v-57a203bb]{flex-direction:column;justify-content:flex-start;align-items:flex-start;gap:12px;width:100%;height:auto;display:flex}.dialog-content__wrapper[data-v-57a203bb]:not(:last-child){margin-bottom:32px}.dialog-content__actions[data-v-57a203bb]{justify-content:flex-end;align-items:center;gap:8px;width:100%;height:auto;display:flex}@media (max-width:1010px){.dialog-content[data-v-57a203bb]{box-sizing:border-box;flex-direction:column;height:calc(100dvh - 32px);max-height:calc(100dvh - 32px);display:flex}.dialog-content__header[data-v-57a203bb]{flex:none}.dialog-content__wrapper[data-v-57a203bb]{box-sizing:content-box;scrollbar-width:thin;scrollbar-color:var(--theme-neutral-icon-primary) var(--theme-neutral-surface-icon);flex:1 1 0;min-height:0;overflow-y:auto}.dialog-content__wrapper[data-v-57a203bb]::-webkit-scrollbar{width:8px;height:0}.dialog-content__wrapper[data-v-57a203bb]::-webkit-scrollbar-thumb{background-color:var(--theme-neutral-icon-primary);background-clip:padding-box;border:1px solid #0000;border-radius:999px}.dialog-content__wrapper[data-v-57a203bb]::-webkit-scrollbar-track{background:var(--theme-neutral-surface-icon);border-radius:4px}.dialog-content__wrapper[data-v-57a203bb]::-webkit-scrollbar-corner{background:0 0}.dialog-content__actions[data-v-57a203bb]{flex:none}}.dialog-content__title[data-v-57a203bb]{width:100%;font-weight:500}.dialog-content__title--with-icon[data-v-57a203bb]{font-weight:700}.dialog-mobile[data-v-57a203bb]{width:100%;padding:0 16px 16px;padding-bottom:calc(16px + env(safe-area-inset-bottom,0px));flex-direction:column;gap:16px;display:flex}.dialog-mobile__header[data-v-57a203bb]{align-items:center;gap:12px;display:flex}.dialog-mobile__icon[data-v-57a203bb]{flex-shrink:0;justify-content:center;align-items:center;display:flex}.dialog-mobile__divider[data-v-57a203bb]{background-color:var(--theme-secondary-250);width:100%;height:1px;margin-top:-4px}.dialog-mobile__title[data-v-57a203bb]{color:var(--theme-neutral-text-title);font-size:1.125rem;font-weight:500;line-height:1.5}.dialog-mobile__content[data-v-57a203bb]{flex-direction:column;gap:12px;display:flex}.dialog-mobile__actions[data-v-57a203bb]{flex-direction:column-reverse;gap:8px;width:100%;display:flex}.dialog-mobile__actions[data-v-57a203bb] button{width:100%}
|
|
@@ -33,6 +33,7 @@ declare function __VLS_template(): {
|
|
|
33
33
|
};
|
|
34
34
|
refs: {
|
|
35
35
|
triggerRef: HTMLSpanElement;
|
|
36
|
+
layerRef: HTMLDivElement;
|
|
36
37
|
contentRef: HTMLDivElement;
|
|
37
38
|
};
|
|
38
39
|
rootEl: any;
|
|
@@ -57,6 +58,7 @@ declare const __VLS_component: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}
|
|
|
57
58
|
testId: string;
|
|
58
59
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
59
60
|
triggerRef: HTMLSpanElement;
|
|
61
|
+
layerRef: HTMLDivElement;
|
|
60
62
|
contentRef: HTMLDivElement;
|
|
61
63
|
}, any>;
|
|
62
64
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -2,7 +2,7 @@ import './Dialog.css';
|
|
|
2
2
|
import o from "./Dialog.vue2.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
5
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-57a203bb"]]);
|
|
6
6
|
export {
|
|
7
7
|
p as default
|
|
8
8
|
};
|