From fc4174aee7b6228ab757d85332a169d16d911c34 Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Tue, 15 Aug 2023 16:36:50 -0400 Subject: [PATCH 1/4] `navset_pill_card` -> `navset_card_pill` --- CHANGELOG.md | 4 ++ docs/_quartodoc.yml | 4 +- shiny/api-examples/nav/app.py | 4 +- shiny/experimental/e2e/navbar/app.py | 6 +-- shiny/experimental/ui/__init__.py | 4 +- shiny/experimental/ui/_navs.py | 8 ++-- shiny/experimental/ui/_sidebar.py | 4 +- shiny/ui/__init__.py | 5 ++- shiny/ui/_navs.py | 55 ++++++++++++++++++++++------ tests/test_navs.py | 2 +- 10 files changed, 67 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98544f820..866a39032 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [UNRELEASED] +# Breaking changes + +* `shiny.ui.navset_pill_card` has been renamed to `shiny.ui.navset_pill_card_panel` (TODO-barret). + ### New features * Added `shiny.render.renderer_components` decorator to help create new output renderers. (#621) diff --git a/docs/_quartodoc.yml b/docs/_quartodoc.yml index aaa17d8e1..4a4dddba7 100644 --- a/docs/_quartodoc.yml +++ b/docs/_quartodoc.yml @@ -79,7 +79,7 @@ quartodoc: - ui.navset_tab - ui.navset_tab_card - ui.navset_pill - - ui.navset_pill_card + - ui.navset_card_pill - ui.navset_pill_list - ui.navset_hidden - title: UI panels @@ -248,7 +248,7 @@ quartodoc: - experimental.ui.page_navbar - experimental.ui.navset_bar - experimental.ui.navset_tab_card - - experimental.ui.navset_pill_card + - experimental.ui.navset_card_pill - experimental.ui.sidebar_toggle - experimental.ui.panel_main - experimental.ui.panel_sidebar diff --git a/shiny/api-examples/nav/app.py b/shiny/api-examples/nav/app.py index 65c9bea3c..cef97dab3 100644 --- a/shiny/api-examples/nav/app.py +++ b/shiny/api-examples/nav/app.py @@ -55,8 +55,8 @@ def nav_controls(prefix: str) -> List[NavSetArg]: ui.navset_pill(*nav_controls("navset_pill()")), ui.h4("navset_tab_card()"), ui.navset_tab_card(*nav_controls("navset_tab_card()")), - ui.h4("navset_pill_card()"), - ui.navset_pill_card(*nav_controls("navset_pill_card()")), + ui.h4("navset_card_pill()"), + ui.navset_card_pill(*nav_controls("navset_card_pill()")), ui.h4("navset_pill_list()"), ui.navset_pill_list(*nav_controls("navset_pill_list()")), ) diff --git a/shiny/experimental/e2e/navbar/app.py b/shiny/experimental/e2e/navbar/app.py index a9cf2d9e1..23363d859 100644 --- a/shiny/experimental/e2e/navbar/app.py +++ b/shiny/experimental/e2e/navbar/app.py @@ -56,9 +56,9 @@ def nav_items(prefix: str) -> list[NavSetArg]: *nav_items("navset_tab_card()"), sidebar=my_sidebar, ), - ui.h4("navset_pill_card()"), - x.ui.navset_pill_card( - *nav_items("navset_pill_card()"), + ui.h4("navset_card_pill()"), + x.ui.navset_card_pill( + *nav_items("navset_card_pill()"), sidebar=my_sidebar, ), # Do not include `navset_bar()` in example. Ok for testing only diff --git a/shiny/experimental/ui/__init__.py b/shiny/experimental/ui/__init__.py index 54005f500..04e80c5ff 100644 --- a/shiny/experimental/ui/__init__.py +++ b/shiny/experimental/ui/__init__.py @@ -34,7 +34,7 @@ ) from ._input_text import input_text_area from ._layout import layout_column_wrap -from ._navs import navset_bar, navset_pill_card, navset_tab_card +from ._navs import navset_bar, navset_card_pill, navset_tab_card from ._output import output_image, output_plot, output_ui from ._page import page_fillable, page_navbar, page_sidebar from ._sidebar import ( @@ -71,7 +71,7 @@ # Navs "navset_bar", "navset_tab_card", - "navset_pill_card", + "navset_card_pill", # Card "CardItem", "ImgContainer", diff --git a/shiny/experimental/ui/_navs.py b/shiny/experimental/ui/_navs.py index 5f9f169cd..69ec788b6 100644 --- a/shiny/experimental/ui/_navs.py +++ b/shiny/experimental/ui/_navs.py @@ -3,7 +3,7 @@ __all__ = ( "navset_bar", "navset_tab_card", - "navset_pill_card", + "navset_card_pill", ) import copy @@ -229,7 +229,7 @@ def navset_tab_card( * ~shiny.experimental.ui.navset_bar * ~shiny.ui.navset_tab * ~shiny.ui.navset_pill - * ~shiny.experimental.ui.navset_pill_card + * ~shiny.experimental.ui.navset_card_pill * ~shiny.ui.navset_hidden Example @@ -249,7 +249,7 @@ def navset_tab_card( ) -def navset_pill_card( +def navset_card_pill( *args: NavSetArg, id: Optional[str] = None, selected: Optional[str] = None, @@ -534,7 +534,7 @@ def navset_bar( * ~shiny.ui.navset_tab * ~shiny.ui.navset_pill * ~shiny.experimental.ui.navset_tab_card - * ~shiny.experimental.ui.navset_pill_card + * ~shiny.experimental.ui.navset_card_pill * ~shiny.ui.navset_hidden Example diff --git a/shiny/experimental/ui/_sidebar.py b/shiny/experimental/ui/_sidebar.py index 3933154a9..30f6e34b2 100644 --- a/shiny/experimental/ui/_sidebar.py +++ b/shiny/experimental/ui/_sidebar.py @@ -133,7 +133,7 @@ def sidebar( * :func:`~shiny.experimental.ui.layout_sidebar` * Creates a sidebar layout component which can be dropped inside any Shiny UI page method (e.g. :func:`~shiny.experimental.ui.page_fillable`) or :func:`~shiny.experimental.ui.card` context. - * :func:`~shiny.experimental.ui.navset_bar`, :func:`~shiny.experimental.ui.navset_tab_card`, and :func:`~shiny.experimental.ui.navset_pill_card` + * :func:`~shiny.experimental.ui.navset_bar`, :func:`~shiny.experimental.ui.navset_tab_card`, and :func:`~shiny.experimental.ui.navset_card_pill` * Creates a multi page/tab UI with a singular `sidebar()` (which is shown on every page/tab). @@ -186,7 +186,7 @@ def sidebar( * :func:`~shiny.experimental.ui.layout_sidebar` * :func:`~shiny.experimental.ui.navset_bar` * :func:`~shiny.experimental.ui.navset_tab_card` - * :func:`~shiny.experimental.ui.navset_pill_card` + * :func:`~shiny.experimental.ui.navset_card_pill` """ # TODO-future; validate `open`, bg, fg, class_, max_height_mobile diff --git a/shiny/ui/__init__.py b/shiny/ui/__init__.py index 5a579ac11..f562eb84d 100644 --- a/shiny/ui/__init__.py +++ b/shiny/ui/__init__.py @@ -61,10 +61,12 @@ navset_tab, navset_tab_card, navset_pill, - navset_pill_card, + navset_card_pill, navset_pill_list, navset_hidden, navset_bar, + # Deprecated + navset_pill_card, ) from ._notification import notification_show, notification_remove from ._output import ( @@ -177,6 +179,7 @@ "navset_tab", "navset_tab_card", "navset_pill", + "navset_card_pill", "navset_pill_card", "navset_pill_list", "navset_hidden", diff --git a/shiny/ui/_navs.py b/shiny/ui/_navs.py index e368f8be4..93e7cfddb 100644 --- a/shiny/ui/_navs.py +++ b/shiny/ui/_navs.py @@ -8,10 +8,12 @@ "navset_tab", "navset_tab_card", "navset_pill", - "navset_pill_card", + "navset_card_pill", "navset_pill_list", "navset_hidden", "navset_bar", + # Deprecated - 2023-08-15 + "navset_pill_card", ) import copy @@ -20,6 +22,7 @@ from htmltools import MetadataNode, Tag, TagChild, TagList, div, tags +from .._deprecated import warn_deprecated from .._docstring import add_example from .._namespaces import resolve_id from .._utils import private_random_int @@ -120,7 +123,7 @@ def nav( ~shiny.ui.navset_tab ~shiny.ui.navset_pill ~shiny.ui.navset_tab_card - ~shiny.ui.navset_pill_card + ~shiny.ui.navset_card_pill ~shiny.ui.navset_hidden """ if value is None: @@ -161,7 +164,7 @@ def nav_control(*args: TagChild) -> Nav: ~shiny.ui.navset_tab ~shiny.ui.navset_pill ~shiny.ui.navset_tab_card - ~shiny.ui.navset_pill_card + ~shiny.ui.navset_card_pill ~shiny.ui.navset_hidden Example ------- @@ -183,7 +186,7 @@ def nav_spacer() -> Nav: ~shiny.ui.navset_tab ~shiny.ui.navset_pill ~shiny.ui.navset_tab_card - ~shiny.ui.navset_pill_card + ~shiny.ui.navset_card_pill ~shiny.ui.navset_hidden Example @@ -316,7 +319,7 @@ def nav_menu( ~shiny.ui.navset_tab ~shiny.ui.navset_pill ~shiny.ui.navset_tab_card - ~shiny.ui.navset_pill_card + ~shiny.ui.navset_card_pill ~shiny.ui.navset_hidden Example ------- @@ -410,7 +413,7 @@ def navset_tab( ~shiny.ui.navset_bar ~shiny.ui.navset_pill ~shiny.ui.navset_tab_card - ~shiny.ui.navset_pill_card + ~shiny.ui.navset_card_pill ~shiny.ui.navset_hidden Example @@ -462,7 +465,7 @@ def navset_pill( ~shiny.ui.navset_bar ~shiny.ui.navset_tab ~shiny.ui.navset_tab_card - ~shiny.ui.navset_pill_card + ~shiny.ui.navset_card_pill ~shiny.ui.navset_hidden Example @@ -515,7 +518,7 @@ def navset_hidden( ~shiny.ui.navset_tab ~shiny.ui.navset_tab_card ~shiny.ui.navset_pill - ~shiny.ui.navset_pill_card + ~shiny.ui.navset_card_pill ~shiny.ui.navset_pill_list ~shiny.ui.navset_bar """ @@ -594,7 +597,7 @@ def navset_tab_card( ~shiny.ui.navset_bar ~shiny.ui.navset_tab ~shiny.ui.navset_pill - ~shiny.ui.navset_pill_card + ~shiny.ui.navset_card_pill ~shiny.ui.navset_hidden Example @@ -613,7 +616,7 @@ def navset_tab_card( ) -def navset_pill_card( +def navset_card_pill( *args: NavSetArg, id: Optional[str] = None, selected: Optional[str] = None, @@ -743,7 +746,7 @@ def navset_pill_list( ~shiny.ui.navset_tab ~shiny.ui.navset_tab_card ~shiny.ui.navset_pill - ~shiny.ui.navset_pill_card + ~shiny.ui.navset_card_pill ~shiny.ui.navset_hidden ~shiny.ui.navset_bar ~shiny.ui.navset_hidden @@ -911,7 +914,7 @@ def navset_bar( ~shiny.ui.navset_tab ~shiny.ui.navset_pill ~shiny.ui.navset_tab_card - ~shiny.ui.navset_pill_card + ~shiny.ui.navset_card_pill ~shiny.ui.navset_hidden Example @@ -997,3 +1000,31 @@ def card(*args: TagChild, header: TagChild = None, footer: TagChild = None) -> T bootstrap_deps(), class_="card", ) + + +############################################## +# Deprecated +############################################## +# Deprecated 2023-08-15 +def navset_pill_card( + *args: NavSetArg, + id: Optional[str] = None, + selected: Optional[str] = None, + header: TagChild = None, + footer: TagChild = None, + placement: Literal["above", "below"] = "above", +) -> NavSetCard: + """Deprecated. Please use `navset_card_pill()` instead of `navset_pill_card()`.""" + warn_deprecated( + "`navset_pill_card()` is deprecated. " + "This method will be remove in a future version, " + "please use :func:`~shiny.ui.navset_card_pill` instead." + ) + return navset_card_pill( + *args, + id=id, + selected=selected, + header=header, + footer=footer, + placement=placement, + ) diff --git a/tests/test_navs.py b/tests/test_navs.py index 083eda6dd..8abf50d94 100644 --- a/tests/test_navs.py +++ b/tests/test_navs.py @@ -97,7 +97,7 @@ def test_nav_markup(): ) x = with_private_seed( - ui.navset_pill_card, + ui.navset_card_pill, a, ui.nav_menu("Menu", c), b, From 63bbb78be41bf909af91d1a384a372b8738f159e Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Tue, 15 Aug 2023 16:43:13 -0400 Subject: [PATCH 2/4] `navset_tab_card` -> `navset_card_tab` --- CHANGELOG.md | 3 +- docs/_quartodoc.yml | 4 +-- examples/event/app.py | 2 +- shiny/api-examples/nav/app.py | 4 +-- shiny/api-examples/update_navs/app.py | 2 +- shiny/experimental/e2e/navbar/app.py | 6 ++-- shiny/experimental/ui/__init__.py | 4 +-- shiny/experimental/ui/_navs.py | 8 ++--- shiny/experimental/ui/_sidebar.py | 4 +-- shiny/ui/__init__.py | 6 ++-- shiny/ui/_navs.py | 48 ++++++++++++++++++++------- 11 files changed, 59 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 866a39032..93727482e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 # Breaking changes -* `shiny.ui.navset_pill_card` has been renamed to `shiny.ui.navset_pill_card_panel` (TODO-barret). +* `shiny.ui.navset_pill_card` has been renamed to `shiny.ui.navset_card_pill` (TODO-barret). +* `shiny.ui.navset_tab_card` has been renamed to `shiny.ui.navset_card_tab` (TODO-barret). ### New features diff --git a/docs/_quartodoc.yml b/docs/_quartodoc.yml index 4a4dddba7..6d032d539 100644 --- a/docs/_quartodoc.yml +++ b/docs/_quartodoc.yml @@ -77,7 +77,7 @@ quartodoc: - ui.nav_spacer - ui.nav_menu - ui.navset_tab - - ui.navset_tab_card + - ui.navset_card_tab - ui.navset_pill - ui.navset_card_pill - ui.navset_pill_list @@ -247,7 +247,7 @@ quartodoc: - experimental.ui.layout_sidebar - experimental.ui.page_navbar - experimental.ui.navset_bar - - experimental.ui.navset_tab_card + - experimental.ui.navset_card_tab - experimental.ui.navset_card_pill - experimental.ui.sidebar_toggle - experimental.ui.panel_main diff --git a/examples/event/app.py b/examples/event/app.py index c96f7ca85..20adf5d25 100644 --- a/examples/event/app.py +++ b/examples/event/app.py @@ -11,7 +11,7 @@ print the number of clicks in the console twice. """ ), - ui.navset_tab_card( + ui.navset_card_tab( ui.nav( "Sync", ui.input_action_button("btn", "Click me"), diff --git a/shiny/api-examples/nav/app.py b/shiny/api-examples/nav/app.py index cef97dab3..ed255589c 100644 --- a/shiny/api-examples/nav/app.py +++ b/shiny/api-examples/nav/app.py @@ -53,8 +53,8 @@ def nav_controls(prefix: str) -> List[NavSetArg]: ui.navset_tab(*nav_controls("navset_tab()")), ui.h4("navset_pill()"), ui.navset_pill(*nav_controls("navset_pill()")), - ui.h4("navset_tab_card()"), - ui.navset_tab_card(*nav_controls("navset_tab_card()")), + ui.h4("navset_card_tab()"), + ui.navset_card_tab(*nav_controls("navset_card_tab()")), ui.h4("navset_card_pill()"), ui.navset_card_pill(*nav_controls("navset_card_pill()")), ui.h4("navset_pill_list()"), diff --git a/shiny/api-examples/update_navs/app.py b/shiny/api-examples/update_navs/app.py index de5961508..e319eba51 100644 --- a/shiny/api-examples/update_navs/app.py +++ b/shiny/api-examples/update_navs/app.py @@ -6,7 +6,7 @@ ui.input_slider("controller", "Controller", min=1, max=3, value=1) ), ui.panel_main( - ui.navset_tab_card( + ui.navset_card_tab( ui.nav("Panel 1", "Panel 1 content", value="panel1"), ui.nav("Panel 2", "Panel 2 content", value="panel2"), ui.nav("Panel 3", "Panel 3 content", value="panel3"), diff --git a/shiny/experimental/e2e/navbar/app.py b/shiny/experimental/e2e/navbar/app.py index 23363d859..78761a44b 100644 --- a/shiny/experimental/e2e/navbar/app.py +++ b/shiny/experimental/e2e/navbar/app.py @@ -51,9 +51,9 @@ def nav_items(prefix: str) -> list[NavSetArg]: ), footer=ui.div( {"style": "width:80%; margin: 0 auto"}, - ui.h4("navset_tab_card()"), - x.ui.navset_tab_card( - *nav_items("navset_tab_card()"), + ui.h4("navset_card_tab()"), + x.ui.navset_card_tab( + *nav_items("navset_card_tab()"), sidebar=my_sidebar, ), ui.h4("navset_card_pill()"), diff --git a/shiny/experimental/ui/__init__.py b/shiny/experimental/ui/__init__.py index 04e80c5ff..6f46660dc 100644 --- a/shiny/experimental/ui/__init__.py +++ b/shiny/experimental/ui/__init__.py @@ -34,7 +34,7 @@ ) from ._input_text import input_text_area from ._layout import layout_column_wrap -from ._navs import navset_bar, navset_card_pill, navset_tab_card +from ._navs import navset_bar, navset_card_pill, navset_card_tab from ._output import output_image, output_plot, output_ui from ._page import page_fillable, page_navbar, page_sidebar from ._sidebar import ( @@ -70,7 +70,7 @@ "page_navbar", # Navs "navset_bar", - "navset_tab_card", + "navset_card_tab", "navset_card_pill", # Card "CardItem", diff --git a/shiny/experimental/ui/_navs.py b/shiny/experimental/ui/_navs.py index 69ec788b6..b3b9e78f0 100644 --- a/shiny/experimental/ui/_navs.py +++ b/shiny/experimental/ui/_navs.py @@ -2,7 +2,7 @@ __all__ = ( "navset_bar", - "navset_tab_card", + "navset_card_tab", "navset_card_pill", ) @@ -194,7 +194,7 @@ def navset_card_body(content: Tag, sidebar: Optional[Sidebar] = None) -> CardIte return CardItem(content) -def navset_tab_card( +def navset_card_tab( *args: NavSetArg, id: Optional[str] = None, selected: Optional[str] = None, @@ -287,7 +287,7 @@ def navset_card_pill( * ~shiny.experimental.ui.navset_bar * ~shiny.ui.navset_tab * ~shiny.ui.navset_pill - * ~shiny.experimental.ui.navset_tab_card + * ~shiny.experimental.ui.navset_card_tab * ~shiny.ui.navset_hidden Example @@ -533,7 +533,7 @@ def navset_bar( * ~shiny.ui.nav_spacer * ~shiny.ui.navset_tab * ~shiny.ui.navset_pill - * ~shiny.experimental.ui.navset_tab_card + * ~shiny.experimental.ui.navset_card_tab * ~shiny.experimental.ui.navset_card_pill * ~shiny.ui.navset_hidden diff --git a/shiny/experimental/ui/_sidebar.py b/shiny/experimental/ui/_sidebar.py index 30f6e34b2..233186680 100644 --- a/shiny/experimental/ui/_sidebar.py +++ b/shiny/experimental/ui/_sidebar.py @@ -133,7 +133,7 @@ def sidebar( * :func:`~shiny.experimental.ui.layout_sidebar` * Creates a sidebar layout component which can be dropped inside any Shiny UI page method (e.g. :func:`~shiny.experimental.ui.page_fillable`) or :func:`~shiny.experimental.ui.card` context. - * :func:`~shiny.experimental.ui.navset_bar`, :func:`~shiny.experimental.ui.navset_tab_card`, and :func:`~shiny.experimental.ui.navset_card_pill` + * :func:`~shiny.experimental.ui.navset_bar`, :func:`~shiny.experimental.ui.navset_card_tab`, and :func:`~shiny.experimental.ui.navset_card_pill` * Creates a multi page/tab UI with a singular `sidebar()` (which is shown on every page/tab). @@ -185,7 +185,7 @@ def sidebar( -------- * :func:`~shiny.experimental.ui.layout_sidebar` * :func:`~shiny.experimental.ui.navset_bar` - * :func:`~shiny.experimental.ui.navset_tab_card` + * :func:`~shiny.experimental.ui.navset_card_tab` * :func:`~shiny.experimental.ui.navset_card_pill` """ # TODO-future; validate `open`, bg, fg, class_, max_height_mobile diff --git a/shiny/ui/__init__.py b/shiny/ui/__init__.py index f562eb84d..9554ee305 100644 --- a/shiny/ui/__init__.py +++ b/shiny/ui/__init__.py @@ -59,14 +59,15 @@ nav_control, nav_spacer, navset_tab, - navset_tab_card, navset_pill, navset_card_pill, + navset_card_tab, navset_pill_list, navset_hidden, navset_bar, # Deprecated navset_pill_card, + navset_tab_card, ) from ._notification import notification_show, notification_remove from ._output import ( @@ -178,8 +179,9 @@ "nav_spacer", "navset_tab", "navset_tab_card", - "navset_pill", + "navset_card_tab", "navset_card_pill", + "navset_pill", "navset_pill_card", "navset_pill_list", "navset_hidden", diff --git a/shiny/ui/_navs.py b/shiny/ui/_navs.py index 93e7cfddb..7ff55ca8a 100644 --- a/shiny/ui/_navs.py +++ b/shiny/ui/_navs.py @@ -6,7 +6,7 @@ "nav_control", "nav_spacer", "navset_tab", - "navset_tab_card", + "navset_card_tab", "navset_pill", "navset_card_pill", "navset_pill_list", @@ -14,6 +14,7 @@ "navset_bar", # Deprecated - 2023-08-15 "navset_pill_card", + "navset_tab_card", ) import copy @@ -122,7 +123,7 @@ def nav( ~shiny.ui.navset_bar ~shiny.ui.navset_tab ~shiny.ui.navset_pill - ~shiny.ui.navset_tab_card + ~shiny.ui.navset_card_tab ~shiny.ui.navset_card_pill ~shiny.ui.navset_hidden """ @@ -163,7 +164,7 @@ def nav_control(*args: TagChild) -> Nav: ~shiny.ui.navset_bar ~shiny.ui.navset_tab ~shiny.ui.navset_pill - ~shiny.ui.navset_tab_card + ~shiny.ui.navset_card_tab ~shiny.ui.navset_card_pill ~shiny.ui.navset_hidden Example @@ -185,7 +186,7 @@ def nav_spacer() -> Nav: ~shiny.ui.navset_bar ~shiny.ui.navset_tab ~shiny.ui.navset_pill - ~shiny.ui.navset_tab_card + ~shiny.ui.navset_card_tab ~shiny.ui.navset_card_pill ~shiny.ui.navset_hidden @@ -318,7 +319,7 @@ def nav_menu( ~shiny.ui.navset_bar ~shiny.ui.navset_tab ~shiny.ui.navset_pill - ~shiny.ui.navset_tab_card + ~shiny.ui.navset_card_tab ~shiny.ui.navset_card_pill ~shiny.ui.navset_hidden Example @@ -412,7 +413,7 @@ def navset_tab( ~shiny.ui.nav_spacer ~shiny.ui.navset_bar ~shiny.ui.navset_pill - ~shiny.ui.navset_tab_card + ~shiny.ui.navset_card_tab ~shiny.ui.navset_card_pill ~shiny.ui.navset_hidden @@ -464,7 +465,7 @@ def navset_pill( ~shiny.ui.nav_spacer ~shiny.ui.navset_bar ~shiny.ui.navset_tab - ~shiny.ui.navset_tab_card + ~shiny.ui.navset_card_tab ~shiny.ui.navset_card_pill ~shiny.ui.navset_hidden @@ -516,7 +517,7 @@ def navset_hidden( ~shiny.ui.nav_control ~shiny.ui.nav_spacer ~shiny.ui.navset_tab - ~shiny.ui.navset_tab_card + ~shiny.ui.navset_card_tab ~shiny.ui.navset_pill ~shiny.ui.navset_card_pill ~shiny.ui.navset_pill_list @@ -563,7 +564,7 @@ def layout(self, nav: TagChild, content: TagChild) -> Tag: return card(self.header, content, self.footer, header=nav) -def navset_tab_card( +def navset_card_tab( *args: NavSetArg, id: Optional[str] = None, selected: Optional[str] = None, @@ -653,7 +654,7 @@ def navset_card_pill( ~shiny.ui.navset_bar ~shiny.ui.navset_tab ~shiny.ui.navset_pill - ~shiny.ui.navset_tab_card + ~shiny.ui.navset_card_tab ~shiny.ui.navset_hidden Example @@ -744,7 +745,7 @@ def navset_pill_list( ~shiny.ui.nav_control ~shiny.ui.nav_spacer ~shiny.ui.navset_tab - ~shiny.ui.navset_tab_card + ~shiny.ui.navset_card_tab ~shiny.ui.navset_pill ~shiny.ui.navset_card_pill ~shiny.ui.navset_hidden @@ -913,7 +914,7 @@ def navset_bar( ~shiny.ui.nav_spacer ~shiny.ui.navset_tab ~shiny.ui.navset_pill - ~shiny.ui.navset_tab_card + ~shiny.ui.navset_card_tab ~shiny.ui.navset_card_pill ~shiny.ui.navset_hidden @@ -1028,3 +1029,26 @@ def navset_pill_card( footer=footer, placement=placement, ) + + +# Deprecated 2023-08-15 +def navset_tab_card( + *args: NavSetArg, + id: Optional[str] = None, + selected: Optional[str] = None, + header: TagChild = None, + footer: TagChild = None, +) -> NavSetCard: + """Deprecated. Please use `navset_card_tab()` instead of `navset_tab_card()`.""" + warn_deprecated( + "`navset_tab_card()` is deprecated. " + "This method will be remove in a future version, " + "please use :func:`~shiny.ui.navset_card_tab` instead." + ) + return navset_card_tab( + *args, + id=id, + selected=selected, + header=header, + footer=footer, + ) From c61288b261c6982a041aa8c716510e8e37eb1274 Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Wed, 16 Aug 2023 11:37:52 -0400 Subject: [PATCH 3/4] Update _navs.py --- shiny/ui/_navs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shiny/ui/_navs.py b/shiny/ui/_navs.py index 7ff55ca8a..e5b7c9aa2 100644 --- a/shiny/ui/_navs.py +++ b/shiny/ui/_navs.py @@ -1018,7 +1018,7 @@ def navset_pill_card( """Deprecated. Please use `navset_card_pill()` instead of `navset_pill_card()`.""" warn_deprecated( "`navset_pill_card()` is deprecated. " - "This method will be remove in a future version, " + "This method will be removed in a future version, " "please use :func:`~shiny.ui.navset_card_pill` instead." ) return navset_card_pill( @@ -1042,7 +1042,7 @@ def navset_tab_card( """Deprecated. Please use `navset_card_tab()` instead of `navset_tab_card()`.""" warn_deprecated( "`navset_tab_card()` is deprecated. " - "This method will be remove in a future version, " + "This method will be removed in a future version, " "please use :func:`~shiny.ui.navset_card_tab` instead." ) return navset_card_tab( From 30f73367d2b1c218a3fe0f6a0a3fcd3cae082f12 Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Wed, 16 Aug 2023 11:47:05 -0400 Subject: [PATCH 4/4] Update CHANGELOG.md --- CHANGELOG.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93727482e..0116d3032 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,10 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [UNRELEASED] -# Breaking changes +### API changes -* `shiny.ui.navset_pill_card` has been renamed to `shiny.ui.navset_card_pill` (TODO-barret). -* `shiny.ui.navset_tab_card` has been renamed to `shiny.ui.navset_card_tab` (TODO-barret). +* Renamed `shiny.ui.navset_pill_card` to `shiny.ui.navset_card_pill`. `shiny.ui.navset_pill_card` will throw a deprecated warning (#492). +* Renamed `shiny.ui.navset_tab_card` to `shiny.ui.navset_card_tab`. `shiny.ui.navset_tab_card` will throw a deprecated warning (#492). +* Renamed `shiny.experimental.ui.navset_pill_card` to `shiny.experimental.ui.navset_card_pill` (#492). +* Renamed `shiny.experimental.ui.navset_tab_card` to `shiny.experimental.ui.navset_card_tab` (#492). ### New features @@ -19,7 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Bug fixes -Fixes #646: Wrap bare value box value in `

` tags. (#668) +* Fixes #646: Wrap bare value box value in `

` tags. (#668) ### Other changes