@axa-fr/canopee-react 2.0.1-alpha.2 → 2.0.1-alpha.6

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.
@@ -1,7 +1,9 @@
1
1
  import type { ComponentProps, ElementType } from "react";
2
2
  import { type PolymorphicComponent } from "../utilities/types/PolymorphicComponent";
3
+ import type { Permutations } from "../utilities/types/Permutations";
3
4
  export declare const cardVariants: {
4
5
  readonly unstyled: "unstyled";
6
+ readonly vertical: "vertical";
5
7
  };
6
8
  export type CardVariants = keyof typeof cardVariants;
7
9
  /**
@@ -13,8 +15,9 @@ export type CardCommonProps<T extends ElementType> = PolymorphicComponent<T, Com
13
15
  /**
14
16
  * Visual variant of the card.
15
17
  * - `"unstyled"` — removes border and padding.
18
+ * - `"vertical"` — displays the card content in a vertical layout.
16
19
  */
17
- variant?: CardVariants;
20
+ variant?: Permutations<CardVariants>;
18
21
  }>;
19
22
  /**
20
23
  * Polymorphic card wrapper that adds padding and a border.
@@ -3,6 +3,7 @@ import {} from "../utilities/types/PolymorphicComponent";
3
3
  import { getClassName } from "../utilities/getClassName";
4
4
  export const cardVariants = {
5
5
  unstyled: "unstyled",
6
+ vertical: "vertical",
6
7
  };
7
8
  /**
8
9
  * Polymorphic card wrapper that adds padding and a border.
@@ -21,7 +22,7 @@ export const CardCommon = ({ as, children, className, variant, ...props }) => {
21
22
  const Component = as || "div";
22
23
  return (_jsx(Component, { className: getClassName({
23
24
  baseClassName: "af-card",
24
- modifiers: [variant],
25
+ modifiers: variant?.split(" "),
25
26
  className,
26
27
  }), ...props, children: children }));
27
28
  };
@@ -0,0 +1 @@
1
+ export type Permutations<T extends string, U extends string = T> = T extends unknown ? T | `${T} ${Permutations<Exclude<U, T>>}` : never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axa-fr/canopee-react",
3
- "version": "2.0.1-alpha.2",
3
+ "version": "2.0.1-alpha.6",
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.1-alpha.2",
56
+ "@axa-fr/canopee-css": "2.0.1-alpha.6",
57
57
  "@material-symbols/svg-400": ">= 0.19.0",
58
58
  "@material-symbols/svg-700": ">= 0.19.0",
59
59
  "react": ">= 19"