|
| 1 | +import React from "react"; |
| 2 | + |
| 3 | +import { Meta, StoryObj } from "@storybook/react"; |
| 4 | +import SegmentedControl from "./SegmentedControl"; |
| 5 | + |
| 6 | +const meta: Meta<typeof SegmentedControl> = { |
| 7 | + component: SegmentedControl, |
| 8 | + tags: ["autodocs"], |
| 9 | +}; |
| 10 | + |
| 11 | +export default meta; |
| 12 | + |
| 13 | +type Story = StoryObj<typeof SegmentedControl>; |
| 14 | + |
| 15 | +export const Default: Story = { |
| 16 | + name: "Default", |
| 17 | + |
| 18 | + args: { |
| 19 | + segments: [ |
| 20 | + { |
| 21 | + label: "OLM", |
| 22 | + content: ( |
| 23 | + <p> |
| 24 | + A system to help you move from configuration management to |
| 25 | + application management across your hybrid cloud estate - through |
| 26 | + sharable, reusable, tiny applications called Charmed Operators. |
| 27 | + </p> |
| 28 | + ), |
| 29 | + }, |
| 30 | + { |
| 31 | + label: "SDK", |
| 32 | + content: ( |
| 33 | + <p> |
| 34 | + A set of tools to help you write Charmed Operators and to package |
| 35 | + them as Charms. |
| 36 | + </p> |
| 37 | + ), |
| 38 | + }, |
| 39 | + { |
| 40 | + label: "Charmhub", |
| 41 | + content: ( |
| 42 | + <p> |
| 43 | + A repository for charms - from Observability to Data to Identity and |
| 44 | + more. |
| 45 | + </p> |
| 46 | + ), |
| 47 | + }, |
| 48 | + ], |
| 49 | + }, |
| 50 | +}; |
| 51 | + |
| 52 | +/** |
| 53 | + * The buttons take up a more compact apperance by adding the modifier is-dense |
| 54 | + */ |
| 55 | + |
| 56 | +export const Dense: Story = { |
| 57 | + name: "Dense", |
| 58 | + |
| 59 | + args: { |
| 60 | + className: "is-dense", |
| 61 | + segments: [ |
| 62 | + { |
| 63 | + label: "OLM", |
| 64 | + content: ( |
| 65 | + <p> |
| 66 | + A system to help you move from configuration management to |
| 67 | + application management across your hybrid cloud estate - through |
| 68 | + sharable, reusable, tiny applications called Charmed Operators. |
| 69 | + </p> |
| 70 | + ), |
| 71 | + }, |
| 72 | + { |
| 73 | + label: "SDK", |
| 74 | + content: ( |
| 75 | + <p> |
| 76 | + A set of tools to help you write Charmed Operators and to package |
| 77 | + them as Charms. |
| 78 | + </p> |
| 79 | + ), |
| 80 | + }, |
| 81 | + { |
| 82 | + label: "Charmhub", |
| 83 | + content: ( |
| 84 | + <p> |
| 85 | + A repository for charms - from Observability to Data to Identity and |
| 86 | + more. |
| 87 | + </p> |
| 88 | + ), |
| 89 | + }, |
| 90 | + ], |
| 91 | + }, |
| 92 | +}; |
| 93 | +/** |
| 94 | + * The pattern also supports the use of icons within each button. |
| 95 | + * |
| 96 | + * Icons : If any icons are used, all buttons within the pattern should have an icon, to avoid any potential confusion that could arise from a mix of buttons with and without an icon. |
| 97 | + */ |
| 98 | +export const WithIcon: Story = { |
| 99 | + name: "With Icon", |
| 100 | + args: { |
| 101 | + segments: [ |
| 102 | + { |
| 103 | + label: "OLM", |
| 104 | + content: ( |
| 105 | + <p> |
| 106 | + A system to help you move from configuration management to |
| 107 | + application management across your hybrid cloud estate - through |
| 108 | + sharable, reusable, tiny applications called Charmed Operators. |
| 109 | + </p> |
| 110 | + ), |
| 111 | + iconName: "information", |
| 112 | + }, |
| 113 | + { |
| 114 | + label: "SDK", |
| 115 | + content: ( |
| 116 | + <p> |
| 117 | + A set of tools to help you write Charmed Operators and to package |
| 118 | + them as Charms. |
| 119 | + </p> |
| 120 | + ), |
| 121 | + iconName: "information", |
| 122 | + }, |
| 123 | + { |
| 124 | + label: "Charmhub", |
| 125 | + content: ( |
| 126 | + <p> |
| 127 | + A repository for charms - from Observability to Data to Identity and |
| 128 | + more. |
| 129 | + </p> |
| 130 | + ), |
| 131 | + iconName: "information", |
| 132 | + }, |
| 133 | + ], |
| 134 | + }, |
| 135 | +}; |
0 commit comments