flowLayout.stories.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import React from 'react';
  2. import {withInfo} from '@storybook/addon-info';
  3. import FlowLayout from 'app/components/flowLayout';
  4. import SpreadLayout from 'app/components/spreadLayout';
  5. export default {
  6. title: 'Deprecated/ComponentLayouts/FlowLayout',
  7. };
  8. export const Row = withInfo('Horizontal row with vertical centering')(() => (
  9. <FlowLayout style={{backgroundColor: '#fff'}}>
  10. <div style={{padding: 6, backgroundColor: 'rgba(0, 0, 0, 0.2)'}}>Flow</div>
  11. <div style={{padding: 12, backgroundColor: 'rgba(0, 0, 0, 0.1)'}}>Layout</div>
  12. <div style={{padding: 24, backgroundColor: 'rgba(0, 0, 0, 0.05)'}}>Flow</div>
  13. <div style={{padding: 18, backgroundColor: 'rgba(0, 0, 0, 0.3)'}}>Layout</div>
  14. </FlowLayout>
  15. ));
  16. Row.story = {
  17. name: 'row',
  18. };
  19. export const Column = withInfo('Vertical column with horizontal centering')(() => (
  20. <FlowLayout vertical style={{backgroundColor: '#fff'}}>
  21. <div style={{padding: 6, backgroundColor: 'rgba(0, 0, 0, 0.2)'}}>Flow</div>
  22. <div style={{padding: 12, backgroundColor: 'rgba(0, 0, 0, 0.1)'}}>Layout</div>
  23. <div style={{padding: 24, backgroundColor: 'rgba(0, 0, 0, 0.05)'}}>Flow</div>
  24. <div style={{padding: 18, backgroundColor: 'rgba(0, 0, 0, 0.3)'}}>Layout</div>
  25. </FlowLayout>
  26. ));
  27. Column.story = {
  28. name: 'column',
  29. };
  30. export const LongContentTruncate = withInfo(
  31. 'When you use <FlowLayout> with content that does not get wrapped and overflows, by default hide overflow.'
  32. )(() => (
  33. <div>
  34. <h3 style={{marginBottom: 0, marginTop: 24}}>With "truncate"</h3>
  35. <SpreadLayout style={{backgroundColor: 'white', width: 250}}>
  36. <FlowLayout truncate>
  37. <span className="truncate" style={{whiteSpace: 'nowrap'}}>
  38. Very very long content Very very long content Very very long content Very very
  39. long content
  40. </span>
  41. </FlowLayout>
  42. <div style={{backgroundColor: '#ccc'}}>Important</div>
  43. </SpreadLayout>
  44. <h3 style={{marginBottom: 0, marginTop: 24}}>Without "truncate"</h3>
  45. <SpreadLayout style={{backgroundColor: 'white', width: 250}}>
  46. <FlowLayout truncate={false}>
  47. <span className="truncate" style={{whiteSpace: 'nowrap'}}>
  48. Very very long content Very very long content Very very long content Very very
  49. long content
  50. </span>
  51. </FlowLayout>
  52. <div style={{backgroundColor: '#ccc'}}>Important</div>
  53. </SpreadLayout>
  54. </div>
  55. ));
  56. LongContentTruncate.story = {
  57. name: 'long content (truncate)',
  58. };