Skip to content

Commit

Permalink
docs(storybook): fix lint errors, use createElement as decorator so h…
Browse files Browse the repository at this point in the history
  • Loading branch information
tay1orjones committed Oct 28, 2020
1 parent b66aa3c commit 8140ee4
Show file tree
Hide file tree
Showing 18 changed files with 2,182 additions and 1,592 deletions.
6 changes: 3 additions & 3 deletions src/components/Button/Button.story.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ NotLoading.story = {
};

export const _Default = () => {
const regularProps = props.regular();
const regularProps = props.regular(); // eslint-disable-line react/destructuring-assignment
return (
<div
style={{
Expand Down Expand Up @@ -236,7 +236,7 @@ _Default.story = {
};

export const IconOnlyButtons = () => (
<Button {...props.iconOnly()} hasIconOnly />
<Button {...props.iconOnly()} hasIconOnly /> // eslint-disable-line react/destructuring-assignment
);

IconOnlyButtons.story = {
Expand Down Expand Up @@ -267,7 +267,7 @@ IconSelectionButtons.story = {
};

export const SetsOfButtons = () => {
const setProps = props.set();
const setProps = props.set(); // eslint-disable-line react/destructuring-assignment
return (
<div className={`${prefix}--btn-set`}>
<Button kind="secondary" {...setProps}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ export default {
title: 'Watson IoT/ComposedStructuredList (Deprecated)',
};

export const Deprecated = () => (
<DeprecationNotice
deprecatedComponentName="ComposedStructuredList"
replacementComponentName="StructuredList"
/>
);
Deprecated.story = {
name: deprecatedStoryTitle,
};

export const Default = () => (
<ComposedStructuredList
design={select('Row design', ['normal', 'mini'], 'mini')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -739,3 +739,96 @@ exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/Compo
</button>
</div>
`;

exports[`Storybook Snapshot tests and console checks Storyshots Watson IoT/ComposedStructuredList (Deprecated) ️⛔ Deprecation Notice 1`] = `
<div
className="storybook-container"
>
<div
style={
Object {
"position": "relative",
"zIndex": 0,
}
}
>
<div
className="bx--toast-notification bx--toast-notification--warning"
kind="warning"
role="alert"
style={
Object {
"marginBottom": "0.5rem",
"minWidth": "30rem",
}
}
>
<svg
aria-hidden={true}
className="bx--toast-notification__icon"
fill="currentColor"
focusable="false"
height={20}
preserveAspectRatio="xMidYMid meet"
viewBox="0 0 20 20"
width={20}
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M10,1c-5,0-9,4-9,9s4,9,9,9s9-4,9-9S15,1,10,1z M9.2,5h1.5v7H9.2V5z M10,16c-0.6,0-1-0.4-1-1s0.4-1,1-1 s1,0.4,1,1S10.6,16,10,16z"
/>
<path
d="M9.2,5h1.5v7H9.2V5z M10,16c-0.6,0-1-0.4-1-1s0.4-1,1-1s1,0.4,1,1S10.6,16,10,16z"
data-icon-path="inner-path"
opacity="0"
/>
<title>
warning icon
</title>
</svg>
<div
className="bx--toast-notification__details"
>
<h3
className="bx--toast-notification__title"
>
Deprecation Notice
</h3>
<div
className="bx--toast-notification__subtitle"
>
ComposedStructuredList has been deprecated and will be removed in the next major version of carbon-addons-iot-react.
</div>
<div
className="bx--toast-notification__caption"
>
Refactor usages of ComposedStructuredList to use StructuredList instead.
</div>
</div>
</div>
</div>
<button
className="info__show-button"
onClick={[Function]}
style={
Object {
"background": "#027ac5",
"border": "none",
"borderRadius": "0 0 0 5px",
"color": "#fff",
"cursor": "pointer",
"display": "block",
"fontFamily": "sans-serif",
"fontSize": 12,
"padding": "5px 15px",
"position": "fixed",
"right": 0,
"top": 0,
}
}
type="button"
>
Show Info
</button>
</div>
`;
7 changes: 7 additions & 0 deletions src/components/Dashboard/Dashboard.story.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,13 @@ export default {
excludeStories: ['originalCards'],
};

export const Deprecated = () => (
<DeprecationNotice deprecatedComponentName="Dashboard" />
);
Deprecated.story = {
name: deprecatedStoryTitle,
};

export const BasicDashboard = () => {
return (
<FullWidthWrapper>
Expand Down
Loading

0 comments on commit 8140ee4

Please sign in to comment.