Skip to content

Commit 69284a8

Browse files
Merge branch 'master' into scale-axes
2 parents f92143e + f8e4bf8 commit 69284a8

293 files changed

Lines changed: 3006 additions & 1172 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2.1
22

33
orbs:
4-
code-infra: https://raw.githubusercontent.com/mui/mui-public/18225f60a2186e3eb12f1c1ecee4db945baecca2/.circleci/orbs/code-infra.yml
4+
code-infra: https://raw.githubusercontent.com/mui/mui-public/35aa25ced2bc6ff4f6c5266b073a0a725a362785/.circleci/orbs/code-infra.yml
55

66
parameters:
77
browserstack-force:
@@ -57,6 +57,7 @@ default-job: &default-job
5757
BASE_BRANCH: master
5858
working_directory: /tmp/mui
5959
executor: code-infra/mui-node
60+
resource_class: medium
6061
# CircleCI has disabled the cache across forks for security reasons.
6162
# Following their official statement, it was a quick solution, they
6263
# are working on providing this feature back with appropriate security measures.
@@ -276,7 +277,6 @@ jobs:
276277
executor:
277278
name: code-infra/mui-node-browser
278279
playwright-img-version: v1.60.0-noble
279-
resource_class: medium
280280
steps:
281281
- checkout
282282
- run:

docs/data/charts/components/components.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,114 @@ For example, you can use `useLineSeries()` to obtain the series of a Line Chart
9191

9292
{{"demo": "SeriesDemo.js"}}
9393

