From b01be96118cf0b8d928a0b4cf4822ea7c976f66c Mon Sep 17 00:00:00 2001 From: AleKoure <22891491+AleKoure@users.noreply.github.com> Date: Tue, 15 Sep 2026 14:37:48 +0300 Subject: [PATCH 01/11] Quote software names in Title and Description (CRAN comment 1) CRAN review of 0.7.5 asked that package, software and API names be single-quoted in the Title and Description fields, noting that package names are case sensitive. Quote 'Bootstrap' and use the correctly-cased 'shiny' in both fields. Also rewrite the Description to drop the unsupported comparative claim ('cleaner, more flexible'), keep a consistent declarative mood, and name the actual components instead of 'reusable components'. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- DESCRIPTION | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index f48b1d1..3784df0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: bslibdash Type: Package -Title: Bootstrap 5 Dashboard Framework for Shiny Apps +Title: 'Bootstrap' 5 Dashboard Framework for 'shiny' Apps Version: 0.7.5 Authors@R: c( person("Alexandros", "Kouretsis", email = "alexandros@appsilon.com", role = c("aut", "cre")), @@ -8,10 +8,12 @@ Authors@R: c( person("Dominik", "Rafacz", email = "dominik.rafacz_ext@novartis.com", role = "aut"), person("Novartis Open Source Initiative", role = "cph") ) -Description: Build modern Bootstrap 5 dashboards in Shiny with 'bslib'. Provides a dashboard page shell - and reusable components that integrate with 'bslib' themes and follow Bootstrap design patterns. The - API is inspired by 'shinydashboard', where the underlying concepts are shared, helping existing apps - migrate with minimal changes while supporting a cleaner, more flexible dashboard design style. +Description: Provides a dashboard layer for 'shiny' applications built on 'bslib' and + 'Bootstrap' 5. Includes a dashboard page shell, sidebar navigation, cards, value boxes, + header dropdown menus and feedback components that inherit the active 'bslib' theme and + follow 'Bootstrap' design patterns. Function names mirror those of the 'shinydashboard' + package wherever the underlying concepts are shared, allowing existing applications to + migrate with minimal changes. License: MIT + file LICENSE URL: https://github.com/Novartis/bslibdash, https://opensource.nibr.com/bslibdash/ BugReports: https://github.com/Novartis/bslibdash/issues From d4c5203e9c4b12be108ba1794545e5c42e038975 Mon Sep 17 00:00:00 2001 From: AleKoure <22891491+AleKoure@users.noreply.github.com> Date: Tue, 15 Sep 2026 15:03:18 +0300 Subject: [PATCH 02/11] Document return values for all exported functions (CRAN comment 3) CRAN review of 0.7.5 reported missing \value tags in up to 28 .Rd files and asked that the documentation state the structure/class of the output and what it means. Add @return to every exported function in R/*.R and regenerate man/. Return classes were verified empirically rather than assumed: UI builders return shiny.tag (some as bslib_fragment), tabItem()/messageItem()/notificationItem()/taskItem() return shiny.tag.list, render* functions return shiny.render.function, and updateBox()/updateCard()/updateTabItems() return NULL invisibly and are documented as called for side effects. Cases returning NULL (disable/empty arguments) are called out explicitly. Also strengthen the four pre-existing \value tags (dashboardPage, brand_bs_theme, icon, sidebarUserPanel) which named no class. All 31 function .Rd files now have \value; the package-level doc is exempt. R CMD check --as-cran: 0 errors, 0 warnings. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- R/body.R | 7 +++++++ R/brand_bs_theme.R | 5 ++++- R/cards.R | 12 ++++++++++++ R/feedbacks.R | 5 +++++ R/grid.R | 3 +++ R/icons.R | 4 +++- R/inputs.R | 3 +++ R/layout.R | 15 ++++++++++++++- R/sidebar.R | 16 ++++++++++++++++ R/sidebar_user.R | 4 ++-- R/useful-items.R | 11 +++++++++++ R/widgets-boxes.R | 26 ++++++++++++++++++++++++++ R/widgets-menu.R | 22 ++++++++++++++++++++++ R/widgets-sidebar.R | 16 ++++++++++++++++ man/accordion.Rd | 8 ++++++++ man/actionButton.Rd | 4 ++++ man/badge.Rd | 5 +++++ man/box.Rd | 13 +++++++++++-- man/boxLayout.Rd | 10 ++++++++-- man/brand_bs_theme.Rd | 7 +++++-- man/bslibdash-package.Rd | 5 ++--- man/column.Rd | 4 ++++ man/dashboardBody.Rd | 11 +++++++++++ man/dashboardFooter.Rd | 4 ++++ man/dashboardHeader.Rd | 5 +++++ man/dashboardPage.Rd | 5 ++++- man/dashboardSidebar.Rd | 18 ++++++++++++++++++ man/dropdownMenu.Rd | 17 +++++++++++++++++ man/dropdownMenuOutput.Rd | 4 ++++ man/icon.Rd | 4 +++- man/infoBox.Rd | 5 +++++ man/infoBoxOutput.Rd | 4 ++++ man/menuItemOutput.Rd | 4 ++++ man/renderDropdownMenu.Rd | 4 ++++ man/renderInfoBox.Rd | 4 ++++ man/renderMenu.Rd | 4 ++++ man/renderValueBox.Rd | 4 ++++ man/sidebarMenuOutput.Rd | 4 ++++ man/sidebarSearchForm.Rd | 5 +++++ man/sidebarUserPanel.Rd | 4 ++-- man/tabBox.Rd | 9 ++++++++- man/tabsetPanel.Rd | 5 +++++ man/toast.Rd | 6 ++++++ man/updateTabItems.Rd | 4 ++++ man/valueBox.Rd | 5 +++++ man/valueBoxOutput.Rd | 4 ++++ 46 files changed, 329 insertions(+), 19 deletions(-) diff --git a/R/body.R b/R/body.R index acafb79..0fe63cd 100644 --- a/R/body.R +++ b/R/body.R @@ -1,6 +1,8 @@ #' Dashboard body #' #' @param ... Body content, usually `tabItems()`. +#' @return `dashboardBody()` returns a `shiny.tag` `
` wrapping the main +#' content area of the dashboard. #' @examples #' dashboardBody( #' tabItems( @@ -26,6 +28,8 @@ dashboardBody <- function(...) { #' @param id Shared Shiny id for the sidebar menu and body tabset. Use the same #' value in `sidebarMenu(id)`, `tabItems(id)`, and #' `updateTabItems(inputId)`. Defaults to `"sidebarMenu"`. +#' @return `tabItems()` returns a `shiny.tag` `
` containing a hidden +#' [shiny::tabsetPanel()] whose panels are switched by the sidebar menu. #' @examples #' tabItems( #' tabItem(tabName = "overview", shiny::p("Overview content")), @@ -38,6 +42,9 @@ tabItems <- function(..., id = "sidebarMenu") { } #' @param tabName The name of a tab. +#' @return `tabItem()` returns a `shiny.tag.list` holding the tab content, with +#' the tab name recorded in its `tabName` attribute so that `tabItems()` can +#' place it in the matching panel. #' @examples #' tabItem( #' tabName = "overview", diff --git a/R/brand_bs_theme.R b/R/brand_bs_theme.R index 073f417..b22c9ec 100644 --- a/R/brand_bs_theme.R +++ b/R/brand_bs_theme.R @@ -23,7 +23,10 @@ #' ) #' } #' -#' @return A `bslib` theme object. +#' @return A `bs_theme` object (also inheriting `bs_version_5` and +#' `sass_bundle`) carrying the bslibdash brand colour, typography and shape +#' variables. Pass it to the `theme` argument of [dashboardPage()], or extend +#' it with the `bslib::bs_add_*()` helpers. #' @examples #' theme <- brand_bs_theme() #' class(theme) diff --git a/R/cards.R b/R/cards.R index 07aa165..e0079a7 100644 --- a/R/cards.R +++ b/R/cards.R @@ -26,6 +26,11 @@ #' @param id Optional card id. Use to target the card with [updateBox()]. #' Provide distinct ids when rendering otherwise-identical cards on the same page. #' +#' @return `box()` returns a `shiny.tag`: a bslib card with the bslibdash card +#' styles attached as an HTML dependency. When `width` is an integer between +#' `1` and `12` the card is wrapped in a Bootstrap grid column; for any other +#' `width` the card itself is returned. +#' #' @examples #' box( #' "Card body", @@ -205,6 +210,11 @@ box <- function(..., #' `bslib::layout_column_wrap()` fallback is used, but prefer calling #' `bslib::layout_column_wrap()` directly for new code. #' +#' @return A `shiny.tag` `
` containing the supplied cards, laid out +#' according to `type`: a Bootstrap `.card-group` row, a responsive +#' `.row.row-cols-*` grid, or a `bslib::layout_column_wrap()` fragment for the +#' deprecated `"columns"` type. +#' #' @examples #' boxLayout( #' box("Revenue", title = "KPI"), @@ -266,6 +276,8 @@ boxLayout <- function(..., .list = NULL, type = c("group", "deck", "columns")) { #' @param action Action to trigger. #' @param options List of new options for `action = "update"`. #' @param session Shiny session. +#' @return `updateBox()`, and its alias `updateCard()`, return `NULL` invisibly. +#' They are called for their side effect of modifying the card in the browser. #' @rdname box #' @export updateBox <- function(id, diff --git a/R/feedbacks.R b/R/feedbacks.R index 22935c5..1051978 100644 --- a/R/feedbacks.R +++ b/R/feedbacks.R @@ -20,6 +20,11 @@ #' `"message"`, `"warning"`, `"error"`). #' @param session Shiny session object. #' +#' @return A character string holding the id of the notification created by +#' [shiny::showNotification()], which can be passed to +#' [shiny::removeNotification()]. Called mainly for the side effect of +#' displaying the toast. +#' #' @examples #' if (interactive()) { #' shiny::shinyApp( diff --git a/R/grid.R b/R/grid.R index 514a340..5cad467 100644 --- a/R/grid.R +++ b/R/grid.R @@ -4,6 +4,9 @@ #' @param ... Elements to include within the column. #' @param offset The number of columns to offset this column. #' +#' @return A `shiny.tag` `
` carrying the Bootstrap grid column classes and +#' wrapping the elements passed to `...`. +#' #' @examples #' shiny::fluidRow( #' column(8, shiny::p("Main content")), diff --git a/R/icons.R b/R/icons.R index 36e3bb4..f2396b7 100644 --- a/R/icons.R +++ b/R/icons.R @@ -7,7 +7,9 @@ #' @param color Icon color applied to a wrapping span. #' @param css Named list of CSS properties applied to the icon tag. #' -#' @return An icon `htmltools` tag. +#' @return An object of class `html` (a `character` string of HTML) containing +#' the icon tag, optionally wrapped in a styled span. Insert it directly into +#' a UI definition or pass it to the `icon` argument of a bslibdash component. #' @examples #' if (interactive()) { #' icon("user") diff --git a/R/inputs.R b/R/inputs.R index b69efac..8a28f1f 100644 --- a/R/inputs.R +++ b/R/inputs.R @@ -10,6 +10,9 @@ #' @param size Button size. #' @param flat Whether to apply a flat style. #' +#' @return A `shiny.tag` `