@citygross/components 0.7.80 → 0.7.82

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.
Files changed (47) hide show
  1. package/build/@types/components/IconText/IconText.d.ts +1 -2
  2. package/build/@types/components/Nav/Nav.d.ts +2 -4
  3. package/build/@types/components/NavMainLink/NavMainLink.d.ts +3 -2
  4. package/build/@types/components/SearchBar/SearchBar.d.ts +1 -2
  5. package/build/@types/components/SideModal/SideModal.d.ts +1 -1
  6. package/build/cjs/components/src/components/AddressBlock/AddressBlock.js +1 -1
  7. package/build/cjs/components/src/components/Button/Button.js +1 -1
  8. package/build/cjs/components/src/components/IconText/IconText.js +20 -0
  9. package/build/cjs/components/src/components/IconText/IconText.js.map +1 -0
  10. package/build/cjs/components/src/components/IconText/IconText.styles.js +5 -1
  11. package/build/cjs/components/src/components/IconText/IconText.styles.js.map +1 -1
  12. package/build/cjs/components/src/components/Nav/Nav.js +76 -0
  13. package/build/cjs/components/src/components/Nav/Nav.js.map +1 -0
  14. package/build/cjs/components/src/components/Nav/Nav.styles.js +12 -6
  15. package/build/cjs/components/src/components/Nav/Nav.styles.js.map +1 -1
  16. package/build/cjs/components/src/components/NavMainLink/NavMainLink.js +18 -0
  17. package/build/cjs/components/src/components/NavMainLink/NavMainLink.js.map +1 -0
  18. package/build/cjs/components/src/components/NavMainLink/NavMainLink.styled.js +5 -1
  19. package/build/cjs/components/src/components/NavMainLink/NavMainLink.styled.js.map +1 -1
  20. package/build/cjs/components/src/components/SearchBar/SearchBar.js +33 -0
  21. package/build/cjs/components/src/components/SearchBar/SearchBar.js.map +1 -0
  22. package/build/cjs/components/src/components/SearchBar/SearchBar.styles.js +13 -5
  23. package/build/cjs/components/src/components/SearchBar/SearchBar.styles.js.map +1 -1
  24. package/build/cjs/components/src/components/WarningLabel/WarningLabel.js +1 -1
  25. package/build/cjs/components/src/index.js +8 -7
  26. package/build/cjs/components/src/index.js.map +1 -1
  27. package/build/es/components/src/components/AddressBlock/AddressBlock.js +1 -1
  28. package/build/es/components/src/components/Button/Button.js +1 -1
  29. package/build/es/components/src/components/IconText/IconText.js +12 -0
  30. package/build/es/components/src/components/IconText/IconText.js.map +1 -0
  31. package/build/es/components/src/components/IconText/IconText.styles.js +3 -1
  32. package/build/es/components/src/components/IconText/IconText.styles.js.map +1 -1
  33. package/build/es/components/src/components/Nav/Nav.js +68 -0
  34. package/build/es/components/src/components/Nav/Nav.js.map +1 -0
  35. package/build/es/components/src/components/Nav/Nav.styles.js +7 -7
  36. package/build/es/components/src/components/NavMainLink/NavMainLink.js +10 -0
  37. package/build/es/components/src/components/NavMainLink/NavMainLink.js.map +1 -0
  38. package/build/es/components/src/components/NavMainLink/NavMainLink.styled.js +3 -1
  39. package/build/es/components/src/components/NavMainLink/NavMainLink.styled.js.map +1 -1
  40. package/build/es/components/src/components/SearchBar/SearchBar.js +25 -0
  41. package/build/es/components/src/components/SearchBar/SearchBar.js.map +1 -0
  42. package/build/es/components/src/components/SearchBar/SearchBar.styles.js +7 -5
  43. package/build/es/components/src/components/SearchBar/SearchBar.styles.js.map +1 -1
  44. package/build/es/components/src/components/WarningLabel/WarningLabel.js +1 -1
  45. package/build/es/components/src/index.js +4 -7
  46. package/build/es/components/src/index.js.map +1 -1
  47. package/package.json +2 -2
@@ -5,5 +5,4 @@ export declare type TIconText = {
5
5
  showOnlyIcon?: boolean;
6
6
  spacing?: number;
7
7
  };
8
- declare const IconText: ({ icon, spacing, children, showOnlyIcon }: TIconText) => JSX.Element;
9
- export default IconText;
8
+ export declare const IconText: ({ icon, spacing, children, showOnlyIcon }: TIconText) => JSX.Element;
@@ -1,11 +1,10 @@
1
1
  import React, { ChangeEventHandler } from 'react';
2
- import { TNavMainLink } from '../NavMainLink/NavMainLink';
3
2
  export declare type TNav = {
4
3
  logo: React.ReactNode;
5
4
  maxWidth?: number;
6
5
  height?: number;
7
6
  topPosition?: number;
8
- mainLinks?: TNavMainLink[];
7
+ mainLinks?: React.ReactNode[];
9
8
  mainLinksBorderColor?: string;
10
9
  rightContent?: React.ReactNode;
11
10
  searchResultElement?: React.ReactNode;
@@ -16,5 +15,4 @@ export declare type TNav = {
16
15
  searchValue?: string;
17
16
  onSearchClick?: () => void;
18
17
  };
19
- declare const Nav: ({ logo, maxWidth, height, topPosition, mainLinks, mainLinksBorderColor, rightContent, searchResultElement, searchCancelLabel, searchIcon, searchPlaceHolder, searchOnChange, searchValue, onSearchClick }: TNav) => JSX.Element;
20
- export default Nav;
18
+ export declare const Nav: ({ logo, maxWidth, height, topPosition, mainLinks, mainLinksBorderColor, rightContent, searchResultElement, searchCancelLabel, searchIcon, searchPlaceHolder, searchOnChange, searchValue, onSearchClick }: TNav) => JSX.Element;
@@ -1,9 +1,10 @@
1
+ import React from 'react';
1
2
  export declare type TNavMainLink = {
2
3
  text: string;
3
4
  href?: string;
4
5
  active?: boolean;
5
6
  target?: '_blank' | '_self';
6
7
  borderColor?: string;
8
+ component?: React.ReactNode;
7
9
  };
8
- declare const NavMainLink: ({ text, href, target, active, borderColor }: TNavMainLink) => JSX.Element;
9
- export default NavMainLink;
10
+ export declare const NavMainLink: ({ text, href, target, active, borderColor }: TNavMainLink) => JSX.Element;
@@ -9,5 +9,4 @@ export declare type TSearchBar = styles.SearchInputProps & {
9
9
  isOpen?: boolean;
10
10
  children?: React.ReactNode;
11
11
  };
12
- declare const SearchBar: ({ flexGrow, isValid, inputSize, activeBorderColor, cancelLabel, icon, value, resultBoxTopPosition, children, inputRef, isOpen, onCancelClick, ...props }: TSearchBar) => JSX.Element;
13
- export default SearchBar;
12
+ export declare const SearchBar: ({ flexGrow, isValid, inputSize, activeBorderColor, cancelLabel, icon, value, resultBoxTopPosition, children, inputRef, isOpen, onCancelClick, ...props }: TSearchBar) => JSX.Element;
@@ -7,6 +7,6 @@ export declare type TSideModal = {
7
7
  isVisible?: boolean;
8
8
  querySelector?: string;
9
9
  slideFrom?: 'left' | 'right';
10
- overlayBackground: string;
10
+ overlayBackground?: string;
11
11
  };
12
12
  export declare const SideModal: ({ onBackdropClick, background, overlayBackground, width, isVisible, slideFrom, querySelector, children }: TSideModal) => React.ReactPortal | null;
@@ -73,9 +73,9 @@ require('../../containers/TwoColumnsContainer/TwoColumnsPageContainer.styles.js'
73
73
  require('../UnorderedList/UnorderedList.styles.js');
74
74
  require('../WarningLabel/WarningLabel.styles.js');
75
75
  require('../MobileTable/MobileTable.styles.js');
76
- require('../NavMainLink/NavMainLink.styled.js');
77
76
  require('../SearchBar/SearchBar.styles.js');
78
77
  require('../Nav/Nav.styles.js');
78
+ require('../NavMainLink/NavMainLink.styled.js');
79
79
  require('framer-motion');
80
80
  require('../SideModal/SideModal.styles.js');
81
81
  require('../IconText/IconText.styles.js');
@@ -39,7 +39,7 @@ function Button(_a) {
39
39
  icon,
40
40
  children)) : (children),
41
41
  React__default["default"].createElement("span", { className: "ripple" }),
42
- buttonBadge && React__default["default"].createElement(Button_styles.ButtonBadge, null, buttonBadge)));
42
+ buttonBadge ? (React__default["default"].createElement(Button_styles.ButtonBadge, null, buttonBadge)) : null));
43
43
  }
44
44
 
