@cooperco/cooper-component-library 0.0.10 → 0.1.1

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 (181) hide show
  1. package/dist/component-lib.js +6960 -0
  2. package/dist/component-lib.umd.cjs +98 -0
  3. package/dist/style.css +1 -0
  4. package/dist/vite.svg +16 -0
  5. package/package.json +93 -84
  6. package/src/assets/fonts/GT-Walsheim-Bold.woff +0 -0
  7. package/src/assets/fonts/GT-Walsheim-Bold.woff2 +0 -0
  8. package/src/assets/fonts/GT-Walsheim-LC-Bold.woff +0 -0
  9. package/src/assets/fonts/GT-Walsheim-LC-Bold.woff2 +0 -0
  10. package/src/assets/fonts/GT-Walsheim-LC-Regular.woff +0 -0
  11. package/src/assets/fonts/GT-Walsheim-LC-Regular.woff2 +0 -0
  12. package/src/assets/fonts/GT-Walsheim-Medium.woff +0 -0
  13. package/src/assets/fonts/GT-Walsheim-Medium.woff2 +0 -0
  14. package/src/assets/fonts/GT-Walsheim-Regular.woff +0 -0
  15. package/src/assets/fonts/GT-Walsheim-Regular.woff2 +0 -0
  16. package/src/assets/fonts/fonts.scss +60 -0
  17. package/src/assets/fonts/notosanssc-bold-webfont.woff +0 -0
  18. package/src/assets/fonts/notosanssc-bold-webfont.woff2 +0 -0
  19. package/src/assets/fonts/notosanssc-regular-webfont.woff +0 -0
  20. package/src/assets/fonts/notosanssc-regular-webfont.woff2 +0 -0
  21. package/src/assets/main.css +18 -114
  22. package/src/assets/theme.css +5 -1
  23. package/src/components/{types → Accordion}/Accordion.ts +8 -6
  24. package/src/components/Accordion/Accordion.vue +66 -0
  25. package/src/components/Accordion/AccordionItem.ts +25 -0
  26. package/src/components/Accordion/AccordionItem.vue +104 -0
  27. package/src/components/{AccordionItem.vue → Accordion/AccordionListItem.vue} +22 -14
  28. package/src/components/Accordion/AccordionTileItem.vue +75 -0
  29. package/src/components/CTA/CTA.ts +22 -0
  30. package/src/components/CTA/CTA.vue +65 -0
  31. package/src/components/CarouselModule/CarouselModule.ts +20 -0
  32. package/src/components/{CarouselModule.vue → CarouselModule/CarouselModule.vue} +25 -7
  33. package/src/components/ContainerCollectionModule/ContainerCollectionModule.ts +12 -0
  34. package/src/components/{ContainerCollectionModule.vue → ContainerCollectionModule/ContainerCollectionModule.vue} +12 -3
  35. package/src/components/ContainerModule/ContainerModule.ts +69 -0
  36. package/src/components/{ContainerModule.vue → ContainerModule/ContainerModule.vue} +33 -36
  37. package/src/components/ContentModule/ContentModule.ts +31 -0
  38. package/src/components/ContentModule/ContentModule.vue +65 -0
  39. package/src/components/{types → FooterNavigation}/FooterNavigation.ts +3 -2
  40. package/src/components/{FooterNavigation.vue → FooterNavigation/FooterNavigation.vue} +4 -2
  41. package/src/components/Image/Image.vue +17 -0
  42. package/src/components/{types → LogoCollectionModule}/LogoCollectionModule.ts +3 -3
  43. package/src/components/{LogoCollectionModule.vue → LogoCollectionModule/LogoCollectionModule.vue} +13 -3
  44. package/src/components/{types → NavigationElement}/NavigationElement.ts +6 -3
  45. package/src/components/{NavigationElement.vue → NavigationElement/NavigationElement.vue} +18 -9
  46. package/src/components/{types → PrimaryNavigation}/PrimaryNavigation.ts +2 -2
  47. package/src/components/{PrimaryNavigation.vue → PrimaryNavigation/PrimaryNavigation.vue} +7 -4
  48. package/src/components/{types → SplitModule}/SplitModule.ts +6 -5
  49. package/src/components/SplitModule/SplitModule.vue +57 -0
  50. package/src/components/TestimonialModule/TestimonialModule.ts +22 -0
  51. package/src/components/TestimonialModule/TestimonialModule.vue +51 -0
  52. package/src/components/TileCollectionModule/TileCollectionModule.ts +18 -0
  53. package/src/components/TileCollectionModule/TileCollectionModule.vue +58 -0
  54. package/src/components/TileContent/TileContent.ts +60 -0
  55. package/src/components/{TileContent.vue → TileContent/TileContent.vue} +25 -14
  56. package/src/components/TileContent/TileContentIconTile.vue +83 -0
  57. package/src/components/TileContent/TileContentImageStackedAnimatedTile.vue +121 -0
  58. package/src/components/TileContent/TileContentImageTile.vue +80 -0
  59. package/src/components/TileContent/TileContentTextTile.vue +63 -0
  60. package/src/components/TileContent/TileContentVideoTile.vue +81 -0
  61. package/src/components/{types → Video}/Video.ts +1 -1
  62. package/src/components/{Video.vue → Video/Video.vue} +1 -1
  63. package/src/config/defaultPassthrough.ts +261 -0
  64. package/src/assets/usercard.jpg +0 -0
  65. package/src/assets/vue.svg +0 -1
  66. package/src/components/Accordion.vue +0 -33
  67. package/src/components/CTA.vue +0 -39
  68. package/src/components/ContentAndImage.vue +0 -34
  69. package/src/components/ContentMediaModule.vue +0 -50
  70. package/src/components/ContentModule.vue +0 -51
  71. package/src/components/IconChevron.vue +0 -107
  72. package/src/components/Image.vue +0 -15
  73. package/src/components/LogoContainerModule.vue +0 -30
  74. package/src/components/SplitModule.vue +0 -42
  75. package/src/components/Testimonial.vue +0 -48
  76. package/src/components/TestimonialModule.vue +0 -48
  77. package/src/components/TileCollection.vue +0 -37
  78. package/src/components/TileCollectionModule.vue +0 -45
  79. package/src/components/types/AccordionItem.ts +0 -19
  80. package/src/components/types/CTA.ts +0 -13
  81. package/src/components/types/CarouselModule.ts +0 -21
  82. package/src/components/types/ContainerCollectionModule.ts +0 -12
  83. package/src/components/types/ContainerModule.ts +0 -35
  84. package/src/components/types/ContentAndImage.ts +0 -14
  85. package/src/components/types/ContentMediaModule.ts +0 -14
  86. package/src/components/types/ContentModule.ts +0 -21
  87. package/src/components/types/LogoContainerModule.ts +0 -12
  88. package/src/components/types/Testimonial.ts +0 -17
  89. package/src/components/types/TileCollection.ts +0 -14
  90. package/src/components/types/TileContent.ts +0 -34
  91. package/src/components/types/index.ts +0 -10
  92. package/src/presets/aura/accordion/index.js +0 -81
  93. package/src/presets/aura/autocomplete/index.js +0 -280
  94. package/src/presets/aura/avatar/index.js +0 -46
  95. package/src/presets/aura/badge/index.js +0 -43
  96. package/src/presets/aura/badgedirective/index.js +0 -49
  97. package/src/presets/aura/blockui/index.js +0 -8
  98. package/src/presets/aura/breadcrumb/index.js +0 -63
  99. package/src/presets/aura/button/index.js +0 -511
  100. package/src/presets/aura/calendar/index.js +0 -702
  101. package/src/presets/aura/card/index.js +0 -53
  102. package/src/presets/aura/carousel/index.js +0 -160
  103. package/src/presets/aura/cascadeselect/index.js +0 -220
  104. package/src/presets/aura/checkbox/index.js +0 -107
  105. package/src/presets/aura/chip/index.js +0 -45
  106. package/src/presets/aura/chips/index.js +0 -126
  107. package/src/presets/aura/colorpicker/index.js +0 -132
  108. package/src/presets/aura/confirmpopup/index.js +0 -111
  109. package/src/presets/aura/contextmenu/index.js +0 -132
  110. package/src/presets/aura/datatable/index.js +0 -1290
  111. package/src/presets/aura/dataview/index.js +0 -40
  112. package/src/presets/aura/deferred/index.js +0 -3
  113. package/src/presets/aura/dialog/index.js +0 -250
  114. package/src/presets/aura/divider/index.js +0 -72
  115. package/src/presets/aura/dock/index.js +0 -97
  116. package/src/presets/aura/dropdown/index.js +0 -297
  117. package/src/presets/aura/fieldset/index.js +0 -95
  118. package/src/presets/aura/fileupload/index.js +0 -175
  119. package/src/presets/aura/floatlabel/index.js +0 -26
  120. package/src/presets/aura/galleria/index.js +0 -353
  121. package/src/presets/aura/global.js +0 -90
  122. package/src/presets/aura/iconfield/index.js +0 -22
  123. package/src/presets/aura/image/index.js +0 -206
  124. package/src/presets/aura/index.js +0 -181
  125. package/src/presets/aura/inlinemessage/index.js +0 -46
  126. package/src/presets/aura/inplace/index.js +0 -27
  127. package/src/presets/aura/inputgroup/index.js +0 -5
  128. package/src/presets/aura/inputgroupaddon/index.js +0 -28
  129. package/src/presets/aura/inputmask/index.js +0 -47
  130. package/src/presets/aura/inputnumber/index.js +0 -293
  131. package/src/presets/aura/inputotp/index.js +0 -69
  132. package/src/presets/aura/inputswitch/index.js +0 -94
  133. package/src/presets/aura/inputtext/index.js +0 -63
  134. package/src/presets/aura/knob/index.js +0 -47
  135. package/src/presets/aura/listbox/index.js +0 -158
  136. package/src/presets/aura/megamenu/index.js +0 -206
  137. package/src/presets/aura/menu/index.js +0 -122
  138. package/src/presets/aura/menubar/index.js +0 -184
  139. package/src/presets/aura/message/index.js +0 -112
  140. package/src/presets/aura/metergroup/index.js +0 -110
  141. package/src/presets/aura/multiselect/index.js +0 -579
  142. package/src/presets/aura/orderlist/index.js +0 -281
  143. package/src/presets/aura/organizationchart/index.js +0 -142
  144. package/src/presets/aura/overlaypanel/index.js +0 -34
  145. package/src/presets/aura/paginator/index.js +0 -566
  146. package/src/presets/aura/panel/index.js +0 -102
  147. package/src/presets/aura/panelmenu/index.js +0 -130
  148. package/src/presets/aura/password/index.js +0 -143
  149. package/src/presets/aura/picklist/index.js +0 -718
  150. package/src/presets/aura/progressbar/index.js +0 -64
  151. package/src/presets/aura/progressspinner/index.js +0 -51
  152. package/src/presets/aura/radiobutton/index.js +0 -121
  153. package/src/presets/aura/rating/index.js +0 -95
  154. package/src/presets/aura/ripple/index.js +0 -6
  155. package/src/presets/aura/scrollpanel/index.js +0 -77
  156. package/src/presets/aura/scrolltop/index.js +0 -45
  157. package/src/presets/aura/selectbutton/index.js +0 -66
  158. package/src/presets/aura/sidebar/index.js +0 -160
  159. package/src/presets/aura/skeleton/index.js +0 -19
  160. package/src/presets/aura/slider/index.js +0 -144
  161. package/src/presets/aura/speeddial/index.js +0 -579
  162. package/src/presets/aura/splitbutton/index.js +0 -1185
  163. package/src/presets/aura/splitter/index.js +0 -71
  164. package/src/presets/aura/stepper/index.js +0 -183
  165. package/src/presets/aura/steps/index.js +0 -117
  166. package/src/presets/aura/tabmenu/index.js +0 -75
  167. package/src/presets/aura/tabview/index.js +0 -162
  168. package/src/presets/aura/tag/index.js +0 -44
  169. package/src/presets/aura/terminal/index.js +0 -60
  170. package/src/presets/aura/textarea/index.js +0 -49
  171. package/src/presets/aura/tieredmenu/index.js +0 -125
  172. package/src/presets/aura/timeline/index.js +0 -114
  173. package/src/presets/aura/toast/index.js +0 -151
  174. package/src/presets/aura/togglebutton/index.js +0 -98
  175. package/src/presets/aura/toolbar/index.js +0 -28
  176. package/src/presets/aura/tooltip/index.js +0 -73
  177. package/src/presets/aura/tree/index.js +0 -294
  178. package/src/presets/aura/treeselect/index.js +0 -404
  179. package/src/presets/aura/treetable/index.js +0 -513
  180. package/src/presets/aura/tristatecheckbox/index.js +0 -121
  181. /package/src/components/{types → Image}/Image.ts +0 -0
