northants-design-system 0.3.0 → 0.3.3
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.esm.js +108 -110
- package/build/index.esm.js.map +1 -1
- package/build/index.js +108 -110
- package/build/index.js.map +1 -1
- package/build/library/components/CheckboxListFilter/CheckboxListFilter.d.ts +3 -3
- package/build/library/components/CheckboxListFilter/CheckboxListFilter.types.d.ts +11 -7
- package/package.json +1 -1
package/build/index.esm.js
CHANGED
|
@@ -6466,131 +6466,128 @@ var Pagination = function (_a) {
|
|
|
6466
6466
|
};
|
|
6467
6467
|
|
|
6468
6468
|
const Container$T = styled.div`
|
|
6469
|
-
${props => props.theme.fontStyles};
|
|
6469
|
+
${(props) => props.theme.fontStyles};
|
|
6470
6470
|
margin-bottom: 30px;
|
|
6471
6471
|
`;
|
|
6472
6472
|
|
|
6473
6473
|
const Fieldset = styled.fieldset`
|
|
6474
|
-
|
|
6475
|
-
|
|
6476
|
-
|
|
6477
|
-
|
|
6474
|
+
min-width: 0;
|
|
6475
|
+
margin: 0;
|
|
6476
|
+
padding: 0;
|
|
6477
|
+
border: 0;
|
|
6478
6478
|
|
|
6479
|
-
|
|
6480
|
-
|
|
6481
|
-
|
|
6482
|
-
|
|
6483
|
-
|
|
6479
|
+
&:after {
|
|
6480
|
+
content: '';
|
|
6481
|
+
display: block;
|
|
6482
|
+
clear: both;
|
|
6483
|
+
}
|
|
6484
6484
|
`;
|
|
6485
6485
|
|
|
6486
|
-
const hideLabel$1 = props => {
|
|
6487
|
-
if(props.labelHidden
|
|
6486
|
+
const hideLabel$1 = (props) => {
|
|
6487
|
+
if (props.labelHidden) {
|
|
6488
6488
|
return VisuallyHidden$2;
|
|
6489
6489
|
}
|
|
6490
6490
|
};
|
|
6491
6491
|
|
|
6492
|
-
|
|
6493
6492
|
const Legend = styled.legend`
|
|
6494
|
-
|
|
6495
|
-
|
|
6496
|
-
|
|
6497
|
-
|
|
6498
|
-
|
|
6499
|
-
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6493
|
+
color: #0b0c0c;
|
|
6494
|
+
-webkit-box-sizing: border-box;
|
|
6495
|
+
box-sizing: border-box;
|
|
6496
|
+
display: table;
|
|
6497
|
+
max-width: 100%;
|
|
6498
|
+
margin-bottom: 10px;
|
|
6499
|
+
padding: 0;
|
|
6500
|
+
white-space: normal;
|
|
6501
|
+
${hideLabel$1}
|
|
6503
6502
|
`;
|
|
6504
6503
|
|
|
6505
|
-
const hideHint = props => {
|
|
6506
|
-
if(props.hintHidden
|
|
6504
|
+
const hideHint = (props) => {
|
|
6505
|
+
if (props.hintHidden) {
|
|
6507
6506
|
return VisuallyHidden$2;
|
|
6508
6507
|
}
|
|
6509
6508
|
};
|
|
6510
6509
|
|
|
6511
|
-
|
|
6512
6510
|
const Hint = styled.div`
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
|
|
6511
|
+
font-size: ${(props) => props.theme.theme_vars.fontSizes.small};
|
|
6512
|
+
display: block;
|
|
6513
|
+
margin-bottom: 15px;
|
|
6514
|
+
color: #505a5f;
|
|
6515
|
+
margin-top: -5px;
|
|
6516
|
+
${hideHint}
|
|
6519
6517
|
`;
|
|
6520
6518
|
|
|
6521
6519
|
const Checkboxes = styled.div`
|
|
6522
|
-
display: block;
|
|
6523
|
-
|
|
6524
|
-
|
|
6525
|
-
|
|
6520
|
+
display: block;
|
|
6521
|
+
`;
|
|
6526
6522
|
|
|
6527
6523
|
const Checkbox = styled.div`
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
`;
|
|
6524
|
+
font-size: ${(props) => props.theme.theme_vars.fontSizes.small};
|
|
6525
|
+
display: block;
|
|
6526
|
+
position: relative;
|
|
6527
|
+
min-height: 40px;
|
|
6528
|
+
margin-bottom: 10px;
|
|
6529
|
+
padding-left: 40px;
|
|
6530
|
+
clear: left;
|
|
6531
|
+
`;
|
|
6537
6532
|
|
|
6538
6533
|
const CheckboxInput = styled.input`
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
|
|
6534
|
+
cursor: pointer;
|
|
6535
|
+
position: absolute;
|
|
6536
|
+
z-index: 1;
|
|
6537
|
+
top: -2px;
|
|
6538
|
+
left: -2px;
|
|
6539
|
+
width: 44px;
|
|
6540
|
+
height: 44px;
|
|
6541
|
+
margin: 0;
|
|
6542
|
+
opacity: 0;
|
|
6543
|
+
|
|
6544
|
+
&:focus + label:before {
|
|
6545
|
+
box-shadow: 0 0 0 3px ${(props) => props.theme.theme_vars.colours.focus};
|
|
6546
|
+
}
|
|
6548
6547
|
`;
|
|
6549
6548
|
|
|
6550
6549
|
const CheckboxLabel = styled.label`
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
&:before {
|
|
6563
|
-
content: "";
|
|
6564
|
-
-webkit-box-sizing: border-box;
|
|
6565
|
-
box-sizing: border-box;
|
|
6566
|
-
position: absolute;
|
|
6567
|
-
top: 0;
|
|
6568
|
-
left: 0;
|
|
6569
|
-
width: 40px;
|
|
6570
|
-
height: 40px;
|
|
6571
|
-
border: 2px solid currentColor;
|
|
6572
|
-
background: transparent;
|
|
6573
|
-
}
|
|
6550
|
+
display: inline-block;
|
|
6551
|
+
margin-bottom: 0;
|
|
6552
|
+
padding: 8px 15px 5px;
|
|
6553
|
+
cursor: pointer;
|
|
6554
|
+
-ms-touch-action: manipulation;
|
|
6555
|
+
touch-action: manipulation;
|
|
6556
|
+
color: #0b0c0c;
|
|
6557
|
+
display: block;
|
|
6558
|
+
margin-bottom: 5px;
|
|
6574
6559
|
|
|
6560
|
+
&:before {
|
|
6561
|
+
content: '';
|
|
6562
|
+
-webkit-box-sizing: border-box;
|
|
6563
|
+
box-sizing: border-box;
|
|
6564
|
+
position: absolute;
|
|
6565
|
+
top: 0;
|
|
6566
|
+
left: 0;
|
|
6567
|
+
width: 40px;
|
|
6568
|
+
height: 40px;
|
|
6569
|
+
border: 2px solid currentColor;
|
|
6570
|
+
background: transparent;
|
|
6571
|
+
}
|
|
6575
6572
|
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6573
|
+
&:after {
|
|
6574
|
+
content: '';
|
|
6575
|
+
-webkit-box-sizing: border-box;
|
|
6576
|
+
box-sizing: border-box;
|
|
6577
|
+
position: absolute;
|
|
6578
|
+
top: 11px;
|
|
6579
|
+
left: 9px;
|
|
6580
|
+
width: 23px;
|
|
6581
|
+
height: 12px;
|
|
6582
|
+
-webkit-transform: rotate(-45deg);
|
|
6583
|
+
-ms-transform: rotate(-45deg);
|
|
6584
|
+
transform: rotate(-45deg);
|
|
6585
|
+
border: solid;
|
|
6586
|
+
border-width: 0 0 5px 5px;
|
|
6587
|
+
border-top-color: transparent;
|
|
6588
|
+
opacity: ${(props) => (props.isChecked ? 1 : 0)};
|
|
6589
|
+
background: transparent;
|
|
6590
|
+
}
|
|
6594
6591
|
`;
|
|
6595
6592
|
|
|
6596
6593
|
const NewsArticleFilterFields = {
|
|
@@ -6615,13 +6612,13 @@ const NewsArticleFilterFields = {
|
|
|
6615
6612
|
};
|
|
6616
6613
|
|
|
6617
6614
|
var CheckboxListFilter = function (_a) {
|
|
6618
|
-
var options = _a.options, checked = _a.checked,
|
|
6619
|
-
var labelHidden =
|
|
6620
|
-
var hintHidden =
|
|
6615
|
+
var options = _a.options, checked = _a.checked, _b = _a.label, label = _b === void 0 ? null : _b, _c = _a.hint, hint = _c === void 0 ? null : _c, displayLegend = _a.displayLegend, _d = _a.hintId, hintId = _d === void 0 ? 'hint' : _d;
|
|
6616
|
+
var labelHidden = label === null || !displayLegend ? true : false;
|
|
6617
|
+
var hintHidden = hint === null ? true : false;
|
|
6621
6618
|
var setupCheckboxes = function () {
|
|
6622
|
-
return options.map(function (option) { return (__assign$2(__assign$2({}, option), { checked:
|
|
6619
|
+
return options.map(function (option) { return (__assign$2(__assign$2({}, option), { checked: checked.includes(option.value) ? true : false })); });
|
|
6623
6620
|
};
|
|
6624
|
-
var
|
|
6621
|
+
var _e = useState(setupCheckboxes()), checkboxState = _e[0], setCheckboxState = _e[1];
|
|
6625
6622
|
var optionChecked = function (e) {
|
|
6626
6623
|
var checkedVal = e.target.value;
|
|
6627
6624
|
var newCheckboxState = __spreadArray([], checkboxState, true);
|
|
@@ -6636,18 +6633,16 @@ var CheckboxListFilter = function (_a) {
|
|
|
6636
6633
|
var checked = __spreadArray([], checkboxState, true);
|
|
6637
6634
|
checked = newCheckboxState.filter(function (c) { return c.checked === true; });
|
|
6638
6635
|
var articleTypes = checked.map(function (c) { return c.value; }).join(',');
|
|
6639
|
-
handleParams('news', [{ key: NewsArticleFilterFields.articleType.queryParamKey, value: articleTypes }], [
|
|
6636
|
+
handleParams('news', [{ key: NewsArticleFilterFields.articleType.queryParamKey, value: articleTypes }], ['page']);
|
|
6640
6637
|
};
|
|
6641
6638
|
var backupLabel = Math.random().toString(36).substring(7);
|
|
6642
6639
|
return (React.createElement(Container$T, { "data-testid": "CheckboxListFilter" },
|
|
6643
|
-
React.createElement(Fieldset, { "aria-describedby":
|
|
6644
|
-
React.createElement(Legend, { labelHidden: labelHidden }, label),
|
|
6645
|
-
React.createElement(Hint, { id:
|
|
6646
|
-
React.createElement(Checkboxes, null, checkboxState.map(function (option, i) {
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
|
-
React.createElement(CheckboxLabel, { isChecked: option.checked, htmlFor: option.value }, option.title));
|
|
6650
|
-
})))));
|
|
6640
|
+
React.createElement(Fieldset, { "aria-describedby": hintId },
|
|
6641
|
+
React.createElement(Legend, { labelHidden: labelHidden, "data-testid": "CheckboxListFilterLegend" }, label),
|
|
6642
|
+
React.createElement(Hint, { id: hintId, hintHidden: hintHidden, "data-testid": "CheckboxListFilterHint" }, hint),
|
|
6643
|
+
React.createElement(Checkboxes, null, checkboxState.map(function (option, i) { return (React.createElement(Checkbox, { key: i },
|
|
6644
|
+
React.createElement(CheckboxInput, { id: option.value, name: labelHidden ? backupLabel : label, type: "checkbox", onChange: optionChecked, value: option.value, checked: option.checked }),
|
|
6645
|
+
React.createElement(CheckboxLabel, { isChecked: option.checked, htmlFor: option.value }, option.title))); })))));
|
|
6651
6646
|
};
|
|
6652
6647
|
|
|
6653
6648
|
const Container$S = styled.div`
|
|
@@ -6823,7 +6818,10 @@ const Container$R = styled.div`
|
|
|
6823
6818
|
border: ${(props) => (props.hasBorder ? `1px solid ${props.theme.theme_vars.colours.grey}` : 'none')};
|
|
6824
6819
|
list-style: none;
|
|
6825
6820
|
max-width: none !important;
|
|
6826
|
-
min-width:
|
|
6821
|
+
min-width: calc(
|
|
6822
|
+
100% + ${(props) => props.theme.theme_vars.spacingSizes.small} +
|
|
6823
|
+
${(props) => props.theme.theme_vars.spacingSizes.small}
|
|
6824
|
+
);
|
|
6827
6825
|
|
|
6828
6826
|
@media screen and (min-width: ${(props) => props.theme.theme_vars.breakpoints.l}) {
|
|
6829
6827
|
flex-wrap: ${(props) => (props.hasWrap ? `wrap` : `nowrap`)};
|
|
@@ -25599,7 +25597,7 @@ var ServiceLinksBoxed = function (_a) {
|
|
|
25599
25597
|
React.createElement(Row$1, { isList: true }, (_a = serviceLink.quickLinksArray) === null || _a === void 0 ? void 0 :
|
|
25600
25598
|
_a.map(function (quickLink, quickLinkIndex) { return (React.createElement(Column, { isList: true, small: "full", medium: "one-half", large: "one-third", key: quickLinkIndex },
|
|
25601
25599
|
React.createElement(QuickLink, { href: quickLink.url }, quickLink.title))); }),
|
|
25602
|
-
React.createElement(Column, { small: "full", medium: "one-half", large: "one-third" },
|
|
25600
|
+
React.createElement(Column, { isList: true, small: "full", medium: "one-half", large: "one-third" },
|
|
25603
25601
|
React.createElement(QuickLink, { href: serviceLink.url },
|
|
25604
25602
|
"All ",
|
|
25605
25603
|
serviceLink.title.toLowerCase(),
|