45
45
  exports.Button = Button;
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var IconText_styles = require('./IconText.styles.js');
7
+
8
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
+
10
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
11
+
12
+ var IconText = function (_a) {
13
+ var icon = _a.icon, spacing = _a.spacing, children = _a.children, showOnlyIcon = _a.showOnlyIcon;
14
+ return (React__default["default"].createElement(IconText_styles.IconTextContainer, { spacing: spacing },
15
+ icon,
16
+ !showOnlyIcon && children));
17
+ };
18
+
19
+ exports.IconText = IconText;
20
+ //# sourceMappingURL=IconText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconText.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  var _tslib = require('../../../../_virtual/_tslib.js');
4
6
  var styled = require('styled-components');
5
7
 
@@ -7,6 +9,8 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
7
9
 
8
10
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
9
11
 
10
- styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n display: flex;\n gap: ", "px;\n align-items: center;\n flex-wrap: nowrap;\n white-space: nowrap;\n"], ["\n display: flex;\n gap: ", "px;\n align-items: center;\n flex-wrap: nowrap;\n white-space: nowrap;\n"])), function (props) { var _a, _b; return (_a = props.spacing) !== null && _a !== void 0 ? _a : (_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs; });
12
+ var IconTextContainer = styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n display: flex;\n gap: ", "px;\n align-items: center;\n flex-wrap: nowrap;\n white-space: nowrap;\n"], ["\n display: flex;\n gap: ", "px;\n align-items: center;\n flex-wrap: nowrap;\n white-space: nowrap;\n"])), function (props) { var _a, _b; return (_a = props.spacing) !== null && _a !== void 0 ? _a : (_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs; });
11
13
  var templateObject_1;
14
+
15
+ exports.IconTextContainer = IconTextContainer;
12
16
  //# sourceMappingURL=IconText.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IconText.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
