Skip to content

Commit

Permalink
feat: added bs5_spinner
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnCoene committed Jan 2, 2022
1 parent ada4f6e commit 95e8616
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 5 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export(Waitress)
export(attendantBar)
export(autoWaiter)
export(bs4_spinner)
export(bs5_spinner)
export(hostess_bubble)
export(hostess_gradient)
export(hostess_loader)
Expand Down
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ the attendant instead of `httr::progress`.
- Fix major issue with `Hostess`, it was basically broken
[#108](https://github.com/JohnCoene/waiter/issues/108).
- Add `withWaiter` as requested in
[#105](https://github.com/JohnCoene/waiter/issues/105)
- Added `bs4_spinner`.
[#105](https://github.com/JohnCoene/waiter/issues/105).
- Added `bs4_spinner` and `bs5_spinner`.

# waiter 0.2.3

Expand Down
32 changes: 32 additions & 0 deletions R/spinners.R
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,38 @@ bs4_spinner <- function(
)
}

#' @rdname spinners
#' @export
bs5_spinner <- function(
style = c("spin", "grow"),
color = c(
"primary",
"secondary",
"success",
"danger",
"warning",
"info",
"light",
"dark"
)
) {
style <- match.arg(style)
color <- match.arg(color)

cl <- "border"
if(style == "grow")
cl <- "grow"

tags$div(
class = sprintf("spinner-%s text-%s", cl, color),
role = "status",
tags$span(
class = "visually-hidden",
"Loading..."
)
)
}

#' @rdname spinners
#' @export
spin_google <- function(){
Expand Down
6 changes: 3 additions & 3 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

List of changes made to waiter.

# waiter 0.2.4.9000
## waiter 0.2.4.9000

- Added `httr_progress` function to use the waitress or
the attendant instead of `httr::progress`.
Expand All @@ -13,8 +13,8 @@ the attendant instead of `httr::progress`.
- Fix major issue with `Hostess`, it was basically broken
[#108](https://github.com/JohnCoene/waiter/issues/108).
- Add `withWaiter` as requested in
[#105](https://github.com/JohnCoene/waiter/issues/105)

[#105](https://github.com/JohnCoene/waiter/issues/105).
- Added `bs4_spinner` and `bs5_spinner`.

## waiter 0.2.3

Expand Down
7 changes: 7 additions & 0 deletions man/spinners.Rd

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

0 comments on commit 95e8616

Please sign in to comment.