2023-04-14 21:27:05 +00:00
|
|
|
/** @type {import('@svgr/babel-plugin-transform-svg-component').Template} */
|
2023-01-20 14:18:05 +00:00
|
|
|
const template = (variables, { tpl }) => {
|
|
|
|
return tpl`
|
2023-04-14 21:27:05 +00:00
|
|
|
import { createIcon } from '../lib/create-icon'
|
|
|
|
${'\n'}
|
|
|
|
const ${variables.componentName} = createIcon((props) => {
|
|
|
|
return (
|
|
|
|
${variables.jsx}
|
|
|
|
)
|
|
|
|
});
|
|
|
|
${'\n'}
|
|
|
|
${variables.exports};
|
2023-01-20 14:18:05 +00:00
|
|
|
`
|
|
|
|
}
|
|
|
|
|
2023-04-14 21:27:05 +00:00
|
|
|
/** @type {import('@svgr/core').Config} */
|
2023-01-20 14:18:05 +00:00
|
|
|
module.exports = {
|
|
|
|
typescript: true,
|
|
|
|
jsxRuntime: 'automatic',
|
2023-04-14 21:27:05 +00:00
|
|
|
expandProps: 'start',
|
|
|
|
svgProps: {
|
|
|
|
focusable: '{false}',
|
|
|
|
'aria-hidden': '{true}',
|
|
|
|
width: '{props.width}',
|
|
|
|
height: '{props.height}',
|
|
|
|
},
|
|
|
|
svgoConfig: {
|
|
|
|
plugins: [
|
|
|
|
{
|
|
|
|
name: 'preset-default',
|
|
|
|
params: {
|
|
|
|
overrides: {
|
|
|
|
// viewBox is required to resize SVGs with CSS.
|
|
|
|
// @see https://github.com/svg/svgo/issues/1128
|
|
|
|
removeViewBox: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'prefixIds',
|
|
|
|
],
|
|
|
|
},
|
2023-01-20 14:18:05 +00:00
|
|
|
replaceAttrValues: {
|
2023-04-14 21:27:05 +00:00
|
|
|
// currentColor: '{props.color}',
|
|
|
|
'#09101C': '{props.color}',
|
|
|
|
'#000': '{props.color}',
|
|
|
|
'#0D1625': '{props.color}',
|
2023-07-02 21:57:40 +00:00
|
|
|
'#647084': '{props.color}',
|
2023-01-20 14:18:05 +00:00
|
|
|
},
|
|
|
|
filenameCase: 'kebab',
|
|
|
|
template,
|
|
|
|
}
|