@weni/unnnic-system 3.12.2 → 3.12.3-alpha-teleports.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/components/Alert/Alert.vue.d.ts +3 -3
- package/dist/components/Alert/Version1dot1.vue.d.ts +1 -1
- package/dist/components/AudioRecorder/AudioHandler.vue.d.ts +92 -18
- package/dist/components/AudioRecorder/AudioRecorder.vue.d.ts +184 -36
- package/dist/components/AvatarIcon/AvatarIcon.vue.d.ts +1 -1
- package/dist/components/Button/Button.vue.d.ts +2 -2
- package/dist/components/Card/AccountCard.vue.d.ts +2 -2
- package/dist/components/Card/Card.vue.d.ts +103 -29
- package/dist/components/Card/CardCompany.vue.d.ts +2 -2
- package/dist/components/Card/CardStatusesContainer.vue.d.ts +93 -19
- package/dist/components/Card/ContentCard.vue.d.ts +1 -1
- package/dist/components/Card/DashCard.vue.d.ts +2 -2
- package/dist/components/Card/DefaultCard.vue.d.ts +1 -1
- package/dist/components/Card/MarketplaceCard.vue.d.ts +1 -1
- package/dist/components/Card/SimpleCard.vue.d.ts +92 -18
- package/dist/components/Card/StatusCard.vue.d.ts +1 -1
- package/dist/components/Card/TitleCard.vue.d.ts +92 -18
- package/dist/components/CardImage/CardImage.vue.d.ts +5 -5
- package/dist/components/CardInformation/CardInformation.vue.d.ts +93 -19
- package/dist/components/CardProject/CardProject.vue.d.ts +2 -2
- package/dist/components/Carousel/Carousel.vue.d.ts +2 -2
- package/dist/components/Carousel/TagCarousel.vue.d.ts +2 -2
- package/dist/components/ChartBar/ChartBar.vue.d.ts +98 -24
- package/dist/components/ChartFunnel/DefaultFunnel/ChartDefaultFunnelBase.vue.d.ts.map +1 -1
- package/dist/components/ChartLine/ChartLine.vue.d.ts +92 -18
- package/dist/components/ChatText/ChatText.vue.d.ts +92 -18
- package/dist/components/ChatsContact/ChatsContact.vue.d.ts +6 -6
- package/dist/components/ChatsMessage/ChatsMessage.vue.d.ts +92 -18
- package/dist/components/ChatsUserAvatar/ChatsUserAvatar.vue.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.vue.d.ts +3 -3
- package/dist/components/Checkbox/Checkbox.vue.d.ts.map +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.vue.d.ts.map +1 -1
- package/dist/components/DataArea/DataArea.vue.d.ts +92 -18
- package/dist/components/DataTable/index.vue.d.ts +1 -1
- package/dist/components/DataTable/index.vue.d.ts.map +1 -1
- package/dist/components/DateFilter/DateFilter.vue.d.ts +13 -13
- package/dist/components/Drawer/Drawer.vue.d.ts +37 -207
- package/dist/components/Drawer/Drawer.vue.d.ts.map +1 -1
- package/dist/components/Dropdown/Dropdown.vue.d.ts +1 -1
- package/dist/components/FormElement/FormElement.vue.d.ts +6 -6
- package/dist/components/FormElement/FormElement.vue.d.ts.map +1 -1
- package/dist/components/ImportCard/ImportCard.vue.d.ts +6 -6
- package/dist/components/Input/Input.vue.d.ts +12 -12
- package/dist/components/Input/TextInput.vue.d.ts +2 -2
- package/dist/components/InputNext/InputNext.vue.d.ts +3 -3
- package/dist/components/Label/Label.vue.d.ts +1 -1
- package/dist/components/Label/Label.vue.d.ts.map +1 -1
- package/dist/components/Modal/Modal.vue.d.ts +1 -1
- package/dist/components/ModalDialog/ModalDialog.vue.d.ts +209 -35
- package/dist/components/ModalDialog/ModalDialog.vue.d.ts.map +1 -1
- package/dist/components/ModalNext/ModalNext.vue.d.ts +18 -18
- package/dist/components/ModalUpload/ModalUpload.vue.d.ts +12 -12
- package/dist/components/MoodRating/MoodRating.vue.d.ts +92 -18
- package/dist/components/MultiSelect/MultiSelect.vue.d.ts +18 -18
- package/dist/components/Pagination/Pagination.vue.d.ts +6 -6
- package/dist/components/Radio/Radio.vue.d.ts +6 -6
- package/dist/components/Radio/Radio.vue.d.ts.map +1 -1
- package/dist/components/SelectSmart/SelectSmart.vue.d.ts +11 -11
- package/dist/components/SelectSmart/SelectSmartMultipleHeader.vue.d.ts +2 -2
- package/dist/components/SelectSmart/SelectSmartOption.vue.d.ts +5 -5
- package/dist/components/SelectTime/index.vue.d.ts +3 -3
- package/dist/components/Slider/Slider.vue.d.ts +92 -18
- package/dist/components/Switch/Switch.vue.d.ts +3 -3
- package/dist/components/Switch/Switch.vue.d.ts.map +1 -1
- package/dist/components/Tab/Tab.vue.d.ts +92 -18
- package/dist/components/TableNext/TableBodyCell.vue.d.ts +2 -2
- package/dist/components/TableNext/TablePagination.vue.d.ts +6 -6
- package/dist/components/Tag/DefaultTag.vue.d.ts +1 -1
- package/dist/components/Tag/Tag.vue.d.ts +2 -2
- package/dist/components/TemplatePreview/TemplatePreview.vue.d.ts.map +1 -1
- package/dist/components/TextArea/TextArea.vue.d.ts +8 -8
- package/dist/components/Toast/Toast.vue.d.ts +1 -1
- package/dist/components/Toast/Toast.vue.d.ts.map +1 -1
- package/dist/components/ToolTip/ToolTip.vue.d.ts +92 -18
- package/dist/components/ToolTip/ToolTip.vue.d.ts.map +1 -1
- package/dist/components/Tour/Tour.vue.d.ts +6 -6
- package/dist/components/Tour/TourPopover.vue.d.ts +6 -6
- package/dist/components/UploadArea/UploadArea.vue.d.ts +6 -6
- package/dist/components/ui/dialog/Dialog.vue.d.ts +23 -0
- package/dist/components/ui/dialog/Dialog.vue.d.ts.map +1 -0
- package/dist/components/ui/dialog/DialogClose.vue.d.ts +19 -0
- package/dist/components/ui/dialog/DialogClose.vue.d.ts.map +1 -0
- package/dist/components/ui/dialog/DialogContent.vue.d.ts +43 -0
- package/dist/components/ui/dialog/DialogContent.vue.d.ts.map +1 -0
- package/dist/components/ui/dialog/DialogFooter.vue.d.ts +25 -0
- package/dist/components/ui/dialog/DialogFooter.vue.d.ts.map +1 -0
- package/dist/components/ui/dialog/DialogHeader.vue.d.ts +29 -0
- package/dist/components/ui/dialog/DialogHeader.vue.d.ts.map +1 -0
- package/dist/components/ui/dialog/DialogTitle.vue.d.ts +23 -0
- package/dist/components/ui/dialog/DialogTitle.vue.d.ts.map +1 -0
- package/dist/components/ui/dialog/DialogTrigger.vue.d.ts +19 -0
- package/dist/components/ui/dialog/DialogTrigger.vue.d.ts.map +1 -0
- package/dist/components/ui/dialog/index.d.ts +8 -0
- package/dist/components/ui/dialog/index.d.ts.map +1 -0
- package/dist/components/ui/drawer/Drawer.vue.d.ts +35 -0
- package/dist/components/ui/drawer/Drawer.vue.d.ts.map +1 -0
- package/dist/components/ui/drawer/DrawerClose.vue.d.ts +19 -0
- package/dist/components/ui/drawer/DrawerClose.vue.d.ts.map +1 -0
- package/dist/components/ui/drawer/DrawerContent.vue.d.ts +43 -0
- package/dist/components/ui/drawer/DrawerContent.vue.d.ts.map +1 -0
- package/dist/components/ui/drawer/DrawerDescription.vue.d.ts +23 -0
- package/dist/components/ui/drawer/DrawerDescription.vue.d.ts.map +1 -0
- package/dist/components/ui/drawer/DrawerFooter.vue.d.ts +22 -0
- package/dist/components/ui/drawer/DrawerFooter.vue.d.ts.map +1 -0
- package/dist/components/ui/drawer/DrawerHeader.vue.d.ts +25 -0
- package/dist/components/ui/drawer/DrawerHeader.vue.d.ts.map +1 -0
- package/dist/components/ui/drawer/DrawerOverlay.vue.d.ts +8 -0
- package/dist/components/ui/drawer/DrawerOverlay.vue.d.ts.map +1 -0
- package/dist/components/ui/drawer/DrawerTitle.vue.d.ts +23 -0
- package/dist/components/ui/drawer/DrawerTitle.vue.d.ts.map +1 -0
- package/dist/components/ui/drawer/DrawerTrigger.vue.d.ts +19 -0
- package/dist/components/ui/drawer/DrawerTrigger.vue.d.ts.map +1 -0
- package/dist/components/ui/drawer/index.d.ts +11 -0
- package/dist/components/ui/drawer/index.d.ts.map +1 -0
- package/dist/components/ui/popover/PopoverContent.vue.d.ts +2 -2
- package/dist/components/ui/popover/PopoverContent.vue.d.ts.map +1 -1
- package/dist/components/ui/popover/PopoverTrigger.vue.d.ts.map +1 -1
- package/dist/components/ui/popover/index.d.ts +0 -1
- package/dist/components/ui/popover/index.d.ts.map +1 -1
- package/dist/components/ui/tooltip/Tooltip.vue.d.ts +23 -0
- package/dist/components/ui/tooltip/Tooltip.vue.d.ts.map +1 -0
- package/dist/components/ui/tooltip/TooltipContent.vue.d.ts +31 -0
- package/dist/components/ui/tooltip/TooltipContent.vue.d.ts.map +1 -0
- package/dist/components/ui/tooltip/TooltipTrigger.vue.d.ts +19 -0
- package/dist/components/ui/tooltip/TooltipTrigger.vue.d.ts.map +1 -0
- package/dist/components/ui/tooltip/index.d.ts +4 -0
- package/dist/components/ui/tooltip/index.d.ts.map +1 -0
- package/dist/{es-40d7aad6.mjs → es-4aa88754.mjs} +1 -1
- package/dist/{index-56b50ff8.mjs → index-ec96f88a.mjs} +99538 -96746
- package/dist/lib/layer-manager.d.ts +16 -0
- package/dist/lib/layer-manager.d.ts.map +1 -0
- package/dist/{pt-br-e6e2313f.mjs → pt-br-ec1ec185.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +233 -207
- package/dist/unnnic.umd.js +48 -44
- package/package.json +3 -2
- package/src/assets/scss/tailwind.scss +8 -0
- package/src/components/Alert/__tests__/__snapshots__/Alert.spec.js.snap +1 -1
- package/src/components/ChartFunnel/DefaultFunnel/ChartDefaultFunnelBase.vue +2 -1
- package/src/components/ChartFunnel/SvgFunnel/ChartFunnelTwoRows.vue +61 -60
- package/src/components/Checkbox/Checkbox.vue +2 -8
- package/src/components/CheckboxGroup/CheckboxGroup.vue +5 -7
- package/src/components/Chip/Chip.vue +1 -1
- package/src/components/Drawer/Drawer.vue +180 -270
- package/src/components/Drawer/__tests__/Drawer.spec.js +32 -43
- package/src/components/Drawer/__tests__/__snapshots__/Drawer.spec.js.snap +18 -19
- package/src/components/FormElement/FormElement.vue +87 -96
- package/src/components/Input/Input.vue +2 -2
- package/src/components/ModalDialog/ModalDialog.vue +64 -148
- package/src/components/ModalDialog/__tests__/ModalDialog.spec.js +11 -221
- package/src/components/ModalDialog/__tests__/__snapshots__/ModalDialog.spec.js.snap +1 -22
- package/src/components/Radio/Radio.vue +6 -12
- package/src/components/Radio/__test__/Radio.spec.js +1 -3
- package/src/components/RadioGroup/RadioGroup.vue +10 -18
- package/src/components/Switch/Switch.vue +3 -10
- package/src/components/Tab/__test__/__snapshots__/Tab.spec.js.snap +3 -1
- package/src/components/TemplatePreview/TemplatePreview.vue +25 -28
- package/src/components/TemplatePreview/TemplatePreviewModal.vue +10 -10
- package/src/components/TemplatePreview/types.d.ts +3 -3
- package/src/components/Toast/Toast.vue +4 -1
- package/src/components/ToolTip/ToolTip.vue +25 -177
- package/src/components/ToolTip/__tests__/ToolTip.spec.js +339 -61
- package/src/components/index.ts +56 -0
- package/src/components/ui/dialog/Dialog.vue +19 -0
- package/src/components/ui/dialog/DialogClose.vue +29 -0
- package/src/components/ui/dialog/DialogContent.vue +140 -0
- package/src/components/ui/dialog/DialogFooter.vue +50 -0
- package/src/components/ui/dialog/DialogHeader.vue +83 -0
- package/src/components/ui/dialog/DialogTitle.vue +38 -0
- package/src/components/ui/dialog/DialogTrigger.vue +16 -0
- package/src/components/ui/dialog/index.ts +7 -0
- package/src/components/ui/drawer/Drawer.vue +27 -0
- package/src/components/ui/drawer/DrawerClose.vue +31 -0
- package/src/components/ui/drawer/DrawerContent.vue +111 -0
- package/src/components/ui/drawer/DrawerDescription.vue +40 -0
- package/src/components/ui/drawer/DrawerFooter.vue +38 -0
- package/src/components/ui/drawer/DrawerHeader.vue +57 -0
- package/src/components/ui/drawer/DrawerOverlay.vue +33 -0
- package/src/components/ui/drawer/DrawerTitle.vue +37 -0
- package/src/components/ui/drawer/DrawerTrigger.vue +31 -0
- package/src/components/ui/drawer/index.ts +10 -0
- package/src/components/ui/popover/PopoverContent.vue +4 -2
- package/src/components/ui/popover/PopoverTrigger.vue +5 -1
- package/src/components/ui/tooltip/Tooltip.vue +21 -0
- package/src/components/ui/tooltip/TooltipContent.vue +74 -0
- package/src/components/ui/tooltip/TooltipTrigger.vue +26 -0
- package/src/components/ui/tooltip/index.ts +3 -0
- package/src/lib/layer-manager.ts +92 -0
- package/src/stories/Dialog.stories.js +832 -0
- package/src/stories/Drawer.stories.js +1 -1
- package/src/stories/DrawerNext.stories.js +611 -0
- package/src/stories/LayerManager.docs.mdx +40 -0
- package/src/stories/LayerManager.stories.js +364 -0
- package/src/stories/ModalDialog.mdx +3 -0
- package/src/stories/ModalDialog.stories.js +1 -1
- package/src/stories/TemplatePreview.stories.js +27 -27
- package/src/stories/TemplatePreviewModal.stories.js +31 -31
- package/dist/components/ui/popover/PopoverOption.vue.d.ts +0 -18
- package/dist/components/ui/popover/PopoverOption.vue.d.ts.map +0 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { type HTMLAttributes } from 'vue';
|
|
3
|
+
import { cn } from '@/lib/utils';
|
|
4
|
+
|
|
5
|
+
defineOptions({
|
|
6
|
+
name: 'UnnnicDrawerFooter',
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
const props = defineProps<{
|
|
10
|
+
class?: HTMLAttributes['class'];
|
|
11
|
+
}>();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<footer :class="cn('unnnic-drawer__footer', props.class)">
|
|
16
|
+
<slot />
|
|
17
|
+
</footer>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<style lang="scss" scoped>
|
|
21
|
+
@use '@/assets/scss/unnnic' as *;
|
|
22
|
+
|
|
23
|
+
.unnnic-drawer__footer {
|
|
24
|
+
border-top: 1px solid $unnnic-color-border-soft;
|
|
25
|
+
|
|
26
|
+
margin-top: auto;
|
|
27
|
+
padding: $unnnic-space-6;
|
|
28
|
+
|
|
29
|
+
display: flex;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
align-items: center;
|
|
32
|
+
gap: $unnnic-space-2;
|
|
33
|
+
|
|
34
|
+
> * {
|
|
35
|
+
width: 100%;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
</style>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { type HTMLAttributes } from 'vue';
|
|
3
|
+
import { cn } from '@/lib/utils';
|
|
4
|
+
import UnnnicButton from '@/components/Button/Button.vue';
|
|
5
|
+
import DrawerClose from './DrawerClose.vue';
|
|
6
|
+
|
|
7
|
+
defineOptions({
|
|
8
|
+
name: 'UnnnicDrawerHeader',
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
const props = defineProps<{
|
|
12
|
+
class?: HTMLAttributes['class'];
|
|
13
|
+
}>();
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<header :class="cn('unnnic-drawer__header', props.class)">
|
|
18
|
+
<slot />
|
|
19
|
+
|
|
20
|
+
<template v-if="$slots.close">
|
|
21
|
+
<slot
|
|
22
|
+
name="close"
|
|
23
|
+
class="unnnic-drawer__close-button"
|
|
24
|
+
/>
|
|
25
|
+
</template>
|
|
26
|
+
<template v-else>
|
|
27
|
+
<DrawerClose>
|
|
28
|
+
<UnnnicButton
|
|
29
|
+
iconCenter="close"
|
|
30
|
+
size="small"
|
|
31
|
+
type="tertiary"
|
|
32
|
+
class="unnnic-drawer__close-button"
|
|
33
|
+
/>
|
|
34
|
+
</DrawerClose>
|
|
35
|
+
</template>
|
|
36
|
+
</header>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<style lang="scss" scoped>
|
|
40
|
+
@use '@/assets/scss/unnnic' as *;
|
|
41
|
+
|
|
42
|
+
.unnnic-drawer__header {
|
|
43
|
+
display: grid;
|
|
44
|
+
align-items: center;
|
|
45
|
+
grid-template-columns: 1fr auto;
|
|
46
|
+
padding: $unnnic-space-6;
|
|
47
|
+
|
|
48
|
+
gap: $unnnic-space-1;
|
|
49
|
+
|
|
50
|
+
border-bottom: 1px solid $unnnic-color-border-soft;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.unnnic-drawer__close-button {
|
|
54
|
+
grid-column: 2 / 3;
|
|
55
|
+
grid-row: 1 / 2;
|
|
56
|
+
}
|
|
57
|
+
</style>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import type { DialogOverlayProps } from 'reka-ui';
|
|
3
|
+
import { type HTMLAttributes } from 'vue';
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core';
|
|
5
|
+
import { DrawerOverlay } from 'vaul-vue';
|
|
6
|
+
import { cn } from '@/lib/utils';
|
|
7
|
+
|
|
8
|
+
defineOptions({
|
|
9
|
+
name: 'UnnnicDrawerOverlay',
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const props = defineProps<
|
|
13
|
+
DialogOverlayProps & { class?: HTMLAttributes['class'] }
|
|
14
|
+
>();
|
|
15
|
+
|
|
16
|
+
const delegatedProps = reactiveOmit(props, 'class');
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<DrawerOverlay
|
|
21
|
+
v-bind="delegatedProps"
|
|
22
|
+
:class="cn('unnnic-drawer__overlay', props.class)"
|
|
23
|
+
/>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<style lang="scss" scoped>
|
|
27
|
+
.unnnic-drawer__overlay {
|
|
28
|
+
position: fixed;
|
|
29
|
+
inset: 0;
|
|
30
|
+
|
|
31
|
+
background: rgba(53, 57, 69, 0.65);
|
|
32
|
+
}
|
|
33
|
+
</style>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import type { DrawerTitleProps } from 'vaul-vue';
|
|
3
|
+
import { type HTMLAttributes } from 'vue';
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core';
|
|
5
|
+
import { DrawerTitle } from 'vaul-vue';
|
|
6
|
+
import { cn } from '@/lib/utils';
|
|
7
|
+
|
|
8
|
+
defineOptions({
|
|
9
|
+
name: 'UnnnicDrawerTitle',
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const props = defineProps<
|
|
13
|
+
DrawerTitleProps & { class?: HTMLAttributes['class'] }
|
|
14
|
+
>();
|
|
15
|
+
|
|
16
|
+
const delegatedProps = reactiveOmit(props, 'class');
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<DrawerTitle
|
|
21
|
+
v-bind="delegatedProps"
|
|
22
|
+
:class="cn('unnnic-drawer__title', props.class)"
|
|
23
|
+
>
|
|
24
|
+
<slot />
|
|
25
|
+
</DrawerTitle>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<style lang="scss" scoped>
|
|
29
|
+
@use '@/assets/scss/unnnic' as *;
|
|
30
|
+
|
|
31
|
+
.unnnic-drawer__title {
|
|
32
|
+
margin: 0;
|
|
33
|
+
|
|
34
|
+
color: $unnnic-color-fg-emphasized;
|
|
35
|
+
font: $unnnic-font-display-2;
|
|
36
|
+
}
|
|
37
|
+
</style>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DrawerTriggerProps } from 'vaul-vue';
|
|
3
|
+
import { DrawerTrigger } from 'vaul-vue';
|
|
4
|
+
|
|
5
|
+
defineOptions({
|
|
6
|
+
name: 'UnnnicDrawerTrigger',
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
const props = defineProps<DrawerTriggerProps>();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<DrawerTrigger
|
|
14
|
+
v-bind="props"
|
|
15
|
+
class="unnnic-drawer__trigger"
|
|
16
|
+
>
|
|
17
|
+
<slot />
|
|
18
|
+
</DrawerTrigger>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<style lang="scss" scoped>
|
|
22
|
+
@use '@/assets/scss/unnnic' as *;
|
|
23
|
+
|
|
24
|
+
.unnnic-drawer__trigger {
|
|
25
|
+
border: none;
|
|
26
|
+
background: none;
|
|
27
|
+
padding: 0;
|
|
28
|
+
margin: 0;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
}
|
|
31
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { default as Drawer } from './Drawer.vue';
|
|
2
|
+
export { default as DrawerContent } from './DrawerContent.vue';
|
|
3
|
+
export { default as DrawerDescription } from './DrawerDescription.vue';
|
|
4
|
+
export { default as DrawerFooter } from './DrawerFooter.vue';
|
|
5
|
+
export { default as DrawerHeader } from './DrawerHeader.vue';
|
|
6
|
+
export { default as DrawerOverlay } from './DrawerOverlay.vue';
|
|
7
|
+
export { default as DrawerTitle } from './DrawerTitle.vue';
|
|
8
|
+
export { default as DrawerTrigger } from './DrawerTrigger.vue';
|
|
9
|
+
export { default as DrawerClose } from './DrawerClose.vue';
|
|
10
|
+
export { DrawerPortal } from 'vaul-vue';
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
'bg-popover text-popover-foreground outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
|
|
10
10
|
)
|
|
11
11
|
"
|
|
12
|
+
:style="{ zIndex: popoverZIndex }"
|
|
12
13
|
>
|
|
13
14
|
<section :class="`unnnic-popover__content ${props.class || ''}`">
|
|
14
15
|
<component
|
|
@@ -34,6 +35,7 @@ import { computed, useSlots } from 'vue';
|
|
|
34
35
|
import { reactiveOmit } from '@vueuse/core';
|
|
35
36
|
import { PopoverContent, PopoverPortal, useForwardPropsEmits } from 'reka-ui';
|
|
36
37
|
import { cn } from '@/lib/utils';
|
|
38
|
+
import { useLayerZIndex } from '@/lib/layer-manager';
|
|
37
39
|
|
|
38
40
|
defineOptions({
|
|
39
41
|
inheritAttrs: false,
|
|
@@ -61,6 +63,8 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
|
61
63
|
|
|
62
64
|
const slots = useSlots();
|
|
63
65
|
|
|
66
|
+
const popoverZIndex = useLayerZIndex('popover');
|
|
67
|
+
|
|
64
68
|
const getComponentName = (vnode: VNode): string | undefined => {
|
|
65
69
|
const componentType = vnode.type as { name?: string; __name?: string };
|
|
66
70
|
return componentType?.name || componentType?.__name;
|
|
@@ -87,8 +91,6 @@ const footerChildren = computed(() => {
|
|
|
87
91
|
$popover-space: $unnnic-space-4;
|
|
88
92
|
|
|
89
93
|
.unnnic-popover {
|
|
90
|
-
z-index: 10000;
|
|
91
|
-
|
|
92
94
|
border-radius: $unnnic-radius-2;
|
|
93
95
|
box-shadow: $unnnic-shadow-1;
|
|
94
96
|
|
|
@@ -14,10 +14,14 @@ const props = defineProps<PopoverTriggerProps>();
|
|
|
14
14
|
</PopoverTrigger>
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
|
-
<style scoped>
|
|
17
|
+
<style lang="scss" scoped>
|
|
18
18
|
.unnnic-popover-trigger {
|
|
19
19
|
border: none;
|
|
20
20
|
background: transparent;
|
|
21
21
|
padding: 0;
|
|
22
|
+
|
|
23
|
+
& > * {
|
|
24
|
+
width: 100%;
|
|
25
|
+
}
|
|
22
26
|
}
|
|
23
27
|
</style>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { TooltipRootEmits, TooltipRootProps } from 'reka-ui';
|
|
3
|
+
import { TooltipRoot, useForwardPropsEmits } from 'reka-ui';
|
|
4
|
+
import { TooltipProvider } from 'reka-ui';
|
|
5
|
+
|
|
6
|
+
const props = defineProps<TooltipRootProps>();
|
|
7
|
+
const emits = defineEmits<TooltipRootEmits>();
|
|
8
|
+
|
|
9
|
+
const forwarded = useForwardPropsEmits(props, emits);
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<TooltipProvider
|
|
14
|
+
:delayDuration="100"
|
|
15
|
+
disableClosingTrigger
|
|
16
|
+
>
|
|
17
|
+
<TooltipRoot v-bind="forwarded">
|
|
18
|
+
<slot />
|
|
19
|
+
</TooltipRoot>
|
|
20
|
+
</TooltipProvider>
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { TooltipContentEmits, TooltipContentProps } from 'reka-ui';
|
|
3
|
+
import type { HTMLAttributes } from 'vue';
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core';
|
|
5
|
+
import {
|
|
6
|
+
TooltipArrow,
|
|
7
|
+
TooltipContent,
|
|
8
|
+
TooltipPortal,
|
|
9
|
+
useForwardPropsEmits,
|
|
10
|
+
} from 'reka-ui';
|
|
11
|
+
import { cn } from '@/lib/utils';
|
|
12
|
+
import { useLayerZIndex } from '@/lib/layer-manager';
|
|
13
|
+
|
|
14
|
+
defineOptions({
|
|
15
|
+
inheritAttrs: false,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const props = withDefaults(
|
|
19
|
+
defineProps<TooltipContentProps & { class?: HTMLAttributes['class'] }>(),
|
|
20
|
+
{
|
|
21
|
+
sideOffset: 0,
|
|
22
|
+
},
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
const emits = defineEmits<TooltipContentEmits>();
|
|
26
|
+
|
|
27
|
+
const delegatedProps = reactiveOmit(props, 'class');
|
|
28
|
+
|
|
29
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
30
|
+
const tooltipZIndex = useLayerZIndex('tooltip');
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<template>
|
|
34
|
+
<TooltipPortal>
|
|
35
|
+
<TooltipContent
|
|
36
|
+
v-bind="{ ...forwarded, ...$attrs }"
|
|
37
|
+
:class="
|
|
38
|
+
cn(
|
|
39
|
+
'tooltip__content',
|
|
40
|
+
'animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
|
|
41
|
+
props.class,
|
|
42
|
+
)
|
|
43
|
+
"
|
|
44
|
+
:style="{ zIndex: tooltipZIndex }"
|
|
45
|
+
>
|
|
46
|
+
<slot />
|
|
47
|
+
|
|
48
|
+
<TooltipArrow class="tooltip__arrow" />
|
|
49
|
+
</TooltipContent>
|
|
50
|
+
</TooltipPortal>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<style lang="scss">
|
|
54
|
+
@use '@/assets/scss/unnnic' as *;
|
|
55
|
+
|
|
56
|
+
.tooltip__content {
|
|
57
|
+
background-color: $unnnic-color-gray-900;
|
|
58
|
+
color: $unnnic-color-white;
|
|
59
|
+
border-radius: $unnnic-radius-1;
|
|
60
|
+
padding: $unnnic-space-2;
|
|
61
|
+
box-shadow: $unnnic-shadow-1;
|
|
62
|
+
font: $unnnic-font-caption-2;
|
|
63
|
+
|
|
64
|
+
overflow-wrap: break-word;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.tooltip__arrow {
|
|
68
|
+
width: 10px;
|
|
69
|
+
height: 10px;
|
|
70
|
+
background-color: $unnnic-color-gray-900;
|
|
71
|
+
fill: $unnnic-color-gray-900;
|
|
72
|
+
transform: rotate(45deg) translate(-50%, -50%);
|
|
73
|
+
}
|
|
74
|
+
</style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { TooltipTriggerProps } from 'reka-ui';
|
|
3
|
+
import { TooltipTrigger } from 'reka-ui';
|
|
4
|
+
|
|
5
|
+
const props = defineProps<TooltipTriggerProps>();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<TooltipTrigger
|
|
10
|
+
v-bind="props"
|
|
11
|
+
as="div"
|
|
12
|
+
class="unnnic-tooltip-trigger"
|
|
13
|
+
>
|
|
14
|
+
<slot />
|
|
15
|
+
</TooltipTrigger>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<style lang="scss" scoped>
|
|
19
|
+
.unnnic-tooltip-trigger {
|
|
20
|
+
display: inline-block;
|
|
21
|
+
|
|
22
|
+
& > * {
|
|
23
|
+
width: 100%;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
</style>
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { onBeforeUnmount, onMounted, ref, type Ref } from 'vue';
|
|
2
|
+
|
|
3
|
+
export const layerScale = {
|
|
4
|
+
hide: -1,
|
|
5
|
+
base: 0,
|
|
6
|
+
drawer: 1000,
|
|
7
|
+
modal: 1100,
|
|
8
|
+
popover: 1200,
|
|
9
|
+
tooltip: 1300,
|
|
10
|
+
toast: 1400,
|
|
11
|
+
} as const;
|
|
12
|
+
|
|
13
|
+
export type LayerToken = keyof typeof layerScale;
|
|
14
|
+
|
|
15
|
+
const DEFAULT_STEP = 5;
|
|
16
|
+
|
|
17
|
+
const activeValues: Record<LayerToken, number[]> = {
|
|
18
|
+
hide: [],
|
|
19
|
+
base: [],
|
|
20
|
+
drawer: [],
|
|
21
|
+
modal: [],
|
|
22
|
+
popover: [],
|
|
23
|
+
tooltip: [],
|
|
24
|
+
toast: [],
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
interface Allocation {
|
|
28
|
+
id: symbol;
|
|
29
|
+
type: LayerToken;
|
|
30
|
+
value: number;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const allocations = new Map<symbol, Allocation>();
|
|
34
|
+
|
|
35
|
+
function acquire(type: LayerToken): Allocation {
|
|
36
|
+
const id = Symbol('layer');
|
|
37
|
+
const list = activeValues[type];
|
|
38
|
+
const lastValue = list.length ? list[list.length - 1] : layerScale[type];
|
|
39
|
+
const value = lastValue + DEFAULT_STEP;
|
|
40
|
+
const allocation: Allocation = { id, type, value };
|
|
41
|
+
|
|
42
|
+
list.push(value);
|
|
43
|
+
allocations.set(id, allocation);
|
|
44
|
+
|
|
45
|
+
return allocation;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function release(id: symbol) {
|
|
49
|
+
const allocation = allocations.get(id);
|
|
50
|
+
if (!allocation) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
allocations.delete(id);
|
|
55
|
+
const list = activeValues[allocation.type];
|
|
56
|
+
const index = list.indexOf(allocation.value);
|
|
57
|
+
|
|
58
|
+
if (index !== -1) {
|
|
59
|
+
list.splice(index, 1);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface LayerZIndexOptions {
|
|
64
|
+
offset?: number;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function useLayerZIndex(
|
|
68
|
+
type: LayerToken = 'base',
|
|
69
|
+
options?: LayerZIndexOptions,
|
|
70
|
+
): Ref<number> {
|
|
71
|
+
const initialValue = layerScale[type] + (options?.offset ?? 0);
|
|
72
|
+
const zIndex = ref(initialValue);
|
|
73
|
+
|
|
74
|
+
let allocationId: symbol | null = null;
|
|
75
|
+
|
|
76
|
+
const allocate = () => {
|
|
77
|
+
const allocation = acquire(type);
|
|
78
|
+
allocationId = allocation.id;
|
|
79
|
+
zIndex.value = allocation.value + (options?.offset ?? 0);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
onMounted(allocate);
|
|
83
|
+
|
|
84
|
+
onBeforeUnmount(() => {
|
|
85
|
+
if (allocationId) {
|
|
86
|
+
release(allocationId);
|
|
87
|
+
allocationId = null;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
return zIndex;
|
|
92
|
+
}
|