Skip to content

Commit

Permalink
Merge pull request #776 from alphagov/add-tabs-component
Browse files Browse the repository at this point in the history
Add tabs component
  • Loading branch information
alex-ju authored Jun 20, 2018
2 parents 430635f + 7fe359e commit 1b9ca1c
Show file tree
Hide file tree
Showing 16 changed files with 1,764 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ Note: We're not following semantic versioning yet, we are going to talk about th

- Add default text for back-link component
([PR #793](https://github.com/alphagov/govuk-frontend/pull/793))

- Add default container class to the header component
([PR #807](https://github.com/alphagov/govuk-frontend/pull/807))

- Add tabs component – thanks to [@adamsilver](https://github.com/adamsilver) and [@trevorsaint](https://github.com/trevorsaint) for contributing
([PR #776](https://github.com/alphagov/govuk-frontend/pull/776))

🔧 Fixes:

- Pull Request Title goes here
Expand Down
9 changes: 8 additions & 1 deletion src/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Checkboxes from './components/checkboxes/checkboxes'
import ErrorSummary from './components/error-summary/error-summary'
import Header from './components/header/header'
import Radios from './components/radios/radios'
import Tabs from './components/tabs/tabs'

function initAll () {
new Button(document).init()
Expand All @@ -31,6 +32,11 @@ function initAll () {
nodeListForEach($radios, function ($radio) {
new Radios($radio).init()
})

var $tabs = document.querySelectorAll('[data-module="tabs"]')
nodeListForEach($tabs, function ($tabs) {
new Tabs($tabs).init()
})
}

export {
Expand All @@ -40,5 +46,6 @@ export {
Checkboxes,
ErrorSummary,
Header,
Radios
Radios,
Tabs
}
3 changes: 2 additions & 1 deletion src/all.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ describe('GOV.UK Frontend', () => {
'Checkboxes',
'ErrorSummary',
'Header',
'Radios'
'Radios',
'Tabs'
])
})
it('exported Components can be initialised', async () => {
Expand Down
1 change: 1 addition & 0 deletions src/components/_all.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
@import "label/label";
@import "panel/panel";
@import "phase-banner/phase-banner";
@import "tabs/tabs";
@import "tag/tag";
@import "radios/radios";
@import "select/select";
Expand Down
Loading

0 comments on commit 1b9ca1c

Please sign in to comment.