Skip to content

Commit 5709fc3

Browse files
authored
v0.1.0 changes
Merge all changes for v0.1.0 from development into master now they're on CRAN
2 parents a033342 + 7f9f069 commit 5709fc3

File tree

155 files changed

+12471
-3118
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+12471
-3118
lines changed

.Rbuildignore

+4
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22
^\.Rproj\.user$
33
^cran-comments\.md$
44
^css_changes\.md$
5+
^_pkgdown\.yml$
6+
^docs$
7+
^pkgdown$
8+
^\.github$

.github/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.html

.github/workflows/R-CMD-check.yaml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master, development, update-to-gds-v5.4]
8+
9+
name: R-CMD-check
10+
11+
permissions: read-all
12+
13+
jobs:
14+
R-CMD-check:
15+
runs-on: ${{ matrix.config.os }}
16+
17+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
18+
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
config:
23+
- {os: macos-latest, r: 'release'}
24+
- {os: windows-latest, r: 'release'}
25+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
26+
- {os: ubuntu-latest, r: 'release'}
27+
- {os: ubuntu-latest, r: 'oldrel-1'}
28+
29+
env:
30+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
31+
R_KEEP_PKG_SOURCE: yes
32+
33+
steps:
34+
- uses: actions/checkout@v4
35+
36+
- uses: r-lib/actions/setup-pandoc@v2
37+
38+
- uses: r-lib/actions/setup-r@v2
39+
with:
40+
r-version: ${{ matrix.config.r }}
41+
http-user-agent: ${{ matrix.config.http-user-agent }}
42+
use-public-rspm: true
43+
44+
- uses: r-lib/actions/setup-r-dependencies@v2
45+
with:
46+
extra-packages: any::rcmdcheck
47+
needs: check
48+
49+
- uses: r-lib/actions/check-r-package@v2
50+
with:
51+
upload-snapshots: true
52+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

.github/workflows/pkgdown.yaml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
release:
9+
types: [published]
10+
workflow_dispatch:
11+
12+
name: pkgdown
13+
14+
permissions: read-all
15+
16+
jobs:
17+
pkgdown:
18+
runs-on: ubuntu-latest
19+
# Only restrict concurrency for non-PR jobs
20+
concurrency:
21+
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
22+
env:
23+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
24+
permissions:
25+
contents: write
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- uses: r-lib/actions/setup-pandoc@v2
30+
31+
- uses: r-lib/actions/setup-r@v2
32+
with:
33+
use-public-rspm: true
34+
35+
- uses: r-lib/actions/setup-r-dependencies@v2
36+
with:
37+
extra-packages: any::pkgdown, local::.
38+
needs: website
39+
40+
- name: Build site
41+
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
42+
shell: Rscript {0}
43+
44+
- name: Deploy to GitHub pages 🚀
45+
if: github.event_name != 'pull_request'
46+
uses: JamesIves/[email protected]
47+
with:
48+
clean: false
49+
branch: gh-pages
50+
folder: docs

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
.Rhistory
33
.RData
44
.DS_Store
5+
docs

DESCRIPTION

+23-15
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,32 @@
11
Package: shinyGovstyle
22
Title: Custom Gov Style Inputs for Shiny
3-
Version: 0.0.8
4-
Authors@R: person(
5-
given = "Ross",
6-
family = "Wyatt",
7-
email = "[email protected]",
8-
role = c("aut", "cre"))
9-
Description: Collection of 'shiny' application styling that are the based on
10-
the GOV.UK Design System. See
11-
<https://design-system.service.gov.uk/components/> for details.
12-
Depends: R (>= 3.1.0)
3+
Version: 0.1.0
4+
Authors@R: c(
5+
person("Ross", "Wyatt", , "[email protected]", role = c("aut", "cre")),
6+
person("Cameron", "Race", , "[email protected]", role = "ctb"),
7+
person("Sarah", "Wong", role = "ctb"),
8+
person("Richard", "Bielby", , "[email protected]", role = "ctb"),
9+
person("Charlotte", "Foster", , "[email protected]", role = "ctb"),
10+
person("Jeni", "Martin", role = "ctb")
11+
)
12+
Description: Collection of 'shiny' application styling that are the based
13+
on the GOV.UK Design System. See
14+
<https://design-system.service.gov.uk/components/> for details.
1315
License: GPL-3
14-
Encoding: UTF-8
15-
RoxygenNote: 7.1.2
1616
URL: https://github.com/moj-analytical-services/shinyGovstyle
17-
BugReports: https://github.com/moj-analytical-services/shinyGovstyle/issues
17+
BugReports:
18+
https://github.com/moj-analytical-services/shinyGovstyle/issues
19+
Depends:
20+
R (>= 3.1.0)
1821
Imports:
19-
shiny (>= 0.14),
2022
htmltools,
23+
jsonlite,
24+
magrittr,
25+
purrr,
26+
shiny (>= 0.14),
2127
shinyjs,
22-
jsonlite
28+
stringr
2329
Suggests:
2430
testthat
31+
Encoding: UTF-8
32+
RoxygenNote: 7.3.2

