iconProps.stories.js 4.0 KB

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