@weni/unnnic-system 3.12.7 → 3.12.8
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/CHANGELOG.md +15 -0
- package/dist/{es-c84c6e0c.mjs → es-62c1e8d3.mjs} +1 -1
- package/dist/{index-71322a23.mjs → index-ef197fd5.mjs} +208 -203
- package/dist/index.d.ts +12 -6
- package/dist/{pt-br-f53036d2.mjs → pt-br-198b147b.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +1 -1
- package/dist/unnnic.umd.js +1 -1
- package/package.json +1 -1
- package/src/components/ui/popover/PopoverContent.vue +27 -8
- package/src/components/ui/popover/PopoverOption.vue +1 -1
- package/src/stories/Popover.stories.js +5 -0
package/package.json
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
<PopoverPortal>
|
|
3
3
|
<PopoverContent
|
|
4
4
|
v-bind="{ ...forwarded, ...$attrs }"
|
|
5
|
+
:style="{ width: contentWidth }"
|
|
5
6
|
:class="
|
|
6
7
|
cn(
|
|
7
8
|
'unnnic-popover',
|
|
8
|
-
`unnnic-popover--size-${props.size}`,
|
|
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
|
"
|
|
@@ -43,7 +43,8 @@ const props = withDefaults(
|
|
|
43
43
|
defineProps<
|
|
44
44
|
PopoverContentProps & {
|
|
45
45
|
class?: HTMLAttributes['class'];
|
|
46
|
-
size?:
|
|
46
|
+
size?: string;
|
|
47
|
+
width?: string;
|
|
47
48
|
}
|
|
48
49
|
>(),
|
|
49
50
|
{
|
|
@@ -51,6 +52,7 @@ const props = withDefaults(
|
|
|
51
52
|
sideOffset: 4,
|
|
52
53
|
size: 'medium',
|
|
53
54
|
class: '',
|
|
55
|
+
width: '',
|
|
54
56
|
},
|
|
55
57
|
);
|
|
56
58
|
const emits = defineEmits<PopoverContentEmits>();
|
|
@@ -79,6 +81,18 @@ const footerChildren = computed(() => {
|
|
|
79
81
|
(vnode: VNode) => getComponentName(vnode) === 'UnnnicPopoverFooter',
|
|
80
82
|
);
|
|
81
83
|
});
|
|
84
|
+
|
|
85
|
+
const contentWidth = computed(() => {
|
|
86
|
+
if (props.width) return props.width;
|
|
87
|
+
|
|
88
|
+
const sizes = {
|
|
89
|
+
small: '240px',
|
|
90
|
+
medium: '320px',
|
|
91
|
+
large: '400px',
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
return sizes[props.size as keyof typeof sizes];
|
|
95
|
+
});
|
|
82
96
|
</script>
|
|
83
97
|
|
|
84
98
|
<style lang="scss">
|
|
@@ -91,15 +105,20 @@ $popover-space: $unnnic-space-4;
|
|
|
91
105
|
|
|
92
106
|
border-radius: $unnnic-radius-2;
|
|
93
107
|
box-shadow: $unnnic-shadow-1;
|
|
108
|
+
border: 1px solid $unnnic-color-border-soft;
|
|
94
109
|
|
|
95
|
-
|
|
96
|
-
width:
|
|
110
|
+
&::-webkit-scrollbar {
|
|
111
|
+
width: $unnnic-space-1;
|
|
97
112
|
}
|
|
98
|
-
|
|
99
|
-
|
|
113
|
+
|
|
114
|
+
&::-webkit-scrollbar-thumb {
|
|
115
|
+
background: $unnnic-color-neutral-cleanest;
|
|
116
|
+
border-radius: $unnnic-border-radius-pill;
|
|
100
117
|
}
|
|
101
|
-
|
|
102
|
-
|
|
118
|
+
|
|
119
|
+
&::-webkit-scrollbar-track {
|
|
120
|
+
background: $unnnic-color-neutral-soft;
|
|
121
|
+
border-radius: $unnnic-border-radius-pill;
|
|
103
122
|
}
|
|
104
123
|
|
|
105
124
|
&__content {
|
|
@@ -76,7 +76,7 @@ const schemeColor = computed(() => {
|
|
|
76
76
|
.unnnic-popover-option {
|
|
77
77
|
cursor: pointer;
|
|
78
78
|
border-radius: $unnnic-radius-2;
|
|
79
|
-
padding: $unnnic-space-2;
|
|
79
|
+
padding: $unnnic-space-2 $unnnic-space-4;
|
|
80
80
|
font: $unnnic-font-emphasis;
|
|
81
81
|
display: flex;
|
|
82
82
|
gap: $unnnic-space-2;
|
|
@@ -26,6 +26,11 @@ export default {
|
|
|
26
26
|
},
|
|
27
27
|
},
|
|
28
28
|
argTypes: {
|
|
29
|
+
width: {
|
|
30
|
+
control: { type: 'text' },
|
|
31
|
+
description:
|
|
32
|
+
'The width of the popover. This overrides the size prop. If not provided, the size prop will be used.',
|
|
33
|
+
},
|
|
29
34
|
size: {
|
|
30
35
|
control: { type: 'select' },
|
|
31
36
|
options: ['small', 'medium', 'large'],
|