mirror of
https://github.com/rstudio/shiny.git
synced 2026-01-10 07:28:01 -05:00
rename bootstraplib package to bslib (#3132)
This commit is contained in:
@@ -93,7 +93,7 @@ Imports:
|
||||
withr,
|
||||
commonmark (>= 1.7),
|
||||
glue (>= 1.3.2),
|
||||
bootstraplib (>= 0.2.0.9001),
|
||||
bslib (>= 0.2.0.9001),
|
||||
cachem,
|
||||
ellipsis
|
||||
Suggests:
|
||||
@@ -116,7 +116,7 @@ Suggests:
|
||||
Remotes:
|
||||
rstudio/htmltools,
|
||||
rstudio/sass,
|
||||
rstudio/bootstraplib,
|
||||
rstudio/bslib,
|
||||
r-lib/cachem
|
||||
URL: http://shiny.rstudio.com
|
||||
BugReports: https://github.com/rstudio/shiny/issues
|
||||
|
||||
@@ -18,7 +18,7 @@ NULL
|
||||
#' Bootstrap 3.
|
||||
#' @param theme One of the following:
|
||||
#' * `NULL` (the default), which implies a "stock" build of Bootstrap 3.
|
||||
#' * A [bootstraplib::bs_theme()] object. This can be used to replace a stock
|
||||
#' * A [bslib::bs_theme()] object. This can be used to replace a stock
|
||||
#' build of Bootstrap 3 with a customized version of Bootstrap 3 or higher.
|
||||
#' * A character string pointing to an alternative Bootstrap stylesheet
|
||||
#' (normally a css file within the www directory, e.g. `www/bootstrap.css`).
|
||||
@@ -78,7 +78,7 @@ getLang <- function(ui) {
|
||||
#' @export
|
||||
bootstrapLib <- function(theme = NULL) {
|
||||
tagFunction(function() {
|
||||
# If we're not compiling Bootstrap Sass (from bootstraplib), return the
|
||||
# If we're not compiling Bootstrap Sass (from bslib), return the
|
||||
# static Bootstrap build.
|
||||
if (!is_bs_theme(theme)) {
|
||||
# We'll enter here if `theme` is the path to a .css file, like that
|
||||
@@ -119,19 +119,19 @@ bootstrapLib <- function(theme = NULL) {
|
||||
#)
|
||||
}
|
||||
|
||||
bootstraplib::bs_theme_dependencies(theme)
|
||||
bslib::bs_theme_dependencies(theme)
|
||||
})
|
||||
}
|
||||
|
||||
# This is defined outside of bootstrapLib() because registerThemeDependency()
|
||||
# wants a non-anonymous function with a single argument
|
||||
bs_theme_deps <- function(theme) {
|
||||
bootstraplib::bs_theme_dependencies(theme)
|
||||
bslib::bs_theme_dependencies(theme)
|
||||
}
|
||||
|
||||
is_bs_theme <- function(x) {
|
||||
is_available("bootstraplib", "0.2.0.9000") &&
|
||||
bootstraplib::is_bs_theme(x)
|
||||
is_available("bslib", "0.2.0.9000") &&
|
||||
bslib::is_bs_theme(x)
|
||||
}
|
||||
|
||||
#' Obtain Shiny's Bootstrap Sass theme
|
||||
@@ -140,7 +140,7 @@ is_bs_theme <- function(x) {
|
||||
#' styling based on the [bootstrapLib()]'s `theme` value.
|
||||
#'
|
||||
#' @return If called at render-time (i.e., inside a [htmltools::tagFunction()]),
|
||||
#' and [bootstrapLib()]'s `theme` has been set to a [bootstraplib::bs_theme()]
|
||||
#' and [bootstrapLib()]'s `theme` has been set to a [bslib::bs_theme()]
|
||||
#' object, then this returns the `theme`. Otherwise, this returns `NULL`.
|
||||
#' @seealso [getCurrentOutputInfo()], [bootstrapLib()], [htmltools::tagFunction()]
|
||||
#'
|
||||
|
||||
@@ -149,7 +149,7 @@ datePickerDependency <- function(theme) {
|
||||
})();
|
||||
</script>"
|
||||
),
|
||||
bootstraplib::bs_dependency_defer(datePickerCSS)
|
||||
bslib::bs_dependency_defer(datePickerCSS)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ datePickerCSS <- function(theme) {
|
||||
|
||||
scss_file <- system.file(package = "shiny", "www/shared/datepicker/scss/build3.scss")
|
||||
|
||||
bootstraplib::bs_dependency(
|
||||
bslib::bs_dependency(
|
||||
input = sass::sass_file(scss_file),
|
||||
theme = theme,
|
||||
name = "bootstrap-datepicker",
|
||||
|
||||
@@ -247,7 +247,7 @@ selectizeDependency <- function(theme) {
|
||||
"accessibility/js/selectize-plugin-a11y.min.js"
|
||||
)
|
||||
),
|
||||
bootstraplib::bs_dependency_defer(selectizeCSS)
|
||||
bslib::bs_dependency_defer(selectizeCSS)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -263,13 +263,13 @@ selectizeCSS <- function(theme) {
|
||||
|
||||
scss_file <- system.file(
|
||||
package = "shiny", "www/shared/selectize/scss",
|
||||
if ("3" %in% bootstraplib::theme_version(theme)) {
|
||||
if ("3" %in% bslib::theme_version(theme)) {
|
||||
"selectize.bootstrap3.scss"
|
||||
} else {
|
||||
"selectize.bootstrap4.scss"
|
||||
}
|
||||
)
|
||||
bootstraplib::bs_dependency(
|
||||
bslib::bs_dependency(
|
||||
input = sass::sass_file(scss_file),
|
||||
theme = theme,
|
||||
name = "selectize",
|
||||
|
||||
@@ -224,7 +224,7 @@ ionRangeSliderDependency <- function() {
|
||||
src = c(href = "shared/strftime"),
|
||||
script = "strftime-min.js"
|
||||
),
|
||||
bootstraplib::bs_dependency_defer(ionRangeSliderDependencyCSS)
|
||||
bslib::bs_dependency_defer(ionRangeSliderDependencyCSS)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ ionRangeSliderDependencyCSS <- function(theme) {
|
||||
)
|
||||
)
|
||||
|
||||
bootstraplib::bs_dependency(
|
||||
bslib::bs_dependency(
|
||||
input = sass_input,
|
||||
theme = theme,
|
||||
name = "ionRangeSlider",
|
||||
|
||||
@@ -85,7 +85,7 @@ renderPage <- function(ui, showcase=0, testMode=FALSE) {
|
||||
shinyDependencies <- function() {
|
||||
version <- utils::packageVersion("shiny")
|
||||
list(
|
||||
bootstraplib::bs_dependency_defer(shinyDependencyCSS),
|
||||
bslib::bs_dependency_defer(shinyDependencyCSS),
|
||||
htmlDependency(
|
||||
name = "shiny-javascript",
|
||||
version = version,
|
||||
@@ -111,7 +111,7 @@ shinyDependencyCSS <- function(theme) {
|
||||
scss_files <- file.path(scss_home, c("bootstrap.scss", "shiny.scss"))
|
||||
scss_files <- lapply(scss_files, sass::sass_file)
|
||||
|
||||
bootstraplib::bs_dependency(
|
||||
bslib::bs_dependency(
|
||||
input = scss_files,
|
||||
theme = theme,
|
||||
name = "shiny-sass",
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
// Variables and mixins copied from Bootstrap 3.3.5
|
||||
|
||||
// These are BS3 variables that are used in datepicker3.scss. So, when compiling against
|
||||
// a BS3 bootstraplib theme, these variables should already be defined. Here we set
|
||||
// a BS3 bslib theme, these variables should already be defined. Here we set
|
||||
// *defaults* for these variables based on BS4 variables, so this scss can work for
|
||||
// both BS3 and BS4
|
||||
$gray: mix($body-bg, $body-color, 33.5%) !default;
|
||||
|
||||
@@ -10,7 +10,7 @@ bootstrapLib(theme = NULL)
|
||||
\item{theme}{One of the following:
|
||||
\itemize{
|
||||
\item \code{NULL} (the default), which implies a "stock" build of Bootstrap 3.
|
||||
\item A \code{\link[bootstraplib:bs_theme]{bootstraplib::bs_theme()}} object. This can be used to replace a stock
|
||||
\item A \code{\link[bslib:bs_theme]{bslib::bs_theme()}} object. This can be used to replace a stock
|
||||
build of Bootstrap 3 with a customized version of Bootstrap 3 or higher.
|
||||
\item A character string pointing to an alternative Bootstrap stylesheet
|
||||
(normally a css file within the www directory, e.g. \code{www/bootstrap.css}).
|
||||
|
||||
@@ -20,7 +20,7 @@ Bootstrap 3.}
|
||||
\item{theme}{One of the following:
|
||||
\itemize{
|
||||
\item \code{NULL} (the default), which implies a "stock" build of Bootstrap 3.
|
||||
\item A \code{\link[bootstraplib:bs_theme]{bootstraplib::bs_theme()}} object. This can be used to replace a stock
|
||||
\item A \code{\link[bslib:bs_theme]{bslib::bs_theme()}} object. This can be used to replace a stock
|
||||
build of Bootstrap 3 with a customized version of Bootstrap 3 or higher.
|
||||
\item A character string pointing to an alternative Bootstrap stylesheet
|
||||
(normally a css file within the www directory, e.g. \code{www/bootstrap.css}).
|
||||
|
||||
@@ -8,7 +8,7 @@ getCurrentTheme()
|
||||
}
|
||||
\value{
|
||||
If called at render-time (i.e., inside a \code{\link[htmltools:tagFunction]{htmltools::tagFunction()}}),
|
||||
and \code{\link[=bootstrapLib]{bootstrapLib()}}'s \code{theme} has been set to a \code{\link[bootstraplib:bs_theme]{bootstraplib::bs_theme()}}
|
||||
and \code{\link[=bootstrapLib]{bootstrapLib()}}'s \code{theme} has been set to a \code{\link[bslib:bs_theme]{bslib::bs_theme()}}
|
||||
object, then this returns the \code{theme}. Otherwise, this returns \code{NULL}.
|
||||
}
|
||||
\description{
|
||||
|
||||
@@ -11,7 +11,7 @@ index b5388654..0dac6a62 100644
|
||||
-$gray-light: lighten(#000, 46.7%); // #777
|
||||
-$gray-lighter: lighten(#000, 93.5%); // #eee
|
||||
+// These are BS3 variables that are used in datepicker3.scss. So, when compiling against
|
||||
+// a BS3 bootstraplib theme, these variables should already be defined. Here we set
|
||||
+// a BS3 bslib theme, these variables should already be defined. Here we set
|
||||
+// *defaults* for these variables based on BS4 variables, so this scss can work for
|
||||
+// both BS3 and BS4
|
||||
+$gray: mix($body-bg, $body-color, 33.5%) !default;
|
||||
|
||||
@@ -75,7 +75,7 @@ for (patch in list.files(patch_dir, full.names = TRUE)) {
|
||||
|
||||
# Compile to CSS
|
||||
library(sass)
|
||||
library(bootstraplib)
|
||||
library(bslib)
|
||||
css_dir <- file.path(dest_dir, "css")
|
||||
dir.create(css_dir, recursive = TRUE)
|
||||
bs_sass(
|
||||
|
||||
Reference in New Issue
Block a user