|
1 | 1 | from typing import Final |
2 | 2 |
|
| 3 | +import air |
3 | 4 | from air import * |
4 | 5 |
|
5 | | -SMALL_HTML_SAMPLE: Final = Html( |
6 | | - Div( |
7 | | - Link( |
8 | | - rel="stylesheet", |
9 | | - href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css", |
| 6 | +FRAGMENT_AIR_TAG_SAMPLE: Final = air.Div( |
| 7 | + air.Meta(charset="utf-8"), |
| 8 | + air.Meta( |
| 9 | + content="width=device-width,initial-scale=1", |
| 10 | + name="viewport", |
| 11 | + ), |
| 12 | + air.Title("Title!"), |
| 13 | + air.Comment("My crazy comment"), |
| 14 | + air.P( |
| 15 | + "Hello ", |
| 16 | + air.Strong("World"), |
| 17 | + "!", |
| 18 | + ), |
| 19 | +) |
| 20 | + |
| 21 | +TINY_AIR_TAG_SAMPLE: Final = air.Html( |
| 22 | + air.Head( |
| 23 | + air.Meta(charset="utf-8"), |
| 24 | + air.Meta( |
| 25 | + content="width=device-width,initial-scale=1", |
| 26 | + name="viewport", |
10 | 27 | ), |
11 | | - Script( |
12 | | - src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.6/dist/htmx.min.js", |
13 | | - integrity="sha384-Akqfrbj/HpNVo8k11SXBb6TlBWmXXlYQrCSqEWmyKJe+hDm3Z/B2WVG4smwBkRVm", |
14 | | - crossorigin="anonymous", |
| 28 | + air.Title("Title!"), |
| 29 | + air.Comment("My crazy comment"), |
| 30 | + ), |
| 31 | + air.Body( |
| 32 | + air.P( |
| 33 | + "Hello", |
| 34 | + air.Strong("World"), |
| 35 | + "!", |
15 | 36 | ), |
16 | | - H1("H1", data_cloud=True, data_earth="true"), |
17 | | - H2("H1", data_cloud=True, data_earth="true"), |
18 | | - P( |
19 | | - A("A", data_cloud=True, data_earth="true"), |
20 | | - A(SafeStr(":root & > < { --pico-font-size: 100%; }"), id="id1"), |
21 | | - SafeStr("safe <> string"), |
22 | | - A(":root & > < { --pico-font-size: 100%; }", id="id1"), |
23 | | - Img( |
24 | | - src="https://cdn.jsdelivr.net/dist/img.png", |
25 | | - width=250, |
26 | | - height=100, |
27 | | - alt="My Img", |
28 | | - checked=False, |
29 | | - selected=True, |
30 | | - bar="foo", |
31 | | - ), |
32 | | - "<>", |
33 | | - Script("safe <> Script", crossorigin="anonymous"), |
| 37 | + air.Div( |
| 38 | + "Div", |
| 39 | + hidden=True, |
| 40 | + draggable=True, |
| 41 | + translate="no", |
| 42 | + contenteditable=True, |
| 43 | + tabindex=3, |
| 44 | + width=12.34, |
34 | 45 | ), |
35 | | - class_="class1", |
36 | | - id="id1", |
37 | | - style="style1", |
38 | | - kwarg1="kwarg1", |
39 | | - kwarg2="kwarg2", |
40 | | - kwarg3="kwarg3", |
41 | | - ) |
| 46 | + ), |
| 47 | + lang="en", |
| 48 | +) |
| 49 | + |
| 50 | +SMALL_AIR_TAG_SAMPLE: Final = Html( |
| 51 | + air.Head(), |
| 52 | + air.Body( |
| 53 | + Div( |
| 54 | + Link( |
| 55 | + rel="stylesheet", |
| 56 | + href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css", |
| 57 | + ), |
| 58 | + Script( |
| 59 | + src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.6/dist/htmx.min.js", |
| 60 | + integrity="sha384-Akqfrbj/HpNVo8k11SXBb6TlBWmXXlYQrCSqEWmyKJe+hDm3Z/B2WVG4smwBkRVm", |
| 61 | + crossorigin="anonymous", |
| 62 | + ), |
| 63 | + H1("H1", data_cloud=True, data_earth="true"), |
| 64 | + H2("H1", data_cloud=True, data_earth="true"), |
| 65 | + P( |
| 66 | + A("A", data_cloud=True, data_earth="true"), |
| 67 | + A(SafeStr(":root & > < { --pico-font-size: 100%; }"), id_="id1"), |
| 68 | + SafeStr("safe <> string"), |
| 69 | + A(":root & > < { --pico-font-size: 100%; }", id_="id1"), |
| 70 | + Img( |
| 71 | + src="https://cdn.jsdelivr.net/dist/img.png", |
| 72 | + width=250, |
| 73 | + height=100, |
| 74 | + alt="My Img", |
| 75 | + selected=True, |
| 76 | + bar="foo", |
| 77 | + ), |
| 78 | + "<>", |
| 79 | + Script("safe <> Script", crossorigin="anonymous"), |
| 80 | + ), |
| 81 | + class_="class1", |
| 82 | + id_="id1", |
| 83 | + style="style1", |
| 84 | + kwarg1="kwarg1", |
| 85 | + kwarg2="kwarg2", |
| 86 | + kwarg3="kwarg3", |
| 87 | + ) |
| 88 | + ), |
42 | 89 | ) |
43 | 90 |
|
44 | | -HTML_SAMPLE: Final = Html( |
| 91 | +AIR_TAG_SAMPLE: Final = Html( |
45 | 92 | Head( |
46 | 93 | Meta( |
47 | 94 | property="og:image", |
|
366 | 413 | type="text", |
367 | 414 | name="q", |
368 | 415 | placeholder="Enter your search query...", |
369 | | - id="search-input", |
| 416 | + id_="search-input", |
370 | 417 | ), |
371 | 418 | Div(class_="search-results-modal"), |
372 | 419 | class_="modal-content", |
373 | 420 | ), |
374 | | - id="search-modal", |
| 421 | + id_="search-modal", |
375 | 422 | style="display:none;", |
376 | 423 | class_="modal overflow-auto", |
377 | 424 | ), |
|
0 commit comments