@dilicorp/ui 0.2.17 → 0.2.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.
package/dist/atoms/icon.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export declare type IconProps = {
|
|
|
6
6
|
className?: string;
|
|
7
7
|
id?: string;
|
|
8
8
|
size?: 'lg' | 'md' | 'sm';
|
|
9
|
+
title?: string;
|
|
9
10
|
};
|
|
10
|
-
export declare const Icon: ({ icon, brand,
|
|
11
|
+
export declare const Icon: ({ pluxee, icon, brand, className, id, size, ...props }: IconProps) => JSX.Element;
|
|
11
12
|
//# sourceMappingURL=icon.d.ts.map
|
package/dist/atoms/icon.js
CHANGED
|
@@ -1,14 +1,26 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
1
12
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
2
13
|
import * as fab from '@fortawesome/free-brands-svg-icons';
|
|
3
14
|
import * as fa from '@fortawesome/free-solid-svg-icons';
|
|
4
15
|
import stringHelper from '../utils/string-helper';
|
|
5
16
|
import React from 'react';
|
|
6
17
|
import { PluxeeIcon } from './pluxee-icon/pluxee-icon';
|
|
7
|
-
export const Icon = (
|
|
18
|
+
export const Icon = (_a) => {
|
|
19
|
+
var { pluxee, icon, brand, className = '', id, size } = _a, props = __rest(_a, ["pluxee", "icon", "brand", "className", "id", "size"]);
|
|
8
20
|
if (pluxee) {
|
|
9
|
-
return React.createElement(PluxeeIcon, { icon: icon, size: size });
|
|
21
|
+
return (React.createElement(PluxeeIcon, Object.assign({ icon: icon, size: size }, props)));
|
|
10
22
|
}
|
|
11
23
|
const sanitize = stringHelper.toCamelCase(icon);
|
|
12
24
|
const ico = brand ? fab[sanitize] : fa[sanitize];
|
|
13
|
-
return React.createElement(FontAwesomeIcon, { id: id, icon: ico, className: className });
|
|
25
|
+
return (React.createElement(FontAwesomeIcon, Object.assign({ id: id, icon: ico, className: className }, props)));
|
|
14
26
|
};
|
|
@@ -14,7 +14,7 @@ import { Icon } from '../../atoms/icon';
|
|
|
14
14
|
import { Link } from '../../index';
|
|
15
15
|
const InnerItem = ({ icon, iconSize = 'md', pluxee, label, dataLink }) => {
|
|
16
16
|
return (React.createElement(React.Fragment, null,
|
|
17
|
-
icon && React.createElement(Icon, { icon: icon, pluxee: pluxee, size: iconSize }),
|
|
17
|
+
icon && React.createElement(Icon, { title: label, icon: icon, pluxee: pluxee, size: iconSize }),
|
|
18
18
|
React.createElement("span", { title: label, style: Object.assign({}, (iconSize === 'sm' && { fontSize: 12 })), className: "link_name", "data-link": `${dataLink ? 'link' : 'container'}` }, label)));
|
|
19
19
|
};
|
|
20
20
|
export const SideNavigationBarItem = (props) => {
|