import * as React from 'react'; import { Meta, Story } from '@storybook/react'; import { Card, CardColor, CardProps, CardRadius, CardShadow, CardSize } from '../Card'; import { EnhancedView, View, ViewGroup } from '../View/View'; const colors: CardColor[] = ['white', 'gray', 'zinc', 'slate']; const shadows: CardShadow[] = ['none', 'sm', 'base', 'md', 'lg', 'xl']; const radiuses: CardRadius[] = ['none', 'sm', 'base', 'md', 'lg']; const sizes: CardSize[] = ['sm', 'base', 'md', 'lg']; const headerText = 'Header'; const bodyText = "Rewind UI is a React component library that provides a set of accessible, reusable, and customizable components to help you build your next project. We've designed our components to be flexible and easy to use, so you can focus on what matters most: building great user experiences."; const footerText = 'Footer'; const imgSrc = 'https://images.unsplash.com/photo-1563089145-599997674d42?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=4140&q=80'; const meta: Meta = { title: 'Components/Card', component: Card, argTypes: { radius: { options: radiuses, control: { type: 'select' }, }, color: { options: colors, control: { type: 'select' }, }, shadow: { options: shadows, control: { type: 'select' }, }, size: { options: sizes, control: { type: 'select' }, }, bordered: { control: { type: 'boolean' }, }, withDivider: { control: { type: 'boolean' }, }, ref: { table: { disable: true, }, }, }, parameters: { controls: { expanded: true, sort: 'alpha' }, }, }; export default meta; const DefaultTemplate: Story = (args) => { return ( {headerText} {bodyText} {footerText} ); }; export const Default = DefaultTemplate.bind({}); const ColorTemplate: Story = (args) => { const items = colors.map((color) => ( {headerText} {bodyText} {footerText} )); return {items}; }; export const Colors = ColorTemplate.bind({}); const SizeTemplate: Story = (args) => { const items = sizes.map((size) => ( {headerText} {bodyText} {footerText} )); return {items}; }; export const Sizes = SizeTemplate.bind({}); const RadiusTemplate: Story = (args) => { const items = radiuses.map((radius) => ( {headerText} {bodyText} {footerText} )); return {items}; }; export const Radiuses = RadiusTemplate.bind({}); const ShadowTemplate: Story = (args) => { const items = shadows.map((shadow) => ( {headerText} {bodyText} {footerText} )); return {items}; }; export const Shadows = ShadowTemplate.bind({}); const BorderedTemplate: Story = (args) => { return ( {headerText} {bodyText} {footerText} {headerText} {bodyText} {footerText} ); }; export const Bordered = BorderedTemplate.bind({}); const DividedTemplate: Story = (args) => { return ( {headerText} {bodyText} {footerText} {headerText} {bodyText} {footerText} ); }; export const Divided = DividedTemplate.bind({}); const ImageTemplate: Story = (args) => { return ( {bodyText} ); }; export const Image = ImageTemplate.bind({});