|
| 1 | +// ----- Imports ----- // |
| 2 | +import type { Meta } from '@storybook/react-webpack5'; |
| 3 | +import { StarRatingDeprecated } from './StarRatingDeprecated'; |
| 4 | + |
| 5 | +// ----- Meta ----- // |
| 6 | + |
| 7 | +const meta: Meta<typeof StarRatingDeprecated> = { |
| 8 | + title: 'components/StarRatingDeprecated', |
| 9 | + component: StarRatingDeprecated, |
| 10 | +}; |
| 11 | + |
| 12 | +export default meta; |
| 13 | + |
| 14 | +// ----- Stories ----- // |
| 15 | + |
| 16 | +export const AllSizeStars = () => ( |
| 17 | + <> |
| 18 | + <h1>Small</h1> |
| 19 | + <br /> |
| 20 | + <StarRatingDeprecated rating={3} size="small" /> |
| 21 | + <br /> |
| 22 | + <br /> |
| 23 | + <h1>Large</h1> |
| 24 | + <br /> |
| 25 | + <StarRatingDeprecated rating={3} size="large" /> |
| 26 | + </> |
| 27 | +); |
| 28 | +AllSizeStars.storyName = 'All Sizes'; |
| 29 | + |
| 30 | +export const SmallStory = () => ( |
| 31 | + <> |
| 32 | + <h1>0 Star</h1> |
| 33 | + <StarRatingDeprecated rating={0} size="small" /> |
| 34 | + <br /> |
| 35 | + <h1>1 Star</h1> |
| 36 | + <StarRatingDeprecated rating={1} size="small" /> |
| 37 | + <br /> |
| 38 | + <h1>2 Star</h1> |
| 39 | + <StarRatingDeprecated rating={2} size="small" /> |
| 40 | + <br /> |
| 41 | + <h1>3 Star</h1> |
| 42 | + <StarRatingDeprecated rating={3} size="small" /> |
| 43 | + <br /> |
| 44 | + <h1>4 Star</h1> |
| 45 | + <StarRatingDeprecated rating={4} size="small" /> |
| 46 | + <br /> |
| 47 | + <h1>5 Star</h1> |
| 48 | + <StarRatingDeprecated rating={5} size="small" /> |
| 49 | + </> |
| 50 | +); |
| 51 | +SmallStory.storyName = 'Small Stars'; |
| 52 | + |
| 53 | +export const LargeStory = () => ( |
| 54 | + <> |
| 55 | + <h1>0 Star</h1> |
| 56 | + <StarRatingDeprecated rating={0} size="large" /> |
| 57 | + <br /> |
| 58 | + <h1>1 Star</h1> |
| 59 | + <StarRatingDeprecated rating={1} size="large" /> |
| 60 | + <br /> |
| 61 | + <h1>2 Star</h1> |
| 62 | + <StarRatingDeprecated rating={2} size="large" /> |
| 63 | + <br /> |
| 64 | + <h1>3 Star</h1> |
| 65 | + <StarRatingDeprecated rating={3} size="large" /> |
| 66 | + <br /> |
| 67 | + <h1>4 Star</h1> |
| 68 | + <StarRatingDeprecated rating={4} size="large" /> |
| 69 | + <br /> |
| 70 | + <h1>5 Star</h1> |
| 71 | + <StarRatingDeprecated rating={5} size="large" /> |
| 72 | + </> |
| 73 | +); |
| 74 | +LargeStory.storyName = 'Large stars'; |
| 75 | + |
| 76 | +export const StarColours = () => ( |
| 77 | + <> |
| 78 | + <div style={{ backgroundColor: '#f6dde1' }}> |
| 79 | + <p>Stars take the colour of the parent by default</p> |
| 80 | + <div style={{ color: 'red' }}> |
| 81 | + <StarRatingDeprecated rating={0} size="large" /> |
| 82 | + </div> |
| 83 | + <div style={{ color: 'orange' }}> |
| 84 | + <StarRatingDeprecated rating={1} size="large" /> |
| 85 | + </div> |
| 86 | + <div style={{ color: 'yellow' }}> |
| 87 | + <StarRatingDeprecated rating={2} size="large" /> |
| 88 | + </div> |
| 89 | + <div style={{ color: 'green' }}> |
| 90 | + <StarRatingDeprecated rating={3} size="large" /> |
| 91 | + </div> |
| 92 | + <div style={{ color: 'blue' }}> |
| 93 | + <StarRatingDeprecated rating={4} size="large" /> |
| 94 | + </div> |
| 95 | + <div style={{ color: 'purple' }}> |
| 96 | + <StarRatingDeprecated rating={5} size="large" /> |
| 97 | + </div> |
| 98 | + </div> |
| 99 | + </> |
| 100 | +); |
| 101 | +StarColours.storyName = 'Star colours'; |
0 commit comments