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.
@@ -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
- min-width: 0;
6475
- margin: 0;
6476
- padding: 0;
6477
- border: 0;
6474
+ min-width: 0;
6475
+ margin: 0;
6476
+ padding: 0;
6477
+ border: 0;
6478
6478
 
6479
- &:after {
6480
- content: "";
6481
- display: block;
6482
- clear: both;
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 === true) {
6486
+ const hideLabel$1 = (props) => {
6487
+ if (props.labelHidden === true) {
6488
6488
  return VisuallyHidden$2;
6489
6489
  }
6490
6490
  };
6491
6491
 
6492
-
6493
6492
  const Legend = styled.legend`
6494
- color: #0b0c0c;
6495
- -webkit-box-sizing: border-box;
6496
- box-sizing: border-box;
6497
- display: table;
6498
- max-width: 100%;
6499
- margin-bottom: 10px;
6500
- padding: 0;
6501
- white-space: normal;
6502
- ${hideLabel$1}
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 === true) {
6504
+ const hideHint = (props) => {
6505
+ if (props.hintHidden === true) {
6507
6506
  return VisuallyHidden$2;
6508
6507
  }
6509
6508
  };
6510
6509
 
6511
-
6512
6510
  const Hint = styled.div`
6513
- font-size: ${props => props.theme.theme_vars.fontSizes.small};
6514
- display: block;
6515
- margin-bottom: 15px;
6516
- color: #505a5f;
6517
- margin-top: -5px;
6518
- ${hideHint}
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
- font-size: ${props => props.theme.theme_vars.fontSizes.small};
6530
- display: block;
6531
- position: relative;
6532
- min-height: 40px;
6533
- margin-bottom: 10px;
6534
- padding-left: 40px;
6535
- clear: left;
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
- cursor: pointer;
6540
- position: absolute;
6541
- z-index: 1;
6542
- top: -2px;
6543
- left: -2px;
6544
- width: 44px;
6545
- height: 44px;
6546
- margin: 0;
6547
- opacity: 0;
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
- display: inline-block;
6552
- margin-bottom: 0;
6553
- padding: 8px 15px 5px;
6554
- cursor: pointer;
6555
- -ms-touch-action: manipulation;
6556
- touch-action: manipulation;
6557
- color: #0b0c0c;
6558
- display: block;
6559
- margin-bottom: 5px;
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
- &:after {
6577
- content: "";
6578
- -webkit-box-sizing: border-box;
6579
- box-sizing: border-box;
6580
- position: absolute;
6581
- top: 11px;
6582
- left: 9px;
6583
- width: 23px;
6584
- height: 12px;
6585
- -webkit-transform: rotate(-45deg);
6586
- -ms-transform: rotate(-45deg);
6587
- transform: rotate(-45deg);
6588
- border: solid;
6589
- border-width: 0 0 5px 5px;
6590
- border-top-color: transparent;
6591
- opacity: ${props => props.isChecked ? 1 : 0};
6592
- background: transparent;
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 = {
@@ -6616,10 +6613,10 @@ const NewsArticleFilterFields = {
6616
6613
 
6617
6614
  var CheckboxListFilter = function (_a) {
6618
6615
  var options = _a.options, checked = _a.checked, label = _a.label, _b = _a.hint, hint = _b === void 0 ? null : _b, displayLegend = _a.displayLegend;
6619
- var labelHidden = (label === null || !displayLegend) ? true : false;
6620
- var hintHidden = (hint === null) ? true : false;
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: (checked.includes(option.value) ? true : false) })); });
6619
+ return options.map(function (option) { return (__assign$2(__assign$2({}, option), { checked: checked.includes(option.value) ? true : false })); });
6623
6620
  };
6624
6621
  var _c = useState(setupCheckboxes()), checkboxState = _c[0], setCheckboxState = _c[1];
6625
6622
  var optionChecked = function (e) {
@@ -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 }], ["page"]);
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
6640
  React.createElement(Fieldset, { "aria-describedby": "waste-hint" },
6644
6641
  React.createElement(Legend, { labelHidden: labelHidden }, label),
6645
6642
  React.createElement(Hint, { id: "waste-hint", hintHidden: hintHidden }, hint),
6646
- React.createElement(Checkboxes, null, checkboxState.map(function (option, i) {
6647
- return React.createElement(Checkbox, { key: i },
6648
- React.createElement(CheckboxInput, { id: option.value, name: labelHidden ? backupLabel : label, type: "checkbox", onChange: optionChecked, value: option.value, checked: option.checked }),
6649
- React.createElement(CheckboxLabel, { isChecked: option.checked, htmlFor: option.value }, option.title));
6650
- })))));
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`