typography.py 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. """Typography classes."""
  2. from typing import ClassVar, Literal
  3. from reflex.vars.base import Var
  4. from .base import BaseHTML
  5. class Blockquote(BaseHTML):
  6. """Display the blockquote element."""
  7. tag = "blockquote"
  8. # Define the title of a work.
  9. cite: Var[str]
  10. class Dd(BaseHTML):
  11. """Display the dd element."""
  12. tag = "dd"
  13. class Div(BaseHTML):
  14. """Display the div element."""
  15. tag = "div"
  16. class Dl(BaseHTML):
  17. """Display the dl element."""
  18. tag = "dl"
  19. class Dt(BaseHTML):
  20. """Display the dt element."""
  21. tag = "dt"
  22. class Figcaption(BaseHTML):
  23. """Display the figcaption element."""
  24. tag = "figcaption"
  25. class Hr(BaseHTML):
  26. """Display the hr element."""
  27. tag = "hr"
  28. class Li(BaseHTML):
  29. """Display the li element."""
  30. tag = "li"
  31. class Menu(BaseHTML):
  32. """Display the menu element."""
  33. tag = "menu"
  34. # Specifies that the menu element is a context menu.
  35. type: Var[str]
  36. class Ol(BaseHTML):
  37. """Display the ol element."""
  38. tag = "ol"
  39. # Reverses the order of the list.
  40. reversed: Var[bool]
  41. # Specifies the start value of the first list item in an ordered list.
  42. start: Var[int]
  43. # Specifies the kind of marker to use in the list (letters or numbers).
  44. type: Var[Literal["1", "a", "A", "i", "I"]]
  45. class P(BaseHTML):
  46. """Display the p element."""
  47. tag = "p"
  48. _invalid_children: ClassVar[list] = ["P", "Ol", "Ul", "Div"]
  49. class Pre(BaseHTML):
  50. """Display the pre element."""
  51. tag = "pre"
  52. class Ul(BaseHTML):
  53. """Display the ul element."""
  54. tag = "ul"
  55. class Ins(BaseHTML):
  56. """Display the ins element."""
  57. tag = "ins"
  58. # Specifies the URL of the document that explains the reason why the text was inserted/changed.
  59. cite: Var[str]
  60. # Specifies the date and time of when the text was inserted/changed.
  61. date_time: Var[str]
  62. class Del(BaseHTML):
  63. """Display the del element."""
  64. tag = "del"
  65. # Specifies the URL of the document that explains the reason why the text was deleted.
  66. cite: Var[str]
  67. # Specifies the date and time of when the text was deleted.
  68. date_time: Var[str]
  69. blockquote = Blockquote.create
  70. dd = Dd.create
  71. div = Div.create
  72. dl = Dl.create
  73. dt = Dt.create
  74. figcaption = Figcaption.create
  75. hr = Hr.create
  76. li = Li.create
  77. ol = Ol.create
  78. p = P.create
  79. pre = Pre.create
  80. ul = Ul.create
  81. ins = Ins.create
  82. del_ = Del.create # 'del' is a reserved keyword in Python