@weni/unnnic-system 3.5.3-alpha.0 → 3.5.3-alpha.2

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 (43) hide show
  1. package/dist/components/ModalDialog/ModalDialog.vue.d.ts +194 -29
  2. package/dist/components/ModalDialog/ModalDialog.vue.d.ts.map +1 -1
  3. package/dist/components/index.d.ts +862 -78
  4. package/dist/components/index.d.ts.map +1 -1
  5. package/dist/components/ui/dialog/Dialog.vue.d.ts +23 -0
  6. package/dist/components/ui/dialog/Dialog.vue.d.ts.map +1 -0
  7. package/dist/components/ui/dialog/DialogClose.vue.d.ts +19 -0
  8. package/dist/components/ui/dialog/DialogClose.vue.d.ts.map +1 -0
  9. package/dist/components/ui/dialog/DialogContent.vue.d.ts +40 -0
  10. package/dist/components/ui/dialog/DialogContent.vue.d.ts.map +1 -0
  11. package/dist/components/ui/dialog/DialogFooter.vue.d.ts +25 -0
  12. package/dist/components/ui/dialog/DialogFooter.vue.d.ts.map +1 -0
  13. package/dist/components/ui/dialog/DialogHeader.vue.d.ts +29 -0
  14. package/dist/components/ui/dialog/DialogHeader.vue.d.ts.map +1 -0
  15. package/dist/components/ui/dialog/DialogTitle.vue.d.ts +23 -0
  16. package/dist/components/ui/dialog/DialogTitle.vue.d.ts.map +1 -0
  17. package/dist/components/ui/dialog/DialogTrigger.vue.d.ts +19 -0
  18. package/dist/components/ui/dialog/DialogTrigger.vue.d.ts.map +1 -0
  19. package/dist/components/ui/dialog/index.d.ts +8 -0
  20. package/dist/components/ui/dialog/index.d.ts.map +1 -0
  21. package/dist/{es-1c7253d4.mjs → es-dea507ea.mjs} +1 -1
  22. package/dist/{index-ff0a404c.mjs → index-25e40316.mjs} +10953 -10270
  23. package/dist/{pt-br-316f1627.mjs → pt-br-8720ec19.mjs} +1 -1
  24. package/dist/style.css +1 -1
  25. package/dist/unnnic.mjs +185 -171
  26. package/dist/unnnic.umd.js +43 -39
  27. package/package.json +1 -1
  28. package/src/assets/scss/scheme-colors.scss +82 -95
  29. package/src/assets/scss/tailwind.scss +8 -0
  30. package/src/components/ModalDialog/ModalDialog.vue +60 -146
  31. package/src/components/ModalDialog/__tests__/__snapshots__/ModalDialog.spec.js.snap +1 -22
  32. package/src/components/index.ts +28 -0
  33. package/src/components/ui/dialog/Dialog.vue +15 -0
  34. package/src/components/ui/dialog/DialogClose.vue +25 -0
  35. package/src/components/ui/dialog/DialogContent.vue +114 -0
  36. package/src/components/ui/dialog/DialogFooter.vue +46 -0
  37. package/src/components/ui/dialog/DialogHeader.vue +78 -0
  38. package/src/components/ui/dialog/DialogTitle.vue +34 -0
  39. package/src/components/ui/dialog/DialogTrigger.vue +12 -0
  40. package/src/components/ui/dialog/index.ts +7 -0
  41. package/src/stories/Dialog.stories.js +832 -0
  42. package/src/stories/ModalDialog.mdx +3 -0
  43. package/src/stories/ModalDialog.stories.js +1 -1
