inline.py 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. """Inline classes."""
  2. from typing import Literal
  3. from reflex.vars.base import Var
  4. from .base import BaseHTML
  5. ReferrerPolicy = Literal[
  6. "",
  7. "no-referrer",
  8. "no-referrer-when-downgrade",
  9. "origin",
  10. "origin-when-cross-origin",
  11. "same-origin",
  12. "strict-origin",
  13. "strict-origin-when-cross-origin",
  14. "unsafe-url",
  15. ]
  16. class A(BaseHTML): # Inherits common attributes from BaseMeta
  17. """Display the 'a' element."""
  18. tag = "a"
  19. # Specifies that the target (the file specified in the href attribute) will be downloaded when a user clicks on the hyperlink.
  20. download: Var[str | bool]
  21. # Specifies the URL of the page the link goes to
  22. href: Var[str]
  23. # Specifies the language of the linked document
  24. href_lang: Var[str]
  25. # Specifies what media/device the linked document is optimized for
  26. media: Var[str]
  27. # Specifies which referrer is sent when fetching the resource
  28. ping: Var[str]
  29. # Specifies the relationship between the current document and the linked document
  30. referrer_policy: Var[ReferrerPolicy]
  31. # Specifies the relationship between the linked document and the current document
  32. rel: Var[str]
  33. # Specifies where to open the linked document
  34. target: Var[str | Literal["_self", "_blank", "_parent", "_top"]]
  35. class Abbr(BaseHTML):
  36. """Display the abbr element."""
  37. tag = "abbr"
  38. class B(BaseHTML):
  39. """Display the b element."""
  40. tag = "b"
  41. class Bdi(BaseHTML):
  42. """Display the bdi element."""
  43. tag = "bdi"
  44. class Bdo(BaseHTML):
  45. """Display the bdo element."""
  46. tag = "bdo"
  47. class Br(BaseHTML):
  48. """Display the br element."""
  49. tag = "br"
  50. class Cite(BaseHTML):
  51. """Display the cite element."""
  52. tag = "cite"
  53. class Code(BaseHTML):
  54. """Display the code element."""
  55. tag = "code"
  56. class Data(BaseHTML):
  57. """Display the data element."""
  58. tag = "data"
  59. # Specifies the machine-readable translation of the data element.
  60. value: Var[str | int | float]
  61. class Dfn(BaseHTML):
  62. """Display the dfn element."""
  63. tag = "dfn"
  64. class Em(BaseHTML):
  65. """Display the em element."""
  66. tag = "em"
  67. class I(BaseHTML): # noqa: E742
  68. """Display the i element."""
  69. tag = "i"
  70. class Kbd(BaseHTML):
  71. """Display the kbd element."""
  72. tag = "kbd"
  73. class Mark(BaseHTML):
  74. """Display the mark element."""
  75. tag = "mark"
  76. class Q(BaseHTML):
  77. """Display the q element."""
  78. tag = "q"
  79. # Specifies the source URL of the quote.
  80. cite: Var[str]
  81. class Rp(BaseHTML):
  82. """Display the rp element."""
  83. tag = "rp"
  84. class Rt(BaseHTML):
  85. """Display the rt element."""
  86. tag = "rt"
  87. class Ruby(BaseHTML):
  88. """Display the ruby element."""
  89. tag = "ruby"
  90. class S(BaseHTML):
  91. """Display the s element."""
  92. tag = "s"
  93. class Samp(BaseHTML):
  94. """Display the samp element."""
  95. tag = "samp"
  96. class Small(BaseHTML):
  97. """Display the small element."""
  98. tag = "small"
  99. class Span(BaseHTML):
  100. """Display the span element."""
  101. tag = "span"
  102. class Strong(BaseHTML):
  103. """Display the strong element."""
  104. tag = "strong"
  105. class Sub(BaseHTML):
  106. """Display the sub element."""
  107. tag = "sub"
  108. class Sup(BaseHTML):
  109. """Display the sup element."""
  110. tag = "sup"
  111. class Time(BaseHTML):
  112. """Display the time element."""
  113. tag = "time"
  114. # Specifies the date and/or time of the element.
  115. date_time: Var[str]
  116. class U(BaseHTML):
  117. """Display the u element."""
  118. tag = "u"
  119. class Wbr(BaseHTML):
  120. """Display the wbr element."""
  121. tag = "wbr"
  122. a = A.create
  123. abbr = Abbr.create
  124. b = B.create
  125. bdi = Bdi.create
  126. bdo = Bdo.create
  127. br = Br.create
  128. cite = Cite.create
  129. code = Code.create
  130. data = Data.create
  131. dfn = Dfn.create
  132. em = Em.create
  133. i = I.create
  134. kbd = Kbd.create
  135. mark = Mark.create
  136. q = Q.create
  137. rp = Rp.create
  138. rt = Rt.create
  139. ruby = Ruby.create
  140. s = S.create
  141. samp = Samp.create
  142. small = Small.create
  143. span = Span.create
  144. strong = Strong.create
  145. sub = Sub.create
  146. sup = Sup.create
  147. time = Time.create
  148. u = U.create
  149. wbr = Wbr.create