@energie360/ui-library 0.1.1 → 0.1.3

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 +6 -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
@@ -0,0 +1,77 @@
1
+ <script setup lang="ts">
2
+ interface Cell {
3
+ text: string
4
+ info?: string
5
+ discount: string
6
+ }
7
+
8
+ interface Table {
9
+ heading?: [Cell, Cell]
10
+ rows?: Array<[Cell, Cell]>
11
+ }
12
+
13
+ interface Props {
14
+ title?: string
15
+ secondaryTitle?: string
16
+ tables: Table[]
17
+ }
18
+
19
+ defineProps<Props>()
20
+
21
+ const getCellText = (cell: Cell): string => (cell.discount ? cell.discount : cell.text || '')
22
+
23
+ const getCellDiscount = (cell: Cell): string => (cell.discount ? cell.text : '')
24
+ </script>
25
+
26
+ <template>
27
+ <div class="card-table-wrapper">
28
+ <div class="card-table-heading">
29
+ <div v-if="title" class="card-table-heading__title">
30
+ {{ title }}
31
+ </div>
32
+
33
+ <div v-if="secondaryTitle" class="card-table-heading__secondary-title">
34
+ {{ secondaryTitle }}
35
+ </div>
36
+ </div>
37
+
38
+ <table v-for="(table, idx) in tables" :key="idx" class="card-table">
39
+ <!-- TABLE HEADING -->
40
+ <thead v-if="table.heading">
41
+ <tr>
42
+ <th>
43
+ {{ table.heading[0].text }}
44
+ <span v-if="table.heading[0].info" class="info">{{ table.heading[0].info }}</span>
45
+ </th>
46
+ <th>
47
+ <div>
48
+ {{ getCellText(table.heading[1])
49
+ }}<span v-if="getCellDiscount(table.heading[1])" class="discount"
50
+ ><s>{{ getCellDiscount(table.heading[1]) }}</s></span
51
+ >
52
+ </div>
53
+ </th>
54
+ </tr>
55
+ </thead>
56
+
57
+ <!-- TABLE BODY -->
58
+ <tbody>
59
+ <tr v-for="(row, idx2) in table.rows" :key="idx2">
60
+ <td>{{ row[0].text || '' }}</td>
61
+ <td>
62
+ <div>
63
+ {{ getCellText(row[1])
64
+ }}<span v-if="getCellDiscount(row[1])" class="discount"
65
+ ><s>{{ getCellDiscount(row[1]) }}</s></span
66
+ >
67
+ </div>
68
+ </td>
69
+ </tr>
70
+ </tbody>
71
+ </table>
72
+ </div>
73
+ </template>
74
+
75
+ <style lang="scss">
76
+ @use './card-table.scss';
77
+ </style>
@@ -0,0 +1,13 @@
1
+ @use '../../base/abstracts' as a;
2
+
3
+ .card-toggle-switches {
4
+ .card-toggle-switches__title {
5
+ @include a.type(200, strong);
6
+
7
+ margin-bottom: var(--e-space-4);
8
+ }
9
+
10
+ .toggle-switch + .toggle-switch {
11
+ margin-top: var(--e-space-4);
12
+ }
13
+ }
@@ -0,0 +1,30 @@
1
+ <script setup lang="ts">
2
+ import UToggleSwitch, { ToggleSwitch } from '../../elements/toggle-switch/u-toggle-switch.vue'
3
+
4
+ interface Props {
5
+ title?: string
6
+ toggles?: ToggleSwitch[]
7
+ }
8
+
9
+ defineProps<Props>()
10
+ </script>
11
+
12
+ <template>
13
+ <div class="card-toggle-switches">
14
+ <h4 class="card-toggle-switches__title">{{ title }}</h4>
15
+
16
+ <slot>
17
+ <UToggleSwitch
18
+ v-for="(toggle, idx) in toggles"
19
+ :key="idx"
20
+ v-bind="toggle"
21
+ variant="small"
22
+ label-position="right"
23
+ ></UToggleSwitch>
24
+ </slot>
25
+ </div>
26
+ </template>
27
+
28
+ <style lang="scss">
29
+ @use './card-toggle-switches.scss';
30
+ </style>
@@ -0,0 +1,14 @@
1
+ @use '../../base/abstracts' as a;
2
+
3
+ .collapsible {
4
+ .collapsible__heading {
5
+ line-height: 1;
6
+ color: inherit;
7
+ }
8
+
9
+ .collapsible__header {
10
+ text-align: left;
11
+ width: 100%;
12
+ cursor: pointer;
13
+ }
14
+ }
@@ -0,0 +1,81 @@
1
+ <script setup lang="ts">
2
+ import { useId, computed, ref, inject, watch } from 'vue'
3
+ import TransitionHeight from '../../helpers/transition-height.vue'
4
+
5
+ interface Props {
6
+ header?: string
7
+ panel?: string
8
+ level?: 2 | 3 | 4 | 5 | 6
9
+ expanded?: boolean
10
+ }
11
+
12
+ const cId = useId()
13
+ const { level = 3, expanded = false } = defineProps<Props>()
14
+
15
+ // Initial state
16
+ const panelHidden = ref(!expanded)
17
+
18
+ const headingTag = computed(() => `h${level}`)
19
+ const headerId = `collapsible-header-${cId}`
20
+ const panelId = `collapsible-panel-${cId}`
21
+
22
+ // This will only be available if there's a parent <UCollapsibelGroup>
23
+ const { activeItem, updateActiveItem } = inject('activeItem', {})
24
+
25
+ const onToggle = () => {
26
+ panelHidden.value = !panelHidden.value
27
+
28
+ if (updateActiveItem) {
29
+ updateActiveItem(cId)
30
+ }
31
+ }
32
+
33
+ if (activeItem) {
34
+ watch(activeItem, (newV) => {
35
+ if (newV !== cId) {
36
+ // Collapse component
37
+ panelHidden.value = true
38
+ }
39
+ })
40
+ }
41
+
42
+ defineExpose({
43
+ isExpanded: computed(() => !panelHidden.value),
44
+ })
45
+ </script>
46
+
47
+ <template>
48
+ <div class="collapsible">
49
+ <component :is="headingTag" class="collapsible__heading">
50
+ <button
51
+ :id="headerId"
52
+ :aria-controls="panelId"
53
+ class="collapsible__header"
54
+ type="button"
55
+ :aria-expanded="panelHidden ? 'false' : 'true'"
56
+ @click="onToggle"
57
+ >
58
+ <slot name="header">
59
+ {{ header }}
60
+ </slot>
61
+ </button>
62
+ </component>
63
+
64
+ <TransitionHeight>
65
+ <section
66
+ v-if="!panelHidden"
67
+ :id="panelId"
68
+ class="collapsible__panel"
69
+ :aria-labelledby="headerId"
70
+ >
71
+ <slot name="panel">
72
+ <div v-html="panel"></div>
73
+ </slot>
74
+ </section>
75
+ </TransitionHeight>
76
+ </div>
77
+ </template>
78
+
79
+ <style scoped lang="scss">
80
+ @use './collapsible.scss';
81
+ </style>
@@ -0,0 +1,14 @@
1
+ <script setup lang="ts">
2
+ import { ref, provide } from 'vue'
3
+
4
+ const activeItem = ref(null)
5
+ const updateActiveItem = (id: string): void => {
6
+ activeItem.value = id
7
+ }
8
+
9
+ provide('activeItem', { activeItem, updateActiveItem })
10
+ </script>
11
+
12
+ <template>
13
+ <slot></slot>
14
+ </template>
@@ -0,0 +1,58 @@
1
+ @use '../../base/abstracts/' as a;
2
+
3
+ .icon-tesaer__content {
4
+ display: flex;
5
+ flex-direction: column;
6
+ row-gap: var(--e-space-2);
7
+ }
8
+
9
+ .icon-teaser__image-wrapper {
10
+ margin: 0 auto var(--e-space-6);
11
+ display: flex;
12
+ align-items: center;
13
+ justify-content: center;
14
+ flex: 0 0 auto;
15
+ width: a.rem(120);
16
+ height: a.rem(120);
17
+ border-radius: 100%;
18
+ background-color: var(--e-c-primary-01-50);
19
+
20
+ @include a.bp(m) {
21
+ margin-bottom: var(--e-space-4);
22
+ width: a.rem(96);
23
+ height: a.rem(96);
24
+ }
25
+
26
+ img {
27
+ width: a.rem(56);
28
+ height: a.rem(56);
29
+
30
+ @include a.bp(m) {
31
+ width: a.rem(38);
32
+ height: a.rem(38);
33
+ }
34
+ }
35
+ }
36
+
37
+ .icon-teaser__title {
38
+ @include a.type(400, strong);
39
+
40
+ text-align: center;
41
+
42
+ @include a.bp(m) {
43
+ @include a.type(300, strong);
44
+ }
45
+ }
46
+
47
+ .icon-teaser__description {
48
+ @include a.type(200);
49
+
50
+ margin-top: var(--e-space-3);
51
+ text-align: center;
52
+
53
+ @include a.bp(m) {
54
+ margin-top: var(--e-space-1);
55
+
56
+ @include a.type(100);
57
+ }
58
+ }
@@ -0,0 +1,35 @@
1
+ <script setup lang="ts">
2
+ import { Image } from '../../elements/types.ts'
3
+
4
+ export interface IconTeaser {
5
+ title?: string
6
+ description?: string
7
+ image?: Image
8
+ }
9
+
10
+ defineProps<IconTeaser>()
11
+ </script>
12
+
13
+ <template>
14
+ <div class="icon-teaser">
15
+ <div class="icon-teaser__image-wrapper">
16
+ <slot name="image">
17
+ <img aria-hidden="true" :src="image?.src" :alt="image?.alt" />
18
+ </slot>
19
+ </div>
20
+
21
+ <div class="icon-teaser__content">
22
+ <h2 class="icon-teaser__title">
23
+ <slot name="title">{{ title }}</slot>
24
+ </h2>
25
+
26
+ <p class="icon-teaser__description">
27
+ <slot name="description">{{ description }}</slot>
28
+ </p>
29
+ </div>
30
+ </div>
31
+ </template>
32
+
33
+ <style lang="scss">
34
+ @use './icon-teaser.scss';
35
+ </style>
@@ -0,0 +1,10 @@
1
+ @use '../../base/abstracts/' as a;
2
+
3
+ .icon-teaser-group {
4
+ display: flex;
5
+ gap: var(--e-space-10);
6
+
7
+ @include a.bp(lg) {
8
+ flex-direction: column;
9
+ }
10
+ }
@@ -0,0 +1,19 @@
1
+ <script setup lang="ts">
2
+ import UIconTeaser, { IconTeaser } from '../icon-teaser/u-icon-teaser.vue'
3
+
4
+ interface Props {
5
+ items?: IconTeaser[]
6
+ }
7
+
8
+ defineProps<Props>()
9
+ </script>
10
+
11
+ <template>
12
+ <div class="icon-teaser-group">
13
+ <slot><UIconTeaser v-for="(item, idx) in items" :key="idx" v-bind="item"></UIconTeaser></slot>
14
+ </div>
15
+ </template>
16
+
17
+ <style lang="scss">
18
+ @use './icon-teaser-group.scss';
19
+ </style>
@@ -1,10 +1,10 @@
1
1
  <script setup lang="ts">
