@ceed/cds 1.40.3-next.3 → 1.40.3-next.5

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,10 +1,10 @@
1
1
  import React, { AriaAttributes, ComponentProps, ComponentRef, ElementType, ReactNode } from 'react';
2
- import { MenuButtonProps as JoyMenuButtonProps } from '@mui/joy';
2
+ import { MenuButtonProps as JoyMenuButtonProps, IconButtonProps as JoyIconButtonProps, MenuItemProps as JoyMenuItemProps } from '@mui/joy';
3
3
  export interface IconMenuButtonProps<T extends ElementType = 'button', P extends ElementType = 'li'> {
4
4
  size?: JoyMenuButtonProps<T, P>['size'];
5
5
  icon: ReactNode;
6
6
  buttonComponent?: T;
7
- buttonComponentProps?: ComponentProps<T> & AriaAttributes;
7
+ buttonComponentProps?: ComponentProps<T> & AriaAttributes & Pick<JoyIconButtonProps, 'sx'>;
8
8
  disabled?: boolean;
9
9
  loading?: boolean;
10
10
  color?: JoyMenuButtonProps<T, P>['color'];
@@ -12,7 +12,7 @@ export interface IconMenuButtonProps<T extends ElementType = 'button', P extends
12
12
  items?: {
13
13
  text: string;
14
14
  component?: P;
15
- componentProps?: ComponentProps<P>;
15
+ componentProps?: ComponentProps<P> & Pick<JoyMenuItemProps, 'disabled'>;
16
16
  }[];
17
17
  placement?: 'bottom-start' | 'bottom' | 'bottom-end';
18
18
  }
@@ -233,18 +233,18 @@ function EditorToolbar({ onAction }) {
233
233
 
234
234
  ### Key Props
235
235
 
236
- | Prop | Type | Default | Description |
237
- | ---------------------- | ---------------------------------------------------------------------- | ----------- | -------------------------------------------- |
238
- | `icon` | `ReactNode` | (required) | Icon element to render in the trigger button |
239
- | `items` | `{ text: string; component?: ElementType; componentProps?: object }[]` | - | Menu items |
240
- | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Button size |
241
- | `color` | `'primary' \| 'neutral' \| 'danger' \| 'success' \| 'warning'` | `'neutral'` | Button color |
242
- | `variant` | `'solid' \| 'soft' \| 'outlined' \| 'plain'` | `'plain'` | Button visual style |
243
- | `disabled` | `boolean` | `false` | Disables the button |
244
- | `loading` | `boolean` | `false` | Shows loading indicator |
245
- | `placement` | `Placement` | `'bottom'` | Menu position |
246
- | `buttonComponent` | `ElementType` | - | Custom trigger element |
247
- | `buttonComponentProps` | `object` | - | Props passed to custom trigger |
236
+ | Prop | Type | Default | Description |
237
+ | ---------------------- | ---------------------------------------------------------------------- | ----------- | ------------------------------------------------------------------------ |
238
+ | `icon` | `ReactNode` | (required) | Icon element to render in the trigger button |
239
+ | `items` | `{ text: string; component?: ElementType; componentProps?: object }[]` | - | Menu items. `componentProps` reaches Joy `MenuItem`, so `disabled` works |
240
+ | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Button size |
241
+ | `color` | `'primary' \| 'neutral' \| 'danger' \| 'success' \| 'warning'` | `'neutral'` | Button color |
242
+ | `variant` | `'solid' \| 'soft' \| 'outlined' \| 'plain'` | `'plain'` | Button visual style |
243
+ | `disabled` | `boolean` | `false` | Disables the button |
244
+ | `loading` | `boolean` | `false` | Shows loading indicator |
245
+ | `placement` | `Placement` | `'bottom'` | Menu position |
246
+ | `buttonComponent` | `ElementType` | - | Custom trigger element |
247
+ | `buttonComponentProps` | `object` | - | Props passed to the trigger. Reaches Joy `IconButton`, so `sx` works |
248
248
 
249
249
  ## Best Practices
250
250