diff --git a/changelog.md b/changelog.md index 4c8d9b1c..0d1c9194 100644 --- a/changelog.md +++ b/changelog.md @@ -14,6 +14,7 @@ - **Breaking** Full-width _Navbar_ (`containerWidth={false}`) now uses a 12px side gutter instead of 24px (16px on small screens), so a default-size menu `IconButton` at its left edge lines up with _SidebarNav_'s item icons. Centred Navbars keep the 24px gutter. - **Breaking** _User_ no longer renders a `flexGrow` spacer before itself, which added an extra gap next to sibling controls in a `Navbar` slot. If you placed `User` directly in a flex container and relied on it pushing itself to the right, add your own spacer. - `DiamondDSIntegrations.mrtOptions({ onRowReorder })` adds row reordering: drag with a drop line between rows, plus Move up/down in the row menu. +- _LinearProgress_ and _CircularProgress_ now default to `color="info"`. Set `color="primary"` to keep the previous look. ### Fixed diff --git a/src/components/MUI/Feedback/CircularProgress.stories.tsx b/src/components/MUI/Feedback/CircularProgress.stories.tsx index 370c3555..944e84dd 100644 --- a/src/components/MUI/Feedback/CircularProgress.stories.tsx +++ b/src/components/MUI/Feedback/CircularProgress.stories.tsx @@ -26,7 +26,7 @@ const meta: Meta = { thickness: { control: { type: "number", min: 1, max: 10, step: 0.5 } }, }, args: { - color: "primary", + color: "info", variant: "indeterminate", value: 75, size: 40, diff --git a/src/components/MUI/Feedback/LinearProgress.stories.tsx b/src/components/MUI/Feedback/LinearProgress.stories.tsx index 237fd44c..e29d2ca9 100644 --- a/src/components/MUI/Feedback/LinearProgress.stories.tsx +++ b/src/components/MUI/Feedback/LinearProgress.stories.tsx @@ -28,7 +28,7 @@ const meta: Meta = { valueBuffer: { control: { type: "number", min: 0, max: 100, step: 1 } }, }, args: { - color: "primary", + color: "info", variant: "indeterminate", value: 40, valueBuffer: 60, diff --git a/src/themes/DiamondDSTheme.test.ts b/src/themes/DiamondDSTheme.test.ts index 57c77bdd..3aad80e9 100644 --- a/src/themes/DiamondDSTheme.test.ts +++ b/src/themes/DiamondDSTheme.test.ts @@ -1264,6 +1264,25 @@ describe("DiamondDS component overrides", () => { expectTokenFallback(circularStyles.color, "--ds-warning"); }); + it("defaults progress indicators to the info colour", () => { + const linearBar = + DiamondDSTheme.components?.MuiLinearProgress?.styleOverrides?.bar; + + expect( + DiamondDSTheme.components?.MuiLinearProgress?.defaultProps?.color, + ).toBe("info"); + expect( + DiamondDSTheme.components?.MuiCircularProgress?.defaultProps?.color, + ).toBe("info"); + expectTokenFallback( + getStyleOverride(linearBar, { + ownerState: { color: "info" }, + theme: DiamondDSTheme, + }).backgroundColor, + "--ds-info", + ); + }); + it("uses semantic loading surface roles for skeletons", () => { const root = DiamondDSTheme.components?.MuiSkeleton?.styleOverrides?.root; const wave = DiamondDSTheme.components?.MuiSkeleton?.styleOverrides?.wave; diff --git a/src/themes/DiamondDSTheme.ts b/src/themes/DiamondDSTheme.ts index 89d8fe65..5fcd48ed 100644 --- a/src/themes/DiamondDSTheme.ts +++ b/src/themes/DiamondDSTheme.ts @@ -1849,6 +1849,9 @@ const DiamondDSTheme = extendTheme({ * surface. This keeps them visually lighter than buttons or alerts. */ MuiLinearProgress: { + defaultProps: { + color: "info", + }, styleOverrides: { root: { height: 6, @@ -1869,6 +1872,9 @@ const DiamondDSTheme = extendTheme({ }, MuiCircularProgress: { + defaultProps: { + color: "info", + }, styleOverrides: { root: ({ ownerState,