Skip to content

Commit 95e8616

Browse files
committed
feat: added bs5_spinner
1 parent ada4f6e commit 95e8616

File tree

5 files changed

+45
-5
lines changed

5 files changed

+45
-5
lines changed

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export(Waitress)
1010
export(attendantBar)
1111
export(autoWaiter)
1212
export(bs4_spinner)
13+
export(bs5_spinner)
1314
export(hostess_bubble)
1415
export(hostess_gradient)
1516
export(hostess_loader)

NEWS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ the attendant instead of `httr::progress`.
99
- Fix major issue with `Hostess`, it was basically broken
1010
[#108](https://github.com/JohnCoene/waiter/issues/108).
1111
- Add `withWaiter` as requested in
12-
[#105](https://github.com/JohnCoene/waiter/issues/105)
13-
- Added `bs4_spinner`.
12+
[#105](https://github.com/JohnCoene/waiter/issues/105).
13+
- Added `bs4_spinner` and `bs5_spinner`.
1414

1515
# waiter 0.2.3
1616

R/spinners.R

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,38 @@ bs4_spinner <- function(
773773
)
774774
}
775775

776+
#' @rdname spinners
777+
#' @export
778+
bs5_spinner <- function(
779+
style = c("spin", "grow"),
780+
color = c(
781+
"primary",
782+
"secondary",
783+
"success",
784+
"danger",
785+
"warning",
786+
"info",
787+
"light",
788+
"dark"
789+
)
790+
) {
791+
style <- match.arg(style)
792+
color <- match.arg(color)
793+
794+
cl <- "border"
795+
if(style == "grow")
796+
cl <- "grow"
797+
798+
tags$div(
799+
class = sprintf("spinner-%s text-%s", cl, color),
800+
role = "status",
801+
tags$span(
802+
class = "visually-hidden",
803+
"Loading..."
804+
)
805+
)
806+
}
807+
776808
#' @rdname spinners
777809
#' @export
778810
spin_google <- function(){

docs/changelog.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
List of changes made to waiter.
44

5-
# waiter 0.2.4.9000
5+
## waiter 0.2.4.9000
66

77
- Added `httr_progress` function to use the waitress or
88
the attendant instead of `httr::progress`.
@@ -13,8 +13,8 @@ the attendant instead of `httr::progress`.
1313
- Fix major issue with `Hostess`, it was basically broken
1414
[#108](https://github.com/JohnCoene/waiter/issues/108).
1515
- Add `withWaiter` as requested in
16-
[#105](https://github.com/JohnCoene/waiter/issues/105)
17-
16+
[#105](https://github.com/JohnCoene/waiter/issues/105).
17+
- Added `bs4_spinner` and `bs5_spinner`.
1818

1919
## waiter 0.2.3
2020

man/spinners.Rd

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)