@energie360/ui-library 0.1.1 → 0.1.2

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 (92) hide show
  1. package/base/_input-resets.scss +9 -3
  2. package/base/_resets.scss +5 -0
  3. package/components/accordion-item/accordion-item.scss +62 -0
  4. package/components/accordion-item/u-accordion-item.vue +44 -0
  5. package/components/card/card.scss +58 -0
  6. package/components/card/u-card.vue +26 -0
  7. package/components/card-header/card-header.scss +102 -0
  8. package/components/card-header/u-card-header.vue +51 -0
  9. package/components/card-hint/card-hint.scss +13 -0
  10. package/components/card-hint/u-card-hint.vue +23 -0
  11. package/components/card-price/card-price.scss +110 -0
  12. package/components/card-price/u-card-price.vue +47 -0
  13. package/components/card-table/card-table.scss +76 -0
  14. package/components/card-table/u-card-table.vue +77 -0
  15. package/components/card-toggle-switches/card-toggle-switches.scss +13 -0
  16. package/components/card-toggle-switches/u-card-toggle-switches.vue +30 -0
  17. package/components/collapsible/collapsible.scss +14 -0
  18. package/components/collapsible/u-collapsible.vue +81 -0
  19. package/components/collapsible-group/u-collapsible-group.vue +14 -0
  20. package/components/icon-teaser/icon-teaser.scss +58 -0
  21. package/components/icon-teaser/u-icon-teaser.vue +35 -0
  22. package/components/icon-teaser-group/icon-teaser-group.scss +10 -0
  23. package/components/icon-teaser-group/u-icon-teaser-group.vue +19 -0
  24. package/components/icon-text-block/u-icon-text-block.vue +3 -8
  25. package/components/language-nav/language-nav.scss +32 -0
  26. package/components/language-nav/u-language-nav.vue +27 -0
  27. package/components/panel/panel.scss +43 -6
  28. package/components/panel/u-panel.vue +22 -11
  29. package/components/progress-bar/u-progress-bar.vue +1 -1
  30. package/components/richtext/richtext.scss +208 -0
  31. package/components/richtext/u-richtext.vue +21 -0
  32. package/components/table/u-cell-ctas.vue +2 -7
  33. package/components/table/u-cell-icon-group.vue +1 -1
  34. package/components/table/u-cell-icon-text.vue +1 -1
  35. package/components/table/u-cell-progress-bar.vue +1 -1
  36. package/components/table/u-table-cell.vue +3 -13
  37. package/components/table/u-table-heading.vue +1 -4
  38. package/components/tooltip/{popover.js → popover.ts} +51 -43
  39. package/components/tooltip/u-tooltip.vue +40 -60
  40. package/dist/base-style.css +409 -2
  41. package/dist/base-style.css.map +1 -0
  42. package/dist/elements/text-link.css +40 -0
  43. package/dist/elements/text-link.css.map +1 -0
  44. package/dist/layout/split.css +124 -0
  45. package/dist/layout/split.css.map +1 -0
  46. package/elements/button/u-button.vue +2 -5
  47. package/elements/button-chip/button-chip.scss +83 -0
  48. package/elements/button-chip/u-button-chip.vue +45 -0
  49. package/elements/form-field/form-field-base.scss +2 -3
  50. package/elements/form-field/form-field.types.ts +8 -0
  51. package/elements/icon/u-icon.vue +1 -3
  52. package/elements/image/u-image.vue +2 -2
  53. package/elements/numeric-stepper/numeric-stepper.scss +110 -0
  54. package/elements/numeric-stepper/u-numeric-stepper.vue +135 -0
  55. package/elements/select/select.scss +32 -0
  56. package/elements/select/u-select.vue +130 -0
  57. package/elements/select-chip/select-chip.scss +18 -0
  58. package/elements/select-chip/u-select-chip.vue +50 -0
  59. package/elements/select-chips/select-chips.scss +5 -0
  60. package/elements/select-chips/u-select-chips.vue +23 -0
  61. package/elements/spectro/spectro.scss +1 -4
  62. package/elements/text-field/u-text-field.vue +43 -27
  63. package/elements/text-link/text-link.scss +57 -0
  64. package/elements/toggle-switch/toggle-switch-small.scss +40 -0
  65. package/elements/toggle-switch/toggle-switch.scss +149 -0
  66. package/elements/toggle-switch/u-toggle-switch.vue +68 -0
  67. package/elements/types.ts +7 -0
  68. package/globals.js +1 -2
  69. package/helpers/transition-height.vue +39 -0
  70. package/i18n/i18n.ts +40 -0
  71. package/layout/grid/grid.mixin.scss +4 -11
  72. package/layout/split/split.scss +96 -0
  73. package/modules/footer/footer.scss +161 -0
  74. package/modules/footer/u-footer.vue +59 -0
  75. package/package.json +23 -13
  76. package/utility/elements/text-link.scss +1 -0
  77. package/utility/layout/split.scss +1 -0
  78. package/utility/utility-text.js +1 -0
  79. package/utils/object/deep-get.js +1 -2
  80. package/utils/translations/translate.js +13 -0
  81. package/vite.config.ts +1 -0
  82. package/watch.js +27 -0
  83. package/wizard/wizard-intro/wizard-intro.scss +4 -0
  84. package/wizard/wizard-layout/u-wizard-layout-block.vue +1 -1
  85. package/wizard/wizard-layout/u-wizard-layout-element.vue +1 -1
  86. package/wizard/wizard-layout/u-wizard-layout.vue +1 -1
  87. package/wizard/wizard-layout/wizard-layout.scss +6 -6
  88. package/dist/base-style.js +0 -2
  89. package/dist/base-style.js.map +0 -1
  90. package/dist/custom-elements.css +0 -1
  91. package/dist/custom-elements.js +0 -5185
  92. package/dist/custom-elements.js.map +0 -1
