Skip to content

Commit

Permalink
chore: Finer-grained usage of the experimental badge (#837)
Browse files Browse the repository at this point in the history
  • Loading branch information
gadenbuie authored Oct 17, 2023
1 parent b7208b4 commit eafad9b
Show file tree
Hide file tree
Showing 26 changed files with 100 additions and 17 deletions.
8 changes: 7 additions & 1 deletion R/accordion.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#' Create a vertically collapsing accordion
#'
#' @description
#' `r lifecycle::badge("experimental")`
#'
#' @param ... Named arguments become attributes on the `<div class="accordion">`
#' element. Unnamed arguments should be `accordion_panel()`s.
#' @param id If provided, you can use `input$id` in your server logic to
Expand All @@ -18,7 +21,7 @@
#'
#' @export
#' @seealso [accordion_panel_set()]
#' @examplesIf interactive()
#' @examplesIf rlang::is_interactive()
#'
#' items <- lapply(LETTERS, function(x) {
#' accordion_panel(paste("Section", x), paste("Some narrative for section", x))
Expand Down Expand Up @@ -161,6 +164,9 @@ accordion_panel <- function(title, ..., value = title, icon = NULL) {

#' Dynamically update accordions
#'
#' @description
#' `r lifecycle::badge("experimental")`
#'
#' Dynamically (i.e., programmatically) update/modify [`accordion()`]s in a
#' Shiny app. These functions require an `id` to be provided to the
#' `accordion()` and must also be called within an active Shiny session.
Expand Down
9 changes: 7 additions & 2 deletions R/breakpoints.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
#' Define breakpoint values
#'
#' A generic constructor for responsive breakpoints.
#' @description
#' `r lifecycle::badge("experimental")`
#'
#' A generic constructor for responsive breakpoints.
#' @param sm Values to apply at the `sm` breakpoint.
#' @param md Values to apply at the `md` breakpoint.
#' @param lg Values to apply at the `lg` breakpoint.
#' @param ... Other breakpoints (e.g., `xl`).
#'
#' @seealso [layout_columns()]
#' @references <https://getbootstrap.com/docs/5.3/layout/breakpoints/>
#'
#' @examples
#' breakpoints(sm = c(4, 4, 4), md = c(3, 3, 6), lg = c(-2, 8, -2))
#'
#' @export
#' @seealso [layout_columns()]
breakpoints <- function(..., sm = NULL, md = NULL, lg = NULL) {
breaks <- dropNulls(
rlang::list2(..., sm = sm, md = md, lg = lg)
Expand Down
3 changes: 3 additions & 0 deletions R/card.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#' A Bootstrap card component
#'
#' @description
#' `r lifecycle::badge("experimental")`
#'
#' A general purpose container for grouping related UI elements together with a
#' border and optional padding. To learn more about [card()]s, see [this
#' article](https://rstudio.github.io/bslib/articles/cards.html).
Expand Down
3 changes: 3 additions & 0 deletions R/input-dark-mode.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#' Dark mode input control
#'
#' @description
#' `r lifecycle::badge("experimental")`
#'
#' Creates a button that toggles between dark and light modes, specifically for
#' toggling between light and dark [Bootstrap color
#' modes](https://getbootstrap.com/docs/5.3/customize/color-modes/) -- a new
Expand Down
3 changes: 3 additions & 0 deletions R/input-switch.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#' Switch input control
#'
#' @description
#' `r lifecycle::badge("experimental")`
#'
#' Create an on-off style switch control for specifying logical values.
#'
#' @examplesIf interactive()
Expand Down
3 changes: 3 additions & 0 deletions R/layout.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#' A grid-like, column-first, layout
#'
#' @description
#' `r lifecycle::badge("experimental")`
#'
#' Wraps a 1d sequence of UI elements into a 2d grid. The number of columns (and
#' rows) in the grid dependent on the column `width` as well as the size of the
#' display. For more explanation and illustrative examples, see [here](https://rstudio.github.io/bslib/articles/cards.html#multiple-cards)
Expand Down
15 changes: 11 additions & 4 deletions R/page.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ page <- function(..., title = NULL, theme = bs_theme(), lang = NULL) {
)
}

#' @rdname page
#' @describeIn page A \pkg{bslib} wrapper for [shiny::fluidPage()], a fluid
#' Bootstrap-based page layout that extends to the full viewport width.
#' @inheritParams shiny::fluidPage
#' @export
page_fluid <- function(..., title = NULL, theme = bs_theme(), lang = NULL) {
Expand All @@ -38,7 +39,9 @@ page_fluid <- function(..., title = NULL, theme = bs_theme(), lang = NULL) {
)
}

#' @rdname page
#' @describeIn page A \pkg{bslib} wrapper for [shiny::fixedPage()], a fixed
#' Bootstrap-based page layout where the page content container is centered
#' horizontally and its width is constrained.
#' @inheritParams shiny::fixedPage
#' @export
page_fixed <- function(..., title = NULL, theme = bs_theme(), lang = NULL) {
Expand All @@ -48,7 +51,8 @@ page_fixed <- function(..., title = NULL, theme = bs_theme(), lang = NULL) {
)
}

#' @rdname page
#' @describeIn page `r lifecycle::badge("experimental")` A Bootstrap-based page
#' layout whose contents fill the full height and width of the browser window.
#' @param padding Padding to use for the body. This can be a numeric vector
#' (which will be interpreted as pixels) or a character vector with valid CSS
#' lengths. The length can be between one and four. If one, then that value
Expand Down Expand Up @@ -87,6 +91,9 @@ validateCssPadding <- function(padding = NULL) {

#' A sidebar page (i.e., dashboard)
#'
#' @description
#' `r lifecycle::badge("experimental")`
#'
#' Create a dashboard layout with a full-bleed header (`title`) and [sidebar()].
#'
#' @inheritParams layout_sidebar
Expand All @@ -103,7 +110,7 @@ validateCssPadding <- function(padding = NULL) {
#' @seealso [card()] for wrapping outputs in the 'main' content area.
#' @seealso [value_box()] for highlighting values.
#'
#' @examplesIf interactive()
#' @examplesIf rlang::is_interactive()
#'
#' library(shiny)
#' library(ggplot2)
Expand Down
3 changes: 3 additions & 0 deletions R/popover.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#' Add a popover to a UI element
#'
#' @description
#' `r lifecycle::badge("experimental")`
#'
#' Display additional information when clicking on a UI element (typically a
#' button).
#'
Expand Down
7 changes: 5 additions & 2 deletions R/sidebar.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#' Sidebar layouts
#'
#' @description Create a collapsing sidebar layout by providing a `sidebar()`
#' object to the `sidebar` argument of:
#' @description
#' `r lifecycle::badge("experimental")`
#'
#' Create a collapsing sidebar layout by providing a `sidebar()` object to the
#' `sidebar` argument of:
#'
#' * [page_sidebar()]
#' * Creates a "page-level" sidebar.
Expand Down
3 changes: 3 additions & 0 deletions R/tooltip.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#' Add a tooltip to a UI element
#'
#' @description
#' `r lifecycle::badge("experimental")`
#'
#' Display additional information when focusing (or hovering over) a UI element.
#'
#' @param trigger A UI element (i.e., [htmltools tag][htmltools::tags]) to serve
Expand Down
3 changes: 3 additions & 0 deletions R/value-box.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#' Value box
#'
#' @description
#' `r lifecycle::badge("experimental")`
#'
#' An opinionated ([card()]-powered) box, designed for displaying a `value` and
#' `title`. Optionally, a `showcase` can provide for context for what the
#' `value` represents (for example, it could hold a [bsicons::bs_icon()], or
Expand Down
4 changes: 3 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ output: github_document

<!-- badges: start -->

[![CRAN status](https://www.r-pkg.org/badges/version/bslib)](https://cran.r-project.org/package=bslib) [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html) [![R build status](https://github.com/rstudio/bslib/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/rstudio/bslib/actions)
[![CRAN status](https://www.r-pkg.org/badges/version/bslib)](https://cran.r-project.org/package=bslib)
[![bslib status badge](https://rstudio.r-universe.dev/badges/bslib)](https://rstudio.r-universe.dev/bslib)
[![R build status](https://github.com/rstudio/bslib/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/rstudio/bslib/actions)

<!-- badges: end -->

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

[![CRAN
status](https://www.r-pkg.org/badges/version/bslib)](https://cran.r-project.org/package=bslib)
[![Lifecycle:
experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html)
[![bslib status
badge](https://rstudio.r-universe.dev/badges/bslib)](https://rstudio.r-universe.dev/bslib)
[![R build
status](https://github.com/rstudio/bslib/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/rstudio/bslib/actions)

Expand Down
4 changes: 2 additions & 2 deletions man/accordion.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/accordion_panel_set.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions man/breakpoints.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/card.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/input_dark_mode.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/input_switch.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/layout_column_wrap.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions man/page.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/page_sidebar.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/popover.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/sidebar.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/tooltip.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/value_box.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit eafad9b

Please sign in to comment.