@explorer-1/html 1.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.
- package/.pre-commit-config.yaml +19 -0
- package/.stylelintcache +1 -0
- package/CHANGELOG.md +49 -0
- package/LICENSE +21 -0
- package/index.html +1202 -0
- package/package.json +55 -0
- package/postcss.config.js +7 -0
- package/src/assets/README.md +12 -0
- package/src/assets/fonts/README.md +12 -0
- package/src/assets/scss/styles.scss +1 -0
- package/src/components/AppBarInternal/AppBarInternal.js +102 -0
- package/src/components/BaseButton/BaseButton.js +115 -0
- package/src/components/BaseButton/BaseButton.stories.js +275 -0
- package/src/components/BaseImage/BaseImage.js +23 -0
- package/src/components/BaseImage/BaseImage.stories.js +85 -0
- package/src/components/BaseImagePlaceholder/BaseImagePlaceholder.js +47 -0
- package/src/components/BaseImagePlaceholder/BaseImagePlaceholder.stories.js +147 -0
- package/src/components/BaseLink/BaseLink.js +86 -0
- package/src/components/BaseLink/BaseLink.stories.js +114 -0
- package/src/components/FooterInternal/FooterInternal.js +156 -0
- package/src/components/FooterInternal/FooterInternal.stories.js +43 -0
- package/src/components/FooterInternal/FooterInternalContactList.js +30 -0
- package/src/components/HeaderInternal/HeaderInternal.docs.mdx +154 -0
- package/src/components/HeaderInternal/HeaderInternal.js +39 -0
- package/src/components/HeaderInternal/HeaderInternal.stories.js +64 -0
- package/src/components/Icons/IconArrow.js +20 -0
- package/src/components/Icons/IconCaret.js +19 -0
- package/src/components/Icons/IconClose.js +20 -0
- package/src/components/Icons/IconDownload.js +22 -0
- package/src/components/Icons/IconDropdown.js +19 -0
- package/src/components/Icons/IconExpand.js +20 -0
- package/src/components/Icons/IconExternal.js +19 -0
- package/src/components/Icons/IconMenu.js +20 -0
- package/src/components/Icons/IconNext.js +15 -0
- package/src/components/Icons/IconPrev.js +15 -0
- package/src/components/Icons/IconSearch.js +20 -0
- package/src/components/Icons/IconSocialEmail.js +20 -0
- package/src/components/Icons/IconSocialFacebook.js +20 -0
- package/src/components/Icons/IconSocialInstagram.js +23 -0
- package/src/components/Icons/IconSocialReddit.js +19 -0
- package/src/components/Icons/IconSocialTwitter.js +19 -0
- package/src/components/Icons/IconSocialYoutube.js +23 -0
- package/src/components/Icons/IconUser.js +16 -0
- package/src/components/LogoJPL/LogoJPL.docs.mdx +28 -0
- package/src/components/LogoJPL/LogoJPL.js +17 -0
- package/src/components/LogoJPL/LogoJPL.stories.js +40 -0
- package/src/components/MixinAnimationCaret/MixinAnimationCaret.js +42 -0
- package/src/components/MixinAnimationCaret/MixinAnimationCaret.stories.js +42 -0
- package/src/components/NavInternal/NavInternal.js +135 -0
- package/src/components/NavInternal/NavInternal.stories.js +68 -0
- package/src/components/NavInternal/NavInternalHighlight.js +64 -0
- package/src/components/NavInternal/NavInternalHighlight.stories.js +36 -0
- package/src/components/NavInternal/NavInternalPanel.js +88 -0
- package/src/components/NavInternal/NavInternalPanel.stories.js +248 -0
- package/src/components/NavInternal/NavInternalSection.js +47 -0
- package/src/components/NavInternal/NavInternalSection.stories.js +55 -0
- package/src/components/SearchInput/SearchInput.js +44 -0
- package/src/components/SearchInput/SearchInput.stories.js +30 -0
- package/src/main.js +6 -0
- package/stylelint.config.js +60 -0
- package/tailwind.config.js +19 -0
- package/tsconfig.json +23 -0
- package/vite.config.js +25 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { BaseImageTemplate } from '../BaseImage/BaseImage'
|
|
2
|
+
|
|
3
|
+
export const BaseImagePlaceholderTemplate = ({
|
|
4
|
+
theme,
|
|
5
|
+
noLogo,
|
|
6
|
+
aspectRatio,
|
|
7
|
+
wrapperClass,
|
|
8
|
+
placeholder,
|
|
9
|
+
// BaseImage props
|
|
10
|
+
src,
|
|
11
|
+
srcset,
|
|
12
|
+
alt,
|
|
13
|
+
width,
|
|
14
|
+
height,
|
|
15
|
+
imageWrapperClass,
|
|
16
|
+
objectFitClass,
|
|
17
|
+
imageClass
|
|
18
|
+
}) => {
|
|
19
|
+
// interpret props
|
|
20
|
+
if (!theme) theme = 'light-theme'
|
|
21
|
+
if (!aspectRatio) aspectRatio = 'aspect-ratio-none'
|
|
22
|
+
if (!objectFitClass) objectFitClass = 'object-contain'
|
|
23
|
+
noLogo ? (noLogo = 'no-logo') : (noLogo = '')
|
|
24
|
+
let renderWrapperClass = ''
|
|
25
|
+
if (wrapperClass) renderWrapperClass = ` class="${wrapperClass}"`
|
|
26
|
+
// BaseImage rendering
|
|
27
|
+
const slot =
|
|
28
|
+
src || srcset
|
|
29
|
+
? BaseImageTemplate({
|
|
30
|
+
src: src,
|
|
31
|
+
srcset: srcset,
|
|
32
|
+
alt: alt,
|
|
33
|
+
width: width,
|
|
34
|
+
height: height,
|
|
35
|
+
imageClass: imageClass ? imageClass : '',
|
|
36
|
+
wrapperClass: imageWrapperClass ? imageWrapperClass : '',
|
|
37
|
+
objectFitClass: objectFitClass
|
|
38
|
+
})
|
|
39
|
+
: placeholder
|
|
40
|
+
? `<div>${placeholder}</div>`
|
|
41
|
+
: '<div></div>'
|
|
42
|
+
return `<div${renderWrapperClass}>
|
|
43
|
+
<div class="BaseImagePlaceholder ${theme} ${aspectRatio} ${noLogo}">
|
|
44
|
+
${slot}
|
|
45
|
+
</div>
|
|
46
|
+
</div>`
|
|
47
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { BaseImagePlaceholderTemplate } from './BaseImagePlaceholder.js'
|
|
2
|
+
import { BaseImageData } from '../BaseImage/BaseImage.stories.js'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Components/Base/BaseImagePlaceholder',
|
|
6
|
+
argTypes: {
|
|
7
|
+
aspectRatio: {
|
|
8
|
+
type: 'string',
|
|
9
|
+
description:
|
|
10
|
+
'Aspect ratio CSS class. View dropdown to see all options. More classes can be added in `/src/scss/_aspect-ratios.scss`',
|
|
11
|
+
control: {
|
|
12
|
+
type: 'select',
|
|
13
|
+
options: [
|
|
14
|
+
'aspect-ratio-none',
|
|
15
|
+
'aspect-ratio-four-five',
|
|
16
|
+
'aspect-ratio-square',
|
|
17
|
+
'aspect-ratio-one-one',
|
|
18
|
+
'aspect-ratio-two-one',
|
|
19
|
+
'aspect-ratio-two-three',
|
|
20
|
+
'aspect-ratio-three-two',
|
|
21
|
+
'aspect-ratio-sixteen-seven',
|
|
22
|
+
'aspect-ratio-sixteen-nine',
|
|
23
|
+
'aspect-ratio-twelve-nine',
|
|
24
|
+
'aspect-ratio-nine-sixteen',
|
|
25
|
+
'aspect-ratio-seven-eight',
|
|
26
|
+
'aspect-ratio-eight-seven',
|
|
27
|
+
'aspect-ratio-four-three',
|
|
28
|
+
'aspect-ratio-four-five',
|
|
29
|
+
'aspect-ratio-twentyone-nine'
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
table: {
|
|
33
|
+
defaultValue: { summary: 'aspect-ratio-none' }
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
theme: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
description: 'Theme color for the placeholder background.',
|
|
39
|
+
control: {
|
|
40
|
+
type: 'select',
|
|
41
|
+
options: ['light-theme', 'dark-theme', 'transparent-theme']
|
|
42
|
+
},
|
|
43
|
+
table: {
|
|
44
|
+
defaultValue: { summary: 'light-theme' }
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
noLogo: {
|
|
48
|
+
type: 'boolean',
|
|
49
|
+
description: 'If a JPL logo should appear when there is no image'
|
|
50
|
+
},
|
|
51
|
+
src: {
|
|
52
|
+
type: { name: 'string', required: true },
|
|
53
|
+
description: 'Passed to `BaseImage`.'
|
|
54
|
+
},
|
|
55
|
+
srcset: {
|
|
56
|
+
type: 'string',
|
|
57
|
+
description: 'Passed to `BaseImage`.'
|
|
58
|
+
},
|
|
59
|
+
alt: {
|
|
60
|
+
type: { name: 'string', required: true },
|
|
61
|
+
description: 'Passed to `BaseImage`.'
|
|
62
|
+
},
|
|
63
|
+
width: {
|
|
64
|
+
type: { name: 'number', required: true },
|
|
65
|
+
description: 'Passed to `BaseImage`.'
|
|
66
|
+
},
|
|
67
|
+
height: {
|
|
68
|
+
type: { name: 'number', required: true },
|
|
69
|
+
description: 'Passed to `BaseImage`.'
|
|
70
|
+
},
|
|
71
|
+
objectFitClass: {
|
|
72
|
+
type: 'string',
|
|
73
|
+
description:
|
|
74
|
+
"Passed to `BaseImage`. Apply a Tailwind CSS object fit class to `BaseImage` to specify how the image will scale within the placeholder's aspect ratio.",
|
|
75
|
+
control: {
|
|
76
|
+
type: 'select',
|
|
77
|
+
options: [
|
|
78
|
+
'object-none',
|
|
79
|
+
'object-contain',
|
|
80
|
+
'object-cover',
|
|
81
|
+
'object-fill',
|
|
82
|
+
'object-scale-down'
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
table: {
|
|
86
|
+
defaultValue: { summary: 'object-contain' }
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
imageClass: {
|
|
90
|
+
table: { disable: true }
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
parameters: {
|
|
94
|
+
docs: {
|
|
95
|
+
description: {
|
|
96
|
+
component: `The \`BaseImagePlaceholder\` component is designed to appear as a temporary stand-in to be replaced by an actual image.
|
|
97
|
+
|
|
98
|
+
- expects to contain an image as a child element in its primary slot
|
|
99
|
+
- provides a lazy-loading block for the image to load into
|
|
100
|
+
- can be used to maintain an aspect ratio
|
|
101
|
+
- compatible with Tailwind CSS classes, e.g. \`.rounded-lg\` to have round edges around the image. Think of it like a frame to put an image within.
|
|
102
|
+
|
|
103
|
+
## Accessibility notes
|
|
104
|
+
|
|
105
|
+
BaseImagePlaceholder is a presentational element consisting of a single \`div\` with a background image (JPL Logo), without semantic meaning, it simply prevents page load becoming janky by setting a 'placeholder' for the images that are yet to be loaded with \`loading="lazy"\` or LazySizes fallback. As such it should not need to meet color contrast requirements.
|
|
106
|
+
`
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export const Basic = BaseImagePlaceholderTemplate.bind({})
|
|
113
|
+
Basic.args = {
|
|
114
|
+
noLogo: false,
|
|
115
|
+
...BaseImageData
|
|
116
|
+
}
|
|
117
|
+
export const Default = BaseImagePlaceholderTemplate.bind({})
|
|
118
|
+
Default.args = {
|
|
119
|
+
aspectRatio: 'aspect-ratio-two-one',
|
|
120
|
+
noLogo: false
|
|
121
|
+
}
|
|
122
|
+
export const LazyLoading = BaseImagePlaceholderTemplate.bind({})
|
|
123
|
+
LazyLoading.args = {
|
|
124
|
+
noLogo: false,
|
|
125
|
+
...BaseImageData
|
|
126
|
+
}
|
|
127
|
+
LazyLoading.decorators = [
|
|
128
|
+
(Story) => `
|
|
129
|
+
<div class="max-w-full">
|
|
130
|
+
<div style="height:2500px">
|
|
131
|
+
Scroll down
|
|
132
|
+
</div>
|
|
133
|
+
<div id="storyRoot">
|
|
134
|
+
${Story()}
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
`
|
|
138
|
+
]
|
|
139
|
+
LazyLoading.parameters = {
|
|
140
|
+
html: {
|
|
141
|
+
root: '#storyRoot'
|
|
142
|
+
},
|
|
143
|
+
docs: {
|
|
144
|
+
storyDescription:
|
|
145
|
+
"`BaseImagePlaceholder` is compatible with `BaseImage`'s lazy loading behavior."
|
|
146
|
+
}
|
|
147
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { MixinAnimationCaretTemplate } from '../MixinAnimationCaret/MixinAnimationCaret'
|
|
2
|
+
import { IconArrowTemplate } from '../Icons/IconArrow'
|
|
3
|
+
import { IconDownloadTemplate } from '../Icons/IconDownload'
|
|
4
|
+
import { IconExternalTemplate } from '../Icons/IconExternal'
|
|
5
|
+
|
|
6
|
+
export const BaseLinkTemplate = ({
|
|
7
|
+
text,
|
|
8
|
+
variant,
|
|
9
|
+
link,
|
|
10
|
+
icon,
|
|
11
|
+
caret,
|
|
12
|
+
caretInline,
|
|
13
|
+
caretWrapperClass,
|
|
14
|
+
target,
|
|
15
|
+
externalTargetBlank,
|
|
16
|
+
computedClass,
|
|
17
|
+
linkClass,
|
|
18
|
+
wrapperClass
|
|
19
|
+
}) => {
|
|
20
|
+
if (!icon) icon = ''
|
|
21
|
+
let template = text ? text : 'Full Image Details'
|
|
22
|
+
let variantType = variant ? variant.toLowerCase() : ''
|
|
23
|
+
if (!caretWrapperClass) caretWrapperClass = ''
|
|
24
|
+
|
|
25
|
+
if (caretInline && caret) {
|
|
26
|
+
template = MixinAnimationCaretTemplate({
|
|
27
|
+
text,
|
|
28
|
+
customClass: 'caret-inline'
|
|
29
|
+
})
|
|
30
|
+
} else if (variantType === 'primary' || caret) {
|
|
31
|
+
template = MixinAnimationCaretTemplate({
|
|
32
|
+
text,
|
|
33
|
+
customClass: caretWrapperClass
|
|
34
|
+
})
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
let theTarget = ''
|
|
38
|
+
if (target) {
|
|
39
|
+
theTarget = target
|
|
40
|
+
} else if (link && externalTargetBlank) {
|
|
41
|
+
theTarget = '_blank'
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
let theRel = ''
|
|
45
|
+
if (theTarget === '_blank') {
|
|
46
|
+
theRel = 'noopener'
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (variantType === 'primary' || variantType === 'secondary') {
|
|
50
|
+
computedClass = `${
|
|
51
|
+
variantType === 'primary' ? '-primary' : '-secondary'
|
|
52
|
+
} text-subtitle text-action can-hover:hover:text-action-hover`
|
|
53
|
+
} else if (variantType === 'default') {
|
|
54
|
+
computedClass = '-default underline text-action can-hover:hover:text-action-hover'
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
let renderWrapperClass = ''
|
|
58
|
+
if (wrapperClass) renderWrapperClass = ` class="${wrapperClass}"`
|
|
59
|
+
|
|
60
|
+
const iconTemplate =
|
|
61
|
+
icon === 'document'
|
|
62
|
+
? IconDownloadTemplate({})
|
|
63
|
+
: icon === 'internal'
|
|
64
|
+
? IconArrowTemplate({})
|
|
65
|
+
: icon === 'external'
|
|
66
|
+
? IconExternalTemplate({})
|
|
67
|
+
: ''
|
|
68
|
+
|
|
69
|
+
return `
|
|
70
|
+
<div${renderWrapperClass}>
|
|
71
|
+
<a
|
|
72
|
+
href="${link}"
|
|
73
|
+
target="${theTarget}"
|
|
74
|
+
rel="${theRel}"
|
|
75
|
+
class="group cursor-pointer${computedClass ? ` ${computedClass}` : ''}${
|
|
76
|
+
linkClass ? ` ${linkClass}` : ''
|
|
77
|
+
}"
|
|
78
|
+
>
|
|
79
|
+
<span class="break-words">
|
|
80
|
+
${template}
|
|
81
|
+
</span>
|
|
82
|
+
${iconTemplate}
|
|
83
|
+
</a>
|
|
84
|
+
</div>
|
|
85
|
+
`
|
|
86
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { BaseLinkTemplate } from './BaseLink.js'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Components/Base/BaseLink',
|
|
5
|
+
argTypes: {
|
|
6
|
+
text: {
|
|
7
|
+
type: 'string',
|
|
8
|
+
description: 'Link text'
|
|
9
|
+
},
|
|
10
|
+
variant: {
|
|
11
|
+
type: 'string',
|
|
12
|
+
description: 'Link variant type',
|
|
13
|
+
control: {
|
|
14
|
+
type: 'select',
|
|
15
|
+
options: ['primary', 'secondary', 'default', 'none']
|
|
16
|
+
},
|
|
17
|
+
table: {
|
|
18
|
+
defaultValue: { summary: 'default' }
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
link: {
|
|
22
|
+
type: 'string',
|
|
23
|
+
description: 'Link URL'
|
|
24
|
+
},
|
|
25
|
+
target: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
description: 'Link to a target ID. Overrides `externalTargetBlank`'
|
|
28
|
+
},
|
|
29
|
+
externalTargetBlank: {
|
|
30
|
+
type: 'boolean',
|
|
31
|
+
description: 'Open link in a new window.',
|
|
32
|
+
control: {
|
|
33
|
+
type: 'boolean'
|
|
34
|
+
},
|
|
35
|
+
table: {
|
|
36
|
+
defaultValue: { summary: 'false' }
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
caret: {
|
|
40
|
+
type: 'boolean',
|
|
41
|
+
description:
|
|
42
|
+
'Display the caret. Note: the `primary` variant will always display the caret. Use this option to add a caret to other variants.',
|
|
43
|
+
control: {
|
|
44
|
+
type: 'boolean'
|
|
45
|
+
},
|
|
46
|
+
table: {
|
|
47
|
+
defaultValue: { summary: 'false' }
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
caretInline: {
|
|
51
|
+
type: 'boolean',
|
|
52
|
+
description: 'Set to `true` to have caret wrap with text. Must use with `caret: true`. ',
|
|
53
|
+
control: {
|
|
54
|
+
type: 'boolean'
|
|
55
|
+
},
|
|
56
|
+
table: {
|
|
57
|
+
defaultValue: { summary: 'false' }
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
parameters: {
|
|
62
|
+
viewMode: 'docs',
|
|
63
|
+
docs: {
|
|
64
|
+
description: {
|
|
65
|
+
component: 'Simple link with several style variations.'
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export const Default = BaseLinkTemplate.bind({})
|
|
72
|
+
Default.storyName = 'Primary'
|
|
73
|
+
Default.args = {
|
|
74
|
+
text: 'Explore',
|
|
75
|
+
variant: 'primary',
|
|
76
|
+
link: '#',
|
|
77
|
+
target: '',
|
|
78
|
+
externalTargetBlank: false,
|
|
79
|
+
caret: false,
|
|
80
|
+
caretInline: false
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export const Secondary = BaseLinkTemplate.bind({})
|
|
84
|
+
Secondary.args = {
|
|
85
|
+
text: 'Explore',
|
|
86
|
+
variant: 'secondary',
|
|
87
|
+
link: '#',
|
|
88
|
+
target: '',
|
|
89
|
+
externalTargetBlank: false,
|
|
90
|
+
caret: false,
|
|
91
|
+
caretInline: false
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export const Default_Body = BaseLinkTemplate.bind({})
|
|
95
|
+
Default_Body.args = {
|
|
96
|
+
text: 'Explore',
|
|
97
|
+
variant: 'default',
|
|
98
|
+
link: '#',
|
|
99
|
+
target: '',
|
|
100
|
+
externalTargetBlank: false,
|
|
101
|
+
caret: false,
|
|
102
|
+
caretInline: false
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export const Unstyled = BaseLinkTemplate.bind({})
|
|
106
|
+
Unstyled.args = {
|
|
107
|
+
text: 'Explore',
|
|
108
|
+
variant: 'none',
|
|
109
|
+
link: '#',
|
|
110
|
+
target: '',
|
|
111
|
+
externalTargetBlank: false,
|
|
112
|
+
caret: false,
|
|
113
|
+
caretInline: false
|
|
114
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { FooterInternalContactListTemplate } from '../FooterInternal/FooterInternalContactList'
|
|
2
|
+
import { BaseButtonTemplate } from '../BaseButton/BaseButton'
|
|
3
|
+
import { BaseLinkTemplate } from '../BaseLink/BaseLink'
|
|
4
|
+
|
|
5
|
+
export const FooterInternalTemplate = ({ siteEditors, siteManagers, dateUpdated, version }) => {
|
|
6
|
+
// prop defaults
|
|
7
|
+
if (!siteEditors) siteEditors = []
|
|
8
|
+
if (!siteManagers) siteManagers = []
|
|
9
|
+
if (!dateUpdated) dateUpdated = ''
|
|
10
|
+
if (!version) version = ''
|
|
11
|
+
|
|
12
|
+
return `
|
|
13
|
+
<footer class="FooterInternal ThemeInternal ThemeVariantDark bg-gray-dark text-white">
|
|
14
|
+
<div class="lg:BaseGrid container mx-auto pt-10">
|
|
15
|
+
<div class="indent-col-base indent-col-2">
|
|
16
|
+
${
|
|
17
|
+
siteEditors.length > 0
|
|
18
|
+
? FooterInternalContactListTemplate({
|
|
19
|
+
title: 'Site Editors',
|
|
20
|
+
items: siteEditors
|
|
21
|
+
})
|
|
22
|
+
: ''
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
${
|
|
26
|
+
siteManagers.length > 0
|
|
27
|
+
? FooterInternalContactListTemplate({
|
|
28
|
+
title: 'Site Managers',
|
|
29
|
+
items: siteManagers
|
|
30
|
+
})
|
|
31
|
+
: ''
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
${
|
|
35
|
+
dateUpdated
|
|
36
|
+
? `<div class="text-body-sm mb-2">
|
|
37
|
+
<b>Page Last Updated:</b>
|
|
38
|
+
${dateUpdated}
|
|
39
|
+
</div>`
|
|
40
|
+
: ''
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
${
|
|
44
|
+
version
|
|
45
|
+
? `<div class="mb-2">
|
|
46
|
+
<b>Site Version:</b>
|
|
47
|
+
${version}
|
|
48
|
+
</div>`
|
|
49
|
+
: ''
|
|
50
|
+
}
|
|
51
|
+
<p class="my-8 text-body-xs font-secondary -tracking-[0.03rem] xl:w-1/2">JPL is a federally funded research and development center staffed and managed for NASA by Caltech.</p>
|
|
52
|
+
<div class="more-sites mb-4">
|
|
53
|
+
<h2 class="text-subtitle mb-4">More Sites</h2>
|
|
54
|
+
<ul class="inline-block lg:flex lg:flex-wrap">
|
|
55
|
+
<li class="mb-2 lg:mb-8 lg:mr-8">
|
|
56
|
+
${BaseButtonTemplate({
|
|
57
|
+
variant: 'dark',
|
|
58
|
+
label: 'JPL',
|
|
59
|
+
link: 'https://www.jpl.nasa.gov/',
|
|
60
|
+
icon: 'external',
|
|
61
|
+
cssClass: 'hidden lg:inline-block',
|
|
62
|
+
target: '_blank'
|
|
63
|
+
})}
|
|
64
|
+
${BaseLinkTemplate({
|
|
65
|
+
variant: 'none',
|
|
66
|
+
text: 'JPL',
|
|
67
|
+
link: 'https://www.jpl.nasa.gov/',
|
|
68
|
+
icon: 'external',
|
|
69
|
+
linkClass:
|
|
70
|
+
'flex flex-nowrap items-baseline lg:hidden text-jpl-action can-hover:hover:text-action-dark',
|
|
71
|
+
target: '_blank'
|
|
72
|
+
})}
|
|
73
|
+
</li>
|
|
74
|
+
<li class="mb-2 lg:mb-8 lg:mr-8">
|
|
75
|
+
${BaseButtonTemplate({
|
|
76
|
+
variant: 'dark',
|
|
77
|
+
label: 'JPL Space',
|
|
78
|
+
link: 'https://js.jpl.nasa.gov/',
|
|
79
|
+
icon: 'external',
|
|
80
|
+
cssClass: 'hidden lg:inline-block',
|
|
81
|
+
target: '_blank'
|
|
82
|
+
})}
|
|
83
|
+
${BaseLinkTemplate({
|
|
84
|
+
variant: 'none',
|
|
85
|
+
text: 'JPL Space',
|
|
86
|
+
link: 'https://js.jpl.nasa.gov/',
|
|
87
|
+
icon: 'external',
|
|
88
|
+
linkClass:
|
|
89
|
+
'flex flex-nowrap items-center lg:hidden text-jpl-action can-hover:hover:text-action-dark',
|
|
90
|
+
target: '_blank'
|
|
91
|
+
})}
|
|
92
|
+
</li>
|
|
93
|
+
<li class="mb-2 lg:mb-8 lg:mr-8">
|
|
94
|
+
${BaseButtonTemplate({
|
|
95
|
+
variant: 'dark',
|
|
96
|
+
label: 'Caltech',
|
|
97
|
+
link: 'https://www.caltech.edu/',
|
|
98
|
+
icon: 'external',
|
|
99
|
+
cssClass: 'hidden lg:inline-block',
|
|
100
|
+
target: '_blank'
|
|
101
|
+
})}
|
|
102
|
+
${BaseLinkTemplate({
|
|
103
|
+
variant: 'none',
|
|
104
|
+
text: 'Caltech',
|
|
105
|
+
link: 'https://www.caltech.edu/',
|
|
106
|
+
icon: 'external',
|
|
107
|
+
linkClass:
|
|
108
|
+
'flex flex-nowrap items-center lg:hidden text-action can-hover:hover:text-action-dark',
|
|
109
|
+
target: '_blank'
|
|
110
|
+
})}
|
|
111
|
+
</li>
|
|
112
|
+
<li class="mb-2 lg:mb-8 lg:mr-8">
|
|
113
|
+
${BaseButtonTemplate({
|
|
114
|
+
variant: 'dark',
|
|
115
|
+
label: 'NASA',
|
|
116
|
+
link: 'https://www.nasa.gov/',
|
|
117
|
+
icon: 'external',
|
|
118
|
+
cssClass: 'hidden lg:inline-block',
|
|
119
|
+
target: '_blank'
|
|
120
|
+
})}
|
|
121
|
+
${BaseLinkTemplate({
|
|
122
|
+
variant: 'none',
|
|
123
|
+
text: 'NASA',
|
|
124
|
+
link: 'https://www.nasa.gov/',
|
|
125
|
+
icon: 'external',
|
|
126
|
+
linkClass:
|
|
127
|
+
'flex flex-nowrap items-center lg:hidden text-jpl-action can-hover:hover:text-action-dark',
|
|
128
|
+
target: '_blank'
|
|
129
|
+
})}
|
|
130
|
+
</li>
|
|
131
|
+
</ul>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
<div class="bg-white/10">
|
|
136
|
+
<div class="lg:BaseGrid container mx-auto py-4">
|
|
137
|
+
<div class="indent-col-base indent-col-2 text-body-xs font-secondary -tracking-[0.03rem]">
|
|
138
|
+
Information in this system is sensitive and must be handled in accordance with all applicable rules. See
|
|
139
|
+
<div class="inline-block mr-1">
|
|
140
|
+
${BaseLinkTemplate({
|
|
141
|
+
variant: 'none',
|
|
142
|
+
text: 'Marking & Handling',
|
|
143
|
+
link: 'https://mh.jpl.nasa.gov',
|
|
144
|
+
icon: 'external',
|
|
145
|
+
wrapperClass: 'inline',
|
|
146
|
+
linkClass: 'flex flex-nowrap items-center text-blue-200 can-hover:hover:text-action',
|
|
147
|
+
target: '_blank'
|
|
148
|
+
})}
|
|
149
|
+
</div>
|
|
150
|
+
for more information.
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
</footer>
|
|
155
|
+
`
|
|
156
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { FooterInternalTemplate } from './FooterInternal'
|
|
2
|
+
|
|
3
|
+
const contactListData = [
|
|
4
|
+
{
|
|
5
|
+
name: 'Lorem Ipsum',
|
|
6
|
+
email: '#'
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
name: 'Dolor Sit-Amet',
|
|
10
|
+
email: '#'
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
title: 'Internal Footer',
|
|
16
|
+
argTypes: {
|
|
17
|
+
siteEditors: {
|
|
18
|
+
type: { name: 'array', required: false },
|
|
19
|
+
description: 'Array of site editors. Object should include a `name` and `email`.'
|
|
20
|
+
},
|
|
21
|
+
siteManagers: {
|
|
22
|
+
type: { name: 'array', required: false },
|
|
23
|
+
description: 'Array of site editors. Object should include a `name` and `email`.'
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
parameters: {
|
|
27
|
+
// viewMode: 'story',
|
|
28
|
+
docs: {
|
|
29
|
+
description: {
|
|
30
|
+
component: 'Simple footer with preset links.'
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const Default = FooterInternalTemplate.bind({})
|
|
37
|
+
Default.storyName = 'For Internal Sites'
|
|
38
|
+
Default.args = {
|
|
39
|
+
siteEditors: contactListData,
|
|
40
|
+
siteManagers: contactListData,
|
|
41
|
+
dateUpdated: 'July 28, 2022',
|
|
42
|
+
version: '1.0'
|
|
43
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { BaseLinkTemplate } from '../BaseLink/BaseLink'
|
|
2
|
+
|
|
3
|
+
export const FooterInternalContactListTemplate = ({ title, items }) => {
|
|
4
|
+
// prop defaults
|
|
5
|
+
if (!title) title = ''
|
|
6
|
+
if (!items) items = []
|
|
7
|
+
|
|
8
|
+
let itemsTemplate = ''
|
|
9
|
+
if (items.length > 0) {
|
|
10
|
+
itemsTemplate = '<ul class="flex flex-wrap">'
|
|
11
|
+
for (const [index, item] of items.entries()) {
|
|
12
|
+
itemsTemplate += `<li class="flex flex-nowrap mr-2">${BaseLinkTemplate({
|
|
13
|
+
variant: 'none',
|
|
14
|
+
linkClass: 'text-blue-300 can-hover:hover:text-action',
|
|
15
|
+
text: item.name,
|
|
16
|
+
link: `mailto:${item.email}`
|
|
17
|
+
})}
|
|
18
|
+
${index + 1 === items.length ? '' : ','}
|
|
19
|
+
</li>`
|
|
20
|
+
}
|
|
21
|
+
itemsTemplate += `</ul>`
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return `
|
|
25
|
+
<div class="mb-2 flex flex-wrap text-body-sm">
|
|
26
|
+
<strong class="mr-2">${title}:</strong>
|
|
27
|
+
${itemsTemplate}
|
|
28
|
+
</div>
|
|
29
|
+
`
|
|
30
|
+
}
|