@staskozin/ui-kit 1.1.0 → 1.2.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/dist/index.css CHANGED
@@ -1 +1 @@
1
- .UiButton{font-family:inherit;display:flex;column-gap:.5em}.UiButton.--size-small{font-size:1rem;line-height:1.5em;padding:.375em .625em .375em .5em}.UiButton.--size-medium,.UiButton.--size-large{font-size:1rem}
1
+ .UiIcon.--size-small{width:1rem;height:1rem}.UiIcon.--size-medium{width:1.25rem;height:1.25rem}.UiButton{font-family:inherit;display:flex;column-gap:.5em;border:none;border-radius:.25em}.UiButton.--size-small{font-size:.875rem;line-height:1.5em;padding:.375em .625em .375em .5em;column-gap:.25em}.UiButton.--size-medium{font-size:1rem;line-height:1.5em;padding:.5em 1.25em}.UiButton.--size-medium.--has-icon{padding:.5em .75em}.UiButton.--size-medium.--has-icon:not(.--has-label){padding:.625em}.UiButton.--size-large{font-size:1rem;line-height:1.25em;padding:.75em 1.5em}
package/dist/index.d.ts CHANGED
@@ -7,8 +7,8 @@ export declare const UiButton: DefineComponent<UiButtonProps, {}, {}, {}, {}, Co
7
7
 
8
8
  declare type UiButtonProps = {
9
9
  label?: string;
10
- icon?: string;
11
- size: UiElementSize;
10
+ icon?: 'calendar';
11
+ size?: UiElementSize;
12
12
  };
13
13
 
14
14
  declare type UiElementSize = 'small' | 'medium' | 'large';
package/dist/index.js CHANGED
@@ -1,5 +1,23 @@
1
- import { defineComponent as n, computed as o, openBlock as s, createElementBlock as i, normalizeClass as a, toDisplayString as l } from "vue";
2
- const m = /* @__PURE__ */ n({
1
+ import { defineComponent as s, computed as t, openBlock as o, createElementBlock as c, unref as a, normalizeClass as l, createBlock as u, createCommentVNode as m, createTextVNode as d, toDisplayString as h } from "vue";
2
+ const v = {
3
+ calendar: '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M15.83 3.33H4.17c-.92 0-1.67.75-1.67 1.67v11.67c0 .92.75 1.66 1.67 1.66h11.66c.92 0 1.67-.74 1.67-1.66V5c0-.92-.75-1.67-1.67-1.67m-2.5-1.66V5M6.67 1.67V5M2.5 8.33h15" stroke="currentColor" stroke-width="1.67" stroke-linecap="round" stroke-linejoin="round"/></svg>',
4
+ paperclip: '<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="m17.8666 9.2084-7.6584 7.6583a5.0026 5.0026 0 0 1-8.5402-3.5375c0-1.3268.527-2.5993 1.4653-3.5375l7.6583-7.6583A3.3352 3.3352 0 1 1 15.5082 6.85l-7.6666 7.6583a1.6674 1.6674 0 0 1-2.8468-1.1791c0-.4423.1757-.8665.4885-1.1792l7.0749-7.0666" stroke="currentColor" stroke-width="1.6667" stroke-linecap="round" stroke-linejoin="round"/></svg>'
5
+ }, k = ["innerHTML"], w = /* @__PURE__ */ s({
6
+ __name: "UiIcon",
7
+ props: {
8
+ name: {},
9
+ size: { default: "medium" }
10
+ },
11
+ setup(e) {
12
+ const n = t(() => [
13
+ `--size-${e.size}`
14
+ ]);
15
+ return (i, r) => (o(), c("div", {
16
+ class: l([n.value, "UiIcon"]),
17
+ innerHTML: a(v)[e.name]
18
+ }, null, 10, k));
19
+ }
20
+ }), f = /* @__PURE__ */ s({
3
21
  __name: "UiButton",
4
22
  props: {
5
23
  label: {},
@@ -7,14 +25,23 @@ const m = /* @__PURE__ */ n({
7
25
  size: { default: "medium" }
8
26
  },
9
27
  setup(e) {
10
- const t = o(() => [
11
- `--size-${e.size}`
12
- ]);
13
- return (c, r) => (s(), i("button", {
14
- class: a([t.value, "UiButton"])
15
- }, l(e.label), 3));
28
+ const n = t(() => [
29
+ `--size-${e.size}`,
30
+ ...e.icon ? ["--has-icon"] : [],
31
+ ...e.label ? ["--has-label"] : []
32
+ ]), i = t(() => e.size !== "large" ? e.size : "medium");
33
+ return (r, z) => (o(), c("button", {
34
+ class: l([n.value, "UiButton"])
35
+ }, [
36
+ e.icon ? (o(), u(w, {
37
+ key: 0,
38
+ name: e.icon,
39
+ size: i.value
40
+ }, null, 8, ["name", "size"])) : m("", !0),
41
+ d(" " + h(e.label), 1)
42
+ ], 2));
16
43
  }
17
44
  });
18
45
  export {
19
- m as UiButton
46
+ f as UiButton
20
47
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staskozin/ui-kit",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -30,7 +30,6 @@
30
30
  "prepare": "husky"
31
31
  },
32
32
  "devDependencies": {
33
- "@chromatic-com/storybook": "^5.0.1",
34
33
  "@commitlint/cli": "^20.4.2",
35
34
  "@commitlint/config-conventional": "^20.4.2",
36
35
  "@semantic-release/changelog": "^6.0.3",