northants-design-system 0.3.1 → 0.3.2
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 +98 -103
- package/build/index.esm.js.map +1 -1
- package/build/index.js +98 -103
- 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 +5 -5
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -6487,131 +6487,128 @@ var Pagination = function (_a) {
|
|
|
6487
6487
|
};
|
|
6488
6488
|
|
|
6489
6489
|
const Container$T = styled__default["default"].div`
|
|
6490
|
-
${props => props.theme.fontStyles};
|
|
6490
|
+
${(props) => props.theme.fontStyles};
|
|
6491
6491
|
margin-bottom: 30px;
|
|
6492
6492
|
`;
|
|
6493
6493
|
|
|
6494
6494
|
const Fieldset = styled__default["default"].fieldset`
|
|
6495
|
-
|
|
6496
|
-
|
|
6497
|
-
|
|
6498
|
-
|
|
6495
|
+
min-width: 0;
|
|
6496
|
+
margin: 0;
|
|
6497
|
+
padding: 0;
|
|
6498
|
+
border: 0;
|
|
6499
6499
|
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
6500
|
+
&:after {
|
|
6501
|
+
content: '';
|
|
6502
|
+
display: block;
|
|
6503
|
+
clear: both;
|
|
6504
|
+
}
|
|
6505
6505
|
`;
|
|
6506
6506
|
|
|
6507
|
-
const hideLabel$1 = props => {
|
|
6508
|
-
if(props.labelHidden === true) {
|
|
6507
|
+
const hideLabel$1 = (props) => {
|
|
6508
|
+
if (props.labelHidden === true) {
|
|
6509
6509
|
return VisuallyHidden$2;
|
|
6510
6510
|
}
|
|
6511
6511
|
};
|
|
6512
6512
|
|
|
6513
|
-
|
|
6514
6513
|
const Legend = styled__default["default"].legend`
|
|
6515
|
-
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
|
|
6514
|
+
color: #0b0c0c;
|
|
6515
|
+
-webkit-box-sizing: border-box;
|
|
6516
|
+
box-sizing: border-box;
|
|
6517
|
+
display: table;
|
|
6518
|
+
max-width: 100%;
|
|
6519
|
+
margin-bottom: 10px;
|
|
6520
|
+
padding: 0;
|
|
6521
|
+
white-space: normal;
|
|
6522
|
+
${hideLabel$1}
|
|
6524
6523
|
`;
|
|
6525
6524
|
|
|
6526
|
-
const hideHint = props => {
|
|
6527
|
-
if(props.hintHidden === true) {
|
|
6525
|
+
const hideHint = (props) => {
|
|
6526
|
+
if (props.hintHidden === true) {
|
|
6528
6527
|
return VisuallyHidden$2;
|
|
6529
6528
|
}
|
|
6530
6529
|
};
|
|
6531
6530
|
|
|
6532
|
-
|
|
6533
6531
|
const Hint = styled__default["default"].div`
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6532
|
+
font-size: ${(props) => props.theme.theme_vars.fontSizes.small};
|
|
6533
|
+
display: block;
|
|
6534
|
+
margin-bottom: 15px;
|
|
6535
|
+
color: #505a5f;
|
|
6536
|
+
margin-top: -5px;
|
|
6537
|
+
${hideHint}
|
|
6540
6538
|
`;
|
|
6541
6539
|
|
|
6542
6540
|
const Checkboxes = styled__default["default"].div`
|
|
6543
|
-
display: block;
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6541
|
+
display: block;
|
|
6542
|
+
`;
|
|
6547
6543
|
|
|
6548
6544
|
const Checkbox = styled__default["default"].div`
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
`;
|
|
6545
|
+
font-size: ${(props) => props.theme.theme_vars.fontSizes.small};
|
|
6546
|
+
display: block;
|
|
6547
|
+
position: relative;
|
|
6548
|
+
min-height: 40px;
|
|
6549
|
+
margin-bottom: 10px;
|
|
6550
|
+
padding-left: 40px;
|
|
6551
|
+
clear: left;
|
|
6552
|
+
`;
|
|
6558
6553
|
|
|
6559
6554
|
const CheckboxInput = styled__default["default"].input`
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6555
|
+
cursor: pointer;
|
|
6556
|
+
position: absolute;
|
|
6557
|
+
z-index: 1;
|
|
6558
|
+
top: -2px;
|
|
6559
|
+
left: -2px;
|
|
6560
|
+
width: 44px;
|
|
6561
|
+
height: 44px;
|
|
6562
|
+
margin: 0;
|
|
6563
|
+
opacity: 0;
|
|
6564
|
+
|
|
6565
|
+
&:focus + label:before {
|
|
6566
|
+
box-shadow: 0 0 0 3px ${(props) => props.theme.theme_vars.colours.focus};
|
|
6567
|
+
}
|
|
6569
6568
|
`;
|
|
6570
6569
|
|
|
6571
6570
|
const CheckboxLabel = styled__default["default"].label`
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
&:before {
|
|
6584
|
-
content: "";
|
|
6585
|
-
-webkit-box-sizing: border-box;
|
|
6586
|
-
box-sizing: border-box;
|
|
6587
|
-
position: absolute;
|
|
6588
|
-
top: 0;
|
|
6589
|
-
left: 0;
|
|
6590
|
-
width: 40px;
|
|
6591
|
-
height: 40px;
|
|
6592
|
-
border: 2px solid currentColor;
|
|
6593
|
-
background: transparent;
|
|
6594
|
-
}
|
|
6571
|
+
display: inline-block;
|
|
6572
|
+
margin-bottom: 0;
|
|
6573
|
+
padding: 8px 15px 5px;
|
|
6574
|
+
cursor: pointer;
|
|
6575
|
+
-ms-touch-action: manipulation;
|
|
6576
|
+
touch-action: manipulation;
|
|
6577
|
+
color: #0b0c0c;
|
|
6578
|
+
display: block;
|
|
6579
|
+
margin-bottom: 5px;
|
|
6595
6580
|
|
|
6581
|
+
&:before {
|
|
6582
|
+
content: '';
|
|
6583
|
+
-webkit-box-sizing: border-box;
|
|
6584
|
+
box-sizing: border-box;
|
|
6585
|
+
position: absolute;
|
|
6586
|
+
top: 0;
|
|
6587
|
+
left: 0;
|
|
6588
|
+
width: 40px;
|
|
6589
|
+
height: 40px;
|
|
6590
|
+
border: 2px solid currentColor;
|
|
6591
|
+
background: transparent;
|
|
6592
|
+
}
|
|
6596
6593
|
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
|
-
|
|
6610
|
-
|
|
6611
|
-
|
|
6612
|
-
|
|
6613
|
-
|
|
6614
|
-
|
|
6594
|
+
&:after {
|
|
6595
|
+
content: '';
|
|
6596
|
+
-webkit-box-sizing: border-box;
|
|
6597
|
+
box-sizing: border-box;
|
|
6598
|
+
position: absolute;
|
|
6599
|
+
top: 11px;
|
|
6600
|
+
left: 9px;
|
|
6601
|
+
width: 23px;
|
|
6602
|
+
height: 12px;
|
|
6603
|
+
-webkit-transform: rotate(-45deg);
|
|
6604
|
+
-ms-transform: rotate(-45deg);
|
|
6605
|
+
transform: rotate(-45deg);
|
|
6606
|
+
border: solid;
|
|
6607
|
+
border-width: 0 0 5px 5px;
|
|
6608
|
+
border-top-color: transparent;
|
|
6609
|
+
opacity: ${(props) => (props.isChecked ? 1 : 0)};
|
|
6610
|
+
background: transparent;
|
|
6611
|
+
}
|
|
6615
6612
|
`;
|
|
6616
6613
|
|
|
6617
6614
|
const NewsArticleFilterFields = {
|
|
@@ -6637,10 +6634,10 @@ const NewsArticleFilterFields = {
|
|
|
6637
6634
|
|
|
6638
6635
|
var CheckboxListFilter = function (_a) {
|
|
6639
6636
|
var options = _a.options, checked = _a.checked, label = _a.label, _b = _a.hint, hint = _b === void 0 ? null : _b, displayLegend = _a.displayLegend;
|
|
6640
|
-
var labelHidden =
|
|
6641
|
-
var hintHidden =
|
|
6637
|
+
var labelHidden = label === null || !displayLegend ? true : false;
|
|
6638
|
+
var hintHidden = hint === null ? true : false;
|
|
6642
6639
|
var setupCheckboxes = function () {
|
|
6643
|
-
return options.map(function (option) { return (__assign$2(__assign$2({}, option), { checked:
|
|
6640
|
+
return options.map(function (option) { return (__assign$2(__assign$2({}, option), { checked: checked.includes(option.value) ? true : false })); });
|
|
6644
6641
|
};
|
|
6645
6642
|
var _c = React.useState(setupCheckboxes()), checkboxState = _c[0], setCheckboxState = _c[1];
|
|
6646
6643
|
var optionChecked = function (e) {
|
|
@@ -6657,18 +6654,16 @@ var CheckboxListFilter = function (_a) {
|
|
|
6657
6654
|
var checked = __spreadArray([], checkboxState, true);
|
|
6658
6655
|
checked = newCheckboxState.filter(function (c) { return c.checked === true; });
|
|
6659
6656
|
var articleTypes = checked.map(function (c) { return c.value; }).join(',');
|
|
6660
|
-
handleParams('news', [{ key: NewsArticleFilterFields.articleType.queryParamKey, value: articleTypes }], [
|
|
6657
|
+
handleParams('news', [{ key: NewsArticleFilterFields.articleType.queryParamKey, value: articleTypes }], ['page']);
|
|
6661
6658
|
};
|
|
6662
6659
|
var backupLabel = Math.random().toString(36).substring(7);
|
|
6663
6660
|
return (React__default["default"].createElement(Container$T, { "data-testid": "CheckboxListFilter" },
|
|
6664
6661
|
React__default["default"].createElement(Fieldset, { "aria-describedby": "waste-hint" },
|
|
6665
6662
|
React__default["default"].createElement(Legend, { labelHidden: labelHidden }, label),
|
|
6666
6663
|
React__default["default"].createElement(Hint, { id: "waste-hint", hintHidden: hintHidden }, hint),
|
|
6667
|
-
React__default["default"].createElement(Checkboxes, null, checkboxState.map(function (option, i) {
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
React__default["default"].createElement(CheckboxLabel, { isChecked: option.checked, htmlFor: option.value }, option.title));
|
|
6671
|
-
})))));
|
|
6664
|
+
React__default["default"].createElement(Checkboxes, null, checkboxState.map(function (option, i) { return (React__default["default"].createElement(Checkbox, { key: i },
|
|
6665
|
+
React__default["default"].createElement(CheckboxInput, { id: option.value, name: labelHidden ? backupLabel : label, type: "checkbox", onChange: optionChecked, value: option.value, checked: option.checked }),
|
|
6666
|
+
React__default["default"].createElement(CheckboxLabel, { isChecked: option.checked, htmlFor: option.value }, option.title))); })))));
|
|
6672
6667
|
};
|
|
6673
6668
|
|
|
6674
6669
|
const Container$S = styled__default["default"].div`
|