1
+ {"version":3,"file":"IconText.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
@@ -0,0 +1,76 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var designTokens = require('@citygross/design-tokens');
6
+ var utils = require('@citygross/utils');
7
+ var React = require('react');
8
+ var SearchBar = require('../SearchBar/SearchBar.js');
9
+ var Nav_styles = require('./Nav.styles.js');
10
+
11
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
+
13
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
14
+
15
+ var Nav = function (_a) {
16
+ var _b, _c;
17
+ var logo = _a.logo, maxWidth = _a.maxWidth, height = _a.height, topPosition = _a.topPosition, mainLinks = _a.mainLinks, _d = _a.mainLinksBorderColor; _d === void 0 ? (_b = designTokens.theme.palette) === null || _b === void 0 ? void 0 : _b.primary : _d; var rightContent = _a.rightContent, searchResultElement = _a.searchResultElement, searchCancelLabel = _a.searchCancelLabel, searchIcon = _a.searchIcon, searchPlaceHolder = _a.searchPlaceHolder, searchOnChange = _a.searchOnChange, searchValue = _a.searchValue, onSearchClick = _a.onSearchClick;
18
+ var searchContainerRef = React.useRef(null);
19
+ var searchInputRef = React.useRef(null);
20
+ var navRef = React.useRef(null);
21
+ var width = utils.useWindowSize().width;
22
+ var _e = React.useState(0), elToRemove = _e[0], setElToRemove = _e[1];
23
+ var widthRef = React.useRef(null);
24
+ var checkWidth = function () {
25
+ var _a, _b;
26
+ if ((navRef === null || navRef === void 0 ? void 0 : navRef.current) &&
27
+ ((_a = navRef === null || navRef === void 0 ? void 0 : navRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) < ((_b = navRef === null || navRef === void 0 ? void 0 : navRef.current) === null || _b === void 0 ? void 0 : _b.scrollWidth)) {
28
+ setElToRemove(function (prev) { return prev + 1; });
29
+ widthRef.current = width;
30
+ }
31
+ else if ((widthRef === null || widthRef === void 0 ? void 0 : widthRef.current) && width >= (widthRef === null || widthRef === void 0 ? void 0 : widthRef.current)) {
32
+ setElToRemove(0);
33
+ }
34
+ };
35
+ React.useEffect(function () {
36
+ var debounce = setTimeout(function () {
37
+ checkWidth();
38
+ }, 300);
39
+ return function () {
40
+ clearTimeout(debounce);
41
+ };
42
+ }, [width]);
43
+ var _f = React.useState(false), openSearch = _f[0], setOpenSearch = _f[1];
44
+ React__default["default"].useEffect(function () {
45
+ var handleClick = function (event) {
46
+ var _a;
47
+ if ((searchContainerRef === null || searchContainerRef === void 0 ? void 0 : searchContainerRef.current) &&
48
+ !((_a = searchContainerRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
49
+ event.stopPropagation();
50
+ setOpenSearch(false);
51
+ }
52
+ };
53
+ document.addEventListener('click', function (e) { return handleClick(e); }, true);
54
+ return function () {
55
+ document.removeEventListener('click', function (e) { return handleClick(e); }, true);
56
+ };
57
+ }, [searchContainerRef]);
58
+ return (React__default["default"].createElement(Nav_styles.Nav, { height: height, topPosition: topPosition, ref: navRef },
59
+ React__default["default"].createElement(Nav_styles.NavContainer, { maxWidth: maxWidth },
60
+ logo,
61
+ React__default["default"].createElement(Nav_styles.NavChildContainer, null,
62
+ openSearch ? (React__default["default"].createElement(Nav_styles.NavSearchContainer, { ref: searchContainerRef },
63
+ React__default["default"].createElement(SearchBar.SearchBar, { icon: searchIcon, cancelLabel: searchCancelLabel, flexGrow: 1, placeholder: searchPlaceHolder, onChange: searchOnChange, value: searchValue, inputRef: searchInputRef, onCancelClick: function () {
64
+ setOpenSearch(false);
65
+ }, isOpen: openSearch }, searchResultElement))) : (React__default["default"].createElement(React__default["default"].Fragment, null,
66
+ React__default["default"].createElement(Nav_styles.NavMainLinks, null, (_c = mainLinks === null || mainLinks === void 0 ? void 0 : mainLinks.slice(0, mainLinks.length - elToRemove)) === null || _c === void 0 ? void 0 : _c.map(function (link) { return link; })),
67
+ React__default["default"].createElement(Nav_styles.NavDummySearchContainer, { onClick: function () {
68
+ onSearchClick ? onSearchClick() : setOpenSearch(true);
69
+ } },
70
+ React__default["default"].createElement(SearchBar.SearchBar, { icon: searchIcon, flexGrow: 1, placeholder: searchPlaceHolder })))),
71
+ rightContent)),
72
+ React__default["default"].createElement(Nav_styles.SearchResultOverlay, { show: openSearch })));
73
+ };
74
+
75
+ exports.Nav = Nav;
76
+ //# sourceMappingURL=Nav.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Nav.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -9,14 +9,20 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
9
9
 
10
10
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
11
11
 
12
- styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n display: flex;\n background: ", ";\n position: fixed;\n top: ", "px;\n left: 0;\n height: ", "px;\n width: 100%;\n align-items: center;\n\n @media (min-width: ", "px) {\n height: ", "px;\n }\n"], ["\n display: flex;\n background: ", ";\n position: fixed;\n top: ", "px;\n left: 0;\n height: ", "px;\n width: 100%;\n align-items: center;\n\n @media (min-width: ", "px) {\n height: ", "px;\n }\n"])), function (props) { var _a, _b; return (_a = props === null || props === void 0 ? void 0 : props.background) !== null && _a !== void 0 ? _a : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.white; }, function (props) { var _a; return (_a = props.topPosition) !== null && _a !== void 0 ? _a : 0; }, function (props) { var _a, _b; return (_a = props === null || props === void 0 ? void 0 : props.height) !== null && _a !== void 0 ? _a : (_b = props.theme.constants) === null || _b === void 0 ? void 0 : _b.navHeaderHeightSmall; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeight; });
13
- styled__default["default"].div(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n margin: 0 auto;\n max-width: ", "px;\n width: 100%;\n display: flex;\n padding: ", "px;\n @media (min-width: ", "px) {\n padding: ", "px;\n }\n"], ["\n margin: 0 auto;\n max-width: ", "px;\n width: 100%;\n display: flex;\n padding: ", "px;\n @media (min-width: ", "px) {\n padding: ", "px;\n }\n"])), function (props) { return props.maxWidth; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; });
14
- styled__default["default"].div(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n justify-content: flex-end;\n display: flex;\n flex: 1;\n align-items: center;\n z-index: 20;\n"], ["\n justify-content: flex-end;\n display: flex;\n flex: 1;\n align-items: center;\n z-index: 20;\n"])));
15
- styled__default["default"].div(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n display: none;\n @media (min-width: ", "px) {\n height: 100%;\n display: flex;\n\n gap: ", "px;\n align-items: center;\n width: auto;\n margin-left: ", "px;\n }\n"], ["\n display: none;\n @media (min-width: ", "px) {\n height: 100%;\n display: flex;\n\n gap: ", "px;\n align-items: center;\n width: auto;\n margin-left: ", "px;\n }\n"])), function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.lg; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; });
12
+ var Nav = styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n display: flex;\n background: ", ";\n position: fixed;\n top: ", "px;\n left: 0;\n height: ", "px;\n width: 100%;\n align-items: center;\n\n @media (min-width: ", "px) {\n height: ", "px;\n }\n"], ["\n display: flex;\n background: ", ";\n position: fixed;\n top: ", "px;\n left: 0;\n height: ", "px;\n width: 100%;\n align-items: center;\n\n @media (min-width: ", "px) {\n height: ", "px;\n }\n"])), function (props) { var _a, _b; return (_a = props === null || props === void 0 ? void 0 : props.background) !== null && _a !== void 0 ? _a : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.white; }, function (props) { var _a; return (_a = props.topPosition) !== null && _a !== void 0 ? _a : 0; }, function (props) { var _a, _b; return (_a = props === null || props === void 0 ? void 0 : props.height) !== null && _a !== void 0 ? _a : (_b = props.theme.constants) === null || _b === void 0 ? void 0 : _b.navHeaderHeightSmall; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeight; });
13
+ var NavContainer = styled__default["default"].div(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n margin: 0 auto;\n max-width: ", "px;\n width: 100%;\n display: flex;\n padding: ", "px;\n @media (min-width: ", "px) {\n padding: ", "px;\n }\n"], ["\n margin: 0 auto;\n max-width: ", "px;\n width: 100%;\n display: flex;\n padding: ", "px;\n @media (min-width: ", "px) {\n padding: ", "px;\n }\n"])), function (props) { return props.maxWidth; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; });
14
+ var NavChildContainer = styled__default["default"].div(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n justify-content: flex-end;\n display: flex;\n flex: 1;\n align-items: center;\n z-index: 20;\n"], ["\n justify-content: flex-end;\n display: flex;\n flex: 1;\n align-items: center;\n z-index: 20;\n"])));
15
+ var NavMainLinks = styled__default["default"].div(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n display: none;\n @media (min-width: ", "px) {\n height: 100%;\n display: flex;\n\n gap: ", "px;\n align-items: center;\n width: auto;\n margin-left: ", "px;\n }\n"], ["\n display: none;\n @media (min-width: ", "px) {\n height: 100%;\n display: flex;\n\n gap: ", "px;\n align-items: center;\n width: auto;\n margin-left: ", "px;\n }\n"])), function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.lg; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; });
16
16
  var NavDummySearchContainer = styled__default["default"].div(templateObject_5 || (templateObject_5 = _tslib.__makeTemplateObject(["\n margin-left: ", "px;\n display: flex;\n align-items: center;\n flex: 1;\n"], ["\n margin-left: ", "px;\n display: flex;\n align-items: center;\n flex: 1;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; });
17
- styled__default["default"](NavDummySearchContainer)(templateObject_6 || (templateObject_6 = _tslib.__makeTemplateObject(["\n display: none;\n @media (min-width: ", "px) {\n display: flex;\n }\n"], ["\n display: none;\n @media (min-width: ", "px) {\n display: flex;\n }\n"])), function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; });
18
- styled__default["default"].div(templateObject_7 || (templateObject_7 = _tslib.__makeTemplateObject(["\n display: ", ";\n background: #333;\n opacity: 0.5;\n width: 100vw;\n height: ", ";\n position: fixed;\n top: ", ";\n left: 0;\n overflow: hidden;\n z-index: 10;\n @media (min-width: ", "px) {\n height: calc(100vh - ", "px);\n top: ", ";\n }\n"], ["\n display: ", ";\n background: #333;\n opacity: 0.5;\n width: 100vw;\n height: ", ";\n position: fixed;\n top: ", ";\n left: 0;\n overflow: hidden;\n z-index: 10;\n @media (min-width: ", "px) {\n height: calc(100vh - ", "px);\n top: ", ";\n }\n"])), function (props) { return (props.show ? 'block' : 'none'); }, function (props) { var _a; return "calc(100vh - " + ((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeightSmall) + "px)"; }, function (props) { var _a, _b; return "calc(" + ((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeightSmall) + "px - " + ((_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs) + "px)"; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeight; }, function (props) { var _a; return "calc(" + ((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeight) + "px - 8px)"; });
17
+ var NavSearchContainer = styled__default["default"](NavDummySearchContainer)(templateObject_6 || (templateObject_6 = _tslib.__makeTemplateObject(["\n display: none;\n @media (min-width: ", "px) {\n display: flex;\n }\n"], ["\n display: none;\n @media (min-width: ", "px) {\n display: flex;\n }\n"])), function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; });
18
+ var SearchResultOverlay = styled__default["default"].div(templateObject_7 || (templateObject_7 = _tslib.__makeTemplateObject(["\n display: ", ";\n background: #333;\n opacity: 0.5;\n width: 100vw;\n height: ", ";\n position: fixed;\n top: ", ";\n left: 0;\n overflow: hidden;\n z-index: 10;\n @media (min-width: ", "px) {\n height: calc(100vh - ", "px);\n top: ", ";\n }\n"], ["\n display: ", ";\n background: #333;\n opacity: 0.5;\n width: 100vw;\n height: ", ";\n position: fixed;\n top: ", ";\n left: 0;\n overflow: hidden;\n z-index: 10;\n @media (min-width: ", "px) {\n height: calc(100vh - ", "px);\n top: ", ";\n }\n"])), function (props) { return (props.show ? 'block' : 'none'); }, function (props) { var _a; return "calc(100vh - " + ((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeightSmall) + "px)"; }, function (props) { var _a, _b; return "calc(" + ((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeightSmall) + "px - " + ((_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs) + "px)"; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeight; }, function (props) { var _a; return "calc(" + ((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeight) + "px - 8px)"; });
19
19
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
20
20
 
21
+ exports.Nav = Nav;
22
+ exports.NavChildContainer = NavChildContainer;
23
+ exports.NavContainer = NavContainer;
21
24
  exports.NavDummySearchContainer = NavDummySearchContainer;
25
+ exports.NavMainLinks = NavMainLinks;
26
+ exports.NavSearchContainer = NavSearchContainer;
27
+ exports.SearchResultOverlay = SearchResultOverlay;
22
28
  //# sourceMappingURL=Nav.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Nav.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Nav.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var NavMainLink_styled = require('./NavMainLink.styled.js');
7
+
8
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
+
10
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
11
+
12
+ var NavMainLink = function (_a) {
13
+ var text = _a.text, href = _a.href, _b = _a.target, target = _b === void 0 ? '_self' : _b, active = _a.active, borderColor = _a.borderColor;
14
+ return (React__default["default"].createElement(NavMainLink_styled.MainLinkContainer, { href: href, target: target, active: active, borderColor: borderColor }, text));
15
+ };
16
+
17
+ exports.NavMainLink = NavMainLink;
18
+ //# sourceMappingURL=NavMainLink.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NavMainLink.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  var _tslib = require('../../../../_virtual/_tslib.js');
4
6
  var styled = require('styled-components');
5
7
 
@@ -7,10 +9,12 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
7
9
 
8
10
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
9
11
 
10
- styled__default["default"].a(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n height: 100%;\n display: inline-flex;\n cursor: pointer;\n align-items: center;\n white-space: nowrap;\n font-weight: ", ";\n ", ";\n &:hover {\n box-shadow: inset 0 -4px 0 ", ";\n }\n"], ["\n height: 100%;\n display: inline-flex;\n cursor: pointer;\n align-items: center;\n white-space: nowrap;\n font-weight: ", ";\n ", ";\n &:hover {\n box-shadow: inset 0 -4px 0 ", ";\n }\n"])), function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.weight.semiBold; }, function (props) {
12
+ var MainLinkContainer = styled__default["default"].a(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n height: 100%;\n display: inline-flex;\n cursor: pointer;\n align-items: center;\n white-space: nowrap;\n font-weight: ", ";\n ", ";\n &:hover {\n box-shadow: inset 0 -4px 0 ", ";\n }\n"], ["\n height: 100%;\n display: inline-flex;\n cursor: pointer;\n align-items: center;\n white-space: nowrap;\n font-weight: ", ";\n ", ";\n &:hover {\n box-shadow: inset 0 -4px 0 ", ";\n }\n"])), function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.weight.semiBold; }, function (props) {
11
13
  var _a, _b;
12
14
  return (props === null || props === void 0 ? void 0 : props.active) &&
13
15
  "\n box-shadow: inset 0 -4px 0 " + ((_a = props === null || props === void 0 ? void 0 : props.borderColor) !== null && _a !== void 0 ? _a : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.primary) + ";\n ";
14
16
  }, function (props) { var _a, _b; return (_a = props === null || props === void 0 ? void 0 : props.borderColor) !== null && _a !== void 0 ? _a : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.primary; });
15
17
  var templateObject_1;
18
+
19
+ exports.MainLinkContainer = MainLinkContainer;
16
20
  //# sourceMappingURL=NavMainLink.styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NavMainLink.styled.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"NavMainLink.styled.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,33 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _tslib = require('../../../../_virtual/_tslib.js');
6
+ var React = require('react');
7
+ var SearchBar_styles = require('./SearchBar.styles.js');
8
+
9
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
+
11
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
12
+
13
+ var SearchBar = function (_a) {
14
+ var flexGrow = _a.flexGrow, isValid = _a.isValid, _b = _a.inputSize, inputSize = _b === void 0 ? 'medium' : _b, activeBorderColor = _a.activeBorderColor, cancelLabel = _a.cancelLabel, icon = _a.icon, value = _a.value, resultBoxTopPosition = _a.resultBoxTopPosition, children = _a.children, inputRef = _a.inputRef, isOpen = _a.isOpen, onCancelClick = _a.onCancelClick, props = _tslib.__rest(_a, ["flexGrow", "isValid", "inputSize", "activeBorderColor", "cancelLabel", "icon", "value", "resultBoxTopPosition", "children", "inputRef", "isOpen", "onCancelClick"]);
15
+ React.useEffect(function () {
16
+ var _a;
17
+ if (inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) {
18
+ (_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
19
+ }
20
+ }, [inputRef === null || inputRef === void 0 ? void 0 : inputRef.current]);
21
+ return (React__default["default"].createElement(React__default["default"].Fragment, null,
22
+ React__default["default"].createElement(SearchBar_styles.SearchBarContainer, { activeBorderColor: activeBorderColor, inputSize: inputSize, flexGrow: flexGrow, isOpen: isOpen },
23
+ React__default["default"].createElement(SearchBar_styles.SearchLeftIcon, null, icon),
24
+ React__default["default"].createElement(SearchBar_styles.SearchInput, _tslib.__assign({ flexGrow: flexGrow, isValid: isValid, inputSize: inputSize, activeBorderColor: activeBorderColor, ref: inputRef }, props, { value: value })),
25
+ cancelLabel ? (React__default["default"].createElement(SearchBar_styles.SearchRightLabel, { onClick: function (e) {
26
+ e.stopPropagation();
27
+ onCancelClick && onCancelClick();
28
+ }, isOpen: isOpen }, cancelLabel)) : null,
29
+ React__default["default"].createElement(SearchBar_styles.SearchResultContainer, { topPosition: resultBoxTopPosition, isOpen: isOpen }, children))));
30
+ };
31
+
32
+ exports.SearchBar = SearchBar;
33
+ //# sourceMappingURL=SearchBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchBar.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  var _tslib = require('../../../../_virtual/_tslib.js');
4
6
  var styled = require('styled-components');
5
7
 
@@ -7,13 +9,13 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
7
9
 
8
10
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
9
11
 
10
- styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n display: ", ";\n position: absolute;\n top: ", ";\n left: 0;\n width: 100%;\n"], ["\n display: ", ";\n position: absolute;\n top: ", ";\n left: 0;\n width: 100%;\n"])), function (props) { return ((props === null || props === void 0 ? void 0 : props.isOpen) ? 'block' : 'none'); }, function (props) { var _a, _b; return (_a = props.topPosition) !== null && _a !== void 0 ? _a : "calc(100% + " + ((_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs) + "px)"; });
11
- styled__default["default"].div(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n display: ", ";\n align-items: center;\n margin-left: ", "px;\n cursor: pointer;\n"], ["\n display: ", ";\n align-items: center;\n margin-left: ", "px;\n cursor: pointer;\n"])), function (props) { return ((props === null || props === void 0 ? void 0 : props.isOpen) ? 'flex' : 'none'); }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
12
- styled__default["default"].div(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n ", ";\n\n position: relative;\n display: flex;\n justify-content: flex-end;\n\n @media (min-width: ", "px) {\n flex-direction: row-reverse;\n padding-left: ", "px;\n padding-right: ", "px;\n background: ", ";\n border-top: 1px solid ", ";\n border-radius: ", "px;\n ", "\n }\n"], ["\n ", ";\n\n position: relative;\n display: flex;\n justify-content: flex-end;\n\n @media (min-width: ", "px) {\n flex-direction: row-reverse;\n padding-left: ", "px;\n padding-right: ", "px;\n background: ", ";\n border-top: 1px solid ", ";\n border-radius: ", "px;\n ", "\n }\n"])), function (props) { return props.flexGrow && "flex: 1;"; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.lg; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lighter; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.medium; }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.extraSmall; }, function (props) {
12
+ var SearchResultContainer = styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n display: ", ";\n position: absolute;\n top: ", ";\n left: 0;\n width: 100%;\n"], ["\n display: ", ";\n position: absolute;\n top: ", ";\n left: 0;\n width: 100%;\n"])), function (props) { return ((props === null || props === void 0 ? void 0 : props.isOpen) ? 'block' : 'none'); }, function (props) { var _a, _b; return (_a = props.topPosition) !== null && _a !== void 0 ? _a : "calc(100% + " + ((_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs) + "px)"; });
13
+ var SearchRightLabel = styled__default["default"].div(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n display: ", ";\n align-items: center;\n margin-left: ", "px;\n cursor: pointer;\n"], ["\n display: ", ";\n align-items: center;\n margin-left: ", "px;\n cursor: pointer;\n"])), function (props) { return ((props === null || props === void 0 ? void 0 : props.isOpen) ? 'flex' : 'none'); }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
14
+ var SearchBarContainer = styled__default["default"].div(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n ", ";\n\n position: relative;\n display: flex;\n justify-content: flex-end;\n\n @media (min-width: ", "px) {\n flex-direction: row-reverse;\n padding-left: ", "px;\n padding-right: ", "px;\n background: ", ";\n border-top: 1px solid ", ";\n border-radius: ", "px;\n ", "\n }\n"], ["\n ", ";\n\n position: relative;\n display: flex;\n justify-content: flex-end;\n\n @media (min-width: ", "px) {\n flex-direction: row-reverse;\n padding-left: ", "px;\n padding-right: ", "px;\n background: ", ";\n border-top: 1px solid ", ";\n border-radius: ", "px;\n ", "\n }\n"])), function (props) { return props.flexGrow && "flex: 1;"; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.lg; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lighter; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.medium; }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.extraSmall; }, function (props) {
13
15
  return props.isOpen &&
14
16
  "\n flex-direction: row;\n box-shadow: inset 0 0 2px " + props.activeBorderColor + ";\n ";
15
17
  });
16
- styled__default["default"].input(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n display: none;\n flex: 1;\n border: none;\n background: transparent;\n outline: none;\n font-size: ", "px;\n padding: ", "px;\n\n ::placeholder {\n /* Chrome, Firefox, Opera, Safari 10.1+ */\n color: ", ";\n opacity: 1; /* Firefox */\n }\n\n :-ms-input-placeholder {\n /* Internet Explorer 10-11 */\n color: ", ";\n }\n\n ::-ms-input-placeholder {\n /* Microsoft Edge */\n color: ", ";\n }\n @media (min-width: ", "px) {\n font-size: ", "px;\n }\n @media (min-width: ", "px) {\n display: block;\n }\n"], ["\n display: none;\n flex: 1;\n border: none;\n background: transparent;\n outline: none;\n font-size: ", "px;\n padding: ", "px;\n\n ::placeholder {\n /* Chrome, Firefox, Opera, Safari 10.1+ */\n color: ", ";\n opacity: 1; /* Firefox */\n }\n\n :-ms-input-placeholder {\n /* Internet Explorer 10-11 */\n color: ", ";\n }\n\n ::-ms-input-placeholder {\n /* Microsoft Edge */\n color: ", ";\n }\n @media (min-width: ", "px) {\n font-size: ", "px;\n }\n @media (min-width: ", "px) {\n display: block;\n }\n"])), function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.size.s2; }, function (props) {
18
+ var SearchInput = styled__default["default"].input(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n display: none;\n flex: 1;\n border: none;\n background: transparent;\n outline: none;\n font-size: ", "px;\n padding: ", "px;\n\n ::placeholder {\n /* Chrome, Firefox, Opera, Safari 10.1+ */\n color: ", ";\n opacity: 1; /* Firefox */\n }\n\n :-ms-input-placeholder {\n /* Internet Explorer 10-11 */\n color: ", ";\n }\n\n ::-ms-input-placeholder {\n /* Microsoft Edge */\n color: ", ";\n }\n @media (min-width: ", "px) {\n font-size: ", "px;\n }\n @media (min-width: ", "px) {\n display: block;\n }\n"], ["\n display: none;\n flex: 1;\n border: none;\n background: transparent;\n outline: none;\n font-size: ", "px;\n padding: ", "px;\n\n ::placeholder {\n /* Chrome, Firefox, Opera, Safari 10.1+ */\n color: ", ";\n opacity: 1; /* Firefox */\n }\n\n :-ms-input-placeholder {\n /* Internet Explorer 10-11 */\n color: ", ";\n }\n\n ::-ms-input-placeholder {\n /* Microsoft Edge */\n color: ", ";\n }\n @media (min-width: ", "px) {\n font-size: ", "px;\n }\n @media (min-width: ", "px) {\n display: block;\n }\n"])), function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.size.s2; }, function (props) {
17
19
  var _a, _b;
18
20
  return props.inputSize === 'small'
19
21
  ? (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs
@@ -24,6 +26,12 @@ styled__default["default"].input(templateObject_4 || (templateObject_4 = _tslib.
24
26
  ? (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.size.s2
25
27
  : (_b = props.theme.typography) === null || _b === void 0 ? void 0 : _b.size.s3;
26
28
  }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.lg; });
27
- styled__default["default"].div(templateObject_5 || (templateObject_5 = _tslib.__makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-right: ", "px;\n"], ["\n display: flex;\n align-items: center;\n margin-right: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
29
+ var SearchLeftIcon = styled__default["default"].div(templateObject_5 || (templateObject_5 = _tslib.__makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-right: ", "px;\n"], ["\n display: flex;\n align-items: center;\n margin-right: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
28
30
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
31
+
32
+ exports.SearchBarContainer = SearchBarContainer;
33
+ exports.SearchInput = SearchInput;
34
+ exports.SearchLeftIcon = SearchLeftIcon;
35
+ exports.SearchResultContainer = SearchResultContainer;
36
+ exports.SearchRightLabel = SearchRightLabel;
29
37
  //# sourceMappingURL=SearchBar.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBar.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"SearchBar.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -73,9 +73,9 @@ require('../../containers/TwoColumnsContainer/TwoColumnsPageContainer.styles.js'
73
73
  require('../UnorderedList/UnorderedList.styles.js');
74
74
  var WarningLabel_styles = require('./WarningLabel.styles.js');
75
75
  require('../MobileTable/MobileTable.styles.js');
76
- require('../NavMainLink/NavMainLink.styled.js');
77
76
  require('../SearchBar/SearchBar.styles.js');
78
77
  require('../Nav/Nav.styles.js');
78
+ require('../NavMainLink/NavMainLink.styled.js');
79
79
  require('framer-motion');
80
80
  require('../SideModal/SideModal.styles.js');
81
81
  require('../IconText/IconText.styles.js');
@@ -64,14 +64,11 @@ var TwoColumnsPageContainer = require('./containers/TwoColumnsContainer/TwoColum
64
64
  var UnorderedList_styles = require('./components/UnorderedList/UnorderedList.styles.js');
65
65
  var WarningLabel = require('./components/WarningLabel/WarningLabel.js');
66
66
  var MobileTable_styles = require('./components/MobileTable/MobileTable.styles.js');
67
- require('@citygross/design-tokens');
68
- require('@citygross/utils');
69
- require('react');
70
- require('./components/NavMainLink/NavMainLink.styled.js');
71
- require('./components/SearchBar/SearchBar.styles.js');
72
- require('./components/Nav/Nav.styles.js');
67
+ var Nav = require('./components/Nav/Nav.js');
68
+ var NavMainLink = require('./components/NavMainLink/NavMainLink.js');
69
+ var SearchBar = require('./components/SearchBar/SearchBar.js');
73
70
  var SideModal = require('./components/SideModal/SideModal.js');
74
- require('./components/IconText/IconText.styles.js');
71
+ var IconText = require('./components/IconText/IconText.js');
75
72
  var Logo = require('./components/Logo/Logo.js');
76
73
  var Dropdown = require('./components/Dropdown/Dropdown.js');
77
74
 
@@ -170,7 +167,11 @@ exports.WarningLabel = WarningLabel.WarningLabel;
170
167
  exports.MobileLabel = MobileTable_styles.MobileLabel;
171
168
  exports.MobileTable = MobileTable_styles.MobileTable;
172
169
  exports.MobileTd = MobileTable_styles.MobileTd;
170
+ exports.Nav = Nav.Nav;
171
+ exports.NavMainLink = NavMainLink.NavMainLink;
172
+ exports.SearchBar = SearchBar.SearchBar;
173
173
  exports.SideModal = SideModal.SideModal;
174
+ exports.IconText = IconText.IconText;
174
175
  exports.Logo = Logo.Logo;
175
176
  exports.Dropdown = Dropdown.Dropdown;
176
177
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -69,9 +69,9 @@ import '../../containers/TwoColumnsContainer/TwoColumnsPageContainer.styles.js';
69
69
  import '../UnorderedList/UnorderedList.styles.js';
70
70
  import '../WarningLabel/WarningLabel.styles.js';
71
71
  import '../MobileTable/MobileTable.styles.js';
72
- import '../NavMainLink/NavMainLink.styled.js';
73
72
  import '../SearchBar/SearchBar.styles.js';
74
73
  import '../Nav/Nav.styles.js';
74
+ import '../NavMainLink/NavMainLink.styled.js';
75
75
  import 'framer-motion';
76
76
  import '../SideModal/SideModal.styles.js';
77
77
  import '../IconText/IconText.styles.js';
@@ -31,7 +31,7 @@ function Button(_a) {
31
31
  icon,
32
32
  children)) : (children),
33
33
  React.createElement("span", { className: "ripple" }),
34
- buttonBadge && React.createElement(ButtonBadge, null, buttonBadge)));
34
+ buttonBadge ? (React.createElement(ButtonBadge, null, buttonBadge)) : null));
35
35
  }
36
36
 
37
37
  export { Button, ButtonColor, ButtonSize };
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { IconTextContainer } from './IconText.styles.js';
3
+
4
+ var IconText = function (_a) {
5
+ var icon = _a.icon, spacing = _a.spacing, children = _a.children, showOnlyIcon = _a.showOnlyIcon;
6
+ return (React.createElement(IconTextContainer, { spacing: spacing },
7
+ icon,
8
+ !showOnlyIcon && children));
9
+ };
10
+
11
+ export { IconText };
12
+ //# sourceMappingURL=IconText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconText.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
@@ -1,6 +1,8 @@
1
1
  import { __makeTemplateObject } from '../../../../_virtual/_tslib.js';
2
2
  import styled from 'styled-components';
3
3
 
4
- styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n gap: ", "px;\n align-items: center;\n flex-wrap: nowrap;\n white-space: nowrap;\n"], ["\n display: flex;\n gap: ", "px;\n align-items: center;\n flex-wrap: nowrap;\n white-space: nowrap;\n"])), function (props) { var _a, _b; return (_a = props.spacing) !== null && _a !== void 0 ? _a : (_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs; });
4
+ var IconTextContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n gap: ", "px;\n align-items: center;\n flex-wrap: nowrap;\n white-space: nowrap;\n"], ["\n display: flex;\n gap: ", "px;\n align-items: center;\n flex-wrap: nowrap;\n white-space: nowrap;\n"])), function (props) { var _a, _b; return (_a = props.spacing) !== null && _a !== void 0 ? _a : (_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs; });
5
5
  var templateObject_1;
6
+
7
+ export { IconTextContainer };
6
8
  //# sourceMappingURL=IconText.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IconText.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"IconText.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -0,0 +1,68 @@
1
+ import { theme } from '@citygross/design-tokens';
2
+ import { useWindowSize } from '@citygross/utils';
3
+ import React, { useRef, useState, useEffect } from 'react';
4
+ import { SearchBar } from '../SearchBar/SearchBar.js';
5
+ import { Nav as Nav$1, NavContainer, NavChildContainer, NavSearchContainer, NavMainLinks, NavDummySearchContainer, SearchResultOverlay } from './Nav.styles.js';
6
+
7
+ var Nav = function (_a) {
8
+ var _b, _c;
9
+ var logo = _a.logo, maxWidth = _a.maxWidth, height = _a.height, topPosition = _a.topPosition, mainLinks = _a.mainLinks, _d = _a.mainLinksBorderColor; _d === void 0 ? (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.primary : _d; var rightContent = _a.rightContent, searchResultElement = _a.searchResultElement, searchCancelLabel = _a.searchCancelLabel, searchIcon = _a.searchIcon, searchPlaceHolder = _a.searchPlaceHolder, searchOnChange = _a.searchOnChange, searchValue = _a.searchValue, onSearchClick = _a.onSearchClick;
10
+ var searchContainerRef = useRef(null);
11
+ var searchInputRef = useRef(null);
12
+ var navRef = useRef(null);
13
+ var width = useWindowSize().width;
14
+ var _e = useState(0), elToRemove = _e[0], setElToRemove = _e[1];
15
+ var widthRef = useRef(null);
16
+ var checkWidth = function () {
17
+ var _a, _b;
18
+ if ((navRef === null || navRef === void 0 ? void 0 : navRef.current) &&
19
+ ((_a = navRef === null || navRef === void 0 ? void 0 : navRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) < ((_b = navRef === null || navRef === void 0 ? void 0 : navRef.current) === null || _b === void 0 ? void 0 : _b.scrollWidth)) {
20
+ setElToRemove(function (prev) { return prev + 1; });
21
+ widthRef.current = width;
22
+ }
23
+ else if ((widthRef === null || widthRef === void 0 ? void 0 : widthRef.current) && width >= (widthRef === null || widthRef === void 0 ? void 0 : widthRef.current)) {
24
+ setElToRemove(0);
25
+ }
26
+ };
27
+ useEffect(function () {
28
+ var debounce = setTimeout(function () {
29
+ checkWidth();
30
+ }, 300);
31
+ return function () {
32
+ clearTimeout(debounce);
33
+ };
34
+ }, [width]);
35
+ var _f = useState(false), openSearch = _f[0], setOpenSearch = _f[1];
36
+ React.useEffect(function () {
37
+ var handleClick = function (event) {
38
+ var _a;
39
+ if ((searchContainerRef === null || searchContainerRef === void 0 ? void 0 : searchContainerRef.current) &&
40
+ !((_a = searchContainerRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
41
+ event.stopPropagation();
42
+ setOpenSearch(false);
43
+ }
44
+ };
45
+ document.addEventListener('click', function (e) { return handleClick(e); }, true);
46
+ return function () {
47
+ document.removeEventListener('click', function (e) { return handleClick(e); }, true);
48
+ };
49
+ }, [searchContainerRef]);
50
+ return (React.createElement(Nav$1, { height: height, topPosition: topPosition, ref: navRef },
51
+ React.createElement(NavContainer, { maxWidth: maxWidth },
52
+ logo,
53
+ React.createElement(NavChildContainer, null,
54
+ openSearch ? (React.createElement(NavSearchContainer, { ref: searchContainerRef },
55
+ React.createElement(SearchBar, { icon: searchIcon, cancelLabel: searchCancelLabel, flexGrow: 1, placeholder: searchPlaceHolder, onChange: searchOnChange, value: searchValue, inputRef: searchInputRef, onCancelClick: function () {
56
+ setOpenSearch(false);
57
+ }, isOpen: openSearch }, searchResultElement))) : (React.createElement(React.Fragment, null,
58
+ React.createElement(NavMainLinks, null, (_c = mainLinks === null || mainLinks === void 0 ? void 0 : mainLinks.slice(0, mainLinks.length - elToRemove)) === null || _c === void 0 ? void 0 : _c.map(function (link) { return link; })),
59
+ React.createElement(NavDummySearchContainer, { onClick: function () {
60
+ onSearchClick ? onSearchClick() : setOpenSearch(true);
61
+ } },
62
+ React.createElement(SearchBar, { icon: searchIcon, flexGrow: 1, placeholder: searchPlaceHolder })))),
63
+ rightContent)),
64
+ React.createElement(SearchResultOverlay, { show: openSearch })));
65
+ };
66
+
67
+ export { Nav };
68
+ //# sourceMappingURL=Nav.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Nav.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,14 +1,14 @@
1
1
  import { __makeTemplateObject } from '../../../../_virtual/_tslib.js';
2
2
  import styled from 'styled-components';
3
3
 
4
- styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n background: ", ";\n position: fixed;\n top: ", "px;\n left: 0;\n height: ", "px;\n width: 100%;\n align-items: center;\n\n @media (min-width: ", "px) {\n height: ", "px;\n }\n"], ["\n display: flex;\n background: ", ";\n position: fixed;\n top: ", "px;\n left: 0;\n height: ", "px;\n width: 100%;\n align-items: center;\n\n @media (min-width: ", "px) {\n height: ", "px;\n }\n"])), function (props) { var _a, _b; return (_a = props === null || props === void 0 ? void 0 : props.background) !== null && _a !== void 0 ? _a : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.white; }, function (props) { var _a; return (_a = props.topPosition) !== null && _a !== void 0 ? _a : 0; }, function (props) { var _a, _b; return (_a = props === null || props === void 0 ? void 0 : props.height) !== null && _a !== void 0 ? _a : (_b = props.theme.constants) === null || _b === void 0 ? void 0 : _b.navHeaderHeightSmall; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeight; });
5
- styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin: 0 auto;\n max-width: ", "px;\n width: 100%;\n display: flex;\n padding: ", "px;\n @media (min-width: ", "px) {\n padding: ", "px;\n }\n"], ["\n margin: 0 auto;\n max-width: ", "px;\n width: 100%;\n display: flex;\n padding: ", "px;\n @media (min-width: ", "px) {\n padding: ", "px;\n }\n"])), function (props) { return props.maxWidth; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; });
6
- styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n justify-content: flex-end;\n display: flex;\n flex: 1;\n align-items: center;\n z-index: 20;\n"], ["\n justify-content: flex-end;\n display: flex;\n flex: 1;\n align-items: center;\n z-index: 20;\n"])));
7
- styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: none;\n @media (min-width: ", "px) {\n height: 100%;\n display: flex;\n\n gap: ", "px;\n align-items: center;\n width: auto;\n margin-left: ", "px;\n }\n"], ["\n display: none;\n @media (min-width: ", "px) {\n height: 100%;\n display: flex;\n\n gap: ", "px;\n align-items: center;\n width: auto;\n margin-left: ", "px;\n }\n"])), function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.lg; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; });
4
+ var Nav = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n background: ", ";\n position: fixed;\n top: ", "px;\n left: 0;\n height: ", "px;\n width: 100%;\n align-items: center;\n\n @media (min-width: ", "px) {\n height: ", "px;\n }\n"], ["\n display: flex;\n background: ", ";\n position: fixed;\n top: ", "px;\n left: 0;\n height: ", "px;\n width: 100%;\n align-items: center;\n\n @media (min-width: ", "px) {\n height: ", "px;\n }\n"])), function (props) { var _a, _b; return (_a = props === null || props === void 0 ? void 0 : props.background) !== null && _a !== void 0 ? _a : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.white; }, function (props) { var _a; return (_a = props.topPosition) !== null && _a !== void 0 ? _a : 0; }, function (props) { var _a, _b; return (_a = props === null || props === void 0 ? void 0 : props.height) !== null && _a !== void 0 ? _a : (_b = props.theme.constants) === null || _b === void 0 ? void 0 : _b.navHeaderHeightSmall; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeight; });
5
+ var NavContainer = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin: 0 auto;\n max-width: ", "px;\n width: 100%;\n display: flex;\n padding: ", "px;\n @media (min-width: ", "px) {\n padding: ", "px;\n }\n"], ["\n margin: 0 auto;\n max-width: ", "px;\n width: 100%;\n display: flex;\n padding: ", "px;\n @media (min-width: ", "px) {\n padding: ", "px;\n }\n"])), function (props) { return props.maxWidth; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.xs; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; });
6
+ var NavChildContainer = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n justify-content: flex-end;\n display: flex;\n flex: 1;\n align-items: center;\n z-index: 20;\n"], ["\n justify-content: flex-end;\n display: flex;\n flex: 1;\n align-items: center;\n z-index: 20;\n"])));
7
+ var NavMainLinks = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: none;\n @media (min-width: ", "px) {\n height: 100%;\n display: flex;\n\n gap: ", "px;\n align-items: center;\n width: auto;\n margin-left: ", "px;\n }\n"], ["\n display: none;\n @media (min-width: ", "px) {\n height: 100%;\n display: flex;\n\n gap: ", "px;\n align-items: center;\n width: auto;\n margin-left: ", "px;\n }\n"])), function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.lg; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; });
8
8
  var NavDummySearchContainer = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n margin-left: ", "px;\n display: flex;\n align-items: center;\n flex: 1;\n"], ["\n margin-left: ", "px;\n display: flex;\n align-items: center;\n flex: 1;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; });
9
- styled(NavDummySearchContainer)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: none;\n @media (min-width: ", "px) {\n display: flex;\n }\n"], ["\n display: none;\n @media (min-width: ", "px) {\n display: flex;\n }\n"])), function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; });
10
- styled.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n display: ", ";\n background: #333;\n opacity: 0.5;\n width: 100vw;\n height: ", ";\n position: fixed;\n top: ", ";\n left: 0;\n overflow: hidden;\n z-index: 10;\n @media (min-width: ", "px) {\n height: calc(100vh - ", "px);\n top: ", ";\n }\n"], ["\n display: ", ";\n background: #333;\n opacity: 0.5;\n width: 100vw;\n height: ", ";\n position: fixed;\n top: ", ";\n left: 0;\n overflow: hidden;\n z-index: 10;\n @media (min-width: ", "px) {\n height: calc(100vh - ", "px);\n top: ", ";\n }\n"])), function (props) { return (props.show ? 'block' : 'none'); }, function (props) { var _a; return "calc(100vh - " + ((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeightSmall) + "px)"; }, function (props) { var _a, _b; return "calc(" + ((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeightSmall) + "px - " + ((_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs) + "px)"; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeight; }, function (props) { var _a; return "calc(" + ((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeight) + "px - 8px)"; });
9
+ var NavSearchContainer = styled(NavDummySearchContainer)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: none;\n @media (min-width: ", "px) {\n display: flex;\n }\n"], ["\n display: none;\n @media (min-width: ", "px) {\n display: flex;\n }\n"])), function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; });
10
+ var SearchResultOverlay = styled.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n display: ", ";\n background: #333;\n opacity: 0.5;\n width: 100vw;\n height: ", ";\n position: fixed;\n top: ", ";\n left: 0;\n overflow: hidden;\n z-index: 10;\n @media (min-width: ", "px) {\n height: calc(100vh - ", "px);\n top: ", ";\n }\n"], ["\n display: ", ";\n background: #333;\n opacity: 0.5;\n width: 100vw;\n height: ", ";\n position: fixed;\n top: ", ";\n left: 0;\n overflow: hidden;\n z-index: 10;\n @media (min-width: ", "px) {\n height: calc(100vh - ", "px);\n top: ", ";\n }\n"])), function (props) { return (props.show ? 'block' : 'none'); }, function (props) { var _a; return "calc(100vh - " + ((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeightSmall) + "px)"; }, function (props) { var _a, _b; return "calc(" + ((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeightSmall) + "px - " + ((_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs) + "px)"; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.md; }, function (props) { var _a; return (_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeight; }, function (props) { var _a; return "calc(" + ((_a = props.theme.constants) === null || _a === void 0 ? void 0 : _a.navHeaderHeight) + "px - 8px)"; });
11
11
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
12
12
 
13
- export { NavDummySearchContainer };
13
+ export { Nav, NavChildContainer, NavContainer, NavDummySearchContainer, NavMainLinks, NavSearchContainer, SearchResultOverlay };
14
14
  //# sourceMappingURL=Nav.styles.js.map
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { MainLinkContainer } from './NavMainLink.styled.js';
3
+
4
+ var NavMainLink = function (_a) {
5
+ var text = _a.text, href = _a.href, _b = _a.target, target = _b === void 0 ? '_self' : _b, active = _a.active, borderColor = _a.borderColor;
6
+ return (React.createElement(MainLinkContainer, { href: href, target: target, active: active, borderColor: borderColor }, text));
7
+ };
8
+
9
+ export { NavMainLink };
10
+ //# sourceMappingURL=NavMainLink.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NavMainLink.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -1,10 +1,12 @@
1
1
  import { __makeTemplateObject } from '../../../../_virtual/_tslib.js';
2
2
  import styled from 'styled-components';
3
3
 
4
- styled.a(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 100%;\n display: inline-flex;\n cursor: pointer;\n align-items: center;\n white-space: nowrap;\n font-weight: ", ";\n ", ";\n &:hover {\n box-shadow: inset 0 -4px 0 ", ";\n }\n"], ["\n height: 100%;\n display: inline-flex;\n cursor: pointer;\n align-items: center;\n white-space: nowrap;\n font-weight: ", ";\n ", ";\n &:hover {\n box-shadow: inset 0 -4px 0 ", ";\n }\n"])), function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.weight.semiBold; }, function (props) {
4
+ var MainLinkContainer = styled.a(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 100%;\n display: inline-flex;\n cursor: pointer;\n align-items: center;\n white-space: nowrap;\n font-weight: ", ";\n ", ";\n &:hover {\n box-shadow: inset 0 -4px 0 ", ";\n }\n"], ["\n height: 100%;\n display: inline-flex;\n cursor: pointer;\n align-items: center;\n white-space: nowrap;\n font-weight: ", ";\n ", ";\n &:hover {\n box-shadow: inset 0 -4px 0 ", ";\n }\n"])), function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.weight.semiBold; }, function (props) {
5
5
  var _a, _b;
6
6
  return (props === null || props === void 0 ? void 0 : props.active) &&
7
7
  "\n box-shadow: inset 0 -4px 0 " + ((_a = props === null || props === void 0 ? void 0 : props.borderColor) !== null && _a !== void 0 ? _a : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.primary) + ";\n ";
8
8
  }, function (props) { var _a, _b; return (_a = props === null || props === void 0 ? void 0 : props.borderColor) !== null && _a !== void 0 ? _a : (_b = props.theme.palette) === null || _b === void 0 ? void 0 : _b.primary; });
9
9
  var templateObject_1;
10
+
11
+ export { MainLinkContainer };
10
12
  //# sourceMappingURL=NavMainLink.styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NavMainLink.styled.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
1
+ {"version":3,"file":"NavMainLink.styled.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
@@ -0,0 +1,25 @@
1
+ import { __rest, __assign } from '../../../../_virtual/_tslib.js';
2
+ import React, { useEffect } from 'react';
3
+ import { SearchBarContainer, SearchLeftIcon, SearchInput, SearchRightLabel, SearchResultContainer } from './SearchBar.styles.js';
4
+
5
+ var SearchBar = function (_a) {
6
+ var flexGrow = _a.flexGrow, isValid = _a.isValid, _b = _a.inputSize, inputSize = _b === void 0 ? 'medium' : _b, activeBorderColor = _a.activeBorderColor, cancelLabel = _a.cancelLabel, icon = _a.icon, value = _a.value, resultBoxTopPosition = _a.resultBoxTopPosition, children = _a.children, inputRef = _a.inputRef, isOpen = _a.isOpen, onCancelClick = _a.onCancelClick, props = __rest(_a, ["flexGrow", "isValid", "inputSize", "activeBorderColor", "cancelLabel", "icon", "value", "resultBoxTopPosition", "children", "inputRef", "isOpen", "onCancelClick"]);
7
+ useEffect(function () {
8
+ var _a;
9
+ if (inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) {
10
+ (_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
11
+ }
12
+ }, [inputRef === null || inputRef === void 0 ? void 0 : inputRef.current]);
13
+ return (React.createElement(React.Fragment, null,
14
+ React.createElement(SearchBarContainer, { activeBorderColor: activeBorderColor, inputSize: inputSize, flexGrow: flexGrow, isOpen: isOpen },
15
+ React.createElement(SearchLeftIcon, null, icon),
16
+ React.createElement(SearchInput, __assign({ flexGrow: flexGrow, isValid: isValid, inputSize: inputSize, activeBorderColor: activeBorderColor, ref: inputRef }, props, { value: value })),
17
+ cancelLabel ? (React.createElement(SearchRightLabel, { onClick: function (e) {
18
+ e.stopPropagation();
19
+ onCancelClick && onCancelClick();
20
+ }, isOpen: isOpen }, cancelLabel)) : null,
21
+ React.createElement(SearchResultContainer, { topPosition: resultBoxTopPosition, isOpen: isOpen }, children))));
22
+ };
23
+
24
+ export { SearchBar };
25
+ //# sourceMappingURL=SearchBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchBar.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,13 +1,13 @@
1
1
  import { __makeTemplateObject } from '../../../../_virtual/_tslib.js';
2
2
  import styled from 'styled-components';
3
3
 
4
- styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: ", ";\n position: absolute;\n top: ", ";\n left: 0;\n width: 100%;\n"], ["\n display: ", ";\n position: absolute;\n top: ", ";\n left: 0;\n width: 100%;\n"])), function (props) { return ((props === null || props === void 0 ? void 0 : props.isOpen) ? 'block' : 'none'); }, function (props) { var _a, _b; return (_a = props.topPosition) !== null && _a !== void 0 ? _a : "calc(100% + " + ((_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs) + "px)"; });
5
- styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: ", ";\n align-items: center;\n margin-left: ", "px;\n cursor: pointer;\n"], ["\n display: ", ";\n align-items: center;\n margin-left: ", "px;\n cursor: pointer;\n"])), function (props) { return ((props === null || props === void 0 ? void 0 : props.isOpen) ? 'flex' : 'none'); }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
6
- styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", ";\n\n position: relative;\n display: flex;\n justify-content: flex-end;\n\n @media (min-width: ", "px) {\n flex-direction: row-reverse;\n padding-left: ", "px;\n padding-right: ", "px;\n background: ", ";\n border-top: 1px solid ", ";\n border-radius: ", "px;\n ", "\n }\n"], ["\n ", ";\n\n position: relative;\n display: flex;\n justify-content: flex-end;\n\n @media (min-width: ", "px) {\n flex-direction: row-reverse;\n padding-left: ", "px;\n padding-right: ", "px;\n background: ", ";\n border-top: 1px solid ", ";\n border-radius: ", "px;\n ", "\n }\n"])), function (props) { return props.flexGrow && "flex: 1;"; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.lg; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lighter; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.medium; }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.extraSmall; }, function (props) {
4
+ var SearchResultContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: ", ";\n position: absolute;\n top: ", ";\n left: 0;\n width: 100%;\n"], ["\n display: ", ";\n position: absolute;\n top: ", ";\n left: 0;\n width: 100%;\n"])), function (props) { return ((props === null || props === void 0 ? void 0 : props.isOpen) ? 'block' : 'none'); }, function (props) { var _a, _b; return (_a = props.topPosition) !== null && _a !== void 0 ? _a : "calc(100% + " + ((_b = props.theme.spacings) === null || _b === void 0 ? void 0 : _b.xs) + "px)"; });
5
+ var SearchRightLabel = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: ", ";\n align-items: center;\n margin-left: ", "px;\n cursor: pointer;\n"], ["\n display: ", ";\n align-items: center;\n margin-left: ", "px;\n cursor: pointer;\n"])), function (props) { return ((props === null || props === void 0 ? void 0 : props.isOpen) ? 'flex' : 'none'); }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
6
+ var SearchBarContainer = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", ";\n\n position: relative;\n display: flex;\n justify-content: flex-end;\n\n @media (min-width: ", "px) {\n flex-direction: row-reverse;\n padding-left: ", "px;\n padding-right: ", "px;\n background: ", ";\n border-top: 1px solid ", ";\n border-radius: ", "px;\n ", "\n }\n"], ["\n ", ";\n\n position: relative;\n display: flex;\n justify-content: flex-end;\n\n @media (min-width: ", "px) {\n flex-direction: row-reverse;\n padding-left: ", "px;\n padding-right: ", "px;\n background: ", ";\n border-top: 1px solid ", ";\n border-radius: ", "px;\n ", "\n }\n"])), function (props) { return props.flexGrow && "flex: 1;"; }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.lg; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.sm; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.lighter; }, function (props) { var _a; return (_a = props.theme.palette) === null || _a === void 0 ? void 0 : _a.medium; }, function (props) { var _a; return (_a = props.theme.attributes) === null || _a === void 0 ? void 0 : _a.borderRadius.extraSmall; }, function (props) {
7
7
  return props.isOpen &&
8
8
  "\n flex-direction: row;\n box-shadow: inset 0 0 2px " + props.activeBorderColor + ";\n ";
9
9
  });
10
- styled.input(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: none;\n flex: 1;\n border: none;\n background: transparent;\n outline: none;\n font-size: ", "px;\n padding: ", "px;\n\n ::placeholder {\n /* Chrome, Firefox, Opera, Safari 10.1+ */\n color: ", ";\n opacity: 1; /* Firefox */\n }\n\n :-ms-input-placeholder {\n /* Internet Explorer 10-11 */\n color: ", ";\n }\n\n ::-ms-input-placeholder {\n /* Microsoft Edge */\n color: ", ";\n }\n @media (min-width: ", "px) {\n font-size: ", "px;\n }\n @media (min-width: ", "px) {\n display: block;\n }\n"], ["\n display: none;\n flex: 1;\n border: none;\n background: transparent;\n outline: none;\n font-size: ", "px;\n padding: ", "px;\n\n ::placeholder {\n /* Chrome, Firefox, Opera, Safari 10.1+ */\n color: ", ";\n opacity: 1; /* Firefox */\n }\n\n :-ms-input-placeholder {\n /* Internet Explorer 10-11 */\n color: ", ";\n }\n\n ::-ms-input-placeholder {\n /* Microsoft Edge */\n color: ", ";\n }\n @media (min-width: ", "px) {\n font-size: ", "px;\n }\n @media (min-width: ", "px) {\n display: block;\n }\n"])), function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.size.s2; }, function (props) {
10
+ var SearchInput = styled.input(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: none;\n flex: 1;\n border: none;\n background: transparent;\n outline: none;\n font-size: ", "px;\n padding: ", "px;\n\n ::placeholder {\n /* Chrome, Firefox, Opera, Safari 10.1+ */\n color: ", ";\n opacity: 1; /* Firefox */\n }\n\n :-ms-input-placeholder {\n /* Internet Explorer 10-11 */\n color: ", ";\n }\n\n ::-ms-input-placeholder {\n /* Microsoft Edge */\n color: ", ";\n }\n @media (min-width: ", "px) {\n font-size: ", "px;\n }\n @media (min-width: ", "px) {\n display: block;\n }\n"], ["\n display: none;\n flex: 1;\n border: none;\n background: transparent;\n outline: none;\n font-size: ", "px;\n padding: ", "px;\n\n ::placeholder {\n /* Chrome, Firefox, Opera, Safari 10.1+ */\n color: ", ";\n opacity: 1; /* Firefox */\n }\n\n :-ms-input-placeholder {\n /* Internet Explorer 10-11 */\n color: ", ";\n }\n\n ::-ms-input-placeholder {\n /* Microsoft Edge */\n color: ", ";\n }\n @media (min-width: ", "px) {\n font-size: ", "px;\n }\n @media (min-width: ", "px) {\n display: block;\n }\n"])), function (props) { var _a; return (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.size.s2; }, function (props) {
11
11
  var _a, _b;
12
12
  return props.inputSize === 'small'
13
13
  ? (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs
@@ -18,6 +18,8 @@ styled.input(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n
18
18
  ? (_a = props.theme.typography) === null || _a === void 0 ? void 0 : _a.size.s2
19
19
  : (_b = props.theme.typography) === null || _b === void 0 ? void 0 : _b.size.s3;
20
20
  }, function (props) { var _a; return (_a = props.theme.breakpoints) === null || _a === void 0 ? void 0 : _a.lg; });
21
- styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-right: ", "px;\n"], ["\n display: flex;\n align-items: center;\n margin-right: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
21
+ var SearchLeftIcon = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-right: ", "px;\n"], ["\n display: flex;\n align-items: center;\n margin-right: ", "px;\n"])), function (props) { var _a; return (_a = props.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs; });
22
22
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
23
+
24
+ export { SearchBarContainer, SearchInput, SearchLeftIcon, SearchResultContainer, SearchRightLabel };
23
25
  //# sourceMappingURL=SearchBar.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBar.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"SearchBar.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -69,9 +69,9 @@ import '../../containers/TwoColumnsContainer/TwoColumnsPageContainer.styles.js';
69
69
  import '../UnorderedList/UnorderedList.styles.js';
70
70
  import { WarningIndicator } from './WarningLabel.styles.js';
71
71
  import '../MobileTable/MobileTable.styles.js';
72
- import '../NavMainLink/NavMainLink.styled.js';
73
72
  import '../SearchBar/SearchBar.styles.js';
74
73
  import '../Nav/Nav.styles.js';
74
+ import '../NavMainLink/NavMainLink.styled.js';
75
75
  import 'framer-motion';
76
76
  import '../SideModal/SideModal.styles.js';
77
77
  import '../IconText/IconText.styles.js';
@@ -60,14 +60,11 @@ export { TwoColumnsPageContainer } from './containers/TwoColumnsContainer/TwoCol
60
60
  export { UnorderedList, UnorderedListItem } from './components/UnorderedList/UnorderedList.styles.js';
61
61
  export { WarningLabel } from './components/WarningLabel/WarningLabel.js';
62
62
  export { MobileLabel, MobileTable, MobileTd } from './components/MobileTable/MobileTable.styles.js';
63
- import '@citygross/design-tokens';
64
- import '@citygross/utils';
65
- import 'react';
66
- import './components/NavMainLink/NavMainLink.styled.js';
67
- import './components/SearchBar/SearchBar.styles.js';
68
- import './components/Nav/Nav.styles.js';
63
+ export { Nav } from './components/Nav/Nav.js';
64
+ export { NavMainLink } from './components/NavMainLink/NavMainLink.js';
65
+ export { SearchBar } from './components/SearchBar/SearchBar.js';
69
66
  export { SideModal } from './components/SideModal/SideModal.js';
70
- import './components/IconText/IconText.styles.js';
67
+ export { IconText } from './components/IconText/IconText.js';
71
68
  export { Logo } from './components/Logo/Logo.js';
72
69
  export { Dropdown } from './components/Dropdown/Dropdown.js';
73
70
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citygross/components",
3
- "version": "0.7.80",
3
+ "version": "0.7.82",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "./build/cjs/components/src/index.js",
@@ -71,5 +71,5 @@
71
71
  "moment": "^2.29.1",
72
72
  "react-loading-skeleton": "^2.2.0"
73
73
  },
74
- "gitHead": "08e4bf5ca179bcfca31e82cc5797a128181fc124"
74
+ "gitHead": "deb2bd9f4c54ae9de1a5034c4223f0d3d1752d5e"
75
75
  }