@axa-fr/design-system-look-and-feel-react 0.2.0-beta.364 → 0.2.0-beta.365
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/Title/Title.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { type ReactNode } from "react";
|
2
|
-
import { TitleSize } from "./constants";
|
2
|
+
import { TitleSize, TitleLevel } from "./constants";
|
3
3
|
type TitleProps = {
|
4
4
|
children: ReactNode;
|
5
5
|
firstSubtitle?: string;
|
@@ -8,6 +8,7 @@ type TitleProps = {
|
|
8
8
|
className?: string;
|
9
9
|
classModifier?: string;
|
10
10
|
size?: TitleSize;
|
11
|
+
level?: TitleLevel;
|
11
12
|
};
|
12
|
-
export declare const Title: ({ children: title, className, classModifier, firstSubtitle, icon, secondSubtitle, size, }: TitleProps) => import("react/jsx-runtime").JSX.Element;
|
13
|
+
export declare const Title: ({ children: title, className, classModifier, firstSubtitle, icon, secondSubtitle, size, level, }: TitleProps) => import("react/jsx-runtime").JSX.Element;
|
13
14
|
export {};
|
package/dist/Title/Title.js
CHANGED
@@ -4,8 +4,8 @@ import { IconBg } from "..";
|
|
4
4
|
import { getComponentClassName } from "../utilities";
|
5
5
|
import { TitleSize } from "./constants";
|
6
6
|
import { TitleWithSubtitles } from "./TitleWithSubtitles";
|
7
|
-
export const Title = ({ children: title, className, classModifier, firstSubtitle, icon, secondSubtitle, size = TitleSize.XL, }) => {
|
7
|
+
export const Title = ({ children: title, className, classModifier, firstSubtitle, icon, secondSubtitle, size = TitleSize.XL, level = size === TitleSize.L ? 2 : 1, }) => {
|
8
8
|
const componentClassName = useMemo(() => getComponentClassName(className, classModifier ? `${classModifier} ${size}` : size, "af-title"), [classModifier, className, size]);
|
9
9
|
const TitleWithSubtitlesPart = useCallback(({ ...args }) => (_jsx(TitleWithSubtitles, { title: title, firstSubtitle: firstSubtitle, ...args })), [title, firstSubtitle]);
|
10
|
-
return (_jsx("div", { className: componentClassName, children: icon && size === TitleSize.XL ? (_jsxs(_Fragment, { children: [_jsx(IconBg, { className: "af-title__icon af-icon-bg", children: icon }), _jsx("div", { className: "af-title__text-container", children: _jsx(TitleWithSubtitlesPart, { secondSubtitle: secondSubtitle }) })] })) : (_jsx(TitleWithSubtitlesPart, {})) }));
|
10
|
+
return (_jsx("div", { className: componentClassName, children: icon && size === TitleSize.XL ? (_jsxs(_Fragment, { children: [_jsx(IconBg, { className: "af-title__icon af-icon-bg", children: icon }), _jsx("div", { className: "af-title__text-container", children: _jsx(TitleWithSubtitlesPart, { secondSubtitle: secondSubtitle, level: level }) })] })) : (_jsx(TitleWithSubtitlesPart, { level: level })) }));
|
11
11
|
};
|
@@ -1,8 +1,10 @@
|
|
1
|
-
import type
|
1
|
+
import { type ReactNode } from "react";
|
2
|
+
import { TitleLevel } from "./constants";
|
2
3
|
type TitleTextProps = {
|
3
4
|
title: ReactNode;
|
4
5
|
firstSubtitle?: string;
|
5
6
|
secondSubtitle?: string;
|
7
|
+
level?: TitleLevel;
|
6
8
|
};
|
7
|
-
export declare const TitleWithSubtitles: ({ title, firstSubtitle, secondSubtitle, }: TitleTextProps) => import("react/jsx-runtime").JSX.Element;
|
9
|
+
export declare const TitleWithSubtitles: ({ title, firstSubtitle, secondSubtitle, level, }: TitleTextProps) => import("react/jsx-runtime").JSX.Element;
|
8
10
|
export {};
|
@@ -1,2 +1,6 @@
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
-
|
2
|
+
import { useMemo } from "react";
|
3
|
+
export const TitleWithSubtitles = ({ title, firstSubtitle, secondSubtitle, level = 1, }) => {
|
4
|
+
const HLevel = useMemo(() => `h${level}`, [level]);
|
5
|
+
return (_jsxs(_Fragment, { children: [_jsx(HLevel, { className: "af-title__title", children: title }), firstSubtitle && (_jsx("span", { className: "af-title__subtitle", children: firstSubtitle })), secondSubtitle && (_jsx("span", { className: "af-title__subtitle", children: secondSubtitle }))] }));
|
6
|
+
};
|
package/dist/Title/index.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
@@ -27,4 +27,4 @@ export { Stepper } from "./Stepper/Stepper";
|
|
27
27
|
export { Svg } from "./Svg";
|
28
28
|
export { TabsClient as Tabs } from "./Tabs/Tabs";
|
29
29
|
export { Tag } from "./Tag";
|
30
|
-
export { Title, TitleSize } from "./Title";
|
30
|
+
export { Title, TitleSize, type TitleLevel } from "./Title";
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@axa-fr/design-system-look-and-feel-react",
|
3
|
-
"version": "0.2.0-beta.
|
3
|
+
"version": "0.2.0-beta.365",
|
4
4
|
"description": "",
|
5
5
|
"exports": {
|
6
6
|
".": {
|
@@ -41,7 +41,7 @@
|
|
41
41
|
},
|
42
42
|
"homepage": "https://github.com/AxaFrance/design-system#readme",
|
43
43
|
"peerDependencies": {
|
44
|
-
"@axa-fr/design-system-look-and-feel-css": "0.2.0-beta.
|
44
|
+
"@axa-fr/design-system-look-and-feel-css": "0.2.0-beta.365",
|
45
45
|
"@material-symbols/svg-400": ">= 0.19.0",
|
46
46
|
"react": ">= 18"
|
47
47
|
},
|