@energie360/ui-library 0.1.42 → 0.1.44

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
 
@@ -55,4 +55,13 @@ if (currentValue) {
55
55
  </div>
56
56
  </template>
57
57
 
58
- <style lang="scss" src="./card-footer.scss"></style>
58
+ <style scoped lang="scss" src="./card-footer.scss"></style>
59
+ <style scoped lang="scss">
60
+ .card-footer {
61
+ :slotted(a),
62
+ :slotted(button),
63
+ :slotted(.button) {
64
+ width: 100%;
65
+ }
66
+ }
67
+ </style>
@@ -23,6 +23,28 @@
23
23
  }
24
24
  }
25
25
 
26
+ &.columns-2 {
27
+ grid-template-columns: repeat(2, 1fr);
28
+ grid-template-rows: 1fr;
29
+
30
+ @include a.bp(m) {
31
+ grid-template-columns: repeat(1, 1fr);
32
+ }
33
+ }
34
+
35
+ &.columns-3 {
36
+ grid-template-columns: repeat(3, 1fr);
37
+ grid-template-rows: 1fr;
38
+
39
+ @include a.bp(xl) {
40
+ grid-template-columns: repeat(2, 1fr);
41
+ }
42
+
43
+ @include a.bp(m) {
44
+ grid-template-columns: repeat(1, 1fr);
45
+ }
46
+ }
47
+
26
48
  &.columns-4 {
27
49
  grid-template-columns: repeat(4, 1fr);
28
50
  grid-template-rows: 1fr;
@@ -50,9 +50,11 @@ defineProps<Props>()
50
50
  </div>
51
51
  </div>
52
52
 
53
- <div v-if="image || $slots.image" class="image-col">
53
+ <div v-if="hasSlotContent($slots.image) || image" class="image-col">
54
54
  <div class="image-background">
55
- <slot name="image"><img v-if="image" :src="image.src" :alt="image.alt" /></slot>
55
+ <slot name="image">
56
+ <img :src="image.src" :alt="image.alt" />
57
+ </slot>
56
58
  </div>
57
59
  </div>
58
60
 
@@ -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 {
@@ -16,7 +16,7 @@ const {
16
16
  alt: 'Logo Energie 360°',
17
17
  },
18
18
  logoMinifiedImage = {
19
- src: '/static/ui-assets/images/logo-mini.svg',
19
+ src: '/static/ui-assets/images/logo-short-inverted.svg',
20
20
  alt: 'Logo Energie 360°',
21
21
  },
22
22
  } = defineProps<Props>()
@@ -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
  },
@@ -19,8 +19,6 @@
19
19
 
20
20
  // TODO: find a better solution for this.
21
21
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' viewBox='0 0 24 24'%3E%3Cpath fill='%233c8420' fill-rule='evenodd' d='M5.293 8.293a1 1 0 0 1 1.414 0L12 13.586l5.293-5.293a1 1 0 1 1 1.414 1.414l-6 6a1 1 0 0 1-1.414 0l-6-6a1 1 0 0 1 0-1.414' clip-rule='evenodd'/%3E%3C/svg%3E");
22
-
23
- // background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.06 5.53 8 8.583 4.94 5.53 4 6.47l4 4 4-4-.94-.94Z' fill='%23333'/%3E%3C/svg%3E");
24
22
  }
25
23
 
26
24
  select {
@@ -43,4 +41,12 @@
43
41
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' viewBox='0 0 24 24'%3E%3Cpath fill='%23b3b3b3' fill-rule='evenodd' d='M5.293 8.293a1 1 0 0 1 1.414 0L12 13.586l5.293-5.293a1 1 0 1 1 1.414 1.414l-6 6a1 1 0 0 1-1.414 0l-6-6a1 1 0 0 1 0-1.414' clip-rule='evenodd'/%3E%3C/svg%3E");
44
42
  }
45
43
  }
44
+
45
+ &.readonly {
46
+ pointer-events: none;
47
+
48
+ .control::after {
49
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' viewBox='0 0 24 24'%3E%3Cpath fill='%236b6b6b' fill-rule='evenodd' d='M5.293 8.293a1 1 0 0 1 1.414 0L12 13.586l5.293-5.293a1 1 0 1 1 1.414 1.414l-6 6a1 1 0 0 1-1.414 0l-6-6a1 1 0 0 1 0-1.414' clip-rule='evenodd'/%3E%3C/svg%3E");
50
+ }
51
+ }
46
52
  }
@@ -6,6 +6,7 @@ import { getTranslation } from '../../utils/translations/translate'
6
6
 
7
7
  interface Props extends FormFieldBase {
8
8
  name: string
9
+ readonly?: boolean
9
10
  options: SelectOption[]
10
11
  }
11
12
 
@@ -14,6 +15,7 @@ const model = defineModel<string>()
14
15
  const {
15
16
  disabled = false,
16
17
  required = false,
18
+ readonly = false,
17
19
  helpText = '',
18
20
  errorMessage = '',
19
21
  } = defineProps<Props>()
