@bitrix24/b24ui-nuxt 0.7.1 → 1.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/.nuxt/b24ui/accordion.ts +3 -3
- package/.nuxt/b24ui/advice.ts +6 -5
- package/.nuxt/b24ui/alert.ts +102 -49
- package/.nuxt/b24ui/avatar-group.ts +10 -10
- package/.nuxt/b24ui/avatar.ts +18 -18
- package/.nuxt/b24ui/badge.ts +167 -176
- package/.nuxt/b24ui/button-group.ts +3 -1
- package/.nuxt/b24ui/button.ts +179 -170
- package/.nuxt/b24ui/calendar.ts +48 -28
- package/.nuxt/b24ui/checkbox.ts +82 -85
- package/.nuxt/b24ui/chip.ts +121 -32
- package/.nuxt/b24ui/container.ts +1 -1
- package/.nuxt/b24ui/content/table-wrapper.ts +11 -11
- package/.nuxt/b24ui/countdown.ts +11 -11
- package/.nuxt/b24ui/description-list.ts +6 -6
- package/.nuxt/b24ui/dropdown-menu.ts +111 -183
- package/.nuxt/b24ui/form-field.ts +19 -19
- package/.nuxt/b24ui/index.ts +0 -1
- package/.nuxt/b24ui/input-menu.ts +294 -357
- package/.nuxt/b24ui/input-number.ts +111 -259
- package/.nuxt/b24ui/input.ts +136 -259
- package/.nuxt/b24ui/kbd.ts +15 -13
- package/.nuxt/b24ui/link.ts +5 -5
- package/.nuxt/b24ui/modal.ts +14 -12
- package/.nuxt/b24ui/navbar-divider.ts +1 -1
- package/.nuxt/b24ui/navbar-section.ts +1 -1
- package/.nuxt/b24ui/navbar.ts +1 -1
- package/.nuxt/b24ui/navigation-menu.ts +70 -754
- package/.nuxt/b24ui/popover.ts +2 -2
- package/.nuxt/b24ui/progress.ts +58 -68
- package/.nuxt/b24ui/prose/a.ts +1 -1
- package/.nuxt/b24ui/prose/blockquote.ts +1 -1
- package/.nuxt/b24ui/prose/code.ts +45 -9
- package/.nuxt/b24ui/prose/h1.ts +21 -2
- package/.nuxt/b24ui/prose/h2.ts +21 -12
- package/.nuxt/b24ui/prose/h3.ts +21 -12
- package/.nuxt/b24ui/prose/h4.ts +21 -12
- package/.nuxt/b24ui/prose/h5.ts +21 -12
- package/.nuxt/b24ui/prose/h6.ts +21 -12
- package/.nuxt/b24ui/prose/hr.ts +1 -1
- package/.nuxt/b24ui/prose/ol.ts +1 -1
- package/.nuxt/b24ui/prose/p.ts +26 -1
- package/.nuxt/b24ui/prose/thead.ts +1 -1
- package/.nuxt/b24ui/prose/ul.ts +1 -1
- package/.nuxt/b24ui/radio-group.ts +115 -155
- package/.nuxt/b24ui/range.ts +38 -26
- package/.nuxt/b24ui/select-menu.ts +251 -306
- package/.nuxt/b24ui/select.ts +246 -301
- package/.nuxt/b24ui/separator.ts +40 -85
- package/.nuxt/b24ui/sidebar-header.ts +1 -1
- package/.nuxt/b24ui/sidebar-heading.ts +1 -1
- package/.nuxt/b24ui/sidebar-layout.ts +130 -19
- package/.nuxt/b24ui/sidebar-section.ts +1 -1
- package/.nuxt/b24ui/skeleton.ts +19 -1
- package/.nuxt/b24ui/slideover.ts +35 -34
- package/.nuxt/b24ui/switch.ts +59 -48
- package/.nuxt/b24ui/tabs.ts +26 -239
- package/.nuxt/b24ui/textarea.ts +50 -236
- package/.nuxt/b24ui/toast.ts +38 -30
- package/.nuxt/b24ui/toaster.ts +1 -1
- package/.nuxt/b24ui/tooltip.ts +5 -5
- package/cli/templates.mjs +2 -1
- package/dist/meta.d.mts +18759 -5002
- package/dist/meta.mjs +18759 -5002
- package/dist/module.d.mts +1 -0
- package/dist/module.json +2 -2
- package/dist/module.mjs +3 -5
- package/dist/runtime/air-design-tokens/001_b24_global.css +1 -0
- package/dist/runtime/air-design-tokens/002_b24_context_utility.css +0 -0
- package/dist/runtime/air-design-tokens/003_b24_context_light.css +1 -0
- package/dist/runtime/air-design-tokens/004_b24_context_dark.css +1 -0
- package/dist/runtime/air-design-tokens/005_b24_context_edge-light.css +1 -0
- package/dist/runtime/air-design-tokens/006_b24_context_edge-dark.css +1 -0
- package/dist/runtime/air-design-tokens/007_b24_global.css +1 -0
- package/dist/runtime/air-design-tokens/008_ui_global.css +1 -0
- package/dist/runtime/air-design-tokens/009_b24_tools.css +1 -0
- package/dist/runtime/air-design-tokens/components/badge-counter.css +1 -0
- package/dist/runtime/air-design-tokens/components/button.css +1 -0
- package/dist/runtime/air-design-tokens/components/navigation-menu.css +1 -0
- package/dist/runtime/air-design-tokens/components/popup.css +1 -0
- package/dist/runtime/air-design-tokens/components/scrollbar.css +2 -0
- package/dist/runtime/air-design-tokens/index.css +1 -0
- package/dist/runtime/components/Accordion.vue.d.ts +1 -1
- package/dist/runtime/components/Advice.vue +1 -13
- package/dist/runtime/components/Advice.vue.d.ts +1 -1
- package/dist/runtime/components/Alert.vue +6 -4
- package/dist/runtime/components/Alert.vue.d.ts +11 -4
- package/dist/runtime/components/App.vue.d.ts +1 -1
- package/dist/runtime/components/Avatar.vue.d.ts +1 -1
- package/dist/runtime/components/AvatarGroup.vue.d.ts +1 -1
- package/dist/runtime/components/Badge.vue +7 -11
- package/dist/runtime/components/Badge.vue.d.ts +6 -8
- package/dist/runtime/components/Button.vue +18 -15
- package/dist/runtime/components/Button.vue.d.ts +5 -7
- package/dist/runtime/components/ButtonGroup.vue.d.ts +1 -1
- package/dist/runtime/components/Calendar.vue +8 -8
- package/dist/runtime/components/Calendar.vue.d.ts +14 -8
- package/dist/runtime/components/Checkbox.vue.d.ts +2 -2
- package/dist/runtime/components/Chip.vue +28 -7
- package/dist/runtime/components/Chip.vue.d.ts +22 -2
- package/dist/runtime/components/Collapsible.vue.d.ts +1 -1
- package/dist/runtime/components/Container.vue.d.ts +1 -1
- package/dist/runtime/components/Countdown.vue.d.ts +5 -3
- package/dist/runtime/components/DescriptionList.vue.d.ts +1 -1
- package/dist/runtime/components/DropdownMenu.vue +20 -9
- package/dist/runtime/components/DropdownMenu.vue.d.ts +1 -5
- package/dist/runtime/components/DropdownMenuContent.vue +29 -7
- package/dist/runtime/components/DropdownMenuContent.vue.d.ts +14 -6
- package/dist/runtime/components/Form.vue +3 -3
- package/dist/runtime/components/Form.vue.d.ts +6 -5
- package/dist/runtime/components/FormField.vue +2 -2
- package/dist/runtime/components/FormField.vue.d.ts +4 -4
- package/dist/runtime/components/Input.vue +8 -4
- package/dist/runtime/components/Input.vue.d.ts +9 -8
- package/dist/runtime/components/InputMenu.vue +44 -18
- package/dist/runtime/components/InputMenu.vue.d.ts +17 -223
- package/dist/runtime/components/InputNumber.vue +14 -11
- package/dist/runtime/components/InputNumber.vue.d.ts +13 -87
- package/dist/runtime/components/Kbd.vue +6 -3
- package/dist/runtime/components/Kbd.vue.d.ts +7 -3
- package/dist/runtime/components/Link.vue +6 -5
- package/dist/runtime/components/Link.vue.d.ts +1 -3
- package/dist/runtime/components/LinkBase.vue.d.ts +1 -1
- package/dist/runtime/components/Modal.vue +37 -33
- package/dist/runtime/components/Modal.vue.d.ts +2 -2
- package/dist/runtime/components/ModalDialogClose.vue.d.ts +1 -1
- package/dist/runtime/components/Navbar.vue.d.ts +1 -1
- package/dist/runtime/components/NavbarDivider.vue.d.ts +1 -1
- package/dist/runtime/components/NavbarSection.vue.d.ts +1 -1
- package/dist/runtime/components/NavbarSpacer.vue.d.ts +1 -1
- package/dist/runtime/components/NavigationMenu.vue +95 -84
- package/dist/runtime/components/NavigationMenu.vue.d.ts +31 -33
- package/dist/runtime/components/OverlayProvider.vue.d.ts +1 -1
- package/dist/runtime/components/Popover.vue +8 -2
- package/dist/runtime/components/Popover.vue.d.ts +9 -3
- package/dist/runtime/components/Progress.vue.d.ts +3 -3
- package/dist/runtime/components/RadioGroup.vue +1 -1
- package/dist/runtime/components/RadioGroup.vue.d.ts +6 -5
- package/dist/runtime/components/Range.vue.d.ts +6 -6
- package/dist/runtime/components/Select.vue +25 -11
- package/dist/runtime/components/Select.vue.d.ts +7 -7
- package/dist/runtime/components/SelectMenu.vue +38 -19
- package/dist/runtime/components/SelectMenu.vue.d.ts +11 -10
- package/dist/runtime/components/Separator.vue +4 -4
- package/dist/runtime/components/Separator.vue.d.ts +6 -3
- package/dist/runtime/components/Sidebar.vue.d.ts +4 -1
- package/dist/runtime/components/SidebarBody.vue.d.ts +4 -1
- package/dist/runtime/components/SidebarFooter.vue.d.ts +4 -1
- package/dist/runtime/components/SidebarHeader.vue.d.ts +4 -1
- package/dist/runtime/components/SidebarHeading.vue.d.ts +4 -1
- package/dist/runtime/components/SidebarLayout.vue +148 -63
- package/dist/runtime/components/SidebarLayout.vue.d.ts +61 -8
- package/dist/runtime/components/SidebarSection.vue.d.ts +4 -1
- package/dist/runtime/components/SidebarSpacer.vue.d.ts +4 -1
- package/dist/runtime/components/Skeleton.vue +7 -3
- package/dist/runtime/components/Skeleton.vue.d.ts +12 -1
- package/dist/runtime/components/Slideover.vue +120 -43
- package/dist/runtime/components/Slideover.vue.d.ts +22 -9
- package/dist/runtime/components/Switch.vue.d.ts +2 -2
- package/dist/runtime/components/Tabs.vue +11 -3
- package/dist/runtime/components/Tabs.vue.d.ts +8 -7
- package/dist/runtime/components/Textarea.vue +8 -4
- package/dist/runtime/components/Textarea.vue.d.ts +8 -7
- package/dist/runtime/components/Toast.vue +16 -8
- package/dist/runtime/components/Toast.vue.d.ts +16 -15
- package/dist/runtime/components/Toaster.vue.d.ts +2 -2
- package/dist/runtime/components/Tooltip.vue +9 -5
- package/dist/runtime/components/Tooltip.vue.d.ts +7 -1
- package/dist/runtime/components/content/TableWrapper.vue.d.ts +1 -1
- package/dist/runtime/composables/defineShortcuts.js +5 -3
- package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
- package/dist/runtime/composables/useButtonGroup.d.ts +1 -1
- package/dist/runtime/composables/useComponentIcons.d.ts +1 -1
- package/dist/runtime/composables/useFormField.d.ts +4 -7
- package/dist/runtime/composables/useFormField.js +6 -3
- package/dist/runtime/composables/useKbd.d.ts +1 -1
- package/dist/runtime/composables/useLocale.js +2 -2
- package/dist/runtime/composables/useOverlay.d.ts +29 -2
- package/dist/runtime/composables/useOverlay.js +8 -7
- package/dist/runtime/composables/usePortal.d.ts +1 -1
- package/dist/runtime/composables/useSidebarLayout.d.ts +20 -0
- package/dist/runtime/composables/useSidebarLayout.js +16 -0
- package/dist/runtime/dictionary/icons.js +7 -7
- package/dist/runtime/index.css +1 -1
- package/dist/runtime/inertia/components/Link.vue +3 -0
- package/dist/runtime/inertia/components/Link.vue.d.ts +1 -1
- package/dist/runtime/inertia/components/LinkBase.vue.d.ts +1 -1
- package/dist/runtime/inertia/stubs.d.ts +1 -0
- package/dist/runtime/inertia/stubs.js +4 -2
- package/dist/runtime/locale/ar.js +6 -0
- package/dist/runtime/locale/br.js +6 -0
- package/dist/runtime/locale/de.js +6 -0
- package/dist/runtime/locale/en.js +6 -0
- package/dist/runtime/locale/fr.js +6 -0
- package/dist/runtime/locale/id.js +6 -0
- package/dist/runtime/locale/it.js +6 -0
- package/dist/runtime/locale/ja.js +6 -0
- package/dist/runtime/locale/kz.js +6 -0
- package/dist/runtime/locale/la.js +6 -0
- package/dist/runtime/locale/ms.js +6 -0
- package/dist/runtime/locale/pl.js +6 -0
- package/dist/runtime/locale/ru.js +6 -0
- package/dist/runtime/locale/sc.js +6 -0
- package/dist/runtime/locale/tc.js +6 -0
- package/dist/runtime/locale/th.js +6 -0
- package/dist/runtime/locale/tr.js +6 -0
- package/dist/runtime/locale/ua.js +6 -0
- package/dist/runtime/locale/vn.js +6 -0
- package/dist/runtime/plugins/ui-version.d.ts +5 -0
- package/dist/runtime/plugins/ui-version.js +8 -0
- package/dist/runtime/prose/A.vue.d.ts +4 -1
- package/dist/runtime/prose/Blockquote.vue.d.ts +4 -1
- package/dist/runtime/prose/Code.vue.d.ts +4 -1
- package/dist/runtime/prose/Em.vue.d.ts +4 -1
- package/dist/runtime/prose/H1.vue +4 -1
- package/dist/runtime/prose/H1.vue.d.ts +7 -1
- package/dist/runtime/prose/H2.vue +4 -1
- package/dist/runtime/prose/H2.vue.d.ts +7 -1
- package/dist/runtime/prose/H3.vue +4 -1
- package/dist/runtime/prose/H3.vue.d.ts +7 -1
- package/dist/runtime/prose/H4.vue +4 -1
- package/dist/runtime/prose/H4.vue.d.ts +7 -1
- package/dist/runtime/prose/H5.vue +4 -1
- package/dist/runtime/prose/H5.vue.d.ts +7 -1
- package/dist/runtime/prose/H6.vue +4 -1
- package/dist/runtime/prose/H6.vue.d.ts +7 -1
- package/dist/runtime/prose/Hr.vue.d.ts +1 -1
- package/dist/runtime/prose/Img.vue.d.ts +1 -1
- package/dist/runtime/prose/Li.vue.d.ts +4 -1
- package/dist/runtime/prose/Ol.vue.d.ts +4 -1
- package/dist/runtime/prose/P.vue +6 -1
- package/dist/runtime/prose/P.vue.d.ts +12 -1
- package/dist/runtime/prose/Pre.vue.d.ts +4 -1
- package/dist/runtime/prose/Strong.vue.d.ts +4 -1
- package/dist/runtime/prose/Table.vue.d.ts +5 -2
- package/dist/runtime/prose/Tbody.vue.d.ts +4 -1
- package/dist/runtime/prose/Td.vue.d.ts +4 -1
- package/dist/runtime/prose/Th.vue.d.ts +4 -1
- package/dist/runtime/prose/Thead.vue.d.ts +4 -1
- package/dist/runtime/prose/Tr.vue.d.ts +4 -1
- package/dist/runtime/prose/Ul.vue.d.ts +4 -1
- package/dist/runtime/types/index.d.ts +1 -2
- package/dist/runtime/types/index.js +1 -2
- package/dist/runtime/types/locale.d.ts +6 -0
- package/dist/runtime/utils/index.d.ts +6 -0
- package/dist/runtime/utils/index.js +27 -0
- package/dist/runtime/utils/tv.js +66 -1
- package/dist/runtime/vue/components/Link.vue +3 -0
- package/dist/runtime/vue/components/Link.vue.d.ts +1 -1
- package/dist/runtime/vue/stubs.d.ts +1 -0
- package/dist/runtime/vue/stubs.js +3 -1
- package/dist/shared/b24ui-nuxt.dLc5H7ID.mjs +6100 -0
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +40 -28
- package/.nuxt/b24ui/stacked-layout.ts +0 -34
- package/dist/runtime/air-design-tokens.css +0 -1
- package/dist/runtime/components/StackedLayout.vue +0 -117
- package/dist/runtime/components/StackedLayout.vue.d.ts +0 -44
- package/dist/shared/b24ui-nuxt.CxsFEY3M.mjs +0 -7895
|
@@ -3,7 +3,7 @@ import theme from "#build/b24ui/slideover";
|
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
|
-
import { computed, toRef } from "vue";
|
|
6
|
+
import { computed, toRef, ref } from "vue";
|
|
7
7
|
import { DialogRoot, DialogTrigger, DialogPortal, DialogOverlay, DialogContent, DialogTitle, DialogDescription, DialogClose, VisuallyHidden, useForwardPropsEmits } from "reka-ui";
|
|
8
8
|
import { reactivePick } from "@vueuse/core";
|
|
9
9
|
import { useAppConfig } from "#imports";
|
|
@@ -12,19 +12,20 @@ import { usePortal } from "../composables/usePortal";
|
|
|
12
12
|
import { tv } from "../utils/tv";
|
|
13
13
|
import icons from "../dictionary/icons";
|
|
14
14
|
import B24Button from "./Button.vue";
|
|
15
|
+
import B24SidebarLayout from "./SidebarLayout.vue";
|
|
15
16
|
const props = defineProps({
|
|
16
17
|
title: { type: String, required: false },
|
|
17
18
|
description: { type: String, required: false },
|
|
18
19
|
content: { type: Object, required: false },
|
|
19
20
|
overlay: { type: Boolean, required: false, default: true },
|
|
20
|
-
overlayBlur: { type: null, required: false, default: "
|
|
21
|
+
overlayBlur: { type: null, required: false, default: "off" },
|
|
21
22
|
transition: { type: Boolean, required: false, default: true },
|
|
22
|
-
side: { type: null, required: false, default: "
|
|
23
|
+
side: { type: null, required: false, default: "bottom" },
|
|
23
24
|
portal: { type: [Boolean, String], required: false, skipCheck: true, default: true },
|
|
24
25
|
close: { type: [Boolean, Object], required: false, default: true },
|
|
25
26
|
closeIcon: { type: [Function, Object], required: false },
|
|
26
27
|
dismissible: { type: Boolean, required: false, default: true },
|
|
27
|
-
|
|
28
|
+
useLightContent: { type: Boolean, required: false, default: true },
|
|
28
29
|
class: { type: null, required: false },
|
|
29
30
|
b24ui: { type: null, required: false },
|
|
30
31
|
open: { type: Boolean, required: false },
|
|
@@ -59,6 +60,30 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.slideov
|
|
|
59
60
|
side: props.side,
|
|
60
61
|
overlayBlur: props.overlayBlur
|
|
61
62
|
}));
|
|
63
|
+
const sidebarRef = ref(null);
|
|
64
|
+
defineExpose({
|
|
65
|
+
/**
|
|
66
|
+
* Get SidebarLayout API
|
|
67
|
+
* @throws {Error} If SidebarLayout is not initialized
|
|
68
|
+
*/
|
|
69
|
+
getSidebarApi: () => {
|
|
70
|
+
if (!sidebarRef.value) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
return sidebarRef.value.api;
|
|
74
|
+
},
|
|
75
|
+
// Direct access to SidebarLayout methods
|
|
76
|
+
setSidebarLoading: (value) => {
|
|
77
|
+
if (sidebarRef.value) {
|
|
78
|
+
sidebarRef.value.api.setLoading(value);
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
setSidebarRootLoading: (value) => {
|
|
82
|
+
if (sidebarRef.value) {
|
|
83
|
+
sidebarRef.value.api.setRootLoading(value);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
});
|
|
62
87
|
</script>
|
|
63
88
|
|
|
64
89
|
<template>
|
|
@@ -78,7 +103,11 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.slideov
|
|
|
78
103
|
@after-leave="emits('after:leave')"
|
|
79
104
|
v-on="contentEvents"
|
|
80
105
|
>
|
|
81
|
-
<VisuallyHidden
|
|
106
|
+
<VisuallyHidden
|
|
107
|
+
v-if="
|
|
108
|
+
!!slots.content && (title || !!slots.title || (description || !!slots.description)) || !slots.content && !!slots.header && (!slots.title || !slots.description)
|
|
109
|
+
"
|
|
110
|
+
>
|
|
82
111
|
<DialogTitle v-if="title || !!slots.title">
|
|
83
112
|
<slot name="title">
|
|
84
113
|
{{ title }}
|
|
@@ -93,50 +122,98 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.slideov
|
|
|
93
122
|
</VisuallyHidden>
|
|
94
123
|
|
|
95
124
|
<slot name="content" :close="close">
|
|
96
|
-
<
|
|
97
|
-
<
|
|
98
|
-
<
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
125
|
+
<template v-if="['left', 'right', 'bottom'].includes(props?.side) && (props.close || !!slots.close)">
|
|
126
|
+
<DialogClose v-if="props.close || !!slots.close" as-child>
|
|
127
|
+
<slot name="close" :close="close" :b24ui="b24ui">
|
|
128
|
+
<!-- @todo fix this css -->
|
|
129
|
+
<B24Button
|
|
130
|
+
v-if="props.close"
|
|
131
|
+
:icon="closeIcon || icons.close"
|
|
132
|
+
class="group"
|
|
133
|
+
color="air-primary"
|
|
134
|
+
:aria-label="t('slideover.close')"
|
|
135
|
+
size="lg"
|
|
136
|
+
:b24ui="{
|
|
137
|
+
leadingIcon: 'group-hover:rounded-full group-hover:border-1 group-hover:border-current',
|
|
138
|
+
baseLine: 'ps-[4px] pe-[4px]',
|
|
139
|
+
label: 'hidden sm:flex'
|
|
140
|
+
}"
|
|
141
|
+
v-bind="typeof props.close === 'object' ? props.close : {}"
|
|
142
|
+
:class="b24ui.close({ class: props.b24ui?.close })"
|
|
143
|
+
/>
|
|
144
|
+
</slot>
|
|
145
|
+
</DialogClose>
|
|
146
|
+
</template>
|
|
147
|
+
<B24SidebarLayout
|
|
148
|
+
ref="sidebarRef"
|
|
149
|
+
:use-light-content="props.useLightContent"
|
|
150
|
+
is-inner
|
|
151
|
+
:b24ui="{
|
|
152
|
+
root: b24ui.sidebarLayoutRoot({ class: props.b24ui?.sidebarLayoutRoot }),
|
|
153
|
+
header: b24ui.sidebarLayoutHeaderWrapper({ class: props.b24ui?.sidebarLayoutHeaderWrapper }),
|
|
154
|
+
pageBottomWrapper: b24ui.sidebarLayoutPageBottomWrapper({ class: props.b24ui?.sidebarLayoutPageBottomWrapper })
|
|
155
|
+
}"
|
|
156
|
+
>
|
|
157
|
+
<template v-if="!!slots['sidebar']" #sidebar>
|
|
158
|
+
<slot name="sidebar" :close="close" />
|
|
159
|
+
</template>
|
|
104
160
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
</slot>
|
|
109
|
-
</DialogDescription>
|
|
110
|
-
</div>
|
|
161
|
+
<template v-if="!!slots['navbar']" #navbar>
|
|
162
|
+
<slot name="navbar" :close="close" />
|
|
163
|
+
</template>
|
|
111
164
|
|
|
112
|
-
|
|
165
|
+
<template v-if="!!slots.header || (title || !!slots.title) || (description || !!slots.description) || ['top'].includes(props?.side) && (props.close || !!slots.close)" #content-top>
|
|
166
|
+
<div :class="b24ui.header({ class: props.b24ui?.header })">
|
|
167
|
+
<slot name="header" :close="close">
|
|
168
|
+
<div :class="b24ui.wrapper({ class: props.b24ui?.wrapper })">
|
|
169
|
+
<DialogTitle v-if="title || !!slots.title" :class="b24ui.title({ class: props.b24ui?.title })">
|
|
170
|
+
<slot name="title">
|
|
171
|
+
{{ title }}
|
|
172
|
+
</slot>
|
|
173
|
+
</DialogTitle>
|
|
113
174
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
175
|
+
<DialogDescription v-if="description || !!slots.description" :class="b24ui.description({ class: props.b24ui?.description })">
|
|
176
|
+
<slot name="description">
|
|
177
|
+
{{ description }}
|
|
178
|
+
</slot>
|
|
179
|
+
</DialogDescription>
|
|
180
|
+
</div>
|
|
181
|
+
<template v-if="props.close || !!slots.close">
|
|
182
|
+
<DialogClose v-if="props.close || !!slots.close" as-child>
|
|
183
|
+
<slot name="close" :close="close" :b24ui="b24ui">
|
|
184
|
+
<B24Button
|
|
185
|
+
v-if="props.close"
|
|
186
|
+
:icon="closeIcon || icons.close"
|
|
187
|
+
class="group"
|
|
188
|
+
color="air-tertiary-no-accent"
|
|
189
|
+
:aria-label="t('slideover.close')"
|
|
190
|
+
size="lg"
|
|
191
|
+
v-bind="typeof props.close === 'object' ? props.close : {}"
|
|
192
|
+
:class="b24ui.close({ class: props.b24ui?.close })"
|
|
193
|
+
/>
|
|
194
|
+
</slot>
|
|
195
|
+
</DialogClose>
|
|
196
|
+
</template>
|
|
128
197
|
</slot>
|
|
129
|
-
</
|
|
130
|
-
</
|
|
131
|
-
|
|
198
|
+
</div>
|
|
199
|
+
</template>
|
|
200
|
+
|
|
201
|
+
<template v-if="!!slots['actions']" #content-actions>
|
|
202
|
+
<slot name="actions" />
|
|
203
|
+
</template>
|
|
132
204
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
205
|
+
<template v-if="!!slots['body']" #default>
|
|
206
|
+
<div :class="b24ui.body({ class: props.b24ui?.body })">
|
|
207
|
+
<slot name="body" :close="close" />
|
|
208
|
+
</div>
|
|
209
|
+
</template>
|
|
136
210
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
211
|
+
<template v-if="!!slots.footer" #content-bottom>
|
|
212
|
+
<div :class="b24ui.footer({ class: props.b24ui?.footer })">
|
|
213
|
+
<slot name="footer" :close="close" />
|
|
214
|
+
</div>
|
|
215
|
+
</template>
|
|
216
|
+
</B24SidebarLayout>
|
|
140
217
|
</slot>
|
|
141
218
|
</DialogContent>
|
|
142
219
|
</DialogPortal>
|
|
@@ -3,6 +3,7 @@ import type { AppConfig } from '@nuxt/schema';
|
|
|
3
3
|
import theme from '#build/b24ui/slideover';
|
|
4
4
|
import type { ButtonProps, IconComponent } from '../types';
|
|
5
5
|
import type { EmitsToProps, ComponentConfig } from '../types/utils';
|
|
6
|
+
import type { SidebarLayoutApi } from '../composables/useSidebarLayout';
|
|
6
7
|
type Slideover = ComponentConfig<typeof theme, AppConfig, 'slideover'>;
|
|
7
8
|
export interface SlideoverProps extends DialogRootProps {
|
|
8
9
|
title?: string;
|
|
@@ -19,7 +20,7 @@ export interface SlideoverProps extends DialogRootProps {
|
|
|
19
20
|
/**
|
|
20
21
|
* Render an overlay blur behind the slideover.
|
|
21
22
|
* `auto` use `motion-safe`.
|
|
22
|
-
* @defaultValue '
|
|
23
|
+
* @defaultValue 'off'
|
|
23
24
|
*/
|
|
24
25
|
overlayBlur?: Slideover['variants']['overlayBlur'];
|
|
25
26
|
/**
|
|
@@ -29,7 +30,7 @@ export interface SlideoverProps extends DialogRootProps {
|
|
|
29
30
|
transition?: boolean;
|
|
30
31
|
/**
|
|
31
32
|
* The side of the slideover.
|
|
32
|
-
* @defaultValue '
|
|
33
|
+
* @defaultValue 'bottom'
|
|
33
34
|
*/
|
|
34
35
|
side?: Slideover['variants']['side'];
|
|
35
36
|
/**
|
|
@@ -39,8 +40,8 @@ export interface SlideoverProps extends DialogRootProps {
|
|
|
39
40
|
portal?: boolean | string | HTMLElement;
|
|
40
41
|
/**
|
|
41
42
|
* Display a close button to dismiss the slideover.
|
|
42
|
-
* `{ color: 'primary' }`{lang="ts"} for `left`, `right`
|
|
43
|
-
* `{ color: '
|
|
43
|
+
* `{ color: 'air-primary' }`{lang="ts"} for `left`, `right`, `bottom`
|
|
44
|
+
* `{ color: 'air-tertiary' }`{lang="ts"} for `top`
|
|
44
45
|
* @defaultValue true
|
|
45
46
|
*/
|
|
46
47
|
close?: boolean | Partial<ButtonProps>;
|
|
@@ -56,9 +57,10 @@ export interface SlideoverProps extends DialogRootProps {
|
|
|
56
57
|
*/
|
|
57
58
|
dismissible?: boolean;
|
|
58
59
|
/**
|
|
59
|
-
*
|
|
60
|
+
* The content is placed on a light background.
|
|
61
|
+
* @defaultValue 'true'
|
|
60
62
|
*/
|
|
61
|
-
|
|
63
|
+
useLightContent?: boolean;
|
|
62
64
|
class?: any;
|
|
63
65
|
b24ui?: Slideover['slots'];
|
|
64
66
|
}
|
|
@@ -74,6 +76,12 @@ export interface SlideoverSlots {
|
|
|
74
76
|
content(props: {
|
|
75
77
|
close: () => void;
|
|
76
78
|
}): any;
|
|
79
|
+
sidebar(props: {
|
|
80
|
+
close: () => void;
|
|
81
|
+
}): any;
|
|
82
|
+
navbar(props: {
|
|
83
|
+
close: () => void;
|
|
84
|
+
}): any;
|
|
77
85
|
header(props: {
|
|
78
86
|
close: () => void;
|
|
79
87
|
}): any;
|
|
@@ -93,7 +101,12 @@ export interface SlideoverSlots {
|
|
|
93
101
|
close: () => void;
|
|
94
102
|
}): any;
|
|
95
103
|
}
|
|
96
|
-
|
|
104
|
+
export interface SlideoverInstance {
|
|
105
|
+
getSidebarApi: () => SidebarLayoutApi | null;
|
|
106
|
+
setSidebarLoading: (value: boolean) => void;
|
|
107
|
+
setSidebarRootLoading: (value: boolean) => void;
|
|
108
|
+
}
|
|
109
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SlideoverProps, SlideoverInstance, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
97
110
|
"update:open": (value: boolean) => any;
|
|
98
111
|
"after:leave": () => any;
|
|
99
112
|
"after:enter": () => any;
|
|
@@ -105,14 +118,14 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SlideoverP
|
|
|
105
118
|
"onClose:prevent"?: (() => any) | undefined;
|
|
106
119
|
}>, {
|
|
107
120
|
close: boolean | Partial<ButtonProps>;
|
|
121
|
+
transition: boolean;
|
|
108
122
|
modal: boolean;
|
|
109
123
|
portal: boolean | string | HTMLElement;
|
|
110
124
|
overlay: boolean;
|
|
111
125
|
side: Slideover["variants"]["side"];
|
|
112
126
|
overlayBlur: Slideover["variants"]["overlayBlur"];
|
|
113
|
-
transition: boolean;
|
|
114
127
|
dismissible: boolean;
|
|
115
|
-
|
|
128
|
+
useLightContent: boolean;
|
|
116
129
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, SlideoverSlots>;
|
|
117
130
|
export default _default;
|
|
118
131
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -11,7 +11,7 @@ export interface SwitchProps extends Pick<SwitchRootProps, 'disabled' | 'id' | '
|
|
|
11
11
|
*/
|
|
12
12
|
as?: any;
|
|
13
13
|
/**
|
|
14
|
-
* @defaultValue 'primary'
|
|
14
|
+
* @defaultValue 'air-primary'
|
|
15
15
|
*/
|
|
16
16
|
color?: Switch['variants']['color'];
|
|
17
17
|
/**
|
|
@@ -57,7 +57,7 @@ export interface SwitchSlots {
|
|
|
57
57
|
}
|
|
58
58
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SwitchProps & {
|
|
59
59
|
modelValue?: boolean;
|
|
60
|
-
},
|
|
60
|
+
}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
61
61
|
change: (payload: Event) => any;
|
|
62
62
|
"update:modelValue": (value: boolean) => any;
|
|
63
63
|
}, string, import("vue").PublicProps, Readonly<SwitchProps & {
|
|
@@ -10,10 +10,10 @@ import { useAppConfig } from "#imports";
|
|
|
10
10
|
import { get } from "../utils";
|
|
11
11
|
import { tv } from "../utils/tv";
|
|
12
12
|
import B24Avatar from "./Avatar.vue";
|
|
13
|
+
import B24Badge from "./Badge.vue";
|
|
13
14
|
const props = defineProps({
|
|
14
15
|
as: { type: null, required: false },
|
|
15
16
|
items: { type: Array, required: false },
|
|
16
|
-
color: { type: null, required: false },
|
|
17
17
|
variant: { type: null, required: false },
|
|
18
18
|
size: { type: null, required: false },
|
|
19
19
|
orientation: { type: null, required: false, default: "horizontal" },
|
|
@@ -34,7 +34,6 @@ const getLabel = (item) => {
|
|
|
34
34
|
return get(item, props.labelKey);
|
|
35
35
|
};
|
|
36
36
|
const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.tabs || {} })({
|
|
37
|
-
color: props.color,
|
|
38
37
|
variant: props.variant,
|
|
39
38
|
size: props.size,
|
|
40
39
|
orientation: props.orientation
|
|
@@ -78,7 +77,16 @@ defineExpose({
|
|
|
78
77
|
<slot :item="item" :index="index">{{ getLabel(item) }}</slot>
|
|
79
78
|
</span>
|
|
80
79
|
|
|
81
|
-
<slot name="trailing" :item="item" :index="index"
|
|
80
|
+
<slot name="trailing" :item="item" :index="index">
|
|
81
|
+
<B24Badge
|
|
82
|
+
v-if="item.badge !== void 0"
|
|
83
|
+
color="air-primary"
|
|
84
|
+
variant="outline"
|
|
85
|
+
:size="item.ui?.trailingBadgeSize || props.b24ui?.trailingBadgeSize || b24ui.trailingBadgeSize()"
|
|
86
|
+
v-bind="typeof item.badge === 'string' || typeof item.badge === 'number' ? { label: item.badge } : item.badge"
|
|
87
|
+
:class="b24ui.trailingBadge({ class: [props.b24ui?.trailingBadge, item.b24ui?.trailingBadge] })"
|
|
88
|
+
/>
|
|
89
|
+
</slot>
|
|
82
90
|
</TabsTrigger>
|
|
83
91
|
|
|
84
92
|
<slot name="list-trailing" />
|
|
@@ -2,7 +2,7 @@ import type { ComponentPublicInstance } from 'vue';
|
|
|
2
2
|
import type { TabsRootProps, TabsRootEmits } from 'reka-ui';
|
|
3
3
|
import type { AppConfig } from '@nuxt/schema';
|
|
4
4
|
import theme from '#build/b24ui/tabs';
|
|
5
|
-
import type { AvatarProps, IconComponent } from '../types';
|
|
5
|
+
import type { AvatarProps, BadgeProps, IconComponent } from '../types';
|
|
6
6
|
import type { DynamicSlots, ComponentConfig } from '../types/utils';
|
|
7
7
|
type Tabs = ComponentConfig<typeof theme, AppConfig, 'tabs'>;
|
|
8
8
|
export interface TabsItem {
|
|
@@ -12,13 +12,18 @@ export interface TabsItem {
|
|
|
12
12
|
*/
|
|
13
13
|
icon?: IconComponent;
|
|
14
14
|
avatar?: AvatarProps;
|
|
15
|
+
/**
|
|
16
|
+
* Display a badge on the item.
|
|
17
|
+
* `{ size: 'sm', color: 'air-primary' }`{lang="ts"}
|
|
18
|
+
*/
|
|
19
|
+
badge?: string | number | BadgeProps;
|
|
15
20
|
slot?: string;
|
|
16
21
|
content?: string;
|
|
17
22
|
/** A unique value for the tab item. Defaults to the index. */
|
|
18
23
|
value?: string | number;
|
|
19
24
|
disabled?: boolean;
|
|
20
25
|
class?: any;
|
|
21
|
-
b24ui?: Pick<Tabs['slots'], 'trigger' | 'leadingIcon' | '
|
|
26
|
+
b24ui?: Pick<Tabs['slots'], 'trigger' | 'leadingIcon' | 'leadingAvatar' | 'leadingAvatarSize' | 'label' | 'trailingBadge' | 'trailingBadgeSize' | 'content'>;
|
|
22
27
|
[key: string]: any;
|
|
23
28
|
}
|
|
24
29
|
export interface TabsProps<T extends TabsItem = TabsItem> extends Pick<TabsRootProps<string | number>, 'defaultValue' | 'modelValue' | 'activationMode' | 'unmountOnHide'> {
|
|
@@ -28,10 +33,6 @@ export interface TabsProps<T extends TabsItem = TabsItem> extends Pick<TabsRootP
|
|
|
28
33
|
*/
|
|
29
34
|
as?: any;
|
|
30
35
|
items?: T[];
|
|
31
|
-
/**
|
|
32
|
-
* @defaultValue 'default'
|
|
33
|
-
*/
|
|
34
|
-
color?: Tabs['variants']['color'];
|
|
35
36
|
/**
|
|
36
37
|
* @defaultValue 'link'
|
|
37
38
|
*/
|
|
@@ -89,5 +90,5 @@ declare const _default: <T extends TabsItem>(__VLS_props: NonNullable<Awaited<ty
|
|
|
89
90
|
};
|
|
90
91
|
export default _default;
|
|
91
92
|
type __VLS_PrettifyLocal<T> = {
|
|
92
|
-
[K in keyof T]: T[K];
|
|
93
|
+
[K in keyof T as K]: T[K];
|
|
93
94
|
} & {};
|
|
@@ -11,6 +11,7 @@ import { useComponentIcons } from "../composables/useComponentIcons";
|
|
|
11
11
|
import { useFormField } from "../composables/useFormField";
|
|
12
12
|
import { looseToNumber } from "../utils";
|
|
13
13
|
import { tv } from "../utils/tv";
|
|
14
|
+
import B24Badge from "./Badge.vue";
|
|
14
15
|
import B24Avatar from "./Avatar.vue";
|
|
15
16
|
defineOptions({ inheritAttrs: false });
|
|
16
17
|
const props = defineProps({
|
|
@@ -59,7 +60,6 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.textare
|
|
|
59
60
|
loading: props.loading,
|
|
60
61
|
highlight: highlight.value,
|
|
61
62
|
autoresize: Boolean(props.autoresize),
|
|
62
|
-
tagColor: props.tagColor,
|
|
63
63
|
rounded: Boolean(props.rounded),
|
|
64
64
|
noPadding: Boolean(props.noPadding),
|
|
65
65
|
noBorder: Boolean(props.noBorder),
|
|
@@ -143,9 +143,13 @@ defineExpose({
|
|
|
143
143
|
|
|
144
144
|
<template>
|
|
145
145
|
<Primitive :as="as" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
|
|
146
|
-
<
|
|
147
|
-
|
|
148
|
-
|
|
146
|
+
<B24Badge
|
|
147
|
+
v-if="isTag"
|
|
148
|
+
:class="b24ui.tag({ class: props.b24ui?.tag })"
|
|
149
|
+
:color="props.tagColor"
|
|
150
|
+
:label="props.tag"
|
|
151
|
+
size="xs"
|
|
152
|
+
/>
|
|
149
153
|
|
|
150
154
|
<textarea
|
|
151
155
|
:id="id"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AppConfig } from '@nuxt/schema';
|
|
2
2
|
import theme from '#build/b24ui/textarea';
|
|
3
3
|
import type { UseComponentIconsProps } from '../composables/useComponentIcons';
|
|
4
|
+
import type { BadgeProps } from '../types';
|
|
4
5
|
import type { ComponentConfig } from '../types/utils';
|
|
5
6
|
type Textarea = ComponentConfig<typeof theme, AppConfig, 'textarea'>;
|
|
6
7
|
type TextareaValue = string | number | null;
|
|
@@ -17,7 +18,7 @@ export interface TextareaProps<T extends TextareaValue = TextareaValue> extends
|
|
|
17
18
|
*/
|
|
18
19
|
placeholder?: string;
|
|
19
20
|
/**
|
|
20
|
-
* @defaultValue 'primary'
|
|
21
|
+
* @defaultValue 'air-primary'
|
|
21
22
|
*/
|
|
22
23
|
color?: Textarea['variants']['color'];
|
|
23
24
|
/**
|
|
@@ -76,7 +77,7 @@ export interface TextareaProps<T extends TextareaValue = TextareaValue> extends
|
|
|
76
77
|
/**
|
|
77
78
|
* @defaultValue 'primary'
|
|
78
79
|
*/
|
|
79
|
-
tagColor?:
|
|
80
|
+
tagColor?: BadgeProps['color'];
|
|
80
81
|
/**
|
|
81
82
|
* Highlight the ring color like a focus state
|
|
82
83
|
* @defaultValue false
|
|
@@ -95,9 +96,9 @@ export interface TextareaProps<T extends TextareaValue = TextareaValue> extends
|
|
|
95
96
|
b24ui?: Textarea['slots'];
|
|
96
97
|
}
|
|
97
98
|
export interface TextareaEmits<T extends TextareaValue = TextareaValue> {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
'update:modelValue': [payload: T];
|
|
100
|
+
'blur': [event: FocusEvent];
|
|
101
|
+
'change': [event: Event];
|
|
101
102
|
}
|
|
102
103
|
export interface TextareaSlots {
|
|
103
104
|
leading(props?: {}): any;
|
|
@@ -115,11 +116,11 @@ declare const _default: <T extends TextareaValue>(__VLS_props: NonNullable<Await
|
|
|
115
116
|
}>): void;
|
|
116
117
|
attrs: any;
|
|
117
118
|
slots: TextareaSlots;
|
|
118
|
-
emit:
|
|
119
|
+
emit: ((evt: "blur", event: FocusEvent) => void) & ((evt: "change", event: Event) => void) & ((evt: "update:modelValue", payload: T) => void);
|
|
119
120
|
}>) => import("vue").VNode & {
|
|
120
121
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
121
122
|
};
|
|
122
123
|
export default _default;
|
|
123
124
|
type __VLS_PrettifyLocal<T> = {
|
|
124
|
-
[K in keyof T]: T[K];
|
|
125
|
+
[K in keyof T as K]: T[K];
|
|
125
126
|
} & {};
|
|
@@ -12,6 +12,7 @@ import { tv } from "../utils/tv";
|
|
|
12
12
|
import icons from "../dictionary/icons";
|
|
13
13
|
import B24Avatar from "./Avatar.vue";
|
|
14
14
|
import B24Button from "./Button.vue";
|
|
15
|
+
import B24Progress from "./Progress.vue";
|
|
15
16
|
const props = defineProps({
|
|
16
17
|
as: { type: null, required: false },
|
|
17
18
|
title: { type: [String, Object, Function], required: false },
|
|
@@ -20,10 +21,10 @@ const props = defineProps({
|
|
|
20
21
|
avatar: { type: Object, required: false },
|
|
21
22
|
color: { type: null, required: false },
|
|
22
23
|
orientation: { type: null, required: false, default: "vertical" },
|
|
23
|
-
progress: { type: Boolean, required: false, default: true },
|
|
24
|
-
actions: { type: Array, required: false },
|
|
25
24
|
close: { type: [Boolean, Object], required: false, default: true },
|
|
26
25
|
closeIcon: { type: [Function, Object], required: false },
|
|
26
|
+
actions: { type: Array, required: false },
|
|
27
|
+
progress: { type: [Boolean, Object], required: false, default: true },
|
|
27
28
|
class: { type: null, required: false },
|
|
28
29
|
b24ui: { type: null, required: false },
|
|
29
30
|
defaultOpen: { type: Boolean, required: false },
|
|
@@ -59,7 +60,7 @@ defineExpose({
|
|
|
59
60
|
<template>
|
|
60
61
|
<ToastRoot
|
|
61
62
|
ref="el"
|
|
62
|
-
v-slot="{ remaining, duration }"
|
|
63
|
+
v-slot="{ remaining, duration, open }"
|
|
63
64
|
v-bind="rootProps"
|
|
64
65
|
:data-orientation="orientation"
|
|
65
66
|
:class="b24ui.root({ class: [props.b24ui?.root, props.class] })"
|
|
@@ -97,7 +98,7 @@ defineExpose({
|
|
|
97
98
|
<div v-if="orientation === 'vertical' && (actions?.length || !!slots.actions)" :class="b24ui.actions({ class: props.b24ui?.actions })">
|
|
98
99
|
<slot name="actions">
|
|
99
100
|
<ToastAction v-for="(action, index) in actions" :key="index" :alt-text="action.label || 'Action'" as-child @click.stop>
|
|
100
|
-
<B24Button size="
|
|
101
|
+
<B24Button size="sm" :color="color" v-bind="action" />
|
|
101
102
|
</ToastAction>
|
|
102
103
|
</slot>
|
|
103
104
|
</div>
|
|
@@ -107,7 +108,7 @@ defineExpose({
|
|
|
107
108
|
<template v-if="orientation === 'horizontal' && (actions?.length || !!slots.actions)">
|
|
108
109
|
<slot name="actions">
|
|
109
110
|
<ToastAction v-for="(action, index) in actions" :key="index" :alt-text="action.label || 'Action'" as-child @click.stop>
|
|
110
|
-
<B24Button size="
|
|
111
|
+
<B24Button size="sm" :color="color" v-bind="action" />
|
|
111
112
|
</ToastAction>
|
|
112
113
|
</slot>
|
|
113
114
|
</template>
|
|
@@ -117,8 +118,8 @@ defineExpose({
|
|
|
117
118
|
<B24Button
|
|
118
119
|
v-if="close"
|
|
119
120
|
:icon="closeIcon || icons.close"
|
|
120
|
-
size="
|
|
121
|
-
color="
|
|
121
|
+
size="sm"
|
|
122
|
+
color="air-tertiary"
|
|
122
123
|
:aria-label="t('toast.close')"
|
|
123
124
|
v-bind="typeof close === 'object' ? close : {}"
|
|
124
125
|
:class="b24ui.close({ class: props.b24ui?.close })"
|
|
@@ -128,6 +129,13 @@ defineExpose({
|
|
|
128
129
|
</ToastClose>
|
|
129
130
|
</div>
|
|
130
131
|
|
|
131
|
-
<
|
|
132
|
+
<B24Progress
|
|
133
|
+
v-if="progress && open && remaining > 0 && duration"
|
|
134
|
+
:model-value="remaining / duration * 100"
|
|
135
|
+
:color="color"
|
|
136
|
+
v-bind="typeof progress === 'object' ? progress : {}"
|
|
137
|
+
size="sm"
|
|
138
|
+
:class="b24ui.progress({ class: props.b24ui?.progress })"
|
|
139
|
+
/>
|
|
132
140
|
</ToastRoot>
|
|
133
141
|
</template>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ToastRootProps, ToastRootEmits } from 'reka-ui';
|
|
2
2
|
import type { AppConfig } from '@nuxt/schema';
|
|
3
3
|
import theme from '#build/b24ui/toast';
|
|
4
|
-
import type { AvatarProps, ButtonProps, IconComponent } from '../types';
|
|
4
|
+
import type { AvatarProps, ButtonProps, ProgressProps, IconComponent } from '../types';
|
|
5
5
|
import type { StringOrVNode, ComponentConfig } from '../types/utils';
|
|
6
6
|
type Toast = ComponentConfig<typeof theme, AppConfig, 'toast'>;
|
|
7
7
|
export interface ToastProps extends Pick<ToastRootProps, 'defaultOpen' | 'open' | 'type' | 'duration'> {
|
|
@@ -18,7 +18,7 @@ export interface ToastProps extends Pick<ToastRootProps, 'defaultOpen' | 'open'
|
|
|
18
18
|
icon?: IconComponent;
|
|
19
19
|
avatar?: AvatarProps;
|
|
20
20
|
/**
|
|
21
|
-
* @defaultValue '
|
|
21
|
+
* @defaultValue 'air-secondary-no-accent'
|
|
22
22
|
*/
|
|
23
23
|
color?: Toast['variants']['color'];
|
|
24
24
|
/**
|
|
@@ -27,29 +27,30 @@ export interface ToastProps extends Pick<ToastRootProps, 'defaultOpen' | 'open'
|
|
|
27
27
|
*/
|
|
28
28
|
orientation?: Toast['variants']['orientation'];
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* Display a close button to dismiss the toast.
|
|
31
|
+
* `{ size: 'sm', color: 'air-tertiary' }`{lang="ts"}
|
|
31
32
|
* @defaultValue true
|
|
32
33
|
*/
|
|
33
|
-
|
|
34
|
+
close?: boolean | Partial<ButtonProps>;
|
|
35
|
+
/**
|
|
36
|
+
* The icon displayed in the close button.
|
|
37
|
+
* @defaultValue icons.close
|
|
38
|
+
* @IconComponent
|
|
39
|
+
*/
|
|
40
|
+
closeIcon?: IconComponent;
|
|
34
41
|
/**
|
|
35
42
|
* Display a list of actions:
|
|
36
43
|
* - under the title and description when orientation is `vertical`
|
|
37
44
|
* - next to the close button when orientation is `horizontal`
|
|
38
|
-
* `{ size: '
|
|
45
|
+
* `{ size: 'sm' }`{lang="ts"}
|
|
39
46
|
*/
|
|
40
47
|
actions?: ButtonProps[];
|
|
41
48
|
/**
|
|
42
|
-
* Display a
|
|
43
|
-
* `{ size: '
|
|
49
|
+
* Display a progress bar showing the toast's remaining duration.
|
|
50
|
+
* `{ size: 'sm' }`{lang="ts"}
|
|
44
51
|
* @defaultValue true
|
|
45
52
|
*/
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* The icon displayed in the close button.
|
|
49
|
-
* @defaultValue icons.close
|
|
50
|
-
* @IconComponent
|
|
51
|
-
*/
|
|
52
|
-
closeIcon?: IconComponent;
|
|
53
|
+
progress?: boolean | Pick<ProgressProps, 'color' | 'b24ui'>;
|
|
53
54
|
class?: any;
|
|
54
55
|
b24ui?: Toast['slots'];
|
|
55
56
|
}
|
|
@@ -152,7 +153,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ToastProps
|
|
|
152
153
|
}>, "currentTarget">) => any) | undefined;
|
|
153
154
|
}>, {
|
|
154
155
|
close: boolean | Partial<ButtonProps>;
|
|
155
|
-
progress: boolean
|
|
156
|
+
progress: boolean | Pick<ProgressProps, "color" | "b24ui">;
|
|
156
157
|
orientation: Toast["variants"]["orientation"];
|
|
157
158
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ToastSlots>;
|
|
158
159
|
export default _default;
|
|
@@ -34,10 +34,10 @@ export interface ToasterProps extends Omit<ToastProviderProps, 'swipeDirection'>
|
|
|
34
34
|
export interface ToasterSlots {
|
|
35
35
|
default(props?: {}): any;
|
|
36
36
|
}
|
|
37
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ToasterProps,
|
|
37
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ToasterProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ToasterProps> & Readonly<{}>, {
|
|
38
38
|
progress: boolean;
|
|
39
|
-
position: Toaster["variants"]["position"];
|
|
40
39
|
duration: number;
|
|
40
|
+
position: Toaster["variants"]["position"];
|
|
41
41
|
expand: boolean;
|
|
42
42
|
portal: boolean | string | HTMLElement;
|
|
43
43
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ToasterSlots>;
|