@energie360/ui-library 0.1.9 → 0.1.11

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.
Files changed (38) hide show
  1. package/base/abstracts/_variables.scss +1 -0
  2. package/components/card/u-card.vue +10 -3
  3. package/components/card-cta-header/u-card-cta-header.vue +87 -0
  4. package/components/circular-progress/circular-progress.scss +34 -0
  5. package/components/circular-progress/u-circular-progress.vue +25 -0
  6. package/components/context-menu/context-menu.scss +28 -0
  7. package/components/context-menu/u-context-menu.vue +113 -0
  8. package/components/context-menu-divider/context-menu-divider.scss +6 -0
  9. package/components/context-menu-divider/u-context-menu-divider.vue +5 -0
  10. package/components/context-menu-link/context-menu-link.scss +26 -0
  11. package/components/context-menu-link/u-context-menu-link.vue +27 -0
  12. package/components/index.js +8 -0
  13. package/components/navigation-toolbar-link/navigation-toolbar-link.scss +177 -0
  14. package/components/navigation-toolbar-link/u-navigation-toolbar-link.vue +108 -0
  15. package/components/progress-avatar/progress-avatar.scss +27 -0
  16. package/components/progress-avatar/u-progress-avatar.vue +25 -0
  17. package/components/text-block/text-block.scss +58 -0
  18. package/components/text-block/u-text-block.vue +26 -0
  19. package/components/tooltip/popover.ts +74 -12
  20. package/dist/base-style.css +1 -0
  21. package/dist/base-style.css.map +1 -1
  22. package/dist/elements/text-link.css +1 -0
  23. package/dist/elements/text-link.css.map +1 -1
  24. package/dist/layout/split.css +1 -0
  25. package/dist/layout/split.css.map +1 -1
  26. package/elements/button/u-button.vue +12 -5
  27. package/elements/button-chip/button-chip.scss +2 -2
  28. package/elements/form/form.scss +174 -0
  29. package/elements/text-field/u-text-field.vue +9 -1
  30. package/i18n/i18n.ts +8 -0
  31. package/layout/form-grid/form-grid.scss +42 -0
  32. package/modules/index.js +2 -0
  33. package/modules/navigation-toolbar-side/navigation-toolbar-side.scss +89 -0
  34. package/modules/navigation-toolbar-side/u-navigation-toolbar-side.vue +93 -0
  35. package/modules/navigation-toolbar-top/navigation-toolbar-top.scss +89 -0
  36. package/modules/navigation-toolbar-top/u-navigation-toolbar-top.vue +130 -0
  37. package/package.json +4 -2
  38. package/utils/a11y/focus-trap.js +128 -0
