Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

Update stories to use new inputProvider #498

Merged
21 commits merged into from
May 9, 2019
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
1 change: 1 addition & 0 deletions packages/components/psammead-caption/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- prettier-ignore -->
| Version | Description |
|---------|-------------|
| 1.1.2 | [PR#498](https://github.com/bbc/psammead/pull/498) Update stories to use new input provider |
| 1.1.1 | [PR#459](https://github.com/bbc/psammead/pull/459) Add custom propTypes shape |
| 1.1.0 | [PR#446](https://github.com/bbc/psammead/pull/446) De-italicise text in italic tag |
| 1.0.1 | [PR#424](https://github.com/bbc/psammead/pull/424) Add Snyk badge to readme |
Expand Down
54 changes: 49 additions & 5 deletions packages/components/psammead-caption/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/components/psammead-caption/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/psammead-caption",
"version": "1.1.1",
"version": "1.1.2",
"main": "dist/index.js",
"description": "React styled components for a Caption",
"repository": {
Expand All @@ -21,9 +21,9 @@
"@bbc/psammead-styles": "^0.3.2"
},
"devDependencies": {
"@bbc/psammead-storybook-helpers": "^1.0.0",
"@bbc/psammead-test-helpers": "^0.3.3",
"@bbc/psammead-inline-link": "^0.3.4",
"@bbc/psammead-storybook-helpers": "^2.0.0",
"@bbc/psammead-test-helpers": "^0.3.3",
"@bbc/psammead-visually-hidden-text": "^0.1.10",
"react": "^16.6.3",
"styled-components": "^4.1.3"
Expand Down
36 changes: 22 additions & 14 deletions packages/components/psammead-caption/src/index.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,27 @@ import { withKnobs } from '@storybook/addon-knobs';
import { inputProvider } from '@bbc/psammead-storybook-helpers';
import InlineLink from '@bbc/psammead-inline-link';
import VisuallyHiddenText from '@bbc/psammead-visually-hidden-text';
import { latin } from '@bbc/gel-foundations/scripts';
import notes from '../README.md';
import Caption from '.';

storiesOf('Caption', module)
.addDecorator(withKnobs)
.add(
'default',
inputProvider(['caption'], captionText => (
<Caption script={latin}>{captionText}</Caption>
inputProvider([{ name: 'Caption' }], ([captionText], script) => (
<Caption script={script}>{captionText}</Caption>
)),
{ notes, knobs: { escapeHTML: false } },
)
.add(
'with offscreen text',
inputProvider(
['visually hidden text', 'caption'],
(hiddenText, captionText) => (
<Caption script={latin}>
[
{ name: 'Visual hidden text', defaultText: 'visually hidden text' },
{ name: 'Caption', defaultText: 'caption' },
],
([hiddenText, captionText], script) => (
<Caption script={script}>
<VisuallyHiddenText>{hiddenText}</VisuallyHiddenText>
{captionText}
</Caption>
Expand All @@ -32,18 +34,24 @@ storiesOf('Caption', module)
)
.add(
'containing an inline link',
inputProvider(['inline link', 'caption'], (linkText, captionText) => (
<Caption script={latin}>
{captionText}
<InlineLink href="https://www.bbc.com"> {linkText}</InlineLink>.
</Caption>
)),
inputProvider(
[
{ name: 'Inline link', defaultText: 'inline link' },
{ name: 'Caption', defaultText: 'caption' },
],
([linkText, captionText], script) => (
<Caption script={script}>
{captionText}
<InlineLink href="https://www.bbc.com"> {linkText}</InlineLink>.
</Caption>
),
),
{ notes, knobs: { escapeHTML: false } },
)
.add(
'containing italicisation',
inputProvider([], () => (
<Caption script={latin}>
inputProvider([], (inputs, script) => (
<Caption script={script}>
Example text with <i>italics</i>
</Caption>
)),
Expand Down
1 change: 1 addition & 0 deletions packages/components/psammead-figure/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- prettier-ignore -->
| Version | Description |
|---------|-------------|
| 0.1.14 | [PR#498](https://github.com/bbc/psammead/pull/498) Update story to use new input provider |
| 0.1.13 | [PR#430](https://github.com/bbc/psammead/pull/430) Add text knobs to story |
| 0.1.12 | [PR#424](https://github.com/bbc/psammead/pull/424) Add Snyk badge to readme |
| 0.1.11 | [PR#407](https://github.com/bbc/psammead/pull/407) Organise dependencies properly |
Expand Down
62 changes: 57 additions & 5 deletions packages/components/psammead-figure/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/components/psammead-figure/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/psammead-figure",
"version": "0.1.13",
"version": "0.1.14",
"main": "dist/index.js",
"description": "React styled component that generates a figure element",
"repository": {
Expand All @@ -20,12 +20,12 @@
"@bbc/gel-foundations": "^0.3.0"
},
"devDependencies": {
"@bbc/psammead-storybook-helpers": "^1.1.0",
"@bbc/psammead-test-helpers": "^0.3.3",
"@bbc/psammead-caption": "^0.3.0",
"@bbc/psammead-copyright": "^0.3.2",
"@bbc/psammead-image": "^0.3.3",
"@bbc/psammead-image-placeholder": "^0.1.8",
"@bbc/psammead-storybook-helpers": "^2.0.0",
"@bbc/psammead-test-helpers": "^0.3.3",
"@bbc/psammead-visually-hidden-text": "^0.1.10",
"react": "^16.6.3",
"styled-components": "^4.1.3"
Expand Down
2 changes: 1 addition & 1 deletion packages/components/psammead-figure/src/index.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ storiesOf('Figure', module)
)
.add(
'containing Image, ImagePlaceholder, Copyright and Caption',
inputProvider(['caption'], caption => (
inputProvider([{ name: 'Caption' }], ([caption]) => (
<Figure>
<ImagePlaceholder ratio={imageRatio}>
<Image alt={imageAlt} src={imageSrc} width={imageWidth} />
Expand Down
1 change: 1 addition & 0 deletions packages/components/psammead-headings/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- prettier-ignore -->
| Version | Description |
|---------|-------------|
| 1.1.3 | [PR#498](https://github.com/bbc/psammead/pull/498) Update stories to use new input provider |
| 1.1.2 | [PR#428](https://github.com/bbc/psammead/pull/428) Add custom propTypes shape |
| 1.1.1 | [PR#412](https://github.com/bbc/psammead/pull/412) Make SubHeading padding-bottom 24px instead of 16px |
| 1.1.0 | [PR#424](https://github.com/bbc/psammead/pull/424) Add Snyk badge to readme |
Expand Down
Loading