Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: consolidate components and docs into one Storybook #494

Merged
merged 15 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions apps/html-storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"lint:fix": "eslint .storybook --fix",
"build": "pnpm run prepare && storybook build -c .storybook -o storybook_compiled",
"percy": "percy storybook http://localhost:7007",
"percy:dry-run": "percy storybook http://localhost:7007 --dry-run"
"percy:dry-run": "percy storybook http://localhost:7007 --dry-run",
"update:storybook": "npx storybook@latest upgrade --package-manager pnpm"
},
"dependencies": {
"@fancyapps/ui": "^4.0.26",
Expand All @@ -41,24 +42,24 @@
"@percy/cli": "^1.28.6",
"@percy/storybook": "^6.0.0",
"@rushstack/eslint-patch": "^1.2.0",
"@storybook/addon-a11y": "^8.2.1",
"@storybook/addon-docs": "^8.2.1",
"@storybook/addon-essentials": "^8.2.1",
"@storybook/addon-links": "^8.2.1",
"@storybook/addon-viewport": "^8.2.1",
"@storybook/html": "^8.2.1",
"@storybook/html-vite": "^8.2.1",
"@storybook/manager-api": "^8.2.1",
"@storybook/preview-api": "^8.2.1",
"@storybook/theming": "^8.2.1",
"@storybook/addon-a11y": "^8.2.4",
"@storybook/addon-docs": "^8.2.4",
"@storybook/addon-essentials": "^8.2.4",
"@storybook/addon-links": "^8.2.4",
"@storybook/addon-viewport": "^8.2.4",
"@storybook/html": "^8.2.4",
"@storybook/html-vite": "^8.2.4",
"@storybook/manager-api": "^8.2.4",
"@storybook/preview-api": "^8.2.4",
"@storybook/theming": "^8.2.4",
"@whitespace/storybook-addon-html": "^6.1.1",
"autoprefixer": "^10.4.19",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.38",
"postcss-import": "^16.1.0",
"remark-gfm": "^4.0.0",
"rimraf": "^5.0.5",
"storybook": "^8.2.1",
"storybook": "^8.2.4",
"tailwindcss": "^3.4.3",
"ts-node": "^10.9.2",
"tslib": "^2.6.2",
Expand Down
6 changes: 0 additions & 6 deletions apps/vue-storybook/.storybook/manager-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@
color: inherit !important;
}

/* www should be in uppercase */
.sidebar-item#www {
text-transform: uppercase;
}

