Skip to content

Commit

Permalink
Merge pull request #769 from alphagov/update-tables-of-arguments
Browse files Browse the repository at this point in the history
Update components' tables of arguments
  • Loading branch information
Jani Kraner authored Jun 13, 2018
2 parents 5198d71 + 6d2fc39 commit 45f539a
Show file tree
Hide file tree
Showing 51 changed files with 1,188 additions and 950 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ Note: We're not following semantic versioning yet, we are going to talk about th
- Use the correct class name in bold label example
(govuk-label--s rather than govuk-label--bold)
([PR #784](https://github.com/alphagov/govuk-frontend/pull/784))

- Update table of arguments for each component to ensure they're accurate.
([PR #769](https://github.com/alphagov/govuk-frontend/pull/769))


🆕 New features:
Expand Down
28 changes: 8 additions & 20 deletions src/components/back-link/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,49 +69,37 @@ If you are using Nunjucks,then macros take the following arguments

<tr class="govuk-table__row">

<th class="govuk-table__header" scope="row">classes</th>
<th class="govuk-table__header" scope="row">text (or) html</th>

<td class="govuk-table__cell ">string</td>

<td class="govuk-table__cell ">No</td>
<td class="govuk-table__cell ">Yes</td>

<td class="govuk-table__cell ">Optional additional classes for the back-link component.</td>
<td class="govuk-table__cell ">Text or HTML to use within the back link component. If `html` is provided, the `text` argument will be ignored.</td>

</tr>

<tr class="govuk-table__row">

<th class="govuk-table__header" scope="row">text</th>
<th class="govuk-table__header" scope="row">href</th>

<td class="govuk-table__cell ">string</td>

<td class="govuk-table__cell ">No</td>
<td class="govuk-table__cell ">Yes</td>

<td class="govuk-table__cell ">Text to use within the back link component.</td>
<td class="govuk-table__cell ">The value of the link href attribute</td>

</tr>

<tr class="govuk-table__row">

<th class="govuk-table__header" scope="row">html</th>
<th class="govuk-table__header" scope="row">classes</th>

<td class="govuk-table__cell ">string</td>

<td class="govuk-table__cell ">No</td>

<td class="govuk-table__cell ">HTML to use within the back link. If this is provided, the text argument will be ignored.</td>

</tr>

<tr class="govuk-table__row">

<th class="govuk-table__header" scope="row">href</th>

<td class="govuk-table__cell ">string</td>

<td class="govuk-table__cell ">Yes</td>

<td class="govuk-table__cell ">The value of the link href attribute</td>
<td class="govuk-table__cell ">Optional additional classes to add to the anchor tag.</td>

</tr>

Expand Down
30 changes: 8 additions & 22 deletions src/components/back-link/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -39,35 +39,35 @@ Link back component, to go back a page.
'rows' : [
[
{
text: 'classes'
text: 'text (or) html'
},
{
text: 'string'
},
{
text:'No'
text:'Yes'
},
{
text: 'Optional additional classes for the back-link component.'
text: 'Text or HTML to use within the back link component. If `html` is provided, the `text` argument will be ignored.'
}
],
[
{
text: 'text'
text: 'href'
},
{
text: 'string'
},
{
text:'No'
text:'Yes'
},
{
text: 'Text to use within the back link component.'
text: 'The value of the link href attribute'
}
],
[
{
text: 'html'
text: 'classes'
},
{
text: 'string'
Expand All @@ -76,21 +76,7 @@ Link back component, to go back a page.
text:'No'
},
{
text: 'HTML to use within the back link. If this is provided, the text argument will be ignored.'
}
],
[
{
text: 'href'
},
{
text: 'string'
},
{
text:'Yes'
},
{
text: 'The value of the link href attribute'
text: 'Optional additional classes to add to the anchor tag.'
}
],
[
Expand Down
32 changes: 10 additions & 22 deletions src/components/breadcrumbs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,61 +250,49 @@ If you are using Nunjucks,then macros take the following arguments

<tr class="govuk-table__row">

<th class="govuk-table__header" scope="row">classes</th>

<td class="govuk-table__cell ">string</td>

<td class="govuk-table__cell ">No</td>

<td class="govuk-table__cell ">Optional additional classes</td>

</tr>

<tr class="govuk-table__row">

<th class="govuk-table__header" scope="row">items</th>

<td class="govuk-table__cell ">array</td>

<td class="govuk-table__cell ">Yes</td>

<td class="govuk-table__cell ">Array of breadcrumbs items</td>
<td class="govuk-table__cell ">Array of breadcrumbs item objects.</td>

</tr>

<tr class="govuk-table__row">

<th class="govuk-table__header" scope="row">text</th>
<th class="govuk-table__header" scope="row">items.{}.text (or) items.{}.html</th>

<td class="govuk-table__cell ">string</td>

<td class="govuk-table__cell ">No</td>
<td class="govuk-table__cell ">Yes</td>

<td class="govuk-table__cell ">Text to use within the breadcrumbs item</td>
<td class="govuk-table__cell ">Text or HTML to use within the breadcrumbs item. If `html` is provided, the `text` argument will be ignored.</td>

</tr>

<tr class="govuk-table__row">

<th class="govuk-table__header" scope="row">html</th>
<th class="govuk-table__header" scope="row">items.{}.href</th>

<td class="govuk-table__cell ">string</td>

<td class="govuk-table__cell ">No</td>
<td class="govuk-table__cell ">no</td>

<td class="govuk-table__cell ">HTML to use within the breadcrumbs item. If this is provided, the text argument will be ignored.</td>
<td class="govuk-table__cell ">Link for the breadcrumbs item. If not specified, breadcrumbs item is a normal list item</td>

</tr>

<tr class="govuk-table__row">

<th class="govuk-table__header" scope="row">href</th>
<th class="govuk-table__header" scope="row">classes</th>

<td class="govuk-table__cell ">string</td>

<td class="govuk-table__cell ">no</td>
<td class="govuk-table__cell ">No</td>

<td class="govuk-table__cell ">Link for the breadcrumbs item. If not specified, breadcrumbs item is a normal list item</td>
<td class="govuk-table__cell ">Optional additional classes to add to the breadcrumbs container.</td>

</tr>

Expand Down
34 changes: 10 additions & 24 deletions src/components/breadcrumbs/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,6 @@ The Breadcrumbs component helps users to understand where they are within a webs
}
],
'rows': [
[
{
text: 'classes'
},
{
text: 'string'
},
{
text: 'No'
},
{
text: 'Optional additional classes'
}
],
[
{
text: 'items'
Expand All @@ -60,49 +46,49 @@ The Breadcrumbs component helps users to understand where they are within a webs
text: 'Yes'
},
{
text: 'Array of breadcrumbs items'
text: 'Array of breadcrumbs item objects.'
}
],
[
{
text: 'text'
text: 'items.{}.text (or) items.{}.html'
},
{
text: 'string'
},
{
text: 'No'
text:'Yes'
},
{
text: 'Text to use within the breadcrumbs item'
text: 'Text or HTML to use within the breadcrumbs item. If `html` is provided, the `text` argument will be ignored.'
}
],
[
{
text: 'html'
text: 'items.{}.href'
},
{
text: 'string'
},
{
text: 'No'
text: 'no'
},
{
text: 'HTML to use within the breadcrumbs item. If this is provided, the text argument will be ignored.'
text: 'Link for the breadcrumbs item. If not specified, breadcrumbs item is a normal list item'
}
],
[
{
text: 'href'
text: 'classes'
},
{
text: 'string'
},
{
text: 'no'
text: 'No'
},
{
text: 'Link for the breadcrumbs item. If not specified, breadcrumbs item is a normal list item'
text: 'Optional additional classes to add to the breadcrumbs container.'
}
],
[
Expand Down
20 changes: 4 additions & 16 deletions src/components/button/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,33 +190,21 @@ If you are using Nunjucks,then macros take the following arguments

<td class="govuk-table__cell ">string</td>

<td class="govuk-table__cell ">Yes</td>
<td class="govuk-table__cell ">No</td>

<td class="govuk-table__cell ">Whether to use an `input`, `button` or `a` element to create the button. In most cases you will not need to set this as it will be configured automatically if you use `href` or `html`.</td>

</tr>

<tr class="govuk-table__row">

<th class="govuk-table__header" scope="row">text</th>

<td class="govuk-table__cell ">string</td>

<td class="govuk-table__cell ">Yes</td>

<td class="govuk-table__cell ">Text for the button</td>

</tr>

<tr class="govuk-table__row">

<th class="govuk-table__header" scope="row">html</th>
<th class="govuk-table__header" scope="row">text (or) html</th>

<td class="govuk-table__cell ">string</td>

<td class="govuk-table__cell ">Yes</td>

<td class="govuk-table__cell ">HTML for the button or link. If this is provided, the `text` argument will be ignored and `element` will be automatically set to `button` unless `href` is also set, or it has already been defined. This argument has no effect if `element` is set to `input`.</td>
<td class="govuk-table__cell ">Text or HTML for the button or link. If `html` is provided, the `text` argument will be ignored and `element` will be automatically set to `button` unless `href` is also set, or it has already been defined. This argument has no effect if `element` is set to `input`.</td>

</tr>

Expand Down Expand Up @@ -300,7 +288,7 @@ If you are using Nunjucks,then macros take the following arguments

<td class="govuk-table__cell ">No</td>

<td class="govuk-table__cell ">Any extra HTML attributes (for example data attributes) to add to the error message span tag</td>
<td class="govuk-table__cell ">Any extra HTML attributes (for example data attributes) to add to the button component.</td>

</tr>

Expand Down
24 changes: 5 additions & 19 deletions src/components/button/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -51,38 +51,24 @@ Buttons are configured to perform an action and they can have a different look.
text: 'string'
},
{
text: 'Yes'
text: 'No'
},
{
text: 'Whether to use an `input`, `button` or `a` element to create the button. In most cases you will not need to set this as it will be configured automatically if you use `href` or `html`.'
}
],
[
{
text: 'text'
text: 'text (or) html'
},
{
text: 'string'
},
{
text: 'Yes'
},
{
text: 'Text for the button'
}
],
[
{
text: 'html'
},
{
text: 'string'
},
{
text: 'Yes'
text:'Yes'
},
{
text: 'HTML for the button or link. If this is provided, the `text` argument will be ignored and `element` will be automatically set to `button` unless `href` is also set, or it has already been defined. This argument has no effect if `element` is set to `input`.'
text: 'Text or HTML for the button or link. If `html` is provided, the `text` argument will be ignored and `element` will be automatically set to `button` unless `href` is also set, or it has already been defined. This argument has no effect if `element` is set to `input`.'
}
],
[
Expand Down Expand Up @@ -180,7 +166,7 @@ Buttons are configured to perform an action and they can have a different look.
text: 'No'
},
{
text: 'Any extra HTML attributes (for example data attributes) to add to the error message span tag'
text: 'Any extra HTML attributes (for example data attributes) to add to the button component.'
}
]
]
Expand Down
Loading

0 comments on commit 45f539a

Please sign in to comment.