@cooperco/cooper-component-library 0.0.10 → 0.1.0

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 (178) hide show
  1. package/dist/component-lib.js +6947 -0
  2. package/dist/component-lib.umd.cjs +98 -0
  3. package/package.json +29 -20
  4. package/src/assets/fonts/GT-Walsheim-Bold.woff +0 -0
  5. package/src/assets/fonts/GT-Walsheim-Bold.woff2 +0 -0
  6. package/src/assets/fonts/GT-Walsheim-LC-Bold.woff +0 -0
  7. package/src/assets/fonts/GT-Walsheim-LC-Bold.woff2 +0 -0
  8. package/src/assets/fonts/GT-Walsheim-LC-Regular.woff +0 -0
  9. package/src/assets/fonts/GT-Walsheim-LC-Regular.woff2 +0 -0
  10. package/src/assets/fonts/GT-Walsheim-Medium.woff +0 -0
  11. package/src/assets/fonts/GT-Walsheim-Medium.woff2 +0 -0
  12. package/src/assets/fonts/GT-Walsheim-Regular.woff +0 -0
  13. package/src/assets/fonts/GT-Walsheim-Regular.woff2 +0 -0
  14. package/src/assets/fonts/fonts.scss +60 -0
  15. package/src/assets/fonts/notosanssc-bold-webfont.woff +0 -0
  16. package/src/assets/fonts/notosanssc-bold-webfont.woff2 +0 -0
  17. package/src/assets/fonts/notosanssc-regular-webfont.woff +0 -0
  18. package/src/assets/fonts/notosanssc-regular-webfont.woff2 +0 -0
  19. package/src/assets/main.css +18 -114
  20. package/src/assets/theme.css +5 -1
  21. package/src/components/{types → Accordion}/Accordion.ts +8 -6
  22. package/src/components/Accordion/Accordion.vue +66 -0
  23. package/src/components/Accordion/AccordionItem.ts +25 -0
  24. package/src/components/Accordion/AccordionItem.vue +104 -0
  25. package/src/components/{AccordionItem.vue → Accordion/AccordionListItem.vue} +22 -14
  26. package/src/components/Accordion/AccordionTileItem.vue +75 -0
  27. package/src/components/CTA/CTA.ts +22 -0
  28. package/src/components/CTA/CTA.vue +65 -0
  29. package/src/components/CarouselModule/CarouselModule.ts +20 -0
  30. package/src/components/{CarouselModule.vue → CarouselModule/CarouselModule.vue} +25 -7
  31. package/src/components/ContainerCollectionModule/ContainerCollectionModule.ts +12 -0
  32. package/src/components/{ContainerCollectionModule.vue → ContainerCollectionModule/ContainerCollectionModule.vue} +12 -3
  33. package/src/components/ContainerModule/ContainerModule.ts +69 -0
  34. package/src/components/{ContainerModule.vue → ContainerModule/ContainerModule.vue} +33 -36
  35. package/src/components/ContentModule/ContentModule.ts +31 -0
  36. package/src/components/ContentModule/ContentModule.vue +65 -0
  37. package/src/components/{types → FooterNavigation}/FooterNavigation.ts +3 -2
  38. package/src/components/{FooterNavigation.vue → FooterNavigation/FooterNavigation.vue} +4 -2
  39. package/src/components/Image/Image.vue +17 -0
  40. package/src/components/{types → LogoCollectionModule}/LogoCollectionModule.ts +3 -3
  41. package/src/components/{LogoCollectionModule.vue → LogoCollectionModule/LogoCollectionModule.vue} +13 -3
  42. package/src/components/{types → NavigationElement}/NavigationElement.ts +6 -3
  43. package/src/components/{NavigationElement.vue → NavigationElement/NavigationElement.vue} +18 -9
  44. package/src/components/{types → PrimaryNavigation}/PrimaryNavigation.ts +2 -2
  45. package/src/components/{PrimaryNavigation.vue → PrimaryNavigation/PrimaryNavigation.vue} +7 -4
  46. package/src/components/{types → SplitModule}/SplitModule.ts +6 -5
  47. package/src/components/SplitModule/SplitModule.vue +57 -0
  48. package/src/components/TestimonialModule/TestimonialModule.ts +22 -0
  49. package/src/components/TestimonialModule/TestimonialModule.vue +51 -0
  50. package/src/components/TileCollectionModule/TileCollectionModule.ts +18 -0
  51. package/src/components/TileCollectionModule/TileCollectionModule.vue +58 -0
  52. package/src/components/TileContent/TileContent.ts +60 -0
  53. package/src/components/{TileContent.vue → TileContent/TileContent.vue} +25 -14
  54. package/src/components/TileContent/TileContentIconTile.vue +83 -0
  55. package/src/components/TileContent/TileContentImageStackedAnimatedTile.vue +121 -0
  56. package/src/components/TileContent/TileContentImageTile.vue +80 -0
  57. package/src/components/TileContent/TileContentTextTile.vue +63 -0
  58. package/src/components/TileContent/TileContentVideoTile.vue +81 -0
  59. package/src/components/{types → Video}/Video.ts +1 -1
  60. package/src/components/{Video.vue → Video/Video.vue} +1 -1
  61. package/src/assets/usercard.jpg +0 -0
  62. package/src/assets/vue.svg +0 -1
  63. package/src/components/Accordion.vue +0 -33
  64. package/src/components/CTA.vue +0 -39
  65. package/src/components/ContentAndImage.vue +0 -34
  66. package/src/components/ContentMediaModule.vue +0 -50
  67. package/src/components/ContentModule.vue +0 -51
  68. package/src/components/IconChevron.vue +0 -107
  69. package/src/components/Image.vue +0 -15
  70. package/src/components/LogoContainerModule.vue +0 -30
  71. package/src/components/SplitModule.vue +0 -42
  72. package/src/components/Testimonial.vue +0 -48
  73. package/src/components/TestimonialModule.vue +0 -48
  74. package/src/components/TileCollection.vue +0 -37
  75. package/src/components/TileCollectionModule.vue +0 -45
  76. package/src/components/types/AccordionItem.ts +0 -19
  77. package/src/components/types/CTA.ts +0 -13
  78. package/src/components/types/CarouselModule.ts +0 -21
  79. package/src/components/types/ContainerCollectionModule.ts +0 -12
  80. package/src/components/types/ContainerModule.ts +0 -35
  81. package/src/components/types/ContentAndImage.ts +0 -14
  82. package/src/components/types/ContentMediaModule.ts +0 -14
  83. package/src/components/types/ContentModule.ts +0 -21
  84. package/src/components/types/LogoContainerModule.ts +0 -12
  85. package/src/components/types/Testimonial.ts +0 -17
  86. package/src/components/types/TileCollection.ts +0 -14
  87. package/src/components/types/TileContent.ts +0 -34
  88. package/src/components/types/index.ts +0 -10
  89. package/src/presets/aura/accordion/index.js +0 -81
  90. package/src/presets/aura/autocomplete/index.js +0 -280
  91. package/src/presets/aura/avatar/index.js +0 -46
  92. package/src/presets/aura/badge/index.js +0 -43
  93. package/src/presets/aura/badgedirective/index.js +0 -49
  94. package/src/presets/aura/blockui/index.js +0 -8
  95. package/src/presets/aura/breadcrumb/index.js +0 -63
  96. package/src/presets/aura/button/index.js +0 -511
  97. package/src/presets/aura/calendar/index.js +0 -702
  98. package/src/presets/aura/card/index.js +0 -53
  99. package/src/presets/aura/carousel/index.js +0 -160
  100. package/src/presets/aura/cascadeselect/index.js +0 -220
  101. package/src/presets/aura/checkbox/index.js +0 -107
  102. package/src/presets/aura/chip/index.js +0 -45
  103. package/src/presets/aura/chips/index.js +0 -126
  104. package/src/presets/aura/colorpicker/index.js +0 -132
  105. package/src/presets/aura/confirmpopup/index.js +0 -111
  106. package/src/presets/aura/contextmenu/index.js +0 -132
  107. package/src/presets/aura/datatable/index.js +0 -1290
  108. package/src/presets/aura/dataview/index.js +0 -40
  109. package/src/presets/aura/deferred/index.js +0 -3
  110. package/src/presets/aura/dialog/index.js +0 -250
  111. package/src/presets/aura/divider/index.js +0 -72
  112. package/src/presets/aura/dock/index.js +0 -97
  113. package/src/presets/aura/dropdown/index.js +0 -297
  114. package/src/presets/aura/fieldset/index.js +0 -95
  115. package/src/presets/aura/fileupload/index.js +0 -175
  116. package/src/presets/aura/floatlabel/index.js +0 -26
  117. package/src/presets/aura/galleria/index.js +0 -353
  118. package/src/presets/aura/global.js +0 -90
  119. package/src/presets/aura/iconfield/index.js +0 -22
  120. package/src/presets/aura/image/index.js +0 -206
  121. package/src/presets/aura/index.js +0 -181
  122. package/src/presets/aura/inlinemessage/index.js +0 -46
  123. package/src/presets/aura/inplace/index.js +0 -27
  124. package/src/presets/aura/inputgroup/index.js +0 -5
  125. package/src/presets/aura/inputgroupaddon/index.js +0 -28
  126. package/src/presets/aura/inputmask/index.js +0 -47
  127. package/src/presets/aura/inputnumber/index.js +0 -293
  128. package/src/presets/aura/inputotp/index.js +0 -69
  129. package/src/presets/aura/inputswitch/index.js +0 -94
  130. package/src/presets/aura/inputtext/index.js +0 -63
  131. package/src/presets/aura/knob/index.js +0 -47
  132. package/src/presets/aura/listbox/index.js +0 -158
  133. package/src/presets/aura/megamenu/index.js +0 -206
  134. package/src/presets/aura/menu/index.js +0 -122
  135. package/src/presets/aura/menubar/index.js +0 -184
  136. package/src/presets/aura/message/index.js +0 -112
  137. package/src/presets/aura/metergroup/index.js +0 -110
  138. package/src/presets/aura/multiselect/index.js +0 -579
  139. package/src/presets/aura/orderlist/index.js +0 -281
  140. package/src/presets/aura/organizationchart/index.js +0 -142
  141. package/src/presets/aura/overlaypanel/index.js +0 -34
  142. package/src/presets/aura/paginator/index.js +0 -566
  143. package/src/presets/aura/panel/index.js +0 -102
  144. package/src/presets/aura/panelmenu/index.js +0 -130
  145. package/src/presets/aura/password/index.js +0 -143
  146. package/src/presets/aura/picklist/index.js +0 -718
  147. package/src/presets/aura/progressbar/index.js +0 -64
  148. package/src/presets/aura/progressspinner/index.js +0 -51
  149. package/src/presets/aura/radiobutton/index.js +0 -121
  150. package/src/presets/aura/rating/index.js +0 -95
  151. package/src/presets/aura/ripple/index.js +0 -6
  152. package/src/presets/aura/scrollpanel/index.js +0 -77
  153. package/src/presets/aura/scrolltop/index.js +0 -45
  154. package/src/presets/aura/selectbutton/index.js +0 -66
  155. package/src/presets/aura/sidebar/index.js +0 -160
  156. package/src/presets/aura/skeleton/index.js +0 -19
  157. package/src/presets/aura/slider/index.js +0 -144
  158. package/src/presets/aura/speeddial/index.js +0 -579
  159. package/src/presets/aura/splitbutton/index.js +0 -1185
  160. package/src/presets/aura/splitter/index.js +0 -71
  161. package/src/presets/aura/stepper/index.js +0 -183
  162. package/src/presets/aura/steps/index.js +0 -117
  163. package/src/presets/aura/tabmenu/index.js +0 -75
  164. package/src/presets/aura/tabview/index.js +0 -162
  165. package/src/presets/aura/tag/index.js +0 -44
  166. package/src/presets/aura/terminal/index.js +0 -60
  167. package/src/presets/aura/textarea/index.js +0 -49
  168. package/src/presets/aura/tieredmenu/index.js +0 -125
  169. package/src/presets/aura/timeline/index.js +0 -114
  170. package/src/presets/aura/toast/index.js +0 -151
  171. package/src/presets/aura/togglebutton/index.js +0 -98
  172. package/src/presets/aura/toolbar/index.js +0 -28
  173. package/src/presets/aura/tooltip/index.js +0 -73
  174. package/src/presets/aura/tree/index.js +0 -294
  175. package/src/presets/aura/treeselect/index.js +0 -404
  176. package/src/presets/aura/treetable/index.js +0 -513
  177. package/src/presets/aura/tristatecheckbox/index.js +0 -121
  178. /package/src/components/{types → Image}/Image.ts +0 -0
