From 2fe4229a5f1d5c43fbbee7fcdbd0855532f50b95 Mon Sep 17 00:00:00 2001 From: CyanSalt Date: Fri, 7 Jul 2023 14:04:17 +0800 Subject: [PATCH] feat: add icon --- docs/.vitepress/config.ts | 1 + docs/components/icon.md | 129 ++++++++++++++++++++++++++++++++++ package-lock.json | 50 +++++++++++++ package.json | 1 + src/components.ts | 1 + src/icon/index.vue | 143 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 325 insertions(+) create mode 100644 docs/components/icon.md create mode 100644 src/icon/index.vue diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 47c6552..33e3ccd 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -32,6 +32,7 @@ export default defineConfig({ { text: 'Divider', link: '/components/divider' }, { text: 'Graphics', link: '/components/graphics' }, { text: 'Grid Guide', link: '/components/grid-guide' }, + { text: 'Icon', link: '/components/icon' }, { text: 'Link', link: '/components/link' }, { text: 'Space', link: '/components/space' }, { text: 'Text', link: '/components/text' }, diff --git a/docs/components/icon.md b/docs/components/icon.md new file mode 100644 index 0000000..ebf0816 --- /dev/null +++ b/docs/components/icon.md @@ -0,0 +1,129 @@ + + +# RIcon + +No Picture, No Truth. + + + +INFO
Roughness uses [Feather Icons](https://feathericons.com/). + +
+ +## Example + +### Basic + + + + +```vue + + + +``` + + + + + + + + + +### Color and Size + +See [Text](/components/text). + +## Usage + +### Props + + + + + + + + + + + + + + + + + +### Styles + + + + + + + + + + + + + diff --git a/package-lock.json b/package-lock.json index f249501..c4ce93f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,6 +23,7 @@ "chart.js": "^4.3.0", "chartjs-plugin-roughness": "^1.0.6", "fast-glob": "^3.2.12", + "feather-icons": "^4.29.0", "lodash-es": "^4.17.21", "parse-unit": "^1.0.1", "release-it": "^15.11.0", @@ -3691,6 +3692,12 @@ "node": ">=8" } }, + "node_modules/classnames": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz", + "integrity": "sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==", + "dev": true + }, "node_modules/clean-regexp": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/clean-regexp/-/clean-regexp-1.0.0.tgz", @@ -4655,6 +4662,17 @@ "dev": true, "peer": true }, + "node_modules/core-js": { + "version": "3.31.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.31.1.tgz", + "integrity": "sha512-2sKLtfq1eFST7l7v62zaqXacPc7uG8ZAya8ogijLhTtaKNcpzpB4TMoTw2Si+8GYKRwFPMMtUT0263QFWFfqyQ==", + "dev": true, + "hasInstallScript": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, "node_modules/core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", @@ -6277,6 +6295,16 @@ "reusify": "^1.0.4" } }, + "node_modules/feather-icons": { + "version": "4.29.0", + "resolved": "https://registry.npmjs.org/feather-icons/-/feather-icons-4.29.0.tgz", + "integrity": "sha512-Y7VqN9FYb8KdaSF0qD1081HCkm0v4Eq/fpfQYQnubpqi0hXx14k+gF9iqtRys1SIcTEi97xDi/fmsPFZ8xo0GQ==", + "dev": true, + "dependencies": { + "classnames": "^2.2.5", + "core-js": "^3.1.3" + } + }, "node_modules/fetch-blob": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", @@ -15253,6 +15281,12 @@ "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", "dev": true }, + "classnames": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz", + "integrity": "sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==", + "dev": true + }, "clean-regexp": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/clean-regexp/-/clean-regexp-1.0.0.tgz", @@ -16002,6 +16036,12 @@ "dev": true, "peer": true }, + "core-js": { + "version": "3.31.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.31.1.tgz", + "integrity": "sha512-2sKLtfq1eFST7l7v62zaqXacPc7uG8ZAya8ogijLhTtaKNcpzpB4TMoTw2Si+8GYKRwFPMMtUT0263QFWFfqyQ==", + "dev": true + }, "core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", @@ -17183,6 +17223,16 @@ "reusify": "^1.0.4" } }, + "feather-icons": { + "version": "4.29.0", + "resolved": "https://registry.npmjs.org/feather-icons/-/feather-icons-4.29.0.tgz", + "integrity": "sha512-Y7VqN9FYb8KdaSF0qD1081HCkm0v4Eq/fpfQYQnubpqi0hXx14k+gF9iqtRys1SIcTEi97xDi/fmsPFZ8xo0GQ==", + "dev": true, + "requires": { + "classnames": "^2.2.5", + "core-js": "^3.1.3" + } + }, "fetch-blob": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", diff --git a/package.json b/package.json index 6fbf66a..36230b1 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ "chart.js": "^4.3.0", "chartjs-plugin-roughness": "^1.0.6", "fast-glob": "^3.2.12", + "feather-icons": "^4.29.0", "lodash-es": "^4.17.21", "parse-unit": "^1.0.1", "release-it": "^15.11.0", diff --git a/src/components.ts b/src/components.ts index f19f130..74f8bb1 100644 --- a/src/components.ts +++ b/src/components.ts @@ -7,6 +7,7 @@ export { default as RDivider } from './divider/index.vue' export { default as RGraphics } from './graphics/index.vue' export { default as RGraphicsConfig } from './graphics/graphics-config.vue' export { default as RGridGuide } from './grid-guide/index.vue' +export { default as RIcon } from './icon/index.vue' export { default as RInput } from './input/index.vue' export { default as RRate } from './rate/index.vue' export { default as RSelect } from './select/index.vue' diff --git a/src/icon/index.vue b/src/icon/index.vue new file mode 100644 index 0000000..87d8033 --- /dev/null +++ b/src/icon/index.vue @@ -0,0 +1,143 @@ + + + + +