@energie360/ui-library 0.1.41 → 0.1.43

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.
@@ -26,7 +26,7 @@
26
26
  top: 0;
27
27
  right: 0;
28
28
  aspect-ratio: 5/2;
29
- width: 85px;
29
+ width: 76px;
30
30
  z-index: 1;
31
31
  }
32
32
 
@@ -18,7 +18,7 @@ $image-width-small: 100px;
18
18
  }
19
19
 
20
20
  .card-price__subtext {
21
- color: var(--e-c-mono-500);
21
+ color: var(--e-c-mono-700);
22
22
 
23
23
  @include a.type(200);
24
24
  }
@@ -39,9 +39,11 @@ const iconMap = {
39
39
  <slot name="label">{{ label }}</slot>
40
40
  </span>
41
41
 
42
- <a v-if="link" :href="link.href" :target="link.target" class="hint__link">
43
- {{ link.label }}
44
- </a>
42
+ <slot v-if="hasSlotContent($slots.link) || link" name="link">
43
+ <a :href="link.href" :target="link.target" class="hint__link">
44
+ {{ link.label }}
45
+ </a>
46
+ </slot>
45
47
  </p>
46
48
 
47
49
  <URichtext v-if="text || $slots.default" class="hint__richtext" small :text>
@@ -51,6 +53,66 @@ const iconMap = {
51
53
  </template>
52
54
 
53
55
  <style scoped lang="scss" src="./hint.scss"></style>
56
+ <style scoped lang="scss">
57
+ @use '../../elements/text-link/text-link.scss' as t;
58
+ @use '../../base/abstracts' as a;
59
+
60
+ .hint__label {
61
+ :slotted(a) {
62
+ @include t.text-link;
63
+
64
+ display: inline-block;
65
+ color: inherit;
66
+ margin-left: var(--e-space-2);
67
+
68
+ &:active,
69
+ &:hover {
70
+ text-decoration-color: var(--e-c-secondary-05-200);
71
+ }
72
+
73
+ @include a.bp(lg) {
74
+ display: block;
75
+ margin-left: 0;
76
+ }
77
+ }
78
+ }
79
+
80
+ .hint.hint--warning .hint__label {
81
+ :slotted(a) {
82
+ &:active,
83
+ &:hover {
84
+ text-decoration-color: var(--e-c-signal-02-100);
85
+ }
86
+ }
87
+ }
88
+
89
+ .hint.hint--legal .hint__label {
90
+ :slotted(a) {
91
+ &:active,
92
+ &:hover {
93
+ text-decoration-color: var(--e-c-mono-100);
94
+ }
95
+ }
96
+ }
97
+
98
+ .hint.hint--error .hint__label {
99
+ :slotted(a) {
100
+ &:active,
101
+ &:hover {
102
+ text-decoration-color: var(--e-c-signal-03-100);
103
+ }
104
+ }
105
+ }
106
+
107
+ .hint.hint--task .hint__label {
108
+ :slotted(a) {
109
+ &:active,
110
+ &:hover {
111
+ text-decoration-color: var(--e-c-signal-03-100);
112
+ }
113
+ }
114
+ }
115
+ </style>
54
116
 
55
117
  <style lang="scss">
56
118
  .hint__richtext {
@@ -60,13 +60,25 @@ if (activeEdit) {
60
60
 
61
61
  const collapse = () => {
62
62
  expanded.value = false
63
+ emit('collapsed')
63
64
 
64
65
  if (update) {
65
66
  update('')
66
67
  }
67
68
  }
68
69
 
69
- defineExpose({ collapse })
70
+ const expand = () => {
71
+ expanded.value = true
72
+ emit('expanded')
73
+
74
+ update && update(editId)
75
+
76
+ setTimeout(() => {
77
+ rootEl.value.scrollIntoView()
78
+ }, 80)
79
+ }
80
+
81
+ defineExpose({ collapse, expand })
70
82
  </script>
71
83
 
72
84
  <template>
@@ -1,4 +1,4 @@
1
- @use '../../base/abstracts/' as a;
1
+ @use '../../base/abstracts' as a;
2
2
 
3
3
  .navigation-panel-tile {
4
4
  display: flex;
@@ -26,6 +26,12 @@
26
26
  border-color: var(--e-c-mono-200);
27
27
  }
28
28
 
29
+ &.greyed {
30
+ .navigation-panel-tile__icon-wrapper {
31
+ color: var(--e-c-mono-500);
32
+ }
33
+ }
34
+
29
35
  &.disabled {
30
36
  pointer-events: none;
31
37
  border-color: var(--e-c-mono-200);
@@ -7,9 +7,9 @@
7
7
  // This vertical centered style only works in the portal-main layout.
8
8
  // It's not really possible to do this "correctly" at the moment, because `portal-main__content` is `display: block`.
9
9
  // With `display: flex` it would work, but this would need some refactoring.
10
- position: relative;
11
- top: 50%;
12
- transform: translateY(-100%);
10
+ // position: relative;
11
+ // top: 50%;
12
+ // transform: translateY(-100%);
13
13
  }
14
14
  }
15
15
 
@@ -12,7 +12,7 @@
12
12
  --icon-fill-color: var(--e-c-primary-01-700);
13
13
  }
14
14
 
15
- &:hover {
15
+ &:hover:not(.no-hover) {
16
16
  background-color: var(--e-c-primary-01-100);
17
17
  border-color: var(--e-c-primary-01-100);
18
18
  color: var(--e-c-secondary-01-700);
@@ -13,7 +13,7 @@
13
13
  --dot-color: var(--e-c-mono-00);
14
14
  }
15
15
 
16
- &:hover {
16
+ &:hover:not(.no-hover) {
17
17
  background-color: var(--e-c-secondary-01-900);
18
18
  border-color: var(--e-c-secondary-01-900);
19
19
  }
@@ -13,8 +13,8 @@
13
13
  --dot-color: var(--e-c-mono-00);
14
14
  }
15
15
 
16
- &:hover {
17
- background-color: rgba(var(--e-c-primary-01-900-rgb), 0.7);
16
+ &:hover:not(.no-hover) {
17
+ background-color: rgb(var(--e-c-primary-01-900-rgb), 0.7);
18
18
  border-color: var(--e-c-primary-01-200);
19
19
  }
20
20
 
@@ -13,7 +13,7 @@
13
13
  --dot-color: var(--e-c-primary-01-500);
14
14
  }
15
15
 
16
- &:hover {
16
+ &:hover:not(.no-hover) {
17
17
  background-color: var(--e-c-primary-01-50);
18
18
  border-color: var(--e-c-primary-01-200);
19
19
  }
@@ -4,13 +4,13 @@
4
4
  background: none;
5
5
  border: 0;
6
6
  text-decoration: none;
7
- grid-gap: var(--e-space-1);
7
+ gap: var(--e-space-1);
8
8
 
9
9
  .icon {
10
10
  --icon-fill-color: var(--e-c-primary-01-700);
11
11
  }
12
12
 
13
- &:hover {
13
+ &:hover:not(.no-hover) {
14
14
  color: var(--e-c-secondary-01-900);
15
15
 
16
16
  .icon {
@@ -13,7 +13,7 @@
13
13
  --dot-color: var(--e-c-secondary-02-500);
14
14
  }
15
15
 
16
- &:hover {
16
+ &:hover:not(.no-hover) {
17
17
  background-color: var(--e-c-secondary-02-50);
18
18
  border-color: var(--e-c-secondary-02-200);
19
19
  }
@@ -22,7 +22,7 @@
22
22
  @include button-base;
23
23
 
24
24
  // ---- PRIMARY ----
25
- & {
25
+ &.filled {
26
26
  @include button-filled;
27
27
  }
28
28
 
@@ -81,6 +81,10 @@
81
81
  white-space: nowrap;
82
82
  }
83
83
 
84
+ &.no-hover {
85
+ cursor: default;
86
+ }
87
+
84
88
  // In some cases we need to force full width of a button.
85
89
  // Is mostly the case when the button is wrapped by another element.
86
90
  &.full-width {
@@ -17,6 +17,7 @@ interface ButtonProps {
17
17
  fullWidth?: boolean
18
18
  hideLabelM?: boolean
19
19
  hideLabelLg?: boolean
20
+ noHover?: boolean
20
21
  }
21
22
 
22
23
  const {
@@ -26,6 +27,7 @@ const {
26
27
  href = '',
27
28
  target = '',
28
29
  asSpan = false,
30
+ noHover = false,
29
31
  } = defineProps<ButtonProps>()
30
32
 
31
33
  const buttonTag = computed(() => (asSpan ? 'span' : 'button'))
@@ -42,6 +44,7 @@ const buttonTag = computed(() => (asSpan ? 'span' : 'button'))
42
44
  'full-width': fullWidth,
43
45
  'hide-label-m': hideLabelM,
44
46
  'hide-label-lg': hideLabelLg,
47
+ 'no-hover': noHover,
45
48
  },
46
49
  ]"
47
50
  :href
@@ -71,6 +74,7 @@ const buttonTag = computed(() => (asSpan ? 'span' : 'button'))
71
74
  'full-width': fullWidth,
72
75
  'hide-label-m': hideLabelM,
73
76
  'hide-label-lg': hideLabelLg,
77
+ 'no-hover': noHover,
74
78
  loading: loading,
75
79
  disabled,
76
80
  },
@@ -28,7 +28,12 @@ const { onChange } = useRadio({ model, provideKey })
28
28
  :class="[
29
29
  'select-chip__button',
30
30
  'button',
31
- { filled: model === value && !disabled, outlined: model !== value || disabled, disabled },
31
+ {
32
+ filled: model === value && !disabled,
33
+ outlined: model !== value || disabled,
34
+ disabled,
35
+ 'no-hover': model === value,
36
+ },
32
37
  ]"
33
38
  >
34
39
  <UIcon v-if="model === value" name="check" />
@@ -3,7 +3,18 @@
3
3
  .portal-content-aside-container {
4
4
  container-type: inline-size;
5
5
 
6
- @container (width <= 1020px) {
6
+ @container (width <= 880px) {
7
+ .portal-content-aside {
8
+ row-gap: var(--e-space-6);
9
+ column-gap: var(--e-space-8);
10
+ }
11
+
12
+ .portal-content-aside {
13
+ grid-template-columns: auto a.rem(280);
14
+ }
15
+ }
16
+
17
+ @container (width <= 700px) {
7
18
  .portal-content-aside {
8
19
  display: flex;
9
20
  flex-direction: column;
@@ -16,14 +27,8 @@
16
27
  display: grid;
17
28
  grid-template-columns: auto a.rem(320);
18
29
  grid-template-rows: repeat(2, auto);
19
- grid-column-gap: var(--e-space-24);
20
- grid-row-gap: var(--e-space-12);
21
-
22
- // @include a.bp(lg) {
23
- // display: flex;
24
- // flex-direction: column;
25
- // row-gap: var(--e-space-6);
26
- // }
30
+ column-gap: var(--e-space-24);
31
+ row-gap: var(--e-space-12);
27
32
  }
28
33
 
29
34
  .portal-content-aside__main {
@@ -4,7 +4,7 @@ import { UIconButton } from '../../elements'
4
4
  import { UContextMenu } from '../../components'
5
5
  import { Image } from '../../elements/types'
6
6
  import { getTranslation } from '../../utils/translations/translate'
7
- import { ref, watch, useTemplateRef } from 'vue'
7
+ import { ref, watch, useTemplateRef, onUnmounted } from 'vue'
8
8
 
9
9
  interface MenuButton {
10
10
  icon: string
@@ -80,6 +80,11 @@ watch(model, (newV) => {
80
80
  closePanel()
81
81
  }
82
82
  })
83
+
84
+ onUnmounted(() => {
85
+ // In case of re-render, remove this class from <html> tag.
86
+ document.documentElement.classList.toggle('navigation-toolbar-mobile-open', false)
87
+ })
83
88
  </script>
84
89
 
85
90
  <template>
@@ -36,7 +36,7 @@
36
36
  }
37
37
 
38
38
  .toast-message__inner {
39
- background-color: var(--e-c-signal-01-700);
39
+ background-color: var(--e-c-signal-01-900);
40
40
  }
41
41
  }
42
42
 
@@ -46,7 +46,7 @@
46
46
  }
47
47
 
48
48
  .toast-message__inner {
49
- background-color: var(--e-c-signal-03-700);
49
+ background-color: var(--e-c-signal-03-900);
50
50
  }
51
51
  }
52
52
 
@@ -3,12 +3,14 @@
3
3
  .toast {
4
4
  z-index: a.$layer-message;
5
5
  position: fixed;
6
- bottom: var(--e-space-6);
7
- left: 0;
6
+ bottom: var(--toast-offset-bottom);
7
+ padding-left: var(--toast-margin-left);
8
+ padding-right: var(--toast-margin-left);
9
+ left: var(--toast-offset-left);
8
10
  display: flex;
9
11
  flex-direction: column-reverse;
10
- align-items: center;
11
- width: 100%;
12
- grid-gap: var(--e-space-4);
12
+ align-items: var(--toast-align);
13
+ width: calc(100% - var(--toast-offset-left));
14
+ gap: var(--e-space-4);
13
15
  pointer-events: none;
14
16
  }
@@ -22,23 +22,21 @@ const close = () => dismiss(id)
22
22
 
23
23
  <template>
24
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>
25
+ <div class="toast-message__inner">
26
+ <div class="toast-message__icon">
27
+ <UIcon :name="MessageType[type]"></UIcon>
41
28
  </div>
29
+ <div ref="message" class="toast-message__message">
30
+ {{ message }}
31
+ </div>
32
+ <button
33
+ class="toast-message__close-button"
34
+ type="button"
35
+ aria-label="Close message"
36
+ @click="close"
37
+ >
38
+ <UIcon name="close"></UIcon>
39
+ </button>
42
40
  </div>
43
41
  </div>
44
42
  </template>
@@ -30,3 +30,18 @@ import { toasts } from './useToast'
30
30
  </style>
31
31
 
32
32
  <style scoped lang="scss" src="./toast.scss"></style>
33
+ <style lang="scss">
34
+ :root {
35
+ // Values
36
+ --toast-align-center: center;
37
+ --toast-align-left: flex-start;
38
+ --toast-align-right: flex-end;
39
+
40
+ // Default Settings
41
+ --toast-align: var(--toast-align-center);
42
+ --toast-margin-left: var(--e-space-5);
43
+ --toast-margin-right: var(--e-space-5);
44
+ --toast-offset-left: 0px;
45
+ --toast-offset-bottom: var(--e-space-6);
46
+ }
47
+ </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@energie360/ui-library",
3
- "version": "0.1.41",
3
+ "version": "0.1.43",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",