@smbdy/icons-react 1.0.2 → 1.1.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/aave-K32LGE6Y.js +7 -0
- package/dist/bnb-DCJ5FXUB.js +7 -0
- package/dist/brands-L5PTLZAO.js +6 -0
- package/dist/brands-L5PTLZAO.js.map +1 -0
- package/dist/brands-ZFN7COP6.cjs +6 -0
- package/dist/brands-ZFN7COP6.cjs.map +1 -0
- package/dist/brands.js +1 -3
- package/dist/chains-AER7LB2F.cjs +6 -0
- package/dist/chains-AER7LB2F.cjs.map +1 -0
- package/dist/chains-KWHHYIQP.js +6 -0
- package/dist/chains-KWHHYIQP.js.map +1 -0
- package/dist/chains.js +1 -3
- package/dist/{chunk-R2LI45CO.js → chunk-3QBGGX2B.js} +1 -4
- package/dist/{chunk-R2LI45CO.js.map → chunk-3QBGGX2B.js.map} +1 -1
- package/dist/{chunk-5GKWV4K2.js → chunk-CGCK22HF.js} +1 -4
- package/dist/{chunk-5GKWV4K2.js.map → chunk-CGCK22HF.js.map} +1 -1
- package/dist/{chunk-C2QAKFGG.js → chunk-DMUNOIF2.js} +1 -4
- package/dist/{chunk-C2QAKFGG.js.map → chunk-DMUNOIF2.js.map} +1 -1
- package/dist/{chunk-CPRI7WWZ.js → chunk-F6KZW5HP.js} +1 -4
- package/dist/{chunk-CPRI7WWZ.js.map → chunk-F6KZW5HP.js.map} +1 -1
- package/dist/{chunk-35GWSGWA.js → chunk-FWVJHSO6.js} +1 -4
- package/dist/{chunk-35GWSGWA.js.map → chunk-FWVJHSO6.js.map} +1 -1
- package/dist/{chunk-WH52PT4Y.js → chunk-JYYQDYRP.js} +1 -4
- package/dist/{chunk-WH52PT4Y.js.map → chunk-JYYQDYRP.js.map} +1 -1
- package/dist/{chunk-QAWTPM2S.js → chunk-NGMZUDLN.js} +1 -4
- package/dist/{chunk-QAWTPM2S.js.map → chunk-NGMZUDLN.js.map} +1 -1
- package/dist/{chunk-7P3MIHDC.js → chunk-PZ77ZGR7.js} +1 -4
- package/dist/{chunk-7P3MIHDC.js.map → chunk-PZ77ZGR7.js.map} +1 -1
- package/dist/{chunk-OVJUO4KZ.js → chunk-TBD6MI4P.js} +1 -4
- package/dist/{chunk-OVJUO4KZ.js.map → chunk-TBD6MI4P.js.map} +1 -1
- package/dist/{chunk-LMGL65KI.cjs → chunk-WDG7KLLT.cjs} +69 -47
- package/dist/chunk-WDG7KLLT.cjs.map +1 -0
- package/dist/{chunk-XWYUXPMU.js → chunk-WUKTILCO.js} +72 -52
- package/dist/chunk-WUKTILCO.js.map +1 -0
- package/dist/{chunk-ICEGTX2E.js → chunk-Y2MK6VUF.js} +1 -4
- package/dist/{chunk-ICEGTX2E.js.map → chunk-Y2MK6VUF.js.map} +1 -1
- package/dist/compat.cjs +3 -2
- package/dist/compat.js +6 -7
- package/dist/compat.js.map +1 -1
- package/dist/frames.js +1 -3
- package/dist/{github-fallback-W3AHQ4U6.js → github-fallback-LUYR6NJF.js} +9 -7
- package/dist/github-fallback-LUYR6NJF.js.map +1 -0
- package/dist/{github-fallback-WEXDJI4H.cjs → github-fallback-ZBK55BLV.cjs} +8 -4
- package/dist/github-fallback-ZBK55BLV.cjs.map +1 -0
- package/dist/index.cjs +3 -2
- package/dist/index.js +5 -6
- package/dist/link-XFBO5QDH.js +7 -0
- package/dist/pteusde-XLRWLLKT.js +7 -0
- package/dist/tokens-7PEFDREU.js +12 -0
- package/dist/tokens-7PEFDREU.js.map +1 -0
- package/dist/tokens-AYZHIKHK.cjs +12 -0
- package/dist/tokens-AYZHIKHK.cjs.map +1 -0
- package/dist/tokens.js +6 -8
- package/dist/uni-EDTKY5E5.js +7 -0
- package/package.json +1 -1
- package/dist/aave-4NKY7G5P.js +0 -9
- package/dist/bnb-VEXN3I2D.js +0 -9
- package/dist/chunk-LMGL65KI.cjs.map +0 -1
- package/dist/chunk-XWYUXPMU.js.map +0 -1
- package/dist/github-fallback-W3AHQ4U6.js.map +0 -1
- package/dist/github-fallback-WEXDJI4H.cjs.map +0 -1
- package/dist/link-M5GUQP3F.js +0 -9
- package/dist/pteusde-T5QFFBX5.js +0 -9
- package/dist/uni-UB66QGDS.js +0 -9
- /package/dist/{aave-4NKY7G5P.js.map → aave-K32LGE6Y.js.map} +0 -0
- /package/dist/{bnb-VEXN3I2D.js.map → bnb-DCJ5FXUB.js.map} +0 -0
- /package/dist/{link-M5GUQP3F.js.map → link-XFBO5QDH.js.map} +0 -0
- /package/dist/{pteusde-T5QFFBX5.js.map → pteusde-XLRWLLKT.js.map} +0 -0
- /package/dist/{uni-UB66QGDS.js.map → uni-EDTKY5E5.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/generated/brands/metamask.tsx"],"sourcesContent":["// Auto-generated by scripts/generate.ts - DO NOT EDIT\nimport { forwardRef } from 'react'\nimport type { SVGProps } from 'react'\n\nexport interface IconProps extends SVGProps<SVGSVGElement> {\n variant?: 'full' | 'mono'\n size?: number | string\n}\n\nexport const MetamaskIcon = forwardRef<SVGSVGElement, IconProps>(\n ({ variant = 'full', size = 32, ...props }, ref) => {\n if (variant === 'mono') {\n return (\n <svg ref={ref} width={size} height={size} viewBox=\"0 0 32 32\" fill=\"currentColor\" role=\"img\" aria-label=\"MetaMask\" {...props}>\n <path fill=\"currentColor\" d=\"M13.51 17.89h.01c.03-.01.06-.02.09-.02.02 0 .03 0 .05.01h.03c.05.02.1.05.12.11l.39.82.27-1.47-3.85-.17 1.39 1.4 1.51-.69zm1.15-5.99c.08.03.13.11.13.2v.28l.07.15c.03.08 0 .16-.05.22l.14 4.18.02.26.22 1.43-.11 3.54h1.84l-.09-3.51.22-1.52.09-4.39a.22.22 0 0 1-.07-.26l.09-.2v-.21c0-.09.06-.17.14-.2h.04l1.14-2.69h-4.94l1.09 2.75h.05zm-3.74 6.21.62 1.22.22.43-.03-.82-.35-.36z\"/><path fill=\"currentColor\" d=\"m14.25 12.8-2.71 2.29-.11.16-.97 1.47 4.04.18zm-2 7.84 2.2 1.72.14-.1-.5-2.56-1.92-.56.05 1.46s.01.03.01.04zM24.14 7.17l-5.16 1.92-.97 2.62zm-3.07 10.96-.8.81-.03.8.4-.79zm-3.54 4.23 2.22-1.72v-.01l.07-1.49-1.93.57-.5 2.56.08.05z\"/><path fill=\"currentColor\" d=\"M22.12 16.8v.02l.01.01v.18l-1.75 3.4 2.02.06s.1-.09.16-.07l3.55.07-1.33-4.09-3.65-1.07.98 1.48zm-7.51 2.23-.09.5.1.49zm2.77 1 .09-.5-.09-.51z\"/><path fill=\"currentColor\" d=\"m21.33 17.22.05-.05-3.85.17.11.59.16.87.39-.81a.23.23 0 0 1 .13-.11c.05-.02.11-.02.17 0l1.52.69 1.33-1.35zm.2-.5-1.08-1.63-2.71-2.29-.23 4.1z\"/><path fill=\"currentColor\" d=\"M16 0C7.16 0 0 7.16 0 16s7.16 16 16 16 16-7.16 16-16S24.84 0 16 0m9.28 25.37c-.03.1-.12.16-.21.16h-.06l-4.6-1.27-.82.67-1.88 1.3s-.08.04-.13.04H14.4s-.09-.01-.13-.04l-1.85-1.29-.84-.69-4.6 1.27h-.06c-.1 0-.19-.06-.21-.16l-1.35-4.59s.01-.04.01-.07c0-.02-.02-.04-.01-.06l1.41-4.38-.88-1.03s-.06-.11-.05-.17c0-.06.04-.12.09-.15l.19-.14-.46-.42s-.07-.11-.07-.17c0-.07.03-.13.08-.17l.28-.22-.44-.33a.21.21 0 0 1-.09-.18c0-.07.03-.14.09-.18l.33-.25-.68-3.25v-.12l1.05-3.15s.01 0 .01-.01V6.3a.22.22 0 0 1 .13-.1c.04-.01.09 0 .13 0h.02l6.71 2.5h5.52l6.7-2.5h.14c.05.02.1.05.13.1v.02l.01.01 1.06 3.15s.02.08 0 .12l-.68 3.25.33.25c.06.04.09.11.09.18q0 .105-.09.18l-.43.33.29.22c.05.04.08.1.09.17 0 .07-.02.13-.07.17l-.46.42.19.14q.075.06.09.15c.01.06-.01.12-.05.17l-.88 1.03 1.42 4.38s.01.08 0 .12l-1.35 4.59z\"/><path fill=\"currentColor\" d=\"m17.96 22.6 2.13 1.03-.29-2.47zm.03 1.85v.03l-.01.41 1.87-.88-2.04-.99zm2.73-.57 4.2 1.15 1.21-4.09h-3.45z\"/><path fill=\"currentColor\" d=\"M17.74 25.47c-.04 0-.08-.01-.11-.03a.24.24 0 0 1-.1-.19l.02-.67-.07-.06h-2.96l-.06.05v.67c.02.08-.02.15-.09.19-.04.02-.07.03-.11.03-.03 0-.06 0-.1-.02l-.7-.33 1.01.71h3.04l1.01-.7-.69.33s-.06.02-.1.02zm2.48-4.5.29 2.41 1.59-2.44z\"/><path fill=\"currentColor\" d=\"m14.01 24.48.01-.02v-.01l.16-1.43-2.03.99 1.87.88zm-4.42-3.99 2.01-.06-1.74-3.4v-.19l.01-.01v-.02l.98-1.48-3.32.97-.32.09-1.31 4.09 3.54-.07c.07-.02.12.02.16.07zm-3.71.45 1.2 4.09 4.2-1.15-1.96-2.94zm5.61 2.43.28-2.4-1.87-.03zm2.54-.77-1.83-1.43-.29 2.46 1.22-.6zM13.02 9.1 7.85 7.17l6.13 4.55z\"/>\n </svg>\n )\n }\n return (\n <svg ref={ref} width={size} height={size} viewBox=\"0 0 32 32\" fill=\"none\" role=\"img\" aria-label=\"MetaMask\" {...props}>\n <path fill=\"#fff\" d=\"M16 32c8.837 0 16-7.163 16-16S24.837 0 16 0 0 7.163 0 16s7.163 16 16 16\"/><path fill=\"#d2c1b4\" d=\"m20.92 24.96-3.16-1.54h-.05c-.01 0-.02.03-.02.04l.25 2.05-.03.87s0 .03.02.04h.05l2.94-1.39s.03-.02.03-.04-.01-.03-.03-.04zm-6.64-1.54s-.03-.01-.05 0l-3.15 1.54s-.03.02-.03.04.01.03.03.04l2.94 1.39h.05c.01 0 .02-.02.02-.04l-.02-.86.23-2.06s0-.03-.02-.04z\"/><path fill=\"#273445\" d=\"m13.29 18.31-1.86.85s-.03.03-.03.04c0 .02.01.04.03.04l2.63.77h.01c.01 0 .03 0 .04-.02.01-.01.01-.03 0-.05l-.77-1.62s-.04-.03-.06-.02zm7.27.85-1.87-.85s-.05 0-.06.02l-.77 1.62V20c0 .01.02.02.04.02h.01l2.64-.77s.03-.02.03-.04 0-.04-.03-.04z\"/><path fill=\"#be672d\" d=\"m11.55 21.17-2.92.08s-.03.01-.04.03v.05l2.47 3.7s.02.02.04.02h.01c.02 0 .03-.02.04-.04l.45-3.79s0-.03-.01-.04l-.04-.02zm3.03-3.94L9.33 17s-.04.01-.04.03v.05l2.13 2.16s.03.02.05 0l1.82-.83.75 1.58s.02.03.04.03.04-.02.04-.04l.49-2.7v-.04c0-.01-.02-.02-.03-.02zm8.79 4.02-2.92-.08s-.03 0-.04.02c0 0-.01.02-.01.04l.45 3.79s.02.04.04.04h.01c.02 0 .03 0 .04-.02l2.47-3.7s.01-.03 0-.05c0-.01-.02-.02-.04-.03zm-2.78-2.02 2.12-2.16s.02-.03 0-.05c0-.02-.02-.03-.04-.03l-5.24.23s-.03 0-.03.02c0 .01-.01.02 0 .04l.49 2.7s.02.04.04.04.03-.01.04-.03l.76-1.58 1.82.83h.05z\"/><path fill=\"#d57b37\" d=\"M27.75 21.27s-.02-.02-.04-.02l-4.34-.08s-.03 0-.04.02l-2.4 3.68-.42-3.53 2.2-4.28v-.05l-1.48-2.23-3.31-2.95 8.83-6.56s.02-.04.01-.06a.05.05 0 0 0-.06-.02l-7.57 2.83s-.02.01-.03.03l-1.49 3.52-.03-.03s-.03-.01-.05 0c-.02 0-.03.02-.03.04v.28l-.12.26c0 .02 0 .04.01.06h.06l.03-.03-.11 5.14-.25 1.68.11 4.2s.02.04.04.05c0 0 .04-.02.05-.04l.62-3.18v-.02l-.48-2.65 5.07-.23-2.04 2.07s-.01.02-.01.03l-.09 2.11-2.71 2.11s-.02.03-.02.04.01.03.03.04l3.16 1.54 5.29 1.46h.01c.02 0 .04-.01.04-.03l1.52-5.16v-.04zm-13.12-4-.17-5.05h.06c.02-.01.02-.04.02-.05l-.08-.2v-.34s-.02-.03-.04-.04h-.05l-.04.04-1.42-3.6s-.01-.02-.03-.03L5.3 5.17s-.05 0-.06.02 0 .05.01.06l8.77 6.63-3.25 2.88-1.47 2.23s-.01.03 0 .05l2.2 4.28-.41 3.52-2.4-3.68s-.02-.02-.04-.02l-4.33.08s-.03 0-.04.02-.01.03 0 .04l1.51 5.16s.02.03.04.03h.01l5.29-1.46 3.15-1.54s.02-.02.03-.04 0-.03-.02-.04l-2.71-2.11-.07-2.12s0-.02-.01-.03l-2.04-2.07 5.08.23-.48 2.64v.02l.62 3.18s.02.04.05.04c0 0 .04-.02.04-.04l.14-4.2-.26-1.68z\"/><path fill=\"#bcad9f\" d=\"m20.88 24.96-2.87 1.36.03-.79s0-.03-.02-.04l-.23-.21s-.02-.01-.03-.01h-3.52s-.02 0-.03.01l-.21.21s-.01.02-.01.03l.02.79-2.87-1.36s-.05 0-.06.02 0 .05 0 .06l1.03.84 2.08 1.45h3.63l2.09-1.45 1.03-.84s.02-.04 0-.06a.05.05 0 0 0-.06-.02z\"/><path fill=\"#161616\" d=\"M17.78 23.46s0-.03-.02-.03l-.45-.31h-2.64l-.45.31s-.02.02-.02.03l-.23 2.06s0 .04.03.05.04 0 .05 0l.2-.19h3.48l.22.19s.02.01.03.01H18c.02 0 .03-.03.02-.05l-.25-2.06z\"/><path fill=\"#6e401f\" d=\"M5.31 5.19s-.03-.01-.04 0c-.01 0-.03.02-.03.03L4.06 8.76v.02l.79 3.78-.48.36s-.02.02-.02.04c0 .01 0 .03.02.04l.7.53-.52.41s-.02.02-.02.04c0 .01 0 .03.02.04l.7.64-.42.3s-.02.02-.02.03 0 .03.01.04l1.07 1.26s.02.02.04.02h.01l4.88-1.43h.02l3.45-2.92s.02-.02.02-.04c0-.01 0-.03-.02-.04zm21.85 7.36.79-3.78v-.02l-1.19-3.54s-.02-.03-.03-.03h-.04l-8.98 6.66s-.02.02-.02.04c0 .01 0 .03.02.04l3.45 2.92h.02l4.88 1.43h.01c.01 0 .03 0 .04-.02l1.08-1.26s.01-.02.01-.04c0-.01 0-.02-.02-.03l-.42-.3.7-.64s.02-.02.02-.04c0-.01 0-.03-.02-.04l-.53-.41.7-.53s.02-.02.02-.04c0-.01 0-.03-.02-.04l-.47-.36z\"/><path fill=\"#e68a3a\" d=\"m27.78 21.34-1.67-5.12v-.02l-5.03-1.47 1.54 2.31-2.1 4.08.08-1.99-2.7.8h-.03l-.53 2.73.01-3.68.12-1.7.31-5.38 1.42-3.83.02-.06h-6.43l1.42 3.89.33 5.38.11 1.69v3.69l-.52-2.7v-.03l-2.66-.78-.06-.02.07 2-2.1-4.09 1.46-2.2.07-.11-5.03 1.47-1.63 5.08-.02.06h4.4l2.88.04 2.72 2.12.02.02.47-.32h2.55l.47.32 2.74-2.14 2.89-.04z\"/>\n </svg>\n )\n }\n)\nMetamaskIcon.displayName = 'MetamaskIcon'\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/generated/brands/metamask.tsx"],"sourcesContent":["// Auto-generated by scripts/generate.ts - DO NOT EDIT\nimport { forwardRef } from 'react'\nimport type { SVGProps } from 'react'\n\nexport interface IconProps extends SVGProps<SVGSVGElement> {\n variant?: 'full' | 'mono'\n size?: number | string\n}\n\nexport const MetamaskIcon = forwardRef<SVGSVGElement, IconProps>(\n ({ variant = 'full', size = 32, ...props }, ref) => {\n if (variant === 'mono') {\n return (\n <svg ref={ref} width={size} height={size} viewBox=\"0 0 32 32\" fill=\"currentColor\" role=\"img\" aria-label=\"MetaMask\" {...props}>\n <path fill=\"currentColor\" d=\"M13.51 17.89h.01c.03-.01.06-.02.09-.02.02 0 .03 0 .05.01h.03c.05.02.1.05.12.11l.39.82.27-1.47-3.85-.17 1.39 1.4 1.51-.69zm1.15-5.99c.08.03.13.11.13.2v.28l.07.15c.03.08 0 .16-.05.22l.14 4.18.02.26.22 1.43-.11 3.54h1.84l-.09-3.51.22-1.52.09-4.39a.22.22 0 0 1-.07-.26l.09-.2v-.21c0-.09.06-.17.14-.2h.04l1.14-2.69h-4.94l1.09 2.75h.05zm-3.74 6.21.62 1.22.22.43-.03-.82-.35-.36z\"/><path fill=\"currentColor\" d=\"m14.25 12.8-2.71 2.29-.11.16-.97 1.47 4.04.18zm-2 7.84 2.2 1.72.14-.1-.5-2.56-1.92-.56.05 1.46s.01.03.01.04zM24.14 7.17l-5.16 1.92-.97 2.62zm-3.07 10.96-.8.81-.03.8.4-.79zm-3.54 4.23 2.22-1.72v-.01l.07-1.49-1.93.57-.5 2.56.08.05z\"/><path fill=\"currentColor\" d=\"M22.12 16.8v.02l.01.01v.18l-1.75 3.4 2.02.06s.1-.09.16-.07l3.55.07-1.33-4.09-3.65-1.07.98 1.48zm-7.51 2.23-.09.5.1.49zm2.77 1 .09-.5-.09-.51z\"/><path fill=\"currentColor\" d=\"m21.33 17.22.05-.05-3.85.17.11.59.16.87.39-.81a.23.23 0 0 1 .13-.11c.05-.02.11-.02.17 0l1.52.69 1.33-1.35zm.2-.5-1.08-1.63-2.71-2.29-.23 4.1z\"/><path fill=\"currentColor\" d=\"M16 0C7.16 0 0 7.16 0 16s7.16 16 16 16 16-7.16 16-16S24.84 0 16 0m9.28 25.37c-.03.1-.12.16-.21.16h-.06l-4.6-1.27-.82.67-1.88 1.3s-.08.04-.13.04H14.4s-.09-.01-.13-.04l-1.85-1.29-.84-.69-4.6 1.27h-.06c-.1 0-.19-.06-.21-.16l-1.35-4.59s.01-.04.01-.07c0-.02-.02-.04-.01-.06l1.41-4.38-.88-1.03s-.06-.11-.05-.17c0-.06.04-.12.09-.15l.19-.14-.46-.42s-.07-.11-.07-.17c0-.07.03-.13.08-.17l.28-.22-.44-.33a.21.21 0 0 1-.09-.18c0-.07.03-.14.09-.18l.33-.25-.68-3.25v-.12l1.05-3.15s.01 0 .01-.01V6.3a.22.22 0 0 1 .13-.1c.04-.01.09 0 .13 0h.02l6.71 2.5h5.52l6.7-2.5h.14c.05.02.1.05.13.1v.02l.01.01 1.06 3.15s.02.08 0 .12l-.68 3.25.33.25c.06.04.09.11.09.18q0 .105-.09.18l-.43.33.29.22c.05.04.08.1.09.17 0 .07-.02.13-.07.17l-.46.42.19.14q.075.06.09.15c.01.06-.01.12-.05.17l-.88 1.03 1.42 4.38s.01.08 0 .12l-1.35 4.59z\"/><path fill=\"currentColor\" d=\"m17.96 22.6 2.13 1.03-.29-2.47zm.03 1.85v.03l-.01.41 1.87-.88-2.04-.99zm2.73-.57 4.2 1.15 1.21-4.09h-3.45z\"/><path fill=\"currentColor\" d=\"M17.74 25.47c-.04 0-.08-.01-.11-.03a.24.24 0 0 1-.1-.19l.02-.67-.07-.06h-2.96l-.06.05v.67c.02.08-.02.15-.09.19-.04.02-.07.03-.11.03-.03 0-.06 0-.1-.02l-.7-.33 1.01.71h3.04l1.01-.7-.69.33s-.06.02-.1.02zm2.48-4.5.29 2.41 1.59-2.44z\"/><path fill=\"currentColor\" d=\"m14.01 24.48.01-.02v-.01l.16-1.43-2.03.99 1.87.88zm-4.42-3.99 2.01-.06-1.74-3.4v-.19l.01-.01v-.02l.98-1.48-3.32.97-.32.09-1.31 4.09 3.54-.07c.07-.02.12.02.16.07zm-3.71.45 1.2 4.09 4.2-1.15-1.96-2.94zm5.61 2.43.28-2.4-1.87-.03zm2.54-.77-1.83-1.43-.29 2.46 1.22-.6zM13.02 9.1 7.85 7.17l6.13 4.55z\"/>\n </svg>\n )\n }\n return (\n <svg ref={ref} width={size} height={size} viewBox=\"0 0 32 32\" fill=\"none\" role=\"img\" aria-label=\"MetaMask\" {...props}>\n <path fill=\"#fff\" d=\"M16 32c8.837 0 16-7.163 16-16S24.837 0 16 0 0 7.163 0 16s7.163 16 16 16\"/><path fill=\"#d2c1b4\" d=\"m20.92 24.96-3.16-1.54h-.05c-.01 0-.02.03-.02.04l.25 2.05-.03.87s0 .03.02.04h.05l2.94-1.39s.03-.02.03-.04-.01-.03-.03-.04zm-6.64-1.54s-.03-.01-.05 0l-3.15 1.54s-.03.02-.03.04.01.03.03.04l2.94 1.39h.05c.01 0 .02-.02.02-.04l-.02-.86.23-2.06s0-.03-.02-.04z\"/><path fill=\"#273445\" d=\"m13.29 18.31-1.86.85s-.03.03-.03.04c0 .02.01.04.03.04l2.63.77h.01c.01 0 .03 0 .04-.02.01-.01.01-.03 0-.05l-.77-1.62s-.04-.03-.06-.02zm7.27.85-1.87-.85s-.05 0-.06.02l-.77 1.62V20c0 .01.02.02.04.02h.01l2.64-.77s.03-.02.03-.04 0-.04-.03-.04z\"/><path fill=\"#be672d\" d=\"m11.55 21.17-2.92.08s-.03.01-.04.03v.05l2.47 3.7s.02.02.04.02h.01c.02 0 .03-.02.04-.04l.45-3.79s0-.03-.01-.04l-.04-.02zm3.03-3.94L9.33 17s-.04.01-.04.03v.05l2.13 2.16s.03.02.05 0l1.82-.83.75 1.58s.02.03.04.03.04-.02.04-.04l.49-2.7v-.04c0-.01-.02-.02-.03-.02zm8.79 4.02-2.92-.08s-.03 0-.04.02c0 0-.01.02-.01.04l.45 3.79s.02.04.04.04h.01c.02 0 .03 0 .04-.02l2.47-3.7s.01-.03 0-.05c0-.01-.02-.02-.04-.03zm-2.78-2.02 2.12-2.16s.02-.03 0-.05c0-.02-.02-.03-.04-.03l-5.24.23s-.03 0-.03.02c0 .01-.01.02 0 .04l.49 2.7s.02.04.04.04.03-.01.04-.03l.76-1.58 1.82.83h.05z\"/><path fill=\"#d57b37\" d=\"M27.75 21.27s-.02-.02-.04-.02l-4.34-.08s-.03 0-.04.02l-2.4 3.68-.42-3.53 2.2-4.28v-.05l-1.48-2.23-3.31-2.95 8.83-6.56s.02-.04.01-.06a.05.05 0 0 0-.06-.02l-7.57 2.83s-.02.01-.03.03l-1.49 3.52-.03-.03s-.03-.01-.05 0c-.02 0-.03.02-.03.04v.28l-.12.26c0 .02 0 .04.01.06h.06l.03-.03-.11 5.14-.25 1.68.11 4.2s.02.04.04.05c0 0 .04-.02.05-.04l.62-3.18v-.02l-.48-2.65 5.07-.23-2.04 2.07s-.01.02-.01.03l-.09 2.11-2.71 2.11s-.02.03-.02.04.01.03.03.04l3.16 1.54 5.29 1.46h.01c.02 0 .04-.01.04-.03l1.52-5.16v-.04zm-13.12-4-.17-5.05h.06c.02-.01.02-.04.02-.05l-.08-.2v-.34s-.02-.03-.04-.04h-.05l-.04.04-1.42-3.6s-.01-.02-.03-.03L5.3 5.17s-.05 0-.06.02 0 .05.01.06l8.77 6.63-3.25 2.88-1.47 2.23s-.01.03 0 .05l2.2 4.28-.41 3.52-2.4-3.68s-.02-.02-.04-.02l-4.33.08s-.03 0-.04.02-.01.03 0 .04l1.51 5.16s.02.03.04.03h.01l5.29-1.46 3.15-1.54s.02-.02.03-.04 0-.03-.02-.04l-2.71-2.11-.07-2.12s0-.02-.01-.03l-2.04-2.07 5.08.23-.48 2.64v.02l.62 3.18s.02.04.05.04c0 0 .04-.02.04-.04l.14-4.2-.26-1.68z\"/><path fill=\"#bcad9f\" d=\"m20.88 24.96-2.87 1.36.03-.79s0-.03-.02-.04l-.23-.21s-.02-.01-.03-.01h-3.52s-.02 0-.03.01l-.21.21s-.01.02-.01.03l.02.79-2.87-1.36s-.05 0-.06.02 0 .05 0 .06l1.03.84 2.08 1.45h3.63l2.09-1.45 1.03-.84s.02-.04 0-.06a.05.05 0 0 0-.06-.02z\"/><path fill=\"#161616\" d=\"M17.78 23.46s0-.03-.02-.03l-.45-.31h-2.64l-.45.31s-.02.02-.02.03l-.23 2.06s0 .04.03.05.04 0 .05 0l.2-.19h3.48l.22.19s.02.01.03.01H18c.02 0 .03-.03.02-.05l-.25-2.06z\"/><path fill=\"#6e401f\" d=\"M5.31 5.19s-.03-.01-.04 0c-.01 0-.03.02-.03.03L4.06 8.76v.02l.79 3.78-.48.36s-.02.02-.02.04c0 .01 0 .03.02.04l.7.53-.52.41s-.02.02-.02.04c0 .01 0 .03.02.04l.7.64-.42.3s-.02.02-.02.03 0 .03.01.04l1.07 1.26s.02.02.04.02h.01l4.88-1.43h.02l3.45-2.92s.02-.02.02-.04c0-.01 0-.03-.02-.04zm21.85 7.36.79-3.78v-.02l-1.19-3.54s-.02-.03-.03-.03h-.04l-8.98 6.66s-.02.02-.02.04c0 .01 0 .03.02.04l3.45 2.92h.02l4.88 1.43h.01c.01 0 .03 0 .04-.02l1.08-1.26s.01-.02.01-.04c0-.01 0-.02-.02-.03l-.42-.3.7-.64s.02-.02.02-.04c0-.01 0-.03-.02-.04l-.53-.41.7-.53s.02-.02.02-.04c0-.01 0-.03-.02-.04l-.47-.36z\"/><path fill=\"#e68a3a\" d=\"m27.78 21.34-1.67-5.12v-.02l-5.03-1.47 1.54 2.31-2.1 4.08.08-1.99-2.7.8h-.03l-.53 2.73.01-3.68.12-1.7.31-5.38 1.42-3.83.02-.06h-6.43l1.42 3.89.33 5.38.11 1.69v3.69l-.52-2.7v-.03l-2.66-.78-.06-.02.07 2-2.1-4.09 1.46-2.2.07-.11-5.03 1.47-1.63 5.08-.02.06h4.4l2.88.04 2.72 2.12.02.02.47-.32h2.55l.47.32 2.74-2.14 2.89-.04z\"/>\n </svg>\n )\n }\n)\nMetamaskIcon.displayName = 'MetamaskIcon'\n"],"mappings":";AACA,SAAS,kBAAkB;AAYnB,SACE,KADF;AAJD,IAAM,eAAe;AAAA,EAC1B,CAAC,EAAE,UAAU,QAAQ,OAAO,IAAI,GAAG,MAAM,GAAG,QAAQ;AAClD,QAAI,YAAY,QAAQ;AACtB,aACE,qBAAC,SAAI,KAAU,OAAO,MAAM,QAAQ,MAAM,SAAQ,aAAY,MAAK,gBAAe,MAAK,OAAM,cAAW,YAAY,GAAG,OACrH;AAAA,4BAAC,UAAK,MAAK,gBAAe,GAAE,wXAAsX;AAAA,QAAE,oBAAC,UAAK,MAAK,gBAAe,GAAE,yOAAuO;AAAA,QAAE,oBAAC,UAAK,MAAK,gBAAe,GAAE,iJAA+I;AAAA,QAAE,oBAAC,UAAK,MAAK,gBAAe,GAAE,iJAA+I;AAAA,QAAE,oBAAC,UAAK,MAAK,gBAAe,GAAE,myBAAiyB;AAAA,QAAE,oBAAC,UAAK,MAAK,gBAAe,GAAE,8GAA4G;AAAA,QAAE,oBAAC,UAAK,MAAK,gBAAe,GAAE,yOAAuO;AAAA,QAAE,oBAAC,UAAK,MAAK,gBAAe,GAAE,0SAAwS;AAAA,SACvgF;AAAA,IAEJ;AACA,WACE,qBAAC,SAAI,KAAU,OAAO,MAAM,QAAQ,MAAM,SAAQ,aAAY,MAAK,QAAO,MAAK,OAAM,cAAW,YAAY,GAAG,OAC7G;AAAA,0BAAC,UAAK,MAAK,QAAO,GAAE,2EAAyE;AAAA,MAAE,oBAAC,UAAK,MAAK,WAAU,GAAE,iQAA+P;AAAA,MAAE,oBAAC,UAAK,MAAK,WAAU,GAAE,kPAAgP;AAAA,MAAE,oBAAC,UAAK,MAAK,WAAU,GAAE,ijBAA+iB;AAAA,MAAE,oBAAC,UAAK,MAAK,WAAU,GAAE,g9BAA88B;AAAA,MAAE,oBAAC,UAAK,MAAK,WAAU,GAAE,6OAA2O;AAAA,MAAE,oBAAC,UAAK,MAAK,WAAU,GAAE,wKAAsK;AAAA,MAAE,oBAAC,UAAK,MAAK,WAAU,GAAE,4kBAA0kB;AAAA,MAAE,oBAAC,UAAK,MAAK,WAAU,GAAE,mUAAiU;AAAA,OAC/iH;AAAA,EAEJ;AACF;AACA,aAAa,cAAc;","names":[]}
|
|
@@ -16,7 +16,8 @@ var _chunkCZ5BDQQZcjs = require('./chunk-CZ5BDQQZ.cjs');
|
|
|
16
16
|
var _chunkKHCWITFWcjs = require('./chunk-KHCWITFW.cjs');
|
|
17
17
|
|
|
18
18
|
// src/index.tsx
|
|
19
|
-
var _react = require('react');
|
|
19
|
+
var _react = require('react'); var React = _interopRequireWildcard(_react);
|
|
20
|
+
|
|
20
21
|
var _icons = require('@smbdy/icons');
|
|
21
22
|
var _resolve = require('@smbdy/icons/resolve');
|
|
22
23
|
|
|
@@ -31,18 +32,32 @@ var EAGER_ICONS = {
|
|
|
31
32
|
"brand:metamask": _chunkKHCWITFWcjs.MetamaskIcon
|
|
32
33
|
};
|
|
33
34
|
|
|
34
|
-
// src/
|
|
35
|
+
// src/lazy-icons.ts
|
|
35
36
|
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"token:pteusde": _react.lazy.call(void 0, () => Promise.resolve().then(() => _interopRequireWildcard(require("./pteusde-ZTEAA2UN.cjs"))).then((m) => ({ default: m.PteusdeIcon }))),
|
|
41
|
-
"token:uni": _react.lazy.call(void 0, () => Promise.resolve().then(() => _interopRequireWildcard(require("./uni-LS35CB5G.cjs"))).then((m) => ({ default: m.UniIcon })))
|
|
37
|
+
var SHARDS = {
|
|
38
|
+
token: () => Promise.resolve().then(() => _interopRequireWildcard(require("./tokens-AYZHIKHK.cjs"))),
|
|
39
|
+
chain: () => Promise.resolve().then(() => _interopRequireWildcard(require("./chains-AER7LB2F.cjs"))),
|
|
40
|
+
brand: () => Promise.resolve().then(() => _interopRequireWildcard(require("./brands-ZFN7COP6.cjs")))
|
|
42
41
|
};
|
|
42
|
+
var lazyCache = /* @__PURE__ */ new Map();
|
|
43
|
+
var NullIcon = () => null;
|
|
44
|
+
function getLazyIcon(type, id) {
|
|
45
|
+
const key = `${type}:${id}`;
|
|
46
|
+
let entry = lazyCache.get(key);
|
|
47
|
+
if (!entry) {
|
|
48
|
+
entry = _react.lazy.call(void 0, async () => {
|
|
49
|
+
const shard = await SHARDS[type]();
|
|
50
|
+
const load = shard.ICON_IMPORTS[id];
|
|
51
|
+
return load ? load() : { default: NullIcon };
|
|
52
|
+
});
|
|
53
|
+
lazyCache.set(key, entry);
|
|
54
|
+
}
|
|
55
|
+
return entry;
|
|
56
|
+
}
|
|
43
57
|
|
|
44
58
|
// src/index.tsx
|
|
45
59
|
var _jsxruntime = require('react/jsx-runtime');
|
|
60
|
+
var useInsertionEffectSafe = _nullishCoalesce(React.useInsertionEffect, () => ( _react.useEffect));
|
|
46
61
|
var styleInjected = false;
|
|
47
62
|
function ensureStyles() {
|
|
48
63
|
if (styleInjected || typeof document === "undefined") return;
|
|
@@ -100,12 +115,12 @@ var overlayStyle = {
|
|
|
100
115
|
animation: "bgd-icon-fade-in 0.3s ease-out forwards"
|
|
101
116
|
};
|
|
102
117
|
var LazyGithubFallback = _react.lazy.call(void 0,
|
|
103
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./github-fallback-
|
|
118
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./github-fallback-ZBK55BLV.cjs"))).then((m) => ({ default: m.GithubFallback }))
|
|
104
119
|
);
|
|
105
120
|
function NotifyMounted({ onMounted }) {
|
|
106
121
|
_react.useEffect.call(void 0, () => {
|
|
107
122
|
onMounted();
|
|
108
|
-
});
|
|
123
|
+
}, []);
|
|
109
124
|
return null;
|
|
110
125
|
}
|
|
111
126
|
function FadeInLazyIcon({
|
|
@@ -116,6 +131,7 @@ function FadeInLazyIcon({
|
|
|
116
131
|
...props
|
|
117
132
|
}) {
|
|
118
133
|
const [loaded, setLoaded] = _react.useState.call(void 0, false);
|
|
134
|
+
useInsertionEffectSafe(ensureStyles, []);
|
|
119
135
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { style: wrapStyle, children: [
|
|
120
136
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
121
137
|
"span",
|
|
@@ -141,51 +157,57 @@ function Icon({
|
|
|
141
157
|
...props
|
|
142
158
|
}) {
|
|
143
159
|
const { enableFallback } = _chunkKJL5NVUUcjs.useIconConfig.call(void 0, );
|
|
144
|
-
const { id, type } = _resolve.resolveOrCandidate.call(void 0,
|
|
160
|
+
const { id, type, matched } = _resolve.resolveOrCandidate.call(void 0,
|
|
145
161
|
value,
|
|
146
162
|
explicitType ? { type: explicitType } : {}
|
|
147
163
|
);
|
|
148
|
-
const lookupKey = type ? `${type}:${id}` : null;
|
|
149
164
|
const placeholderType = _nullishCoalesce(type, () => ( void 0));
|
|
150
165
|
const variant = mono ? "mono" : "full";
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
166
|
+
if (matched && type) {
|
|
167
|
+
const lookupKey = `${type}:${id}`;
|
|
168
|
+
const Eager = EAGER_ICONS[lookupKey];
|
|
169
|
+
if (Eager) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Eager, { variant, size, ...props });
|
|
170
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
171
|
+
FadeInLazyIcon,
|
|
172
|
+
{
|
|
173
|
+
Lazy: getLazyIcon(type, id),
|
|
174
|
+
placeholder: _nullishCoalesce(fallback, () => ( /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
175
|
+
Placeholder,
|
|
176
|
+
{
|
|
177
|
+
id,
|
|
178
|
+
type: placeholderType,
|
|
179
|
+
size,
|
|
180
|
+
decorative: true
|
|
181
|
+
}
|
|
182
|
+
))),
|
|
183
|
+
variant,
|
|
184
|
+
size,
|
|
185
|
+
...props
|
|
186
|
+
},
|
|
187
|
+
lookupKey
|
|
188
|
+
);
|
|
173
189
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
190
|
+
if (typeof process !== "undefined" && process.env.NODE_ENV !== "production") {
|
|
191
|
+
console.warn(`[bgd-icons] Unknown icon value: "${value}"`);
|
|
192
|
+
}
|
|
193
|
+
if (enableFallback) {
|
|
194
|
+
const placeholder = _nullishCoalesce(fallback, () => ( /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Placeholder, { id, type: placeholderType, size })));
|
|
195
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Suspense, { fallback: placeholder, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
196
|
+
LazyGithubFallback,
|
|
197
|
+
{
|
|
198
|
+
id,
|
|
199
|
+
iconType: placeholderType,
|
|
200
|
+
variant,
|
|
201
|
+
size,
|
|
202
|
+
fallback: placeholder,
|
|
203
|
+
...props
|
|
204
|
+
}
|
|
205
|
+
) });
|
|
206
|
+
}
|
|
207
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: _nullishCoalesce(fallback, () => ( /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Placeholder, { id, type: placeholderType, size }))) });
|
|
186
208
|
}
|
|
187
209
|
|
|
188
210
|
|
|
189
211
|
|
|
190
212
|
exports.Icon = Icon;
|
|
191
|
-
//# sourceMappingURL=chunk-
|
|
213
|
+
//# sourceMappingURL=chunk-WDG7KLLT.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/icons/icons/packages/react/dist/chunk-WDG7KLLT.cjs","../src/index.tsx","../src/generated/eager-map.ts","../src/lazy-icons.ts"],"names":[],"mappings":"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","file":"/home/runner/work/icons/icons/packages/react/dist/chunk-WDG7KLLT.cjs","sourcesContent":[null,"import * as React from 'react'\nimport { lazy, Suspense, useEffect, useState } from 'react'\nimport type { ReactNode, SVGProps } from 'react'\nimport { getMeta, getTypedMeta } from '@smbdy/icons'\nimport { resolveOrCandidate } from '@smbdy/icons/resolve'\nimport { EAGER_ICONS } from './generated/eager-map'\nimport { getLazyIcon } from './lazy-icons'\nimport { useIconConfig } from './icon-provider'\nimport type { IconType } from './types'\n\n// useInsertionEffect is React 18+; fall back to useEffect on React 17.\n// Accessed off the namespace so bundlers don't fail on a missing named\n// export when the peer is React 17.\nconst useInsertionEffectSafe = React.useInsertionEffect ?? useEffect\n\nexport { IconProvider } from './icon-provider'\nexport type { IconContextValue } from './icon-provider'\n\n// `type` shadows the inherited `SVGProps['type']` HTML attribute, which we\n// never expose anyway. Omitting it makes the prop unambiguously `IconType`.\nexport interface IconProps extends Omit<SVGProps<SVGSVGElement>, 'type'> {\n value: string | number\n type?: IconType\n mono?: boolean\n size?: number | string\n fallback?: ReactNode\n}\n\nlet styleInjected = false\nfunction ensureStyles() {\n if (styleInjected || typeof document === 'undefined') return\n styleInjected = true\n const s = document.createElement('style')\n s.textContent =\n '@keyframes bgd-icon-fade-in{from{opacity:0}to{opacity:1}}' +\n '.bgd-icon-placeholder{transition:opacity 0.3s ease-out}' +\n '@media(prefers-reduced-motion:reduce){.bgd-icon-fade{animation:none;opacity:1}.bgd-icon-placeholder{transition:none}}'\n document.head.appendChild(s)\n}\n\nfunction Placeholder({\n id,\n type,\n size = 32,\n decorative = false,\n}: {\n id: string\n type?: IconType\n size?: number | string\n decorative?: boolean\n}) {\n const meta = type ? getTypedMeta(type, id) : getMeta(id)\n const color = meta?.placeholderColor ?? meta?.brandColor ?? '#ccc'\n const letter = (meta?.symbol ?? id).charAt(0).toUpperCase()\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={size}\n height={size}\n viewBox=\"0 0 32 32\"\n {...(decorative\n ? { 'aria-hidden': true, focusable: false }\n : { role: 'img', 'aria-label': meta?.name ?? id })}\n >\n <circle cx=\"16\" cy=\"16\" r=\"16\" fill={color} opacity={0.25} />\n <text\n x=\"16\"\n y=\"16\"\n dy=\".35em\"\n textAnchor=\"middle\"\n fill={color}\n fontSize=\"14\"\n fontFamily=\"system-ui, sans-serif\"\n fontWeight=\"600\"\n >\n {letter}\n </text>\n </svg>\n )\n}\n\nconst wrapStyle: React.CSSProperties = {\n position: 'relative',\n display: 'inline-flex',\n}\nconst overlayStyle: React.CSSProperties = {\n position: 'absolute',\n inset: 0,\n display: 'inline-flex',\n opacity: 0,\n animation: 'bgd-icon-fade-in 0.3s ease-out forwards',\n}\n\nconst LazyGithubFallback = lazy(() =>\n import('./github-fallback').then((m) => ({ default: m.GithubFallback })),\n)\n\n// Mounts only when the surrounding Suspense boundary resolves — used to\n// learn when the lazy icon is actually on screen.\nfunction NotifyMounted({ onMounted }: { onMounted: () => void }) {\n useEffect(() => {\n onMounted()\n // Once per mount: the component remounts (via the key on\n // FadeInLazyIcon) whenever the icon identity changes.\n }, [])\n return null\n}\n\ntype LazyIconComponent = ReturnType<typeof getLazyIcon>\n\n// The placeholder is the layout anchor (the lazy icon overlays it), so it\n// must stay mounted — but once the icon has loaded it has to fade out.\n// Mono icons use currentColor with transparent regions; a placeholder left\n// at full opacity peeks through them.\nfunction FadeInLazyIcon({\n Lazy,\n placeholder,\n variant,\n size,\n ...props\n}: Omit<SVGProps<SVGSVGElement>, 'type'> & {\n Lazy: LazyIconComponent\n placeholder: ReactNode\n variant: 'full' | 'mono'\n size?: number | string\n}) {\n const [loaded, setLoaded] = useState(false)\n // Injecting the keyframe/transition styles is a DOM mutation, so it\n // belongs in an effect, not the render phase. Insertion effects run\n // before layout effects read styles — and never on the server.\n useInsertionEffectSafe(ensureStyles, [])\n return (\n <span style={wrapStyle}>\n <span\n className=\"bgd-icon-placeholder\"\n style={{ display: 'inline-flex', opacity: loaded ? 0 : 1 }}\n aria-hidden={loaded || undefined}\n >\n {placeholder}\n </span>\n <Suspense fallback={null}>\n <span className=\"bgd-icon-fade\" style={overlayStyle}>\n <Lazy variant={variant} size={size} {...props} />\n </span>\n <NotifyMounted onMounted={() => setLoaded(true)} />\n </Suspense>\n </span>\n )\n}\n\nexport function Icon({\n value,\n type: explicitType,\n mono = false,\n size,\n fallback,\n ...props\n}: IconProps) {\n const { enableFallback } = useIconConfig()\n const { id, type, matched } = resolveOrCandidate(\n value,\n explicitType ? { type: explicitType } : {},\n )\n const placeholderType = type ?? undefined\n const variant: 'full' | 'mono' = mono ? 'mono' : 'full'\n\n // A matched identity is guaranteed to ship in the package: either in the\n // eager map (bundle: true assets) or behind the lazy shards.\n if (matched && type) {\n const lookupKey = `${type}:${id}`\n const Eager = EAGER_ICONS[lookupKey]\n if (Eager) return <Eager variant={variant} size={size} {...props} />\n\n return (\n <FadeInLazyIcon\n // Reset the loaded state when the identity changes\n key={lookupKey}\n Lazy={getLazyIcon(type, id)}\n placeholder={\n fallback ?? (\n <Placeholder\n id={id}\n type={placeholderType}\n size={size}\n decorative\n />\n )\n }\n variant={variant}\n size={size}\n {...props}\n />\n )\n }\n\n // Bundlers replace process.env.NODE_ENV and dead-code-eliminate this in production\n if (typeof process !== 'undefined' && process.env.NODE_ENV !== 'production') {\n console.warn(`[bgd-icons] Unknown icon value: \"${value}\"`)\n }\n if (enableFallback) {\n const placeholder = fallback ?? (\n <Placeholder id={id} type={placeholderType} size={size} />\n )\n return (\n <Suspense fallback={placeholder}>\n <LazyGithubFallback\n id={id}\n iconType={placeholderType}\n variant={variant}\n size={size}\n fallback={placeholder}\n {...props}\n />\n </Suspense>\n )\n }\n return (\n <>\n {fallback ?? <Placeholder id={id} type={placeholderType} size={size} />}\n </>\n )\n}\n","// Auto-generated by scripts/generate.ts - DO NOT EDIT\nimport type { ComponentType } from 'react'\nimport type { IconProps } from './tokens/index'\n\nimport { BtcIcon } from './tokens/btc'\nimport { DaiIcon } from './tokens/dai'\nimport { EthIcon } from './tokens/eth'\nimport { UsdcIcon } from './tokens/usdc'\nimport { UsdtIcon } from './tokens/usdt'\nimport { EthereumIcon } from './chains/ethereum'\nimport { MetamaskIcon } from './brands/metamask'\n\nexport const EAGER_ICONS: Record<string, ComponentType<IconProps>> = {\n \"token:btc\": BtcIcon,\n \"token:dai\": DaiIcon,\n \"token:eth\": EthIcon,\n \"token:usdc\": UsdcIcon,\n \"token:usdt\": UsdtIcon,\n \"chain:ethereum\": EthereumIcon,\n \"brand:metamask\": MetamaskIcon,\n}\n","import { lazy } from 'react'\nimport type { ComponentType, LazyExoticComponent } from 'react'\nimport type { IconProps } from './generated/tokens/index'\nimport type { IconType } from './types'\n\n// A lazy icon resolves through two dynamic imports: the per-type shard\n// (id -> import thunk) and then the icon chunk itself. Keeping the shard\n// behind a dynamic import keeps the O(n) map out of consumers' entry\n// bundles — <Icon> stays O(1) in bundle cost no matter how many icons the\n// package ships. Shards are split by type so a tokens-only app never pays\n// for the chain/brand maps; if a single type's map grows heavy, sub-shard\n// it here (e.g. by id prefix) without touching the public API.\n\ntype IconModule = { default: ComponentType<IconProps> }\ntype Shard = { ICON_IMPORTS: Record<string, () => Promise<IconModule>> }\n\nconst SHARDS: Record<IconType, () => Promise<Shard>> = {\n token: () => import('./generated/lazy/tokens'),\n chain: () => import('./generated/lazy/chains'),\n brand: () => import('./generated/lazy/brands'),\n}\n\n// React resolves a lazy component by identity — recreating it per render\n// would refetch and remount. Cache one component per identity for the\n// process lifetime (entries are tiny; the icon set is bounded).\nconst lazyCache = new Map<\n string,\n LazyExoticComponent<ComponentType<IconProps>>\n>()\n\nconst NullIcon: ComponentType<IconProps> = () => null\n\nexport function getLazyIcon(\n type: IconType,\n id: string,\n): LazyExoticComponent<ComponentType<IconProps>> {\n const key = `${type}:${id}`\n let entry = lazyCache.get(key)\n if (!entry) {\n entry = lazy(async () => {\n const shard = await SHARDS[type]()\n const load = shard.ICON_IMPORTS[id]\n // The caller only asks for resolved identities, so a missing shard\n // entry means the icon ships eagerly (handled before this path) or\n // the build is inconsistent — render nothing rather than throw into\n // the nearest Suspense boundary.\n return load ? load() : { default: NullIcon }\n })\n lazyCache.set(key, entry)\n }\n return entry\n}\n"]}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
1
|
import {
|
|
4
2
|
useIconConfig
|
|
5
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Y2MK6VUF.js";
|
|
6
4
|
import {
|
|
7
5
|
BtcIcon,
|
|
8
6
|
DaiIcon,
|
|
9
7
|
EthIcon,
|
|
10
8
|
UsdcIcon,
|
|
11
9
|
UsdtIcon
|
|
12
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FWVJHSO6.js";
|
|
13
11
|
import {
|
|
14
12
|
EthereumIcon
|
|
15
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-3QBGGX2B.js";
|
|
16
14
|
import {
|
|
17
15
|
MetamaskIcon
|
|
18
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-TBD6MI4P.js";
|
|
19
17
|
|
|
20
18
|
// src/index.tsx
|
|
19
|
+
import * as React from "react";
|
|
21
20
|
import { lazy as lazy2, Suspense, useEffect, useState } from "react";
|
|
22
21
|
import { getMeta, getTypedMeta } from "@smbdy/icons";
|
|
23
22
|
import { resolveOrCandidate } from "@smbdy/icons/resolve";
|
|
@@ -33,18 +32,32 @@ var EAGER_ICONS = {
|
|
|
33
32
|
"brand:metamask": MetamaskIcon
|
|
34
33
|
};
|
|
35
34
|
|
|
36
|
-
// src/
|
|
35
|
+
// src/lazy-icons.ts
|
|
37
36
|
import { lazy } from "react";
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"token:pteusde": lazy(() => import("./pteusde-T5QFFBX5.js").then((m) => ({ default: m.PteusdeIcon }))),
|
|
43
|
-
"token:uni": lazy(() => import("./uni-UB66QGDS.js").then((m) => ({ default: m.UniIcon })))
|
|
37
|
+
var SHARDS = {
|
|
38
|
+
token: () => import("./tokens-7PEFDREU.js"),
|
|
39
|
+
chain: () => import("./chains-KWHHYIQP.js"),
|
|
40
|
+
brand: () => import("./brands-L5PTLZAO.js")
|
|
44
41
|
};
|
|
42
|
+
var lazyCache = /* @__PURE__ */ new Map();
|
|
43
|
+
var NullIcon = () => null;
|
|
44
|
+
function getLazyIcon(type, id) {
|
|
45
|
+
const key = `${type}:${id}`;
|
|
46
|
+
let entry = lazyCache.get(key);
|
|
47
|
+
if (!entry) {
|
|
48
|
+
entry = lazy(async () => {
|
|
49
|
+
const shard = await SHARDS[type]();
|
|
50
|
+
const load = shard.ICON_IMPORTS[id];
|
|
51
|
+
return load ? load() : { default: NullIcon };
|
|
52
|
+
});
|
|
53
|
+
lazyCache.set(key, entry);
|
|
54
|
+
}
|
|
55
|
+
return entry;
|
|
56
|
+
}
|
|
45
57
|
|
|
46
58
|
// src/index.tsx
|
|
47
59
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
60
|
+
var useInsertionEffectSafe = React.useInsertionEffect ?? useEffect;
|
|
48
61
|
var styleInjected = false;
|
|
49
62
|
function ensureStyles() {
|
|
50
63
|
if (styleInjected || typeof document === "undefined") return;
|
|
@@ -102,12 +115,12 @@ var overlayStyle = {
|
|
|
102
115
|
animation: "bgd-icon-fade-in 0.3s ease-out forwards"
|
|
103
116
|
};
|
|
104
117
|
var LazyGithubFallback = lazy2(
|
|
105
|
-
() => import("./github-fallback-
|
|
118
|
+
() => import("./github-fallback-LUYR6NJF.js").then((m) => ({ default: m.GithubFallback }))
|
|
106
119
|
);
|
|
107
120
|
function NotifyMounted({ onMounted }) {
|
|
108
121
|
useEffect(() => {
|
|
109
122
|
onMounted();
|
|
110
|
-
});
|
|
123
|
+
}, []);
|
|
111
124
|
return null;
|
|
112
125
|
}
|
|
113
126
|
function FadeInLazyIcon({
|
|
@@ -118,6 +131,7 @@ function FadeInLazyIcon({
|
|
|
118
131
|
...props
|
|
119
132
|
}) {
|
|
120
133
|
const [loaded, setLoaded] = useState(false);
|
|
134
|
+
useInsertionEffectSafe(ensureStyles, []);
|
|
121
135
|
return /* @__PURE__ */ jsxs("span", { style: wrapStyle, children: [
|
|
122
136
|
/* @__PURE__ */ jsx(
|
|
123
137
|
"span",
|
|
@@ -143,51 +157,57 @@ function Icon({
|
|
|
143
157
|
...props
|
|
144
158
|
}) {
|
|
145
159
|
const { enableFallback } = useIconConfig();
|
|
146
|
-
const { id, type } = resolveOrCandidate(
|
|
160
|
+
const { id, type, matched } = resolveOrCandidate(
|
|
147
161
|
value,
|
|
148
162
|
explicitType ? { type: explicitType } : {}
|
|
149
163
|
);
|
|
150
|
-
const lookupKey = type ? `${type}:${id}` : null;
|
|
151
164
|
const placeholderType = type ?? void 0;
|
|
152
165
|
const variant = mono ? "mono" : "full";
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
166
|
+
if (matched && type) {
|
|
167
|
+
const lookupKey = `${type}:${id}`;
|
|
168
|
+
const Eager = EAGER_ICONS[lookupKey];
|
|
169
|
+
if (Eager) return /* @__PURE__ */ jsx(Eager, { variant, size, ...props });
|
|
170
|
+
return /* @__PURE__ */ jsx(
|
|
171
|
+
FadeInLazyIcon,
|
|
172
|
+
{
|
|
173
|
+
Lazy: getLazyIcon(type, id),
|
|
174
|
+
placeholder: fallback ?? /* @__PURE__ */ jsx(
|
|
175
|
+
Placeholder,
|
|
176
|
+
{
|
|
177
|
+
id,
|
|
178
|
+
type: placeholderType,
|
|
179
|
+
size,
|
|
180
|
+
decorative: true
|
|
181
|
+
}
|
|
182
|
+
),
|
|
183
|
+
variant,
|
|
184
|
+
size,
|
|
185
|
+
...props
|
|
186
|
+
},
|
|
187
|
+
lookupKey
|
|
188
|
+
);
|
|
175
189
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
190
|
+
if (typeof process !== "undefined" && process.env.NODE_ENV !== "production") {
|
|
191
|
+
console.warn(`[bgd-icons] Unknown icon value: "${value}"`);
|
|
192
|
+
}
|
|
193
|
+
if (enableFallback) {
|
|
194
|
+
const placeholder = fallback ?? /* @__PURE__ */ jsx(Placeholder, { id, type: placeholderType, size });
|
|
195
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: placeholder, children: /* @__PURE__ */ jsx(
|
|
196
|
+
LazyGithubFallback,
|
|
197
|
+
{
|
|
198
|
+
id,
|
|
199
|
+
iconType: placeholderType,
|
|
200
|
+
variant,
|
|
201
|
+
size,
|
|
202
|
+
fallback: placeholder,
|
|
203
|
+
...props
|
|
204
|
+
}
|
|
205
|
+
) });
|
|
206
|
+
}
|
|
207
|
+
return /* @__PURE__ */ jsx(Fragment, { children: fallback ?? /* @__PURE__ */ jsx(Placeholder, { id, type: placeholderType, size }) });
|
|
188
208
|
}
|
|
189
209
|
|
|
190
210
|
export {
|
|
191
211
|
Icon
|
|
192
212
|
};
|
|
193
|
-
//# sourceMappingURL=chunk-
|
|
213
|
+
//# sourceMappingURL=chunk-WUKTILCO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.tsx","../src/generated/eager-map.ts","../src/lazy-icons.ts"],"sourcesContent":["import * as React from 'react'\nimport { lazy, Suspense, useEffect, useState } from 'react'\nimport type { ReactNode, SVGProps } from 'react'\nimport { getMeta, getTypedMeta } from '@smbdy/icons'\nimport { resolveOrCandidate } from '@smbdy/icons/resolve'\nimport { EAGER_ICONS } from './generated/eager-map'\nimport { getLazyIcon } from './lazy-icons'\nimport { useIconConfig } from './icon-provider'\nimport type { IconType } from './types'\n\n// useInsertionEffect is React 18+; fall back to useEffect on React 17.\n// Accessed off the namespace so bundlers don't fail on a missing named\n// export when the peer is React 17.\nconst useInsertionEffectSafe = React.useInsertionEffect ?? useEffect\n\nexport { IconProvider } from './icon-provider'\nexport type { IconContextValue } from './icon-provider'\n\n// `type` shadows the inherited `SVGProps['type']` HTML attribute, which we\n// never expose anyway. Omitting it makes the prop unambiguously `IconType`.\nexport interface IconProps extends Omit<SVGProps<SVGSVGElement>, 'type'> {\n value: string | number\n type?: IconType\n mono?: boolean\n size?: number | string\n fallback?: ReactNode\n}\n\nlet styleInjected = false\nfunction ensureStyles() {\n if (styleInjected || typeof document === 'undefined') return\n styleInjected = true\n const s = document.createElement('style')\n s.textContent =\n '@keyframes bgd-icon-fade-in{from{opacity:0}to{opacity:1}}' +\n '.bgd-icon-placeholder{transition:opacity 0.3s ease-out}' +\n '@media(prefers-reduced-motion:reduce){.bgd-icon-fade{animation:none;opacity:1}.bgd-icon-placeholder{transition:none}}'\n document.head.appendChild(s)\n}\n\nfunction Placeholder({\n id,\n type,\n size = 32,\n decorative = false,\n}: {\n id: string\n type?: IconType\n size?: number | string\n decorative?: boolean\n}) {\n const meta = type ? getTypedMeta(type, id) : getMeta(id)\n const color = meta?.placeholderColor ?? meta?.brandColor ?? '#ccc'\n const letter = (meta?.symbol ?? id).charAt(0).toUpperCase()\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={size}\n height={size}\n viewBox=\"0 0 32 32\"\n {...(decorative\n ? { 'aria-hidden': true, focusable: false }\n : { role: 'img', 'aria-label': meta?.name ?? id })}\n >\n <circle cx=\"16\" cy=\"16\" r=\"16\" fill={color} opacity={0.25} />\n <text\n x=\"16\"\n y=\"16\"\n dy=\".35em\"\n textAnchor=\"middle\"\n fill={color}\n fontSize=\"14\"\n fontFamily=\"system-ui, sans-serif\"\n fontWeight=\"600\"\n >\n {letter}\n </text>\n </svg>\n )\n}\n\nconst wrapStyle: React.CSSProperties = {\n position: 'relative',\n display: 'inline-flex',\n}\nconst overlayStyle: React.CSSProperties = {\n position: 'absolute',\n inset: 0,\n display: 'inline-flex',\n opacity: 0,\n animation: 'bgd-icon-fade-in 0.3s ease-out forwards',\n}\n\nconst LazyGithubFallback = lazy(() =>\n import('./github-fallback').then((m) => ({ default: m.GithubFallback })),\n)\n\n// Mounts only when the surrounding Suspense boundary resolves — used to\n// learn when the lazy icon is actually on screen.\nfunction NotifyMounted({ onMounted }: { onMounted: () => void }) {\n useEffect(() => {\n onMounted()\n // Once per mount: the component remounts (via the key on\n // FadeInLazyIcon) whenever the icon identity changes.\n }, [])\n return null\n}\n\ntype LazyIconComponent = ReturnType<typeof getLazyIcon>\n\n// The placeholder is the layout anchor (the lazy icon overlays it), so it\n// must stay mounted — but once the icon has loaded it has to fade out.\n// Mono icons use currentColor with transparent regions; a placeholder left\n// at full opacity peeks through them.\nfunction FadeInLazyIcon({\n Lazy,\n placeholder,\n variant,\n size,\n ...props\n}: Omit<SVGProps<SVGSVGElement>, 'type'> & {\n Lazy: LazyIconComponent\n placeholder: ReactNode\n variant: 'full' | 'mono'\n size?: number | string\n}) {\n const [loaded, setLoaded] = useState(false)\n // Injecting the keyframe/transition styles is a DOM mutation, so it\n // belongs in an effect, not the render phase. Insertion effects run\n // before layout effects read styles — and never on the server.\n useInsertionEffectSafe(ensureStyles, [])\n return (\n <span style={wrapStyle}>\n <span\n className=\"bgd-icon-placeholder\"\n style={{ display: 'inline-flex', opacity: loaded ? 0 : 1 }}\n aria-hidden={loaded || undefined}\n >\n {placeholder}\n </span>\n <Suspense fallback={null}>\n <span className=\"bgd-icon-fade\" style={overlayStyle}>\n <Lazy variant={variant} size={size} {...props} />\n </span>\n <NotifyMounted onMounted={() => setLoaded(true)} />\n </Suspense>\n </span>\n )\n}\n\nexport function Icon({\n value,\n type: explicitType,\n mono = false,\n size,\n fallback,\n ...props\n}: IconProps) {\n const { enableFallback } = useIconConfig()\n const { id, type, matched } = resolveOrCandidate(\n value,\n explicitType ? { type: explicitType } : {},\n )\n const placeholderType = type ?? undefined\n const variant: 'full' | 'mono' = mono ? 'mono' : 'full'\n\n // A matched identity is guaranteed to ship in the package: either in the\n // eager map (bundle: true assets) or behind the lazy shards.\n if (matched && type) {\n const lookupKey = `${type}:${id}`\n const Eager = EAGER_ICONS[lookupKey]\n if (Eager) return <Eager variant={variant} size={size} {...props} />\n\n return (\n <FadeInLazyIcon\n // Reset the loaded state when the identity changes\n key={lookupKey}\n Lazy={getLazyIcon(type, id)}\n placeholder={\n fallback ?? (\n <Placeholder\n id={id}\n type={placeholderType}\n size={size}\n decorative\n />\n )\n }\n variant={variant}\n size={size}\n {...props}\n />\n )\n }\n\n // Bundlers replace process.env.NODE_ENV and dead-code-eliminate this in production\n if (typeof process !== 'undefined' && process.env.NODE_ENV !== 'production') {\n console.warn(`[bgd-icons] Unknown icon value: \"${value}\"`)\n }\n if (enableFallback) {\n const placeholder = fallback ?? (\n <Placeholder id={id} type={placeholderType} size={size} />\n )\n return (\n <Suspense fallback={placeholder}>\n <LazyGithubFallback\n id={id}\n iconType={placeholderType}\n variant={variant}\n size={size}\n fallback={placeholder}\n {...props}\n />\n </Suspense>\n )\n }\n return (\n <>\n {fallback ?? <Placeholder id={id} type={placeholderType} size={size} />}\n </>\n )\n}\n","// Auto-generated by scripts/generate.ts - DO NOT EDIT\nimport type { ComponentType } from 'react'\nimport type { IconProps } from './tokens/index'\n\nimport { BtcIcon } from './tokens/btc'\nimport { DaiIcon } from './tokens/dai'\nimport { EthIcon } from './tokens/eth'\nimport { UsdcIcon } from './tokens/usdc'\nimport { UsdtIcon } from './tokens/usdt'\nimport { EthereumIcon } from './chains/ethereum'\nimport { MetamaskIcon } from './brands/metamask'\n\nexport const EAGER_ICONS: Record<string, ComponentType<IconProps>> = {\n \"token:btc\": BtcIcon,\n \"token:dai\": DaiIcon,\n \"token:eth\": EthIcon,\n \"token:usdc\": UsdcIcon,\n \"token:usdt\": UsdtIcon,\n \"chain:ethereum\": EthereumIcon,\n \"brand:metamask\": MetamaskIcon,\n}\n","import { lazy } from 'react'\nimport type { ComponentType, LazyExoticComponent } from 'react'\nimport type { IconProps } from './generated/tokens/index'\nimport type { IconType } from './types'\n\n// A lazy icon resolves through two dynamic imports: the per-type shard\n// (id -> import thunk) and then the icon chunk itself. Keeping the shard\n// behind a dynamic import keeps the O(n) map out of consumers' entry\n// bundles — <Icon> stays O(1) in bundle cost no matter how many icons the\n// package ships. Shards are split by type so a tokens-only app never pays\n// for the chain/brand maps; if a single type's map grows heavy, sub-shard\n// it here (e.g. by id prefix) without touching the public API.\n\ntype IconModule = { default: ComponentType<IconProps> }\ntype Shard = { ICON_IMPORTS: Record<string, () => Promise<IconModule>> }\n\nconst SHARDS: Record<IconType, () => Promise<Shard>> = {\n token: () => import('./generated/lazy/tokens'),\n chain: () => import('./generated/lazy/chains'),\n brand: () => import('./generated/lazy/brands'),\n}\n\n// React resolves a lazy component by identity — recreating it per render\n// would refetch and remount. Cache one component per identity for the\n// process lifetime (entries are tiny; the icon set is bounded).\nconst lazyCache = new Map<\n string,\n LazyExoticComponent<ComponentType<IconProps>>\n>()\n\nconst NullIcon: ComponentType<IconProps> = () => null\n\nexport function getLazyIcon(\n type: IconType,\n id: string,\n): LazyExoticComponent<ComponentType<IconProps>> {\n const key = `${type}:${id}`\n let entry = lazyCache.get(key)\n if (!entry) {\n entry = lazy(async () => {\n const shard = await SHARDS[type]()\n const load = shard.ICON_IMPORTS[id]\n // The caller only asks for resolved identities, so a missing shard\n // entry means the icon ships eagerly (handled before this path) or\n // the build is inconsistent — render nothing rather than throw into\n // the nearest Suspense boundary.\n return load ? load() : { default: NullIcon }\n })\n lazyCache.set(key, entry)\n }\n return entry\n}\n"],"mappings":"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","names":["lazy","lazy"]}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
1
|
// src/icon-provider.tsx
|
|
5
2
|
import { createContext, useContext, useMemo } from "react";
|
|
6
3
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -43,4 +40,4 @@ export {
|
|
|
43
40
|
IconProvider,
|
|
44
41
|
useIconConfig
|
|
45
42
|
};
|
|
46
|
-
//# sourceMappingURL=chunk-
|
|
43
|
+
//# sourceMappingURL=chunk-Y2MK6VUF.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/icon-provider.tsx"],"sourcesContent":["import { createContext, useContext, useMemo } from 'react'\nimport type { ReactNode } from 'react'\n\nexport interface IconContextValue {\n enableFallback?: boolean\n baseUrl?: string\n branch?: string\n}\n\nconst DEFAULT_BASE_URL = 'https://raw.githubusercontent.com/smbdy/icons'\nconst DEFAULT_BRANCH = 'main'\n\nconst IconContext = createContext<IconContextValue>({\n enableFallback: false,\n baseUrl: DEFAULT_BASE_URL,\n branch: DEFAULT_BRANCH,\n})\n\n// Tracks whether the implicit-branch warning has fired so we surface it\n// once per process, not once per render. Dead-code-eliminated in\n// production via the NODE_ENV guard at the call site.\nlet implicitBranchWarned = false\n\nexport function IconProvider({\n children,\n enableFallback = false,\n baseUrl = DEFAULT_BASE_URL,\n branch,\n}: IconContextValue & { children: ReactNode }) {\n if (\n enableFallback &&\n branch === undefined &&\n !implicitBranchWarned &&\n typeof process !== 'undefined' &&\n process.env.NODE_ENV !== 'production'\n ) {\n implicitBranchWarned = true\n console.warn(\n '[bgd-icons] <IconProvider enableFallback /> mounted without an explicit `branch`. ' +\n `Defaulting to \"${DEFAULT_BRANCH}\" produces version-skewed content at runtime. ` +\n 'Pin `branch` to the published tag of @smbdy/icons-react that you have installed.',\n )\n }\n const value = useMemo(\n () => ({ enableFallback, baseUrl, branch: branch ?? DEFAULT_BRANCH }),\n [enableFallback, baseUrl, branch],\n )\n\n return <IconContext.Provider value={value}>{children}</IconContext.Provider>\n}\n\nexport function useIconConfig(): Required<IconContextValue> {\n const ctx = useContext(IconContext)\n return {\n enableFallback: ctx.enableFallback ?? false,\n baseUrl: ctx.baseUrl ?? DEFAULT_BASE_URL,\n branch: ctx.branch ?? DEFAULT_BRANCH,\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/icon-provider.tsx"],"sourcesContent":["import { createContext, useContext, useMemo } from 'react'\nimport type { ReactNode } from 'react'\n\nexport interface IconContextValue {\n enableFallback?: boolean\n baseUrl?: string\n branch?: string\n}\n\nconst DEFAULT_BASE_URL = 'https://raw.githubusercontent.com/smbdy/icons'\nconst DEFAULT_BRANCH = 'main'\n\nconst IconContext = createContext<IconContextValue>({\n enableFallback: false,\n baseUrl: DEFAULT_BASE_URL,\n branch: DEFAULT_BRANCH,\n})\n\n// Tracks whether the implicit-branch warning has fired so we surface it\n// once per process, not once per render. Dead-code-eliminated in\n// production via the NODE_ENV guard at the call site.\nlet implicitBranchWarned = false\n\nexport function IconProvider({\n children,\n enableFallback = false,\n baseUrl = DEFAULT_BASE_URL,\n branch,\n}: IconContextValue & { children: ReactNode }) {\n if (\n enableFallback &&\n branch === undefined &&\n !implicitBranchWarned &&\n typeof process !== 'undefined' &&\n process.env.NODE_ENV !== 'production'\n ) {\n implicitBranchWarned = true\n console.warn(\n '[bgd-icons] <IconProvider enableFallback /> mounted without an explicit `branch`. ' +\n `Defaulting to \"${DEFAULT_BRANCH}\" produces version-skewed content at runtime. ` +\n 'Pin `branch` to the published tag of @smbdy/icons-react that you have installed.',\n )\n }\n const value = useMemo(\n () => ({ enableFallback, baseUrl, branch: branch ?? DEFAULT_BRANCH }),\n [enableFallback, baseUrl, branch],\n )\n\n return <IconContext.Provider value={value}>{children}</IconContext.Provider>\n}\n\nexport function useIconConfig(): Required<IconContextValue> {\n const ctx = useContext(IconContext)\n return {\n enableFallback: ctx.enableFallback ?? false,\n baseUrl: ctx.baseUrl ?? DEFAULT_BASE_URL,\n branch: ctx.branch ?? DEFAULT_BRANCH,\n }\n}\n"],"mappings":";AAAA,SAAS,eAAe,YAAY,eAAe;AAgD1C;AAvCT,IAAM,mBAAmB;AACzB,IAAM,iBAAiB;AAEvB,IAAM,cAAc,cAAgC;AAAA,EAClD,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,QAAQ;AACV,CAAC;AAKD,IAAI,uBAAuB;AAEpB,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA,iBAAiB;AAAA,EACjB,UAAU;AAAA,EACV;AACF,GAA+C;AAC7C,MACE,kBACA,WAAW,UACX,CAAC,wBACD,OAAO,YAAY,eACnB,QAAQ,IAAI,aAAa,cACzB;AACA,2BAAuB;AACvB,YAAQ;AAAA,MACN,sGACoB,cAAc;AAAA,IAEpC;AAAA,EACF;AACA,QAAM,QAAQ;AAAA,IACZ,OAAO,EAAE,gBAAgB,SAAS,QAAQ,UAAU,eAAe;AAAA,IACnE,CAAC,gBAAgB,SAAS,MAAM;AAAA,EAClC;AAEA,SAAO,oBAAC,YAAY,UAAZ,EAAqB,OAAe,UAAS;AACvD;AAEO,SAAS,gBAA4C;AAC1D,QAAM,MAAM,WAAW,WAAW;AAClC,SAAO;AAAA,IACL,gBAAgB,IAAI,kBAAkB;AAAA,IACtC,SAAS,IAAI,WAAW;AAAA,IACxB,QAAQ,IAAI,UAAU;AAAA,EACxB;AACF;","names":[]}
|
package/dist/compat.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
3
|
|
|
3
|
-
var
|
|
4
|
+
var _chunkWDG7KLLTcjs = require('./chunk-WDG7KLLT.cjs');
|
|
4
5
|
require('./chunk-KJL5NVUU.cjs');
|
|
5
6
|
require('./chunk-4HVBGJ3B.cjs');
|
|
6
7
|
require('./chunk-CZ5BDQQZ.cjs');
|
|
@@ -25,7 +26,7 @@ function Web3Icon({
|
|
|
25
26
|
const input = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(symbol, () => ( chainId)), () => ( walletKey)), () => ( brandKey));
|
|
26
27
|
if (!input) return _react.createElement.call(void 0, "span", null, _nullishCoalesce(loader, () => ( null)));
|
|
27
28
|
const iconType = symbol !== void 0 ? void 0 : chainId !== void 0 ? "chain" : brandKey !== void 0 ? "brand" : walletKey !== void 0 ? "brand" : void 0;
|
|
28
|
-
const icon = _react.createElement.call(void 0,
|
|
29
|
+
const icon = _react.createElement.call(void 0, _chunkWDG7KLLTcjs.Icon, {
|
|
29
30
|
value: input,
|
|
30
31
|
type: iconType,
|
|
31
32
|
mono,
|
package/dist/compat.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
2
|
import {
|
|
4
3
|
Icon
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-WUKTILCO.js";
|
|
5
|
+
import "./chunk-Y2MK6VUF.js";
|
|
6
|
+
import "./chunk-FWVJHSO6.js";
|
|
7
|
+
import "./chunk-3QBGGX2B.js";
|
|
8
|
+
import "./chunk-TBD6MI4P.js";
|
|
10
9
|
import {
|
|
11
10
|
FrameWrapper
|
|
12
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-F6KZW5HP.js";
|
|
13
12
|
|
|
14
13
|
// src/compat.ts
|
|
15
14
|
import { createElement } from "react";
|
package/dist/compat.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/compat.ts"],"sourcesContent":["import { createElement } from 'react'\nimport type { ReactNode, SVGProps } from 'react'\nimport { Icon } from './index'\nimport { FrameWrapper } from './frames'\nimport type { IconType } from './types'\n\n// Drop `type` from the inherited SVG attributes so it can't shadow Icon's\n// `type` prop on spread; Web3Icon picks its target type from chainId/brandKey\n// internally.\nexport interface Web3IconProps extends Omit<SVGProps<SVGSVGElement>, 'type'> {\n symbol?: string\n chainId?: number | string\n walletKey?: string\n brandKey?: string\n mono?: boolean\n assetTag?: string\n loader?: ReactNode\n size?: number | string\n}\n\nexport function Web3Icon({\n symbol,\n chainId,\n walletKey,\n brandKey,\n mono,\n assetTag,\n loader,\n size,\n ...props\n}: Web3IconProps) {\n const input = symbol ?? chainId ?? walletKey ?? brandKey\n if (!input) return createElement('span', null, loader ?? null)\n const iconType: IconType | undefined =\n symbol !== undefined\n ? undefined\n : chainId !== undefined\n ? 'chain'\n : brandKey !== undefined\n ? 'brand'\n : walletKey !== undefined\n ? 'brand'\n : undefined\n\n const icon = createElement(Icon, {\n value: input,\n type: iconType,\n mono,\n fallback: loader,\n // Inside a frame, leave size unset so FrameWrapper fills its slot;\n // otherwise the caller's size applies directly.\n size: assetTag ? undefined : size,\n ...props,\n })\n\n if (assetTag) {\n return createElement(\n FrameWrapper,\n {\n frame: assetTag,\n variant: mono ? 'mono' : 'full',\n size,\n },\n icon,\n )\n }\n\n return icon\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/compat.ts"],"sourcesContent":["import { createElement } from 'react'\nimport type { ReactNode, SVGProps } from 'react'\nimport { Icon } from './index'\nimport { FrameWrapper } from './frames'\nimport type { IconType } from './types'\n\n// Drop `type` from the inherited SVG attributes so it can't shadow Icon's\n// `type` prop on spread; Web3Icon picks its target type from chainId/brandKey\n// internally.\nexport interface Web3IconProps extends Omit<SVGProps<SVGSVGElement>, 'type'> {\n symbol?: string\n chainId?: number | string\n walletKey?: string\n brandKey?: string\n mono?: boolean\n assetTag?: string\n loader?: ReactNode\n size?: number | string\n}\n\nexport function Web3Icon({\n symbol,\n chainId,\n walletKey,\n brandKey,\n mono,\n assetTag,\n loader,\n size,\n ...props\n}: Web3IconProps) {\n const input = symbol ?? chainId ?? walletKey ?? brandKey\n if (!input) return createElement('span', null, loader ?? null)\n const iconType: IconType | undefined =\n symbol !== undefined\n ? undefined\n : chainId !== undefined\n ? 'chain'\n : brandKey !== undefined\n ? 'brand'\n : walletKey !== undefined\n ? 'brand'\n : undefined\n\n const icon = createElement(Icon, {\n value: input,\n type: iconType,\n mono,\n fallback: loader,\n // Inside a frame, leave size unset so FrameWrapper fills its slot;\n // otherwise the caller's size applies directly.\n size: assetTag ? undefined : size,\n ...props,\n })\n\n if (assetTag) {\n return createElement(\n FrameWrapper,\n {\n frame: assetTag,\n variant: mono ? 'mono' : 'full',\n size,\n },\n icon,\n )\n }\n\n return icon\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,qBAAqB;AAoBvB,SAAS,SAAS;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAkB;AAChB,QAAM,QAAQ,UAAU,WAAW,aAAa;AAChD,MAAI,CAAC,MAAO,QAAO,cAAc,QAAQ,MAAM,UAAU,IAAI;AAC7D,QAAM,WACJ,WAAW,SACP,SACA,YAAY,SACV,UACA,aAAa,SACX,UACA,cAAc,SACZ,UACA;AAEZ,QAAM,OAAO,cAAc,MAAM;AAAA,IAC/B,OAAO;AAAA,IACP,MAAM;AAAA,IACN;AAAA,IACA,UAAU;AAAA;AAAA;AAAA,IAGV,MAAM,WAAW,SAAY;AAAA,IAC7B,GAAG;AAAA,EACL,CAAC;AAED,MAAI,UAAU;AACZ,WAAO;AAAA,MACL;AAAA,MACA;AAAA,QACE,OAAO;AAAA,QACP,SAAS,OAAO,SAAS;AAAA,QACzB;AAAA,MACF;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|
package/dist/frames.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
1
|
import {
|
|
4
2
|
useIconConfig
|
|
5
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Y2MK6VUF.js";
|
|
6
4
|
|
|
7
5
|
// src/github-fallback.tsx
|
|
8
6
|
import { useEffect, useMemo, useState } from "react";
|
|
@@ -98,6 +96,10 @@ var cacheOrder = [];
|
|
|
98
96
|
var MAX_CACHE = 200;
|
|
99
97
|
var NEGATIVE_CACHE_TTL_MS = 6e4;
|
|
100
98
|
var FETCH_TIMEOUT_MS = 8e3;
|
|
99
|
+
var TIMEOUT_REASON = "bgd-icons:timeout";
|
|
100
|
+
function isTimeout(signal) {
|
|
101
|
+
return signal.aborted && signal.reason === TIMEOUT_REASON;
|
|
102
|
+
}
|
|
101
103
|
function cacheGet(url) {
|
|
102
104
|
const entry = svgCache.get(url);
|
|
103
105
|
if (entry === void 0) return void 0;
|
|
@@ -146,7 +148,7 @@ async function fetchSvg(url, signal) {
|
|
|
146
148
|
cacheSet(url, text);
|
|
147
149
|
return text;
|
|
148
150
|
} catch {
|
|
149
|
-
if (!signal.aborted) cacheSet(url, null);
|
|
151
|
+
if (!signal.aborted || isTimeout(signal)) cacheSet(url, null);
|
|
150
152
|
return null;
|
|
151
153
|
}
|
|
152
154
|
}
|
|
@@ -196,11 +198,11 @@ function GithubFallback({
|
|
|
196
198
|
useEffect(() => {
|
|
197
199
|
if (currentState.content || currentState.failed) return;
|
|
198
200
|
const ac = new AbortController();
|
|
199
|
-
const timer = setTimeout(() => ac.abort(), FETCH_TIMEOUT_MS);
|
|
201
|
+
const timer = setTimeout(() => ac.abort(TIMEOUT_REASON), FETCH_TIMEOUT_MS);
|
|
200
202
|
resolveSvg(baseUrl, branch, id, iconType, variant, ac.signal).then(
|
|
201
203
|
(svgText) => {
|
|
202
204
|
clearTimeout(timer);
|
|
203
|
-
if (ac.signal.aborted) return;
|
|
205
|
+
if (ac.signal.aborted && !isTimeout(ac.signal)) return;
|
|
204
206
|
setState(() => {
|
|
205
207
|
if (!svgText) {
|
|
206
208
|
return { key: requestKey, content: null, failed: true };
|
|
@@ -245,4 +247,4 @@ function GithubFallback({
|
|
|
245
247
|
export {
|
|
246
248
|
GithubFallback
|
|
247
249
|
};
|
|
248
|
-
//# sourceMappingURL=github-fallback-
|
|
250
|
+
//# sourceMappingURL=github-fallback-LUYR6NJF.js.map
|