@iconify-icon/react 0.0.1 → 1.0.0-beta.2
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/iconify.d.ts +2 -2
- package/dist/iconify.js +3 -6
- package/dist/iconify.mjs +3 -5
- package/package.json +54 -54
- package/readme.md +20 -128
package/dist/iconify.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IconifyIconProperties, IconifyIconHTMLElement } from 'iconify-icon';
|
|
3
|
-
export { GetAPIConfig, IconifyAPIConfig, IconifyAPICustomQueryParams, IconifyAPIFunctions, IconifyAPIInternalFunctions, IconifyAPIModule, IconifyAPIPrepareIconsQuery, IconifyAPIQueryParams, IconifyAPISendQuery, IconifyBrowserCacheFunctions, IconifyBrowserCacheType, IconifyBuilderFunctions, IconifyIcon, IconifyIconAttributes, IconifyIconBuildResult, IconifyIconCustomisations, IconifyIconHTMLElement, IconifyIconLoaderAbort, IconifyIconLoaderCallback, IconifyIconName, IconifyIconProperties, IconifyIconSize, IconifyJSON, IconifyRenderMode, IconifyStorageFunctions, PartialIconifyAPIConfig, _api, addAPIProvider, addCollection, addIcon, buildIcon, calculateSize, disableCache, enableCache, getIcon, iconExists, listIcons, loadIcon, loadIcons
|
|
3
|
+
export { GetAPIConfig, IconifyAPIConfig, IconifyAPICustomQueryParams, IconifyAPIFunctions, IconifyAPIInternalFunctions, IconifyAPIModule, IconifyAPIPrepareIconsQuery, IconifyAPIQueryParams, IconifyAPISendQuery, IconifyBrowserCacheFunctions, IconifyBrowserCacheType, IconifyBuilderFunctions, IconifyIcon, IconifyIconAttributes, IconifyIconBuildResult, IconifyIconCustomisations, IconifyIconHTMLElement, IconifyIconLoaderAbort, IconifyIconLoaderCallback, IconifyIconName, IconifyIconProperties, IconifyIconSize, IconifyJSON, IconifyRenderMode, IconifyStorageFunctions, PartialIconifyAPIConfig, _api, addAPIProvider, addCollection, addIcon, buildIcon, calculateSize, disableCache, enableCache, getIcon, iconExists, listIcons, loadIcon, loadIcons } from 'iconify-icon';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Properties for React component
|
|
@@ -11,6 +11,6 @@ interface IconifyIconProps extends React.HTMLProps<HTMLElement>, IconifyIconProp
|
|
|
11
11
|
/**
|
|
12
12
|
* React component
|
|
13
13
|
*/
|
|
14
|
-
declare const Icon: React.ForwardRefExoticComponent<Pick<IconifyIconProps, "rotate" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "children" | "list" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "nonce" | "noValidate" | "open" | "optimum" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "size" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "icon" | "mode" | "inline" | "flip"> & React.RefAttributes<IconifyIconHTMLElement>>;
|
|
14
|
+
declare const Icon: React.ForwardRefExoticComponent<Pick<IconifyIconProps, "preserveAspectRatio" | "rotate" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "children" | "list" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "multiple" | "muted" | "name" | "nonce" | "noValidate" | "open" | "optimum" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "size" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "icon" | "mode" | "inline" | "flip"> & React.RefAttributes<IconifyIconHTMLElement>>;
|
|
15
15
|
|
|
16
16
|
export { Icon, IconifyIconProps };
|
package/dist/iconify.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -35,9 +36,7 @@ __export(iconify_exports, {
|
|
|
35
36
|
iconExists: () => import_iconify_icon.iconExists,
|
|
36
37
|
listIcons: () => import_iconify_icon.listIcons,
|
|
37
38
|
loadIcon: () => import_iconify_icon.loadIcon,
|
|
38
|
-
loadIcons: () => import_iconify_icon.loadIcons
|
|
39
|
-
replaceIDs: () => import_iconify_icon.replaceIDs,
|
|
40
|
-
shareStorage: () => import_iconify_icon.shareStorage
|
|
39
|
+
loadIcons: () => import_iconify_icon.loadIcons
|
|
41
40
|
});
|
|
42
41
|
module.exports = __toCommonJS(iconify_exports);
|
|
43
42
|
var import_react = __toESM(require("react"));
|
|
@@ -73,7 +72,5 @@ var Icon = import_react.default.forwardRef((props, ref) => {
|
|
|
73
72
|
iconExists,
|
|
74
73
|
listIcons,
|
|
75
74
|
loadIcon,
|
|
76
|
-
loadIcons
|
|
77
|
-
replaceIDs,
|
|
78
|
-
shareStorage
|
|
75
|
+
loadIcons
|
|
79
76
|
});
|
package/dist/iconify.mjs
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
1
3
|
// src/iconify.ts
|
|
2
4
|
import React from "react";
|
|
3
5
|
import {
|
|
@@ -6,11 +8,9 @@ import {
|
|
|
6
8
|
iconExists,
|
|
7
9
|
getIcon,
|
|
8
10
|
listIcons,
|
|
9
|
-
shareStorage,
|
|
10
11
|
addIcon,
|
|
11
12
|
addCollection,
|
|
12
13
|
calculateSize,
|
|
13
|
-
replaceIDs,
|
|
14
14
|
buildIcon,
|
|
15
15
|
loadIcons,
|
|
16
16
|
loadIcon,
|
|
@@ -47,7 +47,5 @@ export {
|
|
|
47
47
|
iconExists,
|
|
48
48
|
listIcons,
|
|
49
49
|
loadIcon,
|
|
50
|
-
loadIcons
|
|
51
|
-
replaceIDs,
|
|
52
|
-
shareStorage
|
|
50
|
+
loadIcons
|
|
53
51
|
};
|
package/package.json
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
2
|
+
"name": "@iconify-icon/react",
|
|
3
|
+
"description": "React wrapper for Iconify Icon web component",
|
|
4
|
+
"author": "Vjacheslav Trushkin",
|
|
5
|
+
"version": "1.0.0-beta.2",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"bugs": "https://github.com/iconify/iconify/issues",
|
|
8
|
+
"homepage": "https://iconify.design/",
|
|
9
|
+
"funding": "http://github.com/sponsors/cyberalien",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/iconify/iconify.git",
|
|
13
|
+
"directory": "iconify-icon/react"
|
|
14
|
+
},
|
|
15
|
+
"main": "dist/iconify.js",
|
|
16
|
+
"module": "dist/iconify.mjs",
|
|
17
|
+
"types": "dist/iconify.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
"./*": "./*",
|
|
20
|
+
".": {
|
|
21
|
+
"import": "./dist/iconify.mjs",
|
|
22
|
+
"types": "./dist/iconify.d.ts",
|
|
23
|
+
"default": "./dist/iconify.js"
|
|
24
|
+
},
|
|
25
|
+
"./lib/iconify": {
|
|
26
|
+
"require": "./dist/iconify.js",
|
|
27
|
+
"import": "./dist/iconify.mjs",
|
|
28
|
+
"types": "./dist/iconify.d.ts"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"iconify-icon": "^1.0.0-beta.2"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@types/react": "^17.0.47",
|
|
36
|
+
"@types/react-test-renderer": "^18.0.0",
|
|
37
|
+
"@vitejs/plugin-react": "^1.3.2",
|
|
38
|
+
"jest": "^28.1.1",
|
|
39
|
+
"react": "^18.2.0",
|
|
40
|
+
"react-test-renderer": "^18.2.0",
|
|
41
|
+
"rimraf": "^3.0.2",
|
|
42
|
+
"tsup": "^5.12.9",
|
|
43
|
+
"typescript": "^4.7.4",
|
|
44
|
+
"vitest": "^0.12.10"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"react": ">=16"
|
|
48
|
+
},
|
|
49
|
+
"scripts": {
|
|
50
|
+
"clean": "rimraf lib dist tsconfig.tsbuildinfo",
|
|
51
|
+
"prebuild": "pnpm run clean",
|
|
52
|
+
"build": "tsup",
|
|
53
|
+
"test": "vitest --config vitest.config.mjs"
|
|
54
|
+
}
|
|
55
|
+
}
|
package/readme.md
CHANGED
|
@@ -1,44 +1,31 @@
|
|
|
1
|
-
# Iconify for React
|
|
1
|
+
# Iconify Icon for React
|
|
2
2
|
|
|
3
|
-
Iconify
|
|
4
|
-
|
|
5
|
-
What you get with other components:
|
|
6
|
-
|
|
7
|
-
- Limited set of icons.
|
|
8
|
-
- Large bundle size because all icons are bundled.
|
|
9
|
-
|
|
10
|
-
Iconify icon component is nothing like that. Component does not include any icon data, it is not tied to any specific icon set. Instead, all data is retrieved from public API on demand.
|
|
11
|
-
|
|
12
|
-
That means:
|
|
13
|
-
|
|
14
|
-
- One syntax for over 100,000 icons from 100+ icon sets.
|
|
15
|
-
- Renders SVG. Many components simply render icon fonts, which look ugly. Iconify renders pixel perfect SVG.
|
|
16
|
-
- Loads icons on demand. No need to bundle icons, component will automatically load icon data for icons that you use from Iconify API.
|
|
3
|
+
Iconify Icon web component is a wrapper for `iconify-icon` package, which provides React component and typings.
|
|
17
4
|
|
|
18
5
|
For more information about Iconify project visit [https://iconify.design/](https://iconify.design/).
|
|
19
6
|
|
|
20
|
-
For
|
|
7
|
+
For documentation visit [Iconify Icon web component documentation](https://docs.iconify.design/iconify-icon/).
|
|
21
8
|
|
|
22
9
|
## Installation
|
|
23
10
|
|
|
24
11
|
If you are using NPM:
|
|
25
12
|
|
|
26
13
|
```bash
|
|
27
|
-
npm install --save-dev @iconify/react
|
|
14
|
+
npm install --save-dev @iconify-icon/react
|
|
28
15
|
```
|
|
29
16
|
|
|
30
17
|
If you are using Yarn:
|
|
31
18
|
|
|
32
19
|
```bash
|
|
33
|
-
yarn add --dev @iconify/react
|
|
20
|
+
yarn add --dev @iconify-icon/react
|
|
34
21
|
```
|
|
35
22
|
|
|
36
|
-
## Usage
|
|
23
|
+
## Usage
|
|
37
24
|
|
|
38
|
-
Install `@iconify/react` and import `Icon` from it:
|
|
25
|
+
Install `@iconify-icon/react` and import `Icon` from it:
|
|
39
26
|
|
|
40
27
|
```typescript
|
|
41
|
-
import { Icon } from '@iconify/react';
|
|
28
|
+
import { Icon } from '@iconify-icon/react';
|
|
42
29
|
```
|
|
43
30
|
|
|
44
31
|
Then use `Icon` component with icon name or data as "icon" parameter:
|
|
@@ -59,7 +46,7 @@ If you want to use icon component without relying on public Iconify API, there a
|
|
|
59
46
|
2. You can create custom icon bundles (more efficient, but requires more coding).
|
|
60
47
|
3. You can host your own Iconify API instead of relying on third party service.
|
|
61
48
|
|
|
62
|
-
See [
|
|
49
|
+
See [offline use documentation](https://docs.iconify.design/iconify-icon/without-api.html) or [Iconify API documentation](https://docs.iconify.design/sources/api/).
|
|
63
50
|
|
|
64
51
|
## Icon Names
|
|
65
52
|
|
|
@@ -74,14 +61,14 @@ It has 3 parts, separated by ":":
|
|
|
74
61
|
- prefix is name of icon set.
|
|
75
62
|
- name is name of icon.
|
|
76
63
|
|
|
77
|
-
See [
|
|
64
|
+
See [icon names documentation](https://docs.iconify.design/iconify-icon/icon-name.html) for more detailed explanation.
|
|
78
65
|
|
|
79
66
|
## Using icon data
|
|
80
67
|
|
|
81
68
|
Instead of icon name, you can pass icon data to component:
|
|
82
69
|
|
|
83
70
|
```jsx
|
|
84
|
-
import { Icon } from '@iconify/react';
|
|
71
|
+
import { Icon } from '@iconify-icon/react';
|
|
85
72
|
import home from '@iconify-icons/mdi-light/home';
|
|
86
73
|
|
|
87
74
|
function renderHomeIcon() {
|
|
@@ -93,7 +80,7 @@ See [icon packages documentation](https://docs.iconify.design/sources/npm/) for
|
|
|
93
80
|
|
|
94
81
|
### Next.js notice
|
|
95
82
|
|
|
96
|
-
Example above
|
|
83
|
+
Example above might fail with Next.js. This is because Next.js uses outdated packaging software that does not support ES modules. But do not worry, there is a simple solution: switch to CommonJS icon packages.
|
|
97
84
|
|
|
98
85
|
To switch to CommonJS package, replace this line in example above:
|
|
99
86
|
|
|
@@ -111,83 +98,21 @@ All icons are available as ES modules for modern bundler and as CommonJS modules
|
|
|
111
98
|
|
|
112
99
|
For more details, see [icon packages documentation](https://docs.iconify.design/sources/npm/).
|
|
113
100
|
|
|
114
|
-
## Inline icon
|
|
115
|
-
|
|
116
|
-
Icons have 2 modes: inline and block. Difference between modes is `vertical-align` that is added to inline icons.
|
|
117
|
-
|
|
118
|
-
Inline icons are aligned slightly below baseline, so they look centred compared to text, like glyph fonts.
|
|
119
|
-
|
|
120
|
-
Block icons do not have alignment, like images, which aligns them to baseline by default.
|
|
121
|
-
|
|
122
|
-
Alignment option was added to make icons look like continuation of text, behaving like glyph fonts. This should make migration from glyph fonts easier.
|
|
123
|
-
|
|
124
|
-
```jsx
|
|
125
|
-
import React from 'react';
|
|
126
|
-
import { Icon, InlineIcon } from '@iconify/react';
|
|
127
|
-
|
|
128
|
-
export function inlineDemo() {
|
|
129
|
-
return (
|
|
130
|
-
<div>
|
|
131
|
-
<p>
|
|
132
|
-
Block:
|
|
133
|
-
<Icon icon="line-md:image-twotone" />
|
|
134
|
-
<Icon icon="mdi:account-box-outline" />
|
|
135
|
-
</p>
|
|
136
|
-
<p>
|
|
137
|
-
Inline:
|
|
138
|
-
<InlineIcon icon="line-md:image-twotone" />
|
|
139
|
-
<InlineIcon icon="mdi:account-box-outline" />
|
|
140
|
-
</p>
|
|
141
|
-
</div>
|
|
142
|
-
);
|
|
143
|
-
}
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
To toggle between block and inline modes, you can either use `InlineIcon` or use boolean `inline` property:
|
|
147
|
-
|
|
148
|
-
```jsx
|
|
149
|
-
import React from 'react';
|
|
150
|
-
import { Icon } from '@iconify/react';
|
|
151
|
-
|
|
152
|
-
export function inlineDemo() {
|
|
153
|
-
return (
|
|
154
|
-
<div>
|
|
155
|
-
<p>
|
|
156
|
-
Block:
|
|
157
|
-
<Icon icon="line-md:image-twotone" />
|
|
158
|
-
<Icon icon="mdi:account-box-outline" />
|
|
159
|
-
</p>
|
|
160
|
-
<p>
|
|
161
|
-
Inline:
|
|
162
|
-
<Icon icon="line-md:image-twotone" inline={true} />
|
|
163
|
-
<Icon icon="mdi:account-box-outline" inline={true} />
|
|
164
|
-
</p>
|
|
165
|
-
</div>
|
|
166
|
-
);
|
|
167
|
-
}
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
Visual example to show the difference between inline and block modes:
|
|
171
|
-
|
|
172
|
-

|
|
173
|
-
|
|
174
101
|
## Icon component properties
|
|
175
102
|
|
|
176
103
|
`icon` property is mandatory. It tells component what icon to render. The value can be a string containing the icon name or an object containing the icon data.
|
|
177
104
|
|
|
178
105
|
The icon component has the following optional properties:
|
|
179
106
|
|
|
180
|
-
- `inline`. Changes icon behaviour to match icon fonts.
|
|
107
|
+
- `inline`. Changes icon behaviour to match icon fonts. If set to `true`, it adds vertical alignment to icon to render it below text baseline, so it fits nicely in text.
|
|
181
108
|
- `width` and `height`. Icon dimensions. The default values are "1em" for both. See "Dimensions" section below.
|
|
182
109
|
- `color`. Icon colour. This is the same as setting colour in style. See "Icon colour" section below.
|
|
183
|
-
- `flip
|
|
110
|
+
- `flip`. Flip icon horizontally and/or vertically. See "Transformations" section below.
|
|
184
111
|
- `rotate`. Rotate icon by 90, 180 or 270 degrees. See "Transformations" section below.
|
|
185
|
-
- `align`, `vAlign`, `hAlign`, `slice`. Icon alignment. See "Alignment" section below.
|
|
186
|
-
- `onLoad`. Callback function that is called when icon data has been loaded. See "onLoad" section below.
|
|
187
112
|
|
|
188
113
|
### Other properties and events
|
|
189
114
|
|
|
190
|
-
In addition to the properties mentioned above, the icon component accepts any other properties and events.
|
|
115
|
+
In addition to the properties mentioned above, the icon component accepts any other properties and events.
|
|
191
116
|
|
|
192
117
|
### Dimensions
|
|
193
118
|
|
|
@@ -252,22 +177,10 @@ There are two types of icons: icons that do not have a palette and icons that do
|
|
|
252
177
|
|
|
253
178
|
Icons that do have a palette, such as emojis, cannot be customised. Setting colour to such icons will not change anything.
|
|
254
179
|
|
|
255
|
-
Icons that do not have a palette can be customised. By default, colour is set to "currentColor", which means the icon's colour matches text colour. To change the colour you
|
|
256
|
-
|
|
257
|
-
- Set `color` style or use stylesheet to target icon. If you are using the stylesheet, target `svg` element.
|
|
258
|
-
- Add `color` property.
|
|
180
|
+
Icons that do not have a palette can be customised. By default, colour is set to "currentColor", which means the icon's colour matches text colour. To change the colour you need to change text color.
|
|
259
181
|
|
|
260
182
|
Examples:
|
|
261
183
|
|
|
262
|
-
Using `color` property:
|
|
263
|
-
|
|
264
|
-
```jsx
|
|
265
|
-
<Icon icon="eva:alert-triangle-fill" color="red" />
|
|
266
|
-
<Icon icon="eva:alert-triangle-fill" color="#f00" />
|
|
267
|
-
```
|
|
268
|
-
|
|
269
|
-
Using inline style:
|
|
270
|
-
|
|
271
184
|
```jsx
|
|
272
185
|
<Icon icon="eva:alert-triangle-fill" style={{color: 'red'}} />
|
|
273
186
|
<Icon icon="eva:alert-triangle-fill" style={{color: '#f00'}} />
|
|
@@ -301,36 +214,29 @@ Rotating 16x24 icon by 90 degrees results in:
|
|
|
301
214
|
- CSS transformation keeps 16x24 bounding box, which might cause the icon to overlap text around it.
|
|
302
215
|
- Icon transformation changes bounding box to 24x16, rotating content inside an icon.
|
|
303
216
|
|
|
304
|
-
See [icon transformations documentation](https://docs.iconify.design/icon
|
|
217
|
+
See [icon transformations documentation](https://docs.iconify.design/iconify-icon/transform.html) for more details.
|
|
305
218
|
|
|
306
219
|
#### Flipping an icon
|
|
307
220
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
- `hFlip`: boolean property, flips icon horizontally.
|
|
311
|
-
- `vFlip`: boolean property, flips icon vertically.
|
|
312
|
-
- `flip`: shorthand string property, can flip icon horizontally and/or vertically.
|
|
221
|
+
You can flip an icon horizontally and/or vertically by setting `flip` property.
|
|
313
222
|
|
|
314
223
|
Examples:
|
|
315
224
|
|
|
316
225
|
Flip an icon horizontally:
|
|
317
226
|
|
|
318
227
|
```jsx
|
|
319
|
-
<Icon icon="eva:alert-triangle-fill" hFlip={true} />
|
|
320
228
|
<Icon icon="eva:alert-triangle-fill" flip="horizontal" />
|
|
321
229
|
```
|
|
322
230
|
|
|
323
231
|
Flip an icon vertically:
|
|
324
232
|
|
|
325
233
|
```jsx
|
|
326
|
-
<Icon icon="eva:alert-triangle-fill" vFlip={true} />
|
|
327
234
|
<Icon icon="eva:alert-triangle-fill" flip="vertical" />
|
|
328
235
|
```
|
|
329
236
|
|
|
330
237
|
Flip an icon horizontally and vertically (the same as 180 degrees rotation):
|
|
331
238
|
|
|
332
239
|
```jsx
|
|
333
|
-
<Icon icon="eva:alert-triangle-fill" hFlip={true} vFlip={true} />
|
|
334
240
|
<Icon icon="eva:alert-triangle-fill" flip="horizontal,vertical" />
|
|
335
241
|
```
|
|
336
242
|
|
|
@@ -350,28 +256,14 @@ Examples of 90 degrees rotation:
|
|
|
350
256
|
<Icon icon="eva:alert-triangle-fill" rotate="25%" />
|
|
351
257
|
```
|
|
352
258
|
|
|
353
|
-
### onLoad
|
|
354
|
-
|
|
355
|
-
`onLoad` property is an optional callback function. It is called when icon data has been loaded.
|
|
356
|
-
|
|
357
|
-
It is not an event, such as `onClick` event for links, it is a simple callback function.
|
|
358
|
-
|
|
359
|
-
When `onLoad` is called:
|
|
360
|
-
|
|
361
|
-
- If value of icon property is an object, `onLoad` is not called.
|
|
362
|
-
- If value of icon property is a string and icon data is available, `onLoad` is called on first render.
|
|
363
|
-
- If value of icon property is a string and icon data is not available, `onLoad` is called on first re-render after icon data is retrieved from API.
|
|
364
|
-
|
|
365
|
-
What is the purpose of `onLoad`? To let you know when Icon component renders an icon and when it does not render anything. This allows you to do things like adding class name for parent element, such as "container--with-icon" that modify layout if icon is being displayed.
|
|
366
|
-
|
|
367
259
|
## Full documentation
|
|
368
260
|
|
|
369
|
-
For extended documentation visit [Iconify
|
|
261
|
+
For extended documentation visit [Iconify Icon web component documentation](https://docs.iconify.design/iconify-icon/).
|
|
370
262
|
|
|
371
263
|
## License
|
|
372
264
|
|
|
373
265
|
React component is released with MIT license.
|
|
374
266
|
|
|
375
|
-
©
|
|
267
|
+
© 2022 Vjacheslav Trushkin / Iconify OÜ
|
|
376
268
|
|
|
377
269
|
See [Iconify icon sets page](https://icon-sets.iconify.design/) for list of collections and their licenses.
|