06-TextField.stories.tsx 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import React from "react"
  2. import { TextField } from "./../src"
  3. import { faBan } from "@fortawesome/free-solid-svg-icons"
  4. export default {
  5. title: "TextField",
  6. component: TextField,
  7. }
  8. export const Primary = () => (
  9. <div style={{ backgroundColor: "black", padding: "50px 20px" }}>
  10. <TextField label="Label" />
  11. </div>
  12. )
  13. export const Focus = () => (
  14. <div style={{ backgroundColor: "black", padding: "50px 20px" }}>
  15. <TextField label="Label" focus={true} />
  16. </div>
  17. )
  18. export const Error = () => (
  19. <div style={{ backgroundColor: "black", padding: "50px 20px" }}>
  20. <TextField label="Label" error={true} />
  21. </div>
  22. )
  23. export const Disabled = () => (
  24. <div style={{ backgroundColor: "black", padding: "50px 20px" }}>
  25. <TextField label="Label" disabled={true} />
  26. </div>
  27. )
  28. export const DisabledWithValue = () => (
  29. <div style={{ backgroundColor: "black", padding: "50px 20px" }}>
  30. <TextField label="Label" value="Disabled" disabled={true} />
  31. </div>
  32. )
  33. export const PrimaryWithIconRight = () => (
  34. <div style={{ backgroundColor: "black", padding: "50px 20px" }}>
  35. <TextField label="Label" icon={faBan} iconPosition="right" />
  36. </div>
  37. )
  38. export const PrimaryWithIconLeft = () => (
  39. <div style={{ backgroundColor: "black", padding: "50px 20px" }}>
  40. <TextField label="Label" icon={faBan} iconPosition="left" />
  41. </div>
  42. )
  43. export const PrimaryWithHelperText = () => (
  44. <div style={{ backgroundColor: "black", padding: "50px 20px" }}>
  45. <TextField label="Label" helper="Helper text" />
  46. </div>
  47. )
  48. export const FocusWithHelperText = () => (
  49. <div style={{ backgroundColor: "black", padding: "50px 20px" }}>
  50. <TextField label="Label" focus={true} helper="Helper text" />
  51. </div>
  52. )
  53. export const ErrorWithHelperText = () => (
  54. <div style={{ backgroundColor: "black", padding: "50px 20px" }}>
  55. <TextField label="Label" error={true} helper="Helper text" />
  56. </div>
  57. )