@ubnt/store.core 9.22.0-alpha.5 → 9.22.0-alpha.7
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/CHANGELOG.md +8 -0
- package/lib/assets/close2.svg +3 -2
- package/lib/assets/close3.svg +2 -3
- package/lib/assets/udmPro.jpg +0 -0
- package/lib/assets/udmPro2.jpg +0 -0
- package/lib/assets/udmProMax.jpg +0 -0
- package/lib/assets/udmProMax2.jpg +0 -0
- package/lib/components/FeaturesSection_deprecated/FeaturesSection.js +1 -1
- package/lib/components/FeaturesSection_deprecated/FeaturesSection.mjs +1 -1
- package/lib/components/FeaturesSection_deprecated/assets/close.svg.js +1 -1
- package/lib/components/FeaturesSection_deprecated/assets/close.svg.mjs +2 -2
- package/lib/components/Header/Header.types.d.ts +1 -1
- package/lib/components/Header/Header.types.js.map +1 -1
- package/lib/components/Header/Header.types.mjs.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.d.ts +1 -1
- package/lib/components/Header/ProHeader/ProHeader.js +18 -43
- package/lib/components/Header/ProHeader/ProHeader.js.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.mjs +19 -44
- package/lib/components/Header/ProHeader/ProHeader.mjs.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.styles.d.ts +3 -1
- package/lib/components/Header/ProHeader/ProHeader.styles.js +6 -0
- package/lib/components/Header/ProHeader/ProHeader.styles.js.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.styles.mjs +6 -0
- package/lib/components/Header/ProHeader/ProHeader.styles.mjs.map +1 -1
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmPro.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmPro.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProMax.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProMax.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/udmPro.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/Consoles/udmPro.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/udmProMax.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/Consoles/udmProMax.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/data/CloudGateways.js +6 -6
- package/lib/components/ModelCompareV3/data/CloudGateways.mjs +4 -4
- package/lib/components/ModelCompareV3/data/products/express.js +1 -1
- package/lib/components/ModelCompareV3/data/products/express.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/express.mjs +2 -2
- package/lib/components/ModelCompareV3/data/products/express.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/ucgUltra.js +1 -1
- package/lib/components/ModelCompareV3/data/products/ucgUltra.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/ucgUltra.mjs +2 -2
- package/lib/components/ModelCompareV3/data/products/ucgUltra.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udmPro.js +2 -2
- package/lib/components/ModelCompareV3/data/products/udmPro.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udmPro.mjs +3 -3
- package/lib/components/ModelCompareV3/data/products/udmPro.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udmProMax.js +2 -2
- package/lib/components/ModelCompareV3/data/products/udmProMax.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udmProMax.mjs +3 -3
- package/lib/components/ModelCompareV3/data/products/udmProMax.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udmProSpecial.js +1 -1
- package/lib/components/ModelCompareV3/data/products/udmProSpecial.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udmProSpecial.mjs +2 -2
- package/lib/components/ModelCompareV3/data/products/udmProSpecial.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udr.js +1 -1
- package/lib/components/ModelCompareV3/data/products/udr.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udr.mjs +2 -2
- package/lib/components/ModelCompareV3/data/products/udr.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udw.js +1 -1
- package/lib/components/ModelCompareV3/data/products/udw.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udw.mjs +2 -2
- package/lib/components/ModelCompareV3/data/products/udw.mjs.map +1 -1
- package/lib/components/VideoPlayerNew/VideoPlayer.js +1 -1
- package/lib/components/VideoPlayerNew/VideoPlayer.mjs +1 -1
- package/lib/components/VideoPlayerNew/assets/close.svg.js +1 -1
- package/lib/components/VideoPlayerNew/assets/close.svg.mjs +2 -2
- package/lib/constants/proStoreCategories/mapping/unifi.d.ts +1 -1
- package/lib/constants/proStoreCategories/mapping/unifi.js +1 -1
- package/lib/constants/proStoreCategories/mapping/unifi.js.map +1 -1
- package/lib/constants/proStoreCategories/mapping/unifi.mjs +1 -1
- package/lib/constants/proStoreCategories/mapping/unifi.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,14 @@
|
|
|
6
6
|
|
|
7
7
|
## Releases
|
|
8
8
|
|
|
9
|
+
### 9.22.0-alpha.7
|
|
10
|
+
|
|
11
|
+
- [Feat] [NEP-3663](https://ubiquiti.atlassian.net/browse/NEP-3663) abstract inline categories to be the default layout
|
|
12
|
+
|
|
13
|
+
### 9.22.0-alpha.6
|
|
14
|
+
|
|
15
|
+
- [Fix] [NEP-3663](https://ubiquiti.atlassian.net/browse/NEP-3663) fix all cloud gateway slug
|
|
16
|
+
|
|
9
17
|
### 9.22.0-alpha.5
|
|
10
18
|
|
|
11
19
|
- [Feat] [NEP-3663](https://ubiquiti.atlassian.net/browse/NEP-3663) update category mapping and redirects
|
package/lib/assets/close2.svg
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
<svg width="
|
|
2
|
-
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none"
|
|
2
|
+
xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.2175 18.6475C4.9275 18.9375 4.9275 19.4175 5.2175 19.7075C5.5075 19.9975 5.9875 19.9975 6.2775 19.7075L12.4675 13.5175L18.6575 19.7075C18.9475 19.9975 19.4275 19.9975 19.7175 19.7075C20.0075 19.4175 20.0075 18.9375 19.7175 18.6475L13.5275 12.4675L19.7175 6.2775C20.0075 5.9875 20.0075 5.5075 19.7175 5.2175C19.4275 4.9275 18.9475 4.9275 18.6575 5.2175L12.4675 11.4075L6.2775 5.2175C5.9875 4.9275 5.5075 4.9275 5.2175 5.2175C4.9275 5.5075 4.9275 5.9875 5.2175 6.2775L11.4075 12.4675L5.2175 18.6475Z" fill="currentColor"/>
|
|
3
4
|
</svg>
|
package/lib/assets/close3.svg
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
<svg width="
|
|
2
|
-
|
|
3
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.2175 18.6475C4.9275 18.9375 4.9275 19.4175 5.2175 19.7075C5.5075 19.9975 5.9875 19.9975 6.2775 19.7075L12.4675 13.5175L18.6575 19.7075C18.9475 19.9975 19.4275 19.9975 19.7175 19.7075C20.0075 19.4175 20.0075 18.9375 19.7175 18.6475L13.5275 12.4675L19.7175 6.2775C20.0075 5.9875 20.0075 5.5075 19.7175 5.2175C19.4275 4.9275 18.9475 4.9275 18.6575 5.2175L12.4675 11.4075L6.2775 5.2175C5.9875 4.9275 5.5075 4.9275 5.2175 5.2175C4.9275 5.5075 4.9275 5.9875 5.2175 6.2775L11.4075 12.4675L5.2175 18.6475Z" fill="currentColor"/>
|
|
1
|
+
<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.7175 18.6475C5.4275 18.9375 5.4275 19.4175 5.7175 19.7075C6.0075 19.9975 6.4875 19.9975 6.7775 19.7075L12.9675 13.5175L19.1575 19.7075C19.4475 19.9975 19.9275 19.9975 20.2175 19.7075C20.5075 19.4175 20.5075 18.9375 20.2175 18.6475L14.0275 12.4675L20.2175 6.2775C20.5075 5.9875 20.5075 5.5075 20.2175 5.2175C19.9275 4.9275 19.4475 4.9275 19.1575 5.2175L12.9675 11.4075L6.7775 5.2175C6.4875 4.9275 6.0075 4.9275 5.7175 5.2175C5.4275 5.5075 5.4275 5.9875 5.7175 6.2775L11.9075 12.4675L5.7175 18.6475Z" fill="#36373C"/>
|
|
4
3
|
</svg>
|
package/lib/assets/udmPro.jpg
CHANGED
|
Binary file
|
package/lib/assets/udmPro2.jpg
CHANGED
|
Binary file
|
package/lib/assets/udmProMax.jpg
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -14,7 +14,7 @@ var FeaturesSection_styles = require('./FeaturesSection.styles.js');
|
|
|
14
14
|
var useLockBodyScrollCustom = require('../../hooks/useLockBodyScrollCustom.js');
|
|
15
15
|
var Container = require('../Container/Container.js');
|
|
16
16
|
var StyleableSvgImage = require('../StyleableSvgImage/StyleableSvgImage.js');
|
|
17
|
-
var CloseSvg = require("../../assets/
|
|
17
|
+
var CloseSvg = require("../../assets/close2.svg");
|
|
18
18
|
function _interopDefault(e) {
|
|
19
19
|
return e && e.__esModule ? e : {
|
|
20
20
|
default: e
|
|
@@ -12,7 +12,7 @@ import { WrapOuter, OverlayWrap, OverlayClose, Wrap, MetaWrap, SubHeading, Headi
|
|
|
12
12
|
import { useLockBodyScrollCustom } from '../../hooks/useLockBodyScrollCustom.mjs';
|
|
13
13
|
import { Container } from '../Container/Container.mjs';
|
|
14
14
|
import { StyleableSvgImage } from '../StyleableSvgImage/StyleableSvgImage.mjs';
|
|
15
|
-
import CloseSvg__default from "../../assets/
|
|
15
|
+
import CloseSvg__default from "../../assets/close2.svg";
|
|
16
16
|
"use strict";
|
|
17
17
|
const FEATURES_DEFAULT_PLAYBACK = 500;
|
|
18
18
|
const parseTime = time => parseFloat(time.toFixed(3));
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "../../../assets/
|
|
2
|
-
export { default } from "../../../assets/
|
|
1
|
+
export * from "../../../assets/close2.svg";
|
|
2
|
+
export { default } from "../../../assets/close2.svg";
|
|
3
3
|
//# sourceMappingURL=close.svg.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.types.js","sources":["../../../src/components/Header/Header.types.tsx"],"sourcesContent":["import type { Motif } from \"@ubnt/ui-components/utils\";\n\nimport type { Language } from \"../../contexts/MenuContext/mapping\";\nimport type {\n ModalId,\n ParsedNavigationItem,\n ParsedNavigationSubItem,\n ParsedNavigationSubSubItem,\n} from \"../../contexts/MenuContext/types\";\nimport type { Nullish, ProductLine } from \"../../types\";\nimport type {\n CustomImageAsset,\n RenderImageFn,\n} from \"../CustomImage/CustomImage.types\";\nimport type { NavigationMicrositeMenuProps } from \"./Navigation/MicrositeMenu/MicrositeMenu.types\";\nimport type { ProMobileMenuSectionItem } from \"./Navigation/ProMobileMenu/ProMobileMenu.types\";\n\nexport const defaultHeaderTranslations = {\n new: \"New\",\n support: \"Support\",\n purchasedProductHistory: \"Purchased Product History\",\n orderHistory: \"Order History\",\n earlyAccess: \"Early Access\",\n store: \"Store\",\n links: \"Links\",\n company: \"Company\",\n social: \"Social\",\n tools: \"Tools\",\n training: \"Training\",\n continueShopping: \"Continue Shopping\",\n search: {\n placeholder: \"Search...\",\n noMatchesFound: \"Sorry, we couldn't find any matches.\",\n seeAllResults: \"See all results\",\n searchUniFiProducts: \"Search UniFi products\",\n searchUISPProducts: \"Search UISP products\",\n searchAmpliFiProducts: \"Search AmpliFi products\",\n },\n account: {\n login: \"Log In\",\n signUp: \"Sign Up\",\n signOut: \"Sign Out\",\n uiAccount: \"UI Account\",\n unifiSiteManager: \"UniFi Site Manager\",\n manageAccount: \"Manage Account\",\n orderHistory: \"Orders & Addresses\",\n },\n cart: {\n VATincluded: \"VAT Incl.\",\n includesVat: \"Includes VAT of\",\n discount: \"Discount\",\n empty: \"Your cart is empty\",\n review: \"Checkout\",\n shipping: \"Shipping\",\n subtotal: \"Subtotal\",\n total: \"Total price:\",\n itemsTitle: \"Your Cart\",\n upsellTitle: \"Usually bought together\",\n },\n language: {},\n region: \"Region\",\n};\n\nexport interface HeaderAccountCustomer {\n id: string;\n email: string;\n displayName: string;\n picture?: string | null;\n}\n\nexport interface HeaderAccount {\n loading?: boolean;\n customer?: Nullish<HeaderAccountCustomer>;\n handleLogin?: () => void;\n handleLogout?: () => void;\n handleRegister?: () => void;\n handleManageAccount?: () => void;\n handleOrderHistory?: () => void;\n renderStorePicker?: (onClose: () => void) => JSX.Element;\n}\n\nexport interface HeaderSearch {\n /** Trigger search */\n onSearch: (formattedQuerySearchTerm: string) => void;\n loading?: boolean;\n totalItemsCount: number;\n items: Array<{\n id: string;\n url: string;\n image?: CustomImageAsset | null;\n title: string;\n family?: string | null;\n }>;\n}\n\nexport interface HeaderCartItemControls {\n loading?: boolean;\n quantityMax?: number;\n onQuantityChange: (newQuantity: number) => void;\n}\n\nexport interface HeaderCartItem {\n id: string;\n url: string;\n image: Nullish<CustomImageAsset>;\n quantity: number;\n title: string;\n controls: HeaderCartItemControls;\n price: string;\n priceIncludingVAT?: string;\n}\n\nexport interface HeaderCart {\n onReview: () => void;\n loading?: boolean;\n items: HeaderCartItem[];\n upsellItems?: HeaderCartItem[];\n totals: Nullish<{\n shipping: Nullish<string>;\n discount: Nullish<string>;\n finalTax: Nullish<string>;\n total: string;\n totalIncludingVAT?: string;\n }>;\n}\n\nexport type HeaderTranslations = typeof defaultHeaderTranslations;\n\nexport type HeaderEmbedConfig = {\n /**\n * Allows to configure custom callback on home link click\n */\n homeLinkClickHandler?: () => void;\n\n /**\n * Allows to render custom extra section items in Pro Mobile Menu\n */\n mobileMenuExtraSectionItems?: Array<ProMobileMenuSectionItem>;\n\n /**\n * Moves Avatar icon to the left side of the header\n */\n moveAvatarIconToLeft?: boolean;\n\n /**\n * Allows to display avatar as image instead of icon\n */\n displayAvatarAsImage?: boolean;\n\n /**\n * Allows to configure custom callback on avatar click\n */\n avatarClickHandler?: () => void;\n\n /**\n * Allows to hide logo / site title\n */\n hideLogo?: boolean;\n\n /**\n * Allows to hide Avatar icon from the header\n */\n hideAvatarIcon?: boolean;\n\n /**\n * Hide language picker\n */\n hideLanguagePicker?: boolean;\n\n fullWidthHeader?: boolean;\n\n /**\n * Renders site title instead of UI logo\n */\n siteTitle?: string;\n\n /**\n * Blurs search input and dismissed virtual keyboard on touchmove\n */\n /** @deprecated Use blurSearchOnTouchmove */\n hideSearchOnTouchmove?: boolean;\n blurSearchOnTouchmove?: boolean;\n};\n\nexport interface HeaderProps {\n className?: string;\n motif: Motif;\n /**\n * Main header bar becomes fixed position at the top\n */\n sticky?: boolean;\n /**\n * Navigation carousel becomes fixed position at the top\n */\n stickyCarousel?: boolean;\n translations?: HeaderTranslations;\n renderImage: RenderImageFn;\n showLineLoader?: boolean;\n onModalOpen?: () => void;\n onMenuItemLinkClick?: (\n e: React.MouseEvent<HTMLElement>,\n item: ParsedNavigationItem,\n ) => void;\n onMenuSubItemLinkClick?: (\n e: React.MouseEvent<HTMLElement>,\n item: ParsedNavigationSubItem | ParsedNavigationSubSubItem,\n ) => void;\n\n onLanguageChange?: (\n e: React.MouseEvent<HTMLElement>,\n link: string,\n language: Language,\n ) => void;\n\n // Account\n account?: HeaderAccount;\n\n // Search\n onSearchResultsAction?: (searchTerm: string) => void;\n search?: HeaderSearch;\n\n // Cart\n onCartClick?: () => void;\n cart?: HeaderCart;\n\n // Set specific modal to be open initially\n initialActiveModal?: Nullish<ModalId>;\n /**\n * Triggers on active modal change\n */\n onActiveModal?: (id: ModalId | null, prevModalId: ModalId | null) => void;\n\n /**\n * Will be called before navigating to store search, the tracking request in this callback will only\n * finish if called from store side as microsites are not using next router.\n */\n trackStoreSearchClick?: () => void;\n\n transparentHeader?: boolean;\n\n /**\n * Sub-menu used for microsites\n */\n micrositeMenu?: NavigationMicrositeMenuProps;\n\n /**\n * Header customizations for embed context like WebView\n */\n embedConfig?: HeaderEmbedConfig;\n\n accountMenu?: React.ReactNode;\n}\n\nexport type IsolatedHeaderProps = {\n className?: string;\n motif: Motif;\n translations?: HeaderTranslations;\n handleContinueShopping: () => void;\n showLineLoader?: boolean;\n account?: {\n loading?: HeaderAccount[\"loading\"];\n customer?: {\n picture?: HeaderAccountCustomer[\"picture\"];\n };\n };\n} & Pick<HeaderProps, \"embedConfig\">;\n\nexport interface ProHeaderEarlyAccess {\n loading?: boolean;\n onClick: () => void;\n}\n\nexport interface HeaderProductLineOption {\n value: ProductLine;\n label: string;\n}\n\nexport interface ProHeaderCategories {\n items: ProMobileMenuSectionItem[];\n activeIndex: number;\n}\n\nexport type ProHeaderProps = Pick<\n HeaderProps,\n | \"className\"\n | \"motif\"\n | \"cart\"\n | \"account\"\n | \"translations\"\n | \"onModalOpen\"\n | \"onCartClick\"\n | \"showLineLoader\"\n | \"accountMenu\"\n> & {\n /**\n * Header customizations for embed context like WebView\n */\n embedConfig?: HeaderEmbedConfig;\n\n // Country picker\n currentCountryName?: string;\n handleStorePickerClick?: () => void;\n\n // Early access button\n earlyAccess?: ProHeaderEarlyAccess;\n\n // Purchase History button\n handlePurchaseHistoryClick?: () => void;\n\n // Order button\n handleOrderHistoryClick?: () => void;\n\n // Product line picker\n productLineOptions?: HeaderProductLineOption[];\n productLineValue?: ProductLine;\n handleProductLineChange?: (type: ProductLine) => void;\n\n // Mobile menu aka \"hamburger\" button click\n handleMobileMenuClick?: () => void;\n\n onLanguageChange?: (\n e: React.MouseEvent<HTMLElement>,\n link: string,\n language: Language,\n ) => void;\n\n // Search\n searchValue?: string;\n onSearch?: (searchTerm: string) => void;\n\n onSearchFocus?: () => void;\n onSearchBlur?: () => void;\n onSearchClick?: () => void;\n\n // Categories used for mobile menu\n categories: ProHeaderCategories;\n useInlineCategories?: boolean;\n};\n"],"names":["defaultHeaderTranslations","new","support","purchasedProductHistory","orderHistory","earlyAccess","store","links","company","social","tools","training","continueShopping","search","placeholder","noMatchesFound","seeAllResults","searchUniFiProducts","searchUISPProducts","searchAmpliFiProducts","account","login","signUp","signOut","uiAccount","unifiSiteManager","manageAccount","cart","VATincluded","includesVat","discount","empty","review","shipping","subtotal","total","itemsTitle","upsellTitle","language","region"],"mappings":";;;AAiBO,MAAMA,yBAA4B,GAAA;EACvCC,GAAK,EAAA,KAAA;EACLC,OAAS,EAAA,SAAA;EACTC,uBAAyB,EAAA,2BAAA;EACzBC,YAAc,EAAA,eAAA;EACdC,WAAa,EAAA,cAAA;EACbC,KAAO,EAAA,OAAA;EACPC,KAAO,EAAA,OAAA;EACPC,OAAS,EAAA,SAAA;EACTC,MAAQ,EAAA,QAAA;EACRC,KAAO,EAAA,OAAA;EACPC,QAAU,EAAA,UAAA;EACVC,gBAAkB,EAAA,mBAAA;EAClBC,MAAQ,EAAA;IACNC,WAAa,EAAA,WAAA;IACbC,cAAgB,EAAA,sCAAA;IAChBC,aAAe,EAAA,iBAAA;IACfC,mBAAqB,EAAA,uBAAA;IACrBC,kBAAoB,EAAA,sBAAA;IACpBC,qBAAuB,EAAA;EACzB,CAAA;EACAC,OAAS,EAAA;IACPC,KAAO,EAAA,QAAA;IACPC,MAAQ,EAAA,SAAA;IACRC,OAAS,EAAA,UAAA;IACTC,SAAW,EAAA,YAAA;IACXC,gBAAkB,EAAA,oBAAA;IAClBC,aAAe,EAAA,gBAAA;IACftB,YAAc,EAAA;EAChB,CAAA;EACAuB,IAAM,EAAA;IACJC,WAAa,EAAA,WAAA;IACbC,WAAa,EAAA,iBAAA;IACbC,QAAU,EAAA,UAAA;IACVC,KAAO,EAAA,oBAAA;IACPC,MAAQ,EAAA,UAAA;IACRC,QAAU,EAAA,UAAA;IACVC,QAAU,EAAA,UAAA;IACVC,KAAO,EAAA,cAAA;IACPC,UAAY,EAAA,WAAA;IACZC,WAAa,EAAA;EACf,CAAA;EACAC,UAAU,CAAC,CAAA;EACXC,MAAQ,EAAA;AACV,CAAA;"}
|
|
1
|
+
{"version":3,"file":"Header.types.js","sources":["../../../src/components/Header/Header.types.tsx"],"sourcesContent":["import type { Motif } from \"@ubnt/ui-components/utils\";\n\nimport type { Language } from \"../../contexts/MenuContext/mapping\";\nimport type {\n ModalId,\n ParsedNavigationItem,\n ParsedNavigationSubItem,\n ParsedNavigationSubSubItem,\n} from \"../../contexts/MenuContext/types\";\nimport type { Nullish, ProductLine } from \"../../types\";\nimport type {\n CustomImageAsset,\n RenderImageFn,\n} from \"../CustomImage/CustomImage.types\";\nimport type { NavigationMicrositeMenuProps } from \"./Navigation/MicrositeMenu/MicrositeMenu.types\";\nimport type { ProMobileMenuSectionItem } from \"./Navigation/ProMobileMenu/ProMobileMenu.types\";\n\nexport const defaultHeaderTranslations = {\n new: \"New\",\n support: \"Support\",\n purchasedProductHistory: \"Purchased Product History\",\n orderHistory: \"Order History\",\n earlyAccess: \"Early Access\",\n store: \"Store\",\n links: \"Links\",\n company: \"Company\",\n social: \"Social\",\n tools: \"Tools\",\n training: \"Training\",\n continueShopping: \"Continue Shopping\",\n search: {\n placeholder: \"Search...\",\n noMatchesFound: \"Sorry, we couldn't find any matches.\",\n seeAllResults: \"See all results\",\n searchUniFiProducts: \"Search UniFi products\",\n searchUISPProducts: \"Search UISP products\",\n searchAmpliFiProducts: \"Search AmpliFi products\",\n },\n account: {\n login: \"Log In\",\n signUp: \"Sign Up\",\n signOut: \"Sign Out\",\n uiAccount: \"UI Account\",\n unifiSiteManager: \"UniFi Site Manager\",\n manageAccount: \"Manage Account\",\n orderHistory: \"Orders & Addresses\",\n },\n cart: {\n VATincluded: \"VAT Incl.\",\n includesVat: \"Includes VAT of\",\n discount: \"Discount\",\n empty: \"Your cart is empty\",\n review: \"Checkout\",\n shipping: \"Shipping\",\n subtotal: \"Subtotal\",\n total: \"Total price:\",\n itemsTitle: \"Your Cart\",\n upsellTitle: \"Usually bought together\",\n },\n language: {},\n region: \"Region\",\n};\n\nexport interface HeaderAccountCustomer {\n id: string;\n email: string;\n displayName: string;\n picture?: string | null;\n}\n\nexport interface HeaderAccount {\n loading?: boolean;\n customer?: Nullish<HeaderAccountCustomer>;\n handleLogin?: () => void;\n handleLogout?: () => void;\n handleRegister?: () => void;\n handleManageAccount?: () => void;\n handleOrderHistory?: () => void;\n renderStorePicker?: (onClose: () => void) => JSX.Element;\n}\n\nexport interface HeaderSearch {\n /** Trigger search */\n onSearch: (formattedQuerySearchTerm: string) => void;\n loading?: boolean;\n totalItemsCount: number;\n items: Array<{\n id: string;\n url: string;\n image?: CustomImageAsset | null;\n title: string;\n family?: string | null;\n }>;\n}\n\nexport interface HeaderCartItemControls {\n loading?: boolean;\n quantityMax?: number;\n onQuantityChange: (newQuantity: number) => void;\n}\n\nexport interface HeaderCartItem {\n id: string;\n url: string;\n image: Nullish<CustomImageAsset>;\n quantity: number;\n title: string;\n controls: HeaderCartItemControls;\n price: string;\n priceIncludingVAT?: string;\n}\n\nexport interface HeaderCart {\n onReview: () => void;\n loading?: boolean;\n items: HeaderCartItem[];\n upsellItems?: HeaderCartItem[];\n totals: Nullish<{\n shipping: Nullish<string>;\n discount: Nullish<string>;\n finalTax: Nullish<string>;\n total: string;\n totalIncludingVAT?: string;\n }>;\n}\n\nexport type HeaderTranslations = typeof defaultHeaderTranslations;\n\nexport type HeaderEmbedConfig = {\n /**\n * Allows to configure custom callback on home link click\n */\n homeLinkClickHandler?: () => void;\n\n /**\n * Allows to render custom extra section items in Pro Mobile Menu\n */\n mobileMenuExtraSectionItems?: Array<ProMobileMenuSectionItem>;\n\n /**\n * Moves Avatar icon to the left side of the header\n */\n moveAvatarIconToLeft?: boolean;\n\n /**\n * Allows to display avatar as image instead of icon\n */\n displayAvatarAsImage?: boolean;\n\n /**\n * Allows to configure custom callback on avatar click\n */\n avatarClickHandler?: () => void;\n\n /**\n * Allows to hide logo / site title\n */\n hideLogo?: boolean;\n\n /**\n * Allows to hide Avatar icon from the header\n */\n hideAvatarIcon?: boolean;\n\n /**\n * Hide language picker\n */\n hideLanguagePicker?: boolean;\n\n fullWidthHeader?: boolean;\n\n /**\n * Renders site title instead of UI logo\n */\n siteTitle?: string;\n\n /**\n * Blurs search input and dismissed virtual keyboard on touchmove\n */\n /** @deprecated Use blurSearchOnTouchmove */\n hideSearchOnTouchmove?: boolean;\n blurSearchOnTouchmove?: boolean;\n};\n\nexport interface HeaderProps {\n className?: string;\n motif: Motif;\n /**\n * Main header bar becomes fixed position at the top\n */\n sticky?: boolean;\n /**\n * Navigation carousel becomes fixed position at the top\n */\n stickyCarousel?: boolean;\n translations?: HeaderTranslations;\n renderImage: RenderImageFn;\n showLineLoader?: boolean;\n onModalOpen?: () => void;\n onMenuItemLinkClick?: (\n e: React.MouseEvent<HTMLElement>,\n item: ParsedNavigationItem,\n ) => void;\n onMenuSubItemLinkClick?: (\n e: React.MouseEvent<HTMLElement>,\n item: ParsedNavigationSubItem | ParsedNavigationSubSubItem,\n ) => void;\n\n onLanguageChange?: (\n e: React.MouseEvent<HTMLElement>,\n link: string,\n language: Language,\n ) => void;\n\n // Account\n account?: HeaderAccount;\n\n // Search\n onSearchResultsAction?: (searchTerm: string) => void;\n search?: HeaderSearch;\n\n // Cart\n onCartClick?: () => void;\n cart?: HeaderCart;\n\n // Set specific modal to be open initially\n initialActiveModal?: Nullish<ModalId>;\n /**\n * Triggers on active modal change\n */\n onActiveModal?: (id: ModalId | null, prevModalId: ModalId | null) => void;\n\n /**\n * Will be called before navigating to store search, the tracking request in this callback will only\n * finish if called from store side as microsites are not using next router.\n */\n trackStoreSearchClick?: () => void;\n\n transparentHeader?: boolean;\n\n /**\n * Sub-menu used for microsites\n */\n micrositeMenu?: NavigationMicrositeMenuProps;\n\n /**\n * Header customizations for embed context like WebView\n */\n embedConfig?: HeaderEmbedConfig;\n\n accountMenu?: React.ReactNode;\n}\n\nexport type IsolatedHeaderProps = {\n className?: string;\n motif: Motif;\n translations?: HeaderTranslations;\n handleContinueShopping: () => void;\n showLineLoader?: boolean;\n account?: {\n loading?: HeaderAccount[\"loading\"];\n customer?: {\n picture?: HeaderAccountCustomer[\"picture\"];\n };\n };\n} & Pick<HeaderProps, \"embedConfig\">;\n\nexport interface ProHeaderEarlyAccess {\n loading?: boolean;\n onClick: () => void;\n}\n\nexport interface HeaderProductLineOption {\n value: ProductLine;\n label: string;\n}\n\nexport interface ProHeaderCategories {\n items: ProMobileMenuSectionItem[];\n activeIndex: number;\n}\n\nexport type ProHeaderProps = Pick<\n HeaderProps,\n | \"className\"\n | \"motif\"\n | \"cart\"\n | \"account\"\n | \"translations\"\n | \"onModalOpen\"\n | \"onCartClick\"\n | \"showLineLoader\"\n | \"accountMenu\"\n> & {\n /**\n * Header customizations for embed context like WebView\n */\n embedConfig?: HeaderEmbedConfig;\n\n // Country picker\n currentCountryName?: string;\n handleStorePickerClick?: () => void;\n\n // Early access button\n earlyAccess?: ProHeaderEarlyAccess;\n\n // Purchase History button\n handlePurchaseHistoryClick?: () => void;\n\n // Order button\n handleOrderHistoryClick?: () => void;\n\n // Product line picker\n productLineOptions?: HeaderProductLineOption[];\n productLineValue?: ProductLine;\n handleProductLineChange?: (type: ProductLine) => void;\n\n // Mobile menu aka \"hamburger\" button click\n handleMobileMenuClick?: () => void;\n\n onLanguageChange?: (\n e: React.MouseEvent<HTMLElement>,\n link: string,\n language: Language,\n ) => void;\n\n // Search\n searchValue?: string;\n onSearch?: (searchTerm: string) => void;\n\n onSearchFocus?: () => void;\n onSearchBlur?: () => void;\n onSearchClick?: () => void;\n\n // Categories used for menu\n categories: ProHeaderCategories;\n hideInlineCategories?: boolean;\n};\n"],"names":["defaultHeaderTranslations","new","support","purchasedProductHistory","orderHistory","earlyAccess","store","links","company","social","tools","training","continueShopping","search","placeholder","noMatchesFound","seeAllResults","searchUniFiProducts","searchUISPProducts","searchAmpliFiProducts","account","login","signUp","signOut","uiAccount","unifiSiteManager","manageAccount","cart","VATincluded","includesVat","discount","empty","review","shipping","subtotal","total","itemsTitle","upsellTitle","language","region"],"mappings":";;;AAiBO,MAAMA,yBAA4B,GAAA;EACvCC,GAAK,EAAA,KAAA;EACLC,OAAS,EAAA,SAAA;EACTC,uBAAyB,EAAA,2BAAA;EACzBC,YAAc,EAAA,eAAA;EACdC,WAAa,EAAA,cAAA;EACbC,KAAO,EAAA,OAAA;EACPC,KAAO,EAAA,OAAA;EACPC,OAAS,EAAA,SAAA;EACTC,MAAQ,EAAA,QAAA;EACRC,KAAO,EAAA,OAAA;EACPC,QAAU,EAAA,UAAA;EACVC,gBAAkB,EAAA,mBAAA;EAClBC,MAAQ,EAAA;IACNC,WAAa,EAAA,WAAA;IACbC,cAAgB,EAAA,sCAAA;IAChBC,aAAe,EAAA,iBAAA;IACfC,mBAAqB,EAAA,uBAAA;IACrBC,kBAAoB,EAAA,sBAAA;IACpBC,qBAAuB,EAAA;EACzB,CAAA;EACAC,OAAS,EAAA;IACPC,KAAO,EAAA,QAAA;IACPC,MAAQ,EAAA,SAAA;IACRC,OAAS,EAAA,UAAA;IACTC,SAAW,EAAA,YAAA;IACXC,gBAAkB,EAAA,oBAAA;IAClBC,aAAe,EAAA,gBAAA;IACftB,YAAc,EAAA;EAChB,CAAA;EACAuB,IAAM,EAAA;IACJC,WAAa,EAAA,WAAA;IACbC,WAAa,EAAA,iBAAA;IACbC,QAAU,EAAA,UAAA;IACVC,KAAO,EAAA,oBAAA;IACPC,MAAQ,EAAA,UAAA;IACRC,QAAU,EAAA,UAAA;IACVC,QAAU,EAAA,UAAA;IACVC,KAAO,EAAA,cAAA;IACPC,UAAY,EAAA,WAAA;IACZC,WAAa,EAAA;EACf,CAAA;EACAC,UAAU,CAAC,CAAA;EACXC,MAAQ,EAAA;AACV,CAAA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.types.mjs","sources":["../../../src/components/Header/Header.types.tsx"],"sourcesContent":["import type { Motif } from \"@ubnt/ui-components/utils\";\n\nimport type { Language } from \"../../contexts/MenuContext/mapping\";\nimport type {\n ModalId,\n ParsedNavigationItem,\n ParsedNavigationSubItem,\n ParsedNavigationSubSubItem,\n} from \"../../contexts/MenuContext/types\";\nimport type { Nullish, ProductLine } from \"../../types\";\nimport type {\n CustomImageAsset,\n RenderImageFn,\n} from \"../CustomImage/CustomImage.types\";\nimport type { NavigationMicrositeMenuProps } from \"./Navigation/MicrositeMenu/MicrositeMenu.types\";\nimport type { ProMobileMenuSectionItem } from \"./Navigation/ProMobileMenu/ProMobileMenu.types\";\n\nexport const defaultHeaderTranslations = {\n new: \"New\",\n support: \"Support\",\n purchasedProductHistory: \"Purchased Product History\",\n orderHistory: \"Order History\",\n earlyAccess: \"Early Access\",\n store: \"Store\",\n links: \"Links\",\n company: \"Company\",\n social: \"Social\",\n tools: \"Tools\",\n training: \"Training\",\n continueShopping: \"Continue Shopping\",\n search: {\n placeholder: \"Search...\",\n noMatchesFound: \"Sorry, we couldn't find any matches.\",\n seeAllResults: \"See all results\",\n searchUniFiProducts: \"Search UniFi products\",\n searchUISPProducts: \"Search UISP products\",\n searchAmpliFiProducts: \"Search AmpliFi products\",\n },\n account: {\n login: \"Log In\",\n signUp: \"Sign Up\",\n signOut: \"Sign Out\",\n uiAccount: \"UI Account\",\n unifiSiteManager: \"UniFi Site Manager\",\n manageAccount: \"Manage Account\",\n orderHistory: \"Orders & Addresses\",\n },\n cart: {\n VATincluded: \"VAT Incl.\",\n includesVat: \"Includes VAT of\",\n discount: \"Discount\",\n empty: \"Your cart is empty\",\n review: \"Checkout\",\n shipping: \"Shipping\",\n subtotal: \"Subtotal\",\n total: \"Total price:\",\n itemsTitle: \"Your Cart\",\n upsellTitle: \"Usually bought together\",\n },\n language: {},\n region: \"Region\",\n};\n\nexport interface HeaderAccountCustomer {\n id: string;\n email: string;\n displayName: string;\n picture?: string | null;\n}\n\nexport interface HeaderAccount {\n loading?: boolean;\n customer?: Nullish<HeaderAccountCustomer>;\n handleLogin?: () => void;\n handleLogout?: () => void;\n handleRegister?: () => void;\n handleManageAccount?: () => void;\n handleOrderHistory?: () => void;\n renderStorePicker?: (onClose: () => void) => JSX.Element;\n}\n\nexport interface HeaderSearch {\n /** Trigger search */\n onSearch: (formattedQuerySearchTerm: string) => void;\n loading?: boolean;\n totalItemsCount: number;\n items: Array<{\n id: string;\n url: string;\n image?: CustomImageAsset | null;\n title: string;\n family?: string | null;\n }>;\n}\n\nexport interface HeaderCartItemControls {\n loading?: boolean;\n quantityMax?: number;\n onQuantityChange: (newQuantity: number) => void;\n}\n\nexport interface HeaderCartItem {\n id: string;\n url: string;\n image: Nullish<CustomImageAsset>;\n quantity: number;\n title: string;\n controls: HeaderCartItemControls;\n price: string;\n priceIncludingVAT?: string;\n}\n\nexport interface HeaderCart {\n onReview: () => void;\n loading?: boolean;\n items: HeaderCartItem[];\n upsellItems?: HeaderCartItem[];\n totals: Nullish<{\n shipping: Nullish<string>;\n discount: Nullish<string>;\n finalTax: Nullish<string>;\n total: string;\n totalIncludingVAT?: string;\n }>;\n}\n\nexport type HeaderTranslations = typeof defaultHeaderTranslations;\n\nexport type HeaderEmbedConfig = {\n /**\n * Allows to configure custom callback on home link click\n */\n homeLinkClickHandler?: () => void;\n\n /**\n * Allows to render custom extra section items in Pro Mobile Menu\n */\n mobileMenuExtraSectionItems?: Array<ProMobileMenuSectionItem>;\n\n /**\n * Moves Avatar icon to the left side of the header\n */\n moveAvatarIconToLeft?: boolean;\n\n /**\n * Allows to display avatar as image instead of icon\n */\n displayAvatarAsImage?: boolean;\n\n /**\n * Allows to configure custom callback on avatar click\n */\n avatarClickHandler?: () => void;\n\n /**\n * Allows to hide logo / site title\n */\n hideLogo?: boolean;\n\n /**\n * Allows to hide Avatar icon from the header\n */\n hideAvatarIcon?: boolean;\n\n /**\n * Hide language picker\n */\n hideLanguagePicker?: boolean;\n\n fullWidthHeader?: boolean;\n\n /**\n * Renders site title instead of UI logo\n */\n siteTitle?: string;\n\n /**\n * Blurs search input and dismissed virtual keyboard on touchmove\n */\n /** @deprecated Use blurSearchOnTouchmove */\n hideSearchOnTouchmove?: boolean;\n blurSearchOnTouchmove?: boolean;\n};\n\nexport interface HeaderProps {\n className?: string;\n motif: Motif;\n /**\n * Main header bar becomes fixed position at the top\n */\n sticky?: boolean;\n /**\n * Navigation carousel becomes fixed position at the top\n */\n stickyCarousel?: boolean;\n translations?: HeaderTranslations;\n renderImage: RenderImageFn;\n showLineLoader?: boolean;\n onModalOpen?: () => void;\n onMenuItemLinkClick?: (\n e: React.MouseEvent<HTMLElement>,\n item: ParsedNavigationItem,\n ) => void;\n onMenuSubItemLinkClick?: (\n e: React.MouseEvent<HTMLElement>,\n item: ParsedNavigationSubItem | ParsedNavigationSubSubItem,\n ) => void;\n\n onLanguageChange?: (\n e: React.MouseEvent<HTMLElement>,\n link: string,\n language: Language,\n ) => void;\n\n // Account\n account?: HeaderAccount;\n\n // Search\n onSearchResultsAction?: (searchTerm: string) => void;\n search?: HeaderSearch;\n\n // Cart\n onCartClick?: () => void;\n cart?: HeaderCart;\n\n // Set specific modal to be open initially\n initialActiveModal?: Nullish<ModalId>;\n /**\n * Triggers on active modal change\n */\n onActiveModal?: (id: ModalId | null, prevModalId: ModalId | null) => void;\n\n /**\n * Will be called before navigating to store search, the tracking request in this callback will only\n * finish if called from store side as microsites are not using next router.\n */\n trackStoreSearchClick?: () => void;\n\n transparentHeader?: boolean;\n\n /**\n * Sub-menu used for microsites\n */\n micrositeMenu?: NavigationMicrositeMenuProps;\n\n /**\n * Header customizations for embed context like WebView\n */\n embedConfig?: HeaderEmbedConfig;\n\n accountMenu?: React.ReactNode;\n}\n\nexport type IsolatedHeaderProps = {\n className?: string;\n motif: Motif;\n translations?: HeaderTranslations;\n handleContinueShopping: () => void;\n showLineLoader?: boolean;\n account?: {\n loading?: HeaderAccount[\"loading\"];\n customer?: {\n picture?: HeaderAccountCustomer[\"picture\"];\n };\n };\n} & Pick<HeaderProps, \"embedConfig\">;\n\nexport interface ProHeaderEarlyAccess {\n loading?: boolean;\n onClick: () => void;\n}\n\nexport interface HeaderProductLineOption {\n value: ProductLine;\n label: string;\n}\n\nexport interface ProHeaderCategories {\n items: ProMobileMenuSectionItem[];\n activeIndex: number;\n}\n\nexport type ProHeaderProps = Pick<\n HeaderProps,\n | \"className\"\n | \"motif\"\n | \"cart\"\n | \"account\"\n | \"translations\"\n | \"onModalOpen\"\n | \"onCartClick\"\n | \"showLineLoader\"\n | \"accountMenu\"\n> & {\n /**\n * Header customizations for embed context like WebView\n */\n embedConfig?: HeaderEmbedConfig;\n\n // Country picker\n currentCountryName?: string;\n handleStorePickerClick?: () => void;\n\n // Early access button\n earlyAccess?: ProHeaderEarlyAccess;\n\n // Purchase History button\n handlePurchaseHistoryClick?: () => void;\n\n // Order button\n handleOrderHistoryClick?: () => void;\n\n // Product line picker\n productLineOptions?: HeaderProductLineOption[];\n productLineValue?: ProductLine;\n handleProductLineChange?: (type: ProductLine) => void;\n\n // Mobile menu aka \"hamburger\" button click\n handleMobileMenuClick?: () => void;\n\n onLanguageChange?: (\n e: React.MouseEvent<HTMLElement>,\n link: string,\n language: Language,\n ) => void;\n\n // Search\n searchValue?: string;\n onSearch?: (searchTerm: string) => void;\n\n onSearchFocus?: () => void;\n onSearchBlur?: () => void;\n onSearchClick?: () => void;\n\n // Categories used for mobile menu\n categories: ProHeaderCategories;\n useInlineCategories?: boolean;\n};\n"],"names":["defaultHeaderTranslations","new","support","purchasedProductHistory","orderHistory","earlyAccess","store","links","company","social","tools","training","continueShopping","search","placeholder","noMatchesFound","seeAllResults","searchUniFiProducts","searchUISPProducts","searchAmpliFiProducts","account","login","signUp","signOut","uiAccount","unifiSiteManager","manageAccount","cart","VATincluded","includesVat","discount","empty","review","shipping","subtotal","total","itemsTitle","upsellTitle","language","region"],"mappings":";;AAiBO,MAAMA,yBAA4B,GAAA;EACvCC,GAAK,EAAA,KAAA;EACLC,OAAS,EAAA,SAAA;EACTC,uBAAyB,EAAA,2BAAA;EACzBC,YAAc,EAAA,eAAA;EACdC,WAAa,EAAA,cAAA;EACbC,KAAO,EAAA,OAAA;EACPC,KAAO,EAAA,OAAA;EACPC,OAAS,EAAA,SAAA;EACTC,MAAQ,EAAA,QAAA;EACRC,KAAO,EAAA,OAAA;EACPC,QAAU,EAAA,UAAA;EACVC,gBAAkB,EAAA,mBAAA;EAClBC,MAAQ,EAAA;IACNC,WAAa,EAAA,WAAA;IACbC,cAAgB,EAAA,sCAAA;IAChBC,aAAe,EAAA,iBAAA;IACfC,mBAAqB,EAAA,uBAAA;IACrBC,kBAAoB,EAAA,sBAAA;IACpBC,qBAAuB,EAAA;EACzB,CAAA;EACAC,OAAS,EAAA;IACPC,KAAO,EAAA,QAAA;IACPC,MAAQ,EAAA,SAAA;IACRC,OAAS,EAAA,UAAA;IACTC,SAAW,EAAA,YAAA;IACXC,gBAAkB,EAAA,oBAAA;IAClBC,aAAe,EAAA,gBAAA;IACftB,YAAc,EAAA;EAChB,CAAA;EACAuB,IAAM,EAAA;IACJC,WAAa,EAAA,WAAA;IACbC,WAAa,EAAA,iBAAA;IACbC,QAAU,EAAA,UAAA;IACVC,KAAO,EAAA,oBAAA;IACPC,MAAQ,EAAA,UAAA;IACRC,QAAU,EAAA,UAAA;IACVC,QAAU,EAAA,UAAA;IACVC,KAAO,EAAA,cAAA;IACPC,UAAY,EAAA,WAAA;IACZC,WAAa,EAAA;EACf,CAAA;EACAC,UAAU,CAAC,CAAA;EACXC,MAAQ,EAAA;AACV,CAAA;"}
|
|
1
|
+
{"version":3,"file":"Header.types.mjs","sources":["../../../src/components/Header/Header.types.tsx"],"sourcesContent":["import type { Motif } from \"@ubnt/ui-components/utils\";\n\nimport type { Language } from \"../../contexts/MenuContext/mapping\";\nimport type {\n ModalId,\n ParsedNavigationItem,\n ParsedNavigationSubItem,\n ParsedNavigationSubSubItem,\n} from \"../../contexts/MenuContext/types\";\nimport type { Nullish, ProductLine } from \"../../types\";\nimport type {\n CustomImageAsset,\n RenderImageFn,\n} from \"../CustomImage/CustomImage.types\";\nimport type { NavigationMicrositeMenuProps } from \"./Navigation/MicrositeMenu/MicrositeMenu.types\";\nimport type { ProMobileMenuSectionItem } from \"./Navigation/ProMobileMenu/ProMobileMenu.types\";\n\nexport const defaultHeaderTranslations = {\n new: \"New\",\n support: \"Support\",\n purchasedProductHistory: \"Purchased Product History\",\n orderHistory: \"Order History\",\n earlyAccess: \"Early Access\",\n store: \"Store\",\n links: \"Links\",\n company: \"Company\",\n social: \"Social\",\n tools: \"Tools\",\n training: \"Training\",\n continueShopping: \"Continue Shopping\",\n search: {\n placeholder: \"Search...\",\n noMatchesFound: \"Sorry, we couldn't find any matches.\",\n seeAllResults: \"See all results\",\n searchUniFiProducts: \"Search UniFi products\",\n searchUISPProducts: \"Search UISP products\",\n searchAmpliFiProducts: \"Search AmpliFi products\",\n },\n account: {\n login: \"Log In\",\n signUp: \"Sign Up\",\n signOut: \"Sign Out\",\n uiAccount: \"UI Account\",\n unifiSiteManager: \"UniFi Site Manager\",\n manageAccount: \"Manage Account\",\n orderHistory: \"Orders & Addresses\",\n },\n cart: {\n VATincluded: \"VAT Incl.\",\n includesVat: \"Includes VAT of\",\n discount: \"Discount\",\n empty: \"Your cart is empty\",\n review: \"Checkout\",\n shipping: \"Shipping\",\n subtotal: \"Subtotal\",\n total: \"Total price:\",\n itemsTitle: \"Your Cart\",\n upsellTitle: \"Usually bought together\",\n },\n language: {},\n region: \"Region\",\n};\n\nexport interface HeaderAccountCustomer {\n id: string;\n email: string;\n displayName: string;\n picture?: string | null;\n}\n\nexport interface HeaderAccount {\n loading?: boolean;\n customer?: Nullish<HeaderAccountCustomer>;\n handleLogin?: () => void;\n handleLogout?: () => void;\n handleRegister?: () => void;\n handleManageAccount?: () => void;\n handleOrderHistory?: () => void;\n renderStorePicker?: (onClose: () => void) => JSX.Element;\n}\n\nexport interface HeaderSearch {\n /** Trigger search */\n onSearch: (formattedQuerySearchTerm: string) => void;\n loading?: boolean;\n totalItemsCount: number;\n items: Array<{\n id: string;\n url: string;\n image?: CustomImageAsset | null;\n title: string;\n family?: string | null;\n }>;\n}\n\nexport interface HeaderCartItemControls {\n loading?: boolean;\n quantityMax?: number;\n onQuantityChange: (newQuantity: number) => void;\n}\n\nexport interface HeaderCartItem {\n id: string;\n url: string;\n image: Nullish<CustomImageAsset>;\n quantity: number;\n title: string;\n controls: HeaderCartItemControls;\n price: string;\n priceIncludingVAT?: string;\n}\n\nexport interface HeaderCart {\n onReview: () => void;\n loading?: boolean;\n items: HeaderCartItem[];\n upsellItems?: HeaderCartItem[];\n totals: Nullish<{\n shipping: Nullish<string>;\n discount: Nullish<string>;\n finalTax: Nullish<string>;\n total: string;\n totalIncludingVAT?: string;\n }>;\n}\n\nexport type HeaderTranslations = typeof defaultHeaderTranslations;\n\nexport type HeaderEmbedConfig = {\n /**\n * Allows to configure custom callback on home link click\n */\n homeLinkClickHandler?: () => void;\n\n /**\n * Allows to render custom extra section items in Pro Mobile Menu\n */\n mobileMenuExtraSectionItems?: Array<ProMobileMenuSectionItem>;\n\n /**\n * Moves Avatar icon to the left side of the header\n */\n moveAvatarIconToLeft?: boolean;\n\n /**\n * Allows to display avatar as image instead of icon\n */\n displayAvatarAsImage?: boolean;\n\n /**\n * Allows to configure custom callback on avatar click\n */\n avatarClickHandler?: () => void;\n\n /**\n * Allows to hide logo / site title\n */\n hideLogo?: boolean;\n\n /**\n * Allows to hide Avatar icon from the header\n */\n hideAvatarIcon?: boolean;\n\n /**\n * Hide language picker\n */\n hideLanguagePicker?: boolean;\n\n fullWidthHeader?: boolean;\n\n /**\n * Renders site title instead of UI logo\n */\n siteTitle?: string;\n\n /**\n * Blurs search input and dismissed virtual keyboard on touchmove\n */\n /** @deprecated Use blurSearchOnTouchmove */\n hideSearchOnTouchmove?: boolean;\n blurSearchOnTouchmove?: boolean;\n};\n\nexport interface HeaderProps {\n className?: string;\n motif: Motif;\n /**\n * Main header bar becomes fixed position at the top\n */\n sticky?: boolean;\n /**\n * Navigation carousel becomes fixed position at the top\n */\n stickyCarousel?: boolean;\n translations?: HeaderTranslations;\n renderImage: RenderImageFn;\n showLineLoader?: boolean;\n onModalOpen?: () => void;\n onMenuItemLinkClick?: (\n e: React.MouseEvent<HTMLElement>,\n item: ParsedNavigationItem,\n ) => void;\n onMenuSubItemLinkClick?: (\n e: React.MouseEvent<HTMLElement>,\n item: ParsedNavigationSubItem | ParsedNavigationSubSubItem,\n ) => void;\n\n onLanguageChange?: (\n e: React.MouseEvent<HTMLElement>,\n link: string,\n language: Language,\n ) => void;\n\n // Account\n account?: HeaderAccount;\n\n // Search\n onSearchResultsAction?: (searchTerm: string) => void;\n search?: HeaderSearch;\n\n // Cart\n onCartClick?: () => void;\n cart?: HeaderCart;\n\n // Set specific modal to be open initially\n initialActiveModal?: Nullish<ModalId>;\n /**\n * Triggers on active modal change\n */\n onActiveModal?: (id: ModalId | null, prevModalId: ModalId | null) => void;\n\n /**\n * Will be called before navigating to store search, the tracking request in this callback will only\n * finish if called from store side as microsites are not using next router.\n */\n trackStoreSearchClick?: () => void;\n\n transparentHeader?: boolean;\n\n /**\n * Sub-menu used for microsites\n */\n micrositeMenu?: NavigationMicrositeMenuProps;\n\n /**\n * Header customizations for embed context like WebView\n */\n embedConfig?: HeaderEmbedConfig;\n\n accountMenu?: React.ReactNode;\n}\n\nexport type IsolatedHeaderProps = {\n className?: string;\n motif: Motif;\n translations?: HeaderTranslations;\n handleContinueShopping: () => void;\n showLineLoader?: boolean;\n account?: {\n loading?: HeaderAccount[\"loading\"];\n customer?: {\n picture?: HeaderAccountCustomer[\"picture\"];\n };\n };\n} & Pick<HeaderProps, \"embedConfig\">;\n\nexport interface ProHeaderEarlyAccess {\n loading?: boolean;\n onClick: () => void;\n}\n\nexport interface HeaderProductLineOption {\n value: ProductLine;\n label: string;\n}\n\nexport interface ProHeaderCategories {\n items: ProMobileMenuSectionItem[];\n activeIndex: number;\n}\n\nexport type ProHeaderProps = Pick<\n HeaderProps,\n | \"className\"\n | \"motif\"\n | \"cart\"\n | \"account\"\n | \"translations\"\n | \"onModalOpen\"\n | \"onCartClick\"\n | \"showLineLoader\"\n | \"accountMenu\"\n> & {\n /**\n * Header customizations for embed context like WebView\n */\n embedConfig?: HeaderEmbedConfig;\n\n // Country picker\n currentCountryName?: string;\n handleStorePickerClick?: () => void;\n\n // Early access button\n earlyAccess?: ProHeaderEarlyAccess;\n\n // Purchase History button\n handlePurchaseHistoryClick?: () => void;\n\n // Order button\n handleOrderHistoryClick?: () => void;\n\n // Product line picker\n productLineOptions?: HeaderProductLineOption[];\n productLineValue?: ProductLine;\n handleProductLineChange?: (type: ProductLine) => void;\n\n // Mobile menu aka \"hamburger\" button click\n handleMobileMenuClick?: () => void;\n\n onLanguageChange?: (\n e: React.MouseEvent<HTMLElement>,\n link: string,\n language: Language,\n ) => void;\n\n // Search\n searchValue?: string;\n onSearch?: (searchTerm: string) => void;\n\n onSearchFocus?: () => void;\n onSearchBlur?: () => void;\n onSearchClick?: () => void;\n\n // Categories used for menu\n categories: ProHeaderCategories;\n hideInlineCategories?: boolean;\n};\n"],"names":["defaultHeaderTranslations","new","support","purchasedProductHistory","orderHistory","earlyAccess","store","links","company","social","tools","training","continueShopping","search","placeholder","noMatchesFound","seeAllResults","searchUniFiProducts","searchUISPProducts","searchAmpliFiProducts","account","login","signUp","signOut","uiAccount","unifiSiteManager","manageAccount","cart","VATincluded","includesVat","discount","empty","review","shipping","subtotal","total","itemsTitle","upsellTitle","language","region"],"mappings":";;AAiBO,MAAMA,yBAA4B,GAAA;EACvCC,GAAK,EAAA,KAAA;EACLC,OAAS,EAAA,SAAA;EACTC,uBAAyB,EAAA,2BAAA;EACzBC,YAAc,EAAA,eAAA;EACdC,WAAa,EAAA,cAAA;EACbC,KAAO,EAAA,OAAA;EACPC,KAAO,EAAA,OAAA;EACPC,OAAS,EAAA,SAAA;EACTC,MAAQ,EAAA,QAAA;EACRC,KAAO,EAAA,OAAA;EACPC,QAAU,EAAA,UAAA;EACVC,gBAAkB,EAAA,mBAAA;EAClBC,MAAQ,EAAA;IACNC,WAAa,EAAA,WAAA;IACbC,cAAgB,EAAA,sCAAA;IAChBC,aAAe,EAAA,iBAAA;IACfC,mBAAqB,EAAA,uBAAA;IACrBC,kBAAoB,EAAA,sBAAA;IACpBC,qBAAuB,EAAA;EACzB,CAAA;EACAC,OAAS,EAAA;IACPC,KAAO,EAAA,QAAA;IACPC,MAAQ,EAAA,SAAA;IACRC,OAAS,EAAA,UAAA;IACTC,SAAW,EAAA,YAAA;IACXC,gBAAkB,EAAA,oBAAA;IAClBC,aAAe,EAAA,gBAAA;IACftB,YAAc,EAAA;EAChB,CAAA;EACAuB,IAAM,EAAA;IACJC,WAAa,EAAA,WAAA;IACbC,WAAa,EAAA,iBAAA;IACbC,QAAU,EAAA,UAAA;IACVC,KAAO,EAAA,oBAAA;IACPC,MAAQ,EAAA,UAAA;IACRC,QAAU,EAAA,UAAA;IACVC,QAAU,EAAA,UAAA;IACVC,KAAO,EAAA,cAAA;IACPC,UAAY,EAAA,WAAA;IACZC,WAAa,EAAA;EACf,CAAA;EACAC,UAAU,CAAC,CAAA;EACXC,MAAQ,EAAA;AACV,CAAA;"}
|
|
@@ -17,5 +17,5 @@ export declare const ProHeader: import("react").NamedExoticComponent<Pick<import
|
|
|
17
17
|
onSearchBlur?: () => void;
|
|
18
18
|
onSearchClick?: () => void;
|
|
19
19
|
categories: import("../Header.types").ProHeaderCategories;
|
|
20
|
-
|
|
20
|
+
hideInlineCategories?: boolean;
|
|
21
21
|
}>;
|
|
@@ -108,7 +108,7 @@ const ProHeader = react.memo(function ProHeader2({
|
|
|
108
108
|
handleMobileMenuClick,
|
|
109
109
|
productLineValue,
|
|
110
110
|
categories,
|
|
111
|
-
|
|
111
|
+
hideInlineCategories,
|
|
112
112
|
embedConfig,
|
|
113
113
|
onSearchFocus,
|
|
114
114
|
onSearchBlur,
|
|
@@ -211,12 +211,12 @@ const ProHeader = react.memo(function ProHeader2({
|
|
|
211
211
|
return logoHover || showTouchProMenu;
|
|
212
212
|
}, [logoHover, showTouchProMenu]);
|
|
213
213
|
const onClickAwayFromSearchModal = react.useCallback(() => {
|
|
214
|
-
if (
|
|
214
|
+
if (!!searchValue && !isMobile) return;
|
|
215
215
|
if (activeModal === types.ModalId.Search) {
|
|
216
216
|
setActiveModal(null);
|
|
217
217
|
onSearchClick?.();
|
|
218
218
|
}
|
|
219
|
-
}, [activeModal, isMobile, onSearchClick, searchValue, setActiveModal
|
|
219
|
+
}, [activeModal, isMobile, onSearchClick, searchValue, setActiveModal]);
|
|
220
220
|
const [initialSearchValueHandled, setInitialSearchValueHandled] = react.useState(false);
|
|
221
221
|
react.useEffect(() => {
|
|
222
222
|
if (!initialSearchValueHandled && searchValue) {
|
|
@@ -262,7 +262,7 @@ const ProHeader = react.memo(function ProHeader2({
|
|
|
262
262
|
}
|
|
263
263
|
}, [handleModalOpen, onSearchClick, searchInputRef]);
|
|
264
264
|
react.useEffect(() => {
|
|
265
|
-
if (
|
|
265
|
+
if (activeModal === types.ModalId.Search && !isMobile) return;
|
|
266
266
|
if (desktopSearchInputRef) {
|
|
267
267
|
const interval = setInterval(() => {
|
|
268
268
|
if (document.activeElement === desktopSearchInputRef) {
|
|
@@ -271,7 +271,7 @@ const ProHeader = react.memo(function ProHeader2({
|
|
|
271
271
|
desktopSearchInputRef.focus();
|
|
272
272
|
}, 0);
|
|
273
273
|
}
|
|
274
|
-
}, [activeModal, desktopSearchInputRef, isMobile
|
|
274
|
+
}, [activeModal, desktopSearchInputRef, isMobile]);
|
|
275
275
|
const handleSearchValueChange = react.useCallback(e => {
|
|
276
276
|
onSearch?.(e.target.value);
|
|
277
277
|
}, [onSearch]);
|
|
@@ -313,24 +313,17 @@ const ProHeader = react.memo(function ProHeader2({
|
|
|
313
313
|
return cart?.items.reduce((sum, item) => sum + item.quantity, 0) ?? 0;
|
|
314
314
|
}, [cart?.items]);
|
|
315
315
|
const hasTouch = useHasTouch.useHasTouch();
|
|
316
|
-
const logoSiteUrl = react.useMemo(() => {
|
|
317
|
-
if (useInlineCategories) {
|
|
318
|
-
return createSiteUrl([mapping.SiteId.Store, "/"]);
|
|
319
|
-
}
|
|
320
|
-
return createSiteUrl([mapping.SiteId.Ui, "/"]);
|
|
321
|
-
}, [createSiteUrl, useInlineCategories]);
|
|
322
316
|
const onLogoAnchorClick = react.useCallback(e => {
|
|
323
317
|
if (embedConfig?.homeLinkClickHandler) {
|
|
324
318
|
e.preventDefault();
|
|
325
319
|
embedConfig.homeLinkClickHandler();
|
|
326
320
|
}
|
|
327
|
-
if (
|
|
321
|
+
if (!showProMenu && !hasTouch) {
|
|
328
322
|
e.preventDefault();
|
|
329
323
|
setShowTouchProMenu(true);
|
|
330
324
|
}
|
|
331
|
-
}, [embedConfig,
|
|
325
|
+
}, [embedConfig, hasTouch, showProMenu]);
|
|
332
326
|
react.useEffect(() => {
|
|
333
|
-
if (!useInlineCategories) return;
|
|
334
327
|
const containerEl = containerRef.current;
|
|
335
328
|
if (!containerEl) return;
|
|
336
329
|
const wrapEl = wrapRef.current;
|
|
@@ -344,7 +337,7 @@ const ProHeader = react.memo(function ProHeader2({
|
|
|
344
337
|
window.requestAnimationFrame(handle);
|
|
345
338
|
};
|
|
346
339
|
window.requestAnimationFrame(handle);
|
|
347
|
-
}, [
|
|
340
|
+
}, []);
|
|
348
341
|
const handleAvatarClick = react.useCallback(e => {
|
|
349
342
|
if (embedConfig?.avatarClickHandler) {
|
|
350
343
|
embedConfig.avatarClickHandler();
|
|
@@ -387,9 +380,6 @@ const ProHeader = react.memo(function ProHeader2({
|
|
|
387
380
|
width: 17.86,
|
|
388
381
|
height: 18
|
|
389
382
|
});
|
|
390
|
-
if (!useInlineCategories) {
|
|
391
|
-
return defaultIcon;
|
|
392
|
-
}
|
|
393
383
|
switch (productLineValue) {
|
|
394
384
|
case generated.ProductLine.Unifi:
|
|
395
385
|
return /* @__PURE__ */jsxRuntime.jsx(StyleableSvgImage.StyleableSvgImage, {
|
|
@@ -406,7 +396,7 @@ const ProHeader = react.memo(function ProHeader2({
|
|
|
406
396
|
default:
|
|
407
397
|
return defaultIcon;
|
|
408
398
|
}
|
|
409
|
-
}, [productLineValue
|
|
399
|
+
}, [productLineValue]);
|
|
410
400
|
return /* @__PURE__ */jsxRuntime.jsxs(ProHeader_styles.ProHeaderWrap, {
|
|
411
401
|
ref: rootRef,
|
|
412
402
|
$sticky: !!embedConfig,
|
|
@@ -428,7 +418,7 @@ const ProHeader = react.memo(function ProHeader2({
|
|
|
428
418
|
$addSpaceOnDesktop: !!embedConfig?.fullWidthHeader,
|
|
429
419
|
children: activeModal !== types.ModalId.ProMobileMenu && /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
430
420
|
children: [!embedConfig?.hideLogo && /* @__PURE__ */jsxRuntime.jsx(Header_styles.Anchor, {
|
|
431
|
-
href:
|
|
421
|
+
href: createSiteUrl([mapping.SiteId.Store, "/"]),
|
|
432
422
|
onClick: onLogoAnchorClick,
|
|
433
423
|
children: embedConfig?.siteTitle ? /* @__PURE__ */jsxRuntime.jsx(Header_styles.SiteTitleWrap, {
|
|
434
424
|
children: embedConfig.siteTitle
|
|
@@ -437,19 +427,11 @@ const ProHeader = react.memo(function ProHeader2({
|
|
|
437
427
|
ref: logoRef,
|
|
438
428
|
children: logoIconHtml
|
|
439
429
|
})
|
|
440
|
-
}), embedConfig?.moveAvatarIconToLeft && avatarHtml
|
|
441
|
-
hideBreakpoint: MOBILE_BREAKPOINT_AND_DOWN,
|
|
442
|
-
children: currentCountryName && /* @__PURE__ */jsxRuntime.jsx(ProHeader_styles.CountryButton, {
|
|
443
|
-
"data-test-id": "country-select-btn",
|
|
444
|
-
type: "button",
|
|
445
|
-
onClick: handleStorePickerClick,
|
|
446
|
-
children: currentCountryName
|
|
447
|
-
})
|
|
448
|
-
})]
|
|
430
|
+
}), embedConfig?.moveAvatarIconToLeft && avatarHtml]
|
|
449
431
|
})
|
|
450
|
-
}), /* @__PURE__ */jsxRuntime.
|
|
432
|
+
}), /* @__PURE__ */jsxRuntime.jsx(ProHeader_styles.CenterWrap, {
|
|
451
433
|
hideBreakpoint: MOBILE_BREAKPOINT_AND_DOWN,
|
|
452
|
-
children:
|
|
434
|
+
children: activeModal === types.ModalId.Search || !!searchValue ? /* @__PURE__ */jsxRuntime.jsx(ProHeader_styles.Search, {
|
|
453
435
|
setInputRef: setDesktopSearchInputRef,
|
|
454
436
|
onValueChange: handleSearchValueChange,
|
|
455
437
|
placeholder: searchPlaceholder,
|
|
@@ -462,6 +444,7 @@ const ProHeader = react.memo(function ProHeader2({
|
|
|
462
444
|
onBlur: handleSearchBlur,
|
|
463
445
|
focusedWidth: searchFocusWidth
|
|
464
446
|
}) : /* @__PURE__ */jsxRuntime.jsx(ProHeader_styles.InlineCategoryWrap, {
|
|
447
|
+
$hide: hideInlineCategories,
|
|
465
448
|
children: /* @__PURE__ */jsxRuntime.jsx(ScrollWrapper.ScrollWrapper, {
|
|
466
449
|
direction: "horizontal",
|
|
467
450
|
align: "center",
|
|
@@ -486,27 +469,19 @@ const ProHeader = react.memo(function ProHeader2({
|
|
|
486
469
|
})
|
|
487
470
|
}, category.id);
|
|
488
471
|
}
|
|
489
|
-
}))
|
|
472
|
+
}))
|
|
490
473
|
})
|
|
491
|
-
})
|
|
492
|
-
children: productLineOptions.map(option => /* @__PURE__ */jsxRuntime.jsx(ProHeader_styles.ProductLineSelectorItem, {
|
|
493
|
-
onClick: () => handleProductLineChange?.(option.value),
|
|
494
|
-
$active: option.value === productLineValue,
|
|
495
|
-
"data-test-id": `product-line-selector-${option.value}`,
|
|
496
|
-
children: option.label
|
|
497
|
-
}, option.value))
|
|
498
|
-
})]
|
|
474
|
+
})
|
|
499
475
|
}), /* @__PURE__ */jsxRuntime.jsxs(ProHeader_styles.RightWrap, {
|
|
500
476
|
$addSpaceOnDesktop: !!embedConfig?.fullWidthHeader,
|
|
501
477
|
children: [activeModal !== types.ModalId.ProMobileMenu && /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
502
478
|
children: [/* @__PURE__ */jsxRuntime.jsx(ProHeader_styles.ProIconWrap, {
|
|
503
479
|
"data-test-id": "search-btn",
|
|
504
|
-
hideBreakpoint: !useInlineCategories ? MOBILE_BREAKPOINT_UP : void 0,
|
|
505
480
|
motif,
|
|
506
481
|
onClick: handleShowSearchTab,
|
|
507
482
|
children: /* @__PURE__ */jsxRuntime.jsx(ProHeader_styles.ProIconInnerFillWrap, {
|
|
508
483
|
$active: activeModal === types.ModalId.Search || !!searchValue,
|
|
509
|
-
$transparent: !!embedConfig ||
|
|
484
|
+
$transparent: !!embedConfig || !isMobile,
|
|
510
485
|
children: /* @__PURE__ */jsxRuntime.jsx(Header_styles.SvgIcon, {
|
|
511
486
|
src: _externalAssets_g50k1DIN__default["default"],
|
|
512
487
|
width: Header_styles.HEADER_ICON_SIZE,
|
|
@@ -653,7 +628,7 @@ const ProHeader = react.memo(function ProHeader2({
|
|
|
653
628
|
categories,
|
|
654
629
|
hideExtraSection: !!embedConfig
|
|
655
630
|
})]
|
|
656
|
-
}),
|
|
631
|
+
}), !embedConfig && !isMobile && /* @__PURE__ */jsxRuntime.jsx(ProMenu.NavigationProMenu, {
|
|
657
632
|
show: showProMenu,
|
|
658
633
|
currentCountryName,
|
|
659
634
|
handleStorePickerClick,
|