01-Button.stories.tsx 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. import React from "react";
  2. import { Button } from "../src";
  3. import { faBan } from "@fortawesome/free-solid-svg-icons";
  4. export default {
  5. title: "Button",
  6. component: Button,
  7. };
  8. export const Primary = () => (
  9. <>
  10. <Button onClick={() => console.log("Button clicked!")}>Regular</Button>
  11. <Button size="small" onClick={() => console.log("Button clicked!")}>
  12. Small
  13. </Button>
  14. <Button size="smaller" onClick={() => console.log("Button clicked!")}>
  15. Smaller
  16. </Button>
  17. </>
  18. );
  19. export const Secondary = () => (
  20. <>
  21. <Button type="secondary">Regular</Button>
  22. <Button type="secondary" size="small">
  23. Small
  24. </Button>
  25. <Button type="secondary" size="smaller">
  26. Smaller
  27. </Button>
  28. </>
  29. );
  30. export const PrimaryFullSize = () => <Button full>Primary Full Size</Button>;
  31. export const SecondaryFullSize = () => (
  32. <Button full type="secondary">
  33. Secondary Full Size
  34. </Button>
  35. );
  36. export const PrimaryWithIcon = () => (
  37. <>
  38. <Button icon>Regular</Button>
  39. <Button icon size="small">
  40. Small
  41. </Button>
  42. <Button icon size="smaller">
  43. Smaller
  44. </Button>
  45. </>
  46. );
  47. export const SecondaryWithIcon = () => (
  48. <>
  49. <Button type="secondary" icon>
  50. Regular
  51. </Button>
  52. <Button type="secondary" icon size="small">
  53. Small
  54. </Button>
  55. <Button type="secondary" icon size="smaller">
  56. Smaller
  57. </Button>
  58. </>
  59. );
  60. export const PrimaryWithoutText = () => (
  61. <>
  62. <Button icon />
  63. <Button icon size="small" />
  64. <Button icon size="smaller" />
  65. </>
  66. );
  67. export const SecondaryWithoutText = () => (
  68. <>
  69. <Button type="secondary" icon />
  70. <Button type="secondary" icon size="small" />
  71. <Button type="secondary" icon size="smaller" />
  72. </>
  73. );
  74. export const Disabled = () => (
  75. <>
  76. <Button disabled={true}>Disabled</Button>
  77. <Button disabled={true} icon={true}>
  78. Disabled with icon
  79. </Button>
  80. <Button disabled={true} icon />
  81. </>
  82. );