northants-design-system 0.1.127 → 0.1.131

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.
@@ -167,9 +167,10 @@ const StyledTextInput = styled.input`
167
167
  * Just like TextInput bar a tweak
168
168
  */
169
169
  const AutocompleteTextInput = styled(StyledTextInput)`
170
- /* square off lower corners if suggestions visible */
170
+ /* right edge squared off if has a button adjacent, and lower corners squared if suggestions visible */
171
+ border-top-right-radius: ${props => props.hasAdjacentButton ? "0px" : props.isLarge ? props.theme.theme_vars.border_radius_large : props.theme.theme_vars.border_radius};
171
172
  border-bottom-left-radius: ${props => props.isOpen ? "0px" : props.isLarge ? props.theme.theme_vars.border_radius_large : props.theme.theme_vars.border_radius};
172
- border-bottom-right-radius: ${props => props.isOpen ? "0px" : props.isLarge ? props.theme.theme_vars.border_radius_large : props.theme.theme_vars.border_radius};
173
+ border-bottom-right-radius: ${props => props.hasAdjacentButton || props.isOpen ? "0px" : props.isLarge ? props.theme.theme_vars.border_radius_large : props.theme.theme_vars.border_radius};
173
174
  `;
174
175
 
175
176
  const AutocompleteLabel = styled.label`
@@ -181,7 +182,6 @@ const AutocompleteLabel = styled.label`
181
182
  */
182
183
  const AutocompleteSuggestionList = styled.ul`
183
184
  position: absolute;
184
- max-width: 50%;
185
185
  display: block;
186
186
  z-index: 1;
187
187
  width: auto;
@@ -3691,12 +3691,12 @@ var FunctionReset = process.env.NODE_ENV !== "production" ? '__function_reset__'
3691
3691
  * click on to select. If viewing in Storybook, try typing the name of a fruit in the story examples.
3692
3692
  */
3693
3693
  var Autocomplete = function (_a) {
3694
- var _b = _a.id, id = _b === void 0 ? "autocomplete" : _b, _c = _a.name, name = _c === void 0 ? "autocomplete" : _c, labelText = _a.labelText, value = _a.value, size = _a.size, placeholder = _a.placeholder, _d = _a.isErrored, isErrored = _d === void 0 ? false : _d, errorText = _a.errorText, _e = _a.suggestions, suggestions = _e === void 0 ? [] : _e, _f = _a.showSuggestions, showSuggestions = _f === void 0 ? false : _f, _g = _a.minimumMatchLength, minimumMatchLength = _g === void 0 ? 2 : _g, _h = _a.maximumMatchesShown, maximumMatchesShown = _h === void 0 ? 5 : _h, _j = _a.isLarge, isLarge = _j === void 0 ? false : _j, onSelect = _a.onSelect, onChange = _a.onChange;
3694
+ var _b = _a.id, id = _b === void 0 ? "autocomplete" : _b, _c = _a.name, name = _c === void 0 ? "autocomplete" : _c, labelText = _a.labelText, value = _a.value, size = _a.size, placeholder = _a.placeholder, _d = _a.isErrored, isErrored = _d === void 0 ? false : _d, errorText = _a.errorText, _e = _a.suggestions, suggestions = _e === void 0 ? [] : _e, _f = _a.showSuggestions, showSuggestions = _f === void 0 ? false : _f, _g = _a.minimumMatchLength, minimumMatchLength = _g === void 0 ? 2 : _g, _h = _a.maximumMatchesShown, maximumMatchesShown = _h === void 0 ? 5 : _h, _j = _a.isLarge, isLarge = _j === void 0 ? false : _j, _k = _a.hasAdjacentButton, hasAdjacentButton = _k === void 0 ? false : _k, onSelect = _a.onSelect, onChange = _a.onChange;
3695
3695
  /**
3696
3696
  * We save the input value in state or we can't cope with leaving the input
3697
3697
  * without selecting a matching suggestion.
3698
3698
  */
3699
- var _k = useState(value), inputvalue = _k[0], setInputValue = _k[1];
3699
+ var _l = useState(value), inputvalue = _l[0], setInputValue = _l[1];
3700
3700
  /**
3701
3701
  * For component state changes that affect the input value, we copy the
3702
3702
  * value into our saved state, and fire the onSelect handler if the change
@@ -3778,6 +3778,7 @@ var Autocomplete = function (_a) {
3778
3778
  isErrored: isErrored,
3779
3779
  isOpen: isOpen && filteredsuggestions.length > 0,
3780
3780
  isLarge: isLarge,
3781
+ hasAdjacentButton: hasAdjacentButton,
3781
3782
  size: size
3782
3783
  })))),
3783
3784
  // can't rely just on isOpen or we can end up displaying an empty suggestions list
@@ -6641,13 +6642,12 @@ var IconDownload$1 = function (_a) {
6641
6642
  };
6642
6643
 
6643
6644
  const handleContainerPadding = (noBackground, noPadding) => {
6644
- if(noPadding || noBackground) {
6645
+ if (noPadding || noBackground) {
6645
6646
  return 0
6646
6647
  } else {
6647
6648
  return "50px";
6648
6649
  }
6649
- };
6650
-
6650
+ };
6651
6651
 
6652
6652
  const Container$7 = styled.div`
6653
6653
  background: ${props => props.noBackground ? "transparent" :
@@ -6660,7 +6660,7 @@ const MaxWidth = styled.div`
6660
6660
  ${props => props.theme.fontStyles}
6661
6661
  margin-right: 15px;
6662
6662
  margin-left: 15px;
6663
- overflow: hidden;
6663
+ overflow: ${props => props.overflowVisible ? "visible" : "hidden"};
6664
6664
 
6665
6665
  pre {
6666
6666
  font-family: monospace;
@@ -6682,9 +6682,9 @@ const MaxWidth = styled.div`
6682
6682
  * A container for holding the main content of a page
6683
6683
  */
6684
6684
  var MaxWidthContainer = function (_a) {
6685
- var children = _a.children, classes = _a.classes, _b = _a.noBackground, noBackground = _b === void 0 ? false : _b, _c = _a.noPadding, noPadding = _c === void 0 ? false : _c, props = __rest(_a, ["children", "classes", "noBackground", "noPadding"]);
6685
+ var children = _a.children, classes = _a.classes, _b = _a.noBackground, noBackground = _b === void 0 ? false : _b, _c = _a.noPadding, noPadding = _c === void 0 ? false : _c, _d = _a.overflowVisible, overflowVisible = _d === void 0 ? false : _d, props = __rest(_a, ["children", "classes", "noBackground", "noPadding", "overflowVisible"]);
6686
6686
  return (React.createElement(Container$7, { noBackground: noBackground, noPadding: noPadding },
6687
- React.createElement(MaxWidth, __assign({ className: classes }, props), children)));
6687
+ React.createElement(MaxWidth, __assign({ className: classes, overflowVisible: overflowVisible }, props), children)));
6688
6688
  };
