@huntflow/ui 0.0.16 → 0.0.18

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/README.md CHANGED
@@ -4,6 +4,11 @@
4
4
  <img alt="" src="https://img.shields.io/npm/dm/@huntflow/ui.svg" />
5
5
  </a>
6
6
 
7
+ <a href="https://deno.bundlejs.com/badge?q=@huntflow/ui@0.0.17&treeshake=[*]" target="\_parent">
8
+ <img alt="" src="https://deno.bundlejs.com/badge?q=@huntflow/ui@0.0.17&treeshake=[*]" />
9
+ </a>
10
+
11
+
7
12
  **@huntflow/ui** — это библиотека компонентов, предназначенная для создания удобных, масштабируемых и согласованных пользовательских интерфейсов. Проект ориентирован на упрощение разработки и поддержания единого стиля интерфейса во всех продуктах компании.
8
13
 
9
14
  ## 🚀 Основные возможности
@@ -21,6 +26,12 @@
21
26
  npm install @huntflow/ui
22
27
  ```
23
28
 
29
+ ## 📚 Storybook
30
+
31
+ ```javascript
32
+ npm run storybook
33
+ ```
34
+
24
35
  ## Пример использования
25
36
  ```javascript
26
37
 
@@ -0,0 +1,31 @@
1
+ import { BaseButtonProps } from './types';
2
+ declare function __VLS_template(): {
3
+ slots: {
4
+ leftIcon?(_: {
5
+ icon: import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
6
+ [key: string]: any;
7
+ }>;
8
+ }): any;
9
+ default?(_: {}): any;
10
+ rightIcon?(_: {
11
+ icon: import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
12
+ [key: string]: any;
13
+ }>;
14
+ }): any;
15
+ };
16
+ refs: {};
17
+ attrs: Partial<{}>;
18
+ };
19
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
20
+ declare const __VLS_component: import('vue').DefineComponent<BaseButtonProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
21
+ click: () => any;
22
+ }, string, import('vue').PublicProps, Readonly<BaseButtonProps> & Readonly<{
23
+ onClick?: (() => any) | undefined;
24
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
25
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
26
+ export default _default;
27
+ type __VLS_WithTemplateSlots<T, S> = T & {
28
+ new (): {
29
+ $slots: S;
30
+ };
31
+ };
@@ -0,0 +1,35 @@
1
+ import { VNode } from 'vue';
2
+ export type BaseButtonProps = {
3
+ size?: ButtonSize;
4
+ className?: string;
5
+ type?: ButtonType;
6
+ leftIcon?: VNode;
7
+ rightIcon?: VNode;
8
+ block?: boolean;
9
+ disabled?: boolean;
10
+ loading?: boolean;
11
+ active?: boolean;
12
+ name?: string;
13
+ circle?: boolean;
14
+ bordered?: boolean;
15
+ htmlType?: ButtonHTMLType;
16
+ };
17
+ export declare enum ButtonSize {
18
+ XS = "xs",
19
+ S = "s",
20
+ M = "m",
21
+ L = "l",
22
+ XL = "xl"
23
+ }
24
+ export declare enum ButtonType {
25
+ PRIMARY = "primary",
26
+ DANGER = "danger",
27
+ DEFAULT = "default",
28
+ TEXT = "text",
29
+ LINK = "link"
30
+ }
31
+ export declare enum ButtonHTMLType {
32
+ SUBMIT = "submit",
33
+ BUTTON = "button",
34
+ RESET = "reset"
35
+ }
@@ -0,0 +1,28 @@
1
+ import { BaseInputProps } from './types.ts';
2
+ declare let __VLS_typeProps: BaseInputProps;
3
+ type __VLS_PublicProps = {
4
+ modelValue?: string;
5
+ } & typeof __VLS_typeProps;
6
+ declare function __VLS_template(): {
7
+ slots: {
8
+ prefix?(_: {}): any;
9
+ suffix?(_: {}): any;
10
+ };
11
+ refs: {};
12
+ attrs: Partial<{}>;
13
+ };
14
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
15
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
16
+ "update:modelValue": (...args: any[]) => void;
17
+ enter: (...args: any[]) => void;
18
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
19
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
20
+ onEnter?: ((...args: any[]) => any) | undefined;
21
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
22
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
23
+ export default _default;
24
+ type __VLS_WithTemplateSlots<T, S> = T & {
25
+ new (): {
26
+ $slots: S;
27
+ };
28
+ };
@@ -0,0 +1,27 @@
1
+ export type BaseInputProps = {
2
+ value: string;
3
+ type?: InputType;
4
+ id?: string;
5
+ name?: string;
6
+ disabled?: boolean;
7
+ label?: string;
8
+ placeholder?: string;
9
+ loading?: boolean;
10
+ error?: string | null | void;
11
+ size?: InputSize;
12
+ className?: string;
13
+ };
14
+ export declare enum InputSize {
15
+ XS = "xs",
16
+ S = "s",
17
+ M = "m",
18
+ L = "l",
19
+ XL = "xl"
20
+ }
21
+ export declare enum InputType {
22
+ TEXT = "text",
23
+ PASSWORD = "password",
24
+ EMAIL = "email",
25
+ TEL = "tel",
26
+ SEARCH = "search"
27
+ }
package/dist/main.d.ts CHANGED
@@ -1 +1,4 @@
1
- export { default as TestButton } from './components/TestButton/TestButton.vue';
1
+ export { default as BaseInput } from './components/input/input.vue';
2
+ export { type BaseInputProps } from './components/input/types.ts';
3
+ export { default as BaseButton } from './components/button/button.vue';
4
+ export { type BaseButtonProps } from './components/button/types.ts';
package/dist/ui.es.js CHANGED
@@ -1,22 +1,201 @@
1
- (function(){"use strict";var n;try{if(typeof document<"u"){var e=document.createElement("style");e.nonce=(n=document.head.querySelector("meta[property=csp-nonce]"))==null?void 0:n.content,e.appendChild(document.createTextNode("#baseButton{padding:1rem 2rem;cursor:pointer;border:none;background-color:var(--02dc2362);font-size:var(--0b00b891)}")),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
- import { defineComponent as n, useCssVars as r, computed as c, openBlock as u, createElementBlock as l, renderSlot as a } from "vue";
3
- const p = { id: "baseButton" }, f = /* @__PURE__ */ n({
4
- __name: "TestButton",
1
+ (function(){"use strict";var r;try{if(typeof document<"u"){var o=document.createElement("style");o.nonce=(r=document.head.querySelector("meta[property=csp-nonce]"))==null?void 0:r.content,o.appendChild(document.createTextNode("._wrapper_hww12_1{display:flex;flex-direction:column}._label_hww12_6{margin-bottom:4px;font-size:14px;color:#333}._container_hww12_12{position:relative;display:flex;align-items:center}._input_hww12_18{flex:1;padding:8px 12px;font-size:14px;border:1px solid #ced4da;border-radius:12px;outline:none;transition:border-color .3s}._xs_hww12_28{padding:4px 8px;font-size:12px}._s_hww12_33{padding:6px 10px;font-size:13px}._m_hww12_38{padding:8px 12px;font-size:14px}._l_hww12_6{padding:10px 14px;font-size:16px}._xl_hww12_48{padding:12px 16px;font-size:18px}input:focus{border-color:#007bff}._disabled_hww12_57{background-color:#e9ecef;cursor:not-allowed}._error_hww12_62{border-color:#dc3545}._error_hww12_62{margin-top:4px;font-size:12px;color:#dc3545}._prefix_hww12_72,._suffix_hww12_73{position:absolute;display:flex;align-items:center;color:#6c757d}._prefix_hww12_72{left:8px}._suffix_hww12_73{right:8px}._loading_hww12_88{cursor:wait}._spinner_hww12_92{position:absolute;right:8px;width:16px;height:16px;border:2px solid rgba(0,0,0,.2);border-top-color:#007bff;border-radius:50%;animation:_spin_hww12_92 .6s linear infinite}@keyframes _spin_hww12_92{to{transform:rotate(360deg)}}._button_den84_1{position:relative;display:inline-flex;align-items:center;font-weight:500;justify-content:center;border:none;border-radius:var(--hf-button-border-radius);cursor:pointer;transition:background-color .3s,box-shadow .3s}._button_den84_1:focus{outline:none}._primary_den84_19{color:var(--hf-button-primary-text-color);border:1px solid var(--hf-button-primary-background-color);background-color:var(--hf-button-primary-background-color)}._primary_den84_19:hover{background-color:var(--hf-button-primary-hover-background-color)}._primary_den84_19:focus{box-shadow:0 0 0 3px var(--hf-button-primary-focus-color)}._primary_den84_19._bordered_den84_34{background-color:#fff;color:var(--hf-button-primary-background-color);border:1px solid var(--hf-button-primary-background-color)}._danger_den84_40{color:var(--hf-button-danger-text-color);background-color:var(--hf-button-danger-background-color)}._danger_den84_40:hover{background-color:var(--hf-button-danger-hover-background-color)}._danger_den84_40:focus{box-shadow:0 0 0 3px var(--hf-button-danger-focus-color)}._danger_den84_40._bordered_den84_34{background-color:#fff;color:var(--hf-button-danger-background-color);border:1px solid var(--hf-button-danger-background-color)}._default_den84_59{background-color:#fff;color:var(--hf-button-default-text-color);border:1px solid var(--hf-button-default-border-color)}._default_den84_59:hover{background-color:var(--hf-button-default-hover-background-color)}._default_den84_59:focus{box-shadow:0 0 0 3px var(--hf-button-default-focus-color)}._text_den84_73{background-color:#fff;color:#000}._link_den84_78{background-color:#fff;color:#007bff;text-decoration:underline}._block_den84_84{width:100%}._disabled_den84_88{background-color:#e9ecef;color:#6c757d;cursor:not-allowed}._loading_den84_94{cursor:wait}._circle_den84_98{border-radius:100%;padding:0!important}._bordered_den84_34{border:1px solid currentColor}._icon_den84_107{display:flex;align-items:center}._iconLeft_den84_112{margin-right:8px}._iconRight_den84_116{margin-left:8px}._xs_den84_120{padding:4px 8px;font-size:12px}._s_den84_125{padding:6px 12px;font-size:14px;line-height:20px}._m_den84_131{padding:6px 12px;font-size:15px;line-height:24px}._l_den84_78{padding:16px 32px;font-size:18px}._xl_den84_142{padding:20px 40px;font-size:20px}._spinner_den84_147{display:inline-block;position:absolute;right:0;left:0;margin:0 auto;width:16px;height:16px;border:2px solid rgba(0,0,0,.2);border-top-color:#007bff;border-radius:50%;animation:_spin_den84_147 .6s linear infinite}@keyframes _spin_den84_147{to{transform:rotate(360deg)}}")),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
+ import { defineComponent as y, mergeModels as w, useModel as I, computed as k, openBlock as r, createElementBlock as i, normalizeClass as l, unref as t, toDisplayString as g, createCommentVNode as d, createElementVNode as h, renderSlot as _, Fragment as B } from "vue";
3
+ const M = "_wrapper_hww12_1", N = "_label_hww12_6", E = "_container_hww12_12", R = "_input_hww12_18", V = "_xs_hww12_28", C = "_s_hww12_33", X = "_m_hww12_38", A = "_l_hww12_6", D = "_xl_hww12_48", F = "_disabled_hww12_57", K = "_error_hww12_62", T = "_prefix_hww12_72", U = "_suffix_hww12_73", G = "_loading_hww12_88", P = "_spinner_hww12_92", Y = "_spin_hww12_92", a = {
4
+ wrapper: M,
5
+ label: N,
6
+ container: E,
7
+ input: R,
8
+ xs: V,
9
+ s: C,
10
+ m: X,
11
+ l: A,
12
+ xl: D,
13
+ disabled: F,
14
+ error: K,
15
+ prefix: T,
16
+ suffix: U,
17
+ loading: G,
18
+ spinner: P,
19
+ spin: Y
20
+ };
21
+ var $ = /* @__PURE__ */ ((e) => (e.XS = "xs", e.S = "s", e.M = "m", e.L = "l", e.XL = "xl", e))($ || {});
22
+ const j = ["for"], q = ["id", "value", "name", "type", "disabled", "placeholder"], ue = /* @__PURE__ */ y({
23
+ name: "BaseInput",
24
+ __name: "input",
25
+ props: /* @__PURE__ */ w({
26
+ value: {},
27
+ type: {},
28
+ id: {},
29
+ name: {},
30
+ disabled: { type: Boolean },
31
+ label: {},
32
+ placeholder: {},
33
+ loading: { type: Boolean },
34
+ error: {},
35
+ size: {},
36
+ className: {}
37
+ }, {
38
+ modelValue: {},
39
+ modelModifiers: {}
40
+ }),
41
+ emits: /* @__PURE__ */ w(["update:modelValue", "enter"], ["update:modelValue"]),
42
+ setup(e, { emit: u }) {
43
+ const n = e, b = I(e, "modelValue"), p = u, c = (s) => {
44
+ const f = s.target;
45
+ p("update:modelValue", f.value);
46
+ }, m = (s) => {
47
+ s.key === "Enter" && p("enter");
48
+ }, L = k(() => [
49
+ a.input,
50
+ a[n.size || $.M],
51
+ {
52
+ [a.disabled]: n.disabled,
53
+ [a.error]: n.error,
54
+ [a.loading]: n.loading
55
+ },
56
+ n.className
57
+ ]);
58
+ return (s, f) => (r(), i("div", {
59
+ class: l(t(a).wrapper)
60
+ }, [
61
+ s.label ? (r(), i("label", {
62
+ key: 0,
63
+ for: s.id,
64
+ class: l(t(a).label)
65
+ }, g(s.label), 11, j)) : d("", !0),
66
+ h("div", {
67
+ class: l(t(a).container)
68
+ }, [
69
+ s.$slots.prefix ? (r(), i("span", {
70
+ key: 0,
71
+ class: l(t(a).prefix)
72
+ }, [
73
+ _(s.$slots, "prefix")
74
+ ], 2)) : d("", !0),
75
+ h("input", {
76
+ id: s.id,
77
+ value: b.value,
78
+ name: s.name,
79
+ type: s.type || "text",
80
+ disabled: s.disabled || s.loading,
81
+ placeholder: s.placeholder,
82
+ class: l(L.value),
83
+ onInput: c,
84
+ onKeydown: m
85
+ }, null, 42, q),
86
+ s.$slots.suffix ? (r(), i("span", {
87
+ key: 1,
88
+ class: l(t(a).suffix)
89
+ }, [
90
+ _(s.$slots, "suffix")
91
+ ], 2)) : d("", !0),
92
+ s.loading ? (r(), i("span", {
93
+ key: 2,
94
+ class: l(t(a).spinner)
95
+ }, null, 2)) : d("", !0)
96
+ ], 2),
97
+ s.error ? (r(), i("p", {
98
+ key: 1,
99
+ class: l(t(a).error)
100
+ }, g(s.error), 3)) : d("", !0)
101
+ ], 2));
102
+ }
103
+ }), H = "_button_den84_1", J = "_primary_den84_19", O = "_bordered_den84_34", Q = "_danger_den84_40", W = "_text_den84_73", Z = "_link_den84_78", S = "_block_den84_84", z = "_disabled_den84_88", ee = "_loading_den84_94", ne = "_circle_den84_98", se = "_icon_den84_107", oe = "_iconLeft_den84_112", le = "_iconRight_den84_116", te = "_xs_den84_120", ae = "_s_den84_125", re = "_m_den84_131", ie = "_l_den84_78", de = "_xl_den84_142", ce = "_spinner_den84_147", _e = "_spin_den84_147", o = {
104
+ button: H,
105
+ primary: J,
106
+ bordered: O,
107
+ danger: Q,
108
+ default: "_default_den84_59",
109
+ text: W,
110
+ link: Z,
111
+ block: S,
112
+ disabled: z,
113
+ loading: ee,
114
+ circle: ne,
115
+ icon: se,
116
+ iconLeft: oe,
117
+ iconRight: le,
118
+ xs: te,
119
+ s: ae,
120
+ m: re,
121
+ l: ie,
122
+ xl: de,
123
+ spinner: ce,
124
+ spin: _e
125
+ };
126
+ var x = /* @__PURE__ */ ((e) => (e.XS = "xs", e.S = "s", e.M = "m", e.L = "l", e.XL = "xl", e))(x || {}), v = /* @__PURE__ */ ((e) => (e.PRIMARY = "primary", e.DANGER = "danger", e.DEFAULT = "default", e.TEXT = "text", e.LINK = "link", e))(v || {});
127
+ const pe = ["name", "type", "disabled"], be = /* @__PURE__ */ y({
128
+ name: "BaseButton",
129
+ __name: "button",
5
130
  props: {
6
- size: { default: 16 },
7
- color: { default: "skyblue" }
131
+ size: {},
132
+ className: {},
133
+ type: {},
134
+ leftIcon: {},
135
+ rightIcon: {},
136
+ block: { type: Boolean },
137
+ disabled: { type: Boolean },
138
+ loading: { type: Boolean },
139
+ active: { type: Boolean },
140
+ name: {},
141
+ circle: { type: Boolean },
142
+ bordered: { type: Boolean },
143
+ htmlType: {}
8
144
  },
9
- setup(t) {
10
- r((e) => ({
11
- "02dc2362": e.color,
12
- "0b00b891": s.value
13
- }));
14
- const o = t, s = c(() => `${o.size}px`);
15
- return (e, d) => (u(), l("button", p, [
16
- a(e.$slots, "default")
17
- ]));
145
+ emits: ["click"],
146
+ setup(e, { emit: u }) {
147
+ const n = e, b = u, p = k(() => [
148
+ o.button,
149
+ o[n.size || x.M],
150
+ o[n.type || v.DEFAULT],
151
+ {
152
+ [o.block]: n.block,
153
+ [o.disabled]: n.disabled || n.loading,
154
+ [o.loading]: n.loading,
155
+ [o.active]: n.active,
156
+ [o.circle]: n.circle,
157
+ [o.bordered]: n.bordered
158
+ },
159
+ n.className
160
+ ]);
161
+ return (c, m) => (r(), i("button", {
162
+ name: n.name,
163
+ class: l(p.value),
164
+ type: n.htmlType,
165
+ disabled: n.disabled || n.loading,
166
+ onClick: m[0] || (m[0] = () => b("click"))
167
+ }, [
168
+ n.loading ? (r(), i("span", {
169
+ key: 0,
170
+ class: l(t(o).spinner)
171
+ }, null, 2)) : (r(), i(B, { key: 1 }, [
172
+ n.leftIcon ? (r(), i("span", {
173
+ key: 0,
174
+ class: l([t(o).icon, t(o).iconLeft])
175
+ }, [
176
+ _(c.$slots, "leftIcon", {
177
+ icon: n.leftIcon
178
+ })
179
+ ], 2)) : d("", !0),
180
+ c.$slots.default ? (r(), i("span", {
181
+ key: 1,
182
+ class: l(t(o).content)
183
+ }, [
184
+ _(c.$slots, "default")
185
+ ], 2)) : d("", !0),
186
+ n.rightIcon ? (r(), i("span", {
187
+ key: 2,
188
+ class: l([t(o).icon, t(o).iconRight])
189
+ }, [
190
+ _(c.$slots, "rightIcon", {
191
+ icon: n.rightIcon
192
+ })
193
+ ], 2)) : d("", !0)
194
+ ], 64))
195
+ ], 10, pe));
18
196
  }
19
197
  });
20
198
  export {
21
- f as TestButton
199
+ be as BaseButton,
200
+ ue as BaseInput
22
201
  };
package/dist/ui.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- (function(){"use strict";var n;try{if(typeof document<"u"){var e=document.createElement("style");e.nonce=(n=document.head.querySelector("meta[property=csp-nonce]"))==null?void 0:n.content,e.appendChild(document.createTextNode("#baseButton{padding:1rem 2rem;cursor:pointer;border:none;background-color:var(--02dc2362);font-size:var(--0b00b891)}")),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
- (function(t,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.ui={},t.Vue))})(this,function(t,e){"use strict";const n={id:"baseButton"},s=e.defineComponent({__name:"TestButton",props:{size:{default:16},color:{default:"skyblue"}},setup(i){e.useCssVars(o=>({"02dc2362":o.color,"0b00b891":d.value}));const u=i,d=e.computed(()=>`${u.size}px`);return(o,c)=>(e.openBlock(),e.createElementBlock("button",n,[e.renderSlot(o.$slots,"default")]))}});t.TestButton=s,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
1
+ (function(a,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(a=typeof globalThis<"u"?globalThis:a||self,e(a.ui={},a.Vue))})(this,function(a,e){"use strict";var p=document.createElement("style");p.textContent=`._wrapper_hww12_1{display:flex;flex-direction:column}._label_hww12_6{margin-bottom:4px;font-size:14px;color:#333}._container_hww12_12{position:relative;display:flex;align-items:center}._input_hww12_18{flex:1;padding:8px 12px;font-size:14px;border:1px solid #ced4da;border-radius:12px;outline:none;transition:border-color .3s}._xs_hww12_28{padding:4px 8px;font-size:12px}._s_hww12_33{padding:6px 10px;font-size:13px}._m_hww12_38{padding:8px 12px;font-size:14px}._l_hww12_6{padding:10px 14px;font-size:16px}._xl_hww12_48{padding:12px 16px;font-size:18px}input:focus{border-color:#007bff}._disabled_hww12_57{background-color:#e9ecef;cursor:not-allowed}._error_hww12_62{border-color:#dc3545}._error_hww12_62{margin-top:4px;font-size:12px;color:#dc3545}._prefix_hww12_72,._suffix_hww12_73{position:absolute;display:flex;align-items:center;color:#6c757d}._prefix_hww12_72{left:8px}._suffix_hww12_73{right:8px}._loading_hww12_88{cursor:wait}._spinner_hww12_92{position:absolute;right:8px;width:16px;height:16px;border:2px solid rgba(0,0,0,.2);border-top-color:#007bff;border-radius:50%;animation:_spin_hww12_92 .6s linear infinite}@keyframes _spin_hww12_92{to{transform:rotate(360deg)}}._button_den84_1{position:relative;display:inline-flex;align-items:center;font-weight:500;justify-content:center;border:none;border-radius:var(--hf-button-border-radius);cursor:pointer;transition:background-color .3s,box-shadow .3s}._button_den84_1:focus{outline:none}._primary_den84_19{color:var(--hf-button-primary-text-color);border:1px solid var(--hf-button-primary-background-color);background-color:var(--hf-button-primary-background-color)}._primary_den84_19:hover{background-color:var(--hf-button-primary-hover-background-color)}._primary_den84_19:focus{box-shadow:0 0 0 3px var(--hf-button-primary-focus-color)}._primary_den84_19._bordered_den84_34{background-color:#fff;color:var(--hf-button-primary-background-color);border:1px solid var(--hf-button-primary-background-color)}._danger_den84_40{color:var(--hf-button-danger-text-color);background-color:var(--hf-button-danger-background-color)}._danger_den84_40:hover{background-color:var(--hf-button-danger-hover-background-color)}._danger_den84_40:focus{box-shadow:0 0 0 3px var(--hf-button-danger-focus-color)}._danger_den84_40._bordered_den84_34{background-color:#fff;color:var(--hf-button-danger-background-color);border:1px solid var(--hf-button-danger-background-color)}._default_den84_59{background-color:#fff;color:var(--hf-button-default-text-color);border:1px solid var(--hf-button-default-border-color)}._default_den84_59:hover{background-color:var(--hf-button-default-hover-background-color)}._default_den84_59:focus{box-shadow:0 0 0 3px var(--hf-button-default-focus-color)}._text_den84_73{background-color:#fff;color:#000}._link_den84_78{background-color:#fff;color:#007bff;text-decoration:underline}._block_den84_84{width:100%}._disabled_den84_88{background-color:#e9ecef;color:#6c757d;cursor:not-allowed}._loading_den84_94{cursor:wait}._circle_den84_98{border-radius:100%;padding:0!important}._bordered_den84_34{border:1px solid currentColor}._icon_den84_107{display:flex;align-items:center}._iconLeft_den84_112{margin-right:8px}._iconRight_den84_116{margin-left:8px}._xs_den84_120{padding:4px 8px;font-size:12px}._s_den84_125{padding:6px 12px;font-size:14px;line-height:20px}._m_den84_131{padding:6px 12px;font-size:15px;line-height:24px}._l_den84_78{padding:16px 32px;font-size:18px}._xl_den84_142{padding:20px 40px;font-size:20px}._spinner_den84_147{display:inline-block;position:absolute;right:0;left:0;margin:0 auto;width:16px;height:16px;border:2px solid rgba(0,0,0,.2);border-top-color:#007bff;border-radius:50%;animation:_spin_den84_147 .6s linear infinite}@keyframes _spin_den84_147{to{transform:rotate(360deg)}}
2
+ /*$vite$:1*/`,document.head.appendChild(p);const l={wrapper:"_wrapper_hww12_1",label:"_label_hww12_6",container:"_container_hww12_12",input:"_input_hww12_18",xs:"_xs_hww12_28",s:"_s_hww12_33",m:"_m_hww12_38",l:"_l_hww12_6",xl:"_xl_hww12_48",disabled:"_disabled_hww12_57",error:"_error_hww12_62",prefix:"_prefix_hww12_72",suffix:"_suffix_hww12_73",loading:"_loading_hww12_88",spinner:"_spinner_hww12_92",spin:"_spin_hww12_92"};var f=(o=>(o.XS="xs",o.S="s",o.M="m",o.L="l",o.XL="xl",o))(f||{});const x=["for"],h=["id","value","name","type","disabled","placeholder"],u=e.defineComponent({name:"BaseInput",__name:"input",props:e.mergeModels({value:{},type:{},id:{},name:{},disabled:{type:Boolean},label:{},placeholder:{},loading:{type:Boolean},error:{},size:{},className:{}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["update:modelValue","enter"],["update:modelValue"]),setup(o,{emit:c}){const n=o,_=e.useModel(o,"modelValue"),d=c,i=r=>{const g=r.target;d("update:modelValue",g.value)},s=r=>{r.key==="Enter"&&d("enter")},y=e.computed(()=>[l.input,l[n.size||f.M],{[l.disabled]:n.disabled,[l.error]:n.error,[l.loading]:n.loading},n.className]);return(r,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(l).wrapper)},[r.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:r.id,class:e.normalizeClass(e.unref(l).label)},e.toDisplayString(r.label),11,x)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(l).container)},[r.$slots.prefix?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(l).prefix)},[e.renderSlot(r.$slots,"prefix")],2)):e.createCommentVNode("",!0),e.createElementVNode("input",{id:r.id,value:_.value,name:r.name,type:r.type||"text",disabled:r.disabled||r.loading,placeholder:r.placeholder,class:e.normalizeClass(y.value),onInput:i,onKeydown:s},null,42,h),r.$slots.suffix?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(l).suffix)},[e.renderSlot(r.$slots,"suffix")],2)):e.createCommentVNode("",!0),r.loading?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(e.unref(l).spinner)},null,2)):e.createCommentVNode("",!0)],2),r.error?(e.openBlock(),e.createElementBlock("p",{key:1,class:e.normalizeClass(e.unref(l).error)},e.toDisplayString(r.error),3)):e.createCommentVNode("",!0)],2))}}),t={button:"_button_den84_1",primary:"_primary_den84_19",bordered:"_bordered_den84_34",danger:"_danger_den84_40",default:"_default_den84_59",text:"_text_den84_73",link:"_link_den84_78",block:"_block_den84_84",disabled:"_disabled_den84_88",loading:"_loading_den84_94",circle:"_circle_den84_98",icon:"_icon_den84_107",iconLeft:"_iconLeft_den84_112",iconRight:"_iconRight_den84_116",xs:"_xs_den84_120",s:"_s_den84_125",m:"_m_den84_131",l:"_l_den84_78",xl:"_xl_den84_142",spinner:"_spinner_den84_147",spin:"_spin_den84_147"};var b=(o=>(o.XS="xs",o.S="s",o.M="m",o.L="l",o.XL="xl",o))(b||{}),m=(o=>(o.PRIMARY="primary",o.DANGER="danger",o.DEFAULT="default",o.TEXT="text",o.LINK="link",o))(m||{});const w=["name","type","disabled"],k=e.defineComponent({name:"BaseButton",__name:"button",props:{size:{},className:{},type:{},leftIcon:{},rightIcon:{},block:{type:Boolean},disabled:{type:Boolean},loading:{type:Boolean},active:{type:Boolean},name:{},circle:{type:Boolean},bordered:{type:Boolean},htmlType:{}},emits:["click"],setup(o,{emit:c}){const n=o,_=c,d=e.computed(()=>[t.button,t[n.size||b.M],t[n.type||m.DEFAULT],{[t.block]:n.block,[t.disabled]:n.disabled||n.loading,[t.loading]:n.loading,[t.active]:n.active,[t.circle]:n.circle,[t.bordered]:n.bordered},n.className]);return(i,s)=>(e.openBlock(),e.createElementBlock("button",{name:n.name,class:e.normalizeClass(d.value),type:n.htmlType,disabled:n.disabled||n.loading,onClick:s[0]||(s[0]=()=>_("click"))},[n.loading?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(t).spinner)},null,2)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n.leftIcon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass([e.unref(t).icon,e.unref(t).iconLeft])},[e.renderSlot(i.$slots,"leftIcon",{icon:n.leftIcon})],2)):e.createCommentVNode("",!0),i.$slots.default?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(t).content)},[e.renderSlot(i.$slots,"default")],2)):e.createCommentVNode("",!0),n.rightIcon?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass([e.unref(t).icon,e.unref(t).iconRight])},[e.renderSlot(i.$slots,"rightIcon",{icon:n.rightIcon})],2)):e.createCommentVNode("",!0)],64))],10,w))}});a.BaseButton=k,a.BaseInput=u,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@huntflow/ui",
3
3
  "description": "HuntFlow UiKit, icons, utils library",
