@energie360/ui-library 0.1.42 → 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 {
@@ -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" />
@@ -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>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@energie360/ui-library",
3
- "version": "0.1.42",
3
+ "version": "0.1.43",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",