From 4f79da9732d22bf244110eff7fd257be3dfb0e61 Mon Sep 17 00:00:00 2001 From: Gauthier Fiorentino Date: Mon, 31 Aug 2026 17:34:01 +0200 Subject: [PATCH 1/2] fix(Table): Remove non-color variants from colorVariants Namely "sm", "lg" and "multiline" --- src/Table.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Table.tsx b/src/Table.tsx index 7a67b7a84..5079d4ea7 100644 --- a/src/Table.tsx +++ b/src/Table.tsx @@ -31,7 +31,14 @@ export namespace TableProps { type ExtractColorVariant = FrClassName extends `fr-table--${infer AccentColor}` ? Exclude< AccentColor, - "no-scroll" | "no-caption" | "caption-bottom" | "layout-fixed" | "bordered" + | "no-scroll" + | "no-caption" + | "caption-bottom" + | "layout-fixed" + | "bordered" + | "multiline" + | "sm" + | "lg" > : never; From 8802867fa7939eb2ff0760bb889eb449942c9db1 Mon Sep 17 00:00:00 2001 From: Gauthier Fiorentino Date: Mon, 31 Aug 2026 19:32:58 +0200 Subject: [PATCH 2/2] feat(Table): Add sizes --- src/Table.tsx | 7 ++++++- stories/Table.stories.tsx | 11 +++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Table.tsx b/src/Table.tsx index 5079d4ea7..2d3ac1ff2 100644 --- a/src/Table.tsx +++ b/src/Table.tsx @@ -24,6 +24,8 @@ export type TableProps = { /** Default: false */ bottomCaption?: boolean; style?: CSSProperties; + /** Default medium */ + size?: "small" | "medium" | "large"; colorVariant?: TableProps.ColorVariant; }; @@ -60,6 +62,7 @@ export const Table = memo( bottomCaption = false, colorVariant, className, + size = "medium", style, ...rest } = props; @@ -84,7 +87,9 @@ export const Table = memo( "fr-table--no-scroll": noScroll, "fr-table--layout-fixed": fixed, "fr-table--no-caption": noCaption, - "fr-table--caption-bottom": bottomCaption + "fr-table--caption-bottom": bottomCaption, + "fr-table--sm": size === "small", + "fr-table--lg": size === "large" }, colorVariant !== undefined && `fr-table--${colorVariant}` ), diff --git a/stories/Table.stories.tsx b/stories/Table.stories.tsx index aaa936ee1..d1c4d72e2 100644 --- a/stories/Table.stories.tsx +++ b/stories/Table.stories.tsx @@ -37,6 +37,17 @@ const { meta, getStory } = getStoryFactory({ "description": "Move caption to bottom", "type": { "name": "boolean" } }, + "size": { + "options": (() => { + const options = ["small", "medium", "large"] as const; + + assert>>(); + + return options; + })(), + "control": { "type": "radio" }, + "defaultValue": "medium" + }, "colorVariant": { "options": (() => { const options = [