package/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "@cooperco/cooper-component-library",
3
3
  "private": false,
4
- "version": "0.0.10",
4
+ "version": "0.1.0",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",
8
8
  "src/components/",
9
- "src/presets/",
10
9
  "src/assets/"
11
10
  ],
12
11
  "main": "./dist/component-lib.umd.cjs",
@@ -21,58 +20,66 @@
21
20
  "require": "./dist/style.css"
22
21
  },
23
22
  "./components/*": "./dist/components/*",
24
- "./presets/*": "./dist/presets/*",
25
23
  "./assets/*": "./dist/assets/*"
26
24
  },
27
25
  "scripts": {
28
26
  "dev": "vite",
27
+ "check-types": "vue-tsc --noEmit",
29
28
  "build": "vite build",
30
29
  "preview": "vite preview",
31
30
  "tail": "tailwind-config-viewer -o",
32
31
  "storybook": "storybook dev -p 6006",
33
32
  "build-storybook": "storybook build",
34
33
  "chromatic": "chromatic --exit-zero-on-changes",
35
- "prepare": "husky install"
34
+ "prepare": "husky",
35
+ "lint": "eslint . --no-fix",
36
+ "lint:fix": "eslint . --fix --quiet"
36
37
  },
37
38
  "dependencies": {
38
39
  "@primevue/themes": "^4.0.0",
40
+ "primeicons": "^7.0.0",
39
41
  "primevue": "^3.0.0",
42
+ "tailwind-merge": "^2.4.0",
40
43
  "vite-plugin-turbosnap": "^1.0.3",
41
- "vue": "^3.0.0",
42
- "vue-router": "^4.4.0"
44
+ "vue": "^3.0.0"
43
45
  },