@@ -0,0 +1,27 @@
1
+ @use '../../base/abstracts' as a;
2
+
3
+ .progress-avatar {
4
+ position: relative;
5
+ display: block;
6
+ padding: a.rem(6);
7
+ width: a.rem(88);
8
+ height: a.rem(88);
9
+ }
10
+
11
+ .progress-avatar__anim-container {
12
+ position: absolute;
13
+ inset: 0;
14
+ }
15
+
16
+ .progress-avatar__image-container {
17
+ border-radius: 100%;
18
+ overflow: hidden;
19
+ aspect-ratio: 1;
20
+
21
+ img {
22
+ object-fit: cover;
23
+ object-position: center;
24
+ width: 100%;
25
+ height: 100%;
26
+ }
27
+ }
@@ -0,0 +1,25 @@
1
+ <script setup lang="ts">
2
+ import { Image } from '../../elements/types'
3
+ import { UCircularProgress } from '../'
4
+
5
+ interface Props {
6
+ image: Image
7
+ progress: number
8
+ }
9
+
10
+ defineProps<Props>()
11
+ </script>
12
+
13
+ <template>
14
+ <div class="progress-avatar">
15
+ <div class="progress-avatar__anim-container">
16
+ <UCircularProgress :size="88" :progress />
17
+ </div>
18
+
19
+ <div class="progress-avatar__image-container">
20
+ <img v-bind="image" />
21
+ </div>
22
+ </div>
23
+ </template>
24
+
25
+ <style scoped lang="scss" src="./progress-avatar.scss"></style>
@@ -0,0 +1,58 @@
1
+ @use '../../base/abstracts' as a;
2
+
3
+ .wizard-text-block {
4
+ .wizard-text-block__title {
5
+ @include a.type(800, strong);
6
+
7
+ + .wizard-text-block__text {
8
+ margin-top: var(--e-space-4);
9
+ }
10
+ }
11
+
12
+ .wizard-text-block__title--small {
13
+ @include a.type(500, strong);
14
+ }
15
+
16
+ .wizard-text-block__text {
17
+ @include a.type(300);
18
+ }
19
+
20
+ @include a.bp(lg) {
21
+ .wizard-text-block__title {
22
+ @include a.type(700, strong);
23
+
24
+ + .wizard-text-block__text {
25
+ margin-top: var(--e-space-3);
26
+ }
27
+ }
28
+ }
29
+
30
+ // Modifiers
31
+ &.wizard-text-block--sub {
32
+ .wizard-text-block__title {
33
+ @include a.type(300, strong);
34
+
35
+ + .wizard-text-block__text {
36
+ margin-top: var(--e-space-2);
37
+ }
38
+ }
39
+
40
+ .wizard-text-block__text {
41
+ @include a.type(300);
42
+ }
43
+
44
+ @include a.bp(lg) {
45
+ .wizard-text-block__title {
46
+ @include a.type(200, strong);
47
+
48
+ + .wizard-text-block__text {
49
+ margin-top: var(--e-space-2);
50
+ }
51
+ }
52
+
53
+ .wizard-text-block__text {
54
+ @include a.type(200);
55
+ }
56
+ }
57
+ }
58
+ }
@@ -0,0 +1,26 @@
1
+ <script setup lang="ts">
2
+ interface Props {
3
+ variant: 'lead' | 'sub'
4
+ title?: string
5
+ text?: string
6
+ centered?: boolean
7
+ }
8
+
9
+ const { centered = false } = defineProps<Props>()
10
+ </script>
11
+
12
+ <template>
13
+ <div :class="['wizard-text-block', `wizard-text-block--${variant}`, { centered }]">
14
+ <h2 v-if="title" class="wizard-text-block__title" v-html="title" />
15
+
16
+ <div v-if="text" class="wizard-text-block__text richtext" v-html="text" />
17
+ </div>
18
+ </template>
19
+
20
+ <style scoped lang="scss">
21
+ @use './text-block.scss';
22
+
23
+ .centered {
24
+ text-align: center;
25
+ }
26
+ </style>
@@ -5,9 +5,17 @@ export type Placement =
5
5
  | 'top-right'
6
6
  | 'top-left'
7
7
  | 'top-center'
8
+ | 'top-full'
8
9
  | 'bottom-right'
9
10
  | 'bottom-left'
10
11
  | 'bottom-center'
