northants-design-system 0.4.3 → 0.4.5
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 +19 -18
- package/build/index.esm.js.map +1 -1
- package/build/index.js +19 -18
- package/build/index.js.map +1 -1
- package/build/library/contexts/DirectoryShortListProvider/DirectoryShortListProvider.types.d.ts +4 -0
- package/build/library/structure/BackLink/BackLink.d.ts +6 -3
- package/build/library/structure/BackLink/BackLink.types.d.ts +6 -2
- package/package.json +1 -1
package/build/index.esm.js
CHANGED
|
@@ -23162,31 +23162,29 @@ var AlertBanner = function (_a) {
|
|
|
23162
23162
|
};
|
|
23163
23163
|
|
|
23164
23164
|
const Container$E = styled.a`
|
|
23165
|
-
|
|
23166
|
-
|
|
23167
|
-
|
|
23168
23165
|
display: inline-block;
|
|
23169
23166
|
position: relative;
|
|
23170
23167
|
margin-top: 15px;
|
|
23171
23168
|
margin-bottom: 15px;
|
|
23172
23169
|
padding-left: 14px;
|
|
23170
|
+
border: none;
|
|
23171
|
+
background: transparent;
|
|
23173
23172
|
|
|
23173
|
+
${(props) => props.theme.fontStyles}
|
|
23174
23174
|
|
|
23175
|
-
|
|
23176
|
-
|
|
23177
|
-
|
|
23178
|
-
${props => props.theme.linkStylesHover}
|
|
23175
|
+
&:hover {
|
|
23176
|
+
${(props) => props.theme.linkStylesHover}
|
|
23177
|
+
cursor: pointer;
|
|
23179
23178
|
}
|
|
23180
|
-
&:focus{
|
|
23181
|
-
|
|
23179
|
+
&:focus {
|
|
23180
|
+
${(props) => props.theme.linkStylesFocus}
|
|
23182
23181
|
}
|
|
23183
|
-
&:active{
|
|
23184
|
-
|
|
23182
|
+
&:active {
|
|
23183
|
+
${(props) => props.theme.linkStylesActive}
|
|
23185
23184
|
}
|
|
23186
23185
|
|
|
23187
|
-
|
|
23188
23186
|
&:before {
|
|
23189
|
-
content:
|
|
23187
|
+
content: '';
|
|
23190
23188
|
display: block;
|
|
23191
23189
|
position: absolute;
|
|
23192
23190
|
top: 0;
|
|
@@ -23208,7 +23206,7 @@ const Container$E = styled.a`
|
|
|
23208
23206
|
}
|
|
23209
23207
|
|
|
23210
23208
|
&:after {
|
|
23211
|
-
content:
|
|
23209
|
+
content: '';
|
|
23212
23210
|
position: absolute;
|
|
23213
23211
|
top: -14px;
|
|
23214
23212
|
right: 0;
|
|
@@ -23217,9 +23215,12 @@ const Container$E = styled.a`
|
|
|
23217
23215
|
}
|
|
23218
23216
|
`;
|
|
23219
23217
|
|
|
23218
|
+
/**
|
|
23219
|
+
* A back link or a back button when using history
|
|
23220
|
+
*/
|
|
23220
23221
|
var BackLink = function (_a) {
|
|
23221
|
-
var link = _a.link;
|
|
23222
|
-
return (React.createElement(Container$E, { href: link, "data-testid": "BackLink" }, "Back"));
|
|
23222
|
+
var link = _a.link, _b = _a.useHistory, useHistory = _b === void 0 ? false : _b;
|
|
23223
|
+
return (React.createElement(React.Fragment, null, useHistory ? (React.createElement(Container$E, { onClick: function () { return history.back(); }, "data-testid": "BackLink", as: "button" }, "Back")) : (React.createElement(Container$E, { href: link, "data-testid": "BackLink" }, "Back"))));
|
|
23223
23224
|
};
|
|
23224
23225
|
|
|
23225
23226
|
const Container$D = styled.div`
|
|
@@ -29010,8 +29011,8 @@ const AddToShortlist = styled.button`
|
|
|
29010
29011
|
|
|
29011
29012
|
var DirectoryShortListContext = createContext({});
|
|
29012
29013
|
var DirectoryShortListProvider = function (_a) {
|
|
29013
|
-
var children = _a.children;
|
|
29014
|
-
var
|
|
29014
|
+
var _b = _a.shortlistKey, shortlistKey = _b === void 0 ? 'DirectoryShort' : _b, children = _a.children;
|
|
29015
|
+
var _c = useLocalStorage(shortlistKey, []), favourites = _c[0], setFavourites = _c[1];
|
|
29015
29016
|
var toggleFavourites = function (id, name, snippet, email, website, phone) {
|
|
29016
29017
|
var updatedFavourites = __spreadArray([], favourites, true);
|
|
29017
29018
|
if (isFavourite(id)) {
|