@akinon/icons 0.1.1 → 0.3.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/dist/{icomoon.d.ts → cjs/icomoon.d.ts} +1 -2
- package/dist/cjs/icomoon.d.ts.map +1 -0
- package/dist/cjs/icomoon.js +42 -0
- package/dist/{icon.d.ts → cjs/icon.d.ts} +1 -1
- package/dist/cjs/icon.d.ts.map +1 -0
- package/dist/cjs/icon.js +20 -0
- package/dist/{index.d.ts.map → cjs/index.d.ts.map} +1 -1
- package/dist/cjs/index.js +17 -0
- package/dist/{selection.json.d.ts → cjs/selection.json} +1 -4
- package/dist/esm/icomoon.d.ts +30 -0
- package/dist/esm/icomoon.d.ts.map +1 -0
- package/dist/esm/icomoon.js +38 -0
- package/dist/esm/icon.d.ts +11 -0
- package/dist/esm/icon.d.ts.map +1 -0
- package/dist/esm/icon.js +15 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/selection.json +5821 -0
- package/package.json +18 -11
- package/dist/icomoon.d.ts.map +0 -1
- package/dist/icon.d.ts.map +0 -1
- package/dist/index.cjs +0 -1
- package/dist/index.js +0 -7319
- /package/dist/{index.d.ts → cjs/index.d.ts} +0 -0
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { CSSProperties, JSXElementConstructor, SVGProps } from 'react';
|
|
2
|
-
|
|
3
2
|
type IconSetItem = {
|
|
4
3
|
properties: {
|
|
5
4
|
name: string;
|
|
@@ -26,6 +25,6 @@ export interface IconProps extends SVGProps<SVGElement> {
|
|
|
26
25
|
interface IcomoonProps extends IconProps {
|
|
27
26
|
iconSet: IconSet;
|
|
28
27
|
}
|
|
29
|
-
export declare const Icomoon: ({ iconSet, icon, size, title, disableFill, removeInlineStyle, SvgComponent, PathComponent, ...props }: IcomoonProps) => import(
|
|
28
|
+
export declare const Icomoon: ({ iconSet, icon, size, title, disableFill, removeInlineStyle, SvgComponent, PathComponent, ...props }: IcomoonProps) => import("react").ReactElement<any, string | JSXElementConstructor<any>> | null;
|
|
30
29
|
export {};
|
|
31
30
|
//# sourceMappingURL=icomoon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icomoon.d.ts","sourceRoot":"","sources":["../../src/icomoon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EACb,qBAAqB,EACrB,QAAQ,EACT,MAAM,OAAO,CAAC;AAEf,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE;QACV,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QACjB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KACzB,CAAC;CACH,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,WAAW,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,WAAW,SAAU,SAAQ,QAAQ,CAAC,UAAU,CAAC;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B,YAAY,CAAC,EAAE,qBAAqB,CAAC,GAAG,CAAC,CAAC;IAE1C,aAAa,CAAC,EAAE,qBAAqB,CAAC,GAAG,CAAC,CAAC;IAC3C,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,UAAU,YAAa,SAAQ,SAAS;IACtC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,eAAO,MAAM,OAAO,0GAUjB,YAAY,kFAyCd,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.Icomoon = void 0;
|
|
15
|
+
const react_1 = require("react");
|
|
16
|
+
const Icomoon = (_a) => {
|
|
17
|
+
var { iconSet, icon, size = 24, title, disableFill, removeInlineStyle, SvgComponent, PathComponent } = _a, props = __rest(_a, ["iconSet", "icon", "size", "title", "disableFill", "removeInlineStyle", "SvgComponent", "PathComponent"]);
|
|
18
|
+
if (!iconSet || !icon)
|
|
19
|
+
return null;
|
|
20
|
+
const currentIcon = iconSet.icons.find(item => item.properties.name === icon);
|
|
21
|
+
if (!currentIcon)
|
|
22
|
+
return null;
|
|
23
|
+
const initialStyle = {
|
|
24
|
+
display: 'inline-block',
|
|
25
|
+
stroke: 'currentColor',
|
|
26
|
+
fill: 'currentColor'
|
|
27
|
+
};
|
|
28
|
+
const computedStyle = Object.assign(Object.assign(Object.assign({}, (removeInlineStyle ? {} : initialStyle)), (size ? { width: size, height: size } : {})), (props.style || {}));
|
|
29
|
+
const { width = '1024' } = currentIcon.icon;
|
|
30
|
+
const viewBox = `0 0 ${width} 1024`;
|
|
31
|
+
const children = currentIcon.icon.paths.map((path, index) => {
|
|
32
|
+
var _a;
|
|
33
|
+
const attrs = (_a = currentIcon.icon.attrs) === null || _a === void 0 ? void 0 : _a[index];
|
|
34
|
+
const pathProps = Object.assign({ d: path, key: icon + index }, (!disableFill && attrs ? attrs : {}));
|
|
35
|
+
return (0, react_1.createElement)(PathComponent || 'path', pathProps);
|
|
36
|
+
});
|
|
37
|
+
if (title) {
|
|
38
|
+
children.push((0, react_1.createElement)('title', { key: title }, title));
|
|
39
|
+
}
|
|
40
|
+
return (0, react_1.createElement)(SvgComponent || 'svg', Object.assign(Object.assign({}, props), { viewBox, style: computedStyle }), children);
|
|
41
|
+
};
|
|
42
|
+
exports.Icomoon = Icomoon;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAW,SAAS,EAAE,MAAM,WAAW,CAAC;AAG/C,eAAO,MAAM,IAAI,UAAW,SAAS,sBAEpC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,WAAW,uBAGvB,CAAC"}
|
package/dist/cjs/icon.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getIconList = exports.Icon = void 0;
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const icomoon_1 = require("./icomoon");
|
|
6
|
+
const selection_json_1 = require("./selection.json");
|
|
7
|
+
const Icon = (props) => (React.createElement(icomoon_1.Icomoon, Object.assign({ iconSet: selection_json_1.default }, props)));
|
|
8
|
+
exports.Icon = Icon;
|
|
9
|
+
/**
|
|
10
|
+
* Returns the full list of available icons.
|
|
11
|
+
* Can be used for documentation purposes.
|
|
12
|
+
*
|
|
13
|
+
* @returns {string[]}
|
|
14
|
+
*/
|
|
15
|
+
const getIconList = () => {
|
|
16
|
+
if (!selection_json_1.default || !Array.isArray(selection_json_1.default.icons))
|
|
17
|
+
return null;
|
|
18
|
+
return selection_json_1.default.icons.map(icon => icon.properties.name);
|
|
19
|
+
};
|
|
20
|
+
exports.getIconList = getIconList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./icon"), exports);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CSSProperties, JSXElementConstructor, SVGProps } from 'react';
|
|
2
|
+
type IconSetItem = {
|
|
3
|
+
properties: {
|
|
4
|
+
name: string;
|
|
5
|
+
};
|
|
6
|
+
icon: {
|
|
7
|
+
paths: string[];
|
|
8
|
+
attrs?: object[];
|
|
9
|
+
width?: number | string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
type IconSet = {
|
|
13
|
+
icons: IconSetItem[];
|
|
14
|
+
};
|
|
15
|
+
export interface IconProps extends SVGProps<SVGElement> {
|
|
16
|
+
icon: string;
|
|
17
|
+
size?: string | number;
|
|
18
|
+
title?: string;
|
|
19
|
+
disableFill?: boolean;
|
|
20
|
+
removeInlineStyle?: boolean;
|
|
21
|
+
SvgComponent?: JSXElementConstructor<any>;
|
|
22
|
+
PathComponent?: JSXElementConstructor<any>;
|
|
23
|
+
style?: CSSProperties;
|
|
24
|
+
}
|
|
25
|
+
interface IcomoonProps extends IconProps {
|
|
26
|
+
iconSet: IconSet;
|
|
27
|
+
}
|
|
28
|
+
export declare const Icomoon: ({ iconSet, icon, size, title, disableFill, removeInlineStyle, SvgComponent, PathComponent, ...props }: IcomoonProps) => import("react").ReactElement<any, string | JSXElementConstructor<any>> | null;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=icomoon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icomoon.d.ts","sourceRoot":"","sources":["../../src/icomoon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EACb,qBAAqB,EACrB,QAAQ,EACT,MAAM,OAAO,CAAC;AAEf,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE;QACV,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QACjB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KACzB,CAAC;CACH,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,WAAW,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,WAAW,SAAU,SAAQ,QAAQ,CAAC,UAAU,CAAC;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B,YAAY,CAAC,EAAE,qBAAqB,CAAC,GAAG,CAAC,CAAC;IAE1C,aAAa,CAAC,EAAE,qBAAqB,CAAC,GAAG,CAAC,CAAC;IAC3C,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,UAAU,YAAa,SAAQ,SAAS;IACtC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,eAAO,MAAM,OAAO,0GAUjB,YAAY,kFAyCd,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
};
|
|
12
|
+
import { createElement } from 'react';
|
|
13
|
+
export const Icomoon = (_a) => {
|
|
14
|
+
var { iconSet, icon, size = 24, title, disableFill, removeInlineStyle, SvgComponent, PathComponent } = _a, props = __rest(_a, ["iconSet", "icon", "size", "title", "disableFill", "removeInlineStyle", "SvgComponent", "PathComponent"]);
|
|
15
|
+
if (!iconSet || !icon)
|
|
16
|
+
return null;
|
|
17
|
+
const currentIcon = iconSet.icons.find(item => item.properties.name === icon);
|
|
18
|
+
if (!currentIcon)
|
|
19
|
+
return null;
|
|
20
|
+
const initialStyle = {
|
|
21
|
+
display: 'inline-block',
|
|
22
|
+
stroke: 'currentColor',
|
|
23
|
+
fill: 'currentColor'
|
|
24
|
+
};
|
|
25
|
+
const computedStyle = Object.assign(Object.assign(Object.assign({}, (removeInlineStyle ? {} : initialStyle)), (size ? { width: size, height: size } : {})), (props.style || {}));
|
|
26
|
+
const { width = '1024' } = currentIcon.icon;
|
|
27
|
+
const viewBox = `0 0 ${width} 1024`;
|
|
28
|
+
const children = currentIcon.icon.paths.map((path, index) => {
|
|
29
|
+
var _a;
|
|
30
|
+
const attrs = (_a = currentIcon.icon.attrs) === null || _a === void 0 ? void 0 : _a[index];
|
|
31
|
+
const pathProps = Object.assign({ d: path, key: icon + index }, (!disableFill && attrs ? attrs : {}));
|
|
32
|
+
return createElement(PathComponent || 'path', pathProps);
|
|
33
|
+
});
|
|
34
|
+
if (title) {
|
|
35
|
+
children.push(createElement('title', { key: title }, title));
|
|
36
|
+
}
|
|
37
|
+
return createElement(SvgComponent || 'svg', Object.assign(Object.assign({}, props), { viewBox, style: computedStyle }), children);
|
|
38
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IconProps } from './icomoon';
|
|
3
|
+
export declare const Icon: (props: IconProps) => React.JSX.Element;
|
|
4
|
+
/**
|
|
5
|
+
* Returns the full list of available icons.
|
|
6
|
+
* Can be used for documentation purposes.
|
|
7
|
+
*
|
|
8
|
+
* @returns {string[]}
|
|
9
|
+
*/
|
|
10
|
+
export declare const getIconList: () => string[] | null;
|
|
11
|
+
//# sourceMappingURL=icon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAW,SAAS,EAAE,MAAM,WAAW,CAAC;AAG/C,eAAO,MAAM,IAAI,UAAW,SAAS,sBAEpC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,WAAW,uBAGvB,CAAC"}
|
package/dist/esm/icon.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Icomoon } from './icomoon';
|
|
3
|
+
import icons from './selection.json';
|
|
4
|
+
export const Icon = (props) => (React.createElement(Icomoon, Object.assign({ iconSet: icons }, props)));
|
|
5
|
+
/**
|
|
6
|
+
* Returns the full list of available icons.
|
|
7
|
+
* Can be used for documentation purposes.
|
|
8
|
+
*
|
|
9
|
+
* @returns {string[]}
|
|
10
|
+
*/
|
|
11
|
+
export const getIconList = () => {
|
|
12
|
+
if (!icons || !Array.isArray(icons.icons))
|
|
13
|
+
return null;
|
|
14
|
+
return icons.icons.map(icon => icon.properties.name);
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './icon';
|