From 9bac1b8be6a738b8786a4271ec4c4890931b1558 Mon Sep 17 00:00:00 2001 From: William Kelley Date: Fri, 16 Jul 2021 12:15:44 -0400 Subject: [PATCH 1/2] add custom icon file handling to builder --- libs/spark-icons/scripts/builder.js | 2 ++ libs/spark-icons/tsconfig.json | 1 + 2 files changed, 3 insertions(+) diff --git a/libs/spark-icons/scripts/builder.js b/libs/spark-icons/scripts/builder.js index 55dedc1f5..3a843a7c4 100644 --- a/libs/spark-icons/scripts/builder.js +++ b/libs/spark-icons/scripts/builder.js @@ -285,6 +285,8 @@ export async function main(options) { queue.push(svgPaths); await queue.wait({ empty: true }); + await fse.copy(path.join(__dirname, '../custom'), options.outputDir); + await generateIndex(options); if (options.disableLog) { diff --git a/libs/spark-icons/tsconfig.json b/libs/spark-icons/tsconfig.json index 3230750a8..c4b5fa85f 100644 --- a/libs/spark-icons/tsconfig.json +++ b/libs/spark-icons/tsconfig.json @@ -12,6 +12,7 @@ }, "files": [], "include": [], + "exclude": ["./custom/*.tsx"], "references": [ { "path": "./tsconfig.lib.json" From 1be31b0cf188bfbf4743035ab51d1fa26c25cf16 Mon Sep 17 00:00:00 2001 From: William Kelley Date: Fri, 16 Jul 2021 12:16:55 -0400 Subject: [PATCH 2/2] build icons src with custom --- .eslintignore | 3 +- libs/spark-icons/custom/BookIllustration.tsx | 124 ++++++++++++++++++ .../custom/CollaborateIllustration.tsx | 123 +++++++++++++++++ .../custom/ConquerIllustration.tsx | 95 ++++++++++++++ .../spark-icons/custom/CreateIllustration.tsx | 98 ++++++++++++++ libs/spark-icons/custom/PrendaMonogram.tsx | 10 ++ libs/spark-icons/custom/PrendaWordmark.tsx | 10 ++ libs/spark-icons/custom/SparkMonogram.tsx | 10 ++ libs/spark-icons/src/BookIllustration.tsx | 124 ++++++++++++++++++ .../src/CollaborateIllustration.tsx | 123 +++++++++++++++++ libs/spark-icons/src/ConquerIllustration.tsx | 95 ++++++++++++++ libs/spark-icons/src/CreateIllustration.tsx | 98 ++++++++++++++ libs/spark-icons/src/PrendaMonogram.tsx | 10 ++ libs/spark-icons/src/PrendaWordmark.tsx | 10 ++ libs/spark-icons/src/SparkMonogram.tsx | 10 ++ libs/spark-icons/src/index.ts | 7 + libs/spark-icons/src/utils/createSvgIcon.tsx | 7 +- 17 files changed, 954 insertions(+), 3 deletions(-) create mode 100644 libs/spark-icons/custom/BookIllustration.tsx create mode 100644 libs/spark-icons/custom/CollaborateIllustration.tsx create mode 100644 libs/spark-icons/custom/ConquerIllustration.tsx create mode 100644 libs/spark-icons/custom/CreateIllustration.tsx create mode 100644 libs/spark-icons/custom/PrendaMonogram.tsx create mode 100644 libs/spark-icons/custom/PrendaWordmark.tsx create mode 100644 libs/spark-icons/custom/SparkMonogram.tsx create mode 100644 libs/spark-icons/src/BookIllustration.tsx create mode 100644 libs/spark-icons/src/CollaborateIllustration.tsx create mode 100644 libs/spark-icons/src/ConquerIllustration.tsx create mode 100644 libs/spark-icons/src/CreateIllustration.tsx create mode 100644 libs/spark-icons/src/PrendaMonogram.tsx create mode 100644 libs/spark-icons/src/PrendaWordmark.tsx create mode 100644 libs/spark-icons/src/SparkMonogram.tsx diff --git a/.eslintignore b/.eslintignore index 3bb5359f5..b6bda3d1d 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1,3 @@ /libs/spark-icons/defaults/templateSvgIcon.js -/libs/spark-icons/src/* \ No newline at end of file +/libs/spark-icons/src/* +/libs/spark-icons/custom \ No newline at end of file diff --git a/libs/spark-icons/custom/BookIllustration.tsx b/libs/spark-icons/custom/BookIllustration.tsx new file mode 100644 index 000000000..e09bb04e6 --- /dev/null +++ b/libs/spark-icons/custom/BookIllustration.tsx @@ -0,0 +1,124 @@ +import * as React from 'react'; +import createSvgIcon from './utils/createSvgIcon'; + +export default createSvgIcon( + [ + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + + + + + + , + ], + 'BookIllustration', + '0 0 640 640', + '640', + '640' +); diff --git a/libs/spark-icons/custom/CollaborateIllustration.tsx b/libs/spark-icons/custom/CollaborateIllustration.tsx new file mode 100644 index 000000000..630752af0 --- /dev/null +++ b/libs/spark-icons/custom/CollaborateIllustration.tsx @@ -0,0 +1,123 @@ +import * as React from 'react'; +import createSvgIcon from './utils/createSvgIcon'; + +export default createSvgIcon( + [ + + + + + + + + + + + + + + + + + + + + + + , + + + + + + + + + , + ], + 'CollaborateIllustration', + '0 0 640 640', + '640', + '640' +); diff --git a/libs/spark-icons/custom/ConquerIllustration.tsx b/libs/spark-icons/custom/ConquerIllustration.tsx new file mode 100644 index 000000000..b93a8bd94 --- /dev/null +++ b/libs/spark-icons/custom/ConquerIllustration.tsx @@ -0,0 +1,95 @@ +import * as React from 'react'; +import createSvgIcon from './utils/createSvgIcon'; + +export default createSvgIcon( + [ + + + + + + + + + + + + + + + + , + + + + + + + + + , + ], + 'ConquerIllustration', + '0 0 640 640', + '640', + '640' +); diff --git a/libs/spark-icons/custom/CreateIllustration.tsx b/libs/spark-icons/custom/CreateIllustration.tsx new file mode 100644 index 000000000..d440fc872 --- /dev/null +++ b/libs/spark-icons/custom/CreateIllustration.tsx @@ -0,0 +1,98 @@ +import * as React from 'react'; +import createSvgIcon from './utils/createSvgIcon'; + +export default createSvgIcon( + [ + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + + + + + + , + ], + 'CreateIllustration', + '0 0 640 640', + '640', + '640' +); diff --git a/libs/spark-icons/custom/PrendaMonogram.tsx b/libs/spark-icons/custom/PrendaMonogram.tsx new file mode 100644 index 000000000..1e57e5aeb --- /dev/null +++ b/libs/spark-icons/custom/PrendaMonogram.tsx @@ -0,0 +1,10 @@ +import * as React from 'react'; +import createSvgIcon from './utils/createSvgIcon'; + +export default createSvgIcon( + , + 'PrendaMonogram', + '0 0 65 88', + '65', + '88' +); diff --git a/libs/spark-icons/custom/PrendaWordmark.tsx b/libs/spark-icons/custom/PrendaWordmark.tsx new file mode 100644 index 000000000..1b9da1b1e --- /dev/null +++ b/libs/spark-icons/custom/PrendaWordmark.tsx @@ -0,0 +1,10 @@ +import * as React from 'react'; +import createSvgIcon from './utils/createSvgIcon'; + +export default createSvgIcon( + , + 'PrendaWordmark', + '0 0 167 88', + '167px', + '88px' +); diff --git a/libs/spark-icons/custom/SparkMonogram.tsx b/libs/spark-icons/custom/SparkMonogram.tsx new file mode 100644 index 000000000..50e117cbf --- /dev/null +++ b/libs/spark-icons/custom/SparkMonogram.tsx @@ -0,0 +1,10 @@ +import * as React from 'react'; +import createSvgIcon from './utils/createSvgIcon'; + +export default createSvgIcon( + , + 'SparkMonogram', + '0 0 64 80', + '64', + '80' +); diff --git a/libs/spark-icons/src/BookIllustration.tsx b/libs/spark-icons/src/BookIllustration.tsx new file mode 100644 index 000000000..e09bb04e6 --- /dev/null +++ b/libs/spark-icons/src/BookIllustration.tsx @@ -0,0 +1,124 @@ +import * as React from 'react'; +import createSvgIcon from './utils/createSvgIcon'; + +export default createSvgIcon( + [ + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + + + + + + , + ], + 'BookIllustration', + '0 0 640 640', + '640', + '640' +); diff --git a/libs/spark-icons/src/CollaborateIllustration.tsx b/libs/spark-icons/src/CollaborateIllustration.tsx new file mode 100644 index 000000000..630752af0 --- /dev/null +++ b/libs/spark-icons/src/CollaborateIllustration.tsx @@ -0,0 +1,123 @@ +import * as React from 'react'; +import createSvgIcon from './utils/createSvgIcon'; + +export default createSvgIcon( + [ + + + + + + + + + + + + + + + + + + + + + + , + + + + + + + + + , + ], + 'CollaborateIllustration', + '0 0 640 640', + '640', + '640' +); diff --git a/libs/spark-icons/src/ConquerIllustration.tsx b/libs/spark-icons/src/ConquerIllustration.tsx new file mode 100644 index 000000000..b93a8bd94 --- /dev/null +++ b/libs/spark-icons/src/ConquerIllustration.tsx @@ -0,0 +1,95 @@ +import * as React from 'react'; +import createSvgIcon from './utils/createSvgIcon'; + +export default createSvgIcon( + [ + + + + + + + + + + + + + + + + , + + + + + + + + + , + ], + 'ConquerIllustration', + '0 0 640 640', + '640', + '640' +); diff --git a/libs/spark-icons/src/CreateIllustration.tsx b/libs/spark-icons/src/CreateIllustration.tsx new file mode 100644 index 000000000..d440fc872 --- /dev/null +++ b/libs/spark-icons/src/CreateIllustration.tsx @@ -0,0 +1,98 @@ +import * as React from 'react'; +import createSvgIcon from './utils/createSvgIcon'; + +export default createSvgIcon( + [ + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + + + + + + , + ], + 'CreateIllustration', + '0 0 640 640', + '640', + '640' +); diff --git a/libs/spark-icons/src/PrendaMonogram.tsx b/libs/spark-icons/src/PrendaMonogram.tsx new file mode 100644 index 000000000..1e57e5aeb --- /dev/null +++ b/libs/spark-icons/src/PrendaMonogram.tsx @@ -0,0 +1,10 @@ +import * as React from 'react'; +import createSvgIcon from './utils/createSvgIcon'; + +export default createSvgIcon( + , + 'PrendaMonogram', + '0 0 65 88', + '65', + '88' +); diff --git a/libs/spark-icons/src/PrendaWordmark.tsx b/libs/spark-icons/src/PrendaWordmark.tsx new file mode 100644 index 000000000..1b9da1b1e --- /dev/null +++ b/libs/spark-icons/src/PrendaWordmark.tsx @@ -0,0 +1,10 @@ +import * as React from 'react'; +import createSvgIcon from './utils/createSvgIcon'; + +export default createSvgIcon( + , + 'PrendaWordmark', + '0 0 167 88', + '167px', + '88px' +); diff --git a/libs/spark-icons/src/SparkMonogram.tsx b/libs/spark-icons/src/SparkMonogram.tsx new file mode 100644 index 000000000..50e117cbf --- /dev/null +++ b/libs/spark-icons/src/SparkMonogram.tsx @@ -0,0 +1,10 @@ +import * as React from 'react'; +import createSvgIcon from './utils/createSvgIcon'; + +export default createSvgIcon( + , + 'SparkMonogram', + '0 0 64 80', + '64', + '80' +); diff --git a/libs/spark-icons/src/index.ts b/libs/spark-icons/src/index.ts index edcbff875..515fed059 100644 --- a/libs/spark-icons/src/index.ts +++ b/libs/spark-icons/src/index.ts @@ -153,6 +153,7 @@ export { default as Bluetooth } from './Bluetooth'; export { default as Book } from './Book'; export { default as BookDuotone } from './BookDuotone'; export { default as BookFilled } from './BookFilled'; +export { default as BookIllustration } from './BookIllustration'; export { default as BookLibrary } from './BookLibrary'; export { default as BookLibraryDuotone } from './BookLibraryDuotone'; export { default as BookLibraryFilled } from './BookLibraryFilled'; @@ -411,6 +412,7 @@ export { default as Code } from './Code'; export { default as Coffee } from './Coffee'; export { default as CoffeeDuotone } from './CoffeeDuotone'; export { default as CoffeeFilled } from './CoffeeFilled'; +export { default as CollaborateIllustration } from './CollaborateIllustration'; export { default as ColorFilter } from './ColorFilter'; export { default as ColorFilterDuotone } from './ColorFilterDuotone'; export { default as ColorFilterFilled } from './ColorFilterFilled'; @@ -485,12 +487,14 @@ export { default as CommentTextFilled } from './CommentTextFilled'; export { default as Compass } from './Compass'; export { default as CompassDuotone } from './CompassDuotone'; export { default as CompassFilled } from './CompassFilled'; +export { default as ConquerIllustration } from './ConquerIllustration'; export { default as Copy } from './Copy'; export { default as CopyDuotone } from './CopyDuotone'; export { default as CopyFilled } from './CopyFilled'; export { default as Copyright } from './Copyright'; export { default as CopyrightDuotone } from './CopyrightDuotone'; export { default as CopyrightFilled } from './CopyrightFilled'; +export { default as CreateIllustration } from './CreateIllustration'; export { default as CreditCard } from './CreditCard'; export { default as CreditCardDuotone } from './CreditCardDuotone'; export { default as CreditCardFilled } from './CreditCardFilled'; @@ -1289,6 +1293,8 @@ export { default as POS } from './POS'; export { default as POSDuotone } from './POSDuotone'; export { default as POSFilled } from './POSFilled'; export { default as Power } from './Power'; +export { default as PrendaMonogram } from './PrendaMonogram'; +export { default as PrendaWordmark } from './PrendaWordmark'; export { default as PresentationChart } from './PresentationChart'; export { default as PresentationChartDuotone } from './PresentationChartDuotone'; export { default as PresentationChartFilled } from './PresentationChartFilled'; @@ -1461,6 +1467,7 @@ export { default as SortNumberReverse } from './SortNumberReverse'; export { default as SortText } from './SortText'; export { default as SortTextReverse } from './SortTextReverse'; export { default as Soundwave } from './Soundwave'; +export { default as SparkMonogram } from './SparkMonogram'; export { default as Speaker } from './Speaker'; export { default as SpeakerDuotone } from './SpeakerDuotone'; export { default as SpeakerFilled } from './SpeakerFilled'; diff --git a/libs/spark-icons/src/utils/createSvgIcon.tsx b/libs/spark-icons/src/utils/createSvgIcon.tsx index d1fce8703..fe7bf9b05 100644 --- a/libs/spark-icons/src/utils/createSvgIcon.tsx +++ b/libs/spark-icons/src/utils/createSvgIcon.tsx @@ -7,10 +7,13 @@ import { SvgIconProps as MuiSvgIconProps } from '@material-ui/core'; export default function createSvgIcon( path: React.ReactNode, - displayName: string + displayName: string, + viewBox?: string, + width?: string, + height?: string ): typeof SvgIcon { const Component = (props: MuiSvgIconProps, ref: React.ForwardedRef) => ( - + {path} );