Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(api)!: Rename ui.navset_pill_card -> ui.navset_card_pill and ui.navset_tab_card -> ui.navset_card_tab #681

Merged
merged 5 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [UNRELEASED]

### API changes

* 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

* Added `shiny.render.renderer_components` decorator to help create new output renderers. (#621)

### Bug fixes

Fixes #646: Wrap bare value box value in `<p />` tags. (#668)
* Fixes #646: Wrap bare value box value in `<p />` tags. (#668)

### Other changes

Expand Down
8 changes: 4 additions & 4 deletions docs/_quartodoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ quartodoc:
- ui.nav_spacer
- ui.nav_menu
- ui.navset_tab
- ui.navset_tab_card
- ui.navset_card_tab
- ui.navset_pill
- ui.navset_pill_card
- ui.navset_card_pill
- ui.navset_pill_list
- ui.navset_hidden
- title: UI panels
Expand Down Expand Up @@ -247,8 +247,8 @@ quartodoc:
- experimental.ui.layout_sidebar
- experimental.ui.page_navbar
- experimental.ui.navset_bar
- experimental.ui.navset_tab_card
- experimental.ui.navset_pill_card
- experimental.ui.navset_card_tab
- experimental.ui.navset_card_pill
- experimental.ui.sidebar_toggle
- experimental.ui.panel_main
- experimental.ui.panel_sidebar
Expand Down
2 changes: 1 addition & 1 deletion examples/event/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
8 changes: 4 additions & 4 deletions shiny/api-examples/nav/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ 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_pill_card()"),
ui.navset_pill_card(*nav_controls("navset_pill_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()"),
ui.navset_pill_list(*nav_controls("navset_pill_list()")),
)
Expand Down
2 changes: 1 addition & 1 deletion shiny/api-examples/update_navs/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
12 changes: 6 additions & 6 deletions shiny/experimental/e2e/navbar/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ 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_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
Expand Down
6 changes: 3 additions & 3 deletions shiny/experimental/ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_card_tab
from ._output import output_image, output_plot, output_ui
from ._page import page_fillable, page_navbar, page_sidebar
from ._sidebar import (
Expand Down Expand Up @@ -70,8 +70,8 @@
"page_navbar",
# Navs
"navset_bar",
"navset_tab_card",
"navset_pill_card",
"navset_card_tab",
"navset_card_pill",
# Card
"CardItem",
"ImgContainer",
Expand Down
16 changes: 8 additions & 8 deletions shiny/experimental/ui/_navs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

__all__ = (
"navset_bar",
"navset_tab_card",
"navset_pill_card",
"navset_card_tab",
"navset_card_pill",
)

import copy
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -287,7 +287,7 @@ def navset_pill_card(
* ~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
Expand Down Expand Up @@ -533,8 +533,8 @@ 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_pill_card
* ~shiny.experimental.ui.navset_card_tab
* ~shiny.experimental.ui.navset_card_pill
* ~shiny.ui.navset_hidden

Example
Expand Down
6 changes: 3 additions & 3 deletions shiny/experimental/ui/_sidebar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_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).
Expand Down Expand Up @@ -185,8 +185,8 @@ 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_tab`
* :func:`~shiny.experimental.ui.navset_card_pill`
"""
# TODO-future; validate `open`, bg, fg, class_, max_height_mobile

Expand Down
9 changes: 7 additions & 2 deletions shiny/ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,15 @@
nav_control,
nav_spacer,
navset_tab,
navset_tab_card,
navset_pill,
navset_pill_card,
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 (
Expand Down Expand Up @@ -176,6 +179,8 @@
"nav_spacer",
"navset_tab",
"navset_tab_card",
"navset_card_tab",
"navset_card_pill",
"navset_pill",
"navset_pill_card",
"navset_pill_list",
Expand Down
Loading