@huntflow/ui 0.0.35 → 0.0.37

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.
@@ -0,0 +1,53 @@
1
+ import { BaseButtonSize, BaseButtonType, BaseButtonHTMLType } from './types';
2
+ declare const _default: import('vue').DefineComponent<{
3
+ size?: BaseButtonSize | undefined;
4
+ className?: string | undefined;
5
+ type?: BaseButtonType | undefined;
6
+ leftIcon?: import('vue').VNode | undefined;
7
+ rightIcon?: import('vue').VNode | undefined;
8
+ block?: boolean | undefined;
9
+ disabled?: boolean | undefined;
10
+ loading?: boolean | undefined;
11
+ active?: boolean | undefined;
12
+ name?: string | undefined;
13
+ circle?: boolean | undefined;
14
+ bordered?: boolean | undefined;
15
+ htmlType?: BaseButtonHTMLType | undefined;
16
+ }, {
17
+ classList: import('vue').ComputedRef<(string | {
18
+ [x: string]: boolean | undefined;
19
+ } | undefined)[]>;
20
+ handleClick: () => void;
21
+ styles: CSSModuleClasses;
22
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "click"[], "click", import('vue').PublicProps, Readonly<{
23
+ size?: BaseButtonSize | undefined;
24
+ className?: string | undefined;
25
+ type?: BaseButtonType | undefined;
26
+ leftIcon?: import('vue').VNode | undefined;
27
+ rightIcon?: import('vue').VNode | undefined;
28
+ block?: boolean | undefined;
29
+ disabled?: boolean | undefined;
30
+ loading?: boolean | undefined;
31
+ active?: boolean | undefined;
32
+ name?: string | undefined;
33
+ circle?: boolean | undefined;
34
+ bordered?: boolean | undefined;
35
+ htmlType?: BaseButtonHTMLType | undefined;
36
+ }> & Readonly<{
37
+ onClick?: ((...args: any[]) => any) | undefined;
38
+ }>, {
39
+ name: string;
40
+ type: BaseButtonType;
41
+ size: BaseButtonSize;
42
+ className: string;
43
+ leftIcon: Record<string, any>;
44
+ rightIcon: Record<string, any>;
45
+ block: boolean;
46
+ disabled: boolean;
47
+ loading: boolean;
48
+ active: boolean;
49
+ circle: boolean;
50
+ bordered: boolean;
51
+ htmlType: BaseButtonHTMLType;
52
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
53
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import { default as BaseButton } from './button.vue';
2
+ export { BaseButton };
@@ -0,0 +1,2 @@
1
+ import { default as BaseInput } from './input.vue';
2
+ export { BaseInput };
@@ -0,0 +1,48 @@
1
+ import { BaseInputSize, BaseInputType } from './types.ts';
2
+ declare const _default: import('vue').DefineComponent<{
3
+ value: string;
4
+ type?: BaseInputType | undefined;
5
+ id?: string | undefined;
6
+ name?: string | undefined;
7
+ disabled?: boolean | undefined;
8
+ label?: string | undefined;
9
+ placeholder?: string | undefined;
10
+ loading?: boolean | undefined;
11
+ error?: string | null | void;
12
+ size?: BaseInputSize | undefined;
13
+ className?: string | undefined;
14
+ }, {
15
+ styles: CSSModuleClasses;
16
+ onInput: () => void;
17
+ onKeydown: (event: KeyboardEvent) => void;
18
+ inputClass: import('vue').ComputedRef<(string | {
19
+ [x: string]: string | boolean | void | null;
20
+ } | undefined)[]>;
21
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("update:value" | "enter")[], "update:value" | "enter", import('vue').PublicProps, Readonly<{
22
+ value: string;
23
+ type?: BaseInputType | undefined;
24
+ id?: string | undefined;
25
+ name?: string | undefined;
26
+ disabled?: boolean | undefined;
27
+ label?: string | undefined;
28
+ placeholder?: string | undefined;
29
+ loading?: boolean | undefined;
30
+ error?: string | null | void;
31
+ size?: BaseInputSize | undefined;
32
+ className?: string | undefined;
33
+ }> & Readonly<{
34
+ "onUpdate:value"?: ((...args: any[]) => any) | undefined;
35
+ onEnter?: ((...args: any[]) => any) | undefined;
36
+ }>, {
37
+ name: string;
38
+ type: BaseInputType;
39
+ size: BaseInputSize;
40
+ className: string;
41
+ disabled: boolean;
42
+ loading: boolean;
43
+ label: string;
44
+ id: string;
45
+ placeholder: string;
46
+ error: string;
47
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
48
+ export default _default;
@@ -1,6 +1,6 @@
1
1
  export type BaseInputProps = {
2
2
  value: string;
3
- type?: InputType;
3
+ type?: BaseInputType;
4
4
  id?: string;
5
5
  name?: string;
6
6
  disabled?: boolean;
@@ -8,17 +8,17 @@ export type BaseInputProps = {
8
8
  placeholder?: string;
9
9
  loading?: boolean;
10
10
  error?: string | null | void;
11
- size?: InputSize;
11
+ size?: BaseInputSize;
12
12
  className?: string;
13
13
  };
14
- export declare enum InputSize {
14
+ export declare enum BaseInputSize {
15
15
  XS = "xs",
16
16
  S = "s",
17
17
  M = "m",
18
18
  L = "l",
19
19
  XL = "xl"
20
20
  }
21
- export declare enum InputType {
21
+ export declare enum BaseInputType {
22
22
  TEXT = "text",
23
23
  PASSWORD = "password",
24
24
  EMAIL = "email",
@@ -1,2 +1,2 @@
1
- export { default as BaseButton } from './button';
2
- export type { BaseButtonProps } from './button';
1
+ export { BaseButton } from './base-button';
2
+ export { BaseInput } from './base-input';
package/dist/ui.es.js CHANGED
@@ -1,100 +1,296 @@
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("._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(n){console.error("vite-plugin-css-injected-by-js",n)}})();
2
- import { defineComponent as k, computed as u, openBlock as t, createElementBlock as s, normalizeClass as l, unref as c, Fragment as y, renderSlot as d, createCommentVNode as r } from "vue";
3
- const f = "_button_den84_1", h = "_primary_den84_19", x = "_bordered_den84_34", I = "_danger_den84_40", L = "_text_den84_73", R = "_link_den84_78", v = "_block_den84_84", E = "_disabled_den84_88", N = "_loading_den84_94", A = "_circle_den84_98", C = "_icon_den84_107", $ = "_iconLeft_den84_112", D = "_iconRight_den84_116", F = "_xs_den84_120", M = "_s_den84_125", X = "_m_den84_131", T = "_l_den84_78", U = "_xl_den84_142", G = "_spinner_den84_147", K = "_spin_den84_147", o = {
4
- button: f,
5
- primary: h,
6
- bordered: x,
7
- danger: I,
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("._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)}}._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)}}")),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
+ import { defineComponent as w, computed as h, openBlock as l, createElementBlock as t, normalizeClass as s, Fragment as S, renderSlot as f, createCommentVNode as r, toDisplayString as g, createElementVNode as m } from "vue";
3
+ const E = "_button_den84_1", L = "_primary_den84_19", q = "_bordered_den84_34", C = "_danger_den84_40", I = "_text_den84_73", N = "_link_den84_78", R = "_block_den84_84", A = "_disabled_den84_88", M = "_loading_den84_94", X = "_circle_den84_98", D = "_icon_den84_107", O = "_iconLeft_den84_112", T = "_iconRight_den84_116", U = "_xs_den84_120", K = "_s_den84_125", F = "_m_den84_131", j = "_l_den84_78", P = "_xl_den84_142", V = "_spinner_den84_147", G = "_spin_den84_147", o = {
4
+ button: E,
5
+ primary: L,
6
+ bordered: q,
7
+ danger: C,
8
8
  default: "_default_den84_59",
9
- text: L,
10
- link: R,
11
- block: v,
12
- disabled: E,
13
- loading: N,
14
- circle: A,
15
- icon: C,
16
- iconLeft: $,
17
- iconRight: D,
18
- xs: F,
19
- s: M,
20
- m: X,
21
- l: T,
22
- xl: U,
23
- spinner: G,
24
- spin: K
9
+ text: I,
10
+ link: N,
11
+ block: R,
12
+ disabled: A,
13
+ loading: M,
14
+ circle: X,
15
+ icon: D,
16
+ iconLeft: O,
17
+ iconRight: T,
18
+ xs: U,
19
+ s: K,
20
+ m: F,
21
+ l: j,
22
+ xl: P,
23
+ spinner: V,
24
+ spin: G
25
25
  };
26
- var a = /* @__PURE__ */ ((e) => (e.XS = "xs", e.S = "s", e.M = "m", e.L = "l", e.XL = "xl", e))(a || {}), p = /* @__PURE__ */ ((e) => (e.PRIMARY = "primary", e.DANGER = "danger", e.DEFAULT = "default", e.TEXT = "text", e.LINK = "link", e))(p || {});
27
- const P = ["name", "type", "disabled"], Y = /* @__PURE__ */ k({
26
+ var p = /* @__PURE__ */ ((e) => (e.XS = "xs", e.S = "s", e.M = "m", e.L = "l", e.XL = "xl", e))(p || {}), y = /* @__PURE__ */ ((e) => (e.PRIMARY = "primary", e.DANGER = "danger", e.DEFAULT = "default", e.TEXT = "text", e.LINK = "link", e))(y || {}), k = /* @__PURE__ */ ((e) => (e.SUBMIT = "submit", e.BUTTON = "button", e.RESET = "reset", e))(k || {});
27
+ const W = w({
28
28
  name: "BaseButton",
29
- __name: "button",
30
29
  props: {
31
- size: {},
32
- className: {},
33
- type: {},
34
- leftIcon: {},
35
- rightIcon: {},
36
- block: { type: Boolean },
37
- disabled: { type: Boolean },
38
- loading: { type: Boolean },
39
- active: { type: Boolean },
40
- name: {},
41
- circle: { type: Boolean },
42
- bordered: { type: Boolean },
43
- htmlType: {}
30
+ name: {
31
+ type: String,
32
+ required: !1,
33
+ default: void 0
34
+ },
35
+ size: {
36
+ type: String,
37
+ default: p.M
38
+ },
39
+ className: {
40
+ type: String,
41
+ required: !1,
42
+ default: void 0
43
+ },
44
+ type: {
45
+ type: String,
46
+ default: y.DEFAULT
47
+ },
48
+ leftIcon: {
49
+ type: Object,
50
+ required: !1,
51
+ default: void 0
52
+ },
53
+ rightIcon: {
54
+ type: Object,
55
+ required: !1,
56
+ default: void 0
57
+ },
58
+ block: {
59
+ type: Boolean,
60
+ default: !1
61
+ },
62
+ disabled: {
63
+ type: Boolean,
64
+ default: !1
65
+ },
66
+ loading: {
67
+ type: Boolean,
68
+ default: !1
69
+ },
70
+ active: {
71
+ type: Boolean,
72
+ default: !1
73
+ },
74
+ circle: {
75
+ type: Boolean,
76
+ default: !1
77
+ },
78
+ bordered: {
79
+ type: Boolean,
80
+ default: !1
81
+ },
82
+ htmlType: {
83
+ type: String,
84
+ default: k.BUTTON
85
+ }
44
86
  },
45
87
  emits: ["click"],
46
- setup(e, { emit: m }) {
47
- const n = e, b = m, g = u(() => [
48
- o.button,
49
- o[n.size || a.M],
50
- o[n.type || p.DEFAULT],
88
+ setup(e, { emit: n }) {
89
+ return {
90
+ classList: h(() => [
91
+ o.button,
92
+ o[e.size || p.M],
93
+ o[e.type || y.DEFAULT],
94
+ {
95
+ [o.block]: e.block,
96
+ [o.disabled]: e.disabled || e.loading,
97
+ [o.loading]: e.loading,
98
+ [o.active]: e.active,
99
+ [o.circle]: e.circle,
100
+ [o.bordered]: e.bordered
101
+ },
102
+ e.className
103
+ ]),
104
+ handleClick: () => {
105
+ n("click");
106
+ },
107
+ styles: o
108
+ };
109
+ }
110
+ }), $ = (e, n) => {
111
+ const a = e.__vccOpts || e;
112
+ for (const [i, c] of n)
113
+ a[i] = c;
114
+ return a;
115
+ }, Y = ["name", "type", "disabled"];
116
+ function J(e, n, a, i, c, _) {
117
+ return l(), t("button", {
118
+ name: e.name,
119
+ class: s(e.classList),
120
+ type: e.htmlType,
121
+ disabled: e.disabled || e.loading,
122
+ onClick: n[0] || (n[0] = (...u) => e.handleClick && e.handleClick(...u))
123
+ }, [
124
+ e.loading ? (l(), t("span", {
125
+ key: 0,
126
+ class: s(e.styles.spinner)
127
+ }, null, 2)) : (l(), t(S, { key: 1 }, [
128
+ e.leftIcon ? (l(), t("span", {
129
+ key: 0,
130
+ class: s([e.styles.icon, e.styles.iconLeft])
131
+ }, [
132
+ f(e.$slots, "leftIcon", { icon: e.leftIcon })
133
+ ], 2)) : r("", !0),
134
+ e.$slots.default ? (l(), t("span", {
135
+ key: 1,
136
+ class: s(e.styles.content)
137
+ }, [
138
+ f(e.$slots, "default")
139
+ ], 2)) : r("", !0),
140
+ e.rightIcon ? (l(), t("span", {
141
+ key: 2,
142
+ class: s([e.styles.icon, e.styles.iconRight])
143
+ }, [
144
+ f(e.$slots, "rightIcon", { icon: e.rightIcon })
145
+ ], 2)) : r("", !0)
146
+ ], 64))
147
+ ], 10, Y);
148
+ }
149
+ const ye = /* @__PURE__ */ $(W, [["render", J]]), Q = "_wrapper_hww12_1", Z = "_label_hww12_6", H = "_container_hww12_12", z = "_input_hww12_18", B = "_xs_hww12_28", x = "_s_hww12_33", ee = "_m_hww12_38", ne = "_l_hww12_6", se = "_xl_hww12_48", le = "_disabled_hww12_57", te = "_error_hww12_62", oe = "_prefix_hww12_72", re = "_suffix_hww12_73", ae = "_loading_hww12_88", ie = "_spinner_hww12_92", de = "_spin_hww12_92", d = {
150
+ wrapper: Q,
151
+ label: Z,
152
+ container: H,
153
+ input: z,
154
+ xs: B,
155
+ s: x,
156
+ m: ee,
157
+ l: ne,
158
+ xl: se,
159
+ disabled: le,
160
+ error: te,
161
+ prefix: oe,
162
+ suffix: re,
163
+ loading: ae,
164
+ spinner: ie,
165
+ spin: de
166
+ };
167
+ var b = /* @__PURE__ */ ((e) => (e.XS = "xs", e.S = "s", e.M = "m", e.L = "l", e.XL = "xl", e))(b || {}), v = /* @__PURE__ */ ((e) => (e.TEXT = "text", e.PASSWORD = "password", e.EMAIL = "email", e.TEL = "tel", e.SEARCH = "search", e))(v || {});
168
+ const ce = w({
169
+ name: "BaseInput",
170
+ props: {
171
+ value: {
172
+ type: String,
173
+ required: !0
174
+ },
175
+ type: {
176
+ type: String,
177
+ default: v.TEXT
178
+ },
179
+ id: {
180
+ type: String,
181
+ required: !1,
182
+ default: void 0
183
+ },
184
+ name: {
185
+ type: String,
186
+ required: !1,
187
+ default: void 0
188
+ },
189
+ disabled: {
190
+ type: Boolean,
191
+ default: !1
192
+ },
193
+ label: {
194
+ type: String,
195
+ required: !1,
196
+ default: void 0
197
+ },
198
+ placeholder: {
199
+ type: String,
200
+ required: !1,
201
+ default: void 0
202
+ },
203
+ loading: {
204
+ type: Boolean,
205
+ default: !1
206
+ },
207
+ error: {
208
+ type: String,
209
+ required: !1,
210
+ default: void 0
211
+ },
212
+ size: {
213
+ type: String,
214
+ default: b.M
215
+ },
216
+ className: {
217
+ type: String,
218
+ required: !1,
219
+ default: void 0
220
+ }
221
+ },
222
+ emits: ["update:value", "enter"],
223
+ setup(e, { emit: n }) {
224
+ const a = () => {
225
+ n("update:value");
226
+ }, i = (_) => {
227
+ _.key === "Enter" && n("enter");
228
+ }, c = h(() => [
229
+ d.input,
230
+ d[e.size || b.M],
51
231
  {
52
- [o.block]: n.block,
53
- [o.disabled]: n.disabled || n.loading,
54
- [o.loading]: n.loading,
55
- [o.active]: n.active,
56
- [o.circle]: n.circle,
57
- [o.bordered]: n.bordered
232
+ [d.disabled]: e.disabled,
233
+ [d.error]: e.error,
234
+ [d.loading]: e.loading
58
235
  },
59
- n.className
236
+ e.className
60
237
  ]);
61
- return (i, _) => (t(), s("button", {
62
- name: n.name,
63
- class: l(g.value),
64
- type: n.htmlType,
65
- disabled: n.disabled || n.loading,
66
- onClick: _[0] || (_[0] = () => b("click"))
238
+ return {
239
+ styles: d,
240
+ onInput: a,
241
+ onKeydown: i,
242
+ inputClass: c
243
+ };
244
+ }
245
+ }), ue = ["for"], fe = ["id", "value", "name", "type", "disabled", "placeholder"];
246
+ function _e(e, n, a, i, c, _) {
247
+ return l(), t("div", {
248
+ class: s(e.styles.wrapper)
249
+ }, [
250
+ e.label ? (l(), t("label", {
251
+ key: 0,
252
+ for: e.id,
253
+ class: s(e.styles.label)
254
+ }, g(e.label), 11, ue)) : r("", !0),
255
+ m("div", {
256
+ class: s(e.styles.container)
67
257
  }, [
68
- n.loading ? (t(), s("span", {
258
+ e.$slots.prefix ? (l(), t("span", {
69
259
  key: 0,
70
- class: l(c(o).spinner)
71
- }, null, 2)) : (t(), s(y, { key: 1 }, [
72
- n.leftIcon ? (t(), s("span", {
73
- key: 0,
74
- class: l([c(o).icon, c(o).iconLeft])
75
- }, [
76
- d(i.$slots, "leftIcon", {
77
- icon: n.leftIcon
78
- })
79
- ], 2)) : r("", !0),
80
- i.$slots.default ? (t(), s("span", {
81
- key: 1,
82
- class: l(c(o).content)
83
- }, [
84
- d(i.$slots, "default")
85
- ], 2)) : r("", !0),
86
- n.rightIcon ? (t(), s("span", {
87
- key: 2,
88
- class: l([c(o).icon, c(o).iconRight])
89
- }, [
90
- d(i.$slots, "rightIcon", {
91
- icon: n.rightIcon
92
- })
93
- ], 2)) : r("", !0)
94
- ], 64))
95
- ], 10, P));
96
- }
97
- });
260
+ class: s(e.styles.prefix)
261
+ }, [
262
+ f(e.$slots, "prefix")
263
+ ], 2)) : r("", !0),
264
+ m("input", {
265
+ id: e.id,
266
+ value: e.value,
267
+ name: e.name,
268
+ type: e.type || "text",
269
+ disabled: e.disabled || e.loading,
270
+ placeholder: e.placeholder,
271
+ class: s(e.inputClass),
272
+ onInput: n[0] || (n[0] = (...u) => e.onInput && e.onInput(...u)),
273
+ onKeydown: n[1] || (n[1] = (...u) => e.onKeydown && e.onKeydown(...u))
274
+ }, null, 42, fe),
275
+ e.$slots.suffix ? (l(), t("span", {
276
+ key: 1,
277
+ class: s(e.styles.suffix)
278
+ }, [
279
+ f(e.$slots, "suffix")
280
+ ], 2)) : r("", !0),
281
+ e.loading ? (l(), t("span", {
282
+ key: 2,
283
+ class: s(e.styles.spinner)
284
+ }, null, 2)) : r("", !0)
285
+ ], 2),
286
+ e.error ? (l(), t("p", {
287
+ key: 1,
288
+ class: s(e.styles.error)
289
+ }, g(e.error), 3)) : r("", !0)
290
+ ], 2);
291
+ }
292
+ const be = /* @__PURE__ */ $(ce, [["render", _e]]);
98
293
  export {
99
- Y as BaseButton
294
+ ye as BaseButton,
295
+ be as BaseInput
100
296
  };
package/dist/ui.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- (function(t,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(t=typeof globalThis<"u"?globalThis:t||self,o(t.ui={},t.Vue))})(this,function(t,o){"use strict";var l=document.createElement("style");l.textContent=`._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(l);const e={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 c=(r=>(r.XS="xs",r.S="s",r.M="m",r.L="l",r.XL="xl",r))(c||{}),i=(r=>(r.PRIMARY="primary",r.DANGER="danger",r.DEFAULT="default",r.TEXT="text",r.LINK="link",r))(i||{});const _=["name","type","disabled"],s=o.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(r,{emit:p}){const n=r,b=p,f=o.computed(()=>[e.button,e[n.size||c.M],e[n.type||i.DEFAULT],{[e.block]:n.block,[e.disabled]:n.disabled||n.loading,[e.loading]:n.loading,[e.active]:n.active,[e.circle]:n.circle,[e.bordered]:n.bordered},n.className]);return(d,a)=>(o.openBlock(),o.createElementBlock("button",{name:n.name,class:o.normalizeClass(f.value),type:n.htmlType,disabled:n.disabled||n.loading,onClick:a[0]||(a[0]=()=>b("click"))},[n.loading?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(o.unref(e).spinner)},null,2)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[n.leftIcon?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass([o.unref(e).icon,o.unref(e).iconLeft])},[o.renderSlot(d.$slots,"leftIcon",{icon:n.leftIcon})],2)):o.createCommentVNode("",!0),d.$slots.default?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(o.unref(e).content)},[o.renderSlot(d.$slots,"default")],2)):o.createCommentVNode("",!0),n.rightIcon?(o.openBlock(),o.createElementBlock("span",{key:2,class:o.normalizeClass([o.unref(e).icon,o.unref(e).iconRight])},[o.renderSlot(d.$slots,"rightIcon",{icon:n.rightIcon})],2)):o.createCommentVNode("",!0)],64))],10,_))}});t.BaseButton=s,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
1
+ (function(t,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(t=typeof globalThis<"u"?globalThis:t||self,o(t.ui={},t.Vue))})(this,function(t,o){"use strict";var b=document.createElement("style");b.textContent=`._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)}}._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)}}
2
+ /*$vite$:1*/`,document.head.appendChild(b);const r={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 c=(e=>(e.XS="xs",e.S="s",e.M="m",e.L="l",e.XL="xl",e))(c||{}),_=(e=>(e.PRIMARY="primary",e.DANGER="danger",e.DEFAULT="default",e.TEXT="text",e.LINK="link",e))(_||{}),u=(e=>(e.SUBMIT="submit",e.BUTTON="button",e.RESET="reset",e))(u||{});const h=o.defineComponent({name:"BaseButton",props:{name:{type:String,required:!1,default:void 0},size:{type:String,default:c.M},className:{type:String,required:!1,default:void 0},type:{type:String,default:_.DEFAULT},leftIcon:{type:Object,required:!1,default:void 0},rightIcon:{type:Object,required:!1,default:void 0},block:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},active:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},bordered:{type:Boolean,default:!1},htmlType:{type:String,default:u.BUTTON}},emits:["click"],setup(e,{emit:n}){return{classList:o.computed(()=>[r.button,r[e.size||c.M],r[e.type||_.DEFAULT],{[r.block]:e.block,[r.disabled]:e.disabled||e.loading,[r.loading]:e.loading,[r.active]:e.active,[r.circle]:e.circle,[r.bordered]:e.bordered},e.className]),handleClick:()=>{n("click")},styles:r}}}),g=(e,n)=>{const l=e.__vccOpts||e;for(const[i,a]of n)l[i]=a;return l},w=["name","type","disabled"];function y(e,n,l,i,a,f){return o.openBlock(),o.createElementBlock("button",{name:e.name,class:o.normalizeClass(e.classList),type:e.htmlType,disabled:e.disabled||e.loading,onClick:n[0]||(n[0]=(...s)=>e.handleClick&&e.handleClick(...s))},[e.loading?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(e.styles.spinner)},null,2)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[e.leftIcon?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass([e.styles.icon,e.styles.iconLeft])},[o.renderSlot(e.$slots,"leftIcon",{icon:e.leftIcon})],2)):o.createCommentVNode("",!0),e.$slots.default?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(e.styles.content)},[o.renderSlot(e.$slots,"default")],2)):o.createCommentVNode("",!0),e.rightIcon?(o.openBlock(),o.createElementBlock("span",{key:2,class:o.normalizeClass([e.styles.icon,e.styles.iconRight])},[o.renderSlot(e.$slots,"rightIcon",{icon:e.rightIcon})],2)):o.createCommentVNode("",!0)],64))],10,w)}const k=g(h,[["render",y]]),d={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 p=(e=>(e.XS="xs",e.S="s",e.M="m",e.L="l",e.XL="xl",e))(p||{}),m=(e=>(e.TEXT="text",e.PASSWORD="password",e.EMAIL="email",e.TEL="tel",e.SEARCH="search",e))(m||{});const x=o.defineComponent({name:"BaseInput",props:{value:{type:String,required:!0},type:{type:String,default:m.TEXT},id:{type:String,required:!1,default:void 0},name:{type:String,required:!1,default:void 0},disabled:{type:Boolean,default:!1},label:{type:String,required:!1,default:void 0},placeholder:{type:String,required:!1,default:void 0},loading:{type:Boolean,default:!1},error:{type:String,required:!1,default:void 0},size:{type:String,default:p.M},className:{type:String,required:!1,default:void 0}},emits:["update:value","enter"],setup(e,{emit:n}){const l=()=>{n("update:value")},i=f=>{f.key==="Enter"&&n("enter")},a=o.computed(()=>[d.input,d[e.size||p.M],{[d.disabled]:e.disabled,[d.error]:e.error,[d.loading]:e.loading},e.className]);return{styles:d,onInput:l,onKeydown:i,inputClass:a}}}),$=["for"],C=["id","value","name","type","disabled","placeholder"];function E(e,n,l,i,a,f){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(e.styles.wrapper)},[e.label?(o.openBlock(),o.createElementBlock("label",{key:0,for:e.id,class:o.normalizeClass(e.styles.label)},o.toDisplayString(e.label),11,$)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(e.styles.container)},[e.$slots.prefix?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(e.styles.prefix)},[o.renderSlot(e.$slots,"prefix")],2)):o.createCommentVNode("",!0),o.createElementVNode("input",{id:e.id,value:e.value,name:e.name,type:e.type||"text",disabled:e.disabled||e.loading,placeholder:e.placeholder,class:o.normalizeClass(e.inputClass),onInput:n[0]||(n[0]=(...s)=>e.onInput&&e.onInput(...s)),onKeydown:n[1]||(n[1]=(...s)=>e.onKeydown&&e.onKeydown(...s))},null,42,C),e.$slots.suffix?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(e.styles.suffix)},[o.renderSlot(e.$slots,"suffix")],2)):o.createCommentVNode("",!0),e.loading?(o.openBlock(),o.createElementBlock("span",{key:2,class:o.normalizeClass(e.styles.spinner)},null,2)):o.createCommentVNode("",!0)],2),e.error?(o.openBlock(),o.createElementBlock("p",{key:1,class:o.normalizeClass(e.styles.error)},o.toDisplayString(e.error),3)):o.createCommentVNode("",!0)],2)}const S=g(x,[["render",E]]);t.BaseButton=k,t.BaseInput=S,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -2,8 +2,7 @@
2
2
  "name": "@huntflow/ui",
3
3
  "description": "HuntFlow UiKit, icons, utils library",
4
4
  "private": false,
5
- "version": "0.0.35",
6
- "types": "./dist/index.d.ts",
5
+ "version": "0.0.37",
7
6
  "author": {
8
7
  "name": "HuntFlow Developer",
9
8
  "nickname": "developer",
@@ -13,6 +12,16 @@
13
12
  "main": "./dist/ui.umd.js",
14
13
  "module": "./dist/ui.es.js",
15
14
  "typings": "./dist/index.d.ts",
15
+
16
+ "types": "./dist/index.d.ts",
17
+ "exports": {
18
+ ".": {
19
+ "import": "./dist/ui.es.js",
20
+ "require": "./dist/ui.umd.js",
21
+ "types": "./dist/index.d.ts"
22
+ }
23
+ },
24
+
16
25
  "styles": "./dist/style.css",
17
26
  "files": [
18
27
  "dist",
@@ -1,31 +0,0 @@
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
- };
@@ -1,4 +0,0 @@
1
- import { default as BaseButton } from './button';
2
- import { BaseButtonProps } from './types';
3
- export default BaseButton;
4
- export type { BaseButtonProps };