@weni/unnnic-system 3.2.9 → 3.3.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.
- package/CHANGELOG.md +3 -0
- package/dist/components/ChartFunnel/DefaultFunnel/ChartDefaultFunnelBase.vue.d.ts.map +1 -1
- package/dist/components/ChartFunnel/SvgFunnel/ChartFunnelTwoRows.vue.d.ts +43 -0
- package/dist/components/ChartFunnel/SvgFunnel/ChartFunnelTwoRows.vue.d.ts.map +1 -0
- package/dist/{es-1ca6f2cf.mjs → es-db7a2f44.mjs} +1 -1
- package/dist/{index-ca7d12b1.mjs → index-08caf833.mjs} +1484 -1431
- package/dist/{pt-br-2d5000b1.mjs → pt-br-88538a51.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +1 -1
- package/dist/unnnic.umd.js +29 -29
- package/package.json +2 -2
- package/src/components/ChartFunnel/ChartFunnel.vue +4 -0
- package/src/components/ChartFunnel/DefaultFunnel/ChartDefaultFunnelBase.vue +8 -2
- package/src/components/ChartFunnel/SvgFunnel/ChartFunnelBaseRow.vue +1 -1
- package/src/components/ChartFunnel/SvgFunnel/ChartFunnelTwoRows.vue +64 -0
- package/src/stories/ChartFunnel.stories.js +19 -0
package/package.json
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
</template>
|
|
7
7
|
|
|
8
8
|
<script>
|
|
9
|
+
import ChartFunnelTwoRows from './SvgFunnel/ChartFunnelTwoRows.vue';
|
|
9
10
|
import ChartFunnelThreeRows from './SvgFunnel/ChartFunnelThreeRows.vue';
|
|
10
11
|
import ChartFunnelFourRows from './SvgFunnel/ChartFunnelFourRows.vue';
|
|
11
12
|
import ChartFunnelFiveRows from './SvgFunnel/ChartFunnelFiveRows.vue';
|
|
@@ -15,6 +16,7 @@ export default {
|
|
|
15
16
|
name: 'UnnnicChartFunnel',
|
|
16
17
|
|
|
17
18
|
components: {
|
|
19
|
+
ChartFunnelTwoRows,
|
|
18
20
|
ChartFunnelThreeRows,
|
|
19
21
|
ChartFunnelFourRows,
|
|
20
22
|
ChartFunnelFiveRows,
|
|
@@ -36,11 +38,13 @@ export default {
|
|
|
36
38
|
chartComponent() {
|
|
37
39
|
const componentMap = {
|
|
38
40
|
default: {
|
|
41
|
+
2: ChartDefaultFunnelBase,
|
|
39
42
|
3: ChartDefaultFunnelBase,
|
|
40
43
|
4: ChartDefaultFunnelBase,
|
|
41
44
|
5: ChartDefaultFunnelBase,
|
|
42
45
|
},
|
|
43
46
|
basic: {
|
|
47
|
+
2: 'ChartFunnelTwoRows',
|
|
44
48
|
3: 'ChartFunnelThreeRows',
|
|
45
49
|
4: 'ChartFunnelFourRows',
|
|
46
50
|
5: 'ChartFunnelFiveRows',
|
|
@@ -44,6 +44,8 @@
|
|
|
44
44
|
</template>
|
|
45
45
|
|
|
46
46
|
<script setup lang="ts">
|
|
47
|
+
import { computed } from 'vue';
|
|
48
|
+
|
|
47
49
|
interface FunnelStep {
|
|
48
50
|
percentage: number | string;
|
|
49
51
|
value: number | string;
|
|
@@ -52,9 +54,13 @@ interface FunnelStep {
|
|
|
52
54
|
color: string;
|
|
53
55
|
}
|
|
54
56
|
|
|
55
|
-
defineProps<{
|
|
57
|
+
const props = defineProps<{
|
|
56
58
|
data: FunnelStep[];
|
|
57
59
|
}>();
|
|
60
|
+
|
|
61
|
+
const calculatedTransform = computed(() => {
|
|
62
|
+
return `skew(${props.data.length === 2 ? '-8deg' : '-12deg'}, 0deg) translateX(-20px)`;
|
|
63
|
+
});
|
|
58
64
|
</script>
|
|
59
65
|
|
|
60
66
|
<style lang="scss" scoped>
|
|
@@ -76,7 +82,7 @@ defineProps<{
|
|
|
76
82
|
&__card {
|
|
77
83
|
height: 100%;
|
|
78
84
|
transition: background-color 0.3s ease;
|
|
79
|
-
transform:
|
|
85
|
+
transform: v-bind(calculatedTransform);
|
|
80
86
|
border-radius: 0 0 $unnnic-spacing-xs 0;
|
|
81
87
|
|
|
82
88
|
&.first-item {
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ChartFunnelBaseRow
|
|
3
|
+
class="unnnic-chart-funnel-two-rows"
|
|
4
|
+
:rows="rows"
|
|
5
|
+
viewBox="0 0 250 148"
|
|
6
|
+
/>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
import ChartFunnelBaseRow from './ChartFunnelBaseRow.vue';
|
|
11
|
+
export default {
|
|
12
|
+
name: 'UnnnicChartFunnelTwoRows',
|
|
13
|
+
|
|
14
|
+
components: {
|
|
15
|
+
ChartFunnelBaseRow,
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
props: {
|
|
19
|
+
data: {
|
|
20
|
+
type: Array,
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
computed: {
|
|
26
|
+
rows() {
|
|
27
|
+
const { data } = this;
|
|
28
|
+
return [
|
|
29
|
+
{
|
|
30
|
+
pathD:
|
|
31
|
+
'M362.938 0H12.025C6.30976 0 2.43799 5.81972 4.64626 11.0911L31 74H343.75L370.307 11.1122C372.535 5.83818 368.663 0 362.938 0Z',
|
|
32
|
+
titleX: '50%',
|
|
33
|
+
titleY: '32',
|
|
34
|
+
descriptionX: '50%',
|
|
35
|
+
descriptionY: '52',
|
|
36
|
+
title: data[0].title,
|
|
37
|
+
description: data[0].description,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
pathD: 'M344 74H31L63.4654 148H311.535L344 74Z',
|
|
41
|
+
titleX: '50%',
|
|
42
|
+
titleY: '106',
|
|
43
|
+
descriptionX: '50%',
|
|
44
|
+
descriptionY: '126',
|
|
45
|
+
title: data[1].title,
|
|
46
|
+
description: data[1].description,
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
<style lang="scss">
|
|
55
|
+
@use '@/assets/scss/unnnic' as *;
|
|
56
|
+
.unnnic-chart-funnel-two-rows {
|
|
57
|
+
[class$='row']:nth-child(1) {
|
|
58
|
+
fill: $unnnic-color-weni-950;
|
|
59
|
+
}
|
|
60
|
+
[class$='row']:nth-child(2) {
|
|
61
|
+
fill: $unnnic-color-weni-800;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
</style>
|
|
@@ -14,6 +14,25 @@ export default {
|
|
|
14
14
|
],
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
+
export const TwoRows = {
|
|
18
|
+
args: {
|
|
19
|
+
data: [
|
|
20
|
+
{
|
|
21
|
+
title: '100%',
|
|
22
|
+
description: 'Clicou em comprar',
|
|
23
|
+
value: '18.621',
|
|
24
|
+
color: '#F6E05E',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
title: '67%',
|
|
28
|
+
description: 'Informou entrega',
|
|
29
|
+
value: '12.476',
|
|
30
|
+
color: '#F6AD55',
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
17
36
|
export const ThreeRows = {
|
|
18
37
|
args: {
|
|
19
38
|
data: [
|