94+
## Custom slot props with TypeScript
95+
96+
If the custom component requires additional props to work properly, TypeScript may throw type errors.
97+
To solve these type errors, use [module augmentation](https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation) to enhance the props interface.
98+
99+
The naming of overridable interfaces uses a pattern like this:
100+
101+
```js
102+
`${slotNameInPascalCase}PropsOverrides`;
103+
```
104+
105+
For example, for the `tooltip` slot, the interface name is `TooltipPropsOverrides`.
106+
107+
These files list every overridable interface for the Charts packages:
108+
109+
- [`@mui/x-charts`](https://github.com/mui/mui-x/blob/-/packages/x-charts/src/models/chartsSlotsComponentsProps.ts)
110+
- [`@mui/x-charts-pro`](https://github.com/mui/mui-x/blob/-/packages/x-charts-pro/src/models/chartsSlotsComponentsPropsPro.ts) (pro-only slots: heatmap `cell`, funnel sections, pro toolbar icons, pro base slots)
111+
- [`@mui/x-charts-premium`](https://github.com/mui/mui-x/blob/-/packages/x-charts-premium/src/models/chartsSlotsComponentsPropsPremium.ts) (premium-only slots: `radialLineHighlight`)
112+
113+
<codeblock storageKey="pricing-plan">
114+
115+
```tsx Community
116+
// augment the props for the tooltip slot
117+
declare module '@mui/x-charts' {
118+
interface TooltipPropsOverrides {
119+
someCustomString: string;
120+
someCustomNumber: number;
121+
}
122+
}
123+
124+
<LineChart
125+
series={[{ data: [1, 2, 3] }]}
126+
slots={{
127+
// custom component passed to the tooltip slot
128+
tooltip: CustomTooltip,
129+
}}
130+
slotProps={{
131+
tooltip: {
132+
// props used by CustomTooltip
133+
someCustomString: 'Hello',
134+
someCustomNumber: 42,
135+
},
136+
}}
137+
/>;
138+
```
139+
140+
```tsx Pro
141+
// augment the props for a pro-only slot (heatmap cell)
142+
declare module '@mui/x-charts-pro' {
143+
interface CellPropsOverrides {
144+
someCustomString: string;
145+
someCustomNumber: number;
146+
}
147+
}
148+
149+
<Heatmap
150+
xAxis={[{ data: [1, 2, 3] }]}
151+
yAxis={[{ data: [1, 2, 3] }]}
152+
series={[{ data: [[0, 0, 1]] }]}
153+
slots={{
154+
// custom component passed to the cell slot
155+
cell: CustomHeatmapCell,
156+
}}
157+
slotProps={{
158+
cell: {
159+
// props used by CustomHeatmapCell
160+
someCustomString: 'Hello',
161+
someCustomNumber: 42,
162+
},
163+
}}
164+
/>;
165+
```
166+
167+
```tsx Premium
168+
// augment the props for a premium-only slot (radial line highlight)
169+
declare module '@mui/x-charts-premium' {
170+
interface RadialLineHighlightPropsOverrides {
171+
someCustomString: string;
172+
someCustomNumber: number;
173+
}
174+
}
175+
176+
<RadialLineChart
177+
series={[{ data: [1, 2, 3] }]}
178+
radiusAxis={[{ data: [1, 2, 3] }]}
179+
rotationAxis={[{ data: [0, 120, 240] }]}
180+
slots={{
181+
// custom component passed to the radialLineHighlight slot
182+
radialLineHighlight: CustomRadialLineHighlight,
183+
}}
184+
slotProps={{
185+
radialLineHighlight: {
186+
// props used by CustomRadialLineHighlight
187+
someCustomString: 'Hello',
188+
someCustomNumber: 42,
189+
},
190+
}}
191+
/>;
192+
```
193+
194+
</codeblock>
195+
196+
:::info
197+
Augmentations always target the module where the interface is **originally declared**.
198+
The Pro and Premium tabs above augment `@mui/x-charts-pro` and `@mui/x-charts-premium` because the example slots (`cell`, `radialLineHighlight`) are declared in those packages.
199+
Slots shared across tiers (such as `tooltip`, `legend`, `toolbar`) are declared in `@mui/x-charts` — augment them via `declare module '@mui/x-charts'` regardless of which chart you use.
200+
:::
201+
94202
## HTML components
95203

96204
Use the `ChartsDataProvider` to access chart data from any component.

docs/data/chat/ai-and-agents/reasoning/reasoning.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ const renderers: ChatPartRendererMap = {
108108
<Accordion defaultExpanded={false} sx={{ my: 1, bgcolor: 'action.hover' }}>
109109
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
110110
<Typography variant="caption" color="text.secondary">
111-
{part.state === 'streaming' ? 'Thinking...' : 'Reasoning'}
111+
{part.state === 'streaming' ? 'Thinking' : 'Reasoning'}
112112
</Typography>
113113
</AccordionSummary>
114114
<AccordionDetails>
@@ -137,7 +137,7 @@ function ReasoningPart({ part, showReasoning }) {
137137
<div style={{ opacity: 0.7, fontSize: '0.85em', fontStyle: 'italic' }}>
138138
<details>
139139
<summary>
140-
{part.state === 'streaming' ? 'Thinking...' : 'Show reasoning'}
140+
{part.state === 'streaming' ? 'Thinking' : 'Show reasoning'}
141141
</summary>
142142
<p>{part.text}</p>
143143
</details>

docs/data/chat/ai-and-agents/step-tracking/step-tracking.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const adapter: ChatAdapter = {
7272
controller.enqueue({
7373
type: 'tool-output-available',
7474
toolCallId: 'call-1',
75-
output: { results: ['...'] },
75+
output: { results: [''] },
7676
});
7777
controller.enqueue({ type: 'finish-step' });
7878

@@ -87,12 +87,12 @@ const adapter: ChatAdapter = {
8787
type: 'tool-input-available',
8888
toolCallId: 'call-2',
8989
toolName: 'analyze',
90-
input: { data: '...' },
90+
input: { data: '' },
9191
});
9292
controller.enqueue({
9393
type: 'tool-output-available',
9494
toolCallId: 'call-2',
95-
output: { summary: '...' },
95+
output: { summary: '' },
9696
});
9797
controller.enqueue({ type: 'finish-step' });
9898

@@ -102,7 +102,7 @@ const adapter: ChatAdapter = {
102102
controller.enqueue({
103103
type: 'text-delta',
104104
id: 'text-1',
105-
delta: 'Based on my research, here is the answer...',
105+
delta: 'Based on my research, here is the answer',
106106
});
107107
controller.enqueue({ type: 'text-end', id: 'text-1' });
108108
controller.enqueue({ type: 'finish-step' });
@@ -199,7 +199,7 @@ After streaming, the message's `parts` array contains `step-start` entries inter
199199
},
200200
}, // Step 2 content
201201
{ type: 'step-start' }, // Step 3 delimiter
202-
{ type: 'text', text: 'Final answer...' }, // Step 3 content
202+
{ type: 'text', text: 'Final answer' }, // Step 3 content
203203
];
204204
```
205205

docs/data/chat/backend/real-time-adapters/real-time-adapters.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ function TypingIndicator() {
187187

188188
if (typingUserIds.length === 0) return null;
189189

190-
return <span>{typingUserIds.length} user(s) typing...</span>;
190+
return <span>{typingUserIds.length} user(s) typing</span>;
191191
}
192192
```
193193

docs/data/chat/core/examples/advanced-store-access/AdvancedStoreAccessHeadlessChat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ function AdvancedMetrics() {
208208
fullWidth
209209
value={composer.value}
210210
onChange={(event) => composer.setValue(event.target.value)}
211-
placeholder="Type a message..."
211+
placeholder="Type a message"
212212
/>
213213
<Button
214214
variant="contained"

docs/data/chat/core/examples/advanced-store-access/AdvancedStoreAccessHeadlessChat.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ function AdvancedMetrics() {
209209
fullWidth
210210
value={composer.value}
211211
onChange={(event) => composer.setValue(event.target.value)}
212-
placeholder="Type a message..."
212+
placeholder="Type a message"
213213
/>
214214
<Button
215215
variant="contained"

docs/data/chat/core/hooks/hooks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ function StatusBar() {
177177

178178
return (
179179
<div>
180-
{isStreaming && <span>Assistant is responding...</span>}
181-
{typingUserIds.length > 0 && <span>{typingUserIds.length} typing...</span>}
180+
{isStreaming && <span>Assistant is responding</span>}
181+
{typingUserIds.length > 0 && <span>{typingUserIds.length} typing</span>}
182182
{error && <span>{error.message}</span>}
183183
</div>
184184
);

docs/data/chat/core/realtime/realtime.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function TypingIndicator() {
9191

9292
if (typingUserIds.length === 0) return null;
9393

94-
return <span>{typingUserIds.length} user(s) typing...</span>;
94+
return <span>{typingUserIds.length} user(s) typing</span>;
9595
}
9696
```
9797

docs/data/chat/customization/localization/localization.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ This is useful when building custom slot components that need to access localize
7676
| `messageEditedLabel` | `"Edited"` | Edited message indicator |
7777
| `messageDeletedLabel` | `"Deleted"` | Deleted message indicator |
7878
| `messageReasoningLabel` | `"Reasoning"` | Reasoning part label |
79-
| `messageReasoningStreamingLabel` | `"Thinking..."` | Reasoning part streaming label |
79+
| `messageReasoningStreamingLabel` | `"Thinking…"` | Reasoning part streaming label |
8080
| `messageToolInputLabel` | `"Input"` | Tool input label |
8181
| `messageToolOutputLabel` | `"Output"` | Tool output label |
8282
| `messageToolApproveButtonLabel` | `"Approve"` | Tool approval button |
@@ -89,7 +89,7 @@ This is useful when building custom slot components that need to access localize
8989
| `scrollToBottomLabel` | `"Scroll to bottom"` | Scroll-to-bottom affordance label |
9090
| `threadNoMessagesLabel` | `"No messages yet"` | Empty thread state |
9191
| `genericErrorLabel` | `"Something went wrong"` | Generic error message |
92-
| `loadingLabel` | `"Loading..."` | Loading state label |
92+
| `loadingLabel` | `"Loading…"` | Loading state label |
9393
| `suggestionsLabel` | `"Suggested prompts"` | Suggestions section label |
9494
| `messageListLabel` | `"Message log"` | Message list aria-label |
9595
| `messageLabel` | `"Message"` | Individual message aria-label |
@@ -98,14 +98,14 @@ This is useful when building custom slot components that need to access localize
9898

9999
These keys accept parameters and return formatted strings:
100100

101-
| Key | Signature | Default behavior |
102-
| :----------------------------- | :------------------------------------------- | :------------------------------------------------------------- |
103-
| `messageStatusLabel` | `(status: ChatMessageStatus) => string` | Maps status to human-readable label |
104-
| `toolStateLabel` | `(state: ChatToolInvocationState) => string` | Maps tool state to label (for example, "Running...", "Failed") |
105-
| `messageTimestampLabel` | `(dateTime: string) => string` | Formats to `HH:MM` using `toLocaleTimeString` |
106-
| `conversationTimestampLabel` | `(dateTime: string) => string` | Time for today, `MMM DD` for older dates |
107-
| `typingIndicatorLabel` | `(users: ChatLocaleTypingUser[]) => string` | `"Alice is typing"` or `"Alice, Bob are typing"` |
108-
| `scrollToBottomWithCountLabel` | `(unseenCount: number) => string` | `"Scroll to bottom, N new messages"` |
101+
| Key | Signature | Default behavior |
102+
| :----------------------------- | :------------------------------------------- | :----------------------------------------------------------- |
103+
| `messageStatusLabel` | `(status: ChatMessageStatus) => string` | Maps status to human-readable label |
104+
| `toolStateLabel` | `(state: ChatToolInvocationState) => string` | Maps tool state to label (for example, "Running", "Failed") |
105+
| `messageTimestampLabel` | `(dateTime: string) => string` | Formats to `HH:MM` using `toLocaleTimeString` |
106+
| `conversationTimestampLabel` | `(dateTime: string) => string` | Time for today, `MMM DD` for older dates |
107+
| `typingIndicatorLabel` | `(users: ChatLocaleTypingUser[]) => string` | `"Alice is typing"` or `"Alice, Bob are typing"` |
108+
| `scrollToBottomWithCountLabel` | `(unseenCount: number) => string` | `"Scroll to bottom, N new messages"` |
109109

110110
### Message status labels
111111

@@ -127,10 +127,10 @@ The `toolStateLabel` function maps from `ChatToolInvocationState`:
127127

128128
| State | Default label |
129129
| :------------------- | :-------------------- |
130-
| `input-streaming` | `"Running..."` |
131-
| `input-available` | `"Running..."` |
130+
| `input-streaming` | `"Running…"` |
131+
| `input-available` | `"Running…"` |
132132
| `approval-requested` | `"Awaiting approval"` |
133-
| `approval-responded` | `"Running..."` |
133+
| `approval-responded` | `"Running…"` |
134134
| `output-available` | `"Completed"` |
135135
| `output-error` | `"Failed"` |
136136
| `output-denied` | `"Denied"` |
@@ -145,13 +145,13 @@ const frenchLocale = {
145145
scrollToBottomLabel: 'Aller en bas',
146146
threadNoMessagesLabel: 'Aucun message',
147147
genericErrorLabel: 'Une erreur est survenue',
148-
loadingLabel: 'Chargement...',
148+
loadingLabel: 'Chargement',
149149
retryButtonLabel: 'R\u00e9essayer',
150150
unreadMarkerLabel: 'Nouveaux messages',
151151
typingIndicatorLabel: (users) => {
152152
const names = users.map((u) => u.displayName ?? u.id).join(', ');
153-
if (users.length === 1) return `${names} \u00e9crit...`;
154-
return `${names} \u00e9crivent...`;
153+
if (users.length === 1) return `${names} \u00e9crit`;
154+
return `${names} \u00e9crivent`;
155155
},
156156
messageTimestampLabel: (dateTime) => {
157157
const d = new Date(dateTime);

0 commit comments

Comments
 (0)