Skip to content

Commit

Permalink
completed the 'return' fields
Browse files Browse the repository at this point in the history
  • Loading branch information
stla committed Jul 14, 2021
1 parent 78a9408 commit 8c6034b
Show file tree
Hide file tree
Showing 25 changed files with 106 additions and 5 deletions.
12 changes: 12 additions & 0 deletions R/chakra.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#' \code{\link{jsx}} function, a Shiny widget, or some HTML code created with
#' the \code{\link[htmltools:HTML]{HTML}} function
#'
#' @return No return value, called for side effect.
#'
#' @export
#' @importFrom utils URLencode
#' @seealso \code{\link{withStates}}
Expand Down Expand Up @@ -222,6 +224,9 @@ withStates <- function(component, states){
#'
#' @param ... elements to include within the page
#'
#' @return A UI definition that can be passed to the
#' \code{\link[shiny:shinyUI]{shinyUI}} function.
#'
#' @importFrom htmltools htmlDependency tags attachDependencies
#' @export
chakraPage <- function(...){
Expand Down Expand Up @@ -252,6 +257,9 @@ chakraPage <- function(...){
#' @param componentId component id
#' @param ... elements to include within the component
#'
#' @return A Shiny widget to use in a UI definition, preferably in
#' \code{\link{chakraPage}}.
#'
#' @importFrom reactR createReactShinyInput
#' @importFrom htmltools htmlDependency tags attachDependencies
#' @export
Expand Down Expand Up @@ -299,6 +307,8 @@ chakraComponent <- function(componentId, ...){
#' @description List of Chakra color schemes (to use as a \code{colorScheme}
#' attribute in e.g. Chakra buttons).
#'
#' @return The names of the Chakra color schemes in a vector.
#'
#' @export
#'
#' @examples
Expand Down Expand Up @@ -329,6 +339,8 @@ chakraColorSchemes <- function(){
#' @title Chakra icons
#' @description List of Chakra icons.
#'
#' @return The names of the Chakra icons in a vector.
#'
#' @export
#' @details See \href{https://chakra-ui.com/docs/media-and-icons/icon#all-icons}{all chakra icons}.
#'
Expand Down
3 changes: 3 additions & 0 deletions R/chakraCombinedSlider.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
#' @param decrementStepperColor color of the decrement stepper
#' @param ... other attributes of \code{NumberInput}
#'
#' @return A list of options to be passed to the
#' \code{numericInputOptions} argument in \code{\link{chakraCombinedSlider}}.
#'
#' @importFrom htmltools validateCssUnit
#' @export
numberInputOptions <- function(
Expand Down
4 changes: 4 additions & 0 deletions R/chakraExample.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#' @title Chakra examples
#' @description List of Chakra examples.
#'
#' @return No return value, only prints a message listing the Chakra examples.
#'
#' @export
#'
#' @examples
Expand All @@ -23,6 +25,8 @@ chakraExamples <- function(){
#' \code{\link[shiny:runApp]{runApp}}
#' @param ... arguments passed to \code{\link[shiny:runApp]{runApp}}
#'
#' @return No return value, just launches a Shiny app.
#'
#' @export
#' @importFrom shiny runApp
#'
Expand Down
19 changes: 18 additions & 1 deletion R/jseval_and_hooks.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#' @title Evaluate JS code
#' @description Evaluate JavaScript code in the application.
#'
#' @param code JavaScript code given as a sting
#' @param code JavaScript code given as a string
#'
#' @return A list containing the URL-encoded JavaScript code.
#'
#' @export
#' @importFrom utils URLencode
Expand Down Expand Up @@ -44,6 +46,8 @@ jseval <- function(code){
#'
#' @param state name of the state
#'
#' @return A list like the return value of \code{\link{jseval}}.
#'
#' @export
#' @seealso \code{\link{withStates}}
#'
Expand Down Expand Up @@ -124,6 +128,8 @@ getState <- function(state){
#'
#' @param value a string
#'
#' @return A list containing some URL-encoded JavaScript code.
#'
#' @export
#' @importFrom utils URLencode
#' @details See \href{https://chakra-ui.com/docs/hooks/use-clipboard}{useClipboard}.
Expand Down Expand Up @@ -199,8 +205,11 @@ useClipboard <- function(value){

#' @title The `useRef` hook
#' @description The React `useRef` hook.
#'
#' @param initialValue optional initial value
#'
#' @return A list like the return value of \code{\link{jseval}}.
#'
#' @export
#' @importFrom jsonlite toJSON
useRef <- function(initialValue = NA){
Expand All @@ -218,6 +227,8 @@ useRef <- function(initialValue = NA){
#'
#' @param defaultIsOpen Boolean, the initial value of the \code{isOpen} property
#'
#' @return A list containing some URL-encoded JavaScript code.
#'
#' @export
#' @importFrom utils URLencode
#' @details See \href{https://chakra-ui.com/docs/hooks/use-disclosure}{useDisclosure}.
Expand Down Expand Up @@ -284,6 +295,8 @@ useDisclosure <- function(defaultIsOpen = FALSE){
#' @title The `useToast` hook
#' @description The `useToast` hook.
#'
#' @return A list containing some URL-encoded JavaScript code.
#'
#' @export
#' @importFrom utils URLencode
#' @note It does not work well. Use \code{\link{createStandaloneToast}} instead.
Expand All @@ -294,6 +307,8 @@ useToast <- function(){
#' @title The `createStandaloneToast` hook
#' @description The `createStandaloneToast` hook.
#'
#' @return A list containing some URL-encoded JavaScript code.
#'
#' @export
#' @importFrom utils URLencode
#' @details See \href{https://chakra-ui.com/docs/feedback/toast#standalone-toasts}{Standalone toasts}.
Expand Down Expand Up @@ -357,6 +372,8 @@ createStandaloneToast <- function(){
#' of the \code{\link{withStates}} function
#' @param property the hook property you want to get
#'
#' @return A list like the return value of \code{\link{jseval}}.
#'
#' @export
getHookProperty <- function(hook, property){
stopifnot(isString(hook))
Expand Down
5 changes: 4 additions & 1 deletion R/jsx.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ fixjsx <- function(jsx){ # assumes `checkjsx` has been executed before
#' @description Create a JSX element.
#'
#' @param element the JSX element given as a string
#' @param preamble JavaScript code to run before
#' @param preamble JavaScript code to run before, given as a string
#'
#' @return A list containing the URL-encoded strings \code{element}
#' and \code{preamble}.
#'
#' @export
#' @importFrom utils URLencode
Expand Down
3 changes: 3 additions & 0 deletions R/jsxParser.R
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ parsedJSX2component <- function(jsx, ctx){
#' @param jsxString JSX code given as a string
#' @param clipboard whether to copy the output to the clipboard
#'
#' @return No return value, only prints the code in the console and copy it
#' to the clipboard if \code{clipboard = TRUE}.
#'
#' @export
#' @importFrom formatR tidy_source
#'
Expand Down
2 changes: 1 addition & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This is a resubmission. I fixed the 'Title' field, it was not in title case.
This is a resubmission. I completed the `@return` fields of the documentations.


## Test environments
Expand Down
3 changes: 3 additions & 0 deletions man/chakraColorSchemes.Rd

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

4 changes: 4 additions & 0 deletions man/chakraComponent.Rd

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

3 changes: 3 additions & 0 deletions man/chakraExample.Rd

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

3 changes: 3 additions & 0 deletions man/chakraExamples.Rd

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

3 changes: 3 additions & 0 deletions man/chakraIcons.Rd

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

4 changes: 4 additions & 0 deletions man/chakraPage.Rd

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

3 changes: 3 additions & 0 deletions man/createStandaloneToast.Rd

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

3 changes: 3 additions & 0 deletions man/getHookProperty.Rd

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

3 changes: 3 additions & 0 deletions man/getState.Rd

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

5 changes: 4 additions & 1 deletion man/jseval.Rd

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

6 changes: 5 additions & 1 deletion man/jsx.Rd

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

4 changes: 4 additions & 0 deletions man/jsxString2code.Rd

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

4 changes: 4 additions & 0 deletions man/numberInputOptions.Rd

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

3 changes: 3 additions & 0 deletions man/setReactState.Rd

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

3 changes: 3 additions & 0 deletions man/useClipboard.Rd

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

3 changes: 3 additions & 0 deletions man/useDisclosure.Rd

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

3 changes: 3 additions & 0 deletions man/useRef.Rd

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

3 changes: 3 additions & 0 deletions man/useToast.Rd

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

0 comments on commit 8c6034b

Please sign in to comment.