@@ -0,0 +1,114 @@
1
+ <script setup lang="ts">
2
+ import type { DialogContentEmits, DialogContentProps } from 'reka-ui';
3
+ import type { HTMLAttributes } from 'vue';
4
+ import { reactiveOmit } from '@vueuse/core';
5
+ import {
6
+ DialogContent,
7
+ DialogOverlay,
8
+ DialogPortal,
9
+ useForwardPropsEmits,
10
+ } from 'reka-ui';
11
+ import { cn } from '@/lib/utils';
12
+
13
+ const props = withDefaults(
14
+ defineProps<
15
+ DialogContentProps & {
16
+ class?: HTMLAttributes['class'];
17
+ size?: 'small' | 'medium' | 'large';
18
+ }
19
+ >(),
20
+ {
21
+ size: 'medium',
22
+ },
23
+ );
24
+ const emits = defineEmits<DialogContentEmits>();
25
+
26
+ const delegatedProps = reactiveOmit(props, 'class');
27
+
28
+ const forwarded = useForwardPropsEmits(delegatedProps, emits);
29
+ </script>
30
+
31
+ <template>
32
+ <DialogPortal>
33
+ <DialogOverlay
34
+ 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"
35
+ />
36
+ <DialogContent
37
+ v-bind="forwarded"
38
+ :class="
39
+ cn(
40
+ 'unnnic-dialog-content',
41
+ `unnnic-dialog-content--size-${props.size}`,
42
+ '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%]',
43
+
44
+ props.class,
45
+ )
46
+ "
47
+ >
48
+ <slot />
49
+ </DialogContent>
50
+ </DialogPortal>
51
+ </template>
52
+
53
+ <style lang="scss" scoped>
54
+ @use '@/assets/scss/unnnic' as *;
55
+
56
+ .unnnic-dialog-overlay {
57
+ position: fixed;
58
+ top: 0;
59
+ left: 0;
60
+ z-index: 9999;
61
+
62
+ width: 100vw;
63
+ height: 100vh;
64
+ background: rgba(53, 57, 69, 0.5);
65
+ }
66
+
67
+ .unnnic-dialog-content {
68
+ z-index: 10000;
69
+
70
+ position: fixed;
71
+ top: 50%;
72
+ left: 50%;
73
+
74
+ transform: translate(-50%, -50%);
75
+
76
+ width: 100%;
77
+ max-height: calc(100% - $unnnic-space-20);
78
+
79
+ display: flex;
80
+ flex-direction: column;
81
+
82
+ box-shadow: $unnnic-shadow-2;
83
+ border-radius: $unnnic-radius-4;
84
+ background-color: $unnnic-color-bg-base;
85
+
86
+ &--size-small {
87
+ max-width: 360px;
88
+ }
89
+
90
+ &--size-medium {
91
+ max-width: 560px;
92
+ }
93
+
94
+ &--size-large {
95
+ max-width: 800px;
96
+ }
97
+
98
+ > * {
99
+ &::-webkit-scrollbar {
100
+ width: $unnnic-spacing-inline-nano;
101
+ }
102
+
103
+ &::-webkit-scrollbar-thumb {
104
+ background: $unnnic-color-neutral-cleanest;
105
+ border-radius: $unnnic-border-radius-pill;
106
+ }
107
+
108
+ &::-webkit-scrollbar-track {
109
+ background: $unnnic-color-neutral-soft;
110
+ border-radius: $unnnic-border-radius-pill;
111
+ }
112
+ }
113
+ }
114
+ </style>
@@ -0,0 +1,46 @@
1
+ <script setup lang="ts">
2
+ import type { HTMLAttributes } from 'vue';
3
+ import { cn } from '@/lib/utils';
4
+
5
+ const props = withDefaults(
6
+ defineProps<{ class?: HTMLAttributes['class']; divider?: boolean }>(),
7
+ {
8
+ divider: true,
9
+ },
10
+ );
11
+ </script>
12
+
13
+ <template>
14
+ <footer
15
+ :class="
16
+ cn(
17
+ 'unnnic-dialog-footer',
18
+ { 'unnnic-dialog-footer--with-divider': props.divider },
19
+ props.class,
20
+ )
21
+ "
22
+ >
23
+ <slot />
24
+ </footer>
25
+ </template>
26
+
27
+ <style lang="scss" scoped>
28
+ @use '@/assets/scss/unnnic' as *;
29
+
30
+ .unnnic-dialog-footer {
31
+ display: flex;
32
+ justify-content: center;
33
+ align-items: center;
34
+ gap: $unnnic-space-2;
35
+
36
+ padding: $unnnic-space-6;
37
+
38
+ &--with-divider {
39
+ border-top: 1px solid $unnnic-color-border-soft;
40
+ }
41
+
42
+ > * {
43
+ width: 100%;
44
+ }
45
+ }
46
+ </style>
@@ -0,0 +1,78 @@
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
+ const props = withDefaults(
9
+ defineProps<{
10
+ class?: HTMLAttributes['class'];
11
+ divider?: boolean;
12
+ type?: 'default' | 'success' | 'warning' | 'attention';
13
+ closeButton?: boolean;
14
+ }>(),
15
+ {
16
+ divider: true,
17
+ closeButton: true,
18
+ type: 'default',
19
+ },
20
+ );
21
+
22
+ const iconsMapper = {
23
+ default: { icon: '', scheme: '' as SchemeColor },
24
+ success: { icon: 'check_circle', scheme: 'aux-green-500' as SchemeColor },
25
+ warning: { icon: 'warning', scheme: 'aux-red-500' as SchemeColor },
26
+ attention: { icon: 'error', scheme: 'aux-yellow-500' as SchemeColor },
27
+ };
28
+ </script>
29
+
30
+ <template>
31
+ <header
32
+ :class="
33
+ cn(
34
+ 'unnnic-dialog-header',
35
+ { 'unnnic-dialog-header--with-divider': props.divider },
36
+ props.class,
37
+ )
38
+ "
39
+ >
40
+ <UnnnicIcon
41
+ v-if="iconsMapper[props.type]?.icon"
42
+ :icon="iconsMapper[props.type]?.icon"
43
+ :scheme="iconsMapper[props.type]?.scheme"
44
+ size="md"
45
+ />
46
+ <slot />
47
+
48
+ <DialogClose
49
+ v-if="props.closeButton"
50
+ class="unnnic-dialog-header__close"
51
+ >
52
+ <UnnnicButton
53
+ type="tertiary"
54
+ iconCenter="close"
55
+ />
56
+ </DialogClose>
57
+ </header>
58
+ </template>
59
+
60
+ <style lang="scss" scoped>
61
+ @use '@/assets/scss/unnnic' as *;
62
+
63
+ .unnnic-dialog-header {
64
+ display: flex;
65
+ align-items: center;
66
+ gap: $unnnic-space-2;
67
+
68
+ padding: $unnnic-space-6;
69
+
70
+ &--with-divider {
71
+ border-bottom: 1px solid $unnnic-color-border-soft;
72
+ }
73
+
74
+ &__close {
75
+ margin-left: auto;
76
+ }
77
+ }
78
+ </style>
@@ -0,0 +1,34 @@
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
+ const props = defineProps<
9
+ DialogTitleProps & { class?: HTMLAttributes['class'] }
10
+ >();
11
+
12
+ const delegatedProps = reactiveOmit(props, 'class');
13
+
14
+ const forwardedProps = useForwardProps(delegatedProps);
15
+ </script>
16
+
17
+ <template>
18
+ <DialogTitle
19
+ v-bind="forwardedProps"
20
+ :class="cn('unnnic-dialog-title', props.class)"
21
+ >
22
+ <slot />
23
+ </DialogTitle>
24
+ </template>
25
+
26
+ <style lang="scss" scoped>
27
+ @use '@/assets/scss/unnnic' as *;
28
+
29
+ .unnnic-dialog-title {
30
+ font: $unnnic-font-display-2;
31
+ color: $unnnic-color-fg-emphasized;
32
+ margin: 0;
33
+ }
34
+ </style>
@@ -0,0 +1,12 @@
1
+ <script setup lang="ts">
2
+ import type { DialogTriggerProps } from 'reka-ui';
3
+ import { DialogTrigger } from 'reka-ui';
4
+
5
+ const props = defineProps<DialogTriggerProps>();
6
+ </script>
7
+
8
+ <template>
9
+ <DialogTrigger v-bind="props">
10
+ <slot />
11
+ </DialogTrigger>
12
+ </template>
@@ -0,0 +1,7 @@
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';