@saasmakers/ui 1.5.10 → 2.0.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/app/components/bases/BaseAlert.vue +1 -2
- package/app/components/bases/BaseCard.vue +2 -4
- package/app/components/bases/BaseDivider.vue +2 -3
- package/app/components/bases/BaseIcon.vue +4 -5
- package/app/components/bases/BaseMetric.vue +4 -6
- package/app/components/bases/BaseOverlay.vue +1 -5
- package/app/components/bases/BaseQuote.vue +1 -2
- package/app/components/bases/BaseShortcut.vue +1 -3
- package/app/components/bases/BaseTag.vue +2 -3
- package/app/components/bases/BaseTags.vue +2 -3
- package/app/components/bases/BaseToast.vue +1 -3
- package/app/components/fields/FieldEmojis.vue +0 -1
- package/app/components/fields/FieldSelect.vue +2 -5
- package/app/components/fields/FieldTime.vue +1 -2
- package/app/components/layout/LayoutApps.vue +152 -0
- package/app/components/layout/LayoutToasts.vue +0 -1
- package/app/types/global.d.ts +3 -2
- package/app/types/layout.d.ts +5 -0
- package/app/utils/animations.ts +31 -0
- package/app/utils/chartist.ts +126 -0
- package/app/{composables/useLayerUtils.ts → utils/formatting.ts} +2 -9
- package/app/{composables/useLayerIcons.ts → utils/layerIcons.ts} +6 -13
- package/nuxt.config.ts +4 -0
- package/package.json +4 -1
- package/public/images/layout/LayoutApps/appstore-de.svg +40 -0
- package/public/images/layout/LayoutApps/appstore-en.svg +46 -0
- package/public/images/layout/LayoutApps/appstore-es.svg +47 -0
- package/public/images/layout/LayoutApps/appstore-fr.svg +50 -0
- package/public/images/layout/LayoutApps/appstore-id.svg +46 -0
- package/public/images/layout/LayoutApps/appstore-it.svg +42 -0
- package/public/images/layout/LayoutApps/appstore-ja.svg +35 -0
- package/public/images/layout/LayoutApps/appstore-ko.svg +35 -0
- package/public/images/layout/LayoutApps/appstore-nl.svg +40 -0
- package/public/images/layout/LayoutApps/appstore-pl.svg +46 -0
- package/public/images/layout/LayoutApps/appstore-pt-BR.svg +47 -0
- package/public/images/layout/LayoutApps/appstore-pt.svg +47 -0
- package/public/images/layout/LayoutApps/appstore-vi.svg +46 -0
- package/public/images/layout/LayoutApps/googleplay-de.svg +37 -0
- package/public/images/layout/LayoutApps/googleplay-en.svg +45 -0
- package/public/images/layout/LayoutApps/googleplay-es.svg +45 -0
- package/public/images/layout/LayoutApps/googleplay-fr.svg +45 -0
- package/public/images/layout/LayoutApps/googleplay-id.svg +45 -0
- package/public/images/layout/LayoutApps/googleplay-it.svg +14 -0
- package/public/images/layout/LayoutApps/googleplay-ja.svg +51 -0
- package/public/images/layout/LayoutApps/googleplay-ko.svg +14 -0
- package/public/images/layout/LayoutApps/googleplay-nl.svg +37 -0
- package/public/images/layout/LayoutApps/googleplay-pl.svg +45 -0
- package/public/images/layout/LayoutApps/googleplay-pt-BR.svg +45 -0
- package/public/images/layout/LayoutApps/googleplay-pt.svg +45 -0
- package/public/images/layout/LayoutApps/googleplay-vi.svg +45 -0
- package/app/composables/useChartist.ts +0 -130
- package/app/composables/useMotion.ts +0 -39
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import type { AreaDrawEvent, BarChartOptions, BarDrawEvent, BaseChart, DrawEvent, LineDrawEvent, Options } from 'chartist'
|
|
2
|
-
import { easings } from 'chartist'
|
|
3
|
-
|
|
4
|
-
export default function useChartist() {
|
|
5
|
-
type EasingType = keyof typeof easings | number[]
|
|
6
|
-
|
|
7
|
-
const progressiveLinePlugin = (params: {
|
|
8
|
-
animateArea?: boolean
|
|
9
|
-
delay?: number
|
|
10
|
-
duration?: number
|
|
11
|
-
easing?: EasingType
|
|
12
|
-
stagger?: number
|
|
13
|
-
} = {}) => {
|
|
14
|
-
const animateArea = params.animateArea ?? true
|
|
15
|
-
const delay = params.delay ?? 0
|
|
16
|
-
const duration = params.duration ?? 500
|
|
17
|
-
const easing = params.easing ?? easings.easeOutQuart
|
|
18
|
-
const stagger = params.stagger ?? 0
|
|
19
|
-
|
|
20
|
-
return (chart: BaseChart) => {
|
|
21
|
-
chart.on('draw', (ctx: DrawEvent) => {
|
|
22
|
-
const begin = delay + (stagger ? stagger * (ctx.seriesIndex ?? 0) : 0)
|
|
23
|
-
|
|
24
|
-
// Animation for line charts
|
|
25
|
-
if (ctx.type === 'line') {
|
|
26
|
-
const lineCtx = ctx as LineDrawEvent
|
|
27
|
-
const node = lineCtx.element.getNode<SVGPathElement>()
|
|
28
|
-
const length = node.getTotalLength()
|
|
29
|
-
|
|
30
|
-
// Set the stroke dasharray and dashoffset
|
|
31
|
-
lineCtx.element.attr({
|
|
32
|
-
'stroke-dasharray': `${length}px ${length}px`,
|
|
33
|
-
'stroke-dashoffset': `${length}px`,
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
// Animate the stroke dashoffset to 0
|
|
37
|
-
lineCtx.element.animate({
|
|
38
|
-
'stroke-dashoffset': {
|
|
39
|
-
begin,
|
|
40
|
-
dur: duration,
|
|
41
|
-
easing,
|
|
42
|
-
fill: 'freeze',
|
|
43
|
-
from: `${length}px`,
|
|
44
|
-
to: '0px',
|
|
45
|
-
},
|
|
46
|
-
}, false)
|
|
47
|
-
|
|
48
|
-
// Clean up the dash attributes after it finishes
|
|
49
|
-
const total = delay + duration + (stagger ? stagger * (lineCtx.seriesIndex ?? 0) : 0)
|
|
50
|
-
|
|
51
|
-
globalThis.setTimeout(() => {
|
|
52
|
-
lineCtx.element.attr({
|
|
53
|
-
'stroke-dasharray': undefined,
|
|
54
|
-
'stroke-dashoffset': undefined,
|
|
55
|
-
})
|
|
56
|
-
}, total + 30)
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// Animation for area charts
|
|
60
|
-
if (animateArea && ctx.type === 'area') {
|
|
61
|
-
const areaCtx = ctx as AreaDrawEvent
|
|
62
|
-
|
|
63
|
-
areaCtx.element.animate({
|
|
64
|
-
|
|
65
|
-
d: {
|
|
66
|
-
begin,
|
|
67
|
-
dur: duration,
|
|
68
|
-
easing,
|
|
69
|
-
fill: 'freeze',
|
|
70
|
-
from: areaCtx.path
|
|
71
|
-
.clone()
|
|
72
|
-
.scale(1, 0)
|
|
73
|
-
.translate(0, areaCtx.chartRect.height())
|
|
74
|
-
.stringify(),
|
|
75
|
-
to: areaCtx.path.stringify(),
|
|
76
|
-
},
|
|
77
|
-
}, false)
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// Animation for bar charts
|
|
81
|
-
if (ctx.type === 'bar') {
|
|
82
|
-
const barCtx = ctx as BarDrawEvent
|
|
83
|
-
|
|
84
|
-
// Access private options property via type assertion
|
|
85
|
-
const chartOptions = (chart as unknown as {
|
|
86
|
-
options?: Options & Partial<BarChartOptions>
|
|
87
|
-
}).options
|
|
88
|
-
|
|
89
|
-
const horizontal = !!(chartOptions as BarChartOptions | undefined)?.horizontalBars
|
|
90
|
-
|
|
91
|
-
// For vertical bars, y1 is baseline, y2 is top. For horizontal, x1 is baseline, x2 is end.
|
|
92
|
-
const from = horizontal ? barCtx.x1 : barCtx.y1
|
|
93
|
-
const to = horizontal ? barCtx.x2 : barCtx.y2
|
|
94
|
-
|
|
95
|
-
// Start collapsed at baseline
|
|
96
|
-
if (horizontal) {
|
|
97
|
-
barCtx.element.attr({ x2: from })
|
|
98
|
-
|
|
99
|
-
barCtx.element.animate({
|
|
100
|
-
x2: {
|
|
101
|
-
begin,
|
|
102
|
-
dur: duration,
|
|
103
|
-
easing,
|
|
104
|
-
fill: 'freeze',
|
|
105
|
-
from: String(from),
|
|
106
|
-
to: String(to),
|
|
107
|
-
},
|
|
108
|
-
}, false)
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
barCtx.element.attr({ y2: from })
|
|
112
|
-
|
|
113
|
-
barCtx.element.animate({
|
|
114
|
-
y2: {
|
|
115
|
-
begin,
|
|
116
|
-
dur: duration,
|
|
117
|
-
easing,
|
|
118
|
-
fill: 'freeze',
|
|
119
|
-
from: String(from),
|
|
120
|
-
to: String(to),
|
|
121
|
-
},
|
|
122
|
-
}, false)
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
})
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return { progressiveLinePlugin }
|
|
130
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
export default function useMotion() {
|
|
2
|
-
const fadeIn = {
|
|
3
|
-
animate: {
|
|
4
|
-
opacity: 1,
|
|
5
|
-
transition: { duration: 0.25 },
|
|
6
|
-
},
|
|
7
|
-
initial: { opacity: 0 },
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const fadeInLeft = {
|
|
11
|
-
animate: {
|
|
12
|
-
opacity: 1,
|
|
13
|
-
transition: { duration: 0.25 },
|
|
14
|
-
x: 0,
|
|
15
|
-
},
|
|
16
|
-
initial: {
|
|
17
|
-
opacity: 0,
|
|
18
|
-
x: -25,
|
|
19
|
-
},
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const fadeInUp = {
|
|
23
|
-
animate: {
|
|
24
|
-
opacity: 1,
|
|
25
|
-
transition: { duration: 0.25 },
|
|
26
|
-
y: 0,
|
|
27
|
-
},
|
|
28
|
-
initial: {
|
|
29
|
-
opacity: 0,
|
|
30
|
-
y: 25,
|
|
31
|
-
},
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return {
|
|
35
|
-
fadeIn,
|
|
36
|
-
fadeInLeft,
|
|
37
|
-
fadeInUp,
|
|
38
|
-
}
|
|
39
|
-
}
|