|
| 1 | +/* ! |
| 2 | + * (c) Copyright 2024 Palantir Technologies Inc. All rights reserved. |
| 3 | + */ |
| 4 | + |
| 5 | +import dedent from "dedent"; |
| 6 | +import * as React from "react"; |
| 7 | + |
| 8 | +import { Button, Card, Elevation, H3 } from "@blueprintjs/core"; |
| 9 | +import { CodeExample, type ExampleProps } from "@blueprintjs/docs-theme"; |
| 10 | + |
| 11 | +export const CardBasicExample: React.FC<ExampleProps> = props => { |
| 12 | + const code = dedent` |
| 13 | + <Card> |
| 14 | + <H3>Adventure Awaits</H3> |
| 15 | + <p>Embark on an epic journey across uncharted lands. This card outlines your mission.</p> |
| 16 | + <Button intent="primary">Start Journey</Button> |
| 17 | + </Card>`; |
| 18 | + return ( |
| 19 | + <CodeExample code={code} {...props}> |
| 20 | + <Card> |
| 21 | + <H3>Adventure Awaits</H3> |
| 22 | + <p>Embark on an epic journey across uncharted lands. This card outlines your mission.</p> |
| 23 | + <Button intent="primary">Start Journey</Button> |
| 24 | + </Card> |
| 25 | + </CodeExample> |
| 26 | + ); |
| 27 | +}; |
| 28 | + |
| 29 | +export const CardInteractiveExample: React.FC<ExampleProps> = props => { |
| 30 | + const code = dedent` |
| 31 | + <Card interactive={true} onClick={...}> |
| 32 | + This card is interactive. Hover and click it. |
| 33 | + </Card> |
| 34 | + <Card interactive={true} selected={true}> |
| 35 | + This card is selected. |
| 36 | + </Card>`; |
| 37 | + return ( |
| 38 | + <CodeExample code={code} {...props}> |
| 39 | + {/* eslint-disable-next-line no-console */} |
| 40 | + <Card interactive={true} onClick={() => console.log("clicked card")}> |
| 41 | + This card is interactive. Hover and click it. |
| 42 | + </Card> |
| 43 | + <Card interactive={true} selected={true}> |
| 44 | + This card is selected. |
| 45 | + </Card> |
| 46 | + </CodeExample> |
| 47 | + ); |
| 48 | +}; |
| 49 | + |
| 50 | +export const CardCompactExample: React.FC<ExampleProps> = props => { |
| 51 | + const code = dedent` |
| 52 | + <Card>This card has default padding.</Card> |
| 53 | + <Card compact={true}>This card is more compact.</Card>`; |
| 54 | + return ( |
| 55 | + <CodeExample code={code} {...props}> |
| 56 | + <Card>This card has default padding.</Card> |
| 57 | + <Card compact={true}>This card is more compact.</Card> |
| 58 | + </CodeExample> |
| 59 | + ); |
| 60 | +}; |
| 61 | + |
| 62 | +export const CardElevationExample: React.FC<ExampleProps> = props => { |
| 63 | + const code = dedent` |
| 64 | + <Card elevation={Elevation.ZERO}>0</Card> |
| 65 | + <Card elevation={Elevation.ONE}>1</Card> |
| 66 | + <Card elevation={Elevation.TWO}>2</Card> |
| 67 | + <Card elevation={Elevation.THREE}>3</Card> |
| 68 | + <Card elevation={Elevation.FOUR}>4</Card>`; |
| 69 | + return ( |
| 70 | + <CodeExample code={code} {...props}> |
| 71 | + <Card elevation={Elevation.ZERO}>0</Card> |
| 72 | + <Card elevation={Elevation.ONE}>1</Card> |
| 73 | + <Card elevation={Elevation.TWO}>2</Card> |
| 74 | + <Card elevation={Elevation.THREE}>3</Card> |
| 75 | + <Card elevation={Elevation.FOUR}>4</Card> |
| 76 | + </CodeExample> |
| 77 | + ); |
| 78 | +}; |
0 commit comments