V0.1
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "k356",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"node_modules/@jamescoyle/svg-icon": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@jamescoyle/svg-icon/-/svg-icon-0.2.1.tgz",
|
||||
"integrity": "sha512-ZGth9/uM02L7hxKEPmpVYheviVM1R0P6pxQp4M96xmtqTcFVe22UQIGTfyGWrkFMJtztTgMq2K12++Zv5aXZIw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@mdi/js": {
|
||||
"version": "7.4.47",
|
||||
"resolved": "https://registry.npmjs.org/@mdi/js/-/js-7.4.47.tgz",
|
||||
"integrity": "sha512-KPnNOtm5i2pMabqZxpUz7iQf+mfrYZyKCZ8QNz85czgEt7cuHcGorWfdzUMWYA0SD+a6Hn4FmJ+YhzzzjkTZrQ==",
|
||||
"license": "Apache-2.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: [JamesCoyle] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 James Coyle
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
# SVG Icon WebComponent
|
||||
|
||||
[](https://www.npmjs.com/package/@jamescoyle/svg-icon)
|
||||
[](https://www.npmjs.com/package/@jamescoyle/svg-icon)
|
||||
|
||||
A basic webcomponent for rendering a single path SVG icon. This component makes it easy to use SVG path based icon packs such as [MaterialDesignIcons](https://materialdesignicons.com/) and [SimpleIcons](https://simpleicons.org/).
|
||||
|
||||
# Usage
|
||||
|
||||
1. Install the package from NPM
|
||||
```
|
||||
npm install @jamescoyle/svg-icon
|
||||
```
|
||||
|
||||
2. Import the component into your application
|
||||
```
|
||||
import '@jamescoyle/svg-icon'
|
||||
```
|
||||
|
||||
3. Use the icon in your markup
|
||||
```
|
||||
<svg-icon type="mdi" path="M...z"></svg-icon>
|
||||
```
|
||||
|
||||
# Attributes
|
||||
|
||||
| Name | Default | Description |
|
||||
| ------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| type | null | This sets the size and viewbox to match the recommended size for the icon pack specified. |
|
||||
| path | null | Required. An SVG path to render as an icon |
|
||||
| size | 24 | The width and height of the SVG element |
|
||||
| viewbox | "0 0 24 24" | The `viewBox` of the SVG element |
|
||||
| flip | null | One of "horizontal", "vertical", or "both". Flips the icon in the specified direction(s). |
|
||||
| rotate | 0deg | Rotates the icon by the specified value. Can be any valid [CSS angle](https://developer.mozilla.org/en-US/docs/Web/CSS/angle) value. |
|
||||
|
||||
# Styling
|
||||
|
||||
By default the icon will inherit the current font color of the container it is placed within. You can easily provide a specific color using an inline style on the element (`style="color: red"`) or can target the tag as normal with CSS rules.
|
||||
|
||||
# Accessibility
|
||||
|
||||
You should make use of aria attributes to improve accessibility for users that use screen reading technology. You can use `aria-labelledby` to create a link between an icon and its label. A descriptive `aria-label` can be used to allow screen readers to announce an icon if there is no visual label to accompany it.
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"name": "@jamescoyle/svg-icon",
|
||||
"version": "0.2.1",
|
||||
"description": "Icon webcomponent",
|
||||
"main": "lib/svg-icon.js",
|
||||
"directories": {
|
||||
"lib": "lib",
|
||||
"test": "tests"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "jest"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/JamesCoyle/svg-icon.git"
|
||||
},
|
||||
"keywords": [
|
||||
"webcomponents",
|
||||
"icon",
|
||||
"mdi",
|
||||
"pictogrammers"
|
||||
],
|
||||
"author": "Pictogrammers, James Coyle",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/JamesCoyle/svg-icon/issues"
|
||||
},
|
||||
"homepage": "https://github.com/JamesCoyle/svg-icon#readme"
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Document</title>
|
||||
|
||||
<script type="module">
|
||||
import '../lib/svg-icon.js'
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<svg-icon type="mdi" path="M15,14C12.33,14 7,15.33 7,18V20H23V18C23,15.33 17.67,14 15,14M15,12A4,4 0 0,0 19,8A4,4 0 0,0 15,4A4,4 0 0,0 11,8A4,4 0 0,0 15,12M5,13.28L7.45,14.77L6.8,11.96L9,10.08L6.11,9.83L5,7.19L3.87,9.83L1,10.08L3.18,11.96L2.5,14.77L5,13.28Z"></svg-icon>
|
||||
</body>
|
||||
</html>
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
Pictogrammers Free License
|
||||
--------------------------
|
||||
|
||||
This icon collection is released as free, open source, and GPL friendly by
|
||||
the [Pictogrammers](http://pictogrammers.com/) icon group. You may use it
|
||||
for commercial projects, open source projects, or anything really.
|
||||
|
||||
# Icons: Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0)
|
||||
Some of the icons are redistributed under the Apache 2.0 license. All other
|
||||
icons are either redistributed under their respective licenses or are
|
||||
distributed under the Apache 2.0 license.
|
||||
|
||||
# Fonts: Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0)
|
||||
All web and desktop fonts are distributed under the Apache 2.0 license. Web
|
||||
and desktop fonts contain some icons that are redistributed under the Apache
|
||||
2.0 license. All other icons are either redistributed under their respective
|
||||
licenses or are distributed under the Apache 2.0 license.
|
||||
|
||||
# Code: MIT (https://opensource.org/licenses/MIT)
|
||||
The MIT license applies to all non-font and non-icon files.
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
> *Note:* Please use the main [MaterialDesign](https://github.com/Templarian/MaterialDesign/issues) repo to report issues. This repo is for distribution of the JavaScript files only.
|
||||
|
||||
# JavaScript/TypeScript - Material Design Icons
|
||||
|
||||
JavaScript and TypeScript distribution for the [Material Design Icons](https://materialdesignicons.com). This module contains all the path data for all icons.
|
||||
|
||||
```
|
||||
npm install @mdi/js
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
import { mdiAccount } from '@mdi/js'
|
||||
|
||||
console.log(mdiAccount); // "M...Z"
|
||||
```
|
||||
|
||||
> Note: [WebPack](https://webpack.js.org) 4 or [Rollup](https://rollupjs.org) will tree shake unused icons.
|
||||
|
||||
## Related Packages
|
||||
|
||||
[NPM @MDI Organization](https://npmjs.com/org/mdi)
|
||||
|
||||
- React: [MaterialDesign-React](https://github.com/Templarian/MaterialDesign-React)
|
||||
- SVG: [MaterialDesign-SVG](https://github.com/Templarian/MaterialDesign-SVG)
|
||||
- Webfont: [MaterialDesign-Webfont](https://github.com/Templarian/MaterialDesign-Webfont)
|
||||
- Font-Build: [MaterialDesign-Font-Build](https://github.com/Templarian/MaterialDesign-Font-Build)
|
||||
- Desktop Font: [MaterialDesign-Font](https://github.com/Templarian/MaterialDesign-Font)
|
||||
|
||||
## Learn More
|
||||
|
||||
- [MaterialDesignIcons.com](https://materialdesignicons.com)
|
||||
- https://github.com/Templarian/MaterialDesign
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
const util = require('@mdi/util');
|
||||
|
||||
const meta = util.getMeta(true);
|
||||
|
||||
const find = /(\-\w)/g;
|
||||
const convert = function(matches){
|
||||
return matches[1].toUpperCase();
|
||||
};
|
||||
|
||||
const lines = meta.map(icon => {
|
||||
let name = icon.name.replace(find, convert);
|
||||
name = `${name[0].toUpperCase()}${name.slice(1)}`;
|
||||
return `export const mdi${name}: string = "${icon.path}";`;
|
||||
});
|
||||
|
||||
const output = `// Material Design Icons v${util.getVersion()}\n${lines.join('\n')}`;
|
||||
|
||||
util.write("mdi.ts", output);
|
||||
+7447
File diff suppressed because it is too large
Load Diff
+7599
File diff suppressed because it is too large
Load Diff
+7447
File diff suppressed because it is too large
Load Diff
+7448
File diff suppressed because it is too large
Load Diff
+37
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "@mdi/js",
|
||||
"version": "7.4.47",
|
||||
"description": "Dist for Material Design Icons for JS/TypeScript",
|
||||
"main": "commonjs/mdi.js",
|
||||
"module": "mdi.js",
|
||||
"types": "mdi.d.ts",
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"build": "npm update && npm install && npm run buildjs && npm run es5 && npm run commonjs",
|
||||
"buildjs": "node build.js",
|
||||
"es5": "tsc -d mdi.ts --target es5 --module es2015",
|
||||
"commonjs": "tsc -d mdi.ts --outDir commonjs",
|
||||
"umd": "tsc -d mdi.ts --module UMD --outDir umd",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/Templarian/MaterialDesign-JS.git"
|
||||
},
|
||||
"keywords": [
|
||||
"Material",
|
||||
"Design",
|
||||
"Icons",
|
||||
"mdi"
|
||||
],
|
||||
"author": "Austin Andrews",
|
||||
"license": "Apache-2.0",
|
||||
"bugs": {
|
||||
"url": "https://github.com/Templarian/MaterialDesign-JS/issues"
|
||||
},
|
||||
"homepage": "https://github.com/Templarian/MaterialDesign-JS#readme",
|
||||
"devDependencies": {
|
||||
"@mdi/svg": "^7.4.47",
|
||||
"@mdi/util": "^0.3.2"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user