2
- import { ImageBase } from '../../elements/image/u-image.vue'
2
+ import { Image } from '../../elements/types.ts'
3
3
 
4
4
  interface Props {
5
5
  title: string
6
6
  description?: string
7
- image: ImageBase
7
+ image: Image
8
8
  }
9
9
 
10
10
  defineProps<Props>()
@@ -13,12 +13,7 @@ defineProps<Props>()
13
13
  <template>
14
14
  <div class="icon-text-block">
15
15
  <div class="illu-wrapper">
16
- <img
17
- class="illustration"
18
- aria-hidden="true"
19
- :src="image.src"
20
- :alt="image.alt"
21
- />
16
+ <img class="illustration" aria-hidden="true" :src="image.src" :alt="image.alt" />
22
17
  </div>
23
18
  <div class="content">
24
19
  <h2 class="title">{{ title }}</h2>
@@ -0,0 +1,32 @@
1
+ @use '../../base/abstracts/' as a;
2
+ @use '../../elements/text-link/text-link.scss' as t;
3
+
4
+ .language-nav {
5
+ @include a.type(100, weak);
6
+
7
+ display: flex;
8
+ grid-gap: var(--e-space-4);
9
+
10
+ .language-nav__active-lang,
11
+ > p {
12
+ color: var(--e-c-primary-01-900);
13
+ }
14
+
15
+ .language-nav__link,
16
+ > a {
17
+ text-decoration: none;
18
+ color: var(--e-c-mono-700);
19
+
20
+ &:hover {
21
+ color: var(--e-c-secondary-01-900);
22
+ }
23
+
24
+ &:active {
25
+ color: var(--e-c-primary-01-700);
26
+ }
27
+ }
28
+
29
+ @include a.bp(lg) {
30
+ @include a.type(50);
31
+ }
32
+ }
@@ -0,0 +1,27 @@
1
+ <script setup lang="ts">
2
+ interface LanguageSwitch {
3
+ href: string
4
+ hreflang: string
5
+ label: string
6
+ isActive?: boolean
7
+ }
8
+
9
+ interface Props {
10
+ links: LanguageSwitch[]
11
+ }
12
+
13
+ defineProps<Props>()
14
+ </script>
15
+
16
+ <template>
17
+ <nav class="language-nav">
18
+ <template v-for="(link, idx) in links" :key="idx">
19
+ <p v-if="link.isActive">{{ link.label }}</p>
20
+ <a v-else :href="link.href" :hreflang="link.hreflang">{{ link.label }}</a>
21
+ </template>
22
+ </nav>
23
+ </template>
24
+
25
+ <style lang="scss">
26
+ @use './language-nav.scss';
27
+ </style>
@@ -1,16 +1,33 @@
1
1
  @use '../../base/abstracts' as a;
