@weni/unnnic-system 3.14.0-alpha-teleports.0 → 3.14.0

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.
Files changed (77) hide show
  1. package/README.md +1 -9
  2. package/dist/{es-0d53b5b2.mjs → es-91ae9eed.mjs} +1 -1
  3. package/dist/{index-d7070de8.mjs → index-3b503557.mjs} +26122 -28965
  4. package/dist/index.d.ts +1485 -4826
  5. package/dist/{pt-br-bf4e1f97.mjs → pt-br-9553a558.mjs} +1 -1
  6. package/dist/style.css +1 -1
  7. package/dist/unnnic.mjs +204 -232
  8. package/dist/unnnic.umd.js +44 -48
  9. package/package.json +2 -3
  10. package/src/assets/scss/tailwind.scss +0 -8
  11. package/src/components/Alert/__tests__/__snapshots__/Alert.spec.js.snap +1 -1
  12. package/src/components/ChartFunnel/DefaultFunnel/ChartDefaultFunnelBase.vue +1 -2
  13. package/src/components/ChartFunnel/SvgFunnel/ChartFunnelTwoRows.vue +60 -61
  14. package/src/components/CheckboxGroup/CheckboxGroup.vue +7 -5
  15. package/src/components/Chip/Chip.vue +1 -1
  16. package/src/components/DatePicker/DatePicker.vue +1 -10
  17. package/src/components/Drawer/Drawer.vue +270 -180
  18. package/src/components/Drawer/__tests__/Drawer.spec.js +43 -32
  19. package/src/components/Drawer/__tests__/__snapshots__/Drawer.spec.js.snap +19 -18
  20. package/src/components/FormElement/FormElement.vue +96 -87
  21. package/src/components/InputDatePicker/InputDatePicker.vue +73 -68
  22. package/src/components/InputDatePicker/__test__/InputDatePicker.spec.js +24 -31
  23. package/src/components/ModalDialog/ModalDialog.vue +154 -63
  24. package/src/components/ModalDialog/__tests__/ModalDialog.spec.js +210 -30
  25. package/src/components/ModalDialog/__tests__/__snapshots__/ModalDialog.spec.js.snap +22 -1
  26. package/src/components/Radio/Radio.vue +12 -6
  27. package/src/components/Radio/__test__/Radio.spec.js +3 -1
  28. package/src/components/RadioGroup/RadioGroup.vue +18 -10
  29. package/src/components/Select/__tests__/SelectItem.spec.js +35 -15
  30. package/src/components/Switch/Switch.vue +10 -3
  31. package/src/components/Tab/__test__/__snapshots__/Tab.spec.js.snap +1 -3
  32. package/src/components/TemplatePreview/TemplatePreview.vue +28 -25
  33. package/src/components/TemplatePreview/TemplatePreviewModal.vue +10 -10
  34. package/src/components/TemplatePreview/types.d.ts +3 -3
  35. package/src/components/Toast/Toast.vue +1 -4
  36. package/src/components/Toast/ToastManager.ts +1 -4
  37. package/src/components/Toast/__tests__/ToastManager.spec.js +6 -10
  38. package/src/components/ToolTip/ToolTip.vue +177 -25
  39. package/src/components/ToolTip/__tests__/ToolTip.spec.js +61 -339
  40. package/src/components/index.ts +0 -56
  41. package/src/components/ui/popover/PopoverContent.vue +4 -7
  42. package/src/components/ui/popover/PopoverTrigger.vue +1 -5
  43. package/src/index.ts +2 -9
  44. package/src/stories/Drawer.stories.js +1 -1
  45. package/src/stories/ModalDialog.mdx +0 -3
  46. package/src/stories/ModalDialog.stories.js +1 -96
  47. package/src/stories/TemplatePreview.stories.js +27 -27
  48. package/src/stories/TemplatePreviewModal.stories.js +31 -31
  49. package/src/components/ui/dialog/Dialog.vue +0 -19
  50. package/src/components/ui/dialog/DialogClose.vue +0 -29
  51. package/src/components/ui/dialog/DialogContent.vue +0 -140
  52. package/src/components/ui/dialog/DialogFooter.vue +0 -50
  53. package/src/components/ui/dialog/DialogHeader.vue +0 -83
  54. package/src/components/ui/dialog/DialogTitle.vue +0 -38
  55. package/src/components/ui/dialog/DialogTrigger.vue +0 -16
  56. package/src/components/ui/dialog/index.ts +0 -7
  57. package/src/components/ui/drawer/Drawer.vue +0 -27
  58. package/src/components/ui/drawer/DrawerClose.vue +0 -31
  59. package/src/components/ui/drawer/DrawerContent.vue +0 -113
  60. package/src/components/ui/drawer/DrawerDescription.vue +0 -40
  61. package/src/components/ui/drawer/DrawerFooter.vue +0 -38
  62. package/src/components/ui/drawer/DrawerHeader.vue +0 -57
  63. package/src/components/ui/drawer/DrawerOverlay.vue +0 -33
  64. package/src/components/ui/drawer/DrawerTitle.vue +0 -37
  65. package/src/components/ui/drawer/DrawerTrigger.vue +0 -31
  66. package/src/components/ui/drawer/index.ts +0 -10
  67. package/src/components/ui/tooltip/Tooltip.vue +0 -21
  68. package/src/components/ui/tooltip/TooltipContent.vue +0 -77
  69. package/src/components/ui/tooltip/TooltipTrigger.vue +0 -24
  70. package/src/components/ui/tooltip/index.ts +0 -3
  71. package/src/lib/__tests__/teleport-target.spec.ts +0 -73
  72. package/src/lib/layer-manager.ts +0 -64
  73. package/src/lib/teleport-target.ts +0 -46
  74. package/src/stories/Dialog.stories.js +0 -832
  75. package/src/stories/DrawerNext.stories.js +0 -611
  76. package/src/stories/LayerManager.docs.mdx +0 -40
  77. package/src/stories/LayerManager.stories.js +0 -407
