Skip to content

Commit 9d7c98e

Browse files
authored
Merge pull request #68 from moneytree/export-icon-name-list
[PMB-333] Export list of icon names
2 parents 610b2af + 3970f39 commit 9d7c98e

File tree

7 files changed

+12
-3
lines changed

7 files changed

+12
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mt-web-icons",
3-
"version": "0.2.1",
3+
"version": "0.3.0",
44
"private": true,
55
"main": "react/Icon/cjs/index.js",
66
"module": "react/Icon/esm/index.js",

react/Icon/cjs/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ interface ICoreProps {
44
icon: string;
55
placeholder?: ReactNode;
66
}
7+
export const iconNames: ReadonlyArray<string>;
78
declare type IIconComponentProps = SVGAttributes<SVGElement> & ICoreProps;
89

910
export function SproutLogo(props: SVGAttributes<SVGElement>): ReactNode;

react/Icon/cjs/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

react/Icon/esm/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ interface ICoreProps {
44
icon: string;
55
placeholder?: ReactNode;
66
}
7+
export const iconNames: ReadonlyArray<string>;
78
declare type IIconComponentProps = SVGAttributes<SVGElement> & ICoreProps;
89

910
export function SproutLogo(props: SVGAttributes<SVGElement>): ReactNode;

react/Icon/esm/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

templates/IconComponent.jsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ function getModule(name) {
1818
}
1919
}
2020

21+
export const iconNames = [
22+
<%_ components.forEach(({ name, path }, i) => { _%>
23+
<%- `'${name}'${i < components.length - 1 ? ',' : ''}` %>
24+
<% }); %>
25+
]
26+
2127
function renderFallback(props) {
2228
const { width = 24, height = 24 } = props;
2329
const fallbackProps = {

templates/IconComponentTypeDefinition.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ interface ICoreProps {
44
icon: string;
55
placeholder?: ReactNode;
66
}
7+
export const iconNames: ReadonlyArray<string>;
78
declare type IIconComponentProps = SVGAttributes<SVGElement> & ICoreProps;
89
<% components.forEach(({ name }) => { %>
910
<%- `export function ${name}(props: SVGAttributes<SVGElement>): ReactNode;` -%>

0 commit comments

Comments
 (0)