northants-design-system 0.1.129 → 0.1.130
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
CHANGED
|
@@ -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
|
-
/*
|
|
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
|
|
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
|
|
@@ -7603,11 +7604,13 @@ const Button$1 = styled.button`
|
|
|
7603
7604
|
background: ${props => props.isLight ? props.theme.theme_vars.colours.action : props.theme.theme_vars.colours.grey_darkest};
|
|
7604
7605
|
color: ${props => props.theme.theme_vars.colours.white};
|
|
7605
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);
|
|
7606
7609
|
width: ${props => props.isLarge ? "5rem" : "3rem"};
|
|
7607
7610
|
text-align: center;
|
|
7608
7611
|
height: ${ props => props.isLarge ? "2.9rem" : "2.28rem"};
|
|
7609
7612
|
@media screen and (min-width: ${ props => props.theme.theme_vars.breakpoints.m}) {
|
|
7610
|
-
height: ${ props => props.isLarge ? "3.
|
|
7613
|
+
height: ${ props => props.isLarge ? "3.22rem" : "2.6rem"};
|
|
7611
7614
|
}
|
|
7612
7615
|
|
|
7613
7616
|
&:hover {
|
|
@@ -7707,7 +7710,7 @@ var Searchbar = function (_a) {
|
|
|
7707
7710
|
React.createElement("div", { role: "search" },
|
|
7708
7711
|
React.createElement(Label$1, { htmlFor: id }, placeholder),
|
|
7709
7712
|
React.createElement(InputWrapper, null,
|
|
7710
|
-
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 }),
|
|
7713
|
+
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 }),
|
|
7711
7714
|
React.createElement(Button$1, { type: "submit", value: "Search", isLarge: isLarge, isLight: isLight },
|
|
7712
7715
|
React.createElement(IconDownload$2, { colourFill: "#fff" }),
|
|
7713
7716
|
React.createElement(ButtonText, null, "Search")))))));
|
|
@@ -8521,7 +8524,7 @@ var HomeHero = function (_a) {
|
|
|
8521
8524
|
params: {
|
|
8522
8525
|
type: "search"
|
|
8523
8526
|
}
|
|
8524
|
-
}, suggestions: searchSuggestions })),
|
|
8527
|
+
}, suggestions: searchSuggestions, maximumMatchesShown: 4 })),
|
|
8525
8528
|
promotedLinksArray.length > 0 &&
|
|
8526
8529
|
React.createElement(PromotedLinks$1, { promotedLinksArray: promotedLinksArray })));
|
|
8527
8530
|
}))));
|