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

Add new colors: default status color (grey) and other "light" skins #131

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ shinydashboard 0.5.1.9000
--------------------------------------------------------------------------------
* Updated to AdminLTE 2.3.2 (1ee281b).



* Add more colors addressing #118 and #125 (dashboardPage light-skin colors and
"default" (grey) color boxes)


shinydashboard 0.5.1
--------------------------------------------------------------------------------

Expand Down
8 changes: 6 additions & 2 deletions R/dashboardPage.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
#' @param title A title to display in the browser's title bar. If no value is
#' provided, it will try to extract the title from the \code{dashboardHeader}.
#' @param skin A color theme. One of \code{"blue"}, \code{"black"},
#' \code{"purple"}, \code{"green"}, \code{"red"}, or \code{"yellow"}.
#' \code{"purple"}, \code{"green"}, \code{"red"}, or \code{"yellow"}. Or light
#' skin of each color, e.g. \code{"red-light"}
#'
#' @seealso \code{\link{dashboardHeader}}, \code{\link{dashboardSidebar}},
#' \code{\link{dashboardBody}}.
#'
#' @examples
#' ## Only run this example in interactive R sessions
#' if (interactive()) {
Expand All @@ -29,7 +31,9 @@
#' }
#' @export
dashboardPage <- function(header, sidebar, body, title = NULL,
skin = c("blue", "black", "purple", "green", "red", "yellow")) {
skin = c("blue", "blue-light", "black", "black-light", "purple",
"purple-light", "green", "green-light", "red", "red-light", "yellow",
"yellow-light")) {

tagAssert(header, type = "header", class = "main-header")
tagAssert(sidebar, type = "aside", class = "main-sidebar")
Expand Down
22 changes: 16 additions & 6 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,30 +63,38 @@ validateColor <- function(color) {
#'
#' \itemize{
#' \item \code{red}
#' \item \code{red-light}
#' \item \code{yellow}
#' \item \code{yellow-light}
#' \item \code{aqua}
#' \item \code{blue}
#' \item \code{light-blue}
#' \item \code{blue-light}
#' \item \code{green}
#' \item \code{green-light}
#' \item \code{navy}
#' \item \code{teal}
#' \item \code{gray}
#' \item \code{olive}
#' \item \code{lime}
#' \item \code{orange}
#' \item \code{fuchsia}
#' \item \code{purple}
#' \item \code{purple-light}
#' \item \code{maroon}
#' \item \code{black}
#' \item \code{black-light}
#' }
#'
#' @source \url{https://almsaeedstudio.com/themes/AdminLTE/documentation/index.html#layout}
#' @source \url{https://almsaeedstudio.com/themes/AdminLTE/pages/UI/general.html}
#' @usage NULL
#' @format NULL
#'
#' @keywords internal
validColors <- c("red", "yellow", "aqua", "blue", "light-blue", "green",
"navy", "teal", "olive", "lime", "orange", "fuchsia",
"purple", "maroon", "black")

validColors <- c("red", "red-light", "yellow", "yellow-light","green", "green-light",
"blue", "light-blue","blue-light", "black", "black-light",
"purple", "purple-light", "navy", "teal", "olive", "lime",
"orange", "fuchsia", "maroon", "gray", "aqua")

# Returns TRUE if a status is valid; throws error otherwise.
validateStatus <- function(status) {
Expand All @@ -112,13 +120,15 @@ validateStatus <- function(status) {
#' \item \code{info} Blue
#' \item \code{warning} Orange
#' \item \code{danger} Red
#' \item \code{default} Gray
#' }
#'
#' @usage NULL
#' @format NULL
#' @source \url{https://almsaeedstudio.com/themes/AdminLTE/documentation/index.html#component-box}
#'
#' @keywords internal
validStatuses <- c("primary", "success", "info", "warning", "danger")
validStatuses <- c("primary", "success", "info", "warning", "danger", "default")


"%OR%" <- function(a, b) if (!is.null(a)) a else b
Expand Down
8 changes: 5 additions & 3 deletions man/dashboardPage.Rd

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

12 changes: 12 additions & 0 deletions man/validColors.Rd

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

4 changes: 4 additions & 0 deletions man/validStatuses.Rd

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

4 changes: 3 additions & 1 deletion tests-manual/bigDash.R
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ body <- dashboardBody(tabItems(

box(
width = 4,
status = "default",
background = "light-blue",
p("This is content. The background color is set to light-blue")
)
Expand Down Expand Up @@ -306,6 +307,7 @@ server <- function(input, output) {

ui <- dashboardPage(header,
sidebar,
body)
body,
skin = "blue-light")

shinyApp(ui, server)