@huntflow/ui 0.0.46 → 0.0.47

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.
@@ -1,28 +1,21 @@
1
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: (...args: any[]) => void;
2
+ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<BaseButtonProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
3
+ click: () => any;
22
4
  }, string, import('vue').PublicProps, Readonly<BaseButtonProps> & Readonly<{
23
- onClick?: ((...args: any[]) => any) | undefined;
24
- }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
25
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
5
+ onClick?: (() => any) | undefined;
6
+ }>, {
7
+ size: import('./types').BaseButtonSize;
8
+ type: import('./types').BaseButtonType;
9
+ disabled: boolean;
10
+ loading: boolean;
11
+ active: boolean;
12
+ circle: boolean;
13
+ bordered: boolean;
14
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, {
15
+ leftIcon?(_: {}): any;
16
+ default?(_: {}): any;
17
+ rightIcon?(_: {}): any;
18
+ }>;
26
19
  export default _default;
27
20
  type __VLS_WithTemplateSlots<T, S> = T & {
28
21
  new (): {
@@ -1,10 +1,7 @@
1
- import { VNode } from 'vue';
2
1
  export type BaseButtonProps = {
3
2
  size?: BaseButtonSize;
4
3
  className?: string;
5
4
  type?: BaseButtonType;
6
- leftIcon?: VNode;
7
- rightIcon?: VNode;
8
5
  block?: boolean;
9
6
  disabled?: boolean;
10
7
  loading?: boolean;
@@ -1,5 +1,4 @@
1
1
  type Props = {
2
- checked: boolean;
3
2
  id?: string;
4
3
  name?: string;
5
4
  disabled?: boolean;
@@ -7,22 +6,17 @@ type Props = {
7
6
  error?: string | null | void;
8
7
  className?: string;
9
8
  };
10
- declare function __VLS_template(): {
11
- slots: {
12
- default?(_: {}): any;
13
- };
14
- refs: {};
15
- attrs: Partial<{}>;
16
- };
17
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
18
- declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
19
- "update:checked": (...args: any[]) => void;
20
- change: (...args: any[]) => void;
21
- }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
22
- "onUpdate:checked"?: ((...args: any[]) => any) | undefined;
23
- onChange?: ((...args: any[]) => any) | undefined;
24
- }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
25
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
9
+ declare let __VLS_typeProps: Props;
10
+ type __VLS_PublicProps = {
11
+ 'checked'?: boolean;
12
+ } & typeof __VLS_typeProps;
13
+ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
14
+ "update:checked": (checked: boolean) => any;
15
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
16
+ "onUpdate:checked"?: ((checked: boolean) => any) | undefined;
17
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, {
18
+ default?(_: {}): any;
19
+ }>;
26
20
  export default _default;
27
21
  type __VLS_WithTemplateSlots<T, S> = T & {
28
22
  new (): {
@@ -1,21 +1,23 @@
1
1
  import { BaseInputProps } from './types';
2
- declare function __VLS_template(): {
3
- slots: {
4
- prefix?(_: {}): any;
5
- suffix?(_: {}): any;
6
- };
7
- refs: {};
8
- attrs: Partial<{}>;
9
- };
10
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
11
- declare const __VLS_component: import('vue').DefineComponent<BaseInputProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
12
- "update:value": (...args: any[]) => void;
13
- enter: (...args: any[]) => void;
14
- }, string, import('vue').PublicProps, Readonly<BaseInputProps> & Readonly<{
15
- "onUpdate:value"?: ((...args: any[]) => any) | undefined;
16
- onEnter?: ((...args: any[]) => any) | undefined;
17
- }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
18
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
2
+ declare let __VLS_typeProps: BaseInputProps;
3
+ type __VLS_PublicProps = {
4
+ 'value'?: string;
5
+ } & typeof __VLS_typeProps;
6
+ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
+ "update:value": (value: string) => any;
8
+ } & {
9
+ "update:value": (value: string) => any;
10
+ enter: () => any;
11
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
12
+ "onUpdate:value"?: ((value: string) => any) | undefined;
13
+ onEnter?: (() => any) | undefined;
14
+ }>, {
15
+ size: import('./types').BaseInputSize;
16
+ type: import('./types').BaseInputType;
17
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, {
18
+ prefix?(_: {}): any;
19
+ suffix?(_: {}): any;
20
+ }>;
19
21
  export default _default;
20
22
  type __VLS_WithTemplateSlots<T, S> = T & {
21
23
  new (): {
@@ -1,33 +1,25 @@
1
1
  import { BaseSelectProps } from './types.ts';
2
- declare function __VLS_template(): {
3
- slots: {
4
- icon?(_: {
5
- icon: import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
6
- [key: string]: any;
7
- }>;
8
- }): any;
9
- icon?(_: {
10
- icon: import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
11
- [key: string]: any;
12
- }>;
13
- }): any;
14
- };
15
- refs: {
16
- "base-select": HTMLDivElement;
17
- };
18
- attrs: Partial<{}>;
19
- };
20
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
21
- declare const __VLS_component: import('vue').DefineComponent<BaseSelectProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
22
- "update:value": (...args: any[]) => void;
23
- change: (...args: any[]) => void;
2
+ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<BaseSelectProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
3
+ "update:value": (value: string | number) => any;
24
4
  }, string, import('vue').PublicProps, Readonly<BaseSelectProps> & Readonly<{
25
- "onUpdate:value"?: ((...args: any[]) => any) | undefined;
26
- onChange?: ((...args: any[]) => any) | undefined;
27
- }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
5
+ "onUpdate:value"?: ((value: string | number) => any) | undefined;
6
+ }>, {
7
+ size: import('./types.ts').BaseSelectSize;
8
+ placeholder: string;
9
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
28
10
  "base-select": HTMLDivElement;
29
- }, any>;
30
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
11
+ }, any>, {
12
+ icon?(_: {
13
+ icon: import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
14
+ [key: string]: any;
15
+ }>;
16
+ }): any;
17
+ icon?(_: {
18
+ icon: import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
19
+ [key: string]: any;
20
+ }>;
21
+ }): any;
22
+ }>;
31
23
  export default _default;
