r(o[a])&&(t.offsets.popper[l]=r(o[a])),t}},arrow:{order:500,enabled:!0,fn:function(t,e){var n;if(!ot(t.instance.modifiers,"arrow","keepTogether"))return t;var o=e.element;if("string"==typeof o){if(!(o=t.instance.popper.querySelector(o)))return t}else if(!t.instance.popper.contains(o))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),t;var i=t.placement.split("-")[0],r=t.offsets,s=r.popper,a=r.reference,l=-1!==["left","right"].indexOf(i),c=l?"height":"width",u=l?"Top":"Left",d=u.toLowerCase(),p=l?"left":"top",f=l?"bottom":"right",h=R(o)[c];a[f]-hs[f]&&(t.offsets.popper[d]+=a[d]+h-s[f]),t.offsets.popper=B(t.offsets.popper);var m=a[d]+a[c]/2-h/2,b=w(t.instance.popper),g=parseFloat(b["margin"+u],10),v=parseFloat(b["border"+u+"Width"],10),y=m-t.offsets.popper[d]-g-v;return y=Math.max(Math.min(s[c]-h,y),0),t.arrowElement=o,t.offsets.arrow=(H(n={},d,Math.round(y)),H(n,p,""),n),t},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(t,e){if(z(t.instance.modifiers,"inner"))return t;if(t.flipped&&t.placement===t.originalPlacement)return t;var n=P(t.instance.popper,t.instance.reference,e.padding,e.boundariesElement,t.positionFixed),o=t.placement.split("-")[0],i=G(o),r=t.placement.split("-")[1]||"",s=[];switch(e.behavior){case at.FLIP:s=[o,i];break;case at.CLOCKWISE:s=st(o);break;case at.COUNTERCLOCKWISE:s=st(o,!0);break;default:s=e.behavior}return s.forEach(function(a,l){if(o!==a||s.length===l+1)return t;o=t.placement.split("-")[0],i=G(o);var c,u=t.offsets.popper,d=t.offsets.reference,p=Math.floor,f="left"===o&&p(u.right)>p(d.left)||"right"===o&&p(u.left)p(d.top)||"bottom"===o&&p(u.top)
p(n.right),b=p(u.top)
p(n.bottom),v="left"===o&&h||"right"===o&&m||"top"===o&&b||"bottom"===o&&g,y=-1!==["top","bottom"].indexOf(o),w=!!e.flipVariations&&(y&&"start"===r&&h||y&&"end"===r&&m||!y&&"start"===r&&b||!y&&"end"===r&&g);(f||v||w)&&(t.flipped=!0,(f||v)&&(o=s[l+1]),w&&(r="end"===(c=r)?"start":"start"===c?"end":c),t.placement=o+(r?"-"+r:""),t.offsets.popper=D({},t.offsets.popper,U(t.instance.popper,t.offsets.reference,t.placement)),t=K(t.instance.modifiers,t,"flip"))}),t},behavior:"flip",padding:5,boundariesElement:"viewport"},inner:{order:700,enabled:!1,fn:function(t){var e=t.placement,n=e.split("-")[0],o=t.offsets,i=o.popper,r=o.reference,s=-1!==["left","right"].indexOf(n),a=-1===["top","left"].indexOf(n);return i[s?"left":"top"]=r[n]-(a?i[s?"width":"height"]:0),t.placement=G(e),t.offsets.popper=B(i),t}},hide:{order:800,enabled:!0,fn:function(t){if(!ot(t.instance.modifiers,"hide","preventOverflow"))return t;var e=t.offsets.reference,n=Y(t.instance.modifiers,function(t){return"preventOverflow"===t.name}).boundaries;if(e.bottomn.right||e.top>n.bottom||e.right2&&arguments[2]!==undefined?arguments[2]:{};M(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(o.update)},this.update=v(this.update.bind(this)),this.options=D({},t.Defaults,i),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=e&&e.jquery?e[0]:e,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(D({},t.Defaults.modifiers,i.modifiers)).forEach(function(e){o.options.modifiers[e]=D({},t.Defaults.modifiers[e]||{},i.modifiers?i.modifiers[e]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(t){return D({name:t},o.options.modifiers[t])}).sort(function(t,e){return t.order-e.order}),this.modifiers.forEach(function(t){t.enabled&&y(t.onLoad)&&t.onLoad(o.reference,o.popper,o.options,t,o.state)}),this.update();var r=this.options.eventsEnabled;r&&this.enableEventListeners(),this.state.eventsEnabled=r}return N(t,[{key:"update",value:function(){return function(){if(!this.state.isDestroyed){var t={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};t.offsets.reference=V(this.state,this.popper,this.reference,this.options.positionFixed),t.placement=W(this.options.placement,t.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),t.originalPlacement=t.placement,t.positionFixed=this.options.positionFixed,t.offsets.popper=U(this.popper,t.offsets.reference,t.placement),t.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",t=K(this.modifiers,t),this.state.isCreated?this.options.onUpdate(t):(this.state.isCreated=!0,this.options.onCreate(t))}}.call(this)}},{key:"destroy",value:function(){return function(){return this.state.isDestroyed=!0,z(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[X("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}.call(this)}},{key:"enableEventListeners",value:function(){return function(){this.state.eventsEnabled||(this.state=Q(this.reference,this.options,this.state,this.scheduleUpdate))}.call(this)}},{key:"disableEventListeners",value:function(){return Z.call(this)}}]),t}();function dt(t){this.$module=t,this.$toggleButton=null,this.$dropdown=null,this.popper=null,this.blurEnabled=!0}function pt(t){this.$module=t}function ft(t){console.log(t),this.$module=t,this.$appear=null,this.$disappear=null}ut.Utils=("undefined"!=typeof window?window:global).PopperUtils,ut.placements=it,ut.Defaults=ct,dt.prototype.init=function(){var t=this.$module;t&&(this.$toggleButton=t.querySelector(".js-dropdown-toggle"),this.$toggleButton&&(t.querySelectorAll(".sdn-header__dropdown a").forEach(function(t){t.addEventListener("click",function(){this.$dropdown.style.display="none",this.blurEnabled=!0}.bind(this))}.bind(this)),this.$dropdown=t.querySelector("#"+this.$toggleButton.getAttribute("aria-controls")),document.getElementsByTagName("body")[0].appendChild(this.$dropdown),this.popper=new ut(this.$toggleButton,this.$dropdown,{placement:"bottom-end"}),this.$toggleButton.addEventListener("click",this.handleClick.bind(this)),this.$toggleButton.addEventListener("blur",this.handleBlur.bind(this)),this.$dropdown.addEventListener("mouseenter",this.handleMouseenter.bind(this)),this.$dropdown.addEventListener("mouseleave",this.handleMouseleave.bind(this))))},dt.prototype.toggleClass=function(t,e){t.className.indexOf(e)>0?t.className=t.className.replace(" "+e,""):t.className+=" "+e},dt.prototype.handleClick=function(t){t.preventDefault(),this.$dropdown.style.display="block",this.popper.update()},dt.prototype.handleBlur=function(t){this.blurEnabled&&(this.$dropdown.style.display="none")},dt.prototype.handleMouseenter=function(t){this.blurEnabled=!1},dt.prototype.handleMouseleave=function(t){this.blurEnabled=!0},pt.prototype.init=function(){var t=this.$module;!t||t.className.indexOf("snd-timeline--readonly")>-1||(document.addEventListener("click",this.handleBlur.bind(this)),n("body","click",".js-sdn-timeline__bullet",this.handleClick.bind(this)),n("body","click",".sdn-timeline-dropdown__option",this.closeMenu))},pt.prototype.handleClick=function(t){t.preventDefault();var e=t.target;this.closeMenu(),e.parentNode.classList.add("sdn-timeline__step--dropdown-active"),e.getAttribute("data-blur-initialized")||(e.setAttribute("data-blur-initialized",!0),e.setAttribute("tabindex","0"),e.focus())},pt.prototype.handleBlur=function(t){var e=!0;e=(e=(e=e&&!t.target.classList.contains("sdn-timeline-dropdown__option"))&&!t.target.classList.contains("sdn-timeline-dropdown__bullet"))&&!t.target.classList.contains("sdn-timeline-dropdown__additional-info"),t.target.classList.contains("js-sdn-timeline__bullet")&&(e=!t.target.parentNode.classList.contains("sdn-timeline__step--dropdown-active")),e&&this.closeMenu()},pt.prototype.closeMenu=function(){e(document.querySelectorAll(".sdn-timeline__step--dropdown-active"),function(t){t.classList.remove("sdn-timeline__step--dropdown-active")})},ft.prototype.init=function(){var t=this.$module;if(t){t.addEventListener("click",this.handleClick.bind(this));var e=t.dataset.appear,n=t.dataset.disappear;this.$appear=document.getElementById(e),this.$disappear=document.getElementById(n)}},ft.prototype.handleClick=function(t){t.preventDefault(),this.$appear&&this.$appear.classList.remove("sdn-appear-link-hide"),this.$disappear&&this.$disappear.classList.add("sdn-appear-link-hide"),console.log(this.$appear,this.$disappear)},t.initAll=function(){new r(document).init(),e(document.querySelectorAll('[data-module="accordion"]'),function(t){new o(t).init()}),e(document.querySelectorAll("details"),function(t){new a(t).init()}),e(document.querySelectorAll('[data-module="character-count"]'),function(t){new l(t).init()}),e(document.querySelectorAll('[data-module="checkboxes"]'),function(t){new c(t).init()}),new u(document.querySelector('[data-module="error-summary"]')).init(),new d(document.querySelector('[data-module="header"]')).init(),e(document.querySelectorAll('[data-module="radios"]'),function(t){new p(t).init()}),e(document.querySelectorAll('[data-module="tabs"]'),function(t){new f(t).init()}),new dt(document.querySelector('[data-module="sdn-header"]')).init(),new pt(document.querySelector('[data-module="sdn-timeline"]')).init(),e(document.querySelectorAll('[data-module="sdn-appear-link"]'),function(t){new ft(t).init()})},t.Accordion=o,t.Button=r,t.Details=a,t.CharacterCount=l,t.Checkboxes=c,t.ErrorSummary=u,t.Header=d,t.Radios=p,t.Tabs=f,t.SdnHeader=dt,t.SdnTimeline=pt});
diff --git a/dist/govuk-frontend-ie8-2.5.1.min.css b/dist/navody-digital-ie8-0.1.0.min.css
similarity index 100%
rename from dist/govuk-frontend-ie8-2.5.1.min.css
rename to dist/navody-digital-ie8-0.1.0.min.css
diff --git a/lib/file-helper.js b/lib/file-helper.js
index c350fd125f..6c16f29ee5 100644
--- a/lib/file-helper.js
+++ b/lib/file-helper.js
@@ -17,7 +17,9 @@ const sdnChildDirectories = dir => {
// Generate component list from source directory, excluding anything that's not
// a directory (for example, .DS_Store files)
-exports.allComponents = childDirectories(configPaths.components)
+exports.allComponents = childDirectories(configPaths.components).filter(function (directory) {
+ return directory !== '_sdn' && directory !== '_custom'
+})
exports.allSdnComponents = sdnChildDirectories(configPaths.sdn_components)
// Read the contents of a file from a given path
diff --git a/package.json b/package.json
index 2d381ef7d1..68daeb1a4b 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"private": true,
- "name": "govuk-frontend-repository",
+ "name": "navody-digital-repository",
"description": "Used only for the development of GOV.UK Frontend, see `package/package.json` for the published `package.json`",
"engines": {
"node": "8.9.4"
diff --git a/package/all.js b/package/all.js
index 1d6718742d..7d7bcb9dc0 100644
--- a/package/all.js
+++ b/package/all.js
@@ -4952,7 +4952,9 @@ SdnTimeline.prototype.init = function () {
return
}
+ document.addEventListener('click', this.handleBlur.bind(this));
on('body', 'click', '.js-sdn-timeline__bullet', this.handleClick.bind(this));
+ on('body', 'click', '.sdn-timeline-dropdown__option', this.closeMenu);
};
SdnTimeline.prototype.handleClick = function (event) {
@@ -4960,58 +4962,72 @@ SdnTimeline.prototype.handleClick = function (event) {
var element = event.target;
- element.parentNode.classList.toggle('sdn-timeline__step--dropdown-active');
+ this.closeMenu();
+ element.parentNode.classList.add('sdn-timeline__step--dropdown-active');
if (!element.getAttribute('data-blur-initialized')) {
element.setAttribute('data-blur-initialized', true);
element.setAttribute('tabindex', '0');
- element.addEventListener('focusout', this.handleBlur);
+ // element.addEventListener('focusout', this.handleBlur)
element.focus();
}
};
SdnTimeline.prototype.handleBlur = function (event) {
- event.preventDefault();
+ var closeMenu = true;
+ closeMenu = closeMenu && !event.target.classList.contains('sdn-timeline-dropdown__option');
+ closeMenu = closeMenu && !event.target.classList.contains('sdn-timeline-dropdown__bullet');
+ closeMenu = closeMenu && !event.target.classList.contains('sdn-timeline-dropdown__additional-info');
+
+ if (event.target.classList.contains('js-sdn-timeline__bullet')) {
+ closeMenu = !event.target.parentNode.classList.contains('sdn-timeline__step--dropdown-active');
+ }
- setTimeout(function () {
- this.parentNode.classList.remove('sdn-timeline__step--dropdown-active');
- }.bind(this), 100);
+ if (closeMenu) {
+ this.closeMenu();
+ }
};
-function SndAppearLink($module) {
+SdnTimeline.prototype.closeMenu = function () {
+ var items = document.querySelectorAll('.sdn-timeline__step--dropdown-active');
+ nodeListForEach(items, function (item) {
+ item.classList.remove('sdn-timeline__step--dropdown-active');
+ });
+};
+
+function SndAppearLink ($module) {
console.log($module);
this.$module = $module;
this.$appear = null;
this.$disappear = null;
}
-SndAppearLink.prototype.init = function() {
+SndAppearLink.prototype.init = function () {
// Check for module
var $module = this.$module;
if (!$module) {
- return;
+ return
}
- $module.addEventListener("click", this.handleClick.bind(this));
- var appearId = $module.dataset["appear"];
- var disappearId = $module.dataset["disappear"];
+ $module.addEventListener('click', this.handleClick.bind(this));
+ var appearId = $module.dataset['appear'];
+ var disappearId = $module.dataset['disappear'];
this.$appear = document.getElementById(appearId);
this.$disappear = document.getElementById(disappearId);
};
-SndAppearLink.prototype.handleClick = function(event) {
+SndAppearLink.prototype.handleClick = function (event) {
event.preventDefault();
if (this.$appear) {
- this.$appear.classList.remove("sdn-appear-link-hide");
+ this.$appear.classList.remove('sdn-appear-link-hide');
}
if (this.$disappear) {
- this.$disappear.classList.add("sdn-appear-link-hide");
+ this.$disappear.classList.add('sdn-appear-link-hide');
}
console.log(this.$appear, this.$disappear);
-
};
function initAll () {
diff --git a/package/components/_custom/timeline/timeline.js b/package/components/_custom/timeline/timeline.js
index b34f136b35..93fe9fc1cc 100644
--- a/package/components/_custom/timeline/timeline.js
+++ b/package/components/_custom/timeline/timeline.js
@@ -664,6 +664,14 @@ if (detect) return
* This seems to fail in IE8, requires more investigation.
* See: https://github.com/imagitama/nodelist-foreach-polyfill
*/
+function nodeListForEach (nodes, callback) {
+ if (window.NodeList.prototype.forEach) {
+ return nodes.forEach(callback)
+ }
+ for (var i = 0; i < nodes.length; i++) {
+ callback.call(window, nodes[i], i, nodes);
+ }
+}
function on (elSelector, eventName, selector, fn) {
var element = document.querySelector(elSelector);
@@ -698,7 +706,9 @@ SdnTimeline.prototype.init = function () {
return
}
+ document.addEventListener('click', this.handleBlur.bind(this));
on('body', 'click', '.js-sdn-timeline__bullet', this.handleClick.bind(this));
+ on('body', 'click', '.sdn-timeline-dropdown__option', this.closeMenu);
};
SdnTimeline.prototype.handleClick = function (event) {
@@ -706,22 +716,37 @@ SdnTimeline.prototype.handleClick = function (event) {
var element = event.target;
- element.parentNode.classList.toggle('sdn-timeline__step--dropdown-active');
+ this.closeMenu();
+ element.parentNode.classList.add('sdn-timeline__step--dropdown-active');
if (!element.getAttribute('data-blur-initialized')) {
element.setAttribute('data-blur-initialized', true);
element.setAttribute('tabindex', '0');
- element.addEventListener('focusout', this.handleBlur);
+ // element.addEventListener('focusout', this.handleBlur)
element.focus();
}
};
SdnTimeline.prototype.handleBlur = function (event) {
- event.preventDefault();
+ var closeMenu = true;
+ closeMenu = closeMenu && !event.target.classList.contains('sdn-timeline-dropdown__option');
+ closeMenu = closeMenu && !event.target.classList.contains('sdn-timeline-dropdown__bullet');
+ closeMenu = closeMenu && !event.target.classList.contains('sdn-timeline-dropdown__additional-info');
+
+ if (event.target.classList.contains('js-sdn-timeline__bullet')) {
+ closeMenu = !event.target.parentNode.classList.contains('sdn-timeline__step--dropdown-active');
+ }
- setTimeout(function () {
- this.parentNode.classList.remove('sdn-timeline__step--dropdown-active');
- }.bind(this), 100);
+ if (closeMenu) {
+ this.closeMenu();
+ }
+};
+
+SdnTimeline.prototype.closeMenu = function () {
+ var items = document.querySelectorAll('.sdn-timeline__step--dropdown-active');
+ nodeListForEach(items, function (item) {
+ item.classList.remove('sdn-timeline__step--dropdown-active');
+ });
};
return SdnTimeline;
diff --git a/package/package.json b/package/package.json
index 459178424c..7749df97db 100644
--- a/package/package.json
+++ b/package/package.json
@@ -1,7 +1,7 @@
{
- "name": "govuk-frontend",
+ "name": "mavody-digital-frontend",
"description": "GOV.UK Frontend contains the code you need to start building a user interface for government platforms and services.",
- "version": "2.5.1",
+ "version": "0.1.0",
"main": "all.js",
"sass": "all.scss",
"engines": {
@@ -20,6 +20,7 @@
},
"homepage": "https://github.com/alphagov/govuk-frontend#readme",
"keywords": [
+ "slovensko.digital",
"govuk",
"frontend",
"design system",
diff --git a/package/utilities/appear-link/appear-link.js b/package/utilities/appear-link/appear-link.js
index fb2367024d..0a5be5f61f 100644
--- a/package/utilities/appear-link/appear-link.js
+++ b/package/utilities/appear-link/appear-link.js
@@ -4,40 +4,39 @@
(global.navodyDigitalFrontend = factory());
}(this, (function () { 'use strict';
-function SndAppearLink($module) {
+function SndAppearLink ($module) {
console.log($module);
this.$module = $module;
this.$appear = null;
this.$disappear = null;
}
-SndAppearLink.prototype.init = function() {
+SndAppearLink.prototype.init = function () {
// Check for module
var $module = this.$module;
if (!$module) {
- return;
+ return
}
- $module.addEventListener("click", this.handleClick.bind(this));
- var appearId = $module.dataset["appear"];
- var disappearId = $module.dataset["disappear"];
+ $module.addEventListener('click', this.handleClick.bind(this));
+ var appearId = $module.dataset['appear'];
+ var disappearId = $module.dataset['disappear'];
this.$appear = document.getElementById(appearId);
this.$disappear = document.getElementById(disappearId);
};
-SndAppearLink.prototype.handleClick = function(event) {
+SndAppearLink.prototype.handleClick = function (event) {
event.preventDefault();
if (this.$appear) {
- this.$appear.classList.remove("sdn-appear-link-hide");
+ this.$appear.classList.remove('sdn-appear-link-hide');
}
if (this.$disappear) {
- this.$disappear.classList.add("sdn-appear-link-hide");
+ this.$disappear.classList.add('sdn-appear-link-hide');
}
console.log(this.$appear, this.$disappear);
-
};
return SndAppearLink;
diff --git a/src/all.test.js b/src/all.test.js
index 691fd92924..78f76774bd 100644
--- a/src/all.test.js
+++ b/src/all.test.js
@@ -40,26 +40,26 @@ afterAll(async (done) => {
describe('GOV.UK Frontend', () => {
describe('javascript', async () => {
- it('can be accessed via `GOVUKFrontend`', async () => {
+ it('can be accessed via `navodyDigitalFrontend`', async () => {
await page.goto(baseUrl + '/', { waitUntil: 'load' })
- const GOVUKFrontendGlobal = await page.evaluate(() => window.GOVUKFrontend)
+ const navodyDigitalFrontendGlobal = await page.evaluate(() => window.navodyDigitalFrontend)
- expect(typeof GOVUKFrontendGlobal).toBe('object')
+ expect(typeof navodyDigitalFrontendGlobal).toBe('object')
})
it('exports `initAll` function', async () => {
await page.goto(baseUrl + '/', { waitUntil: 'load' })
- const typeofInitAll = await page.evaluate(() => typeof window.GOVUKFrontend.initAll)
+ const typeofInitAll = await page.evaluate(() => typeof window.navodyDigitalFrontend.initAll)
expect(typeofInitAll).toEqual('function')
})
it('exports Components', async () => {
await page.goto(baseUrl + '/', { waitUntil: 'load' })
- const GOVUKFrontendGlobal = await page.evaluate(() => window.GOVUKFrontend)
+ const navodyDigitalFrontendGlobal = await page.evaluate(() => window.navodyDigitalFrontend)
- var components = Object.keys(GOVUKFrontendGlobal).filter(method => method !== 'initAll')
+ var components = Object.keys(navodyDigitalFrontendGlobal).filter(method => method !== 'initAll')
// Ensure GOV.UK Frontend exports the expected components
expect(components).toEqual([
@@ -71,45 +71,50 @@ describe('GOV.UK Frontend', () => {
'ErrorSummary',
'Header',
'Radios',
- 'Tabs'
+ 'Tabs',
+ 'SdnHeader',
+ 'SdnTimeline'
])
})
it('exported Components can be initialised', async () => {
await page.goto(baseUrl + '/', { waitUntil: 'load' })
- const GOVUKFrontendGlobal = await page.evaluate(() => window.GOVUKFrontend)
+ const navodyDigitalFrontendGlobal = await page.evaluate(() => window.navodyDigitalFrontend)
- var components = Object.keys(GOVUKFrontendGlobal).filter(method => method !== 'initAll')
+ var components = Object.keys(navodyDigitalFrontendGlobal).filter(method => method !== 'initAll')
// Check that all the components on the GOV.UK Frontend global can be initialised
components.forEach(component => {
page.evaluate(component => {
- const Component = window.GOVUKFrontend[component]
+ const Component = window.navodyDigitalFrontend[component]
const $module = document.documentElement
new Component($module).init()
}, component)
})
})
})
- describe('global styles', async () => {
- it('are disabled by default', async () => {
- const sass = `
- @import "all";
- `
- const results = await sassRender({ data: sass, ...sassConfig })
- expect(results.css.toString()).not.toContain(', a {')
- expect(results.css.toString()).not.toContain(', p {')
- })
- it('are enabled if $global-styles variable is set to true', async () => {
- const sass = `
- $govuk-global-styles: true;
- @import "all";
- `
- const results = await sassRender({ data: sass, ...sassConfig })
- expect(results.css.toString()).toContain(', a {')
- expect(results.css.toString()).toContain(', p {')
- })
- })
+
+ // navody.digital uses global styles in the default build
+ //
+ // describe('global styles', async () => {
+ // it('are disabled by default', async () => {
+ // const sass = `
+ // @import "all";
+ // `
+ // const results = await sassRender({ data: sass, ...sassConfig })
+ // expect(results.css.toString()).not.toContain(', a {')
+ // expect(results.css.toString()).not.toContain(', p {')
+ // })
+ // it('are enabled if $global-styles variable is set to true', async () => {
+ // const sass = `
+ // $govuk-global-styles: true;
+ // @import "all";
+ // `
+ // const results = await sassRender({ data: sass, ...sassConfig })
+ // expect(results.css.toString()).toContain(', a {')
+ // expect(results.css.toString()).toContain(', p {')
+ // })
+ // })
// Sass functions will be automatically evaluated at compile time and the
// return value from the function will be used in the compiled CSS.
diff --git a/src/components/_custom/footer/template.test.js b/src/components/_custom/footer/template.test.js
deleted file mode 100644
index 129bedf89f..0000000000
--- a/src/components/_custom/footer/template.test.js
+++ /dev/null
@@ -1,212 +0,0 @@
-/* eslint-env jest */
-
-const axe = require('../../../lib/axe-helper')
-
-const { render, getExamples } = require('../../../lib/jest-helpers')
-
-const examples = getExamples('sdn-footer')
-
-describe('sdn-footer', () => {
- it('default example passes accessibility tests', async () => {
- const $ = render('footer', examples.default)
-
- const results = await axe($.html())
- expect(results).toHaveNoViolations()
- })
-
- it('entire component must have a role of `contentinfo`', () => {
- const $ = render('footer', {})
-
- const $component = $('.govuk-footer')
- expect($component.attr('role')).toEqual('contentinfo')
- })
-
- it('renders attributes correctly', () => {
- const $ = render('footer', {
- attributes: {
- 'data-test-attribute': 'value',
- 'data-test-attribute-2': 'value-2'
- }
- })
-
- const $component = $('.govuk-footer')
- expect($component.attr('data-test-attribute')).toEqual('value')
- expect($component.attr('data-test-attribute-2')).toEqual('value-2')
- })
-
- it('renders classes', () => {
- const $ = render('footer', {
- classes: 'app-footer--custom-modifier'
- })
-
- const $component = $('.govuk-footer')
- expect($component.hasClass('app-footer--custom-modifier')).toBeTruthy()
- })
-
- it('renders custom container classes', () => {
- const $ = render('footer', {
- containerClasses: 'app-width-container'
- })
-
- const $component = $('.govuk-footer')
- const $container = $component.find('.govuk-width-container')
-
- expect($container.hasClass('app-width-container')).toBeTruthy()
- })
-
- describe('meta', () => {
- it('passes accessibility tests', async () => {
- const $ = render('footer', examples['with meta'])
-
- const results = await axe($.html())
- expect(results).toHaveNoViolations()
- })
-
- it('renders heading', () => {
- const $ = render('footer', examples['with meta'])
-
- const $component = $('.govuk-footer')
- const $heading = $component.find('h2.govuk-visually-hidden')
- expect($heading.text()).toEqual('Support links')
- })
-
- it('renders links', () => {
- const $ = render('footer', examples['with meta'])
-
- const $component = $('.govuk-footer')
- const $list = $component.find('ul.govuk-footer__inline-list')
- const $items = $list.find('li.govuk-footer__inline-list-item')
- const $firstItem = $items.find('a.govuk-footer__link:first-child')
- expect($items.length).toEqual(3)
- expect($firstItem.attr('href')).toEqual('#1')
- expect($firstItem.text()).toContain('Item 1')
- })
-
- it('renders custom meta text', () => {
- const $ = render('footer', {
- meta: {
- text: 'GOV.UK Prototype Kit v7.0.1'
- }
- })
-
- const $component = $('.govuk-footer')
- const $custom = $component.find('.govuk-footer__meta-custom')
- expect($custom.text()).toContain('GOV.UK Prototype Kit v7.0.1')
- })
-
- it('renders custom meta html', () => {
- const $ = render('footer', {
- meta: {
- html: 'GOV.UK Prototype Kit v7.0.1'
- }
- })
-
- const $component = $('.govuk-footer')
- const $custom = $component.find('.govuk-footer__meta-custom')
- expect($custom.text()).toContain('GOV.UK Prototype Kit v7.0.1')
- })
-
- it('renders attributes on meta links', () => {
- const $ = render('footer', {
- meta: {
- items: [
- {
- href: '#1',
- text: 'meta item 1',
- attributes: {
- 'data-attribute': 'my-attribute',
- 'data-attribute-2': 'my-attribute-2'
- }
- }
- ]
- }
- })
-
- const $metaLink = $('.govuk-footer__meta .govuk-footer__link')
- expect($metaLink.attr('data-attribute')).toEqual('my-attribute')
- expect($metaLink.attr('data-attribute-2')).toEqual('my-attribute-2')
- })
- })
-
- describe('navigation', () => {
- it('passes accessibility tests', async () => {
- const $ = render('footer', examples['with navigation'])
-
- const results = await axe($.html())
- expect(results).toHaveNoViolations()
- })
-
- it('renders headings', () => {
- const $ = render('footer', examples['with navigation'])
-
- const $component = $('.govuk-footer')
- const $firstSection = $component.find('.govuk-footer__section:first-child')
- const $lastSection = $component.find('.govuk-footer__section:last-child')
- const $firstHeading = $firstSection.find('h2.govuk-footer__heading')
- const $lastHeading = $lastSection.find('h2.govuk-footer__heading')
- expect($firstHeading.text()).toEqual('Two column list')
- expect($lastHeading.text()).toEqual('Single column list')
- })
-
- it('renders lists of links', () => {
- const $ = render('footer', examples['with navigation'])
-
- const $component = $('.govuk-footer')
- const $list = $component.find('ul.govuk-footer__list')
- const $items = $list.find('li.govuk-footer__list-item')
- const $firstItem = $items.find('a.govuk-footer__link:first-child')
- expect($items.length).toEqual(9)
- expect($firstItem.attr('href')).toEqual('#1')
- expect($firstItem.text()).toContain('Navigation item 1')
- })
-
- it('renders attributes on links', () => {
- const $ = render('footer', {
- navigation: [
- {
- items: [
- {
- href: '#1',
- text: 'Navigation item 1',
- attributes: {
- 'data-attribute': 'my-attribute',
- 'data-attribute-2': 'my-attribute-2'
- }
- }
- ]
- }
- ]
- })
-
- const $navigationLink = $('.govuk-footer__list .govuk-footer__link')
- expect($navigationLink.attr('data-attribute')).toEqual('my-attribute')
- expect($navigationLink.attr('data-attribute-2')).toEqual('my-attribute-2')
- })
-
- it('renders lists in columns', () => {
- const $ = render('footer', examples['with navigation'])
-
- const $component = $('.govuk-footer')
- const $list = $component.find('ul.govuk-footer__list')
- expect($list.hasClass('govuk-footer__list--columns-2')).toBeTruthy()
- })
- })
-
- describe('section break', () => {
- it('renders when there is a navigation', () => {
- const $ = render('footer', examples['with navigation'])
-
- const $component = $('.govuk-footer')
- const $sectionBreak = $component.find('hr.govuk-footer__section-break')
- expect($sectionBreak.length).toBeTruthy()
- })
-
- it('renders nothing when there is only meta', () => {
- const $ = render('footer', examples['with meta'])
-
- const $component = $('.govuk-footer')
- const $sectionBreak = $component.find('hr.govuk-footer__section-break')
- expect($sectionBreak.length).toBeFalsy()
- })
- })
-})
diff --git a/src/components/_custom/header/template.test.js b/src/components/_custom/header/template.test.js
deleted file mode 100644
index 7cf694dec2..0000000000
--- a/src/components/_custom/header/template.test.js
+++ /dev/null
@@ -1,135 +0,0 @@
-/* eslint-env jest */
-
-const axe = require('../../../../lib/axe-helper')
-
-const { render, getExamples } = require('../../../../lib/jest-helpers')
-
-const examples = getExamples('header')
-
-describe('header', () => {
- it('passes accessibility tests', async () => {
- const $ = render('header', examples.default)
-
- const results = await axe($.html())
- expect(results).toHaveNoViolations()
- })
-
- it('has a role of `banner`', () => {
- const $ = render('header', {})
-
- const $component = $('.govuk-header')
- expect($component.attr('role')).toEqual('banner')
- })
-
- it('renders attributes correctly', () => {
- const $ = render('header', {
- attributes: {
- 'data-test-attribute': 'value',
- 'data-test-attribute-2': 'value-2'
- }
- })
-
- const $component = $('.govuk-header')
- expect($component.attr('data-test-attribute')).toEqual('value')
- expect($component.attr('data-test-attribute-2')).toEqual('value-2')
- })
-
- it('renders classes', () => {
- const $ = render('header', {
- classes: 'app-header--custom-modifier'
- })
-
- const $component = $('.govuk-header')
- expect($component.hasClass('app-header--custom-modifier')).toBeTruthy()
- })
-
- it('renders custom container classes', () => {
- const $ = render('header', {
- containerClasses: 'app-width-container'
- })
-
- const $component = $('.govuk-header')
- const $container = $component.find('.govuk-header__container')
-
- expect($container.hasClass('app-width-container')).toBeTruthy()
- })
-
- it('renders home page URL', () => {
- const $ = render('header', {
- homepageUrl: '/'
- })
-
- const $component = $('.govuk-header')
- const $homepageLink = $component.find('.govuk-header__link--homepage')
- expect($homepageLink.attr('href')).toEqual('/')
- })
-
- describe('with product name', () => {
- it('renders product name', () => {
- const $ = render('header', examples['full width'])
-
- const $component = $('.govuk-header')
- const $productName = $component.find('.govuk-header__product-name')
- expect($productName.text().trim()).toEqual('Product Name')
- })
- })
-
- describe('with service name', () => {
- it('renders service name', () => {
- const $ = render('header', examples['with service name'])
-
- const $component = $('.govuk-header')
- const $serviceName = $component.find('.govuk-header__link--service-name')
- expect($serviceName.text().trim()).toEqual('Service Name')
- })
- })
-
- describe('with navigation', () => {
- it('passes accessibility tests', async () => {
- const $ = render('header', examples['with navigation'])
-
- const results = await axe($.html())
- expect(results).toHaveNoViolations()
- })
-
- it('renders navigation', () => {
- const $ = render('header', examples['with navigation'])
-
- const $component = $('.govuk-header')
- const $list = $component.find('ul.govuk-header__navigation')
- const $items = $list.find('li.govuk-header__navigation-item')
- const $firstItem = $items.find('a.govuk-header__link:first-child')
- expect($items.length).toEqual(4)
- expect($firstItem.attr('href')).toEqual('#1')
- expect($firstItem.text()).toContain('Navigation item 1')
- })
-
- it('renders navigation item anchor with attributes', () => {
- const $ = render('header', {
- navigation: [
- {
- 'text': 'Item',
- 'href': '/link',
- 'attributes': {
- 'data-attribute': 'my-attribute',
- 'data-attribute-2': 'my-attribute-2'
- }
- }
- ]
- })
-
- const $navigationLink = $('.govuk-header__navigation-item a')
- expect($navigationLink.attr('data-attribute')).toEqual('my-attribute')
- expect($navigationLink.attr('data-attribute-2')).toEqual('my-attribute-2')
- })
- describe('menu button', () => {
- it('has an explicit type="button" so it does not act as a submit button', () => {
- const $ = render('header', examples['with navigation'])
-
- const $button = $('.govuk-header__menu-button')
-
- expect($button.attr('type')).toEqual('button')
- })
- })
- })
-})
diff --git a/src/components/_custom/searchbar/template.test.js b/src/components/_custom/searchbar/template.test.js
deleted file mode 100644
index a9be19b697..0000000000
--- a/src/components/_custom/searchbar/template.test.js
+++ /dev/null
@@ -1,93 +0,0 @@
-/* eslint-env jest */
-
-const axe = require('../../../lib/axe-helper')
-
-const { render, getExamples, htmlWithClassName } = require('../../../lib/jest-helpers')
-
-const examples = getExamples('phase-banner')
-
-describe('Phase banner', () => {
- describe('by default', () => {
- it('passes accessibility tests', async () => {
- const $ = render('phase-banner', examples.default)
-
- const results = await axe($.html())
- expect(results).toHaveNoViolations()
- })
-
- it('allows additional classes to be added to the component', () => {
- const $ = render('phase-banner', {
- classes: 'extra-class one-more-class'
- })
-
- const $component = $('.govuk-phase-banner')
- expect($component.hasClass('extra-class one-more-class')).toBeTruthy()
- })
-
- it('renders banner text', () => {
- const $ = render('phase-banner', {
- text: 'This is a new service – your feedback will help us to improve it.'
- })
- const phaseBannerText = $('.govuk-phase-banner__text').text().trim()
-
- expect(phaseBannerText).toEqual('This is a new service – your feedback will help us to improve it.')
- })
-
- it('allows body text to be passed whilst escaping HTML entities', () => {
- const $ = render('phase-banner', {
- text: 'This is a new service - your feedback will help us to improve it.'
- })
-
- const phaseBannerText = $('.govuk-phase-banner__text').html().trim()
- expect(phaseBannerText).toEqual('This is a new service - your <a href="#" class="govuk-link">feedback</a> will help us to improve it.')
- })
-
- it('allows body HTML to be passed un-escaped', () => {
- const $ = render('phase-banner', examples.default)
-
- const phaseBannerText = $('.govuk-phase-banner__text').html().trim()
- expect(phaseBannerText).toEqual('This is a new service - your feedback will help us to improve it.')
- })
-
- it('allows additional attributes to be added to the component', () => {
- const $ = render('phase-banner', {
- attributes: {
- 'first-attribute': 'true',
- 'second-attribute': 'false'
- }
- })
-
- const $component = $('.govuk-phase-banner')
- expect($component.attr('first-attribute')).toEqual('true')
- expect($component.attr('second-attribute')).toEqual('false')
- })
- })
- describe('with dependant components', () => {
- it('renders the tag component text', () => {
- const $ = render('phase-banner', examples.default)
-
- expect(htmlWithClassName($, '.govuk-phase-banner__content__tag')).toMatchSnapshot()
- })
-
- it('renders the tag component html', () => {
- const $ = render('phase-banner', {
- 'tag': {
- 'html': 'alpha'
- }
- })
-
- expect(htmlWithClassName($, '.govuk-phase-banner__content__tag')).toMatchSnapshot()
- })
-
- it('renders the tag component classes', () => {
- const $ = render('phase-banner', {
- 'tag': {
- 'text': 'alpha',
- 'classes': 'govuk-tag--inactive'
- }
- })
-
- expect(htmlWithClassName($, '.govuk-phase-banner__content__tag')).toMatchSnapshot()
- })
- })
-})
diff --git a/src/components/_custom/timeline/timeline.js b/src/components/_custom/timeline/timeline.js
index 34d2db8c06..4f0fe68bd4 100644
--- a/src/components/_custom/timeline/timeline.js
+++ b/src/components/_custom/timeline/timeline.js
@@ -1,6 +1,6 @@
import '../../../vendor/polyfills/Function/prototype/bind'
import '../../../vendor/polyfills/Event'
-import { on } from '../../../common'
+import { nodeListForEach, on } from '../../../common'
function SdnTimeline ($module) {
this.$module = $module
@@ -13,7 +13,9 @@ SdnTimeline.prototype.init = function () {
return
}
+ document.addEventListener('click', this.handleBlur.bind(this))
on('body', 'click', '.js-sdn-timeline__bullet', this.handleClick.bind(this))
+ on('body', 'click', '.sdn-timeline-dropdown__option', this.closeMenu)
}
SdnTimeline.prototype.handleClick = function (event) {
@@ -21,22 +23,37 @@ SdnTimeline.prototype.handleClick = function (event) {
var element = event.target
- element.parentNode.classList.toggle('sdn-timeline__step--dropdown-active')
+ this.closeMenu()
+ element.parentNode.classList.add('sdn-timeline__step--dropdown-active')
if (!element.getAttribute('data-blur-initialized')) {
element.setAttribute('data-blur-initialized', true)
element.setAttribute('tabindex', '0')
- element.addEventListener('focusout', this.handleBlur)
+ // element.addEventListener('focusout', this.handleBlur)
element.focus()
}
}
SdnTimeline.prototype.handleBlur = function (event) {
- event.preventDefault()
+ var closeMenu = true
+ closeMenu = closeMenu && !event.target.classList.contains('sdn-timeline-dropdown__option')
+ closeMenu = closeMenu && !event.target.classList.contains('sdn-timeline-dropdown__bullet')
+ closeMenu = closeMenu && !event.target.classList.contains('sdn-timeline-dropdown__additional-info')
+
+ if (event.target.classList.contains('js-sdn-timeline__bullet')) {
+ closeMenu = !event.target.parentNode.classList.contains('sdn-timeline__step--dropdown-active')
+ }
+
+ if (closeMenu) {
+ this.closeMenu()
+ }
+}
- setTimeout(function () {
- this.parentNode.classList.remove('sdn-timeline__step--dropdown-active')
- }.bind(this), 100)
+SdnTimeline.prototype.closeMenu = function () {
+ var items = document.querySelectorAll('.sdn-timeline__step--dropdown-active')
+ nodeListForEach(items, function (item) {
+ item.classList.remove('sdn-timeline__step--dropdown-active')
+ })
}
export default SdnTimeline
diff --git a/src/components/_custom/todo-list/template.test.js b/src/components/_custom/todo-list/template.test.js
deleted file mode 100644
index c7d8efac1b..0000000000
--- a/src/components/_custom/todo-list/template.test.js
+++ /dev/null
@@ -1,104 +0,0 @@
-/* eslint-env jest */
-
-const axe = require('../../../lib/axe-helper')
-
-const { render, getExamples } = require('../../../lib/jest-helpers')
-
-const examples = getExamples('label')
-
-describe('Label', () => {
- describe('by default', () => {
- it('passes accessibility tests', async () => {
- const $ = render('label', examples.default)
-
- const results = await axe($.html())
- expect(results).toHaveNoViolations()
- })
-
- it('renders a label element', () => {
- const $ = render('label', examples.default)
-
- const $component = $('.govuk-label')
- expect($component.get(0).tagName).toEqual('label')
- })
-
- it('does not output anything if no html or text is provided', () => {
- const $ = render('label', {})
-
- const $component = $('.govuk-label')
-
- expect($component.length).toEqual(0)
- })
-
- it('allows additional classes to be added to the component', () => {
- const $ = render('label', {
- text: 'National Insurance number',
- classes: 'extra-class one-more-class'
- })
-
- const $component = $('.govuk-label')
- expect($component.hasClass('extra-class one-more-class')).toBeTruthy()
- })
-
- it('renders label text', () => {
- const $ = render('label', {
- text: 'National Insurance number'
- })
- const labelText = $('.govuk-label').text().trim()
-
- expect(labelText).toEqual('National Insurance number')
- })
-
- it('allows label text to be passed whilst escaping HTML entities', () => {
- const $ = render('label', {
- text: 'National Insurance number, NINO'
- })
-
- const labelText = $('.govuk-label').html().trim()
- expect(labelText).toEqual('National Insurance number, <em>NINO</em>')
- })
-
- it('allows label HTML to be passed un-escaped', () => {
- const $ = render('label', {
- html: 'National Insurance number NINO'
- })
-
- const labelText = $('.govuk-label').html().trim()
- expect(labelText).toEqual('National Insurance number NINO')
- })
-
- it('renders for attribute if specified', () => {
- const $ = render('label', {
- text: 'National Insurance number',
- for: '#dummy-input'
- })
-
- const labelForAttr = $('.govuk-label').attr('for')
- expect(labelForAttr).toEqual('#dummy-input')
- })
-
- it('can be nested inside an H1 using isPageHeading', () => {
- const $ = render('label', {
- text: 'National Insurance number',
- isPageHeading: true
- })
-
- const $selector = $('h1 > .govuk-label')
- expect($selector.length).toBeTruthy()
- })
-
- it('allows additional attributes to be added to the component', () => {
- const $ = render('label', {
- text: 'National Insurance number',
- attributes: {
- 'first-attribute': 'true',
- 'second-attribute': 'false'
- }
- })
-
- const $component = $('.govuk-label')
- expect($component.attr('first-attribute')).toEqual('true')
- expect($component.attr('second-attribute')).toEqual('false')
- })
- })
-})
diff --git a/src/utilities/appear-link/appear-link.js b/src/utilities/appear-link/appear-link.js
index e8e932fb43..aaabe680fc 100644
--- a/src/utilities/appear-link/appear-link.js
+++ b/src/utilities/appear-link/appear-link.js
@@ -1,37 +1,36 @@
-function SndAppearLink($module) {
- console.log($module);
- this.$module = $module;
- this.$appear = null;
- this.$disappear = null;
+function SndAppearLink ($module) {
+ console.log($module)
+ this.$module = $module
+ this.$appear = null
+ this.$disappear = null
}
-SndAppearLink.prototype.init = function() {
+SndAppearLink.prototype.init = function () {
// Check for module
- var $module = this.$module;
+ var $module = this.$module
if (!$module) {
- return;
+ return
}
- $module.addEventListener("click", this.handleClick.bind(this));
- var appearId = $module.dataset["appear"];
- var disappearId = $module.dataset["disappear"];
+ $module.addEventListener('click', this.handleClick.bind(this))
+ var appearId = $module.dataset['appear']
+ var disappearId = $module.dataset['disappear']
- this.$appear = document.getElementById(appearId);
- this.$disappear = document.getElementById(disappearId);
-};
+ this.$appear = document.getElementById(appearId)
+ this.$disappear = document.getElementById(disappearId)
+}
-SndAppearLink.prototype.handleClick = function(event) {
- event.preventDefault();
+SndAppearLink.prototype.handleClick = function (event) {
+ event.preventDefault()
if (this.$appear) {
- this.$appear.classList.remove("sdn-appear-link-hide");
+ this.$appear.classList.remove('sdn-appear-link-hide')
}
if (this.$disappear) {
- this.$disappear.classList.add("sdn-appear-link-hide");
+ this.$disappear.classList.add('sdn-appear-link-hide')
}
console.log(this.$appear, this.$disappear)
+}
-};
-
-export default SndAppearLink;
+export default SndAppearLink
diff --git a/tasks/gulp/__tests__/after-build-dist.test.js b/tasks/gulp/__tests__/after-build-dist.test.js
index db6634273f..1a36ffc855 100644
--- a/tasks/gulp/__tests__/after-build-dist.test.js
+++ b/tasks/gulp/__tests__/after-build-dist.test.js
@@ -54,24 +54,24 @@ describe('dist/', () => {
})
})
- describe(`govuk-frontend-${version}.min.css`, () => {
- const stylesheet = lib.readFileContents(path.join(configPaths.dist, `govuk-frontend-${version}.min.css`))
+ describe(`navody-digital-${version}.min.css`, () => {
+ const stylesheet = lib.readFileContents(path.join(configPaths.dist, `navody-digital-${version}.min.css`))
it('should not contain current media query displayed on body element', () => {
expect(stylesheet).not.toMatch(/body:before{content:/)
})
})
- describe(`govuk-frontend-ie8-${version}.min.css`, () => {
- const stylesheet = lib.readFileContents(path.join(configPaths.dist, `govuk-frontend-ie8-${version}.min.css`))
+ describe(`navody-digital-ie8-${version}.min.css`, () => {
+ const stylesheet = lib.readFileContents(path.join(configPaths.dist, `navody-digital-ie8-${version}.min.css`))
it('should not contain current media query displayed on body element', () => {
expect(stylesheet).not.toMatch(/body:before{content:/)
})
})
- describe(`govuk-frontend-${version}.min.js`, () => {
- const javascript = lib.readFileContents(path.join(configPaths.dist, `govuk-frontend-${version}.min.js`))
+ describe(`navody-digital-${version}.min.js`, () => {
+ const javascript = lib.readFileContents(path.join(configPaths.dist, `navody-digital-${version}.min.js`))
it('should have the correct version name', () => {
expect(javascript).toBeTruthy()
diff --git a/tasks/gulp/asset-version.js b/tasks/gulp/asset-version.js
index bf52fe0b78..bd99381c48 100644
--- a/tasks/gulp/asset-version.js
+++ b/tasks/gulp/asset-version.js
@@ -20,14 +20,14 @@ gulp.task('update-assets-version', () => {
let pkg = require('../../' + configPaths.package + 'package.json')
fs.writeFileSync(taskArguments.destination + '/VERSION.txt', pkg.version + '\r\n')
return gulp.src([
- taskArguments.destination + '/govuk-frontend.min.css',
- taskArguments.destination + '/govuk-frontend-ie8.min.css',
- taskArguments.destination + '/govuk-frontend.min.js'
+ taskArguments.destination + '/navody-digital.min.css',
+ taskArguments.destination + '/navody-digital-ie8.min.css',
+ taskArguments.destination + '/navody-digital.min.js'
])
.pipe(vinylPaths(del))
.pipe(gulpif(isDist,
rename(obj => {
- obj.basename = obj.basename.replace(/(govuk.*)(?=\.min)/g, '$1-' + pkg.version)
+ obj.basename = obj.basename.replace(/(navody.*)(?=\.min)/g, '$1-' + pkg.version)
return obj
})
))
diff --git a/tasks/gulp/compile-assets.js b/tasks/gulp/compile-assets.js
index 34f971e1ce..91ec116dc7 100644
--- a/tasks/gulp/compile-assets.js
+++ b/tasks/gulp/compile-assets.js
@@ -14,7 +14,6 @@ const uglify = require('gulp-uglify')
const eol = require('gulp-eol')
const rename = require('gulp-rename')
const cssnano = require('cssnano')
-const postcsspseudoclasses = require('postcss-pseudo-classes')
// Compile CSS and JS task --------------
// --------------------------------------
@@ -51,7 +50,7 @@ gulp.task('scss:compile', () => {
])))
.pipe(gulpif(isDist,
rename({
- basename: 'govuk-frontend',
+ basename: 'navody-digital',
extname: '.min.css'
})
))
@@ -85,7 +84,7 @@ gulp.task('scss:compile', () => {
])))
.pipe(gulpif(isDist,
rename({
- basename: 'govuk-frontend-ie8',
+ basename: 'navody-digital-ie8',
extname: '.min.css'
})
))
@@ -116,7 +115,7 @@ gulp.task('js:compile', () => {
})))
.pipe(gulpif(isDist,
rename({
- basename: 'govuk-frontend',
+ basename: 'navody-digital',
extname: '.min.js'
})
))