@movable/ui 2.12.1 → 2.12.2

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.
@@ -0,0 +1,5 @@
1
+ import { UseControllerProps, FieldPath, FieldValues } from 'react-hook-form';
2
+ import { InkSwitchProps } from './index';
3
+ type InkFormSwitch<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>> = InkSwitchProps & UseControllerProps<TFieldValues, TName>;
4
+ export default function InkFormSwitch<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>>({ control, name, id, rules, ...rest }: InkFormSwitch<TFieldValues, TName>): import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -0,0 +1,10 @@
1
+ import { FormControlLabelProps } from '@mui/material/FormControlLabel';
2
+ import { SwitchProps } from '@mui/material/Switch';
3
+ export type InkSwitchProps = {
4
+ id: string;
5
+ formLabel?: FormControlLabelProps['label'];
6
+ labelPlacement?: FormControlLabelProps['labelPlacement'];
7
+ formControlLabelProps?: FormControlLabelProps;
8
+ } & SwitchProps;
9
+ declare const InkSwitch: import("react").ForwardRefExoticComponent<Omit<InkSwitchProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
10
+ export default InkSwitch;
@@ -0,0 +1,3 @@
1
+ export { default as InkSwitch } from './InkSwitch';
2
+ export type { InkSwitchProps } from './InkSwitch';
3
+ export { default as InkFormSwitch } from './InkFormSwitch';
@@ -6,7 +6,7 @@ export { InkPersistentFilterDrawer } from './PersistentFilterDrawer';
6
6
  export { HeaderMetadata, LinkBreadcrumbs, InkPageHeader, InkWorkflowHeader, PageHeaderActionButtons, HeaderSubtitle, } from './Header';
7
7
  export { InkPaper, type InkPaperProps } from './surfaces';
8
8
  export { InkRadioTiles, type InkRadioTilesProps } from './InkRadioTiles';
9
- export { InkSwitch } from './Switch';
9
+ export { InkSwitch } from './InkSwitch';
10
10
  export { InkToggleText } from './InkToggleText';
11
11
  export { InkToggleTextGroup } from './InkToggleTextGroup';
12
12
  export { InkToggleIcon } from './InkToggleIcon';
package/lib/index.d.ts CHANGED
@@ -11,6 +11,7 @@ import { DrawerProps } from '@mui/material/Drawer';
11
11
  import { DrawerProps as DrawerProps_2 } from '@mui/material';
12
12
  import { FieldPath } from 'react-hook-form';
13
13
  import { FieldValues } from 'react-hook-form';
14
+ import { FormControlLabelProps } from '@mui/material/FormControlLabel';
14
15
  import { FormGroupProps } from '@mui/material/FormGroup';
15
16
  import { FormLabelProps } from '@mui/material/FormLabel';
16
17
  import { ForwardRefExoticComponent } from 'react';
@@ -36,7 +37,7 @@ import { SelectProps } from '@mui/material';
36
37
  import { SnackbarProviderProps } from 'notistack';
37
38
  import { StackProps } from '@mui/material/Stack';
38
39
  import { SvgIconTypeMap } from '@mui/material';
39
- import { SwitchProps } from '@mui/material';
40
+ import { SwitchProps } from '@mui/material/Switch';
40
41
  import { SxProps } from '@mui/material';
41
42
  import { TextFieldProps } from '@mui/material/TextField';
42
43
  import { Theme } from '@mui/material';
@@ -402,12 +403,13 @@ export declare interface InkSnackbarContentProps extends CustomContentProps {
402
403
 
403
404
  export declare const InkSnackbarProvider: ({ children, maxSnack, anchorOrigin, ...rest }: SnackbarProviderProps) => JSX_2.Element;
404
405
 
405
- export declare function InkSwitch({ id, label, labelPlacement, sx, ...rest }: InkSwitchProps): JSX_2.Element;
406
+ export declare const InkSwitch: ForwardRefExoticComponent<Omit<InkSwitchProps, "ref"> & RefAttributes<HTMLDivElement>>;
406
407
 
407
408
  declare type InkSwitchProps = {
408
409
  id: string;
409
- label?: string;
410
- labelPlacement?: 'start' | 'end' | 'top' | 'bottom';
410
+ formLabel?: FormControlLabelProps['label'];
411
+ labelPlacement?: FormControlLabelProps['labelPlacement'];
412
+ formControlLabelProps?: FormControlLabelProps;
411
413
  } & SwitchProps;
412
414
 
413
415
  export declare function InkTextField({ name, minRows, sx, ...rest }: InkTextFieldProps): JSX_2.Element;