|
| 1 | +import { CardHorizontal } from "./CardHorizontal"; |
| 2 | +import { ICON_NAMES } from "@/components/Icon/types.ts"; |
| 3 | +import { styled } from "styled-components"; |
| 4 | +const GridCenter = styled.div` |
| 5 | + display: grid; |
| 6 | + width: 60%; |
| 7 | +`; |
| 8 | + |
| 9 | +const CardHorizontalExample = ({ ...props }) => { |
| 10 | + return ( |
| 11 | + <GridCenter> |
| 12 | + <CardHorizontal |
| 13 | + title={props.title} |
| 14 | + icon={props.icon} |
| 15 | + description={props.description} |
| 16 | + disabled={props.disabled} |
| 17 | + isSelected={props.isSelected} |
| 18 | + badgeText={props.badgeText} |
| 19 | + badgeIcon={props.badgeIcon} |
| 20 | + badgeState={props.badgeState} |
| 21 | + badgeIconDir={props.badgeIconDir} |
| 22 | + infoText={props.infoText} |
| 23 | + infoUrl={props.infoUrl} |
| 24 | + /> |
| 25 | + </GridCenter> |
| 26 | + ); |
| 27 | +}; |
| 28 | + |
| 29 | +export default { |
| 30 | + component: CardHorizontalExample, |
| 31 | + title: "Cards/Horizontal Card", |
| 32 | + tags: ["cardHorizontal", "autodocs"], |
| 33 | + argTypes: { |
| 34 | + icon: { control: "select", options: ICON_NAMES, description: "`IconName`" }, |
| 35 | + badgeIcon: { control: "select", options: ICON_NAMES, description: "`IconName`" }, |
| 36 | + badgeText: { |
| 37 | + control: "text", |
| 38 | + description: "Shows and hides the badge <br />`string`", |
| 39 | + }, |
| 40 | + badgeState: { |
| 41 | + control: "select", |
| 42 | + options: ["default", "info", "success", "warning", "danger"], |
| 43 | + description: "`BadgeState`", |
| 44 | + }, |
| 45 | + badgeIconDir: { |
| 46 | + control: "radio", |
| 47 | + options: ["start", "end"], |
| 48 | + description: "`start` `end`", |
| 49 | + }, |
| 50 | + title: { control: "text", description: "`ReactNode`" }, |
| 51 | + description: { control: "text", description: "`ReactNode`" }, |
| 52 | + infoText: { |
| 53 | + control: "text", |
| 54 | + description: "Shows and hides the button <br />`string`", |
| 55 | + }, |
| 56 | + infoUrl: { control: "text", description: "`string`" }, |
| 57 | + disabled: { |
| 58 | + control: "boolean", |
| 59 | + description: "`boolean`", |
| 60 | + defaultValue: { summary: "false" }, |
| 61 | + }, |
| 62 | + isSelected: { |
| 63 | + control: "boolean", |
| 64 | + description: "`boolean`", |
| 65 | + defaultValue: { summary: "false" }, |
| 66 | + }, |
| 67 | + }, |
| 68 | +}; |
| 69 | + |
| 70 | +export const Playground = { |
| 71 | + args: { |
| 72 | + icon: "building", |
| 73 | + title: "Card title", |
| 74 | + description: "A description very interesting that presumably relates to the card.", |
| 75 | + disabled: false, |
| 76 | + isSelected: false, |
| 77 | + badgeText: "", |
| 78 | + badgeIcon: null, |
| 79 | + badgeState: "default", |
| 80 | + badgeIconDir: "", |
| 81 | + infoText: "", |
| 82 | + infoUrl: "", |
| 83 | + }, |
| 84 | +}; |
0 commit comments