@citygross/components 0.8.176 → 0.8.177

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 (27) hide show
  1. package/build/@types/components/Button/NavButton.d.ts +22 -1
  2. package/build/@types/components/Nav/Nav.d.ts +2 -1
  3. package/build/cjs/components/src/components/AddressBlock/AddressBlock.js +1 -0
  4. package/build/cjs/components/src/components/AddressBlock/AddressBlock.js.map +1 -1
  5. package/build/cjs/components/src/components/Button/NavButton.js +4 -3
  6. package/build/cjs/components/src/components/Button/NavButton.js.map +1 -1
  7. package/build/cjs/components/src/components/InfoTextBlock/InfoTextBlock.js +1 -0
  8. package/build/cjs/components/src/components/InfoTextBlock/InfoTextBlock.js.map +1 -1
  9. package/build/cjs/components/src/components/Nav/Nav.js +12 -18
  10. package/build/cjs/components/src/components/Nav/Nav.js.map +1 -1
  11. package/build/cjs/components/src/components/SearchBar/SearchBar.js +6 -10
  12. package/build/cjs/components/src/components/SearchBar/SearchBar.js.map +1 -1
  13. package/build/cjs/components/src/components/WarningLabel/WarningLabel.js +1 -0
  14. package/build/cjs/components/src/components/WarningLabel/WarningLabel.js.map +1 -1
  15. package/build/es/components/src/components/AddressBlock/AddressBlock.js +1 -0
  16. package/build/es/components/src/components/AddressBlock/AddressBlock.js.map +1 -1
  17. package/build/es/components/src/components/Button/NavButton.js +4 -3
  18. package/build/es/components/src/components/Button/NavButton.js.map +1 -1
  19. package/build/es/components/src/components/InfoTextBlock/InfoTextBlock.js +1 -0
  20. package/build/es/components/src/components/InfoTextBlock/InfoTextBlock.js.map +1 -1
  21. package/build/es/components/src/components/Nav/Nav.js +12 -18
  22. package/build/es/components/src/components/Nav/Nav.js.map +1 -1
  23. package/build/es/components/src/components/SearchBar/SearchBar.js +6 -10
  24. package/build/es/components/src/components/SearchBar/SearchBar.js.map +1 -1
  25. package/build/es/components/src/components/WarningLabel/WarningLabel.js +1 -0
  26. package/build/es/components/src/components/WarningLabel/WarningLabel.js.map +1 -1
  27. package/package.json +2 -2
@@ -16,4 +16,25 @@ export declare type TNavButton = styles.TButton & styles.TBaseSmallButton & {
16
16
  tabIndex?: number;
17
17
  xsSize?: keyof typeof ButtonSize;
18
18
  };
