-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(components): migrate Blockquote to TypeScript (#617)
* refactor(components): switch to named export * feat(components): migrate Blockquote to TypeScript * fix: specify Ref props for HTMLQuoteElement * feat(components): change default Blockquote size to mega This makes the default size consistent with the Text component. * docs: harmonize default quote and default quote size * fix: update snapshots * fix: extend BlockquotesProps from TextProps BREAKING CHANGE: The default size for Blockquote changed from `kilo` to `mega`.
- Loading branch information
Robin Métral
authored
Jun 11, 2020
1 parent
389ea7d
commit 5e5d93d
Showing
10 changed files
with
138 additions
and
164 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
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
This file was deleted.
Oops, something went wrong.
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,47 @@ | ||
/** | ||
* Copyright 2019, SumUp Ltd. | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import React, { Fragment } from 'react'; | ||
import { select, text } from '@storybook/addon-knobs'; | ||
|
||
import docs from './Blockquote.docs.mdx'; | ||
import { Blockquote } from './Blockquote'; | ||
|
||
const defaultQuote = `The ability to accept credit card payments that are EMV-compliant is essentially an insurance policy against fraud and an impressively economical one at that.`; | ||
|
||
const sizes = ['kilo', 'mega', 'giga'] as const; | ||
|
||
export default { | ||
title: 'Typography/Blockquote', | ||
component: Blockquote, | ||
parameters: { | ||
docs: { page: docs }, | ||
jest: ['Blockquote'] | ||
} | ||
}; | ||
|
||
export const base = () => ( | ||
<Blockquote size={select('Size', sizes, sizes[1])}> | ||
{text('Quote', defaultQuote)} | ||
</Blockquote> | ||
); | ||
|
||
export const size = () => ( | ||
<Fragment> | ||
<Blockquote size="kilo">Kilo - {text('Quote', defaultQuote)}</Blockquote> | ||
<Blockquote size="mega">Mega - {text('Quote', defaultQuote)}</Blockquote> | ||
<Blockquote size="giga">Giga - {text('Quote', defaultQuote)}</Blockquote> | ||
</Fragment> | ||
); |
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.