32
24
  type __VLS_WithTemplateSlots<T, S> = T & {
33
25
  new (): {
@@ -2,6 +2,7 @@ import { VNode } from 'vue';
2
2
  export type BaseSelectProps = {
3
3
  value?: number | string | null;
4
4
  name?: string;
5
+ placeholder?: string;
5
6
  label?: string;
6
7
  size?: BaseSelectSize;
7
8
  className?: string;
package/dist/ui.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
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_d4llw_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_d4llw_1:focus{outline:none}._primary_d4llw_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_d4llw_19:hover{background-color:var(--hf-button-primary-hover-background-color)}._primary_d4llw_19:focus{box-shadow:0 0 0 3px var(--hf-button-primary-focus-color)}._primary_d4llw_19._bordered_d4llw_34{background-color:#fff;color:var(--hf-button-primary-background-color);border:1px solid var(--hf-button-primary-background-color)}._danger_d4llw_40{color:var(--hf-button-danger-text-color);background-color:var(--hf-button-danger-background-color)}._danger_d4llw_40:hover{background-color:var(--hf-button-danger-hover-background-color)}._danger_d4llw_40:focus{box-shadow:0 0 0 3px var(--hf-button-danger-focus-color)}._danger_d4llw_40._bordered_d4llw_34{background-color:#fff;color:var(--hf-button-danger-background-color);border:1px solid var(--hf-button-danger-background-color)}._default_d4llw_59{background-color:#fff;color:var(--hf-button-default-text-color);border:1px solid var(--hf-button-default-border-color)}._default_d4llw_59:hover{background-color:var(--hf-button-default-hover-background-color)}._default_d4llw_59:focus{box-shadow:0 0 0 3px var(--hf-button-default-focus-color)}._link_d4llw_73{background-color:#fff;color:#007bff;text-decoration:underline}._block_d4llw_79{width:100%}._disabled_d4llw_83{background-color:#e9ecef;color:#6c757d;cursor:not-allowed}._disabled_d4llw_83:hover{background-color:inherit}._loading_d4llw_93{cursor:wait}._loading_d4llw_93 ._content_d4llw_96{visibility:hidden}._circle_d4llw_101{border-radius:100%;padding:0!important}._bordered_d4llw_34{border:1px solid currentColor}._icon_d4llw_110{display:flex;align-items:center}._iconLeft_d4llw_115{margin-right:8px}._iconRight_d4llw_119{margin-left:8px}._xs_d4llw_123{padding:4px 8px;font-size:12px}._s_d4llw_128{padding:6px 12px;font-size:14px;line-height:20px}._m_d4llw_134{padding:6px 12px;font-size:15px;line-height:24px}._l_d4llw_73{padding:16px 32px;font-size:18px}._xl_d4llw_145{padding:20px 40px;font-size:20px}._loadingWrapper_d4llw_150{width:100%;height:100%;position:absolute;left:0;right:0;display:flex;align-items:center;justify-content:center}._loadingWrapper_d4llw_150 ._spinner_d4llw_161{display:inline-block;position:absolute;right:0;left:0;margin:0 auto;width:16px;height:16px;border:2px solid rgba(0,0,0,.05);border-top-color:#fff;border-radius:50%;animation:_spin_d4llw_161 .6s linear infinite}@keyframes _spin_d4llw_161{to{transform:rotate(360deg)}}._wrapper_f5n0f_1{display:flex;flex-direction:column}._label_f5n0f_6{margin-bottom:4px;font-size:15px;font-weight:500;line-height:20px}._container_f5n0f_13{position:relative;display:flex;align-items:center}._input_f5n0f_19{flex:1;padding:8px 12px;font-size:15px;line-height:24px;border:1px solid #00000029;border-radius:12px;outline:none;transition:border-color .3s}._input_f5n0f_19._error_f5n0f_29{border:1px solid #FF0000}._input_f5n0f_19._error_f5n0f_29:focus{outline:3px solid #FFD6D6}._input_f5n0f_19:focus{outline:3px solid #C4EDFA}._xs_f5n0f_41{padding:4px 8px;font-size:12px}._s_f5n0f_46{padding:6px 10px;font-size:13px}._m_f5n0f_51{padding:8px 12px;font-size:14px}._l_f5n0f_6{padding:10px 14px;font-size:16px}._xl_f5n0f_61{padding:12px 16px;font-size:18px}._disabled_f5n0f_66{background-color:#e9ecef;cursor:not-allowed}._errorText_f5n0f_71{margin-top:4px;font-size:14px;line-height:20px;color:red}._prefix_f5n0f_78,._suffix_f5n0f_79{position:absolute;display:flex;align-items:center;color:#6c757d}._prefix_f5n0f_78{left:8px}._suffix_f5n0f_79{right:8px}._loading_f5n0f_94{cursor:wait}._spinner_f5n0f_98{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_f5n0f_98 .6s linear infinite}@keyframes _spin_f5n0f_98{to{transform:rotate(360deg)}}")),document.head.appendChild(o)}}catch(n){console.error("vite-plugin-css-injected-by-js",n)}})();
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),p="_button_d4llw_1",_="_primary_d4llw_19",f="_bordered_d4llw_34",m="_danger_d4llw_40",u="_link_d4llw_73",b="_block_d4llw_79",k="_disabled_d4llw_83",y="_loading_d4llw_93",g="_content_d4llw_96",B="_circle_d4llw_101",C="_icon_d4llw_110",w="_iconLeft_d4llw_115",h="_iconRight_d4llw_119",$="_xs_d4llw_123",v="_s_d4llw_128",z="_m_d4llw_134",N="_l_d4llw_73",E="_xl_d4llw_145",V="_loadingWrapper_d4llw_150",I="_spinner_d4llw_161",S="_spin_d4llw_161",l={button:p,primary:_,bordered:f,danger:m,default:"_default_d4llw_59",link:u,block:b,disabled:k,loading:y,content:g,circle:B,icon:C,iconLeft:w,iconRight:h,xs:$,s:v,m:z,l:N,xl:E,loadingWrapper:V,spinner:I,spin:S},T=["name","type","disabled"],L=e.defineComponent({__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(a,{emit:i}){const o=a,r=i,c=e.computed(()=>[l.button,l[o.size||"m"],l[o.type||"default"],{[l.block]:o.block,[l.disabled]:o.disabled,[l.loading]:o.loading,[l.active]:o.active,[l.circle]:o.circle,[l.bordered]:o.bordered},o.className]),d=()=>{r("click")};return(s,n)=>(e.openBlock(),e.createElementBlock("button",{name:s.name,class:e.normalizeClass(c.value),type:s.htmlType,disabled:s.disabled||s.loading,onClick:d},[s.loading?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(l).loadingWrapper)},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(l).spinner)},null,2)],2)):e.createCommentVNode("",!0),e.createElementVNode("div",null,[s.leftIcon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass([e.unref(l).icon,e.unref(l).iconLeft])},[e.renderSlot(s.$slots,"leftIcon",{icon:s.leftIcon})],2)):e.createCommentVNode("",!0),s.$slots.default?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(l).content)},[e.renderSlot(s.$slots,"default")],2)):e.createCommentVNode("",!0),s.rightIcon?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass([e.unref(l).icon,e.unref(l).iconRight])},[e.renderSlot(s.$slots,"rightIcon",{icon:s.rightIcon})],2)):e.createCommentVNode("",!0)])],10,T))}}),R="_wrapper_f5n0f_1",W="_label_f5n0f_6",D="_container_f5n0f_13",j="_input_f5n0f_19",q="_error_f5n0f_29",x="_xs_f5n0f_41",K="_s_f5n0f_46",M="_m_f5n0f_51",O="_l_f5n0f_6",P="_xl_f5n0f_61",A="_disabled_f5n0f_66",F="_errorText_f5n0f_71",G="_prefix_f5n0f_78",H="_suffix_f5n0f_79",J="_loading_f5n0f_94",Q="_spinner_f5n0f_98",U="_spin_f5n0f_98",t={wrapper:R,label:W,container:D,input:j,error:q,xs:x,s:K,m:M,l:O,xl:P,disabled:A,errorText:F,prefix:G,suffix:H,loading:J,spinner:Q,spin:U},X=["for"],Y=["id","value","name","type","disabled","placeholder"],Z=e.defineComponent({__name:"input",props:{value:{},type:{},id:{},name:{},disabled:{type:Boolean},label:{},placeholder:{},loading:{type:Boolean},error:{},size:{},className:{}},emits:["update:value","enter"],setup(a,{emit:i}){const o=a,r=i,c=e.computed(()=>[t.input,t[o.size||"m"],{[t.disabled]:o.disabled,[t.error]:o.error,[t.loading]:o.loading},o.className]),d=n=>{r("update:value",n.target.value)},s=n=>{n.key==="Enter"&&r("enter")};return(n,ee)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(t).wrapper)},[n.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:n.id,class:e.normalizeClass(e.unref(t).label)},e.toDisplayString(n.label),11,X)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(t).container)},[n.$slots.prefix?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(t).prefix)},[e.renderSlot(n.$slots,"prefix")],2)):e.createCommentVNode("",!0),e.createElementVNode("input",{id:n.id,value:n.value,name:n.name,type:n.type||"text",disabled:n.disabled||n.loading,placeholder:n.placeholder,class:e.normalizeClass(c.value),onInput:d,onKeydown:s},null,42,Y),n.$slots.suffix?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(t).suffix)},[e.renderSlot(n.$slots,"suffix")],2)):e.createCommentVNode("",!0),n.loading?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(e.unref(t).spinner)},null,2)):e.createCommentVNode("",!0)],2),n.error?(e.openBlock(),e.createElementBlock("p",{key:1,class:e.normalizeClass(e.unref(t).errorText)},e.toDisplayString(n.error),3)):e.createCommentVNode("",!0)],2))}});exports.BaseButton=L;exports.BaseInput=Z;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u="_button_d4llw_1",m="_primary_d4llw_19",b="_bordered_d4llw_34",k="_danger_d4llw_40",y="_link_d4llw_73",g="_block_d4llw_79",B="_disabled_d4llw_83",w="_loading_d4llw_93",v="_content_d4llw_96",C="_circle_d4llw_101",$="_icon_d4llw_110",z="_iconLeft_d4llw_115",N="_iconRight_d4llw_119",E="_xs_d4llw_123",h="_s_d4llw_128",V="_m_d4llw_134",S="_l_d4llw_73",T="_xl_d4llw_145",x="_loadingWrapper_d4llw_150",M="_spinner_d4llw_161",I="_spin_d4llw_161",n={button:u,primary:m,bordered:b,danger:k,default:"_default_d4llw_59",link:y,block:g,disabled:B,loading:w,content:v,circle:C,icon:$,iconLeft:z,iconRight:N,xs:E,s:h,m:V,l:S,xl:T,loadingWrapper:x,spinner:M,spin:I},L=["name","type","disabled"],D=e.defineComponent({__name:"button",props:{size:{default:"m"},className:{},type:{default:"default"},block:{type:Boolean},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},active:{type:Boolean,default:!1},name:{},circle:{type:Boolean,default:!1},bordered:{type:Boolean,default:!1},htmlType:{}},emits:["click"],setup(r){const t=r,i=e.computed(()=>[n.button,n[t.size],n[t.type],{[n.block]:t.block,[n.disabled]:t.disabled,[n.loading]:t.loading,[n.active]:t.active,[n.circle]:t.circle,[n.bordered]:t.bordered},t.className]);return(o,a)=>(e.openBlock(),e.createElementBlock("button",{name:o.name,class:e.normalizeClass(i.value),type:o.htmlType,disabled:o.disabled,onClick:a[0]||(a[0]=d=>o.$emit("click"))},[o.loading?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(n).loadingWrapper)},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(n).spinner)},null,2)],2)):e.createCommentVNode("",!0),e.createElementVNode("div",null,[e.createElementVNode("span",{class:e.normalizeClass([e.unref(n).icon,e.unref(n).iconLeft])},[e.renderSlot(o.$slots,"leftIcon")],2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(n).content)},[e.renderSlot(o.$slots,"default")],2),o.$slots.rightIcon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass([e.unref(n).icon,e.unref(n).iconRight])},[e.renderSlot(o.$slots,"rightIcon")],2)):e.createCommentVNode("",!0)])],10,L))}}),R="_wrapper_f5n0f_1",W="_label_f5n0f_6",j="_container_f5n0f_13",q="_input_f5n0f_19",K="_error_f5n0f_29",O="_xs_f5n0f_41",P="_s_f5n0f_46",U="_m_f5n0f_51",A="_l_f5n0f_6",F="_xl_f5n0f_61",G="_disabled_f5n0f_66",H="_errorText_f5n0f_71",J="_prefix_f5n0f_78",Q="_suffix_f5n0f_79",X="_loading_f5n0f_94",Y="_spinner_f5n0f_98",Z="_spin_f5n0f_98",s={wrapper:R,label:W,container:j,input:q,error:K,xs:O,s:P,m:U,l:A,xl:F,disabled:G,errorText:H,prefix:J,suffix:Q,loading:X,spinner:Y,spin:Z},ee=["for"],le=["id","name","type","disabled","placeholder"],ne=e.defineComponent({__name:"input",props:e.mergeModels({value:{},type:{default:"text"},id:{},name:{},disabled:{type:Boolean},label:{},placeholder:{},loading:{type:Boolean},error:{},size:{default:"m"},className:{}},{value:{},valueModifiers:{}}),emits:e.mergeModels(["update:value","enter"],["update:value"]),setup(r,{emit:t}){const i=e.useModel(r,"value"),o=r,a=t,d=e.computed(()=>[s.input,s[o.size],{[s.disabled]:o.disabled,[s.error]:o.error,[s.loading]:o.loading},o.className]),p=l=>{a("update:value",l.target.value)},_=l=>{l.key==="Enter"&&a("enter")};return(l,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(s).wrapper)},[l.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:l.id,class:e.normalizeClass(e.unref(s).label)},e.toDisplayString(l.label),11,ee)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(s).container)},[l.$slots.prefix?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(s).prefix)},[e.renderSlot(l.$slots,"prefix")],2)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{id:l.id,"onUpdate:modelValue":c[0]||(c[0]=f=>i.value=f),name:l.name,type:l.type,disabled:l.disabled||l.loading,placeholder:l.placeholder,class:e.normalizeClass(d.value),onInput:p,onKeydown:_},null,42,le),[[e.vModelDynamic,i.value]]),l.$slots.suffix?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(s).suffix)},[e.renderSlot(l.$slots,"suffix")],2)):e.createCommentVNode("",!0),l.loading?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(e.unref(s).spinner)},null,2)):e.createCommentVNode("",!0)],2),l.error?(e.openBlock(),e.createElementBlock("p",{key:1,class:e.normalizeClass(e.unref(s).errorText)},e.toDisplayString(l.error),3)):e.createCommentVNode("",!0)],2))}});exports.BaseButton=D;exports.BaseInput=ne;
package/dist/ui.es.js CHANGED
@@ -1,123 +1,117 @@
1
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_d4llw_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_d4llw_1:focus{outline:none}._primary_d4llw_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_d4llw_19:hover{background-color:var(--hf-button-primary-hover-background-color)}._primary_d4llw_19:focus{box-shadow:0 0 0 3px var(--hf-button-primary-focus-color)}._primary_d4llw_19._bordered_d4llw_34{background-color:#fff;color:var(--hf-button-primary-background-color);border:1px solid var(--hf-button-primary-background-color)}._danger_d4llw_40{color:var(--hf-button-danger-text-color);background-color:var(--hf-button-danger-background-color)}._danger_d4llw_40:hover{background-color:var(--hf-button-danger-hover-background-color)}._danger_d4llw_40:focus{box-shadow:0 0 0 3px var(--hf-button-danger-focus-color)}._danger_d4llw_40._bordered_d4llw_34{background-color:#fff;color:var(--hf-button-danger-background-color);border:1px solid var(--hf-button-danger-background-color)}._default_d4llw_59{background-color:#fff;color:var(--hf-button-default-text-color);border:1px solid var(--hf-button-default-border-color)}._default_d4llw_59:hover{background-color:var(--hf-button-default-hover-background-color)}._default_d4llw_59:focus{box-shadow:0 0 0 3px var(--hf-button-default-focus-color)}._link_d4llw_73{background-color:#fff;color:#007bff;text-decoration:underline}._block_d4llw_79{width:100%}._disabled_d4llw_83{background-color:#e9ecef;color:#6c757d;cursor:not-allowed}._disabled_d4llw_83:hover{background-color:inherit}._loading_d4llw_93{cursor:wait}._loading_d4llw_93 ._content_d4llw_96{visibility:hidden}._circle_d4llw_101{border-radius:100%;padding:0!important}._bordered_d4llw_34{border:1px solid currentColor}._icon_d4llw_110{display:flex;align-items:center}._iconLeft_d4llw_115{margin-right:8px}._iconRight_d4llw_119{margin-left:8px}._xs_d4llw_123{padding:4px 8px;font-size:12px}._s_d4llw_128{padding:6px 12px;font-size:14px;line-height:20px}._m_d4llw_134{padding:6px 12px;font-size:15px;line-height:24px}._l_d4llw_73{padding:16px 32px;font-size:18px}._xl_d4llw_145{padding:20px 40px;font-size:20px}._loadingWrapper_d4llw_150{width:100%;height:100%;position:absolute;left:0;right:0;display:flex;align-items:center;justify-content:center}._loadingWrapper_d4llw_150 ._spinner_d4llw_161{display:inline-block;position:absolute;right:0;left:0;margin:0 auto;width:16px;height:16px;border:2px solid rgba(0,0,0,.05);border-top-color:#fff;border-radius:50%;animation:_spin_d4llw_161 .6s linear infinite}@keyframes _spin_d4llw_161{to{transform:rotate(360deg)}}._wrapper_f5n0f_1{display:flex;flex-direction:column}._label_f5n0f_6{margin-bottom:4px;font-size:15px;font-weight:500;line-height:20px}._container_f5n0f_13{position:relative;display:flex;align-items:center}._input_f5n0f_19{flex:1;padding:8px 12px;font-size:15px;line-height:24px;border:1px solid #00000029;border-radius:12px;outline:none;transition:border-color .3s}._input_f5n0f_19._error_f5n0f_29{border:1px solid #FF0000}._input_f5n0f_19._error_f5n0f_29:focus{outline:3px solid #FFD6D6}._input_f5n0f_19:focus{outline:3px solid #C4EDFA}._xs_f5n0f_41{padding:4px 8px;font-size:12px}._s_f5n0f_46{padding:6px 10px;font-size:13px}._m_f5n0f_51{padding:8px 12px;font-size:14px}._l_f5n0f_6{padding:10px 14px;font-size:16px}._xl_f5n0f_61{padding:12px 16px;font-size:18px}._disabled_f5n0f_66{background-color:#e9ecef;cursor:not-allowed}._errorText_f5n0f_71{margin-top:4px;font-size:14px;line-height:20px;color:red}._prefix_f5n0f_78,._suffix_f5n0f_79{position:absolute;display:flex;align-items:center;color:#6c757d}._prefix_f5n0f_78{left:8px}._suffix_f5n0f_79{right:8px}._loading_f5n0f_94{cursor:wait}._spinner_f5n0f_98{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_f5n0f_98 .6s linear infinite}@keyframes _spin_f5n0f_98{to{transform:rotate(360deg)}}")),document.head.appendChild(o)}}catch(n){console.error("vite-plugin-css-injected-by-js",n)}})();
2
- import { defineComponent as g, computed as w, openBlock as i, createElementBlock as r, normalizeClass as o, unref as t, createElementVNode as p, createCommentVNode as d, renderSlot as c, toDisplayString as y } from "vue";
3
- const k = "_button_d4llw_1", h = "_primary_d4llw_19", $ = "_bordered_d4llw_34", v = "_danger_d4llw_40", B = "_link_d4llw_73", I = "_block_d4llw_79", C = "_disabled_d4llw_83", N = "_loading_d4llw_93", T = "_content_d4llw_96", z = "_circle_d4llw_101", L = "_icon_d4llw_110", R = "_iconLeft_d4llw_115", W = "_iconRight_d4llw_119", E = "_xs_d4llw_123", x = "_s_d4llw_128", S = "_m_d4llw_134", V = "_l_d4llw_73", D = "_xl_d4llw_145", K = "_loadingWrapper_d4llw_150", j = "_spinner_d4llw_161", q = "_spin_d4llw_161", n = {
4
- button: k,
5
- primary: h,
6
- bordered: $,
7
- danger: v,
2
+ import { defineComponent as w, computed as v, openBlock as i, createElementBlock as r, normalizeClass as s, unref as o, createElementVNode as c, createCommentVNode as d, renderSlot as p, mergeModels as y, useModel as B, toDisplayString as g, withDirectives as x, vModelDynamic as N } from "vue";
3
+ const T = "_button_d4llw_1", z = "_primary_d4llw_19", C = "_bordered_d4llw_34", I = "_danger_d4llw_40", L = "_link_d4llw_73", M = "_block_d4llw_79", R = "_disabled_d4llw_83", W = "_loading_d4llw_93", D = "_content_d4llw_96", E = "_circle_d4llw_101", V = "_icon_d4llw_110", S = "_iconLeft_d4llw_115", K = "_iconRight_d4llw_119", U = "_xs_d4llw_123", j = "_s_d4llw_128", q = "_m_d4llw_134", A = "_l_d4llw_73", F = "_xl_d4llw_145", G = "_loadingWrapper_d4llw_150", H = "_spinner_d4llw_161", J = "_spin_d4llw_161", l = {
4
+ button: T,
5
+ primary: z,
6
+ bordered: C,
7
+ danger: I,
8
8
  default: "_default_d4llw_59",
9
- link: B,
10
- block: I,
11
- disabled: C,
12
- loading: N,
13
- content: T,
14
- circle: z,
15
- icon: L,
16
- iconLeft: R,
17
- iconRight: W,
18
- xs: E,
19
- s: x,
20
- m: S,
21
- l: V,
22
- xl: D,
23
- loadingWrapper: K,
24
- spinner: j,
25
- spin: q
26
- }, A = ["name", "type", "disabled"], de = /* @__PURE__ */ g({
9
+ link: L,
10
+ block: M,
11
+ disabled: R,
12
+ loading: W,
13
+ content: D,
14
+ circle: E,
15
+ icon: V,
16
+ iconLeft: S,
17
+ iconRight: K,
18
+ xs: U,
19
+ s: j,
20
+ m: q,
21
+ l: A,
22
+ xl: F,
23
+ loadingWrapper: G,
24
+ spinner: H,
25
+ spin: J
26
+ }, O = ["name", "type", "disabled"], me = /* @__PURE__ */ w({
27
27
  __name: "button",
28
28
  props: {
29
- size: {},
29
+ size: { default: "m" },
30
30
  className: {},
31
- type: {},
32
- leftIcon: {},
33
- rightIcon: {},
31
+ type: { default: "default" },
34
32
  block: { type: Boolean },
35
- disabled: { type: Boolean },
36
- loading: { type: Boolean },
37
- active: { type: Boolean },
33
+ disabled: { type: Boolean, default: !1 },
34
+ loading: { type: Boolean, default: !1 },
35
+ active: { type: Boolean, default: !1 },
38
36
  name: {},
39
- circle: { type: Boolean },
40
- bordered: { type: Boolean },
37
+ circle: { type: Boolean, default: !1 },
38
+ bordered: { type: Boolean, default: !1 },
41
39
  htmlType: {}
42
40
  },
43
41
  emits: ["click"],
44
- setup(f, { emit: u }) {
45
- const l = f, _ = u, b = w(() => [
46
- n.button,
47
- n[l.size || "m"],
48
- n[l.type || "default"],
42
+ setup(f) {
43
+ const a = f, u = v(() => [
44
+ l.button,
45
+ l[a.size],
46
+ l[a.type],
49
47
  {
50
- [n.block]: l.block,
51
- [n.disabled]: l.disabled,
52
- [n.loading]: l.loading,
53
- [n.active]: l.active,
54
- [n.circle]: l.circle,
55
- [n.bordered]: l.bordered
48
+ [l.block]: a.block,
49
+ [l.disabled]: a.disabled,
50
+ [l.loading]: a.loading,
51
+ [l.active]: a.active,
52
+ [l.circle]: a.circle,
53
+ [l.bordered]: a.bordered
56
54
  },
57
- l.className
58
- ]), m = () => {
59
- _("click");
60
- };
61
- return (s, e) => (i(), r("button", {
62
- name: s.name,
63
- class: o(b.value),
64
- type: s.htmlType,
65
- disabled: s.disabled || s.loading,
66
- onClick: m
55
+ a.className
56
+ ]);
57
+ return (n, _) => (i(), r("button", {
58
+ name: n.name,
59
+ class: s(u.value),
60
+ type: n.htmlType,
61
+ disabled: n.disabled,
62
+ onClick: _[0] || (_[0] = (m) => n.$emit("click"))
67
63
  }, [
68
- s.loading ? (i(), r("div", {
64
+ n.loading ? (i(), r("div", {
69
65
  key: 0,
70
- class: o(t(n).loadingWrapper)
66
+ class: s(o(l).loadingWrapper)
71
67
  }, [
72
- p("span", {
73
- class: o(t(n).spinner)
68
+ c("span", {
69
+ class: s(o(l).spinner)
74
70
  }, null, 2)
75
71
  ], 2)) : d("", !0),
76
- p("div", null, [
77
- s.leftIcon ? (i(), r("span", {
78
- key: 0,
79
- class: o([t(n).icon, t(n).iconLeft])
72
+ c("div", null, [
73
+ c("span", {
74
+ class: s([o(l).icon, o(l).iconLeft])
80
75
  }, [
81
- c(s.$slots, "leftIcon", { icon: s.leftIcon })
82
- ], 2)) : d("", !0),
83
- s.$slots.default ? (i(), r("span", {
84
- key: 1,
85
- class: o(t(n).content)
76
+ p(n.$slots, "leftIcon")
77
+ ], 2),
78
+ c("span", {
79
+ class: s(o(l).content)
86
80
  }, [
87
- c(s.$slots, "default")
88
- ], 2)) : d("", !0),
89
- s.rightIcon ? (i(), r("span", {
90
- key: 2,
91
- class: o([t(n).icon, t(n).iconRight])
81
+ p(n.$slots, "default")
82
+ ], 2),
83
+ n.$slots.rightIcon ? (i(), r("span", {
84
+ key: 0,
85
+ class: s([o(l).icon, o(l).iconRight])
92
86
  }, [
93
- c(s.$slots, "rightIcon", { icon: s.rightIcon })
87
+ p(n.$slots, "rightIcon")
94
88
  ], 2)) : d("", !0)
95
89
  ])
96
- ], 10, A));
90
+ ], 10, O));
97
91
  }
98
- }), F = "_wrapper_f5n0f_1", G = "_label_f5n0f_6", H = "_container_f5n0f_13", J = "_input_f5n0f_19", M = "_error_f5n0f_29", O = "_xs_f5n0f_41", P = "_s_f5n0f_46", Q = "_m_f5n0f_51", U = "_l_f5n0f_6", X = "_xl_f5n0f_61", Y = "_disabled_f5n0f_66", Z = "_errorText_f5n0f_71", ee = "_prefix_f5n0f_78", ne = "_suffix_f5n0f_79", le = "_loading_f5n0f_94", se = "_spinner_f5n0f_98", oe = "_spin_f5n0f_98", a = {
99
- wrapper: F,
100
- label: G,
101
- container: H,
102
- input: J,
103
- error: M,
104
- xs: O,
105
- s: P,
106
- m: Q,
107
- l: U,
108
- xl: X,
109
- disabled: Y,
110
- errorText: Z,
111
- prefix: ee,
112
- suffix: ne,
113
- loading: le,
114
- spinner: se,
115
- spin: oe
116
- }, te = ["for"], ae = ["id", "value", "name", "type", "disabled", "placeholder"], ce = /* @__PURE__ */ g({
92
+ }), P = "_wrapper_f5n0f_1", Q = "_label_f5n0f_6", X = "_container_f5n0f_13", Y = "_input_f5n0f_19", Z = "_error_f5n0f_29", ee = "_xs_f5n0f_41", le = "_s_f5n0f_46", ne = "_m_f5n0f_51", se = "_l_f5n0f_6", oe = "_xl_f5n0f_61", te = "_disabled_f5n0f_66", ae = "_errorText_f5n0f_71", ie = "_prefix_f5n0f_78", re = "_suffix_f5n0f_79", de = "_loading_f5n0f_94", ce = "_spinner_f5n0f_98", _e = "_spin_f5n0f_98", t = {
93
+ wrapper: P,
94
+ label: Q,
95
+ container: X,
96
+ input: Y,
97
+ error: Z,
98
+ xs: ee,
99
+ s: le,
100
+ m: ne,
101
+ l: se,
102
+ xl: oe,
103
+ disabled: te,
104
+ errorText: ae,
105
+ prefix: ie,
106
+ suffix: re,
107
+ loading: de,
108
+ spinner: ce,
109
+ spin: _e
110
+ }, pe = ["for"], fe = ["id", "name", "type", "disabled", "placeholder"], be = /* @__PURE__ */ w({
117
111
  __name: "input",
118
- props: {
112
+ props: /* @__PURE__ */ y({
119
113
  value: {},
120
- type: {},
114
+ type: { default: "text" },
121
115
  id: {},
122
116
  name: {},
123
117
  disabled: { type: Boolean },
@@ -125,72 +119,77 @@ const k = "_button_d4llw_1", h = "_primary_d4llw_19", $ = "_bordered_d4llw_34",
125
119
  placeholder: {},
126
120
  loading: { type: Boolean },
127
121
  error: {},
128
- size: {},
122
+ size: { default: "m" },
129
123
  className: {}
130
- },
131
- emits: ["update:value", "enter"],
132
- setup(f, { emit: u }) {
133
- const l = f, _ = u, b = w(() => [
134
- a.input,
135
- a[l.size || "m"],
124
+ }, {
125
+ value: {},
126
+ valueModifiers: {}
127
+ }),
128
+ emits: /* @__PURE__ */ y(["update:value", "enter"], ["update:value"]),
129
+ setup(f, { emit: a }) {
130
+ const u = B(f, "value"), n = f, _ = a, m = v(() => [
131
+ t.input,
132
+ t[n.size],
136
133
  {
137
- [a.disabled]: l.disabled,
138
- [a.error]: l.error,
139
- [a.loading]: l.loading
134
+ [t.disabled]: n.disabled,
135
+ [t.error]: n.error,
136
+ [t.loading]: n.loading
140
137
  },
141
- l.className
142
- ]), m = (e) => {
138
+ n.className
139
+ ]), k = (e) => {
143
140
  _("update:value", e.target.value);
144
- }, s = (e) => {
141
+ }, $ = (e) => {
145
142
  e.key === "Enter" && _("enter");
146
143
  };
147
- return (e, ie) => (i(), r("div", {
148
- class: o(t(a).wrapper)
144
+ return (e, b) => (i(), r("div", {
145
+ class: s(o(t).wrapper)
149
146
  }, [
150
147
  e.label ? (i(), r("label", {
151
148
  key: 0,
152
149
  for: e.id,
153
- class: o(t(a).label)
154
- }, y(e.label), 11, te)) : d("", !0),
155
- p("div", {
156
- class: o(t(a).container)
150
+ class: s(o(t).label)
151
+ }, g(e.label), 11, pe)) : d("", !0),
152
+ c("div", {
153
+ class: s(o(t).container)
157
154
  }, [
158
155
  e.$slots.prefix ? (i(), r("span", {
159
156
  key: 0,
160
- class: o(t(a).prefix)
157
+ class: s(o(t).prefix)
161
158
  }, [
162
- c(e.$slots, "prefix")
159
+ p(e.$slots, "prefix")
163
160
  ], 2)) : d("", !0),
164
- p("input", {
161
+ x(c("input", {
165
162
  id: e.id,
166
- value: e.value,
163
+ "onUpdate:modelValue": b[0] || (b[0] = (h) => u.value = h),
167
164
  name: e.name,
168
- type: e.type || "text",
165
+ type: e.type,
169
166
  disabled: e.disabled || e.loading,
170
167
  placeholder: e.placeholder,
171
- class: o(b.value),
172
- onInput: m,
173
- onKeydown: s
174
- }, null, 42, ae),
168
+ class: s(m.value),
169
+ onInput: k,
170
+ onKeydown: $
171
+ }, null, 42, fe), [
172
+ [N, u.value]
173
+ ]),
175
174
  e.$slots.suffix ? (i(), r("span", {
176
175
  key: 1,
177
- class: o(t(a).suffix)
176
+ class: s(o(t).suffix)
178
177
  }, [
179
- c(e.$slots, "suffix")
178
+ p(e.$slots, "suffix")
180
179
  ], 2)) : d("", !0),
181
180
  e.loading ? (i(), r("span", {
182
181
  key: 2,
183
- class: o(t(a).spinner)
182
+ class: s(o(t).spinner)
184
183
  }, null, 2)) : d("", !0)
185
184
  ], 2),
186
185
  e.error ? (i(), r("p", {
187
186
  key: 1,
188
- class: o(t(a).errorText)
189
- }, y(e.error), 3)) : d("", !0)
187
+ class: s(o(t).errorText)
188
+ }, g(e.error), 3)) : d("", !0)
190
189
  ], 2));
191
190
  }
192
191
  });
193
192
  export {
194
- de as BaseButton,
195
- ce as BaseInput
193
+ me as BaseButton,
194
+ be as BaseInput
196
195
  };
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.46",
5
+ "version": "0.0.47",
6
6
  "author": {
7
7
  "name": "HuntFlow Developer",
8
8
  "nickname": "developer",
@@ -74,7 +74,7 @@
74
74
  "storybook": "^8.4.7",
75
75
  "stylelint": "^16.12.0",
76
76
  "stylelint-config-recommended": "^14.0.1",
77
- "typescript": "~5.6.2",
77
+ "typescript": "~5.4.5",
78
78
  "typescript-eslint": "^8.18.1",
79
79
  "vite": "^5.4.10",
80
80
  "vite-plugin-css-injected-by-js": "^3.5.2",