@movable/ui 1.7.1 → 1.9.0

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,7 @@
1
1
  type HeaderMetadataType = {
2
2
  icon: string | JSX.Element;
3
3
  label: string;
4
- value: string;
4
+ value: string | JSX.Element;
5
5
  };
6
6
  type MetaDataProps = {
7
7
  metadata: HeaderMetadataType[];
@@ -1,12 +1,10 @@
1
1
  import { SelectProps, SxProps, Theme } from '@mui/material';
2
2
  import { UseControllerProps, FieldPath, FieldValues } from 'react-hook-form';
3
+ import { MenuOption } from './useMenuHelper';
3
4
  type InkSelectProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>> = {
4
5
  id: string;
5
6
  label?: string;
6
- menuOptions?: {
7
- label: string;
8
- value: string;
9
- }[];
7
+ menuOptions?: MenuOption[];
10
8
  variant?: 'filled' | 'outlined';
11
9
  placeholder?: string;
12
10
  helperText?: string;
@@ -0,0 +1,17 @@
1
+ import { MenuItemProps } from '@mui/material';
2
+ export type MenuOption = MenuItemProps & {
3
+ label: string;
4
+ group?: string;
5
+ };
6
+ type MenuPositionType = {
7
+ maxHeight: number;
8
+ placement: 'top' | 'bottom';
9
+ };
10
+ type UseMenuHelperParams = {
11
+ menuMaxHeight: number;
12
+ menuPlacement: MenuPositionType['placement'];
13
+ handleMenuOpen: (anchorRef: React.MutableRefObject<HTMLElement | null>) => void;
14
+ renderMenuItems: (children: React.ReactNode, menuOptions?: MenuOption[]) => JSX.Element[] | React.ReactNode;
15
+ };
16
+ declare const useMenuHelper: () => UseMenuHelperParams;
17
+ export default useMenuHelper;
package/lib/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './components';
2
+ export * from './layouts';
2
3
  export { inkDialog, InkDialogPageObject, inkSelect } from './page-objects';
3
4
  export { default as MovableUITheme } from './theme';