|
7 | 7 |
|
8 | 8 | from .. import ui |
9 | 9 | from ..types import MISSING, MISSING_TYPE |
| 10 | +from ..ui._accordion import AccordionPanel |
10 | 11 | from ..ui._layout_columns import BreakpointsUser |
| 12 | +from ..ui._navs import NavPanel, NavSet, NavSetCard |
11 | 13 | from ..ui.css import CssUnit |
12 | 14 | from . import _run |
13 | 15 | from ._recall_context import RecallContextManager, wrap_recall_context_manager |
|
39 | 41 | # ====================================================================================== |
40 | 42 | # Page functions |
41 | 43 | # ====================================================================================== |
42 | | -def set_page(page_fn: RecallContextManager[Tag]): |
| 44 | +def set_page(page_fn: RecallContextManager[Tag]) -> None: |
43 | 45 | """Set the page function for the current Shiny express app.""" |
44 | 46 | _run.replace_top_level_recall_context_manager(page_fn, force=True) |
45 | 47 |
|
@@ -162,7 +164,7 @@ def layout_column_wrap( |
162 | 164 | gap: Optional[CssUnit] = None, |
163 | 165 | class_: Optional[str] = None, |
164 | 166 | **kwargs: TagAttrValue, |
165 | | -): |
| 167 | +) -> RecallContextManager[Tag]: |
166 | 168 | """ |
167 | 169 | A grid-like, column-first layout |
168 | 170 |
|
@@ -252,7 +254,7 @@ def layout_columns( |
252 | 254 | class_: Optional[str] = None, |
253 | 255 | height: Optional[CssUnit] = None, |
254 | 256 | **kwargs: TagAttrValue, |
255 | | -): |
| 257 | +) -> RecallContextManager[Tag]: |
256 | 258 | """ |
257 | 259 | Create responsive, column-based grid layouts, based on a 12-column grid. |
258 | 260 |
|
@@ -346,7 +348,9 @@ def layout_columns( |
346 | 348 | ) |
347 | 349 |
|
348 | 350 |
|
349 | | -def column(width: int, *, offset: int = 0, **kwargs: TagAttrValue): |
| 351 | +def column( |
| 352 | + width: int, *, offset: int = 0, **kwargs: TagAttrValue |
| 353 | +) -> RecallContextManager[Tag]: |
350 | 354 | """ |
351 | 355 | Responsive row-column based layout |
352 | 356 |
|
@@ -381,7 +385,7 @@ def column(width: int, *, offset: int = 0, **kwargs: TagAttrValue): |
381 | 385 | ) |
382 | 386 |
|
383 | 387 |
|
384 | | -def row(**kwargs: TagAttrValue): |
| 388 | +def row(**kwargs: TagAttrValue) -> RecallContextManager[Tag]: |
385 | 389 | """ |
386 | 390 | Responsive row-column based layout |
387 | 391 |
|
@@ -419,7 +423,7 @@ def card( |
419 | 423 | fill: bool = True, |
420 | 424 | class_: Optional[str] = None, |
421 | 425 | **kwargs: TagAttrValue, |
422 | | -): |
| 426 | +) -> RecallContextManager[Tag]: |
423 | 427 | """ |
424 | 428 | A Bootstrap card component |
425 | 429 |
|
@@ -481,7 +485,7 @@ def accordion( |
481 | 485 | width: Optional[CssUnit] = None, |
482 | 486 | height: Optional[CssUnit] = None, |
483 | 487 | **kwargs: TagAttrValue, |
484 | | -): |
| 488 | +) -> RecallContextManager[Tag]: |
485 | 489 | """ |
486 | 490 | Create a vertically collapsing accordion. |
487 | 491 |
|
@@ -537,7 +541,7 @@ def accordion_panel( |
537 | 541 | value: Optional[str] | MISSING_TYPE = MISSING, |
538 | 542 | icon: Optional[TagChild] = None, |
539 | 543 | **kwargs: TagAttrValue, |
540 | | -): |
| 544 | +) -> RecallContextManager[AccordionPanel]: |
541 | 545 | """ |
542 | 546 | Single accordion panel. |
543 | 547 |
|
@@ -583,7 +587,7 @@ def navset( |
583 | 587 | selected: Optional[str] = None, |
584 | 588 | header: TagChild = None, |
585 | 589 | footer: TagChild = None, |
586 | | -): |
| 590 | +) -> RecallContextManager[NavSet]: |
587 | 591 | """ |
588 | 592 | Render a set of nav items |
589 | 593 |
|
@@ -635,7 +639,7 @@ def navset_card( |
635 | 639 | sidebar: Optional[ui.Sidebar] = None, |
636 | 640 | header: TagChild = None, |
637 | 641 | footer: TagChild = None, |
638 | | -): |
| 642 | +) -> RecallContextManager[NavSetCard]: |
639 | 643 | """ |
640 | 644 | Render a set of nav items inside a card container. |
641 | 645 |
|
@@ -687,7 +691,7 @@ def nav_panel( |
687 | 691 | *, |
688 | 692 | value: Optional[str] = None, |
689 | 693 | icon: TagChild = None, |
690 | | -): |
| 694 | +) -> RecallContextManager[NavPanel]: |
691 | 695 | """ |
692 | 696 | Create a nav item pointing to some internal content. |
693 | 697 |
|
@@ -803,7 +807,7 @@ def page_fillable( |
803 | 807 | title: Optional[str] = None, |
804 | 808 | lang: Optional[str] = None, |
805 | 809 | **kwargs: TagAttrValue, |
806 | | -): |
| 810 | +) -> RecallContextManager[Tag]: |
807 | 811 | """ |
808 | 812 | Creates a fillable page. |
809 | 813 |
|
@@ -854,7 +858,7 @@ def page_sidebar( |
854 | 858 | window_title: str | MISSING_TYPE = MISSING, |
855 | 859 | lang: Optional[str] = None, |
856 | 860 | **kwargs: TagAttrValue, |
857 | | -): |
| 861 | +) -> RecallContextManager[Tag]: |
858 | 862 | """ |
859 | 863 | Create a page with a sidebar and a title. |
860 | 864 |
|
|
0 commit comments