Skip to content

Commit

Permalink
feat: add size parameter to makeVueComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
lasseitorp committed Dec 5, 2023
1 parent cfda68e commit 1a06381
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @unionen/icons

## 1.3.0

### Minor Changes

- add size parameter to makeVueComponent

## 1.2.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@unionen/icons",
"version": "1.2.0",
"version": "1.3.0",
"description": "An iconset for FormKit inputs used on unionen.se",
"private": false,
"type": "module",
Expand Down
19 changes: 13 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import * as icons from './icons-single';
export * from './collections';
import { h } from 'vue';
import unionenIcons from './unionenIcons';
/* eslint-disable quotes */
import * as icons from "./icons-single";
export * from "./collections";
import { h } from "vue";
import unionenIcons from "./unionenIcons";

export default icons;
export { icons, unionenIcons };
Expand All @@ -19,7 +20,13 @@ export function singleQuotes(param: string): string {
* @param param - The icon string to wrap
* @public
*/
export function makeVueComponent(param: string) {
return h('span', { innerHTML: singleQuotes(param) });
export function makeVueComponent(
param: string,
size: "sm" | "md" | "lg" | undefined = undefined
) {
return h("span", {
innerHTML: singleQuotes(param),
class: size ? `icon-${size}` : undefined,
});
}

0 comments on commit 1a06381

Please sign in to comment.