@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.
Files changed (35) hide show
  1. package/components/navigation-panel-tile/navigation-panel-tile.scss +1 -1
  2. package/components/navigation-panel-tile/u-navigation-panel-tile.vue +17 -13
  3. package/components/richtext/_wizard.scss +26 -0
  4. package/components/richtext/richtext.scss +2 -1
  5. package/elements/checkbox/checkbox.scss +150 -0
  6. package/elements/checkbox/u-checkbox.vue +42 -0
  7. package/elements/index.js +3 -0
  8. package/elements/radio/radio.scss +91 -2
  9. package/elements/radio/u-radio.vue +6 -3
  10. package/elements/radio-group/radio-group.scss +28 -0
  11. package/elements/radio-group/u-radio-group.vue +23 -3
  12. package/elements/select-chip/select-chip.scss +1 -0
  13. package/elements/select-chip/u-select-chip.vue +2 -2
  14. package/elements/select-chips/select-chips.scss +18 -0
  15. package/elements/select-chips/u-select-chips.vue +16 -3
  16. package/elements/select-tile/select-tile.scss +205 -0
  17. package/elements/select-tile/u-select-tile.vue +53 -0
  18. package/elements/select-tiles/select-tiles.scss +32 -0
  19. package/elements/select-tiles/u-select-tiles.vue +31 -0
  20. package/elements/text-field/u-text-field.vue +3 -1
  21. package/elements/toggle-switch/toggle-switch.scss +14 -4
  22. package/elements/toggle-switch/u-toggle-switch.vue +23 -20
  23. package/modules/index.js +3 -0
  24. package/modules/navigation-panel/navigation-panel.scss +1 -0
  25. package/modules/progress-indicator/progress-indicator.scss +84 -0
  26. package/modules/progress-indicator/u-progress-indicator.vue +34 -0
  27. package/modules/toast/toast-message.scss +67 -0
  28. package/modules/toast/toast.scss +14 -0
  29. package/modules/toast/u-toast-message.vue +46 -0
  30. package/modules/toast/u-toast.vue +26 -0
  31. package/modules/toast/useToast.ts +40 -0
  32. package/package.json +1 -1
  33. package/wizard/index.js +1 -0
  34. package/wizard/wizard-outro/u-wizard-outro.vue +49 -0
  35. package/wizard/wizard-outro/wizard-outro.scss +56 -0
@@ -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.15",
3
+ "version": "0.1.16",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
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
+ }