4
4
  "private": false,
5
- "version": "0.0.16",
5
+ "version": "0.0.18",
6
6
  "author": {
7
7
  "name": "HuntFlow Developer",
8
8
  "nickname": "developer",
@@ -12,7 +12,10 @@
12
12
  "scripts": {
13
13
  "dev": "vite",
14
14
  "build": "vue-tsc -b && vite build",
15
- "preview": "vite preview"
15
+ "preview": "vite preview",
16
+ "storybook": "storybook dev -p 6006",
17
+ "build-storybook": "storybook build",
18
+ "lint": "eslint './src/**/*.{js,vue,ts}' --quiet"
16
19
  },
17
20
  "publishConfig": {
18
21
  "access": "public"
@@ -51,12 +54,41 @@
51
54
  "vue": "^3.5.13"
52
55
  },
53
56
  "devDependencies": {
57
+ "@chromatic-com/storybook": "^3.2.2",
58
+ "@eslint/js": "^9.17.0",
59
+ "@storybook/addon-essentials": "^8.4.7",
60
+ "@storybook/addon-interactions": "^8.4.7",
61
+ "@storybook/addon-onboarding": "^8.4.7",
62
+ "@storybook/blocks": "^8.4.7",
63
+ "@storybook/test": "^8.4.7",
64
+ "@storybook/vue3": "^8.4.7",
65
+ "@storybook/vue3-vite": "^8.4.7",
66
+ "@types/eslint": "^9.6.1",
54
67
  "@types/node": "^22.10.1",
68
+ "@typescript-eslint/eslint-plugin": "^8.18.1",
69
+ "@typescript-eslint/parser": "^8.18.1",
55
70
  "@vitejs/plugin-vue": "^5.1.4",
71
+ "@vue/eslint-config-typescript": "^14.1.4",
72
+ "autoprefixer": "^10.4.20",
73
+ "css-has-pseudo": "^7.0.2",
74
+ "eslint": "^9.17.0",
75
+ "eslint-config-prettier": "^9.1.0",
76
+ "eslint-plugin-jest": "^28.9.0",
77
+ "eslint-plugin-prettier": "^5.2.1",
78
+ "eslint-plugin-vue": "^9.32.0",
79
+ "postcss": "^8.4.49",
80
+ "postcss-loader": "^8.1.1",
81
+ "postcss-nesting": "^13.0.1",
82
+ "prettier": "^3.4.2",
83
+ "storybook": "^8.4.7",
84
+ "stylelint": "^16.12.0",
85
+ "stylelint-config-recommended": "^14.0.1",
56
86
  "typescript": "~5.6.2",
87
+ "typescript-eslint": "^8.18.1",
57
88
  "vite": "^5.4.10",
58
89
  "vite-plugin-css-injected-by-js": "^3.5.2",
59
90
  "vite-plugin-dts": "^4.3.0",
91
+ "vite-plugin-eslint2": "^5.0.3",
60
92
  "vue-tsc": "^2.1.8"
61
93
  }
62
94
  }
@@ -1,23 +0,0 @@
1
- type TestButtonProps = {
2
- size?: number;
3
- color?: string;
4
- };
5
- declare function __VLS_template(): {
6
- slots: {
7
- default?(_: {}): any;
8
- };
9
- refs: {};
10
- attrs: Partial<{}>;
11
- };
12
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
13
- declare const __VLS_component: import('vue').DefineComponent<TestButtonProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<TestButtonProps> & Readonly<{}>, {
14
- size: number;
15
- color: string;
16
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
17
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
18
- export default _default;
19
- type __VLS_WithTemplateSlots<T, S> = T & {
20
- new (): {
21
- $slots: S;
22
- };
23
- };