@@ -27,7 +29,7 @@ const isHovering = ref(false)
27
29
  const spacer = '.&nbsp;'
28
30
 
29
31
  const onFocus = () => {
30
- if (disabled) {
32
+ if (readonly || disabled) {
31
33
  return
32
34
  }
33
35
 
@@ -39,7 +41,7 @@ const onBlur = () => {
39
41
  }
40
42
 
41
43
  const onHover = () => {
42
- if (disabled) {
44
+ if (readonly || disabled) {
43
45
  return
44
46
  }
45
47
 
@@ -66,6 +68,7 @@ const needsHelpTextSpacer = computed(() => {
66
68
  {
67
69
  required,
68
70
  disabled,
71
+ readonly,
69
72
  focus: isFocused,
70
73
  hover: isHovering,
71
74
  'float-label': true,
@@ -90,6 +93,7 @@ const needsHelpTextSpacer = computed(() => {
90
93
  v-model="model"
91
94
  :disabled
92
95
  :required
96
+ :aria-readonly="readonly"
93
97
  :name
94
98
  @focus="onFocus"
95
99
  @blur="onBlur"
@@ -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" />
@@ -203,3 +203,8 @@ $trs-pressed: var(--e-trs-duration-fastest) cubic-bezier(0.34, 1.56, 0.64, 1); /
203
203
  border-radius: var(--e-brd-radius-1);
204
204
  }
205
205
  }
206
+
207
+ .select-tile__content:not(:has(.select-tile__label-wrapper), :has(.select-tile__icon-wrapper)),
208
+ .select-tile__content:not(:has(.select-tile__text-wrapper), :has(.select-tile__icon-wrapper)) {
209
+ align-self: center;
210
+ }
@@ -1,11 +1,12 @@
1
1
  <script setup lang="ts">
2
2
  import UIcon from '../icon/u-icon.vue'
3
3
  import { useRadio } from '../radio-group/radio-group-composables'
4
+ import { hasSlotContent } from '../../utils/vue/helpers'
4
5
 
5
6
  interface Props {
6
7
  name: string
7
- label: string
8
- text: string
8
+ label?: string
9
+ text?: string
9
10
  disabled?: boolean
10
11
  value: string
11
12
  icon: string
@@ -13,7 +14,12 @@ interface Props {
13
14
  provideKey?: string
14
15
  }
15
16
 
16
- const { disabled = false, radio = false, provideKey = 'select-tile-group' } = defineProps<Props>()
17
+ const {
18
+ disabled = false,
19
+ radio = false,
20
+ provideKey = 'select-tile-group',
21
+ label = '',
22
+ } = defineProps<Props>()
17
23
 
18
24
  const model = defineModel<string>()
19
25
  const { onChange } = useRadio({ model, provideKey })
@@ -32,15 +38,19 @@ const { onChange } = useRadio({ model, provideKey })
32
38
  </div>
33
39
 
34
40
  <!-- LABEL -->
35
- <div class="select-tile__label-wrapper">
41
+ <div v-if="hasSlotContent($slots.label) || label" class="select-tile__label-wrapper">
36
42
  <slot name="label">
37
43
  {{ label }}
38
44
  </slot>
39
45
  </div>
40
46
 
41
47
  <!-- TEXT -->
42
- <div class="select-tile__text-wrapper">
43
- <p>{{ text }}</p>
48
+ <div v-if="hasSlotContent($slots.text) || text" class="select-tile__text-wrapper">
49
+ <p>
50
+ <slot name="text">
51
+ {{ text }}
52
+ </slot>
53
+ </p>
44
54
  </div>
45
55
  </div>
46
56
 
@@ -24,11 +24,11 @@ interface Props {
24
24
  const {
25
25
  collapsed = false,
26
26
  logoImage = {
27
- src: '/static/ui-assets/images/logo-white.svg',
27
+ src: '/static/ui-assets/images/logo-short-inverted.svg',
28
28
  alt: 'Logo Energie 360°',
29
29
  },
30
30
  logoMinifiedImage = {
31
- src: '/static/ui-assets/images/logo-mini.svg',
31
+ src: '/static/ui-assets/images/logo-short-inverted.svg',
32
32
  alt: 'Logo Energie 360°',
33
33
  },
34
34
  logoLink = {
@@ -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.44",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -12,9 +12,9 @@ defineProps<Props>()
12
12
  <div class="left-col">
13
13
  <div>
14
14
  <div class="title-slot">
15
- <slot name="title"
16
- ><h1>{{ title }}</h1></slot
17
- >
15
+ <slot name="title">
16
+ <h1>{{ title }}</h1>
17
+ </slot>
18
18
  </div>
19
19
 
20
20
  <div class="description-slot">
@@ -35,6 +35,4 @@ defineProps<Props>()
35
35
  </div>
36
36
  </template>
37
37
 
38
- <style lang="scss" scoped>
39
- @use './wizard-intro.scss';
40
- </style>
38
+ <style lang="scss" scoped src="./wizard-intro.scss"></style>