@@ -1,140 +0,0 @@
1
- <script setup lang="ts">
2
- import type { DialogContentEmits, DialogContentProps } from 'reka-ui';
3
- import type { HTMLAttributes, Component } from 'vue';
4
- import { computed, h } from 'vue';
5
- import { reactiveOmit } from '@vueuse/core';
6
- import {
7
- DialogContent,
8
- DialogOverlay,
9
- DialogPortal,
10
- useForwardPropsEmits,
11
- } from 'reka-ui';
12
- import { cn } from '@/lib/utils';
13
- import { useLayerZIndex } from '@/lib/layer-manager';
14
- import { useTeleportTarget } from '@/lib/teleport-target';
15
-
16
- defineOptions({
17
- name: 'UnnnicDialogContent',
18
- });
19
-
20
- const props = withDefaults(
21
- defineProps<
22
- DialogContentProps & {
23
- parentClass?: HTMLAttributes['class'];
24
- class?: HTMLAttributes['class'];
25
- size?: 'small' | 'medium' | 'large';
26
- }
27
- >(),
28
- {
29
- size: 'medium',
30
- parentClass: '', // This class should be temporary, to be discontinued with the ModalDialog component
31
- class: '',
32
- },
33
- );
34
- const emits = defineEmits<DialogContentEmits>();
35
-
36
- const delegatedProps = reactiveOmit(props, 'class', 'parentClass');
37
-
38
- const forwarded = useForwardPropsEmits(delegatedProps, emits);
39
-
40
- const overlayZIndex = useLayerZIndex({ offset: -2 });
41
- const modalZIndex = useLayerZIndex();
42
- const portalTarget = useTeleportTarget();
43
-
44
- const contentClasses = computed(() =>
45
- cn(
46
- 'unnnic-dialog-content',
47
- `unnnic-dialog-content--size-${props.size}`,
48
- 'duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]',
49
- props.class,
50
- ),
51
- );
52
-
53
- // This component is used to wrap the DialogContent component in a section if the parentClass is provided
54
- // This is a temporary solution, to be discontinued with the ModalDialog component
55
- const ConditionalWrapper: Component = (_, { slots }) => {
56
- const content = slots.default?.();
57
- return props.parentClass
58
- ? h('section', { class: props.parentClass }, content)
59
- : content;
60
- };
61
- </script>
62
-
63
- <template>
64
- <DialogPortal :to="portalTarget">
65
- <DialogOverlay
66
- class="unnnic-dialog-overlay data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
67
- :style="{ zIndex: overlayZIndex }"
68
- />
69
-
70
- <ConditionalWrapper>
71
- <DialogContent
72
- v-bind="forwarded"
73
- :class="contentClasses"
74
- :style="{ zIndex: modalZIndex }"
75
- >
76
- <slot />
77
- </DialogContent>
78
- </ConditionalWrapper>
79
- </DialogPortal>
80
- </template>
81
-
82
- <style lang="scss" scoped>
83
- @use '@/assets/scss/unnnic' as *;
84
-
85
- .unnnic-dialog-overlay {
86
- position: fixed;
87
- top: 0;
88
- left: 0;
89
-
90
- width: 100vw;
91
- height: 100vh;
92
- background: rgba(53, 57, 69, 0.5);
93
- }
94
-
95
- .unnnic-dialog-content {
96
- position: fixed;
97
- top: 50%;
98
- left: 50%;
99
-
100
- transform: translate(-50%, -50%);
101
-
102
- width: 100%;
103
- max-height: calc(100% - $unnnic-space-20);
104
-
105
- display: flex;
106
- flex-direction: column;
107
-
108
- box-shadow: $unnnic-shadow-2;
109
- border-radius: $unnnic-radius-4;
110
- background-color: $unnnic-color-bg-base;
111
-
112
- &--size-small {
113
- max-width: 360px;
114
- }
115
-
116
- &--size-medium {
117
- max-width: 560px;
118
- }
119
-
120
- &--size-large {
121
- max-width: 800px;
122
- }
123
-
124
- > * {
125
- &::-webkit-scrollbar {
126
- width: $unnnic-spacing-inline-nano;
127
- }
128
-
129
- &::-webkit-scrollbar-thumb {
130
- background: $unnnic-color-neutral-cleanest;
131
- border-radius: $unnnic-border-radius-pill;
132
- }
133
-
134
- &::-webkit-scrollbar-track {
135
- background: $unnnic-color-neutral-soft;
136
- border-radius: $unnnic-border-radius-pill;
137
- }
138
- }
139
- }
140
- </style>
@@ -1,50 +0,0 @@
1
- <script setup lang="ts">
2
- import type { HTMLAttributes } from 'vue';
3
- import { cn } from '@/lib/utils';
4
-
5
- defineOptions({
6
- name: 'UnnnicDialogFooter',
7
- });
8
-
9
- const props = withDefaults(
10
- defineProps<{ class?: HTMLAttributes['class']; divider?: boolean }>(),
11
- {
12
- divider: true,
13
- },
14
- );
15
- </script>
16
-
17
- <template>
18
- <footer
19
- :class="
20
- cn(
21
- 'unnnic-dialog-footer',
22
- { 'unnnic-dialog-footer--with-divider': props.divider },
23
- props.class,
24
- )
25
- "
26
- >
27
- <slot />
28
- </footer>
29
- </template>
30
-
31
- <style lang="scss" scoped>
32
- @use '@/assets/scss/unnnic' as *;
33
-
34
- .unnnic-dialog-footer {
35
- display: flex;
36
- justify-content: center;
37
- align-items: center;
38
- gap: $unnnic-space-2;
39
-
40
- padding: $unnnic-space-6;
41
-
42
- &--with-divider {
43
- border-top: 1px solid $unnnic-color-border-soft;
44
- }
45
-
46
- > * {
47
- width: 100%;
48
- }
49
- }
50
- </style>
@@ -1,83 +0,0 @@
1
- <script setup lang="ts">
2
- import type { HTMLAttributes } from 'vue';
3
- import { cn } from '@/lib/utils';
4
- import UnnnicButton from '@/components/Button/Button.vue';
5
- import DialogClose from './DialogClose.vue';
6
- import UnnnicIcon, { SchemeColor } from '@/components/Icon.vue';
7
-
8
- defineOptions({
9
- name: 'UnnnicDialogHeader',
10
- });
11
-
12
- const props = withDefaults(
13
- defineProps<{
14
- class?: HTMLAttributes['class'];
15
- divider?: boolean;
16
- type?: 'default' | 'success' | 'warning' | 'attention';
17
- closeButton?: boolean;
18
- }>(),
19
- {
20
- divider: true,
21
- closeButton: true,
22
- type: 'default',
23
- },
24
- );
25
-
26
- const iconsMapper = {
27
- default: { icon: '', scheme: '' as SchemeColor },
28
- success: { icon: 'check_circle', scheme: 'aux-green-500' as SchemeColor },
29
- warning: { icon: 'warning', scheme: 'aux-red-500' as SchemeColor },
30
- attention: { icon: 'error', scheme: 'aux-yellow-500' as SchemeColor },
31
- };
32
- </script>
33
-
34
- <template>
35
- <header
36
- :class="
37
- cn(
38
- 'unnnic-dialog-header',
39
- { 'unnnic-dialog-header--with-divider': props.divider },
40
- props.class,
41
- )
42
- "
43
- >
44
- <UnnnicIcon
45
- v-if="iconsMapper[props.type]?.icon"
46
- :icon="iconsMapper[props.type]?.icon"
47
- :scheme="iconsMapper[props.type]?.scheme"
48
- size="md"
49
- />
50
- <slot />
51
-
52
- <DialogClose
53
- v-if="props.closeButton"
54
- class="unnnic-dialog-header__close"
55
- >
56
- <UnnnicButton
57
- type="tertiary"
58
- iconCenter="close"
59
- size="small"
60
- />
61
- </DialogClose>
62
- </header>
63
- </template>
64
-
65
- <style lang="scss" scoped>
66
- @use '@/assets/scss/unnnic' as *;
67
-
68
- .unnnic-dialog-header {
69
- display: flex;
70
- align-items: center;
71
- gap: $unnnic-space-2;
72
-
73
- padding: $unnnic-space-6;
74
-
75
- &--with-divider {
76
- border-bottom: 1px solid $unnnic-color-border-soft;
77
- }
78
-
79
- &__close {
80
- margin-left: auto;
81
- }
82
- }
83
- </style>
@@ -1,38 +0,0 @@
1
- <script setup lang="ts">
2
- import type { DialogTitleProps } from 'reka-ui';
3
- import type { HTMLAttributes } from 'vue';
4
- import { reactiveOmit } from '@vueuse/core';
5
- import { DialogTitle, useForwardProps } from 'reka-ui';
6
- import { cn } from '@/lib/utils';
7
-
8
- defineOptions({
9
- name: 'UnnnicDialogTitle',
10
- });
11
-
12
- const props = defineProps<
13
- DialogTitleProps & { class?: HTMLAttributes['class'] }
14
- >();
15
-
16
- const delegatedProps = reactiveOmit(props, 'class');
17
-
18
- const forwardedProps = useForwardProps(delegatedProps);
19
- </script>
20
-
21
- <template>
22
- <DialogTitle
23
- v-bind="forwardedProps"
24
- :class="cn('unnnic-dialog-title', props.class)"
25
- >
26
- <slot />
27
- </DialogTitle>
28
- </template>
29
-
30
- <style lang="scss" scoped>
31
- @use '@/assets/scss/unnnic' as *;
32
-
33
- .unnnic-dialog-title {
34
- font: $unnnic-font-display-2;
35
- color: $unnnic-color-fg-emphasized;
36
- margin: 0;
37
- }
38
- </style>
@@ -1,16 +0,0 @@
1
- <script setup lang="ts">
2
- import type { DialogTriggerProps } from 'reka-ui';
3
- import { DialogTrigger } from 'reka-ui';
4
-
5
- defineOptions({
6
- name: 'UnnnicDialogTrigger',
7
- });
8
-
9
- const props = defineProps<DialogTriggerProps>();
10
- </script>
11
-
12
- <template>
13
- <DialogTrigger v-bind="props">
14
- <slot />
15
- </DialogTrigger>
16
- </template>
@@ -1,7 +0,0 @@
1
- export { default as Dialog } from './Dialog.vue';
2
- export { default as DialogClose } from './DialogClose.vue';
3
- export { default as DialogContent } from './DialogContent.vue';
4
- export { default as DialogFooter } from './DialogFooter.vue';
5
- export { default as DialogHeader } from './DialogHeader.vue';
6
- export { default as DialogTitle } from './DialogTitle.vue';
7
- export { default as DialogTrigger } from './DialogTrigger.vue';
@@ -1,27 +0,0 @@
1
- <script lang="ts" setup>
2
- import type { DrawerRootEmits, DrawerRootProps } from 'vaul-vue';
3
- import { useForwardPropsEmits } from 'reka-ui';
4
- import { DrawerRoot } from 'vaul-vue';
5
-
6
- defineOptions({
7
- name: 'UnnnicDrawerNext',
8
- });
9
-
10
- const props = withDefaults(defineProps<DrawerRootProps>(), {
11
- shouldScaleBackground: true,
12
- });
13
-
14
- const emits = defineEmits<DrawerRootEmits>();
15
-
16
- const forwarded = useForwardPropsEmits(props, emits);
17
- </script>
18
-
19
- <template>
20
- <DrawerRoot
21
- v-bind="forwarded"
22
- direction="right"
23
- handleOnly
24
- >
25
- <slot />
26
- </DrawerRoot>
27
- </template>
@@ -1,31 +0,0 @@
1
- <script setup lang="ts">
2
- import type { DrawerCloseProps } from 'vaul-vue';
3
- import { DrawerClose } from 'vaul-vue';
4
-
5
- defineOptions({
6
- name: 'UnnnicDrawerClose',
7
- });
8
-
9
- const props = withDefaults(defineProps<DrawerCloseProps>(), {
10
- asChild: true,
11
- });
12
- </script>
13
-
14
- <template>
15
- <DrawerClose
16
- v-bind="props"
17
- class="unnnic-drawer__close"
18
- >
19
- <slot />
20
- </DrawerClose>
21
- </template>
22
-
23
- <style lang="scss" scoped>
24
- @use '@/assets/scss/unnnic' as *;
25
-
26
- .unnnic-drawer__close {
27
- > * {
28
- width: 100%;
29
- }
30
- }
31
- </style>
@@ -1,113 +0,0 @@
1
- <script lang="ts" setup>
2
- import type { DialogContentEmits, DialogContentProps } from 'reka-ui';
3
- import { type HTMLAttributes } from 'vue';
4
- import { reactiveOmit } from '@vueuse/core';
5
- import { useForwardPropsEmits } from 'reka-ui';
6
- import { DrawerContent, DrawerPortal } from 'vaul-vue';
7
- import { cn } from '@/lib/utils';
8
- import { useLayerZIndex } from '@/lib/layer-manager';
9
- import { useTeleportTarget } from '@/lib/teleport-target';
10
- import DrawerOverlay from './DrawerOverlay.vue';
11
-
12
- defineOptions({
13
- name: 'UnnnicDrawerContent',
14
- });
15
-
16
- const props = withDefaults(
17
- defineProps<
18
- DialogContentProps & {
19
- class?: HTMLAttributes['class'];
20
- size?: 'medium' | 'large' | 'extra-large' | 'giant';
21
- showOverlay?: boolean;
22
- }
23
- >(),
24
- {
25
- class: undefined,
26
- size: 'medium',
27
- showOverlay: true,
28
- },
29
- );
30
- const emits = defineEmits<DialogContentEmits>();
31
-
32
- const delegatedProps = reactiveOmit(props, 'class');
33
- const forwardedProps = useForwardPropsEmits(delegatedProps, emits);
34
-
35
- const layerZIndex = useLayerZIndex();
36
- const portalTarget = useTeleportTarget();
37
- </script>
38
-
39
- <template>
40
- <DrawerPortal :to="portalTarget">
41
- <DrawerOverlay
42
- v-if="showOverlay"
43
- :style="{ zIndex: layerZIndex - 2 }"
44
- />
45
- <DrawerContent
46
- v-bind="forwardedProps"
47
- :class="
48
- cn(
49
- 'unnnic-drawer__content',
50
- `unnnic-drawer__content--${props.size}`,
51
- props.class,
52
- )
53
- "
54
- :style="{
55
- '--initial-transform': 'calc(100% + 8px)',
56
- zIndex: layerZIndex,
57
- }"
58
- >
59
- <slot />
60
- </DrawerContent>
61
- </DrawerPortal>
62
- </template>
63
-
64
- <style lang="scss" scoped>
65
- @use '@/assets/scss/unnnic' as *;
66
-
67
- $drawer-space: $unnnic-space-2;
68
-
69
- .unnnic-drawer__content {
70
- -webkit-user-select: unset;
71
- user-select: unset;
72
- will-change: unset;
73
-
74
- &::after {
75
- display: none;
76
- }
77
-
78
- position: fixed;
79
- top: $drawer-space;
80
- right: $drawer-space;
81
-
82
- display: flex;
83
- flex-direction: column;
84
-
85
- height: calc(100% - $drawer-space * 2);
86
-
87
- border-radius: $unnnic-radius-4;
88
- border: 1px solid $unnnic-color-border-soft;
89
- background-color: $unnnic-color-bg-base;
90
-
91
- &--medium {
92
- width: calc(100% / 3);
93
- }
94
-
95
- &--large {
96
- width: 50%;
97
- }
98
-
99
- &--extra-large {
100
- width: 66%;
101
- }
102
-
103
- &--giant {
104
- width: 75%;
105
- }
106
-
107
- &__body {
108
- overflow-y: auto;
109
- padding: $unnnic-space-6;
110
- flex: 1 0 0;
111
- }
112
- }
113
- </style>
@@ -1,40 +0,0 @@
1
- <script lang="ts" setup>
2
- import type { DrawerDescriptionProps } from 'vaul-vue';
3
- import type { HTMLAttributes } from 'vue';
4
- import { reactiveOmit } from '@vueuse/core';
5
- import { DrawerDescription } from 'vaul-vue';
6
- import { cn } from '@/lib/utils';
7
-
8
- defineOptions({
9
- name: 'UnnnicDrawerDescription',
10
- });
11
-
12
- const props = defineProps<
13
- DrawerDescriptionProps & { class?: HTMLAttributes['class'] }
14
- >();
15
-
16
- const delegatedProps = reactiveOmit(props, 'class');
17
- </script>
18
-
19
- <template>
20
- <DrawerDescription
21
- v-bind="delegatedProps"
22
- :class="cn('unnnic-drawer__description', props.class)"
23
- >
24
- <slot />
25
- </DrawerDescription>
26
- </template>
27
-
28
- <style lang="scss" scoped>
29
- @use '@/assets/scss/unnnic' as *;
30
-
31
- .unnnic-drawer__description {
32
- margin: 0;
33
-
34
- font: $unnnic-font-body;
35
- color: $unnnic-color-fg-base;
36
-
37
- grid-column: 1 / 3;
38
- grid-row: 2 / 3;
39
- }
40
- </style>
@@ -1,38 +0,0 @@
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>
@@ -1,57 +0,0 @@
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>
@@ -1,33 +0,0 @@
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>