/* create illusion of hrs between sidebar sections */
.sidebar-item#www,
.sidebar-item#appendix {
border-radius: 0;
border-top: 2px solid rgba(0, 0, 0, 0.1);
Expand Down
18 changes: 15 additions & 3 deletions apps/vue-storybook/.storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,26 @@ const preview: Preview = {
'Getting Started',
['Developer'],
'Guides',
'Foundation',
'Foundations',
[
'Colors',
'Typography',
'Icons',
'Logos',
'Themes',
'Grid and Layout',
['Docs'],
'Responsive Design'
],
'Navigation',
[
'Overview',
'Headers',
['Overview', 'WWW'],
'Footers',
['Overview', 'WWW'],
'Secondary Navigation'
],
'Global Layout',
[
'Overview',
Expand All @@ -139,7 +149,7 @@ const preview: Preview = {
'Blocks',
['Overview', 'Heroes', ['Overview', 'Small', 'Medium', 'Large']],
'Heroes',
['*', 'HeroMedia', 'HeroListingIndex'],
['Overview', 'HeroSmall', 'HeroMedium', 'HeroLarge', 'HeroMedia', 'HeroListingIndex'],
'Forms',
['Overview', 'TextInput', 'TextArea'],
'Search',
Expand All @@ -149,7 +159,9 @@ const preview: Preview = {
'Utilities',
['Overview', '*'],
'EDU'
]
],
'Mixins',
['Overview']
]
}
}
Expand Down
19 changes: 11 additions & 8 deletions apps/vue-storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"start": "http-server storybook_compiled -p 6006 -c-1 -s",
"test": "test-storybook --stories-json --maxWorkers=4",
"test:cross-browser": "test-storybook --stories-json --verbose --maxWorkers=4 --browsers chromium webkit firefox",
"test:ci": "test-storybook --stories-json --maxWorkers=4"
"test:ci": "test-storybook --stories-json --maxWorkers=4",
"update:storybook": "npx storybook@latest upgrade --package-manager pnpm"
},
"dependencies": {
"@explorer-1/common": "workspace:*",
Expand All @@ -49,13 +50,15 @@
"@explorer-1/prettier-config": "workspace:*",
"@explorer-1/tsconfig": "workspace:*",
"@rushstack/eslint-patch": "^1.2.0",
"@storybook/addon-a11y": "^8.2.1",
"@storybook/addon-essentials": "^8.2.1",
"@storybook/blocks": "^8.2.1",
"@storybook/addon-a11y": "^8.2.4",
"@storybook/addon-essentials": "^8.2.4",
"@storybook/blocks": "^8.2.4",
"@storybook/manager-api": "^8.2.4",
"@storybook/preview-api": "^8.2.4",
"@storybook/test-runner": "^0.19.0",
"@storybook/theming": "^8.2.1",
"@storybook/vue3": "^8.2.1",
"@storybook/vue3-vite": "^8.2.1",
"@storybook/theming": "^8.2.4",
"@storybook/vue3": "^8.2.4",
"@storybook/vue3-vite": "^8.2.4",
"@vitejs/plugin-vue": "^5.0.4",
"@vue/eslint-config-prettier": "^7.1.0",
"@whitespace/storybook-addon-html": "^6.1.1",
Expand All @@ -69,7 +72,7 @@
"postcss": "^8.4.38",
"postcss-import": "^16.1.0",
"rimraf": "^5.0.5",
"storybook": "^8.2.1",
"storybook": "^8.2.4",
"storybook-addon-vue-slots": "^0.9.29",
"tailwindcss": "^3.4.3",
"ts-node": "^10.9.2",
Expand Down
2 changes: 2 additions & 0 deletions packages/vue/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ declare module 'vue' {
ShareButtonsEdu: typeof import('./src/components/ShareButtonsEdu/ShareButtonsEdu.vue')['default']
SkipLink: typeof import('./src/components/SkipLink/SkipLink.vue')['default']
SwimlaneCTA: typeof import('./src/components/SwimlaneCTA/SwimlaneCTA.vue')['default']
TextArea: typeof import('./src/components/TextArea/TextArea.vue')['default']
TextInput: typeof import('./src/components/TextInput/TextInput.vue')['default']
TheFooter: typeof import('./src/components/TheFooter/TheFooter.vue')['default']
TheFooterSignUp: typeof import('./src/components/TheFooter/TheFooterSignUp.vue')['default']
ThumbnailCarousel: typeof import('./src/components/ThumbnailCarousel/ThumbnailCarousel.vue')['default']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import AsteroidWatchWidget from './AsteroidWatchWidget.vue'

export default {
title: 'Components/AsteroidWatchWidget',
title: 'Components/WWW/AsteroidWatchWidget',
component: AsteroidWatchWidget,
excludeStories: /.*Data$/,
decorators: [
Expand Down Expand Up @@ -151,6 +151,6 @@ export const AsteroidWatchWidgetData = {
]
}

export const Base = {
export const BaseStory = {
args: AsteroidWatchWidgetData
}
6 changes: 3 additions & 3 deletions packages/vue/src/components/BackToTop/BackToTop.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ const BackToTopTemplate = (args) => ({
`
})

export const Default = BackToTopTemplate.bind({})
Default.storyName = 'BackToTop'
Default.args = {
export const BaseStory = BackToTopTemplate.bind({})
BaseStory.storyName = 'BackToTop'
BaseStory.args = {
threshhold: 300,
scrollTo: 0
}
2 changes: 1 addition & 1 deletion packages/vue/src/components/BaseAudio/BaseAudio.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const BaseAudioData = {
loop: false
}

export const Base = {
export const BaseStory = {
name: 'BaseAudio', // single story hoisting
args: BaseAudioData
}
5 changes: 3 additions & 2 deletions packages/vue/src/components/BaseButton/BaseButton.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
tags: ['autodocs'],
parameters: {
slots: {
default: 'Default slot content'
default: 'BaseStory slot content'
},
docs: {
description: {
Expand Down Expand Up @@ -45,7 +45,8 @@ export const BaseButtonData = {
default: 'Button'
}

export const PrimaryButton = {
export const BaseStory = {
name: 'Primary Button',
args: {
...BaseButtonData,
variant: 'primary'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import BaseCheckboxGroup from './BaseCheckboxGroup.vue'

export default {
title: 'Components/Base/BaseCheckboxGroup',
component: BaseCheckboxGroup
}

// stories
export const BaseStory = {
args: {
options: [
{
id: 'educators',
title: 'Educators',
text: null
},
{
id: 'educator-workshop',
title: 'Educators Workshops',
text: 'Southern California'
},
{
id: 'students',
title: 'Students K-12',
text: null
},
{
id: 'internships',
title: 'Internships',
text: null
}
],
group: 'edumail',
heading: 'JPL Education Groups',
subHeading:
'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.',
title: 'Education Email Groups'
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default {
},
parameters: {
slots: {
default: 'Default slot content'
default: 'BaseStory slot content'
},
viewMode: 'docs',
docs: {
Expand All @@ -36,7 +36,7 @@ export default {
}

// stories
export const H1 = {
export const BaseStory = {
name: 'H1',
args: { size: 'h1', level: 'h1', default: 'Heading 1' }
}
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/src/components/BaseImage/BaseImage.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const BaseImageData = {
objectFitClass: 'contain'
}
// stories
export const Default = {
export const BaseStory = {
args: BaseImageData,
decorators: [() => ({ template: '<div class="max-w-full"><story /></div>' })]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const BaseImageCaptionData = {
detailUrl: '/image-detail/slug/'
}

export const Default = {
export const BaseStory = {
args: {
data: BaseImageCaptionData
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export const BaseImagePlaceholderData = {
}

export const WithImage = {
name: 'With Image',
args: {
...BaseImagePlaceholderData,
BaseImageProps: {
Expand All @@ -55,7 +56,8 @@ export const WithImage = {
}
}
}
export const NoImage = {
export const BaseStory = {
name: 'No Image',
args: {
...BaseImagePlaceholderData,
BaseImageProps: {
Expand Down
5 changes: 3 additions & 2 deletions packages/vue/src/components/BaseLink/BaseLink.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
component: BaseLink,
parameters: {
slots: {
default: 'Default slot content'
default: 'BaseStory slot content'
}
},
argTypes: {
Expand All @@ -27,7 +27,8 @@ export const BaseLinkData = {
}

// stories
export const Primary = {
export const BaseStory = {
name: 'Primary',
args: { ...BaseLinkData }
}

Expand Down
Loading
Loading