chakra.py 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. """Components that are based on Chakra-UI."""
  2. from typing import Literal
  3. from reflex.components.component import Component
  4. class ChakraComponent(Component):
  5. """A component that wraps a Chakra component."""
  6. library = "@chakra-ui/react"
  7. LiteralColorScheme = Literal[
  8. "gray",
  9. "red",
  10. "orange",
  11. "yellow",
  12. "green",
  13. "teal",
  14. "blue",
  15. "cyan",
  16. "purple",
  17. "pink",
  18. "whiteAlpha",
  19. "blackAlpha",
  20. "linkedin",
  21. "facebook",
  22. "messenger",
  23. "whatsapp",
  24. "twitter",
  25. "telegram",
  26. ]
  27. LiteralVariant = Literal["solid", "subtle", "outline"]
  28. LiteralDividerVariant = Literal["solid", "dashed"]
  29. LiteralTheme = Literal["light", "dark"]
  30. LiteralTagColorScheme = Literal[
  31. "gray",
  32. "red",
  33. "orange",
  34. "yellow",
  35. "green",
  36. "teal",
  37. "blue",
  38. "cyan",
  39. "purple",
  40. "pink",
  41. ]
  42. LiteralTagAlign = Literal["center", "end", "start"]
  43. LiteralTabsVariant = Literal[
  44. "line",
  45. "enclosed",
  46. "enclosed-colored",
  47. "soft-rounded",
  48. "solid-rounded",
  49. "unstyled",
  50. ]
  51. LiteralStatus = Literal["success", "info", "warning", "error"]
  52. LiteralAlertVariant = Literal["subtle", "left-accent", "top-accent", "solid"]
  53. LiteralButtonVariant = Literal["ghost", "outline", "solid", "link", "unstyled"]
  54. LiteralSpinnerPlacement = Literal["start", "end"]
  55. LiteralLanguage = Literal[
  56. "en",
  57. "da",
  58. "de",
  59. "es",
  60. "fr",
  61. "ja",
  62. "ko",
  63. "pt_br",
  64. "ru",
  65. "zh_cn",
  66. "ro",
  67. "pl",
  68. "ckb",
  69. "lv",
  70. "se",
  71. "ua",
  72. "he",
  73. "it",
  74. ]
  75. LiteralInputVariant = Literal["outline", "filled", "flushed", "unstyled"]
  76. LiteralInputNumberMode = [
  77. "text",
  78. "search",
  79. "none",
  80. "tel",
  81. "url",
  82. "email",
  83. "numeric",
  84. "decimal",
  85. ]
  86. LiteralChakraDirection = Literal["ltr", "rtl"]
  87. LiteralCardVariant = Literal["outline", "filled", "elevated", "unstyled"]
  88. LiteralStackDirection = Literal["row", "column"]
  89. LiteralImageLoading = Literal["eager", "lazy"]
  90. LiteralTagSize = Literal["sm", "md", "lg"]
  91. LiteralSpinnerSize = Literal[Literal[LiteralTagSize], "xs", "xl"]
  92. LiteralAvatarSize = Literal[Literal[LiteralTagSize], "xl", "xs", "2xl", "full", "2xs"]
  93. LiteralButtonSize = Literal["sm", "md", "lg", "xs"]
  94. # Applies to AlertDialog and Modal
  95. LiteralAlertDialogSize = Literal[
  96. "sm", "md", "lg", "xs", "2xl", "full", "3xl", "4xl", "5xl", "6xl"
  97. ]
  98. LiteralDrawerSize = Literal[Literal[LiteralSpinnerSize], "xl", "full"]
  99. LiteralMenuStrategy = Literal["fixed", "absolute"]
  100. LiteralMenuOption = Literal["checkbox", "radio"]
  101. LiteralPopOverTrigger = Literal["click", "hover"]
  102. LiteralHeadingSize = Literal["lg", "md", "sm", "xs", "xl", "2xl", "3xl", "4xl"]