diff --git a/NEWS.md b/NEWS.md
index 5c69a4f..4497bf2 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,4 +1,7 @@
# argonR 0.2.0.9000
+- change the icon parameter of `argonTabSet()`, `argonCard()`, `argonAlert()`,
+`argonDropdownItem()` and `argonNavItem()`
+Now you can use `icon("cogs")` from shiny or `argonIcon()` as usual
- add offset arg to `argonColumn()`
- Add btn_text argument to `argonCard()`
- Fix #1: headroom.js and add the corresponding argument to `argonNavbar()`
diff --git a/R/argonAlert.R b/R/argonAlert.R
index 21d662a..73b6f9a 100644
--- a/R/argonAlert.R
+++ b/R/argonAlert.R
@@ -3,7 +3,7 @@
#' Build an argon alert
#'
#' @param ... Alert content.
-#' @param icon Alert icon.
+#' @param icon Alert icon. Expect \link{argonIcon} or \link[shiny]{icon}.
#' @param status Alert status. See \url{https://demos.creative-tim.com/argon-design-system/docs/components/alerts.html}.
#' @param closable Whether to make the alert closable or not. TRUE by default.
#'
@@ -11,7 +11,7 @@
#' if (interactive()) {
#' library(argonR)
#' argonAlert(
-#' icon = "basket",
+#' icon = argonIcon("basket"),
#' status = "danger",
#' "This is an alert",
#' closable = TRUE
@@ -33,7 +33,7 @@ argonAlert <- function(..., icon = NULL, status = "default", closable = TRUE) {
if (!is.null(icon)) {
htmltools::tags$span(
class = "alert-inner--icon",
- argonIcon(icon)
+ icon
)
},
htmltools::tags$span(
diff --git a/R/argonCard.R b/R/argonCard.R
index 1c0e16f..d6417ae 100644
--- a/R/argonCard.R
+++ b/R/argonCard.R
@@ -11,7 +11,7 @@
#' @param shadow_size Card shadow size. Only if shadow is TRUE. NULL by default.
#' @param hover_shadow Only if shadow is TRUE. Whether to enlarge the shadow on hover. FALSE by default.
#' @param border_level Border level. O by default.
-#' @param icon Card icon.
+#' @param icon Card icon. Expect \link{argonIcon} or \link[shiny]{icon}.
#' @param btn_text Button text. src arg must not be NULL so that this button appears.
#' @param status Card status. See \url{https://demos.creative-tim.com/argon-design-system/docs/foundation/colors.html}.
#' @param background_color Card background color. NULL by default. See \url{https://demos.creative-tim.com/argon-design-system/docs/foundation/colors.html}.
@@ -29,7 +29,7 @@
#' title = "Card 1",
#' hover_lift = TRUE,
#' shadow = TRUE,
-#' icon = "check-bold",
+#' icon = argonIcon("check-bold"),
#' src = "#",
#' "Argon is a great free UI package based on Bootstrap 4
#' that includes the most important components and features."
@@ -84,7 +84,7 @@ argonCard <- function(..., title = NULL, src = NULL, hover_lift = FALSE,
if (!is.null(title)) {
htmltools::tags$div(
class = if (!is.null(background_color)) {
- "cqrd-header bg-transparent"
+ "card-header bg-transparent"
} else {
"card-header"
},
@@ -93,7 +93,7 @@ argonCard <- function(..., title = NULL, src = NULL, hover_lift = FALSE,
# icon
if(!is.null(icon)) {
argonIconWrapper(
- iconTag = argonIcon(name = icon, color = status),
+ iconTag = icon,
circle = TRUE,
size = "sm",
shadow = TRUE,
diff --git a/R/argonNavbar.R b/R/argonNavbar.R
index 6f0ef9f..0a8b7b4 100644
--- a/R/argonNavbar.R
+++ b/R/argonNavbar.R
@@ -179,7 +179,7 @@ argonNavMenu <- function(..., side = "left") {
#'
#' @param name Item name.
#' @param src HTML target page.
-#' @param icon Item icon of any.
+#' @param icon Item icon of any. Expect \link{argonIcon} or \link[shiny]{icon}.
#' @param tooltip Text to display when the item is hovered.
#'
#' @author David Granjon, \email{dgranjon@@ymail.com}
@@ -195,7 +195,7 @@ argonNavItem <- function(name = NULL, src = NULL, icon = NULL, tooltip = NULL) {
`data-toggle` = "tooltip",
title = "",
`data-original-title` = tooltip,
- htmltools::tags$i(class = paste0("fa fa-", icon)),
+ icon,
htmltools::tags$span(class = "nav-link-inner--text d-lg-none", name)
)
)
@@ -246,7 +246,7 @@ argonDropdown <- function(..., name, size = NULL) {
#' @param name Item name.
#' @param description Item description if any.
#' @param src HTML target page.
-#' @param icon Item icon of any.
+#' @param icon Item icon of any. Expect \link{argonIcon} or \link[shiny]{icon}.
#' @param status Icon and name color status. See \url{https://demos.creative-tim.com/argon-design-system/docs/foundation/colors.html}.
#'
#' @author David Granjon, \email{dgranjon@@ymail.com}
@@ -260,7 +260,7 @@ argonDropdownItem <- function(name = NULL, description = NULL, src = NULL,
# icon if any
if (!is.null(icon)) {
argonIconWrapper(
- iconTag = argonIcon(icon, color = "white"),
+ iconTag = icon,
gradient_color = status,
circle = TRUE,
size = NULL,
diff --git a/R/argonTabs.R b/R/argonTabs.R
index 7f1c7f9..ec22267 100644
--- a/R/argonTabs.R
+++ b/R/argonTabs.R
@@ -9,7 +9,7 @@
#' @param circle Whether to display circled design. FALSE by default.
#' @param size Tabs size. "sm" by default. "md", "lg".
#' @param width Tabs width. Between 1 and 12.
-#' @param iconList A list of argonIcon such as list("atom", "cloud-upload-96").
+#' @param iconList A list of \link{argonIcon} or \link[shiny]{icon}.
#' The lenght must have the same length as the number of tabs. NULL by default.
#'
#' @examples
@@ -22,7 +22,11 @@
#' circle = FALSE,
#' size = "sm",
#' width = 6,
-#' iconList = list("cloud-upload-96", "bell-55", "calendar-grid-58"),
+#' iconList = list(
+#' argonIcon("cloud-upload-96"),
+#' argonIcon("bell-55"),
+#' argonIcon("calendar-grid-58")
+#' ),
#' argonTab(
#' tabName = "Tab 1",
#' active = FALSE,
@@ -97,7 +101,7 @@ argonTabSet <- function(..., id, card_wrapper = FALSE, horizontal = TRUE, circle
role = "tab",
`aria-controls` = ns(current_item_id),
`aria-selected` = "true",
- if (!is.null(iconList)) argonIcon(name = iconList[[i]]),
+ if (!is.null(iconList)) iconList[[i]],
current_item_name
)
)
diff --git a/docs/articles/getting_started.html b/docs/articles/getting_started.html
index 5d82d00..d1e09d9 100644
--- a/docs/articles/getting_started.html
+++ b/docs/articles/getting_started.html
@@ -96,7 +96,7 @@
Getting Started
David Granjon
- 2019-06-04
+ 2019-06-05
Source: vignettes/getting_started.Rmd
getting_started.Rmd
@@ -177,54 +177,54 @@
The argonNavbar()
function accepts argonNavMenu()
, which in turns takes argonNavItem()
and argonDropdown()
.
@@ -380,493 +380,494 @@
diff --git a/docs/news/index.html b/docs/news/index.html
index db6f0dc..9b6caab 100644
--- a/docs/news/index.html
+++ b/docs/news/index.html
@@ -133,6 +133,7 @@
+- change the icon parameter of
argonTabSet()
, argonCard()
, argonAlert()
, argonDropdownItem()
and argonNavItem()
Now you can use icon("cogs")
from shiny or argonIcon()
as usual
- add offset arg to
argonColumn()
- Add btn_text argument to
argonCard()
diff --git a/docs/reference/argonAlert.html b/docs/reference/argonAlert.html
index 5d433b1..913ee99 100644
--- a/docs/reference/argonAlert.html
+++ b/docs/reference/argonAlert.html
@@ -149,7 +149,7 @@ Arg
icon |
- Alert icon. |
+ Alert icon. Expect argonIcon or icon. |
status |
@@ -166,7 +166,7 @@ Examp
icon |
- Card icon. |
+ Card icon. Expect argonIcon or icon. |
btn_text |
@@ -221,7 +221,7 @@ Examp
title = "Card 1",
hover_lift = TRUE,
shadow = TRUE,
- icon = "check-bold",
+ icon = argonIcon("check-bold"),
src = "#",
"Argon is a great free UI package based on Bootstrap 4
that includes the most important components and features."
diff --git a/docs/reference/argonDropdownItem.html b/docs/reference/argonDropdownItem.html
index 5617547..30533ff 100644
--- a/docs/reference/argonDropdownItem.html
+++ b/docs/reference/argonDropdownItem.html
@@ -158,7 +158,7 @@ Arg
icon |
- Item icon of any. |
+ Item icon of any. Expect argonIcon or icon. |
status |
diff --git a/docs/reference/argonNavItem.html b/docs/reference/argonNavItem.html
index 846229e..c4cebf2 100644
--- a/docs/reference/argonNavItem.html
+++ b/docs/reference/argonNavItem.html
@@ -153,7 +153,7 @@ Arg
icon |
- Item icon of any. |
+ Item icon of any. Expect argonIcon or icon. |
tooltip |
diff --git a/docs/reference/argonTabSet.html b/docs/reference/argonTabSet.html
index f4ff9ec..4ab5cc4 100644
--- a/docs/reference/argonTabSet.html
+++ b/docs/reference/argonTabSet.html
@@ -174,7 +174,7 @@ Arg
iconList |
- A list of argonIcon such as list("atom", "cloud-upload-96").
+ | A list of argonIcon or icon.
The lenght must have the same length as the number of tabs. NULL by default. |
@@ -190,7 +190,11 @@ Examp
circle = FALSE,
size = "sm",
width = 6,
- iconList = list("cloud-upload-96", "bell-55", "calendar-grid-58"),
+ iconList = list(
+ argonIcon("cloud-upload-96"),
+ argonIcon("bell-55"),
+ argonIcon("calendar-grid-58")
+ ),
argonTab(
tabName = "Tab 1",
active = FALSE,
diff --git a/man/argonAlert.Rd b/man/argonAlert.Rd
index b700215..b73b761 100644
--- a/man/argonAlert.Rd
+++ b/man/argonAlert.Rd
@@ -9,7 +9,7 @@ argonAlert(..., icon = NULL, status = "default", closable = TRUE)
\arguments{
\item{...}{Alert content.}
-\item{icon}{Alert icon.}
+\item{icon}{Alert icon. Expect \link{argonIcon} or \link[shiny]{icon}.}
\item{status}{Alert status. See \url{https://demos.creative-tim.com/argon-design-system/docs/components/alerts.html}.}
@@ -22,7 +22,7 @@ Build an argon alert
if (interactive()) {
library(argonR)
argonAlert(
- icon = "basket",
+ icon = argonIcon("basket"),
status = "danger",
"This is an alert",
closable = TRUE
diff --git a/man/argonCard.Rd b/man/argonCard.Rd
index a97a38b..2b178a1 100644
--- a/man/argonCard.Rd
+++ b/man/argonCard.Rd
@@ -28,7 +28,7 @@ Not compatible with floating.}
\item{border_level}{Border level. O by default.}
-\item{icon}{Card icon.}
+\item{icon}{Card icon. Expect \link{argonIcon} or \link[shiny]{icon}.}
\item{btn_text}{Button text. src arg must not be NULL so that this button appears.}
@@ -55,7 +55,7 @@ if (interactive()) {
title = "Card 1",
hover_lift = TRUE,
shadow = TRUE,
- icon = "check-bold",
+ icon = argonIcon("check-bold"),
src = "#",
"Argon is a great free UI package based on Bootstrap 4
that includes the most important components and features."
diff --git a/man/argonDropdownItem.Rd b/man/argonDropdownItem.Rd
index 861adca..6072082 100644
--- a/man/argonDropdownItem.Rd
+++ b/man/argonDropdownItem.Rd
@@ -14,7 +14,7 @@ argonDropdownItem(name = NULL, description = NULL, src = NULL,
\item{src}{HTML target page.}
-\item{icon}{Item icon of any.}
+\item{icon}{Item icon of any. Expect \link{argonIcon} or \link[shiny]{icon}.}
\item{status}{Icon and name color status. See \url{https://demos.creative-tim.com/argon-design-system/docs/foundation/colors.html}.}
}
diff --git a/man/argonNavItem.Rd b/man/argonNavItem.Rd
index 86e8fa1..147965e 100644
--- a/man/argonNavItem.Rd
+++ b/man/argonNavItem.Rd
@@ -11,7 +11,7 @@ argonNavItem(name = NULL, src = NULL, icon = NULL, tooltip = NULL)
\item{src}{HTML target page.}
-\item{icon}{Item icon of any.}
+\item{icon}{Item icon of any. Expect \link{argonIcon} or \link[shiny]{icon}.}
\item{tooltip}{Text to display when the item is hovered.}
}
diff --git a/man/argonTabSet.Rd b/man/argonTabSet.Rd
index 34a776b..9f2478d 100644
--- a/man/argonTabSet.Rd
+++ b/man/argonTabSet.Rd
@@ -22,7 +22,7 @@ argonTabSet(..., id, card_wrapper = FALSE, horizontal = TRUE,
\item{width}{Tabs width. Between 1 and 12.}
-\item{iconList}{A list of argonIcon such as list("atom", "cloud-upload-96").
+\item{iconList}{A list of \link{argonIcon} or \link[shiny]{icon}.
The lenght must have the same length as the number of tabs. NULL by default.}
}
\description{
@@ -38,7 +38,11 @@ if (interactive()) {
circle = FALSE,
size = "sm",
width = 6,
- iconList = list("cloud-upload-96", "bell-55", "calendar-grid-58"),
+ iconList = list(
+ argonIcon("cloud-upload-96"),
+ argonIcon("bell-55"),
+ argonIcon("calendar-grid-58")
+ ),
argonTab(
tabName = "Tab 1",
active = FALSE,
diff --git a/vignettes/getting_started.Rmd b/vignettes/getting_started.Rmd
index 107eee6..4c0515e 100644
--- a/vignettes/getting_started.Rmd
+++ b/vignettes/getting_started.Rmd
@@ -107,21 +107,21 @@ navbar <- argonNavbar(
name = "Getting Started",
description = "Blabla",
src = "",
- icon = "spaceship",
+ icon = argonIcon("spaceship", color = "white"),
status = "primary"
),
argonDropdownItem(
name = "Foundation",
description = "Blabla",
src = "",
- icon = "palette",
+ icon = argonIcon("palette", color = "white"),
status = "warning"
),
argonDropdownItem(
name = "Components",
description = "Blabla",
src = "",
- icon = "ui-04",
+ icon = argonIcon("ui-04", color = "white),
status = "success"
)
)
@@ -132,25 +132,25 @@ navbar <- argonNavbar(
argonNavItem(
name = "facebook",
src = "https://www.facebook.com",
- icon = "facebook-square",
+ icon = icon("facebook-square"),
tooltip = "Like us on Facebook"
),
argonNavItem(
name = "instagram",
src = "https://www.instagram.com",
- icon = "instagram",
+ icon = icon("instagram"),
tooltip = "Follow us on Instagram"
),
argonNavItem(
name = "twitter",
src = "https://www.twitter.com",
- icon = "twitter-square",
+ icon = icon("twitter-square"),
tooltip = "Follow us on Twitter"
),
argonNavItem(
name = "github",
src = "https://www.github.com",
- icon = "github",
+ icon = icon("github"),
tooltip = "Star us on Github"
)
)
@@ -327,22 +327,19 @@ example <- argonPage(
name = "Getting Started",
description = "BlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBla",
src = "test.html",
- icon = "spaceship",
- status = "primary"
+ icon = argonIcon(name = "spaceship" color = "primary")
),
argonDropdownItem(
name = "Foundation",
description = "BlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBla",
src = "",
- icon = "palette",
- status = "warning"
+ icon = argonIcon(name = "palette" color = "warning")
),
argonDropdownItem(
name = "Components",
description = "BlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBla",
src = "",
- icon = "ui-04",
- status = "success"
+ icon = argonIcon(name = "ui-04" color = "success")
)
)
),
@@ -352,25 +349,25 @@ example <- argonPage(
argonNavItem(
name = "facebook",
src = "https://www.facebook.com",
- icon = "facebook-square",
+ icon = icon("facebook-square"),
tooltip = "Like us on Facebook"
),
argonNavItem(
name = "instagram",
src = "https://www.instagram.com",
- icon = "instagram",
+ icon = icon("instagram"),
tooltip = "Follow us on Instagram"
),
argonNavItem(
name = "twitter",
src = "https://www.twitter.com",
- icon = "twitter-square",
+ icon = icon("twitter-square"),
tooltip = "Follow us on Twitter"
),
argonNavItem(
name = "github",
src = "https://www.github.com",
- icon = "github",
+ icon = icon("github"),
tooltip = "Star us on Github"
)
)
@@ -468,7 +465,7 @@ example <- argonPage(
title = "Card 1",
hover_lift = TRUE,
shadow = TRUE,
- icon = "check-bold",
+ icon = argonIcon("check-bold"),
src = "#",
"Argon is a great free UI package based on Bootstrap 4
that includes the most important components and features."
@@ -482,7 +479,7 @@ example <- argonPage(
title = "Card 2",
hover_lift = TRUE,
shadow = TRUE,
- icon = "istanbul",
+ icon = argonIcon("istanbul"),
src = "#",
"Argon is a great free UI package based on Bootstrap 4
that includes the most important components and features"
@@ -496,7 +493,7 @@ example <- argonPage(
title = "Card 3",
hover_lift = TRUE,
shadow = TRUE,
- icon = "planet",
+ icon = argonIcon("planet"),
src = "#",
"Argon is a great free UI package based on Bootstrap 4
that includes the most important components and features"
@@ -568,7 +565,7 @@ example <- argonPage(
argonColumn(
width = 4,
argonAlert(
- icon = "basket",
+ icon = argonIcon("basket"),
status = "danger",
"This is an alert",
closable = TRUE
@@ -577,7 +574,7 @@ example <- argonPage(
argonColumn(
width = 4,
argonAlert(
- icon = "ui-02",
+ icon = argonIcon("ui-02"),
status = "success",
"This is an alert",
closable = TRUE
@@ -586,7 +583,7 @@ example <- argonPage(
argonColumn(
width = 4,
argonAlert(
- icon = "ui-03",
+ icon = argonIcon("ui-03"),
status = "info",
"This is an alert",
closable = TRUE
@@ -604,7 +601,11 @@ example <- argonPage(
circle = FALSE,
size = "sm",
width = 6,
- iconList = list("cloud-upload-96", "bell-55", "calendar-grid-58"),
+ iconList = list(
+ argonIcon("cloud-upload-96"),
+ argonIcon("bell-55"),
+ argonicon("calendar-grid-58")
+ ),
argonTab(
tabName = "Tab 1",
active = FALSE,