@ubnt/store.core 10.4.0-beta.2 → 10.4.0-beta.4
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/attention.svg +5 -5
- package/lib/assets/attention2.svg +5 -5
- package/lib/assets/express.jpg +0 -0
- package/lib/assets/express2.jpg +0 -0
- package/lib/assets/express7.jpg +0 -0
- package/lib/assets/express72.jpg +0 -0
- package/lib/assets/udmProMax.jpg +0 -0
- package/lib/assets/udmProMax2.jpg +0 -0
- package/lib/assets/udmProSpecial.jpg +0 -0
- package/lib/assets/udmProSpecial2.jpg +0 -0
- package/lib/assets/udr7.jpg +0 -0
- package/lib/assets/udr72.jpg +0 -0
- package/lib/components/CardSection/Card/Card.d.ts +1 -1
- package/lib/components/CardSection/Card/Card.js +3 -2
- package/lib/components/CardSection/Card/Card.js.map +1 -1
- package/lib/components/CardSection/Card/Card.mjs +3 -2
- package/lib/components/CardSection/Card/Card.mjs.map +1 -1
- package/lib/components/CardSection/Card/Card.types.d.ts +1 -0
- package/lib/components/CardSection/Card/Card.types.js.map +1 -1
- package/lib/components/CardSection/Card/Card.types.mjs.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.js +5 -0
- package/lib/components/Header/ProHeader/ProHeader.js.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.mjs +5 -0
- package/lib/components/Header/ProHeader/ProHeader.mjs.map +1 -1
- package/lib/components/ModelCompareV3/assets/CameraSecurity/ai-360.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/CameraSecurity/ai-dslr.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/CameraSecurity/ai-lpr.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/CameraSecurity/ai-pro.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/CameraSecurity/g4-instant.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/CameraSecurity/g5-bullet.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/CameraSecurity/g5-flex.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/CameraSecurity/g5-pro.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/CameraSecurity/g6-bullet.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/CameraSecurity/g6-instant.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/express.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/express.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/express7.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/express7.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/bigCompare/udmProSpecial.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProSpecial.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udr7.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udr7.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/express.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/Consoles/express.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/express7.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/Consoles/express7.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/assets/Consoles/udmProSpecial.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/Consoles/udmProSpecial.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/udr7.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/Consoles/udr7.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/data/CameraSecurity.js +21 -21
- package/lib/components/ModelCompareV3/data/CameraSecurity.mjs +11 -11
- package/lib/components/ModelCompareV3/data/CloudGateways.js +12 -12
- package/lib/components/ModelCompareV3/data/CloudGateways.mjs +8 -8
- package/lib/components/ModelCompareV3/data/products/express.js +1 -1
- package/lib/components/ModelCompareV3/data/products/express.mjs +1 -1
- package/lib/components/ModelCompareV3/data/products/express7.js +1 -1
- package/lib/components/ModelCompareV3/data/products/express7.mjs +1 -1
- package/lib/components/ModelCompareV3/data/products/udmProMax.js +1 -1
- package/lib/components/ModelCompareV3/data/products/udmProMax.mjs +1 -1
- package/lib/components/ModelCompareV3/data/products/udmProSpecial.js +1 -1
- package/lib/components/ModelCompareV3/data/products/udmProSpecial.mjs +1 -1
- package/lib/components/ModelCompareV3/data/products/udr7.js +1 -1
- package/lib/components/ModelCompareV3/data/products/udr7.mjs +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.mjs +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.mjs +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.mjs +2 -2
- package/lib/constants/proStoreCategories/mapping/index.js +1 -1
- package/lib/constants/proStoreCategories/mapping/index.js.map +1 -1
- package/lib/constants/proStoreCategories/mapping/index.mjs +1 -1
- package/lib/constants/proStoreCategories/mapping/index.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
|
+
### 10.4.0-beta.4
|
|
10
|
+
|
|
11
|
+
- [Feat] [NEP-4294](https://ubiquiti.atlassian.net/browse/NEP-4294) Close product line dropdown when a modal opens
|
|
12
|
+
|
|
13
|
+
### 10.4.0-beta.3
|
|
14
|
+
|
|
15
|
+
- [Feat] [NEP-4398](https://ubiquiti.atlassian.net/browse/NEP-4398) Add option to remove Learn More link from cards
|
|
16
|
+
|
|
9
17
|
### 10.4.0-beta.2
|
|
10
18
|
|
|
11
19
|
- [Feat] [NEP-4294](https://unifiprojects.atlassian.net/browse/NEP-4294) Revert 10.4.0-beta.1
|
package/lib/assets/attention.svg
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
<svg width="
|
|
2
|
-
<circle cx="
|
|
3
|
-
<path d="
|
|
4
|
-
<path d="
|
|
5
|
-
<circle cx="
|
|
1
|
+
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<circle cx="9" cy="9" r="9" fill="#F7D55E"/>
|
|
3
|
+
<path d="M9.73071 4.64062C9.40595 4.07813 8.59405 4.07812 8.26929 4.64062L4.37218 11.3906C4.04742 11.9531 4.45336 12.6562 5.10288 12.6562H12.8971C13.5466 12.6562 13.9526 11.9531 13.6278 11.3906L9.73071 4.64062Z" stroke="white" stroke-width="0.5625"/>
|
|
4
|
+
<path d="M9.22274 9.12833L9.48295 7.30685C9.52494 7.01295 9.29688 6.75 9 6.75C8.70312 6.75 8.47506 7.01295 8.51705 7.30685L8.77726 9.12833C8.81406 9.3859 9.18594 9.3859 9.22274 9.12833Z" fill="white"/>
|
|
5
|
+
<circle cx="9" cy="10.6875" r="0.5625" fill="#F7D55E"/>
|
|
6
6
|
</svg>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
<svg width="
|
|
2
|
-
<circle cx="
|
|
3
|
-
<path d="
|
|
4
|
-
<path d="
|
|
5
|
-
<circle cx="
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<circle cx="8" cy="8" r="8" fill="#A4A7B5"/>
|
|
3
|
+
<path d="M12.1136 10.125L8.64952 4.125C8.36084 3.625 7.63916 3.625 7.35048 4.125L3.88638 10.125C3.5977 10.625 3.95855 11.25 4.5359 11.25H11.4641C12.0415 11.25 12.4023 10.625 12.1136 10.125Z" stroke="white" stroke-width="0.5"/>
|
|
4
|
+
<path d="M8.19799 8.11407L8.42929 6.49497C8.46661 6.23373 8.2639 6 8 6C7.7361 6 7.53339 6.23373 7.57071 6.49497L7.80201 8.11407C7.83472 8.34302 8.16528 8.34303 8.19799 8.11407Z" fill="white"/>
|
|
5
|
+
<circle cx="8" cy="9.5" r="0.5" fill="white"/>
|
|
6
6
|
</svg>
|
package/lib/assets/express.jpg
CHANGED
|
Binary file
|
package/lib/assets/express2.jpg
CHANGED
|
Binary file
|
package/lib/assets/express7.jpg
CHANGED
|
Binary file
|
package/lib/assets/express72.jpg
CHANGED
|
Binary file
|
package/lib/assets/udmProMax.jpg
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/assets/udr7.jpg
CHANGED
|
Binary file
|
package/lib/assets/udr72.jpg
CHANGED
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type CardProps } from "./Card.types";
|
|
2
|
-
export declare const Card: ({ motif, title, subtitle, titleLarge, learnMoreHref, videoSrc, videoPoster, backgroundImageUrl, backgroundColor, border, labels, onLinkClick, beforeFollowLink, link, className, }: CardProps) => JSX.Element;
|
|
2
|
+
export declare const Card: ({ motif, title, subtitle, titleLarge, learnMoreHref, videoSrc, videoPoster, backgroundImageUrl, backgroundColor, border, labels, onLinkClick, beforeFollowLink, link, className, hideLearnMoreLink, }: CardProps) => JSX.Element;
|
|
@@ -32,7 +32,8 @@ const Card = ({
|
|
|
32
32
|
onLinkClick,
|
|
33
33
|
beforeFollowLink,
|
|
34
34
|
link,
|
|
35
|
-
className
|
|
35
|
+
className,
|
|
36
|
+
hideLearnMoreLink
|
|
36
37
|
}) => {
|
|
37
38
|
const {
|
|
38
39
|
languageDirection
|
|
@@ -133,7 +134,7 @@ const Card = ({
|
|
|
133
134
|
}), titleLarge && /* @__PURE__ */jsxRuntime.jsx(Card_styles.TitleLarge, {
|
|
134
135
|
$motif: motif,
|
|
135
136
|
children: titleLarge
|
|
136
|
-
}), /* @__PURE__ */jsxRuntime.jsx(LearnMoreLink.LearnMoreLink, {
|
|
137
|
+
}), !hideLearnMoreLink && /* @__PURE__ */jsxRuntime.jsx(LearnMoreLink.LearnMoreLink, {
|
|
137
138
|
...link
|
|
138
139
|
})]
|
|
139
140
|
}), videoSrc && /* @__PURE__ */jsxRuntime.jsx(ReverseLoopingVideo.ReverseLoopingVideo, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.js","sources":["../../../../src/components/CardSection/Card/Card.tsx"],"sourcesContent":["import { useCallback, useMemo, useState } from \"react\";\n\nimport { useMenu } from \"../../../contexts/MenuContext\";\nimport { Language } from \"../../../contexts/MenuContext/mapping\";\nimport { useTranslation } from \"../../../hooks\";\nimport { LearnMoreLink } from \"../../LearnMoreLink\";\nimport { ReverseLoopingVideo } from \"../../ReverseLoopingVideo\";\nimport {\n CardWrapper,\n ContentWrap,\n Label,\n LabelWrap,\n Subtitle,\n Title,\n TitleLarge,\n} from \"./Card.styles\";\nimport { type CardProps, presetLabelMap } from \"./Card.types\";\nimport { en as EN_TRANSLATION } from \"./translations\";\n\nexport const Card = ({\n motif,\n title,\n subtitle,\n titleLarge,\n learnMoreHref,\n videoSrc,\n videoPoster,\n backgroundImageUrl,\n backgroundColor,\n border,\n labels,\n onLinkClick,\n beforeFollowLink,\n link,\n className,\n}: CardProps) => {\n const { languageDirection } = useMenu();\n const { formatMessage } = useTranslation({\n defaultTranslation: EN_TRANSLATION,\n additionalTranslations: {\n [Language.Ja]: () =>\n import(\"./translations/ja.json\").then((res) => res.default),\n [Language.Ar]: () =>\n import(\"./translations/ar.json\").then((res) => res.default),\n [Language.De]: () =>\n import(\"./translations/de.json\").then((res) => res.default),\n [Language.Es]: () =>\n import(\"./translations/es.json\").then((res) => res.default),\n [Language.El]: () =>\n import(\"./translations/el.json\").then((res) => res.default),\n [Language.It]: () =>\n import(\"./translations/it.json\").then((res) => res.default),\n [Language.Pt]: () =>\n import(\"./translations/pt-BR.json\").then((res) => res.default),\n [Language.Zh]: () =>\n import(\"./translations/zh-Hans.json\").then((res) => res.default),\n [Language.Fr]: () =>\n import(\"./translations/fr.json\").then((res) => res.default),\n [Language.Tw]: () =>\n import(\"./translations/zh-Hant-TW.json\").then((res) => res.default),\n },\n });\n\n // #############################################################################\n // Labels\n // #############################################################################\n\n const labelEls = useMemo(() => {\n if (!labels) {\n return null;\n }\n\n return labels.map((label, i) => {\n if (typeof label === \"string\") {\n const presetLabel = presetLabelMap[label];\n\n if (presetLabel) {\n return (\n <Label\n key={i}\n $color={presetLabel.color}\n $fontWeight={presetLabel?.[\"fontWeight\"]}\n >\n {formatMessage(presetLabel.text)}\n </Label>\n );\n }\n\n return null;\n } else {\n return (\n <Label key={i} $color={label.color} $fontWeight={label.fontWeight}>\n {label.text}\n </Label>\n );\n }\n });\n }, [labels, formatMessage]);\n\n // #############################################################################\n // Video\n // #############################################################################\n const [playing, setPlaying] = useState(false);\n\n const onMouseEnter = useCallback(() => {\n setPlaying(true);\n }, []);\n\n const onMouseLeave = useCallback(() => {\n setPlaying(false);\n }, []);\n\n // #############################################################################\n // Event\n // #############################################################################\n const handleCardClick = useCallback(\n (e) => {\n beforeFollowLink?.(learnMoreHref);\n onLinkClick?.(e, learnMoreHref);\n },\n [beforeFollowLink, learnMoreHref, onLinkClick],\n );\n\n // #############################################################################\n // Render\n // #############################################################################\n return (\n <CardWrapper\n as=\"a\"\n onClick={handleCardClick}\n href={learnMoreHref}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n $backgroundColor={backgroundColor}\n $backgroundImageUrl={backgroundImageUrl}\n $border={border}\n dir={languageDirection}\n /**\n * Disable \"draggable\" to prevent image dragging on Firefox\n * @see https://ui.slack.com/archives/C017MM5HW1F/p1739876555750939\n * @see https://stackoverflow.com/questions/38907225/disable-drag-for-any-object-in-firefox-addon-popup\n */\n draggable={false}\n className={className}\n >\n <ContentWrap>\n <LabelWrap>{labelEls}</LabelWrap>\n\n <Title $motif={motif}>{title}</Title>\n {subtitle && <Subtitle $motif={motif}>{subtitle}</Subtitle>}\n {titleLarge && <TitleLarge $motif={motif}>{titleLarge}</TitleLarge>}\n <LearnMoreLink {...link} />\n </ContentWrap>\n\n {videoSrc && (\n <ReverseLoopingVideo\n src={videoSrc}\n poster={videoPoster}\n playing={playing}\n />\n )}\n </CardWrapper>\n );\n};\n"],"names":["Card","motif","title","subtitle","titleLarge","learnMoreHref","videoSrc","videoPoster","backgroundImageUrl","backgroundColor","border","labels","onLinkClick","beforeFollowLink","link","className","languageDirection","useMenu","formatMessage","useTranslation","defaultTranslation","EN_TRANSLATION","additionalTranslations","Language","Ja","Promise","then","res","default","Ar","De","Es","El","It","Pt","Zh","Fr","Tw","resolve","require","labelEls","useMemo","map","label","i","presetLabel","presetLabelMap","jsx","Label","$color","color","$fontWeight","children","text","fontWeight","playing","setPlaying","useState","onMouseEnter","useCallback","onMouseLeave","handleCardClick","e","jsxs","CardWrapper","as","onClick","href","$backgroundColor","$backgroundImageUrl","$border","dir","draggable","ContentWrap","LabelWrap","Title","$motif","Subtitle","TitleLarge","LearnMoreLink","ReverseLoopingVideo","src","poster"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBO,MAAMA,OAAOA,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SAAW,EAAA,KAAA;IACXzD,SAAA;IAEAqC,QAAA,EAAA,CAAA,eAAAW,eAAA,CAACU,WAAAA,CAAAA,WACC,EAAA;MAAArB,QAAA,EAAA,CAAAL,eAAAA,UAAAA,CAAAA,GAAA,CAAC2B;QAAWtB,QAAS,EAAAZ;MAAA,CAAA,CAAA,EAAA,eAEpBO,UAAA,CAAAA,GAAA,CAAA4B,WAAA,CAAAA,KAAA,EAAA;QAAMC,MAAQ,EAAA3E,KAAA;QAAQmD,QAAM,EAAAlD;OAAA,CAAA,EAC5BC,QAAY,IAAA,eAAA4C,UAAA,CAAAA,GAAA,CAAC8B,oBAAS,EAAA;QAAAD,MAAA,EAAQ3E;QAAQmD,QAAS,EAAAjD;OAAA,CAAA,EAC/CC,UAAc,IAAA,eAAA2C,UAAA,CAAAA,GAAA,CAAC+B,sBAAW,EAAA;QAAAF,MAAA,EAAQ3E;QAAQmD,QAAW,EAAAhD;OAAA,CAAA,EAAA,eACtD2C,cAAA,CAACgC,aAAAA,CAAAA,aAAe,EAAA;QAAA,GAAGjE;MAAM,CAAA,CAAA;KAC3B,CAAA,EAECR,QACC,mBAAAyC,UAAA,CAAAA,GAAA,CAACiC,mBAAA,CAAAA,mBAAA,EAAA;MACCC,GAAK,EAAA3E,QAAA;MACL4E,MAAQ,EAAA3E,WAAA;MACRgD;IAAA,CAAA,CAAA;EACF,CAEJ,CAAA;AAEJ,CAAA;"}
|
|
1
|
+
{"version":3,"file":"Card.js","sources":["../../../../src/components/CardSection/Card/Card.tsx"],"sourcesContent":["import { useCallback, useMemo, useState } from \"react\";\n\nimport { useMenu } from \"../../../contexts/MenuContext\";\nimport { Language } from \"../../../contexts/MenuContext/mapping\";\nimport { useTranslation } from \"../../../hooks\";\nimport { LearnMoreLink } from \"../../LearnMoreLink\";\nimport { ReverseLoopingVideo } from \"../../ReverseLoopingVideo\";\nimport {\n CardWrapper,\n ContentWrap,\n Label,\n LabelWrap,\n Subtitle,\n Title,\n TitleLarge,\n} from \"./Card.styles\";\nimport { type CardProps, presetLabelMap } from \"./Card.types\";\nimport { en as EN_TRANSLATION } from \"./translations\";\n\nexport const Card = ({\n motif,\n title,\n subtitle,\n titleLarge,\n learnMoreHref,\n videoSrc,\n videoPoster,\n backgroundImageUrl,\n backgroundColor,\n border,\n labels,\n onLinkClick,\n beforeFollowLink,\n link,\n className,\n hideLearnMoreLink,\n}: CardProps) => {\n const { languageDirection } = useMenu();\n const { formatMessage } = useTranslation({\n defaultTranslation: EN_TRANSLATION,\n additionalTranslations: {\n [Language.Ja]: () =>\n import(\"./translations/ja.json\").then((res) => res.default),\n [Language.Ar]: () =>\n import(\"./translations/ar.json\").then((res) => res.default),\n [Language.De]: () =>\n import(\"./translations/de.json\").then((res) => res.default),\n [Language.Es]: () =>\n import(\"./translations/es.json\").then((res) => res.default),\n [Language.El]: () =>\n import(\"./translations/el.json\").then((res) => res.default),\n [Language.It]: () =>\n import(\"./translations/it.json\").then((res) => res.default),\n [Language.Pt]: () =>\n import(\"./translations/pt-BR.json\").then((res) => res.default),\n [Language.Zh]: () =>\n import(\"./translations/zh-Hans.json\").then((res) => res.default),\n [Language.Fr]: () =>\n import(\"./translations/fr.json\").then((res) => res.default),\n [Language.Tw]: () =>\n import(\"./translations/zh-Hant-TW.json\").then((res) => res.default),\n },\n });\n\n // #############################################################################\n // Labels\n // #############################################################################\n\n const labelEls = useMemo(() => {\n if (!labels) {\n return null;\n }\n\n return labels.map((label, i) => {\n if (typeof label === \"string\") {\n const presetLabel = presetLabelMap[label];\n\n if (presetLabel) {\n return (\n <Label\n key={i}\n $color={presetLabel.color}\n $fontWeight={presetLabel?.[\"fontWeight\"]}\n >\n {formatMessage(presetLabel.text)}\n </Label>\n );\n }\n\n return null;\n } else {\n return (\n <Label key={i} $color={label.color} $fontWeight={label.fontWeight}>\n {label.text}\n </Label>\n );\n }\n });\n }, [labels, formatMessage]);\n\n // #############################################################################\n // Video\n // #############################################################################\n const [playing, setPlaying] = useState(false);\n\n const onMouseEnter = useCallback(() => {\n setPlaying(true);\n }, []);\n\n const onMouseLeave = useCallback(() => {\n setPlaying(false);\n }, []);\n\n // #############################################################################\n // Event\n // #############################################################################\n const handleCardClick = useCallback(\n (e) => {\n beforeFollowLink?.(learnMoreHref);\n onLinkClick?.(e, learnMoreHref);\n },\n [beforeFollowLink, learnMoreHref, onLinkClick],\n );\n\n // #############################################################################\n // Render\n // #############################################################################\n return (\n <CardWrapper\n as=\"a\"\n onClick={handleCardClick}\n href={learnMoreHref}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n $backgroundColor={backgroundColor}\n $backgroundImageUrl={backgroundImageUrl}\n $border={border}\n dir={languageDirection}\n /**\n * Disable \"draggable\" to prevent image dragging on Firefox\n * @see https://ui.slack.com/archives/C017MM5HW1F/p1739876555750939\n * @see https://stackoverflow.com/questions/38907225/disable-drag-for-any-object-in-firefox-addon-popup\n */\n draggable={false}\n className={className}\n >\n <ContentWrap>\n <LabelWrap>{labelEls}</LabelWrap>\n\n <Title $motif={motif}>{title}</Title>\n {subtitle && <Subtitle $motif={motif}>{subtitle}</Subtitle>}\n {titleLarge && <TitleLarge $motif={motif}>{titleLarge}</TitleLarge>}\n {!hideLearnMoreLink && <LearnMoreLink {...link} />}\n </ContentWrap>\n\n {videoSrc && (\n <ReverseLoopingVideo\n src={videoSrc}\n poster={videoPoster}\n playing={playing}\n />\n )}\n </CardWrapper>\n );\n};\n"],"names":["Card","motif","title","subtitle","titleLarge","learnMoreHref","videoSrc","videoPoster","backgroundImageUrl","backgroundColor","border","labels","onLinkClick","beforeFollowLink","link","className","hideLearnMoreLink","languageDirection","useMenu","formatMessage","useTranslation","defaultTranslation","EN_TRANSLATION","additionalTranslations","Language","Ja","Promise","then","res","default","Ar","De","Es","El","It","Pt","Zh","Fr","Tw","resolve","require","labelEls","useMemo","map","label","i","presetLabel","presetLabelMap","jsx","Label","$color","color","$fontWeight","children","text","fontWeight","playing","setPlaying","useState","onMouseEnter","useCallback","onMouseLeave","handleCardClick","e","jsxs","CardWrapper","as","onClick","href","$backgroundColor","$backgroundImageUrl","$border","dir","draggable","ContentWrap","LabelWrap","Title","$motif","Subtitle","TitleLarge","LearnMoreLink","ReverseLoopingVideo","src","poster"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBO,MAAMA,OAAOA,CAAC;EACnBC,KAAA;EACAC,KAAA;EACAC,QAAA;EACAC,UAAA;EACAC,aAAA;EACAC,QAAA;EACAC,WAAA;EACAC,kBAAA;EACAC,eAAA;EACAC,MAAA;EACAC,MAAA;EACAC,WAAA;EACAC,gBAAA;EACAC,IAAA;EACAC,SAAA;EACAC;AACF,CAAiB,KAAA;EACT,MAAA;IAAEC;EAAkB,CAAA,GAAIC,eAAQ,CAAA,CAAA;EAChC,MAAA;IAAEC;EAAc,CAAA,GAAIC,6BAAe,CAAA;IACvCC,kBAAoB,EAAAC,EAAA,CAAA,SAAA,CAAA;IACpBC,sBAAwB,EAAA;MACtB,CAACC,SAAA,CAAAA,QAAA,CAASC,EAAE,GAAG,MACbC;uBAAO,2BAAwB,CAAA;MAAA,CAAA,CAAA,CAAEC,IAAK,CAACC,GAAQ,IAAAA,GAAA,CAAIC,OAAO,CAAA;MAC5D,CAACL,SAAA,CAAAA,QAAA,CAASM,EAAE,GAAG,MACbJ;uBAAO,2BAAwB,CAAA;MAAA,CAAA,CAAA,CAAEC,IAAK,CAACC,GAAQ,IAAAA,GAAA,CAAIC,OAAO,CAAA;MAC5D,CAACL,SAAA,CAAAA,QAAA,CAASO,EAAE,GAAG,MACbL;uBAAO,2BAAwB,CAAA;MAAA,CAAA,CAAA,CAAEC,IAAK,CAACC,GAAQ,IAAAA,GAAA,CAAIC,OAAO,CAAA;MAC5D,CAACL,SAAA,CAAAA,QAAA,CAASQ,EAAE,GAAG,MACbN;uBAAO,2BAAwB,CAAA;MAAA,CAAA,CAAA,CAAEC,IAAK,CAACC,GAAQ,IAAAA,GAAA,CAAIC,OAAO,CAAA;MAC5D,CAACL,SAAA,C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|
+
className,
|
|
34
|
+
hideLearnMoreLink
|
|
34
35
|
}) => {
|
|
35
36
|
const {
|
|
36
37
|
languageDirection
|
|
@@ -111,7 +112,7 @@ const Card = ({
|
|
|
111
112
|
}), titleLarge && /* @__PURE__ */jsx(TitleLarge, {
|
|
112
113
|
$motif: motif,
|
|
113
114
|
children: titleLarge
|
|
114
|
-
}), /* @__PURE__ */jsx(LearnMoreLink, {
|
|
115
|
+
}), !hideLearnMoreLink && /* @__PURE__ */jsx(LearnMoreLink, {
|
|
115
116
|
...link
|
|
116
117
|
})]
|
|
117
118
|
}), videoSrc && /* @__PURE__ */jsx(ReverseLoopingVideo, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.mjs","sources":["../../../../src/components/CardSection/Card/Card.tsx"],"sourcesContent":["import { useCallback, useMemo, useState } from \"react\";\n\nimport { useMenu } from \"../../../contexts/MenuContext\";\nimport { Language } from \"../../../contexts/MenuContext/mapping\";\nimport { useTranslation } from \"../../../hooks\";\nimport { LearnMoreLink } from \"../../LearnMoreLink\";\nimport { ReverseLoopingVideo } from \"../../ReverseLoopingVideo\";\nimport {\n CardWrapper,\n ContentWrap,\n Label,\n LabelWrap,\n Subtitle,\n Title,\n TitleLarge,\n} from \"./Card.styles\";\nimport { type CardProps, presetLabelMap } from \"./Card.types\";\nimport { en as EN_TRANSLATION } from \"./translations\";\n\nexport const Card = ({\n motif,\n title,\n subtitle,\n titleLarge,\n learnMoreHref,\n videoSrc,\n videoPoster,\n backgroundImageUrl,\n backgroundColor,\n border,\n labels,\n onLinkClick,\n beforeFollowLink,\n link,\n className,\n}: CardProps) => {\n const { languageDirection } = useMenu();\n const { formatMessage } = useTranslation({\n defaultTranslation: EN_TRANSLATION,\n additionalTranslations: {\n [Language.Ja]: () =>\n import(\"./translations/ja.json\").then((res) => res.default),\n [Language.Ar]: () =>\n import(\"./translations/ar.json\").then((res) => res.default),\n [Language.De]: () =>\n import(\"./translations/de.json\").then((res) => res.default),\n [Language.Es]: () =>\n import(\"./translations/es.json\").then((res) => res.default),\n [Language.El]: () =>\n import(\"./translations/el.json\").then((res) => res.default),\n [Language.It]: () =>\n import(\"./translations/it.json\").then((res) => res.default),\n [Language.Pt]: () =>\n import(\"./translations/pt-BR.json\").then((res) => res.default),\n [Language.Zh]: () =>\n import(\"./translations/zh-Hans.json\").then((res) => res.default),\n [Language.Fr]: () =>\n import(\"./translations/fr.json\").then((res) => res.default),\n [Language.Tw]: () =>\n import(\"./translations/zh-Hant-TW.json\").then((res) => res.default),\n },\n });\n\n // #############################################################################\n // Labels\n // #############################################################################\n\n const labelEls = useMemo(() => {\n if (!labels) {\n return null;\n }\n\n return labels.map((label, i) => {\n if (typeof label === \"string\") {\n const presetLabel = presetLabelMap[label];\n\n if (presetLabel) {\n return (\n <Label\n key={i}\n $color={presetLabel.color}\n $fontWeight={presetLabel?.[\"fontWeight\"]}\n >\n {formatMessage(presetLabel.text)}\n </Label>\n );\n }\n\n return null;\n } else {\n return (\n <Label key={i} $color={label.color} $fontWeight={label.fontWeight}>\n {label.text}\n </Label>\n );\n }\n });\n }, [labels, formatMessage]);\n\n // #############################################################################\n // Video\n // #############################################################################\n const [playing, setPlaying] = useState(false);\n\n const onMouseEnter = useCallback(() => {\n setPlaying(true);\n }, []);\n\n const onMouseLeave = useCallback(() => {\n setPlaying(false);\n }, []);\n\n // #############################################################################\n // Event\n // #############################################################################\n const handleCardClick = useCallback(\n (e) => {\n beforeFollowLink?.(learnMoreHref);\n onLinkClick?.(e, learnMoreHref);\n },\n [beforeFollowLink, learnMoreHref, onLinkClick],\n );\n\n // #############################################################################\n // Render\n // #############################################################################\n return (\n <CardWrapper\n as=\"a\"\n onClick={handleCardClick}\n href={learnMoreHref}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n $backgroundColor={backgroundColor}\n $backgroundImageUrl={backgroundImageUrl}\n $border={border}\n dir={languageDirection}\n /**\n * Disable \"draggable\" to prevent image dragging on Firefox\n * @see https://ui.slack.com/archives/C017MM5HW1F/p1739876555750939\n * @see https://stackoverflow.com/questions/38907225/disable-drag-for-any-object-in-firefox-addon-popup\n */\n draggable={false}\n className={className}\n >\n <ContentWrap>\n <LabelWrap>{labelEls}</LabelWrap>\n\n <Title $motif={motif}>{title}</Title>\n {subtitle && <Subtitle $motif={motif}>{subtitle}</Subtitle>}\n {titleLarge && <TitleLarge $motif={motif}>{titleLarge}</TitleLarge>}\n <LearnMoreLink {...link}
|
|
1
|
+
{"version":3,"file":"Card.mjs","sources":["../../../../src/components/CardSection/Card/Card.tsx"],"sourcesContent":["import { useCallback, useMemo, useState } from \"react\";\n\nimport { useMenu } from \"../../../contexts/MenuContext\";\nimport { Language } from \"../../../contexts/MenuContext/mapping\";\nimport { useTranslation } from \"../../../hooks\";\nimport { LearnMoreLink } from \"../../LearnMoreLink\";\nimport { ReverseLoopingVideo } from \"../../ReverseLoopingVideo\";\nimport {\n CardWrapper,\n ContentWrap,\n Label,\n LabelWrap,\n Subtitle,\n Title,\n TitleLarge,\n} from \"./Card.styles\";\nimport { type CardProps, presetLabelMap } from \"./Card.types\";\nimport { en as EN_TRANSLATION } from \"./translations\";\n\nexport const Card = ({\n motif,\n title,\n subtitle,\n titleLarge,\n learnMoreHref,\n videoSrc,\n videoPoster,\n backgroundImageUrl,\n backgroundColor,\n border,\n labels,\n onLinkClick,\n beforeFollowLink,\n link,\n className,\n hideLearnMoreLink,\n}: CardProps) => {\n const { languageDirection } = useMenu();\n const { formatMessage } = useTranslation({\n defaultTranslation: EN_TRANSLATION,\n additionalTranslations: {\n [Language.Ja]: () =>\n import(\"./translations/ja.json\").then((res) => res.default),\n [Language.Ar]: () =>\n import(\"./translations/ar.json\").then((res) => res.default),\n [Language.De]: () =>\n import(\"./translations/de.json\").then((res) => res.default),\n [Language.Es]: () =>\n import(\"./translations/es.json\").then((res) => res.default),\n [Language.El]: () =>\n import(\"./translations/el.json\").then((res) => res.default),\n [Language.It]: () =>\n import(\"./translations/it.json\").then((res) => res.default),\n [Language.Pt]: () =>\n import(\"./translations/pt-BR.json\").then((res) => res.default),\n [Language.Zh]: () =>\n import(\"./translations/zh-Hans.json\").then((res) => res.default),\n [Language.Fr]: () =>\n import(\"./translations/fr.json\").then((res) => res.default),\n [Language.Tw]: () =>\n import(\"./translations/zh-Hant-TW.json\").then((res) => res.default),\n },\n });\n\n // #############################################################################\n // Labels\n // #############################################################################\n\n const labelEls = useMemo(() => {\n if (!labels) {\n return null;\n }\n\n return labels.map((label, i) => {\n if (typeof label === \"string\") {\n const presetLabel = presetLabelMap[label];\n\n if (presetLabel) {\n return (\n <Label\n key={i}\n $color={presetLabel.color}\n $fontWeight={presetLabel?.[\"fontWeight\"]}\n >\n {formatMessage(presetLabel.text)}\n </Label>\n );\n }\n\n return null;\n } else {\n return (\n <Label key={i} $color={label.color} $fontWeight={label.fontWeight}>\n {label.text}\n </Label>\n );\n }\n });\n }, [labels, formatMessage]);\n\n // #############################################################################\n // Video\n // #############################################################################\n const [playing, setPlaying] = useState(false);\n\n const onMouseEnter = useCallback(() => {\n setPlaying(true);\n }, []);\n\n const onMouseLeave = useCallback(() => {\n setPlaying(false);\n }, []);\n\n // #############################################################################\n // Event\n // #############################################################################\n const handleCardClick = useCallback(\n (e) => {\n beforeFollowLink?.(learnMoreHref);\n onLinkClick?.(e, learnMoreHref);\n },\n [beforeFollowLink, learnMoreHref, onLinkClick],\n );\n\n // #############################################################################\n // Render\n // #############################################################################\n return (\n <CardWrapper\n as=\"a\"\n onClick={handleCardClick}\n href={learnMoreHref}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n $backgroundColor={backgroundColor}\n $backgroundImageUrl={backgroundImageUrl}\n $border={border}\n dir={languageDirection}\n /**\n * Disable \"draggable\" to prevent image dragging on Firefox\n * @see https://ui.slack.com/archives/C017MM5HW1F/p1739876555750939\n * @see https://stackoverflow.com/questions/38907225/disable-drag-for-any-object-in-firefox-addon-popup\n */\n draggable={false}\n className={className}\n >\n <ContentWrap>\n <LabelWrap>{labelEls}</LabelWrap>\n\n <Title $motif={motif}>{title}</Title>\n {subtitle && <Subtitle $motif={motif}>{subtitle}</Subtitle>}\n {titleLarge && <TitleLarge $motif={motif}>{titleLarge}</TitleLarge>}\n {!hideLearnMoreLink && <LearnMoreLink {...link} />}\n </ContentWrap>\n\n {videoSrc && (\n <ReverseLoopingVideo\n src={videoSrc}\n poster={videoPoster}\n playing={playing}\n />\n )}\n </CardWrapper>\n );\n};\n"],"names":["Card","motif","title","subtitle","titleLarge","learnMoreHref","videoSrc","videoPoster","backgroundImageUrl","backgroundColor","border","labels","onLinkClick","beforeFollowLink","link","className","hideLearnMoreLink","languageDirection","useMenu","formatMessage","useTranslation","defaultTranslation","EN_TRANSLATION","additionalTranslations","Language","Ja","then","res","default","Ar","De","Es","El","It","Pt","Zh","Fr","Tw","labelEls","useMemo","map","label","i","presetLabel","presetLabelMap","jsx","Label","$color","color","$fontWeight","children","text","fontWeight","playing","setPlaying","useState","onMouseEnter","useCallback","onMouseLeave","handleCardClick","e","jsxs","CardWrapper","as","onClick","href","$backgroundColor","$backgroundImageUrl","$border","dir","draggable","ContentWrap","LabelWrap","Title","$motif","Subtitle","TitleLarge","LearnMoreLink","ReverseLoopingVideo","src","poster"],"mappings":";;;;;;;;;;;;;;;;;AAmBO,MAAMA,OAAOA,CAAC;EACnBC,KAAA;EACAC,KAAA;EACAC,QAAA;EACAC,UAAA;EACAC,aAAA;EACAC,QAAA;EACAC,WAAA;EACAC,kBAAA;EACAC,eAAA;EACAC,MAAA;EACAC,MAAA;EACAC,WAAA;EACAC,gBAAA;EACAC,IAAA;EACAC,SAAA;EACAC;AACF,CAAiB,KAAA;EACT,MAAA;IAAEC;EAAkB,CAAA,GAAIC,OAAQ,CAAA,CAAA;EAChC,MAAA;IAAEC;EAAc,CAAA,GAAIC,cAAe,CAAA;IACvCC,kBAAoB,EAAAC,cAAA;IACpBC,sBAAwB,EAAA;MACtB,CAACC,QAAA,CAASC,EAAE,GAA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A;EAME,sBAAAiD,IAAA,CAACC,WAAA,EAAA;IACCC,EAAG,EAAA,GAAA;IACHC,OAAS,EAAAL,eAAA;IACTM,IAAM,EAAA5D,aAAA;IACNmD,YAAA;IACAE,YAAA;IACAQ,gBAAkB,EAAAzD,eAAA;IAClB0D,mBAAqB,EAAA3D,kBAAA;IACrB4D,OAAS,EAAA1D,MAAA;IACT2D,GAAK,EAAApD,iBAAA;IAMLqD,SAAW,EAAA,KAAA;IACXvD,SAAA;IAEAmC,QAAA,EAAA,CAAA,eAAAW,IAAA,CAACU,WACC,EAAA;MAAArB,QAAA,EAAA,CAAA,eAAAL,GAAA,CAAC2B;QAAWtB,QAAS,EAAAZ;MAAA,CAAA,CAAA,EAAA,eAEpBO,GAAA,CAAA4B,KAAA,EAAA;QAAMC,MAAQ,EAAAzE,KAAA;QAAQiD,QAAM,EAAAhD;OAAA,CAAA,EAC5BC,QAAY,IAAA,eAAA0C,GAAA,CAAC8B,QAAS,EAAA;QAAAD,MAAA,EAAQzE;QAAQiD,QAAS,EAAA/C;OAAA,CAAA,EAC/CC,UAAc,IAAA,eAAAyC,GAAA,CAAC+B,UAAW,EAAA;QAAAF,MAAA,EAAQzE;QAAQiD,QAAW,EAAA9C;OAAA,CAAA,EACrD,CAACY,iBAAA,IAAA,eAAsB6B,GAAA,CAAAgC,aAAA,EAAA;QAAe,GAAG/D;MAAM,CAAA,CAAA;KAClD,CAAA,EAECR,QACC,mBAAAuC,GAAA,CAACiC,mBAAA,EAAA;MACCC,GAAK,EAAAzE,QAAA;MACL0E,MAAQ,EAAAzE,WAAA;MACR8C;IAAA,CAAA,CAAA;EACF,CAEJ,CAAA;AAEJ,CAAA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.types.js","sources":["../../../../src/components/CardSection/Card/Card.types.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\n\nimport { theme } from \"../../../constants/theme\";\nimport type { LearnMoreLinkProps } from \"../../LearnMoreLink\";\nimport type EN_TRANSLATION from \"./translations/en.json\";\n\ntype Label = {\n color: string;\n text: string;\n fontWeight?: string;\n};\n\ntype PresetLabel = Label & {\n text: keyof typeof EN_TRANSLATION;\n};\n\nexport const presetLabelMap: {\n new: PresetLabel;\n bestseller: PresetLabel;\n unifi6: PresetLabel;\n theOriginal: PresetLabel;\n indoorOutdoor: PresetLabel;\n compact: PresetLabel;\n} = {\n new: {\n text: \"New\",\n color: theme.colors.buttercup,\n },\n bestseller: {\n text: \"Bestseller\",\n color: theme.colors.buttercup,\n },\n unifi6: {\n text: \"UniFi 6\",\n color: theme.colors.vulcan,\n fontWeight: theme.fontWeight.bold,\n },\n theOriginal: {\n text: \"The Original\",\n color: theme.colors.vulcan,\n fontWeight: theme.fontWeight.bold,\n },\n indoorOutdoor: {\n text: \"Indoor / Outdoor\",\n color: theme.colors.vulcan,\n fontWeight: theme.fontWeight.bold,\n },\n compact: {\n text: \"Compact\",\n color: theme.colors.vulcan,\n fontWeight: theme.fontWeight.bold,\n },\n};\n\nexport enum CardMotif {\n light = \"light\",\n dark = \"dark\",\n}\n\nexport type CardProps = {\n motif: CardMotif;\n title: string | ReactNode;\n subtitle?: string;\n titleLarge?: string;\n learnMoreHref: string;\n videoSrc?: string;\n videoPoster?: string;\n backgroundImageUrl?: string;\n backgroundColor?: string;\n border?: boolean;\n labels?: Array<keyof typeof presetLabelMap | Label>;\n onLinkClick?: (e: React.MouseEvent<HTMLElement>, href: string) => void;\n beforeFollowLink?: (url: string) => void;\n link?: LearnMoreLinkProps;\n className?: string;\n};\n"],"names":["presetLabelMap","new","text","color","theme","colors","buttercup","bestseller","unifi6","vulcan","fontWeight","bold","theOriginal","indoorOutdoor","compact","CardMotif"],"mappings":";;;;AAgBO,MAAMA,cAOT,GAAA;EACFC,GAAK,EAAA;IACHC,IAAM,EAAA,KAAA;IACNC,KAAA,EAAOC,YAAMC,MAAO,CAAAC;EACtB,CAAA;EACAC,UAAY,EAAA;IACVL,IAAM,EAAA,YAAA;IACNC,KAAA,EAAOC,YAAMC,MAAO,CAAAC;EACtB,CAAA;EACAE,MAAQ,EAAA;IACNN,IAAM,EAAA,SAAA;IACNC,KAAA,EAAOC,KAAAA,CAAAA,MAAMC,MAAO,CAAAI,MAAA;IACpBC,UAAA,EAAYN,YAAMM,UAAW,CAAAC;EAC/B,CAAA;EACAC,WAAa,EAAA;IACXV,IAAM,EAAA,cAAA;IACNC,KAAA,EAAOC,KAAAA,CAAAA,MAAMC,MAAO,CAAAI,MAAA;IACpBC,UAAA,EAAYN,YAAMM,UAAW,CAAAC;EAC/B,CAAA;EACAE,aAAe,EAAA;IACbX,IAAM,EAAA,kBAAA;IACNC,KAAA,EAAOC,KAAAA,CAAAA,MAAMC,MAAO,CAAAI,MAAA;IACpBC,UAAA,EAAYN,YAAMM,UAAW,CAAAC;EAC/B,CAAA;EACAG,OAAS,EAAA;IACPZ,IAAM,EAAA,SAAA;IACNC,KAAA,EAAOC,KAAAA,CAAAA,MAAMC,MAAO,CAAAI,MAAA;IACpBC,UAAA,EAAYN,YAAMM,UAAW,CAAAC;EAAA;AAEjC,CAAA;AAEY,IAAAI,SAAA,GAAA,gBAAAA,UAAL,IAAA;EACLA,WAAA,OAAQ,CAAA,GAAA,OAAA;EACRA,WAAA,MAAO,CAAA,GAAA,MAAA;EAFGA,OAAAA,UAAAA;AAAA,CAAA,EAAAA,SAAA,IAAA,CAAA,CAAA,CAAA;;"}
|
|
1
|
+
{"version":3,"file":"Card.types.js","sources":["../../../../src/components/CardSection/Card/Card.types.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\n\nimport { theme } from \"../../../constants/theme\";\nimport type { LearnMoreLinkProps } from \"../../LearnMoreLink\";\nimport type EN_TRANSLATION from \"./translations/en.json\";\n\ntype Label = {\n color: string;\n text: string;\n fontWeight?: string;\n};\n\ntype PresetLabel = Label & {\n text: keyof typeof EN_TRANSLATION;\n};\n\nexport const presetLabelMap: {\n new: PresetLabel;\n bestseller: PresetLabel;\n unifi6: PresetLabel;\n theOriginal: PresetLabel;\n indoorOutdoor: PresetLabel;\n compact: PresetLabel;\n} = {\n new: {\n text: \"New\",\n color: theme.colors.buttercup,\n },\n bestseller: {\n text: \"Bestseller\",\n color: theme.colors.buttercup,\n },\n unifi6: {\n text: \"UniFi 6\",\n color: theme.colors.vulcan,\n fontWeight: theme.fontWeight.bold,\n },\n theOriginal: {\n text: \"The Original\",\n color: theme.colors.vulcan,\n fontWeight: theme.fontWeight.bold,\n },\n indoorOutdoor: {\n text: \"Indoor / Outdoor\",\n color: theme.colors.vulcan,\n fontWeight: theme.fontWeight.bold,\n },\n compact: {\n text: \"Compact\",\n color: theme.colors.vulcan,\n fontWeight: theme.fontWeight.bold,\n },\n};\n\nexport enum CardMotif {\n light = \"light\",\n dark = \"dark\",\n}\n\nexport type CardProps = {\n motif: CardMotif;\n title: string | ReactNode;\n subtitle?: string;\n titleLarge?: string;\n learnMoreHref: string;\n videoSrc?: string;\n videoPoster?: string;\n backgroundImageUrl?: string;\n backgroundColor?: string;\n border?: boolean;\n labels?: Array<keyof typeof presetLabelMap | Label>;\n onLinkClick?: (e: React.MouseEvent<HTMLElement>, href: string) => void;\n beforeFollowLink?: (url: string) => void;\n link?: LearnMoreLinkProps;\n className?: string;\n hideLearnMoreLink?: boolean;\n};\n"],"names":["presetLabelMap","new","text","color","theme","colors","buttercup","bestseller","unifi6","vulcan","fontWeight","bold","theOriginal","indoorOutdoor","compact","CardMotif"],"mappings":";;;;AAgBO,MAAMA,cAOT,GAAA;EACFC,GAAK,EAAA;IACHC,IAAM,EAAA,KAAA;IACNC,KAAA,EAAOC,YAAMC,MAAO,CAAAC;EACtB,CAAA;EACAC,UAAY,EAAA;IACVL,IAAM,EAAA,YAAA;IACNC,KAAA,EAAOC,YAAMC,MAAO,CAAAC;EACtB,CAAA;EACAE,MAAQ,EAAA;IACNN,IAAM,EAAA,SAAA;IACNC,KAAA,EAAOC,KAAAA,CAAAA,MAAMC,MAAO,CAAAI,MAAA;IACpBC,UAAA,EAAYN,YAAMM,UAAW,CAAAC;EAC/B,CAAA;EACAC,WAAa,EAAA;IACXV,IAAM,EAAA,cAAA;IACNC,KAAA,EAAOC,KAAAA,CAAAA,MAAMC,MAAO,CAAAI,MAAA;IACpBC,UAAA,EAAYN,YAAMM,UAAW,CAAAC;EAC/B,CAAA;EACAE,aAAe,EAAA;IACbX,IAAM,EAAA,kBAAA;IACNC,KAAA,EAAOC,KAAAA,CAAAA,MAAMC,MAAO,CAAAI,MAAA;IACpBC,UAAA,EAAYN,YAAMM,UAAW,CAAAC;EAC/B,CAAA;EACAG,OAAS,EAAA;IACPZ,IAAM,EAAA,SAAA;IACNC,KAAA,EAAOC,KAAAA,CAAAA,MAAMC,MAAO,CAAAI,MAAA;IACpBC,UAAA,EAAYN,YAAMM,UAAW,CAAAC;EAAA;AAEjC,CAAA;AAEY,IAAAI,SAAA,GAAA,gBAAAA,UAAL,IAAA;EACLA,WAAA,OAAQ,CAAA,GAAA,OAAA;EACRA,WAAA,MAAO,CAAA,GAAA,MAAA;EAFGA,OAAAA,UAAAA;AAAA,CAAA,EAAAA,SAAA,IAAA,CAAA,CAAA,CAAA;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.types.mjs","sources":["../../../../src/components/CardSection/Card/Card.types.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\n\nimport { theme } from \"../../../constants/theme\";\nimport type { LearnMoreLinkProps } from \"../../LearnMoreLink\";\nimport type EN_TRANSLATION from \"./translations/en.json\";\n\ntype Label = {\n color: string;\n text: string;\n fontWeight?: string;\n};\n\ntype PresetLabel = Label & {\n text: keyof typeof EN_TRANSLATION;\n};\n\nexport const presetLabelMap: {\n new: PresetLabel;\n bestseller: PresetLabel;\n unifi6: PresetLabel;\n theOriginal: PresetLabel;\n indoorOutdoor: PresetLabel;\n compact: PresetLabel;\n} = {\n new: {\n text: \"New\",\n color: theme.colors.buttercup,\n },\n bestseller: {\n text: \"Bestseller\",\n color: theme.colors.buttercup,\n },\n unifi6: {\n text: \"UniFi 6\",\n color: theme.colors.vulcan,\n fontWeight: theme.fontWeight.bold,\n },\n theOriginal: {\n text: \"The Original\",\n color: theme.colors.vulcan,\n fontWeight: theme.fontWeight.bold,\n },\n indoorOutdoor: {\n text: \"Indoor / Outdoor\",\n color: theme.colors.vulcan,\n fontWeight: theme.fontWeight.bold,\n },\n compact: {\n text: \"Compact\",\n color: theme.colors.vulcan,\n fontWeight: theme.fontWeight.bold,\n },\n};\n\nexport enum CardMotif {\n light = \"light\",\n dark = \"dark\",\n}\n\nexport type CardProps = {\n motif: CardMotif;\n title: string | ReactNode;\n subtitle?: string;\n titleLarge?: string;\n learnMoreHref: string;\n videoSrc?: string;\n videoPoster?: string;\n backgroundImageUrl?: string;\n backgroundColor?: string;\n border?: boolean;\n labels?: Array<keyof typeof presetLabelMap | Label>;\n onLinkClick?: (e: React.MouseEvent<HTMLElement>, href: string) => void;\n beforeFollowLink?: (url: string) => void;\n link?: LearnMoreLinkProps;\n className?: string;\n};\n"],"names":["presetLabelMap","new","text","color","theme","colors","buttercup","bestseller","unifi6","vulcan","fontWeight","bold","theOriginal","indoorOutdoor","compact","CardMotif"],"mappings":";;AAgBO,MAAMA,cAOT,GAAA;EACFC,GAAK,EAAA;IACHC,IAAM,EAAA,KAAA;IACNC,KAAA,EAAOC,MAAMC,MAAO,CAAAC;EACtB,CAAA;EACAC,UAAY,EAAA;IACVL,IAAM,EAAA,YAAA;IACNC,KAAA,EAAOC,MAAMC,MAAO,CAAAC;EACtB,CAAA;EACAE,MAAQ,EAAA;IACNN,IAAM,EAAA,SAAA;IACNC,KAAA,EAAOC,MAAMC,MAAO,CAAAI,MAAA;IACpBC,UAAA,EAAYN,MAAMM,UAAW,CAAAC;EAC/B,CAAA;EACAC,WAAa,EAAA;IACXV,IAAM,EAAA,cAAA;IACNC,KAAA,EAAOC,MAAMC,MAAO,CAAAI,MAAA;IACpBC,UAAA,EAAYN,MAAMM,UAAW,CAAAC;EAC/B,CAAA;EACAE,aAAe,EAAA;IACbX,IAAM,EAAA,kBAAA;IACNC,KAAA,EAAOC,MAAMC,MAAO,CAAAI,MAAA;IACpBC,UAAA,EAAYN,MAAMM,UAAW,CAAAC;EAC/B,CAAA;EACAG,OAAS,EAAA;IACPZ,IAAM,EAAA,SAAA;IACNC,KAAA,EAAOC,MAAMC,MAAO,CAAAI,MAAA;IACpBC,UAAA,EAAYN,MAAMM,UAAW,CAAAC;EAAA;AAEjC,CAAA;AAEY,IAAAI,SAAA,GAAA,gBAAAA,UAAL,IAAA;EACLA,WAAA,OAAQ,CAAA,GAAA,OAAA;EACRA,WAAA,MAAO,CAAA,GAAA,MAAA;EAFGA,OAAAA,UAAAA;AAAA,CAAA,EAAAA,SAAA,IAAA,CAAA,CAAA,CAAA;"}
|
|
1
|
+
{"version":3,"file":"Card.types.mjs","sources":["../../../../src/components/CardSection/Card/Card.types.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\n\nimport { theme } from \"../../../constants/theme\";\nimport type { LearnMoreLinkProps } from \"../../LearnMoreLink\";\nimport type EN_TRANSLATION from \"./translations/en.json\";\n\ntype Label = {\n color: string;\n text: string;\n fontWeight?: string;\n};\n\ntype PresetLabel = Label & {\n text: keyof typeof EN_TRANSLATION;\n};\n\nexport const presetLabelMap: {\n new: PresetLabel;\n bestseller: PresetLabel;\n unifi6: PresetLabel;\n theOriginal: PresetLabel;\n indoorOutdoor: PresetLabel;\n compact: PresetLabel;\n} = {\n new: {\n text: \"New\",\n color: theme.colors.buttercup,\n },\n bestseller: {\n text: \"Bestseller\",\n color: theme.colors.buttercup,\n },\n unifi6: {\n text: \"UniFi 6\",\n color: theme.colors.vulcan,\n fontWeight: theme.fontWeight.bold,\n },\n theOriginal: {\n text: \"The Original\",\n color: theme.colors.vulcan,\n fontWeight: theme.fontWeight.bold,\n },\n indoorOutdoor: {\n text: \"Indoor / Outdoor\",\n color: theme.colors.vulcan,\n fontWeight: theme.fontWeight.bold,\n },\n compact: {\n text: \"Compact\",\n color: theme.colors.vulcan,\n fontWeight: theme.fontWeight.bold,\n },\n};\n\nexport enum CardMotif {\n light = \"light\",\n dark = \"dark\",\n}\n\nexport type CardProps = {\n motif: CardMotif;\n title: string | ReactNode;\n subtitle?: string;\n titleLarge?: string;\n learnMoreHref: string;\n videoSrc?: string;\n videoPoster?: string;\n backgroundImageUrl?: string;\n backgroundColor?: string;\n border?: boolean;\n labels?: Array<keyof typeof presetLabelMap | Label>;\n onLinkClick?: (e: React.MouseEvent<HTMLElement>, href: string) => void;\n beforeFollowLink?: (url: string) => void;\n link?: LearnMoreLinkProps;\n className?: string;\n hideLearnMoreLink?: boolean;\n};\n"],"names":["presetLabelMap","new","text","color","theme","colors","buttercup","bestseller","unifi6","vulcan","fontWeight","bold","theOriginal","indoorOutdoor","compact","CardMotif"],"mappings":";;AAgBO,MAAMA,cAOT,GAAA;EACFC,GAAK,EAAA;IACHC,IAAM,EAAA,KAAA;IACNC,KAAA,EAAOC,MAAMC,MAAO,CAAAC;EACtB,CAAA;EACAC,UAAY,EAAA;IACVL,IAAM,EAAA,YAAA;IACNC,KAAA,EAAOC,MAAMC,MAAO,CAAAC;EACtB,CAAA;EACAE,MAAQ,EAAA;IACNN,IAAM,EAAA,SAAA;IACNC,KAAA,EAAOC,MAAMC,MAAO,CAAAI,MAAA;IACpBC,UAAA,EAAYN,MAAMM,UAAW,CAAAC;EAC/B,CAAA;EACAC,WAAa,EAAA;IACXV,IAAM,EAAA,cAAA;IACNC,KAAA,EAAOC,MAAMC,MAAO,CAAAI,MAAA;IACpBC,UAAA,EAAYN,MAAMM,UAAW,CAAAC;EAC/B,CAAA;EACAE,aAAe,EAAA;IACbX,IAAM,EAAA,kBAAA;IACNC,KAAA,EAAOC,MAAMC,MAAO,CAAAI,MAAA;IACpBC,UAAA,EAAYN,MAAMM,UAAW,CAAAC;EAC/B,CAAA;EACAG,OAAS,EAAA;IACPZ,IAAM,EAAA,SAAA;IACNC,KAAA,EAAOC,MAAMC,MAAO,CAAAI,MAAA;IACpBC,UAAA,EAAYN,MAAMM,UAAW,CAAAC;EAAA;AAEjC,CAAA;AAEY,IAAAI,SAAA,GAAA,gBAAAA,UAAL,IAAA;EACLA,WAAA,OAAQ,CAAA,GAAA,OAAA;EACRA,WAAA,MAAO,CAAA,GAAA,MAAA;EAFGA,OAAAA,UAAAA;AAAA,CAAA,EAAAA,SAAA,IAAA,CAAA,CAAA,CAAA;"}
|
|
@@ -378,6 +378,11 @@ const ProHeader = React.memo(function ProHeader2({
|
|
|
378
378
|
});
|
|
379
379
|
}, [embedConfig?.moveAvatarIconToLeft, account?.customer?.picture, account?.loading, embedConfig?.displayAvatarAsImage, embedConfig?.hideAvatarIcon, handleAvatarClick, motif]);
|
|
380
380
|
const [showProductLineSelectorDropdown, setShowProductLineSelectorDropdown] = React.useState(false);
|
|
381
|
+
React.useEffect(() => {
|
|
382
|
+
if (activeModal) {
|
|
383
|
+
setShowProductLineSelectorDropdown(false);
|
|
384
|
+
}
|
|
385
|
+
}, [activeModal]);
|
|
381
386
|
const productLineSelectorRef = React.useRef(null);
|
|
382
387
|
reactUse.useClickAway(productLineSelectorRef, () => {
|
|
383
388
|
setShowProductLineSelectorDropdown(false);
|