44
46
  "devDependencies": {
45
- "@chromatic-com/storybook": "^1.4.0",
47
+ "@cooperco/contentful-cli-migrations": "^0.5.0",
48
+ "@chromatic-com/storybook": "^1.6.1",
46
49
  "@eslint/js": "^9.4.0",
47
- "@storybook/addon-essentials": "^8.1.2",
48
- "@storybook/addon-interactions": "^8.1.2",
49
- "@storybook/addon-links": "^8.1.2",
50
- "@storybook/blocks": "^8.1.2",
51
- "@storybook/builder-vite": "^8.1.2",
52
- "@storybook/test": "^8.1.2",
53
- "@storybook/vue3": "^8.1.2",
54
- "@storybook/vue3-vite": "^8.1.2",
50
+ "@storybook/addon-essentials": "^8.2.8",
51
+ "@storybook/addon-interactions": "^8.2.8",
52
+ "@storybook/addon-links": "^8.2.8",
53
+ "@storybook/blocks": "^8.2.8",
54
+ "@storybook/builder-vite": "^8.2.8",
55
+ "@storybook/test": "^8.2.8",
56
+ "@storybook/vue3": "^8.2.8",
57
+ "@storybook/vue3-vite": "^8.2.8",
55
58
  "@tsconfig/node18": "^18.2.4",
56
59
  "@vitejs/plugin-vue": "^5.0.4",
57
60
  "@vue/tsconfig": "^0.5.1",
58
61
  "autoprefixer": "^10.4.19",
59
62
  "chromatic": "^11.4.0",
60
- "eslint": "^8.56.0",
61
- "eslint-plugin-vue": "^9.20.1",
63
+ "eslint": "^8.57.0",
64
+ "eslint-config-prettier": "^9.1.0",
65
+ "eslint-plugin-vue": "^9.26.0",
62
66
  "globals": "^15.3.0",
63
67
  "husky": "^9.1.4",
64
68
  "jsdom": "^24.1.0",
65
69
  "lint-staged": "^15.2.8",
66
70
  "postcss": "^8.4.38",
67
71
  "prettier": "3.3.1",
68
- "storybook": "^8.1.2",
72
+ "storybook": "^8.2.8",
69
73
  "storybook-vue3-router": "^5.0.0",
70
74
  "tailwind-config-viewer": "^2.0.2",
71
75
  "tailwindcss": "^3.4.3",
72
76
  "typescript": "~5.3.3",
73
77
  "typescript-eslint": "^7.17.0",
74
78
  "unplugin-vue-components": "^0.27.0",
75
- "vite": "^5.2.0"
79
+ "vite": "^5.2.0",
80
+ "vue-eslint-parser": "^9.4.3",
81
+ "vue-router": "^4.4.3",
82
+ "vue-tsc": "^2.0.29"
76
83
  },