19
- export declare function NavButton({ badgeBackground, badgeMinWidth, border, borderRadius, buttonBadge, center, childGap, children, color, flexReverse, fullWidth, height, width, hoverBackground, keepLabel, icon, id, isDisabled, loading, minWidth, noShadow, noWrap, onClick, shadow, size, tabIndex, xsSize, ...props }: TNavButton): JSX.Element;
19
+ export declare const NavButton: React.ForwardRefExoticComponent<styles.TButton & Omit<styles.TButton, "size" | "flexReverse" | "fullWidth" | "center"> & {
20
+ width?: number | undefined;
21
+ height?: number | undefined;
22
+ color?: string | undefined;
23
+ opacity?: string | undefined;
24
+ border?: string | undefined;
25
+ shadow?: boolean | undefined;
26
+ } & {
27
+ badgeBackground?: string | undefined;
28
+ badgeMinWidth?: number | undefined;
29
+ buttonBadge?: string | undefined;
30
+ children?: React.ReactNode;
31
+ color?: "primary" | "secondary" | "white" | "darkest" | "lightest" | "buttonGray" | "brandPurple" | "alertGreen" | undefined;
32
+ href?: string | undefined;
33
+ icon: JSX.Element;
34
+ id?: string | undefined;
35
+ keepLabel?: boolean | undefined;
36
+ minWidth?: number | undefined;
37
+ size: keyof typeof ButtonSize;
38
+ tabIndex?: number | undefined;
39
+ xsSize?: "small" | "medium" | "large" | "header" | undefined;
40
+ } & React.RefAttributes<HTMLButtonElement>>;
@@ -13,6 +13,7 @@ export declare type TNav = {
13
13
  rightContent?: React.ReactNode;
14
14
  searchAriaLabel: string;
15
15
  searchCancelLabel?: React.ReactNode;
16
+ searchContainerAriaLabel: string;
16
17
  searchContainerRef: React.RefObject<HTMLDivElement>;
17
18
  searchIcon?: React.ReactNode;
18
19
  searchInputMobileRef: React.RefObject<HTMLInputElement>;
@@ -25,4 +26,4 @@ export declare type TNav = {
25
26
  searchValue?: string;
26
27
  topPosition?: number;
27
28
  };
28
- export declare const Nav: ({ closeSearch, height, inputIcon, logo, mainLinks, maxWidth, mobileTopPosition, onSearchBlur, onSearchClick, overlayTopPosition, rightContent, searchAriaLabel, searchCancelLabel, searchContainerRef, searchIcon, searchInputMobileRef, searchInputRef, searchIsOpen, searchOnChange, searchOnSubmit, searchPlaceHolder, searchResultElement, searchValue, topPosition }: TNav) => JSX.Element;
29
+ export declare const Nav: ({ closeSearch, height, inputIcon, logo, mainLinks, maxWidth, mobileTopPosition, onSearchBlur, onSearchClick, overlayTopPosition, rightContent, searchAriaLabel, searchCancelLabel, searchContainerAriaLabel, searchContainerRef, searchIcon, searchInputMobileRef, searchInputRef, searchIsOpen, searchOnChange, searchOnSubmit, searchPlaceHolder, searchResultElement, searchValue, topPosition }: TNav) => JSX.Element;
@@ -16,6 +16,7 @@ require('../Box/Box.styles.js');
16
16
  require('../Button/Button.js');
17
17
  require('@citygross/design-tokens');
18
18
  require('../Button/Button.styles.js');
19
+ require('../Button/NavButton.js');
19
20
  require('../CartCard/CartCard.styles.js');
20
21
  require('../CgButton/CgButton.js');
21
22
  require('../CgButton/CgButton.types.js');
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -11,9 +11,9 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
11
11
 
12
12
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
13
13
 
14
- function NavButton(_a) {
14
+ var NavButton = React__default["default"].forwardRef(function (_a, ref) {
15
15
  var badgeBackground = _a.badgeBackground, badgeMinWidth = _a.badgeMinWidth, border = _a.border, borderRadius = _a.borderRadius, buttonBadge = _a.buttonBadge, _b = _a.center, center = _b === void 0 ? true : _b, childGap = _a.childGap, children = _a.children, _c = _a.color, color = _c === void 0 ? 'darkest' : _c, flexReverse = _a.flexReverse, fullWidth = _a.fullWidth, height = _a.height, width = _a.width, hoverBackground = _a.hoverBackground, keepLabel = _a.keepLabel, icon = _a.icon, id = _a.id, isDisabled = _a.isDisabled, loading = _a.loading, minWidth = _a.minWidth, noShadow = _a.noShadow, noWrap = _a.noWrap, onClick = _a.onClick, shadow = _a.shadow, size = _a.size, tabIndex = _a.tabIndex, xsSize = _a.xsSize, props = _tslib.__rest(_a, ["badgeBackground", "badgeMinWidth", "border", "borderRadius", "buttonBadge", "center", "childGap", "children", "color", "flexReverse", "fullWidth", "height", "width", "hoverBackground", "keepLabel", "icon", "id", "isDisabled", "loading", "minWidth", "noShadow", "noWrap", "onClick", "shadow", "size", "tabIndex", "xsSize"]);
16
- return (React__default["default"].createElement(Button_styles.NavButton, _tslib.__assign({ border: border, borderRadius: borderRadius, center: center, childGap: childGap, color: designTokens.theme && designTokens.theme.palette ? designTokens.theme === null || designTokens.theme === void 0 ? void 0 : designTokens.theme.palette[color] : '#333333', disabled: loading || isDisabled, height: height, width: width, hoverBackground: hoverBackground, flexReverse: flexReverse, fullWidth: fullWidth, icon: icon, id: id || 'nav-button', isDisabled: loading || isDisabled, keepLabel: keepLabel, loading: loading || null, minWidth: minWidth, noShadow: noShadow, noWrap: noWrap, onClick: function (e) { return onClick && onClick(e); }, shadow: shadow, size: size, tabIndex: tabIndex, xsSize: xsSize }, props),
16
+ return (React__default["default"].createElement(Button_styles.NavButton, _tslib.__assign({ ref: ref, border: border, borderRadius: borderRadius, center: center, childGap: childGap, color: designTokens.theme && designTokens.theme.palette ? designTokens.theme === null || designTokens.theme === void 0 ? void 0 : designTokens.theme.palette[color] : '#333333', disabled: loading || isDisabled, height: height, width: width, hoverBackground: hoverBackground, flexReverse: flexReverse, fullWidth: fullWidth, icon: icon, id: id || 'nav-button', isDisabled: loading || isDisabled, keepLabel: keepLabel, loading: loading || null, minWidth: minWidth, noShadow: noShadow, noWrap: noWrap, onClick: function (e) { return onClick && onClick(e); }, shadow: shadow, size: size, tabIndex: tabIndex, xsSize: xsSize }, props),
17
17
  loading && (React__default["default"].createElement(Button_styles.Loading, null,
18
18
  React__default["default"].createElement(Button_styles.LoadingContainer, null,
19
19
  React__default["default"].createElement(Button_styles.LoadingSpinner, null)))),
@@ -22,7 +22,8 @@ function NavButton(_a) {
22
22
  icon,
23
23
  children)) : (children),
24
24
  buttonBadge ? (React__default["default"].createElement(Button_styles.ButtonBadge, { background: badgeBackground, minWidth: badgeMinWidth, smallBadge: true }, buttonBadge)) : null));
25
- }
25
+ });
26
+ NavButton.displayName = 'NavButton';
26
27
 
27
28
  exports.NavButton = NavButton;
28
29
  //# sourceMappingURL=NavButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NavButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"NavButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -8,6 +8,7 @@ require('../../../../_virtual/_tslib.js');
8
8
  var designTokens = require('@citygross/design-tokens');
9
9
  require('../Button/Button.styles.js');
10
10
  require('@citygross/typography');
11
+ require('../Button/NavButton.js');
11
12
  var fallback_grocery = require('../ListItem/assets/fallback_grocery.svg.js');
12
13
  var InfoTextBlock_styles = require('./InfoTextBlock.styles.js');
13
14
 
@@ -1 +1 @@
1
- {"version":3,"file":"InfoTextBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"InfoTextBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -14,7 +14,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
14
14
 
15
15
  var Nav = function (_a) {
16
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, searchAriaLabel = _a.searchAriaLabel, 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;
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, searchAriaLabel = _a.searchAriaLabel, searchCancelLabel = _a.searchCancelLabel, searchContainerAriaLabel = _a.searchContainerAriaLabel, 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
18
  var navContainerRef = React.useRef(null);
19
19
  var navChildContainerRef = React.useRef(null);
20
20
  var navRef = React.useRef(null);
@@ -48,12 +48,11 @@ var Nav = function (_a) {
48
48
  setElToRemove(function (prev) { return prev - 1; });
49
49
  }
50
50
  }
51
- else ;
52
51
  setLocalWidth(width);
53
52
  };
54
53
  React.useEffect(function () {
55
54
  var debounce = setTimeout(function () {
56
- checkWidth();
55
+ checkWidth === null || checkWidth === void 0 ? void 0 : checkWidth();
57
56
  }, 300);
58
57
  return function () {
59
58
  clearTimeout(debounce);
@@ -61,21 +60,22 @@ var Nav = function (_a) {
61
60
  }, [
62
61
  width,
63
62
  (_b = navRef === null || navRef === void 0 ? void 0 : navRef.current) === null || _b === void 0 ? void 0 : _b.offsetWidth,
64
- (_c = navChildContainerRef === null || navChildContainerRef === void 0 ? void 0 : navChildContainerRef.current) === null || _c === void 0 ? void 0 : _c.offsetWidth
63
+ (_c = navChildContainerRef === null || navChildContainerRef === void 0 ? void 0 : navChildContainerRef.current) === null || _c === void 0 ? void 0 : _c.offsetWidth,
64
+ localWidth
65
65
  ]);
66
- React__default["default"].useEffect(function () {
66
+ React.useEffect(function () {
67
67
  var handleClick = function (event) {
68
68
  var _a;
69
69
  if ((navContainerRef === null || navContainerRef === void 0 ? void 0 : navContainerRef.current) &&
70
- !((_a = navContainerRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
71
- closeSearch && closeSearch();
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
72
  }
73
73
  };
74
- document.addEventListener('click', function (e) { return handleClick(e); }, true);
74
+ document.addEventListener('click', handleClick, true);
75
75
  return function () {
76
- document.removeEventListener('click', function (e) { return handleClick(e); }, true);
76
+ document.removeEventListener('click', handleClick, true);
77
77
  };
78
- }, [navContainerRef]);
78
+ }, [closeSearch, navContainerRef]);
79
79
  var variants = {
80
80
  closed: {
81
81
  width: '0',
@@ -99,14 +99,8 @@ var Nav = function (_a) {
99
99
  : searchIsOpen
100
100
  ? 'closed'
101
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, { "aria-label": searchAriaLabel, "aria-modal": "true", isOpen: searchIsOpen, ref: searchContainerRef, role: "dialog" },
103
- React__default["default"].createElement(SearchBar.SearchBar, { "aria-label": searchPlaceHolder, cancelLabel: searchCancelLabel, flexGrow: true, icon: searchIcon, inputIcon: inputIcon, inputRef: searchInputRef, isOpen: searchIsOpen, mobileTopPosition: mobileTopPosition, onBlur: onSearchBlur, onChange: searchOnChange, onClick: function () {
104
- onSearchClick && onSearchClick();
105
- }, onKeyDown: function (e) {
106
- if (e.key === 'Enter') {
107
- onSearchClick && onSearchClick();
108
- }
109
- }, placeholder: searchPlaceHolder, searchInputMobileRef: searchInputMobileRef, searchOnSubmit: searchOnSubmit, value: searchValue }, searchResultElement))),
102
+ React__default["default"].createElement(Nav_styles.SearchContainer, { "aria-expanded": searchIsOpen, "aria-label": searchContainerAriaLabel, "aria-modal": "true", isOpen: searchIsOpen, ref: searchContainerRef, role: "dialog" },
103
+ React__default["default"].createElement(SearchBar.SearchBar, { "aria-label": searchAriaLabel, 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))),
110
104
  rightContent)),
111
105
  React__default["default"].createElement(Nav_styles.SearchResultOverlay, { show: searchIsOpen, overlayTopPosition: overlayTopPosition })));
112
106
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Nav.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Nav.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -50,29 +50,25 @@ var SearchBar = function (_a) {
50
50
  }
51
51
  };
52
52
  return (React__default["default"].createElement(React.Fragment, null,
53
- React__default["default"].createElement(SearchBar_styles.SearchBarContainer, { activeBorderColor: activeBorderColor, flexGrow: flexGrow, inputSize: inputSize, isOpen: isOpen },
53
+ React__default["default"].createElement(SearchBar_styles.SearchBarContainer, { activeBorderColor: activeBorderColor, flexGrow: flexGrow, inputSize: inputSize, isOpen: isOpen, role: "search" },
54
54
  React__default["default"].createElement(SearchBar_styles.SearchForm, { hideInMobile: true, isOpen: isOpen, onSubmit: function (e) {
55
55
  e.preventDefault();
56
- searchOnSubmit && searchOnSubmit();
56
+ searchOnSubmit === null || searchOnSubmit === void 0 ? void 0 : searchOnSubmit();
57
57
  } },
58
58
  React__default["default"].createElement(SearchBar_styles.SearchLeftIcon, null, inputIcon),
59
59
  React__default["default"].createElement(SearchBar_styles.SearchInput, _tslib.__assign({ activeBorderColor: activeBorderColor, autoComplete: "off", "data-form-type": "other", "data-lpignore": "true", flexGrow: flexGrow, id: "search-input", inputSize: inputSize, isValid: isValid, ref: inputRef, value: value }, props)),
60
- cancelLabel ? (React__default["default"].createElement(SearchBar_styles.SearchRightLabel, { animate: isOpen ? 'open' : 'closed', initial: 'closed', onClick: function (e) {
61
- e.stopPropagation();
62
- }, variants: iconVariants }, cancelLabel)) : null),
60
+ cancelLabel && (React__default["default"].createElement(SearchBar_styles.SearchRightLabel, { animate: isOpen ? 'open' : 'closed', initial: "closed", onClick: function (e) { return e.stopPropagation(); }, variants: iconVariants }, cancelLabel))),
63
61
  React__default["default"].createElement(SearchBar_styles.MobileSearchIconContainer, null,
64
62
  React__default["default"].createElement(SearchBar_styles.SearchLeftIcon, null, icon)),
65
- React__default["default"].createElement(SearchBar_styles.SearchResultContainer, { animate: isOpen ? 'open' : 'closed', initial: 'closed', isOpen: isOpen, mobileTopPosition: mobileTopPosition, topPosition: resultBoxTopPosition, variants: resultVariants },
63
+ React__default["default"].createElement(SearchBar_styles.SearchResultContainer, { animate: isOpen ? 'open' : 'closed', initial: "closed", isOpen: isOpen, mobileTopPosition: mobileTopPosition, topPosition: resultBoxTopPosition, variants: resultVariants },
66
64
  React__default["default"].createElement(SearchBar_styles.MobileSearchFormContainer, null,
67
65
  React__default["default"].createElement(SearchBar_styles.SearchForm, { onSubmit: function (e) {
68
66
  e.preventDefault();
69
- searchOnSubmit && searchOnSubmit();
67
+ searchOnSubmit === null || searchOnSubmit === void 0 ? void 0 : searchOnSubmit();
70
68
  } },
71
69
  React__default["default"].createElement(SearchBar_styles.SearchLeftIcon, null, inputIcon),
72
70
  React__default["default"].createElement(SearchBar_styles.SearchInput, _tslib.__assign({ activeBorderColor: activeBorderColor, autoComplete: "off", "data-form-type": "other", "data-lpignore": "true", flexGrow: flexGrow, isValid: isValid, ref: searchInputMobileRef, value: value, tabIndex: isOpen ? 0 : -1 }, props)),
73
- cancelLabel ? (React__default["default"].createElement(SearchBar_styles.SearchRightLabel, { onClick: function (e) {
74
- e.stopPropagation();
75
- } }, cancelLabel)) : null)),
71
+ cancelLabel && (React__default["default"].createElement(SearchBar_styles.SearchRightLabel, { onClick: function (e) { return e.stopPropagation(); } }, cancelLabel)))),
76
72
  children))));
77
73
  };
