@redneckz/wildless-cms-uni-blocks 0.3.60 → 0.3.61
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 +8 -4
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/Header/Header.js +2 -2
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/Header/HeaderContent.d.ts +9 -0
- package/dist/ui-kit/Logo/Logo.d.ts +5 -0
- package/dist/ui-kit/Logo/Logo.js +7 -2
- package/dist/ui-kit/Logo/Logo.js.map +1 -1
- package/lib/components/Header/Header.js +2 -2
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/Header/HeaderContent.d.ts +9 -0
- package/lib/ui-kit/Logo/Logo.d.ts +5 -0
- package/lib/ui-kit/Logo/Logo.js +7 -2
- package/lib/ui-kit/Logo/Logo.js.map +1 -1
- package/mobile/dist/components/Header/HeaderContent.d.ts +9 -0
- package/mobile/lib/components/Header/HeaderContent.d.ts +9 -0
- package/mobile/src/components/Header/Header.example.json +5 -1
- package/mobile/src/components/Header/HeaderContent.ts +9 -0
- package/package.json +1 -1
- package/src/components/Header/Header.example.json +5 -1
- package/src/components/Header/Header.tsx +2 -1
- package/src/components/Header/HeaderContent.ts +9 -0
- package/src/ui-kit/Logo/Logo.tsx +31 -12
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
import type { Picture } from '../../model/Picture';
|
|
1
2
|
export interface LogoProps {
|
|
2
3
|
className: string;
|
|
3
4
|
href: string;
|
|
4
5
|
targetBlank: boolean;
|
|
5
6
|
bgColor?: string;
|
|
6
7
|
hideTitle?: boolean;
|
|
8
|
+
logo?: {
|
|
9
|
+
image?: Picture;
|
|
10
|
+
title?: string;
|
|
11
|
+
};
|
|
7
12
|
}
|
|
8
13
|
export declare const Logo: (props: import("@redneckz/uni-jsx").PropsWithChildren<Partial<LogoProps>, any>, context?: any) => any;
|
package/dist/ui-kit/Logo/Logo.js
CHANGED
|
@@ -3,6 +3,7 @@ exports.Logo = void 0;
|
|
|
3
3
|
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
4
|
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
5
|
const SVG_1 = require("../SVG");
|
|
6
|
+
const Img_1 = require("../Img/Img");
|
|
6
7
|
const LOGO_PATHS = [
|
|
7
8
|
'm13.72 25.51 4.42-4.33v-2.95l-4.42 4.32v2.96Zm0-10.98 4.42-4.35V7.41l-4.42 4.31v2.8Zm0 3.63 4.42-4.33v-2.78l-4.42 4.32v2.8ZM12.46 7.44l-.6-.56V0h-.66v6.22l-.58-.57V0h-.67v5l-.59-.58V0H8.7v6.56l4.44 4.33V0h-.67v7.44Zm1.26 14.35 4.42-4.33v-2.78L13.72 19v2.8Zm-5.03-.61 4.44 4.33v-2.96l-4.44-4.32v2.95Zm8.79-16.76-.59.58V0h-.66v5.66l-.6.56V0h-.66v6.87l-.58.57V0h-.67v10.9l4.42-4.34V0h-.66v4.42Zm-8.79 5.76 4.44 4.35v-2.8L8.69 7.4v2.77Zm0 3.65 4.44 4.33v-2.8l-4.44-4.3v2.77Zm0 3.63 4.44 4.33V19l-4.44-4.31v2.78Zm26.37 2.29H24.3a2.25 2.25 0 0 0 .36-1.22 2.32 2.32 0 0 0-2.33-2.31 2.32 2.32 0 0 0-2.31 2.31c0 .5.16.96.43 1.34a.74.74 0 0 0-.33.61c0 .26.14.49.33.62a2.32 2.32 0 0 0-.43 1.34 2.31 2.31 0 0 0 2.31 2.31 2.32 2.32 0 0 0 2.33-2.31c0-.45-.13-.87-.36-1.22h8.01v.49h-.8v.68h.8v.7h-.8v1.3h.8v-.58h1.17v.58h.79v-1.3h-.79v-.7h.79v-.68h-.79v-.5h1.58a.56.56 0 0 0 .56-.56v-.34a.57.57 0 0 0-.56-.56Zm-11.53 2.7a1.2 1.2 0 0 1-2.4 0c0-.24.08-.47.2-.66l.34-.56a.97.97 0 0 1-.34-.75c0-.3.13-.56.33-.74l-.32-.56a1.13 1.13 0 0 1-.2-.66 1.2 1.2 0 0 1 2.4 0c0 .49-.56 1.65-.56 1.65v.62c-.01.01.55 1.17.55 1.66ZM4.67 18.34v2.89c0 2.75 1.2 4.53 1.9 5.21l4.58 4.5c1.28 1.25 1.5 1.66 1.79 2.37v-3.2c0-2.84-1.44-3.94-2.19-4.67-1.73-1.68-2.89-2.8-3.82-3.73a8.98 8.98 0 0 1-2.26-3.37Zm6.08 14.24c-1.73-1.7-2.89-2.8-3.82-3.73a10 10 0 0 1-2.25-2.98v2.49a7.87 7.87 0 0 0 1.89 5.24l4.58 4.47c1.28 1.25 1.5 1.85 1.79 2.55v-3.37c0-2.85-1.45-3.95-2.19-4.67Z',
|
|
8
9
|
'M19.88 5.34c-.32 0-.64 0-.96.02V6.7a18.5 18.5 0 1 1 .95 36.94A18.5 18.5 0 0 1 1.35 25.17c0-5.67 2.55-10.73 6.58-14.13V9.32A19.78 19.78 0 0 0 0 25.17C0 36.12 8.9 45 19.88 45a19.85 19.85 0 0 0 19.86-19.83c0-10.95-8.9-19.83-19.87-19.83Z',
|
|
@@ -18,7 +19,11 @@ const TEXT_COLOR = {
|
|
|
18
19
|
'bg-white': 'text-black',
|
|
19
20
|
transparent: 'text-white',
|
|
20
21
|
};
|
|
21
|
-
exports.Logo = (0, uni_jsx_1.JSX)(({ className, href, children, targetBlank, bgColor = 'bg-white', hideTitle }) => {
|
|
22
|
-
return ((0, jsx_runtime_1.jsxs)("a", { className: `inline-flex items-center font-sans no-underline ${className
|
|
22
|
+
exports.Logo = (0, uni_jsx_1.JSX)(({ className = '', href, logo, children = logo?.title, targetBlank, bgColor = 'bg-white', hideTitle, }) => {
|
|
23
|
+
return ((0, jsx_runtime_1.jsxs)("a", { className: `inline-flex items-center font-sans no-underline ${className}`, href: href || 'https://rshb.ru/', target: targetBlank ? '_blank' : '_self', "aria-label": logo?.title || 'Россельхозбанк', children: [logo?.image?.src ? ((0, jsx_runtime_1.jsx)(Img_1.Img, { image: logo.image, className: SVG_COLOR[bgColor], width: "40", height: "45", asSVG: true })) : ((0, jsx_runtime_1.jsx)(SVG_1.SVG, { className: `${SVG_COLOR[bgColor]} w-10`, viewBox: "0 0 40 45", paths: LOGO_PATHS.map((d) => ({ d })) })), hideTitle ? null : renderTitle(children, bgColor, logo?.title)] }));
|
|
23
24
|
});
|
|
25
|
+
const renderTitle = (children, bgColor, title) => {
|
|
26
|
+
const text = children || title || 'Россельхозбанк';
|
|
27
|
+
return (0, jsx_runtime_1.jsx)("span", { className: `${TEXT_COLOR[bgColor]} font-medium ml-2.5`, children: text });
|
|
28
|
+
};
|
|
24
29
|
//# sourceMappingURL=Logo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logo.js","sourceRoot":"","sources":["../../../src/ui-kit/Logo/Logo.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAExC,gCAA6B;
|
|
1
|
+
{"version":3,"file":"Logo.js","sourceRoot":"","sources":["../../../src/ui-kit/Logo/Logo.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAExC,gCAA6B;AAC7B,oCAAiC;AAejC,MAAM,UAAU,GAAG;IACjB,w5CAAw5C;IACx5C,2OAA2O;IAC3O,0JAA0J;IAC1J,gpBAAgpB;IAChpB,kDAAkD;CACnD,CAAC;AACF,MAAM,SAAS,GAAmC;IAChD,UAAU,EAAE,mBAAmB;IAC/B,WAAW,EAAE,YAAY;CAC1B,CAAC;AACF,MAAM,UAAU,GAAmC;IACjD,UAAU,EAAE,YAAY;IACxB,WAAW,EAAE,YAAY;CAC1B,CAAC;AAEW,QAAA,IAAI,GAAG,IAAA,aAAG,EACrB,CAAC,EACC,SAAS,GAAG,EAAE,EACd,IAAI,EACJ,IAAI,EACJ,QAAQ,GAAG,IAAI,EAAE,KAAK,EACtB,WAAW,EACX,OAAO,GAAG,UAAU,EACpB,SAAS,GACV,EAAE,EAAE;IACH,OAAO,CACL,+BACE,SAAS,EAAE,mDAAmD,SAAS,EAAE,EACzE,IAAI,EAAE,IAAI,IAAI,kBAAkB,EAChC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,gBAC5B,IAAI,EAAE,KAAK,IAAI,gBAAgB,aAE1C,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAClB,uBAAC,SAAG,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,SAAS,EAAE,SAAS,CAAC,OAAO,CAAC,EAAE,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,KAAK,SAAG,CACvF,CAAC,CAAC,CAAC,CACF,uBAAC,SAAG,IACF,SAAS,EAAE,GAAG,SAAS,CAAC,OAAO,CAAC,OAAO,EACvC,OAAO,EAAC,WAAW,EACnB,KAAK,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GACrC,CACH,EACA,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAC7D,CACL,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;IAC/C,MAAM,IAAI,GAAG,QAAQ,IAAI,KAAK,IAAI,gBAAgB,CAAC;IACnD,OAAO,iCAAM,SAAS,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC,qBAAqB,YAAG,IAAI,GAAQ,CAAC;AACrF,CAAC,CAAC"}
|
|
@@ -12,13 +12,13 @@ const BORDER_COLORS = {
|
|
|
12
12
|
'bg-white': 'bg-main-divider',
|
|
13
13
|
transparent: 'bg-main-divider opacity-30',
|
|
14
14
|
};
|
|
15
|
-
export const Header = JSX(({ className = '', defaultLocation = 'Москва', showSubMenu = true, bgColor = 'bg-white', context, topItems, anchor = null, }) => {
|
|
15
|
+
export const Header = JSX(({ className = '', defaultLocation = 'Москва', showSubMenu = true, bgColor = 'bg-white', context, topItems, anchor = null, logo, }) => {
|
|
16
16
|
const router = context.useRouter();
|
|
17
17
|
const sitemap = useSitemap(context.useAsyncData);
|
|
18
18
|
const { handlerDecorator } = context;
|
|
19
19
|
const mergedItems = mergeTopItems(sitemap.topItems, topItems);
|
|
20
20
|
const activeTopItem = mergedItems.find(isTopItemActive(router));
|
|
21
21
|
const topMenu = mergedItems.map((_, i) => (_jsx(TopItem, { active: _ === activeTopItem, ...useLink({ router, handlerDecorator }, _), "aria-label": _.text, bgColor: bgColor }, String(i))));
|
|
22
|
-
return (_jsx("header", { className: `pt-6 pb-8 px-20 ${bgColor} ${className}`, id: anchor, children: _jsxs("div", { className: "container", children: [_jsxs("div", { className: "flex items-center", children: [_jsx(Logo, { className: "mr-8", bgColor: bgColor }), topMenu, _jsx(HeaderSecondaryMenu, { context: context, className: "ml-auto", defaultLocation: defaultLocation, bgColor: bgColor })] }), _jsx("div", { className: `mt-6 h-[1px] ${BORDER_COLORS[bgColor]}` }), showSubMenu && activeTopItem?.items?.length ? (_jsx(HeaderSubMenu, { context: context, subItems: activeTopItem.items, bgColor: bgColor })) : null] }) }));
|
|
22
|
+
return (_jsx("header", { className: `pt-6 pb-8 px-20 ${bgColor} ${className}`, id: anchor, children: _jsxs("div", { className: "container", children: [_jsxs("div", { className: "flex items-center", children: [_jsx(Logo, { className: "mr-8", bgColor: bgColor, logo: logo }), topMenu, _jsx(HeaderSecondaryMenu, { context: context, className: "ml-auto", defaultLocation: defaultLocation, bgColor: bgColor })] }), _jsx("div", { className: `mt-6 h-[1px] ${BORDER_COLORS[bgColor]}` }), showSubMenu && activeTopItem?.items?.length ? (_jsx(HeaderSubMenu, { context: context, subItems: activeTopItem.items, bgColor: bgColor })) : null] }) }));
|
|
23
23
|
});
|
|
24
24
|
//# sourceMappingURL=Header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../../src/components/Header/Header.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAE/D,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAEvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,aAAa,GAAmC;IACpD,UAAU,EAAE,iBAAiB;IAC7B,WAAW,EAAE,4BAA4B;CAC1C,CAAC;AAIF,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CACvB,CAAC,EACC,SAAS,GAAG,EAAE,EACd,eAAe,GAAG,QAAQ,EAC1B,WAAW,GAAG,IAAI,EAClB,OAAO,GAAG,UAAU,EACpB,OAAO,EACP,QAAQ,EACR,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../../src/components/Header/Header.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAE/D,OAAO,EAAE,IAAI,EAAE,MAAM,wBA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,YACtE,eAAK,SAAS,EAAC,WAAW,aACxB,eAAK,SAAS,EAAC,mBAAmB,aAChC,KAAC,IAAI,IAAC,SAAS,EAAC,MAAM,EAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,GAAI,EACtD,OAAO,EACR,KAAC,mBAAmB,IAClB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAC,SAAS,EACnB,eAAe,EAAE,eAAe,EAChC,OAAO,EAAE,OAAO,GAChB,IACE,EACN,cAAK,SAAS,EAAE,gBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,GAAI,EAC3D,WAAW,IAAI,aAAa,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAC7C,KAAC,aAAa,IAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,GAAI,CACrF,CAAC,CAAC,CAAC,IAAI,IACJ,GACC,CACV,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -21,6 +21,15 @@ export interface DispositionItem extends LinkProps {
|
|
|
21
21
|
* @required ["defaultLocation", "topItems"]
|
|
22
22
|
*/
|
|
23
23
|
export interface HeaderContent extends SitemapProps {
|
|
24
|
+
/** @title Логотип */
|
|
25
|
+
logo?: {
|
|
26
|
+
/** @title Иконка логотипа */
|
|
27
|
+
image?: Picture;
|
|
28
|
+
/**
|
|
29
|
+
* @title Текст логотипа
|
|
30
|
+
*/
|
|
31
|
+
title?: string;
|
|
32
|
+
};
|
|
24
33
|
/**
|
|
25
34
|
* @title Город по-умолчанию
|
|
26
35
|
* @default Москва
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
import type { Picture } from '../../model/Picture';
|
|
1
2
|
export interface LogoProps {
|
|
2
3
|
className: string;
|
|
3
4
|
href: string;
|
|
4
5
|
targetBlank: boolean;
|
|
5
6
|
bgColor?: string;
|
|
6
7
|
hideTitle?: boolean;
|
|
8
|
+
logo?: {
|
|
9
|
+
image?: Picture;
|
|
10
|
+
title?: string;
|
|
11
|
+
};
|
|
7
12
|
}
|
|
8
13
|
export declare const Logo: (props: import("@redneckz/uni-jsx").PropsWithChildren<Partial<LogoProps>, any>, context?: any) => any;
|
package/lib/ui-kit/Logo/Logo.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
3
|
import { SVG } from '../SVG.js';
|
|
4
|
+
import { Img } from '../Img/Img.js';
|
|
4
5
|
const LOGO_PATHS = [
|
|
5
6
|
'm13.72 25.51 4.42-4.33v-2.95l-4.42 4.32v2.96Zm0-10.98 4.42-4.35V7.41l-4.42 4.31v2.8Zm0 3.63 4.42-4.33v-2.78l-4.42 4.32v2.8ZM12.46 7.44l-.6-.56V0h-.66v6.22l-.58-.57V0h-.67v5l-.59-.58V0H8.7v6.56l4.44 4.33V0h-.67v7.44Zm1.26 14.35 4.42-4.33v-2.78L13.72 19v2.8Zm-5.03-.61 4.44 4.33v-2.96l-4.44-4.32v2.95Zm8.79-16.76-.59.58V0h-.66v5.66l-.6.56V0h-.66v6.87l-.58.57V0h-.67v10.9l4.42-4.34V0h-.66v4.42Zm-8.79 5.76 4.44 4.35v-2.8L8.69 7.4v2.77Zm0 3.65 4.44 4.33v-2.8l-4.44-4.3v2.77Zm0 3.63 4.44 4.33V19l-4.44-4.31v2.78Zm26.37 2.29H24.3a2.25 2.25 0 0 0 .36-1.22 2.32 2.32 0 0 0-2.33-2.31 2.32 2.32 0 0 0-2.31 2.31c0 .5.16.96.43 1.34a.74.74 0 0 0-.33.61c0 .26.14.49.33.62a2.32 2.32 0 0 0-.43 1.34 2.31 2.31 0 0 0 2.31 2.31 2.32 2.32 0 0 0 2.33-2.31c0-.45-.13-.87-.36-1.22h8.01v.49h-.8v.68h.8v.7h-.8v1.3h.8v-.58h1.17v.58h.79v-1.3h-.79v-.7h.79v-.68h-.79v-.5h1.58a.56.56 0 0 0 .56-.56v-.34a.57.57 0 0 0-.56-.56Zm-11.53 2.7a1.2 1.2 0 0 1-2.4 0c0-.24.08-.47.2-.66l.34-.56a.97.97 0 0 1-.34-.75c0-.3.13-.56.33-.74l-.32-.56a1.13 1.13 0 0 1-.2-.66 1.2 1.2 0 0 1 2.4 0c0 .49-.56 1.65-.56 1.65v.62c-.01.01.55 1.17.55 1.66ZM4.67 18.34v2.89c0 2.75 1.2 4.53 1.9 5.21l4.58 4.5c1.28 1.25 1.5 1.66 1.79 2.37v-3.2c0-2.84-1.44-3.94-2.19-4.67-1.73-1.68-2.89-2.8-3.82-3.73a8.98 8.98 0 0 1-2.26-3.37Zm6.08 14.24c-1.73-1.7-2.89-2.8-3.82-3.73a10 10 0 0 1-2.25-2.98v2.49a7.87 7.87 0 0 0 1.89 5.24l4.58 4.47c1.28 1.25 1.5 1.85 1.79 2.55v-3.37c0-2.85-1.45-3.95-2.19-4.67Z',
|
|
6
7
|
'M19.88 5.34c-.32 0-.64 0-.96.02V6.7a18.5 18.5 0 1 1 .95 36.94A18.5 18.5 0 0 1 1.35 25.17c0-5.67 2.55-10.73 6.58-14.13V9.32A19.78 19.78 0 0 0 0 25.17C0 36.12 8.9 45 19.88 45a19.85 19.85 0 0 0 19.86-19.83c0-10.95-8.9-19.83-19.87-19.83Z',
|
|
@@ -16,7 +17,11 @@ const TEXT_COLOR = {
|
|
|
16
17
|
'bg-white': 'text-black',
|
|
17
18
|
transparent: 'text-white',
|
|
18
19
|
};
|
|
19
|
-
export const Logo = JSX(({ className, href, children, targetBlank, bgColor = 'bg-white', hideTitle }) => {
|
|
20
|
-
return (_jsxs("a", { className: `inline-flex items-center font-sans no-underline ${className
|
|
20
|
+
export const Logo = JSX(({ className = '', href, logo, children = logo?.title, targetBlank, bgColor = 'bg-white', hideTitle, }) => {
|
|
21
|
+
return (_jsxs("a", { className: `inline-flex items-center font-sans no-underline ${className}`, href: href || 'https://rshb.ru/', target: targetBlank ? '_blank' : '_self', "aria-label": logo?.title || 'Россельхозбанк', children: [logo?.image?.src ? (_jsx(Img, { image: logo.image, className: SVG_COLOR[bgColor], width: "40", height: "45", asSVG: true })) : (_jsx(SVG, { className: `${SVG_COLOR[bgColor]} w-10`, viewBox: "0 0 40 45", paths: LOGO_PATHS.map((d) => ({ d })) })), hideTitle ? null : renderTitle(children, bgColor, logo?.title)] }));
|
|
21
22
|
});
|
|
23
|
+
const renderTitle = (children, bgColor, title) => {
|
|
24
|
+
const text = children || title || 'Россельхозбанк';
|
|
25
|
+
return _jsx("span", { className: `${TEXT_COLOR[bgColor]} font-medium ml-2.5`, children: text });
|
|
26
|
+
};
|
|
22
27
|
//# sourceMappingURL=Logo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logo.js","sourceRoot":"","sources":["../../../src/ui-kit/Logo/Logo.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"Logo.js","sourceRoot":"","sources":["../../../src/ui-kit/Logo/Logo.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAC7B,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAejC,MAAM,UAAU,GAAG;IACjB,w5CAAw5C;IACx5C,2OAA2O;IAC3O,0JAA0J;IAC1J,gpBAAgpB;IAChpB,kDAAkD;CACnD,CAAC;AACF,MAAM,SAAS,GAAmC;IAChD,UAAU,EAAE,mBAAmB;IAC/B,WAAW,EAAE,YAAY;CAC1B,CAAC;AACF,MAAM,UAAU,GAAmC;IACjD,UAAU,EAAE,YAAY;IACxB,WAAW,EAAE,YAAY;CAC1B,CAAC;AAEF,MAAM,CAAC,MAAM,IAA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,CAAC"}
|
|
@@ -21,6 +21,15 @@ export interface DispositionItem extends LinkProps {
|
|
|
21
21
|
* @required ["defaultLocation", "topItems"]
|
|
22
22
|
*/
|
|
23
23
|
export interface HeaderContent extends SitemapProps {
|
|
24
|
+
/** @title Логотип */
|
|
25
|
+
logo?: {
|
|
26
|
+
/** @title Иконка логотипа */
|
|
27
|
+
image?: Picture;
|
|
28
|
+
/**
|
|
29
|
+
* @title Текст логотипа
|
|
30
|
+
*/
|
|
31
|
+
title?: string;
|
|
32
|
+
};
|
|
24
33
|
/**
|
|
25
34
|
* @title Город по-умолчанию
|
|
26
35
|
* @default Москва
|
|
@@ -21,6 +21,15 @@ export interface DispositionItem extends LinkProps {
|
|
|
21
21
|
* @required ["defaultLocation", "topItems"]
|
|
22
22
|
*/
|
|
23
23
|
export interface HeaderContent extends SitemapProps {
|
|
24
|
+
/** @title Логотип */
|
|
25
|
+
logo?: {
|
|
26
|
+
/** @title Иконка логотипа */
|
|
27
|
+
image?: Picture;
|
|
28
|
+
/**
|
|
29
|
+
* @title Текст логотипа
|
|
30
|
+
*/
|
|
31
|
+
title?: string;
|
|
32
|
+
};
|
|
24
33
|
/**
|
|
25
34
|
* @title Город по-умолчанию
|
|
26
35
|
* @default Москва
|
|
@@ -24,6 +24,15 @@ export interface DispositionItem extends LinkProps {
|
|
|
24
24
|
* @required ["defaultLocation", "topItems"]
|
|
25
25
|
*/
|
|
26
26
|
export interface HeaderContent extends SitemapProps {
|
|
27
|
+
/** @title Логотип */
|
|
28
|
+
logo?: {
|
|
29
|
+
/** @title Иконка логотипа */
|
|
30
|
+
image?: Picture;
|
|
31
|
+
/**
|
|
32
|
+
* @title Текст логотипа
|
|
33
|
+
*/
|
|
34
|
+
title?: string;
|
|
35
|
+
};
|
|
27
36
|
/**
|
|
28
37
|
* @title Город по-умолчанию
|
|
29
38
|
* @default Москва
|
package/package.json
CHANGED
|
@@ -27,6 +27,7 @@ export const Header = JSX<HeaderProps>(
|
|
|
27
27
|
context,
|
|
28
28
|
topItems,
|
|
29
29
|
anchor = null,
|
|
30
|
+
logo,
|
|
30
31
|
}) => {
|
|
31
32
|
const router = context.useRouter();
|
|
32
33
|
const sitemap = useSitemap(context.useAsyncData);
|
|
@@ -49,7 +50,7 @@ export const Header = JSX<HeaderProps>(
|
|
|
49
50
|
<header className={`pt-6 pb-8 px-20 ${bgColor} ${className}`} id={anchor}>
|
|
50
51
|
<div className="container">
|
|
51
52
|
<div className="flex items-center">
|
|
52
|
-
<Logo className="mr-8" bgColor={bgColor} />
|
|
53
|
+
<Logo className="mr-8" bgColor={bgColor} logo={logo} />
|
|
53
54
|
{topMenu}
|
|
54
55
|
<HeaderSecondaryMenu
|
|
55
56
|
context={context}
|
|
@@ -24,6 +24,15 @@ export interface DispositionItem extends LinkProps {
|
|
|
24
24
|
* @required ["defaultLocation", "topItems"]
|
|
25
25
|
*/
|
|
26
26
|
export interface HeaderContent extends SitemapProps {
|
|
27
|
+
/** @title Логотип */
|
|
28
|
+
logo?: {
|
|
29
|
+
/** @title Иконка логотипа */
|
|
30
|
+
image?: Picture;
|
|
31
|
+
/**
|
|
32
|
+
* @title Текст логотипа
|
|
33
|
+
*/
|
|
34
|
+
title?: string;
|
|
35
|
+
};
|
|
27
36
|
/**
|
|
28
37
|
* @title Город по-умолчанию
|
|
29
38
|
* @default Москва
|
package/src/ui-kit/Logo/Logo.tsx
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { BgColorVersion } from '../../model/BgColorVersion';
|
|
3
3
|
import { SVG } from '../SVG';
|
|
4
|
+
import { Img } from '../Img/Img';
|
|
5
|
+
import type { Picture } from '../../model/Picture';
|
|
4
6
|
|
|
5
7
|
export interface LogoProps {
|
|
6
8
|
className: string;
|
|
@@ -8,6 +10,10 @@ export interface LogoProps {
|
|
|
8
10
|
targetBlank: boolean;
|
|
9
11
|
bgColor?: string;
|
|
10
12
|
hideTitle?: boolean;
|
|
13
|
+
logo?: {
|
|
14
|
+
image?: Picture;
|
|
15
|
+
title?: string;
|
|
16
|
+
};
|
|
11
17
|
}
|
|
12
18
|
|
|
13
19
|
const LOGO_PATHS = [
|
|
@@ -27,25 +33,38 @@ const TEXT_COLOR: Record<BgColorVersion, string> = {
|
|
|
27
33
|
};
|
|
28
34
|
|
|
29
35
|
export const Logo = JSX<Partial<LogoProps>>(
|
|
30
|
-
({
|
|
36
|
+
({
|
|
37
|
+
className = '',
|
|
38
|
+
href,
|
|
39
|
+
logo,
|
|
40
|
+
children = logo?.title,
|
|
41
|
+
targetBlank,
|
|
42
|
+
bgColor = 'bg-white',
|
|
43
|
+
hideTitle,
|
|
44
|
+
}) => {
|
|
31
45
|
return (
|
|
32
46
|
<a
|
|
33
|
-
className={`inline-flex items-center font-sans no-underline ${className
|
|
47
|
+
className={`inline-flex items-center font-sans no-underline ${className}`}
|
|
34
48
|
href={href || 'https://rshb.ru/'}
|
|
35
49
|
target={targetBlank ? '_blank' : '_self'}
|
|
36
|
-
aria-label=
|
|
50
|
+
aria-label={logo?.title || 'Россельхозбанк'}
|
|
37
51
|
>
|
|
38
|
-
|
|
39
|
-
className={
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
</span>
|
|
52
|
+
{logo?.image?.src ? (
|
|
53
|
+
<Img image={logo.image} className={SVG_COLOR[bgColor]} width="40" height="45" asSVG />
|
|
54
|
+
) : (
|
|
55
|
+
<SVG
|
|
56
|
+
className={`${SVG_COLOR[bgColor]} w-10`}
|
|
57
|
+
viewBox="0 0 40 45"
|
|
58
|
+
paths={LOGO_PATHS.map((d) => ({ d }))}
|
|
59
|
+
/>
|
|
47
60
|
)}
|
|
61
|
+
{hideTitle ? null : renderTitle(children, bgColor, logo?.title)}
|
|
48
62
|
</a>
|
|
49
63
|
);
|
|
50
64
|
},
|
|
51
65
|
);
|
|
66
|
+
|
|
67
|
+
const renderTitle = (children, bgColor, title) => {
|
|
68
|
+
const text = children || title || 'Россельхозбанк';
|
|
69
|
+
return <span className={`${TEXT_COLOR[bgColor]} font-medium ml-2.5`}>{text}</span>;
|
|
70
|
+
};
|