@bridge-ui/vue 0.0.1-beta.6 → 0.0.1
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/Actions/BridgeUIHosts.vue.d.ts +3 -2
- package/dist/Actions/BridgeUIHosts.vue_vue_type_script_setup_true_lang.js +15 -10
- package/dist/Actions/Drawer/BridgeDrawerHost.js +5 -0
- package/dist/Actions/Drawer/BridgeDrawerHost.vue.d.ts +14 -0
- package/dist/Actions/Drawer/BridgeDrawerHost.vue_vue_type_script_setup_true_lang.js +35 -0
- package/dist/Actions/Drawer/bridgeDrawer.types.d.ts +44 -0
- package/dist/Actions/Drawer/bridgeDrawerInjectionKey.d.ts +3 -0
- package/dist/Actions/Drawer/bridgeDrawerInjectionKey.js +4 -0
- package/dist/Actions/Drawer/createBridgeDrawerApi.d.ts +2 -0
- package/dist/Actions/Drawer/createBridgeDrawerApi.js +49 -0
- package/dist/Actions/Drawer/index.d.ts +3 -0
- package/dist/Actions/Drawer/index.js +3 -0
- package/dist/Actions/Drawer/useDrawerAction.d.ts +5 -0
- package/dist/Actions/Drawer/useDrawerAction.js +26 -0
- package/dist/Actions/bridgeUIHosts.types.d.ts +5 -0
- package/dist/Actions/index.d.ts +2 -0
- package/dist/Actions/index.js +8 -6
- package/dist/Components/Badge/badge.types.d.ts +1 -1
- package/dist/Components/Chip/chip.types.d.ts +1 -1
- package/dist/Components/Drawer/Drawer.js +5 -0
- package/dist/Components/Drawer/Drawer.vue.d.ts +39 -0
- package/dist/Components/Drawer/Drawer.vue_vue_type_script_setup_true_lang.js +96 -0
- package/dist/Components/Drawer/composables/useDrawer.d.ts +63 -0
- package/dist/Components/Drawer/composables/useDrawer.js +208 -0
- package/dist/Components/Drawer/drawer.types.d.ts +188 -0
- package/dist/Components/Drawer/index.d.ts +4 -0
- package/dist/Components/Drawer/index.js +3 -0
- package/dist/Components/FormControl/formControl.types.d.ts +6 -6
- package/dist/Components/FormField/formField.types.d.ts +7 -7
- package/dist/Components/Label/label.types.d.ts +1 -1
- package/dist/Components/Link/link.types.d.ts +3 -3
- package/dist/Components/List/composables/useList.js +1 -1
- package/dist/Components/List/list.types.d.ts +1 -1
- package/dist/Components/ListItem/composables/useListItem.js +7 -7
- package/dist/Components/ListItem/listItem.types.d.ts +1 -1
- package/dist/Components/ListSection/composables/useListSection.js +2 -2
- package/dist/Components/ListSection/listSection.types.d.ts +1 -1
- package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +73 -61
- package/dist/Components/Listbox/composables/useListbox.d.ts +0 -5
- package/dist/Components/Listbox/composables/useListbox.js +10 -19
- package/dist/Components/Listbox/listbox.types.d.ts +7 -7
- package/dist/Components/Menu/composables/useMenu.js +1 -1
- package/dist/Components/Menu/menu.types.d.ts +3 -3
- package/dist/Components/Modal/composables/useModal.js +0 -1
- package/dist/Components/Modal/modal.types.d.ts +3 -2
- package/dist/Components/Progress/Progress.js +5 -0
- package/dist/Components/Progress/Progress.vue.d.ts +4 -0
- package/dist/Components/Progress/Progress.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/Components/Progress/composables/useProgress.d.ts +29 -0
- package/dist/Components/Progress/composables/useProgress.js +75 -0
- package/dist/Components/Progress/index.d.ts +3 -0
- package/dist/Components/Progress/index.js +3 -0
- package/dist/Components/Progress/progress.types.d.ts +94 -0
- package/dist/Components/Select/Select.vue.d.ts +2 -2
- package/dist/Components/Select/select.types.d.ts +5 -5
- package/dist/Components/Snackbar/composables/useSnackbar.js +1 -1
- package/dist/Components/Snackbar/snackbar.types.d.ts +7 -7
- package/dist/Components/Spinner/Spinner.js +5 -0
- package/dist/Components/Spinner/Spinner.vue.d.ts +4 -0
- package/dist/Components/Spinner/Spinner.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/Components/Spinner/composables/useSpinner.d.ts +58 -0
- package/dist/Components/Spinner/composables/useSpinner.js +97 -0
- package/dist/Components/Spinner/index.d.ts +3 -0
- package/dist/Components/Spinner/index.js +3 -0
- package/dist/Components/Spinner/spinner.types.d.ts +99 -0
- package/dist/Components/Tab/Tab.js +5 -0
- package/dist/Components/Tab/Tab.vue.d.ts +11 -0
- package/dist/Components/Tab/Tab.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/Components/Tab/composables/useTab.d.ts +23 -0
- package/dist/Components/Tab/composables/useTab.js +88 -0
- package/dist/Components/Tab/index.d.ts +3 -0
- package/dist/Components/Tab/index.js +3 -0
- package/dist/Components/Tab/tab.types.d.ts +94 -0
- package/dist/Components/TabItem/TabItem.js +5 -0
- package/dist/Components/TabItem/TabItem.vue.d.ts +11 -0
- package/dist/Components/TabItem/TabItem.vue_vue_type_script_setup_true_lang.js +25 -0
- package/dist/Components/TabItem/composables/useTabItem.d.ts +3 -0
- package/dist/Components/TabItem/composables/useTabItem.js +39 -0
- package/dist/Components/TabItem/index.d.ts +3 -0
- package/dist/Components/TabItem/index.js +3 -0
- package/dist/Components/TabItem/tabItem.types.d.ts +72 -0
- package/dist/Components/TabList/TabList.js +5 -0
- package/dist/Components/TabList/TabList.vue.d.ts +11 -0
- package/dist/Components/TabList/TabList.vue_vue_type_script_setup_true_lang.js +18 -0
- package/dist/Components/TabList/composables/useTabList.d.ts +10 -0
- package/dist/Components/TabList/composables/useTabList.js +65 -0
- package/dist/Components/TabList/index.d.ts +3 -0
- package/dist/Components/TabList/index.js +3 -0
- package/dist/Components/TabList/tabList.types.d.ts +38 -0
- package/dist/Components/TabPanel/TabPanel.js +5 -0
- package/dist/Components/TabPanel/TabPanel.vue.d.ts +11 -0
- package/dist/Components/TabPanel/TabPanel.vue_vue_type_script_setup_true_lang.js +20 -0
- package/dist/Components/TabPanel/composables/useTabPanel.d.ts +14 -0
- package/dist/Components/TabPanel/composables/useTabPanel.js +51 -0
- package/dist/Components/TabPanel/index.d.ts +3 -0
- package/dist/Components/TabPanel/index.js +3 -0
- package/dist/Components/TabPanel/tabPanel.types.d.ts +48 -0
- package/dist/Components/Tabs/Tabs.js +5 -0
- package/dist/Components/Tabs/Tabs.vue.d.ts +24 -0
- package/dist/Components/Tabs/Tabs.vue_vue_type_script_setup_true_lang.js +73 -0
- package/dist/Components/Tabs/composables/useTabs.d.ts +39 -0
- package/dist/Components/Tabs/composables/useTabs.js +99 -0
- package/dist/Components/Tabs/index.d.ts +4 -0
- package/dist/Components/Tabs/index.js +4 -0
- package/dist/Components/Tabs/tabs.types.d.ts +93 -0
- package/dist/Components/Tabs/tabsInjectionKey.d.ts +121 -0
- package/dist/Components/Tabs/tabsInjectionKey.js +4 -0
- package/dist/Utils/index.d.ts +2 -0
- package/dist/Utils/index.js +20 -19
- package/dist/Utils/useBreakpoint.d.ts +19 -0
- package/dist/Utils/useBreakpoint.js +35 -0
- package/dist/augments.d.ts +10 -0
- package/dist/index.d.ts +18 -1
- package/dist/index.js +76 -58
- package/dist/theme.css +55 -3
- package/package.json +2 -2
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { mergePartBind as e, resolveVnodeRefElement as t, useBridgeUIComponent as ee, useBridgeUIMergedRegistryClasses as te } from "../../../Utils/index.js";
|
|
2
|
+
import { computed as n, nextTick as r, onBeforeUnmount as ne, ref as i, toValue as a, useAttrs as o, watch as s } from "vue";
|
|
3
|
+
import { get as c } from "es-toolkit/compat";
|
|
4
|
+
import { DRAWER_LEAVE_FALLBACK_MS as re, LAYER_STACK_BASE_Z_INDEX as l, acquireLayerStackOrder as ie, cn as u, countDrawerTransitionLayers as d, createFocusTrap as ae, getDrawerOverlayTransitionClass as oe, getDrawerPanelTransitionClass as se, getLayerStackEntry as ce, hasDrawerTransition as le, mergeBridgeUILayeredClasses as f, pushLayerStack as p, resolveEffectiveDrawerTransition as m, splitComponentProps as h, subscribeLayerStack as g } from "@bridge-ui/core";
|
|
5
|
+
import { isModalBackdropClick as ue } from "@bridge-ui/core/Utils";
|
|
6
|
+
import { blurProps as de, placementPanelProps as fe, placementProps as pe, sizeProps as me } from "@bridge-ui/core/Components/Drawer";
|
|
7
|
+
//#region src/Components/Drawer/composables/useDrawer.ts
|
|
8
|
+
var he = [
|
|
9
|
+
"blur",
|
|
10
|
+
"size",
|
|
11
|
+
"scroll",
|
|
12
|
+
"classes",
|
|
13
|
+
"stackId",
|
|
14
|
+
"ariaLabel",
|
|
15
|
+
"autoFocus",
|
|
16
|
+
"placement",
|
|
17
|
+
"persistent",
|
|
18
|
+
"teleportTo",
|
|
19
|
+
"transition",
|
|
20
|
+
"customProps",
|
|
21
|
+
"keepMounted",
|
|
22
|
+
"hideBackdrop",
|
|
23
|
+
"closeOnEscape",
|
|
24
|
+
"ariaLabelledBy",
|
|
25
|
+
"closeOnOverlay",
|
|
26
|
+
"disableScrollLock",
|
|
27
|
+
"disableEnforceFocus",
|
|
28
|
+
"disableRestoreFocus"
|
|
29
|
+
];
|
|
30
|
+
function _(_, ge, v = {}) {
|
|
31
|
+
let _e = o(), y = i(!1), b = i(!1), x = i(""), S = 0, C = null, w = null, T = i(null), E = null, D = i(l), O = null, k = i("closed"), A = null, j = n(() => a(v.show ?? !1));
|
|
32
|
+
function M(e) {
|
|
33
|
+
e || v.onClose?.(), v.show && (v.show.value = e), v.onShowChange?.(e);
|
|
34
|
+
}
|
|
35
|
+
let N = n(() => h({
|
|
36
|
+
bridgeKeys: he,
|
|
37
|
+
props: {
|
|
38
|
+
..._e,
|
|
39
|
+
..._
|
|
40
|
+
}
|
|
41
|
+
})), { merged: P, entry: F } = ee({
|
|
42
|
+
libDefaults: ge,
|
|
43
|
+
componentName: "Drawer",
|
|
44
|
+
props: () => N.value.componentProps
|
|
45
|
+
}), I = n(() => P.value.customProps), L = te({
|
|
46
|
+
entry: F,
|
|
47
|
+
props: () => N.value.componentProps
|
|
48
|
+
}), R = n(() => m(P.value.transition ?? "none")), z = n(() => le(R.value)), B = n(() => P.value.scroll ?? "paper"), V = n(() => P.value.keepMounted && !y.value), H = n(() => P.value.placement ?? "left"), U = n(() => H.value === "left" || H.value === "right" ? "horizontal" : "vertical"), ve = n(() => c(f(pe, F.value?.customProps?.placement), H.value)), ye = n(() => c(fe, H.value)), be = n(() => c(f(de, F.value?.customProps?.blur), P.value.blur)), xe = n(() => c(f(me, F.value?.customProps?.size), [P.value.size, U.value])), Se = n(() => oe(R.value)), Ce = n(() => se(R.value, H.value)), W = n(() => !P.value.persistent), we = n(() => N.value.inheritedAttrs), Te = n(() => e(I.value?.root, we.value, {
|
|
49
|
+
onTransitionend: je,
|
|
50
|
+
style: { zIndex: D.value },
|
|
51
|
+
"aria-hidden": V.value ? !0 : void 0,
|
|
52
|
+
class: u({
|
|
53
|
+
"fixed inset-0": !0,
|
|
54
|
+
"overflow-y-auto": B.value === "body",
|
|
55
|
+
"overflow-hidden": B.value === "paper",
|
|
56
|
+
"invisible pointer-events-none": V.value,
|
|
57
|
+
[c(L.value, "root") ?? ""]: !0
|
|
58
|
+
})
|
|
59
|
+
})), Ee = n(() => e(I.value?.overlay, { onClick: Z }, {
|
|
60
|
+
"data-drawer-part": "overlay",
|
|
61
|
+
"data-state": k.value,
|
|
62
|
+
class: u({
|
|
63
|
+
"fixed inset-0 bg-black/50": !0,
|
|
64
|
+
[be.value ?? ""]: !0,
|
|
65
|
+
[Se.value]: z.value,
|
|
66
|
+
[c(L.value, "overlay") ?? ""]: !0
|
|
67
|
+
})
|
|
68
|
+
})), De = n(() => e(I.value?.wrapper, { onClick: Q }, u({
|
|
69
|
+
"flex min-h-full w-full transform": !0,
|
|
70
|
+
[ve.value ?? ""]: !0,
|
|
71
|
+
[c(L.value, "wrapper") ?? ""]: !0
|
|
72
|
+
}))), Oe = n(() => e(I.value?.panel, {
|
|
73
|
+
role: "dialog",
|
|
74
|
+
"aria-modal": !0,
|
|
75
|
+
"aria-label": P.value.ariaLabel,
|
|
76
|
+
"aria-labelledby": P.value.ariaLabelledBy
|
|
77
|
+
}, {
|
|
78
|
+
"data-drawer-part": "panel",
|
|
79
|
+
"data-state": k.value,
|
|
80
|
+
class: u({
|
|
81
|
+
"relative rounded-none": !0,
|
|
82
|
+
[ye.value ?? ""]: !0,
|
|
83
|
+
[xe.value ?? ""]: !0,
|
|
84
|
+
"overflow-y-auto": B.value === "paper",
|
|
85
|
+
[Ce.value]: z.value,
|
|
86
|
+
[c(L.value, "panel") ?? ""]: !0
|
|
87
|
+
})
|
|
88
|
+
}));
|
|
89
|
+
function G() {
|
|
90
|
+
w?.release(), w = null;
|
|
91
|
+
}
|
|
92
|
+
function K() {
|
|
93
|
+
if (!y.value || k.value !== "open" || !T.value) {
|
|
94
|
+
G();
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
G(), w = ae({
|
|
98
|
+
container: T.value,
|
|
99
|
+
disableAutoFocus: !P.value.autoFocus,
|
|
100
|
+
disableEnforceFocus: P.value.disableEnforceFocus,
|
|
101
|
+
disableRestoreFocus: P.value.disableRestoreFocus
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function ke(e) {
|
|
105
|
+
T.value = t(e), K();
|
|
106
|
+
}
|
|
107
|
+
function q() {
|
|
108
|
+
A !== null && (clearTimeout(A), A = null);
|
|
109
|
+
}
|
|
110
|
+
function J() {
|
|
111
|
+
q(), S = 0, y.value = !1, G(), j.value ? M(!1) : v.onShowChange?.(!1), k.value = "closed", P.value.keepMounted || (b.value = !1);
|
|
112
|
+
}
|
|
113
|
+
function Y() {
|
|
114
|
+
if (E?.releaseScrollLock(), !z.value) {
|
|
115
|
+
J();
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
if (k.value = "closed", S = d(R.value, { hideBackdrop: P.value.hideBackdrop }), S === 0) {
|
|
119
|
+
J();
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
q(), A = setTimeout(() => {
|
|
123
|
+
A = null, S > 0 && J();
|
|
124
|
+
}, re);
|
|
125
|
+
}
|
|
126
|
+
function Ae() {
|
|
127
|
+
if (!z.value) {
|
|
128
|
+
k.value = "open";
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
k.value = "closed", r(() => {
|
|
132
|
+
requestAnimationFrame(() => {
|
|
133
|
+
k.value = "open";
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
function je(e) {
|
|
138
|
+
if (!b.value || k.value !== "closed") return;
|
|
139
|
+
let t = e.target;
|
|
140
|
+
t?.dataset.drawerPart !== "overlay" && t?.dataset.drawerPart !== "panel" || e.propertyName === "none" || e.elapsedTime === 0 || (--S, S <= 0 && J());
|
|
141
|
+
}
|
|
142
|
+
function X() {
|
|
143
|
+
if (W.value) {
|
|
144
|
+
if (!z.value) {
|
|
145
|
+
M(!1);
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
b.value && Y();
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
function Z() {
|
|
152
|
+
P.value.closeOnOverlay === !1 || !W.value || X();
|
|
153
|
+
}
|
|
154
|
+
function Q(e) {
|
|
155
|
+
ue(e) && Z();
|
|
156
|
+
}
|
|
157
|
+
function Me() {
|
|
158
|
+
!j.value || P.value.closeOnEscape === !1 || !W.value || X();
|
|
159
|
+
}
|
|
160
|
+
s(j, (e) => {
|
|
161
|
+
if (e) {
|
|
162
|
+
b.value = !0, y.value = !0, Ae();
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
b.value && Y();
|
|
166
|
+
}, { immediate: !0 }), s([
|
|
167
|
+
y,
|
|
168
|
+
k,
|
|
169
|
+
() => P.value.autoFocus,
|
|
170
|
+
() => P.value.disableEnforceFocus,
|
|
171
|
+
() => P.value.disableRestoreFocus
|
|
172
|
+
], () => {
|
|
173
|
+
r(() => {
|
|
174
|
+
K();
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
function $() {
|
|
178
|
+
let e = ce(x.value);
|
|
179
|
+
e && (D.value = e.zIndex);
|
|
180
|
+
}
|
|
181
|
+
return s(y, (e) => {
|
|
182
|
+
if (e) {
|
|
183
|
+
C === null && (C = ie()), E = p({
|
|
184
|
+
order: C,
|
|
185
|
+
id: v.stackId,
|
|
186
|
+
onEscape: Me,
|
|
187
|
+
lockScroll: P.value.disableScrollLock !== !0
|
|
188
|
+
}), x.value = E.id, D.value = E.zIndex, $(), O = g($);
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
O?.(), O = null, E?.release(), E = null, x.value = "", D.value = l, b.value || (C = null);
|
|
192
|
+
}, { immediate: !0 }), ne(() => {
|
|
193
|
+
q(), O?.(), O = null, G(), E?.release(), E = null, C = null;
|
|
194
|
+
}), {
|
|
195
|
+
merged: P,
|
|
196
|
+
mounted: b,
|
|
197
|
+
rootBind: Te,
|
|
198
|
+
panelBind: Oe,
|
|
199
|
+
overlayBind: Ee,
|
|
200
|
+
wrapperBind: De,
|
|
201
|
+
setPanelRef: ke,
|
|
202
|
+
layerStackId: x,
|
|
203
|
+
handleOverlayClick: Z,
|
|
204
|
+
handleWrapperClick: Q
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
//#endregion
|
|
208
|
+
export { _ as useDrawer };
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { HTMLAttributes, Slot } from 'vue';
|
|
2
|
+
import { DrawerBlur, DrawerPlacement, DrawerScroll, DrawerSize, DrawerTransition, MergeHtmlProps, MergeProps } from '@bridge-ui/core';
|
|
3
|
+
export interface DrawerBlurOverrides {}
|
|
4
|
+
export interface DrawerSizeOverrides {}
|
|
5
|
+
export interface DrawerScrollOverrides {}
|
|
6
|
+
export interface DrawerPlacementOverrides {}
|
|
7
|
+
export interface DrawerTransitionOverrides {}
|
|
8
|
+
export interface DrawerClasses {
|
|
9
|
+
/**
|
|
10
|
+
* The classes to apply to the overlay.
|
|
11
|
+
*/
|
|
12
|
+
overlay?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The classes to apply to the dialog panel.
|
|
15
|
+
*/
|
|
16
|
+
panel?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The classes to apply to the root portal container.
|
|
19
|
+
*/
|
|
20
|
+
root?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The classes to apply to the placement wrapper.
|
|
23
|
+
*/
|
|
24
|
+
wrapper?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface DrawerCustomProps {
|
|
27
|
+
/**
|
|
28
|
+
* Props forwarded to the overlay.
|
|
29
|
+
*/
|
|
30
|
+
overlay?: HTMLAttributes;
|
|
31
|
+
/**
|
|
32
|
+
* Props forwarded to the dialog panel.
|
|
33
|
+
*/
|
|
34
|
+
panel?: HTMLAttributes;
|
|
35
|
+
/**
|
|
36
|
+
* Props forwarded to the root portal container.
|
|
37
|
+
*/
|
|
38
|
+
root?: HTMLAttributes;
|
|
39
|
+
/**
|
|
40
|
+
* Props forwarded to the placement wrapper.
|
|
41
|
+
*/
|
|
42
|
+
wrapper?: HTMLAttributes;
|
|
43
|
+
}
|
|
44
|
+
export interface DrawerEmits {
|
|
45
|
+
/**
|
|
46
|
+
* Emitted when the user dismisses the drawer (overlay or Escape).
|
|
47
|
+
* Not emitted when the parent sets `v-model` to `false` directly.
|
|
48
|
+
*/
|
|
49
|
+
close: [];
|
|
50
|
+
/**
|
|
51
|
+
* Emitted when `show` should change (controlled state).
|
|
52
|
+
* Listen with `@show-change` / `v-on:show-change`.
|
|
53
|
+
*/
|
|
54
|
+
"show-change": [show: boolean];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Drawer shell (overlay, portal, backdrop). Put any content in the default slot.
|
|
58
|
+
* Visibility is controlled with `v-model` (not listed here — `defineModel` handles it).
|
|
59
|
+
*/
|
|
60
|
+
export interface DrawerOwnProps {
|
|
61
|
+
/**
|
|
62
|
+
* Accessible name for the dialog panel (`aria-label`).
|
|
63
|
+
*
|
|
64
|
+
* @default undefined
|
|
65
|
+
*/
|
|
66
|
+
ariaLabel?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Id of the element that labels the dialog (`aria-labelledby`). Prefer over `ariaLabel` when a visible title exists.
|
|
69
|
+
*
|
|
70
|
+
* @default undefined
|
|
71
|
+
*/
|
|
72
|
+
ariaLabelledBy?: string;
|
|
73
|
+
/**
|
|
74
|
+
* When true, focuses the first focusable element inside the drawer on open.
|
|
75
|
+
*
|
|
76
|
+
* @default false
|
|
77
|
+
*/
|
|
78
|
+
autoFocus?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Backdrop blur on the overlay.
|
|
81
|
+
*
|
|
82
|
+
* @default "none"
|
|
83
|
+
*/
|
|
84
|
+
blur?: MergeProps<DrawerBlur, DrawerBlurOverrides>;
|
|
85
|
+
/**
|
|
86
|
+
* The classes to apply to the drawer.
|
|
87
|
+
*
|
|
88
|
+
* @default undefined
|
|
89
|
+
*/
|
|
90
|
+
classes?: DrawerClasses;
|
|
91
|
+
/**
|
|
92
|
+
* Whether the drawer closes on escape key press.
|
|
93
|
+
*
|
|
94
|
+
* @default true
|
|
95
|
+
*/
|
|
96
|
+
closeOnEscape?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Whether the drawer closes on overlay click.
|
|
99
|
+
*
|
|
100
|
+
* @default true
|
|
101
|
+
*/
|
|
102
|
+
closeOnOverlay?: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Props forwarded to each drawer part.
|
|
105
|
+
*
|
|
106
|
+
* @default undefined
|
|
107
|
+
*/
|
|
108
|
+
customProps?: DrawerCustomProps;
|
|
109
|
+
/**
|
|
110
|
+
* When true, focus is not trapped inside the drawer while open.
|
|
111
|
+
*
|
|
112
|
+
* @default false
|
|
113
|
+
*/
|
|
114
|
+
disableEnforceFocus?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* When true, focus is not restored to the previously focused element on close.
|
|
117
|
+
*
|
|
118
|
+
* @default false
|
|
119
|
+
*/
|
|
120
|
+
disableRestoreFocus?: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* When true, body scroll is not locked while the drawer is open.
|
|
123
|
+
*
|
|
124
|
+
* @default false
|
|
125
|
+
*/
|
|
126
|
+
disableScrollLock?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* When true, the backdrop overlay is not rendered.
|
|
129
|
+
*
|
|
130
|
+
* @default false
|
|
131
|
+
*/
|
|
132
|
+
hideBackdrop?: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* When true, the drawer stays mounted in the DOM after closing (hidden).
|
|
135
|
+
*
|
|
136
|
+
* @default false
|
|
137
|
+
*/
|
|
138
|
+
keepMounted?: boolean;
|
|
139
|
+
/**
|
|
140
|
+
* When true, escape and overlay clicks do not close the drawer.
|
|
141
|
+
*
|
|
142
|
+
* @default false
|
|
143
|
+
*/
|
|
144
|
+
persistent?: boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Edge the panel docks to.
|
|
147
|
+
*
|
|
148
|
+
* @default "left"
|
|
149
|
+
*/
|
|
150
|
+
placement?: MergeProps<DrawerPlacement, DrawerPlacementOverrides>;
|
|
151
|
+
/**
|
|
152
|
+
* Where scroll happens: the page (`body`) or the drawer panel (`paper`).
|
|
153
|
+
*
|
|
154
|
+
* @default "paper"
|
|
155
|
+
*/
|
|
156
|
+
scroll?: MergeProps<DrawerScroll, DrawerScrollOverrides>;
|
|
157
|
+
/**
|
|
158
|
+
* Panel size along the placement axis (width for `left`/`right`, height for `top`/`bottom`).
|
|
159
|
+
*
|
|
160
|
+
* @default "md"
|
|
161
|
+
*/
|
|
162
|
+
size?: MergeProps<DrawerSize, DrawerSizeOverrides>;
|
|
163
|
+
/**
|
|
164
|
+
* Stack id assigned when the drawer opens. Set by BridgeDrawerHost; do not set in app code.
|
|
165
|
+
*
|
|
166
|
+
* @internal
|
|
167
|
+
*/
|
|
168
|
+
stackId?: string;
|
|
169
|
+
/**
|
|
170
|
+
* Where to teleport the drawer. Pass `false` to render in place.
|
|
171
|
+
*
|
|
172
|
+
* @default "body"
|
|
173
|
+
*/
|
|
174
|
+
teleportTo?: false | string;
|
|
175
|
+
/**
|
|
176
|
+
* Enter/leave animation for overlay and panel.
|
|
177
|
+
*
|
|
178
|
+
* @default "slide"
|
|
179
|
+
*/
|
|
180
|
+
transition?: MergeProps<DrawerTransition, DrawerTransitionOverrides>;
|
|
181
|
+
}
|
|
182
|
+
export interface DrawerSlots {
|
|
183
|
+
/**
|
|
184
|
+
* Drawer content.
|
|
185
|
+
*/
|
|
186
|
+
default?: Slot<undefined>;
|
|
187
|
+
}
|
|
188
|
+
export type DrawerProps = MergeHtmlProps<DrawerOwnProps, HTMLAttributes>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { useDrawer } from './composables/useDrawer';
|
|
2
|
+
export type { DrawerOptions } from './composables/useDrawer';
|
|
3
|
+
export type { DrawerBlurOverrides, DrawerClasses, DrawerCustomProps, DrawerEmits, DrawerOwnProps, DrawerPlacementOverrides, DrawerProps, DrawerScrollOverrides, DrawerSizeOverrides, DrawerSlots, DrawerTransitionOverrides, } from './drawer.types';
|
|
4
|
+
export { default as Drawer } from './Drawer.vue';
|
|
@@ -173,26 +173,26 @@ export interface FormControlSlots {
|
|
|
173
173
|
/**
|
|
174
174
|
* The form control (checkbox, radio, switch, …).
|
|
175
175
|
*/
|
|
176
|
-
default?: Slot
|
|
176
|
+
default?: Slot<undefined>;
|
|
177
177
|
/**
|
|
178
178
|
* Helper text below the control row (hidden when invalid).
|
|
179
179
|
*/
|
|
180
|
-
description?: Slot
|
|
180
|
+
description?: Slot<undefined>;
|
|
181
181
|
/**
|
|
182
182
|
* Inline-end label after the main label.
|
|
183
183
|
*/
|
|
184
|
-
endLabel?: Slot
|
|
184
|
+
endLabel?: Slot<undefined>;
|
|
185
185
|
/**
|
|
186
186
|
* Custom error message content.
|
|
187
187
|
*/
|
|
188
|
-
errorMessage?: Slot
|
|
188
|
+
errorMessage?: Slot<undefined>;
|
|
189
189
|
/**
|
|
190
190
|
* Main label next to the control.
|
|
191
191
|
*/
|
|
192
|
-
mainLabel?: Slot
|
|
192
|
+
mainLabel?: Slot<undefined>;
|
|
193
193
|
/**
|
|
194
194
|
* Inline-start label before the control.
|
|
195
195
|
*/
|
|
196
|
-
startLabel?: Slot
|
|
196
|
+
startLabel?: Slot<undefined>;
|
|
197
197
|
}
|
|
198
198
|
export type FormControlProps = MergeHtmlProps<FormControlOwnProps, HTMLAttributes>;
|
|
@@ -263,32 +263,32 @@ export interface FormFieldSlots {
|
|
|
263
263
|
/**
|
|
264
264
|
* Slot at the inline end of the header row (secondary label).
|
|
265
265
|
*/
|
|
266
|
-
corner?: Slot
|
|
266
|
+
corner?: Slot<undefined>;
|
|
267
267
|
/**
|
|
268
268
|
* The form control (input, textarea, select trigger, etc.).
|
|
269
269
|
*/
|
|
270
|
-
default?: Slot
|
|
270
|
+
default?: Slot<undefined>;
|
|
271
271
|
/**
|
|
272
272
|
* Helper text below the control (hidden when the field is invalid).
|
|
273
273
|
*/
|
|
274
|
-
description?: Slot
|
|
274
|
+
description?: Slot<undefined>;
|
|
275
275
|
/**
|
|
276
276
|
* Inline-end slot for custom content (e.g. a `Button`). Prefer the `end` prop
|
|
277
277
|
* for plain suffix text.
|
|
278
278
|
*/
|
|
279
|
-
end?: Slot
|
|
279
|
+
end?: Slot<undefined>;
|
|
280
280
|
/**
|
|
281
281
|
* Custom error message content.
|
|
282
282
|
*/
|
|
283
|
-
errorMessage?: Slot
|
|
283
|
+
errorMessage?: Slot<undefined>;
|
|
284
284
|
/**
|
|
285
285
|
* Slot at the inline start of the header row (primary label).
|
|
286
286
|
*/
|
|
287
|
-
label?: Slot
|
|
287
|
+
label?: Slot<undefined>;
|
|
288
288
|
/**
|
|
289
289
|
* Inline-start slot for custom content (e.g. a `Button`). Prefer the `start`
|
|
290
290
|
* prop for plain prefix text.
|
|
291
291
|
*/
|
|
292
|
-
start?: Slot
|
|
292
|
+
start?: Slot<undefined>;
|
|
293
293
|
}
|
|
294
294
|
export type FormFieldProps = MergeHtmlProps<FormFieldOwnProps, HTMLAttributes>;
|
|
@@ -100,14 +100,14 @@ export interface LinkSlots {
|
|
|
100
100
|
/**
|
|
101
101
|
* Content after the label (inline end).
|
|
102
102
|
*/
|
|
103
|
-
append?: Slot
|
|
103
|
+
append?: Slot<undefined>;
|
|
104
104
|
/**
|
|
105
105
|
* The link label.
|
|
106
106
|
*/
|
|
107
|
-
default?: Slot
|
|
107
|
+
default?: Slot<undefined>;
|
|
108
108
|
/**
|
|
109
109
|
* Content before the label (inline start).
|
|
110
110
|
*/
|
|
111
|
-
prepend?: Slot
|
|
111
|
+
prepend?: Slot<undefined>;
|
|
112
112
|
}
|
|
113
113
|
export type LinkProps = MergeHtmlProps<LinkOwnProps, AnchorHTMLAttributes>;
|
|
@@ -13,7 +13,7 @@ export interface ListCustomProps {
|
|
|
13
13
|
root?: HTMLAttributes;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* Vertical list container
|
|
16
|
+
* Vertical list container. Use with `ListItem` and `ListSection`.
|
|
17
17
|
*/
|
|
18
18
|
export interface ListOwnProps {
|
|
19
19
|
/**
|
|
@@ -56,7 +56,7 @@ function C(t, n, C) {
|
|
|
56
56
|
}), B = l(() => "dense" in (u()?.vnode.props ?? {}) ? t.dense === !0 : t.dense === !0 ? !0 : T ? p(T).dense : !1), V = l(() => e(C, "primary") || e(C, "default") || !!k.value.primary), H = l(() => e(C, "secondary") || !!k.value.secondary), U = l(() => e(C, "start")), W = l(() => P.value ? !F.value || !j.value?.showCheckmark ? null : x : !k.value.selected || _(k.value.selectedIcon) ? null : k.value.selectedIcon ?? x), G = l(() => e(C, "end") || W.value != null), K = l(() => v(O.value.inheritedAttrs, [])), q = l(() => r(R.value?.root, K.value, {
|
|
57
57
|
class: y({
|
|
58
58
|
"list-none": !0,
|
|
59
|
-
"border-b border-black/10 last:border-b-0": k.value.divider,
|
|
59
|
+
"border-b border-black/10 last:border-b-0 dark:border-white/10": k.value.divider,
|
|
60
60
|
[g(z.value, "root") ?? ""]: !0
|
|
61
61
|
}),
|
|
62
62
|
id: P.value && j.value?.listboxId && I.value >= 0 ? s(j.value.listboxId, I.value) : void 0
|
|
@@ -73,13 +73,13 @@ function C(t, n, C) {
|
|
|
73
73
|
M.value && j.value?.onSelect(M.value);
|
|
74
74
|
} : void 0,
|
|
75
75
|
class: y({
|
|
76
|
-
"flex w-full min-w-0 items-center gap-x-3 text-left outline-hidden transition-colors": !0,
|
|
76
|
+
"flex w-full min-w-0 items-center gap-x-3 text-left text-dark-900 outline-hidden transition-colors dark:text-dark-100": !0,
|
|
77
77
|
"cursor-pointer select-none": !k.value.disabled,
|
|
78
78
|
"px-4": !0,
|
|
79
79
|
"py-2": !B.value,
|
|
80
80
|
"py-1.5": B.value,
|
|
81
|
-
"hover:bg-black/5 focus-visible:bg-black/5": !k.value.disabled && !P.value,
|
|
82
|
-
"bg-
|
|
81
|
+
"hover:bg-black/5 focus-visible:bg-black/5 dark:hover:bg-white/10 dark:focus-visible:bg-white/10": !k.value.disabled && !P.value,
|
|
82
|
+
"bg-dark-100 font-medium text-dark-900 dark:bg-white/15 dark:text-white": k.value.selected && !P.value,
|
|
83
83
|
[j.value?.optionSelectedClass ?? ""]: P.value && F.value,
|
|
84
84
|
[j.value?.mergedClasses.optionSelected ?? ""]: P.value && F.value,
|
|
85
85
|
[j.value?.optionHighlightedClass ?? ""]: P.value && L.value && !F.value,
|
|
@@ -90,17 +90,17 @@ function C(t, n, C) {
|
|
|
90
90
|
})
|
|
91
91
|
}) : null), Y = l(() => y({
|
|
92
92
|
"flex w-full min-w-0 gap-x-3": !0,
|
|
93
|
-
"items-center": !k.value.interactive,
|
|
93
|
+
"items-center text-dark-900 dark:text-dark-100": !k.value.interactive,
|
|
94
94
|
"px-4": !k.value.interactive,
|
|
95
95
|
"py-2": !k.value.interactive && !B.value,
|
|
96
96
|
"py-1.5": !k.value.interactive && B.value
|
|
97
97
|
})), X = l(() => r(R.value?.start, {}, y({
|
|
98
|
-
"flex shrink-0": !0,
|
|
98
|
+
"flex shrink-0 text-dark-600 dark:text-dark-300": !0,
|
|
99
99
|
[g(z.value, "start") ?? ""]: !0
|
|
100
100
|
}))), Z = l(() => r(R.value?.content, {}, y({
|
|
101
101
|
"min-w-0 flex-1": !0,
|
|
102
102
|
[g(z.value, "content") ?? ""]: !0
|
|
103
|
-
}))), Q = l(() => r(R.value?.primary, {}, y("block truncate text-sm font-medium", j.value?.sizeClasses?.primary, g(z.value, "primary")))), $ = l(() => r(R.value?.secondary, {}, y("mt-0.5 block truncate text-xs text-dark-500", j.value?.sizeClasses?.secondary, g(z.value, "secondary"))));
|
|
103
|
+
}))), Q = l(() => r(R.value?.primary, {}, y("block truncate text-sm font-medium", j.value?.sizeClasses?.primary, g(z.value, "primary")))), $ = l(() => r(R.value?.secondary, {}, y("mt-0.5 block truncate text-xs text-dark-500 dark:text-dark-400", j.value?.sizeClasses?.secondary, g(z.value, "secondary"))));
|
|
104
104
|
return {
|
|
105
105
|
merged: k,
|
|
106
106
|
hasEnd: G,
|
|
@@ -32,13 +32,13 @@ function m(m, h) {
|
|
|
32
32
|
merged: y,
|
|
33
33
|
rootBind: a(() => t(x.value?.root, T.value, d({
|
|
34
34
|
"list-none": !0,
|
|
35
|
-
"sticky top-0 z-10 bg-white dark:bg-dark-
|
|
35
|
+
"sticky top-0 z-10 bg-white dark:bg-dark-800": y.value.sticky && !E.value,
|
|
36
36
|
[l(S.value, "root") ?? ""]: !0
|
|
37
37
|
}))),
|
|
38
38
|
titleBind: a(() => t(x.value?.title, {}, {
|
|
39
39
|
role: "presentation",
|
|
40
40
|
class: d({
|
|
41
|
-
"bg-white px-4 text-xs font-semibold tracking-wide text-dark-500 uppercase dark:bg-dark-
|
|
41
|
+
"bg-white px-4 text-xs font-semibold tracking-wide text-dark-500 uppercase dark:bg-dark-800 dark:text-dark-300": !0,
|
|
42
42
|
"sticky top-0 z-10": y.value.sticky && E.value,
|
|
43
43
|
"py-2": !C.value,
|
|
44
44
|
"py-1.5": C.value,
|
|
@@ -22,7 +22,7 @@ export interface ListSectionCustomProps {
|
|
|
22
22
|
}
|
|
23
23
|
export type ListSectionLabel = VNode | string | VNode[] | undefined;
|
|
24
24
|
/**
|
|
25
|
-
* Section heading inside a `List
|
|
25
|
+
* Section heading inside a `List`.
|
|
26
26
|
*/
|
|
27
27
|
export interface ListSectionOwnProps {
|
|
28
28
|
/**
|