@@ -1,14 +1,24 @@
1
1
  <script setup lang="ts">
2
- import { type AccordionItem } from './types/AccordionItem'
2
+ import { type AccordionItem } from './AccordionItem'
3
3
  import { computed, ref } from 'vue'
4
+ import ImageComponent from '../Image/Image.vue'
5
+ import {
6
+ combinePassthroughs,
7
+ AccordionListItemPt,
8
+ } from '../../config/defaultPassthrough'
4
9
 
5
10
  const props = defineProps<AccordionItem>()
11
+ const pt = computed(() =>
12
+ combinePassthroughs(AccordionListItemPt, props.pt ?? {})
13
+ )
14
+
6
15
  const showDescription = ref(false)
7
16
  </script>
8
17
 
9
18
  <template>
10
19
  <div
11
20
  :class="{
21
+ [`${pt?.root ?? ''}`]: true,
12
22
  [`accordion-item-${itemNumber}`]: true,
13
23
  active: showDescription,
14
24
  first: isFirst,
@@ -16,15 +26,14 @@ const showDescription = ref(false)
16
26
  }"
17
27
  class="accordion-item group"
18
28
  >
19
- <h3
20
- :class="`flex accordion-item-headline ${pt?.headline ?? ''}`"
29
+ <div
21
30
  :id="`accordion-collapse-headline-${itemNumber}`"
