@fiscozen/icons 0.1.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/.eslintignore +1 -0
- package/.eslintrc.cjs +7 -0
- package/.prettierrc.js +6 -0
- package/LICENSE +21 -0
- package/README.md +7 -0
- package/package.json +28 -0
- package/src/FzIcon.vue +21 -0
- package/src/index.ts +16 -0
- package/src/types.ts +4 -0
- package/tsconfig.json +3 -0
package/.eslintignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
dist
|
package/.eslintrc.cjs
ADDED
package/.prettierrc.js
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Fiscozen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# @fiscozen/icons
|
|
2
|
+
|
|
3
|
+
## Notes
|
|
4
|
+
|
|
5
|
+
- For the current iteration we decided to ship icons in a bundle (svg + js style), no API or lazy loading is currently happening
|
|
6
|
+
- In order to keep the bundle size low we are leveraging the "incon kits" Pro Font Awesome feature, therefore tailoring the icon set that we ship. In order to install the design system users therefore need to configure a `.npmrc` in the application root folder, use the one in this repo as a guideline.
|
|
7
|
+
To avoid exposing secrets the Font Awesome Pro token should be configured in a environment variable as `FONTAWESOME_PACKAGE_TOKEN`
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fiscozen/icons",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Design system icon plugin and component",
|
|
5
|
+
"main": "src/index.ts",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"keywords": [],
|
|
8
|
+
"author": "Riccardo Agnoletto",
|
|
9
|
+
"license": "ISC",
|
|
10
|
+
"peerDependencies": {
|
|
11
|
+
"vue": "^3.4.13"
|
|
12
|
+
},
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@fiscozen/eslint-config": "^0.1.0",
|
|
15
|
+
"@fiscozen/prettier-config": "^0.1.0",
|
|
16
|
+
"@fiscozen/tsconfig": "^0.1.0"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@awesome.me/kit-8137893ad3": "^1.0.65",
|
|
20
|
+
"@fortawesome/fontawesome-svg-core": "^6.5.1",
|
|
21
|
+
"@fortawesome/vue-fontawesome": "^3.0.6"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"format": "prettier --write src/",
|
|
25
|
+
"test": "exit 0;",
|
|
26
|
+
"build": "exit 0;"
|
|
27
|
+
}
|
|
28
|
+
}
|
package/src/FzIcon.vue
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
|
|
3
|
+
import { byPrefixAndName } from '@awesome.me/kit-8137893ad3/icons'
|
|
4
|
+
import type { IconSize, IconVariant } from './types'
|
|
5
|
+
|
|
6
|
+
withDefaults(
|
|
7
|
+
defineProps<{
|
|
8
|
+
name: string | string[]
|
|
9
|
+
size?: IconSize
|
|
10
|
+
variant?: IconVariant
|
|
11
|
+
}>(),
|
|
12
|
+
{ size: 'lg', variant: 'far' }
|
|
13
|
+
)
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<font-awesome-icon
|
|
18
|
+
:icon="typeof name === 'string' ? byPrefixAndName[variant][name] : name"
|
|
19
|
+
:size="size !== 'md' ? size : undefined"
|
|
20
|
+
/>
|
|
21
|
+
</template>
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Plugin } from 'vue'
|
|
2
|
+
import { library } from '@fortawesome/fontawesome-svg-core'
|
|
3
|
+
import { all } from '@awesome.me/kit-8137893ad3/icons'
|
|
4
|
+
import FzIcon from './FzIcon.vue'
|
|
5
|
+
|
|
6
|
+
const IconPlugin : Plugin = {
|
|
7
|
+
install(app) {
|
|
8
|
+
// @ts-ignore
|
|
9
|
+
library.add(...all)
|
|
10
|
+
app.component('fz-icon', FzIcon)
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { FzIcon, IconPlugin }
|
|
15
|
+
|
|
16
|
+
export type { IconVariant, IconSize } from './types'
|
package/src/types.ts
ADDED
package/tsconfig.json
ADDED