-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(storybook): add root level storybook instance for landing page (#…
…358) * feat(sb): add root level storybook for framework composition * chore(sb): update welcome page * chore(sb): update welcome page styles and content * chore(sb): update labs index styles; update gh-pages publish * Update .github/workflows/storybook-publish.yml Co-authored-by: Anna Wen <54281166+annawen1@users.noreply.github.com> --------- Co-authored-by: Anna Wen <54281166+annawen1@users.noreply.github.com>
- Loading branch information
Showing
16 changed files
with
431 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,5 @@ package.tgz | |
.nx/* | ||
agentic.stories.js | ||
/.history | ||
|
||
*storybook.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@forward '@carbon/styles'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { join, dirname } from 'path'; | ||
|
||
/** | ||
* This function is used to resolve the absolute path of a package. | ||
* It is needed in projects that use Yarn PnP or are set up within a monorepo. | ||
*/ | ||
function getAbsolutePath(value) { | ||
return dirname(require.resolve(join(value, 'package.json'))); | ||
} | ||
|
||
/** @type { import('@storybook/web-components-vite').StorybookConfig } */ | ||
const config = { | ||
stories: [ | ||
'./welcome/**/*.mdx', | ||
'./welcome/**/*.stories.@(js|jsx|mjs|ts|tsx)', | ||
], | ||
addons: [getAbsolutePath('@storybook/addon-essentials')], | ||
framework: { | ||
name: getAbsolutePath('@storybook/web-components-vite'), | ||
options: {}, | ||
}, | ||
refs: { | ||
'web-components': { | ||
title: 'Web Components', | ||
url: 'web-components/index.html', | ||
}, | ||
react: { | ||
title: 'React components', | ||
url: 'react/index.html', | ||
}, | ||
}, | ||
}; | ||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
<meta | ||
name="keywords" | ||
content="IBM, design, system, Carbon, design system, Bluemix, styleguide, style, guide, components, library, pattern, kit, component, cloud, React, React.js" /> | ||
<meta | ||
name="description" | ||
content="This is Carbon Labs, an innovation space for the creation of components leveraging Carbon Design System." /> | ||
|
||
<!-- Open Graph --> | ||
<meta property="og:title" content="Carbon Labs" /> | ||
<meta property="og:site_name" content="Carbon Labs" /> | ||
<meta | ||
property="og:description" | ||
content="This is Carbon Labs, an innovation space for the creation of components leveraging Carbon Design System." /> | ||
<meta | ||
property="og:image" | ||
content="https://media.github.ibm.com/user/1679/files/aa651000-7749-11eb-900e-eeb9312ed756" /> | ||
<meta property="og:url" content="http://labs.carbondesignsystem.com" /> | ||
|
||
<!-- Favicon --> | ||
<link rel="icon" type="image/svg+xml" href="favicon.svg" sizes="any" /> | ||
|
||
<footer> | ||
<dds-footer-container | ||
key="footer" | ||
disable-locale-button="true" | ||
size="micro" />, | ||
</footer> | ||
|
||
<script | ||
key="8" | ||
type="module" | ||
src="https://1.www.s81c.com/common/carbon-for-ibm-dotcom/tag/v1/latest/footer.min.js" /> | ||
|
||
<!-- Storybook override --> | ||
<script> | ||
setTimeout(function () { | ||
document.title = 'Carbon Labs'; | ||
}, 1000); | ||
</script> | ||
|
||
<!-- Tealium/GA Set up --> | ||
<script type="text/javascript"> | ||
window._ibmAnalytics = { | ||
settings: { | ||
name: 'CarbonLabsStorybook', | ||
isSpa: true, | ||
tealiumProfileName: 'ibm-web-app', | ||
}, | ||
onLoad: [['ibmStats.pageview', []]], | ||
}; | ||
digitalData = { | ||
page: { | ||
pageInfo: { | ||
ibm: { | ||
siteId: 'IBM_' + _ibmAnalytics.settings.name, | ||
}, | ||
}, | ||
category: { | ||
primaryCategory: 'PC100', | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<script | ||
src="//1.www.s81c.com/common/stats/ibm-common.js" | ||
type="text/javascript" | ||
async="async"></script> | ||
|
||
<!-- Style overrides --> | ||
<style> | ||
body { | ||
font-family: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif; | ||
} | ||
|
||
body a[href='/?path=/settings/about'] { | ||
display: none; | ||
} | ||
|
||
/* This style is required because of the compliance footer */ | ||
#root > div { | ||
height: calc(100vh - 48px); | ||
} | ||
|
||
/* This style is required because of the compliance footer in smaller screens */ | ||
@media (max-width: 671px) { | ||
nav[class^='css-'] { | ||
height: 281px; | ||
} | ||
} | ||
|
||
footer { | ||
position: absolute; | ||
bottom: 0; | ||
width: 100%; | ||
z-index: 99999; | ||
} | ||
|
||
.os-content form span { | ||
font-weight: 600; | ||
} | ||
|
||
.os-content a button { | ||
color: #161616; | ||
} | ||
|
||
button.sidebar-item svg { | ||
color: #161616; | ||
} | ||
|
||
a.sidebar-item[data-selected='true'] { | ||
color: #161616; | ||
} | ||
|
||
a.sidebar-item[data-selected='true'] svg { | ||
color: #161616; | ||
} | ||
|
||
mark[class*='css-'] { | ||
color: #0f62fe; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<!-- | ||
@license | ||
Copyright IBM Corp. 2023 | ||
This source code is licensed under the Apache-2.0 license found in the | ||
LICENSE file in the root directory of this source tree. | ||
--> | ||
|
||
<link | ||
rel="stylesheet" | ||
href="https://1.www.s81c.com/common/carbon/plex/sans.css" /> | ||
|
||
<script> | ||
window.digitalData = window.digitalData || { | ||
page: { | ||
category: { | ||
primaryCategory: '', | ||
}, | ||
pageInfo: { | ||
effectiveDate: '', | ||
expiryDate: '', | ||
language: 'en-US', | ||
publishDate: '', | ||
publisher: '', | ||
version: 'Carbon Labs', | ||
ibm: { | ||
contentDelivery: '', | ||
contentProducer: '', | ||
country: 'US', | ||
industry: '', | ||
owner: '', | ||
siteID: '', | ||
subject: '', | ||
type: '', | ||
}, | ||
}, | ||
isDataLayerReady: true, | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import './styles.scss'; | ||
|
||
/** @type { import('@storybook/web-components').Preview } */ | ||
const preview = { | ||
parameters: { | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/i, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export default preview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@use 'index.scss' as styles with ( | ||
$font-path: '~@ibm/plex' | ||
); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from 'react'; | ||
import { ArrowRight } from '@carbon/icons-react'; | ||
import { Link, Stack } from '@carbon/react'; | ||
import './welcome.scss'; | ||
export const Welcome = () => { | ||
return ( | ||
<> | ||
<div className="welcome__container"> | ||
<h2 className="welcome__heading">@carbon-labs</h2> | ||
<Stack> | ||
<Link | ||
href="https://github.com/carbon-design-system/carbon-labs" | ||
className="welcome__link" | ||
renderIcon={ArrowRight}> | ||
GitHub repo | ||
</Link> | ||
<Link | ||
href="https://carbondesignsystem.com/" | ||
className="welcome__link" | ||
renderIcon={ArrowRight}> | ||
Carbon Design System | ||
</Link> | ||
<Link | ||
href="https://github.com/carbon-design-system/carbon/blob/main/SECURITY.md" | ||
className="welcome__link" | ||
renderIcon={ArrowRight}> | ||
Security policy | ||
</Link> | ||
</Stack> | ||
</div> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Welcome as Intro } from './Welcome'; | ||
import { Meta, Unstyled } from '@storybook/blocks'; | ||
|
||
<Meta title="Welcome to Carbon Labs" /> | ||
|
||
<Unstyled> | ||
<Intro /> | ||
</Unstyled> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
@use '@carbon/styles/scss/type'; | ||
@use '@carbon/styles/scss/colors'; | ||
|
||
.welcome__container { | ||
position: fixed; | ||
padding: 3rem; | ||
background: url('./CarbonLabs2.png') no-repeat center center fixed; | ||
background-size: cover; | ||
block-size: 100vh; | ||
inline-size: 100vw; | ||
inset-block-start: 0; | ||
inset-inline-start: 0; | ||
} | ||
|
||
.welcome__heading { | ||
@include type.type-style('productive-heading-07'); | ||
|
||
color: colors.$gray-80; | ||
} | ||
|
||
.welcome__link, | ||
.welcome__link:hover, | ||
.welcome__link.cds--link:visited { | ||
margin-top: 1rem; | ||
color: colors.$blue-70; | ||
} | ||
|
||
.welcome__link:first-child { | ||
margin-top: 2rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.