@energie360/ui-library 0.1.15 → 0.1.16
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/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 +2 -1
- package/elements/checkbox/checkbox.scss +150 -0
- package/elements/checkbox/u-checkbox.vue +42 -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 +3 -1
- package/elements/toggle-switch/toggle-switch.scss +14 -4
- package/elements/toggle-switch/u-toggle-switch.vue +23 -20
- package/modules/index.js +3 -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 +1 -1
- 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,205 @@
|
|
|
1
|
+
@use '../../base/abstracts/' as a;
|
|
2
|
+
|
|
3
|
+
$transition-options: var(--e-trs-duration-faster) var(--e-trs-easing-default);
|
|
4
|
+
$trs-pressed: var(--e-trs-duration-fastest) cubic-bezier(0.34, 1.56, 0.64, 1); // https://easings.net/#easeOutBack
|
|
5
|
+
|
|
6
|
+
.select-tile {
|
|
7
|
+
position: relative;
|
|
8
|
+
display: flex;
|
|
9
|
+
height: 100%;
|
|
10
|
+
column-gap: var(--e-space-4);
|
|
11
|
+
border-radius: var(--e-brd-radius-2);
|
|
12
|
+
border: 2px solid var(--e-c-secondary-01-100);
|
|
13
|
+
padding: var(--e-space-6);
|
|
14
|
+
transition:
|
|
15
|
+
border $transition-options,
|
|
16
|
+
background $transition-options,
|
|
17
|
+
transform $trs-pressed;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
|
|
20
|
+
// CHECKED/ACTIVE
|
|
21
|
+
&.checked {
|
|
22
|
+
background-color: var(--e-c-primary-01-50);
|
|
23
|
+
border-color: var(--e-c-primary-01-500);
|
|
24
|
+
|
|
25
|
+
.select-tile__icon-wrapper,
|
|
26
|
+
.select-tile__label-wrapper {
|
|
27
|
+
color: var(--e-c-primary-01-900);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.select-tile__text-wrapper {
|
|
31
|
+
color: var(--e-c-primary-01-700);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.select-tile__radio-symbol {
|
|
35
|
+
&::after {
|
|
36
|
+
border-color: var(--e-c-secondary-01-900);
|
|
37
|
+
border-width: 5px;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// HOVER
|
|
43
|
+
&:hover {
|
|
44
|
+
border-color: var(--e-c-primary-01-200);
|
|
45
|
+
|
|
46
|
+
.select-tile__radio-symbol {
|
|
47
|
+
&::before {
|
|
48
|
+
background-color: var(--e-c-primary-01-50);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&::after {
|
|
52
|
+
border-color: var(--e-c-secondary-01-900);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&.checked {
|
|
57
|
+
border-color: var(--e-c-primary-01-900);
|
|
58
|
+
|
|
59
|
+
.select-tile__label-wrapper,
|
|
60
|
+
.select-tile__icon-wrapper {
|
|
61
|
+
color: var(--e-c-primary-01-700);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.select-tile__text-wrapper {
|
|
65
|
+
color: var(--e-c-primary-01-500);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// PRESSED
|
|
71
|
+
&:active {
|
|
72
|
+
background-color: var(--e-c-primary-01-50);
|
|
73
|
+
transform: scale(0.98);
|
|
74
|
+
|
|
75
|
+
.select-tile__label-wrapper,
|
|
76
|
+
.select-tile__icon-wrapper {
|
|
77
|
+
color: var(--e-c-primary-01-700);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.select-tile__text-wrapper {
|
|
81
|
+
color: var(--e-c-primary-01-500);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.select-tile__radio-symbol {
|
|
85
|
+
&::before {
|
|
86
|
+
background-color: var(--e-c-primary-01-100);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&::after {
|
|
90
|
+
border-color: var(--e-c-secondary-01-900);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&.checked {
|
|
95
|
+
background-color: var(--e-c-primary-01-100);
|
|
96
|
+
border-color: var(--e-c-primary-01-500);
|
|
97
|
+
|
|
98
|
+
.select-tile__radio-symbol {
|
|
99
|
+
&::before {
|
|
100
|
+
background-color: var(--e-c-primary-01-50);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// DISABLED
|
|
107
|
+
&.disabled {
|
|
108
|
+
border-color: var(--e-c-mono-500);
|
|
109
|
+
pointer-events: none;
|
|
110
|
+
|
|
111
|
+
.select-tile__radio-symbol {
|
|
112
|
+
&::after {
|
|
113
|
+
border-color: var(--e-c-mono-200);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.select-tile__label-wrapper,
|
|
118
|
+
.select-tile__icon-wrapper {
|
|
119
|
+
color: var(--e-c-mono-500);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.select-tile__text-wrapper {
|
|
123
|
+
color: var(--e-c-mono-200);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&.checked {
|
|
127
|
+
background-color: var(--e-c-mono-50);
|
|
128
|
+
|
|
129
|
+
.select-tile__radio-symbol {
|
|
130
|
+
&::after {
|
|
131
|
+
border-width: 2px;
|
|
132
|
+
background-color: var(--e-c-mono-200);
|
|
133
|
+
box-shadow: 0 0 0 3px var(--e-c-mono-50) inset;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.select-tile__radio-symbol {
|
|
141
|
+
position: relative;
|
|
142
|
+
display: block;
|
|
143
|
+
width: a.rem(40);
|
|
144
|
+
height: a.rem(40);
|
|
145
|
+
|
|
146
|
+
&::before {
|
|
147
|
+
content: '';
|
|
148
|
+
position: absolute;
|
|
149
|
+
inset: 0;
|
|
150
|
+
border-radius: 100%;
|
|
151
|
+
transition: background $transition-options;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&::after {
|
|
155
|
+
content: '';
|
|
156
|
+
position: absolute;
|
|
157
|
+
top: calc(50% - #{a.rem(10)});
|
|
158
|
+
left: calc(50% - #{a.rem(10)});
|
|
159
|
+
width: a.rem(20);
|
|
160
|
+
height: a.rem(20);
|
|
161
|
+
border-radius: 100%;
|
|
162
|
+
border: 2px solid var(--e-c-mono-900);
|
|
163
|
+
transition: border $transition-options;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.select-tile__icon-wrapper {
|
|
168
|
+
margin-bottom: var(--e-space-4);
|
|
169
|
+
transition: color $transition-options;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.select-tile__radio-wrapper {
|
|
173
|
+
display: flex;
|
|
174
|
+
align-items: center;
|
|
175
|
+
justify-content: center;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.select-tile__label-wrapper {
|
|
179
|
+
transition: color $transition-options;
|
|
180
|
+
|
|
181
|
+
@include a.type(300, strong);
|
|
182
|
+
|
|
183
|
+
+ .select-tile__text-wrapper {
|
|
184
|
+
margin-top: var(--e-space-1);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.select-tile__text-wrapper {
|
|
189
|
+
color: var(--e-c-mono-700);
|
|
190
|
+
transition: color $transition-options;
|
|
191
|
+
|
|
192
|
+
@include a.type(300, weak);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.select-tile__input-wrapper {
|
|
196
|
+
position: absolute;
|
|
197
|
+
inset: 0;
|
|
198
|
+
z-index: -1;
|
|
199
|
+
|
|
200
|
+
input {
|
|
201
|
+
width: 100%;
|
|
202
|
+
height: 100%;
|
|
203
|
+
border-radius: var(--e-brd-radius-1);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import UIcon from '../icon/u-icon.vue'
|
|
3
|
+
import { useRadio } from '../radio-group/radio-group-composables'
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
name: string
|
|
7
|
+
label: string
|
|
8
|
+
text: string
|
|
9
|
+
disabled?: boolean
|
|
10
|
+
value: string
|
|
11
|
+
icon: string
|
|
12
|
+
radio?: boolean
|
|
13
|
+
provideKey?: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const { disabled = false, radio = false, provideKey = 'select-tile-group' } = defineProps<Props>()
|
|
17
|
+
|
|
18
|
+
const model = defineModel<string>()
|
|
19
|
+
const { onChange } = useRadio({ model, provideKey })
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<label :class="['select-tile', { checked: model === value, disabled }]">
|
|
24
|
+
<div v-if="radio" class="select-tile__radio-wrapper">
|
|
25
|
+
<span class="select-tile__radio-symbol"></span>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<div class="select-tile__content">
|
|
29
|
+
<!-- ICON -->
|
|
30
|
+
<div v-if="icon" class="select-tile__icon-wrapper">
|
|
31
|
+
<UIcon :name="icon" :width="40" :height="40" />
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<!-- LABEL -->
|
|
35
|
+
<div class="select-tile__label-wrapper">
|
|
36
|
+
<slot name="label">
|
|
37
|
+
{{ label }}
|
|
38
|
+
</slot>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<!-- TEXT -->
|
|
42
|
+
<div class="select-tile__text-wrapper">
|
|
43
|
+
<p>{{ text }}</p>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<div class="select-tile__input-wrapper">
|
|
48
|
+
<input type="radio" :name :value :disabled @change="onChange" />
|
|
49
|
+
</div>
|
|
50
|
+
</label>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<style scoped style="scss" src="./select-tile.scss"></style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
@use '../../base/abstracts/' as a;
|
|
2
|
+
|
|
3
|
+
.select-tiles {
|
|
4
|
+
&.error {
|
|
5
|
+
.select-tiles__error-message {
|
|
6
|
+
display: block;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.select-tiles__items {
|
|
12
|
+
display: grid;
|
|
13
|
+
grid-template-columns: repeat(2, 1fr);
|
|
14
|
+
grid-gap: var(--e-space-10);
|
|
15
|
+
|
|
16
|
+
@include a.bp(lg) {
|
|
17
|
+
grid-gap: var(--e-space-4);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@include a.bp(m) {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.select-tiles__error-message {
|
|
27
|
+
@include a.type(50, strong);
|
|
28
|
+
|
|
29
|
+
display: none;
|
|
30
|
+
margin-top: var(--e-space-1);
|
|
31
|
+
color: var(--e-c-signal-03-700);
|
|
32
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useRadioGroup } from '../radio-group/radio-group-composables'
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
error?: boolean
|
|
6
|
+
errorMessage?: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
defineProps<Props>()
|
|
10
|
+
|
|
11
|
+
const model = defineModel<string>()
|
|
12
|
+
|
|
13
|
+
useRadioGroup({
|
|
14
|
+
model,
|
|
15
|
+
provideKey: 'select-tile-group',
|
|
16
|
+
})
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<div :class="['select-tiles', { error }]">
|
|
21
|
+
<div class="select-tiles__items">
|
|
22
|
+
<slot></slot>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<div class="select-tiles__error-message">
|
|
26
|
+
<slot name="error-message">{{ errorMessage }}</slot>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<style scoped style="scss" src="./select-tiles.scss"></style>
|
|
@@ -37,7 +37,7 @@ const input = useTemplateRef('input')
|
|
|
37
37
|
const isFocused = ref(false)
|
|
38
38
|
const isHovering = ref(false)
|
|
39
39
|
const hasValue = ref(false) // only needed for input type 'search'
|
|
40
|
-
const forceFloatLabel = ref(
|
|
40
|
+
const forceFloatLabel = ref(type === TextFieldTypes.date) // input-type 'date' doesn't support placeholder.
|
|
41
41
|
|
|
42
42
|
const spacer = '. '
|
|
43
43
|
|
|
@@ -122,6 +122,7 @@ watch(
|
|
|
122
122
|
'has-error': error,
|
|
123
123
|
'show-help-text': hasHelpText,
|
|
124
124
|
},
|
|
125
|
+
type,
|
|
125
126
|
]"
|
|
126
127
|
@mouseenter="onHover"
|
|
127
128
|
@mouseleave="onHoverOut"
|
|
@@ -145,6 +146,7 @@ watch(
|
|
|
145
146
|
:readonly
|
|
146
147
|
:placeholder
|
|
147
148
|
:required
|
|
149
|
+
v-bind="$attrs"
|
|
148
150
|
@input="onInput"
|
|
149
151
|
@focus="onFocus"
|
|
150
152
|
@focusout="$emit('focusout', $event.target)"
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
// So that the focus works nicely.
|
|
18
18
|
position: absolute;
|
|
19
19
|
inset: 0;
|
|
20
|
+
border-radius: calc(var(--height) / 2);
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
|
|
@@ -87,6 +88,12 @@
|
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
// States
|
|
91
|
+
&.error {
|
|
92
|
+
.toggle-switch__error-text {
|
|
93
|
+
display: block;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
90
97
|
&.checked {
|
|
91
98
|
.toggle-switch__toggle {
|
|
92
99
|
background-color: var(--e-c-primary-01-900);
|
|
@@ -141,9 +148,12 @@
|
|
|
141
148
|
background-color: var(--e-c-mono-50);
|
|
142
149
|
}
|
|
143
150
|
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.toggle-switch__error-text {
|
|
154
|
+
@include a.type(50, strong);
|
|
144
155
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
// }
|
|
156
|
+
display: none;
|
|
157
|
+
margin-top: var(--e-space-1);
|
|
158
|
+
color: var(--e-c-signal-03-700);
|
|
149
159
|
}
|
|
@@ -6,10 +6,9 @@ import { getTranslation } from '../../utils/translations/translate'
|
|
|
6
6
|
export interface ToggleSwitch {
|
|
7
7
|
name: string
|
|
8
8
|
label?: string
|
|
9
|
-
required?: boolean
|
|
10
9
|
disabled?: boolean
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
error: boolean
|
|
11
|
+
errorMessage?: string
|
|
13
12
|
variant?: 'normal' | 'small'
|
|
14
13
|
labelPosition?: 'left' | 'right'
|
|
15
14
|
}
|
|
@@ -18,8 +17,8 @@ const {
|
|
|
18
17
|
variant = 'big',
|
|
19
18
|
labelPosition = 'right',
|
|
20
19
|
disabled = false,
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
errorMessage = '',
|
|
21
|
+
error,
|
|
23
22
|
} = defineProps<ToggleSwitch>()
|
|
24
23
|
|
|
25
24
|
const model = defineModel<boolean>({ default: false })
|
|
@@ -35,7 +34,7 @@ const checkIcon = computed(() => iconsMap[variant][1])
|
|
|
35
34
|
const classes = computed(() => ({
|
|
36
35
|
checked: model.value,
|
|
37
36
|
disabled,
|
|
38
|
-
|
|
37
|
+
error,
|
|
39
38
|
[`toggle-switch--${variant}`]: variant,
|
|
40
39
|
[`label-${labelPosition}`]: labelPosition,
|
|
41
40
|
}))
|
|
@@ -45,24 +44,28 @@ const classes = computed(() => ({
|
|
|
45
44
|
<div :class="['toggle-switch', classes]">
|
|
46
45
|
<label class="toggle-switch__wrapper">
|
|
47
46
|
<span class="toggle-switch__toggle">
|
|
48
|
-
<span class="toggle-switch__text yes" :aria-hidden="model
|
|
49
|
-
getTranslation('yes')
|
|
50
|
-
|
|
51
|
-
<span class="toggle-switch__text no" :aria-hidden="model
|
|
52
|
-
getTranslation('no')
|
|
53
|
-
|
|
47
|
+
<span class="toggle-switch__text yes" :aria-hidden="model ? 'false' : 'true'">
|
|
48
|
+
{{ getTranslation('yes') }}
|
|
49
|
+
</span>
|
|
50
|
+
<span class="toggle-switch__text no" :aria-hidden="model ? 'true' : 'false'">
|
|
51
|
+
{{ getTranslation('no') }}
|
|
52
|
+
</span>
|
|
54
53
|
<span class="toggle-switch__handle">
|
|
55
|
-
<UIcon :name="model
|
|
54
|
+
<UIcon :name="model ? checkIcon : uncheckIcon" custom-size />
|
|
56
55
|
</span>
|
|
57
56
|
</span>
|
|
58
|
-
|
|
59
|
-
<slot name="
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
|
|
58
|
+
<slot name="label">{{ label }}</slot>
|
|
59
|
+
|
|
60
|
+
<slot name="input">
|
|
61
|
+
<input v-model="model" type="checkbox" :name :disabled v-bind="$attrs" />
|
|
62
|
+
</slot>
|
|
62
63
|
</label>
|
|
64
|
+
|
|
65
|
+
<div class="toggle-switch__error-text">
|
|
66
|
+
<slot name="error-message">{{ errorMessage }}</slot>
|
|
67
|
+
</div>
|
|
63
68
|
</div>
|
|
64
69
|
</template>
|
|
65
70
|
|
|
66
|
-
<style lang="scss">
|
|
67
|
-
@use './toggle-switch.scss';
|
|
68
|
-
</style>
|
|
71
|
+
<style scoped lang="scss" src="./toggle-switch.scss"></style>
|
package/modules/index.js
CHANGED
|
@@ -4,3 +4,6 @@ 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'
|
|
@@ -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
|
+
}
|