text.stories.js 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. import React from 'react';
  2. import {storiesOf} from '@storybook/react';
  3. import {withInfo} from '@storybook/addon-info';
  4. import Text from 'app/components/text';
  5. storiesOf('Style|Text', module).add(
  6. 'default',
  7. withInfo('On-demand styling for native dom elements')(() => (
  8. <div style={{padding: 20, backgroundColor: '#ffffff'}}>
  9. <Text>
  10. <h1>Text styles</h1>
  11. <p>
  12. Not having to override margin, padding, and line-height on native text elements
  13. is a feature in the app UI world — that's why things like reset.css,
  14. normalize.css, etc exist. But in situations where you need those styles to "just
  15. work" it can be quite frustrating to find out they're not supported.
  16. </p>
  17. <h2>Introducing the Text component</h2>
  18. <p>
  19. The Text component unlocks basic type styles on native text components on-demand
  20. in a way that's simple, familiar, and easy to remember. Here are the components
  21. it supports:
  22. </p>
  23. <h3>Headings</h3>
  24. <p>Headings are styled as they should be. Here's a quick sampling:</p>
  25. <h1>This is a H1 heading</h1>
  26. <h2>This is a H2 heading</h2>
  27. <h3>This is a H3 heading</h3>
  28. <h4>This is a H4 heading</h4>
  29. <h5>This is a H5 heading</h5>
  30. <h6>This is a H6 heading</h6>
  31. <h3>Paragraph</h3>
  32. <p>
  33. Paragraphs are essential to communicating complex ideas to our users. However,
  34. we can't rely on them alone.
  35. </p>
  36. <h3>Lists</h3>
  37. <p>Lists are a goto when it comes to conveying complex ideas. Unordered lists:</p>
  38. <ul>
  39. <li>
  40. Help chunk out larger ideas into bite size pieces that are a little easier to
  41. consume
  42. </li>
  43. <li>Make it easy for a user to scan text for key information</li>
  44. <li>Help break up walls of text</li>
  45. </ul>
  46. <p>Ordered lists:</p>
  47. <ol>
  48. <li>Are</li>
  49. <li>great</li>
  50. <li>too</li>
  51. </ol>
  52. <h3>Blockquote</h3>
  53. <blockquote>
  54. LOL have you ever tried to quote something in the app? Who cares, it's
  55. supported.
  56. </blockquote>
  57. <p>
  58. That's it for now. You'll notice that there's no margin doubling up with the
  59. padding of this container. That's because the last child in a Text component has{' '}
  60. <code>margin-bottom: 0</code>. Byyyeeee.
  61. </p>
  62. </Text>
  63. </div>
  64. ))
  65. );