@axa-fr/canopee-react 1.2.1-alpha.22 → 1.2.1-alpha.24
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/prospect-client/ContentItemMono/ContentItemMonoCommon.d.ts +3 -3
- package/dist/prospect-client/ContentItemMono/ContentItemMonoCore.d.ts +9 -3
- package/dist/prospect-client/ContentItemMono/ContentItemMonoCore.js +1 -1
- package/dist/prospect-client/ProgressBar/ProgressBarCommon.d.ts +2 -1
- package/dist/prospect-client/ProgressBar/ProgressBarCommon.js +8 -3
- package/dist/prospect-client/utilities/types/AtLeastOne.d.ts +3 -0
- package/dist/prospect-client/utilities/types/AtLeastOne.js +1 -0
- package/package.json +2 -2
|
@@ -11,14 +11,14 @@ export type ContentMonoItemPictureProps = {
|
|
|
11
11
|
};
|
|
12
12
|
export type ContentMonoItemIconProps = {
|
|
13
13
|
type: "icon";
|
|
14
|
+
title?: string;
|
|
15
|
+
subtitle1?: string;
|
|
16
|
+
subtitle2?: string;
|
|
14
17
|
/**
|
|
15
18
|
* @deprecated Use `iconProps` instead.
|
|
16
19
|
*/
|
|
17
20
|
icon?: string;
|
|
18
21
|
iconProps?: IconProps;
|
|
19
|
-
title: string;
|
|
20
|
-
subtitle1?: string;
|
|
21
|
-
subtitle2?: string;
|
|
22
22
|
};
|
|
23
23
|
export type ContentMonoItemStickProps = {
|
|
24
24
|
type: "stick";
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { AtLeastOne } from "../utilities/types/AtLeastOne";
|
|
1
3
|
export type ContentMonoItemSize = "medium" | "large";
|
|
2
|
-
|
|
3
|
-
size?: ContentMonoItemSize;
|
|
4
|
+
type TextFields = {
|
|
4
5
|
title?: string;
|
|
5
6
|
primarySubtitle?: string;
|
|
6
7
|
subtitle?: string;
|
|
7
|
-
leftComponent?: React.ReactNode;
|
|
8
8
|
};
|
|
9
|
+
type AtLeastOneText = AtLeastOne<TextFields>;
|
|
10
|
+
export type ContentItemCoreProps = {
|
|
11
|
+
size?: ContentMonoItemSize;
|
|
12
|
+
leftComponent?: ReactNode;
|
|
13
|
+
} & AtLeastOneText;
|
|
9
14
|
export declare const ContentItemMonoCore: ({ size, leftComponent, title, primarySubtitle, subtitle, }: ContentItemCoreProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
export const ContentItemMonoCore = ({ size = "medium", leftComponent, title, primarySubtitle, subtitle, }) => {
|
|
3
|
-
return (_jsxs("div", { "data-testid": "container", className: `af-content-item-mono ${size}`, children: [leftComponent, _jsxs("div", { className: "text-content", children: [_jsx("span", { className: "title", children: title }), primarySubtitle ? (_jsx("span", { className: "subtitle-primary", children: primarySubtitle })) : null, subtitle ? _jsx("span", { className: "subtitle", children: subtitle }) : null] })] }));
|
|
3
|
+
return (_jsxs("div", { "data-testid": "container", className: `af-content-item-mono ${size}`, children: [leftComponent, _jsxs("div", { className: "text-content", children: [title ? _jsx("span", { className: "title", children: title }) : null, primarySubtitle ? (_jsx("span", { className: "subtitle-primary", children: primarySubtitle })) : null, subtitle ? _jsx("span", { className: "subtitle", children: subtitle }) : null] })] }));
|
|
4
4
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { type ComponentProps, type ReactNode } from "react";
|
|
2
2
|
type ProgressBarProps = ComponentProps<"progress"> & {
|
|
3
3
|
label?: ReactNode;
|
|
4
|
+
showPercentage?: boolean;
|
|
4
5
|
};
|
|
5
6
|
export declare const ProgressBar: {
|
|
6
|
-
({ id, label, className, ...props }: ProgressBarProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
({ id, label, showPercentage, className, ...props }: ProgressBarProps): import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
displayName: string;
|
|
8
9
|
};
|
|
9
10
|
export {};
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useId } from "react";
|
|
3
|
-
|
|
3
|
+
import { getClassName } from "../utilities/getClassName";
|
|
4
|
+
export const ProgressBar = ({ id, label, showPercentage = false, className, ...props }) => {
|
|
4
5
|
let inputId = useId();
|
|
5
6
|
inputId = id || inputId;
|
|
6
|
-
|
|
7
|
+
const componentClassName = getClassName({
|
|
8
|
+
baseClassName: "af-progress-bar",
|
|
9
|
+
className,
|
|
10
|
+
});
|
|
11
|
+
return (_jsxs(_Fragment, { children: [Boolean(label) && (_jsx("label", { className: "af-progress-bar__label", htmlFor: inputId, children: label })), _jsxs("div", { className: componentClassName, children: [_jsx("progress", { id: inputId, className: "af-progress-bar__progress", ...props }), Boolean(showPercentage) && (_jsxs("span", { "aria-hidden": "true", children: [props.value, " %"] }))] })] }));
|
|
7
12
|
};
|
|
8
13
|
ProgressBar.displayName = "ProgressBar";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axa-fr/canopee-react",
|
|
3
|
-
"version": "1.2.1-alpha.
|
|
3
|
+
"version": "1.2.1-alpha.24",
|
|
4
4
|
"description": "Package React - Design System Canopée",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./distributeur": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"homepage": "https://github.com/AxaFrance/design-system#readme",
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@axa-fr/canopee-css": "1.2.1-alpha.
|
|
48
|
+
"@axa-fr/canopee-css": "1.2.1-alpha.24",
|
|
49
49
|
"@material-symbols/svg-400": ">= 0.19.0",
|
|
50
50
|
"@material-symbols/svg-700": ">= 0.19.0",
|
|
51
51
|
"react": ">= 18"
|