@sydsoft/base 1.9.0 → 1.10.0
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/package.json
CHANGED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { iconMap } from "./icons";
|
|
3
|
-
export declare const iconList: ("search" | "close" | "edit" | "keyboard_arrow_up" | "keyboard_arrow_down")[];
|
|
4
|
-
export type IconName = keyof typeof iconMap;
|
|
5
|
-
interface BaseProps {
|
|
6
|
-
color?: string;
|
|
7
|
-
fontSize?: number | string;
|
|
8
|
-
style?: React.CSSProperties;
|
|
9
|
-
className?: string;
|
|
10
|
-
[key: string]: any;
|
|
11
|
-
}
|
|
12
|
-
interface NameIconProps extends BaseProps {
|
|
13
|
-
name: IconName;
|
|
14
|
-
customIcon?: never;
|
|
15
|
-
}
|
|
16
|
-
interface CustomIconProps extends BaseProps {
|
|
17
|
-
customIcon: {
|
|
18
|
-
viewBox: string;
|
|
19
|
-
content: string;
|
|
20
|
-
};
|
|
21
|
-
name?: never;
|
|
22
|
-
}
|
|
23
|
-
export type Props = NameIconProps | CustomIconProps;
|
|
24
|
-
export declare const Icon: React.FC<Props>;
|
|
25
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { __assign, __rest } from "tslib";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { iconMap } from "./icons";
|
|
4
|
-
export var iconList = Object.keys(iconMap);
|
|
5
|
-
// https://fonts.google.com/icons adresinden ikonu seçtikten sonra kopyalayalıp alıyoruz. Icon adı da en atta hangisiyse onu ekleyelim, isimler karışmasın
|
|
6
|
-
var defaultIconStyle = {
|
|
7
|
-
userSelect: "none",
|
|
8
|
-
width: "1em",
|
|
9
|
-
height: "1em",
|
|
10
|
-
display: "inline-block",
|
|
11
|
-
verticalAlign: "middle",
|
|
12
|
-
flexShrink: 0,
|
|
13
|
-
};
|
|
14
|
-
export var Icon = function (_a) {
|
|
15
|
-
var name = _a.name, customIcon = _a.customIcon, fontSize = _a.fontSize, color = _a.color, className = _a.className, style = _a.style, other = __rest(_a, ["name", "customIcon", "fontSize", "color", "className", "style"]);
|
|
16
|
-
var iconComponent = name ? iconMap[name] : customIcon;
|
|
17
|
-
return (_jsx("span", __assign({ className: className, style: __assign(__assign(__assign({}, defaultIconStyle), style), { fontSize: fontSize || "1.5rem", color: color || "inherit" }) }, other, { children: (iconComponent && (_jsx("svg", { viewBox: iconComponent.viewBox, fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: _jsx("g", { dangerouslySetInnerHTML: { __html: iconComponent.content } }) }))) || _jsx("span", { children: "\u26A0\uFE0F" }) })));
|
|
18
|
-
};
|