@energie360/ui-library 0.1.16 → 0.1.17

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.
@@ -0,0 +1,40 @@
1
+ @use '../../base/abstracts' as a;
2
+
3
+ .card-info {
4
+ padding: var(--e-space-6);
5
+ border: 1px solid var(--e-c-mono-200);
6
+ border-top-left-radius: var(--e-brd-radius-2);
7
+ border-top-right-radius: var(--e-brd-radius-2);
8
+
9
+ &:last-of-type {
10
+ border-bottom-left-radius: var(--e-brd-radius-2);
11
+ border-bottom-right-radius: var(--e-brd-radius-2);
12
+ }
13
+ }
14
+
15
+ .card-info__image {
16
+ width: a.rem(80);
17
+ height: a.rem(80);
18
+
19
+ + .card-info__title {
20
+ margin-top: var(--e-space-4);
21
+ }
22
+ }
23
+
24
+ .card-info__title {
25
+ @include a.type(300, strong);
26
+
27
+ + .card-info__description {
28
+ margin-top: var(--e-space-1);
29
+ }
30
+ }
31
+
32
+ .card-info__description {
33
+ @include a.type(200);
34
+ }
35
+
36
+ .card-info + .card-info {
37
+ border-top: none;
38
+ border-top-left-radius: 0;
39
+ border-top-right-radius: 0;
40
+ }
@@ -0,0 +1,35 @@
1
+ <script setup lang="ts">
2
+ import { Image } from '../../elements/types'
3
+
4
+ interface Props {
5
+ image?: Image
6
+ title?: string
7
+ description?: string
8
+ }
9
+
10
+ defineProps<Props>()
11
+ </script>
12
+
13
+ <template>
14
+ <section class="card-info">
15
+ <div class="card-info__image">
16
+ <slot name="image">
17
+ <img v-bind="image" />
18
+ </slot>
19
+ </div>
20
+
21
+ <h2 class="card-info__title">
22
+ <slot name="title">
23
+ {{ title }}
24
+ </slot>
25
+ </h2>
26
+
27
+ <p class="card-info__description">
28
+ <slot name="description">
29
+ {{ description }}
30
+ </slot>
31
+ </p>
32
+ </section>
33
+ </template>
34
+
35
+ <style scoped lang="scss" src="./card-info.scss"></style>
@@ -51,3 +51,4 @@ export { default as UProgressAvatar } from './progress-avatar/u-progress-avatar.
51
51
  export { default as UWelcome } from './welcome/u-welcome.vue'
52
52
  export { default as UHint } from './hint/u-hint.vue'
53
53
  export { default as UNavigationPanelTile } from './navigation-panel-tile/u-navigation-panel-tile.vue'
54
+ export { default as UCardInfo } from './card-info/u-card-info.vue'
@@ -1,4 +1,5 @@
1
- @use '../../base/abstracts/' as a;
1
+ @use '../../base/abstracts' as a;
2
+ @use '../richtext/richtext' as r;
2
3
 
