northants-design-system 0.1.133 → 0.1.134
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.d.ts +17 -16
- package/build/index.esm.js +136 -40
- package/build/index.esm.js.map +1 -1
- package/build/index.js +136 -39
- package/build/index.js.map +1 -1
- package/build/library/slices/Accordion/Accordion.d.ts +1 -1
- package/build/library/slices/Video/Video.d.ts +7 -0
- package/build/library/slices/Video/Video.types.d.ts +22 -0
- package/package.json +3 -2
package/build/index.d.ts
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import Autocomplete from
|
|
2
|
-
import Button from
|
|
3
|
-
import Heading from
|
|
4
|
-
import HeadingWithIcon from
|
|
5
|
-
import Pagination from
|
|
1
|
+
import Autocomplete from './library/components/Autocomplete/Autocomplete';
|
|
2
|
+
import Button from './library/components/Button/Button';
|
|
3
|
+
import Heading from './library/components/Heading/Heading';
|
|
4
|
+
import HeadingWithIcon from './library/components/HeadingWithIcon/HeadingWithIcon';
|
|
5
|
+
import Pagination from './library/components/Pagination/Pagination';
|
|
6
6
|
import CheckboxListFilter from './library/components/CheckboxListFilter/CheckboxListFilter';
|
|
7
7
|
import DropDownFilter from './library/components/DropDownFilter/DropDownFilter';
|
|
8
8
|
import PromotedLinks from './library/components/PromotedLinks/PromotedLinks';
|
|
9
9
|
import TextInput from './library/components/TextInput/TextInput';
|
|
10
|
-
export { Autocomplete, Button, Heading, HeadingWithIcon, Pagination, CheckboxListFilter, DropDownFilter, PromotedLinks, TextInput };
|
|
11
|
-
import Accordion from
|
|
12
|
-
import BlockQuote from
|
|
13
|
-
import CallToAction from
|
|
14
|
-
import DownloadableFiles from
|
|
15
|
-
import Divider from
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
10
|
+
export { Autocomplete, Button, Heading, HeadingWithIcon, Pagination, CheckboxListFilter, DropDownFilter, PromotedLinks, TextInput, };
|
|
11
|
+
import Accordion from './library/slices/Accordion/Accordion';
|
|
12
|
+
import BlockQuote from './library/slices/BlockQuote/BlockQuote';
|
|
13
|
+
import CallToAction from './library/slices/CallToAction/CallToAction';
|
|
14
|
+
import DownloadableFiles from './library/slices/DownloadableFiles/DownloadableFiles';
|
|
15
|
+
import Divider from './library/slices/Divider/Divider';
|
|
16
|
+
import Video from './library/slices/Video/Video';
|
|
17
|
+
import WarningText from './library/slices/WarningText/WarningText';
|
|
18
|
+
import WarningTextDisclaimer from './library/slices/WarningTextDisclaimer/WarningTextDisclaimer';
|
|
19
|
+
export { Accordion, BlockQuote, CallToAction, Divider, DownloadableFiles, Video, WarningText, WarningTextDisclaimer };
|
|
20
|
+
export { AccessibleLinks, AlertBanner, AlertBannerService, Breadcrumbs, CookieBanner, Footer, Header, HomeHero, MemorialHero, HomeUnitarySection, DisplayDate, NewsArticleDate, NewsArticleImage, NewsArticleFilterAccordion, NewsArticleList, NewsArticleListHeader, NewsArticleOldBanner, NewsArticleFeaturedBlock, SkipToMainContent, PhaseBanner, PageMain, PageTitle, PageSidebar, PageWithSidebarContainer, PageWrapper, PromoBanner, PromoBlock, Searchbar, SearchResultsList, SectionLinks, SectionLinksSidebar, SectionLinksMobileContents, ServicesLinksList, SignpostLinks, MaxWidthContainer, } from './library/structure/PageStructures';
|
|
21
|
+
export { GDS_theme, north_theme, west_theme, lb_theme_north, lb_theme_west } from './themes/theme_generator';
|
package/build/index.esm.js
CHANGED
|
@@ -6206,7 +6206,7 @@ var Accordion = function (_a) {
|
|
|
6206
6206
|
var _f = useState(sections), accordionStates = _f[0], setAccordionStates = _f[1];
|
|
6207
6207
|
useEffect(function () {
|
|
6208
6208
|
var anyOpen = accordionStates.find(function (accordionState) { return accordionState.isExpanded === true; });
|
|
6209
|
-
|
|
6209
|
+
anyOpen ? setOpenAll(false) : setOpenAll(true);
|
|
6210
6210
|
setShowControls(true);
|
|
6211
6211
|
});
|
|
6212
6212
|
var updateAccordionState = function (accordionSectionId, value) {
|
|
@@ -6219,7 +6219,7 @@ var Accordion = function (_a) {
|
|
|
6219
6219
|
});
|
|
6220
6220
|
setAccordionStates(newStatus);
|
|
6221
6221
|
// update the text that shows open all / close all
|
|
6222
|
-
|
|
6222
|
+
value ? setOpenAll(false) : setOpenAll(true);
|
|
6223
6223
|
};
|
|
6224
6224
|
var toggleAll = function () {
|
|
6225
6225
|
setOpenAll(!openAll);
|
|
@@ -6231,13 +6231,11 @@ var Accordion = function (_a) {
|
|
|
6231
6231
|
};
|
|
6232
6232
|
var accordionId = "accordion" + uniqueID();
|
|
6233
6233
|
return (React.createElement(Container$3, { "data-testid": "Accordion", id: accordionId },
|
|
6234
|
-
showControls && sections.length > 1 && React.createElement(AccordionControls, null,
|
|
6234
|
+
showControls && sections.length > 1 && (React.createElement(AccordionControls, null,
|
|
6235
6235
|
React.createElement(OpenAllButton, { onClick: toggleAll, type: "button", "aria-expanded": !openAll },
|
|
6236
6236
|
openAll ? "Open all" : "Close all",
|
|
6237
|
-
React.createElement(VisuallyHidden$2, null, " sections"))),
|
|
6238
|
-
accordionStates.map(function (section, i) {
|
|
6239
|
-
return React.createElement(AccordionSection, __assign({}, section, { key: i, onToggle: updateAccordionState, isFilter: isFilter, withReadMore: withReadMore }));
|
|
6240
|
-
})));
|
|
6237
|
+
React.createElement(VisuallyHidden$2, null, " sections")))),
|
|
6238
|
+
accordionStates.map(function (section, i) { return (React.createElement(AccordionSection, __assign({}, section, { key: i, onToggle: updateAccordionState, isFilter: isFilter, withReadMore: withReadMore }))); })));
|
|
6241
6239
|
};
|
|
6242
6240
|
|
|
6243
6241
|
const Blockquote = styled.blockquote `
|
|
@@ -6436,6 +6434,96 @@ const Divider = styled.hr`
|
|
|
6436
6434
|
// @TODO this needs to fit within the content border
|
|
6437
6435
|
var Divider$1 = function () { return (React.createElement(Divider, { "data-testid": "Divider" })); };
|
|
6438
6436
|
|
|
6437
|
+
var VideoProvider;
|
|
6438
|
+
(function (VideoProvider) {
|
|
6439
|
+
VideoProvider["YouTube"] = "YouTube";
|
|
6440
|
+
VideoProvider["Vimeo"] = "Vimeo";
|
|
6441
|
+
})(VideoProvider || (VideoProvider = {}));
|
|
6442
|
+
|
|
6443
|
+
const VideoContainer = styled.figure`
|
|
6444
|
+
display: block;
|
|
6445
|
+
padding-top: 56.25%;
|
|
6446
|
+
position: relative;
|
|
6447
|
+
margin-bottom: 15px;
|
|
6448
|
+
|
|
6449
|
+
iframe {
|
|
6450
|
+
position: absolute;
|
|
6451
|
+
top: 0;
|
|
6452
|
+
right: 0;
|
|
6453
|
+
bottom: 0;
|
|
6454
|
+
left: 0;
|
|
6455
|
+
width: 100%;
|
|
6456
|
+
height: 100%;
|
|
6457
|
+
border-style: none;
|
|
6458
|
+
}
|
|
6459
|
+
`;
|
|
6460
|
+
|
|
6461
|
+
const VideoLink = styled.a`
|
|
6462
|
+
${(props) => props.theme.fontStyles};
|
|
6463
|
+
${(props) => props.theme.linkStyles};
|
|
6464
|
+
margin-bottom: 15px;
|
|
6465
|
+
display: block;
|
|
6466
|
+
|
|
6467
|
+
&:hover {
|
|
6468
|
+
${(props) => props.theme.linkStylesHover};
|
|
6469
|
+
}
|
|
6470
|
+
|
|
6471
|
+
&:focus {
|
|
6472
|
+
${(props) => props.theme.linkStylesFocus};
|
|
6473
|
+
}
|
|
6474
|
+
|
|
6475
|
+
&:active {
|
|
6476
|
+
${(props) => props.theme.linkStylesActive};
|
|
6477
|
+
}
|
|
6478
|
+
`;
|
|
6479
|
+
|
|
6480
|
+
const cookieName = "fn-cookie";
|
|
6481
|
+
|
|
6482
|
+
|
|
6483
|
+
const getCookie = (name) => {
|
|
6484
|
+
let dc = document.cookie;
|
|
6485
|
+
let prefix = name + "=";
|
|
6486
|
+
|
|
6487
|
+
let begin = dc.indexOf(prefix);
|
|
6488
|
+
if (begin == -1) return null;
|
|
6489
|
+
var end = dc.indexOf(";", begin);
|
|
6490
|
+
if (end == -1) end = dc.length;
|
|
6491
|
+
|
|
6492
|
+
return decodeURI(dc.substring(begin + prefix.length, end));
|
|
6493
|
+
};
|
|
6494
|
+
|
|
6495
|
+
/**
|
|
6496
|
+
* A responsive video embed for YouTube or Vimeo
|
|
6497
|
+
*/
|
|
6498
|
+
var Video = function (_a) {
|
|
6499
|
+
var video_id = _a.video_id, provider = _a.provider, description = _a.description, allowCookies = _a.allowCookies, props = __rest(_a, ["video_id", "provider", "description", "allowCookies"]);
|
|
6500
|
+
var cookiesAccepted = allowCookies;
|
|
6501
|
+
var watchLink;
|
|
6502
|
+
var embedLink;
|
|
6503
|
+
var checkCookie = function () {
|
|
6504
|
+
var myCookie = getCookie(cookieName);
|
|
6505
|
+
if (myCookie !== null && allowCookies == null) {
|
|
6506
|
+
cookiesAccepted = myCookie.includes('"cookiesAccepted":true');
|
|
6507
|
+
}
|
|
6508
|
+
};
|
|
6509
|
+
var defineLinks = function () {
|
|
6510
|
+
if (provider == VideoProvider.YouTube) {
|
|
6511
|
+
watchLink = "https://www.youtube.com/watch?v=" + video_id;
|
|
6512
|
+
embedLink = "https://www.youtube.com/embed/" + video_id + "?rel=0";
|
|
6513
|
+
}
|
|
6514
|
+
if (provider == VideoProvider.Vimeo) {
|
|
6515
|
+
watchLink = "https://vimeo.com/" + video_id;
|
|
6516
|
+
embedLink = "https://player.vimeo.com/video/" + video_id;
|
|
6517
|
+
}
|
|
6518
|
+
};
|
|
6519
|
+
checkCookie();
|
|
6520
|
+
defineLinks();
|
|
6521
|
+
return (React.createElement(React.Fragment, null,
|
|
6522
|
+
cookiesAccepted && (React.createElement(VideoContainer, { "data-testid": "Video" },
|
|
6523
|
+
React.createElement("iframe", { src: embedLink, title: description, allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen;", "data-testid": "VideoIframe" }))),
|
|
6524
|
+
!cookiesAccepted && (React.createElement(VideoLink, { href: watchLink, title: description, "data-testid": "VideoLink" }, description))));
|
|
6525
|
+
};
|
|
6526
|
+
|
|
6439
6527
|
const WarningText = styled.div`
|
|
6440
6528
|
max-width: 750px;
|
|
6441
6529
|
margin: 20px 0px;
|
|
@@ -7071,21 +7159,6 @@ var FormButton = function (_a) {
|
|
|
7071
7159
|
return (React.createElement(StyledButton$1, __assign({ className: ["button--" + size, mode].join(' ') }, props), text));
|
|
7072
7160
|
};
|
|
7073
7161
|
|
|
7074
|
-
const cookieName = "fn-cookie";
|
|
7075
|
-
|
|
7076
|
-
|
|
7077
|
-
const getCookie = (name) => {
|
|
7078
|
-
let dc = document.cookie;
|
|
7079
|
-
let prefix = name + "=";
|
|
7080
|
-
|
|
7081
|
-
let begin = dc.indexOf(prefix);
|
|
7082
|
-
if (begin == -1) return null;
|
|
7083
|
-
var end = dc.indexOf(";", begin);
|
|
7084
|
-
if (end == -1) end = dc.length;
|
|
7085
|
-
|
|
7086
|
-
return decodeURI(dc.substring(begin + prefix.length, end));
|
|
7087
|
-
};
|
|
7088
|
-
|
|
7089
7162
|
var dayjs_min = createCommonjsModule(function (module, exports) {
|
|
7090
7163
|
!function(t,e){module.exports=e();}(commonjsGlobal,function(){var t="millisecond",e="second",n="minute",r="hour",i="day",s="week",u="month",a="quarter",o="year",f="date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,c=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,d={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},$=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},l={s:$,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+$(r,2,"0")+":"+$(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,u),s=n-i<0,a=e.clone().add(r+(s?-1:1),u);return +(-(r+(n-i)/(s?i-a:a-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return {M:u,y:o,w:s,d:i,D:f,h:r,m:n,s:e,ms:t,Q:a}[h]||String(h||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},y="en",M={};M[y]=d;var m=function(t){return t instanceof S},D=function(t,e,n){var r;if(!t)return y;if("string"==typeof t)M[t]&&(r=t),e&&(M[t]=e,r=t);else {var i=t.name;M[i]=t,r=i;}return !n&&r&&(y=r),r||!n&&y},v=function(t,e){if(m(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new S(n)},g=l;g.l=D,g.i=m,g.w=function(t,e){return v(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var S=function(){function d(t){this.$L=D(t.locale,null,!0),this.parse(t);}var $=d.prototype;return $.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(g.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(h);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init();},$.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},$.$utils=function(){return g},$.isValid=function(){return !("Invalid Date"===this.$d.toString())},$.isSame=function(t,e){var n=v(t);return this.startOf(e)<=n&&n<=this.endOf(e)},$.isAfter=function(t,e){return v(t)<this.startOf(e)},$.isBefore=function(t,e){return this.endOf(e)<v(t)},$.$g=function(t,e,n){return g.u(t)?this[e]:this.set(n,t)},$.unix=function(){return Math.floor(this.valueOf()/1e3)},$.valueOf=function(){return this.$d.getTime()},$.startOf=function(t,a){var h=this,c=!!g.u(a)||a,d=g.p(t),$=function(t,e){var n=g.w(h.$u?Date.UTC(h.$y,e,t):new Date(h.$y,e,t),h);return c?n:n.endOf(i)},l=function(t,e){return g.w(h.toDate()[t].apply(h.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(e)),h)},y=this.$W,M=this.$M,m=this.$D,D="set"+(this.$u?"UTC":"");switch(d){case o:return c?$(1,0):$(31,11);case u:return c?$(1,M):$(0,M+1);case s:var v=this.$locale().weekStart||0,S=(y<v?y+7:y)-v;return $(c?m-S:m+(6-S),M);case i:case f:return l(D+"Hours",0);case r:return l(D+"Minutes",1);case n:return l(D+"Seconds",2);case e:return l(D+"Milliseconds",3);default:return this.clone()}},$.endOf=function(t){return this.startOf(t,!1)},$.$set=function(s,a){var h,c=g.p(s),d="set"+(this.$u?"UTC":""),$=(h={},h[i]=d+"Date",h[f]=d+"Date",h[u]=d+"Month",h[o]=d+"FullYear",h[r]=d+"Hours",h[n]=d+"Minutes",h[e]=d+"Seconds",h[t]=d+"Milliseconds",h)[c],l=c===i?this.$D+(a-this.$W):a;if(c===u||c===o){var y=this.clone().set(f,1);y.$d[$](l),y.init(),this.$d=y.set(f,Math.min(this.$D,y.daysInMonth())).$d;}else $&&this.$d[$](l);return this.init(),this},$.set=function(t,e){return this.clone().$set(t,e)},$.get=function(t){return this[g.p(t)]()},$.add=function(t,a){var f,h=this;t=Number(t);var c=g.p(a),d=function(e){var n=v(h);return g.w(n.date(n.date()+Math.round(e*t)),h)};if(c===u)return this.set(u,this.$M+t);if(c===o)return this.set(o,this.$y+t);if(c===i)return d(1);if(c===s)return d(7);var $=(f={},f[n]=6e4,f[r]=36e5,f[e]=1e3,f)[c]||1,l=this.$d.getTime()+t*$;return g.w(l,this)},$.subtract=function(t,e){return this.add(-1*t,e)},$.format=function(t){var e=this;if(!this.isValid())return "Invalid Date";var n=t||"YYYY-MM-DDTHH:mm:ssZ",r=g.z(this),i=this.$locale(),s=this.$H,u=this.$m,a=this.$M,o=i.weekdays,f=i.months,h=function(t,r,i,s){return t&&(t[r]||t(e,n))||i[r].substr(0,s)},d=function(t){return g.s(s%12||12,t,"0")},$=i.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:g.s(a+1,2,"0"),MMM:h(i.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:g.s(this.$D,2,"0"),d:String(this.$W),dd:h(i.weekdaysMin,this.$W,o,2),ddd:h(i.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:g.s(s,2,"0"),h:d(1),hh:d(2),a:$(s,u,!0),A:$(s,u,!1),m:String(u),mm:g.s(u,2,"0"),s:String(this.$s),ss:g.s(this.$s,2,"0"),SSS:g.s(this.$ms,3,"0"),Z:r};return n.replace(c,function(t,e){return e||l[t]||r.replace(":","")})},$.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},$.diff=function(t,f,h){var c,d=g.p(f),$=v(t),l=6e4*($.utcOffset()-this.utcOffset()),y=this-$,M=g.m(this,$);return M=(c={},c[o]=M/12,c[u]=M,c[a]=M/3,c[s]=(y-l)/6048e5,c[i]=(y-l)/864e5,c[r]=y/36e5,c[n]=y/6e4,c[e]=y/1e3,c)[d]||y,h?M:g.a(M)},$.daysInMonth=function(){return this.endOf(u).$D},$.$locale=function(){return M[this.$L]},$.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=D(t,e,!0);return r&&(n.$L=r),n},$.clone=function(){return g.w(this.$d,this)},$.toDate=function(){return new Date(this.valueOf())},$.toJSON=function(){return this.isValid()?this.toISOString():null},$.toISOString=function(){return this.$d.toISOString()},$.toString=function(){return this.$d.toUTCString()},d}(),p=S.prototype;return v.prototype=p,[["$ms",t],["$s",e],["$m",n],["$H",r],["$W",i],["$M",u],["$y",o],["$D",f]].forEach(function(t){p[t[1]]=function(e){return this.$g(e,t[0],t[1])};}),v.extend=function(t,e){return t.$i||(t(e,S,v),t.$i=!0),v},v.locale=D,v.isDayjs=m,v.unix=function(t){return v(1e3*t)},v.en=M[y],v.Ls=M,v.p={},v});
|
|
7091
7164
|
});
|
|
@@ -7675,6 +7748,7 @@ var Searchbar = function (_a) {
|
|
|
7675
7748
|
var initialSearchTerm = searchTerm;
|
|
7676
7749
|
var _h = useState(initialSearchTerm), inputSearchTerm = _h[0], setInputSearchTerm = _h[1];
|
|
7677
7750
|
var _j = useState(false), submit = _j[0], setSubmit = _j[1];
|
|
7751
|
+
var _k = useState(false), isErrored = _k[0], setIsErrored = _k[1];
|
|
7678
7752
|
/**
|
|
7679
7753
|
* An autocomplete suggestion item was selected, so kick off submission
|
|
7680
7754
|
* @param selectedValue string - suggestion text chosen
|
|
@@ -7695,11 +7769,15 @@ var Searchbar = function (_a) {
|
|
|
7695
7769
|
* has been set to true and if so, we submit the search.
|
|
7696
7770
|
*/
|
|
7697
7771
|
useEffect(function () {
|
|
7772
|
+
if (isErrored) {
|
|
7773
|
+
setIsErrored(false);
|
|
7774
|
+
}
|
|
7698
7775
|
if (!submit)
|
|
7699
7776
|
return;
|
|
7700
7777
|
setSubmit(false);
|
|
7701
7778
|
var submitParams = submitInfo.params;
|
|
7702
|
-
if (initialSearchTerm !== inputSearchTerm ||
|
|
7779
|
+
if (initialSearchTerm !== inputSearchTerm ||
|
|
7780
|
+
!(NewsArticleFilterFields.search.queryParamKey in submitParams)) {
|
|
7703
7781
|
submitParams = __assign(__assign({}, submitParams), { searchTerm: inputSearchTerm });
|
|
7704
7782
|
var keyValueFormat = Object.keys(submitParams).map(function (key) {
|
|
7705
7783
|
return { key: key, value: submitParams[key] };
|
|
@@ -7715,6 +7793,12 @@ var Searchbar = function (_a) {
|
|
|
7715
7793
|
var handleSubmit = function (event) {
|
|
7716
7794
|
if (event)
|
|
7717
7795
|
event.preventDefault();
|
|
7796
|
+
if (inputSearchTerm == "") {
|
|
7797
|
+
if (!isErrored) {
|
|
7798
|
+
setIsErrored(true);
|
|
7799
|
+
}
|
|
7800
|
+
return;
|
|
7801
|
+
}
|
|
7718
7802
|
setSubmit(true);
|
|
7719
7803
|
};
|
|
7720
7804
|
/**
|
|
@@ -7724,8 +7808,8 @@ var Searchbar = function (_a) {
|
|
|
7724
7808
|
React.createElement("form", { onSubmit: handleSubmit },
|
|
7725
7809
|
React.createElement("div", { role: "search" },
|
|
7726
7810
|
React.createElement(InputWrapper, null,
|
|
7727
|
-
React.createElement(Autocomplete, { id: id, name: NewsArticleFilterFields.search.queryParamKey, placeholder: placeholder, onSelect: handleSelect, onChange: handleChange, value: inputSearchTerm, suggestions: suggestions, minimumMatchLength: minimumMatchLength, maximumMatchesShown: maximumMatchesShown, isLarge: isLarge, hasAdjacentButton: true }),
|
|
7728
|
-
React.createElement(Button$1, { type: "submit", value: "Search", isLarge: isLarge, isLight: isLight },
|
|
7811
|
+
React.createElement(Autocomplete, { id: id, name: NewsArticleFilterFields.search.queryParamKey, placeholder: placeholder, onSelect: handleSelect, onChange: handleChange, value: inputSearchTerm, suggestions: suggestions, minimumMatchLength: minimumMatchLength, maximumMatchesShown: maximumMatchesShown, isLarge: isLarge, hasAdjacentButton: true, isErrored: isErrored }),
|
|
7812
|
+
React.createElement(Button$1, { type: "submit", value: "Search", isLarge: isLarge, isLight: isLight, "data-testid": "SearchButton" },
|
|
7729
7813
|
React.createElement(IconDownload$2, { colourFill: "#fff" }),
|
|
7730
7814
|
React.createElement(ButtonText, null, "Search")))))));
|
|
7731
7815
|
};
|
|
@@ -11394,28 +11478,40 @@ var followRedirects = wrap({ http: http, https: https });
|
|
|
11394
11478
|
var wrap_1 = wrap;
|
|
11395
11479
|
followRedirects.wrap = wrap_1;
|
|
11396
11480
|
|
|
11397
|
-
const
|
|
11481
|
+
const _args=[["axios@0.21.1","/Users/chrisrhymes/code/design-system"]];const _from="axios@0.21.1";const _id="axios@0.21.1";const _inBundle=false;const _integrity="sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==";const _location="/axios";const _phantomChildren={};const _requested={type:"version",registry:true,raw:"axios@0.21.1",name:"axios",escapedName:"axios",rawSpec:"0.21.1",saveSpec:null,fetchSpec:"0.21.1"};const _requiredBy=["/"];const _resolved="https://registry.npmjs.org/axios/-/axios-0.21.1.tgz";const _spec="0.21.1";const _where="/Users/chrisrhymes/code/design-system";const author={name:"Matt Zabriskie"};const browser$1={"./lib/adapters/http.js":"./lib/adapters/xhr.js"};const bugs={url:"https://github.com/axios/axios/issues"};const bundlesize=[{path:"./dist/axios.min.js",threshold:"5kB"}];const dependencies={"follow-redirects":"^1.10.0"};const description="Promise based HTTP client for the browser and node.js";const devDependencies={bundlesize:"^0.17.0",coveralls:"^3.0.0","es6-promise":"^4.2.4",grunt:"^1.0.2","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^20.1.0","grunt-karma":"^2.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^1.0.18","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1",karma:"^1.3.0","karma-chrome-launcher":"^2.2.0","karma-coverage":"^1.1.1","karma-firefox-launcher":"^1.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-opera-launcher":"^1.0.0","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^1.2.0","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.7","karma-webpack":"^1.7.0","load-grunt-tasks":"^3.5.2",minimist:"^1.2.0",mocha:"^5.2.0",sinon:"^4.5.0",typescript:"^2.8.1","url-search-params":"^0.10.0",webpack:"^1.13.1","webpack-dev-server":"^1.14.1"};const homepage="https://github.com/axios/axios";const jsdelivr="dist/axios.min.js";const keywords=["xhr","http","ajax","promise","node"];const license="MIT";const main="index.js";const name="axios";const repository={type:"git",url:"git+https://github.com/axios/axios.git"};const scripts={build:"NODE_ENV=production grunt build",coveralls:"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",examples:"node ./examples/server.js",fix:"eslint --fix lib/**/*.js",postversion:"git push && git push --tags",preversion:"npm test",start:"node ./sandbox/server.js",test:"grunt test && bundlesize",version:"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json"};const typings="./index.d.ts";const unpkg="dist/axios.min.js";const version="0.21.1";var _package = {_args:_args,_from:_from,_id:_id,_inBundle:_inBundle,_integrity:_integrity,_location:_location,_phantomChildren:_phantomChildren,_requested:_requested,_requiredBy:_requiredBy,_resolved:_resolved,_spec:_spec,_where:_where,author:author,browser:browser$1,bugs:bugs,bundlesize:bundlesize,dependencies:dependencies,description:description,devDependencies:devDependencies,homepage:homepage,jsdelivr:jsdelivr,keywords:keywords,license:license,main:main,name:name,repository:repository,scripts:scripts,typings:typings,unpkg:unpkg,version:version};
|
|
11398
11482
|
|
|
11399
11483
|
var _package$1 = /*#__PURE__*/Object.freeze({
|
|
11400
11484
|
__proto__: null,
|
|
11401
|
-
|
|
11402
|
-
|
|
11403
|
-
|
|
11404
|
-
|
|
11405
|
-
|
|
11406
|
-
|
|
11407
|
-
|
|
11485
|
+
_args: _args,
|
|
11486
|
+
_from: _from,
|
|
11487
|
+
_id: _id,
|
|
11488
|
+
_inBundle: _inBundle,
|
|
11489
|
+
_integrity: _integrity,
|
|
11490
|
+
_location: _location,
|
|
11491
|
+
_phantomChildren: _phantomChildren,
|
|
11492
|
+
_requested: _requested,
|
|
11493
|
+
_requiredBy: _requiredBy,
|
|
11494
|
+
_resolved: _resolved,
|
|
11495
|
+
_spec: _spec,
|
|
11496
|
+
_where: _where,
|
|
11408
11497
|
author: author,
|
|
11409
|
-
|
|
11498
|
+
browser: browser$1,
|
|
11410
11499
|
bugs: bugs,
|
|
11411
|
-
|
|
11500
|
+
bundlesize: bundlesize,
|
|
11501
|
+
dependencies: dependencies,
|
|
11502
|
+
description: description,
|
|
11412
11503
|
devDependencies: devDependencies,
|
|
11413
|
-
|
|
11504
|
+
homepage: homepage,
|
|
11414
11505
|
jsdelivr: jsdelivr,
|
|
11415
|
-
|
|
11506
|
+
keywords: keywords,
|
|
11507
|
+
license: license,
|
|
11508
|
+
main: main,
|
|
11509
|
+
name: name,
|
|
11510
|
+
repository: repository,
|
|
11511
|
+
scripts: scripts,
|
|
11416
11512
|
typings: typings,
|
|
11417
|
-
|
|
11418
|
-
|
|
11513
|
+
unpkg: unpkg,
|
|
11514
|
+
version: version,
|
|
11419
11515
|
'default': _package
|
|
11420
11516
|
});
|
|
11421
11517
|
|
|
@@ -31143,5 +31239,5 @@ const north_theme = generate_theme(north_vars);
|
|
|
31143
31239
|
const lb_theme_north = generate_theme(lb_vars_north);
|
|
31144
31240
|
const lb_theme_west = generate_theme(lb_vars_west);
|
|
31145
31241
|
|
|
31146
|
-
export { AccessibleLink as AccessibleLinks, Accordion, AlertBanner, AlertBannerService, Autocomplete, BlockQuote, Breadcrumbs, Button, CallToAction, CheckboxListFilter, CookieBanner, DisplayDate$1 as DisplayDate, Divider$1 as Divider, DownloadableFiles, DropDownFilter, Footer, GDS_theme, Header, Heading, HeadingWithIcon, HomeHero, HomeUnitarySection, MaxWidthContainer, MemorialHero, NewsArticleDate$1 as NewsArticleDate, NewsArticleFeaturedBlock, NewsArticleFilterAccordion, NewsArticleImage, NewsArticleList, NewsArticleListHeader, NewsArticleOldBanner$1 as NewsArticleOldBanner, PageMain, PageSidebar, PageTitle, PageWithSidebarContainer, PageWrapper, Pagination, PhaseBanner, PromoBanner, PromoBlock, PromotedLinks$1 as PromotedLinks, SearchResultsList, Searchbar, SectionLinks, SectionLinksMobileContents, SectionLinksSidebar, ServicesLinksList, SignpostLinks, SkipToMainContent$1 as SkipToMainContent, TextInput, WarningText$1 as WarningText, WarningTextDisclaimer, lb_theme_north, lb_theme_west, north_theme, west_theme };
|
|
31242
|
+
export { AccessibleLink as AccessibleLinks, Accordion, AlertBanner, AlertBannerService, Autocomplete, BlockQuote, Breadcrumbs, Button, CallToAction, CheckboxListFilter, CookieBanner, DisplayDate$1 as DisplayDate, Divider$1 as Divider, DownloadableFiles, DropDownFilter, Footer, GDS_theme, Header, Heading, HeadingWithIcon, HomeHero, HomeUnitarySection, MaxWidthContainer, MemorialHero, NewsArticleDate$1 as NewsArticleDate, NewsArticleFeaturedBlock, NewsArticleFilterAccordion, NewsArticleImage, NewsArticleList, NewsArticleListHeader, NewsArticleOldBanner$1 as NewsArticleOldBanner, PageMain, PageSidebar, PageTitle, PageWithSidebarContainer, PageWrapper, Pagination, PhaseBanner, PromoBanner, PromoBlock, PromotedLinks$1 as PromotedLinks, SearchResultsList, Searchbar, SectionLinks, SectionLinksMobileContents, SectionLinksSidebar, ServicesLinksList, SignpostLinks, SkipToMainContent$1 as SkipToMainContent, TextInput, Video, WarningText$1 as WarningText, WarningTextDisclaimer, lb_theme_north, lb_theme_west, north_theme, west_theme };
|
|
31147
31243
|
//# sourceMappingURL=index.esm.js.map
|