@explorer-1/vue 0.2.1 → 0.2.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.
- package/lib/main.ts +4 -4
- package/package.json +1 -1
- package/src/components/{BlockCardGroup/BlockCardGroup.stories.js → BlockCardGrid/BlockCardGrid.stories.js} +36 -13
- package/src/components/BlockCardGrid/BlockCardGrid.vue +70 -0
- package/src/components/{BlockCard/BlockCard.stories.js → BlockCardGridItem/BlockCardGridItem.stories.js} +14 -6
- package/src/components/BlockCardGridItem/BlockCardGridItem.vue +40 -0
- package/src/components/{BlockCard/BlockCard.vue → BlockCardGridItem/BlockCardGridItemElement.vue} +30 -17
- package/src/components/BlockCircleImageCard/BlockCircleImageCard.stories.js +2 -1
- package/src/components/BlockLinkCard/BlockLinkCard.stories.js +2 -1
- package/src/components/BlockLinkTile/BlockLinkTile.stories.js +3 -2
- package/src/components/BlockListCards/BlockListCards.stories.js +1 -0
- package/src/components/BlockStreamfield/BlockStreamfield.stories.js +7 -1
- package/src/components/BlockStreamfield/BlockStreamfield.vue +14 -4
- package/src/components/LayoutHelper/LayoutHelper.vue +7 -1
- package/src/docs/overviews/blocks.docs.mdx.disabled +7 -7
- package/src/docs/overviews/cards.docs.mdx +81 -0
- package/src/interfaces.ts +7 -2
- package/src/templates/www/PageRoboticsDetail/PageRoboticsDetail.stories.js +2 -2
- package/src/templates/www/PageRoboticsDetail/PageRoboticsDetail.vue +4 -4
- package/src/components/BlockCardGroup/BlockCardGroup.vue +0 -61
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
|
|
54
|
-
import
|
|
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
|
-
|
|
258
|
-
|
|
257
|
+
BlockCardGridItem,
|
|
258
|
+
BlockCardGrid,
|
|
259
259
|
BlockCircleImageCard,
|
|
260
260
|
BlockCta,
|
|
261
261
|
BlockHeading,
|
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import BlockCardGrid from './BlockCardGrid.vue'
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
|
-
title: 'Components/Blocks/
|
|
5
|
-
component:
|
|
4
|
+
title: 'Components/Blocks/BlockCardGrid',
|
|
5
|
+
component: BlockCardGrid,
|
|
6
|
+
tags: ['!autodocs'],
|
|
6
7
|
excludeStories: /.*Data$/
|
|
7
8
|
}
|
|
8
9
|
|
|
9
|
-
export const
|
|
10
|
+
export const BlockCardGridData = [
|
|
10
11
|
{
|
|
11
|
-
|
|
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.',
|
|
@@ -20,10 +21,14 @@ export const BlockCardGroupData = [
|
|
|
20
21
|
width: 800
|
|
21
22
|
},
|
|
22
23
|
srcSet: 'https://picsum.photos/400/200 320w, https://picsum.photos/800/400 1024w'
|
|
24
|
+
},
|
|
25
|
+
link: {
|
|
26
|
+
page: null,
|
|
27
|
+
externalLink: ''
|
|
23
28
|
}
|
|
24
29
|
},
|
|
25
30
|
{
|
|
26
|
-
|
|
31
|
+
label: 'Factoid 2',
|
|
27
32
|
title: 'Nimble Limbs',
|
|
28
33
|
description: 'The robot has four limbs, each with seven degrees of freedom.',
|
|
29
34
|
image: {
|
|
@@ -34,17 +39,27 @@ export const BlockCardGroupData = [
|
|
|
34
39
|
width: 800
|
|
35
40
|
},
|
|
36
41
|
srcSet: 'https://picsum.photos/400/200 320w, https://picsum.photos/800/400 1024w'
|
|
42
|
+
},
|
|
43
|
+
link: {
|
|
44
|
+
page: {
|
|
45
|
+
url: '#'
|
|
46
|
+
},
|
|
47
|
+
externalLink: ''
|
|
37
48
|
}
|
|
38
49
|
},
|
|
39
50
|
{
|
|
40
|
-
|
|
51
|
+
label: 'Factoid 3',
|
|
41
52
|
title: 'Nimble Limbs',
|
|
42
53
|
description:
|
|
43
54
|
'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
|
-
image: null
|
|
55
|
+
image: null,
|
|
56
|
+
link: {
|
|
57
|
+
page: null,
|
|
58
|
+
externalLink: ''
|
|
59
|
+
}
|
|
45
60
|
},
|
|
46
61
|
{
|
|
47
|
-
|
|
62
|
+
label: 'Factoid 4',
|
|
48
63
|
title: 'Nimble Limbs',
|
|
49
64
|
description: 'The robot has four limbs, each with seven degrees of freedom.',
|
|
50
65
|
image: {
|
|
@@ -55,17 +70,25 @@ export const BlockCardGroupData = [
|
|
|
55
70
|
width: 800
|
|
56
71
|
},
|
|
57
72
|
srcSet: 'https://picsum.photos/400/200 320w, https://picsum.photos/800/400 1024w'
|
|
73
|
+
},
|
|
74
|
+
link: {
|
|
75
|
+
page: null,
|
|
76
|
+
externalLink: ''
|
|
58
77
|
}
|
|
59
78
|
},
|
|
60
79
|
{
|
|
61
|
-
|
|
80
|
+
label: 'Factoid 5',
|
|
62
81
|
title: 'Nimble Limbs',
|
|
63
82
|
description: 'The robot has four limbs, each with seven degrees of freedom.',
|
|
64
|
-
image: null
|
|
83
|
+
image: null,
|
|
84
|
+
link: {
|
|
85
|
+
externalLink: '#',
|
|
86
|
+
page: null
|
|
87
|
+
}
|
|
65
88
|
}
|
|
66
89
|
]
|
|
67
90
|
|
|
68
91
|
export const BaseStory = {
|
|
69
|
-
name: '
|
|
70
|
-
args: {
|
|
92
|
+
name: 'BlockCardGrid',
|
|
93
|
+
args: { cards: BlockCardGridData }
|
|
71
94
|
}
|
|
@@ -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
|
|
1
|
+
import BlockCardGridItem from './BlockCardGridItem.vue'
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
|
-
title: 'Components/
|
|
5
|
-
component:
|
|
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
|
-
|
|
21
|
+
label: 'Factoid',
|
|
21
22
|
title: 'Nimble Limbs',
|
|
22
|
-
|
|
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: '
|
|
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?.page || link?.externalLink"
|
|
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>
|
package/src/components/{BlockCard/BlockCard.vue → BlockCardGridItem/BlockCardGridItemElement.vue}
RENAMED
|
@@ -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
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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">{{
|
|
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: '
|
|
64
|
+
name: 'BlockCardGridItemElement',
|
|
54
65
|
components: {
|
|
55
66
|
BaseImagePlaceholder,
|
|
56
67
|
BaseImage,
|
|
57
|
-
BaseHeading
|
|
68
|
+
BaseHeading,
|
|
69
|
+
IconArrow
|
|
58
70
|
},
|
|
59
71
|
props: {
|
|
60
|
-
|
|
72
|
+
label: {
|
|
61
73
|
type: String,
|
|
62
|
-
|
|
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
|
-
|
|
81
|
+
description: {
|
|
71
82
|
type: String,
|
|
72
|
-
required: false,
|
|
73
83
|
default: undefined
|
|
74
84
|
},
|
|
75
85
|
image: {
|
|
76
86
|
type: Object,
|
|
77
|
-
|
|
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/
|
|
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/
|
|
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/
|
|
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: '
|
|
36
|
+
title: 'Lorem ipsum dolor',
|
|
36
37
|
label: 'Solar System',
|
|
37
38
|
thumbnailImage: {
|
|
38
39
|
src: {
|
|
@@ -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
|
|
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
|
|
6
|
-
import _ as BlockCardStories from './../../components/
|
|
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: '
|
|
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:
|
|
95
|
-
path: '/docs/components-blocks-
|
|
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: '
|
|
164
|
+
heading: 'BlockCardGridItem',
|
|
165
165
|
meta: BlockCardStories,
|
|
166
|
-
path: '/docs/components-blocks-
|
|
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
|
|
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 {
|
|
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:
|
|
40
|
+
facts: BlockCardGridData
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
</p>
|
|
37
37
|
</div>
|
|
38
38
|
<!-- facts -->
|
|
39
|
-
<
|
|
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
|
-
:
|
|
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
|
|
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
|
-
|
|
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>
|