31
+ :class="`flex accordion-item-headline ${pt?.headline ?? ''}`"
22
32
  >
23
- <img
24
- v-if="imageIcon"
25
- :src="imageIcon.src"
26
- alt="imageIcon.alt"
27
- :class="` ${pt.imageIcon}`"
33
+ <ImageComponent
34
+ v-if="Image"
35
+ v-bind="Image"
36
+ :class="`${pt?.image ?? ''}`"
28
37
  />
29
38
  <button
30
39
  type="button"
@@ -35,13 +44,12 @@ const showDescription = ref(false)
35
44
  @click.prevent="showDescription = !showDescription"
36
45
  >
37
46
  <span>{{ title }}</span>
38
- <IconChevron
39
- :class="`accordion-icon ps-5 ${pt?.icon ?? ''}`"
40
- :orientation="showDescription ? 'up' : 'down'"
41
- :bold="true"
42
- />
47
+ <div :class="pt?.icon">
48
+ <i v-show="!showDescription" :class="`pi pi-chevron-down`"></i>
49
+ <i v-show="showDescription" :class="`pi pi-chevron-up`"></i>
50
+ </div>
43
51
  </button>
44
- </h3>
52
+ </div>
45
53
  <div
46
54
  :id="`accordion-collapse-body-${itemNumber}`"
