react-restyle-components 0.3.17 → 0.3.18
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.
|
@@ -2,10 +2,11 @@ import { IconBaseProps } from 'react-icons/lib';
|
|
|
2
2
|
interface IconProps {
|
|
3
3
|
nameIcon: string;
|
|
4
4
|
propsIcon?: IconBaseProps;
|
|
5
|
+
className?: string;
|
|
5
6
|
tooltip?: string;
|
|
6
7
|
isDisable?: boolean;
|
|
7
8
|
onClick?: () => void;
|
|
8
9
|
}
|
|
9
|
-
export declare const Icon: ({ nameIcon, propsIcon, tooltip, isDisable, onClick, }: IconProps) => JSX.Element;
|
|
10
|
+
export declare const Icon: ({ nameIcon, propsIcon, className, tooltip, isDisable, onClick, }: IconProps) => JSX.Element;
|
|
10
11
|
export {};
|
|
11
12
|
//# sourceMappingURL=icons.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.component.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/atoms/icons/icons.component.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAI9C,UAAU,SAAS;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"icons.component.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/atoms/icons/icons.component.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAI9C,UAAU,SAAS;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,IAAI,qEAOd,SAAS,KAAG,WA8Ed,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { Tooltip } from '../tooltip/tooltip.component';
|
|
|
5
5
|
import loadable from '@loadable/component';
|
|
6
6
|
import s from '../../tc.module.css';
|
|
7
7
|
import { cn } from '../../utils';
|
|
8
|
-
export const Icon = ({ nameIcon, propsIcon, tooltip = '', isDisable = false, onClick, }) => {
|
|
8
|
+
export const Icon = ({ nameIcon, propsIcon, className, tooltip = '', isDisable = false, onClick, }) => {
|
|
9
9
|
try {
|
|
10
10
|
const iconProps = {
|
|
11
11
|
...propsIcon,
|
|
@@ -60,7 +60,7 @@ export const Icon = ({ nameIcon, propsIcon, tooltip = '', isDisable = false, onC
|
|
|
60
60
|
const ElementIcon = loadable(loadLibrary, {
|
|
61
61
|
resolveComponent: (el) => el[nameIcon] != null ? el[nameIcon] : el[Object.keys(el.default)[0]],
|
|
62
62
|
});
|
|
63
|
-
return (_jsx("div", { className: cn(s.iconContainer), onClick: () => {
|
|
63
|
+
return (_jsx("div", { className: cn(s.iconContainer, className), onClick: () => {
|
|
64
64
|
if (!isDisable)
|
|
65
65
|
onClick && onClick();
|
|
66
66
|
}, children: !_.isEmpty(tooltip) ? (_jsx(Tooltip, { content: tooltip, children: _jsx(ElementIcon, { ...iconProps, className: cn(s.icon) }) })) : (_jsx(Suspense, { fallback: _jsx("div", { children: "Loading..." }), children: _jsx(ElementIcon, { ...iconProps, className: cn(s.icon) }) })) }));
|