78
74
 
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBar.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"SearchBar.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -16,6 +16,7 @@ require('../Box/Box.styles.js');
16
16
  require('../Button/Button.js');
17
17
  require('@citygross/design-tokens');
18
18
  require('../Button/Button.styles.js');
19
+ require('../Button/NavButton.js');
19
20
  require('../CartCard/CartCard.styles.js');
20
21
  require('../CgButton/CgButton.js');
21
22
  require('../CgButton/CgButton.types.js');
@@ -1 +1 @@
1
- {"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -12,6 +12,7 @@ import '../Box/Box.styles.js';
12
12
  import '../Button/Button.js';
13
13
  import '@citygross/design-tokens';
14
14
  import '../Button/Button.styles.js';
15
+ import '../Button/NavButton.js';
15
16
  import '../CartCard/CartCard.styles.js';
16
17
  import '../CgButton/CgButton.js';
17
18
  import '../CgButton/CgButton.types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"AddressBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -3,9 +3,9 @@ import React from 'react';
3
3
  import { NavButton as NavButton$1, Loading, LoadingContainer, LoadingSpinner, NavButtonIcon, NavButtonChild, ButtonBadge } from './Button.styles.js';
4
4
  import { theme } from '@citygross/design-tokens';
5
5
 
6
- function NavButton(_a) {
6
+ var NavButton = React.forwardRef(function (_a, ref) {
7
7
  var badgeBackground = _a.badgeBackground, badgeMinWidth = _a.badgeMinWidth, border = _a.border, borderRadius = _a.borderRadius, buttonBadge = _a.buttonBadge, _b = _a.center, center = _b === void 0 ? true : _b, childGap = _a.childGap, children = _a.children, _c = _a.color, color = _c === void 0 ? 'darkest' : _c, flexReverse = _a.flexReverse, fullWidth = _a.fullWidth, height = _a.height, width = _a.width, hoverBackground = _a.hoverBackground, keepLabel = _a.keepLabel, icon = _a.icon, id = _a.id, isDisabled = _a.isDisabled, loading = _a.loading, minWidth = _a.minWidth, noShadow = _a.noShadow, noWrap = _a.noWrap, onClick = _a.onClick, shadow = _a.shadow, size = _a.size, tabIndex = _a.tabIndex, xsSize = _a.xsSize, props = __rest(_a, ["badgeBackground", "badgeMinWidth", "border", "borderRadius", "buttonBadge", "center", "childGap", "children", "color", "flexReverse", "fullWidth", "height", "width", "hoverBackground", "keepLabel", "icon", "id", "isDisabled", "loading", "minWidth", "noShadow", "noWrap", "onClick", "shadow", "size", "tabIndex", "xsSize"]);
8
- return (React.createElement(NavButton$1, __assign({ border: border, borderRadius: borderRadius, center: center, childGap: childGap, color: theme && theme.palette ? theme === null || theme === void 0 ? void 0 : theme.palette[color] : '#333333', disabled: loading || isDisabled, height: height, width: width, hoverBackground: hoverBackground, flexReverse: flexReverse, fullWidth: fullWidth, icon: icon, id: id || 'nav-button', isDisabled: loading || isDisabled, keepLabel: keepLabel, loading: loading || null, minWidth: minWidth, noShadow: noShadow, noWrap: noWrap, onClick: function (e) { return onClick && onClick(e); }, shadow: shadow, size: size, tabIndex: tabIndex, xsSize: xsSize }, props),
8
+ return (React.createElement(NavButton$1, __assign({ ref: ref, border: border, borderRadius: borderRadius, center: center, childGap: childGap, color: theme && theme.palette ? theme === null || theme === void 0 ? void 0 : theme.palette[color] : '#333333', disabled: loading || isDisabled, height: height, width: width, hoverBackground: hoverBackground, flexReverse: flexReverse, fullWidth: fullWidth, icon: icon, id: id || 'nav-button', isDisabled: loading || isDisabled, keepLabel: keepLabel, loading: loading || null, minWidth: minWidth, noShadow: noShadow, noWrap: noWrap, onClick: function (e) { return onClick && onClick(e); }, shadow: shadow, size: size, tabIndex: tabIndex, xsSize: xsSize }, props),
9
9
  loading && (React.createElement(Loading, null,
10
10
  React.createElement(LoadingContainer, null,
11
11
  React.createElement(LoadingSpinner, null)))),
@@ -14,7 +14,8 @@ function NavButton(_a) {
14
14
  icon,
15
15
  children)) : (children),
16
16
  buttonBadge ? (React.createElement(ButtonBadge, { background: badgeBackground, minWidth: badgeMinWidth, smallBadge: true }, buttonBadge)) : null));
17
- }
17
+ });
18
+ NavButton.displayName = 'NavButton';
18
19
 
19
20
  export { NavButton };
20
21
  //# sourceMappingURL=NavButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NavButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"NavButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
@@ -4,6 +4,7 @@ import '../../../../_virtual/_tslib.js';
4
4
  import { theme } from '@citygross/design-tokens';
5
5
  import '../Button/Button.styles.js';
6
6
  import '@citygross/typography';
7
+ import '../Button/NavButton.js';
7
8
  import FallbackIcon from '../ListItem/assets/fallback_grocery.svg.js';
8
9
  import { InfoBlock, InfoTextWrapper, ImageContainer, Image, ButtonContainer } from './InfoTextBlock.styles.js';
9
10
 
@@ -1 +1 @@
1
- {"version":3,"file":"InfoTextBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"InfoTextBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -6,7 +6,7 @@ import { Nav as Nav$1, NavContainer, NavChildContainer, NavMainLinks, SearchCont
6
6
 
7
7
  var Nav = function (_a) {
8
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, searchAriaLabel = _a.searchAriaLabel, 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;
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, searchAriaLabel = _a.searchAriaLabel, searchCancelLabel = _a.searchCancelLabel, searchContainerAriaLabel = _a.searchContainerAriaLabel, 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
10
  var navContainerRef = useRef(null);
11
11
  var navChildContainerRef = useRef(null);
12
12
  var navRef = useRef(null);
@@ -40,12 +40,11 @@ var Nav = function (_a) {
40
40
  setElToRemove(function (prev) { return prev - 1; });
41
41
  }
42
42
  }
43
- else ;
44
43
  setLocalWidth(width);
45
44
  };
46
45
  useEffect(function () {
47
46
  var debounce = setTimeout(function () {
48
- checkWidth();
47
+ checkWidth === null || checkWidth === void 0 ? void 0 : checkWidth();
49
48
  }, 300);
50
49
  return function () {
51
50
  clearTimeout(debounce);
@@ -53,21 +52,22 @@ var Nav = function (_a) {
53
52
  }, [
54
53
  width,
55
54
  (_b = navRef === null || navRef === void 0 ? void 0 : navRef.current) === null || _b === void 0 ? void 0 : _b.offsetWidth,
56
- (_c = navChildContainerRef === null || navChildContainerRef === void 0 ? void 0 : navChildContainerRef.current) === null || _c === void 0 ? void 0 : _c.offsetWidth
55
+ (_c = navChildContainerRef === null || navChildContainerRef === void 0 ? void 0 : navChildContainerRef.current) === null || _c === void 0 ? void 0 : _c.offsetWidth,
56
+ localWidth
57
57
  ]);
58
- React.useEffect(function () {
58
+ useEffect(function () {
59
59
  var handleClick = function (event) {
60
60
  var _a;
61
61
  if ((navContainerRef === null || navContainerRef === void 0 ? void 0 : navContainerRef.current) &&
62
- !((_a = navContainerRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
63
- closeSearch && closeSearch();
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
64
  }
65
65
  };
66
- document.addEventListener('click', function (e) { return handleClick(e); }, true);
66
+ document.addEventListener('click', handleClick, true);
67
67
  return function () {
68
- document.removeEventListener('click', function (e) { return handleClick(e); }, true);
68
+ document.removeEventListener('click', handleClick, true);
69
69
  };
70
- }, [navContainerRef]);
70
+ }, [closeSearch, navContainerRef]);
71
71
  var variants = {
72
72
  closed: {
73
73
  width: '0',
@@ -91,14 +91,8 @@ var Nav = function (_a) {
91
91
  : searchIsOpen
92
92
  ? 'closed'
93
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, { "aria-label": searchAriaLabel, "aria-modal": "true", isOpen: searchIsOpen, ref: searchContainerRef, role: "dialog" },
95
- React.createElement(SearchBar, { "aria-label": searchPlaceHolder, cancelLabel: searchCancelLabel, flexGrow: true, icon: searchIcon, inputIcon: inputIcon, inputRef: searchInputRef, isOpen: searchIsOpen, mobileTopPosition: mobileTopPosition, onBlur: onSearchBlur, onChange: searchOnChange, onClick: function () {
96
- onSearchClick && onSearchClick();
97
- }, onKeyDown: function (e) {
98
- if (e.key === 'Enter') {
99
- onSearchClick && onSearchClick();
100
- }
101
- }, placeholder: searchPlaceHolder, searchInputMobileRef: searchInputMobileRef, searchOnSubmit: searchOnSubmit, value: searchValue }, searchResultElement))),
94
+ React.createElement(SearchContainer, { "aria-expanded": searchIsOpen, "aria-label": searchContainerAriaLabel, "aria-modal": "true", isOpen: searchIsOpen, ref: searchContainerRef, role: "dialog" },
95
+ React.createElement(SearchBar, { "aria-label": searchAriaLabel, 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))),
102
96
  rightContent)),
103
97
  React.createElement(SearchResultOverlay, { show: searchIsOpen, overlayTopPosition: overlayTopPosition })));
104
98
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Nav.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Nav.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -42,29 +42,25 @@ var SearchBar = function (_a) {
42
42
  }
43
43
  };
44
44
  return (React.createElement(Fragment, null,
45
- React.createElement(SearchBarContainer, { activeBorderColor: activeBorderColor, flexGrow: flexGrow, inputSize: inputSize, isOpen: isOpen },
45
+ React.createElement(SearchBarContainer, { activeBorderColor: activeBorderColor, flexGrow: flexGrow, inputSize: inputSize, isOpen: isOpen, role: "search" },
46
46
  React.createElement(SearchForm, { hideInMobile: true, isOpen: isOpen, onSubmit: function (e) {
47
47
  e.preventDefault();
48
- searchOnSubmit && searchOnSubmit();
48
+ searchOnSubmit === null || searchOnSubmit === void 0 ? void 0 : searchOnSubmit();
49
49
  } },
50
50
  React.createElement(SearchLeftIcon, null, inputIcon),
51
51
  React.createElement(SearchInput, __assign({ activeBorderColor: activeBorderColor, autoComplete: "off", "data-form-type": "other", "data-lpignore": "true", flexGrow: flexGrow, id: "search-input", inputSize: inputSize, isValid: isValid, ref: inputRef, value: value }, props)),
52
- cancelLabel ? (React.createElement(SearchRightLabel, { animate: isOpen ? 'open' : 'closed', initial: 'closed', onClick: function (e) {
53
- e.stopPropagation();
54
- }, variants: iconVariants }, cancelLabel)) : null),
52
+ cancelLabel && (React.createElement(SearchRightLabel, { animate: isOpen ? 'open' : 'closed', initial: "closed", onClick: function (e) { return e.stopPropagation(); }, variants: iconVariants }, cancelLabel))),
55
53
  React.createElement(MobileSearchIconContainer, null,
56
54
  React.createElement(SearchLeftIcon, null, icon)),
57
- React.createElement(SearchResultContainer, { animate: isOpen ? 'open' : 'closed', initial: 'closed', isOpen: isOpen, mobileTopPosition: mobileTopPosition, topPosition: resultBoxTopPosition, variants: resultVariants },
55
+ React.createElement(SearchResultContainer, { animate: isOpen ? 'open' : 'closed', initial: "closed", isOpen: isOpen, mobileTopPosition: mobileTopPosition, topPosition: resultBoxTopPosition, variants: resultVariants },
58
56
  React.createElement(MobileSearchFormContainer, null,
59
57
  React.createElement(SearchForm, { onSubmit: function (e) {
60
58
  e.preventDefault();
61
- searchOnSubmit && searchOnSubmit();
59
+ searchOnSubmit === null || searchOnSubmit === void 0 ? void 0 : searchOnSubmit();
62
60
  } },
63
61
  React.createElement(SearchLeftIcon, null, inputIcon),
64
62
  React.createElement(SearchInput, __assign({ activeBorderColor: activeBorderColor, autoComplete: "off", "data-form-type": "other", "data-lpignore": "true", flexGrow: flexGrow, isValid: isValid, ref: searchInputMobileRef, value: value, tabIndex: isOpen ? 0 : -1 }, props)),
65
- cancelLabel ? (React.createElement(SearchRightLabel, { onClick: function (e) {
66
- e.stopPropagation();
67
- } }, cancelLabel)) : null)),
63
+ cancelLabel && (React.createElement(SearchRightLabel, { onClick: function (e) { return e.stopPropagation(); } }, cancelLabel)))),
68
64
  children))));
69
65
  };
70
66
 
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBar.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"SearchBar.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -12,6 +12,7 @@ import '../Box/Box.styles.js';
12
12
  import '../Button/Button.js';
13
13
  import '@citygross/design-tokens';
14
14
  import '../Button/Button.styles.js';
15
+ import '../Button/NavButton.js';
15
16
  import '../CartCard/CartCard.styles.js';
16
17
  import '../CgButton/CgButton.js';
17
18
  import '../CgButton/CgButton.types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"WarningLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citygross/components",
3
- "version": "0.8.176",
3
+ "version": "0.8.177",
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": "5ca33b66e00c90f7da86b05803286fb66b778ed8"
77
+ "gitHead": "7eee28e1d4ebf6b6ada7c3b149f6ab4e2f847251"
78
78
  }