@mrktg-common/internal-ui 1.5.1 → 1.6.0
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/dist/Header.d.ts +14 -6
- package/dist/Header.js +3 -3
- package/dist/components.css +2 -0
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
- package/tokens/tokens.json +1 -1
package/dist/Header.d.ts
CHANGED
|
@@ -12,10 +12,16 @@ export type TLinkProps = {
|
|
|
12
12
|
/** Ссылка роутера продукта (react-router, next/link); по умолчанию обычный <a>. */
|
|
13
13
|
export type TLinkComponent = (props: TLinkProps) => ReactNode;
|
|
14
14
|
export declare const PlainLink: TLinkComponent;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
/** Иконка плитки: globe у админки, blocks у конструктора. */
|
|
15
|
+
/** Знак продукта: иконка lucide на акцентной плитке или собственный знак продукта (26 px, без плитки). */
|
|
16
|
+
export type TProductMark = {
|
|
18
17
|
productIcon: LucideIcon;
|
|
18
|
+
productMark?: never;
|
|
19
|
+
} | {
|
|
20
|
+
productMark: ReactNode;
|
|
21
|
+
productIcon?: never;
|
|
22
|
+
};
|
|
23
|
+
type THeaderBaseProps = {
|
|
24
|
+
productName: string;
|
|
19
25
|
homeHref: string;
|
|
20
26
|
link?: TLinkComponent;
|
|
21
27
|
/** Только плитка без названия (редактор): название уходит в aria-label ссылки. */
|
|
@@ -29,9 +35,10 @@ export interface IHeaderProps {
|
|
|
29
35
|
/** Справа: кнопка пользователя с меню. */
|
|
30
36
|
end?: ReactNode;
|
|
31
37
|
className?: string;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
};
|
|
39
|
+
export type IHeaderProps = THeaderBaseProps & TProductMark;
|
|
40
|
+
/** Шапка 56 px: знак и название продукта, слот продукта, справа пользователь. */
|
|
41
|
+
export declare function Header({ productName, productIcon: Icon, productMark, homeHref, link: Link, compact, homeLabel, dev, children, end, className }: IHeaderProps): import("react").JSX.Element;
|
|
35
42
|
export type TNavItem = {
|
|
36
43
|
href: string;
|
|
37
44
|
label: string;
|
|
@@ -44,3 +51,4 @@ export declare function HeaderNav({ items, link: Link, 'aria-label': label }: {
|
|
|
44
51
|
link?: TLinkComponent;
|
|
45
52
|
'aria-label'?: string;
|
|
46
53
|
}): import("react").JSX.Element;
|
|
54
|
+
export {};
|
package/dist/Header.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cx } from './cx.js';
|
|
3
3
|
export const PlainLink = ({ href, children, ...rest }) => (_jsx("a", { href: href, ...rest, children: children }));
|
|
4
|
-
/** Шапка 56 px:
|
|
5
|
-
export function Header({ productName, productIcon: Icon, homeHref, link: Link = PlainLink, compact = false, homeLabel, dev = false, children, end, className }) {
|
|
6
|
-
return (_jsxs("header", { className: cx('hdr', dev && 'hdr-dev', className), children: [_jsxs("div", { className: "hdr-left", children: [_jsxs(Link, { href: homeHref, className: "logo", "aria-label": compact ? (homeLabel ?? productName) : undefined, children: [_jsx("span", { className: "logo-mark", children: _jsx(Icon, { className: "ic ic-sm", "aria-hidden": true }) }), !compact && productName] }), children] }), end !== undefined && _jsx("div", { className: "hdr-right", children: end })] }));
|
|
4
|
+
/** Шапка 56 px: знак и название продукта, слот продукта, справа пользователь. */
|
|
5
|
+
export function Header({ productName, productIcon: Icon, productMark, homeHref, link: Link = PlainLink, compact = false, homeLabel, dev = false, children, end, className }) {
|
|
6
|
+
return (_jsxs("header", { className: cx('hdr', dev && 'hdr-dev', className), children: [_jsxs("div", { className: "hdr-left", children: [_jsxs(Link, { href: homeHref, className: "logo", "aria-label": compact ? (homeLabel ?? productName) : undefined, children: [Icon !== undefined ? (_jsx("span", { className: "logo-mark", children: _jsx(Icon, { className: "ic ic-sm", "aria-hidden": true }) })) : (_jsx("span", { className: "logo-img", "aria-hidden": true, children: productMark })), !compact && productName] }), children] }), end !== undefined && _jsx("div", { className: "hdr-right", children: end })] }));
|
|
7
7
|
}
|
|
8
8
|
/** Разделы продукта в шапке; текущий — aria-current="page". */
|
|
9
9
|
export function HeaderNav({ items, link: Link = PlainLink, 'aria-label': label = 'Sections' }) {
|
package/dist/components.css
CHANGED
|
@@ -46,6 +46,8 @@
|
|
|
46
46
|
.app a.logo:hover, .app a.logo.is-hover { color: var(--accent-text); text-decoration: none; }
|
|
47
47
|
.app a.logo:focus-visible, .app a.logo.is-focus { outline: none; box-shadow: var(--focus-ring); }
|
|
48
48
|
.logo-mark { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: var(--radius-md); background: var(--accent); color: var(--accent-contrast); }
|
|
49
|
+
.logo-img { display: flex; width: 26px; height: 26px; flex-shrink: 0; }
|
|
50
|
+
.logo-img > img, .logo-img > svg { display: block; width: 100%; height: 100%; }
|
|
49
51
|
.nav { display: flex; align-items: center; gap: 2px; margin-left: var(--space-3); }
|
|
50
52
|
.nav a { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 var(--space-3); border-radius: var(--radius-md); font-size: var(--text-md); font-weight: 500; white-space: nowrap; }
|
|
51
53
|
.app .nav a { color: var(--text-muted); text-decoration: none; }
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { ThemeProvider, useTheme, localThemeStorage, resolveTheme } from './them
|
|
|
4
4
|
export { themeScript, isThemeChoice, THEME_STORAGE_KEY } from './themeScript.ts';
|
|
5
5
|
export type { TThemeChoice, TResolvedTheme, IThemeStorage, TThemeApi } from './theme.tsx';
|
|
6
6
|
export { Header, HeaderNav } from './Header.tsx';
|
|
7
|
-
export type { IHeaderProps, TLinkProps, TLinkComponent, TNavItem } from './Header.tsx';
|
|
7
|
+
export type { IHeaderProps, TLinkProps, TLinkComponent, TNavItem, TProductMark } from './Header.tsx';
|
|
8
8
|
export { Breadcrumbs } from './Breadcrumbs.tsx';
|
|
9
9
|
export type { IBreadcrumbsProps, TCrumb } from './Breadcrumbs.tsx';
|
|
10
10
|
export { UserMenu, initials } from './UserMenu.tsx';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrktg-common/internal-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Общий интерфейс внутренних инструментов маркетинга (Landings Admin, LP Constructor): токены, классы компонентов и тонкие React-обёртки над ними.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|