@energie360/ui-library 1.1.0 → 1.2.0

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.
@@ -29,4 +29,9 @@
29
29
  .button-tile__left {
30
30
  display: flex;
31
31
  flex-direction: column;
32
+ hyphens: auto;
33
+ }
34
+
35
+ .button-tile__right {
36
+ flex: 0 0 auto;
32
37
  }
@@ -98,7 +98,7 @@
98
98
  }
99
99
 
100
100
  .error-message-container {
101
- @include a.type(50);
101
+ @include a.type(50, strong);
102
102
 
103
103
  display: none;
104
104
  margin-top: var(--e-space-1);
@@ -1,6 +1,13 @@
1
- @use '../../base/abstracts/' as a;
1
+ @use '../../base/abstracts' as a;
2
2
 
3
3
  .select-tiles {
4
+ // Modifiers
5
+ &.columns-3 {
6
+ .select-tiles__items {
7
+ grid-template-columns: repeat(3, 1fr);
8
+ }
9
+ }
10
+
4
11
  &.error {
5
12
  .select-tiles__error-message {
6
13
  display: block;
@@ -11,10 +18,10 @@
11
18
  .select-tiles__items {
12
19
  display: grid;
13
20
  grid-template-columns: repeat(2, 1fr);
14
- grid-gap: var(--e-space-10);
21
+ gap: var(--e-space-10);
15
22
 
16
23
  @include a.bp(lg) {
17
- grid-gap: var(--e-space-4);
24
+ gap: var(--e-space-4);
18
25
  }
19
26
 
20
27
  @include a.bp(m) {
@@ -4,9 +4,10 @@ import { useRadioGroup } from '../radio-group/radio-group-composables'
4
4
  interface Props {
5
5
  error?: boolean
6
6
  errorMessage?: string
7
+ columns?: 2 | 3
7
8
  }
8
9
 
9
- defineProps<Props>()
10
+ const { columns = 2, errorMessage = '' } = defineProps<Props>()
10
11
 
11
12
  const model = defineModel<string>()
12
13
 
@@ -17,7 +18,7 @@ useRadioGroup({
17
18
  </script>
18
19
 
19
20
  <template>
20
- <div :class="['select-tiles', { error }]">
21
+ <div :class="['select-tiles', `columns-${columns}`, { error }]">
21
22
  <div class="select-tiles__items">
22
23
  <slot></slot>
23
24
  </div>
package/globals.js CHANGED
@@ -6,6 +6,6 @@
6
6
  // TODO: Find a more 'generic' way to set an environment variable when using/developing the library.
7
7
  // In the meantime we'll just use this fixed path for the ui-assets.
8
8
 
9
- const assetsPathPrefix = import.meta.env.VITE_ASSETS_PATH_PREFIX || ''
9
+ const assetsPathPrefix = import.meta?.env ? import.meta.env.VITE_ASSETS_PATH_PREFIX || '' : ''
10
10
 
11
11
  export const assetsPath = assetsPathPrefix + '/static/ui-assets/'
@@ -71,7 +71,7 @@ const onMousemove = (e: MouseEvent) => {
71
71
  @ready="onSpriteReady"
72
72
  />
73
73
  </div>
74
- <img :src="`${assetsPath}images/forest.png`" alt="" />
74
+ <img :src="`${assetsPath}images/forest.png`" alt="Forest background" />
75
75
  </div>
76
76
  </div>
77
77
  </template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@energie360/ui-library",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -9,7 +9,15 @@ const getLanguage = () => {
9
9
  }
10
10
 
11
11
  export const getTranslation = (key, replace) => {
12
- let translation = translations[getLanguage()][key]
12
+ const currentLanguage = getLanguage()
13
+
14
+ let translation
15
+
16
+ if (currentLanguage in translations) {
17
+ translation = translations[currentLanguage][key]
18
+ } else {
19
+ translation = translations[DEFAULT_LANGUAGE][key]
20
+ }
13
21
 
14
22
  if (replace) {
15
23
  for (key in replace) {
@@ -1,5 +1,13 @@
1
+ <script setup lang="ts">
2
+ interface Props {
3
+ embedded?: boolean
4
+ }
5
+
6
+ defineProps<Props>()
7
+ </script>
8
+
1
9
  <template>
2
- <div class="container">
10
+ <div :class="['container', { embedded }]">
3
11
  <div class="wizard-layout">
4
12
  <slot />
5
13
  </div>
@@ -5,19 +5,24 @@
5
5
  .container {
6
6
  @include c.grid-container;
7
7
 
8
+ --e-wizard-wrapper-top: #{a.rem(dt.$space-28)};
9
+ --e-wizard-wrapper-bottom: #{a.rem(dt.$space-28)};
10
+ --e-wizard-block-bottom: #{a.rem(dt.$space-16)};
11
+ --e-wizard-block-between: #{a.rem(dt.$space-6)};
12
+
8
13
  // TODO: Can we do this differently?
9
14
  &.embedded {
10
15
  padding-left: 0;
11
16
  padding-right: 0;
17
+
18
+ .wizard-layout {
19
+ padding-top: 0;
20
+ padding-bottom: 0;
21
+ }
12
22
  }
13
23
  }
14
24
 
15
25
  .wizard-layout {
16
- --e-wizard-wrapper-top: #{a.rem(dt.$space-28)};
17
- --e-wizard-wrapper-bottom: #{a.rem(dt.$space-28)};
18
- --e-wizard-block-bottom: #{a.rem(dt.$space-16)};
19
- --e-wizard-block-between: #{a.rem(dt.$space-6)};
20
-
21
26
  padding-top: var(--e-wizard-wrapper-top);
22
27
  padding-bottom: var(--e-wizard-wrapper-bottom);
23
28