mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-21 03:05:38 -05:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
@@ -1,7 +1,16 @@
|
||||
from pyscript import when
|
||||
from pyweb import pydom
|
||||
from pyweb.ui.shoelace import (Alert, Button, Card, Details, Dialog, Divider, Icon, Rating)
|
||||
from pyweb.ui import elements as el
|
||||
from pyweb.ui.shoelace import (
|
||||
Alert,
|
||||
Button,
|
||||
Card,
|
||||
Details,
|
||||
Dialog,
|
||||
Divider,
|
||||
Icon,
|
||||
Rating,
|
||||
)
|
||||
|
||||
LOREM_IPSUM = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
|
||||
details_code = """
|
||||
@@ -25,52 +34,53 @@ when("click", example_dialog_close_btn)(toggle_dialog)
|
||||
pydom.body.append(example_dialog)
|
||||
|
||||
|
||||
kits = {"shoelace": {
|
||||
"Alert": {
|
||||
"instance": Alert(
|
||||
"This is a standard alert. You can customize its content and even the icon."
|
||||
),
|
||||
"code": el.code(
|
||||
"Alert('This is a standard alert. You can customize its content and even the icon.'"
|
||||
),
|
||||
},
|
||||
"Icon": {
|
||||
"instance": Icon(name="heart"),
|
||||
"code": el.code('Icon(name="heart")'),
|
||||
},
|
||||
"Button": {
|
||||
"instance": Button("Try me"),
|
||||
"code": el.code('Button("Try me")'),
|
||||
},
|
||||
"Card": {
|
||||
"instance": Card(
|
||||
el.p("This is a cool card!"),
|
||||
image="https://pyscript.net/assets/images/pyscript-sticker-black.svg",
|
||||
footer=el.div([Button("More Info"), Rating()]),
|
||||
),
|
||||
"code": el.code(
|
||||
"""
|
||||
kits = {
|
||||
"shoelace": {
|
||||
"Alert": {
|
||||
"instance": Alert(
|
||||
"This is a standard alert. You can customize its content and even the icon."
|
||||
),
|
||||
"code": el.code(
|
||||
"Alert('This is a standard alert. You can customize its content and even the icon.'"
|
||||
),
|
||||
},
|
||||
"Icon": {
|
||||
"instance": Icon(name="heart"),
|
||||
"code": el.code('Icon(name="heart")'),
|
||||
},
|
||||
"Button": {
|
||||
"instance": Button("Try me"),
|
||||
"code": el.code('Button("Try me")'),
|
||||
},
|
||||
"Card": {
|
||||
"instance": Card(
|
||||
el.p("This is a cool card!"),
|
||||
image="https://pyscript.net/assets/images/pyscript-sticker-black.svg",
|
||||
footer=el.div([Button("More Info"), Rating()]),
|
||||
),
|
||||
"code": el.code(
|
||||
"""
|
||||
Card(el.p("This is a cool card!"), image="https://pyscript.net/assets/images/pyscript-sticker-black.svg", footer=el.div([Button("More Info"), Rating()]))
|
||||
"""
|
||||
),
|
||||
},
|
||||
"Details": {
|
||||
"instance": Details(LOREM_IPSUM, summary="Try me"),
|
||||
"code": el.code('Details(LOREM_IPSUM, summary="Try me")'),
|
||||
},
|
||||
"Dialog": {
|
||||
"instance": example_dialog_btn,
|
||||
"code": el.code(
|
||||
'Dialog(div([p(LOREM_IPSUM), Button("Close")]), summary="Try me")'
|
||||
),
|
||||
},
|
||||
"Divider": {
|
||||
"instance": Divider(),
|
||||
"code": el.code("Divider()"),
|
||||
},
|
||||
"Rating": {
|
||||
"instance": Rating(),
|
||||
"code": el.code("Rating()"),
|
||||
},
|
||||
),
|
||||
},
|
||||
"Details": {
|
||||
"instance": Details(LOREM_IPSUM, summary="Try me"),
|
||||
"code": el.code('Details(LOREM_IPSUM, summary="Try me")'),
|
||||
},
|
||||
"Dialog": {
|
||||
"instance": example_dialog_btn,
|
||||
"code": el.code(
|
||||
'Dialog(div([p(LOREM_IPSUM), Button("Close")]), summary="Try me")'
|
||||
),
|
||||
},
|
||||
"Divider": {
|
||||
"instance": Divider(),
|
||||
"code": el.code("Divider()"),
|
||||
},
|
||||
"Rating": {
|
||||
"instance": Rating(),
|
||||
"code": el.code("Rating()"),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user