@axa-fr/canopee-react 1.2.1-alpha.24 → 1.2.1-alpha.25
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/client.d.ts +1 -0
- package/dist/client.js +1 -0
- package/dist/prospect-client/ContentItemMono/ContentItemMonoCore.d.ts +4 -2
- package/dist/prospect-client/ContentItemMono/ContentItemMonoCore.js +3 -2
- package/dist/prospect-client/Fieldset/FieldsetApollo.d.ts +4 -0
- package/dist/prospect-client/Fieldset/FieldsetApollo.js +6 -0
- package/dist/prospect-client/Fieldset/FieldsetCommon.d.ts +13 -0
- package/dist/prospect-client/Fieldset/FieldsetCommon.js +7 -0
- package/dist/prospect-client/Fieldset/FieldsetLF.d.ts +4 -0
- package/dist/prospect-client/Fieldset/FieldsetLF.js +6 -0
- package/dist/prospect.d.ts +1 -0
- package/dist/prospect.js +1 -0
- package/package.json +2 -2
package/dist/client.d.ts
CHANGED
|
@@ -64,3 +64,4 @@ export { List, type ListProps } from "./prospect-client/List/List/ListLF";
|
|
|
64
64
|
export { LevelSelector, type LevelSelectorProps, } from "./prospect-client/LevelSelector/LevelSelectorLF";
|
|
65
65
|
export { Skeleton, type SkeletonProps, } from "./prospect-client/Skeleton/SkeletonLF";
|
|
66
66
|
export { SkeletonList, type SkeletonListProps, } from "./prospect-client/SkeletonList/SkeletonListLF";
|
|
67
|
+
export { Fieldset, type FieldsetProps, } from "./prospect-client/Fieldset/FieldsetLF";
|
package/dist/client.js
CHANGED
|
@@ -63,3 +63,4 @@ export { List } from "./prospect-client/List/List/ListLF";
|
|
|
63
63
|
export { LevelSelector, } from "./prospect-client/LevelSelector/LevelSelectorLF";
|
|
64
64
|
export { Skeleton, } from "./prospect-client/Skeleton/SkeletonLF";
|
|
65
65
|
export { SkeletonList, } from "./prospect-client/SkeletonList/SkeletonListLF";
|
|
66
|
+
export { Fieldset, } from "./prospect-client/Fieldset/FieldsetLF";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ElementType } from "react";
|
|
1
2
|
import { ReactNode } from "react";
|
|
2
3
|
import { AtLeastOne } from "../utilities/types/AtLeastOne";
|
|
3
4
|
export type ContentMonoItemSize = "medium" | "large";
|
|
@@ -7,9 +8,10 @@ type TextFields = {
|
|
|
7
8
|
subtitle?: string;
|
|
8
9
|
};
|
|
9
10
|
type AtLeastOneText = AtLeastOne<TextFields>;
|
|
10
|
-
export type ContentItemCoreProps = {
|
|
11
|
+
export type ContentItemCoreProps<T extends ElementType = "div"> = {
|
|
12
|
+
as?: T;
|
|
11
13
|
size?: ContentMonoItemSize;
|
|
12
14
|
leftComponent?: ReactNode;
|
|
13
15
|
} & AtLeastOneText;
|
|
14
|
-
export declare const ContentItemMonoCore: ({ size, leftComponent, title, primarySubtitle, subtitle, }: ContentItemCoreProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const ContentItemMonoCore: <T extends ElementType = "div">({ as, size, leftComponent, title, primarySubtitle, subtitle, }: ContentItemCoreProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
15
17
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
export const ContentItemMonoCore = ({ size = "medium", leftComponent, title, primarySubtitle, subtitle, }) => {
|
|
3
|
-
|
|
2
|
+
export const ContentItemMonoCore = ({ as, size = "medium", leftComponent, title, primarySubtitle, subtitle, }) => {
|
|
3
|
+
const Component = as ?? "div";
|
|
4
|
+
return (_jsxs(Component, { 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
5
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/canopee-css/prospect/Fieldset/FieldsetApollo.css";
|
|
3
|
+
import { Icon } from "../Icon/IconApollo";
|
|
4
|
+
import { Card } from "../Card/CardApollo";
|
|
5
|
+
import { FieldsetCommon } from "./FieldsetCommon";
|
|
6
|
+
export const Fieldset = (props) => (_jsx(FieldsetCommon, { ...props, IconComponent: Icon, CardComponent: Card }));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentProps, ComponentType, PropsWithChildren } from "react";
|
|
2
|
+
import { CardCommon } from "../Card/CardCommon";
|
|
3
|
+
import { Icon, type IconProps } from "../Icon/IconCommon";
|
|
4
|
+
export type FieldsetProps = PropsWithChildren<{
|
|
5
|
+
title: string;
|
|
6
|
+
iconProps?: IconProps;
|
|
7
|
+
className?: string;
|
|
8
|
+
}>;
|
|
9
|
+
export type FieldsetCommonProps = FieldsetProps & {
|
|
10
|
+
IconComponent: ComponentType<ComponentProps<typeof Icon>>;
|
|
11
|
+
CardComponent: ComponentType<ComponentProps<typeof CardCommon>>;
|
|
12
|
+
};
|
|
13
|
+
export declare const FieldsetCommon: ({ children, title, iconProps, className, IconComponent, CardComponent, }: FieldsetCommonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ContentItemMonoCore } from "../ContentItemMono/ContentItemMonoCore";
|
|
3
|
+
import { getClassName } from "../utilities/getClassName";
|
|
4
|
+
export const FieldsetCommon = ({ children, title, iconProps, className, IconComponent, CardComponent, }) => {
|
|
5
|
+
const iconComponent = iconProps && (_jsx(IconComponent, { "aria-hidden": "true", ...iconProps }));
|
|
6
|
+
return (_jsxs(CardComponent, { as: "fieldset", className: getClassName({ baseClassName: "af-fieldset", className }), children: [_jsx(ContentItemMonoCore, { as: "legend", title: title, leftComponent: iconComponent }), _jsx("div", { className: "af-fieldset__content", children: children })] }));
|
|
7
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/canopee-css/client/Fieldset/FieldsetLF.css";
|
|
3
|
+
import { Icon } from "../Icon/IconLF";
|
|
4
|
+
import { Card } from "../Card/CardLF";
|
|
5
|
+
import { FieldsetCommon } from "./FieldsetCommon";
|
|
6
|
+
export const Fieldset = (props) => (_jsx(FieldsetCommon, { ...props, IconComponent: Icon, CardComponent: Card }));
|
package/dist/prospect.d.ts
CHANGED
|
@@ -60,3 +60,4 @@ export { List, type ListProps } from "./prospect-client/List/List/ListApollo";
|
|
|
60
60
|
export { LevelSelector, type LevelSelectorProps, } from "./prospect-client/LevelSelector/LevelSelectorApollo";
|
|
61
61
|
export { Skeleton, type SkeletonProps, } from "./prospect-client/Skeleton/SkeletonApollo";
|
|
62
62
|
export { SkeletonList, type SkeletonListProps, } from "./prospect-client/SkeletonList/SkeletonListApollo";
|
|
63
|
+
export { Fieldset, type FieldsetProps, } from "./prospect-client/Fieldset/FieldsetApollo";
|
package/dist/prospect.js
CHANGED
|
@@ -59,3 +59,4 @@ export { List } from "./prospect-client/List/List/ListApollo";
|
|
|
59
59
|
export { LevelSelector, } from "./prospect-client/LevelSelector/LevelSelectorApollo";
|
|
60
60
|
export { Skeleton, } from "./prospect-client/Skeleton/SkeletonApollo";
|
|
61
61
|
export { SkeletonList, } from "./prospect-client/SkeletonList/SkeletonListApollo";
|
|
62
|
+
export { Fieldset, } from "./prospect-client/Fieldset/FieldsetApollo";
|
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.25",
|
|
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.25",
|
|
49
49
|
"@material-symbols/svg-400": ">= 0.19.0",
|
|
50
50
|
"@material-symbols/svg-700": ">= 0.19.0",
|
|
51
51
|
"react": ">= 18"
|