Skip to content

Commit

Permalink
docs(design utils): deprecate in favor of {cascadess}
Browse files Browse the repository at this point in the history
  • Loading branch information
nteetor committed Oct 31, 2024
1 parent d5c5411 commit 1e9df20
Show file tree
Hide file tree
Showing 29 changed files with 306 additions and 1,091 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ BugReports: https://github.com/nteetor/yonder/issues
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.0
RoxygenNote: 7.3.2
Depends:
R (>= 3.2),
shiny (>= 1.6.0)
Expand Down
15 changes: 14 additions & 1 deletion R/design-affix.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,22 @@
#' fixed behavior of an element.
#'
#' @include design.R
#' @family design utilities
#'
#' @export
#'
#' @examples
#'
#' div() %>% affix("sticky")
#' # ->
#' div() %>% cascadess::position_sticky()
#'
affix <- function(x, position) {
lifecycle::deprecate_warn(
"0.3.0",
"affix()",
"cascadess::position_sticky()"
)

assert_possible(position, c("top", "bottom", "sticky"))

UseMethod("affix", x)
Expand Down
16 changes: 14 additions & 2 deletions R/design-background.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,23 @@
#'
#' @eval param_color("background")
#'
#' @includeRmd man/roxygen/background.Rmd
#' @keywords internal
#'
#' @family design utilities
#' @export
#'
#' @examples
#'
#' div() %>% background("primary")
#' # ->
#' div() %>% cascadess::background_color("primary")
#'
background <- function(x, color) {
lifecycle::deprecate_warn(
"0.3.0",
"background()",
"cascadess::background_color()"
)

assert_possible(color, theme_colors)

UseMethod("background", x)
Expand Down
16 changes: 14 additions & 2 deletions R/design-border.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,23 @@
#' `"circle"`, `"all"`, or `"none"` specifying how to round the border(s) of a
#' tag element, defaults to `NULL`, in which case the argument is ignored.
#'
#' @includeRmd man/roxygen/border.Rmd
#' @keywords internal
#'
#' @family design utilities
#' @export
#'
#' @examples
#'
#' div() %>% border("primary")
#' # ->
#' div() %>% border_color("primary")
#'
border <- function(x, color = NULL, sides = "all", round = NULL) {
lifecycle::deprecate_warn(
"0.3.0",
"border()",
"cascadess::border_color()"
)

assert_possible(color, theme_colors)
assert_possible(
sides,
Expand Down
16 changes: 15 additions & 1 deletion R/design-display.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,23 @@
#' @param type A [responsive] argument. One of `"inline"`, `"block"`,
#' `"inline-block"`, `"flex"`, `"inline-flex"`, or `"none"`.
#'
#' @family design utilities
#' @keywords internal
#'
#' @export
#'
#' @examples
#'
#' div() %>% display()
#' # ->
#' div() %>% cascadess::display()
#'
display <- function(x, type) {
lifecycle::deprecate_warn(
"0.3.0",
"display()",
"cascadess::display()"
)

UseMethod("display", x)
}

Expand Down
19 changes: 14 additions & 5 deletions R/design-flex.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@
#'
#' When: the style is applied when the viewport is at least 1200px wide, think
#' large desktops.
#'
#' @name responsive
NULL

#' Flex layout
#'
Expand Down Expand Up @@ -91,12 +88,24 @@ NULL
#' `NULL`. If `TRUE` items wrap inside the container, if `FALSE` items will
#' not wrap. See the **wrap** section below for more.
#'
#' @includeRmd man/roxygen/flex.Rmd
#' @keywords internal
#'
#' @family design utilities
#' @export
#'
#' @examples
#'
#' div() %>% flex()
#' # ->
#' div() %>% cascadess::flex_display()
#'
flex <- function(x, direction = NULL, justify = NULL, align = NULL,
wrap = NULL, reverse = NULL) {
lifecycle::deprecate_warn(
"0.3.0",
"flex()",
"cascadess::display_flex()"
)

UseMethod("flex", x)
}

Expand Down
16 changes: 14 additions & 2 deletions R/design-float.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,23 @@
#' @param side A [responsive] argument. One of `"left"` or `"right"` specifying
#' the side to float the element.
#'
#' @includeRmd man/roxygen/float.Rmd
#' @keywords internal
#'
#' @family design utilities
#' @export
#'
#' @examples
#'
#' div() %>% float("left")
#' # ->
#' div() %>% cascadess::float("left")
#'
float <- function(x, side) {
lifecycle::deprecate_warn(
"0.3.0",
"float()",
"cascadess::float()"
)

UseMethod("float", x)
}

Expand Down
18 changes: 15 additions & 3 deletions R/design-font.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,26 @@
#' or `"justify"`, specifying the alignment of the tag element's text,
#' defaults to `NULL`.
#'
#' @includeRmd man/roxygen/font.Rmd
#' @keywords internal
#'
#' @family design utilities
#' @export
#'
#' @examples
#'
#' div() %>% font("primary")
#' # ->
#' div() %>% cascadess::font_color("primary")
#'
font <- function(x, color = NULL, size = NULL, weight = NULL, case = NULL,
align = NULL) {
lifecycle::deprecate_warn(
"0.3.0",
"font()",
"cascadess::font_color()"
)

if (!is.null(size)) {
deprecate_soft("0.2.0", "yonder::font(size = )")
lifecycle::deprecate_soft("0.2.0", "yonder::font(size = )")
}

assert_possible(color, theme_colors)
Expand Down
16 changes: 15 additions & 1 deletion R/design-scroll.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,23 @@
#' direction to scroll overflowing content, defaults to `"vertical"`, in which
#' case the content may scroll up and down.
#'
#' @family design utilities
#' @keywords internal
#'
#' @export
#'
#' @examples
#'
#' div() %>% scroll()
#' # ->
#' div() %>% cascadess::overflow_all()
#'
scroll <- function(x, direction = "vertical") {
lifecycle::deprecate_warn(
"0.3.0",
"scroll()",
"cascadess::overflow_all()"
)

assert_possible(direction, c("vertical", "horizontal"))

UseMethod("scroll", x)
Expand Down
16 changes: 14 additions & 2 deletions R/design-shadow.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,23 @@
#' @param size One of `"none"`, `"small"`, `"medium"`, or `"large"` specifying
#' the amount of shadow added, defaults to `"medium"`.
#'
#' @includeRmd man/roxygen/shadow.Rmd
#' @keywords internal
#'
#' @family design utilities
#' @export
#'
#' @examples
#'
#' div() %>% shadow("small")
#' # ->
#' div() %>% cascadess::shadow("small")
#'
shadow <- function(x, size = "medium") {
lifecycle::deprecate_warn(
"0.3.0",
"shadow()",
"cascadess::shadow()"
)

assert_possible(size, c("none", "small", "medium", "large"))

UseMethod("shadow", x)
Expand Down
32 changes: 30 additions & 2 deletions R/design-sizing.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,23 @@
#' `"viewport"`, in which case the element's width is determined by the size
#' of the browser window.
#'
#' @family design utilities
#' @keywords internal
#'
#' @export
#'
#' @examples
#'
#' div() %>% width(25)
#' # ->
#' div() %>% casacdess::width_relative(25)
#'
width <- function(x, size) {
lifecycle::deprecate_warn(
"0.3.0",
"width()",
"cascadess::width_relative()"
)

assert_possible(size, c(25, 50, 75, 100, "auto", "viewport"))

UseMethod("width", x)
Expand Down Expand Up @@ -82,9 +96,23 @@ width_size <- function(size) {
#' `"viewport"`, in which case the element's height is determined by the size
#' of the browser window.
#'
#' @family design utilities
#' @keywords internal
#'
#' @export
#'
#' @examples
#'
#' div() %>% height(25)
#' # ->
#' div() %>% cascadess::height_relative(25)
#'
height <- function(x, size) {
lifecycle::deprecate_warn(
"0.3.0",
"height()",
"cascadess::height_relative()"
)

assert_possible(size, c(25, 50, 75, 100, "auto", "viewport"))

UseMethod("height", x)
Expand Down
32 changes: 28 additions & 4 deletions R/design-spacing.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,24 @@
#' `"auto"` specifying padding for one or more sides of the tag element. 0
#' removes all inner space and 5 adds the most space.
#'
#' @includeRmd man/roxygen/margin.Rmd
#' @keywords internal
#'
#' @family design utilities
#' @export
#'
#' @examples
#'
#' div() %>% padding(2)
#' # ->
#' div() %>% cascadess::padding_all(2)
#'
padding <- function(x, all = NULL, top = NULL, right = NULL, bottom = NULL,
left = NULL) {
lifecycle::deprecate_warn(
"0.3.0",
"padding()",
"cascadess::padding_all()"
)

UseMethod("padding", x)
}

Expand Down Expand Up @@ -121,12 +133,24 @@ padding_all <- function(all) {
#' removes all outer space, 5 adds the most space, and negative values will
#' consume space pulling the element in that direction.
#'
#' @includeRmd man/roxygen/margin.Rmd
#' @keywords internal
#'
#' @family design utilities
#' @export
#'
#' @examples
#'
#' div() %>% margin(2)
#' # ->
#' div() %>% cascadess::margin_all(2)
#'
margin <- function(x, all = NULL, top = NULL, right = NULL, bottom = NULL,
left = NULL) {
lifecycle::deprecate_warn(
"0.3.0",
"margin()",
"cascadess::margin_all()"
)

UseMethod("margin", x)
}

Expand Down
16 changes: 0 additions & 16 deletions man/active.Rd

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

Loading

0 comments on commit 1e9df20

Please sign in to comment.