@mal-icons/react 0.1.1 → 0.2.7
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/.tsbuildinfo +1 -1
- package/dist/{chunk-46yjgy8c.js → chunk-ckjps1mv.js} +8 -12
- package/dist/icons/demo/MlCheck.js +1 -1
- package/dist/icons/demo/MlCircle.js +1 -1
- package/dist/icons/demo/MlSquare.js +1 -1
- package/dist/icons/fi/FiActivity.js +1 -1
- package/dist/icons/fi/FiAirplay.js +1 -1
- package/dist/icons/fi/FiAlertCircle.js +1 -1
- package/dist/icons/fi/FiAlertOctagon.js +1 -1
- package/dist/icons/fi/FiAlertTriangle.js +1 -1
- package/dist/icons/fi/FiAlignCenter.js +1 -1
- package/dist/icons/fi/FiAlignJustify.js +1 -1
- package/dist/icons/fi/FiAlignLeft.js +1 -1
- package/dist/icons/fi/FiAlignRight.js +1 -1
- package/dist/icons/fi/FiAnchor.js +1 -1
- package/dist/icons/fi/FiAperture.js +1 -1
- package/dist/icons/fi/FiArchive.js +1 -1
- package/dist/icons/fi/FiArrowDown.js +1 -1
- package/dist/icons/fi/FiArrowDownCircle.js +1 -1
- package/dist/icons/fi/FiArrowDownLeft.js +1 -1
- package/dist/icons/fi/FiArrowDownRight.js +1 -1
- package/dist/icons/fi/FiArrowLeft.js +1 -1
- package/dist/icons/fi/FiArrowLeftCircle.js +1 -1
- package/dist/icons/fi/FiArrowRight.js +1 -1
- package/dist/icons/fi/FiArrowRightCircle.js +1 -1
- package/dist/icons/fi/FiArrowUp.js +1 -1
- package/dist/icons/fi/FiArrowUpCircle.js +1 -1
- package/dist/icons/fi/FiArrowUpLeft.js +1 -1
- package/dist/icons/fi/FiArrowUpRight.js +1 -1
- package/dist/icons/fi/FiAtSign.js +1 -1
- package/dist/icons/fi/FiAward.js +1 -1
- package/dist/icons/fi/FiBarChart.js +1 -1
- package/dist/icons/fi/FiBarChart2.js +1 -1
- package/dist/icons/fi/FiBattery.js +1 -1
- package/dist/icons/fi/FiBatteryCharging.js +1 -1
- package/dist/icons/fi/FiBell.js +1 -1
- package/dist/icons/fi/FiBellOff.js +1 -1
- package/dist/icons/fi/FiBluetooth.js +1 -1
- package/dist/icons/fi/FiBold.js +1 -1
- package/dist/icons/fi/FiBook.js +1 -1
- package/dist/icons/fi/FiBookOpen.js +1 -1
- package/dist/icons/fi/FiBookmark.js +1 -1
- package/dist/icons/fi/FiBox.js +1 -1
- package/dist/icons/fi/FiBriefcase.js +1 -1
- package/dist/icons/fi/FiCalendar.js +1 -1
- package/dist/icons/fi/FiCamera.js +1 -1
- package/dist/icons/fi/FiCameraOff.js +1 -1
- package/dist/icons/fi/FiCast.js +1 -1
- package/dist/icons/fi/FiCheck.js +1 -1
- package/dist/icons/fi/FiCheckCircle.js +1 -1
- package/dist/icons/fi/FiCheckSquare.js +1 -1
- package/dist/icons/fi/FiChevronDown.js +1 -1
- package/dist/icons/fi/FiChevronLeft.js +1 -1
- package/dist/icons/fi/FiChevronRight.js +1 -1
- package/dist/icons/fi/FiChevronUp.js +1 -1
- package/dist/icons/fi/FiChevronsDown.js +1 -1
- package/dist/icons/fi/FiChevronsLeft.js +1 -1
- package/dist/icons/fi/FiChevronsRight.js +1 -1
- package/dist/icons/fi/FiChevronsUp.js +1 -1
- package/dist/icons/fi/FiChrome.js +1 -1
- package/dist/icons/fi/FiCircle.js +1 -1
- package/dist/icons/fi/FiClipboard.js +1 -1
- package/dist/icons/fi/FiClock.js +1 -1
- package/dist/icons/fi/FiCloud.js +1 -1
- package/dist/icons/fi/FiCloudDrizzle.js +1 -1
- package/dist/icons/fi/FiCloudLightning.js +1 -1
- package/dist/icons/fi/FiCloudOff.js +1 -1
- package/dist/icons/fi/FiCloudRain.js +1 -1
- package/dist/icons/fi/FiCloudSnow.js +1 -1
- package/dist/icons/fi/FiCode.js +1 -1
- package/dist/icons/fi/FiCodepen.js +1 -1
- package/dist/icons/fi/FiCodesandbox.js +1 -1
- package/dist/icons/fi/FiCoffee.js +1 -1
- package/dist/icons/fi/FiColumns.js +1 -1
- package/dist/icons/fi/FiCommand.js +1 -1
- package/dist/icons/fi/FiCompass.js +1 -1
- package/dist/icons/fi/FiCopy.js +1 -1
- package/dist/icons/fi/FiCornerDownLeft.js +1 -1
- package/dist/icons/fi/FiCornerDownRight.js +1 -1
- package/dist/icons/fi/FiCornerLeftDown.js +1 -1
- package/dist/icons/fi/FiCornerLeftUp.js +1 -1
- package/dist/icons/fi/FiCornerRightDown.js +1 -1
- package/dist/icons/fi/FiCornerRightUp.js +1 -1
- package/dist/icons/fi/FiCornerUpLeft.js +1 -1
- package/dist/icons/fi/FiCornerUpRight.js +1 -1
- package/dist/icons/fi/FiCpu.js +1 -1
- package/dist/icons/fi/FiCreditCard.js +1 -1
- package/dist/icons/fi/FiCrop.js +1 -1
- package/dist/icons/fi/FiCrosshair.js +1 -1
- package/dist/icons/fi/FiDatabase.js +1 -1
- package/dist/icons/fi/FiDelete.js +1 -1
- package/dist/icons/fi/FiDisc.js +1 -1
- package/dist/icons/fi/FiDivide.js +1 -1
- package/dist/icons/fi/FiDivideCircle.js +1 -1
- package/dist/icons/fi/FiDivideSquare.js +1 -1
- package/dist/icons/fi/FiDollarSign.js +1 -1
- package/dist/icons/fi/FiDownload.js +1 -1
- package/dist/icons/fi/FiDownloadCloud.js +1 -1
- package/dist/icons/fi/FiDribbble.js +1 -1
- package/dist/icons/fi/FiDroplet.js +1 -1
- package/dist/icons/fi/FiEdit.js +1 -1
- package/dist/icons/fi/FiEdit2.js +1 -1
- package/dist/icons/fi/FiEdit3.js +1 -1
- package/dist/icons/fi/FiExternalLink.js +1 -1
- package/dist/icons/fi/FiEye.js +1 -1
- package/dist/icons/fi/FiEyeOff.js +1 -1
- package/dist/icons/fi/FiFacebook.js +1 -1
- package/dist/icons/fi/FiFastForward.js +1 -1
- package/dist/icons/fi/FiFeather.js +1 -1
- package/dist/icons/fi/FiFigma.js +1 -1
- package/dist/icons/fi/FiFile.js +1 -1
- package/dist/icons/fi/FiFileMinus.js +1 -1
- package/dist/icons/fi/FiFilePlus.js +1 -1
- package/dist/icons/fi/FiFileText.js +1 -1
- package/dist/icons/fi/FiFilm.js +1 -1
- package/dist/icons/fi/FiFilter.js +1 -1
- package/dist/icons/fi/FiFlag.js +1 -1
- package/dist/icons/fi/FiFolder.js +1 -1
- package/dist/icons/fi/FiFolderMinus.js +1 -1
- package/dist/icons/fi/FiFolderPlus.js +1 -1
- package/dist/icons/fi/FiFramer.js +1 -1
- package/dist/icons/fi/FiFrown.js +1 -1
- package/dist/icons/fi/FiGift.js +1 -1
- package/dist/icons/fi/FiGitBranch.js +1 -1
- package/dist/icons/fi/FiGitCommit.js +1 -1
- package/dist/icons/fi/FiGitMerge.js +1 -1
- package/dist/icons/fi/FiGitPullRequest.js +1 -1
- package/dist/icons/fi/FiGithub.js +1 -1
- package/dist/icons/fi/FiGitlab.js +1 -1
- package/dist/icons/fi/FiGlobe.js +1 -1
- package/dist/icons/fi/FiGrid.js +1 -1
- package/dist/icons/fi/FiHardDrive.js +1 -1
- package/dist/icons/fi/FiHash.js +1 -1
- package/dist/icons/fi/FiHeadphones.js +1 -1
- package/dist/icons/fi/FiHeart.js +1 -1
- package/dist/icons/fi/FiHelpCircle.js +1 -1
- package/dist/icons/fi/FiHexagon.js +1 -1
- package/dist/icons/fi/FiHome.js +1 -1
- package/dist/icons/fi/FiImage.js +1 -1
- package/dist/icons/fi/FiInbox.js +1 -1
- package/dist/icons/fi/FiInfo.js +1 -1
- package/dist/icons/fi/FiInstagram.js +1 -1
- package/dist/icons/fi/FiItalic.js +1 -1
- package/dist/icons/fi/FiKey.js +1 -1
- package/dist/icons/fi/FiLayers.js +1 -1
- package/dist/icons/fi/FiLayout.js +1 -1
- package/dist/icons/fi/FiLifeBuoy.js +1 -1
- package/dist/icons/fi/FiLink.js +1 -1
- package/dist/icons/fi/FiLink2.js +1 -1
- package/dist/icons/fi/FiLinkedin.js +1 -1
- package/dist/icons/fi/FiList.js +1 -1
- package/dist/icons/fi/FiLoader.js +1 -1
- package/dist/icons/fi/FiLock.js +1 -1
- package/dist/icons/fi/FiLogIn.js +1 -1
- package/dist/icons/fi/FiLogOut.js +1 -1
- package/dist/icons/fi/FiMail.js +1 -1
- package/dist/icons/fi/FiMap.js +1 -1
- package/dist/icons/fi/FiMapPin.js +1 -1
- package/dist/icons/fi/FiMaximize.js +1 -1
- package/dist/icons/fi/FiMaximize2.js +1 -1
- package/dist/icons/fi/FiMeh.js +1 -1
- package/dist/icons/fi/FiMenu.js +1 -1
- package/dist/icons/fi/FiMessageCircle.js +1 -1
- package/dist/icons/fi/FiMessageSquare.js +1 -1
- package/dist/icons/fi/FiMic.js +1 -1
- package/dist/icons/fi/FiMicOff.js +1 -1
- package/dist/icons/fi/FiMinimize.js +1 -1
- package/dist/icons/fi/FiMinimize2.js +1 -1
- package/dist/icons/fi/FiMinus.js +1 -1
- package/dist/icons/fi/FiMinusCircle.js +1 -1
- package/dist/icons/fi/FiMinusSquare.js +1 -1
- package/dist/icons/fi/FiMonitor.js +1 -1
- package/dist/icons/fi/FiMoon.js +1 -1
- package/dist/icons/fi/FiMoreHorizontal.js +1 -1
- package/dist/icons/fi/FiMoreVertical.js +1 -1
- package/dist/icons/fi/FiMousePointer.js +1 -1
- package/dist/icons/fi/FiMove.js +1 -1
- package/dist/icons/fi/FiMusic.js +1 -1
- package/dist/icons/fi/FiNavigation.js +1 -1
- package/dist/icons/fi/FiNavigation2.js +1 -1
- package/dist/icons/fi/FiOctagon.js +1 -1
- package/dist/icons/fi/FiPackage.js +1 -1
- package/dist/icons/fi/FiPaperclip.js +1 -1
- package/dist/icons/fi/FiPause.js +1 -1
- package/dist/icons/fi/FiPauseCircle.js +1 -1
- package/dist/icons/fi/FiPenTool.js +1 -1
- package/dist/icons/fi/FiPercent.js +1 -1
- package/dist/icons/fi/FiPhone.js +1 -1
- package/dist/icons/fi/FiPhoneCall.js +1 -1
- package/dist/icons/fi/FiPhoneForwarded.js +1 -1
- package/dist/icons/fi/FiPhoneIncoming.js +1 -1
- package/dist/icons/fi/FiPhoneMissed.js +1 -1
- package/dist/icons/fi/FiPhoneOff.js +1 -1
- package/dist/icons/fi/FiPhoneOutgoing.js +1 -1
- package/dist/icons/fi/FiPieChart.js +1 -1
- package/dist/icons/fi/FiPlay.js +1 -1
- package/dist/icons/fi/FiPlayCircle.js +1 -1
- package/dist/icons/fi/FiPlus.js +1 -1
- package/dist/icons/fi/FiPlusCircle.js +1 -1
- package/dist/icons/fi/FiPlusSquare.js +1 -1
- package/dist/icons/fi/FiPocket.js +1 -1
- package/dist/icons/fi/FiPower.js +1 -1
- package/dist/icons/fi/FiPrinter.js +1 -1
- package/dist/icons/fi/FiRadio.js +1 -1
- package/dist/icons/fi/FiRefreshCcw.js +1 -1
- package/dist/icons/fi/FiRefreshCw.js +1 -1
- package/dist/icons/fi/FiRepeat.js +1 -1
- package/dist/icons/fi/FiRewind.js +1 -1
- package/dist/icons/fi/FiRotateCcw.js +1 -1
- package/dist/icons/fi/FiRotateCw.js +1 -1
- package/dist/icons/fi/FiRss.js +1 -1
- package/dist/icons/fi/FiSave.js +1 -1
- package/dist/icons/fi/FiScissors.js +1 -1
- package/dist/icons/fi/FiSearch.js +1 -1
- package/dist/icons/fi/FiSend.js +1 -1
- package/dist/icons/fi/FiServer.js +1 -1
- package/dist/icons/fi/FiSettings.js +1 -1
- package/dist/icons/fi/FiShare.js +1 -1
- package/dist/icons/fi/FiShare2.js +1 -1
- package/dist/icons/fi/FiShield.js +1 -1
- package/dist/icons/fi/FiShieldOff.js +1 -1
- package/dist/icons/fi/FiShoppingBag.js +1 -1
- package/dist/icons/fi/FiShoppingCart.js +1 -1
- package/dist/icons/fi/FiShuffle.js +1 -1
- package/dist/icons/fi/FiSidebar.js +1 -1
- package/dist/icons/fi/FiSkipBack.js +1 -1
- package/dist/icons/fi/FiSkipForward.js +1 -1
- package/dist/icons/fi/FiSlack.js +1 -1
- package/dist/icons/fi/FiSlash.js +1 -1
- package/dist/icons/fi/FiSliders.js +1 -1
- package/dist/icons/fi/FiSmartphone.js +1 -1
- package/dist/icons/fi/FiSmile.js +1 -1
- package/dist/icons/fi/FiSpeaker.js +1 -1
- package/dist/icons/fi/FiSquare.js +1 -1
- package/dist/icons/fi/FiStar.js +1 -1
- package/dist/icons/fi/FiStopCircle.js +1 -1
- package/dist/icons/fi/FiSun.js +1 -1
- package/dist/icons/fi/FiSunrise.js +1 -1
- package/dist/icons/fi/FiSunset.js +1 -1
- package/dist/icons/fi/FiTable.js +1 -1
- package/dist/icons/fi/FiTablet.js +1 -1
- package/dist/icons/fi/FiTag.js +1 -1
- package/dist/icons/fi/FiTarget.js +1 -1
- package/dist/icons/fi/FiTerminal.js +1 -1
- package/dist/icons/fi/FiThermometer.js +1 -1
- package/dist/icons/fi/FiThumbsDown.js +1 -1
- package/dist/icons/fi/FiThumbsUp.js +1 -1
- package/dist/icons/fi/FiToggleLeft.js +1 -1
- package/dist/icons/fi/FiToggleRight.js +1 -1
- package/dist/icons/fi/FiTool.js +1 -1
- package/dist/icons/fi/FiTrash.js +1 -1
- package/dist/icons/fi/FiTrash2.js +1 -1
- package/dist/icons/fi/FiTrello.js +1 -1
- package/dist/icons/fi/FiTrendingDown.js +1 -1
- package/dist/icons/fi/FiTrendingUp.js +1 -1
- package/dist/icons/fi/FiTriangle.js +1 -1
- package/dist/icons/fi/FiTruck.js +1 -1
- package/dist/icons/fi/FiTv.js +1 -1
- package/dist/icons/fi/FiTwitch.js +1 -1
- package/dist/icons/fi/FiTwitter.js +1 -1
- package/dist/icons/fi/FiType.js +1 -1
- package/dist/icons/fi/FiUmbrella.js +1 -1
- package/dist/icons/fi/FiUnderline.js +1 -1
- package/dist/icons/fi/FiUnlock.js +1 -1
- package/dist/icons/fi/FiUpload.js +1 -1
- package/dist/icons/fi/FiUploadCloud.js +1 -1
- package/dist/icons/fi/FiUser.js +1 -1
- package/dist/icons/fi/FiUserCheck.js +1 -1
- package/dist/icons/fi/FiUserMinus.js +1 -1
- package/dist/icons/fi/FiUserPlus.js +1 -1
- package/dist/icons/fi/FiUserX.js +1 -1
- package/dist/icons/fi/FiUsers.js +1 -1
- package/dist/icons/fi/FiVideo.js +1 -1
- package/dist/icons/fi/FiVideoOff.js +1 -1
- package/dist/icons/fi/FiVoicemail.js +1 -1
- package/dist/icons/fi/FiVolume.js +1 -1
- package/dist/icons/fi/FiVolume1.js +1 -1
- package/dist/icons/fi/FiVolume2.js +1 -1
- package/dist/icons/fi/FiVolumeX.js +1 -1
- package/dist/icons/fi/FiWatch.js +1 -1
- package/dist/icons/fi/FiWifi.js +1 -1
- package/dist/icons/fi/FiWifiOff.js +1 -1
- package/dist/icons/fi/FiWind.js +1 -1
- package/dist/icons/fi/FiX.js +1 -1
- package/dist/icons/fi/FiXCircle.js +1 -1
- package/dist/icons/fi/FiXOctagon.js +1 -1
- package/dist/icons/fi/FiXSquare.js +1 -1
- package/dist/icons/fi/FiYoutube.js +1 -1
- package/dist/icons/fi/FiZap.js +1 -1
- package/dist/icons/fi/FiZapOff.js +1 -1
- package/dist/icons/fi/FiZoomIn.js +1 -1
- package/dist/icons/fi/FiZoomOut.js +1 -1
- package/dist/index.cjs +234 -14
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +156 -0
- package/dist/server.cjs +2 -2
- package/dist/server.js +2 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -39,19 +39,239 @@ var __export = (target, all) => {
|
|
|
39
39
|
// packages/react/src/index.ts
|
|
40
40
|
var exports_src = {};
|
|
41
41
|
__export(exports_src, {
|
|
42
|
-
setLoader: () =>
|
|
43
|
-
setDefaultIconLoader: () =>
|
|
44
|
-
preloadIcon: () =>
|
|
45
|
-
createIcon: () =>
|
|
46
|
-
clearIconCache: () =>
|
|
47
|
-
cdnLoader: () =>
|
|
48
|
-
animationClass: () =>
|
|
49
|
-
WEIGHT_STROKE_WIDTH: () =>
|
|
50
|
-
SpriteIcon: () =>
|
|
51
|
-
IconContext: () =>
|
|
52
|
-
IconBase: () =>
|
|
53
|
-
Icon: () =>
|
|
54
|
-
ICON_ANIMATIONS_CSS: () =>
|
|
55
|
-
DefaultIconContext: () =>
|
|
42
|
+
setLoader: () => setLoader,
|
|
43
|
+
setDefaultIconLoader: () => setDefaultIconLoader,
|
|
44
|
+
preloadIcon: () => preloadIcon,
|
|
45
|
+
createIcon: () => createIcon,
|
|
46
|
+
clearIconCache: () => clearIconCache,
|
|
47
|
+
cdnLoader: () => cdnLoader,
|
|
48
|
+
animationClass: () => animationClass2,
|
|
49
|
+
WEIGHT_STROKE_WIDTH: () => WEIGHT_STROKE_WIDTH2,
|
|
50
|
+
SpriteIcon: () => SpriteIcon,
|
|
51
|
+
IconContext: () => IconContext,
|
|
52
|
+
IconBase: () => IconBase,
|
|
53
|
+
Icon: () => Icon,
|
|
54
|
+
ICON_ANIMATIONS_CSS: () => ICON_ANIMATIONS_CSS,
|
|
55
|
+
DefaultIconContext: () => DefaultIconContext
|
|
56
56
|
});
|
|
57
57
|
module.exports = __toCommonJS(exports_src);
|
|
58
|
+
var import_core3 = require("@mal-icons/core");
|
|
59
|
+
|
|
60
|
+
// packages/react/src/icon-base.tsx
|
|
61
|
+
var import_core = require("@mal-icons/core");
|
|
62
|
+
var import_react2 = require("react");
|
|
63
|
+
|
|
64
|
+
// packages/react/src/context.ts
|
|
65
|
+
var import_react = require("react");
|
|
66
|
+
var DefaultIconContext = {};
|
|
67
|
+
var IconContext = import_react.createContext(DefaultIconContext);
|
|
68
|
+
|
|
69
|
+
// packages/react/src/icon-base.tsx
|
|
70
|
+
var jsx_dev_runtime = require("react/jsx-dev-runtime");
|
|
71
|
+
function IconBase({
|
|
72
|
+
viewBox,
|
|
73
|
+
size,
|
|
74
|
+
color,
|
|
75
|
+
secondaryColor,
|
|
76
|
+
weight,
|
|
77
|
+
animate,
|
|
78
|
+
title,
|
|
79
|
+
className,
|
|
80
|
+
style,
|
|
81
|
+
children,
|
|
82
|
+
...rest
|
|
83
|
+
}) {
|
|
84
|
+
const conf = import_react2.useContext(IconContext);
|
|
85
|
+
const {
|
|
86
|
+
size: computedSize,
|
|
87
|
+
color: computedColor,
|
|
88
|
+
className: cls
|
|
89
|
+
} = import_core.resolveIconAttrs({ size, color, className }, conf);
|
|
90
|
+
const fullClassName = [cls, animate ? import_core.animationClass(animate) : undefined].filter(Boolean).join(" ") || undefined;
|
|
91
|
+
const mergedStyle = computedColor || secondaryColor || conf.style || style ? {
|
|
92
|
+
color: computedColor,
|
|
93
|
+
...secondaryColor ? { "--mal-icons-secondary": secondaryColor } : {},
|
|
94
|
+
...conf.style,
|
|
95
|
+
...style
|
|
96
|
+
} : undefined;
|
|
97
|
+
const weightWidth = weight ? import_core.WEIGHT_STROKE_WIDTH[weight] : undefined;
|
|
98
|
+
const { strokeWidth: restStrokeWidth, ...restProps } = rest;
|
|
99
|
+
const strokeWidth = weightWidth ?? restStrokeWidth ?? "0";
|
|
100
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV("svg", {
|
|
101
|
+
viewBox,
|
|
102
|
+
stroke: "currentColor",
|
|
103
|
+
fill: "currentColor",
|
|
104
|
+
width: computedSize,
|
|
105
|
+
height: computedSize,
|
|
106
|
+
className: fullClassName,
|
|
107
|
+
style: mergedStyle,
|
|
108
|
+
role: title ? "img" : "presentation",
|
|
109
|
+
"aria-hidden": title ? undefined : true,
|
|
110
|
+
...conf.attr,
|
|
111
|
+
...restProps,
|
|
112
|
+
strokeWidth,
|
|
113
|
+
children: [
|
|
114
|
+
title ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV("title", {
|
|
115
|
+
children: title
|
|
116
|
+
}, undefined, false, undefined, this) : null,
|
|
117
|
+
children
|
|
118
|
+
]
|
|
119
|
+
}, undefined, true, undefined, this);
|
|
120
|
+
}
|
|
121
|
+
// packages/react/src/create-icon.tsx
|
|
122
|
+
var import_react3 = require("react");
|
|
123
|
+
var jsx_dev_runtime2 = require("react/jsx-dev-runtime");
|
|
124
|
+
function createIcon(viewBox, nodes, defaultAttr) {
|
|
125
|
+
const children = nodes.map(([tag, attr], i) => import_react3.createElement(tag, { key: i, ...attr }));
|
|
126
|
+
function Icon(props) {
|
|
127
|
+
return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(IconBase, {
|
|
128
|
+
viewBox,
|
|
129
|
+
...defaultAttr,
|
|
130
|
+
...props,
|
|
131
|
+
children
|
|
132
|
+
}, undefined, false, undefined, this);
|
|
133
|
+
}
|
|
134
|
+
return import_react3.memo(Icon);
|
|
135
|
+
}
|
|
136
|
+
// packages/react/src/sprite-icon.tsx
|
|
137
|
+
var import_core2 = require("@mal-icons/core");
|
|
138
|
+
var import_react4 = require("react");
|
|
139
|
+
var jsx_dev_runtime3 = require("react/jsx-dev-runtime");
|
|
140
|
+
function SpriteIcon({
|
|
141
|
+
id,
|
|
142
|
+
href,
|
|
143
|
+
size,
|
|
144
|
+
color,
|
|
145
|
+
title,
|
|
146
|
+
className,
|
|
147
|
+
style,
|
|
148
|
+
...rest
|
|
149
|
+
}) {
|
|
150
|
+
const conf = import_react4.useContext(IconContext);
|
|
151
|
+
const {
|
|
152
|
+
size: computedSize,
|
|
153
|
+
color: computedColor,
|
|
154
|
+
className: cls
|
|
155
|
+
} = import_core2.resolveIconAttrs({ size, color, className }, conf);
|
|
156
|
+
const mergedStyle = computedColor || conf.style || style ? { color: computedColor, ...conf.style, ...style } : undefined;
|
|
157
|
+
const useHref = href ? `${href}#${id}` : `#${id}`;
|
|
158
|
+
return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV("svg", {
|
|
159
|
+
width: computedSize,
|
|
160
|
+
height: computedSize,
|
|
161
|
+
className: cls,
|
|
162
|
+
style: mergedStyle,
|
|
163
|
+
role: title ? "img" : "presentation",
|
|
164
|
+
"aria-hidden": title ? undefined : true,
|
|
165
|
+
...conf.attr,
|
|
166
|
+
...rest,
|
|
167
|
+
children: [
|
|
168
|
+
title ? /* @__PURE__ */ jsx_dev_runtime3.jsxDEV("title", {
|
|
169
|
+
children: title
|
|
170
|
+
}, undefined, false, undefined, this) : null,
|
|
171
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("use", {
|
|
172
|
+
href: useHref
|
|
173
|
+
}, undefined, false, undefined, this)
|
|
174
|
+
]
|
|
175
|
+
}, undefined, true, undefined, this);
|
|
176
|
+
}
|
|
177
|
+
// packages/react/src/dynamic.tsx
|
|
178
|
+
var import_react5 = require("react");
|
|
179
|
+
var jsx_dev_runtime4 = require("react/jsx-dev-runtime");
|
|
180
|
+
var cache = new Map;
|
|
181
|
+
var inflight = new Map;
|
|
182
|
+
var defaultLoader;
|
|
183
|
+
function setDefaultIconLoader(loader) {
|
|
184
|
+
defaultLoader = loader;
|
|
185
|
+
}
|
|
186
|
+
function preloadIcon(name, resolved) {
|
|
187
|
+
cache.set(name, resolved);
|
|
188
|
+
}
|
|
189
|
+
function clearIconCache() {
|
|
190
|
+
cache.clear();
|
|
191
|
+
inflight.clear();
|
|
192
|
+
}
|
|
193
|
+
function resolve(name, loader) {
|
|
194
|
+
const cached = cache.get(name);
|
|
195
|
+
if (cached)
|
|
196
|
+
return Promise.resolve(cached);
|
|
197
|
+
let pending = inflight.get(name);
|
|
198
|
+
if (!pending) {
|
|
199
|
+
pending = loader(name).then((r) => {
|
|
200
|
+
cache.set(name, r);
|
|
201
|
+
inflight.delete(name);
|
|
202
|
+
return r;
|
|
203
|
+
});
|
|
204
|
+
inflight.set(name, pending);
|
|
205
|
+
}
|
|
206
|
+
return pending;
|
|
207
|
+
}
|
|
208
|
+
function isIconData(value) {
|
|
209
|
+
return typeof value === "object" && value !== null && Array.isArray(value.nodes);
|
|
210
|
+
}
|
|
211
|
+
function Icon({ name, loader, fallback = null, ...rest }) {
|
|
212
|
+
const activeLoader = loader ?? defaultLoader;
|
|
213
|
+
const [resolved, setResolved] = import_react5.useState(() => cache.get(name));
|
|
214
|
+
import_react5.useEffect(() => {
|
|
215
|
+
const cached = cache.get(name);
|
|
216
|
+
if (cached) {
|
|
217
|
+
setResolved(cached);
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
if (!activeLoader)
|
|
221
|
+
return;
|
|
222
|
+
let active = true;
|
|
223
|
+
resolve(name, activeLoader).then((r) => {
|
|
224
|
+
if (active)
|
|
225
|
+
setResolved(r);
|
|
226
|
+
}).catch(() => {});
|
|
227
|
+
return () => {
|
|
228
|
+
active = false;
|
|
229
|
+
};
|
|
230
|
+
}, [name, activeLoader]);
|
|
231
|
+
if (!resolved)
|
|
232
|
+
return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(jsx_dev_runtime4.Fragment, {
|
|
233
|
+
children: fallback
|
|
234
|
+
}, undefined, false, undefined, this);
|
|
235
|
+
if (!isIconData(resolved)) {
|
|
236
|
+
const Component = resolved;
|
|
237
|
+
return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Component, {
|
|
238
|
+
...rest
|
|
239
|
+
}, undefined, false, undefined, this);
|
|
240
|
+
}
|
|
241
|
+
return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(IconBase, {
|
|
242
|
+
viewBox: resolved.viewBox,
|
|
243
|
+
...resolved.defaultAttr,
|
|
244
|
+
...rest,
|
|
245
|
+
children: resolved.nodes.map(([tag, attr], i) => import_react5.createElement(tag, { key: i, ...attr }))
|
|
246
|
+
}, undefined, false, undefined, this);
|
|
247
|
+
}
|
|
248
|
+
function cdnLoader(baseUrl, fetchImpl = fetch) {
|
|
249
|
+
const base = baseUrl.replace(/\/+$/, "");
|
|
250
|
+
return async (name) => {
|
|
251
|
+
const res = await fetchImpl(`${base}/${name}.json`);
|
|
252
|
+
if (!res.ok)
|
|
253
|
+
throw new Error(`mal-icons: failed to load "${name}" (${res.status})`);
|
|
254
|
+
const data = await res.json();
|
|
255
|
+
if (typeof data?.viewBox !== "string" || !Array.isArray(data?.nodes)) {
|
|
256
|
+
throw new Error(`mal-icons: malformed icon payload for "${name}"`);
|
|
257
|
+
}
|
|
258
|
+
return { viewBox: data.viewBox, nodes: data.nodes, defaultAttr: data.defaultAttr };
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
function setLoader(importer) {
|
|
262
|
+
let modulePromise;
|
|
263
|
+
return async (name) => {
|
|
264
|
+
if (!modulePromise)
|
|
265
|
+
modulePromise = importer();
|
|
266
|
+
const mod = await modulePromise;
|
|
267
|
+
const component = mod[name];
|
|
268
|
+
if (!component)
|
|
269
|
+
throw new Error(`mal-icons: "${name}" not found in set module`);
|
|
270
|
+
return component;
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// packages/react/src/index.ts
|
|
275
|
+
var ICON_ANIMATIONS_CSS = import_core3.ICON_ANIMATIONS_CSS;
|
|
276
|
+
var WEIGHT_STROKE_WIDTH2 = import_core3.WEIGHT_STROKE_WIDTH;
|
|
277
|
+
var animationClass2 = import_core3.animationClass;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import { animationClass as coreAnimationClass } from "@mal-icons/core";
|
|
1
2
|
export { IconBase, type IconBaseProps } from "./icon-base.tsx";
|
|
2
3
|
export { createIcon, type IconComponent } from "./create-icon.tsx";
|
|
3
4
|
export { SpriteIcon, type SpriteIconProps } from "./sprite-icon.tsx";
|
|
4
5
|
export { Icon, cdnLoader, setLoader, setDefaultIconLoader, preloadIcon, clearIconCache, type DynamicIconProps, type IconData, type IconLoader, type IconResolved, } from "./dynamic.tsx";
|
|
5
6
|
export { IconContext, DefaultIconContext, type ReactIconContextValue, } from "./context.ts";
|
|
6
|
-
export {
|
|
7
|
+
export type { IconAnimation, IconWeight } from "@mal-icons/core";
|
|
8
|
+
export declare const ICON_ANIMATIONS_CSS = "@keyframes mal-icons-spin{to{transform:rotate(360deg)}}\n@keyframes mal-icons-pulse{0%,100%{opacity:1}50%{opacity:.4}}\n@keyframes mal-icons-beat{0%,100%{transform:scale(1)}50%{transform:scale(1.15)}}\n@keyframes mal-icons-bounce{0%,100%{transform:translateY(0)}50%{transform:translateY(-15%)}}\n@keyframes mal-icons-ping{0%{transform:scale(1);opacity:1}75%,100%{transform:scale(1.8);opacity:0}}\n@keyframes mal-icons-shake{0%,100%{transform:translateX(0)}20%,60%{transform:translateX(-12%)}40%,80%{transform:translateX(12%)}}\n@keyframes mal-icons-wiggle{0%,100%{transform:rotate(-8deg)}50%{transform:rotate(8deg)}}\n@keyframes mal-icons-float{0%,100%{transform:translateY(0)}50%{transform:translateY(-12%)}}\n@keyframes mal-icons-heartbeat{0%,28%,70%,100%{transform:scale(1)}14%,42%{transform:scale(1.2)}}\n@keyframes mal-icons-flip{0%{transform:perspective(400px) rotateY(0)}100%{transform:perspective(400px) rotateY(360deg)}}\n@keyframes mal-icons-rotate{0%{transform:rotate(0)}50%{transform:rotate(180deg)}100%{transform:rotate(360deg)}}\n@keyframes mal-icons-zoom{0%,100%{transform:scale(1)}50%{transform:scale(1.4)}}\n@keyframes mal-icons-fade{0%,100%{opacity:1}50%{opacity:.1}}\n@keyframes mal-icons-slide{0%,100%{transform:translateX(0)}50%{transform:translateX(18%)}}\n@keyframes mal-icons-glow{0%,100%{filter:drop-shadow(0 0 0 currentColor)}50%{filter:drop-shadow(0 0 4px currentColor)}}\n@keyframes mal-icons-swing{0%,100%{transform:rotate(0)}20%{transform:rotate(15deg)}40%{transform:rotate(-10deg)}60%{transform:rotate(5deg)}80%{transform:rotate(-5deg)}}\n@keyframes mal-icons-tada{0%,100%{transform:scale(1) rotate(0)}10%,20%{transform:scale(.9) rotate(-3deg)}30%,50%,70%,90%{transform:scale(1.1) rotate(3deg)}40%,60%,80%{transform:scale(1.1) rotate(-3deg)}}\n.mal-icons-animate-spin{animation:mal-icons-spin 1s linear infinite;will-change:transform}\n.mal-icons-animate-spin-reverse{animation:mal-icons-spin 1s linear infinite reverse;will-change:transform}\n.mal-icons-animate-pulse{animation:mal-icons-pulse 1.5s ease-in-out infinite}\n.mal-icons-animate-beat{animation:mal-icons-beat 1s ease-in-out infinite;will-change:transform}\n.mal-icons-animate-bounce{animation:mal-icons-bounce 1s ease infinite;will-change:transform}\n.mal-icons-animate-ping{animation:mal-icons-ping 1s cubic-bezier(0,0,.2,1) infinite;will-change:transform,opacity}\n.mal-icons-animate-shake{animation:mal-icons-shake .8s ease-in-out infinite;will-change:transform}\n.mal-icons-animate-wiggle{animation:mal-icons-wiggle .6s ease-in-out infinite;will-change:transform}\n.mal-icons-animate-float{animation:mal-icons-float 3s ease-in-out infinite;will-change:transform}\n.mal-icons-animate-heartbeat{animation:mal-icons-heartbeat 1.3s ease-in-out infinite;will-change:transform}\n.mal-icons-animate-flip{animation:mal-icons-flip 1.2s ease-in-out infinite;will-change:transform}\n.mal-icons-animate-rotate{animation:mal-icons-rotate 1.5s ease-in-out infinite;will-change:transform}\n.mal-icons-animate-zoom{animation:mal-icons-zoom 1.2s ease-in-out infinite;will-change:transform}\n.mal-icons-animate-fade{animation:mal-icons-fade 1.5s ease-in-out infinite}\n.mal-icons-animate-slide{animation:mal-icons-slide 1s ease-in-out infinite;will-change:transform}\n.mal-icons-animate-glow{animation:mal-icons-glow 1.5s ease-in-out infinite}\n.mal-icons-animate-swing{animation:mal-icons-swing 1s ease-in-out infinite;transform-origin:top center;will-change:transform}\n.mal-icons-animate-tada{animation:mal-icons-tada 1s ease-in-out infinite;will-change:transform}\n@media (prefers-reduced-motion:reduce){[class*=mal-icons-animate-]{animation:none}}\n";
|
|
9
|
+
export declare const WEIGHT_STROKE_WIDTH: Record<import("@mal-icons/core").IconWeight, number>;
|
|
10
|
+
export declare const animationClass: typeof coreAnimationClass;
|
|
7
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EACL,IAAI,EACJ,SAAS,EACT,SAAS,EACT,oBAAoB,EACpB,WAAW,EACX,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,YAAY,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,KAAK,qBAAqB,GAC3B,MAAM,cAAc,CAAC;AACtB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,IAAI,kBAAkB,EAGrC,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EACL,IAAI,EACJ,SAAS,EACT,SAAS,EACT,oBAAoB,EACpB,WAAW,EACX,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,YAAY,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,KAAK,qBAAqB,GAC3B,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAOjE,eAAO,MAAM,mBAAmB,ujHAAwB,CAAC;AACzD,eAAO,MAAM,mBAAmB,sDAAwB,CAAC;AACzD,eAAO,MAAM,cAAc,2BAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,159 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DefaultIconContext,
|
|
3
|
+
IconBase,
|
|
4
|
+
IconContext,
|
|
5
|
+
createIcon
|
|
6
|
+
} from "./chunk-ckjps1mv.js";
|
|
7
|
+
|
|
8
|
+
// packages/react/src/index.ts
|
|
9
|
+
import {
|
|
10
|
+
animationClass as coreAnimationClass,
|
|
11
|
+
ICON_ANIMATIONS_CSS as coreIconAnimationsCss,
|
|
12
|
+
WEIGHT_STROKE_WIDTH as coreWeightStrokeWidth
|
|
13
|
+
} from "@mal-icons/core";
|
|
14
|
+
|
|
15
|
+
// packages/react/src/sprite-icon.tsx
|
|
16
|
+
import { resolveIconAttrs } from "@mal-icons/core";
|
|
17
|
+
import { useContext } from "react";
|
|
18
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
19
|
+
function SpriteIcon({
|
|
20
|
+
id,
|
|
21
|
+
href,
|
|
22
|
+
size,
|
|
23
|
+
color,
|
|
24
|
+
title,
|
|
25
|
+
className,
|
|
26
|
+
style,
|
|
27
|
+
...rest
|
|
28
|
+
}) {
|
|
29
|
+
const conf = useContext(IconContext);
|
|
30
|
+
const {
|
|
31
|
+
size: computedSize,
|
|
32
|
+
color: computedColor,
|
|
33
|
+
className: cls
|
|
34
|
+
} = resolveIconAttrs({ size, color, className }, conf);
|
|
35
|
+
const mergedStyle = computedColor || conf.style || style ? { color: computedColor, ...conf.style, ...style } : undefined;
|
|
36
|
+
const useHref = href ? `${href}#${id}` : `#${id}`;
|
|
37
|
+
return /* @__PURE__ */ jsxDEV("svg", {
|
|
38
|
+
width: computedSize,
|
|
39
|
+
height: computedSize,
|
|
40
|
+
className: cls,
|
|
41
|
+
style: mergedStyle,
|
|
42
|
+
role: title ? "img" : "presentation",
|
|
43
|
+
"aria-hidden": title ? undefined : true,
|
|
44
|
+
...conf.attr,
|
|
45
|
+
...rest,
|
|
46
|
+
children: [
|
|
47
|
+
title ? /* @__PURE__ */ jsxDEV("title", {
|
|
48
|
+
children: title
|
|
49
|
+
}, undefined, false, undefined, this) : null,
|
|
50
|
+
/* @__PURE__ */ jsxDEV("use", {
|
|
51
|
+
href: useHref
|
|
52
|
+
}, undefined, false, undefined, this)
|
|
53
|
+
]
|
|
54
|
+
}, undefined, true, undefined, this);
|
|
55
|
+
}
|
|
56
|
+
// packages/react/src/dynamic.tsx
|
|
57
|
+
import { createElement, useEffect, useState } from "react";
|
|
58
|
+
import { jsxDEV as jsxDEV2, Fragment } from "react/jsx-dev-runtime";
|
|
59
|
+
var cache = new Map;
|
|
60
|
+
var inflight = new Map;
|
|
61
|
+
var defaultLoader;
|
|
62
|
+
function setDefaultIconLoader(loader) {
|
|
63
|
+
defaultLoader = loader;
|
|
64
|
+
}
|
|
65
|
+
function preloadIcon(name, resolved) {
|
|
66
|
+
cache.set(name, resolved);
|
|
67
|
+
}
|
|
68
|
+
function clearIconCache() {
|
|
69
|
+
cache.clear();
|
|
70
|
+
inflight.clear();
|
|
71
|
+
}
|
|
72
|
+
function resolve(name, loader) {
|
|
73
|
+
const cached = cache.get(name);
|
|
74
|
+
if (cached)
|
|
75
|
+
return Promise.resolve(cached);
|
|
76
|
+
let pending = inflight.get(name);
|
|
77
|
+
if (!pending) {
|
|
78
|
+
pending = loader(name).then((r) => {
|
|
79
|
+
cache.set(name, r);
|
|
80
|
+
inflight.delete(name);
|
|
81
|
+
return r;
|
|
82
|
+
});
|
|
83
|
+
inflight.set(name, pending);
|
|
84
|
+
}
|
|
85
|
+
return pending;
|
|
86
|
+
}
|
|
87
|
+
function isIconData(value) {
|
|
88
|
+
return typeof value === "object" && value !== null && Array.isArray(value.nodes);
|
|
89
|
+
}
|
|
90
|
+
function Icon({ name, loader, fallback = null, ...rest }) {
|
|
91
|
+
const activeLoader = loader ?? defaultLoader;
|
|
92
|
+
const [resolved, setResolved] = useState(() => cache.get(name));
|
|
93
|
+
useEffect(() => {
|
|
94
|
+
const cached = cache.get(name);
|
|
95
|
+
if (cached) {
|
|
96
|
+
setResolved(cached);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
if (!activeLoader)
|
|
100
|
+
return;
|
|
101
|
+
let active = true;
|
|
102
|
+
resolve(name, activeLoader).then((r) => {
|
|
103
|
+
if (active)
|
|
104
|
+
setResolved(r);
|
|
105
|
+
}).catch(() => {});
|
|
106
|
+
return () => {
|
|
107
|
+
active = false;
|
|
108
|
+
};
|
|
109
|
+
}, [name, activeLoader]);
|
|
110
|
+
if (!resolved)
|
|
111
|
+
return /* @__PURE__ */ jsxDEV2(Fragment, {
|
|
112
|
+
children: fallback
|
|
113
|
+
}, undefined, false, undefined, this);
|
|
114
|
+
if (!isIconData(resolved)) {
|
|
115
|
+
const Component = resolved;
|
|
116
|
+
return /* @__PURE__ */ jsxDEV2(Component, {
|
|
117
|
+
...rest
|
|
118
|
+
}, undefined, false, undefined, this);
|
|
119
|
+
}
|
|
120
|
+
return /* @__PURE__ */ jsxDEV2(IconBase, {
|
|
121
|
+
viewBox: resolved.viewBox,
|
|
122
|
+
...resolved.defaultAttr,
|
|
123
|
+
...rest,
|
|
124
|
+
children: resolved.nodes.map(([tag, attr], i) => createElement(tag, { key: i, ...attr }))
|
|
125
|
+
}, undefined, false, undefined, this);
|
|
126
|
+
}
|
|
127
|
+
function cdnLoader(baseUrl, fetchImpl = fetch) {
|
|
128
|
+
const base = baseUrl.replace(/\/+$/, "");
|
|
129
|
+
return async (name) => {
|
|
130
|
+
const res = await fetchImpl(`${base}/${name}.json`);
|
|
131
|
+
if (!res.ok)
|
|
132
|
+
throw new Error(`mal-icons: failed to load "${name}" (${res.status})`);
|
|
133
|
+
const data = await res.json();
|
|
134
|
+
if (typeof data?.viewBox !== "string" || !Array.isArray(data?.nodes)) {
|
|
135
|
+
throw new Error(`mal-icons: malformed icon payload for "${name}"`);
|
|
136
|
+
}
|
|
137
|
+
return { viewBox: data.viewBox, nodes: data.nodes, defaultAttr: data.defaultAttr };
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
function setLoader(importer) {
|
|
141
|
+
let modulePromise;
|
|
142
|
+
return async (name) => {
|
|
143
|
+
if (!modulePromise)
|
|
144
|
+
modulePromise = importer();
|
|
145
|
+
const mod = await modulePromise;
|
|
146
|
+
const component = mod[name];
|
|
147
|
+
if (!component)
|
|
148
|
+
throw new Error(`mal-icons: "${name}" not found in set module`);
|
|
149
|
+
return component;
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// packages/react/src/index.ts
|
|
154
|
+
var ICON_ANIMATIONS_CSS = coreIconAnimationsCss;
|
|
155
|
+
var WEIGHT_STROKE_WIDTH = coreWeightStrokeWidth;
|
|
156
|
+
var animationClass = coreAnimationClass;
|
|
1
157
|
export {
|
|
2
158
|
setLoader,
|
|
3
159
|
setDefaultIconLoader,
|
package/dist/server.cjs
CHANGED
|
@@ -43,7 +43,7 @@ __export(exports_server, {
|
|
|
43
43
|
IconBaseServer: () => IconBaseServer
|
|
44
44
|
});
|
|
45
45
|
module.exports = __toCommonJS(exports_server);
|
|
46
|
-
var import_core = require("@mal-
|
|
46
|
+
var import_core = require("@mal-icons/core");
|
|
47
47
|
var import_react = require("react");
|
|
48
48
|
var jsx_dev_runtime = require("react/jsx-dev-runtime");
|
|
49
49
|
function IconBaseServer({
|
|
@@ -67,7 +67,7 @@ function IconBaseServer({
|
|
|
67
67
|
const fullClassName = [cls, animate ? import_core.animationClass(animate) : undefined].filter(Boolean).join(" ") || undefined;
|
|
68
68
|
const mergedStyle = computedColor || secondaryColor || style ? {
|
|
69
69
|
color: computedColor,
|
|
70
|
-
...secondaryColor ? { "--mal-
|
|
70
|
+
...secondaryColor ? { "--mal-icons-secondary": secondaryColor } : {},
|
|
71
71
|
...style
|
|
72
72
|
} : undefined;
|
|
73
73
|
const weightWidth = weight ? import_core.WEIGHT_STROKE_WIDTH[weight] : undefined;
|
package/dist/server.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// packages/react/src/server.tsx
|
|
2
|
-
import { WEIGHT_STROKE_WIDTH, animationClass, resolveIconAttrs } from "@mal-
|
|
2
|
+
import { WEIGHT_STROKE_WIDTH, animationClass, resolveIconAttrs } from "@mal-icons/core";
|
|
3
3
|
import { createElement } from "react";
|
|
4
4
|
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
5
5
|
function IconBaseServer({
|
|
@@ -23,7 +23,7 @@ function IconBaseServer({
|
|
|
23
23
|
const fullClassName = [cls, animate ? animationClass(animate) : undefined].filter(Boolean).join(" ") || undefined;
|
|
24
24
|
const mergedStyle = computedColor || secondaryColor || style ? {
|
|
25
25
|
color: computedColor,
|
|
26
|
-
...secondaryColor ? { "--mal-
|
|
26
|
+
...secondaryColor ? { "--mal-icons-secondary": secondaryColor } : {},
|
|
27
27
|
...style
|
|
28
28
|
} : undefined;
|
|
29
29
|
const weightWidth = weight ? WEIGHT_STROKE_WIDTH[weight] : undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mal-icons/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"description": "React components and dynamic icon rendering for mal-icons.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"react": ">=18"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@mal-icons/core": "0.
|
|
66
|
+
"@mal-icons/core": "0.2.7"
|
|
67
67
|
},
|
|
68
68
|
"publishConfig": {
|
|
69
69
|
"access": "public"
|