2
2
 
3
- .panel{
3
+ .panel {
4
4
  position: relative;
5
- padding: var(--e-space-14) a.rem(400) a.rem(88) var(--e-space-14);
5
+ padding: var(--e-space-14) a.rem(400) var(--e-space-14) var(--e-space-14);
6
6
  box-shadow: var(--e-elevation-md);
7
7
  background-color: var(--e-c-mono-00);
8
8
  border-radius: var(--e-brd-radius-3);
9
9
  border: 1px solid var(--e-c-mono-200);
10
10
  overflow: hidden;
11
+ align-items: center;
12
+ display: flex;
13
+ column-gap: a.rem(40);
14
+
15
+ &.has-image {
16
+ padding: var(--e-space-14);
17
+
18
+ @include a.bp('2xl') {
19
+ padding: var(--e-space-10);
20
+ }
21
+
22
+ @include a.bp(m) {
23
+ padding: var(--e-space-6);
24
+ flex-direction: column;
25
+ row-gap: var(--e-space-6);
26
+ }
27
+ }
11
28
 
12
29
  @include a.bp('2xl') {
13
- padding: var(--e-space-10) a.rem(344) a.rem(72) var(--e-space-10);
30
+ padding: var(--e-space-10) a.rem(344) var(--e-space-10) var(--e-space-10);
14
31
  }
15
32
 
16
33
  @include a.bp('lg') {
@@ -18,7 +35,11 @@
18
35
  }
19
36
  }
20
37
 
21
- .title {
38
+ .panel__content {
39
+ order: 1;
40
+ }
41
+
42
+ .panel__title {
22
43
  margin-bottom: var(--e-space-3);
23
44
 
24
45
  h2 {
@@ -34,7 +55,7 @@
34
55
  }
35
56
  }
36
57
 
37
- .text {
58
+ .panel__text {
38
59
  @include a.type(300);
39
60
 
40
61
  @include a.bp(lg) {
@@ -42,7 +63,7 @@
42
63
  }
43
64
  }
44
65
 
45
- .panel-spectro {
66
+ .panel__spectro {
46
67
  pointer-events: none;
47
68
  position: absolute;
48
69
  top: calc(50% - 700px);
@@ -68,3 +89,19 @@
68
89
  right: calc(50% - 300px);
69
90
  }
70
91
  }
92
+
93
+ .panel__image {
94
+ flex: 0 0 a.rem(360);
95
+ width: a.rem(360);
96
+ order: 2;
97
+
98
+ @include a.bp('2xl') {
99
+ flex: 0 0 a.rem(315);
100
+ width: a.rem(315);
101
+ }
102
+
103
+ @include a.bp(m) {
104
+ flex: 1 0 auto;
105
+ width: auto;
106
+ }
107
+ }
@@ -1,31 +1,42 @@
1
1
  <script setup lang="ts">
2
- import USpectro from "../../elements/spectro/u-spectro.vue";
3
- import {Image} from "../../elements/types";
2
+ import USpectro from '../../elements/spectro/u-spectro.vue'
3
+ import { Image } from '../../elements/types'
4
+ import { computed, useSlots } from 'vue'
4
5
 
5
6
  interface Props {
6
7
  title?: string
7
8
  text?: string
8
- useSpectro?: boolean,
9
+ useSpectro?: boolean
9
10
  image?: Image
10
11
  }
11
12
 
12
- defineProps<Props>()
13
+ const { image = null } = defineProps<Props>()
14
+
15
+ const slots = useSlots()
16
+
17
+ const hasImage = computed(() => !!image || slots.image)
13
18
  </script>
14
19
 
15
20
  <template>
16
- <aside class="panel">
17
- <div v-if="useSpectro" class="panel-spectro">
18
- <USpectro/>
21
+ <aside :class="['panel', { 'has-image': hasImage }]">
22
+ <div v-if="useSpectro && !hasImage" class="panel__spectro">
23
+ <USpectro />
24
+ </div>
25
+
26
+ <div v-if="image" class="panel__image">
27
+ <slot name="image">
28
+ <img :src="image.src" :alt="image.alt" />
29
+ </slot>
19
30
  </div>
20
31
 
21
- <div class="content">
22
- <div class="title">
32
+ <div class="panel__content">
33
+ <div class="panel__title">
23
34
  <h2>
24
- <slot name="title">{{title}}</slot>
35
+ <slot name="title">{{ title }}</slot>
25
36
  </h2>
26
37
  </div>
27
38
 
28
- <div class="text">
39
+ <div class="panel__text">
29
40
  <slot name="text"><div v-html="text"></div></slot>
30
41
  </div>
31
42
  </div>
@@ -12,7 +12,7 @@ const { fullWidth = false } = defineProps<Props>()
12
12
  <div class="progress-track">
13
13
  <div class="progress-position" :style="{ width: `${value}%` }"></div>
14
14
  </div>
15
- <div class="star-icon" v-if="value >= 100"></div>
15
+ <div v-if="value >= 100" class="star-icon"></div>
16
16
  </div>
17
17
  </template>
18
18