3
4
  .inline-edit {
4
5
  border-bottom: 1px solid var(--e-c-mono-200);
@@ -36,6 +37,9 @@
36
37
  .inline-edit__summary {
37
38
  @include a.type(300);
38
39
 
40
+ // We don't need a full richtext implementation. The spacings are enough.
41
+ @include r.richtext-spacing-rules;
42
+
39
43
  color: var(--e-c-mono-700);
40
44
  }
41
45
 
@@ -1,12 +1,14 @@
1
1
  <script setup lang="ts">
2
2
  import { ref, inject, useId, watch, useTemplateRef } from 'vue'
3
- import UButton from '../../elements/button/u-button.vue'
3
+ import { UButton } from '../../elements'
4
+ import { URichtext } from '../../components'
4
5
  import { getTranslation } from '../../utils/translations/translate'
5
6
 
6
7
  interface Props {
7
- title: string
8
- summary: string
9
- description: string
8
+ title?: string
9
+ summary?: string
10
+ description?: string
11
+ nonEditable?: boolean
10
12
  }
11
13
 
12
14
  defineProps<Props>()
@@ -69,25 +71,32 @@ defineExpose({ collapse })
69
71
  </script>
70
72
 
71
73
  <template>
72
- <div ref="root" class="inline-edit" :class="{ expanded, disabled }">
74
+ <div ref="root" class="inline-edit" :class="{ expanded, disabled, 'non-editable': nonEditable }">
73
75
  <div class="inline-edit__heading">
74
76
  <div class="inline-edit__heading-col">
75
- <p :id="headingId" class="inline-edit__title">{{ title }}</p>
76
-
77
- <p class="inline-edit__summary">
78
- <slot name="summary">{{ summary }}</slot>
77
+ <p :id="headingId" class="inline-edit__title">
78
+ <slot name="title">{{ title }}</slot>
79
79
  </p>
80
- <p class="inline-edit__description" v-html="description"></p>
80
+
81
+ <div class="inline-edit__summary">
82
+ <slot name="summary"><div v-html="summary" /></slot>
83
+ </div>
84
+
85
+ <div class="inline-edit__description">
86
+ <slot name="description"><div v-html="description" /></slot>
87
+ </div>
81
88
  </div>
82
- <div class="inline-edit__heading-cta-col">
89
+
90
+ <div v-if="!nonEditable" class="inline-edit__heading-cta-col">
83
91
  <UButton
84
92
  variant="plain-spaceless"
85
93
  :disabled
86
94
  :aria-controls="panelId"
87
95
  :aria-expanded="expanded"
88
96
  @click="onEditToggle"
89
- >{{ getTranslation(expanded ? 'cancel' : 'edit') }}</UButton
90
97
  >
98
+ {{ getTranslation(expanded ? 'cancel' : 'edit') }}
99
+ </UButton>
91
100
  </div>
92
101
  </div>
93
102
 
@@ -1,8 +1,7 @@
1
1
  @use '../../base/abstracts' as a;
2
2
  @use './wizard';
3
3
 
4
- .richtext {
5
- // Spacing rules
4
+ @mixin richtext-spacing-rules {
6
5
  * + * {
7
6
  margin-top: var(--e-space-3);
8
7
  }
@@ -23,7 +22,9 @@
23
22
  * + ol {
24
23
  margin-top: var(--e-space-6);
25
24
  }
25
+ }
26
26
 
27
+ @mixin richtext-spacing-rules-mobile {
27
28
  @include a.bp(lg) {
28
29
  * + * {
29
30
  margin-top: var(--e-space-2);
@@ -41,6 +42,12 @@
41
42
  margin-top: var(--e-space-10);
42
43
  }
43
44
  }
45
+ }
46
+
47
+ .richtext {
48
+ // Spacing rules
49
+ @include richtext-spacing-rules;
50
+ @include richtext-spacing-rules-mobile;
44
51
 
45
52
  // Element styles
46
53
  h2,
@@ -13,7 +13,9 @@ const classes = ['richtext', { 'richtext--small': small, 'richtext--inverted': i
13
13
  <template>
14
14
  <div v-if="text" :class="classes" v-html="text"></div>
15
15
 
16
- <div v-else :class="classes"><slot></slot></div>
16
+ <div v-else :class="classes">
17
+ <slot />
18
+ </div>
17
19
  </template>
18
20
 
19
21
  <style lang="scss" src="./richtext.scss"></style>
@@ -0,0 +1,170 @@
1
+ /* easeOutCubic */
2
+ /* prettier-ignore */
3
+ .form .form__messages {
4
+ display: none;
5
+ }
6
+ .form .form__title {
7
+ font-size: var(--e-type-size-800);
8
+ line-height: var(--e-type-line-height-800);
9
+ letter-spacing: 0.025rem;
10
+ font-weight: var(--e-type-weight-strong);
11
+ -webkit-font-smoothing: antialiased;
12
+ -moz-osx-font-smoothing: grayscale;
13
+ color: var(--e-c-primary-01-500);
14
+ }
15
+ @media (max-width: 1020px) {
16
+ .form .form__title {
17
+ font-size: var(--e-type-size-700);
18
+ line-height: var(--e-type-line-height-700);
19
+ letter-spacing: 0.025rem;
20
+ font-weight: var(--e-type-weight-strong);
21
+ -webkit-font-smoothing: antialiased;
22
+ -moz-osx-font-smoothing: grayscale;
23
+ }
24
+ }
25
+ .form .form__lead {
26
+ font-size: var(--e-type-size-200);
27
+ line-height: var(--e-type-line-height-200);
28
+ letter-spacing: 0.01875rem;
29
+ font-weight: var(--e-type-weight-weak);
30
+ }
31
+ .form .form__lead .form__subtitle-info {
32
+ color: var(--e-c-secondary-01-900);
33
+ margin-left: var(--e-space-1);
34
+ }
35
+ .form .form__lead .form__subtitle-info e-icon {
36
+ display: inline-block;
37
+ vertical-align: middle;
38
+ }
39
+ .form .form__title + .form__lead {
40
+ font-size: var(--e-type-size-300);
41
+ line-height: var(--e-type-line-height-300);
42
+ letter-spacing: 0.01875rem;
43
+ }
44
+ @media (max-width: 1020px) {
45
+ .form .form__title + .form__lead {
46
+ font-size: var(--e-type-size-200);
47
+ line-height: var(--e-type-line-height-200);
48
+ letter-spacing: 0.01875rem;
49
+ }
50
+ }
51
+ .form .form__subtitle {
52
+ font-size: var(--e-type-size-300);
53
+ line-height: var(--e-type-line-height-300);
54
+ letter-spacing: 0.01875rem;
55
+ font-weight: var(--e-type-weight-strong);
56
+ -webkit-font-smoothing: antialiased;
57
+ -moz-osx-font-smoothing: grayscale;
58
+ color: var(--e-c-primary-01-500);
59
+ }
60
+ .form .form__subtitle .form__subtitle-info {
61
+ color: var(--e-c-secondary-01-900);
62
+ margin-left: var(--e-space-1);
63
+ }
64
+ .form .form__subtitle .form__subtitle-info e-icon {
65
+ display: inline-block;
66
+ vertical-align: middle;
67
+ }
68
+ .form .form__cta-group {
69
+ display: flex;
70
+ grid-gap: var(--e-space-5);
71
+ }
72
+ @media (max-width: 740px) {
73
+ .form .form__cta-group {
74
+ flex-direction: column;
75
+ }
76
+ }
77
+ .form .form__title + .form__lead,
78
+ .form .form__subtitle + .form__lead {
79
+ margin-top: var(--e-space-3);
80
+ }
81
+ @media (max-width: 1020px) {
82
+ .form .form__title + .form__lead,
83
+ .form .form__subtitle + .form__lead {
84
+ margin-top: var(--e-space-1_5);
85
+ }
86
+ }
87
+ .form .form__lead-row + * {
88
+ margin-top: var(--e-space-5);
89
+ }
90
+ @media (max-width: 1020px) {
91
+ .form .form__lead-row + * {
92
+ margin-top: var(--e-space-3);
93
+ }
94
+ }
95
+ .form .form__subtitle-row + *,
96
+ .form .form__lead-row.form__subtitle-row + * {
97
+ margin-top: var(--e-space-6);
98
+ }
99
+ @media (max-width: 1020px) {
100
+ .form .form__subtitle-row + *,
101
+ .form .form__lead-row.form__subtitle-row + * {
102
+ margin-top: var(--e-space-3);
103
+ }
104
+ }
105
+ .form .form__input-row + .form__input-row,
106
+ .form .form__title-row + *,
107
+ .form *:not(legend) + .form__lead-row {
108
+ margin-top: var(--e-space-10);
109
+ }
110
+ @media (max-width: 1020px) {
111
+ .form .form__input-row + .form__input-row,
112
+ .form .form__title-row + *,
113
+ .form *:not(legend) + .form__lead-row {
114
+ margin-top: var(--e-space-6);
115
+ }
116
+ }
117
+ .form .form__input-row.form__input-row--compact + .form__input-row.form__input-row--compact {
118
+ margin-top: var(--e-space-6);
119
+ }
120
+ .form *:not(legend) + .form__title-row,
121
+ .form *:not(legend) + .form__cta-row,
122
+ .form *:not(legend) + .form__subtitle-row {
123
+ margin-top: var(--e-space-16);
124
+ }
125
+ @media (max-width: 1020px) {
126
+ .form *:not(legend) + .form__title-row,
127
+ .form *:not(legend) + .form__cta-row,
128
+ .form *:not(legend) + .form__subtitle-row {
129
+ margin-top: var(--e-space-10);
130
+ }
131
+ }
132
+ @media (max-width: 1020px) {
133
+ .form .form__input-col + .form__input-col {
134
+ margin-top: var(--e-space-6);
135
+ }
136
+ }
137
+ .form .form__messages-row {
138
+ display: none;
139
+ margin-top: var(--e-space-10);
140
+ }
141
+ .form .form__cookiebot-message {
142
+ margin-bottom: var(--e-space-6);
143
+ }
144
+ .form.form--has-general-error .form__messages-row,
145
+ .form.form--has-general-error .form__messages {
146
+ display: block;
147
+ }
148
+ .form.form--hide-form-elements > *:not(.success-screen) {
149
+ display: none;
150
+ }
151
+ .form.form--is-submitting .form-row:not(.form__cta-row) {
152
+ opacity: 0.6;
153
+ pointer-events: none;
154
+ }
155
+ .form .form__recaptcha {
156
+ font-size: 0.625rem;
157
+ line-height: 1.5;
158
+ margin-top: var(--e-space-6);
159
+ color: var(--e-c-mono-700);
160
+ }
161
+ .form .form__recaptcha a {
162
+ color: var(--e-c-primary-01-700);
163
+ text-underline-offset: var(--e-space-1);
164
+ }
165
+
166
+ .grecaptcha-badge {
167
+ visibility: hidden;
168
+ }
169
+
170
+ /*# sourceMappingURL=form.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sourceRoot":"","sources":["../../base/abstracts/_variables.scss","../../base/abstracts/_functions.scss","../../elements/form/form.scss","../../base/abstracts/_mixins.scss"],"names":[],"mappings":"AAqCiF;AChCjF;ACFE;EACE;;AAGF;ECoCA;EACA;EAGE;EAMA;EAKE;EACA;EDjDF;;ACWF;EDdA;ICoCA;IACA;IAGE;IAMA;IAKE;IACA;;;AD1CJ;EC0BA;EACA;EAKE;EAIA;;ADjCA;EACE;EACA;;AAEA;EACE;EACA;;AAKN;ECYA;EACA;EAKE;;AA5BF;EDUA;ICYA;IACA;IAKE;;;ADVF;ECIA;EACA;EAGE;EAMA;EAKE;EACA;EDjBF;;AAEA;EACE;EACA;;AAEA;EACE;EACA;;AAKN;EACE;EACA;;ACpCF;EDkCA;IAKI;;;AAKJ;AAAA;EAEE;;AC9CF;ED4CA;AAAA;IAKI;;;AAQJ;EACE;;AC1DF;EDyDA;IAII;;;AAIJ;AAAA;EAEE;;ACnEF;EDiEA;AAAA;IAKI;;;AAIJ;AAAA;AAAA;EAGE;;AC7EF;ED0EA;AAAA;AAAA;IAMI;;;AAIJ;EACE;;AAGF;AAAA;AAAA;EAGE;;AC3FF;EDwFA;AAAA;AAAA;IAMI;;;AC9FJ;EDkGA;IAEI;;;AAIJ;EACE;EACA;;AAGF;EACE;;AASA;AAAA;EAEE;;AAKF;EACE;;AAKF;EACE;EACA;;AAIJ;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;;;AAKN;EACE","file":"form.css"}
@@ -0,0 +1,184 @@
1
+ /* easeOutCubic */
2
+ /* prettier-ignore */
3
+ /**
4
+ Helper to colculate col width in %.
5
+ Looks complicated because we use grid-gap on the row, which takes away from available width.
6
+ */
7
+ /**
8
+ Mixin to create a grid column cell.
9
+
10
+ $cols: Column width of cell.
11
+ $columns: Grid size (in columns). Default is set by global variable $grid-columns (defined via design token).
12
+ */
13
+ .form-grid {
14
+ width: 100%;
15
+ }
16
+
17
+ .form-row {
18
+ display: flex;
19
+ flex-wrap: wrap;
20
+ grid-gap: 2.6315789474%;
21
+ }
22
+ @media (max-width: 1020px) {
23
+ .form-row {
24
+ grid-gap: 2.5531914894%;
25
+ }
26
+ }
27
+ @media (max-width: 740px) {
28
+ .form-row {
29
+ grid-gap: 3.6363636364%;
30
+ }
31
+ }
32
+ @media (max-width: 520px) {
33
+ .form-row {
34
+ grid-gap: 4.1666666667%;
35
+ }
36
+ }
37
+ .form-row .form-col {
38
+ flex: 0 0 48.6842105263%;
39
+ max-width: 48.6842105263%;
40
+ }
41
+ @media (max-width: 1020px) {
42
+ .form-row .form-col {
43
+ flex: 0 0 48.7234042553%;
44
+ max-width: 48.7234042553%;
45
+ }
46
+ }
47
+ @media (max-width: 740px) {
48
+ .form-row .form-col {
49
+ flex: 0 0 48.1818181818%;
50
+ max-width: 48.1818181818%;
51
+ }
52
+ }
53
+ @media (max-width: 520px) {
54
+ .form-row .form-col {
55
+ flex: 0 0 47.9166666667%;
56
+ max-width: 47.9166666667%;
57
+ }
58
+ }
59
+ .form-row .form-col-1\/4 {
60
+ flex: 0 0 23.0263157895%;
61
+ max-width: 23.0263157895%;
62
+ }
63
+ @media (max-width: 1020px) {
64
+ .form-row .form-col-1\/4 {
65
+ flex: 0 0 23.085106383%;
66
+ max-width: 23.085106383%;
67
+ }
68
+ }
69
+ @media (max-width: 740px) {
70
+ .form-row .form-col-1\/4 {
71
+ flex: 0 0 22.2727272727%;
72
+ max-width: 22.2727272727%;
73
+ }
74
+ }
75
+ @media (max-width: 520px) {
76
+ .form-row .form-col-1\/4 {
77
+ flex: 0 0 21.875%;
78
+ max-width: 21.875%;
79
+ }
80
+ }
81
+ .form-row .form-col-2\/4 {
82
+ flex: 0 0 48.6842105263%;
83
+ max-width: 48.6842105263%;
84
+ }
85
+ @media (max-width: 1020px) {
86
+ .form-row .form-col-2\/4 {
87
+ flex: 0 0 48.7234042553%;
88
+ max-width: 48.7234042553%;
89
+ }
90
+ }
91
+ @media (max-width: 740px) {
92
+ .form-row .form-col-2\/4 {
93
+ flex: 0 0 48.1818181818%;
94
+ max-width: 48.1818181818%;
95
+ }
96
+ }
97
+ @media (max-width: 520px) {
98
+ .form-row .form-col-2\/4 {
99
+ flex: 0 0 47.9166666667%;
100
+ max-width: 47.9166666667%;
101
+ }
102
+ }
103
+ .form-row .form-col-3\/4 {
104
+ flex: 0 0 74.3421052632%;
105
+ max-width: 74.3421052632%;
106
+ }
107
+ @media (max-width: 1020px) {
108
+ .form-row .form-col-3\/4 {
109
+ flex: 0 0 74.3617021277%;
110
+ max-width: 74.3617021277%;
111
+ }
112
+ }
113
+ @media (max-width: 740px) {
114
+ .form-row .form-col-3\/4 {
115
+ flex: 0 0 74.0909090909%;
116
+ max-width: 74.0909090909%;
117
+ }
118
+ }
119
+ @media (max-width: 520px) {
120
+ .form-row .form-col-3\/4 {
121
+ flex: 0 0 73.9583333333%;
122
+ max-width: 73.9583333333%;
123
+ }
124
+ }
125
+ .form-row .form-col-4\/4 {
126
+ flex: 0 0 100%;
127
+ max-width: 100%;
128
+ }
129
+ @media (max-width: 1020px) {
130
+ .form-row .form-col-4\/4 {
131
+ flex: 0 0 100%;
132
+ max-width: 100%;
133
+ }
134
+ }
135
+ @media (max-width: 740px) {
136
+ .form-row .form-col-4\/4 {
137
+ flex: 0 0 100%;
138
+ max-width: 100%;
139
+ }
140
+ }
141
+ @media (max-width: 520px) {
142
+ .form-row .form-col-4\/4 {
143
+ flex: 0 0 100%;
144
+ max-width: 100%;
145
+ }
146
+ }
147
+ @media (max-width: 1020px) {
148
+ .form-row .form-col,
149
+ .form-row .form-col-1\/4,
150
+ .form-row .form-col-2\/4,
151
+ .form-row .form-col-3\/4 {
152
+ flex: 0 0 100%;
153
+ max-width: 100%;
154
+ }
155
+ }
156
+ @media (max-width: 1020px) and (max-width: 1020px) {
157
+ .form-row .form-col,
158
+ .form-row .form-col-1\/4,
159
+ .form-row .form-col-2\/4,
160
+ .form-row .form-col-3\/4 {
161
+ flex: 0 0 100%;
162
+ max-width: 100%;
163
+ }
164
+ }
165
+ @media (max-width: 1020px) and (max-width: 740px) {
166
+ .form-row .form-col,
167
+ .form-row .form-col-1\/4,
168
+ .form-row .form-col-2\/4,
169
+ .form-row .form-col-3\/4 {
170
+ flex: 0 0 100%;
171
+ max-width: 100%;
172
+ }
173
+ }
174
+ @media (max-width: 1020px) and (max-width: 520px) {
175
+ .form-row .form-col,
176
+ .form-row .form-col-1\/4,
177
+ .form-row .form-col-2\/4,
178
+ .form-row .form-col-3\/4 {
179
+ flex: 0 0 100%;
180
+ max-width: 100%;
181
+ }
182
+ }
183
+
184
+ /*# sourceMappingURL=form-grid.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sourceRoot":"","sources":["../../base/abstracts/_variables.scss","../../base/abstracts/_functions.scss","../../layout/grid/grid.mixin.scss","../../layout/form-grid/form-grid.scss","../../base/abstracts/_mixins.scss"],"names":[],"mappings":"AAqCiF;AChCjF;ACFA;AAAA;AAAA;AAAA;AA0BA;AAAA;;AAAA;AAAA;AAAA;ACzBA;EACE;;;AAGF;EDIE;EACA;EACA,UFgBgB;;AIThB;EDbF;IDSI,UFca;;;AIVf;EDbF;IDaI,UFWY;;;AIXd;EDbF;IDiBI,UFQY;;;AGtBd;ED2BA;EACA,WAHY;;AEfZ;EDVA;IDiCE;IACA,WAHW;;;AErBb;EDVA;IDwCE;IACA,WAHU;;;AE5BZ;EDVA;ID+CE;IACA,WAHU;;;ACxCZ;EDsBA;EACA,WAHY;;AEfZ;EDLA;ID4BE;IACA,WAHW;;;AErBb;EDLA;IDmCE;IACA,WAHU;;;AE5BZ;EDLA;ID0CE;IACA,WAHU;;;ACpCZ;EDkBA;EACA,WAHY;;AEfZ;EDDA;IDwBE;IACA,WAHW;;;AErBb;EDDA;ID+BE;IACA,WAHU;;;AE5BZ;EDDA;IDsCE;IACA,WAHU;;;AC/BZ;EDaA;EACA,WAHY;;AEfZ;EDIA;IDmBE;IACA,WAHW;;;AErBb;EDIA;ID0BE;IACA,WAHU;;;AE5BZ;EDIA;IDiCE;IACA,WAHU;;;AC3BZ;EDSA;EACA,WAHY;;AEfZ;EDQA;IDeE;IACA,WAHW;;;AErBb;EDQA;IDsBE;IACA,WAHU;;;AE5BZ;EDQA;ID6BE;IACA,WAHU;;;AEnCZ;EDYA;AAAA;AAAA;AAAA;IDKA;IACA,WAHY;;;AEfZ;EDYA;AAAA;AAAA;AAAA;IDWE;IACA,WAHW;;;AErBb;EDYA;AAAA;AAAA;AAAA;IDkBE;IACA,WAHU;;;AE5BZ;EDYA;AAAA;AAAA;AAAA;IDyBE;IACA,WAHU","file":"form-grid.css"}
@@ -1,4 +1,4 @@
1
- @use '../../base/abstracts/' as a;
1
+ @use '../../base/abstracts' as a;
2
2
 
3
3
  .form {
4
4
  .form__messages {
@@ -48,6 +48,10 @@
48
48
  transform: translateY(-50%);
49
49
  }
50
50
 
51
+ .suffix-action {
52
+ display: flex;
53
+ }
54
+
51
55
  .suffix-text {
52
56
  @include a.type(200);
53
57
  }
@@ -70,6 +74,7 @@
70
74
  }
71
75
  }
72
76
 
77
+ &:has(.suffix-action),
73
78
  &:has(.suffix-text) {
74
79
  // A suffix only makes sense for an <input>. That's why we select only input here.
75
80
  .control input {
@@ -129,9 +129,9 @@ watch(
129
129
  >
130
130
  <div class="wrapper">
131
131
  <div class="label">
132
- <slot name="label">
133
- <label :for="inputId">{{ label }}</label>
134
- </slot>
132
+ <label :for="inputId">
133
+ <slot name="label">{{ label }}</slot>
134
+ </label>
135
135
  </div>
136
136
 
137
137
  <div class="control">
@@ -174,6 +174,11 @@ watch(
174
174
  <span v-if="type === TextFieldTypes.date" class="suffix-icon">
175
175
  <UIcon name="calendar"></UIcon>
176
176
  </span>
177
+
178
+ <!-- ACTION -->
179
+ <span v-if="!!slots.action" class="suffix-action custom-action">
180
+ <slot name="action"></slot>
181
+ </span>
177
182
  </div>
178
183
 
179
184
  <div class="help-text">
@@ -191,6 +196,16 @@ watch(
191
196
  </div>
192
197
  </template>
193
198
 
199
+ <style scoped lang="scss" src="./text-field.scss"></style>
200
+
194
201
  <style scoped lang="scss">
195
- @use './text-field.scss';
202
+ .suffix-action.custom-action {
203
+ :slotted(button) {
204
+ cursor: pointer;
205
+ }
206
+
207
+ :slotted(.icon) {
208
+ color: var(--e-c-secondary-05-700);
209
+ }
210
+ }
196
211
  </style>
@@ -0,0 +1,2 @@
1
+ export { default as USettingsLayout } from './settings/u-settings-layout.vue'
2
+ export { default as UPortalLayout } from './portal/u-portal.vue'
@@ -0,0 +1,35 @@
1
+ @use '../../base/abstracts' as a;
2
+
3
+ .portal {
4
+ display: flex;
5
+ height: 100vh;
6
+ }
7
+
8
+ .portal__top-navigation {
9
+ display: none;
10
+ }
11
+
12
+ .portal__main {
13
+ flex: 1 1 auto;
14
+ display: flex;
15
+ flex-direction: column;
16
+ overflow: auto;
17
+ }
18
+
19
+ .portal__footer {
20
+ margin-top: auto;
21
+ }
22
+
23
+ @include a.bp(lg) {
24
+ .portal {
25
+ flex-direction: column;
26
+ }
27
+
28
+ .portal__top-navigation {
29
+ display: block;
30
+ }
31
+
32
+ .portal__side-navigation {
33
+ display: none;
34
+ }
35
+ }
@@ -0,0 +1,22 @@
1
+ <template>
2
+ <div class="portal">
3
+ <div class="portal__side-navigation">
4
+ <slot name="side-navigation"></slot>
5
+ </div>
6
+
7
+ <div class="portal__top-navigation">
8
+ <slot name="top-navigation"></slot>
9
+ </div>
10
+
11
+ <div class="portal__main">
12
+ <slot></slot>
13
+
14
+ <div class="portal__footer">
15
+ <slot name="footer"></slot>
16
+ </div>
17
+ </div>
18
+ </div>
19
+ </template>
20
+
21
+ <script setup lang="ts"></script>
22
+ <style scoped lang="scss" src="./portal.scss"></style>
@@ -0,0 +1,33 @@
1
+ @use '../../base/abstracts' as a;
2
+
3
+ .settings-layout {
4
+ display: grid;
5
+ grid-template-columns: auto a.rem(320);
6
+ grid-template-rows: repeat(2, auto);
7
+ grid-column-gap: var(--e-space-24);
8
+ grid-row-gap: var(--e-space-12);
9
+ padding: var(--e-space-10);
10
+
11
+ @include a.bp(lg) {
12
+ display: flex;
13
+ flex-direction: column;
14
+ row-gap: var(--e-space-6);
15
+ padding: var(--e-space-6) var(--e-space-5) var(--e-space-10);
16
+ }
17
+ }
18
+
19
+ .settings-layout__header {
20
+ grid-area: 1 / 1 / 2 / 3;
21
+ }
22
+
23
+ .settings-layout__main {
24
+ grid-area: 2 / 1 / 3 / 2;
25
+ }
26
+
27
+ .settings-layout__aside {
28
+ grid-area: 2 / 2 / 3 / 3;
29
+ }
30
+
31
+ .settings-layout__title {
32
+ @include a.type(500, strong);
33
+ }
@@ -0,0 +1,19 @@
1
+ <template>
2
+ <div class="settings-layout">
3
+ <div class="settings-layout__header">
4
+ <h1 class="settings-layout__title">
5
+ <slot name="title"></slot>
6
+ </h1>
7
+ </div>
8
+
9
+ <div class="settings-layout__main">
10
+ <slot name="main"></slot>
11
+ </div>
12
+
13
+ <aside class="settings-layout__aside">
14
+ <slot name="aside"></slot>
15
+ </aside>
16
+ </div>
17
+ </template>
18
+
19
+ <style scoped lang="scss" src="./settings.scss"></style>
@@ -0,0 +1,49 @@
1
+ @keyframes fade-in {
2
+ 0% {
3
+ opacity: 0;
4
+ display: none;
5
+ }
6
+
7
+ 100% {
8
+ opacity: 1;
9
+ display: flex;
10
+ }
11
+ }
12
+
13
+ @keyframes fade-in-backdrop {
14
+ 0% {
15
+ background-color: transparent;
16
+ }
17
+
18
+ 100% {
19
+ background-color: var(--e-c-mono-900);
20
+ }
21
+ }
22
+
23
+ @keyframes slide-in {
24
+ 0% {
25
+ opacity: 1;
26
+ transform: translateY(100%);
27
+ display: none;
28
+ }
29
+
30
+ 100% {
31
+ opacity: 1;
32
+ transform: translateY(0);
33
+ display: flex;
34
+ }
35
+ }
36
+
37
+ @keyframes slide-out {
38
+ 0% {
39
+ opacity: 1;
40
+ transform: translateY(0);
41
+ display: flex;
42
+ }
43
+
44
+ 100% {
45
+ opacity: 1;
46
+ transform: translateY(100%);
47
+ display: none;
48
+ }
49
+ }
@@ -0,0 +1,168 @@
1
+ // TODO: Styles have been copied from 'news'. Refactor when possible.
2
+ @use '../../base/abstracts' as a;
3
+ @use './animations';
4
+
5
+ .dialog-container {
6
+ --overflow-gradient-height: var(--e-space-10);
7
+
8
+ padding: 0;
9
+ border: 0;
10
+ max-height: 100vh;
11
+ max-width: 100vw;
12
+ width: 100%;
13
+ height: 100%;
14
+ background-color: transparent;
15
+ justify-content: center;
16
+ align-items: center;
17
+ overflow: hidden;
18
+
19
+ &[open] {
20
+ display: flex;
21
+ animation: fade-in var(--e-trs-duration-faster) var(--e-trs-easing-default);
22
+ }
23
+
24
+ &[open]::backdrop {
25
+ background-color: var(--e-c-mono-900);
26
+ opacity: 0.4;
27
+ animation: fade-in-backdrop var(--e-trs-duration-faster) var(--e-trs-easing-default);
28
+ }
29
+
30
+ &.has-header-image {
31
+ .dialog__header-image-container {
32
+ display: flex;
33
+ }
34
+ }
35
+
36
+ &.has-content-image {
37
+ .dialog__content-image {
38
+ display: block;
39
+ }
40
+ }
41
+ }
42
+
43
+ .dialog {
44
+ display: flex;
45
+ flex-direction: column;
46
+ background-color: var(--e-c-mono-00);
47
+ overflow: auto;
48
+ scrollbar-width: none;
49
+ border-radius: var(--e-brd-radius-3);
50
+ padding: var(--e-space-7) var(--e-space-7) 0;
51
+ height: a.rem(670);
52
+ max-height: 80vh;
53
+ max-width: a.rem(480);
54
+ width: 100%;
55
+
56
+ * + .dialog__content-image {
57
+ margin-top: var(--e-space-5);
58
+ }
59
+
60
+ @include a.bp(m) {
61
+ max-width: none;
62
+ height: auto;
63
+ min-height: a.rem(440);
64
+ padding-left: var(--e-space-5);
65
+ padding-right: var(--e-space-5);
66
+ }
67
+ }
68
+
69
+ .dialog__header-image-container {
70
+ display: none;
71
+ justify-content: center;
72
+ height: a.rem(184);
73
+ margin-bottom: var(--e-space-8);
74
+
75
+ img {
76
+ object-fit: contain;
77
+ }
78
+ }
79
+
80
+ .dialog__content-container {
81
+ margin-bottom: auto;
82
+ }
83
+
84
+ .content-title {
85
+ @include a.type(500, strong);
86
+
87
+ @include a.bp(m) {
88
+ @include a.type(300, strong);
89
+ }
90
+ }
91
+
92
+ .content-title + .content-text {
93
+ margin-top: var(--e-space-2);
94
+
95
+ @include a.bp(m) {
96
+ margin-top: var(--e-space-1);
97
+ }
98
+ }
99
+
100
+ .dialog__content-image {
101
+ display: none;
102
+
103
+ img {
104
+ width: 100%;
105
+ }
106
+ }
107
+
108
+ .cta-container {
109
+ position: sticky;
110
+ display: flex;
111
+ flex-direction: column;
112
+ bottom: 0;
113
+ margin-top: var(--overflow-gradient-height);
114
+ padding: var(--e-space-8) var(--e-space-1) var(--e-space-7);
115
+ background-color: var(--e-c-mono-00);
116
+
117
+ &::after {
118
+ content: '';
119
+ position: absolute;
120
+ top: calc(var(--overflow-gradient-height) * -1);
121
+ left: 0;
122
+ width: 100%;
123
+ height: var(--overflow-gradient-height);
124
+ background-image: linear-gradient(0deg, rgb(255 255 255 / 100%) 0%, rgb(255 255 255 / 0%) 100%);
125
+ }
126
+
127
+ @include a.bp(m) {
128
+ padding: var(--e-space-8) 0 var(--e-space-7);
129
+ }
130
+ }
131
+
132
+ // MOBILE "MODAL" Variant
133
+ .dialog-container.modal {
134
+ @include a.bp(m) {
135
+ padding-left: a.rem(a.$container-edge-m);
136
+ padding-right: a.rem(a.$container-edge-m);
137
+ }
138
+
139
+ @include a.bp(s) {
140
+ padding-left: a.rem(a.$container-edge-s);
141
+ padding-right: a.rem(a.$container-edge-s);
142
+ }
143
+ }
144
+
145
+ // MOBILE "SLIDE-OUT" Variant
146
+ .dialog-container.slideout {
147
+ @include a.bp(m) {
148
+ align-items: flex-end;
149
+
150
+ // Closing animation
151
+ animation: slide-out var(--e-trs-duration-faster) var(--e-trs-easing-default);
152
+
153
+ &[open] {
154
+ display: flex;
155
+ animation: slide-in var(--e-trs-duration-fast) var(--e-trs-easing-default);
156
+ }
157
+
158
+ .dialog {
159
+ border-bottom-left-radius: 0;
160
+ border-bottom-right-radius: 0;
161
+ max-height: 90vh;
162
+ }
163
+ }
164
+ }
165
+
166
+ body:has(.dialog[open]) {
167
+ overflow: hidden;
168
+ }
@@ -0,0 +1,134 @@
1
+ <script setup lang="ts">
2
+ import { Image } from '../../elements/types'
3
+ import { useTemplateRef, watch, useSlots } from 'vue'
4
+ import { UButton } from '../../elements'
5
+ import { getTranslation } from '../../utils/translations/translate'
6
+ import { focusTrap } from '../../utils/a11y/focus-trap'
7
+
8
+ interface Props {
9
+ title?: string
10
+ text?: string
11
+ headerImage?: Image
12
+ contentImage?: Image
13
+ closeBtnLabel?: string
14
+ mobileDialogStyle?: 'modal' | 'slideout'
15
+ }
16
+
17
+ const { mobileDialogStyle = 'modal', closeBtnLabel = getTranslation('close') } =
18
+ defineProps<Props>()
19
+
20
+ const visible = defineModel<boolean>('visible')
21
+ const dialogEl = useTemplateRef('dialog')
22
+ const slots = useSlots()
23
+ let focusTrapInstance
24
+
25
+ // TODO: Key codes should be defined globally
26
+ const ESC = 'Escape'
27
+
28
+ const onKeydown = (e: KeyboardEvent) => {
29
+ if (e.code === ESC) {
30
+ visible.value = false
31
+ }
32
+ }
33
+
34
+ const onDocumentClick = (e: Event) => {
35
+ if (e.target.closest('.dialog')) {
36
+ return
37
+ }
38
+
39
+ e.stopPropagation()
40
+ e.preventDefault()
41
+
42
+ visible.value = false
43
+ }
44
+ watch(visible, (newV) => {
45
+ if (newV) {
46
+ // Open Dialog
47
+ dialogEl.value.showModal()
48
+
49
+ focusTrapInstance = focusTrap(dialogEl.value, {
50
+ focusFirstElement: true,
51
+ allowArrowUpDown: true,
52
+ allowArrowLeftRight: true,
53
+ })
54
+
55
+ requestAnimationFrame(() => {
56
+ window.addEventListener('keydown', onKeydown)
57
+ document.addEventListener('click', onDocumentClick)
58
+ })
59
+ } else {
60
+ focusTrapInstance.release()
61
+
62
+ // Close Dialog
63
+ // The trigger element automatically gets the focus when the dialog is closed. yay native :)
64
+ dialogEl.value.close()
65
+
66
+ window.removeEventListener('keydown', onKeydown)
67
+ document.removeEventListener('click', onDocumentClick)
68
+ }
69
+ })
70
+ </script>
71
+
72
+ <template>
73
+ <dialog
74
+ ref="dialog"
75
+ closedby="none"
76
+ :class="[
77
+ 'dialog-container',
78
+ mobileDialogStyle,
79
+ {
80
+ 'has-header-image': !!slots['header-image'] || headerImage,
81
+ 'has-content-image': !!slots['content-image'] || contentImage,
82
+ },
83
+ ]"
84
+ >
85
+ <div class="dialog">
86
+ <div class="dialog__header-image-container">
87
+ <slot name="header-image">
88
+ <img v-bind="headerImage" />
89
+ </slot>
90
+ </div>
91
+
92
+ <div class="dialog__content-container">
93
+ <div class="content-title">
94
+ <h3>
95
+ <slot name="title">{{ title }}</slot>
96
+ </h3>
97
+ </div>
98
+
99
+ <div class="content-text">
100
+ <div class="richtext">
101
+ <slot name="text">
102
+ <div v-html="text"></div>
103
+ </slot>
104
+ </div>
105
+ </div>
106
+
107
+ <div class="dialog__content-image">
108
+ <slot name="content-image">
109
+ <img v-bind="contentImage" />
110
+ </slot>
111
+ </div>
112
+ </div>
113
+
114
+ <div class="cta-container">
115
+ <UButton @click="visible = false">{{ closeBtnLabel }}</UButton>
116
+ </div>
117
+ </div>
118
+ </dialog>
119
+ </template>
120
+
121
+ <style scoped lang="scss" src="./dialog.scss"></style>
122
+ <style scoped lang="scss">
123
+ .dialog__header-image-container {
124
+ :slotted(img) {
125
+ object-fit: contain;
126
+ }
127
+ }
128
+
129
+ .dialog__content-image {
130
+ :slotted(img) {
131
+ width: 100%;
132
+ }
133
+ }
134
+ </style>
package/modules/index.js CHANGED
@@ -7,3 +7,4 @@ export { default as UNavigationPanel } from './navigation-panel/u-navigation-pan
7
7
  export { default as UProgressIndicator } from './progress-indicator/u-progress-indicator.vue'
8
8
  export { default as UToast } from './toast/u-toast.vue'
9
9
  export { toast } from './toast/useToast.ts'
10
+ export { default as UDialog } from './dialog/u-dialog.vue'
@@ -7,6 +7,8 @@ const update = (id) => {
7
7
 
8
8
  const activeEdit = ref('')
9
9
 
10
+ defineExpose({ update })
11
+
10
12
  provide('inline-edit-group', {
11
13
  update,
12
14
  activeEdit,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@energie360/ui-library",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -11,6 +11,7 @@
11
11
  "./elements": "./elements/index.js",
12
12
  "./components": "./components/index.js",
13
13
  "./modules": "./modules/index.js",
14
+ "./layout": "./layout/index.js",
14
15
  "./wizard": "./wizard/index.js",
15
16
  "./utility/elements/*": "./dist/elements/*",
16
17
  "./utility/layout/*": "./dist/layout/*",
@@ -0,0 +1 @@
1
+ @use '../../elements/form/form';
@@ -0,0 +1 @@
1
+ @use '../../layout/form-grid/form-grid';