77
84
  "peerDependencies": {
78
85
  "primevue": "^3.0.0",
@@ -80,6 +87,8 @@
80
87
  "vue": "^3.0.0"
81
88
  },
82
89
  "lint-staged": {
83
- "*.{js,css,md,ts,vue}": "prettier --write"
90
+ "*.{json,js,ts,jsx,tsx,html,vue}": [
91
+ "prettier --write --ignore-unknown"
92
+ ]
84
93
  }
85
94
  }
@@ -0,0 +1,60 @@
1
+ @font-face {
2
+ font-family: 'GTWalsheim-Rg';
3
+ src: url('./fonts/GT-Walsheim-Regular.woff') format('woff'),
4
+ url('./fonts/GT-Walsheim-Regular.woff2') format('woff2');
5
+ font-weight: normal;
6
+ font-style: normal;
7
+ font-display: swap;
8
+ }
9
+
10
+ @font-face {
11
+ font-family: 'GTWalsheim-Bd';
12
+ src: url('./fonts/GT-Walsheim-Bold.woff') format('woff'), url('./fonts/GT-Walsheim-Bold.woff2') format('woff2');
13
+ font-weight: normal;
14
+ font-style: normal;
15
+ font-display: swap;
16
+ }
17
+
18
+ @font-face {
19
+ font-family: 'GTWalsheim-Md';
20
+ src: url('./fonts/GT-Walsheim-Medium.woff') format('woff'), url('./fonts/GT-Walsheim-Medium.woff2') format('woff2');
21
+ font-weight: normal;
22
+ font-style: normal;
23
+ font-display: swap;
24
+ }
25
+
26
+ @font-face {
27
+ font-family: 'NotoSansSC-Rg';
28
+ src: url('./fonts/notosanssc-regular-webfont.woff') format('woff'),
29
+ url('./fonts/notosanssc-regular-webfont.woff2') format('woff2');
30
+ font-weight: normal;
31
+ font-style: normal;
32
+ font-display: swap;
33
+ }
34
+
35
+ @font-face {
36
+ font-family: 'NotoSansSC-Bd';
37
+ src: url('./fonts/notosanssc-bold-webfont.woff') format('woff'),
38
+ url('./fonts/notosanssc-bold-webfont.woff2') format('woff2');
39
+ font-weight: normal;
40
+ font-style: normal;
41
+ font-display: swap;
42
+ }
43
+
44
+ @font-face {
45
+ font-family: 'GTWalsheimLC-Rg';
46
+ src: url('./fonts/GT-Walsheim-LC-Regular.woff') format('woff'),
47
+ url('./fonts/GT-Walsheim-LC-Regular.woff2') format('woff2');
48
+ font-weight: normal;
49
+ font-style: normal;
50
+ font-display: swap;
51
+ }
52
+
53
+ @font-face {
54
+ font-family: 'GTWalsheimLC-Bd';
55
+ src: url('./fonts/GT-Walsheim-LC-Bold.woff') format('woff'),
56
+ url('./fonts/GT-Walsheim-LC-Bold.woff2') format('woff2');
57
+ font-weight: normal;
58
+ font-style: normal;
59
+ font-display: swap;
60
+ }
@@ -2,6 +2,24 @@
2
2
  @tailwind components;
