@redneckz/wildless-cms-uni-blocks 0.2.99 → 0.2.103
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/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +126 -63
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/BlockContent.d.ts +3 -2
- package/dist/components/Blocks.d.ts +1 -0
- package/dist/components/Blocks.js +2 -0
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/CreditCalculator/CreditCalculator.js +2 -2
- package/dist/components/CreditCalculator/CreditCalculator.js.map +1 -1
- package/dist/components/Footer/FooterContent.d.ts +1 -1
- package/dist/components/Footer/Sitemap.d.ts +1 -1
- package/dist/components/Footer/Sitemap.js +2 -2
- package/dist/components/Footer/Sitemap.js.map +1 -1
- package/dist/components/Header/Header.js +13 -9
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/Header/HeaderContent.d.ts +8 -1
- package/dist/components/Header/HeaderSecondaryMenu.d.ts +2 -1
- package/dist/components/Header/HeaderSecondaryMenu.js +14 -2
- package/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/dist/components/Header/HeaderSecondaryMenuButton.js +1 -1
- package/dist/components/Header/HeaderSecondaryMenuButton.js.map +1 -1
- package/dist/components/Headline/HeadlineContent.d.ts +2 -9
- package/dist/components/MobileBlocks.d.ts +1 -0
- package/dist/components/MobileBlocks.js +2 -0
- package/dist/components/MobileBlocks.js.map +1 -1
- package/dist/components/Navigation/Navigation.d.ts +5 -0
- package/dist/components/Navigation/Navigation.js +16 -0
- package/dist/components/Navigation/Navigation.js.map +1 -0
- package/dist/components/Navigation/NavigationContent.d.ts +10 -0
- package/dist/components/Navigation/NavigationContent.js +2 -0
- package/dist/components/Navigation/NavigationContent.js.map +1 -0
- package/dist/components/Navigation/NavigationItem.d.ts +4 -0
- package/dist/components/Navigation/NavigationItem.js +6 -0
- package/dist/components/Navigation/NavigationItem.js.map +1 -0
- package/dist/components/StepsBlock/StepsBlock.d.ts +1 -1
- package/dist/components/StepsBlock/StepsBlock.js +3 -3
- package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlockContent.d.ts +5 -2
- package/dist/hooks/useLink.js +2 -1
- package/dist/hooks/useLink.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/model/BgColorVersion.d.ts +8 -0
- package/dist/model/BgColorVersion.js +2 -0
- package/dist/model/BgColorVersion.js.map +1 -0
- package/dist/services/sitemap/SitemapProps.d.ts +13 -0
- package/dist/services/sitemap/SitemapProps.js +2 -0
- package/dist/services/sitemap/SitemapProps.js.map +1 -0
- package/dist/services/sitemap/findActiveSubItem.d.ts +3 -0
- package/dist/services/sitemap/findActiveSubItem.js +13 -0
- package/dist/services/sitemap/findActiveSubItem.js.map +1 -0
- package/dist/services/sitemap/isHrefActive.d.ts +4 -0
- package/dist/services/sitemap/isHrefActive.js +9 -0
- package/dist/services/sitemap/isHrefActive.js.map +1 -0
- package/dist/services/sitemap/isSubItemActive.d.ts +3 -0
- package/dist/services/sitemap/isSubItemActive.js +6 -0
- package/dist/services/sitemap/isSubItemActive.js.map +1 -0
- package/dist/services/sitemap/isTopItemActive.d.ts +3 -0
- package/dist/services/sitemap/isTopItemActive.js +7 -0
- package/dist/services/sitemap/isTopItemActive.js.map +1 -0
- package/dist/services/sitemap/mergeTopItems.d.ts +2 -0
- package/dist/{mergeTopItems.js → services/sitemap/mergeTopItems.js} +1 -3
- package/dist/services/sitemap/mergeTopItems.js.map +1 -0
- package/dist/services/sitemap/useSitemap.d.ts +3 -0
- package/dist/{hooks → services/sitemap}/useSitemap.js +1 -1
- package/dist/services/sitemap/useSitemap.js.map +1 -0
- package/dist/ui-kit/Button/ButtonProps.d.ts +1 -1
- package/dist/ui-kit/HeaderItem/HeaderItem.js +16 -4
- package/dist/ui-kit/HeaderItem/HeaderItem.js.map +1 -1
- package/dist/ui-kit/Icon/IconProps.d.ts +83 -45
- package/dist/ui-kit/Icon/IconProps.js +62 -43
- package/dist/ui-kit/Icon/IconProps.js.map +1 -1
- package/dist/ui-kit/Logo/Logo.d.ts +1 -0
- package/dist/ui-kit/Logo/Logo.js +10 -2
- package/dist/ui-kit/Logo/Logo.js.map +1 -1
- package/dist/ui-kit/TopItem/TopItem.d.ts +2 -0
- package/dist/ui-kit/TopItem/TopItem.js +19 -7
- package/dist/ui-kit/TopItem/TopItem.js.map +1 -1
- package/dist/utils/adjustHref.d.ts +4 -0
- package/dist/utils/adjustHref.js +21 -0
- package/dist/utils/adjustHref.js.map +1 -0
- package/dist/utils/maxBy.d.ts +2 -0
- package/dist/utils/maxBy.js +7 -0
- package/dist/utils/maxBy.js.map +1 -0
- package/dist/utils/url.d.ts +0 -13
- package/dist/utils/url.js +2 -26
- package/dist/utils/url.js.map +1 -1
- package/dist/utils/withoutMobilePath.d.ts +2 -0
- package/dist/utils/withoutMobilePath.js +6 -0
- package/dist/utils/withoutMobilePath.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/BlockContent.d.ts +3 -2
- package/lib/components/Blocks.d.ts +1 -0
- package/lib/components/Blocks.js +2 -0
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/CreditCalculator/CreditCalculator.js +2 -2
- package/lib/components/CreditCalculator/CreditCalculator.js.map +1 -1
- package/lib/components/Footer/FooterContent.d.ts +1 -1
- package/lib/components/Footer/Sitemap.d.ts +1 -1
- package/lib/components/Footer/Sitemap.js +2 -2
- package/lib/components/Footer/Sitemap.js.map +1 -1
- package/lib/components/Header/Header.fixture.d.ts +4 -1
- package/lib/components/Header/Header.js +13 -9
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/Header/HeaderContent.d.ts +8 -1
- package/lib/components/Header/HeaderSecondaryMenu.d.ts +2 -1
- package/lib/components/Header/HeaderSecondaryMenu.js +14 -2
- package/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/lib/components/Header/HeaderSecondaryMenuButton.js +1 -1
- package/lib/components/Header/HeaderSecondaryMenuButton.js.map +1 -1
- package/lib/components/Headline/HeadlineContent.d.ts +2 -9
- package/lib/components/MobileBlocks.d.ts +1 -0
- package/lib/components/MobileBlocks.js +2 -0
- package/lib/components/MobileBlocks.js.map +1 -1
- package/lib/components/Navigation/Navigation.d.ts +5 -0
- package/lib/components/Navigation/Navigation.fixture.d.ts +2 -0
- package/lib/components/Navigation/Navigation.js +14 -0
- package/lib/components/Navigation/Navigation.js.map +1 -0
- package/lib/components/Navigation/NavigationContent.d.ts +10 -0
- package/lib/components/Navigation/NavigationContent.js +2 -0
- package/lib/components/Navigation/NavigationContent.js.map +1 -0
- package/lib/components/Navigation/NavigationItem.d.ts +4 -0
- package/lib/components/Navigation/NavigationItem.js +4 -0
- package/lib/components/Navigation/NavigationItem.js.map +1 -0
- package/lib/components/StepsBlock/StepsBlock.d.ts +1 -1
- package/lib/components/StepsBlock/StepsBlock.js +3 -3
- package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlockContent.d.ts +5 -2
- package/lib/hooks/useLink.js +2 -1
- package/lib/hooks/useLink.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js.map +1 -1
- package/lib/model/BgColorVersion.d.ts +8 -0
- package/lib/model/BgColorVersion.js +2 -0
- package/lib/model/BgColorVersion.js.map +1 -0
- package/lib/services/sitemap/SitemapProps.d.ts +13 -0
- package/lib/services/sitemap/SitemapProps.js +2 -0
- package/lib/services/sitemap/SitemapProps.js.map +1 -0
- package/lib/services/sitemap/findActiveSubItem.d.ts +3 -0
- package/lib/services/sitemap/findActiveSubItem.js +10 -0
- package/lib/services/sitemap/findActiveSubItem.js.map +1 -0
- package/lib/services/sitemap/isHrefActive.d.ts +4 -0
- package/lib/services/sitemap/isHrefActive.js +6 -0
- package/lib/services/sitemap/isHrefActive.js.map +1 -0
- package/lib/services/sitemap/isSubItemActive.d.ts +3 -0
- package/lib/services/sitemap/isSubItemActive.js +3 -0
- package/lib/services/sitemap/isSubItemActive.js.map +1 -0
- package/lib/services/sitemap/isTopItemActive.d.ts +3 -0
- package/lib/services/sitemap/isTopItemActive.js +4 -0
- package/lib/services/sitemap/isTopItemActive.js.map +1 -0
- package/lib/services/sitemap/mergeTopItems.d.ts +2 -0
- package/lib/{mergeTopItems.js → services/sitemap/mergeTopItems.js} +1 -3
- package/lib/services/sitemap/mergeTopItems.js.map +1 -0
- package/lib/services/sitemap/useSitemap.d.ts +3 -0
- package/lib/{hooks → services/sitemap}/useSitemap.js +1 -1
- package/lib/services/sitemap/useSitemap.js.map +1 -0
- package/lib/ui-kit/Button/ButtonProps.d.ts +1 -1
- package/lib/ui-kit/HeaderItem/HeaderItem.js +16 -4
- package/lib/ui-kit/HeaderItem/HeaderItem.js.map +1 -1
- package/lib/ui-kit/Icon/IconProps.d.ts +83 -45
- package/lib/ui-kit/Icon/IconProps.js +62 -43
- package/lib/ui-kit/Icon/IconProps.js.map +1 -1
- package/lib/ui-kit/Logo/Logo.d.ts +1 -0
- package/lib/ui-kit/Logo/Logo.js +10 -2
- package/lib/ui-kit/Logo/Logo.js.map +1 -1
- package/lib/ui-kit/TopItem/TopItem.d.ts +2 -0
- package/lib/ui-kit/TopItem/TopItem.js +19 -7
- package/lib/ui-kit/TopItem/TopItem.js.map +1 -1
- package/lib/utils/adjustHref.d.ts +4 -0
- package/lib/utils/adjustHref.js +18 -0
- package/lib/utils/adjustHref.js.map +1 -0
- package/lib/utils/maxBy.d.ts +2 -0
- package/lib/utils/maxBy.js +3 -0
- package/lib/utils/maxBy.js.map +1 -0
- package/lib/utils/url.d.ts +0 -13
- package/lib/utils/url.js +1 -21
- package/lib/utils/url.js.map +1 -1
- package/lib/utils/withoutMobilePath.d.ts +2 -0
- package/lib/utils/withoutMobilePath.js +3 -0
- package/lib/utils/withoutMobilePath.js.map +1 -0
- package/package.json +4 -2
- package/src/components/BlockContent.ts +4 -2
- package/src/components/Blocks.ts +2 -0
- package/src/components/ContentPage/ContentPage.page.json +28 -15
- package/src/components/CreditCalculator/CreditCalculator.tsx +4 -6
- package/src/components/Footer/FooterContent.ts +1 -1
- package/src/components/Footer/Sitemap.tsx +4 -3
- package/src/components/Header/Header.fixture.tsx +4 -18
- package/src/components/Header/Header.tsx +56 -45
- package/src/components/Header/HeaderContent.ts +8 -1
- package/src/components/Header/HeaderSecondaryMenu.tsx +25 -12
- package/src/components/Header/HeaderSecondaryMenuButton.tsx +2 -4
- package/src/components/Headline/HeadlineContent.ts +2 -10
- package/src/components/MobileBlocks.ts +2 -0
- package/src/components/Navigation/Navigation.fixture.tsx +28 -0
- package/src/components/Navigation/Navigation.tsx +39 -0
- package/src/components/Navigation/NavigationContent.ts +11 -0
- package/src/components/Navigation/NavigationItem.tsx +17 -0
- package/src/components/PictureText/PictureText.example.json +2 -2
- package/src/components/PictureText/PictureText.fixture.tsx +2 -2
- package/src/components/StepsBlock/StepsBlock.example.json +3 -1
- package/src/components/StepsBlock/StepsBlock.tsx +21 -16
- package/src/components/StepsBlock/StepsBlockContent.ts +5 -2
- package/src/hooks/useLink.ts +2 -1
- package/src/icons/Calendar2Icon.svg +1 -0
- package/src/icons/CalendarCircleIcon.svg +1 -0
- package/src/icons/CalendarTickIcon.svg +1 -0
- package/src/icons/CardIcon.svg +1 -0
- package/src/icons/CardPosIcon.svg +1 -0
- package/src/icons/CardTickIcon.svg +1 -0
- package/src/icons/CardWithGemIcon.svg +1 -0
- package/src/icons/ChartSquareIcon.svg +1 -0
- package/src/icons/CreditCardsIcon.svg +1 -0
- package/src/icons/DischountStarIcon.svg +1 -0
- package/src/icons/{DocumentText.svg → DocumentTextIcon.svg} +0 -0
- package/src/icons/EarthIcon.svg +1 -0
- package/src/icons/EmptyWalletChangeIcon.svg +1 -0
- package/src/icons/GlobalIcon.svg +1 -0
- package/src/icons/GridIcon.svg +1 -1
- package/src/icons/GridIconWhite.svg +4 -0
- package/src/icons/InterestGrowthIcon.svg +1 -0
- package/src/icons/InterestIcon.svg +1 -0
- package/src/icons/JCBIcon.svg +1 -0
- package/src/icons/MasterCardIcon.svg +1 -0
- package/src/icons/MinusIcon.svg +1 -0
- package/src/icons/MirIcon.svg +1 -0
- package/src/icons/MoneyIcon.svg +1 -0
- package/src/icons/MoneyInsuranceIcon.svg +1 -0
- package/src/icons/MonitorMobileIcon.svg +1 -0
- package/src/icons/OfficeIcon.svg +1 -0
- package/src/icons/PercentageRoundIcon.svg +1 -0
- package/src/icons/PersonalCardIcon.svg +1 -0
- package/src/icons/PlusIcon.svg +1 -0
- package/src/icons/Profile2UserIcon.svg +1 -0
- package/src/icons/RoundRubleIcon.svg +1 -0
- package/src/icons/SafeIcon.svg +1 -0
- package/src/icons/ShieldTickIcon.svg +1 -0
- package/src/icons/SmallClockIcon.svg +1 -0
- package/src/icons/UnionPayIcon.svg +1 -0
- package/src/icons/UserTickIcon.svg +1 -0
- package/src/icons/VisaIcon.svg +1 -0
- package/src/icons/WalletAdd2Icon.svg +1 -0
- package/src/icons/WalletAddIcon.svg +1 -0
- package/src/icons/WalletWithMoneyIcon.svg +1 -0
- package/src/index.ts +1 -1
- package/src/model/BgColorVersion.ts +8 -0
- package/src/services/sitemap/SitemapProps.ts +15 -0
- package/src/services/sitemap/findActiveSubItem.ts +14 -0
- package/src/services/sitemap/isHrefActive.ts +13 -0
- package/src/services/sitemap/isSubItemActive.ts +8 -0
- package/src/services/sitemap/isTopItemActive.ts +9 -0
- package/src/{mergeTopItems.spec.ts → services/sitemap/mergeTopItems.spec.ts} +0 -0
- package/src/{mergeTopItems.ts → services/sitemap/mergeTopItems.ts} +3 -4
- package/src/{hooks → services/sitemap}/useSitemap.ts +3 -3
- package/src/ui-kit/Button/ButtonProps.ts +1 -1
- package/src/ui-kit/HeaderItem/HeaderItem.tsx +32 -18
- package/src/ui-kit/Icon/IconProps.ts +44 -6
- package/src/ui-kit/Logo/Logo.tsx +30 -18
- package/src/ui-kit/TopItem/TopItem.tsx +46 -19
- package/src/utils/adjustHref.spec.ts +25 -0
- package/src/utils/adjustHref.ts +24 -0
- package/src/utils/maxBy.spec.ts +11 -0
- package/src/utils/maxBy.ts +7 -0
- package/src/utils/url.spec.ts +1 -37
- package/src/utils/url.ts +2 -39
- package/src/utils/withoutMobilePath.ts +3 -0
- package/dist/components/Header/isSubItemActive.d.ts +0 -3
- package/dist/components/Header/isSubItemActive.js +0 -8
- package/dist/components/Header/isSubItemActive.js.map +0 -1
- package/dist/components/Header/isTopItemActive.d.ts +0 -3
- package/dist/components/Header/isTopItemActive.js +0 -8
- package/dist/components/Header/isTopItemActive.js.map +0 -1
- package/dist/hooks/useSitemap.d.ts +0 -3
- package/dist/hooks/useSitemap.js.map +0 -1
- package/dist/mergeTopItems.d.ts +0 -2
- package/dist/mergeTopItems.js.map +0 -1
- package/lib/components/Header/isSubItemActive.d.ts +0 -3
- package/lib/components/Header/isSubItemActive.js +0 -5
- package/lib/components/Header/isSubItemActive.js.map +0 -1
- package/lib/components/Header/isTopItemActive.d.ts +0 -3
- package/lib/components/Header/isTopItemActive.js +0 -5
- package/lib/components/Header/isTopItemActive.js.map +0 -1
- package/lib/hooks/useSitemap.d.ts +0 -3
- package/lib/hooks/useSitemap.js.map +0 -1
- package/lib/mergeTopItems.d.ts +0 -2
- package/lib/mergeTopItems.js.map +0 -1
- package/src/components/Header/isSubItemActive.ts +0 -7
- package/src/components/Header/isTopItemActive.ts +0 -8
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
3
|
+
const TEXT_CLASSES = 'font-sans font-normal text-sm';
|
|
4
|
+
const LINK_CLASSES = 'inline-block border border-solid bg-transparent text-center no-underline';
|
|
5
|
+
export const TopItem = JSX(({ className = '', text, href, target, active, flat, onClick, children, ariaLabel, bgColor = 'bg-white', }) => (_jsx("a", { className: `${getLinkClasses(bgColor, active, flat)} ${className}`, href: href, target: target, onClick: onClick, rel: "noopener noreferrer", "aria-label": ariaLabel, children: _jsx("span", { className: getTextClasses(bgColor, active, flat), children: text || children }) })));
|
|
6
|
+
const getLinkClasses = (bgColor, active, flat) => {
|
|
7
|
+
let classes = 'border-transparent';
|
|
8
|
+
if (active) {
|
|
9
|
+
classes = `rounded-md ${bgColor === 'bg-white' ? 'border-primary-main' : 'border-white'}`;
|
|
10
|
+
}
|
|
11
|
+
return `${classes} ${LINK_CLASSES} ${flat ? '' : 'px-4 py-2'}`;
|
|
12
|
+
};
|
|
13
|
+
const getTextClasses = (bgColor, active, flat) => {
|
|
14
|
+
let classes = 'text-white';
|
|
15
|
+
if (bgColor === 'bg-white') {
|
|
16
|
+
classes = active
|
|
17
|
+
? 'text-primary-main'
|
|
18
|
+
: `${flat ? 'text-primary-text' : 'text-secondary-text'} hover:text-primary-main`;
|
|
19
|
+
}
|
|
20
|
+
return `${classes} ${TEXT_CLASSES}`;
|
|
21
|
+
};
|
|
10
22
|
//# sourceMappingURL=TopItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopItem.js","sourceRoot":"","sources":["../../../src/ui-kit/TopItem/TopItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"TopItem.js","sourceRoot":"","sources":["../../../src/ui-kit/TopItem/TopItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAgBxC,MAAM,YAAY,GAAG,+BAA+B,CAAC;AACrD,MAAM,YAAY,GAAG,0EAA0E,CAAC;AAEhG,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,CACxB,CAAC,EACC,SAAS,GAAG,EAAE,EACd,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,MAAM,EACN,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,SAAS,EACT,OAAO,GAAG,UAAU,GACrB,EAAE,EAAE,CAAC,CACJ,YACE,SAAS,EAAE,GAAG,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,SAAS,EAAE,EAClE,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,GAAG,EAAC,qBAAqB,gBACb,SAAS,YAErB,eAAM,SAAS,EAAE,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,YAAG,IAAI,IAAI,QAAQ,GAAQ,GAC/E,CACL,CACF,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,OAAuB,EAAE,MAAgB,EAAE,IAAc,EAAE,EAAE;IACnF,IAAI,OAAO,GAAG,oBAAoB,CAAC;IACnC,IAAI,MAAM,EAAE;QACV,OAAO,GAAG,cAAc,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,cAAc,EAAE,CAAC;KAC3F;IAED,OAAO,GAAG,OAAO,IAAI,YAAY,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AACjE,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,OAAuB,EAAE,MAAgB,EAAE,IAAc,EAAE,EAAE;IACnF,IAAI,OAAO,GAAG,YAAY,CAAC;IAC3B,IAAI,OAAO,KAAK,UAAU,EAAE;QAC1B,OAAO,GAAG,MAAM;YACd,CAAC,CAAC,mBAAmB;YACrB,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,qBAAqB,0BAA0B,CAAC;KACrF;IAED,OAAO,GAAG,OAAO,IAAI,YAAY,EAAE,CAAC;AACtC,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { getOrigin, isURL } from './url.js';
|
|
2
|
+
import { MOBILE_URL_PATH } from './withoutMobilePath.js';
|
|
3
|
+
export const adjustHref = (href, router) => {
|
|
4
|
+
if (!href) {
|
|
5
|
+
return href;
|
|
6
|
+
}
|
|
7
|
+
const relativeHref = toRelativeHref(href, router) || '';
|
|
8
|
+
const isMobilePage = router?.pathname.startsWith(MOBILE_URL_PATH);
|
|
9
|
+
return isMobilePage && !isURL(relativeHref) ? `${MOBILE_URL_PATH}${relativeHref}` : relativeHref;
|
|
10
|
+
};
|
|
11
|
+
const toRelativeHref = (href, router) => {
|
|
12
|
+
if (!href) {
|
|
13
|
+
return href;
|
|
14
|
+
}
|
|
15
|
+
const origin = getOrigin(router?.href);
|
|
16
|
+
return origin ? href.replace(origin, '') || '/' : href;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=adjustHref.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adjustHref.js","sourceRoot":"","sources":["../../src/utils/adjustHref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,IAAwB,EACxB,MAA2C,EAC3C,EAAE;IACF,IAAI,CAAC,IAAI,EAAE;QACT,OAAO,IAAI,CAAC;KACb;IAED,MAAM,YAAY,GAAG,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;IACxD,MAAM,YAAY,GAAG,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;IAClE,OAAO,YAAY,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG,eAAe,GAAG,YAAY,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC;AACnG,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,IAAwB,EAAE,MAAyB,EAAE,EAAE;IAC7E,IAAI,CAAC,IAAI,EAAE;QACT,OAAO,IAAI,CAAC;KACb;IAED,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACvC,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AACzD,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maxBy.js","sourceRoot":"","sources":["../../src/utils/maxBy.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAChB,CAAc,aAAoC,EAAE,EAAE,CACtD,CAAC,IAAY,EAAQ,EAAE,CACrB,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9E,MAAM,CAAC,MAAM,KAAK,GAAG,CAAc,aAAoC,EAAE,EAAE,CACzE,KAAK,CAAC,CAAC,CAAO,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
package/lib/utils/url.d.ts
CHANGED
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
export declare const MOBILE_URL_PATH = "/mobile";
|
|
2
1
|
export declare const isURL: (href?: string) => boolean | undefined;
|
|
3
|
-
export declare const isHrefActive: (href: string | undefined, router: {
|
|
4
|
-
pathname?: string | undefined;
|
|
5
|
-
href?: string | undefined;
|
|
6
|
-
}, cmp?: (href: string, baseHref: string) => boolean) => boolean;
|
|
7
2
|
export declare const withoutQuery: (href?: string) => string;
|
|
8
|
-
export declare const withoutMobilePath: (href?: string) => string;
|
|
9
3
|
export declare const getOrigin: (href?: string) => string | undefined;
|
|
10
|
-
export declare const adjustHref: (href: string | undefined, router: {
|
|
11
|
-
pathname: string;
|
|
12
|
-
href?: string | undefined;
|
|
13
|
-
}) => string | undefined;
|
|
14
|
-
export declare const toRelativeHref: (href: string | undefined, router: {
|
|
15
|
-
href?: string | undefined;
|
|
16
|
-
}) => string | undefined;
|
package/lib/utils/url.js
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
export const MOBILE_URL_PATH = '/mobile';
|
|
2
1
|
export const isURL = (href) => href?.includes('//');
|
|
3
|
-
export const isHrefActive = (href, router, cmp = (href, baseHref) => href === baseHref) => {
|
|
4
|
-
return cmp(withoutQuery(href), withoutMobilePath(withoutQuery(isURL(href) ? router.href : router.pathname)));
|
|
5
|
-
};
|
|
6
2
|
export const withoutQuery = (href) => (href || '').replace(/\/?\?.*/, '');
|
|
7
|
-
export const withoutMobilePath = (href) => (href || '').replace(MOBILE_URL_PATH, '');
|
|
8
3
|
export const getOrigin = (href) => {
|
|
9
|
-
if (!isURL(href)) {
|
|
4
|
+
if (!href || !isURL(href)) {
|
|
10
5
|
return undefined;
|
|
11
6
|
}
|
|
12
7
|
const url = href;
|
|
@@ -15,19 +10,4 @@ export const getOrigin = (href) => {
|
|
|
15
10
|
const endOfOrigin = url.indexOf('/', endOfProto + protoSeparator.length);
|
|
16
11
|
return endOfOrigin !== -1 ? url.substring(0, endOfOrigin) : url;
|
|
17
12
|
};
|
|
18
|
-
export const adjustHref = (href, router) => {
|
|
19
|
-
if (!href) {
|
|
20
|
-
return href;
|
|
21
|
-
}
|
|
22
|
-
const relativeHref = toRelativeHref(href, router);
|
|
23
|
-
const isMobilePage = router?.pathname.startsWith(MOBILE_URL_PATH);
|
|
24
|
-
return isMobilePage && !isURL(relativeHref) ? `${MOBILE_URL_PATH}${relativeHref}` : relativeHref;
|
|
25
|
-
};
|
|
26
|
-
export const toRelativeHref = (href, router) => {
|
|
27
|
-
if (!href) {
|
|
28
|
-
return href;
|
|
29
|
-
}
|
|
30
|
-
const origin = getOrigin(router?.href);
|
|
31
|
-
return origin ? href.replace(origin, '') || '/' : href;
|
|
32
|
-
};
|
|
33
13
|
//# sourceMappingURL=url.js.map
|
package/lib/utils/url.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.js","sourceRoot":"","sources":["../../src/utils/url.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"url.js","sourceRoot":"","sources":["../../src/utils/url.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,IAAa,EAAE,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;AAE7D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAa,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;AAEnF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAa,EAAE,EAAE;IACzC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;QACzB,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,GAAG,GAAG,IAAI,CAAC;IACjB,MAAM,cAAc,GAAG,IAAI,CAAC;IAC5B,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IAC/C,MAAM,WAAW,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,UAAU,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IACzE,OAAO,WAAW,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;AAClE,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withoutMobilePath.js","sourceRoot":"","sources":["../../src/utils/withoutMobilePath.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,SAAS,CAAC;AAEzC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,IAAa,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redneckz/wildless-cms-uni-blocks",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.103",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ЦК",
|
|
@@ -142,7 +142,9 @@
|
|
|
142
142
|
],
|
|
143
143
|
"lint-staged": {
|
|
144
144
|
"src/**/*.{js,jsx,ts,tsx,css}": [
|
|
145
|
-
"prettier --write"
|
|
145
|
+
"prettier --write"
|
|
146
|
+
],
|
|
147
|
+
"src/**/*.{js,jsx,ts,tsx}": [
|
|
146
148
|
"eslint"
|
|
147
149
|
],
|
|
148
150
|
"*.{js,jsx,ts,tsx,css,json}": [
|
|
@@ -6,6 +6,7 @@ import type { GalleryContent } from './Gallery/GalleryContent';
|
|
|
6
6
|
import type { HeaderContent } from './Header/HeaderContent';
|
|
7
7
|
import type { LinkDocsContent } from './LinkDocs/LinkDocsContent';
|
|
8
8
|
import type { MobileAppTileContent } from './MobileAppTile/MobileAppTileContent';
|
|
9
|
+
import type { NavigationContent } from './Navigation/NavigationContent';
|
|
9
10
|
import type { PictureTextContent } from './PictureText/PictureTextContent';
|
|
10
11
|
import type { PlaceholderContent } from './Placeholder/PlaceholderContent';
|
|
11
12
|
import type { ProductBlockContent } from './ProductBlock/ProductBlockContent';
|
|
@@ -13,9 +14,9 @@ import type { ProductGalleryContent } from './ProductGallery/ProductGalleryConte
|
|
|
13
14
|
import type { ProductTileContent } from './ProductTile/ProductTileContent';
|
|
14
15
|
import type { PromoTileContent } from './PromoTile/PromoTileContent';
|
|
15
16
|
import type { StepsBlockContent } from './StepsBlock/StepsBlockContent';
|
|
17
|
+
import type { TariffsTableContent } from './TariffsTable/TariffsTableContent';
|
|
16
18
|
import type { TextBlockContent } from './TextBlock/TextBlockContent';
|
|
17
19
|
import type { TileContent } from './Tile/TileContent';
|
|
18
|
-
import { TariffsTableContent } from './TariffsTable/TariffsTableContent';
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* @hidden
|
|
@@ -38,4 +39,5 @@ export type BlockContent =
|
|
|
38
39
|
| StepsBlockContent
|
|
39
40
|
| TariffsTableContent
|
|
40
41
|
| TextBlockContent
|
|
41
|
-
| TileContent
|
|
42
|
+
| TileContent
|
|
43
|
+
| NavigationContent;
|
package/src/components/Blocks.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { Headline } from './Headline/Headline';
|
|
|
10
10
|
import { LinkDocs } from './LinkDocs/LinkDocs';
|
|
11
11
|
import { MiniGallery } from './MiniGallery/MiniGallery';
|
|
12
12
|
import { MobileAppTile } from './MobileAppTile/MobileAppTile';
|
|
13
|
+
import { Navigation } from './Navigation/Navigation';
|
|
13
14
|
import { PictureText } from './PictureText/PictureText';
|
|
14
15
|
import { Placeholder } from './Placeholder/Placeholder';
|
|
15
16
|
import { ProductBlock } from './ProductBlock/ProductBlock';
|
|
@@ -44,4 +45,5 @@ export const Blocks = {
|
|
|
44
45
|
TariffsTable,
|
|
45
46
|
TextBlock,
|
|
46
47
|
Tile,
|
|
48
|
+
Navigation,
|
|
47
49
|
};
|
|
@@ -18,25 +18,38 @@
|
|
|
18
18
|
"type": "Header",
|
|
19
19
|
"style": ["-mx-20", "mb-5", "shadow-[0_8px_32px_0px_#00000014]"],
|
|
20
20
|
"content": {
|
|
21
|
-
"defaultLocation": "Москва"
|
|
22
|
-
"topItems": [
|
|
23
|
-
{
|
|
24
|
-
"href": "https://rshb.ru/",
|
|
25
|
-
"text": "Бизнес клиентам",
|
|
26
|
-
"target": "_blank"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"href": "https://rshb.ru/",
|
|
30
|
-
"text": "Частным клиентам",
|
|
31
|
-
"target": "_blank"
|
|
32
|
-
}
|
|
33
|
-
]
|
|
21
|
+
"defaultLocation": "Москва"
|
|
34
22
|
}
|
|
35
23
|
}
|
|
36
24
|
]
|
|
37
25
|
}
|
|
38
26
|
},
|
|
39
27
|
"blocks": [
|
|
28
|
+
{
|
|
29
|
+
"type": "Navigation",
|
|
30
|
+
"style": ["col-span-12"],
|
|
31
|
+
"content": {
|
|
32
|
+
"title": "Потребительский кредит наличными",
|
|
33
|
+
"buttons": [
|
|
34
|
+
{
|
|
35
|
+
"href": "/credits",
|
|
36
|
+
"text": "Оформить"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"href": "/tariffs",
|
|
40
|
+
"text": "Тарифы"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"href": "/harvest",
|
|
44
|
+
"text": "Урожай"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"href": "/faq",
|
|
48
|
+
"text": "Частые вопросы"
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
},
|
|
40
53
|
{
|
|
41
54
|
"type": "ProductGallery",
|
|
42
55
|
"style": ["col-span-12"],
|
|
@@ -1838,12 +1851,12 @@
|
|
|
1838
1851
|
{
|
|
1839
1852
|
"label": "Кредит по одному документу",
|
|
1840
1853
|
"description": "До 300 тыс ₽ по упрощённой процедуре получения кредита",
|
|
1841
|
-
"icon": "
|
|
1854
|
+
"icon": "DocumentTextIcon"
|
|
1842
1855
|
},
|
|
1843
1856
|
{
|
|
1844
1857
|
"label": "Кредит на общих условиях",
|
|
1845
1858
|
"description": "До 5 млн ₽ на общих условиях получения кредита",
|
|
1846
|
-
"icon": "
|
|
1859
|
+
"icon": "DiscountShapeIcon"
|
|
1847
1860
|
}
|
|
1848
1861
|
],
|
|
1849
1862
|
"image": {
|
|
@@ -72,12 +72,10 @@ export const CreditCalculator = JSX<CreditCalculatorProps>(
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
return (
|
|
75
|
-
<section className={`font-sans text-primary-text
|
|
76
|
-
<div
|
|
77
|
-
className={`box-border p-[49px] pr-[53px] flex flex-col justify-between ${borderStyle}`}
|
|
78
|
-
>
|
|
75
|
+
<section className={`font-sans text-primary-text p-10 bg-white ${className || ''}`}>
|
|
76
|
+
<div className={`box-border p-[49px] pr-[56px] mx-auto w-max ${borderStyle}`}>
|
|
79
77
|
<div className="flex justify-between ">
|
|
80
|
-
<div className="
|
|
78
|
+
<div className="mr-[42px]">
|
|
81
79
|
<InputRange
|
|
82
80
|
title="Желаемая сумма кредита, ₽"
|
|
83
81
|
items={[
|
|
@@ -115,7 +113,7 @@ export const CreditCalculator = JSX<CreditCalculatorProps>(
|
|
|
115
113
|
onChange={setIsInsuranceChecked}
|
|
116
114
|
/>
|
|
117
115
|
</div>
|
|
118
|
-
<div className="
|
|
116
|
+
<div className="box-border h-fit p-9 bg-primary-main rounded-md text-white">
|
|
119
117
|
<div className="text-base mb-[18px]">Наше предложение</div>
|
|
120
118
|
<div className="text-sm opacity-60">Ежемесячный платёж</div>
|
|
121
119
|
<div className="text-lg mb-3">
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useLink } from '../../hooks/useLink';
|
|
3
|
-
import { useSitemap } from '../../hooks/useSitemap';
|
|
4
|
-
import { mergeTopItems } from '../../mergeTopItems';
|
|
5
3
|
import type { LinkProps } from '../../model/LinkProps';
|
|
6
|
-
import
|
|
4
|
+
import { mergeTopItems } from '../../services/sitemap/mergeTopItems';
|
|
5
|
+
import type { TopMenuItem } from '../../services/sitemap/SitemapProps';
|
|
6
|
+
import { useSitemap } from '../../services/sitemap/useSitemap';
|
|
7
7
|
import type { UniBlockProps } from '../../types';
|
|
8
|
+
|
|
8
9
|
export interface SitemapProps extends UniBlockProps {
|
|
9
10
|
items?: TopMenuItem[];
|
|
10
11
|
}
|
|
@@ -1,21 +1,7 @@
|
|
|
1
1
|
import { context } from '../../setup-fixture';
|
|
2
2
|
import { Header } from './Header';
|
|
3
3
|
|
|
4
|
-
export default
|
|
5
|
-
<Header
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
topItems={[
|
|
9
|
-
{
|
|
10
|
-
href: 'https://rshb.ru/',
|
|
11
|
-
text: 'Бизнес клиентам',
|
|
12
|
-
target: '_blank',
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
href: 'https://rshb.ru/',
|
|
16
|
-
text: 'Частным клиентам',
|
|
17
|
-
target: '_blank',
|
|
18
|
-
},
|
|
19
|
-
]}
|
|
20
|
-
/>
|
|
21
|
-
);
|
|
4
|
+
export default {
|
|
5
|
+
default: <Header context={context} defaultLocation="Москва" />,
|
|
6
|
+
transparent: <Header context={context} defaultLocation="Москва" bgColor="transparent" />,
|
|
7
|
+
};
|
|
@@ -1,61 +1,72 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useLink } from '../../hooks/useLink';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import type { BgColorVersion } from '../../model/BgColorVersion';
|
|
4
|
+
import { findActiveSubItem } from '../../services/sitemap/findActiveSubItem';
|
|
5
|
+
import { isTopItemActive } from '../../services/sitemap/isTopItemActive';
|
|
6
|
+
import { mergeTopItems } from '../../services/sitemap/mergeTopItems';
|
|
7
|
+
import { useSitemap } from '../../services/sitemap/useSitemap';
|
|
5
8
|
import type { UniBlockProps } from '../../types';
|
|
6
9
|
import { HeaderItem } from '../../ui-kit/HeaderItem/HeaderItem';
|
|
7
10
|
import { Logo } from '../../ui-kit/Logo/Logo';
|
|
8
11
|
import { TopItem } from '../../ui-kit/TopItem/TopItem';
|
|
9
12
|
import type { HeaderContent } from './HeaderContent';
|
|
10
13
|
import { HeaderSecondaryMenu } from './HeaderSecondaryMenu';
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
|
|
15
|
+
const BORDER_COLORS: Record<BgColorVersion, string> = {
|
|
16
|
+
'bg-white': 'bg-main-divider',
|
|
17
|
+
transparent: 'bg-main-divider opacity-30',
|
|
18
|
+
};
|
|
13
19
|
|
|
14
20
|
export interface HeaderProps extends HeaderContent, UniBlockProps {}
|
|
15
21
|
|
|
16
|
-
export const Header = JSX<HeaderProps>(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
export const Header = JSX<HeaderProps>(
|
|
23
|
+
({ className, defaultLocation, bgColor = 'bg-white', context, topItems }) => {
|
|
24
|
+
const router = context.useRouter();
|
|
25
|
+
const sitemap = useSitemap(context.useAsyncData);
|
|
26
|
+
const { handlerDecorator } = context;
|
|
20
27
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
28
|
+
const mergedItems = mergeTopItems(sitemap.topItems, topItems);
|
|
29
|
+
const activeTopItem = mergedItems.find(isTopItemActive(router));
|
|
30
|
+
const subItems = activeTopItem?.items;
|
|
31
|
+
const activeSubItem = findActiveSubItem(router)(subItems);
|
|
25
32
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
const topMenu = mergedItems.map((_, i) => (
|
|
34
|
+
<TopItem
|
|
35
|
+
key={String(i)}
|
|
36
|
+
active={_ === activeTopItem}
|
|
37
|
+
{...useLink({ router, handlerDecorator }, _)}
|
|
38
|
+
ariaLabel={_.text}
|
|
39
|
+
bgColor={bgColor}
|
|
40
|
+
/>
|
|
41
|
+
));
|
|
34
42
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
const subMenu = subItems?.map((_) => (
|
|
44
|
+
<HeaderItem
|
|
45
|
+
key={_.href}
|
|
46
|
+
className="mr-8"
|
|
47
|
+
active={_ === activeSubItem}
|
|
48
|
+
{...useLink({ router, handlerDecorator }, _)}
|
|
49
|
+
bgColor={bgColor}
|
|
50
|
+
/>
|
|
51
|
+
));
|
|
43
52
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
return (
|
|
54
|
+
<header className={`pt-5 pb-8 px-20 ${bgColor} ${className || ''}`}>
|
|
55
|
+
<div className="container">
|
|
56
|
+
<div className="flex items-center">
|
|
57
|
+
<Logo className="mr-8" bgColor={bgColor} />
|
|
58
|
+
{topMenu}
|
|
59
|
+
<HeaderSecondaryMenu
|
|
60
|
+
context={context}
|
|
61
|
+
className="ml-auto"
|
|
62
|
+
defaultLocation={defaultLocation}
|
|
63
|
+
bgColor={bgColor}
|
|
64
|
+
/>
|
|
65
|
+
</div>
|
|
66
|
+
<div className={`mt-5 h-[1px] ${BORDER_COLORS[bgColor]}`} />
|
|
67
|
+
<nav className="mt-5">{subMenu}</nav>
|
|
55
68
|
</div>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
);
|
|
61
|
-
});
|
|
69
|
+
</header>
|
|
70
|
+
);
|
|
71
|
+
},
|
|
72
|
+
);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { BgColorVersion } from '../../model/BgColorVersion';
|
|
2
|
+
import type { SitemapProps } from '../../services/sitemap/SitemapProps';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* @title Шапка
|
|
@@ -10,4 +11,10 @@ export interface HeaderContent extends SitemapProps {
|
|
|
10
11
|
* @default Москва
|
|
11
12
|
*/
|
|
12
13
|
defaultLocation?: string;
|
|
14
|
+
/**
|
|
15
|
+
* @title Фон элемента
|
|
16
|
+
* @hidden
|
|
17
|
+
* @default white
|
|
18
|
+
*/
|
|
19
|
+
bgColor?: BgColorVersion;
|
|
13
20
|
}
|
|
@@ -1,20 +1,34 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import type { BgColorVersion } from '../../model/BgColorVersion';
|
|
2
3
|
import type { UniBlockProps } from '../../types';
|
|
3
4
|
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
5
|
+
import type { IconName } from '../../ui-kit/Icon/IconProps';
|
|
4
6
|
import { TopItem } from '../../ui-kit/TopItem/TopItem';
|
|
5
7
|
import { HeaderSecondaryMenuButton } from './HeaderSecondaryMenuButton';
|
|
6
8
|
|
|
7
9
|
interface HeaderSecondaryMenuContent {
|
|
8
10
|
defaultLocation?: string;
|
|
9
|
-
|
|
11
|
+
bgColor?: BgColorVersion;
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
export interface HeaderSecondaryMenuProps extends HeaderSecondaryMenuContent, UniBlockProps {}
|
|
13
15
|
|
|
16
|
+
const COLORS_MAP: Record<BgColorVersion, string> = {
|
|
17
|
+
'bg-white': 'text-primary-text hover:text-primary-main',
|
|
18
|
+
transparent: 'text-white',
|
|
19
|
+
};
|
|
20
|
+
const DOP_LINKS_COLORS_MAP: Record<BgColorVersion, string> = {
|
|
21
|
+
'bg-white': 'text-secondary-light hover:text-secondary-hover',
|
|
22
|
+
transparent: 'text-white',
|
|
23
|
+
};
|
|
24
|
+
const DOP_LINKS_ICON_NAME_MAP: Record<BgColorVersion, IconName> = {
|
|
25
|
+
'bg-white': 'GridIcon',
|
|
26
|
+
transparent: 'GridIconWhite',
|
|
27
|
+
};
|
|
28
|
+
|
|
14
29
|
export const HeaderSecondaryMenu = JSX<HeaderSecondaryMenuProps>(
|
|
15
|
-
({ context, className, defaultLocation = '' }) => {
|
|
30
|
+
({ context, className, defaultLocation = '', bgColor = 'bg-white' }) => {
|
|
16
31
|
const [city, getCity] = context.useGeolocation(defaultLocation);
|
|
17
|
-
|
|
18
32
|
return (
|
|
19
33
|
<div className={`flex items-center ${className || ''}`}>
|
|
20
34
|
<TopItem
|
|
@@ -24,6 +38,7 @@ export const HeaderSecondaryMenu = JSX<HeaderSecondaryMenuProps>(
|
|
|
24
38
|
text={city}
|
|
25
39
|
ariaLabel="Местоположение"
|
|
26
40
|
onClick={getCity}
|
|
41
|
+
bgColor={bgColor}
|
|
27
42
|
/>
|
|
28
43
|
<TopItem
|
|
29
44
|
className="mr-7"
|
|
@@ -31,24 +46,22 @@ export const HeaderSecondaryMenu = JSX<HeaderSecondaryMenuProps>(
|
|
|
31
46
|
href="#"
|
|
32
47
|
text="Офисы и банкоматы"
|
|
33
48
|
ariaLabel="Список всех доступных офисов и банкоматов"
|
|
49
|
+
bgColor={bgColor}
|
|
34
50
|
/>
|
|
35
51
|
<HeaderSecondaryMenuButton
|
|
36
|
-
className=
|
|
52
|
+
className={`mr-5 ${COLORS_MAP[bgColor]}`}
|
|
37
53
|
ariaLabel="Поиск по сайту"
|
|
38
54
|
>
|
|
39
|
-
<Icon name="LoupeIcon"
|
|
55
|
+
<Icon name="LoupeIcon" className="h-full" asSVG />
|
|
40
56
|
</HeaderSecondaryMenuButton>
|
|
41
|
-
<HeaderSecondaryMenuButton
|
|
42
|
-
className="
|
|
43
|
-
ariaLabel="Профиль"
|
|
44
|
-
>
|
|
45
|
-
<Icon name="ProfileIcon" aria-hidden="true" className="h-full" asSVG />
|
|
57
|
+
<HeaderSecondaryMenuButton className={`mr-5 ${COLORS_MAP[bgColor]}`} ariaLabel="Профиль">
|
|
58
|
+
<Icon name="ProfileIcon" className="h-full" asSVG />
|
|
46
59
|
</HeaderSecondaryMenuButton>
|
|
47
60
|
<HeaderSecondaryMenuButton
|
|
48
|
-
className=
|
|
61
|
+
className={`${DOP_LINKS_COLORS_MAP[bgColor]} min-w-[32px] min-h-[32px]`}
|
|
49
62
|
ariaLabel="Дополнительные ссылки"
|
|
50
63
|
>
|
|
51
|
-
<Icon name=
|
|
64
|
+
<Icon name={DOP_LINKS_ICON_NAME_MAP[bgColor]} className="h-full" asSVG />
|
|
52
65
|
</HeaderSecondaryMenuButton>
|
|
53
66
|
</div>
|
|
54
67
|
);
|
|
@@ -6,12 +6,10 @@ interface HeaderSecondaryMenuButtonProps {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
export const HeaderSecondaryMenuButton = JSX<HeaderSecondaryMenuButtonProps>(
|
|
9
|
-
({ className, children, ariaLabel }) => (
|
|
9
|
+
({ className = '', children, ariaLabel }) => (
|
|
10
10
|
<button
|
|
11
11
|
type="button"
|
|
12
|
-
className={`border-0 p-0 w-[24px] h-[24px] flex items-center bg-inherit cursor-pointer ${
|
|
13
|
-
className || ''
|
|
14
|
-
}`}
|
|
12
|
+
className={`border-0 p-0 w-[24px] h-[24px] flex items-center bg-inherit cursor-pointer ${className}`}
|
|
15
13
|
disabled={true}
|
|
16
14
|
aria-label={ariaLabel}
|
|
17
15
|
>
|
|
@@ -1,18 +1,10 @@
|
|
|
1
|
+
import type { BgColorVersion } from '../../model/BgColorVersion';
|
|
1
2
|
import type { BaseTileCommonProps } from '../BaseTile/BaseTileProps';
|
|
2
3
|
|
|
3
|
-
/**
|
|
4
|
-
* @title Цвет фона
|
|
5
|
-
* @enumNames [
|
|
6
|
-
* "Прозрачный",
|
|
7
|
-
* "Белый"
|
|
8
|
-
* ]
|
|
9
|
-
*/
|
|
10
|
-
export type HeadlineBgColor = 'transparent' | 'bg-white';
|
|
11
|
-
|
|
12
4
|
/**
|
|
13
5
|
* @title Заголовок
|
|
14
6
|
*/
|
|
15
7
|
export interface HeadlineContent
|
|
16
8
|
extends Pick<BaseTileCommonProps, 'title' | 'titleSize' | 'description' | 'align'> {
|
|
17
|
-
bgColor?:
|
|
9
|
+
bgColor?: BgColorVersion;
|
|
18
10
|
}
|
|
@@ -4,6 +4,7 @@ import { Gallery } from './Gallery/Gallery.mobile';
|
|
|
4
4
|
import { Header } from './Header/Header';
|
|
5
5
|
import { Headline } from './Headline/Headline';
|
|
6
6
|
import { MobileAppTile } from './MobileAppTile/MobileAppTile';
|
|
7
|
+
import { Navigation } from './Navigation/Navigation';
|
|
7
8
|
import { PictureText } from './PictureText/PictureText';
|
|
8
9
|
import { Placeholder } from './Placeholder/Placeholder';
|
|
9
10
|
import { ProductBlock } from './ProductBlock/ProductBlock.mobile';
|
|
@@ -24,4 +25,5 @@ export const MobileBlocks = {
|
|
|
24
25
|
ProductTile,
|
|
25
26
|
TextBlock,
|
|
26
27
|
Tile,
|
|
28
|
+
Navigation,
|
|
27
29
|
};
|