Skip to content

Commit 0527488

Browse files
committed
feat(navbar_options): Consolidate options and use in navset_bar()
1 parent 230940c commit 0527488

File tree

5 files changed

+336
-40
lines changed

5 files changed

+336
-40
lines changed

shiny/express/ui/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
notification_show,
109109
notification_remove,
110110
nav_spacer,
111+
navbar_options,
111112
Progress,
112113
Theme,
113114
value_box_theme,
@@ -282,6 +283,7 @@
282283
"navset_pill_list",
283284
"navset_tab",
284285
"navset_underline",
286+
"navbar_options",
285287
"value_box",
286288
"panel_well",
287289
"panel_conditional",

shiny/types.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,30 @@
3131
from htmltools import TagChild
3232

3333
from ._docstring import add_example
34-
from ._typing_extensions import NotRequired, TypedDict
34+
from ._typing_extensions import NotRequired, TypedDict, TypeIs
3535

3636
if TYPE_CHECKING:
3737
from matplotlib.figure import Figure
3838

39+
T = TypeVar("T")
40+
3941

4042
# Sentinel value - indicates a missing value in a function call.
4143
class MISSING_TYPE:
4244
pass
4345

4446

4547
MISSING: MISSING_TYPE = MISSING_TYPE()
48+
DEPRECATED: MISSING_TYPE = MISSING_TYPE() # A MISSING that communicates deprecation
49+
MaybeMissing = Union[T, MISSING_TYPE]
4650

47-
48-
T = TypeVar("T")
4951
ListOrTuple = Union[List[T], Tuple[T, ...]]
5052

5153

54+
def is_missing(x: Any) -> TypeIs[MISSING_TYPE]:
55+
return x is MISSING or isinstance(x, MISSING_TYPE)
56+
57+
5258
# Information about a single file, with a structure like:
5359
# {'name': 'mtcars.csv', 'size': 1303, 'type': 'text/csv', 'datapath: '/...../mtcars.csv'}
5460
# The incoming data doesn't include 'datapath'; that field is added by the

shiny/ui/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
nav_menu,
116116
nav_panel,
117117
nav_spacer,
118+
navbar_options,
118119
navset_bar,
119120
navset_card_pill,
120121
navset_card_tab,
@@ -291,6 +292,7 @@
291292
"navset_pill_list",
292293
"navset_hidden",
293294
"navset_bar",
295+
"navbar_options",
294296
# _notification
295297
"notification_show",
296298
"notification_remove",

0 commit comments

Comments
 (0)