Skip to content

Commit

Permalink
chore(storybook): add welcome page
Browse files Browse the repository at this point in the history
  • Loading branch information
tw15egan committed Feb 23, 2021
1 parent 3a43cf7 commit 25d6cdb
Show file tree
Hide file tree
Showing 12 changed files with 67 additions and 11 deletions.
18 changes: 18 additions & 0 deletions packages/react/.storybook/WelcomePage/Welcome-story.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Copyright IBM Corp. 2016, 2018
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

/* eslint-disable no-console */

import React from 'react';
import { Welcome as Intro } from './Welcome';

export default {
title: ' Welcome',
component: Intro,
};

export const Welcome = () => <Intro />;
12 changes: 12 additions & 0 deletions packages/react/.storybook/WelcomePage/Welcome.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Copyright IBM Corp. 2016, 2018
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import React from 'react';
import bg from './carbon_bg.png';

export const Welcome = () => {
return <div>Welcome!</div>;
};
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion packages/react/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,9 @@

module.exports = {
addons: ['storybook-preset-carbon'],
stories: ['../src/**/*-story.js', '../src/**/*.stories.mdx'],
stories: [
'./WelcomePage/Welcome-story.js',
'../src/**/*-story.js',
'../src/**/*.stories.mdx',
],
};
19 changes: 19 additions & 0 deletions packages/react/.storybook/manager-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,22 @@
document.title = 'Carbon Components React';
}, 1000);
</script>

<!-- Style overrides -->
<style>
body a[href='/?path=/settings/about'] {
display: none;
}

.simplebar-content form span {
font-weight: 600;
}

.simplebar-content a button {
color: #161616;
}

.simplebar-content .sidebar-item.selected {
color: #161616;
}
</style>
4 changes: 4 additions & 0 deletions packages/react/.storybook/preview-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
rel="stylesheet"
/> -->
<style>
.sbdocs-li {
list-style: circle;
}

.sbdocs-wrapper .sbdocs-a {
color: #0f62fe;
}
Expand Down
3 changes: 3 additions & 0 deletions packages/react/.storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ addParameters({
// determine order later on.
const UNKNOWN_KEYWORD = 3;
const keywords = new Map([
['welcome', 0],
['default', 1],
['usage', 2],
['playground', 4],
Expand Down Expand Up @@ -67,6 +68,8 @@ addParameters({
if (idB.includes(keyword)) {
matches.set(idB, weight);
}

console.log(idA);
}

// If we have matches for either id, then we will compare the ids based on
Expand Down
4 changes: 0 additions & 4 deletions packages/react/.storybook/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,3 @@ $prefix: 'bx';
}
}
}

.sbdocs-li {
list-style: circle;
}
6 changes: 3 additions & 3 deletions packages/react/.storybook/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PackageInfo from './../package.json';
const {
field01,
interactive01,
interactive02,
selectedUI,
text01,
inverse01,
ui01,
Expand All @@ -18,12 +18,12 @@ export default create({
base: 'light',

colorPrimary: interactive01,
colorSecondary: interactive02,
colorSecondary: selectedUI,

// UI
appBg: uiBackground,
appContentBg: ui01,
appBorderColor: ui04,
appBorderColor: ui03,
appBorderRadius: 0,

// Typography
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Accordion/Accordion-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import Button from '../Button';
import mdx from './Accordion.mdx';

export default {
title: 'Accordion',
title: 'Components/Accordion',
component: Accordion,
subcomponents: {
AccordionItem,
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/DataTable/DataTable-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const props = () => ({
});

export default {
title: 'DataTable',
title: 'Components/DataTable',
component: DataTable,
subcomponents: {
TableContainer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import { batchActionClick, rows, headers } from './shared';
import mdx from '../DataTable.mdx';

export default {
title: 'DataTable/Batch Actions',
title: 'Components/DataTable/Batch Actions',
component: DataTable,
subcomponents: {
TableBatchAction,
Expand Down

0 comments on commit 25d6cdb

Please sign in to comment.