@pdg/react-form 1.0.35 → 1.0.36
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,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FormIconProps as Props } from './FormIcon.types';
|
|
3
|
-
declare const FormIcon: React.ForwardRefExoticComponent<
|
|
3
|
+
declare const FormIcon: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLAnchorElement>>;
|
|
4
4
|
export default FormIcon;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IconProps } from '@mui/material';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { SvgIconComponent } from '@mui/icons-material';
|
|
3
|
+
export interface FormIconProps extends Pick<IconProps, 'color' | 'style' | 'sx' | 'className' | 'fontSize'> {
|
|
4
|
+
children: string | SvgIconComponent;
|
|
4
5
|
}
|
|
5
6
|
export declare const FormIconDefaultProps: {};
|
package/dist/index.esm.js
CHANGED
|
@@ -823,11 +823,11 @@ Form.displayName = 'Form';
|
|
|
823
823
|
Form.defaultProps = FormDefaultProps;var FormButtonDefaultProps = {
|
|
824
824
|
type: 'button',
|
|
825
825
|
};var FormIconDefaultProps = {};var FormIcon = React__default.forwardRef(function (_a, ref) {
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
826
|
+
var className = _a.className, InitChildren = _a.children, props = __rest$3(_a, ["className", "children"]);
|
|
827
|
+
return useMemo(function () {
|
|
828
|
+
var iconProps = __assign$6(__assign$6({}, props), { className: classNames$1('FormIcon', className) });
|
|
829
|
+
return typeof InitChildren === 'string' ? (React__default.createElement(Icon$1, __assign$6({ ref: ref }, iconProps), InitChildren.replace(/[A-Z]/g, function (letter, idx) { return "".concat(idx > 0 ? '_' : '').concat(letter.toLowerCase()); }))) : (React__default.createElement(InitChildren, __assign$6({}, iconProps)));
|
|
830
|
+
}, [InitChildren, className, props, ref]);
|
|
831
831
|
});
|
|
832
832
|
FormIcon.displayName = 'FormIcon';
|
|
833
833
|
FormIcon.defaultProps = FormIconDefaultProps;var FormButton = React__default.forwardRef(function (_a, ref) {
|