NAMESPACE

+3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# Generated by roxygen2: do not edit by hand
22

3+
export("%>%")
34
export(accordion)
45
export(backlink_Input)
56
export(banner)
67
export(button_Input)
78
export(checkbox_Input)
9+
export(contents_link)
810
export(cookieBanner)
911
export(date_Input)
1012
export(details)
@@ -41,5 +43,6 @@ export(word_count)
4143
importFrom(htmltools,attachDependencies)
4244
importFrom(htmltools,findDependencies)
4345
importFrom(htmltools,htmlDependency)
46+
importFrom(magrittr,"%>%")
4447
importFrom(shiny,addResourcePath)
4548
importFrom(utils,packageVersion)

NEWS.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# shinyGovstyle 0.1.0
2+
3+
* Update the css to v5.4.0 and made fixes associated with that.
4+
* No longer requires rem remover step to update for future changes
5+
* One of the major changes in the css is a change in look and functionality for the accordion. Show/hide all works as expected now.
6+
* Another major change to how the radio buttons look and feel, in line with the v5.4.0 design examples.
7+
* Added additional functions to the `run_example` for ease of testing
8+
* Added the contents_links() function as a helper for getting the styling and behaviour for left navigation
9+
10+
111
# shinyGovstyle 0.0.8
212

313
* Update the css to v4.0.0 and made fixes associated with that.

R/accordion.R

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ accordion <- function(inputId, titles, descriptions){
5454
class = "govuk-accordion__show-all",
5555
`aria-expanded` = "false",
5656
shiny::tags$span(
57+
id="show-all-chevron",
5758
class=paste(
5859
"govuk-accordion-nav__chevron",
5960
"govuk-accordion-nav__chevron--down"),

R/attachDependency.R

+12
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,18 @@ attachDependency <- function(tag, widget = NULL) {
6363
)
6464
}
6565

66+
else if (widget == "contents_link") {
67+
dep <- list(
68+
dep,
69+
htmltools::htmlDependency(
70+
name = "contents_link",
71+
version = version,
72+
src = c(href="shinyGovstyle/js"),
73+
script = "contents_link.js"
74+
)
75+
)
76+
}
77+
6678
}
6779

6880
htmltools::attachDependencies(tag, dep, append = TRUE)

R/backlink_Input.R

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#'
33
#' This function adds a back link to the page
44
#' @param inputId The input slot that will be used to access the value.
5+
#' @param label The link text for the backlink, default is "Back"
56
#' @return a backlink html shiny object
67
#' @keywords backlink
78
#' @export
@@ -42,13 +43,12 @@
4243
#' shinyApp(ui = ui, server = server)
4344
#' }
4445

45-
backlink_Input <- function(inputId) {
46+
backlink_Input <- function(inputId, label = "Back") {
4647

4748
value <- shiny::restoreInput(id = inputId, default = NULL)
48-
govBacklink <- shiny::tags$button("Back",
49-
id = inputId,
50-
class = paste0("govuk-back-link",
51-
" action-button"),
49+
govBacklink <- shiny::actionLink(label = label,
50+
inputId = inputId,
51+
class = paste0("govuk-back-link"),
5252
`data-val` = value)
5353
attachDependency(govBacklink)
5454

R/banner.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#' secondary_text = "User Examples",
1818
#' logo="shinyGovstyle/images/moj_logo.png"),
1919
#' shinyGovstyle::banner(
20-
#' inputId = "banner", type = "beta", 'This is a new service')
20+
#' inputId = "banner", type = "Beta", 'This is a new service')
2121
#' )
2222
#'
2323
#' server <- function(input, output, session) {}

R/clean_heading_text.R

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#' Clean heading text function
2+
#' This internal function is used in subcontents_links and heading_text to create an automated link between the two
3+
#' @param text string
4+
#' @return a string
5+
#' @keywords internal
6+
clean_heading_text <- function(text){
7+
8+
text %>%
9+
stringr::str_replace_all(" ", "_") %>%
10+
stringr::str_to_lower() %>%
11+
stringr::str_remove_all( "[^_[a-z]]")
12+
13+
}

0 commit comments

Comments
 (0)