![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@axa-ch/materials
Advanced tools
Materials provides common used icons and images in the SVG format. In addition materials exports styles like colors, helpers, typography and layouts.
Important: If this component needs to run in Internet Explorer 11, you need to use our polyfill.
npm install @axa-ch/materials
import { svg } from 'lit-html';
import { ArrowRightSvg } from '@axa-ch/materials/icons';
<span>${svg(ArrowRightSvg)}</span>;
import ArrowRightSvg from '@axa-ch/materials/icons-raw/arrow-right.svg';
<ArrowRightSvg />;
You need to use SVGR
that takes external SVG files and transforms them into React components with Webpack. It is installed automatically if you use create-pod-app
.
If you need to install it manually:
npm install @svgr/webpack --save-dev
{
test: /\.svg$/,
use: ['@svgr/webpack'],
}
(Complete list is visible here)
icons |
---|
AddSvg |
ArrowLeftSvg |
ArrowRightSvg |
AttachFileSvg |
CancelSvg |
CaretSvg |
CheckCircleSvg |
ClearSvg |
CloudUploadSvg |
CollapseSvg |
DateInputSvg |
DeleteForeverSvg |
DocumentSvg |
DownloadSvg |
EmailSvg |
ExpandSvg |
FacebookSvg |
InfoSvg |
InstagramSvg |
KeySvg |
LinkedinSvg |
MobileSvg |
MessageSvg |
PersonSvg |
PhoneSvg |
PowerSvg |
SearchSvg |
TwitterSvg |
UploadSvg |
XingSvg |
YoutubeSvg |
images |
---|
AxaLogoSvg |
AxaLogoOpenSvg |
... and many more in subfolders |
data-name="Layer 2"
# layer info for vector drawing software<path fill="#fff" d="M0 0h96v96H0z"/>
# outer bounding box filled with white backgroundnpm run build-images
from the materials-folder itself to clean up and optimize the SVGs, then copy the optimized files back from the .tmp
folder to images-raw
fill="currentColor"
and/or strokes="currentColor"
as appropriate. Remove unnecessary attributes.npm run build
to generate a js file for each svg file found. The generated files can be found in the images
folder.All our icons in the "icons" section are the material icons from google (and nothing else). To update the material icons from google (https://github.com/google/material-design-icons/releases), follow these steps.
icons-raw
folder.material-design-icons
.cd
into the materials root folder (src/components/00-materials/
).sh material-importer.sh
.src/components/00-materials/icons-raw
and search for <path
(whitespace at the end).<path fill="currentColor"
(whitespace at the end).src/components/00-materials/icons-raw
and search for <circle
(whitespace at the end).<circle fill="currentColor"
(whitespace at the end).Done. This seems to be the fastest and most efficient approach with the current importer script.
FAQs
The materials component for the AXA Pattern Library
The npm package @axa-ch/materials receives a total of 170 weekly downloads. As such, @axa-ch/materials popularity was classified as not popular.
We found that @axa-ch/materials demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 46 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.