Skip to content

Commit

Permalink
[refs #157] [refs #202] [refs #158] [refs #203] [refs #160] [refs #207]…
Browse files Browse the repository at this point in the history
… Update READMEs

Updated READMEs with correct heading structure, updated links to
service manual, and added Nunjucks 'html' warning.
  • Loading branch information
mcheung-nhs committed Feb 19, 2019
1 parent d9c5751 commit 89d7ade
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 53 deletions.
13 changes: 9 additions & 4 deletions packages/components/action-link/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

To discuss or contribute to this component, visit the [GitHub issue for this component](https://github.com/nhsuk/nhsuk-frontend/issues/157).

## Quick start examples

### Action link
## Guidance

Find out more about the action link component and when to use it in the [NHS Digital service manual](https://beta.nhs.uk/service-manual/styles-components-patterns/action-link).

## Quick start example

[Preview the action link component](https://nhsuk.github.io/nhsuk-frontend/components/action-link/index.html)

Expand Down Expand Up @@ -33,9 +36,9 @@ To discuss or contribute to this component, visit the [GitHub issue for this com
}) }}
```

## Nunjucks arguments
### Nunjucks arguments

If you are using Nunjucks, then macros take the following arguments:
The action link Nunjucks macro takes the following arguments:

| Name | Type | Required | Description |
| -----------------|----------|-----------|-------------|
Expand All @@ -44,3 +47,5 @@ If you are using Nunjucks, then macros take the following arguments:
| openInNewWindow | boolean | No | If set to true, then the link will open in a new window |
| classes | string | No | Optional additional classes to add to the anchor tag. Separate each class with a space. |
| attributes | object | No | Any extra HTML attributes (for example data attributes) to add to the anchor tag. |

If you are using Nunjucks macros in production be aware that using `html` arguments, or ones ending with `html` can be a [security risk](https://developer.mozilla.org/en-US/docs/Glossary/Cross-site_scripting). Read more about this in the [Nunjucks documentation](https://mozilla.github.io/nunjucks/api.html#user-defined-templates-warning).
10 changes: 5 additions & 5 deletions packages/components/back-link/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

To discuss or contribute to this component, visit the [GitHub issue for this component](https://github.com/nhsuk/nhsuk-frontend/issues/202).

## Quick start examples

### Back link
## Quick start example

[Preview the back link component](https://nhsuk.github.io/nhsuk-frontend/components/back-link/index.html)

Expand Down Expand Up @@ -32,9 +30,9 @@ To discuss or contribute to this component, visit the [GitHub issue for this com
}) }}
```

## Nunjucks arguments
### Nunjucks arguments

If you are using Nunjucks, then macros take the following arguments:
The back link Nunjucks macro takes the following arguments:

| Name | Type | Required | Description |
| --------------------|----------|-----------|-------------------------|
Expand All @@ -43,6 +41,8 @@ If you are using Nunjucks, then macros take the following arguments:
| **classes** | string | No | Optional additional classes to add to the button element. Separate each class with a space. |
| **attributes** | object | No | Any extra HTML attributes (for example data attributes) to add to the textarea tag. |

If you are using Nunjucks macros in production be aware that using `html` arguments, or ones ending with `html` can be a [security risk](https://developer.mozilla.org/en-US/docs/Glossary/Cross-site_scripting). Read more about this in the [Nunjucks documentation](https://mozilla.github.io/nunjucks/api.html#user-defined-templates-warning).

## Thanks to the Government Digital Service (GDS)

This component and documentation has been taken from [GOV.UK Frontend - Back link component](https://github.com/alphagov/govuk-frontend/tree/master/package/components/back-link) with a few minor adaptations.
12 changes: 8 additions & 4 deletions packages/components/breadcrumb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

To discuss or contribute to this component, visit the [GitHub issue for this component](https://github.com/nhsuk/nhsuk-frontend/issues/158).

## Quick start examples
## Guidance

### Breadcrumb
Find out more about the breadcrumb component and when to use it in the [NHS Digital service manual](https://beta.nhs.uk/service-manual/styles-components-patterns/breadcrumbs).

## Quick start example

[Preview the breadcrumb component](https://nhsuk.github.io/nhsuk-frontend/components/breadcrumb/index.html)

Expand Down Expand Up @@ -44,9 +46,9 @@ To discuss or contribute to this component, visit the [GitHub issue for this com
}) }}
```

## Nunjucks arguments
### Nunjucks arguments

If you are using Nunjucks, then macros take the following arguments:
The breadcrumb Nunjucks macro takes the following arguments:

| Name | Type | Required | Description |
| --------------------|----------|-----------|--------------|
Expand All @@ -58,3 +60,5 @@ If you are using Nunjucks, then macros take the following arguments:
| text | string | Yes | Text for the current page |
| classes | string | No | Optional additional classes to add to the breadcrumbs container. Separate each class with a space. |
| attributes | object | No | Any extra HTML attributes (for example data attributes) to add to the breadcrumbs container. |

If you are using Nunjucks macros in production be aware that using `html` arguments, or ones ending with `html` can be a [security risk](https://developer.mozilla.org/en-US/docs/Glossary/Cross-site_scripting). Read more about this in the [Nunjucks documentation](https://mozilla.github.io/nunjucks/api.html#user-defined-templates-warning).
44 changes: 30 additions & 14 deletions packages/components/button/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,23 @@

To discuss or contribute to this component, visit the [GitHub issue for this component](https://github.com/nhsuk/nhsuk-frontend/issues/203).

Find out more about the button component and when to use it in the [NHS Digital service manual](https://beta.nhs.uk/service-manual/styles-components-patterns/buttons).

## Quick start examples

### Button

[Preview the button component](https://nhsuk.github.io/nhsuk-frontend/components/button/index.html)

### HTML markup
#### HTML markup

```html
<button class="nhsuk-button" type="submit">
Save and continue
</button>
```

### Nunjucks macro
#### Nunjucks macro

```
{% from 'components/button/macro.njk' import button %}
Expand All @@ -26,19 +28,21 @@ To discuss or contribute to this component, visit the [GitHub issue for this com
}) }}
```

---

### Button disabled

[Preview the button disabled component](https://nhsuk.github.io/nhsuk-frontend/components/button/disabled.html)

### HTML markup
#### HTML markup

```html
<button class="nhsuk-button nhsuk-button--disabled" type="submit" disabled="disabled" aria-disabled="true">
Disabled button
</button>
```

### Nunjucks macro
#### Nunjucks macro

```
{% from 'components/button/macro.njk' import button %}
Expand All @@ -49,19 +53,21 @@ To discuss or contribute to this component, visit the [GitHub issue for this com
}) }}
```

---

### Button secondary

[Preview the button secondary component](https://nhsuk.github.io/nhsuk-frontend/components/button/secondary.html)

### HTML markup
#### HTML markup

```html
<button class="nhsuk-button nhsuk-button--secondary" type="submit">
Save and continue
</button>
```

### Nunjucks macro
#### Nunjucks macro

```
{% from 'components/button/macro.njk' import button %}
Expand All @@ -72,19 +78,21 @@ To discuss or contribute to this component, visit the [GitHub issue for this com
}) }}
```

---

### Button secondary disabled

[Preview the button secondary disabled component](https://nhsuk.github.io/nhsuk-frontend/components/button/secondary-disabled.html)

### HTML markup
#### HTML markup

```html
<button class="nhsuk-button nhsuk-button--secondary nhsuk-button--disabled" type="submit">
Find my location
</button>
```

### Nunjucks macro
#### Nunjucks macro

```
{% from 'components/button/macro.njk' import button %}
Expand All @@ -96,19 +104,21 @@ To discuss or contribute to this component, visit the [GitHub issue for this com
}) }}
```

---

### Button reverse

[Preview the button reverse component](https://nhsuk.github.io/nhsuk-frontend/components/button/reverse.html)

### HTML markup
#### HTML markup

```html
<button class="nhsuk-button nhsuk-button--reverse" type="submit">
Save and continue
</button>
```

### Nunjucks macro
#### Nunjucks macro

```
{% from 'components/button/macro.njk' import button %}
Expand All @@ -119,19 +129,21 @@ To discuss or contribute to this component, visit the [GitHub issue for this com
}) }}
```

---

### Button reverse disabled

[Preview the button reverse disabled component](https://nhsuk.github.io/nhsuk-frontend/components/button/reverse-disabled.html)

### HTML markup
#### HTML markup

```html
<button class="nhsuk-button nhsuk-button--reverse nhsuk-button--disabled" type="submit">
Save and continue
</button>
```

### Nunjucks macro
#### Nunjucks macro

```
{% from 'components/button/macro.njk' import button %}
Expand All @@ -143,9 +155,11 @@ To discuss or contribute to this component, visit the [GitHub issue for this com
}) }}
```

## Nunjucks arguments
---

If you are using Nunjucks, then macros take the following arguments:
### Nunjucks arguments

The button Nunjucks macro takes the following arguments:

| Name | Type | Required | Description |
| --------------------|----------|-----------|-------------------------|
Expand All @@ -159,6 +173,8 @@ If you are using Nunjucks, then macros take the following arguments:
| **classes** | string | No | Optional additional classes to add to the button element. Separate each class with a space. |
| **attributes** | object | No | Any extra HTML attributes (for example data attributes) to add to the textarea tag. |

If you are using Nunjucks macros in production be aware that using `html` arguments, or ones ending with `html` can be a [security risk](https://developer.mozilla.org/en-US/docs/Glossary/Cross-site_scripting). Read more about this in the [Nunjucks documentation](https://mozilla.github.io/nunjucks/api.html#user-defined-templates-warning).

## Thanks to the Government Digital Service (GDS)

This component and documentation has been taken from [GOV.UK Frontend - Button component](https://github.com/alphagov/govuk-frontend/tree/master/package/components/button) with a few minor adaptations.
30 changes: 16 additions & 14 deletions packages/components/care-card/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ To discuss or contribute to this component, visit the [GitHub issue for this com

## Guidance

Find out more about the care card component and when to use it in the [NHS Digital service manual](https://beta.nhs.uk/service-manual/patterns/care-cards/).
Find out more about the care card component and when to use it in the [NHS Digital service manual](https://beta.nhs.uk/service-manual/styles-components-patterns/care-cards).

## Quick start examples

### Care card non-urgent (blue)

[Preview the care card non-urgent (blue) component](https://nhsuk.github.io/nhsuk-frontend/components/care-card/care-card-non-urgent.html)

### HTML markup
#### HTML markup

```html
<div class="nhsuk-care-card nhsuk-care-card--non-urgent">
Expand All @@ -32,9 +32,7 @@ Find out more about the care card component and when to use it in the [NHS Digit
</div>
```

### Nunjucks macro

If you’re using Nunjucks macros in production be aware that using `html` arguments, or ones ending with `html` can be a [security risk](https://en.wikipedia.org/wiki/Cross-site_scripting). More about it in the [Nunjucks documentation](https://mozilla.github.io/nunjucks/api.html#user-defined-templates-warning).
#### Nunjucks macro

```
{% from 'components/care-card/macro.njk' import careCard %}
Expand All @@ -54,11 +52,13 @@ If you’re using Nunjucks macros in production be aware that using `html` argum
}) }}
```

---

### Care card urgent (red)

[Preview care card urgent (red) component](https://nhsuk.github.io/nhsuk-frontend/components/care-card/care-card-urgent.html)

### HTML markup
#### HTML markup

```html
<div class="nhsuk-care-card nhsuk-care-card--urgent">
Expand All @@ -78,9 +78,7 @@ If you’re using Nunjucks macros in production be aware that using `html` argum
</div>
```

### Nunjucks macro

If you’re using Nunjucks macros in production be aware that using `html` arguments, or ones ending with `html` can be a [security risk](https://en.wikipedia.org/wiki/Cross-site_scripting). More about it in the [Nunjucks documentation](https://mozilla.github.io/nunjucks/api.html#user-defined-templates-warning).
#### Nunjucks macro

```
{% from 'components/care-card/macro.njk' import careCard %}
Expand All @@ -100,11 +98,13 @@ If you’re using Nunjucks macros in production be aware that using `html` argum
}) }}
```

---

### Care card immediate (red and black)

[Preview care card immediate (red and black) component](https://nhsuk.github.io/nhsuk-frontend/components/care-card/care-card-immediate.html)

### HTML markup
#### HTML markup

```html
<div class="nhsuk-care-card nhsuk-care-card--immediate">
Expand All @@ -123,9 +123,7 @@ If you’re using Nunjucks macros in production be aware that using `html` argum
</div>
```

### Nunjucks macro

If you’re using Nunjucks macros in production be aware that using `html` arguments, or ones ending with `html` can be a [security risk](https://en.wikipedia.org/wiki/Cross-site_scripting). More about it in the [Nunjucks documentation](https://mozilla.github.io/nunjucks/api.html#user-defined-templates-warning).
#### Nunjucks macro

```
{% from 'components/care-card/macro.njk' import careCard %}
Expand All @@ -144,7 +142,9 @@ If you’re using Nunjucks macros in production be aware that using `html` argum
}) }}
```

## Nunjucks arguments
---

### Nunjucks arguments

The care card Nunjucks macro takes the following arguments:

Expand All @@ -156,3 +156,5 @@ The care card Nunjucks macro takes the following arguments:
| **headingLevel** | integer | No | Optional heading level for the heading. Default: 3 |
| **classes** | string | No | Optional additional classes to add to the care card. Separate each class with a space. |
| **attributes** | object | No | Any extra HTML attributes (for example data attributes) to add to the care card. |

If you are using Nunjucks macros in production be aware that using `html` arguments, or ones ending with `html` can be a [security risk](https://developer.mozilla.org/en-US/docs/Glossary/Cross-site_scripting). Read more about this in the [Nunjucks documentation](https://mozilla.github.io/nunjucks/api.html#user-defined-templates-warning).
Loading

0 comments on commit 89d7ade

Please sign in to comment.