@citygross/components 0.8.180 → 0.8.182
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/@types/components/CgButton/CgButton.styles.d.ts +1 -1
- package/build/@types/index.d.ts +0 -2
- package/build/cjs/components/src/components/AddressBlock/AddressBlock.js +0 -3
- package/build/cjs/components/src/components/AddressBlock/AddressBlock.js.map +1 -1
- package/build/cjs/components/src/components/CgButton/CgButton.styles.js +5 -1
- package/build/cjs/components/src/components/CgButton/CgButton.styles.js.map +1 -1
- package/build/cjs/components/src/components/WarningLabel/WarningLabel.js +0 -3
- package/build/cjs/components/src/components/WarningLabel/WarningLabel.js.map +1 -1
- package/build/cjs/components/src/index.js +0 -4
- package/build/cjs/components/src/index.js.map +1 -1
- package/build/es/components/src/components/AddressBlock/AddressBlock.js +0 -3
- package/build/es/components/src/components/AddressBlock/AddressBlock.js.map +1 -1
- package/build/es/components/src/components/CgButton/CgButton.styles.js +5 -1
- package/build/es/components/src/components/CgButton/CgButton.styles.js.map +1 -1
- package/build/es/components/src/components/WarningLabel/WarningLabel.js +0 -3
- package/build/es/components/src/components/WarningLabel/WarningLabel.js.map +1 -1
- package/build/es/components/src/index.js +0 -2
- package/build/es/components/src/index.js.map +1 -1
- package/package.json +2 -2
- package/build/@types/components/Nav/Nav.d.ts +0 -27
- package/build/@types/components/Nav/Nav.styles.d.ts +0 -23
- package/build/@types/components/SearchBar/SearchBar.d.ts +0 -15
- package/build/@types/components/SearchBar/SearchBar.styles.d.ts +0 -23
- package/build/cjs/components/src/components/Nav/Nav.js +0 -109
- package/build/cjs/components/src/components/Nav/Nav.js.map +0 -1
- package/build/cjs/components/src/components/Nav/Nav.styles.js +0 -53
- package/build/cjs/components/src/components/Nav/Nav.styles.js.map +0 -1
- package/build/cjs/components/src/components/SearchBar/SearchBar.js +0 -73
- package/build/cjs/components/src/components/SearchBar/SearchBar.js.map +0 -1
- package/build/cjs/components/src/components/SearchBar/SearchBar.styles.js +0 -141
- package/build/cjs/components/src/components/SearchBar/SearchBar.styles.js.map +0 -1
- package/build/es/components/src/components/Nav/Nav.js +0 -101
- package/build/es/components/src/components/Nav/Nav.js.map +0 -1
- package/build/es/components/src/components/Nav/Nav.styles.js +0 -40
- package/build/es/components/src/components/Nav/Nav.styles.js.map +0 -1
- package/build/es/components/src/components/SearchBar/SearchBar.js +0 -65
- package/build/es/components/src/components/SearchBar/SearchBar.js.map +0 -1
- package/build/es/components/src/components/SearchBar/SearchBar.styles.js +0 -126
- package/build/es/components/src/components/SearchBar/SearchBar.styles.js.map +0 -1
|
@@ -3,7 +3,7 @@ export declare const ButtonStyle: import("styled-components").StyledComponent<"b
|
|
|
3
3
|
sizeAttributes: import("./CgButton.types").TButtonSizeAttributes;
|
|
4
4
|
variantAttributes: import("./CgButton.types").TButtonVariantAttributes;
|
|
5
5
|
}, never>;
|
|
6
|
-
export declare const ChildrenContainer: import("styled-components").StyledComponent<"
|
|
6
|
+
export declare const ChildrenContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TChildrenContainer, never>;
|
|
7
7
|
export declare const SpinnerContainer: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
8
8
|
export declare const DivAsButton: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, Omit<import("./CgButton.types").TCgButtonRoot, "children" | "loading" | "variant"> & {
|
|
9
9
|
sizeAttributes: import("./CgButton.types").TButtonSizeAttributes;
|
package/build/@types/index.d.ts
CHANGED
|
@@ -54,7 +54,6 @@ export * from './components/MenuListItem/MenuListHeader';
|
|
|
54
54
|
export * from './components/MenuListItem/MenuListItem';
|
|
55
55
|
export * from './components/MobileTable';
|
|
56
56
|
export * from './components/Modal/Modal';
|
|
57
|
-
export * from './components/Nav/Nav';
|
|
58
57
|
export * from './components/NavMainLink/NavMainLink';
|
|
59
58
|
export * from './components/Pagination/Pagination';
|
|
60
59
|
export * from './components/Pill/Pill';
|
|
@@ -70,7 +69,6 @@ export * from './components/RadioGroup';
|
|
|
70
69
|
export * from './components/RadioListItem/RadioListItem';
|
|
71
70
|
export * from './components/RippleContainer/RippleContainer';
|
|
72
71
|
export * from './components/ScreenReader/ScreenReader';
|
|
73
|
-
export * from './components/SearchBar/SearchBar';
|
|
74
72
|
export * from './components/SearchListItem/SearchListItem';
|
|
75
73
|
export * from './components/SearchSuggestionChip/SearchSuggestionChip';
|
|
76
74
|
export * from './components/SelectButton/SelectButton';
|
|
@@ -72,9 +72,6 @@ require('../MenuListItem/MenuListItem.styles.js');
|
|
|
72
72
|
require('../MenuListDropdown/MenuListDropdown.styles.js');
|
|
73
73
|
require('../MobileTable/MobileTable.styles.js');
|
|
74
74
|
require('../Modal/Modal.js');
|
|
75
|
-
require('styled-components');
|
|
76
|
-
require('../SearchBar/SearchBar.styles.js');
|
|
77
|
-
require('../Nav/Nav.styles.js');
|
|
78
75
|
require('../NavMainLink/NavMainLink.styled.js');
|
|
79
76
|
require('../Pagination/Pagination.styles.js');
|
|
80
77
|
require('../Pill/Pill.styles.js');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -80,7 +80,11 @@ var ButtonStyle = styled__default["default"].button(templateObject_2 || (templat
|
|
|
80
80
|
var theme = _a.theme;
|
|
81
81
|
return (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.placeholder;
|
|
82
82
|
});
|
|
83
|
-
var ChildrenContainer = styled__default["default"].
|
|
83
|
+
var ChildrenContainer = styled__default["default"].div(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: ", "px;\n opacity: ", ";\n"], ["\n display: flex;\n align-items: center;\n gap: ", "px;\n opacity: ", ";\n"])), function (_a) {
|
|
84
|
+
var _b;
|
|
85
|
+
var theme = _a.theme;
|
|
86
|
+
return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xs;
|
|
87
|
+
}, function (_a) {
|
|
84
88
|
var loading = _a.loading;
|
|
85
89
|
return (loading ? 0 : 1);
|
|
86
90
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CgButton.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CgButton.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -72,9 +72,6 @@ require('../MenuListItem/MenuListItem.styles.js');
|
|
|
72
72
|
require('../MenuListDropdown/MenuListDropdown.styles.js');
|
|
73
73
|
require('../MobileTable/MobileTable.styles.js');
|
|
74
74
|
require('../Modal/Modal.js');
|
|
75
|
-
require('styled-components');
|
|
76
|
-
require('../SearchBar/SearchBar.styles.js');
|
|
77
|
-
require('../Nav/Nav.styles.js');
|
|
78
75
|
require('../NavMainLink/NavMainLink.styled.js');
|
|
79
76
|
require('../Pagination/Pagination.styles.js');
|
|
80
77
|
require('../Pill/Pill.styles.js');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -61,7 +61,6 @@ var MenuListHeader = require('./components/MenuListItem/MenuListHeader.js');
|
|
|
61
61
|
var MenuListItem = require('./components/MenuListItem/MenuListItem.js');
|
|
62
62
|
var MobileTable_styles = require('./components/MobileTable/MobileTable.styles.js');
|
|
63
63
|
var Modal = require('./components/Modal/Modal.js');
|
|
64
|
-
var Nav = require('./components/Nav/Nav.js');
|
|
65
64
|
var NavMainLink = require('./components/NavMainLink/NavMainLink.js');
|
|
66
65
|
var Pagination = require('./components/Pagination/Pagination.js');
|
|
67
66
|
var Pill = require('./components/Pill/Pill.js');
|
|
@@ -78,7 +77,6 @@ var RadioGroup = require('./components/RadioGroup/RadioGroup.js');
|
|
|
78
77
|
var RadioListItem = require('./components/RadioListItem/RadioListItem.js');
|
|
79
78
|
var RippleContainer = require('./components/RippleContainer/RippleContainer.js');
|
|
80
79
|
var ScreenReader = require('./components/ScreenReader/ScreenReader.js');
|
|
81
|
-
var SearchBar = require('./components/SearchBar/SearchBar.js');
|
|
82
80
|
var SearchListItem = require('./components/SearchListItem/SearchListItem.js');
|
|
83
81
|
var SearchSuggestionChip = require('./components/SearchSuggestionChip/SearchSuggestionChip.js');
|
|
84
82
|
var SelectButton = require('./components/SelectButton/SelectButton.js');
|
|
@@ -216,7 +214,6 @@ exports.MobileLabel = MobileTable_styles.MobileLabel;
|
|
|
216
214
|
exports.MobileTable = MobileTable_styles.MobileTable;
|
|
217
215
|
exports.MobileTd = MobileTable_styles.MobileTd;
|
|
218
216
|
exports.Modal = Modal.Modal;
|
|
219
|
-
exports.Nav = Nav.Nav;
|
|
220
217
|
exports.NavMainLink = NavMainLink.NavMainLink;
|
|
221
218
|
exports.Pagination = Pagination.Pagination;
|
|
222
219
|
exports.Pill = Pill.Pill;
|
|
@@ -247,7 +244,6 @@ exports.RadioGroup = RadioGroup.RadioGroup;
|
|
|
247
244
|
exports.RadioListItem = RadioListItem.RadioListItem;
|
|
248
245
|
exports.RippleContainer = RippleContainer.RippleContainer;
|
|
249
246
|
exports.ScreenReader = ScreenReader.ScreenReader;
|
|
250
|
-
exports.SearchBar = SearchBar.SearchBar;
|
|
251
247
|
exports.SearchListItem = SearchListItem.SearchListItem;
|
|
252
248
|
exports.SearchSuggestionChip = SearchSuggestionChip.SearchSuggestionChip;
|
|
253
249
|
exports.SelectButton = SelectButton.SelectButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -68,9 +68,6 @@ import '../MenuListItem/MenuListItem.styles.js';
|
|
|
68
68
|
import '../MenuListDropdown/MenuListDropdown.styles.js';
|
|
69
69
|
import '../MobileTable/MobileTable.styles.js';
|
|
70
70
|
import '../Modal/Modal.js';
|
|
71
|
-
import 'styled-components';
|
|
72
|
-
import '../SearchBar/SearchBar.styles.js';
|
|
73
|
-
import '../Nav/Nav.styles.js';
|
|
74
71
|
import '../NavMainLink/NavMainLink.styled.js';
|
|
75
72
|
import '../Pagination/Pagination.styles.js';
|
|
76
73
|
import '../Pill/Pill.styles.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -72,7 +72,11 @@ var ButtonStyle = styled.button(templateObject_2 || (templateObject_2 = __makeTe
|
|
|
72
72
|
var theme = _a.theme;
|
|
73
73
|
return (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.placeholder;
|
|
74
74
|
});
|
|
75
|
-
var ChildrenContainer = styled.
|
|
75
|
+
var ChildrenContainer = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: ", "px;\n opacity: ", ";\n"], ["\n display: flex;\n align-items: center;\n gap: ", "px;\n opacity: ", ";\n"])), function (_a) {
|
|
76
|
+
var _b;
|
|
77
|
+
var theme = _a.theme;
|
|
78
|
+
return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xs;
|
|
79
|
+
}, function (_a) {
|
|
76
80
|
var loading = _a.loading;
|
|
77
81
|
return (loading ? 0 : 1);
|
|
78
82
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CgButton.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CgButton.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -68,9 +68,6 @@ import '../MenuListItem/MenuListItem.styles.js';
|
|
|
68
68
|
import '../MenuListDropdown/MenuListDropdown.styles.js';
|
|
69
69
|
import '../MobileTable/MobileTable.styles.js';
|
|
70
70
|
import '../Modal/Modal.js';
|
|
71
|
-
import 'styled-components';
|
|
72
|
-
import '../SearchBar/SearchBar.styles.js';
|
|
73
|
-
import '../Nav/Nav.styles.js';
|
|
74
71
|
import '../NavMainLink/NavMainLink.styled.js';
|
|
75
72
|
import '../Pagination/Pagination.styles.js';
|
|
76
73
|
import '../Pill/Pill.styles.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -57,7 +57,6 @@ export { MenuListHeader } from './components/MenuListItem/MenuListHeader.js';
|
|
|
57
57
|
export { MenuListItem } from './components/MenuListItem/MenuListItem.js';
|
|
58
58
|
export { MobileLabel, MobileTable, MobileTd } from './components/MobileTable/MobileTable.styles.js';
|
|
59
59
|
export { Modal } from './components/Modal/Modal.js';
|
|
60
|
-
export { Nav } from './components/Nav/Nav.js';
|
|
61
60
|
export { NavMainLink } from './components/NavMainLink/NavMainLink.js';
|
|
62
61
|
export { Pagination } from './components/Pagination/Pagination.js';
|
|
63
62
|
export { Pill } from './components/Pill/Pill.js';
|
|
@@ -74,7 +73,6 @@ export { RadioGroup } from './components/RadioGroup/RadioGroup.js';
|
|
|
74
73
|
export { RadioListItem } from './components/RadioListItem/RadioListItem.js';
|
|
75
74
|
export { RippleContainer } from './components/RippleContainer/RippleContainer.js';
|
|
76
75
|
export { ScreenReader } from './components/ScreenReader/ScreenReader.js';
|
|
77
|
-
export { SearchBar } from './components/SearchBar/SearchBar.js';
|
|
78
76
|
export { SearchListItem } from './components/SearchListItem/SearchListItem.js';
|
|
79
77
|
export { SearchSuggestionChip } from './components/SearchSuggestionChip/SearchSuggestionChip.js';
|
|
80
78
|
export { SelectButton } from './components/SelectButton/SelectButton.js';
|
|
@@ -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.8.
|
|
3
|
+
"version": "0.8.182",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./build/cjs/components/src/index.js",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"react-slick": "^0.30.1",
|
|
75
75
|
"slick-carousel": "^1.8.1"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "7465a35eca1a8dd9be16b1538119b30db29f1768"
|
|
78
78
|
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React, { ChangeEventHandler } from 'react';
|
|
2
|
-
export declare type TNav = {
|
|
3
|
-
closeSearch?: () => void;
|
|
4
|
-
height?: number;
|
|
5
|
-
inputIcon?: React.ReactNode;
|
|
6
|
-
logo: React.ReactNode;
|
|
7
|
-
mainLinks?: React.ReactNode[];
|
|
8
|
-
maxWidth?: number;
|
|
9
|
-
mobileTopPosition?: number;
|
|
10
|
-
onSearchBlur?: () => void;
|
|
11
|
-
onSearchClick?: () => void;
|
|
12
|
-
overlayTopPosition?: number;
|
|
13
|
-
rightContent?: React.ReactNode;
|
|
14
|
-
searchCancelLabel?: React.ReactNode;
|
|
15
|
-
searchContainerRef: React.RefObject<HTMLDivElement>;
|
|
16
|
-
searchIcon?: React.ReactNode;
|
|
17
|
-
searchInputMobileRef: React.RefObject<HTMLInputElement>;
|
|
18
|
-
searchInputRef: React.RefObject<HTMLInputElement>;
|
|
19
|
-
searchIsOpen?: boolean;
|
|
20
|
-
searchOnChange?: ChangeEventHandler<HTMLInputElement>;
|
|
21
|
-
searchOnSubmit?: () => void;
|
|
22
|
-
searchPlaceHolder?: string;
|
|
23
|
-
searchResultElement?: React.ReactNode;
|
|
24
|
-
searchValue?: string;
|
|
25
|
-
topPosition?: number;
|
|
26
|
-
};
|
|
27
|
-
export declare const Nav: ({ closeSearch, height, inputIcon, logo, mainLinks, maxWidth, mobileTopPosition, onSearchBlur, onSearchClick, overlayTopPosition, rightContent, searchCancelLabel, searchContainerRef, searchIcon, searchInputMobileRef, searchInputRef, searchIsOpen, searchOnChange, searchOnSubmit, searchPlaceHolder, searchResultElement, searchValue, topPosition }: TNav) => JSX.Element;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
declare type TNav = {
|
|
2
|
-
background?: string;
|
|
3
|
-
height?: number;
|
|
4
|
-
topPosition?: number;
|
|
5
|
-
};
|
|
6
|
-
declare type TNavContainer = {
|
|
7
|
-
maxWidth?: number;
|
|
8
|
-
};
|
|
9
|
-
declare type TNavSearchOverlay = {
|
|
10
|
-
overlayTopPosition?: number;
|
|
11
|
-
show?: boolean;
|
|
12
|
-
};
|
|
13
|
-
declare type TSearchIsOpen = {
|
|
14
|
-
isOpen?: boolean;
|
|
15
|
-
};
|
|
16
|
-
export declare const Nav: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TNav, never>;
|
|
17
|
-
export declare const NavContainer: import("styled-components").StyledComponent<"nav", import("styled-components").DefaultTheme, TNavContainer, never>;
|
|
18
|
-
export declare const NavChildContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
19
|
-
export declare const NavMainLinks: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, import("styled-components").DefaultTheme, {}, never>;
|
|
20
|
-
export declare const SearchContainer: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, import("styled-components").DefaultTheme, TSearchIsOpen, never>;
|
|
21
|
-
export declare const NavSearchContainer: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, import("styled-components").DefaultTheme, TSearchIsOpen, never>;
|
|
22
|
-
export declare const SearchResultOverlay: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TNavSearchOverlay, never>;
|
|
23
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React, { InputHTMLAttributes } from 'react';
|
|
2
|
-
import * as styles from './SearchBar.styles';
|
|
3
|
-
export declare type TSearchBar = styles.TSearchInput & {
|
|
4
|
-
cancelLabel?: React.ReactNode;
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
icon?: React.ReactNode;
|
|
7
|
-
inputIcon?: React.ReactNode;
|
|
8
|
-
inputRef?: React.RefObject<HTMLInputElement>;
|
|
9
|
-
isOpen?: boolean;
|
|
10
|
-
mobileTopPosition?: number;
|
|
11
|
-
resultBoxTopPosition?: string;
|
|
12
|
-
searchInputMobileRef?: React.RefObject<HTMLInputElement>;
|
|
13
|
-
searchOnSubmit?: () => void;
|
|
14
|
-
} & InputHTMLAttributes<HTMLInputElement>;
|
|
15
|
-
export declare const SearchBar: ({ activeBorderColor, cancelLabel, children, flexGrow, icon, inputIcon, inputRef, inputSize, isOpen, isValid, mobileTopPosition, resultBoxTopPosition, searchInputMobileRef, searchOnSubmit, value, ...props }: TSearchBar) => JSX.Element;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export declare type TSearchInput = {
|
|
2
|
-
activeBorderColor?: string;
|
|
3
|
-
flexGrow?: boolean;
|
|
4
|
-
hideInMobile?: boolean;
|
|
5
|
-
inputSize?: 'small' | 'medium';
|
|
6
|
-
isOpen?: boolean;
|
|
7
|
-
isValid?: boolean;
|
|
8
|
-
};
|
|
9
|
-
declare type TSearchResultContainer = {
|
|
10
|
-
background?: string;
|
|
11
|
-
isOpen?: boolean;
|
|
12
|
-
mobileTopPosition?: number;
|
|
13
|
-
topPosition?: string;
|
|
14
|
-
};
|
|
15
|
-
export declare const SearchResultContainer: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, import("styled-components").DefaultTheme, TSearchResultContainer, never>;
|
|
16
|
-
export declare const SearchRightLabel: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, import("styled-components").DefaultTheme, {}, never>;
|
|
17
|
-
export declare const SearchBarContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TSearchInput, never>;
|
|
18
|
-
export declare const SearchInput: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, TSearchInput, never>;
|
|
19
|
-
export declare const MobileSearchFormContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
20
|
-
export declare const SearchForm: import("styled-components").StyledComponent<"form", import("styled-components").DefaultTheme, TSearchInput, never>;
|
|
21
|
-
export declare const MobileSearchIconContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
22
|
-
export declare const SearchLeftIcon: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
23
|
-
export {};
|
|
@@ -1,109 +0,0 @@
|
|
|
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, _d, _e;
|
|
17
|
-
var closeSearch = _a.closeSearch, height = _a.height, inputIcon = _a.inputIcon, logo = _a.logo, mainLinks = _a.mainLinks, maxWidth = _a.maxWidth, mobileTopPosition = _a.mobileTopPosition, onSearchBlur = _a.onSearchBlur, onSearchClick = _a.onSearchClick, overlayTopPosition = _a.overlayTopPosition, rightContent = _a.rightContent, searchCancelLabel = _a.searchCancelLabel, searchContainerRef = _a.searchContainerRef, searchIcon = _a.searchIcon, searchInputMobileRef = _a.searchInputMobileRef, searchInputRef = _a.searchInputRef, searchIsOpen = _a.searchIsOpen, searchOnChange = _a.searchOnChange, searchOnSubmit = _a.searchOnSubmit, searchPlaceHolder = _a.searchPlaceHolder, searchResultElement = _a.searchResultElement, searchValue = _a.searchValue, topPosition = _a.topPosition;
|
|
18
|
-
var navContainerRef = React.useRef(null);
|
|
19
|
-
var navChildContainerRef = React.useRef(null);
|
|
20
|
-
var navRef = React.useRef(null);
|
|
21
|
-
var width = utils.useWindowSize().width;
|
|
22
|
-
var _f = React.useState(width), localWidth = _f[0], setLocalWidth = _f[1];
|
|
23
|
-
var _g = React.useState(0), elToRemove = _g[0], setElToRemove = _g[1];
|
|
24
|
-
var widthRef = React.useRef(null);
|
|
25
|
-
var checkWidth = function () {
|
|
26
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
27
|
-
var containerWidth = (_b = (_a = navRef === null || navRef === void 0 ? void 0 : navRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) !== null && _b !== void 0 ? _b : 0;
|
|
28
|
-
var containerScrollWidth = (_d = (_c = navRef === null || navRef === void 0 ? void 0 : navRef.current) === null || _c === void 0 ? void 0 : _c.scrollWidth) !== null && _d !== void 0 ? _d : 0;
|
|
29
|
-
var childContainerWidth = (_f = (_e = navChildContainerRef === null || navChildContainerRef === void 0 ? void 0 : navChildContainerRef.current) === null || _e === void 0 ? void 0 : _e.offsetWidth) !== null && _f !== void 0 ? _f : 0;
|
|
30
|
-
// assuming mainLinks max width
|
|
31
|
-
var maxMainLinkWidth = (_h = (_g = designTokens.theme.constants) === null || _g === void 0 ? void 0 : _g.navMainLinkWidth) !== null && _h !== void 0 ? _h : 105;
|
|
32
|
-
var currentWidht = containerWidth;
|
|
33
|
-
var removeLength = 0;
|
|
34
|
-
while (currentWidht < containerScrollWidth) {
|
|
35
|
-
currentWidht += maxMainLinkWidth;
|
|
36
|
-
removeLength += 1;
|
|
37
|
-
}
|
|
38
|
-
if (width <= localWidth &&
|
|
39
|
-
(navRef === null || navRef === void 0 ? void 0 : navRef.current) &&
|
|
40
|
-
(containerScrollWidth > containerWidth ||
|
|
41
|
-
((navChildContainerRef === null || navChildContainerRef === void 0 ? void 0 : navChildContainerRef.current) && childContainerWidth > containerWidth))) {
|
|
42
|
-
setElToRemove(function (prev) { return prev + removeLength; });
|
|
43
|
-
widthRef.current = width;
|
|
44
|
-
}
|
|
45
|
-
else if (width > localWidth &&
|
|
46
|
-
(((widthRef === null || widthRef === void 0 ? void 0 : widthRef.current) && width >= (widthRef === null || widthRef === void 0 ? void 0 : widthRef.current)) || elToRemove > 0)) {
|
|
47
|
-
if (elToRemove) {
|
|
48
|
-
setElToRemove(function (prev) { return prev - 1; });
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
setLocalWidth(width);
|
|
52
|
-
};
|
|
53
|
-
React.useEffect(function () {
|
|
54
|
-
var debounce = setTimeout(function () {
|
|
55
|
-
checkWidth === null || checkWidth === void 0 ? void 0 : checkWidth();
|
|
56
|
-
}, 300);
|
|
57
|
-
return function () {
|
|
58
|
-
clearTimeout(debounce);
|
|
59
|
-
};
|
|
60
|
-
}, [
|
|
61
|
-
width,
|
|
62
|
-
(_b = navRef === null || navRef === void 0 ? void 0 : navRef.current) === null || _b === void 0 ? void 0 : _b.offsetWidth,
|
|
63
|
-
(_c = navChildContainerRef === null || navChildContainerRef === void 0 ? void 0 : navChildContainerRef.current) === null || _c === void 0 ? void 0 : _c.offsetWidth,
|
|
64
|
-
localWidth
|
|
65
|
-
]);
|
|
66
|
-
React.useEffect(function () {
|
|
67
|
-
var handleClick = function (event) {
|
|
68
|
-
var _a;
|
|
69
|
-
if ((navContainerRef === null || navContainerRef === void 0 ? void 0 : navContainerRef.current) &&
|
|
70
|
-
!((_a = navContainerRef === null || navContainerRef === void 0 ? void 0 : navContainerRef.current) === null || _a === void 0 ? void 0 : _a.contains(event === null || event === void 0 ? void 0 : event.target))) {
|
|
71
|
-
closeSearch === null || closeSearch === void 0 ? void 0 : closeSearch();
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
document.addEventListener('click', handleClick, true);
|
|
75
|
-
return function () {
|
|
76
|
-
document.removeEventListener('click', handleClick, true);
|
|
77
|
-
};
|
|
78
|
-
}, [closeSearch, navContainerRef]);
|
|
79
|
-
var variants = {
|
|
80
|
-
closed: {
|
|
81
|
-
width: '0',
|
|
82
|
-
transition: {
|
|
83
|
-
duration: 0.1,
|
|
84
|
-
ease: 'linear'
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
open: {
|
|
88
|
-
width: 'auto',
|
|
89
|
-
transition: { duration: 0.1, ease: 'linear' }
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
return (React__default["default"].createElement(Nav_styles.Nav, { height: height, topPosition: topPosition, ref: navRef },
|
|
93
|
-
React__default["default"].createElement(Nav_styles.NavContainer, { maxWidth: maxWidth, ref: navContainerRef },
|
|
94
|
-
logo,
|
|
95
|
-
React__default["default"].createElement(Nav_styles.NavChildContainer, { ref: navChildContainerRef },
|
|
96
|
-
React__default["default"].createElement(React.Fragment, null,
|
|
97
|
-
React__default["default"].createElement(Nav_styles.NavMainLinks, { variants: variants, animate: designTokens.theme.constants && width < ((_d = designTokens.theme.constants) === null || _d === void 0 ? void 0 : _d.headerBreakpoint)
|
|
98
|
-
? false
|
|
99
|
-
: searchIsOpen
|
|
100
|
-
? 'closed'
|
|
101
|
-
: 'open', initial: "open" }, (_e = mainLinks === null || mainLinks === void 0 ? void 0 : mainLinks.slice(0, (mainLinks === null || mainLinks === void 0 ? void 0 : mainLinks.length) - elToRemove)) === null || _e === void 0 ? void 0 : _e.map(function (link) { return link; })),
|
|
102
|
-
React__default["default"].createElement(Nav_styles.SearchContainer, { isOpen: searchIsOpen, ref: searchContainerRef },
|
|
103
|
-
React__default["default"].createElement(SearchBar.SearchBar, { cancelLabel: searchCancelLabel, flexGrow: true, icon: searchIcon, inputIcon: inputIcon, inputRef: searchInputRef, isOpen: searchIsOpen, mobileTopPosition: mobileTopPosition, onBlur: onSearchBlur, onChange: searchOnChange, onClick: function () { return onSearchClick === null || onSearchClick === void 0 ? void 0 : onSearchClick(); }, onKeyDown: function (e) { return e.key === 'Enter' && (onSearchClick === null || onSearchClick === void 0 ? void 0 : onSearchClick()); }, placeholder: searchPlaceHolder, searchInputMobileRef: searchInputMobileRef, searchOnSubmit: searchOnSubmit, value: searchValue }, searchResultElement))),
|
|
104
|
-
rightContent)),
|
|
105
|
-
React__default["default"].createElement(Nav_styles.SearchResultOverlay, { show: searchIsOpen, overlayTopPosition: overlayTopPosition })));
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
exports.Nav = Nav;
|
|
109
|
-
//# sourceMappingURL=Nav.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Nav.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var _tslib = require('../../../../_virtual/_tslib.js');
|
|
6
|
-
var designTokens = require('@citygross/design-tokens');
|
|
7
|
-
var framerMotion = require('framer-motion');
|
|
8
|
-
var styled = require('styled-components');
|
|
9
|
-
|
|
10
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
-
|
|
12
|
-
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
13
|
-
|
|
14
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
15
|
-
var Nav = styled__default["default"].div(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n background: ", ";\n display: flex;\n align-items: center;\n width: 100%;\n height: ", "px;\n"], ["\n background: ", ";\n display: flex;\n align-items: center;\n width: 100%;\n height: ", "px;\n"])), function (_a) {
|
|
16
|
-
var _b;
|
|
17
|
-
var background = _a.background;
|
|
18
|
-
return background !== null && background !== void 0 ? background : (_b = designTokens.theme.palette) === null || _b === void 0 ? void 0 : _b.white;
|
|
19
|
-
}, function (_a) {
|
|
20
|
-
var _b;
|
|
21
|
-
var height = _a.height;
|
|
22
|
-
return height !== null && height !== void 0 ? height : (_b = designTokens.theme.constants) === null || _b === void 0 ? void 0 : _b.navHeaderHeightSmall;
|
|
23
|
-
});
|
|
24
|
-
var NavContainer = styled__default["default"].nav(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n display: flex;\n margin: 0 auto;\n max-width: ", "px;\n padding: ", "px;\n width: 100%;\n\n @media (min-width: ", "px) {\n padding: ", "px ", "px;\n }\n"], ["\n display: flex;\n margin: 0 auto;\n max-width: ", "px;\n padding: ", "px;\n width: 100%;\n\n @media (min-width: ", "px) {\n padding: ", "px ", "px;\n }\n"])), function (_a) {
|
|
25
|
-
var maxWidth = _a.maxWidth;
|
|
26
|
-
return maxWidth;
|
|
27
|
-
}, (_a = designTokens.theme.spacings) === null || _a === void 0 ? void 0 : _a.xs, (_b = designTokens.theme.constants) === null || _b === void 0 ? void 0 : _b.headerBreakpoint, (_c = designTokens.theme.spacings) === null || _c === void 0 ? void 0 : _c.xs, (_d = designTokens.theme.spacings) === null || _d === void 0 ? void 0 : _d.sm);
|
|
28
|
-
var NavChildContainer = styled__default["default"].div(templateObject_3 || (templateObject_3 = _tslib.__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: flex-end;\n flex: 1;\n z-index: ", ";\n"], ["\n display: flex;\n align-items: center;\n justify-content: flex-end;\n flex: 1;\n z-index: ", ";\n"])), (_e = designTokens.theme.attributes) === null || _e === void 0 ? void 0 : _e.zIndex.middle);
|
|
29
|
-
var NavMainLinks = styled__default["default"](framerMotion.motion.div)(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n display: none;\n\n @media (min-width: ", "px) {\n display: flex;\n align-items: center;\n gap: ", "px;\n margin-left: ", "px;\n width: auto;\n height: 100%;\n }\n"], ["\n display: none;\n\n @media (min-width: ", "px) {\n display: flex;\n align-items: center;\n gap: ", "px;\n margin-left: ", "px;\n width: auto;\n height: 100%;\n }\n"])), (_f = designTokens.theme.constants) === null || _f === void 0 ? void 0 : _f.headerBreakpoint, (_g = designTokens.theme.spacings) === null || _g === void 0 ? void 0 : _g.sm, (_h = designTokens.theme.spacings) === null || _h === void 0 ? void 0 : _h.sm);
|
|
30
|
-
var SearchContainer = styled__default["default"](framerMotion.motion.div)(templateObject_5 || (templateObject_5 = _tslib.__makeTemplateObject(["\n display: flex;\n align-items: center;\n flex: 1;\n margin-left: ", "px;\n"], ["\n display: flex;\n align-items: center;\n flex: 1;\n margin-left: ", "px;\n"])), function (_a) {
|
|
31
|
-
var _b;
|
|
32
|
-
var isOpen = _a.isOpen;
|
|
33
|
-
return (isOpen ? 0 : (_b = designTokens.theme.spacings) === null || _b === void 0 ? void 0 : _b.sm);
|
|
34
|
-
});
|
|
35
|
-
styled__default["default"](SearchContainer)(templateObject_6 || (templateObject_6 = _tslib.__makeTemplateObject(["\n display: flex;\n"], ["\n display: flex;\n"])));
|
|
36
|
-
var SearchResultOverlay = styled__default["default"].div(templateObject_7 || (templateObject_7 = _tslib.__makeTemplateObject(["\n background: ", ";\n display: none;\n opacity: 0.5;\n overflow: hidden;\n position: fixed;\n left: 0;\n top: ", "px;\n width: 100vw;\n height: 100%;\n z-index: ", ";\n\n @media (min-width: ", "px) {\n display: ", ";\n top: ", ";\n }\n"], ["\n background: ", ";\n display: none;\n opacity: 0.5;\n overflow: hidden;\n position: fixed;\n left: 0;\n top: ", "px;\n width: 100vw;\n height: 100%;\n z-index: ", ";\n\n @media (min-width: ", "px) {\n display: ", ";\n top: ", ";\n }\n"])), (_j = designTokens.theme.palette) === null || _j === void 0 ? void 0 : _j.darkest, (_k = designTokens.theme.constants) === null || _k === void 0 ? void 0 : _k.navHeaderHeightSmall, (_l = designTokens.theme.attributes) === null || _l === void 0 ? void 0 : _l.zIndex.low, (_m = designTokens.theme.constants) === null || _m === void 0 ? void 0 : _m.headerBreakpoint, function (_a) {
|
|
37
|
-
var show = _a.show;
|
|
38
|
-
return (show ? 'block' : 'none');
|
|
39
|
-
}, function (_a) {
|
|
40
|
-
var _b;
|
|
41
|
-
var overlayTopPosition = _a.overlayTopPosition;
|
|
42
|
-
var baseTop = ((_b = designTokens.theme.constants) === null || _b === void 0 ? void 0 : _b.navHeaderHeightSmall) || 0;
|
|
43
|
-
return "".concat(overlayTopPosition ? overlayTopPosition + baseTop : baseTop, "px");
|
|
44
|
-
});
|
|
45
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
46
|
-
|
|
47
|
-
exports.Nav = Nav;
|
|
48
|
-
exports.NavChildContainer = NavChildContainer;
|
|
49
|
-
exports.NavContainer = NavContainer;
|
|
50
|
-
exports.NavMainLinks = NavMainLinks;
|
|
51
|
-
exports.SearchContainer = SearchContainer;
|
|
52
|
-
exports.SearchResultOverlay = SearchResultOverlay;
|
|
53
|
-
//# sourceMappingURL=Nav.styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Nav.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,73 +0,0 @@
|
|
|
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 utils = require('@citygross/utils');
|
|
8
|
-
var styled = require('styled-components');
|
|
9
|
-
var ScreenReader = require('../ScreenReader/ScreenReader.js');
|
|
10
|
-
var SearchBar_styles = require('./SearchBar.styles.js');
|
|
11
|
-
|
|
12
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
|
-
|
|
14
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
15
|
-
|
|
16
|
-
var SearchBar = function (_a) {
|
|
17
|
-
var _b;
|
|
18
|
-
var activeBorderColor = _a.activeBorderColor, cancelLabel = _a.cancelLabel, children = _a.children, flexGrow = _a.flexGrow, icon = _a.icon, inputIcon = _a.inputIcon, inputRef = _a.inputRef, _c = _a.inputSize, inputSize = _c === void 0 ? 'medium' : _c, isOpen = _a.isOpen, isValid = _a.isValid, mobileTopPosition = _a.mobileTopPosition, resultBoxTopPosition = _a.resultBoxTopPosition, searchInputMobileRef = _a.searchInputMobileRef, searchOnSubmit = _a.searchOnSubmit, value = _a.value, props = _tslib.__rest(_a, ["activeBorderColor", "cancelLabel", "children", "flexGrow", "icon", "inputIcon", "inputRef", "inputSize", "isOpen", "isValid", "mobileTopPosition", "resultBoxTopPosition", "searchInputMobileRef", "searchOnSubmit", "value"]);
|
|
19
|
-
var width = utils.useWindowSize().width;
|
|
20
|
-
var theme = styled.useTheme();
|
|
21
|
-
var isMobile = theme.constants && width < ((_b = theme.constants) === null || _b === void 0 ? void 0 : _b.headerBreakpoint);
|
|
22
|
-
var resultVariants = {
|
|
23
|
-
closed: {
|
|
24
|
-
height: '0',
|
|
25
|
-
transition: { duration: 0, ease: 'linear' }
|
|
26
|
-
},
|
|
27
|
-
open: {
|
|
28
|
-
height: isMobile ? '100%' : 'auto',
|
|
29
|
-
transition: {
|
|
30
|
-
duration: isMobile ? 0 : 0.2,
|
|
31
|
-
delay: isMobile ? 0 : 0.1,
|
|
32
|
-
ease: 'linear'
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
var iconVariants = {
|
|
37
|
-
closed: {
|
|
38
|
-
display: 'none',
|
|
39
|
-
opacity: 0,
|
|
40
|
-
transition: { duration: 0, delay: 0, ease: 'linear' }
|
|
41
|
-
},
|
|
42
|
-
open: {
|
|
43
|
-
display: 'flex',
|
|
44
|
-
opacity: 1,
|
|
45
|
-
transition: { duration: 0.1, delay: 0.1, ease: 'linear' }
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
return (React__default["default"].createElement(React.Fragment, null,
|
|
49
|
-
React__default["default"].createElement(ScreenReader.ScreenReader, { id: "search-help", string: "S\u00F6kf\u00F6rslag kommer visas medan du skriver" }),
|
|
50
|
-
React__default["default"].createElement(SearchBar_styles.SearchBarContainer, { activeBorderColor: activeBorderColor, flexGrow: flexGrow, inputSize: inputSize, isOpen: isOpen, role: "search" },
|
|
51
|
-
React__default["default"].createElement(SearchBar_styles.SearchForm, { hideInMobile: true, isOpen: isOpen, onSubmit: function (e) {
|
|
52
|
-
e.preventDefault();
|
|
53
|
-
searchOnSubmit === null || searchOnSubmit === void 0 ? void 0 : searchOnSubmit();
|
|
54
|
-
} },
|
|
55
|
-
React__default["default"].createElement(SearchBar_styles.SearchLeftIcon, null, inputIcon),
|
|
56
|
-
React__default["default"].createElement(SearchBar_styles.SearchInput, _tslib.__assign({ activeBorderColor: activeBorderColor, "aria-describedby": "search-help", "aria-haspopup": "dialog", "aria-hidden": isMobile, autoComplete: "off", "data-form-type": "other", "data-lpignore": "true", flexGrow: flexGrow, id: "search-input-desktop", inputSize: inputSize, isValid: isValid, ref: inputRef, value: value }, props)),
|
|
57
|
-
cancelLabel && (React__default["default"].createElement(SearchBar_styles.SearchRightLabel, { animate: isOpen ? 'open' : 'closed', initial: "closed", onClick: function (e) { return e.stopPropagation(); }, variants: iconVariants }, cancelLabel))),
|
|
58
|
-
React__default["default"].createElement(SearchBar_styles.MobileSearchIconContainer, null,
|
|
59
|
-
React__default["default"].createElement(SearchBar_styles.SearchLeftIcon, null, icon)),
|
|
60
|
-
React__default["default"].createElement(SearchBar_styles.SearchResultContainer, { animate: isOpen ? 'open' : 'closed', initial: "closed", isOpen: isOpen, mobileTopPosition: mobileTopPosition, topPosition: resultBoxTopPosition, variants: resultVariants },
|
|
61
|
-
React__default["default"].createElement(SearchBar_styles.MobileSearchFormContainer, null,
|
|
62
|
-
React__default["default"].createElement(SearchBar_styles.SearchForm, { onSubmit: function (e) {
|
|
63
|
-
e.preventDefault();
|
|
64
|
-
searchOnSubmit === null || searchOnSubmit === void 0 ? void 0 : searchOnSubmit();
|
|
65
|
-
} },
|
|
66
|
-
React__default["default"].createElement(SearchBar_styles.SearchLeftIcon, null, inputIcon),
|
|
67
|
-
React__default["default"].createElement(SearchBar_styles.SearchInput, _tslib.__assign({ activeBorderColor: activeBorderColor, "aria-describedby": "search-help", "aria-haspopup": "dialog", "aria-hidden": !isMobile, autoComplete: "off", "data-form-type": "other", "data-lpignore": "true", flexGrow: flexGrow, id: "search-input-mobile", isValid: isValid, ref: searchInputMobileRef, value: value, tabIndex: isOpen ? 0 : -1 }, props)),
|
|
68
|
-
cancelLabel && (React__default["default"].createElement(SearchBar_styles.SearchRightLabel, { onClick: function (e) { return e.stopPropagation(); } }, cancelLabel)))),
|
|
69
|
-
children))));
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
exports.SearchBar = SearchBar;
|
|
73
|
-
//# sourceMappingURL=SearchBar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SearchBar.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var _tslib = require('../../../../_virtual/_tslib.js');
|
|
6
|
-
var framerMotion = require('framer-motion');
|
|
7
|
-
var styled = require('styled-components');
|
|
8
|
-
|
|
9
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
-
|
|
11
|
-
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
12
|
-
|
|
13
|
-
var SearchResultContainer = styled__default["default"](framerMotion.motion.div)(templateObject_1 || (templateObject_1 = _tslib.__makeTemplateObject(["\n position: fixed;\n top: ", "px;\n left: 0;\n width: 100%;\n z-index: ", ";\n overflow: hidden;\n @media (max-width: ", "px) {\n height: 100%;\n }\n @media (min-width: ", "px) {\n position: absolute;\n top: ", ";\n }\n"], ["\n position: fixed;\n top: ", "px;\n left: 0;\n width: 100%;\n z-index: ", ";\n overflow: hidden;\n @media (max-width: ", "px) {\n height: 100%;\n }\n @media (min-width: ", "px) {\n position: absolute;\n top: ", ";\n }\n"])), function (_a) {
|
|
14
|
-
var mobileTopPosition = _a.mobileTopPosition;
|
|
15
|
-
return mobileTopPosition !== null && mobileTopPosition !== void 0 ? mobileTopPosition : 0;
|
|
16
|
-
}, function (_a) {
|
|
17
|
-
var _b;
|
|
18
|
-
var theme = _a.theme;
|
|
19
|
-
return (_b = theme.constants) === null || _b === void 0 ? void 0 : _b.searchModalZIndex;
|
|
20
|
-
}, function (_a) {
|
|
21
|
-
var _b;
|
|
22
|
-
var theme = _a.theme;
|
|
23
|
-
return (_b = theme.constants) === null || _b === void 0 ? void 0 : _b.headerBreakpoint;
|
|
24
|
-
}, function (_a) {
|
|
25
|
-
var _b;
|
|
26
|
-
var theme = _a.theme;
|
|
27
|
-
return (_b = theme.constants) === null || _b === void 0 ? void 0 : _b.headerBreakpoint;
|
|
28
|
-
}, function (_a) {
|
|
29
|
-
var _b;
|
|
30
|
-
var topPosition = _a.topPosition, theme = _a.theme;
|
|
31
|
-
return topPosition !== null && topPosition !== void 0 ? topPosition : "calc(100% + ".concat((_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xs, "px)");
|
|
32
|
-
});
|
|
33
|
-
var SearchRightLabel = styled__default["default"](framerMotion.motion.div)(templateObject_2 || (templateObject_2 = _tslib.__makeTemplateObject(["\n display: flex;\n align-items: center;\n cursor: pointer;\n"], ["\n display: flex;\n align-items: center;\n cursor: pointer;\n"])));
|
|
34
|
-
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 ", ";\n\n position: relative;\n display: flex;\n justify-content: flex-end;\n"])), function (_a) {
|
|
35
|
-
var flexGrow = _a.flexGrow;
|
|
36
|
-
return flexGrow && "flex: 1;";
|
|
37
|
-
});
|
|
38
|
-
var SearchInput = styled__default["default"].input(templateObject_4 || (templateObject_4 = _tslib.__makeTemplateObject(["\n flex: 1;\n border: none;\n background: transparent;\n outline: none;\n font-size: ", "px;\n padding: ", "px;\n line-height: ", "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"], ["\n flex: 1;\n border: none;\n background: transparent;\n outline: none;\n font-size: ", "px;\n padding: ", "px;\n line-height: ", "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"])), function (_a) {
|
|
39
|
-
var _b, _c;
|
|
40
|
-
var inputSize = _a.inputSize, theme = _a.theme;
|
|
41
|
-
return inputSize === 'small'
|
|
42
|
-
? (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.size.s2
|
|
43
|
-
: (_c = theme.typography) === null || _c === void 0 ? void 0 : _c.size.s3;
|
|
44
|
-
}, function (_a) {
|
|
45
|
-
var _b, _c;
|
|
46
|
-
var inputSize = _a.inputSize, theme = _a.theme;
|
|
47
|
-
return inputSize === 'small' ? (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xs : (_c = theme.spacings) === null || _c === void 0 ? void 0 : _c.xs2;
|
|
48
|
-
}, function (_a) {
|
|
49
|
-
var _b;
|
|
50
|
-
var theme = _a.theme;
|
|
51
|
-
return (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.size.m1;
|
|
52
|
-
}, function (_a) {
|
|
53
|
-
var _b;
|
|
54
|
-
var theme = _a.theme;
|
|
55
|
-
return (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.mediumDark;
|
|
56
|
-
}, function (_a) {
|
|
57
|
-
var _b;
|
|
58
|
-
var theme = _a.theme;
|
|
59
|
-
return (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.mediumDark;
|
|
60
|
-
}, function (_a) {
|
|
61
|
-
var _b;
|
|
62
|
-
var theme = _a.theme;
|
|
63
|
-
return (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.mediumDark;
|
|
64
|
-
});
|
|
65
|
-
var MobileSearchFormContainer = styled__default["default"].div(templateObject_5 || (templateObject_5 = _tslib.__makeTemplateObject(["\n background: ", ";\n padding: ", ";\n\n @media (min-width: ", "px) {\n display: none;\n }\n"], ["\n background: ", ";\n padding: ", ";\n\n @media (min-width: ", "px) {\n display: none;\n }\n"])), function (_a) {
|
|
66
|
-
var _b;
|
|
67
|
-
var theme = _a.theme;
|
|
68
|
-
return (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.white;
|
|
69
|
-
}, function (_a) {
|
|
70
|
-
var _b;
|
|
71
|
-
var theme = _a.theme;
|
|
72
|
-
return "".concat((_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xs, "px 10px");
|
|
73
|
-
}, function (_a) {
|
|
74
|
-
var _b;
|
|
75
|
-
var theme = _a.theme;
|
|
76
|
-
return (_b = theme.constants) === null || _b === void 0 ? void 0 : _b.headerBreakpoint;
|
|
77
|
-
});
|
|
78
|
-
var SearchForm = styled__default["default"].form(templateObject_6 || (templateObject_6 = _tslib.__makeTemplateObject(["\n flex: 1;\n display: ", ";\n padding: ", ";\n background: ", ";\n border-radius: ", "px;\n box-shadow: inset 0 0 0 1px ", ";\n\n &:focus-within {\n box-shadow: inset 0 0 0 2px ", ";\n background: ", ";\n }\n\n > div[data-lastpass-icon-root] {\n display: none;\n }\n\n @media (min-width: ", ") {\n &:hover {\n background: ", ";\n }\n }\n\n @media (min-width: ", "px) {\n display: flex;\n flex-direction: row;\n padding: 0 ", "px;\n ", "\n }\n"], ["\n flex: 1;\n display: ", ";\n padding: ", ";\n background: ", ";\n border-radius: ", "px;\n box-shadow: inset 0 0 0 1px ", ";\n\n &:focus-within {\n box-shadow: inset 0 0 0 2px ", ";\n background: ", ";\n }\n\n > div[data-lastpass-icon-root] {\n display: none;\n }\n\n @media (min-width: ", ") {\n &:hover {\n background: ", ";\n }\n }\n\n @media (min-width: ", "px) {\n display: flex;\n flex-direction: row;\n padding: 0 ", "px;\n ", "\n }\n"])), function (_a) {
|
|
79
|
-
var hideInMobile = _a.hideInMobile;
|
|
80
|
-
return (hideInMobile ? 'none' : 'flex');
|
|
81
|
-
}, function (_a) {
|
|
82
|
-
var _b;
|
|
83
|
-
var theme = _a.theme;
|
|
84
|
-
return "0px ".concat((_b = theme.constants) === null || _b === void 0 ? void 0 : _b.searchBarHorizontalPadding, "px");
|
|
85
|
-
}, function (_a) {
|
|
86
|
-
var _b;
|
|
87
|
-
var theme = _a.theme;
|
|
88
|
-
return (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.white;
|
|
89
|
-
}, function (_a) {
|
|
90
|
-
var _b;
|
|
91
|
-
var theme = _a.theme;
|
|
92
|
-
return (_b = theme.attributes) === null || _b === void 0 ? void 0 : _b.borderRadius.small;
|
|
93
|
-
}, function (_a) {
|
|
94
|
-
var _b;
|
|
95
|
-
var theme = _a.theme;
|
|
96
|
-
return (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.disabledGray;
|
|
97
|
-
}, function (_a) {
|
|
98
|
-
var _b;
|
|
99
|
-
var theme = _a.theme;
|
|
100
|
-
return (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.brandBlue;
|
|
101
|
-
}, function (_a) {
|
|
102
|
-
var _b;
|
|
103
|
-
var theme = _a.theme;
|
|
104
|
-
return (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.white;
|
|
105
|
-
}, function (_a) {
|
|
106
|
-
var _b;
|
|
107
|
-
var theme = _a.theme;
|
|
108
|
-
return (_b = theme.breakpoints) === null || _b === void 0 ? void 0 : _b.sm;
|
|
109
|
-
}, function (_a) {
|
|
110
|
-
var _b;
|
|
111
|
-
var theme = _a.theme;
|
|
112
|
-
return (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.lightest;
|
|
113
|
-
}, function (_a) {
|
|
114
|
-
var _b;
|
|
115
|
-
var theme = _a.theme;
|
|
116
|
-
return (_b = theme.constants) === null || _b === void 0 ? void 0 : _b.headerBreakpoint;
|
|
117
|
-
}, function (_a) {
|
|
118
|
-
var _b;
|
|
119
|
-
var theme = _a.theme;
|
|
120
|
-
return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.sm;
|
|
121
|
-
}, function (_a) {
|
|
122
|
-
var isOpen = _a.isOpen;
|
|
123
|
-
return isOpen && "flex-direction: row;";
|
|
124
|
-
});
|
|
125
|
-
var MobileSearchIconContainer = styled__default["default"].div(templateObject_7 || (templateObject_7 = _tslib.__makeTemplateObject(["\n display: block;\n\n @media (min-width: ", "px) {\n display: none;\n }\n"], ["\n display: block;\n\n @media (min-width: ", "px) {\n display: none;\n }\n"])), function (_a) {
|
|
126
|
-
var _b;
|
|
127
|
-
var theme = _a.theme;
|
|
128
|
-
return (_b = theme.constants) === null || _b === void 0 ? void 0 : _b.headerBreakpoint;
|
|
129
|
-
});
|
|
130
|
-
var SearchLeftIcon = styled__default["default"].div(templateObject_8 || (templateObject_8 = _tslib.__makeTemplateObject(["\n display: flex;\n align-items: center;\n"], ["\n display: flex;\n align-items: center;\n"])));
|
|
131
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
|
|
132
|
-
|
|
133
|
-
exports.MobileSearchFormContainer = MobileSearchFormContainer;
|
|
134
|
-
exports.MobileSearchIconContainer = MobileSearchIconContainer;
|
|
135
|
-
exports.SearchBarContainer = SearchBarContainer;
|
|
136
|
-
exports.SearchForm = SearchForm;
|
|
137
|
-
exports.SearchInput = SearchInput;
|
|
138
|
-
exports.SearchLeftIcon = SearchLeftIcon;
|
|
139
|
-
exports.SearchResultContainer = SearchResultContainer;
|
|
140
|
-
exports.SearchRightLabel = SearchRightLabel;
|
|
141
|
-
//# sourceMappingURL=SearchBar.styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SearchBar.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { theme } from '@citygross/design-tokens';
|
|
2
|
-
import { useWindowSize } from '@citygross/utils';
|
|
3
|
-
import React, { useRef, useState, useEffect, Fragment } from 'react';
|
|
4
|
-
import { SearchBar } from '../SearchBar/SearchBar.js';
|
|
5
|
-
import { Nav as Nav$1, NavContainer, NavChildContainer, NavMainLinks, SearchContainer, SearchResultOverlay } from './Nav.styles.js';
|
|
6
|
-
|
|
7
|
-
var Nav = function (_a) {
|
|
8
|
-
var _b, _c, _d, _e;
|
|
9
|
-
var closeSearch = _a.closeSearch, height = _a.height, inputIcon = _a.inputIcon, logo = _a.logo, mainLinks = _a.mainLinks, maxWidth = _a.maxWidth, mobileTopPosition = _a.mobileTopPosition, onSearchBlur = _a.onSearchBlur, onSearchClick = _a.onSearchClick, overlayTopPosition = _a.overlayTopPosition, rightContent = _a.rightContent, searchCancelLabel = _a.searchCancelLabel, searchContainerRef = _a.searchContainerRef, searchIcon = _a.searchIcon, searchInputMobileRef = _a.searchInputMobileRef, searchInputRef = _a.searchInputRef, searchIsOpen = _a.searchIsOpen, searchOnChange = _a.searchOnChange, searchOnSubmit = _a.searchOnSubmit, searchPlaceHolder = _a.searchPlaceHolder, searchResultElement = _a.searchResultElement, searchValue = _a.searchValue, topPosition = _a.topPosition;
|
|
10
|
-
var navContainerRef = useRef(null);
|
|
11
|
-
var navChildContainerRef = useRef(null);
|
|
12
|
-
var navRef = useRef(null);
|
|
13
|
-
var width = useWindowSize().width;
|
|
14
|
-
var _f = useState(width), localWidth = _f[0], setLocalWidth = _f[1];
|
|
15
|
-
var _g = useState(0), elToRemove = _g[0], setElToRemove = _g[1];
|
|
16
|
-
var widthRef = useRef(null);
|
|
17
|
-
var checkWidth = function () {
|
|
18
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
19
|
-
var containerWidth = (_b = (_a = navRef === null || navRef === void 0 ? void 0 : navRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) !== null && _b !== void 0 ? _b : 0;
|
|
20
|
-
var containerScrollWidth = (_d = (_c = navRef === null || navRef === void 0 ? void 0 : navRef.current) === null || _c === void 0 ? void 0 : _c.scrollWidth) !== null && _d !== void 0 ? _d : 0;
|
|
21
|
-
var childContainerWidth = (_f = (_e = navChildContainerRef === null || navChildContainerRef === void 0 ? void 0 : navChildContainerRef.current) === null || _e === void 0 ? void 0 : _e.offsetWidth) !== null && _f !== void 0 ? _f : 0;
|
|
22
|
-
// assuming mainLinks max width
|
|
23
|
-
var maxMainLinkWidth = (_h = (_g = theme.constants) === null || _g === void 0 ? void 0 : _g.navMainLinkWidth) !== null && _h !== void 0 ? _h : 105;
|
|
24
|
-
var currentWidht = containerWidth;
|
|
25
|
-
var removeLength = 0;
|
|
26
|
-
while (currentWidht < containerScrollWidth) {
|
|
27
|
-
currentWidht += maxMainLinkWidth;
|
|
28
|
-
removeLength += 1;
|
|
29
|
-
}
|
|
30
|
-
if (width <= localWidth &&
|
|
31
|
-
(navRef === null || navRef === void 0 ? void 0 : navRef.current) &&
|
|
32
|
-
(containerScrollWidth > containerWidth ||
|
|
33
|
-
((navChildContainerRef === null || navChildContainerRef === void 0 ? void 0 : navChildContainerRef.current) && childContainerWidth > containerWidth))) {
|
|
34
|
-
setElToRemove(function (prev) { return prev + removeLength; });
|
|
35
|
-
widthRef.current = width;
|
|
36
|
-
}
|
|
37
|
-
else if (width > localWidth &&
|
|
38
|
-
(((widthRef === null || widthRef === void 0 ? void 0 : widthRef.current) && width >= (widthRef === null || widthRef === void 0 ? void 0 : widthRef.current)) || elToRemove > 0)) {
|
|
39
|
-
if (elToRemove) {
|
|
40
|
-
setElToRemove(function (prev) { return prev - 1; });
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
setLocalWidth(width);
|
|
44
|
-
};
|
|
45
|
-
useEffect(function () {
|
|
46
|
-
var debounce = setTimeout(function () {
|
|
47
|
-
checkWidth === null || checkWidth === void 0 ? void 0 : checkWidth();
|
|
48
|
-
}, 300);
|
|
49
|
-
return function () {
|
|
50
|
-
clearTimeout(debounce);
|
|
51
|
-
};
|
|
52
|
-
}, [
|
|
53
|
-
width,
|
|
54
|
-
(_b = navRef === null || navRef === void 0 ? void 0 : navRef.current) === null || _b === void 0 ? void 0 : _b.offsetWidth,
|
|
55
|
-
(_c = navChildContainerRef === null || navChildContainerRef === void 0 ? void 0 : navChildContainerRef.current) === null || _c === void 0 ? void 0 : _c.offsetWidth,
|
|
56
|
-
localWidth
|
|
57
|
-
]);
|
|
58
|
-
useEffect(function () {
|
|
59
|
-
var handleClick = function (event) {
|
|
60
|
-
var _a;
|
|
61
|
-
if ((navContainerRef === null || navContainerRef === void 0 ? void 0 : navContainerRef.current) &&
|
|
62
|
-
!((_a = navContainerRef === null || navContainerRef === void 0 ? void 0 : navContainerRef.current) === null || _a === void 0 ? void 0 : _a.contains(event === null || event === void 0 ? void 0 : event.target))) {
|
|
63
|
-
closeSearch === null || closeSearch === void 0 ? void 0 : closeSearch();
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
document.addEventListener('click', handleClick, true);
|
|
67
|
-
return function () {
|
|
68
|
-
document.removeEventListener('click', handleClick, true);
|
|
69
|
-
};
|
|
70
|
-
}, [closeSearch, navContainerRef]);
|
|
71
|
-
var variants = {
|
|
72
|
-
closed: {
|
|
73
|
-
width: '0',
|
|
74
|
-
transition: {
|
|
75
|
-
duration: 0.1,
|
|
76
|
-
ease: 'linear'
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
open: {
|
|
80
|
-
width: 'auto',
|
|
81
|
-
transition: { duration: 0.1, ease: 'linear' }
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
return (React.createElement(Nav$1, { height: height, topPosition: topPosition, ref: navRef },
|
|
85
|
-
React.createElement(NavContainer, { maxWidth: maxWidth, ref: navContainerRef },
|
|
86
|
-
logo,
|
|
87
|
-
React.createElement(NavChildContainer, { ref: navChildContainerRef },
|
|
88
|
-
React.createElement(Fragment, null,
|
|
89
|
-
React.createElement(NavMainLinks, { variants: variants, animate: theme.constants && width < ((_d = theme.constants) === null || _d === void 0 ? void 0 : _d.headerBreakpoint)
|
|
90
|
-
? false
|
|
91
|
-
: searchIsOpen
|
|
92
|
-
? 'closed'
|
|
93
|
-
: 'open', initial: "open" }, (_e = mainLinks === null || mainLinks === void 0 ? void 0 : mainLinks.slice(0, (mainLinks === null || mainLinks === void 0 ? void 0 : mainLinks.length) - elToRemove)) === null || _e === void 0 ? void 0 : _e.map(function (link) { return link; })),
|
|
94
|
-
React.createElement(SearchContainer, { isOpen: searchIsOpen, ref: searchContainerRef },
|
|
95
|
-
React.createElement(SearchBar, { cancelLabel: searchCancelLabel, flexGrow: true, icon: searchIcon, inputIcon: inputIcon, inputRef: searchInputRef, isOpen: searchIsOpen, mobileTopPosition: mobileTopPosition, onBlur: onSearchBlur, onChange: searchOnChange, onClick: function () { return onSearchClick === null || onSearchClick === void 0 ? void 0 : onSearchClick(); }, onKeyDown: function (e) { return e.key === 'Enter' && (onSearchClick === null || onSearchClick === void 0 ? void 0 : onSearchClick()); }, placeholder: searchPlaceHolder, searchInputMobileRef: searchInputMobileRef, searchOnSubmit: searchOnSubmit, value: searchValue }, searchResultElement))),
|
|
96
|
-
rightContent)),
|
|
97
|
-
React.createElement(SearchResultOverlay, { show: searchIsOpen, overlayTopPosition: overlayTopPosition })));
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export { Nav };
|
|
101
|
-
//# sourceMappingURL=Nav.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Nav.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { __makeTemplateObject } from '../../../../_virtual/_tslib.js';
|
|
2
|
-
import { theme } from '@citygross/design-tokens';
|
|
3
|
-
import { motion } from 'framer-motion';
|
|
4
|
-
import styled from 'styled-components';
|
|
5
|
-
|
|
6
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
7
|
-
var Nav = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background: ", ";\n display: flex;\n align-items: center;\n width: 100%;\n height: ", "px;\n"], ["\n background: ", ";\n display: flex;\n align-items: center;\n width: 100%;\n height: ", "px;\n"])), function (_a) {
|
|
8
|
-
var _b;
|
|
9
|
-
var background = _a.background;
|
|
10
|
-
return background !== null && background !== void 0 ? background : (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.white;
|
|
11
|
-
}, function (_a) {
|
|
12
|
-
var _b;
|
|
13
|
-
var height = _a.height;
|
|
14
|
-
return height !== null && height !== void 0 ? height : (_b = theme.constants) === null || _b === void 0 ? void 0 : _b.navHeaderHeightSmall;
|
|
15
|
-
});
|
|
16
|
-
var NavContainer = styled.nav(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n margin: 0 auto;\n max-width: ", "px;\n padding: ", "px;\n width: 100%;\n\n @media (min-width: ", "px) {\n padding: ", "px ", "px;\n }\n"], ["\n display: flex;\n margin: 0 auto;\n max-width: ", "px;\n padding: ", "px;\n width: 100%;\n\n @media (min-width: ", "px) {\n padding: ", "px ", "px;\n }\n"])), function (_a) {
|
|
17
|
-
var maxWidth = _a.maxWidth;
|
|
18
|
-
return maxWidth;
|
|
19
|
-
}, (_a = theme.spacings) === null || _a === void 0 ? void 0 : _a.xs, (_b = theme.constants) === null || _b === void 0 ? void 0 : _b.headerBreakpoint, (_c = theme.spacings) === null || _c === void 0 ? void 0 : _c.xs, (_d = theme.spacings) === null || _d === void 0 ? void 0 : _d.sm);
|
|
20
|
-
var NavChildContainer = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: flex-end;\n flex: 1;\n z-index: ", ";\n"], ["\n display: flex;\n align-items: center;\n justify-content: flex-end;\n flex: 1;\n z-index: ", ";\n"])), (_e = theme.attributes) === null || _e === void 0 ? void 0 : _e.zIndex.middle);
|
|
21
|
-
var NavMainLinks = styled(motion.div)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: none;\n\n @media (min-width: ", "px) {\n display: flex;\n align-items: center;\n gap: ", "px;\n margin-left: ", "px;\n width: auto;\n height: 100%;\n }\n"], ["\n display: none;\n\n @media (min-width: ", "px) {\n display: flex;\n align-items: center;\n gap: ", "px;\n margin-left: ", "px;\n width: auto;\n height: 100%;\n }\n"])), (_f = theme.constants) === null || _f === void 0 ? void 0 : _f.headerBreakpoint, (_g = theme.spacings) === null || _g === void 0 ? void 0 : _g.sm, (_h = theme.spacings) === null || _h === void 0 ? void 0 : _h.sm);
|
|
22
|
-
var SearchContainer = styled(motion.div)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n flex: 1;\n margin-left: ", "px;\n"], ["\n display: flex;\n align-items: center;\n flex: 1;\n margin-left: ", "px;\n"])), function (_a) {
|
|
23
|
-
var _b;
|
|
24
|
-
var isOpen = _a.isOpen;
|
|
25
|
-
return (isOpen ? 0 : (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.sm);
|
|
26
|
-
});
|
|
27
|
-
styled(SearchContainer)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: flex;\n"], ["\n display: flex;\n"])));
|
|
28
|
-
var SearchResultOverlay = styled.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n background: ", ";\n display: none;\n opacity: 0.5;\n overflow: hidden;\n position: fixed;\n left: 0;\n top: ", "px;\n width: 100vw;\n height: 100%;\n z-index: ", ";\n\n @media (min-width: ", "px) {\n display: ", ";\n top: ", ";\n }\n"], ["\n background: ", ";\n display: none;\n opacity: 0.5;\n overflow: hidden;\n position: fixed;\n left: 0;\n top: ", "px;\n width: 100vw;\n height: 100%;\n z-index: ", ";\n\n @media (min-width: ", "px) {\n display: ", ";\n top: ", ";\n }\n"])), (_j = theme.palette) === null || _j === void 0 ? void 0 : _j.darkest, (_k = theme.constants) === null || _k === void 0 ? void 0 : _k.navHeaderHeightSmall, (_l = theme.attributes) === null || _l === void 0 ? void 0 : _l.zIndex.low, (_m = theme.constants) === null || _m === void 0 ? void 0 : _m.headerBreakpoint, function (_a) {
|
|
29
|
-
var show = _a.show;
|
|
30
|
-
return (show ? 'block' : 'none');
|
|
31
|
-
}, function (_a) {
|
|
32
|
-
var _b;
|
|
33
|
-
var overlayTopPosition = _a.overlayTopPosition;
|
|
34
|
-
var baseTop = ((_b = theme.constants) === null || _b === void 0 ? void 0 : _b.navHeaderHeightSmall) || 0;
|
|
35
|
-
return "".concat(overlayTopPosition ? overlayTopPosition + baseTop : baseTop, "px");
|
|
36
|
-
});
|
|
37
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
38
|
-
|
|
39
|
-
export { Nav, NavChildContainer, NavContainer, NavMainLinks, SearchContainer, SearchResultOverlay };
|
|
40
|
-
//# sourceMappingURL=Nav.styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Nav.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { __rest, __assign } from '../../../../_virtual/_tslib.js';
|
|
2
|
-
import React, { Fragment } from 'react';
|
|
3
|
-
import { useWindowSize } from '@citygross/utils';
|
|
4
|
-
import { useTheme } from 'styled-components';
|
|
5
|
-
import { ScreenReader } from '../ScreenReader/ScreenReader.js';
|
|
6
|
-
import { SearchBarContainer, SearchForm, SearchLeftIcon, SearchInput, SearchRightLabel, MobileSearchIconContainer, SearchResultContainer, MobileSearchFormContainer } from './SearchBar.styles.js';
|
|
7
|
-
|
|
8
|
-
var SearchBar = function (_a) {
|
|
9
|
-
var _b;
|
|
10
|
-
var activeBorderColor = _a.activeBorderColor, cancelLabel = _a.cancelLabel, children = _a.children, flexGrow = _a.flexGrow, icon = _a.icon, inputIcon = _a.inputIcon, inputRef = _a.inputRef, _c = _a.inputSize, inputSize = _c === void 0 ? 'medium' : _c, isOpen = _a.isOpen, isValid = _a.isValid, mobileTopPosition = _a.mobileTopPosition, resultBoxTopPosition = _a.resultBoxTopPosition, searchInputMobileRef = _a.searchInputMobileRef, searchOnSubmit = _a.searchOnSubmit, value = _a.value, props = __rest(_a, ["activeBorderColor", "cancelLabel", "children", "flexGrow", "icon", "inputIcon", "inputRef", "inputSize", "isOpen", "isValid", "mobileTopPosition", "resultBoxTopPosition", "searchInputMobileRef", "searchOnSubmit", "value"]);
|
|
11
|
-
var width = useWindowSize().width;
|
|
12
|
-
var theme = useTheme();
|
|
13
|
-
var isMobile = theme.constants && width < ((_b = theme.constants) === null || _b === void 0 ? void 0 : _b.headerBreakpoint);
|
|
14
|
-
var resultVariants = {
|
|
15
|
-
closed: {
|
|
16
|
-
height: '0',
|
|
17
|
-
transition: { duration: 0, ease: 'linear' }
|
|
18
|
-
},
|
|
19
|
-
open: {
|
|
20
|
-
height: isMobile ? '100%' : 'auto',
|
|
21
|
-
transition: {
|
|
22
|
-
duration: isMobile ? 0 : 0.2,
|
|
23
|
-
delay: isMobile ? 0 : 0.1,
|
|
24
|
-
ease: 'linear'
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
var iconVariants = {
|
|
29
|
-
closed: {
|
|
30
|
-
display: 'none',
|
|
31
|
-
opacity: 0,
|
|
32
|
-
transition: { duration: 0, delay: 0, ease: 'linear' }
|
|
33
|
-
},
|
|
34
|
-
open: {
|
|
35
|
-
display: 'flex',
|
|
36
|
-
opacity: 1,
|
|
37
|
-
transition: { duration: 0.1, delay: 0.1, ease: 'linear' }
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
return (React.createElement(Fragment, null,
|
|
41
|
-
React.createElement(ScreenReader, { id: "search-help", string: "S\u00F6kf\u00F6rslag kommer visas medan du skriver" }),
|
|
42
|
-
React.createElement(SearchBarContainer, { activeBorderColor: activeBorderColor, flexGrow: flexGrow, inputSize: inputSize, isOpen: isOpen, role: "search" },
|
|
43
|
-
React.createElement(SearchForm, { hideInMobile: true, isOpen: isOpen, onSubmit: function (e) {
|
|
44
|
-
e.preventDefault();
|
|
45
|
-
searchOnSubmit === null || searchOnSubmit === void 0 ? void 0 : searchOnSubmit();
|
|
46
|
-
} },
|
|
47
|
-
React.createElement(SearchLeftIcon, null, inputIcon),
|
|
48
|
-
React.createElement(SearchInput, __assign({ activeBorderColor: activeBorderColor, "aria-describedby": "search-help", "aria-haspopup": "dialog", "aria-hidden": isMobile, autoComplete: "off", "data-form-type": "other", "data-lpignore": "true", flexGrow: flexGrow, id: "search-input-desktop", inputSize: inputSize, isValid: isValid, ref: inputRef, value: value }, props)),
|
|
49
|
-
cancelLabel && (React.createElement(SearchRightLabel, { animate: isOpen ? 'open' : 'closed', initial: "closed", onClick: function (e) { return e.stopPropagation(); }, variants: iconVariants }, cancelLabel))),
|
|
50
|
-
React.createElement(MobileSearchIconContainer, null,
|
|
51
|
-
React.createElement(SearchLeftIcon, null, icon)),
|
|
52
|
-
React.createElement(SearchResultContainer, { animate: isOpen ? 'open' : 'closed', initial: "closed", isOpen: isOpen, mobileTopPosition: mobileTopPosition, topPosition: resultBoxTopPosition, variants: resultVariants },
|
|
53
|
-
React.createElement(MobileSearchFormContainer, null,
|
|
54
|
-
React.createElement(SearchForm, { onSubmit: function (e) {
|
|
55
|
-
e.preventDefault();
|
|
56
|
-
searchOnSubmit === null || searchOnSubmit === void 0 ? void 0 : searchOnSubmit();
|
|
57
|
-
} },
|
|
58
|
-
React.createElement(SearchLeftIcon, null, inputIcon),
|
|
59
|
-
React.createElement(SearchInput, __assign({ activeBorderColor: activeBorderColor, "aria-describedby": "search-help", "aria-haspopup": "dialog", "aria-hidden": !isMobile, autoComplete: "off", "data-form-type": "other", "data-lpignore": "true", flexGrow: flexGrow, id: "search-input-mobile", isValid: isValid, ref: searchInputMobileRef, value: value, tabIndex: isOpen ? 0 : -1 }, props)),
|
|
60
|
-
cancelLabel && (React.createElement(SearchRightLabel, { onClick: function (e) { return e.stopPropagation(); } }, cancelLabel)))),
|
|
61
|
-
children))));
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
export { SearchBar };
|
|
65
|
-
//# sourceMappingURL=SearchBar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SearchBar.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { __makeTemplateObject } from '../../../../_virtual/_tslib.js';
|
|
2
|
-
import { motion } from 'framer-motion';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
|
|
5
|
-
var SearchResultContainer = styled(motion.div)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: fixed;\n top: ", "px;\n left: 0;\n width: 100%;\n z-index: ", ";\n overflow: hidden;\n @media (max-width: ", "px) {\n height: 100%;\n }\n @media (min-width: ", "px) {\n position: absolute;\n top: ", ";\n }\n"], ["\n position: fixed;\n top: ", "px;\n left: 0;\n width: 100%;\n z-index: ", ";\n overflow: hidden;\n @media (max-width: ", "px) {\n height: 100%;\n }\n @media (min-width: ", "px) {\n position: absolute;\n top: ", ";\n }\n"])), function (_a) {
|
|
6
|
-
var mobileTopPosition = _a.mobileTopPosition;
|
|
7
|
-
return mobileTopPosition !== null && mobileTopPosition !== void 0 ? mobileTopPosition : 0;
|
|
8
|
-
}, function (_a) {
|
|
9
|
-
var _b;
|
|
10
|
-
var theme = _a.theme;
|
|
11
|
-
return (_b = theme.constants) === null || _b === void 0 ? void 0 : _b.searchModalZIndex;
|
|
12
|
-
}, function (_a) {
|
|
13
|
-
var _b;
|
|
14
|
-
var theme = _a.theme;
|
|
15
|
-
return (_b = theme.constants) === null || _b === void 0 ? void 0 : _b.headerBreakpoint;
|
|
16
|
-
}, function (_a) {
|
|
17
|
-
var _b;
|
|
18
|
-
var theme = _a.theme;
|
|
19
|
-
return (_b = theme.constants) === null || _b === void 0 ? void 0 : _b.headerBreakpoint;
|
|
20
|
-
}, function (_a) {
|
|
21
|
-
var _b;
|
|
22
|
-
var topPosition = _a.topPosition, theme = _a.theme;
|
|
23
|
-
return topPosition !== null && topPosition !== void 0 ? topPosition : "calc(100% + ".concat((_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xs, "px)");
|
|
24
|
-
});
|
|
25
|
-
var SearchRightLabel = styled(motion.div)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n cursor: pointer;\n"], ["\n display: flex;\n align-items: center;\n cursor: pointer;\n"])));
|
|
26
|
-
var SearchBarContainer = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", ";\n\n position: relative;\n display: flex;\n justify-content: flex-end;\n"], ["\n ", ";\n\n position: relative;\n display: flex;\n justify-content: flex-end;\n"])), function (_a) {
|
|
27
|
-
var flexGrow = _a.flexGrow;
|
|
28
|
-
return flexGrow && "flex: 1;";
|
|
29
|
-
});
|
|
30
|
-
var SearchInput = styled.input(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n flex: 1;\n border: none;\n background: transparent;\n outline: none;\n font-size: ", "px;\n padding: ", "px;\n line-height: ", "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"], ["\n flex: 1;\n border: none;\n background: transparent;\n outline: none;\n font-size: ", "px;\n padding: ", "px;\n line-height: ", "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"])), function (_a) {
|
|
31
|
-
var _b, _c;
|
|
32
|
-
var inputSize = _a.inputSize, theme = _a.theme;
|
|
33
|
-
return inputSize === 'small'
|
|
34
|
-
? (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.size.s2
|
|
35
|
-
: (_c = theme.typography) === null || _c === void 0 ? void 0 : _c.size.s3;
|
|
36
|
-
}, function (_a) {
|
|
37
|
-
var _b, _c;
|
|
38
|
-
var inputSize = _a.inputSize, theme = _a.theme;
|
|
39
|
-
return inputSize === 'small' ? (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xs : (_c = theme.spacings) === null || _c === void 0 ? void 0 : _c.xs2;
|
|
40
|
-
}, function (_a) {
|
|
41
|
-
var _b;
|
|
42
|
-
var theme = _a.theme;
|
|
43
|
-
return (_b = theme.typography) === null || _b === void 0 ? void 0 : _b.size.m1;
|
|
44
|
-
}, function (_a) {
|
|
45
|
-
var _b;
|
|
46
|
-
var theme = _a.theme;
|
|
47
|
-
return (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.mediumDark;
|
|
48
|
-
}, function (_a) {
|
|
49
|
-
var _b;
|
|
50
|
-
var theme = _a.theme;
|
|
51
|
-
return (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.mediumDark;
|
|
52
|
-
}, function (_a) {
|
|
53
|
-
var _b;
|
|
54
|
-
var theme = _a.theme;
|
|
55
|
-
return (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.mediumDark;
|
|
56
|
-
});
|
|
57
|
-
var MobileSearchFormContainer = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background: ", ";\n padding: ", ";\n\n @media (min-width: ", "px) {\n display: none;\n }\n"], ["\n background: ", ";\n padding: ", ";\n\n @media (min-width: ", "px) {\n display: none;\n }\n"])), function (_a) {
|
|
58
|
-
var _b;
|
|
59
|
-
var theme = _a.theme;
|
|
60
|
-
return (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.white;
|
|
61
|
-
}, function (_a) {
|
|
62
|
-
var _b;
|
|
63
|
-
var theme = _a.theme;
|
|
64
|
-
return "".concat((_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.xs, "px 10px");
|
|
65
|
-
}, function (_a) {
|
|
66
|
-
var _b;
|
|
67
|
-
var theme = _a.theme;
|
|
68
|
-
return (_b = theme.constants) === null || _b === void 0 ? void 0 : _b.headerBreakpoint;
|
|
69
|
-
});
|
|
70
|
-
var SearchForm = styled.form(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n flex: 1;\n display: ", ";\n padding: ", ";\n background: ", ";\n border-radius: ", "px;\n box-shadow: inset 0 0 0 1px ", ";\n\n &:focus-within {\n box-shadow: inset 0 0 0 2px ", ";\n background: ", ";\n }\n\n > div[data-lastpass-icon-root] {\n display: none;\n }\n\n @media (min-width: ", ") {\n &:hover {\n background: ", ";\n }\n }\n\n @media (min-width: ", "px) {\n display: flex;\n flex-direction: row;\n padding: 0 ", "px;\n ", "\n }\n"], ["\n flex: 1;\n display: ", ";\n padding: ", ";\n background: ", ";\n border-radius: ", "px;\n box-shadow: inset 0 0 0 1px ", ";\n\n &:focus-within {\n box-shadow: inset 0 0 0 2px ", ";\n background: ", ";\n }\n\n > div[data-lastpass-icon-root] {\n display: none;\n }\n\n @media (min-width: ", ") {\n &:hover {\n background: ", ";\n }\n }\n\n @media (min-width: ", "px) {\n display: flex;\n flex-direction: row;\n padding: 0 ", "px;\n ", "\n }\n"])), function (_a) {
|
|
71
|
-
var hideInMobile = _a.hideInMobile;
|
|
72
|
-
return (hideInMobile ? 'none' : 'flex');
|
|
73
|
-
}, function (_a) {
|
|
74
|
-
var _b;
|
|
75
|
-
var theme = _a.theme;
|
|
76
|
-
return "0px ".concat((_b = theme.constants) === null || _b === void 0 ? void 0 : _b.searchBarHorizontalPadding, "px");
|
|
77
|
-
}, function (_a) {
|
|
78
|
-
var _b;
|
|
79
|
-
var theme = _a.theme;
|
|
80
|
-
return (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.white;
|
|
81
|
-
}, function (_a) {
|
|
82
|
-
var _b;
|
|
83
|
-
var theme = _a.theme;
|
|
84
|
-
return (_b = theme.attributes) === null || _b === void 0 ? void 0 : _b.borderRadius.small;
|
|
85
|
-
}, function (_a) {
|
|
86
|
-
var _b;
|
|
87
|
-
var theme = _a.theme;
|
|
88
|
-
return (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.disabledGray;
|
|
89
|
-
}, function (_a) {
|
|
90
|
-
var _b;
|
|
91
|
-
var theme = _a.theme;
|
|
92
|
-
return (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.brandBlue;
|
|
93
|
-
}, function (_a) {
|
|
94
|
-
var _b;
|
|
95
|
-
var theme = _a.theme;
|
|
96
|
-
return (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.white;
|
|
97
|
-
}, function (_a) {
|
|
98
|
-
var _b;
|
|
99
|
-
var theme = _a.theme;
|
|
100
|
-
return (_b = theme.breakpoints) === null || _b === void 0 ? void 0 : _b.sm;
|
|
101
|
-
}, function (_a) {
|
|
102
|
-
var _b;
|
|
103
|
-
var theme = _a.theme;
|
|
104
|
-
return (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.lightest;
|
|
105
|
-
}, function (_a) {
|
|
106
|
-
var _b;
|
|
107
|
-
var theme = _a.theme;
|
|
108
|
-
return (_b = theme.constants) === null || _b === void 0 ? void 0 : _b.headerBreakpoint;
|
|
109
|
-
}, function (_a) {
|
|
110
|
-
var _b;
|
|
111
|
-
var theme = _a.theme;
|
|
112
|
-
return (_b = theme.spacings) === null || _b === void 0 ? void 0 : _b.sm;
|
|
113
|
-
}, function (_a) {
|
|
114
|
-
var isOpen = _a.isOpen;
|
|
115
|
-
return isOpen && "flex-direction: row;";
|
|
116
|
-
});
|
|
117
|
-
var MobileSearchIconContainer = styled.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n display: block;\n\n @media (min-width: ", "px) {\n display: none;\n }\n"], ["\n display: block;\n\n @media (min-width: ", "px) {\n display: none;\n }\n"])), function (_a) {
|
|
118
|
-
var _b;
|
|
119
|
-
var theme = _a.theme;
|
|
120
|
-
return (_b = theme.constants) === null || _b === void 0 ? void 0 : _b.headerBreakpoint;
|
|
121
|
-
});
|
|
122
|
-
var SearchLeftIcon = styled.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n"], ["\n display: flex;\n align-items: center;\n"])));
|
|
123
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
|
|
124
|
-
|
|
125
|
-
export { MobileSearchFormContainer, MobileSearchIconContainer, SearchBarContainer, SearchForm, SearchInput, SearchLeftIcon, SearchResultContainer, SearchRightLabel };
|
|
126
|
-
//# sourceMappingURL=SearchBar.styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SearchBar.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|