@energie360/ui-library 0.1.15 → 0.1.17
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/components/card-info/card-info.scss +40 -0
- package/components/card-info/u-card-info.vue +35 -0
- package/components/index.js +1 -0
- package/components/inline-edit/inline-edit.scss +5 -1
- package/components/inline-edit/u-inline-edit.vue +21 -12
- package/components/navigation-panel-tile/navigation-panel-tile.scss +1 -1
- package/components/navigation-panel-tile/u-navigation-panel-tile.vue +17 -13
- package/components/richtext/_wizard.scss +26 -0
- package/components/richtext/richtext.scss +11 -3
- package/components/richtext/u-richtext.vue +3 -1
- package/dist/elements/form.css +170 -0
- package/dist/elements/form.css.map +1 -0
- package/dist/layout/form-grid.css +184 -0
- package/dist/layout/form-grid.css.map +1 -0
- package/elements/checkbox/checkbox.scss +150 -0
- package/elements/checkbox/u-checkbox.vue +42 -0
- package/elements/form/form.scss +1 -1
- package/elements/form-field/form-field-prefix-suffix.scss +5 -0
- package/elements/index.js +3 -0
- package/elements/radio/radio.scss +91 -2
- package/elements/radio/u-radio.vue +6 -3
- package/elements/radio-group/radio-group.scss +28 -0
- package/elements/radio-group/u-radio-group.vue +23 -3
- package/elements/select-chip/select-chip.scss +1 -0
- package/elements/select-chip/u-select-chip.vue +2 -2
- package/elements/select-chips/select-chips.scss +18 -0
- package/elements/select-chips/u-select-chips.vue +16 -3
- package/elements/select-tile/select-tile.scss +205 -0
- package/elements/select-tile/u-select-tile.vue +53 -0
- package/elements/select-tiles/select-tiles.scss +32 -0
- package/elements/select-tiles/u-select-tiles.vue +31 -0
- package/elements/text-field/u-text-field.vue +22 -5
- package/elements/toggle-switch/toggle-switch.scss +14 -4
- package/elements/toggle-switch/u-toggle-switch.vue +23 -20
- package/layout/index.js +2 -0
- package/layout/portal/portal.scss +35 -0
- package/layout/portal/u-portal.vue +22 -0
- package/layout/settings/settings.scss +33 -0
- package/layout/settings/u-settings-layout.vue +19 -0
- package/modules/dialog/_animations.scss +49 -0
- package/modules/dialog/dialog.scss +168 -0
- package/modules/dialog/u-dialog.vue +134 -0
- package/modules/index.js +4 -0
- package/modules/inline-edit-group/u-inline-edit-group.vue +2 -0
- package/modules/navigation-panel/navigation-panel.scss +1 -0
- package/modules/progress-indicator/progress-indicator.scss +84 -0
- package/modules/progress-indicator/u-progress-indicator.vue +34 -0
- package/modules/toast/toast-message.scss +67 -0
- package/modules/toast/toast.scss +14 -0
- package/modules/toast/u-toast-message.vue +46 -0
- package/modules/toast/u-toast.vue +26 -0
- package/modules/toast/useToast.ts +40 -0
- package/package.json +2 -1
- package/utility/elements/form.scss +1 -0
- package/utility/layout/form-grid.scss +1 -0
- package/wizard/index.js +1 -0
- package/wizard/wizard-outro/u-wizard-outro.vue +49 -0
- package/wizard/wizard-outro/wizard-outro.scss +56 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { Image } from '../../elements/types'
|
|
3
|
+
import { useTemplateRef, watch, useSlots } from 'vue'
|
|
4
|
+
import { UButton } from '../../elements'
|
|
5
|
+
import { getTranslation } from '../../utils/translations/translate'
|
|
6
|
+
import { focusTrap } from '../../utils/a11y/focus-trap'
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
title?: string
|
|
10
|
+
text?: string
|
|
11
|
+
headerImage?: Image
|
|
12
|
+
contentImage?: Image
|
|
13
|
+
closeBtnLabel?: string
|
|
14
|
+
mobileDialogStyle?: 'modal' | 'slideout'
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const { mobileDialogStyle = 'modal', closeBtnLabel = getTranslation('close') } =
|
|
18
|
+
defineProps<Props>()
|
|
19
|
+
|
|
20
|
+
const visible = defineModel<boolean>('visible')
|
|
21
|
+
const dialogEl = useTemplateRef('dialog')
|
|
22
|
+
const slots = useSlots()
|
|
23
|
+
let focusTrapInstance
|
|
24
|
+
|
|
25
|
+
// TODO: Key codes should be defined globally
|
|
26
|
+
const ESC = 'Escape'
|
|
27
|
+
|
|
28
|
+
const onKeydown = (e: KeyboardEvent) => {
|
|
29
|
+
if (e.code === ESC) {
|
|
30
|
+
visible.value = false
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const onDocumentClick = (e: Event) => {
|
|
35
|
+
if (e.target.closest('.dialog')) {
|
|
36
|
+
return
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
e.stopPropagation()
|
|
40
|
+
e.preventDefault()
|
|
41
|
+
|
|
42
|
+
visible.value = false
|
|
43
|
+
}
|
|
44
|
+
watch(visible, (newV) => {
|
|
45
|
+
if (newV) {
|
|
46
|
+
// Open Dialog
|
|
47
|
+
dialogEl.value.showModal()
|
|
48
|
+
|
|
49
|
+
focusTrapInstance = focusTrap(dialogEl.value, {
|
|
50
|
+
focusFirstElement: true,
|
|
51
|
+
allowArrowUpDown: true,
|
|
52
|
+
allowArrowLeftRight: true,
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
requestAnimationFrame(() => {
|
|
56
|
+
window.addEventListener('keydown', onKeydown)
|
|
57
|
+
document.addEventListener('click', onDocumentClick)
|
|
58
|
+
})
|
|
59
|
+
} else {
|
|
60
|
+
focusTrapInstance.release()
|
|
61
|
+
|
|
62
|
+
// Close Dialog
|
|
63
|
+
// The trigger element automatically gets the focus when the dialog is closed. yay native :)
|
|
64
|
+
dialogEl.value.close()
|
|
65
|
+
|
|
66
|
+
window.removeEventListener('keydown', onKeydown)
|
|
67
|
+
document.removeEventListener('click', onDocumentClick)
|
|
68
|
+
}
|
|
69
|
+
})
|
|
70
|
+
</script>
|
|
71
|
+
|
|
72
|
+
<template>
|
|
73
|
+
<dialog
|
|
74
|
+
ref="dialog"
|
|
75
|
+
closedby="none"
|
|
76
|
+
:class="[
|
|
77
|
+
'dialog-container',
|
|
78
|
+
mobileDialogStyle,
|
|
79
|
+
{
|
|
80
|
+
'has-header-image': !!slots['header-image'] || headerImage,
|
|
81
|
+
'has-content-image': !!slots['content-image'] || contentImage,
|
|
82
|
+
},
|
|
83
|
+
]"
|
|
84
|
+
>
|
|
85
|
+
<div class="dialog">
|
|
86
|
+
<div class="dialog__header-image-container">
|
|
87
|
+
<slot name="header-image">
|
|
88
|
+
<img v-bind="headerImage" />
|
|
89
|
+
</slot>
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
<div class="dialog__content-container">
|
|
93
|
+
<div class="content-title">
|
|
94
|
+
<h3>
|
|
95
|
+
<slot name="title">{{ title }}</slot>
|
|
96
|
+
</h3>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<div class="content-text">
|
|
100
|
+
<div class="richtext">
|
|
101
|
+
<slot name="text">
|
|
102
|
+
<div v-html="text"></div>
|
|
103
|
+
</slot>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<div class="dialog__content-image">
|
|
108
|
+
<slot name="content-image">
|
|
109
|
+
<img v-bind="contentImage" />
|
|
110
|
+
</slot>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
<div class="cta-container">
|
|
115
|
+
<UButton @click="visible = false">{{ closeBtnLabel }}</UButton>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
</dialog>
|
|
119
|
+
</template>
|
|
120
|
+
|
|
121
|
+
<style scoped lang="scss" src="./dialog.scss"></style>
|
|
122
|
+
<style scoped lang="scss">
|
|
123
|
+
.dialog__header-image-container {
|
|
124
|
+
:slotted(img) {
|
|
125
|
+
object-fit: contain;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.dialog__content-image {
|
|
130
|
+
:slotted(img) {
|
|
131
|
+
width: 100%;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
</style>
|
package/modules/index.js
CHANGED
|
@@ -4,3 +4,7 @@ export { default as UInlineEditGroup } from './inline-edit-group/u-inline-edit-g
|
|
|
4
4
|
export { default as UNavigationToolbarTop } from './navigation-toolbar-top/u-navigation-toolbar-top.vue'
|
|
5
5
|
export { default as UNavigationToolbarSide } from './navigation-toolbar-side/u-navigation-toolbar-side.vue'
|
|
6
6
|
export { default as UNavigationPanel } from './navigation-panel/u-navigation-panel.vue'
|
|
7
|
+
export { default as UProgressIndicator } from './progress-indicator/u-progress-indicator.vue'
|
|
8
|
+
export { default as UToast } from './toast/u-toast.vue'
|
|
9
|
+
export { toast } from './toast/useToast.ts'
|
|
10
|
+
export { default as UDialog } from './dialog/u-dialog.vue'
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
@use '../../base/abstracts/' as a;
|
|
2
|
+
|
|
3
|
+
.progress-indicator {
|
|
4
|
+
progress[value]::-webkit-progress-bar {
|
|
5
|
+
width: 100%;
|
|
6
|
+
height: 6px;
|
|
7
|
+
background-color: var(--e-c-mono-100);
|
|
8
|
+
transition: width 300ms ease;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
progress[value]::-webkit-progress-value {
|
|
12
|
+
width: 0;
|
|
13
|
+
background-color: var(--e-c-primary-01-500);
|
|
14
|
+
transition: width a.$trs-default;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&.rounded {
|
|
18
|
+
border-radius: 3px;
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
|
|
21
|
+
.progress-indicator__segment {
|
|
22
|
+
position: relative;
|
|
23
|
+
border: none;
|
|
24
|
+
|
|
25
|
+
&::before {
|
|
26
|
+
content: '';
|
|
27
|
+
position: absolute;
|
|
28
|
+
width: 10px;
|
|
29
|
+
height: 6px;
|
|
30
|
+
left: 3px;
|
|
31
|
+
box-shadow: -6px 0 0 0 var(--e-c-mono-00);
|
|
32
|
+
border-radius: 3px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&::after {
|
|
36
|
+
content: '';
|
|
37
|
+
position: absolute;
|
|
38
|
+
width: 10px;
|
|
39
|
+
height: 6px;
|
|
40
|
+
right: 3px;
|
|
41
|
+
box-shadow: 6px 0 0 0 var(--e-c-mono-00);
|
|
42
|
+
border-radius: 3px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&:first-of-type::before {
|
|
46
|
+
content: none;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&:last-of-type {
|
|
50
|
+
content: none;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.progress-indicator__main-track {
|
|
57
|
+
position: relative;
|
|
58
|
+
display: flex;
|
|
59
|
+
height: 6px;
|
|
60
|
+
width: 100%;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.progress-indicator__progress {
|
|
64
|
+
position: absolute;
|
|
65
|
+
top: 0;
|
|
66
|
+
left: 0;
|
|
67
|
+
width: 100%;
|
|
68
|
+
appearance: none;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.progress-indicator__segment {
|
|
72
|
+
position: relative;
|
|
73
|
+
flex: 1 0 auto;
|
|
74
|
+
border-right: 4px solid var(--e-c-mono-00);
|
|
75
|
+
border-left: 4px solid var(--e-c-mono-00);
|
|
76
|
+
|
|
77
|
+
&:first-of-type {
|
|
78
|
+
border-left: 0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&:last-of-type {
|
|
82
|
+
border-right: 0;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
index: number
|
|
6
|
+
steps: number[]
|
|
7
|
+
rounded?: boolean
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const { steps, rounded = false } = defineProps<Props>()
|
|
11
|
+
|
|
12
|
+
const totalSteps = computed(() => steps.reduce((acc, val) => (acc += val), 0))
|
|
13
|
+
|
|
14
|
+
const getSegmentWidth = (steps: number) => (100 / totalSteps.value) * steps
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<div :class="['progress-indicator', { rounded }]">
|
|
19
|
+
<div class="progress-indicator__main-track">
|
|
20
|
+
<progress class="progress-indicator__progress" :max="totalSteps" :value="index"></progress>
|
|
21
|
+
|
|
22
|
+
<div
|
|
23
|
+
v-for="(segment, idx) in steps"
|
|
24
|
+
:key="idx"
|
|
25
|
+
class="progress-indicator__segment"
|
|
26
|
+
:style="{
|
|
27
|
+
width: `${getSegmentWidth(segment)}%`,
|
|
28
|
+
}"
|
|
29
|
+
></div>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<style scoped lang="scss" src="./progress-indicator.scss"></style>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
@use '../../base/abstracts' as a;
|
|
2
|
+
|
|
3
|
+
.toast-message {
|
|
4
|
+
pointer-events: auto;
|
|
5
|
+
|
|
6
|
+
.toast-message__inner {
|
|
7
|
+
@include a.type(100, strong);
|
|
8
|
+
|
|
9
|
+
position: relative;
|
|
10
|
+
max-width: a.rem(405);
|
|
11
|
+
padding: var(--e-space-4) var(--e-space-14);
|
|
12
|
+
border-radius: var(--e-space-2);
|
|
13
|
+
color: var(--e-c-mono-00);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.toast-message__icon {
|
|
17
|
+
position: absolute;
|
|
18
|
+
top: 50%;
|
|
19
|
+
left: var(--e-space-4);
|
|
20
|
+
transform: translateY(-50%);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.toast-message__close-button {
|
|
24
|
+
position: absolute;
|
|
25
|
+
color: var(--e-c-mono-00);
|
|
26
|
+
right: var(--e-space-4);
|
|
27
|
+
top: 50%;
|
|
28
|
+
transform: translateY(-50%);
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Modifiers
|
|
33
|
+
&.success {
|
|
34
|
+
.toast-message__icon {
|
|
35
|
+
color: var(--e-c-signal-01-500);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.toast-message__inner {
|
|
39
|
+
background-color: var(--e-c-signal-01-700);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&.error {
|
|
44
|
+
.toast-message__icon {
|
|
45
|
+
color: var(--e-c-signal-03-500);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.toast-message__inner {
|
|
49
|
+
background-color: var(--e-c-signal-03-700);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Animations
|
|
54
|
+
&.fade-in {
|
|
55
|
+
animation-name: fade-in-message;
|
|
56
|
+
animation-duration: var(--e-trs-duration-faster);
|
|
57
|
+
animation-timing-function: ease-in;
|
|
58
|
+
animation-fill-mode: forwards;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&.toast-message--fade-out {
|
|
62
|
+
animation-name: fade-out-message;
|
|
63
|
+
animation-duration: var(--e-trs-duration-faster);
|
|
64
|
+
animation-timing-function: ease-in;
|
|
65
|
+
animation-fill-mode: forwards;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
@use '../../base/abstracts' as a;
|
|
2
|
+
|
|
3
|
+
.toast {
|
|
4
|
+
z-index: a.$layer-message;
|
|
5
|
+
position: fixed;
|
|
6
|
+
bottom: var(--e-space-6);
|
|
7
|
+
left: 0;
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column-reverse;
|
|
10
|
+
align-items: center;
|
|
11
|
+
width: 100%;
|
|
12
|
+
grid-gap: var(--e-space-4);
|
|
13
|
+
pointer-events: none;
|
|
14
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { UIcon } from '../../elements'
|
|
3
|
+
import { dismiss } from './useToast'
|
|
4
|
+
import { ref } from 'vue'
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
id: number
|
|
8
|
+
type: 'success' | 'error'
|
|
9
|
+
message: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const { id } = defineProps<Props>()
|
|
13
|
+
|
|
14
|
+
enum MessageType {
|
|
15
|
+
success = 'check-circle',
|
|
16
|
+
error = 'report',
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const fadeIn = ref(false)
|
|
20
|
+
const close = () => dismiss(id)
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<div :class="['toast-message', type, { 'fade-in': fadeIn }]">
|
|
25
|
+
<div class="container">
|
|
26
|
+
<div class="toast-message__inner">
|
|
27
|
+
<div class="toast-message__icon">
|
|
28
|
+
<UIcon :name="MessageType[type]"></UIcon>
|
|
29
|
+
</div>
|
|
30
|
+
<div ref="message" class="toast-message__message">
|
|
31
|
+
{{ message }}
|
|
32
|
+
</div>
|
|
33
|
+
<button
|
|
34
|
+
class="toast-message__close-button"
|
|
35
|
+
type="button"
|
|
36
|
+
aria-label="Close message"
|
|
37
|
+
@click="close"
|
|
38
|
+
>
|
|
39
|
+
<UIcon name="close"></UIcon>
|
|
40
|
+
</button>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<style scoped lang="scss" src="./toast-message.scss"></style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import UToastMessage from './u-toast-message.vue'
|
|
3
|
+
import { toasts } from './useToast'
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<template>
|
|
7
|
+
<div class="toast">
|
|
8
|
+
<TransitionGroup name="list">
|
|
9
|
+
<UToastMessage v-for="(item, idx) in toasts" :key="idx" v-bind="item" />
|
|
10
|
+
</TransitionGroup>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<style scoped>
|
|
15
|
+
.list-enter-active,
|
|
16
|
+
.list-leave-active {
|
|
17
|
+
transition: all var(--e-trs-duration-faster) ease-in;
|
|
18
|
+
}
|
|
19
|
+
.list-enter-from,
|
|
20
|
+
.list-leave-to {
|
|
21
|
+
opacity: 0;
|
|
22
|
+
transform: translateY(10px);
|
|
23
|
+
}
|
|
24
|
+
</style>
|
|
25
|
+
|
|
26
|
+
<style scoped lang="scss" src="./toast.scss"></style>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ref } from 'vue'
|
|
2
|
+
|
|
3
|
+
let messageId = 0
|
|
4
|
+
const defaultTimeout = 3000
|
|
5
|
+
|
|
6
|
+
type ToastMessage = {
|
|
7
|
+
id: number
|
|
8
|
+
type: 'success' | 'error'
|
|
9
|
+
message: string
|
|
10
|
+
timeout?: number
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const toasts = ref<ToastMessage[]>([])
|
|
14
|
+
|
|
15
|
+
type Toast = Omit<ToastMessage, 'id'>
|
|
16
|
+
|
|
17
|
+
const toast = (args: Toast) => {
|
|
18
|
+
messageId++
|
|
19
|
+
|
|
20
|
+
const toastObj = {
|
|
21
|
+
...args,
|
|
22
|
+
id: messageId,
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
toasts.value.push(toastObj)
|
|
26
|
+
|
|
27
|
+
if (args.timeout === 0) {
|
|
28
|
+
return
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
setTimeout(() => {
|
|
32
|
+
dismiss(toastObj.id)
|
|
33
|
+
}, args.timeout || defaultTimeout)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const dismiss = (messageId: number) => {
|
|
37
|
+
toasts.value = toasts.value.filter((item) => item.id !== messageId)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { toast, toasts, dismiss }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@energie360/ui-library",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.17",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"./elements": "./elements/index.js",
|
|
12
12
|
"./components": "./components/index.js",
|
|
13
13
|
"./modules": "./modules/index.js",
|
|
14
|
+
"./layout": "./layout/index.js",
|
|
14
15
|
"./wizard": "./wizard/index.js",
|
|
15
16
|
"./utility/elements/*": "./dist/elements/*",
|
|
16
17
|
"./utility/layout/*": "./dist/layout/*",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use '../../elements/form/form';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use '../../layout/form-grid/form-grid';
|
package/wizard/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as UWizardIntro } from './wizard-intro/u-wizard-intro.vue'
|
|
2
|
+
export { default as UWizardOutro } from './wizard-outro/u-wizard-outro.vue'
|
|
2
3
|
export { default as UWizardLayout } from './wizard-layout/u-wizard-layout.vue'
|
|
3
4
|
export { default as UWizardLayoutBlock } from './wizard-layout/u-wizard-layout-block.vue'
|
|
4
5
|
export { default as UWizardLayoutElement } from './wizard-layout/u-wizard-layout-element.vue'
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { Image, Cta } from '../../elements/types'
|
|
3
|
+
import { UButton } from '../../elements'
|
|
4
|
+
import { computed, useSlots } from 'vue'
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
title?: string
|
|
8
|
+
text?: string
|
|
9
|
+
image?: Image
|
|
10
|
+
cta?: Cta
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const { text, cta } = defineProps<Props>()
|
|
14
|
+
|
|
15
|
+
const slots = useSlots()
|
|
16
|
+
const hasCta = computed(() => !!slots.cta || cta)
|
|
17
|
+
const hasText = computed(() => !!slots.text || text)
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<div class="wizard-outro">
|
|
22
|
+
<div class="row wizard-outro__row">
|
|
23
|
+
<div class="wizard-outro__image-col">
|
|
24
|
+
<slot name="image">
|
|
25
|
+
<img v-if="image" :src="image.src" :alt="image.alt" />
|
|
26
|
+
</slot>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="wizard-outro__content-col">
|
|
29
|
+
<h1 class="wizard-outro__title">
|
|
30
|
+
<slot name="title">{{ title }}</slot>
|
|
31
|
+
</h1>
|
|
32
|
+
|
|
33
|
+
<div v-if="hasText" class="wizard-outro__text">
|
|
34
|
+
<div class="richtext richtext--wizard">
|
|
35
|
+
<slot name="text"><div v-html="text"></div></slot>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<div v-if="hasCta" class="wizard-outro__cta">
|
|
40
|
+
<slot name="cta">
|
|
41
|
+
<UButton v-bind="cta" />
|
|
42
|
+
</slot>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<style scoped lang="scss" src="./wizard-outro.scss"></style>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
@use '../../base/abstracts' as a;
|
|
2
|
+
@use '../../layout/grid/grid.mixin' as g;
|
|
3
|
+
@use '../../layout/grid/grid-row';
|
|
4
|
+
|
|
5
|
+
.wizard-outro {
|
|
6
|
+
.wizard-outro__row {
|
|
7
|
+
@include a.bp(lg) {
|
|
8
|
+
row-gap: var(--e-space-10);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@include a.bp(m) {
|
|
12
|
+
row-gap: var(--e-space-8);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.wizard-outro__image-col {
|
|
17
|
+
@include g.grid-col(4, 10);
|
|
18
|
+
|
|
19
|
+
@include a.bp(lg) {
|
|
20
|
+
@include g.grid-col(10, 10);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
img {
|
|
24
|
+
display: block;
|
|
25
|
+
width: 100%;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.wizard-outro__content-col {
|
|
30
|
+
@include g.grid-col(6, 10);
|
|
31
|
+
|
|
32
|
+
@include a.bp(lg) {
|
|
33
|
+
@include g.grid-col(10, 10);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.wizard-outro__title {
|
|
38
|
+
@include a.type(1000, strong);
|
|
39
|
+
|
|
40
|
+
@include a.bp(m) {
|
|
41
|
+
@include a.type(800, strong);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.wizard-outro__text {
|
|
46
|
+
margin-top: var(--e-space-6);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.wizard-outro__cta {
|
|
50
|
+
margin-top: var(--e-space-16);
|
|
51
|
+
|
|
52
|
+
@include a.bp(lg) {
|
|
53
|
+
margin-top: var(--e-space-12);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|