Skip to content

Commit

Permalink
Introducing card(), value_box(), and layout_column_wrap() (#452)
Browse files Browse the repository at this point in the history
* Introducing card(), value_box(), and layout_column_wrap()

* `devtools::document()` (GitHub Actions)

* website dependencies

* bump version

* Add only one observer per card

* code review

* Revamp value_box() internals; add height limts on card_body_fill()

* `devtools::document()` (GitHub Actions)

* code review

* `devtools::document()` (GitHub Actions)

* Various improvements/additions; break cards article into 3 articles; revamp example app

* `devtools::document()` (GitHub Actions)

* `devtools::build_readme()` (GitHub Actions)

* Run tools/main.R

* update news

Co-authored-by: cpsievert <[email protected]>
  • Loading branch information
cpsievert and cpsievert authored Oct 20, 2022
1 parent fa2e03c commit c47bd43
Show file tree
Hide file tree
Showing 53 changed files with 2,911 additions and 102 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ inst/lib/bsw3/.npmignore
docs
sandbox
revdep
pkgdown
^_pkgdown\.yml$
vignettes
^\.github$
Expand Down
22 changes: 17 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: bslib
Title: Custom 'Bootstrap' 'Sass' Themes for 'shiny' and 'rmarkdown'
Version: 0.4.0.9000
Version: 0.4.0.9900
Authors@R: c(
person("Carson", "Sievert", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0002-4958-2844")),
person("Joe", "Cheng", role = "aut", email = "[email protected]"),
Expand All @@ -26,7 +26,9 @@ Imports:
jquerylib (>= 0.1.3),
rlang,
cachem,
memoise
memoise,
base64enc,
mime
Suggests:
shiny (>= 1.6.0),
rmarkdown (>= 2.7),
Expand All @@ -36,7 +38,9 @@ Suggests:
withr,
rappdirs,
curl,
magrittr
magrittr,
fontawesome,
bsicons
License: MIT + file LICENSE
Encoding: UTF-8
RoxygenNote: 7.2.1
Expand All @@ -52,9 +56,11 @@ Collate:
'bs-theme-preview.R'
'bs-theme-update.R'
'bs-theme.R'
'card.R'
'deprecated.R'
'files.R'
'imports.R'
'layout.R'
'nav-items.R'
'nav-update.R'
'navs-legacy.R'
Expand All @@ -67,6 +73,7 @@ Collate:
'staticimports.R'
'utils-shiny.R'
'utils-tags.R'
'value-box.R'
'version-default.R'
'versions.R'
URL: https://rstudio.github.io/bslib/, https://github.com/rstudio/bslib
Expand All @@ -82,9 +89,12 @@ Config/Needs/website:
glue,
purrr,
rprojroot,
rstudio/quillt,
stringr,
tidyr
tidyr,
plotly,
leaflet,
ggplot2,
svglite
Config/Needs/deploy:
BH,
DT,
Expand All @@ -94,3 +104,5 @@ Config/Needs/deploy:
reactable,
rprojroot,
rsconnect
Remotes:
rstudio/bsicons
14 changes: 14 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

S3method(print,bslib_fragment)
S3method(print,bslib_page)
export(as.card_item)
export(bootstrap)
export(bootstrap_sass)
export(bootswatch_themes)
Expand Down Expand Up @@ -41,11 +42,20 @@ export(bs_theme_preview)
export(bs_theme_set)
export(bs_theme_update)
export(bs_themer)
export(card)
export(card_body)
export(card_body_fill)
export(card_footer)
export(card_header)
export(card_image)
export(card_title)
export(font_collection)
export(font_face)
export(font_google)
export(font_link)
export(is.card_item)
export(is_bs_theme)
export(layout_column_wrap)
export(nav)
export(nav_append)
export(nav_content)
Expand All @@ -72,8 +82,11 @@ export(page_fluid)
export(page_navbar)
export(precompiled_css_path)
export(run_with_themer)
export(showcase_left_center)
export(showcase_top_right)
export(theme_bootswatch)
export(theme_version)
export(value_box)
export(version_default)
export(versions)
import(htmltools)
Expand All @@ -96,5 +109,6 @@ importFrom(tools,file_path_sans_ext)
importFrom(utils,URLencode)
importFrom(utils,download.file)
importFrom(utils,getFromNamespace)
importFrom(utils,head)
importFrom(utils,modifyList)
importFrom(utils,packageVersion)
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

* Upgraded Bootstrap 5 (i.e., `bs_theme(version = 5)`) from 5.1.3 to 5.2.0. (#438)

## New features

* Adds a new `card()` API as well as `value_box()` and `layout_column_wrap()`. To learn more about this new functionality, refer to these new pkgdown articles

* https://rstudio.github.io/bslib/articles/cards.html
* https://rstudio.github.io/bslib/articles/value-boxes.html
* https://rstudio.github.io/bslib/articles/layouts.html

# bslib 0.4.0

Expand Down
12 changes: 11 additions & 1 deletion R/bs-theme.R
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,17 @@ bootstrap_bundle <- function(version) {
),
# Additions to BS5 that are always included (i.e., not a part of compatibility)
sass_layer(rules = pandoc_tables),
bs3compat = bs3compat_bundle()
bs3compat = bs3compat_bundle(),
# card() CSS (can be removed)
vfill = sass_layer(
rules = sass_file(system_file("components/vfill.scss", package = "bslib"))
),
card = sass_layer(
rules = sass_file(system_file("components/card.scss", package = "bslib"))
),
value_box = sass_layer(
rules = sass_file(system_file("components/value-box.scss", package = "bslib"))
)
),
four = sass_bundle(
sass_layer(
Expand Down
Loading

0 comments on commit c47bd43

Please sign in to comment.