@lukekaalim/act-icons 1.0.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/docs/index.ts +11 -0
- package/mod.doc.ts +16 -0
- package/mod.module.css +3 -0
- package/mod.ts +16 -0
- package/package.json +10 -0
- package/readme.md +19 -0
package/docs/index.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DocApp } from "@lukekaalim/grimoire";
|
|
2
|
+
import { TypeDocPlugin } from "@lukekaalim/grimoire-ts";
|
|
3
|
+
|
|
4
|
+
import readmeMd from '../readme.md?raw';
|
|
5
|
+
import projectJSON from 'typedoc:../mod.ts';
|
|
6
|
+
|
|
7
|
+
export const buildIconDocs = (doc: DocApp<[TypeDocPlugin]>) => {
|
|
8
|
+
doc.typedoc.addProjectJSON('@lukekaalim/act-icons', projectJSON);
|
|
9
|
+
|
|
10
|
+
doc.article.add('icons.readme', readmeMd, '/packages/@lukekaalim/act-icons');
|
|
11
|
+
}
|
package/mod.doc.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { h, useEffect, useRef } from "@lukekaalim/act";
|
|
2
|
+
import { MarkdownArticle } from "@lukekaalim/grimoire";
|
|
3
|
+
import md from './readme.md?raw';
|
|
4
|
+
import { SVGRepo } from "./mod";
|
|
5
|
+
import { MarkdownComponent } from "@lukekaalim/act-markdown";
|
|
6
|
+
|
|
7
|
+
const SVGRepoDemo: MarkdownComponent = (props) => {
|
|
8
|
+
const href = `https://www.svgrepo.com/svg/${props.attributes.key}`;
|
|
9
|
+
return h('a', { href, style: { fontSize: '48px', display: 'flex', justifyContent: 'center' } },
|
|
10
|
+
h(SVGRepo, { key: props.attributes.key as string }));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default h(MarkdownArticle, {
|
|
14
|
+
content: md,
|
|
15
|
+
//options: { inlineComponents: { SVGRepoDemo }}
|
|
16
|
+
});
|
package/mod.module.css
ADDED
package/mod.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Component, h } from "@lukekaalim/act";
|
|
2
|
+
import classes from './mod.module.css'
|
|
3
|
+
|
|
4
|
+
export type SVGRepoProps = {
|
|
5
|
+
/** the id and name, i.e.: `535142/aquarius` */
|
|
6
|
+
key: string,
|
|
7
|
+
style?: Record<string, string>
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const SVGRepo: Component<SVGRepoProps> = ({ key, style }) => {
|
|
11
|
+
return h('img', {
|
|
12
|
+
style,
|
|
13
|
+
className: classes.icon,
|
|
14
|
+
src: `https://www.svgrepo.com/download/${key}.svg`,
|
|
15
|
+
})
|
|
16
|
+
}
|
package/package.json
ADDED
package/readme.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# @lukekaalim/act-icons
|
|
2
|
+
|
|
3
|
+
Tiny icon library.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install @lukekaalim/act-icons
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## SVGRepo
|
|
10
|
+
|
|
11
|
+
<TypeDoc project="@lukekaalim/act-icons" name="SVGRepo" extras="SVGRepoProps" />
|
|
12
|
+
|
|
13
|
+
Link `img` elements to URLs from [SVGRepo](https://www.svgrepo.com/).
|
|
14
|
+
|
|
15
|
+
|Name|Key|Example|
|
|
16
|
+
|-|-|-|
|
|
17
|
+
|Front Page|`530508/front-page`|<SVGRepoDemo key="530508/front-page" />|
|
|
18
|
+
|Chef Man|`533810/chef-man-cap`|<SVGRepoDemo key="533810/chef-man-cap" />|
|
|
19
|
+
|Genetic Data|`530661/genetic-data`|<SVGRepoDemo key="530661/genetic-data" />|
|