6689
6689
 
6690
6690
  var AlertBanner = function (_a) {
@@ -7604,11 +7604,13 @@ const Button$1 = styled.button`
7604
7604
  background: ${props => props.isLight ? props.theme.theme_vars.colours.action : props.theme.theme_vars.colours.grey_darkest};
7605
7605
  color: ${props => props.theme.theme_vars.colours.white};
7606
7606
  border: 1px solid transparent;
7607
+ border-top-right-radius: calc(${props => props.theme.theme_vars.border_radius} * 2);
7608
+ border-bottom-right-radius: calc(${props => props.theme.theme_vars.border_radius} * 2);
7607
7609
  width: ${props => props.isLarge ? "5rem" : "3rem"};
7608
7610
  text-align: center;
7609
7611
  height: ${ props => props.isLarge ? "2.9rem" : "2.28rem"};
7610
7612
  @media screen and (min-width: ${ props => props.theme.theme_vars.breakpoints.m}) {
7611
- height: ${ props => props.isLarge ? "3.2rem" : "2.6rem"};
7613
+ height: ${ props => props.isLarge ? "3.22rem" : "2.6rem"};
7612
7614
  }
7613
7615
 
7614
7616
  &:hover {
@@ -7706,9 +7708,8 @@ var Searchbar = function (_a) {
7706
7708
  return (React.createElement(Container$d, { "data-testid": "Searchbar", isLarge: isLarge },
7707
7709
  React.createElement("form", { onSubmit: handleSubmit },
7708
7710
  React.createElement("div", { role: "search" },
7709
- React.createElement(Label$1, { htmlFor: id }, placeholder),
7710
7711
  React.createElement(InputWrapper, null,
7711
- 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 }),
7712
+ 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 }),
7712
7713
  React.createElement(Button$1, { type: "submit", value: "Search", isLarge: isLarge, isLight: isLight },
7713
7714
  React.createElement(IconDownload$2, { colourFill: "#fff" }),
7714
7715
  React.createElement(ButtonText, null, "Search")))))));
@@ -8522,7 +8523,7 @@ var HomeHero = function (_a) {
8522
8523
  params: {
8523
8524
  type: "search"
8524
8525
  }
8525
- }, suggestions: searchSuggestions })),
8526
+ }, suggestions: searchSuggestions, maximumMatchesShown: 4 })),
8526
8527
  promotedLinksArray.length > 0 &&
8527
8528
  React.createElement(PromotedLinks$1, { promotedLinksArray: promotedLinksArray })));
8528
8529
  }))));