@bridge-ui/vue 0.0.5 → 0.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/Actions/Snackbar/BridgeSnackbarAction.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/Actions/Snackbar/BridgeSnackbarHost.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/Actions/Snackbar/createBridgeSnackbarApi.js +17 -17
- package/dist/Adapters/I18n/index.d.ts +1 -0
- package/dist/Adapters/I18n/index.js +2 -0
- package/dist/Adapters/I18n/useI18nAdapter.d.ts +16 -0
- package/dist/Adapters/I18n/useI18nAdapter.js +18 -0
- package/dist/Adapters/Icon/iconSource.types.d.ts +11 -0
- package/dist/Adapters/Icon/index.d.ts +2 -0
- package/dist/Adapters/Icon/index.js +2 -0
- package/dist/Adapters/Icon/useIconAdapter.d.ts +11 -0
- package/dist/Adapters/Icon/useIconAdapter.js +13 -0
- package/dist/Adapters/index.d.ts +3 -0
- package/dist/Adapters/index.js +3 -0
- package/dist/Components/Alert/Alert.vue_vue_type_script_setup_true_lang.js +1 -5
- package/dist/Components/Alert/alert.types.d.ts +2 -2
- package/dist/Components/Alert/alertDefaultIcons.d.ts +2 -2
- package/dist/Components/Alert/alertDefaultIcons.js +9 -10
- package/dist/Components/Alert/composables/useAlert.d.ts +2 -2
- package/dist/Components/Alert/composables/useAlert.js +17 -17
- package/dist/Components/Autocomplete/Autocomplete.js +5 -0
- package/dist/Components/Autocomplete/Autocomplete.vue.d.ts +40 -0
- package/dist/Components/Autocomplete/Autocomplete.vue_vue_type_script_setup_true_lang.js +197 -0
- package/dist/Components/Autocomplete/AutocompleteOption.js +5 -0
- package/dist/Components/Autocomplete/AutocompleteOption.vue.d.ts +4 -0
- package/dist/Components/Autocomplete/AutocompleteOption.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/Components/Autocomplete/autocomplete.types.d.ts +285 -0
- package/dist/Components/Autocomplete/autocompleteInjectionKey.d.ts +7 -0
- package/dist/Components/Autocomplete/autocompleteInjectionKey.js +4 -0
- package/dist/Components/Autocomplete/composables/useAutocomplete.d.ts +762 -0
- package/dist/Components/Autocomplete/composables/useAutocomplete.js +382 -0
- package/dist/Components/Autocomplete/index.d.ts +4 -0
- package/dist/Components/Autocomplete/index.js +4 -0
- package/dist/Components/Avatar/Avatar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/Avatar/avatar.types.d.ts +2 -2
- package/dist/Components/Avatar/composables/useAvatar.d.ts +1 -1
- package/dist/Components/Avatar/composables/useAvatar.js +46 -47
- package/dist/Components/Badge/composables/useBadge.js +8 -8
- package/dist/Components/Button/Button.vue_vue_type_script_setup_true_lang.js +24 -25
- package/dist/Components/Button/button.types.d.ts +4 -4
- package/dist/Components/Button/composables/useButton.d.ts +1 -1
- package/dist/Components/Button/composables/useButton.js +14 -14
- package/dist/Components/Card/composables/useCard.js +27 -27
- package/dist/Components/Checkbox/Checkbox.vue_vue_type_script_setup_true_lang.js +27 -27
- package/dist/Components/Checkbox/composables/useCheckbox.d.ts +4 -4
- package/dist/Components/Checkbox/composables/useCheckbox.js +9 -9
- package/dist/Components/Chip/Chip.vue_vue_type_script_setup_true_lang.js +8 -9
- package/dist/Components/Chip/composables/useChip.js +6 -6
- package/dist/Components/Divider/composables/useDivider.js +5 -5
- package/dist/Components/Drawer/composables/useDrawer.js +23 -23
- package/dist/Components/FormControl/FormControl.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/FormControl/composables/useFormControl.d.ts +3 -3
- package/dist/Components/FormControl/composables/useFormControl.js +12 -12
- package/dist/Components/FormControl/formControl.types.d.ts +6 -6
- package/dist/Components/FormField/FilledFormField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/FormField/NotchedFormField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/FormField/OutlinedFormField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/FormField/StackedFormField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/FormField/UnderlinedFormField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/FormField/composables/useFormField.d.ts +6 -6
- package/dist/Components/FormField/composables/useFormField.js +108 -109
- package/dist/Components/FormField/formField.types.d.ts +19 -19
- package/dist/Components/Icon/Icon.vue_vue_type_script_setup_true_lang.js +7 -7
- package/dist/Components/Icon/composables/useIcon.d.ts +2 -0
- package/dist/Components/Icon/composables/useIcon.js +20 -18
- package/dist/Components/Icon/icon.types.d.ts +3 -3
- package/dist/Components/Label/composables/useLabel.d.ts +1 -1
- package/dist/Components/Label/composables/useLabel.js +5 -5
- package/dist/Components/Link/Link.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/Link/composables/useLink.js +9 -9
- package/dist/Components/Link/link.types.d.ts +3 -3
- package/dist/Components/List/composables/useList.js +6 -6
- package/dist/Components/ListItem/composables/useListItem.d.ts +2 -2
- package/dist/Components/ListItem/composables/useListItem.js +81 -82
- package/dist/Components/ListItem/listItem.types.d.ts +2 -2
- package/dist/Components/ListSection/composables/useListSection.js +8 -8
- package/dist/Components/Listbox/Listbox.vue.d.ts +0 -2
- package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +75 -74
- package/dist/Components/Listbox/composables/useListbox.js +7 -7
- package/dist/Components/Listbox/index.js +3 -3
- package/dist/Components/Menu/composables/useMenu.js +43 -43
- package/dist/Components/Modal/composables/useModal.js +18 -18
- package/dist/Components/NumberField/NumberField.vue_vue_type_script_setup_true_lang.js +43 -43
- package/dist/Components/NumberField/composables/useNumberField.d.ts +8 -8
- package/dist/Components/NumberField/composables/useNumberField.js +9 -9
- package/dist/Components/OtpField/OtpField.js +5 -0
- package/dist/Components/OtpField/OtpField.vue.d.ts +31 -0
- package/dist/Components/OtpField/OtpField.vue_vue_type_script_setup_true_lang.js +80 -0
- package/dist/Components/OtpField/OtpFieldLabel.js +5 -0
- package/dist/Components/OtpField/OtpFieldLabel.vue.d.ts +7 -0
- package/dist/Components/OtpField/OtpFieldLabel.vue_vue_type_script_setup_true_lang.js +16 -0
- package/dist/Components/OtpField/composables/useOtpField.d.ts +460 -0
- package/dist/Components/OtpField/composables/useOtpField.js +212 -0
- package/dist/Components/OtpField/index.d.ts +4 -0
- package/dist/Components/OtpField/index.js +3 -0
- package/dist/Components/OtpField/otpField.types.d.ts +290 -0
- package/dist/Components/PasswordField/PasswordField.vue_vue_type_script_setup_true_lang.js +27 -27
- package/dist/Components/PasswordField/composables/usePasswordField.d.ts +8 -8
- package/dist/Components/PasswordField/composables/usePasswordField.js +2 -2
- package/dist/Components/Progress/composables/useProgress.js +11 -11
- package/dist/Components/Radio/Radio.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/Radio/composables/useRadio.d.ts +4 -4
- package/dist/Components/Radio/composables/useRadio.js +9 -9
- package/dist/Components/Select/Select.vue.d.ts +1 -2
- package/dist/Components/Select/Select.vue_vue_type_script_setup_true_lang.js +72 -68
- package/dist/Components/Select/composables/useSelect.d.ts +10 -10
- package/dist/Components/Select/composables/useSelect.js +193 -193
- package/dist/Components/Skeleton/composables/useSkeleton.js +5 -5
- package/dist/Components/Snackbar/Snackbar.vue_vue_type_script_setup_true_lang.js +81 -75
- package/dist/Components/Snackbar/composables/useSnackbar.d.ts +4 -4
- package/dist/Components/Snackbar/composables/useSnackbar.js +115 -115
- package/dist/Components/Snackbar/snackbar.types.d.ts +2 -2
- package/dist/Components/Snackbar/snackbarDefaultIcons.d.ts +3 -3
- package/dist/Components/Snackbar/snackbarDefaultIcons.js +9 -10
- package/dist/Components/Spinner/composables/useSpinner.js +11 -11
- package/dist/Components/Switch/Switch.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/Switch/composables/useSwitch.d.ts +4 -4
- package/dist/Components/Switch/composables/useSwitch.js +9 -9
- package/dist/Components/Tab/Tab.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/Tab/composables/useTab.js +11 -11
- package/dist/Components/Tab/tab.types.d.ts +3 -3
- package/dist/Components/TabItem/TabItem.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/TabItem/tabItem.types.d.ts +3 -3
- package/dist/Components/TabList/composables/useTabList.js +7 -7
- package/dist/Components/TabPanel/composables/useTabPanel.js +7 -7
- package/dist/Components/Tabs/composables/useTabs.d.ts +468 -4
- package/dist/Components/Tabs/composables/useTabs.js +22 -22
- package/dist/Components/Tabs/tabsInjectionKey.d.ts +5 -5
- package/dist/Components/TextField/TextField.vue.d.ts +1 -1
- package/dist/Components/TextField/TextField.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/Components/TextField/composables/useTextField.d.ts +8 -8
- package/dist/Components/TextField/composables/useTextField.js +1 -1
- package/dist/Components/Textarea/Textarea.vue.d.ts +1 -1
- package/dist/Components/Textarea/Textarea.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/Components/Textarea/composables/useTextarea.d.ts +8 -8
- package/dist/Components/Textarea/composables/useTextarea.js +9 -9
- package/dist/Components/Tooltip/Tooltip.js +5 -0
- package/dist/Components/Tooltip/Tooltip.vue.d.ts +35 -0
- package/dist/Components/Tooltip/Tooltip.vue_vue_type_script_setup_true_lang.js +73 -0
- package/dist/Components/Tooltip/composables/useTooltip.d.ts +50 -0
- package/dist/Components/Tooltip/composables/useTooltip.js +208 -0
- package/dist/Components/Tooltip/index.d.ts +4 -0
- package/dist/Components/Tooltip/index.js +3 -0
- package/dist/Components/Tooltip/tooltip.types.d.ts +166 -0
- package/dist/Provider/bridgeUITypes.d.ts +4 -1
- package/dist/Provider/createBridgeUIApi.js +15 -2
- package/dist/Utils/index.js +7 -7
- package/dist/Utils/useBreakpoint.js +7 -7
- package/dist/augments.d.ts +2 -2
- package/dist/index.d.ts +11 -1
- package/dist/index.js +84 -76
- package/package.json +21 -3
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { useResolveMessage as e } from "../../Adapters/I18n/useI18nAdapter.js";
|
|
2
|
+
import t from "../Icon/Icon.js";
|
|
3
|
+
import { useSnackbar as n } from "./composables/useSnackbar.js";
|
|
4
|
+
import { Teleport as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, guardReactiveProps as f, mergeModels as p, mergeProps as m, normalizeClass as h, normalizeProps as g, openBlock as _, renderSlot as v, toDisplayString as y, unref as b, useModel as x, useSlots as S } from "vue";
|
|
5
|
+
import { cn as C } from "@bridge-ui/core";
|
|
6
6
|
//#region src/Components/Snackbar/Snackbar.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var w = { class: "w-full max-w-sm pointer-events-auto" }, T = ["src"], E = { class: "flex ml-4 shrink-0" }, D = ["
|
|
7
|
+
var w = { class: "w-full max-w-sm pointer-events-auto" }, T = ["src"], E = { class: "flex ml-4 shrink-0" }, D = ["aria-label"], O = ["src"], k = { class: "flex ml-4 shrink-0" }, A = ["aria-label"], j = /* @__PURE__ */ d({
|
|
8
8
|
inheritAttrs: !1,
|
|
9
9
|
__name: "Snackbar",
|
|
10
|
-
props: /* @__PURE__ */
|
|
10
|
+
props: /* @__PURE__ */ p({
|
|
11
11
|
classes: {},
|
|
12
12
|
closeButton: {
|
|
13
13
|
type: Boolean,
|
|
@@ -43,13 +43,13 @@ var w = { class: "w-full max-w-sm pointer-events-auto" }, T = ["src"], E = { cla
|
|
|
43
43
|
},
|
|
44
44
|
modelModifiers: {}
|
|
45
45
|
}),
|
|
46
|
-
emits: /* @__PURE__ */
|
|
46
|
+
emits: /* @__PURE__ */ p([
|
|
47
47
|
"close",
|
|
48
48
|
"leave-complete",
|
|
49
49
|
"show-change"
|
|
50
50
|
], ["update:modelValue"]),
|
|
51
|
-
setup(
|
|
52
|
-
let
|
|
51
|
+
setup(d, { emit: p }) {
|
|
52
|
+
let j = S(), M = p, N = d, P = e(), { merged: F, rendered: I, iconBind: L, panelBind: R, titleBind: z, isPortaled: B, portalBind: V, contentBind: H, showProgress: U, progressBind: W, resolvedIcon: G, requestClose: K, descriptionBind: q } = n(N, {
|
|
53
53
|
rounded: "lg",
|
|
54
54
|
duration: 5e3,
|
|
55
55
|
color: "primary",
|
|
@@ -60,97 +60,103 @@ var w = { class: "w-full max-w-sm pointer-events-auto" }, T = ["src"], E = { cla
|
|
|
60
60
|
transition: "slide",
|
|
61
61
|
position: "bottom-center"
|
|
62
62
|
}, {
|
|
63
|
-
show:
|
|
64
|
-
stackId:
|
|
65
|
-
onClose: () =>
|
|
66
|
-
onLeaveComplete: () =>
|
|
67
|
-
onShowChange: (e) =>
|
|
68
|
-
}),
|
|
69
|
-
return (
|
|
70
|
-
to:
|
|
71
|
-
disabled:
|
|
72
|
-
}, [
|
|
73
|
-
|
|
74
|
-
"flex items-start": !
|
|
75
|
-
"w-full flex":
|
|
63
|
+
show: x(d, "modelValue"),
|
|
64
|
+
stackId: N.stackId,
|
|
65
|
+
onClose: () => M("close"),
|
|
66
|
+
onLeaveComplete: () => M("leave-complete"),
|
|
67
|
+
onShowChange: (e) => M("show-change", e)
|
|
68
|
+
}), J = i(() => !!(j.icon || G.value || F.value.img)), Y = i(() => !!(j.title || F.value.title)), X = i(() => !!(j.description || F.value.description)), Z = i(() => !!j.right), Q = i(() => F.value.teleportTo === !1), $ = i(() => F.value.teleportTo === !1 ? "body" : F.value.teleportTo);
|
|
69
|
+
return (e, n) => (_(), a(r, {
|
|
70
|
+
to: $.value,
|
|
71
|
+
disabled: Q.value
|
|
72
|
+
}, [b(I) && b(B) ? (_(), s("div", g(m({ key: 0 }, b(V))), [c("div", w, [c("div", m(b(R), { class: b(C)(b(R).class, { flex: Z.value }) }), [
|
|
73
|
+
c("div", g(f(b(H)(Z.value))), [c("div", { class: h({
|
|
74
|
+
"flex items-start": !Z.value,
|
|
75
|
+
"w-full flex": Z.value
|
|
76
76
|
}) }, [
|
|
77
|
-
|
|
77
|
+
J.value ? (_(), s("div", {
|
|
78
78
|
key: 0,
|
|
79
|
-
class:
|
|
80
|
-
"w-6": !!(
|
|
81
|
-
"pt-0.5": !!
|
|
79
|
+
class: h(["shrink-0", {
|
|
80
|
+
"w-6": !!(b(G) || b(j).icon),
|
|
81
|
+
"pt-0.5": !!b(F).img
|
|
82
82
|
}])
|
|
83
83
|
}, [
|
|
84
|
-
|
|
85
|
-
!
|
|
84
|
+
v(e.$slots, "icon"),
|
|
85
|
+
!b(j).icon && b(F).img ? (_(), s("img", {
|
|
86
86
|
key: 0,
|
|
87
87
|
alt: "",
|
|
88
|
-
src:
|
|
88
|
+
src: b(F).img,
|
|
89
89
|
class: "w-10 h-10 rounded-full"
|
|
90
|
-
}, null, 8, T)) :
|
|
91
|
-
!
|
|
92
|
-
], 2)) :
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
90
|
+
}, null, 8, T)) : o("", !0),
|
|
91
|
+
!b(j).icon && !b(F).img && b(G) ? (_(), a(b(t), m({ key: 1 }, b(L), { icon: b(G) }), null, 16, ["icon"])) : o("", !0)
|
|
92
|
+
], 2)) : o("", !0),
|
|
93
|
+
c("div", { class: h(["w-0 flex-1 pt-0.5", { "ml-3": J.value }]) }, [
|
|
94
|
+
Y.value ? (_(), s("p", g(m({ key: 0 }, b(z))), [v(e.$slots, "title", {}, () => [l(y(b(F).title), 1)])], 16)) : o("", !0),
|
|
95
|
+
X.value ? (_(), s("p", g(m({ key: 1 }, b(q))), [v(e.$slots, "description", {}, () => [l(y(b(F).description), 1)])], 16)) : o("", !0),
|
|
96
|
+
v(e.$slots, "default"),
|
|
97
|
+
b(j).actions ? (_(), s("div", {
|
|
98
98
|
key: 2,
|
|
99
|
-
class:
|
|
100
|
-
}, [
|
|
99
|
+
class: h(["flex mt-3 gap-x-3", b(F).classes?.actions])
|
|
100
|
+
}, [v(e.$slots, "actions")], 2)) : o("", !0)
|
|
101
101
|
], 2),
|
|
102
|
-
|
|
102
|
+
c("div", E, [v(e.$slots, "trailing"), b(F).closeButton === !1 ? o("", !0) : (_(), s("button", {
|
|
103
103
|
key: 0,
|
|
104
104
|
type: "button",
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
onClick: n[0] ||= (...e) => b(K) && b(K)(...e),
|
|
106
|
+
"aria-label": b(P)("Close"),
|
|
107
107
|
class: "cursor-pointer inline-flex rounded-md text-dark-400 hover:text-dark-500 focus:outline-hidden"
|
|
108
|
-
}, [
|
|
108
|
+
}, [u(b(t), {
|
|
109
|
+
size: "lg",
|
|
110
|
+
icon: "clear"
|
|
111
|
+
})], 8, D))])
|
|
109
112
|
], 2)], 16),
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
], 16)])], 16)) :
|
|
113
|
-
|
|
114
|
-
"flex items-start": !
|
|
115
|
-
"w-full flex":
|
|
113
|
+
v(e.$slots, "right"),
|
|
114
|
+
b(U) ? (_(), s("div", g(m({ key: 0 }, b(W))), null, 16)) : o("", !0)
|
|
115
|
+
], 16)])], 16)) : b(I) ? (_(), s("div", m({ key: 1 }, b(R), { class: b(C)(b(R).class, { flex: Z.value }) }), [
|
|
116
|
+
c("div", g(f(b(H)(Z.value))), [c("div", { class: h({
|
|
117
|
+
"flex items-start": !Z.value,
|
|
118
|
+
"w-full flex": Z.value
|
|
116
119
|
}) }, [
|
|
117
|
-
|
|
120
|
+
J.value ? (_(), s("div", {
|
|
118
121
|
key: 0,
|
|
119
|
-
class:
|
|
120
|
-
"w-6": !!(
|
|
121
|
-
"pt-0.5": !!
|
|
122
|
+
class: h(["shrink-0", {
|
|
123
|
+
"w-6": !!(b(G) || b(j).icon),
|
|
124
|
+
"pt-0.5": !!b(F).img
|
|
122
125
|
}])
|
|
123
126
|
}, [
|
|
124
|
-
|
|
125
|
-
!
|
|
127
|
+
v(e.$slots, "icon"),
|
|
128
|
+
!b(j).icon && b(F).img ? (_(), s("img", {
|
|
126
129
|
key: 0,
|
|
127
130
|
alt: "",
|
|
128
|
-
src:
|
|
131
|
+
src: b(F).img,
|
|
129
132
|
class: "w-10 h-10 rounded-full"
|
|
130
|
-
}, null, 8,
|
|
131
|
-
!
|
|
132
|
-
], 2)) :
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
133
|
+
}, null, 8, O)) : o("", !0),
|
|
134
|
+
!b(j).icon && !b(F).img && b(G) ? (_(), a(b(t), m({ key: 1 }, b(L), { icon: b(G) }), null, 16, ["icon"])) : o("", !0)
|
|
135
|
+
], 2)) : o("", !0),
|
|
136
|
+
c("div", { class: h(["w-0 flex-1 pt-0.5", { "ml-3": J.value }]) }, [
|
|
137
|
+
Y.value ? (_(), s("p", g(m({ key: 0 }, b(z))), [v(e.$slots, "title", {}, () => [l(y(b(F).title), 1)])], 16)) : o("", !0),
|
|
138
|
+
X.value ? (_(), s("p", g(m({ key: 1 }, b(q))), [v(e.$slots, "description", {}, () => [l(y(b(F).description), 1)])], 16)) : o("", !0),
|
|
139
|
+
v(e.$slots, "default"),
|
|
140
|
+
b(j).actions ? (_(), s("div", {
|
|
138
141
|
key: 2,
|
|
139
|
-
class:
|
|
140
|
-
}, [
|
|
142
|
+
class: h(["flex mt-3 gap-x-3", b(F).classes?.actions])
|
|
143
|
+
}, [v(e.$slots, "actions")], 2)) : o("", !0)
|
|
141
144
|
], 2),
|
|
142
|
-
|
|
145
|
+
c("div", k, [v(e.$slots, "trailing"), b(F).closeButton === !1 ? o("", !0) : (_(), s("button", {
|
|
143
146
|
key: 0,
|
|
144
147
|
type: "button",
|
|
145
|
-
|
|
146
|
-
|
|
148
|
+
onClick: n[1] ||= (...e) => b(K) && b(K)(...e),
|
|
149
|
+
"aria-label": b(P)("Close"),
|
|
147
150
|
class: "cursor-pointer inline-flex rounded-md text-dark-400 hover:text-dark-500 focus:outline-hidden"
|
|
148
|
-
}, [
|
|
151
|
+
}, [u(b(t), {
|
|
152
|
+
size: "lg",
|
|
153
|
+
icon: "clear"
|
|
154
|
+
})], 8, A))])
|
|
149
155
|
], 2)], 16),
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
], 16)) :
|
|
156
|
+
v(e.$slots, "right"),
|
|
157
|
+
b(U) ? (_(), s("div", g(m({ key: 0 }, b(W))), null, 16)) : o("", !0)
|
|
158
|
+
], 16)) : o("", !0)], 8, ["to", "disabled"]));
|
|
153
159
|
}
|
|
154
160
|
});
|
|
155
161
|
//#endregion
|
|
156
|
-
export {
|
|
162
|
+
export { j as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LucideIcon } from '@lucide/vue';
|
|
2
1
|
import { Ref } from 'vue';
|
|
3
2
|
import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core';
|
|
3
|
+
import { IconSource } from '../../../Adapters/Icon';
|
|
4
4
|
import { SnackbarOwnProps, SnackbarProps } from '../snackbar.types';
|
|
5
5
|
type SnackbarLibDefaults = LibDefaultsShape<SnackbarOwnProps, "color" | "padding" | "rounded" | "duration" | "position" | "teleportTo" | "transition" | "closeButton" | "progressbar">;
|
|
6
6
|
type SnackbarMerged = MergeLibDefaults<SnackbarOwnProps, SnackbarLibDefaults>;
|
|
@@ -187,13 +187,13 @@ export declare function useSnackbar(props: SnackbarProps, libDefaults: SnackbarL
|
|
|
187
187
|
'aria-valuenow'?: (string | number) | undefined;
|
|
188
188
|
'aria-valuetext'?: string | undefined | undefined;
|
|
189
189
|
accesskey?: string | undefined | undefined;
|
|
190
|
-
contenteditable?:
|
|
190
|
+
contenteditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
191
191
|
contextmenu?: string | undefined | undefined;
|
|
192
192
|
dir?: string | undefined | undefined;
|
|
193
193
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
194
194
|
enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
195
195
|
enterKeyHint?: "done" | "enter" | "go" | "next" | "previous" | "search" | "send" | undefined;
|
|
196
|
-
hidden?: "" | "until-found" | (boolean | "true" | "false") |
|
|
196
|
+
hidden?: "" | "until-found" | "hidden" | (boolean | "true" | "false") | undefined;
|
|
197
197
|
inert?: (boolean | "true" | "false") | undefined;
|
|
198
198
|
placeholder?: string | undefined | undefined;
|
|
199
199
|
spellcheck?: (boolean | "true" | "false") | undefined;
|
|
@@ -242,7 +242,7 @@ export declare function useSnackbar(props: SnackbarProps, libDefaults: SnackbarL
|
|
|
242
242
|
} | undefined;
|
|
243
243
|
}, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
244
244
|
requestClose: () => void;
|
|
245
|
-
resolvedIcon: import('vue').ComputedRef<
|
|
245
|
+
resolvedIcon: import('vue').ComputedRef<IconSource | null>;
|
|
246
246
|
descriptionBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
247
247
|
};
|
|
248
248
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { mergePartBind as e, useBridgeUIComponent as t, useBridgeUIMergedRegistryClasses as n } from "../../../Utils/index.js";
|
|
2
2
|
import { snackbarDefaultIcons as ee } from "../snackbarDefaultIcons.js";
|
|
3
3
|
import { computed as r, nextTick as te, onBeforeUnmount as i, ref as a, toValue as ne, useAttrs as re, watch as o } from "vue";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { LAYER_STACK_BASE_Z_INDEX as s, acquireLayerStackOrder as ie, cn as c, getLayerStackEntry as l, getSnackbarTransitionClass as u, hasSnackbarTransition as d, mergeBridgeUILayeredClasses as f, pushLayerStack as ae, snackbarColorProps as oe, snackbarPaddingProps as se, snackbarPositionProps as ce, snackbarRoundedProps as le, snackbarTransitionProps as ue, splitComponentProps as de, subscribeLayerStack as fe } from "@bridge-ui/core";
|
|
5
|
+
import { get as p, isNil as pe, isNull as me, isObject as he, omit as ge } from "es-toolkit/compat";
|
|
6
6
|
//#region src/Components/Snackbar/composables/useSnackbar.ts
|
|
7
|
-
var
|
|
7
|
+
var _e = [
|
|
8
8
|
"img",
|
|
9
9
|
"icon",
|
|
10
10
|
"color",
|
|
@@ -22,189 +22,189 @@ var ge = [
|
|
|
22
22
|
"description",
|
|
23
23
|
"progressbar"
|
|
24
24
|
];
|
|
25
|
-
function
|
|
26
|
-
let
|
|
25
|
+
function m(m, h, g = {}) {
|
|
26
|
+
let ve = re(), _ = a(!1), v = a(""), y = a(1), b = a(0), x = a(!1), S = a(!1), C = a(0), w = a(!1), T = a(0), E = a(s), D = a("closed"), O = a(null), k = null, A = null, j = null, M = r(() => de({
|
|
27
27
|
props: {
|
|
28
|
-
...
|
|
29
|
-
...
|
|
28
|
+
...ve,
|
|
29
|
+
...m
|
|
30
30
|
},
|
|
31
|
-
bridgeKeys:
|
|
32
|
-
})), { merged:
|
|
33
|
-
libDefaults:
|
|
31
|
+
bridgeKeys: _e
|
|
32
|
+
})), { merged: N, entry: P } = t({
|
|
33
|
+
libDefaults: h,
|
|
34
34
|
componentName: "Snackbar",
|
|
35
|
-
props: () =>
|
|
36
|
-
}),
|
|
37
|
-
entry:
|
|
38
|
-
props: () =>
|
|
39
|
-
}),
|
|
40
|
-
let e =
|
|
41
|
-
return e in
|
|
42
|
-
}),
|
|
43
|
-
function
|
|
44
|
-
|
|
35
|
+
props: () => M.value.componentProps
|
|
36
|
+
}), F = r(() => N.value.customProps), I = r(() => ge(M.value.inheritedAttrs, ["onShowChange"])), L = n({
|
|
37
|
+
entry: P,
|
|
38
|
+
props: () => M.value.componentProps
|
|
39
|
+
}), R = r(() => pe(g.show) ? !1 : ne(g.show)), z = r(() => {
|
|
40
|
+
let e = N.value.transition ?? "none";
|
|
41
|
+
return e in ue ? e : "none";
|
|
42
|
+
}), B = r(() => d(z.value)), ye = r(() => u(z.value)), V = r(() => p(f(oe, P.value?.tokens?.color), N.value.color)), H = r(() => p(f(se, P.value?.tokens?.padding), N.value.padding)), be = r(() => p(f(le, P.value?.tokens?.rounded), N.value.rounded)), xe = r(() => me(N.value.icon) ? null : N.value.icon ? N.value.icon : p(V.value, "icon") ?? p(ee, N.value.color)), U = r(() => N.value.duration === !1 ? 0 : N.value.duration ?? 0), W = r(() => R.value && _.value && U.value > 0 && N.value.progressbar !== !1), G = r(() => N.value.teleportTo !== !1), Se = r(() => G.value ? p(f(ce, P.value?.tokens?.position), N.value.position ?? "bottom-center") : "");
|
|
43
|
+
function K() {
|
|
44
|
+
O.value &&= (clearTimeout(O.value), null);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
e || g.onClose?.(),
|
|
46
|
+
function q(e) {
|
|
47
|
+
e || g.onClose?.(), he(g.show) && "value" in g.show && (g.show.value = e), g.onShowChange?.(e);
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
|
|
49
|
+
function J() {
|
|
50
|
+
S.value && (S.value = !1, D.value = "closed", K(), R.value ? q(!1) : g.onLeaveComplete?.(), _.value = !1);
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
if (
|
|
54
|
-
|
|
52
|
+
function Y() {
|
|
53
|
+
if (K(), S.value = !0, !B.value) {
|
|
54
|
+
J();
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
|
-
|
|
57
|
+
D.value = "closed";
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
if (
|
|
61
|
-
|
|
59
|
+
function Ce() {
|
|
60
|
+
if (S.value = !1, !B.value) {
|
|
61
|
+
D.value = "open";
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
|
-
|
|
64
|
+
D.value = "closed", te(() => {
|
|
65
65
|
requestAnimationFrame(() => {
|
|
66
|
-
|
|
66
|
+
D.value = "open";
|
|
67
67
|
});
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
if (!
|
|
72
|
-
|
|
70
|
+
function X() {
|
|
71
|
+
if (!B.value) {
|
|
72
|
+
q(!1);
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
|
-
|
|
75
|
+
_.value && Y();
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
function Z(e) {
|
|
78
|
+
K(), b.value = e, C.value = Date.now(), T.value = e, O.value = setTimeout(() => {
|
|
79
|
+
X();
|
|
80
80
|
}, e);
|
|
81
81
|
}
|
|
82
|
-
function Ce() {
|
|
83
|
-
!k.value || W.value <= 0 || (q(), x.value -= Date.now() - w.value, b.value = Math.max(x.value / W.value, 0), T.value = !1, S.value = !0);
|
|
84
|
-
}
|
|
85
82
|
function we() {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
83
|
+
!O.value || U.value <= 0 || (K(), b.value -= Date.now() - C.value, y.value = Math.max(b.value / U.value, 0), w.value = !1, x.value = !0);
|
|
84
|
+
}
|
|
85
|
+
function Te() {
|
|
86
|
+
if (U.value <= 0 || !x.value) return;
|
|
87
|
+
let e = Math.max(b.value, 0);
|
|
88
|
+
x.value = !1, w.value = !1, requestAnimationFrame(() => {
|
|
89
|
+
w.value = !0;
|
|
90
|
+
}), Z(e);
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
!
|
|
92
|
+
function Ee(e) {
|
|
93
|
+
!_.value || D.value !== "closed" || e.target === e.currentTarget && (e.propertyName === "none" || e.elapsedTime === 0 || J());
|
|
94
94
|
}
|
|
95
|
-
o(
|
|
95
|
+
o(R, (e) => {
|
|
96
96
|
if (e) {
|
|
97
|
-
|
|
97
|
+
_.value = !0, Ce();
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
100
|
-
|
|
100
|
+
_.value && Y();
|
|
101
101
|
}, { immediate: !0 }), o([
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
R,
|
|
103
|
+
_,
|
|
104
|
+
U
|
|
105
105
|
], ([e, t, n]) => {
|
|
106
106
|
if (!e || !t || n <= 0) {
|
|
107
|
-
|
|
107
|
+
K();
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
|
|
111
|
-
}, { immediate: !0 }), o([
|
|
110
|
+
x.value = !1, Z(n);
|
|
111
|
+
}, { immediate: !0 }), o([U, W], ([e]) => {
|
|
112
112
|
if (!e) {
|
|
113
|
-
|
|
113
|
+
w.value = !1, y.value = 1;
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
|
-
|
|
116
|
+
w.value = !1, y.value = 1;
|
|
117
117
|
let t = requestAnimationFrame(() => {
|
|
118
|
-
|
|
118
|
+
w.value = !0;
|
|
119
119
|
});
|
|
120
120
|
return () => {
|
|
121
121
|
cancelAnimationFrame(t);
|
|
122
122
|
};
|
|
123
123
|
}, { immediate: !0 });
|
|
124
|
-
function
|
|
125
|
-
let e =
|
|
126
|
-
e && (
|
|
124
|
+
function Q() {
|
|
125
|
+
let e = l(v.value);
|
|
126
|
+
e && (E.value = e.zIndex);
|
|
127
127
|
}
|
|
128
|
-
o([
|
|
129
|
-
t && (e ? (
|
|
130
|
-
order:
|
|
128
|
+
o([_, G], ([e, t]) => {
|
|
129
|
+
t && (e ? (k = ie(), A = ae({
|
|
130
|
+
order: k,
|
|
131
131
|
lockScroll: !1,
|
|
132
132
|
id: g.stackId,
|
|
133
133
|
onEscape: () => {
|
|
134
|
-
|
|
134
|
+
X();
|
|
135
135
|
}
|
|
136
|
-
}),
|
|
136
|
+
}), v.value = A.id, E.value = A.zIndex, Q(), j = fe(Q)) : (j?.(), j = null, A?.release(), A = null, k = null, v.value = "", E.value = s));
|
|
137
137
|
}, { immediate: !0 }), i(() => {
|
|
138
|
-
|
|
138
|
+
K(), j?.(), j = null, A?.release(), A = null;
|
|
139
139
|
});
|
|
140
|
-
let
|
|
140
|
+
let $ = r(() => e(F.value?.portal, {
|
|
141
141
|
"data-snackbar-layer": !0,
|
|
142
|
-
style: { zIndex:
|
|
143
|
-
},
|
|
142
|
+
style: { zIndex: E.value }
|
|
143
|
+
}, c({
|
|
144
144
|
"fixed inset-0 flex pointer-events-none px-4 py-6 sm:p-5 sm:pt-4": !0,
|
|
145
|
-
[
|
|
146
|
-
[
|
|
147
|
-
}))), De = r(() => e(
|
|
148
|
-
...
|
|
145
|
+
[Se.value ?? ""]: !0,
|
|
146
|
+
[p(L.value, "portal") ?? ""]: !0
|
|
147
|
+
}))), De = r(() => e(F.value?.root, {
|
|
148
|
+
...I.value,
|
|
149
149
|
"data-snackbar-part": "panel",
|
|
150
|
-
onMouseenter:
|
|
151
|
-
onMouseleave:
|
|
152
|
-
"data-state":
|
|
153
|
-
onTransitionend:
|
|
154
|
-
role:
|
|
155
|
-
"aria-live":
|
|
156
|
-
},
|
|
150
|
+
onMouseenter: we,
|
|
151
|
+
onMouseleave: Te,
|
|
152
|
+
"data-state": D.value,
|
|
153
|
+
onTransitionend: Ee,
|
|
154
|
+
role: I.value.role ?? "status",
|
|
155
|
+
"aria-live": I.value["aria-live"] ?? "polite"
|
|
156
|
+
}, c({
|
|
157
157
|
"relative w-full max-w-sm overflow-hidden pointer-events-auto": !0,
|
|
158
158
|
"bg-white shadow-lg ring-1 ring-black/5": !0,
|
|
159
159
|
"dark:bg-dark-800 dark:border dark:border-dark-700": !0,
|
|
160
|
-
[
|
|
161
|
-
[
|
|
162
|
-
[
|
|
163
|
-
}))), Oe = r(() => e(
|
|
160
|
+
[p(be.value, "base") ?? ""]: !0,
|
|
161
|
+
[ye.value]: B.value,
|
|
162
|
+
[p(L.value, "root") ?? ""]: !0
|
|
163
|
+
}))), Oe = r(() => e(F.value?.icon, {}, c({
|
|
164
164
|
"w-6 h-6 shrink-0": !0,
|
|
165
|
-
[
|
|
166
|
-
[
|
|
167
|
-
}))), ke = r(() => e(
|
|
165
|
+
[p(V.value, "iconColor") ?? ""]: !0,
|
|
166
|
+
[p(L.value, "icon") ?? ""]: !0
|
|
167
|
+
}))), ke = r(() => e(F.value?.title, {}, c({
|
|
168
168
|
"text-sm font-medium": !0,
|
|
169
|
-
[
|
|
170
|
-
[
|
|
171
|
-
}))), Ae = r(() => e(
|
|
169
|
+
[p(V.value, "titleColor") ?? ""]: !0,
|
|
170
|
+
[p(L.value, "title") ?? ""]: !0
|
|
171
|
+
}))), Ae = r(() => e(F.value?.description, {}, c({
|
|
172
172
|
"mt-1 text-sm text-dark-500 dark:text-dark-500": !0,
|
|
173
|
-
[
|
|
174
|
-
}))), je = r(() => e(
|
|
175
|
-
class:
|
|
173
|
+
[p(L.value, "description") ?? ""]: !0
|
|
174
|
+
}))), je = r(() => e(F.value?.progress, {}, {
|
|
175
|
+
class: c({
|
|
176
176
|
"absolute bottom-0 left-0 h-0.5 w-full rounded-full": !0,
|
|
177
|
-
[
|
|
178
|
-
[
|
|
177
|
+
[p(V.value, "progressColor") ?? ""]: !0,
|
|
178
|
+
[p(L.value, "progress") ?? ""]: !0
|
|
179
179
|
}),
|
|
180
|
-
style:
|
|
180
|
+
style: W.value ? {
|
|
181
181
|
transformOrigin: "left center",
|
|
182
|
-
transform: `scaleX(${
|
|
183
|
-
transition:
|
|
182
|
+
transform: `scaleX(${w.value && !x.value ? 0 : y.value})`,
|
|
183
|
+
transition: w.value && !x.value ? `transform ${T.value}ms linear` : "none"
|
|
184
184
|
} : void 0
|
|
185
185
|
}));
|
|
186
186
|
function Me(t) {
|
|
187
|
-
return e(
|
|
188
|
-
[
|
|
189
|
-
[
|
|
190
|
-
[
|
|
187
|
+
return e(F.value?.content, {}, c({
|
|
188
|
+
[p(H.value, "contentRight") ?? ""]: t,
|
|
189
|
+
[p(H.value, "content") ?? ""]: !t,
|
|
190
|
+
[p(L.value, "content") ?? ""]: !0
|
|
191
191
|
}));
|
|
192
192
|
}
|
|
193
193
|
return {
|
|
194
|
-
merged:
|
|
194
|
+
merged: N,
|
|
195
195
|
iconBind: Oe,
|
|
196
|
-
rendered:
|
|
196
|
+
rendered: _,
|
|
197
197
|
panelBind: De,
|
|
198
198
|
titleBind: ke,
|
|
199
|
-
isPortaled:
|
|
200
|
-
portalBind:
|
|
199
|
+
isPortaled: G,
|
|
200
|
+
portalBind: $,
|
|
201
201
|
contentBind: Me,
|
|
202
|
-
showProgress:
|
|
202
|
+
showProgress: W,
|
|
203
203
|
progressBind: je,
|
|
204
|
-
requestClose:
|
|
205
|
-
resolvedIcon:
|
|
204
|
+
requestClose: X,
|
|
205
|
+
resolvedIcon: xe,
|
|
206
206
|
descriptionBind: Ae
|
|
207
207
|
};
|
|
208
208
|
}
|
|
209
209
|
//#endregion
|
|
210
|
-
export {
|
|
210
|
+
export { m as useSnackbar };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LucideIcon } from '@lucide/vue';
|
|
2
1
|
import { HTMLAttributes, Slot } from 'vue';
|
|
3
2
|
import { MergeHtmlProps, MergeProps, SnackbarColor, SnackbarPadding, SnackbarPosition, SnackbarRounded, SnackbarTransition } from '@bridge-ui/core';
|
|
3
|
+
import { IconSource } from '../../Adapters/Icon';
|
|
4
4
|
import { IconProps } from '../Icon';
|
|
5
5
|
export interface SnackbarColorOverrides {}
|
|
6
6
|
export interface SnackbarPaddingOverrides {}
|
|
@@ -131,7 +131,7 @@ export interface SnackbarOwnProps {
|
|
|
131
131
|
/**
|
|
132
132
|
* The icon to display. Use `null` to hide the icon.
|
|
133
133
|
*/
|
|
134
|
-
icon?: null |
|
|
134
|
+
icon?: null | IconSource;
|
|
135
135
|
/**
|
|
136
136
|
* Avatar image URL (shown instead of icon when set).
|
|
137
137
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { SnackbarColor } from '@bridge-ui/core/Tokens/Snackbar';
|
|
2
|
+
import { IconSource } from '../../Adapters/Icon';
|
|
3
3
|
/** Library fallbacks when neither the `icon` prop nor theme `icon` is set. */
|
|
4
|
-
export declare const snackbarDefaultIcons: Record<keyof SnackbarColor,
|
|
4
|
+
export declare const snackbarDefaultIcons: Record<keyof SnackbarColor, IconSource>;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { Bell as e, CircleAlert as t, CircleCheck as n, CircleX as r, Info as i, TriangleAlert as a } from "@lucide/vue";
|
|
2
1
|
//#region src/Components/Snackbar/snackbarDefaultIcons.ts
|
|
3
|
-
var
|
|
4
|
-
dark:
|
|
5
|
-
|
|
6
|
-
error:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
success:
|
|
10
|
-
warning:
|
|
2
|
+
var e = {
|
|
3
|
+
dark: "info",
|
|
4
|
+
info: "alert",
|
|
5
|
+
error: "error",
|
|
6
|
+
primary: "bell",
|
|
7
|
+
secondary: "info",
|
|
8
|
+
success: "success",
|
|
9
|
+
warning: "warning"
|
|
11
10
|
};
|
|
12
11
|
//#endregion
|
|
13
|
-
export {
|
|
12
|
+
export { e as snackbarDefaultIcons };
|