@ubnt/store.core 10.16.1-alpha.23 → 10.16.1-alpha.24
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 +4 -0
- package/lib/assets/ai-360.jpg +0 -0
- package/lib/assets/ai-3602.jpg +0 -0
- package/lib/assets/ai-dome.jpg +0 -0
- package/lib/assets/ai-dome2.jpg +0 -0
- package/lib/assets/ai-lpr.jpg +0 -0
- package/lib/assets/ai-lpr2.jpg +0 -0
- package/lib/assets/ai-theta.jpg +0 -0
- package/lib/assets/ai-theta2.jpg +0 -0
- package/lib/assets/bullet2.svg +4 -2
- package/lib/assets/bullet3.svg +2 -4
- package/lib/assets/compact.svg +2 -2
- package/lib/assets/compact2.svg +2 -2
- package/lib/assets/g2-reader-pro.jpg +0 -0
- package/lib/assets/g2-reader-pro2.jpg +0 -0
- package/lib/assets/g2-reader.jpg +0 -0
- package/lib/assets/g2-reader2.jpg +0 -0
- package/lib/assets/g3-reader-flex.jpg +0 -0
- package/lib/assets/g3-reader-flex2.jpg +0 -0
- package/lib/assets/g3-reader.jpg +0 -0
- package/lib/assets/g3-reader2.jpg +0 -0
- package/lib/assets/g3-starter-kit-pro.jpg +0 -0
- package/lib/assets/g3-starter-kit-pro2.jpg +0 -0
- package/lib/assets/g3-starter-kit.jpg +0 -0
- package/lib/assets/g3-starter-kit2.jpg +0 -0
- package/lib/assets/g4-instant.jpg +0 -0
- package/lib/assets/g4-instant2.jpg +0 -0
- package/lib/assets/g5-bullet.jpg +0 -0
- package/lib/assets/g5-bullet2.jpg +0 -0
- package/lib/assets/g5-dome.jpg +0 -0
- package/lib/assets/g5-dome2.jpg +0 -0
- package/lib/assets/g5-ptz.jpg +0 -0
- package/lib/assets/g5-ptz2.jpg +0 -0
- package/lib/assets/interior-design.svg +2 -2
- package/lib/assets/interior-design2.svg +2 -2
- package/lib/assets/minus4.svg +8 -8
- package/lib/assets/minus5.svg +8 -8
- package/lib/assets/plus4.svg +9 -9
- package/lib/assets/plus5.svg +9 -9
- package/lib/components/Header/MobileLinksModal/MobileMenu.js +66 -23
- package/lib/components/Header/MobileLinksModal/MobileMenu.js.map +1 -1
- package/lib/components/Header/MobileLinksModal/MobileMenu.mjs +69 -26
- package/lib/components/Header/MobileLinksModal/MobileMenu.mjs.map +1 -1
- package/lib/components/Header/MobileLinksModal/MobileMenu.styles.d.ts +6 -9
- package/lib/components/Header/MobileLinksModal/MobileMenu.styles.js +25 -4
- package/lib/components/Header/MobileLinksModal/MobileMenu.styles.js.map +1 -1
- package/lib/components/Header/MobileLinksModal/MobileMenu.styles.mjs +26 -4
- package/lib/components/Header/MobileLinksModal/MobileMenu.styles.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CounterSection.js +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CounterSection.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/minus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/minus.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/plus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/plus.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.js +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/minus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/minus.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/plus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/plus.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Bullet/ai-lpr.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Bullet/ai-lpr.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Bullet/bullet.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/Bullet/bullet.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Bullet/g5-bullet.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Bullet/g5-bullet.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Compact/g4-instant.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Compact/g4-instant.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DomeTurret/ai-360.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DomeTurret/ai-360.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DomeTurret/ai-dome.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DomeTurret/ai-dome.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DomeTurret/g5-dome.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DomeTurret/g5-dome.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/g2-reader-pro.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/g2-reader-pro.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/g2-reader.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/g2-reader.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-reader-flex.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-reader-flex.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-reader.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-reader.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-starter-kit-pro.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-starter-kit-pro.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-starter-kit.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-starter-kit.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Interior/ai-theta.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Interior/ai-theta.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/PTZ/g5-ptz.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/PTZ/g5-ptz.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/compact.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/compact.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/interior-design.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/interior-design.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/bullet.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/bullet.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/bullet/ai-lpr.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/bullet/ai-lpr.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/bullet/g5-bullet.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/bullet/g5-bullet.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/compact/g4-instant.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/compact/g4-instant.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/ai-360.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/ai-360.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/ai-dome.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/ai-dome.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/g5-dome.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/g5-dome.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g2-reader-pro.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g2-reader-pro.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g2-reader.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g2-reader.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-reader-flex.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-reader-flex.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-reader.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-reader.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-starter-kit-pro.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-starter-kit-pro.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-starter-kit.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-starter-kit.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/interior-design/ai-theta.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/interior-design/ai-theta.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/ptz/g5-ptz.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/ptz/g5-ptz.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/compact.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/compact.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/interior-design.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/interior-design.svg.mjs +2 -2
- package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Bullet.js +1 -1
- package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Bullet.mjs +1 -1
- package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Compact.js +1 -1
- package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Compact.mjs +1 -1
- package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/InteriorDesign.js +1 -1
- package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/InteriorDesign.mjs +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/bullet.js +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/bullet.mjs +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/compact.js +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/compact.mjs +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/interiorDesign.js +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/interiorDesign.mjs +1 -1
- package/lib/constants/modelCompareData/data/products/ai360.js +2 -2
- package/lib/constants/modelCompareData/data/products/ai360.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/aiDome.js +2 -2
- package/lib/constants/modelCompareData/data/products/aiDome.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/aiLpr.js +2 -2
- package/lib/constants/modelCompareData/data/products/aiLpr.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g2Reader.js +2 -2
- package/lib/constants/modelCompareData/data/products/g2Reader.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g2ReaderPro.js +2 -2
- package/lib/constants/modelCompareData/data/products/g2ReaderPro.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g3Reader.js +2 -2
- package/lib/constants/modelCompareData/data/products/g3Reader.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g3ReaderFlex.js +2 -2
- package/lib/constants/modelCompareData/data/products/g3ReaderFlex.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g3StarterKit.js +2 -2
- package/lib/constants/modelCompareData/data/products/g3StarterKit.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g3StarterKitPro.js +2 -2
- package/lib/constants/modelCompareData/data/products/g3StarterKitPro.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g4Instant.js +2 -2
- package/lib/constants/modelCompareData/data/products/g4Instant.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g5Bullet.js +2 -2
- package/lib/constants/modelCompareData/data/products/g5Bullet.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g5Dome.js +2 -2
- package/lib/constants/modelCompareData/data/products/g5Dome.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g5Ptz.js +2 -2
- package/lib/constants/modelCompareData/data/products/g5Ptz.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/theta.js +2 -2
- package/lib/constants/modelCompareData/data/products/theta.mjs +2 -2
- package/package.json +1 -1
|
@@ -38,18 +38,20 @@ const MobileLinksModal = ({
|
|
|
38
38
|
} = useFooterContent.useFooterContent();
|
|
39
39
|
const motif = LIGHT_KEY;
|
|
40
40
|
const [expandedSectionItemId, setExpandedSectionItemId] = React.useState(null);
|
|
41
|
+
const [expandedSubSectionItemId, setExpandedSubSectionItemId] = React.useState(null);
|
|
41
42
|
const toggleExpandedSectionItemId = React.useCallback(itemId => {
|
|
42
43
|
setExpandedSectionItemId(expandedSectionItemId === itemId ? null : itemId);
|
|
43
44
|
}, [expandedSectionItemId]);
|
|
45
|
+
const toggleExpandedSubSectionItemId = React.useCallback(itemId => {
|
|
46
|
+
setExpandedSubSectionItemId(prev => prev === itemId ? null : itemId);
|
|
47
|
+
}, []);
|
|
44
48
|
const getPreparedMenu = React.useMemo(() => {
|
|
45
49
|
return (menu?.items ?? []).flatMap(item => {
|
|
46
|
-
if (!item || item.id === mapping.MenuItemId.SiteMap)
|
|
47
|
-
return [];
|
|
48
|
-
}
|
|
50
|
+
if (!item || item.id === mapping.MenuItemId.SiteMap) return [];
|
|
49
51
|
if (item.id === mapping.START_HERE_ID && Array.isArray(item.items)) {
|
|
50
52
|
return item.items;
|
|
51
53
|
}
|
|
52
|
-
return item;
|
|
54
|
+
return [item];
|
|
53
55
|
});
|
|
54
56
|
}, [menu]);
|
|
55
57
|
const handleItemClick = (event, item) => {
|
|
@@ -93,7 +95,11 @@ const MobileLinksModal = ({
|
|
|
93
95
|
children: formatMessage(item.label)
|
|
94
96
|
}), item?.items && /* @__PURE__ */jsxRuntime.jsx(MobileMenu_styles.SectionItemArrowButton, {
|
|
95
97
|
motif,
|
|
96
|
-
onClick:
|
|
98
|
+
onClick: e => {
|
|
99
|
+
e.stopPropagation();
|
|
100
|
+
toggleExpandedSectionItemId(item.id);
|
|
101
|
+
toggleExpandedSubSectionItemId(null);
|
|
102
|
+
},
|
|
97
103
|
children: /* @__PURE__ */jsxRuntime.jsx(MobileMenu_styles.ButtonIcon, {
|
|
98
104
|
children: /* @__PURE__ */jsxRuntime.jsx(MobileMenu_styles.Chevron, {
|
|
99
105
|
src: _externalAssets_BAXELvSy__default["default"],
|
|
@@ -103,29 +109,65 @@ const MobileLinksModal = ({
|
|
|
103
109
|
})
|
|
104
110
|
})
|
|
105
111
|
})]
|
|
106
|
-
}), item.id === expandedSectionItemId && item?.items?.map(subItem => /* @__PURE__ */jsxRuntime.
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
112
|
+
}), item.id === expandedSectionItemId && item?.items?.map(subItem => /* @__PURE__ */jsxRuntime.jsxs(React.Fragment, {
|
|
113
|
+
children: [/* @__PURE__ */jsxRuntime.jsxs(MobileMenu_styles.SectionItem, {
|
|
114
|
+
motif: "dark",
|
|
115
|
+
$secondary: true,
|
|
116
|
+
...(subItem?.target || subItem?.isExternalUrl ? {
|
|
117
|
+
as: "a",
|
|
118
|
+
href: subItem.url,
|
|
119
|
+
target: "_blank",
|
|
120
|
+
rel: "noopener noreferrer"
|
|
121
|
+
} : {
|
|
122
|
+
onClick: event => {
|
|
123
|
+
event.preventDefault();
|
|
124
|
+
if (!subItem?.items) {
|
|
125
|
+
handleItemClick(event, subItem);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}),
|
|
129
|
+
children: [/* @__PURE__ */jsxRuntime.jsx(MobileMenu_styles.SectionItemLabel, {
|
|
130
|
+
motif,
|
|
131
|
+
$active: subItem.id === expandedSubSectionItemId,
|
|
132
|
+
children: /* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
133
|
+
children: [formatMessage(subItem.label), subItem.isNew && /* @__PURE__ */jsxRuntime.jsx(MobileMenu_styles.Badge, {
|
|
134
|
+
children: formatMessage("commons.menu.label.new")
|
|
135
|
+
})]
|
|
136
|
+
})
|
|
137
|
+
}), subItem?.items && /* @__PURE__ */jsxRuntime.jsx(MobileMenu_styles.SectionItemArrowButton, {
|
|
138
|
+
motif,
|
|
139
|
+
onClick: e => {
|
|
140
|
+
e.stopPropagation();
|
|
141
|
+
toggleExpandedSubSectionItemId(subItem.id);
|
|
142
|
+
},
|
|
143
|
+
children: /* @__PURE__ */jsxRuntime.jsx(MobileMenu_styles.ButtonIcon, {
|
|
144
|
+
children: /* @__PURE__ */jsxRuntime.jsx(MobileMenu_styles.Chevron, {
|
|
145
|
+
src: _externalAssets_BAXELvSy__default["default"],
|
|
146
|
+
width: 13,
|
|
147
|
+
height: 8,
|
|
148
|
+
$rotated: subItem.id === expandedSubSectionItemId
|
|
149
|
+
})
|
|
150
|
+
})
|
|
121
151
|
})]
|
|
122
|
-
})
|
|
152
|
+
}), subItem.id === expandedSubSectionItemId && subItem.items?.map(nested => /* @__PURE__ */jsxRuntime.jsx(MobileMenu_styles.SectionItem, {
|
|
153
|
+
motif: "dark",
|
|
154
|
+
$secondary: true,
|
|
155
|
+
href: nested.url,
|
|
156
|
+
as: "a",
|
|
157
|
+
rel: "noopener noreferrer",
|
|
158
|
+
$active: item.id === expandedSectionItemId,
|
|
159
|
+
children: /* @__PURE__ */jsxRuntime.jsx(MobileMenu_styles.SectionItemLabel, {
|
|
160
|
+
motif,
|
|
161
|
+
$tertiary: true,
|
|
162
|
+
children: formatMessage(nested.label)
|
|
163
|
+
})
|
|
164
|
+
}, nested.id))]
|
|
123
165
|
}, subItem.id))]
|
|
124
166
|
}, item.id)), [...miscLinks].map((item, i) => /* @__PURE__ */jsxRuntime.jsx(MobileMenu_styles.SectionItemsGroup, {
|
|
125
167
|
motif,
|
|
126
168
|
$active: item.id === expandedSectionItemId,
|
|
127
169
|
$isSectionBegin: i === 0,
|
|
128
|
-
children: /* @__PURE__ */jsxRuntime.jsx(MobileMenu_styles.
|
|
170
|
+
children: /* @__PURE__ */jsxRuntime.jsx(MobileMenu_styles.SectionItem, {
|
|
129
171
|
motif,
|
|
130
172
|
href: item.src,
|
|
131
173
|
target: item?.target ?? "self",
|
|
@@ -142,6 +184,7 @@ const MobileLinksModal = ({
|
|
|
142
184
|
$active: item.id === expandedSectionItemId,
|
|
143
185
|
$isSectionEnd: item?.isSectionEnd,
|
|
144
186
|
children: [/* @__PURE__ */jsxRuntime.jsxs(MobileMenu_styles.SectionItem, {
|
|
187
|
+
$active: item.id === expandedSectionItemId,
|
|
145
188
|
motif,
|
|
146
189
|
onClick: () => item?.items && toggleExpandedSectionItemId(item.id),
|
|
147
190
|
children: [/* @__PURE__ */jsxRuntime.jsx(MobileMenu_styles.SectionItemLabel, {
|
|
@@ -160,7 +203,7 @@ const MobileLinksModal = ({
|
|
|
160
203
|
})
|
|
161
204
|
})
|
|
162
205
|
})]
|
|
163
|
-
}), item.id === expandedSectionItemId && item?.items?.map(subItem => /* @__PURE__ */jsxRuntime.jsx(MobileMenu_styles.
|
|
206
|
+
}), item.id === expandedSectionItemId && item?.items?.map(subItem => /* @__PURE__ */jsxRuntime.jsx(MobileMenu_styles.SectionItem, {
|
|
164
207
|
motif: "dark",
|
|
165
208
|
$secondary: true,
|
|
166
209
|
href: subItem.src,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileMenu.js","sources":["../../../../src/components/Header/MobileLinksModal/MobileMenu.tsx"],"sourcesContent":["import type { Motif } from \"@ubnt/ui-components/utils\";\nimport { useCallback, useMemo, useState } from \"react\";\n\nimport * as icons from \"../../../constants/icons\";\nimport { useMicrositeMenu } from \"../../../contexts/MicrositeMenuContext\";\nimport {\n MenuItemId,\n START_HERE_ID,\n} from \"../../../contexts/MicrositeMenuContext/mapping\";\nimport { useMicrositeMenuTranslations } from \"../../../contexts/MicrositeMenuContext/translations\";\nimport type { ParsedMicrositeHeaderItem } from \"../../../contexts/MicrositeMenuContext/types\";\nimport type { FooterLinkId } from \"../../Footer/hooks/useFooterContent\";\nimport { useFooterContent } from \"../../Footer/hooks/useFooterContent\";\nimport { StyleableSvgImage } from \"../../StyleableSvgImage\";\nimport * as S from \"./MobileMenu.styles\";\nconst LIGHT_KEY = \"light\";\n\nexport interface MobileLinksProps {\n menu: Pick<ParsedMicrositeHeaderItem, \"label\" | \"url\" | \"items\">;\n onMenuItemClick: (e: React.MouseEvent<HTMLElement>, url: string) => void;\n onModalClose: () => void;\n}\n\nexport const MobileLinksModal = ({\n menu,\n onMenuItemClick,\n onModalClose,\n}: MobileLinksProps) => {\n const { language } = useMicrositeMenu();\n const { formatMessage } = useMicrositeMenuTranslations(language);\n const { footerContent, socialContent, miscLinks } = useFooterContent();\n\n const motif: Motif = LIGHT_KEY;\n\n // #############################################################################\n // Section toggling\n // #############################################################################\n const [expandedSectionItemId, setExpandedSectionItemId] = useState<\n string | null\n >(null);\n\n const toggleExpandedSectionItemId = useCallback(\n (itemId: string) => {\n setExpandedSectionItemId(\n expandedSectionItemId === itemId ? null : itemId,\n );\n },\n [expandedSectionItemId],\n );\n\n const getPreparedMenu = useMemo(() => {\n return (menu?.items ?? []).flatMap((item) => {\n // Remove SiteMap\n if (!item || item.id === MenuItemId.SiteMap) {\n return [];\n }\n // Flatten Start Here one level\n if (item.id === START_HERE_ID && Array.isArray(item.items)) {\n return item.items;\n }\n return item;\n });\n }, [menu]);\n\n // #############################################################################\n // Render\n // #############################################################################\n\n const handleItemClick = (\n event: React.MouseEvent<HTMLButtonElement, MouseEvent>,\n item?: ParsedMicrositeHeaderItem,\n ) => {\n if (item?.items?.length) {\n event.stopPropagation();\n toggleExpandedSectionItemId(item.id);\n } else if (item?.url) {\n onMenuItemClick(event, item.url);\n onModalClose();\n }\n };\n\n type FooterItem = {\n id: FooterLinkId;\n label: string;\n src: string;\n target?: string;\n isSectionEnd?: boolean;\n };\n\n type FooterSection = {\n header: {\n id: string;\n label: string;\n };\n items: FooterItem[];\n };\n\n type FooterSections = {\n company: FooterSection;\n training: FooterSection;\n buy: FooterSection;\n tools: FooterSection;\n social: FooterSection;\n };\n\n function normalizeFooterSections(sections: FooterSections) {\n return Object.values(sections).map((section, i) => ({\n id: section.header.id,\n label: section.header.label,\n isSectionEnd: i === Object.keys(sections).length - 1,\n items: section.items,\n }));\n }\n\n const normalizedFooterContent = normalizeFooterSections({\n ...footerContent,\n social: socialContent,\n });\n\n return (\n <S.Wrap>\n <S.Container size=\"mobile\" noVerticalMargin>\n <S.InnerWrap>\n <S.Section>\n {getPreparedMenu.map((item) => (\n <S.SectionItemsGroup\n motif={motif}\n key={item.id}\n $active={item.id === expandedSectionItemId}\n // @NOTE to separate sections and styling until there's a better way\n $isSectionEnd={item?.isSectionEnd}\n $isSectionBegin={item?.isSectionBegin}\n >\n <S.SectionItem\n motif={motif}\n onClick={(event) => handleItemClick(event, item)}\n >\n <S.SectionItemLabel\n $active={item.id === expandedSectionItemId}\n motif={motif}\n >\n {formatMessage(item.label)}\n </S.SectionItemLabel>\n\n {item?.items && (\n <S.SectionItemArrowButton\n motif={motif}\n onClick={() => toggleExpandedSectionItemId(item.id)}\n >\n <S.ButtonIcon>\n <S.Chevron\n src={icons.generic.collapseArrow}\n width={13}\n height={8}\n $active={item.id === expandedSectionItemId}\n />\n </S.ButtonIcon>\n </S.SectionItemArrowButton>\n )}\n </S.SectionItem>\n\n {item.id === expandedSectionItemId &&\n item?.items?.map((subItem) => (\n <S.SectionItem\n key={subItem.id}\n motif=\"dark\"\n $secondary\n {...(subItem?.target || subItem?.isExternalUrl\n ? {\n as: \"a\",\n href: subItem.url,\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n }\n : {\n onClick: (event) => handleItemClick(event, subItem),\n })}\n >\n <S.SectionItemLabel motif={motif}>\n {formatMessage(subItem.label)}\n {subItem.isNew && (\n <S.Badge>\n {formatMessage(\"commons.menu.label.new\")}\n </S.Badge>\n )}\n </S.SectionItemLabel>\n </S.SectionItem>\n ))}\n </S.SectionItemsGroup>\n ))}\n\n {/* Header Links that don't exist in Desktop Footer */}\n {[...miscLinks].map((item, i) => (\n <S.SectionItemsGroup\n motif={motif}\n key={item.id}\n $active={item.id === expandedSectionItemId}\n $isSectionBegin={i === 0}\n >\n <S.SectionItemLink\n motif={motif}\n href={item.src}\n target={item?.target ?? \"self\"}\n rel={\"noopener noreferrer\"}\n as=\"a\"\n >\n <S.SectionItemLabel\n $active={item.id === expandedSectionItemId}\n motif={motif}\n >\n {item.label}\n </S.SectionItemLabel>\n </S.SectionItemLink>\n </S.SectionItemsGroup>\n ))}\n\n {/* Footer Links to be included in Mobile Nav Modal */}\n {normalizedFooterContent.map((item) => (\n <S.SectionItemsGroup\n motif={motif}\n key={item.id}\n $active={item.id === expandedSectionItemId}\n $isSectionEnd={item?.isSectionEnd}\n >\n <S.SectionItem\n motif={motif}\n onClick={() =>\n item?.items && toggleExpandedSectionItemId(item.id)\n }\n >\n <S.SectionItemLabel\n $active={item.id === expandedSectionItemId}\n motif={motif}\n >\n {item.label}\n </S.SectionItemLabel>\n\n {item?.items && (\n <S.SectionItemArrowButton\n motif={motif}\n onClick={() => toggleExpandedSectionItemId(item.id)}\n >\n <S.ButtonIcon>\n <StyleableSvgImage\n src={icons.generic.collapseArrow}\n width={13}\n height={8}\n $active={item.id === expandedSectionItemId}\n />\n </S.ButtonIcon>\n </S.SectionItemArrowButton>\n )}\n </S.SectionItem>\n\n {item.id === expandedSectionItemId &&\n item?.items?.map((subItem) => (\n <S.SectionItemLink\n key={subItem.id}\n motif=\"dark\"\n $secondary\n href={subItem.src}\n rel={\"noopener noreferrer\"}\n as=\"a\"\n >\n <S.SectionItemLabel motif={motif}>\n {subItem.label}\n </S.SectionItemLabel>\n </S.SectionItemLink>\n ))}\n </S.SectionItemsGroup>\n ))}\n </S.Section>\n </S.InnerWrap>\n </S.Container>\n </S.Wrap>\n );\n};\n"],"names":["LIGHT_KEY","MobileLinksModal","menu","onMenuItemClick","onModalClose","language","useMicrositeMenu","formatMessage","useMicrositeMenuTranslations","footerContent","socialContent","miscLinks","useFooterContent","motif","expandedSectionItemId","setExpandedSectionItemId","useState","toggleExpandedSectionItemId","useCallback","itemId","getPreparedMenu","useMemo","items","flatMap","item","id","MenuItemId","SiteMap","START_HERE_ID","Array","isArray","handleItemClick","event","length","stopPropagation","url","normalizeFooterSections","sections","Object","values","map","section","i","header","label","isSectionEnd","keys","normalizedFooterContent","social","S.Wrap","Wrap","children","jsx","S.Container","size","noVerticalMargin","S.InnerWrap","jsxs","S.Section","S.SectionItemsGroup","SectionItemsGroup","$active","$isSectionEnd","$isSectionBegin","isSectionBegin","S.SectionItem","SectionItem","onClick","S.SectionItemLabel","SectionItemLabel","S.SectionItemArrowButton","SectionItemArrowButton","S.ButtonIcon","S.Chevron","Chevron","src","icons.generic.collapseArrow","width","height","subItem","$secondary","target","isExternalUrl","as","href","rel","isNew","S.Badge","S.SectionItemLink","SectionItemLink","StyleableSvgImage"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAeA,MAAMA,SAAY,GAAA,OAAA;AAQX,MAAMC,mBAAmBA,CAAC;EAC/BC,IAAA;EACAC,eAAA;EACAC;AACF,CAAwB,KAAA;EAChB,MAAA;IAAEC;EAAS,CAAA,GAAIC,wBAAiB,CAAA,CAAA;EACtC,MAAM;IAAEC;EAAA,CAAkB,GAAAC,YAAA,CAAAA,4BAAA,CAA6BH,QAAQ,CAAA;EAC/D,MAAM;IAAEI,aAAA;IAAeC,aAAe;IAAAC;EAAA,IAAcC,gBAAAA,CAAAA,gBAAiB,CAAA,CAAA;EAErE,MAAMC,KAAe,GAAAb,SAAA;EAKrB,MAAM,CAACc,qBAAA,EAAuBC,wBAAwB,CAAA,GAAIC,KAAAA,CAAAA,SAExD,IAAI,CAAA;EAEN,MAAMC,2BAA8B,GAAAC,KAAA,CAAAA,WAAA,CACjCC,MAAmB,IAAA;IAClBJ,wBAAA,CACED,qBAAA,KAA0BK,SAAS,IAAO,GAAAA,MAC5C,CAAA;EACF,CAAA,EACA,CAACL,qBAAqB,CACxB,CAAA;EAEM,MAAAM,eAAA,GAAkBC,KAAAA,CAAAA,QAAQ,MAAM;IACpC,OAAA,CAAQnB,MAAMoB,KAAS,IAAA,EAAI,EAAAC,OAAA,CAASC,IAAS,IAAA;MAE3C,IAAI,CAACA,IAAA,IAAQA,IAAK,CAAAC,EAAA,KAAOC,OAAAA,CAAAA,WAAWC,OAAS,EAAA;QAC3C,OAAO,EAAC;MAAA;MAGV,IAAIH,KAAKC,EAAO,KAAAG,OAAA,CAAAA,aAAA,IAAiBC,MAAMC,OAAQ,CAAAN,IAAA,CAAKF,KAAK,CAAG,EAAA;QAC1D,OAAOE,IAAK,CAAAF,KAAA;MAAA;MAEP,OAAAE,IAAA;IAAA,CACR,CAAA;EAAA,CACH,EAAG,CAACtB,I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,CAEJ,CAAA,EAECU,KAAKC,EAAO,KAAAX,qBAAA,IACXU,MAAMF,KAAO,EAAAkB,GAAA,CAAKuC,OAChB,mBAAA3B,UAAA,CAAAA,GAAA,CAACoC,iBAAE,CAAAC,eAAA,EAAF;cAEC5E,KAAM,EAAA,MAAA;cACNmE,UAAU,EAAA,IAAA;cACVI,MAAML,OAAQ,CAAAJ,GAAA;cACdU,GAAK,EAAA,qBAAA;cACLF,EAAG,EAAA,GAAA;cAEHhC,wCAACiB,kCAAE,EAAF;gBAAmBvD,KAAA;gBACjBsC,kBAAQP;cACX,CAAA;YAAA,CAAA,EATKmC,OAAQ,CAAAtD,EAWhB,CAAA,CAAA;UAAA,CAAA,EAhDED,IAAK,CAAAC,EAkDb,CAAA,CAAA;SACH;MAAA,CACF;IACF,CAAA;GACF,CAAA;AAEJ,CAAA;"}
|
|
1
|
+
{"version":3,"file":"MobileMenu.js","sources":["../../../../src/components/Header/MobileLinksModal/MobileMenu.tsx"],"sourcesContent":["import type { Motif } from \"@ubnt/ui-components/utils\";\nimport { Fragment, useCallback, useMemo, useState } from \"react\";\n\nimport * as icons from \"../../../constants/icons\";\nimport { useMicrositeMenu } from \"../../../contexts/MicrositeMenuContext\";\nimport {\n MenuItemId,\n START_HERE_ID,\n} from \"../../../contexts/MicrositeMenuContext/mapping\";\nimport { useMicrositeMenuTranslations } from \"../../../contexts/MicrositeMenuContext/translations\";\nimport type { ParsedMicrositeHeaderItem } from \"../../../contexts/MicrositeMenuContext/types\";\nimport type { FooterLinkId } from \"../../Footer/hooks/useFooterContent\";\nimport { useFooterContent } from \"../../Footer/hooks/useFooterContent\";\nimport { StyleableSvgImage } from \"../../StyleableSvgImage\";\nimport * as S from \"./MobileMenu.styles\";\nconst LIGHT_KEY = \"light\";\n\nexport interface MobileLinksProps {\n menu: Pick<ParsedMicrositeHeaderItem, \"label\" | \"url\" | \"items\">;\n onMenuItemClick: (e: React.MouseEvent<HTMLElement>, url: string) => void;\n onModalClose: () => void;\n}\n\nexport const MobileLinksModal = ({\n menu,\n onMenuItemClick,\n onModalClose,\n}: MobileLinksProps) => {\n const { language } = useMicrositeMenu();\n const { formatMessage } = useMicrositeMenuTranslations(language);\n const { footerContent, socialContent, miscLinks } = useFooterContent();\n\n const motif: Motif = LIGHT_KEY;\n\n // #############################################################################\n // Section toggling\n // #############################################################################\n const [expandedSectionItemId, setExpandedSectionItemId] = useState<\n string | null\n >(null);\n const [expandedSubSectionItemId, setExpandedSubSectionItemId] = useState<\n string | null\n >(null);\n\n const toggleExpandedSectionItemId = useCallback(\n (itemId: string) => {\n setExpandedSectionItemId(\n expandedSectionItemId === itemId ? null : itemId,\n );\n },\n [expandedSectionItemId],\n );\n\n const toggleExpandedSubSectionItemId = useCallback(\n (itemId: string | null) => {\n setExpandedSubSectionItemId((prev) => (prev === itemId ? null : itemId));\n },\n [],\n );\n\n const getPreparedMenu = useMemo(() => {\n return (menu?.items ?? []).flatMap((item) => {\n if (!item || item.id === MenuItemId.SiteMap) return [];\n if (item.id === START_HERE_ID && Array.isArray(item.items)) {\n return item.items;\n }\n return [item];\n });\n }, [menu]);\n\n // #############################################################################\n // Render\n // #############################################################################\n\n const handleItemClick = (\n event: React.MouseEvent<HTMLButtonElement>,\n item?: ParsedMicrositeHeaderItem,\n ) => {\n if (item?.items?.length) {\n event.stopPropagation();\n toggleExpandedSectionItemId(item.id);\n } else if (item?.url) {\n onMenuItemClick(event, item.url);\n onModalClose();\n }\n };\n\n type FooterItem = {\n id: FooterLinkId;\n label: string;\n src: string;\n target?: string;\n isSectionEnd?: boolean;\n };\n\n type FooterSection = {\n header: {\n id: string;\n label: string;\n };\n items: FooterItem[];\n };\n\n type FooterSections = {\n company: FooterSection;\n training: FooterSection;\n buy: FooterSection;\n tools: FooterSection;\n social: FooterSection;\n };\n\n function normalizeFooterSections(sections: FooterSections) {\n return Object.values(sections).map((section, i) => ({\n id: section.header.id,\n label: section.header.label,\n isSectionEnd: i === Object.keys(sections).length - 1,\n items: section.items,\n }));\n }\n\n const normalizedFooterContent = normalizeFooterSections({\n ...footerContent,\n social: socialContent,\n });\n\n return (\n <S.Wrap>\n <S.Container size=\"mobile\" noVerticalMargin>\n <S.InnerWrap>\n <S.Section>\n {getPreparedMenu.map((item) => (\n <S.SectionItemsGroup\n motif={motif}\n key={item.id}\n $active={item.id === expandedSectionItemId}\n // @NOTE to separate sections and styling until there's a better way\n $isSectionEnd={item?.isSectionEnd}\n $isSectionBegin={item?.isSectionBegin}\n >\n <S.SectionItem\n motif={motif}\n onClick={(event) => handleItemClick(event, item)}\n >\n <S.SectionItemLabel\n $active={item.id === expandedSectionItemId}\n motif={motif}\n >\n {formatMessage(item.label)}\n </S.SectionItemLabel>\n\n {item?.items && (\n <S.SectionItemArrowButton\n motif={motif}\n onClick={(e) => {\n e.stopPropagation();\n toggleExpandedSectionItemId(item.id);\n toggleExpandedSubSectionItemId(null);\n }}\n >\n <S.ButtonIcon>\n <S.Chevron\n src={icons.generic.collapseArrow}\n width={13}\n height={8}\n $active={item.id === expandedSectionItemId}\n />\n </S.ButtonIcon>\n </S.SectionItemArrowButton>\n )}\n </S.SectionItem>\n\n {item.id === expandedSectionItemId &&\n item?.items?.map((subItem) => (\n <Fragment key={subItem.id}>\n <S.SectionItem\n motif=\"dark\"\n $secondary\n {...(subItem?.target || subItem?.isExternalUrl\n ? {\n as: \"a\",\n href: subItem.url,\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n }\n : {\n onClick: (event) => {\n event.preventDefault();\n if (!subItem?.items) {\n handleItemClick(event, subItem);\n }\n },\n })}\n >\n <S.SectionItemLabel\n motif={motif}\n $active={subItem.id === expandedSubSectionItemId}\n >\n <>\n {formatMessage(subItem.label)}\n {subItem.isNew && (\n <S.Badge>\n {formatMessage(\"commons.menu.label.new\")}\n </S.Badge>\n )}\n </>\n </S.SectionItemLabel>\n\n {subItem?.items && (\n <S.SectionItemArrowButton\n motif={motif}\n onClick={(e) => {\n e.stopPropagation();\n toggleExpandedSubSectionItemId(subItem.id);\n }}\n >\n <S.ButtonIcon>\n <S.Chevron\n src={icons.generic.collapseArrow}\n width={13}\n height={8}\n $rotated={\n subItem.id === expandedSubSectionItemId\n }\n />\n </S.ButtonIcon>\n </S.SectionItemArrowButton>\n )}\n </S.SectionItem>\n\n {subItem.id === expandedSubSectionItemId &&\n subItem.items?.map((nested) => (\n <S.SectionItem\n key={nested.id}\n motif=\"dark\"\n $secondary\n href={nested.url}\n as=\"a\"\n rel=\"noopener noreferrer\"\n $active={item.id === expandedSectionItemId}\n >\n <S.SectionItemLabel motif={motif} $tertiary>\n {formatMessage(nested.label)}\n </S.SectionItemLabel>\n </S.SectionItem>\n ))}\n </Fragment>\n ))}\n </S.SectionItemsGroup>\n ))}\n\n {/* Header Links that don't exist in Desktop Footer */}\n {[...miscLinks].map((item, i) => (\n <S.SectionItemsGroup\n motif={motif}\n key={item.id}\n $active={item.id === expandedSectionItemId}\n $isSectionBegin={i === 0}\n >\n <S.SectionItem\n motif={motif}\n href={item.src}\n target={item?.target ?? \"self\"}\n rel={\"noopener noreferrer\"}\n as=\"a\"\n >\n <S.SectionItemLabel\n $active={item.id === expandedSectionItemId}\n motif={motif}\n >\n {item.label}\n </S.SectionItemLabel>\n </S.SectionItem>\n </S.SectionItemsGroup>\n ))}\n\n {normalizedFooterContent.map((item) => (\n <S.SectionItemsGroup\n motif={motif}\n key={item.id}\n $active={item.id === expandedSectionItemId}\n $isSectionEnd={item?.isSectionEnd}\n >\n <S.SectionItem\n $active={item.id === expandedSectionItemId}\n motif={motif}\n onClick={() =>\n item?.items && toggleExpandedSectionItemId(item.id)\n }\n >\n <S.SectionItemLabel\n $active={item.id === expandedSectionItemId}\n motif={motif}\n >\n {item.label}\n </S.SectionItemLabel>\n\n {item?.items && (\n <S.SectionItemArrowButton\n motif={motif}\n onClick={() => toggleExpandedSectionItemId(item.id)}\n >\n <S.ButtonIcon>\n <StyleableSvgImage\n src={icons.generic.collapseArrow}\n width={13}\n height={8}\n $active={item.id === expandedSectionItemId}\n />\n </S.ButtonIcon>\n </S.SectionItemArrowButton>\n )}\n </S.SectionItem>\n\n {item.id === expandedSectionItemId &&\n item?.items?.map((subItem) => (\n <S.SectionItem\n key={subItem.id}\n motif=\"dark\"\n $secondary\n href={subItem.src}\n rel={\"noopener noreferrer\"}\n as=\"a\"\n >\n <S.SectionItemLabel motif={motif}>\n {subItem.label}\n </S.SectionItemLabel>\n </S.SectionItem>\n ))}\n </S.SectionItemsGroup>\n ))}\n </S.Section>\n </S.InnerWrap>\n </S.Container>\n </S.Wrap>\n );\n};\n"],"names":["LIGHT_KEY","MobileLinksModal","menu","onMenuItemClick","onModalClose","language","useMicrositeMenu","formatMessage","useMicrositeMenuTranslations","footerContent","socialContent","miscLinks","useFooterContent","motif","expandedSectionItemId","setExpandedSectionItemId","useState","expandedSubSectionItemId","setExpandedSubSectionItemId","toggleExpandedSectionItemId","useCallback","itemId","toggleExpandedSubSectionItemId","prev","getPreparedMenu","useMemo","items","flatMap","item","id","MenuItemId","SiteMap","START_HERE_ID","Array","isArray","handleItemClick","event","length","stopPropagation","url","normalizeFooterSections","sections","Object","values","map","section","i","header","label","isSectionEnd","keys","normalizedFooterContent","social","S.Wrap","Wrap","children","jsx","S.Container","size","noVerticalMargin","S.InnerWrap","jsxs","S.Section","S.SectionItemsGroup","SectionItemsGroup","$active","$isSectionEnd","$isSectionBegin","isSectionBegin","S.SectionItem","SectionItem","onClick","S.SectionItemLabel","SectionItemLabel","S.SectionItemArrowButton","SectionItemArrowButton","e","S.ButtonIcon","S.Chevron","Chevron","src","icons.generic.collapseArrow","width","height","subItem","Fragment","$secondary","target","isExternalUrl","as","href","rel","preventDefault","isNew","S.Badge","$rotated","nested","$tertiary","StyleableSvgImage"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAeA,MAAMA,SAAY,GAAA,OAAA;AAQX,MAAMC,mBAAmBA,CAAC;EAC/BC,IAAA;EACAC,eAAA;EACAC;AACF,CAAwB,KAAA;EAChB,MAAA;IAAE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sBAAA,EAAF;gBACC9D,KAAA;gBACA0D,OAAS,EAAAA,CAAA,KAAMpD,2BAA4B,CAAAS,IAAA,CAAKC,EAAE,CAAA;gBAElD0B,QAAA,iBAAAC,UAAA,CAAAA,GAAA,CAACqB,4BAAE,EAAF;kBACCtB,QAAA,EAAA,eAAAC,UAAA,CAAAA,GAAA,CAAC0C,iBAAA,CAAAA,iBAAA,EAAA;oBACClB,GAAA,EAAKC,iCAAc,CAAA,SAAA,CAAA;oBACnBC,KAAO,EAAA,EAAA;oBACPC,MAAQ,EAAA,CAAA;oBACRlB,OAAA,EAASrC,KAAKC,EAAO,KAAAf;kBAAA,CAAA;gBAEzB,CAAA;cAAA,CAAA,CAAA;YACF,CAEJ,CAAA,EAECc,KAAKC,EAAO,KAAAf,qBAAA,IACXc,MAAMF,KAAO,EAAAkB,GAAA,CAAKwC,OAChB,mBAAA5B,UAAA,CAAAA,GAAA,CAACa,iBAAE,CAAAC,WAAA,EAAF;cAECzD,KAAM,EAAA,MAAA;cACNyE,UAAU,EAAA,IAAA;cACVI,MAAMN,OAAQ,CAAAJ,GAAA;cACdW,GAAK,EAAA,qBAAA;cACLF,EAAG,EAAA,GAAA;cAEHlC,wCAACiB,kCAAE,EAAF;gBAAmB3D,KAAA;gBACjB0C,kBAAQP;cACX,CAAA;YAAA,CAAA,EATKoC,OAAQ,CAAAvD,EAWhB,CAAA,CAAA;UAAA,CAAA,EAjDED,IAAK,CAAAC,EAmDb,CAAA,CAAA;SACH;MAAA,CACF;IACF,CAAA;GACF,CAAA;AAEJ,CAAA;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { useState, useCallback, useMemo } from 'react';
|
|
1
|
+
import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useCallback, useMemo, Fragment } from 'react';
|
|
3
3
|
import '../../../constants/icons/index.mjs';
|
|
4
4
|
import '../../../contexts/MicrositeMenuContext/index.mjs';
|
|
5
5
|
import { MenuItemId, START_HERE_ID } from '../../../contexts/MicrositeMenuContext/mapping.mjs';
|
|
6
6
|
import { useMicrositeMenuTranslations } from '../../../contexts/MicrositeMenuContext/translations.mjs';
|
|
7
7
|
import { useFooterContent } from '../../Footer/hooks/useFooterContent.mjs';
|
|
8
8
|
import '../../StyleableSvgImage/index.mjs';
|
|
9
|
-
import { Wrap, Container, InnerWrap, Section, SectionItemsGroup, SectionItem, SectionItemLabel, SectionItemArrowButton, ButtonIcon, Chevron, Badge
|
|
9
|
+
import { Wrap, Container, InnerWrap, Section, SectionItemsGroup, SectionItem, SectionItemLabel, SectionItemArrowButton, ButtonIcon, Chevron, Badge } from './MobileMenu.styles.mjs';
|
|
10
10
|
import { useMicrositeMenu } from '../../../contexts/MicrositeMenuContext/context.mjs';
|
|
11
11
|
import _externalAssets_BAXELvSy__default from "../../../assets/collapseArrow.svg";
|
|
12
12
|
import { StyleableSvgImage } from '../../StyleableSvgImage/StyleableSvgImage.mjs';
|
|
@@ -30,18 +30,20 @@ const MobileLinksModal = ({
|
|
|
30
30
|
} = useFooterContent();
|
|
31
31
|
const motif = LIGHT_KEY;
|
|
32
32
|
const [expandedSectionItemId, setExpandedSectionItemId] = useState(null);
|
|
33
|
+
const [expandedSubSectionItemId, setExpandedSubSectionItemId] = useState(null);
|
|
33
34
|
const toggleExpandedSectionItemId = useCallback(itemId => {
|
|
34
35
|
setExpandedSectionItemId(expandedSectionItemId === itemId ? null : itemId);
|
|
35
36
|
}, [expandedSectionItemId]);
|
|
37
|
+
const toggleExpandedSubSectionItemId = useCallback(itemId => {
|
|
38
|
+
setExpandedSubSectionItemId(prev => prev === itemId ? null : itemId);
|
|
39
|
+
}, []);
|
|
36
40
|
const getPreparedMenu = useMemo(() => {
|
|
37
41
|
return (menu?.items ?? []).flatMap(item => {
|
|
38
|
-
if (!item || item.id === MenuItemId.SiteMap)
|
|
39
|
-
return [];
|
|
40
|
-
}
|
|
42
|
+
if (!item || item.id === MenuItemId.SiteMap) return [];
|
|
41
43
|
if (item.id === START_HERE_ID && Array.isArray(item.items)) {
|
|
42
44
|
return item.items;
|
|
43
45
|
}
|
|
44
|
-
return item;
|
|
46
|
+
return [item];
|
|
45
47
|
});
|
|
46
48
|
}, [menu]);
|
|
47
49
|
const handleItemClick = (event, item) => {
|
|
@@ -85,7 +87,11 @@ const MobileLinksModal = ({
|
|
|
85
87
|
children: formatMessage(item.label)
|
|
86
88
|
}), item?.items && /* @__PURE__ */jsx(SectionItemArrowButton, {
|
|
87
89
|
motif,
|
|
88
|
-
onClick:
|
|
90
|
+
onClick: e => {
|
|
91
|
+
e.stopPropagation();
|
|
92
|
+
toggleExpandedSectionItemId(item.id);
|
|
93
|
+
toggleExpandedSubSectionItemId(null);
|
|
94
|
+
},
|
|
89
95
|
children: /* @__PURE__ */jsx(ButtonIcon, {
|
|
90
96
|
children: /* @__PURE__ */jsx(Chevron, {
|
|
91
97
|
src: _externalAssets_BAXELvSy__default,
|
|
@@ -95,29 +101,65 @@ const MobileLinksModal = ({
|
|
|
95
101
|
})
|
|
96
102
|
})
|
|
97
103
|
})]
|
|
98
|
-
}), item.id === expandedSectionItemId && item?.items?.map(subItem => /* @__PURE__ */
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
104
|
+
}), item.id === expandedSectionItemId && item?.items?.map(subItem => /* @__PURE__ */jsxs(Fragment, {
|
|
105
|
+
children: [/* @__PURE__ */jsxs(SectionItem, {
|
|
106
|
+
motif: "dark",
|
|
107
|
+
$secondary: true,
|
|
108
|
+
...(subItem?.target || subItem?.isExternalUrl ? {
|
|
109
|
+
as: "a",
|
|
110
|
+
href: subItem.url,
|
|
111
|
+
target: "_blank",
|
|
112
|
+
rel: "noopener noreferrer"
|
|
113
|
+
} : {
|
|
114
|
+
onClick: event => {
|
|
115
|
+
event.preventDefault();
|
|
116
|
+
if (!subItem?.items) {
|
|
117
|
+
handleItemClick(event, subItem);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}),
|
|
121
|
+
children: [/* @__PURE__ */jsx(SectionItemLabel, {
|
|
122
|
+
motif,
|
|
123
|
+
$active: subItem.id === expandedSubSectionItemId,
|
|
124
|
+
children: /* @__PURE__ */jsxs(Fragment$1, {
|
|
125
|
+
children: [formatMessage(subItem.label), subItem.isNew && /* @__PURE__ */jsx(Badge, {
|
|
126
|
+
children: formatMessage("commons.menu.label.new")
|
|
127
|
+
})]
|
|
128
|
+
})
|
|
129
|
+
}), subItem?.items && /* @__PURE__ */jsx(SectionItemArrowButton, {
|
|
130
|
+
motif,
|
|
131
|
+
onClick: e => {
|
|
132
|
+
e.stopPropagation();
|
|
133
|
+
toggleExpandedSubSectionItemId(subItem.id);
|
|
134
|
+
},
|
|
135
|
+
children: /* @__PURE__ */jsx(ButtonIcon, {
|
|
136
|
+
children: /* @__PURE__ */jsx(Chevron, {
|
|
137
|
+
src: _externalAssets_BAXELvSy__default,
|
|
138
|
+
width: 13,
|
|
139
|
+
height: 8,
|
|
140
|
+
$rotated: subItem.id === expandedSubSectionItemId
|
|
141
|
+
})
|
|
142
|
+
})
|
|
113
143
|
})]
|
|
114
|
-
})
|
|
144
|
+
}), subItem.id === expandedSubSectionItemId && subItem.items?.map(nested => /* @__PURE__ */jsx(SectionItem, {
|
|
145
|
+
motif: "dark",
|
|
146
|
+
$secondary: true,
|
|
147
|
+
href: nested.url,
|
|
148
|
+
as: "a",
|
|
149
|
+
rel: "noopener noreferrer",
|
|
150
|
+
$active: item.id === expandedSectionItemId,
|
|
151
|
+
children: /* @__PURE__ */jsx(SectionItemLabel, {
|
|
152
|
+
motif,
|
|
153
|
+
$tertiary: true,
|
|
154
|
+
children: formatMessage(nested.label)
|
|
155
|
+
})
|
|
156
|
+
}, nested.id))]
|
|
115
157
|
}, subItem.id))]
|
|
116
158
|
}, item.id)), [...miscLinks].map((item, i) => /* @__PURE__ */jsx(SectionItemsGroup, {
|
|
117
159
|
motif,
|
|
118
160
|
$active: item.id === expandedSectionItemId,
|
|
119
161
|
$isSectionBegin: i === 0,
|
|
120
|
-
children: /* @__PURE__ */jsx(
|
|
162
|
+
children: /* @__PURE__ */jsx(SectionItem, {
|
|
121
163
|
motif,
|
|
122
164
|
href: item.src,
|
|
123
165
|
target: item?.target ?? "self",
|
|
@@ -134,6 +176,7 @@ const MobileLinksModal = ({
|
|
|
134
176
|
$active: item.id === expandedSectionItemId,
|
|
135
177
|
$isSectionEnd: item?.isSectionEnd,
|
|
136
178
|
children: [/* @__PURE__ */jsxs(SectionItem, {
|
|
179
|
+
$active: item.id === expandedSectionItemId,
|
|
137
180
|
motif,
|
|
138
181
|
onClick: () => item?.items && toggleExpandedSectionItemId(item.id),
|
|
139
182
|
children: [/* @__PURE__ */jsx(SectionItemLabel, {
|
|
@@ -152,7 +195,7 @@ const MobileLinksModal = ({
|
|
|
152
195
|
})
|
|
153
196
|
})
|
|
154
197
|
})]
|
|
155
|
-
}), item.id === expandedSectionItemId && item?.items?.map(subItem => /* @__PURE__ */jsx(
|
|
198
|
+
}), item.id === expandedSectionItemId && item?.items?.map(subItem => /* @__PURE__ */jsx(SectionItem, {
|
|
156
199
|
motif: "dark",
|
|
157
200
|
$secondary: true,
|
|
158
201
|
href: subItem.src,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileMenu.mjs","sources":["../../../../src/components/Header/MobileLinksModal/MobileMenu.tsx"],"sourcesContent":["import type { Motif } from \"@ubnt/ui-components/utils\";\nimport { useCallback, useMemo, useState } from \"react\";\n\nimport * as icons from \"../../../constants/icons\";\nimport { useMicrositeMenu } from \"../../../contexts/MicrositeMenuContext\";\nimport {\n MenuItemId,\n START_HERE_ID,\n} from \"../../../contexts/MicrositeMenuContext/mapping\";\nimport { useMicrositeMenuTranslations } from \"../../../contexts/MicrositeMenuContext/translations\";\nimport type { ParsedMicrositeHeaderItem } from \"../../../contexts/MicrositeMenuContext/types\";\nimport type { FooterLinkId } from \"../../Footer/hooks/useFooterContent\";\nimport { useFooterContent } from \"../../Footer/hooks/useFooterContent\";\nimport { StyleableSvgImage } from \"../../StyleableSvgImage\";\nimport * as S from \"./MobileMenu.styles\";\nconst LIGHT_KEY = \"light\";\n\nexport interface MobileLinksProps {\n menu: Pick<ParsedMicrositeHeaderItem, \"label\" | \"url\" | \"items\">;\n onMenuItemClick: (e: React.MouseEvent<HTMLElement>, url: string) => void;\n onModalClose: () => void;\n}\n\nexport const MobileLinksModal = ({\n menu,\n onMenuItemClick,\n onModalClose,\n}: MobileLinksProps) => {\n const { language } = useMicrositeMenu();\n const { formatMessage } = useMicrositeMenuTranslations(language);\n const { footerContent, socialContent, miscLinks } = useFooterContent();\n\n const motif: Motif = LIGHT_KEY;\n\n // #############################################################################\n // Section toggling\n // #############################################################################\n const [expandedSectionItemId, setExpandedSectionItemId] = useState<\n string | null\n >(null);\n\n const toggleExpandedSectionItemId = useCallback(\n (itemId: string) => {\n setExpandedSectionItemId(\n expandedSectionItemId === itemId ? null : itemId,\n );\n },\n [expandedSectionItemId],\n );\n\n const getPreparedMenu = useMemo(() => {\n return (menu?.items ?? []).flatMap((item) => {\n // Remove SiteMap\n if (!item || item.id === MenuItemId.SiteMap) {\n return [];\n }\n // Flatten Start Here one level\n if (item.id === START_HERE_ID && Array.isArray(item.items)) {\n return item.items;\n }\n return item;\n });\n }, [menu]);\n\n // #############################################################################\n // Render\n // #############################################################################\n\n const handleItemClick = (\n event: React.MouseEvent<HTMLButtonElement, MouseEvent>,\n item?: ParsedMicrositeHeaderItem,\n ) => {\n if (item?.items?.length) {\n event.stopPropagation();\n toggleExpandedSectionItemId(item.id);\n } else if (item?.url) {\n onMenuItemClick(event, item.url);\n onModalClose();\n }\n };\n\n type FooterItem = {\n id: FooterLinkId;\n label: string;\n src: string;\n target?: string;\n isSectionEnd?: boolean;\n };\n\n type FooterSection = {\n header: {\n id: string;\n label: string;\n };\n items: FooterItem[];\n };\n\n type FooterSections = {\n company: FooterSection;\n training: FooterSection;\n buy: FooterSection;\n tools: FooterSection;\n social: FooterSection;\n };\n\n function normalizeFooterSections(sections: FooterSections) {\n return Object.values(sections).map((section, i) => ({\n id: section.header.id,\n label: section.header.label,\n isSectionEnd: i === Object.keys(sections).length - 1,\n items: section.items,\n }));\n }\n\n const normalizedFooterContent = normalizeFooterSections({\n ...footerContent,\n social: socialContent,\n });\n\n return (\n <S.Wrap>\n <S.Container size=\"mobile\" noVerticalMargin>\n <S.InnerWrap>\n <S.Section>\n {getPreparedMenu.map((item) => (\n <S.SectionItemsGroup\n motif={motif}\n key={item.id}\n $active={item.id === expandedSectionItemId}\n // @NOTE to separate sections and styling until there's a better way\n $isSectionEnd={item?.isSectionEnd}\n $isSectionBegin={item?.isSectionBegin}\n >\n <S.SectionItem\n motif={motif}\n onClick={(event) => handleItemClick(event, item)}\n >\n <S.SectionItemLabel\n $active={item.id === expandedSectionItemId}\n motif={motif}\n >\n {formatMessage(item.label)}\n </S.SectionItemLabel>\n\n {item?.items && (\n <S.SectionItemArrowButton\n motif={motif}\n onClick={() => toggleExpandedSectionItemId(item.id)}\n >\n <S.ButtonIcon>\n <S.Chevron\n src={icons.generic.collapseArrow}\n width={13}\n height={8}\n $active={item.id === expandedSectionItemId}\n />\n </S.ButtonIcon>\n </S.SectionItemArrowButton>\n )}\n </S.SectionItem>\n\n {item.id === expandedSectionItemId &&\n item?.items?.map((subItem) => (\n <S.SectionItem\n key={subItem.id}\n motif=\"dark\"\n $secondary\n {...(subItem?.target || subItem?.isExternalUrl\n ? {\n as: \"a\",\n href: subItem.url,\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n }\n : {\n onClick: (event) => handleItemClick(event, subItem),\n })}\n >\n <S.SectionItemLabel motif={motif}>\n {formatMessage(subItem.label)}\n {subItem.isNew && (\n <S.Badge>\n {formatMessage(\"commons.menu.label.new\")}\n </S.Badge>\n )}\n </S.SectionItemLabel>\n </S.SectionItem>\n ))}\n </S.SectionItemsGroup>\n ))}\n\n {/* Header Links that don't exist in Desktop Footer */}\n {[...miscLinks].map((item, i) => (\n <S.SectionItemsGroup\n motif={motif}\n key={item.id}\n $active={item.id === expandedSectionItemId}\n $isSectionBegin={i === 0}\n >\n <S.SectionItemLink\n motif={motif}\n href={item.src}\n target={item?.target ?? \"self\"}\n rel={\"noopener noreferrer\"}\n as=\"a\"\n >\n <S.SectionItemLabel\n $active={item.id === expandedSectionItemId}\n motif={motif}\n >\n {item.label}\n </S.SectionItemLabel>\n </S.SectionItemLink>\n </S.SectionItemsGroup>\n ))}\n\n {/* Footer Links to be included in Mobile Nav Modal */}\n {normalizedFooterContent.map((item) => (\n <S.SectionItemsGroup\n motif={motif}\n key={item.id}\n $active={item.id === expandedSectionItemId}\n $isSectionEnd={item?.isSectionEnd}\n >\n <S.SectionItem\n motif={motif}\n onClick={() =>\n item?.items && toggleExpandedSectionItemId(item.id)\n }\n >\n <S.SectionItemLabel\n $active={item.id === expandedSectionItemId}\n motif={motif}\n >\n {item.label}\n </S.SectionItemLabel>\n\n {item?.items && (\n <S.SectionItemArrowButton\n motif={motif}\n onClick={() => toggleExpandedSectionItemId(item.id)}\n >\n <S.ButtonIcon>\n <StyleableSvgImage\n src={icons.generic.collapseArrow}\n width={13}\n height={8}\n $active={item.id === expandedSectionItemId}\n />\n </S.ButtonIcon>\n </S.SectionItemArrowButton>\n )}\n </S.SectionItem>\n\n {item.id === expandedSectionItemId &&\n item?.items?.map((subItem) => (\n <S.SectionItemLink\n key={subItem.id}\n motif=\"dark\"\n $secondary\n href={subItem.src}\n rel={\"noopener noreferrer\"}\n as=\"a\"\n >\n <S.SectionItemLabel motif={motif}>\n {subItem.label}\n </S.SectionItemLabel>\n </S.SectionItemLink>\n ))}\n </S.SectionItemsGroup>\n ))}\n </S.Section>\n </S.InnerWrap>\n </S.Container>\n </S.Wrap>\n );\n};\n"],"names":["LIGHT_KEY","MobileLinksModal","menu","onMenuItemClick","onModalClose","language","useMicrositeMenu","formatMessage","useMicrositeMenuTranslations","footerContent","socialContent","miscLinks","useFooterContent","motif","expandedSectionItemId","setExpandedSectionItemId","useState","toggleExpandedSectionItemId","useCallback","itemId","getPreparedMenu","useMemo","items","flatMap","item","id","MenuItemId","SiteMap","START_HERE_ID","Array","isArray","handleItemClick","event","length","stopPropagation","url","normalizeFooterSections","sections","Object","values","map","section","i","header","label","isSectionEnd","keys","normalizedFooterContent","social","S.Wrap","children","jsx","S.Container","size","noVerticalMargin","S.InnerWrap","jsxs","S.Section","S.SectionItemsGroup","$active","$isSectionEnd","$isSectionBegin","isSectionBegin","S.SectionItem","onClick","S.SectionItemLabel","S.SectionItemArrowButton","S.ButtonIcon","S.Chevron","src","icons.generic.collapseArrow","width","height","subItem","$secondary","target","isExternalUrl","as","href","rel","isNew","S.Badge","S.SectionItemLink","StyleableSvgImage"],"mappings":";;;;;;;;;;;;;AAeA,MAAMA,SAAY,GAAA,OAAA;AAQX,MAAMC,mBAAmBA,CAAC;EAC/BC,IAAA;EACAC,eAAA;EACAC;AACF,CAAwB,KAAA;EAChB,MAAA;IAAEC;EAAS,CAAA,GAAIC,gBAAiB,CAAA,CAAA;EACtC,MAAM;IAAEC;EAAA,CAAkB,GAAAC,4BAAA,CAA6BH,QAAQ,CAAA;EAC/D,MAAM;IAAEI,aAAA;IAAeC,aAAe;IAAAC;EAAA,IAAcC,gBAAiB,CAAA,CAAA;EAErE,MAAMC,KAAe,GAAAb,SAAA;EAKrB,MAAM,CAACc,qBAAA,EAAuBC,wBAAwB,CAAA,GAAIC,SAExD,IAAI,CAAA;EAEN,MAAMC,2BAA8B,GAAAC,WAAA,CACjCC,MAAmB,IAAA;IAClBJ,wBAAA,CACED,qBAAA,KAA0BK,SAAS,IAAO,GAAAA,MAC5C,CAAA;EACF,CAAA,EACA,CAACL,qBAAqB,CACxB,CAAA;EAEM,M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,KAAM,EAAA,MAAA;cACN6D,UAAU,EAAA,IAAA;cACVI,MAAML,OAAQ,CAAAJ,GAAA;cACdU,GAAK,EAAA,qBAAA;cACLF,EAAG,EAAA,GAAA;cAEH3B,6BAACe,gBAAE,EAAF;gBAAmBpD,KAAA;gBACjBqC,kBAAQN;cACX,CAAA;YAAA,CAAA,EATK6B,OAAQ,CAAAhD,EAWhB,CAAA,CAAA;UAAA,CAAA,EAhDED,IAAK,CAAAC,EAkDb,CAAA,CAAA;SACH;MAAA,CACF;IACF,CAAA;GACF,CAAA;AAEJ,CAAA;"}
|
|
1
|
+
{"version":3,"file":"MobileMenu.mjs","sources":["../../../../src/components/Header/MobileLinksModal/MobileMenu.tsx"],"sourcesContent":["import type { Motif } from \"@ubnt/ui-components/utils\";\nimport { Fragment, useCallback, useMemo, useState } from \"react\";\n\nimport * as icons from \"../../../constants/icons\";\nimport { useMicrositeMenu } from \"../../../contexts/MicrositeMenuContext\";\nimport {\n MenuItemId,\n START_HERE_ID,\n} from \"../../../contexts/MicrositeMenuContext/mapping\";\nimport { useMicrositeMenuTranslations } from \"../../../contexts/MicrositeMenuContext/translations\";\nimport type { ParsedMicrositeHeaderItem } from \"../../../contexts/MicrositeMenuContext/types\";\nimport type { FooterLinkId } from \"../../Footer/hooks/useFooterContent\";\nimport { useFooterContent } from \"../../Footer/hooks/useFooterContent\";\nimport { StyleableSvgImage } from \"../../StyleableSvgImage\";\nimport * as S from \"./MobileMenu.styles\";\nconst LIGHT_KEY = \"light\";\n\nexport interface MobileLinksProps {\n menu: Pick<ParsedMicrositeHeaderItem, \"label\" | \"url\" | \"items\">;\n onMenuItemClick: (e: React.MouseEvent<HTMLElement>, url: string) => void;\n onModalClose: () => void;\n}\n\nexport const MobileLinksModal = ({\n menu,\n onMenuItemClick,\n onModalClose,\n}: MobileLinksProps) => {\n const { language } = useMicrositeMenu();\n const { formatMessage } = useMicrositeMenuTranslations(language);\n const { footerContent, socialContent, miscLinks } = useFooterContent();\n\n const motif: Motif = LIGHT_KEY;\n\n // #############################################################################\n // Section toggling\n // #############################################################################\n const [expandedSectionItemId, setExpandedSectionItemId] = useState<\n string | null\n >(null);\n const [expandedSubSectionItemId, setExpandedSubSectionItemId] = useState<\n string | null\n >(null);\n\n const toggleExpandedSectionItemId = useCallback(\n (itemId: string) => {\n setExpandedSectionItemId(\n expandedSectionItemId === itemId ? null : itemId,\n );\n },\n [expandedSectionItemId],\n );\n\n const toggleExpandedSubSectionItemId = useCallback(\n (itemId: string | null) => {\n setExpandedSubSectionItemId((prev) => (prev === itemId ? null : itemId));\n },\n [],\n );\n\n const getPreparedMenu = useMemo(() => {\n return (menu?.items ?? []).flatMap((item) => {\n if (!item || item.id === MenuItemId.SiteMap) return [];\n if (item.id === START_HERE_ID && Array.isArray(item.items)) {\n return item.items;\n }\n return [item];\n });\n }, [menu]);\n\n // #############################################################################\n // Render\n // #############################################################################\n\n const handleItemClick = (\n event: React.MouseEvent<HTMLButtonElement>,\n item?: ParsedMicrositeHeaderItem,\n ) => {\n if (item?.items?.length) {\n event.stopPropagation();\n toggleExpandedSectionItemId(item.id);\n } else if (item?.url) {\n onMenuItemClick(event, item.url);\n onModalClose();\n }\n };\n\n type FooterItem = {\n id: FooterLinkId;\n label: string;\n src: string;\n target?: string;\n isSectionEnd?: boolean;\n };\n\n type FooterSection = {\n header: {\n id: string;\n label: string;\n };\n items: FooterItem[];\n };\n\n type FooterSections = {\n company: FooterSection;\n training: FooterSection;\n buy: FooterSection;\n tools: FooterSection;\n social: FooterSection;\n };\n\n function normalizeFooterSections(sections: FooterSections) {\n return Object.values(sections).map((section, i) => ({\n id: section.header.id,\n label: section.header.label,\n isSectionEnd: i === Object.keys(sections).length - 1,\n items: section.items,\n }));\n }\n\n const normalizedFooterContent = normalizeFooterSections({\n ...footerContent,\n social: socialContent,\n });\n\n return (\n <S.Wrap>\n <S.Container size=\"mobile\" noVerticalMargin>\n <S.InnerWrap>\n <S.Section>\n {getPreparedMenu.map((item) => (\n <S.SectionItemsGroup\n motif={motif}\n key={item.id}\n $active={item.id === expandedSectionItemId}\n // @NOTE to separate sections and styling until there's a better way\n $isSectionEnd={item?.isSectionEnd}\n $isSectionBegin={item?.isSectionBegin}\n >\n <S.SectionItem\n motif={motif}\n onClick={(event) => handleItemClick(event, item)}\n >\n <S.SectionItemLabel\n $active={item.id === expandedSectionItemId}\n motif={motif}\n >\n {formatMessage(item.label)}\n </S.SectionItemLabel>\n\n {item?.items && (\n <S.SectionItemArrowButton\n motif={motif}\n onClick={(e) => {\n e.stopPropagation();\n toggleExpandedSectionItemId(item.id);\n toggleExpandedSubSectionItemId(null);\n }}\n >\n <S.ButtonIcon>\n <S.Chevron\n src={icons.generic.collapseArrow}\n width={13}\n height={8}\n $active={item.id === expandedSectionItemId}\n />\n </S.ButtonIcon>\n </S.SectionItemArrowButton>\n )}\n </S.SectionItem>\n\n {item.id === expandedSectionItemId &&\n item?.items?.map((subItem) => (\n <Fragment key={subItem.id}>\n <S.SectionItem\n motif=\"dark\"\n $secondary\n {...(subItem?.target || subItem?.isExternalUrl\n ? {\n as: \"a\",\n href: subItem.url,\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n }\n : {\n onClick: (event) => {\n event.preventDefault();\n if (!subItem?.items) {\n handleItemClick(event, subItem);\n }\n },\n })}\n >\n <S.SectionItemLabel\n motif={motif}\n $active={subItem.id === expandedSubSectionItemId}\n >\n <>\n {formatMessage(subItem.label)}\n {subItem.isNew && (\n <S.Badge>\n {formatMessage(\"commons.menu.label.new\")}\n </S.Badge>\n )}\n </>\n </S.SectionItemLabel>\n\n {subItem?.items && (\n <S.SectionItemArrowButton\n motif={motif}\n onClick={(e) => {\n e.stopPropagation();\n toggleExpandedSubSectionItemId(subItem.id);\n }}\n >\n <S.ButtonIcon>\n <S.Chevron\n src={icons.generic.collapseArrow}\n width={13}\n height={8}\n $rotated={\n subItem.id === expandedSubSectionItemId\n }\n />\n </S.ButtonIcon>\n </S.SectionItemArrowButton>\n )}\n </S.SectionItem>\n\n {subItem.id === expandedSubSectionItemId &&\n subItem.items?.map((nested) => (\n <S.SectionItem\n key={nested.id}\n motif=\"dark\"\n $secondary\n href={nested.url}\n as=\"a\"\n rel=\"noopener noreferrer\"\n $active={item.id === expandedSectionItemId}\n >\n <S.SectionItemLabel motif={motif} $tertiary>\n {formatMessage(nested.label)}\n </S.SectionItemLabel>\n </S.SectionItem>\n ))}\n </Fragment>\n ))}\n </S.SectionItemsGroup>\n ))}\n\n {/* Header Links that don't exist in Desktop Footer */}\n {[...miscLinks].map((item, i) => (\n <S.SectionItemsGroup\n motif={motif}\n key={item.id}\n $active={item.id === expandedSectionItemId}\n $isSectionBegin={i === 0}\n >\n <S.SectionItem\n motif={motif}\n href={item.src}\n target={item?.target ?? \"self\"}\n rel={\"noopener noreferrer\"}\n as=\"a\"\n >\n <S.SectionItemLabel\n $active={item.id === expandedSectionItemId}\n motif={motif}\n >\n {item.label}\n </S.SectionItemLabel>\n </S.SectionItem>\n </S.SectionItemsGroup>\n ))}\n\n {normalizedFooterContent.map((item) => (\n <S.SectionItemsGroup\n motif={motif}\n key={item.id}\n $active={item.id === expandedSectionItemId}\n $isSectionEnd={item?.isSectionEnd}\n >\n <S.SectionItem\n $active={item.id === expandedSectionItemId}\n motif={motif}\n onClick={() =>\n item?.items && toggleExpandedSectionItemId(item.id)\n }\n >\n <S.SectionItemLabel\n $active={item.id === expandedSectionItemId}\n motif={motif}\n >\n {item.label}\n </S.SectionItemLabel>\n\n {item?.items && (\n <S.SectionItemArrowButton\n motif={motif}\n onClick={() => toggleExpandedSectionItemId(item.id)}\n >\n <S.ButtonIcon>\n <StyleableSvgImage\n src={icons.generic.collapseArrow}\n width={13}\n height={8}\n $active={item.id === expandedSectionItemId}\n />\n </S.ButtonIcon>\n </S.SectionItemArrowButton>\n )}\n </S.SectionItem>\n\n {item.id === expandedSectionItemId &&\n item?.items?.map((subItem) => (\n <S.SectionItem\n key={subItem.id}\n motif=\"dark\"\n $secondary\n href={subItem.src}\n rel={\"noopener noreferrer\"}\n as=\"a\"\n >\n <S.SectionItemLabel motif={motif}>\n {subItem.label}\n </S.SectionItemLabel>\n </S.SectionItem>\n ))}\n </S.SectionItemsGroup>\n ))}\n </S.Section>\n </S.InnerWrap>\n </S.Container>\n </S.Wrap>\n );\n};\n"],"names":["LIGHT_KEY","MobileLinksModal","menu","onMenuItemClick","onModalClose","language","useMicrositeMenu","formatMessage","useMicrositeMenuTranslations","footerContent","socialContent","miscLinks","useFooterContent","motif","expandedSectionItemId","setExpandedSectionItemId","useState","expandedSubSectionItemId","setExpandedSubSectionItemId","toggleExpandedSectionItemId","useCallback","itemId","toggleExpandedSubSectionItemId","prev","getPreparedMenu","useMemo","items","flatMap","item","id","MenuItemId","SiteMap","START_HERE_ID","Array","isArray","handleItemClick","event","length","stopPropagation","url","normalizeFooterSections","sections","Object","values","map","section","i","header","label","isSectionEnd","keys","normalizedFooterContent","social","S.Wrap","children","jsx","S.Container","size","noVerticalMargin","S.InnerWrap","jsxs","S.Section","S.SectionItemsGroup","$active","$isSectionEnd","$isSectionBegin","isSectionBegin","S.SectionItem","onClick","S.SectionItemLabel","S.SectionItemArrowButton","e","S.ButtonIcon","S.Chevron","src","icons.generic.collapseArrow","width","height","subItem","Fragment","$secondary","target","isExternalUrl","as","href","rel","preventDefault","isNew","S.Badge","$rotated","nested","$tertiary","StyleableSvgImage"],"mappings":";;;;;;;;;;;;;AAeA,MAAMA,SAAY,GAAA,OAAA;AAQX,MAAMC,mBAAmBA,CAAC;EAC/BC,IAAA;EACAC,eAAA;EACAC;AACF,CAAwB,KAAA;EAChB,MAAA;IAAEC;EAAS,CAAA,GAAIC,gBAAiB,CAAA,CAAA;EACtC,MAAM;IAAEC;EAAA,CAAkB,GAAAC,4BAAA,CAA6BH,QAAQ,CAAA;EAC/D,MAAM;IAAEI,aAAA;IAAeC,aAAe;IAAAC;EAAA,IAAcC,gBAAiB,CAAA,CAAA;EAErE,MAAMC,KAAe,GAAAb,SAAA;EAKrB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AA,eAAAC,GAAA,CAACc,gBAAE,EAAF;gBACCN,OAAA,EAASnC,KAAKC,EAAO,KAAAf,qBAAA;gBACrBD,KAAA;gBAECyC,QAAK,EAAA1B,IAAA,CAAAoB;cAAA,CACR,CAAA,EAECpB,MAAMF,KACL,IAAA,eAAA6B,GAAA,CAACe,sBAAE,EAAF;gBACCzD,KAAA;gBACAuD,OAAS,EAAAA,CAAA,KAAMjD,2BAA4B,CAAAS,IAAA,CAAKC,EAAE,CAAA;gBAElDyB,QAAA,iBAAAC,GAAA,CAACiB,UAAE,EAAF;kBACClB,QAAA,EAAA,eAAAC,GAAA,CAACqC,iBAAA,EAAA;oBACClB,GAAA,EAAKC,iCAAc;oBACnBC,KAAO,EAAA,EAAA;oBACPC,MAAQ,EAAA,CAAA;oBACRd,OAAA,EAASnC,KAAKC,EAAO,KAAAf;kBAAA,CAAA;gBAEzB,CAAA;cAAA,CAAA,CAAA;YACF,CAEJ,CAAA,EAECc,KAAKC,EAAO,KAAAf,qBAAA,IACXc,MAAMF,KAAO,EAAAkB,GAAA,CAAKkC,OAChB,mBAAAvB,GAAA,CAACY,WAAE,EAAF;cAECtD,KAAM,EAAA,MAAA;cACNmE,UAAU,EAAA,IAAA;cACVI,MAAMN,OAAQ,CAAAJ,GAAA;cACdW,GAAK,EAAA,qBAAA;cACLF,EAAG,EAAA,GAAA;cAEH7B,6BAACe,gBAAE,EAAF;gBAAmBxD,KAAA;gBACjByC,kBAAQN;cACX,CAAA;YAAA,CAAA,EATK8B,OAAQ,CAAAjD,EAWhB,CAAA,CAAA;UAAA,CAAA,EAjDED,IAAK,CAAAC,EAmDb,CAAA,CAAA;SACH;MAAA,CACF;IACF,CAAA;GACF,CAAA;AAEJ,CAAA;"}
|
|
@@ -5,8 +5,10 @@ export declare const Wrap: import("styled-components/dist/types").IStyledCompone
|
|
|
5
5
|
export declare const Container: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("../../Container/Container.types").ContainerProps & import("react").RefAttributes<HTMLDivElement>, never>> & string & Omit<import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("../../Container/Container.types").ContainerProps & import("react").RefAttributes<HTMLDivElement>>>, keyof import("react").Component<any, {}, any>>;
|
|
6
6
|
export declare const NewLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
7
7
|
export declare const ButtonIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
8
|
-
export declare const Chevron: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").
|
|
9
|
-
|
|
8
|
+
export declare const Chevron: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("../../StyleableSvgImage").StyleableSvgImageProps, {
|
|
9
|
+
$rotated?: boolean;
|
|
10
|
+
}>> & string & Omit<({ src, width, height, renderedHeight, className, $active, }: import("../../StyleableSvgImage").StyleableSvgImageProps) => JSX.Element, keyof import("react").Component<any, {}, any>>;
|
|
11
|
+
export declare const SectionItemArrowButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
10
12
|
motif: Motif;
|
|
11
13
|
}>> & string;
|
|
12
14
|
export declare const SectionItemImageWrap: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -14,19 +16,14 @@ export declare const SectionItemLabel: import("styled-components/dist/types").IS
|
|
|
14
16
|
motif: Motif;
|
|
15
17
|
$link?: boolean;
|
|
16
18
|
$active?: boolean;
|
|
19
|
+
$tertiary?: boolean;
|
|
17
20
|
}>> & string;
|
|
18
21
|
export declare const SectionItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
|
|
19
22
|
motif: Motif;
|
|
20
23
|
$secondary?: boolean;
|
|
21
24
|
$height?: number;
|
|
25
|
+
$active?: boolean;
|
|
22
26
|
}>> & string;
|
|
23
|
-
export declare const SectionItemLink: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "motif" | "$secondary" | "$height"> & {
|
|
24
|
-
motif: Motif;
|
|
25
|
-
$secondary?: boolean;
|
|
26
|
-
$height?: number;
|
|
27
|
-
}, "key" | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement> | "motif" | "$secondary" | "$height"> & {
|
|
28
|
-
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
29
|
-
}, never>> & string;
|
|
30
27
|
export declare const SectionItemsGroup: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
31
28
|
motif: Motif;
|
|
32
29
|
$active?: boolean;
|
|
@@ -49,8 +49,11 @@ const ButtonIcon = styled__default["default"].div`
|
|
|
49
49
|
`;
|
|
50
50
|
const Chevron = styled__default["default"](StyleableSvgImage.StyleableSvgImage)`
|
|
51
51
|
color: rgb(80 86 94 / 1);
|
|
52
|
+
transform: ${({
|
|
53
|
+
$rotated
|
|
54
|
+
}) => $rotated ? "rotate(180deg)" : "rotate(0deg)"};
|
|
52
55
|
`;
|
|
53
|
-
const SectionItemArrowButton = styled__default["default"].
|
|
56
|
+
const SectionItemArrowButton = styled__default["default"].div`
|
|
54
57
|
${resetButton};
|
|
55
58
|
|
|
56
59
|
height: 100%;
|
|
@@ -98,8 +101,15 @@ const SectionItemLabel = styled__default["default"].span`
|
|
|
98
101
|
}) => $active && `
|
|
99
102
|
color: ${theme.theme.colors.primaryBlue}
|
|
100
103
|
`}
|
|
104
|
+
|
|
105
|
+
${({
|
|
106
|
+
$tertiary
|
|
107
|
+
}) => $tertiary && styled.css`
|
|
108
|
+
margin-left: 30px;
|
|
109
|
+
`}
|
|
101
110
|
`;
|
|
102
111
|
const SectionItem = styled__default["default"].button`
|
|
112
|
+
padding: 0;
|
|
103
113
|
display: flex;
|
|
104
114
|
color: ${({
|
|
105
115
|
motif
|
|
@@ -111,7 +121,13 @@ const SectionItem = styled__default["default"].button`
|
|
|
111
121
|
}) => $height ?? SECTION_ITEM_HEIGHT}px;
|
|
112
122
|
outline: none;
|
|
113
123
|
border: none;
|
|
114
|
-
|
|
124
|
+
|
|
125
|
+
${({
|
|
126
|
+
$active
|
|
127
|
+
}) => $active ? `background-color: transparent;` : `
|
|
128
|
+
background: ${theme.theme.colors.desktopNeutral1};
|
|
129
|
+
`}
|
|
130
|
+
|
|
115
131
|
border-bottom: 1px solid ${theme.theme.colors.desktopNeutral3};
|
|
116
132
|
|
|
117
133
|
${({
|
|
@@ -126,7 +142,6 @@ const SectionItem = styled__default["default"].button`
|
|
|
126
142
|
}
|
|
127
143
|
`}
|
|
128
144
|
`;
|
|
129
|
-
const SectionItemLink = styled__default["default"](SectionItem)``;
|
|
130
145
|
const SectionItemsGroup = styled__default["default"].div`
|
|
131
146
|
display: flex;
|
|
132
147
|
flex-direction: column;
|
|
@@ -144,9 +159,16 @@ const SectionItemsGroup = styled__default["default"].div`
|
|
|
144
159
|
}
|
|
145
160
|
}
|
|
146
161
|
|
|
162
|
+
${({
|
|
163
|
+
$active
|
|
164
|
+
}) => $active ? `background-color: ${theme.theme.colors.desktopNeutral2};` : `
|
|
165
|
+
background: ${theme.theme.colors.desktopNeutral1};
|
|
166
|
+
`}
|
|
167
|
+
|
|
147
168
|
${({
|
|
148
169
|
$active
|
|
149
170
|
}) => $active && styled.css`
|
|
171
|
+
background-color: ${theme.theme.colors.desktopNeutral2};
|
|
150
172
|
${SectionItem} {
|
|
151
173
|
border-bottom: 1px solid ${theme.theme.colors.desktopNeutral3} !important;
|
|
152
174
|
|
|
@@ -221,7 +243,6 @@ exports.SectionItem = SectionItem;
|
|
|
221
243
|
exports.SectionItemArrowButton = SectionItemArrowButton;
|
|
222
244
|
exports.SectionItemImageWrap = SectionItemImageWrap;
|
|
223
245
|
exports.SectionItemLabel = SectionItemLabel;
|
|
224
|
-
exports.SectionItemLink = SectionItemLink;
|
|
225
246
|
exports.SectionItemsGroup = SectionItemsGroup;
|
|
226
247
|
exports.Wrap = Wrap;
|
|
227
248
|
//# sourceMappingURL=MobileMenu.styles.js.map
|