1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204import { storiesOf } from "@storybook/svelte"; import { action } from "@storybook/addon-actions"; import Button from "./Button.svelte"; import markdownNotes from "./buttons.stories.md"; import "../../Tailwindcss.svelte"; storiesOf("Buttons | Buttons", module).add("Standard Primary Button", () => ({ Component: Button, props: { text: "Primary" }, on: { click: action("Primary Button Clicked") } }), { notes: { markdown: markdownNotes } }); storiesOf("Buttons | Buttons", module).add( "Primary Button", () => ({ Component: Button, props: { text: "Primary", filled: true }, on: { click: action("Primary Button Clicked") } }), { notes: { markdown: markdownNotes } } ); storiesOf("Buttons | Buttons", module).add( "Standard Secondary Button", () => ({ Component: Button, props: { text: "Secondary", color: "secondary" }, on: { click: action("Secondary Button Clicked") } }), { notes: { markdown: markdownNotes } } ); storiesOf("Buttons | Buttons", module).add( "Secondary Button", () => ({ Component: Button, props: { text: "Secondary", color: "secondary", filled: true }, on: { click: action("Secondary Button Clicked") } }), { notes: { markdown: markdownNotes } } ); storiesOf("Buttons | Buttons", module).add( "Standard Warning Button", () => ({ Component: Button, props: { text: "Warning", color: "warning" }, on: { click: action("Warning Button Clicked") } }), { notes: { markdown: markdownNotes } } ); storiesOf("Buttons | Buttons", module).add( "Warning Button", () => ({ Component: Button, props: { text: "Warning", color: "warning", filled: true }, on: { click: action("Warning Button Clicked") } }), { notes: { markdown: markdownNotes } } ); storiesOf("Buttons | Buttons", module).add( "Standard Danger Button", () => ({ Component: Button, props: { text: "Danger", color: "danger" }, on: { click: action("Danger Button Clicked") } }), { notes: { markdown: markdownNotes } } ); storiesOf("Buttons | Buttons", module).add( "Danger Button", () => ({ Component: Button, props: { text: "Danger", color: "danger", filled: true }, on: { click: action("Danger Button Clicked") } }), { notes: { markdown: markdownNotes } } ); storiesOf("Buttons | Buttons", module).add( "Small Button", () => ({ Component: Button, props: { text: "Primary", size: "small" }, on: { click: action("Primary Button Clicked") } }), { notes: { markdown: markdownNotes } } ); storiesOf("Buttons | Buttons", module).add( "Disabled Button", () => ({ Component: Button, props: { text: "Primary", disabled: true }, on: { click: action("Primary Button Clicked") } }), { notes: { markdown: markdownNotes } } ); storiesOf("Buttons | Buttons", module).add( "Disabled Filled Button", () => ({ Component: Button, props: { text: "Primary", disabled: true, filled: true }, on: { click: action("Primary Button Clicked") } }), { notes: { markdown: markdownNotes } } ); storiesOf("Buttons | Buttons", module).add( "Loading State", () => ({ Component: Button, props: { text: "Primary", loading: true }, on: { click: action("Primary Button Clicked") } }), { notes: { markdown: markdownNotes } } ); storiesOf("Buttons | Buttons", module).add( "Loading Filled State", () => ({ Component: Button, props: { text: "Primary", loading: true, filled: true }, on: { click: action("Primary Button Clicked") } }), { notes: { markdown: markdownNotes } } ); storiesOf("Buttons | Buttons", module).add( "App Icon Button", () => ({ Component: Button, props: { appIcon: "mermade" }, on: { click: action("Primary Button Clicked") } }), { notes: { markdown: markdownNotes } } ); storiesOf("Buttons | Buttons", module).add( "Avatar Icon Button", () => ({ Component: Button, props: { avatar: { firstName: "Ash", lastName: "Ketchum" } }, on: { click: action("Avatar Button Clicked") } }), { notes: { markdown: markdownNotes } } ); storiesOf("Buttons | Buttons", module).add( "Small Icon Button with Color", () => ({ Component: Button, props: { icon: "check", iconColor: "#017D73" }, on: { click: action("Primary Button Clicked") } }), { notes: { markdown: markdownNotes } } );