@@ -14,9 +14,7 @@ select {
14
14
  input,
15
15
  select,
16
16
  textarea {
17
- @include a.type(
18
- 200
19
- ); // Set this here because of specificity issues (with ::slotted)
17
+ @include a.type(200); // Set this here because of specificity issues (with ::slotted)
20
18
  }
21
19
 
22
20
  input {
@@ -47,3 +45,11 @@ select {
47
45
  textarea {
48
46
  resize: vertical;
49
47
  }
48
+
49
+ input[type='number'] {
50
+ &::-webkit-inner-spin-button,
51
+ &::-webkit-outer-spin-button {
52
+ appearance: none;
53
+ margin: 0;
54
+ }
55
+ }
package/base/_resets.scss CHANGED
@@ -17,6 +17,11 @@ h6 {
17
17
  font-weight: unset;
18
18
  }
19
19
 
20
+ a {
21
+ color: inherit;
22
+ text-decoration: none;
23
+ }
24
+
20
25
  p,
21
26
  figure,
22
27
  blockquote {
@@ -0,0 +1,62 @@
1
+ @use '../../base/abstracts' as a;
2
+
3
+ .accordion-item {
4
+ &.inverted {
5
+ .accordion-item__header {
6
+ background-color: var(--e-c-mono-00);
7
+ border-color: var(--e-c-mono-00);
8
+
9
+ &:hover {
10
+ border-color: var(--e-c-secondary-01-100);
11
+ }
12
+ }
13
+
14
+ .collapsible__header:hover {
15
+ .accordion-item__header {
16
+ border-color: var(--e-c-secondary-01-100);
17
+ }
18
+ }
19
+ }
20
+ }
21
+
22
+ .accordion-item__header {
23
+ @include a.type(200, strong);
24
+
25
+ display: flex;
26
+ justify-content: space-between;
27
+ padding: calc(var(--e-space-4) - 2px) calc(var(--e-space-3) - 2px); // Subtract 2px for border
28
+ grid-gap: var(--e-space-1);
29
+ background-color: var(--e-c-mono-50);
30
+ border-radius: var(--e-brd-radius-1);
31
+ border: 2px solid var(--e-c-mono-50);
32
+ color: var(--e-c-mono-700);
33
+ cursor: pointer;
34
+ transition: border a.$trs-default;
35
+
36
+ // Unfortunately this is necessary so that gtm works. awesome...
37
+ pointer-events: none;
38
+ }
39
+
40
+ .accordion-item__panel {
41
+ padding: var(--e-space-4) var(--e-space-3);
42
+ color: var(--e-c-mono-900);
43
+ }
44
+
45
+ .accordion-item__icon {
46
+ line-height: 0;
47
+
48
+ .icon {
49
+ display: inline-block;
50
+ transition: transform a.$trs-default;
51
+ perspective-origin: center;
52
+
53
+ --fill-color: var(--e-c-primary-01-500);
54
+ }
55
+ }
56
+
57
+ // States
58
+ .accordion-item.is-expanded {
59
+ .accordion-item__icon .icon {
60
+ transform: rotate(180deg);
61
+ }
62
+ }
@@ -0,0 +1,44 @@
1
+ <script setup lang="ts">
2
+ import UCollapsible from '../collapsible/u-collapsible.vue'
3
+ import UIcon from '../../elements/icon/u-icon.vue'
4
+ import URichtext from '../richtext/u-richtext.vue'
5
+ import { useTemplateRef } from 'vue'
6
+
7
+ interface Props {
8
+ header?: string
9
+ panel?: string
10
+ level?: number
11
+ inverted?: boolean
12
+ }
13
+
14
+ const collapsible = useTemplateRef('collapsible')
15
+
16
+ defineProps<Props>()
17
+ </script>
18
+
19
+ <template>
20
+ <div :class="['accordion-item', { 'is-expanded': collapsible?.isExpanded, inverted }]">
21
+ <UCollapsible ref="collapsible" :level>
22
+ <template #header>
23
+ <span class="accordion-item__header">
24
+ {{ header }}
25
+ <span class="accordion-item__icon">
26
+ <UIcon name="chevron-down"></UIcon>
27
+ </span>
28
+ </span>
29
+ </template>
30
+
31
+ <template #panel>
32
+ <slot name="panel">
33
+ <div class="accordion-item__panel">
34
+ <URichtext small :text="panel"></URichtext>
35
+ </div>
36
+ </slot>
37
+ </template>
38
+ </UCollapsible>
39
+ </div>
40
+ </template>
41
+
42
+ <style scoped lang="scss">
43
+ @use './accordion-item.scss';
44
+ </style>
@@ -0,0 +1,58 @@
1
+ @use '../../base/abstracts' as a;
2
+
3
+ .card {
4
+ position: relative;
5
+ border: 1px solid transparent;
6
+ border-radius: var(--e-brd-radius-2);
7
+ display: flex;
8
+ flex-direction: column;
9
+ height: 100%;
10
+
11
+ &::after {
12
+ pointer-events: none;
13
+ content: '';
14
+ position: absolute;
15
+ inset: -1px;
16
+ border-radius: var(--e-brd-radius-2);
17
+ border: 1px solid var(--e-c-mono-200);
18
+ transition: border var(--e-trs-duration-faster) var(--e-trs-easing-default);
19
+ }
20
+
21
+ &.is-active {
22
+ &::after {
23
+ border: 3px solid var(--e-c-primary-01-200);
24
+ }
25
+ }
26
+ }
27
+
28
+ // LAYOUT
29
+ .card-header,
30
+ .card-section,
31
+ .card-footer {
32
+ padding: var(--e-space-6);
33
+
34
+ @include a.bp(m) {
35
+ padding: var(--e-space-5);
36
+ }
37
+
38
+ @include a.bp(s) {
39
+ padding: var(--e-space-4);
40
+ }
41
+ }
42
+
43
+ .card-footer {
44
+ display: flex;
45
+ flex-direction: column;
46
+ gap: var(--e-space-4);
47
+ }
48
+
49
+ .card-section:last-child:has(.card-hint),
50
+ .card-footer {
51
+ margin-top: auto; // Make this element stick to bottom of the card.
52
+ }
53
+
54
+ .card-header + *,
55
+ .card-section + .card-section,
56
+ * + .card-footer {
57
+ border-top: 1px solid var(--e-c-mono-200);
58
+ }
@@ -0,0 +1,26 @@
1
+ <script setup lang="ts">
2
+ import { provide, ref } from 'vue'
3
+
4
+ interface Props {
5
+ active?: boolean
6
+ }
7
+
8
+ defineProps<Props>()
9
+
10
+ const isActive = ref(false)
11
+ const toggleActiveCard = (v: boolean) => {
12
+ isActive.value = v
13
+ }
14
+
15
+ provide('card', { toggleActiveCard })
16
+ </script>
17
+
18
+ <template>
19
+ <section :class="['card', { 'is-active': isActive }]">
20
+ <slot></slot>
21
+ </section>
22
+ </template>
23
+
24
+ <style lang="scss">
25
+ @use './card.scss';
26
+ </style>
@@ -0,0 +1,102 @@
1
+ @use '../../base/abstracts' as a;
2
+
3
+ $image-col-width: 112px;
4
+ $image-col-width-small: 100px;
5
+
6
+ :host {
7
+ display: block;
8
+ container: card / inline-size;
9
+ }
10
+
11
+ .card-header {
12
+ position: relative;
13
+ display: flex;
14
+ column-gap: var(--e-space-2);
15
+
16
+ @container (max-width: 260px) {
17
+ flex-direction: column-reverse;
18
+ }
19
+ }
20
+
21
+ .title-wrapper {
22
+ h3,
23
+ h2 {
24
+ @include a.type(300, strong);
25
+ }
26
+ }
27
+
28
+ .text-wrapper {
29
+ @include a.type(200);
30
+ }
31
+
32
+ .logos {
33
+ display: flex;
34
+ height: a.rem(32);
35
+ gap: var(--e-space-3);
36
+ }
37
+
38
+ .title-wrapper + .text-wrapper,
39
+ * + .logos {
40
+ margin-top: var(--e-space-1);
41
+ }
42
+
43
+ .image-col {
44
+ flex: 0 0 a.rem($image-col-width);
45
+ max-width: a.rem($image-col-width);
46
+ margin-left: auto;
47
+
48
+ img {
49
+ width: a.rem(64);
50
+
51
+ @include a.bp(lg) {
52
+ width: a.rem(60);
53
+ }
54
+ }
55
+
56
+ @container (max-width: 260px) {
57
+ max-width: a.rem($image-col-width-small);
58
+ flex-basis: a.rem($image-col-width-small);
59
+ margin-left: 0;
60
+ margin-bottom: var(--e-space-2);
61
+
62
+ img {
63
+ width: a.rem(60);
64
+ }
65
+ }
66
+
67
+ @include a.bp(lg) {
68
+ flex-basis: a.rem($image-col-width-small);
69
+ }
70
+ }
71
+
72
+ .image-background {
73
+ display: flex;
74
+ align-items: center;
75
+ justify-content: center;
76
+ width: 100%;
77
+ aspect-ratio: 1;
78
+ background-color: var(--e-c-primary-01-100);
79
+ border-radius: 100%;
80
+ }
81
+
82
+ .badge {
83
+ @include a.type(100, strong);
84
+
85
+ position: absolute;
86
+ padding: a.rem(6) a.rem(8) a.rem(4);
87
+ color: var(--e-c-mono-00);
88
+ background-color: var(--e-c-secondary-05-500);
89
+ border-radius: var(--e-brd-radius-1);
90
+ top: a.rem(-16);
91
+ right: a.rem(-16);
92
+
93
+ @include a.bp(m) {
94
+ top: a.rem(-12);
95
+ right: a.rem(-12);
96
+ }
97
+
98
+ @include a.bp(s) {
99
+ top: a.rem(-10);
100
+ right: a.rem(-10);
101
+ }
102
+ }
@@ -0,0 +1,51 @@
1
+ <script setup lang="ts">
2
+ import { Image } from '../../elements/types'
3
+
4
+ interface Props {
5
+ title?: string
6
+ text?: string
7
+ image?: Image
8
+ logos?: Image[]
9
+ badge?: string
10
+ }
11
+
12
+ defineProps<Props>()
13
+ </script>
14
+
15
+ <template>
16
+ <div class="card-header">
17
+ <div class="content-col">
18
+ <div class="title-wrapper">
19
+ <slot name="title">
20
+ <h3>{{ title }}</h3>
21
+ </slot>
22
+ </div>
23
+
24
+ <div class="text-wrapper">
25
+ <slot name="text">
26
+ <p>{{ text }}</p>
27
+ </slot>
28
+ </div>
29
+
30
+ <div v-if="logos" class="logos">
31
+ <slot name="logos">
32
+ <img v-for="(img, idx) in logos" :key="idx" :src="img.src" :alt="img.alt" />
33
+ </slot>
34
+ </div>
35
+ </div>
36
+
37
+ <div v-if="image || $slots.image" class="image-col">
38
+ <div class="image-background">
39
+ <slot name="image"><img v-if="image" :src="image.src" :alt="image.alt" /></slot>
40
+ </div>
41
+ </div>
42
+
43
+ <div v-if="badge" class="badge">
44
+ <slot name="badge">{{ badge }}</slot>
45
+ </div>
46
+ </div>
47
+ </template>
48
+
49
+ <style lang="scss">
50
+ @use './card-header.scss';
51
+ </style>
@@ -0,0 +1,13 @@
1
+ @use '../../base/abstracts' as a;
2
+
3
+ .card-hint {
4
+ h4 {
5
+ @include a.type(100, weak);
6
+ }
7
+
8
+ p {
9
+ @include a.type(100, strong);
10
+
11
+ color: var(--e-c-secondary-05-500);
12
+ }
13
+ }
@@ -0,0 +1,23 @@
1
+ <script setup lang="ts">
2
+ interface Props {
3
+ title: string
4
+ text: string
5
+ }
6
+
7
+ defineProps<Props>()
8
+ </script>
9
+
10
+ <template>
11
+ <div class="card-hint">
12
+ <slot v-if="title" name="title"
13
+ ><h4>{{ title }}</h4></slot
14
+ >
15
+ <slot v-if="text" name="text"
16
+ ><p>{{ text }}</p></slot
17
+ >
18
+ </div>
19
+ </template>
20
+
21
+ <style lang="scss">
22
+ @use './card-hint.scss';
23
+ </style>
@@ -0,0 +1,110 @@
1
+ @use '../../base/abstracts' as a;
2
+
3
+ $image-width: 112px;
4
+ $image-width-small: 100px;
5
+
6
+ .card-price-wrapper {
7
+ display: block;
8
+ container: card / inline-size;
9
+ }
10
+
11
+ .card-price {
12
+ display: flex;
13
+ gap: var(--e-space-6);
14
+ justify-content: space-between;
15
+
16
+ .card-price__price {
17
+ @include a.type(700, strong);
18
+ }
19
+
20
+ .card-price__subtext {
21
+ color: var(--e-c-mono-500);
22
+
23
+ @include a.type(200);
24
+ }
25
+
26
+ .card-price__description {
27
+ @include a.type(50);
28
+
29
+ margin-top: var(--e-space-4);
30
+ }
31
+
32
+ .card-price__description-duplicate {
33
+ display: none;
34
+
35
+ @include a.type(50);
36
+ }
37
+
38
+ .card-price__widget-image {
39
+ display: flex;
40
+ align-items: center;
41
+ justify-content: center;
42
+ width: a.rem($image-width);
43
+ height: a.rem($image-width);
44
+ border-radius: 100%;
45
+ aspect-ratio: 1;
46
+ background-color: var(--e-c-primary-01-100);
47
+
48
+ img {
49
+ min-width: a.rem(64); // Prevent img from shrinking even if width is set.
50
+ width: a.rem(64);
51
+ height: a.rem(64);
52
+ object-fit: contain;
53
+ }
54
+ }
55
+
56
+ @container (max-width: 260px) {
57
+ .card-price__widget-image {
58
+ width: a.rem($image-width-small);
59
+ height: a.rem($image-width-small);
60
+
61
+ img {
62
+ min-width: a.rem(60); // Prevent img from shrinking even if width is set.
63
+ width: a.rem(60);
64
+ height: a.rem(60);
65
+ }
66
+ }
67
+ }
68
+
69
+ @include a.bp(lg) {
70
+ .card-price__widget-image {
71
+ width: a.rem($image-width-small);
72
+ height: a.rem($image-width-small);
73
+
74
+ img {
75
+ min-width: a.rem(60); // Prevent img from shrinking even if width is set.
76
+ width: a.rem(60);
77
+ height: a.rem(60);
78
+ }
79
+ }
80
+ }
81
+
82
+ @include a.bp(m) {
83
+ gap: var(--e-space-4);
84
+
85
+ &.has-img {
86
+ flex-wrap: wrap;
87
+
88
+ .card-price__description {
89
+ display: none;
90
+ }
91
+
92
+ .card-price__description-duplicate {
93
+ display: block;
94
+ flex: 1 0 100%;
95
+ }
96
+ }
97
+
98
+ &.has-numeric-stepper {
99
+ flex-direction: column;
100
+
101
+ .card-price__description {
102
+ display: none;
103
+ }
104
+
105
+ .card-price__description-duplicate {
106
+ display: block;
107
+ }
108
+ }
109
+ }
110
+ }
@@ -0,0 +1,47 @@
1
+ <script setup lang="ts">
2
+ interface Props {
3
+ priceText: string
4
+ priceSubtext?: string
5
+ description?: string
6
+ }
7
+
8
+ defineProps<Props>()
9
+ </script>
10
+
11
+ <template>
12
+ <div class="card-price-wrapper">
13
+ <div
14
+ :class="['card-price', { 'has-img': $slots.image, 'has-numeric-stepper': $slots.stepper }]"
15
+ >
16
+ <div class="card-price__left-col">
17
+ <div class="card-price__price">
18
+ {{ priceText }}
19
+ </div>
20
+
21
+ <div v-if="priceSubtext" class="card-price__subtext">
22
+ {{ priceSubtext }}
23
+ </div>
24
+
25
+ <div v-if="description" class="card-price__description">
26
+ {{ description }}
27
+ </div>
28
+ </div>
29
+
30
+ <div v-if="$slots.stepper || $slots.image" class="card-price__right-col">
31
+ <slot v-if="$slots.stepper" name="stepper"></slot>
32
+
33
+ <div v-if="$slots.image" class="card-price__widget-image">
34
+ <slot name="image"></slot>
35
+ </div>
36
+ </div>
37
+
38
+ <div v-if="description" class="card-price__description-duplicate">
39
+ {{ description }}
40
+ </div>
41
+ </div>
42
+ </div>
43
+ </template>
44
+
45
+ <style lang="scss">
46
+ @use './card-price.scss';
47
+ </style>
@@ -0,0 +1,76 @@
1
+ @use '../../base/abstracts' as a;
2
+
3
+ .card-table-heading {
4
+ display: flex;
5
+ column-gap: var(--e-space-2);
6
+ flex-wrap: wrap;
7
+ margin-bottom: var(--e-space-4);
8
+ }
9
+
10
+ .card-table-heading__title,
11
+ .card-table-heading__secondary-title {
12
+ @include a.type(200, strong);
13
+ }
14
+
15
+ .card-table-heading__title {
16
+ color: var(--e-c-primary-01-700);
17
+ }
18
+
19
+ .card-table {
20
+ width: 100%;
21
+
22
+ td,
23
+ th {
24
+ padding: var(--e-space-1) 0;
25
+
26
+ > div {
27
+ display: flex;
28
+ flex-wrap: nowrap;
29
+ width: 100%;
30
+ justify-content: flex-end;
31
+ column-gap: var(--e-space-2);
32
+ }
33
+ }
34
+
35
+ th {
36
+ vertical-align: top;
37
+
38
+ @include a.type(100, strong);
39
+
40
+ .info {
41
+ white-space: nowrap;
42
+
43
+ @include a.type(100, weak);
44
+ }
45
+ }
46
+
47
+ td {
48
+ @include a.type(100, weak);
49
+ }
50
+
51
+ tr {
52
+ .discount {
53
+ color: var(--e-c-secondary-05-500);
54
+ }
55
+
56
+ td:nth-child(1),
57
+ th:nth-child(1) {
58
+ vertical-align: top;
59
+ text-align: left;
60
+ padding-right: var(--e-space-6);
61
+ }
62
+
63
+ td:nth-child(2),
64
+ th:nth-child(2) {
65
+ text-align: right;
66
+ }
67
+
68
+ td:nth-child(2) {
69
+ color: var(--e-c-mono-700);
70
+ }
71
+ }
72
+
73
+ + .card-table {
74
+ margin-top: var(--e-space-4);
75
+ }
76
+ }