3
3
  @tailwind utilities;
4
4
 
5
+ @font-face {
6
+ font-family: 'GT-Walsheim';
7
+ src: url('./fonts/GT-Walsheim-Regular.woff') format('woff');
8
+ }
9
+
10
+ @font-face {
11
+ font-family: 'GT-Walsheim-Bd';
12
+ src: url('./fonts/GT-Walsheim-Bold.woff') format('woff');
13
+ }
14
+
15
+ :root {
16
+ font-family: 'GT-Walsheim';
17
+ }
18
+
19
+ .font-bold {
20
+ font-family: 'GT-Walsheim-Bd';
21
+ }
22
+
5
23
  img {
6
24
  height: inherit;
7
25
  }
@@ -16,120 +34,6 @@ div {
16
34
  white-space: pre-wrap;
17
35
  }
18
36
 
19
- /*
20
- Tile Collection variant styles.
21
- The `variant` is appended to the container class.
22
- */
23
- .tile-collection.IconCard,
24
- .tile-collection.ImageCard {
25
- .tile-content-media {
26
- @apply order-1 mb-4;
27
- img {
28
- @apply mx-auto;
29
- }
30
- }
31
- .tile-content-headline {
32
- @apply order-2;
33
- }
34
- .tile-content-description {
35
- @apply order-3;
36
- }
37
- }
38
-
39
- .tile-collection.VideoCard {
40
- .p-card-title {
41
- @apply order-1;
42
- }
43
-
44
- .p-card-header {
45
- @apply order-2;
46
- }
47
-
48
- .p-card-content {
49
- @apply order-3;
50
- }
51
- }
52
-
53
- .tile-collection.ImageStackedAnimated {
54
- .tile-collection-content {
55
- @apply flex-col gap-36;
56
- }
57
- p {
58
- @apply leading-snug;
59
- word-wrap: break-word;
60
- }
61
- .tile-content-inner {
62
- @apply max-h-80 !flex-row justify-center items-center gap-16;
63
- .tile-content-subheadline {
64
- @apply hidden;
65
- }
66
- .tile-content-text {
67
- @apply max-w-[450px] space-y-4;
68
- }
69
- }
70
-
71
- .tile-content-container {
72
- @apply flex flex-row items-center justify-center;
73
- }
74
- img {
75
- @apply rounded-full min-w-80;
76
- }
77
-
78
- .tile-content-media {
79
- @apply relative;
80
- img {
81
- @apply relative z-10;
82
- }
83
- }
84
- .tile-content:nth-child(odd) {
85
- .tile-content-inner {
86
- .tile-content-text {
87
- @apply *:text-left order-2;
88
- }
89
- .tile-content-media {
90
- @apply order-1;
91
- .tile-label {
92
- @apply right-0 top-4;
93
- }
94
-
95
- &::before {
96
- @apply absolute z-0;
97
- bottom: -22%;
98
- left: -16%;
99
- background-repeat: no-repeat;
100
- background-position: 0 100%;
101
- content: url(https://images.ctfassets.net/qqblaiss500w/5Bp3ySaz0pqR5gLtdxOQoi/db01031466deed9b7b959c08c17e5681/circles1.f3eead2.svg);
102
- }
103
- }
104
- }
105
- }
106
-
107
- .tile-content:nth-child(even) {
108
- .tile-content-inner {
109
- .tile-content-text {
110
- @apply *:text-right order-1;
111
- }
112
- .tile-content-media {
113
- .tile-label {
114
- @apply left-0 top-4;
115
- }
116
- @apply order-2;
117
- &::before {
118
- @apply absolute z-0;
119
- top: -12%;
120
- left: -28%;
121
- background-repeat: no-repeat;
122
- background-position: 0 100%;
123
- transform: rotate(90deg);
124
- content: url(https://images.ctfassets.net/qqblaiss500w/5Bp3ySaz0pqR5gLtdxOQoi/db01031466deed9b7b959c08c17e5681/circles1.f3eead2.svg);
125
- }
126
- }
127
- .tile-content-media {
128
- }
129
- }
130
- }
131
- }
132
-
133
37
  .carousel.hero {
134
38
  /*
135
39
  This with the content override below puts the indicators
@@ -4,7 +4,7 @@
4
4
  --primary-200: #9375ce;
5
5
  --primary-300: #8869bf;
6
6
  --primary-400: #7d5caf;
7
- --primary-500: #734fa0;
7
+ --primary-500: #8959e3; /* #734fa0 <- old, not quite the same as cordblood */
8
8
  --primary-600: #684291;
9
9
  --primary-700: #5d3581;
10
10
  --primary-800: #522972;
@@ -31,6 +31,10 @@
31
31
  --primary-highlight-opacity: 0.1;
32
32
  --primary-highlight-inverse: var(--primary-700);
33
33
  --primary-highlight-hover-opacity: 0.2;
34
+
35
+ --secondary-500: #18a589;
36
+
37
+ --secondary: var(--secondary-500);
34
38
  }
35
39
  .dark {
36
40
  --primary: var(--primary-400);
@@ -1,18 +1,20 @@
1
- import { ClassOverrides } from '.'
1
+ import { ComponentPassthrough } from '../../types'
2
2
  import { AccordionItem } from './AccordionItem'
3
- import { Image } from './Image'
4
- import { CTA } from './CTA'
3
+ import { Image } from '../Image/Image'
5
4
 
6
- interface AccordionModuleOverrides extends ClassOverrides {
5
+ export interface AccordionPassthrough extends ComponentPassthrough {
7
6
  imageIcon?: string
8
7
  }
8
+
9
9
  export interface Accordion {
10
10
  __typename?: 'Accordion'
11
11
  modules: AccordionItem[]
12
12
  headline?: string
13
13
  // types only used in code, based on placement from contentful
14
14
  isChild?: boolean
15
- type?: 'List' | 'Tile'
16
- pt?: AccordionModuleOverrides
15
+ iconDefault?: string
16
+ iconActive?: string
17
+ type: 'List' | 'Tile'
18
+ pt?: AccordionPassthrough
17
19
  imageIcon?: Image
18
20
  }
@@ -0,0 +1,66 @@
1
+ <script setup lang="ts">
2
+ // Can potentially merge this and TestimonialModule
3
+ import { type Accordion } from './Accordion'
4
+ import { computed, ref } from 'vue'
5
+ import {
6
+ combinePassthroughs,
7
+ AccordionPt,
8
+ } from '../../config/defaultPassthrough'
9
+
10
+ const props = withDefaults(defineProps<Accordion>(), {
11
+ iconDefault: 'pi-chevron-down',
12
+ iconActive: 'pi-chevron-up',
13
+ })
14
+
15
+ const computedIconDefault = computed(() => {
16
+ return props.type === 'List' ? 'pi-chevron-down' : 'pi-plus-circle'
17
+ })
18
+
19
+ const computedIconActive = computed(() => {
20
+ return props.type === 'List' ? 'pi-chevron-up' : 'pi-times-circle'
21
+ })
22
+
23
+ const pt = computed(() =>
24
+ combinePassthroughs(AccordionPt[props.type], props.pt ?? {})
25
+ )
26
+ const openAccordionIndex = ref<number | null>(null)
27
+ const toggleAccordion = (index: number) => {
28
+ openAccordionIndex.value = openAccordionIndex.value === index ? null : index
29
+ }
30
+ </script>
31
+
32
+ <template>
33
+ <component
34
+ :is="isChild ? 'div' : 'section'"
35
+ :class="`accordion-module ${pt?.root ?? ''}`"
36
+ >
37
+ <h3
38
+ v-if="headline"
39
+ :class="`accordion-module-headline ${pt?.headline ?? ''}`"
40
+ >
41
+ {{ headline }}
42
+ </h3>
43
+ <div
44
+ v-if="modules"
45
+ :class="`accordion-module-container flex ${pt?.container ?? ''}`"
46
+ >
47
+ <template
48
+ v-for="(item, index) in modules"
49
+ :key="`${item.title}-${index}`"
50
+ >
51
+ <component
52
+ :is="`Accordion${type}Item`"
53
+ v-bind="item"
54
+ :item-number="index"
55
+ :is-first="index === 0"
56
+ :is-last="index === modules.length - 1"
57
+ :icon-default="computedIconDefault"
58
+ :icon-active="computedIconActive"
59
+ :total-items="modules.length"
60
+ :open-accordion-index="openAccordionIndex"
61
+ @toggle-accordion="toggleAccordion(index)"
62
+ />
63
+ </template>
64
+ </div>
65
+ </component>
66
+ </template>
@@ -0,0 +1,25 @@
1
+ import { ComponentPassthrough } from '../../types'
2
+ import { Image } from '../Image/Image'
3
+
4
+ export interface AccordionItemPassthrough extends ComponentPassthrough {
5
+ icon?: string
6
+ button?: string
7
+ image?: string
8
+ }
9
+
10
+ export interface AccordionItem {
11
+ __typename?: 'AccordionItem'
12
+ itemNumber?: number
13
+ title?: string
14
+ content?: string
15
+ pt?: AccordionItemPassthrough
16
+ isFirst?: boolean
17
+ isLast?: boolean
18
+ iconActive?: string
19
+ iconDefault?: string
20
+ totalItems?: number
21
+ isListType?: boolean
22
+ openAccordionIndex?: number | null
23
+ toggleAccordion?: (index: number) => void
24
+ Image?: Image
25
+ }
@@ -0,0 +1,104 @@
1
+ <script setup lang="ts">
2
+ import { type AccordionItem } from './AccordionItem'
3
+ import { computed, ref } from 'vue'
4
+ import {
5
+ combinePassthroughs,
6
+ AccordionItemPt,
7
+ } from '../../config/defaultPassthrough'
8
+
9
+ const props = withDefaults(defineProps<AccordionItem>(), { totalItems: 4 })
10
+ const pt = computed(() => combinePassthroughs(AccordionItemPt, props.pt ?? {}))
11
+ const showDescription = ref(false)
12
+
13
+ const emit = defineEmits(['toggleAccordion'])
14
+
15
+ const toggleAccordion = (index: number) => {
16
+ emit('toggleAccordion', index)
17
+ }
18
+ </script>
19
+
20
+ <template isListType>
21
+ <div
22
+ v-if="isListType"
23
+ :class="{
24
+ [`accordion-item-${itemNumber}`]: true,
25
+ active: showDescription,
26
+ first: isFirst,
27
+ last: isLast,
28
+ }"
29
+ class="accordion-item group"
30
+ >
31
+ <h3
32
+ :id="`accordion-collapse-headline-${itemNumber}`"
33
+ :class="`flex accordion-item-headline ${pt?.headline ?? ''}`"
34
+ >
35
+ <button
36
+ type="button"
37
+ :class="`flex items-center w-full ${pt?.button ?? ''} justify-between`"
38
+ data-accordion-target="#accordion-collapse-body-1"
39
+ :aria-expanded="true"
40
+ :aria-controls="`accordion-collapse-body-${itemNumber}`"
41
+ @click.prevent="showDescription = !showDescription"
42
+ >
43
+ <span>{{ title }}</span>
44
+ <div :class="`${pt?.icon ?? ''}`">
45
+ <i v-show="!showDescription" :class="`pi ${iconDefault}`"></i>
46
+ <i v-show="showDescription" :class="`pi ${iconActive}`"></i>
47
+ </div>
48
+ </button>
49
+ </h3>
50
+ <div
51
+ :id="`accordion-collapse-body-${itemNumber}`"
52
+ :class="`accordion-item-body ${showDescription ? 'show' : 'hidden'} ${pt?.content ?? ''}`"
53
+ :aria-labelledby="`accordion-collapse-heading-${itemNumber}`"
54
+ >
55
+ {{ content }}
56
+ </div>
57
+ </div>
58
+
59
+ <div
60
+ v-else
61
+ :class="{
62
+ [`accordion-item-${itemNumber}`]: true,
63
+ active: openAccordionIndex === itemNumber,
64
+ first: isFirst,
65
+ last: isLast,
66
+ [`accordion-item-width-${Math.floor(100 / props.totalItems)}`]: true,
67
+ }"
68
+ class="accordion-item group"
69
+ >
70
+ <h3
71
+ :id="`accordion-collapse-headline-${itemNumber}`"
72
+ :class="`flex accordion-item-headline ${pt?.headline ?? ''}`"
73
+ >
74
+ <button
75
+ type="button"
76
+ :class="`flex items-center w-full ${pt?.button ?? ''} ${props.isListType ? 'justify-between' : 'justify-center'}`"
77
+ data-accordion-target="#accordion-collapse-body-1"
78
+ :aria-expanded="openAccordionIndex === itemNumber"
79
+ :aria-controls="`accordion-collapse-body-${itemNumber}`"
80
+ @click.prevent="toggleAccordion(itemNumber as number)"
81
+ >
82
+ <span>{{ title }}</span>
83
+
84
+ <div :class="`${pt?.icon ?? ''}`">
85
+ <i
86
+ v-show="openAccordionIndex !== itemNumber"
87
+ :class="`pi ${iconDefault}`"
88
+ ></i>
89
+ <i
90
+ v-show="openAccordionIndex === itemNumber"
91
+ :class="`pi ${iconActive}`"
92
+ ></i>
93
+ </div>
94
+ </button>
95
+ </h3>
96
+ <div
97
+ :id="`accordion-collapse-body-${itemNumber}`"
98
+ :class="`accordion-item-body ${openAccordionIndex !== itemNumber ? 'hidden' : 'active'} ${pt?.content ?? ''}`"
99
+ :aria-labelledby="`accordion-collapse-heading-${itemNumber}`"
100
+ >
101
+ {{ content }}
102
+ </div>
103
+ </div>
104
+ </template>
@@ -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 ?? ''}`"