material-icon-generator 0.2.0 → 0.3.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/config.js +1 -1
- package/dist/data/icons.json +1 -1
- package/dist/main.js +1 -1
- package/dist/templates/SvelteMasterComponent.hbs +14 -12
- package/dist/utils.js +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -13,7 +13,7 @@ function main() {
|
|
|
13
13
|
parser.add_argument('-d', '--dirpath', {
|
|
14
14
|
help: 'Output directory path',
|
|
15
15
|
metavar: 'DIRPATH',
|
|
16
|
-
default: "src/lib/components
|
|
16
|
+
default: "src/lib/components"
|
|
17
17
|
});
|
|
18
18
|
const [args, rest] = parser.parse_known_args();
|
|
19
19
|
const props = {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import type { ClassValue } from 'svelte/elements';
|
|
4
4
|
|
|
5
5
|
interface Props {
|
|
6
|
-
icon:
|
|
6
|
+
icon: MaterialIconName,
|
|
7
7
|
size?: number,
|
|
8
8
|
class?: ClassValue,
|
|
9
9
|
hidden?: boolean
|
|
@@ -13,18 +13,20 @@
|
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
15
|
<script lang="ts" module>
|
|
16
|
-
export type
|
|
17
|
-
export const
|
|
16
|
+
export type MaterialIconName = {{{ nametype }}};
|
|
17
|
+
export const MaterialIconsAll: MaterialIconName[] = [{{{ iconsArray }}}];
|
|
18
18
|
</script>
|
|
19
19
|
|
|
20
20
|
<div style:height={px} style:width={px} class={props.class || ""} {hidden}>
|
|
21
|
-
|
|
22
|
-
{{{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
{{{
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
{
|
|
29
|
-
|
|
21
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="100%" viewBox="0 -960 960 960" width="100%" fill="currentColor">
|
|
22
|
+
{#if icon === "{{firstIcon.name}}" }
|
|
23
|
+
<path d="{{{ firstIcon.pathd }}}" />
|
|
24
|
+
{{#each restIcons}}
|
|
25
|
+
{:else if icon === "{{this.name}}" }
|
|
26
|
+
<path d="{{{ this.pathd }}}" />
|
|
27
|
+
{{/each}}
|
|
28
|
+
{:else}
|
|
29
|
+
<path d="M513.5-254.5Q528-269 528-290t-14.5-35.5Q499-340 478-340t-35.5 14.5Q428-311 428-290t14.5 35.5Q457-240 478-240t35.5-14.5ZM442-394h74q0-33 7.5-52t42.5-52q26-26 41-49.5t15-56.5q0-56-41-86t-97-30q-57 0-92.5 30T342-618l66 26q5-18 22.5-39t53.5-21q32 0 48 17.5t16 38.5q0 20-12 37.5T506-526q-44 39-54 59t-10 73Zm38 314q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z"/>
|
|
30
|
+
{/if}
|
|
31
|
+
</svg>
|
|
30
32
|
</div>
|
package/dist/utils.js
CHANGED
|
@@ -6,7 +6,7 @@ function dashedToCamelCase(str) {
|
|
|
6
6
|
.join('');
|
|
7
7
|
}
|
|
8
8
|
export function getSvelteFileName(title) {
|
|
9
|
-
return `
|
|
9
|
+
return `Material${dashedToCamelCase(title)}Icon.svelte`;
|
|
10
10
|
}
|
|
11
11
|
export function getSvelteComponentPath(iconName, dirpath) {
|
|
12
12
|
const filename = getSvelteFileName(iconName);
|