@axa-fr/canopee-react 2.0.0-alpha.5 → 2.0.0-alpha.7
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/TagList/TagListApollo.d.ts +4 -0
- package/dist/prospect-client/TagList/TagListApollo.js +5 -0
- package/dist/prospect-client/TagList/TagListCommon.d.ts +10 -0
- package/dist/prospect-client/TagList/TagListCommon.js +16 -0
- package/dist/prospect-client/TagList/TagListLF.d.ts +4 -0
- package/dist/prospect-client/TagList/TagListLF.js +5 -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
|
@@ -74,6 +74,7 @@ export { TabBar, tabBarDirection, type TabBarDirection, type TabBarProps, } from
|
|
|
74
74
|
export { Table, type BodyColorVariants, type HeadColorVariants, type RowSizeVariants, type TableProps, } from "./prospect-client/Table/TableLF";
|
|
75
75
|
export { TableMobileCard, type TableMobileCardProps, } from "./prospect-client/TableMobileCard/TableMobileCard";
|
|
76
76
|
export { Tag, tagVariants, type TagVariants, } from "./prospect-client/Tag/TagLF";
|
|
77
|
+
export { TagList, type TagListProps, } from "./prospect-client/TagList/TagListLF";
|
|
77
78
|
export { TimelineVertical } from "./prospect-client/TimelineVertical/TimelineVerticalLF";
|
|
78
79
|
export { Toggle } from "./prospect-client/Toggle/ToggleLF";
|
|
79
80
|
export type { GridContainerProps } from "./prospect-client/utilities/types/GridContainerProps";
|
package/dist/client.js
CHANGED
|
@@ -74,5 +74,6 @@ export { TabBar, tabBarDirection, } from "./prospect-client/TabBar/TabBarLF";
|
|
|
74
74
|
export { Table, } from "./prospect-client/Table/TableLF";
|
|
75
75
|
export { TableMobileCard, } from "./prospect-client/TableMobileCard/TableMobileCard";
|
|
76
76
|
export { Tag, tagVariants, } from "./prospect-client/Tag/TagLF";
|
|
77
|
+
export { TagList, } from "./prospect-client/TagList/TagListLF";
|
|
77
78
|
export { TimelineVertical } from "./prospect-client/TimelineVertical/TimelineVerticalLF";
|
|
78
79
|
export { Toggle } from "./prospect-client/Toggle/ToggleLF";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type TagListProps as TagListCommonProps } from "./TagListCommon";
|
|
2
|
+
import "@axa-fr/canopee-css/prospect/TagList/TagListAll.css";
|
|
3
|
+
export type TagListProps = Omit<TagListCommonProps, "OverflowTag">;
|
|
4
|
+
export declare const TagList: (props: TagListProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Tag } from "../Tag/TagCommon";
|
|
3
|
+
import { TagListCommon, } from "./TagListCommon";
|
|
4
|
+
import "@axa-fr/canopee-css/prospect/TagList/TagListAll.css";
|
|
5
|
+
export const TagList = (props) => (_jsx(TagListCommon, { ...props, OverflowTag: Tag }));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ComponentType, type ReactNode } from "react";
|
|
2
|
+
export type TagListProps = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
hideThreshold?: number;
|
|
5
|
+
className?: string;
|
|
6
|
+
OverflowTag: ComponentType<{
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}>;
|
|
9
|
+
};
|
|
10
|
+
export declare const TagListCommon: ({ children, hideThreshold, className, OverflowTag, }: TagListProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Children, isValidElement, } from "react";
|
|
3
|
+
import { getClassName } from "../utilities/getClassName";
|
|
4
|
+
export const TagListCommon = ({ children, hideThreshold = 2, className = "", OverflowTag, }) => {
|
|
5
|
+
const childArray = Children.toArray(children).filter(isValidElement);
|
|
6
|
+
const total = childArray.length;
|
|
7
|
+
const isOverflowing = total > hideThreshold;
|
|
8
|
+
const visibleChildren = isOverflowing
|
|
9
|
+
? childArray.slice(0, hideThreshold)
|
|
10
|
+
: childArray;
|
|
11
|
+
const hiddenCount = total - hideThreshold;
|
|
12
|
+
return (_jsxs("div", { className: getClassName({
|
|
13
|
+
baseClassName: "af-tag-list",
|
|
14
|
+
className,
|
|
15
|
+
}), children: [visibleChildren, isOverflowing ? _jsxs(OverflowTag, { children: ["+", hiddenCount] }) : null] }));
|
|
16
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type TagListProps as TagListCommonProps } from "./TagListCommon";
|
|
2
|
+
import "@axa-fr/canopee-css/client/TagList/TagListAll.css";
|
|
3
|
+
export type TagListProps = Omit<TagListCommonProps, "OverflowTag">;
|
|
4
|
+
export declare const TagList: (props: TagListProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Tag } from "../Tag/TagCommon";
|
|
3
|
+
import { TagListCommon, } from "./TagListCommon";
|
|
4
|
+
import "@axa-fr/canopee-css/client/TagList/TagListAll.css";
|
|
5
|
+
export const TagList = (props) => (_jsx(TagListCommon, { ...props, OverflowTag: Tag }));
|
package/dist/prospect.d.ts
CHANGED
|
@@ -70,6 +70,7 @@ export { TabBar, tabBarDirection, type TabBarDirection, type TabBarProps, } from
|
|
|
70
70
|
export { Table, type BodyColorVariants, type HeadColorVariants, type RowSizeVariants, type TableProps, } from "./prospect-client/Table/TableApollo";
|
|
71
71
|
export { TableMobileCard } from "./prospect-client/TableMobileCard/TableMobileCard";
|
|
72
72
|
export { Tag, tagVariants, type TagVariants, } from "./prospect-client/Tag/TagApollo";
|
|
73
|
+
export { TagList, type TagListProps, } from "./prospect-client/TagList/TagListApollo";
|
|
73
74
|
export { TimelineVertical } from "./prospect-client/TimelineVertical/TimelineVerticalApollo";
|
|
74
75
|
export { Toggle } from "./prospect-client/Toggle/ToggleApollo";
|
|
75
76
|
export type { GridContainerProps } from "./prospect-client/utilities/types/GridContainerProps";
|
package/dist/prospect.js
CHANGED
|
@@ -70,5 +70,6 @@ export { TabBar, tabBarDirection, } from "./prospect-client/TabBar/TabBarApollo"
|
|
|
70
70
|
export { Table, } from "./prospect-client/Table/TableApollo";
|
|
71
71
|
export { TableMobileCard } from "./prospect-client/TableMobileCard/TableMobileCard";
|
|
72
72
|
export { Tag, tagVariants, } from "./prospect-client/Tag/TagApollo";
|
|
73
|
+
export { TagList, } from "./prospect-client/TagList/TagListApollo";
|
|
73
74
|
export { TimelineVertical } from "./prospect-client/TimelineVertical/TimelineVerticalApollo";
|
|
74
75
|
export { Toggle } from "./prospect-client/Toggle/ToggleApollo";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axa-fr/canopee-react",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.7",
|
|
4
4
|
"description": "Package React - Design System Canopée",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./distributeur": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"homepage": "https://github.com/AxaFrance/design-system#readme",
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@axa-fr/canopee-css": "2.0.0-alpha.
|
|
56
|
+
"@axa-fr/canopee-css": "2.0.0-alpha.7",
|
|
57
57
|
"@material-symbols/svg-400": ">= 0.19.0",
|
|
58
58
|
"@material-symbols/svg-700": ">= 0.19.0",
|
|
59
59
|
"react": ">= 19"
|