47
55
  :class="`accordion-item-body ${!showDescription ? 'hidden' : 'active'} ${pt?.content ?? ''}`"
@@ -0,0 +1,75 @@
1
+ <script setup lang="ts">
2
+ import { type AccordionItem } from './AccordionItem'
3
+ import { computed } from 'vue'
4
+ import ImageComponent from '../Image/Image.vue'
5
+ import {
6
+ combinePassthroughs,
7
+ AccordionTileItemPt,
8
+ } from '../../config/defaultPassthrough'
9
+
10
+ const props = defineProps<AccordionItem>()
11
+ const pt = computed(() =>
12
+ combinePassthroughs(AccordionTileItemPt, props.pt ?? {})
13
+ )
14
+
15
+ const isExpanded = computed(() => {
16
+ return props.openAccordionIndex === props.itemNumber
17
+ })
18
+
19
+ const emit = defineEmits(['toggleAccordion'])
20
+
21
+ const toggleAccordion = (index: number) => {
22
+ emit('toggleAccordion', index)
23
+ }
24
+ </script>
25
+
26
+ <template>
27
+ <div
28
+ :class="{
29
+ [`accordion-item-${itemNumber}`]: true,
30
+ [pt?.root ?? '']: true,
31
+ active: isExpanded,
32
+ first: isFirst,
33
+ last: isLast,
34
+ }"
35
+ class="accordion-item group"
36
+ >
37
+ <div
38
+ :id="`accordion-collapse-headline-${itemNumber}`"
39
+ :class="`flex accordion-item-headline ${pt?.headline ?? ''}`"
40
+ >
41
+ <ImageComponent
42
+ v-if="Image"
43
+ v-bind="Image"
44
+ :class="`${pt?.image ?? ''}`"
45
+ />
46
+ <button
47
+ type="button"
48
+ :class="`flex items-center w-full ${pt?.button ?? ''}`"
49
+ data-accordion-target="#accordion-collapse-body-1"
50
+ aria-expanded="true"
51
+ :aria-controls="`accordion-collapse-body-${itemNumber}`"
52
+ @click.prevent="toggleAccordion(itemNumber as number)"
53
+ >
54
+ <span>{{ title }}</span>
55
+ <div :class="pt?.icon">
56
+ <i
57
+ v-show="openAccordionIndex !== itemNumber"
58
+ :class="`pi pi-plus-circle`"
59
+ ></i>
60
+ <i
61
+ v-show="openAccordionIndex === itemNumber"
62
+ :class="`pi pi-times-circle`"
63
+ ></i>
64
+ </div>
65
+ </button>
66
+ </div>
67
+ <div
68
+ :id="`accordion-collapse-body-${itemNumber}`"
69
+ :class="`accordion-item-body ${!isExpanded ? 'hidden' : 'active'} ${pt?.content ?? ''}`"
70
+ :aria-labelledby="`accordion-collapse-heading-${itemNumber}`"
71
+ >
72
+ {{ content }}
73
+ </div>
74
+ </div>
75
+ </template>
@@ -0,0 +1,22 @@
1
+ import { URLRef } from '../../types'
2
+ import { Image } from '../Image/Image'
3
+
4
+ export interface CTAPassthrough {
5
+ logo?: string
6
+ title?: string
7
+ }
8
+
9
+ export interface CTA {
10
+ __typename?: 'CTA'
11
+ title: string
12
+ url: URLRef
13
+ color: string
14
+ textColor: string
15
+ buttonType: 'fill' | 'outline' | 'link' | 'logo'
16
+ Logo?: Image | string // could be a css class for an icon
17
+ pt?: CTAPassthrough
18
+ ariaLabel: string
19
+ anchor?: string
20
+ target?: string
21
+ class?: string
22
+ }
@@ -0,0 +1,65 @@
1
+ <script setup lang="ts">
2
+ import { CTA } from './CTA'
3
+ import { CTAOptions } from '../../types'
4
+ import Button from 'primevue/button'
5
+ import { computed } from 'vue'
6
+ import { twMerge } from 'tailwind-merge'
7
+ import { combinePassthroughs, CTAPt } from '../../config/defaultPassthrough'
8
+
9
+ const props = defineProps<CTA>()
10
+
11
+ const pt = computed(() =>
12
+ combinePassthroughs(CTAPt[props.buttonType], props.pt ?? {})
13
+ )
14
+
15
+ const buttonTypeValue = computed(() => {
16
+ return CTAOptions[props?.buttonType]
17
+ })
18
+
19
+ const isLink = computed(() => {
20
+ return props.buttonType === 'link' || props.buttonType === 'logo'
21
+ })
22
+
23
+ const fullClassname = computed(
24
+ () =>
25
+ `cta ${props.class ?? ''} ${props.buttonType === 'link' || props.buttonType === 'logo' ? 'hover:underline' : ''} flex items-center gap-4`
26
+ )
27
+
28
+ const computedStyle = computed(() => {
29
+ return {
30
+ color: props.textColor,
31
+ 'background-color':
32
+ buttonTypeValue.value == CTAOptions.fill ? props.color : 'transparent',
33
+ 'border-color':
34
+ buttonTypeValue.value != CTAOptions.link &&
35
+ buttonTypeValue.value != CTAOptions.logo
36
+ ? props.color
37
+ : 'transparent',
38
+ }
39
+ })
40
+
41
+ // Update to support url vs page
42
+ const url = computed(() => {
43
+ return props?.url?.link
44
+ })
45
+ </script>
46
+
47
+ <template>
48
+ <Button
49
+ :class="fullClassname"
50
+ :style="computedStyle"
51
+ :aria-label="ariaLabel"
52
+ :link="isLink"
53
+ :href="url"
54
+ >
55
+ <div v-if="Logo" :class="pt?.logo ?? ''">
56
+ <template v-if="typeof Logo !== 'string' && Logo?.__typename">
57
+ <Image v-bind="Logo" />
58
+ </template>
59
+ <template v-else-if="typeof Logo === 'string'">
60
+ <div :class="twMerge(Logo, pt?.logo)"></div>
61
+ </template>
62
+ </div>
63
+ <p :class="twMerge('pointer-events-none', pt?.title ?? '')">{{ title }}</p>
64
+ </Button>
65
+ </template>
@@ -0,0 +1,20 @@
1
+ import { ComponentPassthrough } from '../../types'
2
+ import { ContainerModule } from '../ContainerModule/ContainerModule'
3
+ import { TestimonialModule } from '../TestimonialModule/TestimonialModule'
4
+ import { TileContent } from '../TileContent/TileContent'
5
+
6
+ export interface CarouselPassthrough extends ComponentPassthrough {
7
+ item?: string
8
+ }
9
+
10
+ // Carousel
11
+ export interface Carousel {
12
+ __typename?: 'CarouselModule'
13
+ headline: string
14
+ modules: (TestimonialModule | TileContent | ContainerModule)[]
15
+ textColor?: string
16
+ backgroundColor?: string
17
+ backgroundImage?: string
18
+ pt?: CarouselPassthrough
19
+ variant?: 'Hero' | 'Default'
20
+ }
@@ -1,8 +1,12 @@
1
1
  <script setup lang="ts">