12
+ | 'bottom-full'
13
+ | 'right-top'
14
+ | 'right-center'
15
+ | 'right-bottom'
16
+ | 'left-top'
17
+ | 'left-center'
18
+ | 'left-bottom'
11
19
  export interface PopoverPositionParams {
12
20
  placement?: Placement
13
21
  offset?: number
@@ -52,6 +60,7 @@ export const getPopoverPosition = (
52
60
 
53
61
  let top = 0
54
62
  let left = 0
63
+ let right: number | string = ''
55
64
  const { vpWidth } = getViewportDimensions()
56
65
  const docHeight = document.documentElement.scrollHeight
57
66
  const scrollY = window.scrollY
@@ -64,32 +73,85 @@ export const getPopoverPosition = (
64
73
  popoverEl.style.display = ''
65
74
  }
66
75
 
76
+ const topPosition = offsetTop - popoverRect.height - options.offset
77
+ const bottomPosition = offsetTop + refRect.height + options.offset
78
+ const leftAligned = offsetLeft
79
+ const rightAligned = offsetLeft + refRect.width - popoverRect.width
80
+ const centerAligned = offsetLeft + refRect.width / 2 - popoverRect.width / 2
81
+
82
+ const rightPosition = offsetLeft + refRect.width + options.offset
83
+ const leftPosition = offsetLeft - popoverRect.width - options.offset
84
+ const topVAligned = offsetTop
85
+ const centerVAligned = offsetTop - popoverRect.height / 2 + refRect.height / 2
86
+ const bottomVAligned = offsetTop - popoverRect.height + refRect.height
87
+
67
88
  switch (options.placement) {
68
89
  case 'top-right':
69
- top = offsetTop - popoverRect.height - options.offset
70
- left = offsetLeft + refRect.width - popoverRect.width
90
+ top = topPosition
91
+ left = rightAligned
92
+ break
93
+
94
+ case 'top-center':
95
+ top = topPosition
96
+ left = centerAligned
71
97
  break
72
98
 
73
99
  case 'top-left':
74
- top = offsetTop - popoverRect.height - options.offset
75
- left = offsetLeft
100
+ top = topPosition
101
+ left = leftAligned
102
+ break
103
+
104
+ case 'top-full':
105
+ top = topPosition
106
+ left = options.viewportPadding
107
+ right = options.viewportPadding
76
108
  break
77
109
 
78
110
  case 'bottom-right':
79
- top = offsetTop + refRect.height + options.offset
80
- left = offsetLeft + refRect.width - popoverRect.width
111
+ top = bottomPosition
112
+ left = rightAligned
113
+ break
114
+
115
+ case 'bottom-center':
116
+ top = bottomPosition
117
+ left = centerAligned
81
118
  break
82
119
 
83
120
  case 'bottom-left':
84
- top = offsetTop + refRect.height + options.offset
85
- left = offsetLeft
121
+ top = bottomPosition
122
+ left = leftAligned
86
123
  break
87
124
 
88
- // TODO: add remaining placement options
89
- case 'bottom-center':
125
+ case 'bottom-full':
126
+ top = bottomPosition
127
+ left = options.viewportPadding
128
+ right = options.viewportPadding
90
129
  break
91
130
 
92
- case 'top-center':
131
+ case 'right-top':
132
+ top = topVAligned
133
+ left = rightPosition
134
+ break
135
+ case 'right-center':
136
+ top = centerVAligned
137
+ left = rightPosition
138
+ break
139
+ case 'right-bottom':
140
+ top = bottomVAligned
141
+ left = rightPosition
142
+ break
143
+
144
+ case 'left-top':
145
+ top = topVAligned
146
+ left = leftPosition
147
+ break
148
+ case 'left-center':
149
+ top = centerVAligned
150
+ left = leftPosition
151
+ break
152
+ case 'left-bottom':
153
+ top = bottomVAligned
154
+ left = leftPosition
93
155
  }
94
156
 
95
157
  // Add corrections to position if necessary
@@ -114,7 +176,7 @@ export const getPopoverPosition = (
114
176
  top = offsetTop - popoverRect.height - options.offset
115
177
  }
116
178
 
117
- return { top, left }
179
+ return { top, left, right }
118
180
  }
119
181
 
120
182
  /**
@@ -92,6 +92,7 @@ fieldset {
92
92
  border: 0;
93
93
  }
94
94
 
95
+ /* easeOutCubic */
95
96
  /* prettier-ignore */
96
97
  input,
97
98
  textarea,
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../base/main-base.scss","../node_modules/@energie360/design-tokens/dist/fonts/fonts.css","../base/_resets.scss","../base/abstracts/_resets.scss","../base/abstracts/_functions.scss","../base/_input-resets.scss","../base/abstracts/_mixins.scss","../base/_html.scss","../base/_body.scss","../base/_focus-handling.scss","../node_modules/@energie360/design-tokens/dist/css/design-tokens.css"],"names":[],"mappings":";AAAA;AAAA;AAAA;AAAA;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqBA;AACQ;ACpBR;EACE;EACA;;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;EAME;EACA;EACA;EACA;;;AAGF;EACE;EACA;;;AAGF;AAAA;AAAA;EAGE;;;AC1BA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;ADwBJ;AAAA;EAEE;EACA;EACA;;;AAGF;AAAA;AAAA;EAGE;;;AAGF;EACE;;;AAGF;AAAA;EAEE;EACA;;;AAGF;EACE;EACA;EACA;;;AErDF;ACHA;AAAA;AAAA;EAGE;EACA;EACA;EACA;EACA;EACA;;;AAGF;AAAA;AAAA;EC8BE;EACA;EAKE;;;AD7BF;EACE;;AAGF;EACE;;;AAIJ;EACE;;;AAGF;EACE;EACA;;;AAIA;EACE;;;AAIJ;EACE;;;AAIA;EAEE;EACA;;;AEpDJ;EACE;EACA;EACA;;;AAGF;AAAA;AAAA;EAGE;;;ACTF;EACE;EACA;EACA;EACA;EACA;;;ACAF;EACE;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;;ARQF;AACA;AACA;EACE;EACA;EACA;EACA;EACA,KACE;;AAIJ;AACA;EACE;EACA;EACA;EACA;EACA,KACE;;AS3CJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAAA;EAEA;AAAA;EAEA;AAAA;EAEA;AAAA;EAEA;;;AV7MA;AAAA;AAAA;AAAA;EACE","file":"base-style.css"}
1
+ {"version":3,"sourceRoot":"","sources":["../base/main-base.scss","../node_modules/@energie360/design-tokens/dist/fonts/fonts.css","../base/_resets.scss","../base/abstracts/_resets.scss","../base/abstracts/_variables.scss","../base/abstracts/_functions.scss","../base/_input-resets.scss","../base/abstracts/_mixins.scss","../base/_html.scss","../base/_body.scss","../base/_focus-handling.scss","../node_modules/@energie360/design-tokens/dist/css/design-tokens.css"],"names":[],"mappings":";AAAA;AAAA;AAAA;AAAA;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqBA;AACQ;ACpBR;EACE;EACA;;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;EAME;EACA;EACA;EACA;;;AAGF;EACE;EACA;;;AAGF;AAAA;AAAA;EAGE;;;AC1BA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;ADwBJ;AAAA;EAEE;EACA;EACA;;;AAGF;AAAA;AAAA;EAGE;;;AAGF;EACE;;;AAGF;AAAA;EAEE;EACA;;;AAGF;EACE;EACA;EACA;;;AErB+E;AChCjF;ACHA;AAAA;AAAA;EAGE;EACA;EACA;EACA;EACA;EACA;;;AAGF;AAAA;AAAA;EC8BE;EACA;EAKE;;;AD7BF;EACE;;AAGF;EACE;;;AAIJ;EACE;;;AAGF;EACE;EACA;;;AAIA;EACE;;;AAIJ;EACE;;;AAIA;EAEE;EACA;;;AEpDJ;EACE;EACA;EACA;;;AAGF;AAAA;AAAA;EAGE;;;ACTF;EACE;EACA;EACA;EACA;EACA;;;ACAF;EACE;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;;ATQF;AACA;AACA;EACE;EACA;EACA;EACA;EACA,KACE;;AAIJ;AACA;EACE;EACA;EACA;EACA;EACA,KACE;;AU3CJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAAA;EAEA;AAAA;EAEA;AAAA;EAEA;AAAA;EAEA;;;AX7MA;AAAA;AAAA;AAAA;EACE","file":"base-style.css"}
@@ -1,3 +1,4 @@
1
+ /* easeOutCubic */
1
2
  /* prettier-ignore */
2
3
  .text-link {
3
4
  font-size: var(--e-type-size-200);
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../../base/abstracts/_functions.scss","../../elements/text-link/text-link.scss","../../base/abstracts/_mixins.scss"],"names":[],"mappings":"AAKA;ACyCA;ECHE;EACA;EAGE;EAMA;EAKE;EACA;EDtDJ;EACA;EACA;EACA,YACE;;AAGF;EACE;;AAGF;EACE;;AAgCF;EA3BA;;AAEA;EACE;;AAGF;EACE;;AAwBF;EAnBA;EACA;;AAEA;EACE;;AAGF;EACE","file":"text-link.css"}
1
+ {"version":3,"sourceRoot":"","sources":["../../base/abstracts/_variables.scss","../../base/abstracts/_functions.scss","../../elements/text-link/text-link.scss","../../base/abstracts/_mixins.scss"],"names":[],"mappings":"AAqCiF;AChCjF;ACyCA;ECHE;EACA;EAGE;EAMA;EAKE;EACA;EDtDJ;EACA;EACA;EACA,YACE;;AAGF;EACE;;AAGF;EACE;;AAgCF;EA3BA;;AAEA;EACE;;AAGF;EACE;;AAwBF;EAnBA;EACA;;AAEA;EACE;;AAGF;EACE","file":"text-link.css"}
@@ -1,3 +1,4 @@
1
+ /* easeOutCubic */
1
2
  /* prettier-ignore */
2
3
  .container {
3
4
  margin: 0 auto;
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../../base/abstracts/_functions.scss","../../layout/container/container.scss","../../base/abstracts/_mixins.scss","../../layout/split/split.scss"],"names":[],"mappings":"AAKA;ACsBA;EAtBE;EACA;EACA;EACA;EACA;;ACYA;EDMF;IAfI;IACA;;;ACQF;EDMF;IAVI;IACA;;;ACGF;EDMF;IALI;IACA;;;;AEjBJ;EACE;EACA;EACA;EACA;EACA;;ADUA;ECfF;IAQI;IACA;IACA;IACA;IACA;IACA,qBACE;;;ADCJ;ECfF;IAmBI;IACA;;;;AAIJ;EACE;EACA;;ADXA;ECSF;IAKI;IACA;;;ADfF;ECSF;IAUI;IACA;IACA;;;;AAIJ;EACE;;AD1BA;ECyBF;IAII;IACA;;;AD9BF;ECyBF;IASI;;;;AAIJ;EACE;EACA;EACA;EACA;;AD1CA;ECsCF;IAOI;IAIA;IACA;;;ADlDF;ECsCF;IAgBI;IACA;IACA;IACA;IACA;IACA;;;AD3DF;ECsCF;IAyBI;IACA;IACA;;;;AAIJ;EACE;;ADtEA;ECqEF;IAII;;;ADzEF;ECqEF;IAQI","file":"split.css"}
1
+ {"version":3,"sourceRoot":"","sources":["../../base/abstracts/_variables.scss","../../base/abstracts/_functions.scss","../../layout/container/container.scss","../../base/abstracts/_mixins.scss","../../layout/split/split.scss"],"names":[],"mappings":"AAqCiF;AChCjF;ACsBA;EAtBE;EACA;EACA;EACA;EACA;;ACYA;EDMF;IAfI;IACA;;;ACQF;EDMF;IAVI;IACA;;;ACGF;EDMF;IALI;IACA;;;;AEjBJ;EACE;EACA;EACA;EACA;EACA;;ADUA;ECfF;IAQI;IACA;IACA;IACA;IACA;IACA,qBACE;;;ADCJ;ECfF;IAmBI;IACA;;;;AAIJ;EACE;EACA;;ADXA;ECSF;IAKI;IACA;;;ADfF;ECSF;IAUI;IACA;IACA;;;;AAIJ;EACE;;AD1BA;ECyBF;IAII;IACA;;;AD9BF;ECyBF;IASI;;;;AAIJ;EACE;EACA;EACA;EACA;;AD1CA;ECsCF;IAOI;IAIA;IACA;;;ADlDF;ECsCF;IAgBI;IACA;IACA;IACA;IACA;IACA;;;AD3DF;ECsCF;IAyBI;IACA;IACA;;;;AAIJ;EACE;;ADtEA;ECqEF;IAII;;;ADzEF;ECqEF;IAQI","file":"split.css"}
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
- import UIcon from '../icon/u-icon.vue'
3
- import ULoader from '../loader/u-loader.vue'
2
+ import { UIcon, ULoader } from '../'
3
+ import { computed } from 'vue'
4
4
 
5
5
  // TODO: use enums for variant prop.
6
6
  interface ButtonProps {
@@ -11,9 +11,12 @@ interface ButtonProps {
11
11
  href?: string
12
12
  target?: string
13
13
  variant?: string
14
+ asSpan?: boolean
14
15
  }
15
16
 
16
- defineProps<ButtonProps>()
17
+ const { asSpan = false } = defineProps<ButtonProps>()
18
+
19
+ const buttonTag = computed(() => (asSpan ? 'span' : 'button'))
17
20
  </script>
18
21
 
19
22
  <template>
@@ -25,14 +28,18 @@ defineProps<ButtonProps>()
25
28
  </template>
26
29
 
27
30
  <template v-else>
28
- <button :class="['button', variant, { loading: loading }]" :disabled="disabled || null">
31
+ <component
32
+ :is="buttonTag"
33
+ :class="['button', variant, { loading: loading, disabled }]"
34
+ :disabled="disabled || null"
35
+ >
29
36
  <UIcon v-if="icon" :name="icon" />
30
37
  <slot>{{ label }}</slot>
31
38
 
32
39
  <span v-if="loading" class="button__loader">
33
40
  <ULoader />
34
41
  </span>
35
- </button>
42
+ </component>
36
43
  </template>
37
44
  </template>
38
45
 
@@ -63,6 +63,8 @@
63
63
  background-color a.$trs-default,
64
64
  color a.$trs-default;
65
65
 
66
+ @include button-chip-normal;
67
+
66
68
  .icon {
67
69
  margin-left: a.rem(-10);
68
70
  }
@@ -71,8 +73,6 @@
71
73
  @include button-chip-minified;
72
74
  }
73
75
 
74
- @include button-chip-normal;
75
-
76
76
  &.inverted {
77
77
  @include button-chip-inverted;
78
78
  }
@@ -0,0 +1,174 @@
1
+ @use '../../base/abstracts/' as a;
2
+
3
+ .form {
4
+ .form__messages {
5
+ display: none;
6
+ }
7
+
8
+ .form__title {
9
+ @include a.type(800, strong);
10
+
11
+ color: var(--e-c-primary-01-500);
12
+
13
+ @include a.bp(lg) {
14
+ @include a.type(700, strong);
15
+ }
16
+ }
17
+
18
+ .form__lead {
19
+ @include a.type(200, weak);
20
+
21
+ .form__subtitle-info {
22
+ color: var(--e-c-secondary-01-900);
23
+ margin-left: var(--e-space-1);
24
+
25
+ e-icon {
26
+ display: inline-block;
27
+ vertical-align: middle;
28
+ }
29
+ }
30
+ }
31
+
32
+ .form__title + .form__lead {
33
+ @include a.type(300);
34
+
35
+ @include a.bp(lg) {
36
+ @include a.type(200);
37
+ }
38
+ }
39
+
40
+ .form__subtitle {
41
+ @include a.type(300, strong);
42
+
43
+ color: var(--e-c-primary-01-500);
44
+
45
+ .form__subtitle-info {
46
+ color: var(--e-c-secondary-01-900);
47
+ margin-left: var(--e-space-1);
48
+
49
+ e-icon {
50
+ display: inline-block;
51
+ vertical-align: middle;
52
+ }
53
+ }
54
+ }
55
+
56
+ .form__cta-group {
57
+ display: flex;
58
+ grid-gap: var(--e-space-5);
59
+
60
+ @include a.bp(m) {
61
+ flex-direction: column;
62
+ }
63
+ }
64
+
65
+ // Spacing rules for text elements.
66
+ .form__title + .form__lead,
67
+ .form__subtitle + .form__lead {
68
+ margin-top: var(--e-space-3); // get 12px from title to lead
69
+
70
+ @include a.bp(lg) {
71
+ margin-top: var(--e-space-1_5); // get 6px from title to lead
72
+ }
73
+ }
74
+
75
+ // Vertical spacing classes
76
+ // These classes will be set programatically for 'e-form' extension.
77
+
78
+ // Special case
79
+ .form__lead-row + * {
80
+ margin-top: var(--e-space-5);
81
+
82
+ @include a.bp(lg) {
83
+ margin-top: var(--e-space-3);
84
+ }
85
+ }
86
+
87
+ .form__subtitle-row + *,
88
+ .form__lead-row.form__subtitle-row + * {
89
+ margin-top: var(--e-space-6);
90
+
91
+ @include a.bp(lg) {
92
+ margin-top: var(--e-space-3);
93
+ }
94
+ }
95
+
96
+ .form__input-row + .form__input-row,
97
+ .form__title-row + *,
98
+ *:not(legend) + .form__lead-row {
99
+ margin-top: var(--e-space-10);
100
+
101
+ @include a.bp(lg) {
102
+ margin-top: var(--e-space-6);
103
+ }
104
+ }
105
+
106
+ .form__input-row.form__input-row--compact + .form__input-row.form__input-row--compact {
107
+ margin-top: var(--e-space-6);
108
+ }
109
+
110
+ *:not(legend) + .form__title-row,
111
+ *:not(legend) + .form__cta-row,
112
+ *:not(legend) + .form__subtitle-row {
113
+ margin-top: var(--e-space-16);
114
+
115
+ @include a.bp(lg) {
116
+ margin-top: var(--e-space-10);
117
+ }
118
+ }
119
+
120
+ .form__input-col + .form__input-col {
121
+ @include a.bp(lg) {
122
+ margin-top: var(--e-space-6);
123
+ }
124
+ }
125
+
126
+ .form__messages-row {
127
+ display: none;
128
+ margin-top: var(--e-space-10);
129
+ }
130
+
131
+ .form__cookiebot-message {
132
+ margin-bottom: var(--e-space-6);
133
+ }
134
+ //.alert + .button {
135
+ // margin-top: var(--e-space-6);
136
+ //}
137
+
138
+ // States
139
+ &.form--has-general-error {
140
+ .form__messages-row,
141
+ .form__messages {
142
+ display: block;
143
+ }
144
+ }
145
+
146
+ &.form--hide-form-elements {
147
+ > *:not(.success-screen) {
148
+ display: none;
149
+ }
150
+ }
151
+
152
+ &.form--is-submitting {
153
+ .form-row:not(.form__cta-row) {
154
+ opacity: 0.6;
155
+ pointer-events: none;
156
+ }
157
+ }
158
+
159
+ .form__recaptcha {
160
+ font-size: a.rem(10);
161
+ line-height: 1.5;
162
+ margin-top: var(--e-space-6);
163
+ color: var(--e-c-mono-700);
164
+
165
+ a {
166
+ color: var(--e-c-primary-01-700);
167
+ text-underline-offset: var(--e-space-1);
168
+ }
169
+ }
170
+ }
171
+
172
+ .grecaptcha-badge {
173
+ visibility: hidden;
174
+ }
@@ -26,6 +26,11 @@ const {
26
26
 
27
27
  const slots = useSlots()
28
28
  const model = defineModel<string>()
29
+ const emits = defineEmits<{
30
+ input: [value: string | null]
31
+ focus: [target: FocusEvent['target']]
32
+ focusout: [target: FocusEvent['target']]
33
+ }>()
29
34
 
30
35
  const input = useTemplateRef('input')
31
36
 
@@ -39,12 +44,13 @@ const spacer = '.&nbsp;'
39
44
  // In some cases we need to change the input type within the component (for example for the password-show behaviour)
40
45
  const _inputType = ref(type)
41
46
 
42
- const onFocus = () => {
47
+ const onFocus = (event: FocusEvent) => {
43
48
  if (readonly || disabled) {
44
49
  return
45
50
  }
46
51
 
47
52
  isFocused.value = true
53
+ emits('focus', event.target)
48
54
  }
49
55
 
50
56
  const onBlur = () => {
@@ -53,6 +59,7 @@ const onBlur = () => {
53
59
 
54
60
  const onInput = () => {
55
61
  hasValue.value = !!input.value && input.value.value !== ''
62
+ emits('input', input.value?.value ?? null)
56
63
  }
57
64
 
58
65
  const onHover = () => {
@@ -140,6 +147,7 @@ watch(
140
147
  :required
141
148
  @input="onInput"
142
149
  @focus="onFocus"
150
+ @focusout="$emit('focusout', $event.target)"
143
151
  @blur="onBlur"
144
152
  /></slot>
145
153
 
package/i18n/i18n.ts CHANGED
@@ -11,6 +11,8 @@ const translations = {
11
11
  passwordRequirements: 'Anforderungen an das Passwort',
12
12
  edit: 'Bearbeiten',
13
13
  cancel: 'Abbrechen',
14
+ openMenu: 'Menu öffnen',
15
+ closeMenu: 'Menu schliessen',
14
16
  },
15
17
  FR: {
16
18
  yes: 'Ja',
@@ -24,6 +26,8 @@ const translations = {
24
26
  passwordRequirements: 'Exigences relatives au mot de passe',
25
27
  edit: 'Modifier',
26
28
  cancel: 'Annuler',
29
+ openMenu: 'Ouvrir le menu',
30
+ closeMenu: 'Fermer le menu',
27
31
  },
28
32
  IT: {
29
33
  yes: 'Ja',
@@ -37,6 +41,8 @@ const translations = {
37
41
  passwordRequirements: 'Requisiti per la password',
38
42
  edit: 'modificare',
39
43
  cancel: 'cancellare',
44
+ openMenu: 'Apri il menu',
45
+ closeMenu: 'Chiudi menù',
40
46
  },
41
47
  EN: {
42
48
  yes: 'Ja',
@@ -50,6 +56,8 @@ const translations = {
50
56
  passwordRequirements: 'Password requirements',
51
57
  edit: 'Edit',
52
58
  cancel: 'Cancel',
59
+ openMenu: 'Open menu',
60
+ closeMenu: 'Close menu',
53
61
  },
54
62
  }
55
63
 
@@ -0,0 +1,42 @@
1
+ @use '../grid/grid.mixin' as g;
2
+ @use '../../base/abstracts' as a;
3
+
4
+ // TODO: This class doesn't seem to be necessary. Check first then remove it.
5
+ .form-grid {
6
+ width: 100%;
7
+ }
8
+
9
+ .form-row {
10
+ @include g.grid-row;
11
+
12
+ .form-col {
13
+ // Default column width
14
+ @include g.grid-col(6);
15
+ }
16
+
17
+ .form-col-1\/4 {
18
+ @include g.grid-col(3);
19
+ }
20
+
21
+ .form-col-2\/4 {
22
+ // Default column width
23
+ @include g.grid-col(6);
24
+ }
25
+
26
+ .form-col-3\/4 {
27
+ @include g.grid-col(9);
28
+ }
29
+
30
+ .form-col-4\/4 {
31
+ @include g.grid-col(12);
32
+ }
33
+
34
+ .form-col,
35
+ .form-col-1\/4,
36
+ .form-col-2\/4,
37
+ .form-col-3\/4 {
38
+ @include a.bp(lg) {
39
+ @include g.grid-col(12);
40
+ }
41
+ }
42
+ }
package/modules/index.js CHANGED
@@ -1,3 +1,5 @@
1
1
  export { default as UFeedback } from './feedback/u-feedback.vue'
2
2
  export { default as UFooter } from './footer/u-footer.vue'
3
3
  export { default as UInlineEditGroup } from './inline-edit-group/u-inline-edit-group.vue'
4
+ export { default as UNavigationToolbarTop } from './navigation-toolbar-top/u-navigation-toolbar-top.vue'
5
+ export { default as UNavigationToolbarSide } from './navigation-toolbar-side/u-navigation-toolbar-side.vue'