@explorer-1/vue 0.2.1 → 0.2.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.
package/lib/main.ts CHANGED
@@ -50,8 +50,8 @@ import BaseUnitToggle from './../src/components/BaseUnitToggle/BaseUnitToggle.vu
50
50
  import BaseVideo from './../src/components/BaseVideo/BaseVideo.vue'
51
51
  import BlockAnchor from './../src/components/BlockAnchor/BlockAnchor.vue'
52
52
  import BlockAudio from './../src/components/BlockAudio/BlockAudio.vue'
53
- import BlockCard from './../src/components/BlockCard/BlockCard.vue'
54
- import BlockCardGroup from './../src/components/BlockCardGroup/BlockCardGroup.vue'
53
+ import BlockCardGridItem from './../src/components/BlockCardGridItem/BlockCardGridItem.vue'
54
+ import BlockCardGrid from './../src/components/BlockCardGrid/BlockCardGrid.vue'
55
55
  import BlockCircleImageCard from './../src/components/BlockCircleImageCard/BlockCircleImageCard.vue'
56
56
  import BlockCta from './../src/components/BlockCta/BlockCta.vue'
57
57
  import BlockHeading from './../src/components/BlockHeading/BlockHeading.vue'
@@ -254,8 +254,8 @@ export {
254
254
  BaseVideo,
255
255
  BlockAnchor,
256
256
  BlockAudio,
257
- BlockCard,
258
- BlockCardGroup,
257
+ BlockCardGridItem,
258
+ BlockCardGrid,
259
259
  BlockCircleImageCard,
260
260
  BlockCta,
261
261
  BlockHeading,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@explorer-1/vue",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -1,14 +1,15 @@
1
- import BlockCardGroup from './BlockCardGroup.vue'
1
+ import BlockCardGrid from './BlockCardGrid.vue'
2
2
 
3
3
  export default {
4
- title: 'Components/Blocks/BlockCardGroup',
5
- component: BlockCardGroup,
4
+ title: 'Components/Blocks/BlockCardGrid',
5
+ component: BlockCardGrid,
6
+ tags: ['!autodocs'],
6
7
  excludeStories: /.*Data$/
7
8
  }
8
9
 
9
- export const BlockCardGroupData = [
10
+ export const BlockCardGridData = [
10
11
  {
11
- type: 'Factoid 1',
12
+ label: 'Factoid 1',
12
13
  title: 'Nimble Limbs',
13
14
  description:
14
15
  'The robot has four limbs, each with seven degrees of freedom. The robot has four limbs, each with seven degrees of freedom. The robot has four limbs, each with seven degrees of freedom.',
@@ -23,7 +24,7 @@ export const BlockCardGroupData = [
23
24
  }
24
25
  },
25
26
  {
26
- type: 'Factoid 2',
27
+ label: 'Factoid 2',
27
28
  title: 'Nimble Limbs',
28
29
  description: 'The robot has four limbs, each with seven degrees of freedom.',
29
30
  image: {
@@ -34,17 +35,22 @@ export const BlockCardGroupData = [
34
35
  width: 800
35
36
  },
36
37
  srcSet: 'https://picsum.photos/400/200 320w, https://picsum.photos/800/400 1024w'
38
+ },
39
+ link: {
40
+ page: {
41
+ url: '#'
42
+ }
37
43
  }
38
44
  },
39
45
  {
40
- type: 'Factoid 3',
46
+ label: 'Factoid 3',
41
47
  title: 'Nimble Limbs',
42
48
  description:
43
49
  'Proin sapien nulla, consequat et aliquam tristique, sollicitudin vitae lorem. Etiam nec vestibulum ante, semper blandit tortor. Nam id bibendum leo. Suspendisse a cursus felis, eget tristique nibh. Proin facilisis tortor eget pulvinar cursus.',
44
50
  image: null
45
51
  },
46
52
  {
47
- type: 'Factoid 4',
53
+ label: 'Factoid 4',
48
54
  title: 'Nimble Limbs',
49
55
  description: 'The robot has four limbs, each with seven degrees of freedom.',
50
56
  image: {
@@ -58,14 +64,17 @@ export const BlockCardGroupData = [
58
64
  }
59
65
  },
60
66
  {
61
- type: 'Factoid 5',
67
+ label: 'Factoid 5',
62
68
  title: 'Nimble Limbs',
63
69
  description: 'The robot has four limbs, each with seven degrees of freedom.',
64
- image: null
70
+ image: null,
71
+ link: {
72
+ externalLink: '#'
73
+ }
65
74
  }
66
75
  ]
67
76
 
68
77
  export const BaseStory = {
69
- name: 'BlockCardGroup',
70
- args: { facts: BlockCardGroupData }
78
+ name: 'BlockCardGrid',
79
+ args: { cards: BlockCardGridData }
71
80
  }
@@ -0,0 +1,70 @@
1
+ <template>
2
+ <div
3
+ v-if="cards"
4
+ class="BlockCardGrid"
5
+ >
6
+ <div
7
+ :class="`hidden md:grid md:grid-cols-2 lg:grid-cols-3 ${compact ? ' gap-5' : '3xl:grid-cols-4 gap-8'}`"
8
+ >
9
+ <BlockCardGridItem
10
+ v-for="(card, index) of cards"
11
+ :key="`item-${index}`"
12
+ class="col-span-1"
13
+ :label="card.label"
14
+ :title="card.title"
15
+ :description="card.description"
16
+ :image="card.image"
17
+ :link="card.link"
18
+ />
19
+ </div>
20
+ <MixinCarousel
21
+ class="md:hidden sm:px-10 sm:-ml-10 py-10 -mt-10 overflow-x-visible"
22
+ indent="col-1"
23
+ :slides-per-view="3"
24
+ no-links
25
+ >
26
+ <BlockCardGridItem
27
+ v-for="(card, index) of cards"
28
+ :key="index"
29
+ :label="card.label"
30
+ :title="card.title"
31
+ :text="card.description"
32
+ :image="card.image"
33
+ class="swiper-slide mb-5"
34
+ />
35
+ </MixinCarousel>
36
+ </div>
37
+ </template>
38
+ <script lang="ts">
39
+ import { defineComponent } from 'vue'
40
+ import type { PropType } from 'vue'
41
+ import type { ImageObject, LinkObject } from '../../interfaces'
42
+ import BlockCardGridItem from './../BlockCardGridItem/BlockCardGridItem.vue'
43
+ import MixinCarousel from './../MixinCarousel/MixinCarousel.vue'
44
+
45
+ interface CardGridItem {
46
+ title: string
47
+ label: string
48
+ description: string
49
+ image: Partial<ImageObject>
50
+ link?: LinkObject
51
+ }
52
+
53
+ export default defineComponent({
54
+ name: 'BlockCardGrid',
55
+ components: {
56
+ MixinCarousel,
57
+ BlockCardGridItem
58
+ },
59
+ props: {
60
+ compact: {
61
+ type: Boolean,
62
+ default: false
63
+ },
64
+ cards: {
65
+ type: Array as PropType<CardGridItem[]>,
66
+ default: undefined
67
+ }
68
+ }
69
+ })
70
+ </script>
@@ -1,8 +1,9 @@
1
- import BlockCard from './BlockCard.vue'
1
+ import BlockCardGridItem from './BlockCardGridItem.vue'
2
2
 
3
3
  export default {
4
- title: 'Components/Blocks/BlockCard',
5
- component: BlockCard,
4
+ title: 'Components/Cards/BlockCardGridItem',
5
+ component: BlockCardGridItem,
6
+ tags: ['!autodocs'],
6
7
  decorators: [
7
8
  () => ({
8
9
  template: `<div id="storyDecorator" class="lg:w-1/3"><story/></div>`
@@ -17,9 +18,9 @@ export default {
17
18
  }
18
19
 
19
20
  export const BlockCardData = {
20
- type: 'Factoid',
21
+ label: 'Factoid',
21
22
  title: 'Nimble Limbs',
22
- text: 'The robot has four limbs, each with seven degrees of freedom.',
23
+ description: 'The robot has four limbs, each with seven degrees of freedom.',
23
24
  image: {
24
25
  alt: 'Fourth image',
25
26
  src: {
@@ -28,7 +29,14 @@ export const BlockCardData = {
28
29
  width: 800
29
30
  },
30
31
  srcSet: 'https://picsum.photos/400/200 320w, https://picsum.photos/800/400 1024w'
32
+ },
33
+ link: {
34
+ page: {
35
+ url: '#'
36
+ },
37
+ externalLink: null
31
38
  }
32
39
  }
33
40
 
34
- export const BaseStory = { name: 'BlockCard', args: BlockCardData }
41
+ export const BaseStory = { name: 'BlockCardGridItem', args: BlockCardData }
42
+ export const NoLink = { args: { ...BlockCardData, link: undefined } }
@@ -0,0 +1,40 @@
1
+ <template>
2
+ <BaseLink
3
+ v-if="link"
4
+ variant="none"
5
+ :to="link?.page?.url ? link.page.url : undefined"
6
+ :href="link?.externalLink ? link?.externalLink : undefined"
7
+ class="BlockCardGridItem group"
8
+ external-target-blank
9
+ >
10
+ <BlockCardGridItemElement
11
+ v-bind="$attrs"
12
+ :link="link"
13
+ />
14
+ </BaseLink>
15
+ <BlockCardGridItemElement
16
+ v-else
17
+ v-bind="$attrs"
18
+ />
19
+ </template>
20
+ <script lang="ts">
21
+ import { defineComponent, PropType } from 'vue'
22
+ import type { LinkObject } from './../../interfaces'
23
+ import BaseLink from './../BaseLink/BaseLink.vue'
24
+ import BlockCardGridItemElement from './BlockCardGridItemElement.vue'
25
+
26
+ export default defineComponent({
27
+ name: 'BlockCardGridItem',
28
+ components: {
29
+ BaseLink,
30
+ BlockCardGridItemElement
31
+ },
32
+ props: {
33
+ link: {
34
+ type: Object as PropType<LinkObject>,
35
+ required: false,
36
+ default: undefined
37
+ }
38
+ }
39
+ })
40
+ </script>
@@ -19,18 +19,21 @@
19
19
  :width="image.src.width"
20
20
  :height="image.src.height"
21
21
  object-fit-class="cover"
22
+ image-class="can-hover:group-hover:delay-200 can-hover:group-hover:scale-100 absolute top-0 left-0 w-full transition-all duration-200 ease-in transform scale-105"
22
23
  loading="lazy"
23
24
  />
24
25
  </BaseImagePlaceholder>
25
26
  </div>
26
27
  <div class="px-6 py-6 ThemeVariantLight">
27
- <div class="text-primary text-subtitle">
28
- {{ type }}
29
- </div>
30
- <hr
31
- aria-hidden="true"
32
- class="bg-primary text-primary w-8 h-2px border-0 my-2"
33
- />
28
+ <template v-if="label">
29
+ <div class="text-primary text-subtitle">
30
+ {{ label }}
31
+ </div>
32
+ <hr
33
+ aria-hidden="true"
34
+ class="bg-primary text-primary w-8 h-2px border-0 my-2"
35
+ />
36
+ </template>
34
37
  <BaseHeading
35
38
  size="h5"
36
39
  level="h3"
@@ -38,43 +41,53 @@
38
41
  >
39
42
  {{ title }}
40
43
  </BaseHeading>
41
- <p class="text-body-sm">{{ text }}</p>
44
+ <p class="text-body-sm">{{ description }}</p>
45
+ <div
46
+ v-if="link"
47
+ class="ThemeVariantLight w-full mt-1 can-hover:block text-action can-hover:-ml-3 can-hover:group-hover:delay-200 can-hover:opacity-0 can-hover:group-hover:ml-0 can-hover:group-hover:opacity-100 hidden text-2xl leading-normal transition-all duration-200 ease-in"
48
+ >
49
+ <IconArrow />
50
+ </div>
42
51
  </div>
43
52
  </div>
44
53
  </template>
45
54
  <script lang="ts">
46
- import { defineComponent } from 'vue'
55
+ import { defineComponent, PropType } from 'vue'
47
56
  import { mixinGetSrcSet } from './../../utils/mixins'
57
+ import type { LinkObject } from './../../interfaces'
48
58
  import BaseImagePlaceholder from './../BaseImagePlaceholder/BaseImagePlaceholder.vue'
49
59
  import BaseImage from './../BaseImage/BaseImage.vue'
50
60
  import BaseHeading from './../BaseHeading/BaseHeading.vue'
61
+ import IconArrow from './../Icons/IconArrow.vue'
51
62
 
52
63
  export default defineComponent({
53
- name: 'BlockCard',
64
+ name: 'BlockCardGridItemElement',
54
65
  components: {
55
66
  BaseImagePlaceholder,
56
67
  BaseImage,
57
- BaseHeading
68
+ BaseHeading,
69
+ IconArrow
58
70
  },
59
71
  props: {
60
- type: {
72
+ label: {
61
73
  type: String,
62
- required: false,
63
- default: 'Factoid'
74
+ default: undefined
64
75
  },
65
76
  title: {
66
77
  type: String,
67
78
  required: false,
68
79
  default: undefined
69
80
  },
70
- text: {
81
+ description: {
71
82
  type: String,
72
- required: false,
73
83
  default: undefined
74
84
  },
75
85
  image: {
76
86
  type: Object,
77
- required: false,
87
+ default: undefined
88
+ },
89
+ link: {
90
+ type: Object as PropType<LinkObject>,
78
91
  default: undefined
79
92
  }
80
93
  },
@@ -2,8 +2,9 @@ import IconExternal from './../Icons/IconExternal.vue'
2
2
  import BlockCircleImageCard from './BlockCircleImageCard.vue'
3
3
 
4
4
  export default {
5
- title: 'Components/Blocks/BlockCircleImageCard',
5
+ title: 'Components/Cards/BlockCircleImageCard',
6
6
  component: BlockCircleImageCard,
7
+ tags: ['!autodocs'],
7
8
  decorators: [
8
9
  () => ({
9
10
  template: `<div class="relative max-w-xl mx-auto container"><story/></div>`
@@ -3,8 +3,9 @@
3
3
  import BlockLinkCard from './BlockLinkCard.vue'
4
4
 
5
5
  export default {
6
- title: 'Components/Blocks/BlockLinkCard',
6
+ title: 'Components/Cards/BlockLinkCard',
7
7
  component: BlockLinkCard,
8
+ tags: ['!autodocs'],
8
9
  excludeStories: /.*Data$/,
9
10
  decorators: [
10
11
  () => ({
@@ -3,13 +3,14 @@
3
3
  import BlockLinkTile from './BlockLinkTile.vue'
4
4
 
5
5
  export default {
6
- title: 'Components/Blocks/BlockLinkTile',
6
+ title: 'Components/Cards/BlockLinkTile',
7
7
  component: BlockLinkTile,
8
8
  decorators: [
9
9
  () => ({
10
10
  template: `<div id="storyDecorator" class="relative grid grid-cols-2 gap-3 lg:grid-cols-3"><story/></div>`
11
11
  })
12
12
  ],
13
+ tags: ['!autodocs'],
13
14
  argTypes: {
14
15
  headingLevel: {
15
16
  description:
@@ -32,7 +33,7 @@ export default {
32
33
  export const BlockLinkTileData = {
33
34
  card: {
34
35
  url: '/topics/placeholder-slug-1',
35
- title: 'How engineers at NASA-JPL persevered to develop a ventilator',
36
+ title: 'Lorem ipsum dolor',
36
37
  label: 'Solar System',
37
38
  thumbnailImage: {
38
39
  src: {
@@ -8,6 +8,7 @@ export default {
8
8
 
9
9
  export const BlockListCardsData = {
10
10
  blockType: 'ListBlock',
11
+ field: 'content_card_list',
11
12
  items: [
12
13
  {
13
14
  description:
@@ -1,3 +1,4 @@
1
+ import { BlockCardGridData } from './../BlockCardGrid/BlockCardGrid.stories'
1
2
  import { BlockCtaData } from './../BlockCta/BlockCta.stories'
2
3
  import { BlockHeadingData } from './../BlockHeading/BlockHeading.stories'
3
4
  import { BlockImageCarouselData } from './../BlockImageCarousel/BlockImageCarousel.stories'
@@ -94,7 +95,12 @@ export const BlockStreamfieldData = {
94
95
  ...BlockInlineImageData.block,
95
96
  alignTo: 'left'
96
97
  },
97
- BlockTableData
98
+ BlockTableData,
99
+ {
100
+ blockType: 'ListBlock',
101
+ field: 'card_grid',
102
+ items: BlockCardGridData
103
+ }
98
104
  ]
99
105
  }
100
106
 
@@ -33,7 +33,7 @@
33
33
  />
34
34
 
35
35
  <LayoutHelper
36
- v-else-if="block.blockType == 'ListBlock'"
36
+ v-else-if="block.blockType == 'ListBlock' && block.field === 'content_card_list'"
37
37
  :key="`listBlock${index}`"
38
38
  indent="col-3"
39
39
  class="lg:mb-18 mb-10"
@@ -186,6 +186,15 @@
186
186
  :data="block"
187
187
  />
188
188
 
189
+ <LayoutHelper
190
+ v-else-if="block.blockType == 'ListBlock' && block.field === 'card_grid'"
191
+ :key="`gridBlock${index}`"
192
+ indent="col-1"
193
+ class="lg:mb-18 mb-10"
194
+ >
195
+ <BlockCardGrid :cards="block.items" />
196
+ </LayoutHelper>
197
+
189
198
  <div
190
199
  v-else
191
200
  :key="index"
@@ -199,10 +208,11 @@
199
208
  <script lang="ts">
200
209
  import { defineComponent } from 'vue'
201
210
  import type { PropType } from 'vue'
202
- import type { ImageObject } from '../../interfaces'
211
+ import type { BlockData, ImageObject } from '../../interfaces'
203
212
  import type { BlockData as VideoBlockEmbedData } from './../BlockVideoEmbed/BlockVideoEmbed.vue'
204
213
  import type { BlockQuoteAttributes } from './../BlockQuote/BlockQuote.vue'
205
214
  import LayoutHelper from './../LayoutHelper/LayoutHelper.vue'
215
+ import BlockCardGrid from './../BlockCardGrid/BlockCardGrid.vue'
206
216
  import BlockCta from './../BlockCta/BlockCta.vue'
207
217
  import BlockHeading from './../BlockHeading/BlockHeading.vue'
208
218
  import BlockImage from './../BlockImage/BlockImage.vue'
@@ -233,8 +243,7 @@ export const variants: Variants = {
233
243
  fluid: '-fluid'
234
244
  }
235
245
 
236
- export interface StreamfieldBlockData {
237
- blockType: string
246
+ export interface StreamfieldBlockData extends BlockData {
238
247
  id: string
239
248
  fullBleed: boolean
240
249
  heading: string
@@ -256,6 +265,7 @@ export default defineComponent({
256
265
  name: 'BlockStreamfield',
257
266
  components: {
258
267
  LayoutHelper,
268
+ BlockCardGrid,
259
269
  BlockCta,
260
270
  BlockHeading,
261
271
  BlockImage,
@@ -20,6 +20,10 @@ export default defineComponent({
20
20
  required: false,
21
21
  default: 'col-1',
22
22
  validator: (prop: string): boolean => Object.keys(indents).includes(prop)
23
+ },
24
+ fullBleed: {
25
+ type: Boolean,
26
+ default: false
23
27
  }
24
28
  },
25
29
  computed: {
@@ -31,7 +35,9 @@ export default defineComponent({
31
35
  </script>
32
36
  <template>
33
37
  <div class="LayoutHelper BaseGrid container mx-auto">
34
- <div :class="theWidth + ' col-start-1 col-end-13 lg:px-0 px-4 relative'">
38
+ <div
39
+ :class="`${theWidth} col-start-1 col-end-13 lg:px-0 ${fullBleed ? 'px-0' : 'px-4'} relative`"
40
+ >
35
41
  <slot></slot>
36
42
  </div>
37
43
  </div>
@@ -2,8 +2,8 @@
2
2
  import { Meta } from '@storybook/blocks'
3
3
  import { ComponentList } from './../utils/ComponentList'
4
4
  import _ as BlockAccordionStories from './../../components/BlockAccordion/BlockAccordion.stories'
5
- import _ as BlockCardGroupStories from './../../components/BlockCardGroup/BlockCardGroup.stories'
6
- import _ as BlockCardStories from './../../components/BlockCard/BlockCard.stories'
5
+ import _ as BlockCardGridStories from './../../components/BlockCardGrid/BlockCardGrid.stories'
6
+ import _ as BlockCardStories from './../../components/BlockCardGridItem/BlockCardGridItem.stories'
7
7
  import _ as BlockCircleImageCardStories from './../../components/BlockCircleImageCard/BlockCircleImageCard.stories'
8
8
  import _ as BlockIframeEmbedStories from './../../components/BlockIframeEmbed/BlockIframeEmbed.stories'
9
9
  import _ as BlockImageCarouselStories from './../../components/BlockImageCarousel/BlockImageCarousel.stories'
@@ -88,11 +88,11 @@ Reserved for the top of the page. Learn more about our heroes on the [heroes ove
88
88
  fullWidth: true
89
89
  },
90
90
  {
91
- heading: 'BlockCardGroup',
91
+ heading: 'BlockCardGrid',
92
92
  customDescription:
93
93
  'A collection of smaller cards that support images, labels, headings, and descriptions, laid out in a grid on medium and larger screens, or in a carousel on small screens.',
94
- meta: BlockCardGroupStories,
95
- path: '/docs/components-blocks-blockcardgroup--docs',
94
+ meta: BlockCardGridStories,
95
+ path: '/docs/components-blocks-BlockCardGrid--docs',
96
96
  canvasClass: 'sbdocs-inline-height',
97
97
  fullWidth: true
98
98
  },
@@ -161,9 +161,9 @@ Reserved for the top of the page. Learn more about our heroes on the [heroes ove
161
161
  <ComponentList
162
162
  components={[
163
163
  {
164
- heading: 'BlockCard',
164
+ heading: 'BlockCardGridItem',
165
165
  meta: BlockCardStories,
166
- path: '/docs/components-blocks-blockcard--docs'
166
+ path: '/docs/components-blocks-BlockCardGridItem--docs'
167
167
  },
168
168
  {
169
169
  heading: 'BlockLinkCard',
@@ -0,0 +1,81 @@
1
+ import { Meta } from '@storybook/blocks'
2
+ import { ComponentList } from './../utils/ComponentList'
3
+ import * as BlockCardGridItemStories from './../../components/BlockCardGridItem/BlockCardGridItem.stories'
4
+ import * as BlockCircleImageCardStories from './../../components/BlockCircleImageCard/BlockCircleImageCard.stories'
5
+ import * as BlockLinkCardStories from './../../components/BlockLinkCard/BlockLinkCard.stories'
6
+ import * as BlockLinkTileStories from './../../components/BlockLinkTile/BlockLinkTile.stories'
7
+
8
+ <Meta title="Components/Cards/Overview" />
9
+
10
+ # Card Components
11
+
12
+ - [Carousel Cards](#carousel)
13
+ - [Grid Cards](#grid)
14
+ - [Reserved-use Cards](#reserved)
15
+
16
+ <br />
17
+
18
+ <br />
19
+
20
+ <span id="carousel"></span>
21
+
22
+ ## Carousel Cards
23
+
24
+ These cards are interchangeable within `MixinCarousel`.
25
+
26
+ <br />
27
+
28
+ <ComponentList
29
+ components={[
30
+ {
31
+ heading: 'BlockLinkCard',
32
+ meta: BlockLinkCardStories,
33
+ path: '/story/components-cards-blocklinkcard--base-story',
34
+ fullWidth: true
35
+ },
36
+ {
37
+ heading: 'BlockLinkTile',
38
+ meta: BlockLinkTileStories,
39
+ path: '/story/components-cards-blocklinktile--base-story',
40
+ fullWidth: true
41
+ }
42
+ ]}
43
+ />
44
+
45
+ <span id="carousel"></span>
46
+
47
+ ## Grid Cards
48
+
49
+ These cards can be used to create a grid of cards.
50
+
51
+ <br />
52
+
53
+ <ComponentList
54
+ components={[
55
+ {
56
+ heading: 'BlockCardGridItem',
57
+ meta: BlockCardGridItemStories,
58
+ customDescription: 'The link is optional',
59
+ path: '/story/components-cards-blockcardgriditem--base-story',
60
+ fullWidth: true
61
+ }
62
+ ]}
63
+ />
64
+
65
+ ## Reserved-use Cards
66
+
67
+ These cards were built for specific use-cases, but that does not exclude them from being re-used for other purposes.
68
+
69
+ <br />
70
+
71
+ <ComponentList
72
+ components={[
73
+ {
74
+ heading: 'BlockCircleImageCard',
75
+ meta: BlockCircleImageCardStories,
76
+ path: '/story/components-cards-blockcircleimagecard--base-story',
77
+ fullWidth: true,
78
+ customDescription: 'Used in the Timeline'
79
+ }
80
+ ]}
81
+ />
package/src/interfaces.ts CHANGED
@@ -6,6 +6,8 @@ export interface BreadcrumbPathObject {
6
6
 
7
7
  export interface BlockData {
8
8
  blockType: string
9
+ field?: string
10
+ items?: any[]
9
11
  }
10
12
  export interface ImageSrcObject {
11
13
  url: string
@@ -80,12 +82,15 @@ export interface Card {
80
82
  thumbnailImage?: Partial<ImageObject>
81
83
  }
82
84
 
83
- export interface RelatedLinkObject {
85
+ export interface LinkObject {
84
86
  page: {
85
87
  url: string
86
88
  } | null
87
- document: { url: string } | null
88
89
  externalLink: string | null
90
+ }
91
+
92
+ export interface RelatedLinkObject extends LinkObject {
93
+ document: { url: string } | null
89
94
  text: string | null
90
95
  }
91
96
 
@@ -1,6 +1,6 @@
1
1
  import { HeroLargeData } from './../../../components/HeroLarge/HeroLarge.stories.js'
2
2
  import { RoboticsDetailStatsData } from './../../../components/RoboticsDetailStats/RoboticsDetailStats.stories.js'
3
- import { BlockCardGroupData } from './../../../components/BlockCardGroup/BlockCardGroup.stories.js'
3
+ import { BlockCardGridData } from './../../../components/BlockCardGrid/BlockCardGrid.stories.js'
4
4
  import { BlockLinkTileCarouselData } from './../../../components/BlockLinkCarousel/BlockLinkCarousel.stories.js'
5
5
  import { BlockRelatedLinksData } from './../../../components/BlockRelatedLinks/BlockRelatedLinks.stories.js'
6
6
  import { BlockStreamfieldTruncatedData } from './../../../components/BlockStreamfield/BlockStreamfield.stories'
@@ -37,7 +37,7 @@ export const Template = {
37
37
  ...BlockStreamfieldTruncatedData,
38
38
  relatedLinks: [BlockRelatedLinksData.data],
39
39
  moreRobots: BlockLinkTileCarouselData,
40
- facts: BlockCardGroupData
40
+ facts: BlockCardGridData
41
41
  }
42
42
  }
43
43
  }
@@ -36,10 +36,10 @@
36
36
  </p>
37
37
  </div>
38
38
  <!-- facts -->
39
- <BlockCardGroup
39
+ <BlockCardGrid
40
40
  v-if="data.facts"
41
41
  class="3xl:col-end-13 xl:col-end-11 md:px-4 lg:px-0 relative col-start-2 col-end-13 px-0 mt-12"
42
- :facts="data.facts"
42
+ :cards="data.facts"
43
43
  />
44
44
  </div>
45
45
 
@@ -73,7 +73,7 @@ import { defineComponent } from 'vue'
73
73
  import BaseHeading from './../../../components/BaseHeading/BaseHeading.vue'
74
74
  import HeroLarge from './../../../components/HeroLarge/HeroLarge.vue'
75
75
  import RoboticsDetailStats from './../../../components/RoboticsDetailStats/RoboticsDetailStats.vue'
76
- import BlockCardGroup from './../../../components/BlockCardGroup/BlockCardGroup.vue'
76
+ import BlockCardGrid from './../../../components/BlockCardGrid/BlockCardGrid.vue'
77
77
  import BlockRelatedLinks from './../../../components/BlockRelatedLinks/BlockRelatedLinks.vue'
78
78
  import BlockLinkCarousel from './../../../components/BlockLinkCarousel/BlockLinkCarousel.vue'
79
79
  import LayoutHelper from './../../../components/LayoutHelper/LayoutHelper.vue'
@@ -85,7 +85,7 @@ export default defineComponent({
85
85
  BaseHeading,
86
86
  HeroLarge,
87
87
  RoboticsDetailStats,
88
- BlockCardGroup,
88
+ BlockCardGrid,
89
89
  BlockRelatedLinks,
90
90
  BlockLinkCarousel,
91
91
  LayoutHelper,
@@ -1,61 +0,0 @@
1
- <template>
2
- <div
3
- v-if="facts"
4
- class="BlockCardGroup"
5
- >
6
- <div class="md:grid md:grid-cols-2 lg:grid-cols-3 3xl:grid-cols-4 hidden gap-8">
7
- <BlockCard
8
- v-for="(fact, index) of facts"
9
- :key="`fact-${index}`"
10
- class="col-span-1"
11
- :type="fact.type"
12
- :title="fact.title"
13
- :text="fact.description"
14
- :image="fact.image"
15
- />
16
- </div>
17
- <MixinCarousel
18
- class="md:hidden sm:px-10 sm:-ml-10 py-10 -mt-10"
19
- indent="col-1"
20
- :slides-per-view="3"
21
- no-links
22
- >
23
- <BlockCard
24
- v-for="(fact, index) of facts"
25
- :key="index"
26
- :title="fact.title"
27
- :text="fact.description"
28
- :image="fact.image"
29
- class="swiper-slide mb-5"
30
- />
31
- </MixinCarousel>
32
- </div>
33
- </template>
34
- <script lang="ts">
35
- import { defineComponent } from 'vue'
36
- import type { PropType } from 'vue'
37
- import type { ImageObject } from '../../interfaces'
38
- import BlockCard from './../BlockCard/BlockCard.vue'
39
- import MixinCarousel from './../MixinCarousel/MixinCarousel.vue'
40
-
41
- interface Fact {
42
- title: string
43
- type: string
44
- description: string
45
- image: Partial<ImageObject>
46
- }
47
-
48
- export default defineComponent({
49
- name: 'BlockCardGroup',
50
- components: {
51
- MixinCarousel,
52
- BlockCard
53
- },
54
- props: {
55
- facts: {
56
- type: Array as PropType<Fact[]>,
57
- required: false
58
- }
59
- }
60
- })
61
- </script>