Skip to content

Commit c27d652

Browse files
Feature: migrating www components (#455)
* adding all icons, adding HeroMedia and related mixins and stores * adding pinia store to nuxt module * porting over all blocks * fixing the majority of components * porting over remaining components * fixing BaseTimer story * adding PageContent * adding plugins to nuxt module * removing queries from explorer-1 components * testing more components in the nuxt module * fixing NavMobile components * fixing store action highlightPrimary * moving PageError to www * lint * fixing bottom border on main navigation
1 parent 428feed commit c27d652

File tree

374 files changed

+28809
-542
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

374 files changed

+28809
-542
lines changed

apps/vue-storybook/.storybook/preview.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,26 @@ import useMockComponents from './_mock-components.js'
44
import { StoryContext } from '@storybook/types'
55
import { VueRenderer, setup, type Preview } from '@storybook/vue3'
66
import { Swiper, SwiperSlide } from 'swiper/vue'
7+
import vClickOutside from 'click-outside-vue3'
8+
import VueCompareImage from 'vue3-compare-image'
9+
import { createPinia } from 'pinia'
10+
import filters from '@explorer-1/vue/src/utils/filters'
711
import '@explorer-1/common-storybook/src/config/canvas.css'
812
import '@explorer-1/vue/src/assets/scss/styles.scss'
9-
1013
import { withGlobals, globalTypes } from '@explorer-1/common-storybook/src/config/withGlobals'
14+
15+
const pinia = createPinia()
16+
1117
setup((app: App, context?: StoryContext<VueRenderer>) => {
18+
app.use(pinia)
19+
app.use(vClickOutside)
20+
app.use(VueCompareImage)
1221
app.component('Swiper', Swiper)
1322
app.component('SwiperSlide', SwiperSlide)
23+
app.config.globalProperties.$filters = filters
1424
useMockComponents(app)
1525
})
26+
1627
const preview: Preview = {
1728
globalTypes,
1829

apps/vue-storybook/components.d.ts

Lines changed: 229 additions & 0 deletions
Large diffs are not rendered by default.

apps/vue-storybook/package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.0.0",
44
"private": true,
55
"prettier": "@explorer-1/prettier-config",
6+
"type": "module",
67
"scripts": {
78
"dev": "pnpm run storybook",
89
"storybook": "storybook dev -c .storybook -p 6006 --ci",
@@ -16,8 +17,10 @@
1617
"dependencies": {
1718
"@fancyapps/ui": "^4.0.26",
1819
"@tailwindcss/forms": "^0.5.7",
20+
"click-outside-vue3": "^4.0.1",
1921
"swiper": "^11.1.3",
20-
"vue": "^3.2.47"
22+
"vue": "^3.2.47",
23+
"vue3-compare-image": "^1.2.5"
2124
},
2225
"devDependencies": {
2326
"@explorer-1/common": "workspace:*",
@@ -37,6 +40,7 @@
3740
"autoprefixer": "^10.4.19",
3841
"msw": "^2.3.0",
3942
"msw-storybook-addon": "^2.0.2",
43+
"pinia": "^2.1.7",
4044
"postcss": "^8.4.38",
4145
"postcss-import": "^16.1.0",
4246
"rimraf": "^5.0.5",
@@ -45,6 +49,7 @@
4549
"tailwindcss": "^3.4.3",
4650
"ts-node": "^10.9.2",
4751
"typescript": "^5.2.2",
52+
"unplugin-vue-components": "^0.27.0",
4853
"vite": "^5.2.0",
4954
"vue-tsc": "^2.0.6"
5055
}

apps/vue-storybook/stories/Icons.stories.ts

Lines changed: 0 additions & 49 deletions
This file was deleted.
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
import AsteroidWatchWidget from '@explorer-1/vue/src/components/AsteroidWatchWidget/AsteroidWatchWidget.vue'
2+
3+
export default {
4+
title: 'Components/AsteroidWatchWidget',
5+
component: AsteroidWatchWidget,
6+
excludeStories: /.*Data$/,
7+
decorators: [
8+
() => ({
9+
template: `<div id="storyDecorator" class="mt-20"><story/></div>`
10+
})
11+
],
12+
parameters: {
13+
html: {
14+
root: '#storyDecorator' // to omit decorators from html output
15+
}
16+
},
17+
argTypes: {
18+
status: {
19+
control: { type: 'text' }
20+
}
21+
}
22+
}
23+
24+
export const AsteroidWatchWidgetData = {
25+
nextCloseApproaches: [
26+
{
27+
name: '(2008 YN2)',
28+
date: '2024-06-05',
29+
sizeFeet: 61,
30+
sizeMeters: 19,
31+
distanceMiles: 2500000,
32+
distanceKilometers: 4020000,
33+
externalLink: 'https://ssd.jpl.nasa.gov/tools/sbdb_lookup.html#/?sstr=2008%20YN2&view=VOP',
34+
comparisonImage: {
35+
image: {
36+
webp: {
37+
url: 'https://d2pn8kiwq2w21t.cloudfront.net/images/asteroid_watchmanagem.2e16d0ba.fill-320x320.format-webp_mp07rlQ.webp',
38+
__typename: 'CustomRendition'
39+
},
40+
src: {
41+
url: 'https://d2pn8kiwq2w21t.cloudfront.net/images/asteroid_watchmanagementcommandsda.2e16d0ba.fill-320x320_5YFe2jp.png',
42+
__typename: 'CustomRendition'
43+
},
44+
__typename: 'CustomImage'
45+
},
46+
text: 'HOUSE-SIZE',
47+
__typename: 'AsteroidSizeComparison'
48+
},
49+
__typename: 'AsteroidApproach'
50+
},
51+
{
52+
name: '(2024 JR17)',
53+
date: '2024-06-05',
54+
sizeFeet: 260,
55+
sizeMeters: 80,
56+
distanceMiles: 4600000,
57+
distanceKilometers: 7400000,
58+
externalLink: 'https://ssd.jpl.nasa.gov/tools/sbdb_lookup.html#/?sstr=2024%20JR17&view=VOP',
59+
comparisonImage: {
60+
image: {
61+
webp: {
62+
url: 'https://d2pn8kiwq2w21t.cloudfront.net/images/asteroid_watchmanagem.2e16d0ba.fill-320x320.format-webp_miCwBak.webp',
63+
__typename: 'CustomRendition'
64+
},
65+
src: {
66+
url: 'https://d2pn8kiwq2w21t.cloudfront.net/images/asteroid_watchmanagementcommandsda.2e16d0ba.fill-320x320_XtfVXBr.png',
67+
__typename: 'CustomRendition'
68+
},
69+
__typename: 'CustomImage'
70+
},
71+
text: 'BUILDING-SIZE',
72+
__typename: 'AsteroidSizeComparison'
73+
},
74+
__typename: 'AsteroidApproach'
75+
},
76+
{
77+
name: '(2021 LW3)',
78+
date: '2024-06-06',
79+
sizeFeet: 270,
80+
sizeMeters: 82,
81+
distanceMiles: 2310000,
82+
distanceKilometers: 3710000,
83+
externalLink: 'https://ssd.jpl.nasa.gov/tools/sbdb_lookup.html#/?sstr=2021%20LW3&view=VOP',
84+
comparisonImage: {
85+
image: {
86+
webp: {
87+
url: 'https://d2pn8kiwq2w21t.cloudfront.net/images/asteroid_watchmanagem.2e16d0ba.fill-320x320.format-webp_miCwBak.webp',
88+
__typename: 'CustomRendition'
89+
},
90+
src: {
91+
url: 'https://d2pn8kiwq2w21t.cloudfront.net/images/asteroid_watchmanagementcommandsda.2e16d0ba.fill-320x320_XtfVXBr.png',
92+
__typename: 'CustomRendition'
93+
},
94+
__typename: 'CustomImage'
95+
},
96+
text: 'BUILDING-SIZE',
97+
__typename: 'AsteroidSizeComparison'
98+
},
99+
__typename: 'AsteroidApproach'
100+
},
101+
{
102+
name: '(2024 LA)',
103+
date: '2024-06-07',
104+
sizeFeet: 77,
105+
sizeMeters: 24,
106+
distanceMiles: 1120000,
107+
distanceKilometers: 1800000,
108+
externalLink: 'https://ssd.jpl.nasa.gov/tools/sbdb_lookup.html#/?sstr=2024%20LA&view=VOP',
109+
comparisonImage: {
110+
image: {
111+
webp: {
112+
url: 'https://d2pn8kiwq2w21t.cloudfront.net/images/asteroid_watchmanagem.2e16d0ba.fill-320x320.format-webp_frsqFOl.webp',
113+
__typename: 'CustomRendition'
114+
},
115+
src: {
116+
url: 'https://d2pn8kiwq2w21t.cloudfront.net/images/asteroid_watchmanagementcommandsda.2e16d0ba.fill-320x320_QiuTjYV.png',
117+
__typename: 'CustomRendition'
118+
},
119+
__typename: 'CustomImage'
120+
},
121+
text: 'AIRPLANE-SIZE',
122+
__typename: 'AsteroidSizeComparison'
123+
},
124+
__typename: 'AsteroidApproach'
125+
},
126+
{
127+
name: '(2024 KA1)',
128+
date: '2024-06-07',
129+
sizeFeet: 95,
130+
sizeMeters: 29,
131+
distanceMiles: 1170000,
132+
distanceKilometers: 1880000,
133+
externalLink: 'https://ssd.jpl.nasa.gov/tools/sbdb_lookup.html#/?sstr=2024%20KA1&view=VOP',
134+
comparisonImage: {
135+
image: {
136+
webp: {
137+
url: 'https://d2pn8kiwq2w21t.cloudfront.net/images/asteroid_watchmanagem.2e16d0ba.fill-320x320.format-webp_frsqFOl.webp',
138+
__typename: 'CustomRendition'
139+
},
140+
src: {
141+
url: 'https://d2pn8kiwq2w21t.cloudfront.net/images/asteroid_watchmanagementcommandsda.2e16d0ba.fill-320x320_QiuTjYV.png',
142+
__typename: 'CustomRendition'
143+
},
144+
__typename: 'CustomImage'
145+
},
146+
text: 'AIRPLANE-SIZE',
147+
__typename: 'AsteroidSizeComparison'
148+
},
149+
__typename: 'AsteroidApproach'
150+
}
151+
]
152+
}
153+
154+
export const Base = {
155+
args: AsteroidWatchWidgetData
156+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import BackToTop from '@explorer-1/vue/src/components/BackToTop/BackToTop.vue'
2+
3+
export default {
4+
title: 'Components/Utilities/BackToTop',
5+
component: BackToTop
6+
}
7+
8+
// template
9+
const BackToTopTemplate = (args) => ({
10+
components: { BackToTop },
11+
setup() {
12+
return { args }
13+
},
14+
template: `
15+
<div style="height: 2000px;"><div class="fixed">Will appear here on scroll: <BackToTop v-show="true" v-bind="args" /></div></div>
16+
`
17+
})
18+
19+
export const Default = BackToTopTemplate.bind({})
20+
Default.storyName = 'BackToTop'
21+
Default.args = {
22+
threshhold: 300,
23+
scrollTo: 0
24+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import BaseAudio from '@explorer-1/vue/src/components/BaseAudio/BaseAudio.vue'
2+
3+
export default {
4+
title: 'Components/Base/BaseAudio',
5+
component: BaseAudio,
6+
decorators: [
7+
() => ({
8+
template: `<div id="storyDecorator" class="bg-black p-4 pb-5"><story/></div>`
9+
})
10+
],
11+
parameters: {
12+
html: {
13+
root: '#storyDecorator'
14+
}
15+
},
16+
excludeStories: /.*Data$/
17+
}
18+
19+
// shared data
20+
export const BaseAudioData = {
21+
file: 'http://127.0.0.1:9000/media/media/05_Da_Funk_Call_Out_Research_Hook.mp3',
22+
autoPlay: false,
23+
loop: false
24+
}
25+
26+
export const Base = {
27+
name: 'BaseAudio', // single story hoisting
28+
args: BaseAudioData
29+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs'
2+
import BaseCheckboxGroup from '@explorer-1/vue/src/components/BaseCheckboxGroup/BaseCheckboxGroup.vue'
3+
4+
<Meta
5+
title="Components/Base/BaseCheckboxGroup"
6+
component={BaseCheckboxGroup}
7+
parameters={{ viewMode: 'docs' }}
8+
/>
9+
10+
export const BaseCheckboxGroupData = {
11+
options: [
12+
{
13+
id: 'educators',
14+
title: 'Educators',
15+
text: null
16+
},
17+
{
18+
id: 'educator-workshop',
19+
title: 'Educators Workshops',
20+
text: 'Southern California'
21+
},
22+
{
23+
id: 'students',
24+
title: 'Students K-12',
25+
text: null
26+
},
27+
{
28+
id: 'internships',
29+
title: 'Internships',
30+
text: null
31+
}
32+
],
33+
group: 'edumail',
34+
heading: 'JPL Education Groups',
35+
subHeading:
36+
'The JPL Education Office also offers email updates about classroom activities and workshops for educators, projects and competitons for K-12 students and internship opportunities at JPL and NASA.',
37+
title: 'Education Email Groups'
38+
}
39+
40+
export const BaseCheckboxGroupTemplate = (args) => ({
41+
props: Object.keys(args),
42+
components: { BaseCheckboxGroup },
43+
template: `<BaseCheckboxGroup :options="options" :group="group" :heading="heading" :sub-heading="subHeading" :title="title"
44+
></BaseCheckboxGroup>`
45+
})
46+
47+
# Base Checkbox Group
48+
49+
## Usage
50+
51+
The BaseCheckboxGroup component is expected to contain an array of options and a grouping name with the goal of selecting multiple options.
52+
53+
<Canvas>
54+
<Story
55+
name="Default"
56+
args={BaseCheckboxGroupData}
57+
>
58+
{BaseCheckboxGroupTemplate.bind({})}
59+
</Story>
60+
</Canvas>
61+
62+
## Props
63+
64+
<ArgsTable for={BaseCheckboxGroup} />
65+
66+
## Example data
67+
68+
<code language="json">{JSON.stringify(BaseCheckboxGroupData, null, 2)}</code>

0 commit comments

Comments
 (0)