2
- import { Carousel as CarouselType } from './types/CarouselModule'
2
+ import { Carousel as CarouselType } from './CarouselModule'
3
3
  import Carousel from 'primevue/carousel'
4
4
  import { computed } from 'vue'
5
- // import { getComponent } from '../utils/getComponent'
5
+ import {
6
+ combinePassthroughs,
7
+ CarouselModulePt,
8
+ } from '../../config/defaultPassthrough'
9
+ import { twMerge } from 'tailwind-merge'
6
10
 
7
11
  // Still need to figure out how to configure where buttons go
8
12
  // as defaults do not match cordblood site.
@@ -11,6 +15,8 @@ const props = withDefaults(defineProps<CarouselType>(), {
11
15
  variant: 'Default',
12
16
  })
13
17
 
18
+ const pt = computed(() => combinePassthroughs(CarouselModulePt, props.pt ?? {}))
19
+
14
20
  const computedStyle = computed(() => {
15
21
  return {
16
22
  'background-color': props.backgroundColor ?? 'transparent',
@@ -19,25 +25,37 @@ const computedStyle = computed(() => {
19
25
  color: props.textColor ?? 'inherit',
20
26
  }
21
27
  })
28
+ const computedClass = computed(
29
+ () =>
30
+ // TODO: Add description below or remove if classes fixed
31
+ // @ts-expect-error <add description>
32
+ `${twMerge('py-16 px-8', props.class)} ${props.variant.toLowerCase()} carousel`
33
+ )
22
34
  </script>
23
35
 
24
36
  <template>
25
37
  <Carousel
26
38
  :value="modules"
27
- :numVisible="1"
28
- :numScroll="1"
39
+ :num-visible="1"
40
+ :num-scroll="1"
29
41
  :style="computedStyle"
30
- :class="`carousel ${variant.toLowerCase()}`"
42
+ :class="computedClass"
31
43
  :pt:item:class="`carousel-item w-full ${pt?.item ?? ''}`"
32
44
  >
33
45
  <template v-if="headline" #header>
34
46
  <h2 :class="`carousel-headline ${pt?.headline ?? ''}`">{{ headline }}</h2>
35
47
  </template>
36
- <template v-for="(item, index) in modules" #item="slotProps">
48
+ <!-- eslint-disable -->
49
+ <!-- remove ^^ when valid-v-slot error is fixed -->
50
+ <template
51
+ v-for="(item, index) in modules"
52
+ :key="`${item?.__typename}-${index}`"
53
+ #item="slotProps"
54
+ >
37
55
  <component
38
56
  v-bind="slotProps.data"
39
57
  :is="slotProps.data.__typename"
40
- :isChild="true"
58
+ :is-child="true"
41
59
  />
42
60
  </template>
43
61
  <template #footer></template>
@@ -0,0 +1,12 @@
1
+ import { ComponentPassthrough } from '../../types'
2
+ import { ContainerModule } from '../ContainerModule/ContainerModule'
3
+ import { SplitModule } from '../SplitModule/SplitModule'
4
+
5
+ export interface ContainerCollectionModule {
6
+ __typename?: 'ContainerCollection'
7
+ entryTitle?: string
8
+ headline: string
9
+ modules: Array<ContainerModule | SplitModule>
10
+ backgroundColor?: string
11
+ pt?: ComponentPassthrough
12
+ }
@@ -1,9 +1,17 @@
1
1
  <script setup lang="ts">
2
2
  import { computed } from 'vue'
3
- import { ContainerCollectionModule } from './types/ContainerCollectionModule'
3
+ import { ContainerCollectionModule } from './ContainerCollectionModule'
4
+ import {
5
+ combinePassthroughs,
6
+ ContainerCollectionModulePt,
7
+ } from '../../config/defaultPassthrough'
4
8
 
5
9
  const props = defineProps<ContainerCollectionModule>()
6
10
 
11
+ const pt = computed(() =>
12
+ combinePassthroughs(ContainerCollectionModulePt, props.pt ?? {})
13
+ )
14
+
7
15
  const computedStyle = computed(() => {
8
16
  return {
9
17
  'background-color': props.backgroundColor ?? 'transparent',
@@ -23,10 +31,11 @@ const computedStyle = computed(() => {
23
31
  :class="`container-collection-content mx-auto container ${pt?.content}`"
24
32
  >
25
33
  <component
26
- v-for="subModule in modules"
27
34
  :is="subModule.__typename"
35
+ v-for="(subModule, index) in modules"
28
36
  v-bind="subModule"
29
- :isChild="true"
37
+ :key="`${subModule?.__typename}-${index}`"
38
+ :is-child="true"
30
39
  />
31
40
  </div>
32
41
  </section>
@@ -0,0 +1,69 @@
1
+ import { Image } from '../Image/Image'
2
+ import { Video } from '../Video/Video'
3
+ import { Accordion } from '../Accordion/Accordion'
4
+ import { ContentModule } from '../ContentModule/ContentModule'
5
+ import { TestimonialModule } from '../TestimonialModule/TestimonialModule'
6
+ import { TileCollection } from '../TileCollectionModule/TileCollectionModule'
7
+ import {
8
+ TileContent,
9
+ TileContentIconTile,
10
+ TileContentImageStackedAnimatedTile,
11
+ TileContentImageTile,
12
+ TileContentTextTile,
13
+ TileContentVideoTile,
14
+ } from '../TileContent/TileContent'
15
+ import { ComponentPassthrough } from '../../types'
16
+
17
+ export interface ContainerModulePassthrough extends ComponentPassthrough {
18
+ inner?: string
19
+ fullWidthContent?: string
20
+ }
21
+ export interface ContainerModule {
22
+ __typename?: 'ContainerModule'
23
+ headline: string
24
+ subHeadline?: string
25
+ fullWidthContent?:
26
+ | Image
27
+ | Video
28
+ | ContentModule
29
+ | ContainerModule
30
+ | TileCollection
31
+ | TileContent
32
+ | TileContentImageStackedAnimatedTile
33
+ | TileContentIconTile
34
+ | TileContentTextTile
35
+ | TileContentImageTile
36
+ | TileContentVideoTile
37
+ | Accordion
38
+ start?:
39
+ | Image
40
+ | Video
41
+ | ContentModule
42
+ | TileContent
43
+ | TileContentImageStackedAnimatedTile
44
+ | TileContentIconTile
45
+ | TileContentTextTile
46
+ | TileContentImageTile
47
+ | TileContentVideoTile
48
+ | Accordion
49
+ | TestimonialModule
50
+ end?:
51
+ | Image
52
+ | Video
53
+ | ContentModule
54
+ | TileContent
55
+ | TileContentImageStackedAnimatedTile
56
+ | TileContentIconTile
57
+ | TileContentTextTile
58
+ | TileContentImageTile
59
+ | TileContentVideoTile
60
+ | Accordion
61
+ | TestimonialModule
62
+ textColor?: string
63
+ backgroundColor?: string
64
+ backgroundImage?: string
65
+ variant?: 'Centered' | 'Hero'
66
+ // types only used in code, based on placement from contentful
67
+ isChild?: boolean
68
+ pt?: ContainerModulePassthrough
69
+ }
@@ -1,13 +1,22 @@
1
1
  <script setup lang="ts">
2
- import { ContainerModule as ContainerModuleType } from './types/ContainerModule'
3
- import { VariantOptions, MediaOptions } from '../types'
2
+ import { ContainerModule as ContainerModuleType } from './ContainerModule'
3
+ import { VariantOptions } from '../../types'
4
4
  import { computed } from 'vue'
5
+ import { twMerge } from 'tailwind-merge'
6
+ import {
7
+ combinePassthroughs,
8
+ ContainerModulePt,
9
+ } from '../../config/defaultPassthrough'
5
10
 
6
11
  const props = withDefaults(defineProps<ContainerModuleType>(), {
7
12
  isChild: false,
8
13
  variant: 'Centered',
9
14
  })
10
15
 
16
+ const pt = computed(() =>
17
+ combinePassthroughs(ContainerModulePt[props.variant], props.pt ?? {})
18
+ )
19
+
11
20
  const isHero = computed(() => {
12
21
  return VariantOptions[props.variant] === VariantOptions.Hero
13
22
  })
@@ -16,25 +25,18 @@ const isCentered = computed(() => {
16
25
  return VariantOptions[props.variant] === VariantOptions.Centered
17
26
  })
18
27
 
19
- const mediaTypeLeftValue = computed(() => {
20
- if (!props?.start?.mediaType) {
21
- return null
22
- }
23
- return MediaOptions[props.start.mediaType]
24
- })
25
-
26
- const mediaTypeRightValue = computed(() => {
27
- if (!props?.end?.mediaType) {
28
- return null
29
- }
30
- return MediaOptions[props.end.mediaType]
28
+ const computedClass = computed(() => {
29
+ return twMerge(
30
+ `container-module relative ${pt.value?.root} ${isHero.value || props.isChild ? '' : 'py-16 px-8'}`,
31
+ // TODO: Add description below or remove if classes fixed
32
+ // @ts-expect-error <add description>
33
+ props.class ?? ''
34
+ )
31
35
  })
32
36
 
33
37
  const computedStyle = computed(() => {
34
38
  return {
35
39
  'background-color': props.backgroundColor ?? 'transparent',
36
- 'background-image': `url(${props.backgroundImage ?? ''})`,
37
- 'background-size': 'cover',
38
40
  color: props.textColor ?? 'inherit',
39
41
  }
40
42
  })
@@ -44,10 +46,15 @@ const computedStyle = computed(() => {
44
46
  <component
45
47
  :is="isChild ? 'div' : 'section'"
46
48
  :style="computedStyle"
47
- class="container-module"
49
+ :class="computedClass"
48
50
  >
51
+ <Image
52
+ v-if="backgroundImage"
53
+ :media="{ src: backgroundImage }"
54
+ class="md:absolute md:top-0 md:right-0 object-cover w-full h-full z-0"
55
+ />
49
56
  <div
50
- :class="`container-module-inner h-full ${isHero ? 'container' : ''} mx-auto ${pt?.inner ?? ''}`"
57
+ :class="`container-module-inner relative z-10 ${isHero ? 'container' : ''} ${pt?.inner ?? ''}`"
51
58
  >
52
59
  <h2
53
60
  v-if="headline"
@@ -64,48 +71,38 @@ const computedStyle = computed(() => {
64
71
  </p>
65
72
 
66
73
  <div
67
- :class="`container-module-content flex flex-row gap-5 h-full ${pt?.content ?? ''}`"
74
+ :class="`container-module-content flex flex-col-reverse md:flex-row gap-5 h-full ${pt?.content ?? ''}`"
68
75
  >
69
76
  <template v-if="fullWidthContent">
70
77
  <div
71
- :class="`container-module ${pt?.fullWidthContent ?? ''} ${isCentered ? 'mx-auto' : ''}`"
78
+ :class="`container-module-full-width-content ${pt?.fullWidthContent ?? ''} ${isCentered ? 'mx-auto' : ''}`"
72
79
  >
73
- <template v-if="fullWidthContent?.mediaType">
74
- <component :is="mediaTypeLeftValue" :="fullWidthContent" />
75
- </template>
76
- <template v-else-if="fullWidthContent.__typename">
80
+ <template v-if="fullWidthContent.__typename">
77
81
  <component
78
82
  v-bind="fullWidthContent"
79
83
  :is="fullWidthContent.__typename"
80
- :isChild="true"
84
+ :is-child="true"
81
85
  />
82
86
  </template>
83
87
  </div>
84
88
  </template>
85
-
86
89
  <template v-else>
87
90
  <div
88
91
  v-if="start"
89
92
  :class="`container-module-start basis-1/2 ${pt?.start ?? ''}`"
90
93
  >
91
- <template v-if="start?.mediaType">
92
- <component :is="mediaTypeLeftValue" :="start" />
93
- </template>
94
- <template v-else-if="start?.__typename">
94
+ <template v-if="start?.__typename">
95
95
  <component
96
96
  v-bind="start"
97
97
  :is="start.__typename"
98
- :isChild="true"
98
+ :is-child="true"
99
99
  />
100
100
  </template>
101
101
  </div>
102
102
 
103
103
  <div :class="`container-module-end basis-1/2 ${pt?.end ?? ''}`">
104
- <template v-if="end?.mediaType">
105
- <component :is="mediaTypeRightValue" :="end" />
106
- </template>
107
- <template v-else-if="end?.__typename">
108
- <component v-bind="end" :is="end.__typename" :isChild="true" />
104
+ <template v-if="end?.__typename">
105
+ <component v-bind="end" :is="end.__typename" :is-child="true" />
109
106
  </template>
110
107
  </div>
111
108
  </template>
@@ -0,0 +1,31 @@
1
+ import { ComponentPassthrough } from '../../types'
2
+ import { CTA } from '../CTA/CTA'
3
+ import { Image } from '../Image/Image'
4
+
5
+ export interface ContentModulePassthrough extends ComponentPassthrough {
6
+ container?: string
7
+ ctas?: string
8
+ logo?: string
9
+ subHeadline?: string
10
+ }
11
+
12
+ export enum ContentModuleAligmentEnum {
13
+ Left = 'left',
14
+ Center = 'center',
15
+ Right = 'right',
16
+ }
17
+
18
+ export interface ContentModule {
19
+ __typename?: 'ContentModule'
20
+ headline?: string
21
+ subHeadline?: string
22
+ description?: string
23
+ ctas?: CTA[]
24
+ textColor?: string
25
+ backgroundColor?: string
26
+ pt?: ContentModulePassthrough
27
+ logo?: Image
28
+ isHero?: boolean
29
+ alignment?: ContentModuleAligmentEnum
30
+ isChild?: boolean
31
+ }
@@ -0,0 +1,65 @@
1
+ <script setup lang="ts">
2
+ import { ContentModule, ContentModuleAligmentEnum } from './ContentModule'
3
+ import CTA from '../CTA/CTA.vue'
4
+ import { computed } from 'vue'
5
+ import {
6
+ combinePassthroughs,
7
+ ContentModulePt,
8
+ } from '../../config/defaultPassthrough'
9
+ import { twMerge } from 'tailwind-merge'
10
+
11
+ const props = withDefaults(defineProps<ContentModule>(), {
12
+ isHero: false,
13
+ alignment: ContentModuleAligmentEnum.Left,
14
+ })
15
+ const pt = computed(() => combinePassthroughs(ContentModulePt, props.pt ?? {}))
16
+
17
+ const computedStyle = computed(() => {
18
+ return {
19
+ 'background-color': props.backgroundColor ?? 'transparent',
20
+ color: props.textColor ?? 'inherit',
21
+ }
22
+ })
23
+ const computedAlignment = computed(() => `text-${props.alignment}`)
24
+ const logoClass = computed(
25
+ // TODO: Add description or remove when class error is fixed
26
+ // @ts-expect-error <add description>
27
+ () => `${pt.value?.logo ?? ''} ${props?.logo?.class}`
28
+ )
29
+ </script>
30
+
31
+ <template>
32
+ <div :class="`content-module ${pt?.root ?? ''}`" :style="computedStyle">
33
+ <div :class="`content-module-container mx-auto ${pt?.container ?? ''}`">
34
+ <Image v-if="logo" v-bind="logo" :class="logoClass" />
35
+ <h2
36
+ v-if="headline"
37
+ :class="`${headline && !subHeadline ? 'mb-4' : ''} ${twMerge(pt?.headline ?? '', computedAlignment)}`"
38
+ >
39
+ {{ headline }}
40
+ </h2>
41
+ <h2
42
+ v-if="subHeadline"
43
+ :class="`content-module-subheadline ${twMerge(pt?.subheadline ?? '', computedAlignment)}`"
44
+ >
45
+ {{ subHeadline }}
46
+ </h2>
47
+ <p
48
+ v-if="description"
49
+ :class="`content-module-description ${twMerge(pt?.description ?? '', computedAlignment)}`"
50
+ >
51
+ {{ description }}
52
+ </p>
53
+ <div
54
+ v-if="ctas"
55
+ :class="`content-module-ctas ${twMerge(pt?.ctas ?? '', computedAlignment)}`"
56
+ >
57
+ <CTA
58
+ v-for="(item, index) in ctas"
59
+ v-bind="item"
60
+ :key="`cta-${item.title}-${index}`"
61
+ />
62
+ </div>
63
+ </div>
64
+ </div>
65
+ </template>
@@ -1,5 +1,6 @@
1
- import { Image, socialMedia } from '../../types'
2
- import { NavigationElement } from './NavigationElement'
1
+ import { socialMedia } from '../../types'
2
+ import { Image } from '../Image/Image'
3
+ import { NavigationElement } from '../NavigationElement/NavigationElement'
3
4
 
4
5
  export interface FooterNavigation {
5
6
  title?: string