Add KeyboardKey, AspectRatio Components (#685)
This commit is contained in:
parent
41e8afc92a
commit
25472d7d85
@ -91,7 +91,7 @@ poetry run ruff check .
|
|||||||
poetry run pyright pynecone tests
|
poetry run pyright pynecone tests
|
||||||
find pynecone tests -name "*.py" -not -path pynecone/pc.py | xargs poetry run darglint
|
find pynecone tests -name "*.py" -not -path pynecone/pc.py | xargs poetry run darglint
|
||||||
```
|
```
|
||||||
Finally run `black` to format your code.
|
Finally, run `black` to format your code.
|
||||||
``` bash
|
``` bash
|
||||||
poetry run black pynecone tests
|
poetry run black pynecone tests
|
||||||
```
|
```
|
||||||
|
@ -203,3 +203,5 @@ markdown = Markdown.create
|
|||||||
span = Span.create
|
span = Span.create
|
||||||
text = Text.create
|
text = Text.create
|
||||||
script = ScriptTag.create
|
script = ScriptTag.create
|
||||||
|
aspect_ratio = AspectRatio.create
|
||||||
|
kbd = KeyboardKey.create
|
||||||
|
@ -4,6 +4,7 @@ from .badge import Badge
|
|||||||
from .code import Code, CodeBlock
|
from .code import Code, CodeBlock
|
||||||
from .datatable import DataTable
|
from .datatable import DataTable
|
||||||
from .divider import Divider
|
from .divider import Divider
|
||||||
|
from .keyboard_key import KeyboardKey
|
||||||
from .list import List, ListItem, OrderedList, UnorderedList
|
from .list import List, ListItem, OrderedList, UnorderedList
|
||||||
from .stat import Stat, StatArrow, StatGroup, StatHelpText, StatLabel, StatNumber
|
from .stat import Stat, StatArrow, StatGroup, StatHelpText, StatLabel, StatNumber
|
||||||
from .table import Table, TableCaption, TableContainer, Tbody, Td, Tfoot, Th, Thead, Tr
|
from .table import Table, TableCaption, TableContainer, Tbody, Td, Tfoot, Th, Thead, Tr
|
||||||
|
9
pynecone/components/datadisplay/keyboard_key.py
Normal file
9
pynecone/components/datadisplay/keyboard_key.py
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
"""A Keyboard Key Component."""
|
||||||
|
|
||||||
|
from pynecone.components.libs.chakra import ChakraComponent
|
||||||
|
|
||||||
|
|
||||||
|
class KeyboardKey(ChakraComponent):
|
||||||
|
"""Display a keyboard key text."""
|
||||||
|
|
||||||
|
tag = "Kbd"
|
@ -1,5 +1,6 @@
|
|||||||
"""Convenience functions to define layout components."""
|
"""Convenience functions to define layout components."""
|
||||||
|
|
||||||
|
from .aspect_ratio import AspectRatio
|
||||||
from .box import Box
|
from .box import Box
|
||||||
from .center import Center, Circle, Square
|
from .center import Center, Circle, Square
|
||||||
from .cond import Cond, cond
|
from .cond import Cond, cond
|
||||||
|
13
pynecone/components/layout/aspect_ratio.py
Normal file
13
pynecone/components/layout/aspect_ratio.py
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
"""A AspectRatio component."""
|
||||||
|
|
||||||
|
from pynecone.components.libs.chakra import ChakraComponent
|
||||||
|
from pynecone.var import Var
|
||||||
|
|
||||||
|
|
||||||
|
class AspectRatio(ChakraComponent):
|
||||||
|
"""AspectRatio component is used to embed responsive videos and maps, etc."""
|
||||||
|
|
||||||
|
tag = "AspectRatio"
|
||||||
|
|
||||||
|
# The aspect ratio of the Box
|
||||||
|
ratio: Var[float]
|
Loading…
Reference in New Issue
Block a user