@zydon/common 2.2.50 → 2.2.51
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,12 +1,15 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { StackProps } from '@mui/material/Stack';
|
|
4
|
+
import { TypographyProps } from '@mui/material/Typography';
|
|
4
5
|
|
|
5
6
|
interface SummaryProps extends StackProps {
|
|
6
7
|
data: {
|
|
7
8
|
id: string;
|
|
8
9
|
label: ReactNode;
|
|
9
10
|
value?: ReactNode;
|
|
11
|
+
keyProps?: TypographyProps;
|
|
12
|
+
valueProps?: TypographyProps;
|
|
10
13
|
}[];
|
|
11
14
|
}
|
|
12
15
|
|
|
@@ -3,6 +3,6 @@ import { styled } from '@mui/material/styles';
|
|
|
3
3
|
import a from '@mui/material/Typography';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
|
-
var l=styled(n)({display:"grid",gridTemplateColumns:"auto auto"}),p=styled(a)(({theme:e})=>({color:e.palette.grey[600],display:"flex",gap:"8px",alignItems:"center"})),
|
|
6
|
+
var l=styled(n)({display:"grid",gridTemplateColumns:"auto auto"}),p=styled(a)(({theme:e})=>({color:e.palette.grey[600],display:"flex",gap:"8px",alignItems:"center"})),m=styled(a)(({theme:e})=>({textAlign:"right",color:e.palette.grey[800]}));var u=({data:e,...i})=>e.length===0?null:jsx(l,{gap:1,...i,children:e.map(r=>[jsx(p,{...r.keyProps,children:r.label},`label:${r.id}`),jsx(m,{variant:"body2",...r.valueProps,children:r.value},`value:${r.id}`)])}),b=u;
|
|
7
7
|
|
|
8
|
-
export {
|
|
8
|
+
export { b as default };
|
|
@@ -5,6 +5,6 @@ import '@mui/material/Switch';
|
|
|
5
5
|
import '../../../types/baseField.js';
|
|
6
6
|
import 'react-hook-form';
|
|
7
7
|
|
|
8
|
-
declare const Switch: ({ name, helperText, onChange, tabIndex, size, label, sx, ...other }: SwitchProps) => react_jsx_runtime.JSX.Element;
|
|
8
|
+
declare const Switch: ({ name, helperText, rules, onChange, tabIndex, size, label, sx, ...other }: SwitchProps) => react_jsx_runtime.JSX.Element;
|
|
9
9
|
|
|
10
10
|
export { Switch as default };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useFormContext, Controller } from 'react-hook-form';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import F from '@mui/material/FormControlLabel';
|
|
3
|
+
import S from '@mui/material/FormHelperText';
|
|
4
|
+
import g from '@mui/material/Switch';
|
|
5
5
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var h=({name:n,helperText:l,rules:c,onChange:i,tabIndex:d,size:a,label:s,sx:u,...m})=>{let{control:f}=useFormContext(),p=r=>jsx(g,{...r,checked:r.value,onChange:(o,t)=>{r.onChange(o),i&&i(o,t);},inputProps:{tabIndex:d},size:a,sx:u});return jsx(Controller,{name:n,control:f,rules:c,render:({field:r,fieldState:{error:o}})=>jsxs("div",{children:[s?jsx(F,{label:s,control:p(r),"data-intercom-target":n,...m}):p(r),(!!o||l)&&jsx(S,{error:!!o,sx:t=>({mx:"14px",color:m.disabled?t.palette.grey[500]:void 0}),children:o?o?.message:l})]})})},k=h;
|
|
8
8
|
|
|
9
|
-
export {
|
|
9
|
+
export { k as default };
|