iconProps.stories.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. import React from 'react';
  2. import styled from '@emotion/styled';
  3. import {IconAdd, IconArrow, IconBookmark, IconGroup, IconPin} from 'app/icons';
  4. export default {
  5. title: 'Core/Style/Icons',
  6. };
  7. export const IconProps = () => {
  8. return (
  9. <SwatchWrapper>
  10. <ColorSwatches>
  11. <Header>Color Prop</Header>
  12. <Swatch>
  13. <IconBookmark />
  14. <LabelWrapper>IconBookmark</LabelWrapper>
  15. </Swatch>
  16. <Swatch>
  17. <IconBookmark isSolid color="#6C5FC7" />
  18. <LabelWrapper>
  19. IconBookmark <Highlight>solid color="#6C5FC7"</Highlight>
  20. </LabelWrapper>
  21. </Swatch>
  22. </ColorSwatches>
  23. <SizeSwatches>
  24. <Header>Size Prop</Header>
  25. <Swatch>
  26. <IconGroup size="xs" />
  27. <LabelWrapper>
  28. IconGroup <Highlight>size="xs"</Highlight>
  29. </LabelWrapper>
  30. </Swatch>
  31. <Swatch>
  32. <IconGroup />
  33. <LabelWrapper>IconGroup</LabelWrapper>
  34. </Swatch>
  35. <Swatch>
  36. <IconGroup size="md" />
  37. <LabelWrapper>
  38. IconGroup <Highlight>size="md"</Highlight>
  39. </LabelWrapper>
  40. </Swatch>
  41. <Swatch>
  42. <IconGroup size="lg" />
  43. <LabelWrapper>
  44. IconGroup <Highlight>size="lg"</Highlight>
  45. </LabelWrapper>
  46. </Swatch>
  47. <Swatch>
  48. <IconGroup size="xl" />
  49. <LabelWrapper>
  50. IconGroup <Highlight>size="xl"</Highlight>
  51. </LabelWrapper>
  52. </Swatch>
  53. </SizeSwatches>
  54. <DirectionSwatches>
  55. <Header>Direction Prop</Header>
  56. <Swatch>
  57. <IconArrow />
  58. <LabelWrapper>IconArrow</LabelWrapper>
  59. </Swatch>
  60. <Swatch>
  61. <IconArrow direction="left" />
  62. <LabelWrapper>
  63. IconArrow <Highlight>direction="left"</Highlight>
  64. </LabelWrapper>
  65. </Swatch>
  66. <Swatch>
  67. <IconArrow direction="down" />
  68. <LabelWrapper>
  69. IconArrow <Highlight>direction="down"</Highlight>
  70. </LabelWrapper>
  71. </Swatch>
  72. <Swatch>
  73. <IconArrow direction="right" />
  74. <LabelWrapper>
  75. IconArrow <Highlight>direction="right"</Highlight>
  76. </LabelWrapper>
  77. </Swatch>
  78. </DirectionSwatches>
  79. <CircleSwatches>
  80. <Header>Circle Prop</Header>
  81. <Swatch>
  82. <IconAdd />
  83. <LabelWrapper>IconAdd</LabelWrapper>
  84. </Swatch>
  85. <Swatch>
  86. <IconAdd circle />
  87. <LabelWrapper>
  88. IconAdd <Highlight>circle</Highlight>
  89. </LabelWrapper>
  90. </Swatch>
  91. </CircleSwatches>
  92. <SolidSwatches>
  93. <Header>Solid Prop</Header>
  94. <Swatch>
  95. <IconPin />
  96. <LabelWrapper>IconPin</LabelWrapper>
  97. </Swatch>
  98. <Swatch>
  99. <IconPin solid />
  100. <LabelWrapper>
  101. IconPin <Highlight>solid</Highlight>
  102. </LabelWrapper>
  103. </Swatch>
  104. </SolidSwatches>
  105. </SwatchWrapper>
  106. );
  107. };
  108. IconProps.parameters = {
  109. docs: {
  110. description: {
  111. story: 'Props you can assign to the icon components',
  112. },
  113. },
  114. };
  115. const Highlight = styled('span')`
  116. color: ${p => p.theme.purple300};
  117. font-weight: 600;
  118. `;
  119. const Header = styled('h5')`
  120. margin-bottom: 8px;
  121. `;
  122. const LabelWrapper = styled('div')`
  123. font-size: 14px;
  124. margin-left: 16px;
  125. `;
  126. const SwatchWrapper = styled('div')`
  127. display: grid;
  128. grid-template-columns: repeat(2, 1fr);
  129. grid-template-rows: repeat(5, auto);
  130. grid-gap: 16px;
  131. `;
  132. const Swatches = styled('div')`
  133. border: 1px solid ${p => p.theme.border};
  134. padding: 24px;
  135. `;
  136. const ColorSwatches = styled(Swatches)`
  137. grid-column: 1/2;
  138. grid-row: 1/2;
  139. `;
  140. const SizeSwatches = styled(Swatches)`
  141. grid-column: 1/2;
  142. grid-row: 2/6;
  143. `;
  144. const DirectionSwatches = styled(Swatches)`
  145. grid-column: 2/3;
  146. grid-row: 1/4;
  147. `;
  148. const CircleSwatches = styled(Swatches)`
  149. grid-column: 2/3;
  150. `;
  151. const SolidSwatches = styled(Swatches)`
  152. grid-column: 2/3;
  153. `;
  154. const Swatch = styled('div')`
  155. display: flex;
  156. align-items: center;
  157. min-height: 32px;
  158. svg